From f19fc8e12a4e849b83220b3b62b9a3bb9eb8948c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= Date: Thu, 2 Jul 2026 09:15:36 -0500 Subject: [PATCH 1/3] feat: add download response header overrides --- README.md | 9 +- __tests__/_parsed-inputs.ts | 3 + .../commands/delete-copy-presign.test.ts | 32 +- __tests__/commands/upload-download.test.ts | 23 +- __tests__/inputs.test.ts | 15 + action.yml | 7 +- dist/index.js | 18106 +++++----------- dist/index.js.map | 2 +- src/commands/download.ts | 27 +- src/commands/presign.ts | 60 +- src/download-overrides.ts | 44 + src/inputs.ts | 31 +- 12 files changed, 5508 insertions(+), 12851 deletions(-) create mode 100644 src/download-overrides.ts diff --git a/README.md b/README.md index 29263ee..3267554 100644 --- a/README.md +++ b/README.md @@ -287,8 +287,10 @@ the step; comparable SHA-1 mismatches also fail. bucket: my-bucket source: reports/2026-q1.pdf presign-ttl: 7200 + content-disposition: 'attachment; filename="q1-report.pdf"' + response-content-type: application/pdf -- run: curl -fSL "${{ steps.link.outputs.presigned-url }}" -o report.pdf +- run: curl --fail --show-error --location --remote-name --remote-header-name "${{ steps.link.outputs.presigned-url }}" ``` ### Server-side encryption @@ -383,10 +385,11 @@ Set `bypass-governance: true` to shorten governance-mode retention or to remove | `resume` | no | `true` | Reserved. Currently not honored; the action's streaming upload source is non-sliceable, so retries do a full re-upload. Kept in the input surface so it can light up if a `BufferSource` fallback ships. | | `content-type` | no | `b2/x-auto` | MIME type for uploads. | | `file-info` | no | | Upload fileInfo metadata as newline- or simple comma-separated `key=value` pairs. Use newline-separated entries when values contain commas. Keys are normalized to lowercase, may contain letters, digits, and B2-supported special characters, cannot start with `b2-`, and must fit B2 fileInfo limits. Use `cache-control`, `content-disposition`, `content-language`, or `expires` for reserved `b2-*` response headers. | -| `cache-control` | no | | Cache-Control response header to store with uploaded files. | -| `content-disposition` | no | | Content-Disposition response header to store with uploaded files. | +| `cache-control` | no | | Cache-Control header to store with uploads, or response override for `presign` and `download`. | +| `content-disposition` | no | | Content-Disposition header to store with uploads, or response override for `presign` and `download`, such as `attachment; filename="report.pdf"`. | | `content-language` | no | | Content-Language response header to store with uploaded files. | | `expires` | no | | Expires response header to store with uploaded files. | +| `response-content-type` | no | | Response Content-Type override for `presign` and `download`. | | `preserve-mtime` | no | `false` | Store each uploaded file's local modification time as B2 `src_last_modified_millis`. | | `dry-run` | no | `false` | Preview only (sync/delete/purge). | | `allow-bucket-purge` | purge only | `false` | Permit `purge` to target the entire bucket when `source` is empty or `/`. | diff --git a/__tests__/_parsed-inputs.ts b/__tests__/_parsed-inputs.ts index 35d67c1..df47474 100644 --- a/__tests__/_parsed-inputs.ts +++ b/__tests__/_parsed-inputs.ts @@ -25,6 +25,9 @@ export function makeParsedInputs( contentType: undefined, fileInfo: {}, preserveMtime: false, + contentDisposition: undefined, + responseContentType: undefined, + cacheControl: undefined, dryRun: false, allowBucketPurge: false, presignTtlSeconds: 3600, diff --git a/__tests__/commands/delete-copy-presign.test.ts b/__tests__/commands/delete-copy-presign.test.ts index 7a0f9bd..caa18d7 100644 --- a/__tests__/commands/delete-copy-presign.test.ts +++ b/__tests__/commands/delete-copy-presign.test.ts @@ -1,6 +1,6 @@ import { rm, writeFile } from 'node:fs/promises' import { join } from 'node:path' -import { afterEach, beforeEach, describe, expect, it } from 'vitest' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { copyCommand } from '../../src/commands/copy.ts' import { deleteCommand } from '../../src/commands/delete.ts' import { presignCommand } from '../../src/commands/presign.ts' @@ -323,4 +323,34 @@ describe('presign command', () => { expect(first?.url).toContain('expires=') expect(first?.expiresAt).toBeGreaterThan(Math.floor(Date.now() / 1000)) }) + + it('adds response header overrides to presigned URLs and authorization', async () => { + const local = join(fx.workDir, 'private-report.bin') + await writeFile(local, 'share me as pdf') + await uploadCommand(fx.bucket, { + ...baseInputs('upload'), + source: local, + destination: 'reports/private-report.bin', + }) + const getAuth = vi.spyOn(fx.client.raw, 'getDownloadAuthorization') + + const result = await presignCommand(fx.client, fx.bucket, { + ...baseInputs('presign'), + source: 'reports/private-report.bin', + contentDisposition: 'attachment; filename="report.pdf"', + responseContentType: 'application/pdf', + cacheControl: 'private, max-age=60', + }) + + const request = getAuth.mock.calls[0]?.[2] + expect(request).toMatchObject({ + b2ContentDisposition: 'attachment; filename="report.pdf"', + b2ContentType: 'application/pdf', + b2CacheControl: 'private, max-age=60', + }) + const url = new URL(result.files[0]?.url ?? '') + expect(url.searchParams.get('b2ContentDisposition')).toBe('attachment; filename="report.pdf"') + expect(url.searchParams.get('b2ContentType')).toBe('application/pdf') + expect(url.searchParams.get('b2CacheControl')).toBe('private, max-age=60') + }) }) diff --git a/__tests__/commands/upload-download.test.ts b/__tests__/commands/upload-download.test.ts index b41c1d3..45c9fd3 100644 --- a/__tests__/commands/upload-download.test.ts +++ b/__tests__/commands/upload-download.test.ts @@ -2,7 +2,7 @@ import { randomBytes } from 'node:crypto' import { mkdir, readFile, rename, rm, stat, symlink, utimes, writeFile } from 'node:fs/promises' import { join } from 'node:path' import type { Bucket, FileVersion, ProgressEvent } from '@backblaze-labs/b2-sdk' -import { afterEach, beforeEach, describe, expect, it } from 'vitest' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { downloadCommand, replaceDownloadedFile } from '../../src/commands/download.ts' import { uploadCommand } from '../../src/commands/upload.ts' import type { ParsedInputs } from '../../src/inputs.ts' @@ -249,6 +249,27 @@ describe('upload + download commands (B2Simulator)', () => { expect(got.equals(payload)).toBe(true) }) + it('passes response header overrides to downloads', async () => { + await seedFile(fx, 'reports/private-report.bin', 'download me as pdf') + const download = vi.spyOn(fx.bucket, 'download') + + await downloadCommand(fx.bucket, { + ...baseInputs(), + action: 'download', + source: 'reports/private-report.bin', + destination: join(fx.workDir, 'report.pdf'), + contentDisposition: 'attachment; filename="report.pdf"', + responseContentType: 'application/pdf', + cacheControl: 'private, max-age=60', + }) + + expect(download.mock.calls[0]?.[1]).toMatchObject({ + b2ContentDisposition: 'attachment; filename="report.pdf"', + b2ContentType: 'application/pdf', + b2CacheControl: 'private, max-age=60', + }) + }) + it('downloads every file under a prefix', async () => { for (const name of ['a.txt', 'b.txt', 'c.txt']) { const local = join(fx.workDir, name) diff --git a/__tests__/inputs.test.ts b/__tests__/inputs.test.ts index 78f08bb..cca16e2 100644 --- a/__tests__/inputs.test.ts +++ b/__tests__/inputs.test.ts @@ -225,6 +225,21 @@ describe('parseInputs', () => { expect(r.dryRun).toBe(true) }) + it('parses download response header overrides', () => { + setInput('action', 'download') + setInput('application-key-id', 'k') + setInput('application-key', 's') + setInput('bucket', 'b') + setInput('content-disposition', 'attachment; filename="report.pdf"') + setInput('response-content-type', 'application/pdf') + setInput('cache-control', 'max-age=60') + + const r = parseInputs() + expect(r.contentDisposition).toBe('attachment; filename="report.pdf"') + expect(r.responseContentType).toBe('application/pdf') + expect(r.cacheControl).toBe('max-age=60') + }) + it('keeps an empty purge source only when whole-bucket purge is confirmed', () => { setInput('action', 'purge') setInput('application-key-id', 'k') diff --git a/action.yml b/action.yml index f62bb69..eee359c 100644 --- a/action.yml +++ b/action.yml @@ -52,10 +52,10 @@ inputs: description: "Custom upload fileInfo metadata as newline- or simple comma-separated key=value pairs. Use newline-separated entries when values contain commas. Keys are normalized to lowercase, may contain letters, digits, and B2-supported special characters (-_.`~!#$%^&*'|+), cannot start with b2-, and must fit B2 fileInfo limits. Use cache-control/content-disposition/content-language/expires for reserved b2-* response headers." required: false cache-control: - description: 'Cache-Control response header to store with uploaded files.' + description: 'Cache-Control header to store with uploads, or response override for presign/download.' required: false content-disposition: - description: 'Content-Disposition response header to store with uploaded files.' + description: 'Content-Disposition header to store with uploads, or response override for presign/download, such as attachment; filename="report.pdf".' required: false content-language: description: 'Content-Language response header to store with uploaded files.' @@ -63,6 +63,9 @@ inputs: expires: description: 'Expires response header to store with uploaded files.' required: false + response-content-type: + description: 'Response Content-Type override for presign/download.' + required: false preserve-mtime: description: 'Store each uploaded file''s local modification time as B2 src_last_modified_millis. Default false.' required: false diff --git a/dist/index.js b/dist/index.js index ddf5fa1..60f9a5f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,15 +1,15 @@ import './sourcemap-register.cjs';import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /******/ var __webpack_modules__ = ({ -/***/ 2345: +/***/ 1410: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* unused reexport */ __nccwpck_require__(6979); +/* unused reexport */ __nccwpck_require__(1578); /***/ }), -/***/ 6979: +/***/ 1578: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { var __webpack_unused_export__; @@ -281,34 +281,34 @@ __webpack_unused_export__ = debug; // for test /***/ }), -/***/ 5476: +/***/ 7253: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var __webpack_unused_export__; -const Client = __nccwpck_require__(7921) -const Dispatcher = __nccwpck_require__(1815) -const Pool = __nccwpck_require__(3848) -const BalancedPool = __nccwpck_require__(7497) -const Agent = __nccwpck_require__(4161) -const ProxyAgent = __nccwpck_require__(9012) -const EnvHttpProxyAgent = __nccwpck_require__(7077) -const RetryAgent = __nccwpck_require__(4734) -const errors = __nccwpck_require__(55) -const util = __nccwpck_require__(3564) +const Client = __nccwpck_require__(9116) +const Dispatcher = __nccwpck_require__(5774) +const Pool = __nccwpck_require__(3761) +const BalancedPool = __nccwpck_require__(1046) +const Agent = __nccwpck_require__(7698) +const ProxyAgent = __nccwpck_require__(2571) +const EnvHttpProxyAgent = __nccwpck_require__(9456) +const RetryAgent = __nccwpck_require__(6838) +const errors = __nccwpck_require__(9270) +const util = __nccwpck_require__(4457) const { InvalidArgumentError } = errors -const api = __nccwpck_require__(8419) -const buildConnector = __nccwpck_require__(6564) -const MockClient = __nccwpck_require__(6009) -const MockAgent = __nccwpck_require__(8201) -const MockPool = __nccwpck_require__(7520) -const mockErrors = __nccwpck_require__(7185) -const RetryHandler = __nccwpck_require__(452) -const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1209) -const DecoratorHandler = __nccwpck_require__(2495) -const RedirectHandler = __nccwpck_require__(6134) -const createRedirectInterceptor = __nccwpck_require__(4024) +const api = __nccwpck_require__(9142) +const buildConnector = __nccwpck_require__(7135) +const MockClient = __nccwpck_require__(1298) +const MockAgent = __nccwpck_require__(2116) +const MockPool = __nccwpck_require__(6495) +const mockErrors = __nccwpck_require__(4158) +const RetryHandler = __nccwpck_require__(397) +const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(9098) +const DecoratorHandler = __nccwpck_require__(9638) +const RedirectHandler = __nccwpck_require__(1805) +const createRedirectInterceptor = __nccwpck_require__(631) Object.assign(Dispatcher.prototype, api) @@ -326,10 +326,10 @@ __webpack_unused_export__ = DecoratorHandler __webpack_unused_export__ = RedirectHandler __webpack_unused_export__ = createRedirectInterceptor __webpack_unused_export__ = { - redirect: __nccwpck_require__(9782), - retry: __nccwpck_require__(6158), - dump: __nccwpck_require__(3792), - dns: __nccwpck_require__(5023) + redirect: __nccwpck_require__(9113), + retry: __nccwpck_require__(6879), + dump: __nccwpck_require__(8103), + dns: __nccwpck_require__(6038) } __webpack_unused_export__ = buildConnector @@ -391,7 +391,7 @@ function makeDispatcher (fn) { __webpack_unused_export__ = setGlobalDispatcher __webpack_unused_export__ = getGlobalDispatcher -const fetchImpl = (__nccwpck_require__(90).fetch) +const fetchImpl = (__nccwpck_require__(831).fetch) __webpack_unused_export__ = async function fetch (init, options = undefined) { try { return await fetchImpl(init, options) @@ -403,39 +403,39 @@ __webpack_unused_export__ = async function fetch (init, options = undefined) { throw err } } -/* unused reexport */ __nccwpck_require__(32).Headers -/* unused reexport */ __nccwpck_require__(9559).Response -/* unused reexport */ __nccwpck_require__(3459).Request -/* unused reexport */ __nccwpck_require__(5498).FormData +/* unused reexport */ __nccwpck_require__(5057).Headers +/* unused reexport */ __nccwpck_require__(2536).Response +/* unused reexport */ __nccwpck_require__(6454).Request +/* unused reexport */ __nccwpck_require__(6557).FormData __webpack_unused_export__ = globalThis.File ?? (__nccwpck_require__(4573).File) -/* unused reexport */ __nccwpck_require__(6463).FileReader +/* unused reexport */ __nccwpck_require__(5556).FileReader -const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(8303) +const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(3424) __webpack_unused_export__ = setGlobalOrigin __webpack_unused_export__ = getGlobalOrigin -const { CacheStorage } = __nccwpck_require__(6577) -const { kConstruct } = __nccwpck_require__(1449) +const { CacheStorage } = __nccwpck_require__(4382) +const { kConstruct } = __nccwpck_require__(2812) // Cache & CacheStorage are tightly coupled with fetch. Even if it may run // in an older version of Node, it doesn't have any use without fetch. __webpack_unused_export__ = new CacheStorage(kConstruct) -const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(8865) +const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(9156) __webpack_unused_export__ = deleteCookie __webpack_unused_export__ = getCookies __webpack_unused_export__ = getSetCookies __webpack_unused_export__ = setCookie -const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(2992) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4883) __webpack_unused_export__ = parseMIMEType __webpack_unused_export__ = serializeAMimeType -const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(6344) -/* unused reexport */ __nccwpck_require__(3690).WebSocket +const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(2203) +/* unused reexport */ __nccwpck_require__(7799).WebSocket __webpack_unused_export__ = CloseEvent __webpack_unused_export__ = ErrorEvent __webpack_unused_export__ = MessageEvent @@ -451,18 +451,18 @@ __webpack_unused_export__ = MockPool __webpack_unused_export__ = MockAgent __webpack_unused_export__ = mockErrors -const { EventSource } = __nccwpck_require__(1106) +const { EventSource } = __nccwpck_require__(8207) __webpack_unused_export__ = EventSource /***/ }), -/***/ 2810: +/***/ 61: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { addAbortListener } = __nccwpck_require__(3564) -const { RequestAbortedError } = __nccwpck_require__(55) +const { addAbortListener } = __nccwpck_require__(4457) +const { RequestAbortedError } = __nccwpck_require__(9270) const kListener = Symbol('kListener') const kSignal = Symbol('kSignal') @@ -522,16 +522,16 @@ module.exports = { /***/ }), -/***/ 9579: +/***/ 9121: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) -const { AsyncResource } = __nccwpck_require__(4317) -const { InvalidArgumentError, SocketError } = __nccwpck_require__(55) -const util = __nccwpck_require__(3564) -const { addSignal, removeSignal } = __nccwpck_require__(2810) +const { AsyncResource } = __nccwpck_require__(6698) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(9270) +const util = __nccwpck_require__(4457) +const { addSignal, removeSignal } = __nccwpck_require__(61) class ConnectHandler extends AsyncResource { constructor (opts, callback) { @@ -637,7 +637,7 @@ module.exports = connect /***/ }), -/***/ 4658: +/***/ 3737: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -651,10 +651,10 @@ const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError -} = __nccwpck_require__(55) -const util = __nccwpck_require__(3564) -const { AsyncResource } = __nccwpck_require__(4317) -const { addSignal, removeSignal } = __nccwpck_require__(2810) +} = __nccwpck_require__(9270) +const util = __nccwpck_require__(4457) +const { AsyncResource } = __nccwpck_require__(6698) +const { addSignal, removeSignal } = __nccwpck_require__(61) const assert = __nccwpck_require__(4589) const kResume = Symbol('resume') @@ -895,17 +895,17 @@ module.exports = pipeline /***/ }), -/***/ 8295: +/***/ 7010: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) -const { Readable } = __nccwpck_require__(8547) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(55) -const util = __nccwpck_require__(3564) -const { getResolveErrorBodyCallback } = __nccwpck_require__(8651) -const { AsyncResource } = __nccwpck_require__(4317) +const { Readable } = __nccwpck_require__(3468) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9270) +const util = __nccwpck_require__(4457) +const { getResolveErrorBodyCallback } = __nccwpck_require__(3640) +const { AsyncResource } = __nccwpck_require__(6698) class RequestHandler extends AsyncResource { constructor (opts, callback) { @@ -1116,18 +1116,18 @@ module.exports.RequestHandler = RequestHandler /***/ }), -/***/ 2596: +/***/ 5095: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) const { finished, PassThrough } = __nccwpck_require__(7075) -const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(55) -const util = __nccwpck_require__(3564) -const { getResolveErrorBodyCallback } = __nccwpck_require__(8651) -const { AsyncResource } = __nccwpck_require__(4317) -const { addSignal, removeSignal } = __nccwpck_require__(2810) +const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(9270) +const util = __nccwpck_require__(4457) +const { getResolveErrorBodyCallback } = __nccwpck_require__(3640) +const { AsyncResource } = __nccwpck_require__(6698) +const { addSignal, removeSignal } = __nccwpck_require__(61) class StreamHandler extends AsyncResource { constructor (opts, factory, callback) { @@ -1343,15 +1343,15 @@ module.exports = stream /***/ }), -/***/ 9238: +/***/ 5355: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { InvalidArgumentError, SocketError } = __nccwpck_require__(55) -const { AsyncResource } = __nccwpck_require__(4317) -const util = __nccwpck_require__(3564) -const { addSignal, removeSignal } = __nccwpck_require__(2810) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(9270) +const { AsyncResource } = __nccwpck_require__(6698) +const util = __nccwpck_require__(4457) +const { addSignal, removeSignal } = __nccwpck_require__(61) const assert = __nccwpck_require__(4589) class UpgradeHandler extends AsyncResource { @@ -1458,21 +1458,21 @@ module.exports = upgrade /***/ }), -/***/ 8419: +/***/ 9142: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports.request = __nccwpck_require__(8295) -module.exports.stream = __nccwpck_require__(2596) -module.exports.pipeline = __nccwpck_require__(4658) -module.exports.upgrade = __nccwpck_require__(9238) -module.exports.connect = __nccwpck_require__(9579) +module.exports.request = __nccwpck_require__(7010) +module.exports.stream = __nccwpck_require__(5095) +module.exports.pipeline = __nccwpck_require__(3737) +module.exports.upgrade = __nccwpck_require__(5355) +module.exports.connect = __nccwpck_require__(9121) /***/ }), -/***/ 8547: +/***/ 3468: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Ported from https://github.com/nodejs/undici/pull/907 @@ -1481,9 +1481,9 @@ module.exports.connect = __nccwpck_require__(9579) const assert = __nccwpck_require__(4589) const { Readable } = __nccwpck_require__(7075) -const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(55) -const util = __nccwpck_require__(3564) -const { ReadableStreamFrom } = __nccwpck_require__(3564) +const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(9270) +const util = __nccwpck_require__(4457) +const { ReadableStreamFrom } = __nccwpck_require__(4457) const kConsume = Symbol('kConsume') const kReading = Symbol('kReading') @@ -1864,15 +1864,15 @@ module.exports = { Readable: BodyReadable, chunksDecode } /***/ }), -/***/ 8651: +/***/ 3640: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) const { ResponseStatusCodeError -} = __nccwpck_require__(55) +} = __nccwpck_require__(9270) -const { chunksDecode } = __nccwpck_require__(8547) +const { chunksDecode } = __nccwpck_require__(3468) const CHUNK_LIMIT = 128 * 1024 async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { @@ -1964,16 +1964,16 @@ module.exports = { /***/ }), -/***/ 6564: +/***/ 7135: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const net = __nccwpck_require__(7030) const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3564) -const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(55) -const timers = __nccwpck_require__(303) +const util = __nccwpck_require__(4457) +const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(9270) +const timers = __nccwpck_require__(4462) function noop () {} @@ -2211,7 +2211,7 @@ module.exports = buildConnector /***/ }), -/***/ 6483: +/***/ 1048: /***/ ((module) => { @@ -2336,7 +2336,7 @@ module.exports = { /***/ }), -/***/ 7778: +/***/ 3677: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -2545,7 +2545,7 @@ module.exports = { /***/ }), -/***/ 55: +/***/ 9270: /***/ ((module) => { @@ -2977,7 +2977,7 @@ module.exports = { /***/ }), -/***/ 6315: +/***/ 6676: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -2985,7 +2985,7 @@ module.exports = { const { InvalidArgumentError, NotSupportedError -} = __nccwpck_require__(55) +} = __nccwpck_require__(9270) const assert = __nccwpck_require__(4589) const { isValidHTTPToken, @@ -3000,9 +3000,9 @@ const { validateHandler, getServerName, normalizedMethodRecords -} = __nccwpck_require__(3564) -const { channels } = __nccwpck_require__(7778) -const { headerNameLowerCasedRecord } = __nccwpck_require__(6483) +} = __nccwpck_require__(4457) +const { channels } = __nccwpck_require__(3677) +const { headerNameLowerCasedRecord } = __nccwpck_require__(1048) // Verifies that a given path is valid does not contain control chars \x00 to \x20 const invalidPathRegex = /[^\u0021-\u00ff]/ @@ -3389,7 +3389,7 @@ module.exports = Request /***/ }), -/***/ 8015: +/***/ 1912: /***/ ((module) => { module.exports = { @@ -3463,7 +3463,7 @@ module.exports = { /***/ }), -/***/ 4212: +/***/ 3153: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -3471,7 +3471,7 @@ module.exports = { const { wellknownHeaderNames, headerNameLowerCasedRecord -} = __nccwpck_require__(6483) +} = __nccwpck_require__(1048) class TstNode { /** @type {any} */ @@ -3622,13 +3622,13 @@ module.exports = { /***/ }), -/***/ 3564: +/***/ 4457: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) -const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(8015) +const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(1912) const { IncomingMessage } = __nccwpck_require__(7067) const stream = __nccwpck_require__(7075) const net = __nccwpck_require__(7030) @@ -3636,9 +3636,9 @@ const { Blob } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) const { stringify } = __nccwpck_require__(1792) const { EventEmitter: EE } = __nccwpck_require__(8474) -const { InvalidArgumentError } = __nccwpck_require__(55) -const { headerNameLowerCasedRecord } = __nccwpck_require__(6483) -const { tree } = __nccwpck_require__(4212) +const { InvalidArgumentError } = __nccwpck_require__(9270) +const { headerNameLowerCasedRecord } = __nccwpck_require__(1048) +const { tree } = __nccwpck_require__(3153) const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) @@ -4348,18 +4348,18 @@ module.exports = { /***/ }), -/***/ 4161: +/***/ 7698: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { InvalidArgumentError } = __nccwpck_require__(55) -const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8015) -const DispatcherBase = __nccwpck_require__(9661) -const Pool = __nccwpck_require__(3848) -const Client = __nccwpck_require__(7921) -const util = __nccwpck_require__(3564) -const createRedirectInterceptor = __nccwpck_require__(4024) +const { InvalidArgumentError } = __nccwpck_require__(9270) +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1912) +const DispatcherBase = __nccwpck_require__(9726) +const Pool = __nccwpck_require__(3761) +const Client = __nccwpck_require__(9116) +const util = __nccwpck_require__(4457) +const createRedirectInterceptor = __nccwpck_require__(631) const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') @@ -4484,7 +4484,7 @@ module.exports = Agent /***/ }), -/***/ 7497: +/***/ 1046: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -4492,7 +4492,7 @@ module.exports = Agent const { BalancedPoolMissingUpstreamError, InvalidArgumentError -} = __nccwpck_require__(55) +} = __nccwpck_require__(9270) const { PoolBase, kClients, @@ -4500,10 +4500,10 @@ const { kAddClient, kRemoveClient, kGetDispatcher -} = __nccwpck_require__(3164) -const Pool = __nccwpck_require__(3848) -const { kUrl, kInterceptors } = __nccwpck_require__(8015) -const { parseOrigin } = __nccwpck_require__(3564) +} = __nccwpck_require__(2347) +const Pool = __nccwpck_require__(3761) +const { kUrl, kInterceptors } = __nccwpck_require__(1912) +const { parseOrigin } = __nccwpck_require__(4457) const kFactory = Symbol('factory') const kOptions = Symbol('options') @@ -4700,7 +4700,7 @@ module.exports = BalancedPool /***/ }), -/***/ 9641: +/***/ 4858: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -4708,9 +4708,9 @@ module.exports = BalancedPool /* global WebAssembly */ const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3564) -const { channels } = __nccwpck_require__(7778) -const timers = __nccwpck_require__(303) +const util = __nccwpck_require__(4457) +const { channels } = __nccwpck_require__(3677) +const timers = __nccwpck_require__(4462) const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, @@ -4722,7 +4722,7 @@ const { BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError -} = __nccwpck_require__(55) +} = __nccwpck_require__(9270) const { kUrl, kReset, @@ -4755,9 +4755,9 @@ const { kOnError, kResume, kHTTPContext -} = __nccwpck_require__(8015) +} = __nccwpck_require__(1912) -const constants = __nccwpck_require__(5052) +const constants = __nccwpck_require__(3779) const EMPTY_BUF = Buffer.alloc(0) const FastBuffer = Buffer[Symbol.species] const addListener = util.addListener @@ -4769,11 +4769,11 @@ const kSocketUsed = Symbol('kSocketUsed') let extractBody async function lazyllhttp () { - const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(5330) : undefined + const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1789) : undefined let mod try { - mod = await WebAssembly.compile(__nccwpck_require__(2430)) + mod = await WebAssembly.compile(__nccwpck_require__(7279)) } catch (e) { /* istanbul ignore next */ @@ -4781,7 +4781,7 @@ async function lazyllhttp () { // being enabled, but the occurring of this other error // * https://github.com/emscripten-core/emscripten/issues/11495 // got me to remove that check to avoid breaking Node 12. - mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(5330)) + mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(1789)) } return await WebAssembly.instantiate(mod, { @@ -5689,7 +5689,7 @@ function writeH1 (client, request) { if (util.isFormDataLike(body)) { if (!extractBody) { - extractBody = (__nccwpck_require__(1960).extractBody) + extractBody = (__nccwpck_require__(6831).extractBody) } const [bodyStream, contentType] = extractBody(body) @@ -6194,20 +6194,20 @@ module.exports = connectH1 /***/ }), -/***/ 6688: +/***/ 5415: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) const { pipeline } = __nccwpck_require__(7075) -const util = __nccwpck_require__(3564) +const util = __nccwpck_require__(4457) const { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError -} = __nccwpck_require__(55) +} = __nccwpck_require__(9270) const { kUrl, kReset, @@ -6226,7 +6226,7 @@ const { kResume, kSize, kHTTPContext -} = __nccwpck_require__(8015) +} = __nccwpck_require__(1912) const kOpenStreams = Symbol('open streams') @@ -6585,7 +6585,7 @@ function writeH2 (client, request) { let contentLength = util.bodyLength(body) if (util.isFormDataLike(body)) { - extractBody ??= (__nccwpck_require__(1960).extractBody) + extractBody ??= (__nccwpck_require__(6831).extractBody) const [bodyStream, contentType] = extractBody(body) headers['content-type'] = contentType @@ -6945,7 +6945,7 @@ module.exports = connectH2 /***/ }), -/***/ 7921: +/***/ 9116: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // @ts-check @@ -6955,16 +6955,16 @@ module.exports = connectH2 const assert = __nccwpck_require__(4589) const net = __nccwpck_require__(7030) const http = __nccwpck_require__(7067) -const util = __nccwpck_require__(3564) -const { channels } = __nccwpck_require__(7778) -const Request = __nccwpck_require__(6315) -const DispatcherBase = __nccwpck_require__(9661) +const util = __nccwpck_require__(4457) +const { channels } = __nccwpck_require__(3677) +const Request = __nccwpck_require__(6676) +const DispatcherBase = __nccwpck_require__(9726) const { InvalidArgumentError, InformationalError, ClientDestroyedError -} = __nccwpck_require__(55) -const buildConnector = __nccwpck_require__(6564) +} = __nccwpck_require__(9270) +const buildConnector = __nccwpck_require__(7135) const { kUrl, kServerName, @@ -7006,9 +7006,9 @@ const { kHTTPContext, kMaxConcurrentStreams, kResume -} = __nccwpck_require__(8015) -const connectH1 = __nccwpck_require__(9641) -const connectH2 = __nccwpck_require__(6688) +} = __nccwpck_require__(1912) +const connectH1 = __nccwpck_require__(4858) +const connectH2 = __nccwpck_require__(5415) let deprecatedInterceptorWarned = false const kClosedResolve = Symbol('kClosedResolve') @@ -7315,7 +7315,7 @@ class Client extends DispatcherBase { } } -const createRedirectInterceptor = __nccwpck_require__(4024) +const createRedirectInterceptor = __nccwpck_require__(631) function onError (client, err) { if ( @@ -7575,18 +7575,18 @@ module.exports = Client /***/ }), -/***/ 9661: +/***/ 9726: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Dispatcher = __nccwpck_require__(1815) +const Dispatcher = __nccwpck_require__(5774) const { ClientDestroyedError, ClientClosedError, InvalidArgumentError -} = __nccwpck_require__(55) -const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(8015) +} = __nccwpck_require__(9270) +const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(1912) const kOnDestroyed = Symbol('onDestroyed') const kOnClosed = Symbol('onClosed') @@ -7781,7 +7781,7 @@ module.exports = DispatcherBase /***/ }), -/***/ 1815: +/***/ 5774: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -7853,15 +7853,15 @@ module.exports = Dispatcher /***/ }), -/***/ 7077: +/***/ 9456: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const DispatcherBase = __nccwpck_require__(9661) -const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(8015) -const ProxyAgent = __nccwpck_require__(9012) -const Agent = __nccwpck_require__(4161) +const DispatcherBase = __nccwpck_require__(9726) +const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(1912) +const ProxyAgent = __nccwpck_require__(2571) +const Agent = __nccwpck_require__(7698) const DEFAULT_PORTS = { 'http:': 80, @@ -8020,7 +8020,7 @@ module.exports = EnvHttpProxyAgent /***/ }), -/***/ 7816: +/***/ 8591: /***/ ((module) => { /* eslint-disable */ @@ -8144,15 +8144,15 @@ module.exports = class FixedQueue { /***/ }), -/***/ 3164: +/***/ 2347: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const DispatcherBase = __nccwpck_require__(9661) -const FixedQueue = __nccwpck_require__(7816) -const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(8015) -const PoolStats = __nccwpck_require__(6698) +const DispatcherBase = __nccwpck_require__(9726) +const FixedQueue = __nccwpck_require__(8591) +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(1912) +const PoolStats = __nccwpck_require__(8327) const kClients = Symbol('clients') const kNeedDrain = Symbol('needDrain') @@ -8345,10 +8345,10 @@ module.exports = { /***/ }), -/***/ 6698: +/***/ 8327: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(8015) +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(1912) const kPool = Symbol('pool') class PoolStats { @@ -8386,7 +8386,7 @@ module.exports = PoolStats /***/ }), -/***/ 3848: +/***/ 3761: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -8397,14 +8397,14 @@ const { kNeedDrain, kAddClient, kGetDispatcher -} = __nccwpck_require__(3164) -const Client = __nccwpck_require__(7921) +} = __nccwpck_require__(2347) +const Client = __nccwpck_require__(9116) const { InvalidArgumentError -} = __nccwpck_require__(55) -const util = __nccwpck_require__(3564) -const { kUrl, kInterceptors } = __nccwpck_require__(8015) -const buildConnector = __nccwpck_require__(6564) +} = __nccwpck_require__(9270) +const util = __nccwpck_require__(4457) +const { kUrl, kInterceptors } = __nccwpck_require__(1912) +const buildConnector = __nccwpck_require__(7135) const kOptions = Symbol('options') const kConnections = Symbol('connections') @@ -8500,19 +8500,19 @@ module.exports = Pool /***/ }), -/***/ 9012: +/***/ 2571: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8015) +const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1912) const { URL } = __nccwpck_require__(3136) -const Agent = __nccwpck_require__(4161) -const Pool = __nccwpck_require__(3848) -const DispatcherBase = __nccwpck_require__(9661) -const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(55) -const buildConnector = __nccwpck_require__(6564) -const Client = __nccwpck_require__(7921) +const Agent = __nccwpck_require__(7698) +const Pool = __nccwpck_require__(3761) +const DispatcherBase = __nccwpck_require__(9726) +const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(9270) +const buildConnector = __nccwpck_require__(7135) +const Client = __nccwpck_require__(9116) const kAgent = Symbol('proxy agent') const kClient = Symbol('proxy client') @@ -8781,13 +8781,13 @@ module.exports = ProxyAgent /***/ }), -/***/ 4734: +/***/ 6838: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Dispatcher = __nccwpck_require__(1815) -const RetryHandler = __nccwpck_require__(452) +const Dispatcher = __nccwpck_require__(5774) +const RetryHandler = __nccwpck_require__(397) class RetryAgent extends Dispatcher { #agent = null @@ -8823,7 +8823,7 @@ module.exports = RetryAgent /***/ }), -/***/ 1209: +/***/ 9098: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -8831,8 +8831,8 @@ module.exports = RetryAgent // We include a version number for the Dispatcher API. In case of breaking changes, // this version number must be increased to avoid conflicts. const globalDispatcher = Symbol.for('undici.globalDispatcher.1') -const { InvalidArgumentError } = __nccwpck_require__(55) -const Agent = __nccwpck_require__(4161) +const { InvalidArgumentError } = __nccwpck_require__(9270) +const Agent = __nccwpck_require__(7698) if (getGlobalDispatcher() === undefined) { setGlobalDispatcher(new Agent()) @@ -8862,7 +8862,7 @@ module.exports = { /***/ }), -/***/ 2495: +/***/ 9638: /***/ ((module) => { @@ -8913,15 +8913,15 @@ module.exports = class DecoratorHandler { /***/ }), -/***/ 6134: +/***/ 1805: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const util = __nccwpck_require__(3564) -const { kBodyUsed } = __nccwpck_require__(8015) +const util = __nccwpck_require__(4457) +const { kBodyUsed } = __nccwpck_require__(1912) const assert = __nccwpck_require__(4589) -const { InvalidArgumentError } = __nccwpck_require__(55) +const { InvalidArgumentError } = __nccwpck_require__(9270) const EE = __nccwpck_require__(8474) const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] @@ -9152,20 +9152,20 @@ module.exports = RedirectHandler /***/ }), -/***/ 452: +/***/ 397: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) -const { kRetryHandlerDefaultRetry } = __nccwpck_require__(8015) -const { RequestRetryError } = __nccwpck_require__(55) +const { kRetryHandlerDefaultRetry } = __nccwpck_require__(1912) +const { RequestRetryError } = __nccwpck_require__(9270) const { isDisturbed, parseHeaders, parseRangeHeader, wrapRequestBody -} = __nccwpck_require__(3564) +} = __nccwpck_require__(4457) function calculateRetryAfterHeader (retryAfter) { const current = Date.now() @@ -9533,14 +9533,14 @@ module.exports = RetryHandler /***/ }), -/***/ 5023: +/***/ 6038: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { isIP } = __nccwpck_require__(7030) const { lookup } = __nccwpck_require__(610) -const DecoratorHandler = __nccwpck_require__(2495) -const { InvalidArgumentError, InformationalError } = __nccwpck_require__(55) +const DecoratorHandler = __nccwpck_require__(9638) +const { InvalidArgumentError, InformationalError } = __nccwpck_require__(9270) const maxInt = Math.pow(2, 31) - 1 class DNSInstance { @@ -9915,14 +9915,14 @@ module.exports = interceptorOpts => { /***/ }), -/***/ 3792: +/***/ 8103: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const util = __nccwpck_require__(3564) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(55) -const DecoratorHandler = __nccwpck_require__(2495) +const util = __nccwpck_require__(4457) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9270) +const DecoratorHandler = __nccwpck_require__(9638) class DumpHandler extends DecoratorHandler { #maxSize = 1024 * 1024 @@ -10045,12 +10045,12 @@ module.exports = createDumpInterceptor /***/ }), -/***/ 4024: +/***/ 631: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const RedirectHandler = __nccwpck_require__(6134) +const RedirectHandler = __nccwpck_require__(1805) function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { @@ -10073,11 +10073,11 @@ module.exports = createRedirectInterceptor /***/ }), -/***/ 9782: +/***/ 9113: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const RedirectHandler = __nccwpck_require__(6134) +const RedirectHandler = __nccwpck_require__(1805) module.exports = opts => { const globalMaxRedirections = opts?.maxRedirections @@ -10104,11 +10104,11 @@ module.exports = opts => { /***/ }), -/***/ 6158: +/***/ 6879: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const RetryHandler = __nccwpck_require__(452) +const RetryHandler = __nccwpck_require__(397) module.exports = globalOpts => { return dispatch => { @@ -10130,13 +10130,13 @@ module.exports = globalOpts => { /***/ }), -/***/ 5052: +/***/ 3779: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; -const utils_1 = __nccwpck_require__(480); +const utils_1 = __nccwpck_require__(4579); // C headers var ERROR; (function (ERROR) { @@ -10414,7 +10414,7 @@ exports.SPECIAL_HEADERS = { /***/ }), -/***/ 5330: +/***/ 1789: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -10426,7 +10426,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 2430: +/***/ 7279: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -10438,7 +10438,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 480: +/***/ 4579: /***/ ((__unused_webpack_module, exports) => { @@ -10459,13 +10459,13 @@ exports.enumToMap = enumToMap; /***/ }), -/***/ 8201: +/***/ 2116: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kClients } = __nccwpck_require__(8015) -const Agent = __nccwpck_require__(4161) +const { kClients } = __nccwpck_require__(1912) +const Agent = __nccwpck_require__(7698) const { kAgent, kMockAgentSet, @@ -10476,14 +10476,14 @@ const { kGetNetConnect, kOptions, kFactory -} = __nccwpck_require__(8305) -const MockClient = __nccwpck_require__(6009) -const MockPool = __nccwpck_require__(7520) -const { matchValue, buildMockOptions } = __nccwpck_require__(4521) -const { InvalidArgumentError, UndiciError } = __nccwpck_require__(55) -const Dispatcher = __nccwpck_require__(1815) -const Pluralizer = __nccwpck_require__(2269) -const PendingInterceptorsFormatter = __nccwpck_require__(5290) +} = __nccwpck_require__(1024) +const MockClient = __nccwpck_require__(1298) +const MockPool = __nccwpck_require__(6495) +const { matchValue, buildMockOptions } = __nccwpck_require__(6948) +const { InvalidArgumentError, UndiciError } = __nccwpck_require__(9270) +const Dispatcher = __nccwpck_require__(5774) +const Pluralizer = __nccwpck_require__(9556) +const PendingInterceptorsFormatter = __nccwpck_require__(1651) class MockAgent extends Dispatcher { constructor (opts) { @@ -10626,14 +10626,14 @@ module.exports = MockAgent /***/ }), -/***/ 6009: +/***/ 1298: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { promisify } = __nccwpck_require__(7975) -const Client = __nccwpck_require__(7921) -const { buildMockDispatch } = __nccwpck_require__(4521) +const Client = __nccwpck_require__(9116) +const { buildMockDispatch } = __nccwpck_require__(6948) const { kDispatches, kMockAgent, @@ -10642,10 +10642,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(8305) -const { MockInterceptor } = __nccwpck_require__(8579) -const Symbols = __nccwpck_require__(8015) -const { InvalidArgumentError } = __nccwpck_require__(55) +} = __nccwpck_require__(1024) +const { MockInterceptor } = __nccwpck_require__(8222) +const Symbols = __nccwpck_require__(1912) +const { InvalidArgumentError } = __nccwpck_require__(9270) /** * MockClient provides an API that extends the Client to influence the mockDispatches. @@ -10692,12 +10692,12 @@ module.exports = MockClient /***/ }), -/***/ 7185: +/***/ 4158: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { UndiciError } = __nccwpck_require__(55) +const { UndiciError } = __nccwpck_require__(9270) const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED') @@ -10727,12 +10727,12 @@ module.exports = { /***/ }), -/***/ 8579: +/***/ 8222: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(4521) +const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(6948) const { kDispatches, kDispatchKey, @@ -10740,9 +10740,9 @@ const { kDefaultTrailers, kContentLength, kMockDispatch -} = __nccwpck_require__(8305) -const { InvalidArgumentError } = __nccwpck_require__(55) -const { buildURL } = __nccwpck_require__(3564) +} = __nccwpck_require__(1024) +const { InvalidArgumentError } = __nccwpck_require__(9270) +const { buildURL } = __nccwpck_require__(4457) /** * Defines the scope API for an interceptor reply @@ -10941,14 +10941,14 @@ module.exports.MockScope = MockScope /***/ }), -/***/ 7520: +/***/ 6495: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { promisify } = __nccwpck_require__(7975) -const Pool = __nccwpck_require__(3848) -const { buildMockDispatch } = __nccwpck_require__(4521) +const Pool = __nccwpck_require__(3761) +const { buildMockDispatch } = __nccwpck_require__(6948) const { kDispatches, kMockAgent, @@ -10957,10 +10957,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(8305) -const { MockInterceptor } = __nccwpck_require__(8579) -const Symbols = __nccwpck_require__(8015) -const { InvalidArgumentError } = __nccwpck_require__(55) +} = __nccwpck_require__(1024) +const { MockInterceptor } = __nccwpck_require__(8222) +const Symbols = __nccwpck_require__(1912) +const { InvalidArgumentError } = __nccwpck_require__(9270) /** * MockPool provides an API that extends the Pool to influence the mockDispatches. @@ -11007,7 +11007,7 @@ module.exports = MockPool /***/ }), -/***/ 8305: +/***/ 1024: /***/ ((module) => { @@ -11037,20 +11037,20 @@ module.exports = { /***/ }), -/***/ 4521: +/***/ 6948: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { MockNotMatchedError } = __nccwpck_require__(7185) +const { MockNotMatchedError } = __nccwpck_require__(4158) const { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect -} = __nccwpck_require__(8305) -const { buildURL } = __nccwpck_require__(3564) +} = __nccwpck_require__(1024) +const { buildURL } = __nccwpck_require__(4457) const { STATUS_CODES } = __nccwpck_require__(7067) const { types: { @@ -11411,7 +11411,7 @@ module.exports = { /***/ }), -/***/ 5290: +/***/ 1651: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -11461,7 +11461,7 @@ module.exports = class PendingInterceptorsFormatter { /***/ }), -/***/ 2269: +/***/ 9556: /***/ ((module) => { @@ -11497,7 +11497,7 @@ module.exports = class Pluralizer { /***/ }), -/***/ 303: +/***/ 4462: /***/ ((module) => { @@ -11927,20 +11927,20 @@ module.exports = { /***/ }), -/***/ 2542: +/***/ 1939: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kConstruct } = __nccwpck_require__(1449) -const { urlEquals, getFieldValues } = __nccwpck_require__(2) -const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3564) -const { webidl } = __nccwpck_require__(9057) -const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(9559) -const { Request, fromInnerRequest } = __nccwpck_require__(3459) -const { kState } = __nccwpck_require__(327) -const { fetching } = __nccwpck_require__(90) -const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(8116) +const { kConstruct } = __nccwpck_require__(2812) +const { urlEquals, getFieldValues } = __nccwpck_require__(2453) +const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(4457) +const { webidl } = __nccwpck_require__(6709) +const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(2536) +const { Request, fromInnerRequest } = __nccwpck_require__(6454) +const { kState } = __nccwpck_require__(2082) +const { fetching } = __nccwpck_require__(831) +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(5535) const assert = __nccwpck_require__(4589) /** @@ -12793,15 +12793,15 @@ module.exports = { /***/ }), -/***/ 6577: +/***/ 4382: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kConstruct } = __nccwpck_require__(1449) -const { Cache } = __nccwpck_require__(2542) -const { webidl } = __nccwpck_require__(9057) -const { kEnumerableProperty } = __nccwpck_require__(3564) +const { kConstruct } = __nccwpck_require__(2812) +const { Cache } = __nccwpck_require__(1939) +const { webidl } = __nccwpck_require__(6709) +const { kEnumerableProperty } = __nccwpck_require__(4457) class CacheStorage { /** @@ -12952,26 +12952,26 @@ module.exports = { /***/ }), -/***/ 1449: +/***/ 2812: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = { - kConstruct: (__nccwpck_require__(8015).kConstruct) + kConstruct: (__nccwpck_require__(1912).kConstruct) } /***/ }), -/***/ 2: +/***/ 2453: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) -const { URLSerializer } = __nccwpck_require__(2992) -const { isValidHeaderName } = __nccwpck_require__(8116) +const { URLSerializer } = __nccwpck_require__(4883) +const { isValidHeaderName } = __nccwpck_require__(5535) /** * @see https://url.spec.whatwg.org/#concept-url-equals @@ -13016,7 +13016,7 @@ module.exports = { /***/ }), -/***/ 4488: +/***/ 8841: /***/ ((module) => { @@ -13035,15 +13035,15 @@ module.exports = { /***/ }), -/***/ 8865: +/***/ 9156: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { parseSetCookie } = __nccwpck_require__(6806) -const { stringify } = __nccwpck_require__(7033) -const { webidl } = __nccwpck_require__(9057) -const { Headers } = __nccwpck_require__(32) +const { parseSetCookie } = __nccwpck_require__(6583) +const { stringify } = __nccwpck_require__(1542) +const { webidl } = __nccwpck_require__(6709) +const { Headers } = __nccwpck_require__(5057) /** * @typedef {Object} Cookie @@ -13226,14 +13226,14 @@ module.exports = { /***/ }), -/***/ 6806: +/***/ 6583: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(4488) -const { isCTLExcludingHtab } = __nccwpck_require__(7033) -const { collectASequenceOfCodePointsFast } = __nccwpck_require__(2992) +const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(8841) +const { isCTLExcludingHtab } = __nccwpck_require__(1542) +const { collectASequenceOfCodePointsFast } = __nccwpck_require__(4883) const assert = __nccwpck_require__(4589) /** @@ -13543,7 +13543,7 @@ module.exports = { /***/ }), -/***/ 7033: +/***/ 1542: /***/ ((module) => { @@ -13832,12 +13832,12 @@ module.exports = { /***/ }), -/***/ 8083: +/***/ 2892: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { Transform } = __nccwpck_require__(7075) -const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(5799) +const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(5872) /** * @type {number[]} BOM @@ -14237,22 +14237,22 @@ module.exports = { /***/ }), -/***/ 1106: +/***/ 8207: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { pipeline } = __nccwpck_require__(7075) -const { fetching } = __nccwpck_require__(90) -const { makeRequest } = __nccwpck_require__(3459) -const { webidl } = __nccwpck_require__(9057) -const { EventSourceStream } = __nccwpck_require__(8083) -const { parseMIMEType } = __nccwpck_require__(2992) -const { createFastMessageEvent } = __nccwpck_require__(6344) -const { isNetworkError } = __nccwpck_require__(9559) -const { delay } = __nccwpck_require__(5799) -const { kEnumerableProperty } = __nccwpck_require__(3564) -const { environmentSettingsObject } = __nccwpck_require__(8116) +const { fetching } = __nccwpck_require__(831) +const { makeRequest } = __nccwpck_require__(6454) +const { webidl } = __nccwpck_require__(6709) +const { EventSourceStream } = __nccwpck_require__(2892) +const { parseMIMEType } = __nccwpck_require__(4883) +const { createFastMessageEvent } = __nccwpck_require__(2203) +const { isNetworkError } = __nccwpck_require__(2536) +const { delay } = __nccwpck_require__(5872) +const { kEnumerableProperty } = __nccwpck_require__(4457) +const { environmentSettingsObject } = __nccwpck_require__(5535) let experimentalWarned = false @@ -14724,7 +14724,7 @@ module.exports = { /***/ }), -/***/ 5799: +/***/ 5872: /***/ ((module) => { @@ -14768,12 +14768,12 @@ module.exports = { /***/ }), -/***/ 1960: +/***/ 6831: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const util = __nccwpck_require__(3564) +const util = __nccwpck_require__(4457) const { ReadableStreamFrom, isBlobLike, @@ -14783,16 +14783,16 @@ const { fullyReadBody, extractMimeType, utf8DecodeBytes -} = __nccwpck_require__(8116) -const { FormData } = __nccwpck_require__(5498) -const { kState } = __nccwpck_require__(327) -const { webidl } = __nccwpck_require__(9057) +} = __nccwpck_require__(5535) +const { FormData } = __nccwpck_require__(6557) +const { kState } = __nccwpck_require__(2082) +const { webidl } = __nccwpck_require__(6709) const { Blob } = __nccwpck_require__(4573) const assert = __nccwpck_require__(4589) const { isErrored, isDisturbed } = __nccwpck_require__(7075) const { isArrayBuffer } = __nccwpck_require__(3429) -const { serializeAMimeType } = __nccwpck_require__(2992) -const { multipartFormDataParser } = __nccwpck_require__(9424) +const { serializeAMimeType } = __nccwpck_require__(4883) +const { multipartFormDataParser } = __nccwpck_require__(9301) let random try { @@ -15304,7 +15304,7 @@ module.exports = { /***/ }), -/***/ 4123: +/***/ 578: /***/ ((module) => { @@ -15435,7 +15435,7 @@ module.exports = { /***/ }), -/***/ 2992: +/***/ 4883: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -16186,12 +16186,12 @@ module.exports = { /***/ }), -/***/ 4057: +/***/ 7434: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kConnected, kSize } = __nccwpck_require__(8015) +const { kConnected, kSize } = __nccwpck_require__(1912) class CompatWeakRef { constructor (value) { @@ -16239,14 +16239,14 @@ module.exports = function () { /***/ }), -/***/ 3358: +/***/ 9261: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { Blob, File } = __nccwpck_require__(4573) -const { kState } = __nccwpck_require__(327) -const { webidl } = __nccwpck_require__(9057) +const { kState } = __nccwpck_require__(2082) +const { webidl } = __nccwpck_require__(6709) // TODO(@KhafraDev): remove class FileLike { @@ -16372,16 +16372,16 @@ module.exports = { FileLike, isFileLike } /***/ }), -/***/ 9424: +/***/ 9301: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(3564) -const { utf8DecodeBytes } = __nccwpck_require__(8116) -const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(2992) -const { isFileLike } = __nccwpck_require__(3358) -const { makeEntry } = __nccwpck_require__(5498) +const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(4457) +const { utf8DecodeBytes } = __nccwpck_require__(5535) +const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(4883) +const { isFileLike } = __nccwpck_require__(9261) +const { makeEntry } = __nccwpck_require__(6557) const assert = __nccwpck_require__(4589) const { File: NodeFile } = __nccwpck_require__(4573) @@ -16853,16 +16853,16 @@ module.exports = { /***/ }), -/***/ 5498: +/***/ 6557: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { isBlobLike, iteratorMixin } = __nccwpck_require__(8116) -const { kState } = __nccwpck_require__(327) -const { kEnumerableProperty } = __nccwpck_require__(3564) -const { FileLike, isFileLike } = __nccwpck_require__(3358) -const { webidl } = __nccwpck_require__(9057) +const { isBlobLike, iteratorMixin } = __nccwpck_require__(5535) +const { kState } = __nccwpck_require__(2082) +const { kEnumerableProperty } = __nccwpck_require__(4457) +const { FileLike, isFileLike } = __nccwpck_require__(9261) +const { webidl } = __nccwpck_require__(6709) const { File: NativeFile } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) @@ -17112,7 +17112,7 @@ module.exports = { FormData, makeEntry } /***/ }), -/***/ 8303: +/***/ 3424: /***/ ((module) => { @@ -17159,21 +17159,21 @@ module.exports = { /***/ }), -/***/ 32: +/***/ 5057: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // https://github.com/Ethan-Arrowood/undici-fetch -const { kConstruct } = __nccwpck_require__(8015) -const { kEnumerableProperty } = __nccwpck_require__(3564) +const { kConstruct } = __nccwpck_require__(1912) +const { kEnumerableProperty } = __nccwpck_require__(4457) const { iteratorMixin, isValidHeaderName, isValidHeaderValue -} = __nccwpck_require__(8116) -const { webidl } = __nccwpck_require__(9057) +} = __nccwpck_require__(5535) +const { webidl } = __nccwpck_require__(6709) const assert = __nccwpck_require__(4589) const util = __nccwpck_require__(7975) @@ -17853,7 +17853,7 @@ module.exports = { /***/ }), -/***/ 90: +/***/ 831: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // https://github.com/Ethan-Arrowood/undici-fetch @@ -17866,9 +17866,9 @@ const { filterResponse, makeResponse, fromInnerResponse -} = __nccwpck_require__(9559) -const { HeadersList } = __nccwpck_require__(32) -const { Request, cloneRequest } = __nccwpck_require__(3459) +} = __nccwpck_require__(2536) +const { HeadersList } = __nccwpck_require__(5057) +const { Request, cloneRequest } = __nccwpck_require__(6454) const zlib = __nccwpck_require__(8522) const { bytesMatch, @@ -17904,23 +17904,23 @@ const { buildContentRange, createInflate, extractMimeType -} = __nccwpck_require__(8116) -const { kState, kDispatcher } = __nccwpck_require__(327) +} = __nccwpck_require__(5535) +const { kState, kDispatcher } = __nccwpck_require__(2082) const assert = __nccwpck_require__(4589) -const { safelyExtractBody, extractBody } = __nccwpck_require__(1960) +const { safelyExtractBody, extractBody } = __nccwpck_require__(6831) const { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet -} = __nccwpck_require__(4123) +} = __nccwpck_require__(578) const EE = __nccwpck_require__(8474) const { Readable, pipeline, finished } = __nccwpck_require__(7075) -const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(3564) -const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(2992) -const { getGlobalDispatcher } = __nccwpck_require__(1209) -const { webidl } = __nccwpck_require__(9057) +const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(4457) +const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(4883) +const { getGlobalDispatcher } = __nccwpck_require__(9098) +const { webidl } = __nccwpck_require__(6709) const { STATUS_CODES } = __nccwpck_require__(7067) const GET_OR_HEAD = ['GET', 'HEAD'] @@ -20132,23 +20132,23 @@ module.exports = { /***/ }), -/***/ 3459: +/***/ 6454: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* globals AbortController */ -const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(1960) -const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(32) -const { FinalizationRegistry } = __nccwpck_require__(4057)() -const util = __nccwpck_require__(3564) +const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(6831) +const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(5057) +const { FinalizationRegistry } = __nccwpck_require__(7434)() +const util = __nccwpck_require__(4457) const nodeUtil = __nccwpck_require__(7975) const { isValidHTTPToken, sameOrigin, environmentSettingsObject -} = __nccwpck_require__(8116) +} = __nccwpck_require__(5535) const { forbiddenMethodsSet, corsSafeListedMethodsSet, @@ -20158,12 +20158,12 @@ const { requestCredentials, requestCache, requestDuplex -} = __nccwpck_require__(4123) +} = __nccwpck_require__(578) const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util -const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(327) -const { webidl } = __nccwpck_require__(9057) -const { URLSerializer } = __nccwpck_require__(2992) -const { kConstruct } = __nccwpck_require__(8015) +const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(2082) +const { webidl } = __nccwpck_require__(6709) +const { URLSerializer } = __nccwpck_require__(4883) +const { kConstruct } = __nccwpck_require__(1912) const assert = __nccwpck_require__(4589) const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(8474) @@ -21176,14 +21176,14 @@ module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest } /***/ }), -/***/ 9559: +/***/ 2536: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(32) -const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(1960) -const util = __nccwpck_require__(3564) +const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(5057) +const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(6831) +const util = __nccwpck_require__(4457) const nodeUtil = __nccwpck_require__(7975) const { kEnumerableProperty } = util const { @@ -21195,16 +21195,16 @@ const { isErrorLike, isomorphicEncode, environmentSettingsObject: relevantRealm -} = __nccwpck_require__(8116) +} = __nccwpck_require__(5535) const { redirectStatusSet, nullBodyStatus -} = __nccwpck_require__(4123) -const { kState, kHeaders } = __nccwpck_require__(327) -const { webidl } = __nccwpck_require__(9057) -const { FormData } = __nccwpck_require__(5498) -const { URLSerializer } = __nccwpck_require__(2992) -const { kConstruct } = __nccwpck_require__(8015) +} = __nccwpck_require__(578) +const { kState, kHeaders } = __nccwpck_require__(2082) +const { webidl } = __nccwpck_require__(6709) +const { FormData } = __nccwpck_require__(6557) +const { URLSerializer } = __nccwpck_require__(4883) +const { kConstruct } = __nccwpck_require__(1912) const assert = __nccwpck_require__(4589) const { types } = __nccwpck_require__(7975) @@ -21793,7 +21793,7 @@ module.exports = { /***/ }), -/***/ 327: +/***/ 2082: /***/ ((module) => { @@ -21809,21 +21809,21 @@ module.exports = { /***/ }), -/***/ 8116: +/***/ 5535: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { Transform } = __nccwpck_require__(7075) const zlib = __nccwpck_require__(8522) -const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(4123) -const { getGlobalOrigin } = __nccwpck_require__(8303) -const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(2992) +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(578) +const { getGlobalOrigin } = __nccwpck_require__(3424) +const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(4883) const { performance } = __nccwpck_require__(643) -const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(3564) +const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(4457) const assert = __nccwpck_require__(4589) const { isUint8Array } = __nccwpck_require__(3429) -const { webidl } = __nccwpck_require__(9057) +const { webidl } = __nccwpck_require__(6709) let supportedHashes = [] @@ -23448,14 +23448,14 @@ module.exports = { /***/ }), -/***/ 9057: +/***/ 6709: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { types, inspect } = __nccwpck_require__(7975) const { markAsUncloneable } = __nccwpck_require__(5919) -const { toUSVString } = __nccwpck_require__(3564) +const { toUSVString } = __nccwpck_require__(4457) /** @type {import('../../../types/webidl').Webidl} */ const webidl = {} @@ -24150,7 +24150,7 @@ module.exports = { /***/ }), -/***/ 3707: +/***/ 4560: /***/ ((module) => { @@ -24447,7 +24447,7 @@ module.exports = { /***/ }), -/***/ 6463: +/***/ 5556: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -24456,16 +24456,16 @@ const { staticPropertyDescriptors, readOperation, fireAProgressEvent -} = __nccwpck_require__(686) +} = __nccwpck_require__(5665) const { kState, kError, kResult, kEvents, kAborted -} = __nccwpck_require__(2429) -const { webidl } = __nccwpck_require__(9057) -const { kEnumerableProperty } = __nccwpck_require__(3564) +} = __nccwpck_require__(1184) +const { webidl } = __nccwpck_require__(6709) +const { kEnumerableProperty } = __nccwpck_require__(4457) class FileReader extends EventTarget { constructor () { @@ -24798,12 +24798,12 @@ module.exports = { /***/ }), -/***/ 9617: +/***/ 1044: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { webidl } = __nccwpck_require__(9057) +const { webidl } = __nccwpck_require__(6709) const kState = Symbol('ProgressEvent state') @@ -24883,7 +24883,7 @@ module.exports = { /***/ }), -/***/ 2429: +/***/ 1184: /***/ ((module) => { @@ -24900,7 +24900,7 @@ module.exports = { /***/ }), -/***/ 686: +/***/ 5665: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -24911,10 +24911,10 @@ const { kResult, kAborted, kLastProgressEventFired -} = __nccwpck_require__(2429) -const { ProgressEvent } = __nccwpck_require__(9617) -const { getEncoding } = __nccwpck_require__(3707) -const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(2992) +} = __nccwpck_require__(1184) +const { ProgressEvent } = __nccwpck_require__(1044) +const { getEncoding } = __nccwpck_require__(4560) +const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(4883) const { types } = __nccwpck_require__(7975) const { StringDecoder } = __nccwpck_require__(3193) const { btoa } = __nccwpck_require__(4573) @@ -25298,27 +25298,27 @@ module.exports = { /***/ }), -/***/ 8341: +/***/ 2882: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(7916) +const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(541) const { kReadyState, kSentClose, kByteParser, kReceivedClose, kResponse -} = __nccwpck_require__(2060) -const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(6437) -const { channels } = __nccwpck_require__(7778) -const { CloseEvent } = __nccwpck_require__(6344) -const { makeRequest } = __nccwpck_require__(3459) -const { fetching } = __nccwpck_require__(90) -const { Headers, getHeadersList } = __nccwpck_require__(32) -const { getDecodeSplit } = __nccwpck_require__(8116) -const { WebsocketFrameSend } = __nccwpck_require__(8332) +} = __nccwpck_require__(7193) +const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(5122) +const { channels } = __nccwpck_require__(3677) +const { CloseEvent } = __nccwpck_require__(2203) +const { makeRequest } = __nccwpck_require__(6454) +const { fetching } = __nccwpck_require__(831) +const { Headers, getHeadersList } = __nccwpck_require__(5057) +const { getDecodeSplit } = __nccwpck_require__(5535) +const { WebsocketFrameSend } = __nccwpck_require__(1481) /** @type {import('crypto')} */ let crypto @@ -25676,7 +25676,7 @@ module.exports = { /***/ }), -/***/ 7916: +/***/ 541: /***/ ((module) => { @@ -25749,14 +25749,14 @@ module.exports = { /***/ }), -/***/ 6344: +/***/ 2203: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { webidl } = __nccwpck_require__(9057) -const { kEnumerableProperty } = __nccwpck_require__(3564) -const { kConstruct } = __nccwpck_require__(8015) +const { webidl } = __nccwpck_require__(6709) +const { kEnumerableProperty } = __nccwpck_require__(4457) +const { kConstruct } = __nccwpck_require__(1912) const { MessagePort } = __nccwpck_require__(5919) /** @@ -26085,12 +26085,12 @@ module.exports = { /***/ }), -/***/ 8332: +/***/ 1481: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { maxUnsigned16Bit } = __nccwpck_require__(7916) +const { maxUnsigned16Bit } = __nccwpck_require__(541) const BUFFER_SIZE = 16386 @@ -26188,14 +26188,14 @@ module.exports = { /***/ }), -/***/ 617: +/***/ 6190: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __nccwpck_require__(8522) -const { isValidClientWindowBits } = __nccwpck_require__(6437) -const { MessageSizeExceededError } = __nccwpck_require__(55) +const { isValidClientWindowBits } = __nccwpck_require__(5122) +const { MessageSizeExceededError } = __nccwpck_require__(9270) const tail = Buffer.from([0x00, 0x00, 0xff, 0xff]) const kBuffer = Symbol('kBuffer') @@ -26295,16 +26295,16 @@ module.exports = { PerMessageDeflate } /***/ }), -/***/ 8368: +/***/ 8359: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { Writable } = __nccwpck_require__(7075) const assert = __nccwpck_require__(4589) -const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(7916) -const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(2060) -const { channels } = __nccwpck_require__(7778) +const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(541) +const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7193) +const { channels } = __nccwpck_require__(3677) const { isValidStatusCode, isValidOpcode, @@ -26314,11 +26314,11 @@ const { isControlFrame, isTextBinaryFrame, isContinuationFrame -} = __nccwpck_require__(6437) -const { WebsocketFrameSend } = __nccwpck_require__(8332) -const { closeWebSocketConnection } = __nccwpck_require__(8341) -const { PerMessageDeflate } = __nccwpck_require__(617) -const { MessageSizeExceededError } = __nccwpck_require__(55) +} = __nccwpck_require__(5122) +const { WebsocketFrameSend } = __nccwpck_require__(1481) +const { closeWebSocketConnection } = __nccwpck_require__(2882) +const { PerMessageDeflate } = __nccwpck_require__(6190) +const { MessageSizeExceededError } = __nccwpck_require__(9270) function failWebsocketConnectionWithCode (ws, code, reason) { closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason)) @@ -26815,14 +26815,14 @@ module.exports = { /***/ }), -/***/ 8184: +/***/ 8323: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { WebsocketFrameSend } = __nccwpck_require__(8332) -const { opcodes, sendHints } = __nccwpck_require__(7916) -const FixedQueue = __nccwpck_require__(7816) +const { WebsocketFrameSend } = __nccwpck_require__(1481) +const { opcodes, sendHints } = __nccwpck_require__(541) +const FixedQueue = __nccwpck_require__(8591) /** @type {typeof Uint8Array} */ const FastBuffer = Buffer[Symbol.species] @@ -26926,7 +26926,7 @@ module.exports = { SendQueue } /***/ }), -/***/ 2060: +/***/ 7193: /***/ ((module) => { @@ -26945,16 +26945,16 @@ module.exports = { /***/ }), -/***/ 6437: +/***/ 5122: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(2060) -const { states, opcodes } = __nccwpck_require__(7916) -const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(6344) +const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7193) +const { states, opcodes } = __nccwpck_require__(541) +const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(2203) const { isUtf8 } = __nccwpck_require__(4573) -const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(2992) +const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(4883) /* globals Blob */ @@ -27274,15 +27274,15 @@ module.exports = { /***/ }), -/***/ 3690: +/***/ 7799: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { webidl } = __nccwpck_require__(9057) -const { URLSerializer } = __nccwpck_require__(2992) -const { environmentSettingsObject } = __nccwpck_require__(8116) -const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(7916) +const { webidl } = __nccwpck_require__(6709) +const { URLSerializer } = __nccwpck_require__(4883) +const { environmentSettingsObject } = __nccwpck_require__(5535) +const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(541) const { kWebSocketURL, kReadyState, @@ -27291,21 +27291,21 @@ const { kResponse, kSentClose, kByteParser -} = __nccwpck_require__(2060) +} = __nccwpck_require__(7193) const { isConnecting, isEstablished, isClosing, isValidSubprotocol, fireEvent -} = __nccwpck_require__(6437) -const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(8341) -const { ByteParser } = __nccwpck_require__(8368) -const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3564) -const { getGlobalDispatcher } = __nccwpck_require__(1209) +} = __nccwpck_require__(5122) +const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(2882) +const { ByteParser } = __nccwpck_require__(8359) +const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(4457) +const { getGlobalDispatcher } = __nccwpck_require__(9098) const { types } = __nccwpck_require__(7975) -const { ErrorEvent, CloseEvent } = __nccwpck_require__(6344) -const { SendQueue } = __nccwpck_require__(8184) +const { ErrorEvent, CloseEvent } = __nccwpck_require__(2203) +const { SendQueue } = __nccwpck_require__(8323) // https://websockets.spec.whatwg.org/#interface-definition class WebSocket extends EventTarget { @@ -27918,7 +27918,7 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:assert" /***/ }), -/***/ 4317: +/***/ 6698: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:async_hooks"); @@ -27967,13 +27967,6 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events" /***/ }), -/***/ 3024: -/***/ ((module) => { - -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs"); - -/***/ }), - /***/ 1455: /***/ ((module) => { @@ -28197,8 +28190,8 @@ __nccwpck_require__.d(__webpack_exports__, { e: () => (/* binding */ run) }); -// EXTERNAL MODULE: external "node:fs" -var external_node_fs_ = __nccwpck_require__(3024); +;// CONCATENATED MODULE: external "node:fs" +const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs"); // EXTERNAL MODULE: external "node:path" var external_node_path_ = __nccwpck_require__(6760); // EXTERNAL MODULE: external "node:url" @@ -28470,9 +28463,9 @@ class DecodedURL extends URL { } //# sourceMappingURL=proxy.js.map // EXTERNAL MODULE: ./node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js -var node_modules_tunnel = __nccwpck_require__(2345); +var node_modules_tunnel = __nccwpck_require__(1410); // EXTERNAL MODULE: ./node_modules/.pnpm/undici@6.27.0/node_modules/undici/index.js -var undici = __nccwpck_require__(5476); +var undici = __nccwpck_require__(7253); ;// CONCATENATED MODULE: ./node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/index.js /* eslint-disable @typescript-eslint/no-explicit-any */ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { @@ -31148,4001 +31141,999 @@ function getIDToken(aud) { */ //# sourceMappingURL=core.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/upload-url-pool.js -//#region src/auth/upload-url-pool.ts -/** -* Manages a pool of reusable upload URLs keyed by bucket ID or file ID. -* URLs are checked out before an upload, checked back in on success, and -* evicted on error so they are not reused. -*/ -var UploadUrlPool = class { - /** Map from key (bucket ID or file ID) to a stack of available entries. */ - pools = /* @__PURE__ */ new Map(); - /** - * Take an upload URL from the pool, or return null if none are available. - * - * @param key - The bucket ID or file ID to look up. - * - * @returns An upload URL entry, or null if the pool is empty for the given key. - */ - checkout(key) { - const pool = this.pools.get(key); - if (!pool || pool.length === 0) return null; - return pool.pop() ?? null; - } - /** - * Return a still-valid upload URL to the pool for future reuse. - * - * @param key - The bucket ID or file ID the entry belongs to. - * @param entry - The upload URL entry to return to the pool. - */ - checkin(key, entry) { - let pool = this.pools.get(key); - if (!pool) { - pool = []; - this.pools.set(key, pool); - } - pool.push(entry); - } - /** - * Remove a specific upload URL from the pool (e.g. after an upload error). - * - * @param key - The bucket ID or file ID the entry belongs to. - * @param entry - The failed upload URL entry to remove. - */ - evict(key, entry) { - const pool = this.pools.get(key); - if (!pool) return; - const idx = pool.findIndex((e) => e.uploadUrl === entry.uploadUrl); - if (idx !== -1) pool.splice(idx, 1); - } - /** Remove all entries from every key in the pool. */ - clear() { - this.pools.clear(); - } -}; -//#endregion - +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/upload-url-pool.js +class UploadUrlPool { + /** Map from key (bucket ID or file ID) to a stack of available entries. */ + pools = /* @__PURE__ */ new Map(); + /** + * Take an upload URL from the pool, or return null if none are available. + * + * @param key - The bucket ID or file ID to look up. + * + * @returns An upload URL entry, or null if the pool is empty for the given key. + */ + checkout(key) { + const pool = this.pools.get(key); + if (!pool || pool.length === 0) return null; + return pool.pop() ?? null; + } + /** + * Return a still-valid upload URL to the pool for future reuse. + * + * @param key - The bucket ID or file ID the entry belongs to. + * @param entry - The upload URL entry to return to the pool. + */ + checkin(key, entry) { + let pool = this.pools.get(key); + if (!pool) { + pool = []; + this.pools.set(key, pool); + } + pool.push(entry); + } + /** + * Remove a specific upload URL from the pool (e.g. after an upload error). + * + * @param key - The bucket ID or file ID the entry belongs to. + * @param entry - The failed upload URL entry to remove. + */ + evict(key, entry) { + const pool = this.pools.get(key); + if (!pool) return; + const idx = pool.findIndex((e) => e.uploadUrl === entry.uploadUrl); + if (idx !== -1) { + pool.splice(idx, 1); + } + } + /** Remove all entries from every key in the pool. */ + clear() { + this.pools.clear(); + } +} //# sourceMappingURL=upload-url-pool.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/in-memory.js - -//#region src/auth/in-memory.ts -/** -* In-memory implementation of {@link AccountInfo}. -* Stores the authorization response and upload URL pools in plain object fields. -* Suitable for short-lived processes or tests; state is lost when the process exits. -*/ -var InMemoryAccountInfo = class { - /** Cached authorization response, or null before authorize() is called. */ - auth = null; - /** Pool of reusable small-file upload URLs, keyed by bucket ID. */ - uploadUrls = new UploadUrlPool(); - /** Pool of reusable large-file part upload URLs, keyed by file ID. */ - partUploadUrls = new UploadUrlPool(); - /** - * Store a fresh authorization response, replacing any previous state. - * - * @param auth - The authorize account response to store. - */ - setAuth(auth) { - this.auth = auth; - this.uploadUrls.clear(); - this.partUploadUrls.clear(); - } - /** - * Return the current authorization response, or null if not authorized. - * - * @returns The cached authorization response, or null if not yet authorized. - */ - getAuth() { - return this.auth; - } - /** Discard all cached authorization state and upload URLs. */ - clear() { - this.auth = null; - this.uploadUrls.clear(); - this.partUploadUrls.clear(); - } - /** - * Base URL for B2 API calls. - * - * @returns The base URL for B2 API calls. - * - * @throws Error if not yet authorized. - */ - getApiUrl() { - return this.requireAuth().apiInfo.storageApi.apiUrl; - } - /** - * Base URL for file downloads. - * - * @returns The base URL for file downloads. - * - * @throws Error if not yet authorized. - */ - getDownloadUrl() { - return this.requireAuth().apiInfo.storageApi.downloadUrl; - } - /** - * Current authorization token. - * - * @returns The current authorization token. - * - * @throws Error if not yet authorized. - */ - getAuthToken() { - return this.requireAuth().authorizationToken; - } - /** - * The authorized account ID. - * - * @returns The authorized account identifier. - * - * @throws Error if not yet authorized. - */ - getAccountId() { - return this.requireAuth().accountId; - } - /** - * Server-recommended part size for large file uploads, in bytes. - * - * @returns The server-recommended part size in bytes. - * - * @throws Error if not yet authorized. - */ - getRecommendedPartSize() { - return this.requireAuth().apiInfo.storageApi.recommendedPartSize; - } - /** - * Smallest allowed part size for large file uploads, in bytes. - * - * @returns The smallest allowed part size in bytes. - * - * @throws Error if not yet authorized. - */ - getAbsoluteMinimumPartSize() { - return this.requireAuth().apiInfo.storageApi.absoluteMinimumPartSize; - } - /** - * Base URL for the S3-compatible API. - * - * @returns The base URL for the S3-compatible API. - * - * @throws Error if not yet authorized. - */ - getS3ApiUrl() { - return this.requireAuth().apiInfo.storageApi.s3ApiUrl; - } - /** - * Bucket ID the key is restricted to, or null if unrestricted. - * - * @returns The restricted bucket identifier, or null if the key is unrestricted. - * - * @throws Error if not yet authorized. - */ - getAllowedBucketId() { - const allowed = this.requireAuth().apiInfo.storageApi.allowed; - const buckets = allowed.buckets; - if (buckets === void 0) return allowed.bucketId ?? null; - if (buckets !== null) { - if (buckets.length !== 1) throw new Error("Authorized key is not restricted to exactly one bucket; use getAllowedBucketIds()"); - return buckets[0]?.id ?? null; - } - return null; - } - /** - * Bucket IDs the key is restricted to, or null if unrestricted. - * - * @returns The restricted bucket identifiers, or null if the key is unrestricted. - * - * @throws Error if not yet authorized. - */ - getAllowedBucketIds() { - const allowed = this.requireAuth().apiInfo.storageApi.allowed; - const buckets = allowed.buckets; - if (buckets === void 0) { - const legacyBucketId = allowed.bucketId ?? null; - return legacyBucketId === null ? null : [legacyBucketId]; - } - return buckets === null ? null : buckets.map((bucket) => bucket.id); - } - /** - * Take an upload URL from the pool for the given bucket, or null if none available. - * - * @param bucketId - The bucket to check out an upload URL for. - * - * @returns A reusable upload URL entry, or null if none are available. - */ - checkoutUploadUrl(bucketId) { - return this.uploadUrls.checkout(bucketId); - } - /** - * Return a still-valid upload URL to the pool for reuse. - * - * @param bucketId - The bucket the upload URL belongs to. - * @param entry - The upload URL entry to return to the pool. - */ - returnUploadUrl(bucketId, entry) { - this.uploadUrls.checkin(bucketId, entry); - } - /** - * Remove an upload URL from the pool after an upload error. - * - * @param bucketId - The bucket the failed upload URL belongs to. - * @param entry - The upload URL entry to remove from the pool. - */ - evictUploadUrl(bucketId, entry) { - this.uploadUrls.evict(bucketId, entry); - } - /** - * Take a large-file part upload URL from the pool, or null if none available. - * - * @param fileId - The large file to check out a part upload URL for. - * - * @returns A reusable part upload URL entry, or null if none are available. - */ - checkoutPartUploadUrl(fileId) { - return this.partUploadUrls.checkout(fileId); - } - /** - * Return a still-valid part upload URL to the pool for reuse. - * - * @param fileId - The large file the part upload URL belongs to. - * @param entry - The part upload URL entry to return to the pool. - */ - returnPartUploadUrl(fileId, entry) { - this.partUploadUrls.checkin(fileId, entry); - } - /** - * Remove a part upload URL from the pool after an error. - * - * @param fileId - The large file the failed part upload URL belongs to. - * @param entry - The part upload URL entry to remove from the pool. - */ - evictPartUploadUrl(fileId, entry) { - this.partUploadUrls.evict(fileId, entry); - } - /** - * Retrieve the cached auth response or throw if not yet authorized. - * - * @returns The cached authorization response. - * - * @throws Error if authorize() has not been called. - */ - requireAuth() { - if (!this.auth) throw new Error("Not authorized. Call authorize() first."); - return this.auth; - } -}; -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/in-memory.js + +class InMemoryAccountInfo { + /** Cached authorization response, or null before authorize() is called. */ + auth = null; + /** Pool of reusable small-file upload URLs, keyed by bucket ID. */ + uploadUrls = new UploadUrlPool(); + /** Pool of reusable large-file part upload URLs, keyed by file ID. */ + partUploadUrls = new UploadUrlPool(); + /** + * Store a fresh authorization response, replacing any previous state. + * + * @param auth - The authorize account response to store. + */ + setAuth(auth) { + this.auth = auth; + this.uploadUrls.clear(); + this.partUploadUrls.clear(); + } + /** + * Return the current authorization response, or null if not authorized. + * + * @returns The cached authorization response, or null if not yet authorized. + */ + getAuth() { + return this.auth; + } + /** Discard all cached authorization state and upload URLs. */ + clear() { + this.auth = null; + this.uploadUrls.clear(); + this.partUploadUrls.clear(); + } + /** + * Base URL for B2 API calls. + * + * @returns The base URL for B2 API calls. + * + * @throws Error if not yet authorized. + */ + getApiUrl() { + return this.requireAuth().apiInfo.storageApi.apiUrl; + } + /** + * Base URL for file downloads. + * + * @returns The base URL for file downloads. + * + * @throws Error if not yet authorized. + */ + getDownloadUrl() { + return this.requireAuth().apiInfo.storageApi.downloadUrl; + } + /** + * Current authorization token. + * + * @returns The current authorization token. + * + * @throws Error if not yet authorized. + */ + getAuthToken() { + return this.requireAuth().authorizationToken; + } + /** + * The authorized account ID. + * + * @returns The authorized account identifier. + * + * @throws Error if not yet authorized. + */ + getAccountId() { + return this.requireAuth().accountId; + } + /** + * Server-recommended part size for large file uploads, in bytes. + * + * @returns The server-recommended part size in bytes. + * + * @throws Error if not yet authorized. + */ + getRecommendedPartSize() { + return this.requireAuth().apiInfo.storageApi.recommendedPartSize; + } + /** + * Smallest allowed part size for large file uploads, in bytes. + * + * @returns The smallest allowed part size in bytes. + * + * @throws Error if not yet authorized. + */ + getAbsoluteMinimumPartSize() { + return this.requireAuth().apiInfo.storageApi.absoluteMinimumPartSize; + } + /** + * Base URL for the S3-compatible API. + * + * @returns The base URL for the S3-compatible API. + * + * @throws Error if not yet authorized. + */ + getS3ApiUrl() { + return this.requireAuth().apiInfo.storageApi.s3ApiUrl; + } + /** + * Bucket ID the key is restricted to, or null if unrestricted. + * + * @returns The restricted bucket identifier, or null if the key is unrestricted. + * + * @throws Error if not yet authorized. + */ + getAllowedBucketId() { + return this.requireAuth().apiInfo.storageApi.allowed.bucketId ?? null; + } + /** + * Take an upload URL from the pool for the given bucket, or null if none available. + * + * @param bucketId - The bucket to check out an upload URL for. + * + * @returns A reusable upload URL entry, or null if none are available. + */ + checkoutUploadUrl(bucketId) { + return this.uploadUrls.checkout(bucketId); + } + /** + * Return a still-valid upload URL to the pool for reuse. + * + * @param bucketId - The bucket the upload URL belongs to. + * @param entry - The upload URL entry to return to the pool. + */ + returnUploadUrl(bucketId, entry) { + this.uploadUrls.checkin(bucketId, entry); + } + /** + * Remove an upload URL from the pool after an upload error. + * + * @param bucketId - The bucket the failed upload URL belongs to. + * @param entry - The upload URL entry to remove from the pool. + */ + evictUploadUrl(bucketId, entry) { + this.uploadUrls.evict(bucketId, entry); + } + /** + * Take a large-file part upload URL from the pool, or null if none available. + * + * @param fileId - The large file to check out a part upload URL for. + * + * @returns A reusable part upload URL entry, or null if none are available. + */ + checkoutPartUploadUrl(fileId) { + return this.partUploadUrls.checkout(fileId); + } + /** + * Return a still-valid part upload URL to the pool for reuse. + * + * @param fileId - The large file the part upload URL belongs to. + * @param entry - The part upload URL entry to return to the pool. + */ + returnPartUploadUrl(fileId, entry) { + this.partUploadUrls.checkin(fileId, entry); + } + /** + * Remove a part upload URL from the pool after an error. + * + * @param fileId - The large file the failed part upload URL belongs to. + * @param entry - The part upload URL entry to remove from the pool. + */ + evictPartUploadUrl(fileId, entry) { + this.partUploadUrls.evict(fileId, entry); + } + /** + * Retrieve the cached auth response or throw if not yet authorized. + * + * @returns The cached authorization response. + * + * @throws Error if authorize() has not been called. + */ + requireAuth() { + if (!this.auth) throw new Error("Not authorized. Call authorize() first."); + return this.auth; + } +} //# sourceMappingURL=in-memory.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/ids.js -//#region src/types/ids.ts -/** -* Creates a branded {@link AccountId} from a raw string. -* @param raw - The raw account ID string from the B2 API. -* -* @returns A branded AccountId value. -*/ + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/realms.js +const REALM_URLS = { + production: "https://api.backblazeb2.com", + staging: "https://api.backblazeb2.com" +}; +function getRealmUrl(realm) { + return REALM_URLS[realm] ?? realm; +} + +//# sourceMappingURL=realms.js.map + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/ids.js function accountId(raw) { - return raw; + return raw; } -/** -* Creates a branded {@link BucketId} from a raw string. -* @param raw - The raw bucket ID string from the B2 API. -* -* @returns A branded BucketId value. -*/ function bucketId(raw) { - return raw; + return raw; } -/** -* Creates a branded {@link FileId} from a raw string. -* @param raw - The raw file ID string from the B2 API. -* -* @returns A branded FileId value. -*/ function fileId(raw) { - return raw; + return raw; } -/** -* Creates a branded {@link KeyId} from a raw string. -* @param raw - The raw key ID string from the B2 API. -* -* @returns A branded KeyId value. -*/ function keyId(raw) { - return raw; + return raw; } -/** -* Creates a branded {@link ApplicationKeyId} from a raw string. -* @param raw - The raw application key ID string from the B2 API. -* -* @returns A branded ApplicationKeyId value. -*/ function applicationKeyId(raw) { - return raw; -} -/** -* Creates a branded {@link LargeFileId} from a raw string. -* -* `LargeFileId` is the same wire-level shape as `FileId` but is a -* distinct brand so that "ID of an in-progress multipart upload" and -* "ID of a committed file version" don't get mixed up by accident. -* `b2_start_large_file` returns one; `b2_finish_large_file` consumes it -* and produces a regular `FileId`. -* -* @param raw - The raw large-file ID string from the B2 API. -* -* @returns A branded LargeFileId value. -*/ + return raw; +} function largeFileId(raw) { - return raw; + return raw; } -//#endregion - //# sourceMappingURL=ids.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/retry.js -//#region src/http/retry.ts -/** Default retry settings: 5 retries, 1s initial delay, 64s max delay, 15 minute timeout. */ -var DEFAULT_RETRY_OPTIONS = { - maxRetries: 5, - maxRetryDelayMs: 64e3, - initialRetryDelayMs: 1e3, - requestTimeoutMs: 15 * 6e4 -}; -/** -* Computes the delay before the next retry using exponential backoff with jitter. -* If a `Retry-After` value is provided by the server, it takes precedence over -* the calculated backoff (still capped at {@link RetryOptions.maxRetryDelayMs}). -* -* @param attempt - Zero-based retry attempt index. -* @param options - Retry configuration with delay bounds. -* @param retryAfter - Server-provided retry delay in seconds, if any. -* -* @returns The delay in milliseconds before the next retry attempt. -*/ -function computeBackoff(attempt, options, retryAfter) { - if (retryAfter !== void 0 && retryAfter > 0) return Math.min(retryAfter * 1e3, options.maxRetryDelayMs); - const base = options.initialRetryDelayMs * 2 ** attempt; - const jitter = Math.random() * base * .5; - return Math.min(base + jitter, options.maxRetryDelayMs); -} -/** -* Returns a promise that resolves after the given delay. Supports cancellation -* via an optional AbortSignal. -* -* @param ms - Delay in milliseconds. -* @param signal - Optional abort signal to cancel the sleep early. -* -* @returns A promise that resolves when the delay elapses or rejects if aborted. -*/ -function sleep(ms, signal) { - return new Promise((resolve, reject) => { - if (signal?.aborted) { - reject(signal.reason ?? new DOMException("Aborted", "AbortError")); - return; - } - const timer = setTimeout(resolve, ms); - signal?.addEventListener("abort", () => { - clearTimeout(timer); - reject(signal.reason ?? new DOMException("Aborted", "AbortError")); - }, { once: true }); - }); -} -//#endregion - -//# sourceMappingURL=retry.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/paginator.js -//#region src/util/paginator.ts -/** -* Async-iterates one page at a time. Stops when `fetcher` returns -* `nextCursor: undefined`. -* -* @typeParam Page - The per-page response shape. -* @typeParam Cursor - The cursor type used to request the next page. -* -* @param fetcher - Function that fetches one page given the current cursor. -* @param signal - Optional abort signal. Checked before each fetch. -* -* @returns An async iterable of pages. -* -* @throws DOMException When `signal` is aborted between fetches. -* -* @example -* ```ts -* for await (const page of paginatePages( -* async (cursor) => { -* const resp = await bucket.listFileNames({ startFileName: cursor }) -* return { page: resp, nextCursor: resp.nextFileName ?? undefined } -* }, -* abortSignal, -* )) { -* for (const file of page.files) { ... } -* } -* ``` -*/ -async function* paginatePages(fetcher, signal) { - let cursor; - while (true) { - signal?.throwIfAborted(); - const { page, nextCursor } = await fetcher(cursor); - yield page; - if (nextCursor === void 0) return; - cursor = nextCursor; - } -} -/** -* Async-iterates items by flattening pages. The `extractItems` function -* pulls the relevant array out of each page (e.g. `page.files`, -* `page.keys`, `page.parts`). Each item is yielded individually so the -* caller can `for await (const item of paginator)` rather than nest loops. -* -* Aborts between **pages**, not between items: if `signal` is aborted while -* the caller is processing the items of page N, the iterator will still -* yield all of page N's remaining items before checking the signal before -* fetching page N+1. -* -* @typeParam Page - The per-page response shape. -* @typeParam Cursor - The cursor type used to request the next page. -* @typeParam Item - The item type the caller wants to iterate. -* -* @param fetcher - Function that fetches one page given the current cursor. -* @param extractItems - Pulls the iterable items out of a page. -* @param signal - Optional abort signal. Checked before each fetch. -* -* @returns An async iterable of individual items. -* -* @throws DOMException When `signal` is aborted between fetches. -*/ -async function* paginateItems(fetcher, extractItems, signal) { - for await (const page of paginatePages(fetcher, signal)) yield* extractItems(page); +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/best-effort.js +async function bestEffort(fn) { + try { + await fn(); + } catch { + } } -//#endregion - -//# sourceMappingURL=paginator.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/concurrency.js -//#region src/upload/concurrency.ts -/** -* Bounded concurrency primitive. -* -* Limits the number of concurrent operations to a fixed maximum. Callers -* {@link acquire} a slot before starting work and {@link release} it when done. -* If all slots are taken, `acquire` returns a promise that resolves when a slot -* becomes available. -*/ -var Semaphore = class { - limit; - current = 0; - queue = []; - /** - * @param limit - Maximum number of concurrent acquisitions. Must be a - * positive integer; values `<= 0` would create a semaphore that - * never lets anything through (all `acquire()` calls would queue - * forever), so the constructor throws fast instead. - * - * @throws `RangeError` when `limit` is not a positive integer. - */ - constructor(limit) { - this.limit = limit; - if (!Number.isInteger(limit) || limit <= 0) throw new RangeError(`Semaphore limit must be a positive integer; received ${limit}. A non-positive limit produces a deadlocked semaphore — fail fast at construction instead.`); - } - /** - * Acquires a slot, waiting if the limit has been reached. - * @returns A promise that resolves when a slot is available. - */ - async acquire() { - if (this.current < this.limit) { - this.current++; - return; - } - return new Promise((resolve) => { - this.queue.push(resolve); - }); - } - /** Releases a slot, unblocking the next queued caller if any. */ - release() { - const next = this.queue.shift(); - if (next) next(); - else this.current--; - } - /** - * Number of slots currently available. - * - * @returns The count of free concurrency slots. - */ - get available() { - return this.limit - this.current; - } -}; -/** -* Maps over an array with bounded concurrency. -* -* @param items - Input items to process. -* @param concurrency - Maximum number of items processed in parallel. -* @param fn - Async function applied to each item. -* -* @returns Results in the same order as the input items. -*/ -async function mapConcurrent(items, concurrency, fn) { - const sem = new Semaphore(concurrency); - const results = new Array(items.length); - const tasks = items.map(async (item, i) => { - await sem.acquire(); - try { - results[i] = await fn(item, i); - } finally { - sem.release(); - } - }); - await Promise.all(tasks); - return results; -} -//#endregion - - -//# sourceMappingURL=concurrency.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/file.js -//#region src/types/file.ts -/** -* Named constants for the action that created a file version. -* -* @example -* ```ts -* if (file.action === FileAction.Hide) { ... } -* ``` -*/ -var FileAction = { - /** Large file upload started but not yet finished. */ - Start: "start", - /** Normal upload (small or finished large file). */ - Upload: "upload", - /** Hide marker (soft delete). */ - Hide: "hide", - /** Virtual folder marker. */ - Folder: "folder", - /** Created via server-side copy. */ - Copy: "copy" -}; -/** -* Named constants for how metadata is handled during a file copy. -* -* @example -* ```ts -* await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace }) -* ``` -*/ -var MetadataDirective = { - /** Preserve the source file's contentType and fileInfo. */ - Copy: "COPY", - /** Use the values provided in the copy request. */ - Replace: "REPLACE" -}; -//#endregion +//# sourceMappingURL=best-effort.js.map +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/cancel.js -//# sourceMappingURL=file.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/abort-scope.js -//#region src/upload/abort-scope.ts -/** -* Creates an abort scope linked to an optional upstream signal. -* Task failures can abort the same scope so sibling tasks stop promptly. -* @param upstream - Caller-provided abort signal, if any. -* -* @returns A linked abort scope. -*/ -function createAbortScope(upstream) { - const controller = new AbortController(); - let upstreamAbort; - const abort = (reason) => { - if (!controller.signal.aborted) controller.abort(reason); - }; - if (upstream?.aborted === true) abort(upstream.reason); - else if (upstream !== void 0) { - upstreamAbort = () => abort(upstream.reason); - upstream.addEventListener("abort", upstreamAbort, { once: true }); - } - return { - signal: controller.signal, - abort, - dispose() { - if (upstreamAbort !== void 0) upstream?.removeEventListener("abort", upstreamAbort); - } - }; -} -/** -* Throws the abort reason or first task rejection from a settled task set. -* @param settled - Results from `Promise.allSettled`. -* @param abortScope - Scope that coordinated the tasks. -* -* @throws The abort reason or first rejected task reason. -*/ -function throwRejectedOrAbortReason(settled, abortScope) { - const rejected = settled.find((result) => result.status === "rejected"); - if (rejected === void 0) return; - if (abortScope.signal.aborted && abortScope.signal.reason !== void 0) throw abortScope.signal.reason; - /* v8 ignore next -- Defensive fallback for unexpected task rejections outside the abort scope. */ - throw rejected.reason; -} -/** -* Returns the observable reason for an aborted signal. -* @param signal - Aborted signal to inspect. -* -* @returns The signal's reason, or a standard AbortError when the runtime did not provide one. -*/ -function abortReason(signal) { - return signal.reason ?? new DOMException("Aborted", "AbortError"); -} -/** -* Races a request promise against an abort signal. -* -* The underlying request must still receive the same signal so transports can -* cancel their network work. This helper makes callers stop waiting promptly -* even when a test double or custom transport ignores the signal. -* -* @param promise - Request promise to observe. -* @param signal - Signal that should stop waiting for the request. -* -* @returns The request result if it settles before the signal aborts. -* -* @throws The abort reason if the signal aborts first, or the request rejection. -*/ -async function raceWithAbort(promise, signal) { - if (signal.aborted) { - promise.catch(() => {}); - throw abortReason(signal); - } - let removeAbortListener; - const abort = new Promise((_, reject) => { - const onAbort = () => reject(abortReason(signal)); - signal.addEventListener("abort", onAbort, { once: true }); - removeAbortListener = () => signal.removeEventListener("abort", onAbort); - }); - try { - return await Promise.race([promise, abort]); - } catch (err) { - if (signal.aborted) promise.catch(() => {}); - throw err; - } finally { - removeAbortListener?.(); - } -} -//#endregion - - -//# sourceMappingURL=abort-scope.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/internal/url-redaction.js -//#region src/internal/url-redaction.ts -/** -* Redact a URL before including it in an error message. -* -* @param url - Absolute URL, relative URL, or parsed URL to redact. -* @param options - Optional base URL and invalid-URL placeholder. -* -* @returns A URL string with userinfo, query string, fragment, and path -* segments removed. -*/ -function url_redaction_redactUrlForError(url, options = {}) { - try { - const parsed = url instanceof URL ? new URL(url) : options.baseUrl !== void 0 ? new URL(url, options.baseUrl) : new URL(url); - if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return options.invalidUrlLabel ?? ""; - parsed.username = ""; - parsed.password = ""; - parsed.search = ""; - parsed.hash = ""; - parsed.pathname = redactPathname(parsed.pathname); - return parsed.toString(); - } catch { - return options.invalidUrlLabel ?? ""; - } -} -function redactPathname(pathname) { - return pathname.split("/").some(Boolean) ? "/..." : pathname; -} -//#endregion - - -//# sourceMappingURL=url-redaction.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/errors.js -//#region src/types/errors.ts -/** -* B2 API error codes documented by the SDK. -* This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback -* so callers can receive unknown future server codes while keeping autocomplete -* for known values. -*/ -var KNOWN_B2_ERROR_CODES = [ - "expired_auth_token", - "bad_auth_token", - "unauthorized", - "bad_request", - "bad_bucket_name", - "bad_bucket_id", - "not_found", - "method_not_allowed", - "request_timeout", - "too_many_requests", - "conflict", - "duplicate_bucket_name", - "too_many_buckets", - "too_many_files", - "cap_exceeded", - "storage_cap_exceeded", - "transaction_cap_exceeded", - "download_cap_exceeded", - "access_denied", - "service_unavailable", - "internal_error", - "bad_json", - "invalid_bucket_id", - "invalid_bucket_name", - "invalid_bucket_info", - "file_not_present", - "no_such_file", - "out_of_range", - "range_not_satisfiable", - "invalid_file_id", - "invalid_file_name", - "invalid_file_info", - "invalid_part_number", - "bad_sha1_checksum" -]; -//#endregion - - -//# sourceMappingURL=errors.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/errors/index.js - - -//#region src/errors/index.ts -/** -* Typed error hierarchy for B2 API failures. -* -* Every B2 error response maps to a specific {@link B2Error} subclass. -* Retry behavior is exposed through {@link B2Error.retryable}. -* Examples include {@link ExpiredAuthTokenError} and {@link CapExceededError}. -* Use {@link classifyError} to convert a raw error response into the -* appropriate subclass. -* -* Convention: most `B2Error` subclasses represent failures returned by the B2 -* API. The client-side exception is {@link B2RealmConfigurationError}; it -* extends `B2Error` so realm-validation failures can be handled with the SDK -* error hierarchy before credentials are sent. -* -* Other programming errors and SDK preconditions, such as "not yet authorized", -* "stream consumed twice", or "called before init", use the native `Error` -* constructor instead. The direct `Error` outliers are -* {@link B2InsufficientCapabilityError}, {@link B2RedirectError}, -* {@link B2SsrfError}, {@link NetworkError}, -* {@link ResumeFileIdMismatchError}, {@link UploadResponseBodyError}, and -* {@link FinishLargeFileResponseBodyError}. -* -* @packageDocumentation -*/ -/** Thrown when an explicit resumeFileId is not compatible with the requested upload. */ -var ResumeFileIdMismatchError = class extends Error { - /** Caller-supplied unfinished large file ID that failed verification. */ - fileId; - /** Requested destination file name. */ - fileName; - /** - * Creates a new resume-file ID mismatch error. - * @param fileId - Caller-supplied unfinished large file ID that failed verification. - * @param fileName - Requested destination file name. - */ - constructor(fileId, fileName) { - super(`uploadLargeFile: resumeFileId ${fileId} does not identify a compatible unfinished large file for ${fileName}.`); - this.name = "ResumeFileIdMismatchError"; - this.fileId = fileId; - this.fileName = fileName; - } -}; -/** -* Base error class for all B2 API errors. -* Contains the HTTP status, B2 error code, and retry metadata from the response. -*/ -var B2Error = class extends Error { - /** HTTP status code returned by the B2 API. */ - status; - /** B2 error code identifying the error type (e.g. `expired_auth_token`). */ - code; - /** B2 request ID from the `X-Bz-Request-Id` response header, if present. */ - requestId; - /** Retry delay in seconds from the `Retry-After` response header, if present. */ - retryAfter; - /** Whether this error is transient and the request can be retried. */ - retryable; - /** - * Creates a new B2Error instance. - * @param response - Parsed B2 error response body. - * @param options - Optional retry and request metadata from response headers. - */ - constructor(response, options) { - super(response.message); - this.name = "B2Error"; - this.status = response.status; - this.code = response.code; - if (options?.retryAfter !== void 0) this.retryAfter = options.retryAfter; - if (options?.requestId !== void 0) this.requestId = options.requestId; - this.retryable = isTransient(response.status, response.code); - } -}; -/** Thrown when the auth token has expired. Triggers automatic re-authorization. */ -var ExpiredAuthTokenError = class extends B2Error { - /** - * Creates a new ExpiredAuthTokenError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "ExpiredAuthTokenError"; - } -}; -/** Thrown when the auth token is invalid or unauthorized. */ -var BadAuthTokenError = class extends B2Error { - /** - * Creates a new BadAuthTokenError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "BadAuthTokenError"; - } -}; -/** Thrown when the B2 service is temporarily unavailable (HTTP 503). */ -var ServiceUnavailableError = class extends B2Error { - /** - * Creates a new ServiceUnavailableError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "ServiceUnavailableError"; - } -}; -/** Thrown when B2 reports an internal server error. */ -var InternalError = class extends B2Error { - /** - * Creates a new InternalError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "InternalError"; - } -}; -/** Thrown when a request times out on the server side (HTTP 408). */ -var RequestTimeoutError = class extends B2Error { - /** - * Creates a new RequestTimeoutError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "RequestTimeoutError"; - } -}; -/** Thrown when the client has sent too many requests (HTTP 429). */ -var TooManyRequestsError = class extends B2Error { - /** - * Creates a new TooManyRequestsError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "TooManyRequestsError"; - } -}; -/** Thrown when the account has reached the maximum number of buckets. */ -var TooManyBucketsError = class extends B2Error { - /** - * Creates a new TooManyBucketsError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "TooManyBucketsError"; - } -}; -/** Thrown when the bucket or request has reached the maximum number of files. */ -var TooManyFilesError = class extends B2Error { - /** - * Creates a new TooManyFilesError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "TooManyFilesError"; - } -}; -/** Thrown when a storage, transaction, or download cap has been exceeded. */ -var CapExceededError = class extends B2Error { - /** - * Creates a new CapExceededError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "CapExceededError"; - } -}; -/** Thrown when the application key does not have permission for the requested operation. */ -var AccessDeniedError = class extends B2Error { - /** - * Creates a new AccessDeniedError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "AccessDeniedError"; - } -}; -/** Thrown when the requested file does not exist. */ -var FileNotPresentError = class extends B2Error { - /** - * Creates a new FileNotPresentError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "FileNotPresentError"; - } -}; -/** Thrown when a requested B2 resource does not exist. */ -var NotFoundError = class extends B2Error { - /** - * Creates a new NotFoundError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "NotFoundError"; - } -}; -/** Thrown when creating a bucket with a name that already exists in the account. */ -var DuplicateBucketNameError = class extends B2Error { - /** - * Creates a new DuplicateBucketNameError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "DuplicateBucketNameError"; - } -}; -/** Thrown when a bucket name is malformed, reserved, or otherwise rejected by B2. */ -var InvalidBucketNameError = class extends B2Error { - /** - * Creates a new InvalidBucketNameError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "InvalidBucketNameError"; - } -}; -/** Thrown when bucket metadata fails B2 validation. */ -var InvalidBucketInfoError = class extends B2Error { - /** - * Creates a new InvalidBucketInfoError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "InvalidBucketInfoError"; - } -}; -/** Thrown when a bucket ID is malformed or does not identify a valid bucket. */ -var BadBucketIdError = class extends B2Error { - /** - * Creates a new BadBucketIdError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "BadBucketIdError"; - } -}; -/** Thrown when the B2 endpoint does not allow the request method. */ -var MethodNotAllowedError = class extends B2Error { - /** - * Creates a new MethodNotAllowedError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "MethodNotAllowedError"; - } -}; -/** Thrown when the request conflicts with current B2 resource state. */ -var ConflictError = class extends B2Error { - /** - * Creates a new ConflictError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "ConflictError"; - } -}; -/** Thrown for general bad request errors (HTTP 400) not covered by a more specific subclass. */ -var BadRequestError = class extends B2Error { - /** - * Creates a new BadRequestError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "BadRequestError"; - } -}; -/** Thrown when B2 cannot parse the JSON request body. */ -var BadJsonError = class extends B2Error { - /** - * Creates a new BadJsonError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "BadJsonError"; - } -}; -/** Thrown when a bucket ID has a valid shape but does not identify a usable bucket. */ -var InvalidBucketIdError = class extends B2Error { - /** - * Creates a new InvalidBucketIdError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "InvalidBucketIdError"; - } -}; -/** Thrown when a numeric request parameter is outside the allowed range. */ -var OutOfRangeError = class extends B2Error { - /** - * Creates a new OutOfRangeError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "OutOfRangeError"; - } -}; -/** Thrown when a requested byte range cannot be satisfied. */ -var RangeNotSatisfiableError = class extends B2Error { - /** - * Creates a new RangeNotSatisfiableError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "RangeNotSatisfiableError"; - } -}; -/** Thrown when a file name is malformed or otherwise rejected by B2. */ -var InvalidFileNameError = class extends B2Error { - /** - * Creates a new InvalidFileNameError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "InvalidFileNameError"; - } -}; -/** Thrown when file metadata fails B2 validation. */ -var InvalidFileInfoError = class extends B2Error { - /** - * Creates a new InvalidFileInfoError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "InvalidFileInfoError"; - } -}; -/** Thrown when a file ID is malformed or does not identify a valid file. */ -var InvalidFileIdError = class extends B2Error { - /** - * Creates a new InvalidFileIdError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "InvalidFileIdError"; - } -}; -/** Thrown when a multipart upload part number is invalid. */ -var InvalidPartNumberError = class extends B2Error { - /** - * Creates a new InvalidPartNumberError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "InvalidPartNumberError"; - } -}; -/** -* Thrown when an upload URL is no longer valid and must be refreshed. -* -* Forward-compat insurance: B2 does not currently surface a distinct -* error code for this case, so {@link classifyError} never actually -* instantiates this class today. It's part of the public API so -* consumers can pre-write `instanceof` checks; when B2 documents a -* `bad_upload_url` (or similar) error code, the `classifyError` -* switch gets a matching case and existing consumer code starts -* catching the typed error without any changes on their side. -* -* Until then, expect `BadRequestError` for upload-URL invalidation -* scenarios — that's what B2 currently returns. -*/ -var BadUploadUrlError = class extends B2Error { - /** - * Creates a new BadUploadUrlError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "BadUploadUrlError"; - } -}; -/** -* Thrown when the uploaded file's SHA-1 checksum does not match the -* expected value. -* -* When B2 returns `bad_sha1_checksum`, {@link classifyError} instantiates -* this class so callers can handle checksum failures with `instanceof`. -* Generic `bad_request` checksum failures continue to classify as -* {@link BadRequestError}. -*/ -var ChecksumMismatchError = class extends B2Error { - /** - * Creates a new ChecksumMismatchError instance. - * @param response - Parsed B2 error response body. - * @param options - Optional metadata from response headers. - */ - constructor(response, options) { - super(response, options); - this.name = "ChecksumMismatchError"; - } -}; -/** -* Thrown by client-side capability checks when the application key is missing -* capabilities required by an operation. Not raised by the server. -*/ -var B2InsufficientCapabilityError = class extends Error { - /** Capabilities that were required for the operation. */ - required; - /** Capabilities that the current key actually has. */ - available; - /** Capabilities present in `required` but not in `available`. */ - missing; - /** - * Creates a new B2InsufficientCapabilityError instance. - * - * @param required - Capabilities the operation requires. - * @param available - Capabilities the current key holds. - * @param missing - The subset of required that isn't available. - */ - constructor(required, available, missing) { - super(`Application key is missing capabilities: ${missing.join(", ")}`); - this.name = "B2InsufficientCapabilityError"; - this.required = required; - this.available = available; - this.missing = missing; - } -}; -/** -* Thrown when the SDK is asked to fetch a URL whose host is outside the -* authorized B2 realm. Defense against SSRF / URL-substitution attacks where -* a compromised or hostile B2 endpoint returns an upload URL pointing at an -* internal service (e.g. cloud metadata at `169.254.169.254`). -* -* Not retryable. -*/ -var B2SsrfError = class extends Error { - /** Always `false` — this is a security failure, not transient. */ - retryable = false; - /** - * Creates a new {@link B2SsrfError}. - * - * @param message - Human-readable description of which URL was rejected and why. - * @param url - The URL that was rejected. Stored as a sanitized URL. - */ - constructor(message, url) { - const safeUrl = url_redaction_redactUrlForError(url); - super(`${message.split(url).join(safeUrl)} (${safeUrl})`); - this.name = "B2SsrfError"; - this.url = safeUrl; - } - /** Sanitized URL that was rejected. */ - url; -}; -/** Thrown when a configured auth realm cannot safely be used for authorization. */ -var B2RealmConfigurationError = class extends B2Error { - /** - * Creates a new B2RealmConfigurationError instance. - * - * @param message - Human-readable description of the invalid realm setting. - */ - constructor(message) { - super({ - status: 400, - code: "bad_request", - message - }); - this.name = "B2RealmConfigurationError"; - } -}; -/** Thrown when the SDK refuses to follow an HTTP redirect automatically. */ -var B2RedirectError = class extends Error { - /** Always `false` because a blocked redirect is deterministic. */ - retryable = false; - /** Sanitized request URL whose response attempted to redirect. */ - url; - /** HTTP redirect status code, or 0 for an opaque browser redirect. */ - status; - /** Sanitized redirect target, or `null` when no Location header was present. */ - location; - /** - * Creates a new B2RedirectError instance. - * - * @param url - Request URL whose response attempted to redirect. Stored as a sanitized URL. - * @param status - HTTP redirect status code. - * @param location - Redirect Location header, if present. Stored as a sanitized URL. - */ - constructor(url, status, location) { - const safeUrl = url_redaction_redactUrlForError(url); - const safeLocation = location !== null ? url_redaction_redactUrlForError(location, { baseUrl: url }) : null; - super(safeLocation !== null ? `HTTP ${status} redirect blocked for ${safeUrl} to ${safeLocation}` : `HTTP ${status} redirect blocked for ${safeUrl}`); - this.name = "B2RedirectError"; - this.url = safeUrl; - this.status = status; - this.location = safeLocation; - } -}; -/** Thrown when a network-level failure occurs (DNS, TCP, TLS). Always retryable. */ -var NetworkError = class extends Error { - cause; - /** Always `true` since network errors are transient. */ - retryable = true; - /** - * Creates a new NetworkError instance. - * @param message - Human-readable description of the network failure. - * @param cause - The underlying error that caused this failure, if any. - */ - constructor(message, cause) { - super(message); - this.cause = cause; - this.name = "NetworkError"; - } -}; -/** -* Thrown when an upload POST returned a response but its body could not be -* read. The upload may already have been stored by B2, so retrying this error -* can create duplicate file versions or parts. -*/ -var UploadResponseBodyError = class extends Error { - /** Underlying response body error, when available. */ - cause; - /** - * Creates a new UploadResponseBodyError instance. - * @param message - Human-readable description of the response read failure. - * @param options - Optional cause. - */ - constructor(message, options = {}) { - super(message, { cause: options.cause }); - this.name = "UploadResponseBodyError"; - if (options.cause !== void 0) this.cause = options.cause; - } -}; -/** -* Thrown when `b2_finish_large_file` returned a response but its body could not -* be read. The large file may already be committed server-side, so high-level -* upload paths do not cancel the large file after this error. -*/ -var FinishLargeFileResponseBodyError = class extends Error { - /** Ambiguous large file ID that may already be committed server-side. */ - fileId; - /** Bucket requested by the high-level upload, when available. */ - bucketId; - /** File name requested by the high-level upload, when available. */ - fileName; - /** - * Creates a new FinishLargeFileResponseBodyError instance. - * @param message - Human-readable description of the response read failure. - * @param options - Optional cause and reconciliation metadata. - */ - constructor(message, options = {}) { - super(message, { cause: options.cause }); - this.name = "FinishLargeFileResponseBodyError"; - if (options.cause !== void 0) this.cause = options.cause; - if (options.fileId !== void 0) this.fileId = options.fileId; - if (options.bucketId !== void 0) this.bucketId = options.bucketId; - if (options.fileName !== void 0) this.fileName = options.fileName; - } -}; -function isTransient(status, code) { - if (status === 408 || status === 429) return true; - if (status === 500 || status === 502 || status === 503 || status === 504) return true; - if (code === "expired_auth_token") return true; - if (code === "service_unavailable" || code === "request_timeout") return true; - return false; -} -var knownB2ErrorCodes = new Set(KNOWN_B2_ERROR_CODES); -function isKnownB2ErrorCode(code) { - return knownB2ErrorCodes.has(code); -} -function assertNever(value) { - throw new Error(`Unhandled B2 error code: ${String(value)}`); -} -function classifyKnownError(response, code, options) { - switch (code) { - case "expired_auth_token": return new ExpiredAuthTokenError(response, options); - case "bad_auth_token": - case "unauthorized": return new BadAuthTokenError(response, options); - case "bad_request": return new BadRequestError(response, options); - case "bad_bucket_name": - case "invalid_bucket_name": return new InvalidBucketNameError(response, options); - case "bad_bucket_id": return new BadBucketIdError(response, options); - case "not_found": return new NotFoundError(response, options); - case "method_not_allowed": return new MethodNotAllowedError(response, options); - case "request_timeout": return new RequestTimeoutError(response, options); - case "too_many_requests": return new TooManyRequestsError(response, options); - case "conflict": return new ConflictError(response, options); - case "duplicate_bucket_name": return new DuplicateBucketNameError(response, options); - case "too_many_buckets": return new TooManyBucketsError(response, options); - case "too_many_files": return new TooManyFilesError(response, options); - case "cap_exceeded": - case "storage_cap_exceeded": - case "transaction_cap_exceeded": - case "download_cap_exceeded": return new CapExceededError(response, options); - case "access_denied": return new AccessDeniedError(response, options); - case "service_unavailable": return new ServiceUnavailableError(response, options); - case "internal_error": return new InternalError(response, options); - case "bad_json": return new BadJsonError(response, options); - case "invalid_bucket_id": return new InvalidBucketIdError(response, options); - case "invalid_bucket_info": return new InvalidBucketInfoError(response, options); - case "file_not_present": - case "no_such_file": return new FileNotPresentError(response, options); - case "out_of_range": return new OutOfRangeError(response, options); - case "range_not_satisfiable": return new RangeNotSatisfiableError(response, options); - case "invalid_file_id": return new InvalidFileIdError(response, options); - case "invalid_file_name": return new InvalidFileNameError(response, options); - case "invalid_file_info": return new InvalidFileInfoError(response, options); - case "invalid_part_number": return new InvalidPartNumberError(response, options); - case "bad_sha1_checksum": return new ChecksumMismatchError(response, options); - default: return assertNever(code); - } -} -function classifyUnknownError(response, options) { - if (response.status === 429) return new TooManyRequestsError(response, options); - if (response.status === 503) return new ServiceUnavailableError(response, options); - if (response.status === 408) return new RequestTimeoutError(response, options); - return new B2Error(response, options); -} -/** -* Maps a B2 error response to the appropriate {@link B2Error} subclass. -* Uses known error codes for exact matching, then falls back to HTTP status -* codes for unknown future B2 codes. -* -* Maintainer note: when B2 documents a new error code, add it to -* `KNOWN_B2_ERROR_CODES` in `src/types/errors.ts` and add a matching -* `classifyKnownError` switch case. Unknown codes fall through to the -* HTTP-status-based heuristic and finally to a generic `B2Error`, which is -* safe but loses semantic specificity (the caller can't `instanceof` against -* a precise subclass and the retry decision relies on status alone). -* -* @param response - Parsed B2 error response body. -* @param options - Optional retry and request metadata from response headers. -* -* @returns A typed B2Error subclass instance. -*/ -function classifyError(response, options) { - if (response.code === "internal_error" && response.status !== 500) return classifyUnknownError(response, options); - if (isKnownB2ErrorCode(response.code)) return classifyKnownError(response, response.code, options); - return classifyUnknownError(response, options); +async function cancelLargeFileBestEffort(raw, accountInfo, fileId) { + await bestEffort( + () => raw.cancelLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId }) + ); } -//#endregion +//# sourceMappingURL=cancel.js.map -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/best-effort.js -//#region src/util/best-effort.ts -/** -* Runs an async cleanup operation and swallows any rejection. -* -* Used at error-handling boundaries (e.g. after a multipart upload fails, -* when trying to `cancelLargeFile` on the orphaned upload). The primary -* error is what the caller wants to see; a secondary failure during -* cleanup must not shadow it. -* -* Naming the pattern instead of inlining a try/catch with an empty catch -* makes the intent explicit at the call site: this is best-effort cleanup, -* not a silent error swallow. -* -* @param fn - Cleanup async function. Its return value is ignored; any -* thrown error or rejected promise is caught and discarded. -* @param onError - Optional observer called with the swallowed cleanup error. -* -* @returns A promise that always resolves, regardless of `fn`'s outcome. -* -* @example -* ```ts -* try { -* await uploadParts(...) -* } catch (err) { -* await bestEffort(() => -* raw.cancelLargeFile(apiUrl, authToken, { fileId: largeFileId }), -* ) -* throw err -* } -* ``` -*/ -async function bestEffort(fn, onError) { - try { - await fn(); - } catch (error) { - try { - onError?.(error); - } catch {} - } -} -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/concurrency.js +class Semaphore { + /** + * @param limit - Maximum number of concurrent acquisitions. Must be a + * positive integer; values `<= 0` would create a semaphore that + * never lets anything through (all `acquire()` calls would queue + * forever), so the constructor throws fast instead. + * + * @throws `RangeError` when `limit` is not a positive integer. + */ + constructor(limit) { + this.limit = limit; + if (!Number.isInteger(limit) || limit <= 0) { + throw new RangeError( + `Semaphore limit must be a positive integer; received ${limit}. A non-positive limit produces a deadlocked semaphore — fail fast at construction instead.` + ); + } + } + current = 0; + queue = []; + /** + * Acquires a slot, waiting if the limit has been reached. + * @returns A promise that resolves when a slot is available. + */ + async acquire() { + if (this.current < this.limit) { + this.current++; + return; + } + return new Promise((resolve) => { + this.queue.push(resolve); + }); + } + /** Releases a slot, unblocking the next queued caller if any. */ + release() { + const next = this.queue.shift(); + if (next) { + next(); + } else { + this.current--; + } + } + /** + * Number of slots currently available. + * + * @returns The count of free concurrency slots. + */ + get available() { + return this.limit - this.current; + } +} +//# sourceMappingURL=concurrency.js.map -//# sourceMappingURL=best-effort.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/cancel.js - - -//#region src/upload/cancel.ts -/** Default wall-clock bound for best-effort cleanup calls after upload failure. */ -var DEFAULT_CLEANUP_TIMEOUT_MS = 3e4; -var fallbackCleanupDisposers = /* @__PURE__ */ new WeakMap(); -/** -* Cancels an unfinished large file on a best-effort basis. Used at every -* error-handling boundary in the multipart upload, write-stream, and -* server-side copy paths to roll back in-progress uploads without -* letting a cancellation failure mask the underlying error the caller -* is about to see. -* -* Centralising the call removes a five-line `bestEffort` block that -* recurred at six sites with identical shape — the only thing that -* changed was the captured `fileId` and the surrounding error trail. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state for the API URL + token. -* @param fileId - The in-progress large file ID to cancel. -* @param options - Optional request controls and cleanup-failure observer. -* -* @returns A promise that always resolves, regardless of the cancel -* call's outcome. -*/ -async function cancelLargeFileBestEffort(raw, accountInfo, fileId, options) { - await bestEffort(async () => { - const requestOptions = cleanupRequestOptions(options?.signal); - await waitForCleanup(raw.cancelLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId }, requestOptions), requestOptions.signal); - }, (error) => options?.onCleanupFailure?.({ - fileId, - error, - reason: "cancel-failed" - })); -} -/** -* Returns cleanup request controls with a live timeout signal. -* -* @param signal - Caller-provided abort signal, if any. -* @param timeoutMs - Maximum time to spend waiting for cleanup. -* -* @returns Request controls with a signal independent of an already-aborted caller signal. -*/ -function cleanupRequestOptions(signal, timeoutMs = DEFAULT_CLEANUP_TIMEOUT_MS) { - return { signal: createCleanupSignal(signal, timeoutMs) }; -} -function createCleanupSignal(signal, timeoutMs) { - if (typeof AbortSignal.timeout === "function") { - if (signal === void 0 || signal.aborted) return AbortSignal.timeout(timeoutMs); - if (typeof AbortSignal.any === "function") return AbortSignal.any([signal, AbortSignal.timeout(timeoutMs)]); - } - return createFallbackCleanupSignal(signal, timeoutMs); -} -function createFallbackCleanupSignal(signal, timeoutMs) { - const controller = new AbortController(); - const timeout = setTimeout(() => { - abortFallbackCleanup(controller, cleanupTimeoutReason(), cleanup); - }, timeoutMs); - const onAbort = () => { - const reason = signal === void 0 ? cleanupDomException("Cleanup aborted", "AbortError") : cleanupAbortReason(signal); - abortFallbackCleanup(controller, reason, cleanup); - }; - const cleanup = () => { - clearTimeout(timeout); - signal?.removeEventListener("abort", onAbort); - fallbackCleanupDisposers.delete(controller.signal); - }; - fallbackCleanupDisposers.set(controller.signal, cleanup); - if (signal === void 0 || signal.aborted) return controller.signal; - signal.addEventListener("abort", onAbort, { once: true }); - controller.signal.addEventListener("abort", cleanup, { once: true }); - return controller.signal; -} -function abortFallbackCleanup(controller, reason, cleanup) { - if (!controller.signal.aborted) controller.abort(reason); - cleanup(); -} -async function waitForCleanup(request, signal) { - if (signal.aborted) throw cleanupAbortReason(signal); - let removeAbortListener; - const aborted = new Promise((_resolve, reject) => { - const onAbort = () => reject(cleanupAbortReason(signal)); - signal.addEventListener("abort", onAbort, { once: true }); - removeAbortListener = () => signal.removeEventListener("abort", onAbort); - }); - try { - await Promise.race([request, aborted]); - } finally { - removeAbortListener?.(); - fallbackCleanupDisposers.get(signal)?.(); - request.catch(() => {}); - } -} -function cleanupAbortReason(signal) { - return signal.reason ?? cleanupDomException("Cleanup aborted", "AbortError"); -} -function cleanupTimeoutReason() { - return cleanupDomException("Cleanup timed out", "TimeoutError"); -} -function cleanupDomException(message, name) { - if (typeof DOMException === "function") return new DOMException(message, name); - const error = new Error(message); - error.name = name; - return error; -} -/** -* Emits an observable cleanup event when cancellation is deliberately skipped -* because `b2_finish_large_file` may already have committed the file. -* @param fileId - Large file whose final state is ambiguous. -* @param error - Ambiguous finish error that will be thrown to the caller. -* @param onCleanupFailure - Optional observer for cleanup-related events. -*/ -function notifyAmbiguousLargeFileCleanupSkipped(fileId, error, onCleanupFailure) { - try { - onCleanupFailure?.({ - fileId, - error, - reason: "finish-ambiguous" - }); - } catch {} -} -/** -* Adds high-level reconciliation metadata to an ambiguous finish response-body -* error and notifies the cleanup observer that cancellation was skipped. -* -* @param err - Raw finish response-body error from the low-level client. -* @param options - Large-file context used for reconciliation. -* -* @returns The enriched {@link FinishLargeFileResponseBodyError}. -*/ -function handleAmbiguousFinishLargeFileResponseBodyError(err, options) { - const enriched = err.fileId === options.fileId && err.bucketId === options.bucketId && err.fileName === options.fileName ? err : new FinishLargeFileResponseBodyError(err.message, { - cause: err.cause ?? err, - fileId: options.fileId, - bucketId: options.bucketId, - fileName: options.fileName - }); - notifyAmbiguousLargeFileCleanupSkipped(options.fileId, enriched, options.onCleanupFailure); - return enriched; -} -/** -* Performs the shared large-file failure policy: ambiguous finish-body errors -* are enriched and left uncancelled, while all pre-finish errors trigger -* best-effort cancellation. -* -* @param err - Error from a multipart upload/copy/write-stream path. -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param context - Large file metadata used for cleanup and diagnostics. -* @param options - Cleanup policy controls. -* -* @returns The error that should be surfaced to the caller. -*/ -async function resolveLargeFileErrorAfterCleanup(err, raw, accountInfo, context, options = {}) { - if (err instanceof FinishLargeFileResponseBodyError) return handleAmbiguousFinishLargeFileResponseBodyError(err, context); - if (options.cancelOnError ?? true) await cancelLargeFileBestEffort(raw, accountInfo, context.fileId, { - ...context.signal !== void 0 ? { signal: context.signal } : {}, - ...context.onCleanupFailure !== void 0 ? { onCleanupFailure: context.onCleanupFailure } : {} - }); - return err; -} -/** -* Throwing wrapper around {@link resolveLargeFileErrorAfterCleanup} for paths -* that can surface the error directly. -* @param err - Error from a multipart upload/copy/write-stream path. -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param context - Large file metadata used for cleanup and diagnostics. -* @param options - Cleanup policy controls. -* -* @throws The resolved large-file error after cleanup policy is applied. -*/ -async function cleanupAfterLargeFileError(err, raw, accountInfo, context, options) { - throw await resolveLargeFileErrorAfterCleanup(err, raw, accountInfo, context, options); -} -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/defaults.js +const DEFAULT_TRANSFER_CONCURRENCY = 4; +const DEFAULT_BULK_CONCURRENCY = 10; +const DEFAULT_PAGE_SIZE = 1e3; +const DEFAULT_CONTENT_TYPE = "b2/x-auto"; +//# sourceMappingURL=defaults.js.map -//# sourceMappingURL=cancel.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/finish.js - -//#region src/upload/finish.ts -/** -* Calls `b2_finish_large_file` and classifies failures after dispatch that can -* hide an already-committed file as ambiguous finish failures. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param context - Finish request data and reconciliation metadata. -* -* @returns The completed file version metadata. -*/ -async function finishLargeFileWithAbortReconciliation(raw, accountInfo, context) { - context.signal?.throwIfAborted(); - try { - return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { - fileId: context.fileId, - partSha1Array: context.partSha1s - }, context.signal === void 0 && context.retry === void 0 ? void 0 : { - ...context.signal !== void 0 ? { signal: context.signal } : {}, - ...context.retry !== void 0 ? { retry: context.retry } : {} - }); - } catch (err) { - if (err instanceof FinishLargeFileResponseBodyError) throw finishLargeFileResponseBodyErrorWithContext(err, context); - if (isAmbiguousFinishDispatchFailure(err, context.signal)) throw new FinishLargeFileResponseBodyError("b2_finish_large_file failed after dispatch; final file state is ambiguous.", { - cause: err, - fileId: context.fileId, - bucketId: context.bucketId, - fileName: context.fileName - }); - throw err; - } -} -function finishLargeFileResponseBodyErrorWithContext(err, context) { - if (err.fileId === context.fileId && err.bucketId === context.bucketId && err.fileName === context.fileName) return err; - return new FinishLargeFileResponseBodyError(err.message, { - cause: err.cause ?? err, - fileId: context.fileId, - bucketId: context.bucketId, - fileName: context.fileName - }); -} -function isAmbiguousFinishDispatchFailure(err, signal) { - if (err instanceof NetworkError) return true; - if (isTimeoutError(err)) return true; - if (signal?.aborted !== true) return false; - if (signal.reason !== void 0 && Object.is(err, signal.reason)) return true; - return isAbortError(err); -} -function isAbortError(err) { - return err instanceof DOMException && err.name === "AbortError" || err instanceof Error && err.name === "AbortError"; -} -function isTimeoutError(err) { - return err instanceof DOMException && err.name === "TimeoutError" || err instanceof Error && err.name === "TimeoutError"; -} -//#endregion - - -//# sourceMappingURL=finish.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/plan-ranges.js -//#region src/util/plan-ranges.ts -/** -* Lays out a sequence of contiguous, non-overlapping byte ranges over -* `[0, totalSize)`. Every produced range is at most `chunkSize` bytes -* long; the final range may be shorter if `totalSize` is not a multiple -* of `chunkSize`. -* -* Replaces three near-identical hand-rolled loops in -* `upload/large.ts`, `copy/large.ts`, and `download/parallel.ts`. -* -* @param totalSize - Total number of bytes to cover. -* @param chunkSize - Target size of each range in bytes (last range may be smaller). -* -* @returns Ordered, non-overlapping range plans. Empty array when `totalSize === 0`. -*/ +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/plan-ranges.js function planRanges(totalSize, chunkSize) { - const plans = []; - let offset = 0; - let index = 0; - while (offset < totalSize) { - const length = Math.min(chunkSize, totalSize - offset); - const end = offset + length - 1; - plans.push({ - partNumber: index + 1, - index, - offset, - length, - start: offset, - end - }); - offset += length; - index++; - } - return plans; -} -/** -* Format an HTTP `Range:` request-header value covering the given -* inclusive byte offsets. Centralises the `bytes=-` template -* so the upload, copy, and download paths agree on syntax. -* -* @param start - Inclusive starting byte. -* @param end - Inclusive ending byte. -* -* @returns The header value (e.g. `'bytes=0-99'`). -*/ + const plans = []; + let offset = 0; + let index = 0; + while (offset < totalSize) { + const length = Math.min(chunkSize, totalSize - offset); + const end = offset + length - 1; + plans.push({ + partNumber: index + 1, + index, + offset, + length, + start: offset, + end + }); + offset += length; + index++; + } + return plans; +} function byteRangeHeader(start, end) { - return `bytes=${start}-${end}`; + return `bytes=${start}-${end}`; } -//#endregion - //# sourceMappingURL=plan-ranges.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/copy/large.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/copy/large.js - - -//#region src/copy/large.ts -/** -* Performs a server-side copy of a file using the multipart `b2_copy_part` protocol. -* The source bytes never traverse the client; B2 copies each range internally. -* -* Falls back to a single `copyFile` call when the source fits in one part. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state (used to resolve API URL, recommended part size). -* @param options - Copy parameters including source, destination, and concurrency. -* -* @returns The resulting destination {@link FileVersion}. -*/ async function copyLargeFile(raw, accountInfo, options) { - options.signal?.throwIfAborted(); - const recommendedPartSize = accountInfo.getRecommendedPartSize(); - const minPartSize = accountInfo.getAbsoluteMinimumPartSize(); - const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize); - const concurrency = options.concurrency ?? 4; - const sourceInfo = await raw.getFileInfo(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId: options.sourceFileId }); - const totalSize = sourceInfo.contentLength; - if (totalSize <= partSize) { - options.signal?.throwIfAborted(); - const replaceMetadata = options.contentType !== void 0 || options.fileInfo !== void 0; - return raw.copyFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { - sourceFileId: options.sourceFileId, - fileName: options.fileName, - ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : {}, - ...replaceMetadata ? { - metadataDirective: MetadataDirective.Replace, - contentType: options.contentType ?? sourceInfo.contentType ?? "b2/x-auto", - fileInfo: options.fileInfo ?? {} - } : {}, - ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}, - ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {} - }, options.signal !== void 0 ? { signal: options.signal } : void 0); - } - const destBucketId = options.destinationBucketId ?? sourceInfo.bucketId; - const ranges = planRanges(totalSize, partSize); - const partSha1s = new Array(ranges.length); - const sem = new Semaphore(concurrency); - const abortScope = createAbortScope(options.signal); - let largeFileId; - try { - abortScope.signal.throwIfAborted(); - const startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { - bucketId: destBucketId, - fileName: options.fileName, - contentType: options.contentType ?? sourceInfo.contentType ?? "b2/x-auto", - fileInfo: options.fileInfo ?? {}, - ...options.destinationServerSideEncryption !== void 0 ? { serverSideEncryption: options.destinationServerSideEncryption } : {} - }, { signal: abortScope.signal }); - try { - largeFileId = (await raceWithAbort(startPromise, abortScope.signal)).fileId; - } catch (err) { - if (abortScope.signal.aborted) cancelLargeFileAfterStart(startPromise, raw, accountInfo, options.onCleanupFailure); - throw err; - } - const startedLargeFileId = largeFileId; - if (startedLargeFileId === void 0) throw new Error("copyLargeFile: start did not return a large file ID."); - const tasks = ranges.map(async (range) => { - await sem.acquire(); - try { - abortScope.signal.throwIfAborted(); - const resp = await raceWithAbort(raw.copyPart(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { - sourceFileId: options.sourceFileId, - largeFileId: fileId(startedLargeFileId), - partNumber: range.partNumber, - range: byteRangeHeader(range.start, range.end), - ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}, - ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {} - }, { signal: abortScope.signal }), abortScope.signal); - partSha1s[range.partNumber - 1] = resp.contentSha1; - } catch (err) { - abortScope.abort(err); - throw err; - } finally { - sem.release(); - } - }); - throwRejectedOrAbortReason(await Promise.allSettled(tasks), abortScope); - return await finishLargeFileWithAbortReconciliation(raw, accountInfo, { - fileId: startedLargeFileId, - bucketId: destBucketId, - fileName: options.fileName, - partSha1s, - signal: abortScope.signal - }); - } catch (err) { - abortScope.abort(err); - if (largeFileId === void 0) throw err; - return await cleanupAfterLargeFileError(err, raw, accountInfo, { - fileId: largeFileId, - bucketId: destBucketId, - fileName: options.fileName, - signal: options.signal, - onCleanupFailure: options.onCleanupFailure - }); - } finally { - abortScope.dispose(); - } -} -function cancelLargeFileAfterStart(started, raw, accountInfo, onCleanupFailure) { - started.then((resp) => cancelLargeFileBestEffort(raw, accountInfo, resp.fileId, onCleanupFailure === void 0 ? void 0 : { onCleanupFailure })).catch(() => {}); -} -//#endregion - + const recommendedPartSize = accountInfo.getRecommendedPartSize(); + const minPartSize = accountInfo.getAbsoluteMinimumPartSize(); + const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize); + const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY; + const sourceInfo = await raw.getFileInfo(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + fileId: options.sourceFileId + }); + const totalSize = sourceInfo.contentLength; + if (totalSize <= partSize) { + return raw.copyFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + sourceFileId: options.sourceFileId, + fileName: options.fileName, + ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : {}, + ...options.contentType !== void 0 ? { contentType: options.contentType } : {}, + ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {}, + ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}, + ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {} + }); + } + const destBucketId = options.destinationBucketId ?? sourceInfo.bucketId; + const startResp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + bucketId: destBucketId, + fileName: options.fileName, + contentType: options.contentType ?? sourceInfo.contentType ?? DEFAULT_CONTENT_TYPE, + fileInfo: options.fileInfo ?? {}, + ...options.destinationServerSideEncryption !== void 0 ? { serverSideEncryption: options.destinationServerSideEncryption } : {} + }); + const largeFileId = startResp.fileId; + const ranges = planRanges(totalSize, partSize); + const partSha1s = new Array(ranges.length); + const sem = new Semaphore(concurrency); + try { + options.signal?.throwIfAborted(); + await Promise.all( + ranges.map(async (range) => { + await sem.acquire(); + try { + options.signal?.throwIfAborted(); + const resp = await raw.copyPart(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + sourceFileId: options.sourceFileId, + // `startLargeFile` returns `LargeFileId`; `copyPart` takes the + // same value typed as `FileId`. Re-brand via the factory. + largeFileId: fileId(largeFileId), + partNumber: range.partNumber, + range: byteRangeHeader(range.start, range.end), + ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}, + ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {} + }); + partSha1s[range.partNumber - 1] = resp.contentSha1; + } finally { + sem.release(); + } + }) + ); + options.signal?.throwIfAborted(); + return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + fileId: largeFileId, + partSha1Array: partSha1s + }); + } catch (err) { + await cancelLargeFileBestEffort(raw, accountInfo, largeFileId); + throw err; + } +} //# sourceMappingURL=large.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/text-codec.js -//#region src/util/text-codec.ts -/** -* Shared UTF-8 codec singletons. -* -* Every byte boundary in this SDK is UTF-8: JSON request and response bodies, -* webhook payloads, simulator stream chunks, and B2 percent-encoding inputs. -* Allocating a fresh `TextEncoder` / `TextDecoder` per call is wasteful and -* makes the encoding assumption invisible. Importing these constants makes -* "we use UTF-8" explicit at every call site and avoids the per-call -* allocation entirely. -* -* Both classes are spec-defined as stateless across encode / decode calls, -* so a process-wide singleton is safe. -* -* @packageDocumentation -*/ -/** -* Process-wide UTF-8 `TextEncoder`. Use this instead of -* `new TextEncoder()` for any string → bytes conversion in the SDK. -*/ -var utf8Encoder = new TextEncoder(); -/** -* Process-wide UTF-8 `TextDecoder`. Use this instead of -* `new TextDecoder()` for any bytes → string conversion in the SDK. -*/ -var utf8Decoder = new TextDecoder(); -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/text-codec.js +const utf8Encoder = new TextEncoder(); +const utf8Decoder = new TextDecoder(); //# sourceMappingURL=text-codec.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/encoding.js - -//#region src/raw/encoding.ts -/** -* Characters that B2 treats as safe (not percent-encoded) in file names. -* -* Per the B2 docs, everything except `a-z A-Z 0-9 - . _ ~ / ! $ & ' ( ) * + , ; = : @` -* must be percent-encoded using UTF-8 byte values. -*/ -var SAFE_CHARS = new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@/".split("")); -/** -* Percent-encodes a file name using the B2-specific encoding rules. -* -* Unlike standard `encodeURIComponent`, B2 keeps `/` and several other -* characters unencoded while encoding all other non-ASCII and special -* characters as uppercase percent-encoded UTF-8 bytes. -* -* @param name - The raw (unencoded) file name. -* -* @returns The percent-encoded file name suitable for `X-Bz-File-Name` headers. -*/ -function encoding_encodeFileName(name) { - const encoded = []; - for (const char of name) if (SAFE_CHARS.has(char)) encoded.push(char); - else { - const bytes = utf8Encoder.encode(char); - for (const byte of bytes) encoded.push(`%${byte.toString(16).toUpperCase().padStart(2, "0")}`); - } - return encoded.join(""); -} -/** -* Decodes a B2 percent-encoded file name back to a plain string. -* -* B2 percent-encoding is compatible with standard `decodeURIComponent`, -* so this is a thin wrapper. -* -* @param encoded - The percent-encoded file name from B2. -* -* @returns The decoded file name. -*/ + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/encoding.js + +const SAFE_CHARS = new Set( + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@/".split("") +); +function encodeFileName(name) { + const encoded = []; + for (const char of name) { + if (SAFE_CHARS.has(char)) { + encoded.push(char); + } else { + const bytes = utf8Encoder.encode(char); + for (const byte of bytes) { + encoded.push(`%${byte.toString(16).toUpperCase().padStart(2, "0")}`); + } + } + } + return encoded.join(""); +} function decodeFileName(encoded) { - return decodeURIComponent(encoded); -} -/** -* Converts a file-info map into `X-Bz-Info-*` HTTP headers. -* -* Both keys and values are percent-encoded with {@link encodeFileName} -* to satisfy B2 header requirements. -* -* @param fileInfo - Key/value pairs to attach as custom file info, or `undefined`. -* -* @returns A record of header name/value pairs (empty if `fileInfo` is `undefined`). -*/ + return decodeURIComponent(encoded); +} function buildFileInfoHeaders(fileInfo) { - if (!fileInfo) return {}; - const headers = {}; - for (const [key, value] of Object.entries(fileInfo)) headers[`X-Bz-Info-${encoding_encodeFileName(key)}`] = encoding_encodeFileName(value); - return headers; -} -/** -* Extracts custom file-info key/value pairs from B2 response headers. -* -* Scans for headers prefixed with `x-bz-info-` and decodes both the -* key suffix and value using {@link decodeFileName}. -* -* @param headers - The HTTP response headers from a B2 download or file-info call. -* -* @returns A record of decoded file-info key/value pairs. -*/ + if (!fileInfo) return {}; + const headers = {}; + for (const [key, value] of Object.entries(fileInfo)) { + headers[`X-Bz-Info-${encodeFileName(key)}`] = encodeFileName(value); + } + return headers; +} function parseFileInfoHeaders(headers) { - const info = {}; - headers.forEach((value, key) => { - const lower = key.toLowerCase(); - if (lower.startsWith("x-bz-info-")) { - const infoKey = decodeFileName(lower.slice(10)); - info[infoKey] = decodeFileName(value); - } - }); - return info; + const info = {}; + headers.forEach((value, key) => { + const lower = key.toLowerCase(); + if (lower.startsWith("x-bz-info-")) { + const infoKey = decodeFileName(lower.slice("x-bz-info-".length)); + info[infoKey] = decodeFileName(value); + } + }); + return info; } -//#endregion - //# sourceMappingURL=encoding.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/progress.js -//#region src/streams/progress.ts -/** -* Accumulates byte and part counts and emits {@link ProgressEvent}s to a listener. -* -* Internal building block. The SDK wires one of these inside every -* transfer that accepts an `onProgress` option; users supply the -* listener callback, not the tracker. Exported only so SDK source -* modules can import it; not re-exported through any subpath. -* -* @internal -*/ -var ProgressTracker = class { - listener; - totalBytes; - totalParts; - /** Running total of bytes transferred. */ - bytesTransferred = 0; - /** Running count of completed parts. */ - partsCompleted = 0; - /** Timestamp when tracking began. */ - startTime; - /** - * Creates a new ProgressTracker. - * @param listener - Callback to receive progress events, or undefined to disable. - * @param totalBytes - Expected total bytes, or null if unknown. - * @param totalParts - Expected total parts, or null if not a multipart transfer. - */ - constructor(listener, totalBytes, totalParts) { - this.listener = listener; - this.totalBytes = totalBytes; - this.totalParts = totalParts; - this.startTime = Date.now(); - } - /** - * Record that additional bytes have been transferred and notify the listener. - * @param count - The number of additional bytes that were transferred. - */ - addBytes(count) { - this.bytesTransferred += count; - this.emit(); - } - /** Record that a multipart part has completed and notify the listener. */ - completePart() { - this.partsCompleted++; - this.emit(); - } - /** Emit the current progress snapshot to the listener, if one is registered. */ - emit() { - this.listener?.({ - bytesTransferred: this.bytesTransferred, - totalBytes: this.totalBytes, - partsCompleted: this.partsCompleted, - totalParts: this.totalParts, - elapsedMs: Date.now() - this.startTime - }); - } -}; -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/progress.js +class ProgressTracker { + /** + * Creates a new ProgressTracker. + * @param listener - Callback to receive progress events, or undefined to disable. + * @param totalBytes - Expected total bytes, or null if unknown. + * @param totalParts - Expected total parts, or null if not a multipart transfer. + */ + constructor(listener, totalBytes, totalParts) { + this.listener = listener; + this.totalBytes = totalBytes; + this.totalParts = totalParts; + this.startTime = Date.now(); + } + /** Running total of bytes transferred. */ + bytesTransferred = 0; + /** Running count of completed parts. */ + partsCompleted = 0; + /** Timestamp when tracking began. */ + startTime; + /** + * Record that additional bytes have been transferred and notify the listener. + * @param count - The number of additional bytes that were transferred. + */ + addBytes(count) { + this.bytesTransferred += count; + this.emit(); + } + /** Record that a multipart part has completed and notify the listener. */ + completePart() { + this.partsCompleted++; + this.emit(); + } + /** Emit the current progress snapshot to the listener, if one is registered. */ + emit() { + this.listener?.({ + bytesTransferred: this.bytesTransferred, + totalBytes: this.totalBytes, + partsCompleted: this.partsCompleted, + totalParts: this.totalParts, + elapsedMs: Date.now() - this.startTime + }); + } +} //# sourceMappingURL=progress.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/normalize.js -//#region src/util/normalize.ts -/** -* Wire-shape → SDK-shape normalization helpers. -* -* B2 occasionally uses sentinel strings on the wire where a missing -* value would be more idiomatic in TypeScript. The biggest offender is -* `contentSha1: 'none'` on files completed via `b2_finish_large_file` -* (multipart-finished files don't have a whole-file SHA-1; B2 sends the -* literal three-letter string). The SDK's `FileVersion.contentSha1` is -* typed `string | null` to signal that absence — this module collapses -* the wire sentinel to `null` so callers can write -* `if (fv.contentSha1) { ... }` without an extra `=== 'none'` guard. -* -* Normalization happens at the RawClient boundary so every SDK consumer -* (RawClient direct users, the high-level facade, the simulator-driven -* tests, generated docs) sees the same `null` value. -* -* @packageDocumentation -*/ -/** -* Collapses the B2 wire sentinel `'none'` (and `undefined`) to `null` for -* SHA-1-shaped fields. Any other string passes through unchanged. -* -* @param raw - SHA-1 string from the wire, or `null`/`undefined`. -* -* @returns A hex SHA-1 string, or `null` when the wire said "no hash". -*/ + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/normalize.js function normalizeSha1(raw) { - if (raw === null || raw === void 0 || raw === "none") return null; - return raw; -} -/** -* Returns a new file-version-shaped object with the `contentSha1: 'none'` -* sentinel collapsed to `null`. Pass-through when the value is already -* `null` or a real hash. The object reference is preserved if no -* substitution was needed, so callers paying for change detection -* (e.g. React memo) see referential stability. -* -* @typeParam T - Any object with a `contentSha1: string | null` field. -* -* @param fv - The wire-shape file-version object. -* -* @returns Either `fv` unchanged or a shallow copy with `contentSha1: null`. -*/ + if (raw === null || raw === void 0 || raw === "none") return null; + return raw; +} function normalizeFileVersionSha1(fv) { - return fv.contentSha1 === "none" ? { - ...fv, - contentSha1: null - } : fv; -} -/** -* Returns a new list-response object with `normalizeFileVersionSha1` -* applied to every entry in `files`. Used at the `b2_list_file_names` / -* `b2_list_file_versions` boundary so list output shares the same -* SHA-1 semantics as the singular endpoints. -* -* @typeParam F - Any object with a `contentSha1: string | null` field. -* @typeParam R - The list-response shape (must have a `files` array of `F`). -* -* @param resp - The wire-shape list response. -* -* @returns A response with normalized `files`. `resp.files` is a new array. -*/ + return fv.contentSha1 === "none" ? { ...fv, contentSha1: null } : fv; +} function normalizeFileVersionListSha1(resp) { - return { - ...resp, - files: resp.files.map(normalizeFileVersionSha1) - }; + return { ...resp, files: resp.files.map(normalizeFileVersionSha1) }; } -//#endregion - //# sourceMappingURL=normalize.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/hash.js + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/single.js + -//#region src/streams/hash.ts -var nodeCreateHash; -/** -* Lazily loads `node:crypto` and caches the factory. Returns null in non-Node runtimes. -* -* @returns The cached hash factory, or null if Node crypto is unavailable. -*/ -async function getNodeCreateHash() { - if (nodeCreateHash !== void 0) return nodeCreateHash; - try { - const crypto = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 7598, 19)); - if (typeof crypto.createHash !== "function") throw new Error("createHash unavailable"); - nodeCreateHash = (algo) => { - const h = crypto.createHash(algo); - return { - update(data) { - h.update(data); - }, - digest(encoding) { - return h.digest(encoding); - } - }; - }; - } catch { - /* v8 ignore next -- non-Node runtime fallback, unreachable in Node coverage. */ - nodeCreateHash = null; - } - return nodeCreateHash; -} -/** -* Incrementally computes SHA-1 hashes over streaming data. -* Uses Node.js `crypto` when available, falling back to a dependency-free -* incremental JavaScript implementation. -*/ -var IncrementalSha1 = class { - /** Total bytes fed into the hash so far. */ - totalLength = 0; - /** Node.js hash instance, or null if using the JavaScript fallback. */ - nodeHash = null; - /** Streaming JavaScript fallback used when Node crypto is unavailable. */ - jsHash = new JsSha1Hasher(); - /** Resolves once the crypto backend has been loaded. */ - initPromise; - /** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */ - constructor() { - this.initPromise = getNodeCreateHash().then((factory) => { - if (factory) this.nodeHash = factory("sha1"); - }); - } - /** - * Feed data into the hash. Async because it lazily initializes the crypto backend. - * @param data - The bytes to include in the hash computation. - * - * @returns A promise that resolves once the data has been consumed. - */ - async update(data) { - await this.initPromise; - if (this.nodeHash) this.nodeHash.update(data); - else - /* v8 ignore next -- WebCrypto fallback is exercised by browser-mode tests. */ - this.jsHash.update(data); - this.totalLength += data.byteLength; - } - /** - * Finalize the hash and return the hex-encoded SHA-1 digest. - * @returns The lowercase hex-encoded SHA-1 digest of all data fed so far. - */ - async digest() { - await this.initPromise; - if (this.nodeHash) return this.nodeHash.digest("hex"); - /* v8 ignore next -- non-Node runtime fallback, exercised by browser-mode tests */ - return this.jsHash.digest(); - } - /** - * Total number of bytes fed into the hash so far. - * - * @returns The cumulative byte count across all update calls. - */ - get bytesProcessed() { - return this.totalLength; - } -}; -/* v8 ignore start -- JavaScript fallback path, exercised by browser-mode tests */ -var JsSha1Hasher = class { - h0 = 1732584193; - h1 = 4023233417; - h2 = 2562383102; - h3 = 271733878; - h4 = 3285377520; - block = /* @__PURE__ */ new Uint8Array(64); - blockLength = 0; - bytesProcessed = 0; - digested = false; - words = /* @__PURE__ */ new Uint32Array(80); - update(data) { - if (this.digested) throw new Error("SHA-1 digest has already been finalized"); - this.bytesProcessed += data.byteLength; - let offset = 0; - if (this.blockLength > 0) { - const toCopy = Math.min(64 - this.blockLength, data.byteLength); - this.block.set(data.subarray(0, toCopy), this.blockLength); - this.blockLength += toCopy; - offset = toCopy; - if (this.blockLength === 64) { - this.processBlock(this.block, 0); - this.blockLength = 0; - } - } - while (offset + 64 <= data.byteLength) { - this.processBlock(data, offset); - offset += 64; - } - if (offset < data.byteLength) { - this.block.set(data.subarray(offset), 0); - this.blockLength = data.byteLength - offset; - } - } - digest() { - if (this.digested) throw new Error("SHA-1 digest has already been finalized"); - this.digested = true; - const bitLengthHigh = Math.floor(this.bytesProcessed / 536870912); - const bitLengthLow = this.bytesProcessed << 3 >>> 0; - this.block[this.blockLength] = 128; - this.blockLength++; - if (this.blockLength > 56) { - this.block.fill(0, this.blockLength, 64); - this.processBlock(this.block, 0); - this.blockLength = 0; - } - this.block.fill(0, this.blockLength, 56); - this.writeUint32(56, bitLengthHigh); - this.writeUint32(60, bitLengthLow); - this.processBlock(this.block, 0); - return wordToHex(this.h0) + wordToHex(this.h1) + wordToHex(this.h2) + wordToHex(this.h3) + wordToHex(this.h4); - } - writeUint32(offset, value) { - this.block[offset] = value >>> 24 & 255; - this.block[offset + 1] = value >>> 16 & 255; - this.block[offset + 2] = value >>> 8 & 255; - this.block[offset + 3] = value & 255; - } - processBlock(block, offset) { - const words = this.words; - for (let i = 0; i < 16; i++) { - const j = offset + i * 4; - words[i] = (block[j] ?? 0) << 24 | (block[j + 1] ?? 0) << 16 | (block[j + 2] ?? 0) << 8 | (block[j + 3] ?? 0); - } - for (let i = 16; i < 80; i++) words[i] = rotateLeft((words[i - 3] ?? 0) ^ (words[i - 8] ?? 0) ^ (words[i - 14] ?? 0) ^ (words[i - 16] ?? 0), 1); - let a = this.h0; - let b = this.h1; - let c = this.h2; - let d = this.h3; - let e = this.h4; - for (let i = 0; i < 80; i++) { - let f; - let k; - if (i < 20) { - f = b & c | ~b & d; - k = 1518500249; - } else if (i < 40) { - f = b ^ c ^ d; - k = 1859775393; - } else if (i < 60) { - f = b & c | b & d | c & d; - k = 2400959708; - } else { - f = b ^ c ^ d; - k = 3395469782; - } - const temp = rotateLeft(a, 5) + f + e + k + (words[i] ?? 0) >>> 0; - e = d; - d = c; - c = rotateLeft(b, 30); - b = a; - a = temp; - } - this.h0 = this.h0 + a >>> 0; - this.h1 = this.h1 + b >>> 0; - this.h2 = this.h2 + c >>> 0; - this.h3 = this.h3 + d >>> 0; - this.h4 = this.h4 + e >>> 0; - } -}; -function rotateLeft(value, bits) { - return (value << bits | value >>> 32 - bits) >>> 0; -} -function wordToHex(word) { - return word.toString(16).padStart(8, "0"); -} -/* v8 ignore stop */ -/** -* Compute the SHA-1 hex digest of a complete byte array in one shot. -* @param data - The byte array to hash. -* -* @returns The lowercase hex-encoded SHA-1 digest of the input. -*/ -async function sha1Hex(data) { - const factory = await getNodeCreateHash(); - if (factory) { - const h = factory("sha1"); - h.update(data); - return h.digest("hex"); - } - /* v8 ignore start -- WebCrypto fallback, only reachable when node:crypto is unavailable */ - const hashBuffer = await crypto.subtle.digest("SHA-1", arrayBufferFor(data)); - return hexEncode(new Uint8Array(hashBuffer)); - /* v8 ignore stop */ -} -//#endregion -//# sourceMappingURL=hash.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/sha1.js -//#region src/util/sha1.ts -var sha1HexPattern = /^[0-9a-f]{40}$/i; -/** -* Returns whether a value is a verifiable 40-character hexadecimal SHA-1 digest. -* -* @param sha1 - SHA-1 value, or null/undefined when unavailable. -* -* @returns True when the value is a 40-character hexadecimal SHA-1 digest. -*/ -function isVerifiableSha1(sha1) { - return sha1 !== null && sha1 !== void 0 && sha1HexPattern.test(sha1); -} -/** -* Normalizes a verifiable SHA-1 digest to lowercase. -* -* @param sha1 - SHA-1 value, or null/undefined when unavailable. -* -* @returns A lowercase SHA-1 digest, or null when the value is not verifiable. -*/ -function normalizeVerifiableSha1(sha1) { - return isVerifiableSha1(sha1) ? sha1.toLowerCase() : null; -} -//#endregion - - -//# sourceMappingURL=sha1.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/checksum.js - - - -//#region src/download/checksum.ts -/** -* Client-side checksum helpers for download streams. -* -* B2 sends `X-Bz-Content-Sha1` on download responses when a whole-file -* checksum is available. These helpers verify streamed bytes against that -* header without buffering the full response in memory. -* -* @packageDocumentation -*/ -/** -* Builds the typed error used when downloaded bytes fail SHA-1 verification. -* -* @param expectedSha1 - SHA-1 digest advertised by the download response. -* @param actualSha1 - SHA-1 digest computed from the downloaded bytes. -* -* @returns A typed checksum mismatch error. -*/ -function createDownloadChecksumMismatchError(expectedSha1, actualSha1) { - return new ChecksumMismatchError({ - status: 400, - code: "bad_sha1_checksum", - message: `Downloaded content SHA-1 mismatch: expected ${expectedSha1.toLowerCase()}, got ${actualSha1.toLowerCase()}` - }); -} -/** -* Throws when a computed download SHA-1 does not match the expected value. -* -* @param expectedSha1 - SHA-1 digest advertised by the download response. -* @param actualSha1 - SHA-1 digest computed from the downloaded bytes. -* -* @throws ChecksumMismatchError when the two digests differ. -*/ -function assertDownloadSha1(expectedSha1, actualSha1) { - if (actualSha1.toLowerCase() !== expectedSha1.toLowerCase()) throw createDownloadChecksumMismatchError(expectedSha1, actualSha1); -} -/** -* Throws when two range responses disagree about the expected whole-file SHA-1. -* -* @param expectedSha1 - The first range's verifiable SHA-1, or null when unavailable. -* @param actualSha1 - The current range's verifiable SHA-1, or null when unavailable. -* -* @throws ChecksumMismatchError when the two header states differ. -*/ -function assertDownloadSha1HeaderAgreement(expectedSha1, actualSha1) { - if (expectedSha1 === actualSha1) return; - throw new ChecksumMismatchError({ - status: 400, - code: "bad_sha1_checksum", - message: `Downloaded content SHA-1 header mismatch: expected ${formatSha1ForMessage(expectedSha1)}, got ${formatSha1ForMessage(actualSha1)}` - }); -} -/** -* Wraps a download stream with whole-body SHA-1 verification. -* -* If B2 did not provide a verifiable whole-file SHA-1 (for example, -* multipart-finished files report `none`), the original stream is returned. -* -* @param body - Download response body. -* @param expectedSha1 - Normalized SHA-1 header value, or null when unavailable. -* -* @returns A stream that emits the same bytes and errors on checksum mismatch. -*/ -function verifyDownloadStream(body, expectedSha1) { - if (!isVerifiableSha1(expectedSha1)) return body; - const sha1 = new IncrementalSha1(); - const transform = new TransformStream({ - async transform(chunk, controller) { - await sha1.update(chunk); - controller.enqueue(chunk); - }, - async flush() { - assertDownloadSha1(expectedSha1, await sha1.digest()); - } - }); - return body.pipeThrough(transform); -} -function formatSha1ForMessage(sha1) { - return sha1 === null ? "missing or unverifiable" : sha1.toLowerCase(); -} -//#endregion - - -//# sourceMappingURL=checksum.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/single.js - - - - - - -//#region src/download/single.ts -/** -* Downloads a file by its unique ID in a single HTTP request. -* -* Returns a streaming body suitable for small-to-medium files. For large files -* that benefit from concurrent ranged fetches, use -* {@link createParallelDownloadStream} instead. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param options - Download parameters. -* -* @returns Parsed headers and a readable stream of file bytes. -*/ async function downloadById(raw, accountInfo, options) { - const resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.fileId, toRawDownloadOptions(options)); - const headers = extractDownloadHeaders(resp.headers); - return { - headers, - body: prepareDownloadBody(resp.body ?? emptyStream(), headers, options) - }; -} -/** -* Downloads a file by bucket name and file path in a single HTTP request. -* -* Returns a streaming body suitable for small-to-medium files. For large files -* that benefit from concurrent ranged fetches, use -* {@link createParallelDownloadStream} instead. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param options - Download parameters. -* -* @returns Parsed headers and a readable stream of file bytes. -*/ + const resp = await raw.downloadFileById( + accountInfo.getDownloadUrl(), + accountInfo.getAuthToken(), + options.fileId, + toRawDownloadOptions(options) + ); + const headers = extractDownloadHeaders(resp.headers); + return { + headers, + // HEAD requests legitimately have no body; return an empty stream so the + // result shape stays consistent. + body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress) + }; +} async function downloadByName(raw, accountInfo, options) { - const resp = await raw.downloadFileByName(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.bucketName, options.fileName, toRawDownloadOptions(options)); - const headers = extractDownloadHeaders(resp.headers); - return { - headers, - body: prepareDownloadBody(resp.body ?? emptyStream(), headers, options) - }; -} -/** -* Issues a HEAD-by-ID request and returns parsed headers only. Drains -* the (logically empty) response body internally so callers don't have -* to remember to `body.cancel()` themselves. -* -* Prefer this over `downloadById({ method: 'HEAD' })` — same wire-level -* effect, but the caller-facing result has no `body` field at all so -* there's nothing to clean up. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param options - HEAD parameters (file ID + the same response-header -* overrides and abort signal that `downloadById` accepts). -* -* @returns Parsed download headers (no body field). -*/ + const resp = await raw.downloadFileByName( + accountInfo.getDownloadUrl(), + accountInfo.getAuthToken(), + options.bucketName, + options.fileName, + toRawDownloadOptions(options) + ); + const headers = extractDownloadHeaders(resp.headers); + return { + headers, + body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress) + }; +} async function headById(raw, accountInfo, options) { - const resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.fileId, { - ...toRawDownloadOptions(options), - method: "HEAD" - }); - if (resp.body !== null) { - const body = resp.body; - await bestEffort(() => body.cancel()); - } - return { headers: extractDownloadHeaders(resp.headers) }; -} -/** -* Issues a HEAD-by-name request and returns parsed headers only. Drains -* the (logically empty) response body internally so callers don't have -* to remember to `body.cancel()` themselves. -* -* Prefer this over `downloadByName({ method: 'HEAD' })` — same wire-level -* effect, but the caller-facing result has no `body` field at all so -* there's nothing to clean up. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param options - HEAD parameters (bucket + file name + the same -* response-header overrides and abort signal that `downloadByName` -* accepts). -* -* @returns Parsed download headers (no body field). -*/ + const resp = await raw.downloadFileById( + accountInfo.getDownloadUrl(), + accountInfo.getAuthToken(), + options.fileId, + { ...toRawDownloadOptions(options), method: "HEAD" } + ); + if (resp.body !== null) { + const body = resp.body; + await bestEffort(() => body.cancel()); + } + return { headers: extractDownloadHeaders(resp.headers) }; +} async function headByName(raw, accountInfo, options) { - const resp = await raw.downloadFileByName(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.bucketName, options.fileName, { - ...toRawDownloadOptions(options), - method: "HEAD" - }); - if (resp.body !== null) { - const body = resp.body; - await bestEffort(() => body.cancel()); - } - return { headers: extractDownloadHeaders(resp.headers) }; -} -/** -* Translates the public download-options shape into the raw client's -* {@link DownloadFileOptions}, dropping the request-target fields (`fileId`, -* `bucketName`, `fileName`) that don't apply at the transport layer. -* -* @param options - Caller-supplied download options. -* -* @returns The raw transport-layer options. -*/ + const resp = await raw.downloadFileByName( + accountInfo.getDownloadUrl(), + accountInfo.getAuthToken(), + options.bucketName, + options.fileName, + { ...toRawDownloadOptions(options), method: "HEAD" } + ); + if (resp.body !== null) { + const body = resp.body; + await bestEffort(() => body.cancel()); + } + return { headers: extractDownloadHeaders(resp.headers) }; +} function toRawDownloadOptions(options) { - return { - ...options.method !== void 0 ? { method: options.method } : {}, - ...options.range !== void 0 ? { range: options.range } : {}, - ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}, - ...options.b2ContentDisposition !== void 0 ? { b2ContentDisposition: options.b2ContentDisposition } : {}, - ...options.b2ContentLanguage !== void 0 ? { b2ContentLanguage: options.b2ContentLanguage } : {}, - ...options.b2ContentEncoding !== void 0 ? { b2ContentEncoding: options.b2ContentEncoding } : {}, - ...options.b2ContentType !== void 0 ? { b2ContentType: options.b2ContentType } : {}, - ...options.b2CacheControl !== void 0 ? { b2CacheControl: options.b2CacheControl } : {}, - ...options.b2Expires !== void 0 ? { b2Expires: options.b2Expires } : {}, - ...options.signal !== void 0 ? { signal: options.signal } : {} - }; -} -/** -* Builds an immediately-closed empty ReadableStream. Used as the body of a -* HEAD download response so callers always get a stream they can `pipeTo`. -* -* @returns A ReadableStream that yields zero bytes and immediately closes. -*/ + return { + ...options.method !== void 0 ? { method: options.method } : {}, + ...options.range !== void 0 ? { range: options.range } : {}, + ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}, + ...options.b2ContentDisposition !== void 0 ? { b2ContentDisposition: options.b2ContentDisposition } : {}, + ...options.b2ContentLanguage !== void 0 ? { b2ContentLanguage: options.b2ContentLanguage } : {}, + ...options.b2ContentEncoding !== void 0 ? { b2ContentEncoding: options.b2ContentEncoding } : {}, + ...options.b2ContentType !== void 0 ? { b2ContentType: options.b2ContentType } : {}, + ...options.b2CacheControl !== void 0 ? { b2CacheControl: options.b2CacheControl } : {}, + ...options.b2Expires !== void 0 ? { b2Expires: options.b2Expires } : {}, + ...options.signal !== void 0 ? { signal: options.signal } : {} + }; +} function emptyStream() { - return new ReadableStream({ start(controller) { - controller.close(); - } }); -} -/** -* Applies stream wrappers common to single-request downloads. -* -* Full-body GET downloads are checksum-verified when B2 supplies a real -* whole-file SHA-1. HEAD requests and ranged GETs are skipped because the -* response body is empty or partial while `X-Bz-Content-Sha1` describes the -* full file version. -* -* @param body - Download response body. -* @param headers - Parsed download headers. -* @param options - Caller-supplied download options. -* -* @returns A stream wrapped for checksum verification and progress reporting. -*/ -function prepareDownloadBody(body, headers, options) { - return instrumentProgress(options.method !== "HEAD" && options.range === void 0 ? verifyDownloadStream(body, headers.contentSha1) : body, headers.contentLength, options.onProgress); -} -/** -* Wraps a body stream with a `TransformStream` that increments a -* {@link ProgressTracker} for each chunk and reports `partsCompleted: 1` -* when the stream finishes. -* -* When `listener` is undefined the function short-circuits and returns -* the original stream, so unobserved downloads pay no overhead. -* -* @param body - The download response body to wrap. -* @param totalBytes - Expected total bytes (response `Content-Length`). -* @param listener - Caller-supplied progress callback, or undefined. -* -* @returns A stream that emits the same bytes and reports progress. -*/ + return new ReadableStream({ + start(controller) { + controller.close(); + } + }); +} function instrumentProgress(body, totalBytes, listener) { - if (listener === void 0) return body; - const tracker = new ProgressTracker(listener, totalBytes, 1); - const transform = new TransformStream({ - transform(chunk, controller) { - tracker.addBytes(chunk.byteLength); - controller.enqueue(chunk); - }, - flush() { - tracker.completePart(); - } - }); - return body.pipeThrough(transform); -} -/** -* Extracts B2-specific download headers into a structured object. -* @param headers - The HTTP response headers from the download. -* -* @returns The parsed download metadata. -*/ + if (listener === void 0) return body; + const tracker = new ProgressTracker(listener, totalBytes, 1); + const transform = new TransformStream({ + transform(chunk, controller) { + tracker.addBytes(chunk.byteLength); + controller.enqueue(chunk); + }, + flush() { + tracker.completePart(); + } + }); + return body.pipeThrough(transform); +} function extractDownloadHeaders(headers) { - const fileInfo = parseFileInfoHeaders(headers); - return { - contentType: headers.get("Content-Type") ?? "application/octet-stream", - contentLength: Number.parseInt(headers.get("Content-Length") ?? "0", 10), - contentSha1: normalizeSha1(headers.get("X-Bz-Content-Sha1")), - fileId: fileId(headers.get("X-Bz-File-Id") ?? ""), - fileName: decodeURIComponent(headers.get("X-Bz-File-Name") ?? ""), - fileInfo, - uploadTimestamp: Number.parseInt(headers.get("X-Bz-Upload-Timestamp") ?? "0", 10) - }; + const fileInfo = parseFileInfoHeaders(headers); + return { + contentType: headers.get("Content-Type") ?? "application/octet-stream", + contentLength: Number.parseInt(headers.get("Content-Length") ?? "0", 10), + // B2 sends the literal `'none'` for multipart-finished files; collapse + // to `null` so the typed `string | null` actually means "no SHA-1". + contentSha1: normalizeSha1(headers.get("X-Bz-Content-Sha1")), + fileId: fileId(headers.get("X-Bz-File-Id") ?? ""), + fileName: decodeURIComponent(headers.get("X-Bz-File-Name") ?? ""), + fileInfo, + uploadTimestamp: Number.parseInt(headers.get("X-Bz-Upload-Timestamp") ?? "0", 10) + }; } -//#endregion - //# sourceMappingURL=single.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/internal/upload-retry-options.js -//#region src/internal/upload-retry-options.ts -/** -* Merges client upload retry defaults with a per-call override. -* @param defaults - Resolved client upload retry defaults. -* @param override - Per-call retry option overrides, if any. -* -* @returns Retry options for one high-level upload operation. -* -* @internal -*/ -function mergeUploadRetryOptions(defaults, override) { - if (override === void 0) return defaults; - return { - ...defaults, - ...override - }; -} -//#endregion - - -//# sourceMappingURL=upload-retry-options.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/source.js - - - -//#region src/streams/source.ts -var READABLE_STREAM_SIZE_REQUIRED_ERROR = "size is required when using a ReadableStream as input."; -var FORWARD_ONLY_SIZE_REQUIRED_ERROR = "size is required when using a forward-only content source as input."; -var STREAM_SOURCE_ENDED_EARLY_ERROR = "StreamSource ended before the advertised byte count."; -var STREAM_SOURCE_TOO_MANY_BYTES_ERROR = "StreamSource emitted more bytes than the advertised byte count."; -var STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR = "StreamSource emitted too many empty chunks without data."; -/** Maximum consecutive empty chunks tolerated from a forward-only stream. */ -var MAX_EMPTY_STREAM_CHUNKS = 1024; -function asyncIterableToReadableStream(iterable) { - const iterator = iterable[Symbol.asyncIterator](); - return new ReadableStream({ - async pull(controller) { - try { - const { done, value } = await iterator.next(); - if (done === true) { - controller.close(); - return; - } - if (!(value instanceof Uint8Array)) throw new TypeError("Async iterable content sources must yield Uint8Array chunks."); - controller.enqueue(value); - } catch (err) { - /* v8 ignore next -- Iterator-return failure must not mask the pull error. */ - await returnAsyncIteratorBestEffort(iterator); - throw err; - } - }, - async cancel(reason) { - await returnAsyncIteratorBestEffort(iterator, reason); - } - }); -} -async function returnAsyncIteratorBestEffort(iterator, reason) { - try { - await iterator.return?.(reason); - } catch {} -} -function isAsyncIterable(input) { - return typeof input === "object" && input !== null && Symbol.asyncIterator in input && typeof input[Symbol.asyncIterator] === "function"; -} -function isReadableStream(input) { - return typeof input === "object" && input !== null && typeof input.getReader === "function"; -} -/** ContentSource backed by a Blob or File. */ -var BlobSource = class BlobSource { - blob; - /** {@inheritDoc} */ - size; - /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */ - canSlice = true; - /** - * Create a BlobSource wrapping the given Blob. - * @param blob - The Blob or File to use as the underlying content. - */ - constructor(blob) { - this.blob = blob; - this.size = blob.size; - } - /** - * Return a new BlobSource covering the specified byte range. - * @param start - The zero-based byte offset to begin the slice. - * @param end - The exclusive byte offset where the slice ends. - * - * @returns A new ContentSource representing the requested sub-range. - */ - slice(start, end) { - return new BlobSource(this.blob.slice(start, end)); - } - /** - * Open the Blob content as a ReadableStream. - * @returns A ReadableStream of the Blob bytes. - */ - stream() { - return this.blob.stream(); - } - /** - * Read the entire Blob content into an ArrayBuffer. - * @param options - Optional abort signal used while reading. - * - * @returns A promise that resolves with the full content as an ArrayBuffer. - */ - async toArrayBuffer(options = {}) { - options.signal?.throwIfAborted(); - if (options.signal === void 0) return this.blob.arrayBuffer(); - return arrayBufferFor(await collectStream(this.stream(), options)); - } -}; -/** ContentSource backed by a Uint8Array buffer. */ -var BufferSource = class BufferSource { - buffer; - /** {@inheritDoc} */ - size; - /** Random-access: the entire payload lives in memory. */ - canSlice = true; - /** - * Create a BufferSource wrapping the given Uint8Array. - * @param buffer - The byte buffer to use as the underlying content. - */ - constructor(buffer) { - this.buffer = buffer; - this.size = buffer.byteLength; - } - /** - * Return a new BufferSource covering the specified byte range. - * @param start - The zero-based byte offset to begin the slice. - * @param end - The exclusive byte offset where the slice ends. - * - * @returns A new ContentSource representing the requested sub-range. - */ - slice(start, end) { - return new BufferSource(this.buffer.slice(start, end)); - } - /** - * Open the buffer content as a ReadableStream. - * @returns A ReadableStream that emits the buffer bytes in a single chunk. - */ - stream() { - const buffer = this.buffer; - return new ReadableStream({ start(controller) { - controller.enqueue(buffer); - controller.close(); - } }); - } - /** - * Read the entire buffer content into an ArrayBuffer. - * @param options - Optional abort signal checked before returning bytes. - * - * @returns A promise that resolves with the full content as an ArrayBuffer. - */ - async toArrayBuffer(options = {}) { - options.signal?.throwIfAborted(); - return arrayBufferFor(this.buffer); - } -}; -/** ContentSource backed by a ReadableStream. Can only be consumed once and does not support slicing. */ -var StreamSource = class { - readable; - /** {@inheritDoc} */ - size; - /** - * Forward-only: ReadableStreams cannot be repositioned, so multipart - * uploads must take the sequential path. See the interface comment on - * `canSlice` for what the engine does with this flag. - */ - canSlice = false; - /** Whether the stream has already been read. */ - consumed = false; - /** - * Create a StreamSource wrapping the given ReadableStream with a known byte size. - * @param readable - The ReadableStream to wrap as a content source. - * @param size - The total number of bytes the stream will produce. - */ - constructor(readable, size) { - this.readable = readable; - validateStreamSourceSize(size); - this.size = size; - } - /** - * Always throws because streams cannot be sliced. Buffer the stream first. - * - * @throws If slicing is attempted on a stream-backed source. - */ - slice() { - throw new Error("StreamSource does not support slicing. Buffer the stream first."); - } - /** - * Open the underlying ReadableStream. Can only be called once. - * @returns The underlying ReadableStream of bytes. - * - * @throws If the stream has already been consumed. - */ - stream() { - if (this.consumed) throw new Error("StreamSource can only be consumed once."); - this.consumed = true; - return this.readable; - } - /** - * Read the entire stream into an ArrayBuffer. - * @param options - Optional abort signal used while reading. - * - * @returns A promise that resolves with the full content as an ArrayBuffer. - */ - async toArrayBuffer(options = {}) { - return (await collectStreamExactly(this.stream(), this.size, options.signal)).buffer; - } -}; -function validateStreamSourceSize(size) { - if (!Number.isFinite(size) || !Number.isInteger(size) || size < 0) throw new RangeError("StreamSource size must be a non-negative finite integer."); -} -/** -* Reads exactly the advertised number of bytes from a stream. -* @param stream - Stream to consume. -* @param expectedSize - Exact number of bytes expected from the stream. -* @param signal - Optional abort signal for cancelling the read. -* -* @returns A byte array of length `expectedSize`. -* -* @throws If the stream emits too few bytes, too many bytes, too many empty chunks, or aborts. -*/ -async function collectStreamExactly(stream, expectedSize, signal) { - const reader = stream.getReader(); - const chunks = []; - let total = 0; - let completed = false; - try { - while (total < expectedSize) { - const { done, value } = await readNextNonEmptyStreamChunk(reader, STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR, signal); - if (done) throw new Error(STREAM_SOURCE_ENDED_EARLY_ERROR); - if (total + value.byteLength > expectedSize) throw new Error(STREAM_SOURCE_TOO_MANY_BYTES_ERROR); - chunks.push(value); - total += value.byteLength; - } - if (!(await readNextNonEmptyStreamChunk(reader, STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR, signal)).done) throw new Error(STREAM_SOURCE_TOO_MANY_BYTES_ERROR); - const result = new Uint8Array(expectedSize); - let offset = 0; - for (const chunk of chunks) { - result.set(chunk, offset); - offset += chunk.byteLength; - } - completed = true; - return result; - } finally { - if (!completed) cancelReaderBestEffort(reader); - try { - reader.releaseLock(); - } catch {} - } -} -/** -* Reads from a stream until it receives data, EOF, or too many consecutive empty chunks. -* @param reader - Locked reader for a Uint8Array stream. -* @param emptyChunkErrorMessage - Error message to throw when the empty-chunk limit is exceeded. -* @param signal - Optional abort signal that cancels the reader and rejects the read. -* -* @returns The next non-empty chunk or EOF result. -*/ -async function readNextNonEmptyStreamChunk(reader, emptyChunkErrorMessage, signal) { - let emptyChunks = 0; - while (true) { - const result = await readStreamChunk(reader, signal); - if (result.done || result.value.byteLength > 0) return result; - emptyChunks += 1; - if (emptyChunks > 1024) throw new Error(emptyChunkErrorMessage); - } -} -async function readStreamChunk(reader, signal) { - if (signal === void 0) return reader.read(); - if (signal.aborted) { - const reason = signal.reason ?? new DOMException("Aborted", "AbortError"); - cancelReaderBestEffort(reader, reason); - throw reason; - } - let removeAbortListener; - const abort = new Promise((_, reject) => { - const onAbort = () => { - const reason = signal.reason ?? new DOMException("Aborted", "AbortError"); - cancelReaderBestEffort(reader, reason); - reject(reason); - }; - signal.addEventListener("abort", onAbort, { once: true }); - removeAbortListener = () => signal.removeEventListener("abort", onAbort); - }); - try { - const result = await Promise.race([reader.read(), abort]); - if (signal.aborted) { - const reason = signal.reason ?? new DOMException("Aborted", "AbortError"); - cancelReaderBestEffort(reader, reason); - throw reason; - } - return result; - } finally { - removeAbortListener?.(); - } -} -function cancelReaderBestEffort(reader, reason) { - /* v8 ignore next -- Reader cancellation failure is deliberately best-effort. */ - reader.cancel(reason).catch(() => {}); -} -/** ContentSource backed by a forward-only async iterable of Uint8Array chunks. */ -var AsyncIterableSource = class extends StreamSource { - /** - * Create an AsyncIterableSource from a known-size async iterable. - * @param iterable - Async iterable that yields Uint8Array chunks. - * @param size - Total byte length the iterable will produce. - */ - constructor(iterable, size) { - super(asyncIterableToReadableStream(iterable), size); - } + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/retry.js +const DEFAULT_RETRY_OPTIONS = { + maxRetries: 5, + maxRetryDelayMs: 64e3, + initialRetryDelayMs: 1e3 }; -/** -* Convert a Uint8Array, Blob, ReadableStream, or async iterable into a {@link ContentSource}. -* When passing a ReadableStream or async iterable, the `size` parameter is required. -* @param input - The content to wrap. -* @param size - The total byte length, required for forward-only inputs. -* -* @returns A ContentSource adapter for the given input. -* -* @throws If input is forward-only and size is not provided. -*/ -function toContentSource(input, size) { - if (input instanceof Uint8Array) return new BufferSource(input); - if (input instanceof Blob) return new BlobSource(input); - if (isReadableStream(input)) { - if (size === void 0) throw new Error(READABLE_STREAM_SIZE_REQUIRED_ERROR); - return new StreamSource(input, size); - } - if (isAsyncIterable(input)) { - if (size === void 0) throw new Error(FORWARD_ONLY_SIZE_REQUIRED_ERROR); - return new AsyncIterableSource(input, size); - } - throw new TypeError("Unsupported content source input."); +function computeBackoff(attempt, options, retryAfter) { + if (retryAfter !== void 0 && retryAfter > 0) { + return Math.min(retryAfter * 1e3, options.maxRetryDelayMs); + } + const base = options.initialRetryDelayMs * 2 ** attempt; + const jitter = Math.random() * base * 0.5; + return Math.min(base + jitter, options.maxRetryDelayMs); +} +function sleep(ms, signal) { + return new Promise((resolve, reject) => { + if (signal?.aborted) { + reject(signal.reason ?? new DOMException("Aborted", "AbortError")); + return; + } + const timer = setTimeout(resolve, ms); + signal?.addEventListener( + "abort", + () => { + clearTimeout(timer); + reject(signal.reason ?? new DOMException("Aborted", "AbortError")); + }, + { once: true } + ); + }); } -//#endregion - -//# sourceMappingURL=source.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/bucket.js -//#region src/types/bucket.ts -/** -* Named constants for the bucket access level. -* -* The {@link BucketType} type alias is derived from the values of this -* object, so the const is the single source of truth: adding a key here -* automatically widens the type union. -* -* @example -* ```ts -* await client.createBucket({ bucketName: 'my-app-logs', bucketType: BucketType.AllPrivate }) -* ``` -*/ -var BucketType = { - /** Publicly downloadable without authentication. */ - AllPublic: "allPublic", - /** Requires a valid auth token to download. */ - AllPrivate: "allPrivate", - /** Internal snapshot bucket type, generally not user-created. */ - Snapshot: "snapshot", - /** B2-restricted bucket (e.g., for S3-compatible workflows). */ - Restricted: "restricted" -}; -/** -* Named constants for the B2 + S3 operations a CORS rule can permit. -* -* @example -* ```ts -* await bucket.update({ -* corsRules: [{ -* corsRuleName: 'browser-downloads', -* allowedOrigins: ['https://example.com'], -* allowedOperations: [CorsOperation.B2DownloadFileByName, CorsOperation.S3Get], -* allowedHeaders: null, -* exposeHeaders: null, -* maxAgeSeconds: 3600, -* }], -* }) -* ``` -*/ -var CorsOperation = { - /** Native B2 download-by-name request. */ - B2DownloadFileByName: "b2_download_file_by_name", - /** Native B2 download-by-id request. */ - B2DownloadFileById: "b2_download_file_by_id", - /** Native B2 small-file upload. */ - B2UploadFile: "b2_upload_file", - /** Native B2 multipart-part upload. */ - B2UploadPart: "b2_upload_part", - /** S3-compatible DELETE. */ - S3Delete: "s3_delete", - /** S3-compatible GET. */ - S3Get: "s3_get", - /** S3-compatible HEAD. */ - S3Head: "s3_head", - /** S3-compatible POST. */ - S3Post: "s3_post", - /** S3-compatible PUT. */ - S3Put: "s3_put" -}; -/** -* Named constants for the bucket-level Object Lock retention mode. -* -* Pair with {@link BucketRetentionPolicy} when setting a bucket's default -* retention: `{ mode: BucketRetentionMode.Compliance, period: { duration: 30, unit: 'days' } }`. -*/ -var BucketRetentionMode = { - /** Files cannot be deleted or modified during the retention period, even by the account owner. */ - Compliance: "compliance", - /** Files cannot be deleted during retention except by callers with the `bypassGovernance` capability. */ - Governance: "governance", - /** No default retention is applied to new uploads. */ - None: "none" -}; -//#endregion +//# sourceMappingURL=retry.js.map +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/collect.js +async function collectStream(stream) { + const reader = stream.getReader(); + try { + const chunks = []; + let total = 0; + while (true) { + const { done, value } = await reader.read(); + if (done) break; + chunks.push(value); + total += value.byteLength; + } + const result = new Uint8Array(total); + let offset = 0; + for (const chunk of chunks) { + result.set(chunk, offset); + offset += chunk.byteLength; + } + return result; + } finally { + reader.releaseLock(); + } +} -//# sourceMappingURL=bucket.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/encryption.js -//#region src/types/encryption.ts -/** Named constants for the supported server-side encryption algorithms. */ -var EncryptionAlgorithm = { -/** AES with a 256-bit key. The only algorithm B2 currently supports. */ -Aes256: "AES256" }; -/** -* Named constants for the server-side encryption mode used by a file. -* -* Most callers should use the {@link SSE_B2}, {@link SSE_NONE}, and -* {@link sseCustomer} helpers below which return complete -* {@link EncryptionSetting} objects. These constants are useful when you -* need the bare mode discriminator (e.g., when introspecting a file's -* current encryption setting). -*/ -var EncryptionMode = { - /** B2-managed encryption keys. */ - SseB2: "SSE-B2", - /** Customer-provided encryption keys. */ - SseC: "SSE-C", - /** No encryption. */ - None: "none" -}; -/** Pre-built SSE-B2 encryption setting using AES-256. */ -var SSE_B2 = { - mode: "SSE-B2", - algorithm: "AES256" -}; -/** Pre-built setting indicating no server-side encryption. */ -var SSE_NONE = { mode: "none" }; -/** -* Creates an SSE-C encryption setting with a customer-provided key. -* @param customerKey - Base64-encoded 256-bit encryption key. -* @param customerKeyMd5 - Base64-encoded MD5 digest of the key. -* -* @returns An SSE-C encryption setting ready to pass to upload or download calls. -*/ -function sseCustomer(customerKey, customerKeyMd5) { - return { - mode: "SSE-C", - algorithm: "AES256", - customerKey, - customerKeyMd5 - }; -} -/** -* Encodes raw bytes as base64 in an isomorphic way (Node Buffer fallback to btoa). -* -* @param bytes - The raw bytes to encode. -* -* @returns The base64-encoded string. -*/ -function bytesToBase64(bytes) { - const g = globalThis; - if (g.Buffer) return g.Buffer.from(bytes).toString("base64"); - let binary = ""; - for (const b of bytes) binary += String.fromCharCode(b); - return btoa(binary); -} -/** -* Computes the MD5 digest of the given bytes as a base64 string. Prefers -* `node:crypto` for native speed when available; falls back to a pure-JS -* implementation in browser / edge runtimes because WebCrypto's -* `crypto.subtle.digest` deliberately does not support MD5. -* -* MD5 is used here only for SSE-C key integrity (matching the B2 wire -* protocol). It is **not** a security boundary; the customer key itself is -* the secret. Bundling a pure-JS fallback keeps `EncryptionKey.fromBytes` -* isomorphic. -* -* @param bytes - The bytes to digest. -* -* @returns The base64-encoded MD5 digest. -*/ -async function md5Base64(bytes) { - try { - const { createHash } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 7598, 19)); - if (typeof createHash !== "function") throw new Error("createHash unavailable"); - return createHash("md5").update(bytes).digest("base64"); - } catch { - return bytesToBase64(md5Bytes(bytes)); - } -} -/** -* Pure-JS MD5 implementation per RFC 1321. Returns the 16-byte digest of the -* input. Used as a browser fallback for SSE-C key MD5 computation; not -* intended for security-sensitive purposes (MD5 is broken cryptographically). -* -* @param data - The bytes to hash. -* -* @returns The 16-byte MD5 digest. -*/ -function md5Bytes(data) { - const originalBitLength = data.byteLength * 8; - const padLength = (data.byteLength + 8 >>> 6) + 1; - const padded = new Uint8Array(padLength * 64); - padded.set(data); - padded[data.byteLength] = 128; - const lowBits = originalBitLength >>> 0; - const highBits = Math.floor(originalBitLength / 4294967296) >>> 0; - const lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8); - lengthView.setUint32(0, lowBits, true); - lengthView.setUint32(4, highBits, true); - const s = [ - 7, - 12, - 17, - 22, - 7, - 12, - 17, - 22, - 7, - 12, - 17, - 22, - 7, - 12, - 17, - 22, - 5, - 9, - 14, - 20, - 5, - 9, - 14, - 20, - 5, - 9, - 14, - 20, - 5, - 9, - 14, - 20, - 4, - 11, - 16, - 23, - 4, - 11, - 16, - 23, - 4, - 11, - 16, - 23, - 4, - 11, - 16, - 23, - 6, - 10, - 15, - 21, - 6, - 10, - 15, - 21, - 6, - 10, - 15, - 21, - 6, - 10, - 15, - 21 - ]; - const k = new Uint32Array([ - 3614090360, - 3905402710, - 606105819, - 3250441966, - 4118548399, - 1200080426, - 2821735955, - 4249261313, - 1770035416, - 2336552879, - 4294925233, - 2304563134, - 1804603682, - 4254626195, - 2792965006, - 1236535329, - 4129170786, - 3225465664, - 643717713, - 3921069994, - 3593408605, - 38016083, - 3634488961, - 3889429448, - 568446438, - 3275163606, - 4107603335, - 1163531501, - 2850285829, - 4243563512, - 1735328473, - 2368359562, - 4294588738, - 2272392833, - 1839030562, - 4259657740, - 2763975236, - 1272893353, - 4139469664, - 3200236656, - 681279174, - 3936430074, - 3572445317, - 76029189, - 3654602809, - 3873151461, - 530742520, - 3299628645, - 4096336452, - 1126891415, - 2878612391, - 4237533241, - 1700485571, - 2399980690, - 4293915773, - 2240044497, - 1873313359, - 4264355552, - 2734768916, - 1309151649, - 4149444226, - 3174756917, - 718787259, - 3951481745 - ]); - let a0 = 1732584193; - let b0 = 4023233417; - let c0 = 2562383102; - let d0 = 271733878; - const m = /* @__PURE__ */ new Uint32Array(16); - const view = new DataView(padded.buffer); - for (let block = 0; block < padded.byteLength; block += 64) { - for (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true); - let A = a0; - let B = b0; - let C = c0; - let D = d0; - for (let i = 0; i < 64; i++) { - let f; - let g; - if (i < 16) { - f = B & C | ~B & D; - g = i; - } else if (i < 32) { - f = D & B | ~D & C; - g = (5 * i + 1) % 16; - } else if (i < 48) { - f = B ^ C ^ D; - g = (3 * i + 5) % 16; - } else { - f = C ^ (B | ~D); - g = 7 * i % 16; - } - const temp = D; - D = C; - C = B; - const sum = A + f + (k[i] ?? 0) + (m[g] ?? 0) >>> 0; - const shift = s[i] ?? 0; - const rotated = (sum << shift | sum >>> 32 - shift) >>> 0; - B = B + rotated >>> 0; - A = temp; - } - a0 = a0 + A >>> 0; - b0 = b0 + B >>> 0; - c0 = c0 + C >>> 0; - d0 = d0 + D >>> 0; - } - const out = /* @__PURE__ */ new Uint8Array(16); - const outView = new DataView(out.buffer); - outView.setUint32(0, a0, true); - outView.setUint32(4, b0, true); - outView.setUint32(8, c0, true); - outView.setUint32(12, d0, true); - return out; -} -var KEY_REDACTED = "[redacted SSE-C key]"; -/** -* Safe wrapper around an SSE-C customer key. Hides the key bytes from -* `JSON.stringify`, `console.log`, and Node's `util.inspect`. Use {@link EncryptionKey.fromBytes} -* to construct one from a raw 32-byte key; the MD5 digest is computed internally. -*/ -var EncryptionKey = class EncryptionKey { - /** Encryption mode discriminant. Always `'SSE-C'` for this class. */ - mode = "SSE-C"; - /** Encryption algorithm. B2's S3-compatible API only supports AES-256. */ - algorithm = "AES256"; - /** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */ - customerKey; - /** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */ - customerKeyMd5; - /** - * Internal constructor. Use {@link EncryptionKey.fromBytes} or - * {@link EncryptionKey.fromBase64} instead. - * - * @param customerKey - Base64-encoded 256-bit encryption key. - * @param customerKeyMd5 - Base64-encoded MD5 digest of the key. - * - * @internal - */ - constructor(customerKey, customerKeyMd5) { - this.customerKey = customerKey; - this.customerKeyMd5 = customerKeyMd5; - } - /** - * Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the - * required base64 MD5 digest internally. - * - * @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes. - * - * @returns A safely-wrapped EncryptionKey ready for upload/download. - * - * @throws If the key is not exactly 32 bytes. - */ - static async fromBytes(rawKey) { - if (rawKey.byteLength !== 32) throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`); - const customerKey = bytesToBase64(rawKey); - const customerKeyMd5 = await md5Base64(rawKey); - return new EncryptionKey(customerKey, customerKeyMd5); - } - /** - * Builds an EncryptionKey from precomputed base64 strings. Use this in - * environments where MD5 must be computed externally (e.g., browsers). - * - * @param customerKey - Base64-encoded 256-bit encryption key. - * @param customerKeyMd5 - Base64-encoded MD5 digest of the key. - * - * @returns A safely-wrapped EncryptionKey ready for upload/download. - */ - static fromBase64(customerKey, customerKeyMd5) { - return new EncryptionKey(customerKey, customerKeyMd5); - } - /** - * Hides the key bytes from `JSON.stringify`. - * - * @returns A redacted shape: same mode and algorithm, but the key and MD5 - * replaced with a placeholder string. - */ - toJSON() { - return { - mode: this.mode, - algorithm: this.algorithm, - customerKey: KEY_REDACTED, - customerKeyMd5: KEY_REDACTED - }; - } - /** - * Hides the key bytes from default `toString()`. - * - * @returns A short opaque label indicating this is an SSE-C key. - */ - toString() { - return `[EncryptionKey SSE-C ${KEY_REDACTED}]`; - } - /** - * Hides the key bytes from Node's `util.inspect` (and therefore `console.log`). - * - * @returns A short opaque label indicating this is an SSE-C key. - */ - [Symbol.for("nodejs.util.inspect.custom")]() { - return this.toString(); - } -}; -//#endregion +//# sourceMappingURL=collect.js.map +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/parallel.js -//# sourceMappingURL=encryption.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/resume.js - - - - -//#region src/upload/resume.ts -/** Compatibility-only file-info key read from legacy unfinished uploads; new uploads do not write it. */ -var RESUME_SOURCE_SIZE_INFO_KEY = "b2_sdk_resume_source_size"; -/** Compatibility-only file-info key read from legacy unfinished uploads; new uploads do not write it. */ -var RESUME_PART_SIZE_INFO_KEY = "b2_sdk_resume_part_size"; -var DEFAULT_MAX_RESUME_LIST_PAGES = 10; -var DEFAULT_MAX_RESUME_PART_CANDIDATES = 25; -var DEFAULT_MAX_RESUME_PART_PAGES = 10; -var LIST_PARTS_PAGE_SIZE = 100; -/** -* Finds an unfinished large file matching the given bucket and file name. -* Returns `null` when no compatible candidate exists. -* -* With criteria, the newest compatible candidate is selected; incompatible -* same-name uploads are ignored and optionally reported via -* `onCandidateRejected`. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param bucketId - Target bucket of the upload. -* @param fileName - Destination file name of the upload. -* @param criteria - Upload identity and option checks. -* -* @returns A {@link ResumeCandidate} describing the candidate and its uploaded parts, or `null`. -*/ -async function findResumeCandidate(raw, accountInfo, bucketId, fileName, criteria) { - const discoverySignal = createResumeDiscoverySignal(criteria); - try { - return await findResumeCandidateWithSignal(raw, accountInfo, bucketId, fileName, criteria, discoverySignal.signal); - } finally { - discoverySignal.dispose(); - } -} -async function findResumeCandidateWithSignal(raw, accountInfo, bucketId, fileName, criteria, signal) { - const matches = []; - const maxListPages = criteria.maxListPages ?? DEFAULT_MAX_RESUME_LIST_PAGES; - const maxPartCandidates = criteria.maxPartCandidates ?? DEFAULT_MAX_RESUME_PART_CANDIDATES; - let sequence = 0; - let pageCount = 0; - const explicitResumeFileId = criteria.resumeFileId; - let startFileId = explicitResumeFileId; - let truncated = false; - while (pageCount < maxListPages) { - signal?.throwIfAborted(); - const unfinished = await abortableRequest(raw.listUnfinishedLargeFiles(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { - bucketId, - maxFileCount: explicitResumeFileId !== void 0 ? 1 : 100, - namePrefix: fileName, - ...startFileId !== void 0 ? { startFileId } : {} - }, signal !== void 0 ? { signal } : void 0), signal); - pageCount++; - for (const file of unfinished.files) { - if (explicitResumeFileId !== void 0 ? file.fileId === explicitResumeFileId : file.fileName === fileName) matches.push({ - file, - sequence - }); - sequence++; - } - if (explicitResumeFileId !== void 0) break; - if (unfinished.nextFileId === null) break; - startFileId = unfinished.nextFileId; - truncated = pageCount >= maxListPages; - } - if (truncated) emitCandidateRejected(criteria, { - requestedFileName: fileName, - reason: "search-truncated" - }); - matches.sort(compareNewestFirst); - let partCandidatesInspected = 0; - for (const match of matches) { - signal?.throwIfAborted(); - const rejection = candidateMetadataRejectReason(match.file, fileName, criteria); - if (rejection !== null) { - notifyCandidateRejected(criteria, match.file, fileName, rejection); - continue; - } - if (partCandidatesInspected >= maxPartCandidates) { - notifyCandidateRejected(criteria, match.file, fileName, "candidate-limit"); - break; - } - partCandidatesInspected++; - const fileId = largeFileId(match.file.fileId); - const uploadedPartsResult = await collectResumePartInfo(raw, accountInfo, fileId, { - maxPages: criteria.maxPartPages ?? DEFAULT_MAX_RESUME_PART_PAGES, - maxParts: criteria.parts.length, - ...signal !== void 0 ? { signal } : {} - }); - const uploadedParts = uploadedPartsResult.parts; - if (uploadedPartsResult.truncated || !uploadedPartsMatchPlan(uploadedParts, criteria.parts)) { - notifyCandidateRejected(criteria, match.file, fileName, "part-length-mismatch"); - continue; - } - return { - fileId, - uploadedPartSha1s: partInfoToSha1s(uploadedParts) - }; - } - return null; -} -async function collectResumePartInfo(raw, accountInfo, fileId, options) { - const parts = /* @__PURE__ */ new Map(); - const maxPages = options.maxPages ?? Number.POSITIVE_INFINITY; - const maxParts = options.maxParts ?? Number.POSITIVE_INFINITY; - let startPartNumber; - let pageCount = 0; - while (pageCount < maxPages) { - options.signal?.throwIfAborted(); - const remainingParts = maxParts === Number.POSITIVE_INFINITY ? void 0 : Math.max(1, Math.min(LIST_PARTS_PAGE_SIZE, maxParts - parts.size + 1)); - const page = await abortableRequest(raw.listParts(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { - fileId, - ...startPartNumber !== void 0 ? { startPartNumber } : {}, - ...remainingParts !== void 0 ? { maxPartCount: remainingParts } : {} - }, options.signal !== void 0 ? { signal: options.signal } : void 0), options.signal); - pageCount++; - for (const part of page.parts) { - parts.set(part.partNumber, { - contentSha1: part.contentSha1, - contentLength: part.contentLength - }); - if (parts.size > maxParts) return { - parts, - truncated: true - }; - } - if (page.nextPartNumber === null) return { - parts, - truncated: false - }; - assertAdvancingPartCursor(fileId, startPartNumber, page.nextPartNumber); - startPartNumber = page.nextPartNumber; - } - return { - parts, - truncated: true - }; -} -function compareNewestFirst(a, b) { - const aTime = a.file.uploadTimestamp ?? Number.NEGATIVE_INFINITY; - const bTime = b.file.uploadTimestamp ?? Number.NEGATIVE_INFINITY; - if (aTime !== bTime) return bTime - aTime; - return b.sequence - a.sequence; -} -function candidateMetadataRejectReason(candidate, fileName, criteria) { - if (candidate.fileName !== fileName) return "file-name-mismatch"; - if (criteria.contentType === "b2/x-auto" && criteria.resumeFileId === void 0 && candidate.contentType !== "b2/x-auto") return "content-type-mismatch"; - if (criteria.contentType !== "b2/x-auto" && candidate.contentType !== criteria.contentType) return "content-type-mismatch"; - const candidateInfo = splitResumeFileInfo(candidate.fileInfo ?? {}); - if (!recordEquals(candidateInfo.fileInfo, criteria.fileInfo)) return "file-info-mismatch"; - if (candidateInfo.sourceSize !== void 0 && candidateInfo.sourceSize !== String(criteria.sourceSize)) return "source-size-mismatch"; - if (candidateInfo.partSize !== void 0 && candidateInfo.partSize !== String(criteria.partSize)) return "part-size-mismatch"; - const encryptionRejectReason = serverSideEncryptionRejectReason(candidate.serverSideEncryption, criteria.serverSideEncryption); - if (encryptionRejectReason !== null) return encryptionRejectReason; - if (!fileRetentionMatches(candidate.fileRetention, criteria.fileRetention, criteria.defaultFileRetention, criteria.defaultFileRetentionUnreadable === true, candidate.uploadTimestamp)) return "retention-mismatch"; - if (!legalHoldMatches(candidate.legalHold, criteria.legalHold)) return "legal-hold-mismatch"; - return null; -} -function notifyCandidateRejected(criteria, candidate, requestedFileName, reason) { - emitCandidateRejected(criteria, { - fileId: largeFileId(candidate.fileId), - requestedFileName, - candidateFileName: candidate.fileName, - reason - }); -} -function emitCandidateRejected(criteria, event) { - try { - criteria.onCandidateRejected?.(event); - } catch {} -} -function uploadedPartsMatchPlan(uploadedParts, plans) { - for (const [partNumber, part] of uploadedParts) { - const planned = plans[partNumber - 1]; - if (planned === void 0) return false; - if (planned.partNumber !== partNumber) return false; - if (planned.length !== part.contentLength) return false; - } - return true; -} -function partInfoToSha1s(parts) { - const sha1s = /* @__PURE__ */ new Map(); - for (const [partNumber, part] of parts) sha1s.set(partNumber, part.contentSha1); - return sha1s; -} -function recordEquals(a, b) { - const aKeys = Object.keys(a); - const bKeys = Object.keys(b); - if (aKeys.length !== bKeys.length) return false; - for (const key of aKeys) if (a[key] !== b[key]) return false; - return true; -} -function splitResumeFileInfo(fileInfo) { - const userFileInfo = Object.create(null); - let sourceSize; - let partSize; - for (const [key, value] of Object.entries(fileInfo)) if (key === "b2_sdk_resume_source_size") sourceSize = value; - else if (key === "b2_sdk_resume_part_size") partSize = value; - else userFileInfo[key] = value; - return { - fileInfo: userFileInfo, - ...sourceSize !== void 0 ? { sourceSize } : {}, - ...partSize !== void 0 ? { partSize } : {} - }; -} -function fileRetentionMatches(candidate, expected, defaultExpected, defaultUnreadable, uploadTimestamp) { - if (expected === void 0 && defaultUnreadable) return false; - if (expected === void 0 && defaultExpected !== void 0) { - if (defaultExpected.mode === BucketRetentionMode.None) { - if (candidate === void 0) return true; - if (!candidate.isClientAuthorizedToRead) return false; - return fileRetentionValueEquals(candidate.value, null); - } - if (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false; - return fileRetentionValueMatchesBucketDefault(candidate.value, defaultExpected, uploadTimestamp); - } - if (expected === void 0) { - if (candidate === void 0) return true; - if (!candidate.isClientAuthorizedToRead) return false; - return fileRetentionValueEquals(candidate.value, null); - } - if (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false; - return fileRetentionValueEquals(candidate.value, expected); -} -function fileRetentionValueMatchesBucketDefault(candidate, expected, uploadTimestamp) { - if (expected.period === null) return false; - if (candidate?.mode !== expected.mode || candidate.retainUntilTimestamp === null) return false; - if (uploadTimestamp === void 0) return false; - return candidate.retainUntilTimestamp === uploadTimestamp + retentionPeriodMillis(expected.period); -} -function retentionPeriodMillis(period) { - if (period === null) return 0; - return (period.unit === "days" ? period.duration : period.duration * 365) * 24 * 60 * 60 * 1e3; -} -function fileRetentionValueEquals(a, b) { - return (a?.mode ?? null) === (b?.mode ?? null) && (a?.retainUntilTimestamp ?? null) === (b?.retainUntilTimestamp ?? null); -} -function legalHoldMatches(candidate, expected) { - if (expected === void 0) { - if (candidate === void 0) return true; - if (!candidate.isClientAuthorizedToRead) return false; - return candidate.value === null || candidate.value === "off"; - } - if (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false; - return candidate.value === expected; -} -function createResumeDiscoverySignal(criteria) { - if (criteria.signal !== void 0) return { - signal: criteria.signal, - dispose() {} - }; - if (criteria.discoveryTimeoutMs === void 0) return { dispose() {} }; - const timeoutMs = criteria.discoveryTimeoutMs; - if (timeoutMs === Number.POSITIVE_INFINITY) return { dispose() {} }; - const controller = new AbortController(); - const timeout = setTimeout(() => { - controller.abort(resumeDiscoveryTimeoutReason(timeoutMs)); - }, Math.max(0, timeoutMs)); - return { - signal: controller.signal, - dispose() { - clearTimeout(timeout); - } - }; -} -async function abortableRequest(request, signal) { - if (signal === void 0) return request; - if (signal.aborted) throw resumeAbortReason(signal); - let removeAbortListener; - const aborted = new Promise((_resolve, reject) => { - const onAbort = () => reject(resumeAbortReason(signal)); - signal.addEventListener("abort", onAbort, { once: true }); - removeAbortListener = () => signal.removeEventListener("abort", onAbort); - }); - try { - return await Promise.race([request, aborted]); - } finally { - removeAbortListener?.(); - request.catch(() => {}); - } -} -function resumeAbortReason(signal) { - return signal.reason ?? resumeAbortFallbackReason(); -} -function resumeAbortFallbackReason() { - if (typeof DOMException === "function") return new DOMException("Resume discovery aborted", "AbortError"); - const error = /* @__PURE__ */ new Error("Resume discovery aborted"); - error.name = "AbortError"; - return error; -} -function resumeDiscoveryTimeoutReason(timeoutMs) { - if (typeof DOMException === "function") return new DOMException(`Resume discovery timed out after ${timeoutMs} ms`, "TimeoutError"); - const error = /* @__PURE__ */ new Error(`Resume discovery timed out after ${timeoutMs} ms`); - error.name = "TimeoutError"; - return error; -} -function serverSideEncryptionRejectReason(candidate, expected) { - if (expected?.mode === EncryptionMode.SseC) return "sse-c-unsupported"; - const actual = normalizeEncryption(candidate); - if (expected === void 0) { - if (candidate === void 0) return null; - if (actual === void 0) return "encryption-mismatch"; - if (actual.mode === EncryptionMode.None) return null; - if (actual.mode === EncryptionMode.SseB2) return null; - return actual.mode === EncryptionMode.SseC ? "sse-c-unsupported" : "encryption-mismatch"; - } - const normalizedExpected = normalizeEncryption(expected); - if (normalizedExpected?.mode === EncryptionMode.None && candidate === void 0) return null; - if (actual === void 0 || normalizedExpected === void 0) return "encryption-mismatch"; - if (actual.mode !== normalizedExpected.mode) return "encryption-mismatch"; - if (actual.mode === EncryptionMode.None) return null; - return actual.algorithm === normalizedExpected.algorithm ? null : "encryption-mismatch"; -} -function normalizeEncryption(encryption) { - if (encryption === void 0) return void 0; - if (encryption.mode === null || encryption.mode === EncryptionMode.None) return { mode: EncryptionMode.None }; - if (encryption.mode !== EncryptionMode.SseB2 && encryption.mode !== EncryptionMode.SseC) return; - return { - mode: encryption.mode, - algorithm: encryption.algorithm - }; -} -function assertAdvancingPartCursor(fileId, previous, next) { - if (!Number.isInteger(next) || next < 1 || previous !== void 0 && next <= previous) throw new Error(`uploadLargeFile: listParts returned a non-advancing nextPartNumber for ${fileId}; aborting resume.`); -} -//#endregion -//# sourceMappingURL=resume.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/retry.js - - -//#region src/upload/retry.ts -var freshUrlRetryOverride = { maxRetries: 0 }; -/** -* Resolves the public default for `retryResponseBodyFailures`. Callers must -* opt into replaying ambiguous upload POST failures for every upload mode. -* -* @param value - Caller-provided override, if any. -* -* @returns The boolean value passed to the upload retry helper. -*/ -function resolveRetryResponseBodyFailures(value) { - return value ?? false; -} -/** -* Fetches a small-file upload URL, bypassing the pool. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param bucketId - Bucket to upload into. -* @param signal - Optional abort signal for the fresh URL request. -* -* @returns A fresh upload URL entry. -*/ -async function fetchFreshUploadUrl(raw, accountInfo, bucketId, signal) { - const resp = await raw.getUploadUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { bucketId }, { - ...signal !== void 0 ? { signal } : {}, - retry: freshUrlRetryOverride - }); - return { - uploadUrl: resp.uploadUrl, - authorizationToken: resp.authorizationToken - }; -} -/** -* Fetches a large-file part upload URL, bypassing the pool. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param fileId - Large file to upload a part into. -* @param signal - Optional abort signal for the fresh URL request. -* -* @returns A fresh part upload URL entry. -*/ -async function fetchFreshPartUploadUrl(raw, accountInfo, fileId, signal) { - const resp = await raw.getUploadPartUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId }, { - ...signal !== void 0 ? { signal } : {}, - retry: freshUrlRetryOverride - }); - return { - uploadUrl: resp.uploadUrl, - authorizationToken: resp.authorizationToken - }; -} -/** -* Uploads one multipart part with fresh-URL retry. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param fileId - Large file to upload a part into. -* @param options - Part upload parameters and retry settings. -* -* @returns The uploaded part response. -*/ -function uploadPartWithFreshUrl(raw, accountInfo, fileId, options) { - return withFreshUploadUrlRetry({ - fileName: options.fileName, - partNumber: options.partNumber, - retry: options.retry, - signal: options.signal, - onUploadRetry: options.onUploadRetry, - retryResponseBodyFailures: options.retryResponseBodyFailures, - checkout: () => accountInfo.checkoutPartUploadUrl(fileId), - fetchFresh: () => fetchFreshPartUploadUrl(raw, accountInfo, fileId, options.signal), - returnEntry: (entry) => accountInfo.returnPartUploadUrl(fileId, entry), - evictEntry: (entry) => accountInfo.evictPartUploadUrl(fileId, entry), - upload: (entry) => raw.uploadPart(entry.uploadUrl, { - authorization: entry.authorizationToken, - partNumber: options.partNumber, - contentLength: options.contentLength, - contentSha1: options.contentSha1, - ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {} - }, options.data, { - ...options.signal !== void 0 ? { signal: options.signal } : {}, - ...options.retry !== void 0 ? { retry: options.retry } : {} - }) - }); -} -/** -* Runs an upload operation with B2's documented retry flow: evict the failed -* upload URL, back off, fetch a fresh upload URL, and retry there. -* -* For single-request file uploads, sending the POST again after a lost success -* response can create a duplicate file version. Multipart retries re-send the -* same part number instead. Response-body retry defaults are caller-specific: -* single-request uploads keep them off by default, while multipart callers can -* opt in with `retryResponseBodyFailures: true` when replaying the same part -* number is acceptable. -* -* @param options - URL checkout, upload, eviction, and retry callbacks. -* -* @returns The successful upload result. -*/ -async function withFreshUploadUrlRetry(options) { - const retryOptions = { - ...DEFAULT_RETRY_OPTIONS, - ...options.retry - }; - for (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) { - let uploadEntry; - let uploadStarted = false; - try { - options.signal?.throwIfAborted(); - uploadEntry = attempt === 0 ? options.checkout() ?? await options.fetchFresh() : await options.fetchFresh(); - uploadStarted = true; - const result = await options.upload(uploadEntry); - options.returnEntry(uploadEntry); - return result; - } catch (err) { - const retryError = normalizeUploadRetryError(err, options); - if (uploadEntry !== void 0) if (isUploadRateLimitError(retryError)) options.returnEntry(uploadEntry); - else options.evictEntry(uploadEntry); - if (options.signal?.aborted) throw err; - if (isUploadRateLimitError(retryError) && uploadEntry !== void 0) throw retryError; - if (!isUploadRetryable(retryError, { - ...options, - uploadStarted - }) || attempt === retryOptions.maxRetries) throw retryError; - const retryAttempt = attempt + 1; - const retryAfter = retryError instanceof B2Error ? retryError.retryAfter : void 0; - const delayMs = computeBackoff(attempt, retryOptions, retryAfter); - notifyUploadRetry(options, { - fileName: options.fileName, - partNumber: options.partNumber, - attempt: retryAttempt, - maxRetries: retryOptions.maxRetries, - delayMs, - error: retryError - }); - await sleep(delayMs, options.signal); - } - } - /* v8 ignore next -- defensive return-path guard. */ - throw new NetworkError("Upload retry budget exhausted"); -} -function notifyUploadRetry(options, event) { - try { - options.onUploadRetry?.(event); - } catch {} -} -function isUploadRetryable(err, options) { - if (err instanceof NetworkError) { - if (err.cause instanceof B2SsrfError) return false; - if (!options.uploadStarted) return true; - return options.retryResponseBodyFailures === true; - } - if (err instanceof BadAuthTokenError) return true; - if (isUploadUrlInvalidationError(err)) return true; - return err instanceof B2Error && err.retryable; -} -function isUploadRateLimitError(err) { - return err instanceof B2Error && err.status === 429; -} -function normalizeUploadRetryError(err, options) { - if (err instanceof B2Error || err instanceof NetworkError) return err; - if (err instanceof UploadResponseBodyError) { - if (!options.retryResponseBodyFailures) return err; - return new NetworkError(err.message, err); - } - if (err instanceof DOMException && err.name === "AbortError") return err; - if (err instanceof TypeError || err instanceof SyntaxError || err instanceof DOMException) return new NetworkError(err instanceof Error ? err.message : "Upload response read failed", err); - return err; -} -function isUploadUrlInvalidationError(err) { - if (err instanceof BadUploadUrlError) return true; - return err instanceof BadRequestError && /upload url/i.test(err.message); -} -//#endregion +function createParallelDownloadStream(raw, accountInfo, options) { + const rangeSize = options.rangeSize ?? 10 * 1024 * 1024; + const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY; + const totalSize = options.totalSize; + const retryOptions = { + ...DEFAULT_RETRY_OPTIONS, + ...options.maxRetries !== void 0 ? { maxRetries: options.maxRetries } : {} + }; + const abort = options.signal; + const ranges = planRanges(totalSize, rangeSize); + const windowSize = concurrency * 2; + const inflight = /* @__PURE__ */ new Map(); + const buffer = /* @__PURE__ */ new Map(); + let nextToSchedule = 0; + let nextToEmit = 0; + let firstError = null; + function scheduleNext() { + while (firstError === null && // Honour abort here so a completed range that triggers a top-up + // doesn't queue one final fetch after the caller aborted. Without + // this gate, one extra range request fires post-abort before the + // `pull()` loop notices. + abort?.aborted !== true && nextToSchedule < ranges.length && inflight.size + buffer.size < windowSize) { + const range = ranges[nextToSchedule]; + if (range === void 0) break; + const idx = nextToSchedule; + nextToSchedule++; + const task = (async () => { + try { + const data = await fetchRangeWithRetry( + raw, + accountInfo, + options.fileId, + range.start, + range.end, + retryOptions, + abort + ); + buffer.set(idx, data); + } catch (err) { + if (firstError === null) firstError = err; + } finally { + inflight.delete(idx); + } + })(); + inflight.set(idx, task); + } + } + return new ReadableStream({ + start(controller) { + try { + abort?.throwIfAborted(); + scheduleNext(); + } catch (err) { + controller.error(err); + } + }, + async pull(controller) { + try { + while (!buffer.has(nextToEmit)) { + abort?.throwIfAborted(); + if (firstError !== null) throw firstError; + if (inflight.size === 0) { + controller.close(); + return; + } + await Promise.race(inflight.values()); + } + const data = buffer.get(nextToEmit); + if (data !== void 0) { + buffer.delete(nextToEmit); + nextToEmit++; + controller.enqueue(data); + } + scheduleNext(); + if (nextToEmit >= ranges.length && buffer.size === 0 && inflight.size === 0 && firstError === null) { + controller.close(); + } + } catch (err) { + controller.error(err); + } + }, + cancel() { + buffer.clear(); + } + }); +} +async function fetchRangeWithRetry(raw, accountInfo, fileId, start, end, retryOptions, signal) { + let lastError; + for (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) { + if (attempt > 0) { + const delay = computeBackoff(attempt - 1, retryOptions); + await sleep(delay, signal); + } + try { + signal?.throwIfAborted(); + const resp = await raw.downloadFileById( + accountInfo.getDownloadUrl(), + accountInfo.getAuthToken(), + fileId, + { + range: byteRangeHeader(start, end), + ...signal !== void 0 ? { signal } : {} + } + ); + if (!resp.body) throw new Error("Download chunk has no body"); + return await collectStream(resp.body); + } catch (err) { + lastError = err; + if (signal?.aborted) throw err; + if (err instanceof DOMException && err.name === "AbortError") throw err; + } + } + throw lastError instanceof Error ? lastError : new Error("Range download failed after retries"); +} -//# sourceMappingURL=retry.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/large.js +//# sourceMappingURL=parallel.js.map +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/hash.js +let nodeCreateHash; +async function getNodeCreateHash() { + if (nodeCreateHash !== void 0) return nodeCreateHash; + try { + const crypto2 = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 7598, 19)); + if (typeof crypto2.createHash !== "function") throw new Error("createHash unavailable"); + nodeCreateHash = (algo) => { + const h = crypto2.createHash(algo); + return { + update(data) { + h.update(data); + }, + digest(encoding) { + return h.digest(encoding); + } + }; + }; + } catch { + nodeCreateHash = null; + } + return nodeCreateHash; +} +class IncrementalSha1 { + /** Buffered chunks for WebCrypto fallback path. */ + chunks = []; + /** Total bytes fed into the hash so far. */ + totalLength = 0; + /** Node.js hash instance, or null if using WebCrypto fallback. */ + nodeHash = null; + /** Resolves once the crypto backend has been loaded. */ + initPromise; + /** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */ + constructor() { + this.initPromise = getNodeCreateHash().then((factory) => { + if (factory) this.nodeHash = factory("sha1"); + }); + } + /** + * Feed data into the hash. Async because it lazily initializes the crypto backend. + * @param data - The bytes to include in the hash computation. + * + * @returns A promise that resolves once the data has been consumed. + */ + async update(data) { + await this.initPromise; + if (this.nodeHash) { + this.nodeHash.update(data); + } else { + this.chunks.push(new Uint8Array(data)); + } + this.totalLength += data.byteLength; + } + /** + * Finalize the hash and return the hex-encoded SHA-1 digest. + * @returns The lowercase hex-encoded SHA-1 digest of all data fed so far. + */ + async digest() { + await this.initPromise; + if (this.nodeHash) { + return this.nodeHash.digest("hex"); + } + const combined = new Uint8Array(this.totalLength); + let offset = 0; + for (const chunk of this.chunks) { + combined.set(chunk, offset); + offset += chunk.byteLength; + } + const hashBuffer = await crypto.subtle.digest("SHA-1", combined.buffer); + return hexEncode(new Uint8Array(hashBuffer)); + } + /** + * Total number of bytes fed into the hash so far. + * + * @returns The cumulative byte count across all update calls. + */ + get bytesProcessed() { + return this.totalLength; + } +} +function hexEncode(bytes) { + const hex = []; + for (const b of bytes) { + hex.push(b.toString(16).padStart(2, "0")); + } + return hex.join(""); +} +async function sha1Hex(data) { + const factory = await getNodeCreateHash(); + if (factory) { + const h = factory("sha1"); + h.update(data); + return h.digest("hex"); + } + const hashBuffer = await crypto.subtle.digest("SHA-1", data.buffer); + return hexEncode(new Uint8Array(hashBuffer)); +} +//# sourceMappingURL=hash.js.map +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/resume.js + +async function findResumeCandidate(raw, accountInfo, bucketId, fileName) { + const unfinished = await raw.listUnfinishedLargeFiles( + accountInfo.getApiUrl(), + accountInfo.getAuthToken(), + { bucketId } + ); + const match = unfinished.files.find((f) => f.fileName === fileName); + if (!match) return null; + const fileId = largeFileId(match.fileId); + const uploadedPartSha1s = await collectPartSha1s(raw, accountInfo, fileId); + return { fileId, uploadedPartSha1s }; +} +async function collectPartSha1s(raw, accountInfo, fileId) { + const sha1s = /* @__PURE__ */ new Map(); + let startPartNumber; + while (true) { + const page = await raw.listParts(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + fileId, + ...startPartNumber !== void 0 ? { startPartNumber } : {} + }); + for (const part of page.parts) { + sha1s.set(part.partNumber, part.contentSha1); + } + if (page.nextPartNumber === null) break; + startPartNumber = page.nextPartNumber; + } + return sha1s; +} +//# sourceMappingURL=resume.js.map +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/large.js @@ -35150,3820 +32141,3188 @@ function isUploadUrlInvalidationError(err) { -//#region src/upload/large.ts -var MAX_CONSECUTIVE_EMPTY_STREAM_CHUNKS = 1024; -function createResumeCandidateCriteria(options, request, totalSize, partSize, parts) { - return { - contentType: request.contentType, - fileInfo: request.fileInfo, - sourceSize: totalSize, - partSize, - parts, - ...options.signal !== void 0 ? { signal: options.signal } : {}, - ...request.serverSideEncryption !== void 0 ? { serverSideEncryption: request.serverSideEncryption } : options.bucketDefaultServerSideEncryption !== void 0 ? { serverSideEncryption: options.bucketDefaultServerSideEncryption } : {}, - ...request.fileRetention !== void 0 ? { fileRetention: request.fileRetention } : options.bucketDefaultRetention !== void 0 ? { defaultFileRetention: options.bucketDefaultRetention } : options.bucketDefaultRetentionUnreadable === true ? { defaultFileRetentionUnreadable: true } : {}, - ...request.legalHold !== void 0 ? { legalHold: request.legalHold } : {}, - ...options.resumeDiscoveryTimeoutMs !== void 0 ? { discoveryTimeoutMs: options.resumeDiscoveryTimeoutMs } : {}, - ...options.onResumeCandidateRejected !== void 0 ? { onCandidateRejected: options.onResumeCandidateRejected } : {}, - ...options.resumeMaxListPages !== void 0 ? { maxListPages: options.resumeMaxListPages } : {}, - ...options.resumeMaxPartCandidates !== void 0 ? { maxPartCandidates: options.resumeMaxPartCandidates } : {}, - ...options.resumeMaxPartPages !== void 0 ? { maxPartPages: options.resumeMaxPartPages } : {} - }; -} -/** -* Uploads a file using the B2 multipart (large file) protocol. -* -* The source is sliced into parts and uploaded concurrently via -* `b2_upload_part`. This is appropriate for files larger than the recommended -* part size. For smaller files, use {@link uploadSmallFile} which sends the -* entire payload in a single request. -* -* On failure, the in-progress large file is cancelled on a best-effort basis. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state (tokens, URLs, upload URL pool). -* @param options - Upload parameters including part size and concurrency. -* -* @returns The resulting {@link FileVersion} metadata. -*/ async function uploadLargeFile(raw, accountInfo, options) { - const recommendedPartSize = accountInfo.getRecommendedPartSize(); - const minPartSize = accountInfo.getAbsoluteMinimumPartSize(); - const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize); - const concurrency = options.concurrency ?? 4; - const totalSize = options.source.size; - const parts = planRanges(totalSize, partSize); - const fileInfo = Object.create(null); - if (options.fileInfo !== void 0) for (const [key, value] of Object.entries(options.fileInfo)) fileInfo[key] = value; - const startLargeFileRequest = { - bucketId: options.bucketId, - fileName: options.fileName, - contentType: options.contentType ?? "b2/x-auto", - fileInfo, - ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}, - ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {}, - ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {} - }; - const resumeCandidateCriteria = createResumeCandidateCriteria(options, startLargeFileRequest, totalSize, partSize, parts); - if (!options.source.canSlice && options.resumeFileId !== void 0) throw new Error("uploadLargeFile: resume is not supported on non-sliceable sources."); - let largeFileId; - let preUploaded = /* @__PURE__ */ new Map(); - let createdLargeFile = false; - const abortScope = createAbortScope(options.signal); - const startFreshLargeFile = async () => { - if (abortScope.signal.aborted && !options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason); - abortScope.signal.throwIfAborted(); - const startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), startLargeFileRequest, { - signal: abortScope.signal, - ...options.retry !== void 0 ? { retry: options.retry } : {} - }); - try { - largeFileId = (await raceWithAbort(startPromise, abortScope.signal)).fileId; - } catch (err) { - if (abortScope.signal.aborted) { - if (!options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason).catch(() => {}); - large_cancelLargeFileAfterStart(startPromise, raw, accountInfo, options.onCleanupFailure); - } - throw err; - } - preUploaded = /* @__PURE__ */ new Map(); - createdLargeFile = true; - }; - try { - if (abortScope.signal.aborted && !options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason); - abortScope.signal.throwIfAborted(); - if (options.resumeFileId !== void 0) { - const candidate = await findResumeCandidate(raw, accountInfo, options.bucketId, options.fileName, { - ...resumeCandidateCriteria, - resumeFileId: options.resumeFileId - }); - if (candidate === null) throw new ResumeFileIdMismatchError(options.resumeFileId, options.fileName); - largeFileId = candidate.fileId; - preUploaded = candidate.uploadedPartSha1s; - } else if (options.resume === true && options.source.canSlice) { - const candidate = await findResumeCandidate(raw, accountInfo, options.bucketId, options.fileName, resumeCandidateCriteria); - if (candidate) { - largeFileId = candidate.fileId; - preUploaded = /* @__PURE__ */ new Map(); - } else await startFreshLargeFile(); - } else await startFreshLargeFile(); - const activeLargeFileId = largeFileId; - if (activeLargeFileId === void 0) throw new Error("uploadLargeFile: start did not return a large file ID."); - const partSha1s = new Array(parts.length); - const tracker = new ProgressTracker(options.onProgress, totalSize, parts.length); - const sem = new Semaphore(concurrency); - if (!options.source.canSlice) { - await uploadPartsSequentially(raw, accountInfo, options, activeLargeFileId, parts, partSha1s, tracker, abortScope.signal); - return await finishLargeFileWithAbortReconciliation(raw, accountInfo, { - fileId: activeLargeFileId, - bucketId: options.bucketId, - fileName: options.fileName, - partSha1s, - signal: abortScope.signal, - ...options.retry !== void 0 ? { retry: options.retry } : {} - }); - } - const tasks = parts.map(async (part) => { - await sem.acquire(); - try { - abortScope.signal.throwIfAborted(); - const partSource = options.source.slice(part.offset, part.offset + part.length); - const data = new Uint8Array(await partSource.toArrayBuffer({ signal: abortScope.signal })); - abortScope.signal.throwIfAborted(); - const partSha1 = new IncrementalSha1(); - await partSha1.update(data); - const sha1Hex = await partSha1.digest(); - abortScope.signal.throwIfAborted(); - const serverSha1 = preUploaded.get(part.partNumber); - if (serverSha1 !== void 0 && serverSha1 === sha1Hex) { - notifyResumePartReused(options.onResumePartReused, { - fileName: options.fileName, - fileId: activeLargeFileId, - partNumber: part.partNumber, - contentLength: data.byteLength, - contentSha1: serverSha1 - }); - partSha1s[part.partNumber - 1] = serverSha1; - tracker.addBytes(data.byteLength); - tracker.completePart(); - return; - } - const result = await uploadPartWithFreshUrl(raw, accountInfo, activeLargeFileId, { - fileName: options.fileName, - partNumber: part.partNumber, - data, - contentLength: data.byteLength, - contentSha1: sha1Hex, - retry: options.retry, - signal: abortScope.signal, - onUploadRetry: options.onUploadRetry, - retryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures), - ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {} - }); - partSha1s[part.partNumber - 1] = result.contentSha1; - tracker.addBytes(data.byteLength); - tracker.completePart(); - } catch (err) { - abortScope.abort(err); - throw err; - } finally { - sem.release(); - } - }); - throwRejectedOrAbortReason(await Promise.allSettled(tasks), abortScope); - return await finishLargeFileWithAbortReconciliation(raw, accountInfo, { - fileId: activeLargeFileId, - bucketId: options.bucketId, - fileName: options.fileName, - partSha1s, - signal: abortScope.signal, - ...options.retry !== void 0 ? { retry: options.retry } : {} - }); - } catch (err) { - abortScope.abort(err); - if (largeFileId === void 0) throw err; - return await cleanupAfterUploadLargeFileError(err, raw, accountInfo, options, largeFileId, createdLargeFile); - } finally { - abortScope.dispose(); - } -} -function large_cancelLargeFileAfterStart(started, raw, accountInfo, onCleanupFailure) { - started.then((resp) => cancelLargeFileBestEffort(raw, accountInfo, resp.fileId, onCleanupFailure === void 0 ? void 0 : { onCleanupFailure })).catch(() => {}); -} -async function cleanupAfterUploadLargeFileError(err, raw, accountInfo, options, largeFileId, createdLargeFile) { - return await cleanupAfterLargeFileError(err, raw, accountInfo, { - fileId: largeFileId, - bucketId: options.bucketId, - fileName: options.fileName, - signal: options.signal, - onCleanupFailure: options.onCleanupFailure - }, { cancelOnError: createdLargeFile }); -} -/** -* Sequential upload path for non-sliceable sources. -* -* Reads the source's `stream()` once and accumulates exactly `partSize` -* bytes into an in-memory buffer per iteration. Each filled buffer is -* hashed, dispatched to `b2_upload_part`, then released before the next -* part starts — so peak memory is ~partSize regardless of file size. -* -* Concurrency is forced to 1 here because the stream is a single -* forward-only cursor; the engine can't read part N+1 until part N is -* fully consumed. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param options - The original `uploadLargeFile` options. -* @param largeFileId - ID of the in-progress large file (already started). -* @param parts - Pre-planned part layout (used for part numbers + count). -* @param partSha1s - Output array, written in-place at index `partNumber - 1`. -* @param tracker - Progress tracker; bytes added per chunk, part completed -* each time a part finishes. -* @param signal - Linked abort signal for source reads and part uploads. -*/ -async function uploadPartsSequentially(raw, accountInfo, options, largeFileId, parts, partSha1s, tracker, signal) { - const reader = options.source.stream().getReader(); - let bytesRead = 0; - let carry = null; - try { - for (const planned of parts) { - signal.throwIfAborted(); - const buf = new Uint8Array(planned.length); - let filled = 0; - if (carry !== null) { - const take = Math.min(carry.byteLength, buf.byteLength - filled); - buf.set(carry.subarray(0, take), filled); - filled += take; - carry = take < carry.byteLength ? carry.subarray(take) : null; - } - while (filled < buf.byteLength) { - const { done, value } = await readNextNonEmptyStreamChunk(reader, emptyChunkError(), signal); - if (done) throw new Error(`uploadLargeFile: source stream ended after ${bytesRead} bytes, expected ${options.source.size}.`); - bytesRead += value.byteLength; - const take = Math.min(value.byteLength, buf.byteLength - filled); - buf.set(value.subarray(0, take), filled); - filled += take; - if (take < value.byteLength) carry = value.subarray(take); - } - signal.throwIfAborted(); - const data = buf; - const partSha1 = new IncrementalSha1(); - await partSha1.update(data); - const sha1Hex = await partSha1.digest(); - signal.throwIfAborted(); - const result = await uploadPartWithFreshUrl(raw, accountInfo, largeFileId, { - fileName: options.fileName, - partNumber: planned.partNumber, - data, - contentLength: data.byteLength, - contentSha1: sha1Hex, - retry: options.retry, - signal, - onUploadRetry: options.onUploadRetry, - retryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures), - ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {} - }); - partSha1s[planned.partNumber - 1] = result.contentSha1; - tracker.addBytes(data.byteLength); - tracker.completePart(); - } - if (carry !== null && carry.byteLength > 0) throw new Error(tooManyBytesError(options.source.size)); - const extra = await readNextNonEmptyStreamChunk(reader, emptyChunkError(), signal); - if (!extra.done) { - bytesRead += extra.value.byteLength; - throw new Error(tooManyBytesError(options.source.size)); - } - } catch (err) { - await reader.cancel(err).catch(() => {}); - throw err; - } finally { - reader.releaseLock(); - } -} -function emptyChunkError() { - return `uploadLargeFile: source stream emitted more than ${MAX_CONSECUTIVE_EMPTY_STREAM_CHUNKS} consecutive empty chunks. too many empty chunks.`; -} -function tooManyBytesError(advertisedSize) { - return `uploadLargeFile: source stream emitted more than advertised ${advertisedSize} bytes. source stream emitted more bytes than advertised size.`; -} -async function cancelForwardOnlySource(source, reason) { - const reader = source.stream().getReader(); - try { - await reader.cancel(reason); - } finally { - reader.releaseLock(); - } -} -function notifyResumePartReused(listener, event) { - try { - listener?.(event); - } catch {} -} -//#endregion - - -//# sourceMappingURL=large.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/options.js -//#region src/upload/options.ts -/** -* Explicit resume targets are multipart-only and must fail closed on small uploads. -* -* @param options - High-level upload options. -* @param caller - Public method name used in the thrown error. -* -* @throws Error when an explicit resume target is supplied for a small upload. -*/ -function rejectSmallResumeFileId(options, caller) { - if (options.resumeFileId !== void 0) throw new Error(`${caller}: resumeFileId is only supported for multipart uploads.`); + const recommendedPartSize = accountInfo.getRecommendedPartSize(); + const minPartSize = accountInfo.getAbsoluteMinimumPartSize(); + const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize); + const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY; + const totalSize = options.source.size; + const parts = planRanges(totalSize, partSize); + const fileInfo = { ...options.fileInfo }; + const startLargeFileRequest = { + bucketId: options.bucketId, + fileName: options.fileName, + contentType: options.contentType ?? DEFAULT_CONTENT_TYPE, + fileInfo, + ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}, + ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {}, + ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {} + }; + let largeFileId; + let preUploaded; + if (options.resumeFileId !== void 0) { + largeFileId = options.resumeFileId; + preUploaded = await collectPartSha1s(raw, accountInfo, largeFileId); + } else if (options.resume === true) { + const candidate = await findResumeCandidate( + raw, + accountInfo, + options.bucketId, + options.fileName + ); + if (candidate) { + largeFileId = candidate.fileId; + preUploaded = candidate.uploadedPartSha1s; + } else { + const startResp = await raw.startLargeFile( + accountInfo.getApiUrl(), + accountInfo.getAuthToken(), + startLargeFileRequest + ); + largeFileId = startResp.fileId; + preUploaded = /* @__PURE__ */ new Map(); + } + } else { + const startResp = await raw.startLargeFile( + accountInfo.getApiUrl(), + accountInfo.getAuthToken(), + startLargeFileRequest + ); + largeFileId = startResp.fileId; + preUploaded = /* @__PURE__ */ new Map(); + } + const partSha1s = new Array(parts.length); + const tracker = new ProgressTracker(options.onProgress, totalSize, parts.length); + const sem = new Semaphore(concurrency); + if (!options.source.canSlice) { + if (options.resume === true || options.resumeFileId !== void 0) { + await cancelLargeFileBestEffort(raw, accountInfo, largeFileId); + throw new Error( + "uploadLargeFile: resume is not supported on non-sliceable sources (e.g. StreamSource)." + ); + } + try { + await uploadPartsSequentially( + raw, + accountInfo, + options, + largeFileId, + parts, + partSha1s, + tracker + ); + return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + fileId: largeFileId, + partSha1Array: partSha1s + }); + } catch (err) { + await cancelLargeFileBestEffort(raw, accountInfo, largeFileId); + throw err; + } + } + try { + const tasks = parts.map(async (part) => { + await sem.acquire(); + try { + options.signal?.throwIfAborted(); + const partSource = options.source.slice(part.offset, part.offset + part.length); + const data = new Uint8Array(await partSource.toArrayBuffer()); + const partSha1 = new IncrementalSha1(); + await partSha1.update(data); + const sha1Hex = await partSha1.digest(); + const serverSha1 = preUploaded.get(part.partNumber); + if (serverSha1 !== void 0 && serverSha1 === sha1Hex) { + partSha1s[part.partNumber - 1] = serverSha1; + tracker.addBytes(data.byteLength); + tracker.completePart(); + return; + } + let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId); + if (!uploadEntry) { + const resp = await raw.getUploadPartUrl( + accountInfo.getApiUrl(), + accountInfo.getAuthToken(), + { fileId: largeFileId } + ); + uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken }; + } + try { + const result2 = await raw.uploadPart( + uploadEntry.uploadUrl, + { + authorization: uploadEntry.authorizationToken, + partNumber: part.partNumber, + contentLength: data.byteLength, + contentSha1: sha1Hex, + ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {} + }, + data, + options.signal + ); + accountInfo.returnPartUploadUrl(largeFileId, uploadEntry); + partSha1s[part.partNumber - 1] = result2.contentSha1; + tracker.addBytes(data.byteLength); + tracker.completePart(); + } catch (err) { + accountInfo.evictPartUploadUrl(largeFileId, uploadEntry); + throw err; + } + } finally { + sem.release(); + } + }); + await Promise.all(tasks); + const result = await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + fileId: largeFileId, + partSha1Array: partSha1s + }); + return result; + } catch (err) { + await cancelLargeFileBestEffort(raw, accountInfo, largeFileId); + throw err; + } } -/** -* Removes resume-only options before forwarding to the small-file upload path. -* -* @param options - High-level upload options. -* -* @returns Options accepted by the single-request upload implementation. -*/ -function stripResumeOnlyOptions(options) { - const { resume: _resume, resumeFileId: _resumeFileId, onResumeCandidateRejected: _onResumeCandidateRejected, onResumePartReused: _onResumePartReused, resumeDiscoveryTimeoutMs: _resumeDiscoveryTimeoutMs, resumeMaxListPages: _resumeMaxListPages, resumeMaxPartCandidates: _resumeMaxPartCandidates, resumeMaxPartPages: _resumeMaxPartPages, ...smallOptions } = options; - return smallOptions; +async function uploadPartsSequentially(raw, accountInfo, options, largeFileId, parts, partSha1s, tracker) { + const reader = options.source.stream().getReader(); + let partNumber = 1; + let carry = null; + try { + for (const planned of parts) { + options.signal?.throwIfAborted(); + const buf = new Uint8Array(planned.length); + let filled = 0; + if (carry !== null) { + const take = Math.min(carry.byteLength, buf.byteLength - filled); + buf.set(carry.subarray(0, take), filled); + filled += take; + carry = take < carry.byteLength ? carry.subarray(take) : null; + } + while (filled < buf.byteLength) { + const { done, value } = await reader.read(); + if (done) break; + const take = Math.min(value.byteLength, buf.byteLength - filled); + buf.set(value.subarray(0, take), filled); + filled += take; + if (take < value.byteLength) { + carry = value.subarray(take); + } + } + const data = filled === buf.byteLength ? buf : buf.subarray(0, filled); + if (data.byteLength === 0) { + throw new Error( + `uploadLargeFile: source stream ended before part ${partNumber}; advertised size does not match emitted bytes.` + ); + } + const partSha1 = new IncrementalSha1(); + await partSha1.update(data); + const sha1Hex = await partSha1.digest(); + let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId); + if (!uploadEntry) { + const resp = await raw.getUploadPartUrl( + accountInfo.getApiUrl(), + accountInfo.getAuthToken(), + { fileId: largeFileId } + ); + uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken }; + } + try { + const result = await raw.uploadPart( + uploadEntry.uploadUrl, + { + authorization: uploadEntry.authorizationToken, + partNumber: planned.partNumber, + contentLength: data.byteLength, + contentSha1: sha1Hex, + ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {} + }, + data, + options.signal + ); + accountInfo.returnPartUploadUrl(largeFileId, uploadEntry); + partSha1s[planned.partNumber - 1] = result.contentSha1; + tracker.addBytes(data.byteLength); + tracker.completePart(); + } catch (err) { + accountInfo.evictPartUploadUrl(largeFileId, uploadEntry); + throw err; + } + partNumber++; + } + } finally { + reader.releaseLock(); + } } -//#endregion - - -//# sourceMappingURL=options.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/single.js +//# sourceMappingURL=large.js.map +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/single.js -//#region src/upload/single.ts -/** -* Uploads a file in a single HTTP request (suitable for files up to ~100 MB). -* -* The entire file content is read into memory, SHA-1 hashed, and sent in one -* `b2_upload_file` call. For files larger than the recommended part size, use -* {@link uploadLargeFile} which splits the file into parts uploaded in parallel. -* -* Upload URLs are pooled via {@link AccountInfo} and recycled on success or -* evicted on failure. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state (tokens, URLs, upload URL pool). -* @param options - Upload parameters. -* -* @returns The resulting {@link FileVersion} metadata. -*/ async function uploadSmallFile(raw, accountInfo, options) { - const data = await readSmallFileSource(options.source, options.signal); - if (data.byteLength !== options.source.size) throw new Error(`uploadSmallFile: source byte count does not match advertised size (expected ${options.source.size} bytes, got ${data.byteLength} bytes).`); - const sha1 = new IncrementalSha1(); - await sha1.update(data); - const sha1Hex = await sha1.digest(); - const tracker = new ProgressTracker(options.onProgress, data.byteLength, 1); - const result = await withFreshUploadUrlRetry({ - fileName: options.fileName, - partNumber: null, - retry: options.retry, - signal: options.signal, - onUploadRetry: options.onUploadRetry, - retryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures), - checkout: () => accountInfo.checkoutUploadUrl(options.bucketId), - fetchFresh: () => fetchFreshUploadUrl(raw, accountInfo, options.bucketId, options.signal), - returnEntry: (entry) => accountInfo.returnUploadUrl(options.bucketId, entry), - evictEntry: (entry) => accountInfo.evictUploadUrl(options.bucketId, entry), - upload: (entry) => raw.uploadFile(entry.uploadUrl, { - authorization: entry.authorizationToken, - fileName: options.fileName, - contentType: options.contentType ?? "b2/x-auto", - contentLength: data.byteLength, - contentSha1: sha1Hex, - ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {}, - ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}, - ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {}, - ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {}, - ...options.lastModifiedMillis !== void 0 ? { lastModifiedMillis: options.lastModifiedMillis } : {} - }, data, { - ...options.signal !== void 0 ? { signal: options.signal } : {}, - ...options.retry !== void 0 ? { retry: options.retry } : {} - }) - }); - tracker.addBytes(data.byteLength); - tracker.completePart(); - return result; -} -async function readSmallFileSource(source, signal) { - signal?.throwIfAborted(); - if (!source.canSlice) return collectStreamExactly(source.stream(), source.size, signal); - const data = new Uint8Array(await (signal === void 0 ? source.toArrayBuffer() : source.toArrayBuffer({ signal }))); - signal?.throwIfAborted(); - return data; -} -//#endregion - + let uploadEntry = accountInfo.checkoutUploadUrl(options.bucketId); + if (!uploadEntry) { + const resp = await raw.getUploadUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + bucketId: options.bucketId + }); + uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken }; + } + const data = new Uint8Array(await options.source.toArrayBuffer()); + const sha1 = new IncrementalSha1(); + await sha1.update(data); + const sha1Hex = await sha1.digest(); + const tracker = new ProgressTracker(options.onProgress, data.byteLength, 1); + try { + const result = await raw.uploadFile( + uploadEntry.uploadUrl, + { + authorization: uploadEntry.authorizationToken, + fileName: options.fileName, + contentType: options.contentType ?? DEFAULT_CONTENT_TYPE, + contentLength: data.byteLength, + contentSha1: sha1Hex, + ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {}, + ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}, + ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {}, + ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {}, + ...options.lastModifiedMillis !== void 0 ? { lastModifiedMillis: options.lastModifiedMillis } : {} + }, + data, + options.signal + ); + tracker.addBytes(data.byteLength); + tracker.completePart(); + accountInfo.returnUploadUrl(options.bucketId, uploadEntry); + return result; + } catch (err) { + accountInfo.evictUploadUrl(options.bucketId, uploadEntry); + throw err; + } +} //# sourceMappingURL=single.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/to-error.js -//#region src/util/to-error.ts -/** -* Coerce an unknown caught value to a real error instance. -* -* Existing error objects pass through unchanged so call sites preserve -* the original stack and any subclass identity. Other values are -* wrapped in a fresh Error whose message is `String(value)`. Centralises -* the conditional that previously recurred at every async-boundary -* catch site in the upload, copy, sync, and stream paths. -* -* @param value - Value caught from a `try`/`catch` or rejected promise. -* -* @returns An `Error` representing `value`. -*/ + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/to-error.js function toError(value) { - return value instanceof Error ? value : new Error(String(value)); + return value instanceof Error ? value : new Error(String(value)); } -//#endregion - //# sourceMappingURL=to-error.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/collect.js -//#region src/streams/collect.ts -/** -* Drain a `ReadableStream` into a single contiguous -* `Uint8Array`. Releases the reader lock on both the happy and error -* paths so the underlying stream can propagate close / error events to -* the upstream producer. -* -* Used by both `createParallelDownloadStream` (per-range fetch) and -* `StreamSource.toArrayBuffer` (whole-source materialisation). The two -* code paths previously hand-rolled the same accumulate-then-concat -* loop; consolidating here removes ~25 duplicated lines and a class of -* lock-leak bugs. -* -* @param stream - Readable stream to consume. Will be fully drained. -* @param options - Optional abort signal used to stop a pending read. -* -* @returns A new `Uint8Array` containing every byte the stream produced. -*/ -async function collect_collectStream(stream, options = {}) { - const reader = stream.getReader(); - try { - const chunks = []; - let total = 0; - while (true) { - const { done, value } = await readStreamChunkWithSignal(reader, options.signal); - if (done) break; - chunks.push(value); - total += value.byteLength; - } - const result = new Uint8Array(total); - let offset = 0; - for (const chunk of chunks) { - result.set(chunk, offset); - offset += chunk.byteLength; - } - return result; - } finally { - reader.releaseLock(); - } -} -/** -* Reads one chunk and rejects when the supplied signal aborts. -* @param reader - Stream reader to read from. -* @param signal - Optional abort signal that cancels the read. -* -* @returns The next stream read result. -* -* @internal -*/ -async function readStreamChunkWithSignal(reader, signal) { - if (signal === void 0) return reader.read(); - signal.throwIfAborted(); - let removeAbortListener; - const abortPromise = new Promise((_, reject) => { - const onAbort = () => { - const reason = collect_abortReason(signal); - reject(reason); - reader.cancel(reason).catch(() => {}); - }; - signal.addEventListener("abort", onAbort, { once: true }); - removeAbortListener = () => signal.removeEventListener("abort", onAbort); - }); - try { - return await Promise.race([reader.read(), abortPromise]); - } finally { - removeAbortListener?.(); - } -} -function collect_abortReason(signal) { - return signal.reason ?? new DOMException("The operation was aborted.", "AbortError"); -} -//#endregion - - -//# sourceMappingURL=collect.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/parallel.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/stream.js +function createWriteStream(raw, accountInfo, options) { + const minPartSize = accountInfo.getAbsoluteMinimumPartSize(); + const recommendedPartSize = accountInfo.getRecommendedPartSize(); + const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize); + const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY; + const tracker = new ProgressTracker(options.onProgress, null, null); + const sem = new Semaphore(concurrency); + let largeFileId = null; + let startPromise = null; + let nextPartNumber = 1; + let pendingBytes = 0; + const pending = []; + const partSha1s = []; + const inflight = []; + let errored = null; + const { + promise: done, + resolve: resolveDone, + reject: rejectDone + } = Promise.withResolvers(); + done.catch(() => { + }); + function ensureStarted() { + if (largeFileId !== null) return Promise.resolve(largeFileId); + if (startPromise !== null) return startPromise; + startPromise = (async () => { + const resp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + bucketId: options.bucketId, + fileName: options.fileName, + contentType: options.contentType ?? DEFAULT_CONTENT_TYPE, + fileInfo: options.fileInfo ?? {}, + ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {} + }); + largeFileId = resp.fileId; + return largeFileId; + })(); + return startPromise; + } + async function shipPart(data, partNumber) { + const fileId = await ensureStarted(); + const sha1 = new IncrementalSha1(); + await sha1.update(data); + const sha1Hex = await sha1.digest(); + let uploadEntry = accountInfo.checkoutPartUploadUrl(fileId); + if (!uploadEntry) { + const resp = await raw.getUploadPartUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { + fileId + }); + uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken }; + } + try { + const result = await raw.uploadPart( + uploadEntry.uploadUrl, + { + authorization: uploadEntry.authorizationToken, + partNumber, + contentLength: data.byteLength, + contentSha1: sha1Hex, + ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {} + }, + data, + options.signal + ); + accountInfo.returnPartUploadUrl(fileId, uploadEntry); + partSha1s[partNumber - 1] = result.contentSha1; + tracker.addBytes(data.byteLength); + tracker.completePart(); + } catch (err) { + accountInfo.evictPartUploadUrl(fileId, uploadEntry); + throw err; + } + } + function dispatchPart() { + if (pending.length === 0) return; + let data; + if (pending.length === 1) { + const head = pending[0]; + if (!head) return; + data = head; + } else { + const total = pending.reduce((sum, chunk) => sum + chunk.byteLength, 0); + data = new Uint8Array(total); + let offset = 0; + for (const chunk of pending) { + data.set(chunk, offset); + offset += chunk.byteLength; + } + } + pending.length = 0; + pendingBytes = 0; + const partNumber = nextPartNumber++; + const task = (async () => { + await sem.acquire(); + try { + await shipPart(data, partNumber); + } catch (err) { + errored = toError(err); + throw err; + } finally { + sem.release(); + } + })(); + inflight.push(task); + task.catch(() => { + }); + } + const writable = new WritableStream({ + async write(chunk) { + if (errored) throw errored; + options.signal?.throwIfAborted(); + pending.push(chunk); + pendingBytes += chunk.byteLength; + while (pendingBytes >= partSize) { + const carved = carveExact(pending, partSize); + const partNumber = nextPartNumber++; + pendingBytes -= partSize; + const task = (async () => { + await sem.acquire(); + try { + await shipPart(carved, partNumber); + } catch (err) { + errored = toError(err); + throw err; + } finally { + sem.release(); + } + })(); + inflight.push(task); + task.catch(() => { + }); + } + }, + async close() { + try { + if (errored) throw errored; + options.signal?.throwIfAborted(); + if (pendingBytes > 0) { + dispatchPart(); + } + await Promise.all(inflight); + if (errored) throw errored; + if (largeFileId === null) { + throw new Error("createWriteStream closed without any data written."); + } + const result = await raw.finishLargeFile( + accountInfo.getApiUrl(), + accountInfo.getAuthToken(), + { fileId: largeFileId, partSha1Array: partSha1s } + ); + resolveDone(result); + } catch (err) { + const fileIdToCancel = largeFileId; + if (fileIdToCancel !== null) { + await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel); + } + rejectDone(err); + throw err; + } + }, + async abort(reason) { + const fileIdToCancel = largeFileId; + if (fileIdToCancel !== null) { + await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel); + } + rejectDone(toError(reason)); + } + }); + return { writable, done }; +} +function carveExact(chunks, size) { + const out = new Uint8Array(size); + let written = 0; + while (written < size && chunks.length > 0) { + const head = chunks[0]; + if (!head) break; + const need = size - written; + if (head.byteLength <= need) { + out.set(head, written); + written += head.byteLength; + chunks.shift(); + } else { + out.set(head.subarray(0, need), written); + chunks[0] = head.subarray(need); + written += need; + } + } + return out; +} +//# sourceMappingURL=stream.js.map -//#region src/download/parallel.ts -/** -* Creates a readable stream that downloads a file using parallel byte-range requests. -* -* The file is split into fixed-size ranges fetched in a **sliding -* window** keyed off the consumer's read pace. The window size is -* `concurrency * 2`: up to `concurrency` ranges are in flight at once, -* plus up to `concurrency` completed-but-not-yet-emitted ranges buffered -* ahead of the read head. New fetches kick off only when the consumer -* reads a chunk, so a slow downstream pipe (e.g. a saturated network -* sink or a `pipeTo` consumer that drains slowly) backpressures into -* the SDK and bounds peak memory to `(concurrency * 2) * rangeSize`. -* -* The previous eager implementation scheduled every range into -* `Promise.all` up front; a slow head-of-line range could hold the -* entire file in memory while later ranges finished and waited. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param options - Parallel download parameters (file ID, size, concurrency). -* -* @returns A `ReadableStream` that yields file bytes in order. -*/ -function createParallelDownloadStream(raw, accountInfo, options) { - const rangeSize = options.rangeSize ?? 10 * 1024 * 1024; - const concurrency = options.concurrency ?? 4; - const totalSize = options.totalSize; - const retryOptions = { - ...DEFAULT_RETRY_OPTIONS, - maxRetries: options.maxRetries ?? 0 - }; - const abort = options.signal; - const ranges = planRanges(totalSize, rangeSize); - const windowSize = concurrency * 2; - const inflight = /* @__PURE__ */ new Map(); - const buffer = /* @__PURE__ */ new Map(); - let assembledSha1 = null; - let nextToSchedule = 0; - let nextToEmit = 0; - let expectedSha1; - let firstError = null; - function scheduleNext() { - while (firstError === null && abort?.aborted !== true && nextToSchedule < ranges.length && inflight.size + buffer.size < windowSize) { - const range = ranges[nextToSchedule]; - if (range === void 0) break; - const idx = nextToSchedule; - nextToSchedule++; - const task = (async () => { - try { - const result = await fetchRangeWithRetry(raw, accountInfo, options.fileId, range.start, range.end, totalSize, retryOptions, abort); - buffer.set(idx, result); - } catch (err) { - if (firstError === null) firstError = err; - } finally { - inflight.delete(idx); - } - })(); - inflight.set(idx, task); - } - } - return new ReadableStream({ - start(controller) { - try { - abort?.throwIfAborted(); - scheduleNext(); - } catch (err) { - controller.error(err); - } - }, - async pull(controller) { - try { - while (!buffer.has(nextToEmit)) { - abort?.throwIfAborted(); - if (firstError !== null) throw firstError; - if (inflight.size === 0) { - controller.close(); - return; - } - await Promise.race(inflight.values()); - } - const result = buffer.get(nextToEmit); - if (result !== void 0) { - buffer.delete(nextToEmit); - nextToEmit++; - const rangeSha1 = normalizeVerifiableSha1(result.contentSha1); - if (expectedSha1 === void 0) expectedSha1 = rangeSha1; - else assertDownloadSha1HeaderAgreement(expectedSha1, rangeSha1); - if (expectedSha1 !== null) { - assembledSha1 ??= new IncrementalSha1(); - await assembledSha1.update(result.data); - } - controller.enqueue(result.data); - } - scheduleNext(); - if (nextToEmit >= ranges.length && buffer.size === 0 && inflight.size === 0 && firstError === null) { - if (expectedSha1 !== void 0 && expectedSha1 !== null && assembledSha1 !== null) assertDownloadSha1(expectedSha1, await assembledSha1.digest()); - controller.close(); - } - } catch (err) { - controller.error(err); - } - }, - cancel() { - buffer.clear(); - } - }); -} -/** -* Fetches a single byte range with bounded retry on transient failures. -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state. -* @param fileId - ID of the file being downloaded. -* @param start - Inclusive byte offset where the range begins. -* @param end - Inclusive byte offset where the range ends. -* @param totalSize - Expected complete file size. -* @param retryOptions - Retry settings controlling attempts and backoff. -* @param signal - Optional abort signal that cancels the range and any pending retry. -* -* @returns The range's bytes, or throws after exhausting all retry attempts. -*/ -async function fetchRangeWithRetry(raw, accountInfo, fileId, start, end, totalSize, retryOptions, signal) { - let lastError; - for (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) { - if (attempt > 0) { - const retryAfter = lastError instanceof B2Error && lastError.retryAfter !== void 0 ? lastError.retryAfter : void 0; - await sleep(computeBackoff(attempt - 1, retryOptions, retryAfter), signal); - } - try { - signal?.throwIfAborted(); - const resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), fileId, { - range: byteRangeHeader(start, end), - ...signal !== void 0 ? { signal } : {} - }); - if (resp.status < 200 || resp.status >= 300) throw await classifyDownloadResponseError(resp); - if (!resp.body) throw new Error("Download chunk has no body"); - const data = await collect_collectStream(resp.body); - validateRangeResponse(resp, start, end, totalSize, data.byteLength); - return { - data, - contentSha1: normalizeSha1(resp.headers.get("X-Bz-Content-Sha1")) - }; - } catch (err) { - lastError = err; - if (signal?.aborted) throw err; - if (err instanceof DOMException && err.name === "AbortError") throw err; - if (!isRetryableRangeError(err) || attempt === retryOptions.maxRetries) throw err; - } - } - throw lastError instanceof Error ? lastError : /* @__PURE__ */ new Error("Range download failed after retries"); -} -var RangeValidationError = class extends Error { - retryable = false; - constructor(message) { - super(message); - this.name = "RangeValidationError"; - } -}; -function validateRangeResponse(response, start, end, totalSize, byteLength) { - const expectedLength = end - start + 1; - if (response.status !== 206) throw new RangeValidationError(`Expected HTTP 206 Partial Content for range ${start}-${end}, got ${response.status}`); - const contentRange = response.headers.get("Content-Range"); - if (contentRange === null) throw new RangeValidationError(`Missing Content-Range for range ${start}-${end}`); - const match = contentRange.match(/^bytes (\d+)-(\d+)\/(\d+|\*)$/); - if (match === null) throw new RangeValidationError(`Invalid Content-Range for range ${start}-${end}: ${contentRange}`); - const actualStart = Number.parseInt(match[1] ?? "", 10); - const actualEnd = Number.parseInt(match[2] ?? "", 10); - const actualTotal = match[3] ?? ""; - if (actualStart !== start || actualEnd !== end) throw new RangeValidationError(`Content-Range ${contentRange} does not match requested range ${start}-${end}`); - if (actualTotal === "*") throw new RangeValidationError(`Content-Range ${contentRange} does not include total size`); - if (Number.parseInt(actualTotal, 10) !== totalSize) throw new RangeValidationError(`Content-Range ${contentRange} does not match expected total size ${totalSize}`); - if (byteLength !== expectedLength) throw new RangeValidationError(`Expected ${expectedLength} bytes for range ${start}-${end}, got ${byteLength}`); -} -async function classifyDownloadResponseError(response) { - let errorBody = { - status: response.status, - code: "internal_error", - message: `HTTP ${response.status}` - }; - if (response.body !== null) { - const bytes = await collect_collectStream(response.body); - try { - const parsed = JSON.parse(utf8Decoder.decode(bytes)); - errorBody = { - status: response.status, - code: parsed.code ?? "internal_error", - message: parsed.message ?? `HTTP ${response.status}` - }; - } catch {} - } - const retryAfterHeader = response.headers.get("Retry-After"); - const retryAfter = retryAfterHeader !== null ? Number.parseInt(retryAfterHeader, 10) : void 0; - const requestId = response.headers.get("X-Bz-Request-Id") ?? void 0; - return classifyError(errorBody, { - ...retryAfter !== void 0 ? { retryAfter } : {}, - ...requestId !== void 0 ? { requestId } : {} - }); -} -function isRetryableRangeError(err) { - if (err instanceof B2Error || err instanceof NetworkError) return err.retryable; - if (hasRetryableFlag(err)) return err.retryable; - return err instanceof TypeError; -} -function hasRetryableFlag(err) { - return typeof err === "object" && err !== null && "retryable" in err && typeof err.retryable === "boolean"; -} -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/object.js -//# sourceMappingURL=parallel.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/stream.js +class B2Object { + /** The file name (path) within the bucket. */ + fileName; + client; + bucket; + /** + * @param client - The parent B2Client instance. + * @param bucket - The parent Bucket this object belongs to. + * @param fileName - The file path within the bucket. + * + * @internal + */ + constructor(client, bucket, fileName) { + this.client = client; + this.bucket = bucket; + this.fileName = fileName; + } + /** + * Uploads data to this file name. Automatically uses multipart upload for large files. + * @param options - Upload configuration including data source and optional settings. + * + * @returns Metadata for the uploaded file version. + */ + async upload(options) { + const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize(); + const isLarge = options.source.size > recommendedPartSize; + if (isLarge) { + return uploadLargeFile(this.client.raw, this.client.accountInfo, { + bucketId: this.bucket.id, + fileName: this.fileName, + ...options + }); + } + const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options; + return uploadSmallFile(this.client.raw, this.client.accountInfo, { + bucketId: this.bucket.id, + fileName: this.fileName, + ...smallOptions + }); + } + /** + * Downloads this file by name. Pass `method: 'HEAD'` to fetch only the + * response headers (file metadata) without streaming the body. + * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal. + * + * @returns The download result with response headers and body stream. + */ + async download(options) { + return downloadByName(this.client.raw, this.client.accountInfo, { + bucketName: this.bucket.name, + fileName: this.fileName, + ...options + }); + } + /** + * Fetches response headers for this file via HTTP HEAD. Returns a + * body-less result so callers never have to drain the (logically + * empty) HEAD body themselves. + * + * @param options - Optional range, SSE-C decryption, response-header + * overrides, and abort signal. Same shape as {@link B2Object.download}'s + * options minus `method` (always HEAD) and `onProgress` (no body). + * + * @returns Parsed download headers (content type, SHA-1, file info, etc.). + */ + async head(options) { + return headByName(this.client.raw, this.client.accountInfo, { + bucketName: this.bucket.name, + fileName: this.fileName, + ...options + }); + } + /** + * Downloads a specific version of this file by ID. Pass `method: 'HEAD'` + * to fetch only the response headers (file metadata) without streaming the body. + * @param fileId - The file version ID to download. + * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal. + * + * @returns The download result with response headers and body stream. + */ + async downloadById(fileId, options) { + return downloadById(this.client.raw, this.client.accountInfo, { + fileId, + ...options + }); + } + /** + * Fetches response headers for a specific version of this file by ID + * via HTTP HEAD. Returns a body-less result so callers never have to + * drain the (logically empty) HEAD body themselves. + * + * @param fileId - The file version ID to inspect. + * @param options - Optional range, SSE-C decryption, response-header + * overrides, and abort signal. + * + * @returns Parsed download headers. + */ + async headById(fileId, options) { + return headById(this.client.raw, this.client.accountInfo, { + fileId, + ...options + }); + } + /** + * Creates a parallel-download ReadableStream that fetches the file in concurrent ranged chunks. + * @param fileId - The file version ID to download. + * @param totalSize - Total file size in bytes (needed to compute range boundaries). + * @param options - Concurrency, range size, and abort signal. + * + * @returns A Web ReadableStream of file data in sequential order. + */ + createReadStream(fileId, totalSize, options) { + return createParallelDownloadStream(this.client.raw, this.client.accountInfo, { + fileId, + totalSize, + ...options + }); + } + /** + * Creates a Web `WritableStream` that uploads streamed data into this file + * using the multipart protocol. Pipe a `ReadableStream` into the + * returned `writable` and await `done` to get the final {@link FileVersion}. + * + * Note: streaming uploads do not support resume because the size and per-part + * hashes are not known in advance. Use {@link upload} with a buffered source + * when resume is required. + * + * @param options - Streaming upload parameters (part size, concurrency, encryption). + * + * @returns A handle with the writable sink and a completion promise. + */ + createWriteStream(options) { + return createWriteStream(this.client.raw, this.client.accountInfo, { + bucketId: this.bucket.id, + fileName: this.fileName, + ...options ?? {} + }); + } + /** + * Retrieves metadata for a specific file version. + * @param fileId - The file version ID to look up. + * + * @returns The file version metadata. + */ + async getFileInfo(fileId) { + return this.client.raw.getFileInfo( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { fileId } + ); + } + /** + * Hides this file by creating a hide marker at this file name. + * + * @returns Metadata for the newly created hide marker. + */ + async hide() { + return this.bucket.hideFile(this.fileName); + } + /** + * Permanently deletes a specific version of this file. + * @param fileId - The unique identifier of the file version to delete. + */ + async deleteVersion(fileId) { + await this.bucket.deleteFileVersion(this.fileName, fileId); + } + /** + * Sets or updates the Object Lock retention policy on a specific file + * version of this file. + * + * The bucket must have Object Lock enabled (`fileLockEnabled: true` at + * creation time). Governance-mode retention can be shortened or removed + * by passing `bypassGovernance: true` together with an application key + * that carries the `bypassGovernance` capability; compliance-mode + * retention cannot be shortened by anyone until the + * `retainUntilTimestamp` elapses. + * + * @param fileId - The file version to apply the policy to. + * @param retention - The retention policy to apply. + * @param options - Optional flag for shortening governance-mode retention. + * + * @returns Metadata for the updated file version. + */ + async setRetention(fileId, retention, options) { + return this.bucket.updateFileRetention(this.fileName, fileId, retention, options); + } + /** + * Toggles the legal hold flag on a specific file version of this file. + * + * Legal hold is independent of retention: a file can be on legal hold + * without any retention policy, and vice versa. The bucket must have + * Object Lock enabled, and any caller must hold the `writeFileLegalHolds` + * capability. + * + * @param fileId - The file version to apply the flag to. + * @param legalHold - `'on'` to apply the hold, `'off'` to remove it. + * + * @returns Metadata for the updated file version. + */ + async setLegalHold(fileId, legalHold) { + return this.bucket.updateFileLegalHold(this.fileName, fileId, legalHold); + } +} +//# sourceMappingURL=object.js.map +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/paginator.js +async function* paginatePages(fetcher, signal) { + let cursor; + while (true) { + signal?.throwIfAborted(); + const { page, nextCursor } = await fetcher(cursor); + yield page; + if (nextCursor === void 0) return; + cursor = nextCursor; + } +} +async function* paginateItems(fetcher, extractItems, signal) { + for await (const page of paginatePages(fetcher, signal)) { + yield* extractItems(page); + } +} +//# sourceMappingURL=paginator.js.map +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/bucket.js -//#region src/upload/stream.ts -/** -* Creates a {@link WritableStream} that streams data into a B2 multipart upload. -* -* Buffers incoming chunks until `partSize` bytes are accumulated, ships each -* complete part through the standard multipart engine, and finalizes the file -* once the stream is closed. Honours backpressure via the queue's bounded -* concurrency. Streaming uploads do not support resume because the total size -* and per-part hashes aren't known in advance; use {@link uploadLargeFile} with -* a buffered source when resume is required. -* -* @param raw - Low-level B2 API client. -* @param accountInfo - Authorized account state (tokens, URLs, part URL pool). -* @param options - Streaming upload parameters. -* -* @returns A {@link UploadWriteHandle} with the writable sink and a completion promise. -*/ -function createWriteStream(raw, accountInfo, options) { - const minPartSize = accountInfo.getAbsoluteMinimumPartSize(); - const recommendedPartSize = accountInfo.getRecommendedPartSize(); - const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize); - const concurrency = options.concurrency ?? 4; - const tracker = new ProgressTracker(options.onProgress, null, null); - const sem = new Semaphore(concurrency); - const abortScope = createAbortScope(options.signal); - let largeFileId = null; - let startPromise = null; - let cancelAfterStartScheduled = false; - let nextPartNumber = 1; - let pendingBytes = 0; - const pending = []; - const partSha1s = []; - const inflight = []; - let errored = null; - const { promise: done, resolve: resolveDone, reject: rejectDone } = Promise.withResolvers(); - done.catch(() => {}); - function ensureStarted() { - if (largeFileId !== null) return Promise.resolve(largeFileId); - if (startPromise === null) startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { - bucketId: options.bucketId, - fileName: options.fileName, - contentType: options.contentType ?? "b2/x-auto", - fileInfo: options.fileInfo ?? {}, - ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {} - }, { - signal: abortScope.signal, - ...options.retry !== void 0 ? { retry: options.retry } : {} - }).then((resp) => { - largeFileId = resp.fileId; - if (abortScope.signal.aborted || errored !== null) cancelStartedLargeFile(largeFileId); - return largeFileId; - }); - const started = startPromise; - return raceWithAbort(started, abortScope.signal).catch((err) => { - if (abortScope.signal.aborted) scheduleCancelLargeFileAfterStart(started); - throw err; - }); - } - async function shipPart(data, partNumber) { - if (errored !== null) throw errored; - abortScope.signal.throwIfAborted(); - const fileId = await ensureStarted(); - if (errored !== null) throw errored; - abortScope.signal.throwIfAborted(); - const sha1 = new IncrementalSha1(); - await sha1.update(data); - const sha1Hex = await sha1.digest(); - abortScope.signal.throwIfAborted(); - const result = await uploadPartWithFreshUrl(raw, accountInfo, fileId, { - fileName: options.fileName, - partNumber, - data, - contentLength: data.byteLength, - contentSha1: sha1Hex, - retry: options.retry, - signal: abortScope.signal, - onUploadRetry: options.onUploadRetry, - retryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures), - ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {} - }); - partSha1s[partNumber - 1] = result.contentSha1; - tracker.addBytes(data.byteLength); - tracker.completePart(); - } - function markErrored(err) { - const error = toError(err); - errored = error; - abortScope.abort(error); - return error; - } - function cancelStartedLargeFile(fileId) { - if (cancelAfterStartScheduled) return; - cancelAfterStartScheduled = true; - cancelLargeFileBestEffort(raw, accountInfo, fileId, cleanupWriteStreamOptions(options)); - } - function scheduleCancelLargeFileAfterStart(started) { - started.then((fileId) => cancelStartedLargeFile(fileId)).catch(() => {}); - } - async function settleInflightForClose() { - const settled = Promise.allSettled(inflight); - if (startPromise === null || largeFileId !== null) return await settled; - const abortWaiter = waitForAbort(abortScope.signal); - try { - if (await Promise.race([ - settled.then(() => "settled"), - startPromise.then(() => "start-settled", () => "start-settled"), - abortWaiter.promise.then(() => "aborted") - ]) === "aborted" && largeFileId === null) throw abortReason(abortScope.signal); - return await settled; - } finally { - abortWaiter.dispose(); - } - } - function startPartWithAcquiredSlot(data, partNumber) { - const task = (async () => { - try { - await shipPart(data, partNumber); - } catch (err) { - markErrored(err); - throw err; - } finally { - sem.release(); - } - })(); - inflight.push(task); - task.catch(() => {}); - } - async function acquirePartSlot() { - await sem.acquire(); - if (errored !== null) { - sem.release(); - throw errored; - } - try { - abortScope.signal.throwIfAborted(); - } catch (err) { - sem.release(); - throw err; - } - } - async function waitForInflightPartsToSettle(timeoutMs = DEFAULT_CLEANUP_TIMEOUT_MS) { - if (inflight.length === 0) return; - let timeout; - try { - await Promise.race([Promise.allSettled(inflight).then(() => void 0), new Promise((resolve) => { - timeout = setTimeout(resolve, timeoutMs); - })]); - } finally { - if (timeout !== void 0) clearTimeout(timeout); - } - } - async function dispatchPart() { - if (pending.length === 0) return; - await acquirePartSlot(); - let data; - if (pending.length === 1) { - const head = pending[0]; - if (!head) { - sem.release(); - return; - } - data = head; - } else { - const total = pending.reduce((sum, chunk) => sum + chunk.byteLength, 0); - data = new Uint8Array(total); - let offset = 0; - for (const chunk of pending) { - data.set(chunk, offset); - offset += chunk.byteLength; - } - } - pending.length = 0; - pendingBytes = 0; - const partNumber = nextPartNumber++; - startPartWithAcquiredSlot(data, partNumber); - } - return { - writable: new WritableStream({ - async write(chunk) { - if (errored) throw errored; - abortScope.signal.throwIfAborted(); - if (chunk.byteLength === 0) return; - pending.push(chunk); - pendingBytes += chunk.byteLength; - while (pendingBytes >= partSize) { - await acquirePartSlot(); - if (errored) { - sem.release(); - throw errored; - } - const carved = carveExact(pending, partSize); - const partNumber = nextPartNumber++; - pendingBytes -= partSize; - startPartWithAcquiredSlot(carved, partNumber); - } - }, - async close() { - try { - if (errored) throw errored; - abortScope.signal.throwIfAborted(); - if (pendingBytes > 0) await dispatchPart(); - const rejected = (await settleInflightForClose()).find((result) => result.status === "rejected"); - if (rejected !== void 0 && errored === null) markErrored(rejected.reason); - if (errored) throw errored; - if (largeFileId === null) throw new Error("createWriteStream closed without any data written."); - const result = await finishLargeFileWithAbortReconciliation(raw, accountInfo, { - fileId: largeFileId, - bucketId: options.bucketId, - fileName: options.fileName, - partSha1s, - signal: abortScope.signal, - ...options.retry !== void 0 ? { retry: options.retry } : {} - }); - abortScope.dispose(); - resolveDone(result); - } catch (err) { - const closeError = toError(err); - if (errored === null) errored = closeError; - abortScope.abort(errored); - const observedError = errored; - const fileIdToCancel = largeFileId; - if (fileIdToCancel === null && startPromise !== null) { - scheduleCancelLargeFileAfterStart(startPromise); - abortScope.dispose(); - rejectDone(observedError); - throw observedError; - } - await Promise.allSettled(inflight); - let finalError = observedError; - if (fileIdToCancel !== null) finalError = await resolveLargeFileErrorAfterCleanup(observedError, raw, accountInfo, { - fileId: fileIdToCancel, - bucketId: options.bucketId, - fileName: options.fileName, - signal: options.signal, - onCleanupFailure: options.onCleanupFailure - }); - abortScope.dispose(); - rejectDone(finalError); - throw finalError; - } - }, - async abort(reason) { - const abortError = markErrored(reason); - pending.length = 0; - pendingBytes = 0; - const fileIdToCancel = largeFileId; - if (fileIdToCancel === null && startPromise !== null) scheduleCancelLargeFileAfterStart(startPromise); - if (fileIdToCancel !== null) { - await waitForInflightPartsToSettle(); - await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel, cleanupWriteStreamOptions(options)); - } - abortScope.dispose(); - rejectDone(abortError); - } - }), - done - }; -} -function cleanupWriteStreamOptions(options) { - return { - ...options.signal !== void 0 ? { signal: options.signal } : {}, - ...options.onCleanupFailure !== void 0 ? { onCleanupFailure: options.onCleanupFailure } : {} - }; -} -/** -* Removes exactly `size` bytes from the front of `chunks` (mutates) and returns -* them as a contiguous Uint8Array. Any trailing remainder of the last chunk -* stays at the front of `chunks` for the next part. -* -* @param chunks - Queue of pending chunks. Modified in place. -* @param size - Number of bytes to carve off the front. -* -* @returns A new Uint8Array containing exactly `size` bytes. -*/ -function carveExact(chunks, size) { - const out = new Uint8Array(size); - let written = 0; - while (written < size && chunks.length > 0) { - const head = chunks[0]; - if (!head) break; - const need = size - written; - if (head.byteLength <= need) { - out.set(head, written); - written += head.byteLength; - chunks.shift(); - } else { - out.set(head.subarray(0, need), written); - chunks[0] = head.subarray(need); - written += need; - } - } - return out; -} -function waitForAbort(signal) { - if (signal.aborted) return { - promise: Promise.resolve(abortReason(signal)), - dispose() {} - }; - let onAbort; - return { - promise: new Promise((resolve) => { - onAbort = () => resolve(abortReason(signal)); - signal.addEventListener("abort", onAbort, { once: true }); - }), - dispose() { - if (onAbort !== void 0) signal.removeEventListener("abort", onAbort); - } - }; -} -//#endregion -//# sourceMappingURL=stream.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/object.js - - - - - - - -//#region src/object.ts -function bucketDefaultRetentionSnapshot(info) { - const fileLock = info.fileLockConfiguration; - if (!fileLock.isClientAuthorizedToRead) return { unreadable: true }; - if (fileLock.value === null) return { unreadable: false }; - return { - retention: fileLock.value.defaultRetention, - unreadable: false - }; -} -function resumeNeedsFreshBucketDefaults(options) { - return (options.resume === true || options.resumeFileId !== void 0) && (options.serverSideEncryption === void 0 || options.fileRetention === void 0); -} -/** -* Handle to a specific file (by name) within a B2 bucket. -* -* Provides file-scoped upload, download, and management operations. -* Obtained via {@link Bucket.file}. -* -* @example -* ```ts -* const obj = bucket.file('photos/2026/sunset.jpg') -* await obj.upload({ source: new BufferSource(data) }) -* const result = await obj.download() -* ``` -*/ -var B2Object = class { - /** The file name (path) within the bucket. */ - fileName; - client; - bucket; - uploadRetryOptions; - /** - * @param client - The parent B2Client instance. - * @param bucket - The parent Bucket this object belongs to. - * @param fileName - The file path within the bucket. - * @param uploadRetryOptions - Resolved client upload retry defaults. - * - * @internal - */ - constructor(client, bucket, fileName, uploadRetryOptions) { - this.client = client; - this.bucket = bucket; - this.fileName = fileName; - this.uploadRetryOptions = uploadRetryOptions; - } - /** - * Uploads data to this file name. Automatically uses multipart upload for large files. - * @param options - Upload configuration including data source and optional settings. - * - * @returns Metadata for the uploaded file version. - */ - async upload(options) { - const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize(); - const isLarge = options.source.size > recommendedPartSize; - const uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options.retry); - if (isLarge) { - const bucketInfo = resumeNeedsFreshBucketDefaults(options) ? await this.fetchFreshBucketInfo() : this.bucket.info; - const bucketDefaultRetention = bucketDefaultRetentionSnapshot(bucketInfo); - return uploadLargeFile(this.client.raw, this.client.accountInfo, { - ...options, - bucketId: this.bucket.id, - fileName: this.fileName, - retry: uploadRetryOptions, - bucketDefaultServerSideEncryption: bucketInfo.defaultServerSideEncryption, - ...bucketDefaultRetention.retention !== void 0 ? { bucketDefaultRetention: bucketDefaultRetention.retention } : {}, - ...bucketDefaultRetention.unreadable ? { bucketDefaultRetentionUnreadable: true } : {} - }); - } - rejectSmallResumeFileId(options, "B2Object.upload"); - const smallOptions = stripResumeOnlyOptions(options); - return uploadSmallFile(this.client.raw, this.client.accountInfo, { - ...smallOptions, - bucketId: this.bucket.id, - fileName: this.fileName, - retry: uploadRetryOptions - }); - } - async fetchFreshBucketInfo() { - const found = (await this.client.listBuckets({ bucketId: this.bucket.id }))[0]; - if (!found) throw new Error(`Bucket ${this.bucket.id} not found`); - return found.info; - } - /** - * Downloads this file by name. Pass `method: 'HEAD'` to fetch only the - * response headers (file metadata) without streaming the body. - * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal. - * - * @returns The download result with response headers and body stream. - */ - async download(options) { - return downloadByName(this.client.raw, this.client.accountInfo, { - bucketName: this.bucket.name, - fileName: this.fileName, - ...options - }); - } - /** - * Fetches response headers for this file via HTTP HEAD. Returns a - * body-less result so callers never have to drain the (logically - * empty) HEAD body themselves. - * - * @param options - Optional range, SSE-C decryption, response-header - * overrides, and abort signal. Same shape as {@link B2Object.download}'s - * options minus `method` (always HEAD) and `onProgress` (no body). - * - * @returns Parsed download headers (content type, SHA-1, file info, etc.). - */ - async head(options) { - return headByName(this.client.raw, this.client.accountInfo, { - bucketName: this.bucket.name, - fileName: this.fileName, - ...options - }); - } - /** - * Downloads a specific version of this file by ID. Pass `method: 'HEAD'` - * to fetch only the response headers (file metadata) without streaming the body. - * @param fileId - The file version ID to download. - * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal. - * - * @returns The download result with response headers and body stream. - */ - async downloadById(fileId, options) { - return downloadById(this.client.raw, this.client.accountInfo, { - fileId, - ...options - }); - } - /** - * Fetches response headers for a specific version of this file by ID - * via HTTP HEAD. Returns a body-less result so callers never have to - * drain the (logically empty) HEAD body themselves. - * - * @param fileId - The file version ID to inspect. - * @param options - Optional range, SSE-C decryption, response-header - * overrides, and abort signal. - * - * @returns Parsed download headers. - */ - async headById(fileId, options) { - return headById(this.client.raw, this.client.accountInfo, { - fileId, - ...options - }); - } - /** - * Creates a parallel-download ReadableStream that fetches the file in concurrent ranged chunks. - * @param fileId - The file version ID to download. - * @param totalSize - Total file size in bytes (needed to compute range boundaries). - * @param options - Concurrency, range size, and abort signal. - * - * @returns A Web ReadableStream of file data in sequential order. - */ - createReadStream(fileId, totalSize, options) { - return createParallelDownloadStream(this.client.raw, this.client.accountInfo, { - fileId, - totalSize, - ...options - }); - } - /** - * Creates a Web `WritableStream` that uploads streamed data into this file - * using the multipart protocol. Pipe a `ReadableStream` into the - * returned `writable` and await `done` to get the final {@link FileVersion}. - * - * Note: streaming uploads do not support resume because the size and per-part - * hashes are not known in advance. Use {@link upload} with a buffered source - * when resume is required. - * - * @param options - Streaming upload parameters (part size, concurrency, encryption). - * - * @returns A handle with the writable sink and a completion promise. - */ - createWriteStream(options) { - const uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options?.retry); - return createWriteStream(this.client.raw, this.client.accountInfo, { - ...options ?? {}, - bucketId: this.bucket.id, - fileName: this.fileName, - retry: uploadRetryOptions - }); - } - /** - * Retrieves metadata for a specific file version. - * @param fileId - The file version ID to look up. - * - * @returns The file version metadata. - */ - async getFileInfo(fileId) { - return this.client.raw.getFileInfo(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { fileId }); - } - /** - * Hides this file by creating a hide marker at this file name. - * - * @returns Metadata for the newly created hide marker. - */ - async hide() { - return this.bucket.hideFile(this.fileName); - } - /** - * Permanently deletes a specific version of this file. - * @param fileId - The unique identifier of the file version to delete. - */ - async deleteVersion(fileId) { - await this.bucket.deleteFileVersion(this.fileName, fileId); - } - /** - * Sets or updates the Object Lock retention policy on a specific file - * version of this file. - * - * The bucket must have Object Lock enabled (`fileLockEnabled: true` at - * creation time). Governance-mode retention can be shortened or removed - * by passing `bypassGovernance: true` together with an application key - * that carries the `bypassGovernance` capability; compliance-mode - * retention cannot be shortened by anyone until the - * `retainUntilTimestamp` elapses. - * - * @param fileId - The file version to apply the policy to. - * @param retention - The retention policy to apply. - * @param options - Optional flag for shortening governance-mode retention. - * - * @returns Metadata for the updated file version. - */ - async setRetention(fileId, retention, options) { - return this.bucket.updateFileRetention(this.fileName, fileId, retention, options); - } - /** - * Toggles the legal hold flag on a specific file version of this file. - * - * Legal hold is independent of retention: a file can be on legal hold - * without any retention policy, and vice versa. The bucket must have - * Object Lock enabled, and any caller must hold the `writeFileLegalHolds` - * capability. - * - * @param fileId - The file version to apply the flag to. - * @param legalHold - `'on'` to apply the hold, `'off'` to remove it. - * - * @returns Metadata for the updated file version. - */ - async setLegalHold(fileId, legalHold) { - return this.bucket.updateFileLegalHold(this.fileName, fileId, legalHold); - } -}; -//#endregion -//# sourceMappingURL=object.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/bucket.js - - - - - - - - - - - - -//#region src/bucket.ts -function bucket_bucketDefaultRetentionSnapshot(info) { - const fileLock = info.fileLockConfiguration; - if (!fileLock.isClientAuthorizedToRead) return { unreadable: true }; - if (fileLock.value === null) return { unreadable: false }; - return { - retention: fileLock.value.defaultRetention, - unreadable: false - }; -} -function bucket_resumeNeedsFreshBucketDefaults(options) { - return (options.resume === true || options.resumeFileId !== void 0) && (options.serverSideEncryption === void 0 || options.fileRetention === void 0); -} -/** -* Handle to a B2 bucket providing upload, download, listing, and management operations. -* -* Obtained via {@link B2Client.createBucket}, {@link B2Client.listBuckets}, or {@link B2Client.getBucket}. -* -* @example -* ```ts -* const bucket = await client.getBucket('my-bucket') -* await bucket.upload({ fileName: 'hello.txt', source: new BufferSource(data) }) -* ``` -*/ -var Bucket = class { - /** Unique identifier for this bucket. */ - id; - /** Human-readable bucket name. */ - name; - /** Full bucket metadata as returned by the B2 API. */ - info; - client; - uploadRetryOptions; - /** - * @param client - The parent B2Client instance. - * @param info - The bucket metadata from the API. - * @param uploadRetryOptions - Resolved client upload retry defaults. - * - * @internal - */ - constructor(client, info, uploadRetryOptions) { - this.client = client; - this.info = info; - this.id = info.bucketId; - this.name = info.bucketName; - this.uploadRetryOptions = uploadRetryOptions; - } - /** - * Returns a {@link B2Object} handle for a specific file name in this bucket. - * @param fileName - The file path within the bucket. - * - * @returns A B2Object handle bound to this bucket and file name. - */ - file(fileName) { - return new B2Object(this.client, this, fileName, this.uploadRetryOptions); - } - /** - * Uploads a file to this bucket. Automatically uses multipart upload for files - * larger than the recommended part size. - * @param options - Upload configuration including file name, source data, and optional settings. - * - * @returns Metadata for the uploaded file version. - */ - async upload(options) { - const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize(); - const isLarge = options.source.size > recommendedPartSize; - const uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options.retry); - if (isLarge) { - const bucketInfo = bucket_resumeNeedsFreshBucketDefaults(options) ? await this.refresh() : this.info; - const bucketDefaultRetention = bucket_bucketDefaultRetentionSnapshot(bucketInfo); - return uploadLargeFile(this.client.raw, this.client.accountInfo, { - ...options, - bucketId: this.id, - retry: uploadRetryOptions, - bucketDefaultServerSideEncryption: bucketInfo.defaultServerSideEncryption, - ...bucketDefaultRetention.retention !== void 0 ? { bucketDefaultRetention: bucketDefaultRetention.retention } : {}, - ...bucketDefaultRetention.unreadable ? { bucketDefaultRetentionUnreadable: true } : {} - }); - } - rejectSmallResumeFileId(options, "Bucket.upload"); - const smallOptions = stripResumeOnlyOptions(options); - return uploadSmallFile(this.client.raw, this.client.accountInfo, { - ...smallOptions, - bucketId: this.id, - retry: uploadRetryOptions - }); - } - /** - * Downloads a file from this bucket by name. Pass `method: 'HEAD'` in - * `options` to fetch only the response headers (file metadata) without - * streaming the body. - * @param fileName - The file name (path) to download. - * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal. - * - * @returns The download result containing response headers and a readable body stream. - */ - async download(fileName, options) { - return downloadByName(this.client.raw, this.client.accountInfo, { - bucketName: this.name, - fileName, - ...options - }); - } - /** - * Fetches the response headers (file metadata) for a file via HTTP - * HEAD. Returns a body-less result so callers never have to drain - * the (logically empty) HEAD body themselves. - * - * Use this for metadata-only checks like "does this file exist", "what - * is its current SHA-1", "what is its Content-Length". For full file - * retrieval use {@link Bucket.download}. - * - * @param fileName - The file name (path) to inspect. - * @param options - Optional range, SSE-C decryption, response-header - * overrides, and abort signal. Same shape as {@link Bucket.download}'s - * options minus `method` (always HEAD) and `onProgress` (no body). - * - * @returns Parsed download headers (content type, SHA-1, file info, etc.). - * - * @example - * ```ts - * const { headers } = await bucket.head('photos/2026/sunset.jpg') - * console.log(headers.contentLength, headers.contentSha1) - * ``` - */ - async head(fileName, options) { - return headByName(this.client.raw, this.client.accountInfo, { - bucketName: this.name, - fileName, - ...options - }); - } - /** - * Lists file names in this bucket (most recent versions only). - * @param options - Optional filtering and pagination settings. - * - * @returns A page of file versions with an optional continuation token. - */ - async listFileNames(options) { - return this.client.raw.listFileNames(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - bucketId: this.id, - ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {}, - ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}, - ...options?.prefix !== void 0 ? { prefix: options.prefix } : {}, - ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {} - }, { ...options?.signal !== void 0 ? { signal: options.signal } : {} }); - } - /** - * Lists all file versions in this bucket, including hidden files. - * @param options - Optional filtering and pagination settings. - * - * @returns A page of file versions with an optional continuation token. - */ - async listFileVersions(options) { - return this.client.raw.listFileVersions(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - bucketId: this.id, - ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {}, - ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {}, - ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}, - ...options?.prefix !== void 0 ? { prefix: options.prefix } : {}, - ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {} - }, { ...options?.signal !== void 0 ? { signal: options.signal } : {} }); - } - /** - * Async iterator that yields the latest visible version of every file in - * the bucket, automatically handling pagination via `listFileNames`. - * - * Hidden files (those whose latest version is a hide marker) are NOT - * yielded by this iterator. Use {@link paginateFileVersions} when you - * need full version history. - * - * @param options - Filter + pagination + abort options. `pageSize` is - * forwarded to `b2_list_file_names`'s `maxFileCount` (default 1000, - * B2-capped at 10000). - * - * @returns An async iterable of {@link FileVersion} entries. - * - * @example - * ```ts - * for await (const file of bucket.paginateFileNames({ prefix: 'photos/' })) { - * console.log(file.fileName, file.contentLength) - * } - * ``` - */ - paginateFileNames(options) { - return paginateItems(async (cursor) => { - const resp = await this.listFileNames({ - pageSize: options?.pageSize ?? 1e3, - ...cursor !== void 0 ? { startFileName: cursor } : {}, - ...options?.prefix !== void 0 ? { prefix: options.prefix } : {}, - ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}, - ...options?.signal !== void 0 ? { signal: options.signal } : {} - }); - return { - page: resp, - nextCursor: resp.nextFileName ?? void 0 - }; - }, (page) => page.files.filter((f) => f.action !== "hide"), options?.signal); - } - /** - * Async iterator that yields every version of every file in the bucket, - * including hidden files and historical versions, automatically handling - * pagination via `listFileVersions`. - * - * The two-cursor `(nextFileName, nextFileId)` continuation that the raw - * endpoint exposes is threaded internally; callers iterate flat. - * - * @param options - Filter + pagination + abort options. - * - * @returns An async iterable of {@link FileVersion} entries. - */ - paginateFileVersions(options) { - return paginateItems(async (cursor) => { - const resp = await this.listFileVersions({ - pageSize: options?.pageSize ?? 1e3, - ...cursor !== void 0 ? { startFileName: cursor.fileName } : {}, - ...cursor?.fileId !== void 0 ? { startFileId: cursor.fileId } : {}, - ...options?.prefix !== void 0 ? { prefix: options.prefix } : {}, - ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}, - ...options?.signal !== void 0 ? { signal: options.signal } : {} - }); - return { - page: resp, - nextCursor: resp.nextFileName !== null ? { - fileName: resp.nextFileName, - fileId: resp.nextFileId ?? void 0 - } : void 0 - }; - }, (page) => page.files, options?.signal); - } - /** - * Async iterator that yields every unfinished large file in the bucket, - * automatically handling pagination via `listUnfinishedLargeFiles`. - * - * Useful for janitorial scripts that want to inspect or cancel abandoned - * multipart uploads (typically followed by {@link cancelLargeFile} on - * the underlying raw client). - * - * @param options - Filter + pagination + abort options. `pageSize` is - * B2-capped at 100 for this endpoint. - * - * @returns An async iterable of unfinished-large-file metadata entries. - */ - paginateUnfinishedLargeFiles(options) { - return paginateItems(async (cursor) => { - const resp = await this.listUnfinishedLargeFiles({ - pageSize: options?.pageSize ?? 100, - ...cursor !== void 0 ? { startFileId: cursor } : {}, - ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {}, - ...options?.signal !== void 0 ? { signal: options.signal } : {} - }); - return { - page: resp, - nextCursor: resp.nextFileId ?? void 0 - }; - }, (page) => page.files, options?.signal); - } - /** - * Async iterator that yields every uploaded part for a specific large - * file, automatically handling pagination via `listParts`. - * - * @param largeFileId - The unfinished large file to enumerate parts of. - * @param options - Pagination + abort options. `pageSize` is B2-capped - * at 1000 for this endpoint; the default is 1000. - * - * @returns An async iterable of {@link PartInfo} entries. - */ - paginateParts(largeFileId, options) { - return paginateItems(async (cursor) => { - const resp = await this.client.raw.listParts(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - fileId: largeFileId, - maxPartCount: options?.pageSize ?? 1e3, - ...cursor !== void 0 ? { startPartNumber: cursor } : {} - }, options?.signal !== void 0 ? { signal: options.signal } : void 0); - return { - page: resp, - nextCursor: resp.nextPartNumber ?? void 0 - }; - }, (page) => page.parts, options?.signal); - } - /** - * Looks up the latest visible version of a file by name. - * Uses `listFileNames` under the hood; returns `null` when the file does not - * exist or its latest version is a hide marker. - * @param fileName - The exact file path to look up. - * - * @returns The latest {@link FileVersion}, or `null` if not found. - */ - async getFileInfoByName(fileName) { - const match = (await this.listFileNames({ - prefix: fileName, - pageSize: 1 - })).files.find((f) => f.fileName === fileName); - if (!match || match.action === "hide") return null; - return match; - } - /** - * Removes the latest hide marker for a file, restoring visibility of the - * previous upload. Returns the deleted hide marker, or `null` if there was - * no hide marker to remove (file is already visible or does not exist). - * @param fileName - The file path to unhide. - * - * @returns The deleted hide marker version, or `null` if nothing was hidden. - */ - async unhideFile(fileName) { - const versions = (await this.listFileVersions({ - prefix: fileName, - pageSize: 100 - })).files.filter((f) => f.fileName === fileName); - if (versions.length === 0) return null; - const latest = versions[0]; - if (latest?.action !== "hide") return null; - await this.deleteFileVersion(fileName, latest.fileId); - return latest; - } - /** - * Hides a file by creating a hide marker. The file remains in version history but is no longer visible in `listFileNames`. - * @param fileName - The file path to hide. - * @param options - Optional request controls such as an abort signal. - * - * @returns Metadata for the newly created hide marker. - */ - async hideFile(fileName, options) { - return this.client.raw.hideFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - bucketId: this.id, - fileName - }, options); - } - /** - * Permanently deletes a specific file version. Both file name and file ID are required. - * - * If the file is under Object Lock retention, B2 will reject the - * delete: compliance-mode files cannot be deleted until the retention - * expires; governance-mode files require `bypassGovernance: true` - * AND a calling key with the `bypassGovernance` capability. Files on - * legal hold cannot be deleted by anyone until the hold is removed. - * - * @param fileName - The file path of the version to delete. - * @param fileId - The unique identifier of the file version to delete. - * @param options - Optional governance and abort controls. - */ - async deleteFileVersion(fileName, fileId, options) { - await this.client.raw.deleteFileVersion(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - fileName, - fileId, - ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {} - }, options?.signal !== void 0 ? { signal: options.signal } : void 0); - } - /** - * Cancels an in-progress large file upload so the partial parts are not - * retained or billed. The most common reason to call this is to clean up - * abandoned multipart uploads surfaced by {@link listUnfinishedLargeFiles}. - * @param fileId - The unique identifier of the unfinished large file to cancel. - * - * @returns Metadata about the cancelled large file. - */ - async cancelLargeFile(fileId) { - return this.client.raw.cancelLargeFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { fileId }); - } - /** - * Lists large files in this bucket that were started but never finished or - * cancelled. Wraps `b2_list_unfinished_large_files`. - * @param options - Optional pagination filters. - * - * @returns The page of unfinished large files plus a continuation token. - */ - async listUnfinishedLargeFiles(options) { - return this.client.raw.listUnfinishedLargeFiles(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - bucketId: this.id, - ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {}, - ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {}, - ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {} - }, options?.signal !== void 0 ? { signal: options.signal } : void 0); - } - /** - * Deletes many file versions with bounded concurrency. Errors from individual - * deletes are collected and returned rather than thrown, so partial success - * does not abort the run. - * - * When `options.signal` is supplied and aborted, in-flight deletes - * complete (they're already on the wire), but no new deletes start - * after the abort fires. Subsequent targets are short-circuited to an - * error entry so the result tally reflects what actually happened. - * @param targets - File versions to delete. - * @param options - Optional concurrency override and abort signal. - * Concurrency defaults to the SDK-wide bulk-metadata setting - * (currently 10, higher than transfer concurrency because each - * task is a single tiny API round-trip). - * - * @returns A summary of successes and per-target errors. - */ - async deleteMany(targets, options) { - const sem = new Semaphore(options?.concurrency ?? 10); - const signal = options?.signal; - let deleted = 0; - const errors = []; - await Promise.all(targets.map(async (target) => { - await sem.acquire(); - try { - if (signal?.aborted) { - errors.push({ - target, - error: toError(signal.reason ?? "aborted") - }); - return; - } - await this.deleteFileVersion(target.fileName, target.fileId); - deleted++; - } catch (err) { - errors.push({ - target, - error: toError(err) - }); - } finally { - sem.release(); - } - })); - return { - deleted, - errors - }; - } - /** - * Async generator that streams every file version in the bucket (optionally - * filtered by prefix) and deletes each one. Yields a {@link DeleteAllEvent} - * per file version. With `dryRun: true`, no deletes are performed but `skip` - * events are still emitted. - * @param options - Optional prefix filter, page size, and dry-run flag. - * - * @returns An async generator of per-file events. - */ - async *deleteAll(options) { - const dryRun = options?.dryRun ?? false; - const pageSize = options?.pageSize ?? 1e3; - let startFileName; - let startFileId; - while (true) { - const page = await this.listFileVersions({ - pageSize, - ...options?.prefix !== void 0 ? { prefix: options.prefix } : {}, - ...startFileName !== void 0 ? { startFileName } : {}, - ...startFileId !== void 0 ? { startFileId } : {} - }); - for (const version of page.files) { - if (dryRun) { - yield { - type: "skip", - fileName: version.fileName, - fileId: version.fileId - }; - continue; - } - try { - await this.deleteFileVersion(version.fileName, version.fileId); - yield { - type: "delete", - fileName: version.fileName, - fileId: version.fileId - }; - } catch (err) { - yield { - type: "error", - fileName: version.fileName, - fileId: version.fileId, - message: toError(err).message - }; - } - } - if (!page.nextFileName) break; - startFileName = page.nextFileName; - startFileId = page.nextFileId ?? void 0; - } - } - /** - * Creates a server-side copy of a file within or across buckets. - * @param options - Copy configuration including source file ID and destination name. - * - * @returns Metadata for the newly created file version. - */ - async copyFile(options) { - const { serverSideEncryption, destinationServerSideEncryption, signal, ...copyOptions } = options; - const destinationEncryption = destinationServerSideEncryption ?? serverSideEncryption; - return this.client.raw.copyFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - ...copyOptions, - ...destinationEncryption !== void 0 ? { destinationServerSideEncryption: destinationEncryption } : {} - }, signal !== void 0 ? { signal } : void 0); - } - /** - * Copies a file via the server-side multipart protocol. Each part is copied - * by reference through `b2_copy_part`; data never traverses the client. Falls - * back to a single `copyFile` call when the source fits within a single part. - * @param options - Copy parameters including source file ID, destination name, part size, and concurrency. - * - * @returns Metadata for the newly created destination file version. - */ - async copyLargeFile(options) { - return copyLargeFile(this.client.raw, this.client.accountInfo, { - sourceFileId: options.sourceFileId, - fileName: options.fileName, - ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : { destinationBucketId: this.id }, - ...options.contentType !== void 0 ? { contentType: options.contentType } : {}, - ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {}, - ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}, - ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}, - ...options.partSize !== void 0 ? { partSize: options.partSize } : {}, - ...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {}, - ...options.onCleanupFailure !== void 0 ? { onCleanupFailure: options.onCleanupFailure } : {}, - ...options.signal !== void 0 ? { signal: options.signal } : {} - }); - } - /** - * Updates bucket settings such as type, CORS, lifecycle rules, and encryption. - * @param options - Fields to update. Omitted fields are left unchanged. - * - * @returns Updated bucket metadata. - */ - async update(options) { - return this.client.raw.updateBucket(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - accountId: accountId(this.client.accountInfo.getAccountId()), - bucketId: this.id, - ...options - }); - } - /** - * Permanently deletes this bucket. The bucket must be empty (no file versions). - * - * @returns The deleted bucket metadata. - */ - async delete() { - return this.client.deleteBucket(this.id); - } - /** - * Gets a download authorization token scoped to a file name prefix in this bucket. - * @param fileNamePrefix - Only authorize downloads of files starting with this prefix. - * @param validDurationInSeconds - How long the authorization is valid (1-604800 seconds). - * - * @returns The download authorization response containing a time-limited token. - */ - async getDownloadAuthorization(fileNamePrefix, validDurationInSeconds) { - return this.client.raw.getDownloadAuthorization(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - bucketId: this.id, - fileNamePrefix, - validDurationInSeconds - }); - } - /** - * Gets the event notification rules configured for this bucket. - * - * @returns The current notification rules for this bucket. - */ - async getNotificationRules() { - return this.client.raw.getBucketNotificationRules(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { bucketId: this.id }); - } - /** - * Replaces the event notification rules for this bucket. - * @param rules - The new set of notification rules to apply. - * - * @returns The updated notification rules for this bucket. - */ - async setNotificationRules(rules) { - return this.client.raw.setBucketNotificationRules(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - bucketId: this.id, - eventNotificationRules: rules - }); - } - /** - * Updates the file retention policy for a specific file version. Requires file lock on the bucket. - * @param fileName - The file path of the version to update. - * @param fileId - The unique identifier of the file version. - * @param retention - The new retention policy to apply. - * @param options - Optional flags. Set `bypassGovernance: true` to shorten governance-mode retention. - * - * @returns The updated file retention metadata. - */ - async updateFileRetention(fileName, fileId, retention, options) { - return this.client.raw.updateFileRetention(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - fileName, - fileId, - fileRetention: retention, - ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {} - }); - } - /** - * Updates the legal hold status for a specific file version. Requires file lock on the bucket. - * @param fileName - The file path of the version to update. - * @param fileId - The unique identifier of the file version. - * @param legalHold - The new legal hold status to apply. - * - * @returns The updated legal hold metadata. - */ - async updateFileLegalHold(fileName, fileId, legalHold) { - return this.client.raw.updateFileLegalHold(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { - fileName, - fileId, - legalHold - }); - } - /** - * Refetches this bucket's metadata from B2 so callers operating on - * replication / lifecycle / retention configuration always start from the - * server-of-record state. - * - * Bucket configuration is monotonically revisioned by B2: B2 increments - * `revision` on every accepted update. The local {@link info} snapshot - * captured at construction time goes stale as soon as anyone else (or any - * prior `update()` call) mutates the bucket, so the ergonomic - * add/remove helpers below always refresh before composing the next - * `setX()` call. The result is that each helper is safe to call without - * the caller having to thread BucketInfo through their code. - * - * @returns Fresh {@link BucketInfo} for this bucket. - * - * @throws If the bucket no longer exists. - */ - async refresh() { - const found = (await this.client.listBuckets({ bucketId: this.id }))[0]; - if (!found) throw new Error(`Bucket ${this.id} not found`); - return found.info; - } - /** - * Returns the current cross-region replication configuration, refetched - * from B2. - * - * Use this when you need to read replication state without composing a - * write. For add/remove flows the helper methods below handle the - * refresh-then-set sequence for you. - * - * @returns The current {@link ReplicationConfiguration}. - */ - async getReplication() { - return (await this.refresh()).replicationConfiguration; - } - /** - * Replaces this bucket's complete replication configuration. - * @param replication - The new configuration. Pass an empty source/destination - * pair (`{ asReplicationSource: null, asReplicationDestination: null }`) - * to clear replication entirely. - * - * @returns The updated bucket metadata. - */ - async setReplication(replication) { - return this.update({ replicationConfiguration: replication }); - } - /** - * Adds (or replaces by `replicationRuleName`) a single replication rule - * on this bucket while leaving any other rules, the source key, and the - * destination key mapping untouched. - * - * When this is the very first source-side rule, `sourceApplicationKeyId` - * must be supplied to seed `asReplicationSource.sourceApplicationKeyId`; - * for subsequent calls the existing source key is reused unless the - * caller explicitly overrides it. - * - * @param rule - The replication rule to add or replace. - * @param options - Optional source application key ID override (or seed - * when no source side exists yet). - * - * @returns The updated bucket metadata. - * - * @throws If no source-side replication exists yet and the caller did - * not supply `sourceApplicationKeyId`. - */ - async addReplicationRule(rule, options) { - const current = (await this.refresh()).replicationConfiguration; - const existingSource = current.asReplicationSource; - const sourceKey = options?.sourceApplicationKeyId ?? existingSource?.sourceApplicationKeyId; - if (!sourceKey) throw new Error("addReplicationRule: no existing source-side replication; pass options.sourceApplicationKeyId"); - const without = (existingSource?.replicationRules ?? []).filter((r) => r.replicationRuleName !== rule.replicationRuleName); - return this.setReplication({ - asReplicationSource: { - sourceApplicationKeyId: sourceKey, - replicationRules: [...without, rule] - }, - asReplicationDestination: current.asReplicationDestination - }); - } - /** - * Removes a single replication rule by name. No-ops cleanly when the rule - * is not present (returns the unchanged-but-revision-bumped bucket info). - * - * @param replicationRuleName - Name of the rule to remove. - * - * @returns The updated bucket metadata. - */ - async removeReplicationRule(replicationRuleName) { - const current = (await this.refresh()).replicationConfiguration; - const existingSource = current.asReplicationSource; - if (!existingSource) return this.setReplication(current); - const filtered = existingSource.replicationRules.filter((r) => r.replicationRuleName !== replicationRuleName); - return this.setReplication({ - asReplicationSource: { - sourceApplicationKeyId: existingSource.sourceApplicationKeyId, - replicationRules: filtered - }, - asReplicationDestination: current.asReplicationDestination - }); - } - /** - * Returns the current lifecycle rules for this bucket, refetched from B2. - * - * @returns The current array of {@link LifecycleRule}s. - */ - async getLifecycleRules() { - return (await this.refresh()).lifecycleRules; - } - /** - * Replaces this bucket's lifecycle rules in their entirety. - * @param rules - The new rule set. Pass `[]` to remove all lifecycle - * automation. - * - * @returns The updated bucket metadata. - */ - async setLifecycleRules(rules) { - return this.update({ lifecycleRules: [...rules] }); - } - /** - * Adds (or replaces, matched by `fileNamePrefix`) a single lifecycle rule - * while leaving any other rules untouched. - * - * Matching on prefix mirrors B2's own data model: each unique prefix can - * have at most one rule, and a `b2_update_bucket` call that contains two - * rules with the same prefix is rejected. The helper enforces this for - * the caller. - * - * @param rule - The lifecycle rule to add or replace. - * - * @returns The updated bucket metadata. - */ - async addLifecycleRule(rule) { - const without = (await this.getLifecycleRules()).filter((r) => r.fileNamePrefix !== rule.fileNamePrefix); - return this.setLifecycleRules([...without, rule]); - } - /** - * Removes a single lifecycle rule by prefix. No-ops cleanly when the rule - * is not present. - * - * @param fileNamePrefix - The prefix of the rule to remove. - * - * @returns The updated bucket metadata. - */ - async removeLifecycleRule(fileNamePrefix) { - const current = await this.getLifecycleRules(); - return this.setLifecycleRules(current.filter((r) => r.fileNamePrefix !== fileNamePrefix)); - } - /** - * Returns the current default Object Lock retention policy for new - * uploads to this bucket, refetched from B2. - * - * @returns The default {@link BucketRetentionPolicy} (which may be - * `{ mode: 'none', period: null }` when Object Lock is enabled on the - * bucket but no default is set). - */ - async getDefaultRetention() { - return (await this.refresh()).defaultRetention; - } - /** - * Sets (or clears, by passing `{ mode: 'none', period: null }`) the - * default Object Lock retention policy applied to new uploads. - * - * Object Lock must already be enabled on the bucket. Buckets created - * without `fileLockEnabled: true` cannot accept a default retention - * policy and B2 will reject this call. - * - * @param policy - The new default retention policy. - * - * @returns The updated bucket metadata. - */ - async setDefaultRetention(policy) { - return this.update({ defaultRetention: policy }); - } -}; -//#endregion -//# sourceMappingURL=bucket.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/realms.js -//#region src/auth/realms.ts -var VERIFIED_REALM_URLS = { - /** Public production B2 Native API authorize endpoint. */ - production: "https://api.backblazeb2.com", - /** Backblaze staging authorize endpoint from the official Python SDK realm map. */ - staging: "https://api.backblaze.net" -}; -/** -* Built-in realm aliases to their `b2_authorize_account` base API URLs. -* The object remains a mutable `Record` for source -* compatibility with earlier SDK versions that let applications add local -* aliases. SDK internals validate only the built-in aliases in -* `VERIFIED_REALM_URLS`; pass direct custom realm URLs to `B2Client` instead -* of relying on mutation for new code. -*/ -var REALM_URLS = { ...VERIFIED_REALM_URLS }; -var HTTP_REALM_URL_WITH_HOST = /^https?:\/\/[^/?#]/i; -function parseAbsoluteRealmUrl(realmUrl) { - try { - return new URL(realmUrl); - } catch { - return null; - } -} -function realmUrlForError(realmUrl, url = parseAbsoluteRealmUrl(realmUrl)) { - return url_redaction_redactUrlForError(url ?? realmUrl, { invalidUrlLabel: "" }); -} -function isLoopbackHost(hostname) { - const host = hostname.toLowerCase(); - if (host === "[::1]" || host === "::1") return true; - const parts = host.split("."); - return parts.length === 4 && parts[0] === "127" && parts.every((part) => /^\d+$/.test(part) && Number(part) <= 255); -} -function assertAuthorizableRealmScheme(realmUrl, url) { - if ((url.protocol === "https:" || url.protocol === "http:") && (!HTTP_REALM_URL_WITH_HOST.test(realmUrl) || url.hostname === "")) throw new B2RealmConfigurationError(`realm URL must be an absolute HTTP(S) URL with a hostname for authorization: ${realmUrlForError(realmUrl, url)}`); - if (url.protocol === "https:") return; - if (url.protocol === "http:" && isLoopbackHost(url.hostname)) return; - if (url.protocol === "http:") throw new B2RealmConfigurationError(`refusing to send credentials over plaintext HTTP realm: ${realmUrlForError(realmUrl, url)}`); - throw new B2RealmConfigurationError(`realm URL must use HTTPS or loopback IP HTTP for authorization: ${realmUrlForError(realmUrl, url)}`); -} -function assertRealmBaseUrl(realmUrl, url) { - if (url.username === "" && url.password === "" && url.search === "" && url.hash === "") return; - throw new B2RealmConfigurationError(`realm URL must not include credentials, query, or fragment for authorization: ${realmUrlForError(realmUrl, url)}`); -} -/** -* Validate a realm URL before it is used for credential-bearing authorization. -* Any accepted custom HTTPS host receives the application key during authorize; -* do not derive custom realm URLs from untrusted input. Realm URLs must be base -* URLs without userinfo, query strings, or fragments. -* -* @param realmUrl - The resolved realm URL to validate. -* -* @throws B2RealmConfigurationError when the realm URL is not absolute, is not -* a base URL, uses an unsupported scheme, or uses non-loopback plaintext HTTP. -* Loopback IP HTTP is accepted only for local testing and sends the application -* key unencrypted to whichever process is listening on that address and port. -*/ -function assertSecureRealmUrl(realmUrl) { - const url = parseAbsoluteRealmUrl(realmUrl); - if (url === null) throw new B2RealmConfigurationError(`realm URL must be absolute for authorization: ${realmUrlForError(realmUrl, url)}`); - assertRealmBaseUrl(realmUrl, url); - assertAuthorizableRealmScheme(realmUrl, url); -} -function isRealmName(realm) { - return Object.hasOwn(VERIFIED_REALM_URLS, realm); -} -/** -* Resolve a realm name to its base API URL. Unknown strings are returned -* unchanged so callers can resolve custom aliases before authorization. -* -* @param realm - The realm name or direct URL to resolve. -* -* @returns The mapped base API URL for a known realm, otherwise `realm`. -*/ -function getRealmUrl(realm) { - return isRealmName(realm) ? VERIFIED_REALM_URLS[realm] : realm; +class Bucket { + /** Unique identifier for this bucket. */ + id; + /** Human-readable bucket name. */ + name; + /** Full bucket metadata as returned by the B2 API. */ + info; + client; + /** + * @param client - The parent B2Client instance. + * @param info - The bucket metadata from the API. + * + * @internal + */ + constructor(client, info) { + this.client = client; + this.info = info; + this.id = info.bucketId; + this.name = info.bucketName; + } + /** + * Returns a {@link B2Object} handle for a specific file name in this bucket. + * @param fileName - The file path within the bucket. + * + * @returns A B2Object handle bound to this bucket and file name. + */ + file(fileName) { + return new B2Object(this.client, this, fileName); + } + /** + * Uploads a file to this bucket. Automatically uses multipart upload for files + * larger than the recommended part size. + * @param options - Upload configuration including file name, source data, and optional settings. + * + * @returns Metadata for the uploaded file version. + */ + async upload(options) { + const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize(); + const isLarge = options.source.size > recommendedPartSize; + if (isLarge) { + return uploadLargeFile(this.client.raw, this.client.accountInfo, { + bucketId: this.id, + ...options + }); + } + const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options; + return uploadSmallFile(this.client.raw, this.client.accountInfo, { + bucketId: this.id, + ...smallOptions + }); + } + /** + * Downloads a file from this bucket by name. Pass `method: 'HEAD'` in + * `options` to fetch only the response headers (file metadata) without + * streaming the body. + * @param fileName - The file name (path) to download. + * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal. + * + * @returns The download result containing response headers and a readable body stream. + */ + async download(fileName, options) { + return downloadByName(this.client.raw, this.client.accountInfo, { + bucketName: this.name, + fileName, + ...options + }); + } + /** + * Fetches the response headers (file metadata) for a file via HTTP + * HEAD. Returns a body-less result so callers never have to drain + * the (logically empty) HEAD body themselves. + * + * Use this for metadata-only checks like "does this file exist", "what + * is its current SHA-1", "what is its Content-Length". For full file + * retrieval use {@link Bucket.download}. + * + * @param fileName - The file name (path) to inspect. + * @param options - Optional range, SSE-C decryption, response-header + * overrides, and abort signal. Same shape as {@link Bucket.download}'s + * options minus `method` (always HEAD) and `onProgress` (no body). + * + * @returns Parsed download headers (content type, SHA-1, file info, etc.). + * + * @example + * ```ts + * const { headers } = await bucket.head('photos/2026/sunset.jpg') + * console.log(headers.contentLength, headers.contentSha1) + * ``` + */ + async head(fileName, options) { + return headByName(this.client.raw, this.client.accountInfo, { + bucketName: this.name, + fileName, + ...options + }); + } + /** + * Lists file names in this bucket (most recent versions only). + * @param options - Optional filtering and pagination settings. + * + * @returns A page of file versions with an optional continuation token. + */ + async listFileNames(options) { + return this.client.raw.listFileNames( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { + bucketId: this.id, + ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {}, + ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}, + ...options?.prefix !== void 0 ? { prefix: options.prefix } : {}, + ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {} + } + ); + } + /** + * Lists all file versions in this bucket, including hidden files. + * @param options - Optional filtering and pagination settings. + * + * @returns A page of file versions with an optional continuation token. + */ + async listFileVersions(options) { + return this.client.raw.listFileVersions( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { + bucketId: this.id, + ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {}, + ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {}, + ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}, + ...options?.prefix !== void 0 ? { prefix: options.prefix } : {}, + ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {} + } + ); + } + /** + * Async iterator that yields the latest visible version of every file in + * the bucket, automatically handling pagination via `listFileNames`. + * + * Hidden files (those whose latest version is a hide marker) are NOT + * yielded by this iterator. Use {@link paginateFileVersions} when you + * need full version history. + * + * @param options - Filter + pagination + abort options. `pageSize` is + * forwarded to `b2_list_file_names`'s `maxFileCount` (default 1000, + * B2-capped at 10000). + * + * @returns An async iterable of {@link FileVersion} entries. + * + * @example + * ```ts + * for await (const file of bucket.paginateFileNames({ prefix: 'photos/' })) { + * console.log(file.fileName, file.contentLength) + * } + * ``` + */ + paginateFileNames(options) { + return paginateItems( + async (cursor) => { + const resp = await this.listFileNames({ + pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE, + ...cursor !== void 0 ? { startFileName: cursor } : {}, + ...options?.prefix !== void 0 ? { prefix: options.prefix } : {}, + ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {} + }); + return { page: resp, nextCursor: resp.nextFileName ?? void 0 }; + }, + // Real B2 surfaces hide markers as rows in `b2_list_file_names`. This + // iterator's documented contract is "latest VISIBLE version", so we + // drop hide-action rows here. Callers who need full history should + // use `paginateFileVersions`. + (page) => page.files.filter((f) => f.action !== "hide"), + options?.signal + ); + } + /** + * Async iterator that yields every version of every file in the bucket, + * including hidden files and historical versions, automatically handling + * pagination via `listFileVersions`. + * + * The two-cursor `(nextFileName, nextFileId)` continuation that the raw + * endpoint exposes is threaded internally; callers iterate flat. + * + * @param options - Filter + pagination + abort options. + * + * @returns An async iterable of {@link FileVersion} entries. + */ + paginateFileVersions(options) { + return paginateItems( + async (cursor) => { + const resp = await this.listFileVersions({ + pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE, + ...cursor !== void 0 ? { startFileName: cursor.fileName } : {}, + ...cursor?.fileId !== void 0 ? { startFileId: cursor.fileId } : {}, + ...options?.prefix !== void 0 ? { prefix: options.prefix } : {}, + ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {} + }); + const nextCursor = resp.nextFileName !== null ? { fileName: resp.nextFileName, fileId: resp.nextFileId ?? void 0 } : void 0; + return { page: resp, nextCursor }; + }, + (page) => page.files, + options?.signal + ); + } + /** + * Async iterator that yields every unfinished large file in the bucket, + * automatically handling pagination via `listUnfinishedLargeFiles`. + * + * Useful for janitorial scripts that want to inspect or cancel abandoned + * multipart uploads (typically followed by {@link cancelLargeFile} on + * the underlying raw client). + * + * @param options - Filter + pagination + abort options. `pageSize` is + * B2-capped at 100 for this endpoint. + * + * @returns An async iterable of unfinished-large-file metadata entries. + */ + paginateUnfinishedLargeFiles(options) { + return paginateItems( + async (cursor) => { + const resp = await this.listUnfinishedLargeFiles({ + pageSize: options?.pageSize ?? 100, + ...cursor !== void 0 ? { startFileId: cursor } : {}, + ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {} + }); + return { page: resp, nextCursor: resp.nextFileId ?? void 0 }; + }, + (page) => page.files, + options?.signal + ); + } + /** + * Async iterator that yields every uploaded part for a specific large + * file, automatically handling pagination via `listParts`. + * + * @param largeFileId - The unfinished large file to enumerate parts of. + * @param options - Pagination + abort options. `pageSize` is B2-capped + * at 1000 for this endpoint; the default is 1000. + * + * @returns An async iterable of {@link PartInfo} entries. + */ + paginateParts(largeFileId, options) { + return paginateItems( + async (cursor) => { + const resp = await this.client.raw.listParts( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { + fileId: largeFileId, + maxPartCount: options?.pageSize ?? DEFAULT_PAGE_SIZE, + ...cursor !== void 0 ? { startPartNumber: cursor } : {} + } + ); + return { page: resp, nextCursor: resp.nextPartNumber ?? void 0 }; + }, + (page) => page.parts, + options?.signal + ); + } + /** + * Looks up the latest visible version of a file by name. + * Uses `listFileNames` under the hood; returns `null` when the file does not + * exist or its latest version is a hide marker. + * @param fileName - The exact file path to look up. + * + * @returns The latest {@link FileVersion}, or `null` if not found. + */ + async getFileInfoByName(fileName) { + const resp = await this.listFileNames({ prefix: fileName, pageSize: 1 }); + const match = resp.files.find((f) => f.fileName === fileName); + if (!match || match.action === "hide") return null; + return match; + } + /** + * Removes the latest hide marker for a file, restoring visibility of the + * previous upload. Returns the deleted hide marker, or `null` if there was + * no hide marker to remove (file is already visible or does not exist). + * @param fileName - The file path to unhide. + * + * @returns The deleted hide marker version, or `null` if nothing was hidden. + */ + async unhideFile(fileName) { + const resp = await this.listFileVersions({ prefix: fileName, pageSize: 100 }); + const versions = resp.files.filter((f) => f.fileName === fileName); + if (versions.length === 0) return null; + const latest = versions[0]; + if (!latest || latest.action !== "hide") return null; + await this.deleteFileVersion(fileName, latest.fileId); + return latest; + } + /** + * Hides a file by creating a hide marker. The file remains in version history but is no longer visible in `listFileNames`. + * @param fileName - The file path to hide. + * + * @returns Metadata for the newly created hide marker. + */ + async hideFile(fileName) { + return this.client.raw.hideFile( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { bucketId: this.id, fileName } + ); + } + /** + * Permanently deletes a specific file version. Both file name and file ID are required. + * + * If the file is under Object Lock retention, B2 will reject the + * delete: compliance-mode files cannot be deleted until the retention + * expires; governance-mode files require `bypassGovernance: true` + * AND a calling key with the `bypassGovernance` capability. Files on + * legal hold cannot be deleted by anyone until the hold is removed. + * + * @param fileName - The file path of the version to delete. + * @param fileId - The unique identifier of the file version to delete. + * @param options - Optional flag for bypassing governance retention. + */ + async deleteFileVersion(fileName, fileId, options) { + await this.client.raw.deleteFileVersion( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { + fileName, + fileId, + ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {} + } + ); + } + /** + * Cancels an in-progress large file upload so the partial parts are not + * retained or billed. The most common reason to call this is to clean up + * abandoned multipart uploads surfaced by {@link listUnfinishedLargeFiles}. + * @param fileId - The unique identifier of the unfinished large file to cancel. + * + * @returns Metadata about the cancelled large file. + */ + async cancelLargeFile(fileId) { + return this.client.raw.cancelLargeFile( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { fileId } + ); + } + /** + * Lists large files in this bucket that were started but never finished or + * cancelled. Wraps `b2_list_unfinished_large_files`. + * @param options - Optional pagination filters. + * + * @returns The page of unfinished large files plus a continuation token. + */ + async listUnfinishedLargeFiles(options) { + return this.client.raw.listUnfinishedLargeFiles( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { + bucketId: this.id, + ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {}, + ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {}, + ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {} + } + ); + } + /** + * Deletes many file versions with bounded concurrency. Errors from individual + * deletes are collected and returned rather than thrown, so partial success + * does not abort the run. + * + * When `options.signal` is supplied and aborted, in-flight deletes + * complete (they're already on the wire), but no new deletes start + * after the abort fires. Subsequent targets are short-circuited to an + * error entry so the result tally reflects what actually happened. + * @param targets - File versions to delete. + * @param options - Optional concurrency override and abort signal. + * Concurrency defaults to the SDK-wide bulk-metadata setting + * (currently 10, higher than transfer concurrency because each + * task is a single tiny API round-trip). + * + * @returns A summary of successes and per-target errors. + */ + async deleteMany(targets, options) { + const concurrency = options?.concurrency ?? DEFAULT_BULK_CONCURRENCY; + const sem = new Semaphore(concurrency); + const signal = options?.signal; + let deleted = 0; + const errors = []; + await Promise.all( + targets.map(async (target) => { + await sem.acquire(); + try { + if (signal?.aborted) { + errors.push({ + target, + error: toError(signal.reason ?? "aborted") + }); + return; + } + await this.deleteFileVersion(target.fileName, target.fileId); + deleted++; + } catch (err) { + errors.push({ + target, + error: toError(err) + }); + } finally { + sem.release(); + } + }) + ); + return { deleted, errors }; + } + /** + * Async generator that streams every file version in the bucket (optionally + * filtered by prefix) and deletes each one. Yields a {@link DeleteAllEvent} + * per file version. With `dryRun: true`, no deletes are performed but `skip` + * events are still emitted. + * @param options - Optional prefix filter, page size, and dry-run flag. + * + * @returns An async generator of per-file events. + */ + async *deleteAll(options) { + const dryRun = options?.dryRun ?? false; + const pageSize = options?.pageSize ?? DEFAULT_PAGE_SIZE; + let startFileName; + let startFileId; + while (true) { + const page = await this.listFileVersions({ + pageSize, + ...options?.prefix !== void 0 ? { prefix: options.prefix } : {}, + ...startFileName !== void 0 ? { startFileName } : {}, + ...startFileId !== void 0 ? { startFileId } : {} + }); + for (const version of page.files) { + if (dryRun) { + yield { type: "skip", fileName: version.fileName, fileId: version.fileId }; + continue; + } + try { + await this.deleteFileVersion(version.fileName, version.fileId); + yield { type: "delete", fileName: version.fileName, fileId: version.fileId }; + } catch (err) { + yield { + type: "error", + fileName: version.fileName, + fileId: version.fileId, + message: toError(err).message + }; + } + } + if (!page.nextFileName) break; + startFileName = page.nextFileName; + startFileId = page.nextFileId ?? void 0; + } + } + /** + * Creates a server-side copy of a file within or across buckets. + * @param options - Copy configuration including source file ID and destination name. + * + * @returns Metadata for the newly created file version. + */ + async copyFile(options) { + return this.client.raw.copyFile( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + options + ); + } + /** + * Copies a file via the server-side multipart protocol. Each part is copied + * by reference through `b2_copy_part`; data never traverses the client. Falls + * back to a single `copyFile` call when the source fits within a single part. + * @param options - Copy parameters including source file ID, destination name, part size, and concurrency. + * + * @returns Metadata for the newly created destination file version. + */ + async copyLargeFile(options) { + return copyLargeFile(this.client.raw, this.client.accountInfo, { + sourceFileId: options.sourceFileId, + fileName: options.fileName, + ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : { destinationBucketId: this.id }, + ...options.contentType !== void 0 ? { contentType: options.contentType } : {}, + ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {}, + ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}, + ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}, + ...options.partSize !== void 0 ? { partSize: options.partSize } : {}, + ...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {}, + ...options.signal !== void 0 ? { signal: options.signal } : {} + }); + } + /** + * Updates bucket settings such as type, CORS, lifecycle rules, and encryption. + * @param options - Fields to update. Omitted fields are left unchanged. + * + * @returns Updated bucket metadata. + */ + async update(options) { + return this.client.raw.updateBucket( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { + accountId: accountId(this.client.accountInfo.getAccountId()), + bucketId: this.id, + ...options + } + ); + } + /** + * Permanently deletes this bucket. The bucket must be empty (no file versions). + * + * @returns The deleted bucket metadata. + */ + async delete() { + return this.client.deleteBucket(this.id); + } + /** + * Gets a download authorization token scoped to a file name prefix in this bucket. + * @param fileNamePrefix - Only authorize downloads of files starting with this prefix. + * @param validDurationInSeconds - How long the authorization is valid (1-604800 seconds). + * + * @returns The download authorization response containing a time-limited token. + */ + async getDownloadAuthorization(fileNamePrefix, validDurationInSeconds) { + return this.client.raw.getDownloadAuthorization( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { bucketId: this.id, fileNamePrefix, validDurationInSeconds } + ); + } + /** + * Gets the event notification rules configured for this bucket. + * + * @returns The current notification rules for this bucket. + */ + async getNotificationRules() { + return this.client.raw.getBucketNotificationRules( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { bucketId: this.id } + ); + } + /** + * Replaces the event notification rules for this bucket. + * @param rules - The new set of notification rules to apply. + * + * @returns The updated notification rules for this bucket. + */ + async setNotificationRules(rules) { + return this.client.raw.setBucketNotificationRules( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { bucketId: this.id, eventNotificationRules: rules } + ); + } + /** + * Updates the file retention policy for a specific file version. Requires file lock on the bucket. + * @param fileName - The file path of the version to update. + * @param fileId - The unique identifier of the file version. + * @param retention - The new retention policy to apply. + * @param options - Optional flags. Set `bypassGovernance: true` to shorten governance-mode retention. + * + * @returns The updated file retention metadata. + */ + async updateFileRetention(fileName, fileId, retention, options) { + return this.client.raw.updateFileRetention( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { + fileName, + fileId, + fileRetention: retention, + ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {} + } + ); + } + /** + * Updates the legal hold status for a specific file version. Requires file lock on the bucket. + * @param fileName - The file path of the version to update. + * @param fileId - The unique identifier of the file version. + * @param legalHold - The new legal hold status to apply. + * + * @returns The updated legal hold metadata. + */ + async updateFileLegalHold(fileName, fileId, legalHold) { + return this.client.raw.updateFileLegalHold( + this.client.accountInfo.getApiUrl(), + this.client.accountInfo.getAuthToken(), + { fileName, fileId, legalHold } + ); + } + /** + * Refetches this bucket's metadata from B2 so callers operating on + * replication / lifecycle / retention configuration always start from the + * server-of-record state. + * + * Bucket configuration is monotonically revisioned by B2: B2 increments + * `revision` on every accepted update. The local {@link info} snapshot + * captured at construction time goes stale as soon as anyone else (or any + * prior `update()` call) mutates the bucket, so the ergonomic + * add/remove helpers below always refresh before composing the next + * `setX()` call. The result is that each helper is safe to call without + * the caller having to thread BucketInfo through their code. + * + * @returns Fresh {@link BucketInfo} for this bucket. + * + * @throws If the bucket no longer exists. + */ + async refresh() { + const fresh = await this.client.listBuckets({ bucketId: this.id }); + const found = fresh[0]; + if (!found) throw new Error(`Bucket ${this.id} not found`); + return found.info; + } + /** + * Returns the current cross-region replication configuration, refetched + * from B2. + * + * Use this when you need to read replication state without composing a + * write. For add/remove flows the helper methods below handle the + * refresh-then-set sequence for you. + * + * @returns The current {@link ReplicationConfiguration}. + */ + async getReplication() { + const fresh = await this.refresh(); + return fresh.replicationConfiguration; + } + /** + * Replaces this bucket's complete replication configuration. + * @param replication - The new configuration. Pass an empty source/destination + * pair (`{ asReplicationSource: null, asReplicationDestination: null }`) + * to clear replication entirely. + * + * @returns The updated bucket metadata. + */ + async setReplication(replication) { + return this.update({ replicationConfiguration: replication }); + } + /** + * Adds (or replaces by `replicationRuleName`) a single replication rule + * on this bucket while leaving any other rules, the source key, and the + * destination key mapping untouched. + * + * When this is the very first source-side rule, `sourceApplicationKeyId` + * must be supplied to seed `asReplicationSource.sourceApplicationKeyId`; + * for subsequent calls the existing source key is reused unless the + * caller explicitly overrides it. + * + * @param rule - The replication rule to add or replace. + * @param options - Optional source application key ID override (or seed + * when no source side exists yet). + * + * @returns The updated bucket metadata. + * + * @throws If no source-side replication exists yet and the caller did + * not supply `sourceApplicationKeyId`. + */ + async addReplicationRule(rule, options) { + const current = (await this.refresh()).replicationConfiguration; + const existingSource = current.asReplicationSource; + const sourceKey = options?.sourceApplicationKeyId ?? existingSource?.sourceApplicationKeyId; + if (!sourceKey) { + throw new Error( + "addReplicationRule: no existing source-side replication; pass options.sourceApplicationKeyId" + ); + } + const existingRules = existingSource?.replicationRules ?? []; + const without = existingRules.filter((r) => r.replicationRuleName !== rule.replicationRuleName); + return this.setReplication({ + asReplicationSource: { + sourceApplicationKeyId: sourceKey, + replicationRules: [...without, rule] + }, + asReplicationDestination: current.asReplicationDestination + }); + } + /** + * Removes a single replication rule by name. No-ops cleanly when the rule + * is not present (returns the unchanged-but-revision-bumped bucket info). + * + * @param replicationRuleName - Name of the rule to remove. + * + * @returns The updated bucket metadata. + */ + async removeReplicationRule(replicationRuleName) { + const current = (await this.refresh()).replicationConfiguration; + const existingSource = current.asReplicationSource; + if (!existingSource) { + return this.setReplication(current); + } + const filtered = existingSource.replicationRules.filter( + (r) => r.replicationRuleName !== replicationRuleName + ); + return this.setReplication({ + asReplicationSource: { + sourceApplicationKeyId: existingSource.sourceApplicationKeyId, + replicationRules: filtered + }, + asReplicationDestination: current.asReplicationDestination + }); + } + /** + * Returns the current lifecycle rules for this bucket, refetched from B2. + * + * @returns The current array of {@link LifecycleRule}s. + */ + async getLifecycleRules() { + const fresh = await this.refresh(); + return fresh.lifecycleRules; + } + /** + * Replaces this bucket's lifecycle rules in their entirety. + * @param rules - The new rule set. Pass `[]` to remove all lifecycle + * automation. + * + * @returns The updated bucket metadata. + */ + async setLifecycleRules(rules) { + return this.update({ lifecycleRules: [...rules] }); + } + /** + * Adds (or replaces, matched by `fileNamePrefix`) a single lifecycle rule + * while leaving any other rules untouched. + * + * Matching on prefix mirrors B2's own data model: each unique prefix can + * have at most one rule, and a `b2_update_bucket` call that contains two + * rules with the same prefix is rejected. The helper enforces this for + * the caller. + * + * @param rule - The lifecycle rule to add or replace. + * + * @returns The updated bucket metadata. + */ + async addLifecycleRule(rule) { + const current = await this.getLifecycleRules(); + const without = current.filter((r) => r.fileNamePrefix !== rule.fileNamePrefix); + return this.setLifecycleRules([...without, rule]); + } + /** + * Removes a single lifecycle rule by prefix. No-ops cleanly when the rule + * is not present. + * + * @param fileNamePrefix - The prefix of the rule to remove. + * + * @returns The updated bucket metadata. + */ + async removeLifecycleRule(fileNamePrefix) { + const current = await this.getLifecycleRules(); + return this.setLifecycleRules(current.filter((r) => r.fileNamePrefix !== fileNamePrefix)); + } + /** + * Returns the current default Object Lock retention policy for new + * uploads to this bucket, refetched from B2. + * + * @returns The default {@link BucketRetentionPolicy} (which may be + * `{ mode: 'none', period: null }` when Object Lock is enabled on the + * bucket but no default is set). + */ + async getDefaultRetention() { + const fresh = await this.refresh(); + return fresh.defaultRetention; + } + /** + * Sets (or clears, by passing `{ mode: 'none', period: null }`) the + * default Object Lock retention policy applied to new uploads. + * + * Object Lock must already be enabled on the bucket. Buckets created + * without `fileLockEnabled: true` cannot accept a default retention + * policy and B2 will reject this call. + * + * @param policy - The new default retention policy. + * + * @returns The updated bucket metadata. + */ + async setDefaultRetention(policy) { + return this.update({ defaultRetention: policy }); + } } -//#endregion +//# sourceMappingURL=bucket.js.map -//# sourceMappingURL=realms.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/url-guard.js - -//#region src/http/url-guard.ts -/** -* URL allow-list guard. Defends against SSRF / URL-substitution attacks where -* a compromised or hostile B2 endpoint returns an upload URL pointing at an -* internal service (e.g. cloud metadata at `169.254.169.254`). -* -* The guard is built once per `B2Client` and updated by `B2Client.authorize()`. -* Before authorization it is permissive (so the very first -* `b2_authorize_account` request, whose URL the user configured, can succeed). -* After authorization it is locked to host suffixes derived from the realm's -* apiUrl/downloadUrl/s3ApiUrl, plus the well-known B2 upload-pod parent -* domain `backblaze.com`. -* -* The guard runs in `FetchTransport` before any outgoing request. It rejects: -* -* 1. Literal IPv4/IPv6 addresses (defense in depth, covers attempts to -* bypass DNS-based checks with raw IPs). -* 2. Well-known internal hostnames (`localhost`, `metadata`, -* `metadata.google.internal`, `.internal`, `.local`). -* 3. Hosts not matching any allowed suffix once the SDK is locked. -* -* Users supplying a custom `transport` to `B2Client` bypass the guard. That -* is their responsibility to document for their threat model. -* -* Threat-model note: the guard checks the URL's hostname before the -* `fetch()` call. It does NOT pin the resolved IP. A DNS rebinding attack -* could in principle resolve a permitted hostname to an internal IP between -* the guard's check and `fetch()`'s own resolution. This is theoretical -* against B2 because the allow-list is locked to a small set of stable -* Backblaze hostnames (the realm's apiUrl/downloadUrl/s3ApiUrl plus the -* `backblaze.com` parent), and DNS rebinding requires a hostname under -* attacker control. Defense in depth — pinning the IP from the first -* resolution and rejecting subsequent mismatches — would break legitimate -* CDN failovers and is not justified at this surface area. If your -* threat model requires it, supply a custom transport that does. -*/ -/** A URL allow-list that can be reconfigured after construction. */ -var UrlGuard = class { - allowedSuffixes = []; - /** - * Lock the guard to the given host suffixes. A suffix matches a host - * either exactly or as a `*.suffix` subdomain. For example, - * `backblazeb2.com` allows `api.backblazeb2.com` and - * `s3.us-west-004.backblazeb2.com`. - * - * Passing an empty array disables the guard (used by the simulator and - * other test setups). Production code should always lock the guard after - * a successful `b2_authorize_account`. - * - * @param suffixes - Allowed host suffixes. - */ - setAllowedSuffixes(suffixes) { - this.allowedSuffixes = suffixes; - } - /** - * Returns the current allowed-suffix list (for tests and diagnostics). - * - * @returns The currently-configured list of allowed host suffixes. - */ - getAllowedSuffixes() { - return this.allowedSuffixes; - } - /** - * Validate `rawUrl` against the allow-list. Throws {@link B2SsrfError} if - * the URL points at a literal IP, a known-internal hostname, or a host - * outside the allowed suffixes. Permissive (no-op) when no suffixes have - * been configured yet. - * - * @param rawUrl - The URL the caller is about to fetch. - * - * @throws A `B2SsrfError` when the URL is rejected. - */ - check(rawUrl) { - if (this.allowedSuffixes.length === 0) return; - let parsed; - try { - parsed = new URL(rawUrl); - } catch { - throw new B2SsrfError(`malformed URL rejected by SSRF guard: ${rawUrl}`, rawUrl); - } - const host = parsed.hostname.toLowerCase(); - if (isLiteralIp(host)) throw new B2SsrfError(`literal IP host not allowed by SSRF guard (use a hostname): ${host}`, rawUrl); - if (isInternalHostname(host)) throw new B2SsrfError(`internal hostname not allowed by SSRF guard: ${host}`, rawUrl); - if (hostMatchesAnyAllowedSuffix(host, this.allowedSuffixes)) return; - throw new B2SsrfError(`host outside allowed B2 realm: ${host} (allowed suffixes: ${this.allowedSuffixes.join(", ")})`, rawUrl); - } -}; -/** -* Extract host suffixes to allow from a B2 authorize-account response. -* -* Known B2 realm hosts under `backblazeb2.com` are collapsed to that parent. -* Unknown or custom realm hosts are used as scoped suffixes: the returned -* hostname and its subdomains are allowed, but sibling hosts and parent -* domains are not. This avoids accidentally trusting broad public suffixes -* such as `co.uk`. -* -* Always includes `backblaze.com` because upload-pod URLs returned by -* `b2_get_upload_url` use that parent domain (`pod-NNN-NNNN-NN.backblaze.com`) -* rather than `backblazeb2.com`. -* -* @param storageApi - The `apiInfo.storageApi` portion of the authorize response. -* -* @returns Sorted list of unique host suffixes to allow. -*/ +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/errors/index.js +class B2Error extends Error { + /** HTTP status code returned by the B2 API. */ + status; + /** B2 error code identifying the error type (e.g. `expired_auth_token`). */ + code; + /** B2 request ID from the `X-Bz-Request-Id` response header, if present. */ + requestId; + /** Retry delay in seconds from the `Retry-After` response header, if present. */ + retryAfter; + /** Whether this error is transient and the request can be retried. */ + retryable; + /** + * Creates a new B2Error instance. + * @param response - Parsed B2 error response body. + * @param options - Optional retry and request metadata from response headers. + */ + constructor(response, options) { + super(response.message); + this.name = "B2Error"; + this.status = response.status; + this.code = response.code; + if (options?.retryAfter !== void 0) this.retryAfter = options.retryAfter; + if (options?.requestId !== void 0) this.requestId = options.requestId; + this.retryable = isTransient(response.status, response.code); + } +} +class ExpiredAuthTokenError extends B2Error { + /** + * Creates a new ExpiredAuthTokenError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "ExpiredAuthTokenError"; + } +} +class BadAuthTokenError extends B2Error { + /** + * Creates a new BadAuthTokenError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "BadAuthTokenError"; + } +} +class ServiceUnavailableError extends B2Error { + /** + * Creates a new ServiceUnavailableError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "ServiceUnavailableError"; + } +} +class RequestTimeoutError extends B2Error { + /** + * Creates a new RequestTimeoutError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "RequestTimeoutError"; + } +} +class TooManyRequestsError extends B2Error { + /** + * Creates a new TooManyRequestsError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "TooManyRequestsError"; + } +} +class CapExceededError extends B2Error { + /** + * Creates a new CapExceededError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "CapExceededError"; + } +} +class AccessDeniedError extends B2Error { + /** + * Creates a new AccessDeniedError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "AccessDeniedError"; + } +} +class FileNotPresentError extends B2Error { + /** + * Creates a new FileNotPresentError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "FileNotPresentError"; + } +} +class DuplicateBucketNameError extends B2Error { + /** + * Creates a new DuplicateBucketNameError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "DuplicateBucketNameError"; + } +} +class BadRequestError extends B2Error { + /** + * Creates a new BadRequestError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "BadRequestError"; + } +} +class BadUploadUrlError extends B2Error { + /** + * Creates a new BadUploadUrlError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "BadUploadUrlError"; + } +} +class ChecksumMismatchError extends B2Error { + /** + * Creates a new ChecksumMismatchError instance. + * @param response - Parsed B2 error response body. + * @param options - The error details including HTTP status, error code, message, and optional request ID. + */ + constructor(response, options) { + super(response, options); + this.name = "ChecksumMismatchError"; + } +} +class B2InsufficientCapabilityError extends Error { + /** Capabilities that were required for the operation. */ + required; + /** Capabilities that the current key actually has. */ + available; + /** Capabilities present in `required` but not in `available`. */ + missing; + /** + * Creates a new B2InsufficientCapabilityError instance. + * + * @param required - Capabilities the operation requires. + * @param available - Capabilities the current key holds. + * @param missing - The subset of required that isn't available. + */ + constructor(required, available, missing) { + super(`Application key is missing capabilities: ${missing.join(", ")}`); + this.name = "B2InsufficientCapabilityError"; + this.required = required; + this.available = available; + this.missing = missing; + } +} +class B2SsrfError extends Error { + /** + * Creates a new {@link B2SsrfError}. + * + * @param message - Human-readable description of which URL was rejected and why. + * @param url - The full URL that was rejected. + */ + constructor(message, url) { + super(message); + this.url = url; + this.name = "B2SsrfError"; + } + /** Always `false` — this is a security failure, not transient. */ + retryable = false; +} +class NetworkError extends Error { + /** + * Creates a new NetworkError instance. + * @param message - Human-readable description of the network failure. + * @param cause - The underlying error that caused this failure, if any. + */ + constructor(message, cause) { + super(message); + this.cause = cause; + this.name = "NetworkError"; + } + /** Always `true` since network errors are transient. */ + retryable = true; +} +function isTransient(status, code) { + if (status === 408 || status === 429 || status === 503) return true; + if (code === "expired_auth_token") return true; + if (code === "service_unavailable" || code === "request_timeout") return true; + return false; +} +function classifyError(response, options) { + switch (response.code) { + case "expired_auth_token": + return new ExpiredAuthTokenError(response, options); + case "bad_auth_token": + case "unauthorized": + return new BadAuthTokenError(response, options); + case "service_unavailable": + return new ServiceUnavailableError(response, options); + case "request_timeout": + return new RequestTimeoutError(response, options); + case "cap_exceeded": + case "storage_cap_exceeded": + case "transaction_cap_exceeded": + case "download_cap_exceeded": + return new CapExceededError(response, options); + case "access_denied": + return new AccessDeniedError(response, options); + case "file_not_present": + case "no_such_file": + return new FileNotPresentError(response, options); + case "duplicate_bucket_name": + return new DuplicateBucketNameError(response, options); + case "bad_sha1_checksum": + return new ChecksumMismatchError(response, options); + case "bad_request": + return new BadRequestError(response, options); + } + if (response.status === 429) return new TooManyRequestsError(response, options); + if (response.status === 503) return new ServiceUnavailableError(response, options); + if (response.status === 408) return new RequestTimeoutError(response, options); + return new B2Error(response, options); +} + +//# sourceMappingURL=index.js.map + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/url-guard.js + +class UrlGuard { + allowedSuffixes = []; + /** + * Lock the guard to the given host suffixes. A suffix matches a host + * either exactly or as a `*.suffix` subdomain. For example, + * `backblazeb2.com` allows `api.backblazeb2.com` and + * `s3.us-west-004.backblazeb2.com`. + * + * Passing an empty array disables the guard (used by the simulator and + * other test setups). Production code should always lock the guard after + * a successful `b2_authorize_account`. + * + * @param suffixes - Allowed host suffixes. + */ + setAllowedSuffixes(suffixes) { + this.allowedSuffixes = suffixes; + } + /** + * Returns the current allowed-suffix list (for tests and diagnostics). + * + * @returns The currently-configured list of allowed host suffixes. + */ + getAllowedSuffixes() { + return this.allowedSuffixes; + } + /** + * Validate `rawUrl` against the allow-list. Throws {@link B2SsrfError} if + * the URL points at a literal IP, a known-internal hostname, or a host + * outside the allowed suffixes. Permissive (no-op) when no suffixes have + * been configured yet. + * + * @param rawUrl - The URL the caller is about to fetch. + * + * @throws A `B2SsrfError` when the URL is rejected. + */ + check(rawUrl) { + if (this.allowedSuffixes.length === 0) return; + let parsed; + try { + parsed = new URL(rawUrl); + } catch { + throw new B2SsrfError(`malformed URL rejected by SSRF guard: ${rawUrl}`, rawUrl); + } + const host = parsed.hostname.toLowerCase(); + if (isLiteralIp(host)) { + throw new B2SsrfError( + `literal IP host not allowed by SSRF guard (use a hostname): ${host}`, + rawUrl + ); + } + if (isInternalHostname(host)) { + throw new B2SsrfError(`internal hostname not allowed by SSRF guard: ${host}`, rawUrl); + } + for (const suffix of this.allowedSuffixes) { + const lowered = suffix.toLowerCase(); + if (host === lowered || host.endsWith(`.${lowered}`)) return; + } + throw new B2SsrfError( + `host outside allowed B2 realm: ${host} (allowed suffixes: ${this.allowedSuffixes.join(", ")})`, + rawUrl + ); + } +} function deriveAllowedSuffixes(storageApi) { - const suffixes = /* @__PURE__ */ new Set(["backblaze.com"]); - for (const url of [ - storageApi.apiUrl, - storageApi.downloadUrl, - storageApi.s3ApiUrl - ]) try { - const host = new URL(url).hostname; - suffixes.add(host === "backblazeb2.com" || host.endsWith(".backblazeb2.com") ? "backblazeb2.com" : host); - } catch {} - return Array.from(suffixes).sort(); -} -/** -* Checks a hostname against one allowed suffix using the SDK's exact-or-subdomain rule. -* -* @param hostname - URL hostname to check. -* @param suffix - Domain suffix that may match exactly or as a parent domain. -* -* @returns Whether the hostname is exactly the suffix or a subdomain of it. -*/ -function url_guard_hostMatchesAllowedSuffix(hostname, suffix) { - const host = hostname.toLowerCase(); - const lowered = suffix.toLowerCase(); - return host === lowered || host.endsWith(`.${lowered}`); -} -/** -* Checks a hostname against an allowed-suffix list. -* -* @param hostname - URL hostname to check. -* @param suffixes - Domain suffixes to test with the SDK's suffix-matching rule. -* -* @returns Whether any suffix matches the hostname. -*/ -function hostMatchesAnyAllowedSuffix(hostname, suffixes) { - return suffixes.some((suffix) => url_guard_hostMatchesAllowedSuffix(hostname, suffix)); + const suffixes = /* @__PURE__ */ new Set(["backblaze.com"]); + for (const url of [storageApi.apiUrl, storageApi.downloadUrl, storageApi.s3ApiUrl]) { + try { + const host = new URL(url).hostname; + const parts = host.split("."); + if (parts.length >= 2) { + suffixes.add(parts.slice(-2).join(".")); + } + } catch { + } + } + return Array.from(suffixes).sort(); } function isLiteralIp(host) { - if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host)) return true; - if (host.includes(":")) return true; - return false; + if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host)) return true; + if (host.includes(":")) return true; + return false; } function isInternalHostname(host) { - if (host === "localhost") return true; - if (host.endsWith(".localhost")) return true; - if (host === "metadata") return true; - if (host === "metadata.google.internal") return true; - if (host.endsWith(".internal")) return true; - if (host.endsWith(".local")) return true; - return false; + if (host === "localhost") return true; + if (host.endsWith(".localhost")) return true; + if (host === "metadata") return true; + if (host === "metadata.google.internal") return true; + if (host.endsWith(".internal")) return true; + if (host.endsWith(".local")) return true; + return false; } -//#endregion - //# sourceMappingURL=url-guard.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/_virtual/_b2-sdk-version-json.js -//#region \0b2-sdk-version-json -var _b2_sdk_version_json_default = { "version": "0.2.0" }; -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/package.json.js +const version = "0.1.0"; +const pkg = { + version +}; -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/version.js +//# sourceMappingURL=package.json.js.map -//#region src/version.ts -/** -* Current SDK version. Read directly from package.json so there is no -* second-source-of-truth to keep in sync — bumping `version` in package.json -* automatically propagates here, into the SDK's User-Agent header, and into -* the published artifact. -* -* Works in every runtime the SDK targets: -* - Node 22.3+, Bun, Deno: native JSON import attributes. -* - Vite builds: the JSON import is replaced with a version-only shim so -* published runtime chunks do not carry unrelated package metadata. -* - Vitest browser mode: Vite handles the import the same way as build. -*/ -var VERSION = _b2_sdk_version_json_default.version; -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/version.js +const VERSION = pkg.version; //# sourceMappingURL=version.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/user-agent.js - -//#region src/http/user-agent.ts -/** -* Stable identifier Backblaze can grep server logs for to find every request -* issued by this SDK regardless of how the User-Agent comment evolves. -* Treat as part of the public contract: do NOT rename without coordinating. -*/ -var SDK_PRODUCT = "b2-sdk-typescript"; -/** -* The npm package name. Embedded in the User-Agent comment alongside -* {@link SDK_PRODUCT} so log queries that grep on either token work. -*/ -var SDK_PACKAGE = "@backblaze-labs/b2-sdk"; -/** -* Best-effort detection of the JS runtime and host OS. Used to populate the -* User-Agent comment so server-side logs can spot Bun/Deno adoption and -* triage OS-specific issues without asking for a repro environment. -* -* @returns The detected runtime, OS, and architecture tokens. -*/ + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/user-agent.js + +const SDK_PRODUCT = "b2-sdk-typescript"; +const SDK_PACKAGE = "@backblaze-labs/b2-sdk"; function detectPlatform() { - const g = globalThis; - if (typeof g["Deno"] !== "undefined") { - const deno = g["Deno"]; - return { - runtime: deno.version?.deno ? `deno/${deno.version.deno}` : "deno", - os: deno.build?.os, - arch: deno.build?.arch - }; - } - if (typeof g["Bun"] !== "undefined") { - const bun = g["Bun"]; - const proc = g["process"]; - return { - runtime: bun.version ? `bun/${bun.version}` : "bun", - os: proc?.platform, - arch: proc?.arch - }; - } - if (typeof g["process"] !== "undefined") { - const proc = g["process"]; - if (proc.versions?.node) return { - runtime: `node/${proc.versions.node}`, - os: proc.platform, - arch: proc.arch - }; - } - if (typeof g["navigator"] !== "undefined") return { - runtime: "browser", - os: void 0, - arch: void 0 - }; - return { - runtime: "unknown", - os: void 0, - arch: void 0 - }; -} -/** -* Build the User-Agent header value the SDK sends on every B2 request. -* -* The product token, npm package name, language label, runtime, OS, and -* architecture are emitted in that order, separated by semicolons inside a -* single parenthesised comment block. OS and architecture are omitted on -* runtimes that don't expose them (notably browsers). A custom prefix passed -* via `B2ClientOptions.userAgent` is prepended verbatim so app-level -* identifiers come first. See the README "Identifying your traffic" section -* for examples. -* -* @param custom - Optional prefix prepended to the default User-Agent. -* -* @returns The formatted User-Agent header string. -*/ + const g = globalThis; + if (typeof g["Deno"] !== "undefined") { + const deno = g["Deno"]; + return { + runtime: deno.version?.deno ? `deno/${deno.version.deno}` : "deno", + os: deno.build?.os, + arch: deno.build?.arch + }; + } + if (typeof g["Bun"] !== "undefined") { + const bun = g["Bun"]; + const proc = g["process"]; + return { + runtime: bun.version ? `bun/${bun.version}` : "bun", + os: proc?.platform, + arch: proc?.arch + }; + } + if (typeof g["process"] !== "undefined") { + const proc = g["process"]; + if (proc.versions?.node) { + return { + runtime: `node/${proc.versions.node}`, + os: proc.platform, + arch: proc.arch + }; + } + } + if (typeof g["navigator"] !== "undefined") { + return { runtime: "browser", os: void 0, arch: void 0 }; + } + return { runtime: "unknown", os: void 0, arch: void 0 }; +} function getUserAgent(custom) { - const { runtime, os, arch } = detectPlatform(); - const parts = [ - "typescript", - SDK_PACKAGE, - runtime - ]; - if (os !== void 0) parts.push(os); - if (arch !== void 0) parts.push(arch); - const base = `${SDK_PRODUCT}/${VERSION} (${parts.join("; ")})`; - return custom ? `${custom} ${base}` : base; + const { runtime, os, arch } = detectPlatform(); + const parts = ["typescript", SDK_PACKAGE, runtime]; + if (os !== void 0) parts.push(os); + if (arch !== void 0) parts.push(arch); + const base = `${SDK_PRODUCT}/${VERSION} (${parts.join("; ")})`; + return custom ? `${custom} ${base}` : base; } -//#endregion - //# sourceMappingURL=user-agent.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/transport.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/transport.js -//#region src/http/transport.ts -var REDIRECT_STATUSES = /* @__PURE__ */ new Set([ - 301, - 302, - 303, - 307, - 308 -]); -var MAX_SAME_ORIGIN_REDIRECTS = 5; -/** -* Default transport implementation using the global `fetch` API. -* Automatically sets the User-Agent header on each request and applies the -* SSRF {@link UrlGuard} (if configured) before opening the connection. -* Redirect following is disabled so redirected URLs cannot bypass the guard or -* receive credential-bearing headers without an explicit checked request. -*/ -var FetchTransport = class { - /** User-Agent string sent with every request. */ - userAgent; - /** Whether same-origin GET/HEAD redirects should be followed after guard checks. */ - followSameOriginRedirects; - /** SSRF allow-list applied to every outgoing URL. Mutable so `B2Client.authorize()` can lock it down post-auth. */ - urlGuard; - /** - * Creates a new FetchTransport. - * @param options - Optional configuration: custom User-Agent prefix and SSRF guard. - */ - constructor(options) { - this.userAgent = getUserAgent(options?.userAgent); - this.followSameOriginRedirects = options?.followSameOriginRedirects ?? true; - this.urlGuard = options?.urlGuard ?? new UrlGuard(); - } - /** - * Sends the request using the global `fetch` function. - * @param request - The HTTP request to execute. - * - * @returns The HTTP response. - * - * @throws B2SsrfError when the URL fails the configured SSRF guard. - * @throws B2RedirectError when a response attempts to redirect. - */ - async send(request) { - let currentRequest = request; - let redirectCount = 0; - while (true) { - this.urlGuard.check(currentRequest.url); - const headers = new Headers(currentRequest.headers); - if (!headers.has("User-Agent")) headers.set("User-Agent", this.userAgent); - const timeoutScope = createRequestTimeoutScope(currentRequest); - let response; - try { - response = await fetch(currentRequest.url, { - method: currentRequest.method, - headers, - body: currentRequest.body ?? null, - redirect: "manual", - ...timeoutScope.signal !== void 0 ? { signal: timeoutScope.signal } : {} - }); - } catch (err) { - timeoutScope.dispose(); - if (timeoutScope.timedOut) throw createRequestTimeoutError(timeoutScope); - throw err; - } - if (isBlockedRedirect(response)) { - const location = response.headers.get("Location"); - if (this.followSameOriginRedirects && location !== null && redirectCount < MAX_SAME_ORIGIN_REDIRECTS && canFollowSameOriginRedirect(currentRequest, location)) { - const nextUrl = new URL(location, currentRequest.url).toString(); - await cancelResponseBody(response); - timeoutScope.dispose(); - this.urlGuard.check(nextUrl); - currentRequest = { - ...currentRequest, - url: nextUrl - }; - redirectCount += 1; - continue; - } - await cancelResponseBody(response); - timeoutScope.dispose(); - throw new B2RedirectError(currentRequest.url, response.status, location); - } - return createTimedHttpResponse(response, timeoutScope); - } - } + +class FetchTransport { + /** User-Agent string sent with every request. */ + userAgent; + /** SSRF allow-list applied to every outgoing URL. Mutable so `B2Client.authorize()` can lock it down post-auth. */ + urlGuard; + /** + * Creates a new FetchTransport. + * @param options - Optional configuration: custom User-Agent prefix and SSRF guard. + */ + constructor(options) { + this.userAgent = getUserAgent(options?.userAgent); + this.urlGuard = options?.urlGuard ?? new UrlGuard(); + } + /** + * Sends the request using the global `fetch` function. + * @param request - The HTTP request to execute. + * + * @returns The HTTP response. + * + * @throws B2SsrfError when the URL fails the configured SSRF guard. + */ + async send(request) { + this.urlGuard.check(request.url); + const headers = new Headers(request.headers); + if (!headers.has("User-Agent")) { + headers.set("User-Agent", this.userAgent); + } + const response = await fetch(request.url, { + method: request.method, + headers, + body: request.body ?? null, + ...request.signal !== void 0 ? { signal: request.signal } : {} + }); + return { + status: response.status, + headers: response.headers, + body: response.body, + json: () => response.json(), + text: () => response.text(), + arrayBuffer: () => response.arrayBuffer() + }; + } +} +class RetryTransport { + /** The wrapped transport that performs actual HTTP requests. */ + inner; + /** Resolved retry options (defaults merged with user overrides). */ + options; + /** Optional callback to refresh auth credentials on 401 — returns the fresh token. */ + onReauth; + /** Sleep implementation used between retries; injectable for tests. */ + sleepImpl; + /** + * Creates a new RetryTransport. + * @param opts - Retry transport configuration. + */ + constructor(opts) { + this.inner = opts.transport; + this.options = { ...DEFAULT_RETRY_OPTIONS, ...opts.retry }; + if (opts.onReauth !== void 0) this.onReauth = opts.onReauth; + this.sleepImpl = opts.sleepImpl ?? sleep; + } + /** + * Sends the request with automatic retry on transient failures. + * On expired auth tokens, calls {@link RetryTransportOptions.onReauth} and retries. + * @param originalRequest - The HTTP request to execute. The caller's + * reference is not mutated; on reauth, a copy with a refreshed + * Authorization header is sent. + * + * @returns The HTTP response. + */ + async send(originalRequest) { + let request = originalRequest; + let lastError; + for (let attempt = 0; attempt <= this.options.maxRetries; attempt++) { + if (attempt > 0 && lastError) { + const retryAfter = lastError instanceof NetworkError ? void 0 : lastError.retryAfter; + const delay = computeBackoff(attempt - 1, this.options, retryAfter); + await this.sleepImpl(delay, request.signal); + } + try { + const response = await this.inner.send(request); + if (response.status >= 200 && response.status < 300) { + return response; + } + let errorBody; + try { + errorBody = await response.json(); + } catch { + errorBody = { + status: response.status, + code: "internal_error", + message: `HTTP ${response.status}` + }; + } + const retryAfterHeader = response.headers.get("Retry-After"); + const retryAfterSec = retryAfterHeader ? Number.parseInt(retryAfterHeader, 10) : void 0; + const requestId = response.headers.get("X-Bz-Request-Id") ?? void 0; + const error = classifyError(errorBody, { + ...retryAfterSec !== void 0 ? { retryAfter: retryAfterSec } : {}, + ...requestId !== void 0 ? { requestId } : {} + }); + if (error instanceof ExpiredAuthTokenError && this.onReauth) { + const freshToken = await this.onReauth(); + request = { + ...request, + headers: { ...request.headers ?? {}, Authorization: freshToken } + }; + continue; + } + if (!error.retryable || attempt === this.options.maxRetries) { + throw error; + } + lastError = error; + } catch (err) { + if (err instanceof B2Error || err instanceof NetworkError) { + throw err; + } + if (err instanceof DOMException && err.name === "AbortError") { + throw err; + } + const networkErr = new NetworkError( + err instanceof Error ? err.message : "Network error", + err + ); + if (attempt === this.options.maxRetries) { + throw networkErr; + } + lastError = networkErr; + } + } + throw lastError ?? new NetworkError("Max retries exceeded"); + } +} + +//# sourceMappingURL=transport.js.map + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/encryption.js +const EncryptionAlgorithm = { + /** AES with a 256-bit key. The only algorithm B2 currently supports. */ + Aes256: "AES256" }; -function createRequestTimeoutScope(request) { - const timeoutMs = request.retry?.requestTimeoutMs ?? DEFAULT_RETRY_OPTIONS.requestTimeoutMs; - if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) { - const scope = { - timeoutMs: 0, - timedOut: false, - reset() {}, - dispose() {} - }; - if (request.signal !== void 0) return { - ...scope, - signal: request.signal - }; - return scope; - } - const controller = new AbortController(); - let timedOut = false; - let timer; - const abortFromUpstream = () => { - clearTimeout(timer); - controller.abort(request.signal?.reason ?? new DOMException("Aborted", "AbortError")); - }; - const armTimer = () => { - const nextTimer = setTimeout(() => { - timedOut = true; - controller.abort(new DOMException("HTTP request timed out", "TimeoutError")); - }, timeoutMs); - unrefTimer(nextTimer); - return nextTimer; - }; - timer = armTimer(); - const reset = () => { - if (timedOut || controller.signal.aborted) return; - clearTimeout(timer); - timer = armTimer(); - }; - if (request.signal?.aborted === true) { - clearTimeout(timer); - abortFromUpstream(); - } else request.signal?.addEventListener("abort", abortFromUpstream, { once: true }); - return { - signal: controller.signal, - timeoutMs, - get timedOut() { - return timedOut; - }, - reset, - dispose() { - clearTimeout(timer); - request.signal?.removeEventListener("abort", abortFromUpstream); - } - }; -} -function unrefTimer(timer) { - const maybeUnref = timer.unref; - if (typeof maybeUnref === "function") maybeUnref.call(timer); -} -function createRequestTimeoutError(scope) { - return new DOMException(`HTTP request timed out after ${scope.timeoutMs} ms`, "TimeoutError"); -} -function createTimedHttpResponse(response, timeoutScope) { - const body = response.body; - if (body === null) timeoutScope.dispose(); - let timedBody; - return { - status: response.status, - headers: response.headers, - get body() { - if (body === null) return null; - timedBody ??= createTimedResponseBody(body, timeoutScope); - return timedBody; - }, - json: () => readTimedResponseBody(timeoutScope, response, () => response.json()), - text: () => readTimedResponseBody(timeoutScope, response, () => response.text()), - arrayBuffer: () => readTimedResponseBody(timeoutScope, response, () => response.arrayBuffer()) - }; -} -async function readTimedResponseBody(timeoutScope, response, read) { - try { - return await raceBodyReadWithAbort(timeoutScope, read(), (reason) => cancelResponseBody(response, reason)); - } catch (err) { - if (timeoutScope.timedOut) throw createRequestTimeoutError(timeoutScope); - throw err; - } finally { - timeoutScope.dispose(); - } -} -function createTimedResponseBody(body, timeoutScope) { - let reader; - let disposed = false; - const dispose = () => { - if (disposed) return; - disposed = true; - timeoutScope.dispose(); - }; - return new ReadableStream({ - async pull(controller) { - reader ??= body.getReader(); - try { - const result = await raceBodyReadWithAbort(timeoutScope, reader.read(), (reason) => reader?.cancel(reason)); - if (result.done) { - dispose(); - controller.close(); - return; - } - timeoutScope.reset(); - controller.enqueue(result.value); - } catch (err) { - dispose(); - if (timeoutScope.timedOut) { - controller.error(createRequestTimeoutError(timeoutScope)); - return; - } - controller.error(err); - } - }, - async cancel(reason) { - dispose(); - try { - if (reader !== void 0) { - await reader.cancel(reason); - return; - } - await body.cancel(reason); - } catch {} - } - }); -} -async function raceBodyReadWithAbort(timeoutScope, read, abortCleanup) { - const signal = timeoutScope.signal; - if (signal === void 0) return read; - const abortReason = () => signal.reason ?? new DOMException("Aborted", "AbortError"); - if (signal.aborted) { - read.catch(() => {}); - const reason = abortReason(); - await runAbortCleanup(abortCleanup, reason); - throw reason; - } - let removeAbortListener; - const abort = new Promise((_, reject) => { - const onAbort = () => { - const reason = abortReason(); - read.catch(() => {}); - reject(reason); - runAbortCleanup(abortCleanup, reason); - }; - signal.addEventListener("abort", onAbort, { once: true }); - removeAbortListener = () => signal.removeEventListener("abort", onAbort); - }); - try { - return await Promise.race([read, abort]); - } finally { - removeAbortListener?.(); - } -} -async function runAbortCleanup(abortCleanup, reason) { - try { - await abortCleanup?.(reason); - } catch {} -} -function isBlockedRedirect(response) { - return response.type === "opaqueredirect" || REDIRECT_STATUSES.has(response.status); -} -function canFollowSameOriginRedirect(request, location) { - if (request.method !== "GET" && request.method !== "HEAD") return false; - try { - return new URL(request.url).origin === new URL(location, request.url).origin; - } catch { - return false; - } -} -async function cancelResponseBody(response, reason) { - try { - await response.body?.cancel(reason); - } catch {} -} -/** -* Decide whether `url` points at a URL-pinned upload POST endpoint. -* -* @param url - Request URL to inspect. -* -* @returns Whether the request is a direct upload endpoint. -*/ -function isUploadEndpoint(url) { - const endpoint = b2ApiEndpointName(url); - return endpoint === "b2_upload_file" || endpoint === "b2_upload_part"; -} -function isFinishLargeFileEndpoint(url) { - return b2ApiEndpointName(url) === "b2_finish_large_file"; -} -function isStartLargeFileEndpoint(url) { - return b2ApiEndpointName(url) === "b2_start_large_file"; -} -function b2ApiEndpointName(url) { - const [, root, , endpoint] = new URL(url).pathname.split("/"); - if (root !== "b2api") return void 0; - return endpoint; -} -function isReplayUnsafePostEndpoint(url) { - return isUploadEndpoint(url) || isStartLargeFileEndpoint(url) || isFinishLargeFileEndpoint(url); -} -/** -* Decide whether a classified error should be retried in place for `url`. -* Transient errors normally retry; upload endpoints bubble to the upload layer -* for fresh-URL retry except account-level 429 throttling, where fetching a new -* upload URL only amplifies the rate limit. -* -* @param error - The classified, retryability-tagged error. -* @param url - The request URL (used to detect upload endpoints). -* -* @returns Whether to retry the request in place. -*/ -function shouldRetryInPlace(error, url) { - if (!error.retryable) return false; - if (isStartLargeFileEndpoint(url) || isFinishLargeFileEndpoint(url)) return false; - if (isUploadEndpoint(url) && error.status === 429) return true; - if (isUploadEndpoint(url)) return false; - return true; -} -function isRequestTimeoutError(err) { - return err instanceof DOMException && err.name === "TimeoutError"; -} -function isTerminalTransportError(err) { - return err instanceof B2Error || err instanceof B2RedirectError || err instanceof NetworkError || err instanceof B2SsrfError || err instanceof DOMException && err.name === "AbortError"; -} -/** -* Transport wrapper that adds automatic retry with exponential backoff. -* Handles transient errors (408, 429, and the transient 5xx set 500/502/503/504), -* expired auth tokens, and network failures. Delegates to an inner -* {@link HttpTransport}. -* -* Upload endpoints (`b2_upload_file` / `b2_upload_part`) are URL-pinned. Their -* retryable pod failures bubble to the upload layer, which evicts the failed -* URL, fetches a fresh one, and retries there. HTTP 429 remains an in-place -* retry so account-level throttling does not trigger extra upload URL fetches. -*/ -var RetryTransport = class { - /** The wrapped transport that performs actual HTTP requests. */ - inner; - /** Resolved retry options (defaults merged with user overrides). */ - options; - /** Optional callback to refresh auth credentials on 401 — returns the fresh token. */ - onReauth; - /** Sleep implementation used between retries; injectable for tests. */ - sleepImpl; - /** - * Creates a new RetryTransport. - * @param opts - Retry transport configuration. - */ - constructor(opts) { - this.inner = opts.transport; - this.options = { - ...DEFAULT_RETRY_OPTIONS, - ...opts.retry - }; - if (opts.onReauth !== void 0) this.onReauth = opts.onReauth; - this.sleepImpl = opts.sleepImpl ?? sleep; - } - /** - * Sends the request with automatic retry on transient failures. - * On expired auth tokens, calls {@link RetryTransportOptions.onReauth} and retries. - * @param originalRequest - The HTTP request to execute. The caller's - * reference is not mutated; on reauth, a copy with a refreshed - * Authorization header is sent. - * - * @returns The HTTP response. - */ - async send(originalRequest) { - let request = originalRequest; - const retryOptions = { - ...this.options, - ...originalRequest.retry - }; - let lastError; - let didReauth = false; - let attempt = 0; - while (attempt <= retryOptions.maxRetries) { - throwIfSignalAborted(request.signal); - if (attempt > 0 && lastError) { - const retryAfter = lastError instanceof NetworkError ? void 0 : lastError.retryAfter; - const delay = computeBackoff(attempt - 1, retryOptions, retryAfter); - await this.sleepImpl(delay, request.signal); - } - try { - const response = await this.inner.send({ - ...request, - retry: retryOptions - }); - await throwIfSignalAbortedAfterResponse(request.signal, response); - if (response.status >= 200 && response.status < 300) return response; - let errorBody; - try { - errorBody = await response.json(); - } catch (err) { - if (isRequestTimeoutError(err)) throw err; - errorBody = { - status: response.status, - code: "internal_error", - message: `HTTP ${response.status}` - }; - } - const retryAfterHeader = response.headers.get("Retry-After"); - const retryAfterSec = retryAfterHeader ? Number.parseInt(retryAfterHeader, 10) : void 0; - const requestId = response.headers.get("X-Bz-Request-Id") ?? void 0; - const error = classifyError(errorBody, { - ...retryAfterSec !== void 0 ? { retryAfter: retryAfterSec } : {}, - ...requestId !== void 0 ? { requestId } : {} - }); - if (error instanceof ExpiredAuthTokenError && this.onReauth && !isUploadEndpoint(request.url) && !didReauth) { - const freshToken = await this.onReauth(); - request = { - ...request, - headers: { - ...request.headers ?? {}, - Authorization: freshToken - } - }; - didReauth = true; - lastError = void 0; - continue; - } - if (!shouldRetryInPlace(error, request.url) || attempt === retryOptions.maxRetries) throw error; - lastError = error; - attempt += 1; - } catch (err) { - throwIfSignalAborted(request.signal); - if (isTerminalTransportError(err)) throw err; - const networkErr = new NetworkError(err instanceof Error ? err.message : "Network error", err); - if (isReplayUnsafePostEndpoint(request.url) || attempt === retryOptions.maxRetries) throw networkErr; - lastError = networkErr; - attempt += 1; - } - } - throw lastError ?? new NetworkError("Max retries exceeded"); - } +const EncryptionMode = { + /** B2-managed encryption keys. */ + SseB2: "SSE-B2", + /** Customer-provided encryption keys. */ + SseC: "SSE-C", + /** No encryption. */ + None: "none" }; -function throwIfSignalAborted(signal) { - if (signal?.aborted === true) throw signal.reason ?? new DOMException("Aborted", "AbortError"); +const SSE_B2 = { mode: "SSE-B2", algorithm: "AES256" }; +const SSE_NONE = { mode: "none" }; +function sseCustomer(customerKey, customerKeyMd5) { + return { mode: "SSE-C", algorithm: "AES256", customerKey, customerKeyMd5 }; } -async function throwIfSignalAbortedAfterResponse(signal, response) { - if (signal?.aborted !== true) return; - const reason = signal.reason ?? new DOMException("Aborted", "AbortError"); - try { - await response.body?.cancel(reason); - } catch {} - throw reason; +function bytesToBase64(bytes) { + const g = globalThis; + if (g.Buffer) { + return g.Buffer.from(bytes).toString("base64"); + } + let binary = ""; + for (const b of bytes) binary += String.fromCharCode(b); + return btoa(binary); +} +async function md5Base64(bytes) { + try { + const { createHash } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 7598, 19)); + if (typeof createHash !== "function") throw new Error("createHash unavailable"); + return createHash("md5").update(bytes).digest("base64"); + } catch { + return bytesToBase64(md5Bytes(bytes)); + } +} +function md5Bytes(data) { + const originalBitLength = data.byteLength * 8; + const padLength = (data.byteLength + 8 >>> 6) + 1; + const padded = new Uint8Array(padLength * 64); + padded.set(data); + padded[data.byteLength] = 128; + const lowBits = originalBitLength >>> 0; + const highBits = Math.floor(originalBitLength / 4294967296) >>> 0; + const lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8); + lengthView.setUint32(0, lowBits, true); + lengthView.setUint32(4, highBits, true); + const s = [ + 7, + 12, + 17, + 22, + 7, + 12, + 17, + 22, + 7, + 12, + 17, + 22, + 7, + 12, + 17, + 22, + 5, + 9, + 14, + 20, + 5, + 9, + 14, + 20, + 5, + 9, + 14, + 20, + 5, + 9, + 14, + 20, + 4, + 11, + 16, + 23, + 4, + 11, + 16, + 23, + 4, + 11, + 16, + 23, + 4, + 11, + 16, + 23, + 6, + 10, + 15, + 21, + 6, + 10, + 15, + 21, + 6, + 10, + 15, + 21, + 6, + 10, + 15, + 21 + ]; + const k = new Uint32Array([ + 3614090360, + 3905402710, + 606105819, + 3250441966, + 4118548399, + 1200080426, + 2821735955, + 4249261313, + 1770035416, + 2336552879, + 4294925233, + 2304563134, + 1804603682, + 4254626195, + 2792965006, + 1236535329, + 4129170786, + 3225465664, + 643717713, + 3921069994, + 3593408605, + 38016083, + 3634488961, + 3889429448, + 568446438, + 3275163606, + 4107603335, + 1163531501, + 2850285829, + 4243563512, + 1735328473, + 2368359562, + 4294588738, + 2272392833, + 1839030562, + 4259657740, + 2763975236, + 1272893353, + 4139469664, + 3200236656, + 681279174, + 3936430074, + 3572445317, + 76029189, + 3654602809, + 3873151461, + 530742520, + 3299628645, + 4096336452, + 1126891415, + 2878612391, + 4237533241, + 1700485571, + 2399980690, + 4293915773, + 2240044497, + 1873313359, + 4264355552, + 2734768916, + 1309151649, + 4149444226, + 3174756917, + 718787259, + 3951481745 + ]); + let a0 = 1732584193; + let b0 = 4023233417; + let c0 = 2562383102; + let d0 = 271733878; + const m = new Uint32Array(16); + const view = new DataView(padded.buffer); + for (let block = 0; block < padded.byteLength; block += 64) { + for (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true); + let A = a0; + let B = b0; + let C = c0; + let D = d0; + for (let i = 0; i < 64; i++) { + let f; + let g; + if (i < 16) { + f = B & C | ~B & D; + g = i; + } else if (i < 32) { + f = D & B | ~D & C; + g = (5 * i + 1) % 16; + } else if (i < 48) { + f = B ^ C ^ D; + g = (3 * i + 5) % 16; + } else { + f = C ^ (B | ~D); + g = 7 * i % 16; + } + const temp = D; + D = C; + C = B; + const sum = A + f + (k[i] ?? 0) + (m[g] ?? 0) >>> 0; + const shift = s[i] ?? 0; + const rotated = (sum << shift | sum >>> 32 - shift) >>> 0; + B = B + rotated >>> 0; + A = temp; + } + a0 = a0 + A >>> 0; + b0 = b0 + B >>> 0; + c0 = c0 + C >>> 0; + d0 = d0 + D >>> 0; + } + const out = new Uint8Array(16); + const outView = new DataView(out.buffer); + outView.setUint32(0, a0, true); + outView.setUint32(4, b0, true); + outView.setUint32(8, c0, true); + outView.setUint32(12, d0, true); + return out; +} +const KEY_REDACTED = "[redacted SSE-C key]"; +class EncryptionKey { + /** Encryption mode discriminant. Always `'SSE-C'` for this class. */ + mode = "SSE-C"; + /** Encryption algorithm. B2's S3-compatible API only supports AES-256. */ + algorithm = "AES256"; + /** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */ + customerKey; + /** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */ + customerKeyMd5; + /** + * Internal constructor. Use {@link EncryptionKey.fromBytes} or + * {@link EncryptionKey.fromBase64} instead. + * + * @param customerKey - Base64-encoded 256-bit encryption key. + * @param customerKeyMd5 - Base64-encoded MD5 digest of the key. + * + * @internal + */ + constructor(customerKey, customerKeyMd5) { + this.customerKey = customerKey; + this.customerKeyMd5 = customerKeyMd5; + } + /** + * Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the + * required base64 MD5 digest internally. + * + * @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes. + * + * @returns A safely-wrapped EncryptionKey ready for upload/download. + * + * @throws If the key is not exactly 32 bytes. + */ + static async fromBytes(rawKey) { + if (rawKey.byteLength !== 32) { + throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`); + } + const customerKey = bytesToBase64(rawKey); + const customerKeyMd5 = await md5Base64(rawKey); + return new EncryptionKey(customerKey, customerKeyMd5); + } + /** + * Builds an EncryptionKey from precomputed base64 strings. Use this in + * environments where MD5 must be computed externally (e.g., browsers). + * + * @param customerKey - Base64-encoded 256-bit encryption key. + * @param customerKeyMd5 - Base64-encoded MD5 digest of the key. + * + * @returns A safely-wrapped EncryptionKey ready for upload/download. + */ + static fromBase64(customerKey, customerKeyMd5) { + return new EncryptionKey(customerKey, customerKeyMd5); + } + /** + * Hides the key bytes from `JSON.stringify`. + * + * @returns A redacted shape: same mode and algorithm, but the key and MD5 + * replaced with a placeholder string. + */ + toJSON() { + return { + mode: this.mode, + algorithm: this.algorithm, + customerKey: KEY_REDACTED, + customerKeyMd5: KEY_REDACTED + }; + } + /** + * Hides the key bytes from default `toString()`. + * + * @returns A short opaque label indicating this is an SSE-C key. + */ + toString() { + return `[EncryptionKey SSE-C ${KEY_REDACTED}]`; + } + /** + * Hides the key bytes from Node's `util.inspect` (and therefore `console.log`). + * + * @returns A short opaque label indicating this is an SSE-C key. + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + return this.toString(); + } } -//#endregion +//# sourceMappingURL=encryption.js.map -//# sourceMappingURL=transport.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/index.js - - - - - -//#region src/raw/index.ts -/** -* Low-level 1:1 bindings for every B2 native API endpoint. -* -* Each method on {@link RawClient} maps directly to a single `b2_*` HTTP call -* with fully typed request and response objects. No retry logic, no URL pooling, -* no automatic reauthorization. Use this when you need precise control over -* individual API calls; for most use cases prefer the high-level `B2Client`. -* -* @packageDocumentation -*/ -function normalizeRawRequestOptions(optionsOrSignal, retry) { - if (optionsOrSignal === void 0) return retry === void 0 ? void 0 : { retry }; - if (isAbortSignal(optionsOrSignal)) return { - signal: optionsOrSignal, - ...retry !== void 0 ? { retry } : {} - }; - return retry === void 0 ? optionsOrSignal : { - ...optionsOrSignal, - retry - }; -} -function isAbortSignal(value) { - return typeof value === "object" && value !== null && "aborted" in value && typeof value.addEventListener === "function"; -} -function normalizeCreateKeyRequest(request) { - const { bucketId, ...withoutDeprecatedBucketId } = request; - if (bucketId !== void 0 && withoutDeprecatedBucketId.bucketIds !== void 0) throw new TypeError("createKey accepts either bucketIds or deprecated bucketId, not both"); - if (bucketId === void 0) return withoutDeprecatedBucketId; - return { - ...withoutDeprecatedBucketId, - bucketIds: [bucketId] - }; -} -function singleBucketId(bucketIds) { - return bucketIds?.length === 1 ? bucketIds[0] ?? null : null; -} -function normalizeKeyResponse(key) { - return { - ...key, - bucketId: singleBucketId(key.bucketIds) - }; -} -function normalizeAllowedBuckets(storageApi) { - const allowed = storageApi.allowed; - if (allowed?.buckets !== void 0) return allowed.buckets === null ? null : allowed.buckets.map((bucket) => ({ ...bucket })); - const bucketId = allowed?.bucketId ?? storageApi.bucketId ?? null; - if (bucketId === null) return null; - return [{ - id: bucketId, - name: allowed?.bucketName ?? storageApi.bucketName ?? null - }]; -} -function normalizeAuthorizeAccountResponse(response) { - const storageApi = response.apiInfo.storageApi; - const allowed = storageApi.allowed; - const buckets = normalizeAllowedBuckets(storageApi); - const singleBucket = buckets?.length === 1 ? buckets[0] : void 0; - const bucketId = singleBucket?.id ?? null; - const bucketName = singleBucket?.name ?? null; - const namePrefix = allowed?.namePrefix ?? storageApi.namePrefix ?? null; - const capabilities = allowed?.capabilities ?? storageApi.capabilities ?? []; - const { allowed: _wireAllowed, capabilities: _legacyCapabilities, ...storageApiBase } = storageApi; - return { - ...response, - apiInfo: { - ...response.apiInfo, - storageApi: { - ...storageApiBase, - bucketId, - bucketName, - downloadUrl: storageApi.downloadUrl, - infoType: "storageApi", - namePrefix, - allowed: { - ...allowed ?? {}, - capabilities, - buckets, - bucketId, - bucketName, - namePrefix - } - } - } - }; -} -function uploadResponseBodyError(err, signal) { - if (signal?.aborted === true) throw signal.reason ?? new DOMException("Aborted", "AbortError"); - return new UploadResponseBodyError(err instanceof Error ? err.message : "Upload response body could not be read", { cause: err }); -} -/** -* Low-level client providing 1:1 bindings to all B2 native API endpoints. -* -* Each method maps directly to a single B2 API call. Most methods accept -* `(apiUrl, authToken, request)` and return the JSON response. Upload and -* download methods accept endpoint-specific parameters instead. -*/ -var RawClient = class { - /** @internal */ - transport; - /** - * Creates a new RawClient with the given transport. - * @param options - The constructor configuration. - */ - constructor(options) { - this.transport = options.transport; - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}. - * @param applicationKeyId - The application key ID for authentication. - * @param applicationKey - The application key secret. - * @param realmUrl - The B2 realm URL to authenticate against. - * - * @returns The authorization response with API URLs and credentials. - */ - async authorizeAccount(applicationKeyId, applicationKey, realmUrl = "https://api.backblazeb2.com") { - assertSecureRealmUrl(realmUrl); - return normalizeAuthorizeAccountResponse(await (await this.transport.send({ - url: `${realmUrl}/b2api/v4/b2_authorize_account`, - method: "GET", - headers: { Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}` } - })).json()); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The created bucket metadata. - */ - async createBucket(apiUrl, authToken, request) { - return this.postJson(apiUrl, authToken, "b2_create_bucket", request); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The deleted bucket metadata. - */ - async deleteBucket(apiUrl, authToken, request) { - return this.postJson(apiUrl, authToken, "b2_delete_bucket", request); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The list of matching buckets. - */ - async listBuckets(apiUrl, authToken, request) { - return this.postJson(apiUrl, authToken, "b2_list_buckets", request); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The updated bucket metadata. - */ - async updateBucket(apiUrl, authToken, request) { - return this.postJson(apiUrl, authToken, "b2_update_bucket", request); - } - /** - * Implementation for both upload URL request-control signatures. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param optionsOrSignal - Options bag or legacy abort signal. - * @param retry - Optional legacy per-request retry override. - * - * @returns The upload URL and authorization token. - */ - async getUploadUrl(apiUrl, authToken, request, optionsOrSignal, retry) { - return this.postJson(apiUrl, authToken, "b2_get_upload_url", request, normalizeRawRequestOptions(optionsOrSignal, retry)); - } - /** - * Implementation for both upload-file request-control signatures. - * @param uploadUrl - The upload endpoint URL. - * @param headers - The request headers including authorization and content metadata. - * @param body - The file data to upload. - * @param optionsOrSignal - Options bag or legacy abort signal. - * @param retry - Optional legacy per-request retry override. - * - * @returns The uploaded file version metadata. - */ - async uploadFile(uploadUrl, headers, body, optionsOrSignal, retry) { - const options = normalizeRawRequestOptions(optionsOrSignal, retry); - const reqHeaders = { - Authorization: headers.authorization, - "X-Bz-File-Name": encoding_encodeFileName(headers.fileName), - "Content-Type": headers.contentType, - "Content-Length": String(headers.contentLength), - "X-Bz-Content-Sha1": headers.contentSha1, - ...buildFileInfoHeaders(headers.fileInfo) - }; - if (headers.lastModifiedMillis !== void 0) reqHeaders["X-Bz-Info-src_last_modified_millis"] = String(headers.lastModifiedMillis); - if (headers.contentDisposition) reqHeaders["X-Bz-Info-b2-content-disposition"] = headers.contentDisposition; - if (headers.contentLanguage) reqHeaders["X-Bz-Info-b2-content-language"] = headers.contentLanguage; - if (headers.expires) reqHeaders["X-Bz-Info-b2-expires"] = headers.expires; - if (headers.cacheControl) reqHeaders["X-Bz-Info-b2-cache-control"] = headers.cacheControl; - if (headers.contentEncoding) reqHeaders["X-Bz-Info-b2-content-encoding"] = headers.contentEncoding; - applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption); - applyRetentionHeaders(reqHeaders, headers.fileRetention); - applyLegalHoldHeader(reqHeaders, headers.legalHold); - const response = await this.transport.send({ - url: uploadUrl, - method: "POST", - headers: reqHeaders, - body, - ...options?.signal !== void 0 ? { signal: options.signal } : {}, - ...options?.retry !== void 0 ? { retry: options.retry } : {} - }); - try { - return normalizeFileVersionSha1(await response.json()); - } catch (err) { - throw uploadResponseBodyError(err, options?.signal); - } - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional request controls such as an abort signal. - * - * @returns The list of file names and optional continuation token. - */ - async listFileNames(apiUrl, authToken, request, options) { - return normalizeFileVersionListSha1(await this.postJson(apiUrl, authToken, "b2_list_file_names", request, options)); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional request controls such as an abort signal. - * - * @returns The list of file versions and optional continuation token. - */ - async listFileVersions(apiUrl, authToken, request, options) { - return normalizeFileVersionListSha1(await this.postJson(apiUrl, authToken, "b2_list_file_versions", request, options)); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The file version metadata. - */ - async getFileInfo(apiUrl, authToken, request) { - return normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, "b2_get_file_info", request)); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional request controls such as an abort signal. - * - * @returns The hidden file version metadata. - */ - async hideFile(apiUrl, authToken, request, options) { - return normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, "b2_hide_file", request, options)); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional request controls such as an abort signal. - * - * @returns The deleted file version identifier. - */ - async deleteFileVersion(apiUrl, authToken, request, options) { - return this.postJson(apiUrl, authToken, "b2_delete_file_version", request, options); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional request controls such as an abort signal. - * - * @returns The copied file version metadata. - */ - async copyFile(apiUrl, authToken, request, options) { - return normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, "b2_copy_file", request, options)); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional abort and retry controls. - * - * @returns The copied part metadata. - */ - async copyPart(apiUrl, authToken, request, options) { - return this.postJson(apiUrl, authToken, "b2_copy_part", request, options); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional abort and retry controls. - * - * @returns The started large file metadata with file ID. - */ - async startLargeFile(apiUrl, authToken, request, options) { - return this.postJson(apiUrl, authToken, "b2_start_large_file", request, options); - } - /** - * Implementation for both upload part URL request-control signatures. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param optionsOrSignal - Options bag or legacy abort signal. - * @param retry - Optional legacy per-request retry override. - * - * @returns The upload part URL and authorization token. - */ - async getUploadPartUrl(apiUrl, authToken, request, optionsOrSignal, retry) { - return this.postJson(apiUrl, authToken, "b2_get_upload_part_url", request, normalizeRawRequestOptions(optionsOrSignal, retry)); - } - /** - * Implementation for both upload-part request-control signatures. - * @param uploadUrl - The upload endpoint URL. - * @param headers - The request headers including authorization and content metadata. - * @param body - The file data to upload. - * @param optionsOrSignal - Options bag or legacy abort signal. - * @param retry - Optional legacy per-request retry override. - * - * @returns The uploaded part metadata. - */ - async uploadPart(uploadUrl, headers, body, optionsOrSignal, retry) { - const options = normalizeRawRequestOptions(optionsOrSignal, retry); - const reqHeaders = { - Authorization: headers.authorization, - "X-Bz-Part-Number": String(headers.partNumber), - "Content-Length": String(headers.contentLength), - "X-Bz-Content-Sha1": headers.contentSha1 - }; - applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption); - const response = await this.transport.send({ - url: uploadUrl, - method: "POST", - headers: reqHeaders, - body, - ...options?.signal !== void 0 ? { signal: options.signal } : {}, - ...options?.retry !== void 0 ? { retry: options.retry } : {} - }); - try { - return await response.json(); - } catch (err) { - throw uploadResponseBodyError(err, options?.signal); - } - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional abort and retry controls. - * - * @returns The completed file version metadata. - */ - async finishLargeFile(apiUrl, authToken, request, options) { - const response = await this.transport.send({ - url: `${apiUrl}/b2api/v3/b2_finish_large_file`, - method: "POST", - headers: { - Authorization: authToken, - "Content-Type": "application/json" - }, - body: JSON.stringify(request), - ...options?.signal !== void 0 ? { signal: options.signal } : {}, - ...options?.retry !== void 0 ? { retry: options.retry } : {} - }); - let fileVersion; - try { - fileVersion = await response.json(); - } catch (err) { - throw new FinishLargeFileResponseBodyError(err instanceof Error ? err.message : "Finish large file response body could not be read", { - cause: err, - fileId: request.fileId - }); - } - return normalizeFileVersionSha1(fileVersion); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional request controls such as cancellation and retry overrides. - * - * @returns The cancelled large file metadata. - */ - async cancelLargeFile(apiUrl, authToken, request, options) { - return this.postJson(apiUrl, authToken, "b2_cancel_large_file", request, options); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional request controls such as cancellation and retry. - * - * @returns The list of unfinished large files and optional continuation token. - */ - async listUnfinishedLargeFiles(apiUrl, authToken, request, options) { - return this.postJson(apiUrl, authToken, "b2_list_unfinished_large_files", request, options); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * @param options - Optional request controls such as cancellation and retry. - * - * @returns The list of uploaded parts and optional continuation token. - */ - async listParts(apiUrl, authToken, request, options) { - return this.postJson(apiUrl, authToken, "b2_list_parts", request, options); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}. - * @param downloadUrl - The B2 download base URL. - * @param authToken - The authorization token. - * @param fileId - The unique identifier of the file to download. - * @param options - Optional download parameters for range requests and cancellation. - * - * @returns The response headers, streaming body, and HTTP status code. - */ - async downloadFileById(downloadUrl, authToken, fileId, options) { - const headers = buildDownloadRequestHeaders(authToken, options); - const url = appendDownloadOverrides(`${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`, options); - const response = await this.transport.send({ - url, - method: options?.method ?? "GET", - headers, - ...options?.signal !== void 0 ? { signal: options.signal } : {} - }); - return { - headers: response.headers, - body: response.body, - status: response.status - }; - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}. - * @param downloadUrl - The B2 download base URL. - * @param authToken - The authorization token. - * @param bucketName - The name of the bucket containing the file. - * @param fileName - The name of the file to download. - * @param options - Optional download parameters for range requests and cancellation. - * - * @returns The response headers, streaming body, and HTTP status code. - */ - async downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) { - const headers = buildDownloadRequestHeaders(authToken, options); - const url = appendDownloadOverrides(`${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encoding_encodeFileName(fileName)}`, options); - const response = await this.transport.send({ - url, - method: options?.method ?? "GET", - headers, - ...options?.signal !== void 0 ? { signal: options.signal } : {} - }); - return { - headers: response.headers, - body: response.body, - status: response.status - }; - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The current session authorization token. - * @param request - The API request parameters. - * - * @returns The download authorization token for the specified file prefix. - */ - async getDownloadAuthorization(apiUrl, authToken, request) { - return this.postJson(apiUrl, authToken, "b2_get_download_authorization", request); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The newly created application key with secret. - */ - async createKey(apiUrl, authToken, request) { - return normalizeKeyResponse(await this.postJson(apiUrl, authToken, "b2_create_key", normalizeCreateKeyRequest(request), void 0, "v4")); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The list of application keys and optional continuation token. - */ - async listKeys(apiUrl, authToken, request) { - const response = await this.postJson(apiUrl, authToken, "b2_list_keys", request, void 0, "v4"); - return { - ...response, - keys: response.keys.map((key) => normalizeKeyResponse(key)) - }; - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The deleted application key metadata. - */ - async deleteKey(apiUrl, authToken, request) { - return normalizeKeyResponse(await this.postJson(apiUrl, authToken, "b2_delete_key", request, void 0, "v4")); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The updated file retention settings. - */ - async updateFileRetention(apiUrl, authToken, request) { - return this.postJson(apiUrl, authToken, "b2_update_file_retention", request); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The updated file legal hold status. - */ - async updateFileLegalHold(apiUrl, authToken, request) { - return this.postJson(apiUrl, authToken, "b2_update_file_legal_hold", request); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The configured event notification rules for the specified bucket. - */ - async getBucketNotificationRules(apiUrl, authToken, request) { - return this.postJson(apiUrl, authToken, "b2_get_bucket_notification_rules", request); - } - /** - * Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param request - The API request parameters. - * - * @returns The updated bucket notification rules. - */ - async setBucketNotificationRules(apiUrl, authToken, request) { - return this.postJson(apiUrl, authToken, "b2_set_bucket_notification_rules", request); - } - /** - * Sends a JSON POST request to the specified B2 API endpoint. - * @param apiUrl - The B2 API base URL. - * @param authToken - The authorization token. - * @param endpoint - The B2 API endpoint name. - * @param body - The JSON request body. - * @param options - Optional abort and per-request retry settings. - * @param apiVersion - B2 Native API version segment for this endpoint. - * - * @returns The parsed JSON response. - */ - async postJson(apiUrl, authToken, endpoint, body, options, apiVersion = "v3") { - return (await this.transport.send({ - url: `${apiUrl}/b2api/${apiVersion}/${endpoint}`, - method: "POST", - headers: { - Authorization: authToken, - "Content-Type": "application/json" - }, - body: JSON.stringify(body), - ...options?.signal !== void 0 ? { signal: options.signal } : {}, - ...options?.retry !== void 0 ? { retry: options.retry } : {} - })).json(); - } -}; -/** -* Applies server-side encryption headers to the request. -* @param headers - The mutable headers object to populate. -* @param encryption - The encryption settings, or undefined to skip. -*/ +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/index.js + + + + +class RawClient { + /** @internal */ + transport; + /** + * Creates a new RawClient with the given transport. + * @param options - The constructor configuration. + */ + constructor(options) { + this.transport = options.transport; + } + // --- Auth --- + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}. + * @param applicationKeyId - The application key ID for authentication. + * @param applicationKey - The application key secret. + * @param realmUrl - The B2 realm URL to authenticate against. + * + * @returns The authorization response with API URLs and credentials. + */ + async authorizeAccount(applicationKeyId, applicationKey, realmUrl = "https://api.backblazeb2.com") { + const response = await this.transport.send({ + url: `${realmUrl}/b2api/v3/b2_authorize_account`, + method: "GET", + headers: { + Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}` + } + }); + return response.json(); + } + // --- Buckets --- + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The created bucket metadata. + */ + async createBucket(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_create_bucket", request); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The deleted bucket metadata. + */ + async deleteBucket(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_delete_bucket", request); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The list of matching buckets. + */ + async listBuckets(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_list_buckets", request); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The updated bucket metadata. + */ + async updateBucket(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_update_bucket", request); + } + // --- Files --- + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-url | b2_get_upload_url}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The upload URL and authorization token. + */ + async getUploadUrl(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_get_upload_url", request); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-upload-file | b2_upload_file}. + * + * Unlike most methods, this posts directly to the `uploadUrl` obtained + * from {@link getUploadUrl} rather than the API URL. + * @param uploadUrl - The upload endpoint URL. + * @param headers - The request headers including authorization and content metadata. + * @param body - The file data to upload. + * @param signal - An optional abort signal for cancellation. + * + * @returns The uploaded file version metadata. + */ + async uploadFile(uploadUrl, headers, body, signal) { + const reqHeaders = { + Authorization: headers.authorization, + "X-Bz-File-Name": encodeFileName(headers.fileName), + "Content-Type": headers.contentType, + "Content-Length": String(headers.contentLength), + "X-Bz-Content-Sha1": headers.contentSha1, + ...buildFileInfoHeaders(headers.fileInfo) + }; + if (headers.lastModifiedMillis !== void 0) { + reqHeaders["X-Bz-Info-src_last_modified_millis"] = String(headers.lastModifiedMillis); + } + if (headers.contentDisposition) { + reqHeaders["X-Bz-Info-b2-content-disposition"] = headers.contentDisposition; + } + if (headers.contentLanguage) { + reqHeaders["X-Bz-Info-b2-content-language"] = headers.contentLanguage; + } + if (headers.expires) { + reqHeaders["X-Bz-Info-b2-expires"] = headers.expires; + } + if (headers.cacheControl) { + reqHeaders["X-Bz-Info-b2-cache-control"] = headers.cacheControl; + } + if (headers.contentEncoding) { + reqHeaders["X-Bz-Info-b2-content-encoding"] = headers.contentEncoding; + } + applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption); + applyRetentionHeaders(reqHeaders, headers.fileRetention); + applyLegalHoldHeader(reqHeaders, headers.legalHold); + const response = await this.transport.send({ + url: uploadUrl, + method: "POST", + headers: reqHeaders, + body, + ...signal !== void 0 ? { signal } : {} + }); + return normalizeFileVersionSha1(await response.json()); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The list of file names and optional continuation token. + */ + async listFileNames(apiUrl, authToken, request) { + return normalizeFileVersionListSha1( + await this.postJson(apiUrl, authToken, "b2_list_file_names", request) + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The list of file versions and optional continuation token. + */ + async listFileVersions(apiUrl, authToken, request) { + return normalizeFileVersionListSha1( + await this.postJson( + apiUrl, + authToken, + "b2_list_file_versions", + request + ) + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The file version metadata. + */ + async getFileInfo(apiUrl, authToken, request) { + return normalizeFileVersionSha1( + await this.postJson(apiUrl, authToken, "b2_get_file_info", request) + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The hidden file version metadata. + */ + async hideFile(apiUrl, authToken, request) { + return normalizeFileVersionSha1( + await this.postJson(apiUrl, authToken, "b2_hide_file", request) + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The deleted file version identifier. + */ + async deleteFileVersion(apiUrl, authToken, request) { + return this.postJson( + apiUrl, + authToken, + "b2_delete_file_version", + request + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The copied file version metadata. + */ + async copyFile(apiUrl, authToken, request) { + return normalizeFileVersionSha1( + await this.postJson(apiUrl, authToken, "b2_copy_file", request) + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The copied part metadata. + */ + async copyPart(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_copy_part", request); + } + // --- Large Files --- + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The started large file metadata with file ID. + */ + async startLargeFile(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_start_large_file", request); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-part-url | b2_get_upload_part_url}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The upload part URL and authorization token. + */ + async getUploadPartUrl(apiUrl, authToken, request) { + return this.postJson( + apiUrl, + authToken, + "b2_get_upload_part_url", + request + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-upload-part | b2_upload_part}. + * + * Posts directly to the `uploadUrl` obtained from {@link getUploadPartUrl} + * rather than the API URL. + * @param uploadUrl - The upload endpoint URL. + * @param headers - The request headers including authorization and content metadata. + * @param body - The file data to upload. + * @param signal - An optional abort signal for cancellation. + * + * @returns The uploaded part metadata. + */ + async uploadPart(uploadUrl, headers, body, signal) { + const reqHeaders = { + Authorization: headers.authorization, + "X-Bz-Part-Number": String(headers.partNumber), + "Content-Length": String(headers.contentLength), + "X-Bz-Content-Sha1": headers.contentSha1 + }; + applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption); + const response = await this.transport.send({ + url: uploadUrl, + method: "POST", + headers: reqHeaders, + body, + ...signal !== void 0 ? { signal } : {} + }); + return response.json(); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The completed file version metadata. + */ + async finishLargeFile(apiUrl, authToken, request) { + return normalizeFileVersionSha1( + await this.postJson(apiUrl, authToken, "b2_finish_large_file", request) + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The cancelled large file metadata. + */ + async cancelLargeFile(apiUrl, authToken, request) { + return this.postJson( + apiUrl, + authToken, + "b2_cancel_large_file", + request + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The list of unfinished large files and optional continuation token. + */ + async listUnfinishedLargeFiles(apiUrl, authToken, request) { + return this.postJson( + apiUrl, + authToken, + "b2_list_unfinished_large_files", + request + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The list of uploaded parts and optional continuation token. + */ + async listParts(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_list_parts", request); + } + // --- Downloads --- + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}. + * @param downloadUrl - The B2 download base URL. + * @param authToken - The authorization token. + * @param fileId - The unique identifier of the file to download. + * @param options - Optional download parameters for range requests and cancellation. + * + * @returns The response headers, streaming body, and HTTP status code. + */ + async downloadFileById(downloadUrl, authToken, fileId, options) { + const headers = buildDownloadRequestHeaders(authToken, options); + const url = appendDownloadOverrides( + `${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`, + options + ); + const response = await this.transport.send({ + url, + method: options?.method ?? "GET", + headers, + ...options?.signal !== void 0 ? { signal: options.signal } : {} + }); + return { headers: response.headers, body: response.body, status: response.status }; + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}. + * @param downloadUrl - The B2 download base URL. + * @param authToken - The authorization token. + * @param bucketName - The name of the bucket containing the file. + * @param fileName - The name of the file to download. + * @param options - Optional download parameters for range requests and cancellation. + * + * @returns The response headers, streaming body, and HTTP status code. + */ + async downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) { + const headers = buildDownloadRequestHeaders(authToken, options); + const url = appendDownloadOverrides( + `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileName(fileName)}`, + options + ); + const response = await this.transport.send({ + url, + method: options?.method ?? "GET", + headers, + ...options?.signal !== void 0 ? { signal: options.signal } : {} + }); + return { headers: response.headers, body: response.body, status: response.status }; + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The current session authorization token. + * @param request - The API request parameters. + * + * @returns The download authorization token for the specified file prefix. + */ + async getDownloadAuthorization(apiUrl, authToken, request) { + return this.postJson( + apiUrl, + authToken, + "b2_get_download_authorization", + request + ); + } + // --- Keys --- + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The newly created application key with secret. + */ + async createKey(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_create_key", request); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The list of application keys and optional continuation token. + */ + async listKeys(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_list_keys", request); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The deleted application key metadata. + */ + async deleteKey(apiUrl, authToken, request) { + return this.postJson(apiUrl, authToken, "b2_delete_key", request); + } + // --- Retention / Legal Hold --- + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The updated file retention settings. + */ + async updateFileRetention(apiUrl, authToken, request) { + return this.postJson( + apiUrl, + authToken, + "b2_update_file_retention", + request + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The updated file legal hold status. + */ + async updateFileLegalHold(apiUrl, authToken, request) { + return this.postJson( + apiUrl, + authToken, + "b2_update_file_legal_hold", + request + ); + } + // --- Notifications --- + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The configured event notification rules for the specified bucket. + */ + async getBucketNotificationRules(apiUrl, authToken, request) { + return this.postJson( + apiUrl, + authToken, + "b2_get_bucket_notification_rules", + request + ); + } + /** + * Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param request - The API request parameters. + * + * @returns The updated bucket notification rules. + */ + async setBucketNotificationRules(apiUrl, authToken, request) { + return this.postJson( + apiUrl, + authToken, + "b2_set_bucket_notification_rules", + request + ); + } + // --- Internal --- + /** + * Sends a JSON POST request to the specified B2 API endpoint. + * @param apiUrl - The B2 API base URL. + * @param authToken - The authorization token. + * @param endpoint - The B2 API endpoint name. + * @param body - The JSON request body. + * + * @returns The parsed JSON response. + */ + async postJson(apiUrl, authToken, endpoint, body) { + const response = await this.transport.send({ + url: `${apiUrl}/b2api/v3/${endpoint}`, + method: "POST", + headers: { + Authorization: authToken, + "Content-Type": "application/json" + }, + body: JSON.stringify(body) + }); + return response.json(); + } +} function applyEncryptionHeaders(headers, encryption) { - if (!encryption || encryption.mode === EncryptionMode.None) return; - if (encryption.mode === EncryptionMode.SseB2) headers["X-Bz-Server-Side-Encryption"] = EncryptionAlgorithm.Aes256; - else if (encryption.mode === EncryptionMode.SseC) { - headers["X-Bz-Server-Side-Encryption-Customer-Algorithm"] = EncryptionAlgorithm.Aes256; - headers["X-Bz-Server-Side-Encryption-Customer-Key"] = encryption.customerKey; - headers["X-Bz-Server-Side-Encryption-Customer-Key-Md5"] = encryption.customerKeyMd5; - } -} -var DOWNLOAD_OVERRIDE_PARAMS = [ - "b2ContentDisposition", - "b2ContentLanguage", - "b2ContentEncoding", - "b2ContentType", - "b2CacheControl", - "b2Expires" + if (!encryption || encryption.mode === EncryptionMode.None) return; + if (encryption.mode === EncryptionMode.SseB2) { + headers["X-Bz-Server-Side-Encryption"] = EncryptionAlgorithm.Aes256; + } else if (encryption.mode === EncryptionMode.SseC) { + headers["X-Bz-Server-Side-Encryption-Customer-Algorithm"] = EncryptionAlgorithm.Aes256; + headers["X-Bz-Server-Side-Encryption-Customer-Key"] = encryption.customerKey; + headers["X-Bz-Server-Side-Encryption-Customer-Key-Md5"] = encryption.customerKeyMd5; + } +} +const DOWNLOAD_OVERRIDE_PARAMS = [ + "b2ContentDisposition", + "b2ContentLanguage", + "b2ContentEncoding", + "b2ContentType", + "b2CacheControl", + "b2Expires" ]; -/** -* Builds the HTTP request headers for a download: Authorization, optional -* Range, and optional SSE-C decryption headers. -* -* @param authToken - The B2 session authorization token. -* @param options - Caller-supplied download options. -* -* @returns The header map to send with the request. -*/ function buildDownloadRequestHeaders(authToken, options) { - const headers = { Authorization: authToken }; - if (options?.range) headers["Range"] = options.range; - if (options?.serverSideEncryption) applyEncryptionHeaders(headers, { - mode: EncryptionMode.SseC, - ...options.serverSideEncryption - }); - return headers; -} -/** -* Appends the documented `b2Content*` response-header overrides to a download -* URL as query-string parameters. B2 echoes the values into the response -* headers so callers can control content type, disposition, and caching. -* -* @param url - The base download URL. -* @param options - Caller-supplied download options. -* -* @returns The URL with any override parameters appended. -*/ + const headers = { Authorization: authToken }; + if (options?.range) headers["Range"] = options.range; + if (options?.serverSideEncryption) { + applyEncryptionHeaders(headers, { + mode: EncryptionMode.SseC, + ...options.serverSideEncryption + }); + } + return headers; +} function appendDownloadOverrides(url, options) { - if (!options) return url; - const params = []; - for (const key of DOWNLOAD_OVERRIDE_PARAMS) { - const value = options[key]; - if (value !== void 0) params.push(`${key}=${encodeURIComponent(value)}`); - } - if (params.length === 0) return url; - return `${url}${url.includes("?") ? "&" : "?"}${params.join("&")}`; -} -/** -* Applies file retention headers to the request. -* @param headers - The mutable headers object to populate. -* @param retention - The retention settings, or undefined to skip. -*/ + if (!options) return url; + const params = []; + for (const key of DOWNLOAD_OVERRIDE_PARAMS) { + const value = options[key]; + if (value !== void 0) { + params.push(`${key}=${encodeURIComponent(value)}`); + } + } + if (params.length === 0) return url; + const separator = url.includes("?") ? "&" : "?"; + return `${url}${separator}${params.join("&")}`; +} function applyRetentionHeaders(headers, retention) { - if (!retention) return; - if (retention.mode) headers["X-Bz-File-Retention-Mode"] = retention.mode; - if (retention.retainUntilTimestamp) headers["X-Bz-File-Retention-Retain-Until-Timestamp"] = String(retention.retainUntilTimestamp); + if (!retention) return; + if (retention.mode) { + headers["X-Bz-File-Retention-Mode"] = retention.mode; + } + if (retention.retainUntilTimestamp) { + headers["X-Bz-File-Retention-Retain-Until-Timestamp"] = String(retention.retainUntilTimestamp); + } } -/** -* Applies the legal hold header to the request. -* @param headers - The mutable headers object to populate. -* @param legalHold - The legal hold value, or undefined to skip. -*/ function applyLegalHoldHeader(headers, legalHold) { - if (!legalHold) return; - headers["X-Bz-File-Legal-Hold"] = legalHold; + if (!legalHold) return; + headers["X-Bz-File-Legal-Hold"] = legalHold; } -//#endregion - //# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/client.js - - - - - - - - - - -//#region src/client.ts -/** -* High-level B2 client providing ergonomic access to buckets, files, and keys. -* -* @example -* ```ts -* const client = new B2Client({ -* applicationKeyId: process.env.B2_APPLICATION_KEY_ID, -* applicationKey: process.env.B2_APPLICATION_KEY, -* }) -* await client.authorize() -* const buckets = await client.listBuckets() -* ``` -*/ -var B2Client = class { - /** Low-level client for direct B2 API calls. */ - raw; - /** Authorization state storage (tokens, URLs, capabilities). */ - accountInfo; - /** - * SSRF allow-list applied by the default {@link FetchTransport}. `null` when - * a custom transport was supplied — in that case the SDK does not own the - * guard. Locked down by {@link B2Client.authorize}. - */ - urlGuard; - applicationKeyId; - applicationKey; - realmUrl; - userAllowedSuffixes; - resolvedUploadRetryOptions; - /** - * Creates a new B2Client. Call {@link authorize} before making API requests. - * @param options - Configuration including credentials, realm, and transport settings. - */ - constructor(options) { - this.applicationKeyId = options.applicationKeyId; - this.applicationKey = options.applicationKey; - this.realmUrl = getRealmUrl(options.realm ?? "production"); - this.accountInfo = options.accountInfo ?? new InMemoryAccountInfo(); - bindAccountInfoAuthContext(this.accountInfo, this.realmUrl, this.applicationKeyId); - this.userAllowedSuffixes = options.allowedHostSuffixes; - this.resolvedUploadRetryOptions = { - ...DEFAULT_RETRY_OPTIONS, - ...options.retry - }; - let baseTransport; - if (options.transport !== void 0) { - baseTransport = options.transport; - this.urlGuard = null; - } else { - const urlGuard = new UrlGuard(); - baseTransport = new FetchTransport({ - urlGuard, - ...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {}, - ...options.followSameOriginRedirects !== void 0 ? { followSameOriginRedirects: options.followSameOriginRedirects } : {} - }); - this.urlGuard = urlGuard; - } - const retryTransport = new RetryTransport({ - transport: baseTransport, - retry: this.resolvedUploadRetryOptions, - onReauth: () => this.reauthorize() - }); - const cachedAuth = this.accountInfo.getAuth(); - if (cachedAuth !== null) this.lockUrlGuard(cachedAuth); - this.raw = new RawClient({ transport: retryTransport }); - } - /** - * Authenticates with B2 and stores the authorization state. Must be called before other methods. - * - * @returns The authorization response containing tokens, URLs, and capabilities. - */ - async authorize() { - const auth = await this.raw.authorizeAccount(this.applicationKeyId, this.applicationKey, this.realmUrl); - this.accountInfo.setAuth(auth); - this.lockUrlGuard(auth); - return auth; - } - lockUrlGuard(auth) { - if (this.urlGuard !== null) { - const derived = deriveAllowedSuffixes(auth.apiInfo.storageApi); - const merged = this.userAllowedSuffixes !== void 0 ? this.userAllowedSuffixes.length === 0 ? [] : Array.from(/* @__PURE__ */ new Set([...derived, ...this.userAllowedSuffixes])) : derived; - this.urlGuard.setAllowedSuffixes(merged); - } - } - /** - * Refresh credentials after a 401. Returns the fresh auth token so - * {@link RetryTransport} can rewrite the in-flight request's - * Authorization header before retrying. - * - * @returns The fresh authorization token. - */ - async reauthorize() { - this.accountInfo.clear(); - return (await this.authorize()).authorizationToken; - } - /** - * Creates a new B2 bucket. - * @param options - Bucket configuration including name, type, and optional settings. - * - * @returns A {@link Bucket} handle for the newly created bucket. - */ - async createBucket(options) { - const request = { - accountId: accountId(this.accountInfo.getAccountId()), - ...options - }; - const info = await this.raw.createBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), request); - return new Bucket(this, info, this.resolvedUploadRetryOptions); - } - /** - * Lists buckets in the account, optionally filtered by ID, name, or type. - * @param options - Optional filters for bucket ID, name, or type. - * - * @returns An array of {@link Bucket} handles. - */ - async listBuckets(options) { - return (await this.raw.listBuckets(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { - accountId: accountId(this.accountInfo.getAccountId()), - ...options - })).buckets.map((info) => new Bucket(this, info, this.resolvedUploadRetryOptions)); - } - /** - * Looks up a single bucket by name. - * @param bucketName - The name of the bucket to find. - * - * @returns The {@link Bucket} handle, or `null` if not found. - */ - async getBucket(bucketName) { - const filteredMatch = (await this.listBuckets({ bucketName }))[0]; - if (filteredMatch !== void 0) return filteredMatch; - return (await this.listBuckets()).find((bucket) => bucket.name === bucketName) ?? null; - } - /** - * Permanently deletes a bucket. The bucket must be empty. - * @param id - The unique identifier of the bucket to delete. - * - * @returns The deleted bucket metadata. - */ - async deleteBucket(id) { - return this.raw.deleteBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { - accountId: accountId(this.accountInfo.getAccountId()), - bucketId: id - }); - } - /** - * Creates a new application key with the specified capabilities. - * @param options - Key configuration including capabilities, name, and optional restrictions. - * - * @returns The full key including the secret (only returned at creation time). - */ - async createKey(options) { - return this.raw.createKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { - accountId: accountId(this.accountInfo.getAccountId()), - ...options - }); - } - /** - * Lists application keys in the account. - * @param options - Optional pagination settings. - * - * @returns A page of application keys with an optional continuation token. - */ - async listKeys(options) { - return this.raw.listKeys(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { - accountId: accountId(this.accountInfo.getAccountId()), - ...options?.pageSize !== void 0 ? { maxKeyCount: options.pageSize } : {}, - ...options?.startApplicationKeyId !== void 0 ? { startApplicationKeyId: options.startApplicationKeyId } : {} - }); - } - /** - * Async iterator that yields every application key on the account, - * automatically handling pagination via `listKeys`. - * - * @param options - Pagination + abort options. `pageSize` is forwarded - * to `maxKeyCount`; the default is 1000. - * - * @returns An async iterable of {@link ApplicationKey} entries. - * - * @example - * ```ts - * for await (const key of client.paginateKeys()) { - * console.log(key.keyName, key.capabilities) - * } - * ``` - */ - paginateKeys(options) { - return paginateItems(async (cursor) => { - const resp = await this.listKeys({ - pageSize: options?.pageSize ?? 1e3, - ...cursor !== void 0 ? { startApplicationKeyId: cursor } : {} - }); - return { - page: resp, - nextCursor: resp.nextApplicationKeyId ?? void 0 - }; - }, (page) => page.keys, options?.signal); - } - /** - * Permanently deletes an application key. - * @param applicationKeyId - The unique identifier of the key to delete. - * - * @returns The deleted application key metadata. - */ - async deleteKey(applicationKeyId) { - return this.raw.deleteKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { applicationKeyId }); - } - /** - * Checks whether the authorized application key carries every capability in - * `needed`. Returns the missing capabilities so callers can fail fast with a - * clear error instead of a generic 401/403 from the server. - * - * @param needed - The capabilities required by the planned operation. - * - * @returns An object with `ok: true` when every needed capability is - * present, otherwise `{ ok: false, missing: [...] }`. - * - * @throws If {@link authorize} has not been called yet. - */ - hasCapabilities(needed) { - const auth = this.accountInfo.getAuth(); - if (!auth) throw new Error("Not authorized. Call authorize() first."); - const available = new Set(auth.apiInfo.storageApi.allowed.capabilities); - const missing = needed.filter((cap) => !available.has(cap)); - return { - ok: missing.length === 0, - missing - }; - } -}; -function bindAccountInfoAuthContext(accountInfo, realmUrl, applicationKeyId) { - accountInfo.setApplicationKeyId?.(applicationKeyId); - accountInfo.setRealmUrl?.(realmUrl); -} -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/client.js + + + + + + + + + +class B2Client { + /** Low-level client for direct B2 API calls. */ + raw; + /** Authorization state storage (tokens, URLs, capabilities). */ + accountInfo; + /** + * SSRF allow-list applied by the default {@link FetchTransport}. `null` when + * a custom transport was supplied — in that case the SDK does not own the + * guard. Locked down by {@link B2Client.authorize}. + */ + urlGuard; + applicationKeyId; + applicationKey; + realmUrl; + userAllowedSuffixes; + /** + * Creates a new B2Client. Call {@link authorize} before making API requests. + * @param options - Configuration including credentials, realm, and transport settings. + */ + constructor(options) { + this.applicationKeyId = options.applicationKeyId; + this.applicationKey = options.applicationKey; + this.realmUrl = getRealmUrl(options.realm ?? "production"); + this.accountInfo = options.accountInfo ?? new InMemoryAccountInfo(); + this.userAllowedSuffixes = options.allowedHostSuffixes; + let baseTransport; + if (options.transport !== void 0) { + baseTransport = options.transport; + this.urlGuard = null; + } else { + const urlGuard = new UrlGuard(); + baseTransport = new FetchTransport({ + urlGuard, + ...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {} + }); + this.urlGuard = urlGuard; + } + const retryTransport = new RetryTransport({ + transport: baseTransport, + ...options.retry !== void 0 ? { retry: options.retry } : {}, + onReauth: () => this.reauthorize() + }); + this.raw = new RawClient({ transport: retryTransport }); + } + /** + * Authenticates with B2 and stores the authorization state. Must be called before other methods. + * + * @returns The authorization response containing tokens, URLs, and capabilities. + */ + async authorize() { + const auth = await this.raw.authorizeAccount( + this.applicationKeyId, + this.applicationKey, + this.realmUrl + ); + this.accountInfo.setAuth(auth); + if (this.urlGuard !== null) { + const derived = deriveAllowedSuffixes(auth.apiInfo.storageApi); + const merged = this.userAllowedSuffixes !== void 0 ? Array.from(/* @__PURE__ */ new Set([...derived, ...this.userAllowedSuffixes])) : derived; + this.urlGuard.setAllowedSuffixes(merged); + } + return auth; + } + /** + * Refresh credentials after a 401. Returns the fresh auth token so + * {@link RetryTransport} can rewrite the in-flight request's + * Authorization header before retrying. + * + * @returns The fresh authorization token. + */ + async reauthorize() { + this.accountInfo.clear(); + const auth = await this.authorize(); + return auth.authorizationToken; + } + /** + * Creates a new B2 bucket. + * @param options - Bucket configuration including name, type, and optional settings. + * + * @returns A {@link Bucket} handle for the newly created bucket. + */ + async createBucket(options) { + const request = { + accountId: accountId(this.accountInfo.getAccountId()), + ...options + }; + const info = await this.raw.createBucket( + this.accountInfo.getApiUrl(), + this.accountInfo.getAuthToken(), + request + ); + return new Bucket(this, info); + } + /** + * Lists buckets in the account, optionally filtered by ID, name, or type. + * @param options - Optional filters for bucket ID, name, or type. + * + * @returns An array of {@link Bucket} handles. + */ + async listBuckets(options) { + const resp = await this.raw.listBuckets( + this.accountInfo.getApiUrl(), + this.accountInfo.getAuthToken(), + { + accountId: accountId(this.accountInfo.getAccountId()), + ...options + } + ); + return resp.buckets.map((info) => new Bucket(this, info)); + } + /** + * Looks up a single bucket by name. + * @param bucketName - The name of the bucket to find. + * + * @returns The {@link Bucket} handle, or `null` if not found. + */ + async getBucket(bucketName) { + const buckets = await this.listBuckets({ bucketName }); + return buckets[0] ?? null; + } + /** + * Permanently deletes a bucket. The bucket must be empty. + * @param id - The unique identifier of the bucket to delete. + * + * @returns The deleted bucket metadata. + */ + async deleteBucket(id) { + return this.raw.deleteBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { + accountId: accountId(this.accountInfo.getAccountId()), + bucketId: id + }); + } + /** + * Creates a new application key with the specified capabilities. + * @param options - Key configuration including capabilities, name, and optional restrictions. + * + * @returns The full key including the secret (only returned at creation time). + */ + async createKey(options) { + return this.raw.createKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { + accountId: accountId(this.accountInfo.getAccountId()), + ...options + }); + } + /** + * Lists application keys in the account. + * @param options - Optional pagination settings. + * + * @returns A page of application keys with an optional continuation token. + */ + async listKeys(options) { + return this.raw.listKeys(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { + accountId: accountId(this.accountInfo.getAccountId()), + ...options?.pageSize !== void 0 ? { maxKeyCount: options.pageSize } : {}, + ...options?.startApplicationKeyId !== void 0 ? { startApplicationKeyId: options.startApplicationKeyId } : {} + }); + } + /** + * Async iterator that yields every application key on the account, + * automatically handling pagination via `listKeys`. + * + * @param options - Pagination + abort options. `pageSize` is forwarded + * to `maxKeyCount`; the default is 1000. + * + * @returns An async iterable of {@link ApplicationKey} entries. + * + * @example + * ```ts + * for await (const key of client.paginateKeys()) { + * console.log(key.keyName, key.capabilities) + * } + * ``` + */ + paginateKeys(options) { + return paginateItems( + async (cursor) => { + const resp = await this.listKeys({ + pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE, + ...cursor !== void 0 ? { startApplicationKeyId: cursor } : {} + }); + return { page: resp, nextCursor: resp.nextApplicationKeyId ?? void 0 }; + }, + (page) => page.keys, + options?.signal + ); + } + /** + * Permanently deletes an application key. + * @param applicationKeyId - The unique identifier of the key to delete. + * + * @returns The deleted application key metadata. + */ + async deleteKey(applicationKeyId) { + return this.raw.deleteKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { + applicationKeyId + }); + } + /** + * Checks whether the authorized application key carries every capability in + * `needed`. Returns the missing capabilities so callers can fail fast with a + * clear error instead of a generic 401/403 from the server. + * + * @param needed - The capabilities required by the planned operation. + * + * @returns An object with `ok: true` when every needed capability is + * present, otherwise `{ ok: false, missing: [...] }`. + * + * @throws If {@link authorize} has not been called yet. + */ + hasCapabilities(needed) { + const auth = this.accountInfo.getAuth(); + if (!auth) throw new Error("Not authorized. Call authorize() first."); + const available = new Set(auth.apiInfo.storageApi.allowed.capabilities); + const missing = needed.filter((cap) => !available.has(cap)); + return { ok: missing.length === 0, missing }; + } +} //# sourceMappingURL=client.js.map + ;// CONCATENATED MODULE: ./package.json const package_namespaceObject = {"rE":"1.1.0"}; ;// CONCATENATED MODULE: ./src/version.ts @@ -39179,18 +35538,6 @@ const VALID_RETENTION_MODE = ['compliance', 'governance', 'none']; const VALID_LEGAL_HOLD = ['on', 'off']; const APPLICATION_KEY_ID_ENV = 'B2_APPLICATION_KEY_ID'; const APPLICATION_KEY_ENV = 'B2_APPLICATION_KEY'; -const FILE_INFO_KEY_PATTERN = /^[a-zA-Z0-9_.`~!#$%^&*'|+-]+$/; -const FILE_INFO_KEY_MAX_BYTES = 50; -const FILE_INFO_MAX_ENTRIES = 10; -const FILE_INFO_TOTAL_MAX_BYTES = 7000; -const FILE_INFO_TOTAL_MAX_BYTES_WITH_ENCRYPTION = 2048; -const CONTENT_HEADER_FILE_INFO_KEYS = [ - ['cache-control', 'b2-cache-control'], - ['content-disposition', 'b2-content-disposition'], - ['content-language', 'b2-content-language'], - ['expires', 'b2-expires'], -]; -const inputs_utf8Encoder = new TextEncoder(); /** * Sensitive raw values that can appear in parser-scope errors before * {@link parseInputs} returns its structured output. @@ -39243,19 +35590,13 @@ function parseInputs() { const bypassGovernance = parseBool('bypass-governance', getInput('bypass-governance') || 'false'); const presignTtlSeconds = parsePositiveInt('presign-ttl', getInput('presign-ttl') || '3600'); const maxResults = parsePositiveInt('max-results', getInput('max-results') || '1000'); + const contentType = optional('content-type'); + const contentDisposition = optional('content-disposition'); + const responseContentType = optional('response-content-type'); + const cacheControl = optional('cache-control'); const endpoint = optional('endpoint'); const sse = optional('sse'); const encryption = parseSse(sse); - const contentType = optional('content-type'); - const fileInfo = parseFileInfo(optional('file-info')); - for (const [inputName, fileInfoKey] of CONTENT_HEADER_FILE_INFO_KEYS) { - addFileInfo(fileInfo, fileInfoKey, optional(inputName), inputName, { allowReserved: true }); - } - validateFileInfo(fileInfo, uploadFileInfoTotalMaxBytes(encryption)); - const preserveMtime = parseBool('preserve-mtime', getInput('preserve-mtime') || 'false'); - if (preserveMtime && Object.hasOwn(fileInfo, 'src_last_modified_millis')) { - throw new Error(`Duplicate fileInfo key "src_last_modified_millis" from 'preserve-mtime' input`); - } const expectedSha1 = optional('expected-sha1'); const retentionUntil = optional('retention-until'); const compareMode = parseEnum('compare-mode', (getInput('compare-mode') || 'modtime').toLowerCase(), VALID_COMPARE); @@ -39277,8 +35618,9 @@ function parseInputs() { partSize, resume, contentType, - fileInfo, - preserveMtime, + contentDisposition, + responseContentType, + cacheControl, dryRun, allowBucketPurge, presignTtlSeconds, @@ -39394,90 +35736,6 @@ function splitCsv(value) { .map((s) => s.trim()) .filter((s) => s.length > 0); } -/** - * Parse upload fileInfo metadata from newline-delimited or simple - * comma-separated `key=value` entries. Newline mode preserves commas inside - * values. - * - * @internal - */ -function parseFileInfo(value) { - if (value === undefined || value.trim() === '') - return {}; - const pairs = /[\r\n]/.test(value) ? value.split(/\r?\n|\r/) : value.split(','); - const fileInfo = {}; - for (const rawPair of pairs) { - const pair = rawPair.trim(); - if (pair === '') - continue; - const equalsIndex = pair.indexOf('='); - if (equalsIndex <= 0) { - throw new Error(`Invalid 'file-info' entry "${pair}". Expected key=value.`); - } - const key = pair.slice(0, equalsIndex).trim(); - const parsedValue = pair.slice(equalsIndex + 1).trim(); - addFileInfo(fileInfo, key, parsedValue, 'file-info', { allowReserved: false }); - } - return fileInfo; -} -function addFileInfo(fileInfo, key, value, inputName, options) { - if (value === undefined) - return; - const canonicalKey = key.toLowerCase(); - if (!options.allowReserved && canonicalKey.startsWith('b2-')) { - throw new Error(`Reserved fileInfo key "${key}" from '${inputName}' input must use the dedicated upload inputs such as content-type, cache-control, content-disposition, content-language, or expires`); - } - if (Object.hasOwn(fileInfo, canonicalKey)) { - throw new Error(`Duplicate fileInfo key "${key}" from '${inputName}' input`); - } - fileInfo[canonicalKey] = value; -} -/** - * Return the upload fileInfo byte budget for the active encryption mode. - * - * @internal - */ -function uploadFileInfoTotalMaxBytes(encryption) { - return encryption === undefined - ? FILE_INFO_TOTAL_MAX_BYTES - : FILE_INFO_TOTAL_MAX_BYTES_WITH_ENCRYPTION; -} -/** - * Validate upload fileInfo metadata before forwarding it to the B2 SDK. - * - * @internal - */ -function validateFileInfo(fileInfo, totalMaxBytes = FILE_INFO_TOTAL_MAX_BYTES) { - const entries = Object.entries(fileInfo); - if (entries.length > FILE_INFO_MAX_ENTRIES) { - throw new Error(`Invalid fileInfo: ${entries.length} entries exceeds ${FILE_INFO_MAX_ENTRIES}`); - } - let totalBytes = 0; - const seenCanonicalKeys = new Set(); - for (const [key, value] of entries) { - const canonicalKey = key.toLowerCase(); - if (seenCanonicalKeys.has(canonicalKey)) { - throw new Error(`Duplicate fileInfo key "${key}" from upload metadata`); - } - seenCanonicalKeys.add(canonicalKey); - if (!FILE_INFO_KEY_PATTERN.test(key)) { - throw new Error(`Invalid fileInfo key "${key}" from 'file-info'. Keys must match ${FILE_INFO_KEY_PATTERN.source}`); - } - const keyBytes = inputs_utf8Encoder.encode(key).byteLength; - if (keyBytes > FILE_INFO_KEY_MAX_BYTES) { - throw new Error(`Invalid fileInfo key "${key}": ${keyBytes} bytes exceeds ${FILE_INFO_KEY_MAX_BYTES}`); - } - const valueBytes = inputs_utf8Encoder.encode(value).byteLength; - const remainingValueBytes = Math.max(0, totalMaxBytes - totalBytes - keyBytes); - if (valueBytes > remainingValueBytes) { - throw new Error(`Invalid fileInfo value for "${key}": ${valueBytes} bytes exceeds ${remainingValueBytes}`); - } - totalBytes += keyBytes + valueBytes; - } - if (totalBytes > totalMaxBytes) { - throw new Error(`Invalid fileInfo: total size ${totalBytes} bytes exceeds ${totalMaxBytes}`); - } -} /** * Parse the documented boolean input spellings accepted by this action. * @@ -39614,7 +35872,7 @@ async function* deleteAllVersions(bucket, options) { } catch (error) { options.signal?.throwIfAborted(); - if (delete_all_isAbortError(error)) + if (isAbortError(error)) throw error; yield { type: 'error', @@ -39626,7 +35884,7 @@ async function* deleteAllVersions(bucket, options) { options.signal?.throwIfAborted(); } } -function delete_all_isAbortError(error) { +function isAbortError(error) { return error instanceof Error && error.name === 'AbortError'; } @@ -39719,6 +35977,37 @@ var promises_ = __nccwpck_require__(1455); var external_node_stream_ = __nccwpck_require__(7075); ;// CONCATENATED MODULE: external "node:stream/promises" const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises"); +;// CONCATENATED MODULE: ./src/download-overrides.ts +const DOWNLOAD_OVERRIDE_QUERY_PARAMS = { + b2ContentDisposition: 'b2ContentDisposition', + b2ContentType: 'b2ContentType', + b2CacheControl: 'b2CacheControl', +}; +function downloadHeaderOverridesFromInputs(inputs) { + return { + ...(inputs.contentDisposition !== undefined + ? { b2ContentDisposition: inputs.contentDisposition } + : {}), + ...(inputs.responseContentType !== undefined + ? { b2ContentType: inputs.responseContentType } + : {}), + ...(inputs.cacheControl !== undefined ? { b2CacheControl: inputs.cacheControl } : {}), + }; +} +function appendDownloadHeaderOverrides(url, overrides) { + const entries = Object.entries(DOWNLOAD_OVERRIDE_QUERY_PARAMS); + if (entries.every(([key]) => overrides[key] === undefined)) + return url; + const parsed = new URL(url); + for (const [key, param] of entries) { + const value = overrides[key]; + if (value !== undefined) { + parsed.searchParams.set(param, value); + } + } + return parsed.toString(); +} + ;// CONCATENATED MODULE: ./src/fs.ts /** @@ -39794,6 +36083,7 @@ function makeProgressListener(label, intervalMs = 1000) { + /** * Download from B2 to the local runner. * @@ -39809,10 +36099,11 @@ async function downloadCommand(bucket, inputs, signal) { const source = requireSource(inputs.source, 'download', 'a B2 file name or prefix'); const isPrefix = source.endsWith('/'); const sseDownload = sseFromInputs(inputs); + const downloadOverrides = downloadHeaderOverridesFromInputs(inputs); if (isPrefix) { - return downloadPrefix(bucket, source, inputs.destination ?? '.', sseDownload, signal); + return downloadPrefix(bucket, source, inputs.destination ?? '.', sseDownload, downloadOverrides, signal); } - const out = await downloadOne(bucket, source, inputs.destination, sseDownload, signal); + const out = await downloadOne(bucket, source, inputs.destination, sseDownload, downloadOverrides, signal); return { files: [out], bytesTransferred: out.size }; } function sseFromInputs(inputs) { @@ -39825,7 +36116,7 @@ function sseFromInputs(inputs) { customerKeyMd5: e.customerKeyMd5, }; } -async function downloadPrefix(bucket, prefix, destinationDir, sseDownload, signal) { +async function downloadPrefix(bucket, prefix, destinationDir, sseDownload, downloadOverrides, signal) { const destRoot = (0,external_node_path_.resolve)(destinationDir); await (0,promises_.mkdir)(destRoot, { recursive: true }); const pathSafety = await createPathSafetyContext(destRoot); @@ -39867,7 +36158,7 @@ async function downloadPrefix(bucket, prefix, destinationDir, sseDownload, signa signal?.throwIfAborted(); startGroup(`download b2://${bucket.name}/${plan.fileName} → ${plan.localPath}`); try { - const r = await downloadOne(bucket, plan.fileName, plan.localPath, sseDownload, signal, downloadPathSafety); + const r = await downloadOne(bucket, plan.fileName, plan.localPath, sseDownload, downloadOverrides, signal, downloadPathSafety); files.push(r); total += r.size; } @@ -39877,7 +36168,7 @@ async function downloadPrefix(bucket, prefix, destinationDir, sseDownload, signa } return { files, bytesTransferred: total }; } -async function downloadOne(bucket, fileName, destination, sseDownload, signal, pathSafety) { +async function downloadOne(bucket, fileName, destination, sseDownload, downloadOverrides, signal, pathSafety) { const localPath = pathSafety !== undefined && destination !== undefined ? (0,external_node_path_.resolve)(destination) : await resolveLocalPath(fileName, destination); @@ -39890,6 +36181,7 @@ async function downloadOne(bucket, fileName, destination, sseDownload, signal, p } const result = await bucket.download(fileName, { ...(sseDownload !== undefined ? { serverSideEncryption: sseDownload } : {}), + ...downloadOverrides, ...(signal !== undefined ? { signal } : {}), }); const size = result.headers.contentLength; @@ -39920,7 +36212,7 @@ async function downloadOne(bucket, fileName, destination, sseDownload, signal, p await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName); } const tempPath = `${localPath}.b2-action-download-${(0,external_node_crypto_.randomUUID)()}.tmp`; - const writeStream = (0,external_node_fs_.createWriteStream)(tempPath, { flags: 'wx' }); + const writeStream = (0,external_node_fs_namespaceObject.createWriteStream)(tempPath, { flags: 'wx' }); try { await (0,external_node_stream_promises_namespaceObject.pipeline)(external_node_stream_.Readable.fromWeb(result.body), counter, writeStream); await replaceDownloadedFile(tempPath, localPath); @@ -40304,363 +36596,33 @@ async function hasVisibleUploadAfter(bucket, prefix, startFileName) { return false; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/s3/index.js - - - - - - -//#region src/s3/index.ts -var HTTP_HEADER_TOKEN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; -var HTTP_MEDIA_TYPE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+\/[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; -var DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN = 3600; -var TRUSTED_NATIVE_DOWNLOAD_HOST_SUFFIXES = (/* unused pure expression or super */ null && ([ - "backblazeb2.com", - "backblaze.com", - "backblaze.net", - "b2-staging.io" -])); -var BROWSER_EXECUTABLE_CONTENT_TYPES = /* @__PURE__ */ new Set([ - "text/html", - "application/xhtml+xml", - "image/svg+xml", - "application/javascript", - "text/javascript", - "application/x-javascript", - "text/x-javascript", - "application/ecmascript", - "text/ecmascript", - "application/x-ecmascript", - "text/x-ecmascript", - "text/xml", - "application/xml" -]); -/** -* Server-side opt-in token for unsafe S3 presign options. -* -* Use this token as the value for `allowBrowserExecutableContentType`, -* `allowBrowserExecutableResponseContentType`, or -* `allowInlineResponseContentDisposition` only when active content or inline -* rendering from the storage origin is intentional and trusted. -*/ -var trustedUnsafeS3PresignOptIn = Object.freeze({ __trustedUnsafeS3PresignOptIn: "trustedUnsafeS3PresignOptIn" }); -/** -* Derives an S3-compatible client configuration from B2 authorization state. -* Pass the result to `new S3Client(config)` from `@aws-sdk/client-s3`. -* -* Non-standard, custom, or proxied endpoints require an explicit `region`; set -* it before deploying this SDK to those endpoints. The SDK no longer falls back -* to `us-west-004` because that can mis-sign requests. -* -* @param config - B2 auth state, application key credentials, and optional region override. -* -* @returns Configuration ready for the AWS S3 SDK. -* -* @example -* ```ts -* const { B2_APPLICATION_KEY_ID, B2_APPLICATION_KEY } = process.env -* if (!B2_APPLICATION_KEY_ID || !B2_APPLICATION_KEY) throw new Error('Missing B2 credentials') -* const s3 = new S3Client(createS3ClientConfig({ -* accountInfo: client.accountInfo, -* applicationKeyId: B2_APPLICATION_KEY_ID, -* applicationKey: B2_APPLICATION_KEY, -* })) -* ``` -*/ +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/s3/index.js function createS3ClientConfig(config) { - const s3Url = config.accountInfo.getS3ApiUrl(); - const region = config.region ?? deriveRequiredS3Region(s3Url); - assertNonEmptyStringOption("applicationKeyId", config.applicationKeyId); - assertNonEmptyStringOption("applicationKey", config.applicationKey); - assertNonEmptyStringOption("region", region); - assertSigV4CredentialScopeComponent("applicationKeyId", config.applicationKeyId); - assertSigV4CredentialScopeComponent("region", region); - return { - endpoint: s3Url, - region, - credentials: { - accessKeyId: config.applicationKeyId, - secretAccessKey: config.applicationKey - }, - forcePathStyle: true - }; -} -/** -* Extracts the B2 S3 region from a standard B2 S3 endpoint. -* -* Custom endpoints cannot be inferred safely. Pass `region` explicitly to -* {@link createS3ClientConfig}, {@link presignS3GetObjectUrl}, or -* {@link presignS3PutObjectUrl} when this returns `null`. -* -* @param endpoint - The S3 endpoint URL. -* -* @returns The derived region, or `null` when the endpoint is not a standard B2 S3 URL. -*/ -function deriveS3RegionFromEndpoint(endpoint) { - let hostname; - try { - hostname = new URL(endpoint).hostname.toLowerCase(); - } catch { - return null; - } - return /^s3\.([a-z0-9-]+)\.backblazeb2\.com$/.exec(hostname)?.[1] ?? null; -} -/** -* Generates an AWS Signature Version 4 presigned GET URL for B2's S3-compatible API. -* -* This helper signs internally and does not pass the B2 application key to -* runtime peer dependencies. Response override options are signed into the URL -* and control headers served from the storage origin; do not populate them from -* untrusted input without an allow-list. Presign success does not prove the URL -* will be accepted later; keep URL-generating hosts clock-synchronized and -* check clock skew when downstream use returns SigV4 403 errors. -* -* @param options - B2 auth state, S3 credentials, target object, and signing options. -* -* @returns The presigned URL string. -*/ -async function presignS3GetObjectUrl(options) { - const query = [["x-id", "GetObject"]]; - if (options.versionId !== void 0) { - assertSafeQueryValue("versionId", options.versionId); - query.push(["versionId", options.versionId]); - } - if (options.responseCacheControl !== void 0) { - assertSafeResponseOverride("responseCacheControl", options.responseCacheControl); - query.push(["response-cache-control", options.responseCacheControl]); - } - if (options.responseContentDisposition !== void 0) { - assertSafeResponseContentDisposition(options.responseContentDisposition, isTrustedUnsafeS3PresignOptIn(options.allowInlineResponseContentDisposition)); - query.push(["response-content-disposition", options.responseContentDisposition]); - } - if (options.responseContentEncoding !== void 0) { - assertSafeResponseOverride("responseContentEncoding", options.responseContentEncoding); - query.push(["response-content-encoding", options.responseContentEncoding]); - } - if (options.responseContentLanguage !== void 0) { - assertSafeResponseOverride("responseContentLanguage", options.responseContentLanguage); - query.push(["response-content-language", options.responseContentLanguage]); - } - if (options.responseContentType !== void 0) { - if (isTrustedUnsafeS3PresignOptIn(options.allowBrowserExecutableResponseContentType)) assertSafeContentTypeValue("responseContentType", options.responseContentType, "response header value"); - else assertSafeResponseContentType(options.responseContentType); - query.push(["response-content-type", options.responseContentType]); - } - if (options.responseExpires !== void 0) query.push(["response-expires", normalizeResponseExpires(options.responseExpires)]); - return await presignS3Request("GET", createSigV4PresignOptions(options), query, []); -} -/** -* Returns a B2-native download-authorization URL, not an S3 presigned URL. -* -* This deprecated helper preserves the legacy positional output contract where -* the whole file name is encoded as one URL component, including `/` as `%2F`. -* It keeps the legacy string-building contract for callers that relied on -* custom/local download URLs or permissive inputs. Use -* {@link createNativeDownloadAuthorizationUrl} for strict validation. -* -* @param downloadUrl - The B2 download URL from authorization. -* @param bucketName - The bucket containing the file. -* @param fileName - The file name (path) to download. -* @param authorizationToken - A download authorization token from `b2_get_download_authorization`. -* @param validDurationInSeconds - Compatibility-only value for the non-authoritative `expires` query. -* -* @returns The B2 native download-authorization URL string. -* -* @deprecated Use {@link createNativeDownloadAuthorizationUrl} for B2 native -* download-token URLs, or {@link presignS3GetObjectUrl} for real S3-compatible -* AWS Signature Version 4 presigned GET URLs. -*/ -function presignGetObjectUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds) { - const expires = Math.floor(Date.now() / 1e3) + (validDurationInSeconds ?? DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN); - return `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeURIComponent(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`; -} -/** -* Generates an AWS Signature Version 4 presigned PUT URL for browser or -* third-party uploads through B2's S3-compatible API. -* -* This helper signs internally and does not pass the B2 application key to -* runtime peer dependencies. A presigned PUT URL is a replayable bearer -* credential for writing one key until expiry. Retried PUTs can create -* duplicate B2 file versions when a response is lost after B2 stored the object. -* Use unique keys or reconcile uploaded file IDs/checksums, and configure -* lifecycle/version cleanup where duplicate versions must be removed -* automatically. If `contentType` and `contentLength` are omitted, the holder -* can choose any content type, including browser-executable types, and any size -* accepted by B2; bind both values before handing URLs to untrusted uploaders -* to limit financial-DoS and content-type smuggling risk. -* -* @param options - B2 auth state, S3 credentials, target object, and signing options. -* -* @returns The presigned URL string. -*/ -async function presignS3PutObjectUrl(options) { - const headers = []; - if (options.contentType !== void 0) { - if (isTrustedUnsafeS3PresignOptIn(options.allowBrowserExecutableContentType)) assertSafeContentTypeValue("contentType", options.contentType, "stored object Content-Type"); - else assertSafePutContentType(options.contentType); - headers.push(["content-type", options.contentType]); - } - if (options.contentLength !== void 0) headers.push(["content-length", normalizeContentLength(options.contentLength)]); - headers.push(...normalizeMetadataHeaders(options.metadata)); - return await presignS3Request("PUT", createSigV4PresignOptions(options), [["x-id", "PutObject"]], headers); -} -/** -* Generates an AWS Signature Version 4 presigned PUT URL for B2's -* S3-compatible API. -* -* @param options - B2 auth state, S3 credentials, target object, and signing options. -* -* @returns The presigned URL string. -* -* @deprecated Use {@link presignS3PutObjectUrl}; this alias is retained for -* pre-release callers that adopted the shorter name. -*/ -async function presignPutObjectUrl(options) { - return await presignS3PutObjectUrl(options); -} -/** -* Constructs a B2-native download URL using a token from `b2_get_download_authorization`. -* This is not an S3 presigned URL. -* -* The token lifetime is fixed when `b2_get_download_authorization` creates the -* token. `validDurationInSeconds` is retained only for compatibility with the -* legacy `presignGetObjectUrl` helper's decorative `expires` query parameter; -* changing it here does not shorten or extend access. -* Because the returned URL carries a bearer token, `downloadUrl` must be an -* HTTPS Backblaze download origin without userinfo, path, query, or fragment. -* -* @param downloadUrl - The B2 download URL from authorization (e.g., `https://f004.backblazeb2.com`). -* @param bucketName - The bucket containing the file. -* @param fileName - The file name (path) to download. -* @param authorizationToken - A download authorization token from `b2_get_download_authorization`. -* @param validDurationInSeconds - Compatibility-only value for the non-authoritative `expires` query. -* -* @returns The B2 native download-authorization URL string, not an S3 presigned URL. -*/ -function createNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds = DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN) { - return buildNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds, encodeFileName, assertNativeDownloadFileName); -} -function deriveRequiredS3Region(endpoint) { - const region = deriveS3RegionFromEndpoint(endpoint); - if (region !== null) return region; - throw new Error(`Unable to derive B2 S3 region from endpoint "${redactUrlForError(endpoint, { invalidUrlLabel: "" })}". Pass an explicit \`region\` option before deploying custom or proxied endpoints.`); -} -function createSigV4PresignOptions(options) { - const clientConfig = createS3ClientConfig(options); - return { - endpoint: clientConfig.endpoint, - region: clientConfig.region, - accessKeyId: clientConfig.credentials.accessKeyId, - secretAccessKey: clientConfig.credentials.secretAccessKey, - bucketName: options.bucketName, - fileName: options.fileName, - ...options.expiresIn !== void 0 ? { expiresIn: options.expiresIn } : {} - }; -} -function normalizeContentLength(contentLength) { - if (!Number.isSafeInteger(contentLength) || contentLength < 0) throw new RangeError(`contentLength must be a non-negative safe integer; received ${String(contentLength)}.`); - return String(contentLength); -} -function normalizeValidDurationInSeconds(validDurationInSeconds) { - if (!Number.isSafeInteger(validDurationInSeconds) || validDurationInSeconds < 0) throw new RangeError(`validDurationInSeconds must be a non-negative safe integer; received ${String(validDurationInSeconds)}.`); - return validDurationInSeconds; -} -function assertNonEmptyStringOption(name, value) { - if (typeof value !== "string" || value.trim().length === 0) throw new TypeError(`${name} must be a non-empty string.`); -} -function assertSigV4CredentialScopeComponent(name, value) { - if (/[\s/]/u.test(value) || hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain whitespace, control characters, or "/" because it is embedded in the SigV4 credential scope.`); -} -function isTrustedUnsafeS3PresignOptIn(value) { - return value === trustedUnsafeS3PresignOptIn; -} -function buildNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds, encodeFileNameForUrl, assertFileName) { - const baseUrl = parseNativeDownloadBaseUrl(downloadUrl); - assertSafeBucketName(bucketName); - assertFileName(fileName); - const expires = Math.floor(Date.now() / 1e3) + normalizeValidDurationInSeconds(validDurationInSeconds); - return `${baseUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileNameForUrl(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`; -} -function parseNativeDownloadBaseUrl(downloadUrl) { - let base; - try { - base = new URL(downloadUrl); - } catch { - throw new TypeError(`Native download-authorization URLs require a valid https: downloadUrl; received "${redactUrlForError(downloadUrl, { invalidUrlLabel: "" })}".`); - } - if (base.protocol !== "https:") throw new TypeError(`Native download-authorization URLs require an https: downloadUrl; received "${redactUrlForError(base)}".`); - if (base.username !== "" || base.password !== "") throw new TypeError("Native download-authorization URLs must not include userinfo."); - if (base.search !== "" || base.hash !== "") throw new TypeError("Native download-authorization URLs must not include query or fragment."); - if (base.pathname !== "" && base.pathname !== "/") throw new TypeError("Native download-authorization URLs must not include a path."); - if (!isTrustedNativeDownloadHost(base.hostname)) throw new TypeError(`Native download-authorization URLs require a Backblaze download host; received "${redactUrlForError(base)}".`); - return base.origin; -} -function normalizeMetadataHeaders(metadata) { - const headers = []; - const seenKeys = /* @__PURE__ */ new Set(); - for (const [key, value] of Object.entries(metadata ?? {})) { - if (!HTTP_HEADER_TOKEN.test(key)) throw new TypeError(`metadata key "${key}" must be a non-empty valid HTTP header token.`); - if (typeof value !== "string") throw new TypeError(`metadata value for "${key}" must be a string.`); - const lowerKey = key.toLowerCase(); - if (seenKeys.has(lowerKey)) throw new TypeError(`metadata key "${key}" must not differ only by case.`); - seenKeys.add(lowerKey); - headers.push([`x-amz-meta-${lowerKey}`, value]); - } - return headers; -} -function normalizeResponseExpires(responseExpires) { - if (!Number.isFinite(responseExpires.getTime())) throw new RangeError("responseExpires must be a valid Date."); - return responseExpires.toUTCString(); -} -function assertSafeResponseOverride(name, value) { - assertSafeHeaderValue(name, value, "response header value"); -} -function assertSafeQueryValue(name, value) { - if (hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain control characters because it becomes a query parameter.`); -} -function assertSafeHeaderValue(name, value, target) { - if (hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain control characters because it becomes a ${target}.`); -} -function assertSafeResponseContentType(contentType) { - assertNonExecutableContentType("responseContentType", contentType, "response header value", "allow-list a safe content type before signing response overrides"); -} -function assertSafePutContentType(contentType) { - assertNonExecutableContentType("contentType", contentType, "stored object Content-Type", "pass allowBrowserExecutableContentType only when active content is intentional"); -} -function assertSafeResponseContentDisposition(contentDisposition, allowInline) { - assertSafeResponseOverride("responseContentDisposition", contentDisposition); - const disposition = contentDisposition.split(";", 1)[0]?.trim().toLowerCase(); - if (!allowInline && disposition === "inline") throw new TypeError("responseContentDisposition must not force inline rendering; use an attachment disposition for response overrides."); -} -function mediaTypeFor(contentType) { - return contentType.split(";", 1)[0]?.trim().toLowerCase() ?? ""; -} -function assertSafeContentTypeValue(name, contentType, target) { - assertSafeHeaderValue(name, contentType, target); - const mediaType = mediaTypeFor(contentType); - if (mediaType.length === 0) throw new TypeError(`${name} must include a non-empty media type.`); - if (!HTTP_MEDIA_TYPE.test(mediaType)) throw new TypeError(`${name} must include a valid media type.`); - return mediaType; -} -function assertNonExecutableContentType(name, contentType, target, guidance) { - const mediaType = assertSafeContentTypeValue(name, contentType, target); - if (isBrowserExecutableContentType(mediaType)) throw new TypeError(`${name} "${mediaType}" can execute in browsers; ${guidance}.`); -} -function isBrowserExecutableContentType(mediaType) { - return BROWSER_EXECUTABLE_CONTENT_TYPES.has(mediaType) || mediaType.endsWith("+xml"); -} -function isTrustedNativeDownloadHost(hostname) { - return TRUSTED_NATIVE_DOWNLOAD_HOST_SUFFIXES.some((suffix) => hostMatchesAllowedSuffix(hostname, suffix)); -} -//#endregion - + const s3Url = config.accountInfo.getS3ApiUrl(); + const regionMatch = s3Url.match(/s3\.([^.]+)\.backblazeb2\.com/); + const region = config.region ?? regionMatch?.[1] ?? "us-west-004"; + return { + endpoint: s3Url, + region, + credentials: { + accessKeyId: config.applicationKeyId, + secretAccessKey: config.applicationKey + }, + forcePathStyle: true + }; +} +function presignGetObjectUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds = 3600) { + const expires = Math.floor(Date.now() / 1e3) + validDurationInSeconds; + return `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeURIComponent(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`; +} //# sourceMappingURL=index.js.map + ;// CONCATENATED MODULE: ./src/commands/presign.ts + /** * Generate a presigned download URL for one B2 file or every file under a * prefix. @@ -40681,13 +36643,24 @@ async function presignCommand(client, bucket, inputs) { if (source.endsWith('/')) { return presignPrefix(client, bucket, inputs, source); } - return { files: [await presignOne(client, bucket, source, inputs.presignTtlSeconds, source)] }; + const downloadOverrides = downloadHeaderOverridesFromInputs(inputs); + return { + files: [ + await presignOne(client, bucket, source, inputs.presignTtlSeconds, source, downloadOverrides), + ], + }; } async function presignPrefix(client, bucket, inputs, prefix) { const downloadUrl = client.accountInfo.getDownloadUrl(); + const downloadOverrides = downloadHeaderOverridesFromInputs(inputs); // One auth token covers the whole prefix (that's exactly what // `b2_get_download_authorization` is designed for). - const auth = await bucket.getDownloadAuthorization(prefix, inputs.presignTtlSeconds); + const auth = await client.raw.getDownloadAuthorization(client.accountInfo.getApiUrl(), client.accountInfo.getAuthToken(), { + bucketId: bucket.id, + fileNamePrefix: prefix, + validDurationInSeconds: inputs.presignTtlSeconds, + ...downloadOverrides, + }); core_setSecret(auth.authorizationToken); const expiresAt = Math.floor(Date.now() / 1000) + inputs.presignTtlSeconds; const files = []; @@ -40704,7 +36677,7 @@ async function presignPrefix(client, bucket, inputs, prefix) { for (const f of page.files) { if (f.action !== 'upload') continue; - const url = presignGetObjectUrl(downloadUrl, bucket.name, f.fileName, auth.authorizationToken, inputs.presignTtlSeconds); + const url = appendDownloadHeaderOverrides(presignGetObjectUrl(downloadUrl, bucket.name, f.fileName, auth.authorizationToken, inputs.presignTtlSeconds), downloadOverrides); core_setSecret(url); files.push({ fileName: f.fileName, url, expiresAt }); if (files.length >= inputs.maxResults) @@ -40721,10 +36694,15 @@ async function presignPrefix(client, bucket, inputs, prefix) { } return { files }; } -async function presignOne(client, bucket, fileName, ttlSeconds, authPrefix) { - const auth = await bucket.getDownloadAuthorization(authPrefix, ttlSeconds); +async function presignOne(client, bucket, fileName, ttlSeconds, authPrefix, downloadOverrides) { + const auth = await client.raw.getDownloadAuthorization(client.accountInfo.getApiUrl(), client.accountInfo.getAuthToken(), { + bucketId: bucket.id, + fileNamePrefix: authPrefix, + validDurationInSeconds: ttlSeconds, + ...downloadOverrides, + }); const downloadUrl = client.accountInfo.getDownloadUrl(); - const url = presignGetObjectUrl(downloadUrl, bucket.name, fileName, auth.authorizationToken, ttlSeconds); + const url = appendDownloadHeaderOverrides(presignGetObjectUrl(downloadUrl, bucket.name, fileName, auth.authorizationToken, ttlSeconds), downloadOverrides); core_setSecret(auth.authorizationToken); core_setSecret(url); const expiresAt = Math.floor(Date.now() / 1000) + ttlSeconds; @@ -40890,4234 +36868,780 @@ async function retentionCommand(bucket, inputs) { } } -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/file-source.js -//#region src/streams/file-source.ts -var FILE_STREAM_CHUNK_SIZE = 16 * 1024 * 1024; -var FILE_SOURCE_INTERNAL = Symbol("FileSource.internal"); -/** @internal */ -var fileSourceTestHooks = {}; -function getNodeFsSync() { - const fs = globalThis.process?.getBuiltinModule?.("node:fs"); - if (!isNodeFsSync(fs)) throw new Error("FileSource constructor requires Node.js 22.3+ synchronous filesystem APIs; use FileSource.fromPath() when synchronous filesystem access is unavailable."); - return fs; -} -function isNodeFsSync(value) { - if (typeof value !== "object" || value === null) return false; - return typeof value["lstatSync"] === "function"; -} -async function fileOpenFlags() { - const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19)); - return constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0); -} -function normalizeSliceOffset(value, size) { - if (!Number.isFinite(value)) throw new RangeError("FileSource slice offsets must be finite."); - const integer = Math.trunc(value); - const offset = integer < 0 ? size + integer : integer; - return Math.min(Math.max(offset, 0), size); -} -function formatFilePath(path) { - return path instanceof URL ? path.href : path; -} -function identityFromStats(stats) { - return { - dev: stats.dev, - ino: stats.ino, - size: stats.size, - mtimeMs: stats.mtimeMs, - ctimeMs: stats.ctimeMs - }; -} -function assertStableIdentity(path, stats) { - if (stats.dev === 0 && stats.ino === 0) throw new Error(`FileSource: ${formatFilePath(path)} is on a filesystem that does not expose stable file identity.`); -} -function assertRegularFile(path, stats) { - if (!stats.isFile()) throw new Error(`FileSource: ${formatFilePath(path)} is not a regular file.`); -} -function validatedIdentityFromStats(path, stats) { - assertRegularFile(path, stats); - if (shouldComparePosixFileIdentity()) assertStableIdentity(path, stats); - return identityFromStats(stats); -} -function assertSameIdentity(path, expected, actual, when) { - if (shouldComparePosixFileIdentity()) assertStableIdentity(path, actual); - if (shouldComparePosixFileIdentity() && (actual.dev !== expected.dev || actual.ino !== expected.ino)) throw new Error(`FileSource: ${formatFilePath(path)} changed ${when}.`); - if (actual.size !== expected.size || actual.mtimeMs !== expected.mtimeMs) throw new Error(`FileSource: ${formatFilePath(path)} was modified ${when}.`); - if (shouldComparePosixChangeTime() && actual.ctimeMs !== expected.ctimeMs) throw new Error(`FileSource: ${formatFilePath(path)} was modified ${when}.`); -} -function file_source_isWindows() { - if (fileSourceTestHooks.platform !== void 0) return fileSourceTestHooks.platform === "win32"; - return globalThis.process?.platform === "win32"; -} -function shouldComparePosixFileIdentity() { - return !file_source_isWindows(); -} -function shouldComparePosixChangeTime() { - return !file_source_isWindows(); -} -function throwIfAborted(signal) { - if (signal === void 0 || !signal.aborted) return; - throw signal.reason ?? new DOMException("Aborted", "AbortError"); -} -function maxReadSize() { - return fileSourceTestHooks.maxReadSize ?? FILE_STREAM_CHUNK_SIZE; -} -/* v8 ignore start -- Requires a file to pass identity checks and still EOF mid-range. */ -function rangeEndedEarlyError(path, offset, size) { - const end = offset + size; - return /* @__PURE__ */ new Error(`FileSource: ${formatFilePath(path)} ended before byte range [${offset}, ${end}) was fully read.`); -} -/* v8 ignore stop */ -async function openValidatedFile(path, identity) { - const open = fileSourceTestHooks.openFile ?? (await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19))).open; - let file; - try { - file = await open(path, await fileOpenFlags()); - } catch (err) { - const message = err instanceof Error ? err.message : String(err); - throw new Error(`FileSource: ${formatFilePath(path)} could not be opened: ${message}`); - } - try { - const stats = await file.stat(); - assertRegularFile(path, stats); - assertSameIdentity(path, identity, stats, "before read"); - return file; - } catch (err) { - /* v8 ignore next -- Cleanup failure is deliberately best-effort. */ - await file.close().catch(() => {}); - throw err; - } -} -async function lstatNodeFile(path) { - const { lstat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - return lstat(path); -} -async function readFileRange(path, identity, offset, size, signal) { - throwIfAborted(signal); - if (size === 0) { - await verifyFileIdentityForEmptyRead(path, identity, signal); - return /* @__PURE__ */ new Uint8Array(0); - } - throwIfAborted(signal); - const file = await openValidatedFile(path, identity); - const data = new Uint8Array(size); - let filled = 0; - try { - while (filled < data.byteLength) { - throwIfAborted(signal); - const length = Math.min(maxReadSize(), data.byteLength - filled); - const { bytesRead } = await file.read(data, filled, length, offset + filled); - if (bytesRead === 0) throw rangeEndedEarlyError(path, offset, size); - filled += bytesRead; - await fileSourceTestHooks.afterReadIteration?.(filled); - } - throwIfAborted(signal); - assertSameIdentity(path, identity, await file.stat(), "while being read"); - return data; - } finally { - /* v8 ignore next -- Cleanup failure is deliberately best-effort. */ - await file.close().catch(() => {}); - } -} -async function verifyFileIdentityForEmptyRead(path, identity, signal) { - throwIfAborted(signal); - const file = await openValidatedFile(path, identity); - try { - throwIfAborted(signal); - return; - } finally { - /* v8 ignore next -- Cleanup failure is deliberately best-effort. */ - await file.close().catch(() => {}); - } -} -function sliceFileRange(path, identity, offset, size, start, end) { - const normalizedStart = normalizeSliceOffset(start, size); - const normalizedEnd = normalizeSliceOffset(end, size); - return new FileSliceSource(path, identity, offset + normalizedStart, Math.max(normalizedEnd - normalizedStart, 0)); -} -function streamFileRange(path, identity, offset, size) { - let position = offset; - let remaining = size; - let verifiedEmpty = false; - const abortController = new AbortController(); - return new ReadableStream({ - async pull(controller) { - try { - if (remaining === 0) { - if (!verifiedEmpty) { - verifiedEmpty = true; - await verifyFileIdentityForEmptyRead(path, identity); - } - controller.close(); - return; - } - const data = await readFileRange(path, identity, position, Math.min(FILE_STREAM_CHUNK_SIZE, remaining), abortController.signal); - position += data.byteLength; - remaining -= data.byteLength; - controller.enqueue(data); - if (remaining === 0) controller.close(); - } catch (err) { - controller.error(err); - } - }, - cancel(reason) { - abortController.abort(reason); - } - }); -} -async function fileRangeToArrayBuffer(path, identity, offset, size, options = {}) { - return (await readFileRange(path, identity, offset, size, options.signal)).buffer; -} -var FileSliceSource = class { - path; - identity; - offset; - size; - canSlice = true; - constructor(path, identity, offset, size) { - this.path = path; - this.identity = identity; - this.offset = offset; - this.size = size; - } - slice(start, end) { - return sliceFileRange(this.path, this.identity, this.offset, this.size, start, end); - } - stream() { - return streamFileRange(this.path, this.identity, this.offset, this.size); - } - toArrayBuffer(options = {}) { - return fileRangeToArrayBuffer(this.path, this.identity, this.offset, this.size, options); - } -}; -/** -* ContentSource backed by a local filesystem path. -* -* `FileSource` is Node-only but safe to import in browser builds: it touches -* Node filesystem APIs only when constructed or read. The constructor performs -* synchronous filesystem validation so `size` is immediately available; request -* handlers, sync loops, and other latency-sensitive code should use -* {@link FileSource.fromPath}. Both paths capture a best-effort regular file -* identity and reject a symlink as the final path component; parent directory -* symlinks are followed by the operating system, so callers that constrain -* paths under a trusted root should validate those parents separately. Reads -* reject if the path is replaced, if the filesystem cannot report stable -* identity on POSIX platforms, or if size/mtime/ctime changes before the -* configured byte range is read. On Windows, reads avoid unreliable dev/inode -* identity comparisons and validate size/mtime instead. -* Slices preserve the captured identity, so multipart uploads can read -* disjoint ranges without materialising the whole file in memory or following -* later leaf path swaps. -*/ -var FileSource = class { - /** Random-access: file ranges are read by absolute byte offset. */ - canSlice = true; - /** File size captured at construction time. */ - size; - path; - identity; - /** - * Internal constructor path for async validation. - * @param path - Local filesystem path or file URL. - * @param internal - Module-private validated identity payload. - * - * @internal - */ - constructor(path, internal) { - const resolvedIdentity = internal?.key === FILE_SOURCE_INTERNAL ? internal.identity : validatedIdentityFromStats(path, getNodeFsSync().lstatSync(path)); - this.path = path; - this.identity = resolvedIdentity; - this.size = resolvedIdentity.size; - } - /** - * Return a new file-backed source covering the specified byte range. - * @param start - The zero-based byte offset to begin the slice. - * @param end - The exclusive byte offset where the slice ends. - * - * @returns A new ContentSource representing the requested sub-range. - */ - slice(start, end) { - return sliceFileRange(this.path, this.identity, 0, this.size, start, end); - } - /** - * Open this file as a Web ReadableStream. - * @returns A ReadableStream that reads the file lazily. - */ - stream() { - return streamFileRange(this.path, this.identity, 0, this.size); - } - /** - * Read this file into an ArrayBuffer. - * @param options - Optional abort signal used while reading. - * - * @returns A promise resolving with the file bytes. - */ - toArrayBuffer(options = {}) { - return fileRangeToArrayBuffer(this.path, this.identity, 0, this.size, options); - } - /** - * Create a FileSource using asynchronous filesystem validation. - * @param path - Local filesystem path or file URL. - * - * @returns A FileSource bound to the validated file identity. - * - * @throws If the path does not reference a regular non-symlink file. - * @throws If a POSIX filesystem cannot report stable file identity. - */ - static async fromPath(path) { - return constructFileSourceFromIdentity(path, validatedIdentityFromStats(path, await lstatNodeFile(path))); - } -}; -function constructFileSourceFromIdentity(path, identity) { - return Reflect.construct(FileSource, [path, { - key: FILE_SOURCE_INTERNAL, - identity - }]); -} -//#endregion - - -//# sourceMappingURL=file-source.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/actions/index.js -//#region src/sync/actions/index.ts -/** Uploads a local file to B2. */ -var UploadAction = class { - relativePath; - absolutePath; - size; - doUpload; - type = "upload"; - /** - * Creates a new UploadAction for the given relative path. - * @param relativePath - Path relative to the sync root. - * @param absolutePath - Absolute local filesystem path. - * @param size - File size in bytes. - * @param doUpload - Callback that performs the actual upload. - */ - constructor(relativePath, absolutePath, size, doUpload) { - this.relativePath = relativePath; - this.absolutePath = absolutePath; - this.size = size; - this.doUpload = doUpload; - } - /** - * Uploads the file (unless dryRun) and returns an 'upload-done' event. - * @param dryRun - Whether to simulate the action without making changes. - * @param signal - Optional abort signal for canceling the upload. - * - * @returns A promise resolving to the sync event produced by the action. - */ - async execute(dryRun, signal) { - if (!dryRun) await this.doUpload(this.absolutePath, this.relativePath, signal); - return { - type: "upload-done", - path: this.relativePath, - size: this.size - }; - } -}; -/** Downloads a B2 file to the local filesystem. */ -var DownloadAction = class { - relativePath; - size; - doDownload; - type = "download"; - /** - * Creates a new DownloadAction for the given relative path. - * @param relativePath - Path relative to the sync root. - * @param size - File size in bytes. - * @param doDownload - Callback that performs the actual download. - */ - constructor(relativePath, size, doDownload) { - this.relativePath = relativePath; - this.size = size; - this.doDownload = doDownload; - } - /** - * Downloads the file (unless dryRun) and returns a 'download-done' event. - * @param dryRun - Whether to simulate the action without making changes. - * @param signal - Optional abort signal for canceling the download. - * - * @returns A promise resolving to the sync event produced by the action. - */ - async execute(dryRun, signal) { - if (!dryRun) await this.doDownload(this.relativePath, signal); - return { - type: "download-done", - path: this.relativePath, - size: this.size - }; - } -}; -/** Server-side copies a B2 file to a new key within the same or different bucket. */ -var CopyAction = class { - relativePath; - size; - doCopy; - type = "copy"; - /** - * Creates a new CopyAction for the given relative path. - * @param relativePath - Path relative to the sync root. - * @param size - File size in bytes. - * @param doCopy - Callback that performs the server-side copy. - */ - constructor(relativePath, size, doCopy) { - this.relativePath = relativePath; - this.size = size; - this.doCopy = doCopy; - } - /** - * Copies the file (unless dryRun) and returns a 'copy-done' event. - * @param dryRun - Whether to simulate the action without making changes. - * @param signal - Optional abort signal for canceling the copy. - * - * @returns A promise resolving to the sync event produced by the action. - */ - async execute(dryRun, signal) { - if (!dryRun) await this.doCopy(this.relativePath, signal); - return { - type: "copy-done", - path: this.relativePath, - size: this.size - }; - } -}; -/** Hides a file in B2 by creating a hide marker (soft delete). */ -var HideAction = class { - relativePath; - doHide; - type = "hide"; - size = 0; - /** - * Creates a new HideAction for the given relative path. - * @param relativePath - Path relative to the sync root. - * @param doHide - Callback that creates the hide marker. - */ - constructor(relativePath, doHide) { - this.relativePath = relativePath; - this.doHide = doHide; - } - /** - * Hides the file (unless dryRun) and returns a 'hide' event. - * @param dryRun - Whether to simulate the action without making changes. - * @param signal - Optional abort signal for canceling the hide request. - * - * @returns A promise resolving to the sync event produced by the action. - */ - async execute(dryRun, signal) { - if (!dryRun) await this.doHide(this.relativePath, signal); - return { - type: "hide", - path: this.relativePath, - size: 0 - }; - } -}; -/** Permanently deletes a specific file version from B2. */ -var DeleteRemoteAction = class { - relativePath; - fileId; - doDelete; - type = "delete-remote"; - size = 0; - /** - * Creates a new DeleteRemoteAction for the given relative path. - * @param relativePath - Path relative to the sync root. - * @param fileId - The B2 file version ID to delete. - * @param doDelete - Callback that performs the deletion. - */ - constructor(relativePath, fileId, doDelete) { - this.relativePath = relativePath; - this.fileId = fileId; - this.doDelete = doDelete; - } - /** - * Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event. - * @param dryRun - Whether to simulate the action without making changes. - * @param signal - Optional abort signal for canceling the delete request. - * - * @returns A promise resolving to the sync event produced by the action. - */ - async execute(dryRun, signal) { - if (!dryRun) await this.doDelete(this.fileId, this.relativePath, signal); - return { - type: "delete-remote", - path: this.relativePath, - size: 0 - }; - } -}; -/** Deletes a file from the local filesystem. */ -var DeleteLocalAction = class { - relativePath; - absolutePath; - doDelete; - type = "delete-local"; - size = 0; - /** - * Creates a new DeleteLocalAction for the given relative path. - * @param relativePath - Path relative to the sync root. - * @param absolutePath - Absolute local filesystem path. - * @param doDelete - Callback that performs the deletion. - */ - constructor(relativePath, absolutePath, doDelete) { - this.relativePath = relativePath; - this.absolutePath = absolutePath; - this.doDelete = doDelete; - } - /** - * Deletes the local file (unless dryRun) and returns a 'delete-local' event. - * @param dryRun - Whether to simulate the action without making changes. - * @param signal - Optional abort signal checked before deleting. - * - * @returns A promise resolving to the sync event produced by the action. - */ - async execute(dryRun, signal) { - if (!dryRun) await this.doDelete(this.absolutePath, signal); - return { - type: "delete-local", - path: this.relativePath, - size: 0 - }; - } -}; -/** Represents a no-op action for files that do not need syncing. */ -var SkipAction = class { - relativePath; - reason; - type = "skip"; - size = 0; - /** - * Creates a new SkipAction for the given relative path. - * @param relativePath - Path relative to the sync root. - * @param reason - Human-readable explanation for why the file was skipped. - */ - constructor(relativePath, reason) { - this.relativePath = relativePath; - this.reason = reason; - } - /** - * Returns a 'skip' event with the reason message. No I/O is performed. - * @param _dryRun - Whether to simulate the action (unused for no-op). - * @param _signal - Unused abort signal accepted for the shared action interface. - * - * @returns A promise resolving to the sync event produced by the action. - */ - async execute(_dryRun, _signal) { - return { - type: "skip", - path: this.relativePath, - size: 0, - message: this.reason - }; - } -}; -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/source.js + +class BlobSource { + /** + * Create a BlobSource wrapping the given Blob. + * @param blob - The Blob or File to use as the underlying content. + */ + constructor(blob) { + this.blob = blob; + this.size = blob.size; + } + /** {@inheritDoc} */ + size; + /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */ + canSlice = true; + /** + * Return a new BlobSource covering the specified byte range. + * @param start - The zero-based byte offset to begin the slice. + * @param end - The exclusive byte offset where the slice ends. + * + * @returns A new ContentSource representing the requested sub-range. + */ + slice(start, end) { + return new BlobSource(this.blob.slice(start, end)); + } + /** + * Open the Blob content as a ReadableStream. + * @returns A ReadableStream of the Blob bytes. + */ + stream() { + return this.blob.stream(); + } + /** + * Read the entire Blob content into an ArrayBuffer. + * @returns A promise that resolves with the full content as an ArrayBuffer. + */ + toArrayBuffer() { + return this.blob.arrayBuffer(); + } +} +class BufferSource { + /** + * Create a BufferSource wrapping the given Uint8Array. + * @param buffer - The byte buffer to use as the underlying content. + */ + constructor(buffer) { + this.buffer = buffer; + this.size = buffer.byteLength; + } + /** {@inheritDoc} */ + size; + /** Random-access: the entire payload lives in memory. */ + canSlice = true; + /** + * Return a new BufferSource covering the specified byte range. + * @param start - The zero-based byte offset to begin the slice. + * @param end - The exclusive byte offset where the slice ends. + * + * @returns A new ContentSource representing the requested sub-range. + */ + slice(start, end) { + return new BufferSource(this.buffer.slice(start, end)); + } + /** + * Open the buffer content as a ReadableStream. + * @returns A ReadableStream that emits the buffer bytes in a single chunk. + */ + stream() { + const buffer = this.buffer; + return new ReadableStream({ + start(controller) { + controller.enqueue(buffer); + controller.close(); + } + }); + } + /** + * Read the entire buffer content into an ArrayBuffer. + * @returns A promise that resolves with the full content as an ArrayBuffer. + */ + toArrayBuffer() { + return Promise.resolve( + this.buffer.buffer.slice( + this.buffer.byteOffset, + this.buffer.byteOffset + this.buffer.byteLength + ) + ); + } +} +class StreamSource { + /** + * Create a StreamSource wrapping the given ReadableStream with a known byte size. + * @param readable - The ReadableStream to wrap as a content source. + * @param size - The total number of bytes the stream will produce. + */ + constructor(readable, size) { + this.readable = readable; + this.size = size; + } + /** {@inheritDoc} */ + size; + /** + * Forward-only: ReadableStreams cannot be repositioned, so multipart + * uploads must take the sequential path. See the interface comment on + * `canSlice` for what the engine does with this flag. + */ + canSlice = false; + /** Whether the stream has already been read. */ + consumed = false; + /** + * Always throws because streams cannot be sliced. Buffer the stream first. + * + * @throws If slicing is attempted on a stream-backed source. + */ + slice() { + throw new Error("StreamSource does not support slicing. Buffer the stream first."); + } + /** + * Open the underlying ReadableStream. Can only be called once. + * @returns The underlying ReadableStream of bytes. + * + * @throws If the stream has already been consumed. + */ + stream() { + if (this.consumed) throw new Error("StreamSource can only be consumed once."); + this.consumed = true; + return this.readable; + } + /** + * Read the entire stream into an ArrayBuffer. + * @returns A promise that resolves with the full content as an ArrayBuffer. + */ + async toArrayBuffer() { + const bytes = await collectStream(this.stream()); + return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength); + } +} +function toContentSource(input, size) { + if (input instanceof Uint8Array) { + return new BufferSource(input); + } + if (input instanceof Blob) { + return new BlobSource(input); + } + if (size === void 0) { + throw new Error("size is required when using a ReadableStream as input."); + } + return new StreamSource(input, size); +} +//# sourceMappingURL=source.js.map + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/actions/index.js +class UploadAction { + /** + * Creates a new UploadAction for the given relative path. + * @param relativePath - Path relative to the sync root. + * @param absolutePath - Absolute local filesystem path. + * @param size - File size in bytes. + * @param doUpload - Callback that performs the actual upload. + */ + constructor(relativePath, absolutePath, size, doUpload) { + this.relativePath = relativePath; + this.absolutePath = absolutePath; + this.size = size; + this.doUpload = doUpload; + } + type = "upload"; + /** + * Uploads the file (unless dryRun) and returns an 'upload-done' event. + * @param dryRun - Whether to simulate the action without making changes. + * + * @returns An async generator yielding sync progress events. + */ + async execute(dryRun) { + if (!dryRun) { + await this.doUpload(this.absolutePath, this.relativePath); + } + return { type: "upload-done", path: this.relativePath, size: this.size }; + } +} +class DownloadAction { + /** + * Creates a new DownloadAction for the given relative path. + * @param relativePath - Path relative to the sync root. + * @param size - File size in bytes. + * @param doDownload - Callback that performs the actual download. + */ + constructor(relativePath, size, doDownload) { + this.relativePath = relativePath; + this.size = size; + this.doDownload = doDownload; + } + type = "download"; + /** + * Downloads the file (unless dryRun) and returns a 'download-done' event. + * @param dryRun - Whether to simulate the action without making changes. + * + * @returns An async generator yielding sync progress events. + */ + async execute(dryRun) { + if (!dryRun) { + await this.doDownload(this.relativePath); + } + return { type: "download-done", path: this.relativePath, size: this.size }; + } +} +class CopyAction { + /** + * Creates a new CopyAction for the given relative path. + * @param relativePath - Path relative to the sync root. + * @param size - File size in bytes. + * @param doCopy - Callback that performs the server-side copy. + */ + constructor(relativePath, size, doCopy) { + this.relativePath = relativePath; + this.size = size; + this.doCopy = doCopy; + } + type = "copy"; + /** + * Copies the file (unless dryRun) and returns a 'copy-done' event. + * @param dryRun - Whether to simulate the action without making changes. + * + * @returns An async generator yielding sync progress events. + */ + async execute(dryRun) { + if (!dryRun) { + await this.doCopy(this.relativePath); + } + return { type: "copy-done", path: this.relativePath, size: this.size }; + } +} +class HideAction { + /** + * Creates a new HideAction for the given relative path. + * @param relativePath - Path relative to the sync root. + * @param doHide - Callback that creates the hide marker. + */ + constructor(relativePath, doHide) { + this.relativePath = relativePath; + this.doHide = doHide; + } + type = "hide"; + size = 0; + /** + * Hides the file (unless dryRun) and returns a 'hide' event. + * @param dryRun - Whether to simulate the action without making changes. + * + * @returns An async generator yielding sync progress events. + */ + async execute(dryRun) { + if (!dryRun) { + await this.doHide(this.relativePath); + } + return { type: "hide", path: this.relativePath, size: 0 }; + } +} +class DeleteRemoteAction { + /** + * Creates a new DeleteRemoteAction for the given relative path. + * @param relativePath - Path relative to the sync root. + * @param fileId - The B2 file version ID to delete. + * @param doDelete - Callback that performs the deletion. + */ + constructor(relativePath, fileId, doDelete) { + this.relativePath = relativePath; + this.fileId = fileId; + this.doDelete = doDelete; + } + type = "delete-remote"; + size = 0; + /** + * Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event. + * @param dryRun - Whether to simulate the action without making changes. + * + * @returns An async generator yielding sync progress events. + */ + async execute(dryRun) { + if (!dryRun) { + await this.doDelete(this.fileId, this.relativePath); + } + return { type: "delete-remote", path: this.relativePath, size: 0 }; + } +} +class DeleteLocalAction { + /** + * Creates a new DeleteLocalAction for the given relative path. + * @param relativePath - Path relative to the sync root. + * @param absolutePath - Absolute local filesystem path. + * @param doDelete - Callback that performs the deletion. + */ + constructor(relativePath, absolutePath, doDelete) { + this.relativePath = relativePath; + this.absolutePath = absolutePath; + this.doDelete = doDelete; + } + type = "delete-local"; + size = 0; + /** + * Deletes the local file (unless dryRun) and returns a 'delete-local' event. + * @param dryRun - Whether to simulate the action without making changes. + * + * @returns An async generator yielding sync progress events. + */ + async execute(dryRun) { + if (!dryRun) { + await this.doDelete(this.absolutePath); + } + return { type: "delete-local", path: this.relativePath, size: 0 }; + } +} +class SkipAction { + /** + * Creates a new SkipAction for the given relative path. + * @param relativePath - Path relative to the sync root. + * @param reason - Human-readable explanation for why the file was skipped. + */ + constructor(relativePath, reason) { + this.relativePath = relativePath; + this.reason = reason; + } + type = "skip"; + size = 0; + /** + * Returns a 'skip' event with the reason message. No I/O is performed. + * @param _dryRun - Whether to simulate the action (unused for no-op). + * + * @returns An async generator yielding sync progress events. + */ + async execute(_dryRun) { + return { type: "skip", path: this.relativePath, size: 0, message: this.reason }; + } +} //# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/regexp-safety.js -//#region src/sync/regexp-safety.ts -var MAX_REGEXP_SOURCE_LENGTH = 512; -var MAX_REGEXP_INPUT_LENGTH = 1024; -var MAX_REGEXP_UNBOUNDED_QUANTIFIERS = 1; -var MAX_REGEXP_BOUNDED_QUANTIFIER = 200; -var MAX_REGEXP_BOUNDED_QUANTIFIERS = 16; -var MAX_REGEXP_BOUNDED_QUANTIFIER_PRODUCT = 1e4; -var safeRegExpCache = /* @__PURE__ */ new WeakMap(); -var validatedFilterCache = /* @__PURE__ */ new WeakSet(); -/** -* Validates every RegExp filter in an include/exclude filter set. -* -* @param filters - Optional include and exclude filters to validate. -* -* @throws When a RegExp filter is too large or structurally unsafe. -*/ -function validateSyncFilters(filters) { - if (filters === void 0) return; - if (validatedFilterCache.has(filters)) return; - validateSyncFilterList("include", filters.include); - validateSyncFilterList("exclude", filters.exclude); - validatedFilterCache.add(filters); -} -/** -* Tests a path with a caller-provided RegExp without retaining `lastIndex` state. -* -* @param relativePath - Folder-relative path to test. -* @param pattern - Caller-provided RegExp filter. -* -* @returns True when the RegExp matches the relative path. -* -* @throws When the RegExp filter is too large or structurally unsafe. -*/ -function regexpMatchesSyncPath(relativePath, pattern) { - if (pathExceedsSafeRegExpInput(relativePath)) return false; - return regexpWithoutState(pattern).test(relativePath); -} -/** -* Tests whether a relative path is too long to feed to caller-provided RegExp filters. -* -* @param relativePath - Folder-relative path to test. -* -* @returns True when RegExp filters should not be evaluated for the path. -*/ -function pathExceedsSafeRegExpInput(relativePath) { - return relativePath.length > MAX_REGEXP_INPUT_LENGTH; -} -function validateSyncFilterList(kind, patterns) { - for (const pattern of patterns ?? []) if (typeof pattern !== "string") regexpWithoutState(pattern, kind); -} -function regexpWithoutState(pattern, kind = "pattern") { - const cached = safeRegExpCache.get(pattern); - if (cached !== void 0) return cached; - assertSafeRegExp(pattern, kind); - const compiled = new RegExp(pattern.source, pattern.flags.replace(/[gy]/g, "")); - safeRegExpCache.set(pattern, compiled); - return compiled; -} -function assertSafeRegExp(pattern, kind) { - const source = pattern.source; - if (source.length > MAX_REGEXP_SOURCE_LENGTH) throw new Error(`Sync filter RegExp is too long (${kind}: /${source}/)`); - if (!regexpSourceLooksSafe(source)) throw new Error(`Sync filter RegExp is too complex (${kind}: /${source}/)`); -} -/** -* Best-effort linear RegExp guard for filters matched synchronously on attacker-controlled paths. -* -* The accepted subset intentionally rejects constructs that are hard to bound in the JavaScript -* RegExp engine: backreferences, unterminated escapes/classes/groups, repeated unbounded -* quantifiers, bounded quantifiers above {@link MAX_REGEXP_BOUNDED_QUANTIFIER}, too many bounded -* quantifiers or too large a bounded-quantifier product, and any quantified group whose subtree -* already contains a quantifier or alternation. Group state is propagated upward so nested groups -* cannot hide a quantified or alternated subtree before an outer bounded or unbounded quantifier. -* -* @param source - RegExp source text to inspect. -* -* @returns True when the source passes the SDK's structural safety heuristic. -*/ -function regexpSourceLooksSafe(source) { - let escaped = false; - let inClass = false; - let unboundedQuantifiers = 0; - let boundedQuantifiers = 0; - let boundedQuantifierProduct = 1; - const groups = []; - let lastToken = null; - for (let i = 0; i < source.length; i++) { - const char = source[i] ?? ""; - if (escaped) { - if (!inClass && char === "k" && source[i + 1] === "<") return false; - if (!inClass && /[1-9]/.test(char)) return false; - escaped = false; - lastToken = { type: "atom" }; - continue; - } - if (char === "\\") { - escaped = true; - continue; - } - if (inClass) { - if (char === "]") inClass = false; - continue; - } - if (char === "[") { - inClass = true; - lastToken = { type: "atom" }; - continue; - } - if (char === "(") { - groups.push({ - hasQuantifier: false, - hasAlternation: false - }); - lastToken = null; - continue; - } - if (char === ")") { - const group = groups.pop(); - if (!group) return false; - const parent = groups.at(-1); - if (parent) mergeGroupState(parent, group); - lastToken = { - type: "group", - ...group - }; - continue; - } - if (char === "|") { - const group = groups.at(-1); - if (group) group.hasAlternation = true; - lastToken = null; - continue; - } - const quantifier = lastToken !== null ? parseQuantifier(source, i) : null; - if (lastToken !== null && quantifier !== null) { - if (lastToken?.type === "group" && (lastToken.hasQuantifier || lastToken.hasAlternation)) return false; - if (quantifier.unbounded) { - unboundedQuantifiers++; - if (unboundedQuantifiers > MAX_REGEXP_UNBOUNDED_QUANTIFIERS) return false; - } else { - boundedQuantifiers++; - if (boundedQuantifiers > MAX_REGEXP_BOUNDED_QUANTIFIERS) return false; - if (quantifier.maxRepetitions > MAX_REGEXP_BOUNDED_QUANTIFIER) return false; - boundedQuantifierProduct *= Math.max(quantifier.maxRepetitions, 1); - if (boundedQuantifierProduct > MAX_REGEXP_BOUNDED_QUANTIFIER_PRODUCT) return false; - } - const group = groups.at(-1); - if (group) group.hasQuantifier = true; - i = quantifier.endIndex; - lastToken = null; - continue; - } - lastToken = { type: "atom" }; - } - return !escaped && !inClass && groups.length === 0; -} -function mergeGroupState(target, source) { - target.hasQuantifier = target.hasQuantifier || source.hasQuantifier; - target.hasAlternation = target.hasAlternation || source.hasAlternation; -} -function parseQuantifier(source, index) { - const char = source[index]; - if (char === "*" || char === "+") return { - endIndex: index, - maxRepetitions: Number.POSITIVE_INFINITY, - unbounded: true - }; - if (char === "?") return { - endIndex: index, - maxRepetitions: 1, - unbounded: false - }; - if (char !== "{") return null; - const end = source.indexOf("}", index + 1); - if (end === -1) return null; - const body = source.slice(index + 1, end); - const match = /^(\d+)(?:,(\d*))?$/.exec(body); - if (!match) return null; - const min = Number(match[1]); - const maxText = match[2]; - const unbounded = body.includes(",") && maxText === ""; - return { - endIndex: end, - maxRepetitions: unbounded ? Number.POSITIVE_INFINITY : Number(maxText ?? min), - unbounded - }; -} -//#endregion - - -//# sourceMappingURL=regexp-safety.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scan-events.js -//#region src/sync/scan-events.ts -/** -* Emits a scanner skip event without letting observer failures abort the scan. -* -* @param filters - Scan options that may include an onSkip callback. -* @param event - Skip event to report. -*/ -function emitScannerSkip(filters, event) { - try { - filters?.onSkip?.(event); - } catch {} -} -/** -* Builds a consistent skip event for paths that cannot be safely tested against RegExp filters. -* -* @param relativePath - Sync-relative path that exceeded the RegExp input limit. -* -* @returns A typed scanner skip event. -*/ -function regexpInputTooLongSkip(relativePath) { - return { - type: "skip", - path: relativePath, - size: 0, - message: `Skipped sync path ${JSON.stringify(relativePath)}: path exceeds the RegExp filter input limit`, - reason: "path-too-long-for-regexp" - }; -} -//#endregion - - -//# sourceMappingURL=scan-events.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/filters.js - - -//#region src/sync/filters.ts -/** -* Tests whether a relative sync path is included by the configured include/exclude filters. -* Exclude filters win over include filters when both match the same path. -* -* @param relativePath - Folder-relative path using forward slashes. -* @param filters - Optional include and exclude filters. -* -* @returns True when the path should remain in the sync scan. -*/ -function pathPassesSyncFilters(relativePath, filters) { - validateSyncFilters(filters); - const path = normalizePath(relativePath); - if (normalizedPathSkippedByRegExpInputLimit(path, filters)) return false; - const include = filters?.include ?? []; - const exclude = filters?.exclude ?? []; - if (include.length > 0) { - if (!include.some((pattern) => matchesPattern(path, pattern))) return false; - } - return !exclude.some((pattern) => matchesPattern(path, pattern)); -} -/** -* Tests whether a directory may contain paths admitted by the configured filters. -* -* @param relativePath - Folder-relative directory path using forward slashes. -* @param filters - Optional include and exclude filters. -* -* @returns True when the scanner should descend into the directory. -*/ -function directoryMayContainSyncPaths(relativePath, filters) { - validateSyncFilters(filters); - const path = normalizePath(relativePath); - if (path === "") return true; - if ((filters?.exclude ?? []).some((pattern) => stringPatternExcludesAllDescendants(path, pattern))) return false; - const include = filters?.include ?? []; - return include.length === 0 || include.some((pattern) => patternMayMatchDescendant(path, pattern)); -} -/** -* Returns the safe literal prefix that B2 listing can use for include filters. -* Exclude filters are not considered because they cannot narrow a B2 prefix. -* -* @param filters - Optional include and exclude filters. -* -* @returns A folder-relative literal prefix, or an empty string when no safe narrowing exists. -*/ -function literalPrefixForSyncFilters(filters) { - validateSyncFilters(filters); - const include = filters?.include ?? []; - let commonPrefix; - for (const pattern of include) { - if (patternIsRegExp(pattern)) return ""; - const glob = normalizePath(pattern); - if (!glob.includes("/")) return ""; - const prefix = literalPrefixForGlob(glob); - if (prefix === "") return ""; - commonPrefix = commonPrefix === void 0 ? prefix : commonLiteralPrefix(commonPrefix, prefix); - } - return commonPrefix ?? ""; -} -/** -* Filters an async iterable of sync paths while preserving the original item type. -* -* @typeParam T - Concrete sync path shape yielded by the source folder. -* -* @param paths - Async iterable of folder scan results. -* @param filters - Optional include and exclude filters. -* -* @returns A filtered async generator of sync paths. -*/ -async function* filterSyncPaths(paths, filters) { - for await (const path of paths) if (pathPassesSyncFilters(path.relativePath, filters)) yield path; - else if (pathSkippedByRegExpInputLimit(path.relativePath, filters)) emitScannerSkip(filters, regexpInputTooLongSkip(normalizePath(path.relativePath))); -} -/** -* Tests whether a path is skipped because RegExp filters are configured and the normalized path -* exceeds the SDK RegExp input guard. -* -* @param relativePath - Folder-relative path using forward slashes. -* @param filters - Optional include and exclude filters. -* -* @returns True when any RegExp filter is present and the path is too long to evaluate. -*/ -function pathSkippedByRegExpInputLimit(relativePath, filters) { - validateSyncFilters(filters); - return normalizedPathSkippedByRegExpInputLimit(normalizePath(relativePath), filters); -} -function normalizedPathSkippedByRegExpInputLimit(normalizedPath, filters) { - if (!pathExceedsSafeRegExpInput(normalizedPath) || !filtersContainRegExp(filters)) return false; - return true; -} -function matchesPattern(relativePath, pattern) { - if (patternIsRegExp(pattern)) return regexpMatchesSyncPath(relativePath, pattern); - const glob = normalizePath(pattern); - if (glob === "") return relativePath === ""; - const segments = splitPath(relativePath); - if (!glob.includes("/")) return segments.some((segment) => matchSegmentGlob(segment, glob)); - return matchPathGlob(segments, splitPath(glob)); -} -function stringPatternExcludesAllDescendants(relativePath, pattern) { - if (patternIsRegExp(pattern)) return false; - const glob = normalizePath(pattern); - if (glob === "") return false; - if (!glob.includes("/")) return matchesPattern(relativePath, pattern); - const globSegments = splitPath(glob); - return globSegments.at(-1) === "**" && matchPathGlob(splitPath(relativePath), globSegments); -} -function filtersContainRegExp(filters) { - return filters?.include?.some(patternIsRegExp) === true || filters?.exclude?.some(patternIsRegExp) === true; -} -function patternMayMatchDescendant(relativePath, pattern) { - if (patternIsRegExp(pattern)) return true; - const glob = normalizePath(pattern); - if (glob === "" || !glob.includes("/")) return true; - const pathSegments = splitPath(relativePath); - const globSegments = splitPath(glob); - const length = Math.min(pathSegments.length, globSegments.length); - for (let i = 0; i < length; i++) { - const globSegment = globSegments[i]; - if (globSegment === "**" || globSegment === void 0 || hasGlobWildcard(globSegment)) return true; - if (globSegment !== pathSegments[i]) return false; - } - return true; -} -function matchPathGlob(pathSegments, globSegments) { - let reachable = new Array(pathSegments.length + 1).fill(false); - reachable[0] = true; - for (const globSegment of globSegments) { - const next = new Array(pathSegments.length + 1).fill(false); - if (globSegment === "**") { - let canReach = false; - for (let i = 0; i <= pathSegments.length; i++) { - canReach = canReach || reachable[i] === true; - next[i] = canReach; - } - } else for (let i = 0; i < pathSegments.length; i++) if (reachable[i] === true && matchSegmentGlob(pathSegments[i] ?? "", globSegment)) next[i + 1] = true; - reachable = next; - } - return reachable[pathSegments.length] === true; -} -function matchSegmentGlob(segment, glob) { - let segmentIndex = 0; - let globIndex = 0; - let starIndex = -1; - let starMatchIndex = 0; - while (segmentIndex < segment.length) { - const globChar = glob[globIndex]; - if (globChar === "?" || globChar === segment[segmentIndex]) { - globIndex++; - segmentIndex++; - } else if (globChar === "*") { - while (glob[globIndex + 1] === "*") globIndex++; - starIndex = globIndex; - starMatchIndex = segmentIndex; - globIndex++; - } else if (starIndex !== -1) { - globIndex = starIndex + 1; - starMatchIndex++; - segmentIndex = starMatchIndex; - } else return false; - } - while (glob[globIndex] === "*") globIndex++; - return globIndex === glob.length; -} -function literalPrefixForGlob(glob) { - const segments = splitPath(glob); - const literalSegments = []; - let firstWildcardIndex = segments.length; - for (const [index, segment] of segments.entries()) { - if (segment === "**" || hasGlobWildcard(segment)) { - firstWildcardIndex = index; - break; - } - literalSegments.push(segment); - } - if (literalSegments.length === 0) return ""; - const prefix = literalSegments.join("/"); - const wildcardTail = segments.slice(firstWildcardIndex); - if (wildcardTail.length > 0 && wildcardTail.every((segment) => segment === "**")) return prefix; - return literalSegments.length < segments.length ? `${prefix}/` : prefix; -} -function commonLiteralPrefix(a, b) { - let end = 0; - const max = Math.min(a.length, b.length); - while (end < max && a[end] === b[end]) end++; - return trimTrailingHighSurrogate(a.slice(0, end)); -} -function trimTrailingHighSurrogate(value) { - const lastCodeUnit = value.charCodeAt(value.length - 1); - return lastCodeUnit >= 55296 && lastCodeUnit <= 56319 ? value.slice(0, -1) : value; -} -function hasGlobWildcard(glob) { - return glob.includes("*") || glob.includes("?"); -} -function patternIsRegExp(pattern) { - return typeof pattern !== "string"; -} -function splitPath(path) { - if (path === "") return []; - return path.split("/").filter((segment) => segment !== ""); -} -function normalizePath(path) { - let normalized = path.split("\\").join("/"); - while (normalized.startsWith("./")) normalized = normalized.slice(2); - while (normalized.startsWith("/")) normalized = normalized.slice(1); - while (normalized.endsWith("/") && normalized.length > 1) normalized = normalized.slice(0, -1); - return normalized; -} -//#endregion - - -//# sourceMappingURL=filters.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/path-order.js -//#region src/sync/path-order.ts -/** -* Compares sync-relative paths using the same code-unit order everywhere sorted scans are consumed. -* -* @param left - First sync-relative path. -* @param right - Second sync-relative path. -* -* @returns Negative, zero, or positive using JavaScript code-unit order. -*/ -function compareSyncRelativePaths(left, right) { - return compareCodeUnits(left, right); -} -/** -* Compares strings by JavaScript code-unit order. -* -* @param left - First string. -* @param right - Second string. -* -* @returns Negative, zero, or positive using code-unit order. -*/ -function compareCodeUnits(left, right) { - if (left < right) return -1; - if (left > right) return 1; - return 0; -} -//#endregion - - -//# sourceMappingURL=path-order.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scan-limit.js -//#region src/sync/scan-limit.ts -/** Default maximum number of entries a sync scanner may retain before failing. */ -var DEFAULT_MAX_SCAN_ENTRIES = 1e6; -/** -* Resolves and validates the effective scan entry limit. -* @param options - Optional scan options carrying an override. -* -* @returns The configured or default scan entry limit. -* -* @throws When the configured limit is not a positive safe integer or Infinity. -*/ -function scanEntryLimit(options) { - const limit = options?.maxScanEntries ?? 1e6; - if (limit === Number.POSITIVE_INFINITY) return limit; - if (!Number.isSafeInteger(limit) || limit < 1) throw new Error("maxScanEntries must be a positive safe integer or Infinity"); - return limit; -} -/** -* Throws when a scanner has retained more entries than the configured limit. -* @param count - Number of retained entries. -* @param limit - Maximum allowed retained entries. -* -* @throws When count is greater than limit. -*/ -function assertScanEntryLimit(count, limit) { - if (count > limit) throw new Error(`Sync scan entry limit exceeded: maxScanEntries=${limit} was exceeded after ${count} scanned entries; raising maxScanEntries increases peak scanner memory`); -} -//#endregion - - -//# sourceMappingURL=scan-limit.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/pairing.js - - - - -//#region src/sync/pairing.ts -/** -* Merge-joins two sorted folder scans by relative path, yielding paired tuples. -* Files present only in source yield `[source, null]`, only in dest yield `[null, dest]`, -* and files in both yield `[source, dest]`. -* -* @param source - The source folder to scan. -* @param dest - The destination folder to scan. -* @param options - Optional scan controls and filters shared by both folders. -* @param scanCallbacks - Optional internal source/destination skip callbacks. -*/ -async function* zipFolders(source, dest, options = {}, scanCallbacks = {}) { - validateSyncFilters(options); - const sourceOptions = scanOptionsSnapshot(options, scanCallbacks.onSourceSkip); - const destOptions = scanOptionsSnapshot(options, scanCallbacks.onDestSkip); - const sourceIter = scanWithFilters(source, sourceOptions)[Symbol.asyncIterator](); - const destIter = scanWithFilters(dest, destOptions)[Symbol.asyncIterator](); - let sourceDone = false; - let destDone = false; - try { - let [sourceResult, destResult] = await Promise.all([sourceIter.next(), destIter.next()]); - sourceDone = sourceResult.done === true; - destDone = destResult.done === true; - while (!sourceResult.done || !destResult.done) { - const s = sourceResult.done ? null : sourceResult.value; - const d = destResult.done ? null : destResult.value; - if (s === null) { - yield [null, d]; - destResult = await destIter.next(); - destDone = destResult.done === true; - } else if (d === null) { - yield [s, null]; - sourceResult = await sourceIter.next(); - sourceDone = sourceResult.done === true; - } else { - const comparison = compareSyncRelativePaths(s.relativePath, d.relativePath); - if (comparison < 0) { - yield [s, null]; - sourceResult = await sourceIter.next(); - sourceDone = sourceResult.done === true; - } else if (comparison > 0) { - yield [null, d]; - destResult = await destIter.next(); - destDone = destResult.done === true; - } else { - yield [s, d]; - sourceResult = await sourceIter.next(); - destResult = await destIter.next(); - sourceDone = sourceResult.done === true; - destDone = destResult.done === true; - } - } - } - } finally { - await closeScanIterator(sourceIter, sourceDone); - await closeScanIterator(destIter, destDone); - } -} -async function closeScanIterator(iterator, alreadyDone) { - if (alreadyDone || iterator.return === void 0) return; - try { - await iterator.return(); - } catch {} -} -function scanWithFilters(folder, options) { - const scanned = filterSyncPaths(folder.scan(options.scanner), options.sdk); - if (folder.appliesScanSorting === true) return limitSyncPaths(scanned, options.sdk); - return sortSyncPaths(scanned, options.sdk); -} -async function* limitSyncPaths(paths, filters) { - const maxScanEntries = scanEntryLimit(filters); - let count = 0; - for await (const path of paths) { - count++; - assertScanEntryLimit(count, maxScanEntries); - yield path; - } -} -async function* sortSyncPaths(paths, filters) { - const maxScanEntries = scanEntryLimit(filters); - const collected = []; - for await (const path of paths) { - collected.push(path); - assertScanEntryLimit(collected.length, maxScanEntries); - } - collected.sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath)); - yield* collected; -} -function scanOptionsSnapshot(options, onSkip) { - const onSkipSnapshot = options.onSkip === void 0 && onSkip === void 0 ? void 0 : (event) => { - options.onSkip?.(event); - onSkip?.(event); - }; - return { - scanner: frozenScanOptions(options, frozenPatterns(options.include), frozenPatterns(options.exclude), onSkipSnapshot), - sdk: frozenScanOptions(options, frozenPatterns(options.include), frozenPatterns(options.exclude), onSkipSnapshot) - }; -} -function frozenScanOptions(options, include, exclude, onSkip) { - return Object.freeze({ - ...include !== void 0 ? { include } : {}, - ...exclude !== void 0 ? { exclude } : {}, - ...options.signal !== void 0 ? { signal: options.signal } : {}, - ...options.onError !== void 0 ? { onError: options.onError } : {}, - ...onSkip !== void 0 ? { onSkip } : {}, - ...options.requireLocalSafePaths !== void 0 ? { requireLocalSafePaths: options.requireLocalSafePaths } : {}, - ...options.maxScanEntries !== void 0 ? { maxScanEntries: options.maxScanEntries } : {} - }); -} -function frozenPatterns(patterns) { - return patterns === void 0 ? void 0 : Object.freeze([...patterns]); -} -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/pairing.js +async function* zipFolders(source, dest) { + const sourceIter = source.scan()[Symbol.asyncIterator](); + const destIter = dest.scan()[Symbol.asyncIterator](); + let sourceResult = await sourceIter.next(); + let destResult = await destIter.next(); + while (!sourceResult.done || !destResult.done) { + const s = sourceResult.done ? null : sourceResult.value; + const d = destResult.done ? null : destResult.value; + if (s === null) { + yield [null, d]; + destResult = await destIter.next(); + } else if (d === null) { + yield [s, null]; + sourceResult = await sourceIter.next(); + } else if (s.relativePath < d.relativePath) { + yield [s, null]; + sourceResult = await sourceIter.next(); + } else if (d.relativePath < s.relativePath) { + yield [null, d]; + destResult = await destIter.next(); + } else { + yield [s, d]; + sourceResult = await sourceIter.next(); + destResult = await destIter.next(); + } + } +} //# sourceMappingURL=pairing.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/error-reason.js - -//#region src/util/error-reason.ts -/** -* Formats an unknown error for public diagnostics without leaking filesystem paths. -* -* @param err - Unknown thrown value. -* -* @returns A stable, sanitized reason. -*/ -function sanitizeErrorReason(err) { - const error = toError(err); - const code = error.code; - if (typeof code === "string" && code.length > 0) { - const reason = cleanReason(code); - if (reason.length > 0) return reason; - } - const message = cleanReason(error.message); - if (message.length > 0 && !/[\\/]/.test(message)) return message; - const name = cleanReason(error.name); - if (name.length > 0) return name; - return "Error"; -} -function cleanReason(value) { - let cleaned = ""; - let sawNonWhitespace = false; - for (const char of value) { - const code = char.charCodeAt(0); - if (code < 32 || code === 127) continue; - if (!sawNonWhitespace) { - if (char.trim().length === 0) continue; - sawNonWhitespace = true; - } - cleaned += char; - if (cleaned.length >= 200) break; - } - return cleaned.trimEnd(); -} -//#endregion - - -//# sourceMappingURL=error-reason.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/sha1-options.js -//#region src/sync/sha1-options.ts -/** Default idle/no-progress timeout for SHA-1 reads. */ -var DEFAULT_SHA1_IDLE_TIMEOUT_MILLIS = 3e4; -/** Default absolute deadline for one untrusted B2 SHA-1 verification read. */ -var DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS = 3e5; -/** -* Normalizes a user-provided SHA-1 timeout value. -* -* @param value - Optional timeout in milliseconds. -* @param defaultValue - Default timeout when the value is missing or invalid. -* -* @returns A positive integer timeout in milliseconds. -*/ -function normalizeSha1TimeoutMillis(value, defaultValue = DEFAULT_SHA1_IDLE_TIMEOUT_MILLIS) { - if (value === void 0 || !Number.isFinite(value) || value < 1) return defaultValue; - return Math.floor(value); -} -//#endregion - - -//# sourceMappingURL=sha1-options.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-file-identity.js -//#region src/sync/local-file-identity.ts -/** -* Converts Node file stats into the sync scanner's persisted identity shape. -* @param stats - Node file stats to convert. -* -* @returns The scanner identity stored with a local sync path. -* -* @internal -*/ -function localFileIdentityFromStats(stats) { - return { - deviceId: stats.dev, - inode: stats.ino, - size: stats.size, - modTimeMillis: Math.floor(stats.mtimeMs), - changeTimeMillis: Math.floor(stats.ctimeMs) - }; -} -/** -* Verifies that current local stats still match a previously scanned regular file. -* @param stats - Current filesystem stats for the candidate file. -* @param path - Previously scanned local sync path. -* @param operation - Operation name used in mutation diagnostics. -* @param options - Platform and ctime comparison overrides for controlled filesystem moves. -* -* @throws If the current file is not the scanned regular file. -* -* @internal -*/ -function assertSameScannedRegularFile(stats, path, operation = "upload", options = {}) { - const reason = `local file changed before ${operation}`; - if (!stats.isFile()) { - if (operation === "delete") throw Object.assign(/* @__PURE__ */ new Error(`${reason}: not a regular file`), { code: "EISDIR" }); - throw new Error(`${reason}: not a regular file`); - } - if (stats.size !== path.size) throw new Error(`${reason}: size changed`); - const identity = path.fileIdentity; - if (identity === void 0) return; - if (!sameLocalIdentity(stats, identity, { - compareChangeTime: options.compareChangeTime, - platform: options.platform ?? currentPlatform() - })) throw new Error(reason); -} -function sameLocalIdentity(stats, identity, options) { - const compareChangeTime = options.compareChangeTime ?? local_file_identity_shouldComparePosixChangeTime(options.platform); - return (!local_file_identity_shouldComparePosixFileIdentity(options.platform) || stats.dev === identity.deviceId && stats.ino === identity.inode) && stats.size === identity.size && Math.floor(stats.mtimeMs) === identity.modTimeMillis && (!compareChangeTime || identity.changeTimeMillis === void 0 || Math.floor(stats.ctimeMs) === identity.changeTimeMillis); -} -function local_file_identity_shouldComparePosixFileIdentity(platform) { - return platform !== "win32"; -} -function local_file_identity_shouldComparePosixChangeTime(platform) { - return platform !== "win32"; -} -function currentPlatform() { - return globalThis.process?.platform; -} -//#endregion - - -//# sourceMappingURL=local-file-identity.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-sha1.js - - - - - -//#region src/sync/local-sha1.ts -/** -* Formats a hash error for public sync events without leaking filesystem paths. -* -* @param error - Error thrown while hashing. -* -* @returns A sanitized reason suitable for event messages. -*/ -function formatHashError(error) { - return sanitizeErrorReason(error); -} -/** -* Returns whether an error represents an abort. -* -* @param err - Unknown thrown value. -* -* @returns True for AbortError values. -*/ -function local_sha1_isAbortError(err) { - return toError(err).name === "AbortError"; -} -/** -* Reads a local file and computes its SHA-1 digest with non-regular-file rejection, -* scanned-size bounds, abort support, and an idle/no-progress timeout. -* -* @param path - Local sync path to hash. -* @param signal - Optional abort signal. -* @param options - Optional idle timeout override. -* -* @returns The lowercase SHA-1 digest of the file bytes. -*/ -async function readLocalSha1File(path, signal, options = {}) { - const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19)); - const { lstat, open } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - const timeoutMillis = normalizeSha1TimeoutMillis(options.timeoutMillis); - const flags = constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0); - const hash = new IncrementalSha1(); - let stream; - let file; - let timeout; - function armTimeout(onTimeout) { - if (timeout !== void 0) clearTimeout(timeout); - timeout = setTimeout(onTimeout, timeoutMillis); - } - try { - signal?.throwIfAborted(); - assertSameScannedRegularFile(await withTimeout(lstat(path.absolutePath), timeoutMillis, "sha1 file status"), path, "sha1 comparison"); - file = await openWithTimeout(open(path.absolutePath, flags), timeoutMillis); - assertSameScannedRegularFile(await withTimeout(lstat(path.absolutePath), timeoutMillis, "sha1 file status"), path, "sha1 comparison"); - assertSameScannedRegularFile(await withTimeout(file.stat(), timeoutMillis, "sha1 file status"), path, "sha1 comparison"); - stream = file.createReadStream({ - ...path.size > 0 ? { - start: 0, - end: path.size - 1 - } : {}, - ...signal !== void 0 ? { signal } : {} - }); - let bytesRead = 0; - /* v8 ignore next 3 -- idle-timeout firing is timing-dependent in filesystem tests */ - armTimeout(() => { - stream?.destroy(/* @__PURE__ */ new Error(`sha1 read stalled for ${timeoutMillis} ms`)); - }); - for await (const chunk of stream) { - bytesRead += chunk.byteLength; - await hash.update(chunk); - /* v8 ignore next 3 -- idle-timeout firing is timing-dependent in filesystem tests */ - armTimeout(() => { - stream?.destroy(/* @__PURE__ */ new Error(`sha1 read stalled for ${timeoutMillis} ms`)); - }); - } - /* v8 ignore next -- defensive TOCTOU guard after the bounded stream completes */ - if (bytesRead !== path.size) throw new Error("file changed during sha1 comparison"); - return hash.digest(); - } finally { - if (timeout !== void 0) clearTimeout(timeout); - stream?.destroy(); - await file?.close().catch(() => {}); - } -} -/* v8 ignore start -- defensive stale-filesystem stall handling is not portable to trigger */ -async function withTimeout(promise, timeoutMillis, operation) { - let timeout; - try { - return await Promise.race([promise, new Promise((_, reject) => { - timeout = setTimeout(() => { - reject(/* @__PURE__ */ new Error(`${operation} stalled for ${timeoutMillis} ms`)); - }, timeoutMillis); - })]); - } finally { - if (timeout !== void 0) clearTimeout(timeout); - } -} -async function openWithTimeout(promise, timeoutMillis) { - let timedOut = false; - const tracked = promise.then((file) => { - if (timedOut) file.close().catch(() => {}); - return file; - }, (err) => { - throw err; - }); - try { - return await withTimeout(tracked, timeoutMillis, "sha1 file open"); - } catch (err) { - timedOut = true; - throw err; - } -} -/* v8 ignore stop */ -//#endregion - - -//# sourceMappingURL=local-sha1.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/sha1-metadata.js - -//#region src/sync/sha1-metadata.ts -/** Prefix used to mark SHA-1 metadata that must not prove equality without byte verification. */ -var untrustedSha1Prefix = "unverified:"; -/** -* Marks a verifiable SHA-1 digest as untrusted provider metadata. -* -* @param sha1 - Verifiable 40-character hexadecimal SHA-1 digest. -* -* @returns The untrusted SHA-1 sentinel value. -* -* @throws When the supplied value is not a verifiable SHA-1 digest. -*/ -function untrustedSha1(sha1) { - const normalized = normalizeVerifiableSha1(sha1); - if (normalized === null) throw new Error("untrusted SHA-1 metadata must be verifiable"); - return `${untrustedSha1Prefix}${normalized}`; -} -/** -* Extracts the best comparable SHA-1 value from a B2 file version. -* -* B2's primary `contentSha1` is authoritative for single-part uploads when it is a verifiable -* digest. Large/multipart B2 files report `contentSha1: null`; `fileInfo.large_file_sha1` is -* caller-provided metadata, so it is returned as an untrusted hint that cannot prove equality -* until the high-level synchronizer hashes the selected version's bytes. -* -* @param version - B2 file version metadata. -* -* @returns A lowercase comparable SHA-1, an untrusted sentinel, or null when unavailable. -*/ -function selectB2ComparableSha1(version) { - const originalContentSha1 = version.contentSha1; - if (typeof originalContentSha1 === "string") { - if (isUntrustedSha1(originalContentSha1)) return originalContentSha1.toLowerCase(); - return normalizeVerifiableSha1(originalContentSha1) ?? originalContentSha1.toLowerCase(); - } - const largeFileSha1 = normalizeVerifiableSha1(version.fileInfo["large_file_sha1"]); - return largeFileSha1 === null ? null : untrustedSha1(largeFileSha1); -} -/** -* Returns whether a SHA-1 value is marked as untrusted metadata. -* -* @param sha1 - Candidate SHA-1 metadata. -* -* @returns True when the value carries B2's unverified sentinel prefix. -*/ -function isUntrustedSha1(sha1) { - return sha1?.toLowerCase().startsWith("unverified:") ?? false; -} -/** -* Parses the public `SyncPath.contentSha1` value into an explicit trust/availability state. -* -* @param sha1 - The raw `contentSha1` field from a sync path. -* -* @returns A discriminated state so custom scanners do not need to decode sentinels directly. -*/ -function parseSyncContentSha1(sha1) { - if (sha1 === void 0) return { kind: "pending" }; - if (sha1 === null) return { kind: "unavailable" }; - if (isUntrustedSha1(sha1)) return { - kind: "untrusted", - raw: sha1, - value: normalizeVerifiableSha1(sha1.slice(11)) - }; - const normalized = normalizeVerifiableSha1(sha1); - if (normalized === null) return { - kind: "untrusted", - raw: sha1, - value: null - }; - return { - kind: "verified", - value: normalized - }; -} -/** -* Reads an explicit SHA-1 state when present, otherwise parses the compatibility field. -* -* @param path - Object carrying SHA-1 metadata. -* -* @returns The explicit or parsed SHA-1 state. -*/ -function syncSha1StateOf(path) { - return path.contentSha1State ?? parseSyncContentSha1(path.contentSha1); -} -//#endregion - - -//# sourceMappingURL=sha1-metadata.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/compare.js - - - - - -//#region src/sync/policies/compare.ts -/** -* Determines whether two files should be considered different based on the compare mode. -* For `sha1`, callers that use the low-level policy helpers should first prepare the pair so -* local hashes and comparable B2 hashes are populated. -* -* @param source - The source file metadata. -* @param dest - The destination file metadata. -* @param compareMode - The comparison strategy: 'modtime', 'size', 'sha1', or 'none'. -* @param threshold - Tolerance for the comparison (bytes for size, milliseconds for modtime). -* -* @returns `true` if the files are considered different. -* -* @throws When `compareMode` is not one of the supported compare modes. -*/ -function filesAreDifferent(source, dest, compareMode, threshold = 0) { - switch (compareMode) { - case "none": return false; - case "size": return Math.abs(source.size - dest.size) > threshold; - case "sha1": return sha1ValuesAreDifferent(source, dest); - case "modtime": return Math.abs(source.modTimeMillis - dest.modTimeMillis) > threshold; - default: throw new Error(`Unsupported compare mode: ${String(compareMode)}`); - } -} -/** -* Throws when a runtime compare mode value is unsupported. -* -* @param compareMode - User-supplied compare mode. -* -* @throws When `compareMode` is not one of the supported values. -*/ -function assertSupportedCompareMode(compareMode) { - switch (compareMode) { - case "none": - case "size": - case "sha1": - case "modtime": return; - default: throw new Error(`Unsupported compare mode: ${String(compareMode)}`); - } -} -function sha1ValuesAreDifferent(source, dest) { - if (source.size !== dest.size) return true; - const sourceSha1 = comparableSha1(source); - const destSha1 = comparableSha1(dest); - if (sourceSha1.kind === "untrusted" || destSha1.kind === "untrusted") return true; - if (sourceSha1.kind === "unavailable" || destSha1.kind === "unavailable") return true; - return sourceSha1.value !== destSha1.value; -} -/** -* Prepares a pair for the selected compare mode. -* -* For `sha1`, this fills missing B2 hashes from comparable metadata and, when an explicit local -* reader is supplied, hashes the local side only when size cannot already prove a difference. -* Reader failures are converted into per-file sync events instead of aborting the whole run. -* -* @param pair - Source/destination pair from {@link zipFolders}. -* @param compareMode - The comparison strategy. -* @param options - Optional hashing dependencies and cancellation signal. -* -* @returns The prepared pair plus any preparation events. -*/ -async function preparePairForCompare(pair, compareMode, options = {}) { - assertSupportedCompareMode(compareMode); - if (compareMode !== "sha1") return readyComparePair(pair); - const [source, dest] = pair; - if (source === null || dest === null) return readyComparePair(pair); - if (source.size !== dest.size) return readyComparePair(pair); - const metadataPair = [withB2ContentSha1(source), withB2ContentSha1(dest)]; - if (hasUnavailableB2Sha1(metadataPair)) return skipped(metadataPair, unavailableSha1Event(metadataPair)); - if (options.readB2Sha1 === void 0 && hasUntrustedSha1(metadataPair) && !hasVerifiableUntrustedSha1(metadataPair)) return readyComparePair(metadataPair); - const [metadataSource, metadataDest] = metadataPair; - if (metadataSource === null || metadataDest === null) return readyComparePair(metadataPair); - const sourceResult = await prepareLocalPathSha1(metadataSource, options); - if (sourceResult.aborted) return aborted(metadataPair); - if (sourceResult.event) return skipped(metadataPair, sourceResult.event, sourceResult.error, sourceResult.bytesHashed); - const destResult = await prepareLocalPathSha1(metadataDest, options); - if (destResult.aborted) return aborted([sourceResult.path, destResult.path]); - if (destResult.event) return skipped([sourceResult.path, destResult.path], destResult.event, destResult.error, sourceResult.bytesHashed); - const preparedPair = [sourceResult.path, destResult.path]; - const sourceState = comparableSha1(sourceResult.path); - const destState = comparableSha1(destResult.path); - const bytesHashed = sourceResult.bytesHashed + destResult.bytesHashed; - if (sourceState.kind === "unavailable" || destState.kind === "unavailable") return skipped(preparedPair, unavailableSha1Event(preparedPair), void 0, bytesHashed); - const shouldVerifyB2Bytes = untrustedSha1CouldSuppressTransfer(sourceState, destState); - const readB2Sha1 = options.readB2Sha1; - if (shouldVerifyB2Bytes && hasB2Path(preparedPair) && readB2Sha1 !== void 0) return verifyB2Sha1Bytes(preparedPair, { - ...options, - readB2Sha1 - }, bytesHashed); - return readyComparePair(preparedPair, bytesHashed); -} -/** -* Prepares a list of pairs for the selected compare mode with bounded concurrency. -* -* @param pairs - Source/destination pairs from {@link zipFolders}. -* @param compareMode - The comparison strategy. -* @param options - Optional hashing dependencies, cancellation signal, and concurrency. -* -* @returns Prepared results in the same order as the input pairs. -*/ -async function preparePairsForCompare(pairs, compareMode, options = {}) { - assertSupportedCompareMode(compareMode); - if (compareMode !== "sha1") return pairs.map((pair) => ({ - originalPair: pair, - prepared: readyComparePair(pair) - })); - return mapConcurrent(pairs, normalizeConcurrency(options.concurrency), async (pair) => { - if (options.signal?.aborted) return { - originalPair: pair, - prepared: aborted(pair) - }; - return { - originalPair: pair, - prepared: await preparePairForCompare(pair, compareMode, options) - }; - }); -} -async function prepareLocalPathSha1(path, options) { - if (!isLocalSyncPath(path)) return { - path, - bytesHashed: 0, - bytesVerified: 0, - aborted: false - }; - if (options.signal?.aborted) return { - path, - bytesHashed: 0, - bytesVerified: 0, - aborted: true - }; - try { - const state = syncSha1StateOf(path); - if (state.kind === "verified") return { - path: { - ...path, - contentSha1: state.value - }, - bytesHashed: 0, - bytesVerified: 0, - aborted: false - }; - if (state.kind === "unavailable") return { - path: { - ...path, - contentSha1: null - }, - bytesHashed: 0, - bytesVerified: 0, - aborted: false - }; - const readLocalSha1 = options.readLocalSha1; - if (readLocalSha1 === void 0) return { - path: { - ...path, - contentSha1: path.contentSha1 ?? null - }, - bytesHashed: 0, - bytesVerified: 0, - aborted: false - }; - const contentSha1 = await readLocalSha1(path, options.signal, { ...options.sha1ReadTimeoutMillis !== void 0 ? { timeoutMillis: options.sha1ReadTimeoutMillis } : {} }); - return { - path: { - ...path, - contentSha1 - }, - bytesHashed: normalizeVerifiableSha1(contentSha1) === null ? 0 : path.size, - bytesVerified: 0, - aborted: false - }; - } catch (err) { - if (options.signal?.aborted || local_sha1_isAbortError(err)) return { - path, - bytesHashed: 0, - bytesVerified: 0, - aborted: true - }; - const error = toError(err); - return { - path, - bytesHashed: 0, - event: { - type: "error", - path: path.relativePath, - size: 0, - message: `failed to hash local file for sha1 comparison: ${formatHashError(error)}` - }, - error, - bytesVerified: 0, - aborted: false - }; - } -} -async function verifyB2Sha1Bytes(pair, options, bytesHashed) { - const [source, dest] = pair; - /* v8 ignore next -- callers only verify B2 bytes for paired compare results */ - if (source === null || dest === null) return readyComparePair(pair, bytesHashed); - const sourceResult = await prepareUntrustedB2PathSha1(source, options); - const sourceBytesVerified = sourceResult.bytesVerified; - if (sourceResult.aborted) return aborted(pair); - if (sourceResult.event) return skipped([sourceResult.path, dest], sourceResult.event, sourceResult.error, bytesHashed, sourceBytesVerified); - const destResult = await prepareUntrustedB2PathSha1(dest, options); - const bytesVerified = sourceBytesVerified + destResult.bytesVerified; - /* v8 ignore next -- destination abort mirrors the covered source abort path */ - if (destResult.aborted) return aborted([sourceResult.path, destResult.path]); - if (destResult.event) return skipped([sourceResult.path, destResult.path], destResult.event, destResult.error, bytesHashed, bytesVerified); - return readyComparePair([sourceResult.path, destResult.path], bytesHashed, bytesVerified); -} -async function prepareUntrustedB2PathSha1(path, options) { - if (!isB2SyncPath(path) || comparableSha1(path).kind !== "untrusted") return { - path, - bytesHashed: 0, - bytesVerified: 0, - aborted: false - }; - return prepareB2PathSha1(path, options); -} -async function prepareB2PathSha1(path, options) { - /* v8 ignore next -- pre-aborted B2 reads are covered at pair level */ - if (options.signal?.aborted) return { - path, - bytesHashed: 0, - bytesVerified: 0, - aborted: true - }; - try { - const result = await options.readB2Sha1(path, options.signal); - const contentSha1 = typeof result === "object" && result !== null ? result.contentSha1 : result; - const bytesVerified = typeof result === "object" && result !== null ? Math.max(0, result.bytesRead) : 0; - const preparedPath = { - ...path, - contentSha1, - contentSha1State: syncSha1StateOf({ contentSha1 }) - }; - if (contentSha1 === null) return { - path: preparedPath, - bytesHashed: 0, - bytesVerified, - event: unavailableSha1PathEvent(path), - aborted: false - }; - return { - path: preparedPath, - bytesHashed: 0, - bytesVerified, - aborted: false - }; - } catch (err) { - if (options.signal?.aborted || local_sha1_isAbortError(err)) return { - path, - bytesHashed: 0, - bytesVerified: 0, - aborted: true - }; - const error = toError(err); - return { - path, - bytesHashed: 0, - bytesVerified: 0, - event: { - type: "skip", - path: path.relativePath, - size: 0, - message: `sha1 comparison skipped because B2 verification failed: ${formatHashError(error)}` - }, - aborted: false - }; - } -} -function comparableSha1(path) { - const state = syncSha1StateOf(path); - if (state.kind === "verified") return { - kind: "verified", - value: state.value - }; - if (state.kind === "untrusted") return { - kind: "untrusted", - value: state.value - }; - return { kind: "unavailable" }; -} -function untrustedSha1CouldSuppressTransfer(source, dest) { - if (source.kind === "untrusted" && dest.kind === "verified") return source.value === dest.value; - if (dest.kind === "untrusted" && source.kind === "verified") return dest.value === source.value; - if (source.kind === "untrusted" && dest.kind === "untrusted") return source.value !== null && source.value === dest.value; - return false; -} -function withB2ContentSha1(path) { - if (!isB2SyncPath(path) || path.contentSha1 !== void 0 || path.contentSha1State !== void 0) return path; - const contentSha1 = selectB2ComparableSha1(path.selectedVersion); - return { - ...path, - contentSha1, - contentSha1State: syncSha1StateOf({ contentSha1 }) - }; -} -function hasUnavailableB2Sha1(pair) { - const [source, dest] = pair; - return source !== null && isB2SyncPath(source) && comparableSha1(source).kind === "unavailable" || dest !== null && isB2SyncPath(dest) && comparableSha1(dest).kind === "unavailable"; -} -function hasUntrustedSha1(pair) { - const [source, dest] = pair; - return source !== null && comparableSha1(source).kind === "untrusted" || dest !== null && comparableSha1(dest).kind === "untrusted"; -} -function hasVerifiableUntrustedSha1(pair) { - const [source, dest] = pair; - return source !== null && verifiableUntrustedSha1(source) || dest !== null && verifiableUntrustedSha1(dest); -} -function verifiableUntrustedSha1(path) { - const state = comparableSha1(path); - return state.kind === "untrusted" && state.value !== null; -} -function hasB2Path(pair) { - const [source, dest] = pair; - return source !== null && isB2SyncPath(source) || dest !== null && isB2SyncPath(dest); -} -function isB2SyncPath(path) { - return "selectedVersion" in path; -} -function isLocalSyncPath(path) { - return "absolutePath" in path; -} -/** -* Creates a successful no-op compare preparation result for a pair. -* -* @param pair - Source/destination pair from {@link zipFolders}. -* @param bytesHashed - Local file bytes read while preparing the pair. -* @param bytesVerified - B2 bytes read while verifying untrusted SHA-1 metadata. -* -* @returns A ready preparation result that allows action generation. -*/ -function readyComparePair(pair, bytesHashed = 0, bytesVerified = 0) { - return { - pair, - events: [], - errors: [], - bytesHashed, - bytesVerified, - skipActionGeneration: false, - aborted: false - }; -} -function skipped(pair, event, error, bytesHashed = 0, bytesVerified = 0) { - return { - pair, - events: [event], - errors: error !== void 0 ? [error] : [], - bytesHashed, - bytesVerified, - skipActionGeneration: true, - aborted: false - }; -} -function aborted(pair) { - return { - pair, - events: [], - errors: [], - bytesHashed: 0, - bytesVerified: 0, - skipActionGeneration: true, - aborted: true - }; -} -function unavailableSha1Event(pair) { - return unavailableSha1PathEvent({ relativePath: (pair[0] ?? pair[1])?.relativePath ?? "" }); -} -function unavailableSha1PathEvent(path) { - return { - type: "skip", - path: path.relativePath, - size: 0, - message: "sha1 comparison skipped because a verifiable SHA-1 is unavailable" - }; -} -function normalizeConcurrency(value) { - if (value === void 0 || !Number.isFinite(value) || value < 1) return 1; - return Math.max(1, Math.floor(value)); -} -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/compare.js +function filesAreDifferent(source, dest, compareMode, threshold = 0) { + switch (compareMode) { + case "none": + return false; + case "size": + return Math.abs(source.size - dest.size) > threshold; + case "modtime": + return Math.abs(source.modTimeMillis - dest.modTimeMillis) > threshold; + } +} //# sourceMappingURL=compare.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/index.js - - -//#region src/sync/policies/index.ts -/** -* Converts a paired source/dest tuple into zero or more sync actions based on the -* sync direction, compare mode, and keep policy. -* For `compareMode: 'sha1'`, prefer the high-level `synchronize()` API so local -* file hashes and comparable B2 hashes are prepared before actions are generated. -* Low-level callers must pass pairs with local `contentSha1` values already -* computed and B2 `contentSha1` values containing any comparable metadata fallback. -* -* @param pair - The source/dest file pair from {@link zipFolders}. -* @param direction - The sync direction. -* @param compareMode - How to compare files for differences. -* @param keepMode - Policy for destination-only files. -* @param keepDays - Retention period when keepMode is 'keep-days'. -* @param nowMillis - Current time in milliseconds, used for keep-days calculation. -* @param factory - Factory to create the concrete action objects. -* @param compareThreshold - Tolerance for the comparison. -*/ + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/index.js + + function* generateActions(pair, direction, compareMode, keepMode, keepDays, nowMillis, factory, compareThreshold) { - assertSupportedCompareMode(compareMode); - const [source, dest] = pair; - if (source !== null && dest === null) yield* actionsForSourceOnly(source, direction, factory); - else if (source === null && dest !== null) yield* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory); - else if (source !== null && dest !== null) yield* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory); + const [source, dest] = pair; + if (source !== null && dest === null) { + yield* actionsForSourceOnly(source, direction, factory); + } else if (source === null && dest !== null) { + yield* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory); + } else if (source !== null && dest !== null) { + yield* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory); + } } function* actionsForSourceOnly(source, direction, factory) { - switch (direction) { - case "local-to-b2": - yield factory.upload(source); - break; - case "b2-to-local": - yield factory.download(source, null); - break; - case "b2-to-b2": - yield factory.copy(source, source.relativePath); - break; - } + switch (direction) { + case "local-to-b2": + yield factory.upload(source); + break; + case "b2-to-local": + yield factory.download(source); + break; + case "b2-to-b2": + yield factory.copy(source, source.relativePath); + break; + } } function* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory) { - if (keepMode === "no-delete") { - yield new SkipAction(dest.relativePath, "not in source, keep-mode is no-delete"); - return; - } - if (keepMode === "keep-days") { - const ageDays = (nowMillis - dest.modTimeMillis) / (1440 * 60 * 1e3); - if (ageDays < keepDays) { - yield new SkipAction(dest.relativePath, `not in source, keeping for ${Math.ceil(keepDays - ageDays)} more days`); - return; - } - } - switch (direction) { - case "local-to-b2": - yield factory.removeOrphan(dest); - break; - case "b2-to-local": - yield factory.deleteLocal(dest); - break; - case "b2-to-b2": - yield factory.removeOrphan(dest); - break; - } + if (keepMode === "no-delete") { + yield new SkipAction(dest.relativePath, "not in source, keep-mode is no-delete"); + return; + } + if (keepMode === "keep-days") { + const ageMillis = nowMillis - dest.modTimeMillis; + const ageDays = ageMillis / (24 * 60 * 60 * 1e3); + if (ageDays < keepDays) { + yield new SkipAction( + dest.relativePath, + `not in source, keeping for ${Math.ceil(keepDays - ageDays)} more days` + ); + return; + } + } + switch (direction) { + case "local-to-b2": + yield factory.removeOrphan(dest); + break; + case "b2-to-local": + yield factory.deleteLocal(dest); + break; + case "b2-to-b2": + yield factory.removeOrphan(dest); + break; + } } function* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory) { - if (!filesAreDifferent(source, dest, compareMode, compareThreshold)) { - yield new SkipAction(source.relativePath, "files are the same"); - return; - } - switch (direction) { - case "local-to-b2": - yield factory.upload(source, dest); - break; - case "b2-to-local": - yield factory.download(source, dest); - break; - case "b2-to-b2": - yield factory.copyB2Path?.(source, dest) ?? factory.copy(source, dest.relativePath); - break; - } -} -//#endregion - + if (!filesAreDifferent(source, dest, compareMode, compareThreshold)) { + yield new SkipAction(source.relativePath, "files are the same"); + return; + } + switch (direction) { + case "local-to-b2": + yield factory.upload(source); + break; + case "b2-to-local": + yield factory.download(source); + break; + case "b2-to-b2": + yield factory.copy(source, dest.relativePath); + break; + } +} //# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/path-safety.js -//#region src/sync/path-safety.ts -var RESERVED_SYNC_TEMP_FILE_RE = /^\.b2sdk-[0-9a-f]{24}-[^/\\]+-[0-9a-f]{32}\.partial$/i; -var UUID_HEX_RE = /^[0-9a-f]{32}$/i; -/** -* Checks whether a basename is reserved for SDK-owned sync partial files. -* @param name - Basename to inspect. -* -* @returns Whether the basename matches the SDK reserved partial-file pattern. -* -* @internal -*/ -function isReservedSyncTempFileName(name) { - return RESERVED_SYNC_TEMP_FILE_RE.test(name); -} -/** -* Rejects sync paths whose basename is reserved for SDK-owned temporary files. -* @param relativePath - Sync-relative path using slash separators. -* -* @throws If any path segment uses the SDK's reserved temporary-file pattern. -* -* @internal -*/ -function assertSyncPathAllowed(relativePath) { - if (relativePath.split(/[\\/]+/).filter(Boolean).some((part) => isReservedSyncTempFileName(part))) throw new Error(`Sync path uses reserved SDK temporary-file name: ${relativePath}`); -} -/** -* Creates a download staging basename inside the SDK-reserved temp namespace. -* @param finalName - Final destination basename. -* @param uuid - UUID used to make the temp basename unique. -* -* @returns A basename that local and B2 scanners reject as SDK-owned temp data. -* -* @throws If the provided UUID cannot be normalized to 32 hex characters. -* -* @internal -*/ -function makeReservedSyncTempFileName(finalName, uuid) { - if (finalName.length === 0 || /[\\/]/.test(finalName)) throw new Error("invalid sync temporary-file basename"); - const hex = uuid.replaceAll("-", "").toLowerCase(); - if (!UUID_HEX_RE.test(hex)) throw new Error("invalid sync temporary-file nonce"); - return `.b2sdk-${hex.slice(0, 24)}-${finalName}-${hex}.partial`; -} -/** -* Validates B2 relative names before they are materialized on a local filesystem. -* -* @param relPath - B2-style relative path. -* -* @returns Validated path segments. -* -* @throws When the path is empty, absolute, platform-ambiguous, or contains traversal. -* -* @internal -*/ -function safeRelativePathSegments(relPath) { - assertSyncPathAllowed(relPath); - if (relPath.length === 0 || relPath.includes("\0") || relPath.includes("\\") || relPath.startsWith("/") || /^[A-Za-z]:/.test(relPath)) throw new Error("unsafe local destination path"); - const segments = relPath.split("/"); - if (segments.some((segment) => segment.length === 0 || segment === "." || segment === ".." || segment.includes(":") || segment.endsWith(".") || segment.endsWith(" ") || WINDOWS_RESERVED_NAME.test(segment))) throw new Error("unsafe local destination path"); - return segments; -} -var WINDOWS_RESERVED_NAME = /^(con|prn|aux|nul|conin\$|conout\$|com[0-9\u00b9\u00b2\u00b3]|lpt[0-9\u00b9\u00b2\u00b3])(?:\..*)?$/i; -/** -* Throws if {@link target} is outside {@link root} or names the root itself. -* -* @param root - Resolved filesystem root. -* @param target - Candidate path to validate. -* @param path - Node path module. -* -* @throws When the target is outside the root or equal to the root. -* -* @internal -*/ -function assertPathInsideRoot(root, target, path) { - const relative = path.relative(root, target); - if (relative.length === 0 || relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) throw new Error("unsafe local destination path"); -} -/** -* Returns the platform's no-follow open flag when available. -* -* @param constants - Node filesystem constants. -* -* @returns The `O_NOFOLLOW` bit or `0`. -* -* @internal -*/ -function noFollowFlag(constants) { - return constants.O_NOFOLLOW ?? 0; -} -/** -* Checks whether an unknown thrown value has a specific Node error code. -* -* @param err - Unknown thrown value. -* @param code - Expected Node error code. -* -* @returns True when the value exposes the expected code. -* -* @internal -*/ -function hasErrorCode(err, code) { - return err.code === code; -} -//#endregion - - -//# sourceMappingURL=path-safety.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/download-staging.js - -//#region src/sync/download-staging.ts -/** @internal */ -var DOWNLOAD_STAGING_DIRECTORY_NAME = ".b2sdk-download-staging"; -/** @internal */ -var DOWNLOAD_STAGING_MARKER_NAME = ".b2sdk-staging-marker.partial"; -var CANONICAL_DOWNLOAD_STAGING_DIRECTORY_NAME = canonicalLocalFilesystemSegment(DOWNLOAD_STAGING_DIRECTORY_NAME); -var DOWNLOAD_STAGING_ENTRY_SUFFIX = ".download"; -var STALE_DOWNLOAD_STAGING_AGE_MS = 1440 * 60 * 1e3; -var MAX_STAGING_CLEANUP_CONCURRENCY = 8; -var MAX_CLEANUP_WARNING_ENTRIES = 3; -/** @internal */ -var DOWNLOAD_STAGING_ACTIVITY_ENTRY_LIMIT = 1024; -var reapedManagedDirectories = /* @__PURE__ */ new Map(); -/** -* Checks whether a single path segment matches the SDK-managed staging directory name. -* @param segment - Candidate path segment. -* -* @returns True when the segment is the reserved staging directory name under -* local filesystem canonicalization. -* -* @internal -*/ -function isDownloadStagingDirectorySegment(segment) { - return segment !== void 0 && canonicalLocalFilesystemSegment(segment) === CANONICAL_DOWNLOAD_STAGING_DIRECTORY_NAME; -} -/** -* Creates a private SDK-managed staging directory under a local sync root. -* @param rootRealPath - Resolved local sync root path. -* @param path - Node path module used for platform-specific path operations. -* @param randomUUID - UUID provider used to create unique staging entries. -* @param statForDeviceCheck - Stat function used to verify filesystem devices. -* @param beforeStagingMarkerWrite - Test hook called before marker creation. -* -* @returns The resolved staging directory path. -* -* @internal -*/ -async function createDownloadStagingDirectory(rootRealPath, path, randomUUID, statForDeviceCheck, beforeStagingMarkerWrite) { - const { chmod, lstat, mkdir, readdir, realpath, rm } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - const managedDirectory = path.join(rootRealPath, DOWNLOAD_STAGING_DIRECTORY_NAME); - try { - await mkdir(managedDirectory, { mode: PRIVATE_DOWNLOAD_DIRECTORY_MODE }); - } catch (err) { - if (!hasErrorCode(err, "EEXIST")) throw err; - } - if (!(await lstat(managedDirectory)).isDirectory()) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is not a directory`); - const realManagedDirectory = await realpath(managedDirectory); - assertPathInsideRoot(rootRealPath, realManagedDirectory, path); - await assertDownloadPathSameDevice(rootRealPath, realManagedDirectory, statForDeviceCheck, "unsafe local destination path: cannot stage download across filesystems"); - if (!await isManagedDownloadStagingRoot(realManagedDirectory)) { - if ((await readdir(realManagedDirectory)).length > 0 && !await isManagedDownloadStagingRoot(realManagedDirectory)) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is reserved for SDK download staging`); - } - await beforeStagingMarkerWrite?.(realManagedDirectory); - await writeStagingMarker(realManagedDirectory, path); - /* v8 ignore next -- best-effort chmod */ - await chmod(realManagedDirectory, PRIVATE_DOWNLOAD_DIRECTORY_MODE).catch(() => {}); - await reapStaleDownloadStagingDirectoriesOnce(realManagedDirectory, path, Date.now()); - const stagingDirectory = path.join(realManagedDirectory, `${Date.now()}-${randomUUID()}${DOWNLOAD_STAGING_ENTRY_SUFFIX}`); - await mkdir(stagingDirectory, { mode: PRIVATE_DOWNLOAD_DIRECTORY_MODE }); - /* v8 ignore next -- best-effort chmod */ - await chmod(stagingDirectory, PRIVATE_DOWNLOAD_DIRECTORY_MODE).catch(() => {}); - try { - const realStagingDirectory = await realpath(stagingDirectory); - assertPathInsideRoot(realManagedDirectory, realStagingDirectory, path); - await assertDownloadPathSameDevice(rootRealPath, realStagingDirectory, statForDeviceCheck, "unsafe local destination path: cannot stage download across filesystems"); - await beforeStagingMarkerWrite?.(realStagingDirectory); - await writeStagingMarker(realStagingDirectory, path); - return realStagingDirectory; - } catch (err) { - /* v8 ignore next -- best-effort cleanup */ - await rm(stagingDirectory, { - recursive: true, - force: true - }).catch(() => {}); - throw err; - } -} -/** -* Returns true when a scan-root entry is an SDK-managed download staging root. -* @param directory - Candidate directory to inspect. -* -* @returns True when the directory contains SDK staging markers. -* -* @internal -*/ -async function isManagedDownloadStagingRoot(directory) { - const { lstat, readdir } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - const path = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19)); - try { - if ((await lstat(path.join(directory, ".b2sdk-staging-marker.partial"))).isFile()) return true; - } catch (err) { - if (!hasErrorCode(err, "ENOENT")) return false; - } - let entries; - try { - entries = await readdir(directory, { withFileTypes: true }); - } catch { - return false; - } - for (const entry of entries) { - if (!entry.isDirectory() || !entry.name.endsWith(DOWNLOAD_STAGING_ENTRY_SUFFIX)) continue; - try { - if ((await lstat(path.join(directory, entry.name, ".b2sdk-staging-marker.partial"))).isFile()) return true; - } catch {} - } - return false; -} -var PRIVATE_DOWNLOAD_FILE_MODE = 384; -var PRIVATE_DOWNLOAD_DIRECTORY_MODE = 448; -async function writeStagingMarker(directory, path) { - const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19)); - const { lstat, open } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - const markerPath = path.join(directory, DOWNLOAD_STAGING_MARKER_NAME); - let handle; - try { - handle = await open(markerPath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | noFollowFlag(constants), PRIVATE_DOWNLOAD_FILE_MODE); - /* v8 ignore next -- best-effort chmod */ - await handle.chmod(PRIVATE_DOWNLOAD_FILE_MODE).catch(() => {}); - } catch (err) { - if (hasErrorCode(err, "EEXIST") || hasErrorCode(err, "ELOOP")) { - if ((await lstat(markerPath).catch(() => void 0))?.isFile() === true) return; - throw new Error("unsafe local destination path: staging marker is not a regular file"); - } - throw err; - } finally { - /* v8 ignore next -- best-effort close */ - await handle?.close().catch(() => {}); - } -} -/** -* Verifies that a candidate path is on the same filesystem device as the root. -* @param rootRealPath - Resolved local sync root path. -* @param candidateRealPath - Resolved candidate path to compare. -* @param statForDeviceCheck - Stat function used to read device IDs. -* @param message - Error message used when devices differ. -* -* @internal -*/ -async function assertDownloadPathSameDevice(rootRealPath, candidateRealPath, statForDeviceCheck, message) { - const [rootStats, candidateStats] = await Promise.all([statForDeviceCheck(rootRealPath), statForDeviceCheck(candidateRealPath)]); - if (rootStats.dev !== candidateStats.dev) throw new Error(message); -} -async function reapStaleDownloadStagingDirectoriesOnce(managedDirectory, path, nowMillis) { - const previous = reapedManagedDirectories.get(managedDirectory); - if (previous !== void 0) { - await previous; - return; - } - const next = reapStaleDownloadStagingDirectories(managedDirectory, path, nowMillis).finally(() => { - if (reapedManagedDirectories.get(managedDirectory) === next) reapedManagedDirectories.delete(managedDirectory); - }); - reapedManagedDirectories.set(managedDirectory, next); - await next; -} -async function reapStaleDownloadStagingDirectories(managedDirectory, path, nowMillis) { - const { readdir, realpath, rm } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - let entries; - try { - entries = await readdir(managedDirectory, { withFileTypes: true }); - } catch (err) { - if (hasErrorCode(err, "ENOENT")) return; - emitCleanupWarning("failed to inspect B2 SDK download staging entries"); - return; - } - const cleanupErrors = []; - await forEachWithConcurrency(entries, MAX_STAGING_CLEANUP_CONCURRENCY, async (entry) => { - if (!entry.isDirectory() || !entry.name.endsWith(DOWNLOAD_STAGING_ENTRY_SUFFIX)) return; - const candidate = path.join(managedDirectory, entry.name); - const activity = await readManagedStagingEntryActivity(candidate, path); - if (activity === void 0 || !stagingActivityIsStale(activity, nowMillis)) return; - const realCandidate = await realpath(candidate).catch(() => { - cleanupErrors.push({ - entryName: entry.name, - operation: "inspect" - }); - }); - if (realCandidate === void 0) return; - try { - assertPathInsideRoot(managedDirectory, realCandidate, path); - const latestActivity = await readManagedStagingEntryActivity(candidate, path); - if (latestActivity === void 0 || latestActivity.signature !== activity.signature || !stagingActivityIsStale(latestActivity, nowMillis)) return; - await rm(realCandidate, { - recursive: true, - force: true - }); - } catch { - cleanupErrors.push({ - entryName: entry.name, - operation: "remove" - }); - } - }); - if (cleanupErrors.length > 0) { - const noun = cleanupErrors.length === 1 ? "entry" : "entries"; - emitCleanupWarning(`failed to reap ${cleanupErrors.length} stale B2 SDK download staging ${noun}: ${cleanupErrors.slice(0, MAX_CLEANUP_WARNING_ENTRIES).map(formatCleanupWarning).join("; ")}`); - } -} -async function readManagedStagingEntryActivity(candidate, path) { - const { lstat, readdir } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - try { - const [directoryStats, markerStats] = await Promise.all([lstat(candidate), lstat(path.join(candidate, DOWNLOAD_STAGING_MARKER_NAME))]); - if (!directoryStats.isDirectory() || !markerStats.isFile()) return void 0; - const entries = await readdir(candidate, { withFileTypes: true }); - if (entries.length > 1024) return void 0; - const statsParts = [`.:${stagingStatsSignature(directoryStats)}`, `${DOWNLOAD_STAGING_MARKER_NAME}:${stagingStatsSignature(markerStats)}`]; - let newestActivityMs = Math.max(stagingStatsActivityMs(directoryStats), stagingStatsActivityMs(markerStats)); - for (const entry of [...entries].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) { - const stats = await lstat(path.join(candidate, entry.name)); - statsParts.push(`${entry.name}:${stagingStatsSignature(stats)}`); - newestActivityMs = Math.max(newestActivityMs, stagingStatsActivityMs(stats)); - } - return { - newestActivityMs, - signature: statsParts.join("|") - }; - } catch { - return; - } -} -function stagingStatsActivityMs(stats) { - return stats.mtimeMs; -} -function stagingStatsSignature(stats) { - return `${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeMs}:${stats.ctimeMs}`; -} -function stagingActivityIsStale(activity, nowMillis) { - return nowMillis - activity.newestActivityMs >= STALE_DOWNLOAD_STAGING_AGE_MS; -} -function formatCleanupWarning(error) { - return `${error.operation} ${safeWarningName(error.entryName)}`; -} -function safeWarningName(name) { - const chars = Array.from(name); - const bounded = chars.slice(0, 80).join(""); - const suffix = chars.length > 80 ? "..." : ""; - return JSON.stringify(`${bounded.replace(/[^A-Za-z0-9._-]/g, "?")}${suffix}`); -} -function canonicalLocalFilesystemSegment(segment) { - return segment.normalize("NFC").toLocaleLowerCase("en-US"); -} -async function forEachWithConcurrency(items, concurrency, fn) { - let index = 0; - const workers = Array.from({ length: Math.min(concurrency, items.length) }, async () => { - while (index < items.length) { - const item = items[index]; - index += 1; - if (item !== void 0) await fn(item); - } - }); - await Promise.all(workers); -} -function emitCleanupWarning(message) { - globalThis.process?.emitWarning?.(message, { code: "B2SDK_DOWNLOAD_STAGING_CLEANUP_FAILED" }); -} -//#endregion - - -//# sourceMappingURL=download-staging.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/prefix.js - -//#region src/sync/prefix.ts -/** -* Treats the supplied string as a raw B2 key prefix without adding a folder boundary. -* -* B2 keys are byte-oriented names, not local filesystem paths. A backslash in a prefix is a real -* key character and must not be rewritten to `/`; callers that want slash-delimited prefixes should -* pass `/` explicitly. -* -* @param prefix - User-supplied raw B2 key prefix. -* -* @returns Raw B2 key prefix. -*/ -function asRawB2KeyPrefix(prefix) { - return prefix; -} -/** -* Normalizes a B2 object name into a safe folder-relative sync path. -* -* Object names are converted to forward-slash sync paths for local compatibility. Callers that scan -* B2 must detect normalized-path collisions between distinct raw B2 keys before yielding entries. -* -* @param path - B2 object name or prefix-stripped suffix returned by a listing. -* @param options - Optional normalization behavior for legacy slashless raw prefixes. -* -* @returns Folder-relative sync path. -* -* @throws When the object name cannot be represented as a safe relative path. -*/ -function normalizeB2RelativePath(path, options = {}) { - const slashPath = path.split("\\").join("/"); - const relativePath = options.stripLeadingSlashes === true ? stripSingleLeadingSlash(slashPath) : slashPath; - const segments = relativePath.split("/"); - if (/^[A-Za-z]:/.test(relativePath) || segments.some((segment) => segmentIsUnsafe(segment))) throw new Error("Unsafe B2 file name cannot be used as a sync relative path"); - return relativePath; -} -/** -* Converts a B2 object key under a configured raw prefix into a sync relative path. -* -* @param prefix - Raw B2 key prefix used for the scan or mutation guard. -* @param fileName - Full B2 object key. -* -* @returns The normalized sync relative path for the key suffix. -*/ -function b2KeyToRelativePathUnderPrefix(prefix, fileName) { - const rawPrefix = asRawB2KeyPrefix(prefix); - return normalizeB2RelativePath(rawPrefix === "" ? fileName : fileName.slice(rawPrefix.length), { stripLeadingSlashes: rawPrefix !== "" && !rawPrefix.endsWith("/") }); -} -/** -* Returns whether a sync path is unsafe to materialize on Windows-compatible local filesystems. -* B2-to-B2 syncs can preserve these object names, but B2-to-local syncs skip them before writing. -* -* @param relativePath - Folder-relative sync path. -* -* @returns True when any segment is Windows-dangerous or ambiguous. -*/ -function localFilesystemSyncPathIsUnsafe(relativePath) { - const segments = relativePath.split("/"); - return isDownloadStagingDirectorySegment(segments[0]) || segments.some((segment) => segmentIsLocalFilesystemUnsafe(segment)); -} -/** -* Produces an approximate Windows/macOS-style canonical key for local collision detection. -* -* @param relativePath - Folder-relative sync path. -* -* @returns A canonicalized path key for detecting case/Unicode collisions before local writes. -*/ -function localFilesystemCanonicalSyncPath(relativePath) { - return relativePath.split("/").map((segment) => segment.normalize("NFC").toLocaleLowerCase("en-US")).join("/"); -} -function segmentIsUnsafe(segment) { - return segment === "" || segment === "." || segment === ".." || containsControlCharacter(segment); -} -function segmentIsLocalFilesystemUnsafe(segment) { - if (segment.includes(":") || segment.endsWith(".") || segment.endsWith(" ")) return true; - const basename = segment.split(".")[0]?.toUpperCase(); - return basename !== void 0 && /^(CON|PRN|AUX|NUL|CONIN\$|CONOUT\$|COM[0-9¹²³]|LPT[0-9¹²³])$/u.test(basename); -} -function containsControlCharacter(segment) { - for (let index = 0; index < segment.length; index++) { - const code = segment.charCodeAt(index); - if (code >= 0 && code <= 31) return true; - } - return false; -} -function stripSingleLeadingSlash(path) { - return path.startsWith("/") ? path.slice(1) : path; -} -//#endregion - - -//# sourceMappingURL=prefix.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/filesystem-errors.js - -//#region src/sync/filesystem-errors.ts -/** -* Formats local filesystem errors without including host filesystem paths. -* @param err - Unknown filesystem error. -* -* @returns A path-independent code or error name. -*/ -function localFilesystemErrorReason(err) { - const error = toError(err); - const code = cleanFilesystemErrorPart(error.code); - if (code !== "") return code; - const name = cleanFilesystemErrorPart(error.name); - if (name !== "") return name; - return "Error"; -} -function cleanFilesystemErrorPart(value) { - if (typeof value !== "string") return ""; - let cleaned = ""; - for (const char of value) { - const code = char.charCodeAt(0); - if (code < 32 || code === 127) continue; - cleaned += char; - if (cleaned.length >= 80) break; - } - const trimmed = cleaned.trim(); - return /[\\/]/.test(trimmed) ? "" : trimmed; -} -//#endregion - - -//# sourceMappingURL=filesystem-errors.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-filesystem-root.js -//#region src/sync/local-filesystem-root.ts -var localFilesystemRoots = /* @__PURE__ */ new WeakSet(); -/** -* Privately marks SDK local folders that are backed by the filesystem. -* @param folder - Local folder instance to mark. -* -* @internal -*/ -function registerLocalFilesystemRoot(folder) { - localFilesystemRoots.add(folder); -} -/** -* Returns true for SDK local folders backed by the filesystem. -* @param folder - Sync folder to inspect. -* -* @returns True when the folder was registered as an SDK filesystem root. -* -* @internal -*/ -function isLocalFilesystemRoot(folder) { - return localFilesystemRoots.has(folder); -} -//#endregion - - -//# sourceMappingURL=local-filesystem-root.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/b2-sha1-reader.js - - -//#region src/sync/b2-sha1-reader.ts -var MAX_CONSECUTIVE_EMPTY_READ_CHUNKS = 1024; -/** -* Reads one non-empty stream chunk with an idle timeout and optional abort signal. -* Empty chunks are not progress; too many consecutive empty chunks fail with the -* same stalled-read diagnostic used for pending reads. -* -* @param reader - Locked reader to read from. -* @param timeoutMillis - Idle timeout in milliseconds for this read. -* @param stalledMessage - Error message used when the read makes no progress. -* @param signal - Optional abort signal to observe while reading. -* -* @returns The next stream read result. -* -* @internal -*/ -async function readStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal) { - let emptyChunks = 0; - while (true) { - const result = await readRawStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal); - if (result.done || result.value.byteLength > 0) return result; - emptyChunks += 1; - if (emptyChunks > MAX_CONSECUTIVE_EMPTY_READ_CHUNKS) throw new Error(stalledMessage); - } -} -async function readRawStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal) { - signal?.throwIfAborted(); - let timeout; - let removeAbortListener; - const readPromise = reader.read(); - const timeoutPromise = timeoutMillis === Number.POSITIVE_INFINITY ? void 0 : new Promise((_, reject) => { - timeout = setTimeout(() => { - reject(new Error(stalledMessage)); - }, timeoutMillis); - }); - const abortPromise = signal === void 0 ? void 0 : new Promise((_, reject) => { - const onAbort = () => reject(signal.reason ?? /* @__PURE__ */ new Error("aborted")); - signal.addEventListener("abort", onAbort, { once: true }); - removeAbortListener = () => signal.removeEventListener("abort", onAbort); - }); - try { - if (timeoutPromise === void 0 && abortPromise === void 0) return await readPromise; - const candidates = [readPromise]; - if (timeoutPromise !== void 0) candidates.push(timeoutPromise); - if (abortPromise !== void 0) candidates.push(abortPromise); - return await Promise.race(candidates); - } finally { - if (timeout !== void 0) clearTimeout(timeout); - removeAbortListener?.(); - readPromise.catch(() => {}); - } -} -/** -* Hashes a B2 response body as SHA-1 with idle timeout, abort, and size checks. -* -* @param body - Response body stream to hash. -* @param signal - Optional abort signal to observe while reading. -* @param options - Optional timeout and byte-count limits. -* -* @returns The computed SHA-1 and number of bytes read. -* -* @internal -*/ -async function hashReadableStreamSha1(body, signal, options) { - const hash = new IncrementalSha1(); - const reader = body.getReader(); - const idleTimeoutMillis = options?.idleTimeoutMillis ?? normalizeSha1TimeoutMillis(void 0); - const maxBytes = options?.maxBytes ?? Number.POSITIVE_INFINITY; - const expectedBytes = options?.expectedBytes; - let bytesRead = 0; - try { - while (true) { - const { done, value } = await readStreamChunkWithTimeout(reader, idleTimeoutMillis, `sha1 B2 read stalled for ${idleTimeoutMillis} ms`, signal); - if (done) break; - bytesRead += value.byteLength; - if (bytesRead > maxBytes) throw new Error(`sha1 B2 read exceeded ${maxBytes} byte verification budget`); - await hash.update(value); - } - if (expectedBytes !== void 0 && bytesRead !== expectedBytes) throw new Error(`sha1 B2 read ended after ${bytesRead} bytes, expected ${expectedBytes}`); - return { - contentSha1: await hash.digest(), - bytesRead - }; - } catch (err) { - reader.cancel(err).catch(() => {}); - throw err; - } finally { - reader.releaseLock(); - } -} -/** -* Applies an absolute verification deadline while forwarding parent aborts. -* -* @param signal - Optional parent abort signal. -* @param timeoutMillis - Absolute deadline in milliseconds. -* @param run - Operation to run with the derived deadline signal. -* -* @returns The operation result. -* -* @internal -*/ -async function withSha1VerificationDeadline(signal, timeoutMillis, run) { - const controller = new AbortController(); - const abortFromParent = () => controller.abort(signal?.reason); - if (signal?.aborted) abortFromParent(); - signal?.addEventListener("abort", abortFromParent, { once: true }); - let timeout; - const timeoutPromise = new Promise((_, reject) => { - timeout = setTimeout(() => { - const error = /* @__PURE__ */ new Error(`sha1 B2 verification exceeded ${timeoutMillis} ms`); - controller.abort(error); - reject(error); - }, timeoutMillis); - }); - const runPromise = run(controller.signal); - try { - return await Promise.race([runPromise, timeoutPromise]); - } finally { - if (timeout !== void 0) clearTimeout(timeout); - signal?.removeEventListener("abort", abortFromParent); - runPromise.catch(() => {}); - } -} -/** -* Bounds B2 SHA-1 verification downloads to the selected object's size and optional ceiling. -* -* @param contentLength - Selected B2 object byte length. -* @param ceiling - Optional lower verification budget. -* -* @returns The byte budget to enforce. -* -* @internal -*/ -function normalizeSha1VerificationMaxBytes(contentLength, ceiling) { - const contentBudget = Math.max(0, Math.floor(contentLength)); - if (ceiling === void 0) return contentBudget; - if (!Number.isFinite(ceiling) || ceiling < 0) return contentBudget; - return Math.min(contentBudget, Math.floor(ceiling)); -} -//#endregion - - -//# sourceMappingURL=b2-sha1-reader.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-file-io.js - - - - - -//#region src/sync/local-file-io.ts -/** @internal */ -var localFileIoTestHooks = {}; -/** -* Verifies that a previously scanned local file still points at the same regular file. -* -* @param path - Scanned local path and file identity. -* -* @internal -*/ -async function validateScannedLocalFile(path) { - await (await openValidatedScannedLocalFile(path)).close(); -} -async function openValidatedScannedLocalFile(path) { - const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19)); - const { open } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - const flags = constants.O_RDONLY | noFollowFlag(constants) | (constants.O_NONBLOCK ?? 0); - const handle = await open(path.absolutePath, flags).catch((err) => { - if (hasErrorCode(err, "ELOOP")) throw new Error("local file changed before upload: not a regular file"); - throw new Error(`local file changed before upload: could not open scanned file: ${sanitizeErrorReason(err)}`); - }); - try { - assertSameScannedRegularFile(await handle.stat(), path, "upload", { platform: localFileIoTestHooks.platform }); - return handle; - } catch (err) { - await handle.close().catch(() => {}); - throw err; - } -} -/** -* Streams a B2 download under a local sync root with path, timeout, and size checks. -* -* @param root - Local sync root. -* @param relPath - Destination path relative to the root. -* @param body - Download body stream. -* @param options - Expected byte count, idle timeout, and optional abort signal. -* -* @internal -*/ -async function writeLocalStreamInsideRoot(root, relPath, body, options) { - const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19)); - const { link, lstat, mkdir, open, realpath, rename, rm, stat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - const path = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19)); - const { randomUUID } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 7598, 19)); - assertValidExpectedBytes(options.expectedBytes); - const segments = safeRelativePathSegments(relPath); - if (isDownloadStagingDirectorySegment(segments[0])) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is reserved for SDK download staging`); - const rootRealPath = await realpath(root); - let current = rootRealPath; - for (const segment of segments.slice(0, -1)) { - current = path.join(current, segment); - try { - await mkdir(current); - } catch (err) { - if (!hasErrorCode(err, "EEXIST")) throw err; - } - if (!(await lstat(current)).isDirectory()) throw new Error("unsafe local destination path: parent is not a directory"); - await localFileIoTestHooks.afterParentDirectoryValidated?.(current); - } - const destPath = path.join(rootRealPath, ...segments); - assertPathInsideRoot(rootRealPath, destPath, path); - const parentRealPath = await realpath(path.dirname(destPath)); - const finalPath = path.join(parentRealPath, path.basename(destPath)); - assertPathInsideRoot(rootRealPath, finalPath, path); - try { - const targetStats = await lstat(finalPath); - if (targetStats.isSymbolicLink()) throw new Error("unsafe local destination path: target is a symbolic link"); - if (targetStats.isFile() && targetStats.nlink > 1) throw new Error("unsafe local destination path: target has multiple hard links"); - } catch (err) { - if (!hasErrorCode(err, "ENOENT")) throw err; - } - const statForDeviceCheck = localFileIoTestHooks.statForDeviceCheck ?? stat; - await assertDownloadPathSameDevice(rootRealPath, parentRealPath, statForDeviceCheck, "unsafe local destination path: cannot publish download across filesystems"); - let parentHandle; - let anchoredParentPath; - /* v8 ignore start -- Linux-only fd-relative path support is covered by Linux CI */ - if (globalThis.process?.platform === "linux" && constants.O_DIRECTORY !== void 0 && localFileIoTestHooks.disableProcFdAnchoring !== true) try { - parentHandle = await open(parentRealPath, constants.O_RDONLY | constants.O_DIRECTORY | noFollowFlag(constants)); - anchoredParentPath = `/proc/self/fd/${parentHandle.fd}`; - } catch (err) { - if (hasErrorCode(err, "ELOOP") || hasErrorCode(err, "ENOTDIR")) throw new Error("unsafe local destination path: parent is not a directory"); - throw err; - } - /* v8 ignore stop */ - const finalName = path.basename(destPath); - const finalWritePath = path.join(anchoredParentPath ?? parentRealPath, finalName); - let publishMode; - try { - publishMode = await replacementFileMode(finalPath); - } catch (err) { - /* v8 ignore next -- best-effort close during setup failure */ - await parentHandle?.close().catch(() => {}); - throw err; - } - let stagingDirectory; - try { - stagingDirectory = await createDownloadStagingDirectory(rootRealPath, path, randomUUID, statForDeviceCheck, localFileIoTestHooks.beforeStagingMarkerWrite); - } catch (err) { - /* v8 ignore next -- best-effort close during setup failure */ - await parentHandle?.close().catch(() => {}); - throw err; - } - const tmpPath = path.join(stagingDirectory, `.b2sdk-${randomUUID()}.partial`); - let handle; - try { - handle = await open(tmpPath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | noFollowFlag(constants), local_file_io_PRIVATE_DOWNLOAD_FILE_MODE); - /* v8 ignore next -- best-effort chmod */ - await handle.chmod(local_file_io_PRIVATE_DOWNLOAD_FILE_MODE).catch(() => {}); - await localFileIoTestHooks.afterTempFileCreated?.(tmpPath, stagingDirectory); - } catch (err) { - await parentHandle?.close().catch(() => {}); - await rm(stagingDirectory, { - recursive: true, - force: true - }).catch(() => {}); - throw err; - } - /* v8 ignore stop */ - try { - const tmpRealPath = await realpath(tmpPath); - assertPathInsideRoot(stagingDirectory, tmpRealPath, path); - } catch (err) { - /* v8 ignore next -- best-effort cleanup */ - await handle?.close().catch(() => {}); - /* v8 ignore next -- best-effort cleanup */ - await rm(tmpPath, { force: true }).catch(() => {}); - /* v8 ignore next -- best-effort cleanup */ - await rm(stagingDirectory, { - recursive: true, - force: true - }).catch(() => {}); - /* v8 ignore next -- best-effort cleanup */ - await parentHandle?.close().catch(() => {}); - throw err; - } - const writeHandle = handle; - const reader = body.getReader(); - let completed = false; - try { - let bytesWritten = 0; - while (true) { - const { done, value } = await readStreamChunkWithTimeout(reader, options.idleTimeoutMillis, `download read stalled for ${options.idleTimeoutMillis} ms`, options.signal); - if (done) break; - if (bytesWritten + value.byteLength > options.expectedBytes) throw new Error(`download read exceeded ${options.expectedBytes} byte limit`); - await writeAll(writeHandle, value, bytesWritten); - bytesWritten += value.byteLength; - } - if (bytesWritten !== options.expectedBytes) throw new Error(`download read ended after ${bytesWritten} bytes, expected ${options.expectedBytes}`); - if (publishMode !== local_file_io_PRIVATE_DOWNLOAD_FILE_MODE) - /* v8 ignore next -- best-effort mode preservation */ - await writeHandle.chmod(publishMode).catch(() => {}); - await writeHandle.close(); - handle = void 0; - const [parentRealPathBeforeRename, parentStatsBeforeRename] = await Promise.all([realpath(path.dirname(destPath)), stat(path.dirname(destPath))]); - assertPathInsideRoot(rootRealPath, path.join(parentRealPathBeforeRename, path.basename(destPath)), path); - await localFileIoTestHooks.beforeFinalRename?.(parentRealPathBeforeRename); - let publishPath = finalWritePath; - if (anchoredParentPath === void 0) { - const [parentRealPathAfterHook, parentStatsAfterHook] = await Promise.all([realpath(path.dirname(destPath)), stat(path.dirname(destPath))]); - if (parentRealPathAfterHook !== parentRealPathBeforeRename || !sameParentIdentity(parentStatsAfterHook, parentStatsBeforeRename)) throw new Error("unsafe local destination path: parent changed before final publish"); - publishPath = path.join(parentRealPathAfterHook, path.basename(destPath)); - assertPathInsideRoot(rootRealPath, publishPath, path); - } - await publishDownload(lstat, link, path, randomUUID, rename, rm, tmpPath, publishPath, options.expectedDestination); - completed = true; - } catch (err) { - /* v8 ignore next -- best-effort cleanup */ - reader.cancel(err).catch(() => {}); - throw err; - } finally { - reader.releaseLock(); - if (!completed) { - /* v8 ignore next -- best-effort cleanup */ - await handle?.close().catch(() => {}); - /* v8 ignore next -- best-effort cleanup */ - await rm(tmpPath, { force: true }).catch(() => {}); - } - /* v8 ignore next -- best-effort cleanup */ - await rm(stagingDirectory, { - recursive: true, - force: true - }).catch(() => {}); - /* v8 ignore next -- best-effort cleanup */ - await parentHandle?.close().catch(() => {}); - } -} -function assertValidExpectedBytes(expectedBytes) { - if (!Number.isSafeInteger(expectedBytes) || expectedBytes < 0) throw new Error("download expectedBytes must be a non-negative safe integer"); -} -async function assertExpectedDownloadDestination(lstat, finalPath, expectedDestination) { - if (expectedDestination === void 0) return; - try { - const stats = await lstat(finalPath); - if (expectedDestination === null) throw new Error("local destination changed before download: file was created"); - assertSameScannedRegularFile(stats, { - ...expectedDestination, - absolutePath: finalPath - }, "download", { platform: localFileIoTestHooks.platform }); - } catch (err) { - if (hasErrorCode(err, "ENOENT")) { - if (expectedDestination === null) return; - throw new Error("local file changed before download: file missing"); - } - throw err; - } -} -async function publishDownload(lstat, link, path, randomUUID, rename, rm, tmpPath, publishPath, expectedDestination) { - await assertExpectedDownloadDestination(lstat, publishPath, expectedDestination); - await localFileIoTestHooks.beforeDownloadPublish?.(publishPath); - if (expectedDestination === void 0) { - await rename(tmpPath, publishPath); - return; - } - if (expectedDestination === null) { - await linkDownloadNoOverwrite(link, tmpPath, publishPath, "local destination changed before download: file was created"); - /* v8 ignore next -- staging cleanup is best-effort after a guarded publish succeeds. */ - await rm(tmpPath, { force: true }).catch(() => {}); - return; - } - const backupPath = path.join(path.dirname(publishPath), makeReservedSyncTempFileName(path.basename(publishPath), randomUUID())); - let backupExists = false; - let removeBackup = false; - try { - try { - await rename(publishPath, backupPath); - backupExists = true; - await localFileIoTestHooks.afterDownloadBackupRename?.(backupPath); - } catch (err) { - if (hasErrorCode(err, "ENOENT")) throw new Error("local file changed before download: file missing"); - throw err; - } - assertSameScannedRegularFile(await lstat(backupPath), { - ...expectedDestination, - absolutePath: backupPath - }, "download", { - compareChangeTime: false, - platform: localFileIoTestHooks.platform - }); - await linkDownloadNoOverwrite(link, tmpPath, publishPath, "local destination changed before download: file was created"); - removeBackup = true; - /* v8 ignore next -- staging cleanup is best-effort after a guarded publish succeeds. */ - await rm(tmpPath, { force: true }).catch(() => {}); - } catch (err) { - if (backupExists && !removeBackup) await restoreBackupWithoutOverwrite(link, rm, backupPath, publishPath).catch(() => {}); - throw err; - } finally { - if (removeBackup) - /* v8 ignore next -- old destination cleanup is best-effort after publish succeeds. */ - await rm(backupPath, { force: true }).catch(() => {}); - } -} -async function linkDownloadNoOverwrite(link, sourcePath, destPath, message) { - try { - await link(sourcePath, destPath); - } catch (err) { - if (hasErrorCode(err, "EEXIST")) throw new Error(message); - throw err; - } -} -async function restoreBackupWithoutOverwrite(link, rm, backupPath, publishPath) { - try { - await link(backupPath, publishPath); - await rm(backupPath, { force: true }); - } catch (err) { - if (hasErrorCode(err, "EEXIST")) return; - throw err; - } -} -var local_file_io_PRIVATE_DOWNLOAD_FILE_MODE = 384; -async function replacementFileMode(filePath) { - const { lstat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - try { - const stats = await lstat(filePath); - return stats.isFile() ? stats.mode & 511 : local_file_io_PRIVATE_DOWNLOAD_FILE_MODE; - } catch (err) { - if (hasErrorCode(err, "ENOENT")) return local_file_io_PRIVATE_DOWNLOAD_FILE_MODE; - throw err; - } -} -/** -* Deletes a scanned local file under a sync root without re-resolving attacker-controlled parents. -* -* @param root - Local sync root. -* @param scannedPath - Previously scanned local file metadata. -* -* @internal -*/ -async function deleteLocalFileInsideRoot(root, scannedPath) { - if (root === "") throw new Error("Local sync root required for filesystem mutation"); - const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19)); - const { lstat, open, realpath, stat, unlink } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - const path = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19)); - const segments = safeRelativePathSegments(scannedPath.relativePath); - const safeRoot = path.resolve(root); - const rootStats = await lstat(safeRoot); - if (rootStats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${scannedPath.relativePath}`); - if (!rootStats.isDirectory()) throw new Error(`Local sync root is not a directory: ${scannedPath.relativePath}`); - const rootRealPath = await realpath(safeRoot); - const expectedPath = path.join(rootRealPath, ...segments); - assertPathInsideRoot(rootRealPath, expectedPath, path); - if (path.resolve(scannedPath.absolutePath) !== expectedPath) throw new Error(`Refusing to delete outside sync root: ${scannedPath.relativePath}`); - const [parentRealPath, parentStats] = await Promise.all([realpath(path.dirname(expectedPath)), stat(path.dirname(expectedPath))]); - const finalPath = path.join(parentRealPath, path.basename(expectedPath)); - assertPathInsideRoot(rootRealPath, finalPath, path); - const platform = globalThis.process?.platform; - let parentHandle; - let anchoredParentPath; - /* v8 ignore start -- Linux-only fd-relative path support is covered by Linux CI */ - if (platform === "linux" && constants.O_DIRECTORY !== void 0 && localFileIoTestHooks.disableProcFdAnchoring !== true) try { - await localFileIoTestHooks.beforeLocalDeleteOpenParent?.(parentRealPath); - parentHandle = await open(parentRealPath, constants.O_RDONLY | constants.O_DIRECTORY | noFollowFlag(constants)); - anchoredParentPath = `/proc/self/fd/${parentHandle.fd}`; - } catch (err) { - if (hasErrorCode(err, "ELOOP") || hasErrorCode(err, "ENOTDIR")) throw new Error("unsafe local delete path: parent is not a directory"); - throw err; - } - /* v8 ignore stop */ - try { - const unlinkPath = anchoredParentPath === void 0 ? finalPath : path.join(anchoredParentPath, path.basename(expectedPath)); - assertSameScannedRegularFile(await lstat(unlinkPath), { - ...scannedPath, - absolutePath: unlinkPath - }, "delete", { platform: localFileIoTestHooks.platform }); - await localFileIoTestHooks.beforeLocalDeleteUnlink?.(parentRealPath); - if (anchoredParentPath === void 0 && localFileIoTestHooks.disableProcFdAnchoring === true && parentRealPath !== rootRealPath) throw new Error("unsafe local delete path: stable parent handle unavailable for unlink"); - if (anchoredParentPath === void 0) { - const [parentRealPathBeforeUnlink, parentStatsBeforeUnlink] = await Promise.all([realpath(path.dirname(expectedPath)), stat(path.dirname(expectedPath))]); - if (parentRealPathBeforeUnlink !== parentRealPath || !sameParentIdentity(parentStatsBeforeUnlink, parentStats)) throw new Error("unsafe local delete path: parent changed before unlink"); - } - assertSameScannedRegularFile(await lstat(unlinkPath), { - ...scannedPath, - absolutePath: unlinkPath - }, "delete", { platform: localFileIoTestHooks.platform }); - await unlink(unlinkPath); - } finally { - /* v8 ignore next -- best-effort cleanup */ - await parentHandle?.close().catch(() => {}); - } -} -function sameParentIdentity(current, expected) { - return current.dev === expected.dev && current.ino === expected.ino; -} -async function writeAll(handle, data, position) { - let offset = 0; - while (offset < data.byteLength) { - const { bytesWritten } = await handle.write(data, offset, data.byteLength - offset, position + offset); - /* v8 ignore next -- defensive: FileHandle.write should progress for non-empty chunks. */ - if (bytesWritten <= 0) throw new Error("download write made no progress"); - offset += bytesWritten; - } -} -//#endregion - - -//# sourceMappingURL=local-file-io.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/synchronizer.js - - - - - - - - - - - - - - - -//#region src/sync/synchronizer.ts -var MAX_BUFFERED_SCAN_EVENTS = 100; -var MAX_AGGREGATE_FAILED_PATHS = 100; -var DEFAULT_DOWNLOAD_IDLE_TIMEOUT_MILLIS = 6e4; -/** -* Test hooks for bounded planning behavior. -* -* @internal -*/ -var synchronizerTestHooks = {}; -/** -* Infers the sync direction from the source and destination folder types. -* @param source - The folder to read files from. -* @param dest - The folder to write files to. -* -* @returns The resolved sync direction based on folder types. -* -* @throws When the source and destination folder types form an unsupported combination. -*/ + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/synchronizer.js + + + + + + + + function resolveDirection(source, dest) { - if (source.type === "local" && dest.type === "b2") return "local-to-b2"; - if (source.type === "b2" && dest.type === "local") return "b2-to-local"; - if (source.type === "b2" && dest.type === "b2") return "b2-to-b2"; - throw new Error(`Unsupported sync direction: ${source.type} to ${dest.type}`); + if (source.type === "local" && dest.type === "b2") return "local-to-b2"; + if (source.type === "b2" && dest.type === "local") return "b2-to-local"; + if (source.type === "b2" && dest.type === "b2") return "b2-to-b2"; + throw new Error(`Unsupported sync direction: ${source.type} to ${dest.type}`); } async function* synchronize(config) { - const { source, dest, options } = config; - assertSupportedCompareMode(options.compareMode); - const direction = resolveDirection(source, dest); - const dryRun = options.dryRun ?? false; - const concurrency = normalizeSyncConcurrency(options.concurrency); - const keepDays = options.keepDays ?? 0; - const compareThreshold = options.compareThreshold ?? 0; - const nowMillis = Date.now(); - const localRootContexts = await resolveLocalRootContexts(config); - const queuedEvents = []; - const failedPaths = []; - const failedPathSet = /* @__PURE__ */ new Set(); - let errorCount = 0; - let failedPathOmittedCount = 0; - let scanHadError = false; - const runningActions = /* @__PURE__ */ new Set(); - const scanEvents = { - events: [], - dropped: 0 - }; - const scanOptions = { - ...options.include !== void 0 ? { include: options.include } : {}, - ...options.exclude !== void 0 ? { exclude: options.exclude } : {}, - ...options.signal !== void 0 ? { signal: options.signal } : {}, - ...options.maxScanEntries !== void 0 ? { maxScanEntries: options.maxScanEntries } : {}, - ...direction === "b2-to-local" ? { requireLocalSafePaths: true } : {}, - onError: (event) => { - scanHadError = true; - recordSyncError(event); - queueEvent(event); - } - }; - const factory = createActionFactory(config, localRootContexts); - const readB2Sha1 = dryRun ? void 0 : createB2Sha1Reader(config); - const actionAbortController = new AbortController(); - const removeAbortForwarder = forwardAbortSignal(options.signal, actionAbortController); - let completed = false; - async function* finishAfterAbort() { - await drainActions(); - yield* emitQueuedEvents(); - } - try { - let pairs; - try { - pairs = await collectPairs(); - } catch (err) { - await drainActions(); - if (options.signal?.aborted) { - yield* finishAfterAbort(); - return; - } - if (!scanHadError) { - yield* emitQueuedEvents(); - throw err; - } - yield* emitQueuedEvents(); - yield aggregateErrorEvent(); - completed = true; - return; - } - yield* emitQueuedEvents(); - const filesystemError = scanFilesystemError(scanEvents); - if (filesystemError !== void 0) throw filesystemError; - if (options.signal?.aborted) { - yield* finishAfterAbort(); - return; - } - if (scanHadError) { - if (errorCount > 0) yield aggregateErrorEvent(); - completed = true; - return; - } - if (options.compareMode === "sha1") { - const compareBatchSize = concurrency; - for (let index = 0; index < pairs.length; index += compareBatchSize) if (yield* emitSha1Batch(pairs.slice(index, index + compareBatchSize))) return; - } else for (let index = 0; index < pairs.length; index += concurrency) { - const items = pairs.slice(index, index + concurrency).map((pair) => planPreparedPair(pair, readyComparePair(pair))); - synchronizerTestHooks.afterNonSha1PlanBatch?.(items.length); - if (yield* emitPreparedItems(items)) return; - } - await drainActions(); - yield* emitQueuedEvents(); - if (errorCount > 0) yield aggregateErrorEvent(); - completed = true; - } finally { - if (!completed) abortActionController(actionAbortController, new DOMException("Sync iterator closed", "AbortError")); - removeAbortForwarder(); - await drainActions(); - } - async function collectPairs() { - const pairs = []; - for await (const pair of zipFolders(source, dest, scanOptions, { - onSourceSkip(event) { - bufferScanEvent(scanEvents, event, direction, "source"); - }, - onDestSkip(event) { - bufferScanEvent(scanEvents, event, direction, "dest"); - } - })) { - if (options.signal?.aborted) return pairs; - validateB2SourcePairPrefix(pair, config); - pairs.push(pair); - } - return pairs; - } - async function* emitSha1Batch(batch) { - if (batch.length === 0) return false; - await drainActions(); - yield* emitQueuedEvents(); - const preparedBatch = await processPreparedBatch(batch); - if (yield* emitPreparedItems(preparedBatch.items)) return true; - if (preparedBatch.aborted || options.signal?.aborted) { - yield* finishAfterAbort(); - return true; - } - return false; - } - async function* emitPreparedItems(items) { - for (const item of items) { - yield* emitQueuedEvents(); - yield item.event; - yield* emitQueuedEvents(); - /* v8 ignore next -- abort between compare yield and scheduling is timing-dependent */ - if (options.signal?.aborted) { - yield* finishAfterAbort(); - return true; - } - for (const action of item.actions) { - await scheduleAction(action); - yield* emitQueuedEvents(); - } - } - return false; - } - async function processPreparedBatch(batch) { - if (batch.length === 0) return { - items: [], - aborted: false - }; - const preparedPairs = await preparePairsForCompare(batch, "sha1", { - concurrency, - ...options.signal !== void 0 ? { signal: options.signal } : {}, - ...options.sha1ReadTimeoutMillis !== void 0 ? { sha1ReadTimeoutMillis: options.sha1ReadTimeoutMillis } : {}, - readLocalSha1: readLocalSha1File, - ...readB2Sha1 !== void 0 ? { readB2Sha1 } : {} - }); - const items = []; - for (const { originalPair, prepared } of preparedPairs) { - if (prepared.aborted || options.signal?.aborted) return { - items, - aborted: true - }; - items.push(planPreparedPair(originalPair, prepared)); - } - return { - items, - aborted: false - }; - } - function planPreparedPair(pair, prepared) { - const event = { - type: "compare", - path: (pair[0] ?? pair[1])?.relativePath ?? "", - size: 0, - bytesHashed: prepared.bytesHashed, - ...prepared.bytesVerified > 0 ? { bytesVerified: prepared.bytesVerified } : {} - }; - let preparedErrorEventCount = 0; - for (const preparedEvent of prepared.events) { - queueEvent(preparedEvent); - if (preparedEvent.type === "error") { - preparedErrorEventCount++; - recordFailurePath(preparedEvent.path); - } - } - errorCount += prepared.errors.length; - for (let index = preparedErrorEventCount; index < prepared.errors.length; index++) recordFailurePath(event.path); - if (prepared.skipActionGeneration) return { - event, - actions: [] - }; - if ((scanHadError || scanHadFilesystemError(scanEvents)) && prepared.pair[0] === null && prepared.pair[1] !== null) return { - event, - actions: [new SkipAction(prepared.pair[1].relativePath, "not removed because scan errors occurred")] - }; - if (sourceInventoryIncomplete(scanEvents) && prepared.pair[0] === null && prepared.pair[1] !== null) return { - event, - actions: [new SkipAction(prepared.pair[1].relativePath, scanEvents.sourceInventoryIncompleteMessage ?? "not removed because the source scan skipped unsafe B2 names")] - }; - return { - event, - actions: [...generateActions(prepared.pair, direction, options.compareMode, options.keepMode, keepDays, nowMillis, factory, compareThreshold)] - }; - } - async function scheduleAction(action) { - const task = executeAction(action).finally(() => { - runningActions.delete(task); - }); - runningActions.add(task); - if (runningActions.size >= concurrency) await Promise.race(runningActions); - } - async function executeAction(action) { - try { - if (actionAbortController.signal.aborted) return; - queueEvent(await action.execute(dryRun, actionAbortController.signal)); - } catch (err) { - const event = { - type: "error", - path: action.relativePath, - size: 0, - message: sanitizeErrorReason(err) - }; - recordSyncError(event); - queueEvent(event); - } - } - function recordSyncError(event) { - errorCount += 1; - recordFailurePath(event.path); - } - function recordFailurePath(path) { - if (path === "") return; - if (failedPathSet.has(path)) return; - failedPathSet.add(path); - if (failedPaths.length < MAX_AGGREGATE_FAILED_PATHS) failedPaths.push(path); - else failedPathOmittedCount++; - } - function aggregateErrorEvent() { - return { - type: "error", - path: "", - size: 0, - message: `${errorCount} sync error(s) occurred`, - failureCount: errorCount, - failedPaths: [...failedPaths], - ...failedPathOmittedCount > 0 ? { failedPathOmittedCount } : {} - }; - } - function queueEvent(event) { - queuedEvents.push(event); - } - async function* emitQueuedEvents() { - yield* drainScanEvents(scanEvents); - for (const event of queuedEvents.splice(0)) yield event; - } - async function drainActions() { - while (runningActions.size > 0) await Promise.race(runningActions); - } -} -/** -* Normalizes user-provided sync concurrency before it controls compare batches and transfers. -* -* @param value - Optional concurrency value from sync options. -* -* @returns A positive integer concurrency value. -* -* @throws When the configured concurrency is not a positive integer. -*/ -function normalizeSyncConcurrency(value) { - const candidate = value ?? 4; - if (!Number.isInteger(candidate) || candidate < 1) throw new RangeError("Sync concurrency must be a positive integer"); - return candidate; -} -function normalizeDownloadIdleTimeoutMillis(value) { - if (value === void 0) return DEFAULT_DOWNLOAD_IDLE_TIMEOUT_MILLIS; - if (value === Number.POSITIVE_INFINITY) return value; - if (!Number.isFinite(value) || value < 1) throw new RangeError("downloadIdleTimeoutMillis must be a positive finite number or Infinity"); - return Math.floor(value); -} -function assertValidB2ContentLength(contentLength) { - if (!Number.isSafeInteger(contentLength) || contentLength < 0) throw new Error("B2 contentLength must be a non-negative safe integer"); - return contentLength; -} -function createB2Sha1Reader(config) { - const upConfig = config; - const downConfig = config; - const bucket = upConfig.bucket ?? downConfig.bucket; - if (bucket === void 0) return void 0; - const readablePrefixes = b2ReadableRawPrefixes(config); - const idleTimeoutMillis = normalizeSha1TimeoutMillis(config.options.sha1ReadTimeoutMillis); - const verificationTimeoutMillis = normalizeSha1TimeoutMillis(config.options.sha1VerificationTimeoutMillis, DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS); - return async (path, signal) => { - const expectedBytes = assertValidB2ContentLength(path.selectedVersion.contentLength); - const maxBytes = normalizeSha1VerificationMaxBytes(expectedBytes, config.options.sha1VerificationMaxBytes); - return withSha1VerificationDeadline(signal, verificationTimeoutMillis, async (deadlineSignal) => { - deadlineSignal.throwIfAborted(); - if (maxBytes < expectedBytes) throw new Error(`sha1 B2 verification skipped because contentLength ${expectedBytes} exceeds ${maxBytes} byte verification budget`); - const serverSideEncryption = toSseCDownloadKey(config.options.encryptionProvider?.getSettingForDownload(path.selectedVersion)); - const fileName = validateB2SyncPathInAnyPrefix(readablePrefixes, path, "read"); - const verified = await hashReadableStreamSha1((await bucket.file(fileName).downloadById(path.selectedVersion.fileId, { - ...serverSideEncryption !== void 0 ? { serverSideEncryption } : {}, - signal: deadlineSignal - })).body, deadlineSignal, { - idleTimeoutMillis, - maxBytes, - expectedBytes - }); - return { - contentSha1: verified.contentSha1, - bytesRead: verified.bytesRead - }; - }); - }; -} -function forwardAbortSignal(source, controller) { - if (source === void 0) return () => void 0; - if (source.aborted) { - abortActionController(controller, source.reason); - return () => void 0; - } - const abort = () => abortActionController(controller, source.reason); - source.addEventListener("abort", abort, { once: true }); - return () => source.removeEventListener("abort", abort); -} -function abortActionController(controller, reason) { - if (!controller.signal.aborted) controller.abort(reason); -} -/** -* Narrowing assertion that a `Bucket` is present for an action that requires -* it. Throws with a consistent, context-tagged message when the configured -* direction did not supply one (e.g. `b2-to-local` direction asking for an -* upload action). -* -* Uses TypeScript's `asserts` signature so call-site flow narrows -* `bucket` from `Bucket | undefined` to `Bucket` after the check, without -* requiring a separate `if (!bucket) throw ...` line per action factory. -* -* @param bucket - The (possibly missing) bucket reference. -* @param context - Short verb describing the action being constructed -* (e.g. `'upload'`, `'download'`). Surfaced in the error message. -* -* @throws `Error` when `bucket` is `undefined` or `null`. -*/ + const { source, dest, options } = config; + const direction = resolveDirection(source, dest); + const dryRun = options.dryRun ?? false; + const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY; + const keepDays = options.keepDays ?? 0; + const compareThreshold = options.compareThreshold ?? 0; + const nowMillis = Date.now(); + const factory = createActionFactory(config); + const actions = []; + for await (const pair of zipFolders(source, dest)) { + if (options.signal?.aborted) return; + for (const action of generateActions( + pair, + direction, + options.compareMode, + options.keepMode, + keepDays, + nowMillis, + factory, + compareThreshold + )) { + actions.push(action); + } + yield { type: "compare", path: (pair[0] ?? pair[1])?.relativePath ?? "", size: 0 }; + } + const sem = new Semaphore(concurrency); + const results = []; + const errors = []; + const promises = actions.map(async (action) => { + await sem.acquire(); + try { + if (options.signal?.aborted) return; + const event = await action.execute(dryRun); + results.push(event); + } catch (err) { + const errorValue = toError(err); + errors.push(errorValue); + results.push({ + type: "error", + path: action.relativePath, + size: 0, + message: errorValue.message + }); + } finally { + sem.release(); + } + }); + await Promise.all(promises); + for (const event of results) { + yield event; + } + if (errors.length > 0) { + yield { + type: "error", + path: "", + size: 0, + message: `${errors.length} action(s) failed` + }; + } +} function assertBucket(bucket, context) { - if (!bucket) throw new Error(`Bucket required for ${context} actions`); -} -/** -* Returns the root for a local sync folder required by an action. -* -* @param folder - The configured folder to validate. -* @param role - Whether the local folder is the source or destination. -* @param context - Short verb describing the action being constructed. -* -* @returns The local filesystem root. -* -* @throws `Error` when the folder is not local or has no root. -*/ -function requireLocalRoot(folder, role, context) { - const root = folder?.type === "local" ? folder.root : void 0; - if (typeof root !== "string" || root === "") throw new Error(`Local ${role} root required for ${context} actions`); - return root; -} -async function resolveLocalRootContexts(config) { - const sourceIsLocalFilesystem = isLocalFilesystemFolder(config.source); - const destIsLocalFilesystem = isLocalFilesystemFolder(config.dest); - if (!sourceIsLocalFilesystem && !destIsLocalFilesystem) return {}; - const sourceContext = config.dest.type === "b2" ? "upload" : "sync"; - const destContext = config.source.type === "b2" ? "download" : "sync"; - return { - ...sourceIsLocalFilesystem ? { source: await resolveLocalRootContext(requireLocalRoot(config.source, "source", sourceContext)) } : {}, - ...destIsLocalFilesystem ? { dest: await resolveLocalRootContext(requireLocalRoot(config.dest, "destination", destContext)) } : {} - }; -} -async function resolveLocalRootContext(root) { - const { realpath, stat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - const { resolve } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19)); - const safeRoot = resolve(root); - const realPath = await realpath(safeRoot).catch((err) => { - if (isNotFoundError(err)) return safeRoot; - throw err; - }); - const stats = await stat(realPath).catch((err) => { - if (isNotFoundError(err)) return void 0; - throw err; - }); - if (stats !== void 0 && !stats.isDirectory()) throw new Error("Local sync root is not a directory"); - return { - root: safeRoot, - realPath, - ...stats === void 0 ? {} : { identity: { - deviceId: stats.dev, - inode: stats.ino - } } - }; -} -function isLocalFilesystemFolder(folder) { - return folder?.type === "local" && isLocalFilesystemRoot(folder); -} -/** -* Narrows a setting to SSE-C; non-SSE-C source settings need no key on read. -* -* @param setting - Provider-supplied encryption setting, or undefined. -* -* @returns The SSE-C setting when one is provided; otherwise undefined. -*/ -function toSseCEncryptionSetting(setting) { - if (setting?.mode !== "SSE-C") return void 0; - return setting; -} -/** -* Returns a download key from SSE-C settings; non-SSE-C downloads need no key. -* -* @param setting - Provider-supplied encryption setting, or undefined. -* -* @returns A download key for SSE-C files; otherwise undefined. -*/ -function toSseCDownloadKey(setting) { - return toSseCEncryptionSetting(setting); -} -/** -* Creates a configured sync engine wired to the bucket and paths in the given config. -* -* For sync operations that may need to remove destination-only files (the -* `keepMode: 'delete'` policy), the factory reads the destination -* bucket's cached `fileLockConfiguration` once so `removeOrphan` can -* dispatch to either `hide` (locked buckets) or `deleteFileVersion` -* (vanilla buckets) without a per-file branch. The cache is whatever -* `client.listBuckets()` or `client.createBucket()` returned — callers -* who flipped lock state mid-sync (rare) should refresh before -* synchronize(). -* -* @param config - Synchronizer configuration containing source, destination, and options. -* @param localRootContexts - Resolved filesystem roots captured before action creation. -* -* @returns An action factory bound to the provided configuration. -*/ -function createActionFactory(config, localRootContexts) { - const upConfig = config; - const downConfig = config; - const uploadPrefix = asRawB2KeyPrefix(upConfig.prefix ?? b2FolderRawPrefix(config.dest) ?? ""); - const sourceB2Prefix = b2FolderRawPrefix(config.source); - const bucketIsLocked = (upConfig.bucket ?? downConfig.bucket)?.info?.fileLockConfiguration?.value?.isFileLockEnabled ?? false; - const factory = { - upload(source, dest) { - const bucket = upConfig.bucket; - assertBucket(bucket, "upload"); - return new UploadAction(source.relativePath, source.absolutePath, source.size, async (absPath, relPath, signal) => { - const rootContext = localRootContexts.source; - const root = rootContext?.root ?? upConfig.source.root ?? ""; - const fileName = dest !== void 0 ? validateB2SyncPathInPrefix(uploadPrefix, dest) : `${uploadPrefix}${relPath}`; - if (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, relPath, { allowSymlinkRoot: true }); - const targetPath = rootContext === void 0 ? await resolveContainedLocalPath(root, source.relativePath, absPath) : await resolveContainedLocalPath(rootContext.realPath, source.relativePath); - synchronizer_throwIfAborted(signal); - const fileSource = await createValidatedUploadFileSource(source, targetPath); - synchronizer_throwIfAborted(signal); - const serverSideEncryption = config.options.encryptionProvider?.getSettingForUpload(fileName, fileSource.size); - await bucket.upload({ - fileName, - source: fileSource, - ...serverSideEncryption !== void 0 ? { serverSideEncryption } : {}, - ...signal !== void 0 ? { signal } : {} - }); - }); - }, - download(source, scannedDest) { - const bucket = downConfig.bucket; - assertBucket(bucket, "download"); - return new DownloadAction(source.relativePath, source.size, async (relPath, signal) => { - const rootContext = localRootContexts.dest; - const root = rootContext?.root ?? downConfig.dest.root ?? ""; - safeRelativePathSegments(relPath); - const b2FileName = sourceB2Prefix === void 0 ? source.selectedVersion.fileName : validateB2SyncPathInPrefix(sourceB2Prefix, source, "read"); - const idleTimeoutMillis = normalizeDownloadIdleTimeoutMillis(config.options.downloadIdleTimeoutMillis); - const expectedBytes = assertValidB2ContentLength(source.selectedVersion.contentLength); - if (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, relPath, { allowSymlinkRoot: false }); - await ensureLocalSyncRootDirectory(root, relPath); - const serverSideEncryption = toSseCDownloadKey(config.options.encryptionProvider?.getSettingForDownload(source.selectedVersion)); - const result = await bucket.file(b2FileName).downloadById(source.selectedVersion.fileId, { - ...serverSideEncryption !== void 0 ? { serverSideEncryption } : {}, - ...signal !== void 0 ? { signal } : {} - }); - try { - await writeLocalStreamInsideRoot(root, relPath, result.body, { - expectedBytes, - ...scannedDest !== void 0 ? { expectedDestination: scannedDest } : {}, - idleTimeoutMillis, - ...signal !== void 0 ? { signal } : {} - }); - } catch (err) { - await cancelReadableStreamBody(result.body, err); - throw err; - } - }); - }, - copy(source, destRelativePath) { - return copyToB2Key(source, `${uploadPrefix}${destRelativePath}`); - }, - copyB2Path(source, dest) { - return copyToB2Key(source, validateB2SyncPathInPrefix(uploadPrefix, dest)); - }, - hide(path) { - const bucket = upConfig.bucket ?? downConfig.bucket; - assertBucket(bucket, "hide"); - return new HideAction(path, async (_relPath, signal) => { - await bucket.hideFile(`${uploadPrefix}${path}`, signal === void 0 ? void 0 : { signal }); - }); - }, - hideB2Path(path) { - const bucket = upConfig.bucket ?? downConfig.bucket; - assertBucket(bucket, "hide"); - const b2FileName = validateB2SyncPathInPrefix(uploadPrefix, path); - return new HideAction(path.relativePath, async (_relPath, signal) => { - await bucket.hideFile(b2FileName, signal === void 0 ? void 0 : { signal }); - }); - }, - deleteRemote(path) { - const bucket = upConfig.bucket ?? downConfig.bucket; - assertBucket(bucket, "delete"); - const b2FileName = validateB2SyncPathInPrefix(uploadPrefix, path); - return new DeleteRemoteAction(path.relativePath, path.selectedVersion.fileId, async (fileId$1, _fileName, signal) => { - await bucket.deleteFileVersion(b2FileName, fileId(fileId$1), signal === void 0 ? void 0 : { signal }); - }); - }, - deleteLocal(path) { - const rootContext = localRootContexts.dest; - const root = rootContext?.root ?? localSyncRoot(downConfig.dest); - return new DeleteLocalAction(path.relativePath, path.absolutePath, async (absPath, signal) => { - signal?.throwIfAborted(); - if (absPath !== path.absolutePath) throw new Error(`Refusing to delete outside sync root: ${path.relativePath}`); - signal?.throwIfAborted(); - try { - if (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, path.relativePath, { allowSymlinkRoot: false }); - await deleteLocalFileInsideRoot(root, path); - } catch (err) { - if (isLocalDeleteSafetyError(err)) throw err; - throw new Error(`failed to delete local file: ${localFilesystemErrorReason(err)}`); - } - }); - }, - removeOrphan(dest) { - return bucketIsLocked ? factory.hideB2Path?.(dest) ?? factory.hide(dest.relativePath) : factory.deleteRemote(dest); - } - }; - function copyToB2Key(source, targetPath) { - const bucket = upConfig.bucket; - assertBucket(bucket, "copy"); - return new CopyAction(source.relativePath, source.size, async (_relPath, signal) => { - if (sourceB2Prefix !== void 0) validateB2SyncPathInPrefix(sourceB2Prefix, source, "read"); - const destinationServerSideEncryption = config.options.encryptionProvider?.getSettingForUpload(targetPath, source.size); - const sourceServerSideEncryption = toSseCEncryptionSetting(config.options.encryptionProvider?.getSettingForDownload(source.selectedVersion)); - await bucket.copyFile({ - sourceFileId: source.selectedVersion.fileId, - fileName: targetPath, - ...destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption } : {}, - ...sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption } : {}, - ...signal !== void 0 ? { signal } : {} - }); - }); - } - return factory; -} -async function createValidatedUploadFileSource(source, absolutePath) { - try { - const fileSource = await FileSource.fromPath(absolutePath); - await validateScannedLocalFile({ - ...source, - absolutePath - }); - return fileSource; - } catch (err) { - throw normalizeLocalUploadSourceError(err); - } -} -function normalizeLocalUploadSourceError(err) { - if (err instanceof Error && err.message.startsWith("local file changed before upload")) return err; - const message = err instanceof Error ? err.message : String(err); - if (message.includes("not a regular file")) return /* @__PURE__ */ new Error("local file changed before upload: not a regular file"); - if (message.includes("changed") || message.includes("modified")) return /* @__PURE__ */ new Error("local file changed before upload"); - return /* @__PURE__ */ new Error(`local file changed before upload: ${sanitizeErrorReason(err)}`); -} -function localSyncRoot(folder) { - return folder?.type === "local" ? folder.root : ""; -} -function b2FolderRawPrefix(folder) { - if (folder?.type !== "b2") return void 0; - const rawPrefix = folder.rawPrefix; - return typeof rawPrefix === "string" ? rawPrefix : void 0; -} -function validateB2SourcePairPrefix(pair, config) { - const [source] = pair; - if (config.source.type !== "b2" || source === null || !synchronizer_isB2SyncPath(source)) return; - const sourcePrefix = b2FolderRawPrefix(config.source); - if (sourcePrefix === void 0) return; - validateB2SyncPathInPrefix(sourcePrefix, source, "read"); -} -function b2ReadableRawPrefixes(config) { - const prefixes = []; - const sourcePrefix = b2FolderRawPrefix(config.source); - if (config.source.type === "b2") prefixes.push(sourcePrefix ?? ""); - const upConfig = config; - if (config.dest.type === "b2") prefixes.push(upConfig.prefix ?? b2FolderRawPrefix(config.dest) ?? ""); - return [...new Set(prefixes.map((prefix) => asRawB2KeyPrefix(prefix)))]; -} -function validateB2SyncPathInAnyPrefix(prefixes, path, operation) { - let firstError = /* @__PURE__ */ new Error(`Refusing to ${operation} B2 key: ${path.relativePath}`); - for (const prefix of prefixes) try { - return validateB2SyncPathInPrefix(prefix, path, operation); - } catch (err) { - if (err instanceof Error) firstError = err; - } - throw firstError; -} -function validateB2SyncPathInPrefix(prefix, path, operation = "mutate") { - const fileName = path.selectedVersion.fileName; - if (!fileName.startsWith(prefix)) throw new Error(`Refusing to ${operation} B2 key outside configured prefix: ${path.relativePath}`); - if (b2KeyToRelativePathUnderPrefix(prefix, fileName) !== path.relativePath) throw new Error(`Refusing to ${operation} mismatched B2 key for sync path: ${path.relativePath}`); - return fileName; -} -function synchronizer_isB2SyncPath(path) { - return "selectedVersion" in path; -} -function synchronizer_throwIfAborted(signal) { - if (signal?.aborted === true) throw signal.reason ?? new DOMException("Aborted", "AbortError"); -} -async function cancelReadableStreamBody(body, reason) { - if (body.locked) return; - try { - await body.cancel(reason); - } catch {} -} -async function assertLocalRootContextCurrent(context, relativePath, options) { - if (context.identity === void 0) return; - const { lstat, realpath, stat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - let currentRealPath; - try { - const rootLinkStats = await lstat(context.root); - if (!options.allowSymlinkRoot && rootLinkStats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`); - currentRealPath = await realpath(context.root); - } catch (err) { - if (err instanceof Error && err.message.startsWith("Refusing to access sync root")) throw err; - throw new Error(`Local sync root changed before filesystem action: ${relativePath}`); - } - if (currentRealPath !== context.realPath) throw new Error(`Local sync root changed before filesystem action: ${relativePath}`); - let currentStats; - try { - currentStats = await stat(context.realPath); - } catch { - throw new Error(`Local sync root changed before filesystem action: ${relativePath}`); - } - if (!currentStats.isDirectory() || currentStats.dev !== context.identity.deviceId || currentStats.ino !== context.identity.inode) throw new Error(`Local sync root changed before filesystem action: ${relativePath}`); -} -async function ensureLocalSyncRootDirectory(root, relativePath) { - if (root === "") throw new Error("Local sync root required for filesystem mutation"); - const { lstat, mkdir } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - const { resolve } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19)); - const safeRoot = resolve(root); - try { - const stats = await lstat(safeRoot); - if (stats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`); - if (!stats.isDirectory()) throw new Error(`Local sync root is not a directory: ${relativePath}`); - return; - } catch (error) { - if (!isNotFoundError(error)) throw error; - } - await mkdir(safeRoot, { recursive: true }); - await assertLocalRootHasNoSymlink(safeRoot, relativePath); -} -function bufferScanEvent(buffer, event, direction, scanSide) { - if (event.type === "skip" && event.reason === "filesystem-error") buffer.fatalFilesystemErrorMessage ??= event.message; - if (sourceSkipMakesInventoryIncomplete(event, direction, scanSide)) buffer.sourceInventoryIncompleteMessage ??= sourceInventoryIncompleteMessage(direction); - if (buffer.events.length < MAX_BUFFERED_SCAN_EVENTS) buffer.events.push(event); - else buffer.dropped++; -} -function* drainScanEvents(buffer) { - while (buffer.events.length > 0) { - const event = buffer.events.shift(); - if (event) yield event; - } - if (buffer.dropped > 0) { - yield { - type: "skip", - path: "", - size: 0, - reason: "scan-skip-overflow", - message: `${buffer.dropped} scanner skip event(s) were omitted after ${MAX_BUFFERED_SCAN_EVENTS} buffered diagnostics` - }; - buffer.dropped = 0; - } -} -function scanHadFilesystemError(scanEvents) { - return scanEvents.fatalFilesystemErrorMessage !== void 0; -} -function sourceInventoryIncomplete(scanEvents) { - return scanEvents.sourceInventoryIncompleteMessage !== void 0; -} -function scanFilesystemError(scanEvents) { - return scanEvents.fatalFilesystemErrorMessage === void 0 ? void 0 : new Error(scanEvents.fatalFilesystemErrorMessage); -} -function sourceSkipMakesInventoryIncomplete(event, direction, scanSide) { - if (scanSide !== "source" || event.type !== "skip") return false; - if (direction === "local-to-b2") return event.reason === "unsafe-name" || event.reason === "stale-download-partial" || event.reason === "path-too-long-for-regexp"; - if (direction === "b2-to-local" || direction === "b2-to-b2") return event.reason === "unsafe-name" || event.reason === "local-unsafe-name" || event.reason === "relative-path-collision" || event.reason === "local-path-collision" || event.reason === "path-too-long-for-regexp"; - return false; -} -function sourceInventoryIncompleteMessage(direction) { - return direction === "local-to-b2" ? "not removed because the source scan skipped local paths" : "not removed because the source scan skipped unsafe B2 names"; -} -function isLocalDeleteSafetyError(err) { - if (!(err instanceof Error)) return false; - return err.message === "Local sync root required for filesystem mutation" || err.message.startsWith("Local sync root changed before filesystem action: ") || err.message.startsWith("Refusing to ") || err.message.startsWith("Local sync root is not a directory: ") || err.message.startsWith("unsafe local delete path: "); -} -async function resolveContainedLocalPath(root, relativePath, absolutePath) { - if (root === "") throw new Error("Local sync root required for filesystem mutation"); - const { isAbsolute, relative, resolve, sep } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19)); - const safeRoot = resolve(root); - const target = absolutePath === void 0 ? resolve(safeRoot, relativePath) : resolve(absolutePath); - const pathFromRoot = relative(safeRoot, target); - /* v8 ignore next -- defense-in-depth after prior no-follow and symlink checks. */ - if (pathFromRoot === ".." || pathFromRoot.startsWith(`..${sep}`) || isAbsolute(pathFromRoot)) throw new Error(`Refusing to access path outside sync root: ${relativePath}`); - await assertLocalRootHasNoSymlink(safeRoot, relativePath); - await assertPathHasNoSymlinkComponents(safeRoot, pathFromRoot, relativePath); - return target; -} -async function assertLocalRootHasNoSymlink(safeRoot, relativePath) { - const { lstat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - try { - if ((await lstat(safeRoot)).isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`); - } catch (error) { - if (isNotFoundError(error)) return; - throw error; - } -} -async function assertPathHasNoSymlinkComponents(safeRoot, pathFromRoot, relativePath) { - if (pathFromRoot === "") return; - const { lstat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); - const { join, sep } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19)); - let current = safeRoot; - for (const segment of pathFromRoot.split(sep)) { - current = join(current, segment); - let stats; - try { - stats = await lstat(current); - } catch (error) { - if (isNotFoundError(error)) return; - throw error; - } - if (stats.isSymbolicLink()) throw new Error(`Refusing to access path through symlink: ${relativePath}`); - } -} -function isNotFoundError(error) { - return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT"; -} -//#endregion - + if (!bucket) throw new Error(`Bucket required for ${context} actions`); +} +function createActionFactory(config) { + const upConfig = config; + const downConfig = config; + const destBucket = upConfig.bucket ?? downConfig.bucket; + const bucketIsLocked = destBucket?.info?.fileLockConfiguration?.value?.isFileLockEnabled ?? false; + const factory = { + upload(source) { + const bucket = upConfig.bucket; + const prefix = upConfig.prefix ?? ""; + assertBucket(bucket, "upload"); + return new UploadAction( + source.relativePath, + source.absolutePath, + source.size, + async (absPath, relPath) => { + const { readFile } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); + const data = await readFile(absPath); + await bucket.upload({ + fileName: `${prefix}${relPath}`, + source: new BufferSource(new Uint8Array(data)) + }); + } + ); + }, + download(source) { + const bucket = downConfig.bucket; + const root = downConfig.dest?.type === "local" ? downConfig.dest.root : ""; + assertBucket(bucket, "download"); + return new DownloadAction(source.relativePath, source.size, async (relPath) => { + const result = await bucket.download(source.selectedVersion.fileName); + const reader = result.body.getReader(); + let combined; + try { + const chunks = []; + while (true) { + const { done, value } = await reader.read(); + if (done) break; + chunks.push(value); + } + let total = 0; + for (const c of chunks) total += c.byteLength; + combined = new Uint8Array(total); + let offset = 0; + for (const c of chunks) { + combined.set(c, offset); + offset += c.byteLength; + } + } finally { + reader.releaseLock(); + } + const { mkdir, writeFile } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); + const { dirname, join } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19)); + const destPath = join(root, relPath); + await mkdir(dirname(destPath), { recursive: true }); + await writeFile(destPath, combined); + }); + }, + copy(source, destPath) { + const bucket = upConfig.bucket; + assertBucket(bucket, "copy"); + return new CopyAction(source.relativePath, source.size, async () => { + await bucket.copyFile({ + sourceFileId: source.selectedVersion.fileId, + fileName: destPath + }); + }); + }, + hide(path) { + const bucket = upConfig.bucket ?? downConfig.bucket; + assertBucket(bucket, "hide"); + return new HideAction(path, async (relPath) => { + const prefix = upConfig.prefix ?? ""; + await bucket.hideFile(`${prefix}${relPath}`); + }); + }, + deleteRemote(path) { + const bucket = upConfig.bucket ?? downConfig.bucket; + assertBucket(bucket, "delete"); + const b2FileName = path.selectedVersion.fileName; + return new DeleteRemoteAction( + path.relativePath, + path.selectedVersion.fileId, + async (fileId$1) => { + await bucket.deleteFileVersion(b2FileName, fileId(fileId$1)); + } + ); + }, + deleteLocal(path) { + return new DeleteLocalAction(path.relativePath, path.absolutePath, async (absPath) => { + const { unlink } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)); + await unlink(absPath); + }); + }, + removeOrphan(dest) { + return bucketIsLocked ? factory.hide(dest.relativePath) : factory.deleteRemote(dest); + } + }; + return factory; +} //# sourceMappingURL=synchronizer.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/local.js - - - - - - - - - - -//#region src/sync/scanners/local.ts -/** -* Scans a local directory tree and yields {@link LocalSyncPath} entries sorted by relative path. -* A root directory read failure aborts the scan with an error diagnostic. Per-entry file or -* directory failures are reported through `onError` and the scan continues over readable siblings. -* SDK-managed partial download file names are skipped so unfinished internal -* temp files are not synchronized. -* The current implementation collects matching entries before sorting, so memory usage is -* proportional to the number of matched files. -*/ -var LocalFolder = class { - type = "local"; - appliesScanFilters = true; - appliesScanSorting = true; - /** Resolved absolute path to the local root directory. */ - root; - /** - * Creates a new LocalFolder for the given root directory. - * @param root - Absolute or relative path to the local directory to scan. - */ - constructor(root) { - this.root = resolvePathAtConstruction(root); - registerLocalFilesystemRoot(this); - } - /** - * Recursively walks the directory and yields files in sync path order. - * @param options - Optional scan controls. - */ - async *scan(options = {}) { - validateSyncFilters(options); - const nodeDeps = await loadLocalNodeDeps(); - const root = nodeDeps.resolve(this.root); - const collected = []; - await this.walk(root, root, collected, options, scanEntryLimit(options), nodeDeps); - collected.sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath)); - for (const entry of collected) { - throwIfScanAborted(options); - yield entry; - } - } - /** - * Recursively collects files from {@link dir} into {@link out}. - * @param root - Resolved scan root used for relative path calculation. - * @param dir - Absolute path of the directory to scan. - * @param out - Accumulator array that receives discovered file entries. - * @param options - Optional scan controls. - * @param maxScanEntries - Maximum number of entries to retain before failing. - * @param nodeDeps - Lazy-loaded Node filesystem and path helpers. - */ - async walk(root, dir, out, options, maxScanEntries, nodeDeps) { - throwIfScanAborted(options); - let entries; - try { - entries = await nodeDeps.readdir(dir, { withFileTypes: true }); - } catch (err) { - const error = this.emitScanError(options, relativePathFromRoot(root, dir, nodeDeps), "directory", err); - if (dir === root) throw error; - return; - } - for (const entry of entries) { - throwIfScanAborted(options); - const fullPath = nodeDeps.join(dir, entry.name); - const rel = relativePathFromRoot(root, fullPath, nodeDeps); - if (isDownloadStagingDirectorySegment(rel) && entry.isDirectory() && isDownloadStagingDirectorySegment(entry.name) && await isManagedDownloadStagingRoot(fullPath)) continue; - if (rel.includes("\\")) { - emitScannerSkip(options, { - type: "skip", - path: rel, - size: 0, - reason: "unsafe-name", - message: `Skipped local path ${JSON.stringify(rel)}: backslashes are not safe sync path characters` - }); - continue; - } - if (isReservedSyncTempFileName(entry.name)) { - emitScannerSkip(options, { - type: "skip", - path: rel, - size: 0, - reason: "stale-download-partial", - message: `Skipped local path ${JSON.stringify(rel)}: reserved SDK partial download file` - }); - continue; - } - if (entry.isDirectory()) { - if (directoryMayContainSyncPaths(rel, options)) await this.walk(root, fullPath, out, options, maxScanEntries, nodeDeps); - } else if (entry.isFile()) { - if (!pathPassesSyncFilters(rel, options)) { - if (pathSkippedByRegExpInputLimit(rel, options)) emitScannerSkip(options, regexpInputTooLongSkip(rel)); - continue; - } - let s; - try { - s = await nodeDeps.lstat(fullPath); - /* v8 ignore start -- lstat race after a Dirent file result is not deterministic */ - if (!s.isFile()) { - this.emitScanError(options, rel, "file", /* @__PURE__ */ new Error("not a regular file")); - continue; - } - } catch (err) { - /* v8 ignore next -- stat TOCTOU failures are not deterministic to trigger */ - this.emitScanError(options, relativePathFromRoot(root, fullPath, nodeDeps), "file", err); - continue; - } - assertScanEntryLimit(out.length + 1, maxScanEntries); - out.push({ - relativePath: rel, - absolutePath: fullPath, - modTimeMillis: Math.floor(s.mtimeMs), - size: s.size, - fileIdentity: localFileIdentityFromStats(s) - }); - } - } - } - emitScanError(options, path, kind, err) { - const event = { - type: "error", - path, - size: 0, - message: `failed to scan local ${kind}: ${localFilesystemErrorReason(err)}` - }; - options.onError?.(event); - return new Error(event.message); - } -}; -async function loadLocalNodeDeps() { - const [fsPromises, path] = await Promise.all([Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)), Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19))]); - return { - readdir: fsPromises.readdir, - lstat: fsPromises.lstat, - join: path.join, - relative: path.relative, - resolve: path.resolve, - sep: path.sep - }; -} -function resolvePathAtConstruction(root) { - const processLike = globalThis.process; - if (typeof processLike?.cwd !== "function") return root; - const cwd = processLike.cwd(); - if (processLike.platform === "win32") return resolveWindowsPath(cwd, root); - return resolvePosixPath(cwd, root); -} -function resolvePosixPath(cwd, root) { - const resolved = normalizePathSegments((root.startsWith("/") ? root : `${cwd}/${root}`).split("/"), "/"); - return resolved === "" ? "/" : `/${resolved}`; -} -function resolveWindowsPath(cwd, root) { - const normalizedRoot = root.replaceAll("/", "\\"); - const normalizedCwd = cwd.replaceAll("/", "\\"); - const drive = /^[A-Za-z]:/.exec(normalizedCwd)?.[0] ?? ""; - const cwdUnc = splitUncPath(normalizedCwd); - if (/^\\\\/.test(normalizedRoot)) return normalizeUncPath(normalizedRoot); - if (/^[A-Za-z]:\\/.test(normalizedRoot)) return joinWindowsRoot(normalizedRoot.slice(0, 2), normalizePathSegments(normalizedRoot.slice(3).split("\\"), "\\")); - if (/^[A-Za-z]:/.test(normalizedRoot)) throw new Error("LocalFolder root must not be a drive-relative Windows path"); - if (normalizedRoot.startsWith("\\")) { - const rest = normalizePathSegments(normalizedRoot.slice(1).split("\\"), "\\"); - return joinWindowsRoot(cwdUnc?.prefix ?? drive, rest); - } - if (cwdUnc !== void 0) { - const resolved = normalizePathSegments([...cwdUnc.rest, ...normalizedRoot.split("\\")], "\\"); - return joinWindowsRoot(cwdUnc.prefix, resolved); - } - const base = /^[A-Za-z]:\\/.test(normalizedCwd) ? normalizedCwd : `${drive}\\`; - const prefix = /^[A-Za-z]:/.exec(base)?.[0] ?? drive; - return joinWindowsRoot(prefix, normalizePathSegments([...base.slice(prefix.length).replace(/^\\/, "").split("\\"), ...normalizedRoot.split("\\")], "\\")); -} -function normalizeUncPath(path) { - const unc = splitUncPath(path); - if (unc === void 0) return path; - return joinWindowsRoot(unc.prefix, normalizePathSegments(unc.rest, "\\")); -} -function splitUncPath(path) { - if (!path.startsWith("\\\\")) return void 0; - const [server, share, ...rest] = path.split("\\").filter((part) => part !== ""); - if (server === void 0 || share === void 0) return void 0; - return { - prefix: `\\\\${server}\\${share}`, - rest - }; -} -function joinWindowsRoot(prefix, rest) { - return rest === "" ? `${prefix}\\` : `${prefix}\\${rest}`; -} -function normalizePathSegments(segments, separator) { - const out = []; - for (const segment of segments) { - if (segment === "" || segment === ".") continue; - if (segment === "..") { - out.pop(); - continue; - } - out.push(segment); - } - return out.join(separator); -} -function relativePathFromRoot(root, path, nodeDeps) { - return nodeDeps.relative(root, path).split(nodeDeps.sep).join("/"); -} -function throwIfScanAborted(options) { - if (options.signal?.aborted === true) throw options.signal.reason ?? new DOMException("Aborted", "AbortError"); -} -//#endregion +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/local.js + + +class LocalFolder { + type = "local"; + /** Absolute path to the local root directory. */ + root; + /** + * Creates a new LocalFolder for the given root directory. + * @param root - Absolute path to the local directory to scan. + */ + constructor(root) { + this.root = root; + } + /** Recursively walks the directory and yields files sorted by relative path. */ + async *scan() { + const collected = []; + await this.walk(this.root, collected); + collected.sort((a, b) => a.relativePath.localeCompare(b.relativePath)); + for (const entry of collected) { + yield entry; + } + } + /** + * Recursively collects files from {@link dir} into {@link out}. + * @param dir - Absolute path of the directory to scan. + * @param out - Accumulator array that receives discovered file entries. + */ + async walk(dir, out) { + let entries; + try { + entries = await (0,promises_.readdir)(dir, { withFileTypes: true }); + } catch { + return; + } + for (const entry of entries) { + const fullPath = (0,external_node_path_.join)(dir, entry.name); + if (entry.isDirectory()) { + await this.walk(fullPath, out); + } else if (entry.isFile()) { + try { + const s = await (0,promises_.stat)(fullPath); + const rel = (0,external_node_path_.relative)(this.root, fullPath).split(external_node_path_.sep).join("/"); + out.push({ + relativePath: rel, + absolutePath: fullPath, + modTimeMillis: Math.floor(s.mtimeMs), + size: s.size + }); + } catch { + } + } + } + } +} //# sourceMappingURL=local.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/b2.js - - - - - - - - - - - -//#region src/sync/scanners/b2.ts -var MAX_EMPTY_B2_SCAN_PAGES = 100; -/** -* Scans a B2 bucket (optionally filtered by a raw B2 key prefix) and yields -* {@link B2SyncPath} entries sorted by `compareSyncRelativePaths(relativePath)`. Hidden files are excluded. -* Raw B2 file names are used only as an internal tie-breaker after collision handling. -* All versions for the listed prefix are fetched, grouped, and sorted before -* yielding; exclude filters are applied client-side and do not reduce that -* B2 listing memory footprint. -* SDK-reserved temporary names fail the scan because syncing them could corrupt -* in-progress transfers. -*/ -var B2Folder = class { - type = "b2"; - appliesScanFilters = true; - appliesScanSorting = true; - /** Raw B2 key prefix this folder scans, preserving caller-provided separators verbatim. */ - rawPrefix; - bucket; - /** - * Creates a new B2Folder for the given bucket and optional prefix. - * @param bucket - The B2 bucket to scan. - * @param prefix - Optional raw B2 key prefix to restrict the scan scope. - * Backslashes are preserved as raw B2 key characters; pass `/` explicitly for slash prefixes. - */ - constructor(bucket, prefix = "") { - this.bucket = bucket; - this.rawPrefix = asRawB2KeyPrefix(prefix); - } - /** - * Lists all file versions in the bucket, groups by name, and yields the latest visible version. - * @param options - Optional scan controls. - */ - async *scan(options = {}) { - validateSyncFilters(options); - const maxScanEntries = scanEntryLimit(options); - const grouped = /* @__PURE__ */ new Map(); - const listPrefix = this.listPrefixFor(options); - let listedVersions = 0; - let startFileName; - let startFileId; - let emptyPageCount = 0; - while (true) { - if (scanIsAborted(options)) return; - let listing; - try { - listing = await this.bucket.listFileVersions({ - ...listPrefix !== "" ? { prefix: listPrefix } : {}, - ...startFileName !== void 0 ? { startFileName } : {}, - ...startFileId !== void 0 ? { startFileId } : {}, - ...options.signal !== void 0 ? { signal: options.signal } : {} - }); - } catch (err) { - if (scanIsAborted(options) || local_sha1_isAbortError(err)) return; - throw emitScanError(options, "failed to scan B2 file versions", err); - } - if (scanIsAborted(options)) return; - if (listing.files.length === 0) { - emptyPageCount++; - if (emptyPageCount > MAX_EMPTY_B2_SCAN_PAGES) throw emitScanError(options, "failed to scan B2 file versions", /* @__PURE__ */ new Error("B2 pagination returned too many empty pages")); - } else emptyPageCount = 0; - for (const fv of listing.files) { - if (scanIsAborted(options)) return; - assertScanEntryLimit(listedVersions + 1, maxScanEntries); - listedVersions++; - if (this.rawPrefix !== "" && !fv.fileName.startsWith(this.rawPrefix)) { - this.emitSkip(options, fv.fileName, fv.fileName, "outside-prefix", `listed object is outside configured B2 prefix ${JSON.stringify(this.rawPrefix)}`); - continue; - } - if (options.requireLocalSafePaths === true && fv.fileName.includes("\\")) { - this.emitSkip(options, fv.fileName, fv.fileName, "local-unsafe-name", "object name contains a backslash that is unsafe for local filesystem destinations"); - continue; - } - const relativePath = this.tryToRelativePath(fv.fileName); - if (relativePath === null) { - this.emitSkip(options, fv.fileName, fv.fileName, "unsafe-name", "object name cannot be represented as a safe sync relative path"); - continue; - } - if (!pathPassesSyncFilters(relativePath, options)) { - if (pathSkippedByRegExpInputLimit(relativePath, options)) emitScannerSkip(options, { - ...regexpInputTooLongSkip(relativePath), - b2FileName: fv.fileName - }); - continue; - } - const existing = grouped.get(fv.fileName); - if (existing) existing.versions.push(fv); - else grouped.set(fv.fileName, { - relativePath, - versions: [fv] - }); - } - if (!listing.nextFileName) break; - if (listing.nextFileName === startFileName && (listing.nextFileId ?? void 0) === startFileId) throw emitScanError(options, "failed to scan B2 file versions", /* @__PURE__ */ new Error("B2 pagination did not advance")); - startFileName = listing.nextFileName; - startFileId = listing.nextFileId ?? void 0; - } - const visible = this.visibleCandidates(grouped, options); - const withoutRelativeCollisions = this.rejectRelativePathCollisions(visible, options); - const sorted = (options.requireLocalSafePaths === true ? this.rejectLocalPathCollisions(withoutRelativeCollisions, options) : withoutRelativeCollisions).sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath) || compareCodeUnits(a.fileName, b.fileName)); - for (const { relativePath, versions, selectedVersion } of sorted) { - if (scanIsAborted(options)) return; - assertSyncPathAllowed(relativePath); - const contentSha1 = selectB2ComparableSha1(selectedVersion); - yield { - relativePath, - modTimeMillis: selectedVersion.uploadTimestamp, - size: selectedVersion.contentLength, - contentSha1, - contentSha1State: syncSha1StateOf({ contentSha1 }), - selectedVersion, - allVersions: versions - }; - } - } - tryToRelativePath(fileName) { - try { - return b2KeyToRelativePathUnderPrefix(this.rawPrefix, fileName); - } catch { - return null; - } - } - listPrefixFor(filters) { - const filterPrefix = literalPrefixForSyncFilters(filters); - if (filterPrefix === "") return this.rawPrefix; - if (this.rawPrefix !== "" && !this.rawPrefix.endsWith("/")) return this.rawPrefix; - return `${this.rawPrefix}${rawPrefixBeforeNormalizedSeparator(filterPrefix)}`; - } - visibleCandidates(grouped, filters) { - const visible = []; - for (const [fileName, entry] of grouped) { - entry.versions.sort((a, b) => b.uploadTimestamp - a.uploadTimestamp); - const selected = entry.versions[0]; - if (!selected || selected.action === FileAction.Hide) continue; - if (filters?.requireLocalSafePaths === true && localFilesystemSyncPathIsUnsafe(entry.relativePath)) { - this.emitSkip(filters, entry.relativePath, fileName, "local-unsafe-name", "object name is unsafe for a local filesystem destination"); - continue; - } - visible.push({ - fileName, - relativePath: entry.relativePath, - versions: entry.versions, - selectedVersion: selected - }); - } - return visible; - } - rejectRelativePathCollisions(candidates, filters) { - const accepted = []; - const owners = /* @__PURE__ */ new Map(); - const collidedRelativePaths = /* @__PURE__ */ new Set(); - for (const candidate of candidates) { - if (collidedRelativePaths.has(candidate.relativePath)) { - this.emitSkip(filters, candidate.relativePath, candidate.fileName, "relative-path-collision", "object normalizes to a relative path already rejected because of another raw B2 key"); - continue; - } - const owner = owners.get(candidate.relativePath); - if (owner !== void 0 && owner.fileName !== candidate.fileName) { - owners.delete(candidate.relativePath); - removeAcceptedCandidate(accepted, owner); - collidedRelativePaths.add(candidate.relativePath); - this.emitSkip(filters, candidate.relativePath, owner.fileName, "relative-path-collision", `object normalizes to the same relative path as ${JSON.stringify(candidate.fileName)}`); - this.emitSkip(filters, candidate.relativePath, candidate.fileName, "relative-path-collision", `object normalizes to the same relative path as ${JSON.stringify(owner.fileName)}`); - continue; - } - owners.set(candidate.relativePath, candidate); - accepted.push(candidate); - } - return accepted; - } - rejectLocalPathCollisions(candidates, filters) { - const accepted = []; - const owners = /* @__PURE__ */ new Map(); - const collidedLocalPaths = /* @__PURE__ */ new Set(); - for (const candidate of candidates) { - const canonicalPath = localFilesystemCanonicalSyncPath(candidate.relativePath); - if (collidedLocalPaths.has(canonicalPath)) { - this.emitSkip(filters, candidate.relativePath, candidate.fileName, "local-path-collision", "object collides with another object on case-insensitive or Unicode-normalizing filesystems"); - continue; - } - const owner = owners.get(canonicalPath); - if (owner !== void 0) { - owners.delete(canonicalPath); - removeAcceptedCandidate(accepted, owner); - collidedLocalPaths.add(canonicalPath); - this.emitSkip(filters, owner.relativePath, owner.fileName, "local-path-collision", `object collides with ${JSON.stringify(candidate.fileName)} on local filesystems`); - this.emitSkip(filters, candidate.relativePath, candidate.fileName, "local-path-collision", `object collides with ${JSON.stringify(owner.fileName)} on local filesystems`); - continue; - } - owners.set(canonicalPath, candidate); - accepted.push(candidate); - } - return accepted; - } - emitSkip(filters, path, b2FileName, reason, message) { - emitScannerSkip(filters, { - type: "skip", - path, - size: 0, - message: `Skipped B2 object ${JSON.stringify(b2FileName)}: ${message}`, - reason, - b2FileName - }); - } + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/file.js +const FileAction = { + /** Large file upload started but not yet finished. */ + Start: "start", + /** Normal upload (small or finished large file). */ + Upload: "upload", + /** Hide marker (soft delete). */ + Hide: "hide", + /** Virtual folder marker. */ + Folder: "folder", + /** Created via server-side copy. */ + Copy: "copy" }; -function rawPrefixBeforeNormalizedSeparator(filterPrefix) { - const separatorIndex = filterPrefix.indexOf("/"); - return separatorIndex === -1 ? filterPrefix : filterPrefix.slice(0, separatorIndex); -} -function emitScanError(options, message, err) { - const event = { - type: "error", - path: "", - size: 0, - message: `${message}: ${sanitizeErrorReason(err)}` - }; - options.onError?.(event); - return new Error(event.message); -} -function removeAcceptedCandidate(candidates, target) { - const index = candidates.indexOf(target); - if (index !== -1) candidates.splice(index, 1); -} -function scanIsAborted(filters) { - return filters?.signal?.aborted === true; -} -//#endregion +const MetadataDirective = { + /** Preserve the source file's contentType and fileInfo. */ + Copy: "COPY", + /** Use the values provided in the copy request. */ + Replace: "REPLACE" +}; + +//# sourceMappingURL=file.js.map + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/b2.js +class B2Folder { + type = "b2"; + bucket; + prefix; + /** + * Creates a new B2Folder for the given bucket and optional prefix. + * @param bucket - The B2 bucket to scan. + * @param prefix - Optional key prefix to restrict the scan scope. + */ + constructor(bucket, prefix = "") { + this.bucket = bucket; + this.prefix = prefix; + } + /** Lists all file versions in the bucket, groups by name, and yields the latest visible version. */ + async *scan() { + const grouped = /* @__PURE__ */ new Map(); + let startFileName; + let startFileId; + while (true) { + const listing = await this.bucket.listFileVersions({ + ...this.prefix !== "" ? { prefix: this.prefix } : {}, + ...startFileName !== void 0 ? { startFileName } : {}, + ...startFileId !== void 0 ? { startFileId } : {} + }); + for (const fv of listing.files) { + const existing = grouped.get(fv.fileName); + if (existing) { + existing.push(fv); + } else { + grouped.set(fv.fileName, [fv]); + } + } + if (!listing.nextFileName) break; + startFileName = listing.nextFileName; + startFileId = listing.nextFileId; + } + const sorted = [...grouped.entries()].sort((a, b) => a[0].localeCompare(b[0])); + for (const [fileName, versions] of sorted) { + versions.sort((a, b) => b.uploadTimestamp - a.uploadTimestamp); + const selected = versions[0]; + if (!selected || selected.action === FileAction.Hide) continue; + const relativePath = this.prefix !== "" ? fileName.slice(this.prefix.length) : fileName; + yield { + relativePath, + modTimeMillis: selected.uploadTimestamp, + size: selected.contentLength, + selectedVersion: selected, + allVersions: versions + }; + } + } +} //# sourceMappingURL=b2.js.map + ;// CONCATENATED MODULE: ./src/commands/sync.ts @@ -45282,22 +37806,14 @@ async function buildConfig(bucket, source, inputs, direction, signal) { } const remotePrefix = source.replace(/^\/+|\/+$/g, ''); const localDest = inputs.destination ?? '.'; - const localRoot = await prepareLocalDestinationRoot(localDest); + await (0,promises_.mkdir)((0,external_node_path_.resolve)(localDest), { recursive: true }); return { source: new B2Folder(bucket, remotePrefix === '' ? '' : `${remotePrefix}/`), - dest: new LocalFolder(localRoot), + dest: new LocalFolder((0,external_node_path_.resolve)(localDest)), bucket, options, }; } -async function prepareLocalDestinationRoot(localDest) { - const resolved = (0,external_node_path_.resolve)(localDest); - await (0,promises_.mkdir)(resolved, { recursive: true }); - const stats = await (0,promises_.lstat)(resolved); - if (stats.isSymbolicLink()) - return resolved; - return (0,promises_.realpath)(resolved); -} ;// CONCATENATED MODULE: ./src/commands/unhide.ts @@ -48730,6 +41246,7 @@ function glob_hashFiles(patterns_1) { + /** * Upload one or more files to B2. * @@ -48761,14 +41278,11 @@ async function uploadCommand(bucket, inputs, signal) { // file's multipart upload sequential so total in-flight B2 requests remain // bounded by the user-supplied `concurrency` value. const partConcurrency = isSingleExplicitFile || files.length === 1 ? inputs.concurrency : 1; - const uploadPlans = await mapWithConcurrency(files, fileConcurrency, async (f) => { - signal?.throwIfAborted(); - return await prepareUploadPlan(f, inputs, isSingleExplicitFile); - }); - const uploaded = await mapWithConcurrency(uploadPlans, fileConcurrency, async (plan) => { + const uploaded = await mapWithConcurrency(files, fileConcurrency, async (f) => { signal?.throwIfAborted(); - const uploadLabel = `upload ${plan.localPath} → b2://${bucket.name}/${plan.fileName}`; - const groupedLog = uploadPlans.length === 1 || fileConcurrency === 1; + const fileName = remapFileName(f, inputs.destination, isSingleExplicitFile); + const uploadLabel = `upload ${f.localPath} → b2://${bucket.name}/${fileName}`; + const groupedLog = files.length === 1 || fileConcurrency === 1; if (groupedLog) { startGroup(uploadLabel); } @@ -48776,7 +41290,7 @@ async function uploadCommand(bucket, inputs, signal) { info(uploadLabel); } try { - return await uploadOne(bucket, plan, inputs, partConcurrency, groupedLog, signal); + return await uploadOne(bucket, f.localPath, fileName, inputs, partConcurrency, groupedLog, signal); } finally { if (groupedLog) @@ -48821,14 +41335,7 @@ async function resolveFiles(source, include, exclude) { const looksLikeGlob = /[*?[\]]/.test(source); if (explicitFile?.isFile() && !looksLikeGlob && include.length === 0) { return { - files: [ - { - localPath: (0,external_node_path_.resolve)(source), - fileName: (0,external_node_path_.basename)(source), - size: explicitFile.size, - mtimeMs: explicitFile.mtimeMs, - }, - ], + files: [{ localPath: (0,external_node_path_.resolve)(source), fileName: (0,external_node_path_.basename)(source) }], isSingleExplicitFile: true, }; } @@ -48857,7 +41364,7 @@ async function resolveFiles(source, include, exclude) { if (!s?.isFile()) continue; const rel = (0,external_node_path_.relative)(root, m).split(external_node_path_.sep).join(external_node_path_.posix.sep); - out.push({ localPath: m, fileName: rel, size: s.size, mtimeMs: s.mtimeMs }); + out.push({ localPath: m, fileName: rel }); } out.sort(compareResolvedFiles); return { files: out, isSingleExplicitFile: false }; @@ -48885,27 +41392,15 @@ function remapFileName(file, destination, isSingleExplicitFile) { return dest; return `${dest}/${file.fileName}`; } -async function prepareUploadPlan(file, inputs, isSingleExplicitFile) { - const size = file.size; - const lastModifiedMillis = inputs.preserveMtime ? Math.trunc(file.mtimeMs) : undefined; - const fileInfo = buildUploadFileInfo(inputs.fileInfo, lastModifiedMillis); - validateFileInfo(fileInfo, uploadFileInfoTotalMaxBytes(inputs.encryption)); - return { - localPath: file.localPath, - fileName: remapFileName(file, inputs.destination, isSingleExplicitFile), - size, - lastModifiedMillis, - fileInfo, - }; -} -async function uploadOne(bucket, plan, inputs, partConcurrency, groupedLog, signal) { - const { fileInfo, fileName, lastModifiedMillis, localPath, size } = plan; +async function uploadOne(bucket, localPath, fileName, inputs, partConcurrency, groupedLog, signal) { + const fileStat = await (0,promises_.stat)(localPath); + const size = fileStat.size; // Stream the file from disk. The SDK's `bucket.upload` routes files larger // than the recommended part size through `uploadLargeFile`, which now // detects non-sliceable sources (StreamSource) and reads the stream once, // shipping one part at a time. Peak memory ≈ partSize regardless of file // size, so multi-GB uploads stay bounded. - const nodeStream = (0,external_node_fs_.createReadStream)(localPath); + const nodeStream = (0,external_node_fs_namespaceObject.createReadStream)(localPath); const webStream = external_node_stream_.Readable.toWeb(nodeStream); const source = new StreamSource(webStream, size); const onProgress = makeProgressListener(`upload[${fileName}]`); @@ -48924,8 +41419,6 @@ async function uploadOne(bucket, plan, inputs, partConcurrency, groupedLog, sign concurrency: partConcurrency, ...(inputs.partSize !== undefined ? { partSize: inputs.partSize } : {}), ...(inputs.contentType !== undefined ? { contentType: inputs.contentType } : {}), - ...(Object.keys(fileInfo).length > 0 ? { fileInfo } : {}), - ...(lastModifiedMillis !== undefined ? { lastModifiedMillis } : {}), ...(inputs.encryption !== undefined ? { serverSideEncryption: inputs.encryption } : {}), ...(signal !== undefined ? { signal } : {}), onProgress, @@ -48935,33 +41428,14 @@ async function uploadOne(bucket, plan, inputs, partConcurrency, groupedLog, sign const sha1 = result.contentSha1; const detailPrefix = groupedLog ? ' ' : ''; info(`${detailPrefix}fileId=${result.fileId} sha1=${sha1 ?? 'multipart'}`); - const resultFileInfo = Object.keys(result.fileInfo).length > 0 ? result.fileInfo : fileInfo; return { localPath, fileName: result.fileName, fileId: result.fileId, size, contentSha1: sha1, - fileInfo: resultFileInfo, }; } -function buildUploadFileInfo(inputFileInfo, lastModifiedMillis) { - const fileInfo = {}; - for (const [key, value] of Object.entries(inputFileInfo)) { - const canonicalKey = key.toLowerCase(); - if (Object.hasOwn(fileInfo, canonicalKey)) { - throw new Error(`Duplicate fileInfo key "${key}" from upload metadata`); - } - fileInfo[canonicalKey] = value; - } - if (lastModifiedMillis !== undefined) { - if (Object.hasOwn(fileInfo, 'src_last_modified_millis')) { - throw new Error(`Duplicate fileInfo key "src_last_modified_millis" from 'preserve-mtime' input`); - } - fileInfo.src_last_modified_millis = String(lastModifiedMillis); - } - return fileInfo; -} ;// CONCATENATED MODULE: ./src/commands/verify.ts @@ -49068,7 +41542,7 @@ async function sha1OfFile(path) { throw new Error(`verify: 'destination' must be an existing file, got: ${path}`); } const hasher = new IncrementalSha1(); - const stream = (0,external_node_fs_.createReadStream)(path); + const stream = (0,external_node_fs_namespaceObject.createReadStream)(path); for await (const chunk of stream) { await hasher.update(chunk); } @@ -49837,7 +42311,7 @@ function isEntrypoint(metaUrl, argv1) { if (argv1 === undefined) return false; try { - return (0,external_node_fs_.realpathSync)((0,external_node_url_.fileURLToPath)(metaUrl)) === (0,external_node_fs_.realpathSync)((0,external_node_path_.resolve)(argv1)); + return (0,external_node_fs_namespaceObject.realpathSync)((0,external_node_url_.fileURLToPath)(metaUrl)) === (0,external_node_fs_namespaceObject.realpathSync)((0,external_node_path_.resolve)(argv1)); } catch { return false; diff --git a/dist/index.js.map b/dist/index.js.map index aefc18e..f1f9050 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;AAAA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9sBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC98CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrRA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC11BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/dA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/tEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5gCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/lDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACllBA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACNA;AACA;;;;;;;;;;;;;;;;;;ACDA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AChCA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9QA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9JA;AACA;AACA;AACA;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACvPA;AAEA;;;;;;;;;;;AAWA;AACA;;;ACdA;AAEA;AAMA;AA6BA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AAKA;AACA;AACA;AACA;AAAA;AAEA;AACA;;;;;;;AC3IA;AACA;AAEA;AAEA;AAEA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;;;AC3DA;AAEA;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmFA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;AAYA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AAKA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAKA;AAKA;AAKA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;AAUA;AACA;AACA;AAAA;AACA;AACA;AAEA;;;AAGA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAEA;;;;AAIA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAMA;AAOA;AAAA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC3jBA;AAEA;AACA;AAkBA;;;;;;;;;;;AAWA;AACA;AAMA;AACA;AACA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACnFA;AACA;AAmBA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC3FA;AAEA;AACA;AACA;AAoBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAEA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;;;;;ACpHA;;ACCA;AAEA;;;;;AAKA;AACA;AACA;AACA;;;ACXA;;;;;AAKA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;;;ACXA;AAEA;AAEA;;;;;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAGA;AACA;AAIA;AACA;AACA;AACA;AACA;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAgDA;;;;;;;;;;AAUA;AACA;AAKA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AAOA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAQA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;;;;AAIA;AACA;AASA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAKA;AAKA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAGA;AACA;;;AChjBA;AAEA;AAoBA;;;;;;;;AAQA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtDA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;AClCA;AA8BA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/VA;AAEA;AACA;AAkBA;;;;;;;;;;;;;;AAcA;AACA;AAKA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAOA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;;;ACtHA;AAGA;AAsBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AChGA;AAEA;AACA;AAgBA;;;;;;;;;;;;;;;;;AAiBA;AACA;AAIA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChPA;AACA;AACA;AASA;AACA;AACA;AAwBA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAGA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;;;;;;;;;;AAUA;AACA;AAKA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;;;AClQA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACx0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzlCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpOA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAMA;AA8BA;;;;;;;;;;;;;;;AAeA;AACA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AA8BA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AAKA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;;;ACzVA;AACA;AACA;AAEA;AACA;AAsBA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC/IA;AAQA;AAEA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;;;AClPA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AA+BA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AAEA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AAEA;AAIA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC9NA;AACA;AACA;AAEA;AACA;AAmBA;;;;;;;;AAQA;AACA;AAMA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA","sources":[".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js",".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/abort-signal.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-pipeline.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-upgrade.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/readable.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/diagnostics.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/tree.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/balanced-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h1.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h2.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/fixed-queue.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-stats.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/retry-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/decorator-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/redirect-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/retry-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dns.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dump.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/retry.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pluralizer.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/util/timers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cache.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cachestorage.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/parse.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/body.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/data-url.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/dispatcher-weakref.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/file.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata-parser.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/headers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/response.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/webidl.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/encoding.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/filereader.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/progressevent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/connection.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/events.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/frame.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/permessage-deflate.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/receiver.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/sender.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/websocket.js","../external node-commonjs \"assert\"","../external node-commonjs \"events\"","../external node-commonjs \"http\"","../external node-commonjs \"https\"","../external node-commonjs \"net\"","../external node-commonjs \"node:assert\"","../external node-commonjs \"node:async_hooks\"","../external node-commonjs \"node:buffer\"","../external node-commonjs \"node:console\"","../external node-commonjs \"node:crypto\"","../external node-commonjs \"node:diagnostics_channel\"","../external node-commonjs \"node:dns\"","../external node-commonjs \"node:events\"","../external node-commonjs \"node:fs\"","../external node-commonjs \"node:fs/promises\"","../external node-commonjs \"node:http\"","../external node-commonjs \"node:http2\"","../external node-commonjs \"node:net\"","../external node-commonjs \"node:path\"","../external node-commonjs \"node:perf_hooks\"","../external node-commonjs \"node:querystring\"","../external node-commonjs \"node:stream\"","../external node-commonjs \"node:tls\"","../external node-commonjs \"node:url\"","../external node-commonjs \"node:util\"","../external node-commonjs \"node:util/types\"","../external node-commonjs \"node:worker_threads\"","../external node-commonjs \"node:zlib\"","../external node-commonjs \"string_decoder\"","../external node-commonjs \"tls\"","../external node-commonjs \"util\"","../webpack/bootstrap","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/compat","../external node-commonjs \"os\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/command.js","../external node-commonjs \"crypto\"","../external node-commonjs \"fs\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/file-command.js","../external node-commonjs \"path\"",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/proxy.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/index.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/auth.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/oidc-utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/summary.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/path-utils.js","../external node-commonjs \"child_process\"",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io-util.js",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io.js","../external node-commonjs \"timers\"",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/toolrunner.js",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/exec.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/platform.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/core.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/upload-url-pool.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/in-memory.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/ids.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/retry.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/paginator.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/concurrency.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/file.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/abort-scope.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/internal/url-redaction.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/errors.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/errors/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/best-effort.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/cancel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/finish.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/plan-ranges.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/copy/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/text-codec.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/encoding.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/progress.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/normalize.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/hash.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/sha1.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/checksum.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/internal/upload-retry-options.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/source.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/bucket.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/encryption.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/resume.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/retry.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/options.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/to-error.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/collect.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/parallel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/stream.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/object.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/bucket.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/realms.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/url-guard.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/_virtual/_b2-sdk-version-json.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/version.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/user-agent.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/transport.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/client.js",".././src/version.ts",".././src/client.ts",".././src/sse.ts",".././src/inputs.ts",".././src/commands/copy.ts",".././src/commands/delete-all.ts",".././src/commands/delete.ts","../external node-commonjs \"node:stream/promises\"",".././src/fs.ts",".././src/format.ts",".././src/progress.ts",".././src/commands/download.ts",".././src/commands/head.ts",".././src/commands/hide.ts",".././src/commands/list.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/s3/index.js",".././src/commands/presign.ts",".././src/commands/purge.ts",".././src/commands/retention.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/file-source.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/actions/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/regexp-safety.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scan-events.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/filters.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/path-order.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scan-limit.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/pairing.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/error-reason.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/sha1-options.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-file-identity.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-sha1.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/sha1-metadata.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/compare.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/path-safety.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/download-staging.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/prefix.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/filesystem-errors.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-filesystem-root.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/b2-sha1-reader.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-file-io.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/synchronizer.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/local.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/b2.js",".././src/commands/sync.ts",".././src/commands/unhide.ts",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-glob-options-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-match-kind.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern-helper.js",".././node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js",".././node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/esm/index.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/brace-expressions.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/unescape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/ast.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/escape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-search-state.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-globber.js","../external node-commonjs \"stream\"",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-hash-files.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/glob.js",".././src/commands/upload.ts",".././src/commands/verify.ts",".././src/errors.ts",".././src/outputs.ts",".././src/summary.ts",".././src/main.ts"],"sourcesContent":["module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict'\n\nconst Client = require('./lib/dispatcher/client')\nconst Dispatcher = require('./lib/dispatcher/dispatcher')\nconst Pool = require('./lib/dispatcher/pool')\nconst BalancedPool = require('./lib/dispatcher/balanced-pool')\nconst Agent = require('./lib/dispatcher/agent')\nconst ProxyAgent = require('./lib/dispatcher/proxy-agent')\nconst EnvHttpProxyAgent = require('./lib/dispatcher/env-http-proxy-agent')\nconst RetryAgent = require('./lib/dispatcher/retry-agent')\nconst errors = require('./lib/core/errors')\nconst util = require('./lib/core/util')\nconst { InvalidArgumentError } = errors\nconst api = require('./lib/api')\nconst buildConnector = require('./lib/core/connect')\nconst MockClient = require('./lib/mock/mock-client')\nconst MockAgent = require('./lib/mock/mock-agent')\nconst MockPool = require('./lib/mock/mock-pool')\nconst mockErrors = require('./lib/mock/mock-errors')\nconst RetryHandler = require('./lib/handler/retry-handler')\nconst { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global')\nconst DecoratorHandler = require('./lib/handler/decorator-handler')\nconst RedirectHandler = require('./lib/handler/redirect-handler')\nconst createRedirectInterceptor = require('./lib/interceptor/redirect-interceptor')\n\nObject.assign(Dispatcher.prototype, api)\n\nmodule.exports.Dispatcher = Dispatcher\nmodule.exports.Client = Client\nmodule.exports.Pool = Pool\nmodule.exports.BalancedPool = BalancedPool\nmodule.exports.Agent = Agent\nmodule.exports.ProxyAgent = ProxyAgent\nmodule.exports.EnvHttpProxyAgent = EnvHttpProxyAgent\nmodule.exports.RetryAgent = RetryAgent\nmodule.exports.RetryHandler = RetryHandler\n\nmodule.exports.DecoratorHandler = DecoratorHandler\nmodule.exports.RedirectHandler = RedirectHandler\nmodule.exports.createRedirectInterceptor = createRedirectInterceptor\nmodule.exports.interceptors = {\n redirect: require('./lib/interceptor/redirect'),\n retry: require('./lib/interceptor/retry'),\n dump: require('./lib/interceptor/dump'),\n dns: require('./lib/interceptor/dns')\n}\n\nmodule.exports.buildConnector = buildConnector\nmodule.exports.errors = errors\nmodule.exports.util = {\n parseHeaders: util.parseHeaders,\n headerNameToString: util.headerNameToString\n}\n\nfunction makeDispatcher (fn) {\n return (url, opts, handler) => {\n if (typeof opts === 'function') {\n handler = opts\n opts = null\n }\n\n if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {\n throw new InvalidArgumentError('invalid url')\n }\n\n if (opts != null && typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (opts && opts.path != null) {\n if (typeof opts.path !== 'string') {\n throw new InvalidArgumentError('invalid opts.path')\n }\n\n let path = opts.path\n if (!opts.path.startsWith('/')) {\n path = `/${path}`\n }\n\n url = new URL(util.parseOrigin(url).origin + path)\n } else {\n if (!opts) {\n opts = typeof url === 'object' ? url : {}\n }\n\n url = util.parseURL(url)\n }\n\n const { agent, dispatcher = getGlobalDispatcher() } = opts\n\n if (agent) {\n throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')\n }\n\n return fn.call(dispatcher, {\n ...opts,\n origin: url.origin,\n path: url.search ? `${url.pathname}${url.search}` : url.pathname,\n method: opts.method || (opts.body ? 'PUT' : 'GET')\n }, handler)\n }\n}\n\nmodule.exports.setGlobalDispatcher = setGlobalDispatcher\nmodule.exports.getGlobalDispatcher = getGlobalDispatcher\n\nconst fetchImpl = require('./lib/web/fetch').fetch\nmodule.exports.fetch = async function fetch (init, options = undefined) {\n try {\n return await fetchImpl(init, options)\n } catch (err) {\n if (err && typeof err === 'object') {\n Error.captureStackTrace(err)\n }\n\n throw err\n }\n}\nmodule.exports.Headers = require('./lib/web/fetch/headers').Headers\nmodule.exports.Response = require('./lib/web/fetch/response').Response\nmodule.exports.Request = require('./lib/web/fetch/request').Request\nmodule.exports.FormData = require('./lib/web/fetch/formdata').FormData\nmodule.exports.File = globalThis.File ?? require('node:buffer').File\nmodule.exports.FileReader = require('./lib/web/fileapi/filereader').FileReader\n\nconst { setGlobalOrigin, getGlobalOrigin } = require('./lib/web/fetch/global')\n\nmodule.exports.setGlobalOrigin = setGlobalOrigin\nmodule.exports.getGlobalOrigin = getGlobalOrigin\n\nconst { CacheStorage } = require('./lib/web/cache/cachestorage')\nconst { kConstruct } = require('./lib/web/cache/symbols')\n\n// Cache & CacheStorage are tightly coupled with fetch. Even if it may run\n// in an older version of Node, it doesn't have any use without fetch.\nmodule.exports.caches = new CacheStorage(kConstruct)\n\nconst { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/web/cookies')\n\nmodule.exports.deleteCookie = deleteCookie\nmodule.exports.getCookies = getCookies\nmodule.exports.getSetCookies = getSetCookies\nmodule.exports.setCookie = setCookie\n\nconst { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/data-url')\n\nmodule.exports.parseMIMEType = parseMIMEType\nmodule.exports.serializeAMimeType = serializeAMimeType\n\nconst { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/web/websocket/events')\nmodule.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket\nmodule.exports.CloseEvent = CloseEvent\nmodule.exports.ErrorEvent = ErrorEvent\nmodule.exports.MessageEvent = MessageEvent\n\nmodule.exports.request = makeDispatcher(api.request)\nmodule.exports.stream = makeDispatcher(api.stream)\nmodule.exports.pipeline = makeDispatcher(api.pipeline)\nmodule.exports.connect = makeDispatcher(api.connect)\nmodule.exports.upgrade = makeDispatcher(api.upgrade)\n\nmodule.exports.MockClient = MockClient\nmodule.exports.MockPool = MockPool\nmodule.exports.MockAgent = MockAgent\nmodule.exports.mockErrors = mockErrors\n\nconst { EventSource } = require('./lib/web/eventsource/eventsource')\n\nmodule.exports.EventSource = EventSource\n","const { addAbortListener } = require('../core/util')\nconst { RequestAbortedError } = require('../core/errors')\n\nconst kListener = Symbol('kListener')\nconst kSignal = Symbol('kSignal')\n\nfunction abort (self) {\n if (self.abort) {\n self.abort(self[kSignal]?.reason)\n } else {\n self.reason = self[kSignal]?.reason ?? new RequestAbortedError()\n }\n removeSignal(self)\n}\n\nfunction addSignal (self, signal) {\n self.reason = null\n\n self[kSignal] = null\n self[kListener] = null\n\n if (!signal) {\n return\n }\n\n if (signal.aborted) {\n abort(self)\n return\n }\n\n self[kSignal] = signal\n self[kListener] = () => {\n abort(self)\n }\n\n addAbortListener(self[kSignal], self[kListener])\n}\n\nfunction removeSignal (self) {\n if (!self[kSignal]) {\n return\n }\n\n if ('removeEventListener' in self[kSignal]) {\n self[kSignal].removeEventListener('abort', self[kListener])\n } else {\n self[kSignal].removeListener('abort', self[kListener])\n }\n\n self[kSignal] = null\n self[kListener] = null\n}\n\nmodule.exports = {\n addSignal,\n removeSignal\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { AsyncResource } = require('node:async_hooks')\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass ConnectHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n const { signal, opaque, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n super('UNDICI_CONNECT')\n\n this.opaque = opaque || null\n this.responseHeaders = responseHeaders || null\n this.callback = callback\n this.abort = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders () {\n throw new SocketError('bad connect', null)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n const { callback, opaque, context } = this\n\n removeSignal(this)\n\n this.callback = null\n\n let headers = rawHeaders\n // Indicates is an HTTP2Session\n if (headers != null) {\n headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n }\n\n this.runInAsyncScope(callback, null, null, {\n statusCode,\n headers,\n socket,\n opaque,\n context\n })\n }\n\n onError (err) {\n const { callback, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n }\n}\n\nfunction connect (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n connect.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const connectHandler = new ConnectHandler(opts, callback)\n this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = connect\n","'use strict'\n\nconst {\n Readable,\n Duplex,\n PassThrough\n} = require('node:stream')\nconst {\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nconst kResume = Symbol('resume')\n\nclass PipelineRequest extends Readable {\n constructor () {\n super({ autoDestroy: true })\n\n this[kResume] = null\n }\n\n _read () {\n const { [kResume]: resume } = this\n\n if (resume) {\n this[kResume] = null\n resume()\n }\n }\n\n _destroy (err, callback) {\n this._read()\n\n callback(err)\n }\n}\n\nclass PipelineResponse extends Readable {\n constructor (resume) {\n super({ autoDestroy: true })\n this[kResume] = resume\n }\n\n _read () {\n this[kResume]()\n }\n\n _destroy (err, callback) {\n if (!err && !this._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n callback(err)\n }\n}\n\nclass PipelineHandler extends AsyncResource {\n constructor (opts, handler) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof handler !== 'function') {\n throw new InvalidArgumentError('invalid handler')\n }\n\n const { signal, method, opaque, onInfo, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_PIPELINE')\n\n this.opaque = opaque || null\n this.responseHeaders = responseHeaders || null\n this.handler = handler\n this.abort = null\n this.context = null\n this.onInfo = onInfo || null\n\n this.req = new PipelineRequest().on('error', util.nop)\n\n this.ret = new Duplex({\n readableObjectMode: opts.objectMode,\n autoDestroy: true,\n read: () => {\n const { body } = this\n\n if (body?.resume) {\n body.resume()\n }\n },\n write: (chunk, encoding, callback) => {\n const { req } = this\n\n if (req.push(chunk, encoding) || req._readableState.destroyed) {\n callback()\n } else {\n req[kResume] = callback\n }\n },\n destroy: (err, callback) => {\n const { body, req, res, ret, abort } = this\n\n if (!err && !ret._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n if (abort && err) {\n abort()\n }\n\n util.destroy(body, err)\n util.destroy(req, err)\n util.destroy(res, err)\n\n removeSignal(this)\n\n callback(err)\n }\n }).on('prefinish', () => {\n const { req } = this\n\n // Node < 15 does not call _final in same tick.\n req.push(null)\n })\n\n this.res = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n const { ret, res } = this\n\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(!res, 'pipeline cannot be retried')\n assert(!ret.destroyed)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume) {\n const { opaque, handler, context } = this\n\n if (statusCode < 200) {\n if (this.onInfo) {\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n this.res = new PipelineResponse(resume)\n\n let body\n try {\n this.handler = null\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n body = this.runInAsyncScope(handler, null, {\n statusCode,\n headers,\n opaque,\n body: this.res,\n context\n })\n } catch (err) {\n this.res.on('error', util.nop)\n throw err\n }\n\n if (!body || typeof body.on !== 'function') {\n throw new InvalidReturnValueError('expected Readable')\n }\n\n body\n .on('data', (chunk) => {\n const { ret, body } = this\n\n if (!ret.push(chunk) && body.pause) {\n body.pause()\n }\n })\n .on('error', (err) => {\n const { ret } = this\n\n util.destroy(ret, err)\n })\n .on('end', () => {\n const { ret } = this\n\n ret.push(null)\n })\n .on('close', () => {\n const { ret } = this\n\n if (!ret._readableState.ended) {\n util.destroy(ret, new RequestAbortedError())\n }\n })\n\n this.body = body\n }\n\n onData (chunk) {\n const { res } = this\n return res.push(chunk)\n }\n\n onComplete (trailers) {\n const { res } = this\n res.push(null)\n }\n\n onError (err) {\n const { ret } = this\n this.handler = null\n util.destroy(ret, err)\n }\n}\n\nfunction pipeline (opts, handler) {\n try {\n const pipelineHandler = new PipelineHandler(opts, handler)\n this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)\n return pipelineHandler.ret\n } catch (err) {\n return new PassThrough().destroy(err)\n }\n}\n\nmodule.exports = pipeline\n","'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('./readable')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\n\nclass RequestHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts\n\n try {\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {\n throw new InvalidArgumentError('invalid highWaterMark')\n }\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_REQUEST')\n } catch (err) {\n if (util.isStream(body)) {\n util.destroy(body.on('error', util.nop), err)\n }\n throw err\n }\n\n this.method = method\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.callback = callback\n this.res = null\n this.abort = null\n this.body = body\n this.trailers = {}\n this.context = null\n this.onInfo = onInfo || null\n this.throwOnError = throwOnError\n this.highWaterMark = highWaterMark\n this.signal = signal\n this.reason = null\n this.removeAbortListener = null\n\n if (util.isStream(body)) {\n body.on('error', (err) => {\n this.onError(err)\n })\n }\n\n if (this.signal) {\n if (this.signal.aborted) {\n this.reason = this.signal.reason ?? new RequestAbortedError()\n } else {\n this.removeAbortListener = util.addAbortListener(this.signal, () => {\n this.reason = this.signal.reason ?? new RequestAbortedError()\n if (this.res) {\n util.destroy(this.res.on('error', util.nop), this.reason)\n } else if (this.abort) {\n this.abort(this.reason)\n }\n\n if (this.removeAbortListener) {\n this.res?.off('close', this.removeAbortListener)\n this.removeAbortListener()\n this.removeAbortListener = null\n }\n })\n }\n }\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this\n\n const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n if (statusCode < 200) {\n if (this.onInfo) {\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n const contentType = parsedHeaders['content-type']\n const contentLength = parsedHeaders['content-length']\n const res = new Readable({\n resume,\n abort,\n contentType,\n contentLength: this.method !== 'HEAD' && contentLength\n ? Number(contentLength)\n : null,\n highWaterMark\n })\n\n if (this.removeAbortListener) {\n res.on('close', this.removeAbortListener)\n }\n\n this.callback = null\n this.res = res\n if (callback !== null) {\n if (this.throwOnError && statusCode >= 400) {\n this.runInAsyncScope(getResolveErrorBodyCallback, null,\n { callback, body: res, contentType, statusCode, statusMessage, headers }\n )\n } else {\n this.runInAsyncScope(callback, null, null, {\n statusCode,\n headers,\n trailers: this.trailers,\n opaque,\n body: res,\n context\n })\n }\n }\n }\n\n onData (chunk) {\n return this.res.push(chunk)\n }\n\n onComplete (trailers) {\n util.parseHeaders(trailers, this.trailers)\n this.res.push(null)\n }\n\n onError (err) {\n const { res, callback, body, opaque } = this\n\n if (callback) {\n // TODO: Does this need queueMicrotask?\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n\n if (res) {\n this.res = null\n // Ensure all queued handlers are invoked before destroying res.\n queueMicrotask(() => {\n util.destroy(res, err)\n })\n }\n\n if (body) {\n this.body = null\n util.destroy(body, err)\n }\n\n if (this.removeAbortListener) {\n res?.off('close', this.removeAbortListener)\n this.removeAbortListener()\n this.removeAbortListener = null\n }\n }\n}\n\nfunction request (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n request.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n this.dispatch(opts, new RequestHandler(opts, callback))\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = request\nmodule.exports.RequestHandler = RequestHandler\n","'use strict'\n\nconst assert = require('node:assert')\nconst { finished, PassThrough } = require('node:stream')\nconst { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass StreamHandler extends AsyncResource {\n constructor (opts, factory, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts\n\n try {\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('invalid factory')\n }\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_STREAM')\n } catch (err) {\n if (util.isStream(body)) {\n util.destroy(body.on('error', util.nop), err)\n }\n throw err\n }\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.factory = factory\n this.callback = callback\n this.res = null\n this.abort = null\n this.context = null\n this.trailers = null\n this.body = body\n this.onInfo = onInfo || null\n this.throwOnError = throwOnError || false\n\n if (util.isStream(body)) {\n body.on('error', (err) => {\n this.onError(err)\n })\n }\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const { factory, opaque, context, callback, responseHeaders } = this\n\n const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n if (statusCode < 200) {\n if (this.onInfo) {\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n this.factory = null\n\n let res\n\n if (this.throwOnError && statusCode >= 400) {\n const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n const contentType = parsedHeaders['content-type']\n res = new PassThrough()\n\n this.callback = null\n this.runInAsyncScope(getResolveErrorBodyCallback, null,\n { callback, body: res, contentType, statusCode, statusMessage, headers }\n )\n } else {\n if (factory === null) {\n return\n }\n\n res = this.runInAsyncScope(factory, null, {\n statusCode,\n headers,\n opaque,\n context\n })\n\n if (\n !res ||\n typeof res.write !== 'function' ||\n typeof res.end !== 'function' ||\n typeof res.on !== 'function'\n ) {\n throw new InvalidReturnValueError('expected Writable')\n }\n\n // TODO: Avoid finished. It registers an unnecessary amount of listeners.\n finished(res, { readable: false }, (err) => {\n const { callback, res, opaque, trailers, abort } = this\n\n this.res = null\n if (err || !res.readable) {\n util.destroy(res, err)\n }\n\n this.callback = null\n this.runInAsyncScope(callback, null, err || null, { opaque, trailers })\n\n if (err) {\n abort()\n }\n })\n }\n\n res.on('drain', resume)\n\n this.res = res\n\n const needDrain = res.writableNeedDrain !== undefined\n ? res.writableNeedDrain\n : res._writableState?.needDrain\n\n return needDrain !== true\n }\n\n onData (chunk) {\n const { res } = this\n\n return res ? res.write(chunk) : true\n }\n\n onComplete (trailers) {\n const { res } = this\n\n removeSignal(this)\n\n if (!res) {\n return\n }\n\n this.trailers = util.parseHeaders(trailers)\n\n res.end()\n }\n\n onError (err) {\n const { res, callback, opaque, body } = this\n\n removeSignal(this)\n\n this.factory = null\n\n if (res) {\n this.res = null\n util.destroy(res, err)\n } else if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n\n if (body) {\n this.body = null\n util.destroy(body, err)\n }\n }\n}\n\nfunction stream (opts, factory, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n stream.call(this, opts, factory, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n this.dispatch(opts, new StreamHandler(opts, factory, callback))\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = stream\n","'use strict'\n\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst { AsyncResource } = require('node:async_hooks')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nclass UpgradeHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n const { signal, opaque, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n super('UNDICI_UPGRADE')\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.callback = callback\n this.abort = null\n this.context = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = null\n }\n\n onHeaders () {\n throw new SocketError('bad upgrade', null)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n assert(statusCode === 101)\n\n const { callback, opaque, context } = this\n\n removeSignal(this)\n\n this.callback = null\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n this.runInAsyncScope(callback, null, null, {\n headers,\n socket,\n opaque,\n context\n })\n }\n\n onError (err) {\n const { callback, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n }\n}\n\nfunction upgrade (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n upgrade.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const upgradeHandler = new UpgradeHandler(opts, callback)\n this.dispatch({\n ...opts,\n method: opts.method || 'GET',\n upgrade: opts.protocol || 'Websocket'\n }, upgradeHandler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = upgrade\n","'use strict'\n\nmodule.exports.request = require('./api-request')\nmodule.exports.stream = require('./api-stream')\nmodule.exports.pipeline = require('./api-pipeline')\nmodule.exports.upgrade = require('./api-upgrade')\nmodule.exports.connect = require('./api-connect')\n","// Ported from https://github.com/nodejs/undici/pull/907\n\n'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('node:stream')\nconst { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require('../core/errors')\nconst util = require('../core/util')\nconst { ReadableStreamFrom } = require('../core/util')\n\nconst kConsume = Symbol('kConsume')\nconst kReading = Symbol('kReading')\nconst kBody = Symbol('kBody')\nconst kAbort = Symbol('kAbort')\nconst kContentType = Symbol('kContentType')\nconst kContentLength = Symbol('kContentLength')\n\nconst noop = () => {}\n\nclass BodyReadable extends Readable {\n constructor ({\n resume,\n abort,\n contentType = '',\n contentLength,\n highWaterMark = 64 * 1024 // Same as nodejs fs streams.\n }) {\n super({\n autoDestroy: true,\n read: resume,\n highWaterMark\n })\n\n this._readableState.dataEmitted = false\n\n this[kAbort] = abort\n this[kConsume] = null\n this[kBody] = null\n this[kContentType] = contentType\n this[kContentLength] = contentLength\n\n // Is stream being consumed through Readable API?\n // This is an optimization so that we avoid checking\n // for 'data' and 'readable' listeners in the hot path\n // inside push().\n this[kReading] = false\n }\n\n destroy (err) {\n if (!err && !this._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n if (err) {\n this[kAbort]()\n }\n\n return super.destroy(err)\n }\n\n _destroy (err, callback) {\n // Workaround for Node \"bug\". If the stream is destroyed in same\n // tick as it is created, then a user who is waiting for a\n // promise (i.e micro tick) for installing a 'error' listener will\n // never get a chance and will always encounter an unhandled exception.\n if (!this[kReading]) {\n setImmediate(() => {\n callback(err)\n })\n } else {\n callback(err)\n }\n }\n\n on (ev, ...args) {\n if (ev === 'data' || ev === 'readable') {\n this[kReading] = true\n }\n return super.on(ev, ...args)\n }\n\n addListener (ev, ...args) {\n return this.on(ev, ...args)\n }\n\n off (ev, ...args) {\n const ret = super.off(ev, ...args)\n if (ev === 'data' || ev === 'readable') {\n this[kReading] = (\n this.listenerCount('data') > 0 ||\n this.listenerCount('readable') > 0\n )\n }\n return ret\n }\n\n removeListener (ev, ...args) {\n return this.off(ev, ...args)\n }\n\n push (chunk) {\n if (this[kConsume] && chunk !== null) {\n consumePush(this[kConsume], chunk)\n return this[kReading] ? super.push(chunk) : true\n }\n return super.push(chunk)\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-text\n async text () {\n return consume(this, 'text')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-json\n async json () {\n return consume(this, 'json')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-blob\n async blob () {\n return consume(this, 'blob')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-bytes\n async bytes () {\n return consume(this, 'bytes')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n async arrayBuffer () {\n return consume(this, 'arrayBuffer')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-formdata\n async formData () {\n // TODO: Implement.\n throw new NotSupportedError()\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-bodyused\n get bodyUsed () {\n return util.isDisturbed(this)\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-body\n get body () {\n if (!this[kBody]) {\n this[kBody] = ReadableStreamFrom(this)\n if (this[kConsume]) {\n // TODO: Is this the best way to force a lock?\n this[kBody].getReader() // Ensure stream is locked.\n assert(this[kBody].locked)\n }\n }\n return this[kBody]\n }\n\n async dump (opts) {\n let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024\n const signal = opts?.signal\n\n if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) {\n throw new InvalidArgumentError('signal must be an AbortSignal')\n }\n\n signal?.throwIfAborted()\n\n if (this._readableState.closeEmitted) {\n return null\n }\n\n return await new Promise((resolve, reject) => {\n if (this[kContentLength] > limit) {\n this.destroy(new AbortError())\n }\n\n const onAbort = () => {\n this.destroy(signal.reason ?? new AbortError())\n }\n signal?.addEventListener('abort', onAbort)\n\n this\n .on('close', function () {\n signal?.removeEventListener('abort', onAbort)\n if (signal?.aborted) {\n reject(signal.reason ?? new AbortError())\n } else {\n resolve(null)\n }\n })\n .on('error', noop)\n .on('data', function (chunk) {\n limit -= chunk.length\n if (limit <= 0) {\n this.destroy()\n }\n })\n .resume()\n })\n }\n}\n\n// https://streams.spec.whatwg.org/#readablestream-locked\nfunction isLocked (self) {\n // Consume is an implicit lock.\n return (self[kBody] && self[kBody].locked === true) || self[kConsume]\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction isUnusable (self) {\n return util.isDisturbed(self) || isLocked(self)\n}\n\nasync function consume (stream, type) {\n assert(!stream[kConsume])\n\n return new Promise((resolve, reject) => {\n if (isUnusable(stream)) {\n const rState = stream._readableState\n if (rState.destroyed && rState.closeEmitted === false) {\n stream\n .on('error', err => {\n reject(err)\n })\n .on('close', () => {\n reject(new TypeError('unusable'))\n })\n } else {\n reject(rState.errored ?? new TypeError('unusable'))\n }\n } else {\n queueMicrotask(() => {\n stream[kConsume] = {\n type,\n stream,\n resolve,\n reject,\n length: 0,\n body: []\n }\n\n stream\n .on('error', function (err) {\n consumeFinish(this[kConsume], err)\n })\n .on('close', function () {\n if (this[kConsume].body !== null) {\n consumeFinish(this[kConsume], new RequestAbortedError())\n }\n })\n\n consumeStart(stream[kConsume])\n })\n }\n })\n}\n\nfunction consumeStart (consume) {\n if (consume.body === null) {\n return\n }\n\n const { _readableState: state } = consume.stream\n\n if (state.bufferIndex) {\n const start = state.bufferIndex\n const end = state.buffer.length\n for (let n = start; n < end; n++) {\n consumePush(consume, state.buffer[n])\n }\n } else {\n for (const chunk of state.buffer) {\n consumePush(consume, chunk)\n }\n }\n\n if (state.endEmitted) {\n consumeEnd(this[kConsume])\n } else {\n consume.stream.on('end', function () {\n consumeEnd(this[kConsume])\n })\n }\n\n consume.stream.resume()\n\n while (consume.stream.read() != null) {\n // Loop\n }\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n */\nfunction chunksDecode (chunks, length) {\n if (chunks.length === 0 || length === 0) {\n return ''\n }\n const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length)\n const bufferLength = buffer.length\n\n // Skip BOM.\n const start =\n bufferLength > 2 &&\n buffer[0] === 0xef &&\n buffer[1] === 0xbb &&\n buffer[2] === 0xbf\n ? 3\n : 0\n return buffer.utf8Slice(start, bufferLength)\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n * @returns {Uint8Array}\n */\nfunction chunksConcat (chunks, length) {\n if (chunks.length === 0 || length === 0) {\n return new Uint8Array(0)\n }\n if (chunks.length === 1) {\n // fast-path\n return new Uint8Array(chunks[0])\n }\n const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer)\n\n let offset = 0\n for (let i = 0; i < chunks.length; ++i) {\n const chunk = chunks[i]\n buffer.set(chunk, offset)\n offset += chunk.length\n }\n\n return buffer\n}\n\nfunction consumeEnd (consume) {\n const { type, body, resolve, stream, length } = consume\n\n try {\n if (type === 'text') {\n resolve(chunksDecode(body, length))\n } else if (type === 'json') {\n resolve(JSON.parse(chunksDecode(body, length)))\n } else if (type === 'arrayBuffer') {\n resolve(chunksConcat(body, length).buffer)\n } else if (type === 'blob') {\n resolve(new Blob(body, { type: stream[kContentType] }))\n } else if (type === 'bytes') {\n resolve(chunksConcat(body, length))\n }\n\n consumeFinish(consume)\n } catch (err) {\n stream.destroy(err)\n }\n}\n\nfunction consumePush (consume, chunk) {\n consume.length += chunk.length\n consume.body.push(chunk)\n}\n\nfunction consumeFinish (consume, err) {\n if (consume.body === null) {\n return\n }\n\n if (err) {\n consume.reject(err)\n } else {\n consume.resolve()\n }\n\n consume.type = null\n consume.stream = null\n consume.resolve = null\n consume.reject = null\n consume.length = 0\n consume.body = null\n}\n\nmodule.exports = { Readable: BodyReadable, chunksDecode }\n","const assert = require('node:assert')\nconst {\n ResponseStatusCodeError\n} = require('../core/errors')\n\nconst { chunksDecode } = require('./readable')\nconst CHUNK_LIMIT = 128 * 1024\n\nasync function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {\n assert(body)\n\n let chunks = []\n let length = 0\n\n try {\n for await (const chunk of body) {\n chunks.push(chunk)\n length += chunk.length\n if (length > CHUNK_LIMIT) {\n chunks = []\n length = 0\n break\n }\n }\n } catch {\n chunks = []\n length = 0\n // Do nothing....\n }\n\n const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`\n\n if (statusCode === 204 || !contentType || !length) {\n queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)))\n return\n }\n\n const stackTraceLimit = Error.stackTraceLimit\n Error.stackTraceLimit = 0\n let payload\n\n try {\n if (isContentTypeApplicationJson(contentType)) {\n payload = JSON.parse(chunksDecode(chunks, length))\n } else if (isContentTypeText(contentType)) {\n payload = chunksDecode(chunks, length)\n }\n } catch {\n // process in a callback to avoid throwing in the microtask queue\n } finally {\n Error.stackTraceLimit = stackTraceLimit\n }\n queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)))\n}\n\nconst isContentTypeApplicationJson = (contentType) => {\n return (\n contentType.length > 15 &&\n contentType[11] === '/' &&\n contentType[0] === 'a' &&\n contentType[1] === 'p' &&\n contentType[2] === 'p' &&\n contentType[3] === 'l' &&\n contentType[4] === 'i' &&\n contentType[5] === 'c' &&\n contentType[6] === 'a' &&\n contentType[7] === 't' &&\n contentType[8] === 'i' &&\n contentType[9] === 'o' &&\n contentType[10] === 'n' &&\n contentType[12] === 'j' &&\n contentType[13] === 's' &&\n contentType[14] === 'o' &&\n contentType[15] === 'n'\n )\n}\n\nconst isContentTypeText = (contentType) => {\n return (\n contentType.length > 4 &&\n contentType[4] === '/' &&\n contentType[0] === 't' &&\n contentType[1] === 'e' &&\n contentType[2] === 'x' &&\n contentType[3] === 't'\n )\n}\n\nmodule.exports = {\n getResolveErrorBodyCallback,\n isContentTypeApplicationJson,\n isContentTypeText\n}\n","'use strict'\n\nconst net = require('node:net')\nconst assert = require('node:assert')\nconst util = require('./util')\nconst { InvalidArgumentError, ConnectTimeoutError } = require('./errors')\nconst timers = require('../util/timers')\n\nfunction noop () {}\n\nlet tls // include tls conditionally since it is not always available\n\n// TODO: session re-use does not wait for the first\n// connection to resolve the session and might therefore\n// resolve the same servername multiple times even when\n// re-use is enabled.\n\nlet SessionCache\n// FIXME: remove workaround when the Node bug is fixed\n// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\nif (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) {\n SessionCache = class WeakSessionCache {\n constructor (maxCachedSessions) {\n this._maxCachedSessions = maxCachedSessions\n this._sessionCache = new Map()\n this._sessionRegistry = new global.FinalizationRegistry((key) => {\n if (this._sessionCache.size < this._maxCachedSessions) {\n return\n }\n\n const ref = this._sessionCache.get(key)\n if (ref !== undefined && ref.deref() === undefined) {\n this._sessionCache.delete(key)\n }\n })\n }\n\n get (sessionKey) {\n const ref = this._sessionCache.get(sessionKey)\n return ref ? ref.deref() : null\n }\n\n set (sessionKey, session) {\n if (this._maxCachedSessions === 0) {\n return\n }\n\n this._sessionCache.set(sessionKey, new WeakRef(session))\n this._sessionRegistry.register(session, sessionKey)\n }\n }\n} else {\n SessionCache = class SimpleSessionCache {\n constructor (maxCachedSessions) {\n this._maxCachedSessions = maxCachedSessions\n this._sessionCache = new Map()\n }\n\n get (sessionKey) {\n return this._sessionCache.get(sessionKey)\n }\n\n set (sessionKey, session) {\n if (this._maxCachedSessions === 0) {\n return\n }\n\n if (this._sessionCache.size >= this._maxCachedSessions) {\n // remove the oldest session\n const { value: oldestKey } = this._sessionCache.keys().next()\n this._sessionCache.delete(oldestKey)\n }\n\n this._sessionCache.set(sessionKey, session)\n }\n }\n}\n\nfunction buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {\n if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')\n }\n\n const options = { path: socketPath, ...opts }\n const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)\n timeout = timeout == null ? 10e3 : timeout\n allowH2 = allowH2 != null ? allowH2 : false\n return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n let socket\n if (protocol === 'https:') {\n if (!tls) {\n tls = require('node:tls')\n }\n servername = servername || options.servername || util.getServerName(host) || null\n\n const sessionKey = servername || hostname\n assert(sessionKey)\n\n const session = customSession || sessionCache.get(sessionKey) || null\n\n port = port || 443\n\n socket = tls.connect({\n highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...\n ...options,\n servername,\n session,\n localAddress,\n // TODO(HTTP/2): Add support for h2c\n ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],\n socket: httpSocket, // upgrade socket connection\n port,\n host: hostname\n })\n\n socket\n .on('session', function (session) {\n // TODO (fix): Can a session become invalid once established? Don't think so?\n sessionCache.set(sessionKey, session)\n })\n } else {\n assert(!httpSocket, 'httpSocket can only be sent on TLS update')\n\n port = port || 80\n\n socket = net.connect({\n highWaterMark: 64 * 1024, // Same as nodejs fs streams.\n ...options,\n localAddress,\n port,\n host: hostname\n })\n }\n\n // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket\n if (options.keepAlive == null || options.keepAlive) {\n const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay\n socket.setKeepAlive(true, keepAliveInitialDelay)\n }\n\n const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port })\n\n socket\n .setNoDelay(true)\n .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {\n queueMicrotask(clearConnectTimeout)\n\n if (callback) {\n const cb = callback\n callback = null\n cb(null, this)\n }\n })\n .on('error', function (err) {\n queueMicrotask(clearConnectTimeout)\n\n if (callback) {\n const cb = callback\n callback = null\n cb(err)\n }\n })\n\n return socket\n }\n}\n\n/**\n * @param {WeakRef} socketWeakRef\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n * @returns {() => void}\n */\nconst setupConnectTimeout = process.platform === 'win32'\n ? (socketWeakRef, opts) => {\n if (!opts.timeout) {\n return noop\n }\n\n let s1 = null\n let s2 = null\n const fastTimer = timers.setFastTimeout(() => {\n // setImmediate is added to make sure that we prioritize socket error events over timeouts\n s1 = setImmediate(() => {\n // Windows needs an extra setImmediate probably due to implementation differences in the socket logic\n s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))\n })\n }, opts.timeout)\n return () => {\n timers.clearFastTimeout(fastTimer)\n clearImmediate(s1)\n clearImmediate(s2)\n }\n }\n : (socketWeakRef, opts) => {\n if (!opts.timeout) {\n return noop\n }\n\n let s1 = null\n const fastTimer = timers.setFastTimeout(() => {\n // setImmediate is added to make sure that we prioritize socket error events over timeouts\n s1 = setImmediate(() => {\n onConnectTimeout(socketWeakRef.deref(), opts)\n })\n }, opts.timeout)\n return () => {\n timers.clearFastTimeout(fastTimer)\n clearImmediate(s1)\n }\n }\n\n/**\n * @param {net.Socket} socket\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n */\nfunction onConnectTimeout (socket, opts) {\n // The socket could be already garbage collected\n if (socket == null) {\n return\n }\n\n let message = 'Connect Timeout Error'\n if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {\n message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`\n } else {\n message += ` (attempted address: ${opts.hostname}:${opts.port},`\n }\n\n message += ` timeout: ${opts.timeout}ms)`\n\n util.destroy(socket, new ConnectTimeoutError(message))\n}\n\nmodule.exports = buildConnector\n","'use strict'\n\n/** @type {Record} */\nconst headerNameLowerCasedRecord = {}\n\n// https://developer.mozilla.org/docs/Web/HTTP/Headers\nconst wellknownHeaderNames = [\n 'Accept',\n 'Accept-Encoding',\n 'Accept-Language',\n 'Accept-Ranges',\n 'Access-Control-Allow-Credentials',\n 'Access-Control-Allow-Headers',\n 'Access-Control-Allow-Methods',\n 'Access-Control-Allow-Origin',\n 'Access-Control-Expose-Headers',\n 'Access-Control-Max-Age',\n 'Access-Control-Request-Headers',\n 'Access-Control-Request-Method',\n 'Age',\n 'Allow',\n 'Alt-Svc',\n 'Alt-Used',\n 'Authorization',\n 'Cache-Control',\n 'Clear-Site-Data',\n 'Connection',\n 'Content-Disposition',\n 'Content-Encoding',\n 'Content-Language',\n 'Content-Length',\n 'Content-Location',\n 'Content-Range',\n 'Content-Security-Policy',\n 'Content-Security-Policy-Report-Only',\n 'Content-Type',\n 'Cookie',\n 'Cross-Origin-Embedder-Policy',\n 'Cross-Origin-Opener-Policy',\n 'Cross-Origin-Resource-Policy',\n 'Date',\n 'Device-Memory',\n 'Downlink',\n 'ECT',\n 'ETag',\n 'Expect',\n 'Expect-CT',\n 'Expires',\n 'Forwarded',\n 'From',\n 'Host',\n 'If-Match',\n 'If-Modified-Since',\n 'If-None-Match',\n 'If-Range',\n 'If-Unmodified-Since',\n 'Keep-Alive',\n 'Last-Modified',\n 'Link',\n 'Location',\n 'Max-Forwards',\n 'Origin',\n 'Permissions-Policy',\n 'Pragma',\n 'Proxy-Authenticate',\n 'Proxy-Authorization',\n 'RTT',\n 'Range',\n 'Referer',\n 'Referrer-Policy',\n 'Refresh',\n 'Retry-After',\n 'Sec-WebSocket-Accept',\n 'Sec-WebSocket-Extensions',\n 'Sec-WebSocket-Key',\n 'Sec-WebSocket-Protocol',\n 'Sec-WebSocket-Version',\n 'Server',\n 'Server-Timing',\n 'Service-Worker-Allowed',\n 'Service-Worker-Navigation-Preload',\n 'Set-Cookie',\n 'SourceMap',\n 'Strict-Transport-Security',\n 'Supports-Loading-Mode',\n 'TE',\n 'Timing-Allow-Origin',\n 'Trailer',\n 'Transfer-Encoding',\n 'Upgrade',\n 'Upgrade-Insecure-Requests',\n 'User-Agent',\n 'Vary',\n 'Via',\n 'WWW-Authenticate',\n 'X-Content-Type-Options',\n 'X-DNS-Prefetch-Control',\n 'X-Frame-Options',\n 'X-Permitted-Cross-Domain-Policies',\n 'X-Powered-By',\n 'X-Requested-With',\n 'X-XSS-Protection'\n]\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n const key = wellknownHeaderNames[i]\n const lowerCasedKey = key.toLowerCase()\n headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =\n lowerCasedKey\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(headerNameLowerCasedRecord, null)\n\nmodule.exports = {\n wellknownHeaderNames,\n headerNameLowerCasedRecord\n}\n","'use strict'\nconst diagnosticsChannel = require('node:diagnostics_channel')\nconst util = require('node:util')\n\nconst undiciDebugLog = util.debuglog('undici')\nconst fetchDebuglog = util.debuglog('fetch')\nconst websocketDebuglog = util.debuglog('websocket')\nlet isClientSet = false\nconst channels = {\n // Client\n beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),\n connected: diagnosticsChannel.channel('undici:client:connected'),\n connectError: diagnosticsChannel.channel('undici:client:connectError'),\n sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),\n // Request\n create: diagnosticsChannel.channel('undici:request:create'),\n bodySent: diagnosticsChannel.channel('undici:request:bodySent'),\n headers: diagnosticsChannel.channel('undici:request:headers'),\n trailers: diagnosticsChannel.channel('undici:request:trailers'),\n error: diagnosticsChannel.channel('undici:request:error'),\n // WebSocket\n open: diagnosticsChannel.channel('undici:websocket:open'),\n close: diagnosticsChannel.channel('undici:websocket:close'),\n socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),\n ping: diagnosticsChannel.channel('undici:websocket:ping'),\n pong: diagnosticsChannel.channel('undici:websocket:pong')\n}\n\nif (undiciDebugLog.enabled || fetchDebuglog.enabled) {\n const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog\n\n // Track all Client events\n diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host }\n } = evt\n debuglog(\n 'connecting to %s using %s%s',\n `${host}${port ? `:${port}` : ''}`,\n protocol,\n version\n )\n })\n\n diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host }\n } = evt\n debuglog(\n 'connected to %s using %s%s',\n `${host}${port ? `:${port}` : ''}`,\n protocol,\n version\n )\n })\n\n diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host },\n error\n } = evt\n debuglog(\n 'connection to %s using %s%s errored - %s',\n `${host}${port ? `:${port}` : ''}`,\n protocol,\n version,\n error.message\n )\n })\n\n diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n const {\n request: { method, path, origin }\n } = evt\n debuglog('sending request to %s %s/%s', method, origin, path)\n })\n\n // Track Request events\n diagnosticsChannel.channel('undici:request:headers').subscribe(evt => {\n const {\n request: { method, path, origin },\n response: { statusCode }\n } = evt\n debuglog(\n 'received response to %s %s/%s - HTTP %d',\n method,\n origin,\n path,\n statusCode\n )\n })\n\n diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => {\n const {\n request: { method, path, origin }\n } = evt\n debuglog('trailers received from %s %s/%s', method, origin, path)\n })\n\n diagnosticsChannel.channel('undici:request:error').subscribe(evt => {\n const {\n request: { method, path, origin },\n error\n } = evt\n debuglog(\n 'request to %s %s/%s errored - %s',\n method,\n origin,\n path,\n error.message\n )\n })\n\n isClientSet = true\n}\n\nif (websocketDebuglog.enabled) {\n if (!isClientSet) {\n const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog\n diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host }\n } = evt\n debuglog(\n 'connecting to %s%s using %s%s',\n host,\n port ? `:${port}` : '',\n protocol,\n version\n )\n })\n\n diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host }\n } = evt\n debuglog(\n 'connected to %s%s using %s%s',\n host,\n port ? `:${port}` : '',\n protocol,\n version\n )\n })\n\n diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host },\n error\n } = evt\n debuglog(\n 'connection to %s%s using %s%s errored - %s',\n host,\n port ? `:${port}` : '',\n protocol,\n version,\n error.message\n )\n })\n\n diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n const {\n request: { method, path, origin }\n } = evt\n debuglog('sending request to %s %s/%s', method, origin, path)\n })\n }\n\n // Track all WebSocket events\n diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => {\n const {\n address: { address, port }\n } = evt\n websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '')\n })\n\n diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => {\n const { websocket, code, reason } = evt\n websocketDebuglog(\n 'closed connection to %s - %s %s',\n websocket.url,\n code,\n reason\n )\n })\n\n diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => {\n websocketDebuglog('connection errored - %s', err.message)\n })\n\n diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => {\n websocketDebuglog('ping received')\n })\n\n diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => {\n websocketDebuglog('pong received')\n })\n}\n\nmodule.exports = {\n channels\n}\n","'use strict'\n\nconst kUndiciError = Symbol.for('undici.error.UND_ERR')\nclass UndiciError extends Error {\n constructor (message) {\n super(message)\n this.name = 'UndiciError'\n this.code = 'UND_ERR'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kUndiciError] === true\n }\n\n [kUndiciError] = true\n}\n\nconst kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT')\nclass ConnectTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ConnectTimeoutError'\n this.message = message || 'Connect Timeout Error'\n this.code = 'UND_ERR_CONNECT_TIMEOUT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kConnectTimeoutError] === true\n }\n\n [kConnectTimeoutError] = true\n}\n\nconst kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT')\nclass HeadersTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'HeadersTimeoutError'\n this.message = message || 'Headers Timeout Error'\n this.code = 'UND_ERR_HEADERS_TIMEOUT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kHeadersTimeoutError] === true\n }\n\n [kHeadersTimeoutError] = true\n}\n\nconst kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW')\nclass HeadersOverflowError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'HeadersOverflowError'\n this.message = message || 'Headers Overflow Error'\n this.code = 'UND_ERR_HEADERS_OVERFLOW'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kHeadersOverflowError] === true\n }\n\n [kHeadersOverflowError] = true\n}\n\nconst kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT')\nclass BodyTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'BodyTimeoutError'\n this.message = message || 'Body Timeout Error'\n this.code = 'UND_ERR_BODY_TIMEOUT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kBodyTimeoutError] === true\n }\n\n [kBodyTimeoutError] = true\n}\n\nconst kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE')\nclass ResponseStatusCodeError extends UndiciError {\n constructor (message, statusCode, headers, body) {\n super(message)\n this.name = 'ResponseStatusCodeError'\n this.message = message || 'Response Status Code Error'\n this.code = 'UND_ERR_RESPONSE_STATUS_CODE'\n this.body = body\n this.status = statusCode\n this.statusCode = statusCode\n this.headers = headers\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseStatusCodeError] === true\n }\n\n [kResponseStatusCodeError] = true\n}\n\nconst kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG')\nclass InvalidArgumentError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'InvalidArgumentError'\n this.message = message || 'Invalid Argument Error'\n this.code = 'UND_ERR_INVALID_ARG'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kInvalidArgumentError] === true\n }\n\n [kInvalidArgumentError] = true\n}\n\nconst kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE')\nclass InvalidReturnValueError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'InvalidReturnValueError'\n this.message = message || 'Invalid Return Value Error'\n this.code = 'UND_ERR_INVALID_RETURN_VALUE'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kInvalidReturnValueError] === true\n }\n\n [kInvalidReturnValueError] = true\n}\n\nconst kAbortError = Symbol.for('undici.error.UND_ERR_ABORT')\nclass AbortError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'AbortError'\n this.message = message || 'The operation was aborted'\n this.code = 'UND_ERR_ABORT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kAbortError] === true\n }\n\n [kAbortError] = true\n}\n\nconst kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED')\nclass RequestAbortedError extends AbortError {\n constructor (message) {\n super(message)\n this.name = 'AbortError'\n this.message = message || 'Request aborted'\n this.code = 'UND_ERR_ABORTED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kRequestAbortedError] === true\n }\n\n [kRequestAbortedError] = true\n}\n\nconst kInformationalError = Symbol.for('undici.error.UND_ERR_INFO')\nclass InformationalError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'InformationalError'\n this.message = message || 'Request information'\n this.code = 'UND_ERR_INFO'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kInformationalError] === true\n }\n\n [kInformationalError] = true\n}\n\nconst kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH')\nclass RequestContentLengthMismatchError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'RequestContentLengthMismatchError'\n this.message = message || 'Request body length does not match content-length header'\n this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kRequestContentLengthMismatchError] === true\n }\n\n [kRequestContentLengthMismatchError] = true\n}\n\nconst kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH')\nclass ResponseContentLengthMismatchError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ResponseContentLengthMismatchError'\n this.message = message || 'Response body length does not match content-length header'\n this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseContentLengthMismatchError] === true\n }\n\n [kResponseContentLengthMismatchError] = true\n}\n\nconst kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED')\nclass ClientDestroyedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ClientDestroyedError'\n this.message = message || 'The client is destroyed'\n this.code = 'UND_ERR_DESTROYED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kClientDestroyedError] === true\n }\n\n [kClientDestroyedError] = true\n}\n\nconst kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED')\nclass ClientClosedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ClientClosedError'\n this.message = message || 'The client is closed'\n this.code = 'UND_ERR_CLOSED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kClientClosedError] === true\n }\n\n [kClientClosedError] = true\n}\n\nconst kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET')\nclass SocketError extends UndiciError {\n constructor (message, socket) {\n super(message)\n this.name = 'SocketError'\n this.message = message || 'Socket error'\n this.code = 'UND_ERR_SOCKET'\n this.socket = socket\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kSocketError] === true\n }\n\n [kSocketError] = true\n}\n\nconst kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED')\nclass NotSupportedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'NotSupportedError'\n this.message = message || 'Not supported error'\n this.code = 'UND_ERR_NOT_SUPPORTED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kNotSupportedError] === true\n }\n\n [kNotSupportedError] = true\n}\n\nconst kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM')\nclass BalancedPoolMissingUpstreamError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'MissingUpstreamError'\n this.message = message || 'No upstream has been added to the BalancedPool'\n this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kBalancedPoolMissingUpstreamError] === true\n }\n\n [kBalancedPoolMissingUpstreamError] = true\n}\n\nconst kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')\nclass HTTPParserError extends Error {\n constructor (message, code, data) {\n super(message)\n this.name = 'HTTPParserError'\n this.code = code ? `HPE_${code}` : undefined\n this.data = data ? data.toString() : undefined\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kHTTPParserError] === true\n }\n\n [kHTTPParserError] = true\n}\n\nconst kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE')\nclass ResponseExceededMaxSizeError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ResponseExceededMaxSizeError'\n this.message = message || 'Response content exceeded max size'\n this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseExceededMaxSizeError] === true\n }\n\n [kResponseExceededMaxSizeError] = true\n}\n\nconst kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY')\nclass RequestRetryError extends UndiciError {\n constructor (message, code, { headers, data }) {\n super(message)\n this.name = 'RequestRetryError'\n this.message = message || 'Request retry error'\n this.code = 'UND_ERR_REQ_RETRY'\n this.statusCode = code\n this.data = data\n this.headers = headers\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kRequestRetryError] === true\n }\n\n [kRequestRetryError] = true\n}\n\nconst kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')\nclass ResponseError extends UndiciError {\n constructor (message, code, { headers, data }) {\n super(message)\n this.name = 'ResponseError'\n this.message = message || 'Response error'\n this.code = 'UND_ERR_RESPONSE'\n this.statusCode = code\n this.data = data\n this.headers = headers\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseError] === true\n }\n\n [kResponseError] = true\n}\n\nconst kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS')\nclass SecureProxyConnectionError extends UndiciError {\n constructor (cause, message, options) {\n super(message, { cause, ...(options ?? {}) })\n this.name = 'SecureProxyConnectionError'\n this.message = message || 'Secure Proxy Connection failed'\n this.code = 'UND_ERR_PRX_TLS'\n this.cause = cause\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kSecureProxyConnectionError] === true\n }\n\n [kSecureProxyConnectionError] = true\n}\n\nconst kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED')\nclass MessageSizeExceededError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'MessageSizeExceededError'\n this.message = message || 'Max decompressed message size exceeded'\n this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kMessageSizeExceededError] === true\n }\n\n get [kMessageSizeExceededError] () {\n return true\n }\n}\n\nmodule.exports = {\n AbortError,\n HTTPParserError,\n UndiciError,\n HeadersTimeoutError,\n HeadersOverflowError,\n BodyTimeoutError,\n RequestContentLengthMismatchError,\n ConnectTimeoutError,\n ResponseStatusCodeError,\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError,\n ClientDestroyedError,\n ClientClosedError,\n InformationalError,\n SocketError,\n NotSupportedError,\n ResponseContentLengthMismatchError,\n BalancedPoolMissingUpstreamError,\n ResponseExceededMaxSizeError,\n RequestRetryError,\n ResponseError,\n SecureProxyConnectionError,\n MessageSizeExceededError\n}\n","'use strict'\n\nconst {\n InvalidArgumentError,\n NotSupportedError\n} = require('./errors')\nconst assert = require('node:assert')\nconst {\n isValidHTTPToken,\n isValidHeaderValue,\n isStream,\n destroy,\n isBuffer,\n isFormDataLike,\n isIterable,\n isBlobLike,\n buildURL,\n validateHandler,\n getServerName,\n normalizedMethodRecords\n} = require('./util')\nconst { channels } = require('./diagnostics.js')\nconst { headerNameLowerCasedRecord } = require('./constants')\n\n// Verifies that a given path is valid does not contain control chars \\x00 to \\x20\nconst invalidPathRegex = /[^\\u0021-\\u00ff]/\n\nconst kHandler = Symbol('handler')\n\nclass Request {\n constructor (origin, {\n path,\n method,\n body,\n headers,\n query,\n idempotent,\n blocking,\n upgrade,\n headersTimeout,\n bodyTimeout,\n reset,\n throwOnError,\n expectContinue,\n servername\n }, handler) {\n if (typeof path !== 'string') {\n throw new InvalidArgumentError('path must be a string')\n } else if (\n path[0] !== '/' &&\n !(path.startsWith('http://') || path.startsWith('https://')) &&\n method !== 'CONNECT'\n ) {\n throw new InvalidArgumentError('path must be an absolute URL or start with a slash')\n } else if (invalidPathRegex.test(path)) {\n throw new InvalidArgumentError('invalid request path')\n }\n\n if (typeof method !== 'string') {\n throw new InvalidArgumentError('method must be a string')\n } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {\n throw new InvalidArgumentError('invalid request method')\n }\n\n if (upgrade && typeof upgrade !== 'string') {\n throw new InvalidArgumentError('upgrade must be a string')\n }\n\n if (upgrade && !isValidHeaderValue(upgrade)) {\n throw new InvalidArgumentError('invalid upgrade header')\n }\n\n if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n throw new InvalidArgumentError('invalid headersTimeout')\n }\n\n if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n throw new InvalidArgumentError('invalid bodyTimeout')\n }\n\n if (reset != null && typeof reset !== 'boolean') {\n throw new InvalidArgumentError('invalid reset')\n }\n\n if (expectContinue != null && typeof expectContinue !== 'boolean') {\n throw new InvalidArgumentError('invalid expectContinue')\n }\n\n this.headersTimeout = headersTimeout\n\n this.bodyTimeout = bodyTimeout\n\n this.throwOnError = throwOnError === true\n\n this.method = method\n\n this.abort = null\n\n if (body == null) {\n this.body = null\n } else if (isStream(body)) {\n this.body = body\n\n const rState = this.body._readableState\n if (!rState || !rState.autoDestroy) {\n this.endHandler = function autoDestroy () {\n destroy(this)\n }\n this.body.on('end', this.endHandler)\n }\n\n this.errorHandler = err => {\n if (this.abort) {\n this.abort(err)\n } else {\n this.error = err\n }\n }\n this.body.on('error', this.errorHandler)\n } else if (isBuffer(body)) {\n this.body = body.byteLength ? body : null\n } else if (ArrayBuffer.isView(body)) {\n this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null\n } else if (body instanceof ArrayBuffer) {\n this.body = body.byteLength ? Buffer.from(body) : null\n } else if (typeof body === 'string') {\n this.body = body.length ? Buffer.from(body) : null\n } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {\n this.body = body\n } else {\n throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')\n }\n\n this.completed = false\n\n this.aborted = false\n\n this.upgrade = upgrade || null\n\n this.path = query ? buildURL(path, query) : path\n\n this.origin = origin\n\n this.idempotent = idempotent == null\n ? method === 'HEAD' || method === 'GET'\n : idempotent\n\n this.blocking = blocking == null ? false : blocking\n\n this.reset = reset == null ? null : reset\n\n this.host = null\n\n this.contentLength = null\n\n this.contentType = null\n\n this.headers = []\n\n // Only for H2\n this.expectContinue = expectContinue != null ? expectContinue : false\n\n if (Array.isArray(headers)) {\n if (headers.length % 2 !== 0) {\n throw new InvalidArgumentError('headers array must be even')\n }\n for (let i = 0; i < headers.length; i += 2) {\n processHeader(this, headers[i], headers[i + 1])\n }\n } else if (headers && typeof headers === 'object') {\n if (headers[Symbol.iterator]) {\n for (const header of headers) {\n if (!Array.isArray(header) || header.length !== 2) {\n throw new InvalidArgumentError('headers must be in key-value pair format')\n }\n processHeader(this, header[0], header[1])\n }\n } else {\n const keys = Object.keys(headers)\n for (let i = 0; i < keys.length; ++i) {\n processHeader(this, keys[i], headers[keys[i]])\n }\n }\n } else if (headers != null) {\n throw new InvalidArgumentError('headers must be an object or an array')\n }\n\n validateHandler(handler, method, upgrade)\n\n this.servername = servername || getServerName(this.host)\n\n this[kHandler] = handler\n\n if (channels.create.hasSubscribers) {\n channels.create.publish({ request: this })\n }\n }\n\n onBodySent (chunk) {\n if (this[kHandler].onBodySent) {\n try {\n return this[kHandler].onBodySent(chunk)\n } catch (err) {\n this.abort(err)\n }\n }\n }\n\n onRequestSent () {\n if (channels.bodySent.hasSubscribers) {\n channels.bodySent.publish({ request: this })\n }\n\n if (this[kHandler].onRequestSent) {\n try {\n return this[kHandler].onRequestSent()\n } catch (err) {\n this.abort(err)\n }\n }\n }\n\n onConnect (abort) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (this.error) {\n abort(this.error)\n } else {\n this.abort = abort\n return this[kHandler].onConnect(abort)\n }\n }\n\n onResponseStarted () {\n return this[kHandler].onResponseStarted?.()\n }\n\n onHeaders (statusCode, headers, resume, statusText) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (channels.headers.hasSubscribers) {\n channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n }\n\n try {\n return this[kHandler].onHeaders(statusCode, headers, resume, statusText)\n } catch (err) {\n this.abort(err)\n }\n }\n\n onData (chunk) {\n assert(!this.aborted)\n assert(!this.completed)\n\n try {\n return this[kHandler].onData(chunk)\n } catch (err) {\n this.abort(err)\n return false\n }\n }\n\n onUpgrade (statusCode, headers, socket) {\n assert(!this.aborted)\n assert(!this.completed)\n\n return this[kHandler].onUpgrade(statusCode, headers, socket)\n }\n\n onComplete (trailers) {\n this.onFinally()\n\n assert(!this.aborted)\n\n this.completed = true\n if (channels.trailers.hasSubscribers) {\n channels.trailers.publish({ request: this, trailers })\n }\n\n try {\n return this[kHandler].onComplete(trailers)\n } catch (err) {\n // TODO (fix): This might be a bad idea?\n this.onError(err)\n }\n }\n\n onError (error) {\n this.onFinally()\n\n if (channels.error.hasSubscribers) {\n channels.error.publish({ request: this, error })\n }\n\n if (this.aborted) {\n return\n }\n this.aborted = true\n\n return this[kHandler].onError(error)\n }\n\n onFinally () {\n if (this.errorHandler) {\n this.body.off('error', this.errorHandler)\n this.errorHandler = null\n }\n\n if (this.endHandler) {\n this.body.off('end', this.endHandler)\n this.endHandler = null\n }\n }\n\n addHeader (key, value) {\n processHeader(this, key, value)\n return this\n }\n}\n\nfunction processHeader (request, key, val) {\n if (val && (typeof val === 'object' && !Array.isArray(val))) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n } else if (val === undefined) {\n return\n }\n\n let headerName = headerNameLowerCasedRecord[key]\n\n if (headerName === undefined) {\n headerName = key.toLowerCase()\n if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {\n throw new InvalidArgumentError('invalid header key')\n }\n }\n\n if (Array.isArray(val)) {\n const arr = []\n for (let i = 0; i < val.length; i++) {\n if (typeof val[i] === 'string') {\n if (!isValidHeaderValue(val[i])) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n arr.push(val[i])\n } else if (val[i] === null) {\n arr.push('')\n } else if (typeof val[i] === 'object') {\n throw new InvalidArgumentError(`invalid ${key} header`)\n } else {\n arr.push(`${val[i]}`)\n }\n }\n val = arr\n } else if (typeof val === 'string') {\n if (!isValidHeaderValue(val)) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n } else if (val === null) {\n val = ''\n } else {\n val = `${val}`\n }\n\n if (headerName === 'host') {\n if (request.host !== null) {\n throw new InvalidArgumentError('duplicate host header')\n }\n if (typeof val !== 'string') {\n throw new InvalidArgumentError('invalid host header')\n }\n // Consumed by Client\n request.host = val\n } else if (headerName === 'content-length') {\n if (request.contentLength !== null) {\n throw new InvalidArgumentError('duplicate content-length header')\n }\n request.contentLength = parseInt(val, 10)\n if (!Number.isFinite(request.contentLength)) {\n throw new InvalidArgumentError('invalid content-length header')\n }\n } else if (request.contentType === null && headerName === 'content-type') {\n request.contentType = val\n request.headers.push(key, val)\n } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {\n throw new InvalidArgumentError(`invalid ${headerName} header`)\n } else if (headerName === 'connection') {\n const value = typeof val === 'string' ? val.toLowerCase() : null\n if (value !== 'close' && value !== 'keep-alive') {\n throw new InvalidArgumentError('invalid connection header')\n }\n\n if (value === 'close') {\n request.reset = true\n }\n } else if (headerName === 'expect') {\n throw new NotSupportedError('expect header not supported')\n } else {\n request.headers.push(key, val)\n }\n}\n\nmodule.exports = Request\n","module.exports = {\n kClose: Symbol('close'),\n kDestroy: Symbol('destroy'),\n kDispatch: Symbol('dispatch'),\n kUrl: Symbol('url'),\n kWriting: Symbol('writing'),\n kResuming: Symbol('resuming'),\n kQueue: Symbol('queue'),\n kConnect: Symbol('connect'),\n kConnecting: Symbol('connecting'),\n kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),\n kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),\n kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),\n kKeepAliveTimeoutValue: Symbol('keep alive timeout'),\n kKeepAlive: Symbol('keep alive'),\n kHeadersTimeout: Symbol('headers timeout'),\n kBodyTimeout: Symbol('body timeout'),\n kServerName: Symbol('server name'),\n kLocalAddress: Symbol('local address'),\n kHost: Symbol('host'),\n kNoRef: Symbol('no ref'),\n kBodyUsed: Symbol('used'),\n kBody: Symbol('abstracted request body'),\n kRunning: Symbol('running'),\n kBlocking: Symbol('blocking'),\n kPending: Symbol('pending'),\n kSize: Symbol('size'),\n kBusy: Symbol('busy'),\n kQueued: Symbol('queued'),\n kFree: Symbol('free'),\n kConnected: Symbol('connected'),\n kClosed: Symbol('closed'),\n kNeedDrain: Symbol('need drain'),\n kReset: Symbol('reset'),\n kDestroyed: Symbol.for('nodejs.stream.destroyed'),\n kResume: Symbol('resume'),\n kOnError: Symbol('on error'),\n kMaxHeadersSize: Symbol('max headers size'),\n kRunningIdx: Symbol('running index'),\n kPendingIdx: Symbol('pending index'),\n kError: Symbol('error'),\n kClients: Symbol('clients'),\n kClient: Symbol('client'),\n kParser: Symbol('parser'),\n kOnDestroyed: Symbol('destroy callbacks'),\n kPipelining: Symbol('pipelining'),\n kSocket: Symbol('socket'),\n kHostHeader: Symbol('host header'),\n kConnector: Symbol('connector'),\n kStrictContentLength: Symbol('strict content length'),\n kMaxRedirections: Symbol('maxRedirections'),\n kMaxRequests: Symbol('maxRequestsPerClient'),\n kProxy: Symbol('proxy agent options'),\n kCounter: Symbol('socket request counter'),\n kInterceptors: Symbol('dispatch interceptors'),\n kMaxResponseSize: Symbol('max response size'),\n kHTTP2Session: Symbol('http2Session'),\n kHTTP2SessionState: Symbol('http2Session state'),\n kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),\n kConstruct: Symbol('constructable'),\n kListeners: Symbol('listeners'),\n kHTTPContext: Symbol('http context'),\n kMaxConcurrentStreams: Symbol('max concurrent streams'),\n kNoProxyAgent: Symbol('no proxy agent'),\n kHttpProxyAgent: Symbol('http proxy agent'),\n kHttpsProxyAgent: Symbol('https proxy agent')\n}\n","'use strict'\n\nconst {\n wellknownHeaderNames,\n headerNameLowerCasedRecord\n} = require('./constants')\n\nclass TstNode {\n /** @type {any} */\n value = null\n /** @type {null | TstNode} */\n left = null\n /** @type {null | TstNode} */\n middle = null\n /** @type {null | TstNode} */\n right = null\n /** @type {number} */\n code\n /**\n * @param {string} key\n * @param {any} value\n * @param {number} index\n */\n constructor (key, value, index) {\n if (index === undefined || index >= key.length) {\n throw new TypeError('Unreachable')\n }\n const code = this.code = key.charCodeAt(index)\n // check code is ascii string\n if (code > 0x7F) {\n throw new TypeError('key must be ascii string')\n }\n if (key.length !== ++index) {\n this.middle = new TstNode(key, value, index)\n } else {\n this.value = value\n }\n }\n\n /**\n * @param {string} key\n * @param {any} value\n */\n add (key, value) {\n const length = key.length\n if (length === 0) {\n throw new TypeError('Unreachable')\n }\n let index = 0\n let node = this\n while (true) {\n const code = key.charCodeAt(index)\n // check code is ascii string\n if (code > 0x7F) {\n throw new TypeError('key must be ascii string')\n }\n if (node.code === code) {\n if (length === ++index) {\n node.value = value\n break\n } else if (node.middle !== null) {\n node = node.middle\n } else {\n node.middle = new TstNode(key, value, index)\n break\n }\n } else if (node.code < code) {\n if (node.left !== null) {\n node = node.left\n } else {\n node.left = new TstNode(key, value, index)\n break\n }\n } else if (node.right !== null) {\n node = node.right\n } else {\n node.right = new TstNode(key, value, index)\n break\n }\n }\n }\n\n /**\n * @param {Uint8Array} key\n * @return {TstNode | null}\n */\n search (key) {\n const keylength = key.length\n let index = 0\n let node = this\n while (node !== null && index < keylength) {\n let code = key[index]\n // A-Z\n // First check if it is bigger than 0x5a.\n // Lowercase letters have higher char codes than uppercase ones.\n // Also we assume that headers will mostly contain lowercase characters.\n if (code <= 0x5a && code >= 0x41) {\n // Lowercase for uppercase.\n code |= 32\n }\n while (node !== null) {\n if (code === node.code) {\n if (keylength === ++index) {\n // Returns Node since it is the last key.\n return node\n }\n node = node.middle\n break\n }\n node = node.code < code ? node.left : node.right\n }\n }\n return null\n }\n}\n\nclass TernarySearchTree {\n /** @type {TstNode | null} */\n node = null\n\n /**\n * @param {string} key\n * @param {any} value\n * */\n insert (key, value) {\n if (this.node === null) {\n this.node = new TstNode(key, value, 0)\n } else {\n this.node.add(key, value)\n }\n }\n\n /**\n * @param {Uint8Array} key\n * @return {any}\n */\n lookup (key) {\n return this.node?.search(key)?.value ?? null\n }\n}\n\nconst tree = new TernarySearchTree()\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]\n tree.insert(key, key)\n}\n\nmodule.exports = {\n TernarySearchTree,\n tree\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')\nconst { IncomingMessage } = require('node:http')\nconst stream = require('node:stream')\nconst net = require('node:net')\nconst { Blob } = require('node:buffer')\nconst nodeUtil = require('node:util')\nconst { stringify } = require('node:querystring')\nconst { EventEmitter: EE } = require('node:events')\nconst { InvalidArgumentError } = require('./errors')\nconst { headerNameLowerCasedRecord } = require('./constants')\nconst { tree } = require('./tree')\n\nconst [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))\n\nclass BodyAsyncIterable {\n constructor (body) {\n this[kBody] = body\n this[kBodyUsed] = false\n }\n\n async * [Symbol.asyncIterator] () {\n assert(!this[kBodyUsed], 'disturbed')\n this[kBodyUsed] = true\n yield * this[kBody]\n }\n}\n\nfunction wrapRequestBody (body) {\n if (isStream(body)) {\n // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n // so that it can be dispatched again?\n // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n if (bodyLength(body) === 0) {\n body\n .on('data', function () {\n assert(false)\n })\n }\n\n if (typeof body.readableDidRead !== 'boolean') {\n body[kBodyUsed] = false\n EE.prototype.on.call(body, 'data', function () {\n this[kBodyUsed] = true\n })\n }\n\n return body\n } else if (body && typeof body.pipeTo === 'function') {\n // TODO (fix): We can't access ReadableStream internal state\n // to determine whether or not it has been disturbed. This is just\n // a workaround.\n return new BodyAsyncIterable(body)\n } else if (\n body &&\n typeof body !== 'string' &&\n !ArrayBuffer.isView(body) &&\n isIterable(body)\n ) {\n // TODO: Should we allow re-using iterable if !this.opts.idempotent\n // or through some other flag?\n return new BodyAsyncIterable(body)\n } else {\n return body\n }\n}\n\nfunction nop () {}\n\nfunction isStream (obj) {\n return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'\n}\n\n// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)\nfunction isBlobLike (object) {\n if (object === null) {\n return false\n } else if (object instanceof Blob) {\n return true\n } else if (typeof object !== 'object') {\n return false\n } else {\n const sTag = object[Symbol.toStringTag]\n\n return (sTag === 'Blob' || sTag === 'File') && (\n ('stream' in object && typeof object.stream === 'function') ||\n ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')\n )\n }\n}\n\nfunction buildURL (url, queryParams) {\n if (url.includes('?') || url.includes('#')) {\n throw new Error('Query params cannot be passed when url already contains \"?\" or \"#\".')\n }\n\n const stringified = stringify(queryParams)\n\n if (stringified) {\n url += '?' + stringified\n }\n\n return url\n}\n\nfunction isValidPort (port) {\n const value = parseInt(port, 10)\n return (\n value === Number(port) &&\n value >= 0 &&\n value <= 65535\n )\n}\n\nfunction isHttpOrHttpsPrefixed (value) {\n return (\n value != null &&\n value[0] === 'h' &&\n value[1] === 't' &&\n value[2] === 't' &&\n value[3] === 'p' &&\n (\n value[4] === ':' ||\n (\n value[4] === 's' &&\n value[5] === ':'\n )\n )\n )\n}\n\nfunction parseURL (url) {\n if (typeof url === 'string') {\n url = new URL(url)\n\n if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n return url\n }\n\n if (!url || typeof url !== 'object') {\n throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')\n }\n\n if (!(url instanceof URL)) {\n if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {\n throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')\n }\n\n if (url.path != null && typeof url.path !== 'string') {\n throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')\n }\n\n if (url.pathname != null && typeof url.pathname !== 'string') {\n throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')\n }\n\n if (url.hostname != null && typeof url.hostname !== 'string') {\n throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')\n }\n\n if (url.origin != null && typeof url.origin !== 'string') {\n throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')\n }\n\n if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n const port = url.port != null\n ? url.port\n : (url.protocol === 'https:' ? 443 : 80)\n let origin = url.origin != null\n ? url.origin\n : `${url.protocol || ''}//${url.hostname || ''}:${port}`\n let path = url.path != null\n ? url.path\n : `${url.pathname || ''}${url.search || ''}`\n\n if (origin[origin.length - 1] === '/') {\n origin = origin.slice(0, origin.length - 1)\n }\n\n if (path && path[0] !== '/') {\n path = `/${path}`\n }\n // new URL(path, origin) is unsafe when `path` contains an absolute URL\n // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:\n // If first parameter is a relative URL, second param is required, and will be used as the base URL.\n // If first parameter is an absolute URL, a given second param will be ignored.\n return new URL(`${origin}${path}`)\n }\n\n if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n return url\n}\n\nfunction parseOrigin (url) {\n url = parseURL(url)\n\n if (url.pathname !== '/' || url.search || url.hash) {\n throw new InvalidArgumentError('invalid url')\n }\n\n return url\n}\n\nfunction getHostname (host) {\n if (host[0] === '[') {\n const idx = host.indexOf(']')\n\n assert(idx !== -1)\n return host.substring(1, idx)\n }\n\n const idx = host.indexOf(':')\n if (idx === -1) return host\n\n return host.substring(0, idx)\n}\n\n// IP addresses are not valid server names per RFC6066\n// > Currently, the only server names supported are DNS hostnames\nfunction getServerName (host) {\n if (!host) {\n return null\n }\n\n assert(typeof host === 'string')\n\n const servername = getHostname(host)\n if (net.isIP(servername)) {\n return ''\n }\n\n return servername\n}\n\nfunction deepClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}\n\nfunction isAsyncIterable (obj) {\n return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')\n}\n\nfunction isIterable (obj) {\n return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))\n}\n\nfunction bodyLength (body) {\n if (body == null) {\n return 0\n } else if (isStream(body)) {\n const state = body._readableState\n return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)\n ? state.length\n : null\n } else if (isBlobLike(body)) {\n return body.size != null ? body.size : null\n } else if (isBuffer(body)) {\n return body.byteLength\n }\n\n return null\n}\n\nfunction isDestroyed (body) {\n return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))\n}\n\nfunction destroy (stream, err) {\n if (stream == null || !isStream(stream) || isDestroyed(stream)) {\n return\n }\n\n if (typeof stream.destroy === 'function') {\n if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {\n // See: https://github.com/nodejs/node/pull/38505/files\n stream.socket = null\n }\n\n stream.destroy(err)\n } else if (err) {\n queueMicrotask(() => {\n stream.emit('error', err)\n })\n }\n\n if (stream.destroyed !== true) {\n stream[kDestroyed] = true\n }\n}\n\nconst KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/\nfunction parseKeepAliveTimeout (val) {\n const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)\n return m ? parseInt(m[1], 10) * 1000 : null\n}\n\n/**\n * Retrieves a header name and returns its lowercase value.\n * @param {string | Buffer} value Header name\n * @returns {string}\n */\nfunction headerNameToString (value) {\n return typeof value === 'string'\n ? headerNameLowerCasedRecord[value] ?? value.toLowerCase()\n : tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * Receive the buffer as a string and return its lowercase value.\n * @param {Buffer} value Header name\n * @returns {string}\n */\nfunction bufferToLowerCasedHeaderName (value) {\n return tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers\n * @param {Record} [obj]\n * @returns {Record}\n */\nfunction parseHeaders (headers, obj) {\n if (obj === undefined) obj = {}\n for (let i = 0; i < headers.length; i += 2) {\n const key = headerNameToString(headers[i])\n let val = obj[key]\n\n if (val) {\n if (typeof val === 'string') {\n val = [val]\n obj[key] = val\n }\n val.push(headers[i + 1].toString('utf8'))\n } else {\n const headersValue = headers[i + 1]\n if (typeof headersValue === 'string') {\n obj[key] = headersValue\n } else {\n obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')\n }\n }\n }\n\n // See https://github.com/nodejs/node/pull/46528\n if ('content-length' in obj && 'content-disposition' in obj) {\n obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')\n }\n\n return obj\n}\n\nfunction parseRawHeaders (headers) {\n const len = headers.length\n const ret = new Array(len)\n\n let hasContentLength = false\n let contentDispositionIdx = -1\n let key\n let val\n let kLen = 0\n\n for (let n = 0; n < headers.length; n += 2) {\n key = headers[n]\n val = headers[n + 1]\n\n typeof key !== 'string' && (key = key.toString())\n typeof val !== 'string' && (val = val.toString('utf8'))\n\n kLen = key.length\n if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {\n hasContentLength = true\n } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {\n contentDispositionIdx = n + 1\n }\n ret[n] = key\n ret[n + 1] = val\n }\n\n // See https://github.com/nodejs/node/pull/46528\n if (hasContentLength && contentDispositionIdx !== -1) {\n ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')\n }\n\n return ret\n}\n\nfunction isBuffer (buffer) {\n // See, https://github.com/mcollina/undici/pull/319\n return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)\n}\n\nfunction validateHandler (handler, method, upgrade) {\n if (!handler || typeof handler !== 'object') {\n throw new InvalidArgumentError('handler must be an object')\n }\n\n if (typeof handler.onConnect !== 'function') {\n throw new InvalidArgumentError('invalid onConnect method')\n }\n\n if (typeof handler.onError !== 'function') {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {\n throw new InvalidArgumentError('invalid onBodySent method')\n }\n\n if (upgrade || method === 'CONNECT') {\n if (typeof handler.onUpgrade !== 'function') {\n throw new InvalidArgumentError('invalid onUpgrade method')\n }\n } else {\n if (typeof handler.onHeaders !== 'function') {\n throw new InvalidArgumentError('invalid onHeaders method')\n }\n\n if (typeof handler.onData !== 'function') {\n throw new InvalidArgumentError('invalid onData method')\n }\n\n if (typeof handler.onComplete !== 'function') {\n throw new InvalidArgumentError('invalid onComplete method')\n }\n }\n}\n\n// A body is disturbed if it has been read from and it cannot\n// be re-used without losing state or data.\nfunction isDisturbed (body) {\n // TODO (fix): Why is body[kBodyUsed] needed?\n return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))\n}\n\nfunction isErrored (body) {\n return !!(body && stream.isErrored(body))\n}\n\nfunction isReadable (body) {\n return !!(body && stream.isReadable(body))\n}\n\nfunction getSocketInfo (socket) {\n return {\n localAddress: socket.localAddress,\n localPort: socket.localPort,\n remoteAddress: socket.remoteAddress,\n remotePort: socket.remotePort,\n remoteFamily: socket.remoteFamily,\n timeout: socket.timeout,\n bytesWritten: socket.bytesWritten,\n bytesRead: socket.bytesRead\n }\n}\n\n/** @type {globalThis['ReadableStream']} */\nfunction ReadableStreamFrom (iterable) {\n // We cannot use ReadableStream.from here because it does not return a byte stream.\n\n let iterator\n return new ReadableStream(\n {\n async start () {\n iterator = iterable[Symbol.asyncIterator]()\n },\n async pull (controller) {\n const { done, value } = await iterator.next()\n if (done) {\n queueMicrotask(() => {\n controller.close()\n controller.byobRequest?.respond(0)\n })\n } else {\n const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)\n if (buf.byteLength) {\n controller.enqueue(new Uint8Array(buf))\n }\n }\n return controller.desiredSize > 0\n },\n async cancel (reason) {\n await iterator.return()\n },\n type: 'bytes'\n }\n )\n}\n\n// The chunk should be a FormData instance and contains\n// all the required methods.\nfunction isFormDataLike (object) {\n return (\n object &&\n typeof object === 'object' &&\n typeof object.append === 'function' &&\n typeof object.delete === 'function' &&\n typeof object.get === 'function' &&\n typeof object.getAll === 'function' &&\n typeof object.has === 'function' &&\n typeof object.set === 'function' &&\n object[Symbol.toStringTag] === 'FormData'\n )\n}\n\nfunction addAbortListener (signal, listener) {\n if ('addEventListener' in signal) {\n signal.addEventListener('abort', listener, { once: true })\n return () => signal.removeEventListener('abort', listener)\n }\n signal.addListener('abort', listener)\n return () => signal.removeListener('abort', listener)\n}\n\nconst hasToWellFormed = typeof String.prototype.toWellFormed === 'function'\nconst hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'\n\n/**\n * @param {string} val\n */\nfunction toUSVString (val) {\n return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)\n}\n\n/**\n * @param {string} val\n */\n// TODO: move this to webidl\nfunction isUSVString (val) {\n return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`\n}\n\n/**\n * @see https://tools.ietf.org/html/rfc7230#section-3.2.6\n * @param {number} c\n */\nfunction isTokenCharCode (c) {\n switch (c) {\n case 0x22:\n case 0x28:\n case 0x29:\n case 0x2c:\n case 0x2f:\n case 0x3a:\n case 0x3b:\n case 0x3c:\n case 0x3d:\n case 0x3e:\n case 0x3f:\n case 0x40:\n case 0x5b:\n case 0x5c:\n case 0x5d:\n case 0x7b:\n case 0x7d:\n // DQUOTE and \"(),/:;<=>?@[\\]{}\"\n return false\n default:\n // VCHAR %x21-7E\n return c >= 0x21 && c <= 0x7e\n }\n}\n\n/**\n * @param {string} characters\n */\nfunction isValidHTTPToken (characters) {\n if (characters.length === 0) {\n return false\n }\n for (let i = 0; i < characters.length; ++i) {\n if (!isTokenCharCode(characters.charCodeAt(i))) {\n return false\n }\n }\n return true\n}\n\n// headerCharRegex have been lifted from\n// https://github.com/nodejs/node/blob/main/lib/_http_common.js\n\n/**\n * Matches if val contains an invalid field-vchar\n * field-value = *( field-content / obs-fold )\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n */\nconst headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/\n\n/**\n * @param {string} characters\n */\nfunction isValidHeaderValue (characters) {\n return !headerCharRegex.test(characters)\n}\n\n// Parsed accordingly to RFC 9110\n// https://www.rfc-editor.org/rfc/rfc9110#field.content-range\nfunction parseRangeHeader (range) {\n if (range == null || range === '') return { start: 0, end: null, size: null }\n\n const m = range ? range.match(/^bytes (\\d+)-(\\d+)\\/(\\d+)?$/) : null\n return m\n ? {\n start: parseInt(m[1]),\n end: m[2] ? parseInt(m[2]) : null,\n size: m[3] ? parseInt(m[3]) : null\n }\n : null\n}\n\nfunction addListener (obj, name, listener) {\n const listeners = (obj[kListeners] ??= [])\n listeners.push([name, listener])\n obj.on(name, listener)\n return obj\n}\n\nfunction removeAllListeners (obj) {\n for (const [name, listener] of obj[kListeners] ?? []) {\n obj.removeListener(name, listener)\n }\n obj[kListeners] = null\n}\n\nfunction errorRequest (client, request, err) {\n try {\n request.onError(err)\n assert(request.aborted)\n } catch (err) {\n client.emit('error', err)\n }\n}\n\nconst kEnumerableProperty = Object.create(null)\nkEnumerableProperty.enumerable = true\n\nconst normalizedMethodRecordsBase = {\n delete: 'DELETE',\n DELETE: 'DELETE',\n get: 'GET',\n GET: 'GET',\n head: 'HEAD',\n HEAD: 'HEAD',\n options: 'OPTIONS',\n OPTIONS: 'OPTIONS',\n post: 'POST',\n POST: 'POST',\n put: 'PUT',\n PUT: 'PUT'\n}\n\nconst normalizedMethodRecords = {\n ...normalizedMethodRecordsBase,\n patch: 'patch',\n PATCH: 'PATCH'\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(normalizedMethodRecordsBase, null)\nObject.setPrototypeOf(normalizedMethodRecords, null)\n\nmodule.exports = {\n kEnumerableProperty,\n nop,\n isDisturbed,\n isErrored,\n isReadable,\n toUSVString,\n isUSVString,\n isBlobLike,\n parseOrigin,\n parseURL,\n getServerName,\n isStream,\n isIterable,\n isAsyncIterable,\n isDestroyed,\n headerNameToString,\n bufferToLowerCasedHeaderName,\n addListener,\n removeAllListeners,\n errorRequest,\n parseRawHeaders,\n parseHeaders,\n parseKeepAliveTimeout,\n destroy,\n bodyLength,\n deepClone,\n ReadableStreamFrom,\n isBuffer,\n validateHandler,\n getSocketInfo,\n isFormDataLike,\n buildURL,\n addAbortListener,\n isValidHTTPToken,\n isValidHeaderValue,\n isTokenCharCode,\n parseRangeHeader,\n normalizedMethodRecordsBase,\n normalizedMethodRecords,\n isValidPort,\n isHttpOrHttpsPrefixed,\n nodeMajor,\n nodeMinor,\n safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],\n wrapRequestBody\n}\n","'use strict'\n\nconst { InvalidArgumentError } = require('../core/errors')\nconst { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst DispatcherBase = require('./dispatcher-base')\nconst Pool = require('./pool')\nconst Client = require('./client')\nconst util = require('../core/util')\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor')\n\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kMaxRedirections = Symbol('maxRedirections')\nconst kOnDrain = Symbol('onDrain')\nconst kFactory = Symbol('factory')\nconst kOptions = Symbol('options')\n\nfunction defaultFactory (origin, opts) {\n return opts && opts.connections === 1\n ? new Client(origin, opts)\n : new Pool(origin, opts)\n}\n\nclass Agent extends DispatcherBase {\n constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n super(options)\n\n if (connect && typeof connect !== 'function') {\n connect = { ...connect }\n }\n\n this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)\n ? options.interceptors.Agent\n : [createRedirectInterceptor({ maxRedirections })]\n\n this[kOptions] = { ...util.deepClone(options), connect }\n this[kOptions].interceptors = options.interceptors\n ? { ...options.interceptors }\n : undefined\n this[kMaxRedirections] = maxRedirections\n this[kFactory] = factory\n this[kClients] = new Map()\n\n this[kOnDrain] = (origin, targets) => {\n this.emit('drain', origin, [this, ...targets])\n }\n\n this[kOnConnect] = (origin, targets) => {\n this.emit('connect', origin, [this, ...targets])\n }\n\n this[kOnDisconnect] = (origin, targets, err) => {\n this.emit('disconnect', origin, [this, ...targets], err)\n }\n\n this[kOnConnectionError] = (origin, targets, err) => {\n this.emit('connectionError', origin, [this, ...targets], err)\n }\n }\n\n get [kRunning] () {\n let ret = 0\n for (const client of this[kClients].values()) {\n ret += client[kRunning]\n }\n return ret\n }\n\n [kDispatch] (opts, handler) {\n let key\n if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {\n key = String(opts.origin)\n } else {\n throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')\n }\n\n let dispatcher = this[kClients].get(key)\n\n if (!dispatcher) {\n dispatcher = this[kFactory](opts.origin, this[kOptions])\n .on('drain', this[kOnDrain])\n .on('connect', this[kOnConnect])\n .on('disconnect', this[kOnDisconnect])\n .on('connectionError', this[kOnConnectionError])\n\n // This introduces a tiny memory leak, as dispatchers are never removed from the map.\n // TODO(mcollina): remove te timer when the client/pool do not have any more\n // active connections.\n this[kClients].set(key, dispatcher)\n }\n\n return dispatcher.dispatch(opts, handler)\n }\n\n async [kClose] () {\n const closePromises = []\n for (const client of this[kClients].values()) {\n closePromises.push(client.close())\n }\n this[kClients].clear()\n\n await Promise.all(closePromises)\n }\n\n async [kDestroy] (err) {\n const destroyPromises = []\n for (const client of this[kClients].values()) {\n destroyPromises.push(client.destroy(err))\n }\n this[kClients].clear()\n\n await Promise.all(destroyPromises)\n }\n}\n\nmodule.exports = Agent\n","'use strict'\n\nconst {\n BalancedPoolMissingUpstreamError,\n InvalidArgumentError\n} = require('../core/errors')\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kRemoveClient,\n kGetDispatcher\n} = require('./pool-base')\nconst Pool = require('./pool')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst { parseOrigin } = require('../core/util')\nconst kFactory = Symbol('factory')\n\nconst kOptions = Symbol('options')\nconst kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')\nconst kCurrentWeight = Symbol('kCurrentWeight')\nconst kIndex = Symbol('kIndex')\nconst kWeight = Symbol('kWeight')\nconst kMaxWeightPerServer = Symbol('kMaxWeightPerServer')\nconst kErrorPenalty = Symbol('kErrorPenalty')\n\n/**\n * Calculate the greatest common divisor of two numbers by\n * using the Euclidean algorithm.\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction getGreatestCommonDivisor (a, b) {\n if (a === 0) return b\n\n while (b !== 0) {\n const t = b\n b = a % b\n a = t\n }\n return a\n}\n\nfunction defaultFactory (origin, opts) {\n return new Pool(origin, opts)\n}\n\nclass BalancedPool extends PoolBase {\n constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {\n super()\n\n this[kOptions] = opts\n this[kIndex] = -1\n this[kCurrentWeight] = 0\n\n this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100\n this[kErrorPenalty] = this[kOptions].errorPenalty || 15\n\n if (!Array.isArray(upstreams)) {\n upstreams = [upstreams]\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)\n ? opts.interceptors.BalancedPool\n : []\n this[kFactory] = factory\n\n for (const upstream of upstreams) {\n this.addUpstream(upstream)\n }\n this._updateBalancedPoolStats()\n }\n\n addUpstream (upstream) {\n const upstreamOrigin = parseOrigin(upstream).origin\n\n if (this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))) {\n return this\n }\n const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))\n\n this[kAddClient](pool)\n pool.on('connect', () => {\n pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])\n })\n\n pool.on('connectionError', () => {\n pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n this._updateBalancedPoolStats()\n })\n\n pool.on('disconnect', (...args) => {\n const err = args[2]\n if (err && err.code === 'UND_ERR_SOCKET') {\n // decrease the weight of the pool.\n pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n this._updateBalancedPoolStats()\n }\n })\n\n for (const client of this[kClients]) {\n client[kWeight] = this[kMaxWeightPerServer]\n }\n\n this._updateBalancedPoolStats()\n\n return this\n }\n\n _updateBalancedPoolStats () {\n let result = 0\n for (let i = 0; i < this[kClients].length; i++) {\n result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)\n }\n\n this[kGreatestCommonDivisor] = result\n }\n\n removeUpstream (upstream) {\n const upstreamOrigin = parseOrigin(upstream).origin\n\n const pool = this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))\n\n if (pool) {\n this[kRemoveClient](pool)\n }\n\n return this\n }\n\n get upstreams () {\n return this[kClients]\n .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)\n .map((p) => p[kUrl].origin)\n }\n\n [kGetDispatcher] () {\n // We validate that pools is greater than 0,\n // otherwise we would have to wait until an upstream\n // is added, which might never happen.\n if (this[kClients].length === 0) {\n throw new BalancedPoolMissingUpstreamError()\n }\n\n const dispatcher = this[kClients].find(dispatcher => (\n !dispatcher[kNeedDrain] &&\n dispatcher.closed !== true &&\n dispatcher.destroyed !== true\n ))\n\n if (!dispatcher) {\n return\n }\n\n const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)\n\n if (allClientsBusy) {\n return\n }\n\n let counter = 0\n\n let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])\n\n while (counter++ < this[kClients].length) {\n this[kIndex] = (this[kIndex] + 1) % this[kClients].length\n const pool = this[kClients][this[kIndex]]\n\n // find pool index with the largest weight\n if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {\n maxWeightIndex = this[kIndex]\n }\n\n // decrease the current weight every `this[kClients].length`.\n if (this[kIndex] === 0) {\n // Set the current weight to the next lower weight.\n this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]\n\n if (this[kCurrentWeight] <= 0) {\n this[kCurrentWeight] = this[kMaxWeightPerServer]\n }\n }\n if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {\n return pool\n }\n }\n\n this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]\n this[kIndex] = maxWeightIndex\n return this[kClients][maxWeightIndex]\n }\n}\n\nmodule.exports = BalancedPool\n","'use strict'\n\n/* global WebAssembly */\n\nconst assert = require('node:assert')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst timers = require('../util/timers.js')\nconst {\n RequestContentLengthMismatchError,\n ResponseContentLengthMismatchError,\n RequestAbortedError,\n HeadersTimeoutError,\n HeadersOverflowError,\n SocketError,\n InformationalError,\n BodyTimeoutError,\n HTTPParserError,\n ResponseExceededMaxSizeError\n} = require('../core/errors.js')\nconst {\n kUrl,\n kReset,\n kClient,\n kParser,\n kBlocking,\n kRunning,\n kPending,\n kSize,\n kWriting,\n kQueue,\n kNoRef,\n kKeepAliveDefaultTimeout,\n kHostHeader,\n kPendingIdx,\n kRunningIdx,\n kError,\n kPipelining,\n kSocket,\n kKeepAliveTimeoutValue,\n kMaxHeadersSize,\n kKeepAliveMaxTimeout,\n kKeepAliveTimeoutThreshold,\n kHeadersTimeout,\n kBodyTimeout,\n kStrictContentLength,\n kMaxRequests,\n kCounter,\n kMaxResponseSize,\n kOnError,\n kResume,\n kHTTPContext\n} = require('../core/symbols.js')\n\nconst constants = require('../llhttp/constants.js')\nconst EMPTY_BUF = Buffer.alloc(0)\nconst FastBuffer = Buffer[Symbol.species]\nconst addListener = util.addListener\nconst removeAllListeners = util.removeAllListeners\nconst kIdleSocketValidation = Symbol('kIdleSocketValidation')\nconst kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout')\nconst kSocketUsed = Symbol('kSocketUsed')\n\nlet extractBody\n\nasync function lazyllhttp () {\n const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined\n\n let mod\n try {\n mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js'))\n } catch (e) {\n /* istanbul ignore next */\n\n // We could check if the error was caused by the simd option not\n // being enabled, but the occurring of this other error\n // * https://github.com/emscripten-core/emscripten/issues/11495\n // got me to remove that check to avoid breaking Node 12.\n mod = await WebAssembly.compile(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))\n }\n\n return await WebAssembly.instantiate(mod, {\n env: {\n /* eslint-disable camelcase */\n\n wasm_on_url: (p, at, len) => {\n /* istanbul ignore next */\n return 0\n },\n wasm_on_status: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_message_begin: (p) => {\n assert(currentParser.ptr === p)\n return currentParser.onMessageBegin() || 0\n },\n wasm_on_header_field: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_header_value: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n assert(currentParser.ptr === p)\n return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0\n },\n wasm_on_body: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_message_complete: (p) => {\n assert(currentParser.ptr === p)\n return currentParser.onMessageComplete() || 0\n }\n\n /* eslint-enable camelcase */\n }\n })\n}\n\nlet llhttpInstance = null\nlet llhttpPromise = lazyllhttp()\nllhttpPromise.catch()\n\nlet currentParser = null\nlet currentBufferRef = null\nlet currentBufferSize = 0\nlet currentBufferPtr = null\n\nconst USE_NATIVE_TIMER = 0\nconst USE_FAST_TIMER = 1\n\n// Use fast timers for headers and body to take eventual event loop\n// latency into account.\nconst TIMEOUT_HEADERS = 2 | USE_FAST_TIMER\nconst TIMEOUT_BODY = 4 | USE_FAST_TIMER\n\n// Use native timers to ignore event loop latency for keep-alive\n// handling.\nconst TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER\n\nclass Parser {\n constructor (client, socket, { exports }) {\n assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)\n\n this.llhttp = exports\n this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)\n this.client = client\n this.socket = socket\n this.timeout = null\n this.timeoutValue = null\n this.timeoutType = null\n this.statusCode = null\n this.statusText = ''\n this.upgrade = false\n this.headers = []\n this.headersSize = 0\n this.headersMaxSize = client[kMaxHeadersSize]\n this.shouldKeepAlive = false\n this.paused = false\n this.resume = this.resume.bind(this)\n\n this.bytesRead = 0\n\n this.keepAlive = ''\n this.contentLength = ''\n this.connection = ''\n this.maxResponseSize = client[kMaxResponseSize]\n }\n\n setTimeout (delay, type) {\n // If the existing timer and the new timer are of different timer type\n // (fast or native) or have different delay, we need to clear the existing\n // timer and set a new one.\n if (\n delay !== this.timeoutValue ||\n (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)\n ) {\n // If a timeout is already set, clear it with clearTimeout of the fast\n // timer implementation, as it can clear fast and native timers.\n if (this.timeout) {\n timers.clearTimeout(this.timeout)\n this.timeout = null\n }\n\n if (delay) {\n if (type & USE_FAST_TIMER) {\n this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this))\n } else {\n this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this))\n this.timeout.unref()\n }\n }\n\n this.timeoutValue = delay\n } else if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n this.timeoutType = type\n }\n\n resume () {\n if (this.socket.destroyed || !this.paused) {\n return\n }\n\n assert(this.ptr != null)\n assert(currentParser == null)\n\n this.llhttp.llhttp_resume(this.ptr)\n\n assert(this.timeoutType === TIMEOUT_BODY)\n if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n this.paused = false\n this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.\n this.readMore()\n }\n\n readMore () {\n while (!this.paused && this.ptr) {\n const chunk = this.socket.read()\n if (chunk === null) {\n break\n }\n this.execute(chunk)\n }\n }\n\n execute (data) {\n assert(this.ptr != null)\n assert(currentParser == null)\n assert(!this.paused)\n\n const { socket, llhttp } = this\n\n if (data.length > currentBufferSize) {\n if (currentBufferPtr) {\n llhttp.free(currentBufferPtr)\n }\n currentBufferSize = Math.ceil(data.length / 4096) * 4096\n currentBufferPtr = llhttp.malloc(currentBufferSize)\n }\n\n new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)\n\n // Call `execute` on the wasm parser.\n // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,\n // and finally the length of bytes to parse.\n // The return value is an error code or `constants.ERROR.OK`.\n try {\n let ret\n\n try {\n currentBufferRef = data\n currentParser = this\n ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)\n /* eslint-disable-next-line no-useless-catch */\n } catch (err) {\n /* istanbul ignore next: difficult to make a test case for */\n throw err\n } finally {\n currentParser = null\n currentBufferRef = null\n }\n\n const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr\n\n if (ret !== constants.ERROR.OK) {\n const body = data.subarray(offset)\n\n if (ret === constants.ERROR.PAUSED_UPGRADE) {\n this.onUpgrade(body)\n } else if (ret === constants.ERROR.PAUSED) {\n this.paused = true\n socket.unshift(body)\n } else {\n throw this.createError(ret, body)\n }\n }\n } catch (err) {\n util.destroy(socket, err)\n }\n }\n\n finish () {\n assert(currentParser === null)\n assert(this.ptr != null)\n assert(!this.paused)\n\n const { llhttp } = this\n\n let ret\n\n try {\n currentParser = this\n ret = llhttp.llhttp_finish(this.ptr)\n } finally {\n currentParser = null\n }\n\n if (ret === constants.ERROR.OK) {\n return null\n }\n\n if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {\n this.paused = true\n return null\n }\n\n return this.createError(ret, EMPTY_BUF)\n }\n\n createError (ret, data) {\n const { llhttp, contentLength, bytesRead } = this\n\n if (contentLength && bytesRead !== parseInt(contentLength, 10)) {\n return new ResponseContentLengthMismatchError()\n }\n\n const ptr = llhttp.llhttp_get_error_reason(this.ptr)\n let message = ''\n if (ptr) {\n const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)\n message =\n 'Response does not match the HTTP/1.1 protocol (' +\n Buffer.from(llhttp.memory.buffer, ptr, len).toString() +\n ')'\n }\n\n return new HTTPParserError(message, constants.ERROR[ret], data)\n }\n\n destroy () {\n assert(this.ptr != null)\n assert(currentParser == null)\n\n this.llhttp.llhttp_free(this.ptr)\n this.ptr = null\n\n this.timeout && timers.clearTimeout(this.timeout)\n this.timeout = null\n this.timeoutValue = null\n this.timeoutType = null\n\n this.paused = false\n }\n\n onStatus (buf) {\n this.statusText = buf.toString()\n }\n\n onMessageBegin () {\n const { socket, client } = this\n\n /* istanbul ignore next: difficult to make a test case for */\n if (socket.destroyed) {\n return -1\n }\n\n if (client[kRunning] === 0) {\n util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n if (!request) {\n return -1\n }\n request.onResponseStarted()\n }\n\n onHeaderField (buf) {\n const len = this.headers.length\n\n if ((len & 1) === 0) {\n this.headers.push(buf)\n } else {\n this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n }\n\n this.trackHeader(buf.length)\n }\n\n onHeaderValue (buf) {\n let len = this.headers.length\n\n if ((len & 1) === 1) {\n this.headers.push(buf)\n len += 1\n } else {\n this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n }\n\n const key = this.headers[len - 2]\n if (key.length === 10) {\n const headerName = util.bufferToLowerCasedHeaderName(key)\n if (headerName === 'keep-alive') {\n this.keepAlive += buf.toString()\n } else if (headerName === 'connection') {\n this.connection += buf.toString()\n }\n } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {\n this.contentLength += buf.toString()\n }\n\n this.trackHeader(buf.length)\n }\n\n trackHeader (len) {\n this.headersSize += len\n if (this.headersSize >= this.headersMaxSize) {\n util.destroy(this.socket, new HeadersOverflowError())\n }\n }\n\n onUpgrade (head) {\n const { upgrade, client, socket, headers, statusCode } = this\n\n assert(upgrade)\n assert(client[kSocket] === socket)\n assert(!socket.destroyed)\n assert(!this.paused)\n assert((headers.length & 1) === 0)\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n assert(request.upgrade || request.method === 'CONNECT')\n\n this.statusCode = null\n this.statusText = ''\n this.shouldKeepAlive = null\n\n this.headers = []\n this.headersSize = 0\n\n socket.unshift(head)\n\n socket[kParser].destroy()\n socket[kParser] = null\n\n socket[kClient] = null\n socket[kError] = null\n\n removeAllListeners(socket)\n\n client[kSocket] = null\n client[kHTTPContext] = null // TODO (fix): This is hacky...\n client[kQueue][client[kRunningIdx]++] = null\n client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))\n\n try {\n request.onUpgrade(statusCode, headers, socket)\n } catch (err) {\n util.destroy(socket, err)\n }\n\n client[kResume]()\n }\n\n onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {\n const { client, socket, headers, statusText } = this\n\n /* istanbul ignore next: difficult to make a test case for */\n if (socket.destroyed) {\n return -1\n }\n\n if (client[kRunning] === 0) {\n util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n\n /* istanbul ignore next: difficult to make a test case for */\n if (!request) {\n return -1\n }\n\n assert(!this.upgrade)\n assert(this.statusCode < 200)\n\n if (statusCode === 100) {\n util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n return -1\n }\n\n /* this can only happen if server is misbehaving */\n if (upgrade && !request.upgrade) {\n util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))\n return -1\n }\n\n assert(this.timeoutType === TIMEOUT_HEADERS)\n\n this.statusCode = statusCode\n this.shouldKeepAlive = (\n shouldKeepAlive ||\n // Override llhttp value which does not allow keepAlive for HEAD.\n (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')\n )\n\n if (this.statusCode >= 200) {\n const bodyTimeout = request.bodyTimeout != null\n ? request.bodyTimeout\n : client[kBodyTimeout]\n this.setTimeout(bodyTimeout, TIMEOUT_BODY)\n } else if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n if (request.method === 'CONNECT') {\n assert(client[kRunning] === 1)\n this.upgrade = true\n return 2\n }\n\n if (upgrade) {\n assert(client[kRunning] === 1)\n this.upgrade = true\n return 2\n }\n\n assert((this.headers.length & 1) === 0)\n this.headers = []\n this.headersSize = 0\n\n if (this.shouldKeepAlive && client[kPipelining]) {\n const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null\n\n if (keepAliveTimeout != null) {\n const timeout = Math.min(\n keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n client[kKeepAliveMaxTimeout]\n )\n if (timeout <= 0) {\n socket[kReset] = true\n } else {\n client[kKeepAliveTimeoutValue] = timeout\n }\n } else {\n client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]\n }\n } else {\n // Stop more requests from being dispatched.\n socket[kReset] = true\n }\n\n const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false\n\n if (request.aborted) {\n return -1\n }\n\n if (request.method === 'HEAD') {\n return 1\n }\n\n if (statusCode < 200) {\n return 1\n }\n\n if (socket[kBlocking]) {\n socket[kBlocking] = false\n client[kResume]()\n }\n\n return pause ? constants.ERROR.PAUSED : 0\n }\n\n onBody (buf) {\n const { client, socket, statusCode, maxResponseSize } = this\n\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n assert(this.timeoutType === TIMEOUT_BODY)\n if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n assert(statusCode >= 200)\n\n if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n util.destroy(socket, new ResponseExceededMaxSizeError())\n return -1\n }\n\n this.bytesRead += buf.length\n\n if (request.onData(buf) === false) {\n return constants.ERROR.PAUSED\n }\n }\n\n onMessageComplete () {\n const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this\n\n if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n return -1\n }\n\n if (upgrade) {\n return\n }\n\n assert(statusCode >= 100)\n assert((this.headers.length & 1) === 0)\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n this.statusCode = null\n this.statusText = ''\n this.bytesRead = 0\n this.contentLength = ''\n this.keepAlive = ''\n this.connection = ''\n\n this.headers = []\n this.headersSize = 0\n\n if (statusCode < 200) {\n return\n }\n\n /* istanbul ignore next: should be handled by llhttp? */\n if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n util.destroy(socket, new ResponseContentLengthMismatchError())\n return -1\n }\n\n request.onComplete(headers)\n\n client[kQueue][client[kRunningIdx]++] = null\n socket[kSocketUsed] = true\n\n if (socket[kWriting]) {\n assert(client[kRunning] === 0)\n // Response completed before request.\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (!shouldKeepAlive) {\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (socket[kReset] && client[kRunning] === 0) {\n // Destroy socket once all requests have completed.\n // The request at the tail of the pipeline is the one\n // that requested reset and no further requests should\n // have been queued since then.\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (client[kPipelining] == null || client[kPipelining] === 1) {\n // We must wait a full event loop cycle to reuse this socket to make sure\n // that non-spec compliant servers are not closing the connection even if they\n // said they won't.\n setImmediate(() => client[kResume]())\n } else {\n client[kResume]()\n }\n }\n}\n\nfunction onParserTimeout (parser) {\n const { socket, timeoutType, client, paused } = parser.deref()\n\n /* istanbul ignore else */\n if (timeoutType === TIMEOUT_HEADERS) {\n if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n assert(!paused, 'cannot be paused while waiting for headers')\n util.destroy(socket, new HeadersTimeoutError())\n }\n } else if (timeoutType === TIMEOUT_BODY) {\n if (!paused) {\n util.destroy(socket, new BodyTimeoutError())\n }\n } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {\n assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])\n util.destroy(socket, new InformationalError('socket idle timeout'))\n }\n}\n\nasync function connectH1 (client, socket) {\n client[kSocket] = socket\n\n if (!llhttpInstance) {\n llhttpInstance = await llhttpPromise\n llhttpPromise = null\n }\n\n socket[kNoRef] = false\n socket[kWriting] = false\n socket[kReset] = false\n socket[kBlocking] = false\n socket[kIdleSocketValidation] = 0\n socket[kIdleSocketValidationTimeout] = null\n socket[kSocketUsed] = false\n socket[kParser] = new Parser(client, socket, llhttpInstance)\n\n addListener(socket, 'error', function (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n const parser = this[kParser]\n\n // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded\n // to the user.\n if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {\n const parserErr = parser.finish()\n if (parserErr) {\n this[kError] = parserErr\n this[kClient][kOnError](parserErr)\n }\n return\n }\n\n this[kError] = err\n\n this[kClient][kOnError](err)\n })\n addListener(socket, 'readable', function () {\n const parser = this[kParser]\n\n if (parser) {\n parser.readMore()\n }\n })\n addListener(socket, 'end', function () {\n const parser = this[kParser]\n\n if (parser.statusCode && !parser.shouldKeepAlive) {\n const parserErr = parser.finish()\n if (parserErr) {\n util.destroy(this, parserErr)\n }\n return\n }\n\n util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n })\n addListener(socket, 'close', function () {\n const client = this[kClient]\n const parser = this[kParser]\n\n clearIdleSocketValidation(this)\n\n if (parser) {\n if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {\n this[kError] = parser.finish() || this[kError]\n }\n\n this[kParser].destroy()\n this[kParser] = null\n }\n\n const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n client[kSocket] = null\n client[kHTTPContext] = null // TODO (fix): This is hacky...\n\n if (client.destroyed) {\n assert(client[kPending] === 0)\n\n // Fail entire queue.\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n util.errorRequest(client, request, err)\n }\n } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {\n // Fail head of pipeline.\n const request = client[kQueue][client[kRunningIdx]]\n client[kQueue][client[kRunningIdx]++] = null\n\n util.errorRequest(client, request, err)\n }\n\n client[kPendingIdx] = client[kRunningIdx]\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n\n client[kResume]()\n })\n\n let closed = false\n socket.on('close', () => {\n closed = true\n })\n\n return {\n version: 'h1',\n defaultPipelining: 1,\n write (...args) {\n return writeH1(client, ...args)\n },\n resume () {\n resumeH1(client)\n },\n destroy (err, callback) {\n if (closed) {\n queueMicrotask(callback)\n } else {\n socket.destroy(err).on('close', callback)\n }\n },\n get destroyed () {\n return socket.destroyed\n },\n busy (request) {\n if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) {\n return true\n }\n\n if (request) {\n if (client[kRunning] > 0 && !request.idempotent) {\n // Non-idempotent request cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n return true\n }\n\n if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {\n // Don't dispatch an upgrade until all preceding requests have completed.\n // A misbehaving server might upgrade the connection before all pipelined\n // request has completed.\n return true\n }\n\n if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&\n (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {\n // Request with stream or iterator body can error while other requests\n // are inflight and indirectly error those as well.\n // Ensure this doesn't happen by waiting for inflight\n // to complete before dispatching.\n\n // Request with stream or iterator body cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n return true\n }\n }\n\n return false\n }\n }\n}\n\nfunction clearIdleSocketValidation (socket) {\n if (socket[kIdleSocketValidationTimeout]) {\n clearTimeout(socket[kIdleSocketValidationTimeout])\n socket[kIdleSocketValidationTimeout] = null\n }\n\n socket[kIdleSocketValidation] = 0\n}\n\nfunction scheduleIdleSocketValidation (client, socket) {\n socket[kIdleSocketValidation] = 1\n socket[kIdleSocketValidationTimeout] = setTimeout(() => {\n socket[kIdleSocketValidationTimeout] = null\n socket[kIdleSocketValidation] = 2\n\n if (client[kSocket] === socket && !socket.destroyed) {\n client[kResume]()\n }\n }, 0)\n socket[kIdleSocketValidationTimeout].unref?.()\n}\n\n/**\n * @param {import('./client.js')} client\n */\nfunction resumeH1 (client) {\n const socket = client[kSocket]\n\n if (socket && !socket.destroyed) {\n if (client[kSize] === 0) {\n if (!socket[kNoRef] && socket.unref) {\n socket.unref()\n socket[kNoRef] = true\n }\n } else if (socket[kNoRef] && socket.ref) {\n socket.ref()\n socket[kNoRef] = false\n }\n\n if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {\n if (socket[kIdleSocketValidation] === 0) {\n scheduleIdleSocketValidation(client, socket)\n socket[kParser].readMore()\n if (socket.destroyed) {\n return\n }\n return\n }\n\n if (socket[kIdleSocketValidation] === 1) {\n socket[kParser].readMore()\n if (socket.destroyed) {\n return\n }\n return\n }\n }\n\n if (client[kRunning] === 0) {\n socket[kParser].readMore()\n if (socket.destroyed) {\n return\n }\n }\n\n if (client[kSize] === 0) {\n if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {\n socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)\n }\n } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n const request = client[kQueue][client[kRunningIdx]]\n const headersTimeout = request.headersTimeout != null\n ? request.headersTimeout\n : client[kHeadersTimeout]\n socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)\n }\n }\n }\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH1 (client, request) {\n const { method, path, host, upgrade, blocking, reset } = request\n\n let { body, headers, contentLength } = request\n\n // https://tools.ietf.org/html/rfc7231#section-4.3.1\n // https://tools.ietf.org/html/rfc7231#section-4.3.2\n // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n // Sending a payload body on a request that does not\n // expect it can cause undefined behavior on some\n // servers and corrupt connection state. Do not\n // re-use the connection for further requests.\n\n const expectsPayload = (\n method === 'PUT' ||\n method === 'POST' ||\n method === 'PATCH' ||\n method === 'QUERY' ||\n method === 'PROPFIND' ||\n method === 'PROPPATCH'\n )\n\n if (util.isFormDataLike(body)) {\n if (!extractBody) {\n extractBody = require('../web/fetch/body.js').extractBody\n }\n\n const [bodyStream, contentType] = extractBody(body)\n if (request.contentType == null) {\n headers.push('content-type', contentType)\n }\n body = bodyStream.stream\n contentLength = bodyStream.length\n } else if (util.isBlobLike(body) && request.contentType == null && body.type) {\n headers.push('content-type', body.type)\n }\n\n if (body && typeof body.read === 'function') {\n // Try to read EOF in order to get length.\n body.read(0)\n }\n\n const bodyLength = util.bodyLength(body)\n\n contentLength = bodyLength ?? contentLength\n\n if (contentLength === null) {\n contentLength = request.contentLength\n }\n\n if (contentLength === 0 && !expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD NOT send a Content-Length header field when\n // the request message does not contain a payload body and the method\n // semantics do not anticipate such a body.\n\n contentLength = null\n }\n\n // https://github.com/nodejs/undici/issues/2046\n // A user agent may send a Content-Length header with 0 value, this should be allowed.\n if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {\n if (client[kStrictContentLength]) {\n util.errorRequest(client, request, new RequestContentLengthMismatchError())\n return false\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n const socket = client[kSocket]\n clearIdleSocketValidation(socket)\n\n const abort = (err) => {\n if (request.aborted || request.completed) {\n return\n }\n\n util.errorRequest(client, request, err || new RequestAbortedError())\n\n util.destroy(body)\n util.destroy(socket, new InformationalError('aborted'))\n }\n\n try {\n request.onConnect(abort)\n } catch (err) {\n util.errorRequest(client, request, err)\n }\n\n if (request.aborted) {\n return false\n }\n\n if (method === 'HEAD') {\n // https://github.com/mcollina/undici/issues/258\n // Close after a HEAD request to interop with misbehaving servers\n // that may send a body in the response.\n\n socket[kReset] = true\n }\n\n if (upgrade || method === 'CONNECT') {\n // On CONNECT or upgrade, block pipeline from dispatching further\n // requests on this connection.\n\n socket[kReset] = true\n }\n\n if (reset != null) {\n socket[kReset] = reset\n }\n\n if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n socket[kReset] = true\n }\n\n if (blocking) {\n socket[kBlocking] = true\n }\n\n let header = `${method} ${path} HTTP/1.1\\r\\n`\n\n if (typeof host === 'string') {\n header += `host: ${host}\\r\\n`\n } else {\n header += client[kHostHeader]\n }\n\n if (upgrade) {\n header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n } else if (client[kPipelining] && !socket[kReset]) {\n header += 'connection: keep-alive\\r\\n'\n } else {\n header += 'connection: close\\r\\n'\n }\n\n if (Array.isArray(headers)) {\n for (let n = 0; n < headers.length; n += 2) {\n const key = headers[n + 0]\n const val = headers[n + 1]\n\n if (Array.isArray(val)) {\n for (let i = 0; i < val.length; i++) {\n header += `${key}: ${val[i]}\\r\\n`\n }\n } else {\n header += `${key}: ${val}\\r\\n`\n }\n }\n }\n\n if (channels.sendHeaders.hasSubscribers) {\n channels.sendHeaders.publish({ request, headers: header, socket })\n }\n\n /* istanbul ignore else: assertion */\n if (!body || bodyLength === 0) {\n writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)\n } else if (util.isBuffer(body)) {\n writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)\n } else if (util.isBlobLike(body)) {\n if (typeof body.stream === 'function') {\n writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)\n } else {\n writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)\n }\n } else if (util.isStream(body)) {\n writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)\n } else if (util.isIterable(body)) {\n writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)\n } else {\n assert(false)\n }\n\n return true\n}\n\nfunction writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n let finished = false\n\n const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n\n const onData = function (chunk) {\n if (finished) {\n return\n }\n\n try {\n if (!writer.write(chunk) && this.pause) {\n this.pause()\n }\n } catch (err) {\n util.destroy(this, err)\n }\n }\n const onDrain = function () {\n if (finished) {\n return\n }\n\n if (body.resume) {\n body.resume()\n }\n }\n const onClose = function () {\n // 'close' might be emitted *before* 'error' for\n // broken streams. Wait a tick to avoid this case.\n queueMicrotask(() => {\n // It's only safe to remove 'error' listener after\n // 'close'.\n body.removeListener('error', onFinished)\n })\n\n if (!finished) {\n const err = new RequestAbortedError()\n queueMicrotask(() => onFinished(err))\n }\n }\n const onFinished = function (err) {\n if (finished) {\n return\n }\n\n finished = true\n\n assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))\n\n socket\n .off('drain', onDrain)\n .off('error', onFinished)\n\n body\n .removeListener('data', onData)\n .removeListener('end', onFinished)\n .removeListener('close', onClose)\n\n if (!err) {\n try {\n writer.end()\n } catch (er) {\n err = er\n }\n }\n\n writer.destroy(err)\n\n if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {\n util.destroy(body, err)\n } else {\n util.destroy(body)\n }\n }\n\n body\n .on('data', onData)\n .on('end', onFinished)\n .on('error', onFinished)\n .on('close', onClose)\n\n if (body.resume) {\n body.resume()\n }\n\n socket\n .on('drain', onDrain)\n .on('error', onFinished)\n\n if (body.errorEmitted ?? body.errored) {\n setImmediate(() => onFinished(body.errored))\n } else if (body.endEmitted ?? body.readableEnded) {\n setImmediate(() => onFinished(null))\n }\n\n if (body.closeEmitted ?? body.closed) {\n setImmediate(onClose)\n }\n}\n\nfunction writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n try {\n if (!body) {\n if (contentLength === 0) {\n socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n } else {\n assert(contentLength === null, 'no body must not have content length')\n socket.write(`${header}\\r\\n`, 'latin1')\n }\n } else if (util.isBuffer(body)) {\n assert(contentLength === body.byteLength, 'buffer body must have content length')\n\n socket.cork()\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n socket.write(body)\n socket.uncork()\n request.onBodySent(body)\n\n if (!expectsPayload && request.reset !== false) {\n socket[kReset] = true\n }\n }\n request.onRequestSent()\n\n client[kResume]()\n } catch (err) {\n abort(err)\n }\n}\n\nasync function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n assert(contentLength === body.size, 'blob body must have content length')\n\n try {\n if (contentLength != null && contentLength !== body.size) {\n throw new RequestContentLengthMismatchError()\n }\n\n const buffer = Buffer.from(await body.arrayBuffer())\n\n socket.cork()\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n socket.write(buffer)\n socket.uncork()\n\n request.onBodySent(buffer)\n request.onRequestSent()\n\n if (!expectsPayload && request.reset !== false) {\n socket[kReset] = true\n }\n\n client[kResume]()\n } catch (err) {\n abort(err)\n }\n}\n\nasync function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n let callback = null\n function onDrain () {\n if (callback) {\n const cb = callback\n callback = null\n cb()\n }\n }\n\n const waitForDrain = () => new Promise((resolve, reject) => {\n assert(callback === null)\n\n if (socket[kError]) {\n reject(socket[kError])\n } else {\n callback = resolve\n }\n })\n\n socket\n .on('close', onDrain)\n .on('drain', onDrain)\n\n const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n try {\n // It's up to the user to somehow abort the async iterable.\n for await (const chunk of body) {\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (!writer.write(chunk)) {\n await waitForDrain()\n }\n }\n\n writer.end()\n } catch (err) {\n writer.destroy(err)\n } finally {\n socket\n .off('close', onDrain)\n .off('drain', onDrain)\n }\n}\n\nclass AsyncWriter {\n constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {\n this.socket = socket\n this.request = request\n this.contentLength = contentLength\n this.client = client\n this.bytesWritten = 0\n this.expectsPayload = expectsPayload\n this.header = header\n this.abort = abort\n\n socket[kWriting] = true\n }\n\n write (chunk) {\n const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this\n\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (socket.destroyed) {\n return false\n }\n\n const len = Buffer.byteLength(chunk)\n if (!len) {\n return true\n }\n\n // We should defer writing chunks.\n if (contentLength !== null && bytesWritten + len > contentLength) {\n if (client[kStrictContentLength]) {\n throw new RequestContentLengthMismatchError()\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n socket.cork()\n\n if (bytesWritten === 0) {\n if (!expectsPayload && request.reset !== false) {\n socket[kReset] = true\n }\n\n if (contentLength === null) {\n socket.write(`${header}transfer-encoding: chunked\\r\\n`, 'latin1')\n } else {\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n }\n }\n\n if (contentLength === null) {\n socket.write(`\\r\\n${len.toString(16)}\\r\\n`, 'latin1')\n }\n\n this.bytesWritten += len\n\n const ret = socket.write(chunk)\n\n socket.uncork()\n\n request.onBodySent(chunk)\n\n if (!ret) {\n if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n // istanbul ignore else: only for jest\n if (socket[kParser].timeout.refresh) {\n socket[kParser].timeout.refresh()\n }\n }\n }\n\n return ret\n }\n\n end () {\n const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this\n request.onRequestSent()\n\n socket[kWriting] = false\n\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (socket.destroyed) {\n return\n }\n\n if (bytesWritten === 0) {\n if (expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD send a Content-Length in a request message when\n // no Transfer-Encoding is sent and the request method defines a meaning\n // for an enclosed payload body.\n\n socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n } else {\n socket.write(`${header}\\r\\n`, 'latin1')\n }\n } else if (contentLength === null) {\n socket.write('\\r\\n0\\r\\n\\r\\n', 'latin1')\n }\n\n if (contentLength !== null && bytesWritten !== contentLength) {\n if (client[kStrictContentLength]) {\n throw new RequestContentLengthMismatchError()\n } else {\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n }\n\n if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n // istanbul ignore else: only for jest\n if (socket[kParser].timeout.refresh) {\n socket[kParser].timeout.refresh()\n }\n }\n\n client[kResume]()\n }\n\n destroy (err) {\n const { socket, client, abort } = this\n\n socket[kWriting] = false\n\n if (err) {\n assert(client[kRunning] <= 1, 'pipeline should only contain this request')\n abort(err)\n }\n }\n}\n\nmodule.exports = connectH1\n","'use strict'\n\nconst assert = require('node:assert')\nconst { pipeline } = require('node:stream')\nconst util = require('../core/util.js')\nconst {\n RequestContentLengthMismatchError,\n RequestAbortedError,\n SocketError,\n InformationalError\n} = require('../core/errors.js')\nconst {\n kUrl,\n kReset,\n kClient,\n kRunning,\n kPending,\n kQueue,\n kPendingIdx,\n kRunningIdx,\n kError,\n kSocket,\n kStrictContentLength,\n kOnError,\n kMaxConcurrentStreams,\n kHTTP2Session,\n kResume,\n kSize,\n kHTTPContext\n} = require('../core/symbols.js')\n\nconst kOpenStreams = Symbol('open streams')\n\nlet extractBody\n\n// Experimental\nlet h2ExperimentalWarned = false\n\n/** @type {import('http2')} */\nlet http2\ntry {\n http2 = require('node:http2')\n} catch {\n // @ts-ignore\n http2 = { constants: {} }\n}\n\nconst {\n constants: {\n HTTP2_HEADER_AUTHORITY,\n HTTP2_HEADER_METHOD,\n HTTP2_HEADER_PATH,\n HTTP2_HEADER_SCHEME,\n HTTP2_HEADER_CONTENT_LENGTH,\n HTTP2_HEADER_EXPECT,\n HTTP2_HEADER_STATUS\n }\n} = http2\n\nfunction parseH2Headers (headers) {\n const result = []\n\n for (const [name, value] of Object.entries(headers)) {\n // h2 may concat the header value by array\n // e.g. Set-Cookie\n if (Array.isArray(value)) {\n for (const subvalue of value) {\n // we need to provide each header value of header name\n // because the headers handler expect name-value pair\n result.push(Buffer.from(name), Buffer.from(subvalue))\n }\n } else {\n result.push(Buffer.from(name), Buffer.from(value))\n }\n }\n\n return result\n}\n\nasync function connectH2 (client, socket) {\n client[kSocket] = socket\n\n if (!h2ExperimentalWarned) {\n h2ExperimentalWarned = true\n process.emitWarning('H2 support is experimental, expect them to change at any time.', {\n code: 'UNDICI-H2'\n })\n }\n\n const session = http2.connect(client[kUrl], {\n createConnection: () => socket,\n peerMaxConcurrentStreams: client[kMaxConcurrentStreams]\n })\n\n session[kOpenStreams] = 0\n session[kClient] = client\n session[kSocket] = socket\n\n util.addListener(session, 'error', onHttp2SessionError)\n util.addListener(session, 'frameError', onHttp2FrameError)\n util.addListener(session, 'end', onHttp2SessionEnd)\n util.addListener(session, 'goaway', onHTTP2GoAway)\n util.addListener(session, 'close', function () {\n const { [kClient]: client } = this\n const { [kSocket]: socket } = client\n\n const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket))\n\n client[kHTTP2Session] = null\n\n if (client.destroyed) {\n assert(client[kPending] === 0)\n\n // Fail entire queue.\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n util.errorRequest(client, request, err)\n }\n }\n })\n\n session.unref()\n\n client[kHTTP2Session] = session\n socket[kHTTP2Session] = session\n\n util.addListener(socket, 'error', function (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n this[kError] = err\n\n this[kClient][kOnError](err)\n })\n\n util.addListener(socket, 'end', function () {\n util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n })\n\n util.addListener(socket, 'close', function () {\n const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n client[kSocket] = null\n\n if (this[kHTTP2Session] != null) {\n this[kHTTP2Session].destroy(err)\n }\n\n client[kPendingIdx] = client[kRunningIdx]\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n\n client[kResume]()\n })\n\n let closed = false\n socket.on('close', () => {\n closed = true\n })\n\n return {\n version: 'h2',\n defaultPipelining: Infinity,\n write (...args) {\n return writeH2(client, ...args)\n },\n resume () {\n resumeH2(client)\n },\n destroy (err, callback) {\n if (closed) {\n queueMicrotask(callback)\n } else {\n // Destroying the socket will trigger the session close\n socket.destroy(err).on('close', callback)\n }\n },\n get destroyed () {\n return socket.destroyed\n },\n busy () {\n return false\n }\n }\n}\n\nfunction resumeH2 (client) {\n const socket = client[kSocket]\n\n if (socket?.destroyed === false) {\n if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) {\n socket.unref()\n client[kHTTP2Session].unref()\n } else {\n socket.ref()\n client[kHTTP2Session].ref()\n }\n }\n}\n\nfunction onHttp2SessionError (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n this[kSocket][kError] = err\n this[kClient][kOnError](err)\n}\n\nfunction onHttp2FrameError (type, code, id) {\n if (id === 0) {\n const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n this[kSocket][kError] = err\n this[kClient][kOnError](err)\n }\n}\n\nfunction onHttp2SessionEnd () {\n const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket]))\n this.destroy(err)\n util.destroy(this[kSocket], err)\n}\n\n/**\n * This is the root cause of #3011\n * We need to handle GOAWAY frames properly, and trigger the session close\n * along with the socket right away\n */\nfunction onHTTP2GoAway (code) {\n // We cannot recover, so best to close the session and the socket\n const err = this[kError] || new SocketError(`HTTP/2: \"GOAWAY\" frame received with code ${code}`, util.getSocketInfo(this))\n const client = this[kClient]\n\n client[kSocket] = null\n client[kHTTPContext] = null\n\n if (this[kHTTP2Session] != null) {\n this[kHTTP2Session].destroy(err)\n this[kHTTP2Session] = null\n }\n\n util.destroy(this[kSocket], err)\n\n // Fail head of pipeline.\n if (client[kRunningIdx] < client[kQueue].length) {\n const request = client[kQueue][client[kRunningIdx]]\n client[kQueue][client[kRunningIdx]++] = null\n util.errorRequest(client, request, err)\n client[kPendingIdx] = client[kRunningIdx]\n }\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n\n client[kResume]()\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH2 (client, request) {\n const session = client[kHTTP2Session]\n const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request\n let { body } = request\n\n if (upgrade) {\n util.errorRequest(client, request, new Error('Upgrade not supported for H2'))\n return false\n }\n\n const headers = {}\n for (let n = 0; n < reqHeaders.length; n += 2) {\n const key = reqHeaders[n + 0]\n const val = reqHeaders[n + 1]\n\n if (Array.isArray(val)) {\n for (let i = 0; i < val.length; i++) {\n if (headers[key]) {\n headers[key] += `,${val[i]}`\n } else {\n headers[key] = val[i]\n }\n }\n } else {\n headers[key] = val\n }\n }\n\n /** @type {import('node:http2').ClientHttp2Stream} */\n let stream\n\n const { hostname, port } = client[kUrl]\n\n headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`\n headers[HTTP2_HEADER_METHOD] = method\n\n const abort = (err) => {\n if (request.aborted || request.completed) {\n return\n }\n\n err = err || new RequestAbortedError()\n\n util.errorRequest(client, request, err)\n\n if (stream != null) {\n util.destroy(stream, err)\n }\n\n // We do not destroy the socket as we can continue using the session\n // the stream get's destroyed and the session remains to create new streams\n util.destroy(body, err)\n client[kQueue][client[kRunningIdx]++] = null\n client[kResume]()\n }\n\n try {\n // We are already connected, streams are pending.\n // We can call on connect, and wait for abort\n request.onConnect(abort)\n } catch (err) {\n util.errorRequest(client, request, err)\n }\n\n if (request.aborted) {\n return false\n }\n\n if (method === 'CONNECT') {\n session.ref()\n // We are already connected, streams are pending, first request\n // will create a new stream. We trigger a request to create the stream and wait until\n // `ready` event is triggered\n // We disabled endStream to allow the user to write to the stream\n stream = session.request(headers, { endStream: false, signal })\n\n if (stream.id && !stream.pending) {\n request.onUpgrade(null, null, stream)\n ++session[kOpenStreams]\n client[kQueue][client[kRunningIdx]++] = null\n } else {\n stream.once('ready', () => {\n request.onUpgrade(null, null, stream)\n ++session[kOpenStreams]\n client[kQueue][client[kRunningIdx]++] = null\n })\n }\n\n stream.once('close', () => {\n session[kOpenStreams] -= 1\n if (session[kOpenStreams] === 0) session.unref()\n })\n\n return true\n }\n\n // https://tools.ietf.org/html/rfc7540#section-8.3\n // :path and :scheme headers must be omitted when sending CONNECT\n\n headers[HTTP2_HEADER_PATH] = path\n headers[HTTP2_HEADER_SCHEME] = 'https'\n\n // https://tools.ietf.org/html/rfc7231#section-4.3.1\n // https://tools.ietf.org/html/rfc7231#section-4.3.2\n // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n // Sending a payload body on a request that does not\n // expect it can cause undefined behavior on some\n // servers and corrupt connection state. Do not\n // re-use the connection for further requests.\n\n const expectsPayload = (\n method === 'PUT' ||\n method === 'POST' ||\n method === 'PATCH'\n )\n\n if (body && typeof body.read === 'function') {\n // Try to read EOF in order to get length.\n body.read(0)\n }\n\n let contentLength = util.bodyLength(body)\n\n if (util.isFormDataLike(body)) {\n extractBody ??= require('../web/fetch/body.js').extractBody\n\n const [bodyStream, contentType] = extractBody(body)\n headers['content-type'] = contentType\n\n body = bodyStream.stream\n contentLength = bodyStream.length\n }\n\n if (contentLength == null) {\n contentLength = request.contentLength\n }\n\n if (contentLength === 0 || !expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD NOT send a Content-Length header field when\n // the request message does not contain a payload body and the method\n // semantics do not anticipate such a body.\n\n contentLength = null\n }\n\n // https://github.com/nodejs/undici/issues/2046\n // A user agent may send a Content-Length header with 0 value, this should be allowed.\n if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {\n if (client[kStrictContentLength]) {\n util.errorRequest(client, request, new RequestContentLengthMismatchError())\n return false\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n if (contentLength != null) {\n assert(body, 'no body must not have content length')\n headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`\n }\n\n session.ref()\n\n const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null\n if (expectContinue) {\n headers[HTTP2_HEADER_EXPECT] = '100-continue'\n stream = session.request(headers, { endStream: shouldEndStream, signal })\n\n stream.once('continue', writeBodyH2)\n } else {\n stream = session.request(headers, {\n endStream: shouldEndStream,\n signal\n })\n writeBodyH2()\n }\n\n // Increment counter as we have new streams open\n ++session[kOpenStreams]\n\n stream.once('response', headers => {\n const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n request.onResponseStarted()\n\n // Due to the stream nature, it is possible we face a race condition\n // where the stream has been assigned, but the request has been aborted\n // the request remains in-flight and headers hasn't been received yet\n // for those scenarios, best effort is to destroy the stream immediately\n // as there's no value to keep it open.\n if (request.aborted) {\n const err = new RequestAbortedError()\n util.errorRequest(client, request, err)\n util.destroy(stream, err)\n return\n }\n\n if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) {\n stream.pause()\n }\n\n stream.on('data', (chunk) => {\n if (request.onData(chunk) === false) {\n stream.pause()\n }\n })\n })\n\n stream.once('end', () => {\n // When state is null, it means we haven't consumed body and the stream still do not have\n // a state.\n // Present specially when using pipeline or stream\n if (stream.state?.state == null || stream.state.state < 6) {\n request.onComplete([])\n }\n\n if (session[kOpenStreams] === 0) {\n // Stream is closed or half-closed-remote (6), decrement counter and cleanup\n // It does not have sense to continue working with the stream as we do not\n // have yet RST_STREAM support on client-side\n\n session.unref()\n }\n\n abort(new InformationalError('HTTP/2: stream half-closed (remote)'))\n client[kQueue][client[kRunningIdx]++] = null\n client[kPendingIdx] = client[kRunningIdx]\n client[kResume]()\n })\n\n stream.once('close', () => {\n session[kOpenStreams] -= 1\n if (session[kOpenStreams] === 0) {\n session.unref()\n }\n })\n\n stream.once('error', function (err) {\n abort(err)\n })\n\n stream.once('frameError', (type, code) => {\n abort(new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`))\n })\n\n // stream.on('aborted', () => {\n // // TODO(HTTP/2): Support aborted\n // })\n\n // stream.on('timeout', () => {\n // // TODO(HTTP/2): Support timeout\n // })\n\n // stream.on('push', headers => {\n // // TODO(HTTP/2): Support push\n // })\n\n // stream.on('trailers', headers => {\n // // TODO(HTTP/2): Support trailers\n // })\n\n return true\n\n function writeBodyH2 () {\n /* istanbul ignore else: assertion */\n if (!body || contentLength === 0) {\n writeBuffer(\n abort,\n stream,\n null,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else if (util.isBuffer(body)) {\n writeBuffer(\n abort,\n stream,\n body,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else if (util.isBlobLike(body)) {\n if (typeof body.stream === 'function') {\n writeIterable(\n abort,\n stream,\n body.stream(),\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else {\n writeBlob(\n abort,\n stream,\n body,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n }\n } else if (util.isStream(body)) {\n writeStream(\n abort,\n client[kSocket],\n expectsPayload,\n stream,\n body,\n client,\n request,\n contentLength\n )\n } else if (util.isIterable(body)) {\n writeIterable(\n abort,\n stream,\n body,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else {\n assert(false)\n }\n }\n}\n\nfunction writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n try {\n if (body != null && util.isBuffer(body)) {\n assert(contentLength === body.byteLength, 'buffer body must have content length')\n h2stream.cork()\n h2stream.write(body)\n h2stream.uncork()\n h2stream.end()\n\n request.onBodySent(body)\n }\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n request.onRequestSent()\n client[kResume]()\n } catch (error) {\n abort(error)\n }\n}\n\nfunction writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n // For HTTP/2, is enough to pipe the stream\n const pipe = pipeline(\n body,\n h2stream,\n (err) => {\n if (err) {\n util.destroy(pipe, err)\n abort(err)\n } else {\n util.removeAllListeners(pipe)\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n client[kResume]()\n }\n }\n )\n\n util.addListener(pipe, 'data', onPipeData)\n\n function onPipeData (chunk) {\n request.onBodySent(chunk)\n }\n}\n\nasync function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n assert(contentLength === body.size, 'blob body must have content length')\n\n try {\n if (contentLength != null && contentLength !== body.size) {\n throw new RequestContentLengthMismatchError()\n }\n\n const buffer = Buffer.from(await body.arrayBuffer())\n\n h2stream.cork()\n h2stream.write(buffer)\n h2stream.uncork()\n h2stream.end()\n\n request.onBodySent(buffer)\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n client[kResume]()\n } catch (err) {\n abort(err)\n }\n}\n\nasync function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n let callback = null\n function onDrain () {\n if (callback) {\n const cb = callback\n callback = null\n cb()\n }\n }\n\n const waitForDrain = () => new Promise((resolve, reject) => {\n assert(callback === null)\n\n if (socket[kError]) {\n reject(socket[kError])\n } else {\n callback = resolve\n }\n })\n\n h2stream\n .on('close', onDrain)\n .on('drain', onDrain)\n\n try {\n // It's up to the user to somehow abort the async iterable.\n for await (const chunk of body) {\n if (socket[kError]) {\n throw socket[kError]\n }\n\n const res = h2stream.write(chunk)\n request.onBodySent(chunk)\n if (!res) {\n await waitForDrain()\n }\n }\n\n h2stream.end()\n\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n client[kResume]()\n } catch (err) {\n abort(err)\n } finally {\n h2stream\n .off('close', onDrain)\n .off('drain', onDrain)\n }\n}\n\nmodule.exports = connectH2\n","// @ts-check\n\n'use strict'\n\nconst assert = require('node:assert')\nconst net = require('node:net')\nconst http = require('node:http')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst Request = require('../core/request.js')\nconst DispatcherBase = require('./dispatcher-base')\nconst {\n InvalidArgumentError,\n InformationalError,\n ClientDestroyedError\n} = require('../core/errors.js')\nconst buildConnector = require('../core/connect.js')\nconst {\n kUrl,\n kServerName,\n kClient,\n kBusy,\n kConnect,\n kResuming,\n kRunning,\n kPending,\n kSize,\n kQueue,\n kConnected,\n kConnecting,\n kNeedDrain,\n kKeepAliveDefaultTimeout,\n kHostHeader,\n kPendingIdx,\n kRunningIdx,\n kError,\n kPipelining,\n kKeepAliveTimeoutValue,\n kMaxHeadersSize,\n kKeepAliveMaxTimeout,\n kKeepAliveTimeoutThreshold,\n kHeadersTimeout,\n kBodyTimeout,\n kStrictContentLength,\n kConnector,\n kMaxRedirections,\n kMaxRequests,\n kCounter,\n kClose,\n kDestroy,\n kDispatch,\n kInterceptors,\n kLocalAddress,\n kMaxResponseSize,\n kOnError,\n kHTTPContext,\n kMaxConcurrentStreams,\n kResume\n} = require('../core/symbols.js')\nconst connectH1 = require('./client-h1.js')\nconst connectH2 = require('./client-h2.js')\nlet deprecatedInterceptorWarned = false\n\nconst kClosedResolve = Symbol('kClosedResolve')\n\nconst noop = () => {}\n\nfunction getPipelining (client) {\n return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1\n}\n\n/**\n * @type {import('../../types/client.js').default}\n */\nclass Client extends DispatcherBase {\n /**\n *\n * @param {string|URL} url\n * @param {import('../../types/client.js').Client.Options} options\n */\n constructor (url, {\n interceptors,\n maxHeaderSize,\n headersTimeout,\n socketTimeout,\n requestTimeout,\n connectTimeout,\n bodyTimeout,\n idleTimeout,\n keepAlive,\n keepAliveTimeout,\n maxKeepAliveTimeout,\n keepAliveMaxTimeout,\n keepAliveTimeoutThreshold,\n socketPath,\n pipelining,\n tls,\n strictContentLength,\n maxCachedSessions,\n maxRedirections,\n connect,\n maxRequestsPerClient,\n localAddress,\n maxResponseSize,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n // h2\n maxConcurrentStreams,\n allowH2,\n webSocket\n } = {}) {\n super({ webSocket })\n\n if (keepAlive !== undefined) {\n throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')\n }\n\n if (socketTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')\n }\n\n if (requestTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')\n }\n\n if (idleTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')\n }\n\n if (maxKeepAliveTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')\n }\n\n if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {\n throw new InvalidArgumentError('invalid maxHeaderSize')\n }\n\n if (socketPath != null && typeof socketPath !== 'string') {\n throw new InvalidArgumentError('invalid socketPath')\n }\n\n if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n throw new InvalidArgumentError('invalid connectTimeout')\n }\n\n if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n throw new InvalidArgumentError('invalid keepAliveTimeout')\n }\n\n if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n throw new InvalidArgumentError('invalid keepAliveMaxTimeout')\n }\n\n if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')\n }\n\n if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')\n }\n\n if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')\n }\n\n if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {\n throw new InvalidArgumentError('localAddress must be valid string IP address')\n }\n\n if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n throw new InvalidArgumentError('maxResponseSize must be a positive number')\n }\n\n if (\n autoSelectFamilyAttemptTimeout != null &&\n (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)\n ) {\n throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')\n }\n\n // h2\n if (allowH2 != null && typeof allowH2 !== 'boolean') {\n throw new InvalidArgumentError('allowH2 must be a valid boolean value')\n }\n\n if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {\n throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')\n }\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n socketPath,\n timeout: connectTimeout,\n ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n }\n\n if (interceptors?.Client && Array.isArray(interceptors.Client)) {\n this[kInterceptors] = interceptors.Client\n if (!deprecatedInterceptorWarned) {\n deprecatedInterceptorWarned = true\n process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', {\n code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED'\n })\n }\n } else {\n this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]\n }\n\n this[kUrl] = util.parseOrigin(url)\n this[kConnector] = connect\n this[kPipelining] = pipelining != null ? pipelining : 1\n this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize\n this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout\n this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout\n this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold\n this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]\n this[kServerName] = null\n this[kLocalAddress] = localAddress != null ? localAddress : null\n this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming\n this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming\n this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\\r\\n`\n this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3\n this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3\n this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength\n this[kMaxRedirections] = maxRedirections\n this[kMaxRequests] = maxRequestsPerClient\n this[kClosedResolve] = null\n this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1\n this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server\n this[kHTTPContext] = null\n\n // kQueue is built up of 3 sections separated by\n // the kRunningIdx and kPendingIdx indices.\n // | complete | running | pending |\n // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length\n // kRunningIdx points to the first running element.\n // kPendingIdx points to the first pending element.\n // This implements a fast queue with an amortized\n // time of O(1).\n\n this[kQueue] = []\n this[kRunningIdx] = 0\n this[kPendingIdx] = 0\n\n this[kResume] = (sync) => resume(this, sync)\n this[kOnError] = (err) => onError(this, err)\n }\n\n get pipelining () {\n return this[kPipelining]\n }\n\n set pipelining (value) {\n this[kPipelining] = value\n this[kResume](true)\n }\n\n get [kPending] () {\n return this[kQueue].length - this[kPendingIdx]\n }\n\n get [kRunning] () {\n return this[kPendingIdx] - this[kRunningIdx]\n }\n\n get [kSize] () {\n return this[kQueue].length - this[kRunningIdx]\n }\n\n get [kConnected] () {\n return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed\n }\n\n get [kBusy] () {\n return Boolean(\n this[kHTTPContext]?.busy(null) ||\n (this[kSize] >= (getPipelining(this) || 1)) ||\n this[kPending] > 0\n )\n }\n\n /* istanbul ignore: only used for test */\n [kConnect] (cb) {\n connect(this)\n this.once('connect', cb)\n }\n\n [kDispatch] (opts, handler) {\n const origin = opts.origin || this[kUrl].origin\n const request = new Request(origin, opts, handler)\n\n this[kQueue].push(request)\n if (this[kResuming]) {\n // Do nothing.\n } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n // Wait a tick in case stream/iterator is ended in the same tick.\n this[kResuming] = 1\n queueMicrotask(() => resume(this))\n } else {\n this[kResume](true)\n }\n\n if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n this[kNeedDrain] = 2\n }\n\n return this[kNeedDrain] < 2\n }\n\n async [kClose] () {\n // TODO: for H2 we need to gracefully flush the remaining enqueued\n // request and close each stream.\n return new Promise((resolve) => {\n if (this[kSize]) {\n this[kClosedResolve] = resolve\n } else {\n resolve(null)\n }\n })\n }\n\n async [kDestroy] (err) {\n return new Promise((resolve) => {\n const requests = this[kQueue].splice(this[kPendingIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n util.errorRequest(this, request, err)\n }\n\n const callback = () => {\n if (this[kClosedResolve]) {\n // TODO (fix): Should we error here with ClientDestroyedError?\n this[kClosedResolve]()\n this[kClosedResolve] = null\n }\n resolve(null)\n }\n\n if (this[kHTTPContext]) {\n this[kHTTPContext].destroy(err, callback)\n this[kHTTPContext] = null\n } else {\n queueMicrotask(callback)\n }\n\n this[kResume]()\n })\n }\n}\n\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor.js')\n\nfunction onError (client, err) {\n if (\n client[kRunning] === 0 &&\n err.code !== 'UND_ERR_INFO' &&\n err.code !== 'UND_ERR_SOCKET'\n ) {\n // Error is not caused by running request and not a recoverable\n // socket error.\n\n assert(client[kPendingIdx] === client[kRunningIdx])\n\n const requests = client[kQueue].splice(client[kRunningIdx])\n\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n util.errorRequest(client, request, err)\n }\n assert(client[kSize] === 0)\n }\n}\n\n/**\n * @param {Client} client\n * @returns\n */\nasync function connect (client) {\n assert(!client[kConnecting])\n assert(!client[kHTTPContext])\n\n let { host, hostname, protocol, port } = client[kUrl]\n\n // Resolve ipv6\n if (hostname[0] === '[') {\n const idx = hostname.indexOf(']')\n\n assert(idx !== -1)\n const ip = hostname.substring(1, idx)\n\n assert(net.isIP(ip))\n hostname = ip\n }\n\n client[kConnecting] = true\n\n if (channels.beforeConnect.hasSubscribers) {\n channels.beforeConnect.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n version: client[kHTTPContext]?.version,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector]\n })\n }\n\n try {\n const socket = await new Promise((resolve, reject) => {\n client[kConnector]({\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n }, (err, socket) => {\n if (err) {\n reject(err)\n } else {\n resolve(socket)\n }\n })\n })\n\n if (client.destroyed) {\n util.destroy(socket.on('error', noop), new ClientDestroyedError())\n return\n }\n\n assert(socket)\n\n try {\n client[kHTTPContext] = socket.alpnProtocol === 'h2'\n ? await connectH2(client, socket)\n : await connectH1(client, socket)\n } catch (err) {\n socket.destroy().on('error', noop)\n throw err\n }\n\n client[kConnecting] = false\n\n socket[kCounter] = 0\n socket[kMaxRequests] = client[kMaxRequests]\n socket[kClient] = client\n socket[kError] = null\n\n if (channels.connected.hasSubscribers) {\n channels.connected.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n version: client[kHTTPContext]?.version,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector],\n socket\n })\n }\n client.emit('connect', client[kUrl], [client])\n } catch (err) {\n if (client.destroyed) {\n return\n }\n\n client[kConnecting] = false\n\n if (channels.connectError.hasSubscribers) {\n channels.connectError.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n version: client[kHTTPContext]?.version,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector],\n error: err\n })\n }\n\n if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n assert(client[kRunning] === 0)\n while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n const request = client[kQueue][client[kPendingIdx]++]\n util.errorRequest(client, request, err)\n }\n } else {\n onError(client, err)\n }\n\n client.emit('connectionError', client[kUrl], [client], err)\n }\n\n client[kResume]()\n}\n\nfunction emitDrain (client) {\n client[kNeedDrain] = 0\n client.emit('drain', client[kUrl], [client])\n}\n\nfunction resume (client, sync) {\n if (client[kResuming] === 2) {\n return\n }\n\n client[kResuming] = 2\n\n _resume(client, sync)\n client[kResuming] = 0\n\n if (client[kRunningIdx] > 256) {\n client[kQueue].splice(0, client[kRunningIdx])\n client[kPendingIdx] -= client[kRunningIdx]\n client[kRunningIdx] = 0\n }\n}\n\nfunction _resume (client, sync) {\n while (true) {\n if (client.destroyed) {\n assert(client[kPending] === 0)\n return\n }\n\n if (client[kClosedResolve] && !client[kSize]) {\n client[kClosedResolve]()\n client[kClosedResolve] = null\n return\n }\n\n if (client[kHTTPContext]) {\n client[kHTTPContext].resume()\n }\n\n if (client[kBusy]) {\n client[kNeedDrain] = 2\n } else if (client[kNeedDrain] === 2) {\n if (sync) {\n client[kNeedDrain] = 1\n queueMicrotask(() => emitDrain(client))\n } else {\n emitDrain(client)\n }\n continue\n }\n\n if (client[kPending] === 0) {\n return\n }\n\n if (client[kRunning] >= (getPipelining(client) || 1)) {\n return\n }\n\n const request = client[kQueue][client[kPendingIdx]]\n\n if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {\n if (client[kRunning] > 0) {\n return\n }\n\n client[kServerName] = request.servername\n client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {\n client[kHTTPContext] = null\n resume(client)\n })\n }\n\n if (client[kConnecting]) {\n return\n }\n\n if (!client[kHTTPContext]) {\n connect(client)\n return\n }\n\n if (client[kHTTPContext].destroyed) {\n return\n }\n\n if (client[kHTTPContext].busy(request)) {\n return\n }\n\n if (!request.aborted && client[kHTTPContext].write(request)) {\n client[kPendingIdx]++\n } else {\n client[kQueue].splice(client[kPendingIdx], 1)\n }\n }\n}\n\nmodule.exports = Client\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst {\n ClientDestroyedError,\n ClientClosedError,\n InvalidArgumentError\n} = require('../core/errors')\nconst { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require('../core/symbols')\n\nconst kOnDestroyed = Symbol('onDestroyed')\nconst kOnClosed = Symbol('onClosed')\nconst kInterceptedDispatch = Symbol('Intercepted Dispatch')\nconst kWebSocketOptions = Symbol('webSocketOptions')\n\nclass DispatcherBase extends Dispatcher {\n constructor (opts) {\n super()\n\n this[kDestroyed] = false\n this[kOnDestroyed] = null\n this[kClosed] = false\n this[kOnClosed] = []\n this[kWebSocketOptions] = opts?.webSocket ?? {}\n }\n\n get webSocketOptions () {\n return {\n maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,\n maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024\n }\n }\n\n get destroyed () {\n return this[kDestroyed]\n }\n\n get closed () {\n return this[kClosed]\n }\n\n get interceptors () {\n return this[kInterceptors]\n }\n\n set interceptors (newInterceptors) {\n if (newInterceptors) {\n for (let i = newInterceptors.length - 1; i >= 0; i--) {\n const interceptor = this[kInterceptors][i]\n if (typeof interceptor !== 'function') {\n throw new InvalidArgumentError('interceptor must be an function')\n }\n }\n }\n\n this[kInterceptors] = newInterceptors\n }\n\n close (callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n this.close((err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (this[kDestroyed]) {\n queueMicrotask(() => callback(new ClientDestroyedError(), null))\n return\n }\n\n if (this[kClosed]) {\n if (this[kOnClosed]) {\n this[kOnClosed].push(callback)\n } else {\n queueMicrotask(() => callback(null, null))\n }\n return\n }\n\n this[kClosed] = true\n this[kOnClosed].push(callback)\n\n const onClosed = () => {\n const callbacks = this[kOnClosed]\n this[kOnClosed] = null\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i](null, null)\n }\n }\n\n // Should not error.\n this[kClose]()\n .then(() => this.destroy())\n .then(() => {\n queueMicrotask(onClosed)\n })\n }\n\n destroy (err, callback) {\n if (typeof err === 'function') {\n callback = err\n err = null\n }\n\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n this.destroy(err, (err, data) => {\n return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)\n })\n })\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (this[kDestroyed]) {\n if (this[kOnDestroyed]) {\n this[kOnDestroyed].push(callback)\n } else {\n queueMicrotask(() => callback(null, null))\n }\n return\n }\n\n if (!err) {\n err = new ClientDestroyedError()\n }\n\n this[kDestroyed] = true\n this[kOnDestroyed] = this[kOnDestroyed] || []\n this[kOnDestroyed].push(callback)\n\n const onDestroyed = () => {\n const callbacks = this[kOnDestroyed]\n this[kOnDestroyed] = null\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i](null, null)\n }\n }\n\n // Should not error.\n this[kDestroy](err).then(() => {\n queueMicrotask(onDestroyed)\n })\n }\n\n [kInterceptedDispatch] (opts, handler) {\n if (!this[kInterceptors] || this[kInterceptors].length === 0) {\n this[kInterceptedDispatch] = this[kDispatch]\n return this[kDispatch](opts, handler)\n }\n\n let dispatch = this[kDispatch].bind(this)\n for (let i = this[kInterceptors].length - 1; i >= 0; i--) {\n dispatch = this[kInterceptors][i](dispatch)\n }\n this[kInterceptedDispatch] = dispatch\n return dispatch(opts, handler)\n }\n\n dispatch (opts, handler) {\n if (!handler || typeof handler !== 'object') {\n throw new InvalidArgumentError('handler must be an object')\n }\n\n try {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object.')\n }\n\n if (this[kDestroyed] || this[kOnDestroyed]) {\n throw new ClientDestroyedError()\n }\n\n if (this[kClosed]) {\n throw new ClientClosedError()\n }\n\n return this[kInterceptedDispatch](opts, handler)\n } catch (err) {\n if (typeof handler.onError !== 'function') {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n handler.onError(err)\n\n return false\n }\n }\n}\n\nmodule.exports = DispatcherBase\n","'use strict'\nconst EventEmitter = require('node:events')\n\nclass Dispatcher extends EventEmitter {\n dispatch () {\n throw new Error('not implemented')\n }\n\n close () {\n throw new Error('not implemented')\n }\n\n destroy () {\n throw new Error('not implemented')\n }\n\n compose (...args) {\n // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...\n const interceptors = Array.isArray(args[0]) ? args[0] : args\n let dispatch = this.dispatch.bind(this)\n\n for (const interceptor of interceptors) {\n if (interceptor == null) {\n continue\n }\n\n if (typeof interceptor !== 'function') {\n throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)\n }\n\n dispatch = interceptor(dispatch)\n\n if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {\n throw new TypeError('invalid interceptor')\n }\n }\n\n return new ComposedDispatcher(this, dispatch)\n }\n}\n\nclass ComposedDispatcher extends Dispatcher {\n #dispatcher = null\n #dispatch = null\n\n constructor (dispatcher, dispatch) {\n super()\n this.#dispatcher = dispatcher\n this.#dispatch = dispatch\n }\n\n dispatch (...args) {\n this.#dispatch(...args)\n }\n\n close (...args) {\n return this.#dispatcher.close(...args)\n }\n\n destroy (...args) {\n return this.#dispatcher.destroy(...args)\n }\n}\n\nmodule.exports = Dispatcher\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require('../core/symbols')\nconst ProxyAgent = require('./proxy-agent')\nconst Agent = require('./agent')\n\nconst DEFAULT_PORTS = {\n 'http:': 80,\n 'https:': 443\n}\n\nlet experimentalWarned = false\n\nclass EnvHttpProxyAgent extends DispatcherBase {\n #noProxyValue = null\n #noProxyEntries = null\n #opts = null\n\n constructor (opts = {}) {\n super()\n this.#opts = opts\n\n if (!experimentalWarned) {\n experimentalWarned = true\n process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', {\n code: 'UNDICI-EHPA'\n })\n }\n\n const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts\n\n this[kNoProxyAgent] = new Agent(agentOpts)\n\n const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY\n if (HTTP_PROXY) {\n this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY })\n } else {\n this[kHttpProxyAgent] = this[kNoProxyAgent]\n }\n\n const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY\n if (HTTPS_PROXY) {\n this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY })\n } else {\n this[kHttpsProxyAgent] = this[kHttpProxyAgent]\n }\n\n this.#parseNoProxy()\n }\n\n [kDispatch] (opts, handler) {\n const url = new URL(opts.origin)\n const agent = this.#getProxyAgentForUrl(url)\n return agent.dispatch(opts, handler)\n }\n\n async [kClose] () {\n await this[kNoProxyAgent].close()\n if (!this[kHttpProxyAgent][kClosed]) {\n await this[kHttpProxyAgent].close()\n }\n if (!this[kHttpsProxyAgent][kClosed]) {\n await this[kHttpsProxyAgent].close()\n }\n }\n\n async [kDestroy] (err) {\n await this[kNoProxyAgent].destroy(err)\n if (!this[kHttpProxyAgent][kDestroyed]) {\n await this[kHttpProxyAgent].destroy(err)\n }\n if (!this[kHttpsProxyAgent][kDestroyed]) {\n await this[kHttpsProxyAgent].destroy(err)\n }\n }\n\n #getProxyAgentForUrl (url) {\n let { protocol, host: hostname, port } = url\n\n // Stripping ports in this way instead of using parsedUrl.hostname to make\n // sure that the brackets around IPv6 addresses are kept.\n hostname = hostname.replace(/:\\d*$/, '').toLowerCase()\n port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0\n if (!this.#shouldProxy(hostname, port)) {\n return this[kNoProxyAgent]\n }\n if (protocol === 'https:') {\n return this[kHttpsProxyAgent]\n }\n return this[kHttpProxyAgent]\n }\n\n #shouldProxy (hostname, port) {\n if (this.#noProxyChanged) {\n this.#parseNoProxy()\n }\n\n if (this.#noProxyEntries.length === 0) {\n return true // Always proxy if NO_PROXY is not set or empty.\n }\n if (this.#noProxyValue === '*') {\n return false // Never proxy if wildcard is set.\n }\n\n for (let i = 0; i < this.#noProxyEntries.length; i++) {\n const entry = this.#noProxyEntries[i]\n if (entry.port && entry.port !== port) {\n continue // Skip if ports don't match.\n }\n if (!/^[.*]/.test(entry.hostname)) {\n // No wildcards, so don't proxy only if there is not an exact match.\n if (hostname === entry.hostname) {\n return false\n }\n } else {\n // Don't proxy if the hostname ends with the no_proxy host.\n if (hostname.endsWith(entry.hostname.replace(/^\\*/, ''))) {\n return false\n }\n }\n }\n\n return true\n }\n\n #parseNoProxy () {\n const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv\n const noProxySplit = noProxyValue.split(/[,\\s]/)\n const noProxyEntries = []\n\n for (let i = 0; i < noProxySplit.length; i++) {\n const entry = noProxySplit[i]\n if (!entry) {\n continue\n }\n const parsed = entry.match(/^(.+):(\\d+)$/)\n noProxyEntries.push({\n hostname: (parsed ? parsed[1] : entry).toLowerCase(),\n port: parsed ? Number.parseInt(parsed[2], 10) : 0\n })\n }\n\n this.#noProxyValue = noProxyValue\n this.#noProxyEntries = noProxyEntries\n }\n\n get #noProxyChanged () {\n if (this.#opts.noProxy !== undefined) {\n return false\n }\n return this.#noProxyValue !== this.#noProxyEnv\n }\n\n get #noProxyEnv () {\n return process.env.no_proxy ?? process.env.NO_PROXY ?? ''\n }\n}\n\nmodule.exports = EnvHttpProxyAgent\n","/* eslint-disable */\n\n'use strict'\n\n// Extracted from node/lib/internal/fixed_queue.js\n\n// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.\nconst kSize = 2048;\nconst kMask = kSize - 1;\n\n// The FixedQueue is implemented as a singly-linked list of fixed-size\n// circular buffers. It looks something like this:\n//\n// head tail\n// | |\n// v v\n// +-----------+ <-----\\ +-----------+ <------\\ +-----------+\n// | [null] | \\----- | next | \\------- | next |\n// +-----------+ +-----------+ +-----------+\n// | item | <-- bottom | item | <-- bottom | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | bottom --> | item |\n// | item | | item | | item |\n// | ... | | ... | | ... |\n// | item | | item | | item |\n// | item | | item | | item |\n// | [empty] | <-- top | item | | item |\n// | [empty] | | item | | item |\n// | [empty] | | [empty] | <-- top top --> | [empty] |\n// +-----------+ +-----------+ +-----------+\n//\n// Or, if there is only one circular buffer, it looks something\n// like either of these:\n//\n// head tail head tail\n// | | | |\n// v v v v\n// +-----------+ +-----------+\n// | [null] | | [null] |\n// +-----------+ +-----------+\n// | [empty] | | item |\n// | [empty] | | item |\n// | item | <-- bottom top --> | [empty] |\n// | item | | [empty] |\n// | [empty] | <-- top bottom --> | item |\n// | [empty] | | item |\n// +-----------+ +-----------+\n//\n// Adding a value means moving `top` forward by one, removing means\n// moving `bottom` forward by one. After reaching the end, the queue\n// wraps around.\n//\n// When `top === bottom` the current queue is empty and when\n// `top + 1 === bottom` it's full. This wastes a single space of storage\n// but allows much quicker checks.\n\nclass FixedCircularBuffer {\n constructor() {\n this.bottom = 0;\n this.top = 0;\n this.list = new Array(kSize);\n this.next = null;\n }\n\n isEmpty() {\n return this.top === this.bottom;\n }\n\n isFull() {\n return ((this.top + 1) & kMask) === this.bottom;\n }\n\n push(data) {\n this.list[this.top] = data;\n this.top = (this.top + 1) & kMask;\n }\n\n shift() {\n const nextItem = this.list[this.bottom];\n if (nextItem === undefined)\n return null;\n this.list[this.bottom] = undefined;\n this.bottom = (this.bottom + 1) & kMask;\n return nextItem;\n }\n}\n\nmodule.exports = class FixedQueue {\n constructor() {\n this.head = this.tail = new FixedCircularBuffer();\n }\n\n isEmpty() {\n return this.head.isEmpty();\n }\n\n push(data) {\n if (this.head.isFull()) {\n // Head is full: Creates a new queue, sets the old queue's `.next` to it,\n // and sets it as the new main queue.\n this.head = this.head.next = new FixedCircularBuffer();\n }\n this.head.push(data);\n }\n\n shift() {\n const tail = this.tail;\n const next = tail.shift();\n if (tail.isEmpty() && tail.next !== null) {\n // If there is another queue, it forms the new tail.\n this.tail = tail.next;\n }\n return next;\n }\n};\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst FixedQueue = require('./fixed-queue')\nconst { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('../core/symbols')\nconst PoolStats = require('./pool-stats')\n\nconst kClients = Symbol('clients')\nconst kNeedDrain = Symbol('needDrain')\nconst kQueue = Symbol('queue')\nconst kClosedResolve = Symbol('closed resolve')\nconst kOnDrain = Symbol('onDrain')\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kGetDispatcher = Symbol('get dispatcher')\nconst kAddClient = Symbol('add client')\nconst kRemoveClient = Symbol('remove client')\nconst kStats = Symbol('stats')\n\nclass PoolBase extends DispatcherBase {\n constructor (opts) {\n super(opts)\n\n this[kQueue] = new FixedQueue()\n this[kClients] = []\n this[kQueued] = 0\n\n const pool = this\n\n this[kOnDrain] = function onDrain (origin, targets) {\n const queue = pool[kQueue]\n\n let needDrain = false\n\n while (!needDrain) {\n const item = queue.shift()\n if (!item) {\n break\n }\n pool[kQueued]--\n needDrain = !this.dispatch(item.opts, item.handler)\n }\n\n this[kNeedDrain] = needDrain\n\n if (!this[kNeedDrain] && pool[kNeedDrain]) {\n pool[kNeedDrain] = false\n pool.emit('drain', origin, [pool, ...targets])\n }\n\n if (pool[kClosedResolve] && queue.isEmpty()) {\n Promise\n .all(pool[kClients].map(c => c.close()))\n .then(pool[kClosedResolve])\n }\n }\n\n this[kOnConnect] = (origin, targets) => {\n pool.emit('connect', origin, [pool, ...targets])\n }\n\n this[kOnDisconnect] = (origin, targets, err) => {\n pool.emit('disconnect', origin, [pool, ...targets], err)\n }\n\n this[kOnConnectionError] = (origin, targets, err) => {\n pool.emit('connectionError', origin, [pool, ...targets], err)\n }\n\n this[kStats] = new PoolStats(this)\n }\n\n get [kBusy] () {\n return this[kNeedDrain]\n }\n\n get [kConnected] () {\n return this[kClients].filter(client => client[kConnected]).length\n }\n\n get [kFree] () {\n return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length\n }\n\n get [kPending] () {\n let ret = this[kQueued]\n for (const { [kPending]: pending } of this[kClients]) {\n ret += pending\n }\n return ret\n }\n\n get [kRunning] () {\n let ret = 0\n for (const { [kRunning]: running } of this[kClients]) {\n ret += running\n }\n return ret\n }\n\n get [kSize] () {\n let ret = this[kQueued]\n for (const { [kSize]: size } of this[kClients]) {\n ret += size\n }\n return ret\n }\n\n get stats () {\n return this[kStats]\n }\n\n async [kClose] () {\n if (this[kQueue].isEmpty()) {\n await Promise.all(this[kClients].map(c => c.close()))\n } else {\n await new Promise((resolve) => {\n this[kClosedResolve] = resolve\n })\n }\n }\n\n async [kDestroy] (err) {\n while (true) {\n const item = this[kQueue].shift()\n if (!item) {\n break\n }\n item.handler.onError(err)\n }\n\n await Promise.all(this[kClients].map(c => c.destroy(err)))\n }\n\n [kDispatch] (opts, handler) {\n const dispatcher = this[kGetDispatcher]()\n\n if (!dispatcher) {\n this[kNeedDrain] = true\n this[kQueue].push({ opts, handler })\n this[kQueued]++\n } else if (!dispatcher.dispatch(opts, handler)) {\n dispatcher[kNeedDrain] = true\n this[kNeedDrain] = !this[kGetDispatcher]()\n }\n\n return !this[kNeedDrain]\n }\n\n [kAddClient] (client) {\n client\n .on('drain', this[kOnDrain])\n .on('connect', this[kOnConnect])\n .on('disconnect', this[kOnDisconnect])\n .on('connectionError', this[kOnConnectionError])\n\n this[kClients].push(client)\n\n if (this[kNeedDrain]) {\n queueMicrotask(() => {\n if (this[kNeedDrain]) {\n this[kOnDrain](client[kUrl], [this, client])\n }\n })\n }\n\n return this\n }\n\n [kRemoveClient] (client) {\n client.close(() => {\n const idx = this[kClients].indexOf(client)\n if (idx !== -1) {\n this[kClients].splice(idx, 1)\n }\n })\n\n this[kNeedDrain] = this[kClients].some(dispatcher => (\n !dispatcher[kNeedDrain] &&\n dispatcher.closed !== true &&\n dispatcher.destroyed !== true\n ))\n }\n}\n\nmodule.exports = {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kRemoveClient,\n kGetDispatcher\n}\n","const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('../core/symbols')\nconst kPool = Symbol('pool')\n\nclass PoolStats {\n constructor (pool) {\n this[kPool] = pool\n }\n\n get connected () {\n return this[kPool][kConnected]\n }\n\n get free () {\n return this[kPool][kFree]\n }\n\n get pending () {\n return this[kPool][kPending]\n }\n\n get queued () {\n return this[kPool][kQueued]\n }\n\n get running () {\n return this[kPool][kRunning]\n }\n\n get size () {\n return this[kPool][kSize]\n }\n}\n\nmodule.exports = PoolStats\n","'use strict'\n\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kGetDispatcher\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n InvalidArgumentError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst buildConnector = require('../core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\n\nfunction defaultFactory (origin, opts) {\n return new Client(origin, opts)\n}\n\nclass Pool extends PoolBase {\n constructor (origin, {\n connections,\n factory = defaultFactory,\n connect,\n connectTimeout,\n tls,\n maxCachedSessions,\n socketPath,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n allowH2,\n ...options\n } = {}) {\n if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n throw new InvalidArgumentError('invalid connections')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n socketPath,\n timeout: connectTimeout,\n ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n }\n\n super(options)\n\n this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool)\n ? options.interceptors.Pool\n : []\n this[kConnections] = connections || null\n this[kUrl] = util.parseOrigin(origin)\n this[kOptions] = { ...util.deepClone(options), connect, allowH2 }\n this[kOptions].interceptors = options.interceptors\n ? { ...options.interceptors }\n : undefined\n this[kFactory] = factory\n\n this.on('connectionError', (origin, targets, error) => {\n // If a connection error occurs, we remove the client from the pool,\n // and emit a connectionError event. They will not be re-used.\n // Fixes https://github.com/nodejs/undici/issues/3895\n for (const target of targets) {\n // Do not use kRemoveClient here, as it will close the client,\n // but the client cannot be closed in this state.\n const idx = this[kClients].indexOf(target)\n if (idx !== -1) {\n this[kClients].splice(idx, 1)\n }\n }\n })\n }\n\n [kGetDispatcher] () {\n for (const client of this[kClients]) {\n if (!client[kNeedDrain]) {\n return client\n }\n }\n\n if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n const dispatcher = this[kFactory](this[kUrl], this[kOptions])\n this[kAddClient](dispatcher)\n return dispatcher\n }\n }\n}\n\nmodule.exports = Pool\n","'use strict'\n\nconst { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst { URL } = require('node:url')\nconst Agent = require('./agent')\nconst Pool = require('./pool')\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors')\nconst buildConnector = require('../core/connect')\nconst Client = require('./client')\n\nconst kAgent = Symbol('proxy agent')\nconst kClient = Symbol('proxy client')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kRequestTls = Symbol('request tls settings')\nconst kProxyTls = Symbol('proxy tls settings')\nconst kConnectEndpoint = Symbol('connect endpoint function')\nconst kTunnelProxy = Symbol('tunnel proxy')\n\nfunction defaultProtocolPort (protocol) {\n return protocol === 'https:' ? 443 : 80\n}\n\nfunction defaultFactory (origin, opts) {\n return new Pool(origin, opts)\n}\n\nconst noop = () => {}\n\nfunction defaultAgentFactory (origin, opts) {\n if (opts.connections === 1) {\n return new Client(origin, opts)\n }\n return new Pool(origin, opts)\n}\n\nclass Http1ProxyWrapper extends DispatcherBase {\n #client\n\n constructor (proxyUrl, { headers = {}, connect, factory }) {\n super()\n if (!proxyUrl) {\n throw new InvalidArgumentError('Proxy URL is mandatory')\n }\n\n this[kProxyHeaders] = headers\n if (factory) {\n this.#client = factory(proxyUrl, { connect })\n } else {\n this.#client = new Client(proxyUrl, { connect })\n }\n }\n\n [kDispatch] (opts, handler) {\n const onHeaders = handler.onHeaders\n handler.onHeaders = function (statusCode, data, resume) {\n if (statusCode === 407) {\n if (typeof handler.onError === 'function') {\n handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)'))\n }\n return\n }\n if (onHeaders) onHeaders.call(this, statusCode, data, resume)\n }\n\n // Rewrite request as an HTTP1 Proxy request, without tunneling.\n const {\n origin,\n path = '/',\n headers = {}\n } = opts\n\n opts.path = origin + path\n\n if (!('host' in headers) && !('Host' in headers)) {\n const { host } = new URL(origin)\n headers.host = host\n }\n opts.headers = { ...this[kProxyHeaders], ...headers }\n\n return this.#client[kDispatch](opts, handler)\n }\n\n async [kClose] () {\n return this.#client.close()\n }\n\n async [kDestroy] (err) {\n return this.#client.destroy(err)\n }\n}\n\nclass ProxyAgent extends DispatcherBase {\n constructor (opts) {\n super()\n\n if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) {\n throw new InvalidArgumentError('Proxy uri is mandatory')\n }\n\n const { clientFactory = defaultFactory } = opts\n if (typeof clientFactory !== 'function') {\n throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')\n }\n\n const { proxyTunnel = true } = opts\n\n const url = this.#getUrl(opts)\n const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url\n\n this[kProxy] = { uri: href, protocol }\n this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)\n ? opts.interceptors.ProxyAgent\n : []\n this[kRequestTls] = opts.requestTls\n this[kProxyTls] = opts.proxyTls\n this[kProxyHeaders] = opts.headers || {}\n this[kTunnelProxy] = proxyTunnel\n\n if (opts.auth && opts.token) {\n throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')\n } else if (opts.auth) {\n /* @deprecated in favour of opts.token */\n this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`\n } else if (opts.token) {\n this[kProxyHeaders]['proxy-authorization'] = opts.token\n } else if (username && password) {\n this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`\n }\n\n const connect = buildConnector({ ...opts.proxyTls })\n this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })\n\n const agentFactory = opts.factory || defaultAgentFactory\n const factory = (origin, options) => {\n const { protocol } = new URL(origin)\n if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') {\n return new Http1ProxyWrapper(this[kProxy].uri, {\n headers: this[kProxyHeaders],\n connect,\n factory: agentFactory\n })\n }\n return agentFactory(origin, options)\n }\n this[kClient] = clientFactory(url, { connect })\n this[kAgent] = new Agent({\n ...opts,\n factory,\n connect: async (opts, callback) => {\n let requestedPath = opts.host\n if (!opts.port) {\n requestedPath += `:${defaultProtocolPort(opts.protocol)}`\n }\n try {\n const { socket, statusCode } = await this[kClient].connect({\n origin,\n port,\n path: requestedPath,\n signal: opts.signal,\n headers: {\n ...this[kProxyHeaders],\n host: opts.host\n },\n servername: this[kProxyTls]?.servername || proxyHostname\n })\n if (statusCode !== 200) {\n socket.on('error', noop).destroy()\n callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))\n }\n if (opts.protocol !== 'https:') {\n callback(null, socket)\n return\n }\n let servername\n if (this[kRequestTls]) {\n servername = this[kRequestTls].servername\n } else {\n servername = opts.servername\n }\n this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)\n } catch (err) {\n if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n // Throw a custom error to avoid loop in client.js#connect\n callback(new SecureProxyConnectionError(err))\n } else {\n callback(err)\n }\n }\n }\n })\n }\n\n dispatch (opts, handler) {\n const headers = buildHeaders(opts.headers)\n throwIfProxyAuthIsSent(headers)\n\n if (headers && !('host' in headers) && !('Host' in headers)) {\n const { host } = new URL(opts.origin)\n headers.host = host\n }\n\n return this[kAgent].dispatch(\n {\n ...opts,\n headers\n },\n handler\n )\n }\n\n /**\n * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts\n * @returns {URL}\n */\n #getUrl (opts) {\n if (typeof opts === 'string') {\n return new URL(opts)\n } else if (opts instanceof URL) {\n return opts\n } else {\n return new URL(opts.uri)\n }\n }\n\n async [kClose] () {\n await this[kAgent].close()\n await this[kClient].close()\n }\n\n async [kDestroy] () {\n await this[kAgent].destroy()\n await this[kClient].destroy()\n }\n}\n\n/**\n * @param {string[] | Record} headers\n * @returns {Record}\n */\nfunction buildHeaders (headers) {\n // When using undici.fetch, the headers list is stored\n // as an array.\n if (Array.isArray(headers)) {\n /** @type {Record} */\n const headersPair = {}\n\n for (let i = 0; i < headers.length; i += 2) {\n headersPair[headers[i]] = headers[i + 1]\n }\n\n return headersPair\n }\n\n return headers\n}\n\n/**\n * @param {Record} headers\n *\n * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers\n * Nevertheless, it was changed and to avoid a security vulnerability by end users\n * this check was created.\n * It should be removed in the next major version for performance reasons\n */\nfunction throwIfProxyAuthIsSent (headers) {\n const existProxyAuth = headers && Object.keys(headers)\n .find((key) => key.toLowerCase() === 'proxy-authorization')\n if (existProxyAuth) {\n throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')\n }\n}\n\nmodule.exports = ProxyAgent\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst RetryHandler = require('../handler/retry-handler')\n\nclass RetryAgent extends Dispatcher {\n #agent = null\n #options = null\n constructor (agent, options = {}) {\n super(options)\n this.#agent = agent\n this.#options = options\n }\n\n dispatch (opts, handler) {\n const retry = new RetryHandler({\n ...opts,\n retryOptions: this.#options\n }, {\n dispatch: this.#agent.dispatch.bind(this.#agent),\n handler\n })\n return this.#agent.dispatch(opts, retry)\n }\n\n close () {\n return this.#agent.close()\n }\n\n destroy () {\n return this.#agent.destroy()\n }\n}\n\nmodule.exports = RetryAgent\n","'use strict'\n\n// We include a version number for the Dispatcher API. In case of breaking changes,\n// this version number must be increased to avoid conflicts.\nconst globalDispatcher = Symbol.for('undici.globalDispatcher.1')\nconst { InvalidArgumentError } = require('./core/errors')\nconst Agent = require('./dispatcher/agent')\n\nif (getGlobalDispatcher() === undefined) {\n setGlobalDispatcher(new Agent())\n}\n\nfunction setGlobalDispatcher (agent) {\n if (!agent || typeof agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument agent must implement Agent')\n }\n Object.defineProperty(globalThis, globalDispatcher, {\n value: agent,\n writable: true,\n enumerable: false,\n configurable: false\n })\n}\n\nfunction getGlobalDispatcher () {\n return globalThis[globalDispatcher]\n}\n\nmodule.exports = {\n setGlobalDispatcher,\n getGlobalDispatcher\n}\n","'use strict'\n\nmodule.exports = class DecoratorHandler {\n #handler\n\n constructor (handler) {\n if (typeof handler !== 'object' || handler === null) {\n throw new TypeError('handler must be an object')\n }\n this.#handler = handler\n }\n\n onConnect (...args) {\n return this.#handler.onConnect?.(...args)\n }\n\n onError (...args) {\n return this.#handler.onError?.(...args)\n }\n\n onUpgrade (...args) {\n return this.#handler.onUpgrade?.(...args)\n }\n\n onResponseStarted (...args) {\n return this.#handler.onResponseStarted?.(...args)\n }\n\n onHeaders (...args) {\n return this.#handler.onHeaders?.(...args)\n }\n\n onData (...args) {\n return this.#handler.onData?.(...args)\n }\n\n onComplete (...args) {\n return this.#handler.onComplete?.(...args)\n }\n\n onBodySent (...args) {\n return this.#handler.onBodySent?.(...args)\n }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('node:assert')\nconst { InvalidArgumentError } = require('../core/errors')\nconst EE = require('node:events')\n\nconst redirectableStatusCodes = [300, 301, 302, 303, 307, 308]\n\nconst kBody = Symbol('body')\n\nclass BodyAsyncIterable {\n constructor (body) {\n this[kBody] = body\n this[kBodyUsed] = false\n }\n\n async * [Symbol.asyncIterator] () {\n assert(!this[kBodyUsed], 'disturbed')\n this[kBodyUsed] = true\n yield * this[kBody]\n }\n}\n\nclass RedirectHandler {\n constructor (dispatch, maxRedirections, opts, handler) {\n if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n util.validateHandler(handler, opts.method, opts.upgrade)\n\n this.dispatch = dispatch\n this.location = null\n this.abort = null\n this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy\n this.maxRedirections = maxRedirections\n this.handler = handler\n this.history = []\n this.redirectionLimitReached = false\n\n if (util.isStream(this.opts.body)) {\n // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n // so that it can be dispatched again?\n // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n if (util.bodyLength(this.opts.body) === 0) {\n this.opts.body\n .on('data', function () {\n assert(false)\n })\n }\n\n if (typeof this.opts.body.readableDidRead !== 'boolean') {\n this.opts.body[kBodyUsed] = false\n EE.prototype.on.call(this.opts.body, 'data', function () {\n this[kBodyUsed] = true\n })\n }\n } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {\n // TODO (fix): We can't access ReadableStream internal state\n // to determine whether or not it has been disturbed. This is just\n // a workaround.\n this.opts.body = new BodyAsyncIterable(this.opts.body)\n } else if (\n this.opts.body &&\n typeof this.opts.body !== 'string' &&\n !ArrayBuffer.isView(this.opts.body) &&\n util.isIterable(this.opts.body)\n ) {\n // TODO: Should we allow re-using iterable if !this.opts.idempotent\n // or through some other flag?\n this.opts.body = new BodyAsyncIterable(this.opts.body)\n }\n }\n\n onConnect (abort) {\n this.abort = abort\n this.handler.onConnect(abort, { history: this.history })\n }\n\n onUpgrade (statusCode, headers, socket) {\n this.handler.onUpgrade(statusCode, headers, socket)\n }\n\n onError (error) {\n this.handler.onError(error)\n }\n\n onHeaders (statusCode, headers, resume, statusText) {\n this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)\n ? null\n : parseLocation(statusCode, headers)\n\n if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {\n if (this.request) {\n this.request.abort(new Error('max redirects'))\n }\n\n this.redirectionLimitReached = true\n this.abort(new Error('max redirects'))\n return\n }\n\n if (this.opts.origin) {\n this.history.push(new URL(this.opts.path, this.opts.origin))\n }\n\n if (!this.location) {\n return this.handler.onHeaders(statusCode, headers, resume, statusText)\n }\n\n const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))\n const path = search ? `${pathname}${search}` : pathname\n\n // Remove headers referring to the original URL.\n // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.\n // https://tools.ietf.org/html/rfc7231#section-6.4\n this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)\n this.opts.path = path\n this.opts.origin = origin\n this.opts.maxRedirections = 0\n this.opts.query = null\n\n // https://tools.ietf.org/html/rfc7231#section-6.4.4\n // In case of HTTP 303, always replace method to be either HEAD or GET\n if (statusCode === 303 && this.opts.method !== 'HEAD') {\n this.opts.method = 'GET'\n this.opts.body = null\n }\n }\n\n onData (chunk) {\n if (this.location) {\n /*\n https://tools.ietf.org/html/rfc7231#section-6.4\n\n TLDR: undici always ignores 3xx response bodies.\n\n Redirection is used to serve the requested resource from another URL, so it is assumes that\n no body is generated (and thus can be ignored). Even though generating a body is not prohibited.\n\n For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually\n (which means it's optional and not mandated) contain just an hyperlink to the value of\n the Location response header, so the body can be ignored safely.\n\n For status 300, which is \"Multiple Choices\", the spec mentions both generating a Location\n response header AND a response body with the other possible location to follow.\n Since the spec explicitly chooses not to specify a format for such body and leave it to\n servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.\n */\n } else {\n return this.handler.onData(chunk)\n }\n }\n\n onComplete (trailers) {\n if (this.location) {\n /*\n https://tools.ietf.org/html/rfc7231#section-6.4\n\n TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections\n and neither are useful if present.\n\n See comment on onData method above for more detailed information.\n */\n\n this.location = null\n this.abort = null\n\n this.dispatch(this.opts, this)\n } else {\n this.handler.onComplete(trailers)\n }\n }\n\n onBodySent (chunk) {\n if (this.handler.onBodySent) {\n this.handler.onBodySent(chunk)\n }\n }\n}\n\nfunction parseLocation (statusCode, headers) {\n if (redirectableStatusCodes.indexOf(statusCode) === -1) {\n return null\n }\n\n for (let i = 0; i < headers.length; i += 2) {\n if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') {\n return headers[i + 1]\n }\n }\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4.4\nfunction shouldRemoveHeader (header, removeContent, unknownOrigin) {\n if (header.length === 4) {\n return util.headerNameToString(header) === 'host'\n }\n if (removeContent && util.headerNameToString(header).startsWith('content-')) {\n return true\n }\n if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {\n const name = util.headerNameToString(header)\n return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'\n }\n return false\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4\nfunction cleanRequestHeaders (headers, removeContent, unknownOrigin) {\n const ret = []\n if (Array.isArray(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n ret.push(headers[i], headers[i + 1])\n }\n }\n } else if (headers && typeof headers === 'object') {\n for (const key of Object.keys(headers)) {\n if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n ret.push(key, headers[key])\n }\n }\n } else {\n assert(headers == null, 'headers must be an object or an array')\n }\n return ret\n}\n\nmodule.exports = RedirectHandler\n","'use strict'\nconst assert = require('node:assert')\n\nconst { kRetryHandlerDefaultRetry } = require('../core/symbols')\nconst { RequestRetryError } = require('../core/errors')\nconst {\n isDisturbed,\n parseHeaders,\n parseRangeHeader,\n wrapRequestBody\n} = require('../core/util')\n\nfunction calculateRetryAfterHeader (retryAfter) {\n const current = Date.now()\n return new Date(retryAfter).getTime() - current\n}\n\nclass RetryHandler {\n constructor (opts, handlers) {\n const { retryOptions, ...dispatchOpts } = opts\n const {\n // Retry scoped\n retry: retryFn,\n maxRetries,\n maxTimeout,\n minTimeout,\n timeoutFactor,\n // Response scoped\n methods,\n errorCodes,\n retryAfter,\n statusCodes\n } = retryOptions ?? {}\n\n this.dispatch = handlers.dispatch\n this.handler = handlers.handler\n this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }\n this.abort = null\n this.aborted = false\n this.retryOpts = {\n retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],\n retryAfter: retryAfter ?? true,\n maxTimeout: maxTimeout ?? 30 * 1000, // 30s,\n minTimeout: minTimeout ?? 500, // .5s\n timeoutFactor: timeoutFactor ?? 2,\n maxRetries: maxRetries ?? 5,\n // What errors we should retry\n methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],\n // Indicates which errors to retry\n statusCodes: statusCodes ?? [500, 502, 503, 504, 429],\n // List of errors to retry\n errorCodes: errorCodes ?? [\n 'ECONNRESET',\n 'ECONNREFUSED',\n 'ENOTFOUND',\n 'ENETDOWN',\n 'ENETUNREACH',\n 'EHOSTDOWN',\n 'EHOSTUNREACH',\n 'EPIPE',\n 'UND_ERR_SOCKET'\n ]\n }\n\n this.retryCount = 0\n this.retryCountCheckpoint = 0\n this.start = 0\n this.end = null\n this.etag = null\n this.resume = null\n\n // Handle possible onConnect duplication\n this.handler.onConnect(reason => {\n this.aborted = true\n if (this.abort) {\n this.abort(reason)\n } else {\n this.reason = reason\n }\n })\n }\n\n onRequestSent () {\n if (this.handler.onRequestSent) {\n this.handler.onRequestSent()\n }\n }\n\n onUpgrade (statusCode, headers, socket) {\n if (this.handler.onUpgrade) {\n this.handler.onUpgrade(statusCode, headers, socket)\n }\n }\n\n onConnect (abort) {\n if (this.aborted) {\n abort(this.reason)\n } else {\n this.abort = abort\n }\n }\n\n onBodySent (chunk) {\n if (this.handler.onBodySent) return this.handler.onBodySent(chunk)\n }\n\n static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {\n const { statusCode, code, headers } = err\n const { method, retryOptions } = opts\n const {\n maxRetries,\n minTimeout,\n maxTimeout,\n timeoutFactor,\n statusCodes,\n errorCodes,\n methods\n } = retryOptions\n const { counter } = state\n\n // Any code that is not a Undici's originated and allowed to retry\n if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) {\n cb(err)\n return\n }\n\n // If a set of method are provided and the current method is not in the list\n if (Array.isArray(methods) && !methods.includes(method)) {\n cb(err)\n return\n }\n\n // If a set of status code are provided and the current status code is not in the list\n if (\n statusCode != null &&\n Array.isArray(statusCodes) &&\n !statusCodes.includes(statusCode)\n ) {\n cb(err)\n return\n }\n\n // If we reached the max number of retries\n if (counter > maxRetries) {\n cb(err)\n return\n }\n\n let retryAfterHeader = headers?.['retry-after']\n if (retryAfterHeader) {\n retryAfterHeader = Number(retryAfterHeader)\n retryAfterHeader = Number.isNaN(retryAfterHeader)\n ? calculateRetryAfterHeader(retryAfterHeader)\n : retryAfterHeader * 1e3 // Retry-After is in seconds\n }\n\n const retryTimeout =\n retryAfterHeader > 0\n ? Math.min(retryAfterHeader, maxTimeout)\n : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)\n\n setTimeout(() => cb(null), retryTimeout)\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const headers = parseHeaders(rawHeaders)\n\n this.retryCount += 1\n\n if (statusCode >= 300) {\n if (this.retryOpts.statusCodes.includes(statusCode) === false) {\n return this.handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n } else {\n this.abort(\n new RequestRetryError('Request failed', statusCode, {\n headers,\n data: {\n count: this.retryCount\n }\n })\n )\n return false\n }\n }\n\n // Checkpoint for resume from where we left it\n if (this.resume != null) {\n this.resume = null\n\n // Only Partial Content 206 supposed to provide Content-Range,\n // any other status code that partially consumed the payload\n // should not be retry because it would result in downstream\n // wrongly concatanete multiple responses.\n if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {\n this.abort(\n new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n )\n return false\n }\n\n const contentRange = parseRangeHeader(headers['content-range'])\n // If no content range\n if (!contentRange) {\n this.abort(\n new RequestRetryError('Content-Range mismatch', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n )\n return false\n }\n\n // Let's start with a weak etag check\n if (this.etag != null && this.etag !== headers.etag) {\n this.abort(\n new RequestRetryError('ETag mismatch', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n )\n return false\n }\n\n const { start, size, end = size - 1 } = contentRange\n\n assert(this.start === start, 'content-range mismatch')\n assert(this.end == null || this.end === end, 'content-range mismatch')\n\n this.resume = resume\n return true\n }\n\n if (this.end == null) {\n if (statusCode === 206) {\n // First time we receive 206\n const range = parseRangeHeader(headers['content-range'])\n\n if (range == null) {\n return this.handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n }\n\n const { start, size, end = size - 1 } = range\n assert(\n start != null && Number.isFinite(start),\n 'content-range mismatch'\n )\n assert(end != null && Number.isFinite(end), 'invalid content-length')\n\n this.start = start\n this.end = end\n }\n\n // We make our best to checkpoint the body for further range headers\n if (this.end == null) {\n const contentLength = headers['content-length']\n this.end = contentLength != null ? Number(contentLength) - 1 : null\n }\n\n assert(Number.isFinite(this.start))\n assert(\n this.end == null || Number.isFinite(this.end),\n 'invalid content-length'\n )\n\n this.resume = resume\n this.etag = headers.etag != null ? headers.etag : null\n\n // Weak etags are not useful for comparison nor cache\n // for instance not safe to assume if the response is byte-per-byte\n // equal\n if (this.etag != null && this.etag.startsWith('W/')) {\n this.etag = null\n }\n\n return this.handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n }\n\n const err = new RequestRetryError('Request failed', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n\n this.abort(err)\n\n return false\n }\n\n onData (chunk) {\n this.start += chunk.length\n\n return this.handler.onData(chunk)\n }\n\n onComplete (rawTrailers) {\n this.retryCount = 0\n return this.handler.onComplete(rawTrailers)\n }\n\n onError (err) {\n if (this.aborted || isDisturbed(this.opts.body)) {\n return this.handler.onError(err)\n }\n\n // We reconcile in case of a mix between network errors\n // and server error response\n if (this.retryCount - this.retryCountCheckpoint > 0) {\n // We count the difference between the last checkpoint and the current retry count\n this.retryCount =\n this.retryCountCheckpoint +\n (this.retryCount - this.retryCountCheckpoint)\n } else {\n this.retryCount += 1\n }\n\n this.retryOpts.retry(\n err,\n {\n state: { counter: this.retryCount },\n opts: { retryOptions: this.retryOpts, ...this.opts }\n },\n onRetry.bind(this)\n )\n\n function onRetry (err) {\n if (err != null || this.aborted || isDisturbed(this.opts.body)) {\n return this.handler.onError(err)\n }\n\n if (this.start !== 0) {\n const headers = { range: `bytes=${this.start}-${this.end ?? ''}` }\n\n // Weak etag check - weak etags will make comparison algorithms never match\n if (this.etag != null) {\n headers['if-match'] = this.etag\n }\n\n this.opts = {\n ...this.opts,\n headers: {\n ...this.opts.headers,\n ...headers\n }\n }\n }\n\n try {\n this.retryCountCheckpoint = this.retryCount\n this.dispatch(this.opts, this)\n } catch (err) {\n this.handler.onError(err)\n }\n }\n }\n}\n\nmodule.exports = RetryHandler\n","'use strict'\nconst { isIP } = require('node:net')\nconst { lookup } = require('node:dns')\nconst DecoratorHandler = require('../handler/decorator-handler')\nconst { InvalidArgumentError, InformationalError } = require('../core/errors')\nconst maxInt = Math.pow(2, 31) - 1\n\nclass DNSInstance {\n #maxTTL = 0\n #maxItems = 0\n #records = new Map()\n dualStack = true\n affinity = null\n lookup = null\n pick = null\n\n constructor (opts) {\n this.#maxTTL = opts.maxTTL\n this.#maxItems = opts.maxItems\n this.dualStack = opts.dualStack\n this.affinity = opts.affinity\n this.lookup = opts.lookup ?? this.#defaultLookup\n this.pick = opts.pick ?? this.#defaultPick\n }\n\n get full () {\n return this.#records.size === this.#maxItems\n }\n\n runLookup (origin, opts, cb) {\n const ips = this.#records.get(origin.hostname)\n\n // If full, we just return the origin\n if (ips == null && this.full) {\n cb(null, origin.origin)\n return\n }\n\n const newOpts = {\n affinity: this.affinity,\n dualStack: this.dualStack,\n lookup: this.lookup,\n pick: this.pick,\n ...opts.dns,\n maxTTL: this.#maxTTL,\n maxItems: this.#maxItems\n }\n\n // If no IPs we lookup\n if (ips == null) {\n this.lookup(origin, newOpts, (err, addresses) => {\n if (err || addresses == null || addresses.length === 0) {\n cb(err ?? new InformationalError('No DNS entries found'))\n return\n }\n\n this.setRecords(origin, addresses)\n const records = this.#records.get(origin.hostname)\n\n const ip = this.pick(\n origin,\n records,\n newOpts.affinity\n )\n\n let port\n if (typeof ip.port === 'number') {\n port = `:${ip.port}`\n } else if (origin.port !== '') {\n port = `:${origin.port}`\n } else {\n port = ''\n }\n\n cb(\n null,\n `${origin.protocol}//${\n ip.family === 6 ? `[${ip.address}]` : ip.address\n }${port}`\n )\n })\n } else {\n // If there's IPs we pick\n const ip = this.pick(\n origin,\n ips,\n newOpts.affinity\n )\n\n // If no IPs we lookup - deleting old records\n if (ip == null) {\n this.#records.delete(origin.hostname)\n this.runLookup(origin, opts, cb)\n return\n }\n\n let port\n if (typeof ip.port === 'number') {\n port = `:${ip.port}`\n } else if (origin.port !== '') {\n port = `:${origin.port}`\n } else {\n port = ''\n }\n\n cb(\n null,\n `${origin.protocol}//${\n ip.family === 6 ? `[${ip.address}]` : ip.address\n }${port}`\n )\n }\n }\n\n #defaultLookup (origin, opts, cb) {\n lookup(\n origin.hostname,\n {\n all: true,\n family: this.dualStack === false ? this.affinity : 0,\n order: 'ipv4first'\n },\n (err, addresses) => {\n if (err) {\n return cb(err)\n }\n\n const results = new Map()\n\n for (const addr of addresses) {\n // On linux we found duplicates, we attempt to remove them with\n // the latest record\n results.set(`${addr.address}:${addr.family}`, addr)\n }\n\n cb(null, results.values())\n }\n )\n }\n\n #defaultPick (origin, hostnameRecords, affinity) {\n let ip = null\n const { records, offset } = hostnameRecords\n\n let family\n if (this.dualStack) {\n if (affinity == null) {\n // Balance between ip families\n if (offset == null || offset === maxInt) {\n hostnameRecords.offset = 0\n affinity = 4\n } else {\n hostnameRecords.offset++\n affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4\n }\n }\n\n if (records[affinity] != null && records[affinity].ips.length > 0) {\n family = records[affinity]\n } else {\n family = records[affinity === 4 ? 6 : 4]\n }\n } else {\n family = records[affinity]\n }\n\n // If no IPs we return null\n if (family == null || family.ips.length === 0) {\n return ip\n }\n\n if (family.offset == null || family.offset === maxInt) {\n family.offset = 0\n } else {\n family.offset++\n }\n\n const position = family.offset % family.ips.length\n ip = family.ips[position] ?? null\n\n if (ip == null) {\n return ip\n }\n\n if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms\n // We delete expired records\n // It is possible that they have different TTL, so we manage them individually\n family.ips.splice(position, 1)\n return this.pick(origin, hostnameRecords, affinity)\n }\n\n return ip\n }\n\n setRecords (origin, addresses) {\n const timestamp = Date.now()\n const records = { records: { 4: null, 6: null } }\n for (const record of addresses) {\n record.timestamp = timestamp\n if (typeof record.ttl === 'number') {\n // The record TTL is expected to be in ms\n record.ttl = Math.min(record.ttl, this.#maxTTL)\n } else {\n record.ttl = this.#maxTTL\n }\n\n const familyRecords = records.records[record.family] ?? { ips: [] }\n\n familyRecords.ips.push(record)\n records.records[record.family] = familyRecords\n }\n\n this.#records.set(origin.hostname, records)\n }\n\n getHandler (meta, opts) {\n return new DNSDispatchHandler(this, meta, opts)\n }\n}\n\nclass DNSDispatchHandler extends DecoratorHandler {\n #state = null\n #opts = null\n #dispatch = null\n #handler = null\n #origin = null\n\n constructor (state, { origin, handler, dispatch }, opts) {\n super(handler)\n this.#origin = origin\n this.#handler = handler\n this.#opts = { ...opts }\n this.#state = state\n this.#dispatch = dispatch\n }\n\n onError (err) {\n switch (err.code) {\n case 'ETIMEDOUT':\n case 'ECONNREFUSED': {\n if (this.#state.dualStack) {\n // We delete the record and retry\n this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => {\n if (err) {\n return this.#handler.onError(err)\n }\n\n const dispatchOpts = {\n ...this.#opts,\n origin: newOrigin\n }\n\n this.#dispatch(dispatchOpts, this)\n })\n\n // if dual-stack disabled, we error out\n return\n }\n\n this.#handler.onError(err)\n return\n }\n case 'ENOTFOUND':\n this.#state.deleteRecord(this.#origin)\n // eslint-disable-next-line no-fallthrough\n default:\n this.#handler.onError(err)\n break\n }\n }\n}\n\nmodule.exports = interceptorOpts => {\n if (\n interceptorOpts?.maxTTL != null &&\n (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0)\n ) {\n throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number')\n }\n\n if (\n interceptorOpts?.maxItems != null &&\n (typeof interceptorOpts?.maxItems !== 'number' ||\n interceptorOpts?.maxItems < 1)\n ) {\n throw new InvalidArgumentError(\n 'Invalid maxItems. Must be a positive number and greater than zero'\n )\n }\n\n if (\n interceptorOpts?.affinity != null &&\n interceptorOpts?.affinity !== 4 &&\n interceptorOpts?.affinity !== 6\n ) {\n throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6')\n }\n\n if (\n interceptorOpts?.dualStack != null &&\n typeof interceptorOpts?.dualStack !== 'boolean'\n ) {\n throw new InvalidArgumentError('Invalid dualStack. Must be a boolean')\n }\n\n if (\n interceptorOpts?.lookup != null &&\n typeof interceptorOpts?.lookup !== 'function'\n ) {\n throw new InvalidArgumentError('Invalid lookup. Must be a function')\n }\n\n if (\n interceptorOpts?.pick != null &&\n typeof interceptorOpts?.pick !== 'function'\n ) {\n throw new InvalidArgumentError('Invalid pick. Must be a function')\n }\n\n const dualStack = interceptorOpts?.dualStack ?? true\n let affinity\n if (dualStack) {\n affinity = interceptorOpts?.affinity ?? null\n } else {\n affinity = interceptorOpts?.affinity ?? 4\n }\n\n const opts = {\n maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms\n lookup: interceptorOpts?.lookup ?? null,\n pick: interceptorOpts?.pick ?? null,\n dualStack,\n affinity,\n maxItems: interceptorOpts?.maxItems ?? Infinity\n }\n\n const instance = new DNSInstance(opts)\n\n return dispatch => {\n return function dnsInterceptor (origDispatchOpts, handler) {\n const origin =\n origDispatchOpts.origin.constructor === URL\n ? origDispatchOpts.origin\n : new URL(origDispatchOpts.origin)\n\n if (isIP(origin.hostname) !== 0) {\n return dispatch(origDispatchOpts, handler)\n }\n\n instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {\n if (err) {\n return handler.onError(err)\n }\n\n let dispatchOpts = null\n dispatchOpts = {\n ...origDispatchOpts,\n servername: origin.hostname, // For SNI on TLS\n origin: newOrigin,\n headers: {\n host: origin.hostname,\n ...origDispatchOpts.headers\n }\n }\n\n dispatch(\n dispatchOpts,\n instance.getHandler({ origin, dispatch, handler }, origDispatchOpts)\n )\n })\n\n return true\n }\n }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst DecoratorHandler = require('../handler/decorator-handler')\n\nclass DumpHandler extends DecoratorHandler {\n #maxSize = 1024 * 1024\n #abort = null\n #dumped = false\n #aborted = false\n #size = 0\n #reason = null\n #handler = null\n\n constructor ({ maxSize }, handler) {\n super(handler)\n\n if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {\n throw new InvalidArgumentError('maxSize must be a number greater than 0')\n }\n\n this.#maxSize = maxSize ?? this.#maxSize\n this.#handler = handler\n }\n\n onConnect (abort) {\n this.#abort = abort\n\n this.#handler.onConnect(this.#customAbort.bind(this))\n }\n\n #customAbort (reason) {\n this.#aborted = true\n this.#reason = reason\n }\n\n // TODO: will require adjustment after new hooks are out\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const headers = util.parseHeaders(rawHeaders)\n const contentLength = headers['content-length']\n\n if (contentLength != null && contentLength > this.#maxSize) {\n throw new RequestAbortedError(\n `Response size (${contentLength}) larger than maxSize (${\n this.#maxSize\n })`\n )\n }\n\n if (this.#aborted) {\n return true\n }\n\n return this.#handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n }\n\n onError (err) {\n if (this.#dumped) {\n return\n }\n\n err = this.#reason ?? err\n\n this.#handler.onError(err)\n }\n\n onData (chunk) {\n this.#size = this.#size + chunk.length\n\n if (this.#size >= this.#maxSize) {\n this.#dumped = true\n\n if (this.#aborted) {\n this.#handler.onError(this.#reason)\n } else {\n this.#handler.onComplete([])\n }\n }\n\n return true\n }\n\n onComplete (trailers) {\n if (this.#dumped) {\n return\n }\n\n if (this.#aborted) {\n this.#handler.onError(this.reason)\n return\n }\n\n this.#handler.onComplete(trailers)\n }\n}\n\nfunction createDumpInterceptor (\n { maxSize: defaultMaxSize } = {\n maxSize: 1024 * 1024\n }\n) {\n return dispatch => {\n return function Intercept (opts, handler) {\n const { dumpMaxSize = defaultMaxSize } =\n opts\n\n const dumpHandler = new DumpHandler(\n { maxSize: dumpMaxSize },\n handler\n )\n\n return dispatch(opts, dumpHandler)\n }\n }\n}\n\nmodule.exports = createDumpInterceptor\n","'use strict'\n\nconst RedirectHandler = require('../handler/redirect-handler')\n\nfunction createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {\n return (dispatch) => {\n return function Intercept (opts, handler) {\n const { maxRedirections = defaultMaxRedirections } = opts\n\n if (!maxRedirections) {\n return dispatch(opts, handler)\n }\n\n const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)\n opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.\n return dispatch(opts, redirectHandler)\n }\n }\n}\n\nmodule.exports = createRedirectInterceptor\n","'use strict'\nconst RedirectHandler = require('../handler/redirect-handler')\n\nmodule.exports = opts => {\n const globalMaxRedirections = opts?.maxRedirections\n return dispatch => {\n return function redirectInterceptor (opts, handler) {\n const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts\n\n if (!maxRedirections) {\n return dispatch(opts, handler)\n }\n\n const redirectHandler = new RedirectHandler(\n dispatch,\n maxRedirections,\n opts,\n handler\n )\n\n return dispatch(baseOpts, redirectHandler)\n }\n }\n}\n","'use strict'\nconst RetryHandler = require('../handler/retry-handler')\n\nmodule.exports = globalOpts => {\n return dispatch => {\n return function retryInterceptor (opts, handler) {\n return dispatch(\n opts,\n new RetryHandler(\n { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },\n {\n handler,\n dispatch\n }\n )\n )\n }\n }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;\nconst utils_1 = require(\"./utils\");\n// C headers\nvar ERROR;\n(function (ERROR) {\n ERROR[ERROR[\"OK\"] = 0] = \"OK\";\n ERROR[ERROR[\"INTERNAL\"] = 1] = \"INTERNAL\";\n ERROR[ERROR[\"STRICT\"] = 2] = \"STRICT\";\n ERROR[ERROR[\"LF_EXPECTED\"] = 3] = \"LF_EXPECTED\";\n ERROR[ERROR[\"UNEXPECTED_CONTENT_LENGTH\"] = 4] = \"UNEXPECTED_CONTENT_LENGTH\";\n ERROR[ERROR[\"CLOSED_CONNECTION\"] = 5] = \"CLOSED_CONNECTION\";\n ERROR[ERROR[\"INVALID_METHOD\"] = 6] = \"INVALID_METHOD\";\n ERROR[ERROR[\"INVALID_URL\"] = 7] = \"INVALID_URL\";\n ERROR[ERROR[\"INVALID_CONSTANT\"] = 8] = \"INVALID_CONSTANT\";\n ERROR[ERROR[\"INVALID_VERSION\"] = 9] = \"INVALID_VERSION\";\n ERROR[ERROR[\"INVALID_HEADER_TOKEN\"] = 10] = \"INVALID_HEADER_TOKEN\";\n ERROR[ERROR[\"INVALID_CONTENT_LENGTH\"] = 11] = \"INVALID_CONTENT_LENGTH\";\n ERROR[ERROR[\"INVALID_CHUNK_SIZE\"] = 12] = \"INVALID_CHUNK_SIZE\";\n ERROR[ERROR[\"INVALID_STATUS\"] = 13] = \"INVALID_STATUS\";\n ERROR[ERROR[\"INVALID_EOF_STATE\"] = 14] = \"INVALID_EOF_STATE\";\n ERROR[ERROR[\"INVALID_TRANSFER_ENCODING\"] = 15] = \"INVALID_TRANSFER_ENCODING\";\n ERROR[ERROR[\"CB_MESSAGE_BEGIN\"] = 16] = \"CB_MESSAGE_BEGIN\";\n ERROR[ERROR[\"CB_HEADERS_COMPLETE\"] = 17] = \"CB_HEADERS_COMPLETE\";\n ERROR[ERROR[\"CB_MESSAGE_COMPLETE\"] = 18] = \"CB_MESSAGE_COMPLETE\";\n ERROR[ERROR[\"CB_CHUNK_HEADER\"] = 19] = \"CB_CHUNK_HEADER\";\n ERROR[ERROR[\"CB_CHUNK_COMPLETE\"] = 20] = \"CB_CHUNK_COMPLETE\";\n ERROR[ERROR[\"PAUSED\"] = 21] = \"PAUSED\";\n ERROR[ERROR[\"PAUSED_UPGRADE\"] = 22] = \"PAUSED_UPGRADE\";\n ERROR[ERROR[\"PAUSED_H2_UPGRADE\"] = 23] = \"PAUSED_H2_UPGRADE\";\n ERROR[ERROR[\"USER\"] = 24] = \"USER\";\n})(ERROR = exports.ERROR || (exports.ERROR = {}));\nvar TYPE;\n(function (TYPE) {\n TYPE[TYPE[\"BOTH\"] = 0] = \"BOTH\";\n TYPE[TYPE[\"REQUEST\"] = 1] = \"REQUEST\";\n TYPE[TYPE[\"RESPONSE\"] = 2] = \"RESPONSE\";\n})(TYPE = exports.TYPE || (exports.TYPE = {}));\nvar FLAGS;\n(function (FLAGS) {\n FLAGS[FLAGS[\"CONNECTION_KEEP_ALIVE\"] = 1] = \"CONNECTION_KEEP_ALIVE\";\n FLAGS[FLAGS[\"CONNECTION_CLOSE\"] = 2] = \"CONNECTION_CLOSE\";\n FLAGS[FLAGS[\"CONNECTION_UPGRADE\"] = 4] = \"CONNECTION_UPGRADE\";\n FLAGS[FLAGS[\"CHUNKED\"] = 8] = \"CHUNKED\";\n FLAGS[FLAGS[\"UPGRADE\"] = 16] = \"UPGRADE\";\n FLAGS[FLAGS[\"CONTENT_LENGTH\"] = 32] = \"CONTENT_LENGTH\";\n FLAGS[FLAGS[\"SKIPBODY\"] = 64] = \"SKIPBODY\";\n FLAGS[FLAGS[\"TRAILING\"] = 128] = \"TRAILING\";\n // 1 << 8 is unused\n FLAGS[FLAGS[\"TRANSFER_ENCODING\"] = 512] = \"TRANSFER_ENCODING\";\n})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));\nvar LENIENT_FLAGS;\n(function (LENIENT_FLAGS) {\n LENIENT_FLAGS[LENIENT_FLAGS[\"HEADERS\"] = 1] = \"HEADERS\";\n LENIENT_FLAGS[LENIENT_FLAGS[\"CHUNKED_LENGTH\"] = 2] = \"CHUNKED_LENGTH\";\n LENIENT_FLAGS[LENIENT_FLAGS[\"KEEP_ALIVE\"] = 4] = \"KEEP_ALIVE\";\n})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));\nvar METHODS;\n(function (METHODS) {\n METHODS[METHODS[\"DELETE\"] = 0] = \"DELETE\";\n METHODS[METHODS[\"GET\"] = 1] = \"GET\";\n METHODS[METHODS[\"HEAD\"] = 2] = \"HEAD\";\n METHODS[METHODS[\"POST\"] = 3] = \"POST\";\n METHODS[METHODS[\"PUT\"] = 4] = \"PUT\";\n /* pathological */\n METHODS[METHODS[\"CONNECT\"] = 5] = \"CONNECT\";\n METHODS[METHODS[\"OPTIONS\"] = 6] = \"OPTIONS\";\n METHODS[METHODS[\"TRACE\"] = 7] = \"TRACE\";\n /* WebDAV */\n METHODS[METHODS[\"COPY\"] = 8] = \"COPY\";\n METHODS[METHODS[\"LOCK\"] = 9] = \"LOCK\";\n METHODS[METHODS[\"MKCOL\"] = 10] = \"MKCOL\";\n METHODS[METHODS[\"MOVE\"] = 11] = \"MOVE\";\n METHODS[METHODS[\"PROPFIND\"] = 12] = \"PROPFIND\";\n METHODS[METHODS[\"PROPPATCH\"] = 13] = \"PROPPATCH\";\n METHODS[METHODS[\"SEARCH\"] = 14] = \"SEARCH\";\n METHODS[METHODS[\"UNLOCK\"] = 15] = \"UNLOCK\";\n METHODS[METHODS[\"BIND\"] = 16] = \"BIND\";\n METHODS[METHODS[\"REBIND\"] = 17] = \"REBIND\";\n METHODS[METHODS[\"UNBIND\"] = 18] = \"UNBIND\";\n METHODS[METHODS[\"ACL\"] = 19] = \"ACL\";\n /* subversion */\n METHODS[METHODS[\"REPORT\"] = 20] = \"REPORT\";\n METHODS[METHODS[\"MKACTIVITY\"] = 21] = \"MKACTIVITY\";\n METHODS[METHODS[\"CHECKOUT\"] = 22] = \"CHECKOUT\";\n METHODS[METHODS[\"MERGE\"] = 23] = \"MERGE\";\n /* upnp */\n METHODS[METHODS[\"M-SEARCH\"] = 24] = \"M-SEARCH\";\n METHODS[METHODS[\"NOTIFY\"] = 25] = \"NOTIFY\";\n METHODS[METHODS[\"SUBSCRIBE\"] = 26] = \"SUBSCRIBE\";\n METHODS[METHODS[\"UNSUBSCRIBE\"] = 27] = \"UNSUBSCRIBE\";\n /* RFC-5789 */\n METHODS[METHODS[\"PATCH\"] = 28] = \"PATCH\";\n METHODS[METHODS[\"PURGE\"] = 29] = \"PURGE\";\n /* CalDAV */\n METHODS[METHODS[\"MKCALENDAR\"] = 30] = \"MKCALENDAR\";\n /* RFC-2068, section 19.6.1.2 */\n METHODS[METHODS[\"LINK\"] = 31] = \"LINK\";\n METHODS[METHODS[\"UNLINK\"] = 32] = \"UNLINK\";\n /* icecast */\n METHODS[METHODS[\"SOURCE\"] = 33] = \"SOURCE\";\n /* RFC-7540, section 11.6 */\n METHODS[METHODS[\"PRI\"] = 34] = \"PRI\";\n /* RFC-2326 RTSP */\n METHODS[METHODS[\"DESCRIBE\"] = 35] = \"DESCRIBE\";\n METHODS[METHODS[\"ANNOUNCE\"] = 36] = \"ANNOUNCE\";\n METHODS[METHODS[\"SETUP\"] = 37] = \"SETUP\";\n METHODS[METHODS[\"PLAY\"] = 38] = \"PLAY\";\n METHODS[METHODS[\"PAUSE\"] = 39] = \"PAUSE\";\n METHODS[METHODS[\"TEARDOWN\"] = 40] = \"TEARDOWN\";\n METHODS[METHODS[\"GET_PARAMETER\"] = 41] = \"GET_PARAMETER\";\n METHODS[METHODS[\"SET_PARAMETER\"] = 42] = \"SET_PARAMETER\";\n METHODS[METHODS[\"REDIRECT\"] = 43] = \"REDIRECT\";\n METHODS[METHODS[\"RECORD\"] = 44] = \"RECORD\";\n /* RAOP */\n METHODS[METHODS[\"FLUSH\"] = 45] = \"FLUSH\";\n})(METHODS = exports.METHODS || (exports.METHODS = {}));\nexports.METHODS_HTTP = [\n METHODS.DELETE,\n METHODS.GET,\n METHODS.HEAD,\n METHODS.POST,\n METHODS.PUT,\n METHODS.CONNECT,\n METHODS.OPTIONS,\n METHODS.TRACE,\n METHODS.COPY,\n METHODS.LOCK,\n METHODS.MKCOL,\n METHODS.MOVE,\n METHODS.PROPFIND,\n METHODS.PROPPATCH,\n METHODS.SEARCH,\n METHODS.UNLOCK,\n METHODS.BIND,\n METHODS.REBIND,\n METHODS.UNBIND,\n METHODS.ACL,\n METHODS.REPORT,\n METHODS.MKACTIVITY,\n METHODS.CHECKOUT,\n METHODS.MERGE,\n METHODS['M-SEARCH'],\n METHODS.NOTIFY,\n METHODS.SUBSCRIBE,\n METHODS.UNSUBSCRIBE,\n METHODS.PATCH,\n METHODS.PURGE,\n METHODS.MKCALENDAR,\n METHODS.LINK,\n METHODS.UNLINK,\n METHODS.PRI,\n // TODO(indutny): should we allow it with HTTP?\n METHODS.SOURCE,\n];\nexports.METHODS_ICE = [\n METHODS.SOURCE,\n];\nexports.METHODS_RTSP = [\n METHODS.OPTIONS,\n METHODS.DESCRIBE,\n METHODS.ANNOUNCE,\n METHODS.SETUP,\n METHODS.PLAY,\n METHODS.PAUSE,\n METHODS.TEARDOWN,\n METHODS.GET_PARAMETER,\n METHODS.SET_PARAMETER,\n METHODS.REDIRECT,\n METHODS.RECORD,\n METHODS.FLUSH,\n // For AirPlay\n METHODS.GET,\n METHODS.POST,\n];\nexports.METHOD_MAP = utils_1.enumToMap(METHODS);\nexports.H_METHOD_MAP = {};\nObject.keys(exports.METHOD_MAP).forEach((key) => {\n if (/^H/.test(key)) {\n exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];\n }\n});\nvar FINISH;\n(function (FINISH) {\n FINISH[FINISH[\"SAFE\"] = 0] = \"SAFE\";\n FINISH[FINISH[\"SAFE_WITH_CB\"] = 1] = \"SAFE_WITH_CB\";\n FINISH[FINISH[\"UNSAFE\"] = 2] = \"UNSAFE\";\n})(FINISH = exports.FINISH || (exports.FINISH = {}));\nexports.ALPHA = [];\nfor (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {\n // Upper case\n exports.ALPHA.push(String.fromCharCode(i));\n // Lower case\n exports.ALPHA.push(String.fromCharCode(i + 0x20));\n}\nexports.NUM_MAP = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n};\nexports.HEX_MAP = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,\n a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,\n};\nexports.NUM = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n];\nexports.ALPHANUM = exports.ALPHA.concat(exports.NUM);\nexports.MARK = ['-', '_', '.', '!', '~', '*', '\\'', '(', ')'];\nexports.USERINFO_CHARS = exports.ALPHANUM\n .concat(exports.MARK)\n .concat(['%', ';', ':', '&', '=', '+', '$', ',']);\n// TODO(indutny): use RFC\nexports.STRICT_URL_CHAR = [\n '!', '\"', '$', '%', '&', '\\'',\n '(', ')', '*', '+', ',', '-', '.', '/',\n ':', ';', '<', '=', '>',\n '@', '[', '\\\\', ']', '^', '_',\n '`',\n '{', '|', '}', '~',\n].concat(exports.ALPHANUM);\nexports.URL_CHAR = exports.STRICT_URL_CHAR\n .concat(['\\t', '\\f']);\n// All characters with 0x80 bit set to 1\nfor (let i = 0x80; i <= 0xff; i++) {\n exports.URL_CHAR.push(i);\n}\nexports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);\n/* Tokens as defined by rfc 2616. Also lowercases them.\n * token = 1*\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n */\nexports.STRICT_TOKEN = [\n '!', '#', '$', '%', '&', '\\'',\n '*', '+', '-', '.',\n '^', '_', '`',\n '|', '~',\n].concat(exports.ALPHANUM);\nexports.TOKEN = exports.STRICT_TOKEN.concat([' ']);\n/*\n * Verify that a char is a valid visible (printable) US-ASCII\n * character or %x80-FF\n */\nexports.HEADER_CHARS = ['\\t'];\nfor (let i = 32; i <= 255; i++) {\n if (i !== 127) {\n exports.HEADER_CHARS.push(i);\n }\n}\n// ',' = \\x44\nexports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);\nexports.MAJOR = exports.NUM_MAP;\nexports.MINOR = exports.MAJOR;\nvar HEADER_STATE;\n(function (HEADER_STATE) {\n HEADER_STATE[HEADER_STATE[\"GENERAL\"] = 0] = \"GENERAL\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION\"] = 1] = \"CONNECTION\";\n HEADER_STATE[HEADER_STATE[\"CONTENT_LENGTH\"] = 2] = \"CONTENT_LENGTH\";\n HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING\"] = 3] = \"TRANSFER_ENCODING\";\n HEADER_STATE[HEADER_STATE[\"UPGRADE\"] = 4] = \"UPGRADE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_KEEP_ALIVE\"] = 5] = \"CONNECTION_KEEP_ALIVE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_CLOSE\"] = 6] = \"CONNECTION_CLOSE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_UPGRADE\"] = 7] = \"CONNECTION_UPGRADE\";\n HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING_CHUNKED\"] = 8] = \"TRANSFER_ENCODING_CHUNKED\";\n})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));\nexports.SPECIAL_HEADERS = {\n 'connection': HEADER_STATE.CONNECTION,\n 'content-length': HEADER_STATE.CONTENT_LENGTH,\n 'proxy-connection': HEADER_STATE.CONNECTION,\n 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,\n 'upgrade': HEADER_STATE.UPGRADE,\n};\n//# sourceMappingURL=constants.js.map","'use strict'\n\nconst { Buffer } = require('node:buffer')\n\nmodule.exports = Buffer.from('AGFzbQEAA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ohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAk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kACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNk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EDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIAB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gAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiA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gIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQA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AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODx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qKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCAC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QfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64')\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enumToMap = void 0;\nfunction enumToMap(obj) {\n const res = {};\n Object.keys(obj).forEach((key) => {\n const value = obj[key];\n if (typeof value === 'number') {\n res[key] = value;\n }\n });\n return res;\n}\nexports.enumToMap = enumToMap;\n//# sourceMappingURL=utils.js.map","'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../dispatcher/agent')\nconst {\n kAgent,\n kMockAgentSet,\n kMockAgentGet,\n kDispatches,\n kIsMockActive,\n kNetConnect,\n kGetNetConnect,\n kOptions,\n kFactory\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, buildMockOptions } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher/dispatcher')\nconst Pluralizer = require('./pluralizer')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\n\nclass MockAgent extends Dispatcher {\n constructor (opts) {\n super(opts)\n\n this[kNetConnect] = true\n this[kIsMockActive] = true\n\n // Instantiate Agent and encapsulate\n if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n const agent = opts?.agent ? opts.agent : new Agent(opts)\n this[kAgent] = agent\n\n this[kClients] = agent[kClients]\n this[kOptions] = buildMockOptions(opts)\n }\n\n get (origin) {\n let dispatcher = this[kMockAgentGet](origin)\n\n if (!dispatcher) {\n dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n }\n return dispatcher\n }\n\n dispatch (opts, handler) {\n // Call MockAgent.get to perform additional setup before dispatching as normal\n this.get(opts.origin)\n return this[kAgent].dispatch(opts, handler)\n }\n\n async close () {\n await this[kAgent].close()\n this[kClients].clear()\n }\n\n deactivate () {\n this[kIsMockActive] = false\n }\n\n activate () {\n this[kIsMockActive] = true\n }\n\n enableNetConnect (matcher) {\n if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n if (Array.isArray(this[kNetConnect])) {\n this[kNetConnect].push(matcher)\n } else {\n this[kNetConnect] = [matcher]\n }\n } else if (typeof matcher === 'undefined') {\n this[kNetConnect] = true\n } else {\n throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n }\n }\n\n disableNetConnect () {\n this[kNetConnect] = false\n }\n\n // This is required to bypass issues caused by using global symbols - see:\n // https://github.com/nodejs/undici/issues/1447\n get isMockActive () {\n return this[kIsMockActive]\n }\n\n [kMockAgentSet] (origin, dispatcher) {\n this[kClients].set(origin, dispatcher)\n }\n\n [kFactory] (origin) {\n const mockOptions = Object.assign({ agent: this }, this[kOptions])\n return this[kOptions] && this[kOptions].connections === 1\n ? new MockClient(origin, mockOptions)\n : new MockPool(origin, mockOptions)\n }\n\n [kMockAgentGet] (origin) {\n // First check if we can immediately find it\n const client = this[kClients].get(origin)\n if (client) {\n return client\n }\n\n // If the origin is not a string create a dummy parent pool and return to user\n if (typeof origin !== 'string') {\n const dispatcher = this[kFactory]('http://localhost:9999')\n this[kMockAgentSet](origin, dispatcher)\n return dispatcher\n }\n\n // If we match, create a pool and assign the same dispatches\n for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) {\n if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n const dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]\n return dispatcher\n }\n }\n }\n\n [kGetNetConnect] () {\n return this[kNetConnect]\n }\n\n pendingInterceptors () {\n const mockAgentClients = this[kClients]\n\n return Array.from(mockAgentClients.entries())\n .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n .filter(({ pending }) => pending)\n }\n\n assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n const pending = this.pendingInterceptors()\n\n if (pending.length === 0) {\n return\n }\n\n const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)\n\n throw new UndiciError(`\n${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:\n\n${pendingInterceptorsFormatter.format(pending)}\n`.trim())\n }\n}\n\nmodule.exports = MockAgent\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Client = require('../dispatcher/client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n constructor (origin, opts) {\n super(origin, opts)\n\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(opts, this[kDispatches])\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockClient\n","'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nconst kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')\n\n/**\n * The request does not match any registered mock dispatches.\n */\nclass MockNotMatchedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, MockNotMatchedError)\n this.name = 'MockNotMatchedError'\n this.message = message || 'The request does not match any registered mock dispatches'\n this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kMockNotMatchedError] === true\n }\n\n [kMockNotMatchedError] = true\n}\n\nmodule.exports = {\n MockNotMatchedError\n}\n","'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kDispatchKey,\n kDefaultHeaders,\n kDefaultTrailers,\n kContentLength,\n kMockDispatch\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { buildURL } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n constructor (mockDispatch) {\n this[kMockDispatch] = mockDispatch\n }\n\n /**\n * Delay a reply by a set amount in ms.\n */\n delay (waitInMs) {\n if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n }\n\n this[kMockDispatch].delay = waitInMs\n return this\n }\n\n /**\n * For a defined reply, never mark as consumed.\n */\n persist () {\n this[kMockDispatch].persist = true\n return this\n }\n\n /**\n * Allow one to define a reply for a set amount of matching requests.\n */\n times (repeatTimes) {\n if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n }\n\n this[kMockDispatch].times = repeatTimes\n return this\n }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n constructor (opts, mockDispatches) {\n if (typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object')\n }\n if (typeof opts.path === 'undefined') {\n throw new InvalidArgumentError('opts.path must be defined')\n }\n if (typeof opts.method === 'undefined') {\n opts.method = 'GET'\n }\n // See https://github.com/nodejs/undici/issues/1245\n // As per RFC 3986, clients are not supposed to send URI\n // fragments to servers when they retrieve a document,\n if (typeof opts.path === 'string') {\n if (opts.query) {\n opts.path = buildURL(opts.path, opts.query)\n } else {\n // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811\n const parsedURL = new URL(opts.path, 'data://')\n opts.path = parsedURL.pathname + parsedURL.search\n }\n }\n if (typeof opts.method === 'string') {\n opts.method = opts.method.toUpperCase()\n }\n\n this[kDispatchKey] = buildKey(opts)\n this[kDispatches] = mockDispatches\n this[kDefaultHeaders] = {}\n this[kDefaultTrailers] = {}\n this[kContentLength] = false\n }\n\n createMockScopeDispatchData ({ statusCode, data, responseOptions }) {\n const responseData = getResponseData(data)\n const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n return { statusCode, data, headers, trailers }\n }\n\n validateReplyParameters (replyParameters) {\n if (typeof replyParameters.statusCode === 'undefined') {\n throw new InvalidArgumentError('statusCode must be defined')\n }\n if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) {\n throw new InvalidArgumentError('responseOptions must be an object')\n }\n }\n\n /**\n * Mock an undici request with a defined reply.\n */\n reply (replyOptionsCallbackOrStatusCode) {\n // Values of reply aren't available right now as they\n // can only be available when the reply callback is invoked.\n if (typeof replyOptionsCallbackOrStatusCode === 'function') {\n // We'll first wrap the provided callback in another function,\n // this function will properly resolve the data from the callback\n // when invoked.\n const wrappedDefaultsCallback = (opts) => {\n // Our reply options callback contains the parameter for statusCode, data and options.\n const resolvedData = replyOptionsCallbackOrStatusCode(opts)\n\n // Check if it is in the right format\n if (typeof resolvedData !== 'object' || resolvedData === null) {\n throw new InvalidArgumentError('reply options callback must return an object')\n }\n\n const replyParameters = { data: '', responseOptions: {}, ...resolvedData }\n this.validateReplyParameters(replyParameters)\n // Since the values can be obtained immediately we return them\n // from this higher order function that will be resolved later.\n return {\n ...this.createMockScopeDispatchData(replyParameters)\n }\n }\n\n // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)\n return new MockScope(newMockDispatch)\n }\n\n // We can have either one or three parameters, if we get here,\n // we should have 1-3 parameters. So we spread the arguments of\n // this function to obtain the parameters, since replyData will always\n // just be the statusCode.\n const replyParameters = {\n statusCode: replyOptionsCallbackOrStatusCode,\n data: arguments[1] === undefined ? '' : arguments[1],\n responseOptions: arguments[2] === undefined ? {} : arguments[2]\n }\n this.validateReplyParameters(replyParameters)\n\n // Send in-already provided data like usual\n const dispatchData = this.createMockScopeDispatchData(replyParameters)\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Mock an undici request with a defined error.\n */\n replyWithError (error) {\n if (typeof error === 'undefined') {\n throw new InvalidArgumentError('error must be defined')\n }\n\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Set default reply headers on the interceptor for subsequent replies\n */\n defaultReplyHeaders (headers) {\n if (typeof headers === 'undefined') {\n throw new InvalidArgumentError('headers must be defined')\n }\n\n this[kDefaultHeaders] = headers\n return this\n }\n\n /**\n * Set default reply trailers on the interceptor for subsequent replies\n */\n defaultReplyTrailers (trailers) {\n if (typeof trailers === 'undefined') {\n throw new InvalidArgumentError('trailers must be defined')\n }\n\n this[kDefaultTrailers] = trailers\n return this\n }\n\n /**\n * Set reply content length header for replies on the interceptor\n */\n replyContentLength () {\n this[kContentLength] = true\n return this\n }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Pool = require('../dispatcher/pool')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockPool provides an API that extends the Pool to influence the mockDispatches.\n */\nclass MockPool extends Pool {\n constructor (origin, opts) {\n super(origin, opts)\n\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(opts, this[kDispatches])\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockPool\n","'use strict'\n\nmodule.exports = {\n kAgent: Symbol('agent'),\n kOptions: Symbol('options'),\n kFactory: Symbol('factory'),\n kDispatches: Symbol('dispatches'),\n kDispatchKey: Symbol('dispatch key'),\n kDefaultHeaders: Symbol('default headers'),\n kDefaultTrailers: Symbol('default trailers'),\n kContentLength: Symbol('content length'),\n kMockAgent: Symbol('mock agent'),\n kMockAgentSet: Symbol('mock agent set'),\n kMockAgentGet: Symbol('mock agent get'),\n kMockDispatch: Symbol('mock dispatch'),\n kClose: Symbol('close'),\n kOriginalClose: Symbol('original agent close'),\n kOrigin: Symbol('origin'),\n kIsMockActive: Symbol('is mock active'),\n kNetConnect: Symbol('net connect'),\n kGetNetConnect: Symbol('get net connect'),\n kConnected: Symbol('connected')\n}\n","'use strict'\n\nconst { MockNotMatchedError } = require('./mock-errors')\nconst {\n kDispatches,\n kMockAgent,\n kOriginalDispatch,\n kOrigin,\n kGetNetConnect\n} = require('./mock-symbols')\nconst { buildURL } = require('../core/util')\nconst { STATUS_CODES } = require('node:http')\nconst {\n types: {\n isPromise\n }\n} = require('node:util')\n\nfunction matchValue (match, value) {\n if (typeof match === 'string') {\n return match === value\n }\n if (match instanceof RegExp) {\n return match.test(value)\n }\n if (typeof match === 'function') {\n return match(value) === true\n }\n return false\n}\n\nfunction lowerCaseEntries (headers) {\n return Object.fromEntries(\n Object.entries(headers).map(([headerName, headerValue]) => {\n return [headerName.toLocaleLowerCase(), headerValue]\n })\n )\n}\n\n/**\n * @param {import('../../index').Headers|string[]|Record} headers\n * @param {string} key\n */\nfunction getHeaderByName (headers, key) {\n if (Array.isArray(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {\n return headers[i + 1]\n }\n }\n\n return undefined\n } else if (typeof headers.get === 'function') {\n return headers.get(key)\n } else {\n return lowerCaseEntries(headers)[key.toLocaleLowerCase()]\n }\n}\n\n/** @param {string[]} headers */\nfunction buildHeadersFromArray (headers) { // fetch HeadersList\n const clone = headers.slice()\n const entries = []\n for (let index = 0; index < clone.length; index += 2) {\n entries.push([clone[index], clone[index + 1]])\n }\n return Object.fromEntries(entries)\n}\n\nfunction matchHeaders (mockDispatch, headers) {\n if (typeof mockDispatch.headers === 'function') {\n if (Array.isArray(headers)) { // fetch HeadersList\n headers = buildHeadersFromArray(headers)\n }\n return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})\n }\n if (typeof mockDispatch.headers === 'undefined') {\n return true\n }\n if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {\n return false\n }\n\n for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {\n const headerValue = getHeaderByName(headers, matchHeaderName)\n\n if (!matchValue(matchHeaderValue, headerValue)) {\n return false\n }\n }\n return true\n}\n\nfunction safeUrl (path) {\n if (typeof path !== 'string') {\n return path\n }\n\n const pathSegments = path.split('?')\n\n if (pathSegments.length !== 2) {\n return path\n }\n\n const qp = new URLSearchParams(pathSegments.pop())\n qp.sort()\n return [...pathSegments, qp.toString()].join('?')\n}\n\nfunction matchKey (mockDispatch, { path, method, body, headers }) {\n const pathMatch = matchValue(mockDispatch.path, path)\n const methodMatch = matchValue(mockDispatch.method, method)\n const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true\n const headersMatch = matchHeaders(mockDispatch, headers)\n return pathMatch && methodMatch && bodyMatch && headersMatch\n}\n\nfunction getResponseData (data) {\n if (Buffer.isBuffer(data)) {\n return data\n } else if (data instanceof Uint8Array) {\n return data\n } else if (data instanceof ArrayBuffer) {\n return data\n } else if (typeof data === 'object') {\n return JSON.stringify(data)\n } else {\n return data.toString()\n }\n}\n\nfunction getMockDispatch (mockDispatches, key) {\n const basePath = key.query ? buildURL(key.path, key.query) : key.path\n const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath\n\n // Match path\n let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)\n }\n\n // Match method\n matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)\n }\n\n // Match body\n matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)\n }\n\n // Match headers\n matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))\n if (matchedMockDispatches.length === 0) {\n const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers\n throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)\n }\n\n return matchedMockDispatches[0]\n}\n\nfunction addMockDispatch (mockDispatches, key, data) {\n const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }\n const replyData = typeof data === 'function' ? { callback: data } : { ...data }\n const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }\n mockDispatches.push(newMockDispatch)\n return newMockDispatch\n}\n\nfunction deleteMockDispatch (mockDispatches, key) {\n const index = mockDispatches.findIndex(dispatch => {\n if (!dispatch.consumed) {\n return false\n }\n return matchKey(dispatch, key)\n })\n if (index !== -1) {\n mockDispatches.splice(index, 1)\n }\n}\n\nfunction buildKey (opts) {\n const { path, method, body, headers, query } = opts\n return {\n path,\n method,\n body,\n headers,\n query\n }\n}\n\nfunction generateKeyValues (data) {\n const keys = Object.keys(data)\n const result = []\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n const value = data[key]\n const name = Buffer.from(`${key}`)\n if (Array.isArray(value)) {\n for (let j = 0; j < value.length; ++j) {\n result.push(name, Buffer.from(`${value[j]}`))\n }\n } else {\n result.push(name, Buffer.from(`${value}`))\n }\n }\n return result\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n * @param {number} statusCode\n */\nfunction getStatusText (statusCode) {\n return STATUS_CODES[statusCode] || 'unknown'\n}\n\nasync function getResponse (body) {\n const buffers = []\n for await (const data of body) {\n buffers.push(data)\n }\n return Buffer.concat(buffers).toString('utf8')\n}\n\n/**\n * Mock dispatch function used to simulate undici dispatches\n */\nfunction mockDispatch (opts, handler) {\n // Get mock dispatch from built key\n const key = buildKey(opts)\n const mockDispatch = getMockDispatch(this[kDispatches], key)\n\n mockDispatch.timesInvoked++\n\n // Here's where we resolve a callback if a callback is present for the dispatch data.\n if (mockDispatch.data.callback) {\n mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }\n }\n\n // Parse mockDispatch data\n const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch\n const { timesInvoked, times } = mockDispatch\n\n // If it's used up and not persistent, mark as consumed\n mockDispatch.consumed = !persist && timesInvoked >= times\n mockDispatch.pending = timesInvoked < times\n\n // If specified, trigger dispatch error\n if (error !== null) {\n deleteMockDispatch(this[kDispatches], key)\n handler.onError(error)\n return true\n }\n\n // Handle the request with a delay if necessary\n if (typeof delay === 'number' && delay > 0) {\n setTimeout(() => {\n handleReply(this[kDispatches])\n }, delay)\n } else {\n handleReply(this[kDispatches])\n }\n\n function handleReply (mockDispatches, _data = data) {\n // fetch's HeadersList is a 1D string array\n const optsHeaders = Array.isArray(opts.headers)\n ? buildHeadersFromArray(opts.headers)\n : opts.headers\n const body = typeof _data === 'function'\n ? _data({ ...opts, headers: optsHeaders })\n : _data\n\n // util.types.isPromise is likely needed for jest.\n if (isPromise(body)) {\n // If handleReply is asynchronous, throwing an error\n // in the callback will reject the promise, rather than\n // synchronously throw the error, which breaks some tests.\n // Rather, we wait for the callback to resolve if it is a\n // promise, and then re-run handleReply with the new body.\n body.then((newData) => handleReply(mockDispatches, newData))\n return\n }\n\n const responseData = getResponseData(body)\n const responseHeaders = generateKeyValues(headers)\n const responseTrailers = generateKeyValues(trailers)\n\n handler.onConnect?.(err => handler.onError(err), null)\n handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))\n handler.onData?.(Buffer.from(responseData))\n handler.onComplete?.(responseTrailers)\n deleteMockDispatch(mockDispatches, key)\n }\n\n function resume () {}\n\n return true\n}\n\nfunction buildMockDispatch () {\n const agent = this[kMockAgent]\n const origin = this[kOrigin]\n const originalDispatch = this[kOriginalDispatch]\n\n return function dispatch (opts, handler) {\n if (agent.isMockActive) {\n try {\n mockDispatch.call(this, opts, handler)\n } catch (error) {\n if (error instanceof MockNotMatchedError) {\n const netConnect = agent[kGetNetConnect]()\n if (netConnect === false) {\n throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)\n }\n if (checkNetConnect(netConnect, origin)) {\n originalDispatch.call(this, opts, handler)\n } else {\n throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)\n }\n } else {\n throw error\n }\n }\n } else {\n originalDispatch.call(this, opts, handler)\n }\n }\n}\n\nfunction checkNetConnect (netConnect, origin) {\n const url = new URL(origin)\n if (netConnect === true) {\n return true\n } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {\n return true\n }\n return false\n}\n\nfunction buildMockOptions (opts) {\n if (opts) {\n const { agent, ...mockOptions } = opts\n return mockOptions\n }\n}\n\nmodule.exports = {\n getResponseData,\n getMockDispatch,\n addMockDispatch,\n deleteMockDispatch,\n buildKey,\n generateKeyValues,\n matchValue,\n getResponse,\n getStatusText,\n mockDispatch,\n buildMockDispatch,\n checkNetConnect,\n buildMockOptions,\n getHeaderByName,\n buildHeadersFromArray\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst { Console } = require('node:console')\n\nconst PERSISTENT = process.versions.icu ? '✅' : 'Y '\nconst NOT_PERSISTENT = process.versions.icu ? '❌' : 'N '\n\n/**\n * Gets the output of `console.table(…)` as a string.\n */\nmodule.exports = class PendingInterceptorsFormatter {\n constructor ({ disableColors } = {}) {\n this.transform = new Transform({\n transform (chunk, _enc, cb) {\n cb(null, chunk)\n }\n })\n\n this.logger = new Console({\n stdout: this.transform,\n inspectOptions: {\n colors: !disableColors && !process.env.CI\n }\n })\n }\n\n format (pendingInterceptors) {\n const withPrettyHeaders = pendingInterceptors.map(\n ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({\n Method: method,\n Origin: origin,\n Path: path,\n 'Status code': statusCode,\n Persistent: persist ? PERSISTENT : NOT_PERSISTENT,\n Invocations: timesInvoked,\n Remaining: persist ? Infinity : times - timesInvoked\n }))\n\n this.logger.table(withPrettyHeaders)\n return this.transform.read().toString()\n }\n}\n","'use strict'\n\nconst singulars = {\n pronoun: 'it',\n is: 'is',\n was: 'was',\n this: 'this'\n}\n\nconst plurals = {\n pronoun: 'they',\n is: 'are',\n was: 'were',\n this: 'these'\n}\n\nmodule.exports = class Pluralizer {\n constructor (singular, plural) {\n this.singular = singular\n this.plural = plural\n }\n\n pluralize (count) {\n const one = count === 1\n const keys = one ? singulars : plurals\n const noun = one ? this.singular : this.plural\n return { ...keys, count, noun }\n }\n}\n","'use strict'\n\n/**\n * This module offers an optimized timer implementation designed for scenarios\n * where high precision is not critical.\n *\n * The timer achieves faster performance by using a low-resolution approach,\n * with an accuracy target of within 500ms. This makes it particularly useful\n * for timers with delays of 1 second or more, where exact timing is less\n * crucial.\n *\n * It's important to note that Node.js timers are inherently imprecise, as\n * delays can occur due to the event loop being blocked by other operations.\n * Consequently, timers may trigger later than their scheduled time.\n */\n\n/**\n * The fastNow variable contains the internal fast timer clock value.\n *\n * @type {number}\n */\nlet fastNow = 0\n\n/**\n * RESOLUTION_MS represents the target resolution time in milliseconds.\n *\n * @type {number}\n * @default 1000\n */\nconst RESOLUTION_MS = 1e3\n\n/**\n * TICK_MS defines the desired interval in milliseconds between each tick.\n * The target value is set to half the resolution time, minus 1 ms, to account\n * for potential event loop overhead.\n *\n * @type {number}\n * @default 499\n */\nconst TICK_MS = (RESOLUTION_MS >> 1) - 1\n\n/**\n * fastNowTimeout is a Node.js timer used to manage and process\n * the FastTimers stored in the `fastTimers` array.\n *\n * @type {NodeJS.Timeout}\n */\nlet fastNowTimeout\n\n/**\n * The kFastTimer symbol is used to identify FastTimer instances.\n *\n * @type {Symbol}\n */\nconst kFastTimer = Symbol('kFastTimer')\n\n/**\n * The fastTimers array contains all active FastTimers.\n *\n * @type {FastTimer[]}\n */\nconst fastTimers = []\n\n/**\n * These constants represent the various states of a FastTimer.\n */\n\n/**\n * The `NOT_IN_LIST` constant indicates that the FastTimer is not included\n * in the `fastTimers` array. Timers with this status will not be processed\n * during the next tick by the `onTick` function.\n *\n * A FastTimer can be re-added to the `fastTimers` array by invoking the\n * `refresh` method on the FastTimer instance.\n *\n * @type {-2}\n */\nconst NOT_IN_LIST = -2\n\n/**\n * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled\n * for removal from the `fastTimers` array. A FastTimer in this state will\n * be removed in the next tick by the `onTick` function and will no longer\n * be processed.\n *\n * This status is also set when the `clear` method is called on the FastTimer instance.\n *\n * @type {-1}\n */\nconst TO_BE_CLEARED = -1\n\n/**\n * The `PENDING` constant signifies that the FastTimer is awaiting processing\n * in the next tick by the `onTick` function. Timers with this status will have\n * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick.\n *\n * @type {0}\n */\nconst PENDING = 0\n\n/**\n * The `ACTIVE` constant indicates that the FastTimer is active and waiting\n * for its timer to expire. During the next tick, the `onTick` function will\n * check if the timer has expired, and if so, it will execute the associated callback.\n *\n * @type {1}\n */\nconst ACTIVE = 1\n\n/**\n * The onTick function processes the fastTimers array.\n *\n * @returns {void}\n */\nfunction onTick () {\n /**\n * Increment the fastNow value by the TICK_MS value, despite the actual time\n * that has passed since the last tick. This approach ensures independence\n * from the system clock and delays caused by a blocked event loop.\n *\n * @type {number}\n */\n fastNow += TICK_MS\n\n /**\n * The `idx` variable is used to iterate over the `fastTimers` array.\n * Expired timers are removed by replacing them with the last element in the array.\n * Consequently, `idx` is only incremented when the current element is not removed.\n *\n * @type {number}\n */\n let idx = 0\n\n /**\n * The len variable will contain the length of the fastTimers array\n * and will be decremented when a FastTimer should be removed from the\n * fastTimers array.\n *\n * @type {number}\n */\n let len = fastTimers.length\n\n while (idx < len) {\n /**\n * @type {FastTimer}\n */\n const timer = fastTimers[idx]\n\n // If the timer is in the ACTIVE state and the timer has expired, it will\n // be processed in the next tick.\n if (timer._state === PENDING) {\n // Set the _idleStart value to the fastNow value minus the TICK_MS value\n // to account for the time the timer was in the PENDING state.\n timer._idleStart = fastNow - TICK_MS\n timer._state = ACTIVE\n } else if (\n timer._state === ACTIVE &&\n fastNow >= timer._idleStart + timer._idleTimeout\n ) {\n timer._state = TO_BE_CLEARED\n timer._idleStart = -1\n timer._onTimeout(timer._timerArg)\n }\n\n if (timer._state === TO_BE_CLEARED) {\n timer._state = NOT_IN_LIST\n\n // Move the last element to the current index and decrement len if it is\n // not the only element in the array.\n if (--len !== 0) {\n fastTimers[idx] = fastTimers[len]\n }\n } else {\n ++idx\n }\n }\n\n // Set the length of the fastTimers array to the new length and thus\n // removing the excess FastTimers elements from the array.\n fastTimers.length = len\n\n // If there are still active FastTimers in the array, refresh the Timer.\n // If there are no active FastTimers, the timer will be refreshed again\n // when a new FastTimer is instantiated.\n if (fastTimers.length !== 0) {\n refreshTimeout()\n }\n}\n\nfunction refreshTimeout () {\n // If the fastNowTimeout is already set, refresh it.\n if (fastNowTimeout) {\n fastNowTimeout.refresh()\n // fastNowTimeout is not instantiated yet, create a new Timer.\n } else {\n clearTimeout(fastNowTimeout)\n fastNowTimeout = setTimeout(onTick, TICK_MS)\n\n // If the Timer has an unref method, call it to allow the process to exit if\n // there are no other active handles.\n if (fastNowTimeout.unref) {\n fastNowTimeout.unref()\n }\n }\n}\n\n/**\n * The `FastTimer` class is a data structure designed to store and manage\n * timer information.\n */\nclass FastTimer {\n [kFastTimer] = true\n\n /**\n * The state of the timer, which can be one of the following:\n * - NOT_IN_LIST (-2)\n * - TO_BE_CLEARED (-1)\n * - PENDING (0)\n * - ACTIVE (1)\n *\n * @type {-2|-1|0|1}\n * @private\n */\n _state = NOT_IN_LIST\n\n /**\n * The number of milliseconds to wait before calling the callback.\n *\n * @type {number}\n * @private\n */\n _idleTimeout = -1\n\n /**\n * The time in milliseconds when the timer was started. This value is used to\n * calculate when the timer should expire.\n *\n * @type {number}\n * @default -1\n * @private\n */\n _idleStart = -1\n\n /**\n * The function to be executed when the timer expires.\n * @type {Function}\n * @private\n */\n _onTimeout\n\n /**\n * The argument to be passed to the callback when the timer expires.\n *\n * @type {*}\n * @private\n */\n _timerArg\n\n /**\n * @constructor\n * @param {Function} callback A function to be executed after the timer\n * expires.\n * @param {number} delay The time, in milliseconds that the timer should wait\n * before the specified function or code is executed.\n * @param {*} arg\n */\n constructor (callback, delay, arg) {\n this._onTimeout = callback\n this._idleTimeout = delay\n this._timerArg = arg\n\n this.refresh()\n }\n\n /**\n * Sets the timer's start time to the current time, and reschedules the timer\n * to call its callback at the previously specified duration adjusted to the\n * current time.\n * Using this on a timer that has already called its callback will reactivate\n * the timer.\n *\n * @returns {void}\n */\n refresh () {\n // In the special case that the timer is not in the list of active timers,\n // add it back to the array to be processed in the next tick by the onTick\n // function.\n if (this._state === NOT_IN_LIST) {\n fastTimers.push(this)\n }\n\n // If the timer is the only active timer, refresh the fastNowTimeout for\n // better resolution.\n if (!fastNowTimeout || fastTimers.length === 1) {\n refreshTimeout()\n }\n\n // Setting the state to PENDING will cause the timer to be reset in the\n // next tick by the onTick function.\n this._state = PENDING\n }\n\n /**\n * The `clear` method cancels the timer, preventing it from executing.\n *\n * @returns {void}\n * @private\n */\n clear () {\n // Set the state to TO_BE_CLEARED to mark the timer for removal in the next\n // tick by the onTick function.\n this._state = TO_BE_CLEARED\n\n // Reset the _idleStart value to -1 to indicate that the timer is no longer\n // active.\n this._idleStart = -1\n }\n}\n\n/**\n * This module exports a setTimeout and clearTimeout function that can be\n * used as a drop-in replacement for the native functions.\n */\nmodule.exports = {\n /**\n * The setTimeout() method sets a timer which executes a function once the\n * timer expires.\n * @param {Function} callback A function to be executed after the timer\n * expires.\n * @param {number} delay The time, in milliseconds that the timer should\n * wait before the specified function or code is executed.\n * @param {*} [arg] An optional argument to be passed to the callback function\n * when the timer expires.\n * @returns {NodeJS.Timeout|FastTimer}\n */\n setTimeout (callback, delay, arg) {\n // If the delay is less than or equal to the RESOLUTION_MS value return a\n // native Node.js Timer instance.\n return delay <= RESOLUTION_MS\n ? setTimeout(callback, delay, arg)\n : new FastTimer(callback, delay, arg)\n },\n /**\n * The clearTimeout method cancels an instantiated Timer previously created\n * by calling setTimeout.\n *\n * @param {NodeJS.Timeout|FastTimer} timeout\n */\n clearTimeout (timeout) {\n // If the timeout is a FastTimer, call its own clear method.\n if (timeout[kFastTimer]) {\n /**\n * @type {FastTimer}\n */\n timeout.clear()\n // Otherwise it is an instance of a native NodeJS.Timeout, so call the\n // Node.js native clearTimeout function.\n } else {\n clearTimeout(timeout)\n }\n },\n /**\n * The setFastTimeout() method sets a fastTimer which executes a function once\n * the timer expires.\n * @param {Function} callback A function to be executed after the timer\n * expires.\n * @param {number} delay The time, in milliseconds that the timer should\n * wait before the specified function or code is executed.\n * @param {*} [arg] An optional argument to be passed to the callback function\n * when the timer expires.\n * @returns {FastTimer}\n */\n setFastTimeout (callback, delay, arg) {\n return new FastTimer(callback, delay, arg)\n },\n /**\n * The clearTimeout method cancels an instantiated FastTimer previously\n * created by calling setFastTimeout.\n *\n * @param {FastTimer} timeout\n */\n clearFastTimeout (timeout) {\n timeout.clear()\n },\n /**\n * The now method returns the value of the internal fast timer clock.\n *\n * @returns {number}\n */\n now () {\n return fastNow\n },\n /**\n * Trigger the onTick function to process the fastTimers array.\n * Exported for testing purposes only.\n * Marking as deprecated to discourage any use outside of testing.\n * @deprecated\n * @param {number} [delay=0] The delay in milliseconds to add to the now value.\n */\n tick (delay = 0) {\n fastNow += delay - RESOLUTION_MS + 1\n onTick()\n onTick()\n },\n /**\n * Reset FastTimers.\n * Exported for testing purposes only.\n * Marking as deprecated to discourage any use outside of testing.\n * @deprecated\n */\n reset () {\n fastNow = 0\n fastTimers.length = 0\n clearTimeout(fastNowTimeout)\n fastNowTimeout = null\n },\n /**\n * Exporting for testing purposes only.\n * Marking as deprecated to discourage any use outside of testing.\n * @deprecated\n */\n kFastTimer\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { urlEquals, getFieldValues } = require('./util')\nconst { kEnumerableProperty, isDisturbed } = require('../../core/util')\nconst { webidl } = require('../fetch/webidl')\nconst { Response, cloneResponse, fromInnerResponse } = require('../fetch/response')\nconst { Request, fromInnerRequest } = require('../fetch/request')\nconst { kState } = require('../fetch/symbols')\nconst { fetching } = require('../fetch/index')\nconst { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require('../fetch/util')\nconst assert = require('node:assert')\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation\n * @typedef {Object} CacheBatchOperation\n * @property {'delete' | 'put'} type\n * @property {any} request\n * @property {any} response\n * @property {import('../../types/cache').CacheQueryOptions} options\n */\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list\n * @typedef {[any, any][]} requestResponseList\n */\n\nclass Cache {\n /**\n * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list\n * @type {requestResponseList}\n */\n #relevantRequestResponseList\n\n constructor () {\n if (arguments[0] !== kConstruct) {\n webidl.illegalConstructor()\n }\n\n webidl.util.markAsUncloneable(this)\n this.#relevantRequestResponseList = arguments[1]\n }\n\n async match (request, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.match'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n request = webidl.converters.RequestInfo(request, prefix, 'request')\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n const p = this.#internalMatchAll(request, options, 1)\n\n if (p.length === 0) {\n return\n }\n\n return p[0]\n }\n\n async matchAll (request = undefined, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.matchAll'\n if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n return this.#internalMatchAll(request, options)\n }\n\n async add (request) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.add'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n request = webidl.converters.RequestInfo(request, prefix, 'request')\n\n // 1.\n const requests = [request]\n\n // 2.\n const responseArrayPromise = this.addAll(requests)\n\n // 3.\n return await responseArrayPromise\n }\n\n async addAll (requests) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.addAll'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n // 1.\n const responsePromises = []\n\n // 2.\n const requestList = []\n\n // 3.\n for (let request of requests) {\n if (request === undefined) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: 'Argument 1',\n types: ['undefined is not allowed']\n })\n }\n\n request = webidl.converters.RequestInfo(request)\n\n if (typeof request === 'string') {\n continue\n }\n\n // 3.1\n const r = request[kState]\n\n // 3.2\n if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Expected http/s scheme when method is not GET.'\n })\n }\n }\n\n // 4.\n /** @type {ReturnType[]} */\n const fetchControllers = []\n\n // 5.\n for (const request of requests) {\n // 5.1\n const r = new Request(request)[kState]\n\n // 5.2\n if (!urlIsHttpHttpsScheme(r.url)) {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Expected http/s scheme.'\n })\n }\n\n // 5.4\n r.initiator = 'fetch'\n r.destination = 'subresource'\n\n // 5.5\n requestList.push(r)\n\n // 5.6\n const responsePromise = createDeferredPromise()\n\n // 5.7\n fetchControllers.push(fetching({\n request: r,\n processResponse (response) {\n // 1.\n if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {\n responsePromise.reject(webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'Received an invalid status code or the request failed.'\n }))\n } else if (response.headersList.contains('vary')) { // 2.\n // 2.1\n const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n // 2.2\n for (const fieldValue of fieldValues) {\n // 2.2.1\n if (fieldValue === '*') {\n responsePromise.reject(webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'invalid vary field value'\n }))\n\n for (const controller of fetchControllers) {\n controller.abort()\n }\n\n return\n }\n }\n }\n },\n processResponseEndOfBody (response) {\n // 1.\n if (response.aborted) {\n responsePromise.reject(new DOMException('aborted', 'AbortError'))\n return\n }\n\n // 2.\n responsePromise.resolve(response)\n }\n }))\n\n // 5.8\n responsePromises.push(responsePromise.promise)\n }\n\n // 6.\n const p = Promise.all(responsePromises)\n\n // 7.\n const responses = await p\n\n // 7.1\n const operations = []\n\n // 7.2\n let index = 0\n\n // 7.3\n for (const response of responses) {\n // 7.3.1\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'put', // 7.3.2\n request: requestList[index], // 7.3.3\n response // 7.3.4\n }\n\n operations.push(operation) // 7.3.5\n\n index++ // 7.3.6\n }\n\n // 7.5\n const cacheJobPromise = createDeferredPromise()\n\n // 7.6.1\n let errorData = null\n\n // 7.6.2\n try {\n this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n // 7.6.3\n queueMicrotask(() => {\n // 7.6.3.1\n if (errorData === null) {\n cacheJobPromise.resolve(undefined)\n } else {\n // 7.6.3.2\n cacheJobPromise.reject(errorData)\n }\n })\n\n // 7.7\n return cacheJobPromise.promise\n }\n\n async put (request, response) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.put'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n request = webidl.converters.RequestInfo(request, prefix, 'request')\n response = webidl.converters.Response(response, prefix, 'response')\n\n // 1.\n let innerRequest = null\n\n // 2.\n if (request instanceof Request) {\n innerRequest = request[kState]\n } else { // 3.\n innerRequest = new Request(request)[kState]\n }\n\n // 4.\n if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Expected an http/s scheme when method is not GET'\n })\n }\n\n // 5.\n const innerResponse = response[kState]\n\n // 6.\n if (innerResponse.status === 206) {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Got 206 status'\n })\n }\n\n // 7.\n if (innerResponse.headersList.contains('vary')) {\n // 7.1.\n const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))\n\n // 7.2.\n for (const fieldValue of fieldValues) {\n // 7.2.1\n if (fieldValue === '*') {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Got * vary field value'\n })\n }\n }\n }\n\n // 8.\n if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Response body is locked or disturbed'\n })\n }\n\n // 9.\n const clonedResponse = cloneResponse(innerResponse)\n\n // 10.\n const bodyReadPromise = createDeferredPromise()\n\n // 11.\n if (innerResponse.body != null) {\n // 11.1\n const stream = innerResponse.body.stream\n\n // 11.2\n const reader = stream.getReader()\n\n // 11.3\n readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)\n } else {\n bodyReadPromise.resolve(undefined)\n }\n\n // 12.\n /** @type {CacheBatchOperation[]} */\n const operations = []\n\n // 13.\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'put', // 14.\n request: innerRequest, // 15.\n response: clonedResponse // 16.\n }\n\n // 17.\n operations.push(operation)\n\n // 19.\n const bytes = await bodyReadPromise.promise\n\n if (clonedResponse.body != null) {\n clonedResponse.body.source = bytes\n }\n\n // 19.1\n const cacheJobPromise = createDeferredPromise()\n\n // 19.2.1\n let errorData = null\n\n // 19.2.2\n try {\n this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n // 19.2.3\n queueMicrotask(() => {\n // 19.2.3.1\n if (errorData === null) {\n cacheJobPromise.resolve()\n } else { // 19.2.3.2\n cacheJobPromise.reject(errorData)\n }\n })\n\n return cacheJobPromise.promise\n }\n\n async delete (request, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.delete'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n request = webidl.converters.RequestInfo(request, prefix, 'request')\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n /**\n * @type {Request}\n */\n let r = null\n\n if (request instanceof Request) {\n r = request[kState]\n\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return false\n }\n } else {\n assert(typeof request === 'string')\n\n r = new Request(request)[kState]\n }\n\n /** @type {CacheBatchOperation[]} */\n const operations = []\n\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'delete',\n request: r,\n options\n }\n\n operations.push(operation)\n\n const cacheJobPromise = createDeferredPromise()\n\n let errorData = null\n let requestResponses\n\n try {\n requestResponses = this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n queueMicrotask(() => {\n if (errorData === null) {\n cacheJobPromise.resolve(!!requestResponses?.length)\n } else {\n cacheJobPromise.reject(errorData)\n }\n })\n\n return cacheJobPromise.promise\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys\n * @param {any} request\n * @param {import('../../types/cache').CacheQueryOptions} options\n * @returns {Promise}\n */\n async keys (request = undefined, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.keys'\n\n if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n // 1.\n let r = null\n\n // 2.\n if (request !== undefined) {\n // 2.1\n if (request instanceof Request) {\n // 2.1.1\n r = request[kState]\n\n // 2.1.2\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return []\n }\n } else if (typeof request === 'string') { // 2.2\n r = new Request(request)[kState]\n }\n }\n\n // 4.\n const promise = createDeferredPromise()\n\n // 5.\n // 5.1\n const requests = []\n\n // 5.2\n if (request === undefined) {\n // 5.2.1\n for (const requestResponse of this.#relevantRequestResponseList) {\n // 5.2.1.1\n requests.push(requestResponse[0])\n }\n } else { // 5.3\n // 5.3.1\n const requestResponses = this.#queryCache(r, options)\n\n // 5.3.2\n for (const requestResponse of requestResponses) {\n // 5.3.2.1\n requests.push(requestResponse[0])\n }\n }\n\n // 5.4\n queueMicrotask(() => {\n // 5.4.1\n const requestList = []\n\n // 5.4.2\n for (const request of requests) {\n const requestObject = fromInnerRequest(\n request,\n new AbortController().signal,\n 'immutable'\n )\n // 5.4.2.1\n requestList.push(requestObject)\n }\n\n // 5.4.3\n promise.resolve(Object.freeze(requestList))\n })\n\n return promise.promise\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm\n * @param {CacheBatchOperation[]} operations\n * @returns {requestResponseList}\n */\n #batchCacheOperations (operations) {\n // 1.\n const cache = this.#relevantRequestResponseList\n\n // 2.\n const backupCache = [...cache]\n\n // 3.\n const addedItems = []\n\n // 4.1\n const resultList = []\n\n try {\n // 4.2\n for (const operation of operations) {\n // 4.2.1\n if (operation.type !== 'delete' && operation.type !== 'put') {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'operation type does not match \"delete\" or \"put\"'\n })\n }\n\n // 4.2.2\n if (operation.type === 'delete' && operation.response != null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'delete operation should not have an associated response'\n })\n }\n\n // 4.2.3\n if (this.#queryCache(operation.request, operation.options, addedItems).length) {\n throw new DOMException('???', 'InvalidStateError')\n }\n\n // 4.2.4\n let requestResponses\n\n // 4.2.5\n if (operation.type === 'delete') {\n // 4.2.5.1\n requestResponses = this.#queryCache(operation.request, operation.options)\n\n // TODO: the spec is wrong, this is needed to pass WPTs\n if (requestResponses.length === 0) {\n return []\n }\n\n // 4.2.5.2\n for (const requestResponse of requestResponses) {\n const idx = cache.indexOf(requestResponse)\n assert(idx !== -1)\n\n // 4.2.5.2.1\n cache.splice(idx, 1)\n }\n } else if (operation.type === 'put') { // 4.2.6\n // 4.2.6.1\n if (operation.response == null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'put operation should have an associated response'\n })\n }\n\n // 4.2.6.2\n const r = operation.request\n\n // 4.2.6.3\n if (!urlIsHttpHttpsScheme(r.url)) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'expected http or https scheme'\n })\n }\n\n // 4.2.6.4\n if (r.method !== 'GET') {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'not get method'\n })\n }\n\n // 4.2.6.5\n if (operation.options != null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'options must not be defined'\n })\n }\n\n // 4.2.6.6\n requestResponses = this.#queryCache(operation.request)\n\n // 4.2.6.7\n for (const requestResponse of requestResponses) {\n const idx = cache.indexOf(requestResponse)\n assert(idx !== -1)\n\n // 4.2.6.7.1\n cache.splice(idx, 1)\n }\n\n // 4.2.6.8\n cache.push([operation.request, operation.response])\n\n // 4.2.6.10\n addedItems.push([operation.request, operation.response])\n }\n\n // 4.2.7\n resultList.push([operation.request, operation.response])\n }\n\n // 4.3\n return resultList\n } catch (e) { // 5.\n // 5.1\n this.#relevantRequestResponseList.length = 0\n\n // 5.2\n this.#relevantRequestResponseList = backupCache\n\n // 5.3\n throw e\n }\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#query-cache\n * @param {any} requestQuery\n * @param {import('../../types/cache').CacheQueryOptions} options\n * @param {requestResponseList} targetStorage\n * @returns {requestResponseList}\n */\n #queryCache (requestQuery, options, targetStorage) {\n /** @type {requestResponseList} */\n const resultList = []\n\n const storage = targetStorage ?? this.#relevantRequestResponseList\n\n for (const requestResponse of storage) {\n const [cachedRequest, cachedResponse] = requestResponse\n if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {\n resultList.push(requestResponse)\n }\n }\n\n return resultList\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm\n * @param {any} requestQuery\n * @param {any} request\n * @param {any | null} response\n * @param {import('../../types/cache').CacheQueryOptions | undefined} options\n * @returns {boolean}\n */\n #requestMatchesCachedItem (requestQuery, request, response = null, options) {\n // if (options?.ignoreMethod === false && request.method === 'GET') {\n // return false\n // }\n\n const queryURL = new URL(requestQuery.url)\n\n const cachedURL = new URL(request.url)\n\n if (options?.ignoreSearch) {\n cachedURL.search = ''\n\n queryURL.search = ''\n }\n\n if (!urlEquals(queryURL, cachedURL, true)) {\n return false\n }\n\n if (\n response == null ||\n options?.ignoreVary ||\n !response.headersList.contains('vary')\n ) {\n return true\n }\n\n const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n for (const fieldValue of fieldValues) {\n if (fieldValue === '*') {\n return false\n }\n\n const requestValue = request.headersList.get(fieldValue)\n const queryValue = requestQuery.headersList.get(fieldValue)\n\n // If one has the header and the other doesn't, or one has\n // a different value than the other, return false\n if (requestValue !== queryValue) {\n return false\n }\n }\n\n return true\n }\n\n #internalMatchAll (request, options, maxResponses = Infinity) {\n // 1.\n let r = null\n\n // 2.\n if (request !== undefined) {\n if (request instanceof Request) {\n // 2.1.1\n r = request[kState]\n\n // 2.1.2\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return []\n }\n } else if (typeof request === 'string') {\n // 2.2.1\n r = new Request(request)[kState]\n }\n }\n\n // 5.\n // 5.1\n const responses = []\n\n // 5.2\n if (request === undefined) {\n // 5.2.1\n for (const requestResponse of this.#relevantRequestResponseList) {\n responses.push(requestResponse[1])\n }\n } else { // 5.3\n // 5.3.1\n const requestResponses = this.#queryCache(r, options)\n\n // 5.3.2\n for (const requestResponse of requestResponses) {\n responses.push(requestResponse[1])\n }\n }\n\n // 5.4\n // We don't implement CORs so we don't need to loop over the responses, yay!\n\n // 5.5.1\n const responseList = []\n\n // 5.5.2\n for (const response of responses) {\n // 5.5.2.1\n const responseObject = fromInnerResponse(response, 'immutable')\n\n responseList.push(responseObject.clone())\n\n if (responseList.length >= maxResponses) {\n break\n }\n }\n\n // 6.\n return Object.freeze(responseList)\n }\n}\n\nObject.defineProperties(Cache.prototype, {\n [Symbol.toStringTag]: {\n value: 'Cache',\n configurable: true\n },\n match: kEnumerableProperty,\n matchAll: kEnumerableProperty,\n add: kEnumerableProperty,\n addAll: kEnumerableProperty,\n put: kEnumerableProperty,\n delete: kEnumerableProperty,\n keys: kEnumerableProperty\n})\n\nconst cacheQueryOptionConverters = [\n {\n key: 'ignoreSearch',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'ignoreMethod',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'ignoreVary',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n }\n]\n\nwebidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)\n\nwebidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([\n ...cacheQueryOptionConverters,\n {\n key: 'cacheName',\n converter: webidl.converters.DOMString\n }\n])\n\nwebidl.converters.Response = webidl.interfaceConverter(Response)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.RequestInfo\n)\n\nmodule.exports = {\n Cache\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { Cache } = require('./cache')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass CacheStorage {\n /**\n * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map\n * @type {Map}\n */\n async has (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n\n const prefix = 'CacheStorage.has'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n // 2.1.1\n // 2.2\n return this.#caches.has(cacheName)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open\n * @param {string} cacheName\n * @returns {Promise}\n */\n async open (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n\n const prefix = 'CacheStorage.open'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n // 2.1\n if (this.#caches.has(cacheName)) {\n // await caches.open('v1') !== await caches.open('v1')\n\n // 2.1.1\n const cache = this.#caches.get(cacheName)\n\n // 2.1.1.1\n return new Cache(kConstruct, cache)\n }\n\n // 2.2\n const cache = []\n\n // 2.3\n this.#caches.set(cacheName, cache)\n\n // 2.4\n return new Cache(kConstruct, cache)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete\n * @param {string} cacheName\n * @returns {Promise}\n */\n async delete (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n\n const prefix = 'CacheStorage.delete'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n return this.#caches.delete(cacheName)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys\n * @returns {Promise}\n */\n async keys () {\n webidl.brandCheck(this, CacheStorage)\n\n // 2.1\n const keys = this.#caches.keys()\n\n // 2.2\n return [...keys]\n }\n}\n\nObject.defineProperties(CacheStorage.prototype, {\n [Symbol.toStringTag]: {\n value: 'CacheStorage',\n configurable: true\n },\n match: kEnumerableProperty,\n has: kEnumerableProperty,\n open: kEnumerableProperty,\n delete: kEnumerableProperty,\n keys: kEnumerableProperty\n})\n\nmodule.exports = {\n CacheStorage\n}\n","'use strict'\n\nmodule.exports = {\n kConstruct: require('../../core/symbols').kConstruct\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { isValidHeaderName } = require('../fetch/util')\n\n/**\n * @see https://url.spec.whatwg.org/#concept-url-equals\n * @param {URL} A\n * @param {URL} B\n * @param {boolean | undefined} excludeFragment\n * @returns {boolean}\n */\nfunction urlEquals (A, B, excludeFragment = false) {\n const serializedA = URLSerializer(A, excludeFragment)\n\n const serializedB = URLSerializer(B, excludeFragment)\n\n return serializedA === serializedB\n}\n\n/**\n * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262\n * @param {string} header\n */\nfunction getFieldValues (header) {\n assert(header !== null)\n\n const values = []\n\n for (let value of header.split(',')) {\n value = value.trim()\n\n if (isValidHeaderName(value)) {\n values.push(value)\n }\n }\n\n return values\n}\n\nmodule.exports = {\n urlEquals,\n getFieldValues\n}\n","'use strict'\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size\nconst maxAttributeValueSize = 1024\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size\nconst maxNameValuePairSize = 4096\n\nmodule.exports = {\n maxAttributeValueSize,\n maxNameValuePairSize\n}\n","'use strict'\n\nconst { parseSetCookie } = require('./parse')\nconst { stringify } = require('./util')\nconst { webidl } = require('../fetch/webidl')\nconst { Headers } = require('../fetch/headers')\n\n/**\n * @typedef {Object} Cookie\n * @property {string} name\n * @property {string} value\n * @property {Date|number|undefined} expires\n * @property {number|undefined} maxAge\n * @property {string|undefined} domain\n * @property {string|undefined} path\n * @property {boolean|undefined} secure\n * @property {boolean|undefined} httpOnly\n * @property {'Strict'|'Lax'|'None'} sameSite\n * @property {string[]} unparsed\n */\n\n/**\n * @param {Headers} headers\n * @returns {Record}\n */\nfunction getCookies (headers) {\n webidl.argumentLengthCheck(arguments, 1, 'getCookies')\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n const cookie = headers.get('cookie')\n const out = {}\n\n if (!cookie) {\n return out\n }\n\n for (const piece of cookie.split(';')) {\n const [name, ...value] = piece.split('=')\n\n out[name.trim()] = value.join('=')\n }\n\n return out\n}\n\n/**\n * @param {Headers} headers\n * @param {string} name\n * @param {{ path?: string, domain?: string }|undefined} attributes\n * @returns {void}\n */\nfunction deleteCookie (headers, name, attributes) {\n webidl.brandCheck(headers, Headers, { strict: false })\n\n const prefix = 'deleteCookie'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n name = webidl.converters.DOMString(name, prefix, 'name')\n attributes = webidl.converters.DeleteCookieAttributes(attributes)\n\n // Matches behavior of\n // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278\n setCookie(headers, {\n name,\n value: '',\n expires: new Date(0),\n ...attributes\n })\n}\n\n/**\n * @param {Headers} headers\n * @returns {Cookie[]}\n */\nfunction getSetCookies (headers) {\n webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n const cookies = headers.getSetCookie()\n\n if (!cookies) {\n return []\n }\n\n return cookies.map((pair) => parseSetCookie(pair))\n}\n\n/**\n * @param {Headers} headers\n * @param {Cookie} cookie\n * @returns {void}\n */\nfunction setCookie (headers, cookie) {\n webidl.argumentLengthCheck(arguments, 2, 'setCookie')\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n cookie = webidl.converters.Cookie(cookie)\n\n const str = stringify(cookie)\n\n if (str) {\n headers.append('Set-Cookie', str)\n }\n}\n\nwebidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'path',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'domain',\n defaultValue: () => null\n }\n])\n\nwebidl.converters.Cookie = webidl.dictionaryConverter([\n {\n converter: webidl.converters.DOMString,\n key: 'name'\n },\n {\n converter: webidl.converters.DOMString,\n key: 'value'\n },\n {\n converter: webidl.nullableConverter((value) => {\n if (typeof value === 'number') {\n return webidl.converters['unsigned long long'](value)\n }\n\n return new Date(value)\n }),\n key: 'expires',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters['long long']),\n key: 'maxAge',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'domain',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'path',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.boolean),\n key: 'secure',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.boolean),\n key: 'httpOnly',\n defaultValue: () => null\n },\n {\n converter: webidl.converters.USVString,\n key: 'sameSite',\n allowedValues: ['Strict', 'Lax', 'None']\n },\n {\n converter: webidl.sequenceConverter(webidl.converters.DOMString),\n key: 'unparsed',\n defaultValue: () => new Array(0)\n }\n])\n\nmodule.exports = {\n getCookies,\n deleteCookie,\n getSetCookies,\n setCookie\n}\n","'use strict'\n\nconst { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')\nconst { isCTLExcludingHtab } = require('./util')\nconst { collectASequenceOfCodePointsFast } = require('../fetch/data-url')\nconst assert = require('node:assert')\n\n/**\n * @description Parses the field-value attributes of a set-cookie header string.\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} header\n * @returns if the header is invalid, null will be returned\n */\nfunction parseSetCookie (header) {\n // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F\n // character (CTL characters excluding HTAB): Abort these steps and\n // ignore the set-cookie-string entirely.\n if (isCTLExcludingHtab(header)) {\n return null\n }\n\n let nameValuePair = ''\n let unparsedAttributes = ''\n let name = ''\n let value = ''\n\n // 2. If the set-cookie-string contains a %x3B (\";\") character:\n if (header.includes(';')) {\n // 1. The name-value-pair string consists of the characters up to,\n // but not including, the first %x3B (\";\"), and the unparsed-\n // attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\n const position = { position: 0 }\n\n nameValuePair = collectASequenceOfCodePointsFast(';', header, position)\n unparsedAttributes = header.slice(position.position)\n } else {\n // Otherwise:\n\n // 1. The name-value-pair string consists of all the characters\n // contained in the set-cookie-string, and the unparsed-\n // attributes is the empty string.\n nameValuePair = header\n }\n\n // 3. If the name-value-pair string lacks a %x3D (\"=\") character, then\n // the name string is empty, and the value string is the value of\n // name-value-pair.\n if (!nameValuePair.includes('=')) {\n value = nameValuePair\n } else {\n // Otherwise, the name string consists of the characters up to, but\n // not including, the first %x3D (\"=\") character, and the (possibly\n // empty) value string consists of the characters after the first\n // %x3D (\"=\") character.\n const position = { position: 0 }\n name = collectASequenceOfCodePointsFast(\n '=',\n nameValuePair,\n position\n )\n value = nameValuePair.slice(position.position + 1)\n }\n\n // 4. Remove any leading or trailing WSP characters from the name\n // string and the value string.\n name = name.trim()\n value = value.trim()\n\n // 5. If the sum of the lengths of the name string and the value string\n // is more than 4096 octets, abort these steps and ignore the set-\n // cookie-string entirely.\n if (name.length + value.length > maxNameValuePairSize) {\n return null\n }\n\n // 6. The cookie-name is the name string, and the cookie-value is the\n // value string.\n return {\n name, value, ...parseUnparsedAttributes(unparsedAttributes)\n }\n}\n\n/**\n * Parses the remaining attributes of a set-cookie header\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} unparsedAttributes\n * @param {[Object.]={}} cookieAttributeList\n */\nfunction parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {\n // 1. If the unparsed-attributes string is empty, skip the rest of\n // these steps.\n if (unparsedAttributes.length === 0) {\n return cookieAttributeList\n }\n\n // 2. Discard the first character of the unparsed-attributes (which\n // will be a %x3B (\";\") character).\n assert(unparsedAttributes[0] === ';')\n unparsedAttributes = unparsedAttributes.slice(1)\n\n let cookieAv = ''\n\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n if (unparsedAttributes.includes(';')) {\n // 1. Consume the characters of the unparsed-attributes up to, but\n // not including, the first %x3B (\";\") character.\n cookieAv = collectASequenceOfCodePointsFast(\n ';',\n unparsedAttributes,\n { position: 0 }\n )\n unparsedAttributes = unparsedAttributes.slice(cookieAv.length)\n } else {\n // Otherwise:\n\n // 1. Consume the remainder of the unparsed-attributes.\n cookieAv = unparsedAttributes\n unparsedAttributes = ''\n }\n\n // Let the cookie-av string be the characters consumed in this step.\n\n let attributeName = ''\n let attributeValue = ''\n\n // 4. If the cookie-av string contains a %x3D (\"=\") character:\n if (cookieAv.includes('=')) {\n // 1. The (possibly empty) attribute-name string consists of the\n // characters up to, but not including, the first %x3D (\"=\")\n // character, and the (possibly empty) attribute-value string\n // consists of the characters after the first %x3D (\"=\")\n // character.\n const position = { position: 0 }\n\n attributeName = collectASequenceOfCodePointsFast(\n '=',\n cookieAv,\n position\n )\n attributeValue = cookieAv.slice(position.position + 1)\n } else {\n // Otherwise:\n\n // 1. The attribute-name string consists of the entire cookie-av\n // string, and the attribute-value string is empty.\n attributeName = cookieAv\n }\n\n // 5. Remove any leading or trailing WSP characters from the attribute-\n // name string and the attribute-value string.\n attributeName = attributeName.trim()\n attributeValue = attributeValue.trim()\n\n // 6. If the attribute-value is longer than 1024 octets, ignore the\n // cookie-av string and return to Step 1 of this algorithm.\n if (attributeValue.length > maxAttributeValueSize) {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 7. Process the attribute-name and attribute-value according to the\n // requirements in the following subsections. (Notice that\n // attributes with unrecognized attribute-names are ignored.)\n const attributeNameLowercase = attributeName.toLowerCase()\n\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1\n // If the attribute-name case-insensitively matches the string\n // \"Expires\", the user agent MUST process the cookie-av as follows.\n if (attributeNameLowercase === 'expires') {\n // 1. Let the expiry-time be the result of parsing the attribute-value\n // as cookie-date (see Section 5.1.1).\n const expiryTime = new Date(attributeValue)\n\n // 2. If the attribute-value failed to parse as a cookie date, ignore\n // the cookie-av.\n\n cookieAttributeList.expires = expiryTime\n } else if (attributeNameLowercase === 'max-age') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2\n // If the attribute-name case-insensitively matches the string \"Max-\n // Age\", the user agent MUST process the cookie-av as follows.\n\n // 1. If the first character of the attribute-value is not a DIGIT or a\n // \"-\" character, ignore the cookie-av.\n const charCode = attributeValue.charCodeAt(0)\n\n if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 2. If the remainder of attribute-value contains a non-DIGIT\n // character, ignore the cookie-av.\n if (!/^\\d+$/.test(attributeValue)) {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 3. Let delta-seconds be the attribute-value converted to an integer.\n const deltaSeconds = Number(attributeValue)\n\n // 4. Let cookie-age-limit be the maximum age of the cookie (which\n // SHOULD be 400 days or less, see Section 4.1.2.2).\n\n // 5. Set delta-seconds to the smaller of its present value and cookie-\n // age-limit.\n // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)\n\n // 6. If delta-seconds is less than or equal to zero (0), let expiry-\n // time be the earliest representable date and time. Otherwise, let\n // the expiry-time be the current date and time plus delta-seconds\n // seconds.\n // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds\n\n // 7. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Max-Age and an attribute-value of expiry-time.\n cookieAttributeList.maxAge = deltaSeconds\n } else if (attributeNameLowercase === 'domain') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3\n // If the attribute-name case-insensitively matches the string \"Domain\",\n // the user agent MUST process the cookie-av as follows.\n\n // 1. Let cookie-domain be the attribute-value.\n let cookieDomain = attributeValue\n\n // 2. If cookie-domain starts with %x2E (\".\"), let cookie-domain be\n // cookie-domain without its leading %x2E (\".\").\n if (cookieDomain[0] === '.') {\n cookieDomain = cookieDomain.slice(1)\n }\n\n // 3. Convert the cookie-domain to lower case.\n cookieDomain = cookieDomain.toLowerCase()\n\n // 4. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Domain and an attribute-value of cookie-domain.\n cookieAttributeList.domain = cookieDomain\n } else if (attributeNameLowercase === 'path') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4\n // If the attribute-name case-insensitively matches the string \"Path\",\n // the user agent MUST process the cookie-av as follows.\n\n // 1. If the attribute-value is empty or if the first character of the\n // attribute-value is not %x2F (\"/\"):\n let cookiePath = ''\n if (attributeValue.length === 0 || attributeValue[0] !== '/') {\n // 1. Let cookie-path be the default-path.\n cookiePath = '/'\n } else {\n // Otherwise:\n\n // 1. Let cookie-path be the attribute-value.\n cookiePath = attributeValue\n }\n\n // 2. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Path and an attribute-value of cookie-path.\n cookieAttributeList.path = cookiePath\n } else if (attributeNameLowercase === 'secure') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5\n // If the attribute-name case-insensitively matches the string \"Secure\",\n // the user agent MUST append an attribute to the cookie-attribute-list\n // with an attribute-name of Secure and an empty attribute-value.\n\n cookieAttributeList.secure = true\n } else if (attributeNameLowercase === 'httponly') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6\n // If the attribute-name case-insensitively matches the string\n // \"HttpOnly\", the user agent MUST append an attribute to the cookie-\n // attribute-list with an attribute-name of HttpOnly and an empty\n // attribute-value.\n\n cookieAttributeList.httpOnly = true\n } else if (attributeNameLowercase === 'samesite') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7\n // If the attribute-name case-insensitively matches the string\n // \"SameSite\", the user agent MUST process the cookie-av as follows:\n\n const attributeValueLowercase = attributeValue.toLowerCase()\n\n // 1. If cookie-av's attribute-value is a case-insensitive match for\n // \"None\", append an attribute to the cookie-attribute-list with an\n // attribute-name of \"SameSite\" and an attribute-value of \"None\".\n if (attributeValueLowercase === 'none') {\n cookieAttributeList.sameSite = 'None'\n } else if (attributeValueLowercase === 'strict') {\n // 2. If cookie-av's attribute-value is a case-insensitive match for\n // \"Strict\", append an attribute to the cookie-attribute-list with\n // an attribute-name of \"SameSite\" and an attribute-value of\n // \"Strict\".\n cookieAttributeList.sameSite = 'Strict'\n } else if (attributeValueLowercase === 'lax') {\n // 3. If cookie-av's attribute-value is a case-insensitive match for\n // \"Lax\", append an attribute to the cookie-attribute-list with an\n // attribute-name of \"SameSite\" and an attribute-value of \"Lax\".\n cookieAttributeList.sameSite = 'Lax'\n }\n } else {\n cookieAttributeList.unparsed ??= []\n\n cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)\n }\n\n // 8. Return to Step 1 of this algorithm.\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n}\n\nmodule.exports = {\n parseSetCookie,\n parseUnparsedAttributes\n}\n","'use strict'\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction isCTLExcludingHtab (value) {\n for (let i = 0; i < value.length; ++i) {\n const code = value.charCodeAt(i)\n\n if (\n (code >= 0x00 && code <= 0x08) ||\n (code >= 0x0A && code <= 0x1F) ||\n code === 0x7F\n ) {\n return true\n }\n }\n return false\n}\n\n/**\n CHAR = \n token = 1*\n separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n | \",\" | \";\" | \":\" | \"\\\" | <\">\n | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n | \"{\" | \"}\" | SP | HT\n * @param {string} name\n */\nfunction validateCookieName (name) {\n for (let i = 0; i < name.length; ++i) {\n const code = name.charCodeAt(i)\n\n if (\n code < 0x21 || // exclude CTLs (0-31), SP and HT\n code > 0x7E || // exclude non-ascii and DEL\n code === 0x22 || // \"\n code === 0x28 || // (\n code === 0x29 || // )\n code === 0x3C || // <\n code === 0x3E || // >\n code === 0x40 || // @\n code === 0x2C || // ,\n code === 0x3B || // ;\n code === 0x3A || // :\n code === 0x5C || // \\\n code === 0x2F || // /\n code === 0x5B || // [\n code === 0x5D || // ]\n code === 0x3F || // ?\n code === 0x3D || // =\n code === 0x7B || // {\n code === 0x7D // }\n ) {\n throw new Error('Invalid cookie name')\n }\n }\n}\n\n/**\n cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n ; US-ASCII characters excluding CTLs,\n ; whitespace DQUOTE, comma, semicolon,\n ; and backslash\n * @param {string} value\n */\nfunction validateCookieValue (value) {\n let len = value.length\n let i = 0\n\n // if the value is wrapped in DQUOTE\n if (value[0] === '\"') {\n if (len === 1 || value[len - 1] !== '\"') {\n throw new Error('Invalid cookie value')\n }\n --len\n ++i\n }\n\n while (i < len) {\n const code = value.charCodeAt(i++)\n\n if (\n code < 0x21 || // exclude CTLs (0-31)\n code > 0x7E || // non-ascii and DEL (127)\n code === 0x22 || // \"\n code === 0x2C || // ,\n code === 0x3B || // ;\n code === 0x5C // \\\n ) {\n throw new Error('Invalid cookie value')\n }\n }\n}\n\n/**\n * path-value = \n * @param {string} path\n */\nfunction validateCookiePath (path) {\n for (let i = 0; i < path.length; ++i) {\n const code = path.charCodeAt(i)\n\n if (\n code < 0x20 || // exclude CTLs (0-31)\n code === 0x7F || // DEL\n code === 0x3B // ;\n ) {\n throw new Error('Invalid cookie path')\n }\n }\n}\n\n/**\n * I have no idea why these values aren't allowed to be honest,\n * but Deno tests these. - Khafra\n * @param {string} domain\n */\nfunction validateCookieDomain (domain) {\n if (\n domain.startsWith('-') ||\n domain.endsWith('.') ||\n domain.endsWith('-')\n ) {\n throw new Error('Invalid cookie domain')\n }\n}\n\nconst IMFDays = [\n 'Sun', 'Mon', 'Tue', 'Wed',\n 'Thu', 'Fri', 'Sat'\n]\n\nconst IMFMonths = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n]\n\nconst IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1\n * @param {number|Date} date\n IMF-fixdate = day-name \",\" SP date1 SP time-of-day SP GMT\n ; fixed length/zone/capitalization subset of the format\n ; see Section 3.3 of [RFC5322]\n\n day-name = %x4D.6F.6E ; \"Mon\", case-sensitive\n / %x54.75.65 ; \"Tue\", case-sensitive\n / %x57.65.64 ; \"Wed\", case-sensitive\n / %x54.68.75 ; \"Thu\", case-sensitive\n / %x46.72.69 ; \"Fri\", case-sensitive\n / %x53.61.74 ; \"Sat\", case-sensitive\n / %x53.75.6E ; \"Sun\", case-sensitive\n date1 = day SP month SP year\n ; e.g., 02 Jun 1982\n\n day = 2DIGIT\n month = %x4A.61.6E ; \"Jan\", case-sensitive\n / %x46.65.62 ; \"Feb\", case-sensitive\n / %x4D.61.72 ; \"Mar\", case-sensitive\n / %x41.70.72 ; \"Apr\", case-sensitive\n / %x4D.61.79 ; \"May\", case-sensitive\n / %x4A.75.6E ; \"Jun\", case-sensitive\n / %x4A.75.6C ; \"Jul\", case-sensitive\n / %x41.75.67 ; \"Aug\", case-sensitive\n / %x53.65.70 ; \"Sep\", case-sensitive\n / %x4F.63.74 ; \"Oct\", case-sensitive\n / %x4E.6F.76 ; \"Nov\", case-sensitive\n / %x44.65.63 ; \"Dec\", case-sensitive\n year = 4DIGIT\n\n GMT = %x47.4D.54 ; \"GMT\", case-sensitive\n\n time-of-day = hour \":\" minute \":\" second\n ; 00:00:00 - 23:59:60 (leap second)\n\n hour = 2DIGIT\n minute = 2DIGIT\n second = 2DIGIT\n */\nfunction toIMFDate (date) {\n if (typeof date === 'number') {\n date = new Date(date)\n }\n\n return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`\n}\n\n/**\n max-age-av = \"Max-Age=\" non-zero-digit *DIGIT\n ; In practice, both expires-av and max-age-av\n ; are limited to dates representable by the\n ; user agent.\n * @param {number} maxAge\n */\nfunction validateCookieMaxAge (maxAge) {\n if (maxAge < 0) {\n throw new Error('Invalid cookie max-age')\n }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1\n * @param {import('./index').Cookie} cookie\n */\nfunction stringify (cookie) {\n if (cookie.name.length === 0) {\n return null\n }\n\n validateCookieName(cookie.name)\n validateCookieValue(cookie.value)\n\n const out = [`${cookie.name}=${cookie.value}`]\n\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2\n if (cookie.name.startsWith('__Secure-')) {\n cookie.secure = true\n }\n\n if (cookie.name.startsWith('__Host-')) {\n cookie.secure = true\n cookie.domain = null\n cookie.path = '/'\n }\n\n if (cookie.secure) {\n out.push('Secure')\n }\n\n if (cookie.httpOnly) {\n out.push('HttpOnly')\n }\n\n if (typeof cookie.maxAge === 'number') {\n validateCookieMaxAge(cookie.maxAge)\n out.push(`Max-Age=${cookie.maxAge}`)\n }\n\n if (cookie.domain) {\n validateCookieDomain(cookie.domain)\n out.push(`Domain=${cookie.domain}`)\n }\n\n if (cookie.path) {\n validateCookiePath(cookie.path)\n out.push(`Path=${cookie.path}`)\n }\n\n if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {\n out.push(`Expires=${toIMFDate(cookie.expires)}`)\n }\n\n if (cookie.sameSite) {\n out.push(`SameSite=${cookie.sameSite}`)\n }\n\n for (const part of cookie.unparsed) {\n if (!part.includes('=')) {\n throw new Error('Invalid unparsed')\n }\n\n const [key, ...value] = part.split('=')\n\n out.push(`${key.trim()}=${value.join('=')}`)\n }\n\n return out.join('; ')\n}\n\nmodule.exports = {\n isCTLExcludingHtab,\n validateCookieName,\n validateCookiePath,\n validateCookieValue,\n toIMFDate,\n stringify\n}\n","'use strict'\nconst { Transform } = require('node:stream')\nconst { isASCIINumber, isValidLastEventId } = require('./util')\n\n/**\n * @type {number[]} BOM\n */\nconst BOM = [0xEF, 0xBB, 0xBF]\n/**\n * @type {10} LF\n */\nconst LF = 0x0A\n/**\n * @type {13} CR\n */\nconst CR = 0x0D\n/**\n * @type {58} COLON\n */\nconst COLON = 0x3A\n/**\n * @type {32} SPACE\n */\nconst SPACE = 0x20\n\n/**\n * @typedef {object} EventSourceStreamEvent\n * @type {object}\n * @property {string} [event] The event type.\n * @property {string} [data] The data of the message.\n * @property {string} [id] A unique ID for the event.\n * @property {string} [retry] The reconnection time, in milliseconds.\n */\n\n/**\n * @typedef eventSourceSettings\n * @type {object}\n * @property {string} lastEventId The last event ID received from the server.\n * @property {string} origin The origin of the event source.\n * @property {number} reconnectionTime The reconnection time, in milliseconds.\n */\n\nclass EventSourceStream extends Transform {\n /**\n * @type {eventSourceSettings}\n */\n state = null\n\n /**\n * Leading byte-order-mark check.\n * @type {boolean}\n */\n checkBOM = true\n\n /**\n * @type {boolean}\n */\n crlfCheck = false\n\n /**\n * @type {boolean}\n */\n eventEndCheck = false\n\n /**\n * @type {Buffer}\n */\n buffer = null\n\n pos = 0\n\n event = {\n data: undefined,\n event: undefined,\n id: undefined,\n retry: undefined\n }\n\n /**\n * @param {object} options\n * @param {eventSourceSettings} options.eventSourceSettings\n * @param {Function} [options.push]\n */\n constructor (options = {}) {\n // Enable object mode as EventSourceStream emits objects of shape\n // EventSourceStreamEvent\n options.readableObjectMode = true\n\n super(options)\n\n this.state = options.eventSourceSettings || {}\n if (options.push) {\n this.push = options.push\n }\n }\n\n /**\n * @param {Buffer} chunk\n * @param {string} _encoding\n * @param {Function} callback\n * @returns {void}\n */\n _transform (chunk, _encoding, callback) {\n if (chunk.length === 0) {\n callback()\n return\n }\n\n // Cache the chunk in the buffer, as the data might not be complete while\n // processing it\n // TODO: Investigate if there is a more performant way to handle\n // incoming chunks\n // see: https://github.com/nodejs/undici/issues/2630\n if (this.buffer) {\n this.buffer = Buffer.concat([this.buffer, chunk])\n } else {\n this.buffer = chunk\n }\n\n // Strip leading byte-order-mark if we opened the stream and started\n // the processing of the incoming data\n if (this.checkBOM) {\n switch (this.buffer.length) {\n case 1:\n // Check if the first byte is the same as the first byte of the BOM\n if (this.buffer[0] === BOM[0]) {\n // If it is, we need to wait for more data\n callback()\n return\n }\n // Set the checkBOM flag to false as we don't need to check for the\n // BOM anymore\n this.checkBOM = false\n\n // The buffer only contains one byte so we need to wait for more data\n callback()\n return\n case 2:\n // Check if the first two bytes are the same as the first two bytes\n // of the BOM\n if (\n this.buffer[0] === BOM[0] &&\n this.buffer[1] === BOM[1]\n ) {\n // If it is, we need to wait for more data, because the third byte\n // is needed to determine if it is the BOM or not\n callback()\n return\n }\n\n // Set the checkBOM flag to false as we don't need to check for the\n // BOM anymore\n this.checkBOM = false\n break\n case 3:\n // Check if the first three bytes are the same as the first three\n // bytes of the BOM\n if (\n this.buffer[0] === BOM[0] &&\n this.buffer[1] === BOM[1] &&\n this.buffer[2] === BOM[2]\n ) {\n // If it is, we can drop the buffered data, as it is only the BOM\n this.buffer = Buffer.alloc(0)\n // Set the checkBOM flag to false as we don't need to check for the\n // BOM anymore\n this.checkBOM = false\n\n // Await more data\n callback()\n return\n }\n // If it is not the BOM, we can start processing the data\n this.checkBOM = false\n break\n default:\n // The buffer is longer than 3 bytes, so we can drop the BOM if it is\n // present\n if (\n this.buffer[0] === BOM[0] &&\n this.buffer[1] === BOM[1] &&\n this.buffer[2] === BOM[2]\n ) {\n // Remove the BOM from the buffer\n this.buffer = this.buffer.subarray(3)\n }\n\n // Set the checkBOM flag to false as we don't need to check for the\n this.checkBOM = false\n break\n }\n }\n\n while (this.pos < this.buffer.length) {\n // If the previous line ended with an end-of-line, we need to check\n // if the next character is also an end-of-line.\n if (this.eventEndCheck) {\n // If the the current character is an end-of-line, then the event\n // is finished and we can process it\n\n // If the previous line ended with a carriage return, we need to\n // check if the current character is a line feed and remove it\n // from the buffer.\n if (this.crlfCheck) {\n // If the current character is a line feed, we can remove it\n // from the buffer and reset the crlfCheck flag\n if (this.buffer[this.pos] === LF) {\n this.buffer = this.buffer.subarray(this.pos + 1)\n this.pos = 0\n this.crlfCheck = false\n\n // It is possible that the line feed is not the end of the\n // event. We need to check if the next character is an\n // end-of-line character to determine if the event is\n // finished. We simply continue the loop to check the next\n // character.\n\n // As we removed the line feed from the buffer and set the\n // crlfCheck flag to false, we basically don't make any\n // distinction between a line feed and a carriage return.\n continue\n }\n this.crlfCheck = false\n }\n\n if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n // If the current character is a carriage return, we need to\n // set the crlfCheck flag to true, as we need to check if the\n // next character is a line feed so we can remove it from the\n // buffer\n if (this.buffer[this.pos] === CR) {\n this.crlfCheck = true\n }\n\n this.buffer = this.buffer.subarray(this.pos + 1)\n this.pos = 0\n if (\n this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {\n this.processEvent(this.event)\n }\n this.clearEvent()\n continue\n }\n // If the current character is not an end-of-line, then the event\n // is not finished and we have to reset the eventEndCheck flag\n this.eventEndCheck = false\n continue\n }\n\n // If the current character is an end-of-line, we can process the\n // line\n if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n // If the current character is a carriage return, we need to\n // set the crlfCheck flag to true, as we need to check if the\n // next character is a line feed\n if (this.buffer[this.pos] === CR) {\n this.crlfCheck = true\n }\n\n // In any case, we can process the line as we reached an\n // end-of-line character\n this.parseLine(this.buffer.subarray(0, this.pos), this.event)\n\n // Remove the processed line from the buffer\n this.buffer = this.buffer.subarray(this.pos + 1)\n // Reset the position as we removed the processed line from the buffer\n this.pos = 0\n // A line was processed and this could be the end of the event. We need\n // to check if the next line is empty to determine if the event is\n // finished.\n this.eventEndCheck = true\n continue\n }\n\n this.pos++\n }\n\n callback()\n }\n\n /**\n * @param {Buffer} line\n * @param {EventStreamEvent} event\n */\n parseLine (line, event) {\n // If the line is empty (a blank line)\n // Dispatch the event, as defined below.\n // This will be handled in the _transform method\n if (line.length === 0) {\n return\n }\n\n // If the line starts with a U+003A COLON character (:)\n // Ignore the line.\n const colonPosition = line.indexOf(COLON)\n if (colonPosition === 0) {\n return\n }\n\n let field = ''\n let value = ''\n\n // If the line contains a U+003A COLON character (:)\n if (colonPosition !== -1) {\n // Collect the characters on the line before the first U+003A COLON\n // character (:), and let field be that string.\n // TODO: Investigate if there is a more performant way to extract the\n // field\n // see: https://github.com/nodejs/undici/issues/2630\n field = line.subarray(0, colonPosition).toString('utf8')\n\n // Collect the characters on the line after the first U+003A COLON\n // character (:), and let value be that string.\n // If value starts with a U+0020 SPACE character, remove it from value.\n let valueStart = colonPosition + 1\n if (line[valueStart] === SPACE) {\n ++valueStart\n }\n // TODO: Investigate if there is a more performant way to extract the\n // value\n // see: https://github.com/nodejs/undici/issues/2630\n value = line.subarray(valueStart).toString('utf8')\n\n // Otherwise, the string is not empty but does not contain a U+003A COLON\n // character (:)\n } else {\n // Process the field using the steps described below, using the whole\n // line as the field name, and the empty string as the field value.\n field = line.toString('utf8')\n value = ''\n }\n\n // Modify the event with the field name and value. The value is also\n // decoded as UTF-8\n switch (field) {\n case 'data':\n if (event[field] === undefined) {\n event[field] = value\n } else {\n event[field] += `\\n${value}`\n }\n break\n case 'retry':\n if (isASCIINumber(value)) {\n event[field] = value\n }\n break\n case 'id':\n if (isValidLastEventId(value)) {\n event[field] = value\n }\n break\n case 'event':\n if (value.length > 0) {\n event[field] = value\n }\n break\n }\n }\n\n /**\n * @param {EventSourceStreamEvent} event\n */\n processEvent (event) {\n if (event.retry && isASCIINumber(event.retry)) {\n this.state.reconnectionTime = parseInt(event.retry, 10)\n }\n\n if (event.id && isValidLastEventId(event.id)) {\n this.state.lastEventId = event.id\n }\n\n // only dispatch event, when data is provided\n if (event.data !== undefined) {\n this.push({\n type: event.event || 'message',\n options: {\n data: event.data,\n lastEventId: this.state.lastEventId,\n origin: this.state.origin\n }\n })\n }\n }\n\n clearEvent () {\n this.event = {\n data: undefined,\n event: undefined,\n id: undefined,\n retry: undefined\n }\n }\n}\n\nmodule.exports = {\n EventSourceStream\n}\n","'use strict'\n\nconst { pipeline } = require('node:stream')\nconst { fetching } = require('../fetch')\nconst { makeRequest } = require('../fetch/request')\nconst { webidl } = require('../fetch/webidl')\nconst { EventSourceStream } = require('./eventsource-stream')\nconst { parseMIMEType } = require('../fetch/data-url')\nconst { createFastMessageEvent } = require('../websocket/events')\nconst { isNetworkError } = require('../fetch/response')\nconst { delay } = require('./util')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { environmentSettingsObject } = require('../fetch/util')\n\nlet experimentalWarned = false\n\n/**\n * A reconnection time, in milliseconds. This must initially be an implementation-defined value,\n * probably in the region of a few seconds.\n *\n * In Comparison:\n * - Chrome uses 3000ms.\n * - Deno uses 5000ms.\n *\n * @type {3000}\n */\nconst defaultReconnectionTime = 3000\n\n/**\n * The readyState attribute represents the state of the connection.\n * @enum\n * @readonly\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev\n */\n\n/**\n * The connection has not yet been established, or it was closed and the user\n * agent is reconnecting.\n * @type {0}\n */\nconst CONNECTING = 0\n\n/**\n * The user agent has an open connection and is dispatching events as it\n * receives them.\n * @type {1}\n */\nconst OPEN = 1\n\n/**\n * The connection is not open, and the user agent is not trying to reconnect.\n * @type {2}\n */\nconst CLOSED = 2\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"same-origin\".\n * @type {'anonymous'}\n */\nconst ANONYMOUS = 'anonymous'\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"include\".\n * @type {'use-credentials'}\n */\nconst USE_CREDENTIALS = 'use-credentials'\n\n/**\n * The EventSource interface is used to receive server-sent events. It\n * connects to a server over HTTP and receives events in text/event-stream\n * format without closing the connection.\n * @extends {EventTarget}\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events\n * @api public\n */\nclass EventSource extends EventTarget {\n #events = {\n open: null,\n error: null,\n message: null\n }\n\n #url = null\n #withCredentials = false\n\n #readyState = CONNECTING\n\n #request = null\n #controller = null\n\n #dispatcher\n\n /**\n * @type {import('./eventsource-stream').eventSourceSettings}\n */\n #state\n\n /**\n * Creates a new EventSource object.\n * @param {string} url\n * @param {EventSourceInit} [eventSourceInitDict]\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface\n */\n constructor (url, eventSourceInitDict = {}) {\n // 1. Let ev be a new EventSource object.\n super()\n\n webidl.util.markAsUncloneable(this)\n\n const prefix = 'EventSource constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n if (!experimentalWarned) {\n experimentalWarned = true\n process.emitWarning('EventSource is experimental, expect them to change at any time.', {\n code: 'UNDICI-ES'\n })\n }\n\n url = webidl.converters.USVString(url, prefix, 'url')\n eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')\n\n this.#dispatcher = eventSourceInitDict.dispatcher\n this.#state = {\n lastEventId: '',\n reconnectionTime: defaultReconnectionTime\n }\n\n // 2. Let settings be ev's relevant settings object.\n // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object\n const settings = environmentSettingsObject\n\n let urlRecord\n\n try {\n // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.\n urlRecord = new URL(url, settings.settingsObject.baseUrl)\n this.#state.origin = urlRecord.origin\n } catch (e) {\n // 4. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n throw new DOMException(e, 'SyntaxError')\n }\n\n // 5. Set ev's url to urlRecord.\n this.#url = urlRecord.href\n\n // 6. Let corsAttributeState be Anonymous.\n let corsAttributeState = ANONYMOUS\n\n // 7. If the value of eventSourceInitDict's withCredentials member is true,\n // then set corsAttributeState to Use Credentials and set ev's\n // withCredentials attribute to true.\n if (eventSourceInitDict.withCredentials) {\n corsAttributeState = USE_CREDENTIALS\n this.#withCredentials = true\n }\n\n // 8. Let request be the result of creating a potential-CORS request given\n // urlRecord, the empty string, and corsAttributeState.\n const initRequest = {\n redirect: 'follow',\n keepalive: true,\n // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes\n mode: 'cors',\n credentials: corsAttributeState === 'anonymous'\n ? 'same-origin'\n : 'omit',\n referrer: 'no-referrer'\n }\n\n // 9. Set request's client to settings.\n initRequest.client = environmentSettingsObject.settingsObject\n\n // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.\n initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]]\n\n // 11. Set request's cache mode to \"no-store\".\n initRequest.cache = 'no-store'\n\n // 12. Set request's initiator type to \"other\".\n initRequest.initiator = 'other'\n\n initRequest.urlList = [new URL(this.#url)]\n\n // 13. Set ev's request to request.\n this.#request = makeRequest(initRequest)\n\n this.#connect()\n }\n\n /**\n * Returns the state of this EventSource object's connection. It can have the\n * values described below.\n * @returns {0|1|2}\n * @readonly\n */\n get readyState () {\n return this.#readyState\n }\n\n /**\n * Returns the URL providing the event stream.\n * @readonly\n * @returns {string}\n */\n get url () {\n return this.#url\n }\n\n /**\n * Returns a boolean indicating whether the EventSource object was\n * instantiated with CORS credentials set (true), or not (false, the default).\n */\n get withCredentials () {\n return this.#withCredentials\n }\n\n #connect () {\n if (this.#readyState === CLOSED) return\n\n this.#readyState = CONNECTING\n\n const fetchParams = {\n request: this.#request,\n dispatcher: this.#dispatcher\n }\n\n // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.\n const processEventSourceEndOfBody = (response) => {\n if (isNetworkError(response)) {\n this.dispatchEvent(new Event('error'))\n this.close()\n }\n\n this.#reconnect()\n }\n\n // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...\n fetchParams.processResponseEndOfBody = processEventSourceEndOfBody\n\n // and processResponse set to the following steps given response res:\n fetchParams.processResponse = (response) => {\n // 1. If res is an aborted network error, then fail the connection.\n\n if (isNetworkError(response)) {\n // 1. When a user agent is to fail the connection, the user agent\n // must queue a task which, if the readyState attribute is set to a\n // value other than CLOSED, sets the readyState attribute to CLOSED\n // and fires an event named error at the EventSource object. Once the\n // user agent has failed the connection, it does not attempt to\n // reconnect.\n if (response.aborted) {\n this.close()\n this.dispatchEvent(new Event('error'))\n return\n // 2. Otherwise, if res is a network error, then reestablish the\n // connection, unless the user agent knows that to be futile, in\n // which case the user agent may fail the connection.\n } else {\n this.#reconnect()\n return\n }\n }\n\n // 3. Otherwise, if res's status is not 200, or if res's `Content-Type`\n // is not `text/event-stream`, then fail the connection.\n const contentType = response.headersList.get('content-type', true)\n const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'\n const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'\n if (\n response.status !== 200 ||\n contentTypeValid === false\n ) {\n this.close()\n this.dispatchEvent(new Event('error'))\n return\n }\n\n // 4. Otherwise, announce the connection and interpret res's body\n // line by line.\n\n // When a user agent is to announce the connection, the user agent\n // must queue a task which, if the readyState attribute is set to a\n // value other than CLOSED, sets the readyState attribute to OPEN\n // and fires an event named open at the EventSource object.\n // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n this.#readyState = OPEN\n this.dispatchEvent(new Event('open'))\n\n // If redirected to a different origin, set the origin to the new origin.\n this.#state.origin = response.urlList[response.urlList.length - 1].origin\n\n const eventSourceStream = new EventSourceStream({\n eventSourceSettings: this.#state,\n push: (event) => {\n this.dispatchEvent(createFastMessageEvent(\n event.type,\n event.options\n ))\n }\n })\n\n pipeline(response.body.stream,\n eventSourceStream,\n (error) => {\n if (\n error?.aborted === false\n ) {\n this.close()\n this.dispatchEvent(new Event('error'))\n }\n })\n }\n\n this.#controller = fetching(fetchParams)\n }\n\n /**\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n * @returns {Promise}\n */\n async #reconnect () {\n // When a user agent is to reestablish the connection, the user agent must\n // run the following steps. These steps are run in parallel, not as part of\n // a task. (The tasks that it queues, of course, are run like normal tasks\n // and not themselves in parallel.)\n\n // 1. Queue a task to run the following steps:\n\n // 1. If the readyState attribute is set to CLOSED, abort the task.\n if (this.#readyState === CLOSED) return\n\n // 2. Set the readyState attribute to CONNECTING.\n this.#readyState = CONNECTING\n\n // 3. Fire an event named error at the EventSource object.\n this.dispatchEvent(new Event('error'))\n\n // 2. Wait a delay equal to the reconnection time of the event source.\n await delay(this.#state.reconnectionTime)\n\n // 5. Queue a task to run the following steps:\n\n // 1. If the EventSource object's readyState attribute is not set to\n // CONNECTING, then return.\n if (this.#readyState !== CONNECTING) return\n\n // 2. Let request be the EventSource object's request.\n // 3. If the EventSource object's last event ID string is not the empty\n // string, then:\n // 1. Let lastEventIDValue be the EventSource object's last event ID\n // string, encoded as UTF-8.\n // 2. Set (`Last-Event-ID`, lastEventIDValue) in request's header\n // list.\n if (this.#state.lastEventId.length) {\n this.#request.headersList.set('last-event-id', this.#state.lastEventId, true)\n }\n\n // 4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.\n this.#connect()\n }\n\n /**\n * Closes the connection, if any, and sets the readyState attribute to\n * CLOSED.\n */\n close () {\n webidl.brandCheck(this, EventSource)\n\n if (this.#readyState === CLOSED) return\n this.#readyState = CLOSED\n this.#controller.abort()\n this.#request = null\n }\n\n get onopen () {\n return this.#events.open\n }\n\n set onopen (fn) {\n if (this.#events.open) {\n this.removeEventListener('open', this.#events.open)\n }\n\n if (typeof fn === 'function') {\n this.#events.open = fn\n this.addEventListener('open', fn)\n } else {\n this.#events.open = null\n }\n }\n\n get onmessage () {\n return this.#events.message\n }\n\n set onmessage (fn) {\n if (this.#events.message) {\n this.removeEventListener('message', this.#events.message)\n }\n\n if (typeof fn === 'function') {\n this.#events.message = fn\n this.addEventListener('message', fn)\n } else {\n this.#events.message = null\n }\n }\n\n get onerror () {\n return this.#events.error\n }\n\n set onerror (fn) {\n if (this.#events.error) {\n this.removeEventListener('error', this.#events.error)\n }\n\n if (typeof fn === 'function') {\n this.#events.error = fn\n this.addEventListener('error', fn)\n } else {\n this.#events.error = null\n }\n }\n}\n\nconst constantsPropertyDescriptors = {\n CONNECTING: {\n __proto__: null,\n configurable: false,\n enumerable: true,\n value: CONNECTING,\n writable: false\n },\n OPEN: {\n __proto__: null,\n configurable: false,\n enumerable: true,\n value: OPEN,\n writable: false\n },\n CLOSED: {\n __proto__: null,\n configurable: false,\n enumerable: true,\n value: CLOSED,\n writable: false\n }\n}\n\nObject.defineProperties(EventSource, constantsPropertyDescriptors)\nObject.defineProperties(EventSource.prototype, constantsPropertyDescriptors)\n\nObject.defineProperties(EventSource.prototype, {\n close: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onmessage: kEnumerableProperty,\n onopen: kEnumerableProperty,\n readyState: kEnumerableProperty,\n url: kEnumerableProperty,\n withCredentials: kEnumerableProperty\n})\n\nwebidl.converters.EventSourceInitDict = webidl.dictionaryConverter([\n {\n key: 'withCredentials',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'dispatcher', // undici only\n converter: webidl.converters.any\n }\n])\n\nmodule.exports = {\n EventSource,\n defaultReconnectionTime\n}\n","'use strict'\n\n/**\n * Checks if the given value is a valid LastEventId.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isValidLastEventId (value) {\n // LastEventId should not contain U+0000 NULL\n return value.indexOf('\\u0000') === -1\n}\n\n/**\n * Checks if the given value is a base 10 digit.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isASCIINumber (value) {\n if (value.length === 0) return false\n for (let i = 0; i < value.length; i++) {\n if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false\n }\n return true\n}\n\n// https://github.com/nodejs/undici/issues/2664\nfunction delay (ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms).unref()\n })\n}\n\nmodule.exports = {\n isValidLastEventId,\n isASCIINumber,\n delay\n}\n","'use strict'\n\nconst util = require('../../core/util')\nconst {\n ReadableStreamFrom,\n isBlobLike,\n isReadableStreamLike,\n readableStreamClose,\n createDeferredPromise,\n fullyReadBody,\n extractMimeType,\n utf8DecodeBytes\n} = require('./util')\nconst { FormData } = require('./formdata')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { Blob } = require('node:buffer')\nconst assert = require('node:assert')\nconst { isErrored, isDisturbed } = require('node:stream')\nconst { isArrayBuffer } = require('node:util/types')\nconst { serializeAMimeType } = require('./data-url')\nconst { multipartFormDataParser } = require('./formdata-parser')\nlet random\n\ntry {\n const crypto = require('node:crypto')\n random = (max) => crypto.randomInt(0, max)\n} catch {\n random = (max) => Math.floor(Math.random(max))\n}\n\nconst textEncoder = new TextEncoder()\nfunction noop () {}\n\nconst hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0\nlet streamRegistry\n\nif (hasFinalizationRegistry) {\n streamRegistry = new FinalizationRegistry((weakRef) => {\n const stream = weakRef.deref()\n if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {\n stream.cancel('Response object has been garbage collected').catch(noop)\n }\n })\n}\n\n// https://fetch.spec.whatwg.org/#concept-bodyinit-extract\nfunction extractBody (object, keepalive = false) {\n // 1. Let stream be null.\n let stream = null\n\n // 2. If object is a ReadableStream object, then set stream to object.\n if (object instanceof ReadableStream) {\n stream = object\n } else if (isBlobLike(object)) {\n // 3. Otherwise, if object is a Blob object, set stream to the\n // result of running object’s get stream.\n stream = object.stream()\n } else {\n // 4. Otherwise, set stream to a new ReadableStream object, and set\n // up stream with byte reading support.\n stream = new ReadableStream({\n async pull (controller) {\n const buffer = typeof source === 'string' ? textEncoder.encode(source) : source\n\n if (buffer.byteLength) {\n controller.enqueue(buffer)\n }\n\n queueMicrotask(() => readableStreamClose(controller))\n },\n start () {},\n type: 'bytes'\n })\n }\n\n // 5. Assert: stream is a ReadableStream object.\n assert(isReadableStreamLike(stream))\n\n // 6. Let action be null.\n let action = null\n\n // 7. Let source be null.\n let source = null\n\n // 8. Let length be null.\n let length = null\n\n // 9. Let type be null.\n let type = null\n\n // 10. Switch on object:\n if (typeof object === 'string') {\n // Set source to the UTF-8 encoding of object.\n // Note: setting source to a Uint8Array here breaks some mocking assumptions.\n source = object\n\n // Set type to `text/plain;charset=UTF-8`.\n type = 'text/plain;charset=UTF-8'\n } else if (object instanceof URLSearchParams) {\n // URLSearchParams\n\n // spec says to run application/x-www-form-urlencoded on body.list\n // this is implemented in Node.js as apart of an URLSearchParams instance toString method\n // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490\n // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100\n\n // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.\n source = object.toString()\n\n // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.\n type = 'application/x-www-form-urlencoded;charset=UTF-8'\n } else if (isArrayBuffer(object)) {\n // BufferSource/ArrayBuffer\n\n // Set source to a copy of the bytes held by object.\n source = new Uint8Array(object.slice())\n } else if (ArrayBuffer.isView(object)) {\n // BufferSource/ArrayBufferView\n\n // Set source to a copy of the bytes held by object.\n source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))\n } else if (util.isFormDataLike(object)) {\n const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`\n const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n /*! formdata-polyfill. MIT License. Jimmy Wärting */\n const escape = (str) =>\n str.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n const normalizeLinefeeds = (value) => value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n\n // Set action to this step: run the multipart/form-data\n // encoding algorithm, with object’s entry list and UTF-8.\n // - This ensures that the body is immutable and can't be changed afterwords\n // - That the content-length is calculated in advance.\n // - And that all parts are pre-encoded and ready to be sent.\n\n const blobParts = []\n const rn = new Uint8Array([13, 10]) // '\\r\\n'\n length = 0\n let hasUnknownSizeValue = false\n\n for (const [name, value] of object) {\n if (typeof value === 'string') {\n const chunk = textEncoder.encode(prefix +\n `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`)\n blobParts.push(chunk)\n length += chunk.byteLength\n } else {\n const chunk = textEncoder.encode(`${prefix}; name=\"${escape(normalizeLinefeeds(name))}\"` +\n (value.name ? `; filename=\"${escape(value.name)}\"` : '') + '\\r\\n' +\n `Content-Type: ${\n value.type || 'application/octet-stream'\n }\\r\\n\\r\\n`)\n blobParts.push(chunk, value, rn)\n if (typeof value.size === 'number') {\n length += chunk.byteLength + value.size + rn.byteLength\n } else {\n hasUnknownSizeValue = true\n }\n }\n }\n\n // CRLF is appended to the body to function with legacy servers and match other implementations.\n // https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030\n // https://github.com/form-data/form-data/issues/63\n const chunk = textEncoder.encode(`--${boundary}--\\r\\n`)\n blobParts.push(chunk)\n length += chunk.byteLength\n if (hasUnknownSizeValue) {\n length = null\n }\n\n // Set source to object.\n source = object\n\n action = async function * () {\n for (const part of blobParts) {\n if (part.stream) {\n yield * part.stream()\n } else {\n yield part\n }\n }\n }\n\n // Set type to `multipart/form-data; boundary=`,\n // followed by the multipart/form-data boundary string generated\n // by the multipart/form-data encoding algorithm.\n type = `multipart/form-data; boundary=${boundary}`\n } else if (isBlobLike(object)) {\n // Blob\n\n // Set source to object.\n source = object\n\n // Set length to object’s size.\n length = object.size\n\n // If object’s type attribute is not the empty byte sequence, set\n // type to its value.\n if (object.type) {\n type = object.type\n }\n } else if (typeof object[Symbol.asyncIterator] === 'function') {\n // If keepalive is true, then throw a TypeError.\n if (keepalive) {\n throw new TypeError('keepalive')\n }\n\n // If object is disturbed or locked, then throw a TypeError.\n if (util.isDisturbed(object) || object.locked) {\n throw new TypeError(\n 'Response body object should not be disturbed or locked'\n )\n }\n\n stream =\n object instanceof ReadableStream ? object : ReadableStreamFrom(object)\n }\n\n // 11. If source is a byte sequence, then set action to a\n // step that returns source and length to source’s length.\n if (typeof source === 'string' || util.isBuffer(source)) {\n length = Buffer.byteLength(source)\n }\n\n // 12. If action is non-null, then run these steps in in parallel:\n if (action != null) {\n // Run action.\n let iterator\n stream = new ReadableStream({\n async start () {\n iterator = action(object)[Symbol.asyncIterator]()\n },\n async pull (controller) {\n const { value, done } = await iterator.next()\n if (done) {\n // When running action is done, close stream.\n queueMicrotask(() => {\n controller.close()\n controller.byobRequest?.respond(0)\n })\n } else {\n // Whenever one or more bytes are available and stream is not errored,\n // enqueue a Uint8Array wrapping an ArrayBuffer containing the available\n // bytes into stream.\n if (!isErrored(stream)) {\n const buffer = new Uint8Array(value)\n if (buffer.byteLength) {\n controller.enqueue(buffer)\n }\n }\n }\n return controller.desiredSize > 0\n },\n async cancel (reason) {\n await iterator.return()\n },\n type: 'bytes'\n })\n }\n\n // 13. Let body be a body whose stream is stream, source is source,\n // and length is length.\n const body = { stream, source, length }\n\n // 14. Return (body, type).\n return [body, type]\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit-safely-extract\nfunction safelyExtractBody (object, keepalive = false) {\n // To safely extract a body and a `Content-Type` value from\n // a byte sequence or BodyInit object object, run these steps:\n\n // 1. If object is a ReadableStream object, then:\n if (object instanceof ReadableStream) {\n // Assert: object is neither disturbed nor locked.\n // istanbul ignore next\n assert(!util.isDisturbed(object), 'The body has already been consumed.')\n // istanbul ignore next\n assert(!object.locked, 'The stream is locked.')\n }\n\n // 2. Return the results of extracting object.\n return extractBody(object, keepalive)\n}\n\nfunction cloneBody (instance, body) {\n // To clone a body body, run these steps:\n\n // https://fetch.spec.whatwg.org/#concept-body-clone\n\n // 1. Let « out1, out2 » be the result of teeing body’s stream.\n const [out1, out2] = body.stream.tee()\n\n // 2. Set body’s stream to out1.\n body.stream = out1\n\n // 3. Return a body whose stream is out2 and other members are copied from body.\n return {\n stream: out2,\n length: body.length,\n source: body.source\n }\n}\n\nfunction throwIfAborted (state) {\n if (state.aborted) {\n throw new DOMException('The operation was aborted.', 'AbortError')\n }\n}\n\nfunction bodyMixinMethods (instance) {\n const methods = {\n blob () {\n // The blob() method steps are to return the result of\n // running consume body with this and the following step\n // given a byte sequence bytes: return a Blob whose\n // contents are bytes and whose type attribute is this’s\n // MIME type.\n return consumeBody(this, (bytes) => {\n let mimeType = bodyMimeType(this)\n\n if (mimeType === null) {\n mimeType = ''\n } else if (mimeType) {\n mimeType = serializeAMimeType(mimeType)\n }\n\n // Return a Blob whose contents are bytes and type attribute\n // is mimeType.\n return new Blob([bytes], { type: mimeType })\n }, instance)\n },\n\n arrayBuffer () {\n // The arrayBuffer() method steps are to return the result\n // of running consume body with this and the following step\n // given a byte sequence bytes: return a new ArrayBuffer\n // whose contents are bytes.\n return consumeBody(this, (bytes) => {\n return new Uint8Array(bytes).buffer\n }, instance)\n },\n\n text () {\n // The text() method steps are to return the result of running\n // consume body with this and UTF-8 decode.\n return consumeBody(this, utf8DecodeBytes, instance)\n },\n\n json () {\n // The json() method steps are to return the result of running\n // consume body with this and parse JSON from bytes.\n return consumeBody(this, parseJSONFromBytes, instance)\n },\n\n formData () {\n // The formData() method steps are to return the result of running\n // consume body with this and the following step given a byte sequence bytes:\n return consumeBody(this, (value) => {\n // 1. Let mimeType be the result of get the MIME type with this.\n const mimeType = bodyMimeType(this)\n\n // 2. If mimeType is non-null, then switch on mimeType’s essence and run\n // the corresponding steps:\n if (mimeType !== null) {\n switch (mimeType.essence) {\n case 'multipart/form-data': {\n // 1. ... [long step]\n const parsed = multipartFormDataParser(value, mimeType)\n\n // 2. If that fails for some reason, then throw a TypeError.\n if (parsed === 'failure') {\n throw new TypeError('Failed to parse body as FormData.')\n }\n\n // 3. Return a new FormData object, appending each entry,\n // resulting from the parsing operation, to its entry list.\n const fd = new FormData()\n fd[kState] = parsed\n\n return fd\n }\n case 'application/x-www-form-urlencoded': {\n // 1. Let entries be the result of parsing bytes.\n const entries = new URLSearchParams(value.toString())\n\n // 2. If entries is failure, then throw a TypeError.\n\n // 3. Return a new FormData object whose entry list is entries.\n const fd = new FormData()\n\n for (const [name, value] of entries) {\n fd.append(name, value)\n }\n\n return fd\n }\n }\n }\n\n // 3. Throw a TypeError.\n throw new TypeError(\n 'Content-Type was not one of \"multipart/form-data\" or \"application/x-www-form-urlencoded\".'\n )\n }, instance)\n },\n\n bytes () {\n // The bytes() method steps are to return the result of running consume body\n // with this and the following step given a byte sequence bytes: return the\n // result of creating a Uint8Array from bytes in this’s relevant realm.\n return consumeBody(this, (bytes) => {\n return new Uint8Array(bytes)\n }, instance)\n }\n }\n\n return methods\n}\n\nfunction mixinBody (prototype) {\n Object.assign(prototype.prototype, bodyMixinMethods(prototype))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-consume-body\n * @param {Response|Request} object\n * @param {(value: unknown) => unknown} convertBytesToJSValue\n * @param {Response|Request} instance\n */\nasync function consumeBody (object, convertBytesToJSValue, instance) {\n webidl.brandCheck(object, instance)\n\n // 1. If object is unusable, then return a promise rejected\n // with a TypeError.\n if (bodyUnusable(object)) {\n throw new TypeError('Body is unusable: Body has already been read')\n }\n\n throwIfAborted(object[kState])\n\n // 2. Let promise be a new promise.\n const promise = createDeferredPromise()\n\n // 3. Let errorSteps given error be to reject promise with error.\n const errorSteps = (error) => promise.reject(error)\n\n // 4. Let successSteps given a byte sequence data be to resolve\n // promise with the result of running convertBytesToJSValue\n // with data. If that threw an exception, then run errorSteps\n // with that exception.\n const successSteps = (data) => {\n try {\n promise.resolve(convertBytesToJSValue(data))\n } catch (e) {\n errorSteps(e)\n }\n }\n\n // 5. If object’s body is null, then run successSteps with an\n // empty byte sequence.\n if (object[kState].body == null) {\n successSteps(Buffer.allocUnsafe(0))\n return promise.promise\n }\n\n // 6. Otherwise, fully read object’s body given successSteps,\n // errorSteps, and object’s relevant global object.\n await fullyReadBody(object[kState].body, successSteps, errorSteps)\n\n // 7. Return promise.\n return promise.promise\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction bodyUnusable (object) {\n const body = object[kState].body\n\n // An object including the Body interface mixin is\n // said to be unusable if its body is non-null and\n // its body’s stream is disturbed or locked.\n return body != null && (body.stream.locked || util.isDisturbed(body.stream))\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value\n * @param {Uint8Array} bytes\n */\nfunction parseJSONFromBytes (bytes) {\n return JSON.parse(utf8DecodeBytes(bytes))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-mime-type\n * @param {import('./response').Response|import('./request').Request} requestOrResponse\n */\nfunction bodyMimeType (requestOrResponse) {\n // 1. Let headers be null.\n // 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.\n // 3. Otherwise, set headers to requestOrResponse’s response’s header list.\n /** @type {import('./headers').HeadersList} */\n const headers = requestOrResponse[kState].headersList\n\n // 4. Let mimeType be the result of extracting a MIME type from headers.\n const mimeType = extractMimeType(headers)\n\n // 5. If mimeType is failure, then return null.\n if (mimeType === 'failure') {\n return null\n }\n\n // 6. Return mimeType.\n return mimeType\n}\n\nmodule.exports = {\n extractBody,\n safelyExtractBody,\n cloneBody,\n mixinBody,\n streamRegistry,\n hasFinalizationRegistry,\n bodyUnusable\n}\n","'use strict'\n\nconst corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])\n\nconst redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])\nconst redirectStatusSet = new Set(redirectStatus)\n\n/**\n * @see https://fetch.spec.whatwg.org/#block-bad-port\n */\nconst badPorts = /** @type {const} */ ([\n '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',\n '6697', '10080'\n])\nconst badPortsSet = new Set(badPorts)\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\n */\nconst referrerPolicy = /** @type {const} */ ([\n '',\n 'no-referrer',\n 'no-referrer-when-downgrade',\n 'same-origin',\n 'origin',\n 'strict-origin',\n 'origin-when-cross-origin',\n 'strict-origin-when-cross-origin',\n 'unsafe-url'\n])\nconst referrerPolicySet = new Set(referrerPolicy)\n\nconst requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])\n\nconst safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])\n\nconst requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])\n\nconst requestCache = /** @type {const} */ ([\n 'default',\n 'no-store',\n 'reload',\n 'no-cache',\n 'force-cache',\n 'only-if-cached'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-body-header-name\n */\nconst requestBodyHeader = /** @type {const} */ ([\n 'content-encoding',\n 'content-language',\n 'content-location',\n 'content-type',\n // See https://github.com/nodejs/undici/issues/2021\n // 'Content-Length' is a forbidden header name, which is typically\n // removed in the Headers implementation. However, undici doesn't\n // filter out headers, so we add it here.\n 'content-length'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex\n */\nconst requestDuplex = /** @type {const} */ ([\n 'half'\n])\n\n/**\n * @see http://fetch.spec.whatwg.org/#forbidden-method\n */\nconst forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = /** @type {const} */ ([\n 'audio',\n 'audioworklet',\n 'font',\n 'image',\n 'manifest',\n 'paintworklet',\n 'script',\n 'style',\n 'track',\n 'video',\n 'xslt',\n ''\n])\nconst subresourceSet = new Set(subresource)\n\nmodule.exports = {\n subresource,\n forbiddenMethods,\n requestBodyHeader,\n referrerPolicy,\n requestRedirect,\n requestMode,\n requestCredentials,\n requestCache,\n redirectStatus,\n corsSafeListedMethods,\n nullBodyStatus,\n safeMethods,\n badPorts,\n requestDuplex,\n subresourceSet,\n badPortsSet,\n redirectStatusSet,\n corsSafeListedMethodsSet,\n safeMethodsSet,\n forbiddenMethodsSet,\n referrerPolicySet\n}\n","'use strict'\n\nconst assert = require('node:assert')\n\nconst encoder = new TextEncoder()\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-token-code-point\n */\nconst HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\\-.^_|~A-Za-z0-9]+$/\nconst HTTP_WHITESPACE_REGEX = /[\\u000A\\u000D\\u0009\\u0020]/ // eslint-disable-line\nconst ASCII_WHITESPACE_REPLACE_REGEX = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/g // eslint-disable-line\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point\n */\nconst HTTP_QUOTED_STRING_TOKENS = /^[\\u0009\\u0020-\\u007E\\u0080-\\u00FF]+$/ // eslint-disable-line\n\n// https://fetch.spec.whatwg.org/#data-url-processor\n/** @param {URL} dataURL */\nfunction dataURLProcessor (dataURL) {\n // 1. Assert: dataURL’s scheme is \"data\".\n assert(dataURL.protocol === 'data:')\n\n // 2. Let input be the result of running the URL\n // serializer on dataURL with exclude fragment\n // set to true.\n let input = URLSerializer(dataURL, true)\n\n // 3. Remove the leading \"data:\" string from input.\n input = input.slice(5)\n\n // 4. Let position point at the start of input.\n const position = { position: 0 }\n\n // 5. Let mimeType be the result of collecting a\n // sequence of code points that are not equal\n // to U+002C (,), given position.\n let mimeType = collectASequenceOfCodePointsFast(\n ',',\n input,\n position\n )\n\n // 6. Strip leading and trailing ASCII whitespace\n // from mimeType.\n // Undici implementation note: we need to store the\n // length because if the mimetype has spaces removed,\n // the wrong amount will be sliced from the input in\n // step #9\n const mimeTypeLength = mimeType.length\n mimeType = removeASCIIWhitespace(mimeType, true, true)\n\n // 7. If position is past the end of input, then\n // return failure\n if (position.position >= input.length) {\n return 'failure'\n }\n\n // 8. Advance position by 1.\n position.position++\n\n // 9. Let encodedBody be the remainder of input.\n const encodedBody = input.slice(mimeTypeLength + 1)\n\n // 10. Let body be the percent-decoding of encodedBody.\n let body = stringPercentDecode(encodedBody)\n\n // 11. If mimeType ends with U+003B (;), followed by\n // zero or more U+0020 SPACE, followed by an ASCII\n // case-insensitive match for \"base64\", then:\n if (/;(\\u0020){0,}base64$/i.test(mimeType)) {\n // 1. Let stringBody be the isomorphic decode of body.\n const stringBody = isomorphicDecode(body)\n\n // 2. Set body to the forgiving-base64 decode of\n // stringBody.\n body = forgivingBase64(stringBody)\n\n // 3. If body is failure, then return failure.\n if (body === 'failure') {\n return 'failure'\n }\n\n // 4. Remove the last 6 code points from mimeType.\n mimeType = mimeType.slice(0, -6)\n\n // 5. Remove trailing U+0020 SPACE code points from mimeType,\n // if any.\n mimeType = mimeType.replace(/(\\u0020)+$/, '')\n\n // 6. Remove the last U+003B (;) code point from mimeType.\n mimeType = mimeType.slice(0, -1)\n }\n\n // 12. If mimeType starts with U+003B (;), then prepend\n // \"text/plain\" to mimeType.\n if (mimeType.startsWith(';')) {\n mimeType = 'text/plain' + mimeType\n }\n\n // 13. Let mimeTypeRecord be the result of parsing\n // mimeType.\n let mimeTypeRecord = parseMIMEType(mimeType)\n\n // 14. If mimeTypeRecord is failure, then set\n // mimeTypeRecord to text/plain;charset=US-ASCII.\n if (mimeTypeRecord === 'failure') {\n mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')\n }\n\n // 15. Return a new data: URL struct whose MIME\n // type is mimeTypeRecord and body is body.\n // https://fetch.spec.whatwg.org/#data-url-struct\n return { mimeType: mimeTypeRecord, body }\n}\n\n// https://url.spec.whatwg.org/#concept-url-serializer\n/**\n * @param {URL} url\n * @param {boolean} excludeFragment\n */\nfunction URLSerializer (url, excludeFragment = false) {\n if (!excludeFragment) {\n return url.href\n }\n\n const href = url.href\n const hashLength = url.hash.length\n\n const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength)\n\n if (!hashLength && href.endsWith('#')) {\n return serialized.slice(0, -1)\n }\n\n return serialized\n}\n\n// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n/**\n * @param {(char: string) => boolean} condition\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePoints (condition, input, position) {\n // 1. Let result be the empty string.\n let result = ''\n\n // 2. While position doesn’t point past the end of input and the\n // code point at position within input meets the condition condition:\n while (position.position < input.length && condition(input[position.position])) {\n // 1. Append that code point to the end of result.\n result += input[position.position]\n\n // 2. Advance position by 1.\n position.position++\n }\n\n // 3. Return result.\n return result\n}\n\n/**\n * A faster collectASequenceOfCodePoints that only works when comparing a single character.\n * @param {string} char\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePointsFast (char, input, position) {\n const idx = input.indexOf(char, position.position)\n const start = position.position\n\n if (idx === -1) {\n position.position = input.length\n return input.slice(start)\n }\n\n position.position = idx\n return input.slice(start, position.position)\n}\n\n// https://url.spec.whatwg.org/#string-percent-decode\n/** @param {string} input */\nfunction stringPercentDecode (input) {\n // 1. Let bytes be the UTF-8 encoding of input.\n const bytes = encoder.encode(input)\n\n // 2. Return the percent-decoding of bytes.\n return percentDecode(bytes)\n}\n\n/**\n * @param {number} byte\n */\nfunction isHexCharByte (byte) {\n // 0-9 A-F a-f\n return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66)\n}\n\n/**\n * @param {number} byte\n */\nfunction hexByteToNumber (byte) {\n return (\n // 0-9\n byte >= 0x30 && byte <= 0x39\n ? (byte - 48)\n // Convert to uppercase\n // ((byte & 0xDF) - 65) + 10\n : ((byte & 0xDF) - 55)\n )\n}\n\n// https://url.spec.whatwg.org/#percent-decode\n/** @param {Uint8Array} input */\nfunction percentDecode (input) {\n const length = input.length\n // 1. Let output be an empty byte sequence.\n /** @type {Uint8Array} */\n const output = new Uint8Array(length)\n let j = 0\n // 2. For each byte byte in input:\n for (let i = 0; i < length; ++i) {\n const byte = input[i]\n\n // 1. If byte is not 0x25 (%), then append byte to output.\n if (byte !== 0x25) {\n output[j++] = byte\n\n // 2. Otherwise, if byte is 0x25 (%) and the next two bytes\n // after byte in input are not in the ranges\n // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),\n // and 0x61 (a) to 0x66 (f), all inclusive, append byte\n // to output.\n } else if (\n byte === 0x25 &&\n !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))\n ) {\n output[j++] = 0x25\n\n // 3. Otherwise:\n } else {\n // 1. Let bytePoint be the two bytes after byte in input,\n // decoded, and then interpreted as hexadecimal number.\n // 2. Append a byte whose value is bytePoint to output.\n output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2])\n\n // 3. Skip the next two bytes in input.\n i += 2\n }\n }\n\n // 3. Return output.\n return length === j ? output : output.subarray(0, j)\n}\n\n// https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n/** @param {string} input */\nfunction parseMIMEType (input) {\n // 1. Remove any leading and trailing HTTP whitespace\n // from input.\n input = removeHTTPWhitespace(input, true, true)\n\n // 2. Let position be a position variable for input,\n // initially pointing at the start of input.\n const position = { position: 0 }\n\n // 3. Let type be the result of collecting a sequence\n // of code points that are not U+002F (/) from\n // input, given position.\n const type = collectASequenceOfCodePointsFast(\n '/',\n input,\n position\n )\n\n // 4. If type is the empty string or does not solely\n // contain HTTP token code points, then return failure.\n // https://mimesniff.spec.whatwg.org/#http-token-code-point\n if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n return 'failure'\n }\n\n // 5. If position is past the end of input, then return\n // failure\n if (position.position > input.length) {\n return 'failure'\n }\n\n // 6. Advance position by 1. (This skips past U+002F (/).)\n position.position++\n\n // 7. Let subtype be the result of collecting a sequence of\n // code points that are not U+003B (;) from input, given\n // position.\n let subtype = collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 8. Remove any trailing HTTP whitespace from subtype.\n subtype = removeHTTPWhitespace(subtype, false, true)\n\n // 9. If subtype is the empty string or does not solely\n // contain HTTP token code points, then return failure.\n if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n return 'failure'\n }\n\n const typeLowercase = type.toLowerCase()\n const subtypeLowercase = subtype.toLowerCase()\n\n // 10. Let mimeType be a new MIME type record whose type\n // is type, in ASCII lowercase, and subtype is subtype,\n // in ASCII lowercase.\n // https://mimesniff.spec.whatwg.org/#mime-type\n const mimeType = {\n type: typeLowercase,\n subtype: subtypeLowercase,\n /** @type {Map} */\n parameters: new Map(),\n // https://mimesniff.spec.whatwg.org/#mime-type-essence\n essence: `${typeLowercase}/${subtypeLowercase}`\n }\n\n // 11. While position is not past the end of input:\n while (position.position < input.length) {\n // 1. Advance position by 1. (This skips past U+003B (;).)\n position.position++\n\n // 2. Collect a sequence of code points that are HTTP\n // whitespace from input given position.\n collectASequenceOfCodePoints(\n // https://fetch.spec.whatwg.org/#http-whitespace\n char => HTTP_WHITESPACE_REGEX.test(char),\n input,\n position\n )\n\n // 3. Let parameterName be the result of collecting a\n // sequence of code points that are not U+003B (;)\n // or U+003D (=) from input, given position.\n let parameterName = collectASequenceOfCodePoints(\n (char) => char !== ';' && char !== '=',\n input,\n position\n )\n\n // 4. Set parameterName to parameterName, in ASCII\n // lowercase.\n parameterName = parameterName.toLowerCase()\n\n // 5. If position is not past the end of input, then:\n if (position.position < input.length) {\n // 1. If the code point at position within input is\n // U+003B (;), then continue.\n if (input[position.position] === ';') {\n continue\n }\n\n // 2. Advance position by 1. (This skips past U+003D (=).)\n position.position++\n }\n\n // 6. If position is past the end of input, then break.\n if (position.position > input.length) {\n break\n }\n\n // 7. Let parameterValue be null.\n let parameterValue = null\n\n // 8. If the code point at position within input is\n // U+0022 (\"), then:\n if (input[position.position] === '\"') {\n // 1. Set parameterValue to the result of collecting\n // an HTTP quoted string from input, given position\n // and the extract-value flag.\n parameterValue = collectAnHTTPQuotedString(input, position, true)\n\n // 2. Collect a sequence of code points that are not\n // U+003B (;) from input, given position.\n collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 9. Otherwise:\n } else {\n // 1. Set parameterValue to the result of collecting\n // a sequence of code points that are not U+003B (;)\n // from input, given position.\n parameterValue = collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 2. Remove any trailing HTTP whitespace from parameterValue.\n parameterValue = removeHTTPWhitespace(parameterValue, false, true)\n\n // 3. If parameterValue is the empty string, then continue.\n if (parameterValue.length === 0) {\n continue\n }\n }\n\n // 10. If all of the following are true\n // - parameterName is not the empty string\n // - parameterName solely contains HTTP token code points\n // - parameterValue solely contains HTTP quoted-string token code points\n // - mimeType’s parameters[parameterName] does not exist\n // then set mimeType’s parameters[parameterName] to parameterValue.\n if (\n parameterName.length !== 0 &&\n HTTP_TOKEN_CODEPOINTS.test(parameterName) &&\n (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&\n !mimeType.parameters.has(parameterName)\n ) {\n mimeType.parameters.set(parameterName, parameterValue)\n }\n }\n\n // 12. Return mimeType.\n return mimeType\n}\n\n// https://infra.spec.whatwg.org/#forgiving-base64-decode\n/** @param {string} data */\nfunction forgivingBase64 (data) {\n // 1. Remove all ASCII whitespace from data.\n data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '') // eslint-disable-line\n\n let dataLength = data.length\n // 2. If data’s code point length divides by 4 leaving\n // no remainder, then:\n if (dataLength % 4 === 0) {\n // 1. If data ends with one or two U+003D (=) code points,\n // then remove them from data.\n if (data.charCodeAt(dataLength - 1) === 0x003D) {\n --dataLength\n if (data.charCodeAt(dataLength - 1) === 0x003D) {\n --dataLength\n }\n }\n }\n\n // 3. If data’s code point length divides by 4 leaving\n // a remainder of 1, then return failure.\n if (dataLength % 4 === 1) {\n return 'failure'\n }\n\n // 4. If data contains a code point that is not one of\n // U+002B (+)\n // U+002F (/)\n // ASCII alphanumeric\n // then return failure.\n if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {\n return 'failure'\n }\n\n const buffer = Buffer.from(data, 'base64')\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\n// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string\n// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string\n/**\n * @param {string} input\n * @param {{ position: number }} position\n * @param {boolean?} extractValue\n */\nfunction collectAnHTTPQuotedString (input, position, extractValue) {\n // 1. Let positionStart be position.\n const positionStart = position.position\n\n // 2. Let value be the empty string.\n let value = ''\n\n // 3. Assert: the code point at position within input\n // is U+0022 (\").\n assert(input[position.position] === '\"')\n\n // 4. Advance position by 1.\n position.position++\n\n // 5. While true:\n while (true) {\n // 1. Append the result of collecting a sequence of code points\n // that are not U+0022 (\") or U+005C (\\) from input, given\n // position, to value.\n value += collectASequenceOfCodePoints(\n (char) => char !== '\"' && char !== '\\\\',\n input,\n position\n )\n\n // 2. If position is past the end of input, then break.\n if (position.position >= input.length) {\n break\n }\n\n // 3. Let quoteOrBackslash be the code point at position within\n // input.\n const quoteOrBackslash = input[position.position]\n\n // 4. Advance position by 1.\n position.position++\n\n // 5. If quoteOrBackslash is U+005C (\\), then:\n if (quoteOrBackslash === '\\\\') {\n // 1. If position is past the end of input, then append\n // U+005C (\\) to value and break.\n if (position.position >= input.length) {\n value += '\\\\'\n break\n }\n\n // 2. Append the code point at position within input to value.\n value += input[position.position]\n\n // 3. Advance position by 1.\n position.position++\n\n // 6. Otherwise:\n } else {\n // 1. Assert: quoteOrBackslash is U+0022 (\").\n assert(quoteOrBackslash === '\"')\n\n // 2. Break.\n break\n }\n }\n\n // 6. If the extract-value flag is set, then return value.\n if (extractValue) {\n return value\n }\n\n // 7. Return the code points from positionStart to position,\n // inclusive, within input.\n return input.slice(positionStart, position.position)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serializeAMimeType (mimeType) {\n assert(mimeType !== 'failure')\n const { parameters, essence } = mimeType\n\n // 1. Let serialization be the concatenation of mimeType’s\n // type, U+002F (/), and mimeType’s subtype.\n let serialization = essence\n\n // 2. For each name → value of mimeType’s parameters:\n for (let [name, value] of parameters.entries()) {\n // 1. Append U+003B (;) to serialization.\n serialization += ';'\n\n // 2. Append name to serialization.\n serialization += name\n\n // 3. Append U+003D (=) to serialization.\n serialization += '='\n\n // 4. If value does not solely contain HTTP token code\n // points or value is the empty string, then:\n if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n // 1. Precede each occurrence of U+0022 (\") or\n // U+005C (\\) in value with U+005C (\\).\n value = value.replace(/(\\\\|\")/g, '\\\\$1')\n\n // 2. Prepend U+0022 (\") to value.\n value = '\"' + value\n\n // 3. Append U+0022 (\") to value.\n value += '\"'\n }\n\n // 5. Append value to serialization.\n serialization += value\n }\n\n // 3. Return serialization.\n return serialization\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {number} char\n */\nfunction isHTTPWhiteSpace (char) {\n // \"\\r\\n\\t \"\n return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeHTTPWhitespace (str, leading = true, trailing = true) {\n return removeChars(str, leading, trailing, isHTTPWhiteSpace)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n * @param {number} char\n */\nfunction isASCIIWhitespace (char) {\n // \"\\r\\n\\t\\f \"\n return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x00c || char === 0x020\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeASCIIWhitespace (str, leading = true, trailing = true) {\n return removeChars(str, leading, trailing, isASCIIWhitespace)\n}\n\n/**\n * @param {string} str\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns\n */\nfunction removeChars (str, leading, trailing, predicate) {\n let lead = 0\n let trail = str.length - 1\n\n if (leading) {\n while (lead < str.length && predicate(str.charCodeAt(lead))) lead++\n }\n\n if (trailing) {\n while (trail > 0 && predicate(str.charCodeAt(trail))) trail--\n }\n\n return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-decode\n * @param {Uint8Array} input\n * @returns {string}\n */\nfunction isomorphicDecode (input) {\n // 1. To isomorphic decode a byte sequence input, return a string whose code point\n // length is equal to input’s length and whose code points have the same values\n // as the values of input’s bytes, in the same order.\n const length = input.length\n if ((2 << 15) - 1 > length) {\n return String.fromCharCode.apply(null, input)\n }\n let result = ''; let i = 0\n let addition = (2 << 15) - 1\n while (i < length) {\n if (i + addition > length) {\n addition = length - i\n }\n result += String.fromCharCode.apply(null, input.subarray(i, i += addition))\n }\n return result\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type\n * @param {Exclude, 'failure'>} mimeType\n */\nfunction minimizeSupportedMimeType (mimeType) {\n switch (mimeType.essence) {\n case 'application/ecmascript':\n case 'application/javascript':\n case 'application/x-ecmascript':\n case 'application/x-javascript':\n case 'text/ecmascript':\n case 'text/javascript':\n case 'text/javascript1.0':\n case 'text/javascript1.1':\n case 'text/javascript1.2':\n case 'text/javascript1.3':\n case 'text/javascript1.4':\n case 'text/javascript1.5':\n case 'text/jscript':\n case 'text/livescript':\n case 'text/x-ecmascript':\n case 'text/x-javascript':\n // 1. If mimeType is a JavaScript MIME type, then return \"text/javascript\".\n return 'text/javascript'\n case 'application/json':\n case 'text/json':\n // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n return 'application/json'\n case 'image/svg+xml':\n // 3. If mimeType’s essence is \"image/svg+xml\", then return \"image/svg+xml\".\n return 'image/svg+xml'\n case 'text/xml':\n case 'application/xml':\n // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n return 'application/xml'\n }\n\n // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n if (mimeType.subtype.endsWith('+json')) {\n return 'application/json'\n }\n\n // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n if (mimeType.subtype.endsWith('+xml')) {\n return 'application/xml'\n }\n\n // 5. If mimeType is supported by the user agent, then return mimeType’s essence.\n // Technically, node doesn't support any mimetypes.\n\n // 6. Return the empty string.\n return ''\n}\n\nmodule.exports = {\n dataURLProcessor,\n URLSerializer,\n collectASequenceOfCodePoints,\n collectASequenceOfCodePointsFast,\n stringPercentDecode,\n parseMIMEType,\n collectAnHTTPQuotedString,\n serializeAMimeType,\n removeChars,\n removeHTTPWhitespace,\n minimizeSupportedMimeType,\n HTTP_TOKEN_CODEPOINTS,\n isomorphicDecode\n}\n","'use strict'\n\nconst { kConnected, kSize } = require('../../core/symbols')\n\nclass CompatWeakRef {\n constructor (value) {\n this.value = value\n }\n\n deref () {\n return this.value[kConnected] === 0 && this.value[kSize] === 0\n ? undefined\n : this.value\n }\n}\n\nclass CompatFinalizer {\n constructor (finalizer) {\n this.finalizer = finalizer\n }\n\n register (dispatcher, key) {\n if (dispatcher.on) {\n dispatcher.on('disconnect', () => {\n if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {\n this.finalizer(key)\n }\n })\n }\n }\n\n unregister (key) {}\n}\n\nmodule.exports = function () {\n // FIXME: remove workaround when the Node bug is backported to v18\n // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\n if (process.env.NODE_V8_COVERAGE && process.version.startsWith('v18')) {\n process._rawDebug('Using compatibility WeakRef and FinalizationRegistry')\n return {\n WeakRef: CompatWeakRef,\n FinalizationRegistry: CompatFinalizer\n }\n }\n return { WeakRef, FinalizationRegistry }\n}\n","'use strict'\n\nconst { Blob, File } = require('node:buffer')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\n\n// TODO(@KhafraDev): remove\nclass FileLike {\n constructor (blobLike, fileName, options = {}) {\n // TODO: argument idl type check\n\n // The File constructor is invoked with two or three parameters, depending\n // on whether the optional dictionary parameter is used. When the File()\n // constructor is invoked, user agents must run the following steps:\n\n // 1. Let bytes be the result of processing blob parts given fileBits and\n // options.\n\n // 2. Let n be the fileName argument to the constructor.\n const n = fileName\n\n // 3. Process FilePropertyBag dictionary argument by running the following\n // substeps:\n\n // 1. If the type member is provided and is not the empty string, let t\n // be set to the type dictionary member. If t contains any characters\n // outside the range U+0020 to U+007E, then set t to the empty string\n // and return from these substeps.\n // TODO\n const t = options.type\n\n // 2. Convert every character in t to ASCII lowercase.\n // TODO\n\n // 3. If the lastModified member is provided, let d be set to the\n // lastModified dictionary member. If it is not provided, set d to the\n // current date and time represented as the number of milliseconds since\n // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n const d = options.lastModified ?? Date.now()\n\n // 4. Return a new File object F such that:\n // F refers to the bytes byte sequence.\n // F.size is set to the number of total bytes in bytes.\n // F.name is set to n.\n // F.type is set to t.\n // F.lastModified is set to d.\n\n this[kState] = {\n blobLike,\n name: n,\n type: t,\n lastModified: d\n }\n }\n\n stream (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.stream(...args)\n }\n\n arrayBuffer (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.arrayBuffer(...args)\n }\n\n slice (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.slice(...args)\n }\n\n text (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.text(...args)\n }\n\n get size () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.size\n }\n\n get type () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.type\n }\n\n get name () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].name\n }\n\n get lastModified () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].lastModified\n }\n\n get [Symbol.toStringTag] () {\n return 'File'\n }\n}\n\nwebidl.converters.Blob = webidl.interfaceConverter(Blob)\n\n// If this function is moved to ./util.js, some tools (such as\n// rollup) will warn about circular dependencies. See:\n// https://github.com/nodejs/undici/issues/1629\nfunction isFileLike (object) {\n return (\n (object instanceof File) ||\n (\n object &&\n (typeof object.stream === 'function' ||\n typeof object.arrayBuffer === 'function') &&\n object[Symbol.toStringTag] === 'File'\n )\n )\n}\n\nmodule.exports = { FileLike, isFileLike }\n","'use strict'\n\nconst { isUSVString, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { utf8DecodeBytes } = require('./util')\nconst { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require('./data-url')\nconst { isFileLike } = require('./file')\nconst { makeEntry } = require('./formdata')\nconst assert = require('node:assert')\nconst { File: NodeFile } = require('node:buffer')\n\nconst File = globalThis.File ?? NodeFile\n\nconst formDataNameBuffer = Buffer.from('form-data; name=\"')\nconst filenameBuffer = Buffer.from('; filename')\nconst dd = Buffer.from('--')\nconst ddcrlf = Buffer.from('--\\r\\n')\n\n/**\n * @param {string} chars\n */\nfunction isAsciiString (chars) {\n for (let i = 0; i < chars.length; ++i) {\n if ((chars.charCodeAt(i) & ~0x7F) !== 0) {\n return false\n }\n }\n return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary\n * @param {string} boundary\n */\nfunction validateBoundary (boundary) {\n const length = boundary.length\n\n // - its length is greater or equal to 27 and lesser or equal to 70, and\n if (length < 27 || length > 70) {\n return false\n }\n\n // - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or\n // 0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),\n // 0x2D (-) or 0x5F (_).\n for (let i = 0; i < length; ++i) {\n const cp = boundary.charCodeAt(i)\n\n if (!(\n (cp >= 0x30 && cp <= 0x39) ||\n (cp >= 0x41 && cp <= 0x5a) ||\n (cp >= 0x61 && cp <= 0x7a) ||\n cp === 0x27 ||\n cp === 0x2d ||\n cp === 0x5f\n )) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser\n * @param {Buffer} input\n * @param {ReturnType} mimeType\n */\nfunction multipartFormDataParser (input, mimeType) {\n // 1. Assert: mimeType’s essence is \"multipart/form-data\".\n assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')\n\n const boundaryString = mimeType.parameters.get('boundary')\n\n // 2. If mimeType’s parameters[\"boundary\"] does not exist, return failure.\n // Otherwise, let boundary be the result of UTF-8 decoding mimeType’s\n // parameters[\"boundary\"].\n if (boundaryString === undefined) {\n return 'failure'\n }\n\n const boundary = Buffer.from(`--${boundaryString}`, 'utf8')\n\n // 3. Let entry list be an empty entry list.\n const entryList = []\n\n // 4. Let position be a pointer to a byte in input, initially pointing at\n // the first byte.\n const position = { position: 0 }\n\n // Note: undici addition, allows leading and trailing CRLFs.\n while (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n position.position += 2\n }\n\n let trailing = input.length\n\n while (input[trailing - 1] === 0x0a && input[trailing - 2] === 0x0d) {\n trailing -= 2\n }\n\n if (trailing !== input.length) {\n input = input.subarray(0, trailing)\n }\n\n // 5. While true:\n while (true) {\n // 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D\n // (`--`) followed by boundary, advance position by 2 + the length of\n // boundary. Otherwise, return failure.\n // Note: boundary is padded with 2 dashes already, no need to add 2.\n if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {\n position.position += boundary.length\n } else {\n return 'failure'\n }\n\n // 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A\n // (`--` followed by CR LF) followed by the end of input, return entry list.\n // Note: a body does NOT need to end with CRLF. It can end with --.\n if (\n (position.position === input.length - 2 && bufferStartsWith(input, dd, position)) ||\n (position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position))\n ) {\n return entryList\n }\n\n // 5.3. If position does not point to a sequence of bytes starting with 0x0D\n // 0x0A (CR LF), return failure.\n if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n return 'failure'\n }\n\n // 5.4. Advance position by 2. (This skips past the newline.)\n position.position += 2\n\n // 5.5. Let name, filename and contentType be the result of parsing\n // multipart/form-data headers on input and position, if the result\n // is not failure. Otherwise, return failure.\n const result = parseMultipartFormDataHeaders(input, position)\n\n if (result === 'failure') {\n return 'failure'\n }\n\n let { name, filename, contentType, encoding } = result\n\n // 5.6. Advance position by 2. (This skips past the empty line that marks\n // the end of the headers.)\n position.position += 2\n\n // 5.7. Let body be the empty byte sequence.\n let body\n\n // 5.8. Body loop: While position is not past the end of input:\n // TODO: the steps here are completely wrong\n {\n const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)\n\n if (boundaryIndex === -1) {\n return 'failure'\n }\n\n body = input.subarray(position.position, boundaryIndex - 4)\n\n position.position += body.length\n\n // Note: position must be advanced by the body's length before being\n // decoded, otherwise the parsing will fail.\n if (encoding === 'base64') {\n body = Buffer.from(body.toString(), 'base64')\n }\n }\n\n // 5.9. If position does not point to a sequence of bytes starting with\n // 0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.\n if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n return 'failure'\n } else {\n position.position += 2\n }\n\n // 5.10. If filename is not null:\n let value\n\n if (filename !== null) {\n // 5.10.1. If contentType is null, set contentType to \"text/plain\".\n contentType ??= 'text/plain'\n\n // 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.\n\n // Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.\n // Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.\n if (!isAsciiString(contentType)) {\n contentType = ''\n }\n\n // 5.10.3. Let value be a new File object with name filename, type contentType, and body body.\n value = new File([body], filename, { type: contentType })\n } else {\n // 5.11. Otherwise:\n\n // 5.11.1. Let value be the UTF-8 decoding without BOM of body.\n value = utf8DecodeBytes(Buffer.from(body))\n }\n\n // 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.\n assert(isUSVString(name))\n assert((typeof value === 'string' && isUSVString(value)) || isFileLike(value))\n\n // 5.13. Create an entry with name and value, and append it to entry list.\n entryList.push(makeEntry(name, value, filename))\n }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataHeaders (input, position) {\n // 1. Let name, filename and contentType be null.\n let name = null\n let filename = null\n let contentType = null\n let encoding = null\n\n // 2. While true:\n while (true) {\n // 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):\n if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n // 2.1.1. If name is null, return failure.\n if (name === null) {\n return 'failure'\n }\n\n // 2.1.2. Return name, filename and contentType.\n return { name, filename, contentType, encoding }\n }\n\n // 2.2. Let header name be the result of collecting a sequence of bytes that are\n // not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.\n let headerName = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,\n input,\n position\n )\n\n // 2.3. Remove any HTTP tab or space bytes from the start or end of header name.\n headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)\n\n // 2.4. If header name does not match the field-name token production, return failure.\n if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {\n return 'failure'\n }\n\n // 2.5. If the byte at position is not 0x3A (:), return failure.\n if (input[position.position] !== 0x3a) {\n return 'failure'\n }\n\n // 2.6. Advance position by 1.\n position.position++\n\n // 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.\n // (Do nothing with those bytes.)\n collectASequenceOfBytes(\n (char) => char === 0x20 || char === 0x09,\n input,\n position\n )\n\n // 2.8. Byte-lowercase header name and switch on the result:\n switch (bufferToLowerCasedHeaderName(headerName)) {\n case 'content-disposition': {\n // 1. Set name and filename to null.\n name = filename = null\n\n // 2. If position does not point to a sequence of bytes starting with\n // `form-data; name=\"`, return failure.\n if (!bufferStartsWith(input, formDataNameBuffer, position)) {\n return 'failure'\n }\n\n // 3. Advance position so it points at the byte after the next 0x22 (\")\n // byte (the one in the sequence of bytes matched above).\n position.position += 17\n\n // 4. Set name to the result of parsing a multipart/form-data name given\n // input and position, if the result is not failure. Otherwise, return\n // failure.\n name = parseMultipartFormDataName(input, position)\n\n if (name === null) {\n return 'failure'\n }\n\n // 5. If position points to a sequence of bytes starting with `; filename=\"`:\n if (bufferStartsWith(input, filenameBuffer, position)) {\n // Note: undici also handles filename*\n let check = position.position + filenameBuffer.length\n\n if (input[check] === 0x2a) {\n position.position += 1\n check += 1\n }\n\n if (input[check] !== 0x3d || input[check + 1] !== 0x22) { // =\"\n return 'failure'\n }\n\n // 1. Advance position so it points at the byte after the next 0x22 (\") byte\n // (the one in the sequence of bytes matched above).\n position.position += 12\n\n // 2. Set filename to the result of parsing a multipart/form-data name given\n // input and position, if the result is not failure. Otherwise, return failure.\n filename = parseMultipartFormDataName(input, position)\n\n if (filename === null) {\n return 'failure'\n }\n }\n\n break\n }\n case 'content-type': {\n // 1. Let header value be the result of collecting a sequence of bytes that are\n // not 0x0A (LF) or 0x0D (CR), given position.\n let headerValue = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d,\n input,\n position\n )\n\n // 2. Remove any HTTP tab or space bytes from the end of header value.\n headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n // 3. Set contentType to the isomorphic decoding of header value.\n contentType = isomorphicDecode(headerValue)\n\n break\n }\n case 'content-transfer-encoding': {\n let headerValue = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d,\n input,\n position\n )\n\n headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n encoding = isomorphicDecode(headerValue)\n\n break\n }\n default: {\n // Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.\n // (Do nothing with those bytes.)\n collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d,\n input,\n position\n )\n }\n }\n\n // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A\n // (CR LF), return failure. Otherwise, advance position by 2 (past the newline).\n if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {\n return 'failure'\n } else {\n position.position += 2\n }\n }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-a-multipart-form-data-name\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataName (input, position) {\n // 1. Assert: The byte at (position - 1) is 0x22 (\").\n assert(input[position.position - 1] === 0x22)\n\n // 2. Let name be the result of collecting a sequence of bytes that are not 0x0A (LF), 0x0D (CR) or 0x22 (\"), given position.\n /** @type {string | Buffer} */\n let name = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d && char !== 0x22,\n input,\n position\n )\n\n // 3. If the byte at position is not 0x22 (\"), return failure. Otherwise, advance position by 1.\n if (input[position.position] !== 0x22) {\n return null // name could be 'failure'\n } else {\n position.position++\n }\n\n // 4. Replace any occurrence of the following subsequences in name with the given byte:\n // - `%0A`: 0x0A (LF)\n // - `%0D`: 0x0D (CR)\n // - `%22`: 0x22 (\")\n name = new TextDecoder().decode(name)\n .replace(/%0A/ig, '\\n')\n .replace(/%0D/ig, '\\r')\n .replace(/%22/g, '\"')\n\n // 5. Return the UTF-8 decoding without BOM of name.\n return name\n}\n\n/**\n * @param {(char: number) => boolean} condition\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfBytes (condition, input, position) {\n let start = position.position\n\n while (start < input.length && condition(input[start])) {\n ++start\n }\n\n return input.subarray(position.position, (position.position = start))\n}\n\n/**\n * @param {Buffer} buf\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns {Buffer}\n */\nfunction removeChars (buf, leading, trailing, predicate) {\n let lead = 0\n let trail = buf.length - 1\n\n if (leading) {\n while (lead < buf.length && predicate(buf[lead])) lead++\n }\n\n if (trailing) {\n while (trail > 0 && predicate(buf[trail])) trail--\n }\n\n return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)\n}\n\n/**\n * Checks if {@param buffer} starts with {@param start}\n * @param {Buffer} buffer\n * @param {Buffer} start\n * @param {{ position: number }} position\n */\nfunction bufferStartsWith (buffer, start, position) {\n if (buffer.length < start.length) {\n return false\n }\n\n for (let i = 0; i < start.length; i++) {\n if (start[i] !== buffer[position.position + i]) {\n return false\n }\n }\n\n return true\n}\n\nmodule.exports = {\n multipartFormDataParser,\n validateBoundary\n}\n","'use strict'\n\nconst { isBlobLike, iteratorMixin } = require('./util')\nconst { kState } = require('./symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { FileLike, isFileLike } = require('./file')\nconst { webidl } = require('./webidl')\nconst { File: NativeFile } = require('node:buffer')\nconst nodeUtil = require('node:util')\n\n/** @type {globalThis['File']} */\nconst File = globalThis.File ?? NativeFile\n\n// https://xhr.spec.whatwg.org/#formdata\nclass FormData {\n constructor (form) {\n webidl.util.markAsUncloneable(this)\n\n if (form !== undefined) {\n throw webidl.errors.conversionFailed({\n prefix: 'FormData constructor',\n argument: 'Argument 1',\n types: ['undefined']\n })\n }\n\n this[kState] = []\n }\n\n append (name, value, filename = undefined) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.append'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n if (arguments.length === 3 && !isBlobLike(value)) {\n throw new TypeError(\n \"Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'\"\n )\n }\n\n // 1. Let value be value if given; otherwise blobValue.\n\n name = webidl.converters.USVString(name, prefix, 'name')\n value = isBlobLike(value)\n ? webidl.converters.Blob(value, prefix, 'value', { strict: false })\n : webidl.converters.USVString(value, prefix, 'value')\n filename = arguments.length === 3\n ? webidl.converters.USVString(filename, prefix, 'filename')\n : undefined\n\n // 2. Let entry be the result of creating an entry with\n // name, value, and filename if given.\n const entry = makeEntry(name, value, filename)\n\n // 3. Append entry to this’s entry list.\n this[kState].push(entry)\n }\n\n delete (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.delete'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name, prefix, 'name')\n\n // The delete(name) method steps are to remove all entries whose name\n // is name from this’s entry list.\n this[kState] = this[kState].filter(entry => entry.name !== name)\n }\n\n get (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.get'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name, prefix, 'name')\n\n // 1. If there is no entry whose name is name in this’s entry list,\n // then return null.\n const idx = this[kState].findIndex((entry) => entry.name === name)\n if (idx === -1) {\n return null\n }\n\n // 2. Return the value of the first entry whose name is name from\n // this’s entry list.\n return this[kState][idx].value\n }\n\n getAll (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.getAll'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name, prefix, 'name')\n\n // 1. If there is no entry whose name is name in this’s entry list,\n // then return the empty list.\n // 2. Return the values of all entries whose name is name, in order,\n // from this’s entry list.\n return this[kState]\n .filter((entry) => entry.name === name)\n .map((entry) => entry.value)\n }\n\n has (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.has'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name, prefix, 'name')\n\n // The has(name) method steps are to return true if there is an entry\n // whose name is name in this’s entry list; otherwise false.\n return this[kState].findIndex((entry) => entry.name === name) !== -1\n }\n\n set (name, value, filename = undefined) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.set'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n if (arguments.length === 3 && !isBlobLike(value)) {\n throw new TypeError(\n \"Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'\"\n )\n }\n\n // The set(name, value) and set(name, blobValue, filename) method steps\n // are:\n\n // 1. Let value be value if given; otherwise blobValue.\n\n name = webidl.converters.USVString(name, prefix, 'name')\n value = isBlobLike(value)\n ? webidl.converters.Blob(value, prefix, 'name', { strict: false })\n : webidl.converters.USVString(value, prefix, 'name')\n filename = arguments.length === 3\n ? webidl.converters.USVString(filename, prefix, 'name')\n : undefined\n\n // 2. Let entry be the result of creating an entry with name, value, and\n // filename if given.\n const entry = makeEntry(name, value, filename)\n\n // 3. If there are entries in this’s entry list whose name is name, then\n // replace the first such entry with entry and remove the others.\n const idx = this[kState].findIndex((entry) => entry.name === name)\n if (idx !== -1) {\n this[kState] = [\n ...this[kState].slice(0, idx),\n entry,\n ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)\n ]\n } else {\n // 4. Otherwise, append entry to this’s entry list.\n this[kState].push(entry)\n }\n }\n\n [nodeUtil.inspect.custom] (depth, options) {\n const state = this[kState].reduce((a, b) => {\n if (a[b.name]) {\n if (Array.isArray(a[b.name])) {\n a[b.name].push(b.value)\n } else {\n a[b.name] = [a[b.name], b.value]\n }\n } else {\n a[b.name] = b.value\n }\n\n return a\n }, { __proto__: null })\n\n options.depth ??= depth\n options.colors ??= true\n\n const output = nodeUtil.formatWithOptions(options, state)\n\n // remove [Object null prototype]\n return `FormData ${output.slice(output.indexOf(']') + 2)}`\n }\n}\n\niteratorMixin('FormData', FormData, kState, 'name', 'value')\n\nObject.defineProperties(FormData.prototype, {\n append: kEnumerableProperty,\n delete: kEnumerableProperty,\n get: kEnumerableProperty,\n getAll: kEnumerableProperty,\n has: kEnumerableProperty,\n set: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'FormData',\n configurable: true\n }\n})\n\n/**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry\n * @param {string} name\n * @param {string|Blob} value\n * @param {?string} filename\n * @returns\n */\nfunction makeEntry (name, value, filename) {\n // 1. Set name to the result of converting name into a scalar value string.\n // Note: This operation was done by the webidl converter USVString.\n\n // 2. If value is a string, then set value to the result of converting\n // value into a scalar value string.\n if (typeof value === 'string') {\n // Note: This operation was done by the webidl converter USVString.\n } else {\n // 3. Otherwise:\n\n // 1. If value is not a File object, then set value to a new File object,\n // representing the same bytes, whose name attribute value is \"blob\"\n if (!isFileLike(value)) {\n value = value instanceof Blob\n ? new File([value], 'blob', { type: value.type })\n : new FileLike(value, 'blob', { type: value.type })\n }\n\n // 2. If filename is given, then set value to a new File object,\n // representing the same bytes, whose name attribute is filename.\n if (filename !== undefined) {\n /** @type {FilePropertyBag} */\n const options = {\n type: value.type,\n lastModified: value.lastModified\n }\n\n value = value instanceof NativeFile\n ? new File([value], filename, options)\n : new FileLike(value, filename, options)\n }\n }\n\n // 4. Return an entry whose name is name and whose value is value.\n return { name, value }\n}\n\nmodule.exports = { FormData, makeEntry }\n","'use strict'\n\n// In case of breaking changes, increase the version\n// number to avoid conflicts.\nconst globalOrigin = Symbol.for('undici.globalOrigin.1')\n\nfunction getGlobalOrigin () {\n return globalThis[globalOrigin]\n}\n\nfunction setGlobalOrigin (newOrigin) {\n if (newOrigin === undefined) {\n Object.defineProperty(globalThis, globalOrigin, {\n value: undefined,\n writable: true,\n enumerable: false,\n configurable: false\n })\n\n return\n }\n\n const parsedURL = new URL(newOrigin)\n\n if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {\n throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)\n }\n\n Object.defineProperty(globalThis, globalOrigin, {\n value: parsedURL,\n writable: true,\n enumerable: false,\n configurable: false\n })\n}\n\nmodule.exports = {\n getGlobalOrigin,\n setGlobalOrigin\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst { kConstruct } = require('../../core/symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst {\n iteratorMixin,\n isValidHeaderName,\n isValidHeaderValue\n} = require('./util')\nconst { webidl } = require('./webidl')\nconst assert = require('node:assert')\nconst util = require('node:util')\n\nconst kHeadersMap = Symbol('headers map')\nconst kHeadersSortedMap = Symbol('headers map sorted')\n\n/**\n * @param {number} code\n */\nfunction isHTTPWhiteSpaceCharCode (code) {\n return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize\n * @param {string} potentialValue\n */\nfunction headerValueNormalize (potentialValue) {\n // To normalize a byte sequence potentialValue, remove\n // any leading and trailing HTTP whitespace bytes from\n // potentialValue.\n let i = 0; let j = potentialValue.length\n\n while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j\n while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i\n\n return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)\n}\n\nfunction fill (headers, object) {\n // To fill a Headers object headers with a given object object, run these steps:\n\n // 1. If object is a sequence, then for each header in object:\n // Note: webidl conversion to array has already been done.\n if (Array.isArray(object)) {\n for (let i = 0; i < object.length; ++i) {\n const header = object[i]\n // 1. If header does not contain exactly two items, then throw a TypeError.\n if (header.length !== 2) {\n throw webidl.errors.exception({\n header: 'Headers constructor',\n message: `expected name/value pair to be length 2, found ${header.length}.`\n })\n }\n\n // 2. Append (header’s first item, header’s second item) to headers.\n appendHeader(headers, header[0], header[1])\n }\n } else if (typeof object === 'object' && object !== null) {\n // Note: null should throw\n\n // 2. Otherwise, object is a record, then for each key → value in object,\n // append (key, value) to headers\n const keys = Object.keys(object)\n for (let i = 0; i < keys.length; ++i) {\n appendHeader(headers, keys[i], object[keys[i]])\n }\n } else {\n throw webidl.errors.conversionFailed({\n prefix: 'Headers constructor',\n argument: 'Argument 1',\n types: ['sequence>', 'record']\n })\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-headers-append\n */\nfunction appendHeader (headers, name, value) {\n // 1. Normalize value.\n value = headerValueNormalize(value)\n\n // 2. If name is not a header name or value is not a\n // header value, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.append',\n value: name,\n type: 'header name'\n })\n } else if (!isValidHeaderValue(value)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.append',\n value,\n type: 'header value'\n })\n }\n\n // 3. If headers’s guard is \"immutable\", then throw a TypeError.\n // 4. Otherwise, if headers’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 5. Otherwise, if headers’s guard is \"request-no-cors\":\n // TODO\n // Note: undici does not implement forbidden header names\n if (getHeadersGuard(headers) === 'immutable') {\n throw new TypeError('immutable')\n }\n\n // 6. Otherwise, if headers’s guard is \"response\" and name is a\n // forbidden response-header name, return.\n\n // 7. Append (name, value) to headers’s header list.\n return getHeadersList(headers).append(name, value, false)\n\n // 8. If headers’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from headers\n}\n\nfunction compareHeaderName (a, b) {\n return a[0] < b[0] ? -1 : 1\n}\n\nclass HeadersList {\n /** @type {[string, string][]|null} */\n cookies = null\n\n constructor (init) {\n if (init instanceof HeadersList) {\n this[kHeadersMap] = new Map(init[kHeadersMap])\n this[kHeadersSortedMap] = init[kHeadersSortedMap]\n this.cookies = init.cookies === null ? null : [...init.cookies]\n } else {\n this[kHeadersMap] = new Map(init)\n this[kHeadersSortedMap] = null\n }\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#header-list-contains\n * @param {string} name\n * @param {boolean} isLowerCase\n */\n contains (name, isLowerCase) {\n // A header list list contains a header name name if list\n // contains a header whose name is a byte-case-insensitive\n // match for name.\n\n return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase())\n }\n\n clear () {\n this[kHeadersMap].clear()\n this[kHeadersSortedMap] = null\n this.cookies = null\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-append\n * @param {string} name\n * @param {string} value\n * @param {boolean} isLowerCase\n */\n append (name, value, isLowerCase) {\n this[kHeadersSortedMap] = null\n\n // 1. If list contains name, then set name to the first such\n // header’s name.\n const lowercaseName = isLowerCase ? name : name.toLowerCase()\n const exists = this[kHeadersMap].get(lowercaseName)\n\n // 2. Append (name, value) to list.\n if (exists) {\n const delimiter = lowercaseName === 'cookie' ? '; ' : ', '\n this[kHeadersMap].set(lowercaseName, {\n name: exists.name,\n value: `${exists.value}${delimiter}${value}`\n })\n } else {\n this[kHeadersMap].set(lowercaseName, { name, value })\n }\n\n if (lowercaseName === 'set-cookie') {\n (this.cookies ??= []).push(value)\n }\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-set\n * @param {string} name\n * @param {string} value\n * @param {boolean} isLowerCase\n */\n set (name, value, isLowerCase) {\n this[kHeadersSortedMap] = null\n const lowercaseName = isLowerCase ? name : name.toLowerCase()\n\n if (lowercaseName === 'set-cookie') {\n this.cookies = [value]\n }\n\n // 1. If list contains name, then set the value of\n // the first such header to value and remove the\n // others.\n // 2. Otherwise, append header (name, value) to list.\n this[kHeadersMap].set(lowercaseName, { name, value })\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-delete\n * @param {string} name\n * @param {boolean} isLowerCase\n */\n delete (name, isLowerCase) {\n this[kHeadersSortedMap] = null\n if (!isLowerCase) name = name.toLowerCase()\n\n if (name === 'set-cookie') {\n this.cookies = null\n }\n\n this[kHeadersMap].delete(name)\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get\n * @param {string} name\n * @param {boolean} isLowerCase\n * @returns {string | null}\n */\n get (name, isLowerCase) {\n // 1. If list does not contain name, then return null.\n // 2. Return the values of all headers in list whose name\n // is a byte-case-insensitive match for name,\n // separated from each other by 0x2C 0x20, in order.\n return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null\n }\n\n * [Symbol.iterator] () {\n // use the lowercased name\n for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n yield [name, value]\n }\n }\n\n get entries () {\n const headers = {}\n\n if (this[kHeadersMap].size !== 0) {\n for (const { name, value } of this[kHeadersMap].values()) {\n headers[name] = value\n }\n }\n\n return headers\n }\n\n rawValues () {\n return this[kHeadersMap].values()\n }\n\n get entriesList () {\n const headers = []\n\n if (this[kHeadersMap].size !== 0) {\n for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) {\n if (lowerName === 'set-cookie') {\n for (const cookie of this.cookies) {\n headers.push([name, cookie])\n }\n } else {\n headers.push([name, value])\n }\n }\n }\n\n return headers\n }\n\n // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set\n toSortedArray () {\n const size = this[kHeadersMap].size\n const array = new Array(size)\n // In most cases, you will use the fast-path.\n // fast-path: Use binary insertion sort for small arrays.\n if (size <= 32) {\n if (size === 0) {\n // If empty, it is an empty array. To avoid the first index assignment.\n return array\n }\n // Improve performance by unrolling loop and avoiding double-loop.\n // Double-loop-less version of the binary insertion sort.\n const iterator = this[kHeadersMap][Symbol.iterator]()\n const firstValue = iterator.next().value\n // set [name, value] to first index.\n array[0] = [firstValue[0], firstValue[1].value]\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n // 3.2.2. Assert: value is non-null.\n assert(firstValue[1].value !== null)\n for (\n let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value;\n i < size;\n ++i\n ) {\n // get next value\n value = iterator.next().value\n // set [name, value] to current index.\n x = array[i] = [value[0], value[1].value]\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n // 3.2.2. Assert: value is non-null.\n assert(x[1] !== null)\n left = 0\n right = i\n // binary search\n while (left < right) {\n // middle index\n pivot = left + ((right - left) >> 1)\n // compare header name\n if (array[pivot][0] <= x[0]) {\n left = pivot + 1\n } else {\n right = pivot\n }\n }\n if (i !== pivot) {\n j = i\n while (j > left) {\n array[j] = array[--j]\n }\n array[left] = x\n }\n }\n /* c8 ignore next 4 */\n if (!iterator.next().done) {\n // This is for debugging and will never be called.\n throw new TypeError('Unreachable')\n }\n return array\n } else {\n // This case would be a rare occurrence.\n // slow-path: fallback\n let i = 0\n for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n array[i++] = [name, value]\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n // 3.2.2. Assert: value is non-null.\n assert(value !== null)\n }\n return array.sort(compareHeaderName)\n }\n }\n}\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n #guard\n #headersList\n\n constructor (init = undefined) {\n webidl.util.markAsUncloneable(this)\n\n if (init === kConstruct) {\n return\n }\n\n this.#headersList = new HeadersList()\n\n // The new Headers(init) constructor steps are:\n\n // 1. Set this’s guard to \"none\".\n this.#guard = 'none'\n\n // 2. If init is given, then fill this with init.\n if (init !== undefined) {\n init = webidl.converters.HeadersInit(init, 'Headers contructor', 'init')\n fill(this, init)\n }\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-append\n append (name, value) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 2, 'Headers.append')\n\n const prefix = 'Headers.append'\n name = webidl.converters.ByteString(name, prefix, 'name')\n value = webidl.converters.ByteString(value, prefix, 'value')\n\n return appendHeader(this, name, value)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-delete\n delete (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')\n\n const prefix = 'Headers.delete'\n name = webidl.converters.ByteString(name, prefix, 'name')\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.delete',\n value: name,\n type: 'header name'\n })\n }\n\n // 2. If this’s guard is \"immutable\", then throw a TypeError.\n // 3. Otherwise, if this’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 4. Otherwise, if this’s guard is \"request-no-cors\", name\n // is not a no-CORS-safelisted request-header name, and\n // name is not a privileged no-CORS request-header name,\n // return.\n // 5. Otherwise, if this’s guard is \"response\" and name is\n // a forbidden response-header name, return.\n // Note: undici does not implement forbidden header names\n if (this.#guard === 'immutable') {\n throw new TypeError('immutable')\n }\n\n // 6. If this’s header list does not contain name, then\n // return.\n if (!this.#headersList.contains(name, false)) {\n return\n }\n\n // 7. Delete name from this’s header list.\n // 8. If this’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from this.\n this.#headersList.delete(name, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-get\n get (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, 'Headers.get')\n\n const prefix = 'Headers.get'\n name = webidl.converters.ByteString(name, prefix, 'name')\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value: name,\n type: 'header name'\n })\n }\n\n // 2. Return the result of getting name from this’s header\n // list.\n return this.#headersList.get(name, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-has\n has (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, 'Headers.has')\n\n const prefix = 'Headers.has'\n name = webidl.converters.ByteString(name, prefix, 'name')\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value: name,\n type: 'header name'\n })\n }\n\n // 2. Return true if this’s header list contains name;\n // otherwise false.\n return this.#headersList.contains(name, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-set\n set (name, value) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 2, 'Headers.set')\n\n const prefix = 'Headers.set'\n name = webidl.converters.ByteString(name, prefix, 'name')\n value = webidl.converters.ByteString(value, prefix, 'value')\n\n // 1. Normalize value.\n value = headerValueNormalize(value)\n\n // 2. If name is not a header name or value is not a\n // header value, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value: name,\n type: 'header name'\n })\n } else if (!isValidHeaderValue(value)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value,\n type: 'header value'\n })\n }\n\n // 3. If this’s guard is \"immutable\", then throw a TypeError.\n // 4. Otherwise, if this’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 5. Otherwise, if this’s guard is \"request-no-cors\" and\n // name/value is not a no-CORS-safelisted request-header,\n // return.\n // 6. Otherwise, if this’s guard is \"response\" and name is a\n // forbidden response-header name, return.\n // Note: undici does not implement forbidden header names\n if (this.#guard === 'immutable') {\n throw new TypeError('immutable')\n }\n\n // 7. Set (name, value) in this’s header list.\n // 8. If this’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from this\n this.#headersList.set(name, value, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n getSetCookie () {\n webidl.brandCheck(this, Headers)\n\n // 1. If this’s header list does not contain `Set-Cookie`, then return « ».\n // 2. Return the values of all headers in this’s header list whose name is\n // a byte-case-insensitive match for `Set-Cookie`, in order.\n\n const list = this.#headersList.cookies\n\n if (list) {\n return [...list]\n }\n\n return []\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n get [kHeadersSortedMap] () {\n if (this.#headersList[kHeadersSortedMap]) {\n return this.#headersList[kHeadersSortedMap]\n }\n\n // 1. Let headers be an empty list of headers with the key being the name\n // and value the value.\n const headers = []\n\n // 2. Let names be the result of convert header names to a sorted-lowercase\n // set with all the names of the headers in list.\n const names = this.#headersList.toSortedArray()\n\n const cookies = this.#headersList.cookies\n\n // fast-path\n if (cookies === null || cookies.length === 1) {\n // Note: The non-null assertion of value has already been done by `HeadersList#toSortedArray`\n return (this.#headersList[kHeadersSortedMap] = names)\n }\n\n // 3. For each name of names:\n for (let i = 0; i < names.length; ++i) {\n const { 0: name, 1: value } = names[i]\n // 1. If name is `set-cookie`, then:\n if (name === 'set-cookie') {\n // 1. Let values be a list of all values of headers in list whose name\n // is a byte-case-insensitive match for name, in order.\n\n // 2. For each value of values:\n // 1. Append (name, value) to headers.\n for (let j = 0; j < cookies.length; ++j) {\n headers.push([name, cookies[j]])\n }\n } else {\n // 2. Otherwise:\n\n // 1. Let value be the result of getting name from list.\n\n // 2. Assert: value is non-null.\n // Note: This operation was done by `HeadersList#toSortedArray`.\n\n // 3. Append (name, value) to headers.\n headers.push([name, value])\n }\n }\n\n // 4. Return headers.\n return (this.#headersList[kHeadersSortedMap] = headers)\n }\n\n [util.inspect.custom] (depth, options) {\n options.depth ??= depth\n\n return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`\n }\n\n static getHeadersGuard (o) {\n return o.#guard\n }\n\n static setHeadersGuard (o, guard) {\n o.#guard = guard\n }\n\n static getHeadersList (o) {\n return o.#headersList\n }\n\n static setHeadersList (o, list) {\n o.#headersList = list\n }\n}\n\nconst { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers\nReflect.deleteProperty(Headers, 'getHeadersGuard')\nReflect.deleteProperty(Headers, 'setHeadersGuard')\nReflect.deleteProperty(Headers, 'getHeadersList')\nReflect.deleteProperty(Headers, 'setHeadersList')\n\niteratorMixin('Headers', Headers, kHeadersSortedMap, 0, 1)\n\nObject.defineProperties(Headers.prototype, {\n append: kEnumerableProperty,\n delete: kEnumerableProperty,\n get: kEnumerableProperty,\n has: kEnumerableProperty,\n set: kEnumerableProperty,\n getSetCookie: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Headers',\n configurable: true\n },\n [util.inspect.custom]: {\n enumerable: false\n }\n})\n\nwebidl.converters.HeadersInit = function (V, prefix, argument) {\n if (webidl.util.Type(V) === 'Object') {\n const iterator = Reflect.get(V, Symbol.iterator)\n\n // A work-around to ensure we send the properly-cased Headers when V is a Headers object.\n // Read https://github.com/nodejs/undici/pull/3159#issuecomment-2075537226 before touching, please.\n if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { // Headers object\n try {\n return getHeadersList(V).entriesList\n } catch {\n // fall-through\n }\n }\n\n if (typeof iterator === 'function') {\n return webidl.converters['sequence>'](V, prefix, argument, iterator.bind(V))\n }\n\n return webidl.converters['record'](V, prefix, argument)\n }\n\n throw webidl.errors.conversionFailed({\n prefix: 'Headers constructor',\n argument: 'Argument 1',\n types: ['sequence>', 'record']\n })\n}\n\nmodule.exports = {\n fill,\n // for test.\n compareHeaderName,\n Headers,\n HeadersList,\n getHeadersGuard,\n setHeadersGuard,\n setHeadersList,\n getHeadersList\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst {\n makeNetworkError,\n makeAppropriateNetworkError,\n filterResponse,\n makeResponse,\n fromInnerResponse\n} = require('./response')\nconst { HeadersList } = require('./headers')\nconst { Request, cloneRequest } = require('./request')\nconst zlib = require('node:zlib')\nconst {\n bytesMatch,\n makePolicyContainer,\n clonePolicyContainer,\n requestBadPort,\n TAOCheck,\n appendRequestOriginHeader,\n responseLocationURL,\n requestCurrentURL,\n setRequestReferrerPolicyOnRedirect,\n tryUpgradeRequestToAPotentiallyTrustworthyURL,\n createOpaqueTimingInfo,\n appendFetchMetadata,\n corsCheck,\n crossOriginResourcePolicyCheck,\n determineRequestsReferrer,\n coarsenedSharedCurrentTime,\n createDeferredPromise,\n isBlobLike,\n sameOrigin,\n isCancelled,\n isAborted,\n isErrorLike,\n fullyReadBody,\n readableStreamClose,\n isomorphicEncode,\n urlIsLocal,\n urlIsHttpHttpsScheme,\n urlHasHttpsScheme,\n clampAndCoarsenConnectionTimingInfo,\n simpleRangeHeaderValue,\n buildContentRange,\n createInflate,\n extractMimeType\n} = require('./util')\nconst { kState, kDispatcher } = require('./symbols')\nconst assert = require('node:assert')\nconst { safelyExtractBody, extractBody } = require('./body')\nconst {\n redirectStatusSet,\n nullBodyStatus,\n safeMethodsSet,\n requestBodyHeader,\n subresourceSet\n} = require('./constants')\nconst EE = require('node:events')\nconst { Readable, pipeline, finished } = require('node:stream')\nconst { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url')\nconst { getGlobalDispatcher } = require('../../global')\nconst { webidl } = require('./webidl')\nconst { STATUS_CODES } = require('node:http')\nconst GET_OR_HEAD = ['GET', 'HEAD']\n\nconst defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'\n ? 'node'\n : 'undici'\n\n/** @type {import('buffer').resolveObjectURL} */\nlet resolveObjectURL\n\nclass Fetch extends EE {\n constructor (dispatcher) {\n super()\n\n this.dispatcher = dispatcher\n this.connection = null\n this.dump = false\n this.state = 'ongoing'\n }\n\n terminate (reason) {\n if (this.state !== 'ongoing') {\n return\n }\n\n this.state = 'terminated'\n this.connection?.destroy(reason)\n this.emit('terminated', reason)\n }\n\n // https://fetch.spec.whatwg.org/#fetch-controller-abort\n abort (error) {\n if (this.state !== 'ongoing') {\n return\n }\n\n // 1. Set controller’s state to \"aborted\".\n this.state = 'aborted'\n\n // 2. Let fallbackError be an \"AbortError\" DOMException.\n // 3. Set error to fallbackError if it is not given.\n if (!error) {\n error = new DOMException('The operation was aborted.', 'AbortError')\n }\n\n // 4. Let serializedError be StructuredSerialize(error).\n // If that threw an exception, catch it, and let\n // serializedError be StructuredSerialize(fallbackError).\n\n // 5. Set controller’s serialized abort reason to serializedError.\n this.serializedAbortReason = error\n\n this.connection?.destroy(error)\n this.emit('terminated', error)\n }\n}\n\nfunction handleFetchDone (response) {\n finalizeAndReportTiming(response, 'fetch')\n}\n\n// https://fetch.spec.whatwg.org/#fetch-method\nfunction fetch (input, init = undefined) {\n webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')\n\n // 1. Let p be a new promise.\n let p = createDeferredPromise()\n\n // 2. Let requestObject be the result of invoking the initial value of\n // Request as constructor with input and init as arguments. If this throws\n // an exception, reject p with it and return p.\n let requestObject\n\n try {\n requestObject = new Request(input, init)\n } catch (e) {\n p.reject(e)\n return p.promise\n }\n\n // 3. Let request be requestObject’s request.\n const request = requestObject[kState]\n\n // 4. If requestObject’s signal’s aborted flag is set, then:\n if (requestObject.signal.aborted) {\n // 1. Abort the fetch() call with p, request, null, and\n // requestObject’s signal’s abort reason.\n abortFetch(p, request, null, requestObject.signal.reason)\n\n // 2. Return p.\n return p.promise\n }\n\n // 5. Let globalObject be request’s client’s global object.\n const globalObject = request.client.globalObject\n\n // 6. If globalObject is a ServiceWorkerGlobalScope object, then set\n // request’s service-workers mode to \"none\".\n if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {\n request.serviceWorkers = 'none'\n }\n\n // 7. Let responseObject be null.\n let responseObject = null\n\n // 8. Let relevantRealm be this’s relevant Realm.\n\n // 9. Let locallyAborted be false.\n let locallyAborted = false\n\n // 10. Let controller be null.\n let controller = null\n\n // 11. Add the following abort steps to requestObject’s signal:\n addAbortListener(\n requestObject.signal,\n () => {\n // 1. Set locallyAborted to true.\n locallyAborted = true\n\n // 2. Assert: controller is non-null.\n assert(controller != null)\n\n // 3. Abort controller with requestObject’s signal’s abort reason.\n controller.abort(requestObject.signal.reason)\n\n const realResponse = responseObject?.deref()\n\n // 4. Abort the fetch() call with p, request, responseObject,\n // and requestObject’s signal’s abort reason.\n abortFetch(p, request, realResponse, requestObject.signal.reason)\n }\n )\n\n // 12. Let handleFetchDone given response response be to finalize and\n // report timing with response, globalObject, and \"fetch\".\n // see function handleFetchDone\n\n // 13. Set controller to the result of calling fetch given request,\n // with processResponseEndOfBody set to handleFetchDone, and processResponse\n // given response being these substeps:\n\n const processResponse = (response) => {\n // 1. If locallyAborted is true, terminate these substeps.\n if (locallyAborted) {\n return\n }\n\n // 2. If response’s aborted flag is set, then:\n if (response.aborted) {\n // 1. Let deserializedError be the result of deserialize a serialized\n // abort reason given controller’s serialized abort reason and\n // relevantRealm.\n\n // 2. Abort the fetch() call with p, request, responseObject, and\n // deserializedError.\n\n abortFetch(p, request, responseObject, controller.serializedAbortReason)\n return\n }\n\n // 3. If response is a network error, then reject p with a TypeError\n // and terminate these substeps.\n if (response.type === 'error') {\n p.reject(new TypeError('fetch failed', { cause: response.error }))\n return\n }\n\n // 4. Set responseObject to the result of creating a Response object,\n // given response, \"immutable\", and relevantRealm.\n responseObject = new WeakRef(fromInnerResponse(response, 'immutable'))\n\n // 5. Resolve p with responseObject.\n p.resolve(responseObject.deref())\n p = null\n }\n\n controller = fetching({\n request,\n processResponseEndOfBody: handleFetchDone,\n processResponse,\n dispatcher: requestObject[kDispatcher] // undici\n })\n\n // 14. Return p.\n return p.promise\n}\n\n// https://fetch.spec.whatwg.org/#finalize-and-report-timing\nfunction finalizeAndReportTiming (response, initiatorType = 'other') {\n // 1. If response is an aborted network error, then return.\n if (response.type === 'error' && response.aborted) {\n return\n }\n\n // 2. If response’s URL list is null or empty, then return.\n if (!response.urlList?.length) {\n return\n }\n\n // 3. Let originalURL be response’s URL list[0].\n const originalURL = response.urlList[0]\n\n // 4. Let timingInfo be response’s timing info.\n let timingInfo = response.timingInfo\n\n // 5. Let cacheState be response’s cache state.\n let cacheState = response.cacheState\n\n // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.\n if (!urlIsHttpHttpsScheme(originalURL)) {\n return\n }\n\n // 7. If timingInfo is null, then return.\n if (timingInfo === null) {\n return\n }\n\n // 8. If response’s timing allow passed flag is not set, then:\n if (!response.timingAllowPassed) {\n // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.\n timingInfo = createOpaqueTimingInfo({\n startTime: timingInfo.startTime\n })\n\n // 2. Set cacheState to the empty string.\n cacheState = ''\n }\n\n // 9. Set timingInfo’s end time to the coarsened shared current time\n // given global’s relevant settings object’s cross-origin isolated\n // capability.\n // TODO: given global’s relevant settings object’s cross-origin isolated\n // capability?\n timingInfo.endTime = coarsenedSharedCurrentTime()\n\n // 10. Set response’s timing info to timingInfo.\n response.timingInfo = timingInfo\n\n // 11. Mark resource timing for timingInfo, originalURL, initiatorType,\n // global, and cacheState.\n markResourceTiming(\n timingInfo,\n originalURL.href,\n initiatorType,\n globalThis,\n cacheState\n )\n}\n\n// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing\nconst markResourceTiming = performance.markResourceTiming\n\n// https://fetch.spec.whatwg.org/#abort-fetch\nfunction abortFetch (p, request, responseObject, error) {\n // 1. Reject promise with error.\n if (p) {\n // We might have already resolved the promise at this stage\n p.reject(error)\n }\n\n // 2. If request’s body is not null and is readable, then cancel request’s\n // body with error.\n if (request.body != null && isReadable(request.body?.stream)) {\n request.body.stream.cancel(error).catch((err) => {\n if (err.code === 'ERR_INVALID_STATE') {\n // Node bug?\n return\n }\n throw err\n })\n }\n\n // 3. If responseObject is null, then return.\n if (responseObject == null) {\n return\n }\n\n // 4. Let response be responseObject’s response.\n const response = responseObject[kState]\n\n // 5. If response’s body is not null and is readable, then error response’s\n // body with error.\n if (response.body != null && isReadable(response.body?.stream)) {\n response.body.stream.cancel(error).catch((err) => {\n if (err.code === 'ERR_INVALID_STATE') {\n // Node bug?\n return\n }\n throw err\n })\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetching\nfunction fetching ({\n request,\n processRequestBodyChunkLength,\n processRequestEndOfBody,\n processResponse,\n processResponseEndOfBody,\n processResponseConsumeBody,\n useParallelQueue = false,\n dispatcher = getGlobalDispatcher() // undici\n}) {\n // Ensure that the dispatcher is set accordingly\n assert(dispatcher)\n\n // 1. Let taskDestination be null.\n let taskDestination = null\n\n // 2. Let crossOriginIsolatedCapability be false.\n let crossOriginIsolatedCapability = false\n\n // 3. If request’s client is non-null, then:\n if (request.client != null) {\n // 1. Set taskDestination to request’s client’s global object.\n taskDestination = request.client.globalObject\n\n // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin\n // isolated capability.\n crossOriginIsolatedCapability =\n request.client.crossOriginIsolatedCapability\n }\n\n // 4. If useParallelQueue is true, then set taskDestination to the result of\n // starting a new parallel queue.\n // TODO\n\n // 5. Let timingInfo be a new fetch timing info whose start time and\n // post-redirect start time are the coarsened shared current time given\n // crossOriginIsolatedCapability.\n const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)\n const timingInfo = createOpaqueTimingInfo({\n startTime: currentTime\n })\n\n // 6. Let fetchParams be a new fetch params whose\n // request is request,\n // timing info is timingInfo,\n // process request body chunk length is processRequestBodyChunkLength,\n // process request end-of-body is processRequestEndOfBody,\n // process response is processResponse,\n // process response consume body is processResponseConsumeBody,\n // process response end-of-body is processResponseEndOfBody,\n // task destination is taskDestination,\n // and cross-origin isolated capability is crossOriginIsolatedCapability.\n const fetchParams = {\n controller: new Fetch(dispatcher),\n request,\n timingInfo,\n processRequestBodyChunkLength,\n processRequestEndOfBody,\n processResponse,\n processResponseConsumeBody,\n processResponseEndOfBody,\n taskDestination,\n crossOriginIsolatedCapability\n }\n\n // 7. If request’s body is a byte sequence, then set request’s body to\n // request’s body as a body.\n // NOTE: Since fetching is only called from fetch, body should already be\n // extracted.\n assert(!request.body || request.body.stream)\n\n // 8. If request’s window is \"client\", then set request’s window to request’s\n // client, if request’s client’s global object is a Window object; otherwise\n // \"no-window\".\n if (request.window === 'client') {\n // TODO: What if request.client is null?\n request.window =\n request.client?.globalObject?.constructor?.name === 'Window'\n ? request.client\n : 'no-window'\n }\n\n // 9. If request’s origin is \"client\", then set request’s origin to request’s\n // client’s origin.\n if (request.origin === 'client') {\n request.origin = request.client.origin\n }\n\n // 10. If all of the following conditions are true:\n // TODO\n\n // 11. If request’s policy container is \"client\", then:\n if (request.policyContainer === 'client') {\n // 1. If request’s client is non-null, then set request’s policy\n // container to a clone of request’s client’s policy container. [HTML]\n if (request.client != null) {\n request.policyContainer = clonePolicyContainer(\n request.client.policyContainer\n )\n } else {\n // 2. Otherwise, set request’s policy container to a new policy\n // container.\n request.policyContainer = makePolicyContainer()\n }\n }\n\n // 12. If request’s header list does not contain `Accept`, then:\n if (!request.headersList.contains('accept', true)) {\n // 1. Let value be `*/*`.\n const value = '*/*'\n\n // 2. A user agent should set value to the first matching statement, if\n // any, switching on request’s destination:\n // \"document\"\n // \"frame\"\n // \"iframe\"\n // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`\n // \"image\"\n // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`\n // \"style\"\n // `text/css,*/*;q=0.1`\n // TODO\n\n // 3. Append `Accept`/value to request’s header list.\n request.headersList.append('accept', value, true)\n }\n\n // 13. If request’s header list does not contain `Accept-Language`, then\n // user agents should append `Accept-Language`/an appropriate value to\n // request’s header list.\n if (!request.headersList.contains('accept-language', true)) {\n request.headersList.append('accept-language', '*', true)\n }\n\n // 14. If request’s priority is null, then use request’s initiator and\n // destination appropriately in setting request’s priority to a\n // user-agent-defined object.\n if (request.priority === null) {\n // TODO\n }\n\n // 15. If request is a subresource request, then:\n if (subresourceSet.has(request.destination)) {\n // TODO\n }\n\n // 16. Run main fetch given fetchParams.\n mainFetch(fetchParams)\n .catch(err => {\n fetchParams.controller.terminate(err)\n })\n\n // 17. Return fetchParam's controller\n return fetchParams.controller\n}\n\n// https://fetch.spec.whatwg.org/#concept-main-fetch\nasync function mainFetch (fetchParams, recursive = false) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. If request’s local-URLs-only flag is set and request’s current URL is\n // not local, then set response to a network error.\n if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n response = makeNetworkError('local URLs only')\n }\n\n // 4. Run report Content Security Policy violations for request.\n // TODO\n\n // 5. Upgrade request to a potentially trustworthy URL, if appropriate.\n tryUpgradeRequestToAPotentiallyTrustworthyURL(request)\n\n // 6. If should request be blocked due to a bad port, should fetching request\n // be blocked as mixed content, or should request be blocked by Content\n // Security Policy returns blocked, then set response to a network error.\n if (requestBadPort(request) === 'blocked') {\n response = makeNetworkError('bad port')\n }\n // TODO: should fetching request be blocked as mixed content?\n // TODO: should request be blocked by Content Security Policy?\n\n // 7. If request’s referrer policy is the empty string, then set request’s\n // referrer policy to request’s policy container’s referrer policy.\n if (request.referrerPolicy === '') {\n request.referrerPolicy = request.policyContainer.referrerPolicy\n }\n\n // 8. If request’s referrer is not \"no-referrer\", then set request’s\n // referrer to the result of invoking determine request’s referrer.\n if (request.referrer !== 'no-referrer') {\n request.referrer = determineRequestsReferrer(request)\n }\n\n // 9. Set request’s current URL’s scheme to \"https\" if all of the following\n // conditions are true:\n // - request’s current URL’s scheme is \"http\"\n // - request’s current URL’s host is a domain\n // - Matching request’s current URL’s host per Known HSTS Host Domain Name\n // Matching results in either a superdomain match with an asserted\n // includeSubDomains directive or a congruent match (with or without an\n // asserted includeSubDomains directive). [HSTS]\n // TODO\n\n // 10. If recursive is false, then run the remaining steps in parallel.\n // TODO\n\n // 11. If response is null, then set response to the result of running\n // the steps corresponding to the first matching statement:\n if (response === null) {\n response = await (async () => {\n const currentURL = requestCurrentURL(request)\n\n if (\n // - request’s current URL’s origin is same origin with request’s origin,\n // and request’s response tainting is \"basic\"\n (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||\n // request’s current URL’s scheme is \"data\"\n (currentURL.protocol === 'data:') ||\n // - request’s mode is \"navigate\" or \"websocket\"\n (request.mode === 'navigate' || request.mode === 'websocket')\n ) {\n // 1. Set request’s response tainting to \"basic\".\n request.responseTainting = 'basic'\n\n // 2. Return the result of running scheme fetch given fetchParams.\n return await schemeFetch(fetchParams)\n }\n\n // request’s mode is \"same-origin\"\n if (request.mode === 'same-origin') {\n // 1. Return a network error.\n return makeNetworkError('request mode cannot be \"same-origin\"')\n }\n\n // request’s mode is \"no-cors\"\n if (request.mode === 'no-cors') {\n // 1. If request’s redirect mode is not \"follow\", then return a network\n // error.\n if (request.redirect !== 'follow') {\n return makeNetworkError(\n 'redirect mode cannot be \"follow\" for \"no-cors\" request'\n )\n }\n\n // 2. Set request’s response tainting to \"opaque\".\n request.responseTainting = 'opaque'\n\n // 3. Return the result of running scheme fetch given fetchParams.\n return await schemeFetch(fetchParams)\n }\n\n // request’s current URL’s scheme is not an HTTP(S) scheme\n if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n // Return a network error.\n return makeNetworkError('URL scheme must be a HTTP(S) scheme')\n }\n\n // - request’s use-CORS-preflight flag is set\n // - request’s unsafe-request flag is set and either request’s method is\n // not a CORS-safelisted method or CORS-unsafe request-header names with\n // request’s header list is not empty\n // 1. Set request’s response tainting to \"cors\".\n // 2. Let corsWithPreflightResponse be the result of running HTTP fetch\n // given fetchParams and true.\n // 3. If corsWithPreflightResponse is a network error, then clear cache\n // entries using request.\n // 4. Return corsWithPreflightResponse.\n // TODO\n\n // Otherwise\n // 1. Set request’s response tainting to \"cors\".\n request.responseTainting = 'cors'\n\n // 2. Return the result of running HTTP fetch given fetchParams.\n return await httpFetch(fetchParams)\n })()\n }\n\n // 12. If recursive is true, then return response.\n if (recursive) {\n return response\n }\n\n // 13. If response is not a network error and response is not a filtered\n // response, then:\n if (response.status !== 0 && !response.internalResponse) {\n // If request’s response tainting is \"cors\", then:\n if (request.responseTainting === 'cors') {\n // 1. Let headerNames be the result of extracting header list values\n // given `Access-Control-Expose-Headers` and response’s header list.\n // TODO\n // 2. If request’s credentials mode is not \"include\" and headerNames\n // contains `*`, then set response’s CORS-exposed header-name list to\n // all unique header names in response’s header list.\n // TODO\n // 3. Otherwise, if headerNames is not null or failure, then set\n // response’s CORS-exposed header-name list to headerNames.\n // TODO\n }\n\n // Set response to the following filtered response with response as its\n // internal response, depending on request’s response tainting:\n if (request.responseTainting === 'basic') {\n response = filterResponse(response, 'basic')\n } else if (request.responseTainting === 'cors') {\n response = filterResponse(response, 'cors')\n } else if (request.responseTainting === 'opaque') {\n response = filterResponse(response, 'opaque')\n } else {\n assert(false)\n }\n }\n\n // 14. Let internalResponse be response, if response is a network error,\n // and response’s internal response otherwise.\n let internalResponse =\n response.status === 0 ? response : response.internalResponse\n\n // 15. If internalResponse’s URL list is empty, then set it to a clone of\n // request’s URL list.\n if (internalResponse.urlList.length === 0) {\n internalResponse.urlList.push(...request.urlList)\n }\n\n // 16. If request’s timing allow failed flag is unset, then set\n // internalResponse’s timing allow passed flag.\n if (!request.timingAllowFailed) {\n response.timingAllowPassed = true\n }\n\n // 17. If response is not a network error and any of the following returns\n // blocked\n // - should internalResponse to request be blocked as mixed content\n // - should internalResponse to request be blocked by Content Security Policy\n // - should internalResponse to request be blocked due to its MIME type\n // - should internalResponse to request be blocked due to nosniff\n // TODO\n\n // 18. If response’s type is \"opaque\", internalResponse’s status is 206,\n // internalResponse’s range-requested flag is set, and request’s header\n // list does not contain `Range`, then set response and internalResponse\n // to a network error.\n if (\n response.type === 'opaque' &&\n internalResponse.status === 206 &&\n internalResponse.rangeRequested &&\n !request.headers.contains('range', true)\n ) {\n response = internalResponse = makeNetworkError()\n }\n\n // 19. If response is not a network error and either request’s method is\n // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,\n // set internalResponse’s body to null and disregard any enqueuing toward\n // it (if any).\n if (\n response.status !== 0 &&\n (request.method === 'HEAD' ||\n request.method === 'CONNECT' ||\n nullBodyStatus.includes(internalResponse.status))\n ) {\n internalResponse.body = null\n fetchParams.controller.dump = true\n }\n\n // 20. If request’s integrity metadata is not the empty string, then:\n if (request.integrity) {\n // 1. Let processBodyError be this step: run fetch finale given fetchParams\n // and a network error.\n const processBodyError = (reason) =>\n fetchFinale(fetchParams, makeNetworkError(reason))\n\n // 2. If request’s response tainting is \"opaque\", or response’s body is null,\n // then run processBodyError and abort these steps.\n if (request.responseTainting === 'opaque' || response.body == null) {\n processBodyError(response.error)\n return\n }\n\n // 3. Let processBody given bytes be these steps:\n const processBody = (bytes) => {\n // 1. If bytes do not match request’s integrity metadata,\n // then run processBodyError and abort these steps. [SRI]\n if (!bytesMatch(bytes, request.integrity)) {\n processBodyError('integrity mismatch')\n return\n }\n\n // 2. Set response’s body to bytes as a body.\n response.body = safelyExtractBody(bytes)[0]\n\n // 3. Run fetch finale given fetchParams and response.\n fetchFinale(fetchParams, response)\n }\n\n // 4. Fully read response’s body given processBody and processBodyError.\n await fullyReadBody(response.body, processBody, processBodyError)\n } else {\n // 21. Otherwise, run fetch finale given fetchParams and response.\n fetchFinale(fetchParams, response)\n }\n}\n\n// https://fetch.spec.whatwg.org/#concept-scheme-fetch\n// given a fetch params fetchParams\nfunction schemeFetch (fetchParams) {\n // Note: since the connection is destroyed on redirect, which sets fetchParams to a\n // cancelled state, we do not want this condition to trigger *unless* there have been\n // no redirects. See https://github.com/nodejs/undici/issues/1776\n // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n return Promise.resolve(makeAppropriateNetworkError(fetchParams))\n }\n\n // 2. Let request be fetchParams’s request.\n const { request } = fetchParams\n\n const { protocol: scheme } = requestCurrentURL(request)\n\n // 3. Switch on request’s current URL’s scheme and run the associated steps:\n switch (scheme) {\n case 'about:': {\n // If request’s current URL’s path is the string \"blank\", then return a new response\n // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,\n // and body is the empty byte sequence as a body.\n\n // Otherwise, return a network error.\n return Promise.resolve(makeNetworkError('about scheme is not supported'))\n }\n case 'blob:': {\n if (!resolveObjectURL) {\n resolveObjectURL = require('node:buffer').resolveObjectURL\n }\n\n // 1. Let blobURLEntry be request’s current URL’s blob URL entry.\n const blobURLEntry = requestCurrentURL(request)\n\n // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56\n // Buffer.resolveObjectURL does not ignore URL queries.\n if (blobURLEntry.search.length !== 0) {\n return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))\n }\n\n const blob = resolveObjectURL(blobURLEntry.toString())\n\n // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s\n // object is not a Blob object, then return a network error.\n if (request.method !== 'GET' || !isBlobLike(blob)) {\n return Promise.resolve(makeNetworkError('invalid method'))\n }\n\n // 3. Let blob be blobURLEntry’s object.\n // Note: done above\n\n // 4. Let response be a new response.\n const response = makeResponse()\n\n // 5. Let fullLength be blob’s size.\n const fullLength = blob.size\n\n // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.\n const serializedFullLength = isomorphicEncode(`${fullLength}`)\n\n // 7. Let type be blob’s type.\n const type = blob.type\n\n // 8. If request’s header list does not contain `Range`:\n // 9. Otherwise:\n if (!request.headersList.contains('range', true)) {\n // 1. Let bodyWithType be the result of safely extracting blob.\n // Note: in the FileAPI a blob \"object\" is a Blob *or* a MediaSource.\n // In node, this can only ever be a Blob. Therefore we can safely\n // use extractBody directly.\n const bodyWithType = extractBody(blob)\n\n // 2. Set response’s status message to `OK`.\n response.statusText = 'OK'\n\n // 3. Set response’s body to bodyWithType’s body.\n response.body = bodyWithType[0]\n\n // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».\n response.headersList.set('content-length', serializedFullLength, true)\n response.headersList.set('content-type', type, true)\n } else {\n // 1. Set response’s range-requested flag.\n response.rangeRequested = true\n\n // 2. Let rangeHeader be the result of getting `Range` from request’s header list.\n const rangeHeader = request.headersList.get('range', true)\n\n // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true.\n const rangeValue = simpleRangeHeaderValue(rangeHeader, true)\n\n // 4. If rangeValue is failure, then return a network error.\n if (rangeValue === 'failure') {\n return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n }\n\n // 5. Let (rangeStart, rangeEnd) be rangeValue.\n let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue\n\n // 6. If rangeStart is null:\n // 7. Otherwise:\n if (rangeStart === null) {\n // 1. Set rangeStart to fullLength − rangeEnd.\n rangeStart = fullLength - rangeEnd\n\n // 2. Set rangeEnd to rangeStart + rangeEnd − 1.\n rangeEnd = rangeStart + rangeEnd - 1\n } else {\n // 1. If rangeStart is greater than or equal to fullLength, then return a network error.\n if (rangeStart >= fullLength) {\n return Promise.resolve(makeNetworkError('Range start is greater than the blob\\'s size.'))\n }\n\n // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set\n // rangeEnd to fullLength − 1.\n if (rangeEnd === null || rangeEnd >= fullLength) {\n rangeEnd = fullLength - 1\n }\n }\n\n // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,\n // rangeEnd + 1, and type.\n const slicedBlob = blob.slice(rangeStart, rangeEnd, type)\n\n // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.\n // Note: same reason as mentioned above as to why we use extractBody\n const slicedBodyWithType = extractBody(slicedBlob)\n\n // 10. Set response’s body to slicedBodyWithType’s body.\n response.body = slicedBodyWithType[0]\n\n // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.\n const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`)\n\n // 12. Let contentRange be the result of invoking build a content range given rangeStart,\n // rangeEnd, and fullLength.\n const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength)\n\n // 13. Set response’s status to 206.\n response.status = 206\n\n // 14. Set response’s status message to `Partial Content`.\n response.statusText = 'Partial Content'\n\n // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength),\n // (`Content-Type`, type), (`Content-Range`, contentRange) ».\n response.headersList.set('content-length', serializedSlicedLength, true)\n response.headersList.set('content-type', type, true)\n response.headersList.set('content-range', contentRange, true)\n }\n\n // 10. Return response.\n return Promise.resolve(response)\n }\n case 'data:': {\n // 1. Let dataURLStruct be the result of running the\n // data: URL processor on request’s current URL.\n const currentURL = requestCurrentURL(request)\n const dataURLStruct = dataURLProcessor(currentURL)\n\n // 2. If dataURLStruct is failure, then return a\n // network error.\n if (dataURLStruct === 'failure') {\n return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n }\n\n // 3. Let mimeType be dataURLStruct’s MIME type, serialized.\n const mimeType = serializeAMimeType(dataURLStruct.mimeType)\n\n // 4. Return a response whose status message is `OK`,\n // header list is « (`Content-Type`, mimeType) »,\n // and body is dataURLStruct’s body as a body.\n return Promise.resolve(makeResponse({\n statusText: 'OK',\n headersList: [\n ['content-type', { name: 'Content-Type', value: mimeType }]\n ],\n body: safelyExtractBody(dataURLStruct.body)[0]\n }))\n }\n case 'file:': {\n // For now, unfortunate as it is, file URLs are left as an exercise for the reader.\n // When in doubt, return a network error.\n return Promise.resolve(makeNetworkError('not implemented... yet...'))\n }\n case 'http:':\n case 'https:': {\n // Return the result of running HTTP fetch given fetchParams.\n\n return httpFetch(fetchParams)\n .catch((err) => makeNetworkError(err))\n }\n default: {\n return Promise.resolve(makeNetworkError('unknown scheme'))\n }\n }\n}\n\n// https://fetch.spec.whatwg.org/#finalize-response\nfunction finalizeResponse (fetchParams, response) {\n // 1. Set fetchParams’s request’s done flag.\n fetchParams.request.done = true\n\n // 2, If fetchParams’s process response done is not null, then queue a fetch\n // task to run fetchParams’s process response done given response, with\n // fetchParams’s task destination.\n if (fetchParams.processResponseDone != null) {\n queueMicrotask(() => fetchParams.processResponseDone(response))\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-finale\nfunction fetchFinale (fetchParams, response) {\n // 1. Let timingInfo be fetchParams’s timing info.\n let timingInfo = fetchParams.timingInfo\n\n // 2. If response is not a network error and fetchParams’s request’s client is a secure context,\n // then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting\n // `Server-Timing` from response’s internal response’s header list.\n // TODO\n\n // 3. Let processResponseEndOfBody be the following steps:\n const processResponseEndOfBody = () => {\n // 1. Let unsafeEndTime be the unsafe shared current time.\n const unsafeEndTime = Date.now() // ?\n\n // 2. If fetchParams’s request’s destination is \"document\", then set fetchParams’s controller’s\n // full timing info to fetchParams’s timing info.\n if (fetchParams.request.destination === 'document') {\n fetchParams.controller.fullTimingInfo = timingInfo\n }\n\n // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:\n fetchParams.controller.reportTimingSteps = () => {\n // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.\n if (fetchParams.request.url.protocol !== 'https:') {\n return\n }\n\n // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global.\n timingInfo.endTime = unsafeEndTime\n\n // 3. Let cacheState be response’s cache state.\n let cacheState = response.cacheState\n\n // 4. Let bodyInfo be response’s body info.\n const bodyInfo = response.bodyInfo\n\n // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an\n // opaque timing info for timingInfo and set cacheState to the empty string.\n if (!response.timingAllowPassed) {\n timingInfo = createOpaqueTimingInfo(timingInfo)\n\n cacheState = ''\n }\n\n // 6. Let responseStatus be 0.\n let responseStatus = 0\n\n // 7. If fetchParams’s request’s mode is not \"navigate\" or response’s has-cross-origin-redirects is false:\n if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {\n // 1. Set responseStatus to response’s status.\n responseStatus = response.status\n\n // 2. Let mimeType be the result of extracting a MIME type from response’s header list.\n const mimeType = extractMimeType(response.headersList)\n\n // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType.\n if (mimeType !== 'failure') {\n bodyInfo.contentType = minimizeSupportedMimeType(mimeType)\n }\n }\n\n // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo,\n // fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,\n // and responseStatus.\n if (fetchParams.request.initiatorType != null) {\n // TODO: update markresourcetiming\n markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)\n }\n }\n\n // 4. Let processResponseEndOfBodyTask be the following steps:\n const processResponseEndOfBodyTask = () => {\n // 1. Set fetchParams’s request’s done flag.\n fetchParams.request.done = true\n\n // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process\n // response end-of-body given response.\n if (fetchParams.processResponseEndOfBody != null) {\n queueMicrotask(() => fetchParams.processResponseEndOfBody(response))\n }\n\n // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s\n // global object is fetchParams’s task destination, then run fetchParams’s controller’s report\n // timing steps given fetchParams’s request’s client’s global object.\n if (fetchParams.request.initiatorType != null) {\n fetchParams.controller.reportTimingSteps()\n }\n }\n\n // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination\n queueMicrotask(() => processResponseEndOfBodyTask())\n }\n\n // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s\n // process response given response, with fetchParams’s task destination.\n if (fetchParams.processResponse != null) {\n queueMicrotask(() => {\n fetchParams.processResponse(response)\n fetchParams.processResponse = null\n })\n }\n\n // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.\n const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)\n\n // 6. If internalResponse’s body is null, then run processResponseEndOfBody.\n // 7. Otherwise:\n if (internalResponse.body == null) {\n processResponseEndOfBody()\n } else {\n // mcollina: all the following steps of the specs are skipped.\n // The internal transform stream is not needed.\n // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541\n\n // 1. Let transformStream be a new TransformStream.\n // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream.\n // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm\n // set to processResponseEndOfBody.\n // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.\n\n finished(internalResponse.body.stream, () => {\n processResponseEndOfBody()\n })\n }\n}\n\n// https://fetch.spec.whatwg.org/#http-fetch\nasync function httpFetch (fetchParams) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. Let actualResponse be null.\n let actualResponse = null\n\n // 4. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 5. If request’s service-workers mode is \"all\", then:\n if (request.serviceWorkers === 'all') {\n // TODO\n }\n\n // 6. If response is null, then:\n if (response === null) {\n // 1. If makeCORSPreflight is true and one of these conditions is true:\n // TODO\n\n // 2. If request’s redirect mode is \"follow\", then set request’s\n // service-workers mode to \"none\".\n if (request.redirect === 'follow') {\n request.serviceWorkers = 'none'\n }\n\n // 3. Set response and actualResponse to the result of running\n // HTTP-network-or-cache fetch given fetchParams.\n actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n // 4. If request’s response tainting is \"cors\" and a CORS check\n // for request and response returns failure, then return a network error.\n if (\n request.responseTainting === 'cors' &&\n corsCheck(request, response) === 'failure'\n ) {\n return makeNetworkError('cors failure')\n }\n\n // 5. If the TAO check for request and response returns failure, then set\n // request’s timing allow failed flag.\n if (TAOCheck(request, response) === 'failure') {\n request.timingAllowFailed = true\n }\n }\n\n // 7. If either request’s response tainting or response’s type\n // is \"opaque\", and the cross-origin resource policy check with\n // request’s origin, request’s client, request’s destination,\n // and actualResponse returns blocked, then return a network error.\n if (\n (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n crossOriginResourcePolicyCheck(\n request.origin,\n request.client,\n request.destination,\n actualResponse\n ) === 'blocked'\n ) {\n return makeNetworkError('blocked')\n }\n\n // 8. If actualResponse’s status is a redirect status, then:\n if (redirectStatusSet.has(actualResponse.status)) {\n // 1. If actualResponse’s status is not 303, request’s body is not null,\n // and the connection uses HTTP/2, then user agents may, and are even\n // encouraged to, transmit an RST_STREAM frame.\n // See, https://github.com/whatwg/fetch/issues/1288\n if (request.redirect !== 'manual') {\n fetchParams.controller.connection.destroy(undefined, false)\n }\n\n // 2. Switch on request’s redirect mode:\n if (request.redirect === 'error') {\n // Set response to a network error.\n response = makeNetworkError('unexpected redirect')\n } else if (request.redirect === 'manual') {\n // Set response to an opaque-redirect filtered response whose internal\n // response is actualResponse.\n // NOTE(spec): On the web this would return an `opaqueredirect` response,\n // but that doesn't make sense server side.\n // See https://github.com/nodejs/undici/issues/1193.\n response = actualResponse\n } else if (request.redirect === 'follow') {\n // Set response to the result of running HTTP-redirect fetch given\n // fetchParams and response.\n response = await httpRedirectFetch(fetchParams, response)\n } else {\n assert(false)\n }\n }\n\n // 9. Set response’s timing info to timingInfo.\n response.timingInfo = timingInfo\n\n // 10. Return response.\n return response\n}\n\n// https://fetch.spec.whatwg.org/#http-redirect-fetch\nfunction httpRedirectFetch (fetchParams, response) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let actualResponse be response, if response is not a filtered response,\n // and response’s internal response otherwise.\n const actualResponse = response.internalResponse\n ? response.internalResponse\n : response\n\n // 3. Let locationURL be actualResponse’s location URL given request’s current\n // URL’s fragment.\n let locationURL\n\n try {\n locationURL = responseLocationURL(\n actualResponse,\n requestCurrentURL(request).hash\n )\n\n // 4. If locationURL is null, then return response.\n if (locationURL == null) {\n return response\n }\n } catch (err) {\n // 5. If locationURL is failure, then return a network error.\n return Promise.resolve(makeNetworkError(err))\n }\n\n // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network\n // error.\n if (!urlIsHttpHttpsScheme(locationURL)) {\n return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))\n }\n\n // 7. If request’s redirect count is 20, then return a network error.\n if (request.redirectCount === 20) {\n return Promise.resolve(makeNetworkError('redirect count exceeded'))\n }\n\n // 8. Increase request’s redirect count by 1.\n request.redirectCount += 1\n\n // 9. If request’s mode is \"cors\", locationURL includes credentials, and\n // request’s origin is not same origin with locationURL’s origin, then return\n // a network error.\n if (\n request.mode === 'cors' &&\n (locationURL.username || locationURL.password) &&\n !sameOrigin(request, locationURL)\n ) {\n return Promise.resolve(makeNetworkError('cross origin not allowed for request mode \"cors\"'))\n }\n\n // 10. If request’s response tainting is \"cors\" and locationURL includes\n // credentials, then return a network error.\n if (\n request.responseTainting === 'cors' &&\n (locationURL.username || locationURL.password)\n ) {\n return Promise.resolve(makeNetworkError(\n 'URL cannot contain credentials for request mode \"cors\"'\n ))\n }\n\n // 11. If actualResponse’s status is not 303, request’s body is non-null,\n // and request’s body’s source is null, then return a network error.\n if (\n actualResponse.status !== 303 &&\n request.body != null &&\n request.body.source == null\n ) {\n return Promise.resolve(makeNetworkError())\n }\n\n // 12. If one of the following is true\n // - actualResponse’s status is 301 or 302 and request’s method is `POST`\n // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`\n if (\n ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||\n (actualResponse.status === 303 &&\n !GET_OR_HEAD.includes(request.method))\n ) {\n // then:\n // 1. Set request’s method to `GET` and request’s body to null.\n request.method = 'GET'\n request.body = null\n\n // 2. For each headerName of request-body-header name, delete headerName from\n // request’s header list.\n for (const headerName of requestBodyHeader) {\n request.headersList.delete(headerName)\n }\n }\n\n // 13. If request’s current URL’s origin is not same origin with locationURL’s\n // origin, then for each headerName of CORS non-wildcard request-header name,\n // delete headerName from request’s header list.\n if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name\n request.headersList.delete('authorization', true)\n\n // https://fetch.spec.whatwg.org/#authentication-entries\n request.headersList.delete('proxy-authorization', true)\n\n // \"Cookie\" and \"Host\" are forbidden request-headers, which undici doesn't implement.\n request.headersList.delete('cookie', true)\n request.headersList.delete('host', true)\n }\n\n // 14. If request’s body is non-null, then set request’s body to the first return\n // value of safely extracting request’s body’s source.\n if (request.body != null) {\n assert(request.body.source != null)\n request.body = safelyExtractBody(request.body.source)[0]\n }\n\n // 15. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 16. Set timingInfo’s redirect end time and post-redirect start time to the\n // coarsened shared current time given fetchParams’s cross-origin isolated\n // capability.\n timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =\n coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n\n // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s\n // redirect start time to timingInfo’s start time.\n if (timingInfo.redirectStartTime === 0) {\n timingInfo.redirectStartTime = timingInfo.startTime\n }\n\n // 18. Append locationURL to request’s URL list.\n request.urlList.push(locationURL)\n\n // 19. Invoke set request’s referrer policy on redirect on request and\n // actualResponse.\n setRequestReferrerPolicyOnRedirect(request, actualResponse)\n\n // 20. Return the result of running main fetch given fetchParams and true.\n return mainFetch(fetchParams, true)\n}\n\n// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch\nasync function httpNetworkOrCacheFetch (\n fetchParams,\n isAuthenticationFetch = false,\n isNewConnectionFetch = false\n) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let httpFetchParams be null.\n let httpFetchParams = null\n\n // 3. Let httpRequest be null.\n let httpRequest = null\n\n // 4. Let response be null.\n let response = null\n\n // 5. Let storedResponse be null.\n // TODO: cache\n\n // 6. Let httpCache be null.\n const httpCache = null\n\n // 7. Let the revalidatingFlag be unset.\n const revalidatingFlag = false\n\n // 8. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. If request’s window is \"no-window\" and request’s redirect mode is\n // \"error\", then set httpFetchParams to fetchParams and httpRequest to\n // request.\n if (request.window === 'no-window' && request.redirect === 'error') {\n httpFetchParams = fetchParams\n httpRequest = request\n } else {\n // Otherwise:\n\n // 1. Set httpRequest to a clone of request.\n httpRequest = cloneRequest(request)\n\n // 2. Set httpFetchParams to a copy of fetchParams.\n httpFetchParams = { ...fetchParams }\n\n // 3. Set httpFetchParams’s request to httpRequest.\n httpFetchParams.request = httpRequest\n }\n\n // 3. Let includeCredentials be true if one of\n const includeCredentials =\n request.credentials === 'include' ||\n (request.credentials === 'same-origin' &&\n request.responseTainting === 'basic')\n\n // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s\n // body is non-null; otherwise null.\n const contentLength = httpRequest.body ? httpRequest.body.length : null\n\n // 5. Let contentLengthHeaderValue be null.\n let contentLengthHeaderValue = null\n\n // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or\n // `PUT`, then set contentLengthHeaderValue to `0`.\n if (\n httpRequest.body == null &&\n ['POST', 'PUT'].includes(httpRequest.method)\n ) {\n contentLengthHeaderValue = '0'\n }\n\n // 7. If contentLength is non-null, then set contentLengthHeaderValue to\n // contentLength, serialized and isomorphic encoded.\n if (contentLength != null) {\n contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)\n }\n\n // 8. If contentLengthHeaderValue is non-null, then append\n // `Content-Length`/contentLengthHeaderValue to httpRequest’s header\n // list.\n if (contentLengthHeaderValue != null) {\n httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)\n }\n\n // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,\n // contentLengthHeaderValue) to httpRequest’s header list.\n\n // 10. If contentLength is non-null and httpRequest’s keepalive is true,\n // then:\n if (contentLength != null && httpRequest.keepalive) {\n // NOTE: keepalive is a noop outside of browser context.\n }\n\n // 11. If httpRequest’s referrer is a URL, then append\n // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,\n // to httpRequest’s header list.\n if (httpRequest.referrer instanceof URL) {\n httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)\n }\n\n // 12. Append a request `Origin` header for httpRequest.\n appendRequestOriginHeader(httpRequest)\n\n // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]\n appendFetchMetadata(httpRequest)\n\n // 14. If httpRequest’s header list does not contain `User-Agent`, then\n // user agents should append `User-Agent`/default `User-Agent` value to\n // httpRequest’s header list.\n if (!httpRequest.headersList.contains('user-agent', true)) {\n httpRequest.headersList.append('user-agent', defaultUserAgent)\n }\n\n // 15. If httpRequest’s cache mode is \"default\" and httpRequest’s header\n // list contains `If-Modified-Since`, `If-None-Match`,\n // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set\n // httpRequest’s cache mode to \"no-store\".\n if (\n httpRequest.cache === 'default' &&\n (httpRequest.headersList.contains('if-modified-since', true) ||\n httpRequest.headersList.contains('if-none-match', true) ||\n httpRequest.headersList.contains('if-unmodified-since', true) ||\n httpRequest.headersList.contains('if-match', true) ||\n httpRequest.headersList.contains('if-range', true))\n ) {\n httpRequest.cache = 'no-store'\n }\n\n // 16. If httpRequest’s cache mode is \"no-cache\", httpRequest’s prevent\n // no-cache cache-control header modification flag is unset, and\n // httpRequest’s header list does not contain `Cache-Control`, then append\n // `Cache-Control`/`max-age=0` to httpRequest’s header list.\n if (\n httpRequest.cache === 'no-cache' &&\n !httpRequest.preventNoCacheCacheControlHeaderModification &&\n !httpRequest.headersList.contains('cache-control', true)\n ) {\n httpRequest.headersList.append('cache-control', 'max-age=0', true)\n }\n\n // 17. If httpRequest’s cache mode is \"no-store\" or \"reload\", then:\n if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {\n // 1. If httpRequest’s header list does not contain `Pragma`, then append\n // `Pragma`/`no-cache` to httpRequest’s header list.\n if (!httpRequest.headersList.contains('pragma', true)) {\n httpRequest.headersList.append('pragma', 'no-cache', true)\n }\n\n // 2. If httpRequest’s header list does not contain `Cache-Control`,\n // then append `Cache-Control`/`no-cache` to httpRequest’s header list.\n if (!httpRequest.headersList.contains('cache-control', true)) {\n httpRequest.headersList.append('cache-control', 'no-cache', true)\n }\n }\n\n // 18. If httpRequest’s header list contains `Range`, then append\n // `Accept-Encoding`/`identity` to httpRequest’s header list.\n if (httpRequest.headersList.contains('range', true)) {\n httpRequest.headersList.append('accept-encoding', 'identity', true)\n }\n\n // 19. Modify httpRequest’s header list per HTTP. Do not append a given\n // header if httpRequest’s header list contains that header’s name.\n // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129\n if (!httpRequest.headersList.contains('accept-encoding', true)) {\n if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)\n } else {\n httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)\n }\n }\n\n httpRequest.headersList.delete('host', true)\n\n // 20. If includeCredentials is true, then:\n if (includeCredentials) {\n // 1. If the user agent is not configured to block cookies for httpRequest\n // (see section 7 of [COOKIES]), then:\n // TODO: credentials\n // 2. If httpRequest’s header list does not contain `Authorization`, then:\n // TODO: credentials\n }\n\n // 21. If there’s a proxy-authentication entry, use it as appropriate.\n // TODO: proxy-authentication\n\n // 22. Set httpCache to the result of determining the HTTP cache\n // partition, given httpRequest.\n // TODO: cache\n\n // 23. If httpCache is null, then set httpRequest’s cache mode to\n // \"no-store\".\n if (httpCache == null) {\n httpRequest.cache = 'no-store'\n }\n\n // 24. If httpRequest’s cache mode is neither \"no-store\" nor \"reload\",\n // then:\n if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {\n // TODO: cache\n }\n\n // 9. If aborted, then return the appropriate network error for fetchParams.\n // TODO\n\n // 10. If response is null, then:\n if (response == null) {\n // 1. If httpRequest’s cache mode is \"only-if-cached\", then return a\n // network error.\n if (httpRequest.cache === 'only-if-cached') {\n return makeNetworkError('only if cached')\n }\n\n // 2. Let forwardResponse be the result of running HTTP-network fetch\n // given httpFetchParams, includeCredentials, and isNewConnectionFetch.\n const forwardResponse = await httpNetworkFetch(\n httpFetchParams,\n includeCredentials,\n isNewConnectionFetch\n )\n\n // 3. If httpRequest’s method is unsafe and forwardResponse’s status is\n // in the range 200 to 399, inclusive, invalidate appropriate stored\n // responses in httpCache, as per the \"Invalidation\" chapter of HTTP\n // Caching, and set storedResponse to null. [HTTP-CACHING]\n if (\n !safeMethodsSet.has(httpRequest.method) &&\n forwardResponse.status >= 200 &&\n forwardResponse.status <= 399\n ) {\n // TODO: cache\n }\n\n // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,\n // then:\n if (revalidatingFlag && forwardResponse.status === 304) {\n // TODO: cache\n }\n\n // 5. If response is null, then:\n if (response == null) {\n // 1. Set response to forwardResponse.\n response = forwardResponse\n\n // 2. Store httpRequest and forwardResponse in httpCache, as per the\n // \"Storing Responses in Caches\" chapter of HTTP Caching. [HTTP-CACHING]\n // TODO: cache\n }\n }\n\n // 11. Set response’s URL list to a clone of httpRequest’s URL list.\n response.urlList = [...httpRequest.urlList]\n\n // 12. If httpRequest’s header list contains `Range`, then set response’s\n // range-requested flag.\n if (httpRequest.headersList.contains('range', true)) {\n response.rangeRequested = true\n }\n\n // 13. Set response’s request-includes-credentials to includeCredentials.\n response.requestIncludesCredentials = includeCredentials\n\n // 14. If response’s status is 401, httpRequest’s response tainting is not\n // \"cors\", includeCredentials is true, and request’s window is an environment\n // settings object, then:\n // TODO\n\n // 15. If response’s status is 407, then:\n if (response.status === 407) {\n // 1. If request’s window is \"no-window\", then return a network error.\n if (request.window === 'no-window') {\n return makeNetworkError()\n }\n\n // 2. ???\n\n // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 4. Prompt the end user as appropriate in request’s window and store\n // the result as a proxy-authentication entry. [HTTP-AUTH]\n // TODO: Invoke some kind of callback?\n\n // 5. Set response to the result of running HTTP-network-or-cache fetch given\n // fetchParams.\n // TODO\n return makeNetworkError('proxy authentication required')\n }\n\n // 16. If all of the following are true\n if (\n // response’s status is 421\n response.status === 421 &&\n // isNewConnectionFetch is false\n !isNewConnectionFetch &&\n // request’s body is null, or request’s body is non-null and request’s body’s source is non-null\n (request.body == null || request.body.source != null)\n ) {\n // then:\n\n // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 2. Set response to the result of running HTTP-network-or-cache\n // fetch given fetchParams, isAuthenticationFetch, and true.\n\n // TODO (spec): The spec doesn't specify this but we need to cancel\n // the active response before we can start a new one.\n // https://github.com/whatwg/fetch/issues/1293\n fetchParams.controller.connection.destroy()\n\n response = await httpNetworkOrCacheFetch(\n fetchParams,\n isAuthenticationFetch,\n true\n )\n }\n\n // 17. If isAuthenticationFetch is true, then create an authentication entry\n if (isAuthenticationFetch) {\n // TODO\n }\n\n // 18. Return response.\n return response\n}\n\n// https://fetch.spec.whatwg.org/#http-network-fetch\nasync function httpNetworkFetch (\n fetchParams,\n includeCredentials = false,\n forceNewConnection = false\n) {\n assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)\n\n fetchParams.controller.connection = {\n abort: null,\n destroyed: false,\n destroy (err, abort = true) {\n if (!this.destroyed) {\n this.destroyed = true\n if (abort) {\n this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))\n }\n }\n }\n }\n\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 4. Let httpCache be the result of determining the HTTP cache partition,\n // given request.\n // TODO: cache\n const httpCache = null\n\n // 5. If httpCache is null, then set request’s cache mode to \"no-store\".\n if (httpCache == null) {\n request.cache = 'no-store'\n }\n\n // 6. Let networkPartitionKey be the result of determining the network\n // partition key given request.\n // TODO\n\n // 7. Let newConnection be \"yes\" if forceNewConnection is true; otherwise\n // \"no\".\n const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars\n\n // 8. Switch on request’s mode:\n if (request.mode === 'websocket') {\n // Let connection be the result of obtaining a WebSocket connection,\n // given request’s current URL.\n // TODO\n } else {\n // Let connection be the result of obtaining a connection, given\n // networkPartitionKey, request’s current URL’s origin,\n // includeCredentials, and forceNewConnection.\n // TODO\n }\n\n // 9. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. If connection is failure, then return a network error.\n\n // 2. Set timingInfo’s final connection timing info to the result of\n // calling clamp and coarsen connection timing info with connection’s\n // timing info, timingInfo’s post-redirect start time, and fetchParams’s\n // cross-origin isolated capability.\n\n // 3. If connection is not an HTTP/2 connection, request’s body is non-null,\n // and request’s body’s source is null, then append (`Transfer-Encoding`,\n // `chunked`) to request’s header list.\n\n // 4. Set timingInfo’s final network-request start time to the coarsened\n // shared current time given fetchParams’s cross-origin isolated\n // capability.\n\n // 5. Set response to the result of making an HTTP request over connection\n // using request with the following caveats:\n\n // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]\n // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]\n\n // - If request’s body is non-null, and request’s body’s source is null,\n // then the user agent may have a buffer of up to 64 kibibytes and store\n // a part of request’s body in that buffer. If the user agent reads from\n // request’s body beyond that buffer’s size and the user agent needs to\n // resend request, then instead return a network error.\n\n // - Set timingInfo’s final network-response start time to the coarsened\n // shared current time given fetchParams’s cross-origin isolated capability,\n // immediately after the user agent’s HTTP parser receives the first byte\n // of the response (e.g., frame header bytes for HTTP/2 or response status\n // line for HTTP/1.x).\n\n // - Wait until all the headers are transmitted.\n\n // - Any responses whose status is in the range 100 to 199, inclusive,\n // and is not 101, are to be ignored, except for the purposes of setting\n // timingInfo’s final network-response start time above.\n\n // - If request’s header list contains `Transfer-Encoding`/`chunked` and\n // response is transferred via HTTP/1.0 or older, then return a network\n // error.\n\n // - If the HTTP request results in a TLS client certificate dialog, then:\n\n // 1. If request’s window is an environment settings object, make the\n // dialog available in request’s window.\n\n // 2. Otherwise, return a network error.\n\n // To transmit request’s body body, run these steps:\n let requestBody = null\n // 1. If body is null and fetchParams’s process request end-of-body is\n // non-null, then queue a fetch task given fetchParams’s process request\n // end-of-body and fetchParams’s task destination.\n if (request.body == null && fetchParams.processRequestEndOfBody) {\n queueMicrotask(() => fetchParams.processRequestEndOfBody())\n } else if (request.body != null) {\n // 2. Otherwise, if body is non-null:\n\n // 1. Let processBodyChunk given bytes be these steps:\n const processBodyChunk = async function * (bytes) {\n // 1. If the ongoing fetch is terminated, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. Run this step in parallel: transmit bytes.\n yield bytes\n\n // 3. If fetchParams’s process request body is non-null, then run\n // fetchParams’s process request body given bytes’s length.\n fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)\n }\n\n // 2. Let processEndOfBody be these steps:\n const processEndOfBody = () => {\n // 1. If fetchParams is canceled, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. If fetchParams’s process request end-of-body is non-null,\n // then run fetchParams’s process request end-of-body.\n if (fetchParams.processRequestEndOfBody) {\n fetchParams.processRequestEndOfBody()\n }\n }\n\n // 3. Let processBodyError given e be these steps:\n const processBodyError = (e) => {\n // 1. If fetchParams is canceled, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. If e is an \"AbortError\" DOMException, then abort fetchParams’s controller.\n if (e.name === 'AbortError') {\n fetchParams.controller.abort()\n } else {\n fetchParams.controller.terminate(e)\n }\n }\n\n // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,\n // processBodyError, and fetchParams’s task destination.\n requestBody = (async function * () {\n try {\n for await (const bytes of request.body.stream) {\n yield * processBodyChunk(bytes)\n }\n processEndOfBody()\n } catch (err) {\n processBodyError(err)\n }\n })()\n }\n\n try {\n // socket is only provided for websockets\n const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })\n\n if (socket) {\n response = makeResponse({ status, statusText, headersList, socket })\n } else {\n const iterator = body[Symbol.asyncIterator]()\n fetchParams.controller.next = () => iterator.next()\n\n response = makeResponse({ status, statusText, headersList })\n }\n } catch (err) {\n // 10. If aborted, then:\n if (err.name === 'AbortError') {\n // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n fetchParams.controller.connection.destroy()\n\n // 2. Return the appropriate network error for fetchParams.\n return makeAppropriateNetworkError(fetchParams, err)\n }\n\n return makeNetworkError(err)\n }\n\n // 11. Let pullAlgorithm be an action that resumes the ongoing fetch\n // if it is suspended.\n const pullAlgorithm = async () => {\n await fetchParams.controller.resume()\n }\n\n // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s\n // controller with reason, given reason.\n const cancelAlgorithm = (reason) => {\n // If the aborted fetch was already terminated, then we do not\n // need to do anything.\n if (!isCancelled(fetchParams)) {\n fetchParams.controller.abort(reason)\n }\n }\n\n // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by\n // the user agent.\n // TODO\n\n // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object\n // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.\n // TODO\n\n // 15. Let stream be a new ReadableStream.\n // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm,\n // cancelAlgorithm set to cancelAlgorithm.\n const stream = new ReadableStream(\n {\n async start (controller) {\n fetchParams.controller.controller = controller\n },\n async pull (controller) {\n await pullAlgorithm(controller)\n },\n async cancel (reason) {\n await cancelAlgorithm(reason)\n },\n type: 'bytes'\n }\n )\n\n // 17. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. Set response’s body to a new body whose stream is stream.\n response.body = { stream, source: null, length: null }\n\n // 2. If response is not a network error and request’s cache mode is\n // not \"no-store\", then update response in httpCache for request.\n // TODO\n\n // 3. If includeCredentials is true and the user agent is not configured\n // to block cookies for request (see section 7 of [COOKIES]), then run the\n // \"set-cookie-string\" parsing algorithm (see section 5.2 of [COOKIES]) on\n // the value of each header whose name is a byte-case-insensitive match for\n // `Set-Cookie` in response’s header list, if any, and request’s current URL.\n // TODO\n\n // 18. If aborted, then:\n // TODO\n\n // 19. Run these steps in parallel:\n\n // 1. Run these steps, but abort when fetchParams is canceled:\n fetchParams.controller.onAborted = onAborted\n fetchParams.controller.on('terminated', onAborted)\n fetchParams.controller.resume = async () => {\n // 1. While true\n while (true) {\n // 1-3. See onData...\n\n // 4. Set bytes to the result of handling content codings given\n // codings and bytes.\n let bytes\n let isFailure\n try {\n const { done, value } = await fetchParams.controller.next()\n\n if (isAborted(fetchParams)) {\n break\n }\n\n bytes = done ? undefined : value\n } catch (err) {\n if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n // zlib doesn't like empty streams.\n bytes = undefined\n } else {\n bytes = err\n\n // err may be propagated from the result of calling readablestream.cancel,\n // which might not be an error. https://github.com/nodejs/undici/issues/2009\n isFailure = true\n }\n }\n\n if (bytes === undefined) {\n // 2. Otherwise, if the bytes transmission for response’s message\n // body is done normally and stream is readable, then close\n // stream, finalize response for fetchParams and response, and\n // abort these in-parallel steps.\n readableStreamClose(fetchParams.controller.controller)\n\n finalizeResponse(fetchParams, response)\n\n return\n }\n\n // 5. Increase timingInfo’s decoded body size by bytes’s length.\n timingInfo.decodedBodySize += bytes?.byteLength ?? 0\n\n // 6. If bytes is failure, then terminate fetchParams’s controller.\n if (isFailure) {\n fetchParams.controller.terminate(bytes)\n return\n }\n\n // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes\n // into stream.\n const buffer = new Uint8Array(bytes)\n if (buffer.byteLength) {\n fetchParams.controller.controller.enqueue(buffer)\n }\n\n // 8. If stream is errored, then terminate the ongoing fetch.\n if (isErrored(stream)) {\n fetchParams.controller.terminate()\n return\n }\n\n // 9. If stream doesn’t need more data ask the user agent to suspend\n // the ongoing fetch.\n if (fetchParams.controller.controller.desiredSize <= 0) {\n return\n }\n }\n }\n\n // 2. If aborted, then:\n function onAborted (reason) {\n // 2. If fetchParams is aborted, then:\n if (isAborted(fetchParams)) {\n // 1. Set response’s aborted flag.\n response.aborted = true\n\n // 2. If stream is readable, then error stream with the result of\n // deserialize a serialized abort reason given fetchParams’s\n // controller’s serialized abort reason and an\n // implementation-defined realm.\n if (isReadable(stream)) {\n fetchParams.controller.controller.error(\n fetchParams.controller.serializedAbortReason\n )\n }\n } else {\n // 3. Otherwise, if stream is readable, error stream with a TypeError.\n if (isReadable(stream)) {\n fetchParams.controller.controller.error(new TypeError('terminated', {\n cause: isErrorLike(reason) ? reason : undefined\n }))\n }\n }\n\n // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.\n fetchParams.controller.connection.destroy()\n }\n\n // 20. Return response.\n return response\n\n function dispatch ({ body }) {\n const url = requestCurrentURL(request)\n /** @type {import('../..').Agent} */\n const agent = fetchParams.controller.dispatcher\n\n return new Promise((resolve, reject) => agent.dispatch(\n {\n path: url.pathname + url.search,\n origin: url.origin,\n method: request.method,\n body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,\n headers: request.headersList.entries,\n maxRedirections: 0,\n upgrade: request.mode === 'websocket' ? 'websocket' : undefined\n },\n {\n body: null,\n abort: null,\n\n onConnect (abort) {\n // TODO (fix): Do we need connection here?\n const { connection } = fetchParams.controller\n\n // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen\n // connection timing info with connection’s timing info, timingInfo’s post-redirect start\n // time, and fetchParams’s cross-origin isolated capability.\n // TODO: implement connection timing\n timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)\n\n if (connection.destroyed) {\n abort(new DOMException('The operation was aborted.', 'AbortError'))\n } else {\n fetchParams.controller.on('terminated', abort)\n this.abort = connection.abort = abort\n }\n\n // Set timingInfo’s final network-request start time to the coarsened shared current time given\n // fetchParams’s cross-origin isolated capability.\n timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n },\n\n onResponseStarted () {\n // Set timingInfo’s final network-response start time to the coarsened shared current\n // time given fetchParams’s cross-origin isolated capability, immediately after the\n // user agent’s HTTP parser receives the first byte of the response (e.g., frame header\n // bytes for HTTP/2 or response status line for HTTP/1.x).\n timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n },\n\n onHeaders (status, rawHeaders, resume, statusText) {\n if (status < 200) {\n return\n }\n\n let location = ''\n\n const headersList = new HeadersList()\n\n for (let i = 0; i < rawHeaders.length; i += 2) {\n headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n }\n location = headersList.get('location', true)\n\n this.body = new Readable({ read: resume })\n\n const decoders = []\n\n const willFollow = location && request.redirect === 'follow' &&\n redirectStatusSet.has(status)\n\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding\n if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {\n // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n const contentEncoding = headersList.get('content-encoding', true)\n // \"All content-coding values are case-insensitive...\"\n /** @type {string[]} */\n const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []\n\n // Limit the number of content-encodings to prevent resource exhaustion.\n // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).\n const maxContentEncodings = 5\n if (codings.length > maxContentEncodings) {\n reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))\n return true\n }\n\n for (let i = codings.length - 1; i >= 0; --i) {\n const coding = codings[i].trim()\n // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2\n if (coding === 'x-gzip' || coding === 'gzip') {\n decoders.push(zlib.createGunzip({\n // Be less strict when decoding compressed responses, since sometimes\n // servers send slightly invalid responses that are still accepted\n // by common browsers.\n // Always using Z_SYNC_FLUSH is what cURL does.\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n }))\n } else if (coding === 'deflate') {\n decoders.push(createInflate({\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n }))\n } else if (coding === 'br') {\n decoders.push(zlib.createBrotliDecompress({\n flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n }))\n } else {\n decoders.length = 0\n break\n }\n }\n }\n\n const onError = this.onError.bind(this)\n\n resolve({\n status,\n statusText,\n headersList,\n body: decoders.length\n ? pipeline(this.body, ...decoders, (err) => {\n if (err) {\n this.onError(err)\n }\n }).on('error', onError)\n : this.body.on('error', onError)\n })\n\n return true\n },\n\n onData (chunk) {\n if (fetchParams.controller.dump) {\n return\n }\n\n // 1. If one or more bytes have been transmitted from response’s\n // message body, then:\n\n // 1. Let bytes be the transmitted bytes.\n const bytes = chunk\n\n // 2. Let codings be the result of extracting header list values\n // given `Content-Encoding` and response’s header list.\n // See pullAlgorithm.\n\n // 3. Increase timingInfo’s encoded body size by bytes’s length.\n timingInfo.encodedBodySize += bytes.byteLength\n\n // 4. See pullAlgorithm...\n\n return this.body.push(bytes)\n },\n\n onComplete () {\n if (this.abort) {\n fetchParams.controller.off('terminated', this.abort)\n }\n\n if (fetchParams.controller.onAborted) {\n fetchParams.controller.off('terminated', fetchParams.controller.onAborted)\n }\n\n fetchParams.controller.ended = true\n\n this.body.push(null)\n },\n\n onError (error) {\n if (this.abort) {\n fetchParams.controller.off('terminated', this.abort)\n }\n\n this.body?.destroy(error)\n\n fetchParams.controller.terminate(error)\n\n reject(error)\n },\n\n onUpgrade (status, rawHeaders, socket) {\n if (status !== 101) {\n return\n }\n\n const headersList = new HeadersList()\n\n for (let i = 0; i < rawHeaders.length; i += 2) {\n headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n }\n\n resolve({\n status,\n statusText: STATUS_CODES[status],\n headersList,\n socket\n })\n\n return true\n }\n }\n ))\n }\n}\n\nmodule.exports = {\n fetch,\n Fetch,\n fetching,\n finalizeAndReportTiming\n}\n","/* globals AbortController */\n\n'use strict'\n\nconst { extractBody, mixinBody, cloneBody, bodyUnusable } = require('./body')\nconst { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require('./headers')\nconst { FinalizationRegistry } = require('./dispatcher-weakref')()\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst {\n isValidHTTPToken,\n sameOrigin,\n environmentSettingsObject\n} = require('./util')\nconst {\n forbiddenMethodsSet,\n corsSafeListedMethodsSet,\n referrerPolicy,\n requestRedirect,\n requestMode,\n requestCredentials,\n requestCache,\n requestDuplex\n} = require('./constants')\nconst { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util\nconst { kHeaders, kSignal, kState, kDispatcher } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('node:events')\n\nconst kAbortController = Symbol('abortController')\n\nconst requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n signal.removeEventListener('abort', abort)\n})\n\nconst dependentControllerMap = new WeakMap()\n\nfunction buildAbort (acRef) {\n return abort\n\n function abort () {\n const ac = acRef.deref()\n if (ac !== undefined) {\n // Currently, there is a problem with FinalizationRegistry.\n // https://github.com/nodejs/node/issues/49344\n // https://github.com/nodejs/node/issues/47748\n // In the case of abort, the first step is to unregister from it.\n // If the controller can refer to it, it is still registered.\n // It will be removed in the future.\n requestFinalizer.unregister(abort)\n\n // Unsubscribe a listener.\n // FinalizationRegistry will no longer be called, so this must be done.\n this.removeEventListener('abort', abort)\n\n ac.abort(this.reason)\n\n const controllerList = dependentControllerMap.get(ac.signal)\n\n if (controllerList !== undefined) {\n if (controllerList.size !== 0) {\n for (const ref of controllerList) {\n const ctrl = ref.deref()\n if (ctrl !== undefined) {\n ctrl.abort(this.reason)\n }\n }\n controllerList.clear()\n }\n dependentControllerMap.delete(ac.signal)\n }\n }\n }\n}\n\nlet patchMethodWarning = false\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request {\n // https://fetch.spec.whatwg.org/#dom-request\n constructor (input, init = {}) {\n webidl.util.markAsUncloneable(this)\n if (input === kConstruct) {\n return\n }\n\n const prefix = 'Request constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n input = webidl.converters.RequestInfo(input, prefix, 'input')\n init = webidl.converters.RequestInit(init, prefix, 'init')\n\n // 1. Let request be null.\n let request = null\n\n // 2. Let fallbackMode be null.\n let fallbackMode = null\n\n // 3. Let baseURL be this’s relevant settings object’s API base URL.\n const baseUrl = environmentSettingsObject.settingsObject.baseUrl\n\n // 4. Let signal be null.\n let signal = null\n\n // 5. If input is a string, then:\n if (typeof input === 'string') {\n this[kDispatcher] = init.dispatcher\n\n // 1. Let parsedURL be the result of parsing input with baseURL.\n // 2. If parsedURL is failure, then throw a TypeError.\n let parsedURL\n try {\n parsedURL = new URL(input, baseUrl)\n } catch (err) {\n throw new TypeError('Failed to parse URL from ' + input, { cause: err })\n }\n\n // 3. If parsedURL includes credentials, then throw a TypeError.\n if (parsedURL.username || parsedURL.password) {\n throw new TypeError(\n 'Request cannot be constructed from a URL that includes credentials: ' +\n input\n )\n }\n\n // 4. Set request to a new request whose URL is parsedURL.\n request = makeRequest({ urlList: [parsedURL] })\n\n // 5. Set fallbackMode to \"cors\".\n fallbackMode = 'cors'\n } else {\n this[kDispatcher] = init.dispatcher || input[kDispatcher]\n\n // 6. Otherwise:\n\n // 7. Assert: input is a Request object.\n assert(input instanceof Request)\n\n // 8. Set request to input’s request.\n request = input[kState]\n\n // 9. Set signal to input’s signal.\n signal = input[kSignal]\n }\n\n // 7. Let origin be this’s relevant settings object’s origin.\n const origin = environmentSettingsObject.settingsObject.origin\n\n // 8. Let window be \"client\".\n let window = 'client'\n\n // 9. If request’s window is an environment settings object and its origin\n // is same origin with origin, then set window to request’s window.\n if (\n request.window?.constructor?.name === 'EnvironmentSettingsObject' &&\n sameOrigin(request.window, origin)\n ) {\n window = request.window\n }\n\n // 10. If init[\"window\"] exists and is non-null, then throw a TypeError.\n if (init.window != null) {\n throw new TypeError(`'window' option '${window}' must be null`)\n }\n\n // 11. If init[\"window\"] exists, then set window to \"no-window\".\n if ('window' in init) {\n window = 'no-window'\n }\n\n // 12. Set request to a new request with the following properties:\n request = makeRequest({\n // URL request’s URL.\n // undici implementation note: this is set as the first item in request's urlList in makeRequest\n // method request’s method.\n method: request.method,\n // header list A copy of request’s header list.\n // undici implementation note: headersList is cloned in makeRequest\n headersList: request.headersList,\n // unsafe-request flag Set.\n unsafeRequest: request.unsafeRequest,\n // client This’s relevant settings object.\n client: environmentSettingsObject.settingsObject,\n // window window.\n window,\n // priority request’s priority.\n priority: request.priority,\n // origin request’s origin. The propagation of the origin is only significant for navigation requests\n // being handled by a service worker. In this scenario a request can have an origin that is different\n // from the current client.\n origin: request.origin,\n // referrer request’s referrer.\n referrer: request.referrer,\n // referrer policy request’s referrer policy.\n referrerPolicy: request.referrerPolicy,\n // mode request’s mode.\n mode: request.mode,\n // credentials mode request’s credentials mode.\n credentials: request.credentials,\n // cache mode request’s cache mode.\n cache: request.cache,\n // redirect mode request’s redirect mode.\n redirect: request.redirect,\n // integrity metadata request’s integrity metadata.\n integrity: request.integrity,\n // keepalive request’s keepalive.\n keepalive: request.keepalive,\n // reload-navigation flag request’s reload-navigation flag.\n reloadNavigation: request.reloadNavigation,\n // history-navigation flag request’s history-navigation flag.\n historyNavigation: request.historyNavigation,\n // URL list A clone of request’s URL list.\n urlList: [...request.urlList]\n })\n\n const initHasKey = Object.keys(init).length !== 0\n\n // 13. If init is not empty, then:\n if (initHasKey) {\n // 1. If request’s mode is \"navigate\", then set it to \"same-origin\".\n if (request.mode === 'navigate') {\n request.mode = 'same-origin'\n }\n\n // 2. Unset request’s reload-navigation flag.\n request.reloadNavigation = false\n\n // 3. Unset request’s history-navigation flag.\n request.historyNavigation = false\n\n // 4. Set request’s origin to \"client\".\n request.origin = 'client'\n\n // 5. Set request’s referrer to \"client\"\n request.referrer = 'client'\n\n // 6. Set request’s referrer policy to the empty string.\n request.referrerPolicy = ''\n\n // 7. Set request’s URL to request’s current URL.\n request.url = request.urlList[request.urlList.length - 1]\n\n // 8. Set request’s URL list to « request’s URL ».\n request.urlList = [request.url]\n }\n\n // 14. If init[\"referrer\"] exists, then:\n if (init.referrer !== undefined) {\n // 1. Let referrer be init[\"referrer\"].\n const referrer = init.referrer\n\n // 2. If referrer is the empty string, then set request’s referrer to \"no-referrer\".\n if (referrer === '') {\n request.referrer = 'no-referrer'\n } else {\n // 1. Let parsedReferrer be the result of parsing referrer with\n // baseURL.\n // 2. If parsedReferrer is failure, then throw a TypeError.\n let parsedReferrer\n try {\n parsedReferrer = new URL(referrer, baseUrl)\n } catch (err) {\n throw new TypeError(`Referrer \"${referrer}\" is not a valid URL.`, { cause: err })\n }\n\n // 3. If one of the following is true\n // - parsedReferrer’s scheme is \"about\" and path is the string \"client\"\n // - parsedReferrer’s origin is not same origin with origin\n // then set request’s referrer to \"client\".\n if (\n (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||\n (origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl))\n ) {\n request.referrer = 'client'\n } else {\n // 4. Otherwise, set request’s referrer to parsedReferrer.\n request.referrer = parsedReferrer\n }\n }\n }\n\n // 15. If init[\"referrerPolicy\"] exists, then set request’s referrer policy\n // to it.\n if (init.referrerPolicy !== undefined) {\n request.referrerPolicy = init.referrerPolicy\n }\n\n // 16. Let mode be init[\"mode\"] if it exists, and fallbackMode otherwise.\n let mode\n if (init.mode !== undefined) {\n mode = init.mode\n } else {\n mode = fallbackMode\n }\n\n // 17. If mode is \"navigate\", then throw a TypeError.\n if (mode === 'navigate') {\n throw webidl.errors.exception({\n header: 'Request constructor',\n message: 'invalid request mode navigate.'\n })\n }\n\n // 18. If mode is non-null, set request’s mode to mode.\n if (mode != null) {\n request.mode = mode\n }\n\n // 19. If init[\"credentials\"] exists, then set request’s credentials mode\n // to it.\n if (init.credentials !== undefined) {\n request.credentials = init.credentials\n }\n\n // 18. If init[\"cache\"] exists, then set request’s cache mode to it.\n if (init.cache !== undefined) {\n request.cache = init.cache\n }\n\n // 21. If request’s cache mode is \"only-if-cached\" and request’s mode is\n // not \"same-origin\", then throw a TypeError.\n if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {\n throw new TypeError(\n \"'only-if-cached' can be set only with 'same-origin' mode\"\n )\n }\n\n // 22. If init[\"redirect\"] exists, then set request’s redirect mode to it.\n if (init.redirect !== undefined) {\n request.redirect = init.redirect\n }\n\n // 23. If init[\"integrity\"] exists, then set request’s integrity metadata to it.\n if (init.integrity != null) {\n request.integrity = String(init.integrity)\n }\n\n // 24. If init[\"keepalive\"] exists, then set request’s keepalive to it.\n if (init.keepalive !== undefined) {\n request.keepalive = Boolean(init.keepalive)\n }\n\n // 25. If init[\"method\"] exists, then:\n if (init.method !== undefined) {\n // 1. Let method be init[\"method\"].\n let method = init.method\n\n const mayBeNormalized = normalizedMethodRecords[method]\n\n if (mayBeNormalized !== undefined) {\n // Note: Bypass validation DELETE, GET, HEAD, OPTIONS, POST, PUT, PATCH and these lowercase ones\n request.method = mayBeNormalized\n } else {\n // 2. If method is not a method or method is a forbidden method, then\n // throw a TypeError.\n if (!isValidHTTPToken(method)) {\n throw new TypeError(`'${method}' is not a valid HTTP method.`)\n }\n\n const upperCase = method.toUpperCase()\n\n if (forbiddenMethodsSet.has(upperCase)) {\n throw new TypeError(`'${method}' HTTP method is unsupported.`)\n }\n\n // 3. Normalize method.\n // https://fetch.spec.whatwg.org/#concept-method-normalize\n // Note: must be in uppercase\n method = normalizedMethodRecordsBase[upperCase] ?? method\n\n // 4. Set request’s method to method.\n request.method = method\n }\n\n if (!patchMethodWarning && request.method === 'patch') {\n process.emitWarning('Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.', {\n code: 'UNDICI-FETCH-patch'\n })\n\n patchMethodWarning = true\n }\n }\n\n // 26. If init[\"signal\"] exists, then set signal to it.\n if (init.signal !== undefined) {\n signal = init.signal\n }\n\n // 27. Set this’s request to request.\n this[kState] = request\n\n // 28. Set this’s signal to a new AbortSignal object with this’s relevant\n // Realm.\n // TODO: could this be simplified with AbortSignal.any\n // (https://dom.spec.whatwg.org/#dom-abortsignal-any)\n const ac = new AbortController()\n this[kSignal] = ac.signal\n\n // 29. If signal is not null, then make this’s signal follow signal.\n if (signal != null) {\n if (\n !signal ||\n typeof signal.aborted !== 'boolean' ||\n typeof signal.addEventListener !== 'function'\n ) {\n throw new TypeError(\n \"Failed to construct 'Request': member signal is not of type AbortSignal.\"\n )\n }\n\n if (signal.aborted) {\n ac.abort(signal.reason)\n } else {\n // Keep a strong ref to ac while request object\n // is alive. This is needed to prevent AbortController\n // from being prematurely garbage collected.\n // See, https://github.com/nodejs/undici/issues/1926.\n this[kAbortController] = ac\n\n const acRef = new WeakRef(ac)\n const abort = buildAbort(acRef)\n\n // Third-party AbortControllers may not work with these.\n // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.\n try {\n // If the max amount of listeners is equal to the default, increase it\n // This is only available in node >= v19.9.0\n if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {\n setMaxListeners(1500, signal)\n } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {\n setMaxListeners(1500, signal)\n }\n } catch {}\n\n util.addAbortListener(signal, abort)\n // The third argument must be a registry key to be unregistered.\n // Without it, you cannot unregister.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n // abort is used as the unregister key. (because it is unique)\n requestFinalizer.register(ac, { signal, abort }, abort)\n }\n }\n\n // 30. Set this’s headers to a new Headers object with this’s relevant\n // Realm, whose header list is request’s header list and guard is\n // \"request\".\n this[kHeaders] = new Headers(kConstruct)\n setHeadersList(this[kHeaders], request.headersList)\n setHeadersGuard(this[kHeaders], 'request')\n\n // 31. If this’s request’s mode is \"no-cors\", then:\n if (mode === 'no-cors') {\n // 1. If this’s request’s method is not a CORS-safelisted method,\n // then throw a TypeError.\n if (!corsSafeListedMethodsSet.has(request.method)) {\n throw new TypeError(\n `'${request.method} is unsupported in no-cors mode.`\n )\n }\n\n // 2. Set this’s headers’s guard to \"request-no-cors\".\n setHeadersGuard(this[kHeaders], 'request-no-cors')\n }\n\n // 32. If init is not empty, then:\n if (initHasKey) {\n /** @type {HeadersList} */\n const headersList = getHeadersList(this[kHeaders])\n // 1. Let headers be a copy of this’s headers and its associated header\n // list.\n // 2. If init[\"headers\"] exists, then set headers to init[\"headers\"].\n const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)\n\n // 3. Empty this’s headers’s header list.\n headersList.clear()\n\n // 4. If headers is a Headers object, then for each header in its header\n // list, append header’s name/header’s value to this’s headers.\n if (headers instanceof HeadersList) {\n for (const { name, value } of headers.rawValues()) {\n headersList.append(name, value, false)\n }\n // Note: Copy the `set-cookie` meta-data.\n headersList.cookies = headers.cookies\n } else {\n // 5. Otherwise, fill this’s headers with headers.\n fillHeaders(this[kHeaders], headers)\n }\n }\n\n // 33. Let inputBody be input’s request’s body if input is a Request\n // object; otherwise null.\n const inputBody = input instanceof Request ? input[kState].body : null\n\n // 34. If either init[\"body\"] exists and is non-null or inputBody is\n // non-null, and request’s method is `GET` or `HEAD`, then throw a\n // TypeError.\n if (\n (init.body != null || inputBody != null) &&\n (request.method === 'GET' || request.method === 'HEAD')\n ) {\n throw new TypeError('Request with GET/HEAD method cannot have body.')\n }\n\n // 35. Let initBody be null.\n let initBody = null\n\n // 36. If init[\"body\"] exists and is non-null, then:\n if (init.body != null) {\n // 1. Let Content-Type be null.\n // 2. Set initBody and Content-Type to the result of extracting\n // init[\"body\"], with keepalive set to request’s keepalive.\n const [extractedBody, contentType] = extractBody(\n init.body,\n request.keepalive\n )\n initBody = extractedBody\n\n // 3, If Content-Type is non-null and this’s headers’s header list does\n // not contain `Content-Type`, then append `Content-Type`/Content-Type to\n // this’s headers.\n if (contentType && !getHeadersList(this[kHeaders]).contains('content-type', true)) {\n this[kHeaders].append('content-type', contentType)\n }\n }\n\n // 37. Let inputOrInitBody be initBody if it is non-null; otherwise\n // inputBody.\n const inputOrInitBody = initBody ?? inputBody\n\n // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is\n // null, then:\n if (inputOrInitBody != null && inputOrInitBody.source == null) {\n // 1. If initBody is non-null and init[\"duplex\"] does not exist,\n // then throw a TypeError.\n if (initBody != null && init.duplex == null) {\n throw new TypeError('RequestInit: duplex option is required when sending a body.')\n }\n\n // 2. If this’s request’s mode is neither \"same-origin\" nor \"cors\",\n // then throw a TypeError.\n if (request.mode !== 'same-origin' && request.mode !== 'cors') {\n throw new TypeError(\n 'If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"'\n )\n }\n\n // 3. Set this’s request’s use-CORS-preflight flag.\n request.useCORSPreflightFlag = true\n }\n\n // 39. Let finalBody be inputOrInitBody.\n let finalBody = inputOrInitBody\n\n // 40. If initBody is null and inputBody is non-null, then:\n if (initBody == null && inputBody != null) {\n // 1. If input is unusable, then throw a TypeError.\n if (bodyUnusable(input)) {\n throw new TypeError(\n 'Cannot construct a Request with a Request object that has already been used.'\n )\n }\n\n // 2. Set finalBody to the result of creating a proxy for inputBody.\n // https://streams.spec.whatwg.org/#readablestream-create-a-proxy\n const identityTransform = new TransformStream()\n inputBody.stream.pipeThrough(identityTransform)\n finalBody = {\n source: inputBody.source,\n length: inputBody.length,\n stream: identityTransform.readable\n }\n }\n\n // 41. Set this’s request’s body to finalBody.\n this[kState].body = finalBody\n }\n\n // Returns request’s HTTP method, which is \"GET\" by default.\n get method () {\n webidl.brandCheck(this, Request)\n\n // The method getter steps are to return this’s request’s method.\n return this[kState].method\n }\n\n // Returns the URL of request as a string.\n get url () {\n webidl.brandCheck(this, Request)\n\n // The url getter steps are to return this’s request’s URL, serialized.\n return URLSerializer(this[kState].url)\n }\n\n // Returns a Headers object consisting of the headers associated with request.\n // Note that headers added in the network layer by the user agent will not\n // be accounted for in this object, e.g., the \"Host\" header.\n get headers () {\n webidl.brandCheck(this, Request)\n\n // The headers getter steps are to return this’s headers.\n return this[kHeaders]\n }\n\n // Returns the kind of resource requested by request, e.g., \"document\"\n // or \"script\".\n get destination () {\n webidl.brandCheck(this, Request)\n\n // The destination getter are to return this’s request’s destination.\n return this[kState].destination\n }\n\n // Returns the referrer of request. Its value can be a same-origin URL if\n // explicitly set in init, the empty string to indicate no referrer, and\n // \"about:client\" when defaulting to the global’s default. This is used\n // during fetching to determine the value of the `Referer` header of the\n // request being made.\n get referrer () {\n webidl.brandCheck(this, Request)\n\n // 1. If this’s request’s referrer is \"no-referrer\", then return the\n // empty string.\n if (this[kState].referrer === 'no-referrer') {\n return ''\n }\n\n // 2. If this’s request’s referrer is \"client\", then return\n // \"about:client\".\n if (this[kState].referrer === 'client') {\n return 'about:client'\n }\n\n // Return this’s request’s referrer, serialized.\n return this[kState].referrer.toString()\n }\n\n // Returns the referrer policy associated with request.\n // This is used during fetching to compute the value of the request’s\n // referrer.\n get referrerPolicy () {\n webidl.brandCheck(this, Request)\n\n // The referrerPolicy getter steps are to return this’s request’s referrer policy.\n return this[kState].referrerPolicy\n }\n\n // Returns the mode associated with request, which is a string indicating\n // whether the request will use CORS, or will be restricted to same-origin\n // URLs.\n get mode () {\n webidl.brandCheck(this, Request)\n\n // The mode getter steps are to return this’s request’s mode.\n return this[kState].mode\n }\n\n // Returns the credentials mode associated with request,\n // which is a string indicating whether credentials will be sent with the\n // request always, never, or only when sent to a same-origin URL.\n get credentials () {\n // The credentials getter steps are to return this’s request’s credentials mode.\n return this[kState].credentials\n }\n\n // Returns the cache mode associated with request,\n // which is a string indicating how the request will\n // interact with the browser’s cache when fetching.\n get cache () {\n webidl.brandCheck(this, Request)\n\n // The cache getter steps are to return this’s request’s cache mode.\n return this[kState].cache\n }\n\n // Returns the redirect mode associated with request,\n // which is a string indicating how redirects for the\n // request will be handled during fetching. A request\n // will follow redirects by default.\n get redirect () {\n webidl.brandCheck(this, Request)\n\n // The redirect getter steps are to return this’s request’s redirect mode.\n return this[kState].redirect\n }\n\n // Returns request’s subresource integrity metadata, which is a\n // cryptographic hash of the resource being fetched. Its value\n // consists of multiple hashes separated by whitespace. [SRI]\n get integrity () {\n webidl.brandCheck(this, Request)\n\n // The integrity getter steps are to return this’s request’s integrity\n // metadata.\n return this[kState].integrity\n }\n\n // Returns a boolean indicating whether or not request can outlive the\n // global in which it was created.\n get keepalive () {\n webidl.brandCheck(this, Request)\n\n // The keepalive getter steps are to return this’s request’s keepalive.\n return this[kState].keepalive\n }\n\n // Returns a boolean indicating whether or not request is for a reload\n // navigation.\n get isReloadNavigation () {\n webidl.brandCheck(this, Request)\n\n // The isReloadNavigation getter steps are to return true if this’s\n // request’s reload-navigation flag is set; otherwise false.\n return this[kState].reloadNavigation\n }\n\n // Returns a boolean indicating whether or not request is for a history\n // navigation (a.k.a. back-forward navigation).\n get isHistoryNavigation () {\n webidl.brandCheck(this, Request)\n\n // The isHistoryNavigation getter steps are to return true if this’s request’s\n // history-navigation flag is set; otherwise false.\n return this[kState].historyNavigation\n }\n\n // Returns the signal associated with request, which is an AbortSignal\n // object indicating whether or not request has been aborted, and its\n // abort event handler.\n get signal () {\n webidl.brandCheck(this, Request)\n\n // The signal getter steps are to return this’s signal.\n return this[kSignal]\n }\n\n get body () {\n webidl.brandCheck(this, Request)\n\n return this[kState].body ? this[kState].body.stream : null\n }\n\n get bodyUsed () {\n webidl.brandCheck(this, Request)\n\n return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n }\n\n get duplex () {\n webidl.brandCheck(this, Request)\n\n return 'half'\n }\n\n // Returns a clone of request.\n clone () {\n webidl.brandCheck(this, Request)\n\n // 1. If this is unusable, then throw a TypeError.\n if (bodyUnusable(this)) {\n throw new TypeError('unusable')\n }\n\n // 2. Let clonedRequest be the result of cloning this’s request.\n const clonedRequest = cloneRequest(this[kState])\n\n // 3. Let clonedRequestObject be the result of creating a Request object,\n // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.\n // 4. Make clonedRequestObject’s signal follow this’s signal.\n const ac = new AbortController()\n if (this.signal.aborted) {\n ac.abort(this.signal.reason)\n } else {\n let list = dependentControllerMap.get(this.signal)\n if (list === undefined) {\n list = new Set()\n dependentControllerMap.set(this.signal, list)\n }\n const acRef = new WeakRef(ac)\n list.add(acRef)\n util.addAbortListener(\n ac.signal,\n buildAbort(acRef)\n )\n }\n\n // 4. Return clonedRequestObject.\n return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders]))\n }\n\n [nodeUtil.inspect.custom] (depth, options) {\n if (options.depth === null) {\n options.depth = 2\n }\n\n options.colors ??= true\n\n const properties = {\n method: this.method,\n url: this.url,\n headers: this.headers,\n destination: this.destination,\n referrer: this.referrer,\n referrerPolicy: this.referrerPolicy,\n mode: this.mode,\n credentials: this.credentials,\n cache: this.cache,\n redirect: this.redirect,\n integrity: this.integrity,\n keepalive: this.keepalive,\n isReloadNavigation: this.isReloadNavigation,\n isHistoryNavigation: this.isHistoryNavigation,\n signal: this.signal\n }\n\n return `Request ${nodeUtil.formatWithOptions(options, properties)}`\n }\n}\n\nmixinBody(Request)\n\n// https://fetch.spec.whatwg.org/#requests\nfunction makeRequest (init) {\n return {\n method: init.method ?? 'GET',\n localURLsOnly: init.localURLsOnly ?? false,\n unsafeRequest: init.unsafeRequest ?? false,\n body: init.body ?? null,\n client: init.client ?? null,\n reservedClient: init.reservedClient ?? null,\n replacesClientId: init.replacesClientId ?? '',\n window: init.window ?? 'client',\n keepalive: init.keepalive ?? false,\n serviceWorkers: init.serviceWorkers ?? 'all',\n initiator: init.initiator ?? '',\n destination: init.destination ?? '',\n priority: init.priority ?? null,\n origin: init.origin ?? 'client',\n policyContainer: init.policyContainer ?? 'client',\n referrer: init.referrer ?? 'client',\n referrerPolicy: init.referrerPolicy ?? '',\n mode: init.mode ?? 'no-cors',\n useCORSPreflightFlag: init.useCORSPreflightFlag ?? false,\n credentials: init.credentials ?? 'same-origin',\n useCredentials: init.useCredentials ?? false,\n cache: init.cache ?? 'default',\n redirect: init.redirect ?? 'follow',\n integrity: init.integrity ?? '',\n cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? '',\n parserMetadata: init.parserMetadata ?? '',\n reloadNavigation: init.reloadNavigation ?? false,\n historyNavigation: init.historyNavigation ?? false,\n userActivation: init.userActivation ?? false,\n taintedOrigin: init.taintedOrigin ?? false,\n redirectCount: init.redirectCount ?? 0,\n responseTainting: init.responseTainting ?? 'basic',\n preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false,\n done: init.done ?? false,\n timingAllowFailed: init.timingAllowFailed ?? false,\n urlList: init.urlList,\n url: init.urlList[0],\n headersList: init.headersList\n ? new HeadersList(init.headersList)\n : new HeadersList()\n }\n}\n\n// https://fetch.spec.whatwg.org/#concept-request-clone\nfunction cloneRequest (request) {\n // To clone a request request, run these steps:\n\n // 1. Let newRequest be a copy of request, except for its body.\n const newRequest = makeRequest({ ...request, body: null })\n\n // 2. If request’s body is non-null, set newRequest’s body to the\n // result of cloning request’s body.\n if (request.body != null) {\n newRequest.body = cloneBody(newRequest, request.body)\n }\n\n // 3. Return newRequest.\n return newRequest\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-create\n * @param {any} innerRequest\n * @param {AbortSignal} signal\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Request}\n */\nfunction fromInnerRequest (innerRequest, signal, guard) {\n const request = new Request(kConstruct)\n request[kState] = innerRequest\n request[kSignal] = signal\n request[kHeaders] = new Headers(kConstruct)\n setHeadersList(request[kHeaders], innerRequest.headersList)\n setHeadersGuard(request[kHeaders], guard)\n return request\n}\n\nObject.defineProperties(Request.prototype, {\n method: kEnumerableProperty,\n url: kEnumerableProperty,\n headers: kEnumerableProperty,\n redirect: kEnumerableProperty,\n clone: kEnumerableProperty,\n signal: kEnumerableProperty,\n duplex: kEnumerableProperty,\n destination: kEnumerableProperty,\n body: kEnumerableProperty,\n bodyUsed: kEnumerableProperty,\n isHistoryNavigation: kEnumerableProperty,\n isReloadNavigation: kEnumerableProperty,\n keepalive: kEnumerableProperty,\n integrity: kEnumerableProperty,\n cache: kEnumerableProperty,\n credentials: kEnumerableProperty,\n attribute: kEnumerableProperty,\n referrerPolicy: kEnumerableProperty,\n referrer: kEnumerableProperty,\n mode: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Request',\n configurable: true\n }\n})\n\nwebidl.converters.Request = webidl.interfaceConverter(\n Request\n)\n\n// https://fetch.spec.whatwg.org/#requestinfo\nwebidl.converters.RequestInfo = function (V, prefix, argument) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V, prefix, argument)\n }\n\n if (V instanceof Request) {\n return webidl.converters.Request(V, prefix, argument)\n }\n\n return webidl.converters.USVString(V, prefix, argument)\n}\n\nwebidl.converters.AbortSignal = webidl.interfaceConverter(\n AbortSignal\n)\n\n// https://fetch.spec.whatwg.org/#requestinit\nwebidl.converters.RequestInit = webidl.dictionaryConverter([\n {\n key: 'method',\n converter: webidl.converters.ByteString\n },\n {\n key: 'headers',\n converter: webidl.converters.HeadersInit\n },\n {\n key: 'body',\n converter: webidl.nullableConverter(\n webidl.converters.BodyInit\n )\n },\n {\n key: 'referrer',\n converter: webidl.converters.USVString\n },\n {\n key: 'referrerPolicy',\n converter: webidl.converters.DOMString,\n // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n allowedValues: referrerPolicy\n },\n {\n key: 'mode',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#concept-request-mode\n allowedValues: requestMode\n },\n {\n key: 'credentials',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestcredentials\n allowedValues: requestCredentials\n },\n {\n key: 'cache',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestcache\n allowedValues: requestCache\n },\n {\n key: 'redirect',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestredirect\n allowedValues: requestRedirect\n },\n {\n key: 'integrity',\n converter: webidl.converters.DOMString\n },\n {\n key: 'keepalive',\n converter: webidl.converters.boolean\n },\n {\n key: 'signal',\n converter: webidl.nullableConverter(\n (signal) => webidl.converters.AbortSignal(\n signal,\n 'RequestInit',\n 'signal',\n { strict: false }\n )\n )\n },\n {\n key: 'window',\n converter: webidl.converters.any\n },\n {\n key: 'duplex',\n converter: webidl.converters.DOMString,\n allowedValues: requestDuplex\n },\n {\n key: 'dispatcher', // undici specific option\n converter: webidl.converters.any\n }\n])\n\nmodule.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }\n","'use strict'\n\nconst { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require('./headers')\nconst { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require('./body')\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst { kEnumerableProperty } = util\nconst {\n isValidReasonPhrase,\n isCancelled,\n isAborted,\n isBlobLike,\n serializeJavascriptValueToJSONString,\n isErrorLike,\n isomorphicEncode,\n environmentSettingsObject: relevantRealm\n} = require('./util')\nconst {\n redirectStatusSet,\n nullBodyStatus\n} = require('./constants')\nconst { kState, kHeaders } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { FormData } = require('./formdata')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { types } = require('node:util')\n\nconst textEncoder = new TextEncoder('utf-8')\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response {\n // Creates network error Response.\n static error () {\n // The static error() method steps are to return the result of creating a\n // Response object, given a new network error, \"immutable\", and this’s\n // relevant Realm.\n const responseObject = fromInnerResponse(makeNetworkError(), 'immutable')\n\n return responseObject\n }\n\n // https://fetch.spec.whatwg.org/#dom-response-json\n static json (data, init = {}) {\n webidl.argumentLengthCheck(arguments, 1, 'Response.json')\n\n if (init !== null) {\n init = webidl.converters.ResponseInit(init)\n }\n\n // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.\n const bytes = textEncoder.encode(\n serializeJavascriptValueToJSONString(data)\n )\n\n // 2. Let body be the result of extracting bytes.\n const body = extractBody(bytes)\n\n // 3. Let responseObject be the result of creating a Response object, given a new response,\n // \"response\", and this’s relevant Realm.\n const responseObject = fromInnerResponse(makeResponse({}), 'response')\n\n // 4. Perform initialize a response given responseObject, init, and (body, \"application/json\").\n initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })\n\n // 5. Return responseObject.\n return responseObject\n }\n\n // Creates a redirect Response that redirects to url with status status.\n static redirect (url, status = 302) {\n webidl.argumentLengthCheck(arguments, 1, 'Response.redirect')\n\n url = webidl.converters.USVString(url)\n status = webidl.converters['unsigned short'](status)\n\n // 1. Let parsedURL be the result of parsing url with current settings\n // object’s API base URL.\n // 2. If parsedURL is failure, then throw a TypeError.\n // TODO: base-URL?\n let parsedURL\n try {\n parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl)\n } catch (err) {\n throw new TypeError(`Failed to parse URL from ${url}`, { cause: err })\n }\n\n // 3. If status is not a redirect status, then throw a RangeError.\n if (!redirectStatusSet.has(status)) {\n throw new RangeError(`Invalid status code ${status}`)\n }\n\n // 4. Let responseObject be the result of creating a Response object,\n // given a new response, \"immutable\", and this’s relevant Realm.\n const responseObject = fromInnerResponse(makeResponse({}), 'immutable')\n\n // 5. Set responseObject’s response’s status to status.\n responseObject[kState].status = status\n\n // 6. Let value be parsedURL, serialized and isomorphic encoded.\n const value = isomorphicEncode(URLSerializer(parsedURL))\n\n // 7. Append `Location`/value to responseObject’s response’s header list.\n responseObject[kState].headersList.append('location', value, true)\n\n // 8. Return responseObject.\n return responseObject\n }\n\n // https://fetch.spec.whatwg.org/#dom-response\n constructor (body = null, init = {}) {\n webidl.util.markAsUncloneable(this)\n if (body === kConstruct) {\n return\n }\n\n if (body !== null) {\n body = webidl.converters.BodyInit(body)\n }\n\n init = webidl.converters.ResponseInit(init)\n\n // 1. Set this’s response to a new response.\n this[kState] = makeResponse({})\n\n // 2. Set this’s headers to a new Headers object with this’s relevant\n // Realm, whose header list is this’s response’s header list and guard\n // is \"response\".\n this[kHeaders] = new Headers(kConstruct)\n setHeadersGuard(this[kHeaders], 'response')\n setHeadersList(this[kHeaders], this[kState].headersList)\n\n // 3. Let bodyWithType be null.\n let bodyWithType = null\n\n // 4. If body is non-null, then set bodyWithType to the result of extracting body.\n if (body != null) {\n const [extractedBody, type] = extractBody(body)\n bodyWithType = { body: extractedBody, type }\n }\n\n // 5. Perform initialize a response given this, init, and bodyWithType.\n initializeResponse(this, init, bodyWithType)\n }\n\n // Returns response’s type, e.g., \"cors\".\n get type () {\n webidl.brandCheck(this, Response)\n\n // The type getter steps are to return this’s response’s type.\n return this[kState].type\n }\n\n // Returns response’s URL, if it has one; otherwise the empty string.\n get url () {\n webidl.brandCheck(this, Response)\n\n const urlList = this[kState].urlList\n\n // The url getter steps are to return the empty string if this’s\n // response’s URL is null; otherwise this’s response’s URL,\n // serialized with exclude fragment set to true.\n const url = urlList[urlList.length - 1] ?? null\n\n if (url === null) {\n return ''\n }\n\n return URLSerializer(url, true)\n }\n\n // Returns whether response was obtained through a redirect.\n get redirected () {\n webidl.brandCheck(this, Response)\n\n // The redirected getter steps are to return true if this’s response’s URL\n // list has more than one item; otherwise false.\n return this[kState].urlList.length > 1\n }\n\n // Returns response’s status.\n get status () {\n webidl.brandCheck(this, Response)\n\n // The status getter steps are to return this’s response’s status.\n return this[kState].status\n }\n\n // Returns whether response’s status is an ok status.\n get ok () {\n webidl.brandCheck(this, Response)\n\n // The ok getter steps are to return true if this’s response’s status is an\n // ok status; otherwise false.\n return this[kState].status >= 200 && this[kState].status <= 299\n }\n\n // Returns response’s status message.\n get statusText () {\n webidl.brandCheck(this, Response)\n\n // The statusText getter steps are to return this’s response’s status\n // message.\n return this[kState].statusText\n }\n\n // Returns response’s headers as Headers.\n get headers () {\n webidl.brandCheck(this, Response)\n\n // The headers getter steps are to return this’s headers.\n return this[kHeaders]\n }\n\n get body () {\n webidl.brandCheck(this, Response)\n\n return this[kState].body ? this[kState].body.stream : null\n }\n\n get bodyUsed () {\n webidl.brandCheck(this, Response)\n\n return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n }\n\n // Returns a clone of response.\n clone () {\n webidl.brandCheck(this, Response)\n\n // 1. If this is unusable, then throw a TypeError.\n if (bodyUnusable(this)) {\n throw webidl.errors.exception({\n header: 'Response.clone',\n message: 'Body has already been consumed.'\n })\n }\n\n // 2. Let clonedResponse be the result of cloning this’s response.\n const clonedResponse = cloneResponse(this[kState])\n\n // Note: To re-register because of a new stream.\n if (hasFinalizationRegistry && this[kState].body?.stream) {\n streamRegistry.register(this, new WeakRef(this[kState].body.stream))\n }\n\n // 3. Return the result of creating a Response object, given\n // clonedResponse, this’s headers’s guard, and this’s relevant Realm.\n return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders]))\n }\n\n [nodeUtil.inspect.custom] (depth, options) {\n if (options.depth === null) {\n options.depth = 2\n }\n\n options.colors ??= true\n\n const properties = {\n status: this.status,\n statusText: this.statusText,\n headers: this.headers,\n body: this.body,\n bodyUsed: this.bodyUsed,\n ok: this.ok,\n redirected: this.redirected,\n type: this.type,\n url: this.url\n }\n\n return `Response ${nodeUtil.formatWithOptions(options, properties)}`\n }\n}\n\nmixinBody(Response)\n\nObject.defineProperties(Response.prototype, {\n type: kEnumerableProperty,\n url: kEnumerableProperty,\n status: kEnumerableProperty,\n ok: kEnumerableProperty,\n redirected: kEnumerableProperty,\n statusText: kEnumerableProperty,\n headers: kEnumerableProperty,\n clone: kEnumerableProperty,\n body: kEnumerableProperty,\n bodyUsed: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Response',\n configurable: true\n }\n})\n\nObject.defineProperties(Response, {\n json: kEnumerableProperty,\n redirect: kEnumerableProperty,\n error: kEnumerableProperty\n})\n\n// https://fetch.spec.whatwg.org/#concept-response-clone\nfunction cloneResponse (response) {\n // To clone a response response, run these steps:\n\n // 1. If response is a filtered response, then return a new identical\n // filtered response whose internal response is a clone of response’s\n // internal response.\n if (response.internalResponse) {\n return filterResponse(\n cloneResponse(response.internalResponse),\n response.type\n )\n }\n\n // 2. Let newResponse be a copy of response, except for its body.\n const newResponse = makeResponse({ ...response, body: null })\n\n // 3. If response’s body is non-null, then set newResponse’s body to the\n // result of cloning response’s body.\n if (response.body != null) {\n newResponse.body = cloneBody(newResponse, response.body)\n }\n\n // 4. Return newResponse.\n return newResponse\n}\n\nfunction makeResponse (init) {\n return {\n aborted: false,\n rangeRequested: false,\n timingAllowPassed: false,\n requestIncludesCredentials: false,\n type: 'default',\n status: 200,\n timingInfo: null,\n cacheState: '',\n statusText: '',\n ...init,\n headersList: init?.headersList\n ? new HeadersList(init?.headersList)\n : new HeadersList(),\n urlList: init?.urlList ? [...init.urlList] : []\n }\n}\n\nfunction makeNetworkError (reason) {\n const isError = isErrorLike(reason)\n return makeResponse({\n type: 'error',\n status: 0,\n error: isError\n ? reason\n : new Error(reason ? String(reason) : reason),\n aborted: reason && reason.name === 'AbortError'\n })\n}\n\n// @see https://fetch.spec.whatwg.org/#concept-network-error\nfunction isNetworkError (response) {\n return (\n // A network error is a response whose type is \"error\",\n response.type === 'error' &&\n // status is 0\n response.status === 0\n )\n}\n\nfunction makeFilteredResponse (response, state) {\n state = {\n internalResponse: response,\n ...state\n }\n\n return new Proxy(response, {\n get (target, p) {\n return p in state ? state[p] : target[p]\n },\n set (target, p, value) {\n assert(!(p in state))\n target[p] = value\n return true\n }\n })\n}\n\n// https://fetch.spec.whatwg.org/#concept-filtered-response\nfunction filterResponse (response, type) {\n // Set response to the following filtered response with response as its\n // internal response, depending on request’s response tainting:\n if (type === 'basic') {\n // A basic filtered response is a filtered response whose type is \"basic\"\n // and header list excludes any headers in internal response’s header list\n // whose name is a forbidden response-header name.\n\n // Note: undici does not implement forbidden response-header names\n return makeFilteredResponse(response, {\n type: 'basic',\n headersList: response.headersList\n })\n } else if (type === 'cors') {\n // A CORS filtered response is a filtered response whose type is \"cors\"\n // and header list excludes any headers in internal response’s header\n // list whose name is not a CORS-safelisted response-header name, given\n // internal response’s CORS-exposed header-name list.\n\n // Note: undici does not implement CORS-safelisted response-header names\n return makeFilteredResponse(response, {\n type: 'cors',\n headersList: response.headersList\n })\n } else if (type === 'opaque') {\n // An opaque filtered response is a filtered response whose type is\n // \"opaque\", URL list is the empty list, status is 0, status message\n // is the empty byte sequence, header list is empty, and body is null.\n\n return makeFilteredResponse(response, {\n type: 'opaque',\n urlList: Object.freeze([]),\n status: 0,\n statusText: '',\n body: null\n })\n } else if (type === 'opaqueredirect') {\n // An opaque-redirect filtered response is a filtered response whose type\n // is \"opaqueredirect\", status is 0, status message is the empty byte\n // sequence, header list is empty, and body is null.\n\n return makeFilteredResponse(response, {\n type: 'opaqueredirect',\n status: 0,\n statusText: '',\n headersList: [],\n body: null\n })\n } else {\n assert(false)\n }\n}\n\n// https://fetch.spec.whatwg.org/#appropriate-network-error\nfunction makeAppropriateNetworkError (fetchParams, err = null) {\n // 1. Assert: fetchParams is canceled.\n assert(isCancelled(fetchParams))\n\n // 2. Return an aborted network error if fetchParams is aborted;\n // otherwise return a network error.\n return isAborted(fetchParams)\n ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))\n : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))\n}\n\n// https://whatpr.org/fetch/1392.html#initialize-a-response\nfunction initializeResponse (response, init, body) {\n // 1. If init[\"status\"] is not in the range 200 to 599, inclusive, then\n // throw a RangeError.\n if (init.status !== null && (init.status < 200 || init.status > 599)) {\n throw new RangeError('init[\"status\"] must be in the range of 200 to 599, inclusive.')\n }\n\n // 2. If init[\"statusText\"] does not match the reason-phrase token production,\n // then throw a TypeError.\n if ('statusText' in init && init.statusText != null) {\n // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:\n // reason-phrase = *( HTAB / SP / VCHAR / obs-text )\n if (!isValidReasonPhrase(String(init.statusText))) {\n throw new TypeError('Invalid statusText')\n }\n }\n\n // 3. Set response’s response’s status to init[\"status\"].\n if ('status' in init && init.status != null) {\n response[kState].status = init.status\n }\n\n // 4. Set response’s response’s status message to init[\"statusText\"].\n if ('statusText' in init && init.statusText != null) {\n response[kState].statusText = init.statusText\n }\n\n // 5. If init[\"headers\"] exists, then fill response’s headers with init[\"headers\"].\n if ('headers' in init && init.headers != null) {\n fill(response[kHeaders], init.headers)\n }\n\n // 6. If body was given, then:\n if (body) {\n // 1. If response's status is a null body status, then throw a TypeError.\n if (nullBodyStatus.includes(response.status)) {\n throw webidl.errors.exception({\n header: 'Response constructor',\n message: `Invalid response status code ${response.status}`\n })\n }\n\n // 2. Set response's body to body's body.\n response[kState].body = body.body\n\n // 3. If body's type is non-null and response's header list does not contain\n // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.\n if (body.type != null && !response[kState].headersList.contains('content-type', true)) {\n response[kState].headersList.append('content-type', body.type, true)\n }\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#response-create\n * @param {any} innerResponse\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Response}\n */\nfunction fromInnerResponse (innerResponse, guard) {\n const response = new Response(kConstruct)\n response[kState] = innerResponse\n response[kHeaders] = new Headers(kConstruct)\n setHeadersList(response[kHeaders], innerResponse.headersList)\n setHeadersGuard(response[kHeaders], guard)\n\n if (hasFinalizationRegistry && innerResponse.body?.stream) {\n // If the target (response) is reclaimed, the cleanup callback may be called at some point with\n // the held value provided for it (innerResponse.body.stream). The held value can be any value:\n // a primitive or an object, even undefined. If the held value is an object, the registry keeps\n // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n streamRegistry.register(response, new WeakRef(innerResponse.body.stream))\n }\n\n return response\n}\n\nwebidl.converters.ReadableStream = webidl.interfaceConverter(\n ReadableStream\n)\n\nwebidl.converters.FormData = webidl.interfaceConverter(\n FormData\n)\n\nwebidl.converters.URLSearchParams = webidl.interfaceConverter(\n URLSearchParams\n)\n\n// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit\nwebidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V, prefix, name)\n }\n\n if (isBlobLike(V)) {\n return webidl.converters.Blob(V, prefix, name, { strict: false })\n }\n\n if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n return webidl.converters.BufferSource(V, prefix, name)\n }\n\n if (util.isFormDataLike(V)) {\n return webidl.converters.FormData(V, prefix, name, { strict: false })\n }\n\n if (V instanceof URLSearchParams) {\n return webidl.converters.URLSearchParams(V, prefix, name)\n }\n\n return webidl.converters.DOMString(V, prefix, name)\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit\nwebidl.converters.BodyInit = function (V, prefix, argument) {\n if (V instanceof ReadableStream) {\n return webidl.converters.ReadableStream(V, prefix, argument)\n }\n\n // Note: the spec doesn't include async iterables,\n // this is an undici extension.\n if (V?.[Symbol.asyncIterator]) {\n return V\n }\n\n return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument)\n}\n\nwebidl.converters.ResponseInit = webidl.dictionaryConverter([\n {\n key: 'status',\n converter: webidl.converters['unsigned short'],\n defaultValue: () => 200\n },\n {\n key: 'statusText',\n converter: webidl.converters.ByteString,\n defaultValue: () => ''\n },\n {\n key: 'headers',\n converter: webidl.converters.HeadersInit\n }\n])\n\nmodule.exports = {\n isNetworkError,\n makeNetworkError,\n makeResponse,\n makeAppropriateNetworkError,\n filterResponse,\n Response,\n cloneResponse,\n fromInnerResponse\n}\n","'use strict'\n\nmodule.exports = {\n kUrl: Symbol('url'),\n kHeaders: Symbol('headers'),\n kSignal: Symbol('signal'),\n kState: Symbol('state'),\n kDispatcher: Symbol('dispatcher')\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst zlib = require('node:zlib')\nconst { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants')\nconst { getGlobalOrigin } = require('./global')\nconst { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require('./data-url')\nconst { performance } = require('node:perf_hooks')\nconst { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require('../../core/util')\nconst assert = require('node:assert')\nconst { isUint8Array } = require('node:util/types')\nconst { webidl } = require('./webidl')\n\nlet supportedHashes = []\n\n// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable\n/** @type {import('crypto')} */\nlet crypto\ntry {\n crypto = require('node:crypto')\n const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']\n supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))\n/* c8 ignore next 3 */\n} catch {\n\n}\n\nfunction responseURL (response) {\n // https://fetch.spec.whatwg.org/#responses\n // A response has an associated URL. It is a pointer to the last URL\n // in response’s URL list and null if response’s URL list is empty.\n const urlList = response.urlList\n const length = urlList.length\n return length === 0 ? null : urlList[length - 1].toString()\n}\n\n// https://fetch.spec.whatwg.org/#concept-response-location-url\nfunction responseLocationURL (response, requestFragment) {\n // 1. If response’s status is not a redirect status, then return null.\n if (!redirectStatusSet.has(response.status)) {\n return null\n }\n\n // 2. Let location be the result of extracting header list values given\n // `Location` and response’s header list.\n let location = response.headersList.get('location', true)\n\n // 3. If location is a header value, then set location to the result of\n // parsing location with response’s URL.\n if (location !== null && isValidHeaderValue(location)) {\n if (!isValidEncodedURL(location)) {\n // Some websites respond location header in UTF-8 form without encoding them as ASCII\n // and major browsers redirect them to correctly UTF-8 encoded addresses.\n // Here, we handle that behavior in the same way.\n location = normalizeBinaryStringToUtf8(location)\n }\n location = new URL(location, responseURL(response))\n }\n\n // 4. If location is a URL whose fragment is null, then set location’s\n // fragment to requestFragment.\n if (location && !location.hash) {\n location.hash = requestFragment\n }\n\n // 5. Return location.\n return location\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2\n * @param {string} url\n * @returns {boolean}\n */\nfunction isValidEncodedURL (url) {\n for (let i = 0; i < url.length; ++i) {\n const code = url.charCodeAt(i)\n\n if (\n code > 0x7E || // Non-US-ASCII + DEL\n code < 0x20 // Control characters NUL - US\n ) {\n return false\n }\n }\n return true\n}\n\n/**\n * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it.\n * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well.\n * @param {string} value\n * @returns {string}\n */\nfunction normalizeBinaryStringToUtf8 (value) {\n return Buffer.from(value, 'binary').toString('utf8')\n}\n\n/** @returns {URL} */\nfunction requestCurrentURL (request) {\n return request.urlList[request.urlList.length - 1]\n}\n\nfunction requestBadPort (request) {\n // 1. Let url be request’s current URL.\n const url = requestCurrentURL(request)\n\n // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,\n // then return blocked.\n if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {\n return 'blocked'\n }\n\n // 3. Return allowed.\n return 'allowed'\n}\n\nfunction isErrorLike (object) {\n return object instanceof Error || (\n object?.constructor?.name === 'Error' ||\n object?.constructor?.name === 'DOMException'\n )\n}\n\n// Check whether |statusText| is a ByteString and\n// matches the Reason-Phrase token production.\n// RFC 2616: https://tools.ietf.org/html/rfc2616\n// RFC 7230: https://tools.ietf.org/html/rfc7230\n// \"reason-phrase = *( HTAB / SP / VCHAR / obs-text )\"\n// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116\nfunction isValidReasonPhrase (statusText) {\n for (let i = 0; i < statusText.length; ++i) {\n const c = statusText.charCodeAt(i)\n if (\n !(\n (\n c === 0x09 || // HTAB\n (c >= 0x20 && c <= 0x7e) || // SP / VCHAR\n (c >= 0x80 && c <= 0xff)\n ) // obs-text\n )\n ) {\n return false\n }\n }\n return true\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-name\n * @param {string} potentialValue\n */\nconst isValidHeaderName = isValidHTTPToken\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value\n * @param {string} potentialValue\n */\nfunction isValidHeaderValue (potentialValue) {\n // - Has no leading or trailing HTTP tab or space bytes.\n // - Contains no 0x00 (NUL) or HTTP newline bytes.\n return (\n potentialValue[0] === '\\t' ||\n potentialValue[0] === ' ' ||\n potentialValue[potentialValue.length - 1] === '\\t' ||\n potentialValue[potentialValue.length - 1] === ' ' ||\n potentialValue.includes('\\n') ||\n potentialValue.includes('\\r') ||\n potentialValue.includes('\\0')\n ) === false\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect\nfunction setRequestReferrerPolicyOnRedirect (request, actualResponse) {\n // Given a request request and a response actualResponse, this algorithm\n // updates request’s referrer policy according to the Referrer-Policy\n // header (if any) in actualResponse.\n\n // 1. Let policy be the result of executing § 8.1 Parse a referrer policy\n // from a Referrer-Policy header on actualResponse.\n\n // 8.1 Parse a referrer policy from a Referrer-Policy header\n // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.\n const { headersList } = actualResponse\n // 2. Let policy be the empty string.\n // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.\n // 4. Return policy.\n const policyHeader = (headersList.get('referrer-policy', true) ?? '').split(',')\n\n // Note: As the referrer-policy can contain multiple policies\n // separated by comma, we need to loop through all of them\n // and pick the first valid one.\n // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy\n let policy = ''\n if (policyHeader.length > 0) {\n // The right-most policy takes precedence.\n // The left-most policy is the fallback.\n for (let i = policyHeader.length; i !== 0; i--) {\n const token = policyHeader[i - 1].trim()\n if (referrerPolicyTokens.has(token)) {\n policy = token\n break\n }\n }\n }\n\n // 2. If policy is not the empty string, then set request’s referrer policy to policy.\n if (policy !== '') {\n request.referrerPolicy = policy\n }\n}\n\n// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check\nfunction crossOriginResourcePolicyCheck () {\n // TODO\n return 'allowed'\n}\n\n// https://fetch.spec.whatwg.org/#concept-cors-check\nfunction corsCheck () {\n // TODO\n return 'success'\n}\n\n// https://fetch.spec.whatwg.org/#concept-tao-check\nfunction TAOCheck () {\n // TODO\n return 'success'\n}\n\nfunction appendFetchMetadata (httpRequest) {\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header\n // TODO\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header\n\n // 1. Assert: r’s url is a potentially trustworthy URL.\n // TODO\n\n // 2. Let header be a Structured Header whose value is a token.\n let header = null\n\n // 3. Set header’s value to r’s mode.\n header = httpRequest.mode\n\n // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.\n httpRequest.headersList.set('sec-fetch-mode', header, true)\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header\n // TODO\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header\n // TODO\n}\n\n// https://fetch.spec.whatwg.org/#append-a-request-origin-header\nfunction appendRequestOriginHeader (request) {\n // 1. Let serializedOrigin be the result of byte-serializing a request origin\n // with request.\n // TODO: implement \"byte-serializing a request origin\"\n let serializedOrigin = request.origin\n\n // - \"'client' is changed to an origin during fetching.\"\n // This doesn't happen in undici (in most cases) because undici, by default,\n // has no concept of origin.\n // - request.origin can also be set to request.client.origin (client being\n // an environment settings object), which is undefined without using\n // setGlobalOrigin.\n if (serializedOrigin === 'client' || serializedOrigin === undefined) {\n return\n }\n\n // 2. If request’s response tainting is \"cors\" or request’s mode is \"websocket\",\n // then append (`Origin`, serializedOrigin) to request’s header list.\n // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:\n if (request.responseTainting === 'cors' || request.mode === 'websocket') {\n request.headersList.append('origin', serializedOrigin, true)\n } else if (request.method !== 'GET' && request.method !== 'HEAD') {\n // 1. Switch on request’s referrer policy:\n switch (request.referrerPolicy) {\n case 'no-referrer':\n // Set serializedOrigin to `null`.\n serializedOrigin = null\n break\n case 'no-referrer-when-downgrade':\n case 'strict-origin':\n case 'strict-origin-when-cross-origin':\n // If request’s origin is a tuple origin, its scheme is \"https\", and\n // request’s current URL’s scheme is not \"https\", then set\n // serializedOrigin to `null`.\n if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n serializedOrigin = null\n }\n break\n case 'same-origin':\n // If request’s origin is not same origin with request’s current URL’s\n // origin, then set serializedOrigin to `null`.\n if (!sameOrigin(request, requestCurrentURL(request))) {\n serializedOrigin = null\n }\n break\n default:\n // Do nothing.\n }\n\n // 2. Append (`Origin`, serializedOrigin) to request’s header list.\n request.headersList.append('origin', serializedOrigin, true)\n }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsen-time\nfunction coarsenTime (timestamp, crossOriginIsolatedCapability) {\n // TODO\n return timestamp\n}\n\n// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info\nfunction clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {\n if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {\n return {\n domainLookupStartTime: defaultStartTime,\n domainLookupEndTime: defaultStartTime,\n connectionStartTime: defaultStartTime,\n connectionEndTime: defaultStartTime,\n secureConnectionStartTime: defaultStartTime,\n ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol\n }\n }\n\n return {\n domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),\n domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),\n connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),\n connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),\n secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),\n ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol\n }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time\nfunction coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {\n return coarsenTime(performance.now(), crossOriginIsolatedCapability)\n}\n\n// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info\nfunction createOpaqueTimingInfo (timingInfo) {\n return {\n startTime: timingInfo.startTime ?? 0,\n redirectStartTime: 0,\n redirectEndTime: 0,\n postRedirectStartTime: timingInfo.startTime ?? 0,\n finalServiceWorkerStartTime: 0,\n finalNetworkResponseStartTime: 0,\n finalNetworkRequestStartTime: 0,\n endTime: 0,\n encodedBodySize: 0,\n decodedBodySize: 0,\n finalConnectionTimingInfo: null\n }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#policy-container\nfunction makePolicyContainer () {\n // Note: the fetch spec doesn't make use of embedder policy or CSP list\n return {\n referrerPolicy: 'strict-origin-when-cross-origin'\n }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container\nfunction clonePolicyContainer (policyContainer) {\n return {\n referrerPolicy: policyContainer.referrerPolicy\n }\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer\nfunction determineRequestsReferrer (request) {\n // 1. Let policy be request's referrer policy.\n const policy = request.referrerPolicy\n\n // Note: policy cannot (shouldn't) be null or an empty string.\n assert(policy)\n\n // 2. Let environment be request’s client.\n\n let referrerSource = null\n\n // 3. Switch on request’s referrer:\n if (request.referrer === 'client') {\n // Note: node isn't a browser and doesn't implement document/iframes,\n // so we bypass this step and replace it with our own.\n\n const globalOrigin = getGlobalOrigin()\n\n if (!globalOrigin || globalOrigin.origin === 'null') {\n return 'no-referrer'\n }\n\n // note: we need to clone it as it's mutated\n referrerSource = new URL(globalOrigin)\n } else if (request.referrer instanceof URL) {\n // Let referrerSource be request’s referrer.\n referrerSource = request.referrer\n }\n\n // 4. Let request’s referrerURL be the result of stripping referrerSource for\n // use as a referrer.\n let referrerURL = stripURLForReferrer(referrerSource)\n\n // 5. Let referrerOrigin be the result of stripping referrerSource for use as\n // a referrer, with the origin-only flag set to true.\n const referrerOrigin = stripURLForReferrer(referrerSource, true)\n\n // 6. If the result of serializing referrerURL is a string whose length is\n // greater than 4096, set referrerURL to referrerOrigin.\n if (referrerURL.toString().length > 4096) {\n referrerURL = referrerOrigin\n }\n\n const areSameOrigin = sameOrigin(request, referrerURL)\n const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&\n !isURLPotentiallyTrustworthy(request.url)\n\n // 8. Execute the switch statements corresponding to the value of policy:\n switch (policy) {\n case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)\n case 'unsafe-url': return referrerURL\n case 'same-origin':\n return areSameOrigin ? referrerOrigin : 'no-referrer'\n case 'origin-when-cross-origin':\n return areSameOrigin ? referrerURL : referrerOrigin\n case 'strict-origin-when-cross-origin': {\n const currentURL = requestCurrentURL(request)\n\n // 1. If the origin of referrerURL and the origin of request’s current\n // URL are the same, then return referrerURL.\n if (sameOrigin(referrerURL, currentURL)) {\n return referrerURL\n }\n\n // 2. If referrerURL is a potentially trustworthy URL and request’s\n // current URL is not a potentially trustworthy URL, then return no\n // referrer.\n if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n return 'no-referrer'\n }\n\n // 3. Return referrerOrigin.\n return referrerOrigin\n }\n case 'strict-origin': // eslint-disable-line\n /**\n * 1. If referrerURL is a potentially trustworthy URL and\n * request’s current URL is not a potentially trustworthy URL,\n * then return no referrer.\n * 2. Return referrerOrigin\n */\n case 'no-referrer-when-downgrade': // eslint-disable-line\n /**\n * 1. If referrerURL is a potentially trustworthy URL and\n * request’s current URL is not a potentially trustworthy URL,\n * then return no referrer.\n * 2. Return referrerOrigin\n */\n\n default: // eslint-disable-line\n return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin\n }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url\n * @param {URL} url\n * @param {boolean|undefined} originOnly\n */\nfunction stripURLForReferrer (url, originOnly) {\n // 1. Assert: url is a URL.\n assert(url instanceof URL)\n\n url = new URL(url)\n\n // 2. If url’s scheme is a local scheme, then return no referrer.\n if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {\n return 'no-referrer'\n }\n\n // 3. Set url’s username to the empty string.\n url.username = ''\n\n // 4. Set url’s password to the empty string.\n url.password = ''\n\n // 5. Set url’s fragment to null.\n url.hash = ''\n\n // 6. If the origin-only flag is true, then:\n if (originOnly) {\n // 1. Set url’s path to « the empty string ».\n url.pathname = ''\n\n // 2. Set url’s query to null.\n url.search = ''\n }\n\n // 7. Return url.\n return url\n}\n\nfunction isURLPotentiallyTrustworthy (url) {\n if (!(url instanceof URL)) {\n return false\n }\n\n // If child of about, return true\n if (url.href === 'about:blank' || url.href === 'about:srcdoc') {\n return true\n }\n\n // If scheme is data, return true\n if (url.protocol === 'data:') return true\n\n // If file, return true\n if (url.protocol === 'file:') return true\n\n return isOriginPotentiallyTrustworthy(url.origin)\n\n function isOriginPotentiallyTrustworthy (origin) {\n // If origin is explicitly null, return false\n if (origin == null || origin === 'null') return false\n\n const originAsURL = new URL(origin)\n\n // If secure, return true\n if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {\n return true\n }\n\n // If localhost or variants, return true\n if (/^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^\\[(?:0*:)*?:?0*1\\]$/.test(originAsURL.hostname) ||\n (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||\n (originAsURL.hostname.endsWith('.localhost'))) {\n return true\n }\n\n // If any other, return false\n return false\n }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist\n * @param {Uint8Array} bytes\n * @param {string} metadataList\n */\nfunction bytesMatch (bytes, metadataList) {\n // If node is not built with OpenSSL support, we cannot check\n // a request's integrity, so allow it by default (the spec will\n // allow requests if an invalid hash is given, as precedence).\n /* istanbul ignore if: only if node is built with --without-ssl */\n if (crypto === undefined) {\n return true\n }\n\n // 1. Let parsedMetadata be the result of parsing metadataList.\n const parsedMetadata = parseMetadata(metadataList)\n\n // 2. If parsedMetadata is no metadata, return true.\n if (parsedMetadata === 'no metadata') {\n return true\n }\n\n // 3. If response is not eligible for integrity validation, return false.\n // TODO\n\n // 4. If parsedMetadata is the empty set, return true.\n if (parsedMetadata.length === 0) {\n return true\n }\n\n // 5. Let metadata be the result of getting the strongest\n // metadata from parsedMetadata.\n const strongest = getStrongestMetadata(parsedMetadata)\n const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)\n\n // 6. For each item in metadata:\n for (const item of metadata) {\n // 1. Let algorithm be the alg component of item.\n const algorithm = item.algo\n\n // 2. Let expectedValue be the val component of item.\n const expectedValue = item.hash\n\n // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e\n // \"be liberal with padding\". This is annoying, and it's not even in the spec.\n\n // 3. Let actualValue be the result of applying algorithm to bytes.\n let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')\n\n if (actualValue[actualValue.length - 1] === '=') {\n if (actualValue[actualValue.length - 2] === '=') {\n actualValue = actualValue.slice(0, -2)\n } else {\n actualValue = actualValue.slice(0, -1)\n }\n }\n\n // 4. If actualValue is a case-sensitive match for expectedValue,\n // return true.\n if (compareBase64Mixed(actualValue, expectedValue)) {\n return true\n }\n }\n\n // 7. Return false.\n return false\n}\n\n// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options\n// https://www.w3.org/TR/CSP2/#source-list-syntax\n// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1\nconst parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\\s|$)( +[!-~]*)?)?/i\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata\n * @param {string} metadata\n */\nfunction parseMetadata (metadata) {\n // 1. Let result be the empty set.\n /** @type {{ algo: string, hash: string }[]} */\n const result = []\n\n // 2. Let empty be equal to true.\n let empty = true\n\n // 3. For each token returned by splitting metadata on spaces:\n for (const token of metadata.split(' ')) {\n // 1. Set empty to false.\n empty = false\n\n // 2. Parse token as a hash-with-options.\n const parsedToken = parseHashWithOptions.exec(token)\n\n // 3. If token does not parse, continue to the next token.\n if (\n parsedToken === null ||\n parsedToken.groups === undefined ||\n parsedToken.groups.algo === undefined\n ) {\n // Note: Chromium blocks the request at this point, but Firefox\n // gives a warning that an invalid integrity was given. The\n // correct behavior is to ignore these, and subsequently not\n // check the integrity of the resource.\n continue\n }\n\n // 4. Let algorithm be the hash-algo component of token.\n const algorithm = parsedToken.groups.algo.toLowerCase()\n\n // 5. If algorithm is a hash function recognized by the user\n // agent, add the parsed token to result.\n if (supportedHashes.includes(algorithm)) {\n result.push(parsedToken.groups)\n }\n }\n\n // 4. Return no metadata if empty is true, otherwise return result.\n if (empty === true) {\n return 'no metadata'\n }\n\n return result\n}\n\n/**\n * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList\n */\nfunction getStrongestMetadata (metadataList) {\n // Let algorithm be the algo component of the first item in metadataList.\n // Can be sha256\n let algorithm = metadataList[0].algo\n // If the algorithm is sha512, then it is the strongest\n // and we can return immediately\n if (algorithm[3] === '5') {\n return algorithm\n }\n\n for (let i = 1; i < metadataList.length; ++i) {\n const metadata = metadataList[i]\n // If the algorithm is sha512, then it is the strongest\n // and we can break the loop immediately\n if (metadata.algo[3] === '5') {\n algorithm = 'sha512'\n break\n // If the algorithm is sha384, then a potential sha256 or sha384 is ignored\n } else if (algorithm[3] === '3') {\n continue\n // algorithm is sha256, check if algorithm is sha384 and if so, set it as\n // the strongest\n } else if (metadata.algo[3] === '3') {\n algorithm = 'sha384'\n }\n }\n return algorithm\n}\n\nfunction filterMetadataListByAlgorithm (metadataList, algorithm) {\n if (metadataList.length === 1) {\n return metadataList\n }\n\n let pos = 0\n for (let i = 0; i < metadataList.length; ++i) {\n if (metadataList[i].algo === algorithm) {\n metadataList[pos++] = metadataList[i]\n }\n }\n\n metadataList.length = pos\n\n return metadataList\n}\n\n/**\n * Compares two base64 strings, allowing for base64url\n * in the second string.\n *\n* @param {string} actualValue always base64\n * @param {string} expectedValue base64 or base64url\n * @returns {boolean}\n */\nfunction compareBase64Mixed (actualValue, expectedValue) {\n if (actualValue.length !== expectedValue.length) {\n return false\n }\n for (let i = 0; i < actualValue.length; ++i) {\n if (actualValue[i] !== expectedValue[i]) {\n if (\n (actualValue[i] === '+' && expectedValue[i] === '-') ||\n (actualValue[i] === '/' && expectedValue[i] === '_')\n ) {\n continue\n }\n return false\n }\n }\n\n return true\n}\n\n// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request\nfunction tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {\n // TODO\n}\n\n/**\n * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}\n * @param {URL} A\n * @param {URL} B\n */\nfunction sameOrigin (A, B) {\n // 1. If A and B are the same opaque origin, then return true.\n if (A.origin === B.origin && A.origin === 'null') {\n return true\n }\n\n // 2. If A and B are both tuple origins and their schemes,\n // hosts, and port are identical, then return true.\n if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n return true\n }\n\n // 3. Return false.\n return false\n}\n\nfunction createDeferredPromise () {\n let res\n let rej\n const promise = new Promise((resolve, reject) => {\n res = resolve\n rej = reject\n })\n\n return { promise, resolve: res, reject: rej }\n}\n\nfunction isAborted (fetchParams) {\n return fetchParams.controller.state === 'aborted'\n}\n\nfunction isCancelled (fetchParams) {\n return fetchParams.controller.state === 'aborted' ||\n fetchParams.controller.state === 'terminated'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-method-normalize\n * @param {string} method\n */\nfunction normalizeMethod (method) {\n return normalizedMethodRecordsBase[method.toLowerCase()] ?? method\n}\n\n// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string\nfunction serializeJavascriptValueToJSONString (value) {\n // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).\n const result = JSON.stringify(value)\n\n // 2. If result is undefined, then throw a TypeError.\n if (result === undefined) {\n throw new TypeError('Value is not JSON serializable')\n }\n\n // 3. Assert: result is a string.\n assert(typeof result === 'string')\n\n // 4. Return result.\n return result\n}\n\n// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object\nconst esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n class FastIterableIterator {\n /** @type {any} */\n #target\n /** @type {'key' | 'value' | 'key+value'} */\n #kind\n /** @type {number} */\n #index\n\n /**\n * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object\n * @param {unknown} target\n * @param {'key' | 'value' | 'key+value'} kind\n */\n constructor (target, kind) {\n this.#target = target\n this.#kind = kind\n this.#index = 0\n }\n\n next () {\n // 1. Let interface be the interface for which the iterator prototype object exists.\n // 2. Let thisValue be the this value.\n // 3. Let object be ? ToObject(thisValue).\n // 4. If object is a platform object, then perform a security\n // check, passing:\n // 5. If object is not a default iterator object for interface,\n // then throw a TypeError.\n if (typeof this !== 'object' || this === null || !(#target in this)) {\n throw new TypeError(\n `'next' called on an object that does not implement interface ${name} Iterator.`\n )\n }\n\n // 6. Let index be object’s index.\n // 7. Let kind be object’s kind.\n // 8. Let values be object’s target's value pairs to iterate over.\n const index = this.#index\n const values = this.#target[kInternalIterator]\n\n // 9. Let len be the length of values.\n const len = values.length\n\n // 10. If index is greater than or equal to len, then return\n // CreateIterResultObject(undefined, true).\n if (index >= len) {\n return {\n value: undefined,\n done: true\n }\n }\n\n // 11. Let pair be the entry in values at index index.\n const { [keyIndex]: key, [valueIndex]: value } = values[index]\n\n // 12. Set object’s index to index + 1.\n this.#index = index + 1\n\n // 13. Return the iterator result for pair and kind.\n\n // https://webidl.spec.whatwg.org/#iterator-result\n\n // 1. Let result be a value determined by the value of kind:\n let result\n switch (this.#kind) {\n case 'key':\n // 1. Let idlKey be pair’s key.\n // 2. Let key be the result of converting idlKey to an\n // ECMAScript value.\n // 3. result is key.\n result = key\n break\n case 'value':\n // 1. Let idlValue be pair’s value.\n // 2. Let value be the result of converting idlValue to\n // an ECMAScript value.\n // 3. result is value.\n result = value\n break\n case 'key+value':\n // 1. Let idlKey be pair’s key.\n // 2. Let idlValue be pair’s value.\n // 3. Let key be the result of converting idlKey to an\n // ECMAScript value.\n // 4. Let value be the result of converting idlValue to\n // an ECMAScript value.\n // 5. Let array be ! ArrayCreate(2).\n // 6. Call ! CreateDataProperty(array, \"0\", key).\n // 7. Call ! CreateDataProperty(array, \"1\", value).\n // 8. result is array.\n result = [key, value]\n break\n }\n\n // 2. Return CreateIterResultObject(result, false).\n return {\n value: result,\n done: false\n }\n }\n }\n\n // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n // @ts-ignore\n delete FastIterableIterator.prototype.constructor\n\n Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype)\n\n Object.defineProperties(FastIterableIterator.prototype, {\n [Symbol.toStringTag]: {\n writable: false,\n enumerable: false,\n configurable: true,\n value: `${name} Iterator`\n },\n next: { writable: true, enumerable: true, configurable: true }\n })\n\n /**\n * @param {unknown} target\n * @param {'key' | 'value' | 'key+value'} kind\n * @returns {IterableIterator}\n */\n return function (target, kind) {\n return new FastIterableIterator(target, kind)\n }\n}\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {any} object class\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex)\n\n const properties = {\n keys: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function keys () {\n webidl.brandCheck(this, object)\n return makeIterator(this, 'key')\n }\n },\n values: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function values () {\n webidl.brandCheck(this, object)\n return makeIterator(this, 'value')\n }\n },\n entries: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function entries () {\n webidl.brandCheck(this, object)\n return makeIterator(this, 'key+value')\n }\n },\n forEach: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function forEach (callbackfn, thisArg = globalThis) {\n webidl.brandCheck(this, object)\n webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`)\n if (typeof callbackfn !== 'function') {\n throw new TypeError(\n `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`\n )\n }\n for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) {\n callbackfn.call(thisArg, value, key, this)\n }\n }\n }\n }\n\n return Object.defineProperties(object.prototype, {\n ...properties,\n [Symbol.iterator]: {\n writable: true,\n enumerable: false,\n configurable: true,\n value: properties.entries.value\n }\n })\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-fully-read\n */\nasync function fullyReadBody (body, processBody, processBodyError) {\n // 1. If taskDestination is null, then set taskDestination to\n // the result of starting a new parallel queue.\n\n // 2. Let successSteps given a byte sequence bytes be to queue a\n // fetch task to run processBody given bytes, with taskDestination.\n const successSteps = processBody\n\n // 3. Let errorSteps be to queue a fetch task to run processBodyError,\n // with taskDestination.\n const errorSteps = processBodyError\n\n // 4. Let reader be the result of getting a reader for body’s stream.\n // If that threw an exception, then run errorSteps with that\n // exception and return.\n let reader\n\n try {\n reader = body.stream.getReader()\n } catch (e) {\n errorSteps(e)\n return\n }\n\n // 5. Read all bytes from reader, given successSteps and errorSteps.\n try {\n successSteps(await readAllBytes(reader))\n } catch (e) {\n errorSteps(e)\n }\n}\n\nfunction isReadableStreamLike (stream) {\n return stream instanceof ReadableStream || (\n stream[Symbol.toStringTag] === 'ReadableStream' &&\n typeof stream.tee === 'function'\n )\n}\n\n/**\n * @param {ReadableStreamController} controller\n */\nfunction readableStreamClose (controller) {\n try {\n controller.close()\n controller.byobRequest?.respond(0)\n } catch (err) {\n // TODO: add comment explaining why this error occurs.\n if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {\n throw err\n }\n }\n}\n\nconst invalidIsomorphicEncodeValueRegex = /[^\\x00-\\xFF]/ // eslint-disable-line\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-encode\n * @param {string} input\n */\nfunction isomorphicEncode (input) {\n // 1. Assert: input contains no code points greater than U+00FF.\n assert(!invalidIsomorphicEncodeValueRegex.test(input))\n\n // 2. Return a byte sequence whose length is equal to input’s code\n // point length and whose bytes have the same values as the\n // values of input’s code points, in the same order\n return input\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes\n * @see https://streams.spec.whatwg.org/#read-loop\n * @param {ReadableStreamDefaultReader} reader\n */\nasync function readAllBytes (reader) {\n const bytes = []\n let byteLength = 0\n\n while (true) {\n const { done, value: chunk } = await reader.read()\n\n if (done) {\n // 1. Call successSteps with bytes.\n return Buffer.concat(bytes, byteLength)\n }\n\n // 1. If chunk is not a Uint8Array object, call failureSteps\n // with a TypeError and abort these steps.\n if (!isUint8Array(chunk)) {\n throw new TypeError('Received non-Uint8Array chunk')\n }\n\n // 2. Append the bytes represented by chunk to bytes.\n bytes.push(chunk)\n byteLength += chunk.length\n\n // 3. Read-loop given reader, bytes, successSteps, and failureSteps.\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#is-local\n * @param {URL} url\n */\nfunction urlIsLocal (url) {\n assert('protocol' in url) // ensure it's a url object\n\n const protocol = url.protocol\n\n return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'\n}\n\n/**\n * @param {string|URL} url\n * @returns {boolean}\n */\nfunction urlHasHttpsScheme (url) {\n return (\n (\n typeof url === 'string' &&\n url[5] === ':' &&\n url[0] === 'h' &&\n url[1] === 't' &&\n url[2] === 't' &&\n url[3] === 'p' &&\n url[4] === 's'\n ) ||\n url.protocol === 'https:'\n )\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-scheme\n * @param {URL} url\n */\nfunction urlIsHttpHttpsScheme (url) {\n assert('protocol' in url) // ensure it's a url object\n\n const protocol = url.protocol\n\n return protocol === 'http:' || protocol === 'https:'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#simple-range-header-value\n * @param {string} value\n * @param {boolean} allowWhitespace\n */\nfunction simpleRangeHeaderValue (value, allowWhitespace) {\n // 1. Let data be the isomorphic decoding of value.\n // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string,\n // nothing more. We obviously don't need to do that if value is a string already.\n const data = value\n\n // 2. If data does not start with \"bytes\", then return failure.\n if (!data.startsWith('bytes')) {\n return 'failure'\n }\n\n // 3. Let position be a position variable for data, initially pointing at the 5th code point of data.\n const position = { position: 5 }\n\n // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n // from data given position.\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 5. If the code point at position within data is not U+003D (=), then return failure.\n if (data.charCodeAt(position.position) !== 0x3D) {\n return 'failure'\n }\n\n // 6. Advance position by 1.\n position.position++\n\n // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from\n // data given position.\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits,\n // from data given position.\n const rangeStart = collectASequenceOfCodePoints(\n (char) => {\n const code = char.charCodeAt(0)\n\n return code >= 0x30 && code <= 0x39\n },\n data,\n position\n )\n\n // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the\n // empty string; otherwise null.\n const rangeStartValue = rangeStart.length ? Number(rangeStart) : null\n\n // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n // from data given position.\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 11. If the code point at position within data is not U+002D (-), then return failure.\n if (data.charCodeAt(position.position) !== 0x2D) {\n return 'failure'\n }\n\n // 12. Advance position by 1.\n position.position++\n\n // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab\n // or space, from data given position.\n // Note from Khafra: its the same step as in #8 again lol\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 14. Let rangeEnd be the result of collecting a sequence of code points that are\n // ASCII digits, from data given position.\n // Note from Khafra: you wouldn't guess it, but this is also the same step as #8\n const rangeEnd = collectASequenceOfCodePoints(\n (char) => {\n const code = char.charCodeAt(0)\n\n return code >= 0x30 && code <= 0x39\n },\n data,\n position\n )\n\n // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd\n // is not the empty string; otherwise null.\n // Note from Khafra: THE SAME STEP, AGAIN!!!\n // Note: why interpret as a decimal if we only collect ascii digits?\n const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null\n\n // 16. If position is not past the end of data, then return failure.\n if (position.position < data.length) {\n return 'failure'\n }\n\n // 17. If rangeEndValue and rangeStartValue are null, then return failure.\n if (rangeEndValue === null && rangeStartValue === null) {\n return 'failure'\n }\n\n // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is\n // greater than rangeEndValue, then return failure.\n // Note: ... when can they not be numbers?\n if (rangeStartValue > rangeEndValue) {\n return 'failure'\n }\n\n // 19. Return (rangeStartValue, rangeEndValue).\n return { rangeStartValue, rangeEndValue }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#build-a-content-range\n * @param {number} rangeStart\n * @param {number} rangeEnd\n * @param {number} fullLength\n */\nfunction buildContentRange (rangeStart, rangeEnd, fullLength) {\n // 1. Let contentRange be `bytes `.\n let contentRange = 'bytes '\n\n // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange.\n contentRange += isomorphicEncode(`${rangeStart}`)\n\n // 3. Append 0x2D (-) to contentRange.\n contentRange += '-'\n\n // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange.\n contentRange += isomorphicEncode(`${rangeEnd}`)\n\n // 5. Append 0x2F (/) to contentRange.\n contentRange += '/'\n\n // 6. Append fullLength, serialized and isomorphic encoded to contentRange.\n contentRange += isomorphicEncode(`${fullLength}`)\n\n // 7. Return contentRange.\n return contentRange\n}\n\n// A Stream, which pipes the response to zlib.createInflate() or\n// zlib.createInflateRaw() depending on the first byte of the Buffer.\n// If the lower byte of the first byte is 0x08, then the stream is\n// interpreted as a zlib stream, otherwise it's interpreted as a\n// raw deflate stream.\nclass InflateStream extends Transform {\n #zlibOptions\n\n /** @param {zlib.ZlibOptions} [zlibOptions] */\n constructor (zlibOptions) {\n super()\n this.#zlibOptions = zlibOptions\n }\n\n _transform (chunk, encoding, callback) {\n if (!this._inflateStream) {\n if (chunk.length === 0) {\n callback()\n return\n }\n this._inflateStream = (chunk[0] & 0x0F) === 0x08\n ? zlib.createInflate(this.#zlibOptions)\n : zlib.createInflateRaw(this.#zlibOptions)\n\n this._inflateStream.on('data', this.push.bind(this))\n this._inflateStream.on('end', () => this.push(null))\n this._inflateStream.on('error', (err) => this.destroy(err))\n }\n\n this._inflateStream.write(chunk, encoding, callback)\n }\n\n _final (callback) {\n if (this._inflateStream) {\n this._inflateStream.end()\n this._inflateStream = null\n }\n callback()\n }\n}\n\n/**\n * @param {zlib.ZlibOptions} [zlibOptions]\n * @returns {InflateStream}\n */\nfunction createInflate (zlibOptions) {\n return new InflateStream(zlibOptions)\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type\n * @param {import('./headers').HeadersList} headers\n */\nfunction extractMimeType (headers) {\n // 1. Let charset be null.\n let charset = null\n\n // 2. Let essence be null.\n let essence = null\n\n // 3. Let mimeType be null.\n let mimeType = null\n\n // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers.\n const values = getDecodeSplit('content-type', headers)\n\n // 5. If values is null, then return failure.\n if (values === null) {\n return 'failure'\n }\n\n // 6. For each value of values:\n for (const value of values) {\n // 6.1. Let temporaryMimeType be the result of parsing value.\n const temporaryMimeType = parseMIMEType(value)\n\n // 6.2. If temporaryMimeType is failure or its essence is \"*/*\", then continue.\n if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') {\n continue\n }\n\n // 6.3. Set mimeType to temporaryMimeType.\n mimeType = temporaryMimeType\n\n // 6.4. If mimeType’s essence is not essence, then:\n if (mimeType.essence !== essence) {\n // 6.4.1. Set charset to null.\n charset = null\n\n // 6.4.2. If mimeType’s parameters[\"charset\"] exists, then set charset to\n // mimeType’s parameters[\"charset\"].\n if (mimeType.parameters.has('charset')) {\n charset = mimeType.parameters.get('charset')\n }\n\n // 6.4.3. Set essence to mimeType’s essence.\n essence = mimeType.essence\n } else if (!mimeType.parameters.has('charset') && charset !== null) {\n // 6.5. Otherwise, if mimeType’s parameters[\"charset\"] does not exist, and\n // charset is non-null, set mimeType’s parameters[\"charset\"] to charset.\n mimeType.parameters.set('charset', charset)\n }\n }\n\n // 7. If mimeType is null, then return failure.\n if (mimeType == null) {\n return 'failure'\n }\n\n // 8. Return mimeType.\n return mimeType\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split\n * @param {string|null} value\n */\nfunction gettingDecodingSplitting (value) {\n // 1. Let input be the result of isomorphic decoding value.\n const input = value\n\n // 2. Let position be a position variable for input, initially pointing at the start of input.\n const position = { position: 0 }\n\n // 3. Let values be a list of strings, initially empty.\n const values = []\n\n // 4. Let temporaryValue be the empty string.\n let temporaryValue = ''\n\n // 5. While position is not past the end of input:\n while (position.position < input.length) {\n // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (\")\n // or U+002C (,) from input, given position, to temporaryValue.\n temporaryValue += collectASequenceOfCodePoints(\n (char) => char !== '\"' && char !== ',',\n input,\n position\n )\n\n // 5.2. If position is not past the end of input, then:\n if (position.position < input.length) {\n // 5.2.1. If the code point at position within input is U+0022 (\"), then:\n if (input.charCodeAt(position.position) === 0x22) {\n // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue.\n temporaryValue += collectAnHTTPQuotedString(\n input,\n position\n )\n\n // 5.2.1.2. If position is not past the end of input, then continue.\n if (position.position < input.length) {\n continue\n }\n } else {\n // 5.2.2. Otherwise:\n\n // 5.2.2.1. Assert: the code point at position within input is U+002C (,).\n assert(input.charCodeAt(position.position) === 0x2C)\n\n // 5.2.2.2. Advance position by 1.\n position.position++\n }\n }\n\n // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue.\n temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20)\n\n // 5.4. Append temporaryValue to values.\n values.push(temporaryValue)\n\n // 5.6. Set temporaryValue to the empty string.\n temporaryValue = ''\n }\n\n // 6. Return values.\n return values\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split\n * @param {string} name lowercase header name\n * @param {import('./headers').HeadersList} list\n */\nfunction getDecodeSplit (name, list) {\n // 1. Let value be the result of getting name from list.\n const value = list.get(name, true)\n\n // 2. If value is null, then return null.\n if (value === null) {\n return null\n }\n\n // 3. Return the result of getting, decoding, and splitting value.\n return gettingDecodingSplitting(value)\n}\n\nconst textDecoder = new TextDecoder()\n\n/**\n * @see https://encoding.spec.whatwg.org/#utf-8-decode\n * @param {Buffer} buffer\n */\nfunction utf8DecodeBytes (buffer) {\n if (buffer.length === 0) {\n return ''\n }\n\n // 1. Let buffer be the result of peeking three bytes from\n // ioQueue, converted to a byte sequence.\n\n // 2. If buffer is 0xEF 0xBB 0xBF, then read three\n // bytes from ioQueue. (Do nothing with those bytes.)\n if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {\n buffer = buffer.subarray(3)\n }\n\n // 3. Process a queue with an instance of UTF-8’s\n // decoder, ioQueue, output, and \"replacement\".\n const output = textDecoder.decode(buffer)\n\n // 4. Return output.\n return output\n}\n\nclass EnvironmentSettingsObjectBase {\n get baseUrl () {\n return getGlobalOrigin()\n }\n\n get origin () {\n return this.baseUrl?.origin\n }\n\n policyContainer = makePolicyContainer()\n}\n\nclass EnvironmentSettingsObject {\n settingsObject = new EnvironmentSettingsObjectBase()\n}\n\nconst environmentSettingsObject = new EnvironmentSettingsObject()\n\nmodule.exports = {\n isAborted,\n isCancelled,\n isValidEncodedURL,\n createDeferredPromise,\n ReadableStreamFrom,\n tryUpgradeRequestToAPotentiallyTrustworthyURL,\n clampAndCoarsenConnectionTimingInfo,\n coarsenedSharedCurrentTime,\n determineRequestsReferrer,\n makePolicyContainer,\n clonePolicyContainer,\n appendFetchMetadata,\n appendRequestOriginHeader,\n TAOCheck,\n corsCheck,\n crossOriginResourcePolicyCheck,\n createOpaqueTimingInfo,\n setRequestReferrerPolicyOnRedirect,\n isValidHTTPToken,\n requestBadPort,\n requestCurrentURL,\n responseURL,\n responseLocationURL,\n isBlobLike,\n isURLPotentiallyTrustworthy,\n isValidReasonPhrase,\n sameOrigin,\n normalizeMethod,\n serializeJavascriptValueToJSONString,\n iteratorMixin,\n createIterator,\n isValidHeaderName,\n isValidHeaderValue,\n isErrorLike,\n fullyReadBody,\n bytesMatch,\n isReadableStreamLike,\n readableStreamClose,\n isomorphicEncode,\n urlIsLocal,\n urlHasHttpsScheme,\n urlIsHttpHttpsScheme,\n readAllBytes,\n simpleRangeHeaderValue,\n buildContentRange,\n parseMetadata,\n createInflate,\n extractMimeType,\n getDecodeSplit,\n utf8DecodeBytes,\n environmentSettingsObject\n}\n","'use strict'\n\nconst { types, inspect } = require('node:util')\nconst { markAsUncloneable } = require('node:worker_threads')\nconst { toUSVString } = require('../../core/util')\n\n/** @type {import('../../../types/webidl').Webidl} */\nconst webidl = {}\nwebidl.converters = {}\nwebidl.util = {}\nwebidl.errors = {}\n\nwebidl.errors.exception = function (message) {\n return new TypeError(`${message.header}: ${message.message}`)\n}\n\nwebidl.errors.conversionFailed = function (context) {\n const plural = context.types.length === 1 ? '' : ' one of'\n const message =\n `${context.argument} could not be converted to` +\n `${plural}: ${context.types.join(', ')}.`\n\n return webidl.errors.exception({\n header: context.prefix,\n message\n })\n}\n\nwebidl.errors.invalidArgument = function (context) {\n return webidl.errors.exception({\n header: context.prefix,\n message: `\"${context.value}\" is an invalid ${context.type}.`\n })\n}\n\n// https://webidl.spec.whatwg.org/#implements\nwebidl.brandCheck = function (V, I, opts) {\n if (opts?.strict !== false) {\n if (!(V instanceof I)) {\n const err = new TypeError('Illegal invocation')\n err.code = 'ERR_INVALID_THIS' // node compat.\n throw err\n }\n } else {\n if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {\n const err = new TypeError('Illegal invocation')\n err.code = 'ERR_INVALID_THIS' // node compat.\n throw err\n }\n }\n}\n\nwebidl.argumentLengthCheck = function ({ length }, min, ctx) {\n if (length < min) {\n throw webidl.errors.exception({\n message: `${min} argument${min !== 1 ? 's' : ''} required, ` +\n `but${length ? ' only' : ''} ${length} found.`,\n header: ctx\n })\n }\n}\n\nwebidl.illegalConstructor = function () {\n throw webidl.errors.exception({\n header: 'TypeError',\n message: 'Illegal constructor'\n })\n}\n\n// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\nwebidl.util.Type = function (V) {\n switch (typeof V) {\n case 'undefined': return 'Undefined'\n case 'boolean': return 'Boolean'\n case 'string': return 'String'\n case 'symbol': return 'Symbol'\n case 'number': return 'Number'\n case 'bigint': return 'BigInt'\n case 'function':\n case 'object': {\n if (V === null) {\n return 'Null'\n }\n\n return 'Object'\n }\n }\n}\n\nwebidl.util.markAsUncloneable = markAsUncloneable || (() => {})\n// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint\nwebidl.util.ConvertToInt = function (V, bitLength, signedness, opts) {\n let upperBound\n let lowerBound\n\n // 1. If bitLength is 64, then:\n if (bitLength === 64) {\n // 1. Let upperBound be 2^53 − 1.\n upperBound = Math.pow(2, 53) - 1\n\n // 2. If signedness is \"unsigned\", then let lowerBound be 0.\n if (signedness === 'unsigned') {\n lowerBound = 0\n } else {\n // 3. Otherwise let lowerBound be −2^53 + 1.\n lowerBound = Math.pow(-2, 53) + 1\n }\n } else if (signedness === 'unsigned') {\n // 2. Otherwise, if signedness is \"unsigned\", then:\n\n // 1. Let lowerBound be 0.\n lowerBound = 0\n\n // 2. Let upperBound be 2^bitLength − 1.\n upperBound = Math.pow(2, bitLength) - 1\n } else {\n // 3. Otherwise:\n\n // 1. Let lowerBound be -2^bitLength − 1.\n lowerBound = Math.pow(-2, bitLength) - 1\n\n // 2. Let upperBound be 2^bitLength − 1 − 1.\n upperBound = Math.pow(2, bitLength - 1) - 1\n }\n\n // 4. Let x be ? ToNumber(V).\n let x = Number(V)\n\n // 5. If x is −0, then set x to +0.\n if (x === 0) {\n x = 0\n }\n\n // 6. If the conversion is to an IDL type associated\n // with the [EnforceRange] extended attribute, then:\n if (opts?.enforceRange === true) {\n // 1. If x is NaN, +∞, or −∞, then throw a TypeError.\n if (\n Number.isNaN(x) ||\n x === Number.POSITIVE_INFINITY ||\n x === Number.NEGATIVE_INFINITY\n ) {\n throw webidl.errors.exception({\n header: 'Integer conversion',\n message: `Could not convert ${webidl.util.Stringify(V)} to an integer.`\n })\n }\n\n // 2. Set x to IntegerPart(x).\n x = webidl.util.IntegerPart(x)\n\n // 3. If x < lowerBound or x > upperBound, then\n // throw a TypeError.\n if (x < lowerBound || x > upperBound) {\n throw webidl.errors.exception({\n header: 'Integer conversion',\n message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n })\n }\n\n // 4. Return x.\n return x\n }\n\n // 7. If x is not NaN and the conversion is to an IDL\n // type associated with the [Clamp] extended\n // attribute, then:\n if (!Number.isNaN(x) && opts?.clamp === true) {\n // 1. Set x to min(max(x, lowerBound), upperBound).\n x = Math.min(Math.max(x, lowerBound), upperBound)\n\n // 2. Round x to the nearest integer, choosing the\n // even integer if it lies halfway between two,\n // and choosing +0 rather than −0.\n if (Math.floor(x) % 2 === 0) {\n x = Math.floor(x)\n } else {\n x = Math.ceil(x)\n }\n\n // 3. Return x.\n return x\n }\n\n // 8. If x is NaN, +0, +∞, or −∞, then return +0.\n if (\n Number.isNaN(x) ||\n (x === 0 && Object.is(0, x)) ||\n x === Number.POSITIVE_INFINITY ||\n x === Number.NEGATIVE_INFINITY\n ) {\n return 0\n }\n\n // 9. Set x to IntegerPart(x).\n x = webidl.util.IntegerPart(x)\n\n // 10. Set x to x modulo 2^bitLength.\n x = x % Math.pow(2, bitLength)\n\n // 11. If signedness is \"signed\" and x ≥ 2^bitLength − 1,\n // then return x − 2^bitLength.\n if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {\n return x - Math.pow(2, bitLength)\n }\n\n // 12. Otherwise, return x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart\nwebidl.util.IntegerPart = function (n) {\n // 1. Let r be floor(abs(n)).\n const r = Math.floor(Math.abs(n))\n\n // 2. If n < 0, then return -1 × r.\n if (n < 0) {\n return -1 * r\n }\n\n // 3. Otherwise, return r.\n return r\n}\n\nwebidl.util.Stringify = function (V) {\n const type = webidl.util.Type(V)\n\n switch (type) {\n case 'Symbol':\n return `Symbol(${V.description})`\n case 'Object':\n return inspect(V)\n case 'String':\n return `\"${V}\"`\n default:\n return `${V}`\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-sequence\nwebidl.sequenceConverter = function (converter) {\n return (V, prefix, argument, Iterable) => {\n // 1. If Type(V) is not Object, throw a TypeError.\n if (webidl.util.Type(V) !== 'Object') {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.`\n })\n }\n\n // 2. Let method be ? GetMethod(V, @@iterator).\n /** @type {Generator} */\n const method = typeof Iterable === 'function' ? Iterable() : V?.[Symbol.iterator]?.()\n const seq = []\n let index = 0\n\n // 3. If method is undefined, throw a TypeError.\n if (\n method === undefined ||\n typeof method.next !== 'function'\n ) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} is not iterable.`\n })\n }\n\n // https://webidl.spec.whatwg.org/#create-sequence-from-iterable\n while (true) {\n const { done, value } = method.next()\n\n if (done) {\n break\n }\n\n seq.push(converter(value, prefix, `${argument}[${index++}]`))\n }\n\n return seq\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-to-record\nwebidl.recordConverter = function (keyConverter, valueConverter) {\n return (O, prefix, argument) => {\n // 1. If Type(O) is not Object, throw a TypeError.\n if (webidl.util.Type(O) !== 'Object') {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} (\"${webidl.util.Type(O)}\") is not an Object.`\n })\n }\n\n // 2. Let result be a new empty instance of record.\n const result = {}\n\n if (!types.isProxy(O)) {\n // 1. Let desc be ? O.[[GetOwnProperty]](key).\n const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]\n\n for (const key of keys) {\n // 1. Let typedKey be key converted to an IDL value of type K.\n const typedKey = keyConverter(key, prefix, argument)\n\n // 2. Let value be ? Get(O, key).\n // 3. Let typedValue be value converted to an IDL value of type V.\n const typedValue = valueConverter(O[key], prefix, argument)\n\n // 4. Set result[typedKey] to typedValue.\n result[typedKey] = typedValue\n }\n\n // 5. Return result.\n return result\n }\n\n // 3. Let keys be ? O.[[OwnPropertyKeys]]().\n const keys = Reflect.ownKeys(O)\n\n // 4. For each key of keys.\n for (const key of keys) {\n // 1. Let desc be ? O.[[GetOwnProperty]](key).\n const desc = Reflect.getOwnPropertyDescriptor(O, key)\n\n // 2. If desc is not undefined and desc.[[Enumerable]] is true:\n if (desc?.enumerable) {\n // 1. Let typedKey be key converted to an IDL value of type K.\n const typedKey = keyConverter(key, prefix, argument)\n\n // 2. Let value be ? Get(O, key).\n // 3. Let typedValue be value converted to an IDL value of type V.\n const typedValue = valueConverter(O[key], prefix, argument)\n\n // 4. Set result[typedKey] to typedValue.\n result[typedKey] = typedValue\n }\n }\n\n // 5. Return result.\n return result\n }\n}\n\nwebidl.interfaceConverter = function (i) {\n return (V, prefix, argument, opts) => {\n if (opts?.strict !== false && !(V instanceof i)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `Expected ${argument} (\"${webidl.util.Stringify(V)}\") to be an instance of ${i.name}.`\n })\n }\n\n return V\n }\n}\n\nwebidl.dictionaryConverter = function (converters) {\n return (dictionary, prefix, argument) => {\n const type = webidl.util.Type(dictionary)\n const dict = {}\n\n if (type === 'Null' || type === 'Undefined') {\n return dict\n } else if (type !== 'Object') {\n throw webidl.errors.exception({\n header: prefix,\n message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n })\n }\n\n for (const options of converters) {\n const { key, defaultValue, required, converter } = options\n\n if (required === true) {\n if (!Object.hasOwn(dictionary, key)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `Missing required key \"${key}\".`\n })\n }\n }\n\n let value = dictionary[key]\n const hasDefault = Object.hasOwn(options, 'defaultValue')\n\n // Only use defaultValue if value is undefined and\n // a defaultValue options was provided.\n if (hasDefault && value !== null) {\n value ??= defaultValue()\n }\n\n // A key can be optional and have no default value.\n // When this happens, do not perform a conversion,\n // and do not assign the key a value.\n if (required || hasDefault || value !== undefined) {\n value = converter(value, prefix, `${argument}.${key}`)\n\n if (\n options.allowedValues &&\n !options.allowedValues.includes(value)\n ) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`\n })\n }\n\n dict[key] = value\n }\n }\n\n return dict\n }\n}\n\nwebidl.nullableConverter = function (converter) {\n return (V, prefix, argument) => {\n if (V === null) {\n return V\n }\n\n return converter(V, prefix, argument)\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-DOMString\nwebidl.converters.DOMString = function (V, prefix, argument, opts) {\n // 1. If V is null and the conversion is to an IDL type\n // associated with the [LegacyNullToEmptyString]\n // extended attribute, then return the DOMString value\n // that represents the empty string.\n if (V === null && opts?.legacyNullToEmptyString) {\n return ''\n }\n\n // 2. Let x be ? ToString(V).\n if (typeof V === 'symbol') {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} is a symbol, which cannot be converted to a DOMString.`\n })\n }\n\n // 3. Return the IDL DOMString value that represents the\n // same sequence of code units as the one the\n // ECMAScript String value x represents.\n return String(V)\n}\n\n// https://webidl.spec.whatwg.org/#es-ByteString\nwebidl.converters.ByteString = function (V, prefix, argument) {\n // 1. Let x be ? ToString(V).\n // Note: DOMString converter perform ? ToString(V)\n const x = webidl.converters.DOMString(V, prefix, argument)\n\n // 2. If the value of any element of x is greater than\n // 255, then throw a TypeError.\n for (let index = 0; index < x.length; index++) {\n if (x.charCodeAt(index) > 255) {\n throw new TypeError(\n 'Cannot convert argument to a ByteString because the character at ' +\n `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`\n )\n }\n }\n\n // 3. Return an IDL ByteString value whose length is the\n // length of x, and where the value of each element is\n // the value of the corresponding element of x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-USVString\n// TODO: rewrite this so we can control the errors thrown\nwebidl.converters.USVString = toUSVString\n\n// https://webidl.spec.whatwg.org/#es-boolean\nwebidl.converters.boolean = function (V) {\n // 1. Let x be the result of computing ToBoolean(V).\n const x = Boolean(V)\n\n // 2. Return the IDL boolean value that is the one that represents\n // the same truth value as the ECMAScript Boolean value x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-any\nwebidl.converters.any = function (V) {\n return V\n}\n\n// https://webidl.spec.whatwg.org/#es-long-long\nwebidl.converters['long long'] = function (V, prefix, argument) {\n // 1. Let x be ? ConvertToInt(V, 64, \"signed\").\n const x = webidl.util.ConvertToInt(V, 64, 'signed', undefined, prefix, argument)\n\n // 2. Return the IDL long long value that represents\n // the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long-long\nwebidl.converters['unsigned long long'] = function (V, prefix, argument) {\n // 1. Let x be ? ConvertToInt(V, 64, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 64, 'unsigned', undefined, prefix, argument)\n\n // 2. Return the IDL unsigned long long value that\n // represents the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long\nwebidl.converters['unsigned long'] = function (V, prefix, argument) {\n // 1. Let x be ? ConvertToInt(V, 32, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 32, 'unsigned', undefined, prefix, argument)\n\n // 2. Return the IDL unsigned long value that\n // represents the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-short\nwebidl.converters['unsigned short'] = function (V, prefix, argument, opts) {\n // 1. Let x be ? ConvertToInt(V, 16, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts, prefix, argument)\n\n // 2. Return the IDL unsigned short value that represents\n // the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#idl-ArrayBuffer\nwebidl.converters.ArrayBuffer = function (V, prefix, argument, opts) {\n // 1. If Type(V) is not Object, or V does not have an\n // [[ArrayBufferData]] internal slot, then throw a\n // TypeError.\n // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances\n // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances\n if (\n webidl.util.Type(V) !== 'Object' ||\n !types.isAnyArrayBuffer(V)\n ) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n types: ['ArrayBuffer']\n })\n }\n\n // 2. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V) is true, then throw a\n // TypeError.\n if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V) is true, then throw a\n // TypeError.\n if (V.resizable || V.growable) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'Received a resizable ArrayBuffer.'\n })\n }\n\n // 4. Return the IDL ArrayBuffer value that is a\n // reference to the same object as V.\n return V\n}\n\nwebidl.converters.TypedArray = function (V, T, prefix, name, opts) {\n // 1. Let T be the IDL type V is being converted to.\n\n // 2. If Type(V) is not Object, or V does not have a\n // [[TypedArrayName]] internal slot with a value\n // equal to T’s name, then throw a TypeError.\n if (\n webidl.util.Type(V) !== 'Object' ||\n !types.isTypedArray(V) ||\n V.constructor.name !== T.name\n ) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n types: [T.name]\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 4. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (V.buffer.resizable || V.buffer.growable) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'Received a resizable ArrayBuffer.'\n })\n }\n\n // 5. Return the IDL value of type T that is a reference\n // to the same object as V.\n return V\n}\n\nwebidl.converters.DataView = function (V, prefix, name, opts) {\n // 1. If Type(V) is not Object, or V does not have a\n // [[DataView]] internal slot, then throw a TypeError.\n if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${name} is not a DataView.`\n })\n }\n\n // 2. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,\n // then throw a TypeError.\n if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (V.buffer.resizable || V.buffer.growable) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'Received a resizable ArrayBuffer.'\n })\n }\n\n // 4. Return the IDL DataView value that is a reference\n // to the same object as V.\n return V\n}\n\n// https://webidl.spec.whatwg.org/#BufferSource\nwebidl.converters.BufferSource = function (V, prefix, name, opts) {\n if (types.isAnyArrayBuffer(V)) {\n return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false })\n }\n\n if (types.isTypedArray(V)) {\n return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false })\n }\n\n if (types.isDataView(V)) {\n return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false })\n }\n\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n types: ['BufferSource']\n })\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.ByteString\n)\n\nwebidl.converters['sequence>'] = webidl.sequenceConverter(\n webidl.converters['sequence']\n)\n\nwebidl.converters['record'] = webidl.recordConverter(\n webidl.converters.ByteString,\n webidl.converters.ByteString\n)\n\nmodule.exports = {\n webidl\n}\n","'use strict'\n\n/**\n * @see https://encoding.spec.whatwg.org/#concept-encoding-get\n * @param {string|undefined} label\n */\nfunction getEncoding (label) {\n if (!label) {\n return 'failure'\n }\n\n // 1. Remove any leading and trailing ASCII whitespace from label.\n // 2. If label is an ASCII case-insensitive match for any of the\n // labels listed in the table below, then return the\n // corresponding encoding; otherwise return failure.\n switch (label.trim().toLowerCase()) {\n case 'unicode-1-1-utf-8':\n case 'unicode11utf8':\n case 'unicode20utf8':\n case 'utf-8':\n case 'utf8':\n case 'x-unicode20utf8':\n return 'UTF-8'\n case '866':\n case 'cp866':\n case 'csibm866':\n case 'ibm866':\n return 'IBM866'\n case 'csisolatin2':\n case 'iso-8859-2':\n case 'iso-ir-101':\n case 'iso8859-2':\n case 'iso88592':\n case 'iso_8859-2':\n case 'iso_8859-2:1987':\n case 'l2':\n case 'latin2':\n return 'ISO-8859-2'\n case 'csisolatin3':\n case 'iso-8859-3':\n case 'iso-ir-109':\n case 'iso8859-3':\n case 'iso88593':\n case 'iso_8859-3':\n case 'iso_8859-3:1988':\n case 'l3':\n case 'latin3':\n return 'ISO-8859-3'\n case 'csisolatin4':\n case 'iso-8859-4':\n case 'iso-ir-110':\n case 'iso8859-4':\n case 'iso88594':\n case 'iso_8859-4':\n case 'iso_8859-4:1988':\n case 'l4':\n case 'latin4':\n return 'ISO-8859-4'\n case 'csisolatincyrillic':\n case 'cyrillic':\n case 'iso-8859-5':\n case 'iso-ir-144':\n case 'iso8859-5':\n case 'iso88595':\n case 'iso_8859-5':\n case 'iso_8859-5:1988':\n return 'ISO-8859-5'\n case 'arabic':\n case 'asmo-708':\n case 'csiso88596e':\n case 'csiso88596i':\n case 'csisolatinarabic':\n case 'ecma-114':\n case 'iso-8859-6':\n case 'iso-8859-6-e':\n case 'iso-8859-6-i':\n case 'iso-ir-127':\n case 'iso8859-6':\n case 'iso88596':\n case 'iso_8859-6':\n case 'iso_8859-6:1987':\n return 'ISO-8859-6'\n case 'csisolatingreek':\n case 'ecma-118':\n case 'elot_928':\n case 'greek':\n case 'greek8':\n case 'iso-8859-7':\n case 'iso-ir-126':\n case 'iso8859-7':\n case 'iso88597':\n case 'iso_8859-7':\n case 'iso_8859-7:1987':\n case 'sun_eu_greek':\n return 'ISO-8859-7'\n case 'csiso88598e':\n case 'csisolatinhebrew':\n case 'hebrew':\n case 'iso-8859-8':\n case 'iso-8859-8-e':\n case 'iso-ir-138':\n case 'iso8859-8':\n case 'iso88598':\n case 'iso_8859-8':\n case 'iso_8859-8:1988':\n case 'visual':\n return 'ISO-8859-8'\n case 'csiso88598i':\n case 'iso-8859-8-i':\n case 'logical':\n return 'ISO-8859-8-I'\n case 'csisolatin6':\n case 'iso-8859-10':\n case 'iso-ir-157':\n case 'iso8859-10':\n case 'iso885910':\n case 'l6':\n case 'latin6':\n return 'ISO-8859-10'\n case 'iso-8859-13':\n case 'iso8859-13':\n case 'iso885913':\n return 'ISO-8859-13'\n case 'iso-8859-14':\n case 'iso8859-14':\n case 'iso885914':\n return 'ISO-8859-14'\n case 'csisolatin9':\n case 'iso-8859-15':\n case 'iso8859-15':\n case 'iso885915':\n case 'iso_8859-15':\n case 'l9':\n return 'ISO-8859-15'\n case 'iso-8859-16':\n return 'ISO-8859-16'\n case 'cskoi8r':\n case 'koi':\n case 'koi8':\n case 'koi8-r':\n case 'koi8_r':\n return 'KOI8-R'\n case 'koi8-ru':\n case 'koi8-u':\n return 'KOI8-U'\n case 'csmacintosh':\n case 'mac':\n case 'macintosh':\n case 'x-mac-roman':\n return 'macintosh'\n case 'iso-8859-11':\n case 'iso8859-11':\n case 'iso885911':\n case 'tis-620':\n case 'windows-874':\n return 'windows-874'\n case 'cp1250':\n case 'windows-1250':\n case 'x-cp1250':\n return 'windows-1250'\n case 'cp1251':\n case 'windows-1251':\n case 'x-cp1251':\n return 'windows-1251'\n case 'ansi_x3.4-1968':\n case 'ascii':\n case 'cp1252':\n case 'cp819':\n case 'csisolatin1':\n case 'ibm819':\n case 'iso-8859-1':\n case 'iso-ir-100':\n case 'iso8859-1':\n case 'iso88591':\n case 'iso_8859-1':\n case 'iso_8859-1:1987':\n case 'l1':\n case 'latin1':\n case 'us-ascii':\n case 'windows-1252':\n case 'x-cp1252':\n return 'windows-1252'\n case 'cp1253':\n case 'windows-1253':\n case 'x-cp1253':\n return 'windows-1253'\n case 'cp1254':\n case 'csisolatin5':\n case 'iso-8859-9':\n case 'iso-ir-148':\n case 'iso8859-9':\n case 'iso88599':\n case 'iso_8859-9':\n case 'iso_8859-9:1989':\n case 'l5':\n case 'latin5':\n case 'windows-1254':\n case 'x-cp1254':\n return 'windows-1254'\n case 'cp1255':\n case 'windows-1255':\n case 'x-cp1255':\n return 'windows-1255'\n case 'cp1256':\n case 'windows-1256':\n case 'x-cp1256':\n return 'windows-1256'\n case 'cp1257':\n case 'windows-1257':\n case 'x-cp1257':\n return 'windows-1257'\n case 'cp1258':\n case 'windows-1258':\n case 'x-cp1258':\n return 'windows-1258'\n case 'x-mac-cyrillic':\n case 'x-mac-ukrainian':\n return 'x-mac-cyrillic'\n case 'chinese':\n case 'csgb2312':\n case 'csiso58gb231280':\n case 'gb2312':\n case 'gb_2312':\n case 'gb_2312-80':\n case 'gbk':\n case 'iso-ir-58':\n case 'x-gbk':\n return 'GBK'\n case 'gb18030':\n return 'gb18030'\n case 'big5':\n case 'big5-hkscs':\n case 'cn-big5':\n case 'csbig5':\n case 'x-x-big5':\n return 'Big5'\n case 'cseucpkdfmtjapanese':\n case 'euc-jp':\n case 'x-euc-jp':\n return 'EUC-JP'\n case 'csiso2022jp':\n case 'iso-2022-jp':\n return 'ISO-2022-JP'\n case 'csshiftjis':\n case 'ms932':\n case 'ms_kanji':\n case 'shift-jis':\n case 'shift_jis':\n case 'sjis':\n case 'windows-31j':\n case 'x-sjis':\n return 'Shift_JIS'\n case 'cseuckr':\n case 'csksc56011987':\n case 'euc-kr':\n case 'iso-ir-149':\n case 'korean':\n case 'ks_c_5601-1987':\n case 'ks_c_5601-1989':\n case 'ksc5601':\n case 'ksc_5601':\n case 'windows-949':\n return 'EUC-KR'\n case 'csiso2022kr':\n case 'hz-gb-2312':\n case 'iso-2022-cn':\n case 'iso-2022-cn-ext':\n case 'iso-2022-kr':\n case 'replacement':\n return 'replacement'\n case 'unicodefffe':\n case 'utf-16be':\n return 'UTF-16BE'\n case 'csunicode':\n case 'iso-10646-ucs-2':\n case 'ucs-2':\n case 'unicode':\n case 'unicodefeff':\n case 'utf-16':\n case 'utf-16le':\n return 'UTF-16LE'\n case 'x-user-defined':\n return 'x-user-defined'\n default: return 'failure'\n }\n}\n\nmodule.exports = {\n getEncoding\n}\n","'use strict'\n\nconst {\n staticPropertyDescriptors,\n readOperation,\n fireAProgressEvent\n} = require('./util')\nconst {\n kState,\n kError,\n kResult,\n kEvents,\n kAborted\n} = require('./symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass FileReader extends EventTarget {\n constructor () {\n super()\n\n this[kState] = 'empty'\n this[kResult] = null\n this[kError] = null\n this[kEvents] = {\n loadend: null,\n error: null,\n abort: null,\n load: null,\n progress: null,\n loadstart: null\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer\n * @param {import('buffer').Blob} blob\n */\n readAsArrayBuffer (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsArrayBuffer')\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsArrayBuffer(blob) method, when invoked,\n // must initiate a read operation for blob with ArrayBuffer.\n readOperation(this, blob, 'ArrayBuffer')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#readAsBinaryString\n * @param {import('buffer').Blob} blob\n */\n readAsBinaryString (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsBinaryString')\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsBinaryString(blob) method, when invoked,\n // must initiate a read operation for blob with BinaryString.\n readOperation(this, blob, 'BinaryString')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#readAsDataText\n * @param {import('buffer').Blob} blob\n * @param {string?} encoding\n */\n readAsText (blob, encoding = undefined) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsText')\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n if (encoding !== undefined) {\n encoding = webidl.converters.DOMString(encoding, 'FileReader.readAsText', 'encoding')\n }\n\n // The readAsText(blob, encoding) method, when invoked,\n // must initiate a read operation for blob with Text and encoding.\n readOperation(this, blob, 'Text', encoding)\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL\n * @param {import('buffer').Blob} blob\n */\n readAsDataURL (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsDataURL')\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsDataURL(blob) method, when invoked, must\n // initiate a read operation for blob with DataURL.\n readOperation(this, blob, 'DataURL')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-abort\n */\n abort () {\n // 1. If this's state is \"empty\" or if this's state is\n // \"done\" set this's result to null and terminate\n // this algorithm.\n if (this[kState] === 'empty' || this[kState] === 'done') {\n this[kResult] = null\n return\n }\n\n // 2. If this's state is \"loading\" set this's state to\n // \"done\" and set this's result to null.\n if (this[kState] === 'loading') {\n this[kState] = 'done'\n this[kResult] = null\n }\n\n // 3. If there are any tasks from this on the file reading\n // task source in an affiliated task queue, then remove\n // those tasks from that task queue.\n this[kAborted] = true\n\n // 4. Terminate the algorithm for the read method being processed.\n // TODO\n\n // 5. Fire a progress event called abort at this.\n fireAProgressEvent('abort', this)\n\n // 6. If this's state is not \"loading\", fire a progress\n // event called loadend at this.\n if (this[kState] !== 'loading') {\n fireAProgressEvent('loadend', this)\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate\n */\n get readyState () {\n webidl.brandCheck(this, FileReader)\n\n switch (this[kState]) {\n case 'empty': return this.EMPTY\n case 'loading': return this.LOADING\n case 'done': return this.DONE\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-result\n */\n get result () {\n webidl.brandCheck(this, FileReader)\n\n // The result attribute’s getter, when invoked, must return\n // this's result.\n return this[kResult]\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-error\n */\n get error () {\n webidl.brandCheck(this, FileReader)\n\n // The error attribute’s getter, when invoked, must return\n // this's error.\n return this[kError]\n }\n\n get onloadend () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].loadend\n }\n\n set onloadend (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].loadend) {\n this.removeEventListener('loadend', this[kEvents].loadend)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].loadend = fn\n this.addEventListener('loadend', fn)\n } else {\n this[kEvents].loadend = null\n }\n }\n\n get onerror () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].error\n }\n\n set onerror (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].error) {\n this.removeEventListener('error', this[kEvents].error)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].error = fn\n this.addEventListener('error', fn)\n } else {\n this[kEvents].error = null\n }\n }\n\n get onloadstart () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].loadstart\n }\n\n set onloadstart (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].loadstart) {\n this.removeEventListener('loadstart', this[kEvents].loadstart)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].loadstart = fn\n this.addEventListener('loadstart', fn)\n } else {\n this[kEvents].loadstart = null\n }\n }\n\n get onprogress () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].progress\n }\n\n set onprogress (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].progress) {\n this.removeEventListener('progress', this[kEvents].progress)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].progress = fn\n this.addEventListener('progress', fn)\n } else {\n this[kEvents].progress = null\n }\n }\n\n get onload () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].load\n }\n\n set onload (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].load) {\n this.removeEventListener('load', this[kEvents].load)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].load = fn\n this.addEventListener('load', fn)\n } else {\n this[kEvents].load = null\n }\n }\n\n get onabort () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].abort\n }\n\n set onabort (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].abort) {\n this.removeEventListener('abort', this[kEvents].abort)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].abort = fn\n this.addEventListener('abort', fn)\n } else {\n this[kEvents].abort = null\n }\n }\n}\n\n// https://w3c.github.io/FileAPI/#dom-filereader-empty\nFileReader.EMPTY = FileReader.prototype.EMPTY = 0\n// https://w3c.github.io/FileAPI/#dom-filereader-loading\nFileReader.LOADING = FileReader.prototype.LOADING = 1\n// https://w3c.github.io/FileAPI/#dom-filereader-done\nFileReader.DONE = FileReader.prototype.DONE = 2\n\nObject.defineProperties(FileReader.prototype, {\n EMPTY: staticPropertyDescriptors,\n LOADING: staticPropertyDescriptors,\n DONE: staticPropertyDescriptors,\n readAsArrayBuffer: kEnumerableProperty,\n readAsBinaryString: kEnumerableProperty,\n readAsText: kEnumerableProperty,\n readAsDataURL: kEnumerableProperty,\n abort: kEnumerableProperty,\n readyState: kEnumerableProperty,\n result: kEnumerableProperty,\n error: kEnumerableProperty,\n onloadstart: kEnumerableProperty,\n onprogress: kEnumerableProperty,\n onload: kEnumerableProperty,\n onabort: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onloadend: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'FileReader',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nObject.defineProperties(FileReader, {\n EMPTY: staticPropertyDescriptors,\n LOADING: staticPropertyDescriptors,\n DONE: staticPropertyDescriptors\n})\n\nmodule.exports = {\n FileReader\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\n\nconst kState = Symbol('ProgressEvent state')\n\n/**\n * @see https://xhr.spec.whatwg.org/#progressevent\n */\nclass ProgressEvent extends Event {\n constructor (type, eventInitDict = {}) {\n type = webidl.converters.DOMString(type, 'ProgressEvent constructor', 'type')\n eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})\n\n super(type, eventInitDict)\n\n this[kState] = {\n lengthComputable: eventInitDict.lengthComputable,\n loaded: eventInitDict.loaded,\n total: eventInitDict.total\n }\n }\n\n get lengthComputable () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].lengthComputable\n }\n\n get loaded () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].loaded\n }\n\n get total () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].total\n }\n}\n\nwebidl.converters.ProgressEventInit = webidl.dictionaryConverter([\n {\n key: 'lengthComputable',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'loaded',\n converter: webidl.converters['unsigned long long'],\n defaultValue: () => 0\n },\n {\n key: 'total',\n converter: webidl.converters['unsigned long long'],\n defaultValue: () => 0\n },\n {\n key: 'bubbles',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'cancelable',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'composed',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n }\n])\n\nmodule.exports = {\n ProgressEvent\n}\n","'use strict'\n\nmodule.exports = {\n kState: Symbol('FileReader state'),\n kResult: Symbol('FileReader result'),\n kError: Symbol('FileReader error'),\n kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),\n kEvents: Symbol('FileReader events'),\n kAborted: Symbol('FileReader aborted')\n}\n","'use strict'\n\nconst {\n kState,\n kError,\n kResult,\n kAborted,\n kLastProgressEventFired\n} = require('./symbols')\nconst { ProgressEvent } = require('./progressevent')\nconst { getEncoding } = require('./encoding')\nconst { serializeAMimeType, parseMIMEType } = require('../fetch/data-url')\nconst { types } = require('node:util')\nconst { StringDecoder } = require('string_decoder')\nconst { btoa } = require('node:buffer')\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n enumerable: true,\n writable: false,\n configurable: false\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#readOperation\n * @param {import('./filereader').FileReader} fr\n * @param {import('buffer').Blob} blob\n * @param {string} type\n * @param {string?} encodingName\n */\nfunction readOperation (fr, blob, type, encodingName) {\n // 1. If fr’s state is \"loading\", throw an InvalidStateError\n // DOMException.\n if (fr[kState] === 'loading') {\n throw new DOMException('Invalid state', 'InvalidStateError')\n }\n\n // 2. Set fr’s state to \"loading\".\n fr[kState] = 'loading'\n\n // 3. Set fr’s result to null.\n fr[kResult] = null\n\n // 4. Set fr’s error to null.\n fr[kError] = null\n\n // 5. Let stream be the result of calling get stream on blob.\n /** @type {import('stream/web').ReadableStream} */\n const stream = blob.stream()\n\n // 6. Let reader be the result of getting a reader from stream.\n const reader = stream.getReader()\n\n // 7. Let bytes be an empty byte sequence.\n /** @type {Uint8Array[]} */\n const bytes = []\n\n // 8. Let chunkPromise be the result of reading a chunk from\n // stream with reader.\n let chunkPromise = reader.read()\n\n // 9. Let isFirstChunk be true.\n let isFirstChunk = true\n\n // 10. In parallel, while true:\n // Note: \"In parallel\" just means non-blocking\n // Note 2: readOperation itself cannot be async as double\n // reading the body would then reject the promise, instead\n // of throwing an error.\n ;(async () => {\n while (!fr[kAborted]) {\n // 1. Wait for chunkPromise to be fulfilled or rejected.\n try {\n const { done, value } = await chunkPromise\n\n // 2. If chunkPromise is fulfilled, and isFirstChunk is\n // true, queue a task to fire a progress event called\n // loadstart at fr.\n if (isFirstChunk && !fr[kAborted]) {\n queueMicrotask(() => {\n fireAProgressEvent('loadstart', fr)\n })\n }\n\n // 3. Set isFirstChunk to false.\n isFirstChunk = false\n\n // 4. If chunkPromise is fulfilled with an object whose\n // done property is false and whose value property is\n // a Uint8Array object, run these steps:\n if (!done && types.isUint8Array(value)) {\n // 1. Let bs be the byte sequence represented by the\n // Uint8Array object.\n\n // 2. Append bs to bytes.\n bytes.push(value)\n\n // 3. If roughly 50ms have passed since these steps\n // were last invoked, queue a task to fire a\n // progress event called progress at fr.\n if (\n (\n fr[kLastProgressEventFired] === undefined ||\n Date.now() - fr[kLastProgressEventFired] >= 50\n ) &&\n !fr[kAborted]\n ) {\n fr[kLastProgressEventFired] = Date.now()\n queueMicrotask(() => {\n fireAProgressEvent('progress', fr)\n })\n }\n\n // 4. Set chunkPromise to the result of reading a\n // chunk from stream with reader.\n chunkPromise = reader.read()\n } else if (done) {\n // 5. Otherwise, if chunkPromise is fulfilled with an\n // object whose done property is true, queue a task\n // to run the following steps and abort this algorithm:\n queueMicrotask(() => {\n // 1. Set fr’s state to \"done\".\n fr[kState] = 'done'\n\n // 2. Let result be the result of package data given\n // bytes, type, blob’s type, and encodingName.\n try {\n const result = packageData(bytes, type, blob.type, encodingName)\n\n // 4. Else:\n\n if (fr[kAborted]) {\n return\n }\n\n // 1. Set fr’s result to result.\n fr[kResult] = result\n\n // 2. Fire a progress event called load at the fr.\n fireAProgressEvent('load', fr)\n } catch (error) {\n // 3. If package data threw an exception error:\n\n // 1. Set fr’s error to error.\n fr[kError] = error\n\n // 2. Fire a progress event called error at fr.\n fireAProgressEvent('error', fr)\n }\n\n // 5. If fr’s state is not \"loading\", fire a progress\n // event called loadend at the fr.\n if (fr[kState] !== 'loading') {\n fireAProgressEvent('loadend', fr)\n }\n })\n\n break\n }\n } catch (error) {\n if (fr[kAborted]) {\n return\n }\n\n // 6. Otherwise, if chunkPromise is rejected with an\n // error error, queue a task to run the following\n // steps and abort this algorithm:\n queueMicrotask(() => {\n // 1. Set fr’s state to \"done\".\n fr[kState] = 'done'\n\n // 2. Set fr’s error to error.\n fr[kError] = error\n\n // 3. Fire a progress event called error at fr.\n fireAProgressEvent('error', fr)\n\n // 4. If fr’s state is not \"loading\", fire a progress\n // event called loadend at fr.\n if (fr[kState] !== 'loading') {\n fireAProgressEvent('loadend', fr)\n }\n })\n\n break\n }\n }\n })()\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#fire-a-progress-event\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e The name of the event\n * @param {import('./filereader').FileReader} reader\n */\nfunction fireAProgressEvent (e, reader) {\n // The progress event e does not bubble. e.bubbles must be false\n // The progress event e is NOT cancelable. e.cancelable must be false\n const event = new ProgressEvent(e, {\n bubbles: false,\n cancelable: false\n })\n\n reader.dispatchEvent(event)\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#blob-package-data\n * @param {Uint8Array[]} bytes\n * @param {string} type\n * @param {string?} mimeType\n * @param {string?} encodingName\n */\nfunction packageData (bytes, type, mimeType, encodingName) {\n // 1. A Blob has an associated package data algorithm, given\n // bytes, a type, a optional mimeType, and a optional\n // encodingName, which switches on type and runs the\n // associated steps:\n\n switch (type) {\n case 'DataURL': {\n // 1. Return bytes as a DataURL [RFC2397] subject to\n // the considerations below:\n // * Use mimeType as part of the Data URL if it is\n // available in keeping with the Data URL\n // specification [RFC2397].\n // * If mimeType is not available return a Data URL\n // without a media-type. [RFC2397].\n\n // https://datatracker.ietf.org/doc/html/rfc2397#section-3\n // dataurl := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n // mediatype := [ type \"/\" subtype ] *( \";\" parameter )\n // data := *urlchar\n // parameter := attribute \"=\" value\n let dataURL = 'data:'\n\n const parsed = parseMIMEType(mimeType || 'application/octet-stream')\n\n if (parsed !== 'failure') {\n dataURL += serializeAMimeType(parsed)\n }\n\n dataURL += ';base64,'\n\n const decoder = new StringDecoder('latin1')\n\n for (const chunk of bytes) {\n dataURL += btoa(decoder.write(chunk))\n }\n\n dataURL += btoa(decoder.end())\n\n return dataURL\n }\n case 'Text': {\n // 1. Let encoding be failure\n let encoding = 'failure'\n\n // 2. If the encodingName is present, set encoding to the\n // result of getting an encoding from encodingName.\n if (encodingName) {\n encoding = getEncoding(encodingName)\n }\n\n // 3. If encoding is failure, and mimeType is present:\n if (encoding === 'failure' && mimeType) {\n // 1. Let type be the result of parse a MIME type\n // given mimeType.\n const type = parseMIMEType(mimeType)\n\n // 2. If type is not failure, set encoding to the result\n // of getting an encoding from type’s parameters[\"charset\"].\n if (type !== 'failure') {\n encoding = getEncoding(type.parameters.get('charset'))\n }\n }\n\n // 4. If encoding is failure, then set encoding to UTF-8.\n if (encoding === 'failure') {\n encoding = 'UTF-8'\n }\n\n // 5. Decode bytes using fallback encoding encoding, and\n // return the result.\n return decode(bytes, encoding)\n }\n case 'ArrayBuffer': {\n // Return a new ArrayBuffer whose contents are bytes.\n const sequence = combineByteSequences(bytes)\n\n return sequence.buffer\n }\n case 'BinaryString': {\n // Return bytes as a binary string, in which every byte\n // is represented by a code unit of equal value [0..255].\n let binaryString = ''\n\n const decoder = new StringDecoder('latin1')\n\n for (const chunk of bytes) {\n binaryString += decoder.write(chunk)\n }\n\n binaryString += decoder.end()\n\n return binaryString\n }\n }\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#decode\n * @param {Uint8Array[]} ioQueue\n * @param {string} encoding\n */\nfunction decode (ioQueue, encoding) {\n const bytes = combineByteSequences(ioQueue)\n\n // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.\n const BOMEncoding = BOMSniffing(bytes)\n\n let slice = 0\n\n // 2. If BOMEncoding is non-null:\n if (BOMEncoding !== null) {\n // 1. Set encoding to BOMEncoding.\n encoding = BOMEncoding\n\n // 2. Read three bytes from ioQueue, if BOMEncoding is\n // UTF-8; otherwise read two bytes.\n // (Do nothing with those bytes.)\n slice = BOMEncoding === 'UTF-8' ? 3 : 2\n }\n\n // 3. Process a queue with an instance of encoding’s\n // decoder, ioQueue, output, and \"replacement\".\n\n // 4. Return output.\n\n const sliced = bytes.slice(slice)\n return new TextDecoder(encoding).decode(sliced)\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#bom-sniff\n * @param {Uint8Array} ioQueue\n */\nfunction BOMSniffing (ioQueue) {\n // 1. Let BOM be the result of peeking 3 bytes from ioQueue,\n // converted to a byte sequence.\n const [a, b, c] = ioQueue\n\n // 2. For each of the rows in the table below, starting with\n // the first one and going down, if BOM starts with the\n // bytes given in the first column, then return the\n // encoding given in the cell in the second column of that\n // row. Otherwise, return null.\n if (a === 0xEF && b === 0xBB && c === 0xBF) {\n return 'UTF-8'\n } else if (a === 0xFE && b === 0xFF) {\n return 'UTF-16BE'\n } else if (a === 0xFF && b === 0xFE) {\n return 'UTF-16LE'\n }\n\n return null\n}\n\n/**\n * @param {Uint8Array[]} sequences\n */\nfunction combineByteSequences (sequences) {\n const size = sequences.reduce((a, b) => {\n return a + b.byteLength\n }, 0)\n\n let offset = 0\n\n return sequences.reduce((a, b) => {\n a.set(b, offset)\n offset += b.byteLength\n return a\n }, new Uint8Array(size))\n}\n\nmodule.exports = {\n staticPropertyDescriptors,\n readOperation,\n fireAProgressEvent\n}\n","'use strict'\n\nconst { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require('./constants')\nconst {\n kReadyState,\n kSentClose,\n kByteParser,\n kReceivedClose,\n kResponse\n} = require('./symbols')\nconst { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require('./util')\nconst { channels } = require('../../core/diagnostics')\nconst { CloseEvent } = require('./events')\nconst { makeRequest } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { Headers, getHeadersList } = require('../fetch/headers')\nconst { getDecodeSplit } = require('../fetch/util')\nconst { WebsocketFrameSend } = require('./frame')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#concept-websocket-establish\n * @param {URL} url\n * @param {string|string[]} protocols\n * @param {import('./websocket').WebSocket} ws\n * @param {(response: any, extensions: string[] | undefined) => void} onEstablish\n * @param {Partial} options\n */\nfunction establishWebSocketConnection (url, protocols, client, ws, onEstablish, options) {\n // 1. Let requestURL be a copy of url, with its scheme set to \"http\", if url’s\n // scheme is \"ws\", and to \"https\" otherwise.\n const requestURL = url\n\n requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'\n\n // 2. Let request be a new request, whose URL is requestURL, client is client,\n // service-workers mode is \"none\", referrer is \"no-referrer\", mode is\n // \"websocket\", credentials mode is \"include\", cache mode is \"no-store\" ,\n // and redirect mode is \"error\".\n const request = makeRequest({\n urlList: [requestURL],\n client,\n serviceWorkers: 'none',\n referrer: 'no-referrer',\n mode: 'websocket',\n credentials: 'include',\n cache: 'no-store',\n redirect: 'error'\n })\n\n // Note: undici extension, allow setting custom headers.\n if (options.headers) {\n const headersList = getHeadersList(new Headers(options.headers))\n\n request.headersList = headersList\n }\n\n // 3. Append (`Upgrade`, `websocket`) to request’s header list.\n // 4. Append (`Connection`, `Upgrade`) to request’s header list.\n // Note: both of these are handled by undici currently.\n // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397\n\n // 5. Let keyValue be a nonce consisting of a randomly selected\n // 16-byte value that has been forgiving-base64-encoded and\n // isomorphic encoded.\n const keyValue = crypto.randomBytes(16).toString('base64')\n\n // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s\n // header list.\n request.headersList.append('sec-websocket-key', keyValue)\n\n // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s\n // header list.\n request.headersList.append('sec-websocket-version', '13')\n\n // 8. For each protocol in protocols, combine\n // (`Sec-WebSocket-Protocol`, protocol) in request’s header\n // list.\n for (const protocol of protocols) {\n request.headersList.append('sec-websocket-protocol', protocol)\n }\n\n // 9. Let permessageDeflate be a user-agent defined\n // \"permessage-deflate\" extension header value.\n // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673\n const permessageDeflate = 'permessage-deflate; client_max_window_bits'\n\n // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to\n // request’s header list.\n request.headersList.append('sec-websocket-extensions', permessageDeflate)\n\n // 11. Fetch request with useParallelQueue set to true, and\n // processResponse given response being these steps:\n const controller = fetching({\n request,\n useParallelQueue: true,\n dispatcher: options.dispatcher,\n processResponse (response) {\n // 1. If response is a network error or its status is not 101,\n // fail the WebSocket connection.\n if (response.type === 'error' || response.status !== 101) {\n failWebsocketConnection(ws, 'Received network error or non-101 status code.')\n return\n }\n\n // 2. If protocols is not the empty list and extracting header\n // list values given `Sec-WebSocket-Protocol` and response’s\n // header list results in null, failure, or the empty byte\n // sequence, then fail the WebSocket connection.\n if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {\n failWebsocketConnection(ws, 'Server did not respond with sent protocols.')\n return\n }\n\n // 3. Follow the requirements stated step 2 to step 6, inclusive,\n // of the last set of steps in section 4.1 of The WebSocket\n // Protocol to validate response. This either results in fail\n // the WebSocket connection or the WebSocket connection is\n // established.\n\n // 2. If the response lacks an |Upgrade| header field or the |Upgrade|\n // header field contains a value that is not an ASCII case-\n // insensitive match for the value \"websocket\", the client MUST\n // _Fail the WebSocket Connection_.\n if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {\n failWebsocketConnection(ws, 'Server did not set Upgrade header to \"websocket\".')\n return\n }\n\n // 3. If the response lacks a |Connection| header field or the\n // |Connection| header field doesn't contain a token that is an\n // ASCII case-insensitive match for the value \"Upgrade\", the client\n // MUST _Fail the WebSocket Connection_.\n if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {\n failWebsocketConnection(ws, 'Server did not set Connection header to \"upgrade\".')\n return\n }\n\n // 4. If the response lacks a |Sec-WebSocket-Accept| header field or\n // the |Sec-WebSocket-Accept| contains a value other than the\n // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-\n // Key| (as a string, not base64-decoded) with the string \"258EAFA5-\n // E914-47DA-95CA-C5AB0DC85B11\" but ignoring any leading and\n // trailing whitespace, the client MUST _Fail the WebSocket\n // Connection_.\n const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')\n const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')\n if (secWSAccept !== digest) {\n failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')\n return\n }\n\n // 5. If the response includes a |Sec-WebSocket-Extensions| header\n // field and this header field indicates the use of an extension\n // that was not present in the client's handshake (the server has\n // indicated an extension not requested by the client), the client\n // MUST _Fail the WebSocket Connection_. (The parsing of this\n // header field to determine which extensions are requested is\n // discussed in Section 9.1.)\n const secExtension = response.headersList.get('Sec-WebSocket-Extensions')\n let extensions\n\n if (secExtension !== null) {\n extensions = parseExtensions(secExtension)\n\n if (!extensions.has('permessage-deflate')) {\n failWebsocketConnection(ws, 'Sec-WebSocket-Extensions header does not match.')\n return\n }\n }\n\n // 6. If the response includes a |Sec-WebSocket-Protocol| header field\n // and this header field indicates the use of a subprotocol that was\n // not present in the client's handshake (the server has indicated a\n // subprotocol not requested by the client), the client MUST _Fail\n // the WebSocket Connection_.\n const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')\n\n if (secProtocol !== null) {\n const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList)\n\n // The client can request that the server use a specific subprotocol by\n // including the |Sec-WebSocket-Protocol| field in its handshake. If it\n // is specified, the server needs to include the same field and one of\n // the selected subprotocol values in its response for the connection to\n // be established.\n if (!requestProtocols.includes(secProtocol)) {\n failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')\n return\n }\n }\n\n response.socket.on('data', onSocketData)\n response.socket.on('close', onSocketClose)\n response.socket.on('error', onSocketError)\n\n if (channels.open.hasSubscribers) {\n channels.open.publish({\n address: response.socket.address(),\n protocol: secProtocol,\n extensions: secExtension\n })\n }\n\n onEstablish(response, extensions)\n }\n })\n\n return controller\n}\n\nfunction closeWebSocketConnection (ws, code, reason, reasonByteLength) {\n if (isClosing(ws) || isClosed(ws)) {\n // If this's ready state is CLOSING (2) or CLOSED (3)\n // Do nothing.\n } else if (!isEstablished(ws)) {\n // If the WebSocket connection is not yet established\n // Fail the WebSocket connection and set this's ready state\n // to CLOSING (2).\n failWebsocketConnection(ws, 'Connection was closed before it was established.')\n ws[kReadyState] = states.CLOSING\n } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) {\n // If the WebSocket closing handshake has not yet been started\n // Start the WebSocket closing handshake and set this's ready\n // state to CLOSING (2).\n // - If neither code nor reason is present, the WebSocket Close\n // message must not have a body.\n // - If code is present, then the status code to use in the\n // WebSocket Close message must be the integer given by code.\n // - If reason is also present, then reasonBytes must be\n // provided in the Close message after the status code.\n\n ws[kSentClose] = sentCloseFrameState.PROCESSING\n\n const frame = new WebsocketFrameSend()\n\n // If neither code nor reason is present, the WebSocket Close\n // message must not have a body.\n\n // If code is present, then the status code to use in the\n // WebSocket Close message must be the integer given by code.\n if (code !== undefined && reason === undefined) {\n frame.frameData = Buffer.allocUnsafe(2)\n frame.frameData.writeUInt16BE(code, 0)\n } else if (code !== undefined && reason !== undefined) {\n // If reason is also present, then reasonBytes must be\n // provided in the Close message after the status code.\n frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)\n frame.frameData.writeUInt16BE(code, 0)\n // the body MAY contain UTF-8-encoded data with value /reason/\n frame.frameData.write(reason, 2, 'utf-8')\n } else {\n frame.frameData = emptyBuffer\n }\n\n /** @type {import('stream').Duplex} */\n const socket = ws[kResponse].socket\n\n socket.write(frame.createFrame(opcodes.CLOSE))\n\n ws[kSentClose] = sentCloseFrameState.SENT\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n ws[kReadyState] = states.CLOSING\n } else {\n // Otherwise\n // Set this's ready state to CLOSING (2).\n ws[kReadyState] = states.CLOSING\n }\n}\n\n/**\n * @param {Buffer} chunk\n */\nfunction onSocketData (chunk) {\n if (!this.ws[kByteParser].write(chunk)) {\n this.pause()\n }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n */\nfunction onSocketClose () {\n const { ws } = this\n const { [kResponse]: response } = ws\n\n response.socket.off('data', onSocketData)\n response.socket.off('close', onSocketClose)\n response.socket.off('error', onSocketError)\n\n // If the TCP connection was closed after the\n // WebSocket closing handshake was completed, the WebSocket connection\n // is said to have been closed _cleanly_.\n const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]\n\n let code = 1005\n let reason = ''\n\n const result = ws[kByteParser].closingInfo\n\n if (result && !result.error) {\n code = result.code ?? 1005\n reason = result.reason\n } else if (!ws[kReceivedClose]) {\n // If _The WebSocket\n // Connection is Closed_ and no Close control frame was received by the\n // endpoint (such as could occur if the underlying transport connection\n // is lost), _The WebSocket Connection Close Code_ is considered to be\n // 1006.\n code = 1006\n }\n\n // 1. Change the ready state to CLOSED (3).\n ws[kReadyState] = states.CLOSED\n\n // 2. If the user agent was required to fail the WebSocket\n // connection, or if the WebSocket connection was closed\n // after being flagged as full, fire an event named error\n // at the WebSocket object.\n // TODO\n\n // 3. Fire an event named close at the WebSocket object,\n // using CloseEvent, with the wasClean attribute\n // initialized to true if the connection closed cleanly\n // and false otherwise, the code attribute initialized to\n // the WebSocket connection close code, and the reason\n // attribute initialized to the result of applying UTF-8\n // decode without BOM to the WebSocket connection close\n // reason.\n // TODO: process.nextTick\n fireEvent('close', ws, (type, init) => new CloseEvent(type, init), {\n wasClean, code, reason\n })\n\n if (channels.close.hasSubscribers) {\n channels.close.publish({\n websocket: ws,\n code,\n reason\n })\n }\n}\n\nfunction onSocketError (error) {\n const { ws } = this\n\n ws[kReadyState] = states.CLOSING\n\n if (channels.socketError.hasSubscribers) {\n channels.socketError.publish(error)\n }\n\n this.destroy()\n}\n\nmodule.exports = {\n establishWebSocketConnection,\n closeWebSocketConnection\n}\n","'use strict'\n\n// This is a Globally Unique Identifier unique used\n// to validate that the endpoint accepts websocket\n// connections.\n// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3\nconst uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n enumerable: true,\n writable: false,\n configurable: false\n}\n\nconst states = {\n CONNECTING: 0,\n OPEN: 1,\n CLOSING: 2,\n CLOSED: 3\n}\n\nconst sentCloseFrameState = {\n NOT_SENT: 0,\n PROCESSING: 1,\n SENT: 2\n}\n\nconst opcodes = {\n CONTINUATION: 0x0,\n TEXT: 0x1,\n BINARY: 0x2,\n CLOSE: 0x8,\n PING: 0x9,\n PONG: 0xA\n}\n\nconst maxUnsigned16Bit = 2 ** 16 - 1 // 65535\n\nconst parserStates = {\n INFO: 0,\n PAYLOADLENGTH_16: 2,\n PAYLOADLENGTH_64: 3,\n READ_DATA: 4\n}\n\nconst emptyBuffer = Buffer.allocUnsafe(0)\n\nconst sendHints = {\n string: 1,\n typedArray: 2,\n arrayBuffer: 3,\n blob: 4\n}\n\nmodule.exports = {\n uid,\n sentCloseFrameState,\n staticPropertyDescriptors,\n states,\n opcodes,\n maxUnsigned16Bit,\n parserStates,\n emptyBuffer,\n sendHints\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { kConstruct } = require('../../core/symbols')\nconst { MessagePort } = require('node:worker_threads')\n\n/**\n * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent\n */\nclass MessageEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict = {}) {\n if (type === kConstruct) {\n super(arguments[1], arguments[2])\n webidl.util.markAsUncloneable(this)\n return\n }\n\n const prefix = 'MessageEvent constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n type = webidl.converters.DOMString(type, prefix, 'type')\n eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')\n\n super(type, eventInitDict)\n\n this.#eventInit = eventInitDict\n webidl.util.markAsUncloneable(this)\n }\n\n get data () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.data\n }\n\n get origin () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.origin\n }\n\n get lastEventId () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.lastEventId\n }\n\n get source () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.source\n }\n\n get ports () {\n webidl.brandCheck(this, MessageEvent)\n\n if (!Object.isFrozen(this.#eventInit.ports)) {\n Object.freeze(this.#eventInit.ports)\n }\n\n return this.#eventInit.ports\n }\n\n initMessageEvent (\n type,\n bubbles = false,\n cancelable = false,\n data = null,\n origin = '',\n lastEventId = '',\n source = null,\n ports = []\n ) {\n webidl.brandCheck(this, MessageEvent)\n\n webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')\n\n return new MessageEvent(type, {\n bubbles, cancelable, data, origin, lastEventId, source, ports\n })\n }\n\n static createFastMessageEvent (type, init) {\n const messageEvent = new MessageEvent(kConstruct, type, init)\n messageEvent.#eventInit = init\n messageEvent.#eventInit.data ??= null\n messageEvent.#eventInit.origin ??= ''\n messageEvent.#eventInit.lastEventId ??= ''\n messageEvent.#eventInit.source ??= null\n messageEvent.#eventInit.ports ??= []\n return messageEvent\n }\n}\n\nconst { createFastMessageEvent } = MessageEvent\ndelete MessageEvent.createFastMessageEvent\n\n/**\n * @see https://websockets.spec.whatwg.org/#the-closeevent-interface\n */\nclass CloseEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict = {}) {\n const prefix = 'CloseEvent constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n type = webidl.converters.DOMString(type, prefix, 'type')\n eventInitDict = webidl.converters.CloseEventInit(eventInitDict)\n\n super(type, eventInitDict)\n\n this.#eventInit = eventInitDict\n webidl.util.markAsUncloneable(this)\n }\n\n get wasClean () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.wasClean\n }\n\n get code () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.code\n }\n\n get reason () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.reason\n }\n}\n\n// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface\nclass ErrorEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict) {\n const prefix = 'ErrorEvent constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n super(type, eventInitDict)\n webidl.util.markAsUncloneable(this)\n\n type = webidl.converters.DOMString(type, prefix, 'type')\n eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})\n\n this.#eventInit = eventInitDict\n }\n\n get message () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.message\n }\n\n get filename () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.filename\n }\n\n get lineno () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.lineno\n }\n\n get colno () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.colno\n }\n\n get error () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.error\n }\n}\n\nObject.defineProperties(MessageEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'MessageEvent',\n configurable: true\n },\n data: kEnumerableProperty,\n origin: kEnumerableProperty,\n lastEventId: kEnumerableProperty,\n source: kEnumerableProperty,\n ports: kEnumerableProperty,\n initMessageEvent: kEnumerableProperty\n})\n\nObject.defineProperties(CloseEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'CloseEvent',\n configurable: true\n },\n reason: kEnumerableProperty,\n code: kEnumerableProperty,\n wasClean: kEnumerableProperty\n})\n\nObject.defineProperties(ErrorEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'ErrorEvent',\n configurable: true\n },\n message: kEnumerableProperty,\n filename: kEnumerableProperty,\n lineno: kEnumerableProperty,\n colno: kEnumerableProperty,\n error: kEnumerableProperty\n})\n\nwebidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.MessagePort\n)\n\nconst eventInit = [\n {\n key: 'bubbles',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'cancelable',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'composed',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n }\n]\n\nwebidl.converters.MessageEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'data',\n converter: webidl.converters.any,\n defaultValue: () => null\n },\n {\n key: 'origin',\n converter: webidl.converters.USVString,\n defaultValue: () => ''\n },\n {\n key: 'lastEventId',\n converter: webidl.converters.DOMString,\n defaultValue: () => ''\n },\n {\n key: 'source',\n // Node doesn't implement WindowProxy or ServiceWorker, so the only\n // valid value for source is a MessagePort.\n converter: webidl.nullableConverter(webidl.converters.MessagePort),\n defaultValue: () => null\n },\n {\n key: 'ports',\n converter: webidl.converters['sequence'],\n defaultValue: () => new Array(0)\n }\n])\n\nwebidl.converters.CloseEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'wasClean',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'code',\n converter: webidl.converters['unsigned short'],\n defaultValue: () => 0\n },\n {\n key: 'reason',\n converter: webidl.converters.USVString,\n defaultValue: () => ''\n }\n])\n\nwebidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'message',\n converter: webidl.converters.DOMString,\n defaultValue: () => ''\n },\n {\n key: 'filename',\n converter: webidl.converters.USVString,\n defaultValue: () => ''\n },\n {\n key: 'lineno',\n converter: webidl.converters['unsigned long'],\n defaultValue: () => 0\n },\n {\n key: 'colno',\n converter: webidl.converters['unsigned long'],\n defaultValue: () => 0\n },\n {\n key: 'error',\n converter: webidl.converters.any\n }\n])\n\nmodule.exports = {\n MessageEvent,\n CloseEvent,\n ErrorEvent,\n createFastMessageEvent\n}\n","'use strict'\n\nconst { maxUnsigned16Bit } = require('./constants')\n\nconst BUFFER_SIZE = 16386\n\n/** @type {import('crypto')} */\nlet crypto\nlet buffer = null\nlet bufIdx = BUFFER_SIZE\n\ntry {\n crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n crypto = {\n // not full compatibility, but minimum.\n randomFillSync: function randomFillSync (buffer, _offset, _size) {\n for (let i = 0; i < buffer.length; ++i) {\n buffer[i] = Math.random() * 255 | 0\n }\n return buffer\n }\n }\n}\n\nfunction generateMask () {\n if (bufIdx === BUFFER_SIZE) {\n bufIdx = 0\n crypto.randomFillSync((buffer ??= Buffer.allocUnsafe(BUFFER_SIZE)), 0, BUFFER_SIZE)\n }\n return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]\n}\n\nclass WebsocketFrameSend {\n /**\n * @param {Buffer|undefined} data\n */\n constructor (data) {\n this.frameData = data\n }\n\n createFrame (opcode) {\n const frameData = this.frameData\n const maskKey = generateMask()\n const bodyLength = frameData?.byteLength ?? 0\n\n /** @type {number} */\n let payloadLength = bodyLength // 0-125\n let offset = 6\n\n if (bodyLength > maxUnsigned16Bit) {\n offset += 8 // payload length is next 8 bytes\n payloadLength = 127\n } else if (bodyLength > 125) {\n offset += 2 // payload length is next 2 bytes\n payloadLength = 126\n }\n\n const buffer = Buffer.allocUnsafe(bodyLength + offset)\n\n // Clear first 2 bytes, everything else is overwritten\n buffer[0] = buffer[1] = 0\n buffer[0] |= 0x80 // FIN\n buffer[0] = (buffer[0] & 0xF0) + opcode // opcode\n\n /*! ws. MIT License. Einar Otto Stangvik */\n buffer[offset - 4] = maskKey[0]\n buffer[offset - 3] = maskKey[1]\n buffer[offset - 2] = maskKey[2]\n buffer[offset - 1] = maskKey[3]\n\n buffer[1] = payloadLength\n\n if (payloadLength === 126) {\n buffer.writeUInt16BE(bodyLength, 2)\n } else if (payloadLength === 127) {\n // Clear extended payload length\n buffer[2] = buffer[3] = 0\n buffer.writeUIntBE(bodyLength, 4, 6)\n }\n\n buffer[1] |= 0x80 // MASK\n\n // mask body\n for (let i = 0; i < bodyLength; ++i) {\n buffer[offset + i] = frameData[i] ^ maskKey[i & 3]\n }\n\n return buffer\n }\n}\n\nmodule.exports = {\n WebsocketFrameSend\n}\n","'use strict'\n\nconst { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require('node:zlib')\nconst { isValidClientWindowBits } = require('./util')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nconst tail = Buffer.from([0x00, 0x00, 0xff, 0xff])\nconst kBuffer = Symbol('kBuffer')\nconst kLength = Symbol('kLength')\n\nclass PerMessageDeflate {\n /** @type {import('node:zlib').InflateRaw} */\n #inflate\n\n #options = {}\n\n #maxPayloadSize = 0\n\n /**\n * @param {Map} extensions\n */\n constructor (extensions, options) {\n this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')\n this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')\n\n this.#maxPayloadSize = options.maxPayloadSize\n }\n\n /**\n * Decompress a compressed payload.\n * @param {Buffer} chunk Compressed data\n * @param {boolean} fin Final fragment flag\n * @param {Function} callback Callback function\n */\n decompress (chunk, fin, callback) {\n // An endpoint uses the following algorithm to decompress a message.\n // 1. Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the\n // payload of the message.\n // 2. Decompress the resulting data using DEFLATE.\n if (!this.#inflate) {\n let windowBits = Z_DEFAULT_WINDOWBITS\n\n if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS\n if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {\n callback(new Error('Invalid server_max_window_bits'))\n return\n }\n\n windowBits = Number.parseInt(this.#options.serverMaxWindowBits)\n }\n\n try {\n this.#inflate = createInflateRaw({ windowBits })\n } catch (err) {\n callback(err)\n return\n }\n this.#inflate[kBuffer] = []\n this.#inflate[kLength] = 0\n\n this.#inflate.on('data', (data) => {\n this.#inflate[kLength] += data.length\n\n if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {\n callback(new MessageSizeExceededError())\n this.#inflate.removeAllListeners()\n this.#inflate = null\n return\n }\n\n this.#inflate[kBuffer].push(data)\n })\n\n this.#inflate.on('error', (err) => {\n this.#inflate = null\n callback(err)\n })\n }\n\n this.#inflate.write(chunk)\n if (fin) {\n this.#inflate.write(tail)\n }\n\n this.#inflate.flush(() => {\n if (!this.#inflate) {\n return\n }\n\n const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])\n\n this.#inflate[kBuffer].length = 0\n this.#inflate[kLength] = 0\n\n callback(null, full)\n })\n }\n}\n\nmodule.exports = { PerMessageDeflate }\n","'use strict'\n\nconst { Writable } = require('node:stream')\nconst assert = require('node:assert')\nconst { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require('./constants')\nconst { kReadyState, kSentClose, kResponse, kReceivedClose } = require('./symbols')\nconst { channels } = require('../../core/diagnostics')\nconst {\n isValidStatusCode,\n isValidOpcode,\n failWebsocketConnection,\n websocketMessageReceived,\n utf8Decode,\n isControlFrame,\n isTextBinaryFrame,\n isContinuationFrame\n} = require('./util')\nconst { WebsocketFrameSend } = require('./frame')\nconst { closeWebSocketConnection } = require('./connection')\nconst { PerMessageDeflate } = require('./permessage-deflate')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nfunction failWebsocketConnectionWithCode (ws, code, reason) {\n closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason))\n failWebsocketConnection(ws, reason)\n}\n\n// This code was influenced by ws released under the MIT license.\n// Copyright (c) 2011 Einar Otto Stangvik \n// Copyright (c) 2013 Arnout Kazemier and contributors\n// Copyright (c) 2016 Luigi Pinca and contributors\n\nclass ByteParser extends Writable {\n #buffers = []\n #fragmentsBytes = 0\n #byteOffset = 0\n #loop = false\n\n #state = parserStates.INFO\n\n #info = {}\n #fragments = []\n\n /** @type {Map} */\n #extensions\n\n /** @type {number} */\n #maxFragments\n\n /** @type {number} */\n #maxPayloadSize\n\n /**\n * @param {import('./websocket').WebSocket} ws\n * @param {Map|null} extensions\n * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]\n */\n constructor (ws, extensions, options = {}) {\n super()\n\n this.ws = ws\n this.#extensions = extensions == null ? new Map() : extensions\n this.#maxFragments = options.maxFragments ?? 0\n this.#maxPayloadSize = options.maxPayloadSize ?? 0\n\n if (this.#extensions.has('permessage-deflate')) {\n this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))\n }\n }\n\n /**\n * @param {Buffer} chunk\n * @param {() => void} callback\n */\n _write (chunk, _, callback) {\n this.#buffers.push(chunk)\n this.#byteOffset += chunk.length\n this.#loop = true\n\n this.run(callback)\n }\n\n #validatePayloadLength () {\n if (\n this.#maxPayloadSize > 0 &&\n !isControlFrame(this.#info.opcode) &&\n this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize\n ) {\n failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size')\n return false\n }\n\n return true\n }\n\n /**\n * Runs whenever a new chunk is received.\n * Callback is called whenever there are no more chunks buffering,\n * or not enough bytes are buffered to parse.\n */\n run (callback) {\n while (this.#loop) {\n if (this.#state === parserStates.INFO) {\n // If there aren't enough bytes to parse the payload length, etc.\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n const fin = (buffer[0] & 0x80) !== 0\n const opcode = buffer[0] & 0x0F\n const masked = (buffer[1] & 0x80) === 0x80\n\n const fragmented = !fin && opcode !== opcodes.CONTINUATION\n const payloadLength = buffer[1] & 0x7F\n\n const rsv1 = buffer[0] & 0x40\n const rsv2 = buffer[0] & 0x20\n const rsv3 = buffer[0] & 0x10\n\n if (!isValidOpcode(opcode)) {\n failWebsocketConnection(this.ws, 'Invalid opcode received')\n return callback()\n }\n\n if (masked) {\n failWebsocketConnection(this.ws, 'Frame cannot be masked')\n return callback()\n }\n\n // MUST be 0 unless an extension is negotiated that defines meanings\n // for non-zero values. If a nonzero value is received and none of\n // the negotiated extensions defines the meaning of such a nonzero\n // value, the receiving endpoint MUST _Fail the WebSocket\n // Connection_.\n // This document allocates the RSV1 bit of the WebSocket header for\n // PMCEs and calls the bit the \"Per-Message Compressed\" bit. On a\n // WebSocket connection where a PMCE is in use, this bit indicates\n // whether a message is compressed or not.\n if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {\n failWebsocketConnection(this.ws, 'Expected RSV1 to be clear.')\n return\n }\n\n if (rsv2 !== 0 || rsv3 !== 0) {\n failWebsocketConnection(this.ws, 'RSV1, RSV2, RSV3 must be clear')\n return\n }\n\n if (fragmented && !isTextBinaryFrame(opcode)) {\n // Only text and binary frames can be fragmented\n failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')\n return\n }\n\n // If we are already parsing a text/binary frame and do not receive either\n // a continuation frame or close frame, fail the connection.\n if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {\n failWebsocketConnection(this.ws, 'Expected continuation frame')\n return\n }\n\n if (this.#info.fragmented && fragmented) {\n // A fragmented frame can't be fragmented itself\n failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')\n return\n }\n\n // \"All control frames MUST have a payload length of 125 bytes or less\n // and MUST NOT be fragmented.\"\n if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {\n failWebsocketConnection(this.ws, 'Control frame either too large or fragmented')\n return\n }\n\n if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {\n failWebsocketConnection(this.ws, 'Unexpected continuation frame')\n return\n }\n\n if (payloadLength <= 125) {\n this.#info.payloadLength = payloadLength\n this.#state = parserStates.READ_DATA\n\n if (!this.#validatePayloadLength()) {\n return\n }\n } else if (payloadLength === 126) {\n this.#state = parserStates.PAYLOADLENGTH_16\n } else if (payloadLength === 127) {\n this.#state = parserStates.PAYLOADLENGTH_64\n }\n\n if (isTextBinaryFrame(opcode)) {\n this.#info.binaryType = opcode\n this.#info.compressed = rsv1 !== 0\n }\n\n this.#info.opcode = opcode\n this.#info.masked = masked\n this.#info.fin = fin\n this.#info.fragmented = fragmented\n } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n\n this.#info.payloadLength = buffer.readUInt16BE(0)\n this.#state = parserStates.READ_DATA\n\n if (!this.#validatePayloadLength()) {\n return\n }\n } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n if (this.#byteOffset < 8) {\n return callback()\n }\n\n const buffer = this.consume(8)\n const upper = buffer.readUInt32BE(0)\n const lower = buffer.readUInt32BE(4)\n\n // 2^31 is the maximum bytes an arraybuffer can contain\n // on 32-bit systems. Although, on 64-bit systems, this is\n // 2^53-1 bytes.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n if (upper !== 0 || lower > 2 ** 31 - 1) {\n failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')\n return\n }\n\n this.#info.payloadLength = lower\n this.#state = parserStates.READ_DATA\n\n if (!this.#validatePayloadLength()) {\n return\n }\n } else if (this.#state === parserStates.READ_DATA) {\n if (this.#byteOffset < this.#info.payloadLength) {\n return callback()\n }\n\n const body = this.consume(this.#info.payloadLength)\n\n if (isControlFrame(this.#info.opcode)) {\n this.#loop = this.parseControlFrame(body)\n this.#state = parserStates.INFO\n } else {\n if (!this.#info.compressed) {\n if (!this.writeFragments(body)) {\n return\n }\n\n if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n return\n }\n\n // If the frame is not fragmented, a message has been received.\n // If the frame is fragmented, it will terminate with a fin bit set\n // and an opcode of 0 (continuation), therefore we handle that when\n // parsing continuation frames, not here.\n if (!this.#info.fragmented && this.#info.fin) {\n websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n }\n\n this.#state = parserStates.INFO\n } else {\n this.#extensions.get('permessage-deflate').decompress(\n body,\n this.#info.fin,\n (error, data) => {\n if (error) {\n const code = error instanceof MessageSizeExceededError ? 1009 : 1007\n failWebsocketConnectionWithCode(this.ws, code, error.message)\n return\n }\n\n if (!this.writeFragments(data)) {\n return\n }\n\n if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n return\n }\n\n if (!this.#info.fin) {\n this.#state = parserStates.INFO\n this.#loop = true\n this.run(callback)\n return\n }\n\n websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n\n this.#loop = true\n this.#state = parserStates.INFO\n this.run(callback)\n }\n )\n\n this.#loop = false\n break\n }\n }\n }\n }\n }\n\n /**\n * Take n bytes from the buffered Buffers\n * @param {number} n\n * @returns {Buffer}\n */\n consume (n) {\n if (n > this.#byteOffset) {\n throw new Error('Called consume() before buffers satiated.')\n } else if (n === 0) {\n return emptyBuffer\n }\n\n if (this.#buffers[0].length === n) {\n this.#byteOffset -= this.#buffers[0].length\n return this.#buffers.shift()\n }\n\n const buffer = Buffer.allocUnsafe(n)\n let offset = 0\n\n while (offset !== n) {\n const next = this.#buffers[0]\n const { length } = next\n\n if (length + offset === n) {\n buffer.set(this.#buffers.shift(), offset)\n break\n } else if (length + offset > n) {\n buffer.set(next.subarray(0, n - offset), offset)\n this.#buffers[0] = next.subarray(n - offset)\n break\n } else {\n buffer.set(this.#buffers.shift(), offset)\n offset += next.length\n }\n }\n\n this.#byteOffset -= n\n\n return buffer\n }\n\n writeFragments (fragment) {\n if (\n this.#maxFragments > 0 &&\n this.#fragments.length === this.#maxFragments\n ) {\n failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments')\n return false\n }\n\n this.#fragmentsBytes += fragment.length\n this.#fragments.push(fragment)\n return true\n }\n\n consumeFragments () {\n const fragments = this.#fragments\n\n if (fragments.length === 1) {\n this.#fragmentsBytes = 0\n return fragments.shift()\n }\n\n const output = Buffer.concat(fragments, this.#fragmentsBytes)\n this.#fragments = []\n this.#fragmentsBytes = 0\n\n return output\n }\n\n parseCloseBody (data) {\n assert(data.length !== 1)\n\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n /** @type {number|undefined} */\n let code\n\n if (data.length >= 2) {\n // _The WebSocket Connection Close Code_ is\n // defined as the status code (Section 7.4) contained in the first Close\n // control frame received by the application\n code = data.readUInt16BE(0)\n }\n\n if (code !== undefined && !isValidStatusCode(code)) {\n return { code: 1002, reason: 'Invalid status code', error: true }\n }\n\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6\n /** @type {Buffer} */\n let reason = data.subarray(2)\n\n // Remove BOM\n if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {\n reason = reason.subarray(3)\n }\n\n try {\n reason = utf8Decode(reason)\n } catch {\n return { code: 1007, reason: 'Invalid UTF-8', error: true }\n }\n\n return { code, reason, error: false }\n }\n\n /**\n * Parses control frames.\n * @param {Buffer} body\n */\n parseControlFrame (body) {\n const { opcode, payloadLength } = this.#info\n\n if (opcode === opcodes.CLOSE) {\n if (payloadLength === 1) {\n failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')\n return false\n }\n\n this.#info.closeInfo = this.parseCloseBody(body)\n\n if (this.#info.closeInfo.error) {\n const { code, reason } = this.#info.closeInfo\n\n closeWebSocketConnection(this.ws, code, reason, reason.length)\n failWebsocketConnection(this.ws, reason)\n return false\n }\n\n if (this.ws[kSentClose] !== sentCloseFrameState.SENT) {\n // If an endpoint receives a Close frame and did not previously send a\n // Close frame, the endpoint MUST send a Close frame in response. (When\n // sending a Close frame in response, the endpoint typically echos the\n // status code it received.)\n let body = emptyBuffer\n if (this.#info.closeInfo.code) {\n body = Buffer.allocUnsafe(2)\n body.writeUInt16BE(this.#info.closeInfo.code, 0)\n }\n const closeFrame = new WebsocketFrameSend(body)\n\n this.ws[kResponse].socket.write(\n closeFrame.createFrame(opcodes.CLOSE),\n (err) => {\n if (!err) {\n this.ws[kSentClose] = sentCloseFrameState.SENT\n }\n }\n )\n }\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n this.ws[kReadyState] = states.CLOSING\n this.ws[kReceivedClose] = true\n\n return false\n } else if (opcode === opcodes.PING) {\n // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n // response, unless it already received a Close frame.\n // A Pong frame sent in response to a Ping frame must have identical\n // \"Application data\"\n\n if (!this.ws[kReceivedClose]) {\n const frame = new WebsocketFrameSend(body)\n\n this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))\n\n if (channels.ping.hasSubscribers) {\n channels.ping.publish({\n payload: body\n })\n }\n }\n } else if (opcode === opcodes.PONG) {\n // A Pong frame MAY be sent unsolicited. This serves as a\n // unidirectional heartbeat. A response to an unsolicited Pong frame is\n // not expected.\n\n if (channels.pong.hasSubscribers) {\n channels.pong.publish({\n payload: body\n })\n }\n }\n\n return true\n }\n\n get closingInfo () {\n return this.#info.closeInfo\n }\n}\n\nmodule.exports = {\n ByteParser\n}\n","'use strict'\n\nconst { WebsocketFrameSend } = require('./frame')\nconst { opcodes, sendHints } = require('./constants')\nconst FixedQueue = require('../../dispatcher/fixed-queue')\n\n/** @type {typeof Uint8Array} */\nconst FastBuffer = Buffer[Symbol.species]\n\n/**\n * @typedef {object} SendQueueNode\n * @property {Promise | null} promise\n * @property {((...args: any[]) => any)} callback\n * @property {Buffer | null} frame\n */\n\nclass SendQueue {\n /**\n * @type {FixedQueue}\n */\n #queue = new FixedQueue()\n\n /**\n * @type {boolean}\n */\n #running = false\n\n /** @type {import('node:net').Socket} */\n #socket\n\n constructor (socket) {\n this.#socket = socket\n }\n\n add (item, cb, hint) {\n if (hint !== sendHints.blob) {\n const frame = createFrame(item, hint)\n if (!this.#running) {\n // fast-path\n this.#socket.write(frame, cb)\n } else {\n /** @type {SendQueueNode} */\n const node = {\n promise: null,\n callback: cb,\n frame\n }\n this.#queue.push(node)\n }\n return\n }\n\n /** @type {SendQueueNode} */\n const node = {\n promise: item.arrayBuffer().then((ab) => {\n node.promise = null\n node.frame = createFrame(ab, hint)\n }),\n callback: cb,\n frame: null\n }\n\n this.#queue.push(node)\n\n if (!this.#running) {\n this.#run()\n }\n }\n\n async #run () {\n this.#running = true\n const queue = this.#queue\n while (!queue.isEmpty()) {\n const node = queue.shift()\n // wait pending promise\n if (node.promise !== null) {\n await node.promise\n }\n // write\n this.#socket.write(node.frame, node.callback)\n // cleanup\n node.callback = node.frame = null\n }\n this.#running = false\n }\n}\n\nfunction createFrame (data, hint) {\n return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY)\n}\n\nfunction toBuffer (data, hint) {\n switch (hint) {\n case sendHints.string:\n return Buffer.from(data)\n case sendHints.arrayBuffer:\n case sendHints.blob:\n return new FastBuffer(data)\n case sendHints.typedArray:\n return new FastBuffer(data.buffer, data.byteOffset, data.byteLength)\n }\n}\n\nmodule.exports = { SendQueue }\n","'use strict'\n\nmodule.exports = {\n kWebSocketURL: Symbol('url'),\n kReadyState: Symbol('ready state'),\n kController: Symbol('controller'),\n kResponse: Symbol('response'),\n kBinaryType: Symbol('binary type'),\n kSentClose: Symbol('sent close'),\n kReceivedClose: Symbol('received close'),\n kByteParser: Symbol('byte parser')\n}\n","'use strict'\n\nconst { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require('./symbols')\nconst { states, opcodes } = require('./constants')\nconst { ErrorEvent, createFastMessageEvent } = require('./events')\nconst { isUtf8 } = require('node:buffer')\nconst { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require('../fetch/data-url')\n\n/* globals Blob */\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isConnecting (ws) {\n // If the WebSocket connection is not yet established, and the connection\n // is not yet closed, then the WebSocket connection is in the CONNECTING state.\n return ws[kReadyState] === states.CONNECTING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isEstablished (ws) {\n // If the server's response is validated as provided for above, it is\n // said that _The WebSocket Connection is Established_ and that the\n // WebSocket Connection is in the OPEN state.\n return ws[kReadyState] === states.OPEN\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosing (ws) {\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n return ws[kReadyState] === states.CLOSING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosed (ws) {\n return ws[kReadyState] === states.CLOSED\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e\n * @param {EventTarget} target\n * @param {(...args: ConstructorParameters) => Event} eventFactory\n * @param {EventInit | undefined} eventInitDict\n */\nfunction fireEvent (e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {\n // 1. If eventConstructor is not given, then let eventConstructor be Event.\n\n // 2. Let event be the result of creating an event given eventConstructor,\n // in the relevant realm of target.\n // 3. Initialize event’s type attribute to e.\n const event = eventFactory(e, eventInitDict)\n\n // 4. Initialize any other IDL attributes of event as described in the\n // invocation of this algorithm.\n\n // 5. Return the result of dispatching event at target, with legacy target\n // override flag set if set.\n target.dispatchEvent(event)\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @param {import('./websocket').WebSocket} ws\n * @param {number} type Opcode\n * @param {Buffer} data application data\n */\nfunction websocketMessageReceived (ws, type, data) {\n // 1. If ready state is not OPEN (1), then return.\n if (ws[kReadyState] !== states.OPEN) {\n return\n }\n\n // 2. Let dataForEvent be determined by switching on type and binary type:\n let dataForEvent\n\n if (type === opcodes.TEXT) {\n // -> type indicates that the data is Text\n // a new DOMString containing data\n try {\n dataForEvent = utf8Decode(data)\n } catch {\n failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')\n return\n }\n } else if (type === opcodes.BINARY) {\n if (ws[kBinaryType] === 'blob') {\n // -> type indicates that the data is Binary and binary type is \"blob\"\n // a new Blob object, created in the relevant Realm of the WebSocket\n // object, that represents data as its raw data\n dataForEvent = new Blob([data])\n } else {\n // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n // a new ArrayBuffer object, created in the relevant Realm of the\n // WebSocket object, whose contents are data\n dataForEvent = toArrayBuffer(data)\n }\n }\n\n // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n // with the origin attribute initialized to the serialization of the WebSocket\n // object’s url's origin, and the data attribute initialized to dataForEvent.\n fireEvent('message', ws, createFastMessageEvent, {\n origin: ws[kWebSocketURL].origin,\n data: dataForEvent\n })\n}\n\nfunction toArrayBuffer (buffer) {\n if (buffer.byteLength === buffer.buffer.byteLength) {\n return buffer.buffer\n }\n return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455\n * @see https://datatracker.ietf.org/doc/html/rfc2616\n * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407\n * @param {string} protocol\n */\nfunction isValidSubprotocol (protocol) {\n // If present, this value indicates one\n // or more comma-separated subprotocol the client wishes to speak,\n // ordered by preference. The elements that comprise this value\n // MUST be non-empty strings with characters in the range U+0021 to\n // U+007E not including separator characters as defined in\n // [RFC2616] and MUST all be unique strings.\n if (protocol.length === 0) {\n return false\n }\n\n for (let i = 0; i < protocol.length; ++i) {\n const code = protocol.charCodeAt(i)\n\n if (\n code < 0x21 || // CTL, contains SP (0x20) and HT (0x09)\n code > 0x7E ||\n code === 0x22 || // \"\n code === 0x28 || // (\n code === 0x29 || // )\n code === 0x2C || // ,\n code === 0x2F || // /\n code === 0x3A || // :\n code === 0x3B || // ;\n code === 0x3C || // <\n code === 0x3D || // =\n code === 0x3E || // >\n code === 0x3F || // ?\n code === 0x40 || // @\n code === 0x5B || // [\n code === 0x5C || // \\\n code === 0x5D || // ]\n code === 0x7B || // {\n code === 0x7D // }\n ) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4\n * @param {number} code\n */\nfunction isValidStatusCode (code) {\n if (code >= 1000 && code < 1015) {\n return (\n code !== 1004 && // reserved\n code !== 1005 && // \"MUST NOT be set as a status code\"\n code !== 1006 // \"MUST NOT be set as a status code\"\n )\n }\n\n return code >= 3000 && code <= 4999\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @param {string|undefined} reason\n */\nfunction failWebsocketConnection (ws, reason) {\n const { [kController]: controller, [kResponse]: response } = ws\n\n controller.abort()\n\n if (response?.socket && !response.socket.destroyed) {\n response.socket.destroy()\n }\n\n if (reason) {\n // TODO: process.nextTick\n fireEvent('error', ws, (type, init) => new ErrorEvent(type, init), {\n error: new Error(reason),\n message: reason\n })\n }\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5\n * @param {number} opcode\n */\nfunction isControlFrame (opcode) {\n return (\n opcode === opcodes.CLOSE ||\n opcode === opcodes.PING ||\n opcode === opcodes.PONG\n )\n}\n\nfunction isContinuationFrame (opcode) {\n return opcode === opcodes.CONTINUATION\n}\n\nfunction isTextBinaryFrame (opcode) {\n return opcode === opcodes.TEXT || opcode === opcodes.BINARY\n}\n\nfunction isValidOpcode (opcode) {\n return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode)\n}\n\n/**\n * Parses a Sec-WebSocket-Extensions header value.\n * @param {string} extensions\n * @returns {Map}\n */\n// TODO(@Uzlopak, @KhafraDev): make compliant https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\nfunction parseExtensions (extensions) {\n const position = { position: 0 }\n const extensionList = new Map()\n\n while (position.position < extensions.length) {\n const pair = collectASequenceOfCodePointsFast(';', extensions, position)\n const [name, value = ''] = pair.split('=')\n\n extensionList.set(\n removeHTTPWhitespace(name, true, false),\n removeHTTPWhitespace(value, false, true)\n )\n\n position.position++\n }\n\n return extensionList\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2\n * @description \"client-max-window-bits = 1*DIGIT\"\n * @param {string} value\n */\nfunction isValidClientWindowBits (value) {\n // Must have at least one character\n if (value.length === 0) {\n return false\n }\n\n // Check all characters are ASCII digits\n for (let i = 0; i < value.length; i++) {\n const byte = value.charCodeAt(i)\n\n if (byte < 0x30 || byte > 0x39) {\n return false\n }\n }\n\n // Check numeric range: zlib requires windowBits in range 8-15\n const num = Number.parseInt(value, 10)\n return num >= 8 && num <= 15\n}\n\n// https://nodejs.org/api/intl.html#detecting-internationalization-support\nconst hasIntl = typeof process.versions.icu === 'string'\nconst fatalDecoder = hasIntl ? new TextDecoder('utf-8', { fatal: true }) : undefined\n\n/**\n * Converts a Buffer to utf-8, even on platforms without icu.\n * @param {Buffer} buffer\n */\nconst utf8Decode = hasIntl\n ? fatalDecoder.decode.bind(fatalDecoder)\n : function (buffer) {\n if (isUtf8(buffer)) {\n return buffer.toString('utf-8')\n }\n throw new TypeError('Invalid utf-8 received.')\n }\n\nmodule.exports = {\n isConnecting,\n isEstablished,\n isClosing,\n isClosed,\n fireEvent,\n isValidSubprotocol,\n isValidStatusCode,\n failWebsocketConnection,\n websocketMessageReceived,\n utf8Decode,\n isControlFrame,\n isContinuationFrame,\n isTextBinaryFrame,\n isValidOpcode,\n parseExtensions,\n isValidClientWindowBits\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { environmentSettingsObject } = require('../fetch/util')\nconst { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require('./constants')\nconst {\n kWebSocketURL,\n kReadyState,\n kController,\n kBinaryType,\n kResponse,\n kSentClose,\n kByteParser\n} = require('./symbols')\nconst {\n isConnecting,\n isEstablished,\n isClosing,\n isValidSubprotocol,\n fireEvent\n} = require('./util')\nconst { establishWebSocketConnection, closeWebSocketConnection } = require('./connection')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty, isBlobLike } = require('../../core/util')\nconst { getGlobalDispatcher } = require('../../global')\nconst { types } = require('node:util')\nconst { ErrorEvent, CloseEvent } = require('./events')\nconst { SendQueue } = require('./sender')\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n #events = {\n open: null,\n error: null,\n close: null,\n message: null\n }\n\n #bufferedAmount = 0\n #protocol = ''\n #extensions = ''\n\n /** @type {SendQueue} */\n #sendQueue\n\n /**\n * @param {string} url\n * @param {string|string[]} protocols\n */\n constructor (url, protocols = []) {\n super()\n\n webidl.util.markAsUncloneable(this)\n\n const prefix = 'WebSocket constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols, prefix, 'options')\n\n url = webidl.converters.USVString(url, prefix, 'url')\n protocols = options.protocols\n\n // 1. Let baseURL be this's relevant settings object's API base URL.\n const baseURL = environmentSettingsObject.settingsObject.baseUrl\n\n // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.\n let urlRecord\n\n try {\n urlRecord = new URL(url, baseURL)\n } catch (e) {\n // 3. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n throw new DOMException(e, 'SyntaxError')\n }\n\n // 4. If urlRecord’s scheme is \"http\", then set urlRecord’s scheme to \"ws\".\n if (urlRecord.protocol === 'http:') {\n urlRecord.protocol = 'ws:'\n } else if (urlRecord.protocol === 'https:') {\n // 5. Otherwise, if urlRecord’s scheme is \"https\", set urlRecord’s scheme to \"wss\".\n urlRecord.protocol = 'wss:'\n }\n\n // 6. If urlRecord’s scheme is not \"ws\" or \"wss\", then throw a \"SyntaxError\" DOMException.\n if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {\n throw new DOMException(\n `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,\n 'SyntaxError'\n )\n }\n\n // 7. If urlRecord’s fragment is non-null, then throw a \"SyntaxError\"\n // DOMException.\n if (urlRecord.hash || urlRecord.href.endsWith('#')) {\n throw new DOMException('Got fragment', 'SyntaxError')\n }\n\n // 8. If protocols is a string, set protocols to a sequence consisting\n // of just that string.\n if (typeof protocols === 'string') {\n protocols = [protocols]\n }\n\n // 9. If any of the values in protocols occur more than once or otherwise\n // fail to match the requirements for elements that comprise the value\n // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n // protocol, then throw a \"SyntaxError\" DOMException.\n if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n // 10. Set this's url to urlRecord.\n this[kWebSocketURL] = new URL(urlRecord.href)\n\n // 11. Let client be this's relevant settings object.\n const client = environmentSettingsObject.settingsObject\n\n // 12. Run this step in parallel:\n\n // 1. Establish a WebSocket connection given urlRecord, protocols,\n // and client.\n this[kController] = establishWebSocketConnection(\n urlRecord,\n protocols,\n client,\n this,\n (response, extensions) => this.#onConnectionEstablished(response, extensions),\n options\n )\n\n // Each WebSocket object has an associated ready state, which is a\n // number representing the state of the connection. Initially it must\n // be CONNECTING (0).\n this[kReadyState] = WebSocket.CONNECTING\n\n this[kSentClose] = sentCloseFrameState.NOT_SENT\n\n // The extensions attribute must initially return the empty string.\n\n // The protocol attribute must initially return the empty string.\n\n // Each WebSocket object has an associated binary type, which is a\n // BinaryType. Initially it must be \"blob\".\n this[kBinaryType] = 'blob'\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n * @param {number|undefined} code\n * @param {string|undefined} reason\n */\n close (code = undefined, reason = undefined) {\n webidl.brandCheck(this, WebSocket)\n\n const prefix = 'WebSocket.close'\n\n if (code !== undefined) {\n code = webidl.converters['unsigned short'](code, prefix, 'code', { clamp: true })\n }\n\n if (reason !== undefined) {\n reason = webidl.converters.USVString(reason, prefix, 'reason')\n }\n\n // 1. If code is present, but is neither an integer equal to 1000 nor an\n // integer in the range 3000 to 4999, inclusive, throw an\n // \"InvalidAccessError\" DOMException.\n if (code !== undefined) {\n if (code !== 1000 && (code < 3000 || code > 4999)) {\n throw new DOMException('invalid code', 'InvalidAccessError')\n }\n }\n\n let reasonByteLength = 0\n\n // 2. If reason is present, then run these substeps:\n if (reason !== undefined) {\n // 1. Let reasonBytes be the result of encoding reason.\n // 2. If reasonBytes is longer than 123 bytes, then throw a\n // \"SyntaxError\" DOMException.\n reasonByteLength = Buffer.byteLength(reason)\n\n if (reasonByteLength > 123) {\n throw new DOMException(\n `Reason must be less than 123 bytes; received ${reasonByteLength}`,\n 'SyntaxError'\n )\n }\n }\n\n // 3. Run the first matching steps from the following list:\n closeWebSocketConnection(this, code, reason, reasonByteLength)\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n */\n send (data) {\n webidl.brandCheck(this, WebSocket)\n\n const prefix = 'WebSocket.send'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n data = webidl.converters.WebSocketSendData(data, prefix, 'data')\n\n // 1. If this's ready state is CONNECTING, then throw an\n // \"InvalidStateError\" DOMException.\n if (isConnecting(this)) {\n throw new DOMException('Sent before connected.', 'InvalidStateError')\n }\n\n // 2. Run the appropriate set of steps from the following list:\n // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n if (!isEstablished(this) || isClosing(this)) {\n return\n }\n\n // If data is a string\n if (typeof data === 'string') {\n // If the WebSocket connection is established and the WebSocket\n // closing handshake has not yet started, then the user agent\n // must send a WebSocket Message comprised of the data argument\n // using a text frame opcode; if the data cannot be sent, e.g.\n // because it would need to be buffered but the buffer is full,\n // the user agent must flag the WebSocket as full and then close\n // the WebSocket connection. Any invocation of this method with a\n // string argument that does not throw an exception must increase\n // the bufferedAmount attribute by the number of bytes needed to\n // express the argument as UTF-8.\n\n const length = Buffer.byteLength(data)\n\n this.#bufferedAmount += length\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= length\n }, sendHints.string)\n } else if (types.isArrayBuffer(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need\n // to be buffered but the buffer is full, the user agent must flag\n // the WebSocket as full and then close the WebSocket connection.\n // The data to be sent is the data stored in the buffer described\n // by the ArrayBuffer object. Any invocation of this method with an\n // ArrayBuffer argument that does not throw an exception must\n // increase the bufferedAmount attribute by the length of the\n // ArrayBuffer in bytes.\n\n this.#bufferedAmount += data.byteLength\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= data.byteLength\n }, sendHints.arrayBuffer)\n } else if (ArrayBuffer.isView(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need to\n // be buffered but the buffer is full, the user agent must flag the\n // WebSocket as full and then close the WebSocket connection. The\n // data to be sent is the data stored in the section of the buffer\n // described by the ArrayBuffer object that data references. Any\n // invocation of this method with this kind of argument that does\n // not throw an exception must increase the bufferedAmount attribute\n // by the length of data’s buffer in bytes.\n\n this.#bufferedAmount += data.byteLength\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= data.byteLength\n }, sendHints.typedArray)\n } else if (isBlobLike(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need to\n // be buffered but the buffer is full, the user agent must flag the\n // WebSocket as full and then close the WebSocket connection. The data\n // to be sent is the raw data represented by the Blob object. Any\n // invocation of this method with a Blob argument that does not throw\n // an exception must increase the bufferedAmount attribute by the size\n // of the Blob object’s raw data, in bytes.\n\n this.#bufferedAmount += data.size\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= data.size\n }, sendHints.blob)\n }\n }\n\n get readyState () {\n webidl.brandCheck(this, WebSocket)\n\n // The readyState getter steps are to return this's ready state.\n return this[kReadyState]\n }\n\n get bufferedAmount () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#bufferedAmount\n }\n\n get url () {\n webidl.brandCheck(this, WebSocket)\n\n // The url getter steps are to return this's url, serialized.\n return URLSerializer(this[kWebSocketURL])\n }\n\n get extensions () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#extensions\n }\n\n get protocol () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#protocol\n }\n\n get onopen () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.open\n }\n\n set onopen (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.open) {\n this.removeEventListener('open', this.#events.open)\n }\n\n if (typeof fn === 'function') {\n this.#events.open = fn\n this.addEventListener('open', fn)\n } else {\n this.#events.open = null\n }\n }\n\n get onerror () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.error\n }\n\n set onerror (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.error) {\n this.removeEventListener('error', this.#events.error)\n }\n\n if (typeof fn === 'function') {\n this.#events.error = fn\n this.addEventListener('error', fn)\n } else {\n this.#events.error = null\n }\n }\n\n get onclose () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.close\n }\n\n set onclose (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.close) {\n this.removeEventListener('close', this.#events.close)\n }\n\n if (typeof fn === 'function') {\n this.#events.close = fn\n this.addEventListener('close', fn)\n } else {\n this.#events.close = null\n }\n }\n\n get onmessage () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.message\n }\n\n set onmessage (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.message) {\n this.removeEventListener('message', this.#events.message)\n }\n\n if (typeof fn === 'function') {\n this.#events.message = fn\n this.addEventListener('message', fn)\n } else {\n this.#events.message = null\n }\n }\n\n get binaryType () {\n webidl.brandCheck(this, WebSocket)\n\n return this[kBinaryType]\n }\n\n set binaryType (type) {\n webidl.brandCheck(this, WebSocket)\n\n if (type !== 'blob' && type !== 'arraybuffer') {\n this[kBinaryType] = 'blob'\n } else {\n this[kBinaryType] = type\n }\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n */\n #onConnectionEstablished (response, parsedExtensions) {\n // processResponse is called when the \"response's header list has been received and initialized.\"\n // once this happens, the connection is open\n this[kResponse] = response\n\n const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions\n const maxFragments = webSocketOptions?.maxFragments\n const maxPayloadSize = webSocketOptions?.maxPayloadSize\n\n const parser = new ByteParser(this, parsedExtensions, {\n maxFragments,\n maxPayloadSize\n })\n parser.on('drain', onParserDrain)\n parser.on('error', onParserError.bind(this))\n\n response.socket.ws = this\n this[kByteParser] = parser\n\n this.#sendQueue = new SendQueue(response.socket)\n\n // 1. Change the ready state to OPEN (1).\n this[kReadyState] = states.OPEN\n\n // 2. Change the extensions attribute’s value to the extensions in use, if\n // it is not the null value.\n // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n const extensions = response.headersList.get('sec-websocket-extensions')\n\n if (extensions !== null) {\n this.#extensions = extensions\n }\n\n // 3. Change the protocol attribute’s value to the subprotocol in use, if\n // it is not the null value.\n // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n const protocol = response.headersList.get('sec-websocket-protocol')\n\n if (protocol !== null) {\n this.#protocol = protocol\n }\n\n // 4. Fire an event named open at the WebSocket object.\n fireEvent('open', this)\n }\n}\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n CONNECTING: staticPropertyDescriptors,\n OPEN: staticPropertyDescriptors,\n CLOSING: staticPropertyDescriptors,\n CLOSED: staticPropertyDescriptors,\n url: kEnumerableProperty,\n readyState: kEnumerableProperty,\n bufferedAmount: kEnumerableProperty,\n onopen: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onclose: kEnumerableProperty,\n close: kEnumerableProperty,\n onmessage: kEnumerableProperty,\n binaryType: kEnumerableProperty,\n send: kEnumerableProperty,\n extensions: kEnumerableProperty,\n protocol: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'WebSocket',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nObject.defineProperties(WebSocket, {\n CONNECTING: staticPropertyDescriptors,\n OPEN: staticPropertyDescriptors,\n CLOSING: staticPropertyDescriptors,\n CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence'] = function (V, prefix, argument) {\n if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {\n return webidl.converters['sequence'](V)\n }\n\n return webidl.converters.DOMString(V, prefix, argument)\n}\n\n// This implements the proposal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n {\n key: 'protocols',\n converter: webidl.converters['DOMString or sequence'],\n defaultValue: () => new Array(0)\n },\n {\n key: 'dispatcher',\n converter: webidl.converters.any,\n defaultValue: () => getGlobalDispatcher()\n },\n {\n key: 'headers',\n converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n }\n])\n\nwebidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {\n if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {\n return webidl.converters.WebSocketInit(V)\n }\n\n return { protocols: webidl.converters['DOMString or sequence'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n if (webidl.util.Type(V) === 'Object') {\n if (isBlobLike(V)) {\n return webidl.converters.Blob(V, { strict: false })\n }\n\n if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n return webidl.converters.BufferSource(V)\n }\n }\n\n return webidl.converters.USVString(V)\n}\n\nfunction onParserDrain () {\n this.ws[kResponse].socket.resume()\n}\n\nfunction onParserError (err) {\n let message\n let code\n\n if (err instanceof CloseEvent) {\n message = err.reason\n code = err.code\n } else {\n message = err.message\n }\n\n fireEvent('error', this, () => new ErrorEvent('error', { error: err, message }))\n\n closeWebSocketConnection(this, code)\n}\n\nmodule.exports = {\n WebSocket\n}\n","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"https\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:async_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:buffer\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:console\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:crypto\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:diagnostics_channel\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:dns\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs/promises\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http2\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:path\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:perf_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:querystring\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:url\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util/types\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:worker_threads\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:zlib\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"string_decoder\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\\/\\/\\/\\w:/) ? 1 : 0, -1) + \"/\";","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"os\");","// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nexport function toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nexport function toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\n//# sourceMappingURL=utils.js.map","import * as os from 'os';\nimport { toCommandValue } from './utils.js';\n/**\n * Issues a command to the GitHub Actions runner\n *\n * @param command - The command name to issue\n * @param properties - Additional properties for the command (key-value pairs)\n * @param message - The message to include with the command\n * @remarks\n * This function outputs a specially formatted string to stdout that the Actions\n * runner interprets as a command. These commands can control workflow behavior,\n * set outputs, create annotations, mask values, and more.\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * @example\n * ```typescript\n * // Issue a warning annotation\n * issueCommand('warning', {}, 'This is a warning message');\n * // Output: ::warning::This is a warning message\n *\n * // Set an environment variable\n * issueCommand('set-env', { name: 'MY_VAR' }, 'some value');\n * // Output: ::set-env name=MY_VAR::some value\n *\n * // Add a secret mask\n * issueCommand('add-mask', {}, 'secretValue123');\n * // Output: ::add-mask::secretValue123\n * ```\n *\n * @internal\n * This is an internal utility function that powers the public API functions\n * such as setSecret, warning, error, and exportVariable.\n */\nexport function issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexport function issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"crypto\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"fs\");","// For internal use, subject to change.\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as crypto from 'crypto';\nimport * as fs from 'fs';\nimport * as os from 'os';\nimport { toCommandValue } from './utils.js';\nexport function issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexport function prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${crypto.randomUUID()}`;\n const convertedValue = toCommandValue(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\n//# sourceMappingURL=file-command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"path\");","export function getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n try {\n return new DecodedURL(proxyVar);\n }\n catch (_a) {\n if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))\n return new DecodedURL(`http://${proxyVar}`);\n }\n }\n else {\n return undefined;\n }\n}\nexport function checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const reqHost = reqUrl.hostname;\n if (isLoopbackAddress(reqHost)) {\n return true;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperNoProxyItem === '*' ||\n upperReqHosts.some(x => x === upperNoProxyItem ||\n x.endsWith(`.${upperNoProxyItem}`) ||\n (upperNoProxyItem.startsWith('.') &&\n x.endsWith(`${upperNoProxyItem}`)))) {\n return true;\n }\n }\n return false;\n}\nfunction isLoopbackAddress(host) {\n const hostLower = host.toLowerCase();\n return (hostLower === 'localhost' ||\n hostLower.startsWith('127.') ||\n hostLower.startsWith('[::1]') ||\n hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\nclass DecodedURL extends URL {\n constructor(url, base) {\n super(url, base);\n this._decodedUsername = decodeURIComponent(super.username);\n this._decodedPassword = decodeURIComponent(super.password);\n }\n get username() {\n return this._decodedUsername;\n }\n get password() {\n return this._decodedPassword;\n }\n}\n//# sourceMappingURL=proxy.js.map","/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as pm from './proxy.js';\nimport * as tunnel from 'tunnel';\nimport { ProxyAgent } from 'undici';\nexport var HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes || (HttpCodes = {}));\nexport var Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers || (Headers = {}));\nexport var MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes || (MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nexport function getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nexport class HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexport class HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n readBodyBuffer() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n const chunks = [];\n this.message.on('data', (chunk) => {\n chunks.push(chunk);\n });\n this.message.on('end', () => {\n resolve(Buffer.concat(chunks));\n });\n }));\n });\n }\n}\nexport function isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexport class HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl_1) {\n return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl_1, obj_1) {\n return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] =\n this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl_1, obj_1) {\n return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] =\n this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl_1, obj_1) {\n return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] =\n this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n getAgentDispatcher(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (!useProxy) {\n return;\n }\n return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n /**\n * Gets an existing header value or returns a default.\n * Handles converting number header values to strings since HTTP headers must be strings.\n * Note: This returns string | string[] since some headers can have multiple values.\n * For headers that must always be a single string (like Content-Type), use the\n * specialized _getExistingOrDefaultContentTypeHeader method instead.\n */\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n const headerValue = lowercaseKeys(this.requestOptions.headers)[header];\n if (headerValue) {\n clientHeader =\n typeof headerValue === 'number' ? headerValue.toString() : headerValue;\n }\n }\n const additionalValue = additionalHeaders[header];\n if (additionalValue !== undefined) {\n return typeof additionalValue === 'number'\n ? additionalValue.toString()\n : additionalValue;\n }\n if (clientHeader !== undefined) {\n return clientHeader;\n }\n return _default;\n }\n /**\n * Specialized version of _getExistingOrDefaultHeader for Content-Type header.\n * Always returns a single string (not an array) since Content-Type should be a single value.\n * Converts arrays to comma-separated strings and numbers to strings to ensure type safety.\n * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers\n * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).\n */\n _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];\n if (headerValue) {\n if (typeof headerValue === 'number') {\n clientHeader = String(headerValue);\n }\n else if (Array.isArray(headerValue)) {\n clientHeader = headerValue.join(', ');\n }\n else {\n clientHeader = headerValue;\n }\n }\n }\n const additionalValue = additionalHeaders[Headers.ContentType];\n // Return the first non-undefined value, converting numbers or arrays to strings if necessary\n if (additionalValue !== undefined) {\n if (typeof additionalValue === 'number') {\n return String(additionalValue);\n }\n else if (Array.isArray(additionalValue)) {\n return additionalValue.join(', ');\n }\n else {\n return additionalValue;\n }\n }\n if (clientHeader !== undefined) {\n return clientHeader;\n }\n return _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (!useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if tunneling agent isn't assigned create a new agent\n if (!agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _getProxyAgentDispatcher(parsedUrl, proxyUrl) {\n let proxyAgent;\n if (this._keepAlive) {\n proxyAgent = this._proxyAgentDispatcher;\n }\n // if agent is already assigned use that agent.\n if (proxyAgent) {\n return proxyAgent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n proxyAgent = new ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {\n token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`\n })));\n this._proxyAgentDispatcher = proxyAgent;\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {\n rejectUnauthorized: false\n });\n }\n return proxyAgent;\n }\n _getUserAgentWithOrchestrationId(userAgent) {\n const baseUserAgent = userAgent || 'actions/http-client';\n const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];\n if (orchId) {\n // Sanitize the orchestration ID to ensure it contains only valid characters\n // Valid characters: 0-9, a-z, _, -, .\n const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');\n return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;\n }\n return baseUserAgent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nexport class BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexport class BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexport class PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\n//# sourceMappingURL=auth.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { HttpClient } from '@actions/http-client';\nimport { BearerCredentialHandler } from '@actions/http-client/lib/auth';\nimport { debug, setSecret } from './core.js';\nexport class OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new HttpClient('actions/oidc-client', [new BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a;\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\n//# sourceMappingURL=oidc-utils.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { EOL } from 'os';\nimport { constants, promises } from 'fs';\nconst { access, appendFile, writeFile } = promises;\nexport const SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexport const SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, constants.R_OK | constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexport const markdownSummary = _summary;\nexport const summary = _summary;\n//# sourceMappingURL=summary.js.map","import * as path from 'path';\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nexport function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nexport function toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nexport function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\n//# sourceMappingURL=path-utils.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"child_process\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as fs from 'fs';\nimport * as path from 'path';\nexport const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises;\n// export const {open} = 'fs'\nexport const IS_WINDOWS = process.platform === 'win32';\n/**\n * Custom implementation of readlink to ensure Windows junctions\n * maintain trailing backslash for backward compatibility with Node.js < 24\n *\n * In Node.js 20, Windows junctions (directory symlinks) always returned paths\n * with trailing backslashes. Node.js 24 removed this behavior, which breaks\n * code that relied on this format for path operations.\n *\n * This implementation restores the Node 20 behavior by adding a trailing\n * backslash to all junction results on Windows.\n */\nexport function readlink(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield fs.promises.readlink(fsPath);\n // On Windows, restore Node 20 behavior: add trailing backslash to all results\n // since junctions on Windows are always directory links\n if (IS_WINDOWS && !result.endsWith('\\\\')) {\n return `${result}\\\\`;\n }\n return result;\n });\n}\n// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691\nexport const UV_FS_O_EXLOCK = 0x10000000;\nexport const READONLY = fs.constants.O_RDONLY;\nexport function exists(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n yield stat(fsPath);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n }\n return true;\n });\n}\nexport function isDirectory(fsPath_1) {\n return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) {\n const stats = useStat ? yield stat(fsPath) : yield lstat(fsPath);\n return stats.isDirectory();\n });\n}\n/**\n * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:\n * \\, \\hello, \\\\hello\\share, C:, and C:\\hello (and corresponding alternate separator cases).\n */\nexport function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}\n/**\n * Best effort attempt to determine whether a file exists and is executable.\n * @param filePath file path to check\n * @param extensions additional file extensions to try\n * @return if file exists and is executable, returns the file path. otherwise empty string.\n */\nexport function tryGetExecutablePath(filePath, extensions) {\n return __awaiter(this, void 0, void 0, function* () {\n let stats = undefined;\n try {\n // test file exists\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // on Windows, test for valid extension\n const upperExt = path.extname(filePath).toUpperCase();\n if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {\n return filePath;\n }\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n // try each extension\n const originalFilePath = filePath;\n for (const extension of extensions) {\n filePath = originalFilePath + extension;\n stats = undefined;\n try {\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // preserve the case of the actual file (since an extension was appended)\n try {\n const directory = path.dirname(filePath);\n const upperName = path.basename(filePath).toUpperCase();\n for (const actualName of yield readdir(directory)) {\n if (upperName === actualName.toUpperCase()) {\n filePath = path.join(directory, actualName);\n break;\n }\n }\n }\n catch (err) {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);\n }\n return filePath;\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n }\n return '';\n });\n}\nfunction normalizeSeparators(p) {\n p = p || '';\n if (IS_WINDOWS) {\n // convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // remove redundant slashes\n return p.replace(/\\\\\\\\+/g, '\\\\');\n }\n // remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n// on Mac/Linux, test the execute bit\n// R W X R W X R W X\n// 256 128 64 32 16 8 4 2 1\nfunction isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 &&\n process.getgid !== undefined &&\n stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 &&\n process.getuid !== undefined &&\n stats.uid === process.getuid()));\n}\n// Get the path of cmd.exe in windows\nexport function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}\n//# sourceMappingURL=io-util.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ok } from 'assert';\nimport * as path from 'path';\nimport * as ioUtil from './io-util.js';\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nexport function cp(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n const { force, recursive, copySourceDirectory } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory() && copySourceDirectory\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nexport function mv(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nexport function rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Check for invalid characters\n // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n if (/[*\"<>|]/.test(inputPath)) {\n throw new Error('File path must not contain `*`, `\"`, `<`, `>` or `|` on Windows');\n }\n }\n try {\n // note if path does not exist, error is silent\n yield ioUtil.rm(inputPath, {\n force: true,\n maxRetries: 3,\n recursive: true,\n retryDelay: 300\n });\n }\n catch (err) {\n throw new Error(`File was unable to be removed ${err}`);\n }\n });\n}\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nexport function mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n ok(fsPath, 'a path argument must be provided');\n yield ioUtil.mkdir(fsPath, { recursive: true });\n });\n}\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nexport function which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nexport function findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n const copySourceDirectory = options.copySourceDirectory == null\n ? true\n : Boolean(options.copySourceDirectory);\n return { force, recursive, copySourceDirectory };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"timers\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as os from 'os';\nimport * as events from 'events';\nimport * as child from 'child_process';\nimport * as path from 'path';\nimport * as io from '@actions/io';\nimport * as ioUtil from '@actions/io/lib/io-util';\nimport { setTimeout } from 'timers';\n/* eslint-disable @typescript-eslint/unbound-method */\nconst IS_WINDOWS = process.platform === 'win32';\n/*\n * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.\n */\nexport class ToolRunner extends events.EventEmitter {\n constructor(toolPath, args, options) {\n super();\n if (!toolPath) {\n throw new Error(\"Parameter 'toolPath' cannot be null or empty.\");\n }\n this.toolPath = toolPath;\n this.args = args || [];\n this.options = options || {};\n }\n _debug(message) {\n if (this.options.listeners && this.options.listeners.debug) {\n this.options.listeners.debug(message);\n }\n }\n _getCommandString(options, noPrefix) {\n const toolPath = this._getSpawnFileName();\n const args = this._getSpawnArgs(options);\n let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool\n if (IS_WINDOWS) {\n // Windows + cmd file\n if (this._isCmdFile()) {\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows + verbatim\n else if (options.windowsVerbatimArguments) {\n cmd += `\"${toolPath}\"`;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows (regular)\n else {\n cmd += this._windowsQuoteCmdArg(toolPath);\n for (const a of args) {\n cmd += ` ${this._windowsQuoteCmdArg(a)}`;\n }\n }\n }\n else {\n // OSX/Linux - this can likely be improved with some form of quoting.\n // creating processes on Unix is fundamentally different than Windows.\n // on Unix, execvp() takes an arg array.\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n return cmd;\n }\n _processLineBuffer(data, strBuffer, onLine) {\n try {\n let s = strBuffer + data.toString();\n let n = s.indexOf(os.EOL);\n while (n > -1) {\n const line = s.substring(0, n);\n onLine(line);\n // the rest of the string ...\n s = s.substring(n + os.EOL.length);\n n = s.indexOf(os.EOL);\n }\n return s;\n }\n catch (err) {\n // streaming lines to console is best effort. Don't fail a build.\n this._debug(`error processing line. Failed with error ${err}`);\n return '';\n }\n }\n _getSpawnFileName() {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n return process.env['COMSPEC'] || 'cmd.exe';\n }\n }\n return this.toolPath;\n }\n _getSpawnArgs(options) {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n let argline = `/D /S /C \"${this._windowsQuoteCmdArg(this.toolPath)}`;\n for (const a of this.args) {\n argline += ' ';\n argline += options.windowsVerbatimArguments\n ? a\n : this._windowsQuoteCmdArg(a);\n }\n argline += '\"';\n return [argline];\n }\n }\n return this.args;\n }\n _endsWith(str, end) {\n return str.endsWith(end);\n }\n _isCmdFile() {\n const upperToolPath = this.toolPath.toUpperCase();\n return (this._endsWith(upperToolPath, '.CMD') ||\n this._endsWith(upperToolPath, '.BAT'));\n }\n _windowsQuoteCmdArg(arg) {\n // for .exe, apply the normal quoting rules that libuv applies\n if (!this._isCmdFile()) {\n return this._uvQuoteCmdArg(arg);\n }\n // otherwise apply quoting rules specific to the cmd.exe command line parser.\n // the libuv rules are generic and are not designed specifically for cmd.exe\n // command line parser.\n //\n // for a detailed description of the cmd.exe command line parser, refer to\n // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912\n // need quotes for empty arg\n if (!arg) {\n return '\"\"';\n }\n // determine whether the arg needs to be quoted\n const cmdSpecialChars = [\n ' ',\n '\\t',\n '&',\n '(',\n ')',\n '[',\n ']',\n '{',\n '}',\n '^',\n '=',\n ';',\n '!',\n \"'\",\n '+',\n ',',\n '`',\n '~',\n '|',\n '<',\n '>',\n '\"'\n ];\n let needsQuotes = false;\n for (const char of arg) {\n if (cmdSpecialChars.some(x => x === char)) {\n needsQuotes = true;\n break;\n }\n }\n // short-circuit if quotes not needed\n if (!needsQuotes) {\n return arg;\n }\n // the following quoting rules are very similar to the rules that by libuv applies.\n //\n // 1) wrap the string in quotes\n //\n // 2) double-up quotes - i.e. \" => \"\"\n //\n // this is different from the libuv quoting rules. libuv replaces \" with \\\", which unfortunately\n // doesn't work well with a cmd.exe command line.\n //\n // note, replacing \" with \"\" also works well if the arg is passed to a downstream .NET console app.\n // for example, the command line:\n // foo.exe \"myarg:\"\"my val\"\"\"\n // is parsed by a .NET console app into an arg array:\n // [ \"myarg:\\\"my val\\\"\" ]\n // which is the same end result when applying libuv quoting rules. although the actual\n // command line from libuv quoting rules would look like:\n // foo.exe \"myarg:\\\"my val\\\"\"\n //\n // 3) double-up slashes that precede a quote,\n // e.g. hello \\world => \"hello \\world\"\n // hello\\\"world => \"hello\\\\\"\"world\"\n // hello\\\\\"world => \"hello\\\\\\\\\"\"world\"\n // hello world\\ => \"hello world\\\\\"\n //\n // technically this is not required for a cmd.exe command line, or the batch argument parser.\n // the reasons for including this as a .cmd quoting rule are:\n //\n // a) this is optimized for the scenario where the argument is passed from the .cmd file to an\n // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.\n //\n // b) it's what we've been doing previously (by deferring to node default behavior) and we\n // haven't heard any complaints about that aspect.\n //\n // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be\n // escaped when used on the command line directly - even though within a .cmd file % can be escaped\n // by using %%.\n //\n // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts\n // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.\n //\n // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would\n // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the\n // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args\n // to an external program.\n //\n // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.\n // % can be escaped within a .cmd file.\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\'; // double the slash\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\"'; // double the quote\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _uvQuoteCmdArg(arg) {\n // Tool runner wraps child_process.spawn() and needs to apply the same quoting as\n // Node in certain cases where the undocumented spawn option windowsVerbatimArguments\n // is used.\n //\n // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,\n // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),\n // pasting copyright notice from Node within this function:\n //\n // Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to\n // deal in the Software without restriction, including without limitation the\n // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n // sell copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n //\n // The above copyright notice and this permission notice shall be included in\n // all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n // IN THE SOFTWARE.\n if (!arg) {\n // Need double quotation for empty argument\n return '\"\"';\n }\n if (!arg.includes(' ') && !arg.includes('\\t') && !arg.includes('\"')) {\n // No quotation needed\n return arg;\n }\n if (!arg.includes('\"') && !arg.includes('\\\\')) {\n // No embedded double quotes or backslashes, so I can just wrap\n // quote marks around the whole thing.\n return `\"${arg}\"`;\n }\n // Expected input/output:\n // input : hello\"world\n // output: \"hello\\\"world\"\n // input : hello\"\"world\n // output: \"hello\\\"\\\"world\"\n // input : hello\\world\n // output: hello\\world\n // input : hello\\\\world\n // output: hello\\\\world\n // input : hello\\\"world\n // output: \"hello\\\\\\\"world\"\n // input : hello\\\\\"world\n // output: \"hello\\\\\\\\\\\"world\"\n // input : hello world\\\n // output: \"hello world\\\\\" - note the comment in libuv actually reads \"hello world\\\"\n // but it appears the comment is wrong, it should be \"hello world\\\\\"\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\';\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\\\\';\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _cloneExecOptions(options) {\n options = options || {};\n const result = {\n cwd: options.cwd || process.cwd(),\n env: options.env || process.env,\n silent: options.silent || false,\n windowsVerbatimArguments: options.windowsVerbatimArguments || false,\n failOnStdErr: options.failOnStdErr || false,\n ignoreReturnCode: options.ignoreReturnCode || false,\n delay: options.delay || 10000\n };\n result.outStream = options.outStream || process.stdout;\n result.errStream = options.errStream || process.stderr;\n return result;\n }\n _getSpawnOptions(options, toolPath) {\n options = options || {};\n const result = {};\n result.cwd = options.cwd;\n result.env = options.env;\n result['windowsVerbatimArguments'] =\n options.windowsVerbatimArguments || this._isCmdFile();\n if (options.windowsVerbatimArguments) {\n result.argv0 = `\"${toolPath}\"`;\n }\n return result;\n }\n /**\n * Exec a tool.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param tool path to tool to exec\n * @param options optional exec options. See ExecOptions\n * @returns number\n */\n exec() {\n return __awaiter(this, void 0, void 0, function* () {\n // root the tool path if it is unrooted and contains relative pathing\n if (!ioUtil.isRooted(this.toolPath) &&\n (this.toolPath.includes('/') ||\n (IS_WINDOWS && this.toolPath.includes('\\\\')))) {\n // prefer options.cwd if it is specified, however options.cwd may also need to be rooted\n this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);\n }\n // if the tool is only a file name, then resolve it from the PATH\n // otherwise verify it exists (add extension on Windows if necessary)\n this.toolPath = yield io.which(this.toolPath, true);\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n this._debug(`exec tool: ${this.toolPath}`);\n this._debug('arguments:');\n for (const arg of this.args) {\n this._debug(` ${arg}`);\n }\n const optionsNonNull = this._cloneExecOptions(this.options);\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);\n }\n const state = new ExecState(optionsNonNull, this.toolPath);\n state.on('debug', (message) => {\n this._debug(message);\n });\n if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {\n return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));\n }\n const fileName = this._getSpawnFileName();\n const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));\n let stdbuffer = '';\n if (cp.stdout) {\n cp.stdout.on('data', (data) => {\n if (this.options.listeners && this.options.listeners.stdout) {\n this.options.listeners.stdout(data);\n }\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(data);\n }\n stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.stdline) {\n this.options.listeners.stdline(line);\n }\n });\n });\n }\n let errbuffer = '';\n if (cp.stderr) {\n cp.stderr.on('data', (data) => {\n state.processStderr = true;\n if (this.options.listeners && this.options.listeners.stderr) {\n this.options.listeners.stderr(data);\n }\n if (!optionsNonNull.silent &&\n optionsNonNull.errStream &&\n optionsNonNull.outStream) {\n const s = optionsNonNull.failOnStdErr\n ? optionsNonNull.errStream\n : optionsNonNull.outStream;\n s.write(data);\n }\n errbuffer = this._processLineBuffer(data, errbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.errline) {\n this.options.listeners.errline(line);\n }\n });\n });\n }\n cp.on('error', (err) => {\n state.processError = err.message;\n state.processExited = true;\n state.processClosed = true;\n state.CheckComplete();\n });\n cp.on('exit', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n cp.on('close', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n state.processClosed = true;\n this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n state.on('done', (error, exitCode) => {\n if (stdbuffer.length > 0) {\n this.emit('stdline', stdbuffer);\n }\n if (errbuffer.length > 0) {\n this.emit('errline', errbuffer);\n }\n cp.removeAllListeners();\n if (error) {\n reject(error);\n }\n else {\n resolve(exitCode);\n }\n });\n if (this.options.input) {\n if (!cp.stdin) {\n throw new Error('child process missing stdin');\n }\n cp.stdin.end(this.options.input);\n }\n }));\n });\n }\n}\n/**\n * Convert an arg string to an array of args. Handles escaping\n *\n * @param argString string of arguments\n * @returns string[] array of arguments\n */\nexport function argStringToArray(argString) {\n const args = [];\n let inQuotes = false;\n let escaped = false;\n let arg = '';\n function append(c) {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\';\n }\n arg += c;\n escaped = false;\n }\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i);\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes;\n }\n else {\n append(c);\n }\n continue;\n }\n if (c === '\\\\' && escaped) {\n append(c);\n continue;\n }\n if (c === '\\\\' && inQuotes) {\n escaped = true;\n continue;\n }\n if (c === ' ' && !inQuotes) {\n if (arg.length > 0) {\n args.push(arg);\n arg = '';\n }\n continue;\n }\n append(c);\n }\n if (arg.length > 0) {\n args.push(arg.trim());\n }\n return args;\n}\nclass ExecState extends events.EventEmitter {\n constructor(options, toolPath) {\n super();\n this.processClosed = false; // tracks whether the process has exited and stdio is closed\n this.processError = '';\n this.processExitCode = 0;\n this.processExited = false; // tracks whether the process has exited\n this.processStderr = false; // tracks whether stderr was written to\n this.delay = 10000; // 10 seconds\n this.done = false;\n this.timeout = null;\n if (!toolPath) {\n throw new Error('toolPath must not be empty');\n }\n this.options = options;\n this.toolPath = toolPath;\n if (options.delay) {\n this.delay = options.delay;\n }\n }\n CheckComplete() {\n if (this.done) {\n return;\n }\n if (this.processClosed) {\n this._setResult();\n }\n else if (this.processExited) {\n this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);\n }\n }\n _debug(message) {\n this.emit('debug', message);\n }\n _setResult() {\n // determine whether there is an error\n let error;\n if (this.processExited) {\n if (this.processError) {\n error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);\n }\n else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {\n error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);\n }\n else if (this.processStderr && this.options.failOnStdErr) {\n error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);\n }\n }\n // clear the timeout\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.done = true;\n this.emit('done', error, this.processExitCode);\n }\n static HandleTimeout(state) {\n if (state.done) {\n return;\n }\n if (!state.processClosed && state.processExited) {\n const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;\n state._debug(message);\n }\n state._setResult();\n }\n}\n//# sourceMappingURL=toolrunner.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { StringDecoder } from 'string_decoder';\nimport * as tr from './toolrunner.js';\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nexport function exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\n/**\n * Exec a command and get the output.\n * Output will be streamed to the live console.\n * Returns promise with the exit code and collected stdout and stderr\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code, stdout, and stderr\n */\nexport function getExecOutput(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let stdout = '';\n let stderr = '';\n //Using string decoder covers the case where a mult-byte character is split\n const stdoutDecoder = new StringDecoder('utf8');\n const stderrDecoder = new StringDecoder('utf8');\n const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;\n const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;\n const stdErrListener = (data) => {\n stderr += stderrDecoder.write(data);\n if (originalStdErrListener) {\n originalStdErrListener(data);\n }\n };\n const stdOutListener = (data) => {\n stdout += stdoutDecoder.write(data);\n if (originalStdoutListener) {\n originalStdoutListener(data);\n }\n };\n const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });\n const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));\n //flush any remaining characters\n stdout += stdoutDecoder.end();\n stderr += stderrDecoder.end();\n return {\n exitCode,\n stdout,\n stderr\n };\n });\n}\n//# sourceMappingURL=exec.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport os from 'os';\nimport * as exec from '@actions/exec';\nconst getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout: version } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Version\"', undefined, {\n silent: true\n });\n const { stdout: name } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Caption\"', undefined, {\n silent: true\n });\n return {\n name: name.trim(),\n version: version.trim()\n };\n});\nconst getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d;\n const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {\n silent: true\n });\n const version = (_b = (_a = stdout.match(/ProductVersion:\\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';\n const name = (_d = (_c = stdout.match(/ProductName:\\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';\n return {\n name,\n version\n };\n});\nconst getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {\n silent: true\n });\n const [name, version] = stdout.trim().split('\\n');\n return {\n name,\n version\n };\n});\nexport const platform = os.platform();\nexport const arch = os.arch();\nexport const isWindows = platform === 'win32';\nexport const isMacOS = platform === 'darwin';\nexport const isLinux = platform === 'linux';\nexport function getDetails() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign(Object.assign({}, (yield (isWindows\n ? getWindowsInfo()\n : isMacOS\n ? getMacOsInfo()\n : getLinuxInfo()))), { platform,\n arch,\n isWindows,\n isMacOS,\n isLinux });\n });\n}\n//# sourceMappingURL=platform.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { issue, issueCommand } from './command.js';\nimport { issueFileCommand, prepareKeyValueMessage } from './file-command.js';\nimport { toCommandProperties, toCommandValue } from './utils.js';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { OidcClient } from './oidc-utils.js';\n/**\n * The code to exit an action\n */\nexport var ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode || (ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function exportVariable(name, val) {\n const convertedVal = toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return issueFileCommand('ENV', prepareKeyValueMessage(name, val));\n }\n issueCommand('set-env', { name }, convertedVal);\n}\n/**\n * Registers a secret which will get masked from logs\n *\n * @param secret - Value of the secret to be masked\n * @remarks\n * This function instructs the Actions runner to mask the specified value in any\n * logs produced during the workflow run. Once registered, the secret value will\n * be replaced with asterisks (***) whenever it appears in console output, logs,\n * or error messages.\n *\n * This is useful for protecting sensitive information such as:\n * - API keys\n * - Access tokens\n * - Authentication credentials\n * - URL parameters containing signatures (SAS tokens)\n *\n * Note that masking only affects future logs; any previous appearances of the\n * secret in logs before calling this function will remain unmasked.\n *\n * @example\n * ```typescript\n * // Register an API token as a secret\n * const apiToken = \"abc123xyz456\";\n * setSecret(apiToken);\n *\n * // Now any logs containing this value will show *** instead\n * console.log(`Using token: ${apiToken}`); // Outputs: \"Using token: ***\"\n * ```\n */\nexport function setSecret(secret) {\n issueCommand('add-mask', {}, secret);\n}\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nexport function addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n issueFileCommand('PATH', inputPath);\n }\n else {\n issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nexport function getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nexport function getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nexport function getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n issueCommand('set-output', { name }, toCommandValue(value));\n}\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nexport function setCommandEcho(enabled) {\n issue('echo', enabled ? 'on' : 'off');\n}\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nexport function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nexport function isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nexport function debug(message) {\n issueCommand('debug', {}, message);\n}\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function error(message, properties = {}) {\n issueCommand('error', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function warning(message, properties = {}) {\n issueCommand('warning', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function notice(message, properties = {}) {\n issueCommand('notice', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nexport function info(message) {\n process.stdout.write(message + os.EOL);\n}\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nexport function startGroup(name) {\n issue('group', name);\n}\n/**\n * End an output group.\n */\nexport function endGroup() {\n issue('endgroup');\n}\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nexport function group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return issueFileCommand('STATE', prepareKeyValueMessage(name, value));\n }\n issueCommand('save-state', { name }, toCommandValue(value));\n}\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nexport function getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexport function getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield OidcClient.getIDToken(aud);\n });\n}\n/**\n * Summary exports\n */\nexport { summary } from './summary.js';\n/**\n * @deprecated use core.summary\n */\nexport { markdownSummary } from './summary.js';\n/**\n * Path exports\n */\nexport { toPosixPath, toWin32Path, toPlatformPath } from './path-utils.js';\n/**\n * Platform utilities exports\n */\nexport * as platform from './platform.js';\n//# sourceMappingURL=core.js.map","//#region src/auth/upload-url-pool.ts\n/**\n* Manages a pool of reusable upload URLs keyed by bucket ID or file ID.\n* URLs are checked out before an upload, checked back in on success, and\n* evicted on error so they are not reused.\n*/\nvar UploadUrlPool = class {\n\t/** Map from key (bucket ID or file ID) to a stack of available entries. */\n\tpools = /* @__PURE__ */ new Map();\n\t/**\n\t* Take an upload URL from the pool, or return null if none are available.\n\t*\n\t* @param key - The bucket ID or file ID to look up.\n\t*\n\t* @returns An upload URL entry, or null if the pool is empty for the given key.\n\t*/\n\tcheckout(key) {\n\t\tconst pool = this.pools.get(key);\n\t\tif (!pool || pool.length === 0) return null;\n\t\treturn pool.pop() ?? null;\n\t}\n\t/**\n\t* Return a still-valid upload URL to the pool for future reuse.\n\t*\n\t* @param key - The bucket ID or file ID the entry belongs to.\n\t* @param entry - The upload URL entry to return to the pool.\n\t*/\n\tcheckin(key, entry) {\n\t\tlet pool = this.pools.get(key);\n\t\tif (!pool) {\n\t\t\tpool = [];\n\t\t\tthis.pools.set(key, pool);\n\t\t}\n\t\tpool.push(entry);\n\t}\n\t/**\n\t* Remove a specific upload URL from the pool (e.g. after an upload error).\n\t*\n\t* @param key - The bucket ID or file ID the entry belongs to.\n\t* @param entry - The failed upload URL entry to remove.\n\t*/\n\tevict(key, entry) {\n\t\tconst pool = this.pools.get(key);\n\t\tif (!pool) return;\n\t\tconst idx = pool.findIndex((e) => e.uploadUrl === entry.uploadUrl);\n\t\tif (idx !== -1) pool.splice(idx, 1);\n\t}\n\t/** Remove all entries from every key in the pool. */\n\tclear() {\n\t\tthis.pools.clear();\n\t}\n};\n//#endregion\nexport { UploadUrlPool };\n\n//# sourceMappingURL=upload-url-pool.js.map","import { UploadUrlPool } from \"./upload-url-pool.js\";\n//#region src/auth/in-memory.ts\n/**\n* In-memory implementation of {@link AccountInfo}.\n* Stores the authorization response and upload URL pools in plain object fields.\n* Suitable for short-lived processes or tests; state is lost when the process exits.\n*/\nvar InMemoryAccountInfo = class {\n\t/** Cached authorization response, or null before authorize() is called. */\n\tauth = null;\n\t/** Pool of reusable small-file upload URLs, keyed by bucket ID. */\n\tuploadUrls = new UploadUrlPool();\n\t/** Pool of reusable large-file part upload URLs, keyed by file ID. */\n\tpartUploadUrls = new UploadUrlPool();\n\t/**\n\t* Store a fresh authorization response, replacing any previous state.\n\t*\n\t* @param auth - The authorize account response to store.\n\t*/\n\tsetAuth(auth) {\n\t\tthis.auth = auth;\n\t\tthis.uploadUrls.clear();\n\t\tthis.partUploadUrls.clear();\n\t}\n\t/**\n\t* Return the current authorization response, or null if not authorized.\n\t*\n\t* @returns The cached authorization response, or null if not yet authorized.\n\t*/\n\tgetAuth() {\n\t\treturn this.auth;\n\t}\n\t/** Discard all cached authorization state and upload URLs. */\n\tclear() {\n\t\tthis.auth = null;\n\t\tthis.uploadUrls.clear();\n\t\tthis.partUploadUrls.clear();\n\t}\n\t/**\n\t* Base URL for B2 API calls.\n\t*\n\t* @returns The base URL for B2 API calls.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetApiUrl() {\n\t\treturn this.requireAuth().apiInfo.storageApi.apiUrl;\n\t}\n\t/**\n\t* Base URL for file downloads.\n\t*\n\t* @returns The base URL for file downloads.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetDownloadUrl() {\n\t\treturn this.requireAuth().apiInfo.storageApi.downloadUrl;\n\t}\n\t/**\n\t* Current authorization token.\n\t*\n\t* @returns The current authorization token.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetAuthToken() {\n\t\treturn this.requireAuth().authorizationToken;\n\t}\n\t/**\n\t* The authorized account ID.\n\t*\n\t* @returns The authorized account identifier.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetAccountId() {\n\t\treturn this.requireAuth().accountId;\n\t}\n\t/**\n\t* Server-recommended part size for large file uploads, in bytes.\n\t*\n\t* @returns The server-recommended part size in bytes.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetRecommendedPartSize() {\n\t\treturn this.requireAuth().apiInfo.storageApi.recommendedPartSize;\n\t}\n\t/**\n\t* Smallest allowed part size for large file uploads, in bytes.\n\t*\n\t* @returns The smallest allowed part size in bytes.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetAbsoluteMinimumPartSize() {\n\t\treturn this.requireAuth().apiInfo.storageApi.absoluteMinimumPartSize;\n\t}\n\t/**\n\t* Base URL for the S3-compatible API.\n\t*\n\t* @returns The base URL for the S3-compatible API.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetS3ApiUrl() {\n\t\treturn this.requireAuth().apiInfo.storageApi.s3ApiUrl;\n\t}\n\t/**\n\t* Bucket ID the key is restricted to, or null if unrestricted.\n\t*\n\t* @returns The restricted bucket identifier, or null if the key is unrestricted.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetAllowedBucketId() {\n\t\tconst allowed = this.requireAuth().apiInfo.storageApi.allowed;\n\t\tconst buckets = allowed.buckets;\n\t\tif (buckets === void 0) return allowed.bucketId ?? null;\n\t\tif (buckets !== null) {\n\t\t\tif (buckets.length !== 1) throw new Error(\"Authorized key is not restricted to exactly one bucket; use getAllowedBucketIds()\");\n\t\t\treturn buckets[0]?.id ?? null;\n\t\t}\n\t\treturn null;\n\t}\n\t/**\n\t* Bucket IDs the key is restricted to, or null if unrestricted.\n\t*\n\t* @returns The restricted bucket identifiers, or null if the key is unrestricted.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetAllowedBucketIds() {\n\t\tconst allowed = this.requireAuth().apiInfo.storageApi.allowed;\n\t\tconst buckets = allowed.buckets;\n\t\tif (buckets === void 0) {\n\t\t\tconst legacyBucketId = allowed.bucketId ?? null;\n\t\t\treturn legacyBucketId === null ? null : [legacyBucketId];\n\t\t}\n\t\treturn buckets === null ? null : buckets.map((bucket) => bucket.id);\n\t}\n\t/**\n\t* Take an upload URL from the pool for the given bucket, or null if none available.\n\t*\n\t* @param bucketId - The bucket to check out an upload URL for.\n\t*\n\t* @returns A reusable upload URL entry, or null if none are available.\n\t*/\n\tcheckoutUploadUrl(bucketId) {\n\t\treturn this.uploadUrls.checkout(bucketId);\n\t}\n\t/**\n\t* Return a still-valid upload URL to the pool for reuse.\n\t*\n\t* @param bucketId - The bucket the upload URL belongs to.\n\t* @param entry - The upload URL entry to return to the pool.\n\t*/\n\treturnUploadUrl(bucketId, entry) {\n\t\tthis.uploadUrls.checkin(bucketId, entry);\n\t}\n\t/**\n\t* Remove an upload URL from the pool after an upload error.\n\t*\n\t* @param bucketId - The bucket the failed upload URL belongs to.\n\t* @param entry - The upload URL entry to remove from the pool.\n\t*/\n\tevictUploadUrl(bucketId, entry) {\n\t\tthis.uploadUrls.evict(bucketId, entry);\n\t}\n\t/**\n\t* Take a large-file part upload URL from the pool, or null if none available.\n\t*\n\t* @param fileId - The large file to check out a part upload URL for.\n\t*\n\t* @returns A reusable part upload URL entry, or null if none are available.\n\t*/\n\tcheckoutPartUploadUrl(fileId) {\n\t\treturn this.partUploadUrls.checkout(fileId);\n\t}\n\t/**\n\t* Return a still-valid part upload URL to the pool for reuse.\n\t*\n\t* @param fileId - The large file the part upload URL belongs to.\n\t* @param entry - The part upload URL entry to return to the pool.\n\t*/\n\treturnPartUploadUrl(fileId, entry) {\n\t\tthis.partUploadUrls.checkin(fileId, entry);\n\t}\n\t/**\n\t* Remove a part upload URL from the pool after an error.\n\t*\n\t* @param fileId - The large file the failed part upload URL belongs to.\n\t* @param entry - The part upload URL entry to remove from the pool.\n\t*/\n\tevictPartUploadUrl(fileId, entry) {\n\t\tthis.partUploadUrls.evict(fileId, entry);\n\t}\n\t/**\n\t* Retrieve the cached auth response or throw if not yet authorized.\n\t*\n\t* @returns The cached authorization response.\n\t*\n\t* @throws Error if authorize() has not been called.\n\t*/\n\trequireAuth() {\n\t\tif (!this.auth) throw new Error(\"Not authorized. Call authorize() first.\");\n\t\treturn this.auth;\n\t}\n};\n//#endregion\nexport { InMemoryAccountInfo };\n\n//# sourceMappingURL=in-memory.js.map","//#region src/types/ids.ts\n/**\n* Creates a branded {@link AccountId} from a raw string.\n* @param raw - The raw account ID string from the B2 API.\n*\n* @returns A branded AccountId value.\n*/\nfunction accountId(raw) {\n\treturn raw;\n}\n/**\n* Creates a branded {@link BucketId} from a raw string.\n* @param raw - The raw bucket ID string from the B2 API.\n*\n* @returns A branded BucketId value.\n*/\nfunction bucketId(raw) {\n\treturn raw;\n}\n/**\n* Creates a branded {@link FileId} from a raw string.\n* @param raw - The raw file ID string from the B2 API.\n*\n* @returns A branded FileId value.\n*/\nfunction fileId(raw) {\n\treturn raw;\n}\n/**\n* Creates a branded {@link KeyId} from a raw string.\n* @param raw - The raw key ID string from the B2 API.\n*\n* @returns A branded KeyId value.\n*/\nfunction keyId(raw) {\n\treturn raw;\n}\n/**\n* Creates a branded {@link ApplicationKeyId} from a raw string.\n* @param raw - The raw application key ID string from the B2 API.\n*\n* @returns A branded ApplicationKeyId value.\n*/\nfunction applicationKeyId(raw) {\n\treturn raw;\n}\n/**\n* Creates a branded {@link LargeFileId} from a raw string.\n*\n* `LargeFileId` is the same wire-level shape as `FileId` but is a\n* distinct brand so that \"ID of an in-progress multipart upload\" and\n* \"ID of a committed file version\" don't get mixed up by accident.\n* `b2_start_large_file` returns one; `b2_finish_large_file` consumes it\n* and produces a regular `FileId`.\n*\n* @param raw - The raw large-file ID string from the B2 API.\n*\n* @returns A branded LargeFileId value.\n*/\nfunction largeFileId(raw) {\n\treturn raw;\n}\n//#endregion\nexport { accountId, applicationKeyId, bucketId, fileId, keyId, largeFileId };\n\n//# sourceMappingURL=ids.js.map","//#region src/http/retry.ts\n/** Default retry settings: 5 retries, 1s initial delay, 64s max delay, 15 minute timeout. */\nvar DEFAULT_RETRY_OPTIONS = {\n\tmaxRetries: 5,\n\tmaxRetryDelayMs: 64e3,\n\tinitialRetryDelayMs: 1e3,\n\trequestTimeoutMs: 15 * 6e4\n};\n/**\n* Computes the delay before the next retry using exponential backoff with jitter.\n* If a `Retry-After` value is provided by the server, it takes precedence over\n* the calculated backoff (still capped at {@link RetryOptions.maxRetryDelayMs}).\n*\n* @param attempt - Zero-based retry attempt index.\n* @param options - Retry configuration with delay bounds.\n* @param retryAfter - Server-provided retry delay in seconds, if any.\n*\n* @returns The delay in milliseconds before the next retry attempt.\n*/\nfunction computeBackoff(attempt, options, retryAfter) {\n\tif (retryAfter !== void 0 && retryAfter > 0) return Math.min(retryAfter * 1e3, options.maxRetryDelayMs);\n\tconst base = options.initialRetryDelayMs * 2 ** attempt;\n\tconst jitter = Math.random() * base * .5;\n\treturn Math.min(base + jitter, options.maxRetryDelayMs);\n}\n/**\n* Returns a promise that resolves after the given delay. Supports cancellation\n* via an optional AbortSignal.\n*\n* @param ms - Delay in milliseconds.\n* @param signal - Optional abort signal to cancel the sleep early.\n*\n* @returns A promise that resolves when the delay elapses or rejects if aborted.\n*/\nfunction sleep(ms, signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (signal?.aborted) {\n\t\t\treject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n\t\t\treturn;\n\t\t}\n\t\tconst timer = setTimeout(resolve, ms);\n\t\tsignal?.addEventListener(\"abort\", () => {\n\t\t\tclearTimeout(timer);\n\t\t\treject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n\t\t}, { once: true });\n\t});\n}\n//#endregion\nexport { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep };\n\n//# sourceMappingURL=retry.js.map","//#region src/util/paginator.ts\n/**\n* Async-iterates one page at a time. Stops when `fetcher` returns\n* `nextCursor: undefined`.\n*\n* @typeParam Page - The per-page response shape.\n* @typeParam Cursor - The cursor type used to request the next page.\n*\n* @param fetcher - Function that fetches one page given the current cursor.\n* @param signal - Optional abort signal. Checked before each fetch.\n*\n* @returns An async iterable of pages.\n*\n* @throws DOMException When `signal` is aborted between fetches.\n*\n* @example\n* ```ts\n* for await (const page of paginatePages(\n* async (cursor) => {\n* const resp = await bucket.listFileNames({ startFileName: cursor })\n* return { page: resp, nextCursor: resp.nextFileName ?? undefined }\n* },\n* abortSignal,\n* )) {\n* for (const file of page.files) { ... }\n* }\n* ```\n*/\nasync function* paginatePages(fetcher, signal) {\n\tlet cursor;\n\twhile (true) {\n\t\tsignal?.throwIfAborted();\n\t\tconst { page, nextCursor } = await fetcher(cursor);\n\t\tyield page;\n\t\tif (nextCursor === void 0) return;\n\t\tcursor = nextCursor;\n\t}\n}\n/**\n* Async-iterates items by flattening pages. The `extractItems` function\n* pulls the relevant array out of each page (e.g. `page.files`,\n* `page.keys`, `page.parts`). Each item is yielded individually so the\n* caller can `for await (const item of paginator)` rather than nest loops.\n*\n* Aborts between **pages**, not between items: if `signal` is aborted while\n* the caller is processing the items of page N, the iterator will still\n* yield all of page N's remaining items before checking the signal before\n* fetching page N+1.\n*\n* @typeParam Page - The per-page response shape.\n* @typeParam Cursor - The cursor type used to request the next page.\n* @typeParam Item - The item type the caller wants to iterate.\n*\n* @param fetcher - Function that fetches one page given the current cursor.\n* @param extractItems - Pulls the iterable items out of a page.\n* @param signal - Optional abort signal. Checked before each fetch.\n*\n* @returns An async iterable of individual items.\n*\n* @throws DOMException When `signal` is aborted between fetches.\n*/\nasync function* paginateItems(fetcher, extractItems, signal) {\n\tfor await (const page of paginatePages(fetcher, signal)) yield* extractItems(page);\n}\n//#endregion\nexport { paginateItems, paginatePages };\n\n//# sourceMappingURL=paginator.js.map","//#region src/upload/concurrency.ts\n/**\n* Bounded concurrency primitive.\n*\n* Limits the number of concurrent operations to a fixed maximum. Callers\n* {@link acquire} a slot before starting work and {@link release} it when done.\n* If all slots are taken, `acquire` returns a promise that resolves when a slot\n* becomes available.\n*/\nvar Semaphore = class {\n\tlimit;\n\tcurrent = 0;\n\tqueue = [];\n\t/**\n\t* @param limit - Maximum number of concurrent acquisitions. Must be a\n\t* positive integer; values `<= 0` would create a semaphore that\n\t* never lets anything through (all `acquire()` calls would queue\n\t* forever), so the constructor throws fast instead.\n\t*\n\t* @throws `RangeError` when `limit` is not a positive integer.\n\t*/\n\tconstructor(limit) {\n\t\tthis.limit = limit;\n\t\tif (!Number.isInteger(limit) || limit <= 0) throw new RangeError(`Semaphore limit must be a positive integer; received ${limit}. A non-positive limit produces a deadlocked semaphore — fail fast at construction instead.`);\n\t}\n\t/**\n\t* Acquires a slot, waiting if the limit has been reached.\n\t* @returns A promise that resolves when a slot is available.\n\t*/\n\tasync acquire() {\n\t\tif (this.current < this.limit) {\n\t\t\tthis.current++;\n\t\t\treturn;\n\t\t}\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.queue.push(resolve);\n\t\t});\n\t}\n\t/** Releases a slot, unblocking the next queued caller if any. */\n\trelease() {\n\t\tconst next = this.queue.shift();\n\t\tif (next) next();\n\t\telse this.current--;\n\t}\n\t/**\n\t* Number of slots currently available.\n\t*\n\t* @returns The count of free concurrency slots.\n\t*/\n\tget available() {\n\t\treturn this.limit - this.current;\n\t}\n};\n/**\n* Maps over an array with bounded concurrency.\n*\n* @param items - Input items to process.\n* @param concurrency - Maximum number of items processed in parallel.\n* @param fn - Async function applied to each item.\n*\n* @returns Results in the same order as the input items.\n*/\nasync function mapConcurrent(items, concurrency, fn) {\n\tconst sem = new Semaphore(concurrency);\n\tconst results = new Array(items.length);\n\tconst tasks = items.map(async (item, i) => {\n\t\tawait sem.acquire();\n\t\ttry {\n\t\t\tresults[i] = await fn(item, i);\n\t\t} finally {\n\t\t\tsem.release();\n\t\t}\n\t});\n\tawait Promise.all(tasks);\n\treturn results;\n}\n//#endregion\nexport { Semaphore, mapConcurrent };\n\n//# sourceMappingURL=concurrency.js.map","//#region src/types/file.ts\n/**\n* Named constants for the action that created a file version.\n*\n* @example\n* ```ts\n* if (file.action === FileAction.Hide) { ... }\n* ```\n*/\nvar FileAction = {\n\t/** Large file upload started but not yet finished. */\n\tStart: \"start\",\n\t/** Normal upload (small or finished large file). */\n\tUpload: \"upload\",\n\t/** Hide marker (soft delete). */\n\tHide: \"hide\",\n\t/** Virtual folder marker. */\n\tFolder: \"folder\",\n\t/** Created via server-side copy. */\n\tCopy: \"copy\"\n};\n/**\n* Named constants for how metadata is handled during a file copy.\n*\n* @example\n* ```ts\n* await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n* ```\n*/\nvar MetadataDirective = {\n\t/** Preserve the source file's contentType and fileInfo. */\n\tCopy: \"COPY\",\n\t/** Use the values provided in the copy request. */\n\tReplace: \"REPLACE\"\n};\n//#endregion\nexport { FileAction, MetadataDirective };\n\n//# sourceMappingURL=file.js.map","//#region src/upload/abort-scope.ts\n/**\n* Creates an abort scope linked to an optional upstream signal.\n* Task failures can abort the same scope so sibling tasks stop promptly.\n* @param upstream - Caller-provided abort signal, if any.\n*\n* @returns A linked abort scope.\n*/\nfunction createAbortScope(upstream) {\n\tconst controller = new AbortController();\n\tlet upstreamAbort;\n\tconst abort = (reason) => {\n\t\tif (!controller.signal.aborted) controller.abort(reason);\n\t};\n\tif (upstream?.aborted === true) abort(upstream.reason);\n\telse if (upstream !== void 0) {\n\t\tupstreamAbort = () => abort(upstream.reason);\n\t\tupstream.addEventListener(\"abort\", upstreamAbort, { once: true });\n\t}\n\treturn {\n\t\tsignal: controller.signal,\n\t\tabort,\n\t\tdispose() {\n\t\t\tif (upstreamAbort !== void 0) upstream?.removeEventListener(\"abort\", upstreamAbort);\n\t\t}\n\t};\n}\n/**\n* Throws the abort reason or first task rejection from a settled task set.\n* @param settled - Results from `Promise.allSettled`.\n* @param abortScope - Scope that coordinated the tasks.\n*\n* @throws The abort reason or first rejected task reason.\n*/\nfunction throwRejectedOrAbortReason(settled, abortScope) {\n\tconst rejected = settled.find((result) => result.status === \"rejected\");\n\tif (rejected === void 0) return;\n\tif (abortScope.signal.aborted && abortScope.signal.reason !== void 0) throw abortScope.signal.reason;\n\t/* v8 ignore next -- Defensive fallback for unexpected task rejections outside the abort scope. */\n\tthrow rejected.reason;\n}\n/**\n* Returns the observable reason for an aborted signal.\n* @param signal - Aborted signal to inspect.\n*\n* @returns The signal's reason, or a standard AbortError when the runtime did not provide one.\n*/\nfunction abortReason(signal) {\n\treturn signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\n/**\n* Races a request promise against an abort signal.\n*\n* The underlying request must still receive the same signal so transports can\n* cancel their network work. This helper makes callers stop waiting promptly\n* even when a test double or custom transport ignores the signal.\n*\n* @param promise - Request promise to observe.\n* @param signal - Signal that should stop waiting for the request.\n*\n* @returns The request result if it settles before the signal aborts.\n*\n* @throws The abort reason if the signal aborts first, or the request rejection.\n*/\nasync function raceWithAbort(promise, signal) {\n\tif (signal.aborted) {\n\t\tpromise.catch(() => {});\n\t\tthrow abortReason(signal);\n\t}\n\tlet removeAbortListener;\n\tconst abort = new Promise((_, reject) => {\n\t\tconst onAbort = () => reject(abortReason(signal));\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\treturn await Promise.race([promise, abort]);\n\t} catch (err) {\n\t\tif (signal.aborted) promise.catch(() => {});\n\t\tthrow err;\n\t} finally {\n\t\tremoveAbortListener?.();\n\t}\n}\n//#endregion\nexport { abortReason, createAbortScope, raceWithAbort, throwRejectedOrAbortReason };\n\n//# sourceMappingURL=abort-scope.js.map","//#region src/internal/url-redaction.ts\n/**\n* Redact a URL before including it in an error message.\n*\n* @param url - Absolute URL, relative URL, or parsed URL to redact.\n* @param options - Optional base URL and invalid-URL placeholder.\n*\n* @returns A URL string with userinfo, query string, fragment, and path\n* segments removed.\n*/\nfunction redactUrlForError(url, options = {}) {\n\ttry {\n\t\tconst parsed = url instanceof URL ? new URL(url) : options.baseUrl !== void 0 ? new URL(url, options.baseUrl) : new URL(url);\n\t\tif (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") return options.invalidUrlLabel ?? \"\";\n\t\tparsed.username = \"\";\n\t\tparsed.password = \"\";\n\t\tparsed.search = \"\";\n\t\tparsed.hash = \"\";\n\t\tparsed.pathname = redactPathname(parsed.pathname);\n\t\treturn parsed.toString();\n\t} catch {\n\t\treturn options.invalidUrlLabel ?? \"\";\n\t}\n}\nfunction redactPathname(pathname) {\n\treturn pathname.split(\"/\").some(Boolean) ? \"/...\" : pathname;\n}\n//#endregion\nexport { redactUrlForError };\n\n//# sourceMappingURL=url-redaction.js.map","//#region src/types/errors.ts\n/**\n* B2 API error codes documented by the SDK.\n* This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback\n* so callers can receive unknown future server codes while keeping autocomplete\n* for known values.\n*/\nvar KNOWN_B2_ERROR_CODES = [\n\t\"expired_auth_token\",\n\t\"bad_auth_token\",\n\t\"unauthorized\",\n\t\"bad_request\",\n\t\"bad_bucket_name\",\n\t\"bad_bucket_id\",\n\t\"not_found\",\n\t\"method_not_allowed\",\n\t\"request_timeout\",\n\t\"too_many_requests\",\n\t\"conflict\",\n\t\"duplicate_bucket_name\",\n\t\"too_many_buckets\",\n\t\"too_many_files\",\n\t\"cap_exceeded\",\n\t\"storage_cap_exceeded\",\n\t\"transaction_cap_exceeded\",\n\t\"download_cap_exceeded\",\n\t\"access_denied\",\n\t\"service_unavailable\",\n\t\"internal_error\",\n\t\"bad_json\",\n\t\"invalid_bucket_id\",\n\t\"invalid_bucket_name\",\n\t\"invalid_bucket_info\",\n\t\"file_not_present\",\n\t\"no_such_file\",\n\t\"out_of_range\",\n\t\"range_not_satisfiable\",\n\t\"invalid_file_id\",\n\t\"invalid_file_name\",\n\t\"invalid_file_info\",\n\t\"invalid_part_number\",\n\t\"bad_sha1_checksum\"\n];\n//#endregion\nexport { KNOWN_B2_ERROR_CODES };\n\n//# sourceMappingURL=errors.js.map","import { redactUrlForError } from \"../internal/url-redaction.js\";\nimport { KNOWN_B2_ERROR_CODES } from \"../types/errors.js\";\n//#region src/errors/index.ts\n/**\n* Typed error hierarchy for B2 API failures.\n*\n* Every B2 error response maps to a specific {@link B2Error} subclass.\n* Retry behavior is exposed through {@link B2Error.retryable}.\n* Examples include {@link ExpiredAuthTokenError} and {@link CapExceededError}.\n* Use {@link classifyError} to convert a raw error response into the\n* appropriate subclass.\n*\n* Convention: most `B2Error` subclasses represent failures returned by the B2\n* API. The client-side exception is {@link B2RealmConfigurationError}; it\n* extends `B2Error` so realm-validation failures can be handled with the SDK\n* error hierarchy before credentials are sent.\n*\n* Other programming errors and SDK preconditions, such as \"not yet authorized\",\n* \"stream consumed twice\", or \"called before init\", use the native `Error`\n* constructor instead. The direct `Error` outliers are\n* {@link B2InsufficientCapabilityError}, {@link B2RedirectError},\n* {@link B2SsrfError}, {@link NetworkError},\n* {@link ResumeFileIdMismatchError}, {@link UploadResponseBodyError}, and\n* {@link FinishLargeFileResponseBodyError}.\n*\n* @packageDocumentation\n*/\n/** Thrown when an explicit resumeFileId is not compatible with the requested upload. */\nvar ResumeFileIdMismatchError = class extends Error {\n\t/** Caller-supplied unfinished large file ID that failed verification. */\n\tfileId;\n\t/** Requested destination file name. */\n\tfileName;\n\t/**\n\t* Creates a new resume-file ID mismatch error.\n\t* @param fileId - Caller-supplied unfinished large file ID that failed verification.\n\t* @param fileName - Requested destination file name.\n\t*/\n\tconstructor(fileId, fileName) {\n\t\tsuper(`uploadLargeFile: resumeFileId ${fileId} does not identify a compatible unfinished large file for ${fileName}.`);\n\t\tthis.name = \"ResumeFileIdMismatchError\";\n\t\tthis.fileId = fileId;\n\t\tthis.fileName = fileName;\n\t}\n};\n/**\n* Base error class for all B2 API errors.\n* Contains the HTTP status, B2 error code, and retry metadata from the response.\n*/\nvar B2Error = class extends Error {\n\t/** HTTP status code returned by the B2 API. */\n\tstatus;\n\t/** B2 error code identifying the error type (e.g. `expired_auth_token`). */\n\tcode;\n\t/** B2 request ID from the `X-Bz-Request-Id` response header, if present. */\n\trequestId;\n\t/** Retry delay in seconds from the `Retry-After` response header, if present. */\n\tretryAfter;\n\t/** Whether this error is transient and the request can be retried. */\n\tretryable;\n\t/**\n\t* Creates a new B2Error instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional retry and request metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response.message);\n\t\tthis.name = \"B2Error\";\n\t\tthis.status = response.status;\n\t\tthis.code = response.code;\n\t\tif (options?.retryAfter !== void 0) this.retryAfter = options.retryAfter;\n\t\tif (options?.requestId !== void 0) this.requestId = options.requestId;\n\t\tthis.retryable = isTransient(response.status, response.code);\n\t}\n};\n/** Thrown when the auth token has expired. Triggers automatic re-authorization. */\nvar ExpiredAuthTokenError = class extends B2Error {\n\t/**\n\t* Creates a new ExpiredAuthTokenError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"ExpiredAuthTokenError\";\n\t}\n};\n/** Thrown when the auth token is invalid or unauthorized. */\nvar BadAuthTokenError = class extends B2Error {\n\t/**\n\t* Creates a new BadAuthTokenError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"BadAuthTokenError\";\n\t}\n};\n/** Thrown when the B2 service is temporarily unavailable (HTTP 503). */\nvar ServiceUnavailableError = class extends B2Error {\n\t/**\n\t* Creates a new ServiceUnavailableError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"ServiceUnavailableError\";\n\t}\n};\n/** Thrown when B2 reports an internal server error. */\nvar InternalError = class extends B2Error {\n\t/**\n\t* Creates a new InternalError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InternalError\";\n\t}\n};\n/** Thrown when a request times out on the server side (HTTP 408). */\nvar RequestTimeoutError = class extends B2Error {\n\t/**\n\t* Creates a new RequestTimeoutError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"RequestTimeoutError\";\n\t}\n};\n/** Thrown when the client has sent too many requests (HTTP 429). */\nvar TooManyRequestsError = class extends B2Error {\n\t/**\n\t* Creates a new TooManyRequestsError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"TooManyRequestsError\";\n\t}\n};\n/** Thrown when the account has reached the maximum number of buckets. */\nvar TooManyBucketsError = class extends B2Error {\n\t/**\n\t* Creates a new TooManyBucketsError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"TooManyBucketsError\";\n\t}\n};\n/** Thrown when the bucket or request has reached the maximum number of files. */\nvar TooManyFilesError = class extends B2Error {\n\t/**\n\t* Creates a new TooManyFilesError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"TooManyFilesError\";\n\t}\n};\n/** Thrown when a storage, transaction, or download cap has been exceeded. */\nvar CapExceededError = class extends B2Error {\n\t/**\n\t* Creates a new CapExceededError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"CapExceededError\";\n\t}\n};\n/** Thrown when the application key does not have permission for the requested operation. */\nvar AccessDeniedError = class extends B2Error {\n\t/**\n\t* Creates a new AccessDeniedError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"AccessDeniedError\";\n\t}\n};\n/** Thrown when the requested file does not exist. */\nvar FileNotPresentError = class extends B2Error {\n\t/**\n\t* Creates a new FileNotPresentError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"FileNotPresentError\";\n\t}\n};\n/** Thrown when a requested B2 resource does not exist. */\nvar NotFoundError = class extends B2Error {\n\t/**\n\t* Creates a new NotFoundError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"NotFoundError\";\n\t}\n};\n/** Thrown when creating a bucket with a name that already exists in the account. */\nvar DuplicateBucketNameError = class extends B2Error {\n\t/**\n\t* Creates a new DuplicateBucketNameError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"DuplicateBucketNameError\";\n\t}\n};\n/** Thrown when a bucket name is malformed, reserved, or otherwise rejected by B2. */\nvar InvalidBucketNameError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidBucketNameError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidBucketNameError\";\n\t}\n};\n/** Thrown when bucket metadata fails B2 validation. */\nvar InvalidBucketInfoError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidBucketInfoError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidBucketInfoError\";\n\t}\n};\n/** Thrown when a bucket ID is malformed or does not identify a valid bucket. */\nvar BadBucketIdError = class extends B2Error {\n\t/**\n\t* Creates a new BadBucketIdError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"BadBucketIdError\";\n\t}\n};\n/** Thrown when the B2 endpoint does not allow the request method. */\nvar MethodNotAllowedError = class extends B2Error {\n\t/**\n\t* Creates a new MethodNotAllowedError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"MethodNotAllowedError\";\n\t}\n};\n/** Thrown when the request conflicts with current B2 resource state. */\nvar ConflictError = class extends B2Error {\n\t/**\n\t* Creates a new ConflictError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"ConflictError\";\n\t}\n};\n/** Thrown for general bad request errors (HTTP 400) not covered by a more specific subclass. */\nvar BadRequestError = class extends B2Error {\n\t/**\n\t* Creates a new BadRequestError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"BadRequestError\";\n\t}\n};\n/** Thrown when B2 cannot parse the JSON request body. */\nvar BadJsonError = class extends B2Error {\n\t/**\n\t* Creates a new BadJsonError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"BadJsonError\";\n\t}\n};\n/** Thrown when a bucket ID has a valid shape but does not identify a usable bucket. */\nvar InvalidBucketIdError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidBucketIdError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidBucketIdError\";\n\t}\n};\n/** Thrown when a numeric request parameter is outside the allowed range. */\nvar OutOfRangeError = class extends B2Error {\n\t/**\n\t* Creates a new OutOfRangeError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"OutOfRangeError\";\n\t}\n};\n/** Thrown when a requested byte range cannot be satisfied. */\nvar RangeNotSatisfiableError = class extends B2Error {\n\t/**\n\t* Creates a new RangeNotSatisfiableError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"RangeNotSatisfiableError\";\n\t}\n};\n/** Thrown when a file name is malformed or otherwise rejected by B2. */\nvar InvalidFileNameError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidFileNameError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidFileNameError\";\n\t}\n};\n/** Thrown when file metadata fails B2 validation. */\nvar InvalidFileInfoError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidFileInfoError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidFileInfoError\";\n\t}\n};\n/** Thrown when a file ID is malformed or does not identify a valid file. */\nvar InvalidFileIdError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidFileIdError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidFileIdError\";\n\t}\n};\n/** Thrown when a multipart upload part number is invalid. */\nvar InvalidPartNumberError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidPartNumberError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidPartNumberError\";\n\t}\n};\n/**\n* Thrown when an upload URL is no longer valid and must be refreshed.\n*\n* Forward-compat insurance: B2 does not currently surface a distinct\n* error code for this case, so {@link classifyError} never actually\n* instantiates this class today. It's part of the public API so\n* consumers can pre-write `instanceof` checks; when B2 documents a\n* `bad_upload_url` (or similar) error code, the `classifyError`\n* switch gets a matching case and existing consumer code starts\n* catching the typed error without any changes on their side.\n*\n* Until then, expect `BadRequestError` for upload-URL invalidation\n* scenarios — that's what B2 currently returns.\n*/\nvar BadUploadUrlError = class extends B2Error {\n\t/**\n\t* Creates a new BadUploadUrlError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"BadUploadUrlError\";\n\t}\n};\n/**\n* Thrown when the uploaded file's SHA-1 checksum does not match the\n* expected value.\n*\n* When B2 returns `bad_sha1_checksum`, {@link classifyError} instantiates\n* this class so callers can handle checksum failures with `instanceof`.\n* Generic `bad_request` checksum failures continue to classify as\n* {@link BadRequestError}.\n*/\nvar ChecksumMismatchError = class extends B2Error {\n\t/**\n\t* Creates a new ChecksumMismatchError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"ChecksumMismatchError\";\n\t}\n};\n/**\n* Thrown by client-side capability checks when the application key is missing\n* capabilities required by an operation. Not raised by the server.\n*/\nvar B2InsufficientCapabilityError = class extends Error {\n\t/** Capabilities that were required for the operation. */\n\trequired;\n\t/** Capabilities that the current key actually has. */\n\tavailable;\n\t/** Capabilities present in `required` but not in `available`. */\n\tmissing;\n\t/**\n\t* Creates a new B2InsufficientCapabilityError instance.\n\t*\n\t* @param required - Capabilities the operation requires.\n\t* @param available - Capabilities the current key holds.\n\t* @param missing - The subset of required that isn't available.\n\t*/\n\tconstructor(required, available, missing) {\n\t\tsuper(`Application key is missing capabilities: ${missing.join(\", \")}`);\n\t\tthis.name = \"B2InsufficientCapabilityError\";\n\t\tthis.required = required;\n\t\tthis.available = available;\n\t\tthis.missing = missing;\n\t}\n};\n/**\n* Thrown when the SDK is asked to fetch a URL whose host is outside the\n* authorized B2 realm. Defense against SSRF / URL-substitution attacks where\n* a compromised or hostile B2 endpoint returns an upload URL pointing at an\n* internal service (e.g. cloud metadata at `169.254.169.254`).\n*\n* Not retryable.\n*/\nvar B2SsrfError = class extends Error {\n\t/** Always `false` — this is a security failure, not transient. */\n\tretryable = false;\n\t/**\n\t* Creates a new {@link B2SsrfError}.\n\t*\n\t* @param message - Human-readable description of which URL was rejected and why.\n\t* @param url - The URL that was rejected. Stored as a sanitized URL.\n\t*/\n\tconstructor(message, url) {\n\t\tconst safeUrl = redactUrlForError(url);\n\t\tsuper(`${message.split(url).join(safeUrl)} (${safeUrl})`);\n\t\tthis.name = \"B2SsrfError\";\n\t\tthis.url = safeUrl;\n\t}\n\t/** Sanitized URL that was rejected. */\n\turl;\n};\n/** Thrown when a configured auth realm cannot safely be used for authorization. */\nvar B2RealmConfigurationError = class extends B2Error {\n\t/**\n\t* Creates a new B2RealmConfigurationError instance.\n\t*\n\t* @param message - Human-readable description of the invalid realm setting.\n\t*/\n\tconstructor(message) {\n\t\tsuper({\n\t\t\tstatus: 400,\n\t\t\tcode: \"bad_request\",\n\t\t\tmessage\n\t\t});\n\t\tthis.name = \"B2RealmConfigurationError\";\n\t}\n};\n/** Thrown when the SDK refuses to follow an HTTP redirect automatically. */\nvar B2RedirectError = class extends Error {\n\t/** Always `false` because a blocked redirect is deterministic. */\n\tretryable = false;\n\t/** Sanitized request URL whose response attempted to redirect. */\n\turl;\n\t/** HTTP redirect status code, or 0 for an opaque browser redirect. */\n\tstatus;\n\t/** Sanitized redirect target, or `null` when no Location header was present. */\n\tlocation;\n\t/**\n\t* Creates a new B2RedirectError instance.\n\t*\n\t* @param url - Request URL whose response attempted to redirect. Stored as a sanitized URL.\n\t* @param status - HTTP redirect status code.\n\t* @param location - Redirect Location header, if present. Stored as a sanitized URL.\n\t*/\n\tconstructor(url, status, location) {\n\t\tconst safeUrl = redactUrlForError(url);\n\t\tconst safeLocation = location !== null ? redactUrlForError(location, { baseUrl: url }) : null;\n\t\tsuper(safeLocation !== null ? `HTTP ${status} redirect blocked for ${safeUrl} to ${safeLocation}` : `HTTP ${status} redirect blocked for ${safeUrl}`);\n\t\tthis.name = \"B2RedirectError\";\n\t\tthis.url = safeUrl;\n\t\tthis.status = status;\n\t\tthis.location = safeLocation;\n\t}\n};\n/** Thrown when a network-level failure occurs (DNS, TCP, TLS). Always retryable. */\nvar NetworkError = class extends Error {\n\tcause;\n\t/** Always `true` since network errors are transient. */\n\tretryable = true;\n\t/**\n\t* Creates a new NetworkError instance.\n\t* @param message - Human-readable description of the network failure.\n\t* @param cause - The underlying error that caused this failure, if any.\n\t*/\n\tconstructor(message, cause) {\n\t\tsuper(message);\n\t\tthis.cause = cause;\n\t\tthis.name = \"NetworkError\";\n\t}\n};\n/**\n* Thrown when an upload POST returned a response but its body could not be\n* read. The upload may already have been stored by B2, so retrying this error\n* can create duplicate file versions or parts.\n*/\nvar UploadResponseBodyError = class extends Error {\n\t/** Underlying response body error, when available. */\n\tcause;\n\t/**\n\t* Creates a new UploadResponseBodyError instance.\n\t* @param message - Human-readable description of the response read failure.\n\t* @param options - Optional cause.\n\t*/\n\tconstructor(message, options = {}) {\n\t\tsuper(message, { cause: options.cause });\n\t\tthis.name = \"UploadResponseBodyError\";\n\t\tif (options.cause !== void 0) this.cause = options.cause;\n\t}\n};\n/**\n* Thrown when `b2_finish_large_file` returned a response but its body could not\n* be read. The large file may already be committed server-side, so high-level\n* upload paths do not cancel the large file after this error.\n*/\nvar FinishLargeFileResponseBodyError = class extends Error {\n\t/** Ambiguous large file ID that may already be committed server-side. */\n\tfileId;\n\t/** Bucket requested by the high-level upload, when available. */\n\tbucketId;\n\t/** File name requested by the high-level upload, when available. */\n\tfileName;\n\t/**\n\t* Creates a new FinishLargeFileResponseBodyError instance.\n\t* @param message - Human-readable description of the response read failure.\n\t* @param options - Optional cause and reconciliation metadata.\n\t*/\n\tconstructor(message, options = {}) {\n\t\tsuper(message, { cause: options.cause });\n\t\tthis.name = \"FinishLargeFileResponseBodyError\";\n\t\tif (options.cause !== void 0) this.cause = options.cause;\n\t\tif (options.fileId !== void 0) this.fileId = options.fileId;\n\t\tif (options.bucketId !== void 0) this.bucketId = options.bucketId;\n\t\tif (options.fileName !== void 0) this.fileName = options.fileName;\n\t}\n};\nfunction isTransient(status, code) {\n\tif (status === 408 || status === 429) return true;\n\tif (status === 500 || status === 502 || status === 503 || status === 504) return true;\n\tif (code === \"expired_auth_token\") return true;\n\tif (code === \"service_unavailable\" || code === \"request_timeout\") return true;\n\treturn false;\n}\nvar knownB2ErrorCodes = new Set(KNOWN_B2_ERROR_CODES);\nfunction isKnownB2ErrorCode(code) {\n\treturn knownB2ErrorCodes.has(code);\n}\nfunction assertNever(value) {\n\tthrow new Error(`Unhandled B2 error code: ${String(value)}`);\n}\nfunction classifyKnownError(response, code, options) {\n\tswitch (code) {\n\t\tcase \"expired_auth_token\": return new ExpiredAuthTokenError(response, options);\n\t\tcase \"bad_auth_token\":\n\t\tcase \"unauthorized\": return new BadAuthTokenError(response, options);\n\t\tcase \"bad_request\": return new BadRequestError(response, options);\n\t\tcase \"bad_bucket_name\":\n\t\tcase \"invalid_bucket_name\": return new InvalidBucketNameError(response, options);\n\t\tcase \"bad_bucket_id\": return new BadBucketIdError(response, options);\n\t\tcase \"not_found\": return new NotFoundError(response, options);\n\t\tcase \"method_not_allowed\": return new MethodNotAllowedError(response, options);\n\t\tcase \"request_timeout\": return new RequestTimeoutError(response, options);\n\t\tcase \"too_many_requests\": return new TooManyRequestsError(response, options);\n\t\tcase \"conflict\": return new ConflictError(response, options);\n\t\tcase \"duplicate_bucket_name\": return new DuplicateBucketNameError(response, options);\n\t\tcase \"too_many_buckets\": return new TooManyBucketsError(response, options);\n\t\tcase \"too_many_files\": return new TooManyFilesError(response, options);\n\t\tcase \"cap_exceeded\":\n\t\tcase \"storage_cap_exceeded\":\n\t\tcase \"transaction_cap_exceeded\":\n\t\tcase \"download_cap_exceeded\": return new CapExceededError(response, options);\n\t\tcase \"access_denied\": return new AccessDeniedError(response, options);\n\t\tcase \"service_unavailable\": return new ServiceUnavailableError(response, options);\n\t\tcase \"internal_error\": return new InternalError(response, options);\n\t\tcase \"bad_json\": return new BadJsonError(response, options);\n\t\tcase \"invalid_bucket_id\": return new InvalidBucketIdError(response, options);\n\t\tcase \"invalid_bucket_info\": return new InvalidBucketInfoError(response, options);\n\t\tcase \"file_not_present\":\n\t\tcase \"no_such_file\": return new FileNotPresentError(response, options);\n\t\tcase \"out_of_range\": return new OutOfRangeError(response, options);\n\t\tcase \"range_not_satisfiable\": return new RangeNotSatisfiableError(response, options);\n\t\tcase \"invalid_file_id\": return new InvalidFileIdError(response, options);\n\t\tcase \"invalid_file_name\": return new InvalidFileNameError(response, options);\n\t\tcase \"invalid_file_info\": return new InvalidFileInfoError(response, options);\n\t\tcase \"invalid_part_number\": return new InvalidPartNumberError(response, options);\n\t\tcase \"bad_sha1_checksum\": return new ChecksumMismatchError(response, options);\n\t\tdefault: return assertNever(code);\n\t}\n}\nfunction classifyUnknownError(response, options) {\n\tif (response.status === 429) return new TooManyRequestsError(response, options);\n\tif (response.status === 503) return new ServiceUnavailableError(response, options);\n\tif (response.status === 408) return new RequestTimeoutError(response, options);\n\treturn new B2Error(response, options);\n}\n/**\n* Maps a B2 error response to the appropriate {@link B2Error} subclass.\n* Uses known error codes for exact matching, then falls back to HTTP status\n* codes for unknown future B2 codes.\n*\n* Maintainer note: when B2 documents a new error code, add it to\n* `KNOWN_B2_ERROR_CODES` in `src/types/errors.ts` and add a matching\n* `classifyKnownError` switch case. Unknown codes fall through to the\n* HTTP-status-based heuristic and finally to a generic `B2Error`, which is\n* safe but loses semantic specificity (the caller can't `instanceof` against\n* a precise subclass and the retry decision relies on status alone).\n*\n* @param response - Parsed B2 error response body.\n* @param options - Optional retry and request metadata from response headers.\n*\n* @returns A typed B2Error subclass instance.\n*/\nfunction classifyError(response, options) {\n\tif (response.code === \"internal_error\" && response.status !== 500) return classifyUnknownError(response, options);\n\tif (isKnownB2ErrorCode(response.code)) return classifyKnownError(response, response.code, options);\n\treturn classifyUnknownError(response, options);\n}\n//#endregion\nexport { AccessDeniedError, B2Error, B2InsufficientCapabilityError, B2RealmConfigurationError, B2RedirectError, B2SsrfError, BadAuthTokenError, BadBucketIdError, BadJsonError, BadRequestError, BadUploadUrlError, CapExceededError, ChecksumMismatchError, ConflictError, DuplicateBucketNameError, ExpiredAuthTokenError, FileNotPresentError, FinishLargeFileResponseBodyError, InternalError, InvalidBucketIdError, InvalidBucketInfoError, InvalidBucketNameError, InvalidFileIdError, InvalidFileInfoError, InvalidFileNameError, InvalidPartNumberError, MethodNotAllowedError, NetworkError, NotFoundError, OutOfRangeError, RangeNotSatisfiableError, RequestTimeoutError, ResumeFileIdMismatchError, ServiceUnavailableError, TooManyBucketsError, TooManyFilesError, TooManyRequestsError, UploadResponseBodyError, classifyError };\n\n//# sourceMappingURL=index.js.map","//#region src/util/best-effort.ts\n/**\n* Runs an async cleanup operation and swallows any rejection.\n*\n* Used at error-handling boundaries (e.g. after a multipart upload fails,\n* when trying to `cancelLargeFile` on the orphaned upload). The primary\n* error is what the caller wants to see; a secondary failure during\n* cleanup must not shadow it.\n*\n* Naming the pattern instead of inlining a try/catch with an empty catch\n* makes the intent explicit at the call site: this is best-effort cleanup,\n* not a silent error swallow.\n*\n* @param fn - Cleanup async function. Its return value is ignored; any\n* thrown error or rejected promise is caught and discarded.\n* @param onError - Optional observer called with the swallowed cleanup error.\n*\n* @returns A promise that always resolves, regardless of `fn`'s outcome.\n*\n* @example\n* ```ts\n* try {\n* await uploadParts(...)\n* } catch (err) {\n* await bestEffort(() =>\n* raw.cancelLargeFile(apiUrl, authToken, { fileId: largeFileId }),\n* )\n* throw err\n* }\n* ```\n*/\nasync function bestEffort(fn, onError) {\n\ttry {\n\t\tawait fn();\n\t} catch (error) {\n\t\ttry {\n\t\t\tonError?.(error);\n\t\t} catch {}\n\t}\n}\n//#endregion\nexport { bestEffort };\n\n//# sourceMappingURL=best-effort.js.map","import { FinishLargeFileResponseBodyError } from \"../errors/index.js\";\nimport { bestEffort } from \"../util/best-effort.js\";\n//#region src/upload/cancel.ts\n/** Default wall-clock bound for best-effort cleanup calls after upload failure. */\nvar DEFAULT_CLEANUP_TIMEOUT_MS = 3e4;\nvar fallbackCleanupDisposers = /* @__PURE__ */ new WeakMap();\n/**\n* Cancels an unfinished large file on a best-effort basis. Used at every\n* error-handling boundary in the multipart upload, write-stream, and\n* server-side copy paths to roll back in-progress uploads without\n* letting a cancellation failure mask the underlying error the caller\n* is about to see.\n*\n* Centralising the call removes a five-line `bestEffort` block that\n* recurred at six sites with identical shape — the only thing that\n* changed was the captured `fileId` and the surrounding error trail.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state for the API URL + token.\n* @param fileId - The in-progress large file ID to cancel.\n* @param options - Optional request controls and cleanup-failure observer.\n*\n* @returns A promise that always resolves, regardless of the cancel\n* call's outcome.\n*/\nasync function cancelLargeFileBestEffort(raw, accountInfo, fileId, options) {\n\tawait bestEffort(async () => {\n\t\tconst requestOptions = cleanupRequestOptions(options?.signal);\n\t\tawait waitForCleanup(raw.cancelLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId }, requestOptions), requestOptions.signal);\n\t}, (error) => options?.onCleanupFailure?.({\n\t\tfileId,\n\t\terror,\n\t\treason: \"cancel-failed\"\n\t}));\n}\n/**\n* Returns cleanup request controls with a live timeout signal.\n*\n* @param signal - Caller-provided abort signal, if any.\n* @param timeoutMs - Maximum time to spend waiting for cleanup.\n*\n* @returns Request controls with a signal independent of an already-aborted caller signal.\n*/\nfunction cleanupRequestOptions(signal, timeoutMs = DEFAULT_CLEANUP_TIMEOUT_MS) {\n\treturn { signal: createCleanupSignal(signal, timeoutMs) };\n}\nfunction createCleanupSignal(signal, timeoutMs) {\n\tif (typeof AbortSignal.timeout === \"function\") {\n\t\tif (signal === void 0 || signal.aborted) return AbortSignal.timeout(timeoutMs);\n\t\tif (typeof AbortSignal.any === \"function\") return AbortSignal.any([signal, AbortSignal.timeout(timeoutMs)]);\n\t}\n\treturn createFallbackCleanupSignal(signal, timeoutMs);\n}\nfunction createFallbackCleanupSignal(signal, timeoutMs) {\n\tconst controller = new AbortController();\n\tconst timeout = setTimeout(() => {\n\t\tabortFallbackCleanup(controller, cleanupTimeoutReason(), cleanup);\n\t}, timeoutMs);\n\tconst onAbort = () => {\n\t\tconst reason = signal === void 0 ? cleanupDomException(\"Cleanup aborted\", \"AbortError\") : cleanupAbortReason(signal);\n\t\tabortFallbackCleanup(controller, reason, cleanup);\n\t};\n\tconst cleanup = () => {\n\t\tclearTimeout(timeout);\n\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\tfallbackCleanupDisposers.delete(controller.signal);\n\t};\n\tfallbackCleanupDisposers.set(controller.signal, cleanup);\n\tif (signal === void 0 || signal.aborted) return controller.signal;\n\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\tcontroller.signal.addEventListener(\"abort\", cleanup, { once: true });\n\treturn controller.signal;\n}\nfunction abortFallbackCleanup(controller, reason, cleanup) {\n\tif (!controller.signal.aborted) controller.abort(reason);\n\tcleanup();\n}\nasync function waitForCleanup(request, signal) {\n\tif (signal.aborted) throw cleanupAbortReason(signal);\n\tlet removeAbortListener;\n\tconst aborted = new Promise((_resolve, reject) => {\n\t\tconst onAbort = () => reject(cleanupAbortReason(signal));\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\tawait Promise.race([request, aborted]);\n\t} finally {\n\t\tremoveAbortListener?.();\n\t\tfallbackCleanupDisposers.get(signal)?.();\n\t\trequest.catch(() => {});\n\t}\n}\nfunction cleanupAbortReason(signal) {\n\treturn signal.reason ?? cleanupDomException(\"Cleanup aborted\", \"AbortError\");\n}\nfunction cleanupTimeoutReason() {\n\treturn cleanupDomException(\"Cleanup timed out\", \"TimeoutError\");\n}\nfunction cleanupDomException(message, name) {\n\tif (typeof DOMException === \"function\") return new DOMException(message, name);\n\tconst error = new Error(message);\n\terror.name = name;\n\treturn error;\n}\n/**\n* Emits an observable cleanup event when cancellation is deliberately skipped\n* because `b2_finish_large_file` may already have committed the file.\n* @param fileId - Large file whose final state is ambiguous.\n* @param error - Ambiguous finish error that will be thrown to the caller.\n* @param onCleanupFailure - Optional observer for cleanup-related events.\n*/\nfunction notifyAmbiguousLargeFileCleanupSkipped(fileId, error, onCleanupFailure) {\n\ttry {\n\t\tonCleanupFailure?.({\n\t\t\tfileId,\n\t\t\terror,\n\t\t\treason: \"finish-ambiguous\"\n\t\t});\n\t} catch {}\n}\n/**\n* Adds high-level reconciliation metadata to an ambiguous finish response-body\n* error and notifies the cleanup observer that cancellation was skipped.\n*\n* @param err - Raw finish response-body error from the low-level client.\n* @param options - Large-file context used for reconciliation.\n*\n* @returns The enriched {@link FinishLargeFileResponseBodyError}.\n*/\nfunction handleAmbiguousFinishLargeFileResponseBodyError(err, options) {\n\tconst enriched = err.fileId === options.fileId && err.bucketId === options.bucketId && err.fileName === options.fileName ? err : new FinishLargeFileResponseBodyError(err.message, {\n\t\tcause: err.cause ?? err,\n\t\tfileId: options.fileId,\n\t\tbucketId: options.bucketId,\n\t\tfileName: options.fileName\n\t});\n\tnotifyAmbiguousLargeFileCleanupSkipped(options.fileId, enriched, options.onCleanupFailure);\n\treturn enriched;\n}\n/**\n* Performs the shared large-file failure policy: ambiguous finish-body errors\n* are enriched and left uncancelled, while all pre-finish errors trigger\n* best-effort cancellation.\n*\n* @param err - Error from a multipart upload/copy/write-stream path.\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param context - Large file metadata used for cleanup and diagnostics.\n* @param options - Cleanup policy controls.\n*\n* @returns The error that should be surfaced to the caller.\n*/\nasync function resolveLargeFileErrorAfterCleanup(err, raw, accountInfo, context, options = {}) {\n\tif (err instanceof FinishLargeFileResponseBodyError) return handleAmbiguousFinishLargeFileResponseBodyError(err, context);\n\tif (options.cancelOnError ?? true) await cancelLargeFileBestEffort(raw, accountInfo, context.fileId, {\n\t\t...context.signal !== void 0 ? { signal: context.signal } : {},\n\t\t...context.onCleanupFailure !== void 0 ? { onCleanupFailure: context.onCleanupFailure } : {}\n\t});\n\treturn err;\n}\n/**\n* Throwing wrapper around {@link resolveLargeFileErrorAfterCleanup} for paths\n* that can surface the error directly.\n* @param err - Error from a multipart upload/copy/write-stream path.\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param context - Large file metadata used for cleanup and diagnostics.\n* @param options - Cleanup policy controls.\n*\n* @throws The resolved large-file error after cleanup policy is applied.\n*/\nasync function cleanupAfterLargeFileError(err, raw, accountInfo, context, options) {\n\tthrow await resolveLargeFileErrorAfterCleanup(err, raw, accountInfo, context, options);\n}\n//#endregion\nexport { DEFAULT_CLEANUP_TIMEOUT_MS, cancelLargeFileBestEffort, cleanupAfterLargeFileError, cleanupRequestOptions, handleAmbiguousFinishLargeFileResponseBodyError, notifyAmbiguousLargeFileCleanupSkipped, resolveLargeFileErrorAfterCleanup };\n\n//# sourceMappingURL=cancel.js.map","import { FinishLargeFileResponseBodyError, NetworkError } from \"../errors/index.js\";\n//#region src/upload/finish.ts\n/**\n* Calls `b2_finish_large_file` and classifies failures after dispatch that can\n* hide an already-committed file as ambiguous finish failures.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param context - Finish request data and reconciliation metadata.\n*\n* @returns The completed file version metadata.\n*/\nasync function finishLargeFileWithAbortReconciliation(raw, accountInfo, context) {\n\tcontext.signal?.throwIfAborted();\n\ttry {\n\t\treturn await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tfileId: context.fileId,\n\t\t\tpartSha1Array: context.partSha1s\n\t\t}, context.signal === void 0 && context.retry === void 0 ? void 0 : {\n\t\t\t...context.signal !== void 0 ? { signal: context.signal } : {},\n\t\t\t...context.retry !== void 0 ? { retry: context.retry } : {}\n\t\t});\n\t} catch (err) {\n\t\tif (err instanceof FinishLargeFileResponseBodyError) throw finishLargeFileResponseBodyErrorWithContext(err, context);\n\t\tif (isAmbiguousFinishDispatchFailure(err, context.signal)) throw new FinishLargeFileResponseBodyError(\"b2_finish_large_file failed after dispatch; final file state is ambiguous.\", {\n\t\t\tcause: err,\n\t\t\tfileId: context.fileId,\n\t\t\tbucketId: context.bucketId,\n\t\t\tfileName: context.fileName\n\t\t});\n\t\tthrow err;\n\t}\n}\nfunction finishLargeFileResponseBodyErrorWithContext(err, context) {\n\tif (err.fileId === context.fileId && err.bucketId === context.bucketId && err.fileName === context.fileName) return err;\n\treturn new FinishLargeFileResponseBodyError(err.message, {\n\t\tcause: err.cause ?? err,\n\t\tfileId: context.fileId,\n\t\tbucketId: context.bucketId,\n\t\tfileName: context.fileName\n\t});\n}\nfunction isAmbiguousFinishDispatchFailure(err, signal) {\n\tif (err instanceof NetworkError) return true;\n\tif (isTimeoutError(err)) return true;\n\tif (signal?.aborted !== true) return false;\n\tif (signal.reason !== void 0 && Object.is(err, signal.reason)) return true;\n\treturn isAbortError(err);\n}\nfunction isAbortError(err) {\n\treturn err instanceof DOMException && err.name === \"AbortError\" || err instanceof Error && err.name === \"AbortError\";\n}\nfunction isTimeoutError(err) {\n\treturn err instanceof DOMException && err.name === \"TimeoutError\" || err instanceof Error && err.name === \"TimeoutError\";\n}\n//#endregion\nexport { finishLargeFileWithAbortReconciliation };\n\n//# sourceMappingURL=finish.js.map","//#region src/util/plan-ranges.ts\n/**\n* Lays out a sequence of contiguous, non-overlapping byte ranges over\n* `[0, totalSize)`. Every produced range is at most `chunkSize` bytes\n* long; the final range may be shorter if `totalSize` is not a multiple\n* of `chunkSize`.\n*\n* Replaces three near-identical hand-rolled loops in\n* `upload/large.ts`, `copy/large.ts`, and `download/parallel.ts`.\n*\n* @param totalSize - Total number of bytes to cover.\n* @param chunkSize - Target size of each range in bytes (last range may be smaller).\n*\n* @returns Ordered, non-overlapping range plans. Empty array when `totalSize === 0`.\n*/\nfunction planRanges(totalSize, chunkSize) {\n\tconst plans = [];\n\tlet offset = 0;\n\tlet index = 0;\n\twhile (offset < totalSize) {\n\t\tconst length = Math.min(chunkSize, totalSize - offset);\n\t\tconst end = offset + length - 1;\n\t\tplans.push({\n\t\t\tpartNumber: index + 1,\n\t\t\tindex,\n\t\t\toffset,\n\t\t\tlength,\n\t\t\tstart: offset,\n\t\t\tend\n\t\t});\n\t\toffset += length;\n\t\tindex++;\n\t}\n\treturn plans;\n}\n/**\n* Format an HTTP `Range:` request-header value covering the given\n* inclusive byte offsets. Centralises the `bytes=-` template\n* so the upload, copy, and download paths agree on syntax.\n*\n* @param start - Inclusive starting byte.\n* @param end - Inclusive ending byte.\n*\n* @returns The header value (e.g. `'bytes=0-99'`).\n*/\nfunction byteRangeHeader(start, end) {\n\treturn `bytes=${start}-${end}`;\n}\n//#endregion\nexport { byteRangeHeader, planRanges };\n\n//# sourceMappingURL=plan-ranges.js.map","import { MetadataDirective } from \"../types/file.js\";\nimport { fileId } from \"../types/ids.js\";\nimport { createAbortScope, raceWithAbort, throwRejectedOrAbortReason } from \"../upload/abort-scope.js\";\nimport { cancelLargeFileBestEffort, cleanupAfterLargeFileError } from \"../upload/cancel.js\";\nimport { Semaphore } from \"../upload/concurrency.js\";\nimport { finishLargeFileWithAbortReconciliation } from \"../upload/finish.js\";\nimport \"../util/defaults.js\";\nimport { byteRangeHeader, planRanges } from \"../util/plan-ranges.js\";\n//#region src/copy/large.ts\n/**\n* Performs a server-side copy of a file using the multipart `b2_copy_part` protocol.\n* The source bytes never traverse the client; B2 copies each range internally.\n*\n* Falls back to a single `copyFile` call when the source fits in one part.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state (used to resolve API URL, recommended part size).\n* @param options - Copy parameters including source, destination, and concurrency.\n*\n* @returns The resulting destination {@link FileVersion}.\n*/\nasync function copyLargeFile(raw, accountInfo, options) {\n\toptions.signal?.throwIfAborted();\n\tconst recommendedPartSize = accountInfo.getRecommendedPartSize();\n\tconst minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n\tconst partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n\tconst concurrency = options.concurrency ?? 4;\n\tconst sourceInfo = await raw.getFileInfo(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId: options.sourceFileId });\n\tconst totalSize = sourceInfo.contentLength;\n\tif (totalSize <= partSize) {\n\t\toptions.signal?.throwIfAborted();\n\t\tconst replaceMetadata = options.contentType !== void 0 || options.fileInfo !== void 0;\n\t\treturn raw.copyFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tsourceFileId: options.sourceFileId,\n\t\t\tfileName: options.fileName,\n\t\t\t...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : {},\n\t\t\t...replaceMetadata ? {\n\t\t\t\tmetadataDirective: MetadataDirective.Replace,\n\t\t\t\tcontentType: options.contentType ?? sourceInfo.contentType ?? \"b2/x-auto\",\n\t\t\t\tfileInfo: options.fileInfo ?? {}\n\t\t\t} : {},\n\t\t\t...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n\t\t\t...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}\n\t\t}, options.signal !== void 0 ? { signal: options.signal } : void 0);\n\t}\n\tconst destBucketId = options.destinationBucketId ?? sourceInfo.bucketId;\n\tconst ranges = planRanges(totalSize, partSize);\n\tconst partSha1s = new Array(ranges.length);\n\tconst sem = new Semaphore(concurrency);\n\tconst abortScope = createAbortScope(options.signal);\n\tlet largeFileId;\n\ttry {\n\t\tabortScope.signal.throwIfAborted();\n\t\tconst startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tbucketId: destBucketId,\n\t\t\tfileName: options.fileName,\n\t\t\tcontentType: options.contentType ?? sourceInfo.contentType ?? \"b2/x-auto\",\n\t\t\tfileInfo: options.fileInfo ?? {},\n\t\t\t...options.destinationServerSideEncryption !== void 0 ? { serverSideEncryption: options.destinationServerSideEncryption } : {}\n\t\t}, { signal: abortScope.signal });\n\t\ttry {\n\t\t\tlargeFileId = (await raceWithAbort(startPromise, abortScope.signal)).fileId;\n\t\t} catch (err) {\n\t\t\tif (abortScope.signal.aborted) cancelLargeFileAfterStart(startPromise, raw, accountInfo, options.onCleanupFailure);\n\t\t\tthrow err;\n\t\t}\n\t\tconst startedLargeFileId = largeFileId;\n\t\tif (startedLargeFileId === void 0) throw new Error(\"copyLargeFile: start did not return a large file ID.\");\n\t\tconst tasks = ranges.map(async (range) => {\n\t\t\tawait sem.acquire();\n\t\t\ttry {\n\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\tconst resp = await raceWithAbort(raw.copyPart(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\t\t\tsourceFileId: options.sourceFileId,\n\t\t\t\t\tlargeFileId: fileId(startedLargeFileId),\n\t\t\t\t\tpartNumber: range.partNumber,\n\t\t\t\t\trange: byteRangeHeader(range.start, range.end),\n\t\t\t\t\t...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n\t\t\t\t\t...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}\n\t\t\t\t}, { signal: abortScope.signal }), abortScope.signal);\n\t\t\t\tpartSha1s[range.partNumber - 1] = resp.contentSha1;\n\t\t\t} catch (err) {\n\t\t\t\tabortScope.abort(err);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsem.release();\n\t\t\t}\n\t\t});\n\t\tthrowRejectedOrAbortReason(await Promise.allSettled(tasks), abortScope);\n\t\treturn await finishLargeFileWithAbortReconciliation(raw, accountInfo, {\n\t\t\tfileId: startedLargeFileId,\n\t\t\tbucketId: destBucketId,\n\t\t\tfileName: options.fileName,\n\t\t\tpartSha1s,\n\t\t\tsignal: abortScope.signal\n\t\t});\n\t} catch (err) {\n\t\tabortScope.abort(err);\n\t\tif (largeFileId === void 0) throw err;\n\t\treturn await cleanupAfterLargeFileError(err, raw, accountInfo, {\n\t\t\tfileId: largeFileId,\n\t\t\tbucketId: destBucketId,\n\t\t\tfileName: options.fileName,\n\t\t\tsignal: options.signal,\n\t\t\tonCleanupFailure: options.onCleanupFailure\n\t\t});\n\t} finally {\n\t\tabortScope.dispose();\n\t}\n}\nfunction cancelLargeFileAfterStart(started, raw, accountInfo, onCleanupFailure) {\n\tstarted.then((resp) => cancelLargeFileBestEffort(raw, accountInfo, resp.fileId, onCleanupFailure === void 0 ? void 0 : { onCleanupFailure })).catch(() => {});\n}\n//#endregion\nexport { copyLargeFile };\n\n//# sourceMappingURL=large.js.map","//#region src/util/text-codec.ts\n/**\n* Shared UTF-8 codec singletons.\n*\n* Every byte boundary in this SDK is UTF-8: JSON request and response bodies,\n* webhook payloads, simulator stream chunks, and B2 percent-encoding inputs.\n* Allocating a fresh `TextEncoder` / `TextDecoder` per call is wasteful and\n* makes the encoding assumption invisible. Importing these constants makes\n* \"we use UTF-8\" explicit at every call site and avoids the per-call\n* allocation entirely.\n*\n* Both classes are spec-defined as stateless across encode / decode calls,\n* so a process-wide singleton is safe.\n*\n* @packageDocumentation\n*/\n/**\n* Process-wide UTF-8 `TextEncoder`. Use this instead of\n* `new TextEncoder()` for any string → bytes conversion in the SDK.\n*/\nvar utf8Encoder = new TextEncoder();\n/**\n* Process-wide UTF-8 `TextDecoder`. Use this instead of\n* `new TextDecoder()` for any bytes → string conversion in the SDK.\n*/\nvar utf8Decoder = new TextDecoder();\n//#endregion\nexport { utf8Decoder, utf8Encoder };\n\n//# sourceMappingURL=text-codec.js.map","import { utf8Encoder } from \"../util/text-codec.js\";\n//#region src/raw/encoding.ts\n/**\n* Characters that B2 treats as safe (not percent-encoded) in file names.\n*\n* Per the B2 docs, everything except `a-z A-Z 0-9 - . _ ~ / ! $ & ' ( ) * + , ; = : @`\n* must be percent-encoded using UTF-8 byte values.\n*/\nvar SAFE_CHARS = new Set(\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@/\".split(\"\"));\n/**\n* Percent-encodes a file name using the B2-specific encoding rules.\n*\n* Unlike standard `encodeURIComponent`, B2 keeps `/` and several other\n* characters unencoded while encoding all other non-ASCII and special\n* characters as uppercase percent-encoded UTF-8 bytes.\n*\n* @param name - The raw (unencoded) file name.\n*\n* @returns The percent-encoded file name suitable for `X-Bz-File-Name` headers.\n*/\nfunction encodeFileName(name) {\n\tconst encoded = [];\n\tfor (const char of name) if (SAFE_CHARS.has(char)) encoded.push(char);\n\telse {\n\t\tconst bytes = utf8Encoder.encode(char);\n\t\tfor (const byte of bytes) encoded.push(`%${byte.toString(16).toUpperCase().padStart(2, \"0\")}`);\n\t}\n\treturn encoded.join(\"\");\n}\n/**\n* Decodes a B2 percent-encoded file name back to a plain string.\n*\n* B2 percent-encoding is compatible with standard `decodeURIComponent`,\n* so this is a thin wrapper.\n*\n* @param encoded - The percent-encoded file name from B2.\n*\n* @returns The decoded file name.\n*/\nfunction decodeFileName(encoded) {\n\treturn decodeURIComponent(encoded);\n}\n/**\n* Converts a file-info map into `X-Bz-Info-*` HTTP headers.\n*\n* Both keys and values are percent-encoded with {@link encodeFileName}\n* to satisfy B2 header requirements.\n*\n* @param fileInfo - Key/value pairs to attach as custom file info, or `undefined`.\n*\n* @returns A record of header name/value pairs (empty if `fileInfo` is `undefined`).\n*/\nfunction buildFileInfoHeaders(fileInfo) {\n\tif (!fileInfo) return {};\n\tconst headers = {};\n\tfor (const [key, value] of Object.entries(fileInfo)) headers[`X-Bz-Info-${encodeFileName(key)}`] = encodeFileName(value);\n\treturn headers;\n}\n/**\n* Extracts custom file-info key/value pairs from B2 response headers.\n*\n* Scans for headers prefixed with `x-bz-info-` and decodes both the\n* key suffix and value using {@link decodeFileName}.\n*\n* @param headers - The HTTP response headers from a B2 download or file-info call.\n*\n* @returns A record of decoded file-info key/value pairs.\n*/\nfunction parseFileInfoHeaders(headers) {\n\tconst info = {};\n\theaders.forEach((value, key) => {\n\t\tconst lower = key.toLowerCase();\n\t\tif (lower.startsWith(\"x-bz-info-\")) {\n\t\t\tconst infoKey = decodeFileName(lower.slice(10));\n\t\t\tinfo[infoKey] = decodeFileName(value);\n\t\t}\n\t});\n\treturn info;\n}\n//#endregion\nexport { buildFileInfoHeaders, decodeFileName, encodeFileName, parseFileInfoHeaders };\n\n//# sourceMappingURL=encoding.js.map","//#region src/streams/progress.ts\n/**\n* Accumulates byte and part counts and emits {@link ProgressEvent}s to a listener.\n*\n* Internal building block. The SDK wires one of these inside every\n* transfer that accepts an `onProgress` option; users supply the\n* listener callback, not the tracker. Exported only so SDK source\n* modules can import it; not re-exported through any subpath.\n*\n* @internal\n*/\nvar ProgressTracker = class {\n\tlistener;\n\ttotalBytes;\n\ttotalParts;\n\t/** Running total of bytes transferred. */\n\tbytesTransferred = 0;\n\t/** Running count of completed parts. */\n\tpartsCompleted = 0;\n\t/** Timestamp when tracking began. */\n\tstartTime;\n\t/**\n\t* Creates a new ProgressTracker.\n\t* @param listener - Callback to receive progress events, or undefined to disable.\n\t* @param totalBytes - Expected total bytes, or null if unknown.\n\t* @param totalParts - Expected total parts, or null if not a multipart transfer.\n\t*/\n\tconstructor(listener, totalBytes, totalParts) {\n\t\tthis.listener = listener;\n\t\tthis.totalBytes = totalBytes;\n\t\tthis.totalParts = totalParts;\n\t\tthis.startTime = Date.now();\n\t}\n\t/**\n\t* Record that additional bytes have been transferred and notify the listener.\n\t* @param count - The number of additional bytes that were transferred.\n\t*/\n\taddBytes(count) {\n\t\tthis.bytesTransferred += count;\n\t\tthis.emit();\n\t}\n\t/** Record that a multipart part has completed and notify the listener. */\n\tcompletePart() {\n\t\tthis.partsCompleted++;\n\t\tthis.emit();\n\t}\n\t/** Emit the current progress snapshot to the listener, if one is registered. */\n\temit() {\n\t\tthis.listener?.({\n\t\t\tbytesTransferred: this.bytesTransferred,\n\t\t\ttotalBytes: this.totalBytes,\n\t\t\tpartsCompleted: this.partsCompleted,\n\t\t\ttotalParts: this.totalParts,\n\t\t\telapsedMs: Date.now() - this.startTime\n\t\t});\n\t}\n};\n//#endregion\nexport { ProgressTracker };\n\n//# sourceMappingURL=progress.js.map","//#region src/util/normalize.ts\n/**\n* Wire-shape → SDK-shape normalization helpers.\n*\n* B2 occasionally uses sentinel strings on the wire where a missing\n* value would be more idiomatic in TypeScript. The biggest offender is\n* `contentSha1: 'none'` on files completed via `b2_finish_large_file`\n* (multipart-finished files don't have a whole-file SHA-1; B2 sends the\n* literal three-letter string). The SDK's `FileVersion.contentSha1` is\n* typed `string | null` to signal that absence — this module collapses\n* the wire sentinel to `null` so callers can write\n* `if (fv.contentSha1) { ... }` without an extra `=== 'none'` guard.\n*\n* Normalization happens at the RawClient boundary so every SDK consumer\n* (RawClient direct users, the high-level facade, the simulator-driven\n* tests, generated docs) sees the same `null` value.\n*\n* @packageDocumentation\n*/\n/**\n* Collapses the B2 wire sentinel `'none'` (and `undefined`) to `null` for\n* SHA-1-shaped fields. Any other string passes through unchanged.\n*\n* @param raw - SHA-1 string from the wire, or `null`/`undefined`.\n*\n* @returns A hex SHA-1 string, or `null` when the wire said \"no hash\".\n*/\nfunction normalizeSha1(raw) {\n\tif (raw === null || raw === void 0 || raw === \"none\") return null;\n\treturn raw;\n}\n/**\n* Returns a new file-version-shaped object with the `contentSha1: 'none'`\n* sentinel collapsed to `null`. Pass-through when the value is already\n* `null` or a real hash. The object reference is preserved if no\n* substitution was needed, so callers paying for change detection\n* (e.g. React memo) see referential stability.\n*\n* @typeParam T - Any object with a `contentSha1: string | null` field.\n*\n* @param fv - The wire-shape file-version object.\n*\n* @returns Either `fv` unchanged or a shallow copy with `contentSha1: null`.\n*/\nfunction normalizeFileVersionSha1(fv) {\n\treturn fv.contentSha1 === \"none\" ? {\n\t\t...fv,\n\t\tcontentSha1: null\n\t} : fv;\n}\n/**\n* Returns a new list-response object with `normalizeFileVersionSha1`\n* applied to every entry in `files`. Used at the `b2_list_file_names` /\n* `b2_list_file_versions` boundary so list output shares the same\n* SHA-1 semantics as the singular endpoints.\n*\n* @typeParam F - Any object with a `contentSha1: string | null` field.\n* @typeParam R - The list-response shape (must have a `files` array of `F`).\n*\n* @param resp - The wire-shape list response.\n*\n* @returns A response with normalized `files`. `resp.files` is a new array.\n*/\nfunction normalizeFileVersionListSha1(resp) {\n\treturn {\n\t\t...resp,\n\t\tfiles: resp.files.map(normalizeFileVersionSha1)\n\t};\n}\n//#endregion\nexport { normalizeFileVersionListSha1, normalizeFileVersionSha1, normalizeSha1 };\n\n//# sourceMappingURL=normalize.js.map","import { arrayBufferFor } from \"../util/bytes.js\";\nimport { hexEncode } from \"../util/crypto.js\";\n//#region src/streams/hash.ts\nvar nodeCreateHash;\n/**\n* Lazily loads `node:crypto` and caches the factory. Returns null in non-Node runtimes.\n*\n* @returns The cached hash factory, or null if Node crypto is unavailable.\n*/\nasync function getNodeCreateHash() {\n\tif (nodeCreateHash !== void 0) return nodeCreateHash;\n\ttry {\n\t\tconst crypto = await import(\"node:crypto\");\n\t\tif (typeof crypto.createHash !== \"function\") throw new Error(\"createHash unavailable\");\n\t\tnodeCreateHash = (algo) => {\n\t\t\tconst h = crypto.createHash(algo);\n\t\t\treturn {\n\t\t\t\tupdate(data) {\n\t\t\t\t\th.update(data);\n\t\t\t\t},\n\t\t\t\tdigest(encoding) {\n\t\t\t\t\treturn h.digest(encoding);\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t} catch {\n\t\t/* v8 ignore next -- non-Node runtime fallback, unreachable in Node coverage. */\n\t\tnodeCreateHash = null;\n\t}\n\treturn nodeCreateHash;\n}\n/**\n* Incrementally computes SHA-1 hashes over streaming data.\n* Uses Node.js `crypto` when available, falling back to a dependency-free\n* incremental JavaScript implementation.\n*/\nvar IncrementalSha1 = class {\n\t/** Total bytes fed into the hash so far. */\n\ttotalLength = 0;\n\t/** Node.js hash instance, or null if using the JavaScript fallback. */\n\tnodeHash = null;\n\t/** Streaming JavaScript fallback used when Node crypto is unavailable. */\n\tjsHash = new JsSha1Hasher();\n\t/** Resolves once the crypto backend has been loaded. */\n\tinitPromise;\n\t/** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */\n\tconstructor() {\n\t\tthis.initPromise = getNodeCreateHash().then((factory) => {\n\t\t\tif (factory) this.nodeHash = factory(\"sha1\");\n\t\t});\n\t}\n\t/**\n\t* Feed data into the hash. Async because it lazily initializes the crypto backend.\n\t* @param data - The bytes to include in the hash computation.\n\t*\n\t* @returns A promise that resolves once the data has been consumed.\n\t*/\n\tasync update(data) {\n\t\tawait this.initPromise;\n\t\tif (this.nodeHash) this.nodeHash.update(data);\n\t\telse\n /* v8 ignore next -- WebCrypto fallback is exercised by browser-mode tests. */\n\t\tthis.jsHash.update(data);\n\t\tthis.totalLength += data.byteLength;\n\t}\n\t/**\n\t* Finalize the hash and return the hex-encoded SHA-1 digest.\n\t* @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.\n\t*/\n\tasync digest() {\n\t\tawait this.initPromise;\n\t\tif (this.nodeHash) return this.nodeHash.digest(\"hex\");\n\t\t/* v8 ignore next -- non-Node runtime fallback, exercised by browser-mode tests */\n\t\treturn this.jsHash.digest();\n\t}\n\t/**\n\t* Total number of bytes fed into the hash so far.\n\t*\n\t* @returns The cumulative byte count across all update calls.\n\t*/\n\tget bytesProcessed() {\n\t\treturn this.totalLength;\n\t}\n};\n/* v8 ignore start -- JavaScript fallback path, exercised by browser-mode tests */\nvar JsSha1Hasher = class {\n\th0 = 1732584193;\n\th1 = 4023233417;\n\th2 = 2562383102;\n\th3 = 271733878;\n\th4 = 3285377520;\n\tblock = /* @__PURE__ */ new Uint8Array(64);\n\tblockLength = 0;\n\tbytesProcessed = 0;\n\tdigested = false;\n\twords = /* @__PURE__ */ new Uint32Array(80);\n\tupdate(data) {\n\t\tif (this.digested) throw new Error(\"SHA-1 digest has already been finalized\");\n\t\tthis.bytesProcessed += data.byteLength;\n\t\tlet offset = 0;\n\t\tif (this.blockLength > 0) {\n\t\t\tconst toCopy = Math.min(64 - this.blockLength, data.byteLength);\n\t\t\tthis.block.set(data.subarray(0, toCopy), this.blockLength);\n\t\t\tthis.blockLength += toCopy;\n\t\t\toffset = toCopy;\n\t\t\tif (this.blockLength === 64) {\n\t\t\t\tthis.processBlock(this.block, 0);\n\t\t\t\tthis.blockLength = 0;\n\t\t\t}\n\t\t}\n\t\twhile (offset + 64 <= data.byteLength) {\n\t\t\tthis.processBlock(data, offset);\n\t\t\toffset += 64;\n\t\t}\n\t\tif (offset < data.byteLength) {\n\t\t\tthis.block.set(data.subarray(offset), 0);\n\t\t\tthis.blockLength = data.byteLength - offset;\n\t\t}\n\t}\n\tdigest() {\n\t\tif (this.digested) throw new Error(\"SHA-1 digest has already been finalized\");\n\t\tthis.digested = true;\n\t\tconst bitLengthHigh = Math.floor(this.bytesProcessed / 536870912);\n\t\tconst bitLengthLow = this.bytesProcessed << 3 >>> 0;\n\t\tthis.block[this.blockLength] = 128;\n\t\tthis.blockLength++;\n\t\tif (this.blockLength > 56) {\n\t\t\tthis.block.fill(0, this.blockLength, 64);\n\t\t\tthis.processBlock(this.block, 0);\n\t\t\tthis.blockLength = 0;\n\t\t}\n\t\tthis.block.fill(0, this.blockLength, 56);\n\t\tthis.writeUint32(56, bitLengthHigh);\n\t\tthis.writeUint32(60, bitLengthLow);\n\t\tthis.processBlock(this.block, 0);\n\t\treturn wordToHex(this.h0) + wordToHex(this.h1) + wordToHex(this.h2) + wordToHex(this.h3) + wordToHex(this.h4);\n\t}\n\twriteUint32(offset, value) {\n\t\tthis.block[offset] = value >>> 24 & 255;\n\t\tthis.block[offset + 1] = value >>> 16 & 255;\n\t\tthis.block[offset + 2] = value >>> 8 & 255;\n\t\tthis.block[offset + 3] = value & 255;\n\t}\n\tprocessBlock(block, offset) {\n\t\tconst words = this.words;\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tconst j = offset + i * 4;\n\t\t\twords[i] = (block[j] ?? 0) << 24 | (block[j + 1] ?? 0) << 16 | (block[j + 2] ?? 0) << 8 | (block[j + 3] ?? 0);\n\t\t}\n\t\tfor (let i = 16; i < 80; i++) words[i] = rotateLeft((words[i - 3] ?? 0) ^ (words[i - 8] ?? 0) ^ (words[i - 14] ?? 0) ^ (words[i - 16] ?? 0), 1);\n\t\tlet a = this.h0;\n\t\tlet b = this.h1;\n\t\tlet c = this.h2;\n\t\tlet d = this.h3;\n\t\tlet e = this.h4;\n\t\tfor (let i = 0; i < 80; i++) {\n\t\t\tlet f;\n\t\t\tlet k;\n\t\t\tif (i < 20) {\n\t\t\t\tf = b & c | ~b & d;\n\t\t\t\tk = 1518500249;\n\t\t\t} else if (i < 40) {\n\t\t\t\tf = b ^ c ^ d;\n\t\t\t\tk = 1859775393;\n\t\t\t} else if (i < 60) {\n\t\t\t\tf = b & c | b & d | c & d;\n\t\t\t\tk = 2400959708;\n\t\t\t} else {\n\t\t\t\tf = b ^ c ^ d;\n\t\t\t\tk = 3395469782;\n\t\t\t}\n\t\t\tconst temp = rotateLeft(a, 5) + f + e + k + (words[i] ?? 0) >>> 0;\n\t\t\te = d;\n\t\t\td = c;\n\t\t\tc = rotateLeft(b, 30);\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}\n\t\tthis.h0 = this.h0 + a >>> 0;\n\t\tthis.h1 = this.h1 + b >>> 0;\n\t\tthis.h2 = this.h2 + c >>> 0;\n\t\tthis.h3 = this.h3 + d >>> 0;\n\t\tthis.h4 = this.h4 + e >>> 0;\n\t}\n};\nfunction rotateLeft(value, bits) {\n\treturn (value << bits | value >>> 32 - bits) >>> 0;\n}\nfunction wordToHex(word) {\n\treturn word.toString(16).padStart(8, \"0\");\n}\n/* v8 ignore stop */\n/**\n* Compute the SHA-1 hex digest of a complete byte array in one shot.\n* @param data - The byte array to hash.\n*\n* @returns The lowercase hex-encoded SHA-1 digest of the input.\n*/\nasync function sha1Hex(data) {\n\tconst factory = await getNodeCreateHash();\n\tif (factory) {\n\t\tconst h = factory(\"sha1\");\n\t\th.update(data);\n\t\treturn h.digest(\"hex\");\n\t}\n\t/* v8 ignore start -- WebCrypto fallback, only reachable when node:crypto is unavailable */\n\tconst hashBuffer = await crypto.subtle.digest(\"SHA-1\", arrayBufferFor(data));\n\treturn hexEncode(new Uint8Array(hashBuffer));\n\t/* v8 ignore stop */\n}\n//#endregion\nexport { IncrementalSha1, sha1Hex };\n\n//# sourceMappingURL=hash.js.map","//#region src/util/sha1.ts\nvar sha1HexPattern = /^[0-9a-f]{40}$/i;\n/**\n* Returns whether a value is a verifiable 40-character hexadecimal SHA-1 digest.\n*\n* @param sha1 - SHA-1 value, or null/undefined when unavailable.\n*\n* @returns True when the value is a 40-character hexadecimal SHA-1 digest.\n*/\nfunction isVerifiableSha1(sha1) {\n\treturn sha1 !== null && sha1 !== void 0 && sha1HexPattern.test(sha1);\n}\n/**\n* Normalizes a verifiable SHA-1 digest to lowercase.\n*\n* @param sha1 - SHA-1 value, or null/undefined when unavailable.\n*\n* @returns A lowercase SHA-1 digest, or null when the value is not verifiable.\n*/\nfunction normalizeVerifiableSha1(sha1) {\n\treturn isVerifiableSha1(sha1) ? sha1.toLowerCase() : null;\n}\n//#endregion\nexport { isVerifiableSha1, normalizeVerifiableSha1 };\n\n//# sourceMappingURL=sha1.js.map","import { ChecksumMismatchError } from \"../errors/index.js\";\nimport { IncrementalSha1 } from \"../streams/hash.js\";\nimport { isVerifiableSha1 } from \"../util/sha1.js\";\n//#region src/download/checksum.ts\n/**\n* Client-side checksum helpers for download streams.\n*\n* B2 sends `X-Bz-Content-Sha1` on download responses when a whole-file\n* checksum is available. These helpers verify streamed bytes against that\n* header without buffering the full response in memory.\n*\n* @packageDocumentation\n*/\n/**\n* Builds the typed error used when downloaded bytes fail SHA-1 verification.\n*\n* @param expectedSha1 - SHA-1 digest advertised by the download response.\n* @param actualSha1 - SHA-1 digest computed from the downloaded bytes.\n*\n* @returns A typed checksum mismatch error.\n*/\nfunction createDownloadChecksumMismatchError(expectedSha1, actualSha1) {\n\treturn new ChecksumMismatchError({\n\t\tstatus: 400,\n\t\tcode: \"bad_sha1_checksum\",\n\t\tmessage: `Downloaded content SHA-1 mismatch: expected ${expectedSha1.toLowerCase()}, got ${actualSha1.toLowerCase()}`\n\t});\n}\n/**\n* Throws when a computed download SHA-1 does not match the expected value.\n*\n* @param expectedSha1 - SHA-1 digest advertised by the download response.\n* @param actualSha1 - SHA-1 digest computed from the downloaded bytes.\n*\n* @throws ChecksumMismatchError when the two digests differ.\n*/\nfunction assertDownloadSha1(expectedSha1, actualSha1) {\n\tif (actualSha1.toLowerCase() !== expectedSha1.toLowerCase()) throw createDownloadChecksumMismatchError(expectedSha1, actualSha1);\n}\n/**\n* Throws when two range responses disagree about the expected whole-file SHA-1.\n*\n* @param expectedSha1 - The first range's verifiable SHA-1, or null when unavailable.\n* @param actualSha1 - The current range's verifiable SHA-1, or null when unavailable.\n*\n* @throws ChecksumMismatchError when the two header states differ.\n*/\nfunction assertDownloadSha1HeaderAgreement(expectedSha1, actualSha1) {\n\tif (expectedSha1 === actualSha1) return;\n\tthrow new ChecksumMismatchError({\n\t\tstatus: 400,\n\t\tcode: \"bad_sha1_checksum\",\n\t\tmessage: `Downloaded content SHA-1 header mismatch: expected ${formatSha1ForMessage(expectedSha1)}, got ${formatSha1ForMessage(actualSha1)}`\n\t});\n}\n/**\n* Wraps a download stream with whole-body SHA-1 verification.\n*\n* If B2 did not provide a verifiable whole-file SHA-1 (for example,\n* multipart-finished files report `none`), the original stream is returned.\n*\n* @param body - Download response body.\n* @param expectedSha1 - Normalized SHA-1 header value, or null when unavailable.\n*\n* @returns A stream that emits the same bytes and errors on checksum mismatch.\n*/\nfunction verifyDownloadStream(body, expectedSha1) {\n\tif (!isVerifiableSha1(expectedSha1)) return body;\n\tconst sha1 = new IncrementalSha1();\n\tconst transform = new TransformStream({\n\t\tasync transform(chunk, controller) {\n\t\t\tawait sha1.update(chunk);\n\t\t\tcontroller.enqueue(chunk);\n\t\t},\n\t\tasync flush() {\n\t\t\tassertDownloadSha1(expectedSha1, await sha1.digest());\n\t\t}\n\t});\n\treturn body.pipeThrough(transform);\n}\nfunction formatSha1ForMessage(sha1) {\n\treturn sha1 === null ? \"missing or unverifiable\" : sha1.toLowerCase();\n}\n//#endregion\nexport { assertDownloadSha1, assertDownloadSha1HeaderAgreement, verifyDownloadStream };\n\n//# sourceMappingURL=checksum.js.map","import { fileId } from \"../types/ids.js\";\nimport { bestEffort } from \"../util/best-effort.js\";\nimport { parseFileInfoHeaders } from \"../raw/encoding.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { normalizeSha1 } from \"../util/normalize.js\";\nimport { verifyDownloadStream } from \"./checksum.js\";\n//#region src/download/single.ts\n/**\n* Downloads a file by its unique ID in a single HTTP request.\n*\n* Returns a streaming body suitable for small-to-medium files. For large files\n* that benefit from concurrent ranged fetches, use\n* {@link createParallelDownloadStream} instead.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - Download parameters.\n*\n* @returns Parsed headers and a readable stream of file bytes.\n*/\nasync function downloadById(raw, accountInfo, options) {\n\tconst resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.fileId, toRawDownloadOptions(options));\n\tconst headers = extractDownloadHeaders(resp.headers);\n\treturn {\n\t\theaders,\n\t\tbody: prepareDownloadBody(resp.body ?? emptyStream(), headers, options)\n\t};\n}\n/**\n* Downloads a file by bucket name and file path in a single HTTP request.\n*\n* Returns a streaming body suitable for small-to-medium files. For large files\n* that benefit from concurrent ranged fetches, use\n* {@link createParallelDownloadStream} instead.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - Download parameters.\n*\n* @returns Parsed headers and a readable stream of file bytes.\n*/\nasync function downloadByName(raw, accountInfo, options) {\n\tconst resp = await raw.downloadFileByName(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.bucketName, options.fileName, toRawDownloadOptions(options));\n\tconst headers = extractDownloadHeaders(resp.headers);\n\treturn {\n\t\theaders,\n\t\tbody: prepareDownloadBody(resp.body ?? emptyStream(), headers, options)\n\t};\n}\n/**\n* Issues a HEAD-by-ID request and returns parsed headers only. Drains\n* the (logically empty) response body internally so callers don't have\n* to remember to `body.cancel()` themselves.\n*\n* Prefer this over `downloadById({ method: 'HEAD' })` — same wire-level\n* effect, but the caller-facing result has no `body` field at all so\n* there's nothing to clean up.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - HEAD parameters (file ID + the same response-header\n* overrides and abort signal that `downloadById` accepts).\n*\n* @returns Parsed download headers (no body field).\n*/\nasync function headById(raw, accountInfo, options) {\n\tconst resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.fileId, {\n\t\t...toRawDownloadOptions(options),\n\t\tmethod: \"HEAD\"\n\t});\n\tif (resp.body !== null) {\n\t\tconst body = resp.body;\n\t\tawait bestEffort(() => body.cancel());\n\t}\n\treturn { headers: extractDownloadHeaders(resp.headers) };\n}\n/**\n* Issues a HEAD-by-name request and returns parsed headers only. Drains\n* the (logically empty) response body internally so callers don't have\n* to remember to `body.cancel()` themselves.\n*\n* Prefer this over `downloadByName({ method: 'HEAD' })` — same wire-level\n* effect, but the caller-facing result has no `body` field at all so\n* there's nothing to clean up.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - HEAD parameters (bucket + file name + the same\n* response-header overrides and abort signal that `downloadByName`\n* accepts).\n*\n* @returns Parsed download headers (no body field).\n*/\nasync function headByName(raw, accountInfo, options) {\n\tconst resp = await raw.downloadFileByName(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.bucketName, options.fileName, {\n\t\t...toRawDownloadOptions(options),\n\t\tmethod: \"HEAD\"\n\t});\n\tif (resp.body !== null) {\n\t\tconst body = resp.body;\n\t\tawait bestEffort(() => body.cancel());\n\t}\n\treturn { headers: extractDownloadHeaders(resp.headers) };\n}\n/**\n* Translates the public download-options shape into the raw client's\n* {@link DownloadFileOptions}, dropping the request-target fields (`fileId`,\n* `bucketName`, `fileName`) that don't apply at the transport layer.\n*\n* @param options - Caller-supplied download options.\n*\n* @returns The raw transport-layer options.\n*/\nfunction toRawDownloadOptions(options) {\n\treturn {\n\t\t...options.method !== void 0 ? { method: options.method } : {},\n\t\t...options.range !== void 0 ? { range: options.range } : {},\n\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n\t\t...options.b2ContentDisposition !== void 0 ? { b2ContentDisposition: options.b2ContentDisposition } : {},\n\t\t...options.b2ContentLanguage !== void 0 ? { b2ContentLanguage: options.b2ContentLanguage } : {},\n\t\t...options.b2ContentEncoding !== void 0 ? { b2ContentEncoding: options.b2ContentEncoding } : {},\n\t\t...options.b2ContentType !== void 0 ? { b2ContentType: options.b2ContentType } : {},\n\t\t...options.b2CacheControl !== void 0 ? { b2CacheControl: options.b2CacheControl } : {},\n\t\t...options.b2Expires !== void 0 ? { b2Expires: options.b2Expires } : {},\n\t\t...options.signal !== void 0 ? { signal: options.signal } : {}\n\t};\n}\n/**\n* Builds an immediately-closed empty ReadableStream. Used as the body of a\n* HEAD download response so callers always get a stream they can `pipeTo`.\n*\n* @returns A ReadableStream that yields zero bytes and immediately closes.\n*/\nfunction emptyStream() {\n\treturn new ReadableStream({ start(controller) {\n\t\tcontroller.close();\n\t} });\n}\n/**\n* Applies stream wrappers common to single-request downloads.\n*\n* Full-body GET downloads are checksum-verified when B2 supplies a real\n* whole-file SHA-1. HEAD requests and ranged GETs are skipped because the\n* response body is empty or partial while `X-Bz-Content-Sha1` describes the\n* full file version.\n*\n* @param body - Download response body.\n* @param headers - Parsed download headers.\n* @param options - Caller-supplied download options.\n*\n* @returns A stream wrapped for checksum verification and progress reporting.\n*/\nfunction prepareDownloadBody(body, headers, options) {\n\treturn instrumentProgress(options.method !== \"HEAD\" && options.range === void 0 ? verifyDownloadStream(body, headers.contentSha1) : body, headers.contentLength, options.onProgress);\n}\n/**\n* Wraps a body stream with a `TransformStream` that increments a\n* {@link ProgressTracker} for each chunk and reports `partsCompleted: 1`\n* when the stream finishes.\n*\n* When `listener` is undefined the function short-circuits and returns\n* the original stream, so unobserved downloads pay no overhead.\n*\n* @param body - The download response body to wrap.\n* @param totalBytes - Expected total bytes (response `Content-Length`).\n* @param listener - Caller-supplied progress callback, or undefined.\n*\n* @returns A stream that emits the same bytes and reports progress.\n*/\nfunction instrumentProgress(body, totalBytes, listener) {\n\tif (listener === void 0) return body;\n\tconst tracker = new ProgressTracker(listener, totalBytes, 1);\n\tconst transform = new TransformStream({\n\t\ttransform(chunk, controller) {\n\t\t\ttracker.addBytes(chunk.byteLength);\n\t\t\tcontroller.enqueue(chunk);\n\t\t},\n\t\tflush() {\n\t\t\ttracker.completePart();\n\t\t}\n\t});\n\treturn body.pipeThrough(transform);\n}\n/**\n* Extracts B2-specific download headers into a structured object.\n* @param headers - The HTTP response headers from the download.\n*\n* @returns The parsed download metadata.\n*/\nfunction extractDownloadHeaders(headers) {\n\tconst fileInfo = parseFileInfoHeaders(headers);\n\treturn {\n\t\tcontentType: headers.get(\"Content-Type\") ?? \"application/octet-stream\",\n\t\tcontentLength: Number.parseInt(headers.get(\"Content-Length\") ?? \"0\", 10),\n\t\tcontentSha1: normalizeSha1(headers.get(\"X-Bz-Content-Sha1\")),\n\t\tfileId: fileId(headers.get(\"X-Bz-File-Id\") ?? \"\"),\n\t\tfileName: decodeURIComponent(headers.get(\"X-Bz-File-Name\") ?? \"\"),\n\t\tfileInfo,\n\t\tuploadTimestamp: Number.parseInt(headers.get(\"X-Bz-Upload-Timestamp\") ?? \"0\", 10)\n\t};\n}\n//#endregion\nexport { downloadById, downloadByName, headById, headByName };\n\n//# sourceMappingURL=single.js.map","//#region src/internal/upload-retry-options.ts\n/**\n* Merges client upload retry defaults with a per-call override.\n* @param defaults - Resolved client upload retry defaults.\n* @param override - Per-call retry option overrides, if any.\n*\n* @returns Retry options for one high-level upload operation.\n*\n* @internal\n*/\nfunction mergeUploadRetryOptions(defaults, override) {\n\tif (override === void 0) return defaults;\n\treturn {\n\t\t...defaults,\n\t\t...override\n\t};\n}\n//#endregion\nexport { mergeUploadRetryOptions };\n\n//# sourceMappingURL=upload-retry-options.js.map","import { arrayBufferFor } from \"../util/bytes.js\";\nimport { collectStream } from \"./collect.js\";\nimport { FileSource } from \"./file-source.js\";\n//#region src/streams/source.ts\nvar READABLE_STREAM_SIZE_REQUIRED_ERROR = \"size is required when using a ReadableStream as input.\";\nvar FORWARD_ONLY_SIZE_REQUIRED_ERROR = \"size is required when using a forward-only content source as input.\";\nvar STREAM_SOURCE_ENDED_EARLY_ERROR = \"StreamSource ended before the advertised byte count.\";\nvar STREAM_SOURCE_TOO_MANY_BYTES_ERROR = \"StreamSource emitted more bytes than the advertised byte count.\";\nvar STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR = \"StreamSource emitted too many empty chunks without data.\";\n/** Maximum consecutive empty chunks tolerated from a forward-only stream. */\nvar MAX_EMPTY_STREAM_CHUNKS = 1024;\nfunction asyncIterableToReadableStream(iterable) {\n\tconst iterator = iterable[Symbol.asyncIterator]();\n\treturn new ReadableStream({\n\t\tasync pull(controller) {\n\t\t\ttry {\n\t\t\t\tconst { done, value } = await iterator.next();\n\t\t\t\tif (done === true) {\n\t\t\t\t\tcontroller.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!(value instanceof Uint8Array)) throw new TypeError(\"Async iterable content sources must yield Uint8Array chunks.\");\n\t\t\t\tcontroller.enqueue(value);\n\t\t\t} catch (err) {\n\t\t\t\t/* v8 ignore next -- Iterator-return failure must not mask the pull error. */\n\t\t\t\tawait returnAsyncIteratorBestEffort(iterator);\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t},\n\t\tasync cancel(reason) {\n\t\t\tawait returnAsyncIteratorBestEffort(iterator, reason);\n\t\t}\n\t});\n}\nasync function returnAsyncIteratorBestEffort(iterator, reason) {\n\ttry {\n\t\tawait iterator.return?.(reason);\n\t} catch {}\n}\nfunction isAsyncIterable(input) {\n\treturn typeof input === \"object\" && input !== null && Symbol.asyncIterator in input && typeof input[Symbol.asyncIterator] === \"function\";\n}\nfunction isReadableStream(input) {\n\treturn typeof input === \"object\" && input !== null && typeof input.getReader === \"function\";\n}\n/** ContentSource backed by a Blob or File. */\nvar BlobSource = class BlobSource {\n\tblob;\n\t/** {@inheritDoc} */\n\tsize;\n\t/** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */\n\tcanSlice = true;\n\t/**\n\t* Create a BlobSource wrapping the given Blob.\n\t* @param blob - The Blob or File to use as the underlying content.\n\t*/\n\tconstructor(blob) {\n\t\tthis.blob = blob;\n\t\tthis.size = blob.size;\n\t}\n\t/**\n\t* Return a new BlobSource covering the specified byte range.\n\t* @param start - The zero-based byte offset to begin the slice.\n\t* @param end - The exclusive byte offset where the slice ends.\n\t*\n\t* @returns A new ContentSource representing the requested sub-range.\n\t*/\n\tslice(start, end) {\n\t\treturn new BlobSource(this.blob.slice(start, end));\n\t}\n\t/**\n\t* Open the Blob content as a ReadableStream.\n\t* @returns A ReadableStream of the Blob bytes.\n\t*/\n\tstream() {\n\t\treturn this.blob.stream();\n\t}\n\t/**\n\t* Read the entire Blob content into an ArrayBuffer.\n\t* @param options - Optional abort signal used while reading.\n\t*\n\t* @returns A promise that resolves with the full content as an ArrayBuffer.\n\t*/\n\tasync toArrayBuffer(options = {}) {\n\t\toptions.signal?.throwIfAborted();\n\t\tif (options.signal === void 0) return this.blob.arrayBuffer();\n\t\treturn arrayBufferFor(await collectStream(this.stream(), options));\n\t}\n};\n/** ContentSource backed by a Uint8Array buffer. */\nvar BufferSource = class BufferSource {\n\tbuffer;\n\t/** {@inheritDoc} */\n\tsize;\n\t/** Random-access: the entire payload lives in memory. */\n\tcanSlice = true;\n\t/**\n\t* Create a BufferSource wrapping the given Uint8Array.\n\t* @param buffer - The byte buffer to use as the underlying content.\n\t*/\n\tconstructor(buffer) {\n\t\tthis.buffer = buffer;\n\t\tthis.size = buffer.byteLength;\n\t}\n\t/**\n\t* Return a new BufferSource covering the specified byte range.\n\t* @param start - The zero-based byte offset to begin the slice.\n\t* @param end - The exclusive byte offset where the slice ends.\n\t*\n\t* @returns A new ContentSource representing the requested sub-range.\n\t*/\n\tslice(start, end) {\n\t\treturn new BufferSource(this.buffer.slice(start, end));\n\t}\n\t/**\n\t* Open the buffer content as a ReadableStream.\n\t* @returns A ReadableStream that emits the buffer bytes in a single chunk.\n\t*/\n\tstream() {\n\t\tconst buffer = this.buffer;\n\t\treturn new ReadableStream({ start(controller) {\n\t\t\tcontroller.enqueue(buffer);\n\t\t\tcontroller.close();\n\t\t} });\n\t}\n\t/**\n\t* Read the entire buffer content into an ArrayBuffer.\n\t* @param options - Optional abort signal checked before returning bytes.\n\t*\n\t* @returns A promise that resolves with the full content as an ArrayBuffer.\n\t*/\n\tasync toArrayBuffer(options = {}) {\n\t\toptions.signal?.throwIfAborted();\n\t\treturn arrayBufferFor(this.buffer);\n\t}\n};\n/** ContentSource backed by a ReadableStream. Can only be consumed once and does not support slicing. */\nvar StreamSource = class {\n\treadable;\n\t/** {@inheritDoc} */\n\tsize;\n\t/**\n\t* Forward-only: ReadableStreams cannot be repositioned, so multipart\n\t* uploads must take the sequential path. See the interface comment on\n\t* `canSlice` for what the engine does with this flag.\n\t*/\n\tcanSlice = false;\n\t/** Whether the stream has already been read. */\n\tconsumed = false;\n\t/**\n\t* Create a StreamSource wrapping the given ReadableStream with a known byte size.\n\t* @param readable - The ReadableStream to wrap as a content source.\n\t* @param size - The total number of bytes the stream will produce.\n\t*/\n\tconstructor(readable, size) {\n\t\tthis.readable = readable;\n\t\tvalidateStreamSourceSize(size);\n\t\tthis.size = size;\n\t}\n\t/**\n\t* Always throws because streams cannot be sliced. Buffer the stream first.\n\t*\n\t* @throws If slicing is attempted on a stream-backed source.\n\t*/\n\tslice() {\n\t\tthrow new Error(\"StreamSource does not support slicing. Buffer the stream first.\");\n\t}\n\t/**\n\t* Open the underlying ReadableStream. Can only be called once.\n\t* @returns The underlying ReadableStream of bytes.\n\t*\n\t* @throws If the stream has already been consumed.\n\t*/\n\tstream() {\n\t\tif (this.consumed) throw new Error(\"StreamSource can only be consumed once.\");\n\t\tthis.consumed = true;\n\t\treturn this.readable;\n\t}\n\t/**\n\t* Read the entire stream into an ArrayBuffer.\n\t* @param options - Optional abort signal used while reading.\n\t*\n\t* @returns A promise that resolves with the full content as an ArrayBuffer.\n\t*/\n\tasync toArrayBuffer(options = {}) {\n\t\treturn (await collectStreamExactly(this.stream(), this.size, options.signal)).buffer;\n\t}\n};\nfunction validateStreamSourceSize(size) {\n\tif (!Number.isFinite(size) || !Number.isInteger(size) || size < 0) throw new RangeError(\"StreamSource size must be a non-negative finite integer.\");\n}\n/**\n* Reads exactly the advertised number of bytes from a stream.\n* @param stream - Stream to consume.\n* @param expectedSize - Exact number of bytes expected from the stream.\n* @param signal - Optional abort signal for cancelling the read.\n*\n* @returns A byte array of length `expectedSize`.\n*\n* @throws If the stream emits too few bytes, too many bytes, too many empty chunks, or aborts.\n*/\nasync function collectStreamExactly(stream, expectedSize, signal) {\n\tconst reader = stream.getReader();\n\tconst chunks = [];\n\tlet total = 0;\n\tlet completed = false;\n\ttry {\n\t\twhile (total < expectedSize) {\n\t\t\tconst { done, value } = await readNextNonEmptyStreamChunk(reader, STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR, signal);\n\t\t\tif (done) throw new Error(STREAM_SOURCE_ENDED_EARLY_ERROR);\n\t\t\tif (total + value.byteLength > expectedSize) throw new Error(STREAM_SOURCE_TOO_MANY_BYTES_ERROR);\n\t\t\tchunks.push(value);\n\t\t\ttotal += value.byteLength;\n\t\t}\n\t\tif (!(await readNextNonEmptyStreamChunk(reader, STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR, signal)).done) throw new Error(STREAM_SOURCE_TOO_MANY_BYTES_ERROR);\n\t\tconst result = new Uint8Array(expectedSize);\n\t\tlet offset = 0;\n\t\tfor (const chunk of chunks) {\n\t\t\tresult.set(chunk, offset);\n\t\t\toffset += chunk.byteLength;\n\t\t}\n\t\tcompleted = true;\n\t\treturn result;\n\t} finally {\n\t\tif (!completed) cancelReaderBestEffort(reader);\n\t\ttry {\n\t\t\treader.releaseLock();\n\t\t} catch {}\n\t}\n}\n/**\n* Reads from a stream until it receives data, EOF, or too many consecutive empty chunks.\n* @param reader - Locked reader for a Uint8Array stream.\n* @param emptyChunkErrorMessage - Error message to throw when the empty-chunk limit is exceeded.\n* @param signal - Optional abort signal that cancels the reader and rejects the read.\n*\n* @returns The next non-empty chunk or EOF result.\n*/\nasync function readNextNonEmptyStreamChunk(reader, emptyChunkErrorMessage, signal) {\n\tlet emptyChunks = 0;\n\twhile (true) {\n\t\tconst result = await readStreamChunk(reader, signal);\n\t\tif (result.done || result.value.byteLength > 0) return result;\n\t\temptyChunks += 1;\n\t\tif (emptyChunks > 1024) throw new Error(emptyChunkErrorMessage);\n\t}\n}\nasync function readStreamChunk(reader, signal) {\n\tif (signal === void 0) return reader.read();\n\tif (signal.aborted) {\n\t\tconst reason = signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\t\tcancelReaderBestEffort(reader, reason);\n\t\tthrow reason;\n\t}\n\tlet removeAbortListener;\n\tconst abort = new Promise((_, reject) => {\n\t\tconst onAbort = () => {\n\t\t\tconst reason = signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\t\t\tcancelReaderBestEffort(reader, reason);\n\t\t\treject(reason);\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\tconst result = await Promise.race([reader.read(), abort]);\n\t\tif (signal.aborted) {\n\t\t\tconst reason = signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\t\t\tcancelReaderBestEffort(reader, reason);\n\t\t\tthrow reason;\n\t\t}\n\t\treturn result;\n\t} finally {\n\t\tremoveAbortListener?.();\n\t}\n}\nfunction cancelReaderBestEffort(reader, reason) {\n\t/* v8 ignore next -- Reader cancellation failure is deliberately best-effort. */\n\treader.cancel(reason).catch(() => {});\n}\n/** ContentSource backed by a forward-only async iterable of Uint8Array chunks. */\nvar AsyncIterableSource = class extends StreamSource {\n\t/**\n\t* Create an AsyncIterableSource from a known-size async iterable.\n\t* @param iterable - Async iterable that yields Uint8Array chunks.\n\t* @param size - Total byte length the iterable will produce.\n\t*/\n\tconstructor(iterable, size) {\n\t\tsuper(asyncIterableToReadableStream(iterable), size);\n\t}\n};\n/**\n* Convert a Uint8Array, Blob, ReadableStream, or async iterable into a {@link ContentSource}.\n* When passing a ReadableStream or async iterable, the `size` parameter is required.\n* @param input - The content to wrap.\n* @param size - The total byte length, required for forward-only inputs.\n*\n* @returns A ContentSource adapter for the given input.\n*\n* @throws If input is forward-only and size is not provided.\n*/\nfunction toContentSource(input, size) {\n\tif (input instanceof Uint8Array) return new BufferSource(input);\n\tif (input instanceof Blob) return new BlobSource(input);\n\tif (isReadableStream(input)) {\n\t\tif (size === void 0) throw new Error(READABLE_STREAM_SIZE_REQUIRED_ERROR);\n\t\treturn new StreamSource(input, size);\n\t}\n\tif (isAsyncIterable(input)) {\n\t\tif (size === void 0) throw new Error(FORWARD_ONLY_SIZE_REQUIRED_ERROR);\n\t\treturn new AsyncIterableSource(input, size);\n\t}\n\tthrow new TypeError(\"Unsupported content source input.\");\n}\n//#endregion\nexport { BlobSource, BufferSource, FileSource, MAX_EMPTY_STREAM_CHUNKS, StreamSource, collectStreamExactly, readNextNonEmptyStreamChunk, toContentSource };\n\n//# sourceMappingURL=source.js.map","//#region src/types/bucket.ts\n/**\n* Named constants for the bucket access level.\n*\n* The {@link BucketType} type alias is derived from the values of this\n* object, so the const is the single source of truth: adding a key here\n* automatically widens the type union.\n*\n* @example\n* ```ts\n* await client.createBucket({ bucketName: 'my-app-logs', bucketType: BucketType.AllPrivate })\n* ```\n*/\nvar BucketType = {\n\t/** Publicly downloadable without authentication. */\n\tAllPublic: \"allPublic\",\n\t/** Requires a valid auth token to download. */\n\tAllPrivate: \"allPrivate\",\n\t/** Internal snapshot bucket type, generally not user-created. */\n\tSnapshot: \"snapshot\",\n\t/** B2-restricted bucket (e.g., for S3-compatible workflows). */\n\tRestricted: \"restricted\"\n};\n/**\n* Named constants for the B2 + S3 operations a CORS rule can permit.\n*\n* @example\n* ```ts\n* await bucket.update({\n* corsRules: [{\n* corsRuleName: 'browser-downloads',\n* allowedOrigins: ['https://example.com'],\n* allowedOperations: [CorsOperation.B2DownloadFileByName, CorsOperation.S3Get],\n* allowedHeaders: null,\n* exposeHeaders: null,\n* maxAgeSeconds: 3600,\n* }],\n* })\n* ```\n*/\nvar CorsOperation = {\n\t/** Native B2 download-by-name request. */\n\tB2DownloadFileByName: \"b2_download_file_by_name\",\n\t/** Native B2 download-by-id request. */\n\tB2DownloadFileById: \"b2_download_file_by_id\",\n\t/** Native B2 small-file upload. */\n\tB2UploadFile: \"b2_upload_file\",\n\t/** Native B2 multipart-part upload. */\n\tB2UploadPart: \"b2_upload_part\",\n\t/** S3-compatible DELETE. */\n\tS3Delete: \"s3_delete\",\n\t/** S3-compatible GET. */\n\tS3Get: \"s3_get\",\n\t/** S3-compatible HEAD. */\n\tS3Head: \"s3_head\",\n\t/** S3-compatible POST. */\n\tS3Post: \"s3_post\",\n\t/** S3-compatible PUT. */\n\tS3Put: \"s3_put\"\n};\n/**\n* Named constants for the bucket-level Object Lock retention mode.\n*\n* Pair with {@link BucketRetentionPolicy} when setting a bucket's default\n* retention: `{ mode: BucketRetentionMode.Compliance, period: { duration: 30, unit: 'days' } }`.\n*/\nvar BucketRetentionMode = {\n\t/** Files cannot be deleted or modified during the retention period, even by the account owner. */\n\tCompliance: \"compliance\",\n\t/** Files cannot be deleted during retention except by callers with the `bypassGovernance` capability. */\n\tGovernance: \"governance\",\n\t/** No default retention is applied to new uploads. */\n\tNone: \"none\"\n};\n//#endregion\nexport { BucketRetentionMode, BucketType, CorsOperation };\n\n//# sourceMappingURL=bucket.js.map","//#region src/types/encryption.ts\n/** Named constants for the supported server-side encryption algorithms. */\nvar EncryptionAlgorithm = { \n/** AES with a 256-bit key. The only algorithm B2 currently supports. */\nAes256: \"AES256\" };\n/**\n* Named constants for the server-side encryption mode used by a file.\n*\n* Most callers should use the {@link SSE_B2}, {@link SSE_NONE}, and\n* {@link sseCustomer} helpers below which return complete\n* {@link EncryptionSetting} objects. These constants are useful when you\n* need the bare mode discriminator (e.g., when introspecting a file's\n* current encryption setting).\n*/\nvar EncryptionMode = {\n\t/** B2-managed encryption keys. */\n\tSseB2: \"SSE-B2\",\n\t/** Customer-provided encryption keys. */\n\tSseC: \"SSE-C\",\n\t/** No encryption. */\n\tNone: \"none\"\n};\n/** Pre-built SSE-B2 encryption setting using AES-256. */\nvar SSE_B2 = {\n\tmode: \"SSE-B2\",\n\talgorithm: \"AES256\"\n};\n/** Pre-built setting indicating no server-side encryption. */\nvar SSE_NONE = { mode: \"none\" };\n/**\n* Creates an SSE-C encryption setting with a customer-provided key.\n* @param customerKey - Base64-encoded 256-bit encryption key.\n* @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n*\n* @returns An SSE-C encryption setting ready to pass to upload or download calls.\n*/\nfunction sseCustomer(customerKey, customerKeyMd5) {\n\treturn {\n\t\tmode: \"SSE-C\",\n\t\talgorithm: \"AES256\",\n\t\tcustomerKey,\n\t\tcustomerKeyMd5\n\t};\n}\n/**\n* Encodes raw bytes as base64 in an isomorphic way (Node Buffer fallback to btoa).\n*\n* @param bytes - The raw bytes to encode.\n*\n* @returns The base64-encoded string.\n*/\nfunction bytesToBase64(bytes) {\n\tconst g = globalThis;\n\tif (g.Buffer) return g.Buffer.from(bytes).toString(\"base64\");\n\tlet binary = \"\";\n\tfor (const b of bytes) binary += String.fromCharCode(b);\n\treturn btoa(binary);\n}\n/**\n* Computes the MD5 digest of the given bytes as a base64 string. Prefers\n* `node:crypto` for native speed when available; falls back to a pure-JS\n* implementation in browser / edge runtimes because WebCrypto's\n* `crypto.subtle.digest` deliberately does not support MD5.\n*\n* MD5 is used here only for SSE-C key integrity (matching the B2 wire\n* protocol). It is **not** a security boundary; the customer key itself is\n* the secret. Bundling a pure-JS fallback keeps `EncryptionKey.fromBytes`\n* isomorphic.\n*\n* @param bytes - The bytes to digest.\n*\n* @returns The base64-encoded MD5 digest.\n*/\nasync function md5Base64(bytes) {\n\ttry {\n\t\tconst { createHash } = await import(\"node:crypto\");\n\t\tif (typeof createHash !== \"function\") throw new Error(\"createHash unavailable\");\n\t\treturn createHash(\"md5\").update(bytes).digest(\"base64\");\n\t} catch {\n\t\treturn bytesToBase64(md5Bytes(bytes));\n\t}\n}\n/**\n* Pure-JS MD5 implementation per RFC 1321. Returns the 16-byte digest of the\n* input. Used as a browser fallback for SSE-C key MD5 computation; not\n* intended for security-sensitive purposes (MD5 is broken cryptographically).\n*\n* @param data - The bytes to hash.\n*\n* @returns The 16-byte MD5 digest.\n*/\nfunction md5Bytes(data) {\n\tconst originalBitLength = data.byteLength * 8;\n\tconst padLength = (data.byteLength + 8 >>> 6) + 1;\n\tconst padded = new Uint8Array(padLength * 64);\n\tpadded.set(data);\n\tpadded[data.byteLength] = 128;\n\tconst lowBits = originalBitLength >>> 0;\n\tconst highBits = Math.floor(originalBitLength / 4294967296) >>> 0;\n\tconst lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8);\n\tlengthView.setUint32(0, lowBits, true);\n\tlengthView.setUint32(4, highBits, true);\n\tconst s = [\n\t\t7,\n\t\t12,\n\t\t17,\n\t\t22,\n\t\t7,\n\t\t12,\n\t\t17,\n\t\t22,\n\t\t7,\n\t\t12,\n\t\t17,\n\t\t22,\n\t\t7,\n\t\t12,\n\t\t17,\n\t\t22,\n\t\t5,\n\t\t9,\n\t\t14,\n\t\t20,\n\t\t5,\n\t\t9,\n\t\t14,\n\t\t20,\n\t\t5,\n\t\t9,\n\t\t14,\n\t\t20,\n\t\t5,\n\t\t9,\n\t\t14,\n\t\t20,\n\t\t4,\n\t\t11,\n\t\t16,\n\t\t23,\n\t\t4,\n\t\t11,\n\t\t16,\n\t\t23,\n\t\t4,\n\t\t11,\n\t\t16,\n\t\t23,\n\t\t4,\n\t\t11,\n\t\t16,\n\t\t23,\n\t\t6,\n\t\t10,\n\t\t15,\n\t\t21,\n\t\t6,\n\t\t10,\n\t\t15,\n\t\t21,\n\t\t6,\n\t\t10,\n\t\t15,\n\t\t21,\n\t\t6,\n\t\t10,\n\t\t15,\n\t\t21\n\t];\n\tconst k = new Uint32Array([\n\t\t3614090360,\n\t\t3905402710,\n\t\t606105819,\n\t\t3250441966,\n\t\t4118548399,\n\t\t1200080426,\n\t\t2821735955,\n\t\t4249261313,\n\t\t1770035416,\n\t\t2336552879,\n\t\t4294925233,\n\t\t2304563134,\n\t\t1804603682,\n\t\t4254626195,\n\t\t2792965006,\n\t\t1236535329,\n\t\t4129170786,\n\t\t3225465664,\n\t\t643717713,\n\t\t3921069994,\n\t\t3593408605,\n\t\t38016083,\n\t\t3634488961,\n\t\t3889429448,\n\t\t568446438,\n\t\t3275163606,\n\t\t4107603335,\n\t\t1163531501,\n\t\t2850285829,\n\t\t4243563512,\n\t\t1735328473,\n\t\t2368359562,\n\t\t4294588738,\n\t\t2272392833,\n\t\t1839030562,\n\t\t4259657740,\n\t\t2763975236,\n\t\t1272893353,\n\t\t4139469664,\n\t\t3200236656,\n\t\t681279174,\n\t\t3936430074,\n\t\t3572445317,\n\t\t76029189,\n\t\t3654602809,\n\t\t3873151461,\n\t\t530742520,\n\t\t3299628645,\n\t\t4096336452,\n\t\t1126891415,\n\t\t2878612391,\n\t\t4237533241,\n\t\t1700485571,\n\t\t2399980690,\n\t\t4293915773,\n\t\t2240044497,\n\t\t1873313359,\n\t\t4264355552,\n\t\t2734768916,\n\t\t1309151649,\n\t\t4149444226,\n\t\t3174756917,\n\t\t718787259,\n\t\t3951481745\n\t]);\n\tlet a0 = 1732584193;\n\tlet b0 = 4023233417;\n\tlet c0 = 2562383102;\n\tlet d0 = 271733878;\n\tconst m = /* @__PURE__ */ new Uint32Array(16);\n\tconst view = new DataView(padded.buffer);\n\tfor (let block = 0; block < padded.byteLength; block += 64) {\n\t\tfor (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true);\n\t\tlet A = a0;\n\t\tlet B = b0;\n\t\tlet C = c0;\n\t\tlet D = d0;\n\t\tfor (let i = 0; i < 64; i++) {\n\t\t\tlet f;\n\t\t\tlet g;\n\t\t\tif (i < 16) {\n\t\t\t\tf = B & C | ~B & D;\n\t\t\t\tg = i;\n\t\t\t} else if (i < 32) {\n\t\t\t\tf = D & B | ~D & C;\n\t\t\t\tg = (5 * i + 1) % 16;\n\t\t\t} else if (i < 48) {\n\t\t\t\tf = B ^ C ^ D;\n\t\t\t\tg = (3 * i + 5) % 16;\n\t\t\t} else {\n\t\t\t\tf = C ^ (B | ~D);\n\t\t\t\tg = 7 * i % 16;\n\t\t\t}\n\t\t\tconst temp = D;\n\t\t\tD = C;\n\t\t\tC = B;\n\t\t\tconst sum = A + f + (k[i] ?? 0) + (m[g] ?? 0) >>> 0;\n\t\t\tconst shift = s[i] ?? 0;\n\t\t\tconst rotated = (sum << shift | sum >>> 32 - shift) >>> 0;\n\t\t\tB = B + rotated >>> 0;\n\t\t\tA = temp;\n\t\t}\n\t\ta0 = a0 + A >>> 0;\n\t\tb0 = b0 + B >>> 0;\n\t\tc0 = c0 + C >>> 0;\n\t\td0 = d0 + D >>> 0;\n\t}\n\tconst out = /* @__PURE__ */ new Uint8Array(16);\n\tconst outView = new DataView(out.buffer);\n\toutView.setUint32(0, a0, true);\n\toutView.setUint32(4, b0, true);\n\toutView.setUint32(8, c0, true);\n\toutView.setUint32(12, d0, true);\n\treturn out;\n}\nvar KEY_REDACTED = \"[redacted SSE-C key]\";\n/**\n* Safe wrapper around an SSE-C customer key. Hides the key bytes from\n* `JSON.stringify`, `console.log`, and Node's `util.inspect`. Use {@link EncryptionKey.fromBytes}\n* to construct one from a raw 32-byte key; the MD5 digest is computed internally.\n*/\nvar EncryptionKey = class EncryptionKey {\n\t/** Encryption mode discriminant. Always `'SSE-C'` for this class. */\n\tmode = \"SSE-C\";\n\t/** Encryption algorithm. B2's S3-compatible API only supports AES-256. */\n\talgorithm = \"AES256\";\n\t/** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */\n\tcustomerKey;\n\t/** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */\n\tcustomerKeyMd5;\n\t/**\n\t* Internal constructor. Use {@link EncryptionKey.fromBytes} or\n\t* {@link EncryptionKey.fromBase64} instead.\n\t*\n\t* @param customerKey - Base64-encoded 256-bit encryption key.\n\t* @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n\t*\n\t* @internal\n\t*/\n\tconstructor(customerKey, customerKeyMd5) {\n\t\tthis.customerKey = customerKey;\n\t\tthis.customerKeyMd5 = customerKeyMd5;\n\t}\n\t/**\n\t* Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the\n\t* required base64 MD5 digest internally.\n\t*\n\t* @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes.\n\t*\n\t* @returns A safely-wrapped EncryptionKey ready for upload/download.\n\t*\n\t* @throws If the key is not exactly 32 bytes.\n\t*/\n\tstatic async fromBytes(rawKey) {\n\t\tif (rawKey.byteLength !== 32) throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`);\n\t\tconst customerKey = bytesToBase64(rawKey);\n\t\tconst customerKeyMd5 = await md5Base64(rawKey);\n\t\treturn new EncryptionKey(customerKey, customerKeyMd5);\n\t}\n\t/**\n\t* Builds an EncryptionKey from precomputed base64 strings. Use this in\n\t* environments where MD5 must be computed externally (e.g., browsers).\n\t*\n\t* @param customerKey - Base64-encoded 256-bit encryption key.\n\t* @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n\t*\n\t* @returns A safely-wrapped EncryptionKey ready for upload/download.\n\t*/\n\tstatic fromBase64(customerKey, customerKeyMd5) {\n\t\treturn new EncryptionKey(customerKey, customerKeyMd5);\n\t}\n\t/**\n\t* Hides the key bytes from `JSON.stringify`.\n\t*\n\t* @returns A redacted shape: same mode and algorithm, but the key and MD5\n\t* replaced with a placeholder string.\n\t*/\n\ttoJSON() {\n\t\treturn {\n\t\t\tmode: this.mode,\n\t\t\talgorithm: this.algorithm,\n\t\t\tcustomerKey: KEY_REDACTED,\n\t\t\tcustomerKeyMd5: KEY_REDACTED\n\t\t};\n\t}\n\t/**\n\t* Hides the key bytes from default `toString()`.\n\t*\n\t* @returns A short opaque label indicating this is an SSE-C key.\n\t*/\n\ttoString() {\n\t\treturn `[EncryptionKey SSE-C ${KEY_REDACTED}]`;\n\t}\n\t/**\n\t* Hides the key bytes from Node's `util.inspect` (and therefore `console.log`).\n\t*\n\t* @returns A short opaque label indicating this is an SSE-C key.\n\t*/\n\t[Symbol.for(\"nodejs.util.inspect.custom\")]() {\n\t\treturn this.toString();\n\t}\n};\n//#endregion\nexport { EncryptionAlgorithm, EncryptionKey, EncryptionMode, SSE_B2, SSE_NONE, sseCustomer };\n\n//# sourceMappingURL=encryption.js.map","import { largeFileId } from \"../types/ids.js\";\nimport { ResumeFileIdMismatchError } from \"../errors/index.js\";\nimport { BucketRetentionMode } from \"../types/bucket.js\";\nimport { EncryptionMode } from \"../types/encryption.js\";\n//#region src/upload/resume.ts\n/** Compatibility-only file-info key read from legacy unfinished uploads; new uploads do not write it. */\nvar RESUME_SOURCE_SIZE_INFO_KEY = \"b2_sdk_resume_source_size\";\n/** Compatibility-only file-info key read from legacy unfinished uploads; new uploads do not write it. */\nvar RESUME_PART_SIZE_INFO_KEY = \"b2_sdk_resume_part_size\";\nvar DEFAULT_MAX_RESUME_LIST_PAGES = 10;\nvar DEFAULT_MAX_RESUME_PART_CANDIDATES = 25;\nvar DEFAULT_MAX_RESUME_PART_PAGES = 10;\nvar LIST_PARTS_PAGE_SIZE = 100;\n/**\n* Finds an unfinished large file matching the given bucket and file name.\n* Returns `null` when no compatible candidate exists.\n*\n* With criteria, the newest compatible candidate is selected; incompatible\n* same-name uploads are ignored and optionally reported via\n* `onCandidateRejected`.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param bucketId - Target bucket of the upload.\n* @param fileName - Destination file name of the upload.\n* @param criteria - Upload identity and option checks.\n*\n* @returns A {@link ResumeCandidate} describing the candidate and its uploaded parts, or `null`.\n*/\nasync function findResumeCandidate(raw, accountInfo, bucketId, fileName, criteria) {\n\tconst discoverySignal = createResumeDiscoverySignal(criteria);\n\ttry {\n\t\treturn await findResumeCandidateWithSignal(raw, accountInfo, bucketId, fileName, criteria, discoverySignal.signal);\n\t} finally {\n\t\tdiscoverySignal.dispose();\n\t}\n}\nasync function findResumeCandidateWithSignal(raw, accountInfo, bucketId, fileName, criteria, signal) {\n\tconst matches = [];\n\tconst maxListPages = criteria.maxListPages ?? DEFAULT_MAX_RESUME_LIST_PAGES;\n\tconst maxPartCandidates = criteria.maxPartCandidates ?? DEFAULT_MAX_RESUME_PART_CANDIDATES;\n\tlet sequence = 0;\n\tlet pageCount = 0;\n\tconst explicitResumeFileId = criteria.resumeFileId;\n\tlet startFileId = explicitResumeFileId;\n\tlet truncated = false;\n\twhile (pageCount < maxListPages) {\n\t\tsignal?.throwIfAborted();\n\t\tconst unfinished = await abortableRequest(raw.listUnfinishedLargeFiles(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tbucketId,\n\t\t\tmaxFileCount: explicitResumeFileId !== void 0 ? 1 : 100,\n\t\t\tnamePrefix: fileName,\n\t\t\t...startFileId !== void 0 ? { startFileId } : {}\n\t\t}, signal !== void 0 ? { signal } : void 0), signal);\n\t\tpageCount++;\n\t\tfor (const file of unfinished.files) {\n\t\t\tif (explicitResumeFileId !== void 0 ? file.fileId === explicitResumeFileId : file.fileName === fileName) matches.push({\n\t\t\t\tfile,\n\t\t\t\tsequence\n\t\t\t});\n\t\t\tsequence++;\n\t\t}\n\t\tif (explicitResumeFileId !== void 0) break;\n\t\tif (unfinished.nextFileId === null) break;\n\t\tstartFileId = unfinished.nextFileId;\n\t\ttruncated = pageCount >= maxListPages;\n\t}\n\tif (truncated) emitCandidateRejected(criteria, {\n\t\trequestedFileName: fileName,\n\t\treason: \"search-truncated\"\n\t});\n\tmatches.sort(compareNewestFirst);\n\tlet partCandidatesInspected = 0;\n\tfor (const match of matches) {\n\t\tsignal?.throwIfAborted();\n\t\tconst rejection = candidateMetadataRejectReason(match.file, fileName, criteria);\n\t\tif (rejection !== null) {\n\t\t\tnotifyCandidateRejected(criteria, match.file, fileName, rejection);\n\t\t\tcontinue;\n\t\t}\n\t\tif (partCandidatesInspected >= maxPartCandidates) {\n\t\t\tnotifyCandidateRejected(criteria, match.file, fileName, \"candidate-limit\");\n\t\t\tbreak;\n\t\t}\n\t\tpartCandidatesInspected++;\n\t\tconst fileId = largeFileId(match.file.fileId);\n\t\tconst uploadedPartsResult = await collectResumePartInfo(raw, accountInfo, fileId, {\n\t\t\tmaxPages: criteria.maxPartPages ?? DEFAULT_MAX_RESUME_PART_PAGES,\n\t\t\tmaxParts: criteria.parts.length,\n\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t});\n\t\tconst uploadedParts = uploadedPartsResult.parts;\n\t\tif (uploadedPartsResult.truncated || !uploadedPartsMatchPlan(uploadedParts, criteria.parts)) {\n\t\t\tnotifyCandidateRejected(criteria, match.file, fileName, \"part-length-mismatch\");\n\t\t\tcontinue;\n\t\t}\n\t\treturn {\n\t\t\tfileId,\n\t\t\tuploadedPartSha1s: partInfoToSha1s(uploadedParts)\n\t\t};\n\t}\n\treturn null;\n}\nasync function collectResumePartInfo(raw, accountInfo, fileId, options) {\n\tconst parts = /* @__PURE__ */ new Map();\n\tconst maxPages = options.maxPages ?? Number.POSITIVE_INFINITY;\n\tconst maxParts = options.maxParts ?? Number.POSITIVE_INFINITY;\n\tlet startPartNumber;\n\tlet pageCount = 0;\n\twhile (pageCount < maxPages) {\n\t\toptions.signal?.throwIfAborted();\n\t\tconst remainingParts = maxParts === Number.POSITIVE_INFINITY ? void 0 : Math.max(1, Math.min(LIST_PARTS_PAGE_SIZE, maxParts - parts.size + 1));\n\t\tconst page = await abortableRequest(raw.listParts(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tfileId,\n\t\t\t...startPartNumber !== void 0 ? { startPartNumber } : {},\n\t\t\t...remainingParts !== void 0 ? { maxPartCount: remainingParts } : {}\n\t\t}, options.signal !== void 0 ? { signal: options.signal } : void 0), options.signal);\n\t\tpageCount++;\n\t\tfor (const part of page.parts) {\n\t\t\tparts.set(part.partNumber, {\n\t\t\t\tcontentSha1: part.contentSha1,\n\t\t\t\tcontentLength: part.contentLength\n\t\t\t});\n\t\t\tif (parts.size > maxParts) return {\n\t\t\t\tparts,\n\t\t\t\ttruncated: true\n\t\t\t};\n\t\t}\n\t\tif (page.nextPartNumber === null) return {\n\t\t\tparts,\n\t\t\ttruncated: false\n\t\t};\n\t\tassertAdvancingPartCursor(fileId, startPartNumber, page.nextPartNumber);\n\t\tstartPartNumber = page.nextPartNumber;\n\t}\n\treturn {\n\t\tparts,\n\t\ttruncated: true\n\t};\n}\nfunction compareNewestFirst(a, b) {\n\tconst aTime = a.file.uploadTimestamp ?? Number.NEGATIVE_INFINITY;\n\tconst bTime = b.file.uploadTimestamp ?? Number.NEGATIVE_INFINITY;\n\tif (aTime !== bTime) return bTime - aTime;\n\treturn b.sequence - a.sequence;\n}\nfunction candidateMetadataRejectReason(candidate, fileName, criteria) {\n\tif (candidate.fileName !== fileName) return \"file-name-mismatch\";\n\tif (criteria.contentType === \"b2/x-auto\" && criteria.resumeFileId === void 0 && candidate.contentType !== \"b2/x-auto\") return \"content-type-mismatch\";\n\tif (criteria.contentType !== \"b2/x-auto\" && candidate.contentType !== criteria.contentType) return \"content-type-mismatch\";\n\tconst candidateInfo = splitResumeFileInfo(candidate.fileInfo ?? {});\n\tif (!recordEquals(candidateInfo.fileInfo, criteria.fileInfo)) return \"file-info-mismatch\";\n\tif (candidateInfo.sourceSize !== void 0 && candidateInfo.sourceSize !== String(criteria.sourceSize)) return \"source-size-mismatch\";\n\tif (candidateInfo.partSize !== void 0 && candidateInfo.partSize !== String(criteria.partSize)) return \"part-size-mismatch\";\n\tconst encryptionRejectReason = serverSideEncryptionRejectReason(candidate.serverSideEncryption, criteria.serverSideEncryption);\n\tif (encryptionRejectReason !== null) return encryptionRejectReason;\n\tif (!fileRetentionMatches(candidate.fileRetention, criteria.fileRetention, criteria.defaultFileRetention, criteria.defaultFileRetentionUnreadable === true, candidate.uploadTimestamp)) return \"retention-mismatch\";\n\tif (!legalHoldMatches(candidate.legalHold, criteria.legalHold)) return \"legal-hold-mismatch\";\n\treturn null;\n}\nfunction notifyCandidateRejected(criteria, candidate, requestedFileName, reason) {\n\temitCandidateRejected(criteria, {\n\t\tfileId: largeFileId(candidate.fileId),\n\t\trequestedFileName,\n\t\tcandidateFileName: candidate.fileName,\n\t\treason\n\t});\n}\nfunction emitCandidateRejected(criteria, event) {\n\ttry {\n\t\tcriteria.onCandidateRejected?.(event);\n\t} catch {}\n}\nfunction uploadedPartsMatchPlan(uploadedParts, plans) {\n\tfor (const [partNumber, part] of uploadedParts) {\n\t\tconst planned = plans[partNumber - 1];\n\t\tif (planned === void 0) return false;\n\t\tif (planned.partNumber !== partNumber) return false;\n\t\tif (planned.length !== part.contentLength) return false;\n\t}\n\treturn true;\n}\nfunction partInfoToSha1s(parts) {\n\tconst sha1s = /* @__PURE__ */ new Map();\n\tfor (const [partNumber, part] of parts) sha1s.set(partNumber, part.contentSha1);\n\treturn sha1s;\n}\nfunction recordEquals(a, b) {\n\tconst aKeys = Object.keys(a);\n\tconst bKeys = Object.keys(b);\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (const key of aKeys) if (a[key] !== b[key]) return false;\n\treturn true;\n}\nfunction splitResumeFileInfo(fileInfo) {\n\tconst userFileInfo = Object.create(null);\n\tlet sourceSize;\n\tlet partSize;\n\tfor (const [key, value] of Object.entries(fileInfo)) if (key === \"b2_sdk_resume_source_size\") sourceSize = value;\n\telse if (key === \"b2_sdk_resume_part_size\") partSize = value;\n\telse userFileInfo[key] = value;\n\treturn {\n\t\tfileInfo: userFileInfo,\n\t\t...sourceSize !== void 0 ? { sourceSize } : {},\n\t\t...partSize !== void 0 ? { partSize } : {}\n\t};\n}\nfunction fileRetentionMatches(candidate, expected, defaultExpected, defaultUnreadable, uploadTimestamp) {\n\tif (expected === void 0 && defaultUnreadable) return false;\n\tif (expected === void 0 && defaultExpected !== void 0) {\n\t\tif (defaultExpected.mode === BucketRetentionMode.None) {\n\t\t\tif (candidate === void 0) return true;\n\t\t\tif (!candidate.isClientAuthorizedToRead) return false;\n\t\t\treturn fileRetentionValueEquals(candidate.value, null);\n\t\t}\n\t\tif (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false;\n\t\treturn fileRetentionValueMatchesBucketDefault(candidate.value, defaultExpected, uploadTimestamp);\n\t}\n\tif (expected === void 0) {\n\t\tif (candidate === void 0) return true;\n\t\tif (!candidate.isClientAuthorizedToRead) return false;\n\t\treturn fileRetentionValueEquals(candidate.value, null);\n\t}\n\tif (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false;\n\treturn fileRetentionValueEquals(candidate.value, expected);\n}\nfunction fileRetentionValueMatchesBucketDefault(candidate, expected, uploadTimestamp) {\n\tif (expected.period === null) return false;\n\tif (candidate?.mode !== expected.mode || candidate.retainUntilTimestamp === null) return false;\n\tif (uploadTimestamp === void 0) return false;\n\treturn candidate.retainUntilTimestamp === uploadTimestamp + retentionPeriodMillis(expected.period);\n}\nfunction retentionPeriodMillis(period) {\n\tif (period === null) return 0;\n\treturn (period.unit === \"days\" ? period.duration : period.duration * 365) * 24 * 60 * 60 * 1e3;\n}\nfunction fileRetentionValueEquals(a, b) {\n\treturn (a?.mode ?? null) === (b?.mode ?? null) && (a?.retainUntilTimestamp ?? null) === (b?.retainUntilTimestamp ?? null);\n}\nfunction legalHoldMatches(candidate, expected) {\n\tif (expected === void 0) {\n\t\tif (candidate === void 0) return true;\n\t\tif (!candidate.isClientAuthorizedToRead) return false;\n\t\treturn candidate.value === null || candidate.value === \"off\";\n\t}\n\tif (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false;\n\treturn candidate.value === expected;\n}\nfunction createResumeDiscoverySignal(criteria) {\n\tif (criteria.signal !== void 0) return {\n\t\tsignal: criteria.signal,\n\t\tdispose() {}\n\t};\n\tif (criteria.discoveryTimeoutMs === void 0) return { dispose() {} };\n\tconst timeoutMs = criteria.discoveryTimeoutMs;\n\tif (timeoutMs === Number.POSITIVE_INFINITY) return { dispose() {} };\n\tconst controller = new AbortController();\n\tconst timeout = setTimeout(() => {\n\t\tcontroller.abort(resumeDiscoveryTimeoutReason(timeoutMs));\n\t}, Math.max(0, timeoutMs));\n\treturn {\n\t\tsignal: controller.signal,\n\t\tdispose() {\n\t\t\tclearTimeout(timeout);\n\t\t}\n\t};\n}\nasync function abortableRequest(request, signal) {\n\tif (signal === void 0) return request;\n\tif (signal.aborted) throw resumeAbortReason(signal);\n\tlet removeAbortListener;\n\tconst aborted = new Promise((_resolve, reject) => {\n\t\tconst onAbort = () => reject(resumeAbortReason(signal));\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\treturn await Promise.race([request, aborted]);\n\t} finally {\n\t\tremoveAbortListener?.();\n\t\trequest.catch(() => {});\n\t}\n}\nfunction resumeAbortReason(signal) {\n\treturn signal.reason ?? resumeAbortFallbackReason();\n}\nfunction resumeAbortFallbackReason() {\n\tif (typeof DOMException === \"function\") return new DOMException(\"Resume discovery aborted\", \"AbortError\");\n\tconst error = /* @__PURE__ */ new Error(\"Resume discovery aborted\");\n\terror.name = \"AbortError\";\n\treturn error;\n}\nfunction resumeDiscoveryTimeoutReason(timeoutMs) {\n\tif (typeof DOMException === \"function\") return new DOMException(`Resume discovery timed out after ${timeoutMs} ms`, \"TimeoutError\");\n\tconst error = /* @__PURE__ */ new Error(`Resume discovery timed out after ${timeoutMs} ms`);\n\terror.name = \"TimeoutError\";\n\treturn error;\n}\nfunction serverSideEncryptionRejectReason(candidate, expected) {\n\tif (expected?.mode === EncryptionMode.SseC) return \"sse-c-unsupported\";\n\tconst actual = normalizeEncryption(candidate);\n\tif (expected === void 0) {\n\t\tif (candidate === void 0) return null;\n\t\tif (actual === void 0) return \"encryption-mismatch\";\n\t\tif (actual.mode === EncryptionMode.None) return null;\n\t\tif (actual.mode === EncryptionMode.SseB2) return null;\n\t\treturn actual.mode === EncryptionMode.SseC ? \"sse-c-unsupported\" : \"encryption-mismatch\";\n\t}\n\tconst normalizedExpected = normalizeEncryption(expected);\n\tif (normalizedExpected?.mode === EncryptionMode.None && candidate === void 0) return null;\n\tif (actual === void 0 || normalizedExpected === void 0) return \"encryption-mismatch\";\n\tif (actual.mode !== normalizedExpected.mode) return \"encryption-mismatch\";\n\tif (actual.mode === EncryptionMode.None) return null;\n\treturn actual.algorithm === normalizedExpected.algorithm ? null : \"encryption-mismatch\";\n}\nfunction normalizeEncryption(encryption) {\n\tif (encryption === void 0) return void 0;\n\tif (encryption.mode === null || encryption.mode === EncryptionMode.None) return { mode: EncryptionMode.None };\n\tif (encryption.mode !== EncryptionMode.SseB2 && encryption.mode !== EncryptionMode.SseC) return;\n\treturn {\n\t\tmode: encryption.mode,\n\t\talgorithm: encryption.algorithm\n\t};\n}\nfunction assertAdvancingPartCursor(fileId, previous, next) {\n\tif (!Number.isInteger(next) || next < 1 || previous !== void 0 && next <= previous) throw new Error(`uploadLargeFile: listParts returned a non-advancing nextPartNumber for ${fileId}; aborting resume.`);\n}\n//#endregion\nexport { RESUME_PART_SIZE_INFO_KEY, RESUME_SOURCE_SIZE_INFO_KEY, ResumeFileIdMismatchError, findResumeCandidate };\n\n//# sourceMappingURL=resume.js.map","import { B2Error, B2SsrfError, BadAuthTokenError, BadRequestError, BadUploadUrlError, NetworkError, UploadResponseBodyError } from \"../errors/index.js\";\nimport { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep } from \"../http/retry.js\";\n//#region src/upload/retry.ts\nvar freshUrlRetryOverride = { maxRetries: 0 };\n/**\n* Resolves the public default for `retryResponseBodyFailures`. Callers must\n* opt into replaying ambiguous upload POST failures for every upload mode.\n*\n* @param value - Caller-provided override, if any.\n*\n* @returns The boolean value passed to the upload retry helper.\n*/\nfunction resolveRetryResponseBodyFailures(value) {\n\treturn value ?? false;\n}\n/**\n* Fetches a small-file upload URL, bypassing the pool.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param bucketId - Bucket to upload into.\n* @param signal - Optional abort signal for the fresh URL request.\n*\n* @returns A fresh upload URL entry.\n*/\nasync function fetchFreshUploadUrl(raw, accountInfo, bucketId, signal) {\n\tconst resp = await raw.getUploadUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { bucketId }, {\n\t\t...signal !== void 0 ? { signal } : {},\n\t\tretry: freshUrlRetryOverride\n\t});\n\treturn {\n\t\tuploadUrl: resp.uploadUrl,\n\t\tauthorizationToken: resp.authorizationToken\n\t};\n}\n/**\n* Fetches a large-file part upload URL, bypassing the pool.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param fileId - Large file to upload a part into.\n* @param signal - Optional abort signal for the fresh URL request.\n*\n* @returns A fresh part upload URL entry.\n*/\nasync function fetchFreshPartUploadUrl(raw, accountInfo, fileId, signal) {\n\tconst resp = await raw.getUploadPartUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId }, {\n\t\t...signal !== void 0 ? { signal } : {},\n\t\tretry: freshUrlRetryOverride\n\t});\n\treturn {\n\t\tuploadUrl: resp.uploadUrl,\n\t\tauthorizationToken: resp.authorizationToken\n\t};\n}\n/**\n* Uploads one multipart part with fresh-URL retry.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param fileId - Large file to upload a part into.\n* @param options - Part upload parameters and retry settings.\n*\n* @returns The uploaded part response.\n*/\nfunction uploadPartWithFreshUrl(raw, accountInfo, fileId, options) {\n\treturn withFreshUploadUrlRetry({\n\t\tfileName: options.fileName,\n\t\tpartNumber: options.partNumber,\n\t\tretry: options.retry,\n\t\tsignal: options.signal,\n\t\tonUploadRetry: options.onUploadRetry,\n\t\tretryResponseBodyFailures: options.retryResponseBodyFailures,\n\t\tcheckout: () => accountInfo.checkoutPartUploadUrl(fileId),\n\t\tfetchFresh: () => fetchFreshPartUploadUrl(raw, accountInfo, fileId, options.signal),\n\t\treturnEntry: (entry) => accountInfo.returnPartUploadUrl(fileId, entry),\n\t\tevictEntry: (entry) => accountInfo.evictPartUploadUrl(fileId, entry),\n\t\tupload: (entry) => raw.uploadPart(entry.uploadUrl, {\n\t\t\tauthorization: entry.authorizationToken,\n\t\t\tpartNumber: options.partNumber,\n\t\t\tcontentLength: options.contentLength,\n\t\t\tcontentSha1: options.contentSha1,\n\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n\t\t}, options.data, {\n\t\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t})\n\t});\n}\n/**\n* Runs an upload operation with B2's documented retry flow: evict the failed\n* upload URL, back off, fetch a fresh upload URL, and retry there.\n*\n* For single-request file uploads, sending the POST again after a lost success\n* response can create a duplicate file version. Multipart retries re-send the\n* same part number instead. Response-body retry defaults are caller-specific:\n* single-request uploads keep them off by default, while multipart callers can\n* opt in with `retryResponseBodyFailures: true` when replaying the same part\n* number is acceptable.\n*\n* @param options - URL checkout, upload, eviction, and retry callbacks.\n*\n* @returns The successful upload result.\n*/\nasync function withFreshUploadUrlRetry(options) {\n\tconst retryOptions = {\n\t\t...DEFAULT_RETRY_OPTIONS,\n\t\t...options.retry\n\t};\n\tfor (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {\n\t\tlet uploadEntry;\n\t\tlet uploadStarted = false;\n\t\ttry {\n\t\t\toptions.signal?.throwIfAborted();\n\t\t\tuploadEntry = attempt === 0 ? options.checkout() ?? await options.fetchFresh() : await options.fetchFresh();\n\t\t\tuploadStarted = true;\n\t\t\tconst result = await options.upload(uploadEntry);\n\t\t\toptions.returnEntry(uploadEntry);\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst retryError = normalizeUploadRetryError(err, options);\n\t\t\tif (uploadEntry !== void 0) if (isUploadRateLimitError(retryError)) options.returnEntry(uploadEntry);\n\t\t\telse options.evictEntry(uploadEntry);\n\t\t\tif (options.signal?.aborted) throw err;\n\t\t\tif (isUploadRateLimitError(retryError) && uploadEntry !== void 0) throw retryError;\n\t\t\tif (!isUploadRetryable(retryError, {\n\t\t\t\t...options,\n\t\t\t\tuploadStarted\n\t\t\t}) || attempt === retryOptions.maxRetries) throw retryError;\n\t\t\tconst retryAttempt = attempt + 1;\n\t\t\tconst retryAfter = retryError instanceof B2Error ? retryError.retryAfter : void 0;\n\t\t\tconst delayMs = computeBackoff(attempt, retryOptions, retryAfter);\n\t\t\tnotifyUploadRetry(options, {\n\t\t\t\tfileName: options.fileName,\n\t\t\t\tpartNumber: options.partNumber,\n\t\t\t\tattempt: retryAttempt,\n\t\t\t\tmaxRetries: retryOptions.maxRetries,\n\t\t\t\tdelayMs,\n\t\t\t\terror: retryError\n\t\t\t});\n\t\t\tawait sleep(delayMs, options.signal);\n\t\t}\n\t}\n\t/* v8 ignore next -- defensive return-path guard. */\n\tthrow new NetworkError(\"Upload retry budget exhausted\");\n}\nfunction notifyUploadRetry(options, event) {\n\ttry {\n\t\toptions.onUploadRetry?.(event);\n\t} catch {}\n}\nfunction isUploadRetryable(err, options) {\n\tif (err instanceof NetworkError) {\n\t\tif (err.cause instanceof B2SsrfError) return false;\n\t\tif (!options.uploadStarted) return true;\n\t\treturn options.retryResponseBodyFailures === true;\n\t}\n\tif (err instanceof BadAuthTokenError) return true;\n\tif (isUploadUrlInvalidationError(err)) return true;\n\treturn err instanceof B2Error && err.retryable;\n}\nfunction isUploadRateLimitError(err) {\n\treturn err instanceof B2Error && err.status === 429;\n}\nfunction normalizeUploadRetryError(err, options) {\n\tif (err instanceof B2Error || err instanceof NetworkError) return err;\n\tif (err instanceof UploadResponseBodyError) {\n\t\tif (!options.retryResponseBodyFailures) return err;\n\t\treturn new NetworkError(err.message, err);\n\t}\n\tif (err instanceof DOMException && err.name === \"AbortError\") return err;\n\tif (err instanceof TypeError || err instanceof SyntaxError || err instanceof DOMException) return new NetworkError(err instanceof Error ? err.message : \"Upload response read failed\", err);\n\treturn err;\n}\nfunction isUploadUrlInvalidationError(err) {\n\tif (err instanceof BadUploadUrlError) return true;\n\treturn err instanceof BadRequestError && /upload url/i.test(err.message);\n}\n//#endregion\nexport { fetchFreshPartUploadUrl, fetchFreshUploadUrl, resolveRetryResponseBodyFailures, uploadPartWithFreshUrl, withFreshUploadUrlRetry };\n\n//# sourceMappingURL=retry.js.map","import { createAbortScope, raceWithAbort, throwRejectedOrAbortReason } from \"./abort-scope.js\";\nimport { ResumeFileIdMismatchError } from \"../errors/index.js\";\nimport { cancelLargeFileBestEffort, cleanupAfterLargeFileError } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nimport { finishLargeFileWithAbortReconciliation } from \"./finish.js\";\nimport \"../util/defaults.js\";\nimport { planRanges } from \"../util/plan-ranges.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { IncrementalSha1 } from \"../streams/hash.js\";\nimport { readNextNonEmptyStreamChunk } from \"../streams/source.js\";\nimport { findResumeCandidate } from \"./resume.js\";\nimport { resolveRetryResponseBodyFailures, uploadPartWithFreshUrl } from \"./retry.js\";\n//#region src/upload/large.ts\nvar MAX_CONSECUTIVE_EMPTY_STREAM_CHUNKS = 1024;\nfunction createResumeCandidateCriteria(options, request, totalSize, partSize, parts) {\n\treturn {\n\t\tcontentType: request.contentType,\n\t\tfileInfo: request.fileInfo,\n\t\tsourceSize: totalSize,\n\t\tpartSize,\n\t\tparts,\n\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t...request.serverSideEncryption !== void 0 ? { serverSideEncryption: request.serverSideEncryption } : options.bucketDefaultServerSideEncryption !== void 0 ? { serverSideEncryption: options.bucketDefaultServerSideEncryption } : {},\n\t\t...request.fileRetention !== void 0 ? { fileRetention: request.fileRetention } : options.bucketDefaultRetention !== void 0 ? { defaultFileRetention: options.bucketDefaultRetention } : options.bucketDefaultRetentionUnreadable === true ? { defaultFileRetentionUnreadable: true } : {},\n\t\t...request.legalHold !== void 0 ? { legalHold: request.legalHold } : {},\n\t\t...options.resumeDiscoveryTimeoutMs !== void 0 ? { discoveryTimeoutMs: options.resumeDiscoveryTimeoutMs } : {},\n\t\t...options.onResumeCandidateRejected !== void 0 ? { onCandidateRejected: options.onResumeCandidateRejected } : {},\n\t\t...options.resumeMaxListPages !== void 0 ? { maxListPages: options.resumeMaxListPages } : {},\n\t\t...options.resumeMaxPartCandidates !== void 0 ? { maxPartCandidates: options.resumeMaxPartCandidates } : {},\n\t\t...options.resumeMaxPartPages !== void 0 ? { maxPartPages: options.resumeMaxPartPages } : {}\n\t};\n}\n/**\n* Uploads a file using the B2 multipart (large file) protocol.\n*\n* The source is sliced into parts and uploaded concurrently via\n* `b2_upload_part`. This is appropriate for files larger than the recommended\n* part size. For smaller files, use {@link uploadSmallFile} which sends the\n* entire payload in a single request.\n*\n* On failure, the in-progress large file is cancelled on a best-effort basis.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state (tokens, URLs, upload URL pool).\n* @param options - Upload parameters including part size and concurrency.\n*\n* @returns The resulting {@link FileVersion} metadata.\n*/\nasync function uploadLargeFile(raw, accountInfo, options) {\n\tconst recommendedPartSize = accountInfo.getRecommendedPartSize();\n\tconst minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n\tconst partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n\tconst concurrency = options.concurrency ?? 4;\n\tconst totalSize = options.source.size;\n\tconst parts = planRanges(totalSize, partSize);\n\tconst fileInfo = Object.create(null);\n\tif (options.fileInfo !== void 0) for (const [key, value] of Object.entries(options.fileInfo)) fileInfo[key] = value;\n\tconst startLargeFileRequest = {\n\t\tbucketId: options.bucketId,\n\t\tfileName: options.fileName,\n\t\tcontentType: options.contentType ?? \"b2/x-auto\",\n\t\tfileInfo,\n\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n\t\t...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n\t\t...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {}\n\t};\n\tconst resumeCandidateCriteria = createResumeCandidateCriteria(options, startLargeFileRequest, totalSize, partSize, parts);\n\tif (!options.source.canSlice && options.resumeFileId !== void 0) throw new Error(\"uploadLargeFile: resume is not supported on non-sliceable sources.\");\n\tlet largeFileId;\n\tlet preUploaded = /* @__PURE__ */ new Map();\n\tlet createdLargeFile = false;\n\tconst abortScope = createAbortScope(options.signal);\n\tconst startFreshLargeFile = async () => {\n\t\tif (abortScope.signal.aborted && !options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason);\n\t\tabortScope.signal.throwIfAborted();\n\t\tconst startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), startLargeFileRequest, {\n\t\t\tsignal: abortScope.signal,\n\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t});\n\t\ttry {\n\t\t\tlargeFileId = (await raceWithAbort(startPromise, abortScope.signal)).fileId;\n\t\t} catch (err) {\n\t\t\tif (abortScope.signal.aborted) {\n\t\t\t\tif (!options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason).catch(() => {});\n\t\t\t\tcancelLargeFileAfterStart(startPromise, raw, accountInfo, options.onCleanupFailure);\n\t\t\t}\n\t\t\tthrow err;\n\t\t}\n\t\tpreUploaded = /* @__PURE__ */ new Map();\n\t\tcreatedLargeFile = true;\n\t};\n\ttry {\n\t\tif (abortScope.signal.aborted && !options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason);\n\t\tabortScope.signal.throwIfAborted();\n\t\tif (options.resumeFileId !== void 0) {\n\t\t\tconst candidate = await findResumeCandidate(raw, accountInfo, options.bucketId, options.fileName, {\n\t\t\t\t...resumeCandidateCriteria,\n\t\t\t\tresumeFileId: options.resumeFileId\n\t\t\t});\n\t\t\tif (candidate === null) throw new ResumeFileIdMismatchError(options.resumeFileId, options.fileName);\n\t\t\tlargeFileId = candidate.fileId;\n\t\t\tpreUploaded = candidate.uploadedPartSha1s;\n\t\t} else if (options.resume === true && options.source.canSlice) {\n\t\t\tconst candidate = await findResumeCandidate(raw, accountInfo, options.bucketId, options.fileName, resumeCandidateCriteria);\n\t\t\tif (candidate) {\n\t\t\t\tlargeFileId = candidate.fileId;\n\t\t\t\tpreUploaded = /* @__PURE__ */ new Map();\n\t\t\t} else await startFreshLargeFile();\n\t\t} else await startFreshLargeFile();\n\t\tconst activeLargeFileId = largeFileId;\n\t\tif (activeLargeFileId === void 0) throw new Error(\"uploadLargeFile: start did not return a large file ID.\");\n\t\tconst partSha1s = new Array(parts.length);\n\t\tconst tracker = new ProgressTracker(options.onProgress, totalSize, parts.length);\n\t\tconst sem = new Semaphore(concurrency);\n\t\tif (!options.source.canSlice) {\n\t\t\tawait uploadPartsSequentially(raw, accountInfo, options, activeLargeFileId, parts, partSha1s, tracker, abortScope.signal);\n\t\t\treturn await finishLargeFileWithAbortReconciliation(raw, accountInfo, {\n\t\t\t\tfileId: activeLargeFileId,\n\t\t\t\tbucketId: options.bucketId,\n\t\t\t\tfileName: options.fileName,\n\t\t\t\tpartSha1s,\n\t\t\t\tsignal: abortScope.signal,\n\t\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t\t});\n\t\t}\n\t\tconst tasks = parts.map(async (part) => {\n\t\t\tawait sem.acquire();\n\t\t\ttry {\n\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\tconst partSource = options.source.slice(part.offset, part.offset + part.length);\n\t\t\t\tconst data = new Uint8Array(await partSource.toArrayBuffer({ signal: abortScope.signal }));\n\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\tconst partSha1 = new IncrementalSha1();\n\t\t\t\tawait partSha1.update(data);\n\t\t\t\tconst sha1Hex = await partSha1.digest();\n\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\tconst serverSha1 = preUploaded.get(part.partNumber);\n\t\t\t\tif (serverSha1 !== void 0 && serverSha1 === sha1Hex) {\n\t\t\t\t\tnotifyResumePartReused(options.onResumePartReused, {\n\t\t\t\t\t\tfileName: options.fileName,\n\t\t\t\t\t\tfileId: activeLargeFileId,\n\t\t\t\t\t\tpartNumber: part.partNumber,\n\t\t\t\t\t\tcontentLength: data.byteLength,\n\t\t\t\t\t\tcontentSha1: serverSha1\n\t\t\t\t\t});\n\t\t\t\t\tpartSha1s[part.partNumber - 1] = serverSha1;\n\t\t\t\t\ttracker.addBytes(data.byteLength);\n\t\t\t\t\ttracker.completePart();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst result = await uploadPartWithFreshUrl(raw, accountInfo, activeLargeFileId, {\n\t\t\t\t\tfileName: options.fileName,\n\t\t\t\t\tpartNumber: part.partNumber,\n\t\t\t\t\tdata,\n\t\t\t\t\tcontentLength: data.byteLength,\n\t\t\t\t\tcontentSha1: sha1Hex,\n\t\t\t\t\tretry: options.retry,\n\t\t\t\t\tsignal: abortScope.signal,\n\t\t\t\t\tonUploadRetry: options.onUploadRetry,\n\t\t\t\t\tretryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),\n\t\t\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n\t\t\t\t});\n\t\t\t\tpartSha1s[part.partNumber - 1] = result.contentSha1;\n\t\t\t\ttracker.addBytes(data.byteLength);\n\t\t\t\ttracker.completePart();\n\t\t\t} catch (err) {\n\t\t\t\tabortScope.abort(err);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsem.release();\n\t\t\t}\n\t\t});\n\t\tthrowRejectedOrAbortReason(await Promise.allSettled(tasks), abortScope);\n\t\treturn await finishLargeFileWithAbortReconciliation(raw, accountInfo, {\n\t\t\tfileId: activeLargeFileId,\n\t\t\tbucketId: options.bucketId,\n\t\t\tfileName: options.fileName,\n\t\t\tpartSha1s,\n\t\t\tsignal: abortScope.signal,\n\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t});\n\t} catch (err) {\n\t\tabortScope.abort(err);\n\t\tif (largeFileId === void 0) throw err;\n\t\treturn await cleanupAfterUploadLargeFileError(err, raw, accountInfo, options, largeFileId, createdLargeFile);\n\t} finally {\n\t\tabortScope.dispose();\n\t}\n}\nfunction cancelLargeFileAfterStart(started, raw, accountInfo, onCleanupFailure) {\n\tstarted.then((resp) => cancelLargeFileBestEffort(raw, accountInfo, resp.fileId, onCleanupFailure === void 0 ? void 0 : { onCleanupFailure })).catch(() => {});\n}\nasync function cleanupAfterUploadLargeFileError(err, raw, accountInfo, options, largeFileId, createdLargeFile) {\n\treturn await cleanupAfterLargeFileError(err, raw, accountInfo, {\n\t\tfileId: largeFileId,\n\t\tbucketId: options.bucketId,\n\t\tfileName: options.fileName,\n\t\tsignal: options.signal,\n\t\tonCleanupFailure: options.onCleanupFailure\n\t}, { cancelOnError: createdLargeFile });\n}\n/**\n* Sequential upload path for non-sliceable sources.\n*\n* Reads the source's `stream()` once and accumulates exactly `partSize`\n* bytes into an in-memory buffer per iteration. Each filled buffer is\n* hashed, dispatched to `b2_upload_part`, then released before the next\n* part starts — so peak memory is ~partSize regardless of file size.\n*\n* Concurrency is forced to 1 here because the stream is a single\n* forward-only cursor; the engine can't read part N+1 until part N is\n* fully consumed.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - The original `uploadLargeFile` options.\n* @param largeFileId - ID of the in-progress large file (already started).\n* @param parts - Pre-planned part layout (used for part numbers + count).\n* @param partSha1s - Output array, written in-place at index `partNumber - 1`.\n* @param tracker - Progress tracker; bytes added per chunk, part completed\n* each time a part finishes.\n* @param signal - Linked abort signal for source reads and part uploads.\n*/\nasync function uploadPartsSequentially(raw, accountInfo, options, largeFileId, parts, partSha1s, tracker, signal) {\n\tconst reader = options.source.stream().getReader();\n\tlet bytesRead = 0;\n\tlet carry = null;\n\ttry {\n\t\tfor (const planned of parts) {\n\t\t\tsignal.throwIfAborted();\n\t\t\tconst buf = new Uint8Array(planned.length);\n\t\t\tlet filled = 0;\n\t\t\tif (carry !== null) {\n\t\t\t\tconst take = Math.min(carry.byteLength, buf.byteLength - filled);\n\t\t\t\tbuf.set(carry.subarray(0, take), filled);\n\t\t\t\tfilled += take;\n\t\t\t\tcarry = take < carry.byteLength ? carry.subarray(take) : null;\n\t\t\t}\n\t\t\twhile (filled < buf.byteLength) {\n\t\t\t\tconst { done, value } = await readNextNonEmptyStreamChunk(reader, emptyChunkError(), signal);\n\t\t\t\tif (done) throw new Error(`uploadLargeFile: source stream ended after ${bytesRead} bytes, expected ${options.source.size}.`);\n\t\t\t\tbytesRead += value.byteLength;\n\t\t\t\tconst take = Math.min(value.byteLength, buf.byteLength - filled);\n\t\t\t\tbuf.set(value.subarray(0, take), filled);\n\t\t\t\tfilled += take;\n\t\t\t\tif (take < value.byteLength) carry = value.subarray(take);\n\t\t\t}\n\t\t\tsignal.throwIfAborted();\n\t\t\tconst data = buf;\n\t\t\tconst partSha1 = new IncrementalSha1();\n\t\t\tawait partSha1.update(data);\n\t\t\tconst sha1Hex = await partSha1.digest();\n\t\t\tsignal.throwIfAborted();\n\t\t\tconst result = await uploadPartWithFreshUrl(raw, accountInfo, largeFileId, {\n\t\t\t\tfileName: options.fileName,\n\t\t\t\tpartNumber: planned.partNumber,\n\t\t\t\tdata,\n\t\t\t\tcontentLength: data.byteLength,\n\t\t\t\tcontentSha1: sha1Hex,\n\t\t\t\tretry: options.retry,\n\t\t\t\tsignal,\n\t\t\t\tonUploadRetry: options.onUploadRetry,\n\t\t\t\tretryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),\n\t\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n\t\t\t});\n\t\t\tpartSha1s[planned.partNumber - 1] = result.contentSha1;\n\t\t\ttracker.addBytes(data.byteLength);\n\t\t\ttracker.completePart();\n\t\t}\n\t\tif (carry !== null && carry.byteLength > 0) throw new Error(tooManyBytesError(options.source.size));\n\t\tconst extra = await readNextNonEmptyStreamChunk(reader, emptyChunkError(), signal);\n\t\tif (!extra.done) {\n\t\t\tbytesRead += extra.value.byteLength;\n\t\t\tthrow new Error(tooManyBytesError(options.source.size));\n\t\t}\n\t} catch (err) {\n\t\tawait reader.cancel(err).catch(() => {});\n\t\tthrow err;\n\t} finally {\n\t\treader.releaseLock();\n\t}\n}\nfunction emptyChunkError() {\n\treturn `uploadLargeFile: source stream emitted more than ${MAX_CONSECUTIVE_EMPTY_STREAM_CHUNKS} consecutive empty chunks. too many empty chunks.`;\n}\nfunction tooManyBytesError(advertisedSize) {\n\treturn `uploadLargeFile: source stream emitted more than advertised ${advertisedSize} bytes. source stream emitted more bytes than advertised size.`;\n}\nasync function cancelForwardOnlySource(source, reason) {\n\tconst reader = source.stream().getReader();\n\ttry {\n\t\tawait reader.cancel(reason);\n\t} finally {\n\t\treader.releaseLock();\n\t}\n}\nfunction notifyResumePartReused(listener, event) {\n\ttry {\n\t\tlistener?.(event);\n\t} catch {}\n}\n//#endregion\nexport { uploadLargeFile };\n\n//# sourceMappingURL=large.js.map","//#region src/upload/options.ts\n/**\n* Explicit resume targets are multipart-only and must fail closed on small uploads.\n*\n* @param options - High-level upload options.\n* @param caller - Public method name used in the thrown error.\n*\n* @throws Error when an explicit resume target is supplied for a small upload.\n*/\nfunction rejectSmallResumeFileId(options, caller) {\n\tif (options.resumeFileId !== void 0) throw new Error(`${caller}: resumeFileId is only supported for multipart uploads.`);\n}\n/**\n* Removes resume-only options before forwarding to the small-file upload path.\n*\n* @param options - High-level upload options.\n*\n* @returns Options accepted by the single-request upload implementation.\n*/\nfunction stripResumeOnlyOptions(options) {\n\tconst { resume: _resume, resumeFileId: _resumeFileId, onResumeCandidateRejected: _onResumeCandidateRejected, onResumePartReused: _onResumePartReused, resumeDiscoveryTimeoutMs: _resumeDiscoveryTimeoutMs, resumeMaxListPages: _resumeMaxListPages, resumeMaxPartCandidates: _resumeMaxPartCandidates, resumeMaxPartPages: _resumeMaxPartPages, ...smallOptions } = options;\n\treturn smallOptions;\n}\n//#endregion\nexport { rejectSmallResumeFileId, stripResumeOnlyOptions };\n\n//# sourceMappingURL=options.js.map","import \"../util/defaults.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { IncrementalSha1 } from \"../streams/hash.js\";\nimport { collectStreamExactly } from \"../streams/source.js\";\nimport { fetchFreshUploadUrl, resolveRetryResponseBodyFailures, withFreshUploadUrlRetry } from \"./retry.js\";\n//#region src/upload/single.ts\n/**\n* Uploads a file in a single HTTP request (suitable for files up to ~100 MB).\n*\n* The entire file content is read into memory, SHA-1 hashed, and sent in one\n* `b2_upload_file` call. For files larger than the recommended part size, use\n* {@link uploadLargeFile} which splits the file into parts uploaded in parallel.\n*\n* Upload URLs are pooled via {@link AccountInfo} and recycled on success or\n* evicted on failure.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state (tokens, URLs, upload URL pool).\n* @param options - Upload parameters.\n*\n* @returns The resulting {@link FileVersion} metadata.\n*/\nasync function uploadSmallFile(raw, accountInfo, options) {\n\tconst data = await readSmallFileSource(options.source, options.signal);\n\tif (data.byteLength !== options.source.size) throw new Error(`uploadSmallFile: source byte count does not match advertised size (expected ${options.source.size} bytes, got ${data.byteLength} bytes).`);\n\tconst sha1 = new IncrementalSha1();\n\tawait sha1.update(data);\n\tconst sha1Hex = await sha1.digest();\n\tconst tracker = new ProgressTracker(options.onProgress, data.byteLength, 1);\n\tconst result = await withFreshUploadUrlRetry({\n\t\tfileName: options.fileName,\n\t\tpartNumber: null,\n\t\tretry: options.retry,\n\t\tsignal: options.signal,\n\t\tonUploadRetry: options.onUploadRetry,\n\t\tretryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),\n\t\tcheckout: () => accountInfo.checkoutUploadUrl(options.bucketId),\n\t\tfetchFresh: () => fetchFreshUploadUrl(raw, accountInfo, options.bucketId, options.signal),\n\t\treturnEntry: (entry) => accountInfo.returnUploadUrl(options.bucketId, entry),\n\t\tevictEntry: (entry) => accountInfo.evictUploadUrl(options.bucketId, entry),\n\t\tupload: (entry) => raw.uploadFile(entry.uploadUrl, {\n\t\t\tauthorization: entry.authorizationToken,\n\t\t\tfileName: options.fileName,\n\t\t\tcontentType: options.contentType ?? \"b2/x-auto\",\n\t\t\tcontentLength: data.byteLength,\n\t\t\tcontentSha1: sha1Hex,\n\t\t\t...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n\t\t\t...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n\t\t\t...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {},\n\t\t\t...options.lastModifiedMillis !== void 0 ? { lastModifiedMillis: options.lastModifiedMillis } : {}\n\t\t}, data, {\n\t\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t})\n\t});\n\ttracker.addBytes(data.byteLength);\n\ttracker.completePart();\n\treturn result;\n}\nasync function readSmallFileSource(source, signal) {\n\tsignal?.throwIfAborted();\n\tif (!source.canSlice) return collectStreamExactly(source.stream(), source.size, signal);\n\tconst data = new Uint8Array(await (signal === void 0 ? source.toArrayBuffer() : source.toArrayBuffer({ signal })));\n\tsignal?.throwIfAborted();\n\treturn data;\n}\n//#endregion\nexport { uploadSmallFile };\n\n//# sourceMappingURL=single.js.map","//#region src/util/to-error.ts\n/**\n* Coerce an unknown caught value to a real error instance.\n*\n* Existing error objects pass through unchanged so call sites preserve\n* the original stack and any subclass identity. Other values are\n* wrapped in a fresh Error whose message is `String(value)`. Centralises\n* the conditional that previously recurred at every async-boundary\n* catch site in the upload, copy, sync, and stream paths.\n*\n* @param value - Value caught from a `try`/`catch` or rejected promise.\n*\n* @returns An `Error` representing `value`.\n*/\nfunction toError(value) {\n\treturn value instanceof Error ? value : new Error(String(value));\n}\n//#endregion\nexport { toError };\n\n//# sourceMappingURL=to-error.js.map","//#region src/streams/collect.ts\n/**\n* Drain a `ReadableStream` into a single contiguous\n* `Uint8Array`. Releases the reader lock on both the happy and error\n* paths so the underlying stream can propagate close / error events to\n* the upstream producer.\n*\n* Used by both `createParallelDownloadStream` (per-range fetch) and\n* `StreamSource.toArrayBuffer` (whole-source materialisation). The two\n* code paths previously hand-rolled the same accumulate-then-concat\n* loop; consolidating here removes ~25 duplicated lines and a class of\n* lock-leak bugs.\n*\n* @param stream - Readable stream to consume. Will be fully drained.\n* @param options - Optional abort signal used to stop a pending read.\n*\n* @returns A new `Uint8Array` containing every byte the stream produced.\n*/\nasync function collectStream(stream, options = {}) {\n\tconst reader = stream.getReader();\n\ttry {\n\t\tconst chunks = [];\n\t\tlet total = 0;\n\t\twhile (true) {\n\t\t\tconst { done, value } = await readStreamChunkWithSignal(reader, options.signal);\n\t\t\tif (done) break;\n\t\t\tchunks.push(value);\n\t\t\ttotal += value.byteLength;\n\t\t}\n\t\tconst result = new Uint8Array(total);\n\t\tlet offset = 0;\n\t\tfor (const chunk of chunks) {\n\t\t\tresult.set(chunk, offset);\n\t\t\toffset += chunk.byteLength;\n\t\t}\n\t\treturn result;\n\t} finally {\n\t\treader.releaseLock();\n\t}\n}\n/**\n* Reads one chunk and rejects when the supplied signal aborts.\n* @param reader - Stream reader to read from.\n* @param signal - Optional abort signal that cancels the read.\n*\n* @returns The next stream read result.\n*\n* @internal\n*/\nasync function readStreamChunkWithSignal(reader, signal) {\n\tif (signal === void 0) return reader.read();\n\tsignal.throwIfAborted();\n\tlet removeAbortListener;\n\tconst abortPromise = new Promise((_, reject) => {\n\t\tconst onAbort = () => {\n\t\t\tconst reason = abortReason(signal);\n\t\t\treject(reason);\n\t\t\treader.cancel(reason).catch(() => {});\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\treturn await Promise.race([reader.read(), abortPromise]);\n\t} finally {\n\t\tremoveAbortListener?.();\n\t}\n}\nfunction abortReason(signal) {\n\treturn signal.reason ?? new DOMException(\"The operation was aborted.\", \"AbortError\");\n}\n//#endregion\nexport { collectStream, readStreamChunkWithSignal };\n\n//# sourceMappingURL=collect.js.map","import { B2Error, NetworkError, classifyError } from \"../errors/index.js\";\nimport { byteRangeHeader, planRanges } from \"../util/plan-ranges.js\";\nimport { utf8Decoder } from \"../util/text-codec.js\";\nimport { normalizeSha1 } from \"../util/normalize.js\";\nimport { IncrementalSha1 } from \"../streams/hash.js\";\nimport { normalizeVerifiableSha1 } from \"../util/sha1.js\";\nimport { assertDownloadSha1, assertDownloadSha1HeaderAgreement } from \"./checksum.js\";\nimport { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep } from \"../http/retry.js\";\nimport { collectStream } from \"../streams/collect.js\";\n//#region src/download/parallel.ts\n/**\n* Creates a readable stream that downloads a file using parallel byte-range requests.\n*\n* The file is split into fixed-size ranges fetched in a **sliding\n* window** keyed off the consumer's read pace. The window size is\n* `concurrency * 2`: up to `concurrency` ranges are in flight at once,\n* plus up to `concurrency` completed-but-not-yet-emitted ranges buffered\n* ahead of the read head. New fetches kick off only when the consumer\n* reads a chunk, so a slow downstream pipe (e.g. a saturated network\n* sink or a `pipeTo` consumer that drains slowly) backpressures into\n* the SDK and bounds peak memory to `(concurrency * 2) * rangeSize`.\n*\n* The previous eager implementation scheduled every range into\n* `Promise.all` up front; a slow head-of-line range could hold the\n* entire file in memory while later ranges finished and waited.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - Parallel download parameters (file ID, size, concurrency).\n*\n* @returns A `ReadableStream` that yields file bytes in order.\n*/\nfunction createParallelDownloadStream(raw, accountInfo, options) {\n\tconst rangeSize = options.rangeSize ?? 10 * 1024 * 1024;\n\tconst concurrency = options.concurrency ?? 4;\n\tconst totalSize = options.totalSize;\n\tconst retryOptions = {\n\t\t...DEFAULT_RETRY_OPTIONS,\n\t\tmaxRetries: options.maxRetries ?? 0\n\t};\n\tconst abort = options.signal;\n\tconst ranges = planRanges(totalSize, rangeSize);\n\tconst windowSize = concurrency * 2;\n\tconst inflight = /* @__PURE__ */ new Map();\n\tconst buffer = /* @__PURE__ */ new Map();\n\tlet assembledSha1 = null;\n\tlet nextToSchedule = 0;\n\tlet nextToEmit = 0;\n\tlet expectedSha1;\n\tlet firstError = null;\n\tfunction scheduleNext() {\n\t\twhile (firstError === null && abort?.aborted !== true && nextToSchedule < ranges.length && inflight.size + buffer.size < windowSize) {\n\t\t\tconst range = ranges[nextToSchedule];\n\t\t\tif (range === void 0) break;\n\t\t\tconst idx = nextToSchedule;\n\t\t\tnextToSchedule++;\n\t\t\tconst task = (async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await fetchRangeWithRetry(raw, accountInfo, options.fileId, range.start, range.end, totalSize, retryOptions, abort);\n\t\t\t\t\tbuffer.set(idx, result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (firstError === null) firstError = err;\n\t\t\t\t} finally {\n\t\t\t\t\tinflight.delete(idx);\n\t\t\t\t}\n\t\t\t})();\n\t\t\tinflight.set(idx, task);\n\t\t}\n\t}\n\treturn new ReadableStream({\n\t\tstart(controller) {\n\t\t\ttry {\n\t\t\t\tabort?.throwIfAborted();\n\t\t\t\tscheduleNext();\n\t\t\t} catch (err) {\n\t\t\t\tcontroller.error(err);\n\t\t\t}\n\t\t},\n\t\tasync pull(controller) {\n\t\t\ttry {\n\t\t\t\twhile (!buffer.has(nextToEmit)) {\n\t\t\t\t\tabort?.throwIfAborted();\n\t\t\t\t\tif (firstError !== null) throw firstError;\n\t\t\t\t\tif (inflight.size === 0) {\n\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tawait Promise.race(inflight.values());\n\t\t\t\t}\n\t\t\t\tconst result = buffer.get(nextToEmit);\n\t\t\t\tif (result !== void 0) {\n\t\t\t\t\tbuffer.delete(nextToEmit);\n\t\t\t\t\tnextToEmit++;\n\t\t\t\t\tconst rangeSha1 = normalizeVerifiableSha1(result.contentSha1);\n\t\t\t\t\tif (expectedSha1 === void 0) expectedSha1 = rangeSha1;\n\t\t\t\t\telse assertDownloadSha1HeaderAgreement(expectedSha1, rangeSha1);\n\t\t\t\t\tif (expectedSha1 !== null) {\n\t\t\t\t\t\tassembledSha1 ??= new IncrementalSha1();\n\t\t\t\t\t\tawait assembledSha1.update(result.data);\n\t\t\t\t\t}\n\t\t\t\t\tcontroller.enqueue(result.data);\n\t\t\t\t}\n\t\t\t\tscheduleNext();\n\t\t\t\tif (nextToEmit >= ranges.length && buffer.size === 0 && inflight.size === 0 && firstError === null) {\n\t\t\t\t\tif (expectedSha1 !== void 0 && expectedSha1 !== null && assembledSha1 !== null) assertDownloadSha1(expectedSha1, await assembledSha1.digest());\n\t\t\t\t\tcontroller.close();\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tcontroller.error(err);\n\t\t\t}\n\t\t},\n\t\tcancel() {\n\t\t\tbuffer.clear();\n\t\t}\n\t});\n}\n/**\n* Fetches a single byte range with bounded retry on transient failures.\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param fileId - ID of the file being downloaded.\n* @param start - Inclusive byte offset where the range begins.\n* @param end - Inclusive byte offset where the range ends.\n* @param totalSize - Expected complete file size.\n* @param retryOptions - Retry settings controlling attempts and backoff.\n* @param signal - Optional abort signal that cancels the range and any pending retry.\n*\n* @returns The range's bytes, or throws after exhausting all retry attempts.\n*/\nasync function fetchRangeWithRetry(raw, accountInfo, fileId, start, end, totalSize, retryOptions, signal) {\n\tlet lastError;\n\tfor (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {\n\t\tif (attempt > 0) {\n\t\t\tconst retryAfter = lastError instanceof B2Error && lastError.retryAfter !== void 0 ? lastError.retryAfter : void 0;\n\t\t\tawait sleep(computeBackoff(attempt - 1, retryOptions, retryAfter), signal);\n\t\t}\n\t\ttry {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tconst resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), fileId, {\n\t\t\t\trange: byteRangeHeader(start, end),\n\t\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t\t});\n\t\t\tif (resp.status < 200 || resp.status >= 300) throw await classifyDownloadResponseError(resp);\n\t\t\tif (!resp.body) throw new Error(\"Download chunk has no body\");\n\t\t\tconst data = await collectStream(resp.body);\n\t\t\tvalidateRangeResponse(resp, start, end, totalSize, data.byteLength);\n\t\t\treturn {\n\t\t\t\tdata,\n\t\t\t\tcontentSha1: normalizeSha1(resp.headers.get(\"X-Bz-Content-Sha1\"))\n\t\t\t};\n\t\t} catch (err) {\n\t\t\tlastError = err;\n\t\t\tif (signal?.aborted) throw err;\n\t\t\tif (err instanceof DOMException && err.name === \"AbortError\") throw err;\n\t\t\tif (!isRetryableRangeError(err) || attempt === retryOptions.maxRetries) throw err;\n\t\t}\n\t}\n\tthrow lastError instanceof Error ? lastError : /* @__PURE__ */ new Error(\"Range download failed after retries\");\n}\nvar RangeValidationError = class extends Error {\n\tretryable = false;\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"RangeValidationError\";\n\t}\n};\nfunction validateRangeResponse(response, start, end, totalSize, byteLength) {\n\tconst expectedLength = end - start + 1;\n\tif (response.status !== 206) throw new RangeValidationError(`Expected HTTP 206 Partial Content for range ${start}-${end}, got ${response.status}`);\n\tconst contentRange = response.headers.get(\"Content-Range\");\n\tif (contentRange === null) throw new RangeValidationError(`Missing Content-Range for range ${start}-${end}`);\n\tconst match = contentRange.match(/^bytes (\\d+)-(\\d+)\\/(\\d+|\\*)$/);\n\tif (match === null) throw new RangeValidationError(`Invalid Content-Range for range ${start}-${end}: ${contentRange}`);\n\tconst actualStart = Number.parseInt(match[1] ?? \"\", 10);\n\tconst actualEnd = Number.parseInt(match[2] ?? \"\", 10);\n\tconst actualTotal = match[3] ?? \"\";\n\tif (actualStart !== start || actualEnd !== end) throw new RangeValidationError(`Content-Range ${contentRange} does not match requested range ${start}-${end}`);\n\tif (actualTotal === \"*\") throw new RangeValidationError(`Content-Range ${contentRange} does not include total size`);\n\tif (Number.parseInt(actualTotal, 10) !== totalSize) throw new RangeValidationError(`Content-Range ${contentRange} does not match expected total size ${totalSize}`);\n\tif (byteLength !== expectedLength) throw new RangeValidationError(`Expected ${expectedLength} bytes for range ${start}-${end}, got ${byteLength}`);\n}\nasync function classifyDownloadResponseError(response) {\n\tlet errorBody = {\n\t\tstatus: response.status,\n\t\tcode: \"internal_error\",\n\t\tmessage: `HTTP ${response.status}`\n\t};\n\tif (response.body !== null) {\n\t\tconst bytes = await collectStream(response.body);\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(utf8Decoder.decode(bytes));\n\t\t\terrorBody = {\n\t\t\t\tstatus: response.status,\n\t\t\t\tcode: parsed.code ?? \"internal_error\",\n\t\t\t\tmessage: parsed.message ?? `HTTP ${response.status}`\n\t\t\t};\n\t\t} catch {}\n\t}\n\tconst retryAfterHeader = response.headers.get(\"Retry-After\");\n\tconst retryAfter = retryAfterHeader !== null ? Number.parseInt(retryAfterHeader, 10) : void 0;\n\tconst requestId = response.headers.get(\"X-Bz-Request-Id\") ?? void 0;\n\treturn classifyError(errorBody, {\n\t\t...retryAfter !== void 0 ? { retryAfter } : {},\n\t\t...requestId !== void 0 ? { requestId } : {}\n\t});\n}\nfunction isRetryableRangeError(err) {\n\tif (err instanceof B2Error || err instanceof NetworkError) return err.retryable;\n\tif (hasRetryableFlag(err)) return err.retryable;\n\treturn err instanceof TypeError;\n}\nfunction hasRetryableFlag(err) {\n\treturn typeof err === \"object\" && err !== null && \"retryable\" in err && typeof err.retryable === \"boolean\";\n}\n//#endregion\nexport { createParallelDownloadStream };\n\n//# sourceMappingURL=parallel.js.map","import { abortReason, createAbortScope, raceWithAbort } from \"./abort-scope.js\";\nimport { DEFAULT_CLEANUP_TIMEOUT_MS, cancelLargeFileBestEffort, resolveLargeFileErrorAfterCleanup } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nimport { finishLargeFileWithAbortReconciliation } from \"./finish.js\";\nimport \"../util/defaults.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { IncrementalSha1 } from \"../streams/hash.js\";\nimport { resolveRetryResponseBodyFailures, uploadPartWithFreshUrl } from \"./retry.js\";\nimport { toError } from \"../util/to-error.js\";\n//#region src/upload/stream.ts\n/**\n* Creates a {@link WritableStream} that streams data into a B2 multipart upload.\n*\n* Buffers incoming chunks until `partSize` bytes are accumulated, ships each\n* complete part through the standard multipart engine, and finalizes the file\n* once the stream is closed. Honours backpressure via the queue's bounded\n* concurrency. Streaming uploads do not support resume because the total size\n* and per-part hashes aren't known in advance; use {@link uploadLargeFile} with\n* a buffered source when resume is required.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state (tokens, URLs, part URL pool).\n* @param options - Streaming upload parameters.\n*\n* @returns A {@link UploadWriteHandle} with the writable sink and a completion promise.\n*/\nfunction createWriteStream(raw, accountInfo, options) {\n\tconst minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n\tconst recommendedPartSize = accountInfo.getRecommendedPartSize();\n\tconst partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n\tconst concurrency = options.concurrency ?? 4;\n\tconst tracker = new ProgressTracker(options.onProgress, null, null);\n\tconst sem = new Semaphore(concurrency);\n\tconst abortScope = createAbortScope(options.signal);\n\tlet largeFileId = null;\n\tlet startPromise = null;\n\tlet cancelAfterStartScheduled = false;\n\tlet nextPartNumber = 1;\n\tlet pendingBytes = 0;\n\tconst pending = [];\n\tconst partSha1s = [];\n\tconst inflight = [];\n\tlet errored = null;\n\tconst { promise: done, resolve: resolveDone, reject: rejectDone } = Promise.withResolvers();\n\tdone.catch(() => {});\n\tfunction ensureStarted() {\n\t\tif (largeFileId !== null) return Promise.resolve(largeFileId);\n\t\tif (startPromise === null) startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tbucketId: options.bucketId,\n\t\t\tfileName: options.fileName,\n\t\t\tcontentType: options.contentType ?? \"b2/x-auto\",\n\t\t\tfileInfo: options.fileInfo ?? {},\n\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n\t\t}, {\n\t\t\tsignal: abortScope.signal,\n\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t}).then((resp) => {\n\t\t\tlargeFileId = resp.fileId;\n\t\t\tif (abortScope.signal.aborted || errored !== null) cancelStartedLargeFile(largeFileId);\n\t\t\treturn largeFileId;\n\t\t});\n\t\tconst started = startPromise;\n\t\treturn raceWithAbort(started, abortScope.signal).catch((err) => {\n\t\t\tif (abortScope.signal.aborted) scheduleCancelLargeFileAfterStart(started);\n\t\t\tthrow err;\n\t\t});\n\t}\n\tasync function shipPart(data, partNumber) {\n\t\tif (errored !== null) throw errored;\n\t\tabortScope.signal.throwIfAborted();\n\t\tconst fileId = await ensureStarted();\n\t\tif (errored !== null) throw errored;\n\t\tabortScope.signal.throwIfAborted();\n\t\tconst sha1 = new IncrementalSha1();\n\t\tawait sha1.update(data);\n\t\tconst sha1Hex = await sha1.digest();\n\t\tabortScope.signal.throwIfAborted();\n\t\tconst result = await uploadPartWithFreshUrl(raw, accountInfo, fileId, {\n\t\t\tfileName: options.fileName,\n\t\t\tpartNumber,\n\t\t\tdata,\n\t\t\tcontentLength: data.byteLength,\n\t\t\tcontentSha1: sha1Hex,\n\t\t\tretry: options.retry,\n\t\t\tsignal: abortScope.signal,\n\t\t\tonUploadRetry: options.onUploadRetry,\n\t\t\tretryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),\n\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n\t\t});\n\t\tpartSha1s[partNumber - 1] = result.contentSha1;\n\t\ttracker.addBytes(data.byteLength);\n\t\ttracker.completePart();\n\t}\n\tfunction markErrored(err) {\n\t\tconst error = toError(err);\n\t\terrored = error;\n\t\tabortScope.abort(error);\n\t\treturn error;\n\t}\n\tfunction cancelStartedLargeFile(fileId) {\n\t\tif (cancelAfterStartScheduled) return;\n\t\tcancelAfterStartScheduled = true;\n\t\tcancelLargeFileBestEffort(raw, accountInfo, fileId, cleanupWriteStreamOptions(options));\n\t}\n\tfunction scheduleCancelLargeFileAfterStart(started) {\n\t\tstarted.then((fileId) => cancelStartedLargeFile(fileId)).catch(() => {});\n\t}\n\tasync function settleInflightForClose() {\n\t\tconst settled = Promise.allSettled(inflight);\n\t\tif (startPromise === null || largeFileId !== null) return await settled;\n\t\tconst abortWaiter = waitForAbort(abortScope.signal);\n\t\ttry {\n\t\t\tif (await Promise.race([\n\t\t\t\tsettled.then(() => \"settled\"),\n\t\t\t\tstartPromise.then(() => \"start-settled\", () => \"start-settled\"),\n\t\t\t\tabortWaiter.promise.then(() => \"aborted\")\n\t\t\t]) === \"aborted\" && largeFileId === null) throw abortReason(abortScope.signal);\n\t\t\treturn await settled;\n\t\t} finally {\n\t\t\tabortWaiter.dispose();\n\t\t}\n\t}\n\tfunction startPartWithAcquiredSlot(data, partNumber) {\n\t\tconst task = (async () => {\n\t\t\ttry {\n\t\t\t\tawait shipPart(data, partNumber);\n\t\t\t} catch (err) {\n\t\t\t\tmarkErrored(err);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsem.release();\n\t\t\t}\n\t\t})();\n\t\tinflight.push(task);\n\t\ttask.catch(() => {});\n\t}\n\tasync function acquirePartSlot() {\n\t\tawait sem.acquire();\n\t\tif (errored !== null) {\n\t\t\tsem.release();\n\t\t\tthrow errored;\n\t\t}\n\t\ttry {\n\t\t\tabortScope.signal.throwIfAborted();\n\t\t} catch (err) {\n\t\t\tsem.release();\n\t\t\tthrow err;\n\t\t}\n\t}\n\tasync function waitForInflightPartsToSettle(timeoutMs = DEFAULT_CLEANUP_TIMEOUT_MS) {\n\t\tif (inflight.length === 0) return;\n\t\tlet timeout;\n\t\ttry {\n\t\t\tawait Promise.race([Promise.allSettled(inflight).then(() => void 0), new Promise((resolve) => {\n\t\t\t\ttimeout = setTimeout(resolve, timeoutMs);\n\t\t\t})]);\n\t\t} finally {\n\t\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t\t}\n\t}\n\tasync function dispatchPart() {\n\t\tif (pending.length === 0) return;\n\t\tawait acquirePartSlot();\n\t\tlet data;\n\t\tif (pending.length === 1) {\n\t\t\tconst head = pending[0];\n\t\t\tif (!head) {\n\t\t\t\tsem.release();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdata = head;\n\t\t} else {\n\t\t\tconst total = pending.reduce((sum, chunk) => sum + chunk.byteLength, 0);\n\t\t\tdata = new Uint8Array(total);\n\t\t\tlet offset = 0;\n\t\t\tfor (const chunk of pending) {\n\t\t\t\tdata.set(chunk, offset);\n\t\t\t\toffset += chunk.byteLength;\n\t\t\t}\n\t\t}\n\t\tpending.length = 0;\n\t\tpendingBytes = 0;\n\t\tconst partNumber = nextPartNumber++;\n\t\tstartPartWithAcquiredSlot(data, partNumber);\n\t}\n\treturn {\n\t\twritable: new WritableStream({\n\t\t\tasync write(chunk) {\n\t\t\t\tif (errored) throw errored;\n\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\tif (chunk.byteLength === 0) return;\n\t\t\t\tpending.push(chunk);\n\t\t\t\tpendingBytes += chunk.byteLength;\n\t\t\t\twhile (pendingBytes >= partSize) {\n\t\t\t\t\tawait acquirePartSlot();\n\t\t\t\t\tif (errored) {\n\t\t\t\t\t\tsem.release();\n\t\t\t\t\t\tthrow errored;\n\t\t\t\t\t}\n\t\t\t\t\tconst carved = carveExact(pending, partSize);\n\t\t\t\t\tconst partNumber = nextPartNumber++;\n\t\t\t\t\tpendingBytes -= partSize;\n\t\t\t\t\tstartPartWithAcquiredSlot(carved, partNumber);\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync close() {\n\t\t\t\ttry {\n\t\t\t\t\tif (errored) throw errored;\n\t\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\t\tif (pendingBytes > 0) await dispatchPart();\n\t\t\t\t\tconst rejected = (await settleInflightForClose()).find((result) => result.status === \"rejected\");\n\t\t\t\t\tif (rejected !== void 0 && errored === null) markErrored(rejected.reason);\n\t\t\t\t\tif (errored) throw errored;\n\t\t\t\t\tif (largeFileId === null) throw new Error(\"createWriteStream closed without any data written.\");\n\t\t\t\t\tconst result = await finishLargeFileWithAbortReconciliation(raw, accountInfo, {\n\t\t\t\t\t\tfileId: largeFileId,\n\t\t\t\t\t\tbucketId: options.bucketId,\n\t\t\t\t\t\tfileName: options.fileName,\n\t\t\t\t\t\tpartSha1s,\n\t\t\t\t\t\tsignal: abortScope.signal,\n\t\t\t\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t\t\t\t});\n\t\t\t\t\tabortScope.dispose();\n\t\t\t\t\tresolveDone(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst closeError = toError(err);\n\t\t\t\t\tif (errored === null) errored = closeError;\n\t\t\t\t\tabortScope.abort(errored);\n\t\t\t\t\tconst observedError = errored;\n\t\t\t\t\tconst fileIdToCancel = largeFileId;\n\t\t\t\t\tif (fileIdToCancel === null && startPromise !== null) {\n\t\t\t\t\t\tscheduleCancelLargeFileAfterStart(startPromise);\n\t\t\t\t\t\tabortScope.dispose();\n\t\t\t\t\t\trejectDone(observedError);\n\t\t\t\t\t\tthrow observedError;\n\t\t\t\t\t}\n\t\t\t\t\tawait Promise.allSettled(inflight);\n\t\t\t\t\tlet finalError = observedError;\n\t\t\t\t\tif (fileIdToCancel !== null) finalError = await resolveLargeFileErrorAfterCleanup(observedError, raw, accountInfo, {\n\t\t\t\t\t\tfileId: fileIdToCancel,\n\t\t\t\t\t\tbucketId: options.bucketId,\n\t\t\t\t\t\tfileName: options.fileName,\n\t\t\t\t\t\tsignal: options.signal,\n\t\t\t\t\t\tonCleanupFailure: options.onCleanupFailure\n\t\t\t\t\t});\n\t\t\t\t\tabortScope.dispose();\n\t\t\t\t\trejectDone(finalError);\n\t\t\t\t\tthrow finalError;\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync abort(reason) {\n\t\t\t\tconst abortError = markErrored(reason);\n\t\t\t\tpending.length = 0;\n\t\t\t\tpendingBytes = 0;\n\t\t\t\tconst fileIdToCancel = largeFileId;\n\t\t\t\tif (fileIdToCancel === null && startPromise !== null) scheduleCancelLargeFileAfterStart(startPromise);\n\t\t\t\tif (fileIdToCancel !== null) {\n\t\t\t\t\tawait waitForInflightPartsToSettle();\n\t\t\t\t\tawait cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel, cleanupWriteStreamOptions(options));\n\t\t\t\t}\n\t\t\t\tabortScope.dispose();\n\t\t\t\trejectDone(abortError);\n\t\t\t}\n\t\t}),\n\t\tdone\n\t};\n}\nfunction cleanupWriteStreamOptions(options) {\n\treturn {\n\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t...options.onCleanupFailure !== void 0 ? { onCleanupFailure: options.onCleanupFailure } : {}\n\t};\n}\n/**\n* Removes exactly `size` bytes from the front of `chunks` (mutates) and returns\n* them as a contiguous Uint8Array. Any trailing remainder of the last chunk\n* stays at the front of `chunks` for the next part.\n*\n* @param chunks - Queue of pending chunks. Modified in place.\n* @param size - Number of bytes to carve off the front.\n*\n* @returns A new Uint8Array containing exactly `size` bytes.\n*/\nfunction carveExact(chunks, size) {\n\tconst out = new Uint8Array(size);\n\tlet written = 0;\n\twhile (written < size && chunks.length > 0) {\n\t\tconst head = chunks[0];\n\t\tif (!head) break;\n\t\tconst need = size - written;\n\t\tif (head.byteLength <= need) {\n\t\t\tout.set(head, written);\n\t\t\twritten += head.byteLength;\n\t\t\tchunks.shift();\n\t\t} else {\n\t\t\tout.set(head.subarray(0, need), written);\n\t\t\tchunks[0] = head.subarray(need);\n\t\t\twritten += need;\n\t\t}\n\t}\n\treturn out;\n}\nfunction waitForAbort(signal) {\n\tif (signal.aborted) return {\n\t\tpromise: Promise.resolve(abortReason(signal)),\n\t\tdispose() {}\n\t};\n\tlet onAbort;\n\treturn {\n\t\tpromise: new Promise((resolve) => {\n\t\t\tonAbort = () => resolve(abortReason(signal));\n\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t}),\n\t\tdispose() {\n\t\t\tif (onAbort !== void 0) signal.removeEventListener(\"abort\", onAbort);\n\t\t}\n\t};\n}\n//#endregion\nexport { createWriteStream };\n\n//# sourceMappingURL=stream.js.map","import { downloadById, downloadByName, headById, headByName } from \"./download/single.js\";\nimport { mergeUploadRetryOptions } from \"./internal/upload-retry-options.js\";\nimport { createParallelDownloadStream } from \"./download/parallel.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { rejectSmallResumeFileId, stripResumeOnlyOptions } from \"./upload/options.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { createWriteStream } from \"./upload/stream.js\";\n//#region src/object.ts\nfunction bucketDefaultRetentionSnapshot(info) {\n\tconst fileLock = info.fileLockConfiguration;\n\tif (!fileLock.isClientAuthorizedToRead) return { unreadable: true };\n\tif (fileLock.value === null) return { unreadable: false };\n\treturn {\n\t\tretention: fileLock.value.defaultRetention,\n\t\tunreadable: false\n\t};\n}\nfunction resumeNeedsFreshBucketDefaults(options) {\n\treturn (options.resume === true || options.resumeFileId !== void 0) && (options.serverSideEncryption === void 0 || options.fileRetention === void 0);\n}\n/**\n* Handle to a specific file (by name) within a B2 bucket.\n*\n* Provides file-scoped upload, download, and management operations.\n* Obtained via {@link Bucket.file}.\n*\n* @example\n* ```ts\n* const obj = bucket.file('photos/2026/sunset.jpg')\n* await obj.upload({ source: new BufferSource(data) })\n* const result = await obj.download()\n* ```\n*/\nvar B2Object = class {\n\t/** The file name (path) within the bucket. */\n\tfileName;\n\tclient;\n\tbucket;\n\tuploadRetryOptions;\n\t/**\n\t* @param client - The parent B2Client instance.\n\t* @param bucket - The parent Bucket this object belongs to.\n\t* @param fileName - The file path within the bucket.\n\t* @param uploadRetryOptions - Resolved client upload retry defaults.\n\t*\n\t* @internal\n\t*/\n\tconstructor(client, bucket, fileName, uploadRetryOptions) {\n\t\tthis.client = client;\n\t\tthis.bucket = bucket;\n\t\tthis.fileName = fileName;\n\t\tthis.uploadRetryOptions = uploadRetryOptions;\n\t}\n\t/**\n\t* Uploads data to this file name. Automatically uses multipart upload for large files.\n\t* @param options - Upload configuration including data source and optional settings.\n\t*\n\t* @returns Metadata for the uploaded file version.\n\t*/\n\tasync upload(options) {\n\t\tconst recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n\t\tconst isLarge = options.source.size > recommendedPartSize;\n\t\tconst uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options.retry);\n\t\tif (isLarge) {\n\t\t\tconst bucketInfo = resumeNeedsFreshBucketDefaults(options) ? await this.fetchFreshBucketInfo() : this.bucket.info;\n\t\t\tconst bucketDefaultRetention = bucketDefaultRetentionSnapshot(bucketInfo);\n\t\t\treturn uploadLargeFile(this.client.raw, this.client.accountInfo, {\n\t\t\t\t...options,\n\t\t\t\tbucketId: this.bucket.id,\n\t\t\t\tfileName: this.fileName,\n\t\t\t\tretry: uploadRetryOptions,\n\t\t\t\tbucketDefaultServerSideEncryption: bucketInfo.defaultServerSideEncryption,\n\t\t\t\t...bucketDefaultRetention.retention !== void 0 ? { bucketDefaultRetention: bucketDefaultRetention.retention } : {},\n\t\t\t\t...bucketDefaultRetention.unreadable ? { bucketDefaultRetentionUnreadable: true } : {}\n\t\t\t});\n\t\t}\n\t\trejectSmallResumeFileId(options, \"B2Object.upload\");\n\t\tconst smallOptions = stripResumeOnlyOptions(options);\n\t\treturn uploadSmallFile(this.client.raw, this.client.accountInfo, {\n\t\t\t...smallOptions,\n\t\t\tbucketId: this.bucket.id,\n\t\t\tfileName: this.fileName,\n\t\t\tretry: uploadRetryOptions\n\t\t});\n\t}\n\tasync fetchFreshBucketInfo() {\n\t\tconst found = (await this.client.listBuckets({ bucketId: this.bucket.id }))[0];\n\t\tif (!found) throw new Error(`Bucket ${this.bucket.id} not found`);\n\t\treturn found.info;\n\t}\n\t/**\n\t* Downloads this file by name. Pass `method: 'HEAD'` to fetch only the\n\t* response headers (file metadata) without streaming the body.\n\t* @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n\t*\n\t* @returns The download result with response headers and body stream.\n\t*/\n\tasync download(options) {\n\t\treturn downloadByName(this.client.raw, this.client.accountInfo, {\n\t\t\tbucketName: this.bucket.name,\n\t\t\tfileName: this.fileName,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Fetches response headers for this file via HTTP HEAD. Returns a\n\t* body-less result so callers never have to drain the (logically\n\t* empty) HEAD body themselves.\n\t*\n\t* @param options - Optional range, SSE-C decryption, response-header\n\t* overrides, and abort signal. Same shape as {@link B2Object.download}'s\n\t* options minus `method` (always HEAD) and `onProgress` (no body).\n\t*\n\t* @returns Parsed download headers (content type, SHA-1, file info, etc.).\n\t*/\n\tasync head(options) {\n\t\treturn headByName(this.client.raw, this.client.accountInfo, {\n\t\t\tbucketName: this.bucket.name,\n\t\t\tfileName: this.fileName,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Downloads a specific version of this file by ID. Pass `method: 'HEAD'`\n\t* to fetch only the response headers (file metadata) without streaming the body.\n\t* @param fileId - The file version ID to download.\n\t* @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n\t*\n\t* @returns The download result with response headers and body stream.\n\t*/\n\tasync downloadById(fileId, options) {\n\t\treturn downloadById(this.client.raw, this.client.accountInfo, {\n\t\t\tfileId,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Fetches response headers for a specific version of this file by ID\n\t* via HTTP HEAD. Returns a body-less result so callers never have to\n\t* drain the (logically empty) HEAD body themselves.\n\t*\n\t* @param fileId - The file version ID to inspect.\n\t* @param options - Optional range, SSE-C decryption, response-header\n\t* overrides, and abort signal.\n\t*\n\t* @returns Parsed download headers.\n\t*/\n\tasync headById(fileId, options) {\n\t\treturn headById(this.client.raw, this.client.accountInfo, {\n\t\t\tfileId,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Creates a parallel-download ReadableStream that fetches the file in concurrent ranged chunks.\n\t* @param fileId - The file version ID to download.\n\t* @param totalSize - Total file size in bytes (needed to compute range boundaries).\n\t* @param options - Concurrency, range size, and abort signal.\n\t*\n\t* @returns A Web ReadableStream of file data in sequential order.\n\t*/\n\tcreateReadStream(fileId, totalSize, options) {\n\t\treturn createParallelDownloadStream(this.client.raw, this.client.accountInfo, {\n\t\t\tfileId,\n\t\t\ttotalSize,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Creates a Web `WritableStream` that uploads streamed data into this file\n\t* using the multipart protocol. Pipe a `ReadableStream` into the\n\t* returned `writable` and await `done` to get the final {@link FileVersion}.\n\t*\n\t* Note: streaming uploads do not support resume because the size and per-part\n\t* hashes are not known in advance. Use {@link upload} with a buffered source\n\t* when resume is required.\n\t*\n\t* @param options - Streaming upload parameters (part size, concurrency, encryption).\n\t*\n\t* @returns A handle with the writable sink and a completion promise.\n\t*/\n\tcreateWriteStream(options) {\n\t\tconst uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options?.retry);\n\t\treturn createWriteStream(this.client.raw, this.client.accountInfo, {\n\t\t\t...options ?? {},\n\t\t\tbucketId: this.bucket.id,\n\t\t\tfileName: this.fileName,\n\t\t\tretry: uploadRetryOptions\n\t\t});\n\t}\n\t/**\n\t* Retrieves metadata for a specific file version.\n\t* @param fileId - The file version ID to look up.\n\t*\n\t* @returns The file version metadata.\n\t*/\n\tasync getFileInfo(fileId) {\n\t\treturn this.client.raw.getFileInfo(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { fileId });\n\t}\n\t/**\n\t* Hides this file by creating a hide marker at this file name.\n\t*\n\t* @returns Metadata for the newly created hide marker.\n\t*/\n\tasync hide() {\n\t\treturn this.bucket.hideFile(this.fileName);\n\t}\n\t/**\n\t* Permanently deletes a specific version of this file.\n\t* @param fileId - The unique identifier of the file version to delete.\n\t*/\n\tasync deleteVersion(fileId) {\n\t\tawait this.bucket.deleteFileVersion(this.fileName, fileId);\n\t}\n\t/**\n\t* Sets or updates the Object Lock retention policy on a specific file\n\t* version of this file.\n\t*\n\t* The bucket must have Object Lock enabled (`fileLockEnabled: true` at\n\t* creation time). Governance-mode retention can be shortened or removed\n\t* by passing `bypassGovernance: true` together with an application key\n\t* that carries the `bypassGovernance` capability; compliance-mode\n\t* retention cannot be shortened by anyone until the\n\t* `retainUntilTimestamp` elapses.\n\t*\n\t* @param fileId - The file version to apply the policy to.\n\t* @param retention - The retention policy to apply.\n\t* @param options - Optional flag for shortening governance-mode retention.\n\t*\n\t* @returns Metadata for the updated file version.\n\t*/\n\tasync setRetention(fileId, retention, options) {\n\t\treturn this.bucket.updateFileRetention(this.fileName, fileId, retention, options);\n\t}\n\t/**\n\t* Toggles the legal hold flag on a specific file version of this file.\n\t*\n\t* Legal hold is independent of retention: a file can be on legal hold\n\t* without any retention policy, and vice versa. The bucket must have\n\t* Object Lock enabled, and any caller must hold the `writeFileLegalHolds`\n\t* capability.\n\t*\n\t* @param fileId - The file version to apply the flag to.\n\t* @param legalHold - `'on'` to apply the hold, `'off'` to remove it.\n\t*\n\t* @returns Metadata for the updated file version.\n\t*/\n\tasync setLegalHold(fileId, legalHold) {\n\t\treturn this.bucket.updateFileLegalHold(this.fileName, fileId, legalHold);\n\t}\n};\n//#endregion\nexport { B2Object };\n\n//# sourceMappingURL=object.js.map","import { accountId } from \"./types/ids.js\";\nimport { Semaphore } from \"./upload/concurrency.js\";\nimport \"./util/defaults.js\";\nimport { copyLargeFile } from \"./copy/large.js\";\nimport { downloadByName, headByName } from \"./download/single.js\";\nimport { mergeUploadRetryOptions } from \"./internal/upload-retry-options.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { rejectSmallResumeFileId, stripResumeOnlyOptions } from \"./upload/options.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { toError } from \"./util/to-error.js\";\nimport { B2Object } from \"./object.js\";\nimport { paginateItems } from \"./util/paginator.js\";\n//#region src/bucket.ts\nfunction bucketDefaultRetentionSnapshot(info) {\n\tconst fileLock = info.fileLockConfiguration;\n\tif (!fileLock.isClientAuthorizedToRead) return { unreadable: true };\n\tif (fileLock.value === null) return { unreadable: false };\n\treturn {\n\t\tretention: fileLock.value.defaultRetention,\n\t\tunreadable: false\n\t};\n}\nfunction resumeNeedsFreshBucketDefaults(options) {\n\treturn (options.resume === true || options.resumeFileId !== void 0) && (options.serverSideEncryption === void 0 || options.fileRetention === void 0);\n}\n/**\n* Handle to a B2 bucket providing upload, download, listing, and management operations.\n*\n* Obtained via {@link B2Client.createBucket}, {@link B2Client.listBuckets}, or {@link B2Client.getBucket}.\n*\n* @example\n* ```ts\n* const bucket = await client.getBucket('my-bucket')\n* await bucket.upload({ fileName: 'hello.txt', source: new BufferSource(data) })\n* ```\n*/\nvar Bucket = class {\n\t/** Unique identifier for this bucket. */\n\tid;\n\t/** Human-readable bucket name. */\n\tname;\n\t/** Full bucket metadata as returned by the B2 API. */\n\tinfo;\n\tclient;\n\tuploadRetryOptions;\n\t/**\n\t* @param client - The parent B2Client instance.\n\t* @param info - The bucket metadata from the API.\n\t* @param uploadRetryOptions - Resolved client upload retry defaults.\n\t*\n\t* @internal\n\t*/\n\tconstructor(client, info, uploadRetryOptions) {\n\t\tthis.client = client;\n\t\tthis.info = info;\n\t\tthis.id = info.bucketId;\n\t\tthis.name = info.bucketName;\n\t\tthis.uploadRetryOptions = uploadRetryOptions;\n\t}\n\t/**\n\t* Returns a {@link B2Object} handle for a specific file name in this bucket.\n\t* @param fileName - The file path within the bucket.\n\t*\n\t* @returns A B2Object handle bound to this bucket and file name.\n\t*/\n\tfile(fileName) {\n\t\treturn new B2Object(this.client, this, fileName, this.uploadRetryOptions);\n\t}\n\t/**\n\t* Uploads a file to this bucket. Automatically uses multipart upload for files\n\t* larger than the recommended part size.\n\t* @param options - Upload configuration including file name, source data, and optional settings.\n\t*\n\t* @returns Metadata for the uploaded file version.\n\t*/\n\tasync upload(options) {\n\t\tconst recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n\t\tconst isLarge = options.source.size > recommendedPartSize;\n\t\tconst uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options.retry);\n\t\tif (isLarge) {\n\t\t\tconst bucketInfo = resumeNeedsFreshBucketDefaults(options) ? await this.refresh() : this.info;\n\t\t\tconst bucketDefaultRetention = bucketDefaultRetentionSnapshot(bucketInfo);\n\t\t\treturn uploadLargeFile(this.client.raw, this.client.accountInfo, {\n\t\t\t\t...options,\n\t\t\t\tbucketId: this.id,\n\t\t\t\tretry: uploadRetryOptions,\n\t\t\t\tbucketDefaultServerSideEncryption: bucketInfo.defaultServerSideEncryption,\n\t\t\t\t...bucketDefaultRetention.retention !== void 0 ? { bucketDefaultRetention: bucketDefaultRetention.retention } : {},\n\t\t\t\t...bucketDefaultRetention.unreadable ? { bucketDefaultRetentionUnreadable: true } : {}\n\t\t\t});\n\t\t}\n\t\trejectSmallResumeFileId(options, \"Bucket.upload\");\n\t\tconst smallOptions = stripResumeOnlyOptions(options);\n\t\treturn uploadSmallFile(this.client.raw, this.client.accountInfo, {\n\t\t\t...smallOptions,\n\t\t\tbucketId: this.id,\n\t\t\tretry: uploadRetryOptions\n\t\t});\n\t}\n\t/**\n\t* Downloads a file from this bucket by name. Pass `method: 'HEAD'` in\n\t* `options` to fetch only the response headers (file metadata) without\n\t* streaming the body.\n\t* @param fileName - The file name (path) to download.\n\t* @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n\t*\n\t* @returns The download result containing response headers and a readable body stream.\n\t*/\n\tasync download(fileName, options) {\n\t\treturn downloadByName(this.client.raw, this.client.accountInfo, {\n\t\t\tbucketName: this.name,\n\t\t\tfileName,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Fetches the response headers (file metadata) for a file via HTTP\n\t* HEAD. Returns a body-less result so callers never have to drain\n\t* the (logically empty) HEAD body themselves.\n\t*\n\t* Use this for metadata-only checks like \"does this file exist\", \"what\n\t* is its current SHA-1\", \"what is its Content-Length\". For full file\n\t* retrieval use {@link Bucket.download}.\n\t*\n\t* @param fileName - The file name (path) to inspect.\n\t* @param options - Optional range, SSE-C decryption, response-header\n\t* overrides, and abort signal. Same shape as {@link Bucket.download}'s\n\t* options minus `method` (always HEAD) and `onProgress` (no body).\n\t*\n\t* @returns Parsed download headers (content type, SHA-1, file info, etc.).\n\t*\n\t* @example\n\t* ```ts\n\t* const { headers } = await bucket.head('photos/2026/sunset.jpg')\n\t* console.log(headers.contentLength, headers.contentSha1)\n\t* ```\n\t*/\n\tasync head(fileName, options) {\n\t\treturn headByName(this.client.raw, this.client.accountInfo, {\n\t\t\tbucketName: this.name,\n\t\t\tfileName,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Lists file names in this bucket (most recent versions only).\n\t* @param options - Optional filtering and pagination settings.\n\t*\n\t* @returns A page of file versions with an optional continuation token.\n\t*/\n\tasync listFileNames(options) {\n\t\treturn this.client.raw.listFileNames(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\t...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n\t\t\t...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n\t\t\t...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n\t\t\t...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n\t\t}, { ...options?.signal !== void 0 ? { signal: options.signal } : {} });\n\t}\n\t/**\n\t* Lists all file versions in this bucket, including hidden files.\n\t* @param options - Optional filtering and pagination settings.\n\t*\n\t* @returns A page of file versions with an optional continuation token.\n\t*/\n\tasync listFileVersions(options) {\n\t\treturn this.client.raw.listFileVersions(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\t...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n\t\t\t...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n\t\t\t...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n\t\t\t...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n\t\t\t...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n\t\t}, { ...options?.signal !== void 0 ? { signal: options.signal } : {} });\n\t}\n\t/**\n\t* Async iterator that yields the latest visible version of every file in\n\t* the bucket, automatically handling pagination via `listFileNames`.\n\t*\n\t* Hidden files (those whose latest version is a hide marker) are NOT\n\t* yielded by this iterator. Use {@link paginateFileVersions} when you\n\t* need full version history.\n\t*\n\t* @param options - Filter + pagination + abort options. `pageSize` is\n\t* forwarded to `b2_list_file_names`'s `maxFileCount` (default 1000,\n\t* B2-capped at 10000).\n\t*\n\t* @returns An async iterable of {@link FileVersion} entries.\n\t*\n\t* @example\n\t* ```ts\n\t* for await (const file of bucket.paginateFileNames({ prefix: 'photos/' })) {\n\t* console.log(file.fileName, file.contentLength)\n\t* }\n\t* ```\n\t*/\n\tpaginateFileNames(options) {\n\t\treturn paginateItems(async (cursor) => {\n\t\t\tconst resp = await this.listFileNames({\n\t\t\t\tpageSize: options?.pageSize ?? 1e3,\n\t\t\t\t...cursor !== void 0 ? { startFileName: cursor } : {},\n\t\t\t\t...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n\t\t\t\t...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {},\n\t\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tpage: resp,\n\t\t\t\tnextCursor: resp.nextFileName ?? void 0\n\t\t\t};\n\t\t}, (page) => page.files.filter((f) => f.action !== \"hide\"), options?.signal);\n\t}\n\t/**\n\t* Async iterator that yields every version of every file in the bucket,\n\t* including hidden files and historical versions, automatically handling\n\t* pagination via `listFileVersions`.\n\t*\n\t* The two-cursor `(nextFileName, nextFileId)` continuation that the raw\n\t* endpoint exposes is threaded internally; callers iterate flat.\n\t*\n\t* @param options - Filter + pagination + abort options.\n\t*\n\t* @returns An async iterable of {@link FileVersion} entries.\n\t*/\n\tpaginateFileVersions(options) {\n\t\treturn paginateItems(async (cursor) => {\n\t\t\tconst resp = await this.listFileVersions({\n\t\t\t\tpageSize: options?.pageSize ?? 1e3,\n\t\t\t\t...cursor !== void 0 ? { startFileName: cursor.fileName } : {},\n\t\t\t\t...cursor?.fileId !== void 0 ? { startFileId: cursor.fileId } : {},\n\t\t\t\t...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n\t\t\t\t...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {},\n\t\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tpage: resp,\n\t\t\t\tnextCursor: resp.nextFileName !== null ? {\n\t\t\t\t\tfileName: resp.nextFileName,\n\t\t\t\t\tfileId: resp.nextFileId ?? void 0\n\t\t\t\t} : void 0\n\t\t\t};\n\t\t}, (page) => page.files, options?.signal);\n\t}\n\t/**\n\t* Async iterator that yields every unfinished large file in the bucket,\n\t* automatically handling pagination via `listUnfinishedLargeFiles`.\n\t*\n\t* Useful for janitorial scripts that want to inspect or cancel abandoned\n\t* multipart uploads (typically followed by {@link cancelLargeFile} on\n\t* the underlying raw client).\n\t*\n\t* @param options - Filter + pagination + abort options. `pageSize` is\n\t* B2-capped at 100 for this endpoint.\n\t*\n\t* @returns An async iterable of unfinished-large-file metadata entries.\n\t*/\n\tpaginateUnfinishedLargeFiles(options) {\n\t\treturn paginateItems(async (cursor) => {\n\t\t\tconst resp = await this.listUnfinishedLargeFiles({\n\t\t\t\tpageSize: options?.pageSize ?? 100,\n\t\t\t\t...cursor !== void 0 ? { startFileId: cursor } : {},\n\t\t\t\t...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},\n\t\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tpage: resp,\n\t\t\t\tnextCursor: resp.nextFileId ?? void 0\n\t\t\t};\n\t\t}, (page) => page.files, options?.signal);\n\t}\n\t/**\n\t* Async iterator that yields every uploaded part for a specific large\n\t* file, automatically handling pagination via `listParts`.\n\t*\n\t* @param largeFileId - The unfinished large file to enumerate parts of.\n\t* @param options - Pagination + abort options. `pageSize` is B2-capped\n\t* at 1000 for this endpoint; the default is 1000.\n\t*\n\t* @returns An async iterable of {@link PartInfo} entries.\n\t*/\n\tpaginateParts(largeFileId, options) {\n\t\treturn paginateItems(async (cursor) => {\n\t\t\tconst resp = await this.client.raw.listParts(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\t\tfileId: largeFileId,\n\t\t\t\tmaxPartCount: options?.pageSize ?? 1e3,\n\t\t\t\t...cursor !== void 0 ? { startPartNumber: cursor } : {}\n\t\t\t}, options?.signal !== void 0 ? { signal: options.signal } : void 0);\n\t\t\treturn {\n\t\t\t\tpage: resp,\n\t\t\t\tnextCursor: resp.nextPartNumber ?? void 0\n\t\t\t};\n\t\t}, (page) => page.parts, options?.signal);\n\t}\n\t/**\n\t* Looks up the latest visible version of a file by name.\n\t* Uses `listFileNames` under the hood; returns `null` when the file does not\n\t* exist or its latest version is a hide marker.\n\t* @param fileName - The exact file path to look up.\n\t*\n\t* @returns The latest {@link FileVersion}, or `null` if not found.\n\t*/\n\tasync getFileInfoByName(fileName) {\n\t\tconst match = (await this.listFileNames({\n\t\t\tprefix: fileName,\n\t\t\tpageSize: 1\n\t\t})).files.find((f) => f.fileName === fileName);\n\t\tif (!match || match.action === \"hide\") return null;\n\t\treturn match;\n\t}\n\t/**\n\t* Removes the latest hide marker for a file, restoring visibility of the\n\t* previous upload. Returns the deleted hide marker, or `null` if there was\n\t* no hide marker to remove (file is already visible or does not exist).\n\t* @param fileName - The file path to unhide.\n\t*\n\t* @returns The deleted hide marker version, or `null` if nothing was hidden.\n\t*/\n\tasync unhideFile(fileName) {\n\t\tconst versions = (await this.listFileVersions({\n\t\t\tprefix: fileName,\n\t\t\tpageSize: 100\n\t\t})).files.filter((f) => f.fileName === fileName);\n\t\tif (versions.length === 0) return null;\n\t\tconst latest = versions[0];\n\t\tif (latest?.action !== \"hide\") return null;\n\t\tawait this.deleteFileVersion(fileName, latest.fileId);\n\t\treturn latest;\n\t}\n\t/**\n\t* Hides a file by creating a hide marker. The file remains in version history but is no longer visible in `listFileNames`.\n\t* @param fileName - The file path to hide.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns Metadata for the newly created hide marker.\n\t*/\n\tasync hideFile(fileName, options) {\n\t\treturn this.client.raw.hideFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\tfileName\n\t\t}, options);\n\t}\n\t/**\n\t* Permanently deletes a specific file version. Both file name and file ID are required.\n\t*\n\t* If the file is under Object Lock retention, B2 will reject the\n\t* delete: compliance-mode files cannot be deleted until the retention\n\t* expires; governance-mode files require `bypassGovernance: true`\n\t* AND a calling key with the `bypassGovernance` capability. Files on\n\t* legal hold cannot be deleted by anyone until the hold is removed.\n\t*\n\t* @param fileName - The file path of the version to delete.\n\t* @param fileId - The unique identifier of the file version to delete.\n\t* @param options - Optional governance and abort controls.\n\t*/\n\tasync deleteFileVersion(fileName, fileId, options) {\n\t\tawait this.client.raw.deleteFileVersion(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tfileName,\n\t\t\tfileId,\n\t\t\t...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n\t\t}, options?.signal !== void 0 ? { signal: options.signal } : void 0);\n\t}\n\t/**\n\t* Cancels an in-progress large file upload so the partial parts are not\n\t* retained or billed. The most common reason to call this is to clean up\n\t* abandoned multipart uploads surfaced by {@link listUnfinishedLargeFiles}.\n\t* @param fileId - The unique identifier of the unfinished large file to cancel.\n\t*\n\t* @returns Metadata about the cancelled large file.\n\t*/\n\tasync cancelLargeFile(fileId) {\n\t\treturn this.client.raw.cancelLargeFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { fileId });\n\t}\n\t/**\n\t* Lists large files in this bucket that were started but never finished or\n\t* cancelled. Wraps `b2_list_unfinished_large_files`.\n\t* @param options - Optional pagination filters.\n\t*\n\t* @returns The page of unfinished large files plus a continuation token.\n\t*/\n\tasync listUnfinishedLargeFiles(options) {\n\t\treturn this.client.raw.listUnfinishedLargeFiles(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\t...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},\n\t\t\t...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n\t\t\t...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}\n\t\t}, options?.signal !== void 0 ? { signal: options.signal } : void 0);\n\t}\n\t/**\n\t* Deletes many file versions with bounded concurrency. Errors from individual\n\t* deletes are collected and returned rather than thrown, so partial success\n\t* does not abort the run.\n\t*\n\t* When `options.signal` is supplied and aborted, in-flight deletes\n\t* complete (they're already on the wire), but no new deletes start\n\t* after the abort fires. Subsequent targets are short-circuited to an\n\t* error entry so the result tally reflects what actually happened.\n\t* @param targets - File versions to delete.\n\t* @param options - Optional concurrency override and abort signal.\n\t* Concurrency defaults to the SDK-wide bulk-metadata setting\n\t* (currently 10, higher than transfer concurrency because each\n\t* task is a single tiny API round-trip).\n\t*\n\t* @returns A summary of successes and per-target errors.\n\t*/\n\tasync deleteMany(targets, options) {\n\t\tconst sem = new Semaphore(options?.concurrency ?? 10);\n\t\tconst signal = options?.signal;\n\t\tlet deleted = 0;\n\t\tconst errors = [];\n\t\tawait Promise.all(targets.map(async (target) => {\n\t\t\tawait sem.acquire();\n\t\t\ttry {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\ttarget,\n\t\t\t\t\t\terror: toError(signal.reason ?? \"aborted\")\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tawait this.deleteFileVersion(target.fileName, target.fileId);\n\t\t\t\tdeleted++;\n\t\t\t} catch (err) {\n\t\t\t\terrors.push({\n\t\t\t\t\ttarget,\n\t\t\t\t\terror: toError(err)\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tsem.release();\n\t\t\t}\n\t\t}));\n\t\treturn {\n\t\t\tdeleted,\n\t\t\terrors\n\t\t};\n\t}\n\t/**\n\t* Async generator that streams every file version in the bucket (optionally\n\t* filtered by prefix) and deletes each one. Yields a {@link DeleteAllEvent}\n\t* per file version. With `dryRun: true`, no deletes are performed but `skip`\n\t* events are still emitted.\n\t* @param options - Optional prefix filter, page size, and dry-run flag.\n\t*\n\t* @returns An async generator of per-file events.\n\t*/\n\tasync *deleteAll(options) {\n\t\tconst dryRun = options?.dryRun ?? false;\n\t\tconst pageSize = options?.pageSize ?? 1e3;\n\t\tlet startFileName;\n\t\tlet startFileId;\n\t\twhile (true) {\n\t\t\tconst page = await this.listFileVersions({\n\t\t\t\tpageSize,\n\t\t\t\t...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n\t\t\t\t...startFileName !== void 0 ? { startFileName } : {},\n\t\t\t\t...startFileId !== void 0 ? { startFileId } : {}\n\t\t\t});\n\t\t\tfor (const version of page.files) {\n\t\t\t\tif (dryRun) {\n\t\t\t\t\tyield {\n\t\t\t\t\t\ttype: \"skip\",\n\t\t\t\t\t\tfileName: version.fileName,\n\t\t\t\t\t\tfileId: version.fileId\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tawait this.deleteFileVersion(version.fileName, version.fileId);\n\t\t\t\t\tyield {\n\t\t\t\t\t\ttype: \"delete\",\n\t\t\t\t\t\tfileName: version.fileName,\n\t\t\t\t\t\tfileId: version.fileId\n\t\t\t\t\t};\n\t\t\t\t} catch (err) {\n\t\t\t\t\tyield {\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\tfileName: version.fileName,\n\t\t\t\t\t\tfileId: version.fileId,\n\t\t\t\t\t\tmessage: toError(err).message\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!page.nextFileName) break;\n\t\t\tstartFileName = page.nextFileName;\n\t\t\tstartFileId = page.nextFileId ?? void 0;\n\t\t}\n\t}\n\t/**\n\t* Creates a server-side copy of a file within or across buckets.\n\t* @param options - Copy configuration including source file ID and destination name.\n\t*\n\t* @returns Metadata for the newly created file version.\n\t*/\n\tasync copyFile(options) {\n\t\tconst { serverSideEncryption, destinationServerSideEncryption, signal, ...copyOptions } = options;\n\t\tconst destinationEncryption = destinationServerSideEncryption ?? serverSideEncryption;\n\t\treturn this.client.raw.copyFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\t...copyOptions,\n\t\t\t...destinationEncryption !== void 0 ? { destinationServerSideEncryption: destinationEncryption } : {}\n\t\t}, signal !== void 0 ? { signal } : void 0);\n\t}\n\t/**\n\t* Copies a file via the server-side multipart protocol. Each part is copied\n\t* by reference through `b2_copy_part`; data never traverses the client. Falls\n\t* back to a single `copyFile` call when the source fits within a single part.\n\t* @param options - Copy parameters including source file ID, destination name, part size, and concurrency.\n\t*\n\t* @returns Metadata for the newly created destination file version.\n\t*/\n\tasync copyLargeFile(options) {\n\t\treturn copyLargeFile(this.client.raw, this.client.accountInfo, {\n\t\t\tsourceFileId: options.sourceFileId,\n\t\t\tfileName: options.fileName,\n\t\t\t...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : { destinationBucketId: this.id },\n\t\t\t...options.contentType !== void 0 ? { contentType: options.contentType } : {},\n\t\t\t...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n\t\t\t...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n\t\t\t...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n\t\t\t...options.partSize !== void 0 ? { partSize: options.partSize } : {},\n\t\t\t...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {},\n\t\t\t...options.onCleanupFailure !== void 0 ? { onCleanupFailure: options.onCleanupFailure } : {},\n\t\t\t...options.signal !== void 0 ? { signal: options.signal } : {}\n\t\t});\n\t}\n\t/**\n\t* Updates bucket settings such as type, CORS, lifecycle rules, and encryption.\n\t* @param options - Fields to update. Omitted fields are left unchanged.\n\t*\n\t* @returns Updated bucket metadata.\n\t*/\n\tasync update(options) {\n\t\treturn this.client.raw.updateBucket(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\taccountId: accountId(this.client.accountInfo.getAccountId()),\n\t\t\tbucketId: this.id,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Permanently deletes this bucket. The bucket must be empty (no file versions).\n\t*\n\t* @returns The deleted bucket metadata.\n\t*/\n\tasync delete() {\n\t\treturn this.client.deleteBucket(this.id);\n\t}\n\t/**\n\t* Gets a download authorization token scoped to a file name prefix in this bucket.\n\t* @param fileNamePrefix - Only authorize downloads of files starting with this prefix.\n\t* @param validDurationInSeconds - How long the authorization is valid (1-604800 seconds).\n\t*\n\t* @returns The download authorization response containing a time-limited token.\n\t*/\n\tasync getDownloadAuthorization(fileNamePrefix, validDurationInSeconds) {\n\t\treturn this.client.raw.getDownloadAuthorization(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\tfileNamePrefix,\n\t\t\tvalidDurationInSeconds\n\t\t});\n\t}\n\t/**\n\t* Gets the event notification rules configured for this bucket.\n\t*\n\t* @returns The current notification rules for this bucket.\n\t*/\n\tasync getNotificationRules() {\n\t\treturn this.client.raw.getBucketNotificationRules(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { bucketId: this.id });\n\t}\n\t/**\n\t* Replaces the event notification rules for this bucket.\n\t* @param rules - The new set of notification rules to apply.\n\t*\n\t* @returns The updated notification rules for this bucket.\n\t*/\n\tasync setNotificationRules(rules) {\n\t\treturn this.client.raw.setBucketNotificationRules(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\teventNotificationRules: rules\n\t\t});\n\t}\n\t/**\n\t* Updates the file retention policy for a specific file version. Requires file lock on the bucket.\n\t* @param fileName - The file path of the version to update.\n\t* @param fileId - The unique identifier of the file version.\n\t* @param retention - The new retention policy to apply.\n\t* @param options - Optional flags. Set `bypassGovernance: true` to shorten governance-mode retention.\n\t*\n\t* @returns The updated file retention metadata.\n\t*/\n\tasync updateFileRetention(fileName, fileId, retention, options) {\n\t\treturn this.client.raw.updateFileRetention(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tfileName,\n\t\t\tfileId,\n\t\t\tfileRetention: retention,\n\t\t\t...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n\t\t});\n\t}\n\t/**\n\t* Updates the legal hold status for a specific file version. Requires file lock on the bucket.\n\t* @param fileName - The file path of the version to update.\n\t* @param fileId - The unique identifier of the file version.\n\t* @param legalHold - The new legal hold status to apply.\n\t*\n\t* @returns The updated legal hold metadata.\n\t*/\n\tasync updateFileLegalHold(fileName, fileId, legalHold) {\n\t\treturn this.client.raw.updateFileLegalHold(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tfileName,\n\t\t\tfileId,\n\t\t\tlegalHold\n\t\t});\n\t}\n\t/**\n\t* Refetches this bucket's metadata from B2 so callers operating on\n\t* replication / lifecycle / retention configuration always start from the\n\t* server-of-record state.\n\t*\n\t* Bucket configuration is monotonically revisioned by B2: B2 increments\n\t* `revision` on every accepted update. The local {@link info} snapshot\n\t* captured at construction time goes stale as soon as anyone else (or any\n\t* prior `update()` call) mutates the bucket, so the ergonomic\n\t* add/remove helpers below always refresh before composing the next\n\t* `setX()` call. The result is that each helper is safe to call without\n\t* the caller having to thread BucketInfo through their code.\n\t*\n\t* @returns Fresh {@link BucketInfo} for this bucket.\n\t*\n\t* @throws If the bucket no longer exists.\n\t*/\n\tasync refresh() {\n\t\tconst found = (await this.client.listBuckets({ bucketId: this.id }))[0];\n\t\tif (!found) throw new Error(`Bucket ${this.id} not found`);\n\t\treturn found.info;\n\t}\n\t/**\n\t* Returns the current cross-region replication configuration, refetched\n\t* from B2.\n\t*\n\t* Use this when you need to read replication state without composing a\n\t* write. For add/remove flows the helper methods below handle the\n\t* refresh-then-set sequence for you.\n\t*\n\t* @returns The current {@link ReplicationConfiguration}.\n\t*/\n\tasync getReplication() {\n\t\treturn (await this.refresh()).replicationConfiguration;\n\t}\n\t/**\n\t* Replaces this bucket's complete replication configuration.\n\t* @param replication - The new configuration. Pass an empty source/destination\n\t* pair (`{ asReplicationSource: null, asReplicationDestination: null }`)\n\t* to clear replication entirely.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync setReplication(replication) {\n\t\treturn this.update({ replicationConfiguration: replication });\n\t}\n\t/**\n\t* Adds (or replaces by `replicationRuleName`) a single replication rule\n\t* on this bucket while leaving any other rules, the source key, and the\n\t* destination key mapping untouched.\n\t*\n\t* When this is the very first source-side rule, `sourceApplicationKeyId`\n\t* must be supplied to seed `asReplicationSource.sourceApplicationKeyId`;\n\t* for subsequent calls the existing source key is reused unless the\n\t* caller explicitly overrides it.\n\t*\n\t* @param rule - The replication rule to add or replace.\n\t* @param options - Optional source application key ID override (or seed\n\t* when no source side exists yet).\n\t*\n\t* @returns The updated bucket metadata.\n\t*\n\t* @throws If no source-side replication exists yet and the caller did\n\t* not supply `sourceApplicationKeyId`.\n\t*/\n\tasync addReplicationRule(rule, options) {\n\t\tconst current = (await this.refresh()).replicationConfiguration;\n\t\tconst existingSource = current.asReplicationSource;\n\t\tconst sourceKey = options?.sourceApplicationKeyId ?? existingSource?.sourceApplicationKeyId;\n\t\tif (!sourceKey) throw new Error(\"addReplicationRule: no existing source-side replication; pass options.sourceApplicationKeyId\");\n\t\tconst without = (existingSource?.replicationRules ?? []).filter((r) => r.replicationRuleName !== rule.replicationRuleName);\n\t\treturn this.setReplication({\n\t\t\tasReplicationSource: {\n\t\t\t\tsourceApplicationKeyId: sourceKey,\n\t\t\t\treplicationRules: [...without, rule]\n\t\t\t},\n\t\t\tasReplicationDestination: current.asReplicationDestination\n\t\t});\n\t}\n\t/**\n\t* Removes a single replication rule by name. No-ops cleanly when the rule\n\t* is not present (returns the unchanged-but-revision-bumped bucket info).\n\t*\n\t* @param replicationRuleName - Name of the rule to remove.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync removeReplicationRule(replicationRuleName) {\n\t\tconst current = (await this.refresh()).replicationConfiguration;\n\t\tconst existingSource = current.asReplicationSource;\n\t\tif (!existingSource) return this.setReplication(current);\n\t\tconst filtered = existingSource.replicationRules.filter((r) => r.replicationRuleName !== replicationRuleName);\n\t\treturn this.setReplication({\n\t\t\tasReplicationSource: {\n\t\t\t\tsourceApplicationKeyId: existingSource.sourceApplicationKeyId,\n\t\t\t\treplicationRules: filtered\n\t\t\t},\n\t\t\tasReplicationDestination: current.asReplicationDestination\n\t\t});\n\t}\n\t/**\n\t* Returns the current lifecycle rules for this bucket, refetched from B2.\n\t*\n\t* @returns The current array of {@link LifecycleRule}s.\n\t*/\n\tasync getLifecycleRules() {\n\t\treturn (await this.refresh()).lifecycleRules;\n\t}\n\t/**\n\t* Replaces this bucket's lifecycle rules in their entirety.\n\t* @param rules - The new rule set. Pass `[]` to remove all lifecycle\n\t* automation.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync setLifecycleRules(rules) {\n\t\treturn this.update({ lifecycleRules: [...rules] });\n\t}\n\t/**\n\t* Adds (or replaces, matched by `fileNamePrefix`) a single lifecycle rule\n\t* while leaving any other rules untouched.\n\t*\n\t* Matching on prefix mirrors B2's own data model: each unique prefix can\n\t* have at most one rule, and a `b2_update_bucket` call that contains two\n\t* rules with the same prefix is rejected. The helper enforces this for\n\t* the caller.\n\t*\n\t* @param rule - The lifecycle rule to add or replace.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync addLifecycleRule(rule) {\n\t\tconst without = (await this.getLifecycleRules()).filter((r) => r.fileNamePrefix !== rule.fileNamePrefix);\n\t\treturn this.setLifecycleRules([...without, rule]);\n\t}\n\t/**\n\t* Removes a single lifecycle rule by prefix. No-ops cleanly when the rule\n\t* is not present.\n\t*\n\t* @param fileNamePrefix - The prefix of the rule to remove.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync removeLifecycleRule(fileNamePrefix) {\n\t\tconst current = await this.getLifecycleRules();\n\t\treturn this.setLifecycleRules(current.filter((r) => r.fileNamePrefix !== fileNamePrefix));\n\t}\n\t/**\n\t* Returns the current default Object Lock retention policy for new\n\t* uploads to this bucket, refetched from B2.\n\t*\n\t* @returns The default {@link BucketRetentionPolicy} (which may be\n\t* `{ mode: 'none', period: null }` when Object Lock is enabled on the\n\t* bucket but no default is set).\n\t*/\n\tasync getDefaultRetention() {\n\t\treturn (await this.refresh()).defaultRetention;\n\t}\n\t/**\n\t* Sets (or clears, by passing `{ mode: 'none', period: null }`) the\n\t* default Object Lock retention policy applied to new uploads.\n\t*\n\t* Object Lock must already be enabled on the bucket. Buckets created\n\t* without `fileLockEnabled: true` cannot accept a default retention\n\t* policy and B2 will reject this call.\n\t*\n\t* @param policy - The new default retention policy.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync setDefaultRetention(policy) {\n\t\treturn this.update({ defaultRetention: policy });\n\t}\n};\n//#endregion\nexport { Bucket };\n\n//# sourceMappingURL=bucket.js.map","import { redactUrlForError } from \"../internal/url-redaction.js\";\nimport { B2RealmConfigurationError } from \"../errors/index.js\";\n//#region src/auth/realms.ts\nvar VERIFIED_REALM_URLS = {\n\t/** Public production B2 Native API authorize endpoint. */\n\tproduction: \"https://api.backblazeb2.com\",\n\t/** Backblaze staging authorize endpoint from the official Python SDK realm map. */\n\tstaging: \"https://api.backblaze.net\"\n};\n/**\n* Built-in realm aliases to their `b2_authorize_account` base API URLs.\n* The object remains a mutable `Record` for source\n* compatibility with earlier SDK versions that let applications add local\n* aliases. SDK internals validate only the built-in aliases in\n* `VERIFIED_REALM_URLS`; pass direct custom realm URLs to `B2Client` instead\n* of relying on mutation for new code.\n*/\nvar REALM_URLS = { ...VERIFIED_REALM_URLS };\nvar HTTP_REALM_URL_WITH_HOST = /^https?:\\/\\/[^/?#]/i;\nfunction parseAbsoluteRealmUrl(realmUrl) {\n\ttry {\n\t\treturn new URL(realmUrl);\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction realmUrlForError(realmUrl, url = parseAbsoluteRealmUrl(realmUrl)) {\n\treturn redactUrlForError(url ?? realmUrl, { invalidUrlLabel: \"\" });\n}\nfunction isLoopbackHost(hostname) {\n\tconst host = hostname.toLowerCase();\n\tif (host === \"[::1]\" || host === \"::1\") return true;\n\tconst parts = host.split(\".\");\n\treturn parts.length === 4 && parts[0] === \"127\" && parts.every((part) => /^\\d+$/.test(part) && Number(part) <= 255);\n}\nfunction assertAuthorizableRealmScheme(realmUrl, url) {\n\tif ((url.protocol === \"https:\" || url.protocol === \"http:\") && (!HTTP_REALM_URL_WITH_HOST.test(realmUrl) || url.hostname === \"\")) throw new B2RealmConfigurationError(`realm URL must be an absolute HTTP(S) URL with a hostname for authorization: ${realmUrlForError(realmUrl, url)}`);\n\tif (url.protocol === \"https:\") return;\n\tif (url.protocol === \"http:\" && isLoopbackHost(url.hostname)) return;\n\tif (url.protocol === \"http:\") throw new B2RealmConfigurationError(`refusing to send credentials over plaintext HTTP realm: ${realmUrlForError(realmUrl, url)}`);\n\tthrow new B2RealmConfigurationError(`realm URL must use HTTPS or loopback IP HTTP for authorization: ${realmUrlForError(realmUrl, url)}`);\n}\nfunction assertRealmBaseUrl(realmUrl, url) {\n\tif (url.username === \"\" && url.password === \"\" && url.search === \"\" && url.hash === \"\") return;\n\tthrow new B2RealmConfigurationError(`realm URL must not include credentials, query, or fragment for authorization: ${realmUrlForError(realmUrl, url)}`);\n}\n/**\n* Validate a realm URL before it is used for credential-bearing authorization.\n* Any accepted custom HTTPS host receives the application key during authorize;\n* do not derive custom realm URLs from untrusted input. Realm URLs must be base\n* URLs without userinfo, query strings, or fragments.\n*\n* @param realmUrl - The resolved realm URL to validate.\n*\n* @throws B2RealmConfigurationError when the realm URL is not absolute, is not\n* a base URL, uses an unsupported scheme, or uses non-loopback plaintext HTTP.\n* Loopback IP HTTP is accepted only for local testing and sends the application\n* key unencrypted to whichever process is listening on that address and port.\n*/\nfunction assertSecureRealmUrl(realmUrl) {\n\tconst url = parseAbsoluteRealmUrl(realmUrl);\n\tif (url === null) throw new B2RealmConfigurationError(`realm URL must be absolute for authorization: ${realmUrlForError(realmUrl, url)}`);\n\tassertRealmBaseUrl(realmUrl, url);\n\tassertAuthorizableRealmScheme(realmUrl, url);\n}\nfunction isRealmName(realm) {\n\treturn Object.hasOwn(VERIFIED_REALM_URLS, realm);\n}\n/**\n* Resolve a realm name to its base API URL. Unknown strings are returned\n* unchanged so callers can resolve custom aliases before authorization.\n*\n* @param realm - The realm name or direct URL to resolve.\n*\n* @returns The mapped base API URL for a known realm, otherwise `realm`.\n*/\nfunction getRealmUrl(realm) {\n\treturn isRealmName(realm) ? VERIFIED_REALM_URLS[realm] : realm;\n}\n//#endregion\nexport { REALM_URLS, assertSecureRealmUrl, getRealmUrl };\n\n//# sourceMappingURL=realms.js.map","import { B2SsrfError } from \"../errors/index.js\";\n//#region src/http/url-guard.ts\n/**\n* URL allow-list guard. Defends against SSRF / URL-substitution attacks where\n* a compromised or hostile B2 endpoint returns an upload URL pointing at an\n* internal service (e.g. cloud metadata at `169.254.169.254`).\n*\n* The guard is built once per `B2Client` and updated by `B2Client.authorize()`.\n* Before authorization it is permissive (so the very first\n* `b2_authorize_account` request, whose URL the user configured, can succeed).\n* After authorization it is locked to host suffixes derived from the realm's\n* apiUrl/downloadUrl/s3ApiUrl, plus the well-known B2 upload-pod parent\n* domain `backblaze.com`.\n*\n* The guard runs in `FetchTransport` before any outgoing request. It rejects:\n*\n* 1. Literal IPv4/IPv6 addresses (defense in depth, covers attempts to\n* bypass DNS-based checks with raw IPs).\n* 2. Well-known internal hostnames (`localhost`, `metadata`,\n* `metadata.google.internal`, `.internal`, `.local`).\n* 3. Hosts not matching any allowed suffix once the SDK is locked.\n*\n* Users supplying a custom `transport` to `B2Client` bypass the guard. That\n* is their responsibility to document for their threat model.\n*\n* Threat-model note: the guard checks the URL's hostname before the\n* `fetch()` call. It does NOT pin the resolved IP. A DNS rebinding attack\n* could in principle resolve a permitted hostname to an internal IP between\n* the guard's check and `fetch()`'s own resolution. This is theoretical\n* against B2 because the allow-list is locked to a small set of stable\n* Backblaze hostnames (the realm's apiUrl/downloadUrl/s3ApiUrl plus the\n* `backblaze.com` parent), and DNS rebinding requires a hostname under\n* attacker control. Defense in depth — pinning the IP from the first\n* resolution and rejecting subsequent mismatches — would break legitimate\n* CDN failovers and is not justified at this surface area. If your\n* threat model requires it, supply a custom transport that does.\n*/\n/** A URL allow-list that can be reconfigured after construction. */\nvar UrlGuard = class {\n\tallowedSuffixes = [];\n\t/**\n\t* Lock the guard to the given host suffixes. A suffix matches a host\n\t* either exactly or as a `*.suffix` subdomain. For example,\n\t* `backblazeb2.com` allows `api.backblazeb2.com` and\n\t* `s3.us-west-004.backblazeb2.com`.\n\t*\n\t* Passing an empty array disables the guard (used by the simulator and\n\t* other test setups). Production code should always lock the guard after\n\t* a successful `b2_authorize_account`.\n\t*\n\t* @param suffixes - Allowed host suffixes.\n\t*/\n\tsetAllowedSuffixes(suffixes) {\n\t\tthis.allowedSuffixes = suffixes;\n\t}\n\t/**\n\t* Returns the current allowed-suffix list (for tests and diagnostics).\n\t*\n\t* @returns The currently-configured list of allowed host suffixes.\n\t*/\n\tgetAllowedSuffixes() {\n\t\treturn this.allowedSuffixes;\n\t}\n\t/**\n\t* Validate `rawUrl` against the allow-list. Throws {@link B2SsrfError} if\n\t* the URL points at a literal IP, a known-internal hostname, or a host\n\t* outside the allowed suffixes. Permissive (no-op) when no suffixes have\n\t* been configured yet.\n\t*\n\t* @param rawUrl - The URL the caller is about to fetch.\n\t*\n\t* @throws A `B2SsrfError` when the URL is rejected.\n\t*/\n\tcheck(rawUrl) {\n\t\tif (this.allowedSuffixes.length === 0) return;\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = new URL(rawUrl);\n\t\t} catch {\n\t\t\tthrow new B2SsrfError(`malformed URL rejected by SSRF guard: ${rawUrl}`, rawUrl);\n\t\t}\n\t\tconst host = parsed.hostname.toLowerCase();\n\t\tif (isLiteralIp(host)) throw new B2SsrfError(`literal IP host not allowed by SSRF guard (use a hostname): ${host}`, rawUrl);\n\t\tif (isInternalHostname(host)) throw new B2SsrfError(`internal hostname not allowed by SSRF guard: ${host}`, rawUrl);\n\t\tif (hostMatchesAnyAllowedSuffix(host, this.allowedSuffixes)) return;\n\t\tthrow new B2SsrfError(`host outside allowed B2 realm: ${host} (allowed suffixes: ${this.allowedSuffixes.join(\", \")})`, rawUrl);\n\t}\n};\n/**\n* Extract host suffixes to allow from a B2 authorize-account response.\n*\n* Known B2 realm hosts under `backblazeb2.com` are collapsed to that parent.\n* Unknown or custom realm hosts are used as scoped suffixes: the returned\n* hostname and its subdomains are allowed, but sibling hosts and parent\n* domains are not. This avoids accidentally trusting broad public suffixes\n* such as `co.uk`.\n*\n* Always includes `backblaze.com` because upload-pod URLs returned by\n* `b2_get_upload_url` use that parent domain (`pod-NNN-NNNN-NN.backblaze.com`)\n* rather than `backblazeb2.com`.\n*\n* @param storageApi - The `apiInfo.storageApi` portion of the authorize response.\n*\n* @returns Sorted list of unique host suffixes to allow.\n*/\nfunction deriveAllowedSuffixes(storageApi) {\n\tconst suffixes = /* @__PURE__ */ new Set([\"backblaze.com\"]);\n\tfor (const url of [\n\t\tstorageApi.apiUrl,\n\t\tstorageApi.downloadUrl,\n\t\tstorageApi.s3ApiUrl\n\t]) try {\n\t\tconst host = new URL(url).hostname;\n\t\tsuffixes.add(host === \"backblazeb2.com\" || host.endsWith(\".backblazeb2.com\") ? \"backblazeb2.com\" : host);\n\t} catch {}\n\treturn Array.from(suffixes).sort();\n}\n/**\n* Checks a hostname against one allowed suffix using the SDK's exact-or-subdomain rule.\n*\n* @param hostname - URL hostname to check.\n* @param suffix - Domain suffix that may match exactly or as a parent domain.\n*\n* @returns Whether the hostname is exactly the suffix or a subdomain of it.\n*/\nfunction hostMatchesAllowedSuffix(hostname, suffix) {\n\tconst host = hostname.toLowerCase();\n\tconst lowered = suffix.toLowerCase();\n\treturn host === lowered || host.endsWith(`.${lowered}`);\n}\n/**\n* Checks a hostname against an allowed-suffix list.\n*\n* @param hostname - URL hostname to check.\n* @param suffixes - Domain suffixes to test with the SDK's suffix-matching rule.\n*\n* @returns Whether any suffix matches the hostname.\n*/\nfunction hostMatchesAnyAllowedSuffix(hostname, suffixes) {\n\treturn suffixes.some((suffix) => hostMatchesAllowedSuffix(hostname, suffix));\n}\nfunction isLiteralIp(host) {\n\tif (/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/.test(host)) return true;\n\tif (host.includes(\":\")) return true;\n\treturn false;\n}\nfunction isInternalHostname(host) {\n\tif (host === \"localhost\") return true;\n\tif (host.endsWith(\".localhost\")) return true;\n\tif (host === \"metadata\") return true;\n\tif (host === \"metadata.google.internal\") return true;\n\tif (host.endsWith(\".internal\")) return true;\n\tif (host.endsWith(\".local\")) return true;\n\treturn false;\n}\n//#endregion\nexport { UrlGuard, deriveAllowedSuffixes, hostMatchesAllowedSuffix, hostMatchesAnyAllowedSuffix };\n\n//# sourceMappingURL=url-guard.js.map","//#region \\0b2-sdk-version-json\nvar _b2_sdk_version_json_default = { \"version\": \"0.2.0\" };\n//#endregion\nexport { _b2_sdk_version_json_default as default };\n","import _b2_sdk_version_json_default from \"./_virtual/_b2-sdk-version-json.js\";\n//#region src/version.ts\n/**\n* Current SDK version. Read directly from package.json so there is no\n* second-source-of-truth to keep in sync — bumping `version` in package.json\n* automatically propagates here, into the SDK's User-Agent header, and into\n* the published artifact.\n*\n* Works in every runtime the SDK targets:\n* - Node 22.3+, Bun, Deno: native JSON import attributes.\n* - Vite builds: the JSON import is replaced with a version-only shim so\n* published runtime chunks do not carry unrelated package metadata.\n* - Vitest browser mode: Vite handles the import the same way as build.\n*/\nvar VERSION = _b2_sdk_version_json_default.version;\n//#endregion\nexport { VERSION };\n\n//# sourceMappingURL=version.js.map","import { VERSION } from \"../version.js\";\n//#region src/http/user-agent.ts\n/**\n* Stable identifier Backblaze can grep server logs for to find every request\n* issued by this SDK regardless of how the User-Agent comment evolves.\n* Treat as part of the public contract: do NOT rename without coordinating.\n*/\nvar SDK_PRODUCT = \"b2-sdk-typescript\";\n/**\n* The npm package name. Embedded in the User-Agent comment alongside\n* {@link SDK_PRODUCT} so log queries that grep on either token work.\n*/\nvar SDK_PACKAGE = \"@backblaze-labs/b2-sdk\";\n/**\n* Best-effort detection of the JS runtime and host OS. Used to populate the\n* User-Agent comment so server-side logs can spot Bun/Deno adoption and\n* triage OS-specific issues without asking for a repro environment.\n*\n* @returns The detected runtime, OS, and architecture tokens.\n*/\nfunction detectPlatform() {\n\tconst g = globalThis;\n\tif (typeof g[\"Deno\"] !== \"undefined\") {\n\t\tconst deno = g[\"Deno\"];\n\t\treturn {\n\t\t\truntime: deno.version?.deno ? `deno/${deno.version.deno}` : \"deno\",\n\t\t\tos: deno.build?.os,\n\t\t\tarch: deno.build?.arch\n\t\t};\n\t}\n\tif (typeof g[\"Bun\"] !== \"undefined\") {\n\t\tconst bun = g[\"Bun\"];\n\t\tconst proc = g[\"process\"];\n\t\treturn {\n\t\t\truntime: bun.version ? `bun/${bun.version}` : \"bun\",\n\t\t\tos: proc?.platform,\n\t\t\tarch: proc?.arch\n\t\t};\n\t}\n\tif (typeof g[\"process\"] !== \"undefined\") {\n\t\tconst proc = g[\"process\"];\n\t\tif (proc.versions?.node) return {\n\t\t\truntime: `node/${proc.versions.node}`,\n\t\t\tos: proc.platform,\n\t\t\tarch: proc.arch\n\t\t};\n\t}\n\tif (typeof g[\"navigator\"] !== \"undefined\") return {\n\t\truntime: \"browser\",\n\t\tos: void 0,\n\t\tarch: void 0\n\t};\n\treturn {\n\t\truntime: \"unknown\",\n\t\tos: void 0,\n\t\tarch: void 0\n\t};\n}\n/**\n* Build the User-Agent header value the SDK sends on every B2 request.\n*\n* The product token, npm package name, language label, runtime, OS, and\n* architecture are emitted in that order, separated by semicolons inside a\n* single parenthesised comment block. OS and architecture are omitted on\n* runtimes that don't expose them (notably browsers). A custom prefix passed\n* via `B2ClientOptions.userAgent` is prepended verbatim so app-level\n* identifiers come first. See the README \"Identifying your traffic\" section\n* for examples.\n*\n* @param custom - Optional prefix prepended to the default User-Agent.\n*\n* @returns The formatted User-Agent header string.\n*/\nfunction getUserAgent(custom) {\n\tconst { runtime, os, arch } = detectPlatform();\n\tconst parts = [\n\t\t\"typescript\",\n\t\tSDK_PACKAGE,\n\t\truntime\n\t];\n\tif (os !== void 0) parts.push(os);\n\tif (arch !== void 0) parts.push(arch);\n\tconst base = `${SDK_PRODUCT}/${VERSION} (${parts.join(\"; \")})`;\n\treturn custom ? `${custom} ${base}` : base;\n}\n//#endregion\nexport { SDK_PACKAGE, SDK_PRODUCT, getUserAgent };\n\n//# sourceMappingURL=user-agent.js.map","import { B2Error, B2RedirectError, B2SsrfError, ExpiredAuthTokenError, NetworkError, classifyError } from \"../errors/index.js\";\nimport { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep } from \"./retry.js\";\nimport { UrlGuard } from \"./url-guard.js\";\nimport { getUserAgent } from \"./user-agent.js\";\n//#region src/http/transport.ts\nvar REDIRECT_STATUSES = /* @__PURE__ */ new Set([\n\t301,\n\t302,\n\t303,\n\t307,\n\t308\n]);\nvar MAX_SAME_ORIGIN_REDIRECTS = 5;\n/**\n* Default transport implementation using the global `fetch` API.\n* Automatically sets the User-Agent header on each request and applies the\n* SSRF {@link UrlGuard} (if configured) before opening the connection.\n* Redirect following is disabled so redirected URLs cannot bypass the guard or\n* receive credential-bearing headers without an explicit checked request.\n*/\nvar FetchTransport = class {\n\t/** User-Agent string sent with every request. */\n\tuserAgent;\n\t/** Whether same-origin GET/HEAD redirects should be followed after guard checks. */\n\tfollowSameOriginRedirects;\n\t/** SSRF allow-list applied to every outgoing URL. Mutable so `B2Client.authorize()` can lock it down post-auth. */\n\turlGuard;\n\t/**\n\t* Creates a new FetchTransport.\n\t* @param options - Optional configuration: custom User-Agent prefix and SSRF guard.\n\t*/\n\tconstructor(options) {\n\t\tthis.userAgent = getUserAgent(options?.userAgent);\n\t\tthis.followSameOriginRedirects = options?.followSameOriginRedirects ?? true;\n\t\tthis.urlGuard = options?.urlGuard ?? new UrlGuard();\n\t}\n\t/**\n\t* Sends the request using the global `fetch` function.\n\t* @param request - The HTTP request to execute.\n\t*\n\t* @returns The HTTP response.\n\t*\n\t* @throws B2SsrfError when the URL fails the configured SSRF guard.\n\t* @throws B2RedirectError when a response attempts to redirect.\n\t*/\n\tasync send(request) {\n\t\tlet currentRequest = request;\n\t\tlet redirectCount = 0;\n\t\twhile (true) {\n\t\t\tthis.urlGuard.check(currentRequest.url);\n\t\t\tconst headers = new Headers(currentRequest.headers);\n\t\t\tif (!headers.has(\"User-Agent\")) headers.set(\"User-Agent\", this.userAgent);\n\t\t\tconst timeoutScope = createRequestTimeoutScope(currentRequest);\n\t\t\tlet response;\n\t\t\ttry {\n\t\t\t\tresponse = await fetch(currentRequest.url, {\n\t\t\t\t\tmethod: currentRequest.method,\n\t\t\t\t\theaders,\n\t\t\t\t\tbody: currentRequest.body ?? null,\n\t\t\t\t\tredirect: \"manual\",\n\t\t\t\t\t...timeoutScope.signal !== void 0 ? { signal: timeoutScope.signal } : {}\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\ttimeoutScope.dispose();\n\t\t\t\tif (timeoutScope.timedOut) throw createRequestTimeoutError(timeoutScope);\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif (isBlockedRedirect(response)) {\n\t\t\t\tconst location = response.headers.get(\"Location\");\n\t\t\t\tif (this.followSameOriginRedirects && location !== null && redirectCount < MAX_SAME_ORIGIN_REDIRECTS && canFollowSameOriginRedirect(currentRequest, location)) {\n\t\t\t\t\tconst nextUrl = new URL(location, currentRequest.url).toString();\n\t\t\t\t\tawait cancelResponseBody(response);\n\t\t\t\t\ttimeoutScope.dispose();\n\t\t\t\t\tthis.urlGuard.check(nextUrl);\n\t\t\t\t\tcurrentRequest = {\n\t\t\t\t\t\t...currentRequest,\n\t\t\t\t\t\turl: nextUrl\n\t\t\t\t\t};\n\t\t\t\t\tredirectCount += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tawait cancelResponseBody(response);\n\t\t\t\ttimeoutScope.dispose();\n\t\t\t\tthrow new B2RedirectError(currentRequest.url, response.status, location);\n\t\t\t}\n\t\t\treturn createTimedHttpResponse(response, timeoutScope);\n\t\t}\n\t}\n};\nfunction createRequestTimeoutScope(request) {\n\tconst timeoutMs = request.retry?.requestTimeoutMs ?? DEFAULT_RETRY_OPTIONS.requestTimeoutMs;\n\tif (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {\n\t\tconst scope = {\n\t\t\ttimeoutMs: 0,\n\t\t\ttimedOut: false,\n\t\t\treset() {},\n\t\t\tdispose() {}\n\t\t};\n\t\tif (request.signal !== void 0) return {\n\t\t\t...scope,\n\t\t\tsignal: request.signal\n\t\t};\n\t\treturn scope;\n\t}\n\tconst controller = new AbortController();\n\tlet timedOut = false;\n\tlet timer;\n\tconst abortFromUpstream = () => {\n\t\tclearTimeout(timer);\n\t\tcontroller.abort(request.signal?.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n\t};\n\tconst armTimer = () => {\n\t\tconst nextTimer = setTimeout(() => {\n\t\t\ttimedOut = true;\n\t\t\tcontroller.abort(new DOMException(\"HTTP request timed out\", \"TimeoutError\"));\n\t\t}, timeoutMs);\n\t\tunrefTimer(nextTimer);\n\t\treturn nextTimer;\n\t};\n\ttimer = armTimer();\n\tconst reset = () => {\n\t\tif (timedOut || controller.signal.aborted) return;\n\t\tclearTimeout(timer);\n\t\ttimer = armTimer();\n\t};\n\tif (request.signal?.aborted === true) {\n\t\tclearTimeout(timer);\n\t\tabortFromUpstream();\n\t} else request.signal?.addEventListener(\"abort\", abortFromUpstream, { once: true });\n\treturn {\n\t\tsignal: controller.signal,\n\t\ttimeoutMs,\n\t\tget timedOut() {\n\t\t\treturn timedOut;\n\t\t},\n\t\treset,\n\t\tdispose() {\n\t\t\tclearTimeout(timer);\n\t\t\trequest.signal?.removeEventListener(\"abort\", abortFromUpstream);\n\t\t}\n\t};\n}\nfunction unrefTimer(timer) {\n\tconst maybeUnref = timer.unref;\n\tif (typeof maybeUnref === \"function\") maybeUnref.call(timer);\n}\nfunction createRequestTimeoutError(scope) {\n\treturn new DOMException(`HTTP request timed out after ${scope.timeoutMs} ms`, \"TimeoutError\");\n}\nfunction createTimedHttpResponse(response, timeoutScope) {\n\tconst body = response.body;\n\tif (body === null) timeoutScope.dispose();\n\tlet timedBody;\n\treturn {\n\t\tstatus: response.status,\n\t\theaders: response.headers,\n\t\tget body() {\n\t\t\tif (body === null) return null;\n\t\t\ttimedBody ??= createTimedResponseBody(body, timeoutScope);\n\t\t\treturn timedBody;\n\t\t},\n\t\tjson: () => readTimedResponseBody(timeoutScope, response, () => response.json()),\n\t\ttext: () => readTimedResponseBody(timeoutScope, response, () => response.text()),\n\t\tarrayBuffer: () => readTimedResponseBody(timeoutScope, response, () => response.arrayBuffer())\n\t};\n}\nasync function readTimedResponseBody(timeoutScope, response, read) {\n\ttry {\n\t\treturn await raceBodyReadWithAbort(timeoutScope, read(), (reason) => cancelResponseBody(response, reason));\n\t} catch (err) {\n\t\tif (timeoutScope.timedOut) throw createRequestTimeoutError(timeoutScope);\n\t\tthrow err;\n\t} finally {\n\t\ttimeoutScope.dispose();\n\t}\n}\nfunction createTimedResponseBody(body, timeoutScope) {\n\tlet reader;\n\tlet disposed = false;\n\tconst dispose = () => {\n\t\tif (disposed) return;\n\t\tdisposed = true;\n\t\ttimeoutScope.dispose();\n\t};\n\treturn new ReadableStream({\n\t\tasync pull(controller) {\n\t\t\treader ??= body.getReader();\n\t\t\ttry {\n\t\t\t\tconst result = await raceBodyReadWithAbort(timeoutScope, reader.read(), (reason) => reader?.cancel(reason));\n\t\t\t\tif (result.done) {\n\t\t\t\t\tdispose();\n\t\t\t\t\tcontroller.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttimeoutScope.reset();\n\t\t\t\tcontroller.enqueue(result.value);\n\t\t\t} catch (err) {\n\t\t\t\tdispose();\n\t\t\t\tif (timeoutScope.timedOut) {\n\t\t\t\t\tcontroller.error(createRequestTimeoutError(timeoutScope));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontroller.error(err);\n\t\t\t}\n\t\t},\n\t\tasync cancel(reason) {\n\t\t\tdispose();\n\t\t\ttry {\n\t\t\t\tif (reader !== void 0) {\n\t\t\t\t\tawait reader.cancel(reason);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tawait body.cancel(reason);\n\t\t\t} catch {}\n\t\t}\n\t});\n}\nasync function raceBodyReadWithAbort(timeoutScope, read, abortCleanup) {\n\tconst signal = timeoutScope.signal;\n\tif (signal === void 0) return read;\n\tconst abortReason = () => signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\tif (signal.aborted) {\n\t\tread.catch(() => {});\n\t\tconst reason = abortReason();\n\t\tawait runAbortCleanup(abortCleanup, reason);\n\t\tthrow reason;\n\t}\n\tlet removeAbortListener;\n\tconst abort = new Promise((_, reject) => {\n\t\tconst onAbort = () => {\n\t\t\tconst reason = abortReason();\n\t\t\tread.catch(() => {});\n\t\t\treject(reason);\n\t\t\trunAbortCleanup(abortCleanup, reason);\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\treturn await Promise.race([read, abort]);\n\t} finally {\n\t\tremoveAbortListener?.();\n\t}\n}\nasync function runAbortCleanup(abortCleanup, reason) {\n\ttry {\n\t\tawait abortCleanup?.(reason);\n\t} catch {}\n}\nfunction isBlockedRedirect(response) {\n\treturn response.type === \"opaqueredirect\" || REDIRECT_STATUSES.has(response.status);\n}\nfunction canFollowSameOriginRedirect(request, location) {\n\tif (request.method !== \"GET\" && request.method !== \"HEAD\") return false;\n\ttry {\n\t\treturn new URL(request.url).origin === new URL(location, request.url).origin;\n\t} catch {\n\t\treturn false;\n\t}\n}\nasync function cancelResponseBody(response, reason) {\n\ttry {\n\t\tawait response.body?.cancel(reason);\n\t} catch {}\n}\n/**\n* Decide whether `url` points at a URL-pinned upload POST endpoint.\n*\n* @param url - Request URL to inspect.\n*\n* @returns Whether the request is a direct upload endpoint.\n*/\nfunction isUploadEndpoint(url) {\n\tconst endpoint = b2ApiEndpointName(url);\n\treturn endpoint === \"b2_upload_file\" || endpoint === \"b2_upload_part\";\n}\nfunction isFinishLargeFileEndpoint(url) {\n\treturn b2ApiEndpointName(url) === \"b2_finish_large_file\";\n}\nfunction isStartLargeFileEndpoint(url) {\n\treturn b2ApiEndpointName(url) === \"b2_start_large_file\";\n}\nfunction b2ApiEndpointName(url) {\n\tconst [, root, , endpoint] = new URL(url).pathname.split(\"/\");\n\tif (root !== \"b2api\") return void 0;\n\treturn endpoint;\n}\nfunction isReplayUnsafePostEndpoint(url) {\n\treturn isUploadEndpoint(url) || isStartLargeFileEndpoint(url) || isFinishLargeFileEndpoint(url);\n}\n/**\n* Decide whether a classified error should be retried in place for `url`.\n* Transient errors normally retry; upload endpoints bubble to the upload layer\n* for fresh-URL retry except account-level 429 throttling, where fetching a new\n* upload URL only amplifies the rate limit.\n*\n* @param error - The classified, retryability-tagged error.\n* @param url - The request URL (used to detect upload endpoints).\n*\n* @returns Whether to retry the request in place.\n*/\nfunction shouldRetryInPlace(error, url) {\n\tif (!error.retryable) return false;\n\tif (isStartLargeFileEndpoint(url) || isFinishLargeFileEndpoint(url)) return false;\n\tif (isUploadEndpoint(url) && error.status === 429) return true;\n\tif (isUploadEndpoint(url)) return false;\n\treturn true;\n}\nfunction isRequestTimeoutError(err) {\n\treturn err instanceof DOMException && err.name === \"TimeoutError\";\n}\nfunction isTerminalTransportError(err) {\n\treturn err instanceof B2Error || err instanceof B2RedirectError || err instanceof NetworkError || err instanceof B2SsrfError || err instanceof DOMException && err.name === \"AbortError\";\n}\n/**\n* Transport wrapper that adds automatic retry with exponential backoff.\n* Handles transient errors (408, 429, and the transient 5xx set 500/502/503/504),\n* expired auth tokens, and network failures. Delegates to an inner\n* {@link HttpTransport}.\n*\n* Upload endpoints (`b2_upload_file` / `b2_upload_part`) are URL-pinned. Their\n* retryable pod failures bubble to the upload layer, which evicts the failed\n* URL, fetches a fresh one, and retries there. HTTP 429 remains an in-place\n* retry so account-level throttling does not trigger extra upload URL fetches.\n*/\nvar RetryTransport = class {\n\t/** The wrapped transport that performs actual HTTP requests. */\n\tinner;\n\t/** Resolved retry options (defaults merged with user overrides). */\n\toptions;\n\t/** Optional callback to refresh auth credentials on 401 — returns the fresh token. */\n\tonReauth;\n\t/** Sleep implementation used between retries; injectable for tests. */\n\tsleepImpl;\n\t/**\n\t* Creates a new RetryTransport.\n\t* @param opts - Retry transport configuration.\n\t*/\n\tconstructor(opts) {\n\t\tthis.inner = opts.transport;\n\t\tthis.options = {\n\t\t\t...DEFAULT_RETRY_OPTIONS,\n\t\t\t...opts.retry\n\t\t};\n\t\tif (opts.onReauth !== void 0) this.onReauth = opts.onReauth;\n\t\tthis.sleepImpl = opts.sleepImpl ?? sleep;\n\t}\n\t/**\n\t* Sends the request with automatic retry on transient failures.\n\t* On expired auth tokens, calls {@link RetryTransportOptions.onReauth} and retries.\n\t* @param originalRequest - The HTTP request to execute. The caller's\n\t* reference is not mutated; on reauth, a copy with a refreshed\n\t* Authorization header is sent.\n\t*\n\t* @returns The HTTP response.\n\t*/\n\tasync send(originalRequest) {\n\t\tlet request = originalRequest;\n\t\tconst retryOptions = {\n\t\t\t...this.options,\n\t\t\t...originalRequest.retry\n\t\t};\n\t\tlet lastError;\n\t\tlet didReauth = false;\n\t\tlet attempt = 0;\n\t\twhile (attempt <= retryOptions.maxRetries) {\n\t\t\tthrowIfSignalAborted(request.signal);\n\t\t\tif (attempt > 0 && lastError) {\n\t\t\t\tconst retryAfter = lastError instanceof NetworkError ? void 0 : lastError.retryAfter;\n\t\t\t\tconst delay = computeBackoff(attempt - 1, retryOptions, retryAfter);\n\t\t\t\tawait this.sleepImpl(delay, request.signal);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await this.inner.send({\n\t\t\t\t\t...request,\n\t\t\t\t\tretry: retryOptions\n\t\t\t\t});\n\t\t\t\tawait throwIfSignalAbortedAfterResponse(request.signal, response);\n\t\t\t\tif (response.status >= 200 && response.status < 300) return response;\n\t\t\t\tlet errorBody;\n\t\t\t\ttry {\n\t\t\t\t\terrorBody = await response.json();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (isRequestTimeoutError(err)) throw err;\n\t\t\t\t\terrorBody = {\n\t\t\t\t\t\tstatus: response.status,\n\t\t\t\t\t\tcode: \"internal_error\",\n\t\t\t\t\t\tmessage: `HTTP ${response.status}`\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst retryAfterHeader = response.headers.get(\"Retry-After\");\n\t\t\t\tconst retryAfterSec = retryAfterHeader ? Number.parseInt(retryAfterHeader, 10) : void 0;\n\t\t\t\tconst requestId = response.headers.get(\"X-Bz-Request-Id\") ?? void 0;\n\t\t\t\tconst error = classifyError(errorBody, {\n\t\t\t\t\t...retryAfterSec !== void 0 ? { retryAfter: retryAfterSec } : {},\n\t\t\t\t\t...requestId !== void 0 ? { requestId } : {}\n\t\t\t\t});\n\t\t\t\tif (error instanceof ExpiredAuthTokenError && this.onReauth && !isUploadEndpoint(request.url) && !didReauth) {\n\t\t\t\t\tconst freshToken = await this.onReauth();\n\t\t\t\t\trequest = {\n\t\t\t\t\t\t...request,\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t...request.headers ?? {},\n\t\t\t\t\t\t\tAuthorization: freshToken\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tdidReauth = true;\n\t\t\t\t\tlastError = void 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!shouldRetryInPlace(error, request.url) || attempt === retryOptions.maxRetries) throw error;\n\t\t\t\tlastError = error;\n\t\t\t\tattempt += 1;\n\t\t\t} catch (err) {\n\t\t\t\tthrowIfSignalAborted(request.signal);\n\t\t\t\tif (isTerminalTransportError(err)) throw err;\n\t\t\t\tconst networkErr = new NetworkError(err instanceof Error ? err.message : \"Network error\", err);\n\t\t\t\tif (isReplayUnsafePostEndpoint(request.url) || attempt === retryOptions.maxRetries) throw networkErr;\n\t\t\t\tlastError = networkErr;\n\t\t\t\tattempt += 1;\n\t\t\t}\n\t\t}\n\t\tthrow lastError ?? new NetworkError(\"Max retries exceeded\");\n\t}\n};\nfunction throwIfSignalAborted(signal) {\n\tif (signal?.aborted === true) throw signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\nasync function throwIfSignalAbortedAfterResponse(signal, response) {\n\tif (signal?.aborted !== true) return;\n\tconst reason = signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\ttry {\n\t\tawait response.body?.cancel(reason);\n\t} catch {}\n\tthrow reason;\n}\n//#endregion\nexport { FetchTransport, RetryTransport };\n\n//# sourceMappingURL=transport.js.map","import { FinishLargeFileResponseBodyError, UploadResponseBodyError } from \"../errors/index.js\";\nimport { buildFileInfoHeaders, decodeFileName, encodeFileName, parseFileInfoHeaders } from \"./encoding.js\";\nimport { normalizeFileVersionListSha1, normalizeFileVersionSha1 } from \"../util/normalize.js\";\nimport { EncryptionAlgorithm, EncryptionMode } from \"../types/encryption.js\";\nimport { assertSecureRealmUrl } from \"../auth/realms.js\";\n//#region src/raw/index.ts\n/**\n* Low-level 1:1 bindings for every B2 native API endpoint.\n*\n* Each method on {@link RawClient} maps directly to a single `b2_*` HTTP call\n* with fully typed request and response objects. No retry logic, no URL pooling,\n* no automatic reauthorization. Use this when you need precise control over\n* individual API calls; for most use cases prefer the high-level `B2Client`.\n*\n* @packageDocumentation\n*/\nfunction normalizeRawRequestOptions(optionsOrSignal, retry) {\n\tif (optionsOrSignal === void 0) return retry === void 0 ? void 0 : { retry };\n\tif (isAbortSignal(optionsOrSignal)) return {\n\t\tsignal: optionsOrSignal,\n\t\t...retry !== void 0 ? { retry } : {}\n\t};\n\treturn retry === void 0 ? optionsOrSignal : {\n\t\t...optionsOrSignal,\n\t\tretry\n\t};\n}\nfunction isAbortSignal(value) {\n\treturn typeof value === \"object\" && value !== null && \"aborted\" in value && typeof value.addEventListener === \"function\";\n}\nfunction normalizeCreateKeyRequest(request) {\n\tconst { bucketId, ...withoutDeprecatedBucketId } = request;\n\tif (bucketId !== void 0 && withoutDeprecatedBucketId.bucketIds !== void 0) throw new TypeError(\"createKey accepts either bucketIds or deprecated bucketId, not both\");\n\tif (bucketId === void 0) return withoutDeprecatedBucketId;\n\treturn {\n\t\t...withoutDeprecatedBucketId,\n\t\tbucketIds: [bucketId]\n\t};\n}\nfunction singleBucketId(bucketIds) {\n\treturn bucketIds?.length === 1 ? bucketIds[0] ?? null : null;\n}\nfunction normalizeKeyResponse(key) {\n\treturn {\n\t\t...key,\n\t\tbucketId: singleBucketId(key.bucketIds)\n\t};\n}\nfunction normalizeAllowedBuckets(storageApi) {\n\tconst allowed = storageApi.allowed;\n\tif (allowed?.buckets !== void 0) return allowed.buckets === null ? null : allowed.buckets.map((bucket) => ({ ...bucket }));\n\tconst bucketId = allowed?.bucketId ?? storageApi.bucketId ?? null;\n\tif (bucketId === null) return null;\n\treturn [{\n\t\tid: bucketId,\n\t\tname: allowed?.bucketName ?? storageApi.bucketName ?? null\n\t}];\n}\nfunction normalizeAuthorizeAccountResponse(response) {\n\tconst storageApi = response.apiInfo.storageApi;\n\tconst allowed = storageApi.allowed;\n\tconst buckets = normalizeAllowedBuckets(storageApi);\n\tconst singleBucket = buckets?.length === 1 ? buckets[0] : void 0;\n\tconst bucketId = singleBucket?.id ?? null;\n\tconst bucketName = singleBucket?.name ?? null;\n\tconst namePrefix = allowed?.namePrefix ?? storageApi.namePrefix ?? null;\n\tconst capabilities = allowed?.capabilities ?? storageApi.capabilities ?? [];\n\tconst { allowed: _wireAllowed, capabilities: _legacyCapabilities, ...storageApiBase } = storageApi;\n\treturn {\n\t\t...response,\n\t\tapiInfo: {\n\t\t\t...response.apiInfo,\n\t\t\tstorageApi: {\n\t\t\t\t...storageApiBase,\n\t\t\t\tbucketId,\n\t\t\t\tbucketName,\n\t\t\t\tdownloadUrl: storageApi.downloadUrl,\n\t\t\t\tinfoType: \"storageApi\",\n\t\t\t\tnamePrefix,\n\t\t\t\tallowed: {\n\t\t\t\t\t...allowed ?? {},\n\t\t\t\t\tcapabilities,\n\t\t\t\t\tbuckets,\n\t\t\t\t\tbucketId,\n\t\t\t\t\tbucketName,\n\t\t\t\t\tnamePrefix\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction uploadResponseBodyError(err, signal) {\n\tif (signal?.aborted === true) throw signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\treturn new UploadResponseBodyError(err instanceof Error ? err.message : \"Upload response body could not be read\", { cause: err });\n}\n/**\n* Low-level client providing 1:1 bindings to all B2 native API endpoints.\n*\n* Each method maps directly to a single B2 API call. Most methods accept\n* `(apiUrl, authToken, request)` and return the JSON response. Upload and\n* download methods accept endpoint-specific parameters instead.\n*/\nvar RawClient = class {\n\t/** @internal */\n\ttransport;\n\t/**\n\t* Creates a new RawClient with the given transport.\n\t* @param options - The constructor configuration.\n\t*/\n\tconstructor(options) {\n\t\tthis.transport = options.transport;\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}.\n\t* @param applicationKeyId - The application key ID for authentication.\n\t* @param applicationKey - The application key secret.\n\t* @param realmUrl - The B2 realm URL to authenticate against.\n\t*\n\t* @returns The authorization response with API URLs and credentials.\n\t*/\n\tasync authorizeAccount(applicationKeyId, applicationKey, realmUrl = \"https://api.backblazeb2.com\") {\n\t\tassertSecureRealmUrl(realmUrl);\n\t\treturn normalizeAuthorizeAccountResponse(await (await this.transport.send({\n\t\t\turl: `${realmUrl}/b2api/v4/b2_authorize_account`,\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}` }\n\t\t})).json());\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The created bucket metadata.\n\t*/\n\tasync createBucket(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_create_bucket\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The deleted bucket metadata.\n\t*/\n\tasync deleteBucket(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_delete_bucket\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The list of matching buckets.\n\t*/\n\tasync listBuckets(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_list_buckets\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync updateBucket(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_update_bucket\", request);\n\t}\n\t/**\n\t* Implementation for both upload URL request-control signatures.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param optionsOrSignal - Options bag or legacy abort signal.\n\t* @param retry - Optional legacy per-request retry override.\n\t*\n\t* @returns The upload URL and authorization token.\n\t*/\n\tasync getUploadUrl(apiUrl, authToken, request, optionsOrSignal, retry) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_get_upload_url\", request, normalizeRawRequestOptions(optionsOrSignal, retry));\n\t}\n\t/**\n\t* Implementation for both upload-file request-control signatures.\n\t* @param uploadUrl - The upload endpoint URL.\n\t* @param headers - The request headers including authorization and content metadata.\n\t* @param body - The file data to upload.\n\t* @param optionsOrSignal - Options bag or legacy abort signal.\n\t* @param retry - Optional legacy per-request retry override.\n\t*\n\t* @returns The uploaded file version metadata.\n\t*/\n\tasync uploadFile(uploadUrl, headers, body, optionsOrSignal, retry) {\n\t\tconst options = normalizeRawRequestOptions(optionsOrSignal, retry);\n\t\tconst reqHeaders = {\n\t\t\tAuthorization: headers.authorization,\n\t\t\t\"X-Bz-File-Name\": encodeFileName(headers.fileName),\n\t\t\t\"Content-Type\": headers.contentType,\n\t\t\t\"Content-Length\": String(headers.contentLength),\n\t\t\t\"X-Bz-Content-Sha1\": headers.contentSha1,\n\t\t\t...buildFileInfoHeaders(headers.fileInfo)\n\t\t};\n\t\tif (headers.lastModifiedMillis !== void 0) reqHeaders[\"X-Bz-Info-src_last_modified_millis\"] = String(headers.lastModifiedMillis);\n\t\tif (headers.contentDisposition) reqHeaders[\"X-Bz-Info-b2-content-disposition\"] = headers.contentDisposition;\n\t\tif (headers.contentLanguage) reqHeaders[\"X-Bz-Info-b2-content-language\"] = headers.contentLanguage;\n\t\tif (headers.expires) reqHeaders[\"X-Bz-Info-b2-expires\"] = headers.expires;\n\t\tif (headers.cacheControl) reqHeaders[\"X-Bz-Info-b2-cache-control\"] = headers.cacheControl;\n\t\tif (headers.contentEncoding) reqHeaders[\"X-Bz-Info-b2-content-encoding\"] = headers.contentEncoding;\n\t\tapplyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n\t\tapplyRetentionHeaders(reqHeaders, headers.fileRetention);\n\t\tapplyLegalHoldHeader(reqHeaders, headers.legalHold);\n\t\tconst response = await this.transport.send({\n\t\t\turl: uploadUrl,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: reqHeaders,\n\t\t\tbody,\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options?.retry !== void 0 ? { retry: options.retry } : {}\n\t\t});\n\t\ttry {\n\t\t\treturn normalizeFileVersionSha1(await response.json());\n\t\t} catch (err) {\n\t\t\tthrow uploadResponseBodyError(err, options?.signal);\n\t\t}\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns The list of file names and optional continuation token.\n\t*/\n\tasync listFileNames(apiUrl, authToken, request, options) {\n\t\treturn normalizeFileVersionListSha1(await this.postJson(apiUrl, authToken, \"b2_list_file_names\", request, options));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns The list of file versions and optional continuation token.\n\t*/\n\tasync listFileVersions(apiUrl, authToken, request, options) {\n\t\treturn normalizeFileVersionListSha1(await this.postJson(apiUrl, authToken, \"b2_list_file_versions\", request, options));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The file version metadata.\n\t*/\n\tasync getFileInfo(apiUrl, authToken, request) {\n\t\treturn normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, \"b2_get_file_info\", request));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns The hidden file version metadata.\n\t*/\n\tasync hideFile(apiUrl, authToken, request, options) {\n\t\treturn normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, \"b2_hide_file\", request, options));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns The deleted file version identifier.\n\t*/\n\tasync deleteFileVersion(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_delete_file_version\", request, options);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns The copied file version metadata.\n\t*/\n\tasync copyFile(apiUrl, authToken, request, options) {\n\t\treturn normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, \"b2_copy_file\", request, options));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional abort and retry controls.\n\t*\n\t* @returns The copied part metadata.\n\t*/\n\tasync copyPart(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_copy_part\", request, options);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional abort and retry controls.\n\t*\n\t* @returns The started large file metadata with file ID.\n\t*/\n\tasync startLargeFile(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_start_large_file\", request, options);\n\t}\n\t/**\n\t* Implementation for both upload part URL request-control signatures.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param optionsOrSignal - Options bag or legacy abort signal.\n\t* @param retry - Optional legacy per-request retry override.\n\t*\n\t* @returns The upload part URL and authorization token.\n\t*/\n\tasync getUploadPartUrl(apiUrl, authToken, request, optionsOrSignal, retry) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_get_upload_part_url\", request, normalizeRawRequestOptions(optionsOrSignal, retry));\n\t}\n\t/**\n\t* Implementation for both upload-part request-control signatures.\n\t* @param uploadUrl - The upload endpoint URL.\n\t* @param headers - The request headers including authorization and content metadata.\n\t* @param body - The file data to upload.\n\t* @param optionsOrSignal - Options bag or legacy abort signal.\n\t* @param retry - Optional legacy per-request retry override.\n\t*\n\t* @returns The uploaded part metadata.\n\t*/\n\tasync uploadPart(uploadUrl, headers, body, optionsOrSignal, retry) {\n\t\tconst options = normalizeRawRequestOptions(optionsOrSignal, retry);\n\t\tconst reqHeaders = {\n\t\t\tAuthorization: headers.authorization,\n\t\t\t\"X-Bz-Part-Number\": String(headers.partNumber),\n\t\t\t\"Content-Length\": String(headers.contentLength),\n\t\t\t\"X-Bz-Content-Sha1\": headers.contentSha1\n\t\t};\n\t\tapplyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n\t\tconst response = await this.transport.send({\n\t\t\turl: uploadUrl,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: reqHeaders,\n\t\t\tbody,\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options?.retry !== void 0 ? { retry: options.retry } : {}\n\t\t});\n\t\ttry {\n\t\t\treturn await response.json();\n\t\t} catch (err) {\n\t\t\tthrow uploadResponseBodyError(err, options?.signal);\n\t\t}\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional abort and retry controls.\n\t*\n\t* @returns The completed file version metadata.\n\t*/\n\tasync finishLargeFile(apiUrl, authToken, request, options) {\n\t\tconst response = await this.transport.send({\n\t\t\turl: `${apiUrl}/b2api/v3/b2_finish_large_file`,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\tAuthorization: authToken,\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(request),\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options?.retry !== void 0 ? { retry: options.retry } : {}\n\t\t});\n\t\tlet fileVersion;\n\t\ttry {\n\t\t\tfileVersion = await response.json();\n\t\t} catch (err) {\n\t\t\tthrow new FinishLargeFileResponseBodyError(err instanceof Error ? err.message : \"Finish large file response body could not be read\", {\n\t\t\t\tcause: err,\n\t\t\t\tfileId: request.fileId\n\t\t\t});\n\t\t}\n\t\treturn normalizeFileVersionSha1(fileVersion);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as cancellation and retry overrides.\n\t*\n\t* @returns The cancelled large file metadata.\n\t*/\n\tasync cancelLargeFile(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_cancel_large_file\", request, options);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as cancellation and retry.\n\t*\n\t* @returns The list of unfinished large files and optional continuation token.\n\t*/\n\tasync listUnfinishedLargeFiles(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_list_unfinished_large_files\", request, options);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as cancellation and retry.\n\t*\n\t* @returns The list of uploaded parts and optional continuation token.\n\t*/\n\tasync listParts(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_list_parts\", request, options);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}.\n\t* @param downloadUrl - The B2 download base URL.\n\t* @param authToken - The authorization token.\n\t* @param fileId - The unique identifier of the file to download.\n\t* @param options - Optional download parameters for range requests and cancellation.\n\t*\n\t* @returns The response headers, streaming body, and HTTP status code.\n\t*/\n\tasync downloadFileById(downloadUrl, authToken, fileId, options) {\n\t\tconst headers = buildDownloadRequestHeaders(authToken, options);\n\t\tconst url = appendDownloadOverrides(`${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`, options);\n\t\tconst response = await this.transport.send({\n\t\t\turl,\n\t\t\tmethod: options?.method ?? \"GET\",\n\t\t\theaders,\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {}\n\t\t});\n\t\treturn {\n\t\t\theaders: response.headers,\n\t\t\tbody: response.body,\n\t\t\tstatus: response.status\n\t\t};\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}.\n\t* @param downloadUrl - The B2 download base URL.\n\t* @param authToken - The authorization token.\n\t* @param bucketName - The name of the bucket containing the file.\n\t* @param fileName - The name of the file to download.\n\t* @param options - Optional download parameters for range requests and cancellation.\n\t*\n\t* @returns The response headers, streaming body, and HTTP status code.\n\t*/\n\tasync downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) {\n\t\tconst headers = buildDownloadRequestHeaders(authToken, options);\n\t\tconst url = appendDownloadOverrides(`${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileName(fileName)}`, options);\n\t\tconst response = await this.transport.send({\n\t\t\turl,\n\t\t\tmethod: options?.method ?? \"GET\",\n\t\t\theaders,\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {}\n\t\t});\n\t\treturn {\n\t\t\theaders: response.headers,\n\t\t\tbody: response.body,\n\t\t\tstatus: response.status\n\t\t};\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The current session authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The download authorization token for the specified file prefix.\n\t*/\n\tasync getDownloadAuthorization(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_get_download_authorization\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The newly created application key with secret.\n\t*/\n\tasync createKey(apiUrl, authToken, request) {\n\t\treturn normalizeKeyResponse(await this.postJson(apiUrl, authToken, \"b2_create_key\", normalizeCreateKeyRequest(request), void 0, \"v4\"));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The list of application keys and optional continuation token.\n\t*/\n\tasync listKeys(apiUrl, authToken, request) {\n\t\tconst response = await this.postJson(apiUrl, authToken, \"b2_list_keys\", request, void 0, \"v4\");\n\t\treturn {\n\t\t\t...response,\n\t\t\tkeys: response.keys.map((key) => normalizeKeyResponse(key))\n\t\t};\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The deleted application key metadata.\n\t*/\n\tasync deleteKey(apiUrl, authToken, request) {\n\t\treturn normalizeKeyResponse(await this.postJson(apiUrl, authToken, \"b2_delete_key\", request, void 0, \"v4\"));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The updated file retention settings.\n\t*/\n\tasync updateFileRetention(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_update_file_retention\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The updated file legal hold status.\n\t*/\n\tasync updateFileLegalHold(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_update_file_legal_hold\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The configured event notification rules for the specified bucket.\n\t*/\n\tasync getBucketNotificationRules(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_get_bucket_notification_rules\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The updated bucket notification rules.\n\t*/\n\tasync setBucketNotificationRules(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_set_bucket_notification_rules\", request);\n\t}\n\t/**\n\t* Sends a JSON POST request to the specified B2 API endpoint.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param endpoint - The B2 API endpoint name.\n\t* @param body - The JSON request body.\n\t* @param options - Optional abort and per-request retry settings.\n\t* @param apiVersion - B2 Native API version segment for this endpoint.\n\t*\n\t* @returns The parsed JSON response.\n\t*/\n\tasync postJson(apiUrl, authToken, endpoint, body, options, apiVersion = \"v3\") {\n\t\treturn (await this.transport.send({\n\t\t\turl: `${apiUrl}/b2api/${apiVersion}/${endpoint}`,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\tAuthorization: authToken,\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(body),\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options?.retry !== void 0 ? { retry: options.retry } : {}\n\t\t})).json();\n\t}\n};\n/**\n* Applies server-side encryption headers to the request.\n* @param headers - The mutable headers object to populate.\n* @param encryption - The encryption settings, or undefined to skip.\n*/\nfunction applyEncryptionHeaders(headers, encryption) {\n\tif (!encryption || encryption.mode === EncryptionMode.None) return;\n\tif (encryption.mode === EncryptionMode.SseB2) headers[\"X-Bz-Server-Side-Encryption\"] = EncryptionAlgorithm.Aes256;\n\telse if (encryption.mode === EncryptionMode.SseC) {\n\t\theaders[\"X-Bz-Server-Side-Encryption-Customer-Algorithm\"] = EncryptionAlgorithm.Aes256;\n\t\theaders[\"X-Bz-Server-Side-Encryption-Customer-Key\"] = encryption.customerKey;\n\t\theaders[\"X-Bz-Server-Side-Encryption-Customer-Key-Md5\"] = encryption.customerKeyMd5;\n\t}\n}\nvar DOWNLOAD_OVERRIDE_PARAMS = [\n\t\"b2ContentDisposition\",\n\t\"b2ContentLanguage\",\n\t\"b2ContentEncoding\",\n\t\"b2ContentType\",\n\t\"b2CacheControl\",\n\t\"b2Expires\"\n];\n/**\n* Builds the HTTP request headers for a download: Authorization, optional\n* Range, and optional SSE-C decryption headers.\n*\n* @param authToken - The B2 session authorization token.\n* @param options - Caller-supplied download options.\n*\n* @returns The header map to send with the request.\n*/\nfunction buildDownloadRequestHeaders(authToken, options) {\n\tconst headers = { Authorization: authToken };\n\tif (options?.range) headers[\"Range\"] = options.range;\n\tif (options?.serverSideEncryption) applyEncryptionHeaders(headers, {\n\t\tmode: EncryptionMode.SseC,\n\t\t...options.serverSideEncryption\n\t});\n\treturn headers;\n}\n/**\n* Appends the documented `b2Content*` response-header overrides to a download\n* URL as query-string parameters. B2 echoes the values into the response\n* headers so callers can control content type, disposition, and caching.\n*\n* @param url - The base download URL.\n* @param options - Caller-supplied download options.\n*\n* @returns The URL with any override parameters appended.\n*/\nfunction appendDownloadOverrides(url, options) {\n\tif (!options) return url;\n\tconst params = [];\n\tfor (const key of DOWNLOAD_OVERRIDE_PARAMS) {\n\t\tconst value = options[key];\n\t\tif (value !== void 0) params.push(`${key}=${encodeURIComponent(value)}`);\n\t}\n\tif (params.length === 0) return url;\n\treturn `${url}${url.includes(\"?\") ? \"&\" : \"?\"}${params.join(\"&\")}`;\n}\n/**\n* Applies file retention headers to the request.\n* @param headers - The mutable headers object to populate.\n* @param retention - The retention settings, or undefined to skip.\n*/\nfunction applyRetentionHeaders(headers, retention) {\n\tif (!retention) return;\n\tif (retention.mode) headers[\"X-Bz-File-Retention-Mode\"] = retention.mode;\n\tif (retention.retainUntilTimestamp) headers[\"X-Bz-File-Retention-Retain-Until-Timestamp\"] = String(retention.retainUntilTimestamp);\n}\n/**\n* Applies the legal hold header to the request.\n* @param headers - The mutable headers object to populate.\n* @param legalHold - The legal hold value, or undefined to skip.\n*/\nfunction applyLegalHoldHeader(headers, legalHold) {\n\tif (!legalHold) return;\n\theaders[\"X-Bz-File-Legal-Hold\"] = legalHold;\n}\n//#endregion\nexport { RawClient, buildFileInfoHeaders, decodeFileName, encodeFileName, parseFileInfoHeaders };\n\n//# sourceMappingURL=index.js.map","import { InMemoryAccountInfo } from \"./auth/in-memory.js\";\nimport { accountId } from \"./types/ids.js\";\nimport \"./util/defaults.js\";\nimport { DEFAULT_RETRY_OPTIONS } from \"./http/retry.js\";\nimport { paginateItems } from \"./util/paginator.js\";\nimport { Bucket } from \"./bucket.js\";\nimport { getRealmUrl } from \"./auth/realms.js\";\nimport { UrlGuard, deriveAllowedSuffixes } from \"./http/url-guard.js\";\nimport { FetchTransport, RetryTransport } from \"./http/transport.js\";\nimport { RawClient } from \"./raw/index.js\";\n//#region src/client.ts\n/**\n* High-level B2 client providing ergonomic access to buckets, files, and keys.\n*\n* @example\n* ```ts\n* const client = new B2Client({\n* applicationKeyId: process.env.B2_APPLICATION_KEY_ID,\n* applicationKey: process.env.B2_APPLICATION_KEY,\n* })\n* await client.authorize()\n* const buckets = await client.listBuckets()\n* ```\n*/\nvar B2Client = class {\n\t/** Low-level client for direct B2 API calls. */\n\traw;\n\t/** Authorization state storage (tokens, URLs, capabilities). */\n\taccountInfo;\n\t/**\n\t* SSRF allow-list applied by the default {@link FetchTransport}. `null` when\n\t* a custom transport was supplied — in that case the SDK does not own the\n\t* guard. Locked down by {@link B2Client.authorize}.\n\t*/\n\turlGuard;\n\tapplicationKeyId;\n\tapplicationKey;\n\trealmUrl;\n\tuserAllowedSuffixes;\n\tresolvedUploadRetryOptions;\n\t/**\n\t* Creates a new B2Client. Call {@link authorize} before making API requests.\n\t* @param options - Configuration including credentials, realm, and transport settings.\n\t*/\n\tconstructor(options) {\n\t\tthis.applicationKeyId = options.applicationKeyId;\n\t\tthis.applicationKey = options.applicationKey;\n\t\tthis.realmUrl = getRealmUrl(options.realm ?? \"production\");\n\t\tthis.accountInfo = options.accountInfo ?? new InMemoryAccountInfo();\n\t\tbindAccountInfoAuthContext(this.accountInfo, this.realmUrl, this.applicationKeyId);\n\t\tthis.userAllowedSuffixes = options.allowedHostSuffixes;\n\t\tthis.resolvedUploadRetryOptions = {\n\t\t\t...DEFAULT_RETRY_OPTIONS,\n\t\t\t...options.retry\n\t\t};\n\t\tlet baseTransport;\n\t\tif (options.transport !== void 0) {\n\t\t\tbaseTransport = options.transport;\n\t\t\tthis.urlGuard = null;\n\t\t} else {\n\t\t\tconst urlGuard = new UrlGuard();\n\t\t\tbaseTransport = new FetchTransport({\n\t\t\t\turlGuard,\n\t\t\t\t...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {},\n\t\t\t\t...options.followSameOriginRedirects !== void 0 ? { followSameOriginRedirects: options.followSameOriginRedirects } : {}\n\t\t\t});\n\t\t\tthis.urlGuard = urlGuard;\n\t\t}\n\t\tconst retryTransport = new RetryTransport({\n\t\t\ttransport: baseTransport,\n\t\t\tretry: this.resolvedUploadRetryOptions,\n\t\t\tonReauth: () => this.reauthorize()\n\t\t});\n\t\tconst cachedAuth = this.accountInfo.getAuth();\n\t\tif (cachedAuth !== null) this.lockUrlGuard(cachedAuth);\n\t\tthis.raw = new RawClient({ transport: retryTransport });\n\t}\n\t/**\n\t* Authenticates with B2 and stores the authorization state. Must be called before other methods.\n\t*\n\t* @returns The authorization response containing tokens, URLs, and capabilities.\n\t*/\n\tasync authorize() {\n\t\tconst auth = await this.raw.authorizeAccount(this.applicationKeyId, this.applicationKey, this.realmUrl);\n\t\tthis.accountInfo.setAuth(auth);\n\t\tthis.lockUrlGuard(auth);\n\t\treturn auth;\n\t}\n\tlockUrlGuard(auth) {\n\t\tif (this.urlGuard !== null) {\n\t\t\tconst derived = deriveAllowedSuffixes(auth.apiInfo.storageApi);\n\t\t\tconst merged = this.userAllowedSuffixes !== void 0 ? this.userAllowedSuffixes.length === 0 ? [] : Array.from(/* @__PURE__ */ new Set([...derived, ...this.userAllowedSuffixes])) : derived;\n\t\t\tthis.urlGuard.setAllowedSuffixes(merged);\n\t\t}\n\t}\n\t/**\n\t* Refresh credentials after a 401. Returns the fresh auth token so\n\t* {@link RetryTransport} can rewrite the in-flight request's\n\t* Authorization header before retrying.\n\t*\n\t* @returns The fresh authorization token.\n\t*/\n\tasync reauthorize() {\n\t\tthis.accountInfo.clear();\n\t\treturn (await this.authorize()).authorizationToken;\n\t}\n\t/**\n\t* Creates a new B2 bucket.\n\t* @param options - Bucket configuration including name, type, and optional settings.\n\t*\n\t* @returns A {@link Bucket} handle for the newly created bucket.\n\t*/\n\tasync createBucket(options) {\n\t\tconst request = {\n\t\t\taccountId: accountId(this.accountInfo.getAccountId()),\n\t\t\t...options\n\t\t};\n\t\tconst info = await this.raw.createBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), request);\n\t\treturn new Bucket(this, info, this.resolvedUploadRetryOptions);\n\t}\n\t/**\n\t* Lists buckets in the account, optionally filtered by ID, name, or type.\n\t* @param options - Optional filters for bucket ID, name, or type.\n\t*\n\t* @returns An array of {@link Bucket} handles.\n\t*/\n\tasync listBuckets(options) {\n\t\treturn (await this.raw.listBuckets(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n\t\t\taccountId: accountId(this.accountInfo.getAccountId()),\n\t\t\t...options\n\t\t})).buckets.map((info) => new Bucket(this, info, this.resolvedUploadRetryOptions));\n\t}\n\t/**\n\t* Looks up a single bucket by name.\n\t* @param bucketName - The name of the bucket to find.\n\t*\n\t* @returns The {@link Bucket} handle, or `null` if not found.\n\t*/\n\tasync getBucket(bucketName) {\n\t\tconst filteredMatch = (await this.listBuckets({ bucketName }))[0];\n\t\tif (filteredMatch !== void 0) return filteredMatch;\n\t\treturn (await this.listBuckets()).find((bucket) => bucket.name === bucketName) ?? null;\n\t}\n\t/**\n\t* Permanently deletes a bucket. The bucket must be empty.\n\t* @param id - The unique identifier of the bucket to delete.\n\t*\n\t* @returns The deleted bucket metadata.\n\t*/\n\tasync deleteBucket(id) {\n\t\treturn this.raw.deleteBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n\t\t\taccountId: accountId(this.accountInfo.getAccountId()),\n\t\t\tbucketId: id\n\t\t});\n\t}\n\t/**\n\t* Creates a new application key with the specified capabilities.\n\t* @param options - Key configuration including capabilities, name, and optional restrictions.\n\t*\n\t* @returns The full key including the secret (only returned at creation time).\n\t*/\n\tasync createKey(options) {\n\t\treturn this.raw.createKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n\t\t\taccountId: accountId(this.accountInfo.getAccountId()),\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Lists application keys in the account.\n\t* @param options - Optional pagination settings.\n\t*\n\t* @returns A page of application keys with an optional continuation token.\n\t*/\n\tasync listKeys(options) {\n\t\treturn this.raw.listKeys(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n\t\t\taccountId: accountId(this.accountInfo.getAccountId()),\n\t\t\t...options?.pageSize !== void 0 ? { maxKeyCount: options.pageSize } : {},\n\t\t\t...options?.startApplicationKeyId !== void 0 ? { startApplicationKeyId: options.startApplicationKeyId } : {}\n\t\t});\n\t}\n\t/**\n\t* Async iterator that yields every application key on the account,\n\t* automatically handling pagination via `listKeys`.\n\t*\n\t* @param options - Pagination + abort options. `pageSize` is forwarded\n\t* to `maxKeyCount`; the default is 1000.\n\t*\n\t* @returns An async iterable of {@link ApplicationKey} entries.\n\t*\n\t* @example\n\t* ```ts\n\t* for await (const key of client.paginateKeys()) {\n\t* console.log(key.keyName, key.capabilities)\n\t* }\n\t* ```\n\t*/\n\tpaginateKeys(options) {\n\t\treturn paginateItems(async (cursor) => {\n\t\t\tconst resp = await this.listKeys({\n\t\t\t\tpageSize: options?.pageSize ?? 1e3,\n\t\t\t\t...cursor !== void 0 ? { startApplicationKeyId: cursor } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tpage: resp,\n\t\t\t\tnextCursor: resp.nextApplicationKeyId ?? void 0\n\t\t\t};\n\t\t}, (page) => page.keys, options?.signal);\n\t}\n\t/**\n\t* Permanently deletes an application key.\n\t* @param applicationKeyId - The unique identifier of the key to delete.\n\t*\n\t* @returns The deleted application key metadata.\n\t*/\n\tasync deleteKey(applicationKeyId) {\n\t\treturn this.raw.deleteKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { applicationKeyId });\n\t}\n\t/**\n\t* Checks whether the authorized application key carries every capability in\n\t* `needed`. Returns the missing capabilities so callers can fail fast with a\n\t* clear error instead of a generic 401/403 from the server.\n\t*\n\t* @param needed - The capabilities required by the planned operation.\n\t*\n\t* @returns An object with `ok: true` when every needed capability is\n\t* present, otherwise `{ ok: false, missing: [...] }`.\n\t*\n\t* @throws If {@link authorize} has not been called yet.\n\t*/\n\thasCapabilities(needed) {\n\t\tconst auth = this.accountInfo.getAuth();\n\t\tif (!auth) throw new Error(\"Not authorized. Call authorize() first.\");\n\t\tconst available = new Set(auth.apiInfo.storageApi.allowed.capabilities);\n\t\tconst missing = needed.filter((cap) => !available.has(cap));\n\t\treturn {\n\t\t\tok: missing.length === 0,\n\t\t\tmissing\n\t\t};\n\t}\n};\nfunction bindAccountInfoAuthContext(accountInfo, realmUrl, applicationKeyId) {\n\taccountInfo.setApplicationKeyId?.(applicationKeyId);\n\taccountInfo.setRealmUrl?.(realmUrl);\n}\n//#endregion\nexport { B2Client };\n\n//# sourceMappingURL=client.js.map","import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Action version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync: bumping `version` in package.json\n * automatically propagates here, into the User-Agent header, and into the\n * bundled `dist/index.js`.\n *\n * Works because:\n * - Node 22+ supports native JSON import attributes.\n * - ncc / webpack statically inlines the JSON at bundle time, so the\n * runtime artifact has the version baked in as a string literal.\n * - TypeScript's `resolveJsonModule` makes the import type-safe.\n */\nexport const VERSION: string = pkg.version\n","import * as core from '@actions/core'\nimport type { AuthorizeAccountResponse, FileVersion } from '@backblaze-labs/b2-sdk'\nimport {\n B2Client,\n type Bucket,\n type HttpTransport,\n InMemoryAccountInfo,\n} from '@backblaze-labs/b2-sdk'\nimport { VERSION } from './version.ts'\n\n/**\n * An authorized B2Client paired with the bucket name the action is scoped\n * to. Returned by {@link buildClient}; consumed by command dispatch sites\n * that need either the high-level client (cross-bucket copy, presign) or\n * the resolved bucket (via {@link getBucket}).\n */\nexport interface AuthorizedClient {\n /** The authorized SDK client. `client.accountInfo` is populated. */\n client: B2Client\n /** The destination bucket name as provided to the action's `bucket` input. */\n bucketName: string\n}\n\n/** Inputs to {@link buildClient}. */\nexport interface BuildClientOptions {\n /** B2 application key ID. Masked via `core.setSecret` by the dispatcher (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked via `core.setSecret` by the dispatcher. */\n applicationKey: string\n /** Target bucket name (stored on the result for later `getBucket` resolution). */\n bucket: string\n /** Override the default B2 realm endpoint. Only set for staging / custom realms. */\n endpoint?: string | undefined\n /** Inject a custom transport (used by tests with the SDK's `B2Simulator`). */\n transport?: HttpTransport | undefined\n}\n\nfunction maskAccountAuthToken(token: string | null | undefined): void {\n if (token) core.setSecret(token)\n}\n\nclass SecretMaskingAccountInfo extends InMemoryAccountInfo {\n // The SDK routes authorize() and transparent reauthorize() through the\n // supplied AccountInfo.setAuth. The reauth masking test is the CI guard for\n // this SDK coupling when the dependency is bumped.\n override setAuth(auth: AuthorizeAccountResponse): void {\n maskAccountAuthToken(auth.authorizationToken)\n super.setAuth(auth)\n }\n}\n\n/**\n * Build an authorized B2Client.\n *\n * Steps:\n * 1. Construct the client with `userAgent: 'b2-github-action/'`. The\n * SDK preserves its own `b2-sdk-typescript/` and `@backblaze-labs/b2-sdk` tokens before\n * ours so Backblaze server-side logs see both attribution layers.\n * 2. `await client.authorize()`. This is one-shot for the lifetime of the\n * action invocation. B2 auth tokens carry a 24h TTL; typical GitHub\n * Actions runs finish well inside that window. If a long-running job\n * outlives the token, the SDK transparently re-authorizes on the next\n * 401, so the action layer does not need its own refresh loop.\n * 3. Use an AccountInfo wrapper that masks each account authorization token\n * as it is stored, including SDK-driven reauthorization after token\n * expiry. The post-authorize mask is kept as a fallback in case a future\n * SDK version bypasses the wrapper for initial authorization.\n *\n * The `transport` parameter is only used by tests (the SDK's B2Simulator\n * provides one). Production callers leave it undefined to use the SDK's\n * default FetchTransport with its built-in SSRF guard.\n */\nexport async function buildClient(options: BuildClientOptions): Promise {\n const userAgent = `b2-github-action/${VERSION}`\n\n const client = new B2Client({\n applicationKeyId: options.applicationKeyId,\n applicationKey: options.applicationKey,\n accountInfo: new SecretMaskingAccountInfo(),\n userAgent,\n ...(options.transport !== undefined ? { transport: options.transport } : {}),\n ...(options.endpoint !== undefined ? { realm: options.endpoint } : {}),\n })\n\n await client.authorize()\n // Deliberately overlaps with setAuth for initial auth. If a future SDK\n // changes authorize() storage, the public AccountInfo getter still masks the\n // stored account token before command code can log.\n maskAccountAuthToken(client.accountInfo.getAuthToken())\n\n return { client, bucketName: options.bucket }\n}\n\n/**\n * Resolve a bucket by name. Throws a clear error rather than the SDK's\n * `undefined` return so the workflow log surfaces the misconfiguration.\n */\nexport async function getBucket(authorized: AuthorizedClient) {\n const bucket = await authorized.client.getBucket(authorized.bucketName)\n if (!bucket) {\n throw new Error(\n `Bucket \"${authorized.bucketName}\" not found, or the application key lacks listBuckets capability for it.`,\n )\n }\n return bucket\n}\n\n/**\n * Resolve an exact file name only when its latest version is an upload. If the\n * latest exact-name version is a hide marker, this intentionally reports the\n * file as not found instead of selecting an older upload from version history\n * or revealing hidden-object existence in default workflow logs. Throws when\n * the latest exact-name state is hidden, deleted, or absent. Used by `copy`,\n * `delete`, and `retention` to resolve a file name to a `fileId` before\n * operating on it.\n *\n * Consistency assumption: B2's `listFileNames` is read-after-write consistent\n * for a recently-uploaded file in the same region. The simulator returns\n * uploads immediately; production B2 in practice does the same, but a caller\n * that chains \"upload then operate on the same name\" across two action steps\n * is relying on observed behavior rather than a documented SLA.\n *\n * @param bucket - The bucket to search.\n * @param fileName - Exact file name (path) to look up.\n * @param bucketDisplayName - Optional label for the error message; defaults\n * to `bucket.name`. Used when looking up in a source bucket distinct from\n * the action's destination bucket (cross-bucket copy).\n */\nexport async function findFileByName(\n bucket: Bucket,\n fileName: string,\n bucketDisplayName?: string,\n): Promise {\n const display = bucketDisplayName ?? bucket.name\n const page = await bucket.listFileNames({ prefix: fileName, pageSize: 1 })\n const exactLatest = page.files.find((f) => f.fileName === fileName)\n if (exactLatest?.action === 'upload') return exactLatest\n\n throw new Error(`File not found in bucket \"${display}\": ${fileName}`)\n}\n","import { Buffer } from 'node:buffer'\nimport { createHash } from 'node:crypto'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { SSE_B2, sseCustomer } from '@backblaze-labs/b2-sdk'\n\nconst CANONICAL_BASE64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/\n\n/**\n * Parse the `sse` input into an SDK {@link EncryptionSetting}.\n *\n * Accepted forms:\n * - `undefined` / empty → no encryption setting passed (B2 still applies any\n * bucket-default SSE-B2; we just don't override it).\n * - `\"B2\"` (case-insensitive) → SSE-B2 with the B2-managed key (no cost).\n * - `\"C:\"` → SSE-C with a customer-provided key. We\n * compute the required base64 MD5 internally so the workflow author\n * doesn't have to.\n *\n * The action runs in Node only, so we use `node:crypto.createHash('md5')`\n * directly rather than the SDK's isomorphic key wrapper. We deliberately do\n * NOT log the key bytes; the only place they ever go is into the\n * `customerKey` field of the SDK setting which the SDK marks as a secret in\n * any error / debug output.\n */\nexport function parseSse(raw: string | undefined): EncryptionSetting | undefined {\n if (raw === undefined || raw === '') return undefined\n\n const normalized = raw.trim()\n if (normalized.toUpperCase() === 'B2') return SSE_B2\n\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n const base64Key = normalized.slice(2).trim()\n if (base64Key === '') {\n throw new Error(\"SSE-C key is empty. Use 'C:'.\")\n }\n // Node's `Buffer.from(str, 'base64')` silently drops invalid chars instead\n // of throwing, so validate the canonical alphabet and padding first.\n if (!CANONICAL_BASE64.test(base64Key)) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const keyBytes = Buffer.from(base64Key, 'base64')\n if (keyBytes.byteLength !== 32) {\n throw new Error(\n `SSE-C key must decode to exactly 32 bytes (256 bits); got ${keyBytes.byteLength}.`,\n )\n }\n const customerKey = keyBytes.toString('base64')\n if (customerKey !== base64Key) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const customerKeyMd5 = createHash('md5').update(keyBytes).digest('base64')\n return sseCustomer(customerKey, customerKeyMd5)\n }\n\n throw new Error(`Invalid 'sse' input: \"${raw}\". Expected \"B2\" or \"C:\".`)\n}\n","import * as core from '@actions/core'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { parseSse } from './sse.ts'\n\n/**\n * Discriminator the action's dispatcher switches on. Matches the values\n * accepted by the `action:` input in `action.yml`. Adding a new verb\n * requires updating this union, the runtime `VALID_ACTIONS` list,\n * `ACTION_EFFECTS`, the dispatcher in `src/main.ts`, and the documentation\n * surfaces.\n */\nexport type ActionName =\n | 'upload'\n | 'download'\n | 'sync'\n | 'copy'\n | 'delete'\n | 'presign'\n | 'list'\n | 'hide'\n | 'unhide'\n | 'verify'\n | 'retention'\n | 'head'\n | 'purge'\n\nconst VALID_ACTIONS: readonly ActionName[] = [\n 'upload',\n 'download',\n 'sync',\n 'copy',\n 'delete',\n 'presign',\n 'list',\n 'hide',\n 'unhide',\n 'verify',\n 'retention',\n 'head',\n 'purge',\n]\n\ntype ActionEffect = {\n readonly kind: 'read' | 'write'\n readonly honorsDryRun: boolean\n}\n\n/**\n * Runtime side-effect policy for each action verb.\n *\n * @internal\n */\nexport const ACTION_EFFECTS = {\n upload: { kind: 'write', honorsDryRun: false },\n download: { kind: 'read', honorsDryRun: false },\n sync: { kind: 'write', honorsDryRun: true },\n copy: { kind: 'write', honorsDryRun: false },\n delete: { kind: 'write', honorsDryRun: true },\n presign: { kind: 'read', honorsDryRun: false },\n list: { kind: 'read', honorsDryRun: false },\n hide: { kind: 'write', honorsDryRun: false },\n unhide: { kind: 'write', honorsDryRun: false },\n verify: { kind: 'read', honorsDryRun: false },\n retention: { kind: 'write', honorsDryRun: false },\n head: { kind: 'read', honorsDryRun: false },\n purge: { kind: 'write', honorsDryRun: true },\n} as const satisfies Record\n\n/** How `sync` decides whether two files match. Drives the SDK's `synchronize()`. */\nexport type CompareMode = 'modtime' | 'size' | 'none'\n/** What `sync` does with destination-only files when reconciling. */\nexport type KeepMode = 'no-delete' | 'delete' | 'keep-days'\n/** Direction of a `sync`: `auto` infers from whether `source` is local or remote. */\nexport type SyncDirection = 'auto' | 'up' | 'down'\n/** B2 Object Lock retention mode. `none` clears any prior retention. */\nexport type RetentionMode = 'compliance' | 'governance' | 'none'\n/** B2 Object Lock legal-hold state. */\nexport type LegalHold = 'on' | 'off'\n\nconst VALID_COMPARE: readonly CompareMode[] = ['modtime', 'size', 'none']\nconst VALID_KEEP: readonly KeepMode[] = ['no-delete', 'delete', 'keep-days']\nconst VALID_DIRECTION: readonly SyncDirection[] = ['auto', 'up', 'down']\nconst VALID_RETENTION_MODE: readonly RetentionMode[] = ['compliance', 'governance', 'none']\nconst VALID_LEGAL_HOLD: readonly LegalHold[] = ['on', 'off']\nconst APPLICATION_KEY_ID_ENV = 'B2_APPLICATION_KEY_ID'\nconst APPLICATION_KEY_ENV = 'B2_APPLICATION_KEY'\nconst FILE_INFO_KEY_PATTERN = /^[a-zA-Z0-9_.`~!#$%^&*'|+-]+$/\nconst FILE_INFO_KEY_MAX_BYTES = 50\nconst FILE_INFO_MAX_ENTRIES = 10\nconst FILE_INFO_TOTAL_MAX_BYTES = 7000\nconst FILE_INFO_TOTAL_MAX_BYTES_WITH_ENCRYPTION = 2048\nconst CONTENT_HEADER_FILE_INFO_KEYS = [\n ['cache-control', 'b2-cache-control'],\n ['content-disposition', 'b2-content-disposition'],\n ['content-language', 'b2-content-language'],\n ['expires', 'b2-expires'],\n] as const\nconst utf8Encoder = new TextEncoder()\n\n/**\n * The fully-parsed, fully-validated action surface. Built by\n * {@link parseInputs} from `INPUT_*` env vars (via `@actions/core`); every\n * command in `src/commands/` consumes a frozen instance of this shape.\n *\n * Most fields map 1:1 to inputs declared in `action.yml`. Defaults and\n * optionality match the YAML surface; see `action.yml` for the user-facing\n * documentation per input.\n */\nexport interface ParsedInputs {\n /** Which verb to dispatch to. */\n action: ActionName\n /** B2 application key ID. Masked at parse time via `core.setSecret` (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked at parse time via `core.setSecret`. */\n applicationKey: string\n /** Destination bucket name for the action. */\n bucket: string\n /** Cross-bucket `copy` source bucket. Undefined means same-bucket copy. */\n sourceBucket: string | undefined\n /**\n * Verb-dependent source. Upload/sync: a local path or glob. Download/copy/\n * delete/presign/list/hide/unhide/verify/retention/head/purge: a B2 file\n * name or prefix (trailing `/` means prefix mode for verbs that support it).\n */\n source: string | undefined\n /**\n * Verb-dependent destination. Upload/sync: B2 file name or prefix.\n * Download: local path. Copy: destination file name. Other verbs: ignored.\n */\n destination: string | undefined\n /** Glob patterns to include during upload/sync expansion. */\n include: string[]\n /** Glob patterns to exclude during upload/sync expansion. Default: `.git/**`. */\n exclude: string[]\n /** Parallel parts/files for upload/sync. */\n concurrency: number\n /** Multipart part size in bytes. Undefined defers to the SDK's recommendation. */\n partSize: number | undefined\n /** Resume an in-progress multipart upload. */\n resume: boolean\n /** Content-Type to set on uploaded objects. Undefined leaves B2's auto-detect. */\n contentType: string | undefined\n /** Custom B2 fileInfo metadata (`X-Bz-Info-*`) to set on uploaded objects. */\n fileInfo: Record\n /** Preserve each local file's mtime as B2 `src_last_modified_millis`. */\n preserveMtime: boolean\n /** Preview without executing (sync/delete/purge). */\n dryRun: boolean\n /** Permit whole-bucket purge when `source` is empty or `/`. */\n allowBucketPurge: boolean\n /** Presigned-URL TTL in seconds. */\n presignTtlSeconds: number\n /** Override B2 realm endpoint for staging / custom realms. */\n endpoint: string | undefined\n /** Fail the action when upload/sync matches zero files. */\n failOnEmpty: boolean\n /** Raw `sse:` input value as the user typed it. Retained for diagnostics. */\n sse: string | undefined\n /** Parsed SSE specification ready to hand to the SDK. */\n encryption: EncryptionSetting | undefined\n /** How `sync` compares files. */\n compareMode: CompareMode\n /** How `sync` treats destination-only files. */\n keepMode: KeepMode\n /** Direction of a `sync` (auto-detected when set to `auto`). */\n syncDirection: SyncDirection\n /** Cap on listed/presigned entries for `list` and prefix `presign`. */\n maxResults: number\n /** Literal SHA-1 to compare against in `verify` (when set, no local read). */\n expectedSha1: string | undefined\n /** Object Lock retention mode to apply (`retention` verb). */\n retentionMode: RetentionMode | undefined\n /** ISO-8601 timestamp until which retention applies. Required with `retentionMode`. */\n retentionUntil: string | undefined\n /** Legal-hold state to apply (`retention` verb). */\n legalHold: LegalHold | undefined\n /** Allow shortening a governance-mode retention (requires key capability). */\n bypassGovernance: boolean\n}\n\n/**\n * Sensitive raw values that can appear in parser-scope errors before\n * {@link parseInputs} returns its structured output.\n */\nexport function collectInputSecretsForScrubbing(): string[] {\n const secretValues = new Set()\n addSecretValue(secretValues, core.getInput('application-key-id'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ID_ENV])\n addSecretValue(secretValues, core.getInput('application-key'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ENV])\n addSseSecretValue(secretValues, core.getInput('sse'))\n return [...secretValues]\n}\n\n/**\n * Parse and validate inputs.\n *\n * Credentials lookup order:\n *\n * 1. `application-key-id` / `application-key` action inputs\n * 2. `B2_APPLICATION_KEY_ID` / `B2_APPLICATION_KEY` env vars (the official\n * contract used by the Backblaze b2 CLI and the @backblaze-labs/b2-sdk).\n *\n * The credential value, once resolved, is immediately masked via `core.setSecret`\n * so any accidental echo (including from a misbehaving sub-process) is redacted\n * in workflow logs.\n */\nexport function parseInputs(): ParsedInputs {\n const action = parseEnum('action', required('action').toLowerCase(), VALID_ACTIONS)\n\n const applicationKeyId = resolveCredential('application-key-id', APPLICATION_KEY_ID_ENV)\n const applicationKey = resolveCredential('application-key', APPLICATION_KEY_ENV)\n // The keyId is identifying (not the secret half of the HMAC pair), but mask\n // it anyway for defense in depth: the canonical AWS analogue mask AKIA-style\n // IDs in CI logs, and masking costs nothing in debuggability since the user\n // already knows which key they passed.\n core.setSecret(applicationKeyId)\n core.setSecret(applicationKey)\n\n const bucket = required('bucket')\n const sourceBucket = optional('source-bucket')\n const allowBucketPurge = parseBool(\n 'allow-bucket-purge',\n core.getInput('allow-bucket-purge') || 'false',\n )\n const source = optionalSource(action, allowBucketPurge)\n const destination = optional('destination')\n\n const include = splitCsv(optional('include'))\n const exclude = splitCsv(optional('exclude'))\n\n const concurrency = parsePositiveInt('concurrency', core.getInput('concurrency') || '4')\n const partSizeInput = optional('part-size')\n const partSize =\n partSizeInput !== undefined ? parsePositiveInt('part-size', partSizeInput) : undefined\n\n const resume = parseBool('resume', core.getInput('resume') || 'true')\n const dryRun = parseBool('dry-run', core.getInput('dry-run') || 'false')\n const failOnEmpty = parseBool('fail-on-empty', core.getInput('fail-on-empty') || 'true')\n const bypassGovernance = parseBool(\n 'bypass-governance',\n core.getInput('bypass-governance') || 'false',\n )\n\n const presignTtlSeconds = parsePositiveInt('presign-ttl', core.getInput('presign-ttl') || '3600')\n const maxResults = parsePositiveInt('max-results', core.getInput('max-results') || '1000')\n\n const endpoint = optional('endpoint')\n const sse = optional('sse')\n const encryption = parseSse(sse)\n\n const contentType = optional('content-type')\n const fileInfo = parseFileInfo(optional('file-info'))\n for (const [inputName, fileInfoKey] of CONTENT_HEADER_FILE_INFO_KEYS) {\n addFileInfo(fileInfo, fileInfoKey, optional(inputName), inputName, { allowReserved: true })\n }\n validateFileInfo(fileInfo, uploadFileInfoTotalMaxBytes(encryption))\n const preserveMtime = parseBool('preserve-mtime', core.getInput('preserve-mtime') || 'false')\n if (preserveMtime && Object.hasOwn(fileInfo, 'src_last_modified_millis')) {\n throw new Error(`Duplicate fileInfo key \"src_last_modified_millis\" from 'preserve-mtime' input`)\n }\n const expectedSha1 = optional('expected-sha1')\n const retentionUntil = optional('retention-until')\n\n const compareMode = parseEnum(\n 'compare-mode',\n (core.getInput('compare-mode') || 'modtime').toLowerCase(),\n VALID_COMPARE,\n )\n const keepMode = parseEnum(\n 'keep-mode',\n (core.getInput('keep-mode') || 'no-delete').toLowerCase(),\n VALID_KEEP,\n )\n const syncDirection = parseEnum(\n 'direction',\n (core.getInput('direction') || 'auto').toLowerCase(),\n VALID_DIRECTION,\n )\n const retentionMode = parseOptionalEnum(\n 'retention-mode',\n optional('retention-mode')?.toLowerCase(),\n VALID_RETENTION_MODE,\n )\n const legalHold = parseOptionalEnum(\n 'legal-hold',\n optional('legal-hold')?.toLowerCase(),\n VALID_LEGAL_HOLD,\n )\n\n return {\n action,\n applicationKeyId,\n applicationKey,\n bucket,\n sourceBucket,\n source,\n destination,\n include,\n exclude,\n concurrency,\n partSize,\n resume,\n contentType,\n fileInfo,\n preserveMtime,\n dryRun,\n allowBucketPurge,\n presignTtlSeconds,\n endpoint,\n failOnEmpty,\n sse,\n encryption,\n compareMode,\n keepMode,\n syncDirection,\n maxResults,\n expectedSha1,\n retentionMode,\n retentionUntil,\n legalHold,\n bypassGovernance,\n }\n}\n\n/**\n * Validate that `inputs.source` is set and non-empty, returning the value.\n * Throws a uniform error message naming the verb so the workflow log surfaces\n * exactly what's missing. Commands that allow an empty-string source for\n * special semantics (e.g. `purge` with explicit whole-bucket scope) should\n * not use this helper.\n */\nexport function requireSource(\n source: string | undefined,\n verb: string,\n description?: string,\n): string {\n if (source === undefined || source === '') {\n const tail = description !== undefined ? ` (${description})` : ''\n throw new Error(`'source' input is required for '${verb}' action${tail}`)\n }\n return source\n}\n\n/**\n * Validate that `raw` is one of `valid`, narrowing the return type.\n *\n * Replaces the previous pattern of one type-guard + one throw per enum:\n *\n * const x = parseEnum('compare-mode', raw, VALID_COMPARE)\n *\n * Throws a uniform error message that lists the legal values.\n *\n * @internal\n */\nexport function parseEnum(name: string, raw: string, valid: readonly T[]): T {\n if ((valid as readonly string[]).includes(raw)) return raw as T\n throw new Error(`Invalid '${name}' input: \"${raw}\". Must be one of: ${valid.join(', ')}`)\n}\n\n/**\n * Like {@link parseEnum} but passes through `undefined`. Used for inputs that\n * are optional but, when set, must be one of a known set.\n */\nfunction parseOptionalEnum(\n name: string,\n raw: string | undefined,\n valid: readonly T[],\n): T | undefined {\n return raw === undefined ? undefined : parseEnum(name, raw, valid)\n}\n\nfunction required(name: string): string {\n // `@actions/core` throws on missing required inputs, so this never returns\n // empty. Wrapping the call only exists so the throw site has a uniform\n // shape with the rest of the input parsers.\n return core.getInput(name, { required: true })\n}\n\nfunction optional(name: string): string | undefined {\n const v = core.getInput(name)\n return v === '' ? undefined : v\n}\n\nfunction optionalSource(action: ActionName, allowBucketPurge: boolean): string | undefined {\n const v = core.getInput('source')\n if (v !== '') return v\n return action === 'purge' && allowBucketPurge ? '' : undefined\n}\n\nfunction addSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined || value === '') return\n const trimmed = value.trim()\n for (const secret of new Set([value, trimmed])) {\n if (secret === '' || secretValues.has(secret)) continue\n core.setSecret(secret)\n secretValues.add(secret)\n }\n}\n\nfunction addSseSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined) return\n const normalized = value.trim()\n if (normalized === '' || normalized.toUpperCase() === 'B2') return\n\n addSecretValue(secretValues, value)\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n addSecretValue(secretValues, normalized.slice(2).trim())\n }\n}\n\nfunction resolveCredential(inputName: string, envName: string): string {\n const fromInput = optional(inputName)\n if (fromInput !== undefined) return fromInput\n\n const fromEnv = process.env[envName]\n if (fromEnv !== undefined && fromEnv !== '') return fromEnv\n\n throw new Error(`Missing credential: set input '${inputName}' or env var '${envName}'`)\n}\n\n/**\n * Parse a comma-separated action input, trimming entries and dropping blanks.\n *\n * @internal\n */\nexport function splitCsv(value: string | undefined): string[] {\n if (value === undefined) return []\n return value\n .split(',')\n .map((s) => s.trim())\n .filter((s) => s.length > 0)\n}\n\n/**\n * Parse upload fileInfo metadata from newline-delimited or simple\n * comma-separated `key=value` entries. Newline mode preserves commas inside\n * values.\n *\n * @internal\n */\nexport function parseFileInfo(value: string | undefined): Record {\n if (value === undefined || value.trim() === '') return {}\n const pairs = /[\\r\\n]/.test(value) ? value.split(/\\r?\\n|\\r/) : value.split(',')\n const fileInfo: Record = {}\n\n for (const rawPair of pairs) {\n const pair = rawPair.trim()\n if (pair === '') continue\n const equalsIndex = pair.indexOf('=')\n if (equalsIndex <= 0) {\n throw new Error(`Invalid 'file-info' entry \"${pair}\". Expected key=value.`)\n }\n const key = pair.slice(0, equalsIndex).trim()\n const parsedValue = pair.slice(equalsIndex + 1).trim()\n addFileInfo(fileInfo, key, parsedValue, 'file-info', { allowReserved: false })\n }\n\n return fileInfo\n}\n\ninterface AddFileInfoOptions {\n allowReserved: boolean\n}\n\nfunction addFileInfo(\n fileInfo: Record,\n key: string,\n value: string | undefined,\n inputName: string,\n options: AddFileInfoOptions,\n): void {\n if (value === undefined) return\n const canonicalKey = key.toLowerCase()\n if (!options.allowReserved && canonicalKey.startsWith('b2-')) {\n throw new Error(\n `Reserved fileInfo key \"${key}\" from '${inputName}' input must use the dedicated upload inputs such as content-type, cache-control, content-disposition, content-language, or expires`,\n )\n }\n if (Object.hasOwn(fileInfo, canonicalKey)) {\n throw new Error(`Duplicate fileInfo key \"${key}\" from '${inputName}' input`)\n }\n fileInfo[canonicalKey] = value\n}\n\n/**\n * Return the upload fileInfo byte budget for the active encryption mode.\n *\n * @internal\n */\nexport function uploadFileInfoTotalMaxBytes(encryption: EncryptionSetting | undefined): number {\n return encryption === undefined\n ? FILE_INFO_TOTAL_MAX_BYTES\n : FILE_INFO_TOTAL_MAX_BYTES_WITH_ENCRYPTION\n}\n\n/**\n * Validate upload fileInfo metadata before forwarding it to the B2 SDK.\n *\n * @internal\n */\nexport function validateFileInfo(\n fileInfo: Record,\n totalMaxBytes = FILE_INFO_TOTAL_MAX_BYTES,\n): void {\n const entries = Object.entries(fileInfo)\n if (entries.length > FILE_INFO_MAX_ENTRIES) {\n throw new Error(`Invalid fileInfo: ${entries.length} entries exceeds ${FILE_INFO_MAX_ENTRIES}`)\n }\n\n let totalBytes = 0\n const seenCanonicalKeys = new Set()\n for (const [key, value] of entries) {\n const canonicalKey = key.toLowerCase()\n if (seenCanonicalKeys.has(canonicalKey)) {\n throw new Error(`Duplicate fileInfo key \"${key}\" from upload metadata`)\n }\n seenCanonicalKeys.add(canonicalKey)\n\n if (!FILE_INFO_KEY_PATTERN.test(key)) {\n throw new Error(\n `Invalid fileInfo key \"${key}\" from 'file-info'. Keys must match ${FILE_INFO_KEY_PATTERN.source}`,\n )\n }\n\n const keyBytes = utf8Encoder.encode(key).byteLength\n if (keyBytes > FILE_INFO_KEY_MAX_BYTES) {\n throw new Error(\n `Invalid fileInfo key \"${key}\": ${keyBytes} bytes exceeds ${FILE_INFO_KEY_MAX_BYTES}`,\n )\n }\n\n const valueBytes = utf8Encoder.encode(value).byteLength\n const remainingValueBytes = Math.max(0, totalMaxBytes - totalBytes - keyBytes)\n if (valueBytes > remainingValueBytes) {\n throw new Error(\n `Invalid fileInfo value for \"${key}\": ${valueBytes} bytes exceeds ${remainingValueBytes}`,\n )\n }\n totalBytes += keyBytes + valueBytes\n }\n\n if (totalBytes > totalMaxBytes) {\n throw new Error(`Invalid fileInfo: total size ${totalBytes} bytes exceeds ${totalMaxBytes}`)\n }\n}\n\n/**\n * Parse the documented boolean input spellings accepted by this action.\n *\n * @internal\n */\nexport function parseBool(name: string, raw: string): boolean {\n const v = raw.trim().toLowerCase()\n if (v === 'true' || v === '1' || v === 'yes') return true\n if (v === 'false' || v === '0' || v === 'no') return false\n throw new Error(`Invalid boolean for '${name}': \"${raw}\"`)\n}\n\n/**\n * Parse a strictly positive integer input.\n *\n * @internal\n */\nexport function parsePositiveInt(name: string, raw: string): number {\n const trimmed = raw.trim()\n const n = Number(trimmed)\n if (!/^\\d+$/.test(trimmed) || n <= 0 || !Number.isSafeInteger(n)) {\n throw new Error(`Invalid positive integer for '${name}': \"${raw}\"`)\n }\n return n\n}\n","import * as core from '@actions/core'\nimport type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link copyCommand}. Single-file (copy is always one-source-one-destination). */\nexport interface CopyResult {\n /** Source bucket name. */\n sourceBucket: string\n /** Source file name (the B2 key in the source bucket). */\n sourceFileName: string\n /** Destination bucket name. */\n destinationBucket: string\n /** Destination file name (the B2 key in the destination bucket). */\n destinationFileName: string\n /** B2 file ID of the newly-created destination object. */\n fileId: string\n /** Byte size of the copied object. */\n size: number\n}\n\n/**\n * Server-side copy of one B2 object to a new name, within the same bucket or\n * across two buckets in the same account.\n *\n * The copy is done by reference (`b2_copy_file` for small, `b2_copy_part` for\n * large): bytes never traverse the runner. This is dramatically faster and\n * cheaper than download-then-reupload for any non-trivial file.\n *\n * Cross-bucket: set `source-bucket` to the source bucket name. The action's\n * `bucket` input is the destination. The application key must have read\n * permission on the source bucket and write permission on the destination.\n */\nexport async function copyCommand(\n client: B2Client,\n destinationBucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'copy', 'the source B2 file name')\n const destination = inputs.destination\n if (destination === undefined || destination === '') {\n throw new Error(\n \"'destination' input is required for 'copy' action (the destination B2 file name)\",\n )\n }\n\n const sourceBucketName = inputs.sourceBucket ?? destinationBucket.name\n const sourceBucket =\n sourceBucketName === destinationBucket.name\n ? destinationBucket\n : await client.getBucket(sourceBucketName)\n if (!sourceBucket) {\n throw new Error(`Source bucket \"${sourceBucketName}\" not found, or key lacks listBuckets.`)\n }\n\n const hit = await findFileByName(sourceBucket, source, sourceBucketName)\n\n core.startGroup(\n `copy b2://${sourceBucketName}/${source} → b2://${destinationBucket.name}/${destination}`,\n )\n try {\n const recommendedPartSize = client.accountInfo.getRecommendedPartSize()\n const isLarge = hit.contentLength > recommendedPartSize\n const copyOptions = {\n sourceFileId: hit.fileId,\n fileName: destination,\n ...(sourceBucketName !== destinationBucket.name\n ? { destinationBucketId: destinationBucket.id }\n : {}),\n }\n\n const result = isLarge\n ? await destinationBucket.copyLargeFile({\n ...copyOptions,\n ...(signal !== undefined ? { signal } : {}),\n })\n : await destinationBucket.copyFile(copyOptions)\n\n core.info(` copied → fileId=${result.fileId}, size=${result.contentLength}`)\n return {\n sourceBucket: sourceBucketName,\n sourceFileName: source,\n destinationBucket: destinationBucket.name,\n destinationFileName: destination,\n fileId: result.fileId,\n size: result.contentLength,\n }\n } finally {\n core.endGroup()\n }\n}\n","import type {\n Bucket,\n DeleteAllDeleteEvent,\n DeleteAllErrorEvent,\n DeleteAllSkipEvent,\n FileAction,\n} from '@backblaze-labs/b2-sdk'\n\nconst DELETE_FAILED_MESSAGE = 'delete failed'\nconst OUT_OF_PREFIX_MESSAGE = 'listed file is outside requested prefix'\n\n// SDK-deleteAll-compatible events with local extensions for this bypass-governance shim.\nexport type DeleteAllVersionsDeleteEvent = DeleteAllDeleteEvent & {\n readonly action: FileAction\n}\n\nexport type DeleteAllVersionsEvent =\n | DeleteAllVersionsDeleteEvent\n | DeleteAllErrorEvent\n | DeleteAllSkipEvent\n\nexport interface DeleteAllVersionsOptions {\n prefix?: string\n dryRun: boolean\n bypassGovernance: boolean\n signal?: AbortSignal\n}\n\nexport async function* deleteAllVersions(\n bucket: Bucket,\n options: DeleteAllVersionsOptions,\n): AsyncGenerator {\n const versions = bucket.paginateFileVersions({\n ...(options.prefix !== undefined ? { prefix: options.prefix } : {}),\n ...(options.signal !== undefined ? { signal: options.signal } : {}),\n })\n\n while (true) {\n options.signal?.throwIfAborted()\n const next = await versions.next()\n options.signal?.throwIfAborted()\n if (next.done === true) break\n\n const version = next.value\n if (options.prefix !== undefined && !version.fileName.startsWith(options.prefix)) {\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: OUT_OF_PREFIX_MESSAGE,\n }\n continue\n }\n\n if (options.dryRun) {\n yield { type: 'skip', fileName: version.fileName, fileId: version.fileId }\n continue\n }\n\n options.signal?.throwIfAborted()\n try {\n if (options.bypassGovernance) {\n await bucket.deleteFileVersion(version.fileName, version.fileId, {\n bypassGovernance: true,\n })\n } else {\n await bucket.deleteFileVersion(version.fileName, version.fileId)\n }\n yield {\n type: 'delete',\n fileName: version.fileName,\n fileId: version.fileId,\n action: version.action,\n }\n } catch (error) {\n options.signal?.throwIfAborted()\n if (isAbortError(error)) throw error\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: DELETE_FAILED_MESSAGE,\n }\n }\n\n options.signal?.throwIfAborted()\n }\n}\n\nfunction isAbortError(error: unknown): boolean {\n return error instanceof Error && error.name === 'AbortError'\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link DeleteResult.files}. */\nexport interface DeletedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** True for dry-run previews; the file was not actually deleted. */\n skipped: boolean\n}\n\n/** Result of {@link deleteCommand}. */\nexport interface DeleteResult {\n /** One entry per matched file version (including hide markers). */\n files: DeletedFile[]\n /** Count of individual-file delete failures (non-fatal; sums into the dispatcher's `core.setFailed`). */\n errors: number\n}\n\n/**\n * Delete files from B2.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and delete every version\n * matching it.\n * - Otherwise delete the single file by name. We look up the latest version\n * via `listFileNames` to get its `fileId` and call `deleteFileVersion`.\n *\n * With `dry-run: true`, no actual deletions happen; the action reports what\n * would have been deleted.\n */\nexport async function deleteCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'delete', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n if (isPrefix) {\n return deletePrefix(bucket, source, inputs.dryRun, inputs.bypassGovernance, signal)\n }\n return deleteOne(bucket, source, inputs.dryRun, inputs.bypassGovernance)\n}\n\nasync function deletePrefix(\n bucket: Bucket,\n prefix: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n signal?: AbortSignal,\n): Promise {\n const files: DeletedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} prefix b2://${bucket.name}/${prefix}`)\n try {\n for await (const event of deleteAllVersions(bucket, {\n prefix,\n dryRun,\n bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n })) {\n if (event.type === 'delete') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: false })\n core.info(` deleted ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: true })\n core.info(` would delete ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to delete ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n\nasync function deleteOne(\n bucket: Bucket,\n fileName: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n): Promise {\n const hit = await findFileByName(bucket, fileName)\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} b2://${bucket.name}/${fileName}`)\n try {\n if (dryRun) {\n core.info(` would delete ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: true }],\n errors: 0,\n }\n }\n if (bypassGovernance) {\n await bucket.deleteFileVersion(fileName, hit.fileId, { bypassGovernance: true })\n } else {\n await bucket.deleteFileVersion(fileName, hit.fileId)\n }\n core.info(` deleted ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: false }],\n errors: 0,\n }\n } finally {\n core.endGroup()\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream/promises\");","import type { Stats } from 'node:fs'\nimport { stat } from 'node:fs/promises'\n\n/**\n * `stat(path)` that returns `undefined` instead of throwing on ENOENT/EACCES\n * etc. Used at filesystem boundaries where the caller wants to distinguish\n * \"doesn't exist / not readable\" from \"exists with shape X\" without juggling\n * try/catch at every call site.\n */\nexport async function tryStat(path: string): Promise {\n return stat(path).catch(() => undefined)\n}\n","/**\n * Format a byte count with KB/MB/GB suffixes.\n *\n * Single source of truth so the workflow log (progress.ts) and the step\n * summary table (summary.ts) never drift on thresholds or rounding.\n */\nexport function formatBytes(n: number): string {\n if (n < 1024) return `${n} B`\n if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`\n if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`\n return `${(n / 1024 / 1024 / 1024).toFixed(2)} GB`\n}\n","import * as core from '@actions/core'\nimport type { ProgressEvent, ProgressListener } from '@backblaze-labs/b2-sdk'\nimport { formatBytes } from './format.ts'\n\n/**\n * Build a progress listener that throttles output to one update per\n * `intervalMs` (default 1s) so a long-running upload doesn't flood the\n * workflow log with thousands of lines. The first event and the final\n * event are always emitted.\n */\nexport function makeProgressListener(label: string, intervalMs = 1000): ProgressListener {\n let lastEmit = 0\n let lastBytes = 0\n let lastTime = Date.now()\n\n return (event: ProgressEvent) => {\n const now = Date.now()\n const isFirst = lastEmit === 0\n const isFinal = event.totalBytes !== null && event.bytesTransferred >= event.totalBytes\n const due = now - lastEmit >= intervalMs\n\n if (!isFirst && !isFinal && !due) return\n\n const elapsedMs = Math.max(1, now - lastTime)\n const deltaBytes = event.bytesTransferred - lastBytes\n const mbps = (deltaBytes / 1024 / 1024) * (1000 / elapsedMs)\n\n const pct =\n event.totalBytes !== null && event.totalBytes > 0\n ? `${Math.round((event.bytesTransferred / event.totalBytes) * 100)}%`\n : '?%'\n\n const parts =\n event.totalParts !== null ? ` (${event.partsCompleted}/${event.totalParts} parts)` : ''\n\n const totalSuffix = event.totalBytes !== null ? ` / ${formatBytes(event.totalBytes)}` : ''\n core.info(\n `${label} ${pct}${parts} ${formatBytes(event.bytesTransferred)}${totalSuffix} @ ${mbps.toFixed(2)} MB/s`,\n )\n\n lastEmit = now\n lastBytes = event.bytesTransferred\n lastTime = now\n }\n}\n","import { randomUUID } from 'node:crypto'\nimport { createWriteStream } from 'node:fs'\nimport { mkdir, realpath, rename, unlink, writeFile } from 'node:fs/promises'\nimport { dirname, isAbsolute, relative, resolve, sep } from 'node:path'\nimport { Readable, Transform } from 'node:stream'\nimport { pipeline } from 'node:stream/promises'\nimport * as core from '@actions/core'\nimport type { Bucket, SseCDownloadKey } from '@backblaze-labs/b2-sdk'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link DownloadResult.files}. */\nexport interface DownloadedFile {\n /** B2 file name (the key that was fetched). */\n fileName: string\n /** Absolute path on the runner where the body landed. */\n localPath: string\n /** Byte size of the downloaded body. */\n size: number\n /** Remote SHA-1, or `null` if the file was multipart-uploaded (B2 doesn't store a whole-file SHA-1 in that case). */\n contentSha1: string | null\n}\n\n/** Result of {@link downloadCommand}. */\nexport interface DownloadResult {\n /** One entry per downloaded file. Single-file modes return a one-element array. */\n files: DownloadedFile[]\n /** Total bytes transferred across all files. */\n bytesTransferred: number\n}\n\ninterface PathSafetyContext {\n realRoot: string\n safeAncestorDirs: Set\n}\n\ninterface DownloadPathSafety {\n root: string\n realRoot: string\n}\n\ninterface PlannedDownload {\n fileName: string\n localPath: string\n}\n\ninterface LocalPathOwner {\n fileName: string\n localPath: string\n}\n\ninterface ReplaceDownloadedFileOptions {\n platform?: NodeJS.Platform\n renameFile?: typeof rename\n unlinkFile?: typeof unlink\n}\n\n/**\n * Download from B2 to the local runner.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and download every file\n * under it to the local directory at `destination` (defaults to `.`).\n * - Otherwise download a single file. If `destination` ends with `/` or\n * resolves to an existing directory, write into that directory using the\n * basename of `source`. Else `destination` is the exact output file path.\n * If unset, the file's basename is used in the current working directory.\n */\nexport async function downloadCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'download', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n const sseDownload = sseFromInputs(inputs)\n\n if (isPrefix) {\n return downloadPrefix(bucket, source, inputs.destination ?? '.', sseDownload, signal)\n }\n const out = await downloadOne(bucket, source, inputs.destination, sseDownload, signal)\n return { files: [out], bytesTransferred: out.size }\n}\n\nfunction sseFromInputs(inputs: ParsedInputs): SseCDownloadKey | undefined {\n const e = inputs.encryption\n if (e === undefined || e.mode !== 'SSE-C') return undefined\n return {\n algorithm: 'AES256',\n customerKey: e.customerKey,\n customerKeyMd5: e.customerKeyMd5,\n }\n}\n\nasync function downloadPrefix(\n bucket: Bucket,\n prefix: string,\n destinationDir: string,\n sseDownload: SseCDownloadKey | undefined,\n signal?: AbortSignal,\n): Promise {\n const destRoot = resolve(destinationDir)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n const downloadPathSafety = { root: destRoot, realRoot: pathSafety.realRoot }\n const caseInsensitivePaths = await isCaseInsensitiveDirectory(destRoot)\n\n const planned: PlannedDownload[] = []\n const localPathOwners = new Map()\n const localPathAncestorOwners = new Map()\n let startFileName: string | undefined\n\n for (;;) {\n signal?.throwIfAborted()\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n signal?.throwIfAborted()\n // `listFileNames({ prefix })` returns files matching `prefix` per the\n // SDK / B2 contract, so the slice is always safe. Empty `prefix`\n // leaves the name unchanged.\n const relName = f.fileName.slice(prefix.length)\n const localPath = await resolvePathUnderRoot(\n destRoot,\n safeRemotePathSegments(relName, f.fileName),\n f.fileName,\n pathSafety,\n )\n recordPlannedLocalPath(\n { fileName: f.fileName, localPath },\n destRoot,\n caseInsensitivePaths,\n localPathOwners,\n localPathAncestorOwners,\n )\n planned.push({ fileName: f.fileName, localPath })\n }\n // SDK contract: `nextFileName` is `string | null` per `ListFileNamesResponse`.\n // The \"not null\" arm fires for prefixes with >1000 files (covered by\n // the real-pagination test in coverage-stress).\n if (page.nextFileName === null) break\n startFileName = page.nextFileName\n }\n\n const files: DownloadedFile[] = []\n let total = 0\n for (const plan of planned) {\n signal?.throwIfAborted()\n core.startGroup(`download b2://${bucket.name}/${plan.fileName} → ${plan.localPath}`)\n try {\n const r = await downloadOne(\n bucket,\n plan.fileName,\n plan.localPath,\n sseDownload,\n signal,\n downloadPathSafety,\n )\n files.push(r)\n total += r.size\n } finally {\n core.endGroup()\n }\n }\n\n return { files, bytesTransferred: total }\n}\n\nasync function downloadOne(\n bucket: Bucket,\n fileName: string,\n destination: string | undefined,\n sseDownload: SseCDownloadKey | undefined,\n signal?: AbortSignal,\n pathSafety?: DownloadPathSafety,\n): Promise {\n const localPath =\n pathSafety !== undefined && destination !== undefined\n ? resolve(destination)\n : await resolveLocalPath(fileName, destination)\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n await mkdir(dirname(localPath), { recursive: true })\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n\n const result = await bucket.download(fileName, {\n ...(sseDownload !== undefined ? { serverSideEncryption: sseDownload } : {}),\n ...(signal !== undefined ? { signal } : {}),\n })\n const size = result.headers.contentLength\n const sha1 = result.headers.contentSha1\n\n // Wrap the body in a byte-counting Transform that synthesizes ProgressEvents\n // for the shared progress listener. The SDK doesn't expose progress for\n // single-shot downloads; we compute it here from the known content-length.\n const onProgress = makeProgressListener(`download[${fileName}]`)\n const startedAt = Date.now()\n let bytesSeen = 0\n const counter = new Transform({\n transform(chunk: Buffer, _enc, cb) {\n // The transform only runs when the body has bytes to push; for a zero-\n // length response Node's stream pipeline closes without invoking it,\n // so `size` is provably > 0 here.\n bytesSeen += chunk.length\n onProgress({\n bytesTransferred: bytesSeen,\n totalBytes: size,\n partsCompleted: 0,\n totalParts: null,\n elapsedMs: Date.now() - startedAt,\n })\n cb(null, chunk)\n },\n })\n\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n const tempPath = `${localPath}.b2-action-download-${randomUUID()}.tmp`\n const writeStream = createWriteStream(tempPath, { flags: 'wx' })\n try {\n await pipeline(\n Readable.fromWeb(result.body as unknown as Parameters[0]),\n counter,\n writeStream,\n )\n await replaceDownloadedFile(tempPath, localPath)\n } catch (err) {\n // Partial download on disk is worse than no file. Write through a\n // same-directory temporary file and rename only after the body completes,\n // which also avoids following an existing symlink at the final leaf.\n try {\n await unlink(tempPath)\n } catch {\n // ignore: best-effort cleanup, the original error matters more\n }\n throw err\n }\n\n core.info(` wrote ${size} bytes to ${localPath} (sha1=${sha1 ?? 'multipart'})`)\n\n return { fileName, localPath, size, contentSha1: sha1 }\n}\n\n/**\n * Atomically move a completed same-directory download into place.\n *\n * @internal\n */\nexport async function replaceDownloadedFile(\n tempPath: string,\n localPath: string,\n {\n platform = process.platform,\n renameFile = rename,\n unlinkFile = unlink,\n }: ReplaceDownloadedFileOptions = {},\n): Promise {\n try {\n await renameFile(tempPath, localPath)\n } catch (renameError) {\n const retryWindowsOverwrite =\n platform === 'win32' &&\n typeof renameError === 'object' &&\n renameError !== null &&\n 'code' in renameError &&\n (renameError.code === 'EEXIST' || renameError.code === 'EPERM')\n if (!retryWindowsOverwrite) throw renameError\n\n // Windows refuses to rename over an existing leaf. Remove only the leaf\n // path, which unlinks symlinks instead of following them, then retry the\n // completed same-directory temp-file move.\n try {\n await unlinkFile(localPath)\n } catch (unlinkError) {\n if (!isFileNotFound(unlinkError)) throw unlinkError\n }\n await renameFile(tempPath, localPath)\n }\n}\n\n/**\n * Resolve the local target path for a single B2 download.\n *\n * @internal\n */\nexport async function resolveLocalPath(\n fileName: string,\n destination: string | undefined,\n): Promise {\n if (destination === undefined || destination === '') {\n return resolve(safeRemotePathTail(fileName))\n }\n if (destination.endsWith('/') || destination.endsWith('\\\\')) {\n const destRoot = resolve(destination)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n const s = await tryStat(destination)\n if (s?.isDirectory()) {\n const destRoot = resolve(destination)\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n return resolve(destination)\n}\n\nasync function resolvePathUnderRoot(\n root: string,\n segments: string[],\n fileName: string,\n pathSafety: PathSafetyContext,\n) {\n const localPath = resolve(root, ...segments)\n const rel = relative(root, localPath)\n if (!isPathInsideRootRelative(rel)) {\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n }\n await assertExistingAncestryInsideRoot(pathSafety, localPath, fileName)\n return localPath\n}\n\nfunction isPathInsideRootRelative(rel: string): boolean {\n return rel === '' || (!isAbsolute(rel) && rel !== '..' && !rel.startsWith(`..${sep}`))\n}\n\nasync function createPathSafetyContext(root: string): Promise {\n return { realRoot: await realpath(root), safeAncestorDirs: new Set([root]) }\n}\n\nasync function assertFreshAncestryInsideRoot(\n pathSafety: DownloadPathSafety,\n localPath: string,\n fileName: string,\n): Promise {\n await assertExistingAncestryInsideRoot(\n { realRoot: pathSafety.realRoot, safeAncestorDirs: new Set() },\n localPath,\n fileName,\n )\n}\n\nasync function assertExistingAncestryInsideRoot(\n pathSafety: PathSafetyContext,\n localPath: string,\n fileName: string,\n): Promise {\n let candidate = dirname(localPath)\n const checkedDirs: string[] = []\n\n for (;;) {\n if (pathSafety.safeAncestorDirs.has(candidate)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n checkedDirs.push(candidate)\n try {\n const realCandidate = await realpath(candidate)\n const rel = relative(pathSafety.realRoot, realCandidate)\n if (isPathInsideRootRelative(rel)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n } catch (error) {\n if (!isFileNotFound(error)) throw error\n const parent = dirname(candidate)\n if (parent === candidate) throw error\n candidate = parent\n }\n }\n}\n\nfunction isFileNotFound(error: unknown): boolean {\n return typeof error === 'object' && error !== null && 'code' in error && error.code === 'ENOENT'\n}\n\nasync function isCaseInsensitiveDirectory(dir: string): Promise {\n const marker = `.b2-action-case-check-${randomUUID()}`\n const lowerPath = resolve(dir, marker.toLowerCase())\n const upperPath = resolve(dir, marker.toUpperCase())\n\n try {\n await writeFile(lowerPath, '')\n } catch (error) {\n core.warning(\n `Could not probe case sensitivity in ${dir}; treating download collision checks as case-sensitive (${error instanceof Error ? error.message : String(error)})`,\n )\n return false\n }\n try {\n try {\n return (await realpath(lowerPath)) === (await realpath(upperPath))\n } catch (error) {\n if (isFileNotFound(error)) return false\n throw error\n }\n } finally {\n try {\n await unlink(lowerPath)\n } catch (error) {\n core.warning(\n `Could not remove B2 action case-sensitivity probe ${lowerPath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n}\n\nfunction localPathCollisionKey(localPath: string, caseInsensitivePaths: boolean): string {\n return caseInsensitivePaths ? localPath.toLowerCase() : localPath\n}\n\nfunction recordPlannedLocalPath(\n owner: LocalPathOwner,\n root: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n localPathAncestorOwners: Map,\n): void {\n const collisionKey = localPathCollisionKey(owner.localPath, caseInsensitivePaths)\n const existingFile = localPathOwners.get(collisionKey)\n if (existingFile !== undefined && existingFile.fileName !== owner.fileName) {\n throw new Error(\n `download path collision: B2 files \"${existingFile.fileName}\" and \"${owner.fileName}\" both map to \"${owner.localPath}\"`,\n )\n }\n\n const existingDescendant = localPathAncestorOwners.get(collisionKey)\n if (existingDescendant !== undefined && existingDescendant.fileName !== owner.fileName) {\n throwFileDirectoryCollision(owner, existingDescendant)\n }\n\n const existingAncestor = findLocalPathFileAncestor(\n root,\n owner.localPath,\n caseInsensitivePaths,\n localPathOwners,\n )\n if (existingAncestor !== undefined && existingAncestor.fileName !== owner.fileName) {\n throwFileDirectoryCollision(existingAncestor, owner)\n }\n\n localPathOwners.set(collisionKey, owner)\n rememberLocalPathAncestors(root, owner, caseInsensitivePaths, localPathAncestorOwners)\n}\n\nfunction findLocalPathFileAncestor(\n root: string,\n localPath: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n): LocalPathOwner | undefined {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return undefined\n const owner = localPathOwners.get(parentKey)\n if (owner !== undefined) return owner\n const next = dirname(parent)\n if (next === parent) return undefined\n parent = next\n }\n}\n\nfunction rememberLocalPathAncestors(\n root: string,\n owner: LocalPathOwner,\n caseInsensitivePaths: boolean,\n localPathAncestorOwners: Map,\n): void {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(owner.localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return\n if (!localPathAncestorOwners.has(parentKey)) localPathAncestorOwners.set(parentKey, owner)\n const next = dirname(parent)\n if (next === parent) return\n parent = next\n }\n}\n\nfunction throwFileDirectoryCollision(\n fileOwner: LocalPathOwner,\n descendantOwner: LocalPathOwner,\n): never {\n throw new Error(\n `download path collision: B2 file \"${fileOwner.fileName}\" maps to \"${fileOwner.localPath}\", which must be a file, but B2 file \"${descendantOwner.fileName}\" maps beneath it at \"${descendantOwner.localPath}\"`,\n )\n}\n\nfunction safeRemotePathSegments(fileName: string, displayName = fileName): string[] {\n const segments = fileName.split('/')\n for (const segment of segments) {\n validateRemotePathSegment(segment, displayName)\n }\n return segments\n}\n\nfunction safeRemotePathTail(fileName: string): string {\n const tail = fileName.split('/').at(-1) ?? ''\n validateRemotePathSegment(tail, fileName)\n return tail\n}\n\nfunction validateRemotePathSegment(segment: string, fileName: string): void {\n if (segment === '' || segment === '.' || segment === '..') {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains an empty, \".\" or \"..\" path segment`,\n )\n }\n for (const char of segment) {\n const codePoint = char.codePointAt(0)\n if (codePoint !== undefined && (codePoint <= 0x1f || codePoint === 0x7f)) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains a control character`,\n )\n }\n }\n\n // B2 keys are opaque, but prefix downloads must project `/`-separated\n // keys into the runner filesystem without path traversal or lossy rewrites.\n // POSIX runners can preserve characters such as `:`, `?`, trailing dots,\n // and Windows device names verbatim. Windows treats several of those as\n // separators or invalid/reserved filenames, so reject them there instead of\n // silently changing the on-disk name or risking two B2 keys overwriting one\n // local path.\n if (\n process.platform === 'win32' &&\n (/[<>:\"|?*\\\\]/u.test(segment) ||\n /[. ]$/u.test(segment) ||\n /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/iu.test(segment))\n ) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped on Windows because segment \"${segment}\" is reserved or contains a Windows path character`,\n )\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link headCommand}: metadata read from a HEAD request, no body. */\nexport interface HeadResult {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file (from `Content-Length`). */\n size: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** B2-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Custom `X-Bz-Info-*` headers attached at upload time. */\n fileInfo: Record\n}\n\n/**\n * HEAD-only metadata probe. Fetches the headers of an object without\n * downloading the body. Useful for cheap \"does this exist and what's its\n * size / sha1 / contentType?\" checks, or to inspect custom `fileInfo`\n * metadata that the uploader attached.\n *\n * Returns all output fields as step outputs so downstream steps can branch\n * on them.\n */\nexport async function headCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'head', 'the B2 file name')\n\n core.startGroup(`head b2://${bucket.name}/${source}`)\n try {\n // `bucket.head` returns only the parsed response headers; no body to\n // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n const { headers: h } = await bucket.head(source)\n core.info(\n ` size=${h.contentLength} type=${h.contentType} sha1=${h.contentSha1 ?? 'multipart'}`,\n )\n return {\n fileName: h.fileName,\n fileId: h.fileId,\n size: h.contentLength,\n contentType: h.contentType,\n contentSha1: h.contentSha1,\n uploadTimestamp: h.uploadTimestamp,\n fileInfo: h.fileInfo,\n }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link hideCommand}: identifies the hide marker that was just created. */\nexport interface HideResult {\n /** B2 file name that was hidden. */\n fileName: string\n /** File ID of the hide marker (a special version with `action: 'hide'`). */\n fileId: string\n}\n\n/**\n * Hide a file in B2 (creates a \"hide marker\" file version that masks the\n * previous version from `listFileNames` and downloads-by-name).\n *\n * Versioning is always on in B2, so hide is a soft-delete: the underlying\n * data and prior versions remain until lifecycle rules collect them. To\n * permanently delete, use the `delete` command.\n *\n * To unhide, run `delete` against the hide marker's `fileId` (use `list`\n * with versions if you need to discover it).\n */\nexport async function hideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'hide', 'the B2 file name')\n\n core.startGroup(`hide b2://${bucket.name}/${source}`)\n try {\n const result = await bucket.hideFile(source)\n core.info(` hidden: ${result.fileName} (marker fileId=${result.fileId})`)\n return { fileName: result.fileName, fileId: result.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\n\n/** One entry in {@link ListResult.files}. Mirrors the SDK's per-version metadata. */\nexport interface ListedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file. */\n size: number\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** Server-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Custom `X-Bz-Info-*` headers from upload time. */\n fileInfo: Record\n}\n\n/** Result of {@link listCommand}. */\nexport interface ListResult {\n /** Files matching the prefix, capped by `maxResults`. */\n files: ListedFile[]\n /** True when more visible upload files exist beyond `maxResults`. Use to detect pagination. */\n truncated: boolean\n}\n\n/**\n * List file names under a prefix.\n *\n * `source` is the prefix (use trailing `/` to list a \"directory\"). Empty\n * `source` lists everything the application key is allowed to see. Pagination\n * is followed transparently up to `max-results` matches.\n *\n * Useful for \"decide what to do next\" workflow steps:\n * - inventory before a delete\n * - find the most recent release artifact to promote\n * - emit a JSON manifest as a build output\n */\nexport async function listCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const prefix = inputs.source ?? ''\n const maxResults = inputs.maxResults\n const files: ListedFile[] = []\n let startFileName: string | undefined\n\n core.startGroup(`list b2://${bucket.name}/${prefix} (max ${maxResults})`)\n try {\n while (files.length < maxResults) {\n const remaining = maxResults - files.length\n const pageSize = Math.min(1000, remaining)\n const page = await bucket.listFileNames({\n prefix,\n pageSize,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n files.push({\n fileName: f.fileName,\n fileId: f.fileId,\n size: f.contentLength,\n contentSha1: f.contentSha1,\n uploadTimestamp: f.uploadTimestamp,\n contentType: f.contentType,\n fileInfo: f.fileInfo,\n })\n if (files.length >= maxResults) {\n if (!page.nextFileName) return { files, truncated: false }\n return {\n files,\n truncated: await hasVisibleUploadAfter(bucket, prefix, page.nextFileName),\n }\n }\n }\n\n if (!page.nextFileName) {\n return { files, truncated: false }\n }\n startFileName = page.nextFileName\n }\n\n return { files, truncated: true }\n } finally {\n core.info(` ${files.length} file(s) listed`)\n core.endGroup()\n }\n}\n\nasync function hasVisibleUploadAfter(\n bucket: Bucket,\n prefix: string,\n startFileName: string,\n): Promise {\n let cursor: string | undefined = startFileName\n\n while (cursor !== undefined) {\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n startFileName: cursor,\n })\n if (page.files.some((f) => f.action === 'upload')) return true\n cursor = page.nextFileName ?? undefined\n }\n\n return false\n}\n","import { redactUrlForError } from \"../internal/url-redaction.js\";\nimport { encodeFileName } from \"../raw/encoding.js\";\nimport { hostMatchesAllowedSuffix } from \"../http/url-guard.js\";\nimport { hasHttpHeaderControlCharacter } from \"../util/http.js\";\nimport { assertNativeDownloadFileName, assertSafeBucketName } from \"./validation.js\";\nimport { presignS3Request } from \"./sigv4.js\";\n//#region src/s3/index.ts\nvar HTTP_HEADER_TOKEN = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\nvar HTTP_MEDIA_TYPE = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+\\/[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\nvar DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN = 3600;\nvar TRUSTED_NATIVE_DOWNLOAD_HOST_SUFFIXES = [\n\t\"backblazeb2.com\",\n\t\"backblaze.com\",\n\t\"backblaze.net\",\n\t\"b2-staging.io\"\n];\nvar BROWSER_EXECUTABLE_CONTENT_TYPES = /* @__PURE__ */ new Set([\n\t\"text/html\",\n\t\"application/xhtml+xml\",\n\t\"image/svg+xml\",\n\t\"application/javascript\",\n\t\"text/javascript\",\n\t\"application/x-javascript\",\n\t\"text/x-javascript\",\n\t\"application/ecmascript\",\n\t\"text/ecmascript\",\n\t\"application/x-ecmascript\",\n\t\"text/x-ecmascript\",\n\t\"text/xml\",\n\t\"application/xml\"\n]);\n/**\n* Server-side opt-in token for unsafe S3 presign options.\n*\n* Use this token as the value for `allowBrowserExecutableContentType`,\n* `allowBrowserExecutableResponseContentType`, or\n* `allowInlineResponseContentDisposition` only when active content or inline\n* rendering from the storage origin is intentional and trusted.\n*/\nvar trustedUnsafeS3PresignOptIn = Object.freeze({ __trustedUnsafeS3PresignOptIn: \"trustedUnsafeS3PresignOptIn\" });\n/**\n* Derives an S3-compatible client configuration from B2 authorization state.\n* Pass the result to `new S3Client(config)` from `@aws-sdk/client-s3`.\n*\n* Non-standard, custom, or proxied endpoints require an explicit `region`; set\n* it before deploying this SDK to those endpoints. The SDK no longer falls back\n* to `us-west-004` because that can mis-sign requests.\n*\n* @param config - B2 auth state, application key credentials, and optional region override.\n*\n* @returns Configuration ready for the AWS S3 SDK.\n*\n* @example\n* ```ts\n* const { B2_APPLICATION_KEY_ID, B2_APPLICATION_KEY } = process.env\n* if (!B2_APPLICATION_KEY_ID || !B2_APPLICATION_KEY) throw new Error('Missing B2 credentials')\n* const s3 = new S3Client(createS3ClientConfig({\n* accountInfo: client.accountInfo,\n* applicationKeyId: B2_APPLICATION_KEY_ID,\n* applicationKey: B2_APPLICATION_KEY,\n* }))\n* ```\n*/\nfunction createS3ClientConfig(config) {\n\tconst s3Url = config.accountInfo.getS3ApiUrl();\n\tconst region = config.region ?? deriveRequiredS3Region(s3Url);\n\tassertNonEmptyStringOption(\"applicationKeyId\", config.applicationKeyId);\n\tassertNonEmptyStringOption(\"applicationKey\", config.applicationKey);\n\tassertNonEmptyStringOption(\"region\", region);\n\tassertSigV4CredentialScopeComponent(\"applicationKeyId\", config.applicationKeyId);\n\tassertSigV4CredentialScopeComponent(\"region\", region);\n\treturn {\n\t\tendpoint: s3Url,\n\t\tregion,\n\t\tcredentials: {\n\t\t\taccessKeyId: config.applicationKeyId,\n\t\t\tsecretAccessKey: config.applicationKey\n\t\t},\n\t\tforcePathStyle: true\n\t};\n}\n/**\n* Extracts the B2 S3 region from a standard B2 S3 endpoint.\n*\n* Custom endpoints cannot be inferred safely. Pass `region` explicitly to\n* {@link createS3ClientConfig}, {@link presignS3GetObjectUrl}, or\n* {@link presignS3PutObjectUrl} when this returns `null`.\n*\n* @param endpoint - The S3 endpoint URL.\n*\n* @returns The derived region, or `null` when the endpoint is not a standard B2 S3 URL.\n*/\nfunction deriveS3RegionFromEndpoint(endpoint) {\n\tlet hostname;\n\ttry {\n\t\thostname = new URL(endpoint).hostname.toLowerCase();\n\t} catch {\n\t\treturn null;\n\t}\n\treturn /^s3\\.([a-z0-9-]+)\\.backblazeb2\\.com$/.exec(hostname)?.[1] ?? null;\n}\n/**\n* Generates an AWS Signature Version 4 presigned GET URL for B2's S3-compatible API.\n*\n* This helper signs internally and does not pass the B2 application key to\n* runtime peer dependencies. Response override options are signed into the URL\n* and control headers served from the storage origin; do not populate them from\n* untrusted input without an allow-list. Presign success does not prove the URL\n* will be accepted later; keep URL-generating hosts clock-synchronized and\n* check clock skew when downstream use returns SigV4 403 errors.\n*\n* @param options - B2 auth state, S3 credentials, target object, and signing options.\n*\n* @returns The presigned URL string.\n*/\nasync function presignS3GetObjectUrl(options) {\n\tconst query = [[\"x-id\", \"GetObject\"]];\n\tif (options.versionId !== void 0) {\n\t\tassertSafeQueryValue(\"versionId\", options.versionId);\n\t\tquery.push([\"versionId\", options.versionId]);\n\t}\n\tif (options.responseCacheControl !== void 0) {\n\t\tassertSafeResponseOverride(\"responseCacheControl\", options.responseCacheControl);\n\t\tquery.push([\"response-cache-control\", options.responseCacheControl]);\n\t}\n\tif (options.responseContentDisposition !== void 0) {\n\t\tassertSafeResponseContentDisposition(options.responseContentDisposition, isTrustedUnsafeS3PresignOptIn(options.allowInlineResponseContentDisposition));\n\t\tquery.push([\"response-content-disposition\", options.responseContentDisposition]);\n\t}\n\tif (options.responseContentEncoding !== void 0) {\n\t\tassertSafeResponseOverride(\"responseContentEncoding\", options.responseContentEncoding);\n\t\tquery.push([\"response-content-encoding\", options.responseContentEncoding]);\n\t}\n\tif (options.responseContentLanguage !== void 0) {\n\t\tassertSafeResponseOverride(\"responseContentLanguage\", options.responseContentLanguage);\n\t\tquery.push([\"response-content-language\", options.responseContentLanguage]);\n\t}\n\tif (options.responseContentType !== void 0) {\n\t\tif (isTrustedUnsafeS3PresignOptIn(options.allowBrowserExecutableResponseContentType)) assertSafeContentTypeValue(\"responseContentType\", options.responseContentType, \"response header value\");\n\t\telse assertSafeResponseContentType(options.responseContentType);\n\t\tquery.push([\"response-content-type\", options.responseContentType]);\n\t}\n\tif (options.responseExpires !== void 0) query.push([\"response-expires\", normalizeResponseExpires(options.responseExpires)]);\n\treturn await presignS3Request(\"GET\", createSigV4PresignOptions(options), query, []);\n}\n/**\n* Returns a B2-native download-authorization URL, not an S3 presigned URL.\n*\n* This deprecated helper preserves the legacy positional output contract where\n* the whole file name is encoded as one URL component, including `/` as `%2F`.\n* It keeps the legacy string-building contract for callers that relied on\n* custom/local download URLs or permissive inputs. Use\n* {@link createNativeDownloadAuthorizationUrl} for strict validation.\n*\n* @param downloadUrl - The B2 download URL from authorization.\n* @param bucketName - The bucket containing the file.\n* @param fileName - The file name (path) to download.\n* @param authorizationToken - A download authorization token from `b2_get_download_authorization`.\n* @param validDurationInSeconds - Compatibility-only value for the non-authoritative `expires` query.\n*\n* @returns The B2 native download-authorization URL string.\n*\n* @deprecated Use {@link createNativeDownloadAuthorizationUrl} for B2 native\n* download-token URLs, or {@link presignS3GetObjectUrl} for real S3-compatible\n* AWS Signature Version 4 presigned GET URLs.\n*/\nfunction presignGetObjectUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds) {\n\tconst expires = Math.floor(Date.now() / 1e3) + (validDurationInSeconds ?? DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN);\n\treturn `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeURIComponent(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;\n}\n/**\n* Generates an AWS Signature Version 4 presigned PUT URL for browser or\n* third-party uploads through B2's S3-compatible API.\n*\n* This helper signs internally and does not pass the B2 application key to\n* runtime peer dependencies. A presigned PUT URL is a replayable bearer\n* credential for writing one key until expiry. Retried PUTs can create\n* duplicate B2 file versions when a response is lost after B2 stored the object.\n* Use unique keys or reconcile uploaded file IDs/checksums, and configure\n* lifecycle/version cleanup where duplicate versions must be removed\n* automatically. If `contentType` and `contentLength` are omitted, the holder\n* can choose any content type, including browser-executable types, and any size\n* accepted by B2; bind both values before handing URLs to untrusted uploaders\n* to limit financial-DoS and content-type smuggling risk.\n*\n* @param options - B2 auth state, S3 credentials, target object, and signing options.\n*\n* @returns The presigned URL string.\n*/\nasync function presignS3PutObjectUrl(options) {\n\tconst headers = [];\n\tif (options.contentType !== void 0) {\n\t\tif (isTrustedUnsafeS3PresignOptIn(options.allowBrowserExecutableContentType)) assertSafeContentTypeValue(\"contentType\", options.contentType, \"stored object Content-Type\");\n\t\telse assertSafePutContentType(options.contentType);\n\t\theaders.push([\"content-type\", options.contentType]);\n\t}\n\tif (options.contentLength !== void 0) headers.push([\"content-length\", normalizeContentLength(options.contentLength)]);\n\theaders.push(...normalizeMetadataHeaders(options.metadata));\n\treturn await presignS3Request(\"PUT\", createSigV4PresignOptions(options), [[\"x-id\", \"PutObject\"]], headers);\n}\n/**\n* Generates an AWS Signature Version 4 presigned PUT URL for B2's\n* S3-compatible API.\n*\n* @param options - B2 auth state, S3 credentials, target object, and signing options.\n*\n* @returns The presigned URL string.\n*\n* @deprecated Use {@link presignS3PutObjectUrl}; this alias is retained for\n* pre-release callers that adopted the shorter name.\n*/\nasync function presignPutObjectUrl(options) {\n\treturn await presignS3PutObjectUrl(options);\n}\n/**\n* Constructs a B2-native download URL using a token from `b2_get_download_authorization`.\n* This is not an S3 presigned URL.\n*\n* The token lifetime is fixed when `b2_get_download_authorization` creates the\n* token. `validDurationInSeconds` is retained only for compatibility with the\n* legacy `presignGetObjectUrl` helper's decorative `expires` query parameter;\n* changing it here does not shorten or extend access.\n* Because the returned URL carries a bearer token, `downloadUrl` must be an\n* HTTPS Backblaze download origin without userinfo, path, query, or fragment.\n*\n* @param downloadUrl - The B2 download URL from authorization (e.g., `https://f004.backblazeb2.com`).\n* @param bucketName - The bucket containing the file.\n* @param fileName - The file name (path) to download.\n* @param authorizationToken - A download authorization token from `b2_get_download_authorization`.\n* @param validDurationInSeconds - Compatibility-only value for the non-authoritative `expires` query.\n*\n* @returns The B2 native download-authorization URL string, not an S3 presigned URL.\n*/\nfunction createNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds = DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN) {\n\treturn buildNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds, encodeFileName, assertNativeDownloadFileName);\n}\nfunction deriveRequiredS3Region(endpoint) {\n\tconst region = deriveS3RegionFromEndpoint(endpoint);\n\tif (region !== null) return region;\n\tthrow new Error(`Unable to derive B2 S3 region from endpoint \"${redactUrlForError(endpoint, { invalidUrlLabel: \"\" })}\". Pass an explicit \\`region\\` option before deploying custom or proxied endpoints.`);\n}\nfunction createSigV4PresignOptions(options) {\n\tconst clientConfig = createS3ClientConfig(options);\n\treturn {\n\t\tendpoint: clientConfig.endpoint,\n\t\tregion: clientConfig.region,\n\t\taccessKeyId: clientConfig.credentials.accessKeyId,\n\t\tsecretAccessKey: clientConfig.credentials.secretAccessKey,\n\t\tbucketName: options.bucketName,\n\t\tfileName: options.fileName,\n\t\t...options.expiresIn !== void 0 ? { expiresIn: options.expiresIn } : {}\n\t};\n}\nfunction normalizeContentLength(contentLength) {\n\tif (!Number.isSafeInteger(contentLength) || contentLength < 0) throw new RangeError(`contentLength must be a non-negative safe integer; received ${String(contentLength)}.`);\n\treturn String(contentLength);\n}\nfunction normalizeValidDurationInSeconds(validDurationInSeconds) {\n\tif (!Number.isSafeInteger(validDurationInSeconds) || validDurationInSeconds < 0) throw new RangeError(`validDurationInSeconds must be a non-negative safe integer; received ${String(validDurationInSeconds)}.`);\n\treturn validDurationInSeconds;\n}\nfunction assertNonEmptyStringOption(name, value) {\n\tif (typeof value !== \"string\" || value.trim().length === 0) throw new TypeError(`${name} must be a non-empty string.`);\n}\nfunction assertSigV4CredentialScopeComponent(name, value) {\n\tif (/[\\s/]/u.test(value) || hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain whitespace, control characters, or \"/\" because it is embedded in the SigV4 credential scope.`);\n}\nfunction isTrustedUnsafeS3PresignOptIn(value) {\n\treturn value === trustedUnsafeS3PresignOptIn;\n}\nfunction buildNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds, encodeFileNameForUrl, assertFileName) {\n\tconst baseUrl = parseNativeDownloadBaseUrl(downloadUrl);\n\tassertSafeBucketName(bucketName);\n\tassertFileName(fileName);\n\tconst expires = Math.floor(Date.now() / 1e3) + normalizeValidDurationInSeconds(validDurationInSeconds);\n\treturn `${baseUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileNameForUrl(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;\n}\nfunction parseNativeDownloadBaseUrl(downloadUrl) {\n\tlet base;\n\ttry {\n\t\tbase = new URL(downloadUrl);\n\t} catch {\n\t\tthrow new TypeError(`Native download-authorization URLs require a valid https: downloadUrl; received \"${redactUrlForError(downloadUrl, { invalidUrlLabel: \"\" })}\".`);\n\t}\n\tif (base.protocol !== \"https:\") throw new TypeError(`Native download-authorization URLs require an https: downloadUrl; received \"${redactUrlForError(base)}\".`);\n\tif (base.username !== \"\" || base.password !== \"\") throw new TypeError(\"Native download-authorization URLs must not include userinfo.\");\n\tif (base.search !== \"\" || base.hash !== \"\") throw new TypeError(\"Native download-authorization URLs must not include query or fragment.\");\n\tif (base.pathname !== \"\" && base.pathname !== \"/\") throw new TypeError(\"Native download-authorization URLs must not include a path.\");\n\tif (!isTrustedNativeDownloadHost(base.hostname)) throw new TypeError(`Native download-authorization URLs require a Backblaze download host; received \"${redactUrlForError(base)}\".`);\n\treturn base.origin;\n}\nfunction normalizeMetadataHeaders(metadata) {\n\tconst headers = [];\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tfor (const [key, value] of Object.entries(metadata ?? {})) {\n\t\tif (!HTTP_HEADER_TOKEN.test(key)) throw new TypeError(`metadata key \"${key}\" must be a non-empty valid HTTP header token.`);\n\t\tif (typeof value !== \"string\") throw new TypeError(`metadata value for \"${key}\" must be a string.`);\n\t\tconst lowerKey = key.toLowerCase();\n\t\tif (seenKeys.has(lowerKey)) throw new TypeError(`metadata key \"${key}\" must not differ only by case.`);\n\t\tseenKeys.add(lowerKey);\n\t\theaders.push([`x-amz-meta-${lowerKey}`, value]);\n\t}\n\treturn headers;\n}\nfunction normalizeResponseExpires(responseExpires) {\n\tif (!Number.isFinite(responseExpires.getTime())) throw new RangeError(\"responseExpires must be a valid Date.\");\n\treturn responseExpires.toUTCString();\n}\nfunction assertSafeResponseOverride(name, value) {\n\tassertSafeHeaderValue(name, value, \"response header value\");\n}\nfunction assertSafeQueryValue(name, value) {\n\tif (hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain control characters because it becomes a query parameter.`);\n}\nfunction assertSafeHeaderValue(name, value, target) {\n\tif (hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain control characters because it becomes a ${target}.`);\n}\nfunction assertSafeResponseContentType(contentType) {\n\tassertNonExecutableContentType(\"responseContentType\", contentType, \"response header value\", \"allow-list a safe content type before signing response overrides\");\n}\nfunction assertSafePutContentType(contentType) {\n\tassertNonExecutableContentType(\"contentType\", contentType, \"stored object Content-Type\", \"pass allowBrowserExecutableContentType only when active content is intentional\");\n}\nfunction assertSafeResponseContentDisposition(contentDisposition, allowInline) {\n\tassertSafeResponseOverride(\"responseContentDisposition\", contentDisposition);\n\tconst disposition = contentDisposition.split(\";\", 1)[0]?.trim().toLowerCase();\n\tif (!allowInline && disposition === \"inline\") throw new TypeError(\"responseContentDisposition must not force inline rendering; use an attachment disposition for response overrides.\");\n}\nfunction mediaTypeFor(contentType) {\n\treturn contentType.split(\";\", 1)[0]?.trim().toLowerCase() ?? \"\";\n}\nfunction assertSafeContentTypeValue(name, contentType, target) {\n\tassertSafeHeaderValue(name, contentType, target);\n\tconst mediaType = mediaTypeFor(contentType);\n\tif (mediaType.length === 0) throw new TypeError(`${name} must include a non-empty media type.`);\n\tif (!HTTP_MEDIA_TYPE.test(mediaType)) throw new TypeError(`${name} must include a valid media type.`);\n\treturn mediaType;\n}\nfunction assertNonExecutableContentType(name, contentType, target, guidance) {\n\tconst mediaType = assertSafeContentTypeValue(name, contentType, target);\n\tif (isBrowserExecutableContentType(mediaType)) throw new TypeError(`${name} \"${mediaType}\" can execute in browsers; ${guidance}.`);\n}\nfunction isBrowserExecutableContentType(mediaType) {\n\treturn BROWSER_EXECUTABLE_CONTENT_TYPES.has(mediaType) || mediaType.endsWith(\"+xml\");\n}\nfunction isTrustedNativeDownloadHost(hostname) {\n\treturn TRUSTED_NATIVE_DOWNLOAD_HOST_SUFFIXES.some((suffix) => hostMatchesAllowedSuffix(hostname, suffix));\n}\n//#endregion\nexport { createNativeDownloadAuthorizationUrl, createS3ClientConfig, deriveS3RegionFromEndpoint, presignGetObjectUrl, presignPutObjectUrl, presignS3GetObjectUrl, presignS3PutObjectUrl, trustedUnsafeS3PresignOptIn };\n\n//# sourceMappingURL=index.js.map","import * as core from '@actions/core'\nimport type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'\nimport { presignGetObjectUrl } from '@backblaze-labs/b2-sdk/s3'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** One entry in {@link PresignResult.files}. */\nexport interface PresignedFile {\n /** B2 file name (the key the URL grants access to). */\n fileName: string\n /** Presigned download URL. Masked via `core.setSecret` before this struct is logged. */\n url: string\n /** Expiration time as milliseconds since the epoch. */\n expiresAt: number\n}\n\n/** Result of {@link presignCommand}. */\nexport interface PresignResult {\n /** One entry per generated URL. Single-file mode returns a one-element array. */\n files: PresignedFile[]\n}\n\n/**\n * Generate a presigned download URL for one B2 file or every file under a\n * prefix.\n *\n * Modes:\n * - `source` ending in `/` → prefix mode. List the prefix and emit one\n * presigned URL per file (capped by `max-results`). All URLs share the\n * same `b2_get_download_authorization` token because the auth scope is\n * prefix-based; we just expand it into one URL per matched object.\n * - Otherwise → single-file mode (the original behavior).\n *\n * Every URL is masked via `core.setSecret` so subsequent log lines redact\n * them. The first URL is also exposed as the `presigned-url` step output\n * for the most common one-file workflow.\n */\nexport async function presignCommand(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'presign', 'the B2 file name or prefix')\n\n if (source.endsWith('/')) {\n return presignPrefix(client, bucket, inputs, source)\n }\n\n return { files: [await presignOne(client, bucket, source, inputs.presignTtlSeconds, source)] }\n}\n\nasync function presignPrefix(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n prefix: string,\n): Promise {\n const downloadUrl = client.accountInfo.getDownloadUrl()\n // One auth token covers the whole prefix (that's exactly what\n // `b2_get_download_authorization` is designed for).\n const auth = await bucket.getDownloadAuthorization(prefix, inputs.presignTtlSeconds)\n core.setSecret(auth.authorizationToken)\n const expiresAt = Math.floor(Date.now() / 1000) + inputs.presignTtlSeconds\n\n const files: PresignedFile[] = []\n let startFileName: string | undefined\n core.startGroup(`presign prefix b2://${bucket.name}/${prefix} (TTL ${inputs.presignTtlSeconds}s)`)\n try {\n while (files.length < inputs.maxResults) {\n const remaining = inputs.maxResults - files.length\n const page = await bucket.listFileNames({\n prefix,\n pageSize: Math.min(1000, remaining),\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n const url = presignGetObjectUrl(\n downloadUrl,\n bucket.name,\n f.fileName,\n auth.authorizationToken,\n inputs.presignTtlSeconds,\n )\n core.setSecret(url)\n files.push({ fileName: f.fileName, url, expiresAt })\n if (files.length >= inputs.maxResults) break\n }\n if (!page.nextFileName) break\n startFileName = page.nextFileName\n }\n } finally {\n core.info(` generated ${files.length} presigned URL(s)`)\n core.endGroup()\n }\n return { files }\n}\n\nasync function presignOne(\n client: B2Client,\n bucket: Bucket,\n fileName: string,\n ttlSeconds: number,\n authPrefix: string,\n): Promise {\n const auth = await bucket.getDownloadAuthorization(authPrefix, ttlSeconds)\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const url = presignGetObjectUrl(\n downloadUrl,\n bucket.name,\n fileName,\n auth.authorizationToken,\n ttlSeconds,\n )\n core.setSecret(auth.authorizationToken)\n core.setSecret(url)\n const expiresAt = Math.floor(Date.now() / 1000) + ttlSeconds\n core.info(`presigned URL for ${fileName} valid for ${ttlSeconds}s (expires at ${expiresAt})`)\n return { fileName, url, expiresAt }\n}\n","import * as core from '@actions/core'\nimport type { Bucket, FileAction } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link PurgeResult.files}. */\nexport interface PurgedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID of the version that was purged. */\n fileId: string\n /** Which kind of version this entry refers to, or `skip` for dry-run previews. */\n action: FileAction | 'skip'\n /** True for dry-run previews; the version was not actually purged. */\n skipped: boolean\n}\n\n/** Result of {@link purgeCommand}. */\nexport interface PurgeResult {\n /** One entry per matched version (live, prior, and hide markers). */\n files: PurgedFile[]\n /** Count of individual-version purge failures. */\n errors: number\n}\n\n/**\n * Permanently delete every file version (including hide markers and historic\n * uploads) under a prefix. Differs from `delete` in that `delete`'s\n * implementation streams over `listFileVersions` and removes all versions,\n * but `purge` makes the wipe-the-prefix intent explicit and warns loudly.\n *\n * If `source` is empty or `/`, this purges the **entire bucket** only when\n * `allow-bucket-purge: true` is also set. Default behavior is to require a\n * scoped prefix so an omitted source cannot become a bucket-wide wipe.\n *\n * Supports `dry-run` to preview what would be deleted.\n */\nexport async function purgeCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const bucketWide = inputs.source === undefined || inputs.source === '' || inputs.source === '/'\n if (bucketWide && !inputs.allowBucketPurge) {\n throw new Error(\n \"'allow-bucket-purge' must be true for whole-bucket purge (set 'source' to a prefix for scoped purge)\",\n )\n }\n const source = inputs.source ?? ''\n const prefix = bucketWide ? '' : source.endsWith('/') ? source : `${source}/`\n const dryRun = inputs.dryRun\n\n if (prefix === '' && !dryRun) {\n core.warning(\n `purge will permanently delete EVERY version in bucket \"${bucket.name}\". Continuing because allow-bucket-purge is true.`,\n )\n }\n\n const files: PurgedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'purge'} b2://${bucket.name}/${prefix} (all versions)`)\n try {\n const opts = {\n ...(prefix !== '' ? { prefix } : {}),\n dryRun,\n bypassGovernance: inputs.bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n }\n for await (const event of deleteAllVersions(bucket, opts)) {\n if (event.type === 'delete') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: event.action,\n skipped: false,\n })\n core.info(` purged ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: 'skip',\n skipped: true,\n })\n core.info(` would purge ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to purge ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link retentionCommand}: describes what was applied to the target version. */\nexport interface RetentionResult {\n /** B2 file name the retention/hold was applied to. */\n fileName: string\n /** B2 file ID of the version that was modified. */\n fileId: string\n /** Retention mode after the call. `none` means retention was cleared. Undefined if only legal-hold was touched. */\n appliedMode: 'compliance' | 'governance' | 'none' | undefined\n /** Retention expiration timestamp (ms since the epoch). `null` when mode is `none`. */\n retainUntilTimestamp: number | null | undefined\n /** Legal-hold state after the call. Undefined when not touched by this invocation. */\n appliedLegalHold: 'on' | 'off' | undefined\n}\n\n/**\n * Apply Object Lock retention settings and/or a legal hold to a specific\n * file version.\n *\n * The bucket must have Object Lock enabled. Three inputs drive this command:\n * - `retention-mode`: `compliance` | `governance` | `none`. Required if\n * `retention-until` is set.\n * - `retention-until`: ISO 8601 timestamp (e.g. `2027-01-01T00:00:00Z`).\n * Required if `retention-mode` is `compliance` or `governance`.\n * - `legal-hold`: `on` | `off`. Independent of retention; can be set on\n * its own or alongside retention.\n * - `bypass-governance` (bool): allows shortening a governance retention.\n *\n * At least one of `retention-mode` / `legal-hold` must be supplied.\n *\n * The target file version is resolved by exact name only when the latest\n * version is an upload.\n */\nexport async function retentionCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'retention', 'the B2 file name')\n\n const mode = inputs.retentionMode\n const until = inputs.retentionUntil\n const legalHold = inputs.legalHold\n\n if (mode === undefined && legalHold === undefined) {\n throw new Error(\"retention requires at least one of 'retention-mode' or 'legal-hold' to be set\")\n }\n\n // Resolve the retention expiration up front so TypeScript narrows `until`\n // inside the parse branch and the downstream call site doesn't need a cast.\n let retainUntilMillis: number | null = null\n if (mode === 'compliance' || mode === 'governance') {\n if (until === undefined) {\n throw new Error(\n `'retention-until' (ISO 8601 timestamp) is required when 'retention-mode' is '${mode}'`,\n )\n }\n const parsed = Date.parse(until)\n if (Number.isNaN(parsed)) {\n throw new Error(`'retention-until' is not a valid ISO 8601 timestamp: \"${until}\"`)\n }\n // Reject past timestamps client-side. B2 also rejects them server-side\n // but with a generic 400; the action's check fails faster and tells the\n // user exactly what's wrong (especially helpful for timezone-skewed CI\n // runners). Allow a small clock-skew tolerance: anything within the\n // last 30 seconds is treated as \"now\" rather than past.\n const skewToleranceMs = 30_000\n if (parsed < Date.now() - skewToleranceMs) {\n throw new Error(\n `'retention-until' must be in the future; got \"${until}\" (${new Date(parsed).toISOString()})`,\n )\n }\n retainUntilMillis = parsed\n }\n\n // Resolve the file version we're operating on.\n const hit = await findFileByName(bucket, source)\n\n let appliedMode: RetentionResult['appliedMode']\n let retainUntilTimestamp: number | null | undefined\n let appliedLegalHold: RetentionResult['appliedLegalHold']\n\n core.startGroup(`retention b2://${bucket.name}/${source}`)\n try {\n if (mode !== undefined) {\n const retention = {\n mode: mode === 'none' ? null : mode,\n retainUntilTimestamp: retainUntilMillis,\n }\n const result = inputs.bypassGovernance\n ? await bucket.updateFileRetention(source, hit.fileId, retention, {\n bypassGovernance: true,\n })\n : await bucket.updateFileRetention(source, hit.fileId, retention)\n appliedMode = mode\n retainUntilTimestamp = result.fileRetention.retainUntilTimestamp\n core.info(` retention: mode=${mode} retainUntil=${retainUntilMillis}`)\n }\n\n if (legalHold !== undefined) {\n const result = await bucket.updateFileLegalHold(source, hit.fileId, legalHold)\n appliedLegalHold = result.legalHold\n core.info(` legal-hold: ${result.legalHold}`)\n }\n\n return {\n fileName: source,\n fileId: hit.fileId,\n appliedMode,\n retainUntilTimestamp,\n appliedLegalHold,\n }\n } finally {\n core.endGroup()\n }\n}\n","//#region src/streams/file-source.ts\nvar FILE_STREAM_CHUNK_SIZE = 16 * 1024 * 1024;\nvar FILE_SOURCE_INTERNAL = Symbol(\"FileSource.internal\");\n/** @internal */\nvar fileSourceTestHooks = {};\nfunction getNodeFsSync() {\n\tconst fs = globalThis.process?.getBuiltinModule?.(\"node:fs\");\n\tif (!isNodeFsSync(fs)) throw new Error(\"FileSource constructor requires Node.js 22.3+ synchronous filesystem APIs; use FileSource.fromPath() when synchronous filesystem access is unavailable.\");\n\treturn fs;\n}\nfunction isNodeFsSync(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn typeof value[\"lstatSync\"] === \"function\";\n}\nasync function fileOpenFlags() {\n\tconst { constants } = await import(\"node:fs\");\n\treturn constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);\n}\nfunction normalizeSliceOffset(value, size) {\n\tif (!Number.isFinite(value)) throw new RangeError(\"FileSource slice offsets must be finite.\");\n\tconst integer = Math.trunc(value);\n\tconst offset = integer < 0 ? size + integer : integer;\n\treturn Math.min(Math.max(offset, 0), size);\n}\nfunction formatFilePath(path) {\n\treturn path instanceof URL ? path.href : path;\n}\nfunction identityFromStats(stats) {\n\treturn {\n\t\tdev: stats.dev,\n\t\tino: stats.ino,\n\t\tsize: stats.size,\n\t\tmtimeMs: stats.mtimeMs,\n\t\tctimeMs: stats.ctimeMs\n\t};\n}\nfunction assertStableIdentity(path, stats) {\n\tif (stats.dev === 0 && stats.ino === 0) throw new Error(`FileSource: ${formatFilePath(path)} is on a filesystem that does not expose stable file identity.`);\n}\nfunction assertRegularFile(path, stats) {\n\tif (!stats.isFile()) throw new Error(`FileSource: ${formatFilePath(path)} is not a regular file.`);\n}\nfunction validatedIdentityFromStats(path, stats) {\n\tassertRegularFile(path, stats);\n\tif (shouldComparePosixFileIdentity()) assertStableIdentity(path, stats);\n\treturn identityFromStats(stats);\n}\nfunction assertSameIdentity(path, expected, actual, when) {\n\tif (shouldComparePosixFileIdentity()) assertStableIdentity(path, actual);\n\tif (shouldComparePosixFileIdentity() && (actual.dev !== expected.dev || actual.ino !== expected.ino)) throw new Error(`FileSource: ${formatFilePath(path)} changed ${when}.`);\n\tif (actual.size !== expected.size || actual.mtimeMs !== expected.mtimeMs) throw new Error(`FileSource: ${formatFilePath(path)} was modified ${when}.`);\n\tif (shouldComparePosixChangeTime() && actual.ctimeMs !== expected.ctimeMs) throw new Error(`FileSource: ${formatFilePath(path)} was modified ${when}.`);\n}\nfunction isWindows() {\n\tif (fileSourceTestHooks.platform !== void 0) return fileSourceTestHooks.platform === \"win32\";\n\treturn globalThis.process?.platform === \"win32\";\n}\nfunction shouldComparePosixFileIdentity() {\n\treturn !isWindows();\n}\nfunction shouldComparePosixChangeTime() {\n\treturn !isWindows();\n}\nfunction throwIfAborted(signal) {\n\tif (signal === void 0 || !signal.aborted) return;\n\tthrow signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\nfunction maxReadSize() {\n\treturn fileSourceTestHooks.maxReadSize ?? FILE_STREAM_CHUNK_SIZE;\n}\n/* v8 ignore start -- Requires a file to pass identity checks and still EOF mid-range. */\nfunction rangeEndedEarlyError(path, offset, size) {\n\tconst end = offset + size;\n\treturn /* @__PURE__ */ new Error(`FileSource: ${formatFilePath(path)} ended before byte range [${offset}, ${end}) was fully read.`);\n}\n/* v8 ignore stop */\nasync function openValidatedFile(path, identity) {\n\tconst open = fileSourceTestHooks.openFile ?? (await import(\"node:fs/promises\")).open;\n\tlet file;\n\ttry {\n\t\tfile = await open(path, await fileOpenFlags());\n\t} catch (err) {\n\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\tthrow new Error(`FileSource: ${formatFilePath(path)} could not be opened: ${message}`);\n\t}\n\ttry {\n\t\tconst stats = await file.stat();\n\t\tassertRegularFile(path, stats);\n\t\tassertSameIdentity(path, identity, stats, \"before read\");\n\t\treturn file;\n\t} catch (err) {\n\t\t/* v8 ignore next -- Cleanup failure is deliberately best-effort. */\n\t\tawait file.close().catch(() => {});\n\t\tthrow err;\n\t}\n}\nasync function lstatNodeFile(path) {\n\tconst { lstat } = await import(\"node:fs/promises\");\n\treturn lstat(path);\n}\nasync function readFileRange(path, identity, offset, size, signal) {\n\tthrowIfAborted(signal);\n\tif (size === 0) {\n\t\tawait verifyFileIdentityForEmptyRead(path, identity, signal);\n\t\treturn /* @__PURE__ */ new Uint8Array(0);\n\t}\n\tthrowIfAborted(signal);\n\tconst file = await openValidatedFile(path, identity);\n\tconst data = new Uint8Array(size);\n\tlet filled = 0;\n\ttry {\n\t\twhile (filled < data.byteLength) {\n\t\t\tthrowIfAborted(signal);\n\t\t\tconst length = Math.min(maxReadSize(), data.byteLength - filled);\n\t\t\tconst { bytesRead } = await file.read(data, filled, length, offset + filled);\n\t\t\tif (bytesRead === 0) throw rangeEndedEarlyError(path, offset, size);\n\t\t\tfilled += bytesRead;\n\t\t\tawait fileSourceTestHooks.afterReadIteration?.(filled);\n\t\t}\n\t\tthrowIfAborted(signal);\n\t\tassertSameIdentity(path, identity, await file.stat(), \"while being read\");\n\t\treturn data;\n\t} finally {\n\t\t/* v8 ignore next -- Cleanup failure is deliberately best-effort. */\n\t\tawait file.close().catch(() => {});\n\t}\n}\nasync function verifyFileIdentityForEmptyRead(path, identity, signal) {\n\tthrowIfAborted(signal);\n\tconst file = await openValidatedFile(path, identity);\n\ttry {\n\t\tthrowIfAborted(signal);\n\t\treturn;\n\t} finally {\n\t\t/* v8 ignore next -- Cleanup failure is deliberately best-effort. */\n\t\tawait file.close().catch(() => {});\n\t}\n}\nfunction sliceFileRange(path, identity, offset, size, start, end) {\n\tconst normalizedStart = normalizeSliceOffset(start, size);\n\tconst normalizedEnd = normalizeSliceOffset(end, size);\n\treturn new FileSliceSource(path, identity, offset + normalizedStart, Math.max(normalizedEnd - normalizedStart, 0));\n}\nfunction streamFileRange(path, identity, offset, size) {\n\tlet position = offset;\n\tlet remaining = size;\n\tlet verifiedEmpty = false;\n\tconst abortController = new AbortController();\n\treturn new ReadableStream({\n\t\tasync pull(controller) {\n\t\t\ttry {\n\t\t\t\tif (remaining === 0) {\n\t\t\t\t\tif (!verifiedEmpty) {\n\t\t\t\t\t\tverifiedEmpty = true;\n\t\t\t\t\t\tawait verifyFileIdentityForEmptyRead(path, identity);\n\t\t\t\t\t}\n\t\t\t\t\tcontroller.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst data = await readFileRange(path, identity, position, Math.min(FILE_STREAM_CHUNK_SIZE, remaining), abortController.signal);\n\t\t\t\tposition += data.byteLength;\n\t\t\t\tremaining -= data.byteLength;\n\t\t\t\tcontroller.enqueue(data);\n\t\t\t\tif (remaining === 0) controller.close();\n\t\t\t} catch (err) {\n\t\t\t\tcontroller.error(err);\n\t\t\t}\n\t\t},\n\t\tcancel(reason) {\n\t\t\tabortController.abort(reason);\n\t\t}\n\t});\n}\nasync function fileRangeToArrayBuffer(path, identity, offset, size, options = {}) {\n\treturn (await readFileRange(path, identity, offset, size, options.signal)).buffer;\n}\nvar FileSliceSource = class {\n\tpath;\n\tidentity;\n\toffset;\n\tsize;\n\tcanSlice = true;\n\tconstructor(path, identity, offset, size) {\n\t\tthis.path = path;\n\t\tthis.identity = identity;\n\t\tthis.offset = offset;\n\t\tthis.size = size;\n\t}\n\tslice(start, end) {\n\t\treturn sliceFileRange(this.path, this.identity, this.offset, this.size, start, end);\n\t}\n\tstream() {\n\t\treturn streamFileRange(this.path, this.identity, this.offset, this.size);\n\t}\n\ttoArrayBuffer(options = {}) {\n\t\treturn fileRangeToArrayBuffer(this.path, this.identity, this.offset, this.size, options);\n\t}\n};\n/**\n* ContentSource backed by a local filesystem path.\n*\n* `FileSource` is Node-only but safe to import in browser builds: it touches\n* Node filesystem APIs only when constructed or read. The constructor performs\n* synchronous filesystem validation so `size` is immediately available; request\n* handlers, sync loops, and other latency-sensitive code should use\n* {@link FileSource.fromPath}. Both paths capture a best-effort regular file\n* identity and reject a symlink as the final path component; parent directory\n* symlinks are followed by the operating system, so callers that constrain\n* paths under a trusted root should validate those parents separately. Reads\n* reject if the path is replaced, if the filesystem cannot report stable\n* identity on POSIX platforms, or if size/mtime/ctime changes before the\n* configured byte range is read. On Windows, reads avoid unreliable dev/inode\n* identity comparisons and validate size/mtime instead.\n* Slices preserve the captured identity, so multipart uploads can read\n* disjoint ranges without materialising the whole file in memory or following\n* later leaf path swaps.\n*/\nvar FileSource = class {\n\t/** Random-access: file ranges are read by absolute byte offset. */\n\tcanSlice = true;\n\t/** File size captured at construction time. */\n\tsize;\n\tpath;\n\tidentity;\n\t/**\n\t* Internal constructor path for async validation.\n\t* @param path - Local filesystem path or file URL.\n\t* @param internal - Module-private validated identity payload.\n\t*\n\t* @internal\n\t*/\n\tconstructor(path, internal) {\n\t\tconst resolvedIdentity = internal?.key === FILE_SOURCE_INTERNAL ? internal.identity : validatedIdentityFromStats(path, getNodeFsSync().lstatSync(path));\n\t\tthis.path = path;\n\t\tthis.identity = resolvedIdentity;\n\t\tthis.size = resolvedIdentity.size;\n\t}\n\t/**\n\t* Return a new file-backed source covering the specified byte range.\n\t* @param start - The zero-based byte offset to begin the slice.\n\t* @param end - The exclusive byte offset where the slice ends.\n\t*\n\t* @returns A new ContentSource representing the requested sub-range.\n\t*/\n\tslice(start, end) {\n\t\treturn sliceFileRange(this.path, this.identity, 0, this.size, start, end);\n\t}\n\t/**\n\t* Open this file as a Web ReadableStream.\n\t* @returns A ReadableStream that reads the file lazily.\n\t*/\n\tstream() {\n\t\treturn streamFileRange(this.path, this.identity, 0, this.size);\n\t}\n\t/**\n\t* Read this file into an ArrayBuffer.\n\t* @param options - Optional abort signal used while reading.\n\t*\n\t* @returns A promise resolving with the file bytes.\n\t*/\n\ttoArrayBuffer(options = {}) {\n\t\treturn fileRangeToArrayBuffer(this.path, this.identity, 0, this.size, options);\n\t}\n\t/**\n\t* Create a FileSource using asynchronous filesystem validation.\n\t* @param path - Local filesystem path or file URL.\n\t*\n\t* @returns A FileSource bound to the validated file identity.\n\t*\n\t* @throws If the path does not reference a regular non-symlink file.\n\t* @throws If a POSIX filesystem cannot report stable file identity.\n\t*/\n\tstatic async fromPath(path) {\n\t\treturn constructFileSourceFromIdentity(path, validatedIdentityFromStats(path, await lstatNodeFile(path)));\n\t}\n};\nfunction constructFileSourceFromIdentity(path, identity) {\n\treturn Reflect.construct(FileSource, [path, {\n\t\tkey: FILE_SOURCE_INTERNAL,\n\t\tidentity\n\t}]);\n}\n//#endregion\nexport { FileSource, fileSourceTestHooks };\n\n//# sourceMappingURL=file-source.js.map","//#region src/sync/actions/index.ts\n/** Uploads a local file to B2. */\nvar UploadAction = class {\n\trelativePath;\n\tabsolutePath;\n\tsize;\n\tdoUpload;\n\ttype = \"upload\";\n\t/**\n\t* Creates a new UploadAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param absolutePath - Absolute local filesystem path.\n\t* @param size - File size in bytes.\n\t* @param doUpload - Callback that performs the actual upload.\n\t*/\n\tconstructor(relativePath, absolutePath, size, doUpload) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.absolutePath = absolutePath;\n\t\tthis.size = size;\n\t\tthis.doUpload = doUpload;\n\t}\n\t/**\n\t* Uploads the file (unless dryRun) and returns an 'upload-done' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal for canceling the upload.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doUpload(this.absolutePath, this.relativePath, signal);\n\t\treturn {\n\t\t\ttype: \"upload-done\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: this.size\n\t\t};\n\t}\n};\n/** Downloads a B2 file to the local filesystem. */\nvar DownloadAction = class {\n\trelativePath;\n\tsize;\n\tdoDownload;\n\ttype = \"download\";\n\t/**\n\t* Creates a new DownloadAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param size - File size in bytes.\n\t* @param doDownload - Callback that performs the actual download.\n\t*/\n\tconstructor(relativePath, size, doDownload) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.size = size;\n\t\tthis.doDownload = doDownload;\n\t}\n\t/**\n\t* Downloads the file (unless dryRun) and returns a 'download-done' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal for canceling the download.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doDownload(this.relativePath, signal);\n\t\treturn {\n\t\t\ttype: \"download-done\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: this.size\n\t\t};\n\t}\n};\n/** Server-side copies a B2 file to a new key within the same or different bucket. */\nvar CopyAction = class {\n\trelativePath;\n\tsize;\n\tdoCopy;\n\ttype = \"copy\";\n\t/**\n\t* Creates a new CopyAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param size - File size in bytes.\n\t* @param doCopy - Callback that performs the server-side copy.\n\t*/\n\tconstructor(relativePath, size, doCopy) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.size = size;\n\t\tthis.doCopy = doCopy;\n\t}\n\t/**\n\t* Copies the file (unless dryRun) and returns a 'copy-done' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal for canceling the copy.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doCopy(this.relativePath, signal);\n\t\treturn {\n\t\t\ttype: \"copy-done\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: this.size\n\t\t};\n\t}\n};\n/** Hides a file in B2 by creating a hide marker (soft delete). */\nvar HideAction = class {\n\trelativePath;\n\tdoHide;\n\ttype = \"hide\";\n\tsize = 0;\n\t/**\n\t* Creates a new HideAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param doHide - Callback that creates the hide marker.\n\t*/\n\tconstructor(relativePath, doHide) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.doHide = doHide;\n\t}\n\t/**\n\t* Hides the file (unless dryRun) and returns a 'hide' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal for canceling the hide request.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doHide(this.relativePath, signal);\n\t\treturn {\n\t\t\ttype: \"hide\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: 0\n\t\t};\n\t}\n};\n/** Permanently deletes a specific file version from B2. */\nvar DeleteRemoteAction = class {\n\trelativePath;\n\tfileId;\n\tdoDelete;\n\ttype = \"delete-remote\";\n\tsize = 0;\n\t/**\n\t* Creates a new DeleteRemoteAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param fileId - The B2 file version ID to delete.\n\t* @param doDelete - Callback that performs the deletion.\n\t*/\n\tconstructor(relativePath, fileId, doDelete) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.fileId = fileId;\n\t\tthis.doDelete = doDelete;\n\t}\n\t/**\n\t* Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal for canceling the delete request.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doDelete(this.fileId, this.relativePath, signal);\n\t\treturn {\n\t\t\ttype: \"delete-remote\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: 0\n\t\t};\n\t}\n};\n/** Deletes a file from the local filesystem. */\nvar DeleteLocalAction = class {\n\trelativePath;\n\tabsolutePath;\n\tdoDelete;\n\ttype = \"delete-local\";\n\tsize = 0;\n\t/**\n\t* Creates a new DeleteLocalAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param absolutePath - Absolute local filesystem path.\n\t* @param doDelete - Callback that performs the deletion.\n\t*/\n\tconstructor(relativePath, absolutePath, doDelete) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.absolutePath = absolutePath;\n\t\tthis.doDelete = doDelete;\n\t}\n\t/**\n\t* Deletes the local file (unless dryRun) and returns a 'delete-local' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal checked before deleting.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doDelete(this.absolutePath, signal);\n\t\treturn {\n\t\t\ttype: \"delete-local\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: 0\n\t\t};\n\t}\n};\n/** Represents a no-op action for files that do not need syncing. */\nvar SkipAction = class {\n\trelativePath;\n\treason;\n\ttype = \"skip\";\n\tsize = 0;\n\t/**\n\t* Creates a new SkipAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param reason - Human-readable explanation for why the file was skipped.\n\t*/\n\tconstructor(relativePath, reason) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.reason = reason;\n\t}\n\t/**\n\t* Returns a 'skip' event with the reason message. No I/O is performed.\n\t* @param _dryRun - Whether to simulate the action (unused for no-op).\n\t* @param _signal - Unused abort signal accepted for the shared action interface.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(_dryRun, _signal) {\n\t\treturn {\n\t\t\ttype: \"skip\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: 0,\n\t\t\tmessage: this.reason\n\t\t};\n\t}\n};\n//#endregion\nexport { CopyAction, DeleteLocalAction, DeleteRemoteAction, DownloadAction, HideAction, SkipAction, UploadAction };\n\n//# sourceMappingURL=index.js.map","//#region src/sync/regexp-safety.ts\nvar MAX_REGEXP_SOURCE_LENGTH = 512;\nvar MAX_REGEXP_INPUT_LENGTH = 1024;\nvar MAX_REGEXP_UNBOUNDED_QUANTIFIERS = 1;\nvar MAX_REGEXP_BOUNDED_QUANTIFIER = 200;\nvar MAX_REGEXP_BOUNDED_QUANTIFIERS = 16;\nvar MAX_REGEXP_BOUNDED_QUANTIFIER_PRODUCT = 1e4;\nvar safeRegExpCache = /* @__PURE__ */ new WeakMap();\nvar validatedFilterCache = /* @__PURE__ */ new WeakSet();\n/**\n* Validates every RegExp filter in an include/exclude filter set.\n*\n* @param filters - Optional include and exclude filters to validate.\n*\n* @throws When a RegExp filter is too large or structurally unsafe.\n*/\nfunction validateSyncFilters(filters) {\n\tif (filters === void 0) return;\n\tif (validatedFilterCache.has(filters)) return;\n\tvalidateSyncFilterList(\"include\", filters.include);\n\tvalidateSyncFilterList(\"exclude\", filters.exclude);\n\tvalidatedFilterCache.add(filters);\n}\n/**\n* Tests a path with a caller-provided RegExp without retaining `lastIndex` state.\n*\n* @param relativePath - Folder-relative path to test.\n* @param pattern - Caller-provided RegExp filter.\n*\n* @returns True when the RegExp matches the relative path.\n*\n* @throws When the RegExp filter is too large or structurally unsafe.\n*/\nfunction regexpMatchesSyncPath(relativePath, pattern) {\n\tif (pathExceedsSafeRegExpInput(relativePath)) return false;\n\treturn regexpWithoutState(pattern).test(relativePath);\n}\n/**\n* Tests whether a relative path is too long to feed to caller-provided RegExp filters.\n*\n* @param relativePath - Folder-relative path to test.\n*\n* @returns True when RegExp filters should not be evaluated for the path.\n*/\nfunction pathExceedsSafeRegExpInput(relativePath) {\n\treturn relativePath.length > MAX_REGEXP_INPUT_LENGTH;\n}\nfunction validateSyncFilterList(kind, patterns) {\n\tfor (const pattern of patterns ?? []) if (typeof pattern !== \"string\") regexpWithoutState(pattern, kind);\n}\nfunction regexpWithoutState(pattern, kind = \"pattern\") {\n\tconst cached = safeRegExpCache.get(pattern);\n\tif (cached !== void 0) return cached;\n\tassertSafeRegExp(pattern, kind);\n\tconst compiled = new RegExp(pattern.source, pattern.flags.replace(/[gy]/g, \"\"));\n\tsafeRegExpCache.set(pattern, compiled);\n\treturn compiled;\n}\nfunction assertSafeRegExp(pattern, kind) {\n\tconst source = pattern.source;\n\tif (source.length > MAX_REGEXP_SOURCE_LENGTH) throw new Error(`Sync filter RegExp is too long (${kind}: /${source}/)`);\n\tif (!regexpSourceLooksSafe(source)) throw new Error(`Sync filter RegExp is too complex (${kind}: /${source}/)`);\n}\n/**\n* Best-effort linear RegExp guard for filters matched synchronously on attacker-controlled paths.\n*\n* The accepted subset intentionally rejects constructs that are hard to bound in the JavaScript\n* RegExp engine: backreferences, unterminated escapes/classes/groups, repeated unbounded\n* quantifiers, bounded quantifiers above {@link MAX_REGEXP_BOUNDED_QUANTIFIER}, too many bounded\n* quantifiers or too large a bounded-quantifier product, and any quantified group whose subtree\n* already contains a quantifier or alternation. Group state is propagated upward so nested groups\n* cannot hide a quantified or alternated subtree before an outer bounded or unbounded quantifier.\n*\n* @param source - RegExp source text to inspect.\n*\n* @returns True when the source passes the SDK's structural safety heuristic.\n*/\nfunction regexpSourceLooksSafe(source) {\n\tlet escaped = false;\n\tlet inClass = false;\n\tlet unboundedQuantifiers = 0;\n\tlet boundedQuantifiers = 0;\n\tlet boundedQuantifierProduct = 1;\n\tconst groups = [];\n\tlet lastToken = null;\n\tfor (let i = 0; i < source.length; i++) {\n\t\tconst char = source[i] ?? \"\";\n\t\tif (escaped) {\n\t\t\tif (!inClass && char === \"k\" && source[i + 1] === \"<\") return false;\n\t\t\tif (!inClass && /[1-9]/.test(char)) return false;\n\t\t\tescaped = false;\n\t\t\tlastToken = { type: \"atom\" };\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \"\\\\\") {\n\t\t\tescaped = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (inClass) {\n\t\t\tif (char === \"]\") inClass = false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \"[\") {\n\t\t\tinClass = true;\n\t\t\tlastToken = { type: \"atom\" };\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \"(\") {\n\t\t\tgroups.push({\n\t\t\t\thasQuantifier: false,\n\t\t\t\thasAlternation: false\n\t\t\t});\n\t\t\tlastToken = null;\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \")\") {\n\t\t\tconst group = groups.pop();\n\t\t\tif (!group) return false;\n\t\t\tconst parent = groups.at(-1);\n\t\t\tif (parent) mergeGroupState(parent, group);\n\t\t\tlastToken = {\n\t\t\t\ttype: \"group\",\n\t\t\t\t...group\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \"|\") {\n\t\t\tconst group = groups.at(-1);\n\t\t\tif (group) group.hasAlternation = true;\n\t\t\tlastToken = null;\n\t\t\tcontinue;\n\t\t}\n\t\tconst quantifier = lastToken !== null ? parseQuantifier(source, i) : null;\n\t\tif (lastToken !== null && quantifier !== null) {\n\t\t\tif (lastToken?.type === \"group\" && (lastToken.hasQuantifier || lastToken.hasAlternation)) return false;\n\t\t\tif (quantifier.unbounded) {\n\t\t\t\tunboundedQuantifiers++;\n\t\t\t\tif (unboundedQuantifiers > MAX_REGEXP_UNBOUNDED_QUANTIFIERS) return false;\n\t\t\t} else {\n\t\t\t\tboundedQuantifiers++;\n\t\t\t\tif (boundedQuantifiers > MAX_REGEXP_BOUNDED_QUANTIFIERS) return false;\n\t\t\t\tif (quantifier.maxRepetitions > MAX_REGEXP_BOUNDED_QUANTIFIER) return false;\n\t\t\t\tboundedQuantifierProduct *= Math.max(quantifier.maxRepetitions, 1);\n\t\t\t\tif (boundedQuantifierProduct > MAX_REGEXP_BOUNDED_QUANTIFIER_PRODUCT) return false;\n\t\t\t}\n\t\t\tconst group = groups.at(-1);\n\t\t\tif (group) group.hasQuantifier = true;\n\t\t\ti = quantifier.endIndex;\n\t\t\tlastToken = null;\n\t\t\tcontinue;\n\t\t}\n\t\tlastToken = { type: \"atom\" };\n\t}\n\treturn !escaped && !inClass && groups.length === 0;\n}\nfunction mergeGroupState(target, source) {\n\ttarget.hasQuantifier = target.hasQuantifier || source.hasQuantifier;\n\ttarget.hasAlternation = target.hasAlternation || source.hasAlternation;\n}\nfunction parseQuantifier(source, index) {\n\tconst char = source[index];\n\tif (char === \"*\" || char === \"+\") return {\n\t\tendIndex: index,\n\t\tmaxRepetitions: Number.POSITIVE_INFINITY,\n\t\tunbounded: true\n\t};\n\tif (char === \"?\") return {\n\t\tendIndex: index,\n\t\tmaxRepetitions: 1,\n\t\tunbounded: false\n\t};\n\tif (char !== \"{\") return null;\n\tconst end = source.indexOf(\"}\", index + 1);\n\tif (end === -1) return null;\n\tconst body = source.slice(index + 1, end);\n\tconst match = /^(\\d+)(?:,(\\d*))?$/.exec(body);\n\tif (!match) return null;\n\tconst min = Number(match[1]);\n\tconst maxText = match[2];\n\tconst unbounded = body.includes(\",\") && maxText === \"\";\n\treturn {\n\t\tendIndex: end,\n\t\tmaxRepetitions: unbounded ? Number.POSITIVE_INFINITY : Number(maxText ?? min),\n\t\tunbounded\n\t};\n}\n//#endregion\nexport { pathExceedsSafeRegExpInput, regexpMatchesSyncPath, validateSyncFilters };\n\n//# sourceMappingURL=regexp-safety.js.map","//#region src/sync/scan-events.ts\n/**\n* Emits a scanner skip event without letting observer failures abort the scan.\n*\n* @param filters - Scan options that may include an onSkip callback.\n* @param event - Skip event to report.\n*/\nfunction emitScannerSkip(filters, event) {\n\ttry {\n\t\tfilters?.onSkip?.(event);\n\t} catch {}\n}\n/**\n* Builds a consistent skip event for paths that cannot be safely tested against RegExp filters.\n*\n* @param relativePath - Sync-relative path that exceeded the RegExp input limit.\n*\n* @returns A typed scanner skip event.\n*/\nfunction regexpInputTooLongSkip(relativePath) {\n\treturn {\n\t\ttype: \"skip\",\n\t\tpath: relativePath,\n\t\tsize: 0,\n\t\tmessage: `Skipped sync path ${JSON.stringify(relativePath)}: path exceeds the RegExp filter input limit`,\n\t\treason: \"path-too-long-for-regexp\"\n\t};\n}\n//#endregion\nexport { emitScannerSkip, regexpInputTooLongSkip };\n\n//# sourceMappingURL=scan-events.js.map","import { pathExceedsSafeRegExpInput, regexpMatchesSyncPath, validateSyncFilters } from \"./regexp-safety.js\";\nimport { emitScannerSkip, regexpInputTooLongSkip } from \"./scan-events.js\";\n//#region src/sync/filters.ts\n/**\n* Tests whether a relative sync path is included by the configured include/exclude filters.\n* Exclude filters win over include filters when both match the same path.\n*\n* @param relativePath - Folder-relative path using forward slashes.\n* @param filters - Optional include and exclude filters.\n*\n* @returns True when the path should remain in the sync scan.\n*/\nfunction pathPassesSyncFilters(relativePath, filters) {\n\tvalidateSyncFilters(filters);\n\tconst path = normalizePath(relativePath);\n\tif (normalizedPathSkippedByRegExpInputLimit(path, filters)) return false;\n\tconst include = filters?.include ?? [];\n\tconst exclude = filters?.exclude ?? [];\n\tif (include.length > 0) {\n\t\tif (!include.some((pattern) => matchesPattern(path, pattern))) return false;\n\t}\n\treturn !exclude.some((pattern) => matchesPattern(path, pattern));\n}\n/**\n* Tests whether a directory may contain paths admitted by the configured filters.\n*\n* @param relativePath - Folder-relative directory path using forward slashes.\n* @param filters - Optional include and exclude filters.\n*\n* @returns True when the scanner should descend into the directory.\n*/\nfunction directoryMayContainSyncPaths(relativePath, filters) {\n\tvalidateSyncFilters(filters);\n\tconst path = normalizePath(relativePath);\n\tif (path === \"\") return true;\n\tif ((filters?.exclude ?? []).some((pattern) => stringPatternExcludesAllDescendants(path, pattern))) return false;\n\tconst include = filters?.include ?? [];\n\treturn include.length === 0 || include.some((pattern) => patternMayMatchDescendant(path, pattern));\n}\n/**\n* Returns the safe literal prefix that B2 listing can use for include filters.\n* Exclude filters are not considered because they cannot narrow a B2 prefix.\n*\n* @param filters - Optional include and exclude filters.\n*\n* @returns A folder-relative literal prefix, or an empty string when no safe narrowing exists.\n*/\nfunction literalPrefixForSyncFilters(filters) {\n\tvalidateSyncFilters(filters);\n\tconst include = filters?.include ?? [];\n\tlet commonPrefix;\n\tfor (const pattern of include) {\n\t\tif (patternIsRegExp(pattern)) return \"\";\n\t\tconst glob = normalizePath(pattern);\n\t\tif (!glob.includes(\"/\")) return \"\";\n\t\tconst prefix = literalPrefixForGlob(glob);\n\t\tif (prefix === \"\") return \"\";\n\t\tcommonPrefix = commonPrefix === void 0 ? prefix : commonLiteralPrefix(commonPrefix, prefix);\n\t}\n\treturn commonPrefix ?? \"\";\n}\n/**\n* Filters an async iterable of sync paths while preserving the original item type.\n*\n* @typeParam T - Concrete sync path shape yielded by the source folder.\n*\n* @param paths - Async iterable of folder scan results.\n* @param filters - Optional include and exclude filters.\n*\n* @returns A filtered async generator of sync paths.\n*/\nasync function* filterSyncPaths(paths, filters) {\n\tfor await (const path of paths) if (pathPassesSyncFilters(path.relativePath, filters)) yield path;\n\telse if (pathSkippedByRegExpInputLimit(path.relativePath, filters)) emitScannerSkip(filters, regexpInputTooLongSkip(normalizePath(path.relativePath)));\n}\n/**\n* Tests whether a path is skipped because RegExp filters are configured and the normalized path\n* exceeds the SDK RegExp input guard.\n*\n* @param relativePath - Folder-relative path using forward slashes.\n* @param filters - Optional include and exclude filters.\n*\n* @returns True when any RegExp filter is present and the path is too long to evaluate.\n*/\nfunction pathSkippedByRegExpInputLimit(relativePath, filters) {\n\tvalidateSyncFilters(filters);\n\treturn normalizedPathSkippedByRegExpInputLimit(normalizePath(relativePath), filters);\n}\nfunction normalizedPathSkippedByRegExpInputLimit(normalizedPath, filters) {\n\tif (!pathExceedsSafeRegExpInput(normalizedPath) || !filtersContainRegExp(filters)) return false;\n\treturn true;\n}\nfunction matchesPattern(relativePath, pattern) {\n\tif (patternIsRegExp(pattern)) return regexpMatchesSyncPath(relativePath, pattern);\n\tconst glob = normalizePath(pattern);\n\tif (glob === \"\") return relativePath === \"\";\n\tconst segments = splitPath(relativePath);\n\tif (!glob.includes(\"/\")) return segments.some((segment) => matchSegmentGlob(segment, glob));\n\treturn matchPathGlob(segments, splitPath(glob));\n}\nfunction stringPatternExcludesAllDescendants(relativePath, pattern) {\n\tif (patternIsRegExp(pattern)) return false;\n\tconst glob = normalizePath(pattern);\n\tif (glob === \"\") return false;\n\tif (!glob.includes(\"/\")) return matchesPattern(relativePath, pattern);\n\tconst globSegments = splitPath(glob);\n\treturn globSegments.at(-1) === \"**\" && matchPathGlob(splitPath(relativePath), globSegments);\n}\nfunction filtersContainRegExp(filters) {\n\treturn filters?.include?.some(patternIsRegExp) === true || filters?.exclude?.some(patternIsRegExp) === true;\n}\nfunction patternMayMatchDescendant(relativePath, pattern) {\n\tif (patternIsRegExp(pattern)) return true;\n\tconst glob = normalizePath(pattern);\n\tif (glob === \"\" || !glob.includes(\"/\")) return true;\n\tconst pathSegments = splitPath(relativePath);\n\tconst globSegments = splitPath(glob);\n\tconst length = Math.min(pathSegments.length, globSegments.length);\n\tfor (let i = 0; i < length; i++) {\n\t\tconst globSegment = globSegments[i];\n\t\tif (globSegment === \"**\" || globSegment === void 0 || hasGlobWildcard(globSegment)) return true;\n\t\tif (globSegment !== pathSegments[i]) return false;\n\t}\n\treturn true;\n}\nfunction matchPathGlob(pathSegments, globSegments) {\n\tlet reachable = new Array(pathSegments.length + 1).fill(false);\n\treachable[0] = true;\n\tfor (const globSegment of globSegments) {\n\t\tconst next = new Array(pathSegments.length + 1).fill(false);\n\t\tif (globSegment === \"**\") {\n\t\t\tlet canReach = false;\n\t\t\tfor (let i = 0; i <= pathSegments.length; i++) {\n\t\t\t\tcanReach = canReach || reachable[i] === true;\n\t\t\t\tnext[i] = canReach;\n\t\t\t}\n\t\t} else for (let i = 0; i < pathSegments.length; i++) if (reachable[i] === true && matchSegmentGlob(pathSegments[i] ?? \"\", globSegment)) next[i + 1] = true;\n\t\treachable = next;\n\t}\n\treturn reachable[pathSegments.length] === true;\n}\nfunction matchSegmentGlob(segment, glob) {\n\tlet segmentIndex = 0;\n\tlet globIndex = 0;\n\tlet starIndex = -1;\n\tlet starMatchIndex = 0;\n\twhile (segmentIndex < segment.length) {\n\t\tconst globChar = glob[globIndex];\n\t\tif (globChar === \"?\" || globChar === segment[segmentIndex]) {\n\t\t\tglobIndex++;\n\t\t\tsegmentIndex++;\n\t\t} else if (globChar === \"*\") {\n\t\t\twhile (glob[globIndex + 1] === \"*\") globIndex++;\n\t\t\tstarIndex = globIndex;\n\t\t\tstarMatchIndex = segmentIndex;\n\t\t\tglobIndex++;\n\t\t} else if (starIndex !== -1) {\n\t\t\tglobIndex = starIndex + 1;\n\t\t\tstarMatchIndex++;\n\t\t\tsegmentIndex = starMatchIndex;\n\t\t} else return false;\n\t}\n\twhile (glob[globIndex] === \"*\") globIndex++;\n\treturn globIndex === glob.length;\n}\nfunction literalPrefixForGlob(glob) {\n\tconst segments = splitPath(glob);\n\tconst literalSegments = [];\n\tlet firstWildcardIndex = segments.length;\n\tfor (const [index, segment] of segments.entries()) {\n\t\tif (segment === \"**\" || hasGlobWildcard(segment)) {\n\t\t\tfirstWildcardIndex = index;\n\t\t\tbreak;\n\t\t}\n\t\tliteralSegments.push(segment);\n\t}\n\tif (literalSegments.length === 0) return \"\";\n\tconst prefix = literalSegments.join(\"/\");\n\tconst wildcardTail = segments.slice(firstWildcardIndex);\n\tif (wildcardTail.length > 0 && wildcardTail.every((segment) => segment === \"**\")) return prefix;\n\treturn literalSegments.length < segments.length ? `${prefix}/` : prefix;\n}\nfunction commonLiteralPrefix(a, b) {\n\tlet end = 0;\n\tconst max = Math.min(a.length, b.length);\n\twhile (end < max && a[end] === b[end]) end++;\n\treturn trimTrailingHighSurrogate(a.slice(0, end));\n}\nfunction trimTrailingHighSurrogate(value) {\n\tconst lastCodeUnit = value.charCodeAt(value.length - 1);\n\treturn lastCodeUnit >= 55296 && lastCodeUnit <= 56319 ? value.slice(0, -1) : value;\n}\nfunction hasGlobWildcard(glob) {\n\treturn glob.includes(\"*\") || glob.includes(\"?\");\n}\nfunction patternIsRegExp(pattern) {\n\treturn typeof pattern !== \"string\";\n}\nfunction splitPath(path) {\n\tif (path === \"\") return [];\n\treturn path.split(\"/\").filter((segment) => segment !== \"\");\n}\nfunction normalizePath(path) {\n\tlet normalized = path.split(\"\\\\\").join(\"/\");\n\twhile (normalized.startsWith(\"./\")) normalized = normalized.slice(2);\n\twhile (normalized.startsWith(\"/\")) normalized = normalized.slice(1);\n\twhile (normalized.endsWith(\"/\") && normalized.length > 1) normalized = normalized.slice(0, -1);\n\treturn normalized;\n}\n//#endregion\nexport { directoryMayContainSyncPaths, filterSyncPaths, literalPrefixForSyncFilters, pathPassesSyncFilters, pathSkippedByRegExpInputLimit };\n\n//# sourceMappingURL=filters.js.map","//#region src/sync/path-order.ts\n/**\n* Compares sync-relative paths using the same code-unit order everywhere sorted scans are consumed.\n*\n* @param left - First sync-relative path.\n* @param right - Second sync-relative path.\n*\n* @returns Negative, zero, or positive using JavaScript code-unit order.\n*/\nfunction compareSyncRelativePaths(left, right) {\n\treturn compareCodeUnits(left, right);\n}\n/**\n* Compares strings by JavaScript code-unit order.\n*\n* @param left - First string.\n* @param right - Second string.\n*\n* @returns Negative, zero, or positive using code-unit order.\n*/\nfunction compareCodeUnits(left, right) {\n\tif (left < right) return -1;\n\tif (left > right) return 1;\n\treturn 0;\n}\n//#endregion\nexport { compareCodeUnits, compareSyncRelativePaths };\n\n//# sourceMappingURL=path-order.js.map","//#region src/sync/scan-limit.ts\n/** Default maximum number of entries a sync scanner may retain before failing. */\nvar DEFAULT_MAX_SCAN_ENTRIES = 1e6;\n/**\n* Resolves and validates the effective scan entry limit.\n* @param options - Optional scan options carrying an override.\n*\n* @returns The configured or default scan entry limit.\n*\n* @throws When the configured limit is not a positive safe integer or Infinity.\n*/\nfunction scanEntryLimit(options) {\n\tconst limit = options?.maxScanEntries ?? 1e6;\n\tif (limit === Number.POSITIVE_INFINITY) return limit;\n\tif (!Number.isSafeInteger(limit) || limit < 1) throw new Error(\"maxScanEntries must be a positive safe integer or Infinity\");\n\treturn limit;\n}\n/**\n* Throws when a scanner has retained more entries than the configured limit.\n* @param count - Number of retained entries.\n* @param limit - Maximum allowed retained entries.\n*\n* @throws When count is greater than limit.\n*/\nfunction assertScanEntryLimit(count, limit) {\n\tif (count > limit) throw new Error(`Sync scan entry limit exceeded: maxScanEntries=${limit} was exceeded after ${count} scanned entries; raising maxScanEntries increases peak scanner memory`);\n}\n//#endregion\nexport { DEFAULT_MAX_SCAN_ENTRIES, assertScanEntryLimit, scanEntryLimit };\n\n//# sourceMappingURL=scan-limit.js.map","import { validateSyncFilters } from \"./regexp-safety.js\";\nimport { filterSyncPaths } from \"./filters.js\";\nimport { compareSyncRelativePaths } from \"./path-order.js\";\nimport { assertScanEntryLimit, scanEntryLimit } from \"./scan-limit.js\";\n//#region src/sync/pairing.ts\n/**\n* Merge-joins two sorted folder scans by relative path, yielding paired tuples.\n* Files present only in source yield `[source, null]`, only in dest yield `[null, dest]`,\n* and files in both yield `[source, dest]`.\n*\n* @param source - The source folder to scan.\n* @param dest - The destination folder to scan.\n* @param options - Optional scan controls and filters shared by both folders.\n* @param scanCallbacks - Optional internal source/destination skip callbacks.\n*/\nasync function* zipFolders(source, dest, options = {}, scanCallbacks = {}) {\n\tvalidateSyncFilters(options);\n\tconst sourceOptions = scanOptionsSnapshot(options, scanCallbacks.onSourceSkip);\n\tconst destOptions = scanOptionsSnapshot(options, scanCallbacks.onDestSkip);\n\tconst sourceIter = scanWithFilters(source, sourceOptions)[Symbol.asyncIterator]();\n\tconst destIter = scanWithFilters(dest, destOptions)[Symbol.asyncIterator]();\n\tlet sourceDone = false;\n\tlet destDone = false;\n\ttry {\n\t\tlet [sourceResult, destResult] = await Promise.all([sourceIter.next(), destIter.next()]);\n\t\tsourceDone = sourceResult.done === true;\n\t\tdestDone = destResult.done === true;\n\t\twhile (!sourceResult.done || !destResult.done) {\n\t\t\tconst s = sourceResult.done ? null : sourceResult.value;\n\t\t\tconst d = destResult.done ? null : destResult.value;\n\t\t\tif (s === null) {\n\t\t\t\tyield [null, d];\n\t\t\t\tdestResult = await destIter.next();\n\t\t\t\tdestDone = destResult.done === true;\n\t\t\t} else if (d === null) {\n\t\t\t\tyield [s, null];\n\t\t\t\tsourceResult = await sourceIter.next();\n\t\t\t\tsourceDone = sourceResult.done === true;\n\t\t\t} else {\n\t\t\t\tconst comparison = compareSyncRelativePaths(s.relativePath, d.relativePath);\n\t\t\t\tif (comparison < 0) {\n\t\t\t\t\tyield [s, null];\n\t\t\t\t\tsourceResult = await sourceIter.next();\n\t\t\t\t\tsourceDone = sourceResult.done === true;\n\t\t\t\t} else if (comparison > 0) {\n\t\t\t\t\tyield [null, d];\n\t\t\t\t\tdestResult = await destIter.next();\n\t\t\t\t\tdestDone = destResult.done === true;\n\t\t\t\t} else {\n\t\t\t\t\tyield [s, d];\n\t\t\t\t\tsourceResult = await sourceIter.next();\n\t\t\t\t\tdestResult = await destIter.next();\n\t\t\t\t\tsourceDone = sourceResult.done === true;\n\t\t\t\t\tdestDone = destResult.done === true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tawait closeScanIterator(sourceIter, sourceDone);\n\t\tawait closeScanIterator(destIter, destDone);\n\t}\n}\nasync function closeScanIterator(iterator, alreadyDone) {\n\tif (alreadyDone || iterator.return === void 0) return;\n\ttry {\n\t\tawait iterator.return();\n\t} catch {}\n}\nfunction scanWithFilters(folder, options) {\n\tconst scanned = filterSyncPaths(folder.scan(options.scanner), options.sdk);\n\tif (folder.appliesScanSorting === true) return limitSyncPaths(scanned, options.sdk);\n\treturn sortSyncPaths(scanned, options.sdk);\n}\nasync function* limitSyncPaths(paths, filters) {\n\tconst maxScanEntries = scanEntryLimit(filters);\n\tlet count = 0;\n\tfor await (const path of paths) {\n\t\tcount++;\n\t\tassertScanEntryLimit(count, maxScanEntries);\n\t\tyield path;\n\t}\n}\nasync function* sortSyncPaths(paths, filters) {\n\tconst maxScanEntries = scanEntryLimit(filters);\n\tconst collected = [];\n\tfor await (const path of paths) {\n\t\tcollected.push(path);\n\t\tassertScanEntryLimit(collected.length, maxScanEntries);\n\t}\n\tcollected.sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath));\n\tyield* collected;\n}\nfunction scanOptionsSnapshot(options, onSkip) {\n\tconst onSkipSnapshot = options.onSkip === void 0 && onSkip === void 0 ? void 0 : (event) => {\n\t\toptions.onSkip?.(event);\n\t\tonSkip?.(event);\n\t};\n\treturn {\n\t\tscanner: frozenScanOptions(options, frozenPatterns(options.include), frozenPatterns(options.exclude), onSkipSnapshot),\n\t\tsdk: frozenScanOptions(options, frozenPatterns(options.include), frozenPatterns(options.exclude), onSkipSnapshot)\n\t};\n}\nfunction frozenScanOptions(options, include, exclude, onSkip) {\n\treturn Object.freeze({\n\t\t...include !== void 0 ? { include } : {},\n\t\t...exclude !== void 0 ? { exclude } : {},\n\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t...options.onError !== void 0 ? { onError: options.onError } : {},\n\t\t...onSkip !== void 0 ? { onSkip } : {},\n\t\t...options.requireLocalSafePaths !== void 0 ? { requireLocalSafePaths: options.requireLocalSafePaths } : {},\n\t\t...options.maxScanEntries !== void 0 ? { maxScanEntries: options.maxScanEntries } : {}\n\t});\n}\nfunction frozenPatterns(patterns) {\n\treturn patterns === void 0 ? void 0 : Object.freeze([...patterns]);\n}\n//#endregion\nexport { zipFolders };\n\n//# sourceMappingURL=pairing.js.map","import { toError } from \"./to-error.js\";\n//#region src/util/error-reason.ts\n/**\n* Formats an unknown error for public diagnostics without leaking filesystem paths.\n*\n* @param err - Unknown thrown value.\n*\n* @returns A stable, sanitized reason.\n*/\nfunction sanitizeErrorReason(err) {\n\tconst error = toError(err);\n\tconst code = error.code;\n\tif (typeof code === \"string\" && code.length > 0) {\n\t\tconst reason = cleanReason(code);\n\t\tif (reason.length > 0) return reason;\n\t}\n\tconst message = cleanReason(error.message);\n\tif (message.length > 0 && !/[\\\\/]/.test(message)) return message;\n\tconst name = cleanReason(error.name);\n\tif (name.length > 0) return name;\n\treturn \"Error\";\n}\nfunction cleanReason(value) {\n\tlet cleaned = \"\";\n\tlet sawNonWhitespace = false;\n\tfor (const char of value) {\n\t\tconst code = char.charCodeAt(0);\n\t\tif (code < 32 || code === 127) continue;\n\t\tif (!sawNonWhitespace) {\n\t\t\tif (char.trim().length === 0) continue;\n\t\t\tsawNonWhitespace = true;\n\t\t}\n\t\tcleaned += char;\n\t\tif (cleaned.length >= 200) break;\n\t}\n\treturn cleaned.trimEnd();\n}\n//#endregion\nexport { sanitizeErrorReason };\n\n//# sourceMappingURL=error-reason.js.map","//#region src/sync/sha1-options.ts\n/** Default idle/no-progress timeout for SHA-1 reads. */\nvar DEFAULT_SHA1_IDLE_TIMEOUT_MILLIS = 3e4;\n/** Default absolute deadline for one untrusted B2 SHA-1 verification read. */\nvar DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS = 3e5;\n/**\n* Normalizes a user-provided SHA-1 timeout value.\n*\n* @param value - Optional timeout in milliseconds.\n* @param defaultValue - Default timeout when the value is missing or invalid.\n*\n* @returns A positive integer timeout in milliseconds.\n*/\nfunction normalizeSha1TimeoutMillis(value, defaultValue = DEFAULT_SHA1_IDLE_TIMEOUT_MILLIS) {\n\tif (value === void 0 || !Number.isFinite(value) || value < 1) return defaultValue;\n\treturn Math.floor(value);\n}\n//#endregion\nexport { DEFAULT_SHA1_IDLE_TIMEOUT_MILLIS, DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS, normalizeSha1TimeoutMillis };\n\n//# sourceMappingURL=sha1-options.js.map","//#region src/sync/local-file-identity.ts\n/**\n* Converts Node file stats into the sync scanner's persisted identity shape.\n* @param stats - Node file stats to convert.\n*\n* @returns The scanner identity stored with a local sync path.\n*\n* @internal\n*/\nfunction localFileIdentityFromStats(stats) {\n\treturn {\n\t\tdeviceId: stats.dev,\n\t\tinode: stats.ino,\n\t\tsize: stats.size,\n\t\tmodTimeMillis: Math.floor(stats.mtimeMs),\n\t\tchangeTimeMillis: Math.floor(stats.ctimeMs)\n\t};\n}\n/**\n* Verifies that current local stats still match a previously scanned regular file.\n* @param stats - Current filesystem stats for the candidate file.\n* @param path - Previously scanned local sync path.\n* @param operation - Operation name used in mutation diagnostics.\n* @param options - Platform and ctime comparison overrides for controlled filesystem moves.\n*\n* @throws If the current file is not the scanned regular file.\n*\n* @internal\n*/\nfunction assertSameScannedRegularFile(stats, path, operation = \"upload\", options = {}) {\n\tconst reason = `local file changed before ${operation}`;\n\tif (!stats.isFile()) {\n\t\tif (operation === \"delete\") throw Object.assign(/* @__PURE__ */ new Error(`${reason}: not a regular file`), { code: \"EISDIR\" });\n\t\tthrow new Error(`${reason}: not a regular file`);\n\t}\n\tif (stats.size !== path.size) throw new Error(`${reason}: size changed`);\n\tconst identity = path.fileIdentity;\n\tif (identity === void 0) return;\n\tif (!sameLocalIdentity(stats, identity, {\n\t\tcompareChangeTime: options.compareChangeTime,\n\t\tplatform: options.platform ?? currentPlatform()\n\t})) throw new Error(reason);\n}\nfunction sameLocalIdentity(stats, identity, options) {\n\tconst compareChangeTime = options.compareChangeTime ?? shouldComparePosixChangeTime(options.platform);\n\treturn (!shouldComparePosixFileIdentity(options.platform) || stats.dev === identity.deviceId && stats.ino === identity.inode) && stats.size === identity.size && Math.floor(stats.mtimeMs) === identity.modTimeMillis && (!compareChangeTime || identity.changeTimeMillis === void 0 || Math.floor(stats.ctimeMs) === identity.changeTimeMillis);\n}\nfunction shouldComparePosixFileIdentity(platform) {\n\treturn platform !== \"win32\";\n}\nfunction shouldComparePosixChangeTime(platform) {\n\treturn platform !== \"win32\";\n}\nfunction currentPlatform() {\n\treturn globalThis.process?.platform;\n}\n//#endregion\nexport { assertSameScannedRegularFile, localFileIdentityFromStats };\n\n//# sourceMappingURL=local-file-identity.js.map","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { toError } from \"../util/to-error.js\";\nimport { sanitizeErrorReason } from \"../util/error-reason.js\";\nimport { assertSameScannedRegularFile } from \"./local-file-identity.js\";\nimport { normalizeSha1TimeoutMillis } from \"./sha1-options.js\";\n//#region src/sync/local-sha1.ts\n/**\n* Formats a hash error for public sync events without leaking filesystem paths.\n*\n* @param error - Error thrown while hashing.\n*\n* @returns A sanitized reason suitable for event messages.\n*/\nfunction formatHashError(error) {\n\treturn sanitizeErrorReason(error);\n}\n/**\n* Returns whether an error represents an abort.\n*\n* @param err - Unknown thrown value.\n*\n* @returns True for AbortError values.\n*/\nfunction isAbortError(err) {\n\treturn toError(err).name === \"AbortError\";\n}\n/**\n* Reads a local file and computes its SHA-1 digest with non-regular-file rejection,\n* scanned-size bounds, abort support, and an idle/no-progress timeout.\n*\n* @param path - Local sync path to hash.\n* @param signal - Optional abort signal.\n* @param options - Optional idle timeout override.\n*\n* @returns The lowercase SHA-1 digest of the file bytes.\n*/\nasync function readLocalSha1File(path, signal, options = {}) {\n\tconst { constants } = await import(\"node:fs\");\n\tconst { lstat, open } = await import(\"node:fs/promises\");\n\tconst timeoutMillis = normalizeSha1TimeoutMillis(options.timeoutMillis);\n\tconst flags = constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);\n\tconst hash = new IncrementalSha1();\n\tlet stream;\n\tlet file;\n\tlet timeout;\n\tfunction armTimeout(onTimeout) {\n\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t\ttimeout = setTimeout(onTimeout, timeoutMillis);\n\t}\n\ttry {\n\t\tsignal?.throwIfAborted();\n\t\tassertSameScannedRegularFile(await withTimeout(lstat(path.absolutePath), timeoutMillis, \"sha1 file status\"), path, \"sha1 comparison\");\n\t\tfile = await openWithTimeout(open(path.absolutePath, flags), timeoutMillis);\n\t\tassertSameScannedRegularFile(await withTimeout(lstat(path.absolutePath), timeoutMillis, \"sha1 file status\"), path, \"sha1 comparison\");\n\t\tassertSameScannedRegularFile(await withTimeout(file.stat(), timeoutMillis, \"sha1 file status\"), path, \"sha1 comparison\");\n\t\tstream = file.createReadStream({\n\t\t\t...path.size > 0 ? {\n\t\t\t\tstart: 0,\n\t\t\t\tend: path.size - 1\n\t\t\t} : {},\n\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t});\n\t\tlet bytesRead = 0;\n\t\t/* v8 ignore next 3 -- idle-timeout firing is timing-dependent in filesystem tests */\n\t\tarmTimeout(() => {\n\t\t\tstream?.destroy(/* @__PURE__ */ new Error(`sha1 read stalled for ${timeoutMillis} ms`));\n\t\t});\n\t\tfor await (const chunk of stream) {\n\t\t\tbytesRead += chunk.byteLength;\n\t\t\tawait hash.update(chunk);\n\t\t\t/* v8 ignore next 3 -- idle-timeout firing is timing-dependent in filesystem tests */\n\t\t\tarmTimeout(() => {\n\t\t\t\tstream?.destroy(/* @__PURE__ */ new Error(`sha1 read stalled for ${timeoutMillis} ms`));\n\t\t\t});\n\t\t}\n\t\t/* v8 ignore next -- defensive TOCTOU guard after the bounded stream completes */\n\t\tif (bytesRead !== path.size) throw new Error(\"file changed during sha1 comparison\");\n\t\treturn hash.digest();\n\t} finally {\n\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t\tstream?.destroy();\n\t\tawait file?.close().catch(() => {});\n\t}\n}\n/* v8 ignore start -- defensive stale-filesystem stall handling is not portable to trigger */\nasync function withTimeout(promise, timeoutMillis, operation) {\n\tlet timeout;\n\ttry {\n\t\treturn await Promise.race([promise, new Promise((_, reject) => {\n\t\t\ttimeout = setTimeout(() => {\n\t\t\t\treject(/* @__PURE__ */ new Error(`${operation} stalled for ${timeoutMillis} ms`));\n\t\t\t}, timeoutMillis);\n\t\t})]);\n\t} finally {\n\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t}\n}\nasync function openWithTimeout(promise, timeoutMillis) {\n\tlet timedOut = false;\n\tconst tracked = promise.then((file) => {\n\t\tif (timedOut) file.close().catch(() => {});\n\t\treturn file;\n\t}, (err) => {\n\t\tthrow err;\n\t});\n\ttry {\n\t\treturn await withTimeout(tracked, timeoutMillis, \"sha1 file open\");\n\t} catch (err) {\n\t\ttimedOut = true;\n\t\tthrow err;\n\t}\n}\n/* v8 ignore stop */\n//#endregion\nexport { formatHashError, isAbortError, readLocalSha1File };\n\n//# sourceMappingURL=local-sha1.js.map","import { normalizeVerifiableSha1 } from \"../util/sha1.js\";\n//#region src/sync/sha1-metadata.ts\n/** Prefix used to mark SHA-1 metadata that must not prove equality without byte verification. */\nvar untrustedSha1Prefix = \"unverified:\";\n/**\n* Marks a verifiable SHA-1 digest as untrusted provider metadata.\n*\n* @param sha1 - Verifiable 40-character hexadecimal SHA-1 digest.\n*\n* @returns The untrusted SHA-1 sentinel value.\n*\n* @throws When the supplied value is not a verifiable SHA-1 digest.\n*/\nfunction untrustedSha1(sha1) {\n\tconst normalized = normalizeVerifiableSha1(sha1);\n\tif (normalized === null) throw new Error(\"untrusted SHA-1 metadata must be verifiable\");\n\treturn `${untrustedSha1Prefix}${normalized}`;\n}\n/**\n* Extracts the best comparable SHA-1 value from a B2 file version.\n*\n* B2's primary `contentSha1` is authoritative for single-part uploads when it is a verifiable\n* digest. Large/multipart B2 files report `contentSha1: null`; `fileInfo.large_file_sha1` is\n* caller-provided metadata, so it is returned as an untrusted hint that cannot prove equality\n* until the high-level synchronizer hashes the selected version's bytes.\n*\n* @param version - B2 file version metadata.\n*\n* @returns A lowercase comparable SHA-1, an untrusted sentinel, or null when unavailable.\n*/\nfunction selectB2ComparableSha1(version) {\n\tconst originalContentSha1 = version.contentSha1;\n\tif (typeof originalContentSha1 === \"string\") {\n\t\tif (isUntrustedSha1(originalContentSha1)) return originalContentSha1.toLowerCase();\n\t\treturn normalizeVerifiableSha1(originalContentSha1) ?? originalContentSha1.toLowerCase();\n\t}\n\tconst largeFileSha1 = normalizeVerifiableSha1(version.fileInfo[\"large_file_sha1\"]);\n\treturn largeFileSha1 === null ? null : untrustedSha1(largeFileSha1);\n}\n/**\n* Returns whether a SHA-1 value is marked as untrusted metadata.\n*\n* @param sha1 - Candidate SHA-1 metadata.\n*\n* @returns True when the value carries B2's unverified sentinel prefix.\n*/\nfunction isUntrustedSha1(sha1) {\n\treturn sha1?.toLowerCase().startsWith(\"unverified:\") ?? false;\n}\n/**\n* Parses the public `SyncPath.contentSha1` value into an explicit trust/availability state.\n*\n* @param sha1 - The raw `contentSha1` field from a sync path.\n*\n* @returns A discriminated state so custom scanners do not need to decode sentinels directly.\n*/\nfunction parseSyncContentSha1(sha1) {\n\tif (sha1 === void 0) return { kind: \"pending\" };\n\tif (sha1 === null) return { kind: \"unavailable\" };\n\tif (isUntrustedSha1(sha1)) return {\n\t\tkind: \"untrusted\",\n\t\traw: sha1,\n\t\tvalue: normalizeVerifiableSha1(sha1.slice(11))\n\t};\n\tconst normalized = normalizeVerifiableSha1(sha1);\n\tif (normalized === null) return {\n\t\tkind: \"untrusted\",\n\t\traw: sha1,\n\t\tvalue: null\n\t};\n\treturn {\n\t\tkind: \"verified\",\n\t\tvalue: normalized\n\t};\n}\n/**\n* Reads an explicit SHA-1 state when present, otherwise parses the compatibility field.\n*\n* @param path - Object carrying SHA-1 metadata.\n*\n* @returns The explicit or parsed SHA-1 state.\n*/\nfunction syncSha1StateOf(path) {\n\treturn path.contentSha1State ?? parseSyncContentSha1(path.contentSha1);\n}\n//#endregion\nexport { isUntrustedSha1, parseSyncContentSha1, selectB2ComparableSha1, syncSha1StateOf, untrustedSha1, untrustedSha1Prefix };\n\n//# sourceMappingURL=sha1-metadata.js.map","import { mapConcurrent } from \"../../upload/concurrency.js\";\nimport { normalizeVerifiableSha1 } from \"../../util/sha1.js\";\nimport { toError } from \"../../util/to-error.js\";\nimport { formatHashError, isAbortError } from \"../local-sha1.js\";\nimport { selectB2ComparableSha1, syncSha1StateOf } from \"../sha1-metadata.js\";\n//#region src/sync/policies/compare.ts\n/**\n* Determines whether two files should be considered different based on the compare mode.\n* For `sha1`, callers that use the low-level policy helpers should first prepare the pair so\n* local hashes and comparable B2 hashes are populated.\n*\n* @param source - The source file metadata.\n* @param dest - The destination file metadata.\n* @param compareMode - The comparison strategy: 'modtime', 'size', 'sha1', or 'none'.\n* @param threshold - Tolerance for the comparison (bytes for size, milliseconds for modtime).\n*\n* @returns `true` if the files are considered different.\n*\n* @throws When `compareMode` is not one of the supported compare modes.\n*/\nfunction filesAreDifferent(source, dest, compareMode, threshold = 0) {\n\tswitch (compareMode) {\n\t\tcase \"none\": return false;\n\t\tcase \"size\": return Math.abs(source.size - dest.size) > threshold;\n\t\tcase \"sha1\": return sha1ValuesAreDifferent(source, dest);\n\t\tcase \"modtime\": return Math.abs(source.modTimeMillis - dest.modTimeMillis) > threshold;\n\t\tdefault: throw new Error(`Unsupported compare mode: ${String(compareMode)}`);\n\t}\n}\n/**\n* Throws when a runtime compare mode value is unsupported.\n*\n* @param compareMode - User-supplied compare mode.\n*\n* @throws When `compareMode` is not one of the supported values.\n*/\nfunction assertSupportedCompareMode(compareMode) {\n\tswitch (compareMode) {\n\t\tcase \"none\":\n\t\tcase \"size\":\n\t\tcase \"sha1\":\n\t\tcase \"modtime\": return;\n\t\tdefault: throw new Error(`Unsupported compare mode: ${String(compareMode)}`);\n\t}\n}\nfunction sha1ValuesAreDifferent(source, dest) {\n\tif (source.size !== dest.size) return true;\n\tconst sourceSha1 = comparableSha1(source);\n\tconst destSha1 = comparableSha1(dest);\n\tif (sourceSha1.kind === \"untrusted\" || destSha1.kind === \"untrusted\") return true;\n\tif (sourceSha1.kind === \"unavailable\" || destSha1.kind === \"unavailable\") return true;\n\treturn sourceSha1.value !== destSha1.value;\n}\n/**\n* Prepares a pair for the selected compare mode.\n*\n* For `sha1`, this fills missing B2 hashes from comparable metadata and, when an explicit local\n* reader is supplied, hashes the local side only when size cannot already prove a difference.\n* Reader failures are converted into per-file sync events instead of aborting the whole run.\n*\n* @param pair - Source/destination pair from {@link zipFolders}.\n* @param compareMode - The comparison strategy.\n* @param options - Optional hashing dependencies and cancellation signal.\n*\n* @returns The prepared pair plus any preparation events.\n*/\nasync function preparePairForCompare(pair, compareMode, options = {}) {\n\tassertSupportedCompareMode(compareMode);\n\tif (compareMode !== \"sha1\") return readyComparePair(pair);\n\tconst [source, dest] = pair;\n\tif (source === null || dest === null) return readyComparePair(pair);\n\tif (source.size !== dest.size) return readyComparePair(pair);\n\tconst metadataPair = [withB2ContentSha1(source), withB2ContentSha1(dest)];\n\tif (hasUnavailableB2Sha1(metadataPair)) return skipped(metadataPair, unavailableSha1Event(metadataPair));\n\tif (options.readB2Sha1 === void 0 && hasUntrustedSha1(metadataPair) && !hasVerifiableUntrustedSha1(metadataPair)) return readyComparePair(metadataPair);\n\tconst [metadataSource, metadataDest] = metadataPair;\n\tif (metadataSource === null || metadataDest === null) return readyComparePair(metadataPair);\n\tconst sourceResult = await prepareLocalPathSha1(metadataSource, options);\n\tif (sourceResult.aborted) return aborted(metadataPair);\n\tif (sourceResult.event) return skipped(metadataPair, sourceResult.event, sourceResult.error, sourceResult.bytesHashed);\n\tconst destResult = await prepareLocalPathSha1(metadataDest, options);\n\tif (destResult.aborted) return aborted([sourceResult.path, destResult.path]);\n\tif (destResult.event) return skipped([sourceResult.path, destResult.path], destResult.event, destResult.error, sourceResult.bytesHashed);\n\tconst preparedPair = [sourceResult.path, destResult.path];\n\tconst sourceState = comparableSha1(sourceResult.path);\n\tconst destState = comparableSha1(destResult.path);\n\tconst bytesHashed = sourceResult.bytesHashed + destResult.bytesHashed;\n\tif (sourceState.kind === \"unavailable\" || destState.kind === \"unavailable\") return skipped(preparedPair, unavailableSha1Event(preparedPair), void 0, bytesHashed);\n\tconst shouldVerifyB2Bytes = untrustedSha1CouldSuppressTransfer(sourceState, destState);\n\tconst readB2Sha1 = options.readB2Sha1;\n\tif (shouldVerifyB2Bytes && hasB2Path(preparedPair) && readB2Sha1 !== void 0) return verifyB2Sha1Bytes(preparedPair, {\n\t\t...options,\n\t\treadB2Sha1\n\t}, bytesHashed);\n\treturn readyComparePair(preparedPair, bytesHashed);\n}\n/**\n* Prepares a list of pairs for the selected compare mode with bounded concurrency.\n*\n* @param pairs - Source/destination pairs from {@link zipFolders}.\n* @param compareMode - The comparison strategy.\n* @param options - Optional hashing dependencies, cancellation signal, and concurrency.\n*\n* @returns Prepared results in the same order as the input pairs.\n*/\nasync function preparePairsForCompare(pairs, compareMode, options = {}) {\n\tassertSupportedCompareMode(compareMode);\n\tif (compareMode !== \"sha1\") return pairs.map((pair) => ({\n\t\toriginalPair: pair,\n\t\tprepared: readyComparePair(pair)\n\t}));\n\treturn mapConcurrent(pairs, normalizeConcurrency(options.concurrency), async (pair) => {\n\t\tif (options.signal?.aborted) return {\n\t\t\toriginalPair: pair,\n\t\t\tprepared: aborted(pair)\n\t\t};\n\t\treturn {\n\t\t\toriginalPair: pair,\n\t\t\tprepared: await preparePairForCompare(pair, compareMode, options)\n\t\t};\n\t});\n}\nasync function prepareLocalPathSha1(path, options) {\n\tif (!isLocalSyncPath(path)) return {\n\t\tpath,\n\t\tbytesHashed: 0,\n\t\tbytesVerified: 0,\n\t\taborted: false\n\t};\n\tif (options.signal?.aborted) return {\n\t\tpath,\n\t\tbytesHashed: 0,\n\t\tbytesVerified: 0,\n\t\taborted: true\n\t};\n\ttry {\n\t\tconst state = syncSha1StateOf(path);\n\t\tif (state.kind === \"verified\") return {\n\t\t\tpath: {\n\t\t\t\t...path,\n\t\t\t\tcontentSha1: state.value\n\t\t\t},\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: false\n\t\t};\n\t\tif (state.kind === \"unavailable\") return {\n\t\t\tpath: {\n\t\t\t\t...path,\n\t\t\t\tcontentSha1: null\n\t\t\t},\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: false\n\t\t};\n\t\tconst readLocalSha1 = options.readLocalSha1;\n\t\tif (readLocalSha1 === void 0) return {\n\t\t\tpath: {\n\t\t\t\t...path,\n\t\t\t\tcontentSha1: path.contentSha1 ?? null\n\t\t\t},\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: false\n\t\t};\n\t\tconst contentSha1 = await readLocalSha1(path, options.signal, { ...options.sha1ReadTimeoutMillis !== void 0 ? { timeoutMillis: options.sha1ReadTimeoutMillis } : {} });\n\t\treturn {\n\t\t\tpath: {\n\t\t\t\t...path,\n\t\t\t\tcontentSha1\n\t\t\t},\n\t\t\tbytesHashed: normalizeVerifiableSha1(contentSha1) === null ? 0 : path.size,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: false\n\t\t};\n\t} catch (err) {\n\t\tif (options.signal?.aborted || isAbortError(err)) return {\n\t\t\tpath,\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: true\n\t\t};\n\t\tconst error = toError(err);\n\t\treturn {\n\t\t\tpath,\n\t\t\tbytesHashed: 0,\n\t\t\tevent: {\n\t\t\t\ttype: \"error\",\n\t\t\t\tpath: path.relativePath,\n\t\t\t\tsize: 0,\n\t\t\t\tmessage: `failed to hash local file for sha1 comparison: ${formatHashError(error)}`\n\t\t\t},\n\t\t\terror,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: false\n\t\t};\n\t}\n}\nasync function verifyB2Sha1Bytes(pair, options, bytesHashed) {\n\tconst [source, dest] = pair;\n\t/* v8 ignore next -- callers only verify B2 bytes for paired compare results */\n\tif (source === null || dest === null) return readyComparePair(pair, bytesHashed);\n\tconst sourceResult = await prepareUntrustedB2PathSha1(source, options);\n\tconst sourceBytesVerified = sourceResult.bytesVerified;\n\tif (sourceResult.aborted) return aborted(pair);\n\tif (sourceResult.event) return skipped([sourceResult.path, dest], sourceResult.event, sourceResult.error, bytesHashed, sourceBytesVerified);\n\tconst destResult = await prepareUntrustedB2PathSha1(dest, options);\n\tconst bytesVerified = sourceBytesVerified + destResult.bytesVerified;\n\t/* v8 ignore next -- destination abort mirrors the covered source abort path */\n\tif (destResult.aborted) return aborted([sourceResult.path, destResult.path]);\n\tif (destResult.event) return skipped([sourceResult.path, destResult.path], destResult.event, destResult.error, bytesHashed, bytesVerified);\n\treturn readyComparePair([sourceResult.path, destResult.path], bytesHashed, bytesVerified);\n}\nasync function prepareUntrustedB2PathSha1(path, options) {\n\tif (!isB2SyncPath(path) || comparableSha1(path).kind !== \"untrusted\") return {\n\t\tpath,\n\t\tbytesHashed: 0,\n\t\tbytesVerified: 0,\n\t\taborted: false\n\t};\n\treturn prepareB2PathSha1(path, options);\n}\nasync function prepareB2PathSha1(path, options) {\n\t/* v8 ignore next -- pre-aborted B2 reads are covered at pair level */\n\tif (options.signal?.aborted) return {\n\t\tpath,\n\t\tbytesHashed: 0,\n\t\tbytesVerified: 0,\n\t\taborted: true\n\t};\n\ttry {\n\t\tconst result = await options.readB2Sha1(path, options.signal);\n\t\tconst contentSha1 = typeof result === \"object\" && result !== null ? result.contentSha1 : result;\n\t\tconst bytesVerified = typeof result === \"object\" && result !== null ? Math.max(0, result.bytesRead) : 0;\n\t\tconst preparedPath = {\n\t\t\t...path,\n\t\t\tcontentSha1,\n\t\t\tcontentSha1State: syncSha1StateOf({ contentSha1 })\n\t\t};\n\t\tif (contentSha1 === null) return {\n\t\t\tpath: preparedPath,\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified,\n\t\t\tevent: unavailableSha1PathEvent(path),\n\t\t\taborted: false\n\t\t};\n\t\treturn {\n\t\t\tpath: preparedPath,\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified,\n\t\t\taborted: false\n\t\t};\n\t} catch (err) {\n\t\tif (options.signal?.aborted || isAbortError(err)) return {\n\t\t\tpath,\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: true\n\t\t};\n\t\tconst error = toError(err);\n\t\treturn {\n\t\t\tpath,\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\tevent: {\n\t\t\t\ttype: \"skip\",\n\t\t\t\tpath: path.relativePath,\n\t\t\t\tsize: 0,\n\t\t\t\tmessage: `sha1 comparison skipped because B2 verification failed: ${formatHashError(error)}`\n\t\t\t},\n\t\t\taborted: false\n\t\t};\n\t}\n}\nfunction comparableSha1(path) {\n\tconst state = syncSha1StateOf(path);\n\tif (state.kind === \"verified\") return {\n\t\tkind: \"verified\",\n\t\tvalue: state.value\n\t};\n\tif (state.kind === \"untrusted\") return {\n\t\tkind: \"untrusted\",\n\t\tvalue: state.value\n\t};\n\treturn { kind: \"unavailable\" };\n}\nfunction untrustedSha1CouldSuppressTransfer(source, dest) {\n\tif (source.kind === \"untrusted\" && dest.kind === \"verified\") return source.value === dest.value;\n\tif (dest.kind === \"untrusted\" && source.kind === \"verified\") return dest.value === source.value;\n\tif (source.kind === \"untrusted\" && dest.kind === \"untrusted\") return source.value !== null && source.value === dest.value;\n\treturn false;\n}\nfunction withB2ContentSha1(path) {\n\tif (!isB2SyncPath(path) || path.contentSha1 !== void 0 || path.contentSha1State !== void 0) return path;\n\tconst contentSha1 = selectB2ComparableSha1(path.selectedVersion);\n\treturn {\n\t\t...path,\n\t\tcontentSha1,\n\t\tcontentSha1State: syncSha1StateOf({ contentSha1 })\n\t};\n}\nfunction hasUnavailableB2Sha1(pair) {\n\tconst [source, dest] = pair;\n\treturn source !== null && isB2SyncPath(source) && comparableSha1(source).kind === \"unavailable\" || dest !== null && isB2SyncPath(dest) && comparableSha1(dest).kind === \"unavailable\";\n}\nfunction hasUntrustedSha1(pair) {\n\tconst [source, dest] = pair;\n\treturn source !== null && comparableSha1(source).kind === \"untrusted\" || dest !== null && comparableSha1(dest).kind === \"untrusted\";\n}\nfunction hasVerifiableUntrustedSha1(pair) {\n\tconst [source, dest] = pair;\n\treturn source !== null && verifiableUntrustedSha1(source) || dest !== null && verifiableUntrustedSha1(dest);\n}\nfunction verifiableUntrustedSha1(path) {\n\tconst state = comparableSha1(path);\n\treturn state.kind === \"untrusted\" && state.value !== null;\n}\nfunction hasB2Path(pair) {\n\tconst [source, dest] = pair;\n\treturn source !== null && isB2SyncPath(source) || dest !== null && isB2SyncPath(dest);\n}\nfunction isB2SyncPath(path) {\n\treturn \"selectedVersion\" in path;\n}\nfunction isLocalSyncPath(path) {\n\treturn \"absolutePath\" in path;\n}\n/**\n* Creates a successful no-op compare preparation result for a pair.\n*\n* @param pair - Source/destination pair from {@link zipFolders}.\n* @param bytesHashed - Local file bytes read while preparing the pair.\n* @param bytesVerified - B2 bytes read while verifying untrusted SHA-1 metadata.\n*\n* @returns A ready preparation result that allows action generation.\n*/\nfunction readyComparePair(pair, bytesHashed = 0, bytesVerified = 0) {\n\treturn {\n\t\tpair,\n\t\tevents: [],\n\t\terrors: [],\n\t\tbytesHashed,\n\t\tbytesVerified,\n\t\tskipActionGeneration: false,\n\t\taborted: false\n\t};\n}\nfunction skipped(pair, event, error, bytesHashed = 0, bytesVerified = 0) {\n\treturn {\n\t\tpair,\n\t\tevents: [event],\n\t\terrors: error !== void 0 ? [error] : [],\n\t\tbytesHashed,\n\t\tbytesVerified,\n\t\tskipActionGeneration: true,\n\t\taborted: false\n\t};\n}\nfunction aborted(pair) {\n\treturn {\n\t\tpair,\n\t\tevents: [],\n\t\terrors: [],\n\t\tbytesHashed: 0,\n\t\tbytesVerified: 0,\n\t\tskipActionGeneration: true,\n\t\taborted: true\n\t};\n}\nfunction unavailableSha1Event(pair) {\n\treturn unavailableSha1PathEvent({ relativePath: (pair[0] ?? pair[1])?.relativePath ?? \"\" });\n}\nfunction unavailableSha1PathEvent(path) {\n\treturn {\n\t\ttype: \"skip\",\n\t\tpath: path.relativePath,\n\t\tsize: 0,\n\t\tmessage: \"sha1 comparison skipped because a verifiable SHA-1 is unavailable\"\n\t};\n}\nfunction normalizeConcurrency(value) {\n\tif (value === void 0 || !Number.isFinite(value) || value < 1) return 1;\n\treturn Math.max(1, Math.floor(value));\n}\n//#endregion\nexport { assertSupportedCompareMode, filesAreDifferent, preparePairForCompare, preparePairsForCompare, readyComparePair };\n\n//# sourceMappingURL=compare.js.map","import { SkipAction } from \"../actions/index.js\";\nimport { assertSupportedCompareMode, filesAreDifferent } from \"./compare.js\";\n//#region src/sync/policies/index.ts\n/**\n* Converts a paired source/dest tuple into zero or more sync actions based on the\n* sync direction, compare mode, and keep policy.\n* For `compareMode: 'sha1'`, prefer the high-level `synchronize()` API so local\n* file hashes and comparable B2 hashes are prepared before actions are generated.\n* Low-level callers must pass pairs with local `contentSha1` values already\n* computed and B2 `contentSha1` values containing any comparable metadata fallback.\n*\n* @param pair - The source/dest file pair from {@link zipFolders}.\n* @param direction - The sync direction.\n* @param compareMode - How to compare files for differences.\n* @param keepMode - Policy for destination-only files.\n* @param keepDays - Retention period when keepMode is 'keep-days'.\n* @param nowMillis - Current time in milliseconds, used for keep-days calculation.\n* @param factory - Factory to create the concrete action objects.\n* @param compareThreshold - Tolerance for the comparison.\n*/\nfunction* generateActions(pair, direction, compareMode, keepMode, keepDays, nowMillis, factory, compareThreshold) {\n\tassertSupportedCompareMode(compareMode);\n\tconst [source, dest] = pair;\n\tif (source !== null && dest === null) yield* actionsForSourceOnly(source, direction, factory);\n\telse if (source === null && dest !== null) yield* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory);\n\telse if (source !== null && dest !== null) yield* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory);\n}\nfunction* actionsForSourceOnly(source, direction, factory) {\n\tswitch (direction) {\n\t\tcase \"local-to-b2\":\n\t\t\tyield factory.upload(source);\n\t\t\tbreak;\n\t\tcase \"b2-to-local\":\n\t\t\tyield factory.download(source, null);\n\t\t\tbreak;\n\t\tcase \"b2-to-b2\":\n\t\t\tyield factory.copy(source, source.relativePath);\n\t\t\tbreak;\n\t}\n}\nfunction* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory) {\n\tif (keepMode === \"no-delete\") {\n\t\tyield new SkipAction(dest.relativePath, \"not in source, keep-mode is no-delete\");\n\t\treturn;\n\t}\n\tif (keepMode === \"keep-days\") {\n\t\tconst ageDays = (nowMillis - dest.modTimeMillis) / (1440 * 60 * 1e3);\n\t\tif (ageDays < keepDays) {\n\t\t\tyield new SkipAction(dest.relativePath, `not in source, keeping for ${Math.ceil(keepDays - ageDays)} more days`);\n\t\t\treturn;\n\t\t}\n\t}\n\tswitch (direction) {\n\t\tcase \"local-to-b2\":\n\t\t\tyield factory.removeOrphan(dest);\n\t\t\tbreak;\n\t\tcase \"b2-to-local\":\n\t\t\tyield factory.deleteLocal(dest);\n\t\t\tbreak;\n\t\tcase \"b2-to-b2\":\n\t\t\tyield factory.removeOrphan(dest);\n\t\t\tbreak;\n\t}\n}\nfunction* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory) {\n\tif (!filesAreDifferent(source, dest, compareMode, compareThreshold)) {\n\t\tyield new SkipAction(source.relativePath, \"files are the same\");\n\t\treturn;\n\t}\n\tswitch (direction) {\n\t\tcase \"local-to-b2\":\n\t\t\tyield factory.upload(source, dest);\n\t\t\tbreak;\n\t\tcase \"b2-to-local\":\n\t\t\tyield factory.download(source, dest);\n\t\t\tbreak;\n\t\tcase \"b2-to-b2\":\n\t\t\tyield factory.copyB2Path?.(source, dest) ?? factory.copy(source, dest.relativePath);\n\t\t\tbreak;\n\t}\n}\n//#endregion\nexport { generateActions };\n\n//# sourceMappingURL=index.js.map","//#region src/sync/path-safety.ts\nvar RESERVED_SYNC_TEMP_FILE_RE = /^\\.b2sdk-[0-9a-f]{24}-[^/\\\\]+-[0-9a-f]{32}\\.partial$/i;\nvar UUID_HEX_RE = /^[0-9a-f]{32}$/i;\n/**\n* Checks whether a basename is reserved for SDK-owned sync partial files.\n* @param name - Basename to inspect.\n*\n* @returns Whether the basename matches the SDK reserved partial-file pattern.\n*\n* @internal\n*/\nfunction isReservedSyncTempFileName(name) {\n\treturn RESERVED_SYNC_TEMP_FILE_RE.test(name);\n}\n/**\n* Rejects sync paths whose basename is reserved for SDK-owned temporary files.\n* @param relativePath - Sync-relative path using slash separators.\n*\n* @throws If any path segment uses the SDK's reserved temporary-file pattern.\n*\n* @internal\n*/\nfunction assertSyncPathAllowed(relativePath) {\n\tif (relativePath.split(/[\\\\/]+/).filter(Boolean).some((part) => isReservedSyncTempFileName(part))) throw new Error(`Sync path uses reserved SDK temporary-file name: ${relativePath}`);\n}\n/**\n* Creates a download staging basename inside the SDK-reserved temp namespace.\n* @param finalName - Final destination basename.\n* @param uuid - UUID used to make the temp basename unique.\n*\n* @returns A basename that local and B2 scanners reject as SDK-owned temp data.\n*\n* @throws If the provided UUID cannot be normalized to 32 hex characters.\n*\n* @internal\n*/\nfunction makeReservedSyncTempFileName(finalName, uuid) {\n\tif (finalName.length === 0 || /[\\\\/]/.test(finalName)) throw new Error(\"invalid sync temporary-file basename\");\n\tconst hex = uuid.replaceAll(\"-\", \"\").toLowerCase();\n\tif (!UUID_HEX_RE.test(hex)) throw new Error(\"invalid sync temporary-file nonce\");\n\treturn `.b2sdk-${hex.slice(0, 24)}-${finalName}-${hex}.partial`;\n}\n/**\n* Validates B2 relative names before they are materialized on a local filesystem.\n*\n* @param relPath - B2-style relative path.\n*\n* @returns Validated path segments.\n*\n* @throws When the path is empty, absolute, platform-ambiguous, or contains traversal.\n*\n* @internal\n*/\nfunction safeRelativePathSegments(relPath) {\n\tassertSyncPathAllowed(relPath);\n\tif (relPath.length === 0 || relPath.includes(\"\\0\") || relPath.includes(\"\\\\\") || relPath.startsWith(\"/\") || /^[A-Za-z]:/.test(relPath)) throw new Error(\"unsafe local destination path\");\n\tconst segments = relPath.split(\"/\");\n\tif (segments.some((segment) => segment.length === 0 || segment === \".\" || segment === \"..\" || segment.includes(\":\") || segment.endsWith(\".\") || segment.endsWith(\" \") || WINDOWS_RESERVED_NAME.test(segment))) throw new Error(\"unsafe local destination path\");\n\treturn segments;\n}\nvar WINDOWS_RESERVED_NAME = /^(con|prn|aux|nul|conin\\$|conout\\$|com[0-9\\u00b9\\u00b2\\u00b3]|lpt[0-9\\u00b9\\u00b2\\u00b3])(?:\\..*)?$/i;\n/**\n* Throws if {@link target} is outside {@link root} or names the root itself.\n*\n* @param root - Resolved filesystem root.\n* @param target - Candidate path to validate.\n* @param path - Node path module.\n*\n* @throws When the target is outside the root or equal to the root.\n*\n* @internal\n*/\nfunction assertPathInsideRoot(root, target, path) {\n\tconst relative = path.relative(root, target);\n\tif (relative.length === 0 || relative === \"..\" || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) throw new Error(\"unsafe local destination path\");\n}\n/**\n* Returns the platform's no-follow open flag when available.\n*\n* @param constants - Node filesystem constants.\n*\n* @returns The `O_NOFOLLOW` bit or `0`.\n*\n* @internal\n*/\nfunction noFollowFlag(constants) {\n\treturn constants.O_NOFOLLOW ?? 0;\n}\n/**\n* Checks whether an unknown thrown value has a specific Node error code.\n*\n* @param err - Unknown thrown value.\n* @param code - Expected Node error code.\n*\n* @returns True when the value exposes the expected code.\n*\n* @internal\n*/\nfunction hasErrorCode(err, code) {\n\treturn err.code === code;\n}\n//#endregion\nexport { assertPathInsideRoot, assertSyncPathAllowed, hasErrorCode, isReservedSyncTempFileName, makeReservedSyncTempFileName, noFollowFlag, safeRelativePathSegments };\n\n//# sourceMappingURL=path-safety.js.map","import { assertPathInsideRoot, hasErrorCode, noFollowFlag } from \"./path-safety.js\";\n//#region src/sync/download-staging.ts\n/** @internal */\nvar DOWNLOAD_STAGING_DIRECTORY_NAME = \".b2sdk-download-staging\";\n/** @internal */\nvar DOWNLOAD_STAGING_MARKER_NAME = \".b2sdk-staging-marker.partial\";\nvar CANONICAL_DOWNLOAD_STAGING_DIRECTORY_NAME = canonicalLocalFilesystemSegment(DOWNLOAD_STAGING_DIRECTORY_NAME);\nvar DOWNLOAD_STAGING_ENTRY_SUFFIX = \".download\";\nvar STALE_DOWNLOAD_STAGING_AGE_MS = 1440 * 60 * 1e3;\nvar MAX_STAGING_CLEANUP_CONCURRENCY = 8;\nvar MAX_CLEANUP_WARNING_ENTRIES = 3;\n/** @internal */\nvar DOWNLOAD_STAGING_ACTIVITY_ENTRY_LIMIT = 1024;\nvar reapedManagedDirectories = /* @__PURE__ */ new Map();\n/**\n* Checks whether a single path segment matches the SDK-managed staging directory name.\n* @param segment - Candidate path segment.\n*\n* @returns True when the segment is the reserved staging directory name under\n* local filesystem canonicalization.\n*\n* @internal\n*/\nfunction isDownloadStagingDirectorySegment(segment) {\n\treturn segment !== void 0 && canonicalLocalFilesystemSegment(segment) === CANONICAL_DOWNLOAD_STAGING_DIRECTORY_NAME;\n}\n/**\n* Creates a private SDK-managed staging directory under a local sync root.\n* @param rootRealPath - Resolved local sync root path.\n* @param path - Node path module used for platform-specific path operations.\n* @param randomUUID - UUID provider used to create unique staging entries.\n* @param statForDeviceCheck - Stat function used to verify filesystem devices.\n* @param beforeStagingMarkerWrite - Test hook called before marker creation.\n*\n* @returns The resolved staging directory path.\n*\n* @internal\n*/\nasync function createDownloadStagingDirectory(rootRealPath, path, randomUUID, statForDeviceCheck, beforeStagingMarkerWrite) {\n\tconst { chmod, lstat, mkdir, readdir, realpath, rm } = await import(\"node:fs/promises\");\n\tconst managedDirectory = path.join(rootRealPath, DOWNLOAD_STAGING_DIRECTORY_NAME);\n\ttry {\n\t\tawait mkdir(managedDirectory, { mode: PRIVATE_DOWNLOAD_DIRECTORY_MODE });\n\t} catch (err) {\n\t\tif (!hasErrorCode(err, \"EEXIST\")) throw err;\n\t}\n\tif (!(await lstat(managedDirectory)).isDirectory()) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is not a directory`);\n\tconst realManagedDirectory = await realpath(managedDirectory);\n\tassertPathInsideRoot(rootRealPath, realManagedDirectory, path);\n\tawait assertDownloadPathSameDevice(rootRealPath, realManagedDirectory, statForDeviceCheck, \"unsafe local destination path: cannot stage download across filesystems\");\n\tif (!await isManagedDownloadStagingRoot(realManagedDirectory)) {\n\t\tif ((await readdir(realManagedDirectory)).length > 0 && !await isManagedDownloadStagingRoot(realManagedDirectory)) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is reserved for SDK download staging`);\n\t}\n\tawait beforeStagingMarkerWrite?.(realManagedDirectory);\n\tawait writeStagingMarker(realManagedDirectory, path);\n\t/* v8 ignore next -- best-effort chmod */\n\tawait chmod(realManagedDirectory, PRIVATE_DOWNLOAD_DIRECTORY_MODE).catch(() => {});\n\tawait reapStaleDownloadStagingDirectoriesOnce(realManagedDirectory, path, Date.now());\n\tconst stagingDirectory = path.join(realManagedDirectory, `${Date.now()}-${randomUUID()}${DOWNLOAD_STAGING_ENTRY_SUFFIX}`);\n\tawait mkdir(stagingDirectory, { mode: PRIVATE_DOWNLOAD_DIRECTORY_MODE });\n\t/* v8 ignore next -- best-effort chmod */\n\tawait chmod(stagingDirectory, PRIVATE_DOWNLOAD_DIRECTORY_MODE).catch(() => {});\n\ttry {\n\t\tconst realStagingDirectory = await realpath(stagingDirectory);\n\t\tassertPathInsideRoot(realManagedDirectory, realStagingDirectory, path);\n\t\tawait assertDownloadPathSameDevice(rootRealPath, realStagingDirectory, statForDeviceCheck, \"unsafe local destination path: cannot stage download across filesystems\");\n\t\tawait beforeStagingMarkerWrite?.(realStagingDirectory);\n\t\tawait writeStagingMarker(realStagingDirectory, path);\n\t\treturn realStagingDirectory;\n\t} catch (err) {\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait rm(stagingDirectory, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t}).catch(() => {});\n\t\tthrow err;\n\t}\n}\n/**\n* Returns true when a scan-root entry is an SDK-managed download staging root.\n* @param directory - Candidate directory to inspect.\n*\n* @returns True when the directory contains SDK staging markers.\n*\n* @internal\n*/\nasync function isManagedDownloadStagingRoot(directory) {\n\tconst { lstat, readdir } = await import(\"node:fs/promises\");\n\tconst path = await import(\"node:path\");\n\ttry {\n\t\tif ((await lstat(path.join(directory, \".b2sdk-staging-marker.partial\"))).isFile()) return true;\n\t} catch (err) {\n\t\tif (!hasErrorCode(err, \"ENOENT\")) return false;\n\t}\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(directory, { withFileTypes: true });\n\t} catch {\n\t\treturn false;\n\t}\n\tfor (const entry of entries) {\n\t\tif (!entry.isDirectory() || !entry.name.endsWith(DOWNLOAD_STAGING_ENTRY_SUFFIX)) continue;\n\t\ttry {\n\t\t\tif ((await lstat(path.join(directory, entry.name, \".b2sdk-staging-marker.partial\"))).isFile()) return true;\n\t\t} catch {}\n\t}\n\treturn false;\n}\nvar PRIVATE_DOWNLOAD_FILE_MODE = 384;\nvar PRIVATE_DOWNLOAD_DIRECTORY_MODE = 448;\nasync function writeStagingMarker(directory, path) {\n\tconst { constants } = await import(\"node:fs\");\n\tconst { lstat, open } = await import(\"node:fs/promises\");\n\tconst markerPath = path.join(directory, DOWNLOAD_STAGING_MARKER_NAME);\n\tlet handle;\n\ttry {\n\t\thandle = await open(markerPath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | noFollowFlag(constants), PRIVATE_DOWNLOAD_FILE_MODE);\n\t\t/* v8 ignore next -- best-effort chmod */\n\t\tawait handle.chmod(PRIVATE_DOWNLOAD_FILE_MODE).catch(() => {});\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"EEXIST\") || hasErrorCode(err, \"ELOOP\")) {\n\t\t\tif ((await lstat(markerPath).catch(() => void 0))?.isFile() === true) return;\n\t\t\tthrow new Error(\"unsafe local destination path: staging marker is not a regular file\");\n\t\t}\n\t\tthrow err;\n\t} finally {\n\t\t/* v8 ignore next -- best-effort close */\n\t\tawait handle?.close().catch(() => {});\n\t}\n}\n/**\n* Verifies that a candidate path is on the same filesystem device as the root.\n* @param rootRealPath - Resolved local sync root path.\n* @param candidateRealPath - Resolved candidate path to compare.\n* @param statForDeviceCheck - Stat function used to read device IDs.\n* @param message - Error message used when devices differ.\n*\n* @internal\n*/\nasync function assertDownloadPathSameDevice(rootRealPath, candidateRealPath, statForDeviceCheck, message) {\n\tconst [rootStats, candidateStats] = await Promise.all([statForDeviceCheck(rootRealPath), statForDeviceCheck(candidateRealPath)]);\n\tif (rootStats.dev !== candidateStats.dev) throw new Error(message);\n}\nasync function reapStaleDownloadStagingDirectoriesOnce(managedDirectory, path, nowMillis) {\n\tconst previous = reapedManagedDirectories.get(managedDirectory);\n\tif (previous !== void 0) {\n\t\tawait previous;\n\t\treturn;\n\t}\n\tconst next = reapStaleDownloadStagingDirectories(managedDirectory, path, nowMillis).finally(() => {\n\t\tif (reapedManagedDirectories.get(managedDirectory) === next) reapedManagedDirectories.delete(managedDirectory);\n\t});\n\treapedManagedDirectories.set(managedDirectory, next);\n\tawait next;\n}\nasync function reapStaleDownloadStagingDirectories(managedDirectory, path, nowMillis) {\n\tconst { readdir, realpath, rm } = await import(\"node:fs/promises\");\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(managedDirectory, { withFileTypes: true });\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"ENOENT\")) return;\n\t\temitCleanupWarning(\"failed to inspect B2 SDK download staging entries\");\n\t\treturn;\n\t}\n\tconst cleanupErrors = [];\n\tawait forEachWithConcurrency(entries, MAX_STAGING_CLEANUP_CONCURRENCY, async (entry) => {\n\t\tif (!entry.isDirectory() || !entry.name.endsWith(DOWNLOAD_STAGING_ENTRY_SUFFIX)) return;\n\t\tconst candidate = path.join(managedDirectory, entry.name);\n\t\tconst activity = await readManagedStagingEntryActivity(candidate, path);\n\t\tif (activity === void 0 || !stagingActivityIsStale(activity, nowMillis)) return;\n\t\tconst realCandidate = await realpath(candidate).catch(() => {\n\t\t\tcleanupErrors.push({\n\t\t\t\tentryName: entry.name,\n\t\t\t\toperation: \"inspect\"\n\t\t\t});\n\t\t});\n\t\tif (realCandidate === void 0) return;\n\t\ttry {\n\t\t\tassertPathInsideRoot(managedDirectory, realCandidate, path);\n\t\t\tconst latestActivity = await readManagedStagingEntryActivity(candidate, path);\n\t\t\tif (latestActivity === void 0 || latestActivity.signature !== activity.signature || !stagingActivityIsStale(latestActivity, nowMillis)) return;\n\t\t\tawait rm(realCandidate, {\n\t\t\t\trecursive: true,\n\t\t\t\tforce: true\n\t\t\t});\n\t\t} catch {\n\t\t\tcleanupErrors.push({\n\t\t\t\tentryName: entry.name,\n\t\t\t\toperation: \"remove\"\n\t\t\t});\n\t\t}\n\t});\n\tif (cleanupErrors.length > 0) {\n\t\tconst noun = cleanupErrors.length === 1 ? \"entry\" : \"entries\";\n\t\temitCleanupWarning(`failed to reap ${cleanupErrors.length} stale B2 SDK download staging ${noun}: ${cleanupErrors.slice(0, MAX_CLEANUP_WARNING_ENTRIES).map(formatCleanupWarning).join(\"; \")}`);\n\t}\n}\nasync function readManagedStagingEntryActivity(candidate, path) {\n\tconst { lstat, readdir } = await import(\"node:fs/promises\");\n\ttry {\n\t\tconst [directoryStats, markerStats] = await Promise.all([lstat(candidate), lstat(path.join(candidate, DOWNLOAD_STAGING_MARKER_NAME))]);\n\t\tif (!directoryStats.isDirectory() || !markerStats.isFile()) return void 0;\n\t\tconst entries = await readdir(candidate, { withFileTypes: true });\n\t\tif (entries.length > 1024) return void 0;\n\t\tconst statsParts = [`.:${stagingStatsSignature(directoryStats)}`, `${DOWNLOAD_STAGING_MARKER_NAME}:${stagingStatsSignature(markerStats)}`];\n\t\tlet newestActivityMs = Math.max(stagingStatsActivityMs(directoryStats), stagingStatsActivityMs(markerStats));\n\t\tfor (const entry of [...entries].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {\n\t\t\tconst stats = await lstat(path.join(candidate, entry.name));\n\t\t\tstatsParts.push(`${entry.name}:${stagingStatsSignature(stats)}`);\n\t\t\tnewestActivityMs = Math.max(newestActivityMs, stagingStatsActivityMs(stats));\n\t\t}\n\t\treturn {\n\t\t\tnewestActivityMs,\n\t\t\tsignature: statsParts.join(\"|\")\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction stagingStatsActivityMs(stats) {\n\treturn stats.mtimeMs;\n}\nfunction stagingStatsSignature(stats) {\n\treturn `${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeMs}:${stats.ctimeMs}`;\n}\nfunction stagingActivityIsStale(activity, nowMillis) {\n\treturn nowMillis - activity.newestActivityMs >= STALE_DOWNLOAD_STAGING_AGE_MS;\n}\nfunction formatCleanupWarning(error) {\n\treturn `${error.operation} ${safeWarningName(error.entryName)}`;\n}\nfunction safeWarningName(name) {\n\tconst chars = Array.from(name);\n\tconst bounded = chars.slice(0, 80).join(\"\");\n\tconst suffix = chars.length > 80 ? \"...\" : \"\";\n\treturn JSON.stringify(`${bounded.replace(/[^A-Za-z0-9._-]/g, \"?\")}${suffix}`);\n}\nfunction canonicalLocalFilesystemSegment(segment) {\n\treturn segment.normalize(\"NFC\").toLocaleLowerCase(\"en-US\");\n}\nasync function forEachWithConcurrency(items, concurrency, fn) {\n\tlet index = 0;\n\tconst workers = Array.from({ length: Math.min(concurrency, items.length) }, async () => {\n\t\twhile (index < items.length) {\n\t\t\tconst item = items[index];\n\t\t\tindex += 1;\n\t\t\tif (item !== void 0) await fn(item);\n\t\t}\n\t});\n\tawait Promise.all(workers);\n}\nfunction emitCleanupWarning(message) {\n\tglobalThis.process?.emitWarning?.(message, { code: \"B2SDK_DOWNLOAD_STAGING_CLEANUP_FAILED\" });\n}\n//#endregion\nexport { DOWNLOAD_STAGING_ACTIVITY_ENTRY_LIMIT, DOWNLOAD_STAGING_DIRECTORY_NAME, DOWNLOAD_STAGING_MARKER_NAME, assertDownloadPathSameDevice, createDownloadStagingDirectory, isDownloadStagingDirectorySegment, isManagedDownloadStagingRoot };\n\n//# sourceMappingURL=download-staging.js.map","import { isDownloadStagingDirectorySegment } from \"./download-staging.js\";\n//#region src/sync/prefix.ts\n/**\n* Treats the supplied string as a raw B2 key prefix without adding a folder boundary.\n*\n* B2 keys are byte-oriented names, not local filesystem paths. A backslash in a prefix is a real\n* key character and must not be rewritten to `/`; callers that want slash-delimited prefixes should\n* pass `/` explicitly.\n*\n* @param prefix - User-supplied raw B2 key prefix.\n*\n* @returns Raw B2 key prefix.\n*/\nfunction asRawB2KeyPrefix(prefix) {\n\treturn prefix;\n}\n/**\n* Normalizes a B2 object name into a safe folder-relative sync path.\n*\n* Object names are converted to forward-slash sync paths for local compatibility. Callers that scan\n* B2 must detect normalized-path collisions between distinct raw B2 keys before yielding entries.\n*\n* @param path - B2 object name or prefix-stripped suffix returned by a listing.\n* @param options - Optional normalization behavior for legacy slashless raw prefixes.\n*\n* @returns Folder-relative sync path.\n*\n* @throws When the object name cannot be represented as a safe relative path.\n*/\nfunction normalizeB2RelativePath(path, options = {}) {\n\tconst slashPath = path.split(\"\\\\\").join(\"/\");\n\tconst relativePath = options.stripLeadingSlashes === true ? stripSingleLeadingSlash(slashPath) : slashPath;\n\tconst segments = relativePath.split(\"/\");\n\tif (/^[A-Za-z]:/.test(relativePath) || segments.some((segment) => segmentIsUnsafe(segment))) throw new Error(\"Unsafe B2 file name cannot be used as a sync relative path\");\n\treturn relativePath;\n}\n/**\n* Converts a B2 object key under a configured raw prefix into a sync relative path.\n*\n* @param prefix - Raw B2 key prefix used for the scan or mutation guard.\n* @param fileName - Full B2 object key.\n*\n* @returns The normalized sync relative path for the key suffix.\n*/\nfunction b2KeyToRelativePathUnderPrefix(prefix, fileName) {\n\tconst rawPrefix = asRawB2KeyPrefix(prefix);\n\treturn normalizeB2RelativePath(rawPrefix === \"\" ? fileName : fileName.slice(rawPrefix.length), { stripLeadingSlashes: rawPrefix !== \"\" && !rawPrefix.endsWith(\"/\") });\n}\n/**\n* Returns whether a sync path is unsafe to materialize on Windows-compatible local filesystems.\n* B2-to-B2 syncs can preserve these object names, but B2-to-local syncs skip them before writing.\n*\n* @param relativePath - Folder-relative sync path.\n*\n* @returns True when any segment is Windows-dangerous or ambiguous.\n*/\nfunction localFilesystemSyncPathIsUnsafe(relativePath) {\n\tconst segments = relativePath.split(\"/\");\n\treturn isDownloadStagingDirectorySegment(segments[0]) || segments.some((segment) => segmentIsLocalFilesystemUnsafe(segment));\n}\n/**\n* Produces an approximate Windows/macOS-style canonical key for local collision detection.\n*\n* @param relativePath - Folder-relative sync path.\n*\n* @returns A canonicalized path key for detecting case/Unicode collisions before local writes.\n*/\nfunction localFilesystemCanonicalSyncPath(relativePath) {\n\treturn relativePath.split(\"/\").map((segment) => segment.normalize(\"NFC\").toLocaleLowerCase(\"en-US\")).join(\"/\");\n}\nfunction segmentIsUnsafe(segment) {\n\treturn segment === \"\" || segment === \".\" || segment === \"..\" || containsControlCharacter(segment);\n}\nfunction segmentIsLocalFilesystemUnsafe(segment) {\n\tif (segment.includes(\":\") || segment.endsWith(\".\") || segment.endsWith(\" \")) return true;\n\tconst basename = segment.split(\".\")[0]?.toUpperCase();\n\treturn basename !== void 0 && /^(CON|PRN|AUX|NUL|CONIN\\$|CONOUT\\$|COM[0-9¹²³]|LPT[0-9¹²³])$/u.test(basename);\n}\nfunction containsControlCharacter(segment) {\n\tfor (let index = 0; index < segment.length; index++) {\n\t\tconst code = segment.charCodeAt(index);\n\t\tif (code >= 0 && code <= 31) return true;\n\t}\n\treturn false;\n}\nfunction stripSingleLeadingSlash(path) {\n\treturn path.startsWith(\"/\") ? path.slice(1) : path;\n}\n//#endregion\nexport { asRawB2KeyPrefix, b2KeyToRelativePathUnderPrefix, localFilesystemCanonicalSyncPath, localFilesystemSyncPathIsUnsafe, normalizeB2RelativePath };\n\n//# sourceMappingURL=prefix.js.map","import { toError } from \"../util/to-error.js\";\n//#region src/sync/filesystem-errors.ts\n/**\n* Formats local filesystem errors without including host filesystem paths.\n* @param err - Unknown filesystem error.\n*\n* @returns A path-independent code or error name.\n*/\nfunction localFilesystemErrorReason(err) {\n\tconst error = toError(err);\n\tconst code = cleanFilesystemErrorPart(error.code);\n\tif (code !== \"\") return code;\n\tconst name = cleanFilesystemErrorPart(error.name);\n\tif (name !== \"\") return name;\n\treturn \"Error\";\n}\nfunction cleanFilesystemErrorPart(value) {\n\tif (typeof value !== \"string\") return \"\";\n\tlet cleaned = \"\";\n\tfor (const char of value) {\n\t\tconst code = char.charCodeAt(0);\n\t\tif (code < 32 || code === 127) continue;\n\t\tcleaned += char;\n\t\tif (cleaned.length >= 80) break;\n\t}\n\tconst trimmed = cleaned.trim();\n\treturn /[\\\\/]/.test(trimmed) ? \"\" : trimmed;\n}\n//#endregion\nexport { localFilesystemErrorReason };\n\n//# sourceMappingURL=filesystem-errors.js.map","//#region src/sync/local-filesystem-root.ts\nvar localFilesystemRoots = /* @__PURE__ */ new WeakSet();\n/**\n* Privately marks SDK local folders that are backed by the filesystem.\n* @param folder - Local folder instance to mark.\n*\n* @internal\n*/\nfunction registerLocalFilesystemRoot(folder) {\n\tlocalFilesystemRoots.add(folder);\n}\n/**\n* Returns true for SDK local folders backed by the filesystem.\n* @param folder - Sync folder to inspect.\n*\n* @returns True when the folder was registered as an SDK filesystem root.\n*\n* @internal\n*/\nfunction isLocalFilesystemRoot(folder) {\n\treturn localFilesystemRoots.has(folder);\n}\n//#endregion\nexport { isLocalFilesystemRoot, registerLocalFilesystemRoot };\n\n//# sourceMappingURL=local-filesystem-root.js.map","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { normalizeSha1TimeoutMillis } from \"./sha1-options.js\";\n//#region src/sync/b2-sha1-reader.ts\nvar MAX_CONSECUTIVE_EMPTY_READ_CHUNKS = 1024;\n/**\n* Reads one non-empty stream chunk with an idle timeout and optional abort signal.\n* Empty chunks are not progress; too many consecutive empty chunks fail with the\n* same stalled-read diagnostic used for pending reads.\n*\n* @param reader - Locked reader to read from.\n* @param timeoutMillis - Idle timeout in milliseconds for this read.\n* @param stalledMessage - Error message used when the read makes no progress.\n* @param signal - Optional abort signal to observe while reading.\n*\n* @returns The next stream read result.\n*\n* @internal\n*/\nasync function readStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal) {\n\tlet emptyChunks = 0;\n\twhile (true) {\n\t\tconst result = await readRawStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal);\n\t\tif (result.done || result.value.byteLength > 0) return result;\n\t\temptyChunks += 1;\n\t\tif (emptyChunks > MAX_CONSECUTIVE_EMPTY_READ_CHUNKS) throw new Error(stalledMessage);\n\t}\n}\nasync function readRawStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal) {\n\tsignal?.throwIfAborted();\n\tlet timeout;\n\tlet removeAbortListener;\n\tconst readPromise = reader.read();\n\tconst timeoutPromise = timeoutMillis === Number.POSITIVE_INFINITY ? void 0 : new Promise((_, reject) => {\n\t\ttimeout = setTimeout(() => {\n\t\t\treject(new Error(stalledMessage));\n\t\t}, timeoutMillis);\n\t});\n\tconst abortPromise = signal === void 0 ? void 0 : new Promise((_, reject) => {\n\t\tconst onAbort = () => reject(signal.reason ?? /* @__PURE__ */ new Error(\"aborted\"));\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\tif (timeoutPromise === void 0 && abortPromise === void 0) return await readPromise;\n\t\tconst candidates = [readPromise];\n\t\tif (timeoutPromise !== void 0) candidates.push(timeoutPromise);\n\t\tif (abortPromise !== void 0) candidates.push(abortPromise);\n\t\treturn await Promise.race(candidates);\n\t} finally {\n\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t\tremoveAbortListener?.();\n\t\treadPromise.catch(() => {});\n\t}\n}\n/**\n* Hashes a B2 response body as SHA-1 with idle timeout, abort, and size checks.\n*\n* @param body - Response body stream to hash.\n* @param signal - Optional abort signal to observe while reading.\n* @param options - Optional timeout and byte-count limits.\n*\n* @returns The computed SHA-1 and number of bytes read.\n*\n* @internal\n*/\nasync function hashReadableStreamSha1(body, signal, options) {\n\tconst hash = new IncrementalSha1();\n\tconst reader = body.getReader();\n\tconst idleTimeoutMillis = options?.idleTimeoutMillis ?? normalizeSha1TimeoutMillis(void 0);\n\tconst maxBytes = options?.maxBytes ?? Number.POSITIVE_INFINITY;\n\tconst expectedBytes = options?.expectedBytes;\n\tlet bytesRead = 0;\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = await readStreamChunkWithTimeout(reader, idleTimeoutMillis, `sha1 B2 read stalled for ${idleTimeoutMillis} ms`, signal);\n\t\t\tif (done) break;\n\t\t\tbytesRead += value.byteLength;\n\t\t\tif (bytesRead > maxBytes) throw new Error(`sha1 B2 read exceeded ${maxBytes} byte verification budget`);\n\t\t\tawait hash.update(value);\n\t\t}\n\t\tif (expectedBytes !== void 0 && bytesRead !== expectedBytes) throw new Error(`sha1 B2 read ended after ${bytesRead} bytes, expected ${expectedBytes}`);\n\t\treturn {\n\t\t\tcontentSha1: await hash.digest(),\n\t\t\tbytesRead\n\t\t};\n\t} catch (err) {\n\t\treader.cancel(err).catch(() => {});\n\t\tthrow err;\n\t} finally {\n\t\treader.releaseLock();\n\t}\n}\n/**\n* Applies an absolute verification deadline while forwarding parent aborts.\n*\n* @param signal - Optional parent abort signal.\n* @param timeoutMillis - Absolute deadline in milliseconds.\n* @param run - Operation to run with the derived deadline signal.\n*\n* @returns The operation result.\n*\n* @internal\n*/\nasync function withSha1VerificationDeadline(signal, timeoutMillis, run) {\n\tconst controller = new AbortController();\n\tconst abortFromParent = () => controller.abort(signal?.reason);\n\tif (signal?.aborted) abortFromParent();\n\tsignal?.addEventListener(\"abort\", abortFromParent, { once: true });\n\tlet timeout;\n\tconst timeoutPromise = new Promise((_, reject) => {\n\t\ttimeout = setTimeout(() => {\n\t\t\tconst error = /* @__PURE__ */ new Error(`sha1 B2 verification exceeded ${timeoutMillis} ms`);\n\t\t\tcontroller.abort(error);\n\t\t\treject(error);\n\t\t}, timeoutMillis);\n\t});\n\tconst runPromise = run(controller.signal);\n\ttry {\n\t\treturn await Promise.race([runPromise, timeoutPromise]);\n\t} finally {\n\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t\tsignal?.removeEventListener(\"abort\", abortFromParent);\n\t\trunPromise.catch(() => {});\n\t}\n}\n/**\n* Bounds B2 SHA-1 verification downloads to the selected object's size and optional ceiling.\n*\n* @param contentLength - Selected B2 object byte length.\n* @param ceiling - Optional lower verification budget.\n*\n* @returns The byte budget to enforce.\n*\n* @internal\n*/\nfunction normalizeSha1VerificationMaxBytes(contentLength, ceiling) {\n\tconst contentBudget = Math.max(0, Math.floor(contentLength));\n\tif (ceiling === void 0) return contentBudget;\n\tif (!Number.isFinite(ceiling) || ceiling < 0) return contentBudget;\n\treturn Math.min(contentBudget, Math.floor(ceiling));\n}\n//#endregion\nexport { hashReadableStreamSha1, normalizeSha1VerificationMaxBytes, readStreamChunkWithTimeout, withSha1VerificationDeadline };\n\n//# sourceMappingURL=b2-sha1-reader.js.map","import { sanitizeErrorReason } from \"../util/error-reason.js\";\nimport { assertSameScannedRegularFile } from \"./local-file-identity.js\";\nimport { assertPathInsideRoot, hasErrorCode, makeReservedSyncTempFileName, noFollowFlag, safeRelativePathSegments } from \"./path-safety.js\";\nimport { DOWNLOAD_STAGING_DIRECTORY_NAME, assertDownloadPathSameDevice, createDownloadStagingDirectory, isDownloadStagingDirectorySegment } from \"./download-staging.js\";\nimport { readStreamChunkWithTimeout } from \"./b2-sha1-reader.js\";\n//#region src/sync/local-file-io.ts\n/** @internal */\nvar localFileIoTestHooks = {};\n/**\n* Verifies that a previously scanned local file still points at the same regular file.\n*\n* @param path - Scanned local path and file identity.\n*\n* @internal\n*/\nasync function validateScannedLocalFile(path) {\n\tawait (await openValidatedScannedLocalFile(path)).close();\n}\nasync function openValidatedScannedLocalFile(path) {\n\tconst { constants } = await import(\"node:fs\");\n\tconst { open } = await import(\"node:fs/promises\");\n\tconst flags = constants.O_RDONLY | noFollowFlag(constants) | (constants.O_NONBLOCK ?? 0);\n\tconst handle = await open(path.absolutePath, flags).catch((err) => {\n\t\tif (hasErrorCode(err, \"ELOOP\")) throw new Error(\"local file changed before upload: not a regular file\");\n\t\tthrow new Error(`local file changed before upload: could not open scanned file: ${sanitizeErrorReason(err)}`);\n\t});\n\ttry {\n\t\tassertSameScannedRegularFile(await handle.stat(), path, \"upload\", { platform: localFileIoTestHooks.platform });\n\t\treturn handle;\n\t} catch (err) {\n\t\tawait handle.close().catch(() => {});\n\t\tthrow err;\n\t}\n}\n/**\n* Streams a B2 download under a local sync root with path, timeout, and size checks.\n*\n* @param root - Local sync root.\n* @param relPath - Destination path relative to the root.\n* @param body - Download body stream.\n* @param options - Expected byte count, idle timeout, and optional abort signal.\n*\n* @internal\n*/\nasync function writeLocalStreamInsideRoot(root, relPath, body, options) {\n\tconst { constants } = await import(\"node:fs\");\n\tconst { link, lstat, mkdir, open, realpath, rename, rm, stat } = await import(\"node:fs/promises\");\n\tconst path = await import(\"node:path\");\n\tconst { randomUUID } = await import(\"node:crypto\");\n\tassertValidExpectedBytes(options.expectedBytes);\n\tconst segments = safeRelativePathSegments(relPath);\n\tif (isDownloadStagingDirectorySegment(segments[0])) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is reserved for SDK download staging`);\n\tconst rootRealPath = await realpath(root);\n\tlet current = rootRealPath;\n\tfor (const segment of segments.slice(0, -1)) {\n\t\tcurrent = path.join(current, segment);\n\t\ttry {\n\t\t\tawait mkdir(current);\n\t\t} catch (err) {\n\t\t\tif (!hasErrorCode(err, \"EEXIST\")) throw err;\n\t\t}\n\t\tif (!(await lstat(current)).isDirectory()) throw new Error(\"unsafe local destination path: parent is not a directory\");\n\t\tawait localFileIoTestHooks.afterParentDirectoryValidated?.(current);\n\t}\n\tconst destPath = path.join(rootRealPath, ...segments);\n\tassertPathInsideRoot(rootRealPath, destPath, path);\n\tconst parentRealPath = await realpath(path.dirname(destPath));\n\tconst finalPath = path.join(parentRealPath, path.basename(destPath));\n\tassertPathInsideRoot(rootRealPath, finalPath, path);\n\ttry {\n\t\tconst targetStats = await lstat(finalPath);\n\t\tif (targetStats.isSymbolicLink()) throw new Error(\"unsafe local destination path: target is a symbolic link\");\n\t\tif (targetStats.isFile() && targetStats.nlink > 1) throw new Error(\"unsafe local destination path: target has multiple hard links\");\n\t} catch (err) {\n\t\tif (!hasErrorCode(err, \"ENOENT\")) throw err;\n\t}\n\tconst statForDeviceCheck = localFileIoTestHooks.statForDeviceCheck ?? stat;\n\tawait assertDownloadPathSameDevice(rootRealPath, parentRealPath, statForDeviceCheck, \"unsafe local destination path: cannot publish download across filesystems\");\n\tlet parentHandle;\n\tlet anchoredParentPath;\n\t/* v8 ignore start -- Linux-only fd-relative path support is covered by Linux CI */\n\tif (globalThis.process?.platform === \"linux\" && constants.O_DIRECTORY !== void 0 && localFileIoTestHooks.disableProcFdAnchoring !== true) try {\n\t\tparentHandle = await open(parentRealPath, constants.O_RDONLY | constants.O_DIRECTORY | noFollowFlag(constants));\n\t\tanchoredParentPath = `/proc/self/fd/${parentHandle.fd}`;\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"ELOOP\") || hasErrorCode(err, \"ENOTDIR\")) throw new Error(\"unsafe local destination path: parent is not a directory\");\n\t\tthrow err;\n\t}\n\t/* v8 ignore stop */\n\tconst finalName = path.basename(destPath);\n\tconst finalWritePath = path.join(anchoredParentPath ?? parentRealPath, finalName);\n\tlet publishMode;\n\ttry {\n\t\tpublishMode = await replacementFileMode(finalPath);\n\t} catch (err) {\n\t\t/* v8 ignore next -- best-effort close during setup failure */\n\t\tawait parentHandle?.close().catch(() => {});\n\t\tthrow err;\n\t}\n\tlet stagingDirectory;\n\ttry {\n\t\tstagingDirectory = await createDownloadStagingDirectory(rootRealPath, path, randomUUID, statForDeviceCheck, localFileIoTestHooks.beforeStagingMarkerWrite);\n\t} catch (err) {\n\t\t/* v8 ignore next -- best-effort close during setup failure */\n\t\tawait parentHandle?.close().catch(() => {});\n\t\tthrow err;\n\t}\n\tconst tmpPath = path.join(stagingDirectory, `.b2sdk-${randomUUID()}.partial`);\n\tlet handle;\n\ttry {\n\t\thandle = await open(tmpPath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | noFollowFlag(constants), PRIVATE_DOWNLOAD_FILE_MODE);\n\t\t/* v8 ignore next -- best-effort chmod */\n\t\tawait handle.chmod(PRIVATE_DOWNLOAD_FILE_MODE).catch(() => {});\n\t\tawait localFileIoTestHooks.afterTempFileCreated?.(tmpPath, stagingDirectory);\n\t} catch (err) {\n\t\tawait parentHandle?.close().catch(() => {});\n\t\tawait rm(stagingDirectory, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t}).catch(() => {});\n\t\tthrow err;\n\t}\n\t/* v8 ignore stop */\n\ttry {\n\t\tconst tmpRealPath = await realpath(tmpPath);\n\t\tassertPathInsideRoot(stagingDirectory, tmpRealPath, path);\n\t} catch (err) {\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait handle?.close().catch(() => {});\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait rm(tmpPath, { force: true }).catch(() => {});\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait rm(stagingDirectory, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t}).catch(() => {});\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait parentHandle?.close().catch(() => {});\n\t\tthrow err;\n\t}\n\tconst writeHandle = handle;\n\tconst reader = body.getReader();\n\tlet completed = false;\n\ttry {\n\t\tlet bytesWritten = 0;\n\t\twhile (true) {\n\t\t\tconst { done, value } = await readStreamChunkWithTimeout(reader, options.idleTimeoutMillis, `download read stalled for ${options.idleTimeoutMillis} ms`, options.signal);\n\t\t\tif (done) break;\n\t\t\tif (bytesWritten + value.byteLength > options.expectedBytes) throw new Error(`download read exceeded ${options.expectedBytes} byte limit`);\n\t\t\tawait writeAll(writeHandle, value, bytesWritten);\n\t\t\tbytesWritten += value.byteLength;\n\t\t}\n\t\tif (bytesWritten !== options.expectedBytes) throw new Error(`download read ended after ${bytesWritten} bytes, expected ${options.expectedBytes}`);\n\t\tif (publishMode !== PRIVATE_DOWNLOAD_FILE_MODE)\n /* v8 ignore next -- best-effort mode preservation */\n\t\tawait writeHandle.chmod(publishMode).catch(() => {});\n\t\tawait writeHandle.close();\n\t\thandle = void 0;\n\t\tconst [parentRealPathBeforeRename, parentStatsBeforeRename] = await Promise.all([realpath(path.dirname(destPath)), stat(path.dirname(destPath))]);\n\t\tassertPathInsideRoot(rootRealPath, path.join(parentRealPathBeforeRename, path.basename(destPath)), path);\n\t\tawait localFileIoTestHooks.beforeFinalRename?.(parentRealPathBeforeRename);\n\t\tlet publishPath = finalWritePath;\n\t\tif (anchoredParentPath === void 0) {\n\t\t\tconst [parentRealPathAfterHook, parentStatsAfterHook] = await Promise.all([realpath(path.dirname(destPath)), stat(path.dirname(destPath))]);\n\t\t\tif (parentRealPathAfterHook !== parentRealPathBeforeRename || !sameParentIdentity(parentStatsAfterHook, parentStatsBeforeRename)) throw new Error(\"unsafe local destination path: parent changed before final publish\");\n\t\t\tpublishPath = path.join(parentRealPathAfterHook, path.basename(destPath));\n\t\t\tassertPathInsideRoot(rootRealPath, publishPath, path);\n\t\t}\n\t\tawait publishDownload(lstat, link, path, randomUUID, rename, rm, tmpPath, publishPath, options.expectedDestination);\n\t\tcompleted = true;\n\t} catch (err) {\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\treader.cancel(err).catch(() => {});\n\t\tthrow err;\n\t} finally {\n\t\treader.releaseLock();\n\t\tif (!completed) {\n\t\t\t/* v8 ignore next -- best-effort cleanup */\n\t\t\tawait handle?.close().catch(() => {});\n\t\t\t/* v8 ignore next -- best-effort cleanup */\n\t\t\tawait rm(tmpPath, { force: true }).catch(() => {});\n\t\t}\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait rm(stagingDirectory, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t}).catch(() => {});\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait parentHandle?.close().catch(() => {});\n\t}\n}\nfunction assertValidExpectedBytes(expectedBytes) {\n\tif (!Number.isSafeInteger(expectedBytes) || expectedBytes < 0) throw new Error(\"download expectedBytes must be a non-negative safe integer\");\n}\nasync function assertExpectedDownloadDestination(lstat, finalPath, expectedDestination) {\n\tif (expectedDestination === void 0) return;\n\ttry {\n\t\tconst stats = await lstat(finalPath);\n\t\tif (expectedDestination === null) throw new Error(\"local destination changed before download: file was created\");\n\t\tassertSameScannedRegularFile(stats, {\n\t\t\t...expectedDestination,\n\t\t\tabsolutePath: finalPath\n\t\t}, \"download\", { platform: localFileIoTestHooks.platform });\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"ENOENT\")) {\n\t\t\tif (expectedDestination === null) return;\n\t\t\tthrow new Error(\"local file changed before download: file missing\");\n\t\t}\n\t\tthrow err;\n\t}\n}\nasync function publishDownload(lstat, link, path, randomUUID, rename, rm, tmpPath, publishPath, expectedDestination) {\n\tawait assertExpectedDownloadDestination(lstat, publishPath, expectedDestination);\n\tawait localFileIoTestHooks.beforeDownloadPublish?.(publishPath);\n\tif (expectedDestination === void 0) {\n\t\tawait rename(tmpPath, publishPath);\n\t\treturn;\n\t}\n\tif (expectedDestination === null) {\n\t\tawait linkDownloadNoOverwrite(link, tmpPath, publishPath, \"local destination changed before download: file was created\");\n\t\t/* v8 ignore next -- staging cleanup is best-effort after a guarded publish succeeds. */\n\t\tawait rm(tmpPath, { force: true }).catch(() => {});\n\t\treturn;\n\t}\n\tconst backupPath = path.join(path.dirname(publishPath), makeReservedSyncTempFileName(path.basename(publishPath), randomUUID()));\n\tlet backupExists = false;\n\tlet removeBackup = false;\n\ttry {\n\t\ttry {\n\t\t\tawait rename(publishPath, backupPath);\n\t\t\tbackupExists = true;\n\t\t\tawait localFileIoTestHooks.afterDownloadBackupRename?.(backupPath);\n\t\t} catch (err) {\n\t\t\tif (hasErrorCode(err, \"ENOENT\")) throw new Error(\"local file changed before download: file missing\");\n\t\t\tthrow err;\n\t\t}\n\t\tassertSameScannedRegularFile(await lstat(backupPath), {\n\t\t\t...expectedDestination,\n\t\t\tabsolutePath: backupPath\n\t\t}, \"download\", {\n\t\t\tcompareChangeTime: false,\n\t\t\tplatform: localFileIoTestHooks.platform\n\t\t});\n\t\tawait linkDownloadNoOverwrite(link, tmpPath, publishPath, \"local destination changed before download: file was created\");\n\t\tremoveBackup = true;\n\t\t/* v8 ignore next -- staging cleanup is best-effort after a guarded publish succeeds. */\n\t\tawait rm(tmpPath, { force: true }).catch(() => {});\n\t} catch (err) {\n\t\tif (backupExists && !removeBackup) await restoreBackupWithoutOverwrite(link, rm, backupPath, publishPath).catch(() => {});\n\t\tthrow err;\n\t} finally {\n\t\tif (removeBackup)\n /* v8 ignore next -- old destination cleanup is best-effort after publish succeeds. */\n\t\tawait rm(backupPath, { force: true }).catch(() => {});\n\t}\n}\nasync function linkDownloadNoOverwrite(link, sourcePath, destPath, message) {\n\ttry {\n\t\tawait link(sourcePath, destPath);\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"EEXIST\")) throw new Error(message);\n\t\tthrow err;\n\t}\n}\nasync function restoreBackupWithoutOverwrite(link, rm, backupPath, publishPath) {\n\ttry {\n\t\tawait link(backupPath, publishPath);\n\t\tawait rm(backupPath, { force: true });\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"EEXIST\")) return;\n\t\tthrow err;\n\t}\n}\nvar PRIVATE_DOWNLOAD_FILE_MODE = 384;\nasync function replacementFileMode(filePath) {\n\tconst { lstat } = await import(\"node:fs/promises\");\n\ttry {\n\t\tconst stats = await lstat(filePath);\n\t\treturn stats.isFile() ? stats.mode & 511 : PRIVATE_DOWNLOAD_FILE_MODE;\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"ENOENT\")) return PRIVATE_DOWNLOAD_FILE_MODE;\n\t\tthrow err;\n\t}\n}\n/**\n* Deletes a scanned local file under a sync root without re-resolving attacker-controlled parents.\n*\n* @param root - Local sync root.\n* @param scannedPath - Previously scanned local file metadata.\n*\n* @internal\n*/\nasync function deleteLocalFileInsideRoot(root, scannedPath) {\n\tif (root === \"\") throw new Error(\"Local sync root required for filesystem mutation\");\n\tconst { constants } = await import(\"node:fs\");\n\tconst { lstat, open, realpath, stat, unlink } = await import(\"node:fs/promises\");\n\tconst path = await import(\"node:path\");\n\tconst segments = safeRelativePathSegments(scannedPath.relativePath);\n\tconst safeRoot = path.resolve(root);\n\tconst rootStats = await lstat(safeRoot);\n\tif (rootStats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${scannedPath.relativePath}`);\n\tif (!rootStats.isDirectory()) throw new Error(`Local sync root is not a directory: ${scannedPath.relativePath}`);\n\tconst rootRealPath = await realpath(safeRoot);\n\tconst expectedPath = path.join(rootRealPath, ...segments);\n\tassertPathInsideRoot(rootRealPath, expectedPath, path);\n\tif (path.resolve(scannedPath.absolutePath) !== expectedPath) throw new Error(`Refusing to delete outside sync root: ${scannedPath.relativePath}`);\n\tconst [parentRealPath, parentStats] = await Promise.all([realpath(path.dirname(expectedPath)), stat(path.dirname(expectedPath))]);\n\tconst finalPath = path.join(parentRealPath, path.basename(expectedPath));\n\tassertPathInsideRoot(rootRealPath, finalPath, path);\n\tconst platform = globalThis.process?.platform;\n\tlet parentHandle;\n\tlet anchoredParentPath;\n\t/* v8 ignore start -- Linux-only fd-relative path support is covered by Linux CI */\n\tif (platform === \"linux\" && constants.O_DIRECTORY !== void 0 && localFileIoTestHooks.disableProcFdAnchoring !== true) try {\n\t\tawait localFileIoTestHooks.beforeLocalDeleteOpenParent?.(parentRealPath);\n\t\tparentHandle = await open(parentRealPath, constants.O_RDONLY | constants.O_DIRECTORY | noFollowFlag(constants));\n\t\tanchoredParentPath = `/proc/self/fd/${parentHandle.fd}`;\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"ELOOP\") || hasErrorCode(err, \"ENOTDIR\")) throw new Error(\"unsafe local delete path: parent is not a directory\");\n\t\tthrow err;\n\t}\n\t/* v8 ignore stop */\n\ttry {\n\t\tconst unlinkPath = anchoredParentPath === void 0 ? finalPath : path.join(anchoredParentPath, path.basename(expectedPath));\n\t\tassertSameScannedRegularFile(await lstat(unlinkPath), {\n\t\t\t...scannedPath,\n\t\t\tabsolutePath: unlinkPath\n\t\t}, \"delete\", { platform: localFileIoTestHooks.platform });\n\t\tawait localFileIoTestHooks.beforeLocalDeleteUnlink?.(parentRealPath);\n\t\tif (anchoredParentPath === void 0 && localFileIoTestHooks.disableProcFdAnchoring === true && parentRealPath !== rootRealPath) throw new Error(\"unsafe local delete path: stable parent handle unavailable for unlink\");\n\t\tif (anchoredParentPath === void 0) {\n\t\t\tconst [parentRealPathBeforeUnlink, parentStatsBeforeUnlink] = await Promise.all([realpath(path.dirname(expectedPath)), stat(path.dirname(expectedPath))]);\n\t\t\tif (parentRealPathBeforeUnlink !== parentRealPath || !sameParentIdentity(parentStatsBeforeUnlink, parentStats)) throw new Error(\"unsafe local delete path: parent changed before unlink\");\n\t\t}\n\t\tassertSameScannedRegularFile(await lstat(unlinkPath), {\n\t\t\t...scannedPath,\n\t\t\tabsolutePath: unlinkPath\n\t\t}, \"delete\", { platform: localFileIoTestHooks.platform });\n\t\tawait unlink(unlinkPath);\n\t} finally {\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait parentHandle?.close().catch(() => {});\n\t}\n}\nfunction sameParentIdentity(current, expected) {\n\treturn current.dev === expected.dev && current.ino === expected.ino;\n}\nasync function writeAll(handle, data, position) {\n\tlet offset = 0;\n\twhile (offset < data.byteLength) {\n\t\tconst { bytesWritten } = await handle.write(data, offset, data.byteLength - offset, position + offset);\n\t\t/* v8 ignore next -- defensive: FileHandle.write should progress for non-empty chunks. */\n\t\tif (bytesWritten <= 0) throw new Error(\"download write made no progress\");\n\t\toffset += bytesWritten;\n\t}\n}\n//#endregion\nexport { DOWNLOAD_STAGING_DIRECTORY_NAME, deleteLocalFileInsideRoot, localFileIoTestHooks, validateScannedLocalFile, writeLocalStreamInsideRoot };\n\n//# sourceMappingURL=local-file-io.js.map","import { fileId } from \"../types/ids.js\";\nimport { FileSource } from \"../streams/file-source.js\";\nimport { CopyAction, DeleteLocalAction, DeleteRemoteAction, DownloadAction, HideAction, SkipAction, UploadAction } from \"./actions/index.js\";\nimport { zipFolders } from \"./pairing.js\";\nimport { sanitizeErrorReason } from \"../util/error-reason.js\";\nimport { DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS, normalizeSha1TimeoutMillis } from \"./sha1-options.js\";\nimport { readLocalSha1File } from \"./local-sha1.js\";\nimport { assertSupportedCompareMode, preparePairsForCompare, readyComparePair } from \"./policies/compare.js\";\nimport { generateActions } from \"./policies/index.js\";\nimport { safeRelativePathSegments } from \"./path-safety.js\";\nimport { asRawB2KeyPrefix, b2KeyToRelativePathUnderPrefix } from \"./prefix.js\";\nimport { localFilesystemErrorReason } from \"./filesystem-errors.js\";\nimport { isLocalFilesystemRoot } from \"./local-filesystem-root.js\";\nimport { hashReadableStreamSha1, normalizeSha1VerificationMaxBytes, withSha1VerificationDeadline } from \"./b2-sha1-reader.js\";\nimport { deleteLocalFileInsideRoot, validateScannedLocalFile, writeLocalStreamInsideRoot } from \"./local-file-io.js\";\n//#region src/sync/synchronizer.ts\nvar MAX_BUFFERED_SCAN_EVENTS = 100;\nvar MAX_AGGREGATE_FAILED_PATHS = 100;\nvar DEFAULT_DOWNLOAD_IDLE_TIMEOUT_MILLIS = 6e4;\n/**\n* Test hooks for bounded planning behavior.\n*\n* @internal\n*/\nvar synchronizerTestHooks = {};\n/**\n* Infers the sync direction from the source and destination folder types.\n* @param source - The folder to read files from.\n* @param dest - The folder to write files to.\n*\n* @returns The resolved sync direction based on folder types.\n*\n* @throws When the source and destination folder types form an unsupported combination.\n*/\nfunction resolveDirection(source, dest) {\n\tif (source.type === \"local\" && dest.type === \"b2\") return \"local-to-b2\";\n\tif (source.type === \"b2\" && dest.type === \"local\") return \"b2-to-local\";\n\tif (source.type === \"b2\" && dest.type === \"b2\") return \"b2-to-b2\";\n\tthrow new Error(`Unsupported sync direction: ${source.type} to ${dest.type}`);\n}\nasync function* synchronize(config) {\n\tconst { source, dest, options } = config;\n\tassertSupportedCompareMode(options.compareMode);\n\tconst direction = resolveDirection(source, dest);\n\tconst dryRun = options.dryRun ?? false;\n\tconst concurrency = normalizeSyncConcurrency(options.concurrency);\n\tconst keepDays = options.keepDays ?? 0;\n\tconst compareThreshold = options.compareThreshold ?? 0;\n\tconst nowMillis = Date.now();\n\tconst localRootContexts = await resolveLocalRootContexts(config);\n\tconst queuedEvents = [];\n\tconst failedPaths = [];\n\tconst failedPathSet = /* @__PURE__ */ new Set();\n\tlet errorCount = 0;\n\tlet failedPathOmittedCount = 0;\n\tlet scanHadError = false;\n\tconst runningActions = /* @__PURE__ */ new Set();\n\tconst scanEvents = {\n\t\tevents: [],\n\t\tdropped: 0\n\t};\n\tconst scanOptions = {\n\t\t...options.include !== void 0 ? { include: options.include } : {},\n\t\t...options.exclude !== void 0 ? { exclude: options.exclude } : {},\n\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t...options.maxScanEntries !== void 0 ? { maxScanEntries: options.maxScanEntries } : {},\n\t\t...direction === \"b2-to-local\" ? { requireLocalSafePaths: true } : {},\n\t\tonError: (event) => {\n\t\t\tscanHadError = true;\n\t\t\trecordSyncError(event);\n\t\t\tqueueEvent(event);\n\t\t}\n\t};\n\tconst factory = createActionFactory(config, localRootContexts);\n\tconst readB2Sha1 = dryRun ? void 0 : createB2Sha1Reader(config);\n\tconst actionAbortController = new AbortController();\n\tconst removeAbortForwarder = forwardAbortSignal(options.signal, actionAbortController);\n\tlet completed = false;\n\tasync function* finishAfterAbort() {\n\t\tawait drainActions();\n\t\tyield* emitQueuedEvents();\n\t}\n\ttry {\n\t\tlet pairs;\n\t\ttry {\n\t\t\tpairs = await collectPairs();\n\t\t} catch (err) {\n\t\t\tawait drainActions();\n\t\t\tif (options.signal?.aborted) {\n\t\t\t\tyield* finishAfterAbort();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!scanHadError) {\n\t\t\t\tyield* emitQueuedEvents();\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tyield* emitQueuedEvents();\n\t\t\tyield aggregateErrorEvent();\n\t\t\tcompleted = true;\n\t\t\treturn;\n\t\t}\n\t\tyield* emitQueuedEvents();\n\t\tconst filesystemError = scanFilesystemError(scanEvents);\n\t\tif (filesystemError !== void 0) throw filesystemError;\n\t\tif (options.signal?.aborted) {\n\t\t\tyield* finishAfterAbort();\n\t\t\treturn;\n\t\t}\n\t\tif (scanHadError) {\n\t\t\tif (errorCount > 0) yield aggregateErrorEvent();\n\t\t\tcompleted = true;\n\t\t\treturn;\n\t\t}\n\t\tif (options.compareMode === \"sha1\") {\n\t\t\tconst compareBatchSize = concurrency;\n\t\t\tfor (let index = 0; index < pairs.length; index += compareBatchSize) if (yield* emitSha1Batch(pairs.slice(index, index + compareBatchSize))) return;\n\t\t} else for (let index = 0; index < pairs.length; index += concurrency) {\n\t\t\tconst items = pairs.slice(index, index + concurrency).map((pair) => planPreparedPair(pair, readyComparePair(pair)));\n\t\t\tsynchronizerTestHooks.afterNonSha1PlanBatch?.(items.length);\n\t\t\tif (yield* emitPreparedItems(items)) return;\n\t\t}\n\t\tawait drainActions();\n\t\tyield* emitQueuedEvents();\n\t\tif (errorCount > 0) yield aggregateErrorEvent();\n\t\tcompleted = true;\n\t} finally {\n\t\tif (!completed) abortActionController(actionAbortController, new DOMException(\"Sync iterator closed\", \"AbortError\"));\n\t\tremoveAbortForwarder();\n\t\tawait drainActions();\n\t}\n\tasync function collectPairs() {\n\t\tconst pairs = [];\n\t\tfor await (const pair of zipFolders(source, dest, scanOptions, {\n\t\t\tonSourceSkip(event) {\n\t\t\t\tbufferScanEvent(scanEvents, event, direction, \"source\");\n\t\t\t},\n\t\t\tonDestSkip(event) {\n\t\t\t\tbufferScanEvent(scanEvents, event, direction, \"dest\");\n\t\t\t}\n\t\t})) {\n\t\t\tif (options.signal?.aborted) return pairs;\n\t\t\tvalidateB2SourcePairPrefix(pair, config);\n\t\t\tpairs.push(pair);\n\t\t}\n\t\treturn pairs;\n\t}\n\tasync function* emitSha1Batch(batch) {\n\t\tif (batch.length === 0) return false;\n\t\tawait drainActions();\n\t\tyield* emitQueuedEvents();\n\t\tconst preparedBatch = await processPreparedBatch(batch);\n\t\tif (yield* emitPreparedItems(preparedBatch.items)) return true;\n\t\tif (preparedBatch.aborted || options.signal?.aborted) {\n\t\t\tyield* finishAfterAbort();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tasync function* emitPreparedItems(items) {\n\t\tfor (const item of items) {\n\t\t\tyield* emitQueuedEvents();\n\t\t\tyield item.event;\n\t\t\tyield* emitQueuedEvents();\n\t\t\t/* v8 ignore next -- abort between compare yield and scheduling is timing-dependent */\n\t\t\tif (options.signal?.aborted) {\n\t\t\t\tyield* finishAfterAbort();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tfor (const action of item.actions) {\n\t\t\t\tawait scheduleAction(action);\n\t\t\t\tyield* emitQueuedEvents();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tasync function processPreparedBatch(batch) {\n\t\tif (batch.length === 0) return {\n\t\t\titems: [],\n\t\t\taborted: false\n\t\t};\n\t\tconst preparedPairs = await preparePairsForCompare(batch, \"sha1\", {\n\t\t\tconcurrency,\n\t\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options.sha1ReadTimeoutMillis !== void 0 ? { sha1ReadTimeoutMillis: options.sha1ReadTimeoutMillis } : {},\n\t\t\treadLocalSha1: readLocalSha1File,\n\t\t\t...readB2Sha1 !== void 0 ? { readB2Sha1 } : {}\n\t\t});\n\t\tconst items = [];\n\t\tfor (const { originalPair, prepared } of preparedPairs) {\n\t\t\tif (prepared.aborted || options.signal?.aborted) return {\n\t\t\t\titems,\n\t\t\t\taborted: true\n\t\t\t};\n\t\t\titems.push(planPreparedPair(originalPair, prepared));\n\t\t}\n\t\treturn {\n\t\t\titems,\n\t\t\taborted: false\n\t\t};\n\t}\n\tfunction planPreparedPair(pair, prepared) {\n\t\tconst event = {\n\t\t\ttype: \"compare\",\n\t\t\tpath: (pair[0] ?? pair[1])?.relativePath ?? \"\",\n\t\t\tsize: 0,\n\t\t\tbytesHashed: prepared.bytesHashed,\n\t\t\t...prepared.bytesVerified > 0 ? { bytesVerified: prepared.bytesVerified } : {}\n\t\t};\n\t\tlet preparedErrorEventCount = 0;\n\t\tfor (const preparedEvent of prepared.events) {\n\t\t\tqueueEvent(preparedEvent);\n\t\t\tif (preparedEvent.type === \"error\") {\n\t\t\t\tpreparedErrorEventCount++;\n\t\t\t\trecordFailurePath(preparedEvent.path);\n\t\t\t}\n\t\t}\n\t\terrorCount += prepared.errors.length;\n\t\tfor (let index = preparedErrorEventCount; index < prepared.errors.length; index++) recordFailurePath(event.path);\n\t\tif (prepared.skipActionGeneration) return {\n\t\t\tevent,\n\t\t\tactions: []\n\t\t};\n\t\tif ((scanHadError || scanHadFilesystemError(scanEvents)) && prepared.pair[0] === null && prepared.pair[1] !== null) return {\n\t\t\tevent,\n\t\t\tactions: [new SkipAction(prepared.pair[1].relativePath, \"not removed because scan errors occurred\")]\n\t\t};\n\t\tif (sourceInventoryIncomplete(scanEvents) && prepared.pair[0] === null && prepared.pair[1] !== null) return {\n\t\t\tevent,\n\t\t\tactions: [new SkipAction(prepared.pair[1].relativePath, scanEvents.sourceInventoryIncompleteMessage ?? \"not removed because the source scan skipped unsafe B2 names\")]\n\t\t};\n\t\treturn {\n\t\t\tevent,\n\t\t\tactions: [...generateActions(prepared.pair, direction, options.compareMode, options.keepMode, keepDays, nowMillis, factory, compareThreshold)]\n\t\t};\n\t}\n\tasync function scheduleAction(action) {\n\t\tconst task = executeAction(action).finally(() => {\n\t\t\trunningActions.delete(task);\n\t\t});\n\t\trunningActions.add(task);\n\t\tif (runningActions.size >= concurrency) await Promise.race(runningActions);\n\t}\n\tasync function executeAction(action) {\n\t\ttry {\n\t\t\tif (actionAbortController.signal.aborted) return;\n\t\t\tqueueEvent(await action.execute(dryRun, actionAbortController.signal));\n\t\t} catch (err) {\n\t\t\tconst event = {\n\t\t\t\ttype: \"error\",\n\t\t\t\tpath: action.relativePath,\n\t\t\t\tsize: 0,\n\t\t\t\tmessage: sanitizeErrorReason(err)\n\t\t\t};\n\t\t\trecordSyncError(event);\n\t\t\tqueueEvent(event);\n\t\t}\n\t}\n\tfunction recordSyncError(event) {\n\t\terrorCount += 1;\n\t\trecordFailurePath(event.path);\n\t}\n\tfunction recordFailurePath(path) {\n\t\tif (path === \"\") return;\n\t\tif (failedPathSet.has(path)) return;\n\t\tfailedPathSet.add(path);\n\t\tif (failedPaths.length < MAX_AGGREGATE_FAILED_PATHS) failedPaths.push(path);\n\t\telse failedPathOmittedCount++;\n\t}\n\tfunction aggregateErrorEvent() {\n\t\treturn {\n\t\t\ttype: \"error\",\n\t\t\tpath: \"\",\n\t\t\tsize: 0,\n\t\t\tmessage: `${errorCount} sync error(s) occurred`,\n\t\t\tfailureCount: errorCount,\n\t\t\tfailedPaths: [...failedPaths],\n\t\t\t...failedPathOmittedCount > 0 ? { failedPathOmittedCount } : {}\n\t\t};\n\t}\n\tfunction queueEvent(event) {\n\t\tqueuedEvents.push(event);\n\t}\n\tasync function* emitQueuedEvents() {\n\t\tyield* drainScanEvents(scanEvents);\n\t\tfor (const event of queuedEvents.splice(0)) yield event;\n\t}\n\tasync function drainActions() {\n\t\twhile (runningActions.size > 0) await Promise.race(runningActions);\n\t}\n}\n/**\n* Normalizes user-provided sync concurrency before it controls compare batches and transfers.\n*\n* @param value - Optional concurrency value from sync options.\n*\n* @returns A positive integer concurrency value.\n*\n* @throws When the configured concurrency is not a positive integer.\n*/\nfunction normalizeSyncConcurrency(value) {\n\tconst candidate = value ?? 4;\n\tif (!Number.isInteger(candidate) || candidate < 1) throw new RangeError(\"Sync concurrency must be a positive integer\");\n\treturn candidate;\n}\nfunction normalizeDownloadIdleTimeoutMillis(value) {\n\tif (value === void 0) return DEFAULT_DOWNLOAD_IDLE_TIMEOUT_MILLIS;\n\tif (value === Number.POSITIVE_INFINITY) return value;\n\tif (!Number.isFinite(value) || value < 1) throw new RangeError(\"downloadIdleTimeoutMillis must be a positive finite number or Infinity\");\n\treturn Math.floor(value);\n}\nfunction assertValidB2ContentLength(contentLength) {\n\tif (!Number.isSafeInteger(contentLength) || contentLength < 0) throw new Error(\"B2 contentLength must be a non-negative safe integer\");\n\treturn contentLength;\n}\nfunction createB2Sha1Reader(config) {\n\tconst upConfig = config;\n\tconst downConfig = config;\n\tconst bucket = upConfig.bucket ?? downConfig.bucket;\n\tif (bucket === void 0) return void 0;\n\tconst readablePrefixes = b2ReadableRawPrefixes(config);\n\tconst idleTimeoutMillis = normalizeSha1TimeoutMillis(config.options.sha1ReadTimeoutMillis);\n\tconst verificationTimeoutMillis = normalizeSha1TimeoutMillis(config.options.sha1VerificationTimeoutMillis, DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS);\n\treturn async (path, signal) => {\n\t\tconst expectedBytes = assertValidB2ContentLength(path.selectedVersion.contentLength);\n\t\tconst maxBytes = normalizeSha1VerificationMaxBytes(expectedBytes, config.options.sha1VerificationMaxBytes);\n\t\treturn withSha1VerificationDeadline(signal, verificationTimeoutMillis, async (deadlineSignal) => {\n\t\t\tdeadlineSignal.throwIfAborted();\n\t\t\tif (maxBytes < expectedBytes) throw new Error(`sha1 B2 verification skipped because contentLength ${expectedBytes} exceeds ${maxBytes} byte verification budget`);\n\t\t\tconst serverSideEncryption = toSseCDownloadKey(config.options.encryptionProvider?.getSettingForDownload(path.selectedVersion));\n\t\t\tconst fileName = validateB2SyncPathInAnyPrefix(readablePrefixes, path, \"read\");\n\t\t\tconst verified = await hashReadableStreamSha1((await bucket.file(fileName).downloadById(path.selectedVersion.fileId, {\n\t\t\t\t...serverSideEncryption !== void 0 ? { serverSideEncryption } : {},\n\t\t\t\tsignal: deadlineSignal\n\t\t\t})).body, deadlineSignal, {\n\t\t\t\tidleTimeoutMillis,\n\t\t\t\tmaxBytes,\n\t\t\t\texpectedBytes\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tcontentSha1: verified.contentSha1,\n\t\t\t\tbytesRead: verified.bytesRead\n\t\t\t};\n\t\t});\n\t};\n}\nfunction forwardAbortSignal(source, controller) {\n\tif (source === void 0) return () => void 0;\n\tif (source.aborted) {\n\t\tabortActionController(controller, source.reason);\n\t\treturn () => void 0;\n\t}\n\tconst abort = () => abortActionController(controller, source.reason);\n\tsource.addEventListener(\"abort\", abort, { once: true });\n\treturn () => source.removeEventListener(\"abort\", abort);\n}\nfunction abortActionController(controller, reason) {\n\tif (!controller.signal.aborted) controller.abort(reason);\n}\n/**\n* Narrowing assertion that a `Bucket` is present for an action that requires\n* it. Throws with a consistent, context-tagged message when the configured\n* direction did not supply one (e.g. `b2-to-local` direction asking for an\n* upload action).\n*\n* Uses TypeScript's `asserts` signature so call-site flow narrows\n* `bucket` from `Bucket | undefined` to `Bucket` after the check, without\n* requiring a separate `if (!bucket) throw ...` line per action factory.\n*\n* @param bucket - The (possibly missing) bucket reference.\n* @param context - Short verb describing the action being constructed\n* (e.g. `'upload'`, `'download'`). Surfaced in the error message.\n*\n* @throws `Error` when `bucket` is `undefined` or `null`.\n*/\nfunction assertBucket(bucket, context) {\n\tif (!bucket) throw new Error(`Bucket required for ${context} actions`);\n}\n/**\n* Returns the root for a local sync folder required by an action.\n*\n* @param folder - The configured folder to validate.\n* @param role - Whether the local folder is the source or destination.\n* @param context - Short verb describing the action being constructed.\n*\n* @returns The local filesystem root.\n*\n* @throws `Error` when the folder is not local or has no root.\n*/\nfunction requireLocalRoot(folder, role, context) {\n\tconst root = folder?.type === \"local\" ? folder.root : void 0;\n\tif (typeof root !== \"string\" || root === \"\") throw new Error(`Local ${role} root required for ${context} actions`);\n\treturn root;\n}\nasync function resolveLocalRootContexts(config) {\n\tconst sourceIsLocalFilesystem = isLocalFilesystemFolder(config.source);\n\tconst destIsLocalFilesystem = isLocalFilesystemFolder(config.dest);\n\tif (!sourceIsLocalFilesystem && !destIsLocalFilesystem) return {};\n\tconst sourceContext = config.dest.type === \"b2\" ? \"upload\" : \"sync\";\n\tconst destContext = config.source.type === \"b2\" ? \"download\" : \"sync\";\n\treturn {\n\t\t...sourceIsLocalFilesystem ? { source: await resolveLocalRootContext(requireLocalRoot(config.source, \"source\", sourceContext)) } : {},\n\t\t...destIsLocalFilesystem ? { dest: await resolveLocalRootContext(requireLocalRoot(config.dest, \"destination\", destContext)) } : {}\n\t};\n}\nasync function resolveLocalRootContext(root) {\n\tconst { realpath, stat } = await import(\"node:fs/promises\");\n\tconst { resolve } = await import(\"node:path\");\n\tconst safeRoot = resolve(root);\n\tconst realPath = await realpath(safeRoot).catch((err) => {\n\t\tif (isNotFoundError(err)) return safeRoot;\n\t\tthrow err;\n\t});\n\tconst stats = await stat(realPath).catch((err) => {\n\t\tif (isNotFoundError(err)) return void 0;\n\t\tthrow err;\n\t});\n\tif (stats !== void 0 && !stats.isDirectory()) throw new Error(\"Local sync root is not a directory\");\n\treturn {\n\t\troot: safeRoot,\n\t\trealPath,\n\t\t...stats === void 0 ? {} : { identity: {\n\t\t\tdeviceId: stats.dev,\n\t\t\tinode: stats.ino\n\t\t} }\n\t};\n}\nfunction isLocalFilesystemFolder(folder) {\n\treturn folder?.type === \"local\" && isLocalFilesystemRoot(folder);\n}\n/**\n* Narrows a setting to SSE-C; non-SSE-C source settings need no key on read.\n*\n* @param setting - Provider-supplied encryption setting, or undefined.\n*\n* @returns The SSE-C setting when one is provided; otherwise undefined.\n*/\nfunction toSseCEncryptionSetting(setting) {\n\tif (setting?.mode !== \"SSE-C\") return void 0;\n\treturn setting;\n}\n/**\n* Returns a download key from SSE-C settings; non-SSE-C downloads need no key.\n*\n* @param setting - Provider-supplied encryption setting, or undefined.\n*\n* @returns A download key for SSE-C files; otherwise undefined.\n*/\nfunction toSseCDownloadKey(setting) {\n\treturn toSseCEncryptionSetting(setting);\n}\n/**\n* Creates a configured sync engine wired to the bucket and paths in the given config.\n*\n* For sync operations that may need to remove destination-only files (the\n* `keepMode: 'delete'` policy), the factory reads the destination\n* bucket's cached `fileLockConfiguration` once so `removeOrphan` can\n* dispatch to either `hide` (locked buckets) or `deleteFileVersion`\n* (vanilla buckets) without a per-file branch. The cache is whatever\n* `client.listBuckets()` or `client.createBucket()` returned — callers\n* who flipped lock state mid-sync (rare) should refresh before\n* synchronize().\n*\n* @param config - Synchronizer configuration containing source, destination, and options.\n* @param localRootContexts - Resolved filesystem roots captured before action creation.\n*\n* @returns An action factory bound to the provided configuration.\n*/\nfunction createActionFactory(config, localRootContexts) {\n\tconst upConfig = config;\n\tconst downConfig = config;\n\tconst uploadPrefix = asRawB2KeyPrefix(upConfig.prefix ?? b2FolderRawPrefix(config.dest) ?? \"\");\n\tconst sourceB2Prefix = b2FolderRawPrefix(config.source);\n\tconst bucketIsLocked = (upConfig.bucket ?? downConfig.bucket)?.info?.fileLockConfiguration?.value?.isFileLockEnabled ?? false;\n\tconst factory = {\n\t\tupload(source, dest) {\n\t\t\tconst bucket = upConfig.bucket;\n\t\t\tassertBucket(bucket, \"upload\");\n\t\t\treturn new UploadAction(source.relativePath, source.absolutePath, source.size, async (absPath, relPath, signal) => {\n\t\t\t\tconst rootContext = localRootContexts.source;\n\t\t\t\tconst root = rootContext?.root ?? upConfig.source.root ?? \"\";\n\t\t\t\tconst fileName = dest !== void 0 ? validateB2SyncPathInPrefix(uploadPrefix, dest) : `${uploadPrefix}${relPath}`;\n\t\t\t\tif (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, relPath, { allowSymlinkRoot: true });\n\t\t\t\tconst targetPath = rootContext === void 0 ? await resolveContainedLocalPath(root, source.relativePath, absPath) : await resolveContainedLocalPath(rootContext.realPath, source.relativePath);\n\t\t\t\tthrowIfAborted(signal);\n\t\t\t\tconst fileSource = await createValidatedUploadFileSource(source, targetPath);\n\t\t\t\tthrowIfAborted(signal);\n\t\t\t\tconst serverSideEncryption = config.options.encryptionProvider?.getSettingForUpload(fileName, fileSource.size);\n\t\t\t\tawait bucket.upload({\n\t\t\t\t\tfileName,\n\t\t\t\t\tsource: fileSource,\n\t\t\t\t\t...serverSideEncryption !== void 0 ? { serverSideEncryption } : {},\n\t\t\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\tdownload(source, scannedDest) {\n\t\t\tconst bucket = downConfig.bucket;\n\t\t\tassertBucket(bucket, \"download\");\n\t\t\treturn new DownloadAction(source.relativePath, source.size, async (relPath, signal) => {\n\t\t\t\tconst rootContext = localRootContexts.dest;\n\t\t\t\tconst root = rootContext?.root ?? downConfig.dest.root ?? \"\";\n\t\t\t\tsafeRelativePathSegments(relPath);\n\t\t\t\tconst b2FileName = sourceB2Prefix === void 0 ? source.selectedVersion.fileName : validateB2SyncPathInPrefix(sourceB2Prefix, source, \"read\");\n\t\t\t\tconst idleTimeoutMillis = normalizeDownloadIdleTimeoutMillis(config.options.downloadIdleTimeoutMillis);\n\t\t\t\tconst expectedBytes = assertValidB2ContentLength(source.selectedVersion.contentLength);\n\t\t\t\tif (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, relPath, { allowSymlinkRoot: false });\n\t\t\t\tawait ensureLocalSyncRootDirectory(root, relPath);\n\t\t\t\tconst serverSideEncryption = toSseCDownloadKey(config.options.encryptionProvider?.getSettingForDownload(source.selectedVersion));\n\t\t\t\tconst result = await bucket.file(b2FileName).downloadById(source.selectedVersion.fileId, {\n\t\t\t\t\t...serverSideEncryption !== void 0 ? { serverSideEncryption } : {},\n\t\t\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t\t\t});\n\t\t\t\ttry {\n\t\t\t\t\tawait writeLocalStreamInsideRoot(root, relPath, result.body, {\n\t\t\t\t\t\texpectedBytes,\n\t\t\t\t\t\t...scannedDest !== void 0 ? { expectedDestination: scannedDest } : {},\n\t\t\t\t\t\tidleTimeoutMillis,\n\t\t\t\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t\t\t\t});\n\t\t\t\t} catch (err) {\n\t\t\t\t\tawait cancelReadableStreamBody(result.body, err);\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tcopy(source, destRelativePath) {\n\t\t\treturn copyToB2Key(source, `${uploadPrefix}${destRelativePath}`);\n\t\t},\n\t\tcopyB2Path(source, dest) {\n\t\t\treturn copyToB2Key(source, validateB2SyncPathInPrefix(uploadPrefix, dest));\n\t\t},\n\t\thide(path) {\n\t\t\tconst bucket = upConfig.bucket ?? downConfig.bucket;\n\t\t\tassertBucket(bucket, \"hide\");\n\t\t\treturn new HideAction(path, async (_relPath, signal) => {\n\t\t\t\tawait bucket.hideFile(`${uploadPrefix}${path}`, signal === void 0 ? void 0 : { signal });\n\t\t\t});\n\t\t},\n\t\thideB2Path(path) {\n\t\t\tconst bucket = upConfig.bucket ?? downConfig.bucket;\n\t\t\tassertBucket(bucket, \"hide\");\n\t\t\tconst b2FileName = validateB2SyncPathInPrefix(uploadPrefix, path);\n\t\t\treturn new HideAction(path.relativePath, async (_relPath, signal) => {\n\t\t\t\tawait bucket.hideFile(b2FileName, signal === void 0 ? void 0 : { signal });\n\t\t\t});\n\t\t},\n\t\tdeleteRemote(path) {\n\t\t\tconst bucket = upConfig.bucket ?? downConfig.bucket;\n\t\t\tassertBucket(bucket, \"delete\");\n\t\t\tconst b2FileName = validateB2SyncPathInPrefix(uploadPrefix, path);\n\t\t\treturn new DeleteRemoteAction(path.relativePath, path.selectedVersion.fileId, async (fileId$1, _fileName, signal) => {\n\t\t\t\tawait bucket.deleteFileVersion(b2FileName, fileId(fileId$1), signal === void 0 ? void 0 : { signal });\n\t\t\t});\n\t\t},\n\t\tdeleteLocal(path) {\n\t\t\tconst rootContext = localRootContexts.dest;\n\t\t\tconst root = rootContext?.root ?? localSyncRoot(downConfig.dest);\n\t\t\treturn new DeleteLocalAction(path.relativePath, path.absolutePath, async (absPath, signal) => {\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\tif (absPath !== path.absolutePath) throw new Error(`Refusing to delete outside sync root: ${path.relativePath}`);\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\ttry {\n\t\t\t\t\tif (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, path.relativePath, { allowSymlinkRoot: false });\n\t\t\t\t\tawait deleteLocalFileInsideRoot(root, path);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (isLocalDeleteSafetyError(err)) throw err;\n\t\t\t\t\tthrow new Error(`failed to delete local file: ${localFilesystemErrorReason(err)}`);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tremoveOrphan(dest) {\n\t\t\treturn bucketIsLocked ? factory.hideB2Path?.(dest) ?? factory.hide(dest.relativePath) : factory.deleteRemote(dest);\n\t\t}\n\t};\n\tfunction copyToB2Key(source, targetPath) {\n\t\tconst bucket = upConfig.bucket;\n\t\tassertBucket(bucket, \"copy\");\n\t\treturn new CopyAction(source.relativePath, source.size, async (_relPath, signal) => {\n\t\t\tif (sourceB2Prefix !== void 0) validateB2SyncPathInPrefix(sourceB2Prefix, source, \"read\");\n\t\t\tconst destinationServerSideEncryption = config.options.encryptionProvider?.getSettingForUpload(targetPath, source.size);\n\t\t\tconst sourceServerSideEncryption = toSseCEncryptionSetting(config.options.encryptionProvider?.getSettingForDownload(source.selectedVersion));\n\t\t\tawait bucket.copyFile({\n\t\t\t\tsourceFileId: source.selectedVersion.fileId,\n\t\t\t\tfileName: targetPath,\n\t\t\t\t...destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption } : {},\n\t\t\t\t...sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption } : {},\n\t\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t\t});\n\t\t});\n\t}\n\treturn factory;\n}\nasync function createValidatedUploadFileSource(source, absolutePath) {\n\ttry {\n\t\tconst fileSource = await FileSource.fromPath(absolutePath);\n\t\tawait validateScannedLocalFile({\n\t\t\t...source,\n\t\t\tabsolutePath\n\t\t});\n\t\treturn fileSource;\n\t} catch (err) {\n\t\tthrow normalizeLocalUploadSourceError(err);\n\t}\n}\nfunction normalizeLocalUploadSourceError(err) {\n\tif (err instanceof Error && err.message.startsWith(\"local file changed before upload\")) return err;\n\tconst message = err instanceof Error ? err.message : String(err);\n\tif (message.includes(\"not a regular file\")) return /* @__PURE__ */ new Error(\"local file changed before upload: not a regular file\");\n\tif (message.includes(\"changed\") || message.includes(\"modified\")) return /* @__PURE__ */ new Error(\"local file changed before upload\");\n\treturn /* @__PURE__ */ new Error(`local file changed before upload: ${sanitizeErrorReason(err)}`);\n}\nfunction localSyncRoot(folder) {\n\treturn folder?.type === \"local\" ? folder.root : \"\";\n}\nfunction b2FolderRawPrefix(folder) {\n\tif (folder?.type !== \"b2\") return void 0;\n\tconst rawPrefix = folder.rawPrefix;\n\treturn typeof rawPrefix === \"string\" ? rawPrefix : void 0;\n}\nfunction validateB2SourcePairPrefix(pair, config) {\n\tconst [source] = pair;\n\tif (config.source.type !== \"b2\" || source === null || !isB2SyncPath(source)) return;\n\tconst sourcePrefix = b2FolderRawPrefix(config.source);\n\tif (sourcePrefix === void 0) return;\n\tvalidateB2SyncPathInPrefix(sourcePrefix, source, \"read\");\n}\nfunction b2ReadableRawPrefixes(config) {\n\tconst prefixes = [];\n\tconst sourcePrefix = b2FolderRawPrefix(config.source);\n\tif (config.source.type === \"b2\") prefixes.push(sourcePrefix ?? \"\");\n\tconst upConfig = config;\n\tif (config.dest.type === \"b2\") prefixes.push(upConfig.prefix ?? b2FolderRawPrefix(config.dest) ?? \"\");\n\treturn [...new Set(prefixes.map((prefix) => asRawB2KeyPrefix(prefix)))];\n}\nfunction validateB2SyncPathInAnyPrefix(prefixes, path, operation) {\n\tlet firstError = /* @__PURE__ */ new Error(`Refusing to ${operation} B2 key: ${path.relativePath}`);\n\tfor (const prefix of prefixes) try {\n\t\treturn validateB2SyncPathInPrefix(prefix, path, operation);\n\t} catch (err) {\n\t\tif (err instanceof Error) firstError = err;\n\t}\n\tthrow firstError;\n}\nfunction validateB2SyncPathInPrefix(prefix, path, operation = \"mutate\") {\n\tconst fileName = path.selectedVersion.fileName;\n\tif (!fileName.startsWith(prefix)) throw new Error(`Refusing to ${operation} B2 key outside configured prefix: ${path.relativePath}`);\n\tif (b2KeyToRelativePathUnderPrefix(prefix, fileName) !== path.relativePath) throw new Error(`Refusing to ${operation} mismatched B2 key for sync path: ${path.relativePath}`);\n\treturn fileName;\n}\nfunction isB2SyncPath(path) {\n\treturn \"selectedVersion\" in path;\n}\nfunction throwIfAborted(signal) {\n\tif (signal?.aborted === true) throw signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\nasync function cancelReadableStreamBody(body, reason) {\n\tif (body.locked) return;\n\ttry {\n\t\tawait body.cancel(reason);\n\t} catch {}\n}\nasync function assertLocalRootContextCurrent(context, relativePath, options) {\n\tif (context.identity === void 0) return;\n\tconst { lstat, realpath, stat } = await import(\"node:fs/promises\");\n\tlet currentRealPath;\n\ttry {\n\t\tconst rootLinkStats = await lstat(context.root);\n\t\tif (!options.allowSymlinkRoot && rootLinkStats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`);\n\t\tcurrentRealPath = await realpath(context.root);\n\t} catch (err) {\n\t\tif (err instanceof Error && err.message.startsWith(\"Refusing to access sync root\")) throw err;\n\t\tthrow new Error(`Local sync root changed before filesystem action: ${relativePath}`);\n\t}\n\tif (currentRealPath !== context.realPath) throw new Error(`Local sync root changed before filesystem action: ${relativePath}`);\n\tlet currentStats;\n\ttry {\n\t\tcurrentStats = await stat(context.realPath);\n\t} catch {\n\t\tthrow new Error(`Local sync root changed before filesystem action: ${relativePath}`);\n\t}\n\tif (!currentStats.isDirectory() || currentStats.dev !== context.identity.deviceId || currentStats.ino !== context.identity.inode) throw new Error(`Local sync root changed before filesystem action: ${relativePath}`);\n}\nasync function ensureLocalSyncRootDirectory(root, relativePath) {\n\tif (root === \"\") throw new Error(\"Local sync root required for filesystem mutation\");\n\tconst { lstat, mkdir } = await import(\"node:fs/promises\");\n\tconst { resolve } = await import(\"node:path\");\n\tconst safeRoot = resolve(root);\n\ttry {\n\t\tconst stats = await lstat(safeRoot);\n\t\tif (stats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`);\n\t\tif (!stats.isDirectory()) throw new Error(`Local sync root is not a directory: ${relativePath}`);\n\t\treturn;\n\t} catch (error) {\n\t\tif (!isNotFoundError(error)) throw error;\n\t}\n\tawait mkdir(safeRoot, { recursive: true });\n\tawait assertLocalRootHasNoSymlink(safeRoot, relativePath);\n}\nfunction bufferScanEvent(buffer, event, direction, scanSide) {\n\tif (event.type === \"skip\" && event.reason === \"filesystem-error\") buffer.fatalFilesystemErrorMessage ??= event.message;\n\tif (sourceSkipMakesInventoryIncomplete(event, direction, scanSide)) buffer.sourceInventoryIncompleteMessage ??= sourceInventoryIncompleteMessage(direction);\n\tif (buffer.events.length < MAX_BUFFERED_SCAN_EVENTS) buffer.events.push(event);\n\telse buffer.dropped++;\n}\nfunction* drainScanEvents(buffer) {\n\twhile (buffer.events.length > 0) {\n\t\tconst event = buffer.events.shift();\n\t\tif (event) yield event;\n\t}\n\tif (buffer.dropped > 0) {\n\t\tyield {\n\t\t\ttype: \"skip\",\n\t\t\tpath: \"\",\n\t\t\tsize: 0,\n\t\t\treason: \"scan-skip-overflow\",\n\t\t\tmessage: `${buffer.dropped} scanner skip event(s) were omitted after ${MAX_BUFFERED_SCAN_EVENTS} buffered diagnostics`\n\t\t};\n\t\tbuffer.dropped = 0;\n\t}\n}\nfunction scanHadFilesystemError(scanEvents) {\n\treturn scanEvents.fatalFilesystemErrorMessage !== void 0;\n}\nfunction sourceInventoryIncomplete(scanEvents) {\n\treturn scanEvents.sourceInventoryIncompleteMessage !== void 0;\n}\nfunction scanFilesystemError(scanEvents) {\n\treturn scanEvents.fatalFilesystemErrorMessage === void 0 ? void 0 : new Error(scanEvents.fatalFilesystemErrorMessage);\n}\nfunction sourceSkipMakesInventoryIncomplete(event, direction, scanSide) {\n\tif (scanSide !== \"source\" || event.type !== \"skip\") return false;\n\tif (direction === \"local-to-b2\") return event.reason === \"unsafe-name\" || event.reason === \"stale-download-partial\" || event.reason === \"path-too-long-for-regexp\";\n\tif (direction === \"b2-to-local\" || direction === \"b2-to-b2\") return event.reason === \"unsafe-name\" || event.reason === \"local-unsafe-name\" || event.reason === \"relative-path-collision\" || event.reason === \"local-path-collision\" || event.reason === \"path-too-long-for-regexp\";\n\treturn false;\n}\nfunction sourceInventoryIncompleteMessage(direction) {\n\treturn direction === \"local-to-b2\" ? \"not removed because the source scan skipped local paths\" : \"not removed because the source scan skipped unsafe B2 names\";\n}\nfunction isLocalDeleteSafetyError(err) {\n\tif (!(err instanceof Error)) return false;\n\treturn err.message === \"Local sync root required for filesystem mutation\" || err.message.startsWith(\"Local sync root changed before filesystem action: \") || err.message.startsWith(\"Refusing to \") || err.message.startsWith(\"Local sync root is not a directory: \") || err.message.startsWith(\"unsafe local delete path: \");\n}\nasync function resolveContainedLocalPath(root, relativePath, absolutePath) {\n\tif (root === \"\") throw new Error(\"Local sync root required for filesystem mutation\");\n\tconst { isAbsolute, relative, resolve, sep } = await import(\"node:path\");\n\tconst safeRoot = resolve(root);\n\tconst target = absolutePath === void 0 ? resolve(safeRoot, relativePath) : resolve(absolutePath);\n\tconst pathFromRoot = relative(safeRoot, target);\n\t/* v8 ignore next -- defense-in-depth after prior no-follow and symlink checks. */\n\tif (pathFromRoot === \"..\" || pathFromRoot.startsWith(`..${sep}`) || isAbsolute(pathFromRoot)) throw new Error(`Refusing to access path outside sync root: ${relativePath}`);\n\tawait assertLocalRootHasNoSymlink(safeRoot, relativePath);\n\tawait assertPathHasNoSymlinkComponents(safeRoot, pathFromRoot, relativePath);\n\treturn target;\n}\nasync function assertLocalRootHasNoSymlink(safeRoot, relativePath) {\n\tconst { lstat } = await import(\"node:fs/promises\");\n\ttry {\n\t\tif ((await lstat(safeRoot)).isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`);\n\t} catch (error) {\n\t\tif (isNotFoundError(error)) return;\n\t\tthrow error;\n\t}\n}\nasync function assertPathHasNoSymlinkComponents(safeRoot, pathFromRoot, relativePath) {\n\tif (pathFromRoot === \"\") return;\n\tconst { lstat } = await import(\"node:fs/promises\");\n\tconst { join, sep } = await import(\"node:path\");\n\tlet current = safeRoot;\n\tfor (const segment of pathFromRoot.split(sep)) {\n\t\tcurrent = join(current, segment);\n\t\tlet stats;\n\t\ttry {\n\t\t\tstats = await lstat(current);\n\t\t} catch (error) {\n\t\t\tif (isNotFoundError(error)) return;\n\t\t\tthrow error;\n\t\t}\n\t\tif (stats.isSymbolicLink()) throw new Error(`Refusing to access path through symlink: ${relativePath}`);\n\t}\n}\nfunction isNotFoundError(error) {\n\treturn typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"ENOENT\";\n}\n//#endregion\nexport { synchronize, synchronizerTestHooks };\n\n//# sourceMappingURL=synchronizer.js.map","import { validateSyncFilters } from \"../regexp-safety.js\";\nimport { emitScannerSkip, regexpInputTooLongSkip } from \"../scan-events.js\";\nimport { directoryMayContainSyncPaths, pathPassesSyncFilters, pathSkippedByRegExpInputLimit } from \"../filters.js\";\nimport { compareSyncRelativePaths } from \"../path-order.js\";\nimport { assertScanEntryLimit, scanEntryLimit } from \"../scan-limit.js\";\nimport { localFileIdentityFromStats } from \"../local-file-identity.js\";\nimport { isReservedSyncTempFileName } from \"../path-safety.js\";\nimport { isDownloadStagingDirectorySegment, isManagedDownloadStagingRoot } from \"../download-staging.js\";\nimport { localFilesystemErrorReason } from \"../filesystem-errors.js\";\nimport { registerLocalFilesystemRoot } from \"../local-filesystem-root.js\";\n//#region src/sync/scanners/local.ts\n/**\n* Scans a local directory tree and yields {@link LocalSyncPath} entries sorted by relative path.\n* A root directory read failure aborts the scan with an error diagnostic. Per-entry file or\n* directory failures are reported through `onError` and the scan continues over readable siblings.\n* SDK-managed partial download file names are skipped so unfinished internal\n* temp files are not synchronized.\n* The current implementation collects matching entries before sorting, so memory usage is\n* proportional to the number of matched files.\n*/\nvar LocalFolder = class {\n\ttype = \"local\";\n\tappliesScanFilters = true;\n\tappliesScanSorting = true;\n\t/** Resolved absolute path to the local root directory. */\n\troot;\n\t/**\n\t* Creates a new LocalFolder for the given root directory.\n\t* @param root - Absolute or relative path to the local directory to scan.\n\t*/\n\tconstructor(root) {\n\t\tthis.root = resolvePathAtConstruction(root);\n\t\tregisterLocalFilesystemRoot(this);\n\t}\n\t/**\n\t* Recursively walks the directory and yields files in sync path order.\n\t* @param options - Optional scan controls.\n\t*/\n\tasync *scan(options = {}) {\n\t\tvalidateSyncFilters(options);\n\t\tconst nodeDeps = await loadLocalNodeDeps();\n\t\tconst root = nodeDeps.resolve(this.root);\n\t\tconst collected = [];\n\t\tawait this.walk(root, root, collected, options, scanEntryLimit(options), nodeDeps);\n\t\tcollected.sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath));\n\t\tfor (const entry of collected) {\n\t\t\tthrowIfScanAborted(options);\n\t\t\tyield entry;\n\t\t}\n\t}\n\t/**\n\t* Recursively collects files from {@link dir} into {@link out}.\n\t* @param root - Resolved scan root used for relative path calculation.\n\t* @param dir - Absolute path of the directory to scan.\n\t* @param out - Accumulator array that receives discovered file entries.\n\t* @param options - Optional scan controls.\n\t* @param maxScanEntries - Maximum number of entries to retain before failing.\n\t* @param nodeDeps - Lazy-loaded Node filesystem and path helpers.\n\t*/\n\tasync walk(root, dir, out, options, maxScanEntries, nodeDeps) {\n\t\tthrowIfScanAborted(options);\n\t\tlet entries;\n\t\ttry {\n\t\t\tentries = await nodeDeps.readdir(dir, { withFileTypes: true });\n\t\t} catch (err) {\n\t\t\tconst error = this.emitScanError(options, relativePathFromRoot(root, dir, nodeDeps), \"directory\", err);\n\t\t\tif (dir === root) throw error;\n\t\t\treturn;\n\t\t}\n\t\tfor (const entry of entries) {\n\t\t\tthrowIfScanAborted(options);\n\t\t\tconst fullPath = nodeDeps.join(dir, entry.name);\n\t\t\tconst rel = relativePathFromRoot(root, fullPath, nodeDeps);\n\t\t\tif (isDownloadStagingDirectorySegment(rel) && entry.isDirectory() && isDownloadStagingDirectorySegment(entry.name) && await isManagedDownloadStagingRoot(fullPath)) continue;\n\t\t\tif (rel.includes(\"\\\\\")) {\n\t\t\t\temitScannerSkip(options, {\n\t\t\t\t\ttype: \"skip\",\n\t\t\t\t\tpath: rel,\n\t\t\t\t\tsize: 0,\n\t\t\t\t\treason: \"unsafe-name\",\n\t\t\t\t\tmessage: `Skipped local path ${JSON.stringify(rel)}: backslashes are not safe sync path characters`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (isReservedSyncTempFileName(entry.name)) {\n\t\t\t\temitScannerSkip(options, {\n\t\t\t\t\ttype: \"skip\",\n\t\t\t\t\tpath: rel,\n\t\t\t\t\tsize: 0,\n\t\t\t\t\treason: \"stale-download-partial\",\n\t\t\t\t\tmessage: `Skipped local path ${JSON.stringify(rel)}: reserved SDK partial download file`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tif (directoryMayContainSyncPaths(rel, options)) await this.walk(root, fullPath, out, options, maxScanEntries, nodeDeps);\n\t\t\t} else if (entry.isFile()) {\n\t\t\t\tif (!pathPassesSyncFilters(rel, options)) {\n\t\t\t\t\tif (pathSkippedByRegExpInputLimit(rel, options)) emitScannerSkip(options, regexpInputTooLongSkip(rel));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlet s;\n\t\t\t\ttry {\n\t\t\t\t\ts = await nodeDeps.lstat(fullPath);\n\t\t\t\t\t/* v8 ignore start -- lstat race after a Dirent file result is not deterministic */\n\t\t\t\t\tif (!s.isFile()) {\n\t\t\t\t\t\tthis.emitScanError(options, rel, \"file\", /* @__PURE__ */ new Error(\"not a regular file\"));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t/* v8 ignore next -- stat TOCTOU failures are not deterministic to trigger */\n\t\t\t\t\tthis.emitScanError(options, relativePathFromRoot(root, fullPath, nodeDeps), \"file\", err);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tassertScanEntryLimit(out.length + 1, maxScanEntries);\n\t\t\t\tout.push({\n\t\t\t\t\trelativePath: rel,\n\t\t\t\t\tabsolutePath: fullPath,\n\t\t\t\t\tmodTimeMillis: Math.floor(s.mtimeMs),\n\t\t\t\t\tsize: s.size,\n\t\t\t\t\tfileIdentity: localFileIdentityFromStats(s)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\temitScanError(options, path, kind, err) {\n\t\tconst event = {\n\t\t\ttype: \"error\",\n\t\t\tpath,\n\t\t\tsize: 0,\n\t\t\tmessage: `failed to scan local ${kind}: ${localFilesystemErrorReason(err)}`\n\t\t};\n\t\toptions.onError?.(event);\n\t\treturn new Error(event.message);\n\t}\n};\nasync function loadLocalNodeDeps() {\n\tconst [fsPromises, path] = await Promise.all([import(\"node:fs/promises\"), import(\"node:path\")]);\n\treturn {\n\t\treaddir: fsPromises.readdir,\n\t\tlstat: fsPromises.lstat,\n\t\tjoin: path.join,\n\t\trelative: path.relative,\n\t\tresolve: path.resolve,\n\t\tsep: path.sep\n\t};\n}\nfunction resolvePathAtConstruction(root) {\n\tconst processLike = globalThis.process;\n\tif (typeof processLike?.cwd !== \"function\") return root;\n\tconst cwd = processLike.cwd();\n\tif (processLike.platform === \"win32\") return resolveWindowsPath(cwd, root);\n\treturn resolvePosixPath(cwd, root);\n}\nfunction resolvePosixPath(cwd, root) {\n\tconst resolved = normalizePathSegments((root.startsWith(\"/\") ? root : `${cwd}/${root}`).split(\"/\"), \"/\");\n\treturn resolved === \"\" ? \"/\" : `/${resolved}`;\n}\nfunction resolveWindowsPath(cwd, root) {\n\tconst normalizedRoot = root.replaceAll(\"/\", \"\\\\\");\n\tconst normalizedCwd = cwd.replaceAll(\"/\", \"\\\\\");\n\tconst drive = /^[A-Za-z]:/.exec(normalizedCwd)?.[0] ?? \"\";\n\tconst cwdUnc = splitUncPath(normalizedCwd);\n\tif (/^\\\\\\\\/.test(normalizedRoot)) return normalizeUncPath(normalizedRoot);\n\tif (/^[A-Za-z]:\\\\/.test(normalizedRoot)) return joinWindowsRoot(normalizedRoot.slice(0, 2), normalizePathSegments(normalizedRoot.slice(3).split(\"\\\\\"), \"\\\\\"));\n\tif (/^[A-Za-z]:/.test(normalizedRoot)) throw new Error(\"LocalFolder root must not be a drive-relative Windows path\");\n\tif (normalizedRoot.startsWith(\"\\\\\")) {\n\t\tconst rest = normalizePathSegments(normalizedRoot.slice(1).split(\"\\\\\"), \"\\\\\");\n\t\treturn joinWindowsRoot(cwdUnc?.prefix ?? drive, rest);\n\t}\n\tif (cwdUnc !== void 0) {\n\t\tconst resolved = normalizePathSegments([...cwdUnc.rest, ...normalizedRoot.split(\"\\\\\")], \"\\\\\");\n\t\treturn joinWindowsRoot(cwdUnc.prefix, resolved);\n\t}\n\tconst base = /^[A-Za-z]:\\\\/.test(normalizedCwd) ? normalizedCwd : `${drive}\\\\`;\n\tconst prefix = /^[A-Za-z]:/.exec(base)?.[0] ?? drive;\n\treturn joinWindowsRoot(prefix, normalizePathSegments([...base.slice(prefix.length).replace(/^\\\\/, \"\").split(\"\\\\\"), ...normalizedRoot.split(\"\\\\\")], \"\\\\\"));\n}\nfunction normalizeUncPath(path) {\n\tconst unc = splitUncPath(path);\n\tif (unc === void 0) return path;\n\treturn joinWindowsRoot(unc.prefix, normalizePathSegments(unc.rest, \"\\\\\"));\n}\nfunction splitUncPath(path) {\n\tif (!path.startsWith(\"\\\\\\\\\")) return void 0;\n\tconst [server, share, ...rest] = path.split(\"\\\\\").filter((part) => part !== \"\");\n\tif (server === void 0 || share === void 0) return void 0;\n\treturn {\n\t\tprefix: `\\\\\\\\${server}\\\\${share}`,\n\t\trest\n\t};\n}\nfunction joinWindowsRoot(prefix, rest) {\n\treturn rest === \"\" ? `${prefix}\\\\` : `${prefix}\\\\${rest}`;\n}\nfunction normalizePathSegments(segments, separator) {\n\tconst out = [];\n\tfor (const segment of segments) {\n\t\tif (segment === \"\" || segment === \".\") continue;\n\t\tif (segment === \"..\") {\n\t\t\tout.pop();\n\t\t\tcontinue;\n\t\t}\n\t\tout.push(segment);\n\t}\n\treturn out.join(separator);\n}\nfunction relativePathFromRoot(root, path, nodeDeps) {\n\treturn nodeDeps.relative(root, path).split(nodeDeps.sep).join(\"/\");\n}\nfunction throwIfScanAborted(options) {\n\tif (options.signal?.aborted === true) throw options.signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\n//#endregion\nexport { LocalFolder };\n\n//# sourceMappingURL=local.js.map","import { FileAction } from \"../../types/file.js\";\nimport { validateSyncFilters } from \"../regexp-safety.js\";\nimport { emitScannerSkip, regexpInputTooLongSkip } from \"../scan-events.js\";\nimport { literalPrefixForSyncFilters, pathPassesSyncFilters, pathSkippedByRegExpInputLimit } from \"../filters.js\";\nimport { compareCodeUnits, compareSyncRelativePaths } from \"../path-order.js\";\nimport { assertScanEntryLimit, scanEntryLimit } from \"../scan-limit.js\";\nimport { sanitizeErrorReason } from \"../../util/error-reason.js\";\nimport { isAbortError } from \"../local-sha1.js\";\nimport { selectB2ComparableSha1, syncSha1StateOf } from \"../sha1-metadata.js\";\nimport { assertSyncPathAllowed } from \"../path-safety.js\";\nimport { asRawB2KeyPrefix, b2KeyToRelativePathUnderPrefix, localFilesystemCanonicalSyncPath, localFilesystemSyncPathIsUnsafe } from \"../prefix.js\";\n//#region src/sync/scanners/b2.ts\nvar MAX_EMPTY_B2_SCAN_PAGES = 100;\n/**\n* Scans a B2 bucket (optionally filtered by a raw B2 key prefix) and yields\n* {@link B2SyncPath} entries sorted by `compareSyncRelativePaths(relativePath)`. Hidden files are excluded.\n* Raw B2 file names are used only as an internal tie-breaker after collision handling.\n* All versions for the listed prefix are fetched, grouped, and sorted before\n* yielding; exclude filters are applied client-side and do not reduce that\n* B2 listing memory footprint.\n* SDK-reserved temporary names fail the scan because syncing them could corrupt\n* in-progress transfers.\n*/\nvar B2Folder = class {\n\ttype = \"b2\";\n\tappliesScanFilters = true;\n\tappliesScanSorting = true;\n\t/** Raw B2 key prefix this folder scans, preserving caller-provided separators verbatim. */\n\trawPrefix;\n\tbucket;\n\t/**\n\t* Creates a new B2Folder for the given bucket and optional prefix.\n\t* @param bucket - The B2 bucket to scan.\n\t* @param prefix - Optional raw B2 key prefix to restrict the scan scope.\n\t* Backslashes are preserved as raw B2 key characters; pass `/` explicitly for slash prefixes.\n\t*/\n\tconstructor(bucket, prefix = \"\") {\n\t\tthis.bucket = bucket;\n\t\tthis.rawPrefix = asRawB2KeyPrefix(prefix);\n\t}\n\t/**\n\t* Lists all file versions in the bucket, groups by name, and yields the latest visible version.\n\t* @param options - Optional scan controls.\n\t*/\n\tasync *scan(options = {}) {\n\t\tvalidateSyncFilters(options);\n\t\tconst maxScanEntries = scanEntryLimit(options);\n\t\tconst grouped = /* @__PURE__ */ new Map();\n\t\tconst listPrefix = this.listPrefixFor(options);\n\t\tlet listedVersions = 0;\n\t\tlet startFileName;\n\t\tlet startFileId;\n\t\tlet emptyPageCount = 0;\n\t\twhile (true) {\n\t\t\tif (scanIsAborted(options)) return;\n\t\t\tlet listing;\n\t\t\ttry {\n\t\t\t\tlisting = await this.bucket.listFileVersions({\n\t\t\t\t\t...listPrefix !== \"\" ? { prefix: listPrefix } : {},\n\t\t\t\t\t...startFileName !== void 0 ? { startFileName } : {},\n\t\t\t\t\t...startFileId !== void 0 ? { startFileId } : {},\n\t\t\t\t\t...options.signal !== void 0 ? { signal: options.signal } : {}\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\tif (scanIsAborted(options) || isAbortError(err)) return;\n\t\t\t\tthrow emitScanError(options, \"failed to scan B2 file versions\", err);\n\t\t\t}\n\t\t\tif (scanIsAborted(options)) return;\n\t\t\tif (listing.files.length === 0) {\n\t\t\t\temptyPageCount++;\n\t\t\t\tif (emptyPageCount > MAX_EMPTY_B2_SCAN_PAGES) throw emitScanError(options, \"failed to scan B2 file versions\", /* @__PURE__ */ new Error(\"B2 pagination returned too many empty pages\"));\n\t\t\t} else emptyPageCount = 0;\n\t\t\tfor (const fv of listing.files) {\n\t\t\t\tif (scanIsAborted(options)) return;\n\t\t\t\tassertScanEntryLimit(listedVersions + 1, maxScanEntries);\n\t\t\t\tlistedVersions++;\n\t\t\t\tif (this.rawPrefix !== \"\" && !fv.fileName.startsWith(this.rawPrefix)) {\n\t\t\t\t\tthis.emitSkip(options, fv.fileName, fv.fileName, \"outside-prefix\", `listed object is outside configured B2 prefix ${JSON.stringify(this.rawPrefix)}`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (options.requireLocalSafePaths === true && fv.fileName.includes(\"\\\\\")) {\n\t\t\t\t\tthis.emitSkip(options, fv.fileName, fv.fileName, \"local-unsafe-name\", \"object name contains a backslash that is unsafe for local filesystem destinations\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst relativePath = this.tryToRelativePath(fv.fileName);\n\t\t\t\tif (relativePath === null) {\n\t\t\t\t\tthis.emitSkip(options, fv.fileName, fv.fileName, \"unsafe-name\", \"object name cannot be represented as a safe sync relative path\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!pathPassesSyncFilters(relativePath, options)) {\n\t\t\t\t\tif (pathSkippedByRegExpInputLimit(relativePath, options)) emitScannerSkip(options, {\n\t\t\t\t\t\t...regexpInputTooLongSkip(relativePath),\n\t\t\t\t\t\tb2FileName: fv.fileName\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst existing = grouped.get(fv.fileName);\n\t\t\t\tif (existing) existing.versions.push(fv);\n\t\t\t\telse grouped.set(fv.fileName, {\n\t\t\t\t\trelativePath,\n\t\t\t\t\tversions: [fv]\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!listing.nextFileName) break;\n\t\t\tif (listing.nextFileName === startFileName && (listing.nextFileId ?? void 0) === startFileId) throw emitScanError(options, \"failed to scan B2 file versions\", /* @__PURE__ */ new Error(\"B2 pagination did not advance\"));\n\t\t\tstartFileName = listing.nextFileName;\n\t\t\tstartFileId = listing.nextFileId ?? void 0;\n\t\t}\n\t\tconst visible = this.visibleCandidates(grouped, options);\n\t\tconst withoutRelativeCollisions = this.rejectRelativePathCollisions(visible, options);\n\t\tconst sorted = (options.requireLocalSafePaths === true ? this.rejectLocalPathCollisions(withoutRelativeCollisions, options) : withoutRelativeCollisions).sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath) || compareCodeUnits(a.fileName, b.fileName));\n\t\tfor (const { relativePath, versions, selectedVersion } of sorted) {\n\t\t\tif (scanIsAborted(options)) return;\n\t\t\tassertSyncPathAllowed(relativePath);\n\t\t\tconst contentSha1 = selectB2ComparableSha1(selectedVersion);\n\t\t\tyield {\n\t\t\t\trelativePath,\n\t\t\t\tmodTimeMillis: selectedVersion.uploadTimestamp,\n\t\t\t\tsize: selectedVersion.contentLength,\n\t\t\t\tcontentSha1,\n\t\t\t\tcontentSha1State: syncSha1StateOf({ contentSha1 }),\n\t\t\t\tselectedVersion,\n\t\t\t\tallVersions: versions\n\t\t\t};\n\t\t}\n\t}\n\ttryToRelativePath(fileName) {\n\t\ttry {\n\t\t\treturn b2KeyToRelativePathUnderPrefix(this.rawPrefix, fileName);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\tlistPrefixFor(filters) {\n\t\tconst filterPrefix = literalPrefixForSyncFilters(filters);\n\t\tif (filterPrefix === \"\") return this.rawPrefix;\n\t\tif (this.rawPrefix !== \"\" && !this.rawPrefix.endsWith(\"/\")) return this.rawPrefix;\n\t\treturn `${this.rawPrefix}${rawPrefixBeforeNormalizedSeparator(filterPrefix)}`;\n\t}\n\tvisibleCandidates(grouped, filters) {\n\t\tconst visible = [];\n\t\tfor (const [fileName, entry] of grouped) {\n\t\t\tentry.versions.sort((a, b) => b.uploadTimestamp - a.uploadTimestamp);\n\t\t\tconst selected = entry.versions[0];\n\t\t\tif (!selected || selected.action === FileAction.Hide) continue;\n\t\t\tif (filters?.requireLocalSafePaths === true && localFilesystemSyncPathIsUnsafe(entry.relativePath)) {\n\t\t\t\tthis.emitSkip(filters, entry.relativePath, fileName, \"local-unsafe-name\", \"object name is unsafe for a local filesystem destination\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvisible.push({\n\t\t\t\tfileName,\n\t\t\t\trelativePath: entry.relativePath,\n\t\t\t\tversions: entry.versions,\n\t\t\t\tselectedVersion: selected\n\t\t\t});\n\t\t}\n\t\treturn visible;\n\t}\n\trejectRelativePathCollisions(candidates, filters) {\n\t\tconst accepted = [];\n\t\tconst owners = /* @__PURE__ */ new Map();\n\t\tconst collidedRelativePaths = /* @__PURE__ */ new Set();\n\t\tfor (const candidate of candidates) {\n\t\t\tif (collidedRelativePaths.has(candidate.relativePath)) {\n\t\t\t\tthis.emitSkip(filters, candidate.relativePath, candidate.fileName, \"relative-path-collision\", \"object normalizes to a relative path already rejected because of another raw B2 key\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst owner = owners.get(candidate.relativePath);\n\t\t\tif (owner !== void 0 && owner.fileName !== candidate.fileName) {\n\t\t\t\towners.delete(candidate.relativePath);\n\t\t\t\tremoveAcceptedCandidate(accepted, owner);\n\t\t\t\tcollidedRelativePaths.add(candidate.relativePath);\n\t\t\t\tthis.emitSkip(filters, candidate.relativePath, owner.fileName, \"relative-path-collision\", `object normalizes to the same relative path as ${JSON.stringify(candidate.fileName)}`);\n\t\t\t\tthis.emitSkip(filters, candidate.relativePath, candidate.fileName, \"relative-path-collision\", `object normalizes to the same relative path as ${JSON.stringify(owner.fileName)}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\towners.set(candidate.relativePath, candidate);\n\t\t\taccepted.push(candidate);\n\t\t}\n\t\treturn accepted;\n\t}\n\trejectLocalPathCollisions(candidates, filters) {\n\t\tconst accepted = [];\n\t\tconst owners = /* @__PURE__ */ new Map();\n\t\tconst collidedLocalPaths = /* @__PURE__ */ new Set();\n\t\tfor (const candidate of candidates) {\n\t\t\tconst canonicalPath = localFilesystemCanonicalSyncPath(candidate.relativePath);\n\t\t\tif (collidedLocalPaths.has(canonicalPath)) {\n\t\t\t\tthis.emitSkip(filters, candidate.relativePath, candidate.fileName, \"local-path-collision\", \"object collides with another object on case-insensitive or Unicode-normalizing filesystems\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst owner = owners.get(canonicalPath);\n\t\t\tif (owner !== void 0) {\n\t\t\t\towners.delete(canonicalPath);\n\t\t\t\tremoveAcceptedCandidate(accepted, owner);\n\t\t\t\tcollidedLocalPaths.add(canonicalPath);\n\t\t\t\tthis.emitSkip(filters, owner.relativePath, owner.fileName, \"local-path-collision\", `object collides with ${JSON.stringify(candidate.fileName)} on local filesystems`);\n\t\t\t\tthis.emitSkip(filters, candidate.relativePath, candidate.fileName, \"local-path-collision\", `object collides with ${JSON.stringify(owner.fileName)} on local filesystems`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\towners.set(canonicalPath, candidate);\n\t\t\taccepted.push(candidate);\n\t\t}\n\t\treturn accepted;\n\t}\n\temitSkip(filters, path, b2FileName, reason, message) {\n\t\temitScannerSkip(filters, {\n\t\t\ttype: \"skip\",\n\t\t\tpath,\n\t\t\tsize: 0,\n\t\t\tmessage: `Skipped B2 object ${JSON.stringify(b2FileName)}: ${message}`,\n\t\t\treason,\n\t\t\tb2FileName\n\t\t});\n\t}\n};\nfunction rawPrefixBeforeNormalizedSeparator(filterPrefix) {\n\tconst separatorIndex = filterPrefix.indexOf(\"/\");\n\treturn separatorIndex === -1 ? filterPrefix : filterPrefix.slice(0, separatorIndex);\n}\nfunction emitScanError(options, message, err) {\n\tconst event = {\n\t\ttype: \"error\",\n\t\tpath: \"\",\n\t\tsize: 0,\n\t\tmessage: `${message}: ${sanitizeErrorReason(err)}`\n\t};\n\toptions.onError?.(event);\n\treturn new Error(event.message);\n}\nfunction removeAcceptedCandidate(candidates, target) {\n\tconst index = candidates.indexOf(target);\n\tif (index !== -1) candidates.splice(index, 1);\n}\nfunction scanIsAborted(filters) {\n\treturn filters?.signal?.aborted === true;\n}\n//#endregion\nexport { B2Folder };\n\n//# sourceMappingURL=b2.js.map","import { lstat, mkdir, realpath } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type {\n CompareMode,\n KeepMode,\n SyncEvent,\n SynchronizerDownConfig,\n SynchronizerUpConfig,\n} from '@backblaze-labs/b2-sdk/sync'\nimport { B2Folder, LocalFolder, synchronize } from '@backblaze-labs/b2-sdk/sync'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/**\n * Mutable counter bag fed by {@link processSyncEvent} as the action consumes\n * the SDK's `synchronize()` event stream. Exposed alongside the processor so\n * unit tests can drive each SyncEvent variant deterministically (notably the\n * `copy-start` / `copy-done` events that only fire in b2-to-b2 sync, which\n * the action's input surface doesn't currently expose).\n */\nexport interface SyncEventCounters {\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files removed (delete-remote, delete-local, or hide). */\n deleted: number\n /** Count of files left unchanged. */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred (upload + download). */\n bytesTransferred: number\n}\n\n/**\n * Apply one `SyncEvent` from the SDK's `synchronize()` stream to the running\n * counters and emit the corresponding log line. The action's `syncCommand`\n * calls this in a loop; the function is exported (and the {@link SyncEventCounters}\n * type with it) so tests can exercise every event variant independently,\n * including the `copy-*` events that require b2-to-b2 sync to fire from the\n * real engine.\n *\n * Informational lifecycle events (`upload-start`, `compare`, etc.) are\n * deliberate no-ops; listing them explicitly keeps the switch exhaustive\n * so TypeScript errors if the SDK adds a new variant.\n */\nexport function processSyncEvent(event: SyncEvent, counters: SyncEventCounters): void {\n switch (event.type) {\n case 'upload-done':\n counters.uploaded++\n counters.bytesTransferred += event.size\n core.info(` ↑ ${event.path} (${event.size}B)`)\n return\n case 'download-done':\n counters.downloaded++\n counters.bytesTransferred += event.size\n core.info(` ↓ ${event.path} (${event.size}B)`)\n return\n case 'delete-remote':\n counters.deleted++\n core.info(` − ${event.path}`)\n return\n case 'delete-local':\n counters.deleted++\n core.info(` − (local) ${event.path}`)\n return\n case 'hide':\n counters.deleted++\n core.info(` ⌀ ${event.path} (hidden)`)\n return\n case 'skip':\n counters.skipped++\n return\n case 'error':\n counters.errors++\n core.warning(` ! ${event.path}: ${event.message}`)\n return\n case 'upload-start':\n case 'compare':\n case 'download-start':\n case 'copy-start':\n case 'copy-done':\n return\n }\n}\n\n/**\n * Build a one-line summary of the first few sync errors for the dispatcher's\n * top-level failure message. Without this, a sync that fails on three files\n * surfaces only `Sync completed with 3 error(s)` to the user, who then has to\n * dig into the (possibly collapsed) per-file warnings or parse `summary-json`.\n * Including a sample makes the failure message itself diagnose-able.\n */\nexport function summarizeSyncErrors(events: SyncEvent[], limit = 3): string {\n const errors = events.filter(\n (e): e is Extract => e.type === 'error',\n )\n if (errors.length === 0) return ''\n const head = errors\n .slice(0, limit)\n .map((e) => `${e.path}: ${e.message}`)\n .join('; ')\n const tail = errors.length > limit ? `; +${errors.length - limit} more` : ''\n return `${head}${tail}`\n}\n\n/** Result of {@link syncCommand}: per-event log plus aggregate counters. */\nexport interface SyncResult {\n /** Per-file events emitted by the SDK's `synchronize()` (upload-done, download-done, skip, delete-*, hide, error). */\n events: SyncEvent[]\n /** Resolved direction of this sync (after `auto` resolution). */\n direction: 'local-to-b2' | 'b2-to-local'\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files deleted/hidden across both sides. */\n deleted: number\n /** Count of files left unchanged (already in sync). */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred across both directions. */\n bytesTransferred: number\n}\n\n/**\n * Sync a local directory to / from a B2 bucket prefix.\n *\n * Direction is determined by the `direction` input (`up` = local → B2,\n * `down` = B2 → local). With `direction: auto` (the default) we infer:\n * - if `source` is an existing local directory → `up`\n * - otherwise → `down` (source is a B2 prefix, destination is local)\n *\n * The SDK's {@link synchronize} returns an `AsyncGenerator` which we\n * relay to the workflow log (per-file) and aggregate into a typed result.\n */\nexport async function syncCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'sync', 'a local directory (up) or B2 prefix (down)')\n\n const direction = await resolveDirection(inputs.syncDirection, source)\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n\n const config = await buildConfig(bucket, source, inputs, direction, signal)\n\n core.startGroup(\n `sync ${direction === 'local-to-b2' ? source : `b2://${bucket.name}/${source}`} ` +\n `→ ${direction === 'local-to-b2' ? `b2://${bucket.name}/${inputs.destination ?? ''}` : (inputs.destination ?? '.')} ` +\n `(compare=${compareMode}, keep=${keepMode}${dryRun ? ', dry-run' : ''})`,\n )\n\n const events: SyncEvent[] = []\n const counters: SyncEventCounters = {\n uploaded: 0,\n downloaded: 0,\n deleted: 0,\n skipped: 0,\n errors: 0,\n bytesTransferred: 0,\n }\n\n try {\n for await (const event of synchronize(config)) {\n events.push(event)\n processSyncEvent(event, counters)\n }\n } finally {\n core.endGroup()\n }\n\n const { uploaded, downloaded, deleted, skipped, errors, bytesTransferred } = counters\n\n core.info(\n `sync done [${direction}]: ${uploaded} uploaded, ${downloaded} downloaded, ${deleted} removed, ${skipped} unchanged, ${errors} errors`,\n )\n\n return {\n events,\n direction,\n uploaded,\n downloaded,\n deleted,\n skipped,\n errors,\n bytesTransferred,\n }\n}\n\nasync function resolveDirection(\n requested: 'up' | 'down' | 'auto',\n source: string,\n): Promise<'local-to-b2' | 'b2-to-local'> {\n if (requested === 'up') return 'local-to-b2'\n if (requested === 'down') return 'b2-to-local'\n const localStat = await tryStat(source)\n return localStat?.isDirectory() ? 'local-to-b2' : 'b2-to-local'\n}\n\nasync function buildConfig(\n bucket: Bucket,\n source: string,\n inputs: ParsedInputs,\n direction: 'local-to-b2' | 'b2-to-local',\n signal?: AbortSignal,\n): Promise {\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n const concurrency = inputs.concurrency\n const options = {\n compareMode,\n keepMode,\n concurrency,\n dryRun,\n ...(signal !== undefined ? { signal } : {}),\n }\n\n if (direction === 'local-to-b2') {\n const stats = await tryStat(source)\n if (!stats?.isDirectory()) {\n throw new Error(`'sync' up requires 'source' to be an existing local directory: ${source}`)\n }\n const prefix = (inputs.destination ?? '').replace(/^\\/+|\\/+$/g, '')\n return {\n source: new LocalFolder(resolve(source)),\n dest: new B2Folder(bucket, prefix === '' ? '' : `${prefix}/`),\n bucket,\n prefix: prefix === '' ? '' : `${prefix}/`,\n options,\n }\n }\n\n const remotePrefix = source.replace(/^\\/+|\\/+$/g, '')\n const localDest = inputs.destination ?? '.'\n const localRoot = await prepareLocalDestinationRoot(localDest)\n return {\n source: new B2Folder(bucket, remotePrefix === '' ? '' : `${remotePrefix}/`),\n dest: new LocalFolder(localRoot),\n bucket,\n options,\n }\n}\n\nasync function prepareLocalDestinationRoot(localDest: string): Promise {\n const resolved = resolve(localDest)\n await mkdir(resolved, { recursive: true })\n const stats = await lstat(resolved)\n if (stats.isSymbolicLink()) return resolved\n return realpath(resolved)\n}\n\nexport type { CompareMode, KeepMode }\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link unhideCommand}. */\nexport interface UnhideResult {\n /** B2 file name that was unhidden. */\n fileName: string\n /** File ID of the removed hide marker, or `null` if there was nothing hidden. */\n removedMarkerFileId: string | null\n}\n\n/**\n * Restore visibility of a file previously hidden by the `hide` command.\n *\n * Wraps the SDK's {@link Bucket.unhideFile}, which finds the most recent hide\n * marker for the file name and deletes it. If the file is already visible\n * (or never existed), no-ops and reports `removedMarkerFileId: null`.\n *\n * B2 has no native `b2_unhide_file` endpoint; the SDK implements unhide as\n * \"list versions → delete the top hide marker\", which is the canonical\n * recipe. We expose it here so workflow authors don't have to know that.\n */\nexport async function unhideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'unhide', 'the B2 file name')\n\n core.startGroup(`unhide b2://${bucket.name}/${source}`)\n try {\n const marker = await bucket.unhideFile(source)\n if (marker === null) {\n core.info(` no hide marker found for ${source} (already visible or non-existent)`)\n return { fileName: source, removedMarkerFileId: null }\n }\n core.info(` removed hide marker fileId=${marker.fileId}, ${source} is now visible`)\n return { fileName: source, removedMarkerFileId: marker.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core';\n/**\n * Returns a copy with defaults filled in.\n */\nexport function getOptions(copy) {\n const result = {\n followSymbolicLinks: true,\n implicitDescendants: true,\n matchDirectories: true,\n omitBrokenSymbolicLinks: true,\n excludeHiddenFiles: false\n };\n if (copy) {\n if (typeof copy.followSymbolicLinks === 'boolean') {\n result.followSymbolicLinks = copy.followSymbolicLinks;\n core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);\n }\n if (typeof copy.implicitDescendants === 'boolean') {\n result.implicitDescendants = copy.implicitDescendants;\n core.debug(`implicitDescendants '${result.implicitDescendants}'`);\n }\n if (typeof copy.matchDirectories === 'boolean') {\n result.matchDirectories = copy.matchDirectories;\n core.debug(`matchDirectories '${result.matchDirectories}'`);\n }\n if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {\n result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;\n core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);\n }\n if (typeof copy.excludeHiddenFiles === 'boolean') {\n result.excludeHiddenFiles = copy.excludeHiddenFiles;\n core.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`);\n }\n }\n return result;\n}\n//# sourceMappingURL=internal-glob-options-helper.js.map","import * as path from 'path';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.\n *\n * For example, on Linux/macOS:\n * - `/ => /`\n * - `/hello => /`\n *\n * For example, on Windows:\n * - `C:\\ => C:\\`\n * - `C:\\hello => C:\\`\n * - `C: => C:`\n * - `C:hello => C:`\n * - `\\ => \\`\n * - `\\hello => \\`\n * - `\\\\hello => \\\\hello`\n * - `\\\\hello\\world => \\\\hello\\world`\n */\nexport function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}\n/**\n * Roots the path if not already rooted. On Windows, relative roots like `\\`\n * or `C:` are expanded based on the current working directory.\n */\nexport function ensureAbsoluteRoot(root, itemPath) {\n assert(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);\n assert(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Already rooted\n if (hasAbsoluteRoot(itemPath)) {\n return itemPath;\n }\n // Windows\n if (IS_WINDOWS) {\n // Check for itemPath like C: or C:foo\n if (itemPath.match(/^[A-Z]:[^\\\\/]|^[A-Z]:$/i)) {\n let cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n // Drive letter matches cwd? Expand to cwd\n if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {\n // Drive only, e.g. C:\n if (itemPath.length === 2) {\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}`;\n }\n // Drive + path, e.g. C:foo\n else {\n if (!cwd.endsWith('\\\\')) {\n cwd += '\\\\';\n }\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}${itemPath.substr(2)}`;\n }\n }\n // Different drive\n else {\n return `${itemPath[0]}:\\\\${itemPath.substr(2)}`;\n }\n }\n // Check for itemPath like \\ or \\foo\n else if (normalizeSeparators(itemPath).match(/^\\\\$|^\\\\[^\\\\]/)) {\n const cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n return `${cwd[0]}:\\\\${itemPath.substr(1)}`;\n }\n }\n assert(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);\n // Otherwise ensure root ends with a separator\n if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\\\'))) {\n // Intentionally empty\n }\n else {\n // Append separator\n root += path.sep;\n }\n return root + itemPath;\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\\\hello\\share` and `C:\\hello` (and using alternate separator).\n */\nexport function hasAbsoluteRoot(itemPath) {\n assert(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\\\hello\\share or C:\\hello\n return itemPath.startsWith('\\\\\\\\') || /^[A-Z]:\\\\/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\`, `\\hello`, `\\\\hello\\share`, `C:`, and `C:\\hello` (and using alternate separator).\n */\nexport function hasRoot(itemPath) {\n assert(itemPath, `isRooted parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\ or \\hello or \\\\hello\n // E.g. C: or C:\\hello\n return itemPath.startsWith('\\\\') || /^[A-Z]:/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * Removes redundant slashes and converts `/` to `\\` on Windows\n */\nexport function normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n/**\n * Normalizes the path separators and trims the trailing separator (when safe).\n * For example, `/foo/ => /foo` but `/ => /`\n */\nexport function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}\n//# sourceMappingURL=internal-path-helper.js.map","/**\n * Indicates whether a pattern matches a path\n */\nexport var MatchKind;\n(function (MatchKind) {\n /** Not matched */\n MatchKind[MatchKind[\"None\"] = 0] = \"None\";\n /** Matched if the path is a directory */\n MatchKind[MatchKind[\"Directory\"] = 1] = \"Directory\";\n /** Matched if the path is a regular file */\n MatchKind[MatchKind[\"File\"] = 2] = \"File\";\n /** Matched */\n MatchKind[MatchKind[\"All\"] = 3] = \"All\";\n})(MatchKind || (MatchKind = {}));\n//# sourceMappingURL=internal-match-kind.js.map","import * as pathHelper from './internal-path-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Given an array of patterns, returns an array of paths to search.\n * Duplicates and paths under other included paths are filtered out.\n */\nexport function getSearchPaths(patterns) {\n // Ignore negate patterns\n patterns = patterns.filter(x => !x.negate);\n // Create a map of all search paths\n const searchPathMap = {};\n for (const pattern of patterns) {\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n searchPathMap[key] = 'candidate';\n }\n const result = [];\n for (const pattern of patterns) {\n // Check if already included\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n if (searchPathMap[key] === 'included') {\n continue;\n }\n // Check for an ancestor search path\n let foundAncestor = false;\n let tempKey = key;\n let parent = pathHelper.dirname(tempKey);\n while (parent !== tempKey) {\n if (searchPathMap[parent]) {\n foundAncestor = true;\n break;\n }\n tempKey = parent;\n parent = pathHelper.dirname(tempKey);\n }\n // Include the search pattern in the result\n if (!foundAncestor) {\n result.push(pattern.searchPath);\n searchPathMap[key] = 'included';\n }\n }\n return result;\n}\n/**\n * Matches the patterns against the path\n */\nexport function match(patterns, itemPath) {\n let result = MatchKind.None;\n for (const pattern of patterns) {\n if (pattern.negate) {\n result &= ~pattern.match(itemPath);\n }\n else {\n result |= pattern.match(itemPath);\n }\n }\n return result;\n}\n/**\n * Checks whether to descend further into the directory\n */\nexport function partialMatch(patterns, itemPath) {\n return patterns.some(x => !x.negate && x.partialMatch(itemPath));\n}\n//# sourceMappingURL=internal-pattern-helper.js.map","export const balanced = (a, b, str) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a;\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b;\n const r = ma !== null && mb != null && range(ma, mb, str);\n return (r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n });\n};\nconst maybeMatch = (reg, str) => {\n const m = str.match(reg);\n return m ? m[0] : null;\n};\nexport const range = (a, b, str) => {\n let begs, beg, left, right = undefined, result;\n let ai = str.indexOf(a);\n let bi = str.indexOf(b, ai + 1);\n let i = ai;\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n }\n else if (begs.length === 1) {\n const r = begs.pop();\n if (r !== undefined)\n result = [r, bi];\n }\n else {\n beg = begs.pop();\n if (beg !== undefined && beg < left) {\n left = beg;\n right = bi;\n }\n bi = str.indexOf(b, i + 1);\n }\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n if (begs.length && right !== undefined) {\n result = [left, right];\n }\n }\n return result;\n};\n//# sourceMappingURL=index.js.map","import { balanced } from 'balanced-match';\nconst escSlash = '\\0SLASH' + Math.random() + '\\0';\nconst escOpen = '\\0OPEN' + Math.random() + '\\0';\nconst escClose = '\\0CLOSE' + Math.random() + '\\0';\nconst escComma = '\\0COMMA' + Math.random() + '\\0';\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0';\nconst escSlashPattern = new RegExp(escSlash, 'g');\nconst escOpenPattern = new RegExp(escOpen, 'g');\nconst escClosePattern = new RegExp(escClose, 'g');\nconst escCommaPattern = new RegExp(escComma, 'g');\nconst escPeriodPattern = new RegExp(escPeriod, 'g');\nconst slashPattern = /\\\\\\\\/g;\nconst openPattern = /\\\\{/g;\nconst closePattern = /\\\\}/g;\nconst commaPattern = /\\\\,/g;\nconst periodPattern = /\\\\\\./g;\nexport const EXPANSION_MAX = 100_000;\nfunction numeric(str) {\n return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);\n}\nfunction escapeBraces(str) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod);\n}\nfunction unescapeBraces(str) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.');\n}\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str) {\n if (!str) {\n return [''];\n }\n const parts = [];\n const m = balanced('{', '}', str);\n if (!m) {\n return str.split(',');\n }\n const { pre, body, post } = m;\n const p = pre.split(',');\n p[p.length - 1] += '{' + body + '}';\n const postParts = parseCommaParts(post);\n if (post.length) {\n ;\n p[p.length - 1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n parts.push.apply(parts, p);\n return parts;\n}\nexport function expand(str, options = {}) {\n if (!str) {\n return [];\n }\n const { max = EXPANSION_MAX } = options;\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2);\n }\n return expand_(escapeBraces(str), max, true).map(unescapeBraces);\n}\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\nfunction expand_(str, max, isTop) {\n /** @type {string[]} */\n const expansions = [];\n const m = balanced('{', '}', str);\n if (!m)\n return [str];\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre;\n const post = m.post.length ? expand_(m.post, max, false) : [''];\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k];\n expansions.push(expansion);\n }\n }\n else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n const isSequence = isNumericSequence || isAlphaSequence;\n const isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand_(str, max, true);\n }\n return [str];\n }\n let n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n }\n else {\n n = parseCommaParts(m.body);\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace);\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p);\n }\n /* c8 ignore stop */\n }\n }\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N;\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0]);\n const y = numeric(n[1]);\n const width = Math.max(n[0].length, n[1].length);\n let incr = n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n let test = lte;\n const reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n const pad = n.some(isPadded);\n N = [];\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\') {\n c = '';\n }\n }\n else {\n c = String(i);\n if (pad) {\n const need = width - c.length;\n if (need > 0) {\n const z = new Array(need + 1).join('0');\n if (i < 0) {\n c = '-' + z + c.slice(1);\n }\n else {\n c = z + c;\n }\n }\n }\n }\n N.push(c);\n }\n }\n else {\n N = [];\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j], max, false));\n }\n }\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion);\n }\n }\n }\n }\n return expansions;\n}\n//# sourceMappingURL=index.js.map","const MAX_PATTERN_LENGTH = 1024 * 64;\nexport const assertValidPattern = (pattern) => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern');\n }\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long');\n }\n};\n//# sourceMappingURL=assert-valid-pattern.js.map","// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n// { : [, /u flag required, negated]\nconst posixClasses = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n};\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s) => s.replace(/[[\\]\\\\-]/g, '\\\\$&');\n// escape all regexp magic characters\nconst regexpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges) => ranges.join('');\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (glob, position) => {\n const pos = position;\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression');\n }\n /* c8 ignore stop */\n const ranges = [];\n const negs = [];\n let i = pos + 1;\n let sawStart = false;\n let uflag = false;\n let escaping = false;\n let negate = false;\n let endPos = pos;\n let rangeStart = '';\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i);\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true;\n i++;\n continue;\n }\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1;\n break;\n }\n sawStart = true;\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true;\n i++;\n continue;\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true];\n }\n i += cls.length;\n if (neg)\n negs.push(unip);\n else\n ranges.push(unip);\n uflag = uflag || u;\n continue WHILE;\n }\n }\n }\n // now it's just a normal character, effectively\n escaping = false;\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));\n }\n else if (c === rangeStart) {\n ranges.push(braceEscape(c));\n }\n rangeStart = '';\n i++;\n continue;\n }\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'));\n i += 2;\n continue;\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c;\n i += 2;\n continue;\n }\n // not the start of a range, just a single character\n ranges.push(braceEscape(c));\n i++;\n }\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false];\n }\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true];\n }\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];\n return [regexpEscape(r), false, endPos - pos, false];\n }\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';\n const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs;\n return [comb, uflag, endPos - pos, true];\n};\n//# sourceMappingURL=brace-expressions.js.map","/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\nexport const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1');\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1');\n};\n//# sourceMappingURL=unescape.js.map","// parse a single path portion\nvar _a;\nimport { parseClass } from './brace-expressions.js';\nimport { unescape } from './unescape.js';\nconst types = new Set(['!', '?', '+', '*', '@']);\nconst isExtglobType = (c) => types.has(c);\nconst isExtglobAST = (c) => isExtglobType(c.type);\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n]);\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n]);\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n]);\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n]);\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))';\nconst startNoDot = '(?!\\\\.)';\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.']);\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.']);\nconst reSpecials = new Set('().*{}+?[]^$\\\\!');\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// any single thing other than /\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?';\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\nlet ID = 0;\nexport class AST {\n type;\n #root;\n #hasMagic;\n #uflag = false;\n #parts = [];\n #parent;\n #parentIndex;\n #negs;\n #filledNegs = false;\n #options;\n #toString;\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt = false;\n id = ++ID;\n get depth() {\n return (this.#parent?.depth ?? -1) + 1;\n }\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n };\n }\n constructor(type, parent, options = {}) {\n this.type = type;\n // extglobs are inherently magical\n if (type)\n this.#hasMagic = true;\n this.#parent = parent;\n this.#root = this.#parent ? this.#parent.#root : this;\n this.#options = this.#root === this ? options : this.#root.#options;\n this.#negs = this.#root === this ? [] : this.#root.#negs;\n if (type === '!' && !this.#root.#filledNegs)\n this.#negs.push(this);\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;\n }\n get hasMagic() {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined)\n return this.#hasMagic;\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string')\n continue;\n if (p.type || p.hasMagic)\n return (this.#hasMagic = true);\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic;\n }\n // reconstructs the pattern\n toString() {\n return (this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')'));\n }\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root)\n throw new Error('should only call on root');\n if (this.#filledNegs)\n return this;\n /* c8 ignore stop */\n // call toString() once to fill this out\n this.toString();\n this.#filledNegs = true;\n let n;\n while ((n = this.#negs.pop())) {\n if (n.type !== '!')\n continue;\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p = n;\n let pp = p.#parent;\n while (pp) {\n for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??');\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i]);\n }\n }\n p = pp;\n pp = p.#parent;\n }\n }\n return this;\n }\n push(...parts) {\n for (const p of parts) {\n if (p === '')\n continue;\n /* c8 ignore start */\n if (typeof p !== 'string' &&\n !(p instanceof _a && p.#parent === this)) {\n throw new Error('invalid part: ' + p);\n }\n /* c8 ignore stop */\n this.#parts.push(p);\n }\n }\n toJSON() {\n const ret = this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => p.toJSON())];\n if (this.isStart() && !this.type)\n ret.unshift([]);\n if (this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))) {\n ret.push({});\n }\n return ret;\n }\n isStart() {\n if (this.#root === this)\n return true;\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart())\n return false;\n if (this.#parentIndex === 0)\n return true;\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent;\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i];\n if (!(pp instanceof _a && pp.type === '!')) {\n return false;\n }\n }\n return true;\n }\n isEnd() {\n if (this.#root === this)\n return true;\n if (this.#parent?.type === '!')\n return true;\n if (!this.#parent?.isEnd())\n return false;\n if (!this.type)\n return this.#parent?.isEnd();\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0;\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1;\n }\n copyIn(part) {\n if (typeof part === 'string')\n this.push(part);\n else\n this.push(part.clone(this));\n }\n clone(parent) {\n const c = new _a(this.type, parent);\n for (const p of this.#parts) {\n c.copyIn(p);\n }\n return c;\n }\n static #parseAST(str, ast, pos, opt, extDepth) {\n const maxDepth = opt.maxExtglobRecursion ?? 2;\n let escaping = false;\n let inBrace = false;\n let braceStart = -1;\n let braceNeg = false;\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos;\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth;\n if (doRecurse) {\n ast.push(acc);\n acc = '';\n const ext = new _a(c, ast);\n i = _a.#parseAST(str, ext, i, opt, extDepth + 1);\n ast.push(ext);\n continue;\n }\n acc += c;\n }\n ast.push(acc);\n return i;\n }\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1;\n let part = new _a(null, ast);\n const parts = [];\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;\n part.push(acc);\n acc = '';\n const ext = new _a(c, part);\n part.push(ext);\n i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);\n continue;\n }\n if (c === '|') {\n part.push(acc);\n acc = '';\n parts.push(part);\n part = new _a(null, ast);\n continue;\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true;\n }\n part.push(acc);\n acc = '';\n ast.push(...parts, part);\n return i;\n }\n acc += c;\n }\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null;\n ast.#hasMagic = undefined;\n ast.#parts = [str.substring(pos - 1)];\n return i;\n }\n #canAdoptWithSpace(child) {\n return this.#canAdopt(child, adoptionWithSpaceMap);\n }\n #canAdopt(child, map = adoptionMap) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canAdoptType(gc.type, map);\n }\n #canAdoptType(c, map = adoptionAnyMap) {\n return !!map.get(this.type)?.includes(c);\n }\n #adoptWithSpace(child, index) {\n const gc = child.#parts[0];\n const blank = new _a(null, gc, this.options);\n blank.#parts.push('');\n gc.push(blank);\n this.#adopt(child, index);\n }\n #adopt(child, index) {\n const gc = child.#parts[0];\n this.#parts.splice(index, 1, ...gc.#parts);\n for (const p of gc.#parts) {\n if (typeof p === 'object')\n p.#parent = this;\n }\n this.#toString = undefined;\n }\n #canUsurpType(c) {\n const m = usurpMap.get(this.type);\n return !!m?.has(c);\n }\n #canUsurp(child) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canUsurpType(gc.type);\n }\n #usurp(child) {\n const m = usurpMap.get(this.type);\n const gc = child.#parts[0];\n const nt = m?.get(gc.type);\n /* c8 ignore start - impossible */\n if (!nt)\n return false;\n /* c8 ignore stop */\n this.#parts = gc.#parts;\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this;\n }\n }\n this.type = nt;\n this.#toString = undefined;\n this.#emptyExt = false;\n }\n static fromGlob(pattern, options = {}) {\n const ast = new _a(null, undefined, options);\n _a.#parseAST(pattern, ast, 0, options, 0);\n return ast;\n }\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern() {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root)\n return this.#root.toMMPattern();\n /* c8 ignore stop */\n const glob = this.toString();\n const [re, body, hasMagic, uflag] = this.toRegExpSource();\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic = hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase());\n if (!anyMagic) {\n return body;\n }\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n });\n }\n get options() {\n return this.#options;\n }\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(allowDot) {\n const dot = allowDot ?? !!this.#options.dot;\n if (this.#root === this) {\n this.#flatten();\n this.#fillNegs();\n }\n if (!isExtglobAST(this)) {\n const noEmpty = this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string');\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] = typeof p === 'string' ?\n _a.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot);\n this.#hasMagic = this.#hasMagic || hasMagic;\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .join('');\n let start = '';\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);\n if (!dotTravAllowed) {\n const aps = addPatternStart;\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav = \n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)));\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : '';\n }\n }\n }\n // append the \"end of path portion\" pattern to negation tails\n let end = '';\n if (this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!') {\n end = '(?:$|\\\\/)';\n }\n const final = start + src + end;\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n const repeated = this.type === '*' || this.type === '+';\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:';\n let body = this.#partsToRegExp(dot);\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString();\n const me = this;\n me.#parts = [s];\n me.type = null;\n me.#hasMagic = undefined;\n return [s, unescape(this.toString()), false, false];\n }\n let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true);\n if (bodyDotAllowed === body) {\n bodyDotAllowed = '';\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`;\n }\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = '';\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;\n }\n else {\n const close = this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`;\n final = start + body + close;\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten();\n }\n }\n }\n else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0;\n let done = false;\n do {\n done = true;\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i];\n if (typeof c === 'object') {\n c.#flatten();\n if (this.#canAdopt(c)) {\n done = false;\n this.#adopt(c, i);\n }\n else if (this.#canAdoptWithSpace(c)) {\n done = false;\n this.#adoptWithSpace(c, i);\n }\n else if (this.#canUsurp(c)) {\n done = false;\n this.#usurp(c);\n }\n }\n }\n } while (!done && ++iterations < 10);\n }\n this.#toString = undefined;\n }\n #partsToRegExp(dot) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??');\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|');\n }\n static #parseGlob(glob, hasMagic, noEmpty = false) {\n let escaping = false;\n let re = '';\n let uflag = false;\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false;\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i);\n if (escaping) {\n escaping = false;\n re += (reSpecials.has(c) ? '\\\\' : '') + c;\n continue;\n }\n if (c === '*') {\n if (inStar)\n continue;\n inStar = true;\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;\n hasMagic = true;\n continue;\n }\n else {\n inStar = false;\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\';\n }\n else {\n escaping = true;\n }\n continue;\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i);\n if (consumed) {\n re += src;\n uflag = uflag || needUflag;\n i += consumed - 1;\n hasMagic = hasMagic || magic;\n continue;\n }\n }\n if (c === '?') {\n re += qmark;\n hasMagic = true;\n continue;\n }\n re += regExpEscape(c);\n }\n return [re, unescape(glob), !!hasMagic, uflag];\n }\n}\n_a = AST;\n//# sourceMappingURL=ast.js.map","/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&');\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&');\n};\n//# sourceMappingURL=escape.js.map","import { expand } from 'brace-expansion';\nimport { assertValidPattern } from './assert-valid-pattern.js';\nimport { AST } from './ast.js';\nimport { escape } from './escape.js';\nimport { unescape } from './unescape.js';\nexport const minimatch = (p, pattern, options = {}) => {\n assertValidPattern(pattern);\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false;\n }\n return new Minimatch(pattern, options).match(p);\n};\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/;\nconst starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);\nconst starDotExtTestDot = (ext) => (f) => f.endsWith(ext);\nconst starDotExtTestNocase = (ext) => {\n ext = ext.toLowerCase();\n return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);\n};\nconst starDotExtTestNocaseDot = (ext) => {\n ext = ext.toLowerCase();\n return (f) => f.toLowerCase().endsWith(ext);\n};\nconst starDotStarRE = /^\\*+\\.\\*+$/;\nconst starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');\nconst starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');\nconst dotStarRE = /^\\.\\*+$/;\nconst dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');\nconst starRE = /^\\*+$/;\nconst starTest = (f) => f.length !== 0 && !f.startsWith('.');\nconst starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/;\nconst qmarksTestNocase = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestNocaseDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTest = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTestNoExt = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && !f.startsWith('.');\n};\nconst qmarksTestNoExtDot = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && f !== '.' && f !== '..';\n};\n/* c8 ignore start */\nconst defaultPlatform = (typeof process === 'object' && process ?\n (typeof process.env === 'object' &&\n process.env &&\n process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n process.platform\n : 'posix');\nconst path = {\n win32: { sep: '\\\\' },\n posix: { sep: '/' },\n};\n/* c8 ignore stop */\nexport const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;\nminimatch.sep = sep;\nexport const GLOBSTAR = Symbol('globstar **');\nminimatch.GLOBSTAR = GLOBSTAR;\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?';\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?';\nexport const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);\nminimatch.filter = filter;\nconst ext = (a, b = {}) => Object.assign({}, a, b);\nexport const defaults = (def) => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch;\n }\n const orig = minimatch;\n const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));\n return Object.assign(m, {\n Minimatch: class Minimatch extends orig.Minimatch {\n constructor(pattern, options = {}) {\n super(pattern, ext(def, options));\n }\n static defaults(options) {\n return orig.defaults(ext(def, options)).Minimatch;\n }\n },\n AST: class AST extends orig.AST {\n /* c8 ignore start */\n constructor(type, parent, options = {}) {\n super(type, parent, ext(def, options));\n }\n /* c8 ignore stop */\n static fromGlob(pattern, options = {}) {\n return orig.AST.fromGlob(pattern, ext(def, options));\n }\n },\n unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),\n escape: (s, options = {}) => orig.escape(s, ext(def, options)),\n filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),\n defaults: (options) => orig.defaults(ext(def, options)),\n makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),\n braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),\n match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),\n sep: orig.sep,\n GLOBSTAR: GLOBSTAR,\n });\n};\nminimatch.defaults = defaults;\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (pattern, options = {}) => {\n assertValidPattern(pattern);\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern];\n }\n return expand(pattern, { max: options.braceExpandMax });\n};\nminimatch.braceExpand = braceExpand;\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nexport const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();\nminimatch.makeRe = makeRe;\nexport const match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options);\n list = list.filter(f => mm.match(f));\n if (mm.options.nonull && !list.length) {\n list.push(pattern);\n }\n return list;\n};\nminimatch.match = match;\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/;\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\nexport class Minimatch {\n options;\n set;\n pattern;\n windowsPathsNoEscape;\n nonegate;\n negate;\n comment;\n empty;\n preserveMultipleSlashes;\n partial;\n globSet;\n globParts;\n nocase;\n isWindows;\n platform;\n windowsNoMagicRoot;\n maxGlobstarRecursion;\n regexp;\n constructor(pattern, options = {}) {\n assertValidPattern(pattern);\n options = options || {};\n this.options = options;\n this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;\n this.pattern = pattern;\n this.platform = options.platform || defaultPlatform;\n this.isWindows = this.platform === 'win32';\n // avoid the annoying deprecation flag lol\n const awe = ('allowWindow' + 'sEscape');\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options[awe] === false;\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/');\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;\n this.regexp = null;\n this.negate = false;\n this.nonegate = !!options.nonegate;\n this.comment = false;\n this.empty = false;\n this.partial = !!options.partial;\n this.nocase = !!this.options.nocase;\n this.windowsNoMagicRoot =\n options.windowsNoMagicRoot !== undefined ?\n options.windowsNoMagicRoot\n : !!(this.isWindows && this.nocase);\n this.globSet = [];\n this.globParts = [];\n this.set = [];\n // make the set of regexps etc.\n this.make();\n }\n hasMagic() {\n if (this.options.magicalBraces && this.set.length > 1) {\n return true;\n }\n for (const pattern of this.set) {\n for (const part of pattern) {\n if (typeof part !== 'string')\n return true;\n }\n }\n return false;\n }\n debug(..._) { }\n make() {\n const pattern = this.pattern;\n const options = this.options;\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true;\n return;\n }\n if (!pattern) {\n this.empty = true;\n return;\n }\n // step 1: figure out negation, etc.\n this.parseNegate();\n // step 2: expand braces\n this.globSet = [...new Set(this.braceExpand())];\n if (options.debug) {\n //oxlint-disable-next-line no-console\n this.debug = (...args) => console.error(...args);\n }\n this.debug(this.pattern, this.globSet);\n // step 3: now we have a set, so turn each one into a series of\n // path-portion matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n //\n // First, we preprocess to make the glob pattern sets a bit simpler\n // and deduped. There are some perf-killing patterns that can cause\n // problems with a glob walk, but we can simplify them down a bit.\n const rawGlobParts = this.globSet.map(s => this.slashSplit(s));\n this.globParts = this.preprocess(rawGlobParts);\n this.debug(this.pattern, this.globParts);\n // glob --> regexps\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path.\n const isUNC = s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n !globMagic.test(s[3]);\n const isDrive = /^[a-z]:/i.test(s[0]);\n if (isUNC) {\n return [\n ...s.slice(0, 4),\n ...s.slice(4).map(ss => this.parse(ss)),\n ];\n }\n else if (isDrive) {\n return [s[0], ...s.slice(1).map(ss => this.parse(ss))];\n }\n }\n return s.map(ss => this.parse(ss));\n });\n this.debug(this.pattern, set);\n // filter out everything that didn't compile properly.\n this.set = set.filter(s => s.indexOf(false) === -1);\n // do not treat the ? in UNC paths as magic\n if (this.isWindows) {\n for (let i = 0; i < this.set.length; i++) {\n const p = this.set[i];\n if (p[0] === '' &&\n p[1] === '' &&\n this.globParts[i][2] === '?' &&\n typeof p[3] === 'string' &&\n /^[a-z]:$/i.test(p[3])) {\n p[2] = '?';\n }\n }\n }\n this.debug(this.pattern, this.set);\n }\n // various transforms to equivalent pattern sets that are\n // faster to process in a filesystem walk. The goal is to\n // eliminate what we can, and push all ** patterns as far\n // to the right as possible, even if it increases the number\n // of patterns that we have to process.\n preprocess(globParts) {\n // if we're not in globstar mode, then turn ** into *\n if (this.options.noglobstar) {\n for (const partset of globParts) {\n for (let j = 0; j < partset.length; j++) {\n if (partset[j] === '**') {\n partset[j] = '*';\n }\n }\n }\n }\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n // aggressive optimization for the purpose of fs walking\n globParts = this.firstPhasePreProcess(globParts);\n globParts = this.secondPhasePreProcess(globParts);\n }\n else if (optimizationLevel >= 1) {\n // just basic optimizations to remove some .. parts\n globParts = this.levelOneOptimize(globParts);\n }\n else {\n // just collapse multiple ** portions into one\n globParts = this.adjascentGlobstarOptimize(globParts);\n }\n return globParts;\n }\n // just get rid of adjascent ** portions\n adjascentGlobstarOptimize(globParts) {\n return globParts.map(parts => {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let i = gs;\n while (parts[i + 1] === '**') {\n i++;\n }\n if (i !== gs) {\n parts.splice(gs, i - gs);\n }\n }\n return parts;\n });\n }\n // get rid of adjascent ** and resolve .. portions\n levelOneOptimize(globParts) {\n return globParts.map(parts => {\n parts = parts.reduce((set, part) => {\n const prev = set[set.length - 1];\n if (part === '**' && prev === '**') {\n return set;\n }\n if (part === '..') {\n if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n set.pop();\n return set;\n }\n }\n set.push(part);\n return set;\n }, []);\n return parts.length === 0 ? [''] : parts;\n });\n }\n levelTwoFileOptimize(parts) {\n if (!Array.isArray(parts)) {\n parts = this.slashSplit(parts);\n }\n let didSomething = false;\n do {\n didSomething = false;\n //
// -> 
/\n            if (!this.preserveMultipleSlashes) {\n                for (let i = 1; i < parts.length - 1; i++) {\n                    const p = parts[i];\n                    // don't squeeze out UNC patterns\n                    if (i === 1 && p === '' && parts[0] === '')\n                        continue;\n                    if (p === '.' || p === '') {\n                        didSomething = true;\n                        parts.splice(i, 1);\n                        i--;\n                    }\n                }\n                if (parts[0] === '.' &&\n                    parts.length === 2 &&\n                    (parts[1] === '.' || parts[1] === '')) {\n                    didSomething = true;\n                    parts.pop();\n                }\n            }\n            // 
/

/../ ->

/\n            let dd = 0;\n            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                const p = parts[dd - 1];\n                if (p &&\n                    p !== '.' &&\n                    p !== '..' &&\n                    p !== '**' &&\n                    !(this.isWindows && /^[a-z]:$/i.test(p))) {\n                    didSomething = true;\n                    parts.splice(dd - 1, 2);\n                    dd -= 2;\n                }\n            }\n        } while (didSomething);\n        return parts.length === 0 ? [''] : parts;\n    }\n    // First phase: single-pattern processing\n    // 
 is 1 or more portions\n    //  is 1 or more portions\n    // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n    // 
/

/../ ->

/\n    // **/**/ -> **/\n    //\n    // **/*/ -> */**/ <== not valid because ** doesn't follow\n    // this WOULD be allowed if ** did follow symlinks, or * didn't\n    firstPhasePreProcess(globParts) {\n        let didSomething = false;\n        do {\n            didSomething = false;\n            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss = gs;\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n                        gss++;\n                    }\n                    // eg, if gs is 2 and gss is 4, that means we have 3 **\n                    // parts, and can remove 2 of them.\n                    if (gss > gs) {\n                        parts.splice(gs + 1, gss - gs);\n                    }\n                    let next = parts[gs + 1];\n                    const p = parts[gs + 2];\n                    const p2 = parts[gs + 3];\n                    if (next !== '..')\n                        continue;\n                    if (!p ||\n                        p === '.' ||\n                        p === '..' ||\n                        !p2 ||\n                        p2 === '.' ||\n                        p2 === '..') {\n                        continue;\n                    }\n                    didSomething = true;\n                    // edit parts in place, and push the new one\n                    parts.splice(gs, 1);\n                    const other = parts.slice(0);\n                    other[gs] = '**';\n                    globParts.push(other);\n                    gs--;\n                }\n                // 
// -> 
/\n                if (!this.preserveMultipleSlashes) {\n                    for (let i = 1; i < parts.length - 1; i++) {\n                        const p = parts[i];\n                        // don't squeeze out UNC patterns\n                        if (i === 1 && p === '' && parts[0] === '')\n                            continue;\n                        if (p === '.' || p === '') {\n                            didSomething = true;\n                            parts.splice(i, 1);\n                            i--;\n                        }\n                    }\n                    if (parts[0] === '.' &&\n                        parts.length === 2 &&\n                        (parts[1] === '.' || parts[1] === '')) {\n                        didSomething = true;\n                        parts.pop();\n                    }\n                }\n                // 
/

/../ ->

/\n                let dd = 0;\n                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                    const p = parts[dd - 1];\n                    if (p && p !== '.' && p !== '..' && p !== '**') {\n                        didSomething = true;\n                        const needDot = dd === 1 && parts[dd + 1] === '**';\n                        const splin = needDot ? ['.'] : [];\n                        parts.splice(dd - 1, 2, ...splin);\n                        if (parts.length === 0)\n                            parts.push('');\n                        dd -= 2;\n                    }\n                }\n            }\n        } while (didSomething);\n        return globParts;\n    }\n    // second phase: multi-pattern dedupes\n    // {
/*/,
/

/} ->

/*/\n    // {
/,
/} -> 
/\n    // {
/**/,
/} -> 
/**/\n    //\n    // {
/**/,
/**/

/} ->

/**/\n    // ^-- not valid because ** doens't follow symlinks\n    secondPhasePreProcess(globParts) {\n        for (let i = 0; i < globParts.length - 1; i++) {\n            for (let j = i + 1; j < globParts.length; j++) {\n                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);\n                if (matched) {\n                    globParts[i] = [];\n                    globParts[j] = matched;\n                    break;\n                }\n            }\n        }\n        return globParts.filter(gs => gs.length);\n    }\n    partsMatch(a, b, emptyGSMatch = false) {\n        let ai = 0;\n        let bi = 0;\n        let result = [];\n        let which = '';\n        while (ai < a.length && bi < b.length) {\n            if (a[ai] === b[bi]) {\n                result.push(which === 'b' ? b[bi] : a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n                result.push(a[ai]);\n                ai++;\n            }\n            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n                result.push(b[bi]);\n                bi++;\n            }\n            else if (a[ai] === '*' &&\n                b[bi] &&\n                (this.options.dot || !b[bi].startsWith('.')) &&\n                b[bi] !== '**') {\n                if (which === 'b')\n                    return false;\n                which = 'a';\n                result.push(a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (b[bi] === '*' &&\n                a[ai] &&\n                (this.options.dot || !a[ai].startsWith('.')) &&\n                a[ai] !== '**') {\n                if (which === 'a')\n                    return false;\n                which = 'b';\n                result.push(b[bi]);\n                ai++;\n                bi++;\n            }\n            else {\n                return false;\n            }\n        }\n        // if we fall out of the loop, it means they two are identical\n        // as long as their lengths match\n        return a.length === b.length && result;\n    }\n    parseNegate() {\n        if (this.nonegate)\n            return;\n        const pattern = this.pattern;\n        let negate = false;\n        let negateOffset = 0;\n        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n            negate = !negate;\n            negateOffset++;\n        }\n        if (negateOffset)\n            this.pattern = pattern.slice(negateOffset);\n        this.negate = negate;\n    }\n    // set partial to true to test if, for example,\n    // \"/a/b\" matches the start of \"/*/b/*/d\"\n    // Partial means, if you run out of file before you run\n    // out of pattern, then that's fine, as long as all\n    // the parts match.\n    matchOne(file, pattern, partial = false) {\n        let fileStartIndex = 0;\n        let patternStartIndex = 0;\n        // UNC paths like //?/X:/... can match X:/... and vice versa\n        // Drive letters in absolute drive or unc paths are always compared\n        // case-insensitively.\n        if (this.isWindows) {\n            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);\n            const fileUNC = !fileDrive &&\n                file[0] === '' &&\n                file[1] === '' &&\n                file[2] === '?' &&\n                /^[a-z]:$/i.test(file[3]);\n            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);\n            const patternUNC = !patternDrive &&\n                pattern[0] === '' &&\n                pattern[1] === '' &&\n                pattern[2] === '?' &&\n                typeof pattern[3] === 'string' &&\n                /^[a-z]:$/i.test(pattern[3]);\n            const fdi = fileUNC ? 3\n                : fileDrive ? 0\n                    : undefined;\n            const pdi = patternUNC ? 3\n                : patternDrive ? 0\n                    : undefined;\n            if (typeof fdi === 'number' && typeof pdi === 'number') {\n                const [fd, pd] = [\n                    file[fdi],\n                    pattern[pdi],\n                ];\n                // start matching at the drive letter index of each\n                if (fd.toLowerCase() === pd.toLowerCase()) {\n                    pattern[pdi] = fd;\n                    patternStartIndex = pdi;\n                    fileStartIndex = fdi;\n                }\n            }\n        }\n        // resolve and reduce . and .. portions in the file as well.\n        // don't need to do the second phase, because it's only one string[]\n        const { optimizationLevel = 1 } = this.options;\n        if (optimizationLevel >= 2) {\n            file = this.levelTwoFileOptimize(file);\n        }\n        if (pattern.includes(GLOBSTAR)) {\n            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);\n        }\n        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);\n    }\n    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {\n        // split the pattern into head, tail, and middle of ** delimited parts\n        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);\n        const lastgs = pattern.lastIndexOf(GLOBSTAR);\n        // split the pattern up into globstar-delimited sections\n        // the tail has to be at the end, and the others just have\n        // to be found in order from the head.\n        const [head, body, tail] = partial ?\n            [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1),\n                [],\n            ]\n            : [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1, lastgs),\n                pattern.slice(lastgs + 1),\n            ];\n        // check the head, from the current file/pattern index.\n        if (head.length) {\n            const fileHead = file.slice(fileIndex, fileIndex + head.length);\n            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n                return false;\n            }\n            fileIndex += head.length;\n            patternIndex += head.length;\n        }\n        // now we know the head matches!\n        // if the last portion is not empty, it MUST match the end\n        // check the tail\n        let fileTailMatch = 0;\n        if (tail.length) {\n            // if head + tail > file, then we cannot possibly match\n            if (tail.length + fileIndex > file.length)\n                return false;\n            // try to match the tail\n            let tailStart = file.length - tail.length;\n            if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n                fileTailMatch = tail.length;\n            }\n            else {\n                // affordance for stuff like a/**/* matching a/b/\n                // if the last file portion is '', and there's more to the pattern\n                // then try without the '' bit.\n                if (file[file.length - 1] !== '' ||\n                    fileIndex + tail.length === file.length) {\n                    return false;\n                }\n                tailStart--;\n                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n                    return false;\n                }\n                fileTailMatch = tail.length + 1;\n            }\n        }\n        // now we know the tail matches!\n        // the middle is zero or more portions wrapped in **, possibly\n        // containing more ** sections.\n        // so a/**/b/**/c/**/d has become **/b/**/c/**\n        // if it's empty, it means a/**/b, just verify we have no bad dots\n        // if there's no tail, so it ends on /**, then we must have *something*\n        // after the head, or it's not a matc\n        if (!body.length) {\n            let sawSome = !!fileTailMatch;\n            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n                const f = String(file[i]);\n                sawSome = true;\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            // in partial mode, we just need to get past all file parts\n            return partial || sawSome;\n        }\n        // now we know that there's one or more body sections, which can\n        // be matched anywhere from the 0 index (because the head was pruned)\n        // through to the length-fileTailMatch index.\n        // split the body up into sections, and note the minimum index it can\n        // be found at (start with the length of all previous segments)\n        // [section, before, after]\n        const bodySegments = [[[], 0]];\n        let currentBody = bodySegments[0];\n        let nonGsParts = 0;\n        const nonGsPartsSums = [0];\n        for (const b of body) {\n            if (b === GLOBSTAR) {\n                nonGsPartsSums.push(nonGsParts);\n                currentBody = [[], 0];\n                bodySegments.push(currentBody);\n            }\n            else {\n                currentBody[0].push(b);\n                nonGsParts++;\n            }\n        }\n        let i = bodySegments.length - 1;\n        const fileLength = file.length - fileTailMatch;\n        for (const b of bodySegments) {\n            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);\n        }\n        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);\n    }\n    // return false for \"nope, not matching\"\n    // return null for \"not matching, cannot keep trying\"\n    #matchGlobStarBodySections(file, \n    // pattern section, last possible position for it\n    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {\n        // take the first body segment, and walk from fileIndex to its \"after\"\n        // value at the end\n        // If it doesn't match at that position, we increment, until we hit\n        // that final possible position, and give up.\n        // If it does match, then advance and try to rest.\n        // If any of them fail we keep walking forward.\n        // this is still a bit recursively painful, but it's more constrained\n        // than previous implementations, because we never test something that\n        // can't possibly be a valid matching condition.\n        const bs = bodySegments[bodyIndex];\n        if (!bs) {\n            // just make sure that there's no bad dots\n            for (let i = fileIndex; i < file.length; i++) {\n                sawTail = true;\n                const f = file[i];\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            return sawTail;\n        }\n        // have a non-globstar body section to test\n        const [body, after] = bs;\n        while (fileIndex <= after) {\n            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);\n            // if limit exceeded, no match. intentional false negative,\n            // acceptable break in correctness for security.\n            if (m && globStarDepth < this.maxGlobstarRecursion) {\n                // match! see if the rest match. if so, we're done!\n                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);\n                if (sub !== false) {\n                    return sub;\n                }\n            }\n            const f = file[fileIndex];\n            if (f === '.' ||\n                f === '..' ||\n                (!this.options.dot && f.startsWith('.'))) {\n                return false;\n            }\n            fileIndex++;\n        }\n        // walked off. no point continuing\n        return partial || null;\n    }\n    #matchOne(file, pattern, partial, fileIndex, patternIndex) {\n        let fi;\n        let pi;\n        let pl;\n        let fl;\n        for (fi = fileIndex,\n            pi = patternIndex,\n            fl = file.length,\n            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {\n            this.debug('matchOne loop');\n            let p = pattern[pi];\n            let f = file[fi];\n            this.debug(pattern, p, f);\n            // should be impossible.\n            // some invalid regexp stuff in the set.\n            /* c8 ignore start */\n            if (p === false || p === GLOBSTAR) {\n                return false;\n            }\n            /* c8 ignore stop */\n            // something other than **\n            // non-magic patterns just have to match exactly\n            // patterns with magic have been turned into regexps.\n            let hit;\n            if (typeof p === 'string') {\n                hit = f === p;\n                this.debug('string match', p, f, hit);\n            }\n            else {\n                hit = p.test(f);\n                this.debug('pattern match', p, f, hit);\n            }\n            if (!hit)\n                return false;\n        }\n        // Note: ending in / means that we'll get a final \"\"\n        // at the end of the pattern.  This can only match a\n        // corresponding \"\" at the end of the file.\n        // If the file ends in /, then it can only match a\n        // a pattern that ends in /, unless the pattern just\n        // doesn't have any more for it. But, a/b/ should *not*\n        // match \"a/b/*\", even though \"\" matches against the\n        // [^/]*? pattern, except in partial mode, where it might\n        // simply not be reached yet.\n        // However, a/b/ should still satisfy a/*\n        // now either we fell off the end of the pattern, or we're done.\n        if (fi === fl && pi === pl) {\n            // ran out of pattern and filename at the same time.\n            // an exact hit!\n            return true;\n        }\n        else if (fi === fl) {\n            // ran out of file, but still had pattern left.\n            // this is ok if we're doing the match as part of\n            // a glob fs traversal.\n            return partial;\n        }\n        else if (pi === pl) {\n            // ran out of pattern, still have file left.\n            // this is only acceptable if we're on the very last\n            // empty segment of a file with a trailing slash.\n            // a/* should match a/b/\n            return fi === fl - 1 && file[fi] === '';\n            /* c8 ignore start */\n        }\n        else {\n            // should be unreachable.\n            throw new Error('wtf?');\n        }\n        /* c8 ignore stop */\n    }\n    braceExpand() {\n        return braceExpand(this.pattern, this.options);\n    }\n    parse(pattern) {\n        assertValidPattern(pattern);\n        const options = this.options;\n        // shortcuts\n        if (pattern === '**')\n            return GLOBSTAR;\n        if (pattern === '')\n            return '';\n        // far and away, the most common glob pattern parts are\n        // *, *.*, and *.  Add a fast check method for those.\n        let m;\n        let fastTest = null;\n        if ((m = pattern.match(starRE))) {\n            fastTest = options.dot ? starTestDot : starTest;\n        }\n        else if ((m = pattern.match(starDotExtRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    starDotExtTestNocaseDot\n                    : starDotExtTestNocase\n                : options.dot ? starDotExtTestDot\n                    : starDotExtTest)(m[1]);\n        }\n        else if ((m = pattern.match(qmarksRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    qmarksTestNocaseDot\n                    : qmarksTestNocase\n                : options.dot ? qmarksTestDot\n                    : qmarksTest)(m);\n        }\n        else if ((m = pattern.match(starDotStarRE))) {\n            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;\n        }\n        else if ((m = pattern.match(dotStarRE))) {\n            fastTest = dotStarTest;\n        }\n        const re = AST.fromGlob(pattern, this.options).toMMPattern();\n        if (fastTest && typeof re === 'object') {\n            // Avoids overriding in frozen environments\n            Reflect.defineProperty(re, 'test', { value: fastTest });\n        }\n        return re;\n    }\n    makeRe() {\n        if (this.regexp || this.regexp === false)\n            return this.regexp;\n        // at this point, this.set is a 2d array of partial\n        // pattern strings, or \"**\".\n        //\n        // It's better to use .match().  This function shouldn't\n        // be used, really, but it's pretty convenient sometimes,\n        // when you just want to work with a regex.\n        const set = this.set;\n        if (!set.length) {\n            this.regexp = false;\n            return this.regexp;\n        }\n        const options = this.options;\n        const twoStar = options.noglobstar ? star\n            : options.dot ? twoStarDot\n                : twoStarNoDot;\n        const flags = new Set(options.nocase ? ['i'] : []);\n        // regexpify non-globstar patterns\n        // if ** is only item, then we just do one twoStar\n        // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n        // if ** is last, append (\\/twoStar|) to previous\n        // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n        // then filter out GLOBSTAR symbols\n        let re = set\n            .map(pattern => {\n            const pp = pattern.map(p => {\n                if (p instanceof RegExp) {\n                    for (const f of p.flags.split(''))\n                        flags.add(f);\n                }\n                return (typeof p === 'string' ? regExpEscape(p)\n                    : p === GLOBSTAR ? GLOBSTAR\n                        : p._src);\n            });\n            pp.forEach((p, i) => {\n                const next = pp[i + 1];\n                const prev = pp[i - 1];\n                if (p !== GLOBSTAR || prev === GLOBSTAR) {\n                    return;\n                }\n                if (prev === undefined) {\n                    if (next !== undefined && next !== GLOBSTAR) {\n                        pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next;\n                    }\n                    else {\n                        pp[i] = twoStar;\n                    }\n                }\n                else if (next === undefined) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?';\n                }\n                else if (next !== GLOBSTAR) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next;\n                    pp[i + 1] = GLOBSTAR;\n                }\n            });\n            const filtered = pp.filter(p => p !== GLOBSTAR);\n            // For partial matches, we need to make the pattern match\n            // any prefix of the full path. We do this by generating\n            // alternative patterns that match progressively longer prefixes.\n            if (this.partial && filtered.length >= 1) {\n                const prefixes = [];\n                for (let i = 1; i <= filtered.length; i++) {\n                    prefixes.push(filtered.slice(0, i).join('/'));\n                }\n                return '(?:' + prefixes.join('|') + ')';\n            }\n            return filtered.join('/');\n        })\n            .join('|');\n        // need to wrap in parens if we had more than one thing with |,\n        // otherwise only the first will be anchored to ^ and the last to $\n        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];\n        // must match entire pattern\n        // ending in a * or ** will make it less strict.\n        re = '^' + open + re + close + '$';\n        // In partial mode, '/' should always match as it's a valid prefix for any pattern\n        if (this.partial) {\n            re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$';\n        }\n        // can match anything, as long as it's not this.\n        if (this.negate)\n            re = '^(?!' + re + ').+$';\n        try {\n            this.regexp = new RegExp(re, [...flags].join(''));\n            /* c8 ignore start */\n        }\n        catch {\n            // should be impossible\n            this.regexp = false;\n        }\n        /* c8 ignore stop */\n        return this.regexp;\n    }\n    slashSplit(p) {\n        // if p starts with // on windows, we preserve that\n        // so that UNC paths aren't broken.  Otherwise, any number of\n        // / characters are coalesced into one, unless\n        // preserveMultipleSlashes is set to true.\n        if (this.preserveMultipleSlashes) {\n            return p.split('/');\n        }\n        else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n            // add an extra '' for the one we lose\n            return ['', ...p.split(/\\/+/)];\n        }\n        else {\n            return p.split(/\\/+/);\n        }\n    }\n    match(f, partial = this.partial) {\n        this.debug('match', f, this.pattern);\n        // short-circuit in the case of busted things.\n        // comments, etc.\n        if (this.comment) {\n            return false;\n        }\n        if (this.empty) {\n            return f === '';\n        }\n        if (f === '/' && partial) {\n            return true;\n        }\n        const options = this.options;\n        // windows: need to use /, not \\\n        if (this.isWindows) {\n            f = f.split('\\\\').join('/');\n        }\n        // treat the test path as a set of pathparts.\n        const ff = this.slashSplit(f);\n        this.debug(this.pattern, 'split', ff);\n        // just ONE of the pattern sets in this.set needs to match\n        // in order for it to be valid.  If negating, then just one\n        // match means that we have failed.\n        // Either way, return on the first hit.\n        const set = this.set;\n        this.debug(this.pattern, 'set', set);\n        // Find the basename of the path by looking for the last non-empty segment\n        let filename = ff[ff.length - 1];\n        if (!filename) {\n            for (let i = ff.length - 2; !filename && i >= 0; i--) {\n                filename = ff[i];\n            }\n        }\n        for (const pattern of set) {\n            let file = ff;\n            if (options.matchBase && pattern.length === 1) {\n                file = [filename];\n            }\n            const hit = this.matchOne(file, pattern, partial);\n            if (hit) {\n                if (options.flipNegate) {\n                    return true;\n                }\n                return !this.negate;\n            }\n        }\n        // didn't get any hits.  this is success if it's a negative\n        // pattern, failure otherwise.\n        if (options.flipNegate) {\n            return false;\n        }\n        return this.negate;\n    }\n    static defaults(def) {\n        return minimatch.defaults(def).Minimatch;\n    }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js';\nexport { escape } from './escape.js';\nexport { unescape } from './unescape.js';\n/* c8 ignore stop */\nminimatch.AST = AST;\nminimatch.Minimatch = Minimatch;\nminimatch.escape = escape;\nminimatch.unescape = unescape;\n//# sourceMappingURL=index.js.map","import * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Helper class for parsing paths into segments\n */\nexport class Path {\n    /**\n     * Constructs a Path\n     * @param itemPath Path or array of segments\n     */\n    constructor(itemPath) {\n        this.segments = [];\n        // String\n        if (typeof itemPath === 'string') {\n            assert(itemPath, `Parameter 'itemPath' must not be empty`);\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n            // Not rooted\n            if (!pathHelper.hasRoot(itemPath)) {\n                this.segments = itemPath.split(path.sep);\n            }\n            // Rooted\n            else {\n                // Add all segments, while not at the root\n                let remaining = itemPath;\n                let dir = pathHelper.dirname(remaining);\n                while (dir !== remaining) {\n                    // Add the segment\n                    const basename = path.basename(remaining);\n                    this.segments.unshift(basename);\n                    // Truncate the last segment\n                    remaining = dir;\n                    dir = pathHelper.dirname(remaining);\n                }\n                // Remainder is the root\n                this.segments.unshift(remaining);\n            }\n        }\n        // Array\n        else {\n            // Must not be empty\n            assert(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);\n            // Each segment\n            for (let i = 0; i < itemPath.length; i++) {\n                let segment = itemPath[i];\n                // Must not be empty\n                assert(segment, `Parameter 'itemPath' must not contain any empty segments`);\n                // Normalize slashes\n                segment = pathHelper.normalizeSeparators(itemPath[i]);\n                // Root segment\n                if (i === 0 && pathHelper.hasRoot(segment)) {\n                    segment = pathHelper.safeTrimTrailingSeparator(segment);\n                    assert(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);\n                    this.segments.push(segment);\n                }\n                // All other segments\n                else {\n                    // Must not contain slash\n                    assert(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);\n                    this.segments.push(segment);\n                }\n            }\n        }\n    }\n    /**\n     * Converts the path to it's string representation\n     */\n    toString() {\n        // First segment\n        let result = this.segments[0];\n        // All others\n        let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n        for (let i = 1; i < this.segments.length; i++) {\n            if (skipSlash) {\n                skipSlash = false;\n            }\n            else {\n                result += path.sep;\n            }\n            result += this.segments[i];\n        }\n        return result;\n    }\n}\n//# sourceMappingURL=internal-path.js.map","import * as os from 'os';\nimport * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nimport { Minimatch } from 'minimatch';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Path } from './internal-path.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class Pattern {\n    constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) {\n        /**\n         * Indicates whether matches should be excluded from the result set\n         */\n        this.negate = false;\n        // Pattern overload\n        let pattern;\n        if (typeof patternOrNegate === 'string') {\n            pattern = patternOrNegate.trim();\n        }\n        // Segments overload\n        else {\n            // Convert to pattern\n            segments = segments || [];\n            assert(segments.length, `Parameter 'segments' must not empty`);\n            const root = Pattern.getLiteral(segments[0]);\n            assert(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);\n            pattern = new Path(segments).toString().trim();\n            if (patternOrNegate) {\n                pattern = `!${pattern}`;\n            }\n        }\n        // Negate\n        while (pattern.startsWith('!')) {\n            this.negate = !this.negate;\n            pattern = pattern.substr(1).trim();\n        }\n        // Normalize slashes and ensures absolute root\n        pattern = Pattern.fixupPattern(pattern, homedir);\n        // Segments\n        this.segments = new Path(pattern).segments;\n        // Trailing slash indicates the pattern should only match directories, not regular files\n        this.trailingSeparator = pathHelper\n            .normalizeSeparators(pattern)\n            .endsWith(path.sep);\n        pattern = pathHelper.safeTrimTrailingSeparator(pattern);\n        // Search path (literal path prior to the first glob segment)\n        let foundGlob = false;\n        const searchSegments = this.segments\n            .map(x => Pattern.getLiteral(x))\n            .filter(x => !foundGlob && !(foundGlob = x === ''));\n        this.searchPath = new Path(searchSegments).toString();\n        // Root RegExp (required when determining partial match)\n        this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : '');\n        this.isImplicitPattern = isImplicitPattern;\n        // Create minimatch\n        const minimatchOptions = {\n            dot: true,\n            nobrace: true,\n            nocase: IS_WINDOWS,\n            nocomment: true,\n            noext: true,\n            nonegate: true\n        };\n        pattern = IS_WINDOWS ? pattern.replace(/\\\\/g, '/') : pattern;\n        this.minimatch = new Minimatch(pattern, minimatchOptions);\n    }\n    /**\n     * Matches the pattern against the specified path\n     */\n    match(itemPath) {\n        // Last segment is globstar?\n        if (this.segments[this.segments.length - 1] === '**') {\n            // Normalize slashes\n            itemPath = pathHelper.normalizeSeparators(itemPath);\n            // Append a trailing slash. Otherwise Minimatch will not match the directory immediately\n            // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns\n            // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.\n            if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) {\n                // Note, this is safe because the constructor ensures the pattern has an absolute root.\n                // For example, formats like C: and C:foo on Windows are resolved to an absolute root.\n                itemPath = `${itemPath}${path.sep}`;\n            }\n        }\n        else {\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        }\n        // Match\n        if (this.minimatch.match(itemPath)) {\n            return this.trailingSeparator ? MatchKind.Directory : MatchKind.All;\n        }\n        return MatchKind.None;\n    }\n    /**\n     * Indicates whether the pattern may match descendants of the specified path\n     */\n    partialMatch(itemPath) {\n        // Normalize slashes and trim unnecessary trailing slash\n        itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        // matchOne does not handle root path correctly\n        if (pathHelper.dirname(itemPath) === itemPath) {\n            return this.rootRegExp.test(itemPath);\n        }\n        return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\\\+/ : /\\/+/), this.minimatch.set[0], true);\n    }\n    /**\n     * Escapes glob patterns within a path\n     */\n    static globEscape(s) {\n        return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n            .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n            .replace(/\\?/g, '[?]') // escape '?'\n            .replace(/\\*/g, '[*]'); // escape '*'\n    }\n    /**\n     * Normalizes slashes and ensures absolute root\n     */\n    static fixupPattern(pattern, homedir) {\n        // Empty\n        assert(pattern, 'pattern cannot be empty');\n        // Must not contain `.` segment, unless first segment\n        // Must not contain `..` segment\n        const literalSegments = new Path(pattern).segments.map(x => Pattern.getLiteral(x));\n        assert(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);\n        // Must not contain globs in root, e.g. Windows UNC path \\\\foo\\b*r\n        assert(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);\n        // Normalize slashes\n        pattern = pathHelper.normalizeSeparators(pattern);\n        // Replace leading `.` segment\n        if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) {\n            pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1);\n        }\n        // Replace leading `~` segment\n        else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {\n            homedir = homedir || os.homedir();\n            assert(homedir, 'Unable to determine HOME directory');\n            assert(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);\n            pattern = Pattern.globEscape(homedir) + pattern.substr(1);\n        }\n        // Replace relative drive root, e.g. pattern is C: or C:foo\n        else if (IS_WINDOWS &&\n            (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\\\]/i))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', pattern.substr(0, 2));\n            if (pattern.length > 2 && !root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(2);\n        }\n        // Replace relative root, e.g. pattern is \\ or \\foo\n        else if (IS_WINDOWS && (pattern === '\\\\' || pattern.match(/^\\\\[^\\\\]/))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', '\\\\');\n            if (!root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(1);\n        }\n        // Otherwise ensure absolute root\n        else {\n            pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern);\n        }\n        return pathHelper.normalizeSeparators(pattern);\n    }\n    /**\n     * Attempts to unescape a pattern segment to create a literal path segment.\n     * Otherwise returns empty string.\n     */\n    static getLiteral(segment) {\n        let literal = '';\n        for (let i = 0; i < segment.length; i++) {\n            const c = segment[i];\n            // Escape\n            if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n                literal += segment[++i];\n                continue;\n            }\n            // Wildcard\n            else if (c === '*' || c === '?') {\n                return '';\n            }\n            // Character set\n            else if (c === '[' && i + 1 < segment.length) {\n                let set = '';\n                let closed = -1;\n                for (let i2 = i + 1; i2 < segment.length; i2++) {\n                    const c2 = segment[i2];\n                    // Escape\n                    if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n                        set += segment[++i2];\n                        continue;\n                    }\n                    // Closed\n                    else if (c2 === ']') {\n                        closed = i2;\n                        break;\n                    }\n                    // Otherwise\n                    else {\n                        set += c2;\n                    }\n                }\n                // Closed?\n                if (closed >= 0) {\n                    // Cannot convert\n                    if (set.length > 1) {\n                        return '';\n                    }\n                    // Convert to literal\n                    if (set) {\n                        literal += set;\n                        i = closed;\n                        continue;\n                    }\n                }\n                // Otherwise fall thru\n            }\n            // Append\n            literal += c;\n        }\n        return literal;\n    }\n    /**\n     * Escapes regexp special characters\n     * https://javascript.info/regexp-escaping\n     */\n    static regExpEscape(s) {\n        return s.replace(/[[\\\\^$.|?*+()]/g, '\\\\$&');\n    }\n}\n//# sourceMappingURL=internal-pattern.js.map","export class SearchState {\n    constructor(path, level) {\n        this.path = path;\n        this.level = level;\n    }\n}\n//# sourceMappingURL=internal-search-state.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\n    return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n    function fulfill(value) { resume(\"next\", value); }\n    function reject(value) { resume(\"throw\", value); }\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as globOptionsHelper from './internal-glob-options-helper.js';\nimport * as path from 'path';\nimport * as patternHelper from './internal-pattern-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Pattern } from './internal-pattern.js';\nimport { SearchState } from './internal-search-state.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class DefaultGlobber {\n    constructor(options) {\n        this.patterns = [];\n        this.searchPaths = [];\n        this.options = globOptionsHelper.getOptions(options);\n    }\n    getSearchPaths() {\n        // Return a copy\n        return this.searchPaths.slice();\n    }\n    glob() {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a, e_1, _b, _c;\n            const result = [];\n            try {\n                for (var _d = true, _e = __asyncValues(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {\n                    _c = _f.value;\n                    _d = false;\n                    const itemPath = _c;\n                    result.push(itemPath);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            return result;\n        });\n    }\n    globGenerator() {\n        return __asyncGenerator(this, arguments, function* globGenerator_1() {\n            // Fill in defaults options\n            const options = globOptionsHelper.getOptions(this.options);\n            // Implicit descendants?\n            const patterns = [];\n            for (const pattern of this.patterns) {\n                patterns.push(pattern);\n                if (options.implicitDescendants &&\n                    (pattern.trailingSeparator ||\n                        pattern.segments[pattern.segments.length - 1] !== '**')) {\n                    patterns.push(new Pattern(pattern.negate, true, pattern.segments.concat('**')));\n                }\n            }\n            // Push the search paths\n            const stack = [];\n            for (const searchPath of patternHelper.getSearchPaths(patterns)) {\n                core.debug(`Search path '${searchPath}'`);\n                // Exists?\n                try {\n                    // Intentionally using lstat. Detection for broken symlink\n                    // will be performed later (if following symlinks).\n                    yield __await(fs.promises.lstat(searchPath));\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        continue;\n                    }\n                    throw err;\n                }\n                stack.unshift(new SearchState(searchPath, 1));\n            }\n            // Search\n            const traversalChain = []; // used to detect cycles\n            while (stack.length) {\n                // Pop\n                const item = stack.pop();\n                // Match?\n                const match = patternHelper.match(patterns, item.path);\n                const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path);\n                if (!match && !partialMatch) {\n                    continue;\n                }\n                // Stat\n                const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain)\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                );\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                if (!stats) {\n                    continue;\n                }\n                // Hidden file or directory?\n                if (options.excludeHiddenFiles && path.basename(item.path).match(/^\\./)) {\n                    continue;\n                }\n                // Directory\n                if (stats.isDirectory()) {\n                    // Matched\n                    if (match & MatchKind.Directory && options.matchDirectories) {\n                        yield yield __await(item.path);\n                    }\n                    // Descend?\n                    else if (!partialMatch) {\n                        continue;\n                    }\n                    // Push the child items in reverse\n                    const childLevel = item.level + 1;\n                    const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new SearchState(path.join(item.path, x), childLevel));\n                    stack.push(...childItems.reverse());\n                }\n                // File\n                else if (match & MatchKind.File) {\n                    yield yield __await(item.path);\n                }\n            }\n        });\n    }\n    /**\n     * Constructs a DefaultGlobber\n     */\n    static create(patterns, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const result = new DefaultGlobber(options);\n            if (IS_WINDOWS) {\n                patterns = patterns.replace(/\\r\\n/g, '\\n');\n                patterns = patterns.replace(/\\r/g, '\\n');\n            }\n            const lines = patterns.split('\\n').map(x => x.trim());\n            for (const line of lines) {\n                // Empty or comment\n                if (!line || line.startsWith('#')) {\n                    continue;\n                }\n                // Pattern\n                else {\n                    result.patterns.push(new Pattern(line));\n                }\n            }\n            result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns));\n            return result;\n        });\n    }\n    static stat(item, options, traversalChain) {\n        return __awaiter(this, void 0, void 0, function* () {\n            // Note:\n            // `stat` returns info about the target of a symlink (or symlink chain)\n            // `lstat` returns info about a symlink itself\n            let stats;\n            if (options.followSymbolicLinks) {\n                try {\n                    // Use `stat` (following symlinks)\n                    stats = yield fs.promises.stat(item.path);\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        if (options.omitBrokenSymbolicLinks) {\n                            core.debug(`Broken symlink '${item.path}'`);\n                            return undefined;\n                        }\n                        throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);\n                    }\n                    throw err;\n                }\n            }\n            else {\n                // Use `lstat` (not following symlinks)\n                stats = yield fs.promises.lstat(item.path);\n            }\n            // Note, isDirectory() returns false for the lstat of a symlink\n            if (stats.isDirectory() && options.followSymbolicLinks) {\n                // Get the realpath\n                const realPath = yield fs.promises.realpath(item.path);\n                // Fixup the traversal chain to match the item level\n                while (traversalChain.length >= item.level) {\n                    traversalChain.pop();\n                }\n                // Test for a cycle\n                if (traversalChain.some((x) => x === realPath)) {\n                    core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);\n                    return undefined;\n                }\n                // Update the traversal chain\n                traversalChain.push(realPath);\n            }\n            return stats;\n        });\n    }\n}\n//# sourceMappingURL=internal-globber.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"stream\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nimport * as crypto from 'crypto';\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as stream from 'stream';\nimport * as util from 'util';\nimport * as path from 'path';\nexport function hashFiles(globber_1, currentWorkspace_1) {\n    return __awaiter(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) {\n        var _a, e_1, _b, _c;\n        var _d;\n        const writeDelegate = verbose ? core.info : core.debug;\n        let hasMatch = false;\n        const githubWorkspace = currentWorkspace\n            ? currentWorkspace\n            : ((_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd());\n        const result = crypto.createHash('sha256');\n        let count = 0;\n        try {\n            for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {\n                _c = _g.value;\n                _e = false;\n                const file = _c;\n                writeDelegate(file);\n                if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {\n                    writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);\n                    continue;\n                }\n                if (fs.statSync(file).isDirectory()) {\n                    writeDelegate(`Skip directory '${file}'.`);\n                    continue;\n                }\n                const hash = crypto.createHash('sha256');\n                const pipeline = util.promisify(stream.pipeline);\n                yield pipeline(fs.createReadStream(file), hash);\n                result.write(hash.digest());\n                count++;\n                if (!hasMatch) {\n                    hasMatch = true;\n                }\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        result.end();\n        if (hasMatch) {\n            writeDelegate(`Found ${count} files to hash.`);\n            return result.digest('hex');\n        }\n        else {\n            writeDelegate(`No matches found for glob`);\n            return '';\n        }\n    });\n}\n//# sourceMappingURL=internal-hash-files.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { DefaultGlobber } from './internal-globber.js';\nimport { hashFiles as _hashFiles } from './internal-hash-files.js';\n/**\n * Constructs a globber\n *\n * @param patterns  Patterns separated by newlines\n * @param options   Glob options\n */\nexport function create(patterns, options) {\n    return __awaiter(this, void 0, void 0, function* () {\n        return yield DefaultGlobber.create(patterns, options);\n    });\n}\n/**\n * Computes the sha256 hash of a glob\n *\n * @param patterns  Patterns separated by newlines\n * @param currentWorkspace  Workspace used when matching files\n * @param options   Glob options\n * @param verbose   Enables verbose logging\n */\nexport function hashFiles(patterns_1) {\n    return __awaiter(this, arguments, void 0, function* (patterns, currentWorkspace = '', options, verbose = false) {\n        let followSymbolicLinks = true;\n        if (options && typeof options.followSymbolicLinks === 'boolean') {\n            followSymbolicLinks = options.followSymbolicLinks;\n        }\n        const globber = yield create(patterns, { followSymbolicLinks });\n        return _hashFiles(globber, currentWorkspace, verbose);\n    });\n}\n//# sourceMappingURL=glob.js.map","import { createReadStream } from 'node:fs'\nimport { basename, posix, relative, resolve, sep } from 'node:path'\nimport { Readable } from 'node:stream'\nimport * as core from '@actions/core'\nimport * as glob from '@actions/glob'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { StreamSource } from '@backblaze-labs/b2-sdk/streams'\nimport { tryStat } from '../fs.ts'\nimport {\n  type ParsedInputs,\n  requireSource,\n  uploadFileInfoTotalMaxBytes,\n  validateFileInfo,\n} from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link UploadResult.files}. */\nexport interface UploadedFile {\n  /** Absolute path on the runner that was uploaded. */\n  localPath: string\n  /** B2 file name (the key) the upload landed under. */\n  fileName: string\n  /** B2 file ID assigned by the server. */\n  fileId: string\n  /** Byte size of the upload. */\n  size: number\n  /** Whole-file SHA-1, or `null` when the file was multipart-uploaded. */\n  contentSha1: string | null\n  /**\n   * B2 fileInfo metadata for the uploaded object. This is the SDK-returned\n   * metadata when available; otherwise it falls back to the canonical metadata\n   * submitted in the upload request.\n   */\n  fileInfo: Record\n}\n\n/** Result of {@link uploadCommand}. */\nexport interface UploadResult {\n  /** One entry per uploaded file. Single-file mode returns a one-element array. */\n  files: UploadedFile[]\n  /** Total bytes uploaded across all files. */\n  bytesTransferred: number\n}\n\n/**\n * Upload one or more files to B2.\n *\n * Mode selection:\n *   - If `source` is a plain file path (no glob metacharacters and the path\n *     exists as a regular file), upload that single file. The B2 file name is\n *     `destination` if set; otherwise `basename(source)`.\n *   - Otherwise treat `source` (plus any `include` patterns) as glob(s). Each\n *     matched file is uploaded preserving its path relative to the glob root,\n *     prefixed by `destination` (default empty).\n *\n * Large files are streamed (StreamSource over a fs ReadStream-as-Web-Stream)\n * so we don't buffer the whole payload in RAM. The SDK's `Bucket.upload`\n * routes to multipart automatically when size exceeds the recommended part\n * size and parallelizes parts up to `concurrency`.\n */\nexport async function uploadCommand(\n  bucket: Bucket,\n  inputs: ParsedInputs,\n  signal?: AbortSignal,\n): Promise {\n  const source = requireSource(inputs.source, 'upload')\n\n  const { files, isSingleExplicitFile } = await resolveFiles(source, inputs.include, inputs.exclude)\n  if (files.length === 0) {\n    if (inputs.failOnEmpty) {\n      throw new Error(`No files matched: ${source}`)\n    }\n    core.warning(`No files matched: ${source}`)\n    return { files: [], bytesTransferred: 0 }\n  }\n\n  const fileConcurrency = isSingleExplicitFile ? 1 : inputs.concurrency\n  // Multi-file uploads spend the concurrency budget across files and keep each\n  // file's multipart upload sequential so total in-flight B2 requests remain\n  // bounded by the user-supplied `concurrency` value.\n  const partConcurrency = isSingleExplicitFile || files.length === 1 ? inputs.concurrency : 1\n\n  const uploadPlans = await mapWithConcurrency(files, fileConcurrency, async (f) => {\n    signal?.throwIfAborted()\n    return await prepareUploadPlan(f, inputs, isSingleExplicitFile)\n  })\n\n  const uploaded = await mapWithConcurrency(uploadPlans, fileConcurrency, async (plan) => {\n    signal?.throwIfAborted()\n    const uploadLabel = `upload ${plan.localPath} → b2://${bucket.name}/${plan.fileName}`\n    const groupedLog = uploadPlans.length === 1 || fileConcurrency === 1\n    if (groupedLog) {\n      core.startGroup(uploadLabel)\n    } else {\n      core.info(uploadLabel)\n    }\n    try {\n      return await uploadOne(bucket, plan, inputs, partConcurrency, groupedLog, signal)\n    } finally {\n      if (groupedLog) core.endGroup()\n    }\n  })\n  const totalBytes = uploaded.reduce((sum, file) => sum + file.size, 0)\n\n  return { files: uploaded, bytesTransferred: totalBytes }\n}\n\nasync function mapWithConcurrency(\n  items: T[],\n  concurrency: number,\n  mapper: (item: T) => Promise,\n): Promise {\n  const results = new Array(items.length)\n  let next = 0\n  let firstError: unknown\n  let failed = false\n\n  async function worker(): Promise {\n    while (true) {\n      if (failed) return\n      const index = next++\n      if (index >= items.length) return\n      try {\n        results[index] = await mapper(items[index] as T)\n      } catch (error) {\n        if (!failed) {\n          failed = true\n          firstError = error\n        }\n        return\n      }\n    }\n  }\n\n  const workerCount = Math.min(concurrency, items.length)\n  await Promise.all(Array.from({ length: workerCount }, () => worker()))\n  if (failed) throw firstError\n  return results\n}\n\ninterface ResolvedFiles {\n  files: ResolvedFile[]\n  isSingleExplicitFile: boolean\n}\n\n/**\n * Local file resolved from an upload source.\n *\n * @internal\n */\nexport interface ResolvedFile {\n  localPath: string\n  /** Path relative to the glob root, used when computing the B2 key. */\n  fileName: string\n  /** Byte size captured while resolving the upload source. */\n  size: number\n  /** Modification time captured while resolving the upload source. */\n  mtimeMs: number\n}\n\ninterface UploadPlan {\n  localPath: string\n  fileName: string\n  size: number\n  lastModifiedMillis: number | undefined\n  fileInfo: Record\n}\n\nasync function resolveFiles(\n  source: string,\n  include: string[],\n  exclude: string[],\n): Promise {\n  const explicitFile = await tryStat(source)\n  const looksLikeGlob = /[*?[\\]]/.test(source)\n\n  if (explicitFile?.isFile() && !looksLikeGlob && include.length === 0) {\n    return {\n      files: [\n        {\n          localPath: resolve(source),\n          fileName: basename(source),\n          size: explicitFile.size,\n          mtimeMs: explicitFile.mtimeMs,\n        },\n      ],\n      isSingleExplicitFile: true,\n    }\n  }\n\n  const patterns: string[] = []\n  if (explicitFile?.isDirectory()) {\n    patterns.push(`${resolve(source)}/**`)\n  } else {\n    patterns.push(source)\n  }\n  for (const p of include) patterns.push(p)\n  for (const p of exclude) patterns.push(`!${p}`)\n\n  const globber = await glob.create(patterns.join('\\n'), {\n    followSymbolicLinks: false,\n    matchDirectories: false,\n  })\n  const matches = await globber.glob()\n  const root = explicitFile?.isDirectory() ? resolve(source) : process.cwd()\n\n  const out: ResolvedFile[] = []\n  for (const m of matches) {\n    const s = await tryStat(m)\n    // Filesystem boundary: skip entries that aren't readable files (broken\n    // symlinks, races where a file is unlinked between glob and stat, etc.).\n    if (!s?.isFile()) continue\n    const rel = relative(root, m).split(sep).join(posix.sep)\n    out.push({ localPath: m, fileName: rel, size: s.size, mtimeMs: s.mtimeMs })\n  }\n  out.sort(compareResolvedFiles)\n  return { files: out, isSingleExplicitFile: false }\n}\n\nfunction compareResolvedFiles(a: ResolvedFile, b: ResolvedFile): number {\n  return compareStrings(a.fileName, b.fileName) || compareStrings(a.localPath, b.localPath)\n}\n\nfunction compareStrings(a: string, b: string): number {\n  if (a < b) return -1\n  if (a > b) return 1\n  return 0\n}\n\n/**\n * Map a local source file to its B2 file name under the requested destination.\n *\n * @internal\n */\nexport function remapFileName(\n  file: ResolvedFile,\n  destination: string | undefined,\n  isSingleExplicitFile: boolean,\n): string {\n  if (destination === undefined || destination === '') return file.fileName\n  const dest = destination.replace(/\\/+$/, '')\n  if (isSingleExplicitFile && !destination.endsWith('/')) return dest\n  return `${dest}/${file.fileName}`\n}\n\nasync function prepareUploadPlan(\n  file: ResolvedFile,\n  inputs: ParsedInputs,\n  isSingleExplicitFile: boolean,\n): Promise {\n  const size = file.size\n  const lastModifiedMillis = inputs.preserveMtime ? Math.trunc(file.mtimeMs) : undefined\n  const fileInfo = buildUploadFileInfo(inputs.fileInfo, lastModifiedMillis)\n  validateFileInfo(fileInfo, uploadFileInfoTotalMaxBytes(inputs.encryption))\n\n  return {\n    localPath: file.localPath,\n    fileName: remapFileName(file, inputs.destination, isSingleExplicitFile),\n    size,\n    lastModifiedMillis,\n    fileInfo,\n  }\n}\n\nasync function uploadOne(\n  bucket: Bucket,\n  plan: UploadPlan,\n  inputs: ParsedInputs,\n  partConcurrency: number,\n  groupedLog: boolean,\n  signal?: AbortSignal,\n): Promise {\n  const { fileInfo, fileName, lastModifiedMillis, localPath, size } = plan\n\n  // Stream the file from disk. The SDK's `bucket.upload` routes files larger\n  // than the recommended part size through `uploadLargeFile`, which now\n  // detects non-sliceable sources (StreamSource) and reads the stream once,\n  // shipping one part at a time. Peak memory ≈ partSize regardless of file\n  // size, so multi-GB uploads stay bounded.\n  const nodeStream = createReadStream(localPath)\n  const webStream = Readable.toWeb(nodeStream) as ReadableStream\n  const source = new StreamSource(webStream, size)\n\n  const onProgress = makeProgressListener(`upload[${fileName}]`)\n\n  // `inputs.resume` is parsed but deliberately NOT forwarded to the SDK.\n  // The SDK's resume implementation requires a sliceable source so it can\n  // re-upload specific part offsets after a crash. The action uses\n  // `StreamSource` (memory-bounded streaming from disk), which is read-once-\n  // sequential and not sliceable; passing `resume: true` here would throw\n  // `\"resume is not supported on non-sliceable sources\"`. The input is\n  // kept in the action surface so this can be re-enabled if the action\n  // ever offers a `BufferSource` fallback for users willing to trade RAM\n  // for resumability.\n  const result = await bucket.upload({\n    fileName,\n    source,\n    concurrency: partConcurrency,\n    ...(inputs.partSize !== undefined ? { partSize: inputs.partSize } : {}),\n    ...(inputs.contentType !== undefined ? { contentType: inputs.contentType } : {}),\n    ...(Object.keys(fileInfo).length > 0 ? { fileInfo } : {}),\n    ...(lastModifiedMillis !== undefined ? { lastModifiedMillis } : {}),\n    ...(inputs.encryption !== undefined ? { serverSideEncryption: inputs.encryption } : {}),\n    ...(signal !== undefined ? { signal } : {}),\n    onProgress,\n  })\n\n  // SDK now normalizes multipart `'none'` to `null` at the boundary, so\n  // `result.contentSha1` is `string | null` directly.\n  const sha1 = result.contentSha1\n  const detailPrefix = groupedLog ? '  ' : ''\n  core.info(`${detailPrefix}fileId=${result.fileId} sha1=${sha1 ?? 'multipart'}`)\n  const resultFileInfo = Object.keys(result.fileInfo).length > 0 ? result.fileInfo : fileInfo\n\n  return {\n    localPath,\n    fileName: result.fileName,\n    fileId: result.fileId,\n    size,\n    contentSha1: sha1,\n    fileInfo: resultFileInfo,\n  }\n}\n\nfunction buildUploadFileInfo(\n  inputFileInfo: Record,\n  lastModifiedMillis: number | undefined,\n): Record {\n  const fileInfo: Record = {}\n  for (const [key, value] of Object.entries(inputFileInfo)) {\n    const canonicalKey = key.toLowerCase()\n    if (Object.hasOwn(fileInfo, canonicalKey)) {\n      throw new Error(`Duplicate fileInfo key \"${key}\" from upload metadata`)\n    }\n    fileInfo[canonicalKey] = value\n  }\n  if (lastModifiedMillis !== undefined) {\n    if (Object.hasOwn(fileInfo, 'src_last_modified_millis')) {\n      throw new Error(\n        `Duplicate fileInfo key \"src_last_modified_millis\" from 'preserve-mtime' input`,\n      )\n    }\n    fileInfo.src_last_modified_millis = String(lastModifiedMillis)\n  }\n  return fileInfo\n}\n","import { createReadStream } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { IncrementalSha1 } from '@backblaze-labs/b2-sdk/streams'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link verifyCommand}. */\nexport interface VerifyResult {\n  /** B2 file name that was checked. */\n  fileName: string\n  /** Server-reported byte size of the remote object. */\n  remoteSize: number\n  /**\n   * Remote SHA-1 result: normalized lowercase digest when comparable, raw B2\n   * value for non-comparable headers such as `none` or `unverified:`,\n   * or `null` when B2 does not expose one.\n   */\n  remoteSha1: string | null\n  /** Locally-computed SHA-1, or `null` if no local file was provided. */\n  localSha1: string | null\n  /** True when remote SHA-1 matches the expected value. */\n  verified: boolean\n  /** Human-readable failure reason; `undefined` on success. */\n  reason: string | undefined\n}\n\n/**\n * Verify that a B2 object matches a local file (or an expected SHA-1) without\n * transferring the body.\n *\n * Three modes, in priority order:\n *   1. `expected-sha1` input set → compare the remote object's SHA-1 to that\n *      literal value. No local read.\n *   2. `destination` input is an existing local file → compute that file's\n *      SHA-1 locally and compare to the remote.\n *   3. Neither → fail.\n *\n * In all modes, the remote SHA-1 is fetched via a HEAD request (header\n * `x-bz-content-sha1`). Large files uploaded via multipart return `null` from\n * B2 here because B2 stores the per-part SHA-1s but not a whole-file SHA-1;\n * HEAD-only verification cannot validate those objects, even when\n * `expected-sha1` is supplied.\n */\nexport async function verifyCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n  const source = requireSource(inputs.source, 'verify', 'the B2 file name')\n\n  core.startGroup(`verify b2://${bucket.name}/${source}`)\n  try {\n    // `bucket.head` returns only the parsed response headers; no body to\n    // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n    const { headers } = await bucket.head(source)\n    const remoteSize = headers.contentLength\n    const remoteSha1 = headers.contentSha1\n\n    let localSha1: string | null = null\n    let expected: string | null =\n      inputs.expectedSha1 !== undefined ? normalizeSha1(inputs.expectedSha1, 'expected-sha1') : null\n\n    if (expected === null && inputs.destination !== undefined && inputs.destination !== '') {\n      localSha1 = await sha1OfFile(inputs.destination)\n      expected = normalizeSha1(localSha1, 'destination')\n    }\n\n    if (expected === null) {\n      throw new Error(\n        \"verify needs either 'expected-sha1' (literal) or 'destination' (local file path) to compare against\",\n      )\n    }\n\n    const normalizedRemoteSha1 = remoteSha1 === null ? null : normalizeRemoteSha1(remoteSha1)\n    if (normalizedRemoteSha1 === null) {\n      const reason = unavailableRemoteSha1Reason(remoteSha1)\n      core.warning(`  ${reason}`)\n      return {\n        fileName: source,\n        remoteSize,\n        remoteSha1,\n        localSha1,\n        verified: false,\n        reason,\n      }\n    }\n\n    const verified = normalizedRemoteSha1 === expected\n    const reason = verified\n      ? undefined\n      : `SHA-1 mismatch: remote=${normalizedRemoteSha1} expected=${expected}`\n    if (verified) {\n      core.info(`  ✓ SHA-1 matches (${normalizedRemoteSha1}), size=${remoteSize}B`)\n    } else {\n      core.warning(`  ${reason}`)\n    }\n\n    return {\n      fileName: source,\n      remoteSize,\n      remoteSha1: normalizedRemoteSha1,\n      localSha1,\n      verified,\n      reason,\n    }\n  } finally {\n    core.endGroup()\n  }\n}\n\n/**\n * Normalize and validate a SHA-1 digest for case-insensitive comparison.\n *\n * @internal\n */\nexport function normalizeSha1(raw: string, label = 'SHA-1'): string {\n  const normalized = raw.trim().toLowerCase()\n  if (!/^[a-f0-9]{40}$/.test(normalized)) {\n    throw new Error(`Invalid ${label}: expected a 40-character hexadecimal SHA-1 digest`)\n  }\n  return normalized\n}\n\nfunction normalizeRemoteSha1(raw: string): string | null {\n  const normalized = raw.trim().toLowerCase()\n  return /^[a-f0-9]{40}$/.test(normalized) ? normalized : null\n}\n\nfunction unavailableRemoteSha1Reason(remoteSha1: string | null): string {\n  if (remoteSha1 === null) {\n    return 'remote SHA-1 is unavailable because B2 does not expose a whole-file SHA-1 for multipart-uploaded files; HEAD-only verify cannot validate this object, even with expected-sha1'\n  }\n  return `remote SHA-1 is unavailable because B2 reported ${JSON.stringify(remoteSha1)} instead of a verified 40-character whole-file SHA-1; HEAD-only verify cannot validate this object, even with expected-sha1`\n}\n\nasync function sha1OfFile(path: string): Promise {\n  const fileStat = await stat(path)\n  if (!fileStat.isFile()) {\n    throw new Error(`verify: 'destination' must be an existing file, got: ${path}`)\n  }\n  const hasher = new IncrementalSha1()\n  const stream = createReadStream(path)\n  for await (const chunk of stream) {\n    await hasher.update(chunk as Uint8Array)\n  }\n  return hasher.digest()\n}\n","import {\n  AccessDeniedError,\n  B2Error,\n  B2InsufficientCapabilityError,\n  B2SsrfError,\n  BadAuthTokenError,\n  NetworkError,\n} from '@backblaze-labs/b2-sdk/errors'\nimport { ACTION_EFFECTS, type ActionName } from './inputs.ts'\n\nconst SAFE_RETRY_HINT = 'safe to retry this workflow.'\nconst DRY_RUN_RETRY_HINT = 'safe to retry this dry-run workflow.'\nconst MUTATING_RETRY_SUFFIX =\n  'action may have partially committed; inspect B2 state before rerunning to avoid duplicate file versions, orphaned large-file uploads, or unintended deletes.'\nconst UNKNOWN_RETRY_HINT =\n  'retry may be appropriate after checking whether the request had side effects.'\nconst SSRF_FAILURE_MESSAGE =\n  'B2 endpoint safety check failed: rejected an unsafe B2 endpoint or server-provided URL. Check the endpoint input and B2 realm configuration.'\nconst MAX_LOG_FIELD_LENGTH = 1_000\nconst MAX_LOG_INPUT_LENGTH = MAX_LOG_FIELD_LENGTH * 2\nconst MAX_SECRET_BOUNDARY_WINDOW = MAX_LOG_INPUT_LENGTH\nconst MAX_DERIVED_SECRET_LENGTH = 512\nconst DEFAULT_NETWORK_RETRY_AFTER_SECONDS = 30\nconst MAX_RETRY_AFTER_SECONDS = 3_600\nconst MAX_CAUSE_DEPTH = 32\n\nexport interface ActionErrorOptions {\n  action?: ActionName\n  dryRun?: boolean\n  secretValues?: readonly string[]\n}\n\nexport interface ClassifiedActionError {\n  message: string\n  retryable: boolean | undefined\n  retryAfter: number | undefined\n}\n\nexport function classifyActionError(\n  err: unknown,\n  options: ActionErrorOptions = {},\n): ClassifiedActionError {\n  // Order matters: specific SDK classes first, then retryable B2Error, then\n  // the generic B2Error fallback last so new subclasses are not shadowed.\n  if (hasSsrfCause(err)) {\n    return failure(SSRF_FAILURE_MESSAGE, false)\n  }\n  if (err instanceof BadAuthTokenError && isAuthorizationScopeFailure(err)) {\n    return failure(\n      `B2 permission denied: application key is missing required capabilities or is outside the bucket/prefix scope. Update the key capabilities or use a key scoped to this bucket/prefix. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof BadAuthTokenError) {\n    return failure(\n      `B2 authentication failed: check application-key-id and application-key, and confirm the key is active. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof B2InsufficientCapabilityError) {\n    const missing = err.missing.length > 0 ? err.missing.join(', ') : '(unknown)'\n    return failure(\n      `B2 permission denied: application key is missing required capabilities: ${sanitizeLogField(missing, options)}. Update the key capabilities or use a key scoped to this bucket/prefix.`,\n      false,\n    )\n  }\n  if (err instanceof AccessDeniedError) {\n    return failure(\n      `B2 permission denied: check application key capabilities, bucket access, and file name prefix restrictions. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof NetworkError) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient network error talking to B2: ${retry.hint} ${sanitizeLogField(err.message, options)}`,\n      retry.safe,\n      retry.safe ? DEFAULT_NETWORK_RETRY_AFTER_SECONDS : undefined,\n    )\n  }\n  if (err instanceof B2Error && err.retryable) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient B2 error: ${retry.hint} ${formatB2Details(err, options)}`,\n      retry.safe,\n      retry.safe ? err.retryAfter : undefined,\n    )\n  }\n  if (err instanceof B2Error) {\n    return failure(\n      `B2 request failed: ${formatGenericB2Guidance(err, options)} ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  const message = err instanceof Error ? err.message : String(err)\n  return failure(sanitizeLogField(message, options), undefined)\n}\n\nexport function formatActionDebugError(err: unknown, options: ActionErrorOptions = {}): string {\n  const message = err instanceof Error ? (err.stack ?? err.message) : String(err)\n  return sanitizeLogField(message, options)\n}\n\nfunction failure(\n  message: string,\n  retryable: boolean | undefined,\n  retryAfter?: number | undefined,\n): ClassifiedActionError {\n  return { message, retryable, retryAfter: normalizeRetryAfter(retryAfter) }\n}\n\nfunction formatB2Details(err: B2Error, options: ActionErrorOptions): string {\n  const details = [\n    `status ${sanitizeLogField(String(err.status), options)}`,\n    `code ${sanitizeLogField(err.code, options)}`,\n  ]\n  const retryAfter = normalizeRetryAfter(err.retryAfter)\n  if (retryAfter !== undefined) {\n    details.push(`retry after ${sanitizeLogField(String(retryAfter), options)}s`)\n  }\n  return `B2 response details: ${details.join(', ')}`\n}\n\nfunction formatGenericB2Guidance(err: B2Error, options: ActionErrorOptions): string {\n  const message = sanitizeLogField(err.message, options)\n  switch (err.code) {\n    case 'file_not_present':\n    case 'no_such_file':\n      return `File not found; check the bucket and file name. B2 said: ${message}.`\n    case 'duplicate_bucket_name':\n      return `Bucket name already exists; choose a unique bucket name. B2 said: ${message}.`\n    case 'cap_exceeded':\n    case 'storage_cap_exceeded':\n    case 'transaction_cap_exceeded':\n    case 'download_cap_exceeded':\n      return `B2 account cap was exceeded; reduce usage or wait before retrying. B2 said: ${message}.`\n    case 'bad_request':\n      return `Bad request; check the action inputs for invalid values. B2 said: ${message}.`\n    default:\n      return `B2 said: ${message}.`\n  }\n}\n\nfunction retryPolicy(options: ActionErrorOptions): { safe: boolean; hint: string } {\n  const { action } = options\n  if (action === undefined) return { safe: false, hint: UNKNOWN_RETRY_HINT }\n  const effect = ACTION_EFFECTS[action]\n  if (options.dryRun === true && effect.honorsDryRun) {\n    return { safe: true, hint: DRY_RUN_RETRY_HINT }\n  }\n  if (effect.kind === 'read') return { safe: true, hint: SAFE_RETRY_HINT }\n  return { safe: false, hint: `the ${action} ${MUTATING_RETRY_SUFFIX}` }\n}\n\nfunction isAuthorizationScopeFailure(err: BadAuthTokenError): boolean {\n  if (err.code !== 'unauthorized') return false\n  // The SDK currently exposes scoped-key `unauthorized` responses as\n  // BadAuthTokenError with only server prose to distinguish capability/scope\n  // misses. Keep this as best-effort until a structured subtype exists.\n  return /\\b(capability|capabilities|scope|bucket|prefix|permission|not authorized|unauthorized)\\b/i.test(\n    err.message,\n  )\n}\n\nfunction hasSsrfCause(err: unknown): boolean {\n  const seen = new Set()\n  let current: unknown = err\n  for (let depth = 0; current instanceof Error && depth < MAX_CAUSE_DEPTH; depth += 1) {\n    if (current instanceof B2SsrfError) return true\n    if (seen.has(current)) return false\n    seen.add(current)\n    current = current.cause\n  }\n  return false\n}\n\nfunction normalizeRetryAfter(retryAfter: number | undefined): number | undefined {\n  if (retryAfter === undefined || !Number.isFinite(retryAfter) || retryAfter < 0) return undefined\n  return Math.min(Math.ceil(retryAfter), MAX_RETRY_AFTER_SECONDS)\n}\n\nfunction sanitizeUntrustedText(value: string): string {\n  return value\n    .replace(/\\bhttps?:\\/\\/\\S+/gi, '[redacted-url]')\n    .replace(/\\bBearer\\s+[A-Za-z0-9._~+/=-]+/gi, 'Bearer ***')\n}\n\nfunction sanitizeLogField(value: string, options: ActionErrorOptions): string {\n  const secretValues = options.secretValues ?? []\n  const scrubInputLength =\n    secretValues.length > 0\n      ? MAX_LOG_INPUT_LENGTH + MAX_SECRET_BOUNDARY_WINDOW\n      : MAX_LOG_INPUT_LENGTH\n  const bounded = value.length > scrubInputLength ? value.slice(0, scrubInputLength) : value\n  const masked = maskSecrets(bounded, secretValues)\n  const scrubbed =\n    masked.length > MAX_LOG_INPUT_LENGTH ? masked.slice(0, MAX_LOG_INPUT_LENGTH) : masked\n  const sanitized = sanitizeUntrustedText(scrubbed)\n  if (sanitized.length <= MAX_LOG_FIELD_LENGTH) return sanitized\n  return `${sanitized.slice(0, MAX_LOG_FIELD_LENGTH)}... [truncated]`\n}\n\nfunction maskSecrets(value: string, secretValues: readonly string[]): string {\n  let masked = value\n  for (const secret of secretValues) {\n    for (const variant of secretVariants(secret)) {\n      masked = masked.split(variant).join('***')\n    }\n  }\n  return masked\n}\n\nfunction secretVariants(secret: string): string[] {\n  if (secret === '') return []\n  const variants = new Set()\n  addSecretVariant(variants, secret)\n  if (secret.length > MAX_LOG_INPUT_LENGTH) {\n    addSecretVariant(variants, secret.slice(0, MAX_LOG_INPUT_LENGTH))\n  }\n  if (secret.length >= 4 && secret.length <= MAX_DERIVED_SECRET_LENGTH) {\n    const base64 = Buffer.from(secret, 'utf8').toString('base64')\n    const base64Url = base64.replaceAll('+', '-').replaceAll('/', '_')\n    addUriEncodedSecretVariant(variants, secret)\n    addSecretVariant(variants, base64)\n    addSecretVariant(variants, base64Url)\n    addSecretVariant(variants, base64Url.replace(/=+$/u, ''))\n    addSecretVariant(variants, Buffer.from(secret, 'utf8').toString('hex'))\n  }\n  return [...variants].sort((a, b) => b.length - a.length)\n}\n\nfunction addSecretVariant(variants: Set, value: string): void {\n  if (value !== '') variants.add(value)\n}\n\nfunction addUriEncodedSecretVariant(variants: Set, secret: string): void {\n  try {\n    addSecretVariant(variants, encodeURIComponent(secret))\n  } catch {\n    // Malformed surrogate pairs are valid JavaScript strings but invalid URI\n    // components. Keep raw/base64/hex masking without letting scrubbing fail.\n  }\n}\n","import { Buffer } from 'node:buffer'\nimport * as core from '@actions/core'\n\nexport const SUMMARY_JSON_PREVIEW_MAX_ENTRIES = 100\nexport const SUMMARY_JSON_MAX_UTF8_BYTES = 256 * 1024\nconst SUMMARY_JSON_OUTPUT_NAME = 'summary-json'\nconst SUMMARY_JSON_TRUNCATED_OUTPUT_NAME = 'summary-json-truncated'\nexport const SUMMARY_JSON_NOTICE_OUTPUT_NAME = 'summary-json-notice'\nexport const SUMMARY_JSON_PREVIEW_OUTPUT_NAME = 'summary-json-preview'\n\nexport type SummaryJsonPayload = CompleteSummaryJsonPayload | TruncatedSummaryJsonPayload\n\nexport interface CompleteSummaryJsonPayload {\n  json: string\n  totalCount: number\n  truncated: false\n}\n\nexport interface TruncatedSummaryJsonPayload {\n  json: string\n  noticeJson: string\n  previewJson: string\n  totalCount: number\n  previewCount: number\n  reason: string\n  truncated: true\n}\n\nexport interface SummaryJsonOutputOptions {\n  item?: (item: T) => unknown\n}\n\ninterface BoundedJsonArray {\n  json: string\n  emittedCount: number\n  byteLimitExceeded: boolean\n  serializationFailed: boolean\n}\n\n/**\n * Serialize per-file command details into the bounded `summary-json` output.\n *\n * GitHub Actions writes outputs as UTF-8 and caps all action outputs for a job\n * at 1 MB. Keep this single structured output well below that job-level\n * budget so scalar outputs, $GITHUB_OUTPUT framing, and caller-defined outputs\n * still have room.\n *\n * `summary-json` remains a complete array when the full manifest fits. When a\n * result exceeds the supported byte cap, `summary-json` remains an array\n * (`[]`) rather than changing shape or carrying a partial manifest.\n * `summary-json-notice` receives a small JSON object describing the\n * truncation, `summary-json-preview` receives a bounded diagnostic prefix, and\n * `summary-json-truncated` is set to `true`. The action step may still succeed\n * because the B2 operation itself has already completed. Scalar count outputs\n * (`file-count`, `files-listed`, etc.) remain the authoritative totals.\n *\n * The serializer also omits credential-bearing field names for every command:\n * `url`, fields ending in `url`, and fields containing `authorization`,\n * `signature`, or `token` after case/underscore/hyphen normalization. Commands\n * that need to expose similarly named non-secret data should project it to an\n * explicit safe field name before calling this helper.\n */\nexport function buildSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): SummaryJsonPayload {\n  const serialized = serializeJsonArrayPrefix(items, options, items.length)\n  if (!serialized.byteLimitExceeded && !serialized.serializationFailed) {\n    return {\n      json: serialized.json,\n      totalCount: items.length,\n      truncated: false,\n    }\n  }\n\n  return buildTruncatedSummaryJsonPayload(\n    items,\n    options,\n    serialized.serializationFailed\n      ? 'summary-json could not be serialized within the supported output contract'\n      : 'summary-json exceeded the supported UTF-8 output size cap',\n  )\n}\n\nfunction buildTruncatedSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  reason: string,\n): TruncatedSummaryJsonPayload {\n  const preview = buildSummaryJsonPreview(items, options)\n\n  return {\n    json: '[]',\n    noticeJson: JSON.stringify({\n      truncated: true,\n      reason,\n      totalCount: items.length,\n      previewCount: preview.emittedCount,\n      previewOutput: SUMMARY_JSON_PREVIEW_OUTPUT_NAME,\n    }),\n    previewJson: preview.json,\n    totalCount: items.length,\n    previewCount: preview.emittedCount,\n    reason,\n    truncated: true,\n  }\n}\n\nfunction buildSummaryJsonPreview(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n): {\n  json: string\n  emittedCount: number\n} {\n  const preview = serializeJsonArrayPrefix(items, options, SUMMARY_JSON_PREVIEW_MAX_ENTRIES)\n  return { json: preview.json, emittedCount: preview.emittedCount }\n}\n\nexport function setSummaryJsonOutput(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): void {\n  const payload = buildSummaryJsonPayload(items, options)\n\n  core.setOutput(SUMMARY_JSON_TRUNCATED_OUTPUT_NAME, String(payload.truncated))\n  core.setOutput(SUMMARY_JSON_OUTPUT_NAME, payload.json)\n  if (!payload.truncated) {\n    return\n  }\n\n  core.setOutput(SUMMARY_JSON_NOTICE_OUTPUT_NAME, payload.noticeJson)\n  core.setOutput(SUMMARY_JSON_PREVIEW_OUTPUT_NAME, payload.previewJson)\n  core.warning(\n    `summary-json truncated: ${payload.reason}; preview contains ` +\n      `${payload.previewCount} of ${payload.totalCount} item(s). ` +\n      `summary-json is [] and summary-json-notice describes the truncation. ` +\n      `limit is ${formatKiB(SUMMARY_JSON_MAX_UTF8_BYTES)} of UTF-8 JSON text`,\n  )\n}\n\nfunction serializeJsonArrayPrefix(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  maxEntries: number,\n): BoundedJsonArray {\n  const parts: string[] = ['[']\n  let bytes = 2\n  let emittedCount = 0\n  const count = Math.min(items.length, maxEntries)\n\n  for (let index = 0; index < count; index++) {\n    let itemJson: string\n    try {\n      itemJson = stringifyArrayItem(projectItem(items[index] as T, options))\n    } catch {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: false,\n        serializationFailed: true,\n      }\n    }\n\n    const separator = emittedCount === 0 ? '' : ','\n    const additionalBytes = utf8ByteLength(separator) + utf8ByteLength(itemJson)\n    if (bytes + additionalBytes > SUMMARY_JSON_MAX_UTF8_BYTES) {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: true,\n        serializationFailed: false,\n      }\n    }\n\n    if (separator !== '') parts.push(separator)\n    parts.push(itemJson)\n    bytes += additionalBytes\n    emittedCount++\n  }\n\n  parts.push(']')\n  return {\n    json: parts.join(''),\n    emittedCount,\n    byteLimitExceeded: false,\n    serializationFailed: false,\n  }\n}\n\nfunction projectItem(item: T, options: SummaryJsonOutputOptions): unknown {\n  return options.item === undefined ? item : options.item(item)\n}\n\nfunction stringifyArrayItem(item: unknown): string {\n  const json = JSON.stringify(item, sensitiveSummaryJsonFieldReplacer)\n  return json === undefined ? 'null' : json\n}\n\nfunction sensitiveSummaryJsonFieldReplacer(key: string, value: unknown): unknown {\n  return key !== '' && isSensitiveSummaryJsonField(key) ? undefined : value\n}\n\nfunction isSensitiveSummaryJsonField(key: string): boolean {\n  const normalized = key.replaceAll('-', '').replaceAll('_', '').toLowerCase()\n  return (\n    normalized === 'url' ||\n    normalized.endsWith('url') ||\n    normalized.includes('authorization') ||\n    normalized.includes('signature') ||\n    normalized.includes('token')\n  )\n}\n\nfunction utf8ByteLength(value: string): number {\n  return Buffer.byteLength(value, 'utf8')\n}\n\nfunction formatKiB(bytes: number): string {\n  return `${Math.floor(bytes / 1024)} KiB`\n}\n","import { appendFile } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport { formatBytes } from './format.ts'\n\n/** Maximum per-file rows rendered in a GitHub Actions step summary table. */\nexport const STEP_SUMMARY_MAX_ROWS = 100\n\n/**\n * One row in the `$GITHUB_STEP_SUMMARY` table emitted by a verb. Only\n * `fileName` is required; the other cells render empty when omitted.\n */\nexport interface SummaryRow {\n  /** B2 file name or display label (e.g. `(uploaded)`, `(removed)`). */\n  fileName: string\n  /** Byte size of the file. Rendered via {@link formatBytes}. */\n  size?: number | undefined\n  /** B2 file ID (rendered as inline code). */\n  fileId?: string | undefined\n  /** Content SHA-1. Truncated to 12 chars in the table for readability. */\n  sha1?: string | null | undefined\n  /** Free-form status cell (e.g. `uploaded`, `would delete`, `deleted`). */\n  status?: string | undefined\n}\n\n/**\n * Append a markdown summary block to `$GITHUB_STEP_SUMMARY`. No-ops when\n * the env var is unset (e.g. running the bundle locally for a smoke test).\n *\n * @param opts.title - Heading rendered as `## {title}`.\n * @param opts.rows - One row per file. Empty rows render an empty table body.\n * @param opts.totals - Optional aggregate line printed above the table.\n * @param opts.totalRows - Optional source row count when callers pre-slice rows.\n */\nexport async function writeStepSummary(opts: {\n  title: string\n  rows: readonly SummaryRow[]\n  totals?: { files: number; bytes: number } | undefined\n  totalRows?: number | undefined\n}): Promise {\n  const path = process.env.GITHUB_STEP_SUMMARY\n  if (!path) return\n\n  // Keep the writer defensive for direct callers even though dispatcher\n  // call sites pre-slice rows to avoid mapping very large result sets.\n  const rows = opts.rows.slice(0, STEP_SUMMARY_MAX_ROWS)\n  const totalRows = opts.totalRows ?? opts.rows.length\n  const lines: string[] = []\n  lines.push(`## ${opts.title}`)\n  lines.push('')\n\n  if (opts.totals !== undefined) {\n    lines.push(`**${opts.totals.files}** files, **${formatBytes(opts.totals.bytes)}** total.`)\n    lines.push('')\n  }\n\n  if (totalRows > rows.length) {\n    lines.push(`Showing first ${rows.length} of ${totalRows} rows.`)\n    lines.push('')\n  }\n\n  if (rows.length > 0) {\n    lines.push('| File | Size | File ID | SHA-1 | Status |')\n    lines.push('|------|------|---------|-------|--------|')\n    for (const r of rows) {\n      lines.push(\n        `| ${inlineCodeCell(r.fileName)} | ${r.size !== undefined ? formatBytes(r.size) : ''} | ${\n          r.fileId !== undefined ? inlineCodeCell(r.fileId) : ''\n        } | ${r.sha1 != null ? `\\`${r.sha1.slice(0, 12)}…\\`` : ''} | ${\n          r.status !== undefined ? inlineCodeCell(r.status) : ''\n        } |`,\n      )\n    }\n  }\n\n  lines.push('')\n\n  try {\n    await appendFile(path, `${lines.join('\\n')}\\n`)\n  } catch (err) {\n    // $GITHUB_STEP_SUMMARY might point at an unwritable path (e.g. a\n    // directory, or a file the runner lacks permission to extend). The\n    // summary is informational; degrading to a warning is better than\n    // failing an otherwise-successful step.\n    core.warning(`Failed to write step summary: ${(err as Error).message}`)\n  }\n}\n\nfunction inlineCodeCell(value: string): string {\n  return `${escapeHtml(value).replaceAll('|', '|')}`\n}\n\nfunction escapeHtml(value: string): string {\n  // Single-pass escape so correctness never depends on replace ordering\n  // (a chained version must escape '&' first or it would re-escape '<').\n  const map = { '&': '&', '<': '<', '>': '>' } as const\n  return value.replace(/[&<>]/g, (ch) => map[ch as keyof typeof map])\n}\n","import { realpathSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport * as core from '@actions/core'\nimport { buildClient, getBucket } from './client.ts'\nimport { copyCommand } from './commands/copy.ts'\nimport { deleteCommand } from './commands/delete.ts'\nimport { downloadCommand } from './commands/download.ts'\nimport { headCommand } from './commands/head.ts'\nimport { hideCommand } from './commands/hide.ts'\nimport { listCommand } from './commands/list.ts'\nimport { type PresignedFile, presignCommand } from './commands/presign.ts'\nimport { purgeCommand } from './commands/purge.ts'\nimport { retentionCommand } from './commands/retention.ts'\nimport { summarizeSyncErrors, syncCommand } from './commands/sync.ts'\nimport { unhideCommand } from './commands/unhide.ts'\nimport { uploadCommand } from './commands/upload.ts'\nimport { verifyCommand } from './commands/verify.ts'\nimport { classifyActionError, formatActionDebugError } from './errors.ts'\nimport { collectInputSecretsForScrubbing, type ParsedInputs, parseInputs } from './inputs.ts'\nimport { setSummaryJsonOutput } from './outputs.ts'\nimport { STEP_SUMMARY_MAX_ROWS, type SummaryRow, writeStepSummary } from './summary.ts'\n\n/**\n * Action entrypoint. Parses inputs, builds an authorized B2Client, dispatches\n * to the requested subcommand, and writes structured outputs back via\n * `core.setOutput`. Any thrown error is reported through `core.setFailed`\n * so the workflow step surfaces with a clear message and a non-zero exit.\n *\n * Each command path also publishes a `$GITHUB_STEP_SUMMARY` markdown block so\n * the run's summary page shows a per-file table without scrolling through the\n * live log.\n */\nexport async function run(): Promise {\n  // Wire workflow-cancellation signals (`SIGTERM` when the user cancels the\n  // job or a sibling fails fast; `SIGINT` for Ctrl+C in local dev) to an\n  // AbortController that long-running SDK operations subscribe to. Aborting\n  // mid-upload lets the SDK cancel in-flight multipart sessions cleanly\n  // rather than leaving them dangling for the user to pay storage on.\n  const controller = new AbortController()\n  const onSignal = (sig: NodeJS.Signals) => {\n    core.warning(`Received ${sig}; cancelling in-flight B2 operations.`)\n    controller.abort(new Error(`${sig} received`))\n  }\n  const onSigterm = () => onSignal('SIGTERM')\n  const onSigint = () => onSignal('SIGINT')\n  process.once('SIGTERM', onSigterm)\n  process.once('SIGINT', onSigint)\n  const signal = controller.signal\n  let action: ParsedInputs['action'] | undefined\n  let dryRun: boolean | undefined\n  const secretValues: string[] = []\n\n  try {\n    // These values are a defensive formatter scrub list for parser and\n    // dispatcher-scope credentials and tokens. Command-level secrets such as\n    // presigned URLs are masked at the command site with core.setSecret. Any\n    // SDK free-form B2 messages that reach failure output are sanitized in\n    // errors.ts.\n    secretValues.push(...collectInputSecretsForScrubbing())\n    const inputs = parseInputs()\n    action = inputs.action\n    dryRun = inputs.dryRun\n\n    const authorized = await buildClient({\n      applicationKeyId: inputs.applicationKeyId,\n      applicationKey: inputs.applicationKey,\n      bucket: inputs.bucket,\n      ...(inputs.endpoint !== undefined ? { endpoint: inputs.endpoint } : {}),\n    })\n    const authToken = authorized.client.accountInfo.getAuthToken()\n    if (authToken) registerSecretValue(secretValues, authToken)\n    const bucket = await getBucket(authorized)\n\n    switch (inputs.action) {\n      case 'upload': {\n        const result = await uploadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-id', first.fileId)\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-uploaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`uploaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: upload',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: 'uploaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'download': {\n        const result = await downloadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-downloaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`downloaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: download',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            sha1: f.contentSha1,\n            status: 'downloaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'sync': {\n        const result = await syncCommand(bucket, inputs, signal)\n        core.setOutput('files-uploaded', String(result.uploaded))\n        core.setOutput('files-downloaded', String(result.downloaded))\n        core.setOutput('files-deleted', String(result.deleted))\n        setFileCountOutput(result.uploaded + result.downloaded + result.deleted + result.skipped)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        setSummaryJsonOutput(result.events)\n        if (result.errors > 0) {\n          const sample = summarizeSyncErrors(result.events)\n          throw new Error(`Sync completed with ${result.errors} error(s): ${sample}`)\n        }\n        const syncTitlePrefix = inputs.dryRun\n          ? 'Backblaze B2: sync (dry-run)'\n          : 'Backblaze B2: sync'\n        await writeStepSummary({\n          title: `${syncTitlePrefix} [${result.direction}]`,\n          totals: {\n            files: result.uploaded + result.downloaded + result.deleted,\n            bytes: result.bytesTransferred,\n          },\n          rows: [\n            {\n              fileName: '(uploaded)',\n              size: result.direction === 'local-to-b2' ? result.bytesTransferred : 0,\n              status: String(result.uploaded),\n            },\n            {\n              fileName: '(downloaded)',\n              size: result.direction === 'b2-to-local' ? result.bytesTransferred : 0,\n              status: String(result.downloaded),\n            },\n            { fileName: '(removed)', status: String(result.deleted) },\n            { fileName: '(unchanged)', status: String(result.skipped) },\n          ],\n        })\n        return\n      }\n      case 'copy': {\n        const result = await copyCommand(authorized.client, bucket, inputs, signal)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.destinationFileName)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', String(result.size))\n        await writeStepSummary({\n          title: 'Backblaze B2: copy',\n          rows: [\n            {\n              fileName: `b2://${result.sourceBucket}/${result.sourceFileName} → b2://${result.destinationBucket}/${result.destinationFileName}`,\n              size: result.size,\n              fileId: result.fileId,\n              status: 'copied (server-side)',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'delete': {\n        const result = await deleteCommand(bucket, inputs, signal)\n        await emitDeletionSummary('delete', result, inputs)\n        return\n      }\n      case 'presign': {\n        const result = await presignCommand(authorized.client, bucket, inputs)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('presigned-url', first.url)\n          core.setOutput('file-name', first.fileName)\n        }\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        await writeStepSummary({\n          title: `Backblaze B2: presign (${result.files.length})`,\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            status: `expires at ${new Date(f.expiresAt * 1000).toISOString()}`,\n          })),\n        })\n        setSummaryJsonOutput(result.files, { item: presignSummaryItem })\n        return\n      }\n      case 'list': {\n        const result = await listCommand(bucket, inputs)\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        if (result.truncated) {\n          core.warning(\n            `list result truncated at max-results=${inputs.maxResults}; raise it to see more`,\n          )\n        }\n        await writeStepSummary({\n          title: `Backblaze B2: list (${result.files.length}${result.truncated ? '+' : ''})`,\n          totals: {\n            files: result.files.length,\n            bytes: result.files.reduce((s, f) => s + f.size, 0),\n          },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: f.contentType,\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'hide': {\n        const result = await hideCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: hide',\n          rows: [{ fileName: result.fileName, fileId: result.fileId, status: 'hidden' }],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'unhide': {\n        const result = await unhideCommand(bucket, inputs)\n        core.setOutput('file-name', result.fileName)\n        if (result.removedMarkerFileId !== null) {\n          core.setOutput('file-id', result.removedMarkerFileId)\n        }\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: unhide',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.removedMarkerFileId ?? undefined,\n              status: result.removedMarkerFileId === null ? 'no-op (not hidden)' : 'unhidden',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'verify': {\n        const result = await verifyCommand(bucket, inputs)\n        core.setOutput('verified', String(result.verified))\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        if (result.remoteSha1 !== null) core.setOutput('remote-sha1', result.remoteSha1)\n        if (result.localSha1 !== null) core.setOutput('local-sha1', result.localSha1)\n        await writeStepSummary({\n          title: result.verified ? 'Backblaze B2: verify ✓' : 'Backblaze B2: verify ✗',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.remoteSize,\n              sha1: result.remoteSha1,\n              status: result.verified ? 'matches' : (result.reason ?? 'mismatch'),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        if (!result.verified) {\n          throw new Error(result.reason ?? 'verify failed: SHA-1 mismatch')\n        }\n        return\n      }\n      case 'retention': {\n        const result = await retentionCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: retention',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.fileId,\n              status: retentionStatusLine(result),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'head': {\n        const result = await headCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        if (result.contentSha1 !== null) core.setOutput('content-sha1', result.contentSha1)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', '0')\n        await writeStepSummary({\n          title: 'Backblaze B2: head',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.size,\n              fileId: result.fileId,\n              sha1: result.contentSha1,\n              status: result.contentType,\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'purge': {\n        const result = await purgeCommand(bucket, inputs, signal)\n        await emitDeletionSummary('purge', result, inputs)\n        return\n      }\n    }\n  } catch (err) {\n    const failure = classifyActionError(err, {\n      ...(action !== undefined ? { action } : {}),\n      ...(dryRun !== undefined ? { dryRun } : {}),\n      secretValues,\n    })\n    core.debug(formatActionDebugError(err, { secretValues }))\n    if (failure.retryable !== undefined) core.setOutput('retryable', String(failure.retryable))\n    if (failure.retryAfter !== undefined) core.setOutput('retry-after', String(failure.retryAfter))\n    core.setFailed(failure.message)\n  } finally {\n    process.off('SIGTERM', onSigterm)\n    process.off('SIGINT', onSigint)\n  }\n}\n\n/**\n * Checks whether this module is the process entrypoint.\n *\n * @param metaUrl - The current module URL from `import.meta.url`.\n * @param argv1 - The executable script path from `process.argv[1]`.\n * @returns `true` when the current module path matches the invoked script.\n */\nexport function isEntrypoint(metaUrl: string, argv1: string | undefined): boolean {\n  if (argv1 === undefined) return false\n  try {\n    return realpathSync(fileURLToPath(metaUrl)) === realpathSync(resolve(argv1))\n  } catch {\n    return false\n  }\n}\n\n/**\n * Shared output-emission + step-summary for the two deletion verbs.\n * `delete` and `purge` returned-shape and dispatcher-side handling are\n * structurally identical (filter into actually-deleted vs would-delete,\n * set the same outputs, render the same capped row table); they differ only\n * in the verb label and the per-row status string.\n */\nasync function emitDeletionSummary(\n  verb: 'delete' | 'purge',\n  result: {\n    files: { fileName: string; fileId: string; skipped: boolean }[]\n    errors: number\n  },\n  inputs: ParsedInputs,\n): Promise {\n  const actuallyDeleted = result.files.filter((f) => !f.skipped).length\n  const wouldDelete = result.files.filter((f) => f.skipped).length\n  core.setOutput('files-deleted', String(actuallyDeleted))\n  setFileCountOutput(result.files.length)\n  setSummaryJsonOutput(result.files)\n  if (result.errors > 0) {\n    const labels = { delete: 'Delete', purge: 'Purge' } as const\n    throw new Error(`${labels[verb]} completed with ${result.errors} error(s)`)\n  }\n  const past = verb === 'delete' ? 'deleted' : 'purged'\n  const future = verb === 'delete' ? 'would delete' : 'would purge'\n  await writeStepSummary({\n    title: inputs.dryRun ? `Backblaze B2: ${verb} (dry-run)` : `Backblaze B2: ${verb}`,\n    totals: { files: actuallyDeleted + wouldDelete, bytes: 0 },\n    ...stepSummaryRows(result.files, (f) => ({\n      fileName: f.fileName,\n      fileId: f.fileId,\n      status: f.skipped ? future : past,\n    })),\n  })\n}\n\nfunction stepSummaryRows(\n  items: readonly T[],\n  row: (item: T) => SummaryRow,\n): { rows: SummaryRow[]; totalRows?: number } {\n  // Pre-slice here to avoid mapping very large result sets; writeStepSummary\n  // keeps its own defensive cap for direct callers.\n  const rows = items.slice(0, STEP_SUMMARY_MAX_ROWS).map(row)\n  return rows.length < items.length ? { rows, totalRows: items.length } : { rows }\n}\n\nfunction presignSummaryItem(file: PresignedFile): Pick {\n  return { fileName: file.fileName, expiresAt: file.expiresAt }\n}\n\nfunction setFileCountOutput(count: number): void {\n  core.setOutput('file-count', String(count))\n}\n\nfunction registerSecretValue(secretValues: string[], value: string): void {\n  const trimmed = value.trim()\n  for (const secret of [value, trimmed]) {\n    if (secret === '' || secretValues.includes(secret)) continue\n    core.setSecret(secret)\n    secretValues.push(secret)\n  }\n}\n\nfunction retentionStatusLine(result: {\n  appliedMode: 'compliance' | 'governance' | 'none' | undefined\n  retainUntilTimestamp: number | null | undefined\n  appliedLegalHold: 'on' | 'off' | undefined\n}): string {\n  const parts: string[] = [`mode=${result.appliedMode ?? '-'}`]\n  if (result.retainUntilTimestamp != null) {\n    parts.push(`until=${new Date(result.retainUntilTimestamp).toISOString()}`)\n  }\n  if (result.appliedLegalHold !== undefined) {\n    parts.push(`legal-hold=${result.appliedLegalHold}`)\n  }\n  return parts.join(' ')\n}\n\nif (isEntrypoint(import.meta.url, process.argv[1])) {\n  void run()\n}\n"],"names":[],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"index.js","mappings":";;;;;;AAAA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9sBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC98CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrRA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC11BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/dA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/tEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5gCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/lDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACllBA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACNA;AACA;;;;;;;;;;;;ACDA;;;;;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AChCA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9QA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACTA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACrDA;AACA;AACA;AACA;AAMA;AACA;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzEA;AACA;AAIA;AACA;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC7NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9CA;AACA;AACA;AAGA;AACA;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACnNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACpxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmBA;AACA;;;AC3QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AChGA;AACA;AACA;AACA;AAIA;AACA;;;ACRA;AACA;AAGA;AACA;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;;;AChUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;;;ACxlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;;;ACrOA;AAEA;;;;;;;;;;;AAWA;AACA;;;ACdA;AAEA;AAMA;AA6BA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AAKA;AACA;AACA;AACA;AAAA;AAEA;AACA;;;;;;;AC3IA;AACA;AAEA;AAEA;AAEA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;;;AC3DA;AAEA;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AAqFA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;AAYA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAKA;AAKA;AAKA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;AAUA;AACA;AACA;AAAA;AACA;AACA;AAEA;;;AAGA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAEA;;;;AAIA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1bA;AAEA;AACA;AAkBA;;;;;;;;;;;AAWA;AACA;AAMA;AACA;AACA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACnFA;AACA;AAmBA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC3FA;AAEA;AACA;AACA;AAoBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAEA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;;;;;ACpHA;;ACQA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1CA;AAEA;;;;;AAKA;AACA;AACA;AACA;;;ACXA;;;;;AAKA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;;;ACXA;AAEA;AAEA;;;;;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAGA;AACA;AAIA;AACA;AACA;AACA;AACA;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAgDA;;;;;;;;;;AAUA;AACA;AAKA;AACA;AAEA;AACA;AAEA;AACA;AAQA;AACA;AAQA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AAOA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AASA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;;;;AAIA;AACA;AASA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAKA;AAKA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAGA;AACA;;;ACvkBA;AAEA;AAoBA;;;;;;;;AAQA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtDA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;AClCA;AA8BA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACtBA;AAEA;AACA;AAKA;AAkBA;;;;;;;;;;;;;;AAcA;AACA;AAKA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAUA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;;;ACpJA;AAGA;AAsBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AChGA;AAEA;AACA;AAgBA;;;;;;;;;;;;;;;;;AAiBA;AACA;AAIA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACxDA;AACA;AACA;AASA;AACA;AACA;AAwBA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAGA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;;;;;;;;;;AAUA;AACA;AAKA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1PA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACx0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzlCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpOA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAwBA;;;;;;;;;;;;;;;AAeA;AACA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AASA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAkBA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AAKA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAEA;AASA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpRA;AACA;AACA;AAEA;AACA;AAsBA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC/IA;AAQA;AAEA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;;;AClPA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AA+BA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AAEA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AAEA;AAIA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC9NA;AACA;AACA;AAEA;AACA;AAmBA;;;;;;;;AAQA;AACA;AAMA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA","sources":[".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js",".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/abort-signal.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-pipeline.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-upgrade.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/readable.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/diagnostics.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/tree.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/balanced-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h1.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h2.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/fixed-queue.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-stats.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/retry-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/decorator-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/redirect-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/retry-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dns.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dump.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/retry.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pluralizer.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/util/timers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cache.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cachestorage.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/parse.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/body.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/data-url.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/dispatcher-weakref.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/file.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata-parser.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/headers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/response.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/webidl.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/encoding.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/filereader.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/progressevent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/connection.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/events.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/frame.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/permessage-deflate.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/receiver.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/sender.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/websocket.js","../external node-commonjs \"assert\"","../external node-commonjs \"events\"","../external node-commonjs \"http\"","../external node-commonjs \"https\"","../external node-commonjs \"net\"","../external node-commonjs \"node:assert\"","../external node-commonjs \"node:async_hooks\"","../external node-commonjs \"node:buffer\"","../external node-commonjs \"node:console\"","../external node-commonjs \"node:crypto\"","../external node-commonjs \"node:diagnostics_channel\"","../external node-commonjs \"node:dns\"","../external node-commonjs \"node:events\"","../external node-commonjs \"node:fs/promises\"","../external node-commonjs \"node:http\"","../external node-commonjs \"node:http2\"","../external node-commonjs \"node:net\"","../external node-commonjs \"node:path\"","../external node-commonjs \"node:perf_hooks\"","../external node-commonjs \"node:querystring\"","../external node-commonjs \"node:stream\"","../external node-commonjs \"node:tls\"","../external node-commonjs \"node:url\"","../external node-commonjs \"node:util\"","../external node-commonjs \"node:util/types\"","../external node-commonjs \"node:worker_threads\"","../external node-commonjs \"node:zlib\"","../external node-commonjs \"string_decoder\"","../external node-commonjs \"tls\"","../external node-commonjs \"util\"","../webpack/bootstrap","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/compat","../external node-commonjs \"node:fs\"","../external node-commonjs \"os\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/command.js","../external node-commonjs \"crypto\"","../external node-commonjs \"fs\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/file-command.js","../external node-commonjs \"path\"",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/proxy.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/index.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/auth.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/oidc-utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/summary.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/path-utils.js","../external node-commonjs \"child_process\"",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io-util.js",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io.js","../external node-commonjs \"timers\"",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/toolrunner.js",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/exec.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/platform.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/core.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/upload-url-pool.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/in-memory.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/realms.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/ids.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/best-effort.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/cancel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/concurrency.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/defaults.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/plan-ranges.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/copy/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/text-codec.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/encoding.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/progress.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/normalize.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/retry.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/collect.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/parallel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/hash.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/resume.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/to-error.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/stream.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/object.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/paginator.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/bucket.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/errors/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/url-guard.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/package.json.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/version.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/user-agent.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/transport.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/encryption.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/client.js",".././src/version.ts",".././src/client.ts",".././src/sse.ts",".././src/inputs.ts",".././src/commands/copy.ts",".././src/commands/delete-all.ts",".././src/commands/delete.ts","../external node-commonjs \"node:stream/promises\"",".././src/download-overrides.ts",".././src/fs.ts",".././src/format.ts",".././src/progress.ts",".././src/commands/download.ts",".././src/commands/head.ts",".././src/commands/hide.ts",".././src/commands/list.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/s3/index.js",".././src/commands/presign.ts",".././src/commands/purge.ts",".././src/commands/retention.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/source.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/actions/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/pairing.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/compare.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/synchronizer.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/local.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/file.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/b2.js",".././src/commands/sync.ts",".././src/commands/unhide.ts",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-glob-options-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-match-kind.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern-helper.js",".././node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js",".././node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/esm/index.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/brace-expressions.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/unescape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/ast.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/escape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-search-state.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-globber.js","../external node-commonjs \"stream\"",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-hash-files.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/glob.js",".././src/commands/upload.ts",".././src/commands/verify.ts",".././src/errors.ts",".././src/outputs.ts",".././src/summary.ts",".././src/main.ts"],"sourcesContent":["module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = http.request;\n  return agent;\n}\n\nfunction httpsOverHttp(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = http.request;\n  agent.createSocket = createSecureSocket;\n  agent.defaultPort = 443;\n  return agent;\n}\n\nfunction httpOverHttps(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = https.request;\n  return agent;\n}\n\nfunction httpsOverHttps(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = https.request;\n  agent.createSocket = createSecureSocket;\n  agent.defaultPort = 443;\n  return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n  var self = this;\n  self.options = options || {};\n  self.proxyOptions = self.options.proxy || {};\n  self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n  self.requests = [];\n  self.sockets = [];\n\n  self.on('free', function onFree(socket, host, port, localAddress) {\n    var options = toOptions(host, port, localAddress);\n    for (var i = 0, len = self.requests.length; i < len; ++i) {\n      var pending = self.requests[i];\n      if (pending.host === options.host && pending.port === options.port) {\n        // Detect the request to connect same origin server,\n        // reuse the connection.\n        self.requests.splice(i, 1);\n        pending.request.onSocket(socket);\n        return;\n      }\n    }\n    socket.destroy();\n    self.removeSocket(socket);\n  });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n  var self = this;\n  var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n  if (self.sockets.length >= this.maxSockets) {\n    // We are over limit so we'll add it to the queue.\n    self.requests.push(options);\n    return;\n  }\n\n  // If we are under maxSockets create a new one.\n  self.createSocket(options, function(socket) {\n    socket.on('free', onFree);\n    socket.on('close', onCloseOrRemove);\n    socket.on('agentRemove', onCloseOrRemove);\n    req.onSocket(socket);\n\n    function onFree() {\n      self.emit('free', socket, options);\n    }\n\n    function onCloseOrRemove(err) {\n      self.removeSocket(socket);\n      socket.removeListener('free', onFree);\n      socket.removeListener('close', onCloseOrRemove);\n      socket.removeListener('agentRemove', onCloseOrRemove);\n    }\n  });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n  var self = this;\n  var placeholder = {};\n  self.sockets.push(placeholder);\n\n  var connectOptions = mergeOptions({}, self.proxyOptions, {\n    method: 'CONNECT',\n    path: options.host + ':' + options.port,\n    agent: false,\n    headers: {\n      host: options.host + ':' + options.port\n    }\n  });\n  if (options.localAddress) {\n    connectOptions.localAddress = options.localAddress;\n  }\n  if (connectOptions.proxyAuth) {\n    connectOptions.headers = connectOptions.headers || {};\n    connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n        new Buffer(connectOptions.proxyAuth).toString('base64');\n  }\n\n  debug('making CONNECT request');\n  var connectReq = self.request(connectOptions);\n  connectReq.useChunkedEncodingByDefault = false; // for v0.6\n  connectReq.once('response', onResponse); // for v0.6\n  connectReq.once('upgrade', onUpgrade);   // for v0.6\n  connectReq.once('connect', onConnect);   // for v0.7 or later\n  connectReq.once('error', onError);\n  connectReq.end();\n\n  function onResponse(res) {\n    // Very hacky. This is necessary to avoid http-parser leaks.\n    res.upgrade = true;\n  }\n\n  function onUpgrade(res, socket, head) {\n    // Hacky.\n    process.nextTick(function() {\n      onConnect(res, socket, head);\n    });\n  }\n\n  function onConnect(res, socket, head) {\n    connectReq.removeAllListeners();\n    socket.removeAllListeners();\n\n    if (res.statusCode !== 200) {\n      debug('tunneling socket could not be established, statusCode=%d',\n        res.statusCode);\n      socket.destroy();\n      var error = new Error('tunneling socket could not be established, ' +\n        'statusCode=' + res.statusCode);\n      error.code = 'ECONNRESET';\n      options.request.emit('error', error);\n      self.removeSocket(placeholder);\n      return;\n    }\n    if (head.length > 0) {\n      debug('got illegal response body from proxy');\n      socket.destroy();\n      var error = new Error('got illegal response body from proxy');\n      error.code = 'ECONNRESET';\n      options.request.emit('error', error);\n      self.removeSocket(placeholder);\n      return;\n    }\n    debug('tunneling connection has established');\n    self.sockets[self.sockets.indexOf(placeholder)] = socket;\n    return cb(socket);\n  }\n\n  function onError(cause) {\n    connectReq.removeAllListeners();\n\n    debug('tunneling socket could not be established, cause=%s\\n',\n          cause.message, cause.stack);\n    var error = new Error('tunneling socket could not be established, ' +\n                          'cause=' + cause.message);\n    error.code = 'ECONNRESET';\n    options.request.emit('error', error);\n    self.removeSocket(placeholder);\n  }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n  var pos = this.sockets.indexOf(socket)\n  if (pos === -1) {\n    return;\n  }\n  this.sockets.splice(pos, 1);\n\n  var pending = this.requests.shift();\n  if (pending) {\n    // If we have pending requests and a socket gets closed a new one\n    // needs to be created to take over in the pool for the one that closed.\n    this.createSocket(pending, function(socket) {\n      pending.request.onSocket(socket);\n    });\n  }\n};\n\nfunction createSecureSocket(options, cb) {\n  var self = this;\n  TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n    var hostHeader = options.request.getHeader('host');\n    var tlsOptions = mergeOptions({}, self.options, {\n      socket: socket,\n      servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n    });\n\n    // 0 is dummy port for v0.6\n    var secureSocket = tls.connect(0, tlsOptions);\n    self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n    cb(secureSocket);\n  });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n  if (typeof host === 'string') { // since v0.10\n    return {\n      host: host,\n      port: port,\n      localAddress: localAddress\n    };\n  }\n  return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n  for (var i = 1, len = arguments.length; i < len; ++i) {\n    var overrides = arguments[i];\n    if (typeof overrides === 'object') {\n      var keys = Object.keys(overrides);\n      for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n        var k = keys[j];\n        if (overrides[k] !== undefined) {\n          target[k] = overrides[k];\n        }\n      }\n    }\n  }\n  return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n  debug = function() {\n    var args = Array.prototype.slice.call(arguments);\n    if (typeof args[0] === 'string') {\n      args[0] = 'TUNNEL: ' + args[0];\n    } else {\n      args.unshift('TUNNEL:');\n    }\n    console.error.apply(console, args);\n  }\n} else {\n  debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict'\n\nconst Client = require('./lib/dispatcher/client')\nconst Dispatcher = require('./lib/dispatcher/dispatcher')\nconst Pool = require('./lib/dispatcher/pool')\nconst BalancedPool = require('./lib/dispatcher/balanced-pool')\nconst Agent = require('./lib/dispatcher/agent')\nconst ProxyAgent = require('./lib/dispatcher/proxy-agent')\nconst EnvHttpProxyAgent = require('./lib/dispatcher/env-http-proxy-agent')\nconst RetryAgent = require('./lib/dispatcher/retry-agent')\nconst errors = require('./lib/core/errors')\nconst util = require('./lib/core/util')\nconst { InvalidArgumentError } = errors\nconst api = require('./lib/api')\nconst buildConnector = require('./lib/core/connect')\nconst MockClient = require('./lib/mock/mock-client')\nconst MockAgent = require('./lib/mock/mock-agent')\nconst MockPool = require('./lib/mock/mock-pool')\nconst mockErrors = require('./lib/mock/mock-errors')\nconst RetryHandler = require('./lib/handler/retry-handler')\nconst { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global')\nconst DecoratorHandler = require('./lib/handler/decorator-handler')\nconst RedirectHandler = require('./lib/handler/redirect-handler')\nconst createRedirectInterceptor = require('./lib/interceptor/redirect-interceptor')\n\nObject.assign(Dispatcher.prototype, api)\n\nmodule.exports.Dispatcher = Dispatcher\nmodule.exports.Client = Client\nmodule.exports.Pool = Pool\nmodule.exports.BalancedPool = BalancedPool\nmodule.exports.Agent = Agent\nmodule.exports.ProxyAgent = ProxyAgent\nmodule.exports.EnvHttpProxyAgent = EnvHttpProxyAgent\nmodule.exports.RetryAgent = RetryAgent\nmodule.exports.RetryHandler = RetryHandler\n\nmodule.exports.DecoratorHandler = DecoratorHandler\nmodule.exports.RedirectHandler = RedirectHandler\nmodule.exports.createRedirectInterceptor = createRedirectInterceptor\nmodule.exports.interceptors = {\n  redirect: require('./lib/interceptor/redirect'),\n  retry: require('./lib/interceptor/retry'),\n  dump: require('./lib/interceptor/dump'),\n  dns: require('./lib/interceptor/dns')\n}\n\nmodule.exports.buildConnector = buildConnector\nmodule.exports.errors = errors\nmodule.exports.util = {\n  parseHeaders: util.parseHeaders,\n  headerNameToString: util.headerNameToString\n}\n\nfunction makeDispatcher (fn) {\n  return (url, opts, handler) => {\n    if (typeof opts === 'function') {\n      handler = opts\n      opts = null\n    }\n\n    if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {\n      throw new InvalidArgumentError('invalid url')\n    }\n\n    if (opts != null && typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (opts && opts.path != null) {\n      if (typeof opts.path !== 'string') {\n        throw new InvalidArgumentError('invalid opts.path')\n      }\n\n      let path = opts.path\n      if (!opts.path.startsWith('/')) {\n        path = `/${path}`\n      }\n\n      url = new URL(util.parseOrigin(url).origin + path)\n    } else {\n      if (!opts) {\n        opts = typeof url === 'object' ? url : {}\n      }\n\n      url = util.parseURL(url)\n    }\n\n    const { agent, dispatcher = getGlobalDispatcher() } = opts\n\n    if (agent) {\n      throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')\n    }\n\n    return fn.call(dispatcher, {\n      ...opts,\n      origin: url.origin,\n      path: url.search ? `${url.pathname}${url.search}` : url.pathname,\n      method: opts.method || (opts.body ? 'PUT' : 'GET')\n    }, handler)\n  }\n}\n\nmodule.exports.setGlobalDispatcher = setGlobalDispatcher\nmodule.exports.getGlobalDispatcher = getGlobalDispatcher\n\nconst fetchImpl = require('./lib/web/fetch').fetch\nmodule.exports.fetch = async function fetch (init, options = undefined) {\n  try {\n    return await fetchImpl(init, options)\n  } catch (err) {\n    if (err && typeof err === 'object') {\n      Error.captureStackTrace(err)\n    }\n\n    throw err\n  }\n}\nmodule.exports.Headers = require('./lib/web/fetch/headers').Headers\nmodule.exports.Response = require('./lib/web/fetch/response').Response\nmodule.exports.Request = require('./lib/web/fetch/request').Request\nmodule.exports.FormData = require('./lib/web/fetch/formdata').FormData\nmodule.exports.File = globalThis.File ?? require('node:buffer').File\nmodule.exports.FileReader = require('./lib/web/fileapi/filereader').FileReader\n\nconst { setGlobalOrigin, getGlobalOrigin } = require('./lib/web/fetch/global')\n\nmodule.exports.setGlobalOrigin = setGlobalOrigin\nmodule.exports.getGlobalOrigin = getGlobalOrigin\n\nconst { CacheStorage } = require('./lib/web/cache/cachestorage')\nconst { kConstruct } = require('./lib/web/cache/symbols')\n\n// Cache & CacheStorage are tightly coupled with fetch. Even if it may run\n// in an older version of Node, it doesn't have any use without fetch.\nmodule.exports.caches = new CacheStorage(kConstruct)\n\nconst { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/web/cookies')\n\nmodule.exports.deleteCookie = deleteCookie\nmodule.exports.getCookies = getCookies\nmodule.exports.getSetCookies = getSetCookies\nmodule.exports.setCookie = setCookie\n\nconst { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/data-url')\n\nmodule.exports.parseMIMEType = parseMIMEType\nmodule.exports.serializeAMimeType = serializeAMimeType\n\nconst { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/web/websocket/events')\nmodule.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket\nmodule.exports.CloseEvent = CloseEvent\nmodule.exports.ErrorEvent = ErrorEvent\nmodule.exports.MessageEvent = MessageEvent\n\nmodule.exports.request = makeDispatcher(api.request)\nmodule.exports.stream = makeDispatcher(api.stream)\nmodule.exports.pipeline = makeDispatcher(api.pipeline)\nmodule.exports.connect = makeDispatcher(api.connect)\nmodule.exports.upgrade = makeDispatcher(api.upgrade)\n\nmodule.exports.MockClient = MockClient\nmodule.exports.MockPool = MockPool\nmodule.exports.MockAgent = MockAgent\nmodule.exports.mockErrors = mockErrors\n\nconst { EventSource } = require('./lib/web/eventsource/eventsource')\n\nmodule.exports.EventSource = EventSource\n","const { addAbortListener } = require('../core/util')\nconst { RequestAbortedError } = require('../core/errors')\n\nconst kListener = Symbol('kListener')\nconst kSignal = Symbol('kSignal')\n\nfunction abort (self) {\n  if (self.abort) {\n    self.abort(self[kSignal]?.reason)\n  } else {\n    self.reason = self[kSignal]?.reason ?? new RequestAbortedError()\n  }\n  removeSignal(self)\n}\n\nfunction addSignal (self, signal) {\n  self.reason = null\n\n  self[kSignal] = null\n  self[kListener] = null\n\n  if (!signal) {\n    return\n  }\n\n  if (signal.aborted) {\n    abort(self)\n    return\n  }\n\n  self[kSignal] = signal\n  self[kListener] = () => {\n    abort(self)\n  }\n\n  addAbortListener(self[kSignal], self[kListener])\n}\n\nfunction removeSignal (self) {\n  if (!self[kSignal]) {\n    return\n  }\n\n  if ('removeEventListener' in self[kSignal]) {\n    self[kSignal].removeEventListener('abort', self[kListener])\n  } else {\n    self[kSignal].removeListener('abort', self[kListener])\n  }\n\n  self[kSignal] = null\n  self[kListener] = null\n}\n\nmodule.exports = {\n  addSignal,\n  removeSignal\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { AsyncResource } = require('node:async_hooks')\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass ConnectHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    const { signal, opaque, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    super('UNDICI_CONNECT')\n\n    this.opaque = opaque || null\n    this.responseHeaders = responseHeaders || null\n    this.callback = callback\n    this.abort = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders () {\n    throw new SocketError('bad connect', null)\n  }\n\n  onUpgrade (statusCode, rawHeaders, socket) {\n    const { callback, opaque, context } = this\n\n    removeSignal(this)\n\n    this.callback = null\n\n    let headers = rawHeaders\n    // Indicates is an HTTP2Session\n    if (headers != null) {\n      headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n    }\n\n    this.runInAsyncScope(callback, null, null, {\n      statusCode,\n      headers,\n      socket,\n      opaque,\n      context\n    })\n  }\n\n  onError (err) {\n    const { callback, opaque } = this\n\n    removeSignal(this)\n\n    if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n  }\n}\n\nfunction connect (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      connect.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    const connectHandler = new ConnectHandler(opts, callback)\n    this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = connect\n","'use strict'\n\nconst {\n  Readable,\n  Duplex,\n  PassThrough\n} = require('node:stream')\nconst {\n  InvalidArgumentError,\n  InvalidReturnValueError,\n  RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nconst kResume = Symbol('resume')\n\nclass PipelineRequest extends Readable {\n  constructor () {\n    super({ autoDestroy: true })\n\n    this[kResume] = null\n  }\n\n  _read () {\n    const { [kResume]: resume } = this\n\n    if (resume) {\n      this[kResume] = null\n      resume()\n    }\n  }\n\n  _destroy (err, callback) {\n    this._read()\n\n    callback(err)\n  }\n}\n\nclass PipelineResponse extends Readable {\n  constructor (resume) {\n    super({ autoDestroy: true })\n    this[kResume] = resume\n  }\n\n  _read () {\n    this[kResume]()\n  }\n\n  _destroy (err, callback) {\n    if (!err && !this._readableState.endEmitted) {\n      err = new RequestAbortedError()\n    }\n\n    callback(err)\n  }\n}\n\nclass PipelineHandler extends AsyncResource {\n  constructor (opts, handler) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof handler !== 'function') {\n      throw new InvalidArgumentError('invalid handler')\n    }\n\n    const { signal, method, opaque, onInfo, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    if (method === 'CONNECT') {\n      throw new InvalidArgumentError('invalid method')\n    }\n\n    if (onInfo && typeof onInfo !== 'function') {\n      throw new InvalidArgumentError('invalid onInfo callback')\n    }\n\n    super('UNDICI_PIPELINE')\n\n    this.opaque = opaque || null\n    this.responseHeaders = responseHeaders || null\n    this.handler = handler\n    this.abort = null\n    this.context = null\n    this.onInfo = onInfo || null\n\n    this.req = new PipelineRequest().on('error', util.nop)\n\n    this.ret = new Duplex({\n      readableObjectMode: opts.objectMode,\n      autoDestroy: true,\n      read: () => {\n        const { body } = this\n\n        if (body?.resume) {\n          body.resume()\n        }\n      },\n      write: (chunk, encoding, callback) => {\n        const { req } = this\n\n        if (req.push(chunk, encoding) || req._readableState.destroyed) {\n          callback()\n        } else {\n          req[kResume] = callback\n        }\n      },\n      destroy: (err, callback) => {\n        const { body, req, res, ret, abort } = this\n\n        if (!err && !ret._readableState.endEmitted) {\n          err = new RequestAbortedError()\n        }\n\n        if (abort && err) {\n          abort()\n        }\n\n        util.destroy(body, err)\n        util.destroy(req, err)\n        util.destroy(res, err)\n\n        removeSignal(this)\n\n        callback(err)\n      }\n    }).on('prefinish', () => {\n      const { req } = this\n\n      // Node < 15 does not call _final in same tick.\n      req.push(null)\n    })\n\n    this.res = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    const { ret, res } = this\n\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(!res, 'pipeline cannot be retried')\n    assert(!ret.destroyed)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume) {\n    const { opaque, handler, context } = this\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    this.res = new PipelineResponse(resume)\n\n    let body\n    try {\n      this.handler = null\n      const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n      body = this.runInAsyncScope(handler, null, {\n        statusCode,\n        headers,\n        opaque,\n        body: this.res,\n        context\n      })\n    } catch (err) {\n      this.res.on('error', util.nop)\n      throw err\n    }\n\n    if (!body || typeof body.on !== 'function') {\n      throw new InvalidReturnValueError('expected Readable')\n    }\n\n    body\n      .on('data', (chunk) => {\n        const { ret, body } = this\n\n        if (!ret.push(chunk) && body.pause) {\n          body.pause()\n        }\n      })\n      .on('error', (err) => {\n        const { ret } = this\n\n        util.destroy(ret, err)\n      })\n      .on('end', () => {\n        const { ret } = this\n\n        ret.push(null)\n      })\n      .on('close', () => {\n        const { ret } = this\n\n        if (!ret._readableState.ended) {\n          util.destroy(ret, new RequestAbortedError())\n        }\n      })\n\n    this.body = body\n  }\n\n  onData (chunk) {\n    const { res } = this\n    return res.push(chunk)\n  }\n\n  onComplete (trailers) {\n    const { res } = this\n    res.push(null)\n  }\n\n  onError (err) {\n    const { ret } = this\n    this.handler = null\n    util.destroy(ret, err)\n  }\n}\n\nfunction pipeline (opts, handler) {\n  try {\n    const pipelineHandler = new PipelineHandler(opts, handler)\n    this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)\n    return pipelineHandler.ret\n  } catch (err) {\n    return new PassThrough().destroy(err)\n  }\n}\n\nmodule.exports = pipeline\n","'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('./readable')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\n\nclass RequestHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts\n\n    try {\n      if (typeof callback !== 'function') {\n        throw new InvalidArgumentError('invalid callback')\n      }\n\n      if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {\n        throw new InvalidArgumentError('invalid highWaterMark')\n      }\n\n      if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n        throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n      }\n\n      if (method === 'CONNECT') {\n        throw new InvalidArgumentError('invalid method')\n      }\n\n      if (onInfo && typeof onInfo !== 'function') {\n        throw new InvalidArgumentError('invalid onInfo callback')\n      }\n\n      super('UNDICI_REQUEST')\n    } catch (err) {\n      if (util.isStream(body)) {\n        util.destroy(body.on('error', util.nop), err)\n      }\n      throw err\n    }\n\n    this.method = method\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.callback = callback\n    this.res = null\n    this.abort = null\n    this.body = body\n    this.trailers = {}\n    this.context = null\n    this.onInfo = onInfo || null\n    this.throwOnError = throwOnError\n    this.highWaterMark = highWaterMark\n    this.signal = signal\n    this.reason = null\n    this.removeAbortListener = null\n\n    if (util.isStream(body)) {\n      body.on('error', (err) => {\n        this.onError(err)\n      })\n    }\n\n    if (this.signal) {\n      if (this.signal.aborted) {\n        this.reason = this.signal.reason ?? new RequestAbortedError()\n      } else {\n        this.removeAbortListener = util.addAbortListener(this.signal, () => {\n          this.reason = this.signal.reason ?? new RequestAbortedError()\n          if (this.res) {\n            util.destroy(this.res.on('error', util.nop), this.reason)\n          } else if (this.abort) {\n            this.abort(this.reason)\n          }\n\n          if (this.removeAbortListener) {\n            this.res?.off('close', this.removeAbortListener)\n            this.removeAbortListener()\n            this.removeAbortListener = null\n          }\n        })\n      }\n    }\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this\n\n    const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n    const contentType = parsedHeaders['content-type']\n    const contentLength = parsedHeaders['content-length']\n    const res = new Readable({\n      resume,\n      abort,\n      contentType,\n      contentLength: this.method !== 'HEAD' && contentLength\n        ? Number(contentLength)\n        : null,\n      highWaterMark\n    })\n\n    if (this.removeAbortListener) {\n      res.on('close', this.removeAbortListener)\n    }\n\n    this.callback = null\n    this.res = res\n    if (callback !== null) {\n      if (this.throwOnError && statusCode >= 400) {\n        this.runInAsyncScope(getResolveErrorBodyCallback, null,\n          { callback, body: res, contentType, statusCode, statusMessage, headers }\n        )\n      } else {\n        this.runInAsyncScope(callback, null, null, {\n          statusCode,\n          headers,\n          trailers: this.trailers,\n          opaque,\n          body: res,\n          context\n        })\n      }\n    }\n  }\n\n  onData (chunk) {\n    return this.res.push(chunk)\n  }\n\n  onComplete (trailers) {\n    util.parseHeaders(trailers, this.trailers)\n    this.res.push(null)\n  }\n\n  onError (err) {\n    const { res, callback, body, opaque } = this\n\n    if (callback) {\n      // TODO: Does this need queueMicrotask?\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n\n    if (res) {\n      this.res = null\n      // Ensure all queued handlers are invoked before destroying res.\n      queueMicrotask(() => {\n        util.destroy(res, err)\n      })\n    }\n\n    if (body) {\n      this.body = null\n      util.destroy(body, err)\n    }\n\n    if (this.removeAbortListener) {\n      res?.off('close', this.removeAbortListener)\n      this.removeAbortListener()\n      this.removeAbortListener = null\n    }\n  }\n}\n\nfunction request (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      request.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    this.dispatch(opts, new RequestHandler(opts, callback))\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = request\nmodule.exports.RequestHandler = RequestHandler\n","'use strict'\n\nconst assert = require('node:assert')\nconst { finished, PassThrough } = require('node:stream')\nconst { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass StreamHandler extends AsyncResource {\n  constructor (opts, factory, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts\n\n    try {\n      if (typeof callback !== 'function') {\n        throw new InvalidArgumentError('invalid callback')\n      }\n\n      if (typeof factory !== 'function') {\n        throw new InvalidArgumentError('invalid factory')\n      }\n\n      if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n        throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n      }\n\n      if (method === 'CONNECT') {\n        throw new InvalidArgumentError('invalid method')\n      }\n\n      if (onInfo && typeof onInfo !== 'function') {\n        throw new InvalidArgumentError('invalid onInfo callback')\n      }\n\n      super('UNDICI_STREAM')\n    } catch (err) {\n      if (util.isStream(body)) {\n        util.destroy(body.on('error', util.nop), err)\n      }\n      throw err\n    }\n\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.factory = factory\n    this.callback = callback\n    this.res = null\n    this.abort = null\n    this.context = null\n    this.trailers = null\n    this.body = body\n    this.onInfo = onInfo || null\n    this.throwOnError = throwOnError || false\n\n    if (util.isStream(body)) {\n      body.on('error', (err) => {\n        this.onError(err)\n      })\n    }\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const { factory, opaque, context, callback, responseHeaders } = this\n\n    const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    this.factory = null\n\n    let res\n\n    if (this.throwOnError && statusCode >= 400) {\n      const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n      const contentType = parsedHeaders['content-type']\n      res = new PassThrough()\n\n      this.callback = null\n      this.runInAsyncScope(getResolveErrorBodyCallback, null,\n        { callback, body: res, contentType, statusCode, statusMessage, headers }\n      )\n    } else {\n      if (factory === null) {\n        return\n      }\n\n      res = this.runInAsyncScope(factory, null, {\n        statusCode,\n        headers,\n        opaque,\n        context\n      })\n\n      if (\n        !res ||\n        typeof res.write !== 'function' ||\n        typeof res.end !== 'function' ||\n        typeof res.on !== 'function'\n      ) {\n        throw new InvalidReturnValueError('expected Writable')\n      }\n\n      // TODO: Avoid finished. It registers an unnecessary amount of listeners.\n      finished(res, { readable: false }, (err) => {\n        const { callback, res, opaque, trailers, abort } = this\n\n        this.res = null\n        if (err || !res.readable) {\n          util.destroy(res, err)\n        }\n\n        this.callback = null\n        this.runInAsyncScope(callback, null, err || null, { opaque, trailers })\n\n        if (err) {\n          abort()\n        }\n      })\n    }\n\n    res.on('drain', resume)\n\n    this.res = res\n\n    const needDrain = res.writableNeedDrain !== undefined\n      ? res.writableNeedDrain\n      : res._writableState?.needDrain\n\n    return needDrain !== true\n  }\n\n  onData (chunk) {\n    const { res } = this\n\n    return res ? res.write(chunk) : true\n  }\n\n  onComplete (trailers) {\n    const { res } = this\n\n    removeSignal(this)\n\n    if (!res) {\n      return\n    }\n\n    this.trailers = util.parseHeaders(trailers)\n\n    res.end()\n  }\n\n  onError (err) {\n    const { res, callback, opaque, body } = this\n\n    removeSignal(this)\n\n    this.factory = null\n\n    if (res) {\n      this.res = null\n      util.destroy(res, err)\n    } else if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n\n    if (body) {\n      this.body = null\n      util.destroy(body, err)\n    }\n  }\n}\n\nfunction stream (opts, factory, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      stream.call(this, opts, factory, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    this.dispatch(opts, new StreamHandler(opts, factory, callback))\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = stream\n","'use strict'\n\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst { AsyncResource } = require('node:async_hooks')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nclass UpgradeHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    const { signal, opaque, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    super('UNDICI_UPGRADE')\n\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.callback = callback\n    this.abort = null\n    this.context = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = null\n  }\n\n  onHeaders () {\n    throw new SocketError('bad upgrade', null)\n  }\n\n  onUpgrade (statusCode, rawHeaders, socket) {\n    assert(statusCode === 101)\n\n    const { callback, opaque, context } = this\n\n    removeSignal(this)\n\n    this.callback = null\n    const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n    this.runInAsyncScope(callback, null, null, {\n      headers,\n      socket,\n      opaque,\n      context\n    })\n  }\n\n  onError (err) {\n    const { callback, opaque } = this\n\n    removeSignal(this)\n\n    if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n  }\n}\n\nfunction upgrade (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      upgrade.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    const upgradeHandler = new UpgradeHandler(opts, callback)\n    this.dispatch({\n      ...opts,\n      method: opts.method || 'GET',\n      upgrade: opts.protocol || 'Websocket'\n    }, upgradeHandler)\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = upgrade\n","'use strict'\n\nmodule.exports.request = require('./api-request')\nmodule.exports.stream = require('./api-stream')\nmodule.exports.pipeline = require('./api-pipeline')\nmodule.exports.upgrade = require('./api-upgrade')\nmodule.exports.connect = require('./api-connect')\n","// Ported from https://github.com/nodejs/undici/pull/907\n\n'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('node:stream')\nconst { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require('../core/errors')\nconst util = require('../core/util')\nconst { ReadableStreamFrom } = require('../core/util')\n\nconst kConsume = Symbol('kConsume')\nconst kReading = Symbol('kReading')\nconst kBody = Symbol('kBody')\nconst kAbort = Symbol('kAbort')\nconst kContentType = Symbol('kContentType')\nconst kContentLength = Symbol('kContentLength')\n\nconst noop = () => {}\n\nclass BodyReadable extends Readable {\n  constructor ({\n    resume,\n    abort,\n    contentType = '',\n    contentLength,\n    highWaterMark = 64 * 1024 // Same as nodejs fs streams.\n  }) {\n    super({\n      autoDestroy: true,\n      read: resume,\n      highWaterMark\n    })\n\n    this._readableState.dataEmitted = false\n\n    this[kAbort] = abort\n    this[kConsume] = null\n    this[kBody] = null\n    this[kContentType] = contentType\n    this[kContentLength] = contentLength\n\n    // Is stream being consumed through Readable API?\n    // This is an optimization so that we avoid checking\n    // for 'data' and 'readable' listeners in the hot path\n    // inside push().\n    this[kReading] = false\n  }\n\n  destroy (err) {\n    if (!err && !this._readableState.endEmitted) {\n      err = new RequestAbortedError()\n    }\n\n    if (err) {\n      this[kAbort]()\n    }\n\n    return super.destroy(err)\n  }\n\n  _destroy (err, callback) {\n    // Workaround for Node \"bug\". If the stream is destroyed in same\n    // tick as it is created, then a user who is waiting for a\n    // promise (i.e micro tick) for installing a 'error' listener will\n    // never get a chance and will always encounter an unhandled exception.\n    if (!this[kReading]) {\n      setImmediate(() => {\n        callback(err)\n      })\n    } else {\n      callback(err)\n    }\n  }\n\n  on (ev, ...args) {\n    if (ev === 'data' || ev === 'readable') {\n      this[kReading] = true\n    }\n    return super.on(ev, ...args)\n  }\n\n  addListener (ev, ...args) {\n    return this.on(ev, ...args)\n  }\n\n  off (ev, ...args) {\n    const ret = super.off(ev, ...args)\n    if (ev === 'data' || ev === 'readable') {\n      this[kReading] = (\n        this.listenerCount('data') > 0 ||\n        this.listenerCount('readable') > 0\n      )\n    }\n    return ret\n  }\n\n  removeListener (ev, ...args) {\n    return this.off(ev, ...args)\n  }\n\n  push (chunk) {\n    if (this[kConsume] && chunk !== null) {\n      consumePush(this[kConsume], chunk)\n      return this[kReading] ? super.push(chunk) : true\n    }\n    return super.push(chunk)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-text\n  async text () {\n    return consume(this, 'text')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-json\n  async json () {\n    return consume(this, 'json')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-blob\n  async blob () {\n    return consume(this, 'blob')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bytes\n  async bytes () {\n    return consume(this, 'bytes')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n  async arrayBuffer () {\n    return consume(this, 'arrayBuffer')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-formdata\n  async formData () {\n    // TODO: Implement.\n    throw new NotSupportedError()\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bodyused\n  get bodyUsed () {\n    return util.isDisturbed(this)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-body\n  get body () {\n    if (!this[kBody]) {\n      this[kBody] = ReadableStreamFrom(this)\n      if (this[kConsume]) {\n        // TODO: Is this the best way to force a lock?\n        this[kBody].getReader() // Ensure stream is locked.\n        assert(this[kBody].locked)\n      }\n    }\n    return this[kBody]\n  }\n\n  async dump (opts) {\n    let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024\n    const signal = opts?.signal\n\n    if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) {\n      throw new InvalidArgumentError('signal must be an AbortSignal')\n    }\n\n    signal?.throwIfAborted()\n\n    if (this._readableState.closeEmitted) {\n      return null\n    }\n\n    return await new Promise((resolve, reject) => {\n      if (this[kContentLength] > limit) {\n        this.destroy(new AbortError())\n      }\n\n      const onAbort = () => {\n        this.destroy(signal.reason ?? new AbortError())\n      }\n      signal?.addEventListener('abort', onAbort)\n\n      this\n        .on('close', function () {\n          signal?.removeEventListener('abort', onAbort)\n          if (signal?.aborted) {\n            reject(signal.reason ?? new AbortError())\n          } else {\n            resolve(null)\n          }\n        })\n        .on('error', noop)\n        .on('data', function (chunk) {\n          limit -= chunk.length\n          if (limit <= 0) {\n            this.destroy()\n          }\n        })\n        .resume()\n    })\n  }\n}\n\n// https://streams.spec.whatwg.org/#readablestream-locked\nfunction isLocked (self) {\n  // Consume is an implicit lock.\n  return (self[kBody] && self[kBody].locked === true) || self[kConsume]\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction isUnusable (self) {\n  return util.isDisturbed(self) || isLocked(self)\n}\n\nasync function consume (stream, type) {\n  assert(!stream[kConsume])\n\n  return new Promise((resolve, reject) => {\n    if (isUnusable(stream)) {\n      const rState = stream._readableState\n      if (rState.destroyed && rState.closeEmitted === false) {\n        stream\n          .on('error', err => {\n            reject(err)\n          })\n          .on('close', () => {\n            reject(new TypeError('unusable'))\n          })\n      } else {\n        reject(rState.errored ?? new TypeError('unusable'))\n      }\n    } else {\n      queueMicrotask(() => {\n        stream[kConsume] = {\n          type,\n          stream,\n          resolve,\n          reject,\n          length: 0,\n          body: []\n        }\n\n        stream\n          .on('error', function (err) {\n            consumeFinish(this[kConsume], err)\n          })\n          .on('close', function () {\n            if (this[kConsume].body !== null) {\n              consumeFinish(this[kConsume], new RequestAbortedError())\n            }\n          })\n\n        consumeStart(stream[kConsume])\n      })\n    }\n  })\n}\n\nfunction consumeStart (consume) {\n  if (consume.body === null) {\n    return\n  }\n\n  const { _readableState: state } = consume.stream\n\n  if (state.bufferIndex) {\n    const start = state.bufferIndex\n    const end = state.buffer.length\n    for (let n = start; n < end; n++) {\n      consumePush(consume, state.buffer[n])\n    }\n  } else {\n    for (const chunk of state.buffer) {\n      consumePush(consume, chunk)\n    }\n  }\n\n  if (state.endEmitted) {\n    consumeEnd(this[kConsume])\n  } else {\n    consume.stream.on('end', function () {\n      consumeEnd(this[kConsume])\n    })\n  }\n\n  consume.stream.resume()\n\n  while (consume.stream.read() != null) {\n    // Loop\n  }\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n */\nfunction chunksDecode (chunks, length) {\n  if (chunks.length === 0 || length === 0) {\n    return ''\n  }\n  const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length)\n  const bufferLength = buffer.length\n\n  // Skip BOM.\n  const start =\n    bufferLength > 2 &&\n    buffer[0] === 0xef &&\n    buffer[1] === 0xbb &&\n    buffer[2] === 0xbf\n      ? 3\n      : 0\n  return buffer.utf8Slice(start, bufferLength)\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n * @returns {Uint8Array}\n */\nfunction chunksConcat (chunks, length) {\n  if (chunks.length === 0 || length === 0) {\n    return new Uint8Array(0)\n  }\n  if (chunks.length === 1) {\n    // fast-path\n    return new Uint8Array(chunks[0])\n  }\n  const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer)\n\n  let offset = 0\n  for (let i = 0; i < chunks.length; ++i) {\n    const chunk = chunks[i]\n    buffer.set(chunk, offset)\n    offset += chunk.length\n  }\n\n  return buffer\n}\n\nfunction consumeEnd (consume) {\n  const { type, body, resolve, stream, length } = consume\n\n  try {\n    if (type === 'text') {\n      resolve(chunksDecode(body, length))\n    } else if (type === 'json') {\n      resolve(JSON.parse(chunksDecode(body, length)))\n    } else if (type === 'arrayBuffer') {\n      resolve(chunksConcat(body, length).buffer)\n    } else if (type === 'blob') {\n      resolve(new Blob(body, { type: stream[kContentType] }))\n    } else if (type === 'bytes') {\n      resolve(chunksConcat(body, length))\n    }\n\n    consumeFinish(consume)\n  } catch (err) {\n    stream.destroy(err)\n  }\n}\n\nfunction consumePush (consume, chunk) {\n  consume.length += chunk.length\n  consume.body.push(chunk)\n}\n\nfunction consumeFinish (consume, err) {\n  if (consume.body === null) {\n    return\n  }\n\n  if (err) {\n    consume.reject(err)\n  } else {\n    consume.resolve()\n  }\n\n  consume.type = null\n  consume.stream = null\n  consume.resolve = null\n  consume.reject = null\n  consume.length = 0\n  consume.body = null\n}\n\nmodule.exports = { Readable: BodyReadable, chunksDecode }\n","const assert = require('node:assert')\nconst {\n  ResponseStatusCodeError\n} = require('../core/errors')\n\nconst { chunksDecode } = require('./readable')\nconst CHUNK_LIMIT = 128 * 1024\n\nasync function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {\n  assert(body)\n\n  let chunks = []\n  let length = 0\n\n  try {\n    for await (const chunk of body) {\n      chunks.push(chunk)\n      length += chunk.length\n      if (length > CHUNK_LIMIT) {\n        chunks = []\n        length = 0\n        break\n      }\n    }\n  } catch {\n    chunks = []\n    length = 0\n    // Do nothing....\n  }\n\n  const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`\n\n  if (statusCode === 204 || !contentType || !length) {\n    queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)))\n    return\n  }\n\n  const stackTraceLimit = Error.stackTraceLimit\n  Error.stackTraceLimit = 0\n  let payload\n\n  try {\n    if (isContentTypeApplicationJson(contentType)) {\n      payload = JSON.parse(chunksDecode(chunks, length))\n    } else if (isContentTypeText(contentType)) {\n      payload = chunksDecode(chunks, length)\n    }\n  } catch {\n    // process in a callback to avoid throwing in the microtask queue\n  } finally {\n    Error.stackTraceLimit = stackTraceLimit\n  }\n  queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)))\n}\n\nconst isContentTypeApplicationJson = (contentType) => {\n  return (\n    contentType.length > 15 &&\n    contentType[11] === '/' &&\n    contentType[0] === 'a' &&\n    contentType[1] === 'p' &&\n    contentType[2] === 'p' &&\n    contentType[3] === 'l' &&\n    contentType[4] === 'i' &&\n    contentType[5] === 'c' &&\n    contentType[6] === 'a' &&\n    contentType[7] === 't' &&\n    contentType[8] === 'i' &&\n    contentType[9] === 'o' &&\n    contentType[10] === 'n' &&\n    contentType[12] === 'j' &&\n    contentType[13] === 's' &&\n    contentType[14] === 'o' &&\n    contentType[15] === 'n'\n  )\n}\n\nconst isContentTypeText = (contentType) => {\n  return (\n    contentType.length > 4 &&\n    contentType[4] === '/' &&\n    contentType[0] === 't' &&\n    contentType[1] === 'e' &&\n    contentType[2] === 'x' &&\n    contentType[3] === 't'\n  )\n}\n\nmodule.exports = {\n  getResolveErrorBodyCallback,\n  isContentTypeApplicationJson,\n  isContentTypeText\n}\n","'use strict'\n\nconst net = require('node:net')\nconst assert = require('node:assert')\nconst util = require('./util')\nconst { InvalidArgumentError, ConnectTimeoutError } = require('./errors')\nconst timers = require('../util/timers')\n\nfunction noop () {}\n\nlet tls // include tls conditionally since it is not always available\n\n// TODO: session re-use does not wait for the first\n// connection to resolve the session and might therefore\n// resolve the same servername multiple times even when\n// re-use is enabled.\n\nlet SessionCache\n// FIXME: remove workaround when the Node bug is fixed\n// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\nif (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) {\n  SessionCache = class WeakSessionCache {\n    constructor (maxCachedSessions) {\n      this._maxCachedSessions = maxCachedSessions\n      this._sessionCache = new Map()\n      this._sessionRegistry = new global.FinalizationRegistry((key) => {\n        if (this._sessionCache.size < this._maxCachedSessions) {\n          return\n        }\n\n        const ref = this._sessionCache.get(key)\n        if (ref !== undefined && ref.deref() === undefined) {\n          this._sessionCache.delete(key)\n        }\n      })\n    }\n\n    get (sessionKey) {\n      const ref = this._sessionCache.get(sessionKey)\n      return ref ? ref.deref() : null\n    }\n\n    set (sessionKey, session) {\n      if (this._maxCachedSessions === 0) {\n        return\n      }\n\n      this._sessionCache.set(sessionKey, new WeakRef(session))\n      this._sessionRegistry.register(session, sessionKey)\n    }\n  }\n} else {\n  SessionCache = class SimpleSessionCache {\n    constructor (maxCachedSessions) {\n      this._maxCachedSessions = maxCachedSessions\n      this._sessionCache = new Map()\n    }\n\n    get (sessionKey) {\n      return this._sessionCache.get(sessionKey)\n    }\n\n    set (sessionKey, session) {\n      if (this._maxCachedSessions === 0) {\n        return\n      }\n\n      if (this._sessionCache.size >= this._maxCachedSessions) {\n        // remove the oldest session\n        const { value: oldestKey } = this._sessionCache.keys().next()\n        this._sessionCache.delete(oldestKey)\n      }\n\n      this._sessionCache.set(sessionKey, session)\n    }\n  }\n}\n\nfunction buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {\n  if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n    throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')\n  }\n\n  const options = { path: socketPath, ...opts }\n  const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)\n  timeout = timeout == null ? 10e3 : timeout\n  allowH2 = allowH2 != null ? allowH2 : false\n  return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n    let socket\n    if (protocol === 'https:') {\n      if (!tls) {\n        tls = require('node:tls')\n      }\n      servername = servername || options.servername || util.getServerName(host) || null\n\n      const sessionKey = servername || hostname\n      assert(sessionKey)\n\n      const session = customSession || sessionCache.get(sessionKey) || null\n\n      port = port || 443\n\n      socket = tls.connect({\n        highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...\n        ...options,\n        servername,\n        session,\n        localAddress,\n        // TODO(HTTP/2): Add support for h2c\n        ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],\n        socket: httpSocket, // upgrade socket connection\n        port,\n        host: hostname\n      })\n\n      socket\n        .on('session', function (session) {\n          // TODO (fix): Can a session become invalid once established? Don't think so?\n          sessionCache.set(sessionKey, session)\n        })\n    } else {\n      assert(!httpSocket, 'httpSocket can only be sent on TLS update')\n\n      port = port || 80\n\n      socket = net.connect({\n        highWaterMark: 64 * 1024, // Same as nodejs fs streams.\n        ...options,\n        localAddress,\n        port,\n        host: hostname\n      })\n    }\n\n    // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket\n    if (options.keepAlive == null || options.keepAlive) {\n      const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay\n      socket.setKeepAlive(true, keepAliveInitialDelay)\n    }\n\n    const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port })\n\n    socket\n      .setNoDelay(true)\n      .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {\n        queueMicrotask(clearConnectTimeout)\n\n        if (callback) {\n          const cb = callback\n          callback = null\n          cb(null, this)\n        }\n      })\n      .on('error', function (err) {\n        queueMicrotask(clearConnectTimeout)\n\n        if (callback) {\n          const cb = callback\n          callback = null\n          cb(err)\n        }\n      })\n\n    return socket\n  }\n}\n\n/**\n * @param {WeakRef} socketWeakRef\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n * @returns {() => void}\n */\nconst setupConnectTimeout = process.platform === 'win32'\n  ? (socketWeakRef, opts) => {\n      if (!opts.timeout) {\n        return noop\n      }\n\n      let s1 = null\n      let s2 = null\n      const fastTimer = timers.setFastTimeout(() => {\n      // setImmediate is added to make sure that we prioritize socket error events over timeouts\n        s1 = setImmediate(() => {\n        // Windows needs an extra setImmediate probably due to implementation differences in the socket logic\n          s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))\n        })\n      }, opts.timeout)\n      return () => {\n        timers.clearFastTimeout(fastTimer)\n        clearImmediate(s1)\n        clearImmediate(s2)\n      }\n    }\n  : (socketWeakRef, opts) => {\n      if (!opts.timeout) {\n        return noop\n      }\n\n      let s1 = null\n      const fastTimer = timers.setFastTimeout(() => {\n      // setImmediate is added to make sure that we prioritize socket error events over timeouts\n        s1 = setImmediate(() => {\n          onConnectTimeout(socketWeakRef.deref(), opts)\n        })\n      }, opts.timeout)\n      return () => {\n        timers.clearFastTimeout(fastTimer)\n        clearImmediate(s1)\n      }\n    }\n\n/**\n * @param {net.Socket} socket\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n */\nfunction onConnectTimeout (socket, opts) {\n  // The socket could be already garbage collected\n  if (socket == null) {\n    return\n  }\n\n  let message = 'Connect Timeout Error'\n  if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {\n    message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`\n  } else {\n    message += ` (attempted address: ${opts.hostname}:${opts.port},`\n  }\n\n  message += ` timeout: ${opts.timeout}ms)`\n\n  util.destroy(socket, new ConnectTimeoutError(message))\n}\n\nmodule.exports = buildConnector\n","'use strict'\n\n/** @type {Record} */\nconst headerNameLowerCasedRecord = {}\n\n// https://developer.mozilla.org/docs/Web/HTTP/Headers\nconst wellknownHeaderNames = [\n  'Accept',\n  'Accept-Encoding',\n  'Accept-Language',\n  'Accept-Ranges',\n  'Access-Control-Allow-Credentials',\n  'Access-Control-Allow-Headers',\n  'Access-Control-Allow-Methods',\n  'Access-Control-Allow-Origin',\n  'Access-Control-Expose-Headers',\n  'Access-Control-Max-Age',\n  'Access-Control-Request-Headers',\n  'Access-Control-Request-Method',\n  'Age',\n  'Allow',\n  'Alt-Svc',\n  'Alt-Used',\n  'Authorization',\n  'Cache-Control',\n  'Clear-Site-Data',\n  'Connection',\n  'Content-Disposition',\n  'Content-Encoding',\n  'Content-Language',\n  'Content-Length',\n  'Content-Location',\n  'Content-Range',\n  'Content-Security-Policy',\n  'Content-Security-Policy-Report-Only',\n  'Content-Type',\n  'Cookie',\n  'Cross-Origin-Embedder-Policy',\n  'Cross-Origin-Opener-Policy',\n  'Cross-Origin-Resource-Policy',\n  'Date',\n  'Device-Memory',\n  'Downlink',\n  'ECT',\n  'ETag',\n  'Expect',\n  'Expect-CT',\n  'Expires',\n  'Forwarded',\n  'From',\n  'Host',\n  'If-Match',\n  'If-Modified-Since',\n  'If-None-Match',\n  'If-Range',\n  'If-Unmodified-Since',\n  'Keep-Alive',\n  'Last-Modified',\n  'Link',\n  'Location',\n  'Max-Forwards',\n  'Origin',\n  'Permissions-Policy',\n  'Pragma',\n  'Proxy-Authenticate',\n  'Proxy-Authorization',\n  'RTT',\n  'Range',\n  'Referer',\n  'Referrer-Policy',\n  'Refresh',\n  'Retry-After',\n  'Sec-WebSocket-Accept',\n  'Sec-WebSocket-Extensions',\n  'Sec-WebSocket-Key',\n  'Sec-WebSocket-Protocol',\n  'Sec-WebSocket-Version',\n  'Server',\n  'Server-Timing',\n  'Service-Worker-Allowed',\n  'Service-Worker-Navigation-Preload',\n  'Set-Cookie',\n  'SourceMap',\n  'Strict-Transport-Security',\n  'Supports-Loading-Mode',\n  'TE',\n  'Timing-Allow-Origin',\n  'Trailer',\n  'Transfer-Encoding',\n  'Upgrade',\n  'Upgrade-Insecure-Requests',\n  'User-Agent',\n  'Vary',\n  'Via',\n  'WWW-Authenticate',\n  'X-Content-Type-Options',\n  'X-DNS-Prefetch-Control',\n  'X-Frame-Options',\n  'X-Permitted-Cross-Domain-Policies',\n  'X-Powered-By',\n  'X-Requested-With',\n  'X-XSS-Protection'\n]\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n  const key = wellknownHeaderNames[i]\n  const lowerCasedKey = key.toLowerCase()\n  headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =\n    lowerCasedKey\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(headerNameLowerCasedRecord, null)\n\nmodule.exports = {\n  wellknownHeaderNames,\n  headerNameLowerCasedRecord\n}\n","'use strict'\nconst diagnosticsChannel = require('node:diagnostics_channel')\nconst util = require('node:util')\n\nconst undiciDebugLog = util.debuglog('undici')\nconst fetchDebuglog = util.debuglog('fetch')\nconst websocketDebuglog = util.debuglog('websocket')\nlet isClientSet = false\nconst channels = {\n  // Client\n  beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),\n  connected: diagnosticsChannel.channel('undici:client:connected'),\n  connectError: diagnosticsChannel.channel('undici:client:connectError'),\n  sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),\n  // Request\n  create: diagnosticsChannel.channel('undici:request:create'),\n  bodySent: diagnosticsChannel.channel('undici:request:bodySent'),\n  headers: diagnosticsChannel.channel('undici:request:headers'),\n  trailers: diagnosticsChannel.channel('undici:request:trailers'),\n  error: diagnosticsChannel.channel('undici:request:error'),\n  // WebSocket\n  open: diagnosticsChannel.channel('undici:websocket:open'),\n  close: diagnosticsChannel.channel('undici:websocket:close'),\n  socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),\n  ping: diagnosticsChannel.channel('undici:websocket:ping'),\n  pong: diagnosticsChannel.channel('undici:websocket:pong')\n}\n\nif (undiciDebugLog.enabled || fetchDebuglog.enabled) {\n  const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog\n\n  // Track all Client events\n  diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host }\n    } = evt\n    debuglog(\n      'connecting to %s using %s%s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host }\n    } = evt\n    debuglog(\n      'connected to %s using %s%s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host },\n      error\n    } = evt\n    debuglog(\n      'connection to %s using %s%s errored - %s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version,\n      error.message\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n    const {\n      request: { method, path, origin }\n    } = evt\n    debuglog('sending request to %s %s/%s', method, origin, path)\n  })\n\n  // Track Request events\n  diagnosticsChannel.channel('undici:request:headers').subscribe(evt => {\n    const {\n      request: { method, path, origin },\n      response: { statusCode }\n    } = evt\n    debuglog(\n      'received response to %s %s/%s - HTTP %d',\n      method,\n      origin,\n      path,\n      statusCode\n    )\n  })\n\n  diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => {\n    const {\n      request: { method, path, origin }\n    } = evt\n    debuglog('trailers received from %s %s/%s', method, origin, path)\n  })\n\n  diagnosticsChannel.channel('undici:request:error').subscribe(evt => {\n    const {\n      request: { method, path, origin },\n      error\n    } = evt\n    debuglog(\n      'request to %s %s/%s errored - %s',\n      method,\n      origin,\n      path,\n      error.message\n    )\n  })\n\n  isClientSet = true\n}\n\nif (websocketDebuglog.enabled) {\n  if (!isClientSet) {\n    const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog\n    diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host }\n      } = evt\n      debuglog(\n        'connecting to %s%s using %s%s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host }\n      } = evt\n      debuglog(\n        'connected to %s%s using %s%s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host },\n        error\n      } = evt\n      debuglog(\n        'connection to %s%s using %s%s errored - %s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version,\n        error.message\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n      const {\n        request: { method, path, origin }\n      } = evt\n      debuglog('sending request to %s %s/%s', method, origin, path)\n    })\n  }\n\n  // Track all WebSocket events\n  diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => {\n    const {\n      address: { address, port }\n    } = evt\n    websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '')\n  })\n\n  diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => {\n    const { websocket, code, reason } = evt\n    websocketDebuglog(\n      'closed connection to %s - %s %s',\n      websocket.url,\n      code,\n      reason\n    )\n  })\n\n  diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => {\n    websocketDebuglog('connection errored - %s', err.message)\n  })\n\n  diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => {\n    websocketDebuglog('ping received')\n  })\n\n  diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => {\n    websocketDebuglog('pong received')\n  })\n}\n\nmodule.exports = {\n  channels\n}\n","'use strict'\n\nconst kUndiciError = Symbol.for('undici.error.UND_ERR')\nclass UndiciError extends Error {\n  constructor (message) {\n    super(message)\n    this.name = 'UndiciError'\n    this.code = 'UND_ERR'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kUndiciError] === true\n  }\n\n  [kUndiciError] = true\n}\n\nconst kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT')\nclass ConnectTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ConnectTimeoutError'\n    this.message = message || 'Connect Timeout Error'\n    this.code = 'UND_ERR_CONNECT_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kConnectTimeoutError] === true\n  }\n\n  [kConnectTimeoutError] = true\n}\n\nconst kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT')\nclass HeadersTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'HeadersTimeoutError'\n    this.message = message || 'Headers Timeout Error'\n    this.code = 'UND_ERR_HEADERS_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHeadersTimeoutError] === true\n  }\n\n  [kHeadersTimeoutError] = true\n}\n\nconst kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW')\nclass HeadersOverflowError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'HeadersOverflowError'\n    this.message = message || 'Headers Overflow Error'\n    this.code = 'UND_ERR_HEADERS_OVERFLOW'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHeadersOverflowError] === true\n  }\n\n  [kHeadersOverflowError] = true\n}\n\nconst kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT')\nclass BodyTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'BodyTimeoutError'\n    this.message = message || 'Body Timeout Error'\n    this.code = 'UND_ERR_BODY_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kBodyTimeoutError] === true\n  }\n\n  [kBodyTimeoutError] = true\n}\n\nconst kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE')\nclass ResponseStatusCodeError extends UndiciError {\n  constructor (message, statusCode, headers, body) {\n    super(message)\n    this.name = 'ResponseStatusCodeError'\n    this.message = message || 'Response Status Code Error'\n    this.code = 'UND_ERR_RESPONSE_STATUS_CODE'\n    this.body = body\n    this.status = statusCode\n    this.statusCode = statusCode\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseStatusCodeError] === true\n  }\n\n  [kResponseStatusCodeError] = true\n}\n\nconst kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG')\nclass InvalidArgumentError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InvalidArgumentError'\n    this.message = message || 'Invalid Argument Error'\n    this.code = 'UND_ERR_INVALID_ARG'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInvalidArgumentError] === true\n  }\n\n  [kInvalidArgumentError] = true\n}\n\nconst kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE')\nclass InvalidReturnValueError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InvalidReturnValueError'\n    this.message = message || 'Invalid Return Value Error'\n    this.code = 'UND_ERR_INVALID_RETURN_VALUE'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInvalidReturnValueError] === true\n  }\n\n  [kInvalidReturnValueError] = true\n}\n\nconst kAbortError = Symbol.for('undici.error.UND_ERR_ABORT')\nclass AbortError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'AbortError'\n    this.message = message || 'The operation was aborted'\n    this.code = 'UND_ERR_ABORT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kAbortError] === true\n  }\n\n  [kAbortError] = true\n}\n\nconst kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED')\nclass RequestAbortedError extends AbortError {\n  constructor (message) {\n    super(message)\n    this.name = 'AbortError'\n    this.message = message || 'Request aborted'\n    this.code = 'UND_ERR_ABORTED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestAbortedError] === true\n  }\n\n  [kRequestAbortedError] = true\n}\n\nconst kInformationalError = Symbol.for('undici.error.UND_ERR_INFO')\nclass InformationalError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InformationalError'\n    this.message = message || 'Request information'\n    this.code = 'UND_ERR_INFO'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInformationalError] === true\n  }\n\n  [kInformationalError] = true\n}\n\nconst kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH')\nclass RequestContentLengthMismatchError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'RequestContentLengthMismatchError'\n    this.message = message || 'Request body length does not match content-length header'\n    this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestContentLengthMismatchError] === true\n  }\n\n  [kRequestContentLengthMismatchError] = true\n}\n\nconst kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH')\nclass ResponseContentLengthMismatchError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ResponseContentLengthMismatchError'\n    this.message = message || 'Response body length does not match content-length header'\n    this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseContentLengthMismatchError] === true\n  }\n\n  [kResponseContentLengthMismatchError] = true\n}\n\nconst kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED')\nclass ClientDestroyedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ClientDestroyedError'\n    this.message = message || 'The client is destroyed'\n    this.code = 'UND_ERR_DESTROYED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kClientDestroyedError] === true\n  }\n\n  [kClientDestroyedError] = true\n}\n\nconst kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED')\nclass ClientClosedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ClientClosedError'\n    this.message = message || 'The client is closed'\n    this.code = 'UND_ERR_CLOSED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kClientClosedError] === true\n  }\n\n  [kClientClosedError] = true\n}\n\nconst kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET')\nclass SocketError extends UndiciError {\n  constructor (message, socket) {\n    super(message)\n    this.name = 'SocketError'\n    this.message = message || 'Socket error'\n    this.code = 'UND_ERR_SOCKET'\n    this.socket = socket\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kSocketError] === true\n  }\n\n  [kSocketError] = true\n}\n\nconst kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED')\nclass NotSupportedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'NotSupportedError'\n    this.message = message || 'Not supported error'\n    this.code = 'UND_ERR_NOT_SUPPORTED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kNotSupportedError] === true\n  }\n\n  [kNotSupportedError] = true\n}\n\nconst kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM')\nclass BalancedPoolMissingUpstreamError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'MissingUpstreamError'\n    this.message = message || 'No upstream has been added to the BalancedPool'\n    this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kBalancedPoolMissingUpstreamError] === true\n  }\n\n  [kBalancedPoolMissingUpstreamError] = true\n}\n\nconst kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')\nclass HTTPParserError extends Error {\n  constructor (message, code, data) {\n    super(message)\n    this.name = 'HTTPParserError'\n    this.code = code ? `HPE_${code}` : undefined\n    this.data = data ? data.toString() : undefined\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHTTPParserError] === true\n  }\n\n  [kHTTPParserError] = true\n}\n\nconst kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE')\nclass ResponseExceededMaxSizeError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ResponseExceededMaxSizeError'\n    this.message = message || 'Response content exceeded max size'\n    this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseExceededMaxSizeError] === true\n  }\n\n  [kResponseExceededMaxSizeError] = true\n}\n\nconst kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY')\nclass RequestRetryError extends UndiciError {\n  constructor (message, code, { headers, data }) {\n    super(message)\n    this.name = 'RequestRetryError'\n    this.message = message || 'Request retry error'\n    this.code = 'UND_ERR_REQ_RETRY'\n    this.statusCode = code\n    this.data = data\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestRetryError] === true\n  }\n\n  [kRequestRetryError] = true\n}\n\nconst kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')\nclass ResponseError extends UndiciError {\n  constructor (message, code, { headers, data }) {\n    super(message)\n    this.name = 'ResponseError'\n    this.message = message || 'Response error'\n    this.code = 'UND_ERR_RESPONSE'\n    this.statusCode = code\n    this.data = data\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseError] === true\n  }\n\n  [kResponseError] = true\n}\n\nconst kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS')\nclass SecureProxyConnectionError extends UndiciError {\n  constructor (cause, message, options) {\n    super(message, { cause, ...(options ?? {}) })\n    this.name = 'SecureProxyConnectionError'\n    this.message = message || 'Secure Proxy Connection failed'\n    this.code = 'UND_ERR_PRX_TLS'\n    this.cause = cause\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kSecureProxyConnectionError] === true\n  }\n\n  [kSecureProxyConnectionError] = true\n}\n\nconst kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED')\nclass MessageSizeExceededError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'MessageSizeExceededError'\n    this.message = message || 'Max decompressed message size exceeded'\n    this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kMessageSizeExceededError] === true\n  }\n\n  get [kMessageSizeExceededError] () {\n    return true\n  }\n}\n\nmodule.exports = {\n  AbortError,\n  HTTPParserError,\n  UndiciError,\n  HeadersTimeoutError,\n  HeadersOverflowError,\n  BodyTimeoutError,\n  RequestContentLengthMismatchError,\n  ConnectTimeoutError,\n  ResponseStatusCodeError,\n  InvalidArgumentError,\n  InvalidReturnValueError,\n  RequestAbortedError,\n  ClientDestroyedError,\n  ClientClosedError,\n  InformationalError,\n  SocketError,\n  NotSupportedError,\n  ResponseContentLengthMismatchError,\n  BalancedPoolMissingUpstreamError,\n  ResponseExceededMaxSizeError,\n  RequestRetryError,\n  ResponseError,\n  SecureProxyConnectionError,\n  MessageSizeExceededError\n}\n","'use strict'\n\nconst {\n  InvalidArgumentError,\n  NotSupportedError\n} = require('./errors')\nconst assert = require('node:assert')\nconst {\n  isValidHTTPToken,\n  isValidHeaderValue,\n  isStream,\n  destroy,\n  isBuffer,\n  isFormDataLike,\n  isIterable,\n  isBlobLike,\n  buildURL,\n  validateHandler,\n  getServerName,\n  normalizedMethodRecords\n} = require('./util')\nconst { channels } = require('./diagnostics.js')\nconst { headerNameLowerCasedRecord } = require('./constants')\n\n// Verifies that a given path is valid does not contain control chars \\x00 to \\x20\nconst invalidPathRegex = /[^\\u0021-\\u00ff]/\n\nconst kHandler = Symbol('handler')\n\nclass Request {\n  constructor (origin, {\n    path,\n    method,\n    body,\n    headers,\n    query,\n    idempotent,\n    blocking,\n    upgrade,\n    headersTimeout,\n    bodyTimeout,\n    reset,\n    throwOnError,\n    expectContinue,\n    servername\n  }, handler) {\n    if (typeof path !== 'string') {\n      throw new InvalidArgumentError('path must be a string')\n    } else if (\n      path[0] !== '/' &&\n      !(path.startsWith('http://') || path.startsWith('https://')) &&\n      method !== 'CONNECT'\n    ) {\n      throw new InvalidArgumentError('path must be an absolute URL or start with a slash')\n    } else if (invalidPathRegex.test(path)) {\n      throw new InvalidArgumentError('invalid request path')\n    }\n\n    if (typeof method !== 'string') {\n      throw new InvalidArgumentError('method must be a string')\n    } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {\n      throw new InvalidArgumentError('invalid request method')\n    }\n\n    if (upgrade && typeof upgrade !== 'string') {\n      throw new InvalidArgumentError('upgrade must be a string')\n    }\n\n    if (upgrade && !isValidHeaderValue(upgrade)) {\n      throw new InvalidArgumentError('invalid upgrade header')\n    }\n\n    if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n      throw new InvalidArgumentError('invalid headersTimeout')\n    }\n\n    if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n      throw new InvalidArgumentError('invalid bodyTimeout')\n    }\n\n    if (reset != null && typeof reset !== 'boolean') {\n      throw new InvalidArgumentError('invalid reset')\n    }\n\n    if (expectContinue != null && typeof expectContinue !== 'boolean') {\n      throw new InvalidArgumentError('invalid expectContinue')\n    }\n\n    this.headersTimeout = headersTimeout\n\n    this.bodyTimeout = bodyTimeout\n\n    this.throwOnError = throwOnError === true\n\n    this.method = method\n\n    this.abort = null\n\n    if (body == null) {\n      this.body = null\n    } else if (isStream(body)) {\n      this.body = body\n\n      const rState = this.body._readableState\n      if (!rState || !rState.autoDestroy) {\n        this.endHandler = function autoDestroy () {\n          destroy(this)\n        }\n        this.body.on('end', this.endHandler)\n      }\n\n      this.errorHandler = err => {\n        if (this.abort) {\n          this.abort(err)\n        } else {\n          this.error = err\n        }\n      }\n      this.body.on('error', this.errorHandler)\n    } else if (isBuffer(body)) {\n      this.body = body.byteLength ? body : null\n    } else if (ArrayBuffer.isView(body)) {\n      this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null\n    } else if (body instanceof ArrayBuffer) {\n      this.body = body.byteLength ? Buffer.from(body) : null\n    } else if (typeof body === 'string') {\n      this.body = body.length ? Buffer.from(body) : null\n    } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {\n      this.body = body\n    } else {\n      throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')\n    }\n\n    this.completed = false\n\n    this.aborted = false\n\n    this.upgrade = upgrade || null\n\n    this.path = query ? buildURL(path, query) : path\n\n    this.origin = origin\n\n    this.idempotent = idempotent == null\n      ? method === 'HEAD' || method === 'GET'\n      : idempotent\n\n    this.blocking = blocking == null ? false : blocking\n\n    this.reset = reset == null ? null : reset\n\n    this.host = null\n\n    this.contentLength = null\n\n    this.contentType = null\n\n    this.headers = []\n\n    // Only for H2\n    this.expectContinue = expectContinue != null ? expectContinue : false\n\n    if (Array.isArray(headers)) {\n      if (headers.length % 2 !== 0) {\n        throw new InvalidArgumentError('headers array must be even')\n      }\n      for (let i = 0; i < headers.length; i += 2) {\n        processHeader(this, headers[i], headers[i + 1])\n      }\n    } else if (headers && typeof headers === 'object') {\n      if (headers[Symbol.iterator]) {\n        for (const header of headers) {\n          if (!Array.isArray(header) || header.length !== 2) {\n            throw new InvalidArgumentError('headers must be in key-value pair format')\n          }\n          processHeader(this, header[0], header[1])\n        }\n      } else {\n        const keys = Object.keys(headers)\n        for (let i = 0; i < keys.length; ++i) {\n          processHeader(this, keys[i], headers[keys[i]])\n        }\n      }\n    } else if (headers != null) {\n      throw new InvalidArgumentError('headers must be an object or an array')\n    }\n\n    validateHandler(handler, method, upgrade)\n\n    this.servername = servername || getServerName(this.host)\n\n    this[kHandler] = handler\n\n    if (channels.create.hasSubscribers) {\n      channels.create.publish({ request: this })\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this[kHandler].onBodySent) {\n      try {\n        return this[kHandler].onBodySent(chunk)\n      } catch (err) {\n        this.abort(err)\n      }\n    }\n  }\n\n  onRequestSent () {\n    if (channels.bodySent.hasSubscribers) {\n      channels.bodySent.publish({ request: this })\n    }\n\n    if (this[kHandler].onRequestSent) {\n      try {\n        return this[kHandler].onRequestSent()\n      } catch (err) {\n        this.abort(err)\n      }\n    }\n  }\n\n  onConnect (abort) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    if (this.error) {\n      abort(this.error)\n    } else {\n      this.abort = abort\n      return this[kHandler].onConnect(abort)\n    }\n  }\n\n  onResponseStarted () {\n    return this[kHandler].onResponseStarted?.()\n  }\n\n  onHeaders (statusCode, headers, resume, statusText) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    if (channels.headers.hasSubscribers) {\n      channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n    }\n\n    try {\n      return this[kHandler].onHeaders(statusCode, headers, resume, statusText)\n    } catch (err) {\n      this.abort(err)\n    }\n  }\n\n  onData (chunk) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    try {\n      return this[kHandler].onData(chunk)\n    } catch (err) {\n      this.abort(err)\n      return false\n    }\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    return this[kHandler].onUpgrade(statusCode, headers, socket)\n  }\n\n  onComplete (trailers) {\n    this.onFinally()\n\n    assert(!this.aborted)\n\n    this.completed = true\n    if (channels.trailers.hasSubscribers) {\n      channels.trailers.publish({ request: this, trailers })\n    }\n\n    try {\n      return this[kHandler].onComplete(trailers)\n    } catch (err) {\n      // TODO (fix): This might be a bad idea?\n      this.onError(err)\n    }\n  }\n\n  onError (error) {\n    this.onFinally()\n\n    if (channels.error.hasSubscribers) {\n      channels.error.publish({ request: this, error })\n    }\n\n    if (this.aborted) {\n      return\n    }\n    this.aborted = true\n\n    return this[kHandler].onError(error)\n  }\n\n  onFinally () {\n    if (this.errorHandler) {\n      this.body.off('error', this.errorHandler)\n      this.errorHandler = null\n    }\n\n    if (this.endHandler) {\n      this.body.off('end', this.endHandler)\n      this.endHandler = null\n    }\n  }\n\n  addHeader (key, value) {\n    processHeader(this, key, value)\n    return this\n  }\n}\n\nfunction processHeader (request, key, val) {\n  if (val && (typeof val === 'object' && !Array.isArray(val))) {\n    throw new InvalidArgumentError(`invalid ${key} header`)\n  } else if (val === undefined) {\n    return\n  }\n\n  let headerName = headerNameLowerCasedRecord[key]\n\n  if (headerName === undefined) {\n    headerName = key.toLowerCase()\n    if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {\n      throw new InvalidArgumentError('invalid header key')\n    }\n  }\n\n  if (Array.isArray(val)) {\n    const arr = []\n    for (let i = 0; i < val.length; i++) {\n      if (typeof val[i] === 'string') {\n        if (!isValidHeaderValue(val[i])) {\n          throw new InvalidArgumentError(`invalid ${key} header`)\n        }\n        arr.push(val[i])\n      } else if (val[i] === null) {\n        arr.push('')\n      } else if (typeof val[i] === 'object') {\n        throw new InvalidArgumentError(`invalid ${key} header`)\n      } else {\n        arr.push(`${val[i]}`)\n      }\n    }\n    val = arr\n  } else if (typeof val === 'string') {\n    if (!isValidHeaderValue(val)) {\n      throw new InvalidArgumentError(`invalid ${key} header`)\n    }\n  } else if (val === null) {\n    val = ''\n  } else {\n    val = `${val}`\n  }\n\n  if (headerName === 'host') {\n    if (request.host !== null) {\n      throw new InvalidArgumentError('duplicate host header')\n    }\n    if (typeof val !== 'string') {\n      throw new InvalidArgumentError('invalid host header')\n    }\n    // Consumed by Client\n    request.host = val\n  } else if (headerName === 'content-length') {\n    if (request.contentLength !== null) {\n      throw new InvalidArgumentError('duplicate content-length header')\n    }\n    request.contentLength = parseInt(val, 10)\n    if (!Number.isFinite(request.contentLength)) {\n      throw new InvalidArgumentError('invalid content-length header')\n    }\n  } else if (request.contentType === null && headerName === 'content-type') {\n    request.contentType = val\n    request.headers.push(key, val)\n  } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {\n    throw new InvalidArgumentError(`invalid ${headerName} header`)\n  } else if (headerName === 'connection') {\n    const value = typeof val === 'string' ? val.toLowerCase() : null\n    if (value !== 'close' && value !== 'keep-alive') {\n      throw new InvalidArgumentError('invalid connection header')\n    }\n\n    if (value === 'close') {\n      request.reset = true\n    }\n  } else if (headerName === 'expect') {\n    throw new NotSupportedError('expect header not supported')\n  } else {\n    request.headers.push(key, val)\n  }\n}\n\nmodule.exports = Request\n","module.exports = {\n  kClose: Symbol('close'),\n  kDestroy: Symbol('destroy'),\n  kDispatch: Symbol('dispatch'),\n  kUrl: Symbol('url'),\n  kWriting: Symbol('writing'),\n  kResuming: Symbol('resuming'),\n  kQueue: Symbol('queue'),\n  kConnect: Symbol('connect'),\n  kConnecting: Symbol('connecting'),\n  kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),\n  kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),\n  kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),\n  kKeepAliveTimeoutValue: Symbol('keep alive timeout'),\n  kKeepAlive: Symbol('keep alive'),\n  kHeadersTimeout: Symbol('headers timeout'),\n  kBodyTimeout: Symbol('body timeout'),\n  kServerName: Symbol('server name'),\n  kLocalAddress: Symbol('local address'),\n  kHost: Symbol('host'),\n  kNoRef: Symbol('no ref'),\n  kBodyUsed: Symbol('used'),\n  kBody: Symbol('abstracted request body'),\n  kRunning: Symbol('running'),\n  kBlocking: Symbol('blocking'),\n  kPending: Symbol('pending'),\n  kSize: Symbol('size'),\n  kBusy: Symbol('busy'),\n  kQueued: Symbol('queued'),\n  kFree: Symbol('free'),\n  kConnected: Symbol('connected'),\n  kClosed: Symbol('closed'),\n  kNeedDrain: Symbol('need drain'),\n  kReset: Symbol('reset'),\n  kDestroyed: Symbol.for('nodejs.stream.destroyed'),\n  kResume: Symbol('resume'),\n  kOnError: Symbol('on error'),\n  kMaxHeadersSize: Symbol('max headers size'),\n  kRunningIdx: Symbol('running index'),\n  kPendingIdx: Symbol('pending index'),\n  kError: Symbol('error'),\n  kClients: Symbol('clients'),\n  kClient: Symbol('client'),\n  kParser: Symbol('parser'),\n  kOnDestroyed: Symbol('destroy callbacks'),\n  kPipelining: Symbol('pipelining'),\n  kSocket: Symbol('socket'),\n  kHostHeader: Symbol('host header'),\n  kConnector: Symbol('connector'),\n  kStrictContentLength: Symbol('strict content length'),\n  kMaxRedirections: Symbol('maxRedirections'),\n  kMaxRequests: Symbol('maxRequestsPerClient'),\n  kProxy: Symbol('proxy agent options'),\n  kCounter: Symbol('socket request counter'),\n  kInterceptors: Symbol('dispatch interceptors'),\n  kMaxResponseSize: Symbol('max response size'),\n  kHTTP2Session: Symbol('http2Session'),\n  kHTTP2SessionState: Symbol('http2Session state'),\n  kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),\n  kConstruct: Symbol('constructable'),\n  kListeners: Symbol('listeners'),\n  kHTTPContext: Symbol('http context'),\n  kMaxConcurrentStreams: Symbol('max concurrent streams'),\n  kNoProxyAgent: Symbol('no proxy agent'),\n  kHttpProxyAgent: Symbol('http proxy agent'),\n  kHttpsProxyAgent: Symbol('https proxy agent')\n}\n","'use strict'\n\nconst {\n  wellknownHeaderNames,\n  headerNameLowerCasedRecord\n} = require('./constants')\n\nclass TstNode {\n  /** @type {any} */\n  value = null\n  /** @type {null | TstNode} */\n  left = null\n  /** @type {null | TstNode} */\n  middle = null\n  /** @type {null | TstNode} */\n  right = null\n  /** @type {number} */\n  code\n  /**\n   * @param {string} key\n   * @param {any} value\n   * @param {number} index\n   */\n  constructor (key, value, index) {\n    if (index === undefined || index >= key.length) {\n      throw new TypeError('Unreachable')\n    }\n    const code = this.code = key.charCodeAt(index)\n    // check code is ascii string\n    if (code > 0x7F) {\n      throw new TypeError('key must be ascii string')\n    }\n    if (key.length !== ++index) {\n      this.middle = new TstNode(key, value, index)\n    } else {\n      this.value = value\n    }\n  }\n\n  /**\n   * @param {string} key\n   * @param {any} value\n   */\n  add (key, value) {\n    const length = key.length\n    if (length === 0) {\n      throw new TypeError('Unreachable')\n    }\n    let index = 0\n    let node = this\n    while (true) {\n      const code = key.charCodeAt(index)\n      // check code is ascii string\n      if (code > 0x7F) {\n        throw new TypeError('key must be ascii string')\n      }\n      if (node.code === code) {\n        if (length === ++index) {\n          node.value = value\n          break\n        } else if (node.middle !== null) {\n          node = node.middle\n        } else {\n          node.middle = new TstNode(key, value, index)\n          break\n        }\n      } else if (node.code < code) {\n        if (node.left !== null) {\n          node = node.left\n        } else {\n          node.left = new TstNode(key, value, index)\n          break\n        }\n      } else if (node.right !== null) {\n        node = node.right\n      } else {\n        node.right = new TstNode(key, value, index)\n        break\n      }\n    }\n  }\n\n  /**\n   * @param {Uint8Array} key\n   * @return {TstNode | null}\n   */\n  search (key) {\n    const keylength = key.length\n    let index = 0\n    let node = this\n    while (node !== null && index < keylength) {\n      let code = key[index]\n      // A-Z\n      // First check if it is bigger than 0x5a.\n      // Lowercase letters have higher char codes than uppercase ones.\n      // Also we assume that headers will mostly contain lowercase characters.\n      if (code <= 0x5a && code >= 0x41) {\n        // Lowercase for uppercase.\n        code |= 32\n      }\n      while (node !== null) {\n        if (code === node.code) {\n          if (keylength === ++index) {\n            // Returns Node since it is the last key.\n            return node\n          }\n          node = node.middle\n          break\n        }\n        node = node.code < code ? node.left : node.right\n      }\n    }\n    return null\n  }\n}\n\nclass TernarySearchTree {\n  /** @type {TstNode | null} */\n  node = null\n\n  /**\n   * @param {string} key\n   * @param {any} value\n   * */\n  insert (key, value) {\n    if (this.node === null) {\n      this.node = new TstNode(key, value, 0)\n    } else {\n      this.node.add(key, value)\n    }\n  }\n\n  /**\n   * @param {Uint8Array} key\n   * @return {any}\n   */\n  lookup (key) {\n    return this.node?.search(key)?.value ?? null\n  }\n}\n\nconst tree = new TernarySearchTree()\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n  const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]\n  tree.insert(key, key)\n}\n\nmodule.exports = {\n  TernarySearchTree,\n  tree\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')\nconst { IncomingMessage } = require('node:http')\nconst stream = require('node:stream')\nconst net = require('node:net')\nconst { Blob } = require('node:buffer')\nconst nodeUtil = require('node:util')\nconst { stringify } = require('node:querystring')\nconst { EventEmitter: EE } = require('node:events')\nconst { InvalidArgumentError } = require('./errors')\nconst { headerNameLowerCasedRecord } = require('./constants')\nconst { tree } = require('./tree')\n\nconst [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))\n\nclass BodyAsyncIterable {\n  constructor (body) {\n    this[kBody] = body\n    this[kBodyUsed] = false\n  }\n\n  async * [Symbol.asyncIterator] () {\n    assert(!this[kBodyUsed], 'disturbed')\n    this[kBodyUsed] = true\n    yield * this[kBody]\n  }\n}\n\nfunction wrapRequestBody (body) {\n  if (isStream(body)) {\n    // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n    // so that it can be dispatched again?\n    // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n    if (bodyLength(body) === 0) {\n      body\n        .on('data', function () {\n          assert(false)\n        })\n    }\n\n    if (typeof body.readableDidRead !== 'boolean') {\n      body[kBodyUsed] = false\n      EE.prototype.on.call(body, 'data', function () {\n        this[kBodyUsed] = true\n      })\n    }\n\n    return body\n  } else if (body && typeof body.pipeTo === 'function') {\n    // TODO (fix): We can't access ReadableStream internal state\n    // to determine whether or not it has been disturbed. This is just\n    // a workaround.\n    return new BodyAsyncIterable(body)\n  } else if (\n    body &&\n    typeof body !== 'string' &&\n    !ArrayBuffer.isView(body) &&\n    isIterable(body)\n  ) {\n    // TODO: Should we allow re-using iterable if !this.opts.idempotent\n    // or through some other flag?\n    return new BodyAsyncIterable(body)\n  } else {\n    return body\n  }\n}\n\nfunction nop () {}\n\nfunction isStream (obj) {\n  return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'\n}\n\n// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)\nfunction isBlobLike (object) {\n  if (object === null) {\n    return false\n  } else if (object instanceof Blob) {\n    return true\n  } else if (typeof object !== 'object') {\n    return false\n  } else {\n    const sTag = object[Symbol.toStringTag]\n\n    return (sTag === 'Blob' || sTag === 'File') && (\n      ('stream' in object && typeof object.stream === 'function') ||\n      ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')\n    )\n  }\n}\n\nfunction buildURL (url, queryParams) {\n  if (url.includes('?') || url.includes('#')) {\n    throw new Error('Query params cannot be passed when url already contains \"?\" or \"#\".')\n  }\n\n  const stringified = stringify(queryParams)\n\n  if (stringified) {\n    url += '?' + stringified\n  }\n\n  return url\n}\n\nfunction isValidPort (port) {\n  const value = parseInt(port, 10)\n  return (\n    value === Number(port) &&\n    value >= 0 &&\n    value <= 65535\n  )\n}\n\nfunction isHttpOrHttpsPrefixed (value) {\n  return (\n    value != null &&\n    value[0] === 'h' &&\n    value[1] === 't' &&\n    value[2] === 't' &&\n    value[3] === 'p' &&\n    (\n      value[4] === ':' ||\n      (\n        value[4] === 's' &&\n        value[5] === ':'\n      )\n    )\n  )\n}\n\nfunction parseURL (url) {\n  if (typeof url === 'string') {\n    url = new URL(url)\n\n    if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n      throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n    }\n\n    return url\n  }\n\n  if (!url || typeof url !== 'object') {\n    throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')\n  }\n\n  if (!(url instanceof URL)) {\n    if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {\n      throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')\n    }\n\n    if (url.path != null && typeof url.path !== 'string') {\n      throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')\n    }\n\n    if (url.pathname != null && typeof url.pathname !== 'string') {\n      throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')\n    }\n\n    if (url.hostname != null && typeof url.hostname !== 'string') {\n      throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')\n    }\n\n    if (url.origin != null && typeof url.origin !== 'string') {\n      throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')\n    }\n\n    if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n      throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n    }\n\n    const port = url.port != null\n      ? url.port\n      : (url.protocol === 'https:' ? 443 : 80)\n    let origin = url.origin != null\n      ? url.origin\n      : `${url.protocol || ''}//${url.hostname || ''}:${port}`\n    let path = url.path != null\n      ? url.path\n      : `${url.pathname || ''}${url.search || ''}`\n\n    if (origin[origin.length - 1] === '/') {\n      origin = origin.slice(0, origin.length - 1)\n    }\n\n    if (path && path[0] !== '/') {\n      path = `/${path}`\n    }\n    // new URL(path, origin) is unsafe when `path` contains an absolute URL\n    // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:\n    // If first parameter is a relative URL, second param is required, and will be used as the base URL.\n    // If first parameter is an absolute URL, a given second param will be ignored.\n    return new URL(`${origin}${path}`)\n  }\n\n  if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n    throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n  }\n\n  return url\n}\n\nfunction parseOrigin (url) {\n  url = parseURL(url)\n\n  if (url.pathname !== '/' || url.search || url.hash) {\n    throw new InvalidArgumentError('invalid url')\n  }\n\n  return url\n}\n\nfunction getHostname (host) {\n  if (host[0] === '[') {\n    const idx = host.indexOf(']')\n\n    assert(idx !== -1)\n    return host.substring(1, idx)\n  }\n\n  const idx = host.indexOf(':')\n  if (idx === -1) return host\n\n  return host.substring(0, idx)\n}\n\n// IP addresses are not valid server names per RFC6066\n// > Currently, the only server names supported are DNS hostnames\nfunction getServerName (host) {\n  if (!host) {\n    return null\n  }\n\n  assert(typeof host === 'string')\n\n  const servername = getHostname(host)\n  if (net.isIP(servername)) {\n    return ''\n  }\n\n  return servername\n}\n\nfunction deepClone (obj) {\n  return JSON.parse(JSON.stringify(obj))\n}\n\nfunction isAsyncIterable (obj) {\n  return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')\n}\n\nfunction isIterable (obj) {\n  return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))\n}\n\nfunction bodyLength (body) {\n  if (body == null) {\n    return 0\n  } else if (isStream(body)) {\n    const state = body._readableState\n    return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)\n      ? state.length\n      : null\n  } else if (isBlobLike(body)) {\n    return body.size != null ? body.size : null\n  } else if (isBuffer(body)) {\n    return body.byteLength\n  }\n\n  return null\n}\n\nfunction isDestroyed (body) {\n  return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))\n}\n\nfunction destroy (stream, err) {\n  if (stream == null || !isStream(stream) || isDestroyed(stream)) {\n    return\n  }\n\n  if (typeof stream.destroy === 'function') {\n    if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {\n      // See: https://github.com/nodejs/node/pull/38505/files\n      stream.socket = null\n    }\n\n    stream.destroy(err)\n  } else if (err) {\n    queueMicrotask(() => {\n      stream.emit('error', err)\n    })\n  }\n\n  if (stream.destroyed !== true) {\n    stream[kDestroyed] = true\n  }\n}\n\nconst KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/\nfunction parseKeepAliveTimeout (val) {\n  const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)\n  return m ? parseInt(m[1], 10) * 1000 : null\n}\n\n/**\n * Retrieves a header name and returns its lowercase value.\n * @param {string | Buffer} value Header name\n * @returns {string}\n */\nfunction headerNameToString (value) {\n  return typeof value === 'string'\n    ? headerNameLowerCasedRecord[value] ?? value.toLowerCase()\n    : tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * Receive the buffer as a string and return its lowercase value.\n * @param {Buffer} value Header name\n * @returns {string}\n */\nfunction bufferToLowerCasedHeaderName (value) {\n  return tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers\n * @param {Record} [obj]\n * @returns {Record}\n */\nfunction parseHeaders (headers, obj) {\n  if (obj === undefined) obj = {}\n  for (let i = 0; i < headers.length; i += 2) {\n    const key = headerNameToString(headers[i])\n    let val = obj[key]\n\n    if (val) {\n      if (typeof val === 'string') {\n        val = [val]\n        obj[key] = val\n      }\n      val.push(headers[i + 1].toString('utf8'))\n    } else {\n      const headersValue = headers[i + 1]\n      if (typeof headersValue === 'string') {\n        obj[key] = headersValue\n      } else {\n        obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')\n      }\n    }\n  }\n\n  // See https://github.com/nodejs/node/pull/46528\n  if ('content-length' in obj && 'content-disposition' in obj) {\n    obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')\n  }\n\n  return obj\n}\n\nfunction parseRawHeaders (headers) {\n  const len = headers.length\n  const ret = new Array(len)\n\n  let hasContentLength = false\n  let contentDispositionIdx = -1\n  let key\n  let val\n  let kLen = 0\n\n  for (let n = 0; n < headers.length; n += 2) {\n    key = headers[n]\n    val = headers[n + 1]\n\n    typeof key !== 'string' && (key = key.toString())\n    typeof val !== 'string' && (val = val.toString('utf8'))\n\n    kLen = key.length\n    if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {\n      hasContentLength = true\n    } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {\n      contentDispositionIdx = n + 1\n    }\n    ret[n] = key\n    ret[n + 1] = val\n  }\n\n  // See https://github.com/nodejs/node/pull/46528\n  if (hasContentLength && contentDispositionIdx !== -1) {\n    ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')\n  }\n\n  return ret\n}\n\nfunction isBuffer (buffer) {\n  // See, https://github.com/mcollina/undici/pull/319\n  return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)\n}\n\nfunction validateHandler (handler, method, upgrade) {\n  if (!handler || typeof handler !== 'object') {\n    throw new InvalidArgumentError('handler must be an object')\n  }\n\n  if (typeof handler.onConnect !== 'function') {\n    throw new InvalidArgumentError('invalid onConnect method')\n  }\n\n  if (typeof handler.onError !== 'function') {\n    throw new InvalidArgumentError('invalid onError method')\n  }\n\n  if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {\n    throw new InvalidArgumentError('invalid onBodySent method')\n  }\n\n  if (upgrade || method === 'CONNECT') {\n    if (typeof handler.onUpgrade !== 'function') {\n      throw new InvalidArgumentError('invalid onUpgrade method')\n    }\n  } else {\n    if (typeof handler.onHeaders !== 'function') {\n      throw new InvalidArgumentError('invalid onHeaders method')\n    }\n\n    if (typeof handler.onData !== 'function') {\n      throw new InvalidArgumentError('invalid onData method')\n    }\n\n    if (typeof handler.onComplete !== 'function') {\n      throw new InvalidArgumentError('invalid onComplete method')\n    }\n  }\n}\n\n// A body is disturbed if it has been read from and it cannot\n// be re-used without losing state or data.\nfunction isDisturbed (body) {\n  // TODO (fix): Why is body[kBodyUsed] needed?\n  return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))\n}\n\nfunction isErrored (body) {\n  return !!(body && stream.isErrored(body))\n}\n\nfunction isReadable (body) {\n  return !!(body && stream.isReadable(body))\n}\n\nfunction getSocketInfo (socket) {\n  return {\n    localAddress: socket.localAddress,\n    localPort: socket.localPort,\n    remoteAddress: socket.remoteAddress,\n    remotePort: socket.remotePort,\n    remoteFamily: socket.remoteFamily,\n    timeout: socket.timeout,\n    bytesWritten: socket.bytesWritten,\n    bytesRead: socket.bytesRead\n  }\n}\n\n/** @type {globalThis['ReadableStream']} */\nfunction ReadableStreamFrom (iterable) {\n  // We cannot use ReadableStream.from here because it does not return a byte stream.\n\n  let iterator\n  return new ReadableStream(\n    {\n      async start () {\n        iterator = iterable[Symbol.asyncIterator]()\n      },\n      async pull (controller) {\n        const { done, value } = await iterator.next()\n        if (done) {\n          queueMicrotask(() => {\n            controller.close()\n            controller.byobRequest?.respond(0)\n          })\n        } else {\n          const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)\n          if (buf.byteLength) {\n            controller.enqueue(new Uint8Array(buf))\n          }\n        }\n        return controller.desiredSize > 0\n      },\n      async cancel (reason) {\n        await iterator.return()\n      },\n      type: 'bytes'\n    }\n  )\n}\n\n// The chunk should be a FormData instance and contains\n// all the required methods.\nfunction isFormDataLike (object) {\n  return (\n    object &&\n    typeof object === 'object' &&\n    typeof object.append === 'function' &&\n    typeof object.delete === 'function' &&\n    typeof object.get === 'function' &&\n    typeof object.getAll === 'function' &&\n    typeof object.has === 'function' &&\n    typeof object.set === 'function' &&\n    object[Symbol.toStringTag] === 'FormData'\n  )\n}\n\nfunction addAbortListener (signal, listener) {\n  if ('addEventListener' in signal) {\n    signal.addEventListener('abort', listener, { once: true })\n    return () => signal.removeEventListener('abort', listener)\n  }\n  signal.addListener('abort', listener)\n  return () => signal.removeListener('abort', listener)\n}\n\nconst hasToWellFormed = typeof String.prototype.toWellFormed === 'function'\nconst hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'\n\n/**\n * @param {string} val\n */\nfunction toUSVString (val) {\n  return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)\n}\n\n/**\n * @param {string} val\n */\n// TODO: move this to webidl\nfunction isUSVString (val) {\n  return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`\n}\n\n/**\n * @see https://tools.ietf.org/html/rfc7230#section-3.2.6\n * @param {number} c\n */\nfunction isTokenCharCode (c) {\n  switch (c) {\n    case 0x22:\n    case 0x28:\n    case 0x29:\n    case 0x2c:\n    case 0x2f:\n    case 0x3a:\n    case 0x3b:\n    case 0x3c:\n    case 0x3d:\n    case 0x3e:\n    case 0x3f:\n    case 0x40:\n    case 0x5b:\n    case 0x5c:\n    case 0x5d:\n    case 0x7b:\n    case 0x7d:\n      // DQUOTE and \"(),/:;<=>?@[\\]{}\"\n      return false\n    default:\n      // VCHAR %x21-7E\n      return c >= 0x21 && c <= 0x7e\n  }\n}\n\n/**\n * @param {string} characters\n */\nfunction isValidHTTPToken (characters) {\n  if (characters.length === 0) {\n    return false\n  }\n  for (let i = 0; i < characters.length; ++i) {\n    if (!isTokenCharCode(characters.charCodeAt(i))) {\n      return false\n    }\n  }\n  return true\n}\n\n// headerCharRegex have been lifted from\n// https://github.com/nodejs/node/blob/main/lib/_http_common.js\n\n/**\n * Matches if val contains an invalid field-vchar\n *  field-value    = *( field-content / obs-fold )\n *  field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n *  field-vchar    = VCHAR / obs-text\n */\nconst headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/\n\n/**\n * @param {string} characters\n */\nfunction isValidHeaderValue (characters) {\n  return !headerCharRegex.test(characters)\n}\n\n// Parsed accordingly to RFC 9110\n// https://www.rfc-editor.org/rfc/rfc9110#field.content-range\nfunction parseRangeHeader (range) {\n  if (range == null || range === '') return { start: 0, end: null, size: null }\n\n  const m = range ? range.match(/^bytes (\\d+)-(\\d+)\\/(\\d+)?$/) : null\n  return m\n    ? {\n        start: parseInt(m[1]),\n        end: m[2] ? parseInt(m[2]) : null,\n        size: m[3] ? parseInt(m[3]) : null\n      }\n    : null\n}\n\nfunction addListener (obj, name, listener) {\n  const listeners = (obj[kListeners] ??= [])\n  listeners.push([name, listener])\n  obj.on(name, listener)\n  return obj\n}\n\nfunction removeAllListeners (obj) {\n  for (const [name, listener] of obj[kListeners] ?? []) {\n    obj.removeListener(name, listener)\n  }\n  obj[kListeners] = null\n}\n\nfunction errorRequest (client, request, err) {\n  try {\n    request.onError(err)\n    assert(request.aborted)\n  } catch (err) {\n    client.emit('error', err)\n  }\n}\n\nconst kEnumerableProperty = Object.create(null)\nkEnumerableProperty.enumerable = true\n\nconst normalizedMethodRecordsBase = {\n  delete: 'DELETE',\n  DELETE: 'DELETE',\n  get: 'GET',\n  GET: 'GET',\n  head: 'HEAD',\n  HEAD: 'HEAD',\n  options: 'OPTIONS',\n  OPTIONS: 'OPTIONS',\n  post: 'POST',\n  POST: 'POST',\n  put: 'PUT',\n  PUT: 'PUT'\n}\n\nconst normalizedMethodRecords = {\n  ...normalizedMethodRecordsBase,\n  patch: 'patch',\n  PATCH: 'PATCH'\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(normalizedMethodRecordsBase, null)\nObject.setPrototypeOf(normalizedMethodRecords, null)\n\nmodule.exports = {\n  kEnumerableProperty,\n  nop,\n  isDisturbed,\n  isErrored,\n  isReadable,\n  toUSVString,\n  isUSVString,\n  isBlobLike,\n  parseOrigin,\n  parseURL,\n  getServerName,\n  isStream,\n  isIterable,\n  isAsyncIterable,\n  isDestroyed,\n  headerNameToString,\n  bufferToLowerCasedHeaderName,\n  addListener,\n  removeAllListeners,\n  errorRequest,\n  parseRawHeaders,\n  parseHeaders,\n  parseKeepAliveTimeout,\n  destroy,\n  bodyLength,\n  deepClone,\n  ReadableStreamFrom,\n  isBuffer,\n  validateHandler,\n  getSocketInfo,\n  isFormDataLike,\n  buildURL,\n  addAbortListener,\n  isValidHTTPToken,\n  isValidHeaderValue,\n  isTokenCharCode,\n  parseRangeHeader,\n  normalizedMethodRecordsBase,\n  normalizedMethodRecords,\n  isValidPort,\n  isHttpOrHttpsPrefixed,\n  nodeMajor,\n  nodeMinor,\n  safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],\n  wrapRequestBody\n}\n","'use strict'\n\nconst { InvalidArgumentError } = require('../core/errors')\nconst { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst DispatcherBase = require('./dispatcher-base')\nconst Pool = require('./pool')\nconst Client = require('./client')\nconst util = require('../core/util')\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor')\n\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kMaxRedirections = Symbol('maxRedirections')\nconst kOnDrain = Symbol('onDrain')\nconst kFactory = Symbol('factory')\nconst kOptions = Symbol('options')\n\nfunction defaultFactory (origin, opts) {\n  return opts && opts.connections === 1\n    ? new Client(origin, opts)\n    : new Pool(origin, opts)\n}\n\nclass Agent extends DispatcherBase {\n  constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    super(options)\n\n    if (connect && typeof connect !== 'function') {\n      connect = { ...connect }\n    }\n\n    this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)\n      ? options.interceptors.Agent\n      : [createRedirectInterceptor({ maxRedirections })]\n\n    this[kOptions] = { ...util.deepClone(options), connect }\n    this[kOptions].interceptors = options.interceptors\n      ? { ...options.interceptors }\n      : undefined\n    this[kMaxRedirections] = maxRedirections\n    this[kFactory] = factory\n    this[kClients] = new Map()\n\n    this[kOnDrain] = (origin, targets) => {\n      this.emit('drain', origin, [this, ...targets])\n    }\n\n    this[kOnConnect] = (origin, targets) => {\n      this.emit('connect', origin, [this, ...targets])\n    }\n\n    this[kOnDisconnect] = (origin, targets, err) => {\n      this.emit('disconnect', origin, [this, ...targets], err)\n    }\n\n    this[kOnConnectionError] = (origin, targets, err) => {\n      this.emit('connectionError', origin, [this, ...targets], err)\n    }\n  }\n\n  get [kRunning] () {\n    let ret = 0\n    for (const client of this[kClients].values()) {\n      ret += client[kRunning]\n    }\n    return ret\n  }\n\n  [kDispatch] (opts, handler) {\n    let key\n    if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {\n      key = String(opts.origin)\n    } else {\n      throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')\n    }\n\n    let dispatcher = this[kClients].get(key)\n\n    if (!dispatcher) {\n      dispatcher = this[kFactory](opts.origin, this[kOptions])\n        .on('drain', this[kOnDrain])\n        .on('connect', this[kOnConnect])\n        .on('disconnect', this[kOnDisconnect])\n        .on('connectionError', this[kOnConnectionError])\n\n      // This introduces a tiny memory leak, as dispatchers are never removed from the map.\n      // TODO(mcollina): remove te timer when the client/pool do not have any more\n      // active connections.\n      this[kClients].set(key, dispatcher)\n    }\n\n    return dispatcher.dispatch(opts, handler)\n  }\n\n  async [kClose] () {\n    const closePromises = []\n    for (const client of this[kClients].values()) {\n      closePromises.push(client.close())\n    }\n    this[kClients].clear()\n\n    await Promise.all(closePromises)\n  }\n\n  async [kDestroy] (err) {\n    const destroyPromises = []\n    for (const client of this[kClients].values()) {\n      destroyPromises.push(client.destroy(err))\n    }\n    this[kClients].clear()\n\n    await Promise.all(destroyPromises)\n  }\n}\n\nmodule.exports = Agent\n","'use strict'\n\nconst {\n  BalancedPoolMissingUpstreamError,\n  InvalidArgumentError\n} = require('../core/errors')\nconst {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kRemoveClient,\n  kGetDispatcher\n} = require('./pool-base')\nconst Pool = require('./pool')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst { parseOrigin } = require('../core/util')\nconst kFactory = Symbol('factory')\n\nconst kOptions = Symbol('options')\nconst kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')\nconst kCurrentWeight = Symbol('kCurrentWeight')\nconst kIndex = Symbol('kIndex')\nconst kWeight = Symbol('kWeight')\nconst kMaxWeightPerServer = Symbol('kMaxWeightPerServer')\nconst kErrorPenalty = Symbol('kErrorPenalty')\n\n/**\n * Calculate the greatest common divisor of two numbers by\n * using the Euclidean algorithm.\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction getGreatestCommonDivisor (a, b) {\n  if (a === 0) return b\n\n  while (b !== 0) {\n    const t = b\n    b = a % b\n    a = t\n  }\n  return a\n}\n\nfunction defaultFactory (origin, opts) {\n  return new Pool(origin, opts)\n}\n\nclass BalancedPool extends PoolBase {\n  constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {\n    super()\n\n    this[kOptions] = opts\n    this[kIndex] = -1\n    this[kCurrentWeight] = 0\n\n    this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100\n    this[kErrorPenalty] = this[kOptions].errorPenalty || 15\n\n    if (!Array.isArray(upstreams)) {\n      upstreams = [upstreams]\n    }\n\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)\n      ? opts.interceptors.BalancedPool\n      : []\n    this[kFactory] = factory\n\n    for (const upstream of upstreams) {\n      this.addUpstream(upstream)\n    }\n    this._updateBalancedPoolStats()\n  }\n\n  addUpstream (upstream) {\n    const upstreamOrigin = parseOrigin(upstream).origin\n\n    if (this[kClients].find((pool) => (\n      pool[kUrl].origin === upstreamOrigin &&\n      pool.closed !== true &&\n      pool.destroyed !== true\n    ))) {\n      return this\n    }\n    const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))\n\n    this[kAddClient](pool)\n    pool.on('connect', () => {\n      pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])\n    })\n\n    pool.on('connectionError', () => {\n      pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n      this._updateBalancedPoolStats()\n    })\n\n    pool.on('disconnect', (...args) => {\n      const err = args[2]\n      if (err && err.code === 'UND_ERR_SOCKET') {\n        // decrease the weight of the pool.\n        pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n        this._updateBalancedPoolStats()\n      }\n    })\n\n    for (const client of this[kClients]) {\n      client[kWeight] = this[kMaxWeightPerServer]\n    }\n\n    this._updateBalancedPoolStats()\n\n    return this\n  }\n\n  _updateBalancedPoolStats () {\n    let result = 0\n    for (let i = 0; i < this[kClients].length; i++) {\n      result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)\n    }\n\n    this[kGreatestCommonDivisor] = result\n  }\n\n  removeUpstream (upstream) {\n    const upstreamOrigin = parseOrigin(upstream).origin\n\n    const pool = this[kClients].find((pool) => (\n      pool[kUrl].origin === upstreamOrigin &&\n      pool.closed !== true &&\n      pool.destroyed !== true\n    ))\n\n    if (pool) {\n      this[kRemoveClient](pool)\n    }\n\n    return this\n  }\n\n  get upstreams () {\n    return this[kClients]\n      .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)\n      .map((p) => p[kUrl].origin)\n  }\n\n  [kGetDispatcher] () {\n    // We validate that pools is greater than 0,\n    // otherwise we would have to wait until an upstream\n    // is added, which might never happen.\n    if (this[kClients].length === 0) {\n      throw new BalancedPoolMissingUpstreamError()\n    }\n\n    const dispatcher = this[kClients].find(dispatcher => (\n      !dispatcher[kNeedDrain] &&\n      dispatcher.closed !== true &&\n      dispatcher.destroyed !== true\n    ))\n\n    if (!dispatcher) {\n      return\n    }\n\n    const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)\n\n    if (allClientsBusy) {\n      return\n    }\n\n    let counter = 0\n\n    let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])\n\n    while (counter++ < this[kClients].length) {\n      this[kIndex] = (this[kIndex] + 1) % this[kClients].length\n      const pool = this[kClients][this[kIndex]]\n\n      // find pool index with the largest weight\n      if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {\n        maxWeightIndex = this[kIndex]\n      }\n\n      // decrease the current weight every `this[kClients].length`.\n      if (this[kIndex] === 0) {\n        // Set the current weight to the next lower weight.\n        this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]\n\n        if (this[kCurrentWeight] <= 0) {\n          this[kCurrentWeight] = this[kMaxWeightPerServer]\n        }\n      }\n      if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {\n        return pool\n      }\n    }\n\n    this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]\n    this[kIndex] = maxWeightIndex\n    return this[kClients][maxWeightIndex]\n  }\n}\n\nmodule.exports = BalancedPool\n","'use strict'\n\n/* global WebAssembly */\n\nconst assert = require('node:assert')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst timers = require('../util/timers.js')\nconst {\n  RequestContentLengthMismatchError,\n  ResponseContentLengthMismatchError,\n  RequestAbortedError,\n  HeadersTimeoutError,\n  HeadersOverflowError,\n  SocketError,\n  InformationalError,\n  BodyTimeoutError,\n  HTTPParserError,\n  ResponseExceededMaxSizeError\n} = require('../core/errors.js')\nconst {\n  kUrl,\n  kReset,\n  kClient,\n  kParser,\n  kBlocking,\n  kRunning,\n  kPending,\n  kSize,\n  kWriting,\n  kQueue,\n  kNoRef,\n  kKeepAliveDefaultTimeout,\n  kHostHeader,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kPipelining,\n  kSocket,\n  kKeepAliveTimeoutValue,\n  kMaxHeadersSize,\n  kKeepAliveMaxTimeout,\n  kKeepAliveTimeoutThreshold,\n  kHeadersTimeout,\n  kBodyTimeout,\n  kStrictContentLength,\n  kMaxRequests,\n  kCounter,\n  kMaxResponseSize,\n  kOnError,\n  kResume,\n  kHTTPContext\n} = require('../core/symbols.js')\n\nconst constants = require('../llhttp/constants.js')\nconst EMPTY_BUF = Buffer.alloc(0)\nconst FastBuffer = Buffer[Symbol.species]\nconst addListener = util.addListener\nconst removeAllListeners = util.removeAllListeners\nconst kIdleSocketValidation = Symbol('kIdleSocketValidation')\nconst kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout')\nconst kSocketUsed = Symbol('kSocketUsed')\n\nlet extractBody\n\nasync function lazyllhttp () {\n  const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined\n\n  let mod\n  try {\n    mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js'))\n  } catch (e) {\n    /* istanbul ignore next */\n\n    // We could check if the error was caused by the simd option not\n    // being enabled, but the occurring of this other error\n    // * https://github.com/emscripten-core/emscripten/issues/11495\n    // got me to remove that check to avoid breaking Node 12.\n    mod = await WebAssembly.compile(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))\n  }\n\n  return await WebAssembly.instantiate(mod, {\n    env: {\n      /* eslint-disable camelcase */\n\n      wasm_on_url: (p, at, len) => {\n        /* istanbul ignore next */\n        return 0\n      },\n      wasm_on_status: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_message_begin: (p) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onMessageBegin() || 0\n      },\n      wasm_on_header_field: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_header_value: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0\n      },\n      wasm_on_body: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_message_complete: (p) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onMessageComplete() || 0\n      }\n\n      /* eslint-enable camelcase */\n    }\n  })\n}\n\nlet llhttpInstance = null\nlet llhttpPromise = lazyllhttp()\nllhttpPromise.catch()\n\nlet currentParser = null\nlet currentBufferRef = null\nlet currentBufferSize = 0\nlet currentBufferPtr = null\n\nconst USE_NATIVE_TIMER = 0\nconst USE_FAST_TIMER = 1\n\n// Use fast timers for headers and body to take eventual event loop\n// latency into account.\nconst TIMEOUT_HEADERS = 2 | USE_FAST_TIMER\nconst TIMEOUT_BODY = 4 | USE_FAST_TIMER\n\n// Use native timers to ignore event loop latency for keep-alive\n// handling.\nconst TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER\n\nclass Parser {\n  constructor (client, socket, { exports }) {\n    assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)\n\n    this.llhttp = exports\n    this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)\n    this.client = client\n    this.socket = socket\n    this.timeout = null\n    this.timeoutValue = null\n    this.timeoutType = null\n    this.statusCode = null\n    this.statusText = ''\n    this.upgrade = false\n    this.headers = []\n    this.headersSize = 0\n    this.headersMaxSize = client[kMaxHeadersSize]\n    this.shouldKeepAlive = false\n    this.paused = false\n    this.resume = this.resume.bind(this)\n\n    this.bytesRead = 0\n\n    this.keepAlive = ''\n    this.contentLength = ''\n    this.connection = ''\n    this.maxResponseSize = client[kMaxResponseSize]\n  }\n\n  setTimeout (delay, type) {\n    // If the existing timer and the new timer are of different timer type\n    // (fast or native) or have different delay, we need to clear the existing\n    // timer and set a new one.\n    if (\n      delay !== this.timeoutValue ||\n      (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)\n    ) {\n      // If a timeout is already set, clear it with clearTimeout of the fast\n      // timer implementation, as it can clear fast and native timers.\n      if (this.timeout) {\n        timers.clearTimeout(this.timeout)\n        this.timeout = null\n      }\n\n      if (delay) {\n        if (type & USE_FAST_TIMER) {\n          this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this))\n        } else {\n          this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this))\n          this.timeout.unref()\n        }\n      }\n\n      this.timeoutValue = delay\n    } else if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    this.timeoutType = type\n  }\n\n  resume () {\n    if (this.socket.destroyed || !this.paused) {\n      return\n    }\n\n    assert(this.ptr != null)\n    assert(currentParser == null)\n\n    this.llhttp.llhttp_resume(this.ptr)\n\n    assert(this.timeoutType === TIMEOUT_BODY)\n    if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    this.paused = false\n    this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.\n    this.readMore()\n  }\n\n  readMore () {\n    while (!this.paused && this.ptr) {\n      const chunk = this.socket.read()\n      if (chunk === null) {\n        break\n      }\n      this.execute(chunk)\n    }\n  }\n\n  execute (data) {\n    assert(this.ptr != null)\n    assert(currentParser == null)\n    assert(!this.paused)\n\n    const { socket, llhttp } = this\n\n    if (data.length > currentBufferSize) {\n      if (currentBufferPtr) {\n        llhttp.free(currentBufferPtr)\n      }\n      currentBufferSize = Math.ceil(data.length / 4096) * 4096\n      currentBufferPtr = llhttp.malloc(currentBufferSize)\n    }\n\n    new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)\n\n    // Call `execute` on the wasm parser.\n    // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,\n    // and finally the length of bytes to parse.\n    // The return value is an error code or `constants.ERROR.OK`.\n    try {\n      let ret\n\n      try {\n        currentBufferRef = data\n        currentParser = this\n        ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)\n        /* eslint-disable-next-line no-useless-catch */\n      } catch (err) {\n        /* istanbul ignore next: difficult to make a test case for */\n        throw err\n      } finally {\n        currentParser = null\n        currentBufferRef = null\n      }\n\n      const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr\n\n      if (ret !== constants.ERROR.OK) {\n        const body = data.subarray(offset)\n\n        if (ret === constants.ERROR.PAUSED_UPGRADE) {\n          this.onUpgrade(body)\n        } else if (ret === constants.ERROR.PAUSED) {\n          this.paused = true\n          socket.unshift(body)\n        } else {\n          throw this.createError(ret, body)\n        }\n      }\n    } catch (err) {\n      util.destroy(socket, err)\n    }\n  }\n\n  finish () {\n    assert(currentParser === null)\n    assert(this.ptr != null)\n    assert(!this.paused)\n\n    const { llhttp } = this\n\n    let ret\n\n    try {\n      currentParser = this\n      ret = llhttp.llhttp_finish(this.ptr)\n    } finally {\n      currentParser = null\n    }\n\n    if (ret === constants.ERROR.OK) {\n      return null\n    }\n\n    if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {\n      this.paused = true\n      return null\n    }\n\n    return this.createError(ret, EMPTY_BUF)\n  }\n\n  createError (ret, data) {\n    const { llhttp, contentLength, bytesRead } = this\n\n    if (contentLength && bytesRead !== parseInt(contentLength, 10)) {\n      return new ResponseContentLengthMismatchError()\n    }\n\n    const ptr = llhttp.llhttp_get_error_reason(this.ptr)\n    let message = ''\n    if (ptr) {\n      const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)\n      message =\n        'Response does not match the HTTP/1.1 protocol (' +\n        Buffer.from(llhttp.memory.buffer, ptr, len).toString() +\n        ')'\n    }\n\n    return new HTTPParserError(message, constants.ERROR[ret], data)\n  }\n\n  destroy () {\n    assert(this.ptr != null)\n    assert(currentParser == null)\n\n    this.llhttp.llhttp_free(this.ptr)\n    this.ptr = null\n\n    this.timeout && timers.clearTimeout(this.timeout)\n    this.timeout = null\n    this.timeoutValue = null\n    this.timeoutType = null\n\n    this.paused = false\n  }\n\n  onStatus (buf) {\n    this.statusText = buf.toString()\n  }\n\n  onMessageBegin () {\n    const { socket, client } = this\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (socket.destroyed) {\n      return -1\n    }\n\n    if (client[kRunning] === 0) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n    if (!request) {\n      return -1\n    }\n    request.onResponseStarted()\n  }\n\n  onHeaderField (buf) {\n    const len = this.headers.length\n\n    if ((len & 1) === 0) {\n      this.headers.push(buf)\n    } else {\n      this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n    }\n\n    this.trackHeader(buf.length)\n  }\n\n  onHeaderValue (buf) {\n    let len = this.headers.length\n\n    if ((len & 1) === 1) {\n      this.headers.push(buf)\n      len += 1\n    } else {\n      this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n    }\n\n    const key = this.headers[len - 2]\n    if (key.length === 10) {\n      const headerName = util.bufferToLowerCasedHeaderName(key)\n      if (headerName === 'keep-alive') {\n        this.keepAlive += buf.toString()\n      } else if (headerName === 'connection') {\n        this.connection += buf.toString()\n      }\n    } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {\n      this.contentLength += buf.toString()\n    }\n\n    this.trackHeader(buf.length)\n  }\n\n  trackHeader (len) {\n    this.headersSize += len\n    if (this.headersSize >= this.headersMaxSize) {\n      util.destroy(this.socket, new HeadersOverflowError())\n    }\n  }\n\n  onUpgrade (head) {\n    const { upgrade, client, socket, headers, statusCode } = this\n\n    assert(upgrade)\n    assert(client[kSocket] === socket)\n    assert(!socket.destroyed)\n    assert(!this.paused)\n    assert((headers.length & 1) === 0)\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n    assert(request.upgrade || request.method === 'CONNECT')\n\n    this.statusCode = null\n    this.statusText = ''\n    this.shouldKeepAlive = null\n\n    this.headers = []\n    this.headersSize = 0\n\n    socket.unshift(head)\n\n    socket[kParser].destroy()\n    socket[kParser] = null\n\n    socket[kClient] = null\n    socket[kError] = null\n\n    removeAllListeners(socket)\n\n    client[kSocket] = null\n    client[kHTTPContext] = null // TODO (fix): This is hacky...\n    client[kQueue][client[kRunningIdx]++] = null\n    client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))\n\n    try {\n      request.onUpgrade(statusCode, headers, socket)\n    } catch (err) {\n      util.destroy(socket, err)\n    }\n\n    client[kResume]()\n  }\n\n  onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {\n    const { client, socket, headers, statusText } = this\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (socket.destroyed) {\n      return -1\n    }\n\n    if (client[kRunning] === 0) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (!request) {\n      return -1\n    }\n\n    assert(!this.upgrade)\n    assert(this.statusCode < 200)\n\n    if (statusCode === 100) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    /* this can only happen if server is misbehaving */\n    if (upgrade && !request.upgrade) {\n      util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    assert(this.timeoutType === TIMEOUT_HEADERS)\n\n    this.statusCode = statusCode\n    this.shouldKeepAlive = (\n      shouldKeepAlive ||\n      // Override llhttp value which does not allow keepAlive for HEAD.\n      (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')\n    )\n\n    if (this.statusCode >= 200) {\n      const bodyTimeout = request.bodyTimeout != null\n        ? request.bodyTimeout\n        : client[kBodyTimeout]\n      this.setTimeout(bodyTimeout, TIMEOUT_BODY)\n    } else if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    if (request.method === 'CONNECT') {\n      assert(client[kRunning] === 1)\n      this.upgrade = true\n      return 2\n    }\n\n    if (upgrade) {\n      assert(client[kRunning] === 1)\n      this.upgrade = true\n      return 2\n    }\n\n    assert((this.headers.length & 1) === 0)\n    this.headers = []\n    this.headersSize = 0\n\n    if (this.shouldKeepAlive && client[kPipelining]) {\n      const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null\n\n      if (keepAliveTimeout != null) {\n        const timeout = Math.min(\n          keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n          client[kKeepAliveMaxTimeout]\n        )\n        if (timeout <= 0) {\n          socket[kReset] = true\n        } else {\n          client[kKeepAliveTimeoutValue] = timeout\n        }\n      } else {\n        client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]\n      }\n    } else {\n      // Stop more requests from being dispatched.\n      socket[kReset] = true\n    }\n\n    const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false\n\n    if (request.aborted) {\n      return -1\n    }\n\n    if (request.method === 'HEAD') {\n      return 1\n    }\n\n    if (statusCode < 200) {\n      return 1\n    }\n\n    if (socket[kBlocking]) {\n      socket[kBlocking] = false\n      client[kResume]()\n    }\n\n    return pause ? constants.ERROR.PAUSED : 0\n  }\n\n  onBody (buf) {\n    const { client, socket, statusCode, maxResponseSize } = this\n\n    if (socket.destroyed) {\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n\n    assert(this.timeoutType === TIMEOUT_BODY)\n    if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    assert(statusCode >= 200)\n\n    if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n      util.destroy(socket, new ResponseExceededMaxSizeError())\n      return -1\n    }\n\n    this.bytesRead += buf.length\n\n    if (request.onData(buf) === false) {\n      return constants.ERROR.PAUSED\n    }\n  }\n\n  onMessageComplete () {\n    const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this\n\n    if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n      return -1\n    }\n\n    if (upgrade) {\n      return\n    }\n\n    assert(statusCode >= 100)\n    assert((this.headers.length & 1) === 0)\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n\n    this.statusCode = null\n    this.statusText = ''\n    this.bytesRead = 0\n    this.contentLength = ''\n    this.keepAlive = ''\n    this.connection = ''\n\n    this.headers = []\n    this.headersSize = 0\n\n    if (statusCode < 200) {\n      return\n    }\n\n    /* istanbul ignore next: should be handled by llhttp? */\n    if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n      util.destroy(socket, new ResponseContentLengthMismatchError())\n      return -1\n    }\n\n    request.onComplete(headers)\n\n    client[kQueue][client[kRunningIdx]++] = null\n    socket[kSocketUsed] = true\n\n    if (socket[kWriting]) {\n      assert(client[kRunning] === 0)\n      // Response completed before request.\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (!shouldKeepAlive) {\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (socket[kReset] && client[kRunning] === 0) {\n      // Destroy socket once all requests have completed.\n      // The request at the tail of the pipeline is the one\n      // that requested reset and no further requests should\n      // have been queued since then.\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (client[kPipelining] == null || client[kPipelining] === 1) {\n      // We must wait a full event loop cycle to reuse this socket to make sure\n      // that non-spec compliant servers are not closing the connection even if they\n      // said they won't.\n      setImmediate(() => client[kResume]())\n    } else {\n      client[kResume]()\n    }\n  }\n}\n\nfunction onParserTimeout (parser) {\n  const { socket, timeoutType, client, paused } = parser.deref()\n\n  /* istanbul ignore else */\n  if (timeoutType === TIMEOUT_HEADERS) {\n    if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n      assert(!paused, 'cannot be paused while waiting for headers')\n      util.destroy(socket, new HeadersTimeoutError())\n    }\n  } else if (timeoutType === TIMEOUT_BODY) {\n    if (!paused) {\n      util.destroy(socket, new BodyTimeoutError())\n    }\n  } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {\n    assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])\n    util.destroy(socket, new InformationalError('socket idle timeout'))\n  }\n}\n\nasync function connectH1 (client, socket) {\n  client[kSocket] = socket\n\n  if (!llhttpInstance) {\n    llhttpInstance = await llhttpPromise\n    llhttpPromise = null\n  }\n\n  socket[kNoRef] = false\n  socket[kWriting] = false\n  socket[kReset] = false\n  socket[kBlocking] = false\n  socket[kIdleSocketValidation] = 0\n  socket[kIdleSocketValidationTimeout] = null\n  socket[kSocketUsed] = false\n  socket[kParser] = new Parser(client, socket, llhttpInstance)\n\n  addListener(socket, 'error', function (err) {\n    assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n    const parser = this[kParser]\n\n    // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded\n    // to the user.\n    if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {\n      const parserErr = parser.finish()\n      if (parserErr) {\n        this[kError] = parserErr\n        this[kClient][kOnError](parserErr)\n      }\n      return\n    }\n\n    this[kError] = err\n\n    this[kClient][kOnError](err)\n  })\n  addListener(socket, 'readable', function () {\n    const parser = this[kParser]\n\n    if (parser) {\n      parser.readMore()\n    }\n  })\n  addListener(socket, 'end', function () {\n    const parser = this[kParser]\n\n    if (parser.statusCode && !parser.shouldKeepAlive) {\n      const parserErr = parser.finish()\n      if (parserErr) {\n        util.destroy(this, parserErr)\n      }\n      return\n    }\n\n    util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n  })\n  addListener(socket, 'close', function () {\n    const client = this[kClient]\n    const parser = this[kParser]\n\n    clearIdleSocketValidation(this)\n\n    if (parser) {\n      if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {\n        this[kError] = parser.finish() || this[kError]\n      }\n\n      this[kParser].destroy()\n      this[kParser] = null\n    }\n\n    const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n    client[kSocket] = null\n    client[kHTTPContext] = null // TODO (fix): This is hacky...\n\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n\n      // Fail entire queue.\n      const requests = client[kQueue].splice(client[kRunningIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(client, request, err)\n      }\n    } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {\n      // Fail head of pipeline.\n      const request = client[kQueue][client[kRunningIdx]]\n      client[kQueue][client[kRunningIdx]++] = null\n\n      util.errorRequest(client, request, err)\n    }\n\n    client[kPendingIdx] = client[kRunningIdx]\n\n    assert(client[kRunning] === 0)\n\n    client.emit('disconnect', client[kUrl], [client], err)\n\n    client[kResume]()\n  })\n\n  let closed = false\n  socket.on('close', () => {\n    closed = true\n  })\n\n  return {\n    version: 'h1',\n    defaultPipelining: 1,\n    write (...args) {\n      return writeH1(client, ...args)\n    },\n    resume () {\n      resumeH1(client)\n    },\n    destroy (err, callback) {\n      if (closed) {\n        queueMicrotask(callback)\n      } else {\n        socket.destroy(err).on('close', callback)\n      }\n    },\n    get destroyed () {\n      return socket.destroyed\n    },\n    busy (request) {\n      if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) {\n        return true\n      }\n\n      if (request) {\n        if (client[kRunning] > 0 && !request.idempotent) {\n          // Non-idempotent request cannot be retried.\n          // Ensure that no other requests are inflight and\n          // could cause failure.\n          return true\n        }\n\n        if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {\n          // Don't dispatch an upgrade until all preceding requests have completed.\n          // A misbehaving server might upgrade the connection before all pipelined\n          // request has completed.\n          return true\n        }\n\n        if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&\n          (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {\n          // Request with stream or iterator body can error while other requests\n          // are inflight and indirectly error those as well.\n          // Ensure this doesn't happen by waiting for inflight\n          // to complete before dispatching.\n\n          // Request with stream or iterator body cannot be retried.\n          // Ensure that no other requests are inflight and\n          // could cause failure.\n          return true\n        }\n      }\n\n      return false\n    }\n  }\n}\n\nfunction clearIdleSocketValidation (socket) {\n  if (socket[kIdleSocketValidationTimeout]) {\n    clearTimeout(socket[kIdleSocketValidationTimeout])\n    socket[kIdleSocketValidationTimeout] = null\n  }\n\n  socket[kIdleSocketValidation] = 0\n}\n\nfunction scheduleIdleSocketValidation (client, socket) {\n  socket[kIdleSocketValidation] = 1\n  socket[kIdleSocketValidationTimeout] = setTimeout(() => {\n    socket[kIdleSocketValidationTimeout] = null\n    socket[kIdleSocketValidation] = 2\n\n    if (client[kSocket] === socket && !socket.destroyed) {\n      client[kResume]()\n    }\n  }, 0)\n  socket[kIdleSocketValidationTimeout].unref?.()\n}\n\n/**\n * @param {import('./client.js')} client\n */\nfunction resumeH1 (client) {\n  const socket = client[kSocket]\n\n  if (socket && !socket.destroyed) {\n    if (client[kSize] === 0) {\n      if (!socket[kNoRef] && socket.unref) {\n        socket.unref()\n        socket[kNoRef] = true\n      }\n    } else if (socket[kNoRef] && socket.ref) {\n      socket.ref()\n      socket[kNoRef] = false\n    }\n\n    if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {\n      if (socket[kIdleSocketValidation] === 0) {\n        scheduleIdleSocketValidation(client, socket)\n        socket[kParser].readMore()\n        if (socket.destroyed) {\n          return\n        }\n        return\n      }\n\n      if (socket[kIdleSocketValidation] === 1) {\n        socket[kParser].readMore()\n        if (socket.destroyed) {\n          return\n        }\n        return\n      }\n    }\n\n    if (client[kRunning] === 0) {\n      socket[kParser].readMore()\n      if (socket.destroyed) {\n        return\n      }\n    }\n\n    if (client[kSize] === 0) {\n      if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {\n        socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)\n      }\n    } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n      if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n        const request = client[kQueue][client[kRunningIdx]]\n        const headersTimeout = request.headersTimeout != null\n          ? request.headersTimeout\n          : client[kHeadersTimeout]\n        socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)\n      }\n    }\n  }\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n  return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH1 (client, request) {\n  const { method, path, host, upgrade, blocking, reset } = request\n\n  let { body, headers, contentLength } = request\n\n  // https://tools.ietf.org/html/rfc7231#section-4.3.1\n  // https://tools.ietf.org/html/rfc7231#section-4.3.2\n  // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n  // Sending a payload body on a request that does not\n  // expect it can cause undefined behavior on some\n  // servers and corrupt connection state. Do not\n  // re-use the connection for further requests.\n\n  const expectsPayload = (\n    method === 'PUT' ||\n    method === 'POST' ||\n    method === 'PATCH' ||\n    method === 'QUERY' ||\n    method === 'PROPFIND' ||\n    method === 'PROPPATCH'\n  )\n\n  if (util.isFormDataLike(body)) {\n    if (!extractBody) {\n      extractBody = require('../web/fetch/body.js').extractBody\n    }\n\n    const [bodyStream, contentType] = extractBody(body)\n    if (request.contentType == null) {\n      headers.push('content-type', contentType)\n    }\n    body = bodyStream.stream\n    contentLength = bodyStream.length\n  } else if (util.isBlobLike(body) && request.contentType == null && body.type) {\n    headers.push('content-type', body.type)\n  }\n\n  if (body && typeof body.read === 'function') {\n    // Try to read EOF in order to get length.\n    body.read(0)\n  }\n\n  const bodyLength = util.bodyLength(body)\n\n  contentLength = bodyLength ?? contentLength\n\n  if (contentLength === null) {\n    contentLength = request.contentLength\n  }\n\n  if (contentLength === 0 && !expectsPayload) {\n    // https://tools.ietf.org/html/rfc7230#section-3.3.2\n    // A user agent SHOULD NOT send a Content-Length header field when\n    // the request message does not contain a payload body and the method\n    // semantics do not anticipate such a body.\n\n    contentLength = null\n  }\n\n  // https://github.com/nodejs/undici/issues/2046\n  // A user agent may send a Content-Length header with 0 value, this should be allowed.\n  if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {\n    if (client[kStrictContentLength]) {\n      util.errorRequest(client, request, new RequestContentLengthMismatchError())\n      return false\n    }\n\n    process.emitWarning(new RequestContentLengthMismatchError())\n  }\n\n  const socket = client[kSocket]\n  clearIdleSocketValidation(socket)\n\n  const abort = (err) => {\n    if (request.aborted || request.completed) {\n      return\n    }\n\n    util.errorRequest(client, request, err || new RequestAbortedError())\n\n    util.destroy(body)\n    util.destroy(socket, new InformationalError('aborted'))\n  }\n\n  try {\n    request.onConnect(abort)\n  } catch (err) {\n    util.errorRequest(client, request, err)\n  }\n\n  if (request.aborted) {\n    return false\n  }\n\n  if (method === 'HEAD') {\n    // https://github.com/mcollina/undici/issues/258\n    // Close after a HEAD request to interop with misbehaving servers\n    // that may send a body in the response.\n\n    socket[kReset] = true\n  }\n\n  if (upgrade || method === 'CONNECT') {\n    // On CONNECT or upgrade, block pipeline from dispatching further\n    // requests on this connection.\n\n    socket[kReset] = true\n  }\n\n  if (reset != null) {\n    socket[kReset] = reset\n  }\n\n  if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n    socket[kReset] = true\n  }\n\n  if (blocking) {\n    socket[kBlocking] = true\n  }\n\n  let header = `${method} ${path} HTTP/1.1\\r\\n`\n\n  if (typeof host === 'string') {\n    header += `host: ${host}\\r\\n`\n  } else {\n    header += client[kHostHeader]\n  }\n\n  if (upgrade) {\n    header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n  } else if (client[kPipelining] && !socket[kReset]) {\n    header += 'connection: keep-alive\\r\\n'\n  } else {\n    header += 'connection: close\\r\\n'\n  }\n\n  if (Array.isArray(headers)) {\n    for (let n = 0; n < headers.length; n += 2) {\n      const key = headers[n + 0]\n      const val = headers[n + 1]\n\n      if (Array.isArray(val)) {\n        for (let i = 0; i < val.length; i++) {\n          header += `${key}: ${val[i]}\\r\\n`\n        }\n      } else {\n        header += `${key}: ${val}\\r\\n`\n      }\n    }\n  }\n\n  if (channels.sendHeaders.hasSubscribers) {\n    channels.sendHeaders.publish({ request, headers: header, socket })\n  }\n\n  /* istanbul ignore else: assertion */\n  if (!body || bodyLength === 0) {\n    writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isBuffer(body)) {\n    writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isBlobLike(body)) {\n    if (typeof body.stream === 'function') {\n      writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)\n    } else {\n      writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)\n    }\n  } else if (util.isStream(body)) {\n    writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isIterable(body)) {\n    writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else {\n    assert(false)\n  }\n\n  return true\n}\n\nfunction writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n  let finished = false\n\n  const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n\n  const onData = function (chunk) {\n    if (finished) {\n      return\n    }\n\n    try {\n      if (!writer.write(chunk) && this.pause) {\n        this.pause()\n      }\n    } catch (err) {\n      util.destroy(this, err)\n    }\n  }\n  const onDrain = function () {\n    if (finished) {\n      return\n    }\n\n    if (body.resume) {\n      body.resume()\n    }\n  }\n  const onClose = function () {\n    // 'close' might be emitted *before* 'error' for\n    // broken streams. Wait a tick to avoid this case.\n    queueMicrotask(() => {\n      // It's only safe to remove 'error' listener after\n      // 'close'.\n      body.removeListener('error', onFinished)\n    })\n\n    if (!finished) {\n      const err = new RequestAbortedError()\n      queueMicrotask(() => onFinished(err))\n    }\n  }\n  const onFinished = function (err) {\n    if (finished) {\n      return\n    }\n\n    finished = true\n\n    assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))\n\n    socket\n      .off('drain', onDrain)\n      .off('error', onFinished)\n\n    body\n      .removeListener('data', onData)\n      .removeListener('end', onFinished)\n      .removeListener('close', onClose)\n\n    if (!err) {\n      try {\n        writer.end()\n      } catch (er) {\n        err = er\n      }\n    }\n\n    writer.destroy(err)\n\n    if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {\n      util.destroy(body, err)\n    } else {\n      util.destroy(body)\n    }\n  }\n\n  body\n    .on('data', onData)\n    .on('end', onFinished)\n    .on('error', onFinished)\n    .on('close', onClose)\n\n  if (body.resume) {\n    body.resume()\n  }\n\n  socket\n    .on('drain', onDrain)\n    .on('error', onFinished)\n\n  if (body.errorEmitted ?? body.errored) {\n    setImmediate(() => onFinished(body.errored))\n  } else if (body.endEmitted ?? body.readableEnded) {\n    setImmediate(() => onFinished(null))\n  }\n\n  if (body.closeEmitted ?? body.closed) {\n    setImmediate(onClose)\n  }\n}\n\nfunction writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  try {\n    if (!body) {\n      if (contentLength === 0) {\n        socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n      } else {\n        assert(contentLength === null, 'no body must not have content length')\n        socket.write(`${header}\\r\\n`, 'latin1')\n      }\n    } else if (util.isBuffer(body)) {\n      assert(contentLength === body.byteLength, 'buffer body must have content length')\n\n      socket.cork()\n      socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n      socket.write(body)\n      socket.uncork()\n      request.onBodySent(body)\n\n      if (!expectsPayload && request.reset !== false) {\n        socket[kReset] = true\n      }\n    }\n    request.onRequestSent()\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength === body.size, 'blob body must have content length')\n\n  try {\n    if (contentLength != null && contentLength !== body.size) {\n      throw new RequestContentLengthMismatchError()\n    }\n\n    const buffer = Buffer.from(await body.arrayBuffer())\n\n    socket.cork()\n    socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n    socket.write(buffer)\n    socket.uncork()\n\n    request.onBodySent(buffer)\n    request.onRequestSent()\n\n    if (!expectsPayload && request.reset !== false) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n  let callback = null\n  function onDrain () {\n    if (callback) {\n      const cb = callback\n      callback = null\n      cb()\n    }\n  }\n\n  const waitForDrain = () => new Promise((resolve, reject) => {\n    assert(callback === null)\n\n    if (socket[kError]) {\n      reject(socket[kError])\n    } else {\n      callback = resolve\n    }\n  })\n\n  socket\n    .on('close', onDrain)\n    .on('drain', onDrain)\n\n  const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n  try {\n    // It's up to the user to somehow abort the async iterable.\n    for await (const chunk of body) {\n      if (socket[kError]) {\n        throw socket[kError]\n      }\n\n      if (!writer.write(chunk)) {\n        await waitForDrain()\n      }\n    }\n\n    writer.end()\n  } catch (err) {\n    writer.destroy(err)\n  } finally {\n    socket\n      .off('close', onDrain)\n      .off('drain', onDrain)\n  }\n}\n\nclass AsyncWriter {\n  constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {\n    this.socket = socket\n    this.request = request\n    this.contentLength = contentLength\n    this.client = client\n    this.bytesWritten = 0\n    this.expectsPayload = expectsPayload\n    this.header = header\n    this.abort = abort\n\n    socket[kWriting] = true\n  }\n\n  write (chunk) {\n    const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this\n\n    if (socket[kError]) {\n      throw socket[kError]\n    }\n\n    if (socket.destroyed) {\n      return false\n    }\n\n    const len = Buffer.byteLength(chunk)\n    if (!len) {\n      return true\n    }\n\n    // We should defer writing chunks.\n    if (contentLength !== null && bytesWritten + len > contentLength) {\n      if (client[kStrictContentLength]) {\n        throw new RequestContentLengthMismatchError()\n      }\n\n      process.emitWarning(new RequestContentLengthMismatchError())\n    }\n\n    socket.cork()\n\n    if (bytesWritten === 0) {\n      if (!expectsPayload && request.reset !== false) {\n        socket[kReset] = true\n      }\n\n      if (contentLength === null) {\n        socket.write(`${header}transfer-encoding: chunked\\r\\n`, 'latin1')\n      } else {\n        socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n      }\n    }\n\n    if (contentLength === null) {\n      socket.write(`\\r\\n${len.toString(16)}\\r\\n`, 'latin1')\n    }\n\n    this.bytesWritten += len\n\n    const ret = socket.write(chunk)\n\n    socket.uncork()\n\n    request.onBodySent(chunk)\n\n    if (!ret) {\n      if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n        // istanbul ignore else: only for jest\n        if (socket[kParser].timeout.refresh) {\n          socket[kParser].timeout.refresh()\n        }\n      }\n    }\n\n    return ret\n  }\n\n  end () {\n    const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this\n    request.onRequestSent()\n\n    socket[kWriting] = false\n\n    if (socket[kError]) {\n      throw socket[kError]\n    }\n\n    if (socket.destroyed) {\n      return\n    }\n\n    if (bytesWritten === 0) {\n      if (expectsPayload) {\n        // https://tools.ietf.org/html/rfc7230#section-3.3.2\n        // A user agent SHOULD send a Content-Length in a request message when\n        // no Transfer-Encoding is sent and the request method defines a meaning\n        // for an enclosed payload body.\n\n        socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n      } else {\n        socket.write(`${header}\\r\\n`, 'latin1')\n      }\n    } else if (contentLength === null) {\n      socket.write('\\r\\n0\\r\\n\\r\\n', 'latin1')\n    }\n\n    if (contentLength !== null && bytesWritten !== contentLength) {\n      if (client[kStrictContentLength]) {\n        throw new RequestContentLengthMismatchError()\n      } else {\n        process.emitWarning(new RequestContentLengthMismatchError())\n      }\n    }\n\n    if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n      // istanbul ignore else: only for jest\n      if (socket[kParser].timeout.refresh) {\n        socket[kParser].timeout.refresh()\n      }\n    }\n\n    client[kResume]()\n  }\n\n  destroy (err) {\n    const { socket, client, abort } = this\n\n    socket[kWriting] = false\n\n    if (err) {\n      assert(client[kRunning] <= 1, 'pipeline should only contain this request')\n      abort(err)\n    }\n  }\n}\n\nmodule.exports = connectH1\n","'use strict'\n\nconst assert = require('node:assert')\nconst { pipeline } = require('node:stream')\nconst util = require('../core/util.js')\nconst {\n  RequestContentLengthMismatchError,\n  RequestAbortedError,\n  SocketError,\n  InformationalError\n} = require('../core/errors.js')\nconst {\n  kUrl,\n  kReset,\n  kClient,\n  kRunning,\n  kPending,\n  kQueue,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kSocket,\n  kStrictContentLength,\n  kOnError,\n  kMaxConcurrentStreams,\n  kHTTP2Session,\n  kResume,\n  kSize,\n  kHTTPContext\n} = require('../core/symbols.js')\n\nconst kOpenStreams = Symbol('open streams')\n\nlet extractBody\n\n// Experimental\nlet h2ExperimentalWarned = false\n\n/** @type {import('http2')} */\nlet http2\ntry {\n  http2 = require('node:http2')\n} catch {\n  // @ts-ignore\n  http2 = { constants: {} }\n}\n\nconst {\n  constants: {\n    HTTP2_HEADER_AUTHORITY,\n    HTTP2_HEADER_METHOD,\n    HTTP2_HEADER_PATH,\n    HTTP2_HEADER_SCHEME,\n    HTTP2_HEADER_CONTENT_LENGTH,\n    HTTP2_HEADER_EXPECT,\n    HTTP2_HEADER_STATUS\n  }\n} = http2\n\nfunction parseH2Headers (headers) {\n  const result = []\n\n  for (const [name, value] of Object.entries(headers)) {\n    // h2 may concat the header value by array\n    // e.g. Set-Cookie\n    if (Array.isArray(value)) {\n      for (const subvalue of value) {\n        // we need to provide each header value of header name\n        // because the headers handler expect name-value pair\n        result.push(Buffer.from(name), Buffer.from(subvalue))\n      }\n    } else {\n      result.push(Buffer.from(name), Buffer.from(value))\n    }\n  }\n\n  return result\n}\n\nasync function connectH2 (client, socket) {\n  client[kSocket] = socket\n\n  if (!h2ExperimentalWarned) {\n    h2ExperimentalWarned = true\n    process.emitWarning('H2 support is experimental, expect them to change at any time.', {\n      code: 'UNDICI-H2'\n    })\n  }\n\n  const session = http2.connect(client[kUrl], {\n    createConnection: () => socket,\n    peerMaxConcurrentStreams: client[kMaxConcurrentStreams]\n  })\n\n  session[kOpenStreams] = 0\n  session[kClient] = client\n  session[kSocket] = socket\n\n  util.addListener(session, 'error', onHttp2SessionError)\n  util.addListener(session, 'frameError', onHttp2FrameError)\n  util.addListener(session, 'end', onHttp2SessionEnd)\n  util.addListener(session, 'goaway', onHTTP2GoAway)\n  util.addListener(session, 'close', function () {\n    const { [kClient]: client } = this\n    const { [kSocket]: socket } = client\n\n    const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket))\n\n    client[kHTTP2Session] = null\n\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n\n      // Fail entire queue.\n      const requests = client[kQueue].splice(client[kRunningIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(client, request, err)\n      }\n    }\n  })\n\n  session.unref()\n\n  client[kHTTP2Session] = session\n  socket[kHTTP2Session] = session\n\n  util.addListener(socket, 'error', function (err) {\n    assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n    this[kError] = err\n\n    this[kClient][kOnError](err)\n  })\n\n  util.addListener(socket, 'end', function () {\n    util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n  })\n\n  util.addListener(socket, 'close', function () {\n    const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n    client[kSocket] = null\n\n    if (this[kHTTP2Session] != null) {\n      this[kHTTP2Session].destroy(err)\n    }\n\n    client[kPendingIdx] = client[kRunningIdx]\n\n    assert(client[kRunning] === 0)\n\n    client.emit('disconnect', client[kUrl], [client], err)\n\n    client[kResume]()\n  })\n\n  let closed = false\n  socket.on('close', () => {\n    closed = true\n  })\n\n  return {\n    version: 'h2',\n    defaultPipelining: Infinity,\n    write (...args) {\n      return writeH2(client, ...args)\n    },\n    resume () {\n      resumeH2(client)\n    },\n    destroy (err, callback) {\n      if (closed) {\n        queueMicrotask(callback)\n      } else {\n        // Destroying the socket will trigger the session close\n        socket.destroy(err).on('close', callback)\n      }\n    },\n    get destroyed () {\n      return socket.destroyed\n    },\n    busy () {\n      return false\n    }\n  }\n}\n\nfunction resumeH2 (client) {\n  const socket = client[kSocket]\n\n  if (socket?.destroyed === false) {\n    if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) {\n      socket.unref()\n      client[kHTTP2Session].unref()\n    } else {\n      socket.ref()\n      client[kHTTP2Session].ref()\n    }\n  }\n}\n\nfunction onHttp2SessionError (err) {\n  assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n  this[kSocket][kError] = err\n  this[kClient][kOnError](err)\n}\n\nfunction onHttp2FrameError (type, code, id) {\n  if (id === 0) {\n    const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n    this[kSocket][kError] = err\n    this[kClient][kOnError](err)\n  }\n}\n\nfunction onHttp2SessionEnd () {\n  const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket]))\n  this.destroy(err)\n  util.destroy(this[kSocket], err)\n}\n\n/**\n * This is the root cause of #3011\n * We need to handle GOAWAY frames properly, and trigger the session close\n * along with the socket right away\n */\nfunction onHTTP2GoAway (code) {\n  // We cannot recover, so best to close the session and the socket\n  const err = this[kError] || new SocketError(`HTTP/2: \"GOAWAY\" frame received with code ${code}`, util.getSocketInfo(this))\n  const client = this[kClient]\n\n  client[kSocket] = null\n  client[kHTTPContext] = null\n\n  if (this[kHTTP2Session] != null) {\n    this[kHTTP2Session].destroy(err)\n    this[kHTTP2Session] = null\n  }\n\n  util.destroy(this[kSocket], err)\n\n  // Fail head of pipeline.\n  if (client[kRunningIdx] < client[kQueue].length) {\n    const request = client[kQueue][client[kRunningIdx]]\n    client[kQueue][client[kRunningIdx]++] = null\n    util.errorRequest(client, request, err)\n    client[kPendingIdx] = client[kRunningIdx]\n  }\n\n  assert(client[kRunning] === 0)\n\n  client.emit('disconnect', client[kUrl], [client], err)\n\n  client[kResume]()\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n  return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH2 (client, request) {\n  const session = client[kHTTP2Session]\n  const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request\n  let { body } = request\n\n  if (upgrade) {\n    util.errorRequest(client, request, new Error('Upgrade not supported for H2'))\n    return false\n  }\n\n  const headers = {}\n  for (let n = 0; n < reqHeaders.length; n += 2) {\n    const key = reqHeaders[n + 0]\n    const val = reqHeaders[n + 1]\n\n    if (Array.isArray(val)) {\n      for (let i = 0; i < val.length; i++) {\n        if (headers[key]) {\n          headers[key] += `,${val[i]}`\n        } else {\n          headers[key] = val[i]\n        }\n      }\n    } else {\n      headers[key] = val\n    }\n  }\n\n  /** @type {import('node:http2').ClientHttp2Stream} */\n  let stream\n\n  const { hostname, port } = client[kUrl]\n\n  headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`\n  headers[HTTP2_HEADER_METHOD] = method\n\n  const abort = (err) => {\n    if (request.aborted || request.completed) {\n      return\n    }\n\n    err = err || new RequestAbortedError()\n\n    util.errorRequest(client, request, err)\n\n    if (stream != null) {\n      util.destroy(stream, err)\n    }\n\n    // We do not destroy the socket as we can continue using the session\n    // the stream get's destroyed and the session remains to create new streams\n    util.destroy(body, err)\n    client[kQueue][client[kRunningIdx]++] = null\n    client[kResume]()\n  }\n\n  try {\n    // We are already connected, streams are pending.\n    // We can call on connect, and wait for abort\n    request.onConnect(abort)\n  } catch (err) {\n    util.errorRequest(client, request, err)\n  }\n\n  if (request.aborted) {\n    return false\n  }\n\n  if (method === 'CONNECT') {\n    session.ref()\n    // We are already connected, streams are pending, first request\n    // will create a new stream. We trigger a request to create the stream and wait until\n    // `ready` event is triggered\n    // We disabled endStream to allow the user to write to the stream\n    stream = session.request(headers, { endStream: false, signal })\n\n    if (stream.id && !stream.pending) {\n      request.onUpgrade(null, null, stream)\n      ++session[kOpenStreams]\n      client[kQueue][client[kRunningIdx]++] = null\n    } else {\n      stream.once('ready', () => {\n        request.onUpgrade(null, null, stream)\n        ++session[kOpenStreams]\n        client[kQueue][client[kRunningIdx]++] = null\n      })\n    }\n\n    stream.once('close', () => {\n      session[kOpenStreams] -= 1\n      if (session[kOpenStreams] === 0) session.unref()\n    })\n\n    return true\n  }\n\n  // https://tools.ietf.org/html/rfc7540#section-8.3\n  // :path and :scheme headers must be omitted when sending CONNECT\n\n  headers[HTTP2_HEADER_PATH] = path\n  headers[HTTP2_HEADER_SCHEME] = 'https'\n\n  // https://tools.ietf.org/html/rfc7231#section-4.3.1\n  // https://tools.ietf.org/html/rfc7231#section-4.3.2\n  // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n  // Sending a payload body on a request that does not\n  // expect it can cause undefined behavior on some\n  // servers and corrupt connection state. Do not\n  // re-use the connection for further requests.\n\n  const expectsPayload = (\n    method === 'PUT' ||\n    method === 'POST' ||\n    method === 'PATCH'\n  )\n\n  if (body && typeof body.read === 'function') {\n    // Try to read EOF in order to get length.\n    body.read(0)\n  }\n\n  let contentLength = util.bodyLength(body)\n\n  if (util.isFormDataLike(body)) {\n    extractBody ??= require('../web/fetch/body.js').extractBody\n\n    const [bodyStream, contentType] = extractBody(body)\n    headers['content-type'] = contentType\n\n    body = bodyStream.stream\n    contentLength = bodyStream.length\n  }\n\n  if (contentLength == null) {\n    contentLength = request.contentLength\n  }\n\n  if (contentLength === 0 || !expectsPayload) {\n    // https://tools.ietf.org/html/rfc7230#section-3.3.2\n    // A user agent SHOULD NOT send a Content-Length header field when\n    // the request message does not contain a payload body and the method\n    // semantics do not anticipate such a body.\n\n    contentLength = null\n  }\n\n  // https://github.com/nodejs/undici/issues/2046\n  // A user agent may send a Content-Length header with 0 value, this should be allowed.\n  if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {\n    if (client[kStrictContentLength]) {\n      util.errorRequest(client, request, new RequestContentLengthMismatchError())\n      return false\n    }\n\n    process.emitWarning(new RequestContentLengthMismatchError())\n  }\n\n  if (contentLength != null) {\n    assert(body, 'no body must not have content length')\n    headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`\n  }\n\n  session.ref()\n\n  const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null\n  if (expectContinue) {\n    headers[HTTP2_HEADER_EXPECT] = '100-continue'\n    stream = session.request(headers, { endStream: shouldEndStream, signal })\n\n    stream.once('continue', writeBodyH2)\n  } else {\n    stream = session.request(headers, {\n      endStream: shouldEndStream,\n      signal\n    })\n    writeBodyH2()\n  }\n\n  // Increment counter as we have new streams open\n  ++session[kOpenStreams]\n\n  stream.once('response', headers => {\n    const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n    request.onResponseStarted()\n\n    // Due to the stream nature, it is possible we face a race condition\n    // where the stream has been assigned, but the request has been aborted\n    // the request remains in-flight and headers hasn't been received yet\n    // for those scenarios, best effort is to destroy the stream immediately\n    // as there's no value to keep it open.\n    if (request.aborted) {\n      const err = new RequestAbortedError()\n      util.errorRequest(client, request, err)\n      util.destroy(stream, err)\n      return\n    }\n\n    if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) {\n      stream.pause()\n    }\n\n    stream.on('data', (chunk) => {\n      if (request.onData(chunk) === false) {\n        stream.pause()\n      }\n    })\n  })\n\n  stream.once('end', () => {\n    // When state is null, it means we haven't consumed body and the stream still do not have\n    // a state.\n    // Present specially when using pipeline or stream\n    if (stream.state?.state == null || stream.state.state < 6) {\n      request.onComplete([])\n    }\n\n    if (session[kOpenStreams] === 0) {\n      // Stream is closed or half-closed-remote (6), decrement counter and cleanup\n      // It does not have sense to continue working with the stream as we do not\n      // have yet RST_STREAM support on client-side\n\n      session.unref()\n    }\n\n    abort(new InformationalError('HTTP/2: stream half-closed (remote)'))\n    client[kQueue][client[kRunningIdx]++] = null\n    client[kPendingIdx] = client[kRunningIdx]\n    client[kResume]()\n  })\n\n  stream.once('close', () => {\n    session[kOpenStreams] -= 1\n    if (session[kOpenStreams] === 0) {\n      session.unref()\n    }\n  })\n\n  stream.once('error', function (err) {\n    abort(err)\n  })\n\n  stream.once('frameError', (type, code) => {\n    abort(new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`))\n  })\n\n  // stream.on('aborted', () => {\n  //   // TODO(HTTP/2): Support aborted\n  // })\n\n  // stream.on('timeout', () => {\n  //   // TODO(HTTP/2): Support timeout\n  // })\n\n  // stream.on('push', headers => {\n  //   // TODO(HTTP/2): Support push\n  // })\n\n  // stream.on('trailers', headers => {\n  //   // TODO(HTTP/2): Support trailers\n  // })\n\n  return true\n\n  function writeBodyH2 () {\n    /* istanbul ignore else: assertion */\n    if (!body || contentLength === 0) {\n      writeBuffer(\n        abort,\n        stream,\n        null,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else if (util.isBuffer(body)) {\n      writeBuffer(\n        abort,\n        stream,\n        body,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else if (util.isBlobLike(body)) {\n      if (typeof body.stream === 'function') {\n        writeIterable(\n          abort,\n          stream,\n          body.stream(),\n          client,\n          request,\n          client[kSocket],\n          contentLength,\n          expectsPayload\n        )\n      } else {\n        writeBlob(\n          abort,\n          stream,\n          body,\n          client,\n          request,\n          client[kSocket],\n          contentLength,\n          expectsPayload\n        )\n      }\n    } else if (util.isStream(body)) {\n      writeStream(\n        abort,\n        client[kSocket],\n        expectsPayload,\n        stream,\n        body,\n        client,\n        request,\n        contentLength\n      )\n    } else if (util.isIterable(body)) {\n      writeIterable(\n        abort,\n        stream,\n        body,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else {\n      assert(false)\n    }\n  }\n}\n\nfunction writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  try {\n    if (body != null && util.isBuffer(body)) {\n      assert(contentLength === body.byteLength, 'buffer body must have content length')\n      h2stream.cork()\n      h2stream.write(body)\n      h2stream.uncork()\n      h2stream.end()\n\n      request.onBodySent(body)\n    }\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    request.onRequestSent()\n    client[kResume]()\n  } catch (error) {\n    abort(error)\n  }\n}\n\nfunction writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n  // For HTTP/2, is enough to pipe the stream\n  const pipe = pipeline(\n    body,\n    h2stream,\n    (err) => {\n      if (err) {\n        util.destroy(pipe, err)\n        abort(err)\n      } else {\n        util.removeAllListeners(pipe)\n        request.onRequestSent()\n\n        if (!expectsPayload) {\n          socket[kReset] = true\n        }\n\n        client[kResume]()\n      }\n    }\n  )\n\n  util.addListener(pipe, 'data', onPipeData)\n\n  function onPipeData (chunk) {\n    request.onBodySent(chunk)\n  }\n}\n\nasync function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  assert(contentLength === body.size, 'blob body must have content length')\n\n  try {\n    if (contentLength != null && contentLength !== body.size) {\n      throw new RequestContentLengthMismatchError()\n    }\n\n    const buffer = Buffer.from(await body.arrayBuffer())\n\n    h2stream.cork()\n    h2stream.write(buffer)\n    h2stream.uncork()\n    h2stream.end()\n\n    request.onBodySent(buffer)\n    request.onRequestSent()\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n  let callback = null\n  function onDrain () {\n    if (callback) {\n      const cb = callback\n      callback = null\n      cb()\n    }\n  }\n\n  const waitForDrain = () => new Promise((resolve, reject) => {\n    assert(callback === null)\n\n    if (socket[kError]) {\n      reject(socket[kError])\n    } else {\n      callback = resolve\n    }\n  })\n\n  h2stream\n    .on('close', onDrain)\n    .on('drain', onDrain)\n\n  try {\n    // It's up to the user to somehow abort the async iterable.\n    for await (const chunk of body) {\n      if (socket[kError]) {\n        throw socket[kError]\n      }\n\n      const res = h2stream.write(chunk)\n      request.onBodySent(chunk)\n      if (!res) {\n        await waitForDrain()\n      }\n    }\n\n    h2stream.end()\n\n    request.onRequestSent()\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  } finally {\n    h2stream\n      .off('close', onDrain)\n      .off('drain', onDrain)\n  }\n}\n\nmodule.exports = connectH2\n","// @ts-check\n\n'use strict'\n\nconst assert = require('node:assert')\nconst net = require('node:net')\nconst http = require('node:http')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst Request = require('../core/request.js')\nconst DispatcherBase = require('./dispatcher-base')\nconst {\n  InvalidArgumentError,\n  InformationalError,\n  ClientDestroyedError\n} = require('../core/errors.js')\nconst buildConnector = require('../core/connect.js')\nconst {\n  kUrl,\n  kServerName,\n  kClient,\n  kBusy,\n  kConnect,\n  kResuming,\n  kRunning,\n  kPending,\n  kSize,\n  kQueue,\n  kConnected,\n  kConnecting,\n  kNeedDrain,\n  kKeepAliveDefaultTimeout,\n  kHostHeader,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kPipelining,\n  kKeepAliveTimeoutValue,\n  kMaxHeadersSize,\n  kKeepAliveMaxTimeout,\n  kKeepAliveTimeoutThreshold,\n  kHeadersTimeout,\n  kBodyTimeout,\n  kStrictContentLength,\n  kConnector,\n  kMaxRedirections,\n  kMaxRequests,\n  kCounter,\n  kClose,\n  kDestroy,\n  kDispatch,\n  kInterceptors,\n  kLocalAddress,\n  kMaxResponseSize,\n  kOnError,\n  kHTTPContext,\n  kMaxConcurrentStreams,\n  kResume\n} = require('../core/symbols.js')\nconst connectH1 = require('./client-h1.js')\nconst connectH2 = require('./client-h2.js')\nlet deprecatedInterceptorWarned = false\n\nconst kClosedResolve = Symbol('kClosedResolve')\n\nconst noop = () => {}\n\nfunction getPipelining (client) {\n  return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1\n}\n\n/**\n * @type {import('../../types/client.js').default}\n */\nclass Client extends DispatcherBase {\n  /**\n   *\n   * @param {string|URL} url\n   * @param {import('../../types/client.js').Client.Options} options\n   */\n  constructor (url, {\n    interceptors,\n    maxHeaderSize,\n    headersTimeout,\n    socketTimeout,\n    requestTimeout,\n    connectTimeout,\n    bodyTimeout,\n    idleTimeout,\n    keepAlive,\n    keepAliveTimeout,\n    maxKeepAliveTimeout,\n    keepAliveMaxTimeout,\n    keepAliveTimeoutThreshold,\n    socketPath,\n    pipelining,\n    tls,\n    strictContentLength,\n    maxCachedSessions,\n    maxRedirections,\n    connect,\n    maxRequestsPerClient,\n    localAddress,\n    maxResponseSize,\n    autoSelectFamily,\n    autoSelectFamilyAttemptTimeout,\n    // h2\n    maxConcurrentStreams,\n    allowH2,\n    webSocket\n  } = {}) {\n    super({ webSocket })\n\n    if (keepAlive !== undefined) {\n      throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')\n    }\n\n    if (socketTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')\n    }\n\n    if (requestTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')\n    }\n\n    if (idleTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')\n    }\n\n    if (maxKeepAliveTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')\n    }\n\n    if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {\n      throw new InvalidArgumentError('invalid maxHeaderSize')\n    }\n\n    if (socketPath != null && typeof socketPath !== 'string') {\n      throw new InvalidArgumentError('invalid socketPath')\n    }\n\n    if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n      throw new InvalidArgumentError('invalid connectTimeout')\n    }\n\n    if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n      throw new InvalidArgumentError('invalid keepAliveTimeout')\n    }\n\n    if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n      throw new InvalidArgumentError('invalid keepAliveMaxTimeout')\n    }\n\n    if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n      throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')\n    }\n\n    if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n      throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')\n    }\n\n    if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n      throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n      throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')\n    }\n\n    if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {\n      throw new InvalidArgumentError('localAddress must be valid string IP address')\n    }\n\n    if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n      throw new InvalidArgumentError('maxResponseSize must be a positive number')\n    }\n\n    if (\n      autoSelectFamilyAttemptTimeout != null &&\n      (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)\n    ) {\n      throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')\n    }\n\n    // h2\n    if (allowH2 != null && typeof allowH2 !== 'boolean') {\n      throw new InvalidArgumentError('allowH2 must be a valid boolean value')\n    }\n\n    if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {\n      throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')\n    }\n\n    if (typeof connect !== 'function') {\n      connect = buildConnector({\n        ...tls,\n        maxCachedSessions,\n        allowH2,\n        socketPath,\n        timeout: connectTimeout,\n        ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n        ...connect\n      })\n    }\n\n    if (interceptors?.Client && Array.isArray(interceptors.Client)) {\n      this[kInterceptors] = interceptors.Client\n      if (!deprecatedInterceptorWarned) {\n        deprecatedInterceptorWarned = true\n        process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', {\n          code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED'\n        })\n      }\n    } else {\n      this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]\n    }\n\n    this[kUrl] = util.parseOrigin(url)\n    this[kConnector] = connect\n    this[kPipelining] = pipelining != null ? pipelining : 1\n    this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize\n    this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout\n    this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout\n    this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold\n    this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]\n    this[kServerName] = null\n    this[kLocalAddress] = localAddress != null ? localAddress : null\n    this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming\n    this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming\n    this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\\r\\n`\n    this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3\n    this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3\n    this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength\n    this[kMaxRedirections] = maxRedirections\n    this[kMaxRequests] = maxRequestsPerClient\n    this[kClosedResolve] = null\n    this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1\n    this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server\n    this[kHTTPContext] = null\n\n    // kQueue is built up of 3 sections separated by\n    // the kRunningIdx and kPendingIdx indices.\n    // |   complete   |   running   |   pending   |\n    //                ^ kRunningIdx ^ kPendingIdx ^ kQueue.length\n    // kRunningIdx points to the first running element.\n    // kPendingIdx points to the first pending element.\n    // This implements a fast queue with an amortized\n    // time of O(1).\n\n    this[kQueue] = []\n    this[kRunningIdx] = 0\n    this[kPendingIdx] = 0\n\n    this[kResume] = (sync) => resume(this, sync)\n    this[kOnError] = (err) => onError(this, err)\n  }\n\n  get pipelining () {\n    return this[kPipelining]\n  }\n\n  set pipelining (value) {\n    this[kPipelining] = value\n    this[kResume](true)\n  }\n\n  get [kPending] () {\n    return this[kQueue].length - this[kPendingIdx]\n  }\n\n  get [kRunning] () {\n    return this[kPendingIdx] - this[kRunningIdx]\n  }\n\n  get [kSize] () {\n    return this[kQueue].length - this[kRunningIdx]\n  }\n\n  get [kConnected] () {\n    return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed\n  }\n\n  get [kBusy] () {\n    return Boolean(\n      this[kHTTPContext]?.busy(null) ||\n      (this[kSize] >= (getPipelining(this) || 1)) ||\n      this[kPending] > 0\n    )\n  }\n\n  /* istanbul ignore: only used for test */\n  [kConnect] (cb) {\n    connect(this)\n    this.once('connect', cb)\n  }\n\n  [kDispatch] (opts, handler) {\n    const origin = opts.origin || this[kUrl].origin\n    const request = new Request(origin, opts, handler)\n\n    this[kQueue].push(request)\n    if (this[kResuming]) {\n      // Do nothing.\n    } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n      // Wait a tick in case stream/iterator is ended in the same tick.\n      this[kResuming] = 1\n      queueMicrotask(() => resume(this))\n    } else {\n      this[kResume](true)\n    }\n\n    if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n      this[kNeedDrain] = 2\n    }\n\n    return this[kNeedDrain] < 2\n  }\n\n  async [kClose] () {\n    // TODO: for H2 we need to gracefully flush the remaining enqueued\n    // request and close each stream.\n    return new Promise((resolve) => {\n      if (this[kSize]) {\n        this[kClosedResolve] = resolve\n      } else {\n        resolve(null)\n      }\n    })\n  }\n\n  async [kDestroy] (err) {\n    return new Promise((resolve) => {\n      const requests = this[kQueue].splice(this[kPendingIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(this, request, err)\n      }\n\n      const callback = () => {\n        if (this[kClosedResolve]) {\n          // TODO (fix): Should we error here with ClientDestroyedError?\n          this[kClosedResolve]()\n          this[kClosedResolve] = null\n        }\n        resolve(null)\n      }\n\n      if (this[kHTTPContext]) {\n        this[kHTTPContext].destroy(err, callback)\n        this[kHTTPContext] = null\n      } else {\n        queueMicrotask(callback)\n      }\n\n      this[kResume]()\n    })\n  }\n}\n\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor.js')\n\nfunction onError (client, err) {\n  if (\n    client[kRunning] === 0 &&\n    err.code !== 'UND_ERR_INFO' &&\n    err.code !== 'UND_ERR_SOCKET'\n  ) {\n    // Error is not caused by running request and not a recoverable\n    // socket error.\n\n    assert(client[kPendingIdx] === client[kRunningIdx])\n\n    const requests = client[kQueue].splice(client[kRunningIdx])\n\n    for (let i = 0; i < requests.length; i++) {\n      const request = requests[i]\n      util.errorRequest(client, request, err)\n    }\n    assert(client[kSize] === 0)\n  }\n}\n\n/**\n * @param {Client} client\n * @returns\n */\nasync function connect (client) {\n  assert(!client[kConnecting])\n  assert(!client[kHTTPContext])\n\n  let { host, hostname, protocol, port } = client[kUrl]\n\n  // Resolve ipv6\n  if (hostname[0] === '[') {\n    const idx = hostname.indexOf(']')\n\n    assert(idx !== -1)\n    const ip = hostname.substring(1, idx)\n\n    assert(net.isIP(ip))\n    hostname = ip\n  }\n\n  client[kConnecting] = true\n\n  if (channels.beforeConnect.hasSubscribers) {\n    channels.beforeConnect.publish({\n      connectParams: {\n        host,\n        hostname,\n        protocol,\n        port,\n        version: client[kHTTPContext]?.version,\n        servername: client[kServerName],\n        localAddress: client[kLocalAddress]\n      },\n      connector: client[kConnector]\n    })\n  }\n\n  try {\n    const socket = await new Promise((resolve, reject) => {\n      client[kConnector]({\n        host,\n        hostname,\n        protocol,\n        port,\n        servername: client[kServerName],\n        localAddress: client[kLocalAddress]\n      }, (err, socket) => {\n        if (err) {\n          reject(err)\n        } else {\n          resolve(socket)\n        }\n      })\n    })\n\n    if (client.destroyed) {\n      util.destroy(socket.on('error', noop), new ClientDestroyedError())\n      return\n    }\n\n    assert(socket)\n\n    try {\n      client[kHTTPContext] = socket.alpnProtocol === 'h2'\n        ? await connectH2(client, socket)\n        : await connectH1(client, socket)\n    } catch (err) {\n      socket.destroy().on('error', noop)\n      throw err\n    }\n\n    client[kConnecting] = false\n\n    socket[kCounter] = 0\n    socket[kMaxRequests] = client[kMaxRequests]\n    socket[kClient] = client\n    socket[kError] = null\n\n    if (channels.connected.hasSubscribers) {\n      channels.connected.publish({\n        connectParams: {\n          host,\n          hostname,\n          protocol,\n          port,\n          version: client[kHTTPContext]?.version,\n          servername: client[kServerName],\n          localAddress: client[kLocalAddress]\n        },\n        connector: client[kConnector],\n        socket\n      })\n    }\n    client.emit('connect', client[kUrl], [client])\n  } catch (err) {\n    if (client.destroyed) {\n      return\n    }\n\n    client[kConnecting] = false\n\n    if (channels.connectError.hasSubscribers) {\n      channels.connectError.publish({\n        connectParams: {\n          host,\n          hostname,\n          protocol,\n          port,\n          version: client[kHTTPContext]?.version,\n          servername: client[kServerName],\n          localAddress: client[kLocalAddress]\n        },\n        connector: client[kConnector],\n        error: err\n      })\n    }\n\n    if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n      assert(client[kRunning] === 0)\n      while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n        const request = client[kQueue][client[kPendingIdx]++]\n        util.errorRequest(client, request, err)\n      }\n    } else {\n      onError(client, err)\n    }\n\n    client.emit('connectionError', client[kUrl], [client], err)\n  }\n\n  client[kResume]()\n}\n\nfunction emitDrain (client) {\n  client[kNeedDrain] = 0\n  client.emit('drain', client[kUrl], [client])\n}\n\nfunction resume (client, sync) {\n  if (client[kResuming] === 2) {\n    return\n  }\n\n  client[kResuming] = 2\n\n  _resume(client, sync)\n  client[kResuming] = 0\n\n  if (client[kRunningIdx] > 256) {\n    client[kQueue].splice(0, client[kRunningIdx])\n    client[kPendingIdx] -= client[kRunningIdx]\n    client[kRunningIdx] = 0\n  }\n}\n\nfunction _resume (client, sync) {\n  while (true) {\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n      return\n    }\n\n    if (client[kClosedResolve] && !client[kSize]) {\n      client[kClosedResolve]()\n      client[kClosedResolve] = null\n      return\n    }\n\n    if (client[kHTTPContext]) {\n      client[kHTTPContext].resume()\n    }\n\n    if (client[kBusy]) {\n      client[kNeedDrain] = 2\n    } else if (client[kNeedDrain] === 2) {\n      if (sync) {\n        client[kNeedDrain] = 1\n        queueMicrotask(() => emitDrain(client))\n      } else {\n        emitDrain(client)\n      }\n      continue\n    }\n\n    if (client[kPending] === 0) {\n      return\n    }\n\n    if (client[kRunning] >= (getPipelining(client) || 1)) {\n      return\n    }\n\n    const request = client[kQueue][client[kPendingIdx]]\n\n    if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {\n      if (client[kRunning] > 0) {\n        return\n      }\n\n      client[kServerName] = request.servername\n      client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {\n        client[kHTTPContext] = null\n        resume(client)\n      })\n    }\n\n    if (client[kConnecting]) {\n      return\n    }\n\n    if (!client[kHTTPContext]) {\n      connect(client)\n      return\n    }\n\n    if (client[kHTTPContext].destroyed) {\n      return\n    }\n\n    if (client[kHTTPContext].busy(request)) {\n      return\n    }\n\n    if (!request.aborted && client[kHTTPContext].write(request)) {\n      client[kPendingIdx]++\n    } else {\n      client[kQueue].splice(client[kPendingIdx], 1)\n    }\n  }\n}\n\nmodule.exports = Client\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst {\n  ClientDestroyedError,\n  ClientClosedError,\n  InvalidArgumentError\n} = require('../core/errors')\nconst { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require('../core/symbols')\n\nconst kOnDestroyed = Symbol('onDestroyed')\nconst kOnClosed = Symbol('onClosed')\nconst kInterceptedDispatch = Symbol('Intercepted Dispatch')\nconst kWebSocketOptions = Symbol('webSocketOptions')\n\nclass DispatcherBase extends Dispatcher {\n  constructor (opts) {\n    super()\n\n    this[kDestroyed] = false\n    this[kOnDestroyed] = null\n    this[kClosed] = false\n    this[kOnClosed] = []\n    this[kWebSocketOptions] = opts?.webSocket ?? {}\n  }\n\n  get webSocketOptions () {\n    return {\n      maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,\n      maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024\n    }\n  }\n\n  get destroyed () {\n    return this[kDestroyed]\n  }\n\n  get closed () {\n    return this[kClosed]\n  }\n\n  get interceptors () {\n    return this[kInterceptors]\n  }\n\n  set interceptors (newInterceptors) {\n    if (newInterceptors) {\n      for (let i = newInterceptors.length - 1; i >= 0; i--) {\n        const interceptor = this[kInterceptors][i]\n        if (typeof interceptor !== 'function') {\n          throw new InvalidArgumentError('interceptor must be an function')\n        }\n      }\n    }\n\n    this[kInterceptors] = newInterceptors\n  }\n\n  close (callback) {\n    if (callback === undefined) {\n      return new Promise((resolve, reject) => {\n        this.close((err, data) => {\n          return err ? reject(err) : resolve(data)\n        })\n      })\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    if (this[kDestroyed]) {\n      queueMicrotask(() => callback(new ClientDestroyedError(), null))\n      return\n    }\n\n    if (this[kClosed]) {\n      if (this[kOnClosed]) {\n        this[kOnClosed].push(callback)\n      } else {\n        queueMicrotask(() => callback(null, null))\n      }\n      return\n    }\n\n    this[kClosed] = true\n    this[kOnClosed].push(callback)\n\n    const onClosed = () => {\n      const callbacks = this[kOnClosed]\n      this[kOnClosed] = null\n      for (let i = 0; i < callbacks.length; i++) {\n        callbacks[i](null, null)\n      }\n    }\n\n    // Should not error.\n    this[kClose]()\n      .then(() => this.destroy())\n      .then(() => {\n        queueMicrotask(onClosed)\n      })\n  }\n\n  destroy (err, callback) {\n    if (typeof err === 'function') {\n      callback = err\n      err = null\n    }\n\n    if (callback === undefined) {\n      return new Promise((resolve, reject) => {\n        this.destroy(err, (err, data) => {\n          return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)\n        })\n      })\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    if (this[kDestroyed]) {\n      if (this[kOnDestroyed]) {\n        this[kOnDestroyed].push(callback)\n      } else {\n        queueMicrotask(() => callback(null, null))\n      }\n      return\n    }\n\n    if (!err) {\n      err = new ClientDestroyedError()\n    }\n\n    this[kDestroyed] = true\n    this[kOnDestroyed] = this[kOnDestroyed] || []\n    this[kOnDestroyed].push(callback)\n\n    const onDestroyed = () => {\n      const callbacks = this[kOnDestroyed]\n      this[kOnDestroyed] = null\n      for (let i = 0; i < callbacks.length; i++) {\n        callbacks[i](null, null)\n      }\n    }\n\n    // Should not error.\n    this[kDestroy](err).then(() => {\n      queueMicrotask(onDestroyed)\n    })\n  }\n\n  [kInterceptedDispatch] (opts, handler) {\n    if (!this[kInterceptors] || this[kInterceptors].length === 0) {\n      this[kInterceptedDispatch] = this[kDispatch]\n      return this[kDispatch](opts, handler)\n    }\n\n    let dispatch = this[kDispatch].bind(this)\n    for (let i = this[kInterceptors].length - 1; i >= 0; i--) {\n      dispatch = this[kInterceptors][i](dispatch)\n    }\n    this[kInterceptedDispatch] = dispatch\n    return dispatch(opts, handler)\n  }\n\n  dispatch (opts, handler) {\n    if (!handler || typeof handler !== 'object') {\n      throw new InvalidArgumentError('handler must be an object')\n    }\n\n    try {\n      if (!opts || typeof opts !== 'object') {\n        throw new InvalidArgumentError('opts must be an object.')\n      }\n\n      if (this[kDestroyed] || this[kOnDestroyed]) {\n        throw new ClientDestroyedError()\n      }\n\n      if (this[kClosed]) {\n        throw new ClientClosedError()\n      }\n\n      return this[kInterceptedDispatch](opts, handler)\n    } catch (err) {\n      if (typeof handler.onError !== 'function') {\n        throw new InvalidArgumentError('invalid onError method')\n      }\n\n      handler.onError(err)\n\n      return false\n    }\n  }\n}\n\nmodule.exports = DispatcherBase\n","'use strict'\nconst EventEmitter = require('node:events')\n\nclass Dispatcher extends EventEmitter {\n  dispatch () {\n    throw new Error('not implemented')\n  }\n\n  close () {\n    throw new Error('not implemented')\n  }\n\n  destroy () {\n    throw new Error('not implemented')\n  }\n\n  compose (...args) {\n    // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...\n    const interceptors = Array.isArray(args[0]) ? args[0] : args\n    let dispatch = this.dispatch.bind(this)\n\n    for (const interceptor of interceptors) {\n      if (interceptor == null) {\n        continue\n      }\n\n      if (typeof interceptor !== 'function') {\n        throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)\n      }\n\n      dispatch = interceptor(dispatch)\n\n      if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {\n        throw new TypeError('invalid interceptor')\n      }\n    }\n\n    return new ComposedDispatcher(this, dispatch)\n  }\n}\n\nclass ComposedDispatcher extends Dispatcher {\n  #dispatcher = null\n  #dispatch = null\n\n  constructor (dispatcher, dispatch) {\n    super()\n    this.#dispatcher = dispatcher\n    this.#dispatch = dispatch\n  }\n\n  dispatch (...args) {\n    this.#dispatch(...args)\n  }\n\n  close (...args) {\n    return this.#dispatcher.close(...args)\n  }\n\n  destroy (...args) {\n    return this.#dispatcher.destroy(...args)\n  }\n}\n\nmodule.exports = Dispatcher\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require('../core/symbols')\nconst ProxyAgent = require('./proxy-agent')\nconst Agent = require('./agent')\n\nconst DEFAULT_PORTS = {\n  'http:': 80,\n  'https:': 443\n}\n\nlet experimentalWarned = false\n\nclass EnvHttpProxyAgent extends DispatcherBase {\n  #noProxyValue = null\n  #noProxyEntries = null\n  #opts = null\n\n  constructor (opts = {}) {\n    super()\n    this.#opts = opts\n\n    if (!experimentalWarned) {\n      experimentalWarned = true\n      process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', {\n        code: 'UNDICI-EHPA'\n      })\n    }\n\n    const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts\n\n    this[kNoProxyAgent] = new Agent(agentOpts)\n\n    const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY\n    if (HTTP_PROXY) {\n      this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY })\n    } else {\n      this[kHttpProxyAgent] = this[kNoProxyAgent]\n    }\n\n    const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY\n    if (HTTPS_PROXY) {\n      this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY })\n    } else {\n      this[kHttpsProxyAgent] = this[kHttpProxyAgent]\n    }\n\n    this.#parseNoProxy()\n  }\n\n  [kDispatch] (opts, handler) {\n    const url = new URL(opts.origin)\n    const agent = this.#getProxyAgentForUrl(url)\n    return agent.dispatch(opts, handler)\n  }\n\n  async [kClose] () {\n    await this[kNoProxyAgent].close()\n    if (!this[kHttpProxyAgent][kClosed]) {\n      await this[kHttpProxyAgent].close()\n    }\n    if (!this[kHttpsProxyAgent][kClosed]) {\n      await this[kHttpsProxyAgent].close()\n    }\n  }\n\n  async [kDestroy] (err) {\n    await this[kNoProxyAgent].destroy(err)\n    if (!this[kHttpProxyAgent][kDestroyed]) {\n      await this[kHttpProxyAgent].destroy(err)\n    }\n    if (!this[kHttpsProxyAgent][kDestroyed]) {\n      await this[kHttpsProxyAgent].destroy(err)\n    }\n  }\n\n  #getProxyAgentForUrl (url) {\n    let { protocol, host: hostname, port } = url\n\n    // Stripping ports in this way instead of using parsedUrl.hostname to make\n    // sure that the brackets around IPv6 addresses are kept.\n    hostname = hostname.replace(/:\\d*$/, '').toLowerCase()\n    port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0\n    if (!this.#shouldProxy(hostname, port)) {\n      return this[kNoProxyAgent]\n    }\n    if (protocol === 'https:') {\n      return this[kHttpsProxyAgent]\n    }\n    return this[kHttpProxyAgent]\n  }\n\n  #shouldProxy (hostname, port) {\n    if (this.#noProxyChanged) {\n      this.#parseNoProxy()\n    }\n\n    if (this.#noProxyEntries.length === 0) {\n      return true // Always proxy if NO_PROXY is not set or empty.\n    }\n    if (this.#noProxyValue === '*') {\n      return false // Never proxy if wildcard is set.\n    }\n\n    for (let i = 0; i < this.#noProxyEntries.length; i++) {\n      const entry = this.#noProxyEntries[i]\n      if (entry.port && entry.port !== port) {\n        continue // Skip if ports don't match.\n      }\n      if (!/^[.*]/.test(entry.hostname)) {\n        // No wildcards, so don't proxy only if there is not an exact match.\n        if (hostname === entry.hostname) {\n          return false\n        }\n      } else {\n        // Don't proxy if the hostname ends with the no_proxy host.\n        if (hostname.endsWith(entry.hostname.replace(/^\\*/, ''))) {\n          return false\n        }\n      }\n    }\n\n    return true\n  }\n\n  #parseNoProxy () {\n    const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv\n    const noProxySplit = noProxyValue.split(/[,\\s]/)\n    const noProxyEntries = []\n\n    for (let i = 0; i < noProxySplit.length; i++) {\n      const entry = noProxySplit[i]\n      if (!entry) {\n        continue\n      }\n      const parsed = entry.match(/^(.+):(\\d+)$/)\n      noProxyEntries.push({\n        hostname: (parsed ? parsed[1] : entry).toLowerCase(),\n        port: parsed ? Number.parseInt(parsed[2], 10) : 0\n      })\n    }\n\n    this.#noProxyValue = noProxyValue\n    this.#noProxyEntries = noProxyEntries\n  }\n\n  get #noProxyChanged () {\n    if (this.#opts.noProxy !== undefined) {\n      return false\n    }\n    return this.#noProxyValue !== this.#noProxyEnv\n  }\n\n  get #noProxyEnv () {\n    return process.env.no_proxy ?? process.env.NO_PROXY ?? ''\n  }\n}\n\nmodule.exports = EnvHttpProxyAgent\n","/* eslint-disable */\n\n'use strict'\n\n// Extracted from node/lib/internal/fixed_queue.js\n\n// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.\nconst kSize = 2048;\nconst kMask = kSize - 1;\n\n// The FixedQueue is implemented as a singly-linked list of fixed-size\n// circular buffers. It looks something like this:\n//\n//  head                                                       tail\n//    |                                                          |\n//    v                                                          v\n// +-----------+ <-----\\       +-----------+ <------\\         +-----------+\n// |  [null]   |        \\----- |   next    |         \\------- |   next    |\n// +-----------+               +-----------+                  +-----------+\n// |   item    | <-- bottom    |   item    | <-- bottom       |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |       bottom --> |   item    |\n// |   item    |               |   item    |                  |   item    |\n// |    ...    |               |    ...    |                  |    ...    |\n// |   item    |               |   item    |                  |   item    |\n// |   item    |               |   item    |                  |   item    |\n// |  [empty]  | <-- top       |   item    |                  |   item    |\n// |  [empty]  |               |   item    |                  |   item    |\n// |  [empty]  |               |  [empty]  | <-- top  top --> |  [empty]  |\n// +-----------+               +-----------+                  +-----------+\n//\n// Or, if there is only one circular buffer, it looks something\n// like either of these:\n//\n//  head   tail                                 head   tail\n//    |     |                                     |     |\n//    v     v                                     v     v\n// +-----------+                               +-----------+\n// |  [null]   |                               |  [null]   |\n// +-----------+                               +-----------+\n// |  [empty]  |                               |   item    |\n// |  [empty]  |                               |   item    |\n// |   item    | <-- bottom            top --> |  [empty]  |\n// |   item    |                               |  [empty]  |\n// |  [empty]  | <-- top            bottom --> |   item    |\n// |  [empty]  |                               |   item    |\n// +-----------+                               +-----------+\n//\n// Adding a value means moving `top` forward by one, removing means\n// moving `bottom` forward by one. After reaching the end, the queue\n// wraps around.\n//\n// When `top === bottom` the current queue is empty and when\n// `top + 1 === bottom` it's full. This wastes a single space of storage\n// but allows much quicker checks.\n\nclass FixedCircularBuffer {\n  constructor() {\n    this.bottom = 0;\n    this.top = 0;\n    this.list = new Array(kSize);\n    this.next = null;\n  }\n\n  isEmpty() {\n    return this.top === this.bottom;\n  }\n\n  isFull() {\n    return ((this.top + 1) & kMask) === this.bottom;\n  }\n\n  push(data) {\n    this.list[this.top] = data;\n    this.top = (this.top + 1) & kMask;\n  }\n\n  shift() {\n    const nextItem = this.list[this.bottom];\n    if (nextItem === undefined)\n      return null;\n    this.list[this.bottom] = undefined;\n    this.bottom = (this.bottom + 1) & kMask;\n    return nextItem;\n  }\n}\n\nmodule.exports = class FixedQueue {\n  constructor() {\n    this.head = this.tail = new FixedCircularBuffer();\n  }\n\n  isEmpty() {\n    return this.head.isEmpty();\n  }\n\n  push(data) {\n    if (this.head.isFull()) {\n      // Head is full: Creates a new queue, sets the old queue's `.next` to it,\n      // and sets it as the new main queue.\n      this.head = this.head.next = new FixedCircularBuffer();\n    }\n    this.head.push(data);\n  }\n\n  shift() {\n    const tail = this.tail;\n    const next = tail.shift();\n    if (tail.isEmpty() && tail.next !== null) {\n      // If there is another queue, it forms the new tail.\n      this.tail = tail.next;\n    }\n    return next;\n  }\n};\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst FixedQueue = require('./fixed-queue')\nconst { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('../core/symbols')\nconst PoolStats = require('./pool-stats')\n\nconst kClients = Symbol('clients')\nconst kNeedDrain = Symbol('needDrain')\nconst kQueue = Symbol('queue')\nconst kClosedResolve = Symbol('closed resolve')\nconst kOnDrain = Symbol('onDrain')\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kGetDispatcher = Symbol('get dispatcher')\nconst kAddClient = Symbol('add client')\nconst kRemoveClient = Symbol('remove client')\nconst kStats = Symbol('stats')\n\nclass PoolBase extends DispatcherBase {\n  constructor (opts) {\n    super(opts)\n\n    this[kQueue] = new FixedQueue()\n    this[kClients] = []\n    this[kQueued] = 0\n\n    const pool = this\n\n    this[kOnDrain] = function onDrain (origin, targets) {\n      const queue = pool[kQueue]\n\n      let needDrain = false\n\n      while (!needDrain) {\n        const item = queue.shift()\n        if (!item) {\n          break\n        }\n        pool[kQueued]--\n        needDrain = !this.dispatch(item.opts, item.handler)\n      }\n\n      this[kNeedDrain] = needDrain\n\n      if (!this[kNeedDrain] && pool[kNeedDrain]) {\n        pool[kNeedDrain] = false\n        pool.emit('drain', origin, [pool, ...targets])\n      }\n\n      if (pool[kClosedResolve] && queue.isEmpty()) {\n        Promise\n          .all(pool[kClients].map(c => c.close()))\n          .then(pool[kClosedResolve])\n      }\n    }\n\n    this[kOnConnect] = (origin, targets) => {\n      pool.emit('connect', origin, [pool, ...targets])\n    }\n\n    this[kOnDisconnect] = (origin, targets, err) => {\n      pool.emit('disconnect', origin, [pool, ...targets], err)\n    }\n\n    this[kOnConnectionError] = (origin, targets, err) => {\n      pool.emit('connectionError', origin, [pool, ...targets], err)\n    }\n\n    this[kStats] = new PoolStats(this)\n  }\n\n  get [kBusy] () {\n    return this[kNeedDrain]\n  }\n\n  get [kConnected] () {\n    return this[kClients].filter(client => client[kConnected]).length\n  }\n\n  get [kFree] () {\n    return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length\n  }\n\n  get [kPending] () {\n    let ret = this[kQueued]\n    for (const { [kPending]: pending } of this[kClients]) {\n      ret += pending\n    }\n    return ret\n  }\n\n  get [kRunning] () {\n    let ret = 0\n    for (const { [kRunning]: running } of this[kClients]) {\n      ret += running\n    }\n    return ret\n  }\n\n  get [kSize] () {\n    let ret = this[kQueued]\n    for (const { [kSize]: size } of this[kClients]) {\n      ret += size\n    }\n    return ret\n  }\n\n  get stats () {\n    return this[kStats]\n  }\n\n  async [kClose] () {\n    if (this[kQueue].isEmpty()) {\n      await Promise.all(this[kClients].map(c => c.close()))\n    } else {\n      await new Promise((resolve) => {\n        this[kClosedResolve] = resolve\n      })\n    }\n  }\n\n  async [kDestroy] (err) {\n    while (true) {\n      const item = this[kQueue].shift()\n      if (!item) {\n        break\n      }\n      item.handler.onError(err)\n    }\n\n    await Promise.all(this[kClients].map(c => c.destroy(err)))\n  }\n\n  [kDispatch] (opts, handler) {\n    const dispatcher = this[kGetDispatcher]()\n\n    if (!dispatcher) {\n      this[kNeedDrain] = true\n      this[kQueue].push({ opts, handler })\n      this[kQueued]++\n    } else if (!dispatcher.dispatch(opts, handler)) {\n      dispatcher[kNeedDrain] = true\n      this[kNeedDrain] = !this[kGetDispatcher]()\n    }\n\n    return !this[kNeedDrain]\n  }\n\n  [kAddClient] (client) {\n    client\n      .on('drain', this[kOnDrain])\n      .on('connect', this[kOnConnect])\n      .on('disconnect', this[kOnDisconnect])\n      .on('connectionError', this[kOnConnectionError])\n\n    this[kClients].push(client)\n\n    if (this[kNeedDrain]) {\n      queueMicrotask(() => {\n        if (this[kNeedDrain]) {\n          this[kOnDrain](client[kUrl], [this, client])\n        }\n      })\n    }\n\n    return this\n  }\n\n  [kRemoveClient] (client) {\n    client.close(() => {\n      const idx = this[kClients].indexOf(client)\n      if (idx !== -1) {\n        this[kClients].splice(idx, 1)\n      }\n    })\n\n    this[kNeedDrain] = this[kClients].some(dispatcher => (\n      !dispatcher[kNeedDrain] &&\n      dispatcher.closed !== true &&\n      dispatcher.destroyed !== true\n    ))\n  }\n}\n\nmodule.exports = {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kRemoveClient,\n  kGetDispatcher\n}\n","const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('../core/symbols')\nconst kPool = Symbol('pool')\n\nclass PoolStats {\n  constructor (pool) {\n    this[kPool] = pool\n  }\n\n  get connected () {\n    return this[kPool][kConnected]\n  }\n\n  get free () {\n    return this[kPool][kFree]\n  }\n\n  get pending () {\n    return this[kPool][kPending]\n  }\n\n  get queued () {\n    return this[kPool][kQueued]\n  }\n\n  get running () {\n    return this[kPool][kRunning]\n  }\n\n  get size () {\n    return this[kPool][kSize]\n  }\n}\n\nmodule.exports = PoolStats\n","'use strict'\n\nconst {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kGetDispatcher\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n  InvalidArgumentError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst buildConnector = require('../core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\n\nfunction defaultFactory (origin, opts) {\n  return new Client(origin, opts)\n}\n\nclass Pool extends PoolBase {\n  constructor (origin, {\n    connections,\n    factory = defaultFactory,\n    connect,\n    connectTimeout,\n    tls,\n    maxCachedSessions,\n    socketPath,\n    autoSelectFamily,\n    autoSelectFamilyAttemptTimeout,\n    allowH2,\n    ...options\n  } = {}) {\n    if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n      throw new InvalidArgumentError('invalid connections')\n    }\n\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (typeof connect !== 'function') {\n      connect = buildConnector({\n        ...tls,\n        maxCachedSessions,\n        allowH2,\n        socketPath,\n        timeout: connectTimeout,\n        ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n        ...connect\n      })\n    }\n\n    super(options)\n\n    this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool)\n      ? options.interceptors.Pool\n      : []\n    this[kConnections] = connections || null\n    this[kUrl] = util.parseOrigin(origin)\n    this[kOptions] = { ...util.deepClone(options), connect, allowH2 }\n    this[kOptions].interceptors = options.interceptors\n      ? { ...options.interceptors }\n      : undefined\n    this[kFactory] = factory\n\n    this.on('connectionError', (origin, targets, error) => {\n      // If a connection error occurs, we remove the client from the pool,\n      // and emit a connectionError event. They will not be re-used.\n      // Fixes https://github.com/nodejs/undici/issues/3895\n      for (const target of targets) {\n        // Do not use kRemoveClient here, as it will close the client,\n        // but the client cannot be closed in this state.\n        const idx = this[kClients].indexOf(target)\n        if (idx !== -1) {\n          this[kClients].splice(idx, 1)\n        }\n      }\n    })\n  }\n\n  [kGetDispatcher] () {\n    for (const client of this[kClients]) {\n      if (!client[kNeedDrain]) {\n        return client\n      }\n    }\n\n    if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n      const dispatcher = this[kFactory](this[kUrl], this[kOptions])\n      this[kAddClient](dispatcher)\n      return dispatcher\n    }\n  }\n}\n\nmodule.exports = Pool\n","'use strict'\n\nconst { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst { URL } = require('node:url')\nconst Agent = require('./agent')\nconst Pool = require('./pool')\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors')\nconst buildConnector = require('../core/connect')\nconst Client = require('./client')\n\nconst kAgent = Symbol('proxy agent')\nconst kClient = Symbol('proxy client')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kRequestTls = Symbol('request tls settings')\nconst kProxyTls = Symbol('proxy tls settings')\nconst kConnectEndpoint = Symbol('connect endpoint function')\nconst kTunnelProxy = Symbol('tunnel proxy')\n\nfunction defaultProtocolPort (protocol) {\n  return protocol === 'https:' ? 443 : 80\n}\n\nfunction defaultFactory (origin, opts) {\n  return new Pool(origin, opts)\n}\n\nconst noop = () => {}\n\nfunction defaultAgentFactory (origin, opts) {\n  if (opts.connections === 1) {\n    return new Client(origin, opts)\n  }\n  return new Pool(origin, opts)\n}\n\nclass Http1ProxyWrapper extends DispatcherBase {\n  #client\n\n  constructor (proxyUrl, { headers = {}, connect, factory }) {\n    super()\n    if (!proxyUrl) {\n      throw new InvalidArgumentError('Proxy URL is mandatory')\n    }\n\n    this[kProxyHeaders] = headers\n    if (factory) {\n      this.#client = factory(proxyUrl, { connect })\n    } else {\n      this.#client = new Client(proxyUrl, { connect })\n    }\n  }\n\n  [kDispatch] (opts, handler) {\n    const onHeaders = handler.onHeaders\n    handler.onHeaders = function (statusCode, data, resume) {\n      if (statusCode === 407) {\n        if (typeof handler.onError === 'function') {\n          handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)'))\n        }\n        return\n      }\n      if (onHeaders) onHeaders.call(this, statusCode, data, resume)\n    }\n\n    // Rewrite request as an HTTP1 Proxy request, without tunneling.\n    const {\n      origin,\n      path = '/',\n      headers = {}\n    } = opts\n\n    opts.path = origin + path\n\n    if (!('host' in headers) && !('Host' in headers)) {\n      const { host } = new URL(origin)\n      headers.host = host\n    }\n    opts.headers = { ...this[kProxyHeaders], ...headers }\n\n    return this.#client[kDispatch](opts, handler)\n  }\n\n  async [kClose] () {\n    return this.#client.close()\n  }\n\n  async [kDestroy] (err) {\n    return this.#client.destroy(err)\n  }\n}\n\nclass ProxyAgent extends DispatcherBase {\n  constructor (opts) {\n    super()\n\n    if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) {\n      throw new InvalidArgumentError('Proxy uri is mandatory')\n    }\n\n    const { clientFactory = defaultFactory } = opts\n    if (typeof clientFactory !== 'function') {\n      throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')\n    }\n\n    const { proxyTunnel = true } = opts\n\n    const url = this.#getUrl(opts)\n    const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url\n\n    this[kProxy] = { uri: href, protocol }\n    this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)\n      ? opts.interceptors.ProxyAgent\n      : []\n    this[kRequestTls] = opts.requestTls\n    this[kProxyTls] = opts.proxyTls\n    this[kProxyHeaders] = opts.headers || {}\n    this[kTunnelProxy] = proxyTunnel\n\n    if (opts.auth && opts.token) {\n      throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')\n    } else if (opts.auth) {\n      /* @deprecated in favour of opts.token */\n      this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`\n    } else if (opts.token) {\n      this[kProxyHeaders]['proxy-authorization'] = opts.token\n    } else if (username && password) {\n      this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`\n    }\n\n    const connect = buildConnector({ ...opts.proxyTls })\n    this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })\n\n    const agentFactory = opts.factory || defaultAgentFactory\n    const factory = (origin, options) => {\n      const { protocol } = new URL(origin)\n      if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') {\n        return new Http1ProxyWrapper(this[kProxy].uri, {\n          headers: this[kProxyHeaders],\n          connect,\n          factory: agentFactory\n        })\n      }\n      return agentFactory(origin, options)\n    }\n    this[kClient] = clientFactory(url, { connect })\n    this[kAgent] = new Agent({\n      ...opts,\n      factory,\n      connect: async (opts, callback) => {\n        let requestedPath = opts.host\n        if (!opts.port) {\n          requestedPath += `:${defaultProtocolPort(opts.protocol)}`\n        }\n        try {\n          const { socket, statusCode } = await this[kClient].connect({\n            origin,\n            port,\n            path: requestedPath,\n            signal: opts.signal,\n            headers: {\n              ...this[kProxyHeaders],\n              host: opts.host\n            },\n            servername: this[kProxyTls]?.servername || proxyHostname\n          })\n          if (statusCode !== 200) {\n            socket.on('error', noop).destroy()\n            callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))\n          }\n          if (opts.protocol !== 'https:') {\n            callback(null, socket)\n            return\n          }\n          let servername\n          if (this[kRequestTls]) {\n            servername = this[kRequestTls].servername\n          } else {\n            servername = opts.servername\n          }\n          this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)\n        } catch (err) {\n          if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n            // Throw a custom error to avoid loop in client.js#connect\n            callback(new SecureProxyConnectionError(err))\n          } else {\n            callback(err)\n          }\n        }\n      }\n    })\n  }\n\n  dispatch (opts, handler) {\n    const headers = buildHeaders(opts.headers)\n    throwIfProxyAuthIsSent(headers)\n\n    if (headers && !('host' in headers) && !('Host' in headers)) {\n      const { host } = new URL(opts.origin)\n      headers.host = host\n    }\n\n    return this[kAgent].dispatch(\n      {\n        ...opts,\n        headers\n      },\n      handler\n    )\n  }\n\n  /**\n   * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts\n   * @returns {URL}\n   */\n  #getUrl (opts) {\n    if (typeof opts === 'string') {\n      return new URL(opts)\n    } else if (opts instanceof URL) {\n      return opts\n    } else {\n      return new URL(opts.uri)\n    }\n  }\n\n  async [kClose] () {\n    await this[kAgent].close()\n    await this[kClient].close()\n  }\n\n  async [kDestroy] () {\n    await this[kAgent].destroy()\n    await this[kClient].destroy()\n  }\n}\n\n/**\n * @param {string[] | Record} headers\n * @returns {Record}\n */\nfunction buildHeaders (headers) {\n  // When using undici.fetch, the headers list is stored\n  // as an array.\n  if (Array.isArray(headers)) {\n    /** @type {Record} */\n    const headersPair = {}\n\n    for (let i = 0; i < headers.length; i += 2) {\n      headersPair[headers[i]] = headers[i + 1]\n    }\n\n    return headersPair\n  }\n\n  return headers\n}\n\n/**\n * @param {Record} headers\n *\n * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers\n * Nevertheless, it was changed and to avoid a security vulnerability by end users\n * this check was created.\n * It should be removed in the next major version for performance reasons\n */\nfunction throwIfProxyAuthIsSent (headers) {\n  const existProxyAuth = headers && Object.keys(headers)\n    .find((key) => key.toLowerCase() === 'proxy-authorization')\n  if (existProxyAuth) {\n    throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')\n  }\n}\n\nmodule.exports = ProxyAgent\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst RetryHandler = require('../handler/retry-handler')\n\nclass RetryAgent extends Dispatcher {\n  #agent = null\n  #options = null\n  constructor (agent, options = {}) {\n    super(options)\n    this.#agent = agent\n    this.#options = options\n  }\n\n  dispatch (opts, handler) {\n    const retry = new RetryHandler({\n      ...opts,\n      retryOptions: this.#options\n    }, {\n      dispatch: this.#agent.dispatch.bind(this.#agent),\n      handler\n    })\n    return this.#agent.dispatch(opts, retry)\n  }\n\n  close () {\n    return this.#agent.close()\n  }\n\n  destroy () {\n    return this.#agent.destroy()\n  }\n}\n\nmodule.exports = RetryAgent\n","'use strict'\n\n// We include a version number for the Dispatcher API. In case of breaking changes,\n// this version number must be increased to avoid conflicts.\nconst globalDispatcher = Symbol.for('undici.globalDispatcher.1')\nconst { InvalidArgumentError } = require('./core/errors')\nconst Agent = require('./dispatcher/agent')\n\nif (getGlobalDispatcher() === undefined) {\n  setGlobalDispatcher(new Agent())\n}\n\nfunction setGlobalDispatcher (agent) {\n  if (!agent || typeof agent.dispatch !== 'function') {\n    throw new InvalidArgumentError('Argument agent must implement Agent')\n  }\n  Object.defineProperty(globalThis, globalDispatcher, {\n    value: agent,\n    writable: true,\n    enumerable: false,\n    configurable: false\n  })\n}\n\nfunction getGlobalDispatcher () {\n  return globalThis[globalDispatcher]\n}\n\nmodule.exports = {\n  setGlobalDispatcher,\n  getGlobalDispatcher\n}\n","'use strict'\n\nmodule.exports = class DecoratorHandler {\n  #handler\n\n  constructor (handler) {\n    if (typeof handler !== 'object' || handler === null) {\n      throw new TypeError('handler must be an object')\n    }\n    this.#handler = handler\n  }\n\n  onConnect (...args) {\n    return this.#handler.onConnect?.(...args)\n  }\n\n  onError (...args) {\n    return this.#handler.onError?.(...args)\n  }\n\n  onUpgrade (...args) {\n    return this.#handler.onUpgrade?.(...args)\n  }\n\n  onResponseStarted (...args) {\n    return this.#handler.onResponseStarted?.(...args)\n  }\n\n  onHeaders (...args) {\n    return this.#handler.onHeaders?.(...args)\n  }\n\n  onData (...args) {\n    return this.#handler.onData?.(...args)\n  }\n\n  onComplete (...args) {\n    return this.#handler.onComplete?.(...args)\n  }\n\n  onBodySent (...args) {\n    return this.#handler.onBodySent?.(...args)\n  }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('node:assert')\nconst { InvalidArgumentError } = require('../core/errors')\nconst EE = require('node:events')\n\nconst redirectableStatusCodes = [300, 301, 302, 303, 307, 308]\n\nconst kBody = Symbol('body')\n\nclass BodyAsyncIterable {\n  constructor (body) {\n    this[kBody] = body\n    this[kBodyUsed] = false\n  }\n\n  async * [Symbol.asyncIterator] () {\n    assert(!this[kBodyUsed], 'disturbed')\n    this[kBodyUsed] = true\n    yield * this[kBody]\n  }\n}\n\nclass RedirectHandler {\n  constructor (dispatch, maxRedirections, opts, handler) {\n    if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    util.validateHandler(handler, opts.method, opts.upgrade)\n\n    this.dispatch = dispatch\n    this.location = null\n    this.abort = null\n    this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy\n    this.maxRedirections = maxRedirections\n    this.handler = handler\n    this.history = []\n    this.redirectionLimitReached = false\n\n    if (util.isStream(this.opts.body)) {\n      // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n      // so that it can be dispatched again?\n      // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n      if (util.bodyLength(this.opts.body) === 0) {\n        this.opts.body\n          .on('data', function () {\n            assert(false)\n          })\n      }\n\n      if (typeof this.opts.body.readableDidRead !== 'boolean') {\n        this.opts.body[kBodyUsed] = false\n        EE.prototype.on.call(this.opts.body, 'data', function () {\n          this[kBodyUsed] = true\n        })\n      }\n    } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {\n      // TODO (fix): We can't access ReadableStream internal state\n      // to determine whether or not it has been disturbed. This is just\n      // a workaround.\n      this.opts.body = new BodyAsyncIterable(this.opts.body)\n    } else if (\n      this.opts.body &&\n      typeof this.opts.body !== 'string' &&\n      !ArrayBuffer.isView(this.opts.body) &&\n      util.isIterable(this.opts.body)\n    ) {\n      // TODO: Should we allow re-using iterable if !this.opts.idempotent\n      // or through some other flag?\n      this.opts.body = new BodyAsyncIterable(this.opts.body)\n    }\n  }\n\n  onConnect (abort) {\n    this.abort = abort\n    this.handler.onConnect(abort, { history: this.history })\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    this.handler.onUpgrade(statusCode, headers, socket)\n  }\n\n  onError (error) {\n    this.handler.onError(error)\n  }\n\n  onHeaders (statusCode, headers, resume, statusText) {\n    this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)\n      ? null\n      : parseLocation(statusCode, headers)\n\n    if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {\n      if (this.request) {\n        this.request.abort(new Error('max redirects'))\n      }\n\n      this.redirectionLimitReached = true\n      this.abort(new Error('max redirects'))\n      return\n    }\n\n    if (this.opts.origin) {\n      this.history.push(new URL(this.opts.path, this.opts.origin))\n    }\n\n    if (!this.location) {\n      return this.handler.onHeaders(statusCode, headers, resume, statusText)\n    }\n\n    const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))\n    const path = search ? `${pathname}${search}` : pathname\n\n    // Remove headers referring to the original URL.\n    // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.\n    // https://tools.ietf.org/html/rfc7231#section-6.4\n    this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)\n    this.opts.path = path\n    this.opts.origin = origin\n    this.opts.maxRedirections = 0\n    this.opts.query = null\n\n    // https://tools.ietf.org/html/rfc7231#section-6.4.4\n    // In case of HTTP 303, always replace method to be either HEAD or GET\n    if (statusCode === 303 && this.opts.method !== 'HEAD') {\n      this.opts.method = 'GET'\n      this.opts.body = null\n    }\n  }\n\n  onData (chunk) {\n    if (this.location) {\n      /*\n        https://tools.ietf.org/html/rfc7231#section-6.4\n\n        TLDR: undici always ignores 3xx response bodies.\n\n        Redirection is used to serve the requested resource from another URL, so it is assumes that\n        no body is generated (and thus can be ignored). Even though generating a body is not prohibited.\n\n        For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually\n        (which means it's optional and not mandated) contain just an hyperlink to the value of\n        the Location response header, so the body can be ignored safely.\n\n        For status 300, which is \"Multiple Choices\", the spec mentions both generating a Location\n        response header AND a response body with the other possible location to follow.\n        Since the spec explicitly chooses not to specify a format for such body and leave it to\n        servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.\n      */\n    } else {\n      return this.handler.onData(chunk)\n    }\n  }\n\n  onComplete (trailers) {\n    if (this.location) {\n      /*\n        https://tools.ietf.org/html/rfc7231#section-6.4\n\n        TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections\n        and neither are useful if present.\n\n        See comment on onData method above for more detailed information.\n      */\n\n      this.location = null\n      this.abort = null\n\n      this.dispatch(this.opts, this)\n    } else {\n      this.handler.onComplete(trailers)\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this.handler.onBodySent) {\n      this.handler.onBodySent(chunk)\n    }\n  }\n}\n\nfunction parseLocation (statusCode, headers) {\n  if (redirectableStatusCodes.indexOf(statusCode) === -1) {\n    return null\n  }\n\n  for (let i = 0; i < headers.length; i += 2) {\n    if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') {\n      return headers[i + 1]\n    }\n  }\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4.4\nfunction shouldRemoveHeader (header, removeContent, unknownOrigin) {\n  if (header.length === 4) {\n    return util.headerNameToString(header) === 'host'\n  }\n  if (removeContent && util.headerNameToString(header).startsWith('content-')) {\n    return true\n  }\n  if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {\n    const name = util.headerNameToString(header)\n    return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'\n  }\n  return false\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4\nfunction cleanRequestHeaders (headers, removeContent, unknownOrigin) {\n  const ret = []\n  if (Array.isArray(headers)) {\n    for (let i = 0; i < headers.length; i += 2) {\n      if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n        ret.push(headers[i], headers[i + 1])\n      }\n    }\n  } else if (headers && typeof headers === 'object') {\n    for (const key of Object.keys(headers)) {\n      if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n        ret.push(key, headers[key])\n      }\n    }\n  } else {\n    assert(headers == null, 'headers must be an object or an array')\n  }\n  return ret\n}\n\nmodule.exports = RedirectHandler\n","'use strict'\nconst assert = require('node:assert')\n\nconst { kRetryHandlerDefaultRetry } = require('../core/symbols')\nconst { RequestRetryError } = require('../core/errors')\nconst {\n  isDisturbed,\n  parseHeaders,\n  parseRangeHeader,\n  wrapRequestBody\n} = require('../core/util')\n\nfunction calculateRetryAfterHeader (retryAfter) {\n  const current = Date.now()\n  return new Date(retryAfter).getTime() - current\n}\n\nclass RetryHandler {\n  constructor (opts, handlers) {\n    const { retryOptions, ...dispatchOpts } = opts\n    const {\n      // Retry scoped\n      retry: retryFn,\n      maxRetries,\n      maxTimeout,\n      minTimeout,\n      timeoutFactor,\n      // Response scoped\n      methods,\n      errorCodes,\n      retryAfter,\n      statusCodes\n    } = retryOptions ?? {}\n\n    this.dispatch = handlers.dispatch\n    this.handler = handlers.handler\n    this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }\n    this.abort = null\n    this.aborted = false\n    this.retryOpts = {\n      retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],\n      retryAfter: retryAfter ?? true,\n      maxTimeout: maxTimeout ?? 30 * 1000, // 30s,\n      minTimeout: minTimeout ?? 500, // .5s\n      timeoutFactor: timeoutFactor ?? 2,\n      maxRetries: maxRetries ?? 5,\n      // What errors we should retry\n      methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],\n      // Indicates which errors to retry\n      statusCodes: statusCodes ?? [500, 502, 503, 504, 429],\n      // List of errors to retry\n      errorCodes: errorCodes ?? [\n        'ECONNRESET',\n        'ECONNREFUSED',\n        'ENOTFOUND',\n        'ENETDOWN',\n        'ENETUNREACH',\n        'EHOSTDOWN',\n        'EHOSTUNREACH',\n        'EPIPE',\n        'UND_ERR_SOCKET'\n      ]\n    }\n\n    this.retryCount = 0\n    this.retryCountCheckpoint = 0\n    this.start = 0\n    this.end = null\n    this.etag = null\n    this.resume = null\n\n    // Handle possible onConnect duplication\n    this.handler.onConnect(reason => {\n      this.aborted = true\n      if (this.abort) {\n        this.abort(reason)\n      } else {\n        this.reason = reason\n      }\n    })\n  }\n\n  onRequestSent () {\n    if (this.handler.onRequestSent) {\n      this.handler.onRequestSent()\n    }\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    if (this.handler.onUpgrade) {\n      this.handler.onUpgrade(statusCode, headers, socket)\n    }\n  }\n\n  onConnect (abort) {\n    if (this.aborted) {\n      abort(this.reason)\n    } else {\n      this.abort = abort\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this.handler.onBodySent) return this.handler.onBodySent(chunk)\n  }\n\n  static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {\n    const { statusCode, code, headers } = err\n    const { method, retryOptions } = opts\n    const {\n      maxRetries,\n      minTimeout,\n      maxTimeout,\n      timeoutFactor,\n      statusCodes,\n      errorCodes,\n      methods\n    } = retryOptions\n    const { counter } = state\n\n    // Any code that is not a Undici's originated and allowed to retry\n    if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) {\n      cb(err)\n      return\n    }\n\n    // If a set of method are provided and the current method is not in the list\n    if (Array.isArray(methods) && !methods.includes(method)) {\n      cb(err)\n      return\n    }\n\n    // If a set of status code are provided and the current status code is not in the list\n    if (\n      statusCode != null &&\n      Array.isArray(statusCodes) &&\n      !statusCodes.includes(statusCode)\n    ) {\n      cb(err)\n      return\n    }\n\n    // If we reached the max number of retries\n    if (counter > maxRetries) {\n      cb(err)\n      return\n    }\n\n    let retryAfterHeader = headers?.['retry-after']\n    if (retryAfterHeader) {\n      retryAfterHeader = Number(retryAfterHeader)\n      retryAfterHeader = Number.isNaN(retryAfterHeader)\n        ? calculateRetryAfterHeader(retryAfterHeader)\n        : retryAfterHeader * 1e3 // Retry-After is in seconds\n    }\n\n    const retryTimeout =\n      retryAfterHeader > 0\n        ? Math.min(retryAfterHeader, maxTimeout)\n        : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)\n\n    setTimeout(() => cb(null), retryTimeout)\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const headers = parseHeaders(rawHeaders)\n\n    this.retryCount += 1\n\n    if (statusCode >= 300) {\n      if (this.retryOpts.statusCodes.includes(statusCode) === false) {\n        return this.handler.onHeaders(\n          statusCode,\n          rawHeaders,\n          resume,\n          statusMessage\n        )\n      } else {\n        this.abort(\n          new RequestRetryError('Request failed', statusCode, {\n            headers,\n            data: {\n              count: this.retryCount\n            }\n          })\n        )\n        return false\n      }\n    }\n\n    // Checkpoint for resume from where we left it\n    if (this.resume != null) {\n      this.resume = null\n\n      // Only Partial Content 206 supposed to provide Content-Range,\n      // any other status code that partially consumed the payload\n      // should not be retry because it would result in downstream\n      // wrongly concatanete multiple responses.\n      if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {\n        this.abort(\n          new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      const contentRange = parseRangeHeader(headers['content-range'])\n      // If no content range\n      if (!contentRange) {\n        this.abort(\n          new RequestRetryError('Content-Range mismatch', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      // Let's start with a weak etag check\n      if (this.etag != null && this.etag !== headers.etag) {\n        this.abort(\n          new RequestRetryError('ETag mismatch', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      const { start, size, end = size - 1 } = contentRange\n\n      assert(this.start === start, 'content-range mismatch')\n      assert(this.end == null || this.end === end, 'content-range mismatch')\n\n      this.resume = resume\n      return true\n    }\n\n    if (this.end == null) {\n      if (statusCode === 206) {\n        // First time we receive 206\n        const range = parseRangeHeader(headers['content-range'])\n\n        if (range == null) {\n          return this.handler.onHeaders(\n            statusCode,\n            rawHeaders,\n            resume,\n            statusMessage\n          )\n        }\n\n        const { start, size, end = size - 1 } = range\n        assert(\n          start != null && Number.isFinite(start),\n          'content-range mismatch'\n        )\n        assert(end != null && Number.isFinite(end), 'invalid content-length')\n\n        this.start = start\n        this.end = end\n      }\n\n      // We make our best to checkpoint the body for further range headers\n      if (this.end == null) {\n        const contentLength = headers['content-length']\n        this.end = contentLength != null ? Number(contentLength) - 1 : null\n      }\n\n      assert(Number.isFinite(this.start))\n      assert(\n        this.end == null || Number.isFinite(this.end),\n        'invalid content-length'\n      )\n\n      this.resume = resume\n      this.etag = headers.etag != null ? headers.etag : null\n\n      // Weak etags are not useful for comparison nor cache\n      // for instance not safe to assume if the response is byte-per-byte\n      // equal\n      if (this.etag != null && this.etag.startsWith('W/')) {\n        this.etag = null\n      }\n\n      return this.handler.onHeaders(\n        statusCode,\n        rawHeaders,\n        resume,\n        statusMessage\n      )\n    }\n\n    const err = new RequestRetryError('Request failed', statusCode, {\n      headers,\n      data: { count: this.retryCount }\n    })\n\n    this.abort(err)\n\n    return false\n  }\n\n  onData (chunk) {\n    this.start += chunk.length\n\n    return this.handler.onData(chunk)\n  }\n\n  onComplete (rawTrailers) {\n    this.retryCount = 0\n    return this.handler.onComplete(rawTrailers)\n  }\n\n  onError (err) {\n    if (this.aborted || isDisturbed(this.opts.body)) {\n      return this.handler.onError(err)\n    }\n\n    // We reconcile in case of a mix between network errors\n    // and server error response\n    if (this.retryCount - this.retryCountCheckpoint > 0) {\n      // We count the difference between the last checkpoint and the current retry count\n      this.retryCount =\n        this.retryCountCheckpoint +\n        (this.retryCount - this.retryCountCheckpoint)\n    } else {\n      this.retryCount += 1\n    }\n\n    this.retryOpts.retry(\n      err,\n      {\n        state: { counter: this.retryCount },\n        opts: { retryOptions: this.retryOpts, ...this.opts }\n      },\n      onRetry.bind(this)\n    )\n\n    function onRetry (err) {\n      if (err != null || this.aborted || isDisturbed(this.opts.body)) {\n        return this.handler.onError(err)\n      }\n\n      if (this.start !== 0) {\n        const headers = { range: `bytes=${this.start}-${this.end ?? ''}` }\n\n        // Weak etag check - weak etags will make comparison algorithms never match\n        if (this.etag != null) {\n          headers['if-match'] = this.etag\n        }\n\n        this.opts = {\n          ...this.opts,\n          headers: {\n            ...this.opts.headers,\n            ...headers\n          }\n        }\n      }\n\n      try {\n        this.retryCountCheckpoint = this.retryCount\n        this.dispatch(this.opts, this)\n      } catch (err) {\n        this.handler.onError(err)\n      }\n    }\n  }\n}\n\nmodule.exports = RetryHandler\n","'use strict'\nconst { isIP } = require('node:net')\nconst { lookup } = require('node:dns')\nconst DecoratorHandler = require('../handler/decorator-handler')\nconst { InvalidArgumentError, InformationalError } = require('../core/errors')\nconst maxInt = Math.pow(2, 31) - 1\n\nclass DNSInstance {\n  #maxTTL = 0\n  #maxItems = 0\n  #records = new Map()\n  dualStack = true\n  affinity = null\n  lookup = null\n  pick = null\n\n  constructor (opts) {\n    this.#maxTTL = opts.maxTTL\n    this.#maxItems = opts.maxItems\n    this.dualStack = opts.dualStack\n    this.affinity = opts.affinity\n    this.lookup = opts.lookup ?? this.#defaultLookup\n    this.pick = opts.pick ?? this.#defaultPick\n  }\n\n  get full () {\n    return this.#records.size === this.#maxItems\n  }\n\n  runLookup (origin, opts, cb) {\n    const ips = this.#records.get(origin.hostname)\n\n    // If full, we just return the origin\n    if (ips == null && this.full) {\n      cb(null, origin.origin)\n      return\n    }\n\n    const newOpts = {\n      affinity: this.affinity,\n      dualStack: this.dualStack,\n      lookup: this.lookup,\n      pick: this.pick,\n      ...opts.dns,\n      maxTTL: this.#maxTTL,\n      maxItems: this.#maxItems\n    }\n\n    // If no IPs we lookup\n    if (ips == null) {\n      this.lookup(origin, newOpts, (err, addresses) => {\n        if (err || addresses == null || addresses.length === 0) {\n          cb(err ?? new InformationalError('No DNS entries found'))\n          return\n        }\n\n        this.setRecords(origin, addresses)\n        const records = this.#records.get(origin.hostname)\n\n        const ip = this.pick(\n          origin,\n          records,\n          newOpts.affinity\n        )\n\n        let port\n        if (typeof ip.port === 'number') {\n          port = `:${ip.port}`\n        } else if (origin.port !== '') {\n          port = `:${origin.port}`\n        } else {\n          port = ''\n        }\n\n        cb(\n          null,\n          `${origin.protocol}//${\n            ip.family === 6 ? `[${ip.address}]` : ip.address\n          }${port}`\n        )\n      })\n    } else {\n      // If there's IPs we pick\n      const ip = this.pick(\n        origin,\n        ips,\n        newOpts.affinity\n      )\n\n      // If no IPs we lookup - deleting old records\n      if (ip == null) {\n        this.#records.delete(origin.hostname)\n        this.runLookup(origin, opts, cb)\n        return\n      }\n\n      let port\n      if (typeof ip.port === 'number') {\n        port = `:${ip.port}`\n      } else if (origin.port !== '') {\n        port = `:${origin.port}`\n      } else {\n        port = ''\n      }\n\n      cb(\n        null,\n        `${origin.protocol}//${\n          ip.family === 6 ? `[${ip.address}]` : ip.address\n        }${port}`\n      )\n    }\n  }\n\n  #defaultLookup (origin, opts, cb) {\n    lookup(\n      origin.hostname,\n      {\n        all: true,\n        family: this.dualStack === false ? this.affinity : 0,\n        order: 'ipv4first'\n      },\n      (err, addresses) => {\n        if (err) {\n          return cb(err)\n        }\n\n        const results = new Map()\n\n        for (const addr of addresses) {\n          // On linux we found duplicates, we attempt to remove them with\n          // the latest record\n          results.set(`${addr.address}:${addr.family}`, addr)\n        }\n\n        cb(null, results.values())\n      }\n    )\n  }\n\n  #defaultPick (origin, hostnameRecords, affinity) {\n    let ip = null\n    const { records, offset } = hostnameRecords\n\n    let family\n    if (this.dualStack) {\n      if (affinity == null) {\n        // Balance between ip families\n        if (offset == null || offset === maxInt) {\n          hostnameRecords.offset = 0\n          affinity = 4\n        } else {\n          hostnameRecords.offset++\n          affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4\n        }\n      }\n\n      if (records[affinity] != null && records[affinity].ips.length > 0) {\n        family = records[affinity]\n      } else {\n        family = records[affinity === 4 ? 6 : 4]\n      }\n    } else {\n      family = records[affinity]\n    }\n\n    // If no IPs we return null\n    if (family == null || family.ips.length === 0) {\n      return ip\n    }\n\n    if (family.offset == null || family.offset === maxInt) {\n      family.offset = 0\n    } else {\n      family.offset++\n    }\n\n    const position = family.offset % family.ips.length\n    ip = family.ips[position] ?? null\n\n    if (ip == null) {\n      return ip\n    }\n\n    if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms\n      // We delete expired records\n      // It is possible that they have different TTL, so we manage them individually\n      family.ips.splice(position, 1)\n      return this.pick(origin, hostnameRecords, affinity)\n    }\n\n    return ip\n  }\n\n  setRecords (origin, addresses) {\n    const timestamp = Date.now()\n    const records = { records: { 4: null, 6: null } }\n    for (const record of addresses) {\n      record.timestamp = timestamp\n      if (typeof record.ttl === 'number') {\n        // The record TTL is expected to be in ms\n        record.ttl = Math.min(record.ttl, this.#maxTTL)\n      } else {\n        record.ttl = this.#maxTTL\n      }\n\n      const familyRecords = records.records[record.family] ?? { ips: [] }\n\n      familyRecords.ips.push(record)\n      records.records[record.family] = familyRecords\n    }\n\n    this.#records.set(origin.hostname, records)\n  }\n\n  getHandler (meta, opts) {\n    return new DNSDispatchHandler(this, meta, opts)\n  }\n}\n\nclass DNSDispatchHandler extends DecoratorHandler {\n  #state = null\n  #opts = null\n  #dispatch = null\n  #handler = null\n  #origin = null\n\n  constructor (state, { origin, handler, dispatch }, opts) {\n    super(handler)\n    this.#origin = origin\n    this.#handler = handler\n    this.#opts = { ...opts }\n    this.#state = state\n    this.#dispatch = dispatch\n  }\n\n  onError (err) {\n    switch (err.code) {\n      case 'ETIMEDOUT':\n      case 'ECONNREFUSED': {\n        if (this.#state.dualStack) {\n          // We delete the record and retry\n          this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => {\n            if (err) {\n              return this.#handler.onError(err)\n            }\n\n            const dispatchOpts = {\n              ...this.#opts,\n              origin: newOrigin\n            }\n\n            this.#dispatch(dispatchOpts, this)\n          })\n\n          // if dual-stack disabled, we error out\n          return\n        }\n\n        this.#handler.onError(err)\n        return\n      }\n      case 'ENOTFOUND':\n        this.#state.deleteRecord(this.#origin)\n      // eslint-disable-next-line no-fallthrough\n      default:\n        this.#handler.onError(err)\n        break\n    }\n  }\n}\n\nmodule.exports = interceptorOpts => {\n  if (\n    interceptorOpts?.maxTTL != null &&\n    (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0)\n  ) {\n    throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number')\n  }\n\n  if (\n    interceptorOpts?.maxItems != null &&\n    (typeof interceptorOpts?.maxItems !== 'number' ||\n      interceptorOpts?.maxItems < 1)\n  ) {\n    throw new InvalidArgumentError(\n      'Invalid maxItems. Must be a positive number and greater than zero'\n    )\n  }\n\n  if (\n    interceptorOpts?.affinity != null &&\n    interceptorOpts?.affinity !== 4 &&\n    interceptorOpts?.affinity !== 6\n  ) {\n    throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6')\n  }\n\n  if (\n    interceptorOpts?.dualStack != null &&\n    typeof interceptorOpts?.dualStack !== 'boolean'\n  ) {\n    throw new InvalidArgumentError('Invalid dualStack. Must be a boolean')\n  }\n\n  if (\n    interceptorOpts?.lookup != null &&\n    typeof interceptorOpts?.lookup !== 'function'\n  ) {\n    throw new InvalidArgumentError('Invalid lookup. Must be a function')\n  }\n\n  if (\n    interceptorOpts?.pick != null &&\n    typeof interceptorOpts?.pick !== 'function'\n  ) {\n    throw new InvalidArgumentError('Invalid pick. Must be a function')\n  }\n\n  const dualStack = interceptorOpts?.dualStack ?? true\n  let affinity\n  if (dualStack) {\n    affinity = interceptorOpts?.affinity ?? null\n  } else {\n    affinity = interceptorOpts?.affinity ?? 4\n  }\n\n  const opts = {\n    maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms\n    lookup: interceptorOpts?.lookup ?? null,\n    pick: interceptorOpts?.pick ?? null,\n    dualStack,\n    affinity,\n    maxItems: interceptorOpts?.maxItems ?? Infinity\n  }\n\n  const instance = new DNSInstance(opts)\n\n  return dispatch => {\n    return function dnsInterceptor (origDispatchOpts, handler) {\n      const origin =\n        origDispatchOpts.origin.constructor === URL\n          ? origDispatchOpts.origin\n          : new URL(origDispatchOpts.origin)\n\n      if (isIP(origin.hostname) !== 0) {\n        return dispatch(origDispatchOpts, handler)\n      }\n\n      instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {\n        if (err) {\n          return handler.onError(err)\n        }\n\n        let dispatchOpts = null\n        dispatchOpts = {\n          ...origDispatchOpts,\n          servername: origin.hostname, // For SNI on TLS\n          origin: newOrigin,\n          headers: {\n            host: origin.hostname,\n            ...origDispatchOpts.headers\n          }\n        }\n\n        dispatch(\n          dispatchOpts,\n          instance.getHandler({ origin, dispatch, handler }, origDispatchOpts)\n        )\n      })\n\n      return true\n    }\n  }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst DecoratorHandler = require('../handler/decorator-handler')\n\nclass DumpHandler extends DecoratorHandler {\n  #maxSize = 1024 * 1024\n  #abort = null\n  #dumped = false\n  #aborted = false\n  #size = 0\n  #reason = null\n  #handler = null\n\n  constructor ({ maxSize }, handler) {\n    super(handler)\n\n    if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {\n      throw new InvalidArgumentError('maxSize must be a number greater than 0')\n    }\n\n    this.#maxSize = maxSize ?? this.#maxSize\n    this.#handler = handler\n  }\n\n  onConnect (abort) {\n    this.#abort = abort\n\n    this.#handler.onConnect(this.#customAbort.bind(this))\n  }\n\n  #customAbort (reason) {\n    this.#aborted = true\n    this.#reason = reason\n  }\n\n  // TODO: will require adjustment after new hooks are out\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const headers = util.parseHeaders(rawHeaders)\n    const contentLength = headers['content-length']\n\n    if (contentLength != null && contentLength > this.#maxSize) {\n      throw new RequestAbortedError(\n        `Response size (${contentLength}) larger than maxSize (${\n          this.#maxSize\n        })`\n      )\n    }\n\n    if (this.#aborted) {\n      return true\n    }\n\n    return this.#handler.onHeaders(\n      statusCode,\n      rawHeaders,\n      resume,\n      statusMessage\n    )\n  }\n\n  onError (err) {\n    if (this.#dumped) {\n      return\n    }\n\n    err = this.#reason ?? err\n\n    this.#handler.onError(err)\n  }\n\n  onData (chunk) {\n    this.#size = this.#size + chunk.length\n\n    if (this.#size >= this.#maxSize) {\n      this.#dumped = true\n\n      if (this.#aborted) {\n        this.#handler.onError(this.#reason)\n      } else {\n        this.#handler.onComplete([])\n      }\n    }\n\n    return true\n  }\n\n  onComplete (trailers) {\n    if (this.#dumped) {\n      return\n    }\n\n    if (this.#aborted) {\n      this.#handler.onError(this.reason)\n      return\n    }\n\n    this.#handler.onComplete(trailers)\n  }\n}\n\nfunction createDumpInterceptor (\n  { maxSize: defaultMaxSize } = {\n    maxSize: 1024 * 1024\n  }\n) {\n  return dispatch => {\n    return function Intercept (opts, handler) {\n      const { dumpMaxSize = defaultMaxSize } =\n        opts\n\n      const dumpHandler = new DumpHandler(\n        { maxSize: dumpMaxSize },\n        handler\n      )\n\n      return dispatch(opts, dumpHandler)\n    }\n  }\n}\n\nmodule.exports = createDumpInterceptor\n","'use strict'\n\nconst RedirectHandler = require('../handler/redirect-handler')\n\nfunction createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {\n  return (dispatch) => {\n    return function Intercept (opts, handler) {\n      const { maxRedirections = defaultMaxRedirections } = opts\n\n      if (!maxRedirections) {\n        return dispatch(opts, handler)\n      }\n\n      const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)\n      opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.\n      return dispatch(opts, redirectHandler)\n    }\n  }\n}\n\nmodule.exports = createRedirectInterceptor\n","'use strict'\nconst RedirectHandler = require('../handler/redirect-handler')\n\nmodule.exports = opts => {\n  const globalMaxRedirections = opts?.maxRedirections\n  return dispatch => {\n    return function redirectInterceptor (opts, handler) {\n      const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts\n\n      if (!maxRedirections) {\n        return dispatch(opts, handler)\n      }\n\n      const redirectHandler = new RedirectHandler(\n        dispatch,\n        maxRedirections,\n        opts,\n        handler\n      )\n\n      return dispatch(baseOpts, redirectHandler)\n    }\n  }\n}\n","'use strict'\nconst RetryHandler = require('../handler/retry-handler')\n\nmodule.exports = globalOpts => {\n  return dispatch => {\n    return function retryInterceptor (opts, handler) {\n      return dispatch(\n        opts,\n        new RetryHandler(\n          { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },\n          {\n            handler,\n            dispatch\n          }\n        )\n      )\n    }\n  }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;\nconst utils_1 = require(\"./utils\");\n// C headers\nvar ERROR;\n(function (ERROR) {\n    ERROR[ERROR[\"OK\"] = 0] = \"OK\";\n    ERROR[ERROR[\"INTERNAL\"] = 1] = \"INTERNAL\";\n    ERROR[ERROR[\"STRICT\"] = 2] = \"STRICT\";\n    ERROR[ERROR[\"LF_EXPECTED\"] = 3] = \"LF_EXPECTED\";\n    ERROR[ERROR[\"UNEXPECTED_CONTENT_LENGTH\"] = 4] = \"UNEXPECTED_CONTENT_LENGTH\";\n    ERROR[ERROR[\"CLOSED_CONNECTION\"] = 5] = \"CLOSED_CONNECTION\";\n    ERROR[ERROR[\"INVALID_METHOD\"] = 6] = \"INVALID_METHOD\";\n    ERROR[ERROR[\"INVALID_URL\"] = 7] = \"INVALID_URL\";\n    ERROR[ERROR[\"INVALID_CONSTANT\"] = 8] = \"INVALID_CONSTANT\";\n    ERROR[ERROR[\"INVALID_VERSION\"] = 9] = \"INVALID_VERSION\";\n    ERROR[ERROR[\"INVALID_HEADER_TOKEN\"] = 10] = \"INVALID_HEADER_TOKEN\";\n    ERROR[ERROR[\"INVALID_CONTENT_LENGTH\"] = 11] = \"INVALID_CONTENT_LENGTH\";\n    ERROR[ERROR[\"INVALID_CHUNK_SIZE\"] = 12] = \"INVALID_CHUNK_SIZE\";\n    ERROR[ERROR[\"INVALID_STATUS\"] = 13] = \"INVALID_STATUS\";\n    ERROR[ERROR[\"INVALID_EOF_STATE\"] = 14] = \"INVALID_EOF_STATE\";\n    ERROR[ERROR[\"INVALID_TRANSFER_ENCODING\"] = 15] = \"INVALID_TRANSFER_ENCODING\";\n    ERROR[ERROR[\"CB_MESSAGE_BEGIN\"] = 16] = \"CB_MESSAGE_BEGIN\";\n    ERROR[ERROR[\"CB_HEADERS_COMPLETE\"] = 17] = \"CB_HEADERS_COMPLETE\";\n    ERROR[ERROR[\"CB_MESSAGE_COMPLETE\"] = 18] = \"CB_MESSAGE_COMPLETE\";\n    ERROR[ERROR[\"CB_CHUNK_HEADER\"] = 19] = \"CB_CHUNK_HEADER\";\n    ERROR[ERROR[\"CB_CHUNK_COMPLETE\"] = 20] = \"CB_CHUNK_COMPLETE\";\n    ERROR[ERROR[\"PAUSED\"] = 21] = \"PAUSED\";\n    ERROR[ERROR[\"PAUSED_UPGRADE\"] = 22] = \"PAUSED_UPGRADE\";\n    ERROR[ERROR[\"PAUSED_H2_UPGRADE\"] = 23] = \"PAUSED_H2_UPGRADE\";\n    ERROR[ERROR[\"USER\"] = 24] = \"USER\";\n})(ERROR = exports.ERROR || (exports.ERROR = {}));\nvar TYPE;\n(function (TYPE) {\n    TYPE[TYPE[\"BOTH\"] = 0] = \"BOTH\";\n    TYPE[TYPE[\"REQUEST\"] = 1] = \"REQUEST\";\n    TYPE[TYPE[\"RESPONSE\"] = 2] = \"RESPONSE\";\n})(TYPE = exports.TYPE || (exports.TYPE = {}));\nvar FLAGS;\n(function (FLAGS) {\n    FLAGS[FLAGS[\"CONNECTION_KEEP_ALIVE\"] = 1] = \"CONNECTION_KEEP_ALIVE\";\n    FLAGS[FLAGS[\"CONNECTION_CLOSE\"] = 2] = \"CONNECTION_CLOSE\";\n    FLAGS[FLAGS[\"CONNECTION_UPGRADE\"] = 4] = \"CONNECTION_UPGRADE\";\n    FLAGS[FLAGS[\"CHUNKED\"] = 8] = \"CHUNKED\";\n    FLAGS[FLAGS[\"UPGRADE\"] = 16] = \"UPGRADE\";\n    FLAGS[FLAGS[\"CONTENT_LENGTH\"] = 32] = \"CONTENT_LENGTH\";\n    FLAGS[FLAGS[\"SKIPBODY\"] = 64] = \"SKIPBODY\";\n    FLAGS[FLAGS[\"TRAILING\"] = 128] = \"TRAILING\";\n    // 1 << 8 is unused\n    FLAGS[FLAGS[\"TRANSFER_ENCODING\"] = 512] = \"TRANSFER_ENCODING\";\n})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));\nvar LENIENT_FLAGS;\n(function (LENIENT_FLAGS) {\n    LENIENT_FLAGS[LENIENT_FLAGS[\"HEADERS\"] = 1] = \"HEADERS\";\n    LENIENT_FLAGS[LENIENT_FLAGS[\"CHUNKED_LENGTH\"] = 2] = \"CHUNKED_LENGTH\";\n    LENIENT_FLAGS[LENIENT_FLAGS[\"KEEP_ALIVE\"] = 4] = \"KEEP_ALIVE\";\n})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));\nvar METHODS;\n(function (METHODS) {\n    METHODS[METHODS[\"DELETE\"] = 0] = \"DELETE\";\n    METHODS[METHODS[\"GET\"] = 1] = \"GET\";\n    METHODS[METHODS[\"HEAD\"] = 2] = \"HEAD\";\n    METHODS[METHODS[\"POST\"] = 3] = \"POST\";\n    METHODS[METHODS[\"PUT\"] = 4] = \"PUT\";\n    /* pathological */\n    METHODS[METHODS[\"CONNECT\"] = 5] = \"CONNECT\";\n    METHODS[METHODS[\"OPTIONS\"] = 6] = \"OPTIONS\";\n    METHODS[METHODS[\"TRACE\"] = 7] = \"TRACE\";\n    /* WebDAV */\n    METHODS[METHODS[\"COPY\"] = 8] = \"COPY\";\n    METHODS[METHODS[\"LOCK\"] = 9] = \"LOCK\";\n    METHODS[METHODS[\"MKCOL\"] = 10] = \"MKCOL\";\n    METHODS[METHODS[\"MOVE\"] = 11] = \"MOVE\";\n    METHODS[METHODS[\"PROPFIND\"] = 12] = \"PROPFIND\";\n    METHODS[METHODS[\"PROPPATCH\"] = 13] = \"PROPPATCH\";\n    METHODS[METHODS[\"SEARCH\"] = 14] = \"SEARCH\";\n    METHODS[METHODS[\"UNLOCK\"] = 15] = \"UNLOCK\";\n    METHODS[METHODS[\"BIND\"] = 16] = \"BIND\";\n    METHODS[METHODS[\"REBIND\"] = 17] = \"REBIND\";\n    METHODS[METHODS[\"UNBIND\"] = 18] = \"UNBIND\";\n    METHODS[METHODS[\"ACL\"] = 19] = \"ACL\";\n    /* subversion */\n    METHODS[METHODS[\"REPORT\"] = 20] = \"REPORT\";\n    METHODS[METHODS[\"MKACTIVITY\"] = 21] = \"MKACTIVITY\";\n    METHODS[METHODS[\"CHECKOUT\"] = 22] = \"CHECKOUT\";\n    METHODS[METHODS[\"MERGE\"] = 23] = \"MERGE\";\n    /* upnp */\n    METHODS[METHODS[\"M-SEARCH\"] = 24] = \"M-SEARCH\";\n    METHODS[METHODS[\"NOTIFY\"] = 25] = \"NOTIFY\";\n    METHODS[METHODS[\"SUBSCRIBE\"] = 26] = \"SUBSCRIBE\";\n    METHODS[METHODS[\"UNSUBSCRIBE\"] = 27] = \"UNSUBSCRIBE\";\n    /* RFC-5789 */\n    METHODS[METHODS[\"PATCH\"] = 28] = \"PATCH\";\n    METHODS[METHODS[\"PURGE\"] = 29] = \"PURGE\";\n    /* CalDAV */\n    METHODS[METHODS[\"MKCALENDAR\"] = 30] = \"MKCALENDAR\";\n    /* RFC-2068, section 19.6.1.2 */\n    METHODS[METHODS[\"LINK\"] = 31] = \"LINK\";\n    METHODS[METHODS[\"UNLINK\"] = 32] = \"UNLINK\";\n    /* icecast */\n    METHODS[METHODS[\"SOURCE\"] = 33] = \"SOURCE\";\n    /* RFC-7540, section 11.6 */\n    METHODS[METHODS[\"PRI\"] = 34] = \"PRI\";\n    /* RFC-2326 RTSP */\n    METHODS[METHODS[\"DESCRIBE\"] = 35] = \"DESCRIBE\";\n    METHODS[METHODS[\"ANNOUNCE\"] = 36] = \"ANNOUNCE\";\n    METHODS[METHODS[\"SETUP\"] = 37] = \"SETUP\";\n    METHODS[METHODS[\"PLAY\"] = 38] = \"PLAY\";\n    METHODS[METHODS[\"PAUSE\"] = 39] = \"PAUSE\";\n    METHODS[METHODS[\"TEARDOWN\"] = 40] = \"TEARDOWN\";\n    METHODS[METHODS[\"GET_PARAMETER\"] = 41] = \"GET_PARAMETER\";\n    METHODS[METHODS[\"SET_PARAMETER\"] = 42] = \"SET_PARAMETER\";\n    METHODS[METHODS[\"REDIRECT\"] = 43] = \"REDIRECT\";\n    METHODS[METHODS[\"RECORD\"] = 44] = \"RECORD\";\n    /* RAOP */\n    METHODS[METHODS[\"FLUSH\"] = 45] = \"FLUSH\";\n})(METHODS = exports.METHODS || (exports.METHODS = {}));\nexports.METHODS_HTTP = [\n    METHODS.DELETE,\n    METHODS.GET,\n    METHODS.HEAD,\n    METHODS.POST,\n    METHODS.PUT,\n    METHODS.CONNECT,\n    METHODS.OPTIONS,\n    METHODS.TRACE,\n    METHODS.COPY,\n    METHODS.LOCK,\n    METHODS.MKCOL,\n    METHODS.MOVE,\n    METHODS.PROPFIND,\n    METHODS.PROPPATCH,\n    METHODS.SEARCH,\n    METHODS.UNLOCK,\n    METHODS.BIND,\n    METHODS.REBIND,\n    METHODS.UNBIND,\n    METHODS.ACL,\n    METHODS.REPORT,\n    METHODS.MKACTIVITY,\n    METHODS.CHECKOUT,\n    METHODS.MERGE,\n    METHODS['M-SEARCH'],\n    METHODS.NOTIFY,\n    METHODS.SUBSCRIBE,\n    METHODS.UNSUBSCRIBE,\n    METHODS.PATCH,\n    METHODS.PURGE,\n    METHODS.MKCALENDAR,\n    METHODS.LINK,\n    METHODS.UNLINK,\n    METHODS.PRI,\n    // TODO(indutny): should we allow it with HTTP?\n    METHODS.SOURCE,\n];\nexports.METHODS_ICE = [\n    METHODS.SOURCE,\n];\nexports.METHODS_RTSP = [\n    METHODS.OPTIONS,\n    METHODS.DESCRIBE,\n    METHODS.ANNOUNCE,\n    METHODS.SETUP,\n    METHODS.PLAY,\n    METHODS.PAUSE,\n    METHODS.TEARDOWN,\n    METHODS.GET_PARAMETER,\n    METHODS.SET_PARAMETER,\n    METHODS.REDIRECT,\n    METHODS.RECORD,\n    METHODS.FLUSH,\n    // For AirPlay\n    METHODS.GET,\n    METHODS.POST,\n];\nexports.METHOD_MAP = utils_1.enumToMap(METHODS);\nexports.H_METHOD_MAP = {};\nObject.keys(exports.METHOD_MAP).forEach((key) => {\n    if (/^H/.test(key)) {\n        exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];\n    }\n});\nvar FINISH;\n(function (FINISH) {\n    FINISH[FINISH[\"SAFE\"] = 0] = \"SAFE\";\n    FINISH[FINISH[\"SAFE_WITH_CB\"] = 1] = \"SAFE_WITH_CB\";\n    FINISH[FINISH[\"UNSAFE\"] = 2] = \"UNSAFE\";\n})(FINISH = exports.FINISH || (exports.FINISH = {}));\nexports.ALPHA = [];\nfor (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {\n    // Upper case\n    exports.ALPHA.push(String.fromCharCode(i));\n    // Lower case\n    exports.ALPHA.push(String.fromCharCode(i + 0x20));\n}\nexports.NUM_MAP = {\n    0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n    5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n};\nexports.HEX_MAP = {\n    0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n    5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n    A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,\n    a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,\n};\nexports.NUM = [\n    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n];\nexports.ALPHANUM = exports.ALPHA.concat(exports.NUM);\nexports.MARK = ['-', '_', '.', '!', '~', '*', '\\'', '(', ')'];\nexports.USERINFO_CHARS = exports.ALPHANUM\n    .concat(exports.MARK)\n    .concat(['%', ';', ':', '&', '=', '+', '$', ',']);\n// TODO(indutny): use RFC\nexports.STRICT_URL_CHAR = [\n    '!', '\"', '$', '%', '&', '\\'',\n    '(', ')', '*', '+', ',', '-', '.', '/',\n    ':', ';', '<', '=', '>',\n    '@', '[', '\\\\', ']', '^', '_',\n    '`',\n    '{', '|', '}', '~',\n].concat(exports.ALPHANUM);\nexports.URL_CHAR = exports.STRICT_URL_CHAR\n    .concat(['\\t', '\\f']);\n// All characters with 0x80 bit set to 1\nfor (let i = 0x80; i <= 0xff; i++) {\n    exports.URL_CHAR.push(i);\n}\nexports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);\n/* Tokens as defined by rfc 2616. Also lowercases them.\n *        token       = 1*\n *     separators     = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n *                    | \",\" | \";\" | \":\" | \"\\\" | <\">\n *                    | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n *                    | \"{\" | \"}\" | SP | HT\n */\nexports.STRICT_TOKEN = [\n    '!', '#', '$', '%', '&', '\\'',\n    '*', '+', '-', '.',\n    '^', '_', '`',\n    '|', '~',\n].concat(exports.ALPHANUM);\nexports.TOKEN = exports.STRICT_TOKEN.concat([' ']);\n/*\n * Verify that a char is a valid visible (printable) US-ASCII\n * character or %x80-FF\n */\nexports.HEADER_CHARS = ['\\t'];\nfor (let i = 32; i <= 255; i++) {\n    if (i !== 127) {\n        exports.HEADER_CHARS.push(i);\n    }\n}\n// ',' = \\x44\nexports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);\nexports.MAJOR = exports.NUM_MAP;\nexports.MINOR = exports.MAJOR;\nvar HEADER_STATE;\n(function (HEADER_STATE) {\n    HEADER_STATE[HEADER_STATE[\"GENERAL\"] = 0] = \"GENERAL\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION\"] = 1] = \"CONNECTION\";\n    HEADER_STATE[HEADER_STATE[\"CONTENT_LENGTH\"] = 2] = \"CONTENT_LENGTH\";\n    HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING\"] = 3] = \"TRANSFER_ENCODING\";\n    HEADER_STATE[HEADER_STATE[\"UPGRADE\"] = 4] = \"UPGRADE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_KEEP_ALIVE\"] = 5] = \"CONNECTION_KEEP_ALIVE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_CLOSE\"] = 6] = \"CONNECTION_CLOSE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_UPGRADE\"] = 7] = \"CONNECTION_UPGRADE\";\n    HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING_CHUNKED\"] = 8] = \"TRANSFER_ENCODING_CHUNKED\";\n})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));\nexports.SPECIAL_HEADERS = {\n    'connection': HEADER_STATE.CONNECTION,\n    'content-length': HEADER_STATE.CONTENT_LENGTH,\n    'proxy-connection': HEADER_STATE.CONNECTION,\n    'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,\n    'upgrade': HEADER_STATE.UPGRADE,\n};\n//# sourceMappingURL=constants.js.map","'use strict'\n\nconst { Buffer } = require('node:buffer')\n\nmodule.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMB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gADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQF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gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQ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BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64')\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enumToMap = void 0;\nfunction enumToMap(obj) {\n    const res = {};\n    Object.keys(obj).forEach((key) => {\n        const value = obj[key];\n        if (typeof value === 'number') {\n            res[key] = value;\n        }\n    });\n    return res;\n}\nexports.enumToMap = enumToMap;\n//# sourceMappingURL=utils.js.map","'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../dispatcher/agent')\nconst {\n  kAgent,\n  kMockAgentSet,\n  kMockAgentGet,\n  kDispatches,\n  kIsMockActive,\n  kNetConnect,\n  kGetNetConnect,\n  kOptions,\n  kFactory\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, buildMockOptions } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher/dispatcher')\nconst Pluralizer = require('./pluralizer')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\n\nclass MockAgent extends Dispatcher {\n  constructor (opts) {\n    super(opts)\n\n    this[kNetConnect] = true\n    this[kIsMockActive] = true\n\n    // Instantiate Agent and encapsulate\n    if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n    const agent = opts?.agent ? opts.agent : new Agent(opts)\n    this[kAgent] = agent\n\n    this[kClients] = agent[kClients]\n    this[kOptions] = buildMockOptions(opts)\n  }\n\n  get (origin) {\n    let dispatcher = this[kMockAgentGet](origin)\n\n    if (!dispatcher) {\n      dispatcher = this[kFactory](origin)\n      this[kMockAgentSet](origin, dispatcher)\n    }\n    return dispatcher\n  }\n\n  dispatch (opts, handler) {\n    // Call MockAgent.get to perform additional setup before dispatching as normal\n    this.get(opts.origin)\n    return this[kAgent].dispatch(opts, handler)\n  }\n\n  async close () {\n    await this[kAgent].close()\n    this[kClients].clear()\n  }\n\n  deactivate () {\n    this[kIsMockActive] = false\n  }\n\n  activate () {\n    this[kIsMockActive] = true\n  }\n\n  enableNetConnect (matcher) {\n    if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n      if (Array.isArray(this[kNetConnect])) {\n        this[kNetConnect].push(matcher)\n      } else {\n        this[kNetConnect] = [matcher]\n      }\n    } else if (typeof matcher === 'undefined') {\n      this[kNetConnect] = true\n    } else {\n      throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n    }\n  }\n\n  disableNetConnect () {\n    this[kNetConnect] = false\n  }\n\n  // This is required to bypass issues caused by using global symbols - see:\n  // https://github.com/nodejs/undici/issues/1447\n  get isMockActive () {\n    return this[kIsMockActive]\n  }\n\n  [kMockAgentSet] (origin, dispatcher) {\n    this[kClients].set(origin, dispatcher)\n  }\n\n  [kFactory] (origin) {\n    const mockOptions = Object.assign({ agent: this }, this[kOptions])\n    return this[kOptions] && this[kOptions].connections === 1\n      ? new MockClient(origin, mockOptions)\n      : new MockPool(origin, mockOptions)\n  }\n\n  [kMockAgentGet] (origin) {\n    // First check if we can immediately find it\n    const client = this[kClients].get(origin)\n    if (client) {\n      return client\n    }\n\n    // If the origin is not a string create a dummy parent pool and return to user\n    if (typeof origin !== 'string') {\n      const dispatcher = this[kFactory]('http://localhost:9999')\n      this[kMockAgentSet](origin, dispatcher)\n      return dispatcher\n    }\n\n    // If we match, create a pool and assign the same dispatches\n    for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) {\n      if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n        const dispatcher = this[kFactory](origin)\n        this[kMockAgentSet](origin, dispatcher)\n        dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]\n        return dispatcher\n      }\n    }\n  }\n\n  [kGetNetConnect] () {\n    return this[kNetConnect]\n  }\n\n  pendingInterceptors () {\n    const mockAgentClients = this[kClients]\n\n    return Array.from(mockAgentClients.entries())\n      .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n      .filter(({ pending }) => pending)\n  }\n\n  assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n    const pending = this.pendingInterceptors()\n\n    if (pending.length === 0) {\n      return\n    }\n\n    const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)\n\n    throw new UndiciError(`\n${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:\n\n${pendingInterceptorsFormatter.format(pending)}\n`.trim())\n  }\n}\n\nmodule.exports = MockAgent\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Client = require('../dispatcher/client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kMockAgent,\n  kClose,\n  kOriginalClose,\n  kOrigin,\n  kOriginalDispatch,\n  kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n  constructor (origin, opts) {\n    super(origin, opts)\n\n    if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n\n    this[kMockAgent] = opts.agent\n    this[kOrigin] = origin\n    this[kDispatches] = []\n    this[kConnected] = 1\n    this[kOriginalDispatch] = this.dispatch\n    this[kOriginalClose] = this.close.bind(this)\n\n    this.dispatch = buildMockDispatch.call(this)\n    this.close = this[kClose]\n  }\n\n  get [Symbols.kConnected] () {\n    return this[kConnected]\n  }\n\n  /**\n   * Sets up the base interceptor for mocking replies from undici.\n   */\n  intercept (opts) {\n    return new MockInterceptor(opts, this[kDispatches])\n  }\n\n  async [kClose] () {\n    await promisify(this[kOriginalClose])()\n    this[kConnected] = 0\n    this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n  }\n}\n\nmodule.exports = MockClient\n","'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nconst kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')\n\n/**\n * The request does not match any registered mock dispatches.\n */\nclass MockNotMatchedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    Error.captureStackTrace(this, MockNotMatchedError)\n    this.name = 'MockNotMatchedError'\n    this.message = message || 'The request does not match any registered mock dispatches'\n    this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kMockNotMatchedError] === true\n  }\n\n  [kMockNotMatchedError] = true\n}\n\nmodule.exports = {\n  MockNotMatchedError\n}\n","'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kDispatchKey,\n  kDefaultHeaders,\n  kDefaultTrailers,\n  kContentLength,\n  kMockDispatch\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { buildURL } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n  constructor (mockDispatch) {\n    this[kMockDispatch] = mockDispatch\n  }\n\n  /**\n   * Delay a reply by a set amount in ms.\n   */\n  delay (waitInMs) {\n    if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n      throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n    }\n\n    this[kMockDispatch].delay = waitInMs\n    return this\n  }\n\n  /**\n   * For a defined reply, never mark as consumed.\n   */\n  persist () {\n    this[kMockDispatch].persist = true\n    return this\n  }\n\n  /**\n   * Allow one to define a reply for a set amount of matching requests.\n   */\n  times (repeatTimes) {\n    if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n      throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n    }\n\n    this[kMockDispatch].times = repeatTimes\n    return this\n  }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n  constructor (opts, mockDispatches) {\n    if (typeof opts !== 'object') {\n      throw new InvalidArgumentError('opts must be an object')\n    }\n    if (typeof opts.path === 'undefined') {\n      throw new InvalidArgumentError('opts.path must be defined')\n    }\n    if (typeof opts.method === 'undefined') {\n      opts.method = 'GET'\n    }\n    // See https://github.com/nodejs/undici/issues/1245\n    // As per RFC 3986, clients are not supposed to send URI\n    // fragments to servers when they retrieve a document,\n    if (typeof opts.path === 'string') {\n      if (opts.query) {\n        opts.path = buildURL(opts.path, opts.query)\n      } else {\n        // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811\n        const parsedURL = new URL(opts.path, 'data://')\n        opts.path = parsedURL.pathname + parsedURL.search\n      }\n    }\n    if (typeof opts.method === 'string') {\n      opts.method = opts.method.toUpperCase()\n    }\n\n    this[kDispatchKey] = buildKey(opts)\n    this[kDispatches] = mockDispatches\n    this[kDefaultHeaders] = {}\n    this[kDefaultTrailers] = {}\n    this[kContentLength] = false\n  }\n\n  createMockScopeDispatchData ({ statusCode, data, responseOptions }) {\n    const responseData = getResponseData(data)\n    const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n    const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n    const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n    return { statusCode, data, headers, trailers }\n  }\n\n  validateReplyParameters (replyParameters) {\n    if (typeof replyParameters.statusCode === 'undefined') {\n      throw new InvalidArgumentError('statusCode must be defined')\n    }\n    if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) {\n      throw new InvalidArgumentError('responseOptions must be an object')\n    }\n  }\n\n  /**\n   * Mock an undici request with a defined reply.\n   */\n  reply (replyOptionsCallbackOrStatusCode) {\n    // Values of reply aren't available right now as they\n    // can only be available when the reply callback is invoked.\n    if (typeof replyOptionsCallbackOrStatusCode === 'function') {\n      // We'll first wrap the provided callback in another function,\n      // this function will properly resolve the data from the callback\n      // when invoked.\n      const wrappedDefaultsCallback = (opts) => {\n        // Our reply options callback contains the parameter for statusCode, data and options.\n        const resolvedData = replyOptionsCallbackOrStatusCode(opts)\n\n        // Check if it is in the right format\n        if (typeof resolvedData !== 'object' || resolvedData === null) {\n          throw new InvalidArgumentError('reply options callback must return an object')\n        }\n\n        const replyParameters = { data: '', responseOptions: {}, ...resolvedData }\n        this.validateReplyParameters(replyParameters)\n        // Since the values can be obtained immediately we return them\n        // from this higher order function that will be resolved later.\n        return {\n          ...this.createMockScopeDispatchData(replyParameters)\n        }\n      }\n\n      // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n      const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)\n      return new MockScope(newMockDispatch)\n    }\n\n    // We can have either one or three parameters, if we get here,\n    // we should have 1-3 parameters. So we spread the arguments of\n    // this function to obtain the parameters, since replyData will always\n    // just be the statusCode.\n    const replyParameters = {\n      statusCode: replyOptionsCallbackOrStatusCode,\n      data: arguments[1] === undefined ? '' : arguments[1],\n      responseOptions: arguments[2] === undefined ? {} : arguments[2]\n    }\n    this.validateReplyParameters(replyParameters)\n\n    // Send in-already provided data like usual\n    const dispatchData = this.createMockScopeDispatchData(replyParameters)\n    const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)\n    return new MockScope(newMockDispatch)\n  }\n\n  /**\n   * Mock an undici request with a defined error.\n   */\n  replyWithError (error) {\n    if (typeof error === 'undefined') {\n      throw new InvalidArgumentError('error must be defined')\n    }\n\n    const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })\n    return new MockScope(newMockDispatch)\n  }\n\n  /**\n   * Set default reply headers on the interceptor for subsequent replies\n   */\n  defaultReplyHeaders (headers) {\n    if (typeof headers === 'undefined') {\n      throw new InvalidArgumentError('headers must be defined')\n    }\n\n    this[kDefaultHeaders] = headers\n    return this\n  }\n\n  /**\n   * Set default reply trailers on the interceptor for subsequent replies\n   */\n  defaultReplyTrailers (trailers) {\n    if (typeof trailers === 'undefined') {\n      throw new InvalidArgumentError('trailers must be defined')\n    }\n\n    this[kDefaultTrailers] = trailers\n    return this\n  }\n\n  /**\n   * Set reply content length header for replies on the interceptor\n   */\n  replyContentLength () {\n    this[kContentLength] = true\n    return this\n  }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Pool = require('../dispatcher/pool')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kMockAgent,\n  kClose,\n  kOriginalClose,\n  kOrigin,\n  kOriginalDispatch,\n  kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockPool provides an API that extends the Pool to influence the mockDispatches.\n */\nclass MockPool extends Pool {\n  constructor (origin, opts) {\n    super(origin, opts)\n\n    if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n\n    this[kMockAgent] = opts.agent\n    this[kOrigin] = origin\n    this[kDispatches] = []\n    this[kConnected] = 1\n    this[kOriginalDispatch] = this.dispatch\n    this[kOriginalClose] = this.close.bind(this)\n\n    this.dispatch = buildMockDispatch.call(this)\n    this.close = this[kClose]\n  }\n\n  get [Symbols.kConnected] () {\n    return this[kConnected]\n  }\n\n  /**\n   * Sets up the base interceptor for mocking replies from undici.\n   */\n  intercept (opts) {\n    return new MockInterceptor(opts, this[kDispatches])\n  }\n\n  async [kClose] () {\n    await promisify(this[kOriginalClose])()\n    this[kConnected] = 0\n    this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n  }\n}\n\nmodule.exports = MockPool\n","'use strict'\n\nmodule.exports = {\n  kAgent: Symbol('agent'),\n  kOptions: Symbol('options'),\n  kFactory: Symbol('factory'),\n  kDispatches: Symbol('dispatches'),\n  kDispatchKey: Symbol('dispatch key'),\n  kDefaultHeaders: Symbol('default headers'),\n  kDefaultTrailers: Symbol('default trailers'),\n  kContentLength: Symbol('content length'),\n  kMockAgent: Symbol('mock agent'),\n  kMockAgentSet: Symbol('mock agent set'),\n  kMockAgentGet: Symbol('mock agent get'),\n  kMockDispatch: Symbol('mock dispatch'),\n  kClose: Symbol('close'),\n  kOriginalClose: Symbol('original agent close'),\n  kOrigin: Symbol('origin'),\n  kIsMockActive: Symbol('is mock active'),\n  kNetConnect: Symbol('net connect'),\n  kGetNetConnect: Symbol('get net connect'),\n  kConnected: Symbol('connected')\n}\n","'use strict'\n\nconst { MockNotMatchedError } = require('./mock-errors')\nconst {\n  kDispatches,\n  kMockAgent,\n  kOriginalDispatch,\n  kOrigin,\n  kGetNetConnect\n} = require('./mock-symbols')\nconst { buildURL } = require('../core/util')\nconst { STATUS_CODES } = require('node:http')\nconst {\n  types: {\n    isPromise\n  }\n} = require('node:util')\n\nfunction matchValue (match, value) {\n  if (typeof match === 'string') {\n    return match === value\n  }\n  if (match instanceof RegExp) {\n    return match.test(value)\n  }\n  if (typeof match === 'function') {\n    return match(value) === true\n  }\n  return false\n}\n\nfunction lowerCaseEntries (headers) {\n  return Object.fromEntries(\n    Object.entries(headers).map(([headerName, headerValue]) => {\n      return [headerName.toLocaleLowerCase(), headerValue]\n    })\n  )\n}\n\n/**\n * @param {import('../../index').Headers|string[]|Record} headers\n * @param {string} key\n */\nfunction getHeaderByName (headers, key) {\n  if (Array.isArray(headers)) {\n    for (let i = 0; i < headers.length; i += 2) {\n      if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {\n        return headers[i + 1]\n      }\n    }\n\n    return undefined\n  } else if (typeof headers.get === 'function') {\n    return headers.get(key)\n  } else {\n    return lowerCaseEntries(headers)[key.toLocaleLowerCase()]\n  }\n}\n\n/** @param {string[]} headers */\nfunction buildHeadersFromArray (headers) { // fetch HeadersList\n  const clone = headers.slice()\n  const entries = []\n  for (let index = 0; index < clone.length; index += 2) {\n    entries.push([clone[index], clone[index + 1]])\n  }\n  return Object.fromEntries(entries)\n}\n\nfunction matchHeaders (mockDispatch, headers) {\n  if (typeof mockDispatch.headers === 'function') {\n    if (Array.isArray(headers)) { // fetch HeadersList\n      headers = buildHeadersFromArray(headers)\n    }\n    return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})\n  }\n  if (typeof mockDispatch.headers === 'undefined') {\n    return true\n  }\n  if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {\n    return false\n  }\n\n  for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {\n    const headerValue = getHeaderByName(headers, matchHeaderName)\n\n    if (!matchValue(matchHeaderValue, headerValue)) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction safeUrl (path) {\n  if (typeof path !== 'string') {\n    return path\n  }\n\n  const pathSegments = path.split('?')\n\n  if (pathSegments.length !== 2) {\n    return path\n  }\n\n  const qp = new URLSearchParams(pathSegments.pop())\n  qp.sort()\n  return [...pathSegments, qp.toString()].join('?')\n}\n\nfunction matchKey (mockDispatch, { path, method, body, headers }) {\n  const pathMatch = matchValue(mockDispatch.path, path)\n  const methodMatch = matchValue(mockDispatch.method, method)\n  const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true\n  const headersMatch = matchHeaders(mockDispatch, headers)\n  return pathMatch && methodMatch && bodyMatch && headersMatch\n}\n\nfunction getResponseData (data) {\n  if (Buffer.isBuffer(data)) {\n    return data\n  } else if (data instanceof Uint8Array) {\n    return data\n  } else if (data instanceof ArrayBuffer) {\n    return data\n  } else if (typeof data === 'object') {\n    return JSON.stringify(data)\n  } else {\n    return data.toString()\n  }\n}\n\nfunction getMockDispatch (mockDispatches, key) {\n  const basePath = key.query ? buildURL(key.path, key.query) : key.path\n  const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath\n\n  // Match path\n  let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)\n  }\n\n  // Match method\n  matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)\n  }\n\n  // Match body\n  matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)\n  }\n\n  // Match headers\n  matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))\n  if (matchedMockDispatches.length === 0) {\n    const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers\n    throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)\n  }\n\n  return matchedMockDispatches[0]\n}\n\nfunction addMockDispatch (mockDispatches, key, data) {\n  const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }\n  const replyData = typeof data === 'function' ? { callback: data } : { ...data }\n  const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }\n  mockDispatches.push(newMockDispatch)\n  return newMockDispatch\n}\n\nfunction deleteMockDispatch (mockDispatches, key) {\n  const index = mockDispatches.findIndex(dispatch => {\n    if (!dispatch.consumed) {\n      return false\n    }\n    return matchKey(dispatch, key)\n  })\n  if (index !== -1) {\n    mockDispatches.splice(index, 1)\n  }\n}\n\nfunction buildKey (opts) {\n  const { path, method, body, headers, query } = opts\n  return {\n    path,\n    method,\n    body,\n    headers,\n    query\n  }\n}\n\nfunction generateKeyValues (data) {\n  const keys = Object.keys(data)\n  const result = []\n  for (let i = 0; i < keys.length; ++i) {\n    const key = keys[i]\n    const value = data[key]\n    const name = Buffer.from(`${key}`)\n    if (Array.isArray(value)) {\n      for (let j = 0; j < value.length; ++j) {\n        result.push(name, Buffer.from(`${value[j]}`))\n      }\n    } else {\n      result.push(name, Buffer.from(`${value}`))\n    }\n  }\n  return result\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n * @param {number} statusCode\n */\nfunction getStatusText (statusCode) {\n  return STATUS_CODES[statusCode] || 'unknown'\n}\n\nasync function getResponse (body) {\n  const buffers = []\n  for await (const data of body) {\n    buffers.push(data)\n  }\n  return Buffer.concat(buffers).toString('utf8')\n}\n\n/**\n * Mock dispatch function used to simulate undici dispatches\n */\nfunction mockDispatch (opts, handler) {\n  // Get mock dispatch from built key\n  const key = buildKey(opts)\n  const mockDispatch = getMockDispatch(this[kDispatches], key)\n\n  mockDispatch.timesInvoked++\n\n  // Here's where we resolve a callback if a callback is present for the dispatch data.\n  if (mockDispatch.data.callback) {\n    mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }\n  }\n\n  // Parse mockDispatch data\n  const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch\n  const { timesInvoked, times } = mockDispatch\n\n  // If it's used up and not persistent, mark as consumed\n  mockDispatch.consumed = !persist && timesInvoked >= times\n  mockDispatch.pending = timesInvoked < times\n\n  // If specified, trigger dispatch error\n  if (error !== null) {\n    deleteMockDispatch(this[kDispatches], key)\n    handler.onError(error)\n    return true\n  }\n\n  // Handle the request with a delay if necessary\n  if (typeof delay === 'number' && delay > 0) {\n    setTimeout(() => {\n      handleReply(this[kDispatches])\n    }, delay)\n  } else {\n    handleReply(this[kDispatches])\n  }\n\n  function handleReply (mockDispatches, _data = data) {\n    // fetch's HeadersList is a 1D string array\n    const optsHeaders = Array.isArray(opts.headers)\n      ? buildHeadersFromArray(opts.headers)\n      : opts.headers\n    const body = typeof _data === 'function'\n      ? _data({ ...opts, headers: optsHeaders })\n      : _data\n\n    // util.types.isPromise is likely needed for jest.\n    if (isPromise(body)) {\n      // If handleReply is asynchronous, throwing an error\n      // in the callback will reject the promise, rather than\n      // synchronously throw the error, which breaks some tests.\n      // Rather, we wait for the callback to resolve if it is a\n      // promise, and then re-run handleReply with the new body.\n      body.then((newData) => handleReply(mockDispatches, newData))\n      return\n    }\n\n    const responseData = getResponseData(body)\n    const responseHeaders = generateKeyValues(headers)\n    const responseTrailers = generateKeyValues(trailers)\n\n    handler.onConnect?.(err => handler.onError(err), null)\n    handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))\n    handler.onData?.(Buffer.from(responseData))\n    handler.onComplete?.(responseTrailers)\n    deleteMockDispatch(mockDispatches, key)\n  }\n\n  function resume () {}\n\n  return true\n}\n\nfunction buildMockDispatch () {\n  const agent = this[kMockAgent]\n  const origin = this[kOrigin]\n  const originalDispatch = this[kOriginalDispatch]\n\n  return function dispatch (opts, handler) {\n    if (agent.isMockActive) {\n      try {\n        mockDispatch.call(this, opts, handler)\n      } catch (error) {\n        if (error instanceof MockNotMatchedError) {\n          const netConnect = agent[kGetNetConnect]()\n          if (netConnect === false) {\n            throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)\n          }\n          if (checkNetConnect(netConnect, origin)) {\n            originalDispatch.call(this, opts, handler)\n          } else {\n            throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)\n          }\n        } else {\n          throw error\n        }\n      }\n    } else {\n      originalDispatch.call(this, opts, handler)\n    }\n  }\n}\n\nfunction checkNetConnect (netConnect, origin) {\n  const url = new URL(origin)\n  if (netConnect === true) {\n    return true\n  } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {\n    return true\n  }\n  return false\n}\n\nfunction buildMockOptions (opts) {\n  if (opts) {\n    const { agent, ...mockOptions } = opts\n    return mockOptions\n  }\n}\n\nmodule.exports = {\n  getResponseData,\n  getMockDispatch,\n  addMockDispatch,\n  deleteMockDispatch,\n  buildKey,\n  generateKeyValues,\n  matchValue,\n  getResponse,\n  getStatusText,\n  mockDispatch,\n  buildMockDispatch,\n  checkNetConnect,\n  buildMockOptions,\n  getHeaderByName,\n  buildHeadersFromArray\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst { Console } = require('node:console')\n\nconst PERSISTENT = process.versions.icu ? '✅' : 'Y '\nconst NOT_PERSISTENT = process.versions.icu ? '❌' : 'N '\n\n/**\n * Gets the output of `console.table(…)` as a string.\n */\nmodule.exports = class PendingInterceptorsFormatter {\n  constructor ({ disableColors } = {}) {\n    this.transform = new Transform({\n      transform (chunk, _enc, cb) {\n        cb(null, chunk)\n      }\n    })\n\n    this.logger = new Console({\n      stdout: this.transform,\n      inspectOptions: {\n        colors: !disableColors && !process.env.CI\n      }\n    })\n  }\n\n  format (pendingInterceptors) {\n    const withPrettyHeaders = pendingInterceptors.map(\n      ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({\n        Method: method,\n        Origin: origin,\n        Path: path,\n        'Status code': statusCode,\n        Persistent: persist ? PERSISTENT : NOT_PERSISTENT,\n        Invocations: timesInvoked,\n        Remaining: persist ? Infinity : times - timesInvoked\n      }))\n\n    this.logger.table(withPrettyHeaders)\n    return this.transform.read().toString()\n  }\n}\n","'use strict'\n\nconst singulars = {\n  pronoun: 'it',\n  is: 'is',\n  was: 'was',\n  this: 'this'\n}\n\nconst plurals = {\n  pronoun: 'they',\n  is: 'are',\n  was: 'were',\n  this: 'these'\n}\n\nmodule.exports = class Pluralizer {\n  constructor (singular, plural) {\n    this.singular = singular\n    this.plural = plural\n  }\n\n  pluralize (count) {\n    const one = count === 1\n    const keys = one ? singulars : plurals\n    const noun = one ? this.singular : this.plural\n    return { ...keys, count, noun }\n  }\n}\n","'use strict'\n\n/**\n * This module offers an optimized timer implementation designed for scenarios\n * where high precision is not critical.\n *\n * The timer achieves faster performance by using a low-resolution approach,\n * with an accuracy target of within 500ms. This makes it particularly useful\n * for timers with delays of 1 second or more, where exact timing is less\n * crucial.\n *\n * It's important to note that Node.js timers are inherently imprecise, as\n * delays can occur due to the event loop being blocked by other operations.\n * Consequently, timers may trigger later than their scheduled time.\n */\n\n/**\n * The fastNow variable contains the internal fast timer clock value.\n *\n * @type {number}\n */\nlet fastNow = 0\n\n/**\n * RESOLUTION_MS represents the target resolution time in milliseconds.\n *\n * @type {number}\n * @default 1000\n */\nconst RESOLUTION_MS = 1e3\n\n/**\n * TICK_MS defines the desired interval in milliseconds between each tick.\n * The target value is set to half the resolution time, minus 1 ms, to account\n * for potential event loop overhead.\n *\n * @type {number}\n * @default 499\n */\nconst TICK_MS = (RESOLUTION_MS >> 1) - 1\n\n/**\n * fastNowTimeout is a Node.js timer used to manage and process\n * the FastTimers stored in the `fastTimers` array.\n *\n * @type {NodeJS.Timeout}\n */\nlet fastNowTimeout\n\n/**\n * The kFastTimer symbol is used to identify FastTimer instances.\n *\n * @type {Symbol}\n */\nconst kFastTimer = Symbol('kFastTimer')\n\n/**\n * The fastTimers array contains all active FastTimers.\n *\n * @type {FastTimer[]}\n */\nconst fastTimers = []\n\n/**\n * These constants represent the various states of a FastTimer.\n */\n\n/**\n * The `NOT_IN_LIST` constant indicates that the FastTimer is not included\n * in the `fastTimers` array. Timers with this status will not be processed\n * during the next tick by the `onTick` function.\n *\n * A FastTimer can be re-added to the `fastTimers` array by invoking the\n * `refresh` method on the FastTimer instance.\n *\n * @type {-2}\n */\nconst NOT_IN_LIST = -2\n\n/**\n * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled\n * for removal from the `fastTimers` array. A FastTimer in this state will\n * be removed in the next tick by the `onTick` function and will no longer\n * be processed.\n *\n * This status is also set when the `clear` method is called on the FastTimer instance.\n *\n * @type {-1}\n */\nconst TO_BE_CLEARED = -1\n\n/**\n * The `PENDING` constant signifies that the FastTimer is awaiting processing\n * in the next tick by the `onTick` function. Timers with this status will have\n * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick.\n *\n * @type {0}\n */\nconst PENDING = 0\n\n/**\n * The `ACTIVE` constant indicates that the FastTimer is active and waiting\n * for its timer to expire. During the next tick, the `onTick` function will\n * check if the timer has expired, and if so, it will execute the associated callback.\n *\n * @type {1}\n */\nconst ACTIVE = 1\n\n/**\n * The onTick function processes the fastTimers array.\n *\n * @returns {void}\n */\nfunction onTick () {\n  /**\n   * Increment the fastNow value by the TICK_MS value, despite the actual time\n   * that has passed since the last tick. This approach ensures independence\n   * from the system clock and delays caused by a blocked event loop.\n   *\n   * @type {number}\n   */\n  fastNow += TICK_MS\n\n  /**\n   * The `idx` variable is used to iterate over the `fastTimers` array.\n   * Expired timers are removed by replacing them with the last element in the array.\n   * Consequently, `idx` is only incremented when the current element is not removed.\n   *\n   * @type {number}\n   */\n  let idx = 0\n\n  /**\n   * The len variable will contain the length of the fastTimers array\n   * and will be decremented when a FastTimer should be removed from the\n   * fastTimers array.\n   *\n   * @type {number}\n   */\n  let len = fastTimers.length\n\n  while (idx < len) {\n    /**\n     * @type {FastTimer}\n     */\n    const timer = fastTimers[idx]\n\n    // If the timer is in the ACTIVE state and the timer has expired, it will\n    // be processed in the next tick.\n    if (timer._state === PENDING) {\n      // Set the _idleStart value to the fastNow value minus the TICK_MS value\n      // to account for the time the timer was in the PENDING state.\n      timer._idleStart = fastNow - TICK_MS\n      timer._state = ACTIVE\n    } else if (\n      timer._state === ACTIVE &&\n      fastNow >= timer._idleStart + timer._idleTimeout\n    ) {\n      timer._state = TO_BE_CLEARED\n      timer._idleStart = -1\n      timer._onTimeout(timer._timerArg)\n    }\n\n    if (timer._state === TO_BE_CLEARED) {\n      timer._state = NOT_IN_LIST\n\n      // Move the last element to the current index and decrement len if it is\n      // not the only element in the array.\n      if (--len !== 0) {\n        fastTimers[idx] = fastTimers[len]\n      }\n    } else {\n      ++idx\n    }\n  }\n\n  // Set the length of the fastTimers array to the new length and thus\n  // removing the excess FastTimers elements from the array.\n  fastTimers.length = len\n\n  // If there are still active FastTimers in the array, refresh the Timer.\n  // If there are no active FastTimers, the timer will be refreshed again\n  // when a new FastTimer is instantiated.\n  if (fastTimers.length !== 0) {\n    refreshTimeout()\n  }\n}\n\nfunction refreshTimeout () {\n  // If the fastNowTimeout is already set, refresh it.\n  if (fastNowTimeout) {\n    fastNowTimeout.refresh()\n  // fastNowTimeout is not instantiated yet, create a new Timer.\n  } else {\n    clearTimeout(fastNowTimeout)\n    fastNowTimeout = setTimeout(onTick, TICK_MS)\n\n    // If the Timer has an unref method, call it to allow the process to exit if\n    // there are no other active handles.\n    if (fastNowTimeout.unref) {\n      fastNowTimeout.unref()\n    }\n  }\n}\n\n/**\n * The `FastTimer` class is a data structure designed to store and manage\n * timer information.\n */\nclass FastTimer {\n  [kFastTimer] = true\n\n  /**\n   * The state of the timer, which can be one of the following:\n   * - NOT_IN_LIST (-2)\n   * - TO_BE_CLEARED (-1)\n   * - PENDING (0)\n   * - ACTIVE (1)\n   *\n   * @type {-2|-1|0|1}\n   * @private\n   */\n  _state = NOT_IN_LIST\n\n  /**\n   * The number of milliseconds to wait before calling the callback.\n   *\n   * @type {number}\n   * @private\n   */\n  _idleTimeout = -1\n\n  /**\n   * The time in milliseconds when the timer was started. This value is used to\n   * calculate when the timer should expire.\n   *\n   * @type {number}\n   * @default -1\n   * @private\n   */\n  _idleStart = -1\n\n  /**\n   * The function to be executed when the timer expires.\n   * @type {Function}\n   * @private\n   */\n  _onTimeout\n\n  /**\n   * The argument to be passed to the callback when the timer expires.\n   *\n   * @type {*}\n   * @private\n   */\n  _timerArg\n\n  /**\n   * @constructor\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should wait\n   * before the specified function or code is executed.\n   * @param {*} arg\n   */\n  constructor (callback, delay, arg) {\n    this._onTimeout = callback\n    this._idleTimeout = delay\n    this._timerArg = arg\n\n    this.refresh()\n  }\n\n  /**\n   * Sets the timer's start time to the current time, and reschedules the timer\n   * to call its callback at the previously specified duration adjusted to the\n   * current time.\n   * Using this on a timer that has already called its callback will reactivate\n   * the timer.\n   *\n   * @returns {void}\n   */\n  refresh () {\n    // In the special case that the timer is not in the list of active timers,\n    // add it back to the array to be processed in the next tick by the onTick\n    // function.\n    if (this._state === NOT_IN_LIST) {\n      fastTimers.push(this)\n    }\n\n    // If the timer is the only active timer, refresh the fastNowTimeout for\n    // better resolution.\n    if (!fastNowTimeout || fastTimers.length === 1) {\n      refreshTimeout()\n    }\n\n    // Setting the state to PENDING will cause the timer to be reset in the\n    // next tick by the onTick function.\n    this._state = PENDING\n  }\n\n  /**\n   * The `clear` method cancels the timer, preventing it from executing.\n   *\n   * @returns {void}\n   * @private\n   */\n  clear () {\n    // Set the state to TO_BE_CLEARED to mark the timer for removal in the next\n    // tick by the onTick function.\n    this._state = TO_BE_CLEARED\n\n    // Reset the _idleStart value to -1 to indicate that the timer is no longer\n    // active.\n    this._idleStart = -1\n  }\n}\n\n/**\n * This module exports a setTimeout and clearTimeout function that can be\n * used as a drop-in replacement for the native functions.\n */\nmodule.exports = {\n  /**\n   * The setTimeout() method sets a timer which executes a function once the\n   * timer expires.\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should\n   * wait before the specified function or code is executed.\n   * @param {*} [arg] An optional argument to be passed to the callback function\n   * when the timer expires.\n   * @returns {NodeJS.Timeout|FastTimer}\n   */\n  setTimeout (callback, delay, arg) {\n    // If the delay is less than or equal to the RESOLUTION_MS value return a\n    // native Node.js Timer instance.\n    return delay <= RESOLUTION_MS\n      ? setTimeout(callback, delay, arg)\n      : new FastTimer(callback, delay, arg)\n  },\n  /**\n   * The clearTimeout method cancels an instantiated Timer previously created\n   * by calling setTimeout.\n   *\n   * @param {NodeJS.Timeout|FastTimer} timeout\n   */\n  clearTimeout (timeout) {\n    // If the timeout is a FastTimer, call its own clear method.\n    if (timeout[kFastTimer]) {\n      /**\n       * @type {FastTimer}\n       */\n      timeout.clear()\n      // Otherwise it is an instance of a native NodeJS.Timeout, so call the\n      // Node.js native clearTimeout function.\n    } else {\n      clearTimeout(timeout)\n    }\n  },\n  /**\n   * The setFastTimeout() method sets a fastTimer which executes a function once\n   * the timer expires.\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should\n   * wait before the specified function or code is executed.\n   * @param {*} [arg] An optional argument to be passed to the callback function\n   * when the timer expires.\n   * @returns {FastTimer}\n   */\n  setFastTimeout (callback, delay, arg) {\n    return new FastTimer(callback, delay, arg)\n  },\n  /**\n   * The clearTimeout method cancels an instantiated FastTimer previously\n   * created by calling setFastTimeout.\n   *\n   * @param {FastTimer} timeout\n   */\n  clearFastTimeout (timeout) {\n    timeout.clear()\n  },\n  /**\n   * The now method returns the value of the internal fast timer clock.\n   *\n   * @returns {number}\n   */\n  now () {\n    return fastNow\n  },\n  /**\n   * Trigger the onTick function to process the fastTimers array.\n   * Exported for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   * @param {number} [delay=0] The delay in milliseconds to add to the now value.\n   */\n  tick (delay = 0) {\n    fastNow += delay - RESOLUTION_MS + 1\n    onTick()\n    onTick()\n  },\n  /**\n   * Reset FastTimers.\n   * Exported for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   */\n  reset () {\n    fastNow = 0\n    fastTimers.length = 0\n    clearTimeout(fastNowTimeout)\n    fastNowTimeout = null\n  },\n  /**\n   * Exporting for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   */\n  kFastTimer\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { urlEquals, getFieldValues } = require('./util')\nconst { kEnumerableProperty, isDisturbed } = require('../../core/util')\nconst { webidl } = require('../fetch/webidl')\nconst { Response, cloneResponse, fromInnerResponse } = require('../fetch/response')\nconst { Request, fromInnerRequest } = require('../fetch/request')\nconst { kState } = require('../fetch/symbols')\nconst { fetching } = require('../fetch/index')\nconst { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require('../fetch/util')\nconst assert = require('node:assert')\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation\n * @typedef {Object} CacheBatchOperation\n * @property {'delete' | 'put'} type\n * @property {any} request\n * @property {any} response\n * @property {import('../../types/cache').CacheQueryOptions} options\n */\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list\n * @typedef {[any, any][]} requestResponseList\n */\n\nclass Cache {\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list\n   * @type {requestResponseList}\n   */\n  #relevantRequestResponseList\n\n  constructor () {\n    if (arguments[0] !== kConstruct) {\n      webidl.illegalConstructor()\n    }\n\n    webidl.util.markAsUncloneable(this)\n    this.#relevantRequestResponseList = arguments[1]\n  }\n\n  async match (request, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.match'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    const p = this.#internalMatchAll(request, options, 1)\n\n    if (p.length === 0) {\n      return\n    }\n\n    return p[0]\n  }\n\n  async matchAll (request = undefined, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.matchAll'\n    if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    return this.#internalMatchAll(request, options)\n  }\n\n  async add (request) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.add'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n\n    // 1.\n    const requests = [request]\n\n    // 2.\n    const responseArrayPromise = this.addAll(requests)\n\n    // 3.\n    return await responseArrayPromise\n  }\n\n  async addAll (requests) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.addAll'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    // 1.\n    const responsePromises = []\n\n    // 2.\n    const requestList = []\n\n    // 3.\n    for (let request of requests) {\n      if (request === undefined) {\n        throw webidl.errors.conversionFailed({\n          prefix,\n          argument: 'Argument 1',\n          types: ['undefined is not allowed']\n        })\n      }\n\n      request = webidl.converters.RequestInfo(request)\n\n      if (typeof request === 'string') {\n        continue\n      }\n\n      // 3.1\n      const r = request[kState]\n\n      // 3.2\n      if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {\n        throw webidl.errors.exception({\n          header: prefix,\n          message: 'Expected http/s scheme when method is not GET.'\n        })\n      }\n    }\n\n    // 4.\n    /** @type {ReturnType[]} */\n    const fetchControllers = []\n\n    // 5.\n    for (const request of requests) {\n      // 5.1\n      const r = new Request(request)[kState]\n\n      // 5.2\n      if (!urlIsHttpHttpsScheme(r.url)) {\n        throw webidl.errors.exception({\n          header: prefix,\n          message: 'Expected http/s scheme.'\n        })\n      }\n\n      // 5.4\n      r.initiator = 'fetch'\n      r.destination = 'subresource'\n\n      // 5.5\n      requestList.push(r)\n\n      // 5.6\n      const responsePromise = createDeferredPromise()\n\n      // 5.7\n      fetchControllers.push(fetching({\n        request: r,\n        processResponse (response) {\n          // 1.\n          if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {\n            responsePromise.reject(webidl.errors.exception({\n              header: 'Cache.addAll',\n              message: 'Received an invalid status code or the request failed.'\n            }))\n          } else if (response.headersList.contains('vary')) { // 2.\n            // 2.1\n            const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n            // 2.2\n            for (const fieldValue of fieldValues) {\n              // 2.2.1\n              if (fieldValue === '*') {\n                responsePromise.reject(webidl.errors.exception({\n                  header: 'Cache.addAll',\n                  message: 'invalid vary field value'\n                }))\n\n                for (const controller of fetchControllers) {\n                  controller.abort()\n                }\n\n                return\n              }\n            }\n          }\n        },\n        processResponseEndOfBody (response) {\n          // 1.\n          if (response.aborted) {\n            responsePromise.reject(new DOMException('aborted', 'AbortError'))\n            return\n          }\n\n          // 2.\n          responsePromise.resolve(response)\n        }\n      }))\n\n      // 5.8\n      responsePromises.push(responsePromise.promise)\n    }\n\n    // 6.\n    const p = Promise.all(responsePromises)\n\n    // 7.\n    const responses = await p\n\n    // 7.1\n    const operations = []\n\n    // 7.2\n    let index = 0\n\n    // 7.3\n    for (const response of responses) {\n      // 7.3.1\n      /** @type {CacheBatchOperation} */\n      const operation = {\n        type: 'put', // 7.3.2\n        request: requestList[index], // 7.3.3\n        response // 7.3.4\n      }\n\n      operations.push(operation) // 7.3.5\n\n      index++ // 7.3.6\n    }\n\n    // 7.5\n    const cacheJobPromise = createDeferredPromise()\n\n    // 7.6.1\n    let errorData = null\n\n    // 7.6.2\n    try {\n      this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    // 7.6.3\n    queueMicrotask(() => {\n      // 7.6.3.1\n      if (errorData === null) {\n        cacheJobPromise.resolve(undefined)\n      } else {\n        // 7.6.3.2\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    // 7.7\n    return cacheJobPromise.promise\n  }\n\n  async put (request, response) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.put'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    response = webidl.converters.Response(response, prefix, 'response')\n\n    // 1.\n    let innerRequest = null\n\n    // 2.\n    if (request instanceof Request) {\n      innerRequest = request[kState]\n    } else { // 3.\n      innerRequest = new Request(request)[kState]\n    }\n\n    // 4.\n    if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Expected an http/s scheme when method is not GET'\n      })\n    }\n\n    // 5.\n    const innerResponse = response[kState]\n\n    // 6.\n    if (innerResponse.status === 206) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Got 206 status'\n      })\n    }\n\n    // 7.\n    if (innerResponse.headersList.contains('vary')) {\n      // 7.1.\n      const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))\n\n      // 7.2.\n      for (const fieldValue of fieldValues) {\n        // 7.2.1\n        if (fieldValue === '*') {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: 'Got * vary field value'\n          })\n        }\n      }\n    }\n\n    // 8.\n    if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Response body is locked or disturbed'\n      })\n    }\n\n    // 9.\n    const clonedResponse = cloneResponse(innerResponse)\n\n    // 10.\n    const bodyReadPromise = createDeferredPromise()\n\n    // 11.\n    if (innerResponse.body != null) {\n      // 11.1\n      const stream = innerResponse.body.stream\n\n      // 11.2\n      const reader = stream.getReader()\n\n      // 11.3\n      readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)\n    } else {\n      bodyReadPromise.resolve(undefined)\n    }\n\n    // 12.\n    /** @type {CacheBatchOperation[]} */\n    const operations = []\n\n    // 13.\n    /** @type {CacheBatchOperation} */\n    const operation = {\n      type: 'put', // 14.\n      request: innerRequest, // 15.\n      response: clonedResponse // 16.\n    }\n\n    // 17.\n    operations.push(operation)\n\n    // 19.\n    const bytes = await bodyReadPromise.promise\n\n    if (clonedResponse.body != null) {\n      clonedResponse.body.source = bytes\n    }\n\n    // 19.1\n    const cacheJobPromise = createDeferredPromise()\n\n    // 19.2.1\n    let errorData = null\n\n    // 19.2.2\n    try {\n      this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    // 19.2.3\n    queueMicrotask(() => {\n      // 19.2.3.1\n      if (errorData === null) {\n        cacheJobPromise.resolve()\n      } else { // 19.2.3.2\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    return cacheJobPromise.promise\n  }\n\n  async delete (request, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    /**\n     * @type {Request}\n     */\n    let r = null\n\n    if (request instanceof Request) {\n      r = request[kState]\n\n      if (r.method !== 'GET' && !options.ignoreMethod) {\n        return false\n      }\n    } else {\n      assert(typeof request === 'string')\n\n      r = new Request(request)[kState]\n    }\n\n    /** @type {CacheBatchOperation[]} */\n    const operations = []\n\n    /** @type {CacheBatchOperation} */\n    const operation = {\n      type: 'delete',\n      request: r,\n      options\n    }\n\n    operations.push(operation)\n\n    const cacheJobPromise = createDeferredPromise()\n\n    let errorData = null\n    let requestResponses\n\n    try {\n      requestResponses = this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    queueMicrotask(() => {\n      if (errorData === null) {\n        cacheJobPromise.resolve(!!requestResponses?.length)\n      } else {\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    return cacheJobPromise.promise\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys\n   * @param {any} request\n   * @param {import('../../types/cache').CacheQueryOptions} options\n   * @returns {Promise}\n   */\n  async keys (request = undefined, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.keys'\n\n    if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    // 1.\n    let r = null\n\n    // 2.\n    if (request !== undefined) {\n      // 2.1\n      if (request instanceof Request) {\n        // 2.1.1\n        r = request[kState]\n\n        // 2.1.2\n        if (r.method !== 'GET' && !options.ignoreMethod) {\n          return []\n        }\n      } else if (typeof request === 'string') { // 2.2\n        r = new Request(request)[kState]\n      }\n    }\n\n    // 4.\n    const promise = createDeferredPromise()\n\n    // 5.\n    // 5.1\n    const requests = []\n\n    // 5.2\n    if (request === undefined) {\n      // 5.2.1\n      for (const requestResponse of this.#relevantRequestResponseList) {\n        // 5.2.1.1\n        requests.push(requestResponse[0])\n      }\n    } else { // 5.3\n      // 5.3.1\n      const requestResponses = this.#queryCache(r, options)\n\n      // 5.3.2\n      for (const requestResponse of requestResponses) {\n        // 5.3.2.1\n        requests.push(requestResponse[0])\n      }\n    }\n\n    // 5.4\n    queueMicrotask(() => {\n      // 5.4.1\n      const requestList = []\n\n      // 5.4.2\n      for (const request of requests) {\n        const requestObject = fromInnerRequest(\n          request,\n          new AbortController().signal,\n          'immutable'\n        )\n        // 5.4.2.1\n        requestList.push(requestObject)\n      }\n\n      // 5.4.3\n      promise.resolve(Object.freeze(requestList))\n    })\n\n    return promise.promise\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm\n   * @param {CacheBatchOperation[]} operations\n   * @returns {requestResponseList}\n   */\n  #batchCacheOperations (operations) {\n    // 1.\n    const cache = this.#relevantRequestResponseList\n\n    // 2.\n    const backupCache = [...cache]\n\n    // 3.\n    const addedItems = []\n\n    // 4.1\n    const resultList = []\n\n    try {\n      // 4.2\n      for (const operation of operations) {\n        // 4.2.1\n        if (operation.type !== 'delete' && operation.type !== 'put') {\n          throw webidl.errors.exception({\n            header: 'Cache.#batchCacheOperations',\n            message: 'operation type does not match \"delete\" or \"put\"'\n          })\n        }\n\n        // 4.2.2\n        if (operation.type === 'delete' && operation.response != null) {\n          throw webidl.errors.exception({\n            header: 'Cache.#batchCacheOperations',\n            message: 'delete operation should not have an associated response'\n          })\n        }\n\n        // 4.2.3\n        if (this.#queryCache(operation.request, operation.options, addedItems).length) {\n          throw new DOMException('???', 'InvalidStateError')\n        }\n\n        // 4.2.4\n        let requestResponses\n\n        // 4.2.5\n        if (operation.type === 'delete') {\n          // 4.2.5.1\n          requestResponses = this.#queryCache(operation.request, operation.options)\n\n          // TODO: the spec is wrong, this is needed to pass WPTs\n          if (requestResponses.length === 0) {\n            return []\n          }\n\n          // 4.2.5.2\n          for (const requestResponse of requestResponses) {\n            const idx = cache.indexOf(requestResponse)\n            assert(idx !== -1)\n\n            // 4.2.5.2.1\n            cache.splice(idx, 1)\n          }\n        } else if (operation.type === 'put') { // 4.2.6\n          // 4.2.6.1\n          if (operation.response == null) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'put operation should have an associated response'\n            })\n          }\n\n          // 4.2.6.2\n          const r = operation.request\n\n          // 4.2.6.3\n          if (!urlIsHttpHttpsScheme(r.url)) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'expected http or https scheme'\n            })\n          }\n\n          // 4.2.6.4\n          if (r.method !== 'GET') {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'not get method'\n            })\n          }\n\n          // 4.2.6.5\n          if (operation.options != null) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'options must not be defined'\n            })\n          }\n\n          // 4.2.6.6\n          requestResponses = this.#queryCache(operation.request)\n\n          // 4.2.6.7\n          for (const requestResponse of requestResponses) {\n            const idx = cache.indexOf(requestResponse)\n            assert(idx !== -1)\n\n            // 4.2.6.7.1\n            cache.splice(idx, 1)\n          }\n\n          // 4.2.6.8\n          cache.push([operation.request, operation.response])\n\n          // 4.2.6.10\n          addedItems.push([operation.request, operation.response])\n        }\n\n        // 4.2.7\n        resultList.push([operation.request, operation.response])\n      }\n\n      // 4.3\n      return resultList\n    } catch (e) { // 5.\n      // 5.1\n      this.#relevantRequestResponseList.length = 0\n\n      // 5.2\n      this.#relevantRequestResponseList = backupCache\n\n      // 5.3\n      throw e\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#query-cache\n   * @param {any} requestQuery\n   * @param {import('../../types/cache').CacheQueryOptions} options\n   * @param {requestResponseList} targetStorage\n   * @returns {requestResponseList}\n   */\n  #queryCache (requestQuery, options, targetStorage) {\n    /** @type {requestResponseList} */\n    const resultList = []\n\n    const storage = targetStorage ?? this.#relevantRequestResponseList\n\n    for (const requestResponse of storage) {\n      const [cachedRequest, cachedResponse] = requestResponse\n      if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {\n        resultList.push(requestResponse)\n      }\n    }\n\n    return resultList\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm\n   * @param {any} requestQuery\n   * @param {any} request\n   * @param {any | null} response\n   * @param {import('../../types/cache').CacheQueryOptions | undefined} options\n   * @returns {boolean}\n   */\n  #requestMatchesCachedItem (requestQuery, request, response = null, options) {\n    // if (options?.ignoreMethod === false && request.method === 'GET') {\n    //   return false\n    // }\n\n    const queryURL = new URL(requestQuery.url)\n\n    const cachedURL = new URL(request.url)\n\n    if (options?.ignoreSearch) {\n      cachedURL.search = ''\n\n      queryURL.search = ''\n    }\n\n    if (!urlEquals(queryURL, cachedURL, true)) {\n      return false\n    }\n\n    if (\n      response == null ||\n      options?.ignoreVary ||\n      !response.headersList.contains('vary')\n    ) {\n      return true\n    }\n\n    const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n    for (const fieldValue of fieldValues) {\n      if (fieldValue === '*') {\n        return false\n      }\n\n      const requestValue = request.headersList.get(fieldValue)\n      const queryValue = requestQuery.headersList.get(fieldValue)\n\n      // If one has the header and the other doesn't, or one has\n      // a different value than the other, return false\n      if (requestValue !== queryValue) {\n        return false\n      }\n    }\n\n    return true\n  }\n\n  #internalMatchAll (request, options, maxResponses = Infinity) {\n    // 1.\n    let r = null\n\n    // 2.\n    if (request !== undefined) {\n      if (request instanceof Request) {\n        // 2.1.1\n        r = request[kState]\n\n        // 2.1.2\n        if (r.method !== 'GET' && !options.ignoreMethod) {\n          return []\n        }\n      } else if (typeof request === 'string') {\n        // 2.2.1\n        r = new Request(request)[kState]\n      }\n    }\n\n    // 5.\n    // 5.1\n    const responses = []\n\n    // 5.2\n    if (request === undefined) {\n      // 5.2.1\n      for (const requestResponse of this.#relevantRequestResponseList) {\n        responses.push(requestResponse[1])\n      }\n    } else { // 5.3\n      // 5.3.1\n      const requestResponses = this.#queryCache(r, options)\n\n      // 5.3.2\n      for (const requestResponse of requestResponses) {\n        responses.push(requestResponse[1])\n      }\n    }\n\n    // 5.4\n    // We don't implement CORs so we don't need to loop over the responses, yay!\n\n    // 5.5.1\n    const responseList = []\n\n    // 5.5.2\n    for (const response of responses) {\n      // 5.5.2.1\n      const responseObject = fromInnerResponse(response, 'immutable')\n\n      responseList.push(responseObject.clone())\n\n      if (responseList.length >= maxResponses) {\n        break\n      }\n    }\n\n    // 6.\n    return Object.freeze(responseList)\n  }\n}\n\nObject.defineProperties(Cache.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'Cache',\n    configurable: true\n  },\n  match: kEnumerableProperty,\n  matchAll: kEnumerableProperty,\n  add: kEnumerableProperty,\n  addAll: kEnumerableProperty,\n  put: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  keys: kEnumerableProperty\n})\n\nconst cacheQueryOptionConverters = [\n  {\n    key: 'ignoreSearch',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'ignoreMethod',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'ignoreVary',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n]\n\nwebidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)\n\nwebidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([\n  ...cacheQueryOptionConverters,\n  {\n    key: 'cacheName',\n    converter: webidl.converters.DOMString\n  }\n])\n\nwebidl.converters.Response = webidl.interfaceConverter(Response)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.RequestInfo\n)\n\nmodule.exports = {\n  Cache\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { Cache } = require('./cache')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass CacheStorage {\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map\n   * @type {Map}\n   */\n  async has (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.has'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    // 2.1.1\n    // 2.2\n    return this.#caches.has(cacheName)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open\n   * @param {string} cacheName\n   * @returns {Promise}\n   */\n  async open (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.open'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    // 2.1\n    if (this.#caches.has(cacheName)) {\n      // await caches.open('v1') !== await caches.open('v1')\n\n      // 2.1.1\n      const cache = this.#caches.get(cacheName)\n\n      // 2.1.1.1\n      return new Cache(kConstruct, cache)\n    }\n\n    // 2.2\n    const cache = []\n\n    // 2.3\n    this.#caches.set(cacheName, cache)\n\n    // 2.4\n    return new Cache(kConstruct, cache)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete\n   * @param {string} cacheName\n   * @returns {Promise}\n   */\n  async delete (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    return this.#caches.delete(cacheName)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys\n   * @returns {Promise}\n   */\n  async keys () {\n    webidl.brandCheck(this, CacheStorage)\n\n    // 2.1\n    const keys = this.#caches.keys()\n\n    // 2.2\n    return [...keys]\n  }\n}\n\nObject.defineProperties(CacheStorage.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'CacheStorage',\n    configurable: true\n  },\n  match: kEnumerableProperty,\n  has: kEnumerableProperty,\n  open: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  keys: kEnumerableProperty\n})\n\nmodule.exports = {\n  CacheStorage\n}\n","'use strict'\n\nmodule.exports = {\n  kConstruct: require('../../core/symbols').kConstruct\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { isValidHeaderName } = require('../fetch/util')\n\n/**\n * @see https://url.spec.whatwg.org/#concept-url-equals\n * @param {URL} A\n * @param {URL} B\n * @param {boolean | undefined} excludeFragment\n * @returns {boolean}\n */\nfunction urlEquals (A, B, excludeFragment = false) {\n  const serializedA = URLSerializer(A, excludeFragment)\n\n  const serializedB = URLSerializer(B, excludeFragment)\n\n  return serializedA === serializedB\n}\n\n/**\n * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262\n * @param {string} header\n */\nfunction getFieldValues (header) {\n  assert(header !== null)\n\n  const values = []\n\n  for (let value of header.split(',')) {\n    value = value.trim()\n\n    if (isValidHeaderName(value)) {\n      values.push(value)\n    }\n  }\n\n  return values\n}\n\nmodule.exports = {\n  urlEquals,\n  getFieldValues\n}\n","'use strict'\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size\nconst maxAttributeValueSize = 1024\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size\nconst maxNameValuePairSize = 4096\n\nmodule.exports = {\n  maxAttributeValueSize,\n  maxNameValuePairSize\n}\n","'use strict'\n\nconst { parseSetCookie } = require('./parse')\nconst { stringify } = require('./util')\nconst { webidl } = require('../fetch/webidl')\nconst { Headers } = require('../fetch/headers')\n\n/**\n * @typedef {Object} Cookie\n * @property {string} name\n * @property {string} value\n * @property {Date|number|undefined} expires\n * @property {number|undefined} maxAge\n * @property {string|undefined} domain\n * @property {string|undefined} path\n * @property {boolean|undefined} secure\n * @property {boolean|undefined} httpOnly\n * @property {'Strict'|'Lax'|'None'} sameSite\n * @property {string[]} unparsed\n */\n\n/**\n * @param {Headers} headers\n * @returns {Record}\n */\nfunction getCookies (headers) {\n  webidl.argumentLengthCheck(arguments, 1, 'getCookies')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const cookie = headers.get('cookie')\n  const out = {}\n\n  if (!cookie) {\n    return out\n  }\n\n  for (const piece of cookie.split(';')) {\n    const [name, ...value] = piece.split('=')\n\n    out[name.trim()] = value.join('=')\n  }\n\n  return out\n}\n\n/**\n * @param {Headers} headers\n * @param {string} name\n * @param {{ path?: string, domain?: string }|undefined} attributes\n * @returns {void}\n */\nfunction deleteCookie (headers, name, attributes) {\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const prefix = 'deleteCookie'\n  webidl.argumentLengthCheck(arguments, 2, prefix)\n\n  name = webidl.converters.DOMString(name, prefix, 'name')\n  attributes = webidl.converters.DeleteCookieAttributes(attributes)\n\n  // Matches behavior of\n  // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278\n  setCookie(headers, {\n    name,\n    value: '',\n    expires: new Date(0),\n    ...attributes\n  })\n}\n\n/**\n * @param {Headers} headers\n * @returns {Cookie[]}\n */\nfunction getSetCookies (headers) {\n  webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const cookies = headers.getSetCookie()\n\n  if (!cookies) {\n    return []\n  }\n\n  return cookies.map((pair) => parseSetCookie(pair))\n}\n\n/**\n * @param {Headers} headers\n * @param {Cookie} cookie\n * @returns {void}\n */\nfunction setCookie (headers, cookie) {\n  webidl.argumentLengthCheck(arguments, 2, 'setCookie')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  cookie = webidl.converters.Cookie(cookie)\n\n  const str = stringify(cookie)\n\n  if (str) {\n    headers.append('Set-Cookie', str)\n  }\n}\n\nwebidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'path',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'domain',\n    defaultValue: () => null\n  }\n])\n\nwebidl.converters.Cookie = webidl.dictionaryConverter([\n  {\n    converter: webidl.converters.DOMString,\n    key: 'name'\n  },\n  {\n    converter: webidl.converters.DOMString,\n    key: 'value'\n  },\n  {\n    converter: webidl.nullableConverter((value) => {\n      if (typeof value === 'number') {\n        return webidl.converters['unsigned long long'](value)\n      }\n\n      return new Date(value)\n    }),\n    key: 'expires',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters['long long']),\n    key: 'maxAge',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'domain',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'path',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.boolean),\n    key: 'secure',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.boolean),\n    key: 'httpOnly',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.converters.USVString,\n    key: 'sameSite',\n    allowedValues: ['Strict', 'Lax', 'None']\n  },\n  {\n    converter: webidl.sequenceConverter(webidl.converters.DOMString),\n    key: 'unparsed',\n    defaultValue: () => new Array(0)\n  }\n])\n\nmodule.exports = {\n  getCookies,\n  deleteCookie,\n  getSetCookies,\n  setCookie\n}\n","'use strict'\n\nconst { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')\nconst { isCTLExcludingHtab } = require('./util')\nconst { collectASequenceOfCodePointsFast } = require('../fetch/data-url')\nconst assert = require('node:assert')\n\n/**\n * @description Parses the field-value attributes of a set-cookie header string.\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} header\n * @returns if the header is invalid, null will be returned\n */\nfunction parseSetCookie (header) {\n  // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F\n  //    character (CTL characters excluding HTAB): Abort these steps and\n  //    ignore the set-cookie-string entirely.\n  if (isCTLExcludingHtab(header)) {\n    return null\n  }\n\n  let nameValuePair = ''\n  let unparsedAttributes = ''\n  let name = ''\n  let value = ''\n\n  // 2. If the set-cookie-string contains a %x3B (\";\") character:\n  if (header.includes(';')) {\n    // 1. The name-value-pair string consists of the characters up to,\n    //    but not including, the first %x3B (\";\"), and the unparsed-\n    //    attributes consist of the remainder of the set-cookie-string\n    //    (including the %x3B (\";\") in question).\n    const position = { position: 0 }\n\n    nameValuePair = collectASequenceOfCodePointsFast(';', header, position)\n    unparsedAttributes = header.slice(position.position)\n  } else {\n    // Otherwise:\n\n    // 1. The name-value-pair string consists of all the characters\n    //    contained in the set-cookie-string, and the unparsed-\n    //    attributes is the empty string.\n    nameValuePair = header\n  }\n\n  // 3. If the name-value-pair string lacks a %x3D (\"=\") character, then\n  //    the name string is empty, and the value string is the value of\n  //    name-value-pair.\n  if (!nameValuePair.includes('=')) {\n    value = nameValuePair\n  } else {\n    //    Otherwise, the name string consists of the characters up to, but\n    //    not including, the first %x3D (\"=\") character, and the (possibly\n    //    empty) value string consists of the characters after the first\n    //    %x3D (\"=\") character.\n    const position = { position: 0 }\n    name = collectASequenceOfCodePointsFast(\n      '=',\n      nameValuePair,\n      position\n    )\n    value = nameValuePair.slice(position.position + 1)\n  }\n\n  // 4. Remove any leading or trailing WSP characters from the name\n  //    string and the value string.\n  name = name.trim()\n  value = value.trim()\n\n  // 5. If the sum of the lengths of the name string and the value string\n  //    is more than 4096 octets, abort these steps and ignore the set-\n  //    cookie-string entirely.\n  if (name.length + value.length > maxNameValuePairSize) {\n    return null\n  }\n\n  // 6. The cookie-name is the name string, and the cookie-value is the\n  //    value string.\n  return {\n    name, value, ...parseUnparsedAttributes(unparsedAttributes)\n  }\n}\n\n/**\n * Parses the remaining attributes of a set-cookie header\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} unparsedAttributes\n * @param {[Object.]={}} cookieAttributeList\n */\nfunction parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {\n  // 1. If the unparsed-attributes string is empty, skip the rest of\n  //    these steps.\n  if (unparsedAttributes.length === 0) {\n    return cookieAttributeList\n  }\n\n  // 2. Discard the first character of the unparsed-attributes (which\n  //    will be a %x3B (\";\") character).\n  assert(unparsedAttributes[0] === ';')\n  unparsedAttributes = unparsedAttributes.slice(1)\n\n  let cookieAv = ''\n\n  // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n  //    character:\n  if (unparsedAttributes.includes(';')) {\n    // 1. Consume the characters of the unparsed-attributes up to, but\n    //    not including, the first %x3B (\";\") character.\n    cookieAv = collectASequenceOfCodePointsFast(\n      ';',\n      unparsedAttributes,\n      { position: 0 }\n    )\n    unparsedAttributes = unparsedAttributes.slice(cookieAv.length)\n  } else {\n    // Otherwise:\n\n    // 1. Consume the remainder of the unparsed-attributes.\n    cookieAv = unparsedAttributes\n    unparsedAttributes = ''\n  }\n\n  // Let the cookie-av string be the characters consumed in this step.\n\n  let attributeName = ''\n  let attributeValue = ''\n\n  // 4. If the cookie-av string contains a %x3D (\"=\") character:\n  if (cookieAv.includes('=')) {\n    // 1. The (possibly empty) attribute-name string consists of the\n    //    characters up to, but not including, the first %x3D (\"=\")\n    //    character, and the (possibly empty) attribute-value string\n    //    consists of the characters after the first %x3D (\"=\")\n    //    character.\n    const position = { position: 0 }\n\n    attributeName = collectASequenceOfCodePointsFast(\n      '=',\n      cookieAv,\n      position\n    )\n    attributeValue = cookieAv.slice(position.position + 1)\n  } else {\n    // Otherwise:\n\n    // 1. The attribute-name string consists of the entire cookie-av\n    //    string, and the attribute-value string is empty.\n    attributeName = cookieAv\n  }\n\n  // 5. Remove any leading or trailing WSP characters from the attribute-\n  //    name string and the attribute-value string.\n  attributeName = attributeName.trim()\n  attributeValue = attributeValue.trim()\n\n  // 6. If the attribute-value is longer than 1024 octets, ignore the\n  //    cookie-av string and return to Step 1 of this algorithm.\n  if (attributeValue.length > maxAttributeValueSize) {\n    return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n  }\n\n  // 7. Process the attribute-name and attribute-value according to the\n  //    requirements in the following subsections.  (Notice that\n  //    attributes with unrecognized attribute-names are ignored.)\n  const attributeNameLowercase = attributeName.toLowerCase()\n\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1\n  // If the attribute-name case-insensitively matches the string\n  // \"Expires\", the user agent MUST process the cookie-av as follows.\n  if (attributeNameLowercase === 'expires') {\n    // 1. Let the expiry-time be the result of parsing the attribute-value\n    //    as cookie-date (see Section 5.1.1).\n    const expiryTime = new Date(attributeValue)\n\n    // 2. If the attribute-value failed to parse as a cookie date, ignore\n    //    the cookie-av.\n\n    cookieAttributeList.expires = expiryTime\n  } else if (attributeNameLowercase === 'max-age') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2\n    // If the attribute-name case-insensitively matches the string \"Max-\n    // Age\", the user agent MUST process the cookie-av as follows.\n\n    // 1. If the first character of the attribute-value is not a DIGIT or a\n    //    \"-\" character, ignore the cookie-av.\n    const charCode = attributeValue.charCodeAt(0)\n\n    if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {\n      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n    }\n\n    // 2. If the remainder of attribute-value contains a non-DIGIT\n    //    character, ignore the cookie-av.\n    if (!/^\\d+$/.test(attributeValue)) {\n      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n    }\n\n    // 3. Let delta-seconds be the attribute-value converted to an integer.\n    const deltaSeconds = Number(attributeValue)\n\n    // 4. Let cookie-age-limit be the maximum age of the cookie (which\n    //    SHOULD be 400 days or less, see Section 4.1.2.2).\n\n    // 5. Set delta-seconds to the smaller of its present value and cookie-\n    //    age-limit.\n    // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)\n\n    // 6. If delta-seconds is less than or equal to zero (0), let expiry-\n    //    time be the earliest representable date and time.  Otherwise, let\n    //    the expiry-time be the current date and time plus delta-seconds\n    //    seconds.\n    // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds\n\n    // 7. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Max-Age and an attribute-value of expiry-time.\n    cookieAttributeList.maxAge = deltaSeconds\n  } else if (attributeNameLowercase === 'domain') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3\n    // If the attribute-name case-insensitively matches the string \"Domain\",\n    // the user agent MUST process the cookie-av as follows.\n\n    // 1. Let cookie-domain be the attribute-value.\n    let cookieDomain = attributeValue\n\n    // 2. If cookie-domain starts with %x2E (\".\"), let cookie-domain be\n    //    cookie-domain without its leading %x2E (\".\").\n    if (cookieDomain[0] === '.') {\n      cookieDomain = cookieDomain.slice(1)\n    }\n\n    // 3. Convert the cookie-domain to lower case.\n    cookieDomain = cookieDomain.toLowerCase()\n\n    // 4. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Domain and an attribute-value of cookie-domain.\n    cookieAttributeList.domain = cookieDomain\n  } else if (attributeNameLowercase === 'path') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4\n    // If the attribute-name case-insensitively matches the string \"Path\",\n    // the user agent MUST process the cookie-av as follows.\n\n    // 1. If the attribute-value is empty or if the first character of the\n    //    attribute-value is not %x2F (\"/\"):\n    let cookiePath = ''\n    if (attributeValue.length === 0 || attributeValue[0] !== '/') {\n      // 1. Let cookie-path be the default-path.\n      cookiePath = '/'\n    } else {\n      // Otherwise:\n\n      // 1. Let cookie-path be the attribute-value.\n      cookiePath = attributeValue\n    }\n\n    // 2. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Path and an attribute-value of cookie-path.\n    cookieAttributeList.path = cookiePath\n  } else if (attributeNameLowercase === 'secure') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5\n    // If the attribute-name case-insensitively matches the string \"Secure\",\n    // the user agent MUST append an attribute to the cookie-attribute-list\n    // with an attribute-name of Secure and an empty attribute-value.\n\n    cookieAttributeList.secure = true\n  } else if (attributeNameLowercase === 'httponly') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6\n    // If the attribute-name case-insensitively matches the string\n    // \"HttpOnly\", the user agent MUST append an attribute to the cookie-\n    // attribute-list with an attribute-name of HttpOnly and an empty\n    // attribute-value.\n\n    cookieAttributeList.httpOnly = true\n  } else if (attributeNameLowercase === 'samesite') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7\n    // If the attribute-name case-insensitively matches the string\n    // \"SameSite\", the user agent MUST process the cookie-av as follows:\n\n    const attributeValueLowercase = attributeValue.toLowerCase()\n\n    // 1. If cookie-av's attribute-value is a case-insensitive match for\n    //    \"None\", append an attribute to the cookie-attribute-list with an\n    //    attribute-name of \"SameSite\" and an attribute-value of \"None\".\n    if (attributeValueLowercase === 'none') {\n      cookieAttributeList.sameSite = 'None'\n    } else if (attributeValueLowercase === 'strict') {\n      // 2. If cookie-av's attribute-value is a case-insensitive match for\n      //    \"Strict\", append an attribute to the cookie-attribute-list with\n      //    an attribute-name of \"SameSite\" and an attribute-value of\n      //    \"Strict\".\n      cookieAttributeList.sameSite = 'Strict'\n    } else if (attributeValueLowercase === 'lax') {\n      // 3. If cookie-av's attribute-value is a case-insensitive match for\n      //    \"Lax\", append an attribute to the cookie-attribute-list with an\n      //    attribute-name of \"SameSite\" and an attribute-value of \"Lax\".\n      cookieAttributeList.sameSite = 'Lax'\n    }\n  } else {\n    cookieAttributeList.unparsed ??= []\n\n    cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)\n  }\n\n  // 8. Return to Step 1 of this algorithm.\n  return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n}\n\nmodule.exports = {\n  parseSetCookie,\n  parseUnparsedAttributes\n}\n","'use strict'\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction isCTLExcludingHtab (value) {\n  for (let i = 0; i < value.length; ++i) {\n    const code = value.charCodeAt(i)\n\n    if (\n      (code >= 0x00 && code <= 0x08) ||\n      (code >= 0x0A && code <= 0x1F) ||\n      code === 0x7F\n    ) {\n      return true\n    }\n  }\n  return false\n}\n\n/**\n CHAR           = \n token          = 1*\n separators     = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n                | \",\" | \";\" | \":\" | \"\\\" | <\">\n                | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n                | \"{\" | \"}\" | SP | HT\n * @param {string} name\n */\nfunction validateCookieName (name) {\n  for (let i = 0; i < name.length; ++i) {\n    const code = name.charCodeAt(i)\n\n    if (\n      code < 0x21 || // exclude CTLs (0-31), SP and HT\n      code > 0x7E || // exclude non-ascii and DEL\n      code === 0x22 || // \"\n      code === 0x28 || // (\n      code === 0x29 || // )\n      code === 0x3C || // <\n      code === 0x3E || // >\n      code === 0x40 || // @\n      code === 0x2C || // ,\n      code === 0x3B || // ;\n      code === 0x3A || // :\n      code === 0x5C || // \\\n      code === 0x2F || // /\n      code === 0x5B || // [\n      code === 0x5D || // ]\n      code === 0x3F || // ?\n      code === 0x3D || // =\n      code === 0x7B || // {\n      code === 0x7D // }\n    ) {\n      throw new Error('Invalid cookie name')\n    }\n  }\n}\n\n/**\n cookie-value      = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n cookie-octet      = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n                       ; US-ASCII characters excluding CTLs,\n                       ; whitespace DQUOTE, comma, semicolon,\n                       ; and backslash\n * @param {string} value\n */\nfunction validateCookieValue (value) {\n  let len = value.length\n  let i = 0\n\n  // if the value is wrapped in DQUOTE\n  if (value[0] === '\"') {\n    if (len === 1 || value[len - 1] !== '\"') {\n      throw new Error('Invalid cookie value')\n    }\n    --len\n    ++i\n  }\n\n  while (i < len) {\n    const code = value.charCodeAt(i++)\n\n    if (\n      code < 0x21 || // exclude CTLs (0-31)\n      code > 0x7E || // non-ascii and DEL (127)\n      code === 0x22 || // \"\n      code === 0x2C || // ,\n      code === 0x3B || // ;\n      code === 0x5C // \\\n    ) {\n      throw new Error('Invalid cookie value')\n    }\n  }\n}\n\n/**\n * path-value        = \n * @param {string} path\n */\nfunction validateCookiePath (path) {\n  for (let i = 0; i < path.length; ++i) {\n    const code = path.charCodeAt(i)\n\n    if (\n      code < 0x20 || // exclude CTLs (0-31)\n      code === 0x7F || // DEL\n      code === 0x3B // ;\n    ) {\n      throw new Error('Invalid cookie path')\n    }\n  }\n}\n\n/**\n * I have no idea why these values aren't allowed to be honest,\n * but Deno tests these. - Khafra\n * @param {string} domain\n */\nfunction validateCookieDomain (domain) {\n  if (\n    domain.startsWith('-') ||\n    domain.endsWith('.') ||\n    domain.endsWith('-')\n  ) {\n    throw new Error('Invalid cookie domain')\n  }\n}\n\nconst IMFDays = [\n  'Sun', 'Mon', 'Tue', 'Wed',\n  'Thu', 'Fri', 'Sat'\n]\n\nconst IMFMonths = [\n  'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n]\n\nconst IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1\n * @param {number|Date} date\n  IMF-fixdate  = day-name \",\" SP date1 SP time-of-day SP GMT\n  ; fixed length/zone/capitalization subset of the format\n  ; see Section 3.3 of [RFC5322]\n\n  day-name     = %x4D.6F.6E ; \"Mon\", case-sensitive\n              / %x54.75.65 ; \"Tue\", case-sensitive\n              / %x57.65.64 ; \"Wed\", case-sensitive\n              / %x54.68.75 ; \"Thu\", case-sensitive\n              / %x46.72.69 ; \"Fri\", case-sensitive\n              / %x53.61.74 ; \"Sat\", case-sensitive\n              / %x53.75.6E ; \"Sun\", case-sensitive\n  date1        = day SP month SP year\n                  ; e.g., 02 Jun 1982\n\n  day          = 2DIGIT\n  month        = %x4A.61.6E ; \"Jan\", case-sensitive\n              / %x46.65.62 ; \"Feb\", case-sensitive\n              / %x4D.61.72 ; \"Mar\", case-sensitive\n              / %x41.70.72 ; \"Apr\", case-sensitive\n              / %x4D.61.79 ; \"May\", case-sensitive\n              / %x4A.75.6E ; \"Jun\", case-sensitive\n              / %x4A.75.6C ; \"Jul\", case-sensitive\n              / %x41.75.67 ; \"Aug\", case-sensitive\n              / %x53.65.70 ; \"Sep\", case-sensitive\n              / %x4F.63.74 ; \"Oct\", case-sensitive\n              / %x4E.6F.76 ; \"Nov\", case-sensitive\n              / %x44.65.63 ; \"Dec\", case-sensitive\n  year         = 4DIGIT\n\n  GMT          = %x47.4D.54 ; \"GMT\", case-sensitive\n\n  time-of-day  = hour \":\" minute \":\" second\n              ; 00:00:00 - 23:59:60 (leap second)\n\n  hour         = 2DIGIT\n  minute       = 2DIGIT\n  second       = 2DIGIT\n */\nfunction toIMFDate (date) {\n  if (typeof date === 'number') {\n    date = new Date(date)\n  }\n\n  return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`\n}\n\n/**\n max-age-av        = \"Max-Age=\" non-zero-digit *DIGIT\n                       ; In practice, both expires-av and max-age-av\n                       ; are limited to dates representable by the\n                       ; user agent.\n * @param {number} maxAge\n */\nfunction validateCookieMaxAge (maxAge) {\n  if (maxAge < 0) {\n    throw new Error('Invalid cookie max-age')\n  }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1\n * @param {import('./index').Cookie} cookie\n */\nfunction stringify (cookie) {\n  if (cookie.name.length === 0) {\n    return null\n  }\n\n  validateCookieName(cookie.name)\n  validateCookieValue(cookie.value)\n\n  const out = [`${cookie.name}=${cookie.value}`]\n\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2\n  if (cookie.name.startsWith('__Secure-')) {\n    cookie.secure = true\n  }\n\n  if (cookie.name.startsWith('__Host-')) {\n    cookie.secure = true\n    cookie.domain = null\n    cookie.path = '/'\n  }\n\n  if (cookie.secure) {\n    out.push('Secure')\n  }\n\n  if (cookie.httpOnly) {\n    out.push('HttpOnly')\n  }\n\n  if (typeof cookie.maxAge === 'number') {\n    validateCookieMaxAge(cookie.maxAge)\n    out.push(`Max-Age=${cookie.maxAge}`)\n  }\n\n  if (cookie.domain) {\n    validateCookieDomain(cookie.domain)\n    out.push(`Domain=${cookie.domain}`)\n  }\n\n  if (cookie.path) {\n    validateCookiePath(cookie.path)\n    out.push(`Path=${cookie.path}`)\n  }\n\n  if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {\n    out.push(`Expires=${toIMFDate(cookie.expires)}`)\n  }\n\n  if (cookie.sameSite) {\n    out.push(`SameSite=${cookie.sameSite}`)\n  }\n\n  for (const part of cookie.unparsed) {\n    if (!part.includes('=')) {\n      throw new Error('Invalid unparsed')\n    }\n\n    const [key, ...value] = part.split('=')\n\n    out.push(`${key.trim()}=${value.join('=')}`)\n  }\n\n  return out.join('; ')\n}\n\nmodule.exports = {\n  isCTLExcludingHtab,\n  validateCookieName,\n  validateCookiePath,\n  validateCookieValue,\n  toIMFDate,\n  stringify\n}\n","'use strict'\nconst { Transform } = require('node:stream')\nconst { isASCIINumber, isValidLastEventId } = require('./util')\n\n/**\n * @type {number[]} BOM\n */\nconst BOM = [0xEF, 0xBB, 0xBF]\n/**\n * @type {10} LF\n */\nconst LF = 0x0A\n/**\n * @type {13} CR\n */\nconst CR = 0x0D\n/**\n * @type {58} COLON\n */\nconst COLON = 0x3A\n/**\n * @type {32} SPACE\n */\nconst SPACE = 0x20\n\n/**\n * @typedef {object} EventSourceStreamEvent\n * @type {object}\n * @property {string} [event] The event type.\n * @property {string} [data] The data of the message.\n * @property {string} [id] A unique ID for the event.\n * @property {string} [retry] The reconnection time, in milliseconds.\n */\n\n/**\n * @typedef eventSourceSettings\n * @type {object}\n * @property {string} lastEventId The last event ID received from the server.\n * @property {string} origin The origin of the event source.\n * @property {number} reconnectionTime The reconnection time, in milliseconds.\n */\n\nclass EventSourceStream extends Transform {\n  /**\n   * @type {eventSourceSettings}\n   */\n  state = null\n\n  /**\n   * Leading byte-order-mark check.\n   * @type {boolean}\n   */\n  checkBOM = true\n\n  /**\n   * @type {boolean}\n   */\n  crlfCheck = false\n\n  /**\n   * @type {boolean}\n   */\n  eventEndCheck = false\n\n  /**\n   * @type {Buffer}\n   */\n  buffer = null\n\n  pos = 0\n\n  event = {\n    data: undefined,\n    event: undefined,\n    id: undefined,\n    retry: undefined\n  }\n\n  /**\n   * @param {object} options\n   * @param {eventSourceSettings} options.eventSourceSettings\n   * @param {Function} [options.push]\n   */\n  constructor (options = {}) {\n    // Enable object mode as EventSourceStream emits objects of shape\n    // EventSourceStreamEvent\n    options.readableObjectMode = true\n\n    super(options)\n\n    this.state = options.eventSourceSettings || {}\n    if (options.push) {\n      this.push = options.push\n    }\n  }\n\n  /**\n   * @param {Buffer} chunk\n   * @param {string} _encoding\n   * @param {Function} callback\n   * @returns {void}\n   */\n  _transform (chunk, _encoding, callback) {\n    if (chunk.length === 0) {\n      callback()\n      return\n    }\n\n    // Cache the chunk in the buffer, as the data might not be complete while\n    // processing it\n    // TODO: Investigate if there is a more performant way to handle\n    // incoming chunks\n    // see: https://github.com/nodejs/undici/issues/2630\n    if (this.buffer) {\n      this.buffer = Buffer.concat([this.buffer, chunk])\n    } else {\n      this.buffer = chunk\n    }\n\n    // Strip leading byte-order-mark if we opened the stream and started\n    // the processing of the incoming data\n    if (this.checkBOM) {\n      switch (this.buffer.length) {\n        case 1:\n          // Check if the first byte is the same as the first byte of the BOM\n          if (this.buffer[0] === BOM[0]) {\n            // If it is, we need to wait for more data\n            callback()\n            return\n          }\n          // Set the checkBOM flag to false as we don't need to check for the\n          // BOM anymore\n          this.checkBOM = false\n\n          // The buffer only contains one byte so we need to wait for more data\n          callback()\n          return\n        case 2:\n          // Check if the first two bytes are the same as the first two bytes\n          // of the BOM\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1]\n          ) {\n            // If it is, we need to wait for more data, because the third byte\n            // is needed to determine if it is the BOM or not\n            callback()\n            return\n          }\n\n          // Set the checkBOM flag to false as we don't need to check for the\n          // BOM anymore\n          this.checkBOM = false\n          break\n        case 3:\n          // Check if the first three bytes are the same as the first three\n          // bytes of the BOM\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1] &&\n            this.buffer[2] === BOM[2]\n          ) {\n            // If it is, we can drop the buffered data, as it is only the BOM\n            this.buffer = Buffer.alloc(0)\n            // Set the checkBOM flag to false as we don't need to check for the\n            // BOM anymore\n            this.checkBOM = false\n\n            // Await more data\n            callback()\n            return\n          }\n          // If it is not the BOM, we can start processing the data\n          this.checkBOM = false\n          break\n        default:\n          // The buffer is longer than 3 bytes, so we can drop the BOM if it is\n          // present\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1] &&\n            this.buffer[2] === BOM[2]\n          ) {\n            // Remove the BOM from the buffer\n            this.buffer = this.buffer.subarray(3)\n          }\n\n          // Set the checkBOM flag to false as we don't need to check for the\n          this.checkBOM = false\n          break\n      }\n    }\n\n    while (this.pos < this.buffer.length) {\n      // If the previous line ended with an end-of-line, we need to check\n      // if the next character is also an end-of-line.\n      if (this.eventEndCheck) {\n        // If the the current character is an end-of-line, then the event\n        // is finished and we can process it\n\n        // If the previous line ended with a carriage return, we need to\n        // check if the current character is a line feed and remove it\n        // from the buffer.\n        if (this.crlfCheck) {\n          // If the current character is a line feed, we can remove it\n          // from the buffer and reset the crlfCheck flag\n          if (this.buffer[this.pos] === LF) {\n            this.buffer = this.buffer.subarray(this.pos + 1)\n            this.pos = 0\n            this.crlfCheck = false\n\n            // It is possible that the line feed is not the end of the\n            // event. We need to check if the next character is an\n            // end-of-line character to determine if the event is\n            // finished. We simply continue the loop to check the next\n            // character.\n\n            // As we removed the line feed from the buffer and set the\n            // crlfCheck flag to false, we basically don't make any\n            // distinction between a line feed and a carriage return.\n            continue\n          }\n          this.crlfCheck = false\n        }\n\n        if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n          // If the current character is a carriage return, we need to\n          // set the crlfCheck flag to true, as we need to check if the\n          // next character is a line feed so we can remove it from the\n          // buffer\n          if (this.buffer[this.pos] === CR) {\n            this.crlfCheck = true\n          }\n\n          this.buffer = this.buffer.subarray(this.pos + 1)\n          this.pos = 0\n          if (\n            this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {\n            this.processEvent(this.event)\n          }\n          this.clearEvent()\n          continue\n        }\n        // If the current character is not an end-of-line, then the event\n        // is not finished and we have to reset the eventEndCheck flag\n        this.eventEndCheck = false\n        continue\n      }\n\n      // If the current character is an end-of-line, we can process the\n      // line\n      if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n        // If the current character is a carriage return, we need to\n        // set the crlfCheck flag to true, as we need to check if the\n        // next character is a line feed\n        if (this.buffer[this.pos] === CR) {\n          this.crlfCheck = true\n        }\n\n        // In any case, we can process the line as we reached an\n        // end-of-line character\n        this.parseLine(this.buffer.subarray(0, this.pos), this.event)\n\n        // Remove the processed line from the buffer\n        this.buffer = this.buffer.subarray(this.pos + 1)\n        // Reset the position as we removed the processed line from the buffer\n        this.pos = 0\n        // A line was processed and this could be the end of the event. We need\n        // to check if the next line is empty to determine if the event is\n        // finished.\n        this.eventEndCheck = true\n        continue\n      }\n\n      this.pos++\n    }\n\n    callback()\n  }\n\n  /**\n   * @param {Buffer} line\n   * @param {EventStreamEvent} event\n   */\n  parseLine (line, event) {\n    // If the line is empty (a blank line)\n    // Dispatch the event, as defined below.\n    // This will be handled in the _transform method\n    if (line.length === 0) {\n      return\n    }\n\n    // If the line starts with a U+003A COLON character (:)\n    // Ignore the line.\n    const colonPosition = line.indexOf(COLON)\n    if (colonPosition === 0) {\n      return\n    }\n\n    let field = ''\n    let value = ''\n\n    // If the line contains a U+003A COLON character (:)\n    if (colonPosition !== -1) {\n      // Collect the characters on the line before the first U+003A COLON\n      // character (:), and let field be that string.\n      // TODO: Investigate if there is a more performant way to extract the\n      // field\n      // see: https://github.com/nodejs/undici/issues/2630\n      field = line.subarray(0, colonPosition).toString('utf8')\n\n      // Collect the characters on the line after the first U+003A COLON\n      // character (:), and let value be that string.\n      // If value starts with a U+0020 SPACE character, remove it from value.\n      let valueStart = colonPosition + 1\n      if (line[valueStart] === SPACE) {\n        ++valueStart\n      }\n      // TODO: Investigate if there is a more performant way to extract the\n      // value\n      // see: https://github.com/nodejs/undici/issues/2630\n      value = line.subarray(valueStart).toString('utf8')\n\n      // Otherwise, the string is not empty but does not contain a U+003A COLON\n      // character (:)\n    } else {\n      // Process the field using the steps described below, using the whole\n      // line as the field name, and the empty string as the field value.\n      field = line.toString('utf8')\n      value = ''\n    }\n\n    // Modify the event with the field name and value. The value is also\n    // decoded as UTF-8\n    switch (field) {\n      case 'data':\n        if (event[field] === undefined) {\n          event[field] = value\n        } else {\n          event[field] += `\\n${value}`\n        }\n        break\n      case 'retry':\n        if (isASCIINumber(value)) {\n          event[field] = value\n        }\n        break\n      case 'id':\n        if (isValidLastEventId(value)) {\n          event[field] = value\n        }\n        break\n      case 'event':\n        if (value.length > 0) {\n          event[field] = value\n        }\n        break\n    }\n  }\n\n  /**\n   * @param {EventSourceStreamEvent} event\n   */\n  processEvent (event) {\n    if (event.retry && isASCIINumber(event.retry)) {\n      this.state.reconnectionTime = parseInt(event.retry, 10)\n    }\n\n    if (event.id && isValidLastEventId(event.id)) {\n      this.state.lastEventId = event.id\n    }\n\n    // only dispatch event, when data is provided\n    if (event.data !== undefined) {\n      this.push({\n        type: event.event || 'message',\n        options: {\n          data: event.data,\n          lastEventId: this.state.lastEventId,\n          origin: this.state.origin\n        }\n      })\n    }\n  }\n\n  clearEvent () {\n    this.event = {\n      data: undefined,\n      event: undefined,\n      id: undefined,\n      retry: undefined\n    }\n  }\n}\n\nmodule.exports = {\n  EventSourceStream\n}\n","'use strict'\n\nconst { pipeline } = require('node:stream')\nconst { fetching } = require('../fetch')\nconst { makeRequest } = require('../fetch/request')\nconst { webidl } = require('../fetch/webidl')\nconst { EventSourceStream } = require('./eventsource-stream')\nconst { parseMIMEType } = require('../fetch/data-url')\nconst { createFastMessageEvent } = require('../websocket/events')\nconst { isNetworkError } = require('../fetch/response')\nconst { delay } = require('./util')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { environmentSettingsObject } = require('../fetch/util')\n\nlet experimentalWarned = false\n\n/**\n * A reconnection time, in milliseconds. This must initially be an implementation-defined value,\n * probably in the region of a few seconds.\n *\n * In Comparison:\n * - Chrome uses 3000ms.\n * - Deno uses 5000ms.\n *\n * @type {3000}\n */\nconst defaultReconnectionTime = 3000\n\n/**\n * The readyState attribute represents the state of the connection.\n * @enum\n * @readonly\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev\n */\n\n/**\n * The connection has not yet been established, or it was closed and the user\n * agent is reconnecting.\n * @type {0}\n */\nconst CONNECTING = 0\n\n/**\n * The user agent has an open connection and is dispatching events as it\n * receives them.\n * @type {1}\n */\nconst OPEN = 1\n\n/**\n * The connection is not open, and the user agent is not trying to reconnect.\n * @type {2}\n */\nconst CLOSED = 2\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"same-origin\".\n * @type {'anonymous'}\n */\nconst ANONYMOUS = 'anonymous'\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"include\".\n * @type {'use-credentials'}\n */\nconst USE_CREDENTIALS = 'use-credentials'\n\n/**\n * The EventSource interface is used to receive server-sent events. It\n * connects to a server over HTTP and receives events in text/event-stream\n * format without closing the connection.\n * @extends {EventTarget}\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events\n * @api public\n */\nclass EventSource extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    message: null\n  }\n\n  #url = null\n  #withCredentials = false\n\n  #readyState = CONNECTING\n\n  #request = null\n  #controller = null\n\n  #dispatcher\n\n  /**\n   * @type {import('./eventsource-stream').eventSourceSettings}\n   */\n  #state\n\n  /**\n   * Creates a new EventSource object.\n   * @param {string} url\n   * @param {EventSourceInit} [eventSourceInitDict]\n   * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface\n   */\n  constructor (url, eventSourceInitDict = {}) {\n    // 1. Let ev be a new EventSource object.\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'EventSource constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    if (!experimentalWarned) {\n      experimentalWarned = true\n      process.emitWarning('EventSource is experimental, expect them to change at any time.', {\n        code: 'UNDICI-ES'\n      })\n    }\n\n    url = webidl.converters.USVString(url, prefix, 'url')\n    eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')\n\n    this.#dispatcher = eventSourceInitDict.dispatcher\n    this.#state = {\n      lastEventId: '',\n      reconnectionTime: defaultReconnectionTime\n    }\n\n    // 2. Let settings be ev's relevant settings object.\n    // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object\n    const settings = environmentSettingsObject\n\n    let urlRecord\n\n    try {\n      // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.\n      urlRecord = new URL(url, settings.settingsObject.baseUrl)\n      this.#state.origin = urlRecord.origin\n    } catch (e) {\n      // 4. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n      throw new DOMException(e, 'SyntaxError')\n    }\n\n    // 5. Set ev's url to urlRecord.\n    this.#url = urlRecord.href\n\n    // 6. Let corsAttributeState be Anonymous.\n    let corsAttributeState = ANONYMOUS\n\n    // 7. If the value of eventSourceInitDict's withCredentials member is true,\n    // then set corsAttributeState to Use Credentials and set ev's\n    // withCredentials attribute to true.\n    if (eventSourceInitDict.withCredentials) {\n      corsAttributeState = USE_CREDENTIALS\n      this.#withCredentials = true\n    }\n\n    // 8. Let request be the result of creating a potential-CORS request given\n    // urlRecord, the empty string, and corsAttributeState.\n    const initRequest = {\n      redirect: 'follow',\n      keepalive: true,\n      // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes\n      mode: 'cors',\n      credentials: corsAttributeState === 'anonymous'\n        ? 'same-origin'\n        : 'omit',\n      referrer: 'no-referrer'\n    }\n\n    // 9. Set request's client to settings.\n    initRequest.client = environmentSettingsObject.settingsObject\n\n    // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.\n    initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]]\n\n    // 11. Set request's cache mode to \"no-store\".\n    initRequest.cache = 'no-store'\n\n    // 12. Set request's initiator type to \"other\".\n    initRequest.initiator = 'other'\n\n    initRequest.urlList = [new URL(this.#url)]\n\n    // 13. Set ev's request to request.\n    this.#request = makeRequest(initRequest)\n\n    this.#connect()\n  }\n\n  /**\n   * Returns the state of this EventSource object's connection. It can have the\n   * values described below.\n   * @returns {0|1|2}\n   * @readonly\n   */\n  get readyState () {\n    return this.#readyState\n  }\n\n  /**\n   * Returns the URL providing the event stream.\n   * @readonly\n   * @returns {string}\n   */\n  get url () {\n    return this.#url\n  }\n\n  /**\n   * Returns a boolean indicating whether the EventSource object was\n   * instantiated with CORS credentials set (true), or not (false, the default).\n   */\n  get withCredentials () {\n    return this.#withCredentials\n  }\n\n  #connect () {\n    if (this.#readyState === CLOSED) return\n\n    this.#readyState = CONNECTING\n\n    const fetchParams = {\n      request: this.#request,\n      dispatcher: this.#dispatcher\n    }\n\n    // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.\n    const processEventSourceEndOfBody = (response) => {\n      if (isNetworkError(response)) {\n        this.dispatchEvent(new Event('error'))\n        this.close()\n      }\n\n      this.#reconnect()\n    }\n\n    // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...\n    fetchParams.processResponseEndOfBody = processEventSourceEndOfBody\n\n    // and processResponse set to the following steps given response res:\n    fetchParams.processResponse = (response) => {\n      // 1. If res is an aborted network error, then fail the connection.\n\n      if (isNetworkError(response)) {\n        // 1. When a user agent is to fail the connection, the user agent\n        // must queue a task which, if the readyState attribute is set to a\n        // value other than CLOSED, sets the readyState attribute to CLOSED\n        // and fires an event named error at the EventSource object. Once the\n        // user agent has failed the connection, it does not attempt to\n        // reconnect.\n        if (response.aborted) {\n          this.close()\n          this.dispatchEvent(new Event('error'))\n          return\n          // 2. Otherwise, if res is a network error, then reestablish the\n          // connection, unless the user agent knows that to be futile, in\n          // which case the user agent may fail the connection.\n        } else {\n          this.#reconnect()\n          return\n        }\n      }\n\n      // 3. Otherwise, if res's status is not 200, or if res's `Content-Type`\n      // is not `text/event-stream`, then fail the connection.\n      const contentType = response.headersList.get('content-type', true)\n      const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'\n      const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'\n      if (\n        response.status !== 200 ||\n        contentTypeValid === false\n      ) {\n        this.close()\n        this.dispatchEvent(new Event('error'))\n        return\n      }\n\n      // 4. Otherwise, announce the connection and interpret res's body\n      // line by line.\n\n      // When a user agent is to announce the connection, the user agent\n      // must queue a task which, if the readyState attribute is set to a\n      // value other than CLOSED, sets the readyState attribute to OPEN\n      // and fires an event named open at the EventSource object.\n      // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n      this.#readyState = OPEN\n      this.dispatchEvent(new Event('open'))\n\n      // If redirected to a different origin, set the origin to the new origin.\n      this.#state.origin = response.urlList[response.urlList.length - 1].origin\n\n      const eventSourceStream = new EventSourceStream({\n        eventSourceSettings: this.#state,\n        push: (event) => {\n          this.dispatchEvent(createFastMessageEvent(\n            event.type,\n            event.options\n          ))\n        }\n      })\n\n      pipeline(response.body.stream,\n        eventSourceStream,\n        (error) => {\n          if (\n            error?.aborted === false\n          ) {\n            this.close()\n            this.dispatchEvent(new Event('error'))\n          }\n        })\n    }\n\n    this.#controller = fetching(fetchParams)\n  }\n\n  /**\n   * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n   * @returns {Promise}\n   */\n  async #reconnect () {\n    // When a user agent is to reestablish the connection, the user agent must\n    // run the following steps. These steps are run in parallel, not as part of\n    // a task. (The tasks that it queues, of course, are run like normal tasks\n    // and not themselves in parallel.)\n\n    // 1. Queue a task to run the following steps:\n\n    //   1. If the readyState attribute is set to CLOSED, abort the task.\n    if (this.#readyState === CLOSED) return\n\n    //   2. Set the readyState attribute to CONNECTING.\n    this.#readyState = CONNECTING\n\n    //   3. Fire an event named error at the EventSource object.\n    this.dispatchEvent(new Event('error'))\n\n    // 2. Wait a delay equal to the reconnection time of the event source.\n    await delay(this.#state.reconnectionTime)\n\n    // 5. Queue a task to run the following steps:\n\n    //   1. If the EventSource object's readyState attribute is not set to\n    //      CONNECTING, then return.\n    if (this.#readyState !== CONNECTING) return\n\n    //   2. Let request be the EventSource object's request.\n    //   3. If the EventSource object's last event ID string is not the empty\n    //      string, then:\n    //      1. Let lastEventIDValue be the EventSource object's last event ID\n    //         string, encoded as UTF-8.\n    //      2. Set (`Last-Event-ID`, lastEventIDValue) in request's header\n    //         list.\n    if (this.#state.lastEventId.length) {\n      this.#request.headersList.set('last-event-id', this.#state.lastEventId, true)\n    }\n\n    //   4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.\n    this.#connect()\n  }\n\n  /**\n   * Closes the connection, if any, and sets the readyState attribute to\n   * CLOSED.\n   */\n  close () {\n    webidl.brandCheck(this, EventSource)\n\n    if (this.#readyState === CLOSED) return\n    this.#readyState = CLOSED\n    this.#controller.abort()\n    this.#request = null\n  }\n\n  get onopen () {\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.open = fn\n      this.addEventListener('open', fn)\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onmessage () {\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.message = fn\n      this.addEventListener('message', fn)\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get onerror () {\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this.#events.error = null\n    }\n  }\n}\n\nconst constantsPropertyDescriptors = {\n  CONNECTING: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: CONNECTING,\n    writable: false\n  },\n  OPEN: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: OPEN,\n    writable: false\n  },\n  CLOSED: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: CLOSED,\n    writable: false\n  }\n}\n\nObject.defineProperties(EventSource, constantsPropertyDescriptors)\nObject.defineProperties(EventSource.prototype, constantsPropertyDescriptors)\n\nObject.defineProperties(EventSource.prototype, {\n  close: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  url: kEnumerableProperty,\n  withCredentials: kEnumerableProperty\n})\n\nwebidl.converters.EventSourceInitDict = webidl.dictionaryConverter([\n  {\n    key: 'withCredentials',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'dispatcher', // undici only\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = {\n  EventSource,\n  defaultReconnectionTime\n}\n","'use strict'\n\n/**\n * Checks if the given value is a valid LastEventId.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isValidLastEventId (value) {\n  // LastEventId should not contain U+0000 NULL\n  return value.indexOf('\\u0000') === -1\n}\n\n/**\n * Checks if the given value is a base 10 digit.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isASCIINumber (value) {\n  if (value.length === 0) return false\n  for (let i = 0; i < value.length; i++) {\n    if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false\n  }\n  return true\n}\n\n// https://github.com/nodejs/undici/issues/2664\nfunction delay (ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms).unref()\n  })\n}\n\nmodule.exports = {\n  isValidLastEventId,\n  isASCIINumber,\n  delay\n}\n","'use strict'\n\nconst util = require('../../core/util')\nconst {\n  ReadableStreamFrom,\n  isBlobLike,\n  isReadableStreamLike,\n  readableStreamClose,\n  createDeferredPromise,\n  fullyReadBody,\n  extractMimeType,\n  utf8DecodeBytes\n} = require('./util')\nconst { FormData } = require('./formdata')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { Blob } = require('node:buffer')\nconst assert = require('node:assert')\nconst { isErrored, isDisturbed } = require('node:stream')\nconst { isArrayBuffer } = require('node:util/types')\nconst { serializeAMimeType } = require('./data-url')\nconst { multipartFormDataParser } = require('./formdata-parser')\nlet random\n\ntry {\n  const crypto = require('node:crypto')\n  random = (max) => crypto.randomInt(0, max)\n} catch {\n  random = (max) => Math.floor(Math.random(max))\n}\n\nconst textEncoder = new TextEncoder()\nfunction noop () {}\n\nconst hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0\nlet streamRegistry\n\nif (hasFinalizationRegistry) {\n  streamRegistry = new FinalizationRegistry((weakRef) => {\n    const stream = weakRef.deref()\n    if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {\n      stream.cancel('Response object has been garbage collected').catch(noop)\n    }\n  })\n}\n\n// https://fetch.spec.whatwg.org/#concept-bodyinit-extract\nfunction extractBody (object, keepalive = false) {\n  // 1. Let stream be null.\n  let stream = null\n\n  // 2. If object is a ReadableStream object, then set stream to object.\n  if (object instanceof ReadableStream) {\n    stream = object\n  } else if (isBlobLike(object)) {\n    // 3. Otherwise, if object is a Blob object, set stream to the\n    //    result of running object’s get stream.\n    stream = object.stream()\n  } else {\n    // 4. Otherwise, set stream to a new ReadableStream object, and set\n    //    up stream with byte reading support.\n    stream = new ReadableStream({\n      async pull (controller) {\n        const buffer = typeof source === 'string' ? textEncoder.encode(source) : source\n\n        if (buffer.byteLength) {\n          controller.enqueue(buffer)\n        }\n\n        queueMicrotask(() => readableStreamClose(controller))\n      },\n      start () {},\n      type: 'bytes'\n    })\n  }\n\n  // 5. Assert: stream is a ReadableStream object.\n  assert(isReadableStreamLike(stream))\n\n  // 6. Let action be null.\n  let action = null\n\n  // 7. Let source be null.\n  let source = null\n\n  // 8. Let length be null.\n  let length = null\n\n  // 9. Let type be null.\n  let type = null\n\n  // 10. Switch on object:\n  if (typeof object === 'string') {\n    // Set source to the UTF-8 encoding of object.\n    // Note: setting source to a Uint8Array here breaks some mocking assumptions.\n    source = object\n\n    // Set type to `text/plain;charset=UTF-8`.\n    type = 'text/plain;charset=UTF-8'\n  } else if (object instanceof URLSearchParams) {\n    // URLSearchParams\n\n    // spec says to run application/x-www-form-urlencoded on body.list\n    // this is implemented in Node.js as apart of an URLSearchParams instance toString method\n    // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490\n    // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100\n\n    // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.\n    source = object.toString()\n\n    // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.\n    type = 'application/x-www-form-urlencoded;charset=UTF-8'\n  } else if (isArrayBuffer(object)) {\n    // BufferSource/ArrayBuffer\n\n    // Set source to a copy of the bytes held by object.\n    source = new Uint8Array(object.slice())\n  } else if (ArrayBuffer.isView(object)) {\n    // BufferSource/ArrayBufferView\n\n    // Set source to a copy of the bytes held by object.\n    source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))\n  } else if (util.isFormDataLike(object)) {\n    const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`\n    const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n    /*! formdata-polyfill. MIT License. Jimmy Wärting  */\n    const escape = (str) =>\n      str.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n    const normalizeLinefeeds = (value) => value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n\n    // Set action to this step: run the multipart/form-data\n    // encoding algorithm, with object’s entry list and UTF-8.\n    // - This ensures that the body is immutable and can't be changed afterwords\n    // - That the content-length is calculated in advance.\n    // - And that all parts are pre-encoded and ready to be sent.\n\n    const blobParts = []\n    const rn = new Uint8Array([13, 10]) // '\\r\\n'\n    length = 0\n    let hasUnknownSizeValue = false\n\n    for (const [name, value] of object) {\n      if (typeof value === 'string') {\n        const chunk = textEncoder.encode(prefix +\n          `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`)\n        blobParts.push(chunk)\n        length += chunk.byteLength\n      } else {\n        const chunk = textEncoder.encode(`${prefix}; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          (value.name ? `; filename=\"${escape(value.name)}\"` : '') + '\\r\\n' +\n          `Content-Type: ${\n            value.type || 'application/octet-stream'\n          }\\r\\n\\r\\n`)\n        blobParts.push(chunk, value, rn)\n        if (typeof value.size === 'number') {\n          length += chunk.byteLength + value.size + rn.byteLength\n        } else {\n          hasUnknownSizeValue = true\n        }\n      }\n    }\n\n    // CRLF is appended to the body to function with legacy servers and match other implementations.\n    // https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030\n    // https://github.com/form-data/form-data/issues/63\n    const chunk = textEncoder.encode(`--${boundary}--\\r\\n`)\n    blobParts.push(chunk)\n    length += chunk.byteLength\n    if (hasUnknownSizeValue) {\n      length = null\n    }\n\n    // Set source to object.\n    source = object\n\n    action = async function * () {\n      for (const part of blobParts) {\n        if (part.stream) {\n          yield * part.stream()\n        } else {\n          yield part\n        }\n      }\n    }\n\n    // Set type to `multipart/form-data; boundary=`,\n    // followed by the multipart/form-data boundary string generated\n    // by the multipart/form-data encoding algorithm.\n    type = `multipart/form-data; boundary=${boundary}`\n  } else if (isBlobLike(object)) {\n    // Blob\n\n    // Set source to object.\n    source = object\n\n    // Set length to object’s size.\n    length = object.size\n\n    // If object’s type attribute is not the empty byte sequence, set\n    // type to its value.\n    if (object.type) {\n      type = object.type\n    }\n  } else if (typeof object[Symbol.asyncIterator] === 'function') {\n    // If keepalive is true, then throw a TypeError.\n    if (keepalive) {\n      throw new TypeError('keepalive')\n    }\n\n    // If object is disturbed or locked, then throw a TypeError.\n    if (util.isDisturbed(object) || object.locked) {\n      throw new TypeError(\n        'Response body object should not be disturbed or locked'\n      )\n    }\n\n    stream =\n      object instanceof ReadableStream ? object : ReadableStreamFrom(object)\n  }\n\n  // 11. If source is a byte sequence, then set action to a\n  // step that returns source and length to source’s length.\n  if (typeof source === 'string' || util.isBuffer(source)) {\n    length = Buffer.byteLength(source)\n  }\n\n  // 12. If action is non-null, then run these steps in in parallel:\n  if (action != null) {\n    // Run action.\n    let iterator\n    stream = new ReadableStream({\n      async start () {\n        iterator = action(object)[Symbol.asyncIterator]()\n      },\n      async pull (controller) {\n        const { value, done } = await iterator.next()\n        if (done) {\n          // When running action is done, close stream.\n          queueMicrotask(() => {\n            controller.close()\n            controller.byobRequest?.respond(0)\n          })\n        } else {\n          // Whenever one or more bytes are available and stream is not errored,\n          // enqueue a Uint8Array wrapping an ArrayBuffer containing the available\n          // bytes into stream.\n          if (!isErrored(stream)) {\n            const buffer = new Uint8Array(value)\n            if (buffer.byteLength) {\n              controller.enqueue(buffer)\n            }\n          }\n        }\n        return controller.desiredSize > 0\n      },\n      async cancel (reason) {\n        await iterator.return()\n      },\n      type: 'bytes'\n    })\n  }\n\n  // 13. Let body be a body whose stream is stream, source is source,\n  // and length is length.\n  const body = { stream, source, length }\n\n  // 14. Return (body, type).\n  return [body, type]\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit-safely-extract\nfunction safelyExtractBody (object, keepalive = false) {\n  // To safely extract a body and a `Content-Type` value from\n  // a byte sequence or BodyInit object object, run these steps:\n\n  // 1. If object is a ReadableStream object, then:\n  if (object instanceof ReadableStream) {\n    // Assert: object is neither disturbed nor locked.\n    // istanbul ignore next\n    assert(!util.isDisturbed(object), 'The body has already been consumed.')\n    // istanbul ignore next\n    assert(!object.locked, 'The stream is locked.')\n  }\n\n  // 2. Return the results of extracting object.\n  return extractBody(object, keepalive)\n}\n\nfunction cloneBody (instance, body) {\n  // To clone a body body, run these steps:\n\n  // https://fetch.spec.whatwg.org/#concept-body-clone\n\n  // 1. Let « out1, out2 » be the result of teeing body’s stream.\n  const [out1, out2] = body.stream.tee()\n\n  // 2. Set body’s stream to out1.\n  body.stream = out1\n\n  // 3. Return a body whose stream is out2 and other members are copied from body.\n  return {\n    stream: out2,\n    length: body.length,\n    source: body.source\n  }\n}\n\nfunction throwIfAborted (state) {\n  if (state.aborted) {\n    throw new DOMException('The operation was aborted.', 'AbortError')\n  }\n}\n\nfunction bodyMixinMethods (instance) {\n  const methods = {\n    blob () {\n      // The blob() method steps are to return the result of\n      // running consume body with this and the following step\n      // given a byte sequence bytes: return a Blob whose\n      // contents are bytes and whose type attribute is this’s\n      // MIME type.\n      return consumeBody(this, (bytes) => {\n        let mimeType = bodyMimeType(this)\n\n        if (mimeType === null) {\n          mimeType = ''\n        } else if (mimeType) {\n          mimeType = serializeAMimeType(mimeType)\n        }\n\n        // Return a Blob whose contents are bytes and type attribute\n        // is mimeType.\n        return new Blob([bytes], { type: mimeType })\n      }, instance)\n    },\n\n    arrayBuffer () {\n      // The arrayBuffer() method steps are to return the result\n      // of running consume body with this and the following step\n      // given a byte sequence bytes: return a new ArrayBuffer\n      // whose contents are bytes.\n      return consumeBody(this, (bytes) => {\n        return new Uint8Array(bytes).buffer\n      }, instance)\n    },\n\n    text () {\n      // The text() method steps are to return the result of running\n      // consume body with this and UTF-8 decode.\n      return consumeBody(this, utf8DecodeBytes, instance)\n    },\n\n    json () {\n      // The json() method steps are to return the result of running\n      // consume body with this and parse JSON from bytes.\n      return consumeBody(this, parseJSONFromBytes, instance)\n    },\n\n    formData () {\n      // The formData() method steps are to return the result of running\n      // consume body with this and the following step given a byte sequence bytes:\n      return consumeBody(this, (value) => {\n        // 1. Let mimeType be the result of get the MIME type with this.\n        const mimeType = bodyMimeType(this)\n\n        // 2. If mimeType is non-null, then switch on mimeType’s essence and run\n        //    the corresponding steps:\n        if (mimeType !== null) {\n          switch (mimeType.essence) {\n            case 'multipart/form-data': {\n              // 1. ... [long step]\n              const parsed = multipartFormDataParser(value, mimeType)\n\n              // 2. If that fails for some reason, then throw a TypeError.\n              if (parsed === 'failure') {\n                throw new TypeError('Failed to parse body as FormData.')\n              }\n\n              // 3. Return a new FormData object, appending each entry,\n              //    resulting from the parsing operation, to its entry list.\n              const fd = new FormData()\n              fd[kState] = parsed\n\n              return fd\n            }\n            case 'application/x-www-form-urlencoded': {\n              // 1. Let entries be the result of parsing bytes.\n              const entries = new URLSearchParams(value.toString())\n\n              // 2. If entries is failure, then throw a TypeError.\n\n              // 3. Return a new FormData object whose entry list is entries.\n              const fd = new FormData()\n\n              for (const [name, value] of entries) {\n                fd.append(name, value)\n              }\n\n              return fd\n            }\n          }\n        }\n\n        // 3. Throw a TypeError.\n        throw new TypeError(\n          'Content-Type was not one of \"multipart/form-data\" or \"application/x-www-form-urlencoded\".'\n        )\n      }, instance)\n    },\n\n    bytes () {\n      // The bytes() method steps are to return the result of running consume body\n      // with this and the following step given a byte sequence bytes: return the\n      // result of creating a Uint8Array from bytes in this’s relevant realm.\n      return consumeBody(this, (bytes) => {\n        return new Uint8Array(bytes)\n      }, instance)\n    }\n  }\n\n  return methods\n}\n\nfunction mixinBody (prototype) {\n  Object.assign(prototype.prototype, bodyMixinMethods(prototype))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-consume-body\n * @param {Response|Request} object\n * @param {(value: unknown) => unknown} convertBytesToJSValue\n * @param {Response|Request} instance\n */\nasync function consumeBody (object, convertBytesToJSValue, instance) {\n  webidl.brandCheck(object, instance)\n\n  // 1. If object is unusable, then return a promise rejected\n  //    with a TypeError.\n  if (bodyUnusable(object)) {\n    throw new TypeError('Body is unusable: Body has already been read')\n  }\n\n  throwIfAborted(object[kState])\n\n  // 2. Let promise be a new promise.\n  const promise = createDeferredPromise()\n\n  // 3. Let errorSteps given error be to reject promise with error.\n  const errorSteps = (error) => promise.reject(error)\n\n  // 4. Let successSteps given a byte sequence data be to resolve\n  //    promise with the result of running convertBytesToJSValue\n  //    with data. If that threw an exception, then run errorSteps\n  //    with that exception.\n  const successSteps = (data) => {\n    try {\n      promise.resolve(convertBytesToJSValue(data))\n    } catch (e) {\n      errorSteps(e)\n    }\n  }\n\n  // 5. If object’s body is null, then run successSteps with an\n  //    empty byte sequence.\n  if (object[kState].body == null) {\n    successSteps(Buffer.allocUnsafe(0))\n    return promise.promise\n  }\n\n  // 6. Otherwise, fully read object’s body given successSteps,\n  //    errorSteps, and object’s relevant global object.\n  await fullyReadBody(object[kState].body, successSteps, errorSteps)\n\n  // 7. Return promise.\n  return promise.promise\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction bodyUnusable (object) {\n  const body = object[kState].body\n\n  // An object including the Body interface mixin is\n  // said to be unusable if its body is non-null and\n  // its body’s stream is disturbed or locked.\n  return body != null && (body.stream.locked || util.isDisturbed(body.stream))\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value\n * @param {Uint8Array} bytes\n */\nfunction parseJSONFromBytes (bytes) {\n  return JSON.parse(utf8DecodeBytes(bytes))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-mime-type\n * @param {import('./response').Response|import('./request').Request} requestOrResponse\n */\nfunction bodyMimeType (requestOrResponse) {\n  // 1. Let headers be null.\n  // 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.\n  // 3. Otherwise, set headers to requestOrResponse’s response’s header list.\n  /** @type {import('./headers').HeadersList} */\n  const headers = requestOrResponse[kState].headersList\n\n  // 4. Let mimeType be the result of extracting a MIME type from headers.\n  const mimeType = extractMimeType(headers)\n\n  // 5. If mimeType is failure, then return null.\n  if (mimeType === 'failure') {\n    return null\n  }\n\n  // 6. Return mimeType.\n  return mimeType\n}\n\nmodule.exports = {\n  extractBody,\n  safelyExtractBody,\n  cloneBody,\n  mixinBody,\n  streamRegistry,\n  hasFinalizationRegistry,\n  bodyUnusable\n}\n","'use strict'\n\nconst corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])\n\nconst redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])\nconst redirectStatusSet = new Set(redirectStatus)\n\n/**\n * @see https://fetch.spec.whatwg.org/#block-bad-port\n */\nconst badPorts = /** @type {const} */ ([\n  '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n  '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n  '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n  '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n  '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',\n  '6697', '10080'\n])\nconst badPortsSet = new Set(badPorts)\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\n */\nconst referrerPolicy = /** @type {const} */ ([\n  '',\n  'no-referrer',\n  'no-referrer-when-downgrade',\n  'same-origin',\n  'origin',\n  'strict-origin',\n  'origin-when-cross-origin',\n  'strict-origin-when-cross-origin',\n  'unsafe-url'\n])\nconst referrerPolicySet = new Set(referrerPolicy)\n\nconst requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])\n\nconst safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])\n\nconst requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])\n\nconst requestCache = /** @type {const} */ ([\n  'default',\n  'no-store',\n  'reload',\n  'no-cache',\n  'force-cache',\n  'only-if-cached'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-body-header-name\n */\nconst requestBodyHeader = /** @type {const} */ ([\n  'content-encoding',\n  'content-language',\n  'content-location',\n  'content-type',\n  // See https://github.com/nodejs/undici/issues/2021\n  // 'Content-Length' is a forbidden header name, which is typically\n  // removed in the Headers implementation. However, undici doesn't\n  // filter out headers, so we add it here.\n  'content-length'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex\n */\nconst requestDuplex = /** @type {const} */ ([\n  'half'\n])\n\n/**\n * @see http://fetch.spec.whatwg.org/#forbidden-method\n */\nconst forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = /** @type {const} */ ([\n  'audio',\n  'audioworklet',\n  'font',\n  'image',\n  'manifest',\n  'paintworklet',\n  'script',\n  'style',\n  'track',\n  'video',\n  'xslt',\n  ''\n])\nconst subresourceSet = new Set(subresource)\n\nmodule.exports = {\n  subresource,\n  forbiddenMethods,\n  requestBodyHeader,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  redirectStatus,\n  corsSafeListedMethods,\n  nullBodyStatus,\n  safeMethods,\n  badPorts,\n  requestDuplex,\n  subresourceSet,\n  badPortsSet,\n  redirectStatusSet,\n  corsSafeListedMethodsSet,\n  safeMethodsSet,\n  forbiddenMethodsSet,\n  referrerPolicySet\n}\n","'use strict'\n\nconst assert = require('node:assert')\n\nconst encoder = new TextEncoder()\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-token-code-point\n */\nconst HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\\-.^_|~A-Za-z0-9]+$/\nconst HTTP_WHITESPACE_REGEX = /[\\u000A\\u000D\\u0009\\u0020]/ // eslint-disable-line\nconst ASCII_WHITESPACE_REPLACE_REGEX = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/g // eslint-disable-line\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point\n */\nconst HTTP_QUOTED_STRING_TOKENS = /^[\\u0009\\u0020-\\u007E\\u0080-\\u00FF]+$/ // eslint-disable-line\n\n// https://fetch.spec.whatwg.org/#data-url-processor\n/** @param {URL} dataURL */\nfunction dataURLProcessor (dataURL) {\n  // 1. Assert: dataURL’s scheme is \"data\".\n  assert(dataURL.protocol === 'data:')\n\n  // 2. Let input be the result of running the URL\n  // serializer on dataURL with exclude fragment\n  // set to true.\n  let input = URLSerializer(dataURL, true)\n\n  // 3. Remove the leading \"data:\" string from input.\n  input = input.slice(5)\n\n  // 4. Let position point at the start of input.\n  const position = { position: 0 }\n\n  // 5. Let mimeType be the result of collecting a\n  // sequence of code points that are not equal\n  // to U+002C (,), given position.\n  let mimeType = collectASequenceOfCodePointsFast(\n    ',',\n    input,\n    position\n  )\n\n  // 6. Strip leading and trailing ASCII whitespace\n  // from mimeType.\n  // Undici implementation note: we need to store the\n  // length because if the mimetype has spaces removed,\n  // the wrong amount will be sliced from the input in\n  // step #9\n  const mimeTypeLength = mimeType.length\n  mimeType = removeASCIIWhitespace(mimeType, true, true)\n\n  // 7. If position is past the end of input, then\n  // return failure\n  if (position.position >= input.length) {\n    return 'failure'\n  }\n\n  // 8. Advance position by 1.\n  position.position++\n\n  // 9. Let encodedBody be the remainder of input.\n  const encodedBody = input.slice(mimeTypeLength + 1)\n\n  // 10. Let body be the percent-decoding of encodedBody.\n  let body = stringPercentDecode(encodedBody)\n\n  // 11. If mimeType ends with U+003B (;), followed by\n  // zero or more U+0020 SPACE, followed by an ASCII\n  // case-insensitive match for \"base64\", then:\n  if (/;(\\u0020){0,}base64$/i.test(mimeType)) {\n    // 1. Let stringBody be the isomorphic decode of body.\n    const stringBody = isomorphicDecode(body)\n\n    // 2. Set body to the forgiving-base64 decode of\n    // stringBody.\n    body = forgivingBase64(stringBody)\n\n    // 3. If body is failure, then return failure.\n    if (body === 'failure') {\n      return 'failure'\n    }\n\n    // 4. Remove the last 6 code points from mimeType.\n    mimeType = mimeType.slice(0, -6)\n\n    // 5. Remove trailing U+0020 SPACE code points from mimeType,\n    // if any.\n    mimeType = mimeType.replace(/(\\u0020)+$/, '')\n\n    // 6. Remove the last U+003B (;) code point from mimeType.\n    mimeType = mimeType.slice(0, -1)\n  }\n\n  // 12. If mimeType starts with U+003B (;), then prepend\n  // \"text/plain\" to mimeType.\n  if (mimeType.startsWith(';')) {\n    mimeType = 'text/plain' + mimeType\n  }\n\n  // 13. Let mimeTypeRecord be the result of parsing\n  // mimeType.\n  let mimeTypeRecord = parseMIMEType(mimeType)\n\n  // 14. If mimeTypeRecord is failure, then set\n  // mimeTypeRecord to text/plain;charset=US-ASCII.\n  if (mimeTypeRecord === 'failure') {\n    mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')\n  }\n\n  // 15. Return a new data: URL struct whose MIME\n  // type is mimeTypeRecord and body is body.\n  // https://fetch.spec.whatwg.org/#data-url-struct\n  return { mimeType: mimeTypeRecord, body }\n}\n\n// https://url.spec.whatwg.org/#concept-url-serializer\n/**\n * @param {URL} url\n * @param {boolean} excludeFragment\n */\nfunction URLSerializer (url, excludeFragment = false) {\n  if (!excludeFragment) {\n    return url.href\n  }\n\n  const href = url.href\n  const hashLength = url.hash.length\n\n  const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength)\n\n  if (!hashLength && href.endsWith('#')) {\n    return serialized.slice(0, -1)\n  }\n\n  return serialized\n}\n\n// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n/**\n * @param {(char: string) => boolean} condition\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePoints (condition, input, position) {\n  // 1. Let result be the empty string.\n  let result = ''\n\n  // 2. While position doesn’t point past the end of input and the\n  // code point at position within input meets the condition condition:\n  while (position.position < input.length && condition(input[position.position])) {\n    // 1. Append that code point to the end of result.\n    result += input[position.position]\n\n    // 2. Advance position by 1.\n    position.position++\n  }\n\n  // 3. Return result.\n  return result\n}\n\n/**\n * A faster collectASequenceOfCodePoints that only works when comparing a single character.\n * @param {string} char\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePointsFast (char, input, position) {\n  const idx = input.indexOf(char, position.position)\n  const start = position.position\n\n  if (idx === -1) {\n    position.position = input.length\n    return input.slice(start)\n  }\n\n  position.position = idx\n  return input.slice(start, position.position)\n}\n\n// https://url.spec.whatwg.org/#string-percent-decode\n/** @param {string} input */\nfunction stringPercentDecode (input) {\n  // 1. Let bytes be the UTF-8 encoding of input.\n  const bytes = encoder.encode(input)\n\n  // 2. Return the percent-decoding of bytes.\n  return percentDecode(bytes)\n}\n\n/**\n * @param {number} byte\n */\nfunction isHexCharByte (byte) {\n  // 0-9 A-F a-f\n  return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66)\n}\n\n/**\n * @param {number} byte\n */\nfunction hexByteToNumber (byte) {\n  return (\n    // 0-9\n    byte >= 0x30 && byte <= 0x39\n      ? (byte - 48)\n    // Convert to uppercase\n    // ((byte & 0xDF) - 65) + 10\n      : ((byte & 0xDF) - 55)\n  )\n}\n\n// https://url.spec.whatwg.org/#percent-decode\n/** @param {Uint8Array} input */\nfunction percentDecode (input) {\n  const length = input.length\n  // 1. Let output be an empty byte sequence.\n  /** @type {Uint8Array} */\n  const output = new Uint8Array(length)\n  let j = 0\n  // 2. For each byte byte in input:\n  for (let i = 0; i < length; ++i) {\n    const byte = input[i]\n\n    // 1. If byte is not 0x25 (%), then append byte to output.\n    if (byte !== 0x25) {\n      output[j++] = byte\n\n    // 2. Otherwise, if byte is 0x25 (%) and the next two bytes\n    // after byte in input are not in the ranges\n    // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),\n    // and 0x61 (a) to 0x66 (f), all inclusive, append byte\n    // to output.\n    } else if (\n      byte === 0x25 &&\n      !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))\n    ) {\n      output[j++] = 0x25\n\n    // 3. Otherwise:\n    } else {\n      // 1. Let bytePoint be the two bytes after byte in input,\n      // decoded, and then interpreted as hexadecimal number.\n      // 2. Append a byte whose value is bytePoint to output.\n      output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2])\n\n      // 3. Skip the next two bytes in input.\n      i += 2\n    }\n  }\n\n  // 3. Return output.\n  return length === j ? output : output.subarray(0, j)\n}\n\n// https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n/** @param {string} input */\nfunction parseMIMEType (input) {\n  // 1. Remove any leading and trailing HTTP whitespace\n  // from input.\n  input = removeHTTPWhitespace(input, true, true)\n\n  // 2. Let position be a position variable for input,\n  // initially pointing at the start of input.\n  const position = { position: 0 }\n\n  // 3. Let type be the result of collecting a sequence\n  // of code points that are not U+002F (/) from\n  // input, given position.\n  const type = collectASequenceOfCodePointsFast(\n    '/',\n    input,\n    position\n  )\n\n  // 4. If type is the empty string or does not solely\n  // contain HTTP token code points, then return failure.\n  // https://mimesniff.spec.whatwg.org/#http-token-code-point\n  if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n    return 'failure'\n  }\n\n  // 5. If position is past the end of input, then return\n  // failure\n  if (position.position > input.length) {\n    return 'failure'\n  }\n\n  // 6. Advance position by 1. (This skips past U+002F (/).)\n  position.position++\n\n  // 7. Let subtype be the result of collecting a sequence of\n  // code points that are not U+003B (;) from input, given\n  // position.\n  let subtype = collectASequenceOfCodePointsFast(\n    ';',\n    input,\n    position\n  )\n\n  // 8. Remove any trailing HTTP whitespace from subtype.\n  subtype = removeHTTPWhitespace(subtype, false, true)\n\n  // 9. If subtype is the empty string or does not solely\n  // contain HTTP token code points, then return failure.\n  if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n    return 'failure'\n  }\n\n  const typeLowercase = type.toLowerCase()\n  const subtypeLowercase = subtype.toLowerCase()\n\n  // 10. Let mimeType be a new MIME type record whose type\n  // is type, in ASCII lowercase, and subtype is subtype,\n  // in ASCII lowercase.\n  // https://mimesniff.spec.whatwg.org/#mime-type\n  const mimeType = {\n    type: typeLowercase,\n    subtype: subtypeLowercase,\n    /** @type {Map} */\n    parameters: new Map(),\n    // https://mimesniff.spec.whatwg.org/#mime-type-essence\n    essence: `${typeLowercase}/${subtypeLowercase}`\n  }\n\n  // 11. While position is not past the end of input:\n  while (position.position < input.length) {\n    // 1. Advance position by 1. (This skips past U+003B (;).)\n    position.position++\n\n    // 2. Collect a sequence of code points that are HTTP\n    // whitespace from input given position.\n    collectASequenceOfCodePoints(\n      // https://fetch.spec.whatwg.org/#http-whitespace\n      char => HTTP_WHITESPACE_REGEX.test(char),\n      input,\n      position\n    )\n\n    // 3. Let parameterName be the result of collecting a\n    // sequence of code points that are not U+003B (;)\n    // or U+003D (=) from input, given position.\n    let parameterName = collectASequenceOfCodePoints(\n      (char) => char !== ';' && char !== '=',\n      input,\n      position\n    )\n\n    // 4. Set parameterName to parameterName, in ASCII\n    // lowercase.\n    parameterName = parameterName.toLowerCase()\n\n    // 5. If position is not past the end of input, then:\n    if (position.position < input.length) {\n      // 1. If the code point at position within input is\n      // U+003B (;), then continue.\n      if (input[position.position] === ';') {\n        continue\n      }\n\n      // 2. Advance position by 1. (This skips past U+003D (=).)\n      position.position++\n    }\n\n    // 6. If position is past the end of input, then break.\n    if (position.position > input.length) {\n      break\n    }\n\n    // 7. Let parameterValue be null.\n    let parameterValue = null\n\n    // 8. If the code point at position within input is\n    // U+0022 (\"), then:\n    if (input[position.position] === '\"') {\n      // 1. Set parameterValue to the result of collecting\n      // an HTTP quoted string from input, given position\n      // and the extract-value flag.\n      parameterValue = collectAnHTTPQuotedString(input, position, true)\n\n      // 2. Collect a sequence of code points that are not\n      // U+003B (;) from input, given position.\n      collectASequenceOfCodePointsFast(\n        ';',\n        input,\n        position\n      )\n\n    // 9. Otherwise:\n    } else {\n      // 1. Set parameterValue to the result of collecting\n      // a sequence of code points that are not U+003B (;)\n      // from input, given position.\n      parameterValue = collectASequenceOfCodePointsFast(\n        ';',\n        input,\n        position\n      )\n\n      // 2. Remove any trailing HTTP whitespace from parameterValue.\n      parameterValue = removeHTTPWhitespace(parameterValue, false, true)\n\n      // 3. If parameterValue is the empty string, then continue.\n      if (parameterValue.length === 0) {\n        continue\n      }\n    }\n\n    // 10. If all of the following are true\n    // - parameterName is not the empty string\n    // - parameterName solely contains HTTP token code points\n    // - parameterValue solely contains HTTP quoted-string token code points\n    // - mimeType’s parameters[parameterName] does not exist\n    // then set mimeType’s parameters[parameterName] to parameterValue.\n    if (\n      parameterName.length !== 0 &&\n      HTTP_TOKEN_CODEPOINTS.test(parameterName) &&\n      (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&\n      !mimeType.parameters.has(parameterName)\n    ) {\n      mimeType.parameters.set(parameterName, parameterValue)\n    }\n  }\n\n  // 12. Return mimeType.\n  return mimeType\n}\n\n// https://infra.spec.whatwg.org/#forgiving-base64-decode\n/** @param {string} data */\nfunction forgivingBase64 (data) {\n  // 1. Remove all ASCII whitespace from data.\n  data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '')  // eslint-disable-line\n\n  let dataLength = data.length\n  // 2. If data’s code point length divides by 4 leaving\n  // no remainder, then:\n  if (dataLength % 4 === 0) {\n    // 1. If data ends with one or two U+003D (=) code points,\n    // then remove them from data.\n    if (data.charCodeAt(dataLength - 1) === 0x003D) {\n      --dataLength\n      if (data.charCodeAt(dataLength - 1) === 0x003D) {\n        --dataLength\n      }\n    }\n  }\n\n  // 3. If data’s code point length divides by 4 leaving\n  // a remainder of 1, then return failure.\n  if (dataLength % 4 === 1) {\n    return 'failure'\n  }\n\n  // 4. If data contains a code point that is not one of\n  //  U+002B (+)\n  //  U+002F (/)\n  //  ASCII alphanumeric\n  // then return failure.\n  if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {\n    return 'failure'\n  }\n\n  const buffer = Buffer.from(data, 'base64')\n  return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\n// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string\n// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string\n/**\n * @param {string} input\n * @param {{ position: number }} position\n * @param {boolean?} extractValue\n */\nfunction collectAnHTTPQuotedString (input, position, extractValue) {\n  // 1. Let positionStart be position.\n  const positionStart = position.position\n\n  // 2. Let value be the empty string.\n  let value = ''\n\n  // 3. Assert: the code point at position within input\n  // is U+0022 (\").\n  assert(input[position.position] === '\"')\n\n  // 4. Advance position by 1.\n  position.position++\n\n  // 5. While true:\n  while (true) {\n    // 1. Append the result of collecting a sequence of code points\n    // that are not U+0022 (\") or U+005C (\\) from input, given\n    // position, to value.\n    value += collectASequenceOfCodePoints(\n      (char) => char !== '\"' && char !== '\\\\',\n      input,\n      position\n    )\n\n    // 2. If position is past the end of input, then break.\n    if (position.position >= input.length) {\n      break\n    }\n\n    // 3. Let quoteOrBackslash be the code point at position within\n    // input.\n    const quoteOrBackslash = input[position.position]\n\n    // 4. Advance position by 1.\n    position.position++\n\n    // 5. If quoteOrBackslash is U+005C (\\), then:\n    if (quoteOrBackslash === '\\\\') {\n      // 1. If position is past the end of input, then append\n      // U+005C (\\) to value and break.\n      if (position.position >= input.length) {\n        value += '\\\\'\n        break\n      }\n\n      // 2. Append the code point at position within input to value.\n      value += input[position.position]\n\n      // 3. Advance position by 1.\n      position.position++\n\n    // 6. Otherwise:\n    } else {\n      // 1. Assert: quoteOrBackslash is U+0022 (\").\n      assert(quoteOrBackslash === '\"')\n\n      // 2. Break.\n      break\n    }\n  }\n\n  // 6. If the extract-value flag is set, then return value.\n  if (extractValue) {\n    return value\n  }\n\n  // 7. Return the code points from positionStart to position,\n  // inclusive, within input.\n  return input.slice(positionStart, position.position)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serializeAMimeType (mimeType) {\n  assert(mimeType !== 'failure')\n  const { parameters, essence } = mimeType\n\n  // 1. Let serialization be the concatenation of mimeType’s\n  //    type, U+002F (/), and mimeType’s subtype.\n  let serialization = essence\n\n  // 2. For each name → value of mimeType’s parameters:\n  for (let [name, value] of parameters.entries()) {\n    // 1. Append U+003B (;) to serialization.\n    serialization += ';'\n\n    // 2. Append name to serialization.\n    serialization += name\n\n    // 3. Append U+003D (=) to serialization.\n    serialization += '='\n\n    // 4. If value does not solely contain HTTP token code\n    //    points or value is the empty string, then:\n    if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n      // 1. Precede each occurrence of U+0022 (\") or\n      //    U+005C (\\) in value with U+005C (\\).\n      value = value.replace(/(\\\\|\")/g, '\\\\$1')\n\n      // 2. Prepend U+0022 (\") to value.\n      value = '\"' + value\n\n      // 3. Append U+0022 (\") to value.\n      value += '\"'\n    }\n\n    // 5. Append value to serialization.\n    serialization += value\n  }\n\n  // 3. Return serialization.\n  return serialization\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {number} char\n */\nfunction isHTTPWhiteSpace (char) {\n  // \"\\r\\n\\t \"\n  return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeHTTPWhitespace (str, leading = true, trailing = true) {\n  return removeChars(str, leading, trailing, isHTTPWhiteSpace)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n * @param {number} char\n */\nfunction isASCIIWhitespace (char) {\n  // \"\\r\\n\\t\\f \"\n  return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x00c || char === 0x020\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeASCIIWhitespace (str, leading = true, trailing = true) {\n  return removeChars(str, leading, trailing, isASCIIWhitespace)\n}\n\n/**\n * @param {string} str\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns\n */\nfunction removeChars (str, leading, trailing, predicate) {\n  let lead = 0\n  let trail = str.length - 1\n\n  if (leading) {\n    while (lead < str.length && predicate(str.charCodeAt(lead))) lead++\n  }\n\n  if (trailing) {\n    while (trail > 0 && predicate(str.charCodeAt(trail))) trail--\n  }\n\n  return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-decode\n * @param {Uint8Array} input\n * @returns {string}\n */\nfunction isomorphicDecode (input) {\n  // 1. To isomorphic decode a byte sequence input, return a string whose code point\n  //    length is equal to input’s length and whose code points have the same values\n  //    as the values of input’s bytes, in the same order.\n  const length = input.length\n  if ((2 << 15) - 1 > length) {\n    return String.fromCharCode.apply(null, input)\n  }\n  let result = ''; let i = 0\n  let addition = (2 << 15) - 1\n  while (i < length) {\n    if (i + addition > length) {\n      addition = length - i\n    }\n    result += String.fromCharCode.apply(null, input.subarray(i, i += addition))\n  }\n  return result\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type\n * @param {Exclude, 'failure'>} mimeType\n */\nfunction minimizeSupportedMimeType (mimeType) {\n  switch (mimeType.essence) {\n    case 'application/ecmascript':\n    case 'application/javascript':\n    case 'application/x-ecmascript':\n    case 'application/x-javascript':\n    case 'text/ecmascript':\n    case 'text/javascript':\n    case 'text/javascript1.0':\n    case 'text/javascript1.1':\n    case 'text/javascript1.2':\n    case 'text/javascript1.3':\n    case 'text/javascript1.4':\n    case 'text/javascript1.5':\n    case 'text/jscript':\n    case 'text/livescript':\n    case 'text/x-ecmascript':\n    case 'text/x-javascript':\n      // 1. If mimeType is a JavaScript MIME type, then return \"text/javascript\".\n      return 'text/javascript'\n    case 'application/json':\n    case 'text/json':\n      // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n      return 'application/json'\n    case 'image/svg+xml':\n      // 3. If mimeType’s essence is \"image/svg+xml\", then return \"image/svg+xml\".\n      return 'image/svg+xml'\n    case 'text/xml':\n    case 'application/xml':\n      // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n      return 'application/xml'\n  }\n\n  // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n  if (mimeType.subtype.endsWith('+json')) {\n    return 'application/json'\n  }\n\n  // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n  if (mimeType.subtype.endsWith('+xml')) {\n    return 'application/xml'\n  }\n\n  // 5. If mimeType is supported by the user agent, then return mimeType’s essence.\n  // Technically, node doesn't support any mimetypes.\n\n  // 6. Return the empty string.\n  return ''\n}\n\nmodule.exports = {\n  dataURLProcessor,\n  URLSerializer,\n  collectASequenceOfCodePoints,\n  collectASequenceOfCodePointsFast,\n  stringPercentDecode,\n  parseMIMEType,\n  collectAnHTTPQuotedString,\n  serializeAMimeType,\n  removeChars,\n  removeHTTPWhitespace,\n  minimizeSupportedMimeType,\n  HTTP_TOKEN_CODEPOINTS,\n  isomorphicDecode\n}\n","'use strict'\n\nconst { kConnected, kSize } = require('../../core/symbols')\n\nclass CompatWeakRef {\n  constructor (value) {\n    this.value = value\n  }\n\n  deref () {\n    return this.value[kConnected] === 0 && this.value[kSize] === 0\n      ? undefined\n      : this.value\n  }\n}\n\nclass CompatFinalizer {\n  constructor (finalizer) {\n    this.finalizer = finalizer\n  }\n\n  register (dispatcher, key) {\n    if (dispatcher.on) {\n      dispatcher.on('disconnect', () => {\n        if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {\n          this.finalizer(key)\n        }\n      })\n    }\n  }\n\n  unregister (key) {}\n}\n\nmodule.exports = function () {\n  // FIXME: remove workaround when the Node bug is backported to v18\n  // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\n  if (process.env.NODE_V8_COVERAGE && process.version.startsWith('v18')) {\n    process._rawDebug('Using compatibility WeakRef and FinalizationRegistry')\n    return {\n      WeakRef: CompatWeakRef,\n      FinalizationRegistry: CompatFinalizer\n    }\n  }\n  return { WeakRef, FinalizationRegistry }\n}\n","'use strict'\n\nconst { Blob, File } = require('node:buffer')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\n\n// TODO(@KhafraDev): remove\nclass FileLike {\n  constructor (blobLike, fileName, options = {}) {\n    // TODO: argument idl type check\n\n    // The File constructor is invoked with two or three parameters, depending\n    // on whether the optional dictionary parameter is used. When the File()\n    // constructor is invoked, user agents must run the following steps:\n\n    // 1. Let bytes be the result of processing blob parts given fileBits and\n    // options.\n\n    // 2. Let n be the fileName argument to the constructor.\n    const n = fileName\n\n    // 3. Process FilePropertyBag dictionary argument by running the following\n    // substeps:\n\n    //    1. If the type member is provided and is not the empty string, let t\n    //    be set to the type dictionary member. If t contains any characters\n    //    outside the range U+0020 to U+007E, then set t to the empty string\n    //    and return from these substeps.\n    //    TODO\n    const t = options.type\n\n    //    2. Convert every character in t to ASCII lowercase.\n    //    TODO\n\n    //    3. If the lastModified member is provided, let d be set to the\n    //    lastModified dictionary member. If it is not provided, set d to the\n    //    current date and time represented as the number of milliseconds since\n    //    the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n    const d = options.lastModified ?? Date.now()\n\n    // 4. Return a new File object F such that:\n    // F refers to the bytes byte sequence.\n    // F.size is set to the number of total bytes in bytes.\n    // F.name is set to n.\n    // F.type is set to t.\n    // F.lastModified is set to d.\n\n    this[kState] = {\n      blobLike,\n      name: n,\n      type: t,\n      lastModified: d\n    }\n  }\n\n  stream (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.stream(...args)\n  }\n\n  arrayBuffer (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.arrayBuffer(...args)\n  }\n\n  slice (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.slice(...args)\n  }\n\n  text (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.text(...args)\n  }\n\n  get size () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.size\n  }\n\n  get type () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.type\n  }\n\n  get name () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].name\n  }\n\n  get lastModified () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].lastModified\n  }\n\n  get [Symbol.toStringTag] () {\n    return 'File'\n  }\n}\n\nwebidl.converters.Blob = webidl.interfaceConverter(Blob)\n\n// If this function is moved to ./util.js, some tools (such as\n// rollup) will warn about circular dependencies. See:\n// https://github.com/nodejs/undici/issues/1629\nfunction isFileLike (object) {\n  return (\n    (object instanceof File) ||\n    (\n      object &&\n      (typeof object.stream === 'function' ||\n      typeof object.arrayBuffer === 'function') &&\n      object[Symbol.toStringTag] === 'File'\n    )\n  )\n}\n\nmodule.exports = { FileLike, isFileLike }\n","'use strict'\n\nconst { isUSVString, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { utf8DecodeBytes } = require('./util')\nconst { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require('./data-url')\nconst { isFileLike } = require('./file')\nconst { makeEntry } = require('./formdata')\nconst assert = require('node:assert')\nconst { File: NodeFile } = require('node:buffer')\n\nconst File = globalThis.File ?? NodeFile\n\nconst formDataNameBuffer = Buffer.from('form-data; name=\"')\nconst filenameBuffer = Buffer.from('; filename')\nconst dd = Buffer.from('--')\nconst ddcrlf = Buffer.from('--\\r\\n')\n\n/**\n * @param {string} chars\n */\nfunction isAsciiString (chars) {\n  for (let i = 0; i < chars.length; ++i) {\n    if ((chars.charCodeAt(i) & ~0x7F) !== 0) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary\n * @param {string} boundary\n */\nfunction validateBoundary (boundary) {\n  const length = boundary.length\n\n  // - its length is greater or equal to 27 and lesser or equal to 70, and\n  if (length < 27 || length > 70) {\n    return false\n  }\n\n  // - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or\n  //   0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),\n  //   0x2D (-) or 0x5F (_).\n  for (let i = 0; i < length; ++i) {\n    const cp = boundary.charCodeAt(i)\n\n    if (!(\n      (cp >= 0x30 && cp <= 0x39) ||\n      (cp >= 0x41 && cp <= 0x5a) ||\n      (cp >= 0x61 && cp <= 0x7a) ||\n      cp === 0x27 ||\n      cp === 0x2d ||\n      cp === 0x5f\n    )) {\n      return false\n    }\n  }\n\n  return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser\n * @param {Buffer} input\n * @param {ReturnType} mimeType\n */\nfunction multipartFormDataParser (input, mimeType) {\n  // 1. Assert: mimeType’s essence is \"multipart/form-data\".\n  assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')\n\n  const boundaryString = mimeType.parameters.get('boundary')\n\n  // 2. If mimeType’s parameters[\"boundary\"] does not exist, return failure.\n  //    Otherwise, let boundary be the result of UTF-8 decoding mimeType’s\n  //    parameters[\"boundary\"].\n  if (boundaryString === undefined) {\n    return 'failure'\n  }\n\n  const boundary = Buffer.from(`--${boundaryString}`, 'utf8')\n\n  // 3. Let entry list be an empty entry list.\n  const entryList = []\n\n  // 4. Let position be a pointer to a byte in input, initially pointing at\n  //    the first byte.\n  const position = { position: 0 }\n\n  // Note: undici addition, allows leading and trailing CRLFs.\n  while (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n    position.position += 2\n  }\n\n  let trailing = input.length\n\n  while (input[trailing - 1] === 0x0a && input[trailing - 2] === 0x0d) {\n    trailing -= 2\n  }\n\n  if (trailing !== input.length) {\n    input = input.subarray(0, trailing)\n  }\n\n  // 5. While true:\n  while (true) {\n    // 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D\n    //      (`--`) followed by boundary, advance position by 2 + the length of\n    //      boundary. Otherwise, return failure.\n    // Note: boundary is padded with 2 dashes already, no need to add 2.\n    if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {\n      position.position += boundary.length\n    } else {\n      return 'failure'\n    }\n\n    // 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A\n    //      (`--` followed by CR LF) followed by the end of input, return entry list.\n    // Note: a body does NOT need to end with CRLF. It can end with --.\n    if (\n      (position.position === input.length - 2 && bufferStartsWith(input, dd, position)) ||\n      (position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position))\n    ) {\n      return entryList\n    }\n\n    // 5.3. If position does not point to a sequence of bytes starting with 0x0D\n    //      0x0A (CR LF), return failure.\n    if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    }\n\n    // 5.4. Advance position by 2. (This skips past the newline.)\n    position.position += 2\n\n    // 5.5. Let name, filename and contentType be the result of parsing\n    //      multipart/form-data headers on input and position, if the result\n    //      is not failure. Otherwise, return failure.\n    const result = parseMultipartFormDataHeaders(input, position)\n\n    if (result === 'failure') {\n      return 'failure'\n    }\n\n    let { name, filename, contentType, encoding } = result\n\n    // 5.6. Advance position by 2. (This skips past the empty line that marks\n    //      the end of the headers.)\n    position.position += 2\n\n    // 5.7. Let body be the empty byte sequence.\n    let body\n\n    // 5.8. Body loop: While position is not past the end of input:\n    // TODO: the steps here are completely wrong\n    {\n      const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)\n\n      if (boundaryIndex === -1) {\n        return 'failure'\n      }\n\n      body = input.subarray(position.position, boundaryIndex - 4)\n\n      position.position += body.length\n\n      // Note: position must be advanced by the body's length before being\n      // decoded, otherwise the parsing will fail.\n      if (encoding === 'base64') {\n        body = Buffer.from(body.toString(), 'base64')\n      }\n    }\n\n    // 5.9. If position does not point to a sequence of bytes starting with\n    //      0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.\n    if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    } else {\n      position.position += 2\n    }\n\n    // 5.10. If filename is not null:\n    let value\n\n    if (filename !== null) {\n      // 5.10.1. If contentType is null, set contentType to \"text/plain\".\n      contentType ??= 'text/plain'\n\n      // 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.\n\n      // Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.\n      // Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.\n      if (!isAsciiString(contentType)) {\n        contentType = ''\n      }\n\n      // 5.10.3. Let value be a new File object with name filename, type contentType, and body body.\n      value = new File([body], filename, { type: contentType })\n    } else {\n      // 5.11. Otherwise:\n\n      // 5.11.1. Let value be the UTF-8 decoding without BOM of body.\n      value = utf8DecodeBytes(Buffer.from(body))\n    }\n\n    // 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.\n    assert(isUSVString(name))\n    assert((typeof value === 'string' && isUSVString(value)) || isFileLike(value))\n\n    // 5.13. Create an entry with name and value, and append it to entry list.\n    entryList.push(makeEntry(name, value, filename))\n  }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataHeaders (input, position) {\n  // 1. Let name, filename and contentType be null.\n  let name = null\n  let filename = null\n  let contentType = null\n  let encoding = null\n\n  // 2. While true:\n  while (true) {\n    // 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):\n    if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n      // 2.1.1. If name is null, return failure.\n      if (name === null) {\n        return 'failure'\n      }\n\n      // 2.1.2. Return name, filename and contentType.\n      return { name, filename, contentType, encoding }\n    }\n\n    // 2.2. Let header name be the result of collecting a sequence of bytes that are\n    //      not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.\n    let headerName = collectASequenceOfBytes(\n      (char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,\n      input,\n      position\n    )\n\n    // 2.3. Remove any HTTP tab or space bytes from the start or end of header name.\n    headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)\n\n    // 2.4. If header name does not match the field-name token production, return failure.\n    if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {\n      return 'failure'\n    }\n\n    // 2.5. If the byte at position is not 0x3A (:), return failure.\n    if (input[position.position] !== 0x3a) {\n      return 'failure'\n    }\n\n    // 2.6. Advance position by 1.\n    position.position++\n\n    // 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.\n    //      (Do nothing with those bytes.)\n    collectASequenceOfBytes(\n      (char) => char === 0x20 || char === 0x09,\n      input,\n      position\n    )\n\n    // 2.8. Byte-lowercase header name and switch on the result:\n    switch (bufferToLowerCasedHeaderName(headerName)) {\n      case 'content-disposition': {\n        // 1. Set name and filename to null.\n        name = filename = null\n\n        // 2. If position does not point to a sequence of bytes starting with\n        //    `form-data; name=\"`, return failure.\n        if (!bufferStartsWith(input, formDataNameBuffer, position)) {\n          return 'failure'\n        }\n\n        // 3. Advance position so it points at the byte after the next 0x22 (\")\n        //    byte (the one in the sequence of bytes matched above).\n        position.position += 17\n\n        // 4. Set name to the result of parsing a multipart/form-data name given\n        //    input and position, if the result is not failure. Otherwise, return\n        //    failure.\n        name = parseMultipartFormDataName(input, position)\n\n        if (name === null) {\n          return 'failure'\n        }\n\n        // 5. If position points to a sequence of bytes starting with `; filename=\"`:\n        if (bufferStartsWith(input, filenameBuffer, position)) {\n          // Note: undici also handles filename*\n          let check = position.position + filenameBuffer.length\n\n          if (input[check] === 0x2a) {\n            position.position += 1\n            check += 1\n          }\n\n          if (input[check] !== 0x3d || input[check + 1] !== 0x22) { // =\"\n            return 'failure'\n          }\n\n          // 1. Advance position so it points at the byte after the next 0x22 (\") byte\n          //    (the one in the sequence of bytes matched above).\n          position.position += 12\n\n          // 2. Set filename to the result of parsing a multipart/form-data name given\n          //    input and position, if the result is not failure. Otherwise, return failure.\n          filename = parseMultipartFormDataName(input, position)\n\n          if (filename === null) {\n            return 'failure'\n          }\n        }\n\n        break\n      }\n      case 'content-type': {\n        // 1. Let header value be the result of collecting a sequence of bytes that are\n        //    not 0x0A (LF) or 0x0D (CR), given position.\n        let headerValue = collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n\n        // 2. Remove any HTTP tab or space bytes from the end of header value.\n        headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n        // 3. Set contentType to the isomorphic decoding of header value.\n        contentType = isomorphicDecode(headerValue)\n\n        break\n      }\n      case 'content-transfer-encoding': {\n        let headerValue = collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n\n        headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n        encoding = isomorphicDecode(headerValue)\n\n        break\n      }\n      default: {\n        // Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.\n        // (Do nothing with those bytes.)\n        collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n      }\n    }\n\n    // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A\n    //      (CR LF), return failure. Otherwise, advance position by 2 (past the newline).\n    if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    } else {\n      position.position += 2\n    }\n  }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-a-multipart-form-data-name\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataName (input, position) {\n  // 1. Assert: The byte at (position - 1) is 0x22 (\").\n  assert(input[position.position - 1] === 0x22)\n\n  // 2. Let name be the result of collecting a sequence of bytes that are not 0x0A (LF), 0x0D (CR) or 0x22 (\"), given position.\n  /** @type {string | Buffer} */\n  let name = collectASequenceOfBytes(\n    (char) => char !== 0x0a && char !== 0x0d && char !== 0x22,\n    input,\n    position\n  )\n\n  // 3. If the byte at position is not 0x22 (\"), return failure. Otherwise, advance position by 1.\n  if (input[position.position] !== 0x22) {\n    return null // name could be 'failure'\n  } else {\n    position.position++\n  }\n\n  // 4. Replace any occurrence of the following subsequences in name with the given byte:\n  // - `%0A`: 0x0A (LF)\n  // - `%0D`: 0x0D (CR)\n  // - `%22`: 0x22 (\")\n  name = new TextDecoder().decode(name)\n    .replace(/%0A/ig, '\\n')\n    .replace(/%0D/ig, '\\r')\n    .replace(/%22/g, '\"')\n\n  // 5. Return the UTF-8 decoding without BOM of name.\n  return name\n}\n\n/**\n * @param {(char: number) => boolean} condition\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfBytes (condition, input, position) {\n  let start = position.position\n\n  while (start < input.length && condition(input[start])) {\n    ++start\n  }\n\n  return input.subarray(position.position, (position.position = start))\n}\n\n/**\n * @param {Buffer} buf\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns {Buffer}\n */\nfunction removeChars (buf, leading, trailing, predicate) {\n  let lead = 0\n  let trail = buf.length - 1\n\n  if (leading) {\n    while (lead < buf.length && predicate(buf[lead])) lead++\n  }\n\n  if (trailing) {\n    while (trail > 0 && predicate(buf[trail])) trail--\n  }\n\n  return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)\n}\n\n/**\n * Checks if {@param buffer} starts with {@param start}\n * @param {Buffer} buffer\n * @param {Buffer} start\n * @param {{ position: number }} position\n */\nfunction bufferStartsWith (buffer, start, position) {\n  if (buffer.length < start.length) {\n    return false\n  }\n\n  for (let i = 0; i < start.length; i++) {\n    if (start[i] !== buffer[position.position + i]) {\n      return false\n    }\n  }\n\n  return true\n}\n\nmodule.exports = {\n  multipartFormDataParser,\n  validateBoundary\n}\n","'use strict'\n\nconst { isBlobLike, iteratorMixin } = require('./util')\nconst { kState } = require('./symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { FileLike, isFileLike } = require('./file')\nconst { webidl } = require('./webidl')\nconst { File: NativeFile } = require('node:buffer')\nconst nodeUtil = require('node:util')\n\n/** @type {globalThis['File']} */\nconst File = globalThis.File ?? NativeFile\n\n// https://xhr.spec.whatwg.org/#formdata\nclass FormData {\n  constructor (form) {\n    webidl.util.markAsUncloneable(this)\n\n    if (form !== undefined) {\n      throw webidl.errors.conversionFailed({\n        prefix: 'FormData constructor',\n        argument: 'Argument 1',\n        types: ['undefined']\n      })\n    }\n\n    this[kState] = []\n  }\n\n  append (name, value, filename = undefined) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.append'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    if (arguments.length === 3 && !isBlobLike(value)) {\n      throw new TypeError(\n        \"Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'\"\n      )\n    }\n\n    // 1. Let value be value if given; otherwise blobValue.\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n    value = isBlobLike(value)\n      ? webidl.converters.Blob(value, prefix, 'value', { strict: false })\n      : webidl.converters.USVString(value, prefix, 'value')\n    filename = arguments.length === 3\n      ? webidl.converters.USVString(filename, prefix, 'filename')\n      : undefined\n\n    // 2. Let entry be the result of creating an entry with\n    // name, value, and filename if given.\n    const entry = makeEntry(name, value, filename)\n\n    // 3. Append entry to this’s entry list.\n    this[kState].push(entry)\n  }\n\n  delete (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // The delete(name) method steps are to remove all entries whose name\n    // is name from this’s entry list.\n    this[kState] = this[kState].filter(entry => entry.name !== name)\n  }\n\n  get (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.get'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // 1. If there is no entry whose name is name in this’s entry list,\n    // then return null.\n    const idx = this[kState].findIndex((entry) => entry.name === name)\n    if (idx === -1) {\n      return null\n    }\n\n    // 2. Return the value of the first entry whose name is name from\n    // this’s entry list.\n    return this[kState][idx].value\n  }\n\n  getAll (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.getAll'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // 1. If there is no entry whose name is name in this’s entry list,\n    // then return the empty list.\n    // 2. Return the values of all entries whose name is name, in order,\n    // from this’s entry list.\n    return this[kState]\n      .filter((entry) => entry.name === name)\n      .map((entry) => entry.value)\n  }\n\n  has (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.has'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // The has(name) method steps are to return true if there is an entry\n    // whose name is name in this’s entry list; otherwise false.\n    return this[kState].findIndex((entry) => entry.name === name) !== -1\n  }\n\n  set (name, value, filename = undefined) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.set'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    if (arguments.length === 3 && !isBlobLike(value)) {\n      throw new TypeError(\n        \"Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'\"\n      )\n    }\n\n    // The set(name, value) and set(name, blobValue, filename) method steps\n    // are:\n\n    // 1. Let value be value if given; otherwise blobValue.\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n    value = isBlobLike(value)\n      ? webidl.converters.Blob(value, prefix, 'name', { strict: false })\n      : webidl.converters.USVString(value, prefix, 'name')\n    filename = arguments.length === 3\n      ? webidl.converters.USVString(filename, prefix, 'name')\n      : undefined\n\n    // 2. Let entry be the result of creating an entry with name, value, and\n    // filename if given.\n    const entry = makeEntry(name, value, filename)\n\n    // 3. If there are entries in this’s entry list whose name is name, then\n    // replace the first such entry with entry and remove the others.\n    const idx = this[kState].findIndex((entry) => entry.name === name)\n    if (idx !== -1) {\n      this[kState] = [\n        ...this[kState].slice(0, idx),\n        entry,\n        ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)\n      ]\n    } else {\n      // 4. Otherwise, append entry to this’s entry list.\n      this[kState].push(entry)\n    }\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    const state = this[kState].reduce((a, b) => {\n      if (a[b.name]) {\n        if (Array.isArray(a[b.name])) {\n          a[b.name].push(b.value)\n        } else {\n          a[b.name] = [a[b.name], b.value]\n        }\n      } else {\n        a[b.name] = b.value\n      }\n\n      return a\n    }, { __proto__: null })\n\n    options.depth ??= depth\n    options.colors ??= true\n\n    const output = nodeUtil.formatWithOptions(options, state)\n\n    // remove [Object null prototype]\n    return `FormData ${output.slice(output.indexOf(']') + 2)}`\n  }\n}\n\niteratorMixin('FormData', FormData, kState, 'name', 'value')\n\nObject.defineProperties(FormData.prototype, {\n  append: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  get: kEnumerableProperty,\n  getAll: kEnumerableProperty,\n  has: kEnumerableProperty,\n  set: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'FormData',\n    configurable: true\n  }\n})\n\n/**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry\n * @param {string} name\n * @param {string|Blob} value\n * @param {?string} filename\n * @returns\n */\nfunction makeEntry (name, value, filename) {\n  // 1. Set name to the result of converting name into a scalar value string.\n  // Note: This operation was done by the webidl converter USVString.\n\n  // 2. If value is a string, then set value to the result of converting\n  //    value into a scalar value string.\n  if (typeof value === 'string') {\n    // Note: This operation was done by the webidl converter USVString.\n  } else {\n    // 3. Otherwise:\n\n    // 1. If value is not a File object, then set value to a new File object,\n    //    representing the same bytes, whose name attribute value is \"blob\"\n    if (!isFileLike(value)) {\n      value = value instanceof Blob\n        ? new File([value], 'blob', { type: value.type })\n        : new FileLike(value, 'blob', { type: value.type })\n    }\n\n    // 2. If filename is given, then set value to a new File object,\n    //    representing the same bytes, whose name attribute is filename.\n    if (filename !== undefined) {\n      /** @type {FilePropertyBag} */\n      const options = {\n        type: value.type,\n        lastModified: value.lastModified\n      }\n\n      value = value instanceof NativeFile\n        ? new File([value], filename, options)\n        : new FileLike(value, filename, options)\n    }\n  }\n\n  // 4. Return an entry whose name is name and whose value is value.\n  return { name, value }\n}\n\nmodule.exports = { FormData, makeEntry }\n","'use strict'\n\n// In case of breaking changes, increase the version\n// number to avoid conflicts.\nconst globalOrigin = Symbol.for('undici.globalOrigin.1')\n\nfunction getGlobalOrigin () {\n  return globalThis[globalOrigin]\n}\n\nfunction setGlobalOrigin (newOrigin) {\n  if (newOrigin === undefined) {\n    Object.defineProperty(globalThis, globalOrigin, {\n      value: undefined,\n      writable: true,\n      enumerable: false,\n      configurable: false\n    })\n\n    return\n  }\n\n  const parsedURL = new URL(newOrigin)\n\n  if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {\n    throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)\n  }\n\n  Object.defineProperty(globalThis, globalOrigin, {\n    value: parsedURL,\n    writable: true,\n    enumerable: false,\n    configurable: false\n  })\n}\n\nmodule.exports = {\n  getGlobalOrigin,\n  setGlobalOrigin\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst { kConstruct } = require('../../core/symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst {\n  iteratorMixin,\n  isValidHeaderName,\n  isValidHeaderValue\n} = require('./util')\nconst { webidl } = require('./webidl')\nconst assert = require('node:assert')\nconst util = require('node:util')\n\nconst kHeadersMap = Symbol('headers map')\nconst kHeadersSortedMap = Symbol('headers map sorted')\n\n/**\n * @param {number} code\n */\nfunction isHTTPWhiteSpaceCharCode (code) {\n  return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize\n * @param {string} potentialValue\n */\nfunction headerValueNormalize (potentialValue) {\n  //  To normalize a byte sequence potentialValue, remove\n  //  any leading and trailing HTTP whitespace bytes from\n  //  potentialValue.\n  let i = 0; let j = potentialValue.length\n\n  while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j\n  while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i\n\n  return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)\n}\n\nfunction fill (headers, object) {\n  // To fill a Headers object headers with a given object object, run these steps:\n\n  // 1. If object is a sequence, then for each header in object:\n  // Note: webidl conversion to array has already been done.\n  if (Array.isArray(object)) {\n    for (let i = 0; i < object.length; ++i) {\n      const header = object[i]\n      // 1. If header does not contain exactly two items, then throw a TypeError.\n      if (header.length !== 2) {\n        throw webidl.errors.exception({\n          header: 'Headers constructor',\n          message: `expected name/value pair to be length 2, found ${header.length}.`\n        })\n      }\n\n      // 2. Append (header’s first item, header’s second item) to headers.\n      appendHeader(headers, header[0], header[1])\n    }\n  } else if (typeof object === 'object' && object !== null) {\n    // Note: null should throw\n\n    // 2. Otherwise, object is a record, then for each key → value in object,\n    //    append (key, value) to headers\n    const keys = Object.keys(object)\n    for (let i = 0; i < keys.length; ++i) {\n      appendHeader(headers, keys[i], object[keys[i]])\n    }\n  } else {\n    throw webidl.errors.conversionFailed({\n      prefix: 'Headers constructor',\n      argument: 'Argument 1',\n      types: ['sequence>', 'record']\n    })\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-headers-append\n */\nfunction appendHeader (headers, name, value) {\n  // 1. Normalize value.\n  value = headerValueNormalize(value)\n\n  // 2. If name is not a header name or value is not a\n  //    header value, then throw a TypeError.\n  if (!isValidHeaderName(name)) {\n    throw webidl.errors.invalidArgument({\n      prefix: 'Headers.append',\n      value: name,\n      type: 'header name'\n    })\n  } else if (!isValidHeaderValue(value)) {\n    throw webidl.errors.invalidArgument({\n      prefix: 'Headers.append',\n      value,\n      type: 'header value'\n    })\n  }\n\n  // 3. If headers’s guard is \"immutable\", then throw a TypeError.\n  // 4. Otherwise, if headers’s guard is \"request\" and name is a\n  //    forbidden header name, return.\n  // 5. Otherwise, if headers’s guard is \"request-no-cors\":\n  //    TODO\n  // Note: undici does not implement forbidden header names\n  if (getHeadersGuard(headers) === 'immutable') {\n    throw new TypeError('immutable')\n  }\n\n  // 6. Otherwise, if headers’s guard is \"response\" and name is a\n  //    forbidden response-header name, return.\n\n  // 7. Append (name, value) to headers’s header list.\n  return getHeadersList(headers).append(name, value, false)\n\n  // 8. If headers’s guard is \"request-no-cors\", then remove\n  //    privileged no-CORS request headers from headers\n}\n\nfunction compareHeaderName (a, b) {\n  return a[0] < b[0] ? -1 : 1\n}\n\nclass HeadersList {\n  /** @type {[string, string][]|null} */\n  cookies = null\n\n  constructor (init) {\n    if (init instanceof HeadersList) {\n      this[kHeadersMap] = new Map(init[kHeadersMap])\n      this[kHeadersSortedMap] = init[kHeadersSortedMap]\n      this.cookies = init.cookies === null ? null : [...init.cookies]\n    } else {\n      this[kHeadersMap] = new Map(init)\n      this[kHeadersSortedMap] = null\n    }\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#header-list-contains\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   */\n  contains (name, isLowerCase) {\n    // A header list list contains a header name name if list\n    // contains a header whose name is a byte-case-insensitive\n    // match for name.\n\n    return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase())\n  }\n\n  clear () {\n    this[kHeadersMap].clear()\n    this[kHeadersSortedMap] = null\n    this.cookies = null\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-append\n   * @param {string} name\n   * @param {string} value\n   * @param {boolean} isLowerCase\n   */\n  append (name, value, isLowerCase) {\n    this[kHeadersSortedMap] = null\n\n    // 1. If list contains name, then set name to the first such\n    //    header’s name.\n    const lowercaseName = isLowerCase ? name : name.toLowerCase()\n    const exists = this[kHeadersMap].get(lowercaseName)\n\n    // 2. Append (name, value) to list.\n    if (exists) {\n      const delimiter = lowercaseName === 'cookie' ? '; ' : ', '\n      this[kHeadersMap].set(lowercaseName, {\n        name: exists.name,\n        value: `${exists.value}${delimiter}${value}`\n      })\n    } else {\n      this[kHeadersMap].set(lowercaseName, { name, value })\n    }\n\n    if (lowercaseName === 'set-cookie') {\n      (this.cookies ??= []).push(value)\n    }\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-set\n   * @param {string} name\n   * @param {string} value\n   * @param {boolean} isLowerCase\n   */\n  set (name, value, isLowerCase) {\n    this[kHeadersSortedMap] = null\n    const lowercaseName = isLowerCase ? name : name.toLowerCase()\n\n    if (lowercaseName === 'set-cookie') {\n      this.cookies = [value]\n    }\n\n    // 1. If list contains name, then set the value of\n    //    the first such header to value and remove the\n    //    others.\n    // 2. Otherwise, append header (name, value) to list.\n    this[kHeadersMap].set(lowercaseName, { name, value })\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-delete\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   */\n  delete (name, isLowerCase) {\n    this[kHeadersSortedMap] = null\n    if (!isLowerCase) name = name.toLowerCase()\n\n    if (name === 'set-cookie') {\n      this.cookies = null\n    }\n\n    this[kHeadersMap].delete(name)\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-get\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   * @returns {string | null}\n   */\n  get (name, isLowerCase) {\n    // 1. If list does not contain name, then return null.\n    // 2. Return the values of all headers in list whose name\n    //    is a byte-case-insensitive match for name,\n    //    separated from each other by 0x2C 0x20, in order.\n    return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null\n  }\n\n  * [Symbol.iterator] () {\n    // use the lowercased name\n    for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n      yield [name, value]\n    }\n  }\n\n  get entries () {\n    const headers = {}\n\n    if (this[kHeadersMap].size !== 0) {\n      for (const { name, value } of this[kHeadersMap].values()) {\n        headers[name] = value\n      }\n    }\n\n    return headers\n  }\n\n  rawValues () {\n    return this[kHeadersMap].values()\n  }\n\n  get entriesList () {\n    const headers = []\n\n    if (this[kHeadersMap].size !== 0) {\n      for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) {\n        if (lowerName === 'set-cookie') {\n          for (const cookie of this.cookies) {\n            headers.push([name, cookie])\n          }\n        } else {\n          headers.push([name, value])\n        }\n      }\n    }\n\n    return headers\n  }\n\n  // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set\n  toSortedArray () {\n    const size = this[kHeadersMap].size\n    const array = new Array(size)\n    // In most cases, you will use the fast-path.\n    // fast-path: Use binary insertion sort for small arrays.\n    if (size <= 32) {\n      if (size === 0) {\n        // If empty, it is an empty array. To avoid the first index assignment.\n        return array\n      }\n      // Improve performance by unrolling loop and avoiding double-loop.\n      // Double-loop-less version of the binary insertion sort.\n      const iterator = this[kHeadersMap][Symbol.iterator]()\n      const firstValue = iterator.next().value\n      // set [name, value] to first index.\n      array[0] = [firstValue[0], firstValue[1].value]\n      // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n      // 3.2.2. Assert: value is non-null.\n      assert(firstValue[1].value !== null)\n      for (\n        let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value;\n        i < size;\n        ++i\n      ) {\n        // get next value\n        value = iterator.next().value\n        // set [name, value] to current index.\n        x = array[i] = [value[0], value[1].value]\n        // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n        // 3.2.2. Assert: value is non-null.\n        assert(x[1] !== null)\n        left = 0\n        right = i\n        // binary search\n        while (left < right) {\n          // middle index\n          pivot = left + ((right - left) >> 1)\n          // compare header name\n          if (array[pivot][0] <= x[0]) {\n            left = pivot + 1\n          } else {\n            right = pivot\n          }\n        }\n        if (i !== pivot) {\n          j = i\n          while (j > left) {\n            array[j] = array[--j]\n          }\n          array[left] = x\n        }\n      }\n      /* c8 ignore next 4 */\n      if (!iterator.next().done) {\n        // This is for debugging and will never be called.\n        throw new TypeError('Unreachable')\n      }\n      return array\n    } else {\n      // This case would be a rare occurrence.\n      // slow-path: fallback\n      let i = 0\n      for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n        array[i++] = [name, value]\n        // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n        // 3.2.2. Assert: value is non-null.\n        assert(value !== null)\n      }\n      return array.sort(compareHeaderName)\n    }\n  }\n}\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n  #guard\n  #headersList\n\n  constructor (init = undefined) {\n    webidl.util.markAsUncloneable(this)\n\n    if (init === kConstruct) {\n      return\n    }\n\n    this.#headersList = new HeadersList()\n\n    // The new Headers(init) constructor steps are:\n\n    // 1. Set this’s guard to \"none\".\n    this.#guard = 'none'\n\n    // 2. If init is given, then fill this with init.\n    if (init !== undefined) {\n      init = webidl.converters.HeadersInit(init, 'Headers contructor', 'init')\n      fill(this, init)\n    }\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-append\n  append (name, value) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 2, 'Headers.append')\n\n    const prefix = 'Headers.append'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n    value = webidl.converters.ByteString(value, prefix, 'value')\n\n    return appendHeader(this, name, value)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-delete\n  delete (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')\n\n    const prefix = 'Headers.delete'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix: 'Headers.delete',\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. If this’s guard is \"immutable\", then throw a TypeError.\n    // 3. Otherwise, if this’s guard is \"request\" and name is a\n    //    forbidden header name, return.\n    // 4. Otherwise, if this’s guard is \"request-no-cors\", name\n    //    is not a no-CORS-safelisted request-header name, and\n    //    name is not a privileged no-CORS request-header name,\n    //    return.\n    // 5. Otherwise, if this’s guard is \"response\" and name is\n    //    a forbidden response-header name, return.\n    // Note: undici does not implement forbidden header names\n    if (this.#guard === 'immutable') {\n      throw new TypeError('immutable')\n    }\n\n    // 6. If this’s header list does not contain name, then\n    //    return.\n    if (!this.#headersList.contains(name, false)) {\n      return\n    }\n\n    // 7. Delete name from this’s header list.\n    // 8. If this’s guard is \"request-no-cors\", then remove\n    //    privileged no-CORS request headers from this.\n    this.#headersList.delete(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-get\n  get (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.get')\n\n    const prefix = 'Headers.get'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. Return the result of getting name from this’s header\n    //    list.\n    return this.#headersList.get(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-has\n  has (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.has')\n\n    const prefix = 'Headers.has'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. Return true if this’s header list contains name;\n    //    otherwise false.\n    return this.#headersList.contains(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-set\n  set (name, value) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 2, 'Headers.set')\n\n    const prefix = 'Headers.set'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n    value = webidl.converters.ByteString(value, prefix, 'value')\n\n    // 1. Normalize value.\n    value = headerValueNormalize(value)\n\n    // 2. If name is not a header name or value is not a\n    //    header value, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    } else if (!isValidHeaderValue(value)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value,\n        type: 'header value'\n      })\n    }\n\n    // 3. If this’s guard is \"immutable\", then throw a TypeError.\n    // 4. Otherwise, if this’s guard is \"request\" and name is a\n    //    forbidden header name, return.\n    // 5. Otherwise, if this’s guard is \"request-no-cors\" and\n    //    name/value is not a no-CORS-safelisted request-header,\n    //    return.\n    // 6. Otherwise, if this’s guard is \"response\" and name is a\n    //    forbidden response-header name, return.\n    // Note: undici does not implement forbidden header names\n    if (this.#guard === 'immutable') {\n      throw new TypeError('immutable')\n    }\n\n    // 7. Set (name, value) in this’s header list.\n    // 8. If this’s guard is \"request-no-cors\", then remove\n    //    privileged no-CORS request headers from this\n    this.#headersList.set(name, value, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n  getSetCookie () {\n    webidl.brandCheck(this, Headers)\n\n    // 1. If this’s header list does not contain `Set-Cookie`, then return « ».\n    // 2. Return the values of all headers in this’s header list whose name is\n    //    a byte-case-insensitive match for `Set-Cookie`, in order.\n\n    const list = this.#headersList.cookies\n\n    if (list) {\n      return [...list]\n    }\n\n    return []\n  }\n\n  // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n  get [kHeadersSortedMap] () {\n    if (this.#headersList[kHeadersSortedMap]) {\n      return this.#headersList[kHeadersSortedMap]\n    }\n\n    // 1. Let headers be an empty list of headers with the key being the name\n    //    and value the value.\n    const headers = []\n\n    // 2. Let names be the result of convert header names to a sorted-lowercase\n    //    set with all the names of the headers in list.\n    const names = this.#headersList.toSortedArray()\n\n    const cookies = this.#headersList.cookies\n\n    // fast-path\n    if (cookies === null || cookies.length === 1) {\n      // Note: The non-null assertion of value has already been done by `HeadersList#toSortedArray`\n      return (this.#headersList[kHeadersSortedMap] = names)\n    }\n\n    // 3. For each name of names:\n    for (let i = 0; i < names.length; ++i) {\n      const { 0: name, 1: value } = names[i]\n      // 1. If name is `set-cookie`, then:\n      if (name === 'set-cookie') {\n        // 1. Let values be a list of all values of headers in list whose name\n        //    is a byte-case-insensitive match for name, in order.\n\n        // 2. For each value of values:\n        // 1. Append (name, value) to headers.\n        for (let j = 0; j < cookies.length; ++j) {\n          headers.push([name, cookies[j]])\n        }\n      } else {\n        // 2. Otherwise:\n\n        // 1. Let value be the result of getting name from list.\n\n        // 2. Assert: value is non-null.\n        // Note: This operation was done by `HeadersList#toSortedArray`.\n\n        // 3. Append (name, value) to headers.\n        headers.push([name, value])\n      }\n    }\n\n    // 4. Return headers.\n    return (this.#headersList[kHeadersSortedMap] = headers)\n  }\n\n  [util.inspect.custom] (depth, options) {\n    options.depth ??= depth\n\n    return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`\n  }\n\n  static getHeadersGuard (o) {\n    return o.#guard\n  }\n\n  static setHeadersGuard (o, guard) {\n    o.#guard = guard\n  }\n\n  static getHeadersList (o) {\n    return o.#headersList\n  }\n\n  static setHeadersList (o, list) {\n    o.#headersList = list\n  }\n}\n\nconst { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers\nReflect.deleteProperty(Headers, 'getHeadersGuard')\nReflect.deleteProperty(Headers, 'setHeadersGuard')\nReflect.deleteProperty(Headers, 'getHeadersList')\nReflect.deleteProperty(Headers, 'setHeadersList')\n\niteratorMixin('Headers', Headers, kHeadersSortedMap, 0, 1)\n\nObject.defineProperties(Headers.prototype, {\n  append: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  get: kEnumerableProperty,\n  has: kEnumerableProperty,\n  set: kEnumerableProperty,\n  getSetCookie: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Headers',\n    configurable: true\n  },\n  [util.inspect.custom]: {\n    enumerable: false\n  }\n})\n\nwebidl.converters.HeadersInit = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === 'Object') {\n    const iterator = Reflect.get(V, Symbol.iterator)\n\n    // A work-around to ensure we send the properly-cased Headers when V is a Headers object.\n    // Read https://github.com/nodejs/undici/pull/3159#issuecomment-2075537226 before touching, please.\n    if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { // Headers object\n      try {\n        return getHeadersList(V).entriesList\n      } catch {\n        // fall-through\n      }\n    }\n\n    if (typeof iterator === 'function') {\n      return webidl.converters['sequence>'](V, prefix, argument, iterator.bind(V))\n    }\n\n    return webidl.converters['record'](V, prefix, argument)\n  }\n\n  throw webidl.errors.conversionFailed({\n    prefix: 'Headers constructor',\n    argument: 'Argument 1',\n    types: ['sequence>', 'record']\n  })\n}\n\nmodule.exports = {\n  fill,\n  // for test.\n  compareHeaderName,\n  Headers,\n  HeadersList,\n  getHeadersGuard,\n  setHeadersGuard,\n  setHeadersList,\n  getHeadersList\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst {\n  makeNetworkError,\n  makeAppropriateNetworkError,\n  filterResponse,\n  makeResponse,\n  fromInnerResponse\n} = require('./response')\nconst { HeadersList } = require('./headers')\nconst { Request, cloneRequest } = require('./request')\nconst zlib = require('node:zlib')\nconst {\n  bytesMatch,\n  makePolicyContainer,\n  clonePolicyContainer,\n  requestBadPort,\n  TAOCheck,\n  appendRequestOriginHeader,\n  responseLocationURL,\n  requestCurrentURL,\n  setRequestReferrerPolicyOnRedirect,\n  tryUpgradeRequestToAPotentiallyTrustworthyURL,\n  createOpaqueTimingInfo,\n  appendFetchMetadata,\n  corsCheck,\n  crossOriginResourcePolicyCheck,\n  determineRequestsReferrer,\n  coarsenedSharedCurrentTime,\n  createDeferredPromise,\n  isBlobLike,\n  sameOrigin,\n  isCancelled,\n  isAborted,\n  isErrorLike,\n  fullyReadBody,\n  readableStreamClose,\n  isomorphicEncode,\n  urlIsLocal,\n  urlIsHttpHttpsScheme,\n  urlHasHttpsScheme,\n  clampAndCoarsenConnectionTimingInfo,\n  simpleRangeHeaderValue,\n  buildContentRange,\n  createInflate,\n  extractMimeType\n} = require('./util')\nconst { kState, kDispatcher } = require('./symbols')\nconst assert = require('node:assert')\nconst { safelyExtractBody, extractBody } = require('./body')\nconst {\n  redirectStatusSet,\n  nullBodyStatus,\n  safeMethodsSet,\n  requestBodyHeader,\n  subresourceSet\n} = require('./constants')\nconst EE = require('node:events')\nconst { Readable, pipeline, finished } = require('node:stream')\nconst { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url')\nconst { getGlobalDispatcher } = require('../../global')\nconst { webidl } = require('./webidl')\nconst { STATUS_CODES } = require('node:http')\nconst GET_OR_HEAD = ['GET', 'HEAD']\n\nconst defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'\n  ? 'node'\n  : 'undici'\n\n/** @type {import('buffer').resolveObjectURL} */\nlet resolveObjectURL\n\nclass Fetch extends EE {\n  constructor (dispatcher) {\n    super()\n\n    this.dispatcher = dispatcher\n    this.connection = null\n    this.dump = false\n    this.state = 'ongoing'\n  }\n\n  terminate (reason) {\n    if (this.state !== 'ongoing') {\n      return\n    }\n\n    this.state = 'terminated'\n    this.connection?.destroy(reason)\n    this.emit('terminated', reason)\n  }\n\n  // https://fetch.spec.whatwg.org/#fetch-controller-abort\n  abort (error) {\n    if (this.state !== 'ongoing') {\n      return\n    }\n\n    // 1. Set controller’s state to \"aborted\".\n    this.state = 'aborted'\n\n    // 2. Let fallbackError be an \"AbortError\" DOMException.\n    // 3. Set error to fallbackError if it is not given.\n    if (!error) {\n      error = new DOMException('The operation was aborted.', 'AbortError')\n    }\n\n    // 4. Let serializedError be StructuredSerialize(error).\n    //    If that threw an exception, catch it, and let\n    //    serializedError be StructuredSerialize(fallbackError).\n\n    // 5. Set controller’s serialized abort reason to serializedError.\n    this.serializedAbortReason = error\n\n    this.connection?.destroy(error)\n    this.emit('terminated', error)\n  }\n}\n\nfunction handleFetchDone (response) {\n  finalizeAndReportTiming(response, 'fetch')\n}\n\n// https://fetch.spec.whatwg.org/#fetch-method\nfunction fetch (input, init = undefined) {\n  webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')\n\n  // 1. Let p be a new promise.\n  let p = createDeferredPromise()\n\n  // 2. Let requestObject be the result of invoking the initial value of\n  // Request as constructor with input and init as arguments. If this throws\n  // an exception, reject p with it and return p.\n  let requestObject\n\n  try {\n    requestObject = new Request(input, init)\n  } catch (e) {\n    p.reject(e)\n    return p.promise\n  }\n\n  // 3. Let request be requestObject’s request.\n  const request = requestObject[kState]\n\n  // 4. If requestObject’s signal’s aborted flag is set, then:\n  if (requestObject.signal.aborted) {\n    // 1. Abort the fetch() call with p, request, null, and\n    //    requestObject’s signal’s abort reason.\n    abortFetch(p, request, null, requestObject.signal.reason)\n\n    // 2. Return p.\n    return p.promise\n  }\n\n  // 5. Let globalObject be request’s client’s global object.\n  const globalObject = request.client.globalObject\n\n  // 6. If globalObject is a ServiceWorkerGlobalScope object, then set\n  // request’s service-workers mode to \"none\".\n  if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {\n    request.serviceWorkers = 'none'\n  }\n\n  // 7. Let responseObject be null.\n  let responseObject = null\n\n  // 8. Let relevantRealm be this’s relevant Realm.\n\n  // 9. Let locallyAborted be false.\n  let locallyAborted = false\n\n  // 10. Let controller be null.\n  let controller = null\n\n  // 11. Add the following abort steps to requestObject’s signal:\n  addAbortListener(\n    requestObject.signal,\n    () => {\n      // 1. Set locallyAborted to true.\n      locallyAborted = true\n\n      // 2. Assert: controller is non-null.\n      assert(controller != null)\n\n      // 3. Abort controller with requestObject’s signal’s abort reason.\n      controller.abort(requestObject.signal.reason)\n\n      const realResponse = responseObject?.deref()\n\n      // 4. Abort the fetch() call with p, request, responseObject,\n      //    and requestObject’s signal’s abort reason.\n      abortFetch(p, request, realResponse, requestObject.signal.reason)\n    }\n  )\n\n  // 12. Let handleFetchDone given response response be to finalize and\n  // report timing with response, globalObject, and \"fetch\".\n  // see function handleFetchDone\n\n  // 13. Set controller to the result of calling fetch given request,\n  // with processResponseEndOfBody set to handleFetchDone, and processResponse\n  // given response being these substeps:\n\n  const processResponse = (response) => {\n    // 1. If locallyAborted is true, terminate these substeps.\n    if (locallyAborted) {\n      return\n    }\n\n    // 2. If response’s aborted flag is set, then:\n    if (response.aborted) {\n      // 1. Let deserializedError be the result of deserialize a serialized\n      //    abort reason given controller’s serialized abort reason and\n      //    relevantRealm.\n\n      // 2. Abort the fetch() call with p, request, responseObject, and\n      //    deserializedError.\n\n      abortFetch(p, request, responseObject, controller.serializedAbortReason)\n      return\n    }\n\n    // 3. If response is a network error, then reject p with a TypeError\n    // and terminate these substeps.\n    if (response.type === 'error') {\n      p.reject(new TypeError('fetch failed', { cause: response.error }))\n      return\n    }\n\n    // 4. Set responseObject to the result of creating a Response object,\n    // given response, \"immutable\", and relevantRealm.\n    responseObject = new WeakRef(fromInnerResponse(response, 'immutable'))\n\n    // 5. Resolve p with responseObject.\n    p.resolve(responseObject.deref())\n    p = null\n  }\n\n  controller = fetching({\n    request,\n    processResponseEndOfBody: handleFetchDone,\n    processResponse,\n    dispatcher: requestObject[kDispatcher] // undici\n  })\n\n  // 14. Return p.\n  return p.promise\n}\n\n// https://fetch.spec.whatwg.org/#finalize-and-report-timing\nfunction finalizeAndReportTiming (response, initiatorType = 'other') {\n  // 1. If response is an aborted network error, then return.\n  if (response.type === 'error' && response.aborted) {\n    return\n  }\n\n  // 2. If response’s URL list is null or empty, then return.\n  if (!response.urlList?.length) {\n    return\n  }\n\n  // 3. Let originalURL be response’s URL list[0].\n  const originalURL = response.urlList[0]\n\n  // 4. Let timingInfo be response’s timing info.\n  let timingInfo = response.timingInfo\n\n  // 5. Let cacheState be response’s cache state.\n  let cacheState = response.cacheState\n\n  // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.\n  if (!urlIsHttpHttpsScheme(originalURL)) {\n    return\n  }\n\n  // 7. If timingInfo is null, then return.\n  if (timingInfo === null) {\n    return\n  }\n\n  // 8. If response’s timing allow passed flag is not set, then:\n  if (!response.timingAllowPassed) {\n    //  1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.\n    timingInfo = createOpaqueTimingInfo({\n      startTime: timingInfo.startTime\n    })\n\n    //  2. Set cacheState to the empty string.\n    cacheState = ''\n  }\n\n  // 9. Set timingInfo’s end time to the coarsened shared current time\n  // given global’s relevant settings object’s cross-origin isolated\n  // capability.\n  // TODO: given global’s relevant settings object’s cross-origin isolated\n  // capability?\n  timingInfo.endTime = coarsenedSharedCurrentTime()\n\n  // 10. Set response’s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 11. Mark resource timing for timingInfo, originalURL, initiatorType,\n  // global, and cacheState.\n  markResourceTiming(\n    timingInfo,\n    originalURL.href,\n    initiatorType,\n    globalThis,\n    cacheState\n  )\n}\n\n// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing\nconst markResourceTiming = performance.markResourceTiming\n\n// https://fetch.spec.whatwg.org/#abort-fetch\nfunction abortFetch (p, request, responseObject, error) {\n  // 1. Reject promise with error.\n  if (p) {\n    // We might have already resolved the promise at this stage\n    p.reject(error)\n  }\n\n  // 2. If request’s body is not null and is readable, then cancel request’s\n  // body with error.\n  if (request.body != null && isReadable(request.body?.stream)) {\n    request.body.stream.cancel(error).catch((err) => {\n      if (err.code === 'ERR_INVALID_STATE') {\n        // Node bug?\n        return\n      }\n      throw err\n    })\n  }\n\n  // 3. If responseObject is null, then return.\n  if (responseObject == null) {\n    return\n  }\n\n  // 4. Let response be responseObject’s response.\n  const response = responseObject[kState]\n\n  // 5. If response’s body is not null and is readable, then error response’s\n  // body with error.\n  if (response.body != null && isReadable(response.body?.stream)) {\n    response.body.stream.cancel(error).catch((err) => {\n      if (err.code === 'ERR_INVALID_STATE') {\n        // Node bug?\n        return\n      }\n      throw err\n    })\n  }\n}\n\n// https://fetch.spec.whatwg.org/#fetching\nfunction fetching ({\n  request,\n  processRequestBodyChunkLength,\n  processRequestEndOfBody,\n  processResponse,\n  processResponseEndOfBody,\n  processResponseConsumeBody,\n  useParallelQueue = false,\n  dispatcher = getGlobalDispatcher() // undici\n}) {\n  // Ensure that the dispatcher is set accordingly\n  assert(dispatcher)\n\n  // 1. Let taskDestination be null.\n  let taskDestination = null\n\n  // 2. Let crossOriginIsolatedCapability be false.\n  let crossOriginIsolatedCapability = false\n\n  // 3. If request’s client is non-null, then:\n  if (request.client != null) {\n    // 1. Set taskDestination to request’s client’s global object.\n    taskDestination = request.client.globalObject\n\n    // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin\n    // isolated capability.\n    crossOriginIsolatedCapability =\n      request.client.crossOriginIsolatedCapability\n  }\n\n  // 4. If useParallelQueue is true, then set taskDestination to the result of\n  // starting a new parallel queue.\n  // TODO\n\n  // 5. Let timingInfo be a new fetch timing info whose start time and\n  // post-redirect start time are the coarsened shared current time given\n  // crossOriginIsolatedCapability.\n  const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)\n  const timingInfo = createOpaqueTimingInfo({\n    startTime: currentTime\n  })\n\n  // 6. Let fetchParams be a new fetch params whose\n  // request is request,\n  // timing info is timingInfo,\n  // process request body chunk length is processRequestBodyChunkLength,\n  // process request end-of-body is processRequestEndOfBody,\n  // process response is processResponse,\n  // process response consume body is processResponseConsumeBody,\n  // process response end-of-body is processResponseEndOfBody,\n  // task destination is taskDestination,\n  // and cross-origin isolated capability is crossOriginIsolatedCapability.\n  const fetchParams = {\n    controller: new Fetch(dispatcher),\n    request,\n    timingInfo,\n    processRequestBodyChunkLength,\n    processRequestEndOfBody,\n    processResponse,\n    processResponseConsumeBody,\n    processResponseEndOfBody,\n    taskDestination,\n    crossOriginIsolatedCapability\n  }\n\n  // 7. If request’s body is a byte sequence, then set request’s body to\n  //    request’s body as a body.\n  // NOTE: Since fetching is only called from fetch, body should already be\n  // extracted.\n  assert(!request.body || request.body.stream)\n\n  // 8. If request’s window is \"client\", then set request’s window to request’s\n  // client, if request’s client’s global object is a Window object; otherwise\n  // \"no-window\".\n  if (request.window === 'client') {\n    // TODO: What if request.client is null?\n    request.window =\n      request.client?.globalObject?.constructor?.name === 'Window'\n        ? request.client\n        : 'no-window'\n  }\n\n  // 9. If request’s origin is \"client\", then set request’s origin to request’s\n  // client’s origin.\n  if (request.origin === 'client') {\n    request.origin = request.client.origin\n  }\n\n  // 10. If all of the following conditions are true:\n  // TODO\n\n  // 11. If request’s policy container is \"client\", then:\n  if (request.policyContainer === 'client') {\n    // 1. If request’s client is non-null, then set request’s policy\n    // container to a clone of request’s client’s policy container. [HTML]\n    if (request.client != null) {\n      request.policyContainer = clonePolicyContainer(\n        request.client.policyContainer\n      )\n    } else {\n      // 2. Otherwise, set request’s policy container to a new policy\n      // container.\n      request.policyContainer = makePolicyContainer()\n    }\n  }\n\n  // 12. If request’s header list does not contain `Accept`, then:\n  if (!request.headersList.contains('accept', true)) {\n    // 1. Let value be `*/*`.\n    const value = '*/*'\n\n    // 2. A user agent should set value to the first matching statement, if\n    // any, switching on request’s destination:\n    // \"document\"\n    // \"frame\"\n    // \"iframe\"\n    // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`\n    // \"image\"\n    // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`\n    // \"style\"\n    // `text/css,*/*;q=0.1`\n    // TODO\n\n    // 3. Append `Accept`/value to request’s header list.\n    request.headersList.append('accept', value, true)\n  }\n\n  // 13. If request’s header list does not contain `Accept-Language`, then\n  // user agents should append `Accept-Language`/an appropriate value to\n  // request’s header list.\n  if (!request.headersList.contains('accept-language', true)) {\n    request.headersList.append('accept-language', '*', true)\n  }\n\n  // 14. If request’s priority is null, then use request’s initiator and\n  // destination appropriately in setting request’s priority to a\n  // user-agent-defined object.\n  if (request.priority === null) {\n    // TODO\n  }\n\n  // 15. If request is a subresource request, then:\n  if (subresourceSet.has(request.destination)) {\n    // TODO\n  }\n\n  // 16. Run main fetch given fetchParams.\n  mainFetch(fetchParams)\n    .catch(err => {\n      fetchParams.controller.terminate(err)\n    })\n\n  // 17. Return fetchParam's controller\n  return fetchParams.controller\n}\n\n// https://fetch.spec.whatwg.org/#concept-main-fetch\nasync function mainFetch (fetchParams, recursive = false) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. If request’s local-URLs-only flag is set and request’s current URL is\n  // not local, then set response to a network error.\n  if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n    response = makeNetworkError('local URLs only')\n  }\n\n  // 4. Run report Content Security Policy violations for request.\n  // TODO\n\n  // 5. Upgrade request to a potentially trustworthy URL, if appropriate.\n  tryUpgradeRequestToAPotentiallyTrustworthyURL(request)\n\n  // 6. If should request be blocked due to a bad port, should fetching request\n  // be blocked as mixed content, or should request be blocked by Content\n  // Security Policy returns blocked, then set response to a network error.\n  if (requestBadPort(request) === 'blocked') {\n    response = makeNetworkError('bad port')\n  }\n  // TODO: should fetching request be blocked as mixed content?\n  // TODO: should request be blocked by Content Security Policy?\n\n  // 7. If request’s referrer policy is the empty string, then set request’s\n  // referrer policy to request’s policy container’s referrer policy.\n  if (request.referrerPolicy === '') {\n    request.referrerPolicy = request.policyContainer.referrerPolicy\n  }\n\n  // 8. If request’s referrer is not \"no-referrer\", then set request’s\n  // referrer to the result of invoking determine request’s referrer.\n  if (request.referrer !== 'no-referrer') {\n    request.referrer = determineRequestsReferrer(request)\n  }\n\n  // 9. Set request’s current URL’s scheme to \"https\" if all of the following\n  // conditions are true:\n  // - request’s current URL’s scheme is \"http\"\n  // - request’s current URL’s host is a domain\n  // - Matching request’s current URL’s host per Known HSTS Host Domain Name\n  //   Matching results in either a superdomain match with an asserted\n  //   includeSubDomains directive or a congruent match (with or without an\n  //   asserted includeSubDomains directive). [HSTS]\n  // TODO\n\n  // 10. If recursive is false, then run the remaining steps in parallel.\n  // TODO\n\n  // 11. If response is null, then set response to the result of running\n  // the steps corresponding to the first matching statement:\n  if (response === null) {\n    response = await (async () => {\n      const currentURL = requestCurrentURL(request)\n\n      if (\n        // - request’s current URL’s origin is same origin with request’s origin,\n        //   and request’s response tainting is \"basic\"\n        (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||\n        // request’s current URL’s scheme is \"data\"\n        (currentURL.protocol === 'data:') ||\n        // - request’s mode is \"navigate\" or \"websocket\"\n        (request.mode === 'navigate' || request.mode === 'websocket')\n      ) {\n        // 1. Set request’s response tainting to \"basic\".\n        request.responseTainting = 'basic'\n\n        // 2. Return the result of running scheme fetch given fetchParams.\n        return await schemeFetch(fetchParams)\n      }\n\n      // request’s mode is \"same-origin\"\n      if (request.mode === 'same-origin') {\n        // 1. Return a network error.\n        return makeNetworkError('request mode cannot be \"same-origin\"')\n      }\n\n      // request’s mode is \"no-cors\"\n      if (request.mode === 'no-cors') {\n        // 1. If request’s redirect mode is not \"follow\", then return a network\n        // error.\n        if (request.redirect !== 'follow') {\n          return makeNetworkError(\n            'redirect mode cannot be \"follow\" for \"no-cors\" request'\n          )\n        }\n\n        // 2. Set request’s response tainting to \"opaque\".\n        request.responseTainting = 'opaque'\n\n        // 3. Return the result of running scheme fetch given fetchParams.\n        return await schemeFetch(fetchParams)\n      }\n\n      // request’s current URL’s scheme is not an HTTP(S) scheme\n      if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n        // Return a network error.\n        return makeNetworkError('URL scheme must be a HTTP(S) scheme')\n      }\n\n      // - request’s use-CORS-preflight flag is set\n      // - request’s unsafe-request flag is set and either request’s method is\n      //   not a CORS-safelisted method or CORS-unsafe request-header names with\n      //   request’s header list is not empty\n      //    1. Set request’s response tainting to \"cors\".\n      //    2. Let corsWithPreflightResponse be the result of running HTTP fetch\n      //    given fetchParams and true.\n      //    3. If corsWithPreflightResponse is a network error, then clear cache\n      //    entries using request.\n      //    4. Return corsWithPreflightResponse.\n      // TODO\n\n      // Otherwise\n      //    1. Set request’s response tainting to \"cors\".\n      request.responseTainting = 'cors'\n\n      //    2. Return the result of running HTTP fetch given fetchParams.\n      return await httpFetch(fetchParams)\n    })()\n  }\n\n  // 12. If recursive is true, then return response.\n  if (recursive) {\n    return response\n  }\n\n  // 13. If response is not a network error and response is not a filtered\n  // response, then:\n  if (response.status !== 0 && !response.internalResponse) {\n    // If request’s response tainting is \"cors\", then:\n    if (request.responseTainting === 'cors') {\n      // 1. Let headerNames be the result of extracting header list values\n      // given `Access-Control-Expose-Headers` and response’s header list.\n      // TODO\n      // 2. If request’s credentials mode is not \"include\" and headerNames\n      // contains `*`, then set response’s CORS-exposed header-name list to\n      // all unique header names in response’s header list.\n      // TODO\n      // 3. Otherwise, if headerNames is not null or failure, then set\n      // response’s CORS-exposed header-name list to headerNames.\n      // TODO\n    }\n\n    // Set response to the following filtered response with response as its\n    // internal response, depending on request’s response tainting:\n    if (request.responseTainting === 'basic') {\n      response = filterResponse(response, 'basic')\n    } else if (request.responseTainting === 'cors') {\n      response = filterResponse(response, 'cors')\n    } else if (request.responseTainting === 'opaque') {\n      response = filterResponse(response, 'opaque')\n    } else {\n      assert(false)\n    }\n  }\n\n  // 14. Let internalResponse be response, if response is a network error,\n  // and response’s internal response otherwise.\n  let internalResponse =\n    response.status === 0 ? response : response.internalResponse\n\n  // 15. If internalResponse’s URL list is empty, then set it to a clone of\n  // request’s URL list.\n  if (internalResponse.urlList.length === 0) {\n    internalResponse.urlList.push(...request.urlList)\n  }\n\n  // 16. If request’s timing allow failed flag is unset, then set\n  // internalResponse’s timing allow passed flag.\n  if (!request.timingAllowFailed) {\n    response.timingAllowPassed = true\n  }\n\n  // 17. If response is not a network error and any of the following returns\n  // blocked\n  // - should internalResponse to request be blocked as mixed content\n  // - should internalResponse to request be blocked by Content Security Policy\n  // - should internalResponse to request be blocked due to its MIME type\n  // - should internalResponse to request be blocked due to nosniff\n  // TODO\n\n  // 18. If response’s type is \"opaque\", internalResponse’s status is 206,\n  // internalResponse’s range-requested flag is set, and request’s header\n  // list does not contain `Range`, then set response and internalResponse\n  // to a network error.\n  if (\n    response.type === 'opaque' &&\n    internalResponse.status === 206 &&\n    internalResponse.rangeRequested &&\n    !request.headers.contains('range', true)\n  ) {\n    response = internalResponse = makeNetworkError()\n  }\n\n  // 19. If response is not a network error and either request’s method is\n  // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,\n  // set internalResponse’s body to null and disregard any enqueuing toward\n  // it (if any).\n  if (\n    response.status !== 0 &&\n    (request.method === 'HEAD' ||\n      request.method === 'CONNECT' ||\n      nullBodyStatus.includes(internalResponse.status))\n  ) {\n    internalResponse.body = null\n    fetchParams.controller.dump = true\n  }\n\n  // 20. If request’s integrity metadata is not the empty string, then:\n  if (request.integrity) {\n    // 1. Let processBodyError be this step: run fetch finale given fetchParams\n    // and a network error.\n    const processBodyError = (reason) =>\n      fetchFinale(fetchParams, makeNetworkError(reason))\n\n    // 2. If request’s response tainting is \"opaque\", or response’s body is null,\n    // then run processBodyError and abort these steps.\n    if (request.responseTainting === 'opaque' || response.body == null) {\n      processBodyError(response.error)\n      return\n    }\n\n    // 3. Let processBody given bytes be these steps:\n    const processBody = (bytes) => {\n      // 1. If bytes do not match request’s integrity metadata,\n      // then run processBodyError and abort these steps. [SRI]\n      if (!bytesMatch(bytes, request.integrity)) {\n        processBodyError('integrity mismatch')\n        return\n      }\n\n      // 2. Set response’s body to bytes as a body.\n      response.body = safelyExtractBody(bytes)[0]\n\n      // 3. Run fetch finale given fetchParams and response.\n      fetchFinale(fetchParams, response)\n    }\n\n    // 4. Fully read response’s body given processBody and processBodyError.\n    await fullyReadBody(response.body, processBody, processBodyError)\n  } else {\n    // 21. Otherwise, run fetch finale given fetchParams and response.\n    fetchFinale(fetchParams, response)\n  }\n}\n\n// https://fetch.spec.whatwg.org/#concept-scheme-fetch\n// given a fetch params fetchParams\nfunction schemeFetch (fetchParams) {\n  // Note: since the connection is destroyed on redirect, which sets fetchParams to a\n  // cancelled state, we do not want this condition to trigger *unless* there have been\n  // no redirects. See https://github.com/nodejs/undici/issues/1776\n  // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n  if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n    return Promise.resolve(makeAppropriateNetworkError(fetchParams))\n  }\n\n  // 2. Let request be fetchParams’s request.\n  const { request } = fetchParams\n\n  const { protocol: scheme } = requestCurrentURL(request)\n\n  // 3. Switch on request’s current URL’s scheme and run the associated steps:\n  switch (scheme) {\n    case 'about:': {\n      // If request’s current URL’s path is the string \"blank\", then return a new response\n      // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,\n      // and body is the empty byte sequence as a body.\n\n      // Otherwise, return a network error.\n      return Promise.resolve(makeNetworkError('about scheme is not supported'))\n    }\n    case 'blob:': {\n      if (!resolveObjectURL) {\n        resolveObjectURL = require('node:buffer').resolveObjectURL\n      }\n\n      // 1. Let blobURLEntry be request’s current URL’s blob URL entry.\n      const blobURLEntry = requestCurrentURL(request)\n\n      // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56\n      // Buffer.resolveObjectURL does not ignore URL queries.\n      if (blobURLEntry.search.length !== 0) {\n        return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))\n      }\n\n      const blob = resolveObjectURL(blobURLEntry.toString())\n\n      // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s\n      //    object is not a Blob object, then return a network error.\n      if (request.method !== 'GET' || !isBlobLike(blob)) {\n        return Promise.resolve(makeNetworkError('invalid method'))\n      }\n\n      // 3. Let blob be blobURLEntry’s object.\n      // Note: done above\n\n      // 4. Let response be a new response.\n      const response = makeResponse()\n\n      // 5. Let fullLength be blob’s size.\n      const fullLength = blob.size\n\n      // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.\n      const serializedFullLength = isomorphicEncode(`${fullLength}`)\n\n      // 7. Let type be blob’s type.\n      const type = blob.type\n\n      // 8. If request’s header list does not contain `Range`:\n      // 9. Otherwise:\n      if (!request.headersList.contains('range', true)) {\n        // 1. Let bodyWithType be the result of safely extracting blob.\n        // Note: in the FileAPI a blob \"object\" is a Blob *or* a MediaSource.\n        // In node, this can only ever be a Blob. Therefore we can safely\n        // use extractBody directly.\n        const bodyWithType = extractBody(blob)\n\n        // 2. Set response’s status message to `OK`.\n        response.statusText = 'OK'\n\n        // 3. Set response’s body to bodyWithType’s body.\n        response.body = bodyWithType[0]\n\n        // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».\n        response.headersList.set('content-length', serializedFullLength, true)\n        response.headersList.set('content-type', type, true)\n      } else {\n        // 1. Set response’s range-requested flag.\n        response.rangeRequested = true\n\n        // 2. Let rangeHeader be the result of getting `Range` from request’s header list.\n        const rangeHeader = request.headersList.get('range', true)\n\n        // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true.\n        const rangeValue = simpleRangeHeaderValue(rangeHeader, true)\n\n        // 4. If rangeValue is failure, then return a network error.\n        if (rangeValue === 'failure') {\n          return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n        }\n\n        // 5. Let (rangeStart, rangeEnd) be rangeValue.\n        let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue\n\n        // 6. If rangeStart is null:\n        // 7. Otherwise:\n        if (rangeStart === null) {\n          // 1. Set rangeStart to fullLength − rangeEnd.\n          rangeStart = fullLength - rangeEnd\n\n          // 2. Set rangeEnd to rangeStart + rangeEnd − 1.\n          rangeEnd = rangeStart + rangeEnd - 1\n        } else {\n          // 1. If rangeStart is greater than or equal to fullLength, then return a network error.\n          if (rangeStart >= fullLength) {\n            return Promise.resolve(makeNetworkError('Range start is greater than the blob\\'s size.'))\n          }\n\n          // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set\n          //    rangeEnd to fullLength − 1.\n          if (rangeEnd === null || rangeEnd >= fullLength) {\n            rangeEnd = fullLength - 1\n          }\n        }\n\n        // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,\n        //    rangeEnd + 1, and type.\n        const slicedBlob = blob.slice(rangeStart, rangeEnd, type)\n\n        // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.\n        // Note: same reason as mentioned above as to why we use extractBody\n        const slicedBodyWithType = extractBody(slicedBlob)\n\n        // 10. Set response’s body to slicedBodyWithType’s body.\n        response.body = slicedBodyWithType[0]\n\n        // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.\n        const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`)\n\n        // 12. Let contentRange be the result of invoking build a content range given rangeStart,\n        //     rangeEnd, and fullLength.\n        const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength)\n\n        // 13. Set response’s status to 206.\n        response.status = 206\n\n        // 14. Set response’s status message to `Partial Content`.\n        response.statusText = 'Partial Content'\n\n        // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength),\n        //     (`Content-Type`, type), (`Content-Range`, contentRange) ».\n        response.headersList.set('content-length', serializedSlicedLength, true)\n        response.headersList.set('content-type', type, true)\n        response.headersList.set('content-range', contentRange, true)\n      }\n\n      // 10. Return response.\n      return Promise.resolve(response)\n    }\n    case 'data:': {\n      // 1. Let dataURLStruct be the result of running the\n      //    data: URL processor on request’s current URL.\n      const currentURL = requestCurrentURL(request)\n      const dataURLStruct = dataURLProcessor(currentURL)\n\n      // 2. If dataURLStruct is failure, then return a\n      //    network error.\n      if (dataURLStruct === 'failure') {\n        return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n      }\n\n      // 3. Let mimeType be dataURLStruct’s MIME type, serialized.\n      const mimeType = serializeAMimeType(dataURLStruct.mimeType)\n\n      // 4. Return a response whose status message is `OK`,\n      //    header list is « (`Content-Type`, mimeType) »,\n      //    and body is dataURLStruct’s body as a body.\n      return Promise.resolve(makeResponse({\n        statusText: 'OK',\n        headersList: [\n          ['content-type', { name: 'Content-Type', value: mimeType }]\n        ],\n        body: safelyExtractBody(dataURLStruct.body)[0]\n      }))\n    }\n    case 'file:': {\n      // For now, unfortunate as it is, file URLs are left as an exercise for the reader.\n      // When in doubt, return a network error.\n      return Promise.resolve(makeNetworkError('not implemented... yet...'))\n    }\n    case 'http:':\n    case 'https:': {\n      // Return the result of running HTTP fetch given fetchParams.\n\n      return httpFetch(fetchParams)\n        .catch((err) => makeNetworkError(err))\n    }\n    default: {\n      return Promise.resolve(makeNetworkError('unknown scheme'))\n    }\n  }\n}\n\n// https://fetch.spec.whatwg.org/#finalize-response\nfunction finalizeResponse (fetchParams, response) {\n  // 1. Set fetchParams’s request’s done flag.\n  fetchParams.request.done = true\n\n  // 2, If fetchParams’s process response done is not null, then queue a fetch\n  // task to run fetchParams’s process response done given response, with\n  // fetchParams’s task destination.\n  if (fetchParams.processResponseDone != null) {\n    queueMicrotask(() => fetchParams.processResponseDone(response))\n  }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-finale\nfunction fetchFinale (fetchParams, response) {\n  // 1. Let timingInfo be fetchParams’s timing info.\n  let timingInfo = fetchParams.timingInfo\n\n  // 2. If response is not a network error and fetchParams’s request’s client is a secure context,\n  //    then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting\n  //    `Server-Timing` from response’s internal response’s header list.\n  // TODO\n\n  // 3. Let processResponseEndOfBody be the following steps:\n  const processResponseEndOfBody = () => {\n    // 1. Let unsafeEndTime be the unsafe shared current time.\n    const unsafeEndTime = Date.now() // ?\n\n    // 2. If fetchParams’s request’s destination is \"document\", then set fetchParams’s controller’s\n    //    full timing info to fetchParams’s timing info.\n    if (fetchParams.request.destination === 'document') {\n      fetchParams.controller.fullTimingInfo = timingInfo\n    }\n\n    // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:\n    fetchParams.controller.reportTimingSteps = () => {\n      // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.\n      if (fetchParams.request.url.protocol !== 'https:') {\n        return\n      }\n\n      // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global.\n      timingInfo.endTime = unsafeEndTime\n\n      // 3. Let cacheState be response’s cache state.\n      let cacheState = response.cacheState\n\n      // 4. Let bodyInfo be response’s body info.\n      const bodyInfo = response.bodyInfo\n\n      // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an\n      //    opaque timing info for timingInfo and set cacheState to the empty string.\n      if (!response.timingAllowPassed) {\n        timingInfo = createOpaqueTimingInfo(timingInfo)\n\n        cacheState = ''\n      }\n\n      // 6. Let responseStatus be 0.\n      let responseStatus = 0\n\n      // 7. If fetchParams’s request’s mode is not \"navigate\" or response’s has-cross-origin-redirects is false:\n      if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {\n        // 1. Set responseStatus to response’s status.\n        responseStatus = response.status\n\n        // 2. Let mimeType be the result of extracting a MIME type from response’s header list.\n        const mimeType = extractMimeType(response.headersList)\n\n        // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType.\n        if (mimeType !== 'failure') {\n          bodyInfo.contentType = minimizeSupportedMimeType(mimeType)\n        }\n      }\n\n      // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo,\n      //    fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,\n      //    and responseStatus.\n      if (fetchParams.request.initiatorType != null) {\n        // TODO: update markresourcetiming\n        markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)\n      }\n    }\n\n    // 4. Let processResponseEndOfBodyTask be the following steps:\n    const processResponseEndOfBodyTask = () => {\n      // 1. Set fetchParams’s request’s done flag.\n      fetchParams.request.done = true\n\n      // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process\n      //    response end-of-body given response.\n      if (fetchParams.processResponseEndOfBody != null) {\n        queueMicrotask(() => fetchParams.processResponseEndOfBody(response))\n      }\n\n      // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s\n      //    global object is fetchParams’s task destination, then run fetchParams’s controller’s report\n      //    timing steps given fetchParams’s request’s client’s global object.\n      if (fetchParams.request.initiatorType != null) {\n        fetchParams.controller.reportTimingSteps()\n      }\n    }\n\n    // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination\n    queueMicrotask(() => processResponseEndOfBodyTask())\n  }\n\n  // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s\n  //    process response given response, with fetchParams’s task destination.\n  if (fetchParams.processResponse != null) {\n    queueMicrotask(() => {\n      fetchParams.processResponse(response)\n      fetchParams.processResponse = null\n    })\n  }\n\n  // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.\n  const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)\n\n  // 6. If internalResponse’s body is null, then run processResponseEndOfBody.\n  // 7. Otherwise:\n  if (internalResponse.body == null) {\n    processResponseEndOfBody()\n  } else {\n    // mcollina: all the following steps of the specs are skipped.\n    // The internal transform stream is not needed.\n    // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541\n\n    // 1. Let transformStream be a new TransformStream.\n    // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream.\n    // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm\n    //    set to processResponseEndOfBody.\n    // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.\n\n    finished(internalResponse.body.stream, () => {\n      processResponseEndOfBody()\n    })\n  }\n}\n\n// https://fetch.spec.whatwg.org/#http-fetch\nasync function httpFetch (fetchParams) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let actualResponse be null.\n  let actualResponse = null\n\n  // 4. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 5. If request’s service-workers mode is \"all\", then:\n  if (request.serviceWorkers === 'all') {\n    // TODO\n  }\n\n  // 6. If response is null, then:\n  if (response === null) {\n    // 1. If makeCORSPreflight is true and one of these conditions is true:\n    // TODO\n\n    // 2. If request’s redirect mode is \"follow\", then set request’s\n    // service-workers mode to \"none\".\n    if (request.redirect === 'follow') {\n      request.serviceWorkers = 'none'\n    }\n\n    // 3. Set response and actualResponse to the result of running\n    // HTTP-network-or-cache fetch given fetchParams.\n    actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n    // 4. If request’s response tainting is \"cors\" and a CORS check\n    // for request and response returns failure, then return a network error.\n    if (\n      request.responseTainting === 'cors' &&\n      corsCheck(request, response) === 'failure'\n    ) {\n      return makeNetworkError('cors failure')\n    }\n\n    // 5. If the TAO check for request and response returns failure, then set\n    // request’s timing allow failed flag.\n    if (TAOCheck(request, response) === 'failure') {\n      request.timingAllowFailed = true\n    }\n  }\n\n  // 7. If either request’s response tainting or response’s type\n  // is \"opaque\", and the cross-origin resource policy check with\n  // request’s origin, request’s client, request’s destination,\n  // and actualResponse returns blocked, then return a network error.\n  if (\n    (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n    crossOriginResourcePolicyCheck(\n      request.origin,\n      request.client,\n      request.destination,\n      actualResponse\n    ) === 'blocked'\n  ) {\n    return makeNetworkError('blocked')\n  }\n\n  // 8. If actualResponse’s status is a redirect status, then:\n  if (redirectStatusSet.has(actualResponse.status)) {\n    // 1. If actualResponse’s status is not 303, request’s body is not null,\n    // and the connection uses HTTP/2, then user agents may, and are even\n    // encouraged to, transmit an RST_STREAM frame.\n    // See, https://github.com/whatwg/fetch/issues/1288\n    if (request.redirect !== 'manual') {\n      fetchParams.controller.connection.destroy(undefined, false)\n    }\n\n    // 2. Switch on request’s redirect mode:\n    if (request.redirect === 'error') {\n      // Set response to a network error.\n      response = makeNetworkError('unexpected redirect')\n    } else if (request.redirect === 'manual') {\n      // Set response to an opaque-redirect filtered response whose internal\n      // response is actualResponse.\n      // NOTE(spec): On the web this would return an `opaqueredirect` response,\n      // but that doesn't make sense server side.\n      // See https://github.com/nodejs/undici/issues/1193.\n      response = actualResponse\n    } else if (request.redirect === 'follow') {\n      // Set response to the result of running HTTP-redirect fetch given\n      // fetchParams and response.\n      response = await httpRedirectFetch(fetchParams, response)\n    } else {\n      assert(false)\n    }\n  }\n\n  // 9. Set response’s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 10. Return response.\n  return response\n}\n\n// https://fetch.spec.whatwg.org/#http-redirect-fetch\nfunction httpRedirectFetch (fetchParams, response) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let actualResponse be response, if response is not a filtered response,\n  // and response’s internal response otherwise.\n  const actualResponse = response.internalResponse\n    ? response.internalResponse\n    : response\n\n  // 3. Let locationURL be actualResponse’s location URL given request’s current\n  // URL’s fragment.\n  let locationURL\n\n  try {\n    locationURL = responseLocationURL(\n      actualResponse,\n      requestCurrentURL(request).hash\n    )\n\n    // 4. If locationURL is null, then return response.\n    if (locationURL == null) {\n      return response\n    }\n  } catch (err) {\n    // 5. If locationURL is failure, then return a network error.\n    return Promise.resolve(makeNetworkError(err))\n  }\n\n  // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network\n  // error.\n  if (!urlIsHttpHttpsScheme(locationURL)) {\n    return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))\n  }\n\n  // 7. If request’s redirect count is 20, then return a network error.\n  if (request.redirectCount === 20) {\n    return Promise.resolve(makeNetworkError('redirect count exceeded'))\n  }\n\n  // 8. Increase request’s redirect count by 1.\n  request.redirectCount += 1\n\n  // 9. If request’s mode is \"cors\", locationURL includes credentials, and\n  // request’s origin is not same origin with locationURL’s origin, then return\n  //  a network error.\n  if (\n    request.mode === 'cors' &&\n    (locationURL.username || locationURL.password) &&\n    !sameOrigin(request, locationURL)\n  ) {\n    return Promise.resolve(makeNetworkError('cross origin not allowed for request mode \"cors\"'))\n  }\n\n  // 10. If request’s response tainting is \"cors\" and locationURL includes\n  // credentials, then return a network error.\n  if (\n    request.responseTainting === 'cors' &&\n    (locationURL.username || locationURL.password)\n  ) {\n    return Promise.resolve(makeNetworkError(\n      'URL cannot contain credentials for request mode \"cors\"'\n    ))\n  }\n\n  // 11. If actualResponse’s status is not 303, request’s body is non-null,\n  // and request’s body’s source is null, then return a network error.\n  if (\n    actualResponse.status !== 303 &&\n    request.body != null &&\n    request.body.source == null\n  ) {\n    return Promise.resolve(makeNetworkError())\n  }\n\n  // 12. If one of the following is true\n  // - actualResponse’s status is 301 or 302 and request’s method is `POST`\n  // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`\n  if (\n    ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||\n    (actualResponse.status === 303 &&\n      !GET_OR_HEAD.includes(request.method))\n  ) {\n    // then:\n    // 1. Set request’s method to `GET` and request’s body to null.\n    request.method = 'GET'\n    request.body = null\n\n    // 2. For each headerName of request-body-header name, delete headerName from\n    // request’s header list.\n    for (const headerName of requestBodyHeader) {\n      request.headersList.delete(headerName)\n    }\n  }\n\n  // 13. If request’s current URL’s origin is not same origin with locationURL’s\n  //     origin, then for each headerName of CORS non-wildcard request-header name,\n  //     delete headerName from request’s header list.\n  if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n    // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name\n    request.headersList.delete('authorization', true)\n\n    // https://fetch.spec.whatwg.org/#authentication-entries\n    request.headersList.delete('proxy-authorization', true)\n\n    // \"Cookie\" and \"Host\" are forbidden request-headers, which undici doesn't implement.\n    request.headersList.delete('cookie', true)\n    request.headersList.delete('host', true)\n  }\n\n  // 14. If request’s body is non-null, then set request’s body to the first return\n  // value of safely extracting request’s body’s source.\n  if (request.body != null) {\n    assert(request.body.source != null)\n    request.body = safelyExtractBody(request.body.source)[0]\n  }\n\n  // 15. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 16. Set timingInfo’s redirect end time and post-redirect start time to the\n  // coarsened shared current time given fetchParams’s cross-origin isolated\n  // capability.\n  timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =\n    coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n\n  // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s\n  //  redirect start time to timingInfo’s start time.\n  if (timingInfo.redirectStartTime === 0) {\n    timingInfo.redirectStartTime = timingInfo.startTime\n  }\n\n  // 18. Append locationURL to request’s URL list.\n  request.urlList.push(locationURL)\n\n  // 19. Invoke set request’s referrer policy on redirect on request and\n  // actualResponse.\n  setRequestReferrerPolicyOnRedirect(request, actualResponse)\n\n  // 20. Return the result of running main fetch given fetchParams and true.\n  return mainFetch(fetchParams, true)\n}\n\n// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch\nasync function httpNetworkOrCacheFetch (\n  fetchParams,\n  isAuthenticationFetch = false,\n  isNewConnectionFetch = false\n) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let httpFetchParams be null.\n  let httpFetchParams = null\n\n  // 3. Let httpRequest be null.\n  let httpRequest = null\n\n  // 4. Let response be null.\n  let response = null\n\n  // 5. Let storedResponse be null.\n  // TODO: cache\n\n  // 6. Let httpCache be null.\n  const httpCache = null\n\n  // 7. Let the revalidatingFlag be unset.\n  const revalidatingFlag = false\n\n  // 8. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. If request’s window is \"no-window\" and request’s redirect mode is\n  //    \"error\", then set httpFetchParams to fetchParams and httpRequest to\n  //    request.\n  if (request.window === 'no-window' && request.redirect === 'error') {\n    httpFetchParams = fetchParams\n    httpRequest = request\n  } else {\n    // Otherwise:\n\n    // 1. Set httpRequest to a clone of request.\n    httpRequest = cloneRequest(request)\n\n    // 2. Set httpFetchParams to a copy of fetchParams.\n    httpFetchParams = { ...fetchParams }\n\n    // 3. Set httpFetchParams’s request to httpRequest.\n    httpFetchParams.request = httpRequest\n  }\n\n  //    3. Let includeCredentials be true if one of\n  const includeCredentials =\n    request.credentials === 'include' ||\n    (request.credentials === 'same-origin' &&\n      request.responseTainting === 'basic')\n\n  //    4. Let contentLength be httpRequest’s body’s length, if httpRequest’s\n  //    body is non-null; otherwise null.\n  const contentLength = httpRequest.body ? httpRequest.body.length : null\n\n  //    5. Let contentLengthHeaderValue be null.\n  let contentLengthHeaderValue = null\n\n  //    6. If httpRequest’s body is null and httpRequest’s method is `POST` or\n  //    `PUT`, then set contentLengthHeaderValue to `0`.\n  if (\n    httpRequest.body == null &&\n    ['POST', 'PUT'].includes(httpRequest.method)\n  ) {\n    contentLengthHeaderValue = '0'\n  }\n\n  //    7. If contentLength is non-null, then set contentLengthHeaderValue to\n  //    contentLength, serialized and isomorphic encoded.\n  if (contentLength != null) {\n    contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)\n  }\n\n  //    8. If contentLengthHeaderValue is non-null, then append\n  //    `Content-Length`/contentLengthHeaderValue to httpRequest’s header\n  //    list.\n  if (contentLengthHeaderValue != null) {\n    httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)\n  }\n\n  //    9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,\n  //    contentLengthHeaderValue) to httpRequest’s header list.\n\n  //    10. If contentLength is non-null and httpRequest’s keepalive is true,\n  //    then:\n  if (contentLength != null && httpRequest.keepalive) {\n    // NOTE: keepalive is a noop outside of browser context.\n  }\n\n  //    11. If httpRequest’s referrer is a URL, then append\n  //    `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,\n  //     to httpRequest’s header list.\n  if (httpRequest.referrer instanceof URL) {\n    httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)\n  }\n\n  //    12. Append a request `Origin` header for httpRequest.\n  appendRequestOriginHeader(httpRequest)\n\n  //    13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]\n  appendFetchMetadata(httpRequest)\n\n  //    14. If httpRequest’s header list does not contain `User-Agent`, then\n  //    user agents should append `User-Agent`/default `User-Agent` value to\n  //    httpRequest’s header list.\n  if (!httpRequest.headersList.contains('user-agent', true)) {\n    httpRequest.headersList.append('user-agent', defaultUserAgent)\n  }\n\n  //    15. If httpRequest’s cache mode is \"default\" and httpRequest’s header\n  //    list contains `If-Modified-Since`, `If-None-Match`,\n  //    `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set\n  //    httpRequest’s cache mode to \"no-store\".\n  if (\n    httpRequest.cache === 'default' &&\n    (httpRequest.headersList.contains('if-modified-since', true) ||\n      httpRequest.headersList.contains('if-none-match', true) ||\n      httpRequest.headersList.contains('if-unmodified-since', true) ||\n      httpRequest.headersList.contains('if-match', true) ||\n      httpRequest.headersList.contains('if-range', true))\n  ) {\n    httpRequest.cache = 'no-store'\n  }\n\n  //    16. If httpRequest’s cache mode is \"no-cache\", httpRequest’s prevent\n  //    no-cache cache-control header modification flag is unset, and\n  //    httpRequest’s header list does not contain `Cache-Control`, then append\n  //    `Cache-Control`/`max-age=0` to httpRequest’s header list.\n  if (\n    httpRequest.cache === 'no-cache' &&\n    !httpRequest.preventNoCacheCacheControlHeaderModification &&\n    !httpRequest.headersList.contains('cache-control', true)\n  ) {\n    httpRequest.headersList.append('cache-control', 'max-age=0', true)\n  }\n\n  //    17. If httpRequest’s cache mode is \"no-store\" or \"reload\", then:\n  if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {\n    // 1. If httpRequest’s header list does not contain `Pragma`, then append\n    // `Pragma`/`no-cache` to httpRequest’s header list.\n    if (!httpRequest.headersList.contains('pragma', true)) {\n      httpRequest.headersList.append('pragma', 'no-cache', true)\n    }\n\n    // 2. If httpRequest’s header list does not contain `Cache-Control`,\n    // then append `Cache-Control`/`no-cache` to httpRequest’s header list.\n    if (!httpRequest.headersList.contains('cache-control', true)) {\n      httpRequest.headersList.append('cache-control', 'no-cache', true)\n    }\n  }\n\n  //    18. If httpRequest’s header list contains `Range`, then append\n  //    `Accept-Encoding`/`identity` to httpRequest’s header list.\n  if (httpRequest.headersList.contains('range', true)) {\n    httpRequest.headersList.append('accept-encoding', 'identity', true)\n  }\n\n  //    19. Modify httpRequest’s header list per HTTP. Do not append a given\n  //    header if httpRequest’s header list contains that header’s name.\n  //    TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129\n  if (!httpRequest.headersList.contains('accept-encoding', true)) {\n    if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n      httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)\n    } else {\n      httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)\n    }\n  }\n\n  httpRequest.headersList.delete('host', true)\n\n  //    20. If includeCredentials is true, then:\n  if (includeCredentials) {\n    // 1. If the user agent is not configured to block cookies for httpRequest\n    // (see section 7 of [COOKIES]), then:\n    // TODO: credentials\n    // 2. If httpRequest’s header list does not contain `Authorization`, then:\n    // TODO: credentials\n  }\n\n  //    21. If there’s a proxy-authentication entry, use it as appropriate.\n  //    TODO: proxy-authentication\n\n  //    22. Set httpCache to the result of determining the HTTP cache\n  //    partition, given httpRequest.\n  //    TODO: cache\n\n  //    23. If httpCache is null, then set httpRequest’s cache mode to\n  //    \"no-store\".\n  if (httpCache == null) {\n    httpRequest.cache = 'no-store'\n  }\n\n  //    24. If httpRequest’s cache mode is neither \"no-store\" nor \"reload\",\n  //    then:\n  if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {\n    // TODO: cache\n  }\n\n  // 9. If aborted, then return the appropriate network error for fetchParams.\n  // TODO\n\n  // 10. If response is null, then:\n  if (response == null) {\n    // 1. If httpRequest’s cache mode is \"only-if-cached\", then return a\n    // network error.\n    if (httpRequest.cache === 'only-if-cached') {\n      return makeNetworkError('only if cached')\n    }\n\n    // 2. Let forwardResponse be the result of running HTTP-network fetch\n    // given httpFetchParams, includeCredentials, and isNewConnectionFetch.\n    const forwardResponse = await httpNetworkFetch(\n      httpFetchParams,\n      includeCredentials,\n      isNewConnectionFetch\n    )\n\n    // 3. If httpRequest’s method is unsafe and forwardResponse’s status is\n    // in the range 200 to 399, inclusive, invalidate appropriate stored\n    // responses in httpCache, as per the \"Invalidation\" chapter of HTTP\n    // Caching, and set storedResponse to null. [HTTP-CACHING]\n    if (\n      !safeMethodsSet.has(httpRequest.method) &&\n      forwardResponse.status >= 200 &&\n      forwardResponse.status <= 399\n    ) {\n      // TODO: cache\n    }\n\n    // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,\n    // then:\n    if (revalidatingFlag && forwardResponse.status === 304) {\n      // TODO: cache\n    }\n\n    // 5. If response is null, then:\n    if (response == null) {\n      // 1. Set response to forwardResponse.\n      response = forwardResponse\n\n      // 2. Store httpRequest and forwardResponse in httpCache, as per the\n      // \"Storing Responses in Caches\" chapter of HTTP Caching. [HTTP-CACHING]\n      // TODO: cache\n    }\n  }\n\n  // 11. Set response’s URL list to a clone of httpRequest’s URL list.\n  response.urlList = [...httpRequest.urlList]\n\n  // 12. If httpRequest’s header list contains `Range`, then set response’s\n  // range-requested flag.\n  if (httpRequest.headersList.contains('range', true)) {\n    response.rangeRequested = true\n  }\n\n  // 13. Set response’s request-includes-credentials to includeCredentials.\n  response.requestIncludesCredentials = includeCredentials\n\n  // 14. If response’s status is 401, httpRequest’s response tainting is not\n  // \"cors\", includeCredentials is true, and request’s window is an environment\n  // settings object, then:\n  // TODO\n\n  // 15. If response’s status is 407, then:\n  if (response.status === 407) {\n    // 1. If request’s window is \"no-window\", then return a network error.\n    if (request.window === 'no-window') {\n      return makeNetworkError()\n    }\n\n    // 2. ???\n\n    // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n    if (isCancelled(fetchParams)) {\n      return makeAppropriateNetworkError(fetchParams)\n    }\n\n    // 4. Prompt the end user as appropriate in request’s window and store\n    // the result as a proxy-authentication entry. [HTTP-AUTH]\n    // TODO: Invoke some kind of callback?\n\n    // 5. Set response to the result of running HTTP-network-or-cache fetch given\n    // fetchParams.\n    // TODO\n    return makeNetworkError('proxy authentication required')\n  }\n\n  // 16. If all of the following are true\n  if (\n    // response’s status is 421\n    response.status === 421 &&\n    // isNewConnectionFetch is false\n    !isNewConnectionFetch &&\n    // request’s body is null, or request’s body is non-null and request’s body’s source is non-null\n    (request.body == null || request.body.source != null)\n  ) {\n    // then:\n\n    // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n    if (isCancelled(fetchParams)) {\n      return makeAppropriateNetworkError(fetchParams)\n    }\n\n    // 2. Set response to the result of running HTTP-network-or-cache\n    // fetch given fetchParams, isAuthenticationFetch, and true.\n\n    // TODO (spec): The spec doesn't specify this but we need to cancel\n    // the active response before we can start a new one.\n    // https://github.com/whatwg/fetch/issues/1293\n    fetchParams.controller.connection.destroy()\n\n    response = await httpNetworkOrCacheFetch(\n      fetchParams,\n      isAuthenticationFetch,\n      true\n    )\n  }\n\n  // 17. If isAuthenticationFetch is true, then create an authentication entry\n  if (isAuthenticationFetch) {\n    // TODO\n  }\n\n  // 18. Return response.\n  return response\n}\n\n// https://fetch.spec.whatwg.org/#http-network-fetch\nasync function httpNetworkFetch (\n  fetchParams,\n  includeCredentials = false,\n  forceNewConnection = false\n) {\n  assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)\n\n  fetchParams.controller.connection = {\n    abort: null,\n    destroyed: false,\n    destroy (err, abort = true) {\n      if (!this.destroyed) {\n        this.destroyed = true\n        if (abort) {\n          this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))\n        }\n      }\n    }\n  }\n\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 4. Let httpCache be the result of determining the HTTP cache partition,\n  // given request.\n  // TODO: cache\n  const httpCache = null\n\n  // 5. If httpCache is null, then set request’s cache mode to \"no-store\".\n  if (httpCache == null) {\n    request.cache = 'no-store'\n  }\n\n  // 6. Let networkPartitionKey be the result of determining the network\n  // partition key given request.\n  // TODO\n\n  // 7. Let newConnection be \"yes\" if forceNewConnection is true; otherwise\n  // \"no\".\n  const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars\n\n  // 8. Switch on request’s mode:\n  if (request.mode === 'websocket') {\n    // Let connection be the result of obtaining a WebSocket connection,\n    // given request’s current URL.\n    // TODO\n  } else {\n    // Let connection be the result of obtaining a connection, given\n    // networkPartitionKey, request’s current URL’s origin,\n    // includeCredentials, and forceNewConnection.\n    // TODO\n  }\n\n  // 9. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. If connection is failure, then return a network error.\n\n  //    2. Set timingInfo’s final connection timing info to the result of\n  //    calling clamp and coarsen connection timing info with connection’s\n  //    timing info, timingInfo’s post-redirect start time, and fetchParams’s\n  //    cross-origin isolated capability.\n\n  //    3. If connection is not an HTTP/2 connection, request’s body is non-null,\n  //    and request’s body’s source is null, then append (`Transfer-Encoding`,\n  //    `chunked`) to request’s header list.\n\n  //    4. Set timingInfo’s final network-request start time to the coarsened\n  //    shared current time given fetchParams’s cross-origin isolated\n  //    capability.\n\n  //    5. Set response to the result of making an HTTP request over connection\n  //    using request with the following caveats:\n\n  //        - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]\n  //        [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]\n\n  //        - If request’s body is non-null, and request’s body’s source is null,\n  //        then the user agent may have a buffer of up to 64 kibibytes and store\n  //        a part of request’s body in that buffer. If the user agent reads from\n  //        request’s body beyond that buffer’s size and the user agent needs to\n  //        resend request, then instead return a network error.\n\n  //        - Set timingInfo’s final network-response start time to the coarsened\n  //        shared current time given fetchParams’s cross-origin isolated capability,\n  //        immediately after the user agent’s HTTP parser receives the first byte\n  //        of the response (e.g., frame header bytes for HTTP/2 or response status\n  //        line for HTTP/1.x).\n\n  //        - Wait until all the headers are transmitted.\n\n  //        - Any responses whose status is in the range 100 to 199, inclusive,\n  //        and is not 101, are to be ignored, except for the purposes of setting\n  //        timingInfo’s final network-response start time above.\n\n  //    - If request’s header list contains `Transfer-Encoding`/`chunked` and\n  //    response is transferred via HTTP/1.0 or older, then return a network\n  //    error.\n\n  //    - If the HTTP request results in a TLS client certificate dialog, then:\n\n  //        1. If request’s window is an environment settings object, make the\n  //        dialog available in request’s window.\n\n  //        2. Otherwise, return a network error.\n\n  // To transmit request’s body body, run these steps:\n  let requestBody = null\n  // 1. If body is null and fetchParams’s process request end-of-body is\n  // non-null, then queue a fetch task given fetchParams’s process request\n  // end-of-body and fetchParams’s task destination.\n  if (request.body == null && fetchParams.processRequestEndOfBody) {\n    queueMicrotask(() => fetchParams.processRequestEndOfBody())\n  } else if (request.body != null) {\n    // 2. Otherwise, if body is non-null:\n\n    //    1. Let processBodyChunk given bytes be these steps:\n    const processBodyChunk = async function * (bytes) {\n      // 1. If the ongoing fetch is terminated, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. Run this step in parallel: transmit bytes.\n      yield bytes\n\n      // 3. If fetchParams’s process request body is non-null, then run\n      // fetchParams’s process request body given bytes’s length.\n      fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)\n    }\n\n    // 2. Let processEndOfBody be these steps:\n    const processEndOfBody = () => {\n      // 1. If fetchParams is canceled, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. If fetchParams’s process request end-of-body is non-null,\n      // then run fetchParams’s process request end-of-body.\n      if (fetchParams.processRequestEndOfBody) {\n        fetchParams.processRequestEndOfBody()\n      }\n    }\n\n    // 3. Let processBodyError given e be these steps:\n    const processBodyError = (e) => {\n      // 1. If fetchParams is canceled, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. If e is an \"AbortError\" DOMException, then abort fetchParams’s controller.\n      if (e.name === 'AbortError') {\n        fetchParams.controller.abort()\n      } else {\n        fetchParams.controller.terminate(e)\n      }\n    }\n\n    // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,\n    // processBodyError, and fetchParams’s task destination.\n    requestBody = (async function * () {\n      try {\n        for await (const bytes of request.body.stream) {\n          yield * processBodyChunk(bytes)\n        }\n        processEndOfBody()\n      } catch (err) {\n        processBodyError(err)\n      }\n    })()\n  }\n\n  try {\n    // socket is only provided for websockets\n    const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })\n\n    if (socket) {\n      response = makeResponse({ status, statusText, headersList, socket })\n    } else {\n      const iterator = body[Symbol.asyncIterator]()\n      fetchParams.controller.next = () => iterator.next()\n\n      response = makeResponse({ status, statusText, headersList })\n    }\n  } catch (err) {\n    // 10. If aborted, then:\n    if (err.name === 'AbortError') {\n      // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n      fetchParams.controller.connection.destroy()\n\n      // 2. Return the appropriate network error for fetchParams.\n      return makeAppropriateNetworkError(fetchParams, err)\n    }\n\n    return makeNetworkError(err)\n  }\n\n  // 11. Let pullAlgorithm be an action that resumes the ongoing fetch\n  // if it is suspended.\n  const pullAlgorithm = async () => {\n    await fetchParams.controller.resume()\n  }\n\n  // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s\n  // controller with reason, given reason.\n  const cancelAlgorithm = (reason) => {\n    // If the aborted fetch was already terminated, then we do not\n    // need to do anything.\n    if (!isCancelled(fetchParams)) {\n      fetchParams.controller.abort(reason)\n    }\n  }\n\n  // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by\n  // the user agent.\n  // TODO\n\n  // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object\n  // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.\n  // TODO\n\n  // 15. Let stream be a new ReadableStream.\n  // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm,\n  //     cancelAlgorithm set to cancelAlgorithm.\n  const stream = new ReadableStream(\n    {\n      async start (controller) {\n        fetchParams.controller.controller = controller\n      },\n      async pull (controller) {\n        await pullAlgorithm(controller)\n      },\n      async cancel (reason) {\n        await cancelAlgorithm(reason)\n      },\n      type: 'bytes'\n    }\n  )\n\n  // 17. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. Set response’s body to a new body whose stream is stream.\n  response.body = { stream, source: null, length: null }\n\n  //    2. If response is not a network error and request’s cache mode is\n  //    not \"no-store\", then update response in httpCache for request.\n  //    TODO\n\n  //    3. If includeCredentials is true and the user agent is not configured\n  //    to block cookies for request (see section 7 of [COOKIES]), then run the\n  //    \"set-cookie-string\" parsing algorithm (see section 5.2 of [COOKIES]) on\n  //    the value of each header whose name is a byte-case-insensitive match for\n  //    `Set-Cookie` in response’s header list, if any, and request’s current URL.\n  //    TODO\n\n  // 18. If aborted, then:\n  // TODO\n\n  // 19. Run these steps in parallel:\n\n  //    1. Run these steps, but abort when fetchParams is canceled:\n  fetchParams.controller.onAborted = onAborted\n  fetchParams.controller.on('terminated', onAborted)\n  fetchParams.controller.resume = async () => {\n    // 1. While true\n    while (true) {\n      // 1-3. See onData...\n\n      // 4. Set bytes to the result of handling content codings given\n      // codings and bytes.\n      let bytes\n      let isFailure\n      try {\n        const { done, value } = await fetchParams.controller.next()\n\n        if (isAborted(fetchParams)) {\n          break\n        }\n\n        bytes = done ? undefined : value\n      } catch (err) {\n        if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n          // zlib doesn't like empty streams.\n          bytes = undefined\n        } else {\n          bytes = err\n\n          // err may be propagated from the result of calling readablestream.cancel,\n          // which might not be an error. https://github.com/nodejs/undici/issues/2009\n          isFailure = true\n        }\n      }\n\n      if (bytes === undefined) {\n        // 2. Otherwise, if the bytes transmission for response’s message\n        // body is done normally and stream is readable, then close\n        // stream, finalize response for fetchParams and response, and\n        // abort these in-parallel steps.\n        readableStreamClose(fetchParams.controller.controller)\n\n        finalizeResponse(fetchParams, response)\n\n        return\n      }\n\n      // 5. Increase timingInfo’s decoded body size by bytes’s length.\n      timingInfo.decodedBodySize += bytes?.byteLength ?? 0\n\n      // 6. If bytes is failure, then terminate fetchParams’s controller.\n      if (isFailure) {\n        fetchParams.controller.terminate(bytes)\n        return\n      }\n\n      // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes\n      // into stream.\n      const buffer = new Uint8Array(bytes)\n      if (buffer.byteLength) {\n        fetchParams.controller.controller.enqueue(buffer)\n      }\n\n      // 8. If stream is errored, then terminate the ongoing fetch.\n      if (isErrored(stream)) {\n        fetchParams.controller.terminate()\n        return\n      }\n\n      // 9. If stream doesn’t need more data ask the user agent to suspend\n      // the ongoing fetch.\n      if (fetchParams.controller.controller.desiredSize <= 0) {\n        return\n      }\n    }\n  }\n\n  //    2. If aborted, then:\n  function onAborted (reason) {\n    // 2. If fetchParams is aborted, then:\n    if (isAborted(fetchParams)) {\n      // 1. Set response’s aborted flag.\n      response.aborted = true\n\n      // 2. If stream is readable, then error stream with the result of\n      //    deserialize a serialized abort reason given fetchParams’s\n      //    controller’s serialized abort reason and an\n      //    implementation-defined realm.\n      if (isReadable(stream)) {\n        fetchParams.controller.controller.error(\n          fetchParams.controller.serializedAbortReason\n        )\n      }\n    } else {\n      // 3. Otherwise, if stream is readable, error stream with a TypeError.\n      if (isReadable(stream)) {\n        fetchParams.controller.controller.error(new TypeError('terminated', {\n          cause: isErrorLike(reason) ? reason : undefined\n        }))\n      }\n    }\n\n    // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n    // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.\n    fetchParams.controller.connection.destroy()\n  }\n\n  // 20. Return response.\n  return response\n\n  function dispatch ({ body }) {\n    const url = requestCurrentURL(request)\n    /** @type {import('../..').Agent} */\n    const agent = fetchParams.controller.dispatcher\n\n    return new Promise((resolve, reject) => agent.dispatch(\n      {\n        path: url.pathname + url.search,\n        origin: url.origin,\n        method: request.method,\n        body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,\n        headers: request.headersList.entries,\n        maxRedirections: 0,\n        upgrade: request.mode === 'websocket' ? 'websocket' : undefined\n      },\n      {\n        body: null,\n        abort: null,\n\n        onConnect (abort) {\n          // TODO (fix): Do we need connection here?\n          const { connection } = fetchParams.controller\n\n          // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen\n          // connection timing info with connection’s timing info, timingInfo’s post-redirect start\n          // time, and fetchParams’s cross-origin isolated capability.\n          // TODO: implement connection timing\n          timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)\n\n          if (connection.destroyed) {\n            abort(new DOMException('The operation was aborted.', 'AbortError'))\n          } else {\n            fetchParams.controller.on('terminated', abort)\n            this.abort = connection.abort = abort\n          }\n\n          // Set timingInfo’s final network-request start time to the coarsened shared current time given\n          // fetchParams’s cross-origin isolated capability.\n          timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n        },\n\n        onResponseStarted () {\n          // Set timingInfo’s final network-response start time to the coarsened shared current\n          // time given fetchParams’s cross-origin isolated capability, immediately after the\n          // user agent’s HTTP parser receives the first byte of the response (e.g., frame header\n          // bytes for HTTP/2 or response status line for HTTP/1.x).\n          timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n        },\n\n        onHeaders (status, rawHeaders, resume, statusText) {\n          if (status < 200) {\n            return\n          }\n\n          let location = ''\n\n          const headersList = new HeadersList()\n\n          for (let i = 0; i < rawHeaders.length; i += 2) {\n            headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n          }\n          location = headersList.get('location', true)\n\n          this.body = new Readable({ read: resume })\n\n          const decoders = []\n\n          const willFollow = location && request.redirect === 'follow' &&\n            redirectStatusSet.has(status)\n\n          // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding\n          if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {\n            // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n            const contentEncoding = headersList.get('content-encoding', true)\n            // \"All content-coding values are case-insensitive...\"\n            /** @type {string[]} */\n            const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []\n\n            // Limit the number of content-encodings to prevent resource exhaustion.\n            // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).\n            const maxContentEncodings = 5\n            if (codings.length > maxContentEncodings) {\n              reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))\n              return true\n            }\n\n            for (let i = codings.length - 1; i >= 0; --i) {\n              const coding = codings[i].trim()\n              // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2\n              if (coding === 'x-gzip' || coding === 'gzip') {\n                decoders.push(zlib.createGunzip({\n                  // Be less strict when decoding compressed responses, since sometimes\n                  // servers send slightly invalid responses that are still accepted\n                  // by common browsers.\n                  // Always using Z_SYNC_FLUSH is what cURL does.\n                  flush: zlib.constants.Z_SYNC_FLUSH,\n                  finishFlush: zlib.constants.Z_SYNC_FLUSH\n                }))\n              } else if (coding === 'deflate') {\n                decoders.push(createInflate({\n                  flush: zlib.constants.Z_SYNC_FLUSH,\n                  finishFlush: zlib.constants.Z_SYNC_FLUSH\n                }))\n              } else if (coding === 'br') {\n                decoders.push(zlib.createBrotliDecompress({\n                  flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n                  finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n                }))\n              } else {\n                decoders.length = 0\n                break\n              }\n            }\n          }\n\n          const onError = this.onError.bind(this)\n\n          resolve({\n            status,\n            statusText,\n            headersList,\n            body: decoders.length\n              ? pipeline(this.body, ...decoders, (err) => {\n                if (err) {\n                  this.onError(err)\n                }\n              }).on('error', onError)\n              : this.body.on('error', onError)\n          })\n\n          return true\n        },\n\n        onData (chunk) {\n          if (fetchParams.controller.dump) {\n            return\n          }\n\n          // 1. If one or more bytes have been transmitted from response’s\n          // message body, then:\n\n          //  1. Let bytes be the transmitted bytes.\n          const bytes = chunk\n\n          //  2. Let codings be the result of extracting header list values\n          //  given `Content-Encoding` and response’s header list.\n          //  See pullAlgorithm.\n\n          //  3. Increase timingInfo’s encoded body size by bytes’s length.\n          timingInfo.encodedBodySize += bytes.byteLength\n\n          //  4. See pullAlgorithm...\n\n          return this.body.push(bytes)\n        },\n\n        onComplete () {\n          if (this.abort) {\n            fetchParams.controller.off('terminated', this.abort)\n          }\n\n          if (fetchParams.controller.onAborted) {\n            fetchParams.controller.off('terminated', fetchParams.controller.onAborted)\n          }\n\n          fetchParams.controller.ended = true\n\n          this.body.push(null)\n        },\n\n        onError (error) {\n          if (this.abort) {\n            fetchParams.controller.off('terminated', this.abort)\n          }\n\n          this.body?.destroy(error)\n\n          fetchParams.controller.terminate(error)\n\n          reject(error)\n        },\n\n        onUpgrade (status, rawHeaders, socket) {\n          if (status !== 101) {\n            return\n          }\n\n          const headersList = new HeadersList()\n\n          for (let i = 0; i < rawHeaders.length; i += 2) {\n            headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n          }\n\n          resolve({\n            status,\n            statusText: STATUS_CODES[status],\n            headersList,\n            socket\n          })\n\n          return true\n        }\n      }\n    ))\n  }\n}\n\nmodule.exports = {\n  fetch,\n  Fetch,\n  fetching,\n  finalizeAndReportTiming\n}\n","/* globals AbortController */\n\n'use strict'\n\nconst { extractBody, mixinBody, cloneBody, bodyUnusable } = require('./body')\nconst { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require('./headers')\nconst { FinalizationRegistry } = require('./dispatcher-weakref')()\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst {\n  isValidHTTPToken,\n  sameOrigin,\n  environmentSettingsObject\n} = require('./util')\nconst {\n  forbiddenMethodsSet,\n  corsSafeListedMethodsSet,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  requestDuplex\n} = require('./constants')\nconst { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util\nconst { kHeaders, kSignal, kState, kDispatcher } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('node:events')\n\nconst kAbortController = Symbol('abortController')\n\nconst requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n  signal.removeEventListener('abort', abort)\n})\n\nconst dependentControllerMap = new WeakMap()\n\nfunction buildAbort (acRef) {\n  return abort\n\n  function abort () {\n    const ac = acRef.deref()\n    if (ac !== undefined) {\n      // Currently, there is a problem with FinalizationRegistry.\n      // https://github.com/nodejs/node/issues/49344\n      // https://github.com/nodejs/node/issues/47748\n      // In the case of abort, the first step is to unregister from it.\n      // If the controller can refer to it, it is still registered.\n      // It will be removed in the future.\n      requestFinalizer.unregister(abort)\n\n      // Unsubscribe a listener.\n      // FinalizationRegistry will no longer be called, so this must be done.\n      this.removeEventListener('abort', abort)\n\n      ac.abort(this.reason)\n\n      const controllerList = dependentControllerMap.get(ac.signal)\n\n      if (controllerList !== undefined) {\n        if (controllerList.size !== 0) {\n          for (const ref of controllerList) {\n            const ctrl = ref.deref()\n            if (ctrl !== undefined) {\n              ctrl.abort(this.reason)\n            }\n          }\n          controllerList.clear()\n        }\n        dependentControllerMap.delete(ac.signal)\n      }\n    }\n  }\n}\n\nlet patchMethodWarning = false\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request {\n  // https://fetch.spec.whatwg.org/#dom-request\n  constructor (input, init = {}) {\n    webidl.util.markAsUncloneable(this)\n    if (input === kConstruct) {\n      return\n    }\n\n    const prefix = 'Request constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    input = webidl.converters.RequestInfo(input, prefix, 'input')\n    init = webidl.converters.RequestInit(init, prefix, 'init')\n\n    // 1. Let request be null.\n    let request = null\n\n    // 2. Let fallbackMode be null.\n    let fallbackMode = null\n\n    // 3. Let baseURL be this’s relevant settings object’s API base URL.\n    const baseUrl = environmentSettingsObject.settingsObject.baseUrl\n\n    // 4. Let signal be null.\n    let signal = null\n\n    // 5. If input is a string, then:\n    if (typeof input === 'string') {\n      this[kDispatcher] = init.dispatcher\n\n      // 1. Let parsedURL be the result of parsing input with baseURL.\n      // 2. If parsedURL is failure, then throw a TypeError.\n      let parsedURL\n      try {\n        parsedURL = new URL(input, baseUrl)\n      } catch (err) {\n        throw new TypeError('Failed to parse URL from ' + input, { cause: err })\n      }\n\n      // 3. If parsedURL includes credentials, then throw a TypeError.\n      if (parsedURL.username || parsedURL.password) {\n        throw new TypeError(\n          'Request cannot be constructed from a URL that includes credentials: ' +\n            input\n        )\n      }\n\n      // 4. Set request to a new request whose URL is parsedURL.\n      request = makeRequest({ urlList: [parsedURL] })\n\n      // 5. Set fallbackMode to \"cors\".\n      fallbackMode = 'cors'\n    } else {\n      this[kDispatcher] = init.dispatcher || input[kDispatcher]\n\n      // 6. Otherwise:\n\n      // 7. Assert: input is a Request object.\n      assert(input instanceof Request)\n\n      // 8. Set request to input’s request.\n      request = input[kState]\n\n      // 9. Set signal to input’s signal.\n      signal = input[kSignal]\n    }\n\n    // 7. Let origin be this’s relevant settings object’s origin.\n    const origin = environmentSettingsObject.settingsObject.origin\n\n    // 8. Let window be \"client\".\n    let window = 'client'\n\n    // 9. If request’s window is an environment settings object and its origin\n    // is same origin with origin, then set window to request’s window.\n    if (\n      request.window?.constructor?.name === 'EnvironmentSettingsObject' &&\n      sameOrigin(request.window, origin)\n    ) {\n      window = request.window\n    }\n\n    // 10. If init[\"window\"] exists and is non-null, then throw a TypeError.\n    if (init.window != null) {\n      throw new TypeError(`'window' option '${window}' must be null`)\n    }\n\n    // 11. If init[\"window\"] exists, then set window to \"no-window\".\n    if ('window' in init) {\n      window = 'no-window'\n    }\n\n    // 12. Set request to a new request with the following properties:\n    request = makeRequest({\n      // URL request’s URL.\n      // undici implementation note: this is set as the first item in request's urlList in makeRequest\n      // method request’s method.\n      method: request.method,\n      // header list A copy of request’s header list.\n      // undici implementation note: headersList is cloned in makeRequest\n      headersList: request.headersList,\n      // unsafe-request flag Set.\n      unsafeRequest: request.unsafeRequest,\n      // client This’s relevant settings object.\n      client: environmentSettingsObject.settingsObject,\n      // window window.\n      window,\n      // priority request’s priority.\n      priority: request.priority,\n      // origin request’s origin. The propagation of the origin is only significant for navigation requests\n      // being handled by a service worker. In this scenario a request can have an origin that is different\n      // from the current client.\n      origin: request.origin,\n      // referrer request’s referrer.\n      referrer: request.referrer,\n      // referrer policy request’s referrer policy.\n      referrerPolicy: request.referrerPolicy,\n      // mode request’s mode.\n      mode: request.mode,\n      // credentials mode request’s credentials mode.\n      credentials: request.credentials,\n      // cache mode request’s cache mode.\n      cache: request.cache,\n      // redirect mode request’s redirect mode.\n      redirect: request.redirect,\n      // integrity metadata request’s integrity metadata.\n      integrity: request.integrity,\n      // keepalive request’s keepalive.\n      keepalive: request.keepalive,\n      // reload-navigation flag request’s reload-navigation flag.\n      reloadNavigation: request.reloadNavigation,\n      // history-navigation flag request’s history-navigation flag.\n      historyNavigation: request.historyNavigation,\n      // URL list A clone of request’s URL list.\n      urlList: [...request.urlList]\n    })\n\n    const initHasKey = Object.keys(init).length !== 0\n\n    // 13. If init is not empty, then:\n    if (initHasKey) {\n      // 1. If request’s mode is \"navigate\", then set it to \"same-origin\".\n      if (request.mode === 'navigate') {\n        request.mode = 'same-origin'\n      }\n\n      // 2. Unset request’s reload-navigation flag.\n      request.reloadNavigation = false\n\n      // 3. Unset request’s history-navigation flag.\n      request.historyNavigation = false\n\n      // 4. Set request’s origin to \"client\".\n      request.origin = 'client'\n\n      // 5. Set request’s referrer to \"client\"\n      request.referrer = 'client'\n\n      // 6. Set request’s referrer policy to the empty string.\n      request.referrerPolicy = ''\n\n      // 7. Set request’s URL to request’s current URL.\n      request.url = request.urlList[request.urlList.length - 1]\n\n      // 8. Set request’s URL list to « request’s URL ».\n      request.urlList = [request.url]\n    }\n\n    // 14. If init[\"referrer\"] exists, then:\n    if (init.referrer !== undefined) {\n      // 1. Let referrer be init[\"referrer\"].\n      const referrer = init.referrer\n\n      // 2. If referrer is the empty string, then set request’s referrer to \"no-referrer\".\n      if (referrer === '') {\n        request.referrer = 'no-referrer'\n      } else {\n        // 1. Let parsedReferrer be the result of parsing referrer with\n        // baseURL.\n        // 2. If parsedReferrer is failure, then throw a TypeError.\n        let parsedReferrer\n        try {\n          parsedReferrer = new URL(referrer, baseUrl)\n        } catch (err) {\n          throw new TypeError(`Referrer \"${referrer}\" is not a valid URL.`, { cause: err })\n        }\n\n        // 3. If one of the following is true\n        // - parsedReferrer’s scheme is \"about\" and path is the string \"client\"\n        // - parsedReferrer’s origin is not same origin with origin\n        // then set request’s referrer to \"client\".\n        if (\n          (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||\n          (origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl))\n        ) {\n          request.referrer = 'client'\n        } else {\n          // 4. Otherwise, set request’s referrer to parsedReferrer.\n          request.referrer = parsedReferrer\n        }\n      }\n    }\n\n    // 15. If init[\"referrerPolicy\"] exists, then set request’s referrer policy\n    // to it.\n    if (init.referrerPolicy !== undefined) {\n      request.referrerPolicy = init.referrerPolicy\n    }\n\n    // 16. Let mode be init[\"mode\"] if it exists, and fallbackMode otherwise.\n    let mode\n    if (init.mode !== undefined) {\n      mode = init.mode\n    } else {\n      mode = fallbackMode\n    }\n\n    // 17. If mode is \"navigate\", then throw a TypeError.\n    if (mode === 'navigate') {\n      throw webidl.errors.exception({\n        header: 'Request constructor',\n        message: 'invalid request mode navigate.'\n      })\n    }\n\n    // 18. If mode is non-null, set request’s mode to mode.\n    if (mode != null) {\n      request.mode = mode\n    }\n\n    // 19. If init[\"credentials\"] exists, then set request’s credentials mode\n    // to it.\n    if (init.credentials !== undefined) {\n      request.credentials = init.credentials\n    }\n\n    // 18. If init[\"cache\"] exists, then set request’s cache mode to it.\n    if (init.cache !== undefined) {\n      request.cache = init.cache\n    }\n\n    // 21. If request’s cache mode is \"only-if-cached\" and request’s mode is\n    // not \"same-origin\", then throw a TypeError.\n    if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {\n      throw new TypeError(\n        \"'only-if-cached' can be set only with 'same-origin' mode\"\n      )\n    }\n\n    // 22. If init[\"redirect\"] exists, then set request’s redirect mode to it.\n    if (init.redirect !== undefined) {\n      request.redirect = init.redirect\n    }\n\n    // 23. If init[\"integrity\"] exists, then set request’s integrity metadata to it.\n    if (init.integrity != null) {\n      request.integrity = String(init.integrity)\n    }\n\n    // 24. If init[\"keepalive\"] exists, then set request’s keepalive to it.\n    if (init.keepalive !== undefined) {\n      request.keepalive = Boolean(init.keepalive)\n    }\n\n    // 25. If init[\"method\"] exists, then:\n    if (init.method !== undefined) {\n      // 1. Let method be init[\"method\"].\n      let method = init.method\n\n      const mayBeNormalized = normalizedMethodRecords[method]\n\n      if (mayBeNormalized !== undefined) {\n        // Note: Bypass validation DELETE, GET, HEAD, OPTIONS, POST, PUT, PATCH and these lowercase ones\n        request.method = mayBeNormalized\n      } else {\n        // 2. If method is not a method or method is a forbidden method, then\n        // throw a TypeError.\n        if (!isValidHTTPToken(method)) {\n          throw new TypeError(`'${method}' is not a valid HTTP method.`)\n        }\n\n        const upperCase = method.toUpperCase()\n\n        if (forbiddenMethodsSet.has(upperCase)) {\n          throw new TypeError(`'${method}' HTTP method is unsupported.`)\n        }\n\n        // 3. Normalize method.\n        // https://fetch.spec.whatwg.org/#concept-method-normalize\n        // Note: must be in uppercase\n        method = normalizedMethodRecordsBase[upperCase] ?? method\n\n        // 4. Set request’s method to method.\n        request.method = method\n      }\n\n      if (!patchMethodWarning && request.method === 'patch') {\n        process.emitWarning('Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.', {\n          code: 'UNDICI-FETCH-patch'\n        })\n\n        patchMethodWarning = true\n      }\n    }\n\n    // 26. If init[\"signal\"] exists, then set signal to it.\n    if (init.signal !== undefined) {\n      signal = init.signal\n    }\n\n    // 27. Set this’s request to request.\n    this[kState] = request\n\n    // 28. Set this’s signal to a new AbortSignal object with this’s relevant\n    // Realm.\n    // TODO: could this be simplified with AbortSignal.any\n    // (https://dom.spec.whatwg.org/#dom-abortsignal-any)\n    const ac = new AbortController()\n    this[kSignal] = ac.signal\n\n    // 29. If signal is not null, then make this’s signal follow signal.\n    if (signal != null) {\n      if (\n        !signal ||\n        typeof signal.aborted !== 'boolean' ||\n        typeof signal.addEventListener !== 'function'\n      ) {\n        throw new TypeError(\n          \"Failed to construct 'Request': member signal is not of type AbortSignal.\"\n        )\n      }\n\n      if (signal.aborted) {\n        ac.abort(signal.reason)\n      } else {\n        // Keep a strong ref to ac while request object\n        // is alive. This is needed to prevent AbortController\n        // from being prematurely garbage collected.\n        // See, https://github.com/nodejs/undici/issues/1926.\n        this[kAbortController] = ac\n\n        const acRef = new WeakRef(ac)\n        const abort = buildAbort(acRef)\n\n        // Third-party AbortControllers may not work with these.\n        // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.\n        try {\n          // If the max amount of listeners is equal to the default, increase it\n          // This is only available in node >= v19.9.0\n          if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {\n            setMaxListeners(1500, signal)\n          } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {\n            setMaxListeners(1500, signal)\n          }\n        } catch {}\n\n        util.addAbortListener(signal, abort)\n        // The third argument must be a registry key to be unregistered.\n        // Without it, you cannot unregister.\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n        // abort is used as the unregister key. (because it is unique)\n        requestFinalizer.register(ac, { signal, abort }, abort)\n      }\n    }\n\n    // 30. Set this’s headers to a new Headers object with this’s relevant\n    // Realm, whose header list is request’s header list and guard is\n    // \"request\".\n    this[kHeaders] = new Headers(kConstruct)\n    setHeadersList(this[kHeaders], request.headersList)\n    setHeadersGuard(this[kHeaders], 'request')\n\n    // 31. If this’s request’s mode is \"no-cors\", then:\n    if (mode === 'no-cors') {\n      // 1. If this’s request’s method is not a CORS-safelisted method,\n      // then throw a TypeError.\n      if (!corsSafeListedMethodsSet.has(request.method)) {\n        throw new TypeError(\n          `'${request.method} is unsupported in no-cors mode.`\n        )\n      }\n\n      // 2. Set this’s headers’s guard to \"request-no-cors\".\n      setHeadersGuard(this[kHeaders], 'request-no-cors')\n    }\n\n    // 32. If init is not empty, then:\n    if (initHasKey) {\n      /** @type {HeadersList} */\n      const headersList = getHeadersList(this[kHeaders])\n      // 1. Let headers be a copy of this’s headers and its associated header\n      // list.\n      // 2. If init[\"headers\"] exists, then set headers to init[\"headers\"].\n      const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)\n\n      // 3. Empty this’s headers’s header list.\n      headersList.clear()\n\n      // 4. If headers is a Headers object, then for each header in its header\n      // list, append header’s name/header’s value to this’s headers.\n      if (headers instanceof HeadersList) {\n        for (const { name, value } of headers.rawValues()) {\n          headersList.append(name, value, false)\n        }\n        // Note: Copy the `set-cookie` meta-data.\n        headersList.cookies = headers.cookies\n      } else {\n        // 5. Otherwise, fill this’s headers with headers.\n        fillHeaders(this[kHeaders], headers)\n      }\n    }\n\n    // 33. Let inputBody be input’s request’s body if input is a Request\n    // object; otherwise null.\n    const inputBody = input instanceof Request ? input[kState].body : null\n\n    // 34. If either init[\"body\"] exists and is non-null or inputBody is\n    // non-null, and request’s method is `GET` or `HEAD`, then throw a\n    // TypeError.\n    if (\n      (init.body != null || inputBody != null) &&\n      (request.method === 'GET' || request.method === 'HEAD')\n    ) {\n      throw new TypeError('Request with GET/HEAD method cannot have body.')\n    }\n\n    // 35. Let initBody be null.\n    let initBody = null\n\n    // 36. If init[\"body\"] exists and is non-null, then:\n    if (init.body != null) {\n      // 1. Let Content-Type be null.\n      // 2. Set initBody and Content-Type to the result of extracting\n      // init[\"body\"], with keepalive set to request’s keepalive.\n      const [extractedBody, contentType] = extractBody(\n        init.body,\n        request.keepalive\n      )\n      initBody = extractedBody\n\n      // 3, If Content-Type is non-null and this’s headers’s header list does\n      // not contain `Content-Type`, then append `Content-Type`/Content-Type to\n      // this’s headers.\n      if (contentType && !getHeadersList(this[kHeaders]).contains('content-type', true)) {\n        this[kHeaders].append('content-type', contentType)\n      }\n    }\n\n    // 37. Let inputOrInitBody be initBody if it is non-null; otherwise\n    // inputBody.\n    const inputOrInitBody = initBody ?? inputBody\n\n    // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is\n    // null, then:\n    if (inputOrInitBody != null && inputOrInitBody.source == null) {\n      // 1. If initBody is non-null and init[\"duplex\"] does not exist,\n      //    then throw a TypeError.\n      if (initBody != null && init.duplex == null) {\n        throw new TypeError('RequestInit: duplex option is required when sending a body.')\n      }\n\n      // 2. If this’s request’s mode is neither \"same-origin\" nor \"cors\",\n      // then throw a TypeError.\n      if (request.mode !== 'same-origin' && request.mode !== 'cors') {\n        throw new TypeError(\n          'If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"'\n        )\n      }\n\n      // 3. Set this’s request’s use-CORS-preflight flag.\n      request.useCORSPreflightFlag = true\n    }\n\n    // 39. Let finalBody be inputOrInitBody.\n    let finalBody = inputOrInitBody\n\n    // 40. If initBody is null and inputBody is non-null, then:\n    if (initBody == null && inputBody != null) {\n      // 1. If input is unusable, then throw a TypeError.\n      if (bodyUnusable(input)) {\n        throw new TypeError(\n          'Cannot construct a Request with a Request object that has already been used.'\n        )\n      }\n\n      // 2. Set finalBody to the result of creating a proxy for inputBody.\n      // https://streams.spec.whatwg.org/#readablestream-create-a-proxy\n      const identityTransform = new TransformStream()\n      inputBody.stream.pipeThrough(identityTransform)\n      finalBody = {\n        source: inputBody.source,\n        length: inputBody.length,\n        stream: identityTransform.readable\n      }\n    }\n\n    // 41. Set this’s request’s body to finalBody.\n    this[kState].body = finalBody\n  }\n\n  // Returns request’s HTTP method, which is \"GET\" by default.\n  get method () {\n    webidl.brandCheck(this, Request)\n\n    // The method getter steps are to return this’s request’s method.\n    return this[kState].method\n  }\n\n  // Returns the URL of request as a string.\n  get url () {\n    webidl.brandCheck(this, Request)\n\n    // The url getter steps are to return this’s request’s URL, serialized.\n    return URLSerializer(this[kState].url)\n  }\n\n  // Returns a Headers object consisting of the headers associated with request.\n  // Note that headers added in the network layer by the user agent will not\n  // be accounted for in this object, e.g., the \"Host\" header.\n  get headers () {\n    webidl.brandCheck(this, Request)\n\n    // The headers getter steps are to return this’s headers.\n    return this[kHeaders]\n  }\n\n  // Returns the kind of resource requested by request, e.g., \"document\"\n  // or \"script\".\n  get destination () {\n    webidl.brandCheck(this, Request)\n\n    // The destination getter are to return this’s request’s destination.\n    return this[kState].destination\n  }\n\n  // Returns the referrer of request. Its value can be a same-origin URL if\n  // explicitly set in init, the empty string to indicate no referrer, and\n  // \"about:client\" when defaulting to the global’s default. This is used\n  // during fetching to determine the value of the `Referer` header of the\n  // request being made.\n  get referrer () {\n    webidl.brandCheck(this, Request)\n\n    // 1. If this’s request’s referrer is \"no-referrer\", then return the\n    // empty string.\n    if (this[kState].referrer === 'no-referrer') {\n      return ''\n    }\n\n    // 2. If this’s request’s referrer is \"client\", then return\n    // \"about:client\".\n    if (this[kState].referrer === 'client') {\n      return 'about:client'\n    }\n\n    // Return this’s request’s referrer, serialized.\n    return this[kState].referrer.toString()\n  }\n\n  // Returns the referrer policy associated with request.\n  // This is used during fetching to compute the value of the request’s\n  // referrer.\n  get referrerPolicy () {\n    webidl.brandCheck(this, Request)\n\n    // The referrerPolicy getter steps are to return this’s request’s referrer policy.\n    return this[kState].referrerPolicy\n  }\n\n  // Returns the mode associated with request, which is a string indicating\n  // whether the request will use CORS, or will be restricted to same-origin\n  // URLs.\n  get mode () {\n    webidl.brandCheck(this, Request)\n\n    // The mode getter steps are to return this’s request’s mode.\n    return this[kState].mode\n  }\n\n  // Returns the credentials mode associated with request,\n  // which is a string indicating whether credentials will be sent with the\n  // request always, never, or only when sent to a same-origin URL.\n  get credentials () {\n    // The credentials getter steps are to return this’s request’s credentials mode.\n    return this[kState].credentials\n  }\n\n  // Returns the cache mode associated with request,\n  // which is a string indicating how the request will\n  // interact with the browser’s cache when fetching.\n  get cache () {\n    webidl.brandCheck(this, Request)\n\n    // The cache getter steps are to return this’s request’s cache mode.\n    return this[kState].cache\n  }\n\n  // Returns the redirect mode associated with request,\n  // which is a string indicating how redirects for the\n  // request will be handled during fetching. A request\n  // will follow redirects by default.\n  get redirect () {\n    webidl.brandCheck(this, Request)\n\n    // The redirect getter steps are to return this’s request’s redirect mode.\n    return this[kState].redirect\n  }\n\n  // Returns request’s subresource integrity metadata, which is a\n  // cryptographic hash of the resource being fetched. Its value\n  // consists of multiple hashes separated by whitespace. [SRI]\n  get integrity () {\n    webidl.brandCheck(this, Request)\n\n    // The integrity getter steps are to return this’s request’s integrity\n    // metadata.\n    return this[kState].integrity\n  }\n\n  // Returns a boolean indicating whether or not request can outlive the\n  // global in which it was created.\n  get keepalive () {\n    webidl.brandCheck(this, Request)\n\n    // The keepalive getter steps are to return this’s request’s keepalive.\n    return this[kState].keepalive\n  }\n\n  // Returns a boolean indicating whether or not request is for a reload\n  // navigation.\n  get isReloadNavigation () {\n    webidl.brandCheck(this, Request)\n\n    // The isReloadNavigation getter steps are to return true if this’s\n    // request’s reload-navigation flag is set; otherwise false.\n    return this[kState].reloadNavigation\n  }\n\n  // Returns a boolean indicating whether or not request is for a history\n  // navigation (a.k.a. back-forward navigation).\n  get isHistoryNavigation () {\n    webidl.brandCheck(this, Request)\n\n    // The isHistoryNavigation getter steps are to return true if this’s request’s\n    // history-navigation flag is set; otherwise false.\n    return this[kState].historyNavigation\n  }\n\n  // Returns the signal associated with request, which is an AbortSignal\n  // object indicating whether or not request has been aborted, and its\n  // abort event handler.\n  get signal () {\n    webidl.brandCheck(this, Request)\n\n    // The signal getter steps are to return this’s signal.\n    return this[kSignal]\n  }\n\n  get body () {\n    webidl.brandCheck(this, Request)\n\n    return this[kState].body ? this[kState].body.stream : null\n  }\n\n  get bodyUsed () {\n    webidl.brandCheck(this, Request)\n\n    return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n  }\n\n  get duplex () {\n    webidl.brandCheck(this, Request)\n\n    return 'half'\n  }\n\n  // Returns a clone of request.\n  clone () {\n    webidl.brandCheck(this, Request)\n\n    // 1. If this is unusable, then throw a TypeError.\n    if (bodyUnusable(this)) {\n      throw new TypeError('unusable')\n    }\n\n    // 2. Let clonedRequest be the result of cloning this’s request.\n    const clonedRequest = cloneRequest(this[kState])\n\n    // 3. Let clonedRequestObject be the result of creating a Request object,\n    // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.\n    // 4. Make clonedRequestObject’s signal follow this’s signal.\n    const ac = new AbortController()\n    if (this.signal.aborted) {\n      ac.abort(this.signal.reason)\n    } else {\n      let list = dependentControllerMap.get(this.signal)\n      if (list === undefined) {\n        list = new Set()\n        dependentControllerMap.set(this.signal, list)\n      }\n      const acRef = new WeakRef(ac)\n      list.add(acRef)\n      util.addAbortListener(\n        ac.signal,\n        buildAbort(acRef)\n      )\n    }\n\n    // 4. Return clonedRequestObject.\n    return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders]))\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    if (options.depth === null) {\n      options.depth = 2\n    }\n\n    options.colors ??= true\n\n    const properties = {\n      method: this.method,\n      url: this.url,\n      headers: this.headers,\n      destination: this.destination,\n      referrer: this.referrer,\n      referrerPolicy: this.referrerPolicy,\n      mode: this.mode,\n      credentials: this.credentials,\n      cache: this.cache,\n      redirect: this.redirect,\n      integrity: this.integrity,\n      keepalive: this.keepalive,\n      isReloadNavigation: this.isReloadNavigation,\n      isHistoryNavigation: this.isHistoryNavigation,\n      signal: this.signal\n    }\n\n    return `Request ${nodeUtil.formatWithOptions(options, properties)}`\n  }\n}\n\nmixinBody(Request)\n\n// https://fetch.spec.whatwg.org/#requests\nfunction makeRequest (init) {\n  return {\n    method: init.method ?? 'GET',\n    localURLsOnly: init.localURLsOnly ?? false,\n    unsafeRequest: init.unsafeRequest ?? false,\n    body: init.body ?? null,\n    client: init.client ?? null,\n    reservedClient: init.reservedClient ?? null,\n    replacesClientId: init.replacesClientId ?? '',\n    window: init.window ?? 'client',\n    keepalive: init.keepalive ?? false,\n    serviceWorkers: init.serviceWorkers ?? 'all',\n    initiator: init.initiator ?? '',\n    destination: init.destination ?? '',\n    priority: init.priority ?? null,\n    origin: init.origin ?? 'client',\n    policyContainer: init.policyContainer ?? 'client',\n    referrer: init.referrer ?? 'client',\n    referrerPolicy: init.referrerPolicy ?? '',\n    mode: init.mode ?? 'no-cors',\n    useCORSPreflightFlag: init.useCORSPreflightFlag ?? false,\n    credentials: init.credentials ?? 'same-origin',\n    useCredentials: init.useCredentials ?? false,\n    cache: init.cache ?? 'default',\n    redirect: init.redirect ?? 'follow',\n    integrity: init.integrity ?? '',\n    cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? '',\n    parserMetadata: init.parserMetadata ?? '',\n    reloadNavigation: init.reloadNavigation ?? false,\n    historyNavigation: init.historyNavigation ?? false,\n    userActivation: init.userActivation ?? false,\n    taintedOrigin: init.taintedOrigin ?? false,\n    redirectCount: init.redirectCount ?? 0,\n    responseTainting: init.responseTainting ?? 'basic',\n    preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false,\n    done: init.done ?? false,\n    timingAllowFailed: init.timingAllowFailed ?? false,\n    urlList: init.urlList,\n    url: init.urlList[0],\n    headersList: init.headersList\n      ? new HeadersList(init.headersList)\n      : new HeadersList()\n  }\n}\n\n// https://fetch.spec.whatwg.org/#concept-request-clone\nfunction cloneRequest (request) {\n  // To clone a request request, run these steps:\n\n  // 1. Let newRequest be a copy of request, except for its body.\n  const newRequest = makeRequest({ ...request, body: null })\n\n  // 2. If request’s body is non-null, set newRequest’s body to the\n  // result of cloning request’s body.\n  if (request.body != null) {\n    newRequest.body = cloneBody(newRequest, request.body)\n  }\n\n  // 3. Return newRequest.\n  return newRequest\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-create\n * @param {any} innerRequest\n * @param {AbortSignal} signal\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Request}\n */\nfunction fromInnerRequest (innerRequest, signal, guard) {\n  const request = new Request(kConstruct)\n  request[kState] = innerRequest\n  request[kSignal] = signal\n  request[kHeaders] = new Headers(kConstruct)\n  setHeadersList(request[kHeaders], innerRequest.headersList)\n  setHeadersGuard(request[kHeaders], guard)\n  return request\n}\n\nObject.defineProperties(Request.prototype, {\n  method: kEnumerableProperty,\n  url: kEnumerableProperty,\n  headers: kEnumerableProperty,\n  redirect: kEnumerableProperty,\n  clone: kEnumerableProperty,\n  signal: kEnumerableProperty,\n  duplex: kEnumerableProperty,\n  destination: kEnumerableProperty,\n  body: kEnumerableProperty,\n  bodyUsed: kEnumerableProperty,\n  isHistoryNavigation: kEnumerableProperty,\n  isReloadNavigation: kEnumerableProperty,\n  keepalive: kEnumerableProperty,\n  integrity: kEnumerableProperty,\n  cache: kEnumerableProperty,\n  credentials: kEnumerableProperty,\n  attribute: kEnumerableProperty,\n  referrerPolicy: kEnumerableProperty,\n  referrer: kEnumerableProperty,\n  mode: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Request',\n    configurable: true\n  }\n})\n\nwebidl.converters.Request = webidl.interfaceConverter(\n  Request\n)\n\n// https://fetch.spec.whatwg.org/#requestinfo\nwebidl.converters.RequestInfo = function (V, prefix, argument) {\n  if (typeof V === 'string') {\n    return webidl.converters.USVString(V, prefix, argument)\n  }\n\n  if (V instanceof Request) {\n    return webidl.converters.Request(V, prefix, argument)\n  }\n\n  return webidl.converters.USVString(V, prefix, argument)\n}\n\nwebidl.converters.AbortSignal = webidl.interfaceConverter(\n  AbortSignal\n)\n\n// https://fetch.spec.whatwg.org/#requestinit\nwebidl.converters.RequestInit = webidl.dictionaryConverter([\n  {\n    key: 'method',\n    converter: webidl.converters.ByteString\n  },\n  {\n    key: 'headers',\n    converter: webidl.converters.HeadersInit\n  },\n  {\n    key: 'body',\n    converter: webidl.nullableConverter(\n      webidl.converters.BodyInit\n    )\n  },\n  {\n    key: 'referrer',\n    converter: webidl.converters.USVString\n  },\n  {\n    key: 'referrerPolicy',\n    converter: webidl.converters.DOMString,\n    // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n    allowedValues: referrerPolicy\n  },\n  {\n    key: 'mode',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#concept-request-mode\n    allowedValues: requestMode\n  },\n  {\n    key: 'credentials',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestcredentials\n    allowedValues: requestCredentials\n  },\n  {\n    key: 'cache',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestcache\n    allowedValues: requestCache\n  },\n  {\n    key: 'redirect',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestredirect\n    allowedValues: requestRedirect\n  },\n  {\n    key: 'integrity',\n    converter: webidl.converters.DOMString\n  },\n  {\n    key: 'keepalive',\n    converter: webidl.converters.boolean\n  },\n  {\n    key: 'signal',\n    converter: webidl.nullableConverter(\n      (signal) => webidl.converters.AbortSignal(\n        signal,\n        'RequestInit',\n        'signal',\n        { strict: false }\n      )\n    )\n  },\n  {\n    key: 'window',\n    converter: webidl.converters.any\n  },\n  {\n    key: 'duplex',\n    converter: webidl.converters.DOMString,\n    allowedValues: requestDuplex\n  },\n  {\n    key: 'dispatcher', // undici specific option\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }\n","'use strict'\n\nconst { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require('./headers')\nconst { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require('./body')\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst { kEnumerableProperty } = util\nconst {\n  isValidReasonPhrase,\n  isCancelled,\n  isAborted,\n  isBlobLike,\n  serializeJavascriptValueToJSONString,\n  isErrorLike,\n  isomorphicEncode,\n  environmentSettingsObject: relevantRealm\n} = require('./util')\nconst {\n  redirectStatusSet,\n  nullBodyStatus\n} = require('./constants')\nconst { kState, kHeaders } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { FormData } = require('./formdata')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { types } = require('node:util')\n\nconst textEncoder = new TextEncoder('utf-8')\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response {\n  // Creates network error Response.\n  static error () {\n    // The static error() method steps are to return the result of creating a\n    // Response object, given a new network error, \"immutable\", and this’s\n    // relevant Realm.\n    const responseObject = fromInnerResponse(makeNetworkError(), 'immutable')\n\n    return responseObject\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-json\n  static json (data, init = {}) {\n    webidl.argumentLengthCheck(arguments, 1, 'Response.json')\n\n    if (init !== null) {\n      init = webidl.converters.ResponseInit(init)\n    }\n\n    // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.\n    const bytes = textEncoder.encode(\n      serializeJavascriptValueToJSONString(data)\n    )\n\n    // 2. Let body be the result of extracting bytes.\n    const body = extractBody(bytes)\n\n    // 3. Let responseObject be the result of creating a Response object, given a new response,\n    //    \"response\", and this’s relevant Realm.\n    const responseObject = fromInnerResponse(makeResponse({}), 'response')\n\n    // 4. Perform initialize a response given responseObject, init, and (body, \"application/json\").\n    initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })\n\n    // 5. Return responseObject.\n    return responseObject\n  }\n\n  // Creates a redirect Response that redirects to url with status status.\n  static redirect (url, status = 302) {\n    webidl.argumentLengthCheck(arguments, 1, 'Response.redirect')\n\n    url = webidl.converters.USVString(url)\n    status = webidl.converters['unsigned short'](status)\n\n    // 1. Let parsedURL be the result of parsing url with current settings\n    // object’s API base URL.\n    // 2. If parsedURL is failure, then throw a TypeError.\n    // TODO: base-URL?\n    let parsedURL\n    try {\n      parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl)\n    } catch (err) {\n      throw new TypeError(`Failed to parse URL from ${url}`, { cause: err })\n    }\n\n    // 3. If status is not a redirect status, then throw a RangeError.\n    if (!redirectStatusSet.has(status)) {\n      throw new RangeError(`Invalid status code ${status}`)\n    }\n\n    // 4. Let responseObject be the result of creating a Response object,\n    // given a new response, \"immutable\", and this’s relevant Realm.\n    const responseObject = fromInnerResponse(makeResponse({}), 'immutable')\n\n    // 5. Set responseObject’s response’s status to status.\n    responseObject[kState].status = status\n\n    // 6. Let value be parsedURL, serialized and isomorphic encoded.\n    const value = isomorphicEncode(URLSerializer(parsedURL))\n\n    // 7. Append `Location`/value to responseObject’s response’s header list.\n    responseObject[kState].headersList.append('location', value, true)\n\n    // 8. Return responseObject.\n    return responseObject\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response\n  constructor (body = null, init = {}) {\n    webidl.util.markAsUncloneable(this)\n    if (body === kConstruct) {\n      return\n    }\n\n    if (body !== null) {\n      body = webidl.converters.BodyInit(body)\n    }\n\n    init = webidl.converters.ResponseInit(init)\n\n    // 1. Set this’s response to a new response.\n    this[kState] = makeResponse({})\n\n    // 2. Set this’s headers to a new Headers object with this’s relevant\n    // Realm, whose header list is this’s response’s header list and guard\n    // is \"response\".\n    this[kHeaders] = new Headers(kConstruct)\n    setHeadersGuard(this[kHeaders], 'response')\n    setHeadersList(this[kHeaders], this[kState].headersList)\n\n    // 3. Let bodyWithType be null.\n    let bodyWithType = null\n\n    // 4. If body is non-null, then set bodyWithType to the result of extracting body.\n    if (body != null) {\n      const [extractedBody, type] = extractBody(body)\n      bodyWithType = { body: extractedBody, type }\n    }\n\n    // 5. Perform initialize a response given this, init, and bodyWithType.\n    initializeResponse(this, init, bodyWithType)\n  }\n\n  // Returns response’s type, e.g., \"cors\".\n  get type () {\n    webidl.brandCheck(this, Response)\n\n    // The type getter steps are to return this’s response’s type.\n    return this[kState].type\n  }\n\n  // Returns response’s URL, if it has one; otherwise the empty string.\n  get url () {\n    webidl.brandCheck(this, Response)\n\n    const urlList = this[kState].urlList\n\n    // The url getter steps are to return the empty string if this’s\n    // response’s URL is null; otherwise this’s response’s URL,\n    // serialized with exclude fragment set to true.\n    const url = urlList[urlList.length - 1] ?? null\n\n    if (url === null) {\n      return ''\n    }\n\n    return URLSerializer(url, true)\n  }\n\n  // Returns whether response was obtained through a redirect.\n  get redirected () {\n    webidl.brandCheck(this, Response)\n\n    // The redirected getter steps are to return true if this’s response’s URL\n    // list has more than one item; otherwise false.\n    return this[kState].urlList.length > 1\n  }\n\n  // Returns response’s status.\n  get status () {\n    webidl.brandCheck(this, Response)\n\n    // The status getter steps are to return this’s response’s status.\n    return this[kState].status\n  }\n\n  // Returns whether response’s status is an ok status.\n  get ok () {\n    webidl.brandCheck(this, Response)\n\n    // The ok getter steps are to return true if this’s response’s status is an\n    // ok status; otherwise false.\n    return this[kState].status >= 200 && this[kState].status <= 299\n  }\n\n  // Returns response’s status message.\n  get statusText () {\n    webidl.brandCheck(this, Response)\n\n    // The statusText getter steps are to return this’s response’s status\n    // message.\n    return this[kState].statusText\n  }\n\n  // Returns response’s headers as Headers.\n  get headers () {\n    webidl.brandCheck(this, Response)\n\n    // The headers getter steps are to return this’s headers.\n    return this[kHeaders]\n  }\n\n  get body () {\n    webidl.brandCheck(this, Response)\n\n    return this[kState].body ? this[kState].body.stream : null\n  }\n\n  get bodyUsed () {\n    webidl.brandCheck(this, Response)\n\n    return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n  }\n\n  // Returns a clone of response.\n  clone () {\n    webidl.brandCheck(this, Response)\n\n    // 1. If this is unusable, then throw a TypeError.\n    if (bodyUnusable(this)) {\n      throw webidl.errors.exception({\n        header: 'Response.clone',\n        message: 'Body has already been consumed.'\n      })\n    }\n\n    // 2. Let clonedResponse be the result of cloning this’s response.\n    const clonedResponse = cloneResponse(this[kState])\n\n    // Note: To re-register because of a new stream.\n    if (hasFinalizationRegistry && this[kState].body?.stream) {\n      streamRegistry.register(this, new WeakRef(this[kState].body.stream))\n    }\n\n    // 3. Return the result of creating a Response object, given\n    // clonedResponse, this’s headers’s guard, and this’s relevant Realm.\n    return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders]))\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    if (options.depth === null) {\n      options.depth = 2\n    }\n\n    options.colors ??= true\n\n    const properties = {\n      status: this.status,\n      statusText: this.statusText,\n      headers: this.headers,\n      body: this.body,\n      bodyUsed: this.bodyUsed,\n      ok: this.ok,\n      redirected: this.redirected,\n      type: this.type,\n      url: this.url\n    }\n\n    return `Response ${nodeUtil.formatWithOptions(options, properties)}`\n  }\n}\n\nmixinBody(Response)\n\nObject.defineProperties(Response.prototype, {\n  type: kEnumerableProperty,\n  url: kEnumerableProperty,\n  status: kEnumerableProperty,\n  ok: kEnumerableProperty,\n  redirected: kEnumerableProperty,\n  statusText: kEnumerableProperty,\n  headers: kEnumerableProperty,\n  clone: kEnumerableProperty,\n  body: kEnumerableProperty,\n  bodyUsed: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Response',\n    configurable: true\n  }\n})\n\nObject.defineProperties(Response, {\n  json: kEnumerableProperty,\n  redirect: kEnumerableProperty,\n  error: kEnumerableProperty\n})\n\n// https://fetch.spec.whatwg.org/#concept-response-clone\nfunction cloneResponse (response) {\n  // To clone a response response, run these steps:\n\n  // 1. If response is a filtered response, then return a new identical\n  // filtered response whose internal response is a clone of response’s\n  // internal response.\n  if (response.internalResponse) {\n    return filterResponse(\n      cloneResponse(response.internalResponse),\n      response.type\n    )\n  }\n\n  // 2. Let newResponse be a copy of response, except for its body.\n  const newResponse = makeResponse({ ...response, body: null })\n\n  // 3. If response’s body is non-null, then set newResponse’s body to the\n  // result of cloning response’s body.\n  if (response.body != null) {\n    newResponse.body = cloneBody(newResponse, response.body)\n  }\n\n  // 4. Return newResponse.\n  return newResponse\n}\n\nfunction makeResponse (init) {\n  return {\n    aborted: false,\n    rangeRequested: false,\n    timingAllowPassed: false,\n    requestIncludesCredentials: false,\n    type: 'default',\n    status: 200,\n    timingInfo: null,\n    cacheState: '',\n    statusText: '',\n    ...init,\n    headersList: init?.headersList\n      ? new HeadersList(init?.headersList)\n      : new HeadersList(),\n    urlList: init?.urlList ? [...init.urlList] : []\n  }\n}\n\nfunction makeNetworkError (reason) {\n  const isError = isErrorLike(reason)\n  return makeResponse({\n    type: 'error',\n    status: 0,\n    error: isError\n      ? reason\n      : new Error(reason ? String(reason) : reason),\n    aborted: reason && reason.name === 'AbortError'\n  })\n}\n\n// @see https://fetch.spec.whatwg.org/#concept-network-error\nfunction isNetworkError (response) {\n  return (\n    // A network error is a response whose type is \"error\",\n    response.type === 'error' &&\n    // status is 0\n    response.status === 0\n  )\n}\n\nfunction makeFilteredResponse (response, state) {\n  state = {\n    internalResponse: response,\n    ...state\n  }\n\n  return new Proxy(response, {\n    get (target, p) {\n      return p in state ? state[p] : target[p]\n    },\n    set (target, p, value) {\n      assert(!(p in state))\n      target[p] = value\n      return true\n    }\n  })\n}\n\n// https://fetch.spec.whatwg.org/#concept-filtered-response\nfunction filterResponse (response, type) {\n  // Set response to the following filtered response with response as its\n  // internal response, depending on request’s response tainting:\n  if (type === 'basic') {\n    // A basic filtered response is a filtered response whose type is \"basic\"\n    // and header list excludes any headers in internal response’s header list\n    // whose name is a forbidden response-header name.\n\n    // Note: undici does not implement forbidden response-header names\n    return makeFilteredResponse(response, {\n      type: 'basic',\n      headersList: response.headersList\n    })\n  } else if (type === 'cors') {\n    // A CORS filtered response is a filtered response whose type is \"cors\"\n    // and header list excludes any headers in internal response’s header\n    // list whose name is not a CORS-safelisted response-header name, given\n    // internal response’s CORS-exposed header-name list.\n\n    // Note: undici does not implement CORS-safelisted response-header names\n    return makeFilteredResponse(response, {\n      type: 'cors',\n      headersList: response.headersList\n    })\n  } else if (type === 'opaque') {\n    // An opaque filtered response is a filtered response whose type is\n    // \"opaque\", URL list is the empty list, status is 0, status message\n    // is the empty byte sequence, header list is empty, and body is null.\n\n    return makeFilteredResponse(response, {\n      type: 'opaque',\n      urlList: Object.freeze([]),\n      status: 0,\n      statusText: '',\n      body: null\n    })\n  } else if (type === 'opaqueredirect') {\n    // An opaque-redirect filtered response is a filtered response whose type\n    // is \"opaqueredirect\", status is 0, status message is the empty byte\n    // sequence, header list is empty, and body is null.\n\n    return makeFilteredResponse(response, {\n      type: 'opaqueredirect',\n      status: 0,\n      statusText: '',\n      headersList: [],\n      body: null\n    })\n  } else {\n    assert(false)\n  }\n}\n\n// https://fetch.spec.whatwg.org/#appropriate-network-error\nfunction makeAppropriateNetworkError (fetchParams, err = null) {\n  // 1. Assert: fetchParams is canceled.\n  assert(isCancelled(fetchParams))\n\n  // 2. Return an aborted network error if fetchParams is aborted;\n  // otherwise return a network error.\n  return isAborted(fetchParams)\n    ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))\n    : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))\n}\n\n// https://whatpr.org/fetch/1392.html#initialize-a-response\nfunction initializeResponse (response, init, body) {\n  // 1. If init[\"status\"] is not in the range 200 to 599, inclusive, then\n  //    throw a RangeError.\n  if (init.status !== null && (init.status < 200 || init.status > 599)) {\n    throw new RangeError('init[\"status\"] must be in the range of 200 to 599, inclusive.')\n  }\n\n  // 2. If init[\"statusText\"] does not match the reason-phrase token production,\n  //    then throw a TypeError.\n  if ('statusText' in init && init.statusText != null) {\n    // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:\n    //   reason-phrase  = *( HTAB / SP / VCHAR / obs-text )\n    if (!isValidReasonPhrase(String(init.statusText))) {\n      throw new TypeError('Invalid statusText')\n    }\n  }\n\n  // 3. Set response’s response’s status to init[\"status\"].\n  if ('status' in init && init.status != null) {\n    response[kState].status = init.status\n  }\n\n  // 4. Set response’s response’s status message to init[\"statusText\"].\n  if ('statusText' in init && init.statusText != null) {\n    response[kState].statusText = init.statusText\n  }\n\n  // 5. If init[\"headers\"] exists, then fill response’s headers with init[\"headers\"].\n  if ('headers' in init && init.headers != null) {\n    fill(response[kHeaders], init.headers)\n  }\n\n  // 6. If body was given, then:\n  if (body) {\n    // 1. If response's status is a null body status, then throw a TypeError.\n    if (nullBodyStatus.includes(response.status)) {\n      throw webidl.errors.exception({\n        header: 'Response constructor',\n        message: `Invalid response status code ${response.status}`\n      })\n    }\n\n    // 2. Set response's body to body's body.\n    response[kState].body = body.body\n\n    // 3. If body's type is non-null and response's header list does not contain\n    //    `Content-Type`, then append (`Content-Type`, body's type) to response's header list.\n    if (body.type != null && !response[kState].headersList.contains('content-type', true)) {\n      response[kState].headersList.append('content-type', body.type, true)\n    }\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#response-create\n * @param {any} innerResponse\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Response}\n */\nfunction fromInnerResponse (innerResponse, guard) {\n  const response = new Response(kConstruct)\n  response[kState] = innerResponse\n  response[kHeaders] = new Headers(kConstruct)\n  setHeadersList(response[kHeaders], innerResponse.headersList)\n  setHeadersGuard(response[kHeaders], guard)\n\n  if (hasFinalizationRegistry && innerResponse.body?.stream) {\n    // If the target (response) is reclaimed, the cleanup callback may be called at some point with\n    // the held value provided for it (innerResponse.body.stream). The held value can be any value:\n    // a primitive or an object, even undefined. If the held value is an object, the registry keeps\n    // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n    streamRegistry.register(response, new WeakRef(innerResponse.body.stream))\n  }\n\n  return response\n}\n\nwebidl.converters.ReadableStream = webidl.interfaceConverter(\n  ReadableStream\n)\n\nwebidl.converters.FormData = webidl.interfaceConverter(\n  FormData\n)\n\nwebidl.converters.URLSearchParams = webidl.interfaceConverter(\n  URLSearchParams\n)\n\n// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit\nwebidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) {\n  if (typeof V === 'string') {\n    return webidl.converters.USVString(V, prefix, name)\n  }\n\n  if (isBlobLike(V)) {\n    return webidl.converters.Blob(V, prefix, name, { strict: false })\n  }\n\n  if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n    return webidl.converters.BufferSource(V, prefix, name)\n  }\n\n  if (util.isFormDataLike(V)) {\n    return webidl.converters.FormData(V, prefix, name, { strict: false })\n  }\n\n  if (V instanceof URLSearchParams) {\n    return webidl.converters.URLSearchParams(V, prefix, name)\n  }\n\n  return webidl.converters.DOMString(V, prefix, name)\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit\nwebidl.converters.BodyInit = function (V, prefix, argument) {\n  if (V instanceof ReadableStream) {\n    return webidl.converters.ReadableStream(V, prefix, argument)\n  }\n\n  // Note: the spec doesn't include async iterables,\n  // this is an undici extension.\n  if (V?.[Symbol.asyncIterator]) {\n    return V\n  }\n\n  return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument)\n}\n\nwebidl.converters.ResponseInit = webidl.dictionaryConverter([\n  {\n    key: 'status',\n    converter: webidl.converters['unsigned short'],\n    defaultValue: () => 200\n  },\n  {\n    key: 'statusText',\n    converter: webidl.converters.ByteString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'headers',\n    converter: webidl.converters.HeadersInit\n  }\n])\n\nmodule.exports = {\n  isNetworkError,\n  makeNetworkError,\n  makeResponse,\n  makeAppropriateNetworkError,\n  filterResponse,\n  Response,\n  cloneResponse,\n  fromInnerResponse\n}\n","'use strict'\n\nmodule.exports = {\n  kUrl: Symbol('url'),\n  kHeaders: Symbol('headers'),\n  kSignal: Symbol('signal'),\n  kState: Symbol('state'),\n  kDispatcher: Symbol('dispatcher')\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst zlib = require('node:zlib')\nconst { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants')\nconst { getGlobalOrigin } = require('./global')\nconst { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require('./data-url')\nconst { performance } = require('node:perf_hooks')\nconst { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require('../../core/util')\nconst assert = require('node:assert')\nconst { isUint8Array } = require('node:util/types')\nconst { webidl } = require('./webidl')\n\nlet supportedHashes = []\n\n// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable\n/** @type {import('crypto')} */\nlet crypto\ntry {\n  crypto = require('node:crypto')\n  const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']\n  supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))\n/* c8 ignore next 3 */\n} catch {\n\n}\n\nfunction responseURL (response) {\n  // https://fetch.spec.whatwg.org/#responses\n  // A response has an associated URL. It is a pointer to the last URL\n  // in response’s URL list and null if response’s URL list is empty.\n  const urlList = response.urlList\n  const length = urlList.length\n  return length === 0 ? null : urlList[length - 1].toString()\n}\n\n// https://fetch.spec.whatwg.org/#concept-response-location-url\nfunction responseLocationURL (response, requestFragment) {\n  // 1. If response’s status is not a redirect status, then return null.\n  if (!redirectStatusSet.has(response.status)) {\n    return null\n  }\n\n  // 2. Let location be the result of extracting header list values given\n  // `Location` and response’s header list.\n  let location = response.headersList.get('location', true)\n\n  // 3. If location is a header value, then set location to the result of\n  //    parsing location with response’s URL.\n  if (location !== null && isValidHeaderValue(location)) {\n    if (!isValidEncodedURL(location)) {\n      // Some websites respond location header in UTF-8 form without encoding them as ASCII\n      // and major browsers redirect them to correctly UTF-8 encoded addresses.\n      // Here, we handle that behavior in the same way.\n      location = normalizeBinaryStringToUtf8(location)\n    }\n    location = new URL(location, responseURL(response))\n  }\n\n  // 4. If location is a URL whose fragment is null, then set location’s\n  // fragment to requestFragment.\n  if (location && !location.hash) {\n    location.hash = requestFragment\n  }\n\n  // 5. Return location.\n  return location\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2\n * @param {string} url\n * @returns {boolean}\n */\nfunction isValidEncodedURL (url) {\n  for (let i = 0; i < url.length; ++i) {\n    const code = url.charCodeAt(i)\n\n    if (\n      code > 0x7E || // Non-US-ASCII + DEL\n      code < 0x20 // Control characters NUL - US\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it.\n * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well.\n * @param {string} value\n * @returns {string}\n */\nfunction normalizeBinaryStringToUtf8 (value) {\n  return Buffer.from(value, 'binary').toString('utf8')\n}\n\n/** @returns {URL} */\nfunction requestCurrentURL (request) {\n  return request.urlList[request.urlList.length - 1]\n}\n\nfunction requestBadPort (request) {\n  // 1. Let url be request’s current URL.\n  const url = requestCurrentURL(request)\n\n  // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,\n  // then return blocked.\n  if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {\n    return 'blocked'\n  }\n\n  // 3. Return allowed.\n  return 'allowed'\n}\n\nfunction isErrorLike (object) {\n  return object instanceof Error || (\n    object?.constructor?.name === 'Error' ||\n    object?.constructor?.name === 'DOMException'\n  )\n}\n\n// Check whether |statusText| is a ByteString and\n// matches the Reason-Phrase token production.\n// RFC 2616: https://tools.ietf.org/html/rfc2616\n// RFC 7230: https://tools.ietf.org/html/rfc7230\n// \"reason-phrase = *( HTAB / SP / VCHAR / obs-text )\"\n// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116\nfunction isValidReasonPhrase (statusText) {\n  for (let i = 0; i < statusText.length; ++i) {\n    const c = statusText.charCodeAt(i)\n    if (\n      !(\n        (\n          c === 0x09 || // HTAB\n          (c >= 0x20 && c <= 0x7e) || // SP / VCHAR\n          (c >= 0x80 && c <= 0xff)\n        ) // obs-text\n      )\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-name\n * @param {string} potentialValue\n */\nconst isValidHeaderName = isValidHTTPToken\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value\n * @param {string} potentialValue\n */\nfunction isValidHeaderValue (potentialValue) {\n  // - Has no leading or trailing HTTP tab or space bytes.\n  // - Contains no 0x00 (NUL) or HTTP newline bytes.\n  return (\n    potentialValue[0] === '\\t' ||\n    potentialValue[0] === ' ' ||\n    potentialValue[potentialValue.length - 1] === '\\t' ||\n    potentialValue[potentialValue.length - 1] === ' ' ||\n    potentialValue.includes('\\n') ||\n    potentialValue.includes('\\r') ||\n    potentialValue.includes('\\0')\n  ) === false\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect\nfunction setRequestReferrerPolicyOnRedirect (request, actualResponse) {\n  //  Given a request request and a response actualResponse, this algorithm\n  //  updates request’s referrer policy according to the Referrer-Policy\n  //  header (if any) in actualResponse.\n\n  // 1. Let policy be the result of executing § 8.1 Parse a referrer policy\n  // from a Referrer-Policy header on actualResponse.\n\n  // 8.1 Parse a referrer policy from a Referrer-Policy header\n  // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.\n  const { headersList } = actualResponse\n  // 2. Let policy be the empty string.\n  // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.\n  // 4. Return policy.\n  const policyHeader = (headersList.get('referrer-policy', true) ?? '').split(',')\n\n  // Note: As the referrer-policy can contain multiple policies\n  // separated by comma, we need to loop through all of them\n  // and pick the first valid one.\n  // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy\n  let policy = ''\n  if (policyHeader.length > 0) {\n    // The right-most policy takes precedence.\n    // The left-most policy is the fallback.\n    for (let i = policyHeader.length; i !== 0; i--) {\n      const token = policyHeader[i - 1].trim()\n      if (referrerPolicyTokens.has(token)) {\n        policy = token\n        break\n      }\n    }\n  }\n\n  // 2. If policy is not the empty string, then set request’s referrer policy to policy.\n  if (policy !== '') {\n    request.referrerPolicy = policy\n  }\n}\n\n// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check\nfunction crossOriginResourcePolicyCheck () {\n  // TODO\n  return 'allowed'\n}\n\n// https://fetch.spec.whatwg.org/#concept-cors-check\nfunction corsCheck () {\n  // TODO\n  return 'success'\n}\n\n// https://fetch.spec.whatwg.org/#concept-tao-check\nfunction TAOCheck () {\n  // TODO\n  return 'success'\n}\n\nfunction appendFetchMetadata (httpRequest) {\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header\n  //  TODO\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header\n\n  //  1. Assert: r’s url is a potentially trustworthy URL.\n  //  TODO\n\n  //  2. Let header be a Structured Header whose value is a token.\n  let header = null\n\n  //  3. Set header’s value to r’s mode.\n  header = httpRequest.mode\n\n  //  4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.\n  httpRequest.headersList.set('sec-fetch-mode', header, true)\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header\n  //  TODO\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header\n  //  TODO\n}\n\n// https://fetch.spec.whatwg.org/#append-a-request-origin-header\nfunction appendRequestOriginHeader (request) {\n  // 1. Let serializedOrigin be the result of byte-serializing a request origin\n  //    with request.\n  // TODO: implement \"byte-serializing a request origin\"\n  let serializedOrigin = request.origin\n\n  // - \"'client' is changed to an origin during fetching.\"\n  //   This doesn't happen in undici (in most cases) because undici, by default,\n  //   has no concept of origin.\n  // - request.origin can also be set to request.client.origin (client being\n  //   an environment settings object), which is undefined without using\n  //   setGlobalOrigin.\n  if (serializedOrigin === 'client' || serializedOrigin === undefined) {\n    return\n  }\n\n  // 2. If request’s response tainting is \"cors\" or request’s mode is \"websocket\",\n  //    then append (`Origin`, serializedOrigin) to request’s header list.\n  // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:\n  if (request.responseTainting === 'cors' || request.mode === 'websocket') {\n    request.headersList.append('origin', serializedOrigin, true)\n  } else if (request.method !== 'GET' && request.method !== 'HEAD') {\n    // 1. Switch on request’s referrer policy:\n    switch (request.referrerPolicy) {\n      case 'no-referrer':\n        // Set serializedOrigin to `null`.\n        serializedOrigin = null\n        break\n      case 'no-referrer-when-downgrade':\n      case 'strict-origin':\n      case 'strict-origin-when-cross-origin':\n        // If request’s origin is a tuple origin, its scheme is \"https\", and\n        // request’s current URL’s scheme is not \"https\", then set\n        // serializedOrigin to `null`.\n        if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n          serializedOrigin = null\n        }\n        break\n      case 'same-origin':\n        // If request’s origin is not same origin with request’s current URL’s\n        // origin, then set serializedOrigin to `null`.\n        if (!sameOrigin(request, requestCurrentURL(request))) {\n          serializedOrigin = null\n        }\n        break\n      default:\n        // Do nothing.\n    }\n\n    // 2. Append (`Origin`, serializedOrigin) to request’s header list.\n    request.headersList.append('origin', serializedOrigin, true)\n  }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsen-time\nfunction coarsenTime (timestamp, crossOriginIsolatedCapability) {\n  // TODO\n  return timestamp\n}\n\n// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info\nfunction clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {\n  if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {\n    return {\n      domainLookupStartTime: defaultStartTime,\n      domainLookupEndTime: defaultStartTime,\n      connectionStartTime: defaultStartTime,\n      connectionEndTime: defaultStartTime,\n      secureConnectionStartTime: defaultStartTime,\n      ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol\n    }\n  }\n\n  return {\n    domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),\n    domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),\n    connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),\n    connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),\n    secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),\n    ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol\n  }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time\nfunction coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {\n  return coarsenTime(performance.now(), crossOriginIsolatedCapability)\n}\n\n// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info\nfunction createOpaqueTimingInfo (timingInfo) {\n  return {\n    startTime: timingInfo.startTime ?? 0,\n    redirectStartTime: 0,\n    redirectEndTime: 0,\n    postRedirectStartTime: timingInfo.startTime ?? 0,\n    finalServiceWorkerStartTime: 0,\n    finalNetworkResponseStartTime: 0,\n    finalNetworkRequestStartTime: 0,\n    endTime: 0,\n    encodedBodySize: 0,\n    decodedBodySize: 0,\n    finalConnectionTimingInfo: null\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#policy-container\nfunction makePolicyContainer () {\n  // Note: the fetch spec doesn't make use of embedder policy or CSP list\n  return {\n    referrerPolicy: 'strict-origin-when-cross-origin'\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container\nfunction clonePolicyContainer (policyContainer) {\n  return {\n    referrerPolicy: policyContainer.referrerPolicy\n  }\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer\nfunction determineRequestsReferrer (request) {\n  // 1. Let policy be request's referrer policy.\n  const policy = request.referrerPolicy\n\n  // Note: policy cannot (shouldn't) be null or an empty string.\n  assert(policy)\n\n  // 2. Let environment be request’s client.\n\n  let referrerSource = null\n\n  // 3. Switch on request’s referrer:\n  if (request.referrer === 'client') {\n    // Note: node isn't a browser and doesn't implement document/iframes,\n    // so we bypass this step and replace it with our own.\n\n    const globalOrigin = getGlobalOrigin()\n\n    if (!globalOrigin || globalOrigin.origin === 'null') {\n      return 'no-referrer'\n    }\n\n    // note: we need to clone it as it's mutated\n    referrerSource = new URL(globalOrigin)\n  } else if (request.referrer instanceof URL) {\n    // Let referrerSource be request’s referrer.\n    referrerSource = request.referrer\n  }\n\n  // 4. Let request’s referrerURL be the result of stripping referrerSource for\n  //    use as a referrer.\n  let referrerURL = stripURLForReferrer(referrerSource)\n\n  // 5. Let referrerOrigin be the result of stripping referrerSource for use as\n  //    a referrer, with the origin-only flag set to true.\n  const referrerOrigin = stripURLForReferrer(referrerSource, true)\n\n  // 6. If the result of serializing referrerURL is a string whose length is\n  //    greater than 4096, set referrerURL to referrerOrigin.\n  if (referrerURL.toString().length > 4096) {\n    referrerURL = referrerOrigin\n  }\n\n  const areSameOrigin = sameOrigin(request, referrerURL)\n  const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&\n    !isURLPotentiallyTrustworthy(request.url)\n\n  // 8. Execute the switch statements corresponding to the value of policy:\n  switch (policy) {\n    case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)\n    case 'unsafe-url': return referrerURL\n    case 'same-origin':\n      return areSameOrigin ? referrerOrigin : 'no-referrer'\n    case 'origin-when-cross-origin':\n      return areSameOrigin ? referrerURL : referrerOrigin\n    case 'strict-origin-when-cross-origin': {\n      const currentURL = requestCurrentURL(request)\n\n      // 1. If the origin of referrerURL and the origin of request’s current\n      //    URL are the same, then return referrerURL.\n      if (sameOrigin(referrerURL, currentURL)) {\n        return referrerURL\n      }\n\n      // 2. If referrerURL is a potentially trustworthy URL and request’s\n      //    current URL is not a potentially trustworthy URL, then return no\n      //    referrer.\n      if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n        return 'no-referrer'\n      }\n\n      // 3. Return referrerOrigin.\n      return referrerOrigin\n    }\n    case 'strict-origin': // eslint-disable-line\n      /**\n         * 1. If referrerURL is a potentially trustworthy URL and\n         * request’s current URL is not a potentially trustworthy URL,\n         * then return no referrer.\n         * 2. Return referrerOrigin\n        */\n    case 'no-referrer-when-downgrade': // eslint-disable-line\n      /**\n       * 1. If referrerURL is a potentially trustworthy URL and\n       * request’s current URL is not a potentially trustworthy URL,\n       * then return no referrer.\n       * 2. Return referrerOrigin\n      */\n\n    default: // eslint-disable-line\n      return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin\n  }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url\n * @param {URL} url\n * @param {boolean|undefined} originOnly\n */\nfunction stripURLForReferrer (url, originOnly) {\n  // 1. Assert: url is a URL.\n  assert(url instanceof URL)\n\n  url = new URL(url)\n\n  // 2. If url’s scheme is a local scheme, then return no referrer.\n  if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {\n    return 'no-referrer'\n  }\n\n  // 3. Set url’s username to the empty string.\n  url.username = ''\n\n  // 4. Set url’s password to the empty string.\n  url.password = ''\n\n  // 5. Set url’s fragment to null.\n  url.hash = ''\n\n  // 6. If the origin-only flag is true, then:\n  if (originOnly) {\n    // 1. Set url’s path to « the empty string ».\n    url.pathname = ''\n\n    // 2. Set url’s query to null.\n    url.search = ''\n  }\n\n  // 7. Return url.\n  return url\n}\n\nfunction isURLPotentiallyTrustworthy (url) {\n  if (!(url instanceof URL)) {\n    return false\n  }\n\n  // If child of about, return true\n  if (url.href === 'about:blank' || url.href === 'about:srcdoc') {\n    return true\n  }\n\n  // If scheme is data, return true\n  if (url.protocol === 'data:') return true\n\n  // If file, return true\n  if (url.protocol === 'file:') return true\n\n  return isOriginPotentiallyTrustworthy(url.origin)\n\n  function isOriginPotentiallyTrustworthy (origin) {\n    // If origin is explicitly null, return false\n    if (origin == null || origin === 'null') return false\n\n    const originAsURL = new URL(origin)\n\n    // If secure, return true\n    if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {\n      return true\n    }\n\n    // If localhost or variants, return true\n    if (/^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^\\[(?:0*:)*?:?0*1\\]$/.test(originAsURL.hostname) ||\n     (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||\n     (originAsURL.hostname.endsWith('.localhost'))) {\n      return true\n    }\n\n    // If any other, return false\n    return false\n  }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist\n * @param {Uint8Array} bytes\n * @param {string} metadataList\n */\nfunction bytesMatch (bytes, metadataList) {\n  // If node is not built with OpenSSL support, we cannot check\n  // a request's integrity, so allow it by default (the spec will\n  // allow requests if an invalid hash is given, as precedence).\n  /* istanbul ignore if: only if node is built with --without-ssl */\n  if (crypto === undefined) {\n    return true\n  }\n\n  // 1. Let parsedMetadata be the result of parsing metadataList.\n  const parsedMetadata = parseMetadata(metadataList)\n\n  // 2. If parsedMetadata is no metadata, return true.\n  if (parsedMetadata === 'no metadata') {\n    return true\n  }\n\n  // 3. If response is not eligible for integrity validation, return false.\n  // TODO\n\n  // 4. If parsedMetadata is the empty set, return true.\n  if (parsedMetadata.length === 0) {\n    return true\n  }\n\n  // 5. Let metadata be the result of getting the strongest\n  //    metadata from parsedMetadata.\n  const strongest = getStrongestMetadata(parsedMetadata)\n  const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)\n\n  // 6. For each item in metadata:\n  for (const item of metadata) {\n    // 1. Let algorithm be the alg component of item.\n    const algorithm = item.algo\n\n    // 2. Let expectedValue be the val component of item.\n    const expectedValue = item.hash\n\n    // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e\n    // \"be liberal with padding\". This is annoying, and it's not even in the spec.\n\n    // 3. Let actualValue be the result of applying algorithm to bytes.\n    let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')\n\n    if (actualValue[actualValue.length - 1] === '=') {\n      if (actualValue[actualValue.length - 2] === '=') {\n        actualValue = actualValue.slice(0, -2)\n      } else {\n        actualValue = actualValue.slice(0, -1)\n      }\n    }\n\n    // 4. If actualValue is a case-sensitive match for expectedValue,\n    //    return true.\n    if (compareBase64Mixed(actualValue, expectedValue)) {\n      return true\n    }\n  }\n\n  // 7. Return false.\n  return false\n}\n\n// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options\n// https://www.w3.org/TR/CSP2/#source-list-syntax\n// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1\nconst parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\\s|$)( +[!-~]*)?)?/i\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata\n * @param {string} metadata\n */\nfunction parseMetadata (metadata) {\n  // 1. Let result be the empty set.\n  /** @type {{ algo: string, hash: string }[]} */\n  const result = []\n\n  // 2. Let empty be equal to true.\n  let empty = true\n\n  // 3. For each token returned by splitting metadata on spaces:\n  for (const token of metadata.split(' ')) {\n    // 1. Set empty to false.\n    empty = false\n\n    // 2. Parse token as a hash-with-options.\n    const parsedToken = parseHashWithOptions.exec(token)\n\n    // 3. If token does not parse, continue to the next token.\n    if (\n      parsedToken === null ||\n      parsedToken.groups === undefined ||\n      parsedToken.groups.algo === undefined\n    ) {\n      // Note: Chromium blocks the request at this point, but Firefox\n      // gives a warning that an invalid integrity was given. The\n      // correct behavior is to ignore these, and subsequently not\n      // check the integrity of the resource.\n      continue\n    }\n\n    // 4. Let algorithm be the hash-algo component of token.\n    const algorithm = parsedToken.groups.algo.toLowerCase()\n\n    // 5. If algorithm is a hash function recognized by the user\n    //    agent, add the parsed token to result.\n    if (supportedHashes.includes(algorithm)) {\n      result.push(parsedToken.groups)\n    }\n  }\n\n  // 4. Return no metadata if empty is true, otherwise return result.\n  if (empty === true) {\n    return 'no metadata'\n  }\n\n  return result\n}\n\n/**\n * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList\n */\nfunction getStrongestMetadata (metadataList) {\n  // Let algorithm be the algo component of the first item in metadataList.\n  // Can be sha256\n  let algorithm = metadataList[0].algo\n  // If the algorithm is sha512, then it is the strongest\n  // and we can return immediately\n  if (algorithm[3] === '5') {\n    return algorithm\n  }\n\n  for (let i = 1; i < metadataList.length; ++i) {\n    const metadata = metadataList[i]\n    // If the algorithm is sha512, then it is the strongest\n    // and we can break the loop immediately\n    if (metadata.algo[3] === '5') {\n      algorithm = 'sha512'\n      break\n    // If the algorithm is sha384, then a potential sha256 or sha384 is ignored\n    } else if (algorithm[3] === '3') {\n      continue\n    // algorithm is sha256, check if algorithm is sha384 and if so, set it as\n    // the strongest\n    } else if (metadata.algo[3] === '3') {\n      algorithm = 'sha384'\n    }\n  }\n  return algorithm\n}\n\nfunction filterMetadataListByAlgorithm (metadataList, algorithm) {\n  if (metadataList.length === 1) {\n    return metadataList\n  }\n\n  let pos = 0\n  for (let i = 0; i < metadataList.length; ++i) {\n    if (metadataList[i].algo === algorithm) {\n      metadataList[pos++] = metadataList[i]\n    }\n  }\n\n  metadataList.length = pos\n\n  return metadataList\n}\n\n/**\n * Compares two base64 strings, allowing for base64url\n * in the second string.\n *\n* @param {string} actualValue always base64\n * @param {string} expectedValue base64 or base64url\n * @returns {boolean}\n */\nfunction compareBase64Mixed (actualValue, expectedValue) {\n  if (actualValue.length !== expectedValue.length) {\n    return false\n  }\n  for (let i = 0; i < actualValue.length; ++i) {\n    if (actualValue[i] !== expectedValue[i]) {\n      if (\n        (actualValue[i] === '+' && expectedValue[i] === '-') ||\n        (actualValue[i] === '/' && expectedValue[i] === '_')\n      ) {\n        continue\n      }\n      return false\n    }\n  }\n\n  return true\n}\n\n// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request\nfunction tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {\n  // TODO\n}\n\n/**\n * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}\n * @param {URL} A\n * @param {URL} B\n */\nfunction sameOrigin (A, B) {\n  // 1. If A and B are the same opaque origin, then return true.\n  if (A.origin === B.origin && A.origin === 'null') {\n    return true\n  }\n\n  // 2. If A and B are both tuple origins and their schemes,\n  //    hosts, and port are identical, then return true.\n  if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n    return true\n  }\n\n  // 3. Return false.\n  return false\n}\n\nfunction createDeferredPromise () {\n  let res\n  let rej\n  const promise = new Promise((resolve, reject) => {\n    res = resolve\n    rej = reject\n  })\n\n  return { promise, resolve: res, reject: rej }\n}\n\nfunction isAborted (fetchParams) {\n  return fetchParams.controller.state === 'aborted'\n}\n\nfunction isCancelled (fetchParams) {\n  return fetchParams.controller.state === 'aborted' ||\n    fetchParams.controller.state === 'terminated'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-method-normalize\n * @param {string} method\n */\nfunction normalizeMethod (method) {\n  return normalizedMethodRecordsBase[method.toLowerCase()] ?? method\n}\n\n// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string\nfunction serializeJavascriptValueToJSONString (value) {\n  // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).\n  const result = JSON.stringify(value)\n\n  // 2. If result is undefined, then throw a TypeError.\n  if (result === undefined) {\n    throw new TypeError('Value is not JSON serializable')\n  }\n\n  // 3. Assert: result is a string.\n  assert(typeof result === 'string')\n\n  // 4. Return result.\n  return result\n}\n\n// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object\nconst esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n  class FastIterableIterator {\n    /** @type {any} */\n    #target\n    /** @type {'key' | 'value' | 'key+value'} */\n    #kind\n    /** @type {number} */\n    #index\n\n    /**\n     * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object\n     * @param {unknown} target\n     * @param {'key' | 'value' | 'key+value'} kind\n     */\n    constructor (target, kind) {\n      this.#target = target\n      this.#kind = kind\n      this.#index = 0\n    }\n\n    next () {\n      // 1. Let interface be the interface for which the iterator prototype object exists.\n      // 2. Let thisValue be the this value.\n      // 3. Let object be ? ToObject(thisValue).\n      // 4. If object is a platform object, then perform a security\n      //    check, passing:\n      // 5. If object is not a default iterator object for interface,\n      //    then throw a TypeError.\n      if (typeof this !== 'object' || this === null || !(#target in this)) {\n        throw new TypeError(\n          `'next' called on an object that does not implement interface ${name} Iterator.`\n        )\n      }\n\n      // 6. Let index be object’s index.\n      // 7. Let kind be object’s kind.\n      // 8. Let values be object’s target's value pairs to iterate over.\n      const index = this.#index\n      const values = this.#target[kInternalIterator]\n\n      // 9. Let len be the length of values.\n      const len = values.length\n\n      // 10. If index is greater than or equal to len, then return\n      //     CreateIterResultObject(undefined, true).\n      if (index >= len) {\n        return {\n          value: undefined,\n          done: true\n        }\n      }\n\n      // 11. Let pair be the entry in values at index index.\n      const { [keyIndex]: key, [valueIndex]: value } = values[index]\n\n      // 12. Set object’s index to index + 1.\n      this.#index = index + 1\n\n      // 13. Return the iterator result for pair and kind.\n\n      // https://webidl.spec.whatwg.org/#iterator-result\n\n      // 1. Let result be a value determined by the value of kind:\n      let result\n      switch (this.#kind) {\n        case 'key':\n          // 1. Let idlKey be pair’s key.\n          // 2. Let key be the result of converting idlKey to an\n          //    ECMAScript value.\n          // 3. result is key.\n          result = key\n          break\n        case 'value':\n          // 1. Let idlValue be pair’s value.\n          // 2. Let value be the result of converting idlValue to\n          //    an ECMAScript value.\n          // 3. result is value.\n          result = value\n          break\n        case 'key+value':\n          // 1. Let idlKey be pair’s key.\n          // 2. Let idlValue be pair’s value.\n          // 3. Let key be the result of converting idlKey to an\n          //    ECMAScript value.\n          // 4. Let value be the result of converting idlValue to\n          //    an ECMAScript value.\n          // 5. Let array be ! ArrayCreate(2).\n          // 6. Call ! CreateDataProperty(array, \"0\", key).\n          // 7. Call ! CreateDataProperty(array, \"1\", value).\n          // 8. result is array.\n          result = [key, value]\n          break\n      }\n\n      // 2. Return CreateIterResultObject(result, false).\n      return {\n        value: result,\n        done: false\n      }\n    }\n  }\n\n  // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n  // @ts-ignore\n  delete FastIterableIterator.prototype.constructor\n\n  Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype)\n\n  Object.defineProperties(FastIterableIterator.prototype, {\n    [Symbol.toStringTag]: {\n      writable: false,\n      enumerable: false,\n      configurable: true,\n      value: `${name} Iterator`\n    },\n    next: { writable: true, enumerable: true, configurable: true }\n  })\n\n  /**\n   * @param {unknown} target\n   * @param {'key' | 'value' | 'key+value'} kind\n   * @returns {IterableIterator}\n   */\n  return function (target, kind) {\n    return new FastIterableIterator(target, kind)\n  }\n}\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {any} object class\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n  const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex)\n\n  const properties = {\n    keys: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function keys () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'key')\n      }\n    },\n    values: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function values () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'value')\n      }\n    },\n    entries: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function entries () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'key+value')\n      }\n    },\n    forEach: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function forEach (callbackfn, thisArg = globalThis) {\n        webidl.brandCheck(this, object)\n        webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`)\n        if (typeof callbackfn !== 'function') {\n          throw new TypeError(\n            `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`\n          )\n        }\n        for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) {\n          callbackfn.call(thisArg, value, key, this)\n        }\n      }\n    }\n  }\n\n  return Object.defineProperties(object.prototype, {\n    ...properties,\n    [Symbol.iterator]: {\n      writable: true,\n      enumerable: false,\n      configurable: true,\n      value: properties.entries.value\n    }\n  })\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-fully-read\n */\nasync function fullyReadBody (body, processBody, processBodyError) {\n  // 1. If taskDestination is null, then set taskDestination to\n  //    the result of starting a new parallel queue.\n\n  // 2. Let successSteps given a byte sequence bytes be to queue a\n  //    fetch task to run processBody given bytes, with taskDestination.\n  const successSteps = processBody\n\n  // 3. Let errorSteps be to queue a fetch task to run processBodyError,\n  //    with taskDestination.\n  const errorSteps = processBodyError\n\n  // 4. Let reader be the result of getting a reader for body’s stream.\n  //    If that threw an exception, then run errorSteps with that\n  //    exception and return.\n  let reader\n\n  try {\n    reader = body.stream.getReader()\n  } catch (e) {\n    errorSteps(e)\n    return\n  }\n\n  // 5. Read all bytes from reader, given successSteps and errorSteps.\n  try {\n    successSteps(await readAllBytes(reader))\n  } catch (e) {\n    errorSteps(e)\n  }\n}\n\nfunction isReadableStreamLike (stream) {\n  return stream instanceof ReadableStream || (\n    stream[Symbol.toStringTag] === 'ReadableStream' &&\n    typeof stream.tee === 'function'\n  )\n}\n\n/**\n * @param {ReadableStreamController} controller\n */\nfunction readableStreamClose (controller) {\n  try {\n    controller.close()\n    controller.byobRequest?.respond(0)\n  } catch (err) {\n    // TODO: add comment explaining why this error occurs.\n    if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {\n      throw err\n    }\n  }\n}\n\nconst invalidIsomorphicEncodeValueRegex = /[^\\x00-\\xFF]/ // eslint-disable-line\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-encode\n * @param {string} input\n */\nfunction isomorphicEncode (input) {\n  // 1. Assert: input contains no code points greater than U+00FF.\n  assert(!invalidIsomorphicEncodeValueRegex.test(input))\n\n  // 2. Return a byte sequence whose length is equal to input’s code\n  //    point length and whose bytes have the same values as the\n  //    values of input’s code points, in the same order\n  return input\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes\n * @see https://streams.spec.whatwg.org/#read-loop\n * @param {ReadableStreamDefaultReader} reader\n */\nasync function readAllBytes (reader) {\n  const bytes = []\n  let byteLength = 0\n\n  while (true) {\n    const { done, value: chunk } = await reader.read()\n\n    if (done) {\n      // 1. Call successSteps with bytes.\n      return Buffer.concat(bytes, byteLength)\n    }\n\n    // 1. If chunk is not a Uint8Array object, call failureSteps\n    //    with a TypeError and abort these steps.\n    if (!isUint8Array(chunk)) {\n      throw new TypeError('Received non-Uint8Array chunk')\n    }\n\n    // 2. Append the bytes represented by chunk to bytes.\n    bytes.push(chunk)\n    byteLength += chunk.length\n\n    // 3. Read-loop given reader, bytes, successSteps, and failureSteps.\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#is-local\n * @param {URL} url\n */\nfunction urlIsLocal (url) {\n  assert('protocol' in url) // ensure it's a url object\n\n  const protocol = url.protocol\n\n  return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'\n}\n\n/**\n * @param {string|URL} url\n * @returns {boolean}\n */\nfunction urlHasHttpsScheme (url) {\n  return (\n    (\n      typeof url === 'string' &&\n      url[5] === ':' &&\n      url[0] === 'h' &&\n      url[1] === 't' &&\n      url[2] === 't' &&\n      url[3] === 'p' &&\n      url[4] === 's'\n    ) ||\n    url.protocol === 'https:'\n  )\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-scheme\n * @param {URL} url\n */\nfunction urlIsHttpHttpsScheme (url) {\n  assert('protocol' in url) // ensure it's a url object\n\n  const protocol = url.protocol\n\n  return protocol === 'http:' || protocol === 'https:'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#simple-range-header-value\n * @param {string} value\n * @param {boolean} allowWhitespace\n */\nfunction simpleRangeHeaderValue (value, allowWhitespace) {\n  // 1. Let data be the isomorphic decoding of value.\n  // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string,\n  // nothing more. We obviously don't need to do that if value is a string already.\n  const data = value\n\n  // 2. If data does not start with \"bytes\", then return failure.\n  if (!data.startsWith('bytes')) {\n    return 'failure'\n  }\n\n  // 3. Let position be a position variable for data, initially pointing at the 5th code point of data.\n  const position = { position: 5 }\n\n  // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n  //    from data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 5. If the code point at position within data is not U+003D (=), then return failure.\n  if (data.charCodeAt(position.position) !== 0x3D) {\n    return 'failure'\n  }\n\n  // 6. Advance position by 1.\n  position.position++\n\n  // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from\n  //    data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits,\n  //    from data given position.\n  const rangeStart = collectASequenceOfCodePoints(\n    (char) => {\n      const code = char.charCodeAt(0)\n\n      return code >= 0x30 && code <= 0x39\n    },\n    data,\n    position\n  )\n\n  // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the\n  //    empty string; otherwise null.\n  const rangeStartValue = rangeStart.length ? Number(rangeStart) : null\n\n  // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n  //     from data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 11. If the code point at position within data is not U+002D (-), then return failure.\n  if (data.charCodeAt(position.position) !== 0x2D) {\n    return 'failure'\n  }\n\n  // 12. Advance position by 1.\n  position.position++\n\n  // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab\n  //     or space, from data given position.\n  // Note from Khafra: its the same step as in #8 again lol\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 14. Let rangeEnd be the result of collecting a sequence of code points that are\n  //     ASCII digits, from data given position.\n  // Note from Khafra: you wouldn't guess it, but this is also the same step as #8\n  const rangeEnd = collectASequenceOfCodePoints(\n    (char) => {\n      const code = char.charCodeAt(0)\n\n      return code >= 0x30 && code <= 0x39\n    },\n    data,\n    position\n  )\n\n  // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd\n  //     is not the empty string; otherwise null.\n  // Note from Khafra: THE SAME STEP, AGAIN!!!\n  // Note: why interpret as a decimal if we only collect ascii digits?\n  const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null\n\n  // 16. If position is not past the end of data, then return failure.\n  if (position.position < data.length) {\n    return 'failure'\n  }\n\n  // 17. If rangeEndValue and rangeStartValue are null, then return failure.\n  if (rangeEndValue === null && rangeStartValue === null) {\n    return 'failure'\n  }\n\n  // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is\n  //     greater than rangeEndValue, then return failure.\n  // Note: ... when can they not be numbers?\n  if (rangeStartValue > rangeEndValue) {\n    return 'failure'\n  }\n\n  // 19. Return (rangeStartValue, rangeEndValue).\n  return { rangeStartValue, rangeEndValue }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#build-a-content-range\n * @param {number} rangeStart\n * @param {number} rangeEnd\n * @param {number} fullLength\n */\nfunction buildContentRange (rangeStart, rangeEnd, fullLength) {\n  // 1. Let contentRange be `bytes `.\n  let contentRange = 'bytes '\n\n  // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange.\n  contentRange += isomorphicEncode(`${rangeStart}`)\n\n  // 3. Append 0x2D (-) to contentRange.\n  contentRange += '-'\n\n  // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange.\n  contentRange += isomorphicEncode(`${rangeEnd}`)\n\n  // 5. Append 0x2F (/) to contentRange.\n  contentRange += '/'\n\n  // 6. Append fullLength, serialized and isomorphic encoded to contentRange.\n  contentRange += isomorphicEncode(`${fullLength}`)\n\n  // 7. Return contentRange.\n  return contentRange\n}\n\n// A Stream, which pipes the response to zlib.createInflate() or\n// zlib.createInflateRaw() depending on the first byte of the Buffer.\n// If the lower byte of the first byte is 0x08, then the stream is\n// interpreted as a zlib stream, otherwise it's interpreted as a\n// raw deflate stream.\nclass InflateStream extends Transform {\n  #zlibOptions\n\n  /** @param {zlib.ZlibOptions} [zlibOptions] */\n  constructor (zlibOptions) {\n    super()\n    this.#zlibOptions = zlibOptions\n  }\n\n  _transform (chunk, encoding, callback) {\n    if (!this._inflateStream) {\n      if (chunk.length === 0) {\n        callback()\n        return\n      }\n      this._inflateStream = (chunk[0] & 0x0F) === 0x08\n        ? zlib.createInflate(this.#zlibOptions)\n        : zlib.createInflateRaw(this.#zlibOptions)\n\n      this._inflateStream.on('data', this.push.bind(this))\n      this._inflateStream.on('end', () => this.push(null))\n      this._inflateStream.on('error', (err) => this.destroy(err))\n    }\n\n    this._inflateStream.write(chunk, encoding, callback)\n  }\n\n  _final (callback) {\n    if (this._inflateStream) {\n      this._inflateStream.end()\n      this._inflateStream = null\n    }\n    callback()\n  }\n}\n\n/**\n * @param {zlib.ZlibOptions} [zlibOptions]\n * @returns {InflateStream}\n */\nfunction createInflate (zlibOptions) {\n  return new InflateStream(zlibOptions)\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type\n * @param {import('./headers').HeadersList} headers\n */\nfunction extractMimeType (headers) {\n  // 1. Let charset be null.\n  let charset = null\n\n  // 2. Let essence be null.\n  let essence = null\n\n  // 3. Let mimeType be null.\n  let mimeType = null\n\n  // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers.\n  const values = getDecodeSplit('content-type', headers)\n\n  // 5. If values is null, then return failure.\n  if (values === null) {\n    return 'failure'\n  }\n\n  // 6. For each value of values:\n  for (const value of values) {\n    // 6.1. Let temporaryMimeType be the result of parsing value.\n    const temporaryMimeType = parseMIMEType(value)\n\n    // 6.2. If temporaryMimeType is failure or its essence is \"*/*\", then continue.\n    if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') {\n      continue\n    }\n\n    // 6.3. Set mimeType to temporaryMimeType.\n    mimeType = temporaryMimeType\n\n    // 6.4. If mimeType’s essence is not essence, then:\n    if (mimeType.essence !== essence) {\n      // 6.4.1. Set charset to null.\n      charset = null\n\n      // 6.4.2. If mimeType’s parameters[\"charset\"] exists, then set charset to\n      //        mimeType’s parameters[\"charset\"].\n      if (mimeType.parameters.has('charset')) {\n        charset = mimeType.parameters.get('charset')\n      }\n\n      // 6.4.3. Set essence to mimeType’s essence.\n      essence = mimeType.essence\n    } else if (!mimeType.parameters.has('charset') && charset !== null) {\n      // 6.5. Otherwise, if mimeType’s parameters[\"charset\"] does not exist, and\n      //      charset is non-null, set mimeType’s parameters[\"charset\"] to charset.\n      mimeType.parameters.set('charset', charset)\n    }\n  }\n\n  // 7. If mimeType is null, then return failure.\n  if (mimeType == null) {\n    return 'failure'\n  }\n\n  // 8. Return mimeType.\n  return mimeType\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split\n * @param {string|null} value\n */\nfunction gettingDecodingSplitting (value) {\n  // 1. Let input be the result of isomorphic decoding value.\n  const input = value\n\n  // 2. Let position be a position variable for input, initially pointing at the start of input.\n  const position = { position: 0 }\n\n  // 3. Let values be a list of strings, initially empty.\n  const values = []\n\n  // 4. Let temporaryValue be the empty string.\n  let temporaryValue = ''\n\n  // 5. While position is not past the end of input:\n  while (position.position < input.length) {\n    // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (\")\n    //      or U+002C (,) from input, given position, to temporaryValue.\n    temporaryValue += collectASequenceOfCodePoints(\n      (char) => char !== '\"' && char !== ',',\n      input,\n      position\n    )\n\n    // 5.2. If position is not past the end of input, then:\n    if (position.position < input.length) {\n      // 5.2.1. If the code point at position within input is U+0022 (\"), then:\n      if (input.charCodeAt(position.position) === 0x22) {\n        // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue.\n        temporaryValue += collectAnHTTPQuotedString(\n          input,\n          position\n        )\n\n        // 5.2.1.2. If position is not past the end of input, then continue.\n        if (position.position < input.length) {\n          continue\n        }\n      } else {\n        // 5.2.2. Otherwise:\n\n        // 5.2.2.1. Assert: the code point at position within input is U+002C (,).\n        assert(input.charCodeAt(position.position) === 0x2C)\n\n        // 5.2.2.2. Advance position by 1.\n        position.position++\n      }\n    }\n\n    // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue.\n    temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20)\n\n    // 5.4. Append temporaryValue to values.\n    values.push(temporaryValue)\n\n    // 5.6. Set temporaryValue to the empty string.\n    temporaryValue = ''\n  }\n\n  // 6. Return values.\n  return values\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split\n * @param {string} name lowercase header name\n * @param {import('./headers').HeadersList} list\n */\nfunction getDecodeSplit (name, list) {\n  // 1. Let value be the result of getting name from list.\n  const value = list.get(name, true)\n\n  // 2. If value is null, then return null.\n  if (value === null) {\n    return null\n  }\n\n  // 3. Return the result of getting, decoding, and splitting value.\n  return gettingDecodingSplitting(value)\n}\n\nconst textDecoder = new TextDecoder()\n\n/**\n * @see https://encoding.spec.whatwg.org/#utf-8-decode\n * @param {Buffer} buffer\n */\nfunction utf8DecodeBytes (buffer) {\n  if (buffer.length === 0) {\n    return ''\n  }\n\n  // 1. Let buffer be the result of peeking three bytes from\n  //    ioQueue, converted to a byte sequence.\n\n  // 2. If buffer is 0xEF 0xBB 0xBF, then read three\n  //    bytes from ioQueue. (Do nothing with those bytes.)\n  if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {\n    buffer = buffer.subarray(3)\n  }\n\n  // 3. Process a queue with an instance of UTF-8’s\n  //    decoder, ioQueue, output, and \"replacement\".\n  const output = textDecoder.decode(buffer)\n\n  // 4. Return output.\n  return output\n}\n\nclass EnvironmentSettingsObjectBase {\n  get baseUrl () {\n    return getGlobalOrigin()\n  }\n\n  get origin () {\n    return this.baseUrl?.origin\n  }\n\n  policyContainer = makePolicyContainer()\n}\n\nclass EnvironmentSettingsObject {\n  settingsObject = new EnvironmentSettingsObjectBase()\n}\n\nconst environmentSettingsObject = new EnvironmentSettingsObject()\n\nmodule.exports = {\n  isAborted,\n  isCancelled,\n  isValidEncodedURL,\n  createDeferredPromise,\n  ReadableStreamFrom,\n  tryUpgradeRequestToAPotentiallyTrustworthyURL,\n  clampAndCoarsenConnectionTimingInfo,\n  coarsenedSharedCurrentTime,\n  determineRequestsReferrer,\n  makePolicyContainer,\n  clonePolicyContainer,\n  appendFetchMetadata,\n  appendRequestOriginHeader,\n  TAOCheck,\n  corsCheck,\n  crossOriginResourcePolicyCheck,\n  createOpaqueTimingInfo,\n  setRequestReferrerPolicyOnRedirect,\n  isValidHTTPToken,\n  requestBadPort,\n  requestCurrentURL,\n  responseURL,\n  responseLocationURL,\n  isBlobLike,\n  isURLPotentiallyTrustworthy,\n  isValidReasonPhrase,\n  sameOrigin,\n  normalizeMethod,\n  serializeJavascriptValueToJSONString,\n  iteratorMixin,\n  createIterator,\n  isValidHeaderName,\n  isValidHeaderValue,\n  isErrorLike,\n  fullyReadBody,\n  bytesMatch,\n  isReadableStreamLike,\n  readableStreamClose,\n  isomorphicEncode,\n  urlIsLocal,\n  urlHasHttpsScheme,\n  urlIsHttpHttpsScheme,\n  readAllBytes,\n  simpleRangeHeaderValue,\n  buildContentRange,\n  parseMetadata,\n  createInflate,\n  extractMimeType,\n  getDecodeSplit,\n  utf8DecodeBytes,\n  environmentSettingsObject\n}\n","'use strict'\n\nconst { types, inspect } = require('node:util')\nconst { markAsUncloneable } = require('node:worker_threads')\nconst { toUSVString } = require('../../core/util')\n\n/** @type {import('../../../types/webidl').Webidl} */\nconst webidl = {}\nwebidl.converters = {}\nwebidl.util = {}\nwebidl.errors = {}\n\nwebidl.errors.exception = function (message) {\n  return new TypeError(`${message.header}: ${message.message}`)\n}\n\nwebidl.errors.conversionFailed = function (context) {\n  const plural = context.types.length === 1 ? '' : ' one of'\n  const message =\n    `${context.argument} could not be converted to` +\n    `${plural}: ${context.types.join(', ')}.`\n\n  return webidl.errors.exception({\n    header: context.prefix,\n    message\n  })\n}\n\nwebidl.errors.invalidArgument = function (context) {\n  return webidl.errors.exception({\n    header: context.prefix,\n    message: `\"${context.value}\" is an invalid ${context.type}.`\n  })\n}\n\n// https://webidl.spec.whatwg.org/#implements\nwebidl.brandCheck = function (V, I, opts) {\n  if (opts?.strict !== false) {\n    if (!(V instanceof I)) {\n      const err = new TypeError('Illegal invocation')\n      err.code = 'ERR_INVALID_THIS' // node compat.\n      throw err\n    }\n  } else {\n    if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {\n      const err = new TypeError('Illegal invocation')\n      err.code = 'ERR_INVALID_THIS' // node compat.\n      throw err\n    }\n  }\n}\n\nwebidl.argumentLengthCheck = function ({ length }, min, ctx) {\n  if (length < min) {\n    throw webidl.errors.exception({\n      message: `${min} argument${min !== 1 ? 's' : ''} required, ` +\n               `but${length ? ' only' : ''} ${length} found.`,\n      header: ctx\n    })\n  }\n}\n\nwebidl.illegalConstructor = function () {\n  throw webidl.errors.exception({\n    header: 'TypeError',\n    message: 'Illegal constructor'\n  })\n}\n\n// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\nwebidl.util.Type = function (V) {\n  switch (typeof V) {\n    case 'undefined': return 'Undefined'\n    case 'boolean': return 'Boolean'\n    case 'string': return 'String'\n    case 'symbol': return 'Symbol'\n    case 'number': return 'Number'\n    case 'bigint': return 'BigInt'\n    case 'function':\n    case 'object': {\n      if (V === null) {\n        return 'Null'\n      }\n\n      return 'Object'\n    }\n  }\n}\n\nwebidl.util.markAsUncloneable = markAsUncloneable || (() => {})\n// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint\nwebidl.util.ConvertToInt = function (V, bitLength, signedness, opts) {\n  let upperBound\n  let lowerBound\n\n  // 1. If bitLength is 64, then:\n  if (bitLength === 64) {\n    // 1. Let upperBound be 2^53 − 1.\n    upperBound = Math.pow(2, 53) - 1\n\n    // 2. If signedness is \"unsigned\", then let lowerBound be 0.\n    if (signedness === 'unsigned') {\n      lowerBound = 0\n    } else {\n      // 3. Otherwise let lowerBound be −2^53 + 1.\n      lowerBound = Math.pow(-2, 53) + 1\n    }\n  } else if (signedness === 'unsigned') {\n    // 2. Otherwise, if signedness is \"unsigned\", then:\n\n    // 1. Let lowerBound be 0.\n    lowerBound = 0\n\n    // 2. Let upperBound be 2^bitLength − 1.\n    upperBound = Math.pow(2, bitLength) - 1\n  } else {\n    // 3. Otherwise:\n\n    // 1. Let lowerBound be -2^bitLength − 1.\n    lowerBound = Math.pow(-2, bitLength) - 1\n\n    // 2. Let upperBound be 2^bitLength − 1 − 1.\n    upperBound = Math.pow(2, bitLength - 1) - 1\n  }\n\n  // 4. Let x be ? ToNumber(V).\n  let x = Number(V)\n\n  // 5. If x is −0, then set x to +0.\n  if (x === 0) {\n    x = 0\n  }\n\n  // 6. If the conversion is to an IDL type associated\n  //    with the [EnforceRange] extended attribute, then:\n  if (opts?.enforceRange === true) {\n    // 1. If x is NaN, +∞, or −∞, then throw a TypeError.\n    if (\n      Number.isNaN(x) ||\n      x === Number.POSITIVE_INFINITY ||\n      x === Number.NEGATIVE_INFINITY\n    ) {\n      throw webidl.errors.exception({\n        header: 'Integer conversion',\n        message: `Could not convert ${webidl.util.Stringify(V)} to an integer.`\n      })\n    }\n\n    // 2. Set x to IntegerPart(x).\n    x = webidl.util.IntegerPart(x)\n\n    // 3. If x < lowerBound or x > upperBound, then\n    //    throw a TypeError.\n    if (x < lowerBound || x > upperBound) {\n      throw webidl.errors.exception({\n        header: 'Integer conversion',\n        message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n      })\n    }\n\n    // 4. Return x.\n    return x\n  }\n\n  // 7. If x is not NaN and the conversion is to an IDL\n  //    type associated with the [Clamp] extended\n  //    attribute, then:\n  if (!Number.isNaN(x) && opts?.clamp === true) {\n    // 1. Set x to min(max(x, lowerBound), upperBound).\n    x = Math.min(Math.max(x, lowerBound), upperBound)\n\n    // 2. Round x to the nearest integer, choosing the\n    //    even integer if it lies halfway between two,\n    //    and choosing +0 rather than −0.\n    if (Math.floor(x) % 2 === 0) {\n      x = Math.floor(x)\n    } else {\n      x = Math.ceil(x)\n    }\n\n    // 3. Return x.\n    return x\n  }\n\n  // 8. If x is NaN, +0, +∞, or −∞, then return +0.\n  if (\n    Number.isNaN(x) ||\n    (x === 0 && Object.is(0, x)) ||\n    x === Number.POSITIVE_INFINITY ||\n    x === Number.NEGATIVE_INFINITY\n  ) {\n    return 0\n  }\n\n  // 9. Set x to IntegerPart(x).\n  x = webidl.util.IntegerPart(x)\n\n  // 10. Set x to x modulo 2^bitLength.\n  x = x % Math.pow(2, bitLength)\n\n  // 11. If signedness is \"signed\" and x ≥ 2^bitLength − 1,\n  //    then return x − 2^bitLength.\n  if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {\n    return x - Math.pow(2, bitLength)\n  }\n\n  // 12. Otherwise, return x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart\nwebidl.util.IntegerPart = function (n) {\n  // 1. Let r be floor(abs(n)).\n  const r = Math.floor(Math.abs(n))\n\n  // 2. If n < 0, then return -1 × r.\n  if (n < 0) {\n    return -1 * r\n  }\n\n  // 3. Otherwise, return r.\n  return r\n}\n\nwebidl.util.Stringify = function (V) {\n  const type = webidl.util.Type(V)\n\n  switch (type) {\n    case 'Symbol':\n      return `Symbol(${V.description})`\n    case 'Object':\n      return inspect(V)\n    case 'String':\n      return `\"${V}\"`\n    default:\n      return `${V}`\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-sequence\nwebidl.sequenceConverter = function (converter) {\n  return (V, prefix, argument, Iterable) => {\n    // 1. If Type(V) is not Object, throw a TypeError.\n    if (webidl.util.Type(V) !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.`\n      })\n    }\n\n    // 2. Let method be ? GetMethod(V, @@iterator).\n    /** @type {Generator} */\n    const method = typeof Iterable === 'function' ? Iterable() : V?.[Symbol.iterator]?.()\n    const seq = []\n    let index = 0\n\n    // 3. If method is undefined, throw a TypeError.\n    if (\n      method === undefined ||\n      typeof method.next !== 'function'\n    ) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} is not iterable.`\n      })\n    }\n\n    // https://webidl.spec.whatwg.org/#create-sequence-from-iterable\n    while (true) {\n      const { done, value } = method.next()\n\n      if (done) {\n        break\n      }\n\n      seq.push(converter(value, prefix, `${argument}[${index++}]`))\n    }\n\n    return seq\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-to-record\nwebidl.recordConverter = function (keyConverter, valueConverter) {\n  return (O, prefix, argument) => {\n    // 1. If Type(O) is not Object, throw a TypeError.\n    if (webidl.util.Type(O) !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} (\"${webidl.util.Type(O)}\") is not an Object.`\n      })\n    }\n\n    // 2. Let result be a new empty instance of record.\n    const result = {}\n\n    if (!types.isProxy(O)) {\n      // 1. Let desc be ? O.[[GetOwnProperty]](key).\n      const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]\n\n      for (const key of keys) {\n        // 1. Let typedKey be key converted to an IDL value of type K.\n        const typedKey = keyConverter(key, prefix, argument)\n\n        // 2. Let value be ? Get(O, key).\n        // 3. Let typedValue be value converted to an IDL value of type V.\n        const typedValue = valueConverter(O[key], prefix, argument)\n\n        // 4. Set result[typedKey] to typedValue.\n        result[typedKey] = typedValue\n      }\n\n      // 5. Return result.\n      return result\n    }\n\n    // 3. Let keys be ? O.[[OwnPropertyKeys]]().\n    const keys = Reflect.ownKeys(O)\n\n    // 4. For each key of keys.\n    for (const key of keys) {\n      // 1. Let desc be ? O.[[GetOwnProperty]](key).\n      const desc = Reflect.getOwnPropertyDescriptor(O, key)\n\n      // 2. If desc is not undefined and desc.[[Enumerable]] is true:\n      if (desc?.enumerable) {\n        // 1. Let typedKey be key converted to an IDL value of type K.\n        const typedKey = keyConverter(key, prefix, argument)\n\n        // 2. Let value be ? Get(O, key).\n        // 3. Let typedValue be value converted to an IDL value of type V.\n        const typedValue = valueConverter(O[key], prefix, argument)\n\n        // 4. Set result[typedKey] to typedValue.\n        result[typedKey] = typedValue\n      }\n    }\n\n    // 5. Return result.\n    return result\n  }\n}\n\nwebidl.interfaceConverter = function (i) {\n  return (V, prefix, argument, opts) => {\n    if (opts?.strict !== false && !(V instanceof i)) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `Expected ${argument} (\"${webidl.util.Stringify(V)}\") to be an instance of ${i.name}.`\n      })\n    }\n\n    return V\n  }\n}\n\nwebidl.dictionaryConverter = function (converters) {\n  return (dictionary, prefix, argument) => {\n    const type = webidl.util.Type(dictionary)\n    const dict = {}\n\n    if (type === 'Null' || type === 'Undefined') {\n      return dict\n    } else if (type !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n      })\n    }\n\n    for (const options of converters) {\n      const { key, defaultValue, required, converter } = options\n\n      if (required === true) {\n        if (!Object.hasOwn(dictionary, key)) {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: `Missing required key \"${key}\".`\n          })\n        }\n      }\n\n      let value = dictionary[key]\n      const hasDefault = Object.hasOwn(options, 'defaultValue')\n\n      // Only use defaultValue if value is undefined and\n      // a defaultValue options was provided.\n      if (hasDefault && value !== null) {\n        value ??= defaultValue()\n      }\n\n      // A key can be optional and have no default value.\n      // When this happens, do not perform a conversion,\n      // and do not assign the key a value.\n      if (required || hasDefault || value !== undefined) {\n        value = converter(value, prefix, `${argument}.${key}`)\n\n        if (\n          options.allowedValues &&\n          !options.allowedValues.includes(value)\n        ) {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`\n          })\n        }\n\n        dict[key] = value\n      }\n    }\n\n    return dict\n  }\n}\n\nwebidl.nullableConverter = function (converter) {\n  return (V, prefix, argument) => {\n    if (V === null) {\n      return V\n    }\n\n    return converter(V, prefix, argument)\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-DOMString\nwebidl.converters.DOMString = function (V, prefix, argument, opts) {\n  // 1. If V is null and the conversion is to an IDL type\n  //    associated with the [LegacyNullToEmptyString]\n  //    extended attribute, then return the DOMString value\n  //    that represents the empty string.\n  if (V === null && opts?.legacyNullToEmptyString) {\n    return ''\n  }\n\n  // 2. Let x be ? ToString(V).\n  if (typeof V === 'symbol') {\n    throw webidl.errors.exception({\n      header: prefix,\n      message: `${argument} is a symbol, which cannot be converted to a DOMString.`\n    })\n  }\n\n  // 3. Return the IDL DOMString value that represents the\n  //    same sequence of code units as the one the\n  //    ECMAScript String value x represents.\n  return String(V)\n}\n\n// https://webidl.spec.whatwg.org/#es-ByteString\nwebidl.converters.ByteString = function (V, prefix, argument) {\n  // 1. Let x be ? ToString(V).\n  // Note: DOMString converter perform ? ToString(V)\n  const x = webidl.converters.DOMString(V, prefix, argument)\n\n  // 2. If the value of any element of x is greater than\n  //    255, then throw a TypeError.\n  for (let index = 0; index < x.length; index++) {\n    if (x.charCodeAt(index) > 255) {\n      throw new TypeError(\n        'Cannot convert argument to a ByteString because the character at ' +\n        `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`\n      )\n    }\n  }\n\n  // 3. Return an IDL ByteString value whose length is the\n  //    length of x, and where the value of each element is\n  //    the value of the corresponding element of x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-USVString\n// TODO: rewrite this so we can control the errors thrown\nwebidl.converters.USVString = toUSVString\n\n// https://webidl.spec.whatwg.org/#es-boolean\nwebidl.converters.boolean = function (V) {\n  // 1. Let x be the result of computing ToBoolean(V).\n  const x = Boolean(V)\n\n  // 2. Return the IDL boolean value that is the one that represents\n  //    the same truth value as the ECMAScript Boolean value x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-any\nwebidl.converters.any = function (V) {\n  return V\n}\n\n// https://webidl.spec.whatwg.org/#es-long-long\nwebidl.converters['long long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 64, \"signed\").\n  const x = webidl.util.ConvertToInt(V, 64, 'signed', undefined, prefix, argument)\n\n  // 2. Return the IDL long long value that represents\n  //    the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long-long\nwebidl.converters['unsigned long long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 64, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 64, 'unsigned', undefined, prefix, argument)\n\n  // 2. Return the IDL unsigned long long value that\n  //    represents the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long\nwebidl.converters['unsigned long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 32, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 32, 'unsigned', undefined, prefix, argument)\n\n  // 2. Return the IDL unsigned long value that\n  //    represents the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-short\nwebidl.converters['unsigned short'] = function (V, prefix, argument, opts) {\n  // 1. Let x be ? ConvertToInt(V, 16, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts, prefix, argument)\n\n  // 2. Return the IDL unsigned short value that represents\n  //    the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#idl-ArrayBuffer\nwebidl.converters.ArrayBuffer = function (V, prefix, argument, opts) {\n  // 1. If Type(V) is not Object, or V does not have an\n  //    [[ArrayBufferData]] internal slot, then throw a\n  //    TypeError.\n  // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances\n  // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances\n  if (\n    webidl.util.Type(V) !== 'Object' ||\n    !types.isAnyArrayBuffer(V)\n  ) {\n    throw webidl.errors.conversionFailed({\n      prefix,\n      argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n      types: ['ArrayBuffer']\n    })\n  }\n\n  // 2. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V) is true, then throw a\n  //    TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V) is true, then throw a\n  //    TypeError.\n  if (V.resizable || V.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 4. Return the IDL ArrayBuffer value that is a\n  //    reference to the same object as V.\n  return V\n}\n\nwebidl.converters.TypedArray = function (V, T, prefix, name, opts) {\n  // 1. Let T be the IDL type V is being converted to.\n\n  // 2. If Type(V) is not Object, or V does not have a\n  //    [[TypedArrayName]] internal slot with a value\n  //    equal to T’s name, then throw a TypeError.\n  if (\n    webidl.util.Type(V) !== 'Object' ||\n    !types.isTypedArray(V) ||\n    V.constructor.name !== T.name\n  ) {\n    throw webidl.errors.conversionFailed({\n      prefix,\n      argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n      types: [T.name]\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 4. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (V.buffer.resizable || V.buffer.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 5. Return the IDL value of type T that is a reference\n  //    to the same object as V.\n  return V\n}\n\nwebidl.converters.DataView = function (V, prefix, name, opts) {\n  // 1. If Type(V) is not Object, or V does not have a\n  //    [[DataView]] internal slot, then throw a TypeError.\n  if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {\n    throw webidl.errors.exception({\n      header: prefix,\n      message: `${name} is not a DataView.`\n    })\n  }\n\n  // 2. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,\n  //    then throw a TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (V.buffer.resizable || V.buffer.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 4. Return the IDL DataView value that is a reference\n  //    to the same object as V.\n  return V\n}\n\n// https://webidl.spec.whatwg.org/#BufferSource\nwebidl.converters.BufferSource = function (V, prefix, name, opts) {\n  if (types.isAnyArrayBuffer(V)) {\n    return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false })\n  }\n\n  if (types.isTypedArray(V)) {\n    return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false })\n  }\n\n  if (types.isDataView(V)) {\n    return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false })\n  }\n\n  throw webidl.errors.conversionFailed({\n    prefix,\n    argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n    types: ['BufferSource']\n  })\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.ByteString\n)\n\nwebidl.converters['sequence>'] = webidl.sequenceConverter(\n  webidl.converters['sequence']\n)\n\nwebidl.converters['record'] = webidl.recordConverter(\n  webidl.converters.ByteString,\n  webidl.converters.ByteString\n)\n\nmodule.exports = {\n  webidl\n}\n","'use strict'\n\n/**\n * @see https://encoding.spec.whatwg.org/#concept-encoding-get\n * @param {string|undefined} label\n */\nfunction getEncoding (label) {\n  if (!label) {\n    return 'failure'\n  }\n\n  // 1. Remove any leading and trailing ASCII whitespace from label.\n  // 2. If label is an ASCII case-insensitive match for any of the\n  //    labels listed in the table below, then return the\n  //    corresponding encoding; otherwise return failure.\n  switch (label.trim().toLowerCase()) {\n    case 'unicode-1-1-utf-8':\n    case 'unicode11utf8':\n    case 'unicode20utf8':\n    case 'utf-8':\n    case 'utf8':\n    case 'x-unicode20utf8':\n      return 'UTF-8'\n    case '866':\n    case 'cp866':\n    case 'csibm866':\n    case 'ibm866':\n      return 'IBM866'\n    case 'csisolatin2':\n    case 'iso-8859-2':\n    case 'iso-ir-101':\n    case 'iso8859-2':\n    case 'iso88592':\n    case 'iso_8859-2':\n    case 'iso_8859-2:1987':\n    case 'l2':\n    case 'latin2':\n      return 'ISO-8859-2'\n    case 'csisolatin3':\n    case 'iso-8859-3':\n    case 'iso-ir-109':\n    case 'iso8859-3':\n    case 'iso88593':\n    case 'iso_8859-3':\n    case 'iso_8859-3:1988':\n    case 'l3':\n    case 'latin3':\n      return 'ISO-8859-3'\n    case 'csisolatin4':\n    case 'iso-8859-4':\n    case 'iso-ir-110':\n    case 'iso8859-4':\n    case 'iso88594':\n    case 'iso_8859-4':\n    case 'iso_8859-4:1988':\n    case 'l4':\n    case 'latin4':\n      return 'ISO-8859-4'\n    case 'csisolatincyrillic':\n    case 'cyrillic':\n    case 'iso-8859-5':\n    case 'iso-ir-144':\n    case 'iso8859-5':\n    case 'iso88595':\n    case 'iso_8859-5':\n    case 'iso_8859-5:1988':\n      return 'ISO-8859-5'\n    case 'arabic':\n    case 'asmo-708':\n    case 'csiso88596e':\n    case 'csiso88596i':\n    case 'csisolatinarabic':\n    case 'ecma-114':\n    case 'iso-8859-6':\n    case 'iso-8859-6-e':\n    case 'iso-8859-6-i':\n    case 'iso-ir-127':\n    case 'iso8859-6':\n    case 'iso88596':\n    case 'iso_8859-6':\n    case 'iso_8859-6:1987':\n      return 'ISO-8859-6'\n    case 'csisolatingreek':\n    case 'ecma-118':\n    case 'elot_928':\n    case 'greek':\n    case 'greek8':\n    case 'iso-8859-7':\n    case 'iso-ir-126':\n    case 'iso8859-7':\n    case 'iso88597':\n    case 'iso_8859-7':\n    case 'iso_8859-7:1987':\n    case 'sun_eu_greek':\n      return 'ISO-8859-7'\n    case 'csiso88598e':\n    case 'csisolatinhebrew':\n    case 'hebrew':\n    case 'iso-8859-8':\n    case 'iso-8859-8-e':\n    case 'iso-ir-138':\n    case 'iso8859-8':\n    case 'iso88598':\n    case 'iso_8859-8':\n    case 'iso_8859-8:1988':\n    case 'visual':\n      return 'ISO-8859-8'\n    case 'csiso88598i':\n    case 'iso-8859-8-i':\n    case 'logical':\n      return 'ISO-8859-8-I'\n    case 'csisolatin6':\n    case 'iso-8859-10':\n    case 'iso-ir-157':\n    case 'iso8859-10':\n    case 'iso885910':\n    case 'l6':\n    case 'latin6':\n      return 'ISO-8859-10'\n    case 'iso-8859-13':\n    case 'iso8859-13':\n    case 'iso885913':\n      return 'ISO-8859-13'\n    case 'iso-8859-14':\n    case 'iso8859-14':\n    case 'iso885914':\n      return 'ISO-8859-14'\n    case 'csisolatin9':\n    case 'iso-8859-15':\n    case 'iso8859-15':\n    case 'iso885915':\n    case 'iso_8859-15':\n    case 'l9':\n      return 'ISO-8859-15'\n    case 'iso-8859-16':\n      return 'ISO-8859-16'\n    case 'cskoi8r':\n    case 'koi':\n    case 'koi8':\n    case 'koi8-r':\n    case 'koi8_r':\n      return 'KOI8-R'\n    case 'koi8-ru':\n    case 'koi8-u':\n      return 'KOI8-U'\n    case 'csmacintosh':\n    case 'mac':\n    case 'macintosh':\n    case 'x-mac-roman':\n      return 'macintosh'\n    case 'iso-8859-11':\n    case 'iso8859-11':\n    case 'iso885911':\n    case 'tis-620':\n    case 'windows-874':\n      return 'windows-874'\n    case 'cp1250':\n    case 'windows-1250':\n    case 'x-cp1250':\n      return 'windows-1250'\n    case 'cp1251':\n    case 'windows-1251':\n    case 'x-cp1251':\n      return 'windows-1251'\n    case 'ansi_x3.4-1968':\n    case 'ascii':\n    case 'cp1252':\n    case 'cp819':\n    case 'csisolatin1':\n    case 'ibm819':\n    case 'iso-8859-1':\n    case 'iso-ir-100':\n    case 'iso8859-1':\n    case 'iso88591':\n    case 'iso_8859-1':\n    case 'iso_8859-1:1987':\n    case 'l1':\n    case 'latin1':\n    case 'us-ascii':\n    case 'windows-1252':\n    case 'x-cp1252':\n      return 'windows-1252'\n    case 'cp1253':\n    case 'windows-1253':\n    case 'x-cp1253':\n      return 'windows-1253'\n    case 'cp1254':\n    case 'csisolatin5':\n    case 'iso-8859-9':\n    case 'iso-ir-148':\n    case 'iso8859-9':\n    case 'iso88599':\n    case 'iso_8859-9':\n    case 'iso_8859-9:1989':\n    case 'l5':\n    case 'latin5':\n    case 'windows-1254':\n    case 'x-cp1254':\n      return 'windows-1254'\n    case 'cp1255':\n    case 'windows-1255':\n    case 'x-cp1255':\n      return 'windows-1255'\n    case 'cp1256':\n    case 'windows-1256':\n    case 'x-cp1256':\n      return 'windows-1256'\n    case 'cp1257':\n    case 'windows-1257':\n    case 'x-cp1257':\n      return 'windows-1257'\n    case 'cp1258':\n    case 'windows-1258':\n    case 'x-cp1258':\n      return 'windows-1258'\n    case 'x-mac-cyrillic':\n    case 'x-mac-ukrainian':\n      return 'x-mac-cyrillic'\n    case 'chinese':\n    case 'csgb2312':\n    case 'csiso58gb231280':\n    case 'gb2312':\n    case 'gb_2312':\n    case 'gb_2312-80':\n    case 'gbk':\n    case 'iso-ir-58':\n    case 'x-gbk':\n      return 'GBK'\n    case 'gb18030':\n      return 'gb18030'\n    case 'big5':\n    case 'big5-hkscs':\n    case 'cn-big5':\n    case 'csbig5':\n    case 'x-x-big5':\n      return 'Big5'\n    case 'cseucpkdfmtjapanese':\n    case 'euc-jp':\n    case 'x-euc-jp':\n      return 'EUC-JP'\n    case 'csiso2022jp':\n    case 'iso-2022-jp':\n      return 'ISO-2022-JP'\n    case 'csshiftjis':\n    case 'ms932':\n    case 'ms_kanji':\n    case 'shift-jis':\n    case 'shift_jis':\n    case 'sjis':\n    case 'windows-31j':\n    case 'x-sjis':\n      return 'Shift_JIS'\n    case 'cseuckr':\n    case 'csksc56011987':\n    case 'euc-kr':\n    case 'iso-ir-149':\n    case 'korean':\n    case 'ks_c_5601-1987':\n    case 'ks_c_5601-1989':\n    case 'ksc5601':\n    case 'ksc_5601':\n    case 'windows-949':\n      return 'EUC-KR'\n    case 'csiso2022kr':\n    case 'hz-gb-2312':\n    case 'iso-2022-cn':\n    case 'iso-2022-cn-ext':\n    case 'iso-2022-kr':\n    case 'replacement':\n      return 'replacement'\n    case 'unicodefffe':\n    case 'utf-16be':\n      return 'UTF-16BE'\n    case 'csunicode':\n    case 'iso-10646-ucs-2':\n    case 'ucs-2':\n    case 'unicode':\n    case 'unicodefeff':\n    case 'utf-16':\n    case 'utf-16le':\n      return 'UTF-16LE'\n    case 'x-user-defined':\n      return 'x-user-defined'\n    default: return 'failure'\n  }\n}\n\nmodule.exports = {\n  getEncoding\n}\n","'use strict'\n\nconst {\n  staticPropertyDescriptors,\n  readOperation,\n  fireAProgressEvent\n} = require('./util')\nconst {\n  kState,\n  kError,\n  kResult,\n  kEvents,\n  kAborted\n} = require('./symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass FileReader extends EventTarget {\n  constructor () {\n    super()\n\n    this[kState] = 'empty'\n    this[kResult] = null\n    this[kError] = null\n    this[kEvents] = {\n      loadend: null,\n      error: null,\n      abort: null,\n      load: null,\n      progress: null,\n      loadstart: null\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer\n   * @param {import('buffer').Blob} blob\n   */\n  readAsArrayBuffer (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsArrayBuffer')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsArrayBuffer(blob) method, when invoked,\n    // must initiate a read operation for blob with ArrayBuffer.\n    readOperation(this, blob, 'ArrayBuffer')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#readAsBinaryString\n   * @param {import('buffer').Blob} blob\n   */\n  readAsBinaryString (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsBinaryString')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsBinaryString(blob) method, when invoked,\n    // must initiate a read operation for blob with BinaryString.\n    readOperation(this, blob, 'BinaryString')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#readAsDataText\n   * @param {import('buffer').Blob} blob\n   * @param {string?} encoding\n   */\n  readAsText (blob, encoding = undefined) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsText')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    if (encoding !== undefined) {\n      encoding = webidl.converters.DOMString(encoding, 'FileReader.readAsText', 'encoding')\n    }\n\n    // The readAsText(blob, encoding) method, when invoked,\n    // must initiate a read operation for blob with Text and encoding.\n    readOperation(this, blob, 'Text', encoding)\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL\n   * @param {import('buffer').Blob} blob\n   */\n  readAsDataURL (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsDataURL')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsDataURL(blob) method, when invoked, must\n    // initiate a read operation for blob with DataURL.\n    readOperation(this, blob, 'DataURL')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-abort\n   */\n  abort () {\n    // 1. If this's state is \"empty\" or if this's state is\n    //    \"done\" set this's result to null and terminate\n    //    this algorithm.\n    if (this[kState] === 'empty' || this[kState] === 'done') {\n      this[kResult] = null\n      return\n    }\n\n    // 2. If this's state is \"loading\" set this's state to\n    //    \"done\" and set this's result to null.\n    if (this[kState] === 'loading') {\n      this[kState] = 'done'\n      this[kResult] = null\n    }\n\n    // 3. If there are any tasks from this on the file reading\n    //    task source in an affiliated task queue, then remove\n    //    those tasks from that task queue.\n    this[kAborted] = true\n\n    // 4. Terminate the algorithm for the read method being processed.\n    // TODO\n\n    // 5. Fire a progress event called abort at this.\n    fireAProgressEvent('abort', this)\n\n    // 6. If this's state is not \"loading\", fire a progress\n    //    event called loadend at this.\n    if (this[kState] !== 'loading') {\n      fireAProgressEvent('loadend', this)\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate\n   */\n  get readyState () {\n    webidl.brandCheck(this, FileReader)\n\n    switch (this[kState]) {\n      case 'empty': return this.EMPTY\n      case 'loading': return this.LOADING\n      case 'done': return this.DONE\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-result\n   */\n  get result () {\n    webidl.brandCheck(this, FileReader)\n\n    // The result attribute’s getter, when invoked, must return\n    // this's result.\n    return this[kResult]\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-error\n   */\n  get error () {\n    webidl.brandCheck(this, FileReader)\n\n    // The error attribute’s getter, when invoked, must return\n    // this's error.\n    return this[kError]\n  }\n\n  get onloadend () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].loadend\n  }\n\n  set onloadend (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].loadend) {\n      this.removeEventListener('loadend', this[kEvents].loadend)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].loadend = fn\n      this.addEventListener('loadend', fn)\n    } else {\n      this[kEvents].loadend = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].error) {\n      this.removeEventListener('error', this[kEvents].error)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this[kEvents].error = null\n    }\n  }\n\n  get onloadstart () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].loadstart\n  }\n\n  set onloadstart (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].loadstart) {\n      this.removeEventListener('loadstart', this[kEvents].loadstart)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].loadstart = fn\n      this.addEventListener('loadstart', fn)\n    } else {\n      this[kEvents].loadstart = null\n    }\n  }\n\n  get onprogress () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].progress\n  }\n\n  set onprogress (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].progress) {\n      this.removeEventListener('progress', this[kEvents].progress)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].progress = fn\n      this.addEventListener('progress', fn)\n    } else {\n      this[kEvents].progress = null\n    }\n  }\n\n  get onload () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].load\n  }\n\n  set onload (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].load) {\n      this.removeEventListener('load', this[kEvents].load)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].load = fn\n      this.addEventListener('load', fn)\n    } else {\n      this[kEvents].load = null\n    }\n  }\n\n  get onabort () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].abort\n  }\n\n  set onabort (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].abort) {\n      this.removeEventListener('abort', this[kEvents].abort)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].abort = fn\n      this.addEventListener('abort', fn)\n    } else {\n      this[kEvents].abort = null\n    }\n  }\n}\n\n// https://w3c.github.io/FileAPI/#dom-filereader-empty\nFileReader.EMPTY = FileReader.prototype.EMPTY = 0\n// https://w3c.github.io/FileAPI/#dom-filereader-loading\nFileReader.LOADING = FileReader.prototype.LOADING = 1\n// https://w3c.github.io/FileAPI/#dom-filereader-done\nFileReader.DONE = FileReader.prototype.DONE = 2\n\nObject.defineProperties(FileReader.prototype, {\n  EMPTY: staticPropertyDescriptors,\n  LOADING: staticPropertyDescriptors,\n  DONE: staticPropertyDescriptors,\n  readAsArrayBuffer: kEnumerableProperty,\n  readAsBinaryString: kEnumerableProperty,\n  readAsText: kEnumerableProperty,\n  readAsDataURL: kEnumerableProperty,\n  abort: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  result: kEnumerableProperty,\n  error: kEnumerableProperty,\n  onloadstart: kEnumerableProperty,\n  onprogress: kEnumerableProperty,\n  onload: kEnumerableProperty,\n  onabort: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onloadend: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'FileReader',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(FileReader, {\n  EMPTY: staticPropertyDescriptors,\n  LOADING: staticPropertyDescriptors,\n  DONE: staticPropertyDescriptors\n})\n\nmodule.exports = {\n  FileReader\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\n\nconst kState = Symbol('ProgressEvent state')\n\n/**\n * @see https://xhr.spec.whatwg.org/#progressevent\n */\nclass ProgressEvent extends Event {\n  constructor (type, eventInitDict = {}) {\n    type = webidl.converters.DOMString(type, 'ProgressEvent constructor', 'type')\n    eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})\n\n    super(type, eventInitDict)\n\n    this[kState] = {\n      lengthComputable: eventInitDict.lengthComputable,\n      loaded: eventInitDict.loaded,\n      total: eventInitDict.total\n    }\n  }\n\n  get lengthComputable () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].lengthComputable\n  }\n\n  get loaded () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].loaded\n  }\n\n  get total () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].total\n  }\n}\n\nwebidl.converters.ProgressEventInit = webidl.dictionaryConverter([\n  {\n    key: 'lengthComputable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'loaded',\n    converter: webidl.converters['unsigned long long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'total',\n    converter: webidl.converters['unsigned long long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'bubbles',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'cancelable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'composed',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n])\n\nmodule.exports = {\n  ProgressEvent\n}\n","'use strict'\n\nmodule.exports = {\n  kState: Symbol('FileReader state'),\n  kResult: Symbol('FileReader result'),\n  kError: Symbol('FileReader error'),\n  kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),\n  kEvents: Symbol('FileReader events'),\n  kAborted: Symbol('FileReader aborted')\n}\n","'use strict'\n\nconst {\n  kState,\n  kError,\n  kResult,\n  kAborted,\n  kLastProgressEventFired\n} = require('./symbols')\nconst { ProgressEvent } = require('./progressevent')\nconst { getEncoding } = require('./encoding')\nconst { serializeAMimeType, parseMIMEType } = require('../fetch/data-url')\nconst { types } = require('node:util')\nconst { StringDecoder } = require('string_decoder')\nconst { btoa } = require('node:buffer')\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n  enumerable: true,\n  writable: false,\n  configurable: false\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#readOperation\n * @param {import('./filereader').FileReader} fr\n * @param {import('buffer').Blob} blob\n * @param {string} type\n * @param {string?} encodingName\n */\nfunction readOperation (fr, blob, type, encodingName) {\n  // 1. If fr’s state is \"loading\", throw an InvalidStateError\n  //    DOMException.\n  if (fr[kState] === 'loading') {\n    throw new DOMException('Invalid state', 'InvalidStateError')\n  }\n\n  // 2. Set fr’s state to \"loading\".\n  fr[kState] = 'loading'\n\n  // 3. Set fr’s result to null.\n  fr[kResult] = null\n\n  // 4. Set fr’s error to null.\n  fr[kError] = null\n\n  // 5. Let stream be the result of calling get stream on blob.\n  /** @type {import('stream/web').ReadableStream} */\n  const stream = blob.stream()\n\n  // 6. Let reader be the result of getting a reader from stream.\n  const reader = stream.getReader()\n\n  // 7. Let bytes be an empty byte sequence.\n  /** @type {Uint8Array[]} */\n  const bytes = []\n\n  // 8. Let chunkPromise be the result of reading a chunk from\n  //    stream with reader.\n  let chunkPromise = reader.read()\n\n  // 9. Let isFirstChunk be true.\n  let isFirstChunk = true\n\n  // 10. In parallel, while true:\n  // Note: \"In parallel\" just means non-blocking\n  // Note 2: readOperation itself cannot be async as double\n  // reading the body would then reject the promise, instead\n  // of throwing an error.\n  ;(async () => {\n    while (!fr[kAborted]) {\n      // 1. Wait for chunkPromise to be fulfilled or rejected.\n      try {\n        const { done, value } = await chunkPromise\n\n        // 2. If chunkPromise is fulfilled, and isFirstChunk is\n        //    true, queue a task to fire a progress event called\n        //    loadstart at fr.\n        if (isFirstChunk && !fr[kAborted]) {\n          queueMicrotask(() => {\n            fireAProgressEvent('loadstart', fr)\n          })\n        }\n\n        // 3. Set isFirstChunk to false.\n        isFirstChunk = false\n\n        // 4. If chunkPromise is fulfilled with an object whose\n        //    done property is false and whose value property is\n        //    a Uint8Array object, run these steps:\n        if (!done && types.isUint8Array(value)) {\n          // 1. Let bs be the byte sequence represented by the\n          //    Uint8Array object.\n\n          // 2. Append bs to bytes.\n          bytes.push(value)\n\n          // 3. If roughly 50ms have passed since these steps\n          //    were last invoked, queue a task to fire a\n          //    progress event called progress at fr.\n          if (\n            (\n              fr[kLastProgressEventFired] === undefined ||\n              Date.now() - fr[kLastProgressEventFired] >= 50\n            ) &&\n            !fr[kAborted]\n          ) {\n            fr[kLastProgressEventFired] = Date.now()\n            queueMicrotask(() => {\n              fireAProgressEvent('progress', fr)\n            })\n          }\n\n          // 4. Set chunkPromise to the result of reading a\n          //    chunk from stream with reader.\n          chunkPromise = reader.read()\n        } else if (done) {\n          // 5. Otherwise, if chunkPromise is fulfilled with an\n          //    object whose done property is true, queue a task\n          //    to run the following steps and abort this algorithm:\n          queueMicrotask(() => {\n            // 1. Set fr’s state to \"done\".\n            fr[kState] = 'done'\n\n            // 2. Let result be the result of package data given\n            //    bytes, type, blob’s type, and encodingName.\n            try {\n              const result = packageData(bytes, type, blob.type, encodingName)\n\n              // 4. Else:\n\n              if (fr[kAborted]) {\n                return\n              }\n\n              // 1. Set fr’s result to result.\n              fr[kResult] = result\n\n              // 2. Fire a progress event called load at the fr.\n              fireAProgressEvent('load', fr)\n            } catch (error) {\n              // 3. If package data threw an exception error:\n\n              // 1. Set fr’s error to error.\n              fr[kError] = error\n\n              // 2. Fire a progress event called error at fr.\n              fireAProgressEvent('error', fr)\n            }\n\n            // 5. If fr’s state is not \"loading\", fire a progress\n            //    event called loadend at the fr.\n            if (fr[kState] !== 'loading') {\n              fireAProgressEvent('loadend', fr)\n            }\n          })\n\n          break\n        }\n      } catch (error) {\n        if (fr[kAborted]) {\n          return\n        }\n\n        // 6. Otherwise, if chunkPromise is rejected with an\n        //    error error, queue a task to run the following\n        //    steps and abort this algorithm:\n        queueMicrotask(() => {\n          // 1. Set fr’s state to \"done\".\n          fr[kState] = 'done'\n\n          // 2. Set fr’s error to error.\n          fr[kError] = error\n\n          // 3. Fire a progress event called error at fr.\n          fireAProgressEvent('error', fr)\n\n          // 4. If fr’s state is not \"loading\", fire a progress\n          //    event called loadend at fr.\n          if (fr[kState] !== 'loading') {\n            fireAProgressEvent('loadend', fr)\n          }\n        })\n\n        break\n      }\n    }\n  })()\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#fire-a-progress-event\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e The name of the event\n * @param {import('./filereader').FileReader} reader\n */\nfunction fireAProgressEvent (e, reader) {\n  // The progress event e does not bubble. e.bubbles must be false\n  // The progress event e is NOT cancelable. e.cancelable must be false\n  const event = new ProgressEvent(e, {\n    bubbles: false,\n    cancelable: false\n  })\n\n  reader.dispatchEvent(event)\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#blob-package-data\n * @param {Uint8Array[]} bytes\n * @param {string} type\n * @param {string?} mimeType\n * @param {string?} encodingName\n */\nfunction packageData (bytes, type, mimeType, encodingName) {\n  // 1. A Blob has an associated package data algorithm, given\n  //    bytes, a type, a optional mimeType, and a optional\n  //    encodingName, which switches on type and runs the\n  //    associated steps:\n\n  switch (type) {\n    case 'DataURL': {\n      // 1. Return bytes as a DataURL [RFC2397] subject to\n      //    the considerations below:\n      //  * Use mimeType as part of the Data URL if it is\n      //    available in keeping with the Data URL\n      //    specification [RFC2397].\n      //  * If mimeType is not available return a Data URL\n      //    without a media-type. [RFC2397].\n\n      // https://datatracker.ietf.org/doc/html/rfc2397#section-3\n      // dataurl    := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n      // mediatype  := [ type \"/\" subtype ] *( \";\" parameter )\n      // data       := *urlchar\n      // parameter  := attribute \"=\" value\n      let dataURL = 'data:'\n\n      const parsed = parseMIMEType(mimeType || 'application/octet-stream')\n\n      if (parsed !== 'failure') {\n        dataURL += serializeAMimeType(parsed)\n      }\n\n      dataURL += ';base64,'\n\n      const decoder = new StringDecoder('latin1')\n\n      for (const chunk of bytes) {\n        dataURL += btoa(decoder.write(chunk))\n      }\n\n      dataURL += btoa(decoder.end())\n\n      return dataURL\n    }\n    case 'Text': {\n      // 1. Let encoding be failure\n      let encoding = 'failure'\n\n      // 2. If the encodingName is present, set encoding to the\n      //    result of getting an encoding from encodingName.\n      if (encodingName) {\n        encoding = getEncoding(encodingName)\n      }\n\n      // 3. If encoding is failure, and mimeType is present:\n      if (encoding === 'failure' && mimeType) {\n        // 1. Let type be the result of parse a MIME type\n        //    given mimeType.\n        const type = parseMIMEType(mimeType)\n\n        // 2. If type is not failure, set encoding to the result\n        //    of getting an encoding from type’s parameters[\"charset\"].\n        if (type !== 'failure') {\n          encoding = getEncoding(type.parameters.get('charset'))\n        }\n      }\n\n      // 4. If encoding is failure, then set encoding to UTF-8.\n      if (encoding === 'failure') {\n        encoding = 'UTF-8'\n      }\n\n      // 5. Decode bytes using fallback encoding encoding, and\n      //    return the result.\n      return decode(bytes, encoding)\n    }\n    case 'ArrayBuffer': {\n      // Return a new ArrayBuffer whose contents are bytes.\n      const sequence = combineByteSequences(bytes)\n\n      return sequence.buffer\n    }\n    case 'BinaryString': {\n      // Return bytes as a binary string, in which every byte\n      //  is represented by a code unit of equal value [0..255].\n      let binaryString = ''\n\n      const decoder = new StringDecoder('latin1')\n\n      for (const chunk of bytes) {\n        binaryString += decoder.write(chunk)\n      }\n\n      binaryString += decoder.end()\n\n      return binaryString\n    }\n  }\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#decode\n * @param {Uint8Array[]} ioQueue\n * @param {string} encoding\n */\nfunction decode (ioQueue, encoding) {\n  const bytes = combineByteSequences(ioQueue)\n\n  // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.\n  const BOMEncoding = BOMSniffing(bytes)\n\n  let slice = 0\n\n  // 2. If BOMEncoding is non-null:\n  if (BOMEncoding !== null) {\n    // 1. Set encoding to BOMEncoding.\n    encoding = BOMEncoding\n\n    // 2. Read three bytes from ioQueue, if BOMEncoding is\n    //    UTF-8; otherwise read two bytes.\n    //    (Do nothing with those bytes.)\n    slice = BOMEncoding === 'UTF-8' ? 3 : 2\n  }\n\n  // 3. Process a queue with an instance of encoding’s\n  //    decoder, ioQueue, output, and \"replacement\".\n\n  // 4. Return output.\n\n  const sliced = bytes.slice(slice)\n  return new TextDecoder(encoding).decode(sliced)\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#bom-sniff\n * @param {Uint8Array} ioQueue\n */\nfunction BOMSniffing (ioQueue) {\n  // 1. Let BOM be the result of peeking 3 bytes from ioQueue,\n  //    converted to a byte sequence.\n  const [a, b, c] = ioQueue\n\n  // 2. For each of the rows in the table below, starting with\n  //    the first one and going down, if BOM starts with the\n  //    bytes given in the first column, then return the\n  //    encoding given in the cell in the second column of that\n  //    row. Otherwise, return null.\n  if (a === 0xEF && b === 0xBB && c === 0xBF) {\n    return 'UTF-8'\n  } else if (a === 0xFE && b === 0xFF) {\n    return 'UTF-16BE'\n  } else if (a === 0xFF && b === 0xFE) {\n    return 'UTF-16LE'\n  }\n\n  return null\n}\n\n/**\n * @param {Uint8Array[]} sequences\n */\nfunction combineByteSequences (sequences) {\n  const size = sequences.reduce((a, b) => {\n    return a + b.byteLength\n  }, 0)\n\n  let offset = 0\n\n  return sequences.reduce((a, b) => {\n    a.set(b, offset)\n    offset += b.byteLength\n    return a\n  }, new Uint8Array(size))\n}\n\nmodule.exports = {\n  staticPropertyDescriptors,\n  readOperation,\n  fireAProgressEvent\n}\n","'use strict'\n\nconst { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require('./constants')\nconst {\n  kReadyState,\n  kSentClose,\n  kByteParser,\n  kReceivedClose,\n  kResponse\n} = require('./symbols')\nconst { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require('./util')\nconst { channels } = require('../../core/diagnostics')\nconst { CloseEvent } = require('./events')\nconst { makeRequest } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { Headers, getHeadersList } = require('../fetch/headers')\nconst { getDecodeSplit } = require('../fetch/util')\nconst { WebsocketFrameSend } = require('./frame')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n  crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#concept-websocket-establish\n * @param {URL} url\n * @param {string|string[]} protocols\n * @param {import('./websocket').WebSocket} ws\n * @param {(response: any, extensions: string[] | undefined) => void} onEstablish\n * @param {Partial} options\n */\nfunction establishWebSocketConnection (url, protocols, client, ws, onEstablish, options) {\n  // 1. Let requestURL be a copy of url, with its scheme set to \"http\", if url’s\n  //    scheme is \"ws\", and to \"https\" otherwise.\n  const requestURL = url\n\n  requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'\n\n  // 2. Let request be a new request, whose URL is requestURL, client is client,\n  //    service-workers mode is \"none\", referrer is \"no-referrer\", mode is\n  //    \"websocket\", credentials mode is \"include\", cache mode is \"no-store\" ,\n  //    and redirect mode is \"error\".\n  const request = makeRequest({\n    urlList: [requestURL],\n    client,\n    serviceWorkers: 'none',\n    referrer: 'no-referrer',\n    mode: 'websocket',\n    credentials: 'include',\n    cache: 'no-store',\n    redirect: 'error'\n  })\n\n  // Note: undici extension, allow setting custom headers.\n  if (options.headers) {\n    const headersList = getHeadersList(new Headers(options.headers))\n\n    request.headersList = headersList\n  }\n\n  // 3. Append (`Upgrade`, `websocket`) to request’s header list.\n  // 4. Append (`Connection`, `Upgrade`) to request’s header list.\n  // Note: both of these are handled by undici currently.\n  // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397\n\n  // 5. Let keyValue be a nonce consisting of a randomly selected\n  //    16-byte value that has been forgiving-base64-encoded and\n  //    isomorphic encoded.\n  const keyValue = crypto.randomBytes(16).toString('base64')\n\n  // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s\n  //    header list.\n  request.headersList.append('sec-websocket-key', keyValue)\n\n  // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s\n  //    header list.\n  request.headersList.append('sec-websocket-version', '13')\n\n  // 8. For each protocol in protocols, combine\n  //    (`Sec-WebSocket-Protocol`, protocol) in request’s header\n  //    list.\n  for (const protocol of protocols) {\n    request.headersList.append('sec-websocket-protocol', protocol)\n  }\n\n  // 9. Let permessageDeflate be a user-agent defined\n  //    \"permessage-deflate\" extension header value.\n  // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673\n  const permessageDeflate = 'permessage-deflate; client_max_window_bits'\n\n  // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to\n  //     request’s header list.\n  request.headersList.append('sec-websocket-extensions', permessageDeflate)\n\n  // 11. Fetch request with useParallelQueue set to true, and\n  //     processResponse given response being these steps:\n  const controller = fetching({\n    request,\n    useParallelQueue: true,\n    dispatcher: options.dispatcher,\n    processResponse (response) {\n      // 1. If response is a network error or its status is not 101,\n      //    fail the WebSocket connection.\n      if (response.type === 'error' || response.status !== 101) {\n        failWebsocketConnection(ws, 'Received network error or non-101 status code.')\n        return\n      }\n\n      // 2. If protocols is not the empty list and extracting header\n      //    list values given `Sec-WebSocket-Protocol` and response’s\n      //    header list results in null, failure, or the empty byte\n      //    sequence, then fail the WebSocket connection.\n      if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {\n        failWebsocketConnection(ws, 'Server did not respond with sent protocols.')\n        return\n      }\n\n      // 3. Follow the requirements stated step 2 to step 6, inclusive,\n      //    of the last set of steps in section 4.1 of The WebSocket\n      //    Protocol to validate response. This either results in fail\n      //    the WebSocket connection or the WebSocket connection is\n      //    established.\n\n      // 2. If the response lacks an |Upgrade| header field or the |Upgrade|\n      //    header field contains a value that is not an ASCII case-\n      //    insensitive match for the value \"websocket\", the client MUST\n      //    _Fail the WebSocket Connection_.\n      if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {\n        failWebsocketConnection(ws, 'Server did not set Upgrade header to \"websocket\".')\n        return\n      }\n\n      // 3. If the response lacks a |Connection| header field or the\n      //    |Connection| header field doesn't contain a token that is an\n      //    ASCII case-insensitive match for the value \"Upgrade\", the client\n      //    MUST _Fail the WebSocket Connection_.\n      if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {\n        failWebsocketConnection(ws, 'Server did not set Connection header to \"upgrade\".')\n        return\n      }\n\n      // 4. If the response lacks a |Sec-WebSocket-Accept| header field or\n      //    the |Sec-WebSocket-Accept| contains a value other than the\n      //    base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-\n      //    Key| (as a string, not base64-decoded) with the string \"258EAFA5-\n      //    E914-47DA-95CA-C5AB0DC85B11\" but ignoring any leading and\n      //    trailing whitespace, the client MUST _Fail the WebSocket\n      //    Connection_.\n      const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')\n      const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')\n      if (secWSAccept !== digest) {\n        failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')\n        return\n      }\n\n      // 5. If the response includes a |Sec-WebSocket-Extensions| header\n      //    field and this header field indicates the use of an extension\n      //    that was not present in the client's handshake (the server has\n      //    indicated an extension not requested by the client), the client\n      //    MUST _Fail the WebSocket Connection_.  (The parsing of this\n      //    header field to determine which extensions are requested is\n      //    discussed in Section 9.1.)\n      const secExtension = response.headersList.get('Sec-WebSocket-Extensions')\n      let extensions\n\n      if (secExtension !== null) {\n        extensions = parseExtensions(secExtension)\n\n        if (!extensions.has('permessage-deflate')) {\n          failWebsocketConnection(ws, 'Sec-WebSocket-Extensions header does not match.')\n          return\n        }\n      }\n\n      // 6. If the response includes a |Sec-WebSocket-Protocol| header field\n      //    and this header field indicates the use of a subprotocol that was\n      //    not present in the client's handshake (the server has indicated a\n      //    subprotocol not requested by the client), the client MUST _Fail\n      //    the WebSocket Connection_.\n      const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')\n\n      if (secProtocol !== null) {\n        const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList)\n\n        // The client can request that the server use a specific subprotocol by\n        // including the |Sec-WebSocket-Protocol| field in its handshake.  If it\n        // is specified, the server needs to include the same field and one of\n        // the selected subprotocol values in its response for the connection to\n        // be established.\n        if (!requestProtocols.includes(secProtocol)) {\n          failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')\n          return\n        }\n      }\n\n      response.socket.on('data', onSocketData)\n      response.socket.on('close', onSocketClose)\n      response.socket.on('error', onSocketError)\n\n      if (channels.open.hasSubscribers) {\n        channels.open.publish({\n          address: response.socket.address(),\n          protocol: secProtocol,\n          extensions: secExtension\n        })\n      }\n\n      onEstablish(response, extensions)\n    }\n  })\n\n  return controller\n}\n\nfunction closeWebSocketConnection (ws, code, reason, reasonByteLength) {\n  if (isClosing(ws) || isClosed(ws)) {\n    // If this's ready state is CLOSING (2) or CLOSED (3)\n    // Do nothing.\n  } else if (!isEstablished(ws)) {\n    // If the WebSocket connection is not yet established\n    // Fail the WebSocket connection and set this's ready state\n    // to CLOSING (2).\n    failWebsocketConnection(ws, 'Connection was closed before it was established.')\n    ws[kReadyState] = states.CLOSING\n  } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) {\n    // If the WebSocket closing handshake has not yet been started\n    // Start the WebSocket closing handshake and set this's ready\n    // state to CLOSING (2).\n    // - If neither code nor reason is present, the WebSocket Close\n    //   message must not have a body.\n    // - If code is present, then the status code to use in the\n    //   WebSocket Close message must be the integer given by code.\n    // - If reason is also present, then reasonBytes must be\n    //   provided in the Close message after the status code.\n\n    ws[kSentClose] = sentCloseFrameState.PROCESSING\n\n    const frame = new WebsocketFrameSend()\n\n    // If neither code nor reason is present, the WebSocket Close\n    // message must not have a body.\n\n    // If code is present, then the status code to use in the\n    // WebSocket Close message must be the integer given by code.\n    if (code !== undefined && reason === undefined) {\n      frame.frameData = Buffer.allocUnsafe(2)\n      frame.frameData.writeUInt16BE(code, 0)\n    } else if (code !== undefined && reason !== undefined) {\n      // If reason is also present, then reasonBytes must be\n      // provided in the Close message after the status code.\n      frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)\n      frame.frameData.writeUInt16BE(code, 0)\n      // the body MAY contain UTF-8-encoded data with value /reason/\n      frame.frameData.write(reason, 2, 'utf-8')\n    } else {\n      frame.frameData = emptyBuffer\n    }\n\n    /** @type {import('stream').Duplex} */\n    const socket = ws[kResponse].socket\n\n    socket.write(frame.createFrame(opcodes.CLOSE))\n\n    ws[kSentClose] = sentCloseFrameState.SENT\n\n    // Upon either sending or receiving a Close control frame, it is said\n    // that _The WebSocket Closing Handshake is Started_ and that the\n    // WebSocket connection is in the CLOSING state.\n    ws[kReadyState] = states.CLOSING\n  } else {\n    // Otherwise\n    // Set this's ready state to CLOSING (2).\n    ws[kReadyState] = states.CLOSING\n  }\n}\n\n/**\n * @param {Buffer} chunk\n */\nfunction onSocketData (chunk) {\n  if (!this.ws[kByteParser].write(chunk)) {\n    this.pause()\n  }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n */\nfunction onSocketClose () {\n  const { ws } = this\n  const { [kResponse]: response } = ws\n\n  response.socket.off('data', onSocketData)\n  response.socket.off('close', onSocketClose)\n  response.socket.off('error', onSocketError)\n\n  // If the TCP connection was closed after the\n  // WebSocket closing handshake was completed, the WebSocket connection\n  // is said to have been closed _cleanly_.\n  const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]\n\n  let code = 1005\n  let reason = ''\n\n  const result = ws[kByteParser].closingInfo\n\n  if (result && !result.error) {\n    code = result.code ?? 1005\n    reason = result.reason\n  } else if (!ws[kReceivedClose]) {\n    // If _The WebSocket\n    // Connection is Closed_ and no Close control frame was received by the\n    // endpoint (such as could occur if the underlying transport connection\n    // is lost), _The WebSocket Connection Close Code_ is considered to be\n    // 1006.\n    code = 1006\n  }\n\n  // 1. Change the ready state to CLOSED (3).\n  ws[kReadyState] = states.CLOSED\n\n  // 2. If the user agent was required to fail the WebSocket\n  //    connection, or if the WebSocket connection was closed\n  //    after being flagged as full, fire an event named error\n  //    at the WebSocket object.\n  // TODO\n\n  // 3. Fire an event named close at the WebSocket object,\n  //    using CloseEvent, with the wasClean attribute\n  //    initialized to true if the connection closed cleanly\n  //    and false otherwise, the code attribute initialized to\n  //    the WebSocket connection close code, and the reason\n  //    attribute initialized to the result of applying UTF-8\n  //    decode without BOM to the WebSocket connection close\n  //    reason.\n  // TODO: process.nextTick\n  fireEvent('close', ws, (type, init) => new CloseEvent(type, init), {\n    wasClean, code, reason\n  })\n\n  if (channels.close.hasSubscribers) {\n    channels.close.publish({\n      websocket: ws,\n      code,\n      reason\n    })\n  }\n}\n\nfunction onSocketError (error) {\n  const { ws } = this\n\n  ws[kReadyState] = states.CLOSING\n\n  if (channels.socketError.hasSubscribers) {\n    channels.socketError.publish(error)\n  }\n\n  this.destroy()\n}\n\nmodule.exports = {\n  establishWebSocketConnection,\n  closeWebSocketConnection\n}\n","'use strict'\n\n// This is a Globally Unique Identifier unique used\n// to validate that the endpoint accepts websocket\n// connections.\n// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3\nconst uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n  enumerable: true,\n  writable: false,\n  configurable: false\n}\n\nconst states = {\n  CONNECTING: 0,\n  OPEN: 1,\n  CLOSING: 2,\n  CLOSED: 3\n}\n\nconst sentCloseFrameState = {\n  NOT_SENT: 0,\n  PROCESSING: 1,\n  SENT: 2\n}\n\nconst opcodes = {\n  CONTINUATION: 0x0,\n  TEXT: 0x1,\n  BINARY: 0x2,\n  CLOSE: 0x8,\n  PING: 0x9,\n  PONG: 0xA\n}\n\nconst maxUnsigned16Bit = 2 ** 16 - 1 // 65535\n\nconst parserStates = {\n  INFO: 0,\n  PAYLOADLENGTH_16: 2,\n  PAYLOADLENGTH_64: 3,\n  READ_DATA: 4\n}\n\nconst emptyBuffer = Buffer.allocUnsafe(0)\n\nconst sendHints = {\n  string: 1,\n  typedArray: 2,\n  arrayBuffer: 3,\n  blob: 4\n}\n\nmodule.exports = {\n  uid,\n  sentCloseFrameState,\n  staticPropertyDescriptors,\n  states,\n  opcodes,\n  maxUnsigned16Bit,\n  parserStates,\n  emptyBuffer,\n  sendHints\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { kConstruct } = require('../../core/symbols')\nconst { MessagePort } = require('node:worker_threads')\n\n/**\n * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent\n */\nclass MessageEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict = {}) {\n    if (type === kConstruct) {\n      super(arguments[1], arguments[2])\n      webidl.util.markAsUncloneable(this)\n      return\n    }\n\n    const prefix = 'MessageEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')\n\n    super(type, eventInitDict)\n\n    this.#eventInit = eventInitDict\n    webidl.util.markAsUncloneable(this)\n  }\n\n  get data () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.data\n  }\n\n  get origin () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.origin\n  }\n\n  get lastEventId () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.lastEventId\n  }\n\n  get source () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.source\n  }\n\n  get ports () {\n    webidl.brandCheck(this, MessageEvent)\n\n    if (!Object.isFrozen(this.#eventInit.ports)) {\n      Object.freeze(this.#eventInit.ports)\n    }\n\n    return this.#eventInit.ports\n  }\n\n  initMessageEvent (\n    type,\n    bubbles = false,\n    cancelable = false,\n    data = null,\n    origin = '',\n    lastEventId = '',\n    source = null,\n    ports = []\n  ) {\n    webidl.brandCheck(this, MessageEvent)\n\n    webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')\n\n    return new MessageEvent(type, {\n      bubbles, cancelable, data, origin, lastEventId, source, ports\n    })\n  }\n\n  static createFastMessageEvent (type, init) {\n    const messageEvent = new MessageEvent(kConstruct, type, init)\n    messageEvent.#eventInit = init\n    messageEvent.#eventInit.data ??= null\n    messageEvent.#eventInit.origin ??= ''\n    messageEvent.#eventInit.lastEventId ??= ''\n    messageEvent.#eventInit.source ??= null\n    messageEvent.#eventInit.ports ??= []\n    return messageEvent\n  }\n}\n\nconst { createFastMessageEvent } = MessageEvent\ndelete MessageEvent.createFastMessageEvent\n\n/**\n * @see https://websockets.spec.whatwg.org/#the-closeevent-interface\n */\nclass CloseEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict = {}) {\n    const prefix = 'CloseEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.CloseEventInit(eventInitDict)\n\n    super(type, eventInitDict)\n\n    this.#eventInit = eventInitDict\n    webidl.util.markAsUncloneable(this)\n  }\n\n  get wasClean () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.wasClean\n  }\n\n  get code () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.code\n  }\n\n  get reason () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.reason\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface\nclass ErrorEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict) {\n    const prefix = 'ErrorEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    super(type, eventInitDict)\n    webidl.util.markAsUncloneable(this)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})\n\n    this.#eventInit = eventInitDict\n  }\n\n  get message () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.message\n  }\n\n  get filename () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.filename\n  }\n\n  get lineno () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.lineno\n  }\n\n  get colno () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.colno\n  }\n\n  get error () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.error\n  }\n}\n\nObject.defineProperties(MessageEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'MessageEvent',\n    configurable: true\n  },\n  data: kEnumerableProperty,\n  origin: kEnumerableProperty,\n  lastEventId: kEnumerableProperty,\n  source: kEnumerableProperty,\n  ports: kEnumerableProperty,\n  initMessageEvent: kEnumerableProperty\n})\n\nObject.defineProperties(CloseEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'CloseEvent',\n    configurable: true\n  },\n  reason: kEnumerableProperty,\n  code: kEnumerableProperty,\n  wasClean: kEnumerableProperty\n})\n\nObject.defineProperties(ErrorEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'ErrorEvent',\n    configurable: true\n  },\n  message: kEnumerableProperty,\n  filename: kEnumerableProperty,\n  lineno: kEnumerableProperty,\n  colno: kEnumerableProperty,\n  error: kEnumerableProperty\n})\n\nwebidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.MessagePort\n)\n\nconst eventInit = [\n  {\n    key: 'bubbles',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'cancelable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'composed',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n]\n\nwebidl.converters.MessageEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'data',\n    converter: webidl.converters.any,\n    defaultValue: () => null\n  },\n  {\n    key: 'origin',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'lastEventId',\n    converter: webidl.converters.DOMString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'source',\n    // Node doesn't implement WindowProxy or ServiceWorker, so the only\n    // valid value for source is a MessagePort.\n    converter: webidl.nullableConverter(webidl.converters.MessagePort),\n    defaultValue: () => null\n  },\n  {\n    key: 'ports',\n    converter: webidl.converters['sequence'],\n    defaultValue: () => new Array(0)\n  }\n])\n\nwebidl.converters.CloseEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'wasClean',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'code',\n    converter: webidl.converters['unsigned short'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'reason',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  }\n])\n\nwebidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'message',\n    converter: webidl.converters.DOMString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'filename',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'lineno',\n    converter: webidl.converters['unsigned long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'colno',\n    converter: webidl.converters['unsigned long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'error',\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = {\n  MessageEvent,\n  CloseEvent,\n  ErrorEvent,\n  createFastMessageEvent\n}\n","'use strict'\n\nconst { maxUnsigned16Bit } = require('./constants')\n\nconst BUFFER_SIZE = 16386\n\n/** @type {import('crypto')} */\nlet crypto\nlet buffer = null\nlet bufIdx = BUFFER_SIZE\n\ntry {\n  crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n  crypto = {\n    // not full compatibility, but minimum.\n    randomFillSync: function randomFillSync (buffer, _offset, _size) {\n      for (let i = 0; i < buffer.length; ++i) {\n        buffer[i] = Math.random() * 255 | 0\n      }\n      return buffer\n    }\n  }\n}\n\nfunction generateMask () {\n  if (bufIdx === BUFFER_SIZE) {\n    bufIdx = 0\n    crypto.randomFillSync((buffer ??= Buffer.allocUnsafe(BUFFER_SIZE)), 0, BUFFER_SIZE)\n  }\n  return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]\n}\n\nclass WebsocketFrameSend {\n  /**\n   * @param {Buffer|undefined} data\n   */\n  constructor (data) {\n    this.frameData = data\n  }\n\n  createFrame (opcode) {\n    const frameData = this.frameData\n    const maskKey = generateMask()\n    const bodyLength = frameData?.byteLength ?? 0\n\n    /** @type {number} */\n    let payloadLength = bodyLength // 0-125\n    let offset = 6\n\n    if (bodyLength > maxUnsigned16Bit) {\n      offset += 8 // payload length is next 8 bytes\n      payloadLength = 127\n    } else if (bodyLength > 125) {\n      offset += 2 // payload length is next 2 bytes\n      payloadLength = 126\n    }\n\n    const buffer = Buffer.allocUnsafe(bodyLength + offset)\n\n    // Clear first 2 bytes, everything else is overwritten\n    buffer[0] = buffer[1] = 0\n    buffer[0] |= 0x80 // FIN\n    buffer[0] = (buffer[0] & 0xF0) + opcode // opcode\n\n    /*! ws. MIT License. Einar Otto Stangvik  */\n    buffer[offset - 4] = maskKey[0]\n    buffer[offset - 3] = maskKey[1]\n    buffer[offset - 2] = maskKey[2]\n    buffer[offset - 1] = maskKey[3]\n\n    buffer[1] = payloadLength\n\n    if (payloadLength === 126) {\n      buffer.writeUInt16BE(bodyLength, 2)\n    } else if (payloadLength === 127) {\n      // Clear extended payload length\n      buffer[2] = buffer[3] = 0\n      buffer.writeUIntBE(bodyLength, 4, 6)\n    }\n\n    buffer[1] |= 0x80 // MASK\n\n    // mask body\n    for (let i = 0; i < bodyLength; ++i) {\n      buffer[offset + i] = frameData[i] ^ maskKey[i & 3]\n    }\n\n    return buffer\n  }\n}\n\nmodule.exports = {\n  WebsocketFrameSend\n}\n","'use strict'\n\nconst { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require('node:zlib')\nconst { isValidClientWindowBits } = require('./util')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nconst tail = Buffer.from([0x00, 0x00, 0xff, 0xff])\nconst kBuffer = Symbol('kBuffer')\nconst kLength = Symbol('kLength')\n\nclass PerMessageDeflate {\n  /** @type {import('node:zlib').InflateRaw} */\n  #inflate\n\n  #options = {}\n\n  #maxPayloadSize = 0\n\n  /**\n   * @param {Map} extensions\n   */\n  constructor (extensions, options) {\n    this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')\n    this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')\n\n    this.#maxPayloadSize = options.maxPayloadSize\n  }\n\n  /**\n   * Decompress a compressed payload.\n   * @param {Buffer} chunk Compressed data\n   * @param {boolean} fin Final fragment flag\n   * @param {Function} callback Callback function\n   */\n  decompress (chunk, fin, callback) {\n    // An endpoint uses the following algorithm to decompress a message.\n    // 1.  Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the\n    //     payload of the message.\n    // 2.  Decompress the resulting data using DEFLATE.\n    if (!this.#inflate) {\n      let windowBits = Z_DEFAULT_WINDOWBITS\n\n      if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS\n        if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {\n          callback(new Error('Invalid server_max_window_bits'))\n          return\n        }\n\n        windowBits = Number.parseInt(this.#options.serverMaxWindowBits)\n      }\n\n      try {\n        this.#inflate = createInflateRaw({ windowBits })\n      } catch (err) {\n        callback(err)\n        return\n      }\n      this.#inflate[kBuffer] = []\n      this.#inflate[kLength] = 0\n\n      this.#inflate.on('data', (data) => {\n        this.#inflate[kLength] += data.length\n\n        if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {\n          callback(new MessageSizeExceededError())\n          this.#inflate.removeAllListeners()\n          this.#inflate = null\n          return\n        }\n\n        this.#inflate[kBuffer].push(data)\n      })\n\n      this.#inflate.on('error', (err) => {\n        this.#inflate = null\n        callback(err)\n      })\n    }\n\n    this.#inflate.write(chunk)\n    if (fin) {\n      this.#inflate.write(tail)\n    }\n\n    this.#inflate.flush(() => {\n      if (!this.#inflate) {\n        return\n      }\n\n      const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])\n\n      this.#inflate[kBuffer].length = 0\n      this.#inflate[kLength] = 0\n\n      callback(null, full)\n    })\n  }\n}\n\nmodule.exports = { PerMessageDeflate }\n","'use strict'\n\nconst { Writable } = require('node:stream')\nconst assert = require('node:assert')\nconst { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require('./constants')\nconst { kReadyState, kSentClose, kResponse, kReceivedClose } = require('./symbols')\nconst { channels } = require('../../core/diagnostics')\nconst {\n  isValidStatusCode,\n  isValidOpcode,\n  failWebsocketConnection,\n  websocketMessageReceived,\n  utf8Decode,\n  isControlFrame,\n  isTextBinaryFrame,\n  isContinuationFrame\n} = require('./util')\nconst { WebsocketFrameSend } = require('./frame')\nconst { closeWebSocketConnection } = require('./connection')\nconst { PerMessageDeflate } = require('./permessage-deflate')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nfunction failWebsocketConnectionWithCode (ws, code, reason) {\n  closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason))\n  failWebsocketConnection(ws, reason)\n}\n\n// This code was influenced by ws released under the MIT license.\n// Copyright (c) 2011 Einar Otto Stangvik \n// Copyright (c) 2013 Arnout Kazemier and contributors\n// Copyright (c) 2016 Luigi Pinca and contributors\n\nclass ByteParser extends Writable {\n  #buffers = []\n  #fragmentsBytes = 0\n  #byteOffset = 0\n  #loop = false\n\n  #state = parserStates.INFO\n\n  #info = {}\n  #fragments = []\n\n  /** @type {Map} */\n  #extensions\n\n  /** @type {number} */\n  #maxFragments\n\n  /** @type {number} */\n  #maxPayloadSize\n\n  /**\n   * @param {import('./websocket').WebSocket} ws\n   * @param {Map|null} extensions\n   * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]\n   */\n  constructor (ws, extensions, options = {}) {\n    super()\n\n    this.ws = ws\n    this.#extensions = extensions == null ? new Map() : extensions\n    this.#maxFragments = options.maxFragments ?? 0\n    this.#maxPayloadSize = options.maxPayloadSize ?? 0\n\n    if (this.#extensions.has('permessage-deflate')) {\n      this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))\n    }\n  }\n\n  /**\n   * @param {Buffer} chunk\n   * @param {() => void} callback\n   */\n  _write (chunk, _, callback) {\n    this.#buffers.push(chunk)\n    this.#byteOffset += chunk.length\n    this.#loop = true\n\n    this.run(callback)\n  }\n\n  #validatePayloadLength () {\n    if (\n      this.#maxPayloadSize > 0 &&\n      !isControlFrame(this.#info.opcode) &&\n      this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize\n    ) {\n      failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size')\n      return false\n    }\n\n    return true\n  }\n\n  /**\n   * Runs whenever a new chunk is received.\n   * Callback is called whenever there are no more chunks buffering,\n   * or not enough bytes are buffered to parse.\n   */\n  run (callback) {\n    while (this.#loop) {\n      if (this.#state === parserStates.INFO) {\n        // If there aren't enough bytes to parse the payload length, etc.\n        if (this.#byteOffset < 2) {\n          return callback()\n        }\n\n        const buffer = this.consume(2)\n        const fin = (buffer[0] & 0x80) !== 0\n        const opcode = buffer[0] & 0x0F\n        const masked = (buffer[1] & 0x80) === 0x80\n\n        const fragmented = !fin && opcode !== opcodes.CONTINUATION\n        const payloadLength = buffer[1] & 0x7F\n\n        const rsv1 = buffer[0] & 0x40\n        const rsv2 = buffer[0] & 0x20\n        const rsv3 = buffer[0] & 0x10\n\n        if (!isValidOpcode(opcode)) {\n          failWebsocketConnection(this.ws, 'Invalid opcode received')\n          return callback()\n        }\n\n        if (masked) {\n          failWebsocketConnection(this.ws, 'Frame cannot be masked')\n          return callback()\n        }\n\n        // MUST be 0 unless an extension is negotiated that defines meanings\n        // for non-zero values.  If a nonzero value is received and none of\n        // the negotiated extensions defines the meaning of such a nonzero\n        // value, the receiving endpoint MUST _Fail the WebSocket\n        // Connection_.\n        // This document allocates the RSV1 bit of the WebSocket header for\n        // PMCEs and calls the bit the \"Per-Message Compressed\" bit.  On a\n        // WebSocket connection where a PMCE is in use, this bit indicates\n        // whether a message is compressed or not.\n        if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {\n          failWebsocketConnection(this.ws, 'Expected RSV1 to be clear.')\n          return\n        }\n\n        if (rsv2 !== 0 || rsv3 !== 0) {\n          failWebsocketConnection(this.ws, 'RSV1, RSV2, RSV3 must be clear')\n          return\n        }\n\n        if (fragmented && !isTextBinaryFrame(opcode)) {\n          // Only text and binary frames can be fragmented\n          failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')\n          return\n        }\n\n        // If we are already parsing a text/binary frame and do not receive either\n        // a continuation frame or close frame, fail the connection.\n        if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {\n          failWebsocketConnection(this.ws, 'Expected continuation frame')\n          return\n        }\n\n        if (this.#info.fragmented && fragmented) {\n          // A fragmented frame can't be fragmented itself\n          failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')\n          return\n        }\n\n        // \"All control frames MUST have a payload length of 125 bytes or less\n        // and MUST NOT be fragmented.\"\n        if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {\n          failWebsocketConnection(this.ws, 'Control frame either too large or fragmented')\n          return\n        }\n\n        if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {\n          failWebsocketConnection(this.ws, 'Unexpected continuation frame')\n          return\n        }\n\n        if (payloadLength <= 125) {\n          this.#info.payloadLength = payloadLength\n          this.#state = parserStates.READ_DATA\n\n          if (!this.#validatePayloadLength()) {\n            return\n          }\n        } else if (payloadLength === 126) {\n          this.#state = parserStates.PAYLOADLENGTH_16\n        } else if (payloadLength === 127) {\n          this.#state = parserStates.PAYLOADLENGTH_64\n        }\n\n        if (isTextBinaryFrame(opcode)) {\n          this.#info.binaryType = opcode\n          this.#info.compressed = rsv1 !== 0\n        }\n\n        this.#info.opcode = opcode\n        this.#info.masked = masked\n        this.#info.fin = fin\n        this.#info.fragmented = fragmented\n      } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n        if (this.#byteOffset < 2) {\n          return callback()\n        }\n\n        const buffer = this.consume(2)\n\n        this.#info.payloadLength = buffer.readUInt16BE(0)\n        this.#state = parserStates.READ_DATA\n\n        if (!this.#validatePayloadLength()) {\n          return\n        }\n      } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n        if (this.#byteOffset < 8) {\n          return callback()\n        }\n\n        const buffer = this.consume(8)\n        const upper = buffer.readUInt32BE(0)\n        const lower = buffer.readUInt32BE(4)\n\n        // 2^31 is the maximum bytes an arraybuffer can contain\n        // on 32-bit systems. Although, on 64-bit systems, this is\n        // 2^53-1 bytes.\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n        // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n        // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n        if (upper !== 0 || lower > 2 ** 31 - 1) {\n          failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')\n          return\n        }\n\n        this.#info.payloadLength = lower\n        this.#state = parserStates.READ_DATA\n\n        if (!this.#validatePayloadLength()) {\n          return\n        }\n      } else if (this.#state === parserStates.READ_DATA) {\n        if (this.#byteOffset < this.#info.payloadLength) {\n          return callback()\n        }\n\n        const body = this.consume(this.#info.payloadLength)\n\n        if (isControlFrame(this.#info.opcode)) {\n          this.#loop = this.parseControlFrame(body)\n          this.#state = parserStates.INFO\n        } else {\n          if (!this.#info.compressed) {\n            if (!this.writeFragments(body)) {\n              return\n            }\n\n            if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n              failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n              return\n            }\n\n            // If the frame is not fragmented, a message has been received.\n            // If the frame is fragmented, it will terminate with a fin bit set\n            // and an opcode of 0 (continuation), therefore we handle that when\n            // parsing continuation frames, not here.\n            if (!this.#info.fragmented && this.#info.fin) {\n              websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n            }\n\n            this.#state = parserStates.INFO\n          } else {\n            this.#extensions.get('permessage-deflate').decompress(\n              body,\n              this.#info.fin,\n              (error, data) => {\n                if (error) {\n                  const code = error instanceof MessageSizeExceededError ? 1009 : 1007\n                  failWebsocketConnectionWithCode(this.ws, code, error.message)\n                  return\n                }\n\n                if (!this.writeFragments(data)) {\n                  return\n                }\n\n                if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n                  failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n                  return\n                }\n\n                if (!this.#info.fin) {\n                  this.#state = parserStates.INFO\n                  this.#loop = true\n                  this.run(callback)\n                  return\n                }\n\n                websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n\n                this.#loop = true\n                this.#state = parserStates.INFO\n                this.run(callback)\n              }\n            )\n\n            this.#loop = false\n            break\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * Take n bytes from the buffered Buffers\n   * @param {number} n\n   * @returns {Buffer}\n   */\n  consume (n) {\n    if (n > this.#byteOffset) {\n      throw new Error('Called consume() before buffers satiated.')\n    } else if (n === 0) {\n      return emptyBuffer\n    }\n\n    if (this.#buffers[0].length === n) {\n      this.#byteOffset -= this.#buffers[0].length\n      return this.#buffers.shift()\n    }\n\n    const buffer = Buffer.allocUnsafe(n)\n    let offset = 0\n\n    while (offset !== n) {\n      const next = this.#buffers[0]\n      const { length } = next\n\n      if (length + offset === n) {\n        buffer.set(this.#buffers.shift(), offset)\n        break\n      } else if (length + offset > n) {\n        buffer.set(next.subarray(0, n - offset), offset)\n        this.#buffers[0] = next.subarray(n - offset)\n        break\n      } else {\n        buffer.set(this.#buffers.shift(), offset)\n        offset += next.length\n      }\n    }\n\n    this.#byteOffset -= n\n\n    return buffer\n  }\n\n  writeFragments (fragment) {\n    if (\n      this.#maxFragments > 0 &&\n      this.#fragments.length === this.#maxFragments\n    ) {\n      failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments')\n      return false\n    }\n\n    this.#fragmentsBytes += fragment.length\n    this.#fragments.push(fragment)\n    return true\n  }\n\n  consumeFragments () {\n    const fragments = this.#fragments\n\n    if (fragments.length === 1) {\n      this.#fragmentsBytes = 0\n      return fragments.shift()\n    }\n\n    const output = Buffer.concat(fragments, this.#fragmentsBytes)\n    this.#fragments = []\n    this.#fragmentsBytes = 0\n\n    return output\n  }\n\n  parseCloseBody (data) {\n    assert(data.length !== 1)\n\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n    /** @type {number|undefined} */\n    let code\n\n    if (data.length >= 2) {\n      // _The WebSocket Connection Close Code_ is\n      // defined as the status code (Section 7.4) contained in the first Close\n      // control frame received by the application\n      code = data.readUInt16BE(0)\n    }\n\n    if (code !== undefined && !isValidStatusCode(code)) {\n      return { code: 1002, reason: 'Invalid status code', error: true }\n    }\n\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6\n    /** @type {Buffer} */\n    let reason = data.subarray(2)\n\n    // Remove BOM\n    if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {\n      reason = reason.subarray(3)\n    }\n\n    try {\n      reason = utf8Decode(reason)\n    } catch {\n      return { code: 1007, reason: 'Invalid UTF-8', error: true }\n    }\n\n    return { code, reason, error: false }\n  }\n\n  /**\n   * Parses control frames.\n   * @param {Buffer} body\n   */\n  parseControlFrame (body) {\n    const { opcode, payloadLength } = this.#info\n\n    if (opcode === opcodes.CLOSE) {\n      if (payloadLength === 1) {\n        failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')\n        return false\n      }\n\n      this.#info.closeInfo = this.parseCloseBody(body)\n\n      if (this.#info.closeInfo.error) {\n        const { code, reason } = this.#info.closeInfo\n\n        closeWebSocketConnection(this.ws, code, reason, reason.length)\n        failWebsocketConnection(this.ws, reason)\n        return false\n      }\n\n      if (this.ws[kSentClose] !== sentCloseFrameState.SENT) {\n        // If an endpoint receives a Close frame and did not previously send a\n        // Close frame, the endpoint MUST send a Close frame in response.  (When\n        // sending a Close frame in response, the endpoint typically echos the\n        // status code it received.)\n        let body = emptyBuffer\n        if (this.#info.closeInfo.code) {\n          body = Buffer.allocUnsafe(2)\n          body.writeUInt16BE(this.#info.closeInfo.code, 0)\n        }\n        const closeFrame = new WebsocketFrameSend(body)\n\n        this.ws[kResponse].socket.write(\n          closeFrame.createFrame(opcodes.CLOSE),\n          (err) => {\n            if (!err) {\n              this.ws[kSentClose] = sentCloseFrameState.SENT\n            }\n          }\n        )\n      }\n\n      // Upon either sending or receiving a Close control frame, it is said\n      // that _The WebSocket Closing Handshake is Started_ and that the\n      // WebSocket connection is in the CLOSING state.\n      this.ws[kReadyState] = states.CLOSING\n      this.ws[kReceivedClose] = true\n\n      return false\n    } else if (opcode === opcodes.PING) {\n      // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n      // response, unless it already received a Close frame.\n      // A Pong frame sent in response to a Ping frame must have identical\n      // \"Application data\"\n\n      if (!this.ws[kReceivedClose]) {\n        const frame = new WebsocketFrameSend(body)\n\n        this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))\n\n        if (channels.ping.hasSubscribers) {\n          channels.ping.publish({\n            payload: body\n          })\n        }\n      }\n    } else if (opcode === opcodes.PONG) {\n      // A Pong frame MAY be sent unsolicited.  This serves as a\n      // unidirectional heartbeat.  A response to an unsolicited Pong frame is\n      // not expected.\n\n      if (channels.pong.hasSubscribers) {\n        channels.pong.publish({\n          payload: body\n        })\n      }\n    }\n\n    return true\n  }\n\n  get closingInfo () {\n    return this.#info.closeInfo\n  }\n}\n\nmodule.exports = {\n  ByteParser\n}\n","'use strict'\n\nconst { WebsocketFrameSend } = require('./frame')\nconst { opcodes, sendHints } = require('./constants')\nconst FixedQueue = require('../../dispatcher/fixed-queue')\n\n/** @type {typeof Uint8Array} */\nconst FastBuffer = Buffer[Symbol.species]\n\n/**\n * @typedef {object} SendQueueNode\n * @property {Promise | null} promise\n * @property {((...args: any[]) => any)} callback\n * @property {Buffer | null} frame\n */\n\nclass SendQueue {\n  /**\n   * @type {FixedQueue}\n   */\n  #queue = new FixedQueue()\n\n  /**\n   * @type {boolean}\n   */\n  #running = false\n\n  /** @type {import('node:net').Socket} */\n  #socket\n\n  constructor (socket) {\n    this.#socket = socket\n  }\n\n  add (item, cb, hint) {\n    if (hint !== sendHints.blob) {\n      const frame = createFrame(item, hint)\n      if (!this.#running) {\n        // fast-path\n        this.#socket.write(frame, cb)\n      } else {\n        /** @type {SendQueueNode} */\n        const node = {\n          promise: null,\n          callback: cb,\n          frame\n        }\n        this.#queue.push(node)\n      }\n      return\n    }\n\n    /** @type {SendQueueNode} */\n    const node = {\n      promise: item.arrayBuffer().then((ab) => {\n        node.promise = null\n        node.frame = createFrame(ab, hint)\n      }),\n      callback: cb,\n      frame: null\n    }\n\n    this.#queue.push(node)\n\n    if (!this.#running) {\n      this.#run()\n    }\n  }\n\n  async #run () {\n    this.#running = true\n    const queue = this.#queue\n    while (!queue.isEmpty()) {\n      const node = queue.shift()\n      // wait pending promise\n      if (node.promise !== null) {\n        await node.promise\n      }\n      // write\n      this.#socket.write(node.frame, node.callback)\n      // cleanup\n      node.callback = node.frame = null\n    }\n    this.#running = false\n  }\n}\n\nfunction createFrame (data, hint) {\n  return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY)\n}\n\nfunction toBuffer (data, hint) {\n  switch (hint) {\n    case sendHints.string:\n      return Buffer.from(data)\n    case sendHints.arrayBuffer:\n    case sendHints.blob:\n      return new FastBuffer(data)\n    case sendHints.typedArray:\n      return new FastBuffer(data.buffer, data.byteOffset, data.byteLength)\n  }\n}\n\nmodule.exports = { SendQueue }\n","'use strict'\n\nmodule.exports = {\n  kWebSocketURL: Symbol('url'),\n  kReadyState: Symbol('ready state'),\n  kController: Symbol('controller'),\n  kResponse: Symbol('response'),\n  kBinaryType: Symbol('binary type'),\n  kSentClose: Symbol('sent close'),\n  kReceivedClose: Symbol('received close'),\n  kByteParser: Symbol('byte parser')\n}\n","'use strict'\n\nconst { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require('./symbols')\nconst { states, opcodes } = require('./constants')\nconst { ErrorEvent, createFastMessageEvent } = require('./events')\nconst { isUtf8 } = require('node:buffer')\nconst { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require('../fetch/data-url')\n\n/* globals Blob */\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isConnecting (ws) {\n  // If the WebSocket connection is not yet established, and the connection\n  // is not yet closed, then the WebSocket connection is in the CONNECTING state.\n  return ws[kReadyState] === states.CONNECTING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isEstablished (ws) {\n  // If the server's response is validated as provided for above, it is\n  // said that _The WebSocket Connection is Established_ and that the\n  // WebSocket Connection is in the OPEN state.\n  return ws[kReadyState] === states.OPEN\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosing (ws) {\n  // Upon either sending or receiving a Close control frame, it is said\n  // that _The WebSocket Closing Handshake is Started_ and that the\n  // WebSocket connection is in the CLOSING state.\n  return ws[kReadyState] === states.CLOSING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosed (ws) {\n  return ws[kReadyState] === states.CLOSED\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e\n * @param {EventTarget} target\n * @param {(...args: ConstructorParameters) => Event} eventFactory\n * @param {EventInit | undefined} eventInitDict\n */\nfunction fireEvent (e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {\n  // 1. If eventConstructor is not given, then let eventConstructor be Event.\n\n  // 2. Let event be the result of creating an event given eventConstructor,\n  //    in the relevant realm of target.\n  // 3. Initialize event’s type attribute to e.\n  const event = eventFactory(e, eventInitDict)\n\n  // 4. Initialize any other IDL attributes of event as described in the\n  //    invocation of this algorithm.\n\n  // 5. Return the result of dispatching event at target, with legacy target\n  //    override flag set if set.\n  target.dispatchEvent(event)\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @param {import('./websocket').WebSocket} ws\n * @param {number} type Opcode\n * @param {Buffer} data application data\n */\nfunction websocketMessageReceived (ws, type, data) {\n  // 1. If ready state is not OPEN (1), then return.\n  if (ws[kReadyState] !== states.OPEN) {\n    return\n  }\n\n  // 2. Let dataForEvent be determined by switching on type and binary type:\n  let dataForEvent\n\n  if (type === opcodes.TEXT) {\n    // -> type indicates that the data is Text\n    //      a new DOMString containing data\n    try {\n      dataForEvent = utf8Decode(data)\n    } catch {\n      failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')\n      return\n    }\n  } else if (type === opcodes.BINARY) {\n    if (ws[kBinaryType] === 'blob') {\n      // -> type indicates that the data is Binary and binary type is \"blob\"\n      //      a new Blob object, created in the relevant Realm of the WebSocket\n      //      object, that represents data as its raw data\n      dataForEvent = new Blob([data])\n    } else {\n      // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n      //      a new ArrayBuffer object, created in the relevant Realm of the\n      //      WebSocket object, whose contents are data\n      dataForEvent = toArrayBuffer(data)\n    }\n  }\n\n  // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n  //    with the origin attribute initialized to the serialization of the WebSocket\n  //    object’s url's origin, and the data attribute initialized to dataForEvent.\n  fireEvent('message', ws, createFastMessageEvent, {\n    origin: ws[kWebSocketURL].origin,\n    data: dataForEvent\n  })\n}\n\nfunction toArrayBuffer (buffer) {\n  if (buffer.byteLength === buffer.buffer.byteLength) {\n    return buffer.buffer\n  }\n  return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455\n * @see https://datatracker.ietf.org/doc/html/rfc2616\n * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407\n * @param {string} protocol\n */\nfunction isValidSubprotocol (protocol) {\n  // If present, this value indicates one\n  // or more comma-separated subprotocol the client wishes to speak,\n  // ordered by preference.  The elements that comprise this value\n  // MUST be non-empty strings with characters in the range U+0021 to\n  // U+007E not including separator characters as defined in\n  // [RFC2616] and MUST all be unique strings.\n  if (protocol.length === 0) {\n    return false\n  }\n\n  for (let i = 0; i < protocol.length; ++i) {\n    const code = protocol.charCodeAt(i)\n\n    if (\n      code < 0x21 || // CTL, contains SP (0x20) and HT (0x09)\n      code > 0x7E ||\n      code === 0x22 || // \"\n      code === 0x28 || // (\n      code === 0x29 || // )\n      code === 0x2C || // ,\n      code === 0x2F || // /\n      code === 0x3A || // :\n      code === 0x3B || // ;\n      code === 0x3C || // <\n      code === 0x3D || // =\n      code === 0x3E || // >\n      code === 0x3F || // ?\n      code === 0x40 || // @\n      code === 0x5B || // [\n      code === 0x5C || // \\\n      code === 0x5D || // ]\n      code === 0x7B || // {\n      code === 0x7D // }\n    ) {\n      return false\n    }\n  }\n\n  return true\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4\n * @param {number} code\n */\nfunction isValidStatusCode (code) {\n  if (code >= 1000 && code < 1015) {\n    return (\n      code !== 1004 && // reserved\n      code !== 1005 && // \"MUST NOT be set as a status code\"\n      code !== 1006 // \"MUST NOT be set as a status code\"\n    )\n  }\n\n  return code >= 3000 && code <= 4999\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @param {string|undefined} reason\n */\nfunction failWebsocketConnection (ws, reason) {\n  const { [kController]: controller, [kResponse]: response } = ws\n\n  controller.abort()\n\n  if (response?.socket && !response.socket.destroyed) {\n    response.socket.destroy()\n  }\n\n  if (reason) {\n    // TODO: process.nextTick\n    fireEvent('error', ws, (type, init) => new ErrorEvent(type, init), {\n      error: new Error(reason),\n      message: reason\n    })\n  }\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5\n * @param {number} opcode\n */\nfunction isControlFrame (opcode) {\n  return (\n    opcode === opcodes.CLOSE ||\n    opcode === opcodes.PING ||\n    opcode === opcodes.PONG\n  )\n}\n\nfunction isContinuationFrame (opcode) {\n  return opcode === opcodes.CONTINUATION\n}\n\nfunction isTextBinaryFrame (opcode) {\n  return opcode === opcodes.TEXT || opcode === opcodes.BINARY\n}\n\nfunction isValidOpcode (opcode) {\n  return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode)\n}\n\n/**\n * Parses a Sec-WebSocket-Extensions header value.\n * @param {string} extensions\n * @returns {Map}\n */\n// TODO(@Uzlopak, @KhafraDev): make compliant https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\nfunction parseExtensions (extensions) {\n  const position = { position: 0 }\n  const extensionList = new Map()\n\n  while (position.position < extensions.length) {\n    const pair = collectASequenceOfCodePointsFast(';', extensions, position)\n    const [name, value = ''] = pair.split('=')\n\n    extensionList.set(\n      removeHTTPWhitespace(name, true, false),\n      removeHTTPWhitespace(value, false, true)\n    )\n\n    position.position++\n  }\n\n  return extensionList\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2\n * @description \"client-max-window-bits = 1*DIGIT\"\n * @param {string} value\n */\nfunction isValidClientWindowBits (value) {\n  // Must have at least one character\n  if (value.length === 0) {\n    return false\n  }\n\n  // Check all characters are ASCII digits\n  for (let i = 0; i < value.length; i++) {\n    const byte = value.charCodeAt(i)\n\n    if (byte < 0x30 || byte > 0x39) {\n      return false\n    }\n  }\n\n  // Check numeric range: zlib requires windowBits in range 8-15\n  const num = Number.parseInt(value, 10)\n  return num >= 8 && num <= 15\n}\n\n// https://nodejs.org/api/intl.html#detecting-internationalization-support\nconst hasIntl = typeof process.versions.icu === 'string'\nconst fatalDecoder = hasIntl ? new TextDecoder('utf-8', { fatal: true }) : undefined\n\n/**\n * Converts a Buffer to utf-8, even on platforms without icu.\n * @param {Buffer} buffer\n */\nconst utf8Decode = hasIntl\n  ? fatalDecoder.decode.bind(fatalDecoder)\n  : function (buffer) {\n    if (isUtf8(buffer)) {\n      return buffer.toString('utf-8')\n    }\n    throw new TypeError('Invalid utf-8 received.')\n  }\n\nmodule.exports = {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isClosed,\n  fireEvent,\n  isValidSubprotocol,\n  isValidStatusCode,\n  failWebsocketConnection,\n  websocketMessageReceived,\n  utf8Decode,\n  isControlFrame,\n  isContinuationFrame,\n  isTextBinaryFrame,\n  isValidOpcode,\n  parseExtensions,\n  isValidClientWindowBits\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { environmentSettingsObject } = require('../fetch/util')\nconst { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require('./constants')\nconst {\n  kWebSocketURL,\n  kReadyState,\n  kController,\n  kBinaryType,\n  kResponse,\n  kSentClose,\n  kByteParser\n} = require('./symbols')\nconst {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isValidSubprotocol,\n  fireEvent\n} = require('./util')\nconst { establishWebSocketConnection, closeWebSocketConnection } = require('./connection')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty, isBlobLike } = require('../../core/util')\nconst { getGlobalDispatcher } = require('../../global')\nconst { types } = require('node:util')\nconst { ErrorEvent, CloseEvent } = require('./events')\nconst { SendQueue } = require('./sender')\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    close: null,\n    message: null\n  }\n\n  #bufferedAmount = 0\n  #protocol = ''\n  #extensions = ''\n\n  /** @type {SendQueue} */\n  #sendQueue\n\n  /**\n   * @param {string} url\n   * @param {string|string[]} protocols\n   */\n  constructor (url, protocols = []) {\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'WebSocket constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols, prefix, 'options')\n\n    url = webidl.converters.USVString(url, prefix, 'url')\n    protocols = options.protocols\n\n    // 1. Let baseURL be this's relevant settings object's API base URL.\n    const baseURL = environmentSettingsObject.settingsObject.baseUrl\n\n    // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.\n    let urlRecord\n\n    try {\n      urlRecord = new URL(url, baseURL)\n    } catch (e) {\n      // 3. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n      throw new DOMException(e, 'SyntaxError')\n    }\n\n    // 4. If urlRecord’s scheme is \"http\", then set urlRecord’s scheme to \"ws\".\n    if (urlRecord.protocol === 'http:') {\n      urlRecord.protocol = 'ws:'\n    } else if (urlRecord.protocol === 'https:') {\n      // 5. Otherwise, if urlRecord’s scheme is \"https\", set urlRecord’s scheme to \"wss\".\n      urlRecord.protocol = 'wss:'\n    }\n\n    // 6. If urlRecord’s scheme is not \"ws\" or \"wss\", then throw a \"SyntaxError\" DOMException.\n    if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {\n      throw new DOMException(\n        `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,\n        'SyntaxError'\n      )\n    }\n\n    // 7. If urlRecord’s fragment is non-null, then throw a \"SyntaxError\"\n    //    DOMException.\n    if (urlRecord.hash || urlRecord.href.endsWith('#')) {\n      throw new DOMException('Got fragment', 'SyntaxError')\n    }\n\n    // 8. If protocols is a string, set protocols to a sequence consisting\n    //    of just that string.\n    if (typeof protocols === 'string') {\n      protocols = [protocols]\n    }\n\n    // 9. If any of the values in protocols occur more than once or otherwise\n    //    fail to match the requirements for elements that comprise the value\n    //    of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n    //    protocol, then throw a \"SyntaxError\" DOMException.\n    if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    // 10. Set this's url to urlRecord.\n    this[kWebSocketURL] = new URL(urlRecord.href)\n\n    // 11. Let client be this's relevant settings object.\n    const client = environmentSettingsObject.settingsObject\n\n    // 12. Run this step in parallel:\n\n    //    1. Establish a WebSocket connection given urlRecord, protocols,\n    //       and client.\n    this[kController] = establishWebSocketConnection(\n      urlRecord,\n      protocols,\n      client,\n      this,\n      (response, extensions) => this.#onConnectionEstablished(response, extensions),\n      options\n    )\n\n    // Each WebSocket object has an associated ready state, which is a\n    // number representing the state of the connection. Initially it must\n    // be CONNECTING (0).\n    this[kReadyState] = WebSocket.CONNECTING\n\n    this[kSentClose] = sentCloseFrameState.NOT_SENT\n\n    // The extensions attribute must initially return the empty string.\n\n    // The protocol attribute must initially return the empty string.\n\n    // Each WebSocket object has an associated binary type, which is a\n    // BinaryType. Initially it must be \"blob\".\n    this[kBinaryType] = 'blob'\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n   * @param {number|undefined} code\n   * @param {string|undefined} reason\n   */\n  close (code = undefined, reason = undefined) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.close'\n\n    if (code !== undefined) {\n      code = webidl.converters['unsigned short'](code, prefix, 'code', { clamp: true })\n    }\n\n    if (reason !== undefined) {\n      reason = webidl.converters.USVString(reason, prefix, 'reason')\n    }\n\n    // 1. If code is present, but is neither an integer equal to 1000 nor an\n    //    integer in the range 3000 to 4999, inclusive, throw an\n    //    \"InvalidAccessError\" DOMException.\n    if (code !== undefined) {\n      if (code !== 1000 && (code < 3000 || code > 4999)) {\n        throw new DOMException('invalid code', 'InvalidAccessError')\n      }\n    }\n\n    let reasonByteLength = 0\n\n    // 2. If reason is present, then run these substeps:\n    if (reason !== undefined) {\n      // 1. Let reasonBytes be the result of encoding reason.\n      // 2. If reasonBytes is longer than 123 bytes, then throw a\n      //    \"SyntaxError\" DOMException.\n      reasonByteLength = Buffer.byteLength(reason)\n\n      if (reasonByteLength > 123) {\n        throw new DOMException(\n          `Reason must be less than 123 bytes; received ${reasonByteLength}`,\n          'SyntaxError'\n        )\n      }\n    }\n\n    // 3. Run the first matching steps from the following list:\n    closeWebSocketConnection(this, code, reason, reasonByteLength)\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n   * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n   */\n  send (data) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.send'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    data = webidl.converters.WebSocketSendData(data, prefix, 'data')\n\n    // 1. If this's ready state is CONNECTING, then throw an\n    //    \"InvalidStateError\" DOMException.\n    if (isConnecting(this)) {\n      throw new DOMException('Sent before connected.', 'InvalidStateError')\n    }\n\n    // 2. Run the appropriate set of steps from the following list:\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n    if (!isEstablished(this) || isClosing(this)) {\n      return\n    }\n\n    // If data is a string\n    if (typeof data === 'string') {\n      // If the WebSocket connection is established and the WebSocket\n      // closing handshake has not yet started, then the user agent\n      // must send a WebSocket Message comprised of the data argument\n      // using a text frame opcode; if the data cannot be sent, e.g.\n      // because it would need to be buffered but the buffer is full,\n      // the user agent must flag the WebSocket as full and then close\n      // the WebSocket connection. Any invocation of this method with a\n      // string argument that does not throw an exception must increase\n      // the bufferedAmount attribute by the number of bytes needed to\n      // express the argument as UTF-8.\n\n      const length = Buffer.byteLength(data)\n\n      this.#bufferedAmount += length\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= length\n      }, sendHints.string)\n    } else if (types.isArrayBuffer(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need\n      // to be buffered but the buffer is full, the user agent must flag\n      // the WebSocket as full and then close the WebSocket connection.\n      // The data to be sent is the data stored in the buffer described\n      // by the ArrayBuffer object. Any invocation of this method with an\n      // ArrayBuffer argument that does not throw an exception must\n      // increase the bufferedAmount attribute by the length of the\n      // ArrayBuffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.arrayBuffer)\n    } else if (ArrayBuffer.isView(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The\n      // data to be sent is the data stored in the section of the buffer\n      // described by the ArrayBuffer object that data references. Any\n      // invocation of this method with this kind of argument that does\n      // not throw an exception must increase the bufferedAmount attribute\n      // by the length of data’s buffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.typedArray)\n    } else if (isBlobLike(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The data\n      // to be sent is the raw data represented by the Blob object. Any\n      // invocation of this method with a Blob argument that does not throw\n      // an exception must increase the bufferedAmount attribute by the size\n      // of the Blob object’s raw data, in bytes.\n\n      this.#bufferedAmount += data.size\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.size\n      }, sendHints.blob)\n    }\n  }\n\n  get readyState () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The readyState getter steps are to return this's ready state.\n    return this[kReadyState]\n  }\n\n  get bufferedAmount () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#bufferedAmount\n  }\n\n  get url () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The url getter steps are to return this's url, serialized.\n    return URLSerializer(this[kWebSocketURL])\n  }\n\n  get extensions () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#extensions\n  }\n\n  get protocol () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#protocol\n  }\n\n  get onopen () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.open = fn\n      this.addEventListener('open', fn)\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this.#events.error = null\n    }\n  }\n\n  get onclose () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.close\n  }\n\n  set onclose (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.close) {\n      this.removeEventListener('close', this.#events.close)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.close = fn\n      this.addEventListener('close', fn)\n    } else {\n      this.#events.close = null\n    }\n  }\n\n  get onmessage () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.message = fn\n      this.addEventListener('message', fn)\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get binaryType () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this[kBinaryType]\n  }\n\n  set binaryType (type) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (type !== 'blob' && type !== 'arraybuffer') {\n      this[kBinaryType] = 'blob'\n    } else {\n      this[kBinaryType] = type\n    }\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n   */\n  #onConnectionEstablished (response, parsedExtensions) {\n    // processResponse is called when the \"response's header list has been received and initialized.\"\n    // once this happens, the connection is open\n    this[kResponse] = response\n\n    const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions\n    const maxFragments = webSocketOptions?.maxFragments\n    const maxPayloadSize = webSocketOptions?.maxPayloadSize\n\n    const parser = new ByteParser(this, parsedExtensions, {\n      maxFragments,\n      maxPayloadSize\n    })\n    parser.on('drain', onParserDrain)\n    parser.on('error', onParserError.bind(this))\n\n    response.socket.ws = this\n    this[kByteParser] = parser\n\n    this.#sendQueue = new SendQueue(response.socket)\n\n    // 1. Change the ready state to OPEN (1).\n    this[kReadyState] = states.OPEN\n\n    // 2. Change the extensions attribute’s value to the extensions in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n    const extensions = response.headersList.get('sec-websocket-extensions')\n\n    if (extensions !== null) {\n      this.#extensions = extensions\n    }\n\n    // 3. Change the protocol attribute’s value to the subprotocol in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n    const protocol = response.headersList.get('sec-websocket-protocol')\n\n    if (protocol !== null) {\n      this.#protocol = protocol\n    }\n\n    // 4. Fire an event named open at the WebSocket object.\n    fireEvent('open', this)\n  }\n}\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors,\n  url: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  bufferedAmount: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onclose: kEnumerableProperty,\n  close: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  binaryType: kEnumerableProperty,\n  send: kEnumerableProperty,\n  extensions: kEnumerableProperty,\n  protocol: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'WebSocket',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(WebSocket, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence'] = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {\n    return webidl.converters['sequence'](V)\n  }\n\n  return webidl.converters.DOMString(V, prefix, argument)\n}\n\n// This implements the proposal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n  {\n    key: 'protocols',\n    converter: webidl.converters['DOMString or sequence'],\n    defaultValue: () => new Array(0)\n  },\n  {\n    key: 'dispatcher',\n    converter: webidl.converters.any,\n    defaultValue: () => getGlobalDispatcher()\n  },\n  {\n    key: 'headers',\n    converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n  }\n])\n\nwebidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {\n  if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {\n    return webidl.converters.WebSocketInit(V)\n  }\n\n  return { protocols: webidl.converters['DOMString or sequence'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n  if (webidl.util.Type(V) === 'Object') {\n    if (isBlobLike(V)) {\n      return webidl.converters.Blob(V, { strict: false })\n    }\n\n    if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n      return webidl.converters.BufferSource(V)\n    }\n  }\n\n  return webidl.converters.USVString(V)\n}\n\nfunction onParserDrain () {\n  this.ws[kResponse].socket.resume()\n}\n\nfunction onParserError (err) {\n  let message\n  let code\n\n  if (err instanceof CloseEvent) {\n    message = err.reason\n    code = err.code\n  } else {\n    message = err.message\n  }\n\n  fireEvent('error', this, () => new ErrorEvent('error', { error: err, message }))\n\n  closeWebSocketConnection(this, code)\n}\n\nmodule.exports = {\n  WebSocket\n}\n","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"https\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:async_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:buffer\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:console\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:crypto\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:diagnostics_channel\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:dns\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs/promises\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http2\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:path\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:perf_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:querystring\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:url\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util/types\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:worker_threads\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:zlib\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"string_decoder\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\\/\\/\\/\\w:/) ? 1 : 0, -1) + \"/\";","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"os\");","// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nexport function toCommandValue(input) {\n    if (input === null || input === undefined) {\n        return '';\n    }\n    else if (typeof input === 'string' || input instanceof String) {\n        return input;\n    }\n    return JSON.stringify(input);\n}\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nexport function toCommandProperties(annotationProperties) {\n    if (!Object.keys(annotationProperties).length) {\n        return {};\n    }\n    return {\n        title: annotationProperties.title,\n        file: annotationProperties.file,\n        line: annotationProperties.startLine,\n        endLine: annotationProperties.endLine,\n        col: annotationProperties.startColumn,\n        endColumn: annotationProperties.endColumn\n    };\n}\n//# sourceMappingURL=utils.js.map","import * as os from 'os';\nimport { toCommandValue } from './utils.js';\n/**\n * Issues a command to the GitHub Actions runner\n *\n * @param command - The command name to issue\n * @param properties - Additional properties for the command (key-value pairs)\n * @param message - The message to include with the command\n * @remarks\n * This function outputs a specially formatted string to stdout that the Actions\n * runner interprets as a command. These commands can control workflow behavior,\n * set outputs, create annotations, mask values, and more.\n *\n * Command Format:\n *   ::name key=value,key=value::message\n *\n * @example\n * ```typescript\n * // Issue a warning annotation\n * issueCommand('warning', {}, 'This is a warning message');\n * // Output: ::warning::This is a warning message\n *\n * // Set an environment variable\n * issueCommand('set-env', { name: 'MY_VAR' }, 'some value');\n * // Output: ::set-env name=MY_VAR::some value\n *\n * // Add a secret mask\n * issueCommand('add-mask', {}, 'secretValue123');\n * // Output: ::add-mask::secretValue123\n * ```\n *\n * @internal\n * This is an internal utility function that powers the public API functions\n * such as setSecret, warning, error, and exportVariable.\n */\nexport function issueCommand(command, properties, message) {\n    const cmd = new Command(command, properties, message);\n    process.stdout.write(cmd.toString() + os.EOL);\n}\nexport function issue(name, message = '') {\n    issueCommand(name, {}, message);\n}\nconst CMD_STRING = '::';\nclass Command {\n    constructor(command, properties, message) {\n        if (!command) {\n            command = 'missing.command';\n        }\n        this.command = command;\n        this.properties = properties;\n        this.message = message;\n    }\n    toString() {\n        let cmdStr = CMD_STRING + this.command;\n        if (this.properties && Object.keys(this.properties).length > 0) {\n            cmdStr += ' ';\n            let first = true;\n            for (const key in this.properties) {\n                if (this.properties.hasOwnProperty(key)) {\n                    const val = this.properties[key];\n                    if (val) {\n                        if (first) {\n                            first = false;\n                        }\n                        else {\n                            cmdStr += ',';\n                        }\n                        cmdStr += `${key}=${escapeProperty(val)}`;\n                    }\n                }\n            }\n        }\n        cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n        return cmdStr;\n    }\n}\nfunction escapeData(s) {\n    return toCommandValue(s)\n        .replace(/%/g, '%25')\n        .replace(/\\r/g, '%0D')\n        .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n    return toCommandValue(s)\n        .replace(/%/g, '%25')\n        .replace(/\\r/g, '%0D')\n        .replace(/\\n/g, '%0A')\n        .replace(/:/g, '%3A')\n        .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"crypto\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"fs\");","// For internal use, subject to change.\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as crypto from 'crypto';\nimport * as fs from 'fs';\nimport * as os from 'os';\nimport { toCommandValue } from './utils.js';\nexport function issueFileCommand(command, message) {\n    const filePath = process.env[`GITHUB_${command}`];\n    if (!filePath) {\n        throw new Error(`Unable to find environment variable for file command ${command}`);\n    }\n    if (!fs.existsSync(filePath)) {\n        throw new Error(`Missing file at path: ${filePath}`);\n    }\n    fs.appendFileSync(filePath, `${toCommandValue(message)}${os.EOL}`, {\n        encoding: 'utf8'\n    });\n}\nexport function prepareKeyValueMessage(key, value) {\n    const delimiter = `ghadelimiter_${crypto.randomUUID()}`;\n    const convertedValue = toCommandValue(value);\n    // These should realistically never happen, but just in case someone finds a\n    // way to exploit uuid generation let's not allow keys or values that contain\n    // the delimiter.\n    if (key.includes(delimiter)) {\n        throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n    }\n    if (convertedValue.includes(delimiter)) {\n        throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n    }\n    return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\n//# sourceMappingURL=file-command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"path\");","export function getProxyUrl(reqUrl) {\n    const usingSsl = reqUrl.protocol === 'https:';\n    if (checkBypass(reqUrl)) {\n        return undefined;\n    }\n    const proxyVar = (() => {\n        if (usingSsl) {\n            return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n        }\n        else {\n            return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n        }\n    })();\n    if (proxyVar) {\n        try {\n            return new DecodedURL(proxyVar);\n        }\n        catch (_a) {\n            if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))\n                return new DecodedURL(`http://${proxyVar}`);\n        }\n    }\n    else {\n        return undefined;\n    }\n}\nexport function checkBypass(reqUrl) {\n    if (!reqUrl.hostname) {\n        return false;\n    }\n    const reqHost = reqUrl.hostname;\n    if (isLoopbackAddress(reqHost)) {\n        return true;\n    }\n    const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n    if (!noProxy) {\n        return false;\n    }\n    // Determine the request port\n    let reqPort;\n    if (reqUrl.port) {\n        reqPort = Number(reqUrl.port);\n    }\n    else if (reqUrl.protocol === 'http:') {\n        reqPort = 80;\n    }\n    else if (reqUrl.protocol === 'https:') {\n        reqPort = 443;\n    }\n    // Format the request hostname and hostname with port\n    const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n    if (typeof reqPort === 'number') {\n        upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n    }\n    // Compare request host against noproxy\n    for (const upperNoProxyItem of noProxy\n        .split(',')\n        .map(x => x.trim().toUpperCase())\n        .filter(x => x)) {\n        if (upperNoProxyItem === '*' ||\n            upperReqHosts.some(x => x === upperNoProxyItem ||\n                x.endsWith(`.${upperNoProxyItem}`) ||\n                (upperNoProxyItem.startsWith('.') &&\n                    x.endsWith(`${upperNoProxyItem}`)))) {\n            return true;\n        }\n    }\n    return false;\n}\nfunction isLoopbackAddress(host) {\n    const hostLower = host.toLowerCase();\n    return (hostLower === 'localhost' ||\n        hostLower.startsWith('127.') ||\n        hostLower.startsWith('[::1]') ||\n        hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\nclass DecodedURL extends URL {\n    constructor(url, base) {\n        super(url, base);\n        this._decodedUsername = decodeURIComponent(super.username);\n        this._decodedPassword = decodeURIComponent(super.password);\n    }\n    get username() {\n        return this._decodedUsername;\n    }\n    get password() {\n        return this._decodedPassword;\n    }\n}\n//# sourceMappingURL=proxy.js.map","/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as pm from './proxy.js';\nimport * as tunnel from 'tunnel';\nimport { ProxyAgent } from 'undici';\nexport var HttpCodes;\n(function (HttpCodes) {\n    HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n    HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n    HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n    HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n    HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n    HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n    HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n    HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n    HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n    HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n    HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n    HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n    HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n    HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n    HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n    HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n    HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n    HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n    HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n    HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n    HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n    HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n    HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n    HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n    HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n    HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n    HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes || (HttpCodes = {}));\nexport var Headers;\n(function (Headers) {\n    Headers[\"Accept\"] = \"accept\";\n    Headers[\"ContentType\"] = \"content-type\";\n})(Headers || (Headers = {}));\nexport var MediaTypes;\n(function (MediaTypes) {\n    MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes || (MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl  The server URL where the request will be sent. For example, https://api.github.com\n */\nexport function getProxyUrl(serverUrl) {\n    const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n    return proxyUrl ? proxyUrl.href : '';\n}\nconst HttpRedirectCodes = [\n    HttpCodes.MovedPermanently,\n    HttpCodes.ResourceMoved,\n    HttpCodes.SeeOther,\n    HttpCodes.TemporaryRedirect,\n    HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n    HttpCodes.BadGateway,\n    HttpCodes.ServiceUnavailable,\n    HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nexport class HttpClientError extends Error {\n    constructor(message, statusCode) {\n        super(message);\n        this.name = 'HttpClientError';\n        this.statusCode = statusCode;\n        Object.setPrototypeOf(this, HttpClientError.prototype);\n    }\n}\nexport class HttpClientResponse {\n    constructor(message) {\n        this.message = message;\n    }\n    readBody() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n                let output = Buffer.alloc(0);\n                this.message.on('data', (chunk) => {\n                    output = Buffer.concat([output, chunk]);\n                });\n                this.message.on('end', () => {\n                    resolve(output.toString());\n                });\n            }));\n        });\n    }\n    readBodyBuffer() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n                const chunks = [];\n                this.message.on('data', (chunk) => {\n                    chunks.push(chunk);\n                });\n                this.message.on('end', () => {\n                    resolve(Buffer.concat(chunks));\n                });\n            }));\n        });\n    }\n}\nexport function isHttps(requestUrl) {\n    const parsedUrl = new URL(requestUrl);\n    return parsedUrl.protocol === 'https:';\n}\nexport class HttpClient {\n    constructor(userAgent, handlers, requestOptions) {\n        this._ignoreSslError = false;\n        this._allowRedirects = true;\n        this._allowRedirectDowngrade = false;\n        this._maxRedirects = 50;\n        this._allowRetries = false;\n        this._maxRetries = 1;\n        this._keepAlive = false;\n        this._disposed = false;\n        this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);\n        this.handlers = handlers || [];\n        this.requestOptions = requestOptions;\n        if (requestOptions) {\n            if (requestOptions.ignoreSslError != null) {\n                this._ignoreSslError = requestOptions.ignoreSslError;\n            }\n            this._socketTimeout = requestOptions.socketTimeout;\n            if (requestOptions.allowRedirects != null) {\n                this._allowRedirects = requestOptions.allowRedirects;\n            }\n            if (requestOptions.allowRedirectDowngrade != null) {\n                this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n            }\n            if (requestOptions.maxRedirects != null) {\n                this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n            }\n            if (requestOptions.keepAlive != null) {\n                this._keepAlive = requestOptions.keepAlive;\n            }\n            if (requestOptions.allowRetries != null) {\n                this._allowRetries = requestOptions.allowRetries;\n            }\n            if (requestOptions.maxRetries != null) {\n                this._maxRetries = requestOptions.maxRetries;\n            }\n        }\n    }\n    options(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    get(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('GET', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    del(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    post(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('POST', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    patch(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    put(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('PUT', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    head(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    sendStream(verb, requestUrl, stream, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request(verb, requestUrl, stream, additionalHeaders);\n        });\n    }\n    /**\n     * Gets a typed object from an endpoint\n     * Be aware that not found returns a null.  Other errors (4xx, 5xx) reject the promise\n     */\n    getJson(requestUrl_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            const res = yield this.get(requestUrl, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    postJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.post(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    putJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.put(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    patchJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.patch(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    /**\n     * Makes a raw http request.\n     * All other methods such as get, post, patch, and request ultimately call this.\n     * Prefer get, del, post and patch\n     */\n    request(verb, requestUrl, data, headers) {\n        return __awaiter(this, void 0, void 0, function* () {\n            if (this._disposed) {\n                throw new Error('Client has already been disposed.');\n            }\n            const parsedUrl = new URL(requestUrl);\n            let info = this._prepareRequest(verb, parsedUrl, headers);\n            // Only perform retries on reads since writes may not be idempotent.\n            const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n                ? this._maxRetries + 1\n                : 1;\n            let numTries = 0;\n            let response;\n            do {\n                response = yield this.requestRaw(info, data);\n                // Check if it's an authentication challenge\n                if (response &&\n                    response.message &&\n                    response.message.statusCode === HttpCodes.Unauthorized) {\n                    let authenticationHandler;\n                    for (const handler of this.handlers) {\n                        if (handler.canHandleAuthentication(response)) {\n                            authenticationHandler = handler;\n                            break;\n                        }\n                    }\n                    if (authenticationHandler) {\n                        return authenticationHandler.handleAuthentication(this, info, data);\n                    }\n                    else {\n                        // We have received an unauthorized response but have no handlers to handle it.\n                        // Let the response return to the caller.\n                        return response;\n                    }\n                }\n                let redirectsRemaining = this._maxRedirects;\n                while (response.message.statusCode &&\n                    HttpRedirectCodes.includes(response.message.statusCode) &&\n                    this._allowRedirects &&\n                    redirectsRemaining > 0) {\n                    const redirectUrl = response.message.headers['location'];\n                    if (!redirectUrl) {\n                        // if there's no location to redirect to, we won't\n                        break;\n                    }\n                    const parsedRedirectUrl = new URL(redirectUrl);\n                    if (parsedUrl.protocol === 'https:' &&\n                        parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n                        !this._allowRedirectDowngrade) {\n                        throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n                    }\n                    // we need to finish reading the response before reassigning response\n                    // which will leak the open socket.\n                    yield response.readBody();\n                    // strip authorization header if redirected to a different hostname\n                    if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n                        for (const header in headers) {\n                            // header names are case insensitive\n                            if (header.toLowerCase() === 'authorization') {\n                                delete headers[header];\n                            }\n                        }\n                    }\n                    // let's make the request with the new redirectUrl\n                    info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n                    response = yield this.requestRaw(info, data);\n                    redirectsRemaining--;\n                }\n                if (!response.message.statusCode ||\n                    !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n                    // If not a retry code, return immediately instead of retrying\n                    return response;\n                }\n                numTries += 1;\n                if (numTries < maxTries) {\n                    yield response.readBody();\n                    yield this._performExponentialBackoff(numTries);\n                }\n            } while (numTries < maxTries);\n            return response;\n        });\n    }\n    /**\n     * Needs to be called if keepAlive is set to true in request options.\n     */\n    dispose() {\n        if (this._agent) {\n            this._agent.destroy();\n        }\n        this._disposed = true;\n    }\n    /**\n     * Raw request.\n     * @param info\n     * @param data\n     */\n    requestRaw(info, data) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve, reject) => {\n                function callbackForResult(err, res) {\n                    if (err) {\n                        reject(err);\n                    }\n                    else if (!res) {\n                        // If `err` is not passed, then `res` must be passed.\n                        reject(new Error('Unknown error'));\n                    }\n                    else {\n                        resolve(res);\n                    }\n                }\n                this.requestRawWithCallback(info, data, callbackForResult);\n            });\n        });\n    }\n    /**\n     * Raw request with callback.\n     * @param info\n     * @param data\n     * @param onResult\n     */\n    requestRawWithCallback(info, data, onResult) {\n        if (typeof data === 'string') {\n            if (!info.options.headers) {\n                info.options.headers = {};\n            }\n            info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n        }\n        let callbackCalled = false;\n        function handleResult(err, res) {\n            if (!callbackCalled) {\n                callbackCalled = true;\n                onResult(err, res);\n            }\n        }\n        const req = info.httpModule.request(info.options, (msg) => {\n            const res = new HttpClientResponse(msg);\n            handleResult(undefined, res);\n        });\n        let socket;\n        req.on('socket', sock => {\n            socket = sock;\n        });\n        // If we ever get disconnected, we want the socket to timeout eventually\n        req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n            if (socket) {\n                socket.end();\n            }\n            handleResult(new Error(`Request timeout: ${info.options.path}`));\n        });\n        req.on('error', function (err) {\n            // err has statusCode property\n            // res should have headers\n            handleResult(err);\n        });\n        if (data && typeof data === 'string') {\n            req.write(data, 'utf8');\n        }\n        if (data && typeof data !== 'string') {\n            data.on('close', function () {\n                req.end();\n            });\n            data.pipe(req);\n        }\n        else {\n            req.end();\n        }\n    }\n    /**\n     * Gets an http agent. This function is useful when you need an http agent that handles\n     * routing through a proxy server - depending upon the url and proxy environment variables.\n     * @param serverUrl  The server URL where the request will be sent. For example, https://api.github.com\n     */\n    getAgent(serverUrl) {\n        const parsedUrl = new URL(serverUrl);\n        return this._getAgent(parsedUrl);\n    }\n    getAgentDispatcher(serverUrl) {\n        const parsedUrl = new URL(serverUrl);\n        const proxyUrl = pm.getProxyUrl(parsedUrl);\n        const useProxy = proxyUrl && proxyUrl.hostname;\n        if (!useProxy) {\n            return;\n        }\n        return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);\n    }\n    _prepareRequest(method, requestUrl, headers) {\n        const info = {};\n        info.parsedUrl = requestUrl;\n        const usingSsl = info.parsedUrl.protocol === 'https:';\n        info.httpModule = usingSsl ? https : http;\n        const defaultPort = usingSsl ? 443 : 80;\n        info.options = {};\n        info.options.host = info.parsedUrl.hostname;\n        info.options.port = info.parsedUrl.port\n            ? parseInt(info.parsedUrl.port)\n            : defaultPort;\n        info.options.path =\n            (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n        info.options.method = method;\n        info.options.headers = this._mergeHeaders(headers);\n        if (this.userAgent != null) {\n            info.options.headers['user-agent'] = this.userAgent;\n        }\n        info.options.agent = this._getAgent(info.parsedUrl);\n        // gives handlers an opportunity to participate\n        if (this.handlers) {\n            for (const handler of this.handlers) {\n                handler.prepareRequest(info.options);\n            }\n        }\n        return info;\n    }\n    _mergeHeaders(headers) {\n        if (this.requestOptions && this.requestOptions.headers) {\n            return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n        }\n        return lowercaseKeys(headers || {});\n    }\n    /**\n     * Gets an existing header value or returns a default.\n     * Handles converting number header values to strings since HTTP headers must be strings.\n     * Note: This returns string | string[] since some headers can have multiple values.\n     * For headers that must always be a single string (like Content-Type), use the\n     * specialized _getExistingOrDefaultContentTypeHeader method instead.\n     */\n    _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n        let clientHeader;\n        if (this.requestOptions && this.requestOptions.headers) {\n            const headerValue = lowercaseKeys(this.requestOptions.headers)[header];\n            if (headerValue) {\n                clientHeader =\n                    typeof headerValue === 'number' ? headerValue.toString() : headerValue;\n            }\n        }\n        const additionalValue = additionalHeaders[header];\n        if (additionalValue !== undefined) {\n            return typeof additionalValue === 'number'\n                ? additionalValue.toString()\n                : additionalValue;\n        }\n        if (clientHeader !== undefined) {\n            return clientHeader;\n        }\n        return _default;\n    }\n    /**\n     * Specialized version of _getExistingOrDefaultHeader for Content-Type header.\n     * Always returns a single string (not an array) since Content-Type should be a single value.\n     * Converts arrays to comma-separated strings and numbers to strings to ensure type safety.\n     * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers\n     * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).\n     */\n    _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {\n        let clientHeader;\n        if (this.requestOptions && this.requestOptions.headers) {\n            const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];\n            if (headerValue) {\n                if (typeof headerValue === 'number') {\n                    clientHeader = String(headerValue);\n                }\n                else if (Array.isArray(headerValue)) {\n                    clientHeader = headerValue.join(', ');\n                }\n                else {\n                    clientHeader = headerValue;\n                }\n            }\n        }\n        const additionalValue = additionalHeaders[Headers.ContentType];\n        // Return the first non-undefined value, converting numbers or arrays to strings if necessary\n        if (additionalValue !== undefined) {\n            if (typeof additionalValue === 'number') {\n                return String(additionalValue);\n            }\n            else if (Array.isArray(additionalValue)) {\n                return additionalValue.join(', ');\n            }\n            else {\n                return additionalValue;\n            }\n        }\n        if (clientHeader !== undefined) {\n            return clientHeader;\n        }\n        return _default;\n    }\n    _getAgent(parsedUrl) {\n        let agent;\n        const proxyUrl = pm.getProxyUrl(parsedUrl);\n        const useProxy = proxyUrl && proxyUrl.hostname;\n        if (this._keepAlive && useProxy) {\n            agent = this._proxyAgent;\n        }\n        if (!useProxy) {\n            agent = this._agent;\n        }\n        // if agent is already assigned use that agent.\n        if (agent) {\n            return agent;\n        }\n        const usingSsl = parsedUrl.protocol === 'https:';\n        let maxSockets = 100;\n        if (this.requestOptions) {\n            maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n        }\n        // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n        if (proxyUrl && proxyUrl.hostname) {\n            const agentOptions = {\n                maxSockets,\n                keepAlive: this._keepAlive,\n                proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n                    proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n                })), { host: proxyUrl.hostname, port: proxyUrl.port })\n            };\n            let tunnelAgent;\n            const overHttps = proxyUrl.protocol === 'https:';\n            if (usingSsl) {\n                tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n            }\n            else {\n                tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n            }\n            agent = tunnelAgent(agentOptions);\n            this._proxyAgent = agent;\n        }\n        // if tunneling agent isn't assigned create a new agent\n        if (!agent) {\n            const options = { keepAlive: this._keepAlive, maxSockets };\n            agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n            this._agent = agent;\n        }\n        if (usingSsl && this._ignoreSslError) {\n            // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n            // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n            // we have to cast it to any and change it directly\n            agent.options = Object.assign(agent.options || {}, {\n                rejectUnauthorized: false\n            });\n        }\n        return agent;\n    }\n    _getProxyAgentDispatcher(parsedUrl, proxyUrl) {\n        let proxyAgent;\n        if (this._keepAlive) {\n            proxyAgent = this._proxyAgentDispatcher;\n        }\n        // if agent is already assigned use that agent.\n        if (proxyAgent) {\n            return proxyAgent;\n        }\n        const usingSsl = parsedUrl.protocol === 'https:';\n        proxyAgent = new ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {\n            token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`\n        })));\n        this._proxyAgentDispatcher = proxyAgent;\n        if (usingSsl && this._ignoreSslError) {\n            // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n            // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n            // we have to cast it to any and change it directly\n            proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {\n                rejectUnauthorized: false\n            });\n        }\n        return proxyAgent;\n    }\n    _getUserAgentWithOrchestrationId(userAgent) {\n        const baseUserAgent = userAgent || 'actions/http-client';\n        const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];\n        if (orchId) {\n            // Sanitize the orchestration ID to ensure it contains only valid characters\n            // Valid characters: 0-9, a-z, _, -, .\n            const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');\n            return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;\n        }\n        return baseUserAgent;\n    }\n    _performExponentialBackoff(retryNumber) {\n        return __awaiter(this, void 0, void 0, function* () {\n            retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n            const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n            return new Promise(resolve => setTimeout(() => resolve(), ms));\n        });\n    }\n    _processResponse(res, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n                const statusCode = res.message.statusCode || 0;\n                const response = {\n                    statusCode,\n                    result: null,\n                    headers: {}\n                };\n                // not found leads to null obj returned\n                if (statusCode === HttpCodes.NotFound) {\n                    resolve(response);\n                }\n                // get the result from the body\n                function dateTimeDeserializer(key, value) {\n                    if (typeof value === 'string') {\n                        const a = new Date(value);\n                        if (!isNaN(a.valueOf())) {\n                            return a;\n                        }\n                    }\n                    return value;\n                }\n                let obj;\n                let contents;\n                try {\n                    contents = yield res.readBody();\n                    if (contents && contents.length > 0) {\n                        if (options && options.deserializeDates) {\n                            obj = JSON.parse(contents, dateTimeDeserializer);\n                        }\n                        else {\n                            obj = JSON.parse(contents);\n                        }\n                        response.result = obj;\n                    }\n                    response.headers = res.message.headers;\n                }\n                catch (err) {\n                    // Invalid resource (contents not json);  leaving result obj null\n                }\n                // note that 3xx redirects are handled by the http layer.\n                if (statusCode > 299) {\n                    let msg;\n                    // if exception/error in body, attempt to get better error\n                    if (obj && obj.message) {\n                        msg = obj.message;\n                    }\n                    else if (contents && contents.length > 0) {\n                        // it may be the case that the exception is in the body message as string\n                        msg = contents;\n                    }\n                    else {\n                        msg = `Failed request: (${statusCode})`;\n                    }\n                    const err = new HttpClientError(msg, statusCode);\n                    err.result = response.result;\n                    reject(err);\n                }\n                else {\n                    resolve(response);\n                }\n            }));\n        });\n    }\n}\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nexport class BasicCredentialHandler {\n    constructor(username, password) {\n        this.username = username;\n        this.password = password;\n    }\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\nexport class BearerCredentialHandler {\n    constructor(token) {\n        this.token = token;\n    }\n    // currently implements pre-authorization\n    // TODO: support preAuth = false where it hooks on 401\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Bearer ${this.token}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\nexport class PersonalAccessTokenCredentialHandler {\n    constructor(token) {\n        this.token = token;\n    }\n    // currently implements pre-authorization\n    // TODO: support preAuth = false where it hooks on 401\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\n//# sourceMappingURL=auth.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { HttpClient } from '@actions/http-client';\nimport { BearerCredentialHandler } from '@actions/http-client/lib/auth';\nimport { debug, setSecret } from './core.js';\nexport class OidcClient {\n    static createHttpClient(allowRetry = true, maxRetry = 10) {\n        const requestOptions = {\n            allowRetries: allowRetry,\n            maxRetries: maxRetry\n        };\n        return new HttpClient('actions/oidc-client', [new BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n    }\n    static getRequestToken() {\n        const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n        if (!token) {\n            throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n        }\n        return token;\n    }\n    static getIDTokenUrl() {\n        const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n        if (!runtimeUrl) {\n            throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n        }\n        return runtimeUrl;\n    }\n    static getCall(id_token_url) {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a;\n            const httpclient = OidcClient.createHttpClient();\n            const res = yield httpclient\n                .getJson(id_token_url)\n                .catch(error => {\n                throw new Error(`Failed to get ID Token. \\n \n        Error Code : ${error.statusCode}\\n \n        Error Message: ${error.message}`);\n            });\n            const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n            if (!id_token) {\n                throw new Error('Response json body do not have ID Token field');\n            }\n            return id_token;\n        });\n    }\n    static getIDToken(audience) {\n        return __awaiter(this, void 0, void 0, function* () {\n            try {\n                // New ID Token is requested from action service\n                let id_token_url = OidcClient.getIDTokenUrl();\n                if (audience) {\n                    const encodedAudience = encodeURIComponent(audience);\n                    id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n                }\n                debug(`ID token url is ${id_token_url}`);\n                const id_token = yield OidcClient.getCall(id_token_url);\n                setSecret(id_token);\n                return id_token;\n            }\n            catch (error) {\n                throw new Error(`Error message: ${error.message}`);\n            }\n        });\n    }\n}\n//# sourceMappingURL=oidc-utils.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { EOL } from 'os';\nimport { constants, promises } from 'fs';\nconst { access, appendFile, writeFile } = promises;\nexport const SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexport const SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n    constructor() {\n        this._buffer = '';\n    }\n    /**\n     * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n     * Also checks r/w permissions.\n     *\n     * @returns step summary file path\n     */\n    filePath() {\n        return __awaiter(this, void 0, void 0, function* () {\n            if (this._filePath) {\n                return this._filePath;\n            }\n            const pathFromEnv = process.env[SUMMARY_ENV_VAR];\n            if (!pathFromEnv) {\n                throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n            }\n            try {\n                yield access(pathFromEnv, constants.R_OK | constants.W_OK);\n            }\n            catch (_a) {\n                throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n            }\n            this._filePath = pathFromEnv;\n            return this._filePath;\n        });\n    }\n    /**\n     * Wraps content in an HTML tag, adding any HTML attributes\n     *\n     * @param {string} tag HTML tag to wrap\n     * @param {string | null} content content within the tag\n     * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n     *\n     * @returns {string} content wrapped in HTML element\n     */\n    wrap(tag, content, attrs = {}) {\n        const htmlAttrs = Object.entries(attrs)\n            .map(([key, value]) => ` ${key}=\"${value}\"`)\n            .join('');\n        if (!content) {\n            return `<${tag}${htmlAttrs}>`;\n        }\n        return `<${tag}${htmlAttrs}>${content}`;\n    }\n    /**\n     * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n     *\n     * @param {SummaryWriteOptions} [options] (optional) options for write operation\n     *\n     * @returns {Promise} summary instance\n     */\n    write(options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n            const filePath = yield this.filePath();\n            const writeFunc = overwrite ? writeFile : appendFile;\n            yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n            return this.emptyBuffer();\n        });\n    }\n    /**\n     * Clears the summary buffer and wipes the summary file\n     *\n     * @returns {Summary} summary instance\n     */\n    clear() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.emptyBuffer().write({ overwrite: true });\n        });\n    }\n    /**\n     * Returns the current summary buffer as a string\n     *\n     * @returns {string} string of summary buffer\n     */\n    stringify() {\n        return this._buffer;\n    }\n    /**\n     * If the summary buffer is empty\n     *\n     * @returns {boolen} true if the buffer is empty\n     */\n    isEmptyBuffer() {\n        return this._buffer.length === 0;\n    }\n    /**\n     * Resets the summary buffer without writing to summary file\n     *\n     * @returns {Summary} summary instance\n     */\n    emptyBuffer() {\n        this._buffer = '';\n        return this;\n    }\n    /**\n     * Adds raw text to the summary buffer\n     *\n     * @param {string} text content to add\n     * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n     *\n     * @returns {Summary} summary instance\n     */\n    addRaw(text, addEOL = false) {\n        this._buffer += text;\n        return addEOL ? this.addEOL() : this;\n    }\n    /**\n     * Adds the operating system-specific end-of-line marker to the buffer\n     *\n     * @returns {Summary} summary instance\n     */\n    addEOL() {\n        return this.addRaw(EOL);\n    }\n    /**\n     * Adds an HTML codeblock to the summary buffer\n     *\n     * @param {string} code content to render within fenced code block\n     * @param {string} lang (optional) language to syntax highlight code\n     *\n     * @returns {Summary} summary instance\n     */\n    addCodeBlock(code, lang) {\n        const attrs = Object.assign({}, (lang && { lang }));\n        const element = this.wrap('pre', this.wrap('code', code), attrs);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML list to the summary buffer\n     *\n     * @param {string[]} items list of items to render\n     * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n     *\n     * @returns {Summary} summary instance\n     */\n    addList(items, ordered = false) {\n        const tag = ordered ? 'ol' : 'ul';\n        const listItems = items.map(item => this.wrap('li', item)).join('');\n        const element = this.wrap(tag, listItems);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML table to the summary buffer\n     *\n     * @param {SummaryTableCell[]} rows table rows\n     *\n     * @returns {Summary} summary instance\n     */\n    addTable(rows) {\n        const tableBody = rows\n            .map(row => {\n            const cells = row\n                .map(cell => {\n                if (typeof cell === 'string') {\n                    return this.wrap('td', cell);\n                }\n                const { header, data, colspan, rowspan } = cell;\n                const tag = header ? 'th' : 'td';\n                const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n                return this.wrap(tag, data, attrs);\n            })\n                .join('');\n            return this.wrap('tr', cells);\n        })\n            .join('');\n        const element = this.wrap('table', tableBody);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds a collapsable HTML details element to the summary buffer\n     *\n     * @param {string} label text for the closed state\n     * @param {string} content collapsable content\n     *\n     * @returns {Summary} summary instance\n     */\n    addDetails(label, content) {\n        const element = this.wrap('details', this.wrap('summary', label) + content);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML image tag to the summary buffer\n     *\n     * @param {string} src path to the image you to embed\n     * @param {string} alt text description of the image\n     * @param {SummaryImageOptions} options (optional) addition image attributes\n     *\n     * @returns {Summary} summary instance\n     */\n    addImage(src, alt, options) {\n        const { width, height } = options || {};\n        const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n        const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML section heading element\n     *\n     * @param {string} text heading text\n     * @param {number | string} [level=1] (optional) the heading level, default: 1\n     *\n     * @returns {Summary} summary instance\n     */\n    addHeading(text, level) {\n        const tag = `h${level}`;\n        const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n            ? tag\n            : 'h1';\n        const element = this.wrap(allowedTag, text);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexport const markdownSummary = _summary;\nexport const summary = _summary;\n//# sourceMappingURL=summary.js.map","import * as path from 'path';\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nexport function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nexport function toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nexport function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\n//# sourceMappingURL=path-utils.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"child_process\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as fs from 'fs';\nimport * as path from 'path';\nexport const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises;\n// export const {open} = 'fs'\nexport const IS_WINDOWS = process.platform === 'win32';\n/**\n * Custom implementation of readlink to ensure Windows junctions\n * maintain trailing backslash for backward compatibility with Node.js < 24\n *\n * In Node.js 20, Windows junctions (directory symlinks) always returned paths\n * with trailing backslashes. Node.js 24 removed this behavior, which breaks\n * code that relied on this format for path operations.\n *\n * This implementation restores the Node 20 behavior by adding a trailing\n * backslash to all junction results on Windows.\n */\nexport function readlink(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield fs.promises.readlink(fsPath);\n // On Windows, restore Node 20 behavior: add trailing backslash to all results\n // since junctions on Windows are always directory links\n if (IS_WINDOWS && !result.endsWith('\\\\')) {\n return `${result}\\\\`;\n }\n return result;\n });\n}\n// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691\nexport const UV_FS_O_EXLOCK = 0x10000000;\nexport const READONLY = fs.constants.O_RDONLY;\nexport function exists(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n yield stat(fsPath);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n }\n return true;\n });\n}\nexport function isDirectory(fsPath_1) {\n return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) {\n const stats = useStat ? yield stat(fsPath) : yield lstat(fsPath);\n return stats.isDirectory();\n });\n}\n/**\n * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:\n * \\, \\hello, \\\\hello\\share, C:, and C:\\hello (and corresponding alternate separator cases).\n */\nexport function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}\n/**\n * Best effort attempt to determine whether a file exists and is executable.\n * @param filePath file path to check\n * @param extensions additional file extensions to try\n * @return if file exists and is executable, returns the file path. otherwise empty string.\n */\nexport function tryGetExecutablePath(filePath, extensions) {\n return __awaiter(this, void 0, void 0, function* () {\n let stats = undefined;\n try {\n // test file exists\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // on Windows, test for valid extension\n const upperExt = path.extname(filePath).toUpperCase();\n if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {\n return filePath;\n }\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n // try each extension\n const originalFilePath = filePath;\n for (const extension of extensions) {\n filePath = originalFilePath + extension;\n stats = undefined;\n try {\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // preserve the case of the actual file (since an extension was appended)\n try {\n const directory = path.dirname(filePath);\n const upperName = path.basename(filePath).toUpperCase();\n for (const actualName of yield readdir(directory)) {\n if (upperName === actualName.toUpperCase()) {\n filePath = path.join(directory, actualName);\n break;\n }\n }\n }\n catch (err) {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);\n }\n return filePath;\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n }\n return '';\n });\n}\nfunction normalizeSeparators(p) {\n p = p || '';\n if (IS_WINDOWS) {\n // convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // remove redundant slashes\n return p.replace(/\\\\\\\\+/g, '\\\\');\n }\n // remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n// on Mac/Linux, test the execute bit\n// R W X R W X R W X\n// 256 128 64 32 16 8 4 2 1\nfunction isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 &&\n process.getgid !== undefined &&\n stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 &&\n process.getuid !== undefined &&\n stats.uid === process.getuid()));\n}\n// Get the path of cmd.exe in windows\nexport function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}\n//# sourceMappingURL=io-util.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ok } from 'assert';\nimport * as path from 'path';\nimport * as ioUtil from './io-util.js';\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nexport function cp(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n const { force, recursive, copySourceDirectory } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory() && copySourceDirectory\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nexport function mv(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nexport function rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Check for invalid characters\n // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n if (/[*\"<>|]/.test(inputPath)) {\n throw new Error('File path must not contain `*`, `\"`, `<`, `>` or `|` on Windows');\n }\n }\n try {\n // note if path does not exist, error is silent\n yield ioUtil.rm(inputPath, {\n force: true,\n maxRetries: 3,\n recursive: true,\n retryDelay: 300\n });\n }\n catch (err) {\n throw new Error(`File was unable to be removed ${err}`);\n }\n });\n}\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nexport function mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n ok(fsPath, 'a path argument must be provided');\n yield ioUtil.mkdir(fsPath, { recursive: true });\n });\n}\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nexport function which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nexport function findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n const copySourceDirectory = options.copySourceDirectory == null\n ? true\n : Boolean(options.copySourceDirectory);\n return { force, recursive, copySourceDirectory };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"timers\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as os from 'os';\nimport * as events from 'events';\nimport * as child from 'child_process';\nimport * as path from 'path';\nimport * as io from '@actions/io';\nimport * as ioUtil from '@actions/io/lib/io-util';\nimport { setTimeout } from 'timers';\n/* eslint-disable @typescript-eslint/unbound-method */\nconst IS_WINDOWS = process.platform === 'win32';\n/*\n * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.\n */\nexport class ToolRunner extends events.EventEmitter {\n constructor(toolPath, args, options) {\n super();\n if (!toolPath) {\n throw new Error(\"Parameter 'toolPath' cannot be null or empty.\");\n }\n this.toolPath = toolPath;\n this.args = args || [];\n this.options = options || {};\n }\n _debug(message) {\n if (this.options.listeners && this.options.listeners.debug) {\n this.options.listeners.debug(message);\n }\n }\n _getCommandString(options, noPrefix) {\n const toolPath = this._getSpawnFileName();\n const args = this._getSpawnArgs(options);\n let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool\n if (IS_WINDOWS) {\n // Windows + cmd file\n if (this._isCmdFile()) {\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows + verbatim\n else if (options.windowsVerbatimArguments) {\n cmd += `\"${toolPath}\"`;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows (regular)\n else {\n cmd += this._windowsQuoteCmdArg(toolPath);\n for (const a of args) {\n cmd += ` ${this._windowsQuoteCmdArg(a)}`;\n }\n }\n }\n else {\n // OSX/Linux - this can likely be improved with some form of quoting.\n // creating processes on Unix is fundamentally different than Windows.\n // on Unix, execvp() takes an arg array.\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n return cmd;\n }\n _processLineBuffer(data, strBuffer, onLine) {\n try {\n let s = strBuffer + data.toString();\n let n = s.indexOf(os.EOL);\n while (n > -1) {\n const line = s.substring(0, n);\n onLine(line);\n // the rest of the string ...\n s = s.substring(n + os.EOL.length);\n n = s.indexOf(os.EOL);\n }\n return s;\n }\n catch (err) {\n // streaming lines to console is best effort. Don't fail a build.\n this._debug(`error processing line. Failed with error ${err}`);\n return '';\n }\n }\n _getSpawnFileName() {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n return process.env['COMSPEC'] || 'cmd.exe';\n }\n }\n return this.toolPath;\n }\n _getSpawnArgs(options) {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n let argline = `/D /S /C \"${this._windowsQuoteCmdArg(this.toolPath)}`;\n for (const a of this.args) {\n argline += ' ';\n argline += options.windowsVerbatimArguments\n ? a\n : this._windowsQuoteCmdArg(a);\n }\n argline += '\"';\n return [argline];\n }\n }\n return this.args;\n }\n _endsWith(str, end) {\n return str.endsWith(end);\n }\n _isCmdFile() {\n const upperToolPath = this.toolPath.toUpperCase();\n return (this._endsWith(upperToolPath, '.CMD') ||\n this._endsWith(upperToolPath, '.BAT'));\n }\n _windowsQuoteCmdArg(arg) {\n // for .exe, apply the normal quoting rules that libuv applies\n if (!this._isCmdFile()) {\n return this._uvQuoteCmdArg(arg);\n }\n // otherwise apply quoting rules specific to the cmd.exe command line parser.\n // the libuv rules are generic and are not designed specifically for cmd.exe\n // command line parser.\n //\n // for a detailed description of the cmd.exe command line parser, refer to\n // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912\n // need quotes for empty arg\n if (!arg) {\n return '\"\"';\n }\n // determine whether the arg needs to be quoted\n const cmdSpecialChars = [\n ' ',\n '\\t',\n '&',\n '(',\n ')',\n '[',\n ']',\n '{',\n '}',\n '^',\n '=',\n ';',\n '!',\n \"'\",\n '+',\n ',',\n '`',\n '~',\n '|',\n '<',\n '>',\n '\"'\n ];\n let needsQuotes = false;\n for (const char of arg) {\n if (cmdSpecialChars.some(x => x === char)) {\n needsQuotes = true;\n break;\n }\n }\n // short-circuit if quotes not needed\n if (!needsQuotes) {\n return arg;\n }\n // the following quoting rules are very similar to the rules that by libuv applies.\n //\n // 1) wrap the string in quotes\n //\n // 2) double-up quotes - i.e. \" => \"\"\n //\n // this is different from the libuv quoting rules. libuv replaces \" with \\\", which unfortunately\n // doesn't work well with a cmd.exe command line.\n //\n // note, replacing \" with \"\" also works well if the arg is passed to a downstream .NET console app.\n // for example, the command line:\n // foo.exe \"myarg:\"\"my val\"\"\"\n // is parsed by a .NET console app into an arg array:\n // [ \"myarg:\\\"my val\\\"\" ]\n // which is the same end result when applying libuv quoting rules. although the actual\n // command line from libuv quoting rules would look like:\n // foo.exe \"myarg:\\\"my val\\\"\"\n //\n // 3) double-up slashes that precede a quote,\n // e.g. hello \\world => \"hello \\world\"\n // hello\\\"world => \"hello\\\\\"\"world\"\n // hello\\\\\"world => \"hello\\\\\\\\\"\"world\"\n // hello world\\ => \"hello world\\\\\"\n //\n // technically this is not required for a cmd.exe command line, or the batch argument parser.\n // the reasons for including this as a .cmd quoting rule are:\n //\n // a) this is optimized for the scenario where the argument is passed from the .cmd file to an\n // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.\n //\n // b) it's what we've been doing previously (by deferring to node default behavior) and we\n // haven't heard any complaints about that aspect.\n //\n // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be\n // escaped when used on the command line directly - even though within a .cmd file % can be escaped\n // by using %%.\n //\n // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts\n // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.\n //\n // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would\n // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the\n // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args\n // to an external program.\n //\n // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.\n // % can be escaped within a .cmd file.\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\'; // double the slash\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\"'; // double the quote\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _uvQuoteCmdArg(arg) {\n // Tool runner wraps child_process.spawn() and needs to apply the same quoting as\n // Node in certain cases where the undocumented spawn option windowsVerbatimArguments\n // is used.\n //\n // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,\n // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),\n // pasting copyright notice from Node within this function:\n //\n // Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to\n // deal in the Software without restriction, including without limitation the\n // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n // sell copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n //\n // The above copyright notice and this permission notice shall be included in\n // all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n // IN THE SOFTWARE.\n if (!arg) {\n // Need double quotation for empty argument\n return '\"\"';\n }\n if (!arg.includes(' ') && !arg.includes('\\t') && !arg.includes('\"')) {\n // No quotation needed\n return arg;\n }\n if (!arg.includes('\"') && !arg.includes('\\\\')) {\n // No embedded double quotes or backslashes, so I can just wrap\n // quote marks around the whole thing.\n return `\"${arg}\"`;\n }\n // Expected input/output:\n // input : hello\"world\n // output: \"hello\\\"world\"\n // input : hello\"\"world\n // output: \"hello\\\"\\\"world\"\n // input : hello\\world\n // output: hello\\world\n // input : hello\\\\world\n // output: hello\\\\world\n // input : hello\\\"world\n // output: \"hello\\\\\\\"world\"\n // input : hello\\\\\"world\n // output: \"hello\\\\\\\\\\\"world\"\n // input : hello world\\\n // output: \"hello world\\\\\" - note the comment in libuv actually reads \"hello world\\\"\n // but it appears the comment is wrong, it should be \"hello world\\\\\"\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\';\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\\\\';\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _cloneExecOptions(options) {\n options = options || {};\n const result = {\n cwd: options.cwd || process.cwd(),\n env: options.env || process.env,\n silent: options.silent || false,\n windowsVerbatimArguments: options.windowsVerbatimArguments || false,\n failOnStdErr: options.failOnStdErr || false,\n ignoreReturnCode: options.ignoreReturnCode || false,\n delay: options.delay || 10000\n };\n result.outStream = options.outStream || process.stdout;\n result.errStream = options.errStream || process.stderr;\n return result;\n }\n _getSpawnOptions(options, toolPath) {\n options = options || {};\n const result = {};\n result.cwd = options.cwd;\n result.env = options.env;\n result['windowsVerbatimArguments'] =\n options.windowsVerbatimArguments || this._isCmdFile();\n if (options.windowsVerbatimArguments) {\n result.argv0 = `\"${toolPath}\"`;\n }\n return result;\n }\n /**\n * Exec a tool.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param tool path to tool to exec\n * @param options optional exec options. See ExecOptions\n * @returns number\n */\n exec() {\n return __awaiter(this, void 0, void 0, function* () {\n // root the tool path if it is unrooted and contains relative pathing\n if (!ioUtil.isRooted(this.toolPath) &&\n (this.toolPath.includes('/') ||\n (IS_WINDOWS && this.toolPath.includes('\\\\')))) {\n // prefer options.cwd if it is specified, however options.cwd may also need to be rooted\n this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);\n }\n // if the tool is only a file name, then resolve it from the PATH\n // otherwise verify it exists (add extension on Windows if necessary)\n this.toolPath = yield io.which(this.toolPath, true);\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n this._debug(`exec tool: ${this.toolPath}`);\n this._debug('arguments:');\n for (const arg of this.args) {\n this._debug(` ${arg}`);\n }\n const optionsNonNull = this._cloneExecOptions(this.options);\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);\n }\n const state = new ExecState(optionsNonNull, this.toolPath);\n state.on('debug', (message) => {\n this._debug(message);\n });\n if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {\n return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));\n }\n const fileName = this._getSpawnFileName();\n const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));\n let stdbuffer = '';\n if (cp.stdout) {\n cp.stdout.on('data', (data) => {\n if (this.options.listeners && this.options.listeners.stdout) {\n this.options.listeners.stdout(data);\n }\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(data);\n }\n stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.stdline) {\n this.options.listeners.stdline(line);\n }\n });\n });\n }\n let errbuffer = '';\n if (cp.stderr) {\n cp.stderr.on('data', (data) => {\n state.processStderr = true;\n if (this.options.listeners && this.options.listeners.stderr) {\n this.options.listeners.stderr(data);\n }\n if (!optionsNonNull.silent &&\n optionsNonNull.errStream &&\n optionsNonNull.outStream) {\n const s = optionsNonNull.failOnStdErr\n ? optionsNonNull.errStream\n : optionsNonNull.outStream;\n s.write(data);\n }\n errbuffer = this._processLineBuffer(data, errbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.errline) {\n this.options.listeners.errline(line);\n }\n });\n });\n }\n cp.on('error', (err) => {\n state.processError = err.message;\n state.processExited = true;\n state.processClosed = true;\n state.CheckComplete();\n });\n cp.on('exit', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n cp.on('close', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n state.processClosed = true;\n this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n state.on('done', (error, exitCode) => {\n if (stdbuffer.length > 0) {\n this.emit('stdline', stdbuffer);\n }\n if (errbuffer.length > 0) {\n this.emit('errline', errbuffer);\n }\n cp.removeAllListeners();\n if (error) {\n reject(error);\n }\n else {\n resolve(exitCode);\n }\n });\n if (this.options.input) {\n if (!cp.stdin) {\n throw new Error('child process missing stdin');\n }\n cp.stdin.end(this.options.input);\n }\n }));\n });\n }\n}\n/**\n * Convert an arg string to an array of args. Handles escaping\n *\n * @param argString string of arguments\n * @returns string[] array of arguments\n */\nexport function argStringToArray(argString) {\n const args = [];\n let inQuotes = false;\n let escaped = false;\n let arg = '';\n function append(c) {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\';\n }\n arg += c;\n escaped = false;\n }\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i);\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes;\n }\n else {\n append(c);\n }\n continue;\n }\n if (c === '\\\\' && escaped) {\n append(c);\n continue;\n }\n if (c === '\\\\' && inQuotes) {\n escaped = true;\n continue;\n }\n if (c === ' ' && !inQuotes) {\n if (arg.length > 0) {\n args.push(arg);\n arg = '';\n }\n continue;\n }\n append(c);\n }\n if (arg.length > 0) {\n args.push(arg.trim());\n }\n return args;\n}\nclass ExecState extends events.EventEmitter {\n constructor(options, toolPath) {\n super();\n this.processClosed = false; // tracks whether the process has exited and stdio is closed\n this.processError = '';\n this.processExitCode = 0;\n this.processExited = false; // tracks whether the process has exited\n this.processStderr = false; // tracks whether stderr was written to\n this.delay = 10000; // 10 seconds\n this.done = false;\n this.timeout = null;\n if (!toolPath) {\n throw new Error('toolPath must not be empty');\n }\n this.options = options;\n this.toolPath = toolPath;\n if (options.delay) {\n this.delay = options.delay;\n }\n }\n CheckComplete() {\n if (this.done) {\n return;\n }\n if (this.processClosed) {\n this._setResult();\n }\n else if (this.processExited) {\n this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);\n }\n }\n _debug(message) {\n this.emit('debug', message);\n }\n _setResult() {\n // determine whether there is an error\n let error;\n if (this.processExited) {\n if (this.processError) {\n error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);\n }\n else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {\n error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);\n }\n else if (this.processStderr && this.options.failOnStdErr) {\n error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);\n }\n }\n // clear the timeout\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.done = true;\n this.emit('done', error, this.processExitCode);\n }\n static HandleTimeout(state) {\n if (state.done) {\n return;\n }\n if (!state.processClosed && state.processExited) {\n const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;\n state._debug(message);\n }\n state._setResult();\n }\n}\n//# sourceMappingURL=toolrunner.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { StringDecoder } from 'string_decoder';\nimport * as tr from './toolrunner.js';\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nexport function exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\n/**\n * Exec a command and get the output.\n * Output will be streamed to the live console.\n * Returns promise with the exit code and collected stdout and stderr\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code, stdout, and stderr\n */\nexport function getExecOutput(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let stdout = '';\n let stderr = '';\n //Using string decoder covers the case where a mult-byte character is split\n const stdoutDecoder = new StringDecoder('utf8');\n const stderrDecoder = new StringDecoder('utf8');\n const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;\n const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;\n const stdErrListener = (data) => {\n stderr += stderrDecoder.write(data);\n if (originalStdErrListener) {\n originalStdErrListener(data);\n }\n };\n const stdOutListener = (data) => {\n stdout += stdoutDecoder.write(data);\n if (originalStdoutListener) {\n originalStdoutListener(data);\n }\n };\n const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });\n const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));\n //flush any remaining characters\n stdout += stdoutDecoder.end();\n stderr += stderrDecoder.end();\n return {\n exitCode,\n stdout,\n stderr\n };\n });\n}\n//# sourceMappingURL=exec.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport os from 'os';\nimport * as exec from '@actions/exec';\nconst getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout: version } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Version\"', undefined, {\n silent: true\n });\n const { stdout: name } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Caption\"', undefined, {\n silent: true\n });\n return {\n name: name.trim(),\n version: version.trim()\n };\n});\nconst getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d;\n const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {\n silent: true\n });\n const version = (_b = (_a = stdout.match(/ProductVersion:\\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';\n const name = (_d = (_c = stdout.match(/ProductName:\\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';\n return {\n name,\n version\n };\n});\nconst getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {\n silent: true\n });\n const [name, version] = stdout.trim().split('\\n');\n return {\n name,\n version\n };\n});\nexport const platform = os.platform();\nexport const arch = os.arch();\nexport const isWindows = platform === 'win32';\nexport const isMacOS = platform === 'darwin';\nexport const isLinux = platform === 'linux';\nexport function getDetails() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign(Object.assign({}, (yield (isWindows\n ? getWindowsInfo()\n : isMacOS\n ? getMacOsInfo()\n : getLinuxInfo()))), { platform,\n arch,\n isWindows,\n isMacOS,\n isLinux });\n });\n}\n//# sourceMappingURL=platform.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { issue, issueCommand } from './command.js';\nimport { issueFileCommand, prepareKeyValueMessage } from './file-command.js';\nimport { toCommandProperties, toCommandValue } from './utils.js';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { OidcClient } from './oidc-utils.js';\n/**\n * The code to exit an action\n */\nexport var ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode || (ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function exportVariable(name, val) {\n const convertedVal = toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return issueFileCommand('ENV', prepareKeyValueMessage(name, val));\n }\n issueCommand('set-env', { name }, convertedVal);\n}\n/**\n * Registers a secret which will get masked from logs\n *\n * @param secret - Value of the secret to be masked\n * @remarks\n * This function instructs the Actions runner to mask the specified value in any\n * logs produced during the workflow run. Once registered, the secret value will\n * be replaced with asterisks (***) whenever it appears in console output, logs,\n * or error messages.\n *\n * This is useful for protecting sensitive information such as:\n * - API keys\n * - Access tokens\n * - Authentication credentials\n * - URL parameters containing signatures (SAS tokens)\n *\n * Note that masking only affects future logs; any previous appearances of the\n * secret in logs before calling this function will remain unmasked.\n *\n * @example\n * ```typescript\n * // Register an API token as a secret\n * const apiToken = \"abc123xyz456\";\n * setSecret(apiToken);\n *\n * // Now any logs containing this value will show *** instead\n * console.log(`Using token: ${apiToken}`); // Outputs: \"Using token: ***\"\n * ```\n */\nexport function setSecret(secret) {\n issueCommand('add-mask', {}, secret);\n}\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nexport function addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n issueFileCommand('PATH', inputPath);\n }\n else {\n issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nexport function getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nexport function getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nexport function getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n issueCommand('set-output', { name }, toCommandValue(value));\n}\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nexport function setCommandEcho(enabled) {\n issue('echo', enabled ? 'on' : 'off');\n}\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nexport function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nexport function isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nexport function debug(message) {\n issueCommand('debug', {}, message);\n}\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function error(message, properties = {}) {\n issueCommand('error', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function warning(message, properties = {}) {\n issueCommand('warning', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function notice(message, properties = {}) {\n issueCommand('notice', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nexport function info(message) {\n process.stdout.write(message + os.EOL);\n}\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nexport function startGroup(name) {\n issue('group', name);\n}\n/**\n * End an output group.\n */\nexport function endGroup() {\n issue('endgroup');\n}\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nexport function group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return issueFileCommand('STATE', prepareKeyValueMessage(name, value));\n }\n issueCommand('save-state', { name }, toCommandValue(value));\n}\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nexport function getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexport function getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield OidcClient.getIDToken(aud);\n });\n}\n/**\n * Summary exports\n */\nexport { summary } from './summary.js';\n/**\n * @deprecated use core.summary\n */\nexport { markdownSummary } from './summary.js';\n/**\n * Path exports\n */\nexport { toPosixPath, toWin32Path, toPlatformPath } from './path-utils.js';\n/**\n * Platform utilities exports\n */\nexport * as platform from './platform.js';\n//# sourceMappingURL=core.js.map","class UploadUrlPool {\n /** Map from key (bucket ID or file ID) to a stack of available entries. */\n pools = /* @__PURE__ */ new Map();\n /**\n * Take an upload URL from the pool, or return null if none are available.\n *\n * @param key - The bucket ID or file ID to look up.\n *\n * @returns An upload URL entry, or null if the pool is empty for the given key.\n */\n checkout(key) {\n const pool = this.pools.get(key);\n if (!pool || pool.length === 0) return null;\n return pool.pop() ?? null;\n }\n /**\n * Return a still-valid upload URL to the pool for future reuse.\n *\n * @param key - The bucket ID or file ID the entry belongs to.\n * @param entry - The upload URL entry to return to the pool.\n */\n checkin(key, entry) {\n let pool = this.pools.get(key);\n if (!pool) {\n pool = [];\n this.pools.set(key, pool);\n }\n pool.push(entry);\n }\n /**\n * Remove a specific upload URL from the pool (e.g. after an upload error).\n *\n * @param key - The bucket ID or file ID the entry belongs to.\n * @param entry - The failed upload URL entry to remove.\n */\n evict(key, entry) {\n const pool = this.pools.get(key);\n if (!pool) return;\n const idx = pool.findIndex((e) => e.uploadUrl === entry.uploadUrl);\n if (idx !== -1) {\n pool.splice(idx, 1);\n }\n }\n /** Remove all entries from every key in the pool. */\n clear() {\n this.pools.clear();\n }\n}\nexport {\n UploadUrlPool\n};\n//# sourceMappingURL=upload-url-pool.js.map\n","import { UploadUrlPool } from \"./upload-url-pool.js\";\nclass InMemoryAccountInfo {\n /** Cached authorization response, or null before authorize() is called. */\n auth = null;\n /** Pool of reusable small-file upload URLs, keyed by bucket ID. */\n uploadUrls = new UploadUrlPool();\n /** Pool of reusable large-file part upload URLs, keyed by file ID. */\n partUploadUrls = new UploadUrlPool();\n /**\n * Store a fresh authorization response, replacing any previous state.\n *\n * @param auth - The authorize account response to store.\n */\n setAuth(auth) {\n this.auth = auth;\n this.uploadUrls.clear();\n this.partUploadUrls.clear();\n }\n /**\n * Return the current authorization response, or null if not authorized.\n *\n * @returns The cached authorization response, or null if not yet authorized.\n */\n getAuth() {\n return this.auth;\n }\n /** Discard all cached authorization state and upload URLs. */\n clear() {\n this.auth = null;\n this.uploadUrls.clear();\n this.partUploadUrls.clear();\n }\n /**\n * Base URL for B2 API calls.\n *\n * @returns The base URL for B2 API calls.\n *\n * @throws Error if not yet authorized.\n */\n getApiUrl() {\n return this.requireAuth().apiInfo.storageApi.apiUrl;\n }\n /**\n * Base URL for file downloads.\n *\n * @returns The base URL for file downloads.\n *\n * @throws Error if not yet authorized.\n */\n getDownloadUrl() {\n return this.requireAuth().apiInfo.storageApi.downloadUrl;\n }\n /**\n * Current authorization token.\n *\n * @returns The current authorization token.\n *\n * @throws Error if not yet authorized.\n */\n getAuthToken() {\n return this.requireAuth().authorizationToken;\n }\n /**\n * The authorized account ID.\n *\n * @returns The authorized account identifier.\n *\n * @throws Error if not yet authorized.\n */\n getAccountId() {\n return this.requireAuth().accountId;\n }\n /**\n * Server-recommended part size for large file uploads, in bytes.\n *\n * @returns The server-recommended part size in bytes.\n *\n * @throws Error if not yet authorized.\n */\n getRecommendedPartSize() {\n return this.requireAuth().apiInfo.storageApi.recommendedPartSize;\n }\n /**\n * Smallest allowed part size for large file uploads, in bytes.\n *\n * @returns The smallest allowed part size in bytes.\n *\n * @throws Error if not yet authorized.\n */\n getAbsoluteMinimumPartSize() {\n return this.requireAuth().apiInfo.storageApi.absoluteMinimumPartSize;\n }\n /**\n * Base URL for the S3-compatible API.\n *\n * @returns The base URL for the S3-compatible API.\n *\n * @throws Error if not yet authorized.\n */\n getS3ApiUrl() {\n return this.requireAuth().apiInfo.storageApi.s3ApiUrl;\n }\n /**\n * Bucket ID the key is restricted to, or null if unrestricted.\n *\n * @returns The restricted bucket identifier, or null if the key is unrestricted.\n *\n * @throws Error if not yet authorized.\n */\n getAllowedBucketId() {\n return this.requireAuth().apiInfo.storageApi.allowed.bucketId ?? null;\n }\n /**\n * Take an upload URL from the pool for the given bucket, or null if none available.\n *\n * @param bucketId - The bucket to check out an upload URL for.\n *\n * @returns A reusable upload URL entry, or null if none are available.\n */\n checkoutUploadUrl(bucketId) {\n return this.uploadUrls.checkout(bucketId);\n }\n /**\n * Return a still-valid upload URL to the pool for reuse.\n *\n * @param bucketId - The bucket the upload URL belongs to.\n * @param entry - The upload URL entry to return to the pool.\n */\n returnUploadUrl(bucketId, entry) {\n this.uploadUrls.checkin(bucketId, entry);\n }\n /**\n * Remove an upload URL from the pool after an upload error.\n *\n * @param bucketId - The bucket the failed upload URL belongs to.\n * @param entry - The upload URL entry to remove from the pool.\n */\n evictUploadUrl(bucketId, entry) {\n this.uploadUrls.evict(bucketId, entry);\n }\n /**\n * Take a large-file part upload URL from the pool, or null if none available.\n *\n * @param fileId - The large file to check out a part upload URL for.\n *\n * @returns A reusable part upload URL entry, or null if none are available.\n */\n checkoutPartUploadUrl(fileId) {\n return this.partUploadUrls.checkout(fileId);\n }\n /**\n * Return a still-valid part upload URL to the pool for reuse.\n *\n * @param fileId - The large file the part upload URL belongs to.\n * @param entry - The part upload URL entry to return to the pool.\n */\n returnPartUploadUrl(fileId, entry) {\n this.partUploadUrls.checkin(fileId, entry);\n }\n /**\n * Remove a part upload URL from the pool after an error.\n *\n * @param fileId - The large file the failed part upload URL belongs to.\n * @param entry - The part upload URL entry to remove from the pool.\n */\n evictPartUploadUrl(fileId, entry) {\n this.partUploadUrls.evict(fileId, entry);\n }\n /**\n * Retrieve the cached auth response or throw if not yet authorized.\n *\n * @returns The cached authorization response.\n *\n * @throws Error if authorize() has not been called.\n */\n requireAuth() {\n if (!this.auth) throw new Error(\"Not authorized. Call authorize() first.\");\n return this.auth;\n }\n}\nexport {\n InMemoryAccountInfo\n};\n//# sourceMappingURL=in-memory.js.map\n","const REALM_URLS = {\n production: \"https://api.backblazeb2.com\",\n staging: \"https://api.backblazeb2.com\"\n};\nfunction getRealmUrl(realm) {\n return REALM_URLS[realm] ?? realm;\n}\nexport {\n REALM_URLS,\n getRealmUrl\n};\n//# sourceMappingURL=realms.js.map\n","function accountId(raw) {\n return raw;\n}\nfunction bucketId(raw) {\n return raw;\n}\nfunction fileId(raw) {\n return raw;\n}\nfunction keyId(raw) {\n return raw;\n}\nfunction applicationKeyId(raw) {\n return raw;\n}\nfunction largeFileId(raw) {\n return raw;\n}\nexport {\n accountId,\n applicationKeyId,\n bucketId,\n fileId,\n keyId,\n largeFileId\n};\n//# sourceMappingURL=ids.js.map\n","async function bestEffort(fn) {\n try {\n await fn();\n } catch {\n }\n}\nexport {\n bestEffort\n};\n//# sourceMappingURL=best-effort.js.map\n","import { bestEffort } from \"../util/best-effort.js\";\nasync function cancelLargeFileBestEffort(raw, accountInfo, fileId) {\n await bestEffort(\n () => raw.cancelLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId })\n );\n}\nexport {\n cancelLargeFileBestEffort\n};\n//# sourceMappingURL=cancel.js.map\n","class Semaphore {\n /**\n * @param limit - Maximum number of concurrent acquisitions. Must be a\n * positive integer; values `<= 0` would create a semaphore that\n * never lets anything through (all `acquire()` calls would queue\n * forever), so the constructor throws fast instead.\n *\n * @throws `RangeError` when `limit` is not a positive integer.\n */\n constructor(limit) {\n this.limit = limit;\n if (!Number.isInteger(limit) || limit <= 0) {\n throw new RangeError(\n `Semaphore limit must be a positive integer; received ${limit}. A non-positive limit produces a deadlocked semaphore — fail fast at construction instead.`\n );\n }\n }\n current = 0;\n queue = [];\n /**\n * Acquires a slot, waiting if the limit has been reached.\n * @returns A promise that resolves when a slot is available.\n */\n async acquire() {\n if (this.current < this.limit) {\n this.current++;\n return;\n }\n return new Promise((resolve) => {\n this.queue.push(resolve);\n });\n }\n /** Releases a slot, unblocking the next queued caller if any. */\n release() {\n const next = this.queue.shift();\n if (next) {\n next();\n } else {\n this.current--;\n }\n }\n /**\n * Number of slots currently available.\n *\n * @returns The count of free concurrency slots.\n */\n get available() {\n return this.limit - this.current;\n }\n}\nexport {\n Semaphore\n};\n//# sourceMappingURL=concurrency.js.map\n","const DEFAULT_TRANSFER_CONCURRENCY = 4;\nconst DEFAULT_BULK_CONCURRENCY = 10;\nconst DEFAULT_PAGE_SIZE = 1e3;\nconst DEFAULT_CONTENT_TYPE = \"b2/x-auto\";\nexport {\n DEFAULT_BULK_CONCURRENCY,\n DEFAULT_CONTENT_TYPE,\n DEFAULT_PAGE_SIZE,\n DEFAULT_TRANSFER_CONCURRENCY\n};\n//# sourceMappingURL=defaults.js.map\n","function planRanges(totalSize, chunkSize) {\n const plans = [];\n let offset = 0;\n let index = 0;\n while (offset < totalSize) {\n const length = Math.min(chunkSize, totalSize - offset);\n const end = offset + length - 1;\n plans.push({\n partNumber: index + 1,\n index,\n offset,\n length,\n start: offset,\n end\n });\n offset += length;\n index++;\n }\n return plans;\n}\nfunction byteRangeHeader(start, end) {\n return `bytes=${start}-${end}`;\n}\nexport {\n byteRangeHeader,\n planRanges\n};\n//# sourceMappingURL=plan-ranges.js.map\n","import { fileId } from \"../types/ids.js\";\nimport { cancelLargeFileBestEffort } from \"../upload/cancel.js\";\nimport { Semaphore } from \"../upload/concurrency.js\";\nimport { DEFAULT_CONTENT_TYPE, DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { byteRangeHeader, planRanges } from \"../util/plan-ranges.js\";\nasync function copyLargeFile(raw, accountInfo, options) {\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const sourceInfo = await raw.getFileInfo(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: options.sourceFileId\n });\n const totalSize = sourceInfo.contentLength;\n if (totalSize <= partSize) {\n return raw.copyFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n sourceFileId: options.sourceFileId,\n fileName: options.fileName,\n ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : {},\n ...options.contentType !== void 0 ? { contentType: options.contentType } : {},\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}\n });\n }\n const destBucketId = options.destinationBucketId ?? sourceInfo.bucketId;\n const startResp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: destBucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? sourceInfo.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo: options.fileInfo ?? {},\n ...options.destinationServerSideEncryption !== void 0 ? { serverSideEncryption: options.destinationServerSideEncryption } : {}\n });\n const largeFileId = startResp.fileId;\n const ranges = planRanges(totalSize, partSize);\n const partSha1s = new Array(ranges.length);\n const sem = new Semaphore(concurrency);\n try {\n options.signal?.throwIfAborted();\n await Promise.all(\n ranges.map(async (range) => {\n await sem.acquire();\n try {\n options.signal?.throwIfAborted();\n const resp = await raw.copyPart(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n sourceFileId: options.sourceFileId,\n // `startLargeFile` returns `LargeFileId`; `copyPart` takes the\n // same value typed as `FileId`. Re-brand via the factory.\n largeFileId: fileId(largeFileId),\n partNumber: range.partNumber,\n range: byteRangeHeader(range.start, range.end),\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}\n });\n partSha1s[range.partNumber - 1] = resp.contentSha1;\n } finally {\n sem.release();\n }\n })\n );\n options.signal?.throwIfAborted();\n return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n}\nexport {\n copyLargeFile\n};\n//# sourceMappingURL=large.js.map\n","const utf8Encoder = new TextEncoder();\nconst utf8Decoder = new TextDecoder();\nexport {\n utf8Decoder,\n utf8Encoder\n};\n//# sourceMappingURL=text-codec.js.map\n","import { utf8Encoder } from \"../util/text-codec.js\";\nconst SAFE_CHARS = new Set(\n \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@/\".split(\"\")\n);\nfunction encodeFileName(name) {\n const encoded = [];\n for (const char of name) {\n if (SAFE_CHARS.has(char)) {\n encoded.push(char);\n } else {\n const bytes = utf8Encoder.encode(char);\n for (const byte of bytes) {\n encoded.push(`%${byte.toString(16).toUpperCase().padStart(2, \"0\")}`);\n }\n }\n }\n return encoded.join(\"\");\n}\nfunction decodeFileName(encoded) {\n return decodeURIComponent(encoded);\n}\nfunction buildFileInfoHeaders(fileInfo) {\n if (!fileInfo) return {};\n const headers = {};\n for (const [key, value] of Object.entries(fileInfo)) {\n headers[`X-Bz-Info-${encodeFileName(key)}`] = encodeFileName(value);\n }\n return headers;\n}\nfunction parseFileInfoHeaders(headers) {\n const info = {};\n headers.forEach((value, key) => {\n const lower = key.toLowerCase();\n if (lower.startsWith(\"x-bz-info-\")) {\n const infoKey = decodeFileName(lower.slice(\"x-bz-info-\".length));\n info[infoKey] = decodeFileName(value);\n }\n });\n return info;\n}\nexport {\n buildFileInfoHeaders,\n decodeFileName,\n encodeFileName,\n parseFileInfoHeaders\n};\n//# sourceMappingURL=encoding.js.map\n","class ProgressTracker {\n /**\n * Creates a new ProgressTracker.\n * @param listener - Callback to receive progress events, or undefined to disable.\n * @param totalBytes - Expected total bytes, or null if unknown.\n * @param totalParts - Expected total parts, or null if not a multipart transfer.\n */\n constructor(listener, totalBytes, totalParts) {\n this.listener = listener;\n this.totalBytes = totalBytes;\n this.totalParts = totalParts;\n this.startTime = Date.now();\n }\n /** Running total of bytes transferred. */\n bytesTransferred = 0;\n /** Running count of completed parts. */\n partsCompleted = 0;\n /** Timestamp when tracking began. */\n startTime;\n /**\n * Record that additional bytes have been transferred and notify the listener.\n * @param count - The number of additional bytes that were transferred.\n */\n addBytes(count) {\n this.bytesTransferred += count;\n this.emit();\n }\n /** Record that a multipart part has completed and notify the listener. */\n completePart() {\n this.partsCompleted++;\n this.emit();\n }\n /** Emit the current progress snapshot to the listener, if one is registered. */\n emit() {\n this.listener?.({\n bytesTransferred: this.bytesTransferred,\n totalBytes: this.totalBytes,\n partsCompleted: this.partsCompleted,\n totalParts: this.totalParts,\n elapsedMs: Date.now() - this.startTime\n });\n }\n}\nexport {\n ProgressTracker\n};\n//# sourceMappingURL=progress.js.map\n","function normalizeSha1(raw) {\n if (raw === null || raw === void 0 || raw === \"none\") return null;\n return raw;\n}\nfunction normalizeFileVersionSha1(fv) {\n return fv.contentSha1 === \"none\" ? { ...fv, contentSha1: null } : fv;\n}\nfunction normalizeFileVersionListSha1(resp) {\n return { ...resp, files: resp.files.map(normalizeFileVersionSha1) };\n}\nexport {\n normalizeFileVersionListSha1,\n normalizeFileVersionSha1,\n normalizeSha1\n};\n//# sourceMappingURL=normalize.js.map\n","import { parseFileInfoHeaders } from \"../raw/encoding.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { fileId } from \"../types/ids.js\";\nimport { bestEffort } from \"../util/best-effort.js\";\nimport { normalizeSha1 } from \"../util/normalize.js\";\nasync function downloadById(raw, accountInfo, options) {\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.fileId,\n toRawDownloadOptions(options)\n );\n const headers = extractDownloadHeaders(resp.headers);\n return {\n headers,\n // HEAD requests legitimately have no body; return an empty stream so the\n // result shape stays consistent.\n body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress)\n };\n}\nasync function downloadByName(raw, accountInfo, options) {\n const resp = await raw.downloadFileByName(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.bucketName,\n options.fileName,\n toRawDownloadOptions(options)\n );\n const headers = extractDownloadHeaders(resp.headers);\n return {\n headers,\n body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress)\n };\n}\nasync function headById(raw, accountInfo, options) {\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.fileId,\n { ...toRawDownloadOptions(options), method: \"HEAD\" }\n );\n if (resp.body !== null) {\n const body = resp.body;\n await bestEffort(() => body.cancel());\n }\n return { headers: extractDownloadHeaders(resp.headers) };\n}\nasync function headByName(raw, accountInfo, options) {\n const resp = await raw.downloadFileByName(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.bucketName,\n options.fileName,\n { ...toRawDownloadOptions(options), method: \"HEAD\" }\n );\n if (resp.body !== null) {\n const body = resp.body;\n await bestEffort(() => body.cancel());\n }\n return { headers: extractDownloadHeaders(resp.headers) };\n}\nfunction toRawDownloadOptions(options) {\n return {\n ...options.method !== void 0 ? { method: options.method } : {},\n ...options.range !== void 0 ? { range: options.range } : {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.b2ContentDisposition !== void 0 ? { b2ContentDisposition: options.b2ContentDisposition } : {},\n ...options.b2ContentLanguage !== void 0 ? { b2ContentLanguage: options.b2ContentLanguage } : {},\n ...options.b2ContentEncoding !== void 0 ? { b2ContentEncoding: options.b2ContentEncoding } : {},\n ...options.b2ContentType !== void 0 ? { b2ContentType: options.b2ContentType } : {},\n ...options.b2CacheControl !== void 0 ? { b2CacheControl: options.b2CacheControl } : {},\n ...options.b2Expires !== void 0 ? { b2Expires: options.b2Expires } : {},\n ...options.signal !== void 0 ? { signal: options.signal } : {}\n };\n}\nfunction emptyStream() {\n return new ReadableStream({\n start(controller) {\n controller.close();\n }\n });\n}\nfunction instrumentProgress(body, totalBytes, listener) {\n if (listener === void 0) return body;\n const tracker = new ProgressTracker(listener, totalBytes, 1);\n const transform = new TransformStream({\n transform(chunk, controller) {\n tracker.addBytes(chunk.byteLength);\n controller.enqueue(chunk);\n },\n flush() {\n tracker.completePart();\n }\n });\n return body.pipeThrough(transform);\n}\nfunction extractDownloadHeaders(headers) {\n const fileInfo = parseFileInfoHeaders(headers);\n return {\n contentType: headers.get(\"Content-Type\") ?? \"application/octet-stream\",\n contentLength: Number.parseInt(headers.get(\"Content-Length\") ?? \"0\", 10),\n // B2 sends the literal `'none'` for multipart-finished files; collapse\n // to `null` so the typed `string | null` actually means \"no SHA-1\".\n contentSha1: normalizeSha1(headers.get(\"X-Bz-Content-Sha1\")),\n fileId: fileId(headers.get(\"X-Bz-File-Id\") ?? \"\"),\n fileName: decodeURIComponent(headers.get(\"X-Bz-File-Name\") ?? \"\"),\n fileInfo,\n uploadTimestamp: Number.parseInt(headers.get(\"X-Bz-Upload-Timestamp\") ?? \"0\", 10)\n };\n}\nexport {\n downloadById,\n downloadByName,\n headById,\n headByName\n};\n//# sourceMappingURL=single.js.map\n","const DEFAULT_RETRY_OPTIONS = {\n maxRetries: 5,\n maxRetryDelayMs: 64e3,\n initialRetryDelayMs: 1e3\n};\nfunction computeBackoff(attempt, options, retryAfter) {\n if (retryAfter !== void 0 && retryAfter > 0) {\n return Math.min(retryAfter * 1e3, options.maxRetryDelayMs);\n }\n const base = options.initialRetryDelayMs * 2 ** attempt;\n const jitter = Math.random() * base * 0.5;\n return Math.min(base + jitter, options.maxRetryDelayMs);\n}\nfunction sleep(ms, signal) {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) {\n reject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n return;\n }\n const timer = setTimeout(resolve, ms);\n signal?.addEventListener(\n \"abort\",\n () => {\n clearTimeout(timer);\n reject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n },\n { once: true }\n );\n });\n}\nexport {\n DEFAULT_RETRY_OPTIONS,\n computeBackoff,\n sleep\n};\n//# sourceMappingURL=retry.js.map\n","async function collectStream(stream) {\n const reader = stream.getReader();\n try {\n const chunks = [];\n let total = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n total += value.byteLength;\n }\n const result = new Uint8Array(total);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return result;\n } finally {\n reader.releaseLock();\n }\n}\nexport {\n collectStream\n};\n//# sourceMappingURL=collect.js.map\n","import { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep } from \"../http/retry.js\";\nimport { collectStream } from \"../streams/collect.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { planRanges, byteRangeHeader } from \"../util/plan-ranges.js\";\nfunction createParallelDownloadStream(raw, accountInfo, options) {\n const rangeSize = options.rangeSize ?? 10 * 1024 * 1024;\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const totalSize = options.totalSize;\n const retryOptions = {\n ...DEFAULT_RETRY_OPTIONS,\n ...options.maxRetries !== void 0 ? { maxRetries: options.maxRetries } : {}\n };\n const abort = options.signal;\n const ranges = planRanges(totalSize, rangeSize);\n const windowSize = concurrency * 2;\n const inflight = /* @__PURE__ */ new Map();\n const buffer = /* @__PURE__ */ new Map();\n let nextToSchedule = 0;\n let nextToEmit = 0;\n let firstError = null;\n function scheduleNext() {\n while (firstError === null && // Honour abort here so a completed range that triggers a top-up\n // doesn't queue one final fetch after the caller aborted. Without\n // this gate, one extra range request fires post-abort before the\n // `pull()` loop notices.\n abort?.aborted !== true && nextToSchedule < ranges.length && inflight.size + buffer.size < windowSize) {\n const range = ranges[nextToSchedule];\n if (range === void 0) break;\n const idx = nextToSchedule;\n nextToSchedule++;\n const task = (async () => {\n try {\n const data = await fetchRangeWithRetry(\n raw,\n accountInfo,\n options.fileId,\n range.start,\n range.end,\n retryOptions,\n abort\n );\n buffer.set(idx, data);\n } catch (err) {\n if (firstError === null) firstError = err;\n } finally {\n inflight.delete(idx);\n }\n })();\n inflight.set(idx, task);\n }\n }\n return new ReadableStream({\n start(controller) {\n try {\n abort?.throwIfAborted();\n scheduleNext();\n } catch (err) {\n controller.error(err);\n }\n },\n async pull(controller) {\n try {\n while (!buffer.has(nextToEmit)) {\n abort?.throwIfAborted();\n if (firstError !== null) throw firstError;\n if (inflight.size === 0) {\n controller.close();\n return;\n }\n await Promise.race(inflight.values());\n }\n const data = buffer.get(nextToEmit);\n if (data !== void 0) {\n buffer.delete(nextToEmit);\n nextToEmit++;\n controller.enqueue(data);\n }\n scheduleNext();\n if (nextToEmit >= ranges.length && buffer.size === 0 && inflight.size === 0 && firstError === null) {\n controller.close();\n }\n } catch (err) {\n controller.error(err);\n }\n },\n cancel() {\n buffer.clear();\n }\n });\n}\nasync function fetchRangeWithRetry(raw, accountInfo, fileId, start, end, retryOptions, signal) {\n let lastError;\n for (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {\n if (attempt > 0) {\n const delay = computeBackoff(attempt - 1, retryOptions);\n await sleep(delay, signal);\n }\n try {\n signal?.throwIfAborted();\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n fileId,\n {\n range: byteRangeHeader(start, end),\n ...signal !== void 0 ? { signal } : {}\n }\n );\n if (!resp.body) throw new Error(\"Download chunk has no body\");\n return await collectStream(resp.body);\n } catch (err) {\n lastError = err;\n if (signal?.aborted) throw err;\n if (err instanceof DOMException && err.name === \"AbortError\") throw err;\n }\n }\n throw lastError instanceof Error ? lastError : new Error(\"Range download failed after retries\");\n}\nexport {\n createParallelDownloadStream\n};\n//# sourceMappingURL=parallel.js.map\n","let nodeCreateHash;\nasync function getNodeCreateHash() {\n if (nodeCreateHash !== void 0) return nodeCreateHash;\n try {\n const crypto2 = await import(\"node:crypto\");\n if (typeof crypto2.createHash !== \"function\") throw new Error(\"createHash unavailable\");\n nodeCreateHash = (algo) => {\n const h = crypto2.createHash(algo);\n return {\n update(data) {\n h.update(data);\n },\n digest(encoding) {\n return h.digest(encoding);\n }\n };\n };\n } catch {\n nodeCreateHash = null;\n }\n return nodeCreateHash;\n}\nclass IncrementalSha1 {\n /** Buffered chunks for WebCrypto fallback path. */\n chunks = [];\n /** Total bytes fed into the hash so far. */\n totalLength = 0;\n /** Node.js hash instance, or null if using WebCrypto fallback. */\n nodeHash = null;\n /** Resolves once the crypto backend has been loaded. */\n initPromise;\n /** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */\n constructor() {\n this.initPromise = getNodeCreateHash().then((factory) => {\n if (factory) this.nodeHash = factory(\"sha1\");\n });\n }\n /**\n * Feed data into the hash. Async because it lazily initializes the crypto backend.\n * @param data - The bytes to include in the hash computation.\n *\n * @returns A promise that resolves once the data has been consumed.\n */\n async update(data) {\n await this.initPromise;\n if (this.nodeHash) {\n this.nodeHash.update(data);\n } else {\n this.chunks.push(new Uint8Array(data));\n }\n this.totalLength += data.byteLength;\n }\n /**\n * Finalize the hash and return the hex-encoded SHA-1 digest.\n * @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.\n */\n async digest() {\n await this.initPromise;\n if (this.nodeHash) {\n return this.nodeHash.digest(\"hex\");\n }\n const combined = new Uint8Array(this.totalLength);\n let offset = 0;\n for (const chunk of this.chunks) {\n combined.set(chunk, offset);\n offset += chunk.byteLength;\n }\n const hashBuffer = await crypto.subtle.digest(\"SHA-1\", combined.buffer);\n return hexEncode(new Uint8Array(hashBuffer));\n }\n /**\n * Total number of bytes fed into the hash so far.\n *\n * @returns The cumulative byte count across all update calls.\n */\n get bytesProcessed() {\n return this.totalLength;\n }\n}\nfunction hexEncode(bytes) {\n const hex = [];\n for (const b of bytes) {\n hex.push(b.toString(16).padStart(2, \"0\"));\n }\n return hex.join(\"\");\n}\nasync function sha1Hex(data) {\n const factory = await getNodeCreateHash();\n if (factory) {\n const h = factory(\"sha1\");\n h.update(data);\n return h.digest(\"hex\");\n }\n const hashBuffer = await crypto.subtle.digest(\"SHA-1\", data.buffer);\n return hexEncode(new Uint8Array(hashBuffer));\n}\nexport {\n IncrementalSha1,\n sha1Hex\n};\n//# sourceMappingURL=hash.js.map\n","import { largeFileId } from \"../types/ids.js\";\nasync function findResumeCandidate(raw, accountInfo, bucketId, fileName) {\n const unfinished = await raw.listUnfinishedLargeFiles(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { bucketId }\n );\n const match = unfinished.files.find((f) => f.fileName === fileName);\n if (!match) return null;\n const fileId = largeFileId(match.fileId);\n const uploadedPartSha1s = await collectPartSha1s(raw, accountInfo, fileId);\n return { fileId, uploadedPartSha1s };\n}\nasync function collectPartSha1s(raw, accountInfo, fileId) {\n const sha1s = /* @__PURE__ */ new Map();\n let startPartNumber;\n while (true) {\n const page = await raw.listParts(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId,\n ...startPartNumber !== void 0 ? { startPartNumber } : {}\n });\n for (const part of page.parts) {\n sha1s.set(part.partNumber, part.contentSha1);\n }\n if (page.nextPartNumber === null) break;\n startPartNumber = page.nextPartNumber;\n }\n return sha1s;\n}\nexport {\n collectPartSha1s,\n findResumeCandidate\n};\n//# sourceMappingURL=resume.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY, DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nimport { planRanges } from \"../util/plan-ranges.js\";\nimport { cancelLargeFileBestEffort } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nimport { collectPartSha1s, findResumeCandidate } from \"./resume.js\";\nasync function uploadLargeFile(raw, accountInfo, options) {\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const totalSize = options.source.size;\n const parts = planRanges(totalSize, partSize);\n const fileInfo = { ...options.fileInfo };\n const startLargeFileRequest = {\n bucketId: options.bucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {}\n };\n let largeFileId;\n let preUploaded;\n if (options.resumeFileId !== void 0) {\n largeFileId = options.resumeFileId;\n preUploaded = await collectPartSha1s(raw, accountInfo, largeFileId);\n } else if (options.resume === true) {\n const candidate = await findResumeCandidate(\n raw,\n accountInfo,\n options.bucketId,\n options.fileName\n );\n if (candidate) {\n largeFileId = candidate.fileId;\n preUploaded = candidate.uploadedPartSha1s;\n } else {\n const startResp = await raw.startLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n startLargeFileRequest\n );\n largeFileId = startResp.fileId;\n preUploaded = /* @__PURE__ */ new Map();\n }\n } else {\n const startResp = await raw.startLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n startLargeFileRequest\n );\n largeFileId = startResp.fileId;\n preUploaded = /* @__PURE__ */ new Map();\n }\n const partSha1s = new Array(parts.length);\n const tracker = new ProgressTracker(options.onProgress, totalSize, parts.length);\n const sem = new Semaphore(concurrency);\n if (!options.source.canSlice) {\n if (options.resume === true || options.resumeFileId !== void 0) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw new Error(\n \"uploadLargeFile: resume is not supported on non-sliceable sources (e.g. StreamSource).\"\n );\n }\n try {\n await uploadPartsSequentially(\n raw,\n accountInfo,\n options,\n largeFileId,\n parts,\n partSha1s,\n tracker\n );\n return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n }\n try {\n const tasks = parts.map(async (part) => {\n await sem.acquire();\n try {\n options.signal?.throwIfAborted();\n const partSource = options.source.slice(part.offset, part.offset + part.length);\n const data = new Uint8Array(await partSource.toArrayBuffer());\n const partSha1 = new IncrementalSha1();\n await partSha1.update(data);\n const sha1Hex = await partSha1.digest();\n const serverSha1 = preUploaded.get(part.partNumber);\n if (serverSha1 !== void 0 && serverSha1 === sha1Hex) {\n partSha1s[part.partNumber - 1] = serverSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n return;\n }\n let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId }\n );\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result2 = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber: part.partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(largeFileId, uploadEntry);\n partSha1s[part.partNumber - 1] = result2.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(largeFileId, uploadEntry);\n throw err;\n }\n } finally {\n sem.release();\n }\n });\n await Promise.all(tasks);\n const result = await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n return result;\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n}\nasync function uploadPartsSequentially(raw, accountInfo, options, largeFileId, parts, partSha1s, tracker) {\n const reader = options.source.stream().getReader();\n let partNumber = 1;\n let carry = null;\n try {\n for (const planned of parts) {\n options.signal?.throwIfAborted();\n const buf = new Uint8Array(planned.length);\n let filled = 0;\n if (carry !== null) {\n const take = Math.min(carry.byteLength, buf.byteLength - filled);\n buf.set(carry.subarray(0, take), filled);\n filled += take;\n carry = take < carry.byteLength ? carry.subarray(take) : null;\n }\n while (filled < buf.byteLength) {\n const { done, value } = await reader.read();\n if (done) break;\n const take = Math.min(value.byteLength, buf.byteLength - filled);\n buf.set(value.subarray(0, take), filled);\n filled += take;\n if (take < value.byteLength) {\n carry = value.subarray(take);\n }\n }\n const data = filled === buf.byteLength ? buf : buf.subarray(0, filled);\n if (data.byteLength === 0) {\n throw new Error(\n `uploadLargeFile: source stream ended before part ${partNumber}; advertised size does not match emitted bytes.`\n );\n }\n const partSha1 = new IncrementalSha1();\n await partSha1.update(data);\n const sha1Hex = await partSha1.digest();\n let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId }\n );\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber: planned.partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(largeFileId, uploadEntry);\n partSha1s[planned.partNumber - 1] = result.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(largeFileId, uploadEntry);\n throw err;\n }\n partNumber++;\n }\n } finally {\n reader.releaseLock();\n }\n}\nexport {\n uploadLargeFile\n};\n//# sourceMappingURL=large.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nasync function uploadSmallFile(raw, accountInfo, options) {\n let uploadEntry = accountInfo.checkoutUploadUrl(options.bucketId);\n if (!uploadEntry) {\n const resp = await raw.getUploadUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: options.bucketId\n });\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n const data = new Uint8Array(await options.source.toArrayBuffer());\n const sha1 = new IncrementalSha1();\n await sha1.update(data);\n const sha1Hex = await sha1.digest();\n const tracker = new ProgressTracker(options.onProgress, data.byteLength, 1);\n try {\n const result = await raw.uploadFile(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {},\n ...options.lastModifiedMillis !== void 0 ? { lastModifiedMillis: options.lastModifiedMillis } : {}\n },\n data,\n options.signal\n );\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n accountInfo.returnUploadUrl(options.bucketId, uploadEntry);\n return result;\n } catch (err) {\n accountInfo.evictUploadUrl(options.bucketId, uploadEntry);\n throw err;\n }\n}\nexport {\n uploadSmallFile\n};\n//# sourceMappingURL=single.js.map\n","function toError(value) {\n return value instanceof Error ? value : new Error(String(value));\n}\nexport {\n toError\n};\n//# sourceMappingURL=to-error.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY, DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nimport { toError } from \"../util/to-error.js\";\nimport { cancelLargeFileBestEffort } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nfunction createWriteStream(raw, accountInfo, options) {\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const tracker = new ProgressTracker(options.onProgress, null, null);\n const sem = new Semaphore(concurrency);\n let largeFileId = null;\n let startPromise = null;\n let nextPartNumber = 1;\n let pendingBytes = 0;\n const pending = [];\n const partSha1s = [];\n const inflight = [];\n let errored = null;\n const {\n promise: done,\n resolve: resolveDone,\n reject: rejectDone\n } = Promise.withResolvers();\n done.catch(() => {\n });\n function ensureStarted() {\n if (largeFileId !== null) return Promise.resolve(largeFileId);\n if (startPromise !== null) return startPromise;\n startPromise = (async () => {\n const resp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: options.bucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo: options.fileInfo ?? {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n });\n largeFileId = resp.fileId;\n return largeFileId;\n })();\n return startPromise;\n }\n async function shipPart(data, partNumber) {\n const fileId = await ensureStarted();\n const sha1 = new IncrementalSha1();\n await sha1.update(data);\n const sha1Hex = await sha1.digest();\n let uploadEntry = accountInfo.checkoutPartUploadUrl(fileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId\n });\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(fileId, uploadEntry);\n partSha1s[partNumber - 1] = result.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(fileId, uploadEntry);\n throw err;\n }\n }\n function dispatchPart() {\n if (pending.length === 0) return;\n let data;\n if (pending.length === 1) {\n const head = pending[0];\n if (!head) return;\n data = head;\n } else {\n const total = pending.reduce((sum, chunk) => sum + chunk.byteLength, 0);\n data = new Uint8Array(total);\n let offset = 0;\n for (const chunk of pending) {\n data.set(chunk, offset);\n offset += chunk.byteLength;\n }\n }\n pending.length = 0;\n pendingBytes = 0;\n const partNumber = nextPartNumber++;\n const task = (async () => {\n await sem.acquire();\n try {\n await shipPart(data, partNumber);\n } catch (err) {\n errored = toError(err);\n throw err;\n } finally {\n sem.release();\n }\n })();\n inflight.push(task);\n task.catch(() => {\n });\n }\n const writable = new WritableStream({\n async write(chunk) {\n if (errored) throw errored;\n options.signal?.throwIfAborted();\n pending.push(chunk);\n pendingBytes += chunk.byteLength;\n while (pendingBytes >= partSize) {\n const carved = carveExact(pending, partSize);\n const partNumber = nextPartNumber++;\n pendingBytes -= partSize;\n const task = (async () => {\n await sem.acquire();\n try {\n await shipPart(carved, partNumber);\n } catch (err) {\n errored = toError(err);\n throw err;\n } finally {\n sem.release();\n }\n })();\n inflight.push(task);\n task.catch(() => {\n });\n }\n },\n async close() {\n try {\n if (errored) throw errored;\n options.signal?.throwIfAborted();\n if (pendingBytes > 0) {\n dispatchPart();\n }\n await Promise.all(inflight);\n if (errored) throw errored;\n if (largeFileId === null) {\n throw new Error(\"createWriteStream closed without any data written.\");\n }\n const result = await raw.finishLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId, partSha1Array: partSha1s }\n );\n resolveDone(result);\n } catch (err) {\n const fileIdToCancel = largeFileId;\n if (fileIdToCancel !== null) {\n await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel);\n }\n rejectDone(err);\n throw err;\n }\n },\n async abort(reason) {\n const fileIdToCancel = largeFileId;\n if (fileIdToCancel !== null) {\n await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel);\n }\n rejectDone(toError(reason));\n }\n });\n return { writable, done };\n}\nfunction carveExact(chunks, size) {\n const out = new Uint8Array(size);\n let written = 0;\n while (written < size && chunks.length > 0) {\n const head = chunks[0];\n if (!head) break;\n const need = size - written;\n if (head.byteLength <= need) {\n out.set(head, written);\n written += head.byteLength;\n chunks.shift();\n } else {\n out.set(head.subarray(0, need), written);\n chunks[0] = head.subarray(need);\n written += need;\n }\n }\n return out;\n}\nexport {\n createWriteStream\n};\n//# sourceMappingURL=stream.js.map\n","import { createParallelDownloadStream } from \"./download/parallel.js\";\nimport { downloadByName, headByName, downloadById, headById } from \"./download/single.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { createWriteStream } from \"./upload/stream.js\";\nclass B2Object {\n /** The file name (path) within the bucket. */\n fileName;\n client;\n bucket;\n /**\n * @param client - The parent B2Client instance.\n * @param bucket - The parent Bucket this object belongs to.\n * @param fileName - The file path within the bucket.\n *\n * @internal\n */\n constructor(client, bucket, fileName) {\n this.client = client;\n this.bucket = bucket;\n this.fileName = fileName;\n }\n /**\n * Uploads data to this file name. Automatically uses multipart upload for large files.\n * @param options - Upload configuration including data source and optional settings.\n *\n * @returns Metadata for the uploaded file version.\n */\n async upload(options) {\n const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n const isLarge = options.source.size > recommendedPartSize;\n if (isLarge) {\n return uploadLargeFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...options\n });\n }\n const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options;\n return uploadSmallFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...smallOptions\n });\n }\n /**\n * Downloads this file by name. Pass `method: 'HEAD'` to fetch only the\n * response headers (file metadata) without streaming the body.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result with response headers and body stream.\n */\n async download(options) {\n return downloadByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.bucket.name,\n fileName: this.fileName,\n ...options\n });\n }\n /**\n * Fetches response headers for this file via HTTP HEAD. Returns a\n * body-less result so callers never have to drain the (logically\n * empty) HEAD body themselves.\n *\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal. Same shape as {@link B2Object.download}'s\n * options minus `method` (always HEAD) and `onProgress` (no body).\n *\n * @returns Parsed download headers (content type, SHA-1, file info, etc.).\n */\n async head(options) {\n return headByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.bucket.name,\n fileName: this.fileName,\n ...options\n });\n }\n /**\n * Downloads a specific version of this file by ID. Pass `method: 'HEAD'`\n * to fetch only the response headers (file metadata) without streaming the body.\n * @param fileId - The file version ID to download.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result with response headers and body stream.\n */\n async downloadById(fileId, options) {\n return downloadById(this.client.raw, this.client.accountInfo, {\n fileId,\n ...options\n });\n }\n /**\n * Fetches response headers for a specific version of this file by ID\n * via HTTP HEAD. Returns a body-less result so callers never have to\n * drain the (logically empty) HEAD body themselves.\n *\n * @param fileId - The file version ID to inspect.\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal.\n *\n * @returns Parsed download headers.\n */\n async headById(fileId, options) {\n return headById(this.client.raw, this.client.accountInfo, {\n fileId,\n ...options\n });\n }\n /**\n * Creates a parallel-download ReadableStream that fetches the file in concurrent ranged chunks.\n * @param fileId - The file version ID to download.\n * @param totalSize - Total file size in bytes (needed to compute range boundaries).\n * @param options - Concurrency, range size, and abort signal.\n *\n * @returns A Web ReadableStream of file data in sequential order.\n */\n createReadStream(fileId, totalSize, options) {\n return createParallelDownloadStream(this.client.raw, this.client.accountInfo, {\n fileId,\n totalSize,\n ...options\n });\n }\n /**\n * Creates a Web `WritableStream` that uploads streamed data into this file\n * using the multipart protocol. Pipe a `ReadableStream` into the\n * returned `writable` and await `done` to get the final {@link FileVersion}.\n *\n * Note: streaming uploads do not support resume because the size and per-part\n * hashes are not known in advance. Use {@link upload} with a buffered source\n * when resume is required.\n *\n * @param options - Streaming upload parameters (part size, concurrency, encryption).\n *\n * @returns A handle with the writable sink and a completion promise.\n */\n createWriteStream(options) {\n return createWriteStream(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...options ?? {}\n });\n }\n /**\n * Retrieves metadata for a specific file version.\n * @param fileId - The file version ID to look up.\n *\n * @returns The file version metadata.\n */\n async getFileInfo(fileId) {\n return this.client.raw.getFileInfo(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileId }\n );\n }\n /**\n * Hides this file by creating a hide marker at this file name.\n *\n * @returns Metadata for the newly created hide marker.\n */\n async hide() {\n return this.bucket.hideFile(this.fileName);\n }\n /**\n * Permanently deletes a specific version of this file.\n * @param fileId - The unique identifier of the file version to delete.\n */\n async deleteVersion(fileId) {\n await this.bucket.deleteFileVersion(this.fileName, fileId);\n }\n /**\n * Sets or updates the Object Lock retention policy on a specific file\n * version of this file.\n *\n * The bucket must have Object Lock enabled (`fileLockEnabled: true` at\n * creation time). Governance-mode retention can be shortened or removed\n * by passing `bypassGovernance: true` together with an application key\n * that carries the `bypassGovernance` capability; compliance-mode\n * retention cannot be shortened by anyone until the\n * `retainUntilTimestamp` elapses.\n *\n * @param fileId - The file version to apply the policy to.\n * @param retention - The retention policy to apply.\n * @param options - Optional flag for shortening governance-mode retention.\n *\n * @returns Metadata for the updated file version.\n */\n async setRetention(fileId, retention, options) {\n return this.bucket.updateFileRetention(this.fileName, fileId, retention, options);\n }\n /**\n * Toggles the legal hold flag on a specific file version of this file.\n *\n * Legal hold is independent of retention: a file can be on legal hold\n * without any retention policy, and vice versa. The bucket must have\n * Object Lock enabled, and any caller must hold the `writeFileLegalHolds`\n * capability.\n *\n * @param fileId - The file version to apply the flag to.\n * @param legalHold - `'on'` to apply the hold, `'off'` to remove it.\n *\n * @returns Metadata for the updated file version.\n */\n async setLegalHold(fileId, legalHold) {\n return this.bucket.updateFileLegalHold(this.fileName, fileId, legalHold);\n }\n}\nexport {\n B2Object\n};\n//# sourceMappingURL=object.js.map\n","async function* paginatePages(fetcher, signal) {\n let cursor;\n while (true) {\n signal?.throwIfAborted();\n const { page, nextCursor } = await fetcher(cursor);\n yield page;\n if (nextCursor === void 0) return;\n cursor = nextCursor;\n }\n}\nasync function* paginateItems(fetcher, extractItems, signal) {\n for await (const page of paginatePages(fetcher, signal)) {\n yield* extractItems(page);\n }\n}\nexport {\n paginateItems,\n paginatePages\n};\n//# sourceMappingURL=paginator.js.map\n","import { copyLargeFile } from \"./copy/large.js\";\nimport { downloadByName, headByName } from \"./download/single.js\";\nimport { B2Object } from \"./object.js\";\nimport { accountId } from \"./types/ids.js\";\nimport { Semaphore } from \"./upload/concurrency.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { DEFAULT_PAGE_SIZE, DEFAULT_BULK_CONCURRENCY } from \"./util/defaults.js\";\nimport { paginateItems } from \"./util/paginator.js\";\nimport { toError } from \"./util/to-error.js\";\nclass Bucket {\n /** Unique identifier for this bucket. */\n id;\n /** Human-readable bucket name. */\n name;\n /** Full bucket metadata as returned by the B2 API. */\n info;\n client;\n /**\n * @param client - The parent B2Client instance.\n * @param info - The bucket metadata from the API.\n *\n * @internal\n */\n constructor(client, info) {\n this.client = client;\n this.info = info;\n this.id = info.bucketId;\n this.name = info.bucketName;\n }\n /**\n * Returns a {@link B2Object} handle for a specific file name in this bucket.\n * @param fileName - The file path within the bucket.\n *\n * @returns A B2Object handle bound to this bucket and file name.\n */\n file(fileName) {\n return new B2Object(this.client, this, fileName);\n }\n /**\n * Uploads a file to this bucket. Automatically uses multipart upload for files\n * larger than the recommended part size.\n * @param options - Upload configuration including file name, source data, and optional settings.\n *\n * @returns Metadata for the uploaded file version.\n */\n async upload(options) {\n const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n const isLarge = options.source.size > recommendedPartSize;\n if (isLarge) {\n return uploadLargeFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.id,\n ...options\n });\n }\n const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options;\n return uploadSmallFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.id,\n ...smallOptions\n });\n }\n /**\n * Downloads a file from this bucket by name. Pass `method: 'HEAD'` in\n * `options` to fetch only the response headers (file metadata) without\n * streaming the body.\n * @param fileName - The file name (path) to download.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result containing response headers and a readable body stream.\n */\n async download(fileName, options) {\n return downloadByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.name,\n fileName,\n ...options\n });\n }\n /**\n * Fetches the response headers (file metadata) for a file via HTTP\n * HEAD. Returns a body-less result so callers never have to drain\n * the (logically empty) HEAD body themselves.\n *\n * Use this for metadata-only checks like \"does this file exist\", \"what\n * is its current SHA-1\", \"what is its Content-Length\". For full file\n * retrieval use {@link Bucket.download}.\n *\n * @param fileName - The file name (path) to inspect.\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal. Same shape as {@link Bucket.download}'s\n * options minus `method` (always HEAD) and `onProgress` (no body).\n *\n * @returns Parsed download headers (content type, SHA-1, file info, etc.).\n *\n * @example\n * ```ts\n * const { headers } = await bucket.head('photos/2026/sunset.jpg')\n * console.log(headers.contentLength, headers.contentSha1)\n * ```\n */\n async head(fileName, options) {\n return headByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.name,\n fileName,\n ...options\n });\n }\n /**\n * Lists file names in this bucket (most recent versions only).\n * @param options - Optional filtering and pagination settings.\n *\n * @returns A page of file versions with an optional continuation token.\n */\n async listFileNames(options) {\n return this.client.raw.listFileNames(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n }\n );\n }\n /**\n * Lists all file versions in this bucket, including hidden files.\n * @param options - Optional filtering and pagination settings.\n *\n * @returns A page of file versions with an optional continuation token.\n */\n async listFileVersions(options) {\n return this.client.raw.listFileVersions(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n }\n );\n }\n /**\n * Async iterator that yields the latest visible version of every file in\n * the bucket, automatically handling pagination via `listFileNames`.\n *\n * Hidden files (those whose latest version is a hide marker) are NOT\n * yielded by this iterator. Use {@link paginateFileVersions} when you\n * need full version history.\n *\n * @param options - Filter + pagination + abort options. `pageSize` is\n * forwarded to `b2_list_file_names`'s `maxFileCount` (default 1000,\n * B2-capped at 10000).\n *\n * @returns An async iterable of {@link FileVersion} entries.\n *\n * @example\n * ```ts\n * for await (const file of bucket.paginateFileNames({ prefix: 'photos/' })) {\n * console.log(file.fileName, file.contentLength)\n * }\n * ```\n */\n paginateFileNames(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listFileNames({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startFileName: cursor } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n });\n return { page: resp, nextCursor: resp.nextFileName ?? void 0 };\n },\n // Real B2 surfaces hide markers as rows in `b2_list_file_names`. This\n // iterator's documented contract is \"latest VISIBLE version\", so we\n // drop hide-action rows here. Callers who need full history should\n // use `paginateFileVersions`.\n (page) => page.files.filter((f) => f.action !== \"hide\"),\n options?.signal\n );\n }\n /**\n * Async iterator that yields every version of every file in the bucket,\n * including hidden files and historical versions, automatically handling\n * pagination via `listFileVersions`.\n *\n * The two-cursor `(nextFileName, nextFileId)` continuation that the raw\n * endpoint exposes is threaded internally; callers iterate flat.\n *\n * @param options - Filter + pagination + abort options.\n *\n * @returns An async iterable of {@link FileVersion} entries.\n */\n paginateFileVersions(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listFileVersions({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startFileName: cursor.fileName } : {},\n ...cursor?.fileId !== void 0 ? { startFileId: cursor.fileId } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n });\n const nextCursor = resp.nextFileName !== null ? { fileName: resp.nextFileName, fileId: resp.nextFileId ?? void 0 } : void 0;\n return { page: resp, nextCursor };\n },\n (page) => page.files,\n options?.signal\n );\n }\n /**\n * Async iterator that yields every unfinished large file in the bucket,\n * automatically handling pagination via `listUnfinishedLargeFiles`.\n *\n * Useful for janitorial scripts that want to inspect or cancel abandoned\n * multipart uploads (typically followed by {@link cancelLargeFile} on\n * the underlying raw client).\n *\n * @param options - Filter + pagination + abort options. `pageSize` is\n * B2-capped at 100 for this endpoint.\n *\n * @returns An async iterable of unfinished-large-file metadata entries.\n */\n paginateUnfinishedLargeFiles(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listUnfinishedLargeFiles({\n pageSize: options?.pageSize ?? 100,\n ...cursor !== void 0 ? { startFileId: cursor } : {},\n ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {}\n });\n return { page: resp, nextCursor: resp.nextFileId ?? void 0 };\n },\n (page) => page.files,\n options?.signal\n );\n }\n /**\n * Async iterator that yields every uploaded part for a specific large\n * file, automatically handling pagination via `listParts`.\n *\n * @param largeFileId - The unfinished large file to enumerate parts of.\n * @param options - Pagination + abort options. `pageSize` is B2-capped\n * at 1000 for this endpoint; the default is 1000.\n *\n * @returns An async iterable of {@link PartInfo} entries.\n */\n paginateParts(largeFileId, options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.client.raw.listParts(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileId: largeFileId,\n maxPartCount: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startPartNumber: cursor } : {}\n }\n );\n return { page: resp, nextCursor: resp.nextPartNumber ?? void 0 };\n },\n (page) => page.parts,\n options?.signal\n );\n }\n /**\n * Looks up the latest visible version of a file by name.\n * Uses `listFileNames` under the hood; returns `null` when the file does not\n * exist or its latest version is a hide marker.\n * @param fileName - The exact file path to look up.\n *\n * @returns The latest {@link FileVersion}, or `null` if not found.\n */\n async getFileInfoByName(fileName) {\n const resp = await this.listFileNames({ prefix: fileName, pageSize: 1 });\n const match = resp.files.find((f) => f.fileName === fileName);\n if (!match || match.action === \"hide\") return null;\n return match;\n }\n /**\n * Removes the latest hide marker for a file, restoring visibility of the\n * previous upload. Returns the deleted hide marker, or `null` if there was\n * no hide marker to remove (file is already visible or does not exist).\n * @param fileName - The file path to unhide.\n *\n * @returns The deleted hide marker version, or `null` if nothing was hidden.\n */\n async unhideFile(fileName) {\n const resp = await this.listFileVersions({ prefix: fileName, pageSize: 100 });\n const versions = resp.files.filter((f) => f.fileName === fileName);\n if (versions.length === 0) return null;\n const latest = versions[0];\n if (!latest || latest.action !== \"hide\") return null;\n await this.deleteFileVersion(fileName, latest.fileId);\n return latest;\n }\n /**\n * Hides a file by creating a hide marker. The file remains in version history but is no longer visible in `listFileNames`.\n * @param fileName - The file path to hide.\n *\n * @returns Metadata for the newly created hide marker.\n */\n async hideFile(fileName) {\n return this.client.raw.hideFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, fileName }\n );\n }\n /**\n * Permanently deletes a specific file version. Both file name and file ID are required.\n *\n * If the file is under Object Lock retention, B2 will reject the\n * delete: compliance-mode files cannot be deleted until the retention\n * expires; governance-mode files require `bypassGovernance: true`\n * AND a calling key with the `bypassGovernance` capability. Files on\n * legal hold cannot be deleted by anyone until the hold is removed.\n *\n * @param fileName - The file path of the version to delete.\n * @param fileId - The unique identifier of the file version to delete.\n * @param options - Optional flag for bypassing governance retention.\n */\n async deleteFileVersion(fileName, fileId, options) {\n await this.client.raw.deleteFileVersion(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileName,\n fileId,\n ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n }\n );\n }\n /**\n * Cancels an in-progress large file upload so the partial parts are not\n * retained or billed. The most common reason to call this is to clean up\n * abandoned multipart uploads surfaced by {@link listUnfinishedLargeFiles}.\n * @param fileId - The unique identifier of the unfinished large file to cancel.\n *\n * @returns Metadata about the cancelled large file.\n */\n async cancelLargeFile(fileId) {\n return this.client.raw.cancelLargeFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileId }\n );\n }\n /**\n * Lists large files in this bucket that were started but never finished or\n * cancelled. Wraps `b2_list_unfinished_large_files`.\n * @param options - Optional pagination filters.\n *\n * @returns The page of unfinished large files plus a continuation token.\n */\n async listUnfinishedLargeFiles(options) {\n return this.client.raw.listUnfinishedLargeFiles(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},\n ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}\n }\n );\n }\n /**\n * Deletes many file versions with bounded concurrency. Errors from individual\n * deletes are collected and returned rather than thrown, so partial success\n * does not abort the run.\n *\n * When `options.signal` is supplied and aborted, in-flight deletes\n * complete (they're already on the wire), but no new deletes start\n * after the abort fires. Subsequent targets are short-circuited to an\n * error entry so the result tally reflects what actually happened.\n * @param targets - File versions to delete.\n * @param options - Optional concurrency override and abort signal.\n * Concurrency defaults to the SDK-wide bulk-metadata setting\n * (currently 10, higher than transfer concurrency because each\n * task is a single tiny API round-trip).\n *\n * @returns A summary of successes and per-target errors.\n */\n async deleteMany(targets, options) {\n const concurrency = options?.concurrency ?? DEFAULT_BULK_CONCURRENCY;\n const sem = new Semaphore(concurrency);\n const signal = options?.signal;\n let deleted = 0;\n const errors = [];\n await Promise.all(\n targets.map(async (target) => {\n await sem.acquire();\n try {\n if (signal?.aborted) {\n errors.push({\n target,\n error: toError(signal.reason ?? \"aborted\")\n });\n return;\n }\n await this.deleteFileVersion(target.fileName, target.fileId);\n deleted++;\n } catch (err) {\n errors.push({\n target,\n error: toError(err)\n });\n } finally {\n sem.release();\n }\n })\n );\n return { deleted, errors };\n }\n /**\n * Async generator that streams every file version in the bucket (optionally\n * filtered by prefix) and deletes each one. Yields a {@link DeleteAllEvent}\n * per file version. With `dryRun: true`, no deletes are performed but `skip`\n * events are still emitted.\n * @param options - Optional prefix filter, page size, and dry-run flag.\n *\n * @returns An async generator of per-file events.\n */\n async *deleteAll(options) {\n const dryRun = options?.dryRun ?? false;\n const pageSize = options?.pageSize ?? DEFAULT_PAGE_SIZE;\n let startFileName;\n let startFileId;\n while (true) {\n const page = await this.listFileVersions({\n pageSize,\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...startFileName !== void 0 ? { startFileName } : {},\n ...startFileId !== void 0 ? { startFileId } : {}\n });\n for (const version of page.files) {\n if (dryRun) {\n yield { type: \"skip\", fileName: version.fileName, fileId: version.fileId };\n continue;\n }\n try {\n await this.deleteFileVersion(version.fileName, version.fileId);\n yield { type: \"delete\", fileName: version.fileName, fileId: version.fileId };\n } catch (err) {\n yield {\n type: \"error\",\n fileName: version.fileName,\n fileId: version.fileId,\n message: toError(err).message\n };\n }\n }\n if (!page.nextFileName) break;\n startFileName = page.nextFileName;\n startFileId = page.nextFileId ?? void 0;\n }\n }\n /**\n * Creates a server-side copy of a file within or across buckets.\n * @param options - Copy configuration including source file ID and destination name.\n *\n * @returns Metadata for the newly created file version.\n */\n async copyFile(options) {\n return this.client.raw.copyFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n options\n );\n }\n /**\n * Copies a file via the server-side multipart protocol. Each part is copied\n * by reference through `b2_copy_part`; data never traverses the client. Falls\n * back to a single `copyFile` call when the source fits within a single part.\n * @param options - Copy parameters including source file ID, destination name, part size, and concurrency.\n *\n * @returns Metadata for the newly created destination file version.\n */\n async copyLargeFile(options) {\n return copyLargeFile(this.client.raw, this.client.accountInfo, {\n sourceFileId: options.sourceFileId,\n fileName: options.fileName,\n ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : { destinationBucketId: this.id },\n ...options.contentType !== void 0 ? { contentType: options.contentType } : {},\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n ...options.partSize !== void 0 ? { partSize: options.partSize } : {},\n ...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {},\n ...options.signal !== void 0 ? { signal: options.signal } : {}\n });\n }\n /**\n * Updates bucket settings such as type, CORS, lifecycle rules, and encryption.\n * @param options - Fields to update. Omitted fields are left unchanged.\n *\n * @returns Updated bucket metadata.\n */\n async update(options) {\n return this.client.raw.updateBucket(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n accountId: accountId(this.client.accountInfo.getAccountId()),\n bucketId: this.id,\n ...options\n }\n );\n }\n /**\n * Permanently deletes this bucket. The bucket must be empty (no file versions).\n *\n * @returns The deleted bucket metadata.\n */\n async delete() {\n return this.client.deleteBucket(this.id);\n }\n /**\n * Gets a download authorization token scoped to a file name prefix in this bucket.\n * @param fileNamePrefix - Only authorize downloads of files starting with this prefix.\n * @param validDurationInSeconds - How long the authorization is valid (1-604800 seconds).\n *\n * @returns The download authorization response containing a time-limited token.\n */\n async getDownloadAuthorization(fileNamePrefix, validDurationInSeconds) {\n return this.client.raw.getDownloadAuthorization(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, fileNamePrefix, validDurationInSeconds }\n );\n }\n /**\n * Gets the event notification rules configured for this bucket.\n *\n * @returns The current notification rules for this bucket.\n */\n async getNotificationRules() {\n return this.client.raw.getBucketNotificationRules(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id }\n );\n }\n /**\n * Replaces the event notification rules for this bucket.\n * @param rules - The new set of notification rules to apply.\n *\n * @returns The updated notification rules for this bucket.\n */\n async setNotificationRules(rules) {\n return this.client.raw.setBucketNotificationRules(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, eventNotificationRules: rules }\n );\n }\n /**\n * Updates the file retention policy for a specific file version. Requires file lock on the bucket.\n * @param fileName - The file path of the version to update.\n * @param fileId - The unique identifier of the file version.\n * @param retention - The new retention policy to apply.\n * @param options - Optional flags. Set `bypassGovernance: true` to shorten governance-mode retention.\n *\n * @returns The updated file retention metadata.\n */\n async updateFileRetention(fileName, fileId, retention, options) {\n return this.client.raw.updateFileRetention(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileName,\n fileId,\n fileRetention: retention,\n ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n }\n );\n }\n /**\n * Updates the legal hold status for a specific file version. Requires file lock on the bucket.\n * @param fileName - The file path of the version to update.\n * @param fileId - The unique identifier of the file version.\n * @param legalHold - The new legal hold status to apply.\n *\n * @returns The updated legal hold metadata.\n */\n async updateFileLegalHold(fileName, fileId, legalHold) {\n return this.client.raw.updateFileLegalHold(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileName, fileId, legalHold }\n );\n }\n /**\n * Refetches this bucket's metadata from B2 so callers operating on\n * replication / lifecycle / retention configuration always start from the\n * server-of-record state.\n *\n * Bucket configuration is monotonically revisioned by B2: B2 increments\n * `revision` on every accepted update. The local {@link info} snapshot\n * captured at construction time goes stale as soon as anyone else (or any\n * prior `update()` call) mutates the bucket, so the ergonomic\n * add/remove helpers below always refresh before composing the next\n * `setX()` call. The result is that each helper is safe to call without\n * the caller having to thread BucketInfo through their code.\n *\n * @returns Fresh {@link BucketInfo} for this bucket.\n *\n * @throws If the bucket no longer exists.\n */\n async refresh() {\n const fresh = await this.client.listBuckets({ bucketId: this.id });\n const found = fresh[0];\n if (!found) throw new Error(`Bucket ${this.id} not found`);\n return found.info;\n }\n /**\n * Returns the current cross-region replication configuration, refetched\n * from B2.\n *\n * Use this when you need to read replication state without composing a\n * write. For add/remove flows the helper methods below handle the\n * refresh-then-set sequence for you.\n *\n * @returns The current {@link ReplicationConfiguration}.\n */\n async getReplication() {\n const fresh = await this.refresh();\n return fresh.replicationConfiguration;\n }\n /**\n * Replaces this bucket's complete replication configuration.\n * @param replication - The new configuration. Pass an empty source/destination\n * pair (`{ asReplicationSource: null, asReplicationDestination: null }`)\n * to clear replication entirely.\n *\n * @returns The updated bucket metadata.\n */\n async setReplication(replication) {\n return this.update({ replicationConfiguration: replication });\n }\n /**\n * Adds (or replaces by `replicationRuleName`) a single replication rule\n * on this bucket while leaving any other rules, the source key, and the\n * destination key mapping untouched.\n *\n * When this is the very first source-side rule, `sourceApplicationKeyId`\n * must be supplied to seed `asReplicationSource.sourceApplicationKeyId`;\n * for subsequent calls the existing source key is reused unless the\n * caller explicitly overrides it.\n *\n * @param rule - The replication rule to add or replace.\n * @param options - Optional source application key ID override (or seed\n * when no source side exists yet).\n *\n * @returns The updated bucket metadata.\n *\n * @throws If no source-side replication exists yet and the caller did\n * not supply `sourceApplicationKeyId`.\n */\n async addReplicationRule(rule, options) {\n const current = (await this.refresh()).replicationConfiguration;\n const existingSource = current.asReplicationSource;\n const sourceKey = options?.sourceApplicationKeyId ?? existingSource?.sourceApplicationKeyId;\n if (!sourceKey) {\n throw new Error(\n \"addReplicationRule: no existing source-side replication; pass options.sourceApplicationKeyId\"\n );\n }\n const existingRules = existingSource?.replicationRules ?? [];\n const without = existingRules.filter((r) => r.replicationRuleName !== rule.replicationRuleName);\n return this.setReplication({\n asReplicationSource: {\n sourceApplicationKeyId: sourceKey,\n replicationRules: [...without, rule]\n },\n asReplicationDestination: current.asReplicationDestination\n });\n }\n /**\n * Removes a single replication rule by name. No-ops cleanly when the rule\n * is not present (returns the unchanged-but-revision-bumped bucket info).\n *\n * @param replicationRuleName - Name of the rule to remove.\n *\n * @returns The updated bucket metadata.\n */\n async removeReplicationRule(replicationRuleName) {\n const current = (await this.refresh()).replicationConfiguration;\n const existingSource = current.asReplicationSource;\n if (!existingSource) {\n return this.setReplication(current);\n }\n const filtered = existingSource.replicationRules.filter(\n (r) => r.replicationRuleName !== replicationRuleName\n );\n return this.setReplication({\n asReplicationSource: {\n sourceApplicationKeyId: existingSource.sourceApplicationKeyId,\n replicationRules: filtered\n },\n asReplicationDestination: current.asReplicationDestination\n });\n }\n /**\n * Returns the current lifecycle rules for this bucket, refetched from B2.\n *\n * @returns The current array of {@link LifecycleRule}s.\n */\n async getLifecycleRules() {\n const fresh = await this.refresh();\n return fresh.lifecycleRules;\n }\n /**\n * Replaces this bucket's lifecycle rules in their entirety.\n * @param rules - The new rule set. Pass `[]` to remove all lifecycle\n * automation.\n *\n * @returns The updated bucket metadata.\n */\n async setLifecycleRules(rules) {\n return this.update({ lifecycleRules: [...rules] });\n }\n /**\n * Adds (or replaces, matched by `fileNamePrefix`) a single lifecycle rule\n * while leaving any other rules untouched.\n *\n * Matching on prefix mirrors B2's own data model: each unique prefix can\n * have at most one rule, and a `b2_update_bucket` call that contains two\n * rules with the same prefix is rejected. The helper enforces this for\n * the caller.\n *\n * @param rule - The lifecycle rule to add or replace.\n *\n * @returns The updated bucket metadata.\n */\n async addLifecycleRule(rule) {\n const current = await this.getLifecycleRules();\n const without = current.filter((r) => r.fileNamePrefix !== rule.fileNamePrefix);\n return this.setLifecycleRules([...without, rule]);\n }\n /**\n * Removes a single lifecycle rule by prefix. No-ops cleanly when the rule\n * is not present.\n *\n * @param fileNamePrefix - The prefix of the rule to remove.\n *\n * @returns The updated bucket metadata.\n */\n async removeLifecycleRule(fileNamePrefix) {\n const current = await this.getLifecycleRules();\n return this.setLifecycleRules(current.filter((r) => r.fileNamePrefix !== fileNamePrefix));\n }\n /**\n * Returns the current default Object Lock retention policy for new\n * uploads to this bucket, refetched from B2.\n *\n * @returns The default {@link BucketRetentionPolicy} (which may be\n * `{ mode: 'none', period: null }` when Object Lock is enabled on the\n * bucket but no default is set).\n */\n async getDefaultRetention() {\n const fresh = await this.refresh();\n return fresh.defaultRetention;\n }\n /**\n * Sets (or clears, by passing `{ mode: 'none', period: null }`) the\n * default Object Lock retention policy applied to new uploads.\n *\n * Object Lock must already be enabled on the bucket. Buckets created\n * without `fileLockEnabled: true` cannot accept a default retention\n * policy and B2 will reject this call.\n *\n * @param policy - The new default retention policy.\n *\n * @returns The updated bucket metadata.\n */\n async setDefaultRetention(policy) {\n return this.update({ defaultRetention: policy });\n }\n}\nexport {\n Bucket\n};\n//# sourceMappingURL=bucket.js.map\n","class B2Error extends Error {\n /** HTTP status code returned by the B2 API. */\n status;\n /** B2 error code identifying the error type (e.g. `expired_auth_token`). */\n code;\n /** B2 request ID from the `X-Bz-Request-Id` response header, if present. */\n requestId;\n /** Retry delay in seconds from the `Retry-After` response header, if present. */\n retryAfter;\n /** Whether this error is transient and the request can be retried. */\n retryable;\n /**\n * Creates a new B2Error instance.\n * @param response - Parsed B2 error response body.\n * @param options - Optional retry and request metadata from response headers.\n */\n constructor(response, options) {\n super(response.message);\n this.name = \"B2Error\";\n this.status = response.status;\n this.code = response.code;\n if (options?.retryAfter !== void 0) this.retryAfter = options.retryAfter;\n if (options?.requestId !== void 0) this.requestId = options.requestId;\n this.retryable = isTransient(response.status, response.code);\n }\n}\nclass ExpiredAuthTokenError extends B2Error {\n /**\n * Creates a new ExpiredAuthTokenError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ExpiredAuthTokenError\";\n }\n}\nclass BadAuthTokenError extends B2Error {\n /**\n * Creates a new BadAuthTokenError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadAuthTokenError\";\n }\n}\nclass ServiceUnavailableError extends B2Error {\n /**\n * Creates a new ServiceUnavailableError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ServiceUnavailableError\";\n }\n}\nclass RequestTimeoutError extends B2Error {\n /**\n * Creates a new RequestTimeoutError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"RequestTimeoutError\";\n }\n}\nclass TooManyRequestsError extends B2Error {\n /**\n * Creates a new TooManyRequestsError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"TooManyRequestsError\";\n }\n}\nclass CapExceededError extends B2Error {\n /**\n * Creates a new CapExceededError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"CapExceededError\";\n }\n}\nclass AccessDeniedError extends B2Error {\n /**\n * Creates a new AccessDeniedError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"AccessDeniedError\";\n }\n}\nclass FileNotPresentError extends B2Error {\n /**\n * Creates a new FileNotPresentError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"FileNotPresentError\";\n }\n}\nclass DuplicateBucketNameError extends B2Error {\n /**\n * Creates a new DuplicateBucketNameError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"DuplicateBucketNameError\";\n }\n}\nclass BadRequestError extends B2Error {\n /**\n * Creates a new BadRequestError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadRequestError\";\n }\n}\nclass BadUploadUrlError extends B2Error {\n /**\n * Creates a new BadUploadUrlError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadUploadUrlError\";\n }\n}\nclass ChecksumMismatchError extends B2Error {\n /**\n * Creates a new ChecksumMismatchError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ChecksumMismatchError\";\n }\n}\nclass B2InsufficientCapabilityError extends Error {\n /** Capabilities that were required for the operation. */\n required;\n /** Capabilities that the current key actually has. */\n available;\n /** Capabilities present in `required` but not in `available`. */\n missing;\n /**\n * Creates a new B2InsufficientCapabilityError instance.\n *\n * @param required - Capabilities the operation requires.\n * @param available - Capabilities the current key holds.\n * @param missing - The subset of required that isn't available.\n */\n constructor(required, available, missing) {\n super(`Application key is missing capabilities: ${missing.join(\", \")}`);\n this.name = \"B2InsufficientCapabilityError\";\n this.required = required;\n this.available = available;\n this.missing = missing;\n }\n}\nclass B2SsrfError extends Error {\n /**\n * Creates a new {@link B2SsrfError}.\n *\n * @param message - Human-readable description of which URL was rejected and why.\n * @param url - The full URL that was rejected.\n */\n constructor(message, url) {\n super(message);\n this.url = url;\n this.name = \"B2SsrfError\";\n }\n /** Always `false` — this is a security failure, not transient. */\n retryable = false;\n}\nclass NetworkError extends Error {\n /**\n * Creates a new NetworkError instance.\n * @param message - Human-readable description of the network failure.\n * @param cause - The underlying error that caused this failure, if any.\n */\n constructor(message, cause) {\n super(message);\n this.cause = cause;\n this.name = \"NetworkError\";\n }\n /** Always `true` since network errors are transient. */\n retryable = true;\n}\nfunction isTransient(status, code) {\n if (status === 408 || status === 429 || status === 503) return true;\n if (code === \"expired_auth_token\") return true;\n if (code === \"service_unavailable\" || code === \"request_timeout\") return true;\n return false;\n}\nfunction classifyError(response, options) {\n switch (response.code) {\n case \"expired_auth_token\":\n return new ExpiredAuthTokenError(response, options);\n case \"bad_auth_token\":\n case \"unauthorized\":\n return new BadAuthTokenError(response, options);\n case \"service_unavailable\":\n return new ServiceUnavailableError(response, options);\n case \"request_timeout\":\n return new RequestTimeoutError(response, options);\n case \"cap_exceeded\":\n case \"storage_cap_exceeded\":\n case \"transaction_cap_exceeded\":\n case \"download_cap_exceeded\":\n return new CapExceededError(response, options);\n case \"access_denied\":\n return new AccessDeniedError(response, options);\n case \"file_not_present\":\n case \"no_such_file\":\n return new FileNotPresentError(response, options);\n case \"duplicate_bucket_name\":\n return new DuplicateBucketNameError(response, options);\n case \"bad_sha1_checksum\":\n return new ChecksumMismatchError(response, options);\n case \"bad_request\":\n return new BadRequestError(response, options);\n }\n if (response.status === 429) return new TooManyRequestsError(response, options);\n if (response.status === 503) return new ServiceUnavailableError(response, options);\n if (response.status === 408) return new RequestTimeoutError(response, options);\n return new B2Error(response, options);\n}\nexport {\n AccessDeniedError,\n B2Error,\n B2InsufficientCapabilityError,\n B2SsrfError,\n BadAuthTokenError,\n BadRequestError,\n BadUploadUrlError,\n CapExceededError,\n ChecksumMismatchError,\n DuplicateBucketNameError,\n ExpiredAuthTokenError,\n FileNotPresentError,\n NetworkError,\n RequestTimeoutError,\n ServiceUnavailableError,\n TooManyRequestsError,\n classifyError\n};\n//# sourceMappingURL=index.js.map\n","import { B2SsrfError } from \"../errors/index.js\";\nclass UrlGuard {\n allowedSuffixes = [];\n /**\n * Lock the guard to the given host suffixes. A suffix matches a host\n * either exactly or as a `*.suffix` subdomain. For example,\n * `backblazeb2.com` allows `api.backblazeb2.com` and\n * `s3.us-west-004.backblazeb2.com`.\n *\n * Passing an empty array disables the guard (used by the simulator and\n * other test setups). Production code should always lock the guard after\n * a successful `b2_authorize_account`.\n *\n * @param suffixes - Allowed host suffixes.\n */\n setAllowedSuffixes(suffixes) {\n this.allowedSuffixes = suffixes;\n }\n /**\n * Returns the current allowed-suffix list (for tests and diagnostics).\n *\n * @returns The currently-configured list of allowed host suffixes.\n */\n getAllowedSuffixes() {\n return this.allowedSuffixes;\n }\n /**\n * Validate `rawUrl` against the allow-list. Throws {@link B2SsrfError} if\n * the URL points at a literal IP, a known-internal hostname, or a host\n * outside the allowed suffixes. Permissive (no-op) when no suffixes have\n * been configured yet.\n *\n * @param rawUrl - The URL the caller is about to fetch.\n *\n * @throws A `B2SsrfError` when the URL is rejected.\n */\n check(rawUrl) {\n if (this.allowedSuffixes.length === 0) return;\n let parsed;\n try {\n parsed = new URL(rawUrl);\n } catch {\n throw new B2SsrfError(`malformed URL rejected by SSRF guard: ${rawUrl}`, rawUrl);\n }\n const host = parsed.hostname.toLowerCase();\n if (isLiteralIp(host)) {\n throw new B2SsrfError(\n `literal IP host not allowed by SSRF guard (use a hostname): ${host}`,\n rawUrl\n );\n }\n if (isInternalHostname(host)) {\n throw new B2SsrfError(`internal hostname not allowed by SSRF guard: ${host}`, rawUrl);\n }\n for (const suffix of this.allowedSuffixes) {\n const lowered = suffix.toLowerCase();\n if (host === lowered || host.endsWith(`.${lowered}`)) return;\n }\n throw new B2SsrfError(\n `host outside allowed B2 realm: ${host} (allowed suffixes: ${this.allowedSuffixes.join(\", \")})`,\n rawUrl\n );\n }\n}\nfunction deriveAllowedSuffixes(storageApi) {\n const suffixes = /* @__PURE__ */ new Set([\"backblaze.com\"]);\n for (const url of [storageApi.apiUrl, storageApi.downloadUrl, storageApi.s3ApiUrl]) {\n try {\n const host = new URL(url).hostname;\n const parts = host.split(\".\");\n if (parts.length >= 2) {\n suffixes.add(parts.slice(-2).join(\".\"));\n }\n } catch {\n }\n }\n return Array.from(suffixes).sort();\n}\nfunction isLiteralIp(host) {\n if (/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/.test(host)) return true;\n if (host.includes(\":\")) return true;\n return false;\n}\nfunction isInternalHostname(host) {\n if (host === \"localhost\") return true;\n if (host.endsWith(\".localhost\")) return true;\n if (host === \"metadata\") return true;\n if (host === \"metadata.google.internal\") return true;\n if (host.endsWith(\".internal\")) return true;\n if (host.endsWith(\".local\")) return true;\n return false;\n}\nexport {\n UrlGuard,\n deriveAllowedSuffixes\n};\n//# sourceMappingURL=url-guard.js.map\n","const version = \"0.1.0\";\nconst pkg = {\n version\n};\nexport {\n pkg as default,\n version\n};\n//# sourceMappingURL=package.json.js.map\n","import pkg from \"./package.json.js\";\nconst VERSION = pkg.version;\nexport {\n VERSION\n};\n//# sourceMappingURL=version.js.map\n","import { VERSION } from \"../version.js\";\nconst SDK_PRODUCT = \"b2-sdk-typescript\";\nconst SDK_PACKAGE = \"@backblaze-labs/b2-sdk\";\nfunction detectPlatform() {\n const g = globalThis;\n if (typeof g[\"Deno\"] !== \"undefined\") {\n const deno = g[\"Deno\"];\n return {\n runtime: deno.version?.deno ? `deno/${deno.version.deno}` : \"deno\",\n os: deno.build?.os,\n arch: deno.build?.arch\n };\n }\n if (typeof g[\"Bun\"] !== \"undefined\") {\n const bun = g[\"Bun\"];\n const proc = g[\"process\"];\n return {\n runtime: bun.version ? `bun/${bun.version}` : \"bun\",\n os: proc?.platform,\n arch: proc?.arch\n };\n }\n if (typeof g[\"process\"] !== \"undefined\") {\n const proc = g[\"process\"];\n if (proc.versions?.node) {\n return {\n runtime: `node/${proc.versions.node}`,\n os: proc.platform,\n arch: proc.arch\n };\n }\n }\n if (typeof g[\"navigator\"] !== \"undefined\") {\n return { runtime: \"browser\", os: void 0, arch: void 0 };\n }\n return { runtime: \"unknown\", os: void 0, arch: void 0 };\n}\nfunction getUserAgent(custom) {\n const { runtime, os, arch } = detectPlatform();\n const parts = [\"typescript\", SDK_PACKAGE, runtime];\n if (os !== void 0) parts.push(os);\n if (arch !== void 0) parts.push(arch);\n const base = `${SDK_PRODUCT}/${VERSION} (${parts.join(\"; \")})`;\n return custom ? `${custom} ${base}` : base;\n}\nexport {\n SDK_PACKAGE,\n SDK_PRODUCT,\n getUserAgent\n};\n//# sourceMappingURL=user-agent.js.map\n","import { classifyError, ExpiredAuthTokenError, B2Error, NetworkError } from \"../errors/index.js\";\nimport { DEFAULT_RETRY_OPTIONS, sleep, computeBackoff } from \"./retry.js\";\nimport { UrlGuard } from \"./url-guard.js\";\nimport { getUserAgent } from \"./user-agent.js\";\nclass FetchTransport {\n /** User-Agent string sent with every request. */\n userAgent;\n /** SSRF allow-list applied to every outgoing URL. Mutable so `B2Client.authorize()` can lock it down post-auth. */\n urlGuard;\n /**\n * Creates a new FetchTransport.\n * @param options - Optional configuration: custom User-Agent prefix and SSRF guard.\n */\n constructor(options) {\n this.userAgent = getUserAgent(options?.userAgent);\n this.urlGuard = options?.urlGuard ?? new UrlGuard();\n }\n /**\n * Sends the request using the global `fetch` function.\n * @param request - The HTTP request to execute.\n *\n * @returns The HTTP response.\n *\n * @throws B2SsrfError when the URL fails the configured SSRF guard.\n */\n async send(request) {\n this.urlGuard.check(request.url);\n const headers = new Headers(request.headers);\n if (!headers.has(\"User-Agent\")) {\n headers.set(\"User-Agent\", this.userAgent);\n }\n const response = await fetch(request.url, {\n method: request.method,\n headers,\n body: request.body ?? null,\n ...request.signal !== void 0 ? { signal: request.signal } : {}\n });\n return {\n status: response.status,\n headers: response.headers,\n body: response.body,\n json: () => response.json(),\n text: () => response.text(),\n arrayBuffer: () => response.arrayBuffer()\n };\n }\n}\nclass RetryTransport {\n /** The wrapped transport that performs actual HTTP requests. */\n inner;\n /** Resolved retry options (defaults merged with user overrides). */\n options;\n /** Optional callback to refresh auth credentials on 401 — returns the fresh token. */\n onReauth;\n /** Sleep implementation used between retries; injectable for tests. */\n sleepImpl;\n /**\n * Creates a new RetryTransport.\n * @param opts - Retry transport configuration.\n */\n constructor(opts) {\n this.inner = opts.transport;\n this.options = { ...DEFAULT_RETRY_OPTIONS, ...opts.retry };\n if (opts.onReauth !== void 0) this.onReauth = opts.onReauth;\n this.sleepImpl = opts.sleepImpl ?? sleep;\n }\n /**\n * Sends the request with automatic retry on transient failures.\n * On expired auth tokens, calls {@link RetryTransportOptions.onReauth} and retries.\n * @param originalRequest - The HTTP request to execute. The caller's\n * reference is not mutated; on reauth, a copy with a refreshed\n * Authorization header is sent.\n *\n * @returns The HTTP response.\n */\n async send(originalRequest) {\n let request = originalRequest;\n let lastError;\n for (let attempt = 0; attempt <= this.options.maxRetries; attempt++) {\n if (attempt > 0 && lastError) {\n const retryAfter = lastError instanceof NetworkError ? void 0 : lastError.retryAfter;\n const delay = computeBackoff(attempt - 1, this.options, retryAfter);\n await this.sleepImpl(delay, request.signal);\n }\n try {\n const response = await this.inner.send(request);\n if (response.status >= 200 && response.status < 300) {\n return response;\n }\n let errorBody;\n try {\n errorBody = await response.json();\n } catch {\n errorBody = {\n status: response.status,\n code: \"internal_error\",\n message: `HTTP ${response.status}`\n };\n }\n const retryAfterHeader = response.headers.get(\"Retry-After\");\n const retryAfterSec = retryAfterHeader ? Number.parseInt(retryAfterHeader, 10) : void 0;\n const requestId = response.headers.get(\"X-Bz-Request-Id\") ?? void 0;\n const error = classifyError(errorBody, {\n ...retryAfterSec !== void 0 ? { retryAfter: retryAfterSec } : {},\n ...requestId !== void 0 ? { requestId } : {}\n });\n if (error instanceof ExpiredAuthTokenError && this.onReauth) {\n const freshToken = await this.onReauth();\n request = {\n ...request,\n headers: { ...request.headers ?? {}, Authorization: freshToken }\n };\n continue;\n }\n if (!error.retryable || attempt === this.options.maxRetries) {\n throw error;\n }\n lastError = error;\n } catch (err) {\n if (err instanceof B2Error || err instanceof NetworkError) {\n throw err;\n }\n if (err instanceof DOMException && err.name === \"AbortError\") {\n throw err;\n }\n const networkErr = new NetworkError(\n err instanceof Error ? err.message : \"Network error\",\n err\n );\n if (attempt === this.options.maxRetries) {\n throw networkErr;\n }\n lastError = networkErr;\n }\n }\n throw lastError ?? new NetworkError(\"Max retries exceeded\");\n }\n}\nexport {\n FetchTransport,\n RetryTransport\n};\n//# sourceMappingURL=transport.js.map\n","const EncryptionAlgorithm = {\n /** AES with a 256-bit key. The only algorithm B2 currently supports. */\n Aes256: \"AES256\"\n};\nconst EncryptionMode = {\n /** B2-managed encryption keys. */\n SseB2: \"SSE-B2\",\n /** Customer-provided encryption keys. */\n SseC: \"SSE-C\",\n /** No encryption. */\n None: \"none\"\n};\nconst SSE_B2 = { mode: \"SSE-B2\", algorithm: \"AES256\" };\nconst SSE_NONE = { mode: \"none\" };\nfunction sseCustomer(customerKey, customerKeyMd5) {\n return { mode: \"SSE-C\", algorithm: \"AES256\", customerKey, customerKeyMd5 };\n}\nfunction bytesToBase64(bytes) {\n const g = globalThis;\n if (g.Buffer) {\n return g.Buffer.from(bytes).toString(\"base64\");\n }\n let binary = \"\";\n for (const b of bytes) binary += String.fromCharCode(b);\n return btoa(binary);\n}\nasync function md5Base64(bytes) {\n try {\n const { createHash } = await import(\"node:crypto\");\n if (typeof createHash !== \"function\") throw new Error(\"createHash unavailable\");\n return createHash(\"md5\").update(bytes).digest(\"base64\");\n } catch {\n return bytesToBase64(md5Bytes(bytes));\n }\n}\nfunction md5Bytes(data) {\n const originalBitLength = data.byteLength * 8;\n const padLength = (data.byteLength + 8 >>> 6) + 1;\n const padded = new Uint8Array(padLength * 64);\n padded.set(data);\n padded[data.byteLength] = 128;\n const lowBits = originalBitLength >>> 0;\n const highBits = Math.floor(originalBitLength / 4294967296) >>> 0;\n const lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8);\n lengthView.setUint32(0, lowBits, true);\n lengthView.setUint32(4, highBits, true);\n const s = [\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21\n ];\n const k = new Uint32Array([\n 3614090360,\n 3905402710,\n 606105819,\n 3250441966,\n 4118548399,\n 1200080426,\n 2821735955,\n 4249261313,\n 1770035416,\n 2336552879,\n 4294925233,\n 2304563134,\n 1804603682,\n 4254626195,\n 2792965006,\n 1236535329,\n 4129170786,\n 3225465664,\n 643717713,\n 3921069994,\n 3593408605,\n 38016083,\n 3634488961,\n 3889429448,\n 568446438,\n 3275163606,\n 4107603335,\n 1163531501,\n 2850285829,\n 4243563512,\n 1735328473,\n 2368359562,\n 4294588738,\n 2272392833,\n 1839030562,\n 4259657740,\n 2763975236,\n 1272893353,\n 4139469664,\n 3200236656,\n 681279174,\n 3936430074,\n 3572445317,\n 76029189,\n 3654602809,\n 3873151461,\n 530742520,\n 3299628645,\n 4096336452,\n 1126891415,\n 2878612391,\n 4237533241,\n 1700485571,\n 2399980690,\n 4293915773,\n 2240044497,\n 1873313359,\n 4264355552,\n 2734768916,\n 1309151649,\n 4149444226,\n 3174756917,\n 718787259,\n 3951481745\n ]);\n let a0 = 1732584193;\n let b0 = 4023233417;\n let c0 = 2562383102;\n let d0 = 271733878;\n const m = new Uint32Array(16);\n const view = new DataView(padded.buffer);\n for (let block = 0; block < padded.byteLength; block += 64) {\n for (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true);\n let A = a0;\n let B = b0;\n let C = c0;\n let D = d0;\n for (let i = 0; i < 64; i++) {\n let f;\n let g;\n if (i < 16) {\n f = B & C | ~B & D;\n g = i;\n } else if (i < 32) {\n f = D & B | ~D & C;\n g = (5 * i + 1) % 16;\n } else if (i < 48) {\n f = B ^ C ^ D;\n g = (3 * i + 5) % 16;\n } else {\n f = C ^ (B | ~D);\n g = 7 * i % 16;\n }\n const temp = D;\n D = C;\n C = B;\n const sum = A + f + (k[i] ?? 0) + (m[g] ?? 0) >>> 0;\n const shift = s[i] ?? 0;\n const rotated = (sum << shift | sum >>> 32 - shift) >>> 0;\n B = B + rotated >>> 0;\n A = temp;\n }\n a0 = a0 + A >>> 0;\n b0 = b0 + B >>> 0;\n c0 = c0 + C >>> 0;\n d0 = d0 + D >>> 0;\n }\n const out = new Uint8Array(16);\n const outView = new DataView(out.buffer);\n outView.setUint32(0, a0, true);\n outView.setUint32(4, b0, true);\n outView.setUint32(8, c0, true);\n outView.setUint32(12, d0, true);\n return out;\n}\nconst KEY_REDACTED = \"[redacted SSE-C key]\";\nclass EncryptionKey {\n /** Encryption mode discriminant. Always `'SSE-C'` for this class. */\n mode = \"SSE-C\";\n /** Encryption algorithm. B2's S3-compatible API only supports AES-256. */\n algorithm = \"AES256\";\n /** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */\n customerKey;\n /** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */\n customerKeyMd5;\n /**\n * Internal constructor. Use {@link EncryptionKey.fromBytes} or\n * {@link EncryptionKey.fromBase64} instead.\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @internal\n */\n constructor(customerKey, customerKeyMd5) {\n this.customerKey = customerKey;\n this.customerKeyMd5 = customerKeyMd5;\n }\n /**\n * Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the\n * required base64 MD5 digest internally.\n *\n * @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n *\n * @throws If the key is not exactly 32 bytes.\n */\n static async fromBytes(rawKey) {\n if (rawKey.byteLength !== 32) {\n throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`);\n }\n const customerKey = bytesToBase64(rawKey);\n const customerKeyMd5 = await md5Base64(rawKey);\n return new EncryptionKey(customerKey, customerKeyMd5);\n }\n /**\n * Builds an EncryptionKey from precomputed base64 strings. Use this in\n * environments where MD5 must be computed externally (e.g., browsers).\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n */\n static fromBase64(customerKey, customerKeyMd5) {\n return new EncryptionKey(customerKey, customerKeyMd5);\n }\n /**\n * Hides the key bytes from `JSON.stringify`.\n *\n * @returns A redacted shape: same mode and algorithm, but the key and MD5\n * replaced with a placeholder string.\n */\n toJSON() {\n return {\n mode: this.mode,\n algorithm: this.algorithm,\n customerKey: KEY_REDACTED,\n customerKeyMd5: KEY_REDACTED\n };\n }\n /**\n * Hides the key bytes from default `toString()`.\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n toString() {\n return `[EncryptionKey SSE-C ${KEY_REDACTED}]`;\n }\n /**\n * Hides the key bytes from Node's `util.inspect` (and therefore `console.log`).\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return this.toString();\n }\n}\nexport {\n EncryptionAlgorithm,\n EncryptionKey,\n EncryptionMode,\n SSE_B2,\n SSE_NONE,\n sseCustomer\n};\n//# sourceMappingURL=encryption.js.map\n","import { normalizeFileVersionSha1, normalizeFileVersionListSha1 } from \"../util/normalize.js\";\nimport { buildFileInfoHeaders, encodeFileName } from \"./encoding.js\";\nimport { decodeFileName, parseFileInfoHeaders } from \"./encoding.js\";\nimport { EncryptionMode, EncryptionAlgorithm } from \"../types/encryption.js\";\nclass RawClient {\n /** @internal */\n transport;\n /**\n * Creates a new RawClient with the given transport.\n * @param options - The constructor configuration.\n */\n constructor(options) {\n this.transport = options.transport;\n }\n // --- Auth ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}.\n * @param applicationKeyId - The application key ID for authentication.\n * @param applicationKey - The application key secret.\n * @param realmUrl - The B2 realm URL to authenticate against.\n *\n * @returns The authorization response with API URLs and credentials.\n */\n async authorizeAccount(applicationKeyId, applicationKey, realmUrl = \"https://api.backblazeb2.com\") {\n const response = await this.transport.send({\n url: `${realmUrl}/b2api/v3/b2_authorize_account`,\n method: \"GET\",\n headers: {\n Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}`\n }\n });\n return response.json();\n }\n // --- Buckets ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The created bucket metadata.\n */\n async createBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_create_bucket\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted bucket metadata.\n */\n async deleteBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_delete_bucket\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of matching buckets.\n */\n async listBuckets(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_buckets\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated bucket metadata.\n */\n async updateBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_update_bucket\", request);\n }\n // --- Files ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-url | b2_get_upload_url}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The upload URL and authorization token.\n */\n async getUploadUrl(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_get_upload_url\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-upload-file | b2_upload_file}.\n *\n * Unlike most methods, this posts directly to the `uploadUrl` obtained\n * from {@link getUploadUrl} rather than the API URL.\n * @param uploadUrl - The upload endpoint URL.\n * @param headers - The request headers including authorization and content metadata.\n * @param body - The file data to upload.\n * @param signal - An optional abort signal for cancellation.\n *\n * @returns The uploaded file version metadata.\n */\n async uploadFile(uploadUrl, headers, body, signal) {\n const reqHeaders = {\n Authorization: headers.authorization,\n \"X-Bz-File-Name\": encodeFileName(headers.fileName),\n \"Content-Type\": headers.contentType,\n \"Content-Length\": String(headers.contentLength),\n \"X-Bz-Content-Sha1\": headers.contentSha1,\n ...buildFileInfoHeaders(headers.fileInfo)\n };\n if (headers.lastModifiedMillis !== void 0) {\n reqHeaders[\"X-Bz-Info-src_last_modified_millis\"] = String(headers.lastModifiedMillis);\n }\n if (headers.contentDisposition) {\n reqHeaders[\"X-Bz-Info-b2-content-disposition\"] = headers.contentDisposition;\n }\n if (headers.contentLanguage) {\n reqHeaders[\"X-Bz-Info-b2-content-language\"] = headers.contentLanguage;\n }\n if (headers.expires) {\n reqHeaders[\"X-Bz-Info-b2-expires\"] = headers.expires;\n }\n if (headers.cacheControl) {\n reqHeaders[\"X-Bz-Info-b2-cache-control\"] = headers.cacheControl;\n }\n if (headers.contentEncoding) {\n reqHeaders[\"X-Bz-Info-b2-content-encoding\"] = headers.contentEncoding;\n }\n applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n applyRetentionHeaders(reqHeaders, headers.fileRetention);\n applyLegalHoldHeader(reqHeaders, headers.legalHold);\n const response = await this.transport.send({\n url: uploadUrl,\n method: \"POST\",\n headers: reqHeaders,\n body,\n ...signal !== void 0 ? { signal } : {}\n });\n return normalizeFileVersionSha1(await response.json());\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of file names and optional continuation token.\n */\n async listFileNames(apiUrl, authToken, request) {\n return normalizeFileVersionListSha1(\n await this.postJson(apiUrl, authToken, \"b2_list_file_names\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of file versions and optional continuation token.\n */\n async listFileVersions(apiUrl, authToken, request) {\n return normalizeFileVersionListSha1(\n await this.postJson(\n apiUrl,\n authToken,\n \"b2_list_file_versions\",\n request\n )\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The file version metadata.\n */\n async getFileInfo(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_get_file_info\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The hidden file version metadata.\n */\n async hideFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_hide_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted file version identifier.\n */\n async deleteFileVersion(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_delete_file_version\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The copied file version metadata.\n */\n async copyFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_copy_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The copied part metadata.\n */\n async copyPart(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_copy_part\", request);\n }\n // --- Large Files ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The started large file metadata with file ID.\n */\n async startLargeFile(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_start_large_file\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-part-url | b2_get_upload_part_url}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The upload part URL and authorization token.\n */\n async getUploadPartUrl(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_upload_part_url\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-upload-part | b2_upload_part}.\n *\n * Posts directly to the `uploadUrl` obtained from {@link getUploadPartUrl}\n * rather than the API URL.\n * @param uploadUrl - The upload endpoint URL.\n * @param headers - The request headers including authorization and content metadata.\n * @param body - The file data to upload.\n * @param signal - An optional abort signal for cancellation.\n *\n * @returns The uploaded part metadata.\n */\n async uploadPart(uploadUrl, headers, body, signal) {\n const reqHeaders = {\n Authorization: headers.authorization,\n \"X-Bz-Part-Number\": String(headers.partNumber),\n \"Content-Length\": String(headers.contentLength),\n \"X-Bz-Content-Sha1\": headers.contentSha1\n };\n applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n const response = await this.transport.send({\n url: uploadUrl,\n method: \"POST\",\n headers: reqHeaders,\n body,\n ...signal !== void 0 ? { signal } : {}\n });\n return response.json();\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The completed file version metadata.\n */\n async finishLargeFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_finish_large_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The cancelled large file metadata.\n */\n async cancelLargeFile(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_cancel_large_file\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of unfinished large files and optional continuation token.\n */\n async listUnfinishedLargeFiles(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_list_unfinished_large_files\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of uploaded parts and optional continuation token.\n */\n async listParts(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_parts\", request);\n }\n // --- Downloads ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}.\n * @param downloadUrl - The B2 download base URL.\n * @param authToken - The authorization token.\n * @param fileId - The unique identifier of the file to download.\n * @param options - Optional download parameters for range requests and cancellation.\n *\n * @returns The response headers, streaming body, and HTTP status code.\n */\n async downloadFileById(downloadUrl, authToken, fileId, options) {\n const headers = buildDownloadRequestHeaders(authToken, options);\n const url = appendDownloadOverrides(\n `${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`,\n options\n );\n const response = await this.transport.send({\n url,\n method: options?.method ?? \"GET\",\n headers,\n ...options?.signal !== void 0 ? { signal: options.signal } : {}\n });\n return { headers: response.headers, body: response.body, status: response.status };\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}.\n * @param downloadUrl - The B2 download base URL.\n * @param authToken - The authorization token.\n * @param bucketName - The name of the bucket containing the file.\n * @param fileName - The name of the file to download.\n * @param options - Optional download parameters for range requests and cancellation.\n *\n * @returns The response headers, streaming body, and HTTP status code.\n */\n async downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) {\n const headers = buildDownloadRequestHeaders(authToken, options);\n const url = appendDownloadOverrides(\n `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileName(fileName)}`,\n options\n );\n const response = await this.transport.send({\n url,\n method: options?.method ?? \"GET\",\n headers,\n ...options?.signal !== void 0 ? { signal: options.signal } : {}\n });\n return { headers: response.headers, body: response.body, status: response.status };\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The current session authorization token.\n * @param request - The API request parameters.\n *\n * @returns The download authorization token for the specified file prefix.\n */\n async getDownloadAuthorization(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_download_authorization\",\n request\n );\n }\n // --- Keys ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The newly created application key with secret.\n */\n async createKey(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_create_key\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of application keys and optional continuation token.\n */\n async listKeys(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_keys\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted application key metadata.\n */\n async deleteKey(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_delete_key\", request);\n }\n // --- Retention / Legal Hold ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated file retention settings.\n */\n async updateFileRetention(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_update_file_retention\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated file legal hold status.\n */\n async updateFileLegalHold(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_update_file_legal_hold\",\n request\n );\n }\n // --- Notifications ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The configured event notification rules for the specified bucket.\n */\n async getBucketNotificationRules(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_bucket_notification_rules\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated bucket notification rules.\n */\n async setBucketNotificationRules(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_set_bucket_notification_rules\",\n request\n );\n }\n // --- Internal ---\n /**\n * Sends a JSON POST request to the specified B2 API endpoint.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param endpoint - The B2 API endpoint name.\n * @param body - The JSON request body.\n *\n * @returns The parsed JSON response.\n */\n async postJson(apiUrl, authToken, endpoint, body) {\n const response = await this.transport.send({\n url: `${apiUrl}/b2api/v3/${endpoint}`,\n method: \"POST\",\n headers: {\n Authorization: authToken,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(body)\n });\n return response.json();\n }\n}\nfunction applyEncryptionHeaders(headers, encryption) {\n if (!encryption || encryption.mode === EncryptionMode.None) return;\n if (encryption.mode === EncryptionMode.SseB2) {\n headers[\"X-Bz-Server-Side-Encryption\"] = EncryptionAlgorithm.Aes256;\n } else if (encryption.mode === EncryptionMode.SseC) {\n headers[\"X-Bz-Server-Side-Encryption-Customer-Algorithm\"] = EncryptionAlgorithm.Aes256;\n headers[\"X-Bz-Server-Side-Encryption-Customer-Key\"] = encryption.customerKey;\n headers[\"X-Bz-Server-Side-Encryption-Customer-Key-Md5\"] = encryption.customerKeyMd5;\n }\n}\nconst DOWNLOAD_OVERRIDE_PARAMS = [\n \"b2ContentDisposition\",\n \"b2ContentLanguage\",\n \"b2ContentEncoding\",\n \"b2ContentType\",\n \"b2CacheControl\",\n \"b2Expires\"\n];\nfunction buildDownloadRequestHeaders(authToken, options) {\n const headers = { Authorization: authToken };\n if (options?.range) headers[\"Range\"] = options.range;\n if (options?.serverSideEncryption) {\n applyEncryptionHeaders(headers, {\n mode: EncryptionMode.SseC,\n ...options.serverSideEncryption\n });\n }\n return headers;\n}\nfunction appendDownloadOverrides(url, options) {\n if (!options) return url;\n const params = [];\n for (const key of DOWNLOAD_OVERRIDE_PARAMS) {\n const value = options[key];\n if (value !== void 0) {\n params.push(`${key}=${encodeURIComponent(value)}`);\n }\n }\n if (params.length === 0) return url;\n const separator = url.includes(\"?\") ? \"&\" : \"?\";\n return `${url}${separator}${params.join(\"&\")}`;\n}\nfunction applyRetentionHeaders(headers, retention) {\n if (!retention) return;\n if (retention.mode) {\n headers[\"X-Bz-File-Retention-Mode\"] = retention.mode;\n }\n if (retention.retainUntilTimestamp) {\n headers[\"X-Bz-File-Retention-Retain-Until-Timestamp\"] = String(retention.retainUntilTimestamp);\n }\n}\nfunction applyLegalHoldHeader(headers, legalHold) {\n if (!legalHold) return;\n headers[\"X-Bz-File-Legal-Hold\"] = legalHold;\n}\nexport {\n RawClient,\n buildFileInfoHeaders,\n decodeFileName,\n encodeFileName,\n parseFileInfoHeaders\n};\n//# sourceMappingURL=index.js.map\n","import { InMemoryAccountInfo } from \"./auth/in-memory.js\";\nimport { getRealmUrl } from \"./auth/realms.js\";\nimport { Bucket } from \"./bucket.js\";\nimport { FetchTransport, RetryTransport } from \"./http/transport.js\";\nimport { UrlGuard, deriveAllowedSuffixes } from \"./http/url-guard.js\";\nimport { RawClient } from \"./raw/index.js\";\nimport { accountId } from \"./types/ids.js\";\nimport { DEFAULT_PAGE_SIZE } from \"./util/defaults.js\";\nimport { paginateItems } from \"./util/paginator.js\";\nclass B2Client {\n /** Low-level client for direct B2 API calls. */\n raw;\n /** Authorization state storage (tokens, URLs, capabilities). */\n accountInfo;\n /**\n * SSRF allow-list applied by the default {@link FetchTransport}. `null` when\n * a custom transport was supplied — in that case the SDK does not own the\n * guard. Locked down by {@link B2Client.authorize}.\n */\n urlGuard;\n applicationKeyId;\n applicationKey;\n realmUrl;\n userAllowedSuffixes;\n /**\n * Creates a new B2Client. Call {@link authorize} before making API requests.\n * @param options - Configuration including credentials, realm, and transport settings.\n */\n constructor(options) {\n this.applicationKeyId = options.applicationKeyId;\n this.applicationKey = options.applicationKey;\n this.realmUrl = getRealmUrl(options.realm ?? \"production\");\n this.accountInfo = options.accountInfo ?? new InMemoryAccountInfo();\n this.userAllowedSuffixes = options.allowedHostSuffixes;\n let baseTransport;\n if (options.transport !== void 0) {\n baseTransport = options.transport;\n this.urlGuard = null;\n } else {\n const urlGuard = new UrlGuard();\n baseTransport = new FetchTransport({\n urlGuard,\n ...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {}\n });\n this.urlGuard = urlGuard;\n }\n const retryTransport = new RetryTransport({\n transport: baseTransport,\n ...options.retry !== void 0 ? { retry: options.retry } : {},\n onReauth: () => this.reauthorize()\n });\n this.raw = new RawClient({ transport: retryTransport });\n }\n /**\n * Authenticates with B2 and stores the authorization state. Must be called before other methods.\n *\n * @returns The authorization response containing tokens, URLs, and capabilities.\n */\n async authorize() {\n const auth = await this.raw.authorizeAccount(\n this.applicationKeyId,\n this.applicationKey,\n this.realmUrl\n );\n this.accountInfo.setAuth(auth);\n if (this.urlGuard !== null) {\n const derived = deriveAllowedSuffixes(auth.apiInfo.storageApi);\n const merged = this.userAllowedSuffixes !== void 0 ? Array.from(/* @__PURE__ */ new Set([...derived, ...this.userAllowedSuffixes])) : derived;\n this.urlGuard.setAllowedSuffixes(merged);\n }\n return auth;\n }\n /**\n * Refresh credentials after a 401. Returns the fresh auth token so\n * {@link RetryTransport} can rewrite the in-flight request's\n * Authorization header before retrying.\n *\n * @returns The fresh authorization token.\n */\n async reauthorize() {\n this.accountInfo.clear();\n const auth = await this.authorize();\n return auth.authorizationToken;\n }\n /**\n * Creates a new B2 bucket.\n * @param options - Bucket configuration including name, type, and optional settings.\n *\n * @returns A {@link Bucket} handle for the newly created bucket.\n */\n async createBucket(options) {\n const request = {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n };\n const info = await this.raw.createBucket(\n this.accountInfo.getApiUrl(),\n this.accountInfo.getAuthToken(),\n request\n );\n return new Bucket(this, info);\n }\n /**\n * Lists buckets in the account, optionally filtered by ID, name, or type.\n * @param options - Optional filters for bucket ID, name, or type.\n *\n * @returns An array of {@link Bucket} handles.\n */\n async listBuckets(options) {\n const resp = await this.raw.listBuckets(\n this.accountInfo.getApiUrl(),\n this.accountInfo.getAuthToken(),\n {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n }\n );\n return resp.buckets.map((info) => new Bucket(this, info));\n }\n /**\n * Looks up a single bucket by name.\n * @param bucketName - The name of the bucket to find.\n *\n * @returns The {@link Bucket} handle, or `null` if not found.\n */\n async getBucket(bucketName) {\n const buckets = await this.listBuckets({ bucketName });\n return buckets[0] ?? null;\n }\n /**\n * Permanently deletes a bucket. The bucket must be empty.\n * @param id - The unique identifier of the bucket to delete.\n *\n * @returns The deleted bucket metadata.\n */\n async deleteBucket(id) {\n return this.raw.deleteBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n bucketId: id\n });\n }\n /**\n * Creates a new application key with the specified capabilities.\n * @param options - Key configuration including capabilities, name, and optional restrictions.\n *\n * @returns The full key including the secret (only returned at creation time).\n */\n async createKey(options) {\n return this.raw.createKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n });\n }\n /**\n * Lists application keys in the account.\n * @param options - Optional pagination settings.\n *\n * @returns A page of application keys with an optional continuation token.\n */\n async listKeys(options) {\n return this.raw.listKeys(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options?.pageSize !== void 0 ? { maxKeyCount: options.pageSize } : {},\n ...options?.startApplicationKeyId !== void 0 ? { startApplicationKeyId: options.startApplicationKeyId } : {}\n });\n }\n /**\n * Async iterator that yields every application key on the account,\n * automatically handling pagination via `listKeys`.\n *\n * @param options - Pagination + abort options. `pageSize` is forwarded\n * to `maxKeyCount`; the default is 1000.\n *\n * @returns An async iterable of {@link ApplicationKey} entries.\n *\n * @example\n * ```ts\n * for await (const key of client.paginateKeys()) {\n * console.log(key.keyName, key.capabilities)\n * }\n * ```\n */\n paginateKeys(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listKeys({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startApplicationKeyId: cursor } : {}\n });\n return { page: resp, nextCursor: resp.nextApplicationKeyId ?? void 0 };\n },\n (page) => page.keys,\n options?.signal\n );\n }\n /**\n * Permanently deletes an application key.\n * @param applicationKeyId - The unique identifier of the key to delete.\n *\n * @returns The deleted application key metadata.\n */\n async deleteKey(applicationKeyId) {\n return this.raw.deleteKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n applicationKeyId\n });\n }\n /**\n * Checks whether the authorized application key carries every capability in\n * `needed`. Returns the missing capabilities so callers can fail fast with a\n * clear error instead of a generic 401/403 from the server.\n *\n * @param needed - The capabilities required by the planned operation.\n *\n * @returns An object with `ok: true` when every needed capability is\n * present, otherwise `{ ok: false, missing: [...] }`.\n *\n * @throws If {@link authorize} has not been called yet.\n */\n hasCapabilities(needed) {\n const auth = this.accountInfo.getAuth();\n if (!auth) throw new Error(\"Not authorized. Call authorize() first.\");\n const available = new Set(auth.apiInfo.storageApi.allowed.capabilities);\n const missing = needed.filter((cap) => !available.has(cap));\n return { ok: missing.length === 0, missing };\n }\n}\nexport {\n B2Client\n};\n//# sourceMappingURL=client.js.map\n","import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Action version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync: bumping `version` in package.json\n * automatically propagates here, into the User-Agent header, and into the\n * bundled `dist/index.js`.\n *\n * Works because:\n * - Node 22+ supports native JSON import attributes.\n * - ncc / webpack statically inlines the JSON at bundle time, so the\n * runtime artifact has the version baked in as a string literal.\n * - TypeScript's `resolveJsonModule` makes the import type-safe.\n */\nexport const VERSION: string = pkg.version\n","import * as core from '@actions/core'\nimport type { AuthorizeAccountResponse, FileVersion } from '@backblaze-labs/b2-sdk'\nimport {\n B2Client,\n type Bucket,\n type HttpTransport,\n InMemoryAccountInfo,\n} from '@backblaze-labs/b2-sdk'\nimport { VERSION } from './version.ts'\n\n/**\n * An authorized B2Client paired with the bucket name the action is scoped\n * to. Returned by {@link buildClient}; consumed by command dispatch sites\n * that need either the high-level client (cross-bucket copy, presign) or\n * the resolved bucket (via {@link getBucket}).\n */\nexport interface AuthorizedClient {\n /** The authorized SDK client. `client.accountInfo` is populated. */\n client: B2Client\n /** The destination bucket name as provided to the action's `bucket` input. */\n bucketName: string\n}\n\n/** Inputs to {@link buildClient}. */\nexport interface BuildClientOptions {\n /** B2 application key ID. Masked via `core.setSecret` by the dispatcher (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked via `core.setSecret` by the dispatcher. */\n applicationKey: string\n /** Target bucket name (stored on the result for later `getBucket` resolution). */\n bucket: string\n /** Override the default B2 realm endpoint. Only set for staging / custom realms. */\n endpoint?: string | undefined\n /** Inject a custom transport (used by tests with the SDK's `B2Simulator`). */\n transport?: HttpTransport | undefined\n}\n\nfunction maskAccountAuthToken(token: string | null | undefined): void {\n if (token) core.setSecret(token)\n}\n\nclass SecretMaskingAccountInfo extends InMemoryAccountInfo {\n // The SDK routes authorize() and transparent reauthorize() through the\n // supplied AccountInfo.setAuth. The reauth masking test is the CI guard for\n // this SDK coupling when the dependency is bumped.\n override setAuth(auth: AuthorizeAccountResponse): void {\n maskAccountAuthToken(auth.authorizationToken)\n super.setAuth(auth)\n }\n}\n\n/**\n * Build an authorized B2Client.\n *\n * Steps:\n * 1. Construct the client with `userAgent: 'b2-github-action/'`. The\n * SDK preserves its own `b2-sdk-typescript/` and `@backblaze-labs/b2-sdk` tokens before\n * ours so Backblaze server-side logs see both attribution layers.\n * 2. `await client.authorize()`. This is one-shot for the lifetime of the\n * action invocation. B2 auth tokens carry a 24h TTL; typical GitHub\n * Actions runs finish well inside that window. If a long-running job\n * outlives the token, the SDK transparently re-authorizes on the next\n * 401, so the action layer does not need its own refresh loop.\n * 3. Use an AccountInfo wrapper that masks each account authorization token\n * as it is stored, including SDK-driven reauthorization after token\n * expiry. The post-authorize mask is kept as a fallback in case a future\n * SDK version bypasses the wrapper for initial authorization.\n *\n * The `transport` parameter is only used by tests (the SDK's B2Simulator\n * provides one). Production callers leave it undefined to use the SDK's\n * default FetchTransport with its built-in SSRF guard.\n */\nexport async function buildClient(options: BuildClientOptions): Promise {\n const userAgent = `b2-github-action/${VERSION}`\n\n const client = new B2Client({\n applicationKeyId: options.applicationKeyId,\n applicationKey: options.applicationKey,\n accountInfo: new SecretMaskingAccountInfo(),\n userAgent,\n ...(options.transport !== undefined ? { transport: options.transport } : {}),\n ...(options.endpoint !== undefined ? { realm: options.endpoint } : {}),\n })\n\n await client.authorize()\n // Deliberately overlaps with setAuth for initial auth. If a future SDK\n // changes authorize() storage, the public AccountInfo getter still masks the\n // stored account token before command code can log.\n maskAccountAuthToken(client.accountInfo.getAuthToken())\n\n return { client, bucketName: options.bucket }\n}\n\n/**\n * Resolve a bucket by name. Throws a clear error rather than the SDK's\n * `undefined` return so the workflow log surfaces the misconfiguration.\n */\nexport async function getBucket(authorized: AuthorizedClient) {\n const bucket = await authorized.client.getBucket(authorized.bucketName)\n if (!bucket) {\n throw new Error(\n `Bucket \"${authorized.bucketName}\" not found, or the application key lacks listBuckets capability for it.`,\n )\n }\n return bucket\n}\n\n/**\n * Resolve an exact file name only when its latest version is an upload. If the\n * latest exact-name version is a hide marker, this intentionally reports the\n * file as not found instead of selecting an older upload from version history\n * or revealing hidden-object existence in default workflow logs. Throws when\n * the latest exact-name state is hidden, deleted, or absent. Used by `copy`,\n * `delete`, and `retention` to resolve a file name to a `fileId` before\n * operating on it.\n *\n * Consistency assumption: B2's `listFileNames` is read-after-write consistent\n * for a recently-uploaded file in the same region. The simulator returns\n * uploads immediately; production B2 in practice does the same, but a caller\n * that chains \"upload then operate on the same name\" across two action steps\n * is relying on observed behavior rather than a documented SLA.\n *\n * @param bucket - The bucket to search.\n * @param fileName - Exact file name (path) to look up.\n * @param bucketDisplayName - Optional label for the error message; defaults\n * to `bucket.name`. Used when looking up in a source bucket distinct from\n * the action's destination bucket (cross-bucket copy).\n */\nexport async function findFileByName(\n bucket: Bucket,\n fileName: string,\n bucketDisplayName?: string,\n): Promise {\n const display = bucketDisplayName ?? bucket.name\n const page = await bucket.listFileNames({ prefix: fileName, pageSize: 1 })\n const exactLatest = page.files.find((f) => f.fileName === fileName)\n if (exactLatest?.action === 'upload') return exactLatest\n\n throw new Error(`File not found in bucket \"${display}\": ${fileName}`)\n}\n","import { Buffer } from 'node:buffer'\nimport { createHash } from 'node:crypto'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { SSE_B2, sseCustomer } from '@backblaze-labs/b2-sdk'\n\nconst CANONICAL_BASE64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/\n\n/**\n * Parse the `sse` input into an SDK {@link EncryptionSetting}.\n *\n * Accepted forms:\n * - `undefined` / empty → no encryption setting passed (B2 still applies any\n * bucket-default SSE-B2; we just don't override it).\n * - `\"B2\"` (case-insensitive) → SSE-B2 with the B2-managed key (no cost).\n * - `\"C:\"` → SSE-C with a customer-provided key. We\n * compute the required base64 MD5 internally so the workflow author\n * doesn't have to.\n *\n * The action runs in Node only, so we use `node:crypto.createHash('md5')`\n * directly rather than the SDK's isomorphic key wrapper. We deliberately do\n * NOT log the key bytes; the only place they ever go is into the\n * `customerKey` field of the SDK setting which the SDK marks as a secret in\n * any error / debug output.\n */\nexport function parseSse(raw: string | undefined): EncryptionSetting | undefined {\n if (raw === undefined || raw === '') return undefined\n\n const normalized = raw.trim()\n if (normalized.toUpperCase() === 'B2') return SSE_B2\n\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n const base64Key = normalized.slice(2).trim()\n if (base64Key === '') {\n throw new Error(\"SSE-C key is empty. Use 'C:'.\")\n }\n // Node's `Buffer.from(str, 'base64')` silently drops invalid chars instead\n // of throwing, so validate the canonical alphabet and padding first.\n if (!CANONICAL_BASE64.test(base64Key)) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const keyBytes = Buffer.from(base64Key, 'base64')\n if (keyBytes.byteLength !== 32) {\n throw new Error(\n `SSE-C key must decode to exactly 32 bytes (256 bits); got ${keyBytes.byteLength}.`,\n )\n }\n const customerKey = keyBytes.toString('base64')\n if (customerKey !== base64Key) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const customerKeyMd5 = createHash('md5').update(keyBytes).digest('base64')\n return sseCustomer(customerKey, customerKeyMd5)\n }\n\n throw new Error(`Invalid 'sse' input: \"${raw}\". Expected \"B2\" or \"C:\".`)\n}\n","import * as core from '@actions/core'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { parseSse } from './sse.ts'\n\n/**\n * Discriminator the action's dispatcher switches on. Matches the values\n * accepted by the `action:` input in `action.yml`. Adding a new verb\n * requires updating this union, the runtime `VALID_ACTIONS` list,\n * `ACTION_EFFECTS`, the dispatcher in `src/main.ts`, and the documentation\n * surfaces.\n */\nexport type ActionName =\n | 'upload'\n | 'download'\n | 'sync'\n | 'copy'\n | 'delete'\n | 'presign'\n | 'list'\n | 'hide'\n | 'unhide'\n | 'verify'\n | 'retention'\n | 'head'\n | 'purge'\n\nconst VALID_ACTIONS: readonly ActionName[] = [\n 'upload',\n 'download',\n 'sync',\n 'copy',\n 'delete',\n 'presign',\n 'list',\n 'hide',\n 'unhide',\n 'verify',\n 'retention',\n 'head',\n 'purge',\n]\n\ntype ActionEffect = {\n readonly kind: 'read' | 'write'\n readonly honorsDryRun: boolean\n}\n\n/**\n * Runtime side-effect policy for each action verb.\n *\n * @internal\n */\nexport const ACTION_EFFECTS = {\n upload: { kind: 'write', honorsDryRun: false },\n download: { kind: 'read', honorsDryRun: false },\n sync: { kind: 'write', honorsDryRun: true },\n copy: { kind: 'write', honorsDryRun: false },\n delete: { kind: 'write', honorsDryRun: true },\n presign: { kind: 'read', honorsDryRun: false },\n list: { kind: 'read', honorsDryRun: false },\n hide: { kind: 'write', honorsDryRun: false },\n unhide: { kind: 'write', honorsDryRun: false },\n verify: { kind: 'read', honorsDryRun: false },\n retention: { kind: 'write', honorsDryRun: false },\n head: { kind: 'read', honorsDryRun: false },\n purge: { kind: 'write', honorsDryRun: true },\n} as const satisfies Record\n\n/** How `sync` decides whether two files match. Drives the SDK's `synchronize()`. */\nexport type CompareMode = 'modtime' | 'size' | 'none'\n/** What `sync` does with destination-only files when reconciling. */\nexport type KeepMode = 'no-delete' | 'delete' | 'keep-days'\n/** Direction of a `sync`: `auto` infers from whether `source` is local or remote. */\nexport type SyncDirection = 'auto' | 'up' | 'down'\n/** B2 Object Lock retention mode. `none` clears any prior retention. */\nexport type RetentionMode = 'compliance' | 'governance' | 'none'\n/** B2 Object Lock legal-hold state. */\nexport type LegalHold = 'on' | 'off'\n\nconst VALID_COMPARE: readonly CompareMode[] = ['modtime', 'size', 'none']\nconst VALID_KEEP: readonly KeepMode[] = ['no-delete', 'delete', 'keep-days']\nconst VALID_DIRECTION: readonly SyncDirection[] = ['auto', 'up', 'down']\nconst VALID_RETENTION_MODE: readonly RetentionMode[] = ['compliance', 'governance', 'none']\nconst VALID_LEGAL_HOLD: readonly LegalHold[] = ['on', 'off']\nconst APPLICATION_KEY_ID_ENV = 'B2_APPLICATION_KEY_ID'\nconst APPLICATION_KEY_ENV = 'B2_APPLICATION_KEY'\n\n/**\n * The fully-parsed, fully-validated action surface. Built by\n * {@link parseInputs} from `INPUT_*` env vars (via `@actions/core`); every\n * command in `src/commands/` consumes a frozen instance of this shape.\n *\n * Most fields map 1:1 to inputs declared in `action.yml`. Defaults and\n * optionality match the YAML surface; see `action.yml` for the user-facing\n * documentation per input.\n */\nexport interface ParsedInputs {\n /** Which verb to dispatch to. */\n action: ActionName\n /** B2 application key ID. Masked at parse time via `core.setSecret` (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked at parse time via `core.setSecret`. */\n applicationKey: string\n /** Destination bucket name for the action. */\n bucket: string\n /** Cross-bucket `copy` source bucket. Undefined means same-bucket copy. */\n sourceBucket: string | undefined\n /**\n * Verb-dependent source. Upload/sync: a local path or glob. Download/copy/\n * delete/presign/list/hide/unhide/verify/retention/head/purge: a B2 file\n * name or prefix (trailing `/` means prefix mode for verbs that support it).\n */\n source: string | undefined\n /**\n * Verb-dependent destination. Upload/sync: B2 file name or prefix.\n * Download: local path. Copy: destination file name. Other verbs: ignored.\n */\n destination: string | undefined\n /** Glob patterns to include during upload/sync expansion. */\n include: string[]\n /** Glob patterns to exclude during upload/sync expansion. Default: `.git/**`. */\n exclude: string[]\n /** Parallel parts/files for upload/sync. */\n concurrency: number\n /** Multipart part size in bytes. Undefined defers to the SDK's recommendation. */\n partSize: number | undefined\n /** Resume an in-progress multipart upload. */\n resume: boolean\n /** Content-Type to set on uploaded objects. Undefined leaves B2's auto-detect. */\n contentType: string | undefined\n /** Response Content-Disposition override for `download` and `presign`. */\n contentDisposition: string | undefined\n /** Response Content-Type override for `download` and `presign`. */\n responseContentType: string | undefined\n /** Response Cache-Control override for `download` and `presign`. */\n cacheControl: string | undefined\n /** Preview without executing (sync/delete/purge). */\n dryRun: boolean\n /** Permit whole-bucket purge when `source` is empty or `/`. */\n allowBucketPurge: boolean\n /** Presigned-URL TTL in seconds. */\n presignTtlSeconds: number\n /** Override B2 realm endpoint for staging / custom realms. */\n endpoint: string | undefined\n /** Fail the action when upload/sync matches zero files. */\n failOnEmpty: boolean\n /** Raw `sse:` input value as the user typed it. Retained for diagnostics. */\n sse: string | undefined\n /** Parsed SSE specification ready to hand to the SDK. */\n encryption: EncryptionSetting | undefined\n /** How `sync` compares files. */\n compareMode: CompareMode\n /** How `sync` treats destination-only files. */\n keepMode: KeepMode\n /** Direction of a `sync` (auto-detected when set to `auto`). */\n syncDirection: SyncDirection\n /** Cap on listed/presigned entries for `list` and prefix `presign`. */\n maxResults: number\n /** Literal SHA-1 to compare against in `verify` (when set, no local read). */\n expectedSha1: string | undefined\n /** Object Lock retention mode to apply (`retention` verb). */\n retentionMode: RetentionMode | undefined\n /** ISO-8601 timestamp until which retention applies. Required with `retentionMode`. */\n retentionUntil: string | undefined\n /** Legal-hold state to apply (`retention` verb). */\n legalHold: LegalHold | undefined\n /** Allow shortening a governance-mode retention (requires key capability). */\n bypassGovernance: boolean\n}\n\n/**\n * Sensitive raw values that can appear in parser-scope errors before\n * {@link parseInputs} returns its structured output.\n */\nexport function collectInputSecretsForScrubbing(): string[] {\n const secretValues = new Set()\n addSecretValue(secretValues, core.getInput('application-key-id'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ID_ENV])\n addSecretValue(secretValues, core.getInput('application-key'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ENV])\n addSseSecretValue(secretValues, core.getInput('sse'))\n return [...secretValues]\n}\n\n/**\n * Parse and validate inputs.\n *\n * Credentials lookup order:\n *\n * 1. `application-key-id` / `application-key` action inputs\n * 2. `B2_APPLICATION_KEY_ID` / `B2_APPLICATION_KEY` env vars (the official\n * contract used by the Backblaze b2 CLI and the @backblaze-labs/b2-sdk).\n *\n * The credential value, once resolved, is immediately masked via `core.setSecret`\n * so any accidental echo (including from a misbehaving sub-process) is redacted\n * in workflow logs.\n */\nexport function parseInputs(): ParsedInputs {\n const action = parseEnum('action', required('action').toLowerCase(), VALID_ACTIONS)\n\n const applicationKeyId = resolveCredential('application-key-id', APPLICATION_KEY_ID_ENV)\n const applicationKey = resolveCredential('application-key', APPLICATION_KEY_ENV)\n // The keyId is identifying (not the secret half of the HMAC pair), but mask\n // it anyway for defense in depth: the canonical AWS analogue mask AKIA-style\n // IDs in CI logs, and masking costs nothing in debuggability since the user\n // already knows which key they passed.\n core.setSecret(applicationKeyId)\n core.setSecret(applicationKey)\n\n const bucket = required('bucket')\n const sourceBucket = optional('source-bucket')\n const allowBucketPurge = parseBool(\n 'allow-bucket-purge',\n core.getInput('allow-bucket-purge') || 'false',\n )\n const source = optionalSource(action, allowBucketPurge)\n const destination = optional('destination')\n\n const include = splitCsv(optional('include'))\n const exclude = splitCsv(optional('exclude'))\n\n const concurrency = parsePositiveInt('concurrency', core.getInput('concurrency') || '4')\n const partSizeInput = optional('part-size')\n const partSize =\n partSizeInput !== undefined ? parsePositiveInt('part-size', partSizeInput) : undefined\n\n const resume = parseBool('resume', core.getInput('resume') || 'true')\n const dryRun = parseBool('dry-run', core.getInput('dry-run') || 'false')\n const failOnEmpty = parseBool('fail-on-empty', core.getInput('fail-on-empty') || 'true')\n const bypassGovernance = parseBool(\n 'bypass-governance',\n core.getInput('bypass-governance') || 'false',\n )\n\n const presignTtlSeconds = parsePositiveInt('presign-ttl', core.getInput('presign-ttl') || '3600')\n const maxResults = parsePositiveInt('max-results', core.getInput('max-results') || '1000')\n\n const contentType = optional('content-type')\n const contentDisposition = optional('content-disposition')\n const responseContentType = optional('response-content-type')\n const cacheControl = optional('cache-control')\n const endpoint = optional('endpoint')\n const sse = optional('sse')\n const encryption = parseSse(sse)\n const expectedSha1 = optional('expected-sha1')\n const retentionUntil = optional('retention-until')\n\n const compareMode = parseEnum(\n 'compare-mode',\n (core.getInput('compare-mode') || 'modtime').toLowerCase(),\n VALID_COMPARE,\n )\n const keepMode = parseEnum(\n 'keep-mode',\n (core.getInput('keep-mode') || 'no-delete').toLowerCase(),\n VALID_KEEP,\n )\n const syncDirection = parseEnum(\n 'direction',\n (core.getInput('direction') || 'auto').toLowerCase(),\n VALID_DIRECTION,\n )\n const retentionMode = parseOptionalEnum(\n 'retention-mode',\n optional('retention-mode')?.toLowerCase(),\n VALID_RETENTION_MODE,\n )\n const legalHold = parseOptionalEnum(\n 'legal-hold',\n optional('legal-hold')?.toLowerCase(),\n VALID_LEGAL_HOLD,\n )\n\n return {\n action,\n applicationKeyId,\n applicationKey,\n bucket,\n sourceBucket,\n source,\n destination,\n include,\n exclude,\n concurrency,\n partSize,\n resume,\n contentType,\n contentDisposition,\n responseContentType,\n cacheControl,\n dryRun,\n allowBucketPurge,\n presignTtlSeconds,\n endpoint,\n failOnEmpty,\n sse,\n encryption,\n compareMode,\n keepMode,\n syncDirection,\n maxResults,\n expectedSha1,\n retentionMode,\n retentionUntil,\n legalHold,\n bypassGovernance,\n }\n}\n\n/**\n * Validate that `inputs.source` is set and non-empty, returning the value.\n * Throws a uniform error message naming the verb so the workflow log surfaces\n * exactly what's missing. Commands that allow an empty-string source for\n * special semantics (e.g. `purge` with explicit whole-bucket scope) should\n * not use this helper.\n */\nexport function requireSource(\n source: string | undefined,\n verb: string,\n description?: string,\n): string {\n if (source === undefined || source === '') {\n const tail = description !== undefined ? ` (${description})` : ''\n throw new Error(`'source' input is required for '${verb}' action${tail}`)\n }\n return source\n}\n\n/**\n * Validate that `raw` is one of `valid`, narrowing the return type.\n *\n * Replaces the previous pattern of one type-guard + one throw per enum:\n *\n * const x = parseEnum('compare-mode', raw, VALID_COMPARE)\n *\n * Throws a uniform error message that lists the legal values.\n *\n * @internal\n */\nexport function parseEnum(name: string, raw: string, valid: readonly T[]): T {\n if ((valid as readonly string[]).includes(raw)) return raw as T\n throw new Error(`Invalid '${name}' input: \"${raw}\". Must be one of: ${valid.join(', ')}`)\n}\n\n/**\n * Like {@link parseEnum} but passes through `undefined`. Used for inputs that\n * are optional but, when set, must be one of a known set.\n */\nfunction parseOptionalEnum(\n name: string,\n raw: string | undefined,\n valid: readonly T[],\n): T | undefined {\n return raw === undefined ? undefined : parseEnum(name, raw, valid)\n}\n\nfunction required(name: string): string {\n // `@actions/core` throws on missing required inputs, so this never returns\n // empty. Wrapping the call only exists so the throw site has a uniform\n // shape with the rest of the input parsers.\n return core.getInput(name, { required: true })\n}\n\nfunction optional(name: string): string | undefined {\n const v = core.getInput(name)\n return v === '' ? undefined : v\n}\n\nfunction optionalSource(action: ActionName, allowBucketPurge: boolean): string | undefined {\n const v = core.getInput('source')\n if (v !== '') return v\n return action === 'purge' && allowBucketPurge ? '' : undefined\n}\n\nfunction addSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined || value === '') return\n const trimmed = value.trim()\n for (const secret of new Set([value, trimmed])) {\n if (secret === '' || secretValues.has(secret)) continue\n core.setSecret(secret)\n secretValues.add(secret)\n }\n}\n\nfunction addSseSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined) return\n const normalized = value.trim()\n if (normalized === '' || normalized.toUpperCase() === 'B2') return\n\n addSecretValue(secretValues, value)\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n addSecretValue(secretValues, normalized.slice(2).trim())\n }\n}\n\nfunction resolveCredential(inputName: string, envName: string): string {\n const fromInput = optional(inputName)\n if (fromInput !== undefined) return fromInput\n\n const fromEnv = process.env[envName]\n if (fromEnv !== undefined && fromEnv !== '') return fromEnv\n\n throw new Error(`Missing credential: set input '${inputName}' or env var '${envName}'`)\n}\n\n/**\n * Parse a comma-separated action input, trimming entries and dropping blanks.\n *\n * @internal\n */\nexport function splitCsv(value: string | undefined): string[] {\n if (value === undefined) return []\n return value\n .split(',')\n .map((s) => s.trim())\n .filter((s) => s.length > 0)\n}\n\n/**\n * Parse the documented boolean input spellings accepted by this action.\n *\n * @internal\n */\nexport function parseBool(name: string, raw: string): boolean {\n const v = raw.trim().toLowerCase()\n if (v === 'true' || v === '1' || v === 'yes') return true\n if (v === 'false' || v === '0' || v === 'no') return false\n throw new Error(`Invalid boolean for '${name}': \"${raw}\"`)\n}\n\n/**\n * Parse a strictly positive integer input.\n *\n * @internal\n */\nexport function parsePositiveInt(name: string, raw: string): number {\n const trimmed = raw.trim()\n const n = Number(trimmed)\n if (!/^\\d+$/.test(trimmed) || n <= 0 || !Number.isSafeInteger(n)) {\n throw new Error(`Invalid positive integer for '${name}': \"${raw}\"`)\n }\n return n\n}\n","import * as core from '@actions/core'\nimport type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link copyCommand}. Single-file (copy is always one-source-one-destination). */\nexport interface CopyResult {\n /** Source bucket name. */\n sourceBucket: string\n /** Source file name (the B2 key in the source bucket). */\n sourceFileName: string\n /** Destination bucket name. */\n destinationBucket: string\n /** Destination file name (the B2 key in the destination bucket). */\n destinationFileName: string\n /** B2 file ID of the newly-created destination object. */\n fileId: string\n /** Byte size of the copied object. */\n size: number\n}\n\n/**\n * Server-side copy of one B2 object to a new name, within the same bucket or\n * across two buckets in the same account.\n *\n * The copy is done by reference (`b2_copy_file` for small, `b2_copy_part` for\n * large): bytes never traverse the runner. This is dramatically faster and\n * cheaper than download-then-reupload for any non-trivial file.\n *\n * Cross-bucket: set `source-bucket` to the source bucket name. The action's\n * `bucket` input is the destination. The application key must have read\n * permission on the source bucket and write permission on the destination.\n */\nexport async function copyCommand(\n client: B2Client,\n destinationBucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'copy', 'the source B2 file name')\n const destination = inputs.destination\n if (destination === undefined || destination === '') {\n throw new Error(\n \"'destination' input is required for 'copy' action (the destination B2 file name)\",\n )\n }\n\n const sourceBucketName = inputs.sourceBucket ?? destinationBucket.name\n const sourceBucket =\n sourceBucketName === destinationBucket.name\n ? destinationBucket\n : await client.getBucket(sourceBucketName)\n if (!sourceBucket) {\n throw new Error(`Source bucket \"${sourceBucketName}\" not found, or key lacks listBuckets.`)\n }\n\n const hit = await findFileByName(sourceBucket, source, sourceBucketName)\n\n core.startGroup(\n `copy b2://${sourceBucketName}/${source} → b2://${destinationBucket.name}/${destination}`,\n )\n try {\n const recommendedPartSize = client.accountInfo.getRecommendedPartSize()\n const isLarge = hit.contentLength > recommendedPartSize\n const copyOptions = {\n sourceFileId: hit.fileId,\n fileName: destination,\n ...(sourceBucketName !== destinationBucket.name\n ? { destinationBucketId: destinationBucket.id }\n : {}),\n }\n\n const result = isLarge\n ? await destinationBucket.copyLargeFile({\n ...copyOptions,\n ...(signal !== undefined ? { signal } : {}),\n })\n : await destinationBucket.copyFile(copyOptions)\n\n core.info(` copied → fileId=${result.fileId}, size=${result.contentLength}`)\n return {\n sourceBucket: sourceBucketName,\n sourceFileName: source,\n destinationBucket: destinationBucket.name,\n destinationFileName: destination,\n fileId: result.fileId,\n size: result.contentLength,\n }\n } finally {\n core.endGroup()\n }\n}\n","import type {\n Bucket,\n DeleteAllDeleteEvent,\n DeleteAllErrorEvent,\n DeleteAllSkipEvent,\n FileAction,\n} from '@backblaze-labs/b2-sdk'\n\nconst DELETE_FAILED_MESSAGE = 'delete failed'\nconst OUT_OF_PREFIX_MESSAGE = 'listed file is outside requested prefix'\n\n// SDK-deleteAll-compatible events with local extensions for this bypass-governance shim.\nexport type DeleteAllVersionsDeleteEvent = DeleteAllDeleteEvent & {\n readonly action: FileAction\n}\n\nexport type DeleteAllVersionsEvent =\n | DeleteAllVersionsDeleteEvent\n | DeleteAllErrorEvent\n | DeleteAllSkipEvent\n\nexport interface DeleteAllVersionsOptions {\n prefix?: string\n dryRun: boolean\n bypassGovernance: boolean\n signal?: AbortSignal\n}\n\nexport async function* deleteAllVersions(\n bucket: Bucket,\n options: DeleteAllVersionsOptions,\n): AsyncGenerator {\n const versions = bucket.paginateFileVersions({\n ...(options.prefix !== undefined ? { prefix: options.prefix } : {}),\n ...(options.signal !== undefined ? { signal: options.signal } : {}),\n })\n\n while (true) {\n options.signal?.throwIfAborted()\n const next = await versions.next()\n options.signal?.throwIfAborted()\n if (next.done === true) break\n\n const version = next.value\n if (options.prefix !== undefined && !version.fileName.startsWith(options.prefix)) {\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: OUT_OF_PREFIX_MESSAGE,\n }\n continue\n }\n\n if (options.dryRun) {\n yield { type: 'skip', fileName: version.fileName, fileId: version.fileId }\n continue\n }\n\n options.signal?.throwIfAborted()\n try {\n if (options.bypassGovernance) {\n await bucket.deleteFileVersion(version.fileName, version.fileId, {\n bypassGovernance: true,\n })\n } else {\n await bucket.deleteFileVersion(version.fileName, version.fileId)\n }\n yield {\n type: 'delete',\n fileName: version.fileName,\n fileId: version.fileId,\n action: version.action,\n }\n } catch (error) {\n options.signal?.throwIfAborted()\n if (isAbortError(error)) throw error\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: DELETE_FAILED_MESSAGE,\n }\n }\n\n options.signal?.throwIfAborted()\n }\n}\n\nfunction isAbortError(error: unknown): boolean {\n return error instanceof Error && error.name === 'AbortError'\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link DeleteResult.files}. */\nexport interface DeletedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** True for dry-run previews; the file was not actually deleted. */\n skipped: boolean\n}\n\n/** Result of {@link deleteCommand}. */\nexport interface DeleteResult {\n /** One entry per matched file version (including hide markers). */\n files: DeletedFile[]\n /** Count of individual-file delete failures (non-fatal; sums into the dispatcher's `core.setFailed`). */\n errors: number\n}\n\n/**\n * Delete files from B2.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and delete every version\n * matching it.\n * - Otherwise delete the single file by name. We look up the latest version\n * via `listFileNames` to get its `fileId` and call `deleteFileVersion`.\n *\n * With `dry-run: true`, no actual deletions happen; the action reports what\n * would have been deleted.\n */\nexport async function deleteCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'delete', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n if (isPrefix) {\n return deletePrefix(bucket, source, inputs.dryRun, inputs.bypassGovernance, signal)\n }\n return deleteOne(bucket, source, inputs.dryRun, inputs.bypassGovernance)\n}\n\nasync function deletePrefix(\n bucket: Bucket,\n prefix: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n signal?: AbortSignal,\n): Promise {\n const files: DeletedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} prefix b2://${bucket.name}/${prefix}`)\n try {\n for await (const event of deleteAllVersions(bucket, {\n prefix,\n dryRun,\n bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n })) {\n if (event.type === 'delete') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: false })\n core.info(` deleted ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: true })\n core.info(` would delete ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to delete ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n\nasync function deleteOne(\n bucket: Bucket,\n fileName: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n): Promise {\n const hit = await findFileByName(bucket, fileName)\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} b2://${bucket.name}/${fileName}`)\n try {\n if (dryRun) {\n core.info(` would delete ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: true }],\n errors: 0,\n }\n }\n if (bypassGovernance) {\n await bucket.deleteFileVersion(fileName, hit.fileId, { bypassGovernance: true })\n } else {\n await bucket.deleteFileVersion(fileName, hit.fileId)\n }\n core.info(` deleted ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: false }],\n errors: 0,\n }\n } finally {\n core.endGroup()\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream/promises\");","import type { DownloadCallOptions } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from './inputs.ts'\n\nexport type DownloadHeaderOverrides = Pick<\n DownloadCallOptions,\n 'b2CacheControl' | 'b2ContentDisposition' | 'b2ContentType'\n>\n\nconst DOWNLOAD_OVERRIDE_QUERY_PARAMS = {\n b2ContentDisposition: 'b2ContentDisposition',\n b2ContentType: 'b2ContentType',\n b2CacheControl: 'b2CacheControl',\n} as const satisfies Record\n\nexport function downloadHeaderOverridesFromInputs(inputs: ParsedInputs): DownloadHeaderOverrides {\n return {\n ...(inputs.contentDisposition !== undefined\n ? { b2ContentDisposition: inputs.contentDisposition }\n : {}),\n ...(inputs.responseContentType !== undefined\n ? { b2ContentType: inputs.responseContentType }\n : {}),\n ...(inputs.cacheControl !== undefined ? { b2CacheControl: inputs.cacheControl } : {}),\n }\n}\n\nexport function appendDownloadHeaderOverrides(\n url: string,\n overrides: DownloadHeaderOverrides,\n): string {\n const entries = Object.entries(DOWNLOAD_OVERRIDE_QUERY_PARAMS) as Array<\n [keyof DownloadHeaderOverrides, string]\n >\n if (entries.every(([key]) => overrides[key] === undefined)) return url\n\n const parsed = new URL(url)\n for (const [key, param] of entries) {\n const value = overrides[key]\n if (value !== undefined) {\n parsed.searchParams.set(param, value)\n }\n }\n return parsed.toString()\n}\n","import type { Stats } from 'node:fs'\nimport { stat } from 'node:fs/promises'\n\n/**\n * `stat(path)` that returns `undefined` instead of throwing on ENOENT/EACCES\n * etc. Used at filesystem boundaries where the caller wants to distinguish\n * \"doesn't exist / not readable\" from \"exists with shape X\" without juggling\n * try/catch at every call site.\n */\nexport async function tryStat(path: string): Promise {\n return stat(path).catch(() => undefined)\n}\n","/**\n * Format a byte count with KB/MB/GB suffixes.\n *\n * Single source of truth so the workflow log (progress.ts) and the step\n * summary table (summary.ts) never drift on thresholds or rounding.\n */\nexport function formatBytes(n: number): string {\n if (n < 1024) return `${n} B`\n if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`\n if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`\n return `${(n / 1024 / 1024 / 1024).toFixed(2)} GB`\n}\n","import * as core from '@actions/core'\nimport type { ProgressEvent, ProgressListener } from '@backblaze-labs/b2-sdk'\nimport { formatBytes } from './format.ts'\n\n/**\n * Build a progress listener that throttles output to one update per\n * `intervalMs` (default 1s) so a long-running upload doesn't flood the\n * workflow log with thousands of lines. The first event and the final\n * event are always emitted.\n */\nexport function makeProgressListener(label: string, intervalMs = 1000): ProgressListener {\n let lastEmit = 0\n let lastBytes = 0\n let lastTime = Date.now()\n\n return (event: ProgressEvent) => {\n const now = Date.now()\n const isFirst = lastEmit === 0\n const isFinal = event.totalBytes !== null && event.bytesTransferred >= event.totalBytes\n const due = now - lastEmit >= intervalMs\n\n if (!isFirst && !isFinal && !due) return\n\n const elapsedMs = Math.max(1, now - lastTime)\n const deltaBytes = event.bytesTransferred - lastBytes\n const mbps = (deltaBytes / 1024 / 1024) * (1000 / elapsedMs)\n\n const pct =\n event.totalBytes !== null && event.totalBytes > 0\n ? `${Math.round((event.bytesTransferred / event.totalBytes) * 100)}%`\n : '?%'\n\n const parts =\n event.totalParts !== null ? ` (${event.partsCompleted}/${event.totalParts} parts)` : ''\n\n const totalSuffix = event.totalBytes !== null ? ` / ${formatBytes(event.totalBytes)}` : ''\n core.info(\n `${label} ${pct}${parts} ${formatBytes(event.bytesTransferred)}${totalSuffix} @ ${mbps.toFixed(2)} MB/s`,\n )\n\n lastEmit = now\n lastBytes = event.bytesTransferred\n lastTime = now\n }\n}\n","import { randomUUID } from 'node:crypto'\nimport { createWriteStream } from 'node:fs'\nimport { mkdir, realpath, rename, unlink, writeFile } from 'node:fs/promises'\nimport { dirname, isAbsolute, relative, resolve, sep } from 'node:path'\nimport { Readable, Transform } from 'node:stream'\nimport { pipeline } from 'node:stream/promises'\nimport * as core from '@actions/core'\nimport type { Bucket, SseCDownloadKey } from '@backblaze-labs/b2-sdk'\nimport {\n type DownloadHeaderOverrides,\n downloadHeaderOverridesFromInputs,\n} from '../download-overrides.ts'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link DownloadResult.files}. */\nexport interface DownloadedFile {\n /** B2 file name (the key that was fetched). */\n fileName: string\n /** Absolute path on the runner where the body landed. */\n localPath: string\n /** Byte size of the downloaded body. */\n size: number\n /** Remote SHA-1, or `null` if the file was multipart-uploaded (B2 doesn't store a whole-file SHA-1 in that case). */\n contentSha1: string | null\n}\n\n/** Result of {@link downloadCommand}. */\nexport interface DownloadResult {\n /** One entry per downloaded file. Single-file modes return a one-element array. */\n files: DownloadedFile[]\n /** Total bytes transferred across all files. */\n bytesTransferred: number\n}\n\ninterface PathSafetyContext {\n realRoot: string\n safeAncestorDirs: Set\n}\n\ninterface DownloadPathSafety {\n root: string\n realRoot: string\n}\n\ninterface PlannedDownload {\n fileName: string\n localPath: string\n}\n\ninterface LocalPathOwner {\n fileName: string\n localPath: string\n}\n\ninterface ReplaceDownloadedFileOptions {\n platform?: NodeJS.Platform\n renameFile?: typeof rename\n unlinkFile?: typeof unlink\n}\n\n/**\n * Download from B2 to the local runner.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and download every file\n * under it to the local directory at `destination` (defaults to `.`).\n * - Otherwise download a single file. If `destination` ends with `/` or\n * resolves to an existing directory, write into that directory using the\n * basename of `source`. Else `destination` is the exact output file path.\n * If unset, the file's basename is used in the current working directory.\n */\nexport async function downloadCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'download', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n const sseDownload = sseFromInputs(inputs)\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n\n if (isPrefix) {\n return downloadPrefix(\n bucket,\n source,\n inputs.destination ?? '.',\n sseDownload,\n downloadOverrides,\n signal,\n )\n }\n const out = await downloadOne(\n bucket,\n source,\n inputs.destination,\n sseDownload,\n downloadOverrides,\n signal,\n )\n return { files: [out], bytesTransferred: out.size }\n}\n\nfunction sseFromInputs(inputs: ParsedInputs): SseCDownloadKey | undefined {\n const e = inputs.encryption\n if (e === undefined || e.mode !== 'SSE-C') return undefined\n return {\n algorithm: 'AES256',\n customerKey: e.customerKey,\n customerKeyMd5: e.customerKeyMd5,\n }\n}\n\nasync function downloadPrefix(\n bucket: Bucket,\n prefix: string,\n destinationDir: string,\n sseDownload: SseCDownloadKey | undefined,\n downloadOverrides: DownloadHeaderOverrides,\n signal?: AbortSignal,\n): Promise {\n const destRoot = resolve(destinationDir)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n const downloadPathSafety = { root: destRoot, realRoot: pathSafety.realRoot }\n const caseInsensitivePaths = await isCaseInsensitiveDirectory(destRoot)\n\n const planned: PlannedDownload[] = []\n const localPathOwners = new Map()\n const localPathAncestorOwners = new Map()\n let startFileName: string | undefined\n\n for (;;) {\n signal?.throwIfAborted()\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n signal?.throwIfAborted()\n // `listFileNames({ prefix })` returns files matching `prefix` per the\n // SDK / B2 contract, so the slice is always safe. Empty `prefix`\n // leaves the name unchanged.\n const relName = f.fileName.slice(prefix.length)\n const localPath = await resolvePathUnderRoot(\n destRoot,\n safeRemotePathSegments(relName, f.fileName),\n f.fileName,\n pathSafety,\n )\n recordPlannedLocalPath(\n { fileName: f.fileName, localPath },\n destRoot,\n caseInsensitivePaths,\n localPathOwners,\n localPathAncestorOwners,\n )\n planned.push({ fileName: f.fileName, localPath })\n }\n // SDK contract: `nextFileName` is `string | null` per `ListFileNamesResponse`.\n // The \"not null\" arm fires for prefixes with >1000 files (covered by\n // the real-pagination test in coverage-stress).\n if (page.nextFileName === null) break\n startFileName = page.nextFileName\n }\n\n const files: DownloadedFile[] = []\n let total = 0\n for (const plan of planned) {\n signal?.throwIfAborted()\n core.startGroup(`download b2://${bucket.name}/${plan.fileName} → ${plan.localPath}`)\n try {\n const r = await downloadOne(\n bucket,\n plan.fileName,\n plan.localPath,\n sseDownload,\n downloadOverrides,\n signal,\n downloadPathSafety,\n )\n files.push(r)\n total += r.size\n } finally {\n core.endGroup()\n }\n }\n\n return { files, bytesTransferred: total }\n}\n\nasync function downloadOne(\n bucket: Bucket,\n fileName: string,\n destination: string | undefined,\n sseDownload: SseCDownloadKey | undefined,\n downloadOverrides: DownloadHeaderOverrides,\n signal?: AbortSignal,\n pathSafety?: DownloadPathSafety,\n): Promise {\n const localPath =\n pathSafety !== undefined && destination !== undefined\n ? resolve(destination)\n : await resolveLocalPath(fileName, destination)\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n await mkdir(dirname(localPath), { recursive: true })\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n\n const result = await bucket.download(fileName, {\n ...(sseDownload !== undefined ? { serverSideEncryption: sseDownload } : {}),\n ...downloadOverrides,\n ...(signal !== undefined ? { signal } : {}),\n })\n const size = result.headers.contentLength\n const sha1 = result.headers.contentSha1\n\n // Wrap the body in a byte-counting Transform that synthesizes ProgressEvents\n // for the shared progress listener. The SDK doesn't expose progress for\n // single-shot downloads; we compute it here from the known content-length.\n const onProgress = makeProgressListener(`download[${fileName}]`)\n const startedAt = Date.now()\n let bytesSeen = 0\n const counter = new Transform({\n transform(chunk: Buffer, _enc, cb) {\n // The transform only runs when the body has bytes to push; for a zero-\n // length response Node's stream pipeline closes without invoking it,\n // so `size` is provably > 0 here.\n bytesSeen += chunk.length\n onProgress({\n bytesTransferred: bytesSeen,\n totalBytes: size,\n partsCompleted: 0,\n totalParts: null,\n elapsedMs: Date.now() - startedAt,\n })\n cb(null, chunk)\n },\n })\n\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n const tempPath = `${localPath}.b2-action-download-${randomUUID()}.tmp`\n const writeStream = createWriteStream(tempPath, { flags: 'wx' })\n try {\n await pipeline(\n Readable.fromWeb(result.body as unknown as Parameters[0]),\n counter,\n writeStream,\n )\n await replaceDownloadedFile(tempPath, localPath)\n } catch (err) {\n // Partial download on disk is worse than no file. Write through a\n // same-directory temporary file and rename only after the body completes,\n // which also avoids following an existing symlink at the final leaf.\n try {\n await unlink(tempPath)\n } catch {\n // ignore: best-effort cleanup, the original error matters more\n }\n throw err\n }\n\n core.info(` wrote ${size} bytes to ${localPath} (sha1=${sha1 ?? 'multipart'})`)\n\n return { fileName, localPath, size, contentSha1: sha1 }\n}\n\n/**\n * Atomically move a completed same-directory download into place.\n *\n * @internal\n */\nexport async function replaceDownloadedFile(\n tempPath: string,\n localPath: string,\n {\n platform = process.platform,\n renameFile = rename,\n unlinkFile = unlink,\n }: ReplaceDownloadedFileOptions = {},\n): Promise {\n try {\n await renameFile(tempPath, localPath)\n } catch (renameError) {\n const retryWindowsOverwrite =\n platform === 'win32' &&\n typeof renameError === 'object' &&\n renameError !== null &&\n 'code' in renameError &&\n (renameError.code === 'EEXIST' || renameError.code === 'EPERM')\n if (!retryWindowsOverwrite) throw renameError\n\n // Windows refuses to rename over an existing leaf. Remove only the leaf\n // path, which unlinks symlinks instead of following them, then retry the\n // completed same-directory temp-file move.\n try {\n await unlinkFile(localPath)\n } catch (unlinkError) {\n if (!isFileNotFound(unlinkError)) throw unlinkError\n }\n await renameFile(tempPath, localPath)\n }\n}\n\n/**\n * Resolve the local target path for a single B2 download.\n *\n * @internal\n */\nexport async function resolveLocalPath(\n fileName: string,\n destination: string | undefined,\n): Promise {\n if (destination === undefined || destination === '') {\n return resolve(safeRemotePathTail(fileName))\n }\n if (destination.endsWith('/') || destination.endsWith('\\\\')) {\n const destRoot = resolve(destination)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n const s = await tryStat(destination)\n if (s?.isDirectory()) {\n const destRoot = resolve(destination)\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n return resolve(destination)\n}\n\nasync function resolvePathUnderRoot(\n root: string,\n segments: string[],\n fileName: string,\n pathSafety: PathSafetyContext,\n) {\n const localPath = resolve(root, ...segments)\n const rel = relative(root, localPath)\n if (!isPathInsideRootRelative(rel)) {\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n }\n await assertExistingAncestryInsideRoot(pathSafety, localPath, fileName)\n return localPath\n}\n\nfunction isPathInsideRootRelative(rel: string): boolean {\n return rel === '' || (!isAbsolute(rel) && rel !== '..' && !rel.startsWith(`..${sep}`))\n}\n\nasync function createPathSafetyContext(root: string): Promise {\n return { realRoot: await realpath(root), safeAncestorDirs: new Set([root]) }\n}\n\nasync function assertFreshAncestryInsideRoot(\n pathSafety: DownloadPathSafety,\n localPath: string,\n fileName: string,\n): Promise {\n await assertExistingAncestryInsideRoot(\n { realRoot: pathSafety.realRoot, safeAncestorDirs: new Set() },\n localPath,\n fileName,\n )\n}\n\nasync function assertExistingAncestryInsideRoot(\n pathSafety: PathSafetyContext,\n localPath: string,\n fileName: string,\n): Promise {\n let candidate = dirname(localPath)\n const checkedDirs: string[] = []\n\n for (;;) {\n if (pathSafety.safeAncestorDirs.has(candidate)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n checkedDirs.push(candidate)\n try {\n const realCandidate = await realpath(candidate)\n const rel = relative(pathSafety.realRoot, realCandidate)\n if (isPathInsideRootRelative(rel)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n } catch (error) {\n if (!isFileNotFound(error)) throw error\n const parent = dirname(candidate)\n if (parent === candidate) throw error\n candidate = parent\n }\n }\n}\n\nfunction isFileNotFound(error: unknown): boolean {\n return typeof error === 'object' && error !== null && 'code' in error && error.code === 'ENOENT'\n}\n\nasync function isCaseInsensitiveDirectory(dir: string): Promise {\n const marker = `.b2-action-case-check-${randomUUID()}`\n const lowerPath = resolve(dir, marker.toLowerCase())\n const upperPath = resolve(dir, marker.toUpperCase())\n\n try {\n await writeFile(lowerPath, '')\n } catch (error) {\n core.warning(\n `Could not probe case sensitivity in ${dir}; treating download collision checks as case-sensitive (${error instanceof Error ? error.message : String(error)})`,\n )\n return false\n }\n try {\n try {\n return (await realpath(lowerPath)) === (await realpath(upperPath))\n } catch (error) {\n if (isFileNotFound(error)) return false\n throw error\n }\n } finally {\n try {\n await unlink(lowerPath)\n } catch (error) {\n core.warning(\n `Could not remove B2 action case-sensitivity probe ${lowerPath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n}\n\nfunction localPathCollisionKey(localPath: string, caseInsensitivePaths: boolean): string {\n return caseInsensitivePaths ? localPath.toLowerCase() : localPath\n}\n\nfunction recordPlannedLocalPath(\n owner: LocalPathOwner,\n root: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n localPathAncestorOwners: Map,\n): void {\n const collisionKey = localPathCollisionKey(owner.localPath, caseInsensitivePaths)\n const existingFile = localPathOwners.get(collisionKey)\n if (existingFile !== undefined && existingFile.fileName !== owner.fileName) {\n throw new Error(\n `download path collision: B2 files \"${existingFile.fileName}\" and \"${owner.fileName}\" both map to \"${owner.localPath}\"`,\n )\n }\n\n const existingDescendant = localPathAncestorOwners.get(collisionKey)\n if (existingDescendant !== undefined && existingDescendant.fileName !== owner.fileName) {\n throwFileDirectoryCollision(owner, existingDescendant)\n }\n\n const existingAncestor = findLocalPathFileAncestor(\n root,\n owner.localPath,\n caseInsensitivePaths,\n localPathOwners,\n )\n if (existingAncestor !== undefined && existingAncestor.fileName !== owner.fileName) {\n throwFileDirectoryCollision(existingAncestor, owner)\n }\n\n localPathOwners.set(collisionKey, owner)\n rememberLocalPathAncestors(root, owner, caseInsensitivePaths, localPathAncestorOwners)\n}\n\nfunction findLocalPathFileAncestor(\n root: string,\n localPath: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n): LocalPathOwner | undefined {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return undefined\n const owner = localPathOwners.get(parentKey)\n if (owner !== undefined) return owner\n const next = dirname(parent)\n if (next === parent) return undefined\n parent = next\n }\n}\n\nfunction rememberLocalPathAncestors(\n root: string,\n owner: LocalPathOwner,\n caseInsensitivePaths: boolean,\n localPathAncestorOwners: Map,\n): void {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(owner.localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return\n if (!localPathAncestorOwners.has(parentKey)) localPathAncestorOwners.set(parentKey, owner)\n const next = dirname(parent)\n if (next === parent) return\n parent = next\n }\n}\n\nfunction throwFileDirectoryCollision(\n fileOwner: LocalPathOwner,\n descendantOwner: LocalPathOwner,\n): never {\n throw new Error(\n `download path collision: B2 file \"${fileOwner.fileName}\" maps to \"${fileOwner.localPath}\", which must be a file, but B2 file \"${descendantOwner.fileName}\" maps beneath it at \"${descendantOwner.localPath}\"`,\n )\n}\n\nfunction safeRemotePathSegments(fileName: string, displayName = fileName): string[] {\n const segments = fileName.split('/')\n for (const segment of segments) {\n validateRemotePathSegment(segment, displayName)\n }\n return segments\n}\n\nfunction safeRemotePathTail(fileName: string): string {\n const tail = fileName.split('/').at(-1) ?? ''\n validateRemotePathSegment(tail, fileName)\n return tail\n}\n\nfunction validateRemotePathSegment(segment: string, fileName: string): void {\n if (segment === '' || segment === '.' || segment === '..') {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains an empty, \".\" or \"..\" path segment`,\n )\n }\n for (const char of segment) {\n const codePoint = char.codePointAt(0)\n if (codePoint !== undefined && (codePoint <= 0x1f || codePoint === 0x7f)) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains a control character`,\n )\n }\n }\n\n // B2 keys are opaque, but prefix downloads must project `/`-separated\n // keys into the runner filesystem without path traversal or lossy rewrites.\n // POSIX runners can preserve characters such as `:`, `?`, trailing dots,\n // and Windows device names verbatim. Windows treats several of those as\n // separators or invalid/reserved filenames, so reject them there instead of\n // silently changing the on-disk name or risking two B2 keys overwriting one\n // local path.\n if (\n process.platform === 'win32' &&\n (/[<>:\"|?*\\\\]/u.test(segment) ||\n /[. ]$/u.test(segment) ||\n /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/iu.test(segment))\n ) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped on Windows because segment \"${segment}\" is reserved or contains a Windows path character`,\n )\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link headCommand}: metadata read from a HEAD request, no body. */\nexport interface HeadResult {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file (from `Content-Length`). */\n size: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** B2-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Custom `X-Bz-Info-*` headers attached at upload time. */\n fileInfo: Record\n}\n\n/**\n * HEAD-only metadata probe. Fetches the headers of an object without\n * downloading the body. Useful for cheap \"does this exist and what's its\n * size / sha1 / contentType?\" checks, or to inspect custom `fileInfo`\n * metadata that the uploader attached.\n *\n * Returns all output fields as step outputs so downstream steps can branch\n * on them.\n */\nexport async function headCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'head', 'the B2 file name')\n\n core.startGroup(`head b2://${bucket.name}/${source}`)\n try {\n // `bucket.head` returns only the parsed response headers; no body to\n // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n const { headers: h } = await bucket.head(source)\n core.info(\n ` size=${h.contentLength} type=${h.contentType} sha1=${h.contentSha1 ?? 'multipart'}`,\n )\n return {\n fileName: h.fileName,\n fileId: h.fileId,\n size: h.contentLength,\n contentType: h.contentType,\n contentSha1: h.contentSha1,\n uploadTimestamp: h.uploadTimestamp,\n fileInfo: h.fileInfo,\n }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link hideCommand}: identifies the hide marker that was just created. */\nexport interface HideResult {\n /** B2 file name that was hidden. */\n fileName: string\n /** File ID of the hide marker (a special version with `action: 'hide'`). */\n fileId: string\n}\n\n/**\n * Hide a file in B2 (creates a \"hide marker\" file version that masks the\n * previous version from `listFileNames` and downloads-by-name).\n *\n * Versioning is always on in B2, so hide is a soft-delete: the underlying\n * data and prior versions remain until lifecycle rules collect them. To\n * permanently delete, use the `delete` command.\n *\n * To unhide, run `delete` against the hide marker's `fileId` (use `list`\n * with versions if you need to discover it).\n */\nexport async function hideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'hide', 'the B2 file name')\n\n core.startGroup(`hide b2://${bucket.name}/${source}`)\n try {\n const result = await bucket.hideFile(source)\n core.info(` hidden: ${result.fileName} (marker fileId=${result.fileId})`)\n return { fileName: result.fileName, fileId: result.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\n\n/** One entry in {@link ListResult.files}. Mirrors the SDK's per-version metadata. */\nexport interface ListedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file. */\n size: number\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** Server-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Custom `X-Bz-Info-*` headers from upload time. */\n fileInfo: Record\n}\n\n/** Result of {@link listCommand}. */\nexport interface ListResult {\n /** Files matching the prefix, capped by `maxResults`. */\n files: ListedFile[]\n /** True when more visible upload files exist beyond `maxResults`. Use to detect pagination. */\n truncated: boolean\n}\n\n/**\n * List file names under a prefix.\n *\n * `source` is the prefix (use trailing `/` to list a \"directory\"). Empty\n * `source` lists everything the application key is allowed to see. Pagination\n * is followed transparently up to `max-results` matches.\n *\n * Useful for \"decide what to do next\" workflow steps:\n * - inventory before a delete\n * - find the most recent release artifact to promote\n * - emit a JSON manifest as a build output\n */\nexport async function listCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const prefix = inputs.source ?? ''\n const maxResults = inputs.maxResults\n const files: ListedFile[] = []\n let startFileName: string | undefined\n\n core.startGroup(`list b2://${bucket.name}/${prefix} (max ${maxResults})`)\n try {\n while (files.length < maxResults) {\n const remaining = maxResults - files.length\n const pageSize = Math.min(1000, remaining)\n const page = await bucket.listFileNames({\n prefix,\n pageSize,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n files.push({\n fileName: f.fileName,\n fileId: f.fileId,\n size: f.contentLength,\n contentSha1: f.contentSha1,\n uploadTimestamp: f.uploadTimestamp,\n contentType: f.contentType,\n fileInfo: f.fileInfo,\n })\n if (files.length >= maxResults) {\n if (!page.nextFileName) return { files, truncated: false }\n return {\n files,\n truncated: await hasVisibleUploadAfter(bucket, prefix, page.nextFileName),\n }\n }\n }\n\n if (!page.nextFileName) {\n return { files, truncated: false }\n }\n startFileName = page.nextFileName\n }\n\n return { files, truncated: true }\n } finally {\n core.info(` ${files.length} file(s) listed`)\n core.endGroup()\n }\n}\n\nasync function hasVisibleUploadAfter(\n bucket: Bucket,\n prefix: string,\n startFileName: string,\n): Promise {\n let cursor: string | undefined = startFileName\n\n while (cursor !== undefined) {\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n startFileName: cursor,\n })\n if (page.files.some((f) => f.action === 'upload')) return true\n cursor = page.nextFileName ?? undefined\n }\n\n return false\n}\n","function createS3ClientConfig(config) {\n const s3Url = config.accountInfo.getS3ApiUrl();\n const regionMatch = s3Url.match(/s3\\.([^.]+)\\.backblazeb2\\.com/);\n const region = config.region ?? regionMatch?.[1] ?? \"us-west-004\";\n return {\n endpoint: s3Url,\n region,\n credentials: {\n accessKeyId: config.applicationKeyId,\n secretAccessKey: config.applicationKey\n },\n forcePathStyle: true\n };\n}\nfunction presignGetObjectUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds = 3600) {\n const expires = Math.floor(Date.now() / 1e3) + validDurationInSeconds;\n return `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeURIComponent(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;\n}\nexport {\n createS3ClientConfig,\n presignGetObjectUrl\n};\n//# sourceMappingURL=index.js.map\n","import * as core from '@actions/core'\nimport type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'\nimport { presignGetObjectUrl } from '@backblaze-labs/b2-sdk/s3'\nimport {\n appendDownloadHeaderOverrides,\n type DownloadHeaderOverrides,\n downloadHeaderOverridesFromInputs,\n} from '../download-overrides.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** One entry in {@link PresignResult.files}. */\nexport interface PresignedFile {\n /** B2 file name (the key the URL grants access to). */\n fileName: string\n /** Presigned download URL. Masked via `core.setSecret` before this struct is logged. */\n url: string\n /** Expiration time as milliseconds since the epoch. */\n expiresAt: number\n}\n\n/** Result of {@link presignCommand}. */\nexport interface PresignResult {\n /** One entry per generated URL. Single-file mode returns a one-element array. */\n files: PresignedFile[]\n}\n\n/**\n * Generate a presigned download URL for one B2 file or every file under a\n * prefix.\n *\n * Modes:\n * - `source` ending in `/` → prefix mode. List the prefix and emit one\n * presigned URL per file (capped by `max-results`). All URLs share the\n * same `b2_get_download_authorization` token because the auth scope is\n * prefix-based; we just expand it into one URL per matched object.\n * - Otherwise → single-file mode (the original behavior).\n *\n * Every URL is masked via `core.setSecret` so subsequent log lines redact\n * them. The first URL is also exposed as the `presigned-url` step output\n * for the most common one-file workflow.\n */\nexport async function presignCommand(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'presign', 'the B2 file name or prefix')\n\n if (source.endsWith('/')) {\n return presignPrefix(client, bucket, inputs, source)\n }\n\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n return {\n files: [\n await presignOne(client, bucket, source, inputs.presignTtlSeconds, source, downloadOverrides),\n ],\n }\n}\n\nasync function presignPrefix(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n prefix: string,\n): Promise {\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n // One auth token covers the whole prefix (that's exactly what\n // `b2_get_download_authorization` is designed for).\n const auth = await client.raw.getDownloadAuthorization(\n client.accountInfo.getApiUrl(),\n client.accountInfo.getAuthToken(),\n {\n bucketId: bucket.id,\n fileNamePrefix: prefix,\n validDurationInSeconds: inputs.presignTtlSeconds,\n ...downloadOverrides,\n },\n )\n core.setSecret(auth.authorizationToken)\n const expiresAt = Math.floor(Date.now() / 1000) + inputs.presignTtlSeconds\n\n const files: PresignedFile[] = []\n let startFileName: string | undefined\n core.startGroup(`presign prefix b2://${bucket.name}/${prefix} (TTL ${inputs.presignTtlSeconds}s)`)\n try {\n while (files.length < inputs.maxResults) {\n const remaining = inputs.maxResults - files.length\n const page = await bucket.listFileNames({\n prefix,\n pageSize: Math.min(1000, remaining),\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n const url = appendDownloadHeaderOverrides(\n presignGetObjectUrl(\n downloadUrl,\n bucket.name,\n f.fileName,\n auth.authorizationToken,\n inputs.presignTtlSeconds,\n ),\n downloadOverrides,\n )\n core.setSecret(url)\n files.push({ fileName: f.fileName, url, expiresAt })\n if (files.length >= inputs.maxResults) break\n }\n if (!page.nextFileName) break\n startFileName = page.nextFileName\n }\n } finally {\n core.info(` generated ${files.length} presigned URL(s)`)\n core.endGroup()\n }\n return { files }\n}\n\nasync function presignOne(\n client: B2Client,\n bucket: Bucket,\n fileName: string,\n ttlSeconds: number,\n authPrefix: string,\n downloadOverrides: DownloadHeaderOverrides,\n): Promise {\n const auth = await client.raw.getDownloadAuthorization(\n client.accountInfo.getApiUrl(),\n client.accountInfo.getAuthToken(),\n {\n bucketId: bucket.id,\n fileNamePrefix: authPrefix,\n validDurationInSeconds: ttlSeconds,\n ...downloadOverrides,\n },\n )\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const url = appendDownloadHeaderOverrides(\n presignGetObjectUrl(downloadUrl, bucket.name, fileName, auth.authorizationToken, ttlSeconds),\n downloadOverrides,\n )\n core.setSecret(auth.authorizationToken)\n core.setSecret(url)\n const expiresAt = Math.floor(Date.now() / 1000) + ttlSeconds\n core.info(`presigned URL for ${fileName} valid for ${ttlSeconds}s (expires at ${expiresAt})`)\n return { fileName, url, expiresAt }\n}\n","import * as core from '@actions/core'\nimport type { Bucket, FileAction } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link PurgeResult.files}. */\nexport interface PurgedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID of the version that was purged. */\n fileId: string\n /** Which kind of version this entry refers to, or `skip` for dry-run previews. */\n action: FileAction | 'skip'\n /** True for dry-run previews; the version was not actually purged. */\n skipped: boolean\n}\n\n/** Result of {@link purgeCommand}. */\nexport interface PurgeResult {\n /** One entry per matched version (live, prior, and hide markers). */\n files: PurgedFile[]\n /** Count of individual-version purge failures. */\n errors: number\n}\n\n/**\n * Permanently delete every file version (including hide markers and historic\n * uploads) under a prefix. Differs from `delete` in that `delete`'s\n * implementation streams over `listFileVersions` and removes all versions,\n * but `purge` makes the wipe-the-prefix intent explicit and warns loudly.\n *\n * If `source` is empty or `/`, this purges the **entire bucket** only when\n * `allow-bucket-purge: true` is also set. Default behavior is to require a\n * scoped prefix so an omitted source cannot become a bucket-wide wipe.\n *\n * Supports `dry-run` to preview what would be deleted.\n */\nexport async function purgeCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const bucketWide = inputs.source === undefined || inputs.source === '' || inputs.source === '/'\n if (bucketWide && !inputs.allowBucketPurge) {\n throw new Error(\n \"'allow-bucket-purge' must be true for whole-bucket purge (set 'source' to a prefix for scoped purge)\",\n )\n }\n const source = inputs.source ?? ''\n const prefix = bucketWide ? '' : source.endsWith('/') ? source : `${source}/`\n const dryRun = inputs.dryRun\n\n if (prefix === '' && !dryRun) {\n core.warning(\n `purge will permanently delete EVERY version in bucket \"${bucket.name}\". Continuing because allow-bucket-purge is true.`,\n )\n }\n\n const files: PurgedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'purge'} b2://${bucket.name}/${prefix} (all versions)`)\n try {\n const opts = {\n ...(prefix !== '' ? { prefix } : {}),\n dryRun,\n bypassGovernance: inputs.bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n }\n for await (const event of deleteAllVersions(bucket, opts)) {\n if (event.type === 'delete') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: event.action,\n skipped: false,\n })\n core.info(` purged ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: 'skip',\n skipped: true,\n })\n core.info(` would purge ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to purge ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link retentionCommand}: describes what was applied to the target version. */\nexport interface RetentionResult {\n /** B2 file name the retention/hold was applied to. */\n fileName: string\n /** B2 file ID of the version that was modified. */\n fileId: string\n /** Retention mode after the call. `none` means retention was cleared. Undefined if only legal-hold was touched. */\n appliedMode: 'compliance' | 'governance' | 'none' | undefined\n /** Retention expiration timestamp (ms since the epoch). `null` when mode is `none`. */\n retainUntilTimestamp: number | null | undefined\n /** Legal-hold state after the call. Undefined when not touched by this invocation. */\n appliedLegalHold: 'on' | 'off' | undefined\n}\n\n/**\n * Apply Object Lock retention settings and/or a legal hold to a specific\n * file version.\n *\n * The bucket must have Object Lock enabled. Three inputs drive this command:\n * - `retention-mode`: `compliance` | `governance` | `none`. Required if\n * `retention-until` is set.\n * - `retention-until`: ISO 8601 timestamp (e.g. `2027-01-01T00:00:00Z`).\n * Required if `retention-mode` is `compliance` or `governance`.\n * - `legal-hold`: `on` | `off`. Independent of retention; can be set on\n * its own or alongside retention.\n * - `bypass-governance` (bool): allows shortening a governance retention.\n *\n * At least one of `retention-mode` / `legal-hold` must be supplied.\n *\n * The target file version is resolved by exact name only when the latest\n * version is an upload.\n */\nexport async function retentionCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'retention', 'the B2 file name')\n\n const mode = inputs.retentionMode\n const until = inputs.retentionUntil\n const legalHold = inputs.legalHold\n\n if (mode === undefined && legalHold === undefined) {\n throw new Error(\"retention requires at least one of 'retention-mode' or 'legal-hold' to be set\")\n }\n\n // Resolve the retention expiration up front so TypeScript narrows `until`\n // inside the parse branch and the downstream call site doesn't need a cast.\n let retainUntilMillis: number | null = null\n if (mode === 'compliance' || mode === 'governance') {\n if (until === undefined) {\n throw new Error(\n `'retention-until' (ISO 8601 timestamp) is required when 'retention-mode' is '${mode}'`,\n )\n }\n const parsed = Date.parse(until)\n if (Number.isNaN(parsed)) {\n throw new Error(`'retention-until' is not a valid ISO 8601 timestamp: \"${until}\"`)\n }\n // Reject past timestamps client-side. B2 also rejects them server-side\n // but with a generic 400; the action's check fails faster and tells the\n // user exactly what's wrong (especially helpful for timezone-skewed CI\n // runners). Allow a small clock-skew tolerance: anything within the\n // last 30 seconds is treated as \"now\" rather than past.\n const skewToleranceMs = 30_000\n if (parsed < Date.now() - skewToleranceMs) {\n throw new Error(\n `'retention-until' must be in the future; got \"${until}\" (${new Date(parsed).toISOString()})`,\n )\n }\n retainUntilMillis = parsed\n }\n\n // Resolve the file version we're operating on.\n const hit = await findFileByName(bucket, source)\n\n let appliedMode: RetentionResult['appliedMode']\n let retainUntilTimestamp: number | null | undefined\n let appliedLegalHold: RetentionResult['appliedLegalHold']\n\n core.startGroup(`retention b2://${bucket.name}/${source}`)\n try {\n if (mode !== undefined) {\n const retention = {\n mode: mode === 'none' ? null : mode,\n retainUntilTimestamp: retainUntilMillis,\n }\n const result = inputs.bypassGovernance\n ? await bucket.updateFileRetention(source, hit.fileId, retention, {\n bypassGovernance: true,\n })\n : await bucket.updateFileRetention(source, hit.fileId, retention)\n appliedMode = mode\n retainUntilTimestamp = result.fileRetention.retainUntilTimestamp\n core.info(` retention: mode=${mode} retainUntil=${retainUntilMillis}`)\n }\n\n if (legalHold !== undefined) {\n const result = await bucket.updateFileLegalHold(source, hit.fileId, legalHold)\n appliedLegalHold = result.legalHold\n core.info(` legal-hold: ${result.legalHold}`)\n }\n\n return {\n fileName: source,\n fileId: hit.fileId,\n appliedMode,\n retainUntilTimestamp,\n appliedLegalHold,\n }\n } finally {\n core.endGroup()\n }\n}\n","import { collectStream } from \"./collect.js\";\nclass BlobSource {\n /**\n * Create a BlobSource wrapping the given Blob.\n * @param blob - The Blob or File to use as the underlying content.\n */\n constructor(blob) {\n this.blob = blob;\n this.size = blob.size;\n }\n /** {@inheritDoc} */\n size;\n /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */\n canSlice = true;\n /**\n * Return a new BlobSource covering the specified byte range.\n * @param start - The zero-based byte offset to begin the slice.\n * @param end - The exclusive byte offset where the slice ends.\n *\n * @returns A new ContentSource representing the requested sub-range.\n */\n slice(start, end) {\n return new BlobSource(this.blob.slice(start, end));\n }\n /**\n * Open the Blob content as a ReadableStream.\n * @returns A ReadableStream of the Blob bytes.\n */\n stream() {\n return this.blob.stream();\n }\n /**\n * Read the entire Blob content into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n toArrayBuffer() {\n return this.blob.arrayBuffer();\n }\n}\nclass BufferSource {\n /**\n * Create a BufferSource wrapping the given Uint8Array.\n * @param buffer - The byte buffer to use as the underlying content.\n */\n constructor(buffer) {\n this.buffer = buffer;\n this.size = buffer.byteLength;\n }\n /** {@inheritDoc} */\n size;\n /** Random-access: the entire payload lives in memory. */\n canSlice = true;\n /**\n * Return a new BufferSource covering the specified byte range.\n * @param start - The zero-based byte offset to begin the slice.\n * @param end - The exclusive byte offset where the slice ends.\n *\n * @returns A new ContentSource representing the requested sub-range.\n */\n slice(start, end) {\n return new BufferSource(this.buffer.slice(start, end));\n }\n /**\n * Open the buffer content as a ReadableStream.\n * @returns A ReadableStream that emits the buffer bytes in a single chunk.\n */\n stream() {\n const buffer = this.buffer;\n return new ReadableStream({\n start(controller) {\n controller.enqueue(buffer);\n controller.close();\n }\n });\n }\n /**\n * Read the entire buffer content into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n toArrayBuffer() {\n return Promise.resolve(\n this.buffer.buffer.slice(\n this.buffer.byteOffset,\n this.buffer.byteOffset + this.buffer.byteLength\n )\n );\n }\n}\nclass StreamSource {\n /**\n * Create a StreamSource wrapping the given ReadableStream with a known byte size.\n * @param readable - The ReadableStream to wrap as a content source.\n * @param size - The total number of bytes the stream will produce.\n */\n constructor(readable, size) {\n this.readable = readable;\n this.size = size;\n }\n /** {@inheritDoc} */\n size;\n /**\n * Forward-only: ReadableStreams cannot be repositioned, so multipart\n * uploads must take the sequential path. See the interface comment on\n * `canSlice` for what the engine does with this flag.\n */\n canSlice = false;\n /** Whether the stream has already been read. */\n consumed = false;\n /**\n * Always throws because streams cannot be sliced. Buffer the stream first.\n *\n * @throws If slicing is attempted on a stream-backed source.\n */\n slice() {\n throw new Error(\"StreamSource does not support slicing. Buffer the stream first.\");\n }\n /**\n * Open the underlying ReadableStream. Can only be called once.\n * @returns The underlying ReadableStream of bytes.\n *\n * @throws If the stream has already been consumed.\n */\n stream() {\n if (this.consumed) throw new Error(\"StreamSource can only be consumed once.\");\n this.consumed = true;\n return this.readable;\n }\n /**\n * Read the entire stream into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n async toArrayBuffer() {\n const bytes = await collectStream(this.stream());\n return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);\n }\n}\nfunction toContentSource(input, size) {\n if (input instanceof Uint8Array) {\n return new BufferSource(input);\n }\n if (input instanceof Blob) {\n return new BlobSource(input);\n }\n if (size === void 0) {\n throw new Error(\"size is required when using a ReadableStream as input.\");\n }\n return new StreamSource(input, size);\n}\nexport {\n BlobSource,\n BufferSource,\n StreamSource,\n toContentSource\n};\n//# sourceMappingURL=source.js.map\n","class UploadAction {\n /**\n * Creates a new UploadAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param absolutePath - Absolute local filesystem path.\n * @param size - File size in bytes.\n * @param doUpload - Callback that performs the actual upload.\n */\n constructor(relativePath, absolutePath, size, doUpload) {\n this.relativePath = relativePath;\n this.absolutePath = absolutePath;\n this.size = size;\n this.doUpload = doUpload;\n }\n type = \"upload\";\n /**\n * Uploads the file (unless dryRun) and returns an 'upload-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doUpload(this.absolutePath, this.relativePath);\n }\n return { type: \"upload-done\", path: this.relativePath, size: this.size };\n }\n}\nclass DownloadAction {\n /**\n * Creates a new DownloadAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param size - File size in bytes.\n * @param doDownload - Callback that performs the actual download.\n */\n constructor(relativePath, size, doDownload) {\n this.relativePath = relativePath;\n this.size = size;\n this.doDownload = doDownload;\n }\n type = \"download\";\n /**\n * Downloads the file (unless dryRun) and returns a 'download-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDownload(this.relativePath);\n }\n return { type: \"download-done\", path: this.relativePath, size: this.size };\n }\n}\nclass CopyAction {\n /**\n * Creates a new CopyAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param size - File size in bytes.\n * @param doCopy - Callback that performs the server-side copy.\n */\n constructor(relativePath, size, doCopy) {\n this.relativePath = relativePath;\n this.size = size;\n this.doCopy = doCopy;\n }\n type = \"copy\";\n /**\n * Copies the file (unless dryRun) and returns a 'copy-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doCopy(this.relativePath);\n }\n return { type: \"copy-done\", path: this.relativePath, size: this.size };\n }\n}\nclass HideAction {\n /**\n * Creates a new HideAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param doHide - Callback that creates the hide marker.\n */\n constructor(relativePath, doHide) {\n this.relativePath = relativePath;\n this.doHide = doHide;\n }\n type = \"hide\";\n size = 0;\n /**\n * Hides the file (unless dryRun) and returns a 'hide' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doHide(this.relativePath);\n }\n return { type: \"hide\", path: this.relativePath, size: 0 };\n }\n}\nclass DeleteRemoteAction {\n /**\n * Creates a new DeleteRemoteAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param fileId - The B2 file version ID to delete.\n * @param doDelete - Callback that performs the deletion.\n */\n constructor(relativePath, fileId, doDelete) {\n this.relativePath = relativePath;\n this.fileId = fileId;\n this.doDelete = doDelete;\n }\n type = \"delete-remote\";\n size = 0;\n /**\n * Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDelete(this.fileId, this.relativePath);\n }\n return { type: \"delete-remote\", path: this.relativePath, size: 0 };\n }\n}\nclass DeleteLocalAction {\n /**\n * Creates a new DeleteLocalAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param absolutePath - Absolute local filesystem path.\n * @param doDelete - Callback that performs the deletion.\n */\n constructor(relativePath, absolutePath, doDelete) {\n this.relativePath = relativePath;\n this.absolutePath = absolutePath;\n this.doDelete = doDelete;\n }\n type = \"delete-local\";\n size = 0;\n /**\n * Deletes the local file (unless dryRun) and returns a 'delete-local' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDelete(this.absolutePath);\n }\n return { type: \"delete-local\", path: this.relativePath, size: 0 };\n }\n}\nclass SkipAction {\n /**\n * Creates a new SkipAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param reason - Human-readable explanation for why the file was skipped.\n */\n constructor(relativePath, reason) {\n this.relativePath = relativePath;\n this.reason = reason;\n }\n type = \"skip\";\n size = 0;\n /**\n * Returns a 'skip' event with the reason message. No I/O is performed.\n * @param _dryRun - Whether to simulate the action (unused for no-op).\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(_dryRun) {\n return { type: \"skip\", path: this.relativePath, size: 0, message: this.reason };\n }\n}\nexport {\n CopyAction,\n DeleteLocalAction,\n DeleteRemoteAction,\n DownloadAction,\n HideAction,\n SkipAction,\n UploadAction\n};\n//# sourceMappingURL=index.js.map\n","async function* zipFolders(source, dest) {\n const sourceIter = source.scan()[Symbol.asyncIterator]();\n const destIter = dest.scan()[Symbol.asyncIterator]();\n let sourceResult = await sourceIter.next();\n let destResult = await destIter.next();\n while (!sourceResult.done || !destResult.done) {\n const s = sourceResult.done ? null : sourceResult.value;\n const d = destResult.done ? null : destResult.value;\n if (s === null) {\n yield [null, d];\n destResult = await destIter.next();\n } else if (d === null) {\n yield [s, null];\n sourceResult = await sourceIter.next();\n } else if (s.relativePath < d.relativePath) {\n yield [s, null];\n sourceResult = await sourceIter.next();\n } else if (d.relativePath < s.relativePath) {\n yield [null, d];\n destResult = await destIter.next();\n } else {\n yield [s, d];\n sourceResult = await sourceIter.next();\n destResult = await destIter.next();\n }\n }\n}\nexport {\n zipFolders\n};\n//# sourceMappingURL=pairing.js.map\n","function filesAreDifferent(source, dest, compareMode, threshold = 0) {\n switch (compareMode) {\n case \"none\":\n return false;\n case \"size\":\n return Math.abs(source.size - dest.size) > threshold;\n case \"modtime\":\n return Math.abs(source.modTimeMillis - dest.modTimeMillis) > threshold;\n }\n}\nexport {\n filesAreDifferent\n};\n//# sourceMappingURL=compare.js.map\n","import { SkipAction } from \"../actions/index.js\";\nimport { filesAreDifferent } from \"./compare.js\";\nfunction* generateActions(pair, direction, compareMode, keepMode, keepDays, nowMillis, factory, compareThreshold) {\n const [source, dest] = pair;\n if (source !== null && dest === null) {\n yield* actionsForSourceOnly(source, direction, factory);\n } else if (source === null && dest !== null) {\n yield* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory);\n } else if (source !== null && dest !== null) {\n yield* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory);\n }\n}\nfunction* actionsForSourceOnly(source, direction, factory) {\n switch (direction) {\n case \"local-to-b2\":\n yield factory.upload(source);\n break;\n case \"b2-to-local\":\n yield factory.download(source);\n break;\n case \"b2-to-b2\":\n yield factory.copy(source, source.relativePath);\n break;\n }\n}\nfunction* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory) {\n if (keepMode === \"no-delete\") {\n yield new SkipAction(dest.relativePath, \"not in source, keep-mode is no-delete\");\n return;\n }\n if (keepMode === \"keep-days\") {\n const ageMillis = nowMillis - dest.modTimeMillis;\n const ageDays = ageMillis / (24 * 60 * 60 * 1e3);\n if (ageDays < keepDays) {\n yield new SkipAction(\n dest.relativePath,\n `not in source, keeping for ${Math.ceil(keepDays - ageDays)} more days`\n );\n return;\n }\n }\n switch (direction) {\n case \"local-to-b2\":\n yield factory.removeOrphan(dest);\n break;\n case \"b2-to-local\":\n yield factory.deleteLocal(dest);\n break;\n case \"b2-to-b2\":\n yield factory.removeOrphan(dest);\n break;\n }\n}\nfunction* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory) {\n if (!filesAreDifferent(source, dest, compareMode, compareThreshold)) {\n yield new SkipAction(source.relativePath, \"files are the same\");\n return;\n }\n switch (direction) {\n case \"local-to-b2\":\n yield factory.upload(source);\n break;\n case \"b2-to-local\":\n yield factory.download(source);\n break;\n case \"b2-to-b2\":\n yield factory.copy(source, dest.relativePath);\n break;\n }\n}\nexport {\n generateActions\n};\n//# sourceMappingURL=index.js.map\n","import { BufferSource } from \"../streams/source.js\";\nimport { fileId } from \"../types/ids.js\";\nimport { Semaphore } from \"../upload/concurrency.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { toError } from \"../util/to-error.js\";\nimport { DeleteLocalAction, DeleteRemoteAction, HideAction, CopyAction, DownloadAction, UploadAction } from \"./actions/index.js\";\nimport { zipFolders } from \"./pairing.js\";\nimport { generateActions } from \"./policies/index.js\";\nfunction resolveDirection(source, dest) {\n if (source.type === \"local\" && dest.type === \"b2\") return \"local-to-b2\";\n if (source.type === \"b2\" && dest.type === \"local\") return \"b2-to-local\";\n if (source.type === \"b2\" && dest.type === \"b2\") return \"b2-to-b2\";\n throw new Error(`Unsupported sync direction: ${source.type} to ${dest.type}`);\n}\nasync function* synchronize(config) {\n const { source, dest, options } = config;\n const direction = resolveDirection(source, dest);\n const dryRun = options.dryRun ?? false;\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const keepDays = options.keepDays ?? 0;\n const compareThreshold = options.compareThreshold ?? 0;\n const nowMillis = Date.now();\n const factory = createActionFactory(config);\n const actions = [];\n for await (const pair of zipFolders(source, dest)) {\n if (options.signal?.aborted) return;\n for (const action of generateActions(\n pair,\n direction,\n options.compareMode,\n options.keepMode,\n keepDays,\n nowMillis,\n factory,\n compareThreshold\n )) {\n actions.push(action);\n }\n yield { type: \"compare\", path: (pair[0] ?? pair[1])?.relativePath ?? \"\", size: 0 };\n }\n const sem = new Semaphore(concurrency);\n const results = [];\n const errors = [];\n const promises = actions.map(async (action) => {\n await sem.acquire();\n try {\n if (options.signal?.aborted) return;\n const event = await action.execute(dryRun);\n results.push(event);\n } catch (err) {\n const errorValue = toError(err);\n errors.push(errorValue);\n results.push({\n type: \"error\",\n path: action.relativePath,\n size: 0,\n message: errorValue.message\n });\n } finally {\n sem.release();\n }\n });\n await Promise.all(promises);\n for (const event of results) {\n yield event;\n }\n if (errors.length > 0) {\n yield {\n type: \"error\",\n path: \"\",\n size: 0,\n message: `${errors.length} action(s) failed`\n };\n }\n}\nfunction assertBucket(bucket, context) {\n if (!bucket) throw new Error(`Bucket required for ${context} actions`);\n}\nfunction createActionFactory(config) {\n const upConfig = config;\n const downConfig = config;\n const destBucket = upConfig.bucket ?? downConfig.bucket;\n const bucketIsLocked = destBucket?.info?.fileLockConfiguration?.value?.isFileLockEnabled ?? false;\n const factory = {\n upload(source) {\n const bucket = upConfig.bucket;\n const prefix = upConfig.prefix ?? \"\";\n assertBucket(bucket, \"upload\");\n return new UploadAction(\n source.relativePath,\n source.absolutePath,\n source.size,\n async (absPath, relPath) => {\n const { readFile } = await import(\"node:fs/promises\");\n const data = await readFile(absPath);\n await bucket.upload({\n fileName: `${prefix}${relPath}`,\n source: new BufferSource(new Uint8Array(data))\n });\n }\n );\n },\n download(source) {\n const bucket = downConfig.bucket;\n const root = downConfig.dest?.type === \"local\" ? downConfig.dest.root : \"\";\n assertBucket(bucket, \"download\");\n return new DownloadAction(source.relativePath, source.size, async (relPath) => {\n const result = await bucket.download(source.selectedVersion.fileName);\n const reader = result.body.getReader();\n let combined;\n try {\n const chunks = [];\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n let total = 0;\n for (const c of chunks) total += c.byteLength;\n combined = new Uint8Array(total);\n let offset = 0;\n for (const c of chunks) {\n combined.set(c, offset);\n offset += c.byteLength;\n }\n } finally {\n reader.releaseLock();\n }\n const { mkdir, writeFile } = await import(\"node:fs/promises\");\n const { dirname, join } = await import(\"node:path\");\n const destPath = join(root, relPath);\n await mkdir(dirname(destPath), { recursive: true });\n await writeFile(destPath, combined);\n });\n },\n copy(source, destPath) {\n const bucket = upConfig.bucket;\n assertBucket(bucket, \"copy\");\n return new CopyAction(source.relativePath, source.size, async () => {\n await bucket.copyFile({\n sourceFileId: source.selectedVersion.fileId,\n fileName: destPath\n });\n });\n },\n hide(path) {\n const bucket = upConfig.bucket ?? downConfig.bucket;\n assertBucket(bucket, \"hide\");\n return new HideAction(path, async (relPath) => {\n const prefix = upConfig.prefix ?? \"\";\n await bucket.hideFile(`${prefix}${relPath}`);\n });\n },\n deleteRemote(path) {\n const bucket = upConfig.bucket ?? downConfig.bucket;\n assertBucket(bucket, \"delete\");\n const b2FileName = path.selectedVersion.fileName;\n return new DeleteRemoteAction(\n path.relativePath,\n path.selectedVersion.fileId,\n async (fileId$1) => {\n await bucket.deleteFileVersion(b2FileName, fileId(fileId$1));\n }\n );\n },\n deleteLocal(path) {\n return new DeleteLocalAction(path.relativePath, path.absolutePath, async (absPath) => {\n const { unlink } = await import(\"node:fs/promises\");\n await unlink(absPath);\n });\n },\n removeOrphan(dest) {\n return bucketIsLocked ? factory.hide(dest.relativePath) : factory.deleteRemote(dest);\n }\n };\n return factory;\n}\nexport {\n synchronize\n};\n//# sourceMappingURL=synchronizer.js.map\n","import { readdir, stat } from \"node:fs/promises\";\nimport { join, relative, sep } from \"node:path\";\nclass LocalFolder {\n type = \"local\";\n /** Absolute path to the local root directory. */\n root;\n /**\n * Creates a new LocalFolder for the given root directory.\n * @param root - Absolute path to the local directory to scan.\n */\n constructor(root) {\n this.root = root;\n }\n /** Recursively walks the directory and yields files sorted by relative path. */\n async *scan() {\n const collected = [];\n await this.walk(this.root, collected);\n collected.sort((a, b) => a.relativePath.localeCompare(b.relativePath));\n for (const entry of collected) {\n yield entry;\n }\n }\n /**\n * Recursively collects files from {@link dir} into {@link out}.\n * @param dir - Absolute path of the directory to scan.\n * @param out - Accumulator array that receives discovered file entries.\n */\n async walk(dir, out) {\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n if (entry.isDirectory()) {\n await this.walk(fullPath, out);\n } else if (entry.isFile()) {\n try {\n const s = await stat(fullPath);\n const rel = relative(this.root, fullPath).split(sep).join(\"/\");\n out.push({\n relativePath: rel,\n absolutePath: fullPath,\n modTimeMillis: Math.floor(s.mtimeMs),\n size: s.size\n });\n } catch {\n }\n }\n }\n }\n}\nexport {\n LocalFolder\n};\n//# sourceMappingURL=local.js.map\n","const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: \"start\",\n /** Normal upload (small or finished large file). */\n Upload: \"upload\",\n /** Hide marker (soft delete). */\n Hide: \"hide\",\n /** Virtual folder marker. */\n Folder: \"folder\",\n /** Created via server-side copy. */\n Copy: \"copy\"\n};\nconst MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: \"COPY\",\n /** Use the values provided in the copy request. */\n Replace: \"REPLACE\"\n};\nexport {\n FileAction,\n MetadataDirective\n};\n//# sourceMappingURL=file.js.map\n","import { FileAction } from \"../../types/file.js\";\nclass B2Folder {\n type = \"b2\";\n bucket;\n prefix;\n /**\n * Creates a new B2Folder for the given bucket and optional prefix.\n * @param bucket - The B2 bucket to scan.\n * @param prefix - Optional key prefix to restrict the scan scope.\n */\n constructor(bucket, prefix = \"\") {\n this.bucket = bucket;\n this.prefix = prefix;\n }\n /** Lists all file versions in the bucket, groups by name, and yields the latest visible version. */\n async *scan() {\n const grouped = /* @__PURE__ */ new Map();\n let startFileName;\n let startFileId;\n while (true) {\n const listing = await this.bucket.listFileVersions({\n ...this.prefix !== \"\" ? { prefix: this.prefix } : {},\n ...startFileName !== void 0 ? { startFileName } : {},\n ...startFileId !== void 0 ? { startFileId } : {}\n });\n for (const fv of listing.files) {\n const existing = grouped.get(fv.fileName);\n if (existing) {\n existing.push(fv);\n } else {\n grouped.set(fv.fileName, [fv]);\n }\n }\n if (!listing.nextFileName) break;\n startFileName = listing.nextFileName;\n startFileId = listing.nextFileId;\n }\n const sorted = [...grouped.entries()].sort((a, b) => a[0].localeCompare(b[0]));\n for (const [fileName, versions] of sorted) {\n versions.sort((a, b) => b.uploadTimestamp - a.uploadTimestamp);\n const selected = versions[0];\n if (!selected || selected.action === FileAction.Hide) continue;\n const relativePath = this.prefix !== \"\" ? fileName.slice(this.prefix.length) : fileName;\n yield {\n relativePath,\n modTimeMillis: selected.uploadTimestamp,\n size: selected.contentLength,\n selectedVersion: selected,\n allVersions: versions\n };\n }\n }\n}\nexport {\n B2Folder\n};\n//# sourceMappingURL=b2.js.map\n","import { mkdir } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type {\n CompareMode,\n KeepMode,\n SyncEvent,\n SynchronizerDownConfig,\n SynchronizerUpConfig,\n} from '@backblaze-labs/b2-sdk/sync'\nimport { B2Folder, LocalFolder, synchronize } from '@backblaze-labs/b2-sdk/sync'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/**\n * Mutable counter bag fed by {@link processSyncEvent} as the action consumes\n * the SDK's `synchronize()` event stream. Exposed alongside the processor so\n * unit tests can drive each SyncEvent variant deterministically (notably the\n * `copy-start` / `copy-done` events that only fire in b2-to-b2 sync, which\n * the action's input surface doesn't currently expose).\n */\nexport interface SyncEventCounters {\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files removed (delete-remote, delete-local, or hide). */\n deleted: number\n /** Count of files left unchanged. */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred (upload + download). */\n bytesTransferred: number\n}\n\n/**\n * Apply one `SyncEvent` from the SDK's `synchronize()` stream to the running\n * counters and emit the corresponding log line. The action's `syncCommand`\n * calls this in a loop; the function is exported (and the {@link SyncEventCounters}\n * type with it) so tests can exercise every event variant independently,\n * including the `copy-*` events that require b2-to-b2 sync to fire from the\n * real engine.\n *\n * Informational lifecycle events (`upload-start`, `compare`, etc.) are\n * deliberate no-ops; listing them explicitly keeps the switch exhaustive\n * so TypeScript errors if the SDK adds a new variant.\n */\nexport function processSyncEvent(event: SyncEvent, counters: SyncEventCounters): void {\n switch (event.type) {\n case 'upload-done':\n counters.uploaded++\n counters.bytesTransferred += event.size\n core.info(` ↑ ${event.path} (${event.size}B)`)\n return\n case 'download-done':\n counters.downloaded++\n counters.bytesTransferred += event.size\n core.info(` ↓ ${event.path} (${event.size}B)`)\n return\n case 'delete-remote':\n counters.deleted++\n core.info(` − ${event.path}`)\n return\n case 'delete-local':\n counters.deleted++\n core.info(` − (local) ${event.path}`)\n return\n case 'hide':\n counters.deleted++\n core.info(` ⌀ ${event.path} (hidden)`)\n return\n case 'skip':\n counters.skipped++\n return\n case 'error':\n counters.errors++\n core.warning(` ! ${event.path}: ${event.message}`)\n return\n case 'upload-start':\n case 'compare':\n case 'download-start':\n case 'copy-start':\n case 'copy-done':\n return\n }\n}\n\n/**\n * Build a one-line summary of the first few sync errors for the dispatcher's\n * top-level failure message. Without this, a sync that fails on three files\n * surfaces only `Sync completed with 3 error(s)` to the user, who then has to\n * dig into the (possibly collapsed) per-file warnings or parse `summary-json`.\n * Including a sample makes the failure message itself diagnose-able.\n */\nexport function summarizeSyncErrors(events: SyncEvent[], limit = 3): string {\n const errors = events.filter(\n (e): e is Extract => e.type === 'error',\n )\n if (errors.length === 0) return ''\n const head = errors\n .slice(0, limit)\n .map((e) => `${e.path}: ${e.message}`)\n .join('; ')\n const tail = errors.length > limit ? `; +${errors.length - limit} more` : ''\n return `${head}${tail}`\n}\n\n/** Result of {@link syncCommand}: per-event log plus aggregate counters. */\nexport interface SyncResult {\n /** Per-file events emitted by the SDK's `synchronize()` (upload-done, download-done, skip, delete-*, hide, error). */\n events: SyncEvent[]\n /** Resolved direction of this sync (after `auto` resolution). */\n direction: 'local-to-b2' | 'b2-to-local'\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files deleted/hidden across both sides. */\n deleted: number\n /** Count of files left unchanged (already in sync). */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred across both directions. */\n bytesTransferred: number\n}\n\n/**\n * Sync a local directory to / from a B2 bucket prefix.\n *\n * Direction is determined by the `direction` input (`up` = local → B2,\n * `down` = B2 → local). With `direction: auto` (the default) we infer:\n * - if `source` is an existing local directory → `up`\n * - otherwise → `down` (source is a B2 prefix, destination is local)\n *\n * The SDK's {@link synchronize} returns an `AsyncGenerator` which we\n * relay to the workflow log (per-file) and aggregate into a typed result.\n */\nexport async function syncCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'sync', 'a local directory (up) or B2 prefix (down)')\n\n const direction = await resolveDirection(inputs.syncDirection, source)\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n\n const config = await buildConfig(bucket, source, inputs, direction, signal)\n\n core.startGroup(\n `sync ${direction === 'local-to-b2' ? source : `b2://${bucket.name}/${source}`} ` +\n `→ ${direction === 'local-to-b2' ? `b2://${bucket.name}/${inputs.destination ?? ''}` : (inputs.destination ?? '.')} ` +\n `(compare=${compareMode}, keep=${keepMode}${dryRun ? ', dry-run' : ''})`,\n )\n\n const events: SyncEvent[] = []\n const counters: SyncEventCounters = {\n uploaded: 0,\n downloaded: 0,\n deleted: 0,\n skipped: 0,\n errors: 0,\n bytesTransferred: 0,\n }\n\n try {\n for await (const event of synchronize(config)) {\n events.push(event)\n processSyncEvent(event, counters)\n }\n } finally {\n core.endGroup()\n }\n\n const { uploaded, downloaded, deleted, skipped, errors, bytesTransferred } = counters\n\n core.info(\n `sync done [${direction}]: ${uploaded} uploaded, ${downloaded} downloaded, ${deleted} removed, ${skipped} unchanged, ${errors} errors`,\n )\n\n return {\n events,\n direction,\n uploaded,\n downloaded,\n deleted,\n skipped,\n errors,\n bytesTransferred,\n }\n}\n\nasync function resolveDirection(\n requested: 'up' | 'down' | 'auto',\n source: string,\n): Promise<'local-to-b2' | 'b2-to-local'> {\n if (requested === 'up') return 'local-to-b2'\n if (requested === 'down') return 'b2-to-local'\n const localStat = await tryStat(source)\n return localStat?.isDirectory() ? 'local-to-b2' : 'b2-to-local'\n}\n\nasync function buildConfig(\n bucket: Bucket,\n source: string,\n inputs: ParsedInputs,\n direction: 'local-to-b2' | 'b2-to-local',\n signal?: AbortSignal,\n): Promise {\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n const concurrency = inputs.concurrency\n const options = {\n compareMode,\n keepMode,\n concurrency,\n dryRun,\n ...(signal !== undefined ? { signal } : {}),\n }\n\n if (direction === 'local-to-b2') {\n const stats = await tryStat(source)\n if (!stats?.isDirectory()) {\n throw new Error(`'sync' up requires 'source' to be an existing local directory: ${source}`)\n }\n const prefix = (inputs.destination ?? '').replace(/^\\/+|\\/+$/g, '')\n return {\n source: new LocalFolder(resolve(source)),\n dest: new B2Folder(bucket, prefix === '' ? '' : `${prefix}/`),\n bucket,\n prefix: prefix === '' ? '' : `${prefix}/`,\n options,\n }\n }\n\n const remotePrefix = source.replace(/^\\/+|\\/+$/g, '')\n const localDest = inputs.destination ?? '.'\n await mkdir(resolve(localDest), { recursive: true })\n return {\n source: new B2Folder(bucket, remotePrefix === '' ? '' : `${remotePrefix}/`),\n dest: new LocalFolder(resolve(localDest)),\n bucket,\n options,\n }\n}\n\nexport type { CompareMode, KeepMode }\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link unhideCommand}. */\nexport interface UnhideResult {\n /** B2 file name that was unhidden. */\n fileName: string\n /** File ID of the removed hide marker, or `null` if there was nothing hidden. */\n removedMarkerFileId: string | null\n}\n\n/**\n * Restore visibility of a file previously hidden by the `hide` command.\n *\n * Wraps the SDK's {@link Bucket.unhideFile}, which finds the most recent hide\n * marker for the file name and deletes it. If the file is already visible\n * (or never existed), no-ops and reports `removedMarkerFileId: null`.\n *\n * B2 has no native `b2_unhide_file` endpoint; the SDK implements unhide as\n * \"list versions → delete the top hide marker\", which is the canonical\n * recipe. We expose it here so workflow authors don't have to know that.\n */\nexport async function unhideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'unhide', 'the B2 file name')\n\n core.startGroup(`unhide b2://${bucket.name}/${source}`)\n try {\n const marker = await bucket.unhideFile(source)\n if (marker === null) {\n core.info(` no hide marker found for ${source} (already visible or non-existent)`)\n return { fileName: source, removedMarkerFileId: null }\n }\n core.info(` removed hide marker fileId=${marker.fileId}, ${source} is now visible`)\n return { fileName: source, removedMarkerFileId: marker.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core';\n/**\n * Returns a copy with defaults filled in.\n */\nexport function getOptions(copy) {\n const result = {\n followSymbolicLinks: true,\n implicitDescendants: true,\n matchDirectories: true,\n omitBrokenSymbolicLinks: true,\n excludeHiddenFiles: false\n };\n if (copy) {\n if (typeof copy.followSymbolicLinks === 'boolean') {\n result.followSymbolicLinks = copy.followSymbolicLinks;\n core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);\n }\n if (typeof copy.implicitDescendants === 'boolean') {\n result.implicitDescendants = copy.implicitDescendants;\n core.debug(`implicitDescendants '${result.implicitDescendants}'`);\n }\n if (typeof copy.matchDirectories === 'boolean') {\n result.matchDirectories = copy.matchDirectories;\n core.debug(`matchDirectories '${result.matchDirectories}'`);\n }\n if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {\n result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;\n core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);\n }\n if (typeof copy.excludeHiddenFiles === 'boolean') {\n result.excludeHiddenFiles = copy.excludeHiddenFiles;\n core.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`);\n }\n }\n return result;\n}\n//# sourceMappingURL=internal-glob-options-helper.js.map","import * as path from 'path';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.\n *\n * For example, on Linux/macOS:\n * - `/ => /`\n * - `/hello => /`\n *\n * For example, on Windows:\n * - `C:\\ => C:\\`\n * - `C:\\hello => C:\\`\n * - `C: => C:`\n * - `C:hello => C:`\n * - `\\ => \\`\n * - `\\hello => \\`\n * - `\\\\hello => \\\\hello`\n * - `\\\\hello\\world => \\\\hello\\world`\n */\nexport function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}\n/**\n * Roots the path if not already rooted. On Windows, relative roots like `\\`\n * or `C:` are expanded based on the current working directory.\n */\nexport function ensureAbsoluteRoot(root, itemPath) {\n assert(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);\n assert(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Already rooted\n if (hasAbsoluteRoot(itemPath)) {\n return itemPath;\n }\n // Windows\n if (IS_WINDOWS) {\n // Check for itemPath like C: or C:foo\n if (itemPath.match(/^[A-Z]:[^\\\\/]|^[A-Z]:$/i)) {\n let cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n // Drive letter matches cwd? Expand to cwd\n if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {\n // Drive only, e.g. C:\n if (itemPath.length === 2) {\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}`;\n }\n // Drive + path, e.g. C:foo\n else {\n if (!cwd.endsWith('\\\\')) {\n cwd += '\\\\';\n }\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}${itemPath.substr(2)}`;\n }\n }\n // Different drive\n else {\n return `${itemPath[0]}:\\\\${itemPath.substr(2)}`;\n }\n }\n // Check for itemPath like \\ or \\foo\n else if (normalizeSeparators(itemPath).match(/^\\\\$|^\\\\[^\\\\]/)) {\n const cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n return `${cwd[0]}:\\\\${itemPath.substr(1)}`;\n }\n }\n assert(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);\n // Otherwise ensure root ends with a separator\n if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\\\'))) {\n // Intentionally empty\n }\n else {\n // Append separator\n root += path.sep;\n }\n return root + itemPath;\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\\\hello\\share` and `C:\\hello` (and using alternate separator).\n */\nexport function hasAbsoluteRoot(itemPath) {\n assert(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\\\hello\\share or C:\\hello\n return itemPath.startsWith('\\\\\\\\') || /^[A-Z]:\\\\/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\`, `\\hello`, `\\\\hello\\share`, `C:`, and `C:\\hello` (and using alternate separator).\n */\nexport function hasRoot(itemPath) {\n assert(itemPath, `isRooted parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\ or \\hello or \\\\hello\n // E.g. C: or C:\\hello\n return itemPath.startsWith('\\\\') || /^[A-Z]:/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * Removes redundant slashes and converts `/` to `\\` on Windows\n */\nexport function normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n/**\n * Normalizes the path separators and trims the trailing separator (when safe).\n * For example, `/foo/ => /foo` but `/ => /`\n */\nexport function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}\n//# sourceMappingURL=internal-path-helper.js.map","/**\n * Indicates whether a pattern matches a path\n */\nexport var MatchKind;\n(function (MatchKind) {\n /** Not matched */\n MatchKind[MatchKind[\"None\"] = 0] = \"None\";\n /** Matched if the path is a directory */\n MatchKind[MatchKind[\"Directory\"] = 1] = \"Directory\";\n /** Matched if the path is a regular file */\n MatchKind[MatchKind[\"File\"] = 2] = \"File\";\n /** Matched */\n MatchKind[MatchKind[\"All\"] = 3] = \"All\";\n})(MatchKind || (MatchKind = {}));\n//# sourceMappingURL=internal-match-kind.js.map","import * as pathHelper from './internal-path-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Given an array of patterns, returns an array of paths to search.\n * Duplicates and paths under other included paths are filtered out.\n */\nexport function getSearchPaths(patterns) {\n // Ignore negate patterns\n patterns = patterns.filter(x => !x.negate);\n // Create a map of all search paths\n const searchPathMap = {};\n for (const pattern of patterns) {\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n searchPathMap[key] = 'candidate';\n }\n const result = [];\n for (const pattern of patterns) {\n // Check if already included\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n if (searchPathMap[key] === 'included') {\n continue;\n }\n // Check for an ancestor search path\n let foundAncestor = false;\n let tempKey = key;\n let parent = pathHelper.dirname(tempKey);\n while (parent !== tempKey) {\n if (searchPathMap[parent]) {\n foundAncestor = true;\n break;\n }\n tempKey = parent;\n parent = pathHelper.dirname(tempKey);\n }\n // Include the search pattern in the result\n if (!foundAncestor) {\n result.push(pattern.searchPath);\n searchPathMap[key] = 'included';\n }\n }\n return result;\n}\n/**\n * Matches the patterns against the path\n */\nexport function match(patterns, itemPath) {\n let result = MatchKind.None;\n for (const pattern of patterns) {\n if (pattern.negate) {\n result &= ~pattern.match(itemPath);\n }\n else {\n result |= pattern.match(itemPath);\n }\n }\n return result;\n}\n/**\n * Checks whether to descend further into the directory\n */\nexport function partialMatch(patterns, itemPath) {\n return patterns.some(x => !x.negate && x.partialMatch(itemPath));\n}\n//# sourceMappingURL=internal-pattern-helper.js.map","export const balanced = (a, b, str) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a;\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b;\n const r = ma !== null && mb != null && range(ma, mb, str);\n return (r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n });\n};\nconst maybeMatch = (reg, str) => {\n const m = str.match(reg);\n return m ? m[0] : null;\n};\nexport const range = (a, b, str) => {\n let begs, beg, left, right = undefined, result;\n let ai = str.indexOf(a);\n let bi = str.indexOf(b, ai + 1);\n let i = ai;\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n }\n else if (begs.length === 1) {\n const r = begs.pop();\n if (r !== undefined)\n result = [r, bi];\n }\n else {\n beg = begs.pop();\n if (beg !== undefined && beg < left) {\n left = beg;\n right = bi;\n }\n bi = str.indexOf(b, i + 1);\n }\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n if (begs.length && right !== undefined) {\n result = [left, right];\n }\n }\n return result;\n};\n//# sourceMappingURL=index.js.map","import { balanced } from 'balanced-match';\nconst escSlash = '\\0SLASH' + Math.random() + '\\0';\nconst escOpen = '\\0OPEN' + Math.random() + '\\0';\nconst escClose = '\\0CLOSE' + Math.random() + '\\0';\nconst escComma = '\\0COMMA' + Math.random() + '\\0';\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0';\nconst escSlashPattern = new RegExp(escSlash, 'g');\nconst escOpenPattern = new RegExp(escOpen, 'g');\nconst escClosePattern = new RegExp(escClose, 'g');\nconst escCommaPattern = new RegExp(escComma, 'g');\nconst escPeriodPattern = new RegExp(escPeriod, 'g');\nconst slashPattern = /\\\\\\\\/g;\nconst openPattern = /\\\\{/g;\nconst closePattern = /\\\\}/g;\nconst commaPattern = /\\\\,/g;\nconst periodPattern = /\\\\\\./g;\nexport const EXPANSION_MAX = 100_000;\nfunction numeric(str) {\n return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);\n}\nfunction escapeBraces(str) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod);\n}\nfunction unescapeBraces(str) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.');\n}\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str) {\n if (!str) {\n return [''];\n }\n const parts = [];\n const m = balanced('{', '}', str);\n if (!m) {\n return str.split(',');\n }\n const { pre, body, post } = m;\n const p = pre.split(',');\n p[p.length - 1] += '{' + body + '}';\n const postParts = parseCommaParts(post);\n if (post.length) {\n ;\n p[p.length - 1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n parts.push.apply(parts, p);\n return parts;\n}\nexport function expand(str, options = {}) {\n if (!str) {\n return [];\n }\n const { max = EXPANSION_MAX } = options;\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2);\n }\n return expand_(escapeBraces(str), max, true).map(unescapeBraces);\n}\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\nfunction expand_(str, max, isTop) {\n /** @type {string[]} */\n const expansions = [];\n const m = balanced('{', '}', str);\n if (!m)\n return [str];\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre;\n const post = m.post.length ? expand_(m.post, max, false) : [''];\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k];\n expansions.push(expansion);\n }\n }\n else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n const isSequence = isNumericSequence || isAlphaSequence;\n const isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand_(str, max, true);\n }\n return [str];\n }\n let n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n }\n else {\n n = parseCommaParts(m.body);\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace);\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p);\n }\n /* c8 ignore stop */\n }\n }\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N;\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0]);\n const y = numeric(n[1]);\n const width = Math.max(n[0].length, n[1].length);\n let incr = n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n let test = lte;\n const reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n const pad = n.some(isPadded);\n N = [];\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\') {\n c = '';\n }\n }\n else {\n c = String(i);\n if (pad) {\n const need = width - c.length;\n if (need > 0) {\n const z = new Array(need + 1).join('0');\n if (i < 0) {\n c = '-' + z + c.slice(1);\n }\n else {\n c = z + c;\n }\n }\n }\n }\n N.push(c);\n }\n }\n else {\n N = [];\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j], max, false));\n }\n }\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion);\n }\n }\n }\n }\n return expansions;\n}\n//# sourceMappingURL=index.js.map","const MAX_PATTERN_LENGTH = 1024 * 64;\nexport const assertValidPattern = (pattern) => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern');\n }\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long');\n }\n};\n//# sourceMappingURL=assert-valid-pattern.js.map","// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n// { : [, /u flag required, negated]\nconst posixClasses = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n};\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s) => s.replace(/[[\\]\\\\-]/g, '\\\\$&');\n// escape all regexp magic characters\nconst regexpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges) => ranges.join('');\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (glob, position) => {\n const pos = position;\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression');\n }\n /* c8 ignore stop */\n const ranges = [];\n const negs = [];\n let i = pos + 1;\n let sawStart = false;\n let uflag = false;\n let escaping = false;\n let negate = false;\n let endPos = pos;\n let rangeStart = '';\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i);\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true;\n i++;\n continue;\n }\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1;\n break;\n }\n sawStart = true;\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true;\n i++;\n continue;\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true];\n }\n i += cls.length;\n if (neg)\n negs.push(unip);\n else\n ranges.push(unip);\n uflag = uflag || u;\n continue WHILE;\n }\n }\n }\n // now it's just a normal character, effectively\n escaping = false;\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));\n }\n else if (c === rangeStart) {\n ranges.push(braceEscape(c));\n }\n rangeStart = '';\n i++;\n continue;\n }\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'));\n i += 2;\n continue;\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c;\n i += 2;\n continue;\n }\n // not the start of a range, just a single character\n ranges.push(braceEscape(c));\n i++;\n }\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false];\n }\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true];\n }\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];\n return [regexpEscape(r), false, endPos - pos, false];\n }\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';\n const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs;\n return [comb, uflag, endPos - pos, true];\n};\n//# sourceMappingURL=brace-expressions.js.map","/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\nexport const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1');\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1');\n};\n//# sourceMappingURL=unescape.js.map","// parse a single path portion\nvar _a;\nimport { parseClass } from './brace-expressions.js';\nimport { unescape } from './unescape.js';\nconst types = new Set(['!', '?', '+', '*', '@']);\nconst isExtglobType = (c) => types.has(c);\nconst isExtglobAST = (c) => isExtglobType(c.type);\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n]);\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n]);\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n]);\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n]);\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))';\nconst startNoDot = '(?!\\\\.)';\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.']);\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.']);\nconst reSpecials = new Set('().*{}+?[]^$\\\\!');\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// any single thing other than /\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?';\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\nlet ID = 0;\nexport class AST {\n type;\n #root;\n #hasMagic;\n #uflag = false;\n #parts = [];\n #parent;\n #parentIndex;\n #negs;\n #filledNegs = false;\n #options;\n #toString;\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt = false;\n id = ++ID;\n get depth() {\n return (this.#parent?.depth ?? -1) + 1;\n }\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n };\n }\n constructor(type, parent, options = {}) {\n this.type = type;\n // extglobs are inherently magical\n if (type)\n this.#hasMagic = true;\n this.#parent = parent;\n this.#root = this.#parent ? this.#parent.#root : this;\n this.#options = this.#root === this ? options : this.#root.#options;\n this.#negs = this.#root === this ? [] : this.#root.#negs;\n if (type === '!' && !this.#root.#filledNegs)\n this.#negs.push(this);\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;\n }\n get hasMagic() {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined)\n return this.#hasMagic;\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string')\n continue;\n if (p.type || p.hasMagic)\n return (this.#hasMagic = true);\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic;\n }\n // reconstructs the pattern\n toString() {\n return (this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')'));\n }\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root)\n throw new Error('should only call on root');\n if (this.#filledNegs)\n return this;\n /* c8 ignore stop */\n // call toString() once to fill this out\n this.toString();\n this.#filledNegs = true;\n let n;\n while ((n = this.#negs.pop())) {\n if (n.type !== '!')\n continue;\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p = n;\n let pp = p.#parent;\n while (pp) {\n for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??');\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i]);\n }\n }\n p = pp;\n pp = p.#parent;\n }\n }\n return this;\n }\n push(...parts) {\n for (const p of parts) {\n if (p === '')\n continue;\n /* c8 ignore start */\n if (typeof p !== 'string' &&\n !(p instanceof _a && p.#parent === this)) {\n throw new Error('invalid part: ' + p);\n }\n /* c8 ignore stop */\n this.#parts.push(p);\n }\n }\n toJSON() {\n const ret = this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => p.toJSON())];\n if (this.isStart() && !this.type)\n ret.unshift([]);\n if (this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))) {\n ret.push({});\n }\n return ret;\n }\n isStart() {\n if (this.#root === this)\n return true;\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart())\n return false;\n if (this.#parentIndex === 0)\n return true;\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent;\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i];\n if (!(pp instanceof _a && pp.type === '!')) {\n return false;\n }\n }\n return true;\n }\n isEnd() {\n if (this.#root === this)\n return true;\n if (this.#parent?.type === '!')\n return true;\n if (!this.#parent?.isEnd())\n return false;\n if (!this.type)\n return this.#parent?.isEnd();\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0;\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1;\n }\n copyIn(part) {\n if (typeof part === 'string')\n this.push(part);\n else\n this.push(part.clone(this));\n }\n clone(parent) {\n const c = new _a(this.type, parent);\n for (const p of this.#parts) {\n c.copyIn(p);\n }\n return c;\n }\n static #parseAST(str, ast, pos, opt, extDepth) {\n const maxDepth = opt.maxExtglobRecursion ?? 2;\n let escaping = false;\n let inBrace = false;\n let braceStart = -1;\n let braceNeg = false;\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos;\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth;\n if (doRecurse) {\n ast.push(acc);\n acc = '';\n const ext = new _a(c, ast);\n i = _a.#parseAST(str, ext, i, opt, extDepth + 1);\n ast.push(ext);\n continue;\n }\n acc += c;\n }\n ast.push(acc);\n return i;\n }\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1;\n let part = new _a(null, ast);\n const parts = [];\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;\n part.push(acc);\n acc = '';\n const ext = new _a(c, part);\n part.push(ext);\n i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);\n continue;\n }\n if (c === '|') {\n part.push(acc);\n acc = '';\n parts.push(part);\n part = new _a(null, ast);\n continue;\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true;\n }\n part.push(acc);\n acc = '';\n ast.push(...parts, part);\n return i;\n }\n acc += c;\n }\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null;\n ast.#hasMagic = undefined;\n ast.#parts = [str.substring(pos - 1)];\n return i;\n }\n #canAdoptWithSpace(child) {\n return this.#canAdopt(child, adoptionWithSpaceMap);\n }\n #canAdopt(child, map = adoptionMap) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canAdoptType(gc.type, map);\n }\n #canAdoptType(c, map = adoptionAnyMap) {\n return !!map.get(this.type)?.includes(c);\n }\n #adoptWithSpace(child, index) {\n const gc = child.#parts[0];\n const blank = new _a(null, gc, this.options);\n blank.#parts.push('');\n gc.push(blank);\n this.#adopt(child, index);\n }\n #adopt(child, index) {\n const gc = child.#parts[0];\n this.#parts.splice(index, 1, ...gc.#parts);\n for (const p of gc.#parts) {\n if (typeof p === 'object')\n p.#parent = this;\n }\n this.#toString = undefined;\n }\n #canUsurpType(c) {\n const m = usurpMap.get(this.type);\n return !!m?.has(c);\n }\n #canUsurp(child) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canUsurpType(gc.type);\n }\n #usurp(child) {\n const m = usurpMap.get(this.type);\n const gc = child.#parts[0];\n const nt = m?.get(gc.type);\n /* c8 ignore start - impossible */\n if (!nt)\n return false;\n /* c8 ignore stop */\n this.#parts = gc.#parts;\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this;\n }\n }\n this.type = nt;\n this.#toString = undefined;\n this.#emptyExt = false;\n }\n static fromGlob(pattern, options = {}) {\n const ast = new _a(null, undefined, options);\n _a.#parseAST(pattern, ast, 0, options, 0);\n return ast;\n }\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern() {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root)\n return this.#root.toMMPattern();\n /* c8 ignore stop */\n const glob = this.toString();\n const [re, body, hasMagic, uflag] = this.toRegExpSource();\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic = hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase());\n if (!anyMagic) {\n return body;\n }\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n });\n }\n get options() {\n return this.#options;\n }\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(allowDot) {\n const dot = allowDot ?? !!this.#options.dot;\n if (this.#root === this) {\n this.#flatten();\n this.#fillNegs();\n }\n if (!isExtglobAST(this)) {\n const noEmpty = this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string');\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] = typeof p === 'string' ?\n _a.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot);\n this.#hasMagic = this.#hasMagic || hasMagic;\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .join('');\n let start = '';\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);\n if (!dotTravAllowed) {\n const aps = addPatternStart;\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav = \n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)));\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : '';\n }\n }\n }\n // append the \"end of path portion\" pattern to negation tails\n let end = '';\n if (this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!') {\n end = '(?:$|\\\\/)';\n }\n const final = start + src + end;\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n const repeated = this.type === '*' || this.type === '+';\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:';\n let body = this.#partsToRegExp(dot);\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString();\n const me = this;\n me.#parts = [s];\n me.type = null;\n me.#hasMagic = undefined;\n return [s, unescape(this.toString()), false, false];\n }\n let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true);\n if (bodyDotAllowed === body) {\n bodyDotAllowed = '';\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`;\n }\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = '';\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;\n }\n else {\n const close = this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`;\n final = start + body + close;\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten();\n }\n }\n }\n else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0;\n let done = false;\n do {\n done = true;\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i];\n if (typeof c === 'object') {\n c.#flatten();\n if (this.#canAdopt(c)) {\n done = false;\n this.#adopt(c, i);\n }\n else if (this.#canAdoptWithSpace(c)) {\n done = false;\n this.#adoptWithSpace(c, i);\n }\n else if (this.#canUsurp(c)) {\n done = false;\n this.#usurp(c);\n }\n }\n }\n } while (!done && ++iterations < 10);\n }\n this.#toString = undefined;\n }\n #partsToRegExp(dot) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??');\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|');\n }\n static #parseGlob(glob, hasMagic, noEmpty = false) {\n let escaping = false;\n let re = '';\n let uflag = false;\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false;\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i);\n if (escaping) {\n escaping = false;\n re += (reSpecials.has(c) ? '\\\\' : '') + c;\n continue;\n }\n if (c === '*') {\n if (inStar)\n continue;\n inStar = true;\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;\n hasMagic = true;\n continue;\n }\n else {\n inStar = false;\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\';\n }\n else {\n escaping = true;\n }\n continue;\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i);\n if (consumed) {\n re += src;\n uflag = uflag || needUflag;\n i += consumed - 1;\n hasMagic = hasMagic || magic;\n continue;\n }\n }\n if (c === '?') {\n re += qmark;\n hasMagic = true;\n continue;\n }\n re += regExpEscape(c);\n }\n return [re, unescape(glob), !!hasMagic, uflag];\n }\n}\n_a = AST;\n//# sourceMappingURL=ast.js.map","/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&');\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&');\n};\n//# sourceMappingURL=escape.js.map","import { expand } from 'brace-expansion';\nimport { assertValidPattern } from './assert-valid-pattern.js';\nimport { AST } from './ast.js';\nimport { escape } from './escape.js';\nimport { unescape } from './unescape.js';\nexport const minimatch = (p, pattern, options = {}) => {\n assertValidPattern(pattern);\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false;\n }\n return new Minimatch(pattern, options).match(p);\n};\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/;\nconst starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);\nconst starDotExtTestDot = (ext) => (f) => f.endsWith(ext);\nconst starDotExtTestNocase = (ext) => {\n ext = ext.toLowerCase();\n return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);\n};\nconst starDotExtTestNocaseDot = (ext) => {\n ext = ext.toLowerCase();\n return (f) => f.toLowerCase().endsWith(ext);\n};\nconst starDotStarRE = /^\\*+\\.\\*+$/;\nconst starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');\nconst starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');\nconst dotStarRE = /^\\.\\*+$/;\nconst dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');\nconst starRE = /^\\*+$/;\nconst starTest = (f) => f.length !== 0 && !f.startsWith('.');\nconst starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/;\nconst qmarksTestNocase = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestNocaseDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTest = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTestNoExt = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && !f.startsWith('.');\n};\nconst qmarksTestNoExtDot = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && f !== '.' && f !== '..';\n};\n/* c8 ignore start */\nconst defaultPlatform = (typeof process === 'object' && process ?\n (typeof process.env === 'object' &&\n process.env &&\n process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n process.platform\n : 'posix');\nconst path = {\n win32: { sep: '\\\\' },\n posix: { sep: '/' },\n};\n/* c8 ignore stop */\nexport const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;\nminimatch.sep = sep;\nexport const GLOBSTAR = Symbol('globstar **');\nminimatch.GLOBSTAR = GLOBSTAR;\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?';\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?';\nexport const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);\nminimatch.filter = filter;\nconst ext = (a, b = {}) => Object.assign({}, a, b);\nexport const defaults = (def) => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch;\n }\n const orig = minimatch;\n const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));\n return Object.assign(m, {\n Minimatch: class Minimatch extends orig.Minimatch {\n constructor(pattern, options = {}) {\n super(pattern, ext(def, options));\n }\n static defaults(options) {\n return orig.defaults(ext(def, options)).Minimatch;\n }\n },\n AST: class AST extends orig.AST {\n /* c8 ignore start */\n constructor(type, parent, options = {}) {\n super(type, parent, ext(def, options));\n }\n /* c8 ignore stop */\n static fromGlob(pattern, options = {}) {\n return orig.AST.fromGlob(pattern, ext(def, options));\n }\n },\n unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),\n escape: (s, options = {}) => orig.escape(s, ext(def, options)),\n filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),\n defaults: (options) => orig.defaults(ext(def, options)),\n makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),\n braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),\n match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),\n sep: orig.sep,\n GLOBSTAR: GLOBSTAR,\n });\n};\nminimatch.defaults = defaults;\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (pattern, options = {}) => {\n assertValidPattern(pattern);\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern];\n }\n return expand(pattern, { max: options.braceExpandMax });\n};\nminimatch.braceExpand = braceExpand;\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nexport const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();\nminimatch.makeRe = makeRe;\nexport const match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options);\n list = list.filter(f => mm.match(f));\n if (mm.options.nonull && !list.length) {\n list.push(pattern);\n }\n return list;\n};\nminimatch.match = match;\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/;\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\nexport class Minimatch {\n options;\n set;\n pattern;\n windowsPathsNoEscape;\n nonegate;\n negate;\n comment;\n empty;\n preserveMultipleSlashes;\n partial;\n globSet;\n globParts;\n nocase;\n isWindows;\n platform;\n windowsNoMagicRoot;\n maxGlobstarRecursion;\n regexp;\n constructor(pattern, options = {}) {\n assertValidPattern(pattern);\n options = options || {};\n this.options = options;\n this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;\n this.pattern = pattern;\n this.platform = options.platform || defaultPlatform;\n this.isWindows = this.platform === 'win32';\n // avoid the annoying deprecation flag lol\n const awe = ('allowWindow' + 'sEscape');\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options[awe] === false;\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/');\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;\n this.regexp = null;\n this.negate = false;\n this.nonegate = !!options.nonegate;\n this.comment = false;\n this.empty = false;\n this.partial = !!options.partial;\n this.nocase = !!this.options.nocase;\n this.windowsNoMagicRoot =\n options.windowsNoMagicRoot !== undefined ?\n options.windowsNoMagicRoot\n : !!(this.isWindows && this.nocase);\n this.globSet = [];\n this.globParts = [];\n this.set = [];\n // make the set of regexps etc.\n this.make();\n }\n hasMagic() {\n if (this.options.magicalBraces && this.set.length > 1) {\n return true;\n }\n for (const pattern of this.set) {\n for (const part of pattern) {\n if (typeof part !== 'string')\n return true;\n }\n }\n return false;\n }\n debug(..._) { }\n make() {\n const pattern = this.pattern;\n const options = this.options;\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true;\n return;\n }\n if (!pattern) {\n this.empty = true;\n return;\n }\n // step 1: figure out negation, etc.\n this.parseNegate();\n // step 2: expand braces\n this.globSet = [...new Set(this.braceExpand())];\n if (options.debug) {\n //oxlint-disable-next-line no-console\n this.debug = (...args) => console.error(...args);\n }\n this.debug(this.pattern, this.globSet);\n // step 3: now we have a set, so turn each one into a series of\n // path-portion matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n //\n // First, we preprocess to make the glob pattern sets a bit simpler\n // and deduped. There are some perf-killing patterns that can cause\n // problems with a glob walk, but we can simplify them down a bit.\n const rawGlobParts = this.globSet.map(s => this.slashSplit(s));\n this.globParts = this.preprocess(rawGlobParts);\n this.debug(this.pattern, this.globParts);\n // glob --> regexps\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path.\n const isUNC = s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n !globMagic.test(s[3]);\n const isDrive = /^[a-z]:/i.test(s[0]);\n if (isUNC) {\n return [\n ...s.slice(0, 4),\n ...s.slice(4).map(ss => this.parse(ss)),\n ];\n }\n else if (isDrive) {\n return [s[0], ...s.slice(1).map(ss => this.parse(ss))];\n }\n }\n return s.map(ss => this.parse(ss));\n });\n this.debug(this.pattern, set);\n // filter out everything that didn't compile properly.\n this.set = set.filter(s => s.indexOf(false) === -1);\n // do not treat the ? in UNC paths as magic\n if (this.isWindows) {\n for (let i = 0; i < this.set.length; i++) {\n const p = this.set[i];\n if (p[0] === '' &&\n p[1] === '' &&\n this.globParts[i][2] === '?' &&\n typeof p[3] === 'string' &&\n /^[a-z]:$/i.test(p[3])) {\n p[2] = '?';\n }\n }\n }\n this.debug(this.pattern, this.set);\n }\n // various transforms to equivalent pattern sets that are\n // faster to process in a filesystem walk. The goal is to\n // eliminate what we can, and push all ** patterns as far\n // to the right as possible, even if it increases the number\n // of patterns that we have to process.\n preprocess(globParts) {\n // if we're not in globstar mode, then turn ** into *\n if (this.options.noglobstar) {\n for (const partset of globParts) {\n for (let j = 0; j < partset.length; j++) {\n if (partset[j] === '**') {\n partset[j] = '*';\n }\n }\n }\n }\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n // aggressive optimization for the purpose of fs walking\n globParts = this.firstPhasePreProcess(globParts);\n globParts = this.secondPhasePreProcess(globParts);\n }\n else if (optimizationLevel >= 1) {\n // just basic optimizations to remove some .. parts\n globParts = this.levelOneOptimize(globParts);\n }\n else {\n // just collapse multiple ** portions into one\n globParts = this.adjascentGlobstarOptimize(globParts);\n }\n return globParts;\n }\n // just get rid of adjascent ** portions\n adjascentGlobstarOptimize(globParts) {\n return globParts.map(parts => {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let i = gs;\n while (parts[i + 1] === '**') {\n i++;\n }\n if (i !== gs) {\n parts.splice(gs, i - gs);\n }\n }\n return parts;\n });\n }\n // get rid of adjascent ** and resolve .. portions\n levelOneOptimize(globParts) {\n return globParts.map(parts => {\n parts = parts.reduce((set, part) => {\n const prev = set[set.length - 1];\n if (part === '**' && prev === '**') {\n return set;\n }\n if (part === '..') {\n if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n set.pop();\n return set;\n }\n }\n set.push(part);\n return set;\n }, []);\n return parts.length === 0 ? [''] : parts;\n });\n }\n levelTwoFileOptimize(parts) {\n if (!Array.isArray(parts)) {\n parts = this.slashSplit(parts);\n }\n let didSomething = false;\n do {\n didSomething = false;\n //
// -> 
/\n            if (!this.preserveMultipleSlashes) {\n                for (let i = 1; i < parts.length - 1; i++) {\n                    const p = parts[i];\n                    // don't squeeze out UNC patterns\n                    if (i === 1 && p === '' && parts[0] === '')\n                        continue;\n                    if (p === '.' || p === '') {\n                        didSomething = true;\n                        parts.splice(i, 1);\n                        i--;\n                    }\n                }\n                if (parts[0] === '.' &&\n                    parts.length === 2 &&\n                    (parts[1] === '.' || parts[1] === '')) {\n                    didSomething = true;\n                    parts.pop();\n                }\n            }\n            // 
/

/../ ->

/\n            let dd = 0;\n            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                const p = parts[dd - 1];\n                if (p &&\n                    p !== '.' &&\n                    p !== '..' &&\n                    p !== '**' &&\n                    !(this.isWindows && /^[a-z]:$/i.test(p))) {\n                    didSomething = true;\n                    parts.splice(dd - 1, 2);\n                    dd -= 2;\n                }\n            }\n        } while (didSomething);\n        return parts.length === 0 ? [''] : parts;\n    }\n    // First phase: single-pattern processing\n    // 
 is 1 or more portions\n    //  is 1 or more portions\n    // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n    // 
/

/../ ->

/\n    // **/**/ -> **/\n    //\n    // **/*/ -> */**/ <== not valid because ** doesn't follow\n    // this WOULD be allowed if ** did follow symlinks, or * didn't\n    firstPhasePreProcess(globParts) {\n        let didSomething = false;\n        do {\n            didSomething = false;\n            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss = gs;\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n                        gss++;\n                    }\n                    // eg, if gs is 2 and gss is 4, that means we have 3 **\n                    // parts, and can remove 2 of them.\n                    if (gss > gs) {\n                        parts.splice(gs + 1, gss - gs);\n                    }\n                    let next = parts[gs + 1];\n                    const p = parts[gs + 2];\n                    const p2 = parts[gs + 3];\n                    if (next !== '..')\n                        continue;\n                    if (!p ||\n                        p === '.' ||\n                        p === '..' ||\n                        !p2 ||\n                        p2 === '.' ||\n                        p2 === '..') {\n                        continue;\n                    }\n                    didSomething = true;\n                    // edit parts in place, and push the new one\n                    parts.splice(gs, 1);\n                    const other = parts.slice(0);\n                    other[gs] = '**';\n                    globParts.push(other);\n                    gs--;\n                }\n                // 
// -> 
/\n                if (!this.preserveMultipleSlashes) {\n                    for (let i = 1; i < parts.length - 1; i++) {\n                        const p = parts[i];\n                        // don't squeeze out UNC patterns\n                        if (i === 1 && p === '' && parts[0] === '')\n                            continue;\n                        if (p === '.' || p === '') {\n                            didSomething = true;\n                            parts.splice(i, 1);\n                            i--;\n                        }\n                    }\n                    if (parts[0] === '.' &&\n                        parts.length === 2 &&\n                        (parts[1] === '.' || parts[1] === '')) {\n                        didSomething = true;\n                        parts.pop();\n                    }\n                }\n                // 
/

/../ ->

/\n                let dd = 0;\n                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                    const p = parts[dd - 1];\n                    if (p && p !== '.' && p !== '..' && p !== '**') {\n                        didSomething = true;\n                        const needDot = dd === 1 && parts[dd + 1] === '**';\n                        const splin = needDot ? ['.'] : [];\n                        parts.splice(dd - 1, 2, ...splin);\n                        if (parts.length === 0)\n                            parts.push('');\n                        dd -= 2;\n                    }\n                }\n            }\n        } while (didSomething);\n        return globParts;\n    }\n    // second phase: multi-pattern dedupes\n    // {
/*/,
/

/} ->

/*/\n    // {
/,
/} -> 
/\n    // {
/**/,
/} -> 
/**/\n    //\n    // {
/**/,
/**/

/} ->

/**/\n    // ^-- not valid because ** doens't follow symlinks\n    secondPhasePreProcess(globParts) {\n        for (let i = 0; i < globParts.length - 1; i++) {\n            for (let j = i + 1; j < globParts.length; j++) {\n                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);\n                if (matched) {\n                    globParts[i] = [];\n                    globParts[j] = matched;\n                    break;\n                }\n            }\n        }\n        return globParts.filter(gs => gs.length);\n    }\n    partsMatch(a, b, emptyGSMatch = false) {\n        let ai = 0;\n        let bi = 0;\n        let result = [];\n        let which = '';\n        while (ai < a.length && bi < b.length) {\n            if (a[ai] === b[bi]) {\n                result.push(which === 'b' ? b[bi] : a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n                result.push(a[ai]);\n                ai++;\n            }\n            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n                result.push(b[bi]);\n                bi++;\n            }\n            else if (a[ai] === '*' &&\n                b[bi] &&\n                (this.options.dot || !b[bi].startsWith('.')) &&\n                b[bi] !== '**') {\n                if (which === 'b')\n                    return false;\n                which = 'a';\n                result.push(a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (b[bi] === '*' &&\n                a[ai] &&\n                (this.options.dot || !a[ai].startsWith('.')) &&\n                a[ai] !== '**') {\n                if (which === 'a')\n                    return false;\n                which = 'b';\n                result.push(b[bi]);\n                ai++;\n                bi++;\n            }\n            else {\n                return false;\n            }\n        }\n        // if we fall out of the loop, it means they two are identical\n        // as long as their lengths match\n        return a.length === b.length && result;\n    }\n    parseNegate() {\n        if (this.nonegate)\n            return;\n        const pattern = this.pattern;\n        let negate = false;\n        let negateOffset = 0;\n        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n            negate = !negate;\n            negateOffset++;\n        }\n        if (negateOffset)\n            this.pattern = pattern.slice(negateOffset);\n        this.negate = negate;\n    }\n    // set partial to true to test if, for example,\n    // \"/a/b\" matches the start of \"/*/b/*/d\"\n    // Partial means, if you run out of file before you run\n    // out of pattern, then that's fine, as long as all\n    // the parts match.\n    matchOne(file, pattern, partial = false) {\n        let fileStartIndex = 0;\n        let patternStartIndex = 0;\n        // UNC paths like //?/X:/... can match X:/... and vice versa\n        // Drive letters in absolute drive or unc paths are always compared\n        // case-insensitively.\n        if (this.isWindows) {\n            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);\n            const fileUNC = !fileDrive &&\n                file[0] === '' &&\n                file[1] === '' &&\n                file[2] === '?' &&\n                /^[a-z]:$/i.test(file[3]);\n            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);\n            const patternUNC = !patternDrive &&\n                pattern[0] === '' &&\n                pattern[1] === '' &&\n                pattern[2] === '?' &&\n                typeof pattern[3] === 'string' &&\n                /^[a-z]:$/i.test(pattern[3]);\n            const fdi = fileUNC ? 3\n                : fileDrive ? 0\n                    : undefined;\n            const pdi = patternUNC ? 3\n                : patternDrive ? 0\n                    : undefined;\n            if (typeof fdi === 'number' && typeof pdi === 'number') {\n                const [fd, pd] = [\n                    file[fdi],\n                    pattern[pdi],\n                ];\n                // start matching at the drive letter index of each\n                if (fd.toLowerCase() === pd.toLowerCase()) {\n                    pattern[pdi] = fd;\n                    patternStartIndex = pdi;\n                    fileStartIndex = fdi;\n                }\n            }\n        }\n        // resolve and reduce . and .. portions in the file as well.\n        // don't need to do the second phase, because it's only one string[]\n        const { optimizationLevel = 1 } = this.options;\n        if (optimizationLevel >= 2) {\n            file = this.levelTwoFileOptimize(file);\n        }\n        if (pattern.includes(GLOBSTAR)) {\n            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);\n        }\n        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);\n    }\n    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {\n        // split the pattern into head, tail, and middle of ** delimited parts\n        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);\n        const lastgs = pattern.lastIndexOf(GLOBSTAR);\n        // split the pattern up into globstar-delimited sections\n        // the tail has to be at the end, and the others just have\n        // to be found in order from the head.\n        const [head, body, tail] = partial ?\n            [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1),\n                [],\n            ]\n            : [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1, lastgs),\n                pattern.slice(lastgs + 1),\n            ];\n        // check the head, from the current file/pattern index.\n        if (head.length) {\n            const fileHead = file.slice(fileIndex, fileIndex + head.length);\n            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n                return false;\n            }\n            fileIndex += head.length;\n            patternIndex += head.length;\n        }\n        // now we know the head matches!\n        // if the last portion is not empty, it MUST match the end\n        // check the tail\n        let fileTailMatch = 0;\n        if (tail.length) {\n            // if head + tail > file, then we cannot possibly match\n            if (tail.length + fileIndex > file.length)\n                return false;\n            // try to match the tail\n            let tailStart = file.length - tail.length;\n            if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n                fileTailMatch = tail.length;\n            }\n            else {\n                // affordance for stuff like a/**/* matching a/b/\n                // if the last file portion is '', and there's more to the pattern\n                // then try without the '' bit.\n                if (file[file.length - 1] !== '' ||\n                    fileIndex + tail.length === file.length) {\n                    return false;\n                }\n                tailStart--;\n                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n                    return false;\n                }\n                fileTailMatch = tail.length + 1;\n            }\n        }\n        // now we know the tail matches!\n        // the middle is zero or more portions wrapped in **, possibly\n        // containing more ** sections.\n        // so a/**/b/**/c/**/d has become **/b/**/c/**\n        // if it's empty, it means a/**/b, just verify we have no bad dots\n        // if there's no tail, so it ends on /**, then we must have *something*\n        // after the head, or it's not a matc\n        if (!body.length) {\n            let sawSome = !!fileTailMatch;\n            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n                const f = String(file[i]);\n                sawSome = true;\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            // in partial mode, we just need to get past all file parts\n            return partial || sawSome;\n        }\n        // now we know that there's one or more body sections, which can\n        // be matched anywhere from the 0 index (because the head was pruned)\n        // through to the length-fileTailMatch index.\n        // split the body up into sections, and note the minimum index it can\n        // be found at (start with the length of all previous segments)\n        // [section, before, after]\n        const bodySegments = [[[], 0]];\n        let currentBody = bodySegments[0];\n        let nonGsParts = 0;\n        const nonGsPartsSums = [0];\n        for (const b of body) {\n            if (b === GLOBSTAR) {\n                nonGsPartsSums.push(nonGsParts);\n                currentBody = [[], 0];\n                bodySegments.push(currentBody);\n            }\n            else {\n                currentBody[0].push(b);\n                nonGsParts++;\n            }\n        }\n        let i = bodySegments.length - 1;\n        const fileLength = file.length - fileTailMatch;\n        for (const b of bodySegments) {\n            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);\n        }\n        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);\n    }\n    // return false for \"nope, not matching\"\n    // return null for \"not matching, cannot keep trying\"\n    #matchGlobStarBodySections(file, \n    // pattern section, last possible position for it\n    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {\n        // take the first body segment, and walk from fileIndex to its \"after\"\n        // value at the end\n        // If it doesn't match at that position, we increment, until we hit\n        // that final possible position, and give up.\n        // If it does match, then advance and try to rest.\n        // If any of them fail we keep walking forward.\n        // this is still a bit recursively painful, but it's more constrained\n        // than previous implementations, because we never test something that\n        // can't possibly be a valid matching condition.\n        const bs = bodySegments[bodyIndex];\n        if (!bs) {\n            // just make sure that there's no bad dots\n            for (let i = fileIndex; i < file.length; i++) {\n                sawTail = true;\n                const f = file[i];\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            return sawTail;\n        }\n        // have a non-globstar body section to test\n        const [body, after] = bs;\n        while (fileIndex <= after) {\n            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);\n            // if limit exceeded, no match. intentional false negative,\n            // acceptable break in correctness for security.\n            if (m && globStarDepth < this.maxGlobstarRecursion) {\n                // match! see if the rest match. if so, we're done!\n                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);\n                if (sub !== false) {\n                    return sub;\n                }\n            }\n            const f = file[fileIndex];\n            if (f === '.' ||\n                f === '..' ||\n                (!this.options.dot && f.startsWith('.'))) {\n                return false;\n            }\n            fileIndex++;\n        }\n        // walked off. no point continuing\n        return partial || null;\n    }\n    #matchOne(file, pattern, partial, fileIndex, patternIndex) {\n        let fi;\n        let pi;\n        let pl;\n        let fl;\n        for (fi = fileIndex,\n            pi = patternIndex,\n            fl = file.length,\n            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {\n            this.debug('matchOne loop');\n            let p = pattern[pi];\n            let f = file[fi];\n            this.debug(pattern, p, f);\n            // should be impossible.\n            // some invalid regexp stuff in the set.\n            /* c8 ignore start */\n            if (p === false || p === GLOBSTAR) {\n                return false;\n            }\n            /* c8 ignore stop */\n            // something other than **\n            // non-magic patterns just have to match exactly\n            // patterns with magic have been turned into regexps.\n            let hit;\n            if (typeof p === 'string') {\n                hit = f === p;\n                this.debug('string match', p, f, hit);\n            }\n            else {\n                hit = p.test(f);\n                this.debug('pattern match', p, f, hit);\n            }\n            if (!hit)\n                return false;\n        }\n        // Note: ending in / means that we'll get a final \"\"\n        // at the end of the pattern.  This can only match a\n        // corresponding \"\" at the end of the file.\n        // If the file ends in /, then it can only match a\n        // a pattern that ends in /, unless the pattern just\n        // doesn't have any more for it. But, a/b/ should *not*\n        // match \"a/b/*\", even though \"\" matches against the\n        // [^/]*? pattern, except in partial mode, where it might\n        // simply not be reached yet.\n        // However, a/b/ should still satisfy a/*\n        // now either we fell off the end of the pattern, or we're done.\n        if (fi === fl && pi === pl) {\n            // ran out of pattern and filename at the same time.\n            // an exact hit!\n            return true;\n        }\n        else if (fi === fl) {\n            // ran out of file, but still had pattern left.\n            // this is ok if we're doing the match as part of\n            // a glob fs traversal.\n            return partial;\n        }\n        else if (pi === pl) {\n            // ran out of pattern, still have file left.\n            // this is only acceptable if we're on the very last\n            // empty segment of a file with a trailing slash.\n            // a/* should match a/b/\n            return fi === fl - 1 && file[fi] === '';\n            /* c8 ignore start */\n        }\n        else {\n            // should be unreachable.\n            throw new Error('wtf?');\n        }\n        /* c8 ignore stop */\n    }\n    braceExpand() {\n        return braceExpand(this.pattern, this.options);\n    }\n    parse(pattern) {\n        assertValidPattern(pattern);\n        const options = this.options;\n        // shortcuts\n        if (pattern === '**')\n            return GLOBSTAR;\n        if (pattern === '')\n            return '';\n        // far and away, the most common glob pattern parts are\n        // *, *.*, and *.  Add a fast check method for those.\n        let m;\n        let fastTest = null;\n        if ((m = pattern.match(starRE))) {\n            fastTest = options.dot ? starTestDot : starTest;\n        }\n        else if ((m = pattern.match(starDotExtRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    starDotExtTestNocaseDot\n                    : starDotExtTestNocase\n                : options.dot ? starDotExtTestDot\n                    : starDotExtTest)(m[1]);\n        }\n        else if ((m = pattern.match(qmarksRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    qmarksTestNocaseDot\n                    : qmarksTestNocase\n                : options.dot ? qmarksTestDot\n                    : qmarksTest)(m);\n        }\n        else if ((m = pattern.match(starDotStarRE))) {\n            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;\n        }\n        else if ((m = pattern.match(dotStarRE))) {\n            fastTest = dotStarTest;\n        }\n        const re = AST.fromGlob(pattern, this.options).toMMPattern();\n        if (fastTest && typeof re === 'object') {\n            // Avoids overriding in frozen environments\n            Reflect.defineProperty(re, 'test', { value: fastTest });\n        }\n        return re;\n    }\n    makeRe() {\n        if (this.regexp || this.regexp === false)\n            return this.regexp;\n        // at this point, this.set is a 2d array of partial\n        // pattern strings, or \"**\".\n        //\n        // It's better to use .match().  This function shouldn't\n        // be used, really, but it's pretty convenient sometimes,\n        // when you just want to work with a regex.\n        const set = this.set;\n        if (!set.length) {\n            this.regexp = false;\n            return this.regexp;\n        }\n        const options = this.options;\n        const twoStar = options.noglobstar ? star\n            : options.dot ? twoStarDot\n                : twoStarNoDot;\n        const flags = new Set(options.nocase ? ['i'] : []);\n        // regexpify non-globstar patterns\n        // if ** is only item, then we just do one twoStar\n        // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n        // if ** is last, append (\\/twoStar|) to previous\n        // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n        // then filter out GLOBSTAR symbols\n        let re = set\n            .map(pattern => {\n            const pp = pattern.map(p => {\n                if (p instanceof RegExp) {\n                    for (const f of p.flags.split(''))\n                        flags.add(f);\n                }\n                return (typeof p === 'string' ? regExpEscape(p)\n                    : p === GLOBSTAR ? GLOBSTAR\n                        : p._src);\n            });\n            pp.forEach((p, i) => {\n                const next = pp[i + 1];\n                const prev = pp[i - 1];\n                if (p !== GLOBSTAR || prev === GLOBSTAR) {\n                    return;\n                }\n                if (prev === undefined) {\n                    if (next !== undefined && next !== GLOBSTAR) {\n                        pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next;\n                    }\n                    else {\n                        pp[i] = twoStar;\n                    }\n                }\n                else if (next === undefined) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?';\n                }\n                else if (next !== GLOBSTAR) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next;\n                    pp[i + 1] = GLOBSTAR;\n                }\n            });\n            const filtered = pp.filter(p => p !== GLOBSTAR);\n            // For partial matches, we need to make the pattern match\n            // any prefix of the full path. We do this by generating\n            // alternative patterns that match progressively longer prefixes.\n            if (this.partial && filtered.length >= 1) {\n                const prefixes = [];\n                for (let i = 1; i <= filtered.length; i++) {\n                    prefixes.push(filtered.slice(0, i).join('/'));\n                }\n                return '(?:' + prefixes.join('|') + ')';\n            }\n            return filtered.join('/');\n        })\n            .join('|');\n        // need to wrap in parens if we had more than one thing with |,\n        // otherwise only the first will be anchored to ^ and the last to $\n        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];\n        // must match entire pattern\n        // ending in a * or ** will make it less strict.\n        re = '^' + open + re + close + '$';\n        // In partial mode, '/' should always match as it's a valid prefix for any pattern\n        if (this.partial) {\n            re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$';\n        }\n        // can match anything, as long as it's not this.\n        if (this.negate)\n            re = '^(?!' + re + ').+$';\n        try {\n            this.regexp = new RegExp(re, [...flags].join(''));\n            /* c8 ignore start */\n        }\n        catch {\n            // should be impossible\n            this.regexp = false;\n        }\n        /* c8 ignore stop */\n        return this.regexp;\n    }\n    slashSplit(p) {\n        // if p starts with // on windows, we preserve that\n        // so that UNC paths aren't broken.  Otherwise, any number of\n        // / characters are coalesced into one, unless\n        // preserveMultipleSlashes is set to true.\n        if (this.preserveMultipleSlashes) {\n            return p.split('/');\n        }\n        else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n            // add an extra '' for the one we lose\n            return ['', ...p.split(/\\/+/)];\n        }\n        else {\n            return p.split(/\\/+/);\n        }\n    }\n    match(f, partial = this.partial) {\n        this.debug('match', f, this.pattern);\n        // short-circuit in the case of busted things.\n        // comments, etc.\n        if (this.comment) {\n            return false;\n        }\n        if (this.empty) {\n            return f === '';\n        }\n        if (f === '/' && partial) {\n            return true;\n        }\n        const options = this.options;\n        // windows: need to use /, not \\\n        if (this.isWindows) {\n            f = f.split('\\\\').join('/');\n        }\n        // treat the test path as a set of pathparts.\n        const ff = this.slashSplit(f);\n        this.debug(this.pattern, 'split', ff);\n        // just ONE of the pattern sets in this.set needs to match\n        // in order for it to be valid.  If negating, then just one\n        // match means that we have failed.\n        // Either way, return on the first hit.\n        const set = this.set;\n        this.debug(this.pattern, 'set', set);\n        // Find the basename of the path by looking for the last non-empty segment\n        let filename = ff[ff.length - 1];\n        if (!filename) {\n            for (let i = ff.length - 2; !filename && i >= 0; i--) {\n                filename = ff[i];\n            }\n        }\n        for (const pattern of set) {\n            let file = ff;\n            if (options.matchBase && pattern.length === 1) {\n                file = [filename];\n            }\n            const hit = this.matchOne(file, pattern, partial);\n            if (hit) {\n                if (options.flipNegate) {\n                    return true;\n                }\n                return !this.negate;\n            }\n        }\n        // didn't get any hits.  this is success if it's a negative\n        // pattern, failure otherwise.\n        if (options.flipNegate) {\n            return false;\n        }\n        return this.negate;\n    }\n    static defaults(def) {\n        return minimatch.defaults(def).Minimatch;\n    }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js';\nexport { escape } from './escape.js';\nexport { unescape } from './unescape.js';\n/* c8 ignore stop */\nminimatch.AST = AST;\nminimatch.Minimatch = Minimatch;\nminimatch.escape = escape;\nminimatch.unescape = unescape;\n//# sourceMappingURL=index.js.map","import * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Helper class for parsing paths into segments\n */\nexport class Path {\n    /**\n     * Constructs a Path\n     * @param itemPath Path or array of segments\n     */\n    constructor(itemPath) {\n        this.segments = [];\n        // String\n        if (typeof itemPath === 'string') {\n            assert(itemPath, `Parameter 'itemPath' must not be empty`);\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n            // Not rooted\n            if (!pathHelper.hasRoot(itemPath)) {\n                this.segments = itemPath.split(path.sep);\n            }\n            // Rooted\n            else {\n                // Add all segments, while not at the root\n                let remaining = itemPath;\n                let dir = pathHelper.dirname(remaining);\n                while (dir !== remaining) {\n                    // Add the segment\n                    const basename = path.basename(remaining);\n                    this.segments.unshift(basename);\n                    // Truncate the last segment\n                    remaining = dir;\n                    dir = pathHelper.dirname(remaining);\n                }\n                // Remainder is the root\n                this.segments.unshift(remaining);\n            }\n        }\n        // Array\n        else {\n            // Must not be empty\n            assert(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);\n            // Each segment\n            for (let i = 0; i < itemPath.length; i++) {\n                let segment = itemPath[i];\n                // Must not be empty\n                assert(segment, `Parameter 'itemPath' must not contain any empty segments`);\n                // Normalize slashes\n                segment = pathHelper.normalizeSeparators(itemPath[i]);\n                // Root segment\n                if (i === 0 && pathHelper.hasRoot(segment)) {\n                    segment = pathHelper.safeTrimTrailingSeparator(segment);\n                    assert(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);\n                    this.segments.push(segment);\n                }\n                // All other segments\n                else {\n                    // Must not contain slash\n                    assert(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);\n                    this.segments.push(segment);\n                }\n            }\n        }\n    }\n    /**\n     * Converts the path to it's string representation\n     */\n    toString() {\n        // First segment\n        let result = this.segments[0];\n        // All others\n        let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n        for (let i = 1; i < this.segments.length; i++) {\n            if (skipSlash) {\n                skipSlash = false;\n            }\n            else {\n                result += path.sep;\n            }\n            result += this.segments[i];\n        }\n        return result;\n    }\n}\n//# sourceMappingURL=internal-path.js.map","import * as os from 'os';\nimport * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nimport { Minimatch } from 'minimatch';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Path } from './internal-path.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class Pattern {\n    constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) {\n        /**\n         * Indicates whether matches should be excluded from the result set\n         */\n        this.negate = false;\n        // Pattern overload\n        let pattern;\n        if (typeof patternOrNegate === 'string') {\n            pattern = patternOrNegate.trim();\n        }\n        // Segments overload\n        else {\n            // Convert to pattern\n            segments = segments || [];\n            assert(segments.length, `Parameter 'segments' must not empty`);\n            const root = Pattern.getLiteral(segments[0]);\n            assert(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);\n            pattern = new Path(segments).toString().trim();\n            if (patternOrNegate) {\n                pattern = `!${pattern}`;\n            }\n        }\n        // Negate\n        while (pattern.startsWith('!')) {\n            this.negate = !this.negate;\n            pattern = pattern.substr(1).trim();\n        }\n        // Normalize slashes and ensures absolute root\n        pattern = Pattern.fixupPattern(pattern, homedir);\n        // Segments\n        this.segments = new Path(pattern).segments;\n        // Trailing slash indicates the pattern should only match directories, not regular files\n        this.trailingSeparator = pathHelper\n            .normalizeSeparators(pattern)\n            .endsWith(path.sep);\n        pattern = pathHelper.safeTrimTrailingSeparator(pattern);\n        // Search path (literal path prior to the first glob segment)\n        let foundGlob = false;\n        const searchSegments = this.segments\n            .map(x => Pattern.getLiteral(x))\n            .filter(x => !foundGlob && !(foundGlob = x === ''));\n        this.searchPath = new Path(searchSegments).toString();\n        // Root RegExp (required when determining partial match)\n        this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : '');\n        this.isImplicitPattern = isImplicitPattern;\n        // Create minimatch\n        const minimatchOptions = {\n            dot: true,\n            nobrace: true,\n            nocase: IS_WINDOWS,\n            nocomment: true,\n            noext: true,\n            nonegate: true\n        };\n        pattern = IS_WINDOWS ? pattern.replace(/\\\\/g, '/') : pattern;\n        this.minimatch = new Minimatch(pattern, minimatchOptions);\n    }\n    /**\n     * Matches the pattern against the specified path\n     */\n    match(itemPath) {\n        // Last segment is globstar?\n        if (this.segments[this.segments.length - 1] === '**') {\n            // Normalize slashes\n            itemPath = pathHelper.normalizeSeparators(itemPath);\n            // Append a trailing slash. Otherwise Minimatch will not match the directory immediately\n            // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns\n            // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.\n            if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) {\n                // Note, this is safe because the constructor ensures the pattern has an absolute root.\n                // For example, formats like C: and C:foo on Windows are resolved to an absolute root.\n                itemPath = `${itemPath}${path.sep}`;\n            }\n        }\n        else {\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        }\n        // Match\n        if (this.minimatch.match(itemPath)) {\n            return this.trailingSeparator ? MatchKind.Directory : MatchKind.All;\n        }\n        return MatchKind.None;\n    }\n    /**\n     * Indicates whether the pattern may match descendants of the specified path\n     */\n    partialMatch(itemPath) {\n        // Normalize slashes and trim unnecessary trailing slash\n        itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        // matchOne does not handle root path correctly\n        if (pathHelper.dirname(itemPath) === itemPath) {\n            return this.rootRegExp.test(itemPath);\n        }\n        return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\\\+/ : /\\/+/), this.minimatch.set[0], true);\n    }\n    /**\n     * Escapes glob patterns within a path\n     */\n    static globEscape(s) {\n        return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n            .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n            .replace(/\\?/g, '[?]') // escape '?'\n            .replace(/\\*/g, '[*]'); // escape '*'\n    }\n    /**\n     * Normalizes slashes and ensures absolute root\n     */\n    static fixupPattern(pattern, homedir) {\n        // Empty\n        assert(pattern, 'pattern cannot be empty');\n        // Must not contain `.` segment, unless first segment\n        // Must not contain `..` segment\n        const literalSegments = new Path(pattern).segments.map(x => Pattern.getLiteral(x));\n        assert(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);\n        // Must not contain globs in root, e.g. Windows UNC path \\\\foo\\b*r\n        assert(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);\n        // Normalize slashes\n        pattern = pathHelper.normalizeSeparators(pattern);\n        // Replace leading `.` segment\n        if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) {\n            pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1);\n        }\n        // Replace leading `~` segment\n        else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {\n            homedir = homedir || os.homedir();\n            assert(homedir, 'Unable to determine HOME directory');\n            assert(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);\n            pattern = Pattern.globEscape(homedir) + pattern.substr(1);\n        }\n        // Replace relative drive root, e.g. pattern is C: or C:foo\n        else if (IS_WINDOWS &&\n            (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\\\]/i))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', pattern.substr(0, 2));\n            if (pattern.length > 2 && !root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(2);\n        }\n        // Replace relative root, e.g. pattern is \\ or \\foo\n        else if (IS_WINDOWS && (pattern === '\\\\' || pattern.match(/^\\\\[^\\\\]/))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', '\\\\');\n            if (!root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(1);\n        }\n        // Otherwise ensure absolute root\n        else {\n            pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern);\n        }\n        return pathHelper.normalizeSeparators(pattern);\n    }\n    /**\n     * Attempts to unescape a pattern segment to create a literal path segment.\n     * Otherwise returns empty string.\n     */\n    static getLiteral(segment) {\n        let literal = '';\n        for (let i = 0; i < segment.length; i++) {\n            const c = segment[i];\n            // Escape\n            if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n                literal += segment[++i];\n                continue;\n            }\n            // Wildcard\n            else if (c === '*' || c === '?') {\n                return '';\n            }\n            // Character set\n            else if (c === '[' && i + 1 < segment.length) {\n                let set = '';\n                let closed = -1;\n                for (let i2 = i + 1; i2 < segment.length; i2++) {\n                    const c2 = segment[i2];\n                    // Escape\n                    if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n                        set += segment[++i2];\n                        continue;\n                    }\n                    // Closed\n                    else if (c2 === ']') {\n                        closed = i2;\n                        break;\n                    }\n                    // Otherwise\n                    else {\n                        set += c2;\n                    }\n                }\n                // Closed?\n                if (closed >= 0) {\n                    // Cannot convert\n                    if (set.length > 1) {\n                        return '';\n                    }\n                    // Convert to literal\n                    if (set) {\n                        literal += set;\n                        i = closed;\n                        continue;\n                    }\n                }\n                // Otherwise fall thru\n            }\n            // Append\n            literal += c;\n        }\n        return literal;\n    }\n    /**\n     * Escapes regexp special characters\n     * https://javascript.info/regexp-escaping\n     */\n    static regExpEscape(s) {\n        return s.replace(/[[\\\\^$.|?*+()]/g, '\\\\$&');\n    }\n}\n//# sourceMappingURL=internal-pattern.js.map","export class SearchState {\n    constructor(path, level) {\n        this.path = path;\n        this.level = level;\n    }\n}\n//# sourceMappingURL=internal-search-state.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\n    return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n    function fulfill(value) { resume(\"next\", value); }\n    function reject(value) { resume(\"throw\", value); }\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as globOptionsHelper from './internal-glob-options-helper.js';\nimport * as path from 'path';\nimport * as patternHelper from './internal-pattern-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Pattern } from './internal-pattern.js';\nimport { SearchState } from './internal-search-state.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class DefaultGlobber {\n    constructor(options) {\n        this.patterns = [];\n        this.searchPaths = [];\n        this.options = globOptionsHelper.getOptions(options);\n    }\n    getSearchPaths() {\n        // Return a copy\n        return this.searchPaths.slice();\n    }\n    glob() {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a, e_1, _b, _c;\n            const result = [];\n            try {\n                for (var _d = true, _e = __asyncValues(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {\n                    _c = _f.value;\n                    _d = false;\n                    const itemPath = _c;\n                    result.push(itemPath);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            return result;\n        });\n    }\n    globGenerator() {\n        return __asyncGenerator(this, arguments, function* globGenerator_1() {\n            // Fill in defaults options\n            const options = globOptionsHelper.getOptions(this.options);\n            // Implicit descendants?\n            const patterns = [];\n            for (const pattern of this.patterns) {\n                patterns.push(pattern);\n                if (options.implicitDescendants &&\n                    (pattern.trailingSeparator ||\n                        pattern.segments[pattern.segments.length - 1] !== '**')) {\n                    patterns.push(new Pattern(pattern.negate, true, pattern.segments.concat('**')));\n                }\n            }\n            // Push the search paths\n            const stack = [];\n            for (const searchPath of patternHelper.getSearchPaths(patterns)) {\n                core.debug(`Search path '${searchPath}'`);\n                // Exists?\n                try {\n                    // Intentionally using lstat. Detection for broken symlink\n                    // will be performed later (if following symlinks).\n                    yield __await(fs.promises.lstat(searchPath));\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        continue;\n                    }\n                    throw err;\n                }\n                stack.unshift(new SearchState(searchPath, 1));\n            }\n            // Search\n            const traversalChain = []; // used to detect cycles\n            while (stack.length) {\n                // Pop\n                const item = stack.pop();\n                // Match?\n                const match = patternHelper.match(patterns, item.path);\n                const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path);\n                if (!match && !partialMatch) {\n                    continue;\n                }\n                // Stat\n                const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain)\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                );\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                if (!stats) {\n                    continue;\n                }\n                // Hidden file or directory?\n                if (options.excludeHiddenFiles && path.basename(item.path).match(/^\\./)) {\n                    continue;\n                }\n                // Directory\n                if (stats.isDirectory()) {\n                    // Matched\n                    if (match & MatchKind.Directory && options.matchDirectories) {\n                        yield yield __await(item.path);\n                    }\n                    // Descend?\n                    else if (!partialMatch) {\n                        continue;\n                    }\n                    // Push the child items in reverse\n                    const childLevel = item.level + 1;\n                    const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new SearchState(path.join(item.path, x), childLevel));\n                    stack.push(...childItems.reverse());\n                }\n                // File\n                else if (match & MatchKind.File) {\n                    yield yield __await(item.path);\n                }\n            }\n        });\n    }\n    /**\n     * Constructs a DefaultGlobber\n     */\n    static create(patterns, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const result = new DefaultGlobber(options);\n            if (IS_WINDOWS) {\n                patterns = patterns.replace(/\\r\\n/g, '\\n');\n                patterns = patterns.replace(/\\r/g, '\\n');\n            }\n            const lines = patterns.split('\\n').map(x => x.trim());\n            for (const line of lines) {\n                // Empty or comment\n                if (!line || line.startsWith('#')) {\n                    continue;\n                }\n                // Pattern\n                else {\n                    result.patterns.push(new Pattern(line));\n                }\n            }\n            result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns));\n            return result;\n        });\n    }\n    static stat(item, options, traversalChain) {\n        return __awaiter(this, void 0, void 0, function* () {\n            // Note:\n            // `stat` returns info about the target of a symlink (or symlink chain)\n            // `lstat` returns info about a symlink itself\n            let stats;\n            if (options.followSymbolicLinks) {\n                try {\n                    // Use `stat` (following symlinks)\n                    stats = yield fs.promises.stat(item.path);\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        if (options.omitBrokenSymbolicLinks) {\n                            core.debug(`Broken symlink '${item.path}'`);\n                            return undefined;\n                        }\n                        throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);\n                    }\n                    throw err;\n                }\n            }\n            else {\n                // Use `lstat` (not following symlinks)\n                stats = yield fs.promises.lstat(item.path);\n            }\n            // Note, isDirectory() returns false for the lstat of a symlink\n            if (stats.isDirectory() && options.followSymbolicLinks) {\n                // Get the realpath\n                const realPath = yield fs.promises.realpath(item.path);\n                // Fixup the traversal chain to match the item level\n                while (traversalChain.length >= item.level) {\n                    traversalChain.pop();\n                }\n                // Test for a cycle\n                if (traversalChain.some((x) => x === realPath)) {\n                    core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);\n                    return undefined;\n                }\n                // Update the traversal chain\n                traversalChain.push(realPath);\n            }\n            return stats;\n        });\n    }\n}\n//# sourceMappingURL=internal-globber.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"stream\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nimport * as crypto from 'crypto';\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as stream from 'stream';\nimport * as util from 'util';\nimport * as path from 'path';\nexport function hashFiles(globber_1, currentWorkspace_1) {\n    return __awaiter(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) {\n        var _a, e_1, _b, _c;\n        var _d;\n        const writeDelegate = verbose ? core.info : core.debug;\n        let hasMatch = false;\n        const githubWorkspace = currentWorkspace\n            ? currentWorkspace\n            : ((_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd());\n        const result = crypto.createHash('sha256');\n        let count = 0;\n        try {\n            for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {\n                _c = _g.value;\n                _e = false;\n                const file = _c;\n                writeDelegate(file);\n                if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {\n                    writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);\n                    continue;\n                }\n                if (fs.statSync(file).isDirectory()) {\n                    writeDelegate(`Skip directory '${file}'.`);\n                    continue;\n                }\n                const hash = crypto.createHash('sha256');\n                const pipeline = util.promisify(stream.pipeline);\n                yield pipeline(fs.createReadStream(file), hash);\n                result.write(hash.digest());\n                count++;\n                if (!hasMatch) {\n                    hasMatch = true;\n                }\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        result.end();\n        if (hasMatch) {\n            writeDelegate(`Found ${count} files to hash.`);\n            return result.digest('hex');\n        }\n        else {\n            writeDelegate(`No matches found for glob`);\n            return '';\n        }\n    });\n}\n//# sourceMappingURL=internal-hash-files.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { DefaultGlobber } from './internal-globber.js';\nimport { hashFiles as _hashFiles } from './internal-hash-files.js';\n/**\n * Constructs a globber\n *\n * @param patterns  Patterns separated by newlines\n * @param options   Glob options\n */\nexport function create(patterns, options) {\n    return __awaiter(this, void 0, void 0, function* () {\n        return yield DefaultGlobber.create(patterns, options);\n    });\n}\n/**\n * Computes the sha256 hash of a glob\n *\n * @param patterns  Patterns separated by newlines\n * @param currentWorkspace  Workspace used when matching files\n * @param options   Glob options\n * @param verbose   Enables verbose logging\n */\nexport function hashFiles(patterns_1) {\n    return __awaiter(this, arguments, void 0, function* (patterns, currentWorkspace = '', options, verbose = false) {\n        let followSymbolicLinks = true;\n        if (options && typeof options.followSymbolicLinks === 'boolean') {\n            followSymbolicLinks = options.followSymbolicLinks;\n        }\n        const globber = yield create(patterns, { followSymbolicLinks });\n        return _hashFiles(globber, currentWorkspace, verbose);\n    });\n}\n//# sourceMappingURL=glob.js.map","import { createReadStream } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { basename, posix, relative, resolve, sep } from 'node:path'\nimport { Readable } from 'node:stream'\nimport * as core from '@actions/core'\nimport * as glob from '@actions/glob'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { StreamSource } from '@backblaze-labs/b2-sdk/streams'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link UploadResult.files}. */\nexport interface UploadedFile {\n  /** Absolute path on the runner that was uploaded. */\n  localPath: string\n  /** B2 file name (the key) the upload landed under. */\n  fileName: string\n  /** B2 file ID assigned by the server. */\n  fileId: string\n  /** Byte size of the upload. */\n  size: number\n  /** Whole-file SHA-1, or `null` when the file was multipart-uploaded. */\n  contentSha1: string | null\n}\n\n/** Result of {@link uploadCommand}. */\nexport interface UploadResult {\n  /** One entry per uploaded file. Single-file mode returns a one-element array. */\n  files: UploadedFile[]\n  /** Total bytes uploaded across all files. */\n  bytesTransferred: number\n}\n\n/**\n * Upload one or more files to B2.\n *\n * Mode selection:\n *   - If `source` is a plain file path (no glob metacharacters and the path\n *     exists as a regular file), upload that single file. The B2 file name is\n *     `destination` if set; otherwise `basename(source)`.\n *   - Otherwise treat `source` (plus any `include` patterns) as glob(s). Each\n *     matched file is uploaded preserving its path relative to the glob root,\n *     prefixed by `destination` (default empty).\n *\n * Large files are streamed (StreamSource over a fs ReadStream-as-Web-Stream)\n * so we don't buffer the whole payload in RAM. The SDK's `Bucket.upload`\n * routes to multipart automatically when size exceeds the recommended part\n * size and parallelizes parts up to `concurrency`.\n */\nexport async function uploadCommand(\n  bucket: Bucket,\n  inputs: ParsedInputs,\n  signal?: AbortSignal,\n): Promise {\n  const source = requireSource(inputs.source, 'upload')\n\n  const { files, isSingleExplicitFile } = await resolveFiles(source, inputs.include, inputs.exclude)\n  if (files.length === 0) {\n    if (inputs.failOnEmpty) {\n      throw new Error(`No files matched: ${source}`)\n    }\n    core.warning(`No files matched: ${source}`)\n    return { files: [], bytesTransferred: 0 }\n  }\n\n  const fileConcurrency = isSingleExplicitFile ? 1 : inputs.concurrency\n  // Multi-file uploads spend the concurrency budget across files and keep each\n  // file's multipart upload sequential so total in-flight B2 requests remain\n  // bounded by the user-supplied `concurrency` value.\n  const partConcurrency = isSingleExplicitFile || files.length === 1 ? inputs.concurrency : 1\n\n  const uploaded = await mapWithConcurrency(files, fileConcurrency, async (f) => {\n    signal?.throwIfAborted()\n    const fileName = remapFileName(f, inputs.destination, isSingleExplicitFile)\n    const uploadLabel = `upload ${f.localPath} → b2://${bucket.name}/${fileName}`\n    const groupedLog = files.length === 1 || fileConcurrency === 1\n    if (groupedLog) {\n      core.startGroup(uploadLabel)\n    } else {\n      core.info(uploadLabel)\n    }\n    try {\n      return await uploadOne(\n        bucket,\n        f.localPath,\n        fileName,\n        inputs,\n        partConcurrency,\n        groupedLog,\n        signal,\n      )\n    } finally {\n      if (groupedLog) core.endGroup()\n    }\n  })\n  const totalBytes = uploaded.reduce((sum, file) => sum + file.size, 0)\n\n  return { files: uploaded, bytesTransferred: totalBytes }\n}\n\nasync function mapWithConcurrency(\n  items: T[],\n  concurrency: number,\n  mapper: (item: T) => Promise,\n): Promise {\n  const results = new Array(items.length)\n  let next = 0\n  let firstError: unknown\n  let failed = false\n\n  async function worker(): Promise {\n    while (true) {\n      if (failed) return\n      const index = next++\n      if (index >= items.length) return\n      try {\n        results[index] = await mapper(items[index] as T)\n      } catch (error) {\n        if (!failed) {\n          failed = true\n          firstError = error\n        }\n        return\n      }\n    }\n  }\n\n  const workerCount = Math.min(concurrency, items.length)\n  await Promise.all(Array.from({ length: workerCount }, () => worker()))\n  if (failed) throw firstError\n  return results\n}\n\ninterface ResolvedFiles {\n  files: ResolvedFile[]\n  isSingleExplicitFile: boolean\n}\n\n/**\n * Local file resolved from an upload source.\n *\n * @internal\n */\nexport interface ResolvedFile {\n  localPath: string\n  /** Path relative to the glob root, used when computing the B2 key. */\n  fileName: string\n}\n\nasync function resolveFiles(\n  source: string,\n  include: string[],\n  exclude: string[],\n): Promise {\n  const explicitFile = await tryStat(source)\n  const looksLikeGlob = /[*?[\\]]/.test(source)\n\n  if (explicitFile?.isFile() && !looksLikeGlob && include.length === 0) {\n    return {\n      files: [{ localPath: resolve(source), fileName: basename(source) }],\n      isSingleExplicitFile: true,\n    }\n  }\n\n  const patterns: string[] = []\n  if (explicitFile?.isDirectory()) {\n    patterns.push(`${resolve(source)}/**`)\n  } else {\n    patterns.push(source)\n  }\n  for (const p of include) patterns.push(p)\n  for (const p of exclude) patterns.push(`!${p}`)\n\n  const globber = await glob.create(patterns.join('\\n'), {\n    followSymbolicLinks: false,\n    matchDirectories: false,\n  })\n  const matches = await globber.glob()\n  const root = explicitFile?.isDirectory() ? resolve(source) : process.cwd()\n\n  const out: ResolvedFile[] = []\n  for (const m of matches) {\n    const s = await tryStat(m)\n    // Filesystem boundary: skip entries that aren't readable files (broken\n    // symlinks, races where a file is unlinked between glob and stat, etc.).\n    if (!s?.isFile()) continue\n    const rel = relative(root, m).split(sep).join(posix.sep)\n    out.push({ localPath: m, fileName: rel })\n  }\n  out.sort(compareResolvedFiles)\n  return { files: out, isSingleExplicitFile: false }\n}\n\nfunction compareResolvedFiles(a: ResolvedFile, b: ResolvedFile): number {\n  return compareStrings(a.fileName, b.fileName) || compareStrings(a.localPath, b.localPath)\n}\n\nfunction compareStrings(a: string, b: string): number {\n  if (a < b) return -1\n  if (a > b) return 1\n  return 0\n}\n\n/**\n * Map a local source file to its B2 file name under the requested destination.\n *\n * @internal\n */\nexport function remapFileName(\n  file: ResolvedFile,\n  destination: string | undefined,\n  isSingleExplicitFile: boolean,\n): string {\n  if (destination === undefined || destination === '') return file.fileName\n  const dest = destination.replace(/\\/+$/, '')\n  if (isSingleExplicitFile && !destination.endsWith('/')) return dest\n  return `${dest}/${file.fileName}`\n}\n\nasync function uploadOne(\n  bucket: Bucket,\n  localPath: string,\n  fileName: string,\n  inputs: ParsedInputs,\n  partConcurrency: number,\n  groupedLog: boolean,\n  signal?: AbortSignal,\n): Promise {\n  const fileStat = await stat(localPath)\n  const size = fileStat.size\n\n  // Stream the file from disk. The SDK's `bucket.upload` routes files larger\n  // than the recommended part size through `uploadLargeFile`, which now\n  // detects non-sliceable sources (StreamSource) and reads the stream once,\n  // shipping one part at a time. Peak memory ≈ partSize regardless of file\n  // size, so multi-GB uploads stay bounded.\n  const nodeStream = createReadStream(localPath)\n  const webStream = Readable.toWeb(nodeStream) as ReadableStream\n  const source = new StreamSource(webStream, size)\n\n  const onProgress = makeProgressListener(`upload[${fileName}]`)\n\n  // `inputs.resume` is parsed but deliberately NOT forwarded to the SDK.\n  // The SDK's resume implementation requires a sliceable source so it can\n  // re-upload specific part offsets after a crash. The action uses\n  // `StreamSource` (memory-bounded streaming from disk), which is read-once-\n  // sequential and not sliceable; passing `resume: true` here would throw\n  // `\"resume is not supported on non-sliceable sources\"`. The input is\n  // kept in the action surface so this can be re-enabled if the action\n  // ever offers a `BufferSource` fallback for users willing to trade RAM\n  // for resumability.\n  const result = await bucket.upload({\n    fileName,\n    source,\n    concurrency: partConcurrency,\n    ...(inputs.partSize !== undefined ? { partSize: inputs.partSize } : {}),\n    ...(inputs.contentType !== undefined ? { contentType: inputs.contentType } : {}),\n    ...(inputs.encryption !== undefined ? { serverSideEncryption: inputs.encryption } : {}),\n    ...(signal !== undefined ? { signal } : {}),\n    onProgress,\n  })\n\n  // SDK now normalizes multipart `'none'` to `null` at the boundary, so\n  // `result.contentSha1` is `string | null` directly.\n  const sha1 = result.contentSha1\n  const detailPrefix = groupedLog ? '  ' : ''\n  core.info(`${detailPrefix}fileId=${result.fileId} sha1=${sha1 ?? 'multipart'}`)\n\n  return {\n    localPath,\n    fileName: result.fileName,\n    fileId: result.fileId,\n    size,\n    contentSha1: sha1,\n  }\n}\n","import { createReadStream } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { IncrementalSha1 } from '@backblaze-labs/b2-sdk/streams'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link verifyCommand}. */\nexport interface VerifyResult {\n  /** B2 file name that was checked. */\n  fileName: string\n  /** Server-reported byte size of the remote object. */\n  remoteSize: number\n  /**\n   * Remote SHA-1 result: normalized lowercase digest when comparable, raw B2\n   * value for non-comparable headers such as `none` or `unverified:`,\n   * or `null` when B2 does not expose one.\n   */\n  remoteSha1: string | null\n  /** Locally-computed SHA-1, or `null` if no local file was provided. */\n  localSha1: string | null\n  /** True when remote SHA-1 matches the expected value. */\n  verified: boolean\n  /** Human-readable failure reason; `undefined` on success. */\n  reason: string | undefined\n}\n\n/**\n * Verify that a B2 object matches a local file (or an expected SHA-1) without\n * transferring the body.\n *\n * Three modes, in priority order:\n *   1. `expected-sha1` input set → compare the remote object's SHA-1 to that\n *      literal value. No local read.\n *   2. `destination` input is an existing local file → compute that file's\n *      SHA-1 locally and compare to the remote.\n *   3. Neither → fail.\n *\n * In all modes, the remote SHA-1 is fetched via a HEAD request (header\n * `x-bz-content-sha1`). Large files uploaded via multipart return `null` from\n * B2 here because B2 stores the per-part SHA-1s but not a whole-file SHA-1;\n * HEAD-only verification cannot validate those objects, even when\n * `expected-sha1` is supplied.\n */\nexport async function verifyCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n  const source = requireSource(inputs.source, 'verify', 'the B2 file name')\n\n  core.startGroup(`verify b2://${bucket.name}/${source}`)\n  try {\n    // `bucket.head` returns only the parsed response headers; no body to\n    // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n    const { headers } = await bucket.head(source)\n    const remoteSize = headers.contentLength\n    const remoteSha1 = headers.contentSha1\n\n    let localSha1: string | null = null\n    let expected: string | null =\n      inputs.expectedSha1 !== undefined ? normalizeSha1(inputs.expectedSha1, 'expected-sha1') : null\n\n    if (expected === null && inputs.destination !== undefined && inputs.destination !== '') {\n      localSha1 = await sha1OfFile(inputs.destination)\n      expected = normalizeSha1(localSha1, 'destination')\n    }\n\n    if (expected === null) {\n      throw new Error(\n        \"verify needs either 'expected-sha1' (literal) or 'destination' (local file path) to compare against\",\n      )\n    }\n\n    const normalizedRemoteSha1 = remoteSha1 === null ? null : normalizeRemoteSha1(remoteSha1)\n    if (normalizedRemoteSha1 === null) {\n      const reason = unavailableRemoteSha1Reason(remoteSha1)\n      core.warning(`  ${reason}`)\n      return {\n        fileName: source,\n        remoteSize,\n        remoteSha1,\n        localSha1,\n        verified: false,\n        reason,\n      }\n    }\n\n    const verified = normalizedRemoteSha1 === expected\n    const reason = verified\n      ? undefined\n      : `SHA-1 mismatch: remote=${normalizedRemoteSha1} expected=${expected}`\n    if (verified) {\n      core.info(`  ✓ SHA-1 matches (${normalizedRemoteSha1}), size=${remoteSize}B`)\n    } else {\n      core.warning(`  ${reason}`)\n    }\n\n    return {\n      fileName: source,\n      remoteSize,\n      remoteSha1: normalizedRemoteSha1,\n      localSha1,\n      verified,\n      reason,\n    }\n  } finally {\n    core.endGroup()\n  }\n}\n\n/**\n * Normalize and validate a SHA-1 digest for case-insensitive comparison.\n *\n * @internal\n */\nexport function normalizeSha1(raw: string, label = 'SHA-1'): string {\n  const normalized = raw.trim().toLowerCase()\n  if (!/^[a-f0-9]{40}$/.test(normalized)) {\n    throw new Error(`Invalid ${label}: expected a 40-character hexadecimal SHA-1 digest`)\n  }\n  return normalized\n}\n\nfunction normalizeRemoteSha1(raw: string): string | null {\n  const normalized = raw.trim().toLowerCase()\n  return /^[a-f0-9]{40}$/.test(normalized) ? normalized : null\n}\n\nfunction unavailableRemoteSha1Reason(remoteSha1: string | null): string {\n  if (remoteSha1 === null) {\n    return 'remote SHA-1 is unavailable because B2 does not expose a whole-file SHA-1 for multipart-uploaded files; HEAD-only verify cannot validate this object, even with expected-sha1'\n  }\n  return `remote SHA-1 is unavailable because B2 reported ${JSON.stringify(remoteSha1)} instead of a verified 40-character whole-file SHA-1; HEAD-only verify cannot validate this object, even with expected-sha1`\n}\n\nasync function sha1OfFile(path: string): Promise {\n  const fileStat = await stat(path)\n  if (!fileStat.isFile()) {\n    throw new Error(`verify: 'destination' must be an existing file, got: ${path}`)\n  }\n  const hasher = new IncrementalSha1()\n  const stream = createReadStream(path)\n  for await (const chunk of stream) {\n    await hasher.update(chunk as Uint8Array)\n  }\n  return hasher.digest()\n}\n","import {\n  AccessDeniedError,\n  B2Error,\n  B2InsufficientCapabilityError,\n  B2SsrfError,\n  BadAuthTokenError,\n  NetworkError,\n} from '@backblaze-labs/b2-sdk/errors'\nimport { ACTION_EFFECTS, type ActionName } from './inputs.ts'\n\nconst SAFE_RETRY_HINT = 'safe to retry this workflow.'\nconst DRY_RUN_RETRY_HINT = 'safe to retry this dry-run workflow.'\nconst MUTATING_RETRY_SUFFIX =\n  'action may have partially committed; inspect B2 state before rerunning to avoid duplicate file versions, orphaned large-file uploads, or unintended deletes.'\nconst UNKNOWN_RETRY_HINT =\n  'retry may be appropriate after checking whether the request had side effects.'\nconst SSRF_FAILURE_MESSAGE =\n  'B2 endpoint safety check failed: rejected an unsafe B2 endpoint or server-provided URL. Check the endpoint input and B2 realm configuration.'\nconst MAX_LOG_FIELD_LENGTH = 1_000\nconst MAX_LOG_INPUT_LENGTH = MAX_LOG_FIELD_LENGTH * 2\nconst MAX_SECRET_BOUNDARY_WINDOW = MAX_LOG_INPUT_LENGTH\nconst MAX_DERIVED_SECRET_LENGTH = 512\nconst DEFAULT_NETWORK_RETRY_AFTER_SECONDS = 30\nconst MAX_RETRY_AFTER_SECONDS = 3_600\nconst MAX_CAUSE_DEPTH = 32\n\nexport interface ActionErrorOptions {\n  action?: ActionName\n  dryRun?: boolean\n  secretValues?: readonly string[]\n}\n\nexport interface ClassifiedActionError {\n  message: string\n  retryable: boolean | undefined\n  retryAfter: number | undefined\n}\n\nexport function classifyActionError(\n  err: unknown,\n  options: ActionErrorOptions = {},\n): ClassifiedActionError {\n  // Order matters: specific SDK classes first, then retryable B2Error, then\n  // the generic B2Error fallback last so new subclasses are not shadowed.\n  if (hasSsrfCause(err)) {\n    return failure(SSRF_FAILURE_MESSAGE, false)\n  }\n  if (err instanceof BadAuthTokenError && isAuthorizationScopeFailure(err)) {\n    return failure(\n      `B2 permission denied: application key is missing required capabilities or is outside the bucket/prefix scope. Update the key capabilities or use a key scoped to this bucket/prefix. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof BadAuthTokenError) {\n    return failure(\n      `B2 authentication failed: check application-key-id and application-key, and confirm the key is active. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof B2InsufficientCapabilityError) {\n    const missing = err.missing.length > 0 ? err.missing.join(', ') : '(unknown)'\n    return failure(\n      `B2 permission denied: application key is missing required capabilities: ${sanitizeLogField(missing, options)}. Update the key capabilities or use a key scoped to this bucket/prefix.`,\n      false,\n    )\n  }\n  if (err instanceof AccessDeniedError) {\n    return failure(\n      `B2 permission denied: check application key capabilities, bucket access, and file name prefix restrictions. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof NetworkError) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient network error talking to B2: ${retry.hint} ${sanitizeLogField(err.message, options)}`,\n      retry.safe,\n      retry.safe ? DEFAULT_NETWORK_RETRY_AFTER_SECONDS : undefined,\n    )\n  }\n  if (err instanceof B2Error && err.retryable) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient B2 error: ${retry.hint} ${formatB2Details(err, options)}`,\n      retry.safe,\n      retry.safe ? err.retryAfter : undefined,\n    )\n  }\n  if (err instanceof B2Error) {\n    return failure(\n      `B2 request failed: ${formatGenericB2Guidance(err, options)} ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  const message = err instanceof Error ? err.message : String(err)\n  return failure(sanitizeLogField(message, options), undefined)\n}\n\nexport function formatActionDebugError(err: unknown, options: ActionErrorOptions = {}): string {\n  const message = err instanceof Error ? (err.stack ?? err.message) : String(err)\n  return sanitizeLogField(message, options)\n}\n\nfunction failure(\n  message: string,\n  retryable: boolean | undefined,\n  retryAfter?: number | undefined,\n): ClassifiedActionError {\n  return { message, retryable, retryAfter: normalizeRetryAfter(retryAfter) }\n}\n\nfunction formatB2Details(err: B2Error, options: ActionErrorOptions): string {\n  const details = [\n    `status ${sanitizeLogField(String(err.status), options)}`,\n    `code ${sanitizeLogField(err.code, options)}`,\n  ]\n  const retryAfter = normalizeRetryAfter(err.retryAfter)\n  if (retryAfter !== undefined) {\n    details.push(`retry after ${sanitizeLogField(String(retryAfter), options)}s`)\n  }\n  return `B2 response details: ${details.join(', ')}`\n}\n\nfunction formatGenericB2Guidance(err: B2Error, options: ActionErrorOptions): string {\n  const message = sanitizeLogField(err.message, options)\n  switch (err.code) {\n    case 'file_not_present':\n    case 'no_such_file':\n      return `File not found; check the bucket and file name. B2 said: ${message}.`\n    case 'duplicate_bucket_name':\n      return `Bucket name already exists; choose a unique bucket name. B2 said: ${message}.`\n    case 'cap_exceeded':\n    case 'storage_cap_exceeded':\n    case 'transaction_cap_exceeded':\n    case 'download_cap_exceeded':\n      return `B2 account cap was exceeded; reduce usage or wait before retrying. B2 said: ${message}.`\n    case 'bad_request':\n      return `Bad request; check the action inputs for invalid values. B2 said: ${message}.`\n    default:\n      return `B2 said: ${message}.`\n  }\n}\n\nfunction retryPolicy(options: ActionErrorOptions): { safe: boolean; hint: string } {\n  const { action } = options\n  if (action === undefined) return { safe: false, hint: UNKNOWN_RETRY_HINT }\n  const effect = ACTION_EFFECTS[action]\n  if (options.dryRun === true && effect.honorsDryRun) {\n    return { safe: true, hint: DRY_RUN_RETRY_HINT }\n  }\n  if (effect.kind === 'read') return { safe: true, hint: SAFE_RETRY_HINT }\n  return { safe: false, hint: `the ${action} ${MUTATING_RETRY_SUFFIX}` }\n}\n\nfunction isAuthorizationScopeFailure(err: BadAuthTokenError): boolean {\n  if (err.code !== 'unauthorized') return false\n  // The SDK currently exposes scoped-key `unauthorized` responses as\n  // BadAuthTokenError with only server prose to distinguish capability/scope\n  // misses. Keep this as best-effort until a structured subtype exists.\n  return /\\b(capability|capabilities|scope|bucket|prefix|permission|not authorized|unauthorized)\\b/i.test(\n    err.message,\n  )\n}\n\nfunction hasSsrfCause(err: unknown): boolean {\n  const seen = new Set()\n  let current: unknown = err\n  for (let depth = 0; current instanceof Error && depth < MAX_CAUSE_DEPTH; depth += 1) {\n    if (current instanceof B2SsrfError) return true\n    if (seen.has(current)) return false\n    seen.add(current)\n    current = current.cause\n  }\n  return false\n}\n\nfunction normalizeRetryAfter(retryAfter: number | undefined): number | undefined {\n  if (retryAfter === undefined || !Number.isFinite(retryAfter) || retryAfter < 0) return undefined\n  return Math.min(Math.ceil(retryAfter), MAX_RETRY_AFTER_SECONDS)\n}\n\nfunction sanitizeUntrustedText(value: string): string {\n  return value\n    .replace(/\\bhttps?:\\/\\/\\S+/gi, '[redacted-url]')\n    .replace(/\\bBearer\\s+[A-Za-z0-9._~+/=-]+/gi, 'Bearer ***')\n}\n\nfunction sanitizeLogField(value: string, options: ActionErrorOptions): string {\n  const secretValues = options.secretValues ?? []\n  const scrubInputLength =\n    secretValues.length > 0\n      ? MAX_LOG_INPUT_LENGTH + MAX_SECRET_BOUNDARY_WINDOW\n      : MAX_LOG_INPUT_LENGTH\n  const bounded = value.length > scrubInputLength ? value.slice(0, scrubInputLength) : value\n  const masked = maskSecrets(bounded, secretValues)\n  const scrubbed =\n    masked.length > MAX_LOG_INPUT_LENGTH ? masked.slice(0, MAX_LOG_INPUT_LENGTH) : masked\n  const sanitized = sanitizeUntrustedText(scrubbed)\n  if (sanitized.length <= MAX_LOG_FIELD_LENGTH) return sanitized\n  return `${sanitized.slice(0, MAX_LOG_FIELD_LENGTH)}... [truncated]`\n}\n\nfunction maskSecrets(value: string, secretValues: readonly string[]): string {\n  let masked = value\n  for (const secret of secretValues) {\n    for (const variant of secretVariants(secret)) {\n      masked = masked.split(variant).join('***')\n    }\n  }\n  return masked\n}\n\nfunction secretVariants(secret: string): string[] {\n  if (secret === '') return []\n  const variants = new Set()\n  addSecretVariant(variants, secret)\n  if (secret.length > MAX_LOG_INPUT_LENGTH) {\n    addSecretVariant(variants, secret.slice(0, MAX_LOG_INPUT_LENGTH))\n  }\n  if (secret.length >= 4 && secret.length <= MAX_DERIVED_SECRET_LENGTH) {\n    const base64 = Buffer.from(secret, 'utf8').toString('base64')\n    const base64Url = base64.replaceAll('+', '-').replaceAll('/', '_')\n    addUriEncodedSecretVariant(variants, secret)\n    addSecretVariant(variants, base64)\n    addSecretVariant(variants, base64Url)\n    addSecretVariant(variants, base64Url.replace(/=+$/u, ''))\n    addSecretVariant(variants, Buffer.from(secret, 'utf8').toString('hex'))\n  }\n  return [...variants].sort((a, b) => b.length - a.length)\n}\n\nfunction addSecretVariant(variants: Set, value: string): void {\n  if (value !== '') variants.add(value)\n}\n\nfunction addUriEncodedSecretVariant(variants: Set, secret: string): void {\n  try {\n    addSecretVariant(variants, encodeURIComponent(secret))\n  } catch {\n    // Malformed surrogate pairs are valid JavaScript strings but invalid URI\n    // components. Keep raw/base64/hex masking without letting scrubbing fail.\n  }\n}\n","import { Buffer } from 'node:buffer'\nimport * as core from '@actions/core'\n\nexport const SUMMARY_JSON_PREVIEW_MAX_ENTRIES = 100\nexport const SUMMARY_JSON_MAX_UTF8_BYTES = 256 * 1024\nconst SUMMARY_JSON_OUTPUT_NAME = 'summary-json'\nconst SUMMARY_JSON_TRUNCATED_OUTPUT_NAME = 'summary-json-truncated'\nexport const SUMMARY_JSON_NOTICE_OUTPUT_NAME = 'summary-json-notice'\nexport const SUMMARY_JSON_PREVIEW_OUTPUT_NAME = 'summary-json-preview'\n\nexport type SummaryJsonPayload = CompleteSummaryJsonPayload | TruncatedSummaryJsonPayload\n\nexport interface CompleteSummaryJsonPayload {\n  json: string\n  totalCount: number\n  truncated: false\n}\n\nexport interface TruncatedSummaryJsonPayload {\n  json: string\n  noticeJson: string\n  previewJson: string\n  totalCount: number\n  previewCount: number\n  reason: string\n  truncated: true\n}\n\nexport interface SummaryJsonOutputOptions {\n  item?: (item: T) => unknown\n}\n\ninterface BoundedJsonArray {\n  json: string\n  emittedCount: number\n  byteLimitExceeded: boolean\n  serializationFailed: boolean\n}\n\n/**\n * Serialize per-file command details into the bounded `summary-json` output.\n *\n * GitHub Actions writes outputs as UTF-8 and caps all action outputs for a job\n * at 1 MB. Keep this single structured output well below that job-level\n * budget so scalar outputs, $GITHUB_OUTPUT framing, and caller-defined outputs\n * still have room.\n *\n * `summary-json` remains a complete array when the full manifest fits. When a\n * result exceeds the supported byte cap, `summary-json` remains an array\n * (`[]`) rather than changing shape or carrying a partial manifest.\n * `summary-json-notice` receives a small JSON object describing the\n * truncation, `summary-json-preview` receives a bounded diagnostic prefix, and\n * `summary-json-truncated` is set to `true`. The action step may still succeed\n * because the B2 operation itself has already completed. Scalar count outputs\n * (`file-count`, `files-listed`, etc.) remain the authoritative totals.\n *\n * The serializer also omits credential-bearing field names for every command:\n * `url`, fields ending in `url`, and fields containing `authorization`,\n * `signature`, or `token` after case/underscore/hyphen normalization. Commands\n * that need to expose similarly named non-secret data should project it to an\n * explicit safe field name before calling this helper.\n */\nexport function buildSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): SummaryJsonPayload {\n  const serialized = serializeJsonArrayPrefix(items, options, items.length)\n  if (!serialized.byteLimitExceeded && !serialized.serializationFailed) {\n    return {\n      json: serialized.json,\n      totalCount: items.length,\n      truncated: false,\n    }\n  }\n\n  return buildTruncatedSummaryJsonPayload(\n    items,\n    options,\n    serialized.serializationFailed\n      ? 'summary-json could not be serialized within the supported output contract'\n      : 'summary-json exceeded the supported UTF-8 output size cap',\n  )\n}\n\nfunction buildTruncatedSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  reason: string,\n): TruncatedSummaryJsonPayload {\n  const preview = buildSummaryJsonPreview(items, options)\n\n  return {\n    json: '[]',\n    noticeJson: JSON.stringify({\n      truncated: true,\n      reason,\n      totalCount: items.length,\n      previewCount: preview.emittedCount,\n      previewOutput: SUMMARY_JSON_PREVIEW_OUTPUT_NAME,\n    }),\n    previewJson: preview.json,\n    totalCount: items.length,\n    previewCount: preview.emittedCount,\n    reason,\n    truncated: true,\n  }\n}\n\nfunction buildSummaryJsonPreview(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n): {\n  json: string\n  emittedCount: number\n} {\n  const preview = serializeJsonArrayPrefix(items, options, SUMMARY_JSON_PREVIEW_MAX_ENTRIES)\n  return { json: preview.json, emittedCount: preview.emittedCount }\n}\n\nexport function setSummaryJsonOutput(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): void {\n  const payload = buildSummaryJsonPayload(items, options)\n\n  core.setOutput(SUMMARY_JSON_TRUNCATED_OUTPUT_NAME, String(payload.truncated))\n  core.setOutput(SUMMARY_JSON_OUTPUT_NAME, payload.json)\n  if (!payload.truncated) {\n    return\n  }\n\n  core.setOutput(SUMMARY_JSON_NOTICE_OUTPUT_NAME, payload.noticeJson)\n  core.setOutput(SUMMARY_JSON_PREVIEW_OUTPUT_NAME, payload.previewJson)\n  core.warning(\n    `summary-json truncated: ${payload.reason}; preview contains ` +\n      `${payload.previewCount} of ${payload.totalCount} item(s). ` +\n      `summary-json is [] and summary-json-notice describes the truncation. ` +\n      `limit is ${formatKiB(SUMMARY_JSON_MAX_UTF8_BYTES)} of UTF-8 JSON text`,\n  )\n}\n\nfunction serializeJsonArrayPrefix(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  maxEntries: number,\n): BoundedJsonArray {\n  const parts: string[] = ['[']\n  let bytes = 2\n  let emittedCount = 0\n  const count = Math.min(items.length, maxEntries)\n\n  for (let index = 0; index < count; index++) {\n    let itemJson: string\n    try {\n      itemJson = stringifyArrayItem(projectItem(items[index] as T, options))\n    } catch {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: false,\n        serializationFailed: true,\n      }\n    }\n\n    const separator = emittedCount === 0 ? '' : ','\n    const additionalBytes = utf8ByteLength(separator) + utf8ByteLength(itemJson)\n    if (bytes + additionalBytes > SUMMARY_JSON_MAX_UTF8_BYTES) {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: true,\n        serializationFailed: false,\n      }\n    }\n\n    if (separator !== '') parts.push(separator)\n    parts.push(itemJson)\n    bytes += additionalBytes\n    emittedCount++\n  }\n\n  parts.push(']')\n  return {\n    json: parts.join(''),\n    emittedCount,\n    byteLimitExceeded: false,\n    serializationFailed: false,\n  }\n}\n\nfunction projectItem(item: T, options: SummaryJsonOutputOptions): unknown {\n  return options.item === undefined ? item : options.item(item)\n}\n\nfunction stringifyArrayItem(item: unknown): string {\n  const json = JSON.stringify(item, sensitiveSummaryJsonFieldReplacer)\n  return json === undefined ? 'null' : json\n}\n\nfunction sensitiveSummaryJsonFieldReplacer(key: string, value: unknown): unknown {\n  return key !== '' && isSensitiveSummaryJsonField(key) ? undefined : value\n}\n\nfunction isSensitiveSummaryJsonField(key: string): boolean {\n  const normalized = key.replaceAll('-', '').replaceAll('_', '').toLowerCase()\n  return (\n    normalized === 'url' ||\n    normalized.endsWith('url') ||\n    normalized.includes('authorization') ||\n    normalized.includes('signature') ||\n    normalized.includes('token')\n  )\n}\n\nfunction utf8ByteLength(value: string): number {\n  return Buffer.byteLength(value, 'utf8')\n}\n\nfunction formatKiB(bytes: number): string {\n  return `${Math.floor(bytes / 1024)} KiB`\n}\n","import { appendFile } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport { formatBytes } from './format.ts'\n\n/** Maximum per-file rows rendered in a GitHub Actions step summary table. */\nexport const STEP_SUMMARY_MAX_ROWS = 100\n\n/**\n * One row in the `$GITHUB_STEP_SUMMARY` table emitted by a verb. Only\n * `fileName` is required; the other cells render empty when omitted.\n */\nexport interface SummaryRow {\n  /** B2 file name or display label (e.g. `(uploaded)`, `(removed)`). */\n  fileName: string\n  /** Byte size of the file. Rendered via {@link formatBytes}. */\n  size?: number | undefined\n  /** B2 file ID (rendered as inline code). */\n  fileId?: string | undefined\n  /** Content SHA-1. Truncated to 12 chars in the table for readability. */\n  sha1?: string | null | undefined\n  /** Free-form status cell (e.g. `uploaded`, `would delete`, `deleted`). */\n  status?: string | undefined\n}\n\n/**\n * Append a markdown summary block to `$GITHUB_STEP_SUMMARY`. No-ops when\n * the env var is unset (e.g. running the bundle locally for a smoke test).\n *\n * @param opts.title - Heading rendered as `## {title}`.\n * @param opts.rows - One row per file. Empty rows render an empty table body.\n * @param opts.totals - Optional aggregate line printed above the table.\n * @param opts.totalRows - Optional source row count when callers pre-slice rows.\n */\nexport async function writeStepSummary(opts: {\n  title: string\n  rows: readonly SummaryRow[]\n  totals?: { files: number; bytes: number } | undefined\n  totalRows?: number | undefined\n}): Promise {\n  const path = process.env.GITHUB_STEP_SUMMARY\n  if (!path) return\n\n  // Keep the writer defensive for direct callers even though dispatcher\n  // call sites pre-slice rows to avoid mapping very large result sets.\n  const rows = opts.rows.slice(0, STEP_SUMMARY_MAX_ROWS)\n  const totalRows = opts.totalRows ?? opts.rows.length\n  const lines: string[] = []\n  lines.push(`## ${opts.title}`)\n  lines.push('')\n\n  if (opts.totals !== undefined) {\n    lines.push(`**${opts.totals.files}** files, **${formatBytes(opts.totals.bytes)}** total.`)\n    lines.push('')\n  }\n\n  if (totalRows > rows.length) {\n    lines.push(`Showing first ${rows.length} of ${totalRows} rows.`)\n    lines.push('')\n  }\n\n  if (rows.length > 0) {\n    lines.push('| File | Size | File ID | SHA-1 | Status |')\n    lines.push('|------|------|---------|-------|--------|')\n    for (const r of rows) {\n      lines.push(\n        `| ${inlineCodeCell(r.fileName)} | ${r.size !== undefined ? formatBytes(r.size) : ''} | ${\n          r.fileId !== undefined ? inlineCodeCell(r.fileId) : ''\n        } | ${r.sha1 != null ? `\\`${r.sha1.slice(0, 12)}…\\`` : ''} | ${\n          r.status !== undefined ? inlineCodeCell(r.status) : ''\n        } |`,\n      )\n    }\n  }\n\n  lines.push('')\n\n  try {\n    await appendFile(path, `${lines.join('\\n')}\\n`)\n  } catch (err) {\n    // $GITHUB_STEP_SUMMARY might point at an unwritable path (e.g. a\n    // directory, or a file the runner lacks permission to extend). The\n    // summary is informational; degrading to a warning is better than\n    // failing an otherwise-successful step.\n    core.warning(`Failed to write step summary: ${(err as Error).message}`)\n  }\n}\n\nfunction inlineCodeCell(value: string): string {\n  return `${escapeHtml(value).replaceAll('|', '|')}`\n}\n\nfunction escapeHtml(value: string): string {\n  // Single-pass escape so correctness never depends on replace ordering\n  // (a chained version must escape '&' first or it would re-escape '<').\n  const map = { '&': '&', '<': '<', '>': '>' } as const\n  return value.replace(/[&<>]/g, (ch) => map[ch as keyof typeof map])\n}\n","import { realpathSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport * as core from '@actions/core'\nimport { buildClient, getBucket } from './client.ts'\nimport { copyCommand } from './commands/copy.ts'\nimport { deleteCommand } from './commands/delete.ts'\nimport { downloadCommand } from './commands/download.ts'\nimport { headCommand } from './commands/head.ts'\nimport { hideCommand } from './commands/hide.ts'\nimport { listCommand } from './commands/list.ts'\nimport { type PresignedFile, presignCommand } from './commands/presign.ts'\nimport { purgeCommand } from './commands/purge.ts'\nimport { retentionCommand } from './commands/retention.ts'\nimport { summarizeSyncErrors, syncCommand } from './commands/sync.ts'\nimport { unhideCommand } from './commands/unhide.ts'\nimport { uploadCommand } from './commands/upload.ts'\nimport { verifyCommand } from './commands/verify.ts'\nimport { classifyActionError, formatActionDebugError } from './errors.ts'\nimport { collectInputSecretsForScrubbing, type ParsedInputs, parseInputs } from './inputs.ts'\nimport { setSummaryJsonOutput } from './outputs.ts'\nimport { STEP_SUMMARY_MAX_ROWS, type SummaryRow, writeStepSummary } from './summary.ts'\n\n/**\n * Action entrypoint. Parses inputs, builds an authorized B2Client, dispatches\n * to the requested subcommand, and writes structured outputs back via\n * `core.setOutput`. Any thrown error is reported through `core.setFailed`\n * so the workflow step surfaces with a clear message and a non-zero exit.\n *\n * Each command path also publishes a `$GITHUB_STEP_SUMMARY` markdown block so\n * the run's summary page shows a per-file table without scrolling through the\n * live log.\n */\nexport async function run(): Promise {\n  // Wire workflow-cancellation signals (`SIGTERM` when the user cancels the\n  // job or a sibling fails fast; `SIGINT` for Ctrl+C in local dev) to an\n  // AbortController that long-running SDK operations subscribe to. Aborting\n  // mid-upload lets the SDK cancel in-flight multipart sessions cleanly\n  // rather than leaving them dangling for the user to pay storage on.\n  const controller = new AbortController()\n  const onSignal = (sig: NodeJS.Signals) => {\n    core.warning(`Received ${sig}; cancelling in-flight B2 operations.`)\n    controller.abort(new Error(`${sig} received`))\n  }\n  const onSigterm = () => onSignal('SIGTERM')\n  const onSigint = () => onSignal('SIGINT')\n  process.once('SIGTERM', onSigterm)\n  process.once('SIGINT', onSigint)\n  const signal = controller.signal\n  let action: ParsedInputs['action'] | undefined\n  let dryRun: boolean | undefined\n  const secretValues: string[] = []\n\n  try {\n    // These values are a defensive formatter scrub list for parser and\n    // dispatcher-scope credentials and tokens. Command-level secrets such as\n    // presigned URLs are masked at the command site with core.setSecret. Any\n    // SDK free-form B2 messages that reach failure output are sanitized in\n    // errors.ts.\n    secretValues.push(...collectInputSecretsForScrubbing())\n    const inputs = parseInputs()\n    action = inputs.action\n    dryRun = inputs.dryRun\n\n    const authorized = await buildClient({\n      applicationKeyId: inputs.applicationKeyId,\n      applicationKey: inputs.applicationKey,\n      bucket: inputs.bucket,\n      ...(inputs.endpoint !== undefined ? { endpoint: inputs.endpoint } : {}),\n    })\n    const authToken = authorized.client.accountInfo.getAuthToken()\n    if (authToken) registerSecretValue(secretValues, authToken)\n    const bucket = await getBucket(authorized)\n\n    switch (inputs.action) {\n      case 'upload': {\n        const result = await uploadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-id', first.fileId)\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-uploaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`uploaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: upload',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: 'uploaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'download': {\n        const result = await downloadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-downloaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`downloaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: download',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            sha1: f.contentSha1,\n            status: 'downloaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'sync': {\n        const result = await syncCommand(bucket, inputs, signal)\n        core.setOutput('files-uploaded', String(result.uploaded))\n        core.setOutput('files-downloaded', String(result.downloaded))\n        core.setOutput('files-deleted', String(result.deleted))\n        setFileCountOutput(result.uploaded + result.downloaded + result.deleted + result.skipped)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        setSummaryJsonOutput(result.events)\n        if (result.errors > 0) {\n          const sample = summarizeSyncErrors(result.events)\n          throw new Error(`Sync completed with ${result.errors} error(s): ${sample}`)\n        }\n        const syncTitlePrefix = inputs.dryRun\n          ? 'Backblaze B2: sync (dry-run)'\n          : 'Backblaze B2: sync'\n        await writeStepSummary({\n          title: `${syncTitlePrefix} [${result.direction}]`,\n          totals: {\n            files: result.uploaded + result.downloaded + result.deleted,\n            bytes: result.bytesTransferred,\n          },\n          rows: [\n            {\n              fileName: '(uploaded)',\n              size: result.direction === 'local-to-b2' ? result.bytesTransferred : 0,\n              status: String(result.uploaded),\n            },\n            {\n              fileName: '(downloaded)',\n              size: result.direction === 'b2-to-local' ? result.bytesTransferred : 0,\n              status: String(result.downloaded),\n            },\n            { fileName: '(removed)', status: String(result.deleted) },\n            { fileName: '(unchanged)', status: String(result.skipped) },\n          ],\n        })\n        return\n      }\n      case 'copy': {\n        const result = await copyCommand(authorized.client, bucket, inputs, signal)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.destinationFileName)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', String(result.size))\n        await writeStepSummary({\n          title: 'Backblaze B2: copy',\n          rows: [\n            {\n              fileName: `b2://${result.sourceBucket}/${result.sourceFileName} → b2://${result.destinationBucket}/${result.destinationFileName}`,\n              size: result.size,\n              fileId: result.fileId,\n              status: 'copied (server-side)',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'delete': {\n        const result = await deleteCommand(bucket, inputs, signal)\n        await emitDeletionSummary('delete', result, inputs)\n        return\n      }\n      case 'presign': {\n        const result = await presignCommand(authorized.client, bucket, inputs)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('presigned-url', first.url)\n          core.setOutput('file-name', first.fileName)\n        }\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        await writeStepSummary({\n          title: `Backblaze B2: presign (${result.files.length})`,\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            status: `expires at ${new Date(f.expiresAt * 1000).toISOString()}`,\n          })),\n        })\n        setSummaryJsonOutput(result.files, { item: presignSummaryItem })\n        return\n      }\n      case 'list': {\n        const result = await listCommand(bucket, inputs)\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        if (result.truncated) {\n          core.warning(\n            `list result truncated at max-results=${inputs.maxResults}; raise it to see more`,\n          )\n        }\n        await writeStepSummary({\n          title: `Backblaze B2: list (${result.files.length}${result.truncated ? '+' : ''})`,\n          totals: {\n            files: result.files.length,\n            bytes: result.files.reduce((s, f) => s + f.size, 0),\n          },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: f.contentType,\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'hide': {\n        const result = await hideCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: hide',\n          rows: [{ fileName: result.fileName, fileId: result.fileId, status: 'hidden' }],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'unhide': {\n        const result = await unhideCommand(bucket, inputs)\n        core.setOutput('file-name', result.fileName)\n        if (result.removedMarkerFileId !== null) {\n          core.setOutput('file-id', result.removedMarkerFileId)\n        }\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: unhide',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.removedMarkerFileId ?? undefined,\n              status: result.removedMarkerFileId === null ? 'no-op (not hidden)' : 'unhidden',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'verify': {\n        const result = await verifyCommand(bucket, inputs)\n        core.setOutput('verified', String(result.verified))\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        if (result.remoteSha1 !== null) core.setOutput('remote-sha1', result.remoteSha1)\n        if (result.localSha1 !== null) core.setOutput('local-sha1', result.localSha1)\n        await writeStepSummary({\n          title: result.verified ? 'Backblaze B2: verify ✓' : 'Backblaze B2: verify ✗',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.remoteSize,\n              sha1: result.remoteSha1,\n              status: result.verified ? 'matches' : (result.reason ?? 'mismatch'),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        if (!result.verified) {\n          throw new Error(result.reason ?? 'verify failed: SHA-1 mismatch')\n        }\n        return\n      }\n      case 'retention': {\n        const result = await retentionCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: retention',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.fileId,\n              status: retentionStatusLine(result),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'head': {\n        const result = await headCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        if (result.contentSha1 !== null) core.setOutput('content-sha1', result.contentSha1)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', '0')\n        await writeStepSummary({\n          title: 'Backblaze B2: head',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.size,\n              fileId: result.fileId,\n              sha1: result.contentSha1,\n              status: result.contentType,\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'purge': {\n        const result = await purgeCommand(bucket, inputs, signal)\n        await emitDeletionSummary('purge', result, inputs)\n        return\n      }\n    }\n  } catch (err) {\n    const failure = classifyActionError(err, {\n      ...(action !== undefined ? { action } : {}),\n      ...(dryRun !== undefined ? { dryRun } : {}),\n      secretValues,\n    })\n    core.debug(formatActionDebugError(err, { secretValues }))\n    if (failure.retryable !== undefined) core.setOutput('retryable', String(failure.retryable))\n    if (failure.retryAfter !== undefined) core.setOutput('retry-after', String(failure.retryAfter))\n    core.setFailed(failure.message)\n  } finally {\n    process.off('SIGTERM', onSigterm)\n    process.off('SIGINT', onSigint)\n  }\n}\n\n/**\n * Checks whether this module is the process entrypoint.\n *\n * @param metaUrl - The current module URL from `import.meta.url`.\n * @param argv1 - The executable script path from `process.argv[1]`.\n * @returns `true` when the current module path matches the invoked script.\n */\nexport function isEntrypoint(metaUrl: string, argv1: string | undefined): boolean {\n  if (argv1 === undefined) return false\n  try {\n    return realpathSync(fileURLToPath(metaUrl)) === realpathSync(resolve(argv1))\n  } catch {\n    return false\n  }\n}\n\n/**\n * Shared output-emission + step-summary for the two deletion verbs.\n * `delete` and `purge` returned-shape and dispatcher-side handling are\n * structurally identical (filter into actually-deleted vs would-delete,\n * set the same outputs, render the same capped row table); they differ only\n * in the verb label and the per-row status string.\n */\nasync function emitDeletionSummary(\n  verb: 'delete' | 'purge',\n  result: {\n    files: { fileName: string; fileId: string; skipped: boolean }[]\n    errors: number\n  },\n  inputs: ParsedInputs,\n): Promise {\n  const actuallyDeleted = result.files.filter((f) => !f.skipped).length\n  const wouldDelete = result.files.filter((f) => f.skipped).length\n  core.setOutput('files-deleted', String(actuallyDeleted))\n  setFileCountOutput(result.files.length)\n  setSummaryJsonOutput(result.files)\n  if (result.errors > 0) {\n    const labels = { delete: 'Delete', purge: 'Purge' } as const\n    throw new Error(`${labels[verb]} completed with ${result.errors} error(s)`)\n  }\n  const past = verb === 'delete' ? 'deleted' : 'purged'\n  const future = verb === 'delete' ? 'would delete' : 'would purge'\n  await writeStepSummary({\n    title: inputs.dryRun ? `Backblaze B2: ${verb} (dry-run)` : `Backblaze B2: ${verb}`,\n    totals: { files: actuallyDeleted + wouldDelete, bytes: 0 },\n    ...stepSummaryRows(result.files, (f) => ({\n      fileName: f.fileName,\n      fileId: f.fileId,\n      status: f.skipped ? future : past,\n    })),\n  })\n}\n\nfunction stepSummaryRows(\n  items: readonly T[],\n  row: (item: T) => SummaryRow,\n): { rows: SummaryRow[]; totalRows?: number } {\n  // Pre-slice here to avoid mapping very large result sets; writeStepSummary\n  // keeps its own defensive cap for direct callers.\n  const rows = items.slice(0, STEP_SUMMARY_MAX_ROWS).map(row)\n  return rows.length < items.length ? { rows, totalRows: items.length } : { rows }\n}\n\nfunction presignSummaryItem(file: PresignedFile): Pick {\n  return { fileName: file.fileName, expiresAt: file.expiresAt }\n}\n\nfunction setFileCountOutput(count: number): void {\n  core.setOutput('file-count', String(count))\n}\n\nfunction registerSecretValue(secretValues: string[], value: string): void {\n  const trimmed = value.trim()\n  for (const secret of [value, trimmed]) {\n    if (secret === '' || secretValues.includes(secret)) continue\n    core.setSecret(secret)\n    secretValues.push(secret)\n  }\n}\n\nfunction retentionStatusLine(result: {\n  appliedMode: 'compliance' | 'governance' | 'none' | undefined\n  retainUntilTimestamp: number | null | undefined\n  appliedLegalHold: 'on' | 'off' | undefined\n}): string {\n  const parts: string[] = [`mode=${result.appliedMode ?? '-'}`]\n  if (result.retainUntilTimestamp != null) {\n    parts.push(`until=${new Date(result.retainUntilTimestamp).toISOString()}`)\n  }\n  if (result.appliedLegalHold !== undefined) {\n    parts.push(`legal-hold=${result.appliedLegalHold}`)\n  }\n  return parts.join(' ')\n}\n\nif (isEntrypoint(import.meta.url, process.argv[1])) {\n  void run()\n}\n"],"names":[],"sourceRoot":""}
\ No newline at end of file
diff --git a/src/commands/download.ts b/src/commands/download.ts
index d37f551..0384d9d 100644
--- a/src/commands/download.ts
+++ b/src/commands/download.ts
@@ -6,6 +6,10 @@ import { Readable, Transform } from 'node:stream'
 import { pipeline } from 'node:stream/promises'
 import * as core from '@actions/core'
 import type { Bucket, SseCDownloadKey } from '@backblaze-labs/b2-sdk'
+import {
+  type DownloadHeaderOverrides,
+  downloadHeaderOverridesFromInputs,
+} from '../download-overrides.ts'
 import { tryStat } from '../fs.ts'
 import { type ParsedInputs, requireSource } from '../inputs.ts'
 import { makeProgressListener } from '../progress.ts'
@@ -76,11 +80,26 @@ export async function downloadCommand(
   const isPrefix = source.endsWith('/')
 
   const sseDownload = sseFromInputs(inputs)
+  const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)
 
   if (isPrefix) {
-    return downloadPrefix(bucket, source, inputs.destination ?? '.', sseDownload, signal)
+    return downloadPrefix(
+      bucket,
+      source,
+      inputs.destination ?? '.',
+      sseDownload,
+      downloadOverrides,
+      signal,
+    )
   }
-  const out = await downloadOne(bucket, source, inputs.destination, sseDownload, signal)
+  const out = await downloadOne(
+    bucket,
+    source,
+    inputs.destination,
+    sseDownload,
+    downloadOverrides,
+    signal,
+  )
   return { files: [out], bytesTransferred: out.size }
 }
 
@@ -99,6 +118,7 @@ async function downloadPrefix(
   prefix: string,
   destinationDir: string,
   sseDownload: SseCDownloadKey | undefined,
+  downloadOverrides: DownloadHeaderOverrides,
   signal?: AbortSignal,
 ): Promise {
   const destRoot = resolve(destinationDir)
@@ -159,6 +179,7 @@ async function downloadPrefix(
         plan.fileName,
         plan.localPath,
         sseDownload,
+        downloadOverrides,
         signal,
         downloadPathSafety,
       )
@@ -177,6 +198,7 @@ async function downloadOne(
   fileName: string,
   destination: string | undefined,
   sseDownload: SseCDownloadKey | undefined,
+  downloadOverrides: DownloadHeaderOverrides,
   signal?: AbortSignal,
   pathSafety?: DownloadPathSafety,
 ): Promise {
@@ -194,6 +216,7 @@ async function downloadOne(
 
   const result = await bucket.download(fileName, {
     ...(sseDownload !== undefined ? { serverSideEncryption: sseDownload } : {}),
+    ...downloadOverrides,
     ...(signal !== undefined ? { signal } : {}),
   })
   const size = result.headers.contentLength
diff --git a/src/commands/presign.ts b/src/commands/presign.ts
index 608bc86..6475a03 100644
--- a/src/commands/presign.ts
+++ b/src/commands/presign.ts
@@ -1,6 +1,11 @@
 import * as core from '@actions/core'
 import type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'
 import { presignGetObjectUrl } from '@backblaze-labs/b2-sdk/s3'
+import {
+  appendDownloadHeaderOverrides,
+  type DownloadHeaderOverrides,
+  downloadHeaderOverridesFromInputs,
+} from '../download-overrides.ts'
 import { type ParsedInputs, requireSource } from '../inputs.ts'
 
 /** One entry in {@link PresignResult.files}. */
@@ -45,7 +50,12 @@ export async function presignCommand(
     return presignPrefix(client, bucket, inputs, source)
   }
 
-  return { files: [await presignOne(client, bucket, source, inputs.presignTtlSeconds, source)] }
+  const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)
+  return {
+    files: [
+      await presignOne(client, bucket, source, inputs.presignTtlSeconds, source, downloadOverrides),
+    ],
+  }
 }
 
 async function presignPrefix(
@@ -55,9 +65,19 @@ async function presignPrefix(
   prefix: string,
 ): Promise {
   const downloadUrl = client.accountInfo.getDownloadUrl()
+  const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)
   // One auth token covers the whole prefix (that's exactly what
   // `b2_get_download_authorization` is designed for).
-  const auth = await bucket.getDownloadAuthorization(prefix, inputs.presignTtlSeconds)
+  const auth = await client.raw.getDownloadAuthorization(
+    client.accountInfo.getApiUrl(),
+    client.accountInfo.getAuthToken(),
+    {
+      bucketId: bucket.id,
+      fileNamePrefix: prefix,
+      validDurationInSeconds: inputs.presignTtlSeconds,
+      ...downloadOverrides,
+    },
+  )
   core.setSecret(auth.authorizationToken)
   const expiresAt = Math.floor(Date.now() / 1000) + inputs.presignTtlSeconds
 
@@ -74,12 +94,15 @@ async function presignPrefix(
       })
       for (const f of page.files) {
         if (f.action !== 'upload') continue
-        const url = presignGetObjectUrl(
-          downloadUrl,
-          bucket.name,
-          f.fileName,
-          auth.authorizationToken,
-          inputs.presignTtlSeconds,
+        const url = appendDownloadHeaderOverrides(
+          presignGetObjectUrl(
+            downloadUrl,
+            bucket.name,
+            f.fileName,
+            auth.authorizationToken,
+            inputs.presignTtlSeconds,
+          ),
+          downloadOverrides,
         )
         core.setSecret(url)
         files.push({ fileName: f.fileName, url, expiresAt })
@@ -101,15 +124,22 @@ async function presignOne(
   fileName: string,
   ttlSeconds: number,
   authPrefix: string,
+  downloadOverrides: DownloadHeaderOverrides,
 ): Promise {
-  const auth = await bucket.getDownloadAuthorization(authPrefix, ttlSeconds)
+  const auth = await client.raw.getDownloadAuthorization(
+    client.accountInfo.getApiUrl(),
+    client.accountInfo.getAuthToken(),
+    {
+      bucketId: bucket.id,
+      fileNamePrefix: authPrefix,
+      validDurationInSeconds: ttlSeconds,
+      ...downloadOverrides,
+    },
+  )
   const downloadUrl = client.accountInfo.getDownloadUrl()
-  const url = presignGetObjectUrl(
-    downloadUrl,
-    bucket.name,
-    fileName,
-    auth.authorizationToken,
-    ttlSeconds,
+  const url = appendDownloadHeaderOverrides(
+    presignGetObjectUrl(downloadUrl, bucket.name, fileName, auth.authorizationToken, ttlSeconds),
+    downloadOverrides,
   )
   core.setSecret(auth.authorizationToken)
   core.setSecret(url)
diff --git a/src/download-overrides.ts b/src/download-overrides.ts
new file mode 100644
index 0000000..7985041
--- /dev/null
+++ b/src/download-overrides.ts
@@ -0,0 +1,44 @@
+import type { DownloadCallOptions } from '@backblaze-labs/b2-sdk'
+import type { ParsedInputs } from './inputs.ts'
+
+export type DownloadHeaderOverrides = Pick<
+  DownloadCallOptions,
+  'b2CacheControl' | 'b2ContentDisposition' | 'b2ContentType'
+>
+
+const DOWNLOAD_OVERRIDE_QUERY_PARAMS = {
+  b2ContentDisposition: 'b2ContentDisposition',
+  b2ContentType: 'b2ContentType',
+  b2CacheControl: 'b2CacheControl',
+} as const satisfies Record
+
+export function downloadHeaderOverridesFromInputs(inputs: ParsedInputs): DownloadHeaderOverrides {
+  return {
+    ...(inputs.contentDisposition !== undefined
+      ? { b2ContentDisposition: inputs.contentDisposition }
+      : {}),
+    ...(inputs.responseContentType !== undefined
+      ? { b2ContentType: inputs.responseContentType }
+      : {}),
+    ...(inputs.cacheControl !== undefined ? { b2CacheControl: inputs.cacheControl } : {}),
+  }
+}
+
+export function appendDownloadHeaderOverrides(
+  url: string,
+  overrides: DownloadHeaderOverrides,
+): string {
+  const entries = Object.entries(DOWNLOAD_OVERRIDE_QUERY_PARAMS) as Array<
+    [keyof DownloadHeaderOverrides, string]
+  >
+  if (entries.every(([key]) => overrides[key] === undefined)) return url
+
+  const parsed = new URL(url)
+  for (const [key, param] of entries) {
+    const value = overrides[key]
+    if (value !== undefined) {
+      parsed.searchParams.set(param, value)
+    }
+  }
+  return parsed.toString()
+}
diff --git a/src/inputs.ts b/src/inputs.ts
index 8eb3da1..65e10ef 100644
--- a/src/inputs.ts
+++ b/src/inputs.ts
@@ -89,12 +89,6 @@ const FILE_INFO_KEY_MAX_BYTES = 50
 const FILE_INFO_MAX_ENTRIES = 10
 const FILE_INFO_TOTAL_MAX_BYTES = 7000
 const FILE_INFO_TOTAL_MAX_BYTES_WITH_ENCRYPTION = 2048
-const CONTENT_HEADER_FILE_INFO_KEYS = [
-  ['cache-control', 'b2-cache-control'],
-  ['content-disposition', 'b2-content-disposition'],
-  ['content-language', 'b2-content-language'],
-  ['expires', 'b2-expires'],
-] as const
 const utf8Encoder = new TextEncoder()
 
 /**
@@ -144,6 +138,12 @@ export interface ParsedInputs {
   fileInfo: Record
   /** Preserve each local file's mtime as B2 `src_last_modified_millis`. */
   preserveMtime: boolean
+  /** Response Content-Disposition override for `download` and `presign`. */
+  contentDisposition: string | undefined
+  /** Response Content-Type override for `download` and `presign`. */
+  responseContentType: string | undefined
+  /** Response Cache-Control override for `download` and `presign`. */
+  cacheControl: string | undefined
   /** Preview without executing (sync/delete/purge). */
   dryRun: boolean
   /** Permit whole-bucket purge when `source` is empty or `/`. */
@@ -245,15 +245,23 @@ export function parseInputs(): ParsedInputs {
   const presignTtlSeconds = parsePositiveInt('presign-ttl', core.getInput('presign-ttl') || '3600')
   const maxResults = parsePositiveInt('max-results', core.getInput('max-results') || '1000')
 
+  const contentType = optional('content-type')
+  const contentDisposition = optional('content-disposition')
+  const responseContentType = optional('response-content-type')
+  const cacheControl = optional('cache-control')
   const endpoint = optional('endpoint')
   const sse = optional('sse')
   const encryption = parseSse(sse)
 
-  const contentType = optional('content-type')
   const fileInfo = parseFileInfo(optional('file-info'))
-  for (const [inputName, fileInfoKey] of CONTENT_HEADER_FILE_INFO_KEYS) {
-    addFileInfo(fileInfo, fileInfoKey, optional(inputName), inputName, { allowReserved: true })
-  }
+  addFileInfo(fileInfo, 'b2-cache-control', cacheControl, 'cache-control', { allowReserved: true })
+  addFileInfo(fileInfo, 'b2-content-disposition', contentDisposition, 'content-disposition', {
+    allowReserved: true,
+  })
+  addFileInfo(fileInfo, 'b2-content-language', optional('content-language'), 'content-language', {
+    allowReserved: true,
+  })
+  addFileInfo(fileInfo, 'b2-expires', optional('expires'), 'expires', { allowReserved: true })
   validateFileInfo(fileInfo, uploadFileInfoTotalMaxBytes(encryption))
   const preserveMtime = parseBool('preserve-mtime', core.getInput('preserve-mtime') || 'false')
   if (preserveMtime && Object.hasOwn(fileInfo, 'src_last_modified_millis')) {
@@ -304,6 +312,9 @@ export function parseInputs(): ParsedInputs {
     contentType,
     fileInfo,
     preserveMtime,
+    contentDisposition,
+    responseContentType,
+    cacheControl,
     dryRun,
     allowBucketPurge,
     presignTtlSeconds,

From a6bff7449130c69fab41b8429497fab3f9d3ca6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= 
Date: Thu, 2 Jul 2026 09:24:56 -0500
Subject: [PATCH 2/3] fix: validate response header overrides

---
 CHANGELOG.md                                  |   4 +
 README.md                                     |  10 +-
 __tests__/_parsed-inputs.ts                   |   4 +-
 .../commands/delete-copy-presign.test.ts      |  36 +++-
 __tests__/commands/upload-download.test.ts    |  30 +++-
 __tests__/inputs.test.ts                      |   8 +-
 action.yml                                    |  10 +-
 dist/index.js                                 | 167 +++++++++++++++---
 dist/index.js.map                             |   2 +-
 src/commands/presign.ts                       |  53 ++++--
 src/download-overrides.ts                     | 167 +++++++++++++++++-
 src/inputs.ts                                 |  12 +-
 12 files changed, 432 insertions(+), 71 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1a05bfb..8e9b450 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
 
 ## [Unreleased]
 
+### Added
+
+- `presign` and `download`: add `response-content-disposition`, `response-content-type`, and `response-cache-control` inputs for B2 response header overrides. ([#95](https://github.com/backblaze-labs/b2-action/issues/95))
+
 ## [1.1.0] - 2026-06-23
 
 ### Security
diff --git a/README.md b/README.md
index 3267554..710f565 100644
--- a/README.md
+++ b/README.md
@@ -287,10 +287,10 @@ the step; comparable SHA-1 mismatches also fail.
     bucket: my-bucket
     source: reports/2026-q1.pdf
     presign-ttl: 7200
-    content-disposition: 'attachment; filename="q1-report.pdf"'
+    response-content-disposition: 'attachment; filename="q1-report.pdf"'
     response-content-type: application/pdf
 
-- run: curl --fail --show-error --location --remote-name --remote-header-name "${{ steps.link.outputs.presigned-url }}"
+- run: curl --fail --show-error --location "${{ steps.link.outputs.presigned-url }}" -o report.pdf
 ```
 
 ### Server-side encryption
@@ -385,11 +385,13 @@ Set `bypass-governance: true` to shorten governance-mode retention or to remove
 | `resume` | no | `true` | Reserved. Currently not honored; the action's streaming upload source is non-sliceable, so retries do a full re-upload. Kept in the input surface so it can light up if a `BufferSource` fallback ships. |
 | `content-type` | no | `b2/x-auto` | MIME type for uploads. |
 | `file-info` | no | | Upload fileInfo metadata as newline- or simple comma-separated `key=value` pairs. Use newline-separated entries when values contain commas. Keys are normalized to lowercase, may contain letters, digits, and B2-supported special characters, cannot start with `b2-`, and must fit B2 fileInfo limits. Use `cache-control`, `content-disposition`, `content-language`, or `expires` for reserved `b2-*` response headers. |
-| `cache-control` | no | | Cache-Control header to store with uploads, or response override for `presign` and `download`. |
-| `content-disposition` | no | | Content-Disposition header to store with uploads, or response override for `presign` and `download`, such as `attachment; filename="report.pdf"`. |
+| `cache-control` | no | | Cache-Control response header to store with uploaded files. |
+| `content-disposition` | no | | Content-Disposition response header to store with uploaded files. |
 | `content-language` | no | | Content-Language response header to store with uploaded files. |
 | `expires` | no | | Expires response header to store with uploaded files. |
+| `response-content-disposition` | no | | Response Content-Disposition override for `presign` and `download`, such as `attachment; filename="report.pdf"`. |
 | `response-content-type` | no | | Response Content-Type override for `presign` and `download`. |
+| `response-cache-control` | no | | Response Cache-Control override for `presign` and `download`. |
 | `preserve-mtime` | no | `false` | Store each uploaded file's local modification time as B2 `src_last_modified_millis`. |
 | `dry-run` | no | `false` | Preview only (sync/delete/purge). |
 | `allow-bucket-purge` | purge only | `false` | Permit `purge` to target the entire bucket when `source` is empty or `/`. |
diff --git a/__tests__/_parsed-inputs.ts b/__tests__/_parsed-inputs.ts
index df47474..70a82f3 100644
--- a/__tests__/_parsed-inputs.ts
+++ b/__tests__/_parsed-inputs.ts
@@ -25,9 +25,9 @@ export function makeParsedInputs(
     contentType: undefined,
     fileInfo: {},
     preserveMtime: false,
-    contentDisposition: undefined,
+    responseContentDisposition: undefined,
     responseContentType: undefined,
-    cacheControl: undefined,
+    responseCacheControl: undefined,
     dryRun: false,
     allowBucketPurge: false,
     presignTtlSeconds: 3600,
diff --git a/__tests__/commands/delete-copy-presign.test.ts b/__tests__/commands/delete-copy-presign.test.ts
index caa18d7..00aa3ea 100644
--- a/__tests__/commands/delete-copy-presign.test.ts
+++ b/__tests__/commands/delete-copy-presign.test.ts
@@ -337,9 +337,9 @@ describe('presign command', () => {
     const result = await presignCommand(fx.client, fx.bucket, {
       ...baseInputs('presign'),
       source: 'reports/private-report.bin',
-      contentDisposition: 'attachment; filename="report.pdf"',
+      responseContentDisposition: 'attachment; filename="report.pdf"',
       responseContentType: 'application/pdf',
-      cacheControl: 'private, max-age=60',
+      responseCacheControl: 'private, max-age=60',
     })
 
     const request = getAuth.mock.calls[0]?.[2]
@@ -353,4 +353,36 @@ describe('presign command', () => {
     expect(url.searchParams.get('b2ContentType')).toBe('application/pdf')
     expect(url.searchParams.get('b2CacheControl')).toBe('private, max-age=60')
   })
+
+  it.each([
+    [
+      'response-content-disposition',
+      { responseContentDisposition: 'attachment; filename="safe.pdf"\r\nX-Evil: 1' },
+    ],
+    ['response-content-type', { responseContentType: 'text/plain\nX-Evil: 1' }],
+    ['response-cache-control', { responseCacheControl: 'private\u0000, max-age=60' }],
+  ] as const)('rejects malicious %s before presign authorization', async (inputName, override) => {
+    const getAuth = vi.fn()
+    const client = {
+      raw: { getDownloadAuthorization: getAuth },
+      accountInfo: {
+        getApiUrl: () => 'https://api.example.invalid',
+        getAuthToken: () => 'auth-token',
+        getDownloadUrl: () => 'https://download.example.invalid',
+      },
+    } as unknown as Parameters[0]
+    const bucket = {
+      id: 'bucket-id',
+      name: 'gh-action-misc',
+    } as unknown as Parameters[1]
+
+    await expect(
+      presignCommand(client, bucket, {
+        ...baseInputs('presign'),
+        source: 'reports/private-report.bin',
+        ...override,
+      }),
+    ).rejects.toThrow(inputName)
+    expect(getAuth).not.toHaveBeenCalled()
+  })
 })
diff --git a/__tests__/commands/upload-download.test.ts b/__tests__/commands/upload-download.test.ts
index 45c9fd3..195d465 100644
--- a/__tests__/commands/upload-download.test.ts
+++ b/__tests__/commands/upload-download.test.ts
@@ -258,9 +258,9 @@ describe('upload + download commands (B2Simulator)', () => {
       action: 'download',
       source: 'reports/private-report.bin',
       destination: join(fx.workDir, 'report.pdf'),
-      contentDisposition: 'attachment; filename="report.pdf"',
+      responseContentDisposition: 'attachment; filename="report.pdf"',
       responseContentType: 'application/pdf',
-      cacheControl: 'private, max-age=60',
+      responseCacheControl: 'private, max-age=60',
     })
 
     expect(download.mock.calls[0]?.[1]).toMatchObject({
@@ -270,6 +270,32 @@ describe('upload + download commands (B2Simulator)', () => {
     })
   })
 
+  it.each([
+    [
+      'response-content-disposition',
+      { responseContentDisposition: 'attachment; filename="safe.pdf"\r\nX-Evil: 1' },
+    ],
+    ['response-content-type', { responseContentType: 'text/plain\nX-Evil: 1' }],
+    ['response-cache-control', { responseCacheControl: 'private\u0000, max-age=60' }],
+  ] as const)('rejects malicious %s before download requests', async (inputName, override) => {
+    const download = vi.fn()
+    const bucket = {
+      name: 'gh-action-test',
+      download,
+    } as unknown as Parameters[0]
+
+    await expect(
+      downloadCommand(bucket, {
+        ...baseInputs(),
+        action: 'download',
+        source: 'reports/private-report.bin',
+        destination: join(fx.workDir, 'report.pdf'),
+        ...override,
+      }),
+    ).rejects.toThrow(inputName)
+    expect(download).not.toHaveBeenCalled()
+  })
+
   it('downloads every file under a prefix', async () => {
     for (const name of ['a.txt', 'b.txt', 'c.txt']) {
       const local = join(fx.workDir, name)
diff --git a/__tests__/inputs.test.ts b/__tests__/inputs.test.ts
index cca16e2..5813507 100644
--- a/__tests__/inputs.test.ts
+++ b/__tests__/inputs.test.ts
@@ -230,14 +230,14 @@ describe('parseInputs', () => {
     setInput('application-key-id', 'k')
     setInput('application-key', 's')
     setInput('bucket', 'b')
-    setInput('content-disposition', 'attachment; filename="report.pdf"')
+    setInput('response-content-disposition', 'attachment; filename="report.pdf"')
     setInput('response-content-type', 'application/pdf')
-    setInput('cache-control', 'max-age=60')
+    setInput('response-cache-control', 'max-age=60')
 
     const r = parseInputs()
-    expect(r.contentDisposition).toBe('attachment; filename="report.pdf"')
+    expect(r.responseContentDisposition).toBe('attachment; filename="report.pdf"')
     expect(r.responseContentType).toBe('application/pdf')
-    expect(r.cacheControl).toBe('max-age=60')
+    expect(r.responseCacheControl).toBe('max-age=60')
   })
 
   it('keeps an empty purge source only when whole-bucket purge is confirmed', () => {
diff --git a/action.yml b/action.yml
index eee359c..b9bccfe 100644
--- a/action.yml
+++ b/action.yml
@@ -52,10 +52,10 @@ inputs:
     description: "Custom upload fileInfo metadata as newline- or simple comma-separated key=value pairs. Use newline-separated entries when values contain commas. Keys are normalized to lowercase, may contain letters, digits, and B2-supported special characters (-_.`~!#$%^&*'|+), cannot start with b2-, and must fit B2 fileInfo limits. Use cache-control/content-disposition/content-language/expires for reserved b2-* response headers."
     required: false
   cache-control:
-    description: 'Cache-Control header to store with uploads, or response override for presign/download.'
+    description: 'Cache-Control response header to store with uploaded files.'
     required: false
   content-disposition:
-    description: 'Content-Disposition header to store with uploads, or response override for presign/download, such as attachment; filename="report.pdf".'
+    description: 'Content-Disposition response header to store with uploaded files.'
     required: false
   content-language:
     description: 'Content-Language response header to store with uploaded files.'
@@ -63,9 +63,15 @@ inputs:
   expires:
     description: 'Expires response header to store with uploaded files.'
     required: false
+  response-content-disposition:
+    description: 'Response Content-Disposition override for presign/download, such as attachment; filename="report.pdf".'
+    required: false
   response-content-type:
     description: 'Response Content-Type override for presign/download.'
     required: false
+  response-cache-control:
+    description: 'Response Cache-Control override for presign/download.'
+    required: false
   preserve-mtime:
     description: 'Store each uploaded file''s local modification time as B2 src_last_modified_millis. Default false.'
     required: false
diff --git a/dist/index.js b/dist/index.js
index 60f9a5f..557b32f 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -35591,9 +35591,9 @@ function parseInputs() {
     const presignTtlSeconds = parsePositiveInt('presign-ttl', getInput('presign-ttl') || '3600');
     const maxResults = parsePositiveInt('max-results', getInput('max-results') || '1000');
     const contentType = optional('content-type');
-    const contentDisposition = optional('content-disposition');
+    const responseContentDisposition = optional('response-content-disposition');
     const responseContentType = optional('response-content-type');
-    const cacheControl = optional('cache-control');
+    const responseCacheControl = optional('response-cache-control');
     const endpoint = optional('endpoint');
     const sse = optional('sse');
     const encryption = parseSse(sse);
@@ -35618,9 +35618,9 @@ function parseInputs() {
         partSize,
         resume,
         contentType,
-        contentDisposition,
+        responseContentDisposition,
         responseContentType,
-        cacheControl,
+        responseCacheControl,
         dryRun,
         allowBucketPurge,
         presignTtlSeconds,
@@ -35983,15 +35983,18 @@ const DOWNLOAD_OVERRIDE_QUERY_PARAMS = {
     b2ContentType: 'b2ContentType',
     b2CacheControl: 'b2CacheControl',
 };
+const HTTP_TOKEN_RE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
+const MAX_CONTENT_DISPOSITION_LENGTH = 1024;
+const MAX_CONTENT_TYPE_LENGTH = 255;
+const MAX_CACHE_CONTROL_LENGTH = 1024;
 function downloadHeaderOverridesFromInputs(inputs) {
+    const contentDisposition = validateContentDisposition(inputs.responseContentDisposition);
+    const contentType = validateContentType(inputs.responseContentType);
+    const cacheControl = validateCacheControl(inputs.responseCacheControl);
     return {
-        ...(inputs.contentDisposition !== undefined
-            ? { b2ContentDisposition: inputs.contentDisposition }
-            : {}),
-        ...(inputs.responseContentType !== undefined
-            ? { b2ContentType: inputs.responseContentType }
-            : {}),
-        ...(inputs.cacheControl !== undefined ? { b2CacheControl: inputs.cacheControl } : {}),
+        ...(contentDisposition !== undefined ? { b2ContentDisposition: contentDisposition } : {}),
+        ...(contentType !== undefined ? { b2ContentType: contentType } : {}),
+        ...(cacheControl !== undefined ? { b2CacheControl: cacheControl } : {}),
     };
 }
 function appendDownloadHeaderOverrides(url, overrides) {
@@ -36007,6 +36010,125 @@ function appendDownloadHeaderOverrides(url, overrides) {
     }
     return parsed.toString();
 }
+function validateContentDisposition(value) {
+    return validateHeaderValue('response-content-disposition', value, MAX_CONTENT_DISPOSITION_LENGTH, isContentDisposition, 'must start with a disposition token and contain only valid parameters');
+}
+function validateContentType(value) {
+    return validateHeaderValue('response-content-type', value, MAX_CONTENT_TYPE_LENGTH, isContentType, 'must be a media type such as application/pdf, with optional valid parameters');
+}
+function validateCacheControl(value) {
+    return validateHeaderValue('response-cache-control', value, MAX_CACHE_CONTROL_LENGTH, isCacheControl, 'must contain comma-separated Cache-Control directives');
+}
+function validateHeaderValue(inputName, value, maxLength, isValidFormat, formatDescription) {
+    if (value === undefined)
+        return undefined;
+    if (value.length > maxLength) {
+        throw new Error(`Invalid '${inputName}' input: must be at most ${maxLength} characters`);
+    }
+    if (containsHttpControlCharacter(value)) {
+        throw new Error(`Invalid '${inputName}' input: must not contain HTTP control characters`);
+    }
+    if (!isValidFormat(value)) {
+        throw new Error(`Invalid '${inputName}' input: ${formatDescription}`);
+    }
+    return value;
+}
+function containsHttpControlCharacter(value) {
+    for (let i = 0; i < value.length; i += 1) {
+        const code = value.charCodeAt(i);
+        if (code <= 0x1f || code === 0x7f)
+            return true;
+    }
+    return false;
+}
+function isContentDisposition(value) {
+    const parts = splitOutsideQuotes(value, ';');
+    if (parts === null || parts.length === 0 || !isHttpToken(parts[0]))
+        return false;
+    return parts.slice(1).every(isParameter);
+}
+function isContentType(value) {
+    const parts = splitOutsideQuotes(value, ';');
+    if (parts === null || parts.length === 0)
+        return false;
+    const [type, subtype, ...extra] = parts[0]?.split('/') ?? [];
+    if (extra.length > 0 || !isHttpToken(type) || !isHttpToken(subtype))
+        return false;
+    return parts.slice(1).every(isParameter);
+}
+function isCacheControl(value) {
+    const directives = splitOutsideQuotes(value, ',');
+    if (directives === null || directives.length === 0)
+        return false;
+    return directives.every((directive) => {
+        if (directive === '')
+            return false;
+        const equals = directive.indexOf('=');
+        if (equals === -1)
+            return isHttpToken(directive);
+        const name = directive.slice(0, equals).trim();
+        const rawValue = directive.slice(equals + 1).trim();
+        return isHttpToken(name) && isHeaderParameterValue(rawValue);
+    });
+}
+function isParameter(value) {
+    const equals = value.indexOf('=');
+    if (equals <= 0)
+        return false;
+    const name = value.slice(0, equals).trim();
+    const rawValue = value.slice(equals + 1).trim();
+    return isHttpToken(name) && isHeaderParameterValue(rawValue);
+}
+function isHeaderParameterValue(value) {
+    return isHttpToken(value) || isQuotedString(value);
+}
+function isHttpToken(value) {
+    return value !== undefined && HTTP_TOKEN_RE.test(value);
+}
+function isQuotedString(value) {
+    if (value.length < 2 || !value.startsWith('"') || !value.endsWith('"'))
+        return false;
+    for (let i = 1; i < value.length - 1; i += 1) {
+        const char = value[i];
+        if (char === '"')
+            return false;
+        if (char === '\\') {
+            i += 1;
+            if (i >= value.length - 1)
+                return false;
+        }
+    }
+    return true;
+}
+function splitOutsideQuotes(value, separator) {
+    const parts = [];
+    let start = 0;
+    let quoted = false;
+    let escaped = false;
+    for (let i = 0; i < value.length; i += 1) {
+        const char = value[i];
+        if (escaped) {
+            escaped = false;
+            continue;
+        }
+        if (quoted && char === '\\') {
+            escaped = true;
+            continue;
+        }
+        if (char === '"') {
+            quoted = !quoted;
+            continue;
+        }
+        if (!quoted && char === separator) {
+            parts.push(value.slice(start, i).trim());
+            start = i + 1;
+        }
+    }
+    if (quoted || escaped)
+        return null;
+    parts.push(value.slice(start).trim());
+    return parts;
+}
 
 ;// CONCATENATED MODULE: ./src/fs.ts
 
@@ -36655,12 +36777,7 @@ async function presignPrefix(client, bucket, inputs, prefix) {
     const downloadOverrides = downloadHeaderOverridesFromInputs(inputs);
     // One auth token covers the whole prefix (that's exactly what
     // `b2_get_download_authorization` is designed for).
-    const auth = await client.raw.getDownloadAuthorization(client.accountInfo.getApiUrl(), client.accountInfo.getAuthToken(), {
-        bucketId: bucket.id,
-        fileNamePrefix: prefix,
-        validDurationInSeconds: inputs.presignTtlSeconds,
-        ...downloadOverrides,
-    });
+    const auth = await getDownloadAuthorization(client, bucket, prefix, inputs.presignTtlSeconds, downloadOverrides);
     core_setSecret(auth.authorizationToken);
     const expiresAt = Math.floor(Date.now() / 1000) + inputs.presignTtlSeconds;
     const files = [];
@@ -36695,12 +36812,7 @@ async function presignPrefix(client, bucket, inputs, prefix) {
     return { files };
 }
 async function presignOne(client, bucket, fileName, ttlSeconds, authPrefix, downloadOverrides) {
-    const auth = await client.raw.getDownloadAuthorization(client.accountInfo.getApiUrl(), client.accountInfo.getAuthToken(), {
-        bucketId: bucket.id,
-        fileNamePrefix: authPrefix,
-        validDurationInSeconds: ttlSeconds,
-        ...downloadOverrides,
-    });
+    const auth = await getDownloadAuthorization(client, bucket, authPrefix, ttlSeconds, downloadOverrides);
     const downloadUrl = client.accountInfo.getDownloadUrl();
     const url = appendDownloadHeaderOverrides(presignGetObjectUrl(downloadUrl, bucket.name, fileName, auth.authorizationToken, ttlSeconds), downloadOverrides);
     core_setSecret(auth.authorizationToken);
@@ -36709,6 +36821,15 @@ async function presignOne(client, bucket, fileName, ttlSeconds, authPrefix, down
     info(`presigned URL for ${fileName} valid for ${ttlSeconds}s (expires at ${expiresAt})`);
     return { fileName, url, expiresAt };
 }
+async function getDownloadAuthorization(client, bucket, fileNamePrefix, validDurationInSeconds, downloadOverrides) {
+    const request = {
+        bucketId: bucket.id,
+        fileNamePrefix,
+        validDurationInSeconds,
+        ...downloadOverrides,
+    };
+    return await client.raw.getDownloadAuthorization(client.accountInfo.getApiUrl(), client.accountInfo.getAuthToken(), request);
+}
 
 ;// CONCATENATED MODULE: ./src/commands/purge.ts
 
diff --git a/dist/index.js.map b/dist/index.js.map
index f1f9050..5baa2b8 100644
--- a/dist/index.js.map
+++ b/dist/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","mappings":";;;;;;AAAA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9sBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC98CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrRA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC11BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/dA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/tEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5gCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/lDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACllBA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACNA;AACA;;;;;;;;;;;;ACDA;;;;;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AChCA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9QA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACTA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACrDA;AACA;AACA;AACA;AAMA;AACA;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzEA;AACA;AAIA;AACA;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC7NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9CA;AACA;AACA;AAGA;AACA;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACnNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACpxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmBA;AACA;;;AC3QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AChGA;AACA;AACA;AACA;AAIA;AACA;;;ACRA;AACA;AAGA;AACA;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;;;AChUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;;;ACxlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;;;ACrOA;AAEA;;;;;;;;;;;AAWA;AACA;;;ACdA;AAEA;AAMA;AA6BA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AAKA;AACA;AACA;AACA;AAAA;AAEA;AACA;;;;;;;AC3IA;AACA;AAEA;AAEA;AAEA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;;;AC3DA;AAEA;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AAqFA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;AAYA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAKA;AAKA;AAKA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;AAUA;AACA;AACA;AAAA;AACA;AACA;AAEA;;;AAGA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAEA;;;;AAIA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1bA;AAEA;AACA;AAkBA;;;;;;;;;;;AAWA;AACA;AAMA;AACA;AACA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACnFA;AACA;AAmBA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC3FA;AAEA;AACA;AACA;AAoBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAEA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;;;;;ACpHA;;ACQA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1CA;AAEA;;;;;AAKA;AACA;AACA;AACA;;;ACXA;;;;;AAKA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;;;ACXA;AAEA;AAEA;;;;;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAGA;AACA;AAIA;AACA;AACA;AACA;AACA;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAgDA;;;;;;;;;;AAUA;AACA;AAKA;AACA;AAEA;AACA;AAEA;AACA;AAQA;AACA;AAQA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AAOA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AASA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;;;;AAIA;AACA;AASA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAKA;AAKA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAGA;AACA;;;ACvkBA;AAEA;AAoBA;;;;;;;;AAQA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtDA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;AClCA;AA8BA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACtBA;AAEA;AACA;AAKA;AAkBA;;;;;;;;;;;;;;AAcA;AACA;AAKA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAUA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;;;ACpJA;AAGA;AAsBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AChGA;AAEA;AACA;AAgBA;;;;;;;;;;;;;;;;;AAiBA;AACA;AAIA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACxDA;AACA;AACA;AASA;AACA;AACA;AAwBA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAGA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;;;;;;;;;;AAUA;AACA;AAKA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1PA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACx0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzlCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpOA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAwBA;;;;;;;;;;;;;;;AAeA;AACA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AASA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAkBA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AAKA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAEA;AASA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpRA;AACA;AACA;AAEA;AACA;AAsBA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC/IA;AAQA;AAEA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;;;AClPA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AA+BA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AAEA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AAEA;AAIA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC9NA;AACA;AACA;AAEA;AACA;AAmBA;;;;;;;;AAQA;AACA;AAMA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA","sources":[".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js",".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/abort-signal.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-pipeline.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-upgrade.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/readable.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/diagnostics.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/tree.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/balanced-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h1.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h2.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/fixed-queue.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-stats.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/retry-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/decorator-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/redirect-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/retry-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dns.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dump.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/retry.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pluralizer.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/util/timers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cache.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cachestorage.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/parse.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/body.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/data-url.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/dispatcher-weakref.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/file.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata-parser.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/headers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/response.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/webidl.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/encoding.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/filereader.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/progressevent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/connection.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/events.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/frame.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/permessage-deflate.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/receiver.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/sender.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/websocket.js","../external node-commonjs \"assert\"","../external node-commonjs \"events\"","../external node-commonjs \"http\"","../external node-commonjs \"https\"","../external node-commonjs \"net\"","../external node-commonjs \"node:assert\"","../external node-commonjs \"node:async_hooks\"","../external node-commonjs \"node:buffer\"","../external node-commonjs \"node:console\"","../external node-commonjs \"node:crypto\"","../external node-commonjs \"node:diagnostics_channel\"","../external node-commonjs \"node:dns\"","../external node-commonjs \"node:events\"","../external node-commonjs \"node:fs/promises\"","../external node-commonjs \"node:http\"","../external node-commonjs \"node:http2\"","../external node-commonjs \"node:net\"","../external node-commonjs \"node:path\"","../external node-commonjs \"node:perf_hooks\"","../external node-commonjs \"node:querystring\"","../external node-commonjs \"node:stream\"","../external node-commonjs \"node:tls\"","../external node-commonjs \"node:url\"","../external node-commonjs \"node:util\"","../external node-commonjs \"node:util/types\"","../external node-commonjs \"node:worker_threads\"","../external node-commonjs \"node:zlib\"","../external node-commonjs \"string_decoder\"","../external node-commonjs \"tls\"","../external node-commonjs \"util\"","../webpack/bootstrap","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/compat","../external node-commonjs \"node:fs\"","../external node-commonjs \"os\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/command.js","../external node-commonjs \"crypto\"","../external node-commonjs \"fs\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/file-command.js","../external node-commonjs \"path\"",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/proxy.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/index.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/auth.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/oidc-utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/summary.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/path-utils.js","../external node-commonjs \"child_process\"",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io-util.js",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io.js","../external node-commonjs \"timers\"",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/toolrunner.js",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/exec.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/platform.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/core.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/upload-url-pool.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/in-memory.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/realms.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/ids.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/best-effort.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/cancel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/concurrency.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/defaults.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/plan-ranges.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/copy/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/text-codec.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/encoding.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/progress.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/normalize.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/retry.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/collect.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/parallel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/hash.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/resume.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/to-error.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/stream.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/object.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/paginator.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/bucket.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/errors/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/url-guard.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/package.json.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/version.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/user-agent.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/transport.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/encryption.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/client.js",".././src/version.ts",".././src/client.ts",".././src/sse.ts",".././src/inputs.ts",".././src/commands/copy.ts",".././src/commands/delete-all.ts",".././src/commands/delete.ts","../external node-commonjs \"node:stream/promises\"",".././src/download-overrides.ts",".././src/fs.ts",".././src/format.ts",".././src/progress.ts",".././src/commands/download.ts",".././src/commands/head.ts",".././src/commands/hide.ts",".././src/commands/list.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/s3/index.js",".././src/commands/presign.ts",".././src/commands/purge.ts",".././src/commands/retention.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/source.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/actions/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/pairing.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/compare.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/synchronizer.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/local.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/file.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/b2.js",".././src/commands/sync.ts",".././src/commands/unhide.ts",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-glob-options-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-match-kind.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern-helper.js",".././node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js",".././node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/esm/index.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/brace-expressions.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/unescape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/ast.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/escape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-search-state.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-globber.js","../external node-commonjs \"stream\"",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-hash-files.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/glob.js",".././src/commands/upload.ts",".././src/commands/verify.ts",".././src/errors.ts",".././src/outputs.ts",".././src/summary.ts",".././src/main.ts"],"sourcesContent":["module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = http.request;\n  return agent;\n}\n\nfunction httpsOverHttp(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = http.request;\n  agent.createSocket = createSecureSocket;\n  agent.defaultPort = 443;\n  return agent;\n}\n\nfunction httpOverHttps(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = https.request;\n  return agent;\n}\n\nfunction httpsOverHttps(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = https.request;\n  agent.createSocket = createSecureSocket;\n  agent.defaultPort = 443;\n  return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n  var self = this;\n  self.options = options || {};\n  self.proxyOptions = self.options.proxy || {};\n  self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n  self.requests = [];\n  self.sockets = [];\n\n  self.on('free', function onFree(socket, host, port, localAddress) {\n    var options = toOptions(host, port, localAddress);\n    for (var i = 0, len = self.requests.length; i < len; ++i) {\n      var pending = self.requests[i];\n      if (pending.host === options.host && pending.port === options.port) {\n        // Detect the request to connect same origin server,\n        // reuse the connection.\n        self.requests.splice(i, 1);\n        pending.request.onSocket(socket);\n        return;\n      }\n    }\n    socket.destroy();\n    self.removeSocket(socket);\n  });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n  var self = this;\n  var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n  if (self.sockets.length >= this.maxSockets) {\n    // We are over limit so we'll add it to the queue.\n    self.requests.push(options);\n    return;\n  }\n\n  // If we are under maxSockets create a new one.\n  self.createSocket(options, function(socket) {\n    socket.on('free', onFree);\n    socket.on('close', onCloseOrRemove);\n    socket.on('agentRemove', onCloseOrRemove);\n    req.onSocket(socket);\n\n    function onFree() {\n      self.emit('free', socket, options);\n    }\n\n    function onCloseOrRemove(err) {\n      self.removeSocket(socket);\n      socket.removeListener('free', onFree);\n      socket.removeListener('close', onCloseOrRemove);\n      socket.removeListener('agentRemove', onCloseOrRemove);\n    }\n  });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n  var self = this;\n  var placeholder = {};\n  self.sockets.push(placeholder);\n\n  var connectOptions = mergeOptions({}, self.proxyOptions, {\n    method: 'CONNECT',\n    path: options.host + ':' + options.port,\n    agent: false,\n    headers: {\n      host: options.host + ':' + options.port\n    }\n  });\n  if (options.localAddress) {\n    connectOptions.localAddress = options.localAddress;\n  }\n  if (connectOptions.proxyAuth) {\n    connectOptions.headers = connectOptions.headers || {};\n    connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n        new Buffer(connectOptions.proxyAuth).toString('base64');\n  }\n\n  debug('making CONNECT request');\n  var connectReq = self.request(connectOptions);\n  connectReq.useChunkedEncodingByDefault = false; // for v0.6\n  connectReq.once('response', onResponse); // for v0.6\n  connectReq.once('upgrade', onUpgrade);   // for v0.6\n  connectReq.once('connect', onConnect);   // for v0.7 or later\n  connectReq.once('error', onError);\n  connectReq.end();\n\n  function onResponse(res) {\n    // Very hacky. This is necessary to avoid http-parser leaks.\n    res.upgrade = true;\n  }\n\n  function onUpgrade(res, socket, head) {\n    // Hacky.\n    process.nextTick(function() {\n      onConnect(res, socket, head);\n    });\n  }\n\n  function onConnect(res, socket, head) {\n    connectReq.removeAllListeners();\n    socket.removeAllListeners();\n\n    if (res.statusCode !== 200) {\n      debug('tunneling socket could not be established, statusCode=%d',\n        res.statusCode);\n      socket.destroy();\n      var error = new Error('tunneling socket could not be established, ' +\n        'statusCode=' + res.statusCode);\n      error.code = 'ECONNRESET';\n      options.request.emit('error', error);\n      self.removeSocket(placeholder);\n      return;\n    }\n    if (head.length > 0) {\n      debug('got illegal response body from proxy');\n      socket.destroy();\n      var error = new Error('got illegal response body from proxy');\n      error.code = 'ECONNRESET';\n      options.request.emit('error', error);\n      self.removeSocket(placeholder);\n      return;\n    }\n    debug('tunneling connection has established');\n    self.sockets[self.sockets.indexOf(placeholder)] = socket;\n    return cb(socket);\n  }\n\n  function onError(cause) {\n    connectReq.removeAllListeners();\n\n    debug('tunneling socket could not be established, cause=%s\\n',\n          cause.message, cause.stack);\n    var error = new Error('tunneling socket could not be established, ' +\n                          'cause=' + cause.message);\n    error.code = 'ECONNRESET';\n    options.request.emit('error', error);\n    self.removeSocket(placeholder);\n  }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n  var pos = this.sockets.indexOf(socket)\n  if (pos === -1) {\n    return;\n  }\n  this.sockets.splice(pos, 1);\n\n  var pending = this.requests.shift();\n  if (pending) {\n    // If we have pending requests and a socket gets closed a new one\n    // needs to be created to take over in the pool for the one that closed.\n    this.createSocket(pending, function(socket) {\n      pending.request.onSocket(socket);\n    });\n  }\n};\n\nfunction createSecureSocket(options, cb) {\n  var self = this;\n  TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n    var hostHeader = options.request.getHeader('host');\n    var tlsOptions = mergeOptions({}, self.options, {\n      socket: socket,\n      servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n    });\n\n    // 0 is dummy port for v0.6\n    var secureSocket = tls.connect(0, tlsOptions);\n    self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n    cb(secureSocket);\n  });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n  if (typeof host === 'string') { // since v0.10\n    return {\n      host: host,\n      port: port,\n      localAddress: localAddress\n    };\n  }\n  return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n  for (var i = 1, len = arguments.length; i < len; ++i) {\n    var overrides = arguments[i];\n    if (typeof overrides === 'object') {\n      var keys = Object.keys(overrides);\n      for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n        var k = keys[j];\n        if (overrides[k] !== undefined) {\n          target[k] = overrides[k];\n        }\n      }\n    }\n  }\n  return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n  debug = function() {\n    var args = Array.prototype.slice.call(arguments);\n    if (typeof args[0] === 'string') {\n      args[0] = 'TUNNEL: ' + args[0];\n    } else {\n      args.unshift('TUNNEL:');\n    }\n    console.error.apply(console, args);\n  }\n} else {\n  debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict'\n\nconst Client = require('./lib/dispatcher/client')\nconst Dispatcher = require('./lib/dispatcher/dispatcher')\nconst Pool = require('./lib/dispatcher/pool')\nconst BalancedPool = require('./lib/dispatcher/balanced-pool')\nconst Agent = require('./lib/dispatcher/agent')\nconst ProxyAgent = require('./lib/dispatcher/proxy-agent')\nconst EnvHttpProxyAgent = require('./lib/dispatcher/env-http-proxy-agent')\nconst RetryAgent = require('./lib/dispatcher/retry-agent')\nconst errors = require('./lib/core/errors')\nconst util = require('./lib/core/util')\nconst { InvalidArgumentError } = errors\nconst api = require('./lib/api')\nconst buildConnector = require('./lib/core/connect')\nconst MockClient = require('./lib/mock/mock-client')\nconst MockAgent = require('./lib/mock/mock-agent')\nconst MockPool = require('./lib/mock/mock-pool')\nconst mockErrors = require('./lib/mock/mock-errors')\nconst RetryHandler = require('./lib/handler/retry-handler')\nconst { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global')\nconst DecoratorHandler = require('./lib/handler/decorator-handler')\nconst RedirectHandler = require('./lib/handler/redirect-handler')\nconst createRedirectInterceptor = require('./lib/interceptor/redirect-interceptor')\n\nObject.assign(Dispatcher.prototype, api)\n\nmodule.exports.Dispatcher = Dispatcher\nmodule.exports.Client = Client\nmodule.exports.Pool = Pool\nmodule.exports.BalancedPool = BalancedPool\nmodule.exports.Agent = Agent\nmodule.exports.ProxyAgent = ProxyAgent\nmodule.exports.EnvHttpProxyAgent = EnvHttpProxyAgent\nmodule.exports.RetryAgent = RetryAgent\nmodule.exports.RetryHandler = RetryHandler\n\nmodule.exports.DecoratorHandler = DecoratorHandler\nmodule.exports.RedirectHandler = RedirectHandler\nmodule.exports.createRedirectInterceptor = createRedirectInterceptor\nmodule.exports.interceptors = {\n  redirect: require('./lib/interceptor/redirect'),\n  retry: require('./lib/interceptor/retry'),\n  dump: require('./lib/interceptor/dump'),\n  dns: require('./lib/interceptor/dns')\n}\n\nmodule.exports.buildConnector = buildConnector\nmodule.exports.errors = errors\nmodule.exports.util = {\n  parseHeaders: util.parseHeaders,\n  headerNameToString: util.headerNameToString\n}\n\nfunction makeDispatcher (fn) {\n  return (url, opts, handler) => {\n    if (typeof opts === 'function') {\n      handler = opts\n      opts = null\n    }\n\n    if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {\n      throw new InvalidArgumentError('invalid url')\n    }\n\n    if (opts != null && typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (opts && opts.path != null) {\n      if (typeof opts.path !== 'string') {\n        throw new InvalidArgumentError('invalid opts.path')\n      }\n\n      let path = opts.path\n      if (!opts.path.startsWith('/')) {\n        path = `/${path}`\n      }\n\n      url = new URL(util.parseOrigin(url).origin + path)\n    } else {\n      if (!opts) {\n        opts = typeof url === 'object' ? url : {}\n      }\n\n      url = util.parseURL(url)\n    }\n\n    const { agent, dispatcher = getGlobalDispatcher() } = opts\n\n    if (agent) {\n      throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')\n    }\n\n    return fn.call(dispatcher, {\n      ...opts,\n      origin: url.origin,\n      path: url.search ? `${url.pathname}${url.search}` : url.pathname,\n      method: opts.method || (opts.body ? 'PUT' : 'GET')\n    }, handler)\n  }\n}\n\nmodule.exports.setGlobalDispatcher = setGlobalDispatcher\nmodule.exports.getGlobalDispatcher = getGlobalDispatcher\n\nconst fetchImpl = require('./lib/web/fetch').fetch\nmodule.exports.fetch = async function fetch (init, options = undefined) {\n  try {\n    return await fetchImpl(init, options)\n  } catch (err) {\n    if (err && typeof err === 'object') {\n      Error.captureStackTrace(err)\n    }\n\n    throw err\n  }\n}\nmodule.exports.Headers = require('./lib/web/fetch/headers').Headers\nmodule.exports.Response = require('./lib/web/fetch/response').Response\nmodule.exports.Request = require('./lib/web/fetch/request').Request\nmodule.exports.FormData = require('./lib/web/fetch/formdata').FormData\nmodule.exports.File = globalThis.File ?? require('node:buffer').File\nmodule.exports.FileReader = require('./lib/web/fileapi/filereader').FileReader\n\nconst { setGlobalOrigin, getGlobalOrigin } = require('./lib/web/fetch/global')\n\nmodule.exports.setGlobalOrigin = setGlobalOrigin\nmodule.exports.getGlobalOrigin = getGlobalOrigin\n\nconst { CacheStorage } = require('./lib/web/cache/cachestorage')\nconst { kConstruct } = require('./lib/web/cache/symbols')\n\n// Cache & CacheStorage are tightly coupled with fetch. Even if it may run\n// in an older version of Node, it doesn't have any use without fetch.\nmodule.exports.caches = new CacheStorage(kConstruct)\n\nconst { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/web/cookies')\n\nmodule.exports.deleteCookie = deleteCookie\nmodule.exports.getCookies = getCookies\nmodule.exports.getSetCookies = getSetCookies\nmodule.exports.setCookie = setCookie\n\nconst { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/data-url')\n\nmodule.exports.parseMIMEType = parseMIMEType\nmodule.exports.serializeAMimeType = serializeAMimeType\n\nconst { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/web/websocket/events')\nmodule.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket\nmodule.exports.CloseEvent = CloseEvent\nmodule.exports.ErrorEvent = ErrorEvent\nmodule.exports.MessageEvent = MessageEvent\n\nmodule.exports.request = makeDispatcher(api.request)\nmodule.exports.stream = makeDispatcher(api.stream)\nmodule.exports.pipeline = makeDispatcher(api.pipeline)\nmodule.exports.connect = makeDispatcher(api.connect)\nmodule.exports.upgrade = makeDispatcher(api.upgrade)\n\nmodule.exports.MockClient = MockClient\nmodule.exports.MockPool = MockPool\nmodule.exports.MockAgent = MockAgent\nmodule.exports.mockErrors = mockErrors\n\nconst { EventSource } = require('./lib/web/eventsource/eventsource')\n\nmodule.exports.EventSource = EventSource\n","const { addAbortListener } = require('../core/util')\nconst { RequestAbortedError } = require('../core/errors')\n\nconst kListener = Symbol('kListener')\nconst kSignal = Symbol('kSignal')\n\nfunction abort (self) {\n  if (self.abort) {\n    self.abort(self[kSignal]?.reason)\n  } else {\n    self.reason = self[kSignal]?.reason ?? new RequestAbortedError()\n  }\n  removeSignal(self)\n}\n\nfunction addSignal (self, signal) {\n  self.reason = null\n\n  self[kSignal] = null\n  self[kListener] = null\n\n  if (!signal) {\n    return\n  }\n\n  if (signal.aborted) {\n    abort(self)\n    return\n  }\n\n  self[kSignal] = signal\n  self[kListener] = () => {\n    abort(self)\n  }\n\n  addAbortListener(self[kSignal], self[kListener])\n}\n\nfunction removeSignal (self) {\n  if (!self[kSignal]) {\n    return\n  }\n\n  if ('removeEventListener' in self[kSignal]) {\n    self[kSignal].removeEventListener('abort', self[kListener])\n  } else {\n    self[kSignal].removeListener('abort', self[kListener])\n  }\n\n  self[kSignal] = null\n  self[kListener] = null\n}\n\nmodule.exports = {\n  addSignal,\n  removeSignal\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { AsyncResource } = require('node:async_hooks')\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass ConnectHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    const { signal, opaque, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    super('UNDICI_CONNECT')\n\n    this.opaque = opaque || null\n    this.responseHeaders = responseHeaders || null\n    this.callback = callback\n    this.abort = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders () {\n    throw new SocketError('bad connect', null)\n  }\n\n  onUpgrade (statusCode, rawHeaders, socket) {\n    const { callback, opaque, context } = this\n\n    removeSignal(this)\n\n    this.callback = null\n\n    let headers = rawHeaders\n    // Indicates is an HTTP2Session\n    if (headers != null) {\n      headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n    }\n\n    this.runInAsyncScope(callback, null, null, {\n      statusCode,\n      headers,\n      socket,\n      opaque,\n      context\n    })\n  }\n\n  onError (err) {\n    const { callback, opaque } = this\n\n    removeSignal(this)\n\n    if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n  }\n}\n\nfunction connect (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      connect.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    const connectHandler = new ConnectHandler(opts, callback)\n    this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = connect\n","'use strict'\n\nconst {\n  Readable,\n  Duplex,\n  PassThrough\n} = require('node:stream')\nconst {\n  InvalidArgumentError,\n  InvalidReturnValueError,\n  RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nconst kResume = Symbol('resume')\n\nclass PipelineRequest extends Readable {\n  constructor () {\n    super({ autoDestroy: true })\n\n    this[kResume] = null\n  }\n\n  _read () {\n    const { [kResume]: resume } = this\n\n    if (resume) {\n      this[kResume] = null\n      resume()\n    }\n  }\n\n  _destroy (err, callback) {\n    this._read()\n\n    callback(err)\n  }\n}\n\nclass PipelineResponse extends Readable {\n  constructor (resume) {\n    super({ autoDestroy: true })\n    this[kResume] = resume\n  }\n\n  _read () {\n    this[kResume]()\n  }\n\n  _destroy (err, callback) {\n    if (!err && !this._readableState.endEmitted) {\n      err = new RequestAbortedError()\n    }\n\n    callback(err)\n  }\n}\n\nclass PipelineHandler extends AsyncResource {\n  constructor (opts, handler) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof handler !== 'function') {\n      throw new InvalidArgumentError('invalid handler')\n    }\n\n    const { signal, method, opaque, onInfo, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    if (method === 'CONNECT') {\n      throw new InvalidArgumentError('invalid method')\n    }\n\n    if (onInfo && typeof onInfo !== 'function') {\n      throw new InvalidArgumentError('invalid onInfo callback')\n    }\n\n    super('UNDICI_PIPELINE')\n\n    this.opaque = opaque || null\n    this.responseHeaders = responseHeaders || null\n    this.handler = handler\n    this.abort = null\n    this.context = null\n    this.onInfo = onInfo || null\n\n    this.req = new PipelineRequest().on('error', util.nop)\n\n    this.ret = new Duplex({\n      readableObjectMode: opts.objectMode,\n      autoDestroy: true,\n      read: () => {\n        const { body } = this\n\n        if (body?.resume) {\n          body.resume()\n        }\n      },\n      write: (chunk, encoding, callback) => {\n        const { req } = this\n\n        if (req.push(chunk, encoding) || req._readableState.destroyed) {\n          callback()\n        } else {\n          req[kResume] = callback\n        }\n      },\n      destroy: (err, callback) => {\n        const { body, req, res, ret, abort } = this\n\n        if (!err && !ret._readableState.endEmitted) {\n          err = new RequestAbortedError()\n        }\n\n        if (abort && err) {\n          abort()\n        }\n\n        util.destroy(body, err)\n        util.destroy(req, err)\n        util.destroy(res, err)\n\n        removeSignal(this)\n\n        callback(err)\n      }\n    }).on('prefinish', () => {\n      const { req } = this\n\n      // Node < 15 does not call _final in same tick.\n      req.push(null)\n    })\n\n    this.res = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    const { ret, res } = this\n\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(!res, 'pipeline cannot be retried')\n    assert(!ret.destroyed)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume) {\n    const { opaque, handler, context } = this\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    this.res = new PipelineResponse(resume)\n\n    let body\n    try {\n      this.handler = null\n      const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n      body = this.runInAsyncScope(handler, null, {\n        statusCode,\n        headers,\n        opaque,\n        body: this.res,\n        context\n      })\n    } catch (err) {\n      this.res.on('error', util.nop)\n      throw err\n    }\n\n    if (!body || typeof body.on !== 'function') {\n      throw new InvalidReturnValueError('expected Readable')\n    }\n\n    body\n      .on('data', (chunk) => {\n        const { ret, body } = this\n\n        if (!ret.push(chunk) && body.pause) {\n          body.pause()\n        }\n      })\n      .on('error', (err) => {\n        const { ret } = this\n\n        util.destroy(ret, err)\n      })\n      .on('end', () => {\n        const { ret } = this\n\n        ret.push(null)\n      })\n      .on('close', () => {\n        const { ret } = this\n\n        if (!ret._readableState.ended) {\n          util.destroy(ret, new RequestAbortedError())\n        }\n      })\n\n    this.body = body\n  }\n\n  onData (chunk) {\n    const { res } = this\n    return res.push(chunk)\n  }\n\n  onComplete (trailers) {\n    const { res } = this\n    res.push(null)\n  }\n\n  onError (err) {\n    const { ret } = this\n    this.handler = null\n    util.destroy(ret, err)\n  }\n}\n\nfunction pipeline (opts, handler) {\n  try {\n    const pipelineHandler = new PipelineHandler(opts, handler)\n    this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)\n    return pipelineHandler.ret\n  } catch (err) {\n    return new PassThrough().destroy(err)\n  }\n}\n\nmodule.exports = pipeline\n","'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('./readable')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\n\nclass RequestHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts\n\n    try {\n      if (typeof callback !== 'function') {\n        throw new InvalidArgumentError('invalid callback')\n      }\n\n      if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {\n        throw new InvalidArgumentError('invalid highWaterMark')\n      }\n\n      if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n        throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n      }\n\n      if (method === 'CONNECT') {\n        throw new InvalidArgumentError('invalid method')\n      }\n\n      if (onInfo && typeof onInfo !== 'function') {\n        throw new InvalidArgumentError('invalid onInfo callback')\n      }\n\n      super('UNDICI_REQUEST')\n    } catch (err) {\n      if (util.isStream(body)) {\n        util.destroy(body.on('error', util.nop), err)\n      }\n      throw err\n    }\n\n    this.method = method\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.callback = callback\n    this.res = null\n    this.abort = null\n    this.body = body\n    this.trailers = {}\n    this.context = null\n    this.onInfo = onInfo || null\n    this.throwOnError = throwOnError\n    this.highWaterMark = highWaterMark\n    this.signal = signal\n    this.reason = null\n    this.removeAbortListener = null\n\n    if (util.isStream(body)) {\n      body.on('error', (err) => {\n        this.onError(err)\n      })\n    }\n\n    if (this.signal) {\n      if (this.signal.aborted) {\n        this.reason = this.signal.reason ?? new RequestAbortedError()\n      } else {\n        this.removeAbortListener = util.addAbortListener(this.signal, () => {\n          this.reason = this.signal.reason ?? new RequestAbortedError()\n          if (this.res) {\n            util.destroy(this.res.on('error', util.nop), this.reason)\n          } else if (this.abort) {\n            this.abort(this.reason)\n          }\n\n          if (this.removeAbortListener) {\n            this.res?.off('close', this.removeAbortListener)\n            this.removeAbortListener()\n            this.removeAbortListener = null\n          }\n        })\n      }\n    }\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this\n\n    const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n    const contentType = parsedHeaders['content-type']\n    const contentLength = parsedHeaders['content-length']\n    const res = new Readable({\n      resume,\n      abort,\n      contentType,\n      contentLength: this.method !== 'HEAD' && contentLength\n        ? Number(contentLength)\n        : null,\n      highWaterMark\n    })\n\n    if (this.removeAbortListener) {\n      res.on('close', this.removeAbortListener)\n    }\n\n    this.callback = null\n    this.res = res\n    if (callback !== null) {\n      if (this.throwOnError && statusCode >= 400) {\n        this.runInAsyncScope(getResolveErrorBodyCallback, null,\n          { callback, body: res, contentType, statusCode, statusMessage, headers }\n        )\n      } else {\n        this.runInAsyncScope(callback, null, null, {\n          statusCode,\n          headers,\n          trailers: this.trailers,\n          opaque,\n          body: res,\n          context\n        })\n      }\n    }\n  }\n\n  onData (chunk) {\n    return this.res.push(chunk)\n  }\n\n  onComplete (trailers) {\n    util.parseHeaders(trailers, this.trailers)\n    this.res.push(null)\n  }\n\n  onError (err) {\n    const { res, callback, body, opaque } = this\n\n    if (callback) {\n      // TODO: Does this need queueMicrotask?\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n\n    if (res) {\n      this.res = null\n      // Ensure all queued handlers are invoked before destroying res.\n      queueMicrotask(() => {\n        util.destroy(res, err)\n      })\n    }\n\n    if (body) {\n      this.body = null\n      util.destroy(body, err)\n    }\n\n    if (this.removeAbortListener) {\n      res?.off('close', this.removeAbortListener)\n      this.removeAbortListener()\n      this.removeAbortListener = null\n    }\n  }\n}\n\nfunction request (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      request.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    this.dispatch(opts, new RequestHandler(opts, callback))\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = request\nmodule.exports.RequestHandler = RequestHandler\n","'use strict'\n\nconst assert = require('node:assert')\nconst { finished, PassThrough } = require('node:stream')\nconst { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass StreamHandler extends AsyncResource {\n  constructor (opts, factory, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts\n\n    try {\n      if (typeof callback !== 'function') {\n        throw new InvalidArgumentError('invalid callback')\n      }\n\n      if (typeof factory !== 'function') {\n        throw new InvalidArgumentError('invalid factory')\n      }\n\n      if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n        throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n      }\n\n      if (method === 'CONNECT') {\n        throw new InvalidArgumentError('invalid method')\n      }\n\n      if (onInfo && typeof onInfo !== 'function') {\n        throw new InvalidArgumentError('invalid onInfo callback')\n      }\n\n      super('UNDICI_STREAM')\n    } catch (err) {\n      if (util.isStream(body)) {\n        util.destroy(body.on('error', util.nop), err)\n      }\n      throw err\n    }\n\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.factory = factory\n    this.callback = callback\n    this.res = null\n    this.abort = null\n    this.context = null\n    this.trailers = null\n    this.body = body\n    this.onInfo = onInfo || null\n    this.throwOnError = throwOnError || false\n\n    if (util.isStream(body)) {\n      body.on('error', (err) => {\n        this.onError(err)\n      })\n    }\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const { factory, opaque, context, callback, responseHeaders } = this\n\n    const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    this.factory = null\n\n    let res\n\n    if (this.throwOnError && statusCode >= 400) {\n      const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n      const contentType = parsedHeaders['content-type']\n      res = new PassThrough()\n\n      this.callback = null\n      this.runInAsyncScope(getResolveErrorBodyCallback, null,\n        { callback, body: res, contentType, statusCode, statusMessage, headers }\n      )\n    } else {\n      if (factory === null) {\n        return\n      }\n\n      res = this.runInAsyncScope(factory, null, {\n        statusCode,\n        headers,\n        opaque,\n        context\n      })\n\n      if (\n        !res ||\n        typeof res.write !== 'function' ||\n        typeof res.end !== 'function' ||\n        typeof res.on !== 'function'\n      ) {\n        throw new InvalidReturnValueError('expected Writable')\n      }\n\n      // TODO: Avoid finished. It registers an unnecessary amount of listeners.\n      finished(res, { readable: false }, (err) => {\n        const { callback, res, opaque, trailers, abort } = this\n\n        this.res = null\n        if (err || !res.readable) {\n          util.destroy(res, err)\n        }\n\n        this.callback = null\n        this.runInAsyncScope(callback, null, err || null, { opaque, trailers })\n\n        if (err) {\n          abort()\n        }\n      })\n    }\n\n    res.on('drain', resume)\n\n    this.res = res\n\n    const needDrain = res.writableNeedDrain !== undefined\n      ? res.writableNeedDrain\n      : res._writableState?.needDrain\n\n    return needDrain !== true\n  }\n\n  onData (chunk) {\n    const { res } = this\n\n    return res ? res.write(chunk) : true\n  }\n\n  onComplete (trailers) {\n    const { res } = this\n\n    removeSignal(this)\n\n    if (!res) {\n      return\n    }\n\n    this.trailers = util.parseHeaders(trailers)\n\n    res.end()\n  }\n\n  onError (err) {\n    const { res, callback, opaque, body } = this\n\n    removeSignal(this)\n\n    this.factory = null\n\n    if (res) {\n      this.res = null\n      util.destroy(res, err)\n    } else if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n\n    if (body) {\n      this.body = null\n      util.destroy(body, err)\n    }\n  }\n}\n\nfunction stream (opts, factory, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      stream.call(this, opts, factory, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    this.dispatch(opts, new StreamHandler(opts, factory, callback))\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = stream\n","'use strict'\n\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst { AsyncResource } = require('node:async_hooks')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nclass UpgradeHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    const { signal, opaque, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    super('UNDICI_UPGRADE')\n\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.callback = callback\n    this.abort = null\n    this.context = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = null\n  }\n\n  onHeaders () {\n    throw new SocketError('bad upgrade', null)\n  }\n\n  onUpgrade (statusCode, rawHeaders, socket) {\n    assert(statusCode === 101)\n\n    const { callback, opaque, context } = this\n\n    removeSignal(this)\n\n    this.callback = null\n    const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n    this.runInAsyncScope(callback, null, null, {\n      headers,\n      socket,\n      opaque,\n      context\n    })\n  }\n\n  onError (err) {\n    const { callback, opaque } = this\n\n    removeSignal(this)\n\n    if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n  }\n}\n\nfunction upgrade (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      upgrade.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    const upgradeHandler = new UpgradeHandler(opts, callback)\n    this.dispatch({\n      ...opts,\n      method: opts.method || 'GET',\n      upgrade: opts.protocol || 'Websocket'\n    }, upgradeHandler)\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = upgrade\n","'use strict'\n\nmodule.exports.request = require('./api-request')\nmodule.exports.stream = require('./api-stream')\nmodule.exports.pipeline = require('./api-pipeline')\nmodule.exports.upgrade = require('./api-upgrade')\nmodule.exports.connect = require('./api-connect')\n","// Ported from https://github.com/nodejs/undici/pull/907\n\n'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('node:stream')\nconst { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require('../core/errors')\nconst util = require('../core/util')\nconst { ReadableStreamFrom } = require('../core/util')\n\nconst kConsume = Symbol('kConsume')\nconst kReading = Symbol('kReading')\nconst kBody = Symbol('kBody')\nconst kAbort = Symbol('kAbort')\nconst kContentType = Symbol('kContentType')\nconst kContentLength = Symbol('kContentLength')\n\nconst noop = () => {}\n\nclass BodyReadable extends Readable {\n  constructor ({\n    resume,\n    abort,\n    contentType = '',\n    contentLength,\n    highWaterMark = 64 * 1024 // Same as nodejs fs streams.\n  }) {\n    super({\n      autoDestroy: true,\n      read: resume,\n      highWaterMark\n    })\n\n    this._readableState.dataEmitted = false\n\n    this[kAbort] = abort\n    this[kConsume] = null\n    this[kBody] = null\n    this[kContentType] = contentType\n    this[kContentLength] = contentLength\n\n    // Is stream being consumed through Readable API?\n    // This is an optimization so that we avoid checking\n    // for 'data' and 'readable' listeners in the hot path\n    // inside push().\n    this[kReading] = false\n  }\n\n  destroy (err) {\n    if (!err && !this._readableState.endEmitted) {\n      err = new RequestAbortedError()\n    }\n\n    if (err) {\n      this[kAbort]()\n    }\n\n    return super.destroy(err)\n  }\n\n  _destroy (err, callback) {\n    // Workaround for Node \"bug\". If the stream is destroyed in same\n    // tick as it is created, then a user who is waiting for a\n    // promise (i.e micro tick) for installing a 'error' listener will\n    // never get a chance and will always encounter an unhandled exception.\n    if (!this[kReading]) {\n      setImmediate(() => {\n        callback(err)\n      })\n    } else {\n      callback(err)\n    }\n  }\n\n  on (ev, ...args) {\n    if (ev === 'data' || ev === 'readable') {\n      this[kReading] = true\n    }\n    return super.on(ev, ...args)\n  }\n\n  addListener (ev, ...args) {\n    return this.on(ev, ...args)\n  }\n\n  off (ev, ...args) {\n    const ret = super.off(ev, ...args)\n    if (ev === 'data' || ev === 'readable') {\n      this[kReading] = (\n        this.listenerCount('data') > 0 ||\n        this.listenerCount('readable') > 0\n      )\n    }\n    return ret\n  }\n\n  removeListener (ev, ...args) {\n    return this.off(ev, ...args)\n  }\n\n  push (chunk) {\n    if (this[kConsume] && chunk !== null) {\n      consumePush(this[kConsume], chunk)\n      return this[kReading] ? super.push(chunk) : true\n    }\n    return super.push(chunk)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-text\n  async text () {\n    return consume(this, 'text')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-json\n  async json () {\n    return consume(this, 'json')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-blob\n  async blob () {\n    return consume(this, 'blob')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bytes\n  async bytes () {\n    return consume(this, 'bytes')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n  async arrayBuffer () {\n    return consume(this, 'arrayBuffer')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-formdata\n  async formData () {\n    // TODO: Implement.\n    throw new NotSupportedError()\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bodyused\n  get bodyUsed () {\n    return util.isDisturbed(this)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-body\n  get body () {\n    if (!this[kBody]) {\n      this[kBody] = ReadableStreamFrom(this)\n      if (this[kConsume]) {\n        // TODO: Is this the best way to force a lock?\n        this[kBody].getReader() // Ensure stream is locked.\n        assert(this[kBody].locked)\n      }\n    }\n    return this[kBody]\n  }\n\n  async dump (opts) {\n    let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024\n    const signal = opts?.signal\n\n    if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) {\n      throw new InvalidArgumentError('signal must be an AbortSignal')\n    }\n\n    signal?.throwIfAborted()\n\n    if (this._readableState.closeEmitted) {\n      return null\n    }\n\n    return await new Promise((resolve, reject) => {\n      if (this[kContentLength] > limit) {\n        this.destroy(new AbortError())\n      }\n\n      const onAbort = () => {\n        this.destroy(signal.reason ?? new AbortError())\n      }\n      signal?.addEventListener('abort', onAbort)\n\n      this\n        .on('close', function () {\n          signal?.removeEventListener('abort', onAbort)\n          if (signal?.aborted) {\n            reject(signal.reason ?? new AbortError())\n          } else {\n            resolve(null)\n          }\n        })\n        .on('error', noop)\n        .on('data', function (chunk) {\n          limit -= chunk.length\n          if (limit <= 0) {\n            this.destroy()\n          }\n        })\n        .resume()\n    })\n  }\n}\n\n// https://streams.spec.whatwg.org/#readablestream-locked\nfunction isLocked (self) {\n  // Consume is an implicit lock.\n  return (self[kBody] && self[kBody].locked === true) || self[kConsume]\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction isUnusable (self) {\n  return util.isDisturbed(self) || isLocked(self)\n}\n\nasync function consume (stream, type) {\n  assert(!stream[kConsume])\n\n  return new Promise((resolve, reject) => {\n    if (isUnusable(stream)) {\n      const rState = stream._readableState\n      if (rState.destroyed && rState.closeEmitted === false) {\n        stream\n          .on('error', err => {\n            reject(err)\n          })\n          .on('close', () => {\n            reject(new TypeError('unusable'))\n          })\n      } else {\n        reject(rState.errored ?? new TypeError('unusable'))\n      }\n    } else {\n      queueMicrotask(() => {\n        stream[kConsume] = {\n          type,\n          stream,\n          resolve,\n          reject,\n          length: 0,\n          body: []\n        }\n\n        stream\n          .on('error', function (err) {\n            consumeFinish(this[kConsume], err)\n          })\n          .on('close', function () {\n            if (this[kConsume].body !== null) {\n              consumeFinish(this[kConsume], new RequestAbortedError())\n            }\n          })\n\n        consumeStart(stream[kConsume])\n      })\n    }\n  })\n}\n\nfunction consumeStart (consume) {\n  if (consume.body === null) {\n    return\n  }\n\n  const { _readableState: state } = consume.stream\n\n  if (state.bufferIndex) {\n    const start = state.bufferIndex\n    const end = state.buffer.length\n    for (let n = start; n < end; n++) {\n      consumePush(consume, state.buffer[n])\n    }\n  } else {\n    for (const chunk of state.buffer) {\n      consumePush(consume, chunk)\n    }\n  }\n\n  if (state.endEmitted) {\n    consumeEnd(this[kConsume])\n  } else {\n    consume.stream.on('end', function () {\n      consumeEnd(this[kConsume])\n    })\n  }\n\n  consume.stream.resume()\n\n  while (consume.stream.read() != null) {\n    // Loop\n  }\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n */\nfunction chunksDecode (chunks, length) {\n  if (chunks.length === 0 || length === 0) {\n    return ''\n  }\n  const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length)\n  const bufferLength = buffer.length\n\n  // Skip BOM.\n  const start =\n    bufferLength > 2 &&\n    buffer[0] === 0xef &&\n    buffer[1] === 0xbb &&\n    buffer[2] === 0xbf\n      ? 3\n      : 0\n  return buffer.utf8Slice(start, bufferLength)\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n * @returns {Uint8Array}\n */\nfunction chunksConcat (chunks, length) {\n  if (chunks.length === 0 || length === 0) {\n    return new Uint8Array(0)\n  }\n  if (chunks.length === 1) {\n    // fast-path\n    return new Uint8Array(chunks[0])\n  }\n  const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer)\n\n  let offset = 0\n  for (let i = 0; i < chunks.length; ++i) {\n    const chunk = chunks[i]\n    buffer.set(chunk, offset)\n    offset += chunk.length\n  }\n\n  return buffer\n}\n\nfunction consumeEnd (consume) {\n  const { type, body, resolve, stream, length } = consume\n\n  try {\n    if (type === 'text') {\n      resolve(chunksDecode(body, length))\n    } else if (type === 'json') {\n      resolve(JSON.parse(chunksDecode(body, length)))\n    } else if (type === 'arrayBuffer') {\n      resolve(chunksConcat(body, length).buffer)\n    } else if (type === 'blob') {\n      resolve(new Blob(body, { type: stream[kContentType] }))\n    } else if (type === 'bytes') {\n      resolve(chunksConcat(body, length))\n    }\n\n    consumeFinish(consume)\n  } catch (err) {\n    stream.destroy(err)\n  }\n}\n\nfunction consumePush (consume, chunk) {\n  consume.length += chunk.length\n  consume.body.push(chunk)\n}\n\nfunction consumeFinish (consume, err) {\n  if (consume.body === null) {\n    return\n  }\n\n  if (err) {\n    consume.reject(err)\n  } else {\n    consume.resolve()\n  }\n\n  consume.type = null\n  consume.stream = null\n  consume.resolve = null\n  consume.reject = null\n  consume.length = 0\n  consume.body = null\n}\n\nmodule.exports = { Readable: BodyReadable, chunksDecode }\n","const assert = require('node:assert')\nconst {\n  ResponseStatusCodeError\n} = require('../core/errors')\n\nconst { chunksDecode } = require('./readable')\nconst CHUNK_LIMIT = 128 * 1024\n\nasync function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {\n  assert(body)\n\n  let chunks = []\n  let length = 0\n\n  try {\n    for await (const chunk of body) {\n      chunks.push(chunk)\n      length += chunk.length\n      if (length > CHUNK_LIMIT) {\n        chunks = []\n        length = 0\n        break\n      }\n    }\n  } catch {\n    chunks = []\n    length = 0\n    // Do nothing....\n  }\n\n  const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`\n\n  if (statusCode === 204 || !contentType || !length) {\n    queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)))\n    return\n  }\n\n  const stackTraceLimit = Error.stackTraceLimit\n  Error.stackTraceLimit = 0\n  let payload\n\n  try {\n    if (isContentTypeApplicationJson(contentType)) {\n      payload = JSON.parse(chunksDecode(chunks, length))\n    } else if (isContentTypeText(contentType)) {\n      payload = chunksDecode(chunks, length)\n    }\n  } catch {\n    // process in a callback to avoid throwing in the microtask queue\n  } finally {\n    Error.stackTraceLimit = stackTraceLimit\n  }\n  queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)))\n}\n\nconst isContentTypeApplicationJson = (contentType) => {\n  return (\n    contentType.length > 15 &&\n    contentType[11] === '/' &&\n    contentType[0] === 'a' &&\n    contentType[1] === 'p' &&\n    contentType[2] === 'p' &&\n    contentType[3] === 'l' &&\n    contentType[4] === 'i' &&\n    contentType[5] === 'c' &&\n    contentType[6] === 'a' &&\n    contentType[7] === 't' &&\n    contentType[8] === 'i' &&\n    contentType[9] === 'o' &&\n    contentType[10] === 'n' &&\n    contentType[12] === 'j' &&\n    contentType[13] === 's' &&\n    contentType[14] === 'o' &&\n    contentType[15] === 'n'\n  )\n}\n\nconst isContentTypeText = (contentType) => {\n  return (\n    contentType.length > 4 &&\n    contentType[4] === '/' &&\n    contentType[0] === 't' &&\n    contentType[1] === 'e' &&\n    contentType[2] === 'x' &&\n    contentType[3] === 't'\n  )\n}\n\nmodule.exports = {\n  getResolveErrorBodyCallback,\n  isContentTypeApplicationJson,\n  isContentTypeText\n}\n","'use strict'\n\nconst net = require('node:net')\nconst assert = require('node:assert')\nconst util = require('./util')\nconst { InvalidArgumentError, ConnectTimeoutError } = require('./errors')\nconst timers = require('../util/timers')\n\nfunction noop () {}\n\nlet tls // include tls conditionally since it is not always available\n\n// TODO: session re-use does not wait for the first\n// connection to resolve the session and might therefore\n// resolve the same servername multiple times even when\n// re-use is enabled.\n\nlet SessionCache\n// FIXME: remove workaround when the Node bug is fixed\n// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\nif (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) {\n  SessionCache = class WeakSessionCache {\n    constructor (maxCachedSessions) {\n      this._maxCachedSessions = maxCachedSessions\n      this._sessionCache = new Map()\n      this._sessionRegistry = new global.FinalizationRegistry((key) => {\n        if (this._sessionCache.size < this._maxCachedSessions) {\n          return\n        }\n\n        const ref = this._sessionCache.get(key)\n        if (ref !== undefined && ref.deref() === undefined) {\n          this._sessionCache.delete(key)\n        }\n      })\n    }\n\n    get (sessionKey) {\n      const ref = this._sessionCache.get(sessionKey)\n      return ref ? ref.deref() : null\n    }\n\n    set (sessionKey, session) {\n      if (this._maxCachedSessions === 0) {\n        return\n      }\n\n      this._sessionCache.set(sessionKey, new WeakRef(session))\n      this._sessionRegistry.register(session, sessionKey)\n    }\n  }\n} else {\n  SessionCache = class SimpleSessionCache {\n    constructor (maxCachedSessions) {\n      this._maxCachedSessions = maxCachedSessions\n      this._sessionCache = new Map()\n    }\n\n    get (sessionKey) {\n      return this._sessionCache.get(sessionKey)\n    }\n\n    set (sessionKey, session) {\n      if (this._maxCachedSessions === 0) {\n        return\n      }\n\n      if (this._sessionCache.size >= this._maxCachedSessions) {\n        // remove the oldest session\n        const { value: oldestKey } = this._sessionCache.keys().next()\n        this._sessionCache.delete(oldestKey)\n      }\n\n      this._sessionCache.set(sessionKey, session)\n    }\n  }\n}\n\nfunction buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {\n  if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n    throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')\n  }\n\n  const options = { path: socketPath, ...opts }\n  const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)\n  timeout = timeout == null ? 10e3 : timeout\n  allowH2 = allowH2 != null ? allowH2 : false\n  return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n    let socket\n    if (protocol === 'https:') {\n      if (!tls) {\n        tls = require('node:tls')\n      }\n      servername = servername || options.servername || util.getServerName(host) || null\n\n      const sessionKey = servername || hostname\n      assert(sessionKey)\n\n      const session = customSession || sessionCache.get(sessionKey) || null\n\n      port = port || 443\n\n      socket = tls.connect({\n        highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...\n        ...options,\n        servername,\n        session,\n        localAddress,\n        // TODO(HTTP/2): Add support for h2c\n        ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],\n        socket: httpSocket, // upgrade socket connection\n        port,\n        host: hostname\n      })\n\n      socket\n        .on('session', function (session) {\n          // TODO (fix): Can a session become invalid once established? Don't think so?\n          sessionCache.set(sessionKey, session)\n        })\n    } else {\n      assert(!httpSocket, 'httpSocket can only be sent on TLS update')\n\n      port = port || 80\n\n      socket = net.connect({\n        highWaterMark: 64 * 1024, // Same as nodejs fs streams.\n        ...options,\n        localAddress,\n        port,\n        host: hostname\n      })\n    }\n\n    // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket\n    if (options.keepAlive == null || options.keepAlive) {\n      const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay\n      socket.setKeepAlive(true, keepAliveInitialDelay)\n    }\n\n    const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port })\n\n    socket\n      .setNoDelay(true)\n      .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {\n        queueMicrotask(clearConnectTimeout)\n\n        if (callback) {\n          const cb = callback\n          callback = null\n          cb(null, this)\n        }\n      })\n      .on('error', function (err) {\n        queueMicrotask(clearConnectTimeout)\n\n        if (callback) {\n          const cb = callback\n          callback = null\n          cb(err)\n        }\n      })\n\n    return socket\n  }\n}\n\n/**\n * @param {WeakRef} socketWeakRef\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n * @returns {() => void}\n */\nconst setupConnectTimeout = process.platform === 'win32'\n  ? (socketWeakRef, opts) => {\n      if (!opts.timeout) {\n        return noop\n      }\n\n      let s1 = null\n      let s2 = null\n      const fastTimer = timers.setFastTimeout(() => {\n      // setImmediate is added to make sure that we prioritize socket error events over timeouts\n        s1 = setImmediate(() => {\n        // Windows needs an extra setImmediate probably due to implementation differences in the socket logic\n          s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))\n        })\n      }, opts.timeout)\n      return () => {\n        timers.clearFastTimeout(fastTimer)\n        clearImmediate(s1)\n        clearImmediate(s2)\n      }\n    }\n  : (socketWeakRef, opts) => {\n      if (!opts.timeout) {\n        return noop\n      }\n\n      let s1 = null\n      const fastTimer = timers.setFastTimeout(() => {\n      // setImmediate is added to make sure that we prioritize socket error events over timeouts\n        s1 = setImmediate(() => {\n          onConnectTimeout(socketWeakRef.deref(), opts)\n        })\n      }, opts.timeout)\n      return () => {\n        timers.clearFastTimeout(fastTimer)\n        clearImmediate(s1)\n      }\n    }\n\n/**\n * @param {net.Socket} socket\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n */\nfunction onConnectTimeout (socket, opts) {\n  // The socket could be already garbage collected\n  if (socket == null) {\n    return\n  }\n\n  let message = 'Connect Timeout Error'\n  if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {\n    message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`\n  } else {\n    message += ` (attempted address: ${opts.hostname}:${opts.port},`\n  }\n\n  message += ` timeout: ${opts.timeout}ms)`\n\n  util.destroy(socket, new ConnectTimeoutError(message))\n}\n\nmodule.exports = buildConnector\n","'use strict'\n\n/** @type {Record} */\nconst headerNameLowerCasedRecord = {}\n\n// https://developer.mozilla.org/docs/Web/HTTP/Headers\nconst wellknownHeaderNames = [\n  'Accept',\n  'Accept-Encoding',\n  'Accept-Language',\n  'Accept-Ranges',\n  'Access-Control-Allow-Credentials',\n  'Access-Control-Allow-Headers',\n  'Access-Control-Allow-Methods',\n  'Access-Control-Allow-Origin',\n  'Access-Control-Expose-Headers',\n  'Access-Control-Max-Age',\n  'Access-Control-Request-Headers',\n  'Access-Control-Request-Method',\n  'Age',\n  'Allow',\n  'Alt-Svc',\n  'Alt-Used',\n  'Authorization',\n  'Cache-Control',\n  'Clear-Site-Data',\n  'Connection',\n  'Content-Disposition',\n  'Content-Encoding',\n  'Content-Language',\n  'Content-Length',\n  'Content-Location',\n  'Content-Range',\n  'Content-Security-Policy',\n  'Content-Security-Policy-Report-Only',\n  'Content-Type',\n  'Cookie',\n  'Cross-Origin-Embedder-Policy',\n  'Cross-Origin-Opener-Policy',\n  'Cross-Origin-Resource-Policy',\n  'Date',\n  'Device-Memory',\n  'Downlink',\n  'ECT',\n  'ETag',\n  'Expect',\n  'Expect-CT',\n  'Expires',\n  'Forwarded',\n  'From',\n  'Host',\n  'If-Match',\n  'If-Modified-Since',\n  'If-None-Match',\n  'If-Range',\n  'If-Unmodified-Since',\n  'Keep-Alive',\n  'Last-Modified',\n  'Link',\n  'Location',\n  'Max-Forwards',\n  'Origin',\n  'Permissions-Policy',\n  'Pragma',\n  'Proxy-Authenticate',\n  'Proxy-Authorization',\n  'RTT',\n  'Range',\n  'Referer',\n  'Referrer-Policy',\n  'Refresh',\n  'Retry-After',\n  'Sec-WebSocket-Accept',\n  'Sec-WebSocket-Extensions',\n  'Sec-WebSocket-Key',\n  'Sec-WebSocket-Protocol',\n  'Sec-WebSocket-Version',\n  'Server',\n  'Server-Timing',\n  'Service-Worker-Allowed',\n  'Service-Worker-Navigation-Preload',\n  'Set-Cookie',\n  'SourceMap',\n  'Strict-Transport-Security',\n  'Supports-Loading-Mode',\n  'TE',\n  'Timing-Allow-Origin',\n  'Trailer',\n  'Transfer-Encoding',\n  'Upgrade',\n  'Upgrade-Insecure-Requests',\n  'User-Agent',\n  'Vary',\n  'Via',\n  'WWW-Authenticate',\n  'X-Content-Type-Options',\n  'X-DNS-Prefetch-Control',\n  'X-Frame-Options',\n  'X-Permitted-Cross-Domain-Policies',\n  'X-Powered-By',\n  'X-Requested-With',\n  'X-XSS-Protection'\n]\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n  const key = wellknownHeaderNames[i]\n  const lowerCasedKey = key.toLowerCase()\n  headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =\n    lowerCasedKey\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(headerNameLowerCasedRecord, null)\n\nmodule.exports = {\n  wellknownHeaderNames,\n  headerNameLowerCasedRecord\n}\n","'use strict'\nconst diagnosticsChannel = require('node:diagnostics_channel')\nconst util = require('node:util')\n\nconst undiciDebugLog = util.debuglog('undici')\nconst fetchDebuglog = util.debuglog('fetch')\nconst websocketDebuglog = util.debuglog('websocket')\nlet isClientSet = false\nconst channels = {\n  // Client\n  beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),\n  connected: diagnosticsChannel.channel('undici:client:connected'),\n  connectError: diagnosticsChannel.channel('undici:client:connectError'),\n  sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),\n  // Request\n  create: diagnosticsChannel.channel('undici:request:create'),\n  bodySent: diagnosticsChannel.channel('undici:request:bodySent'),\n  headers: diagnosticsChannel.channel('undici:request:headers'),\n  trailers: diagnosticsChannel.channel('undici:request:trailers'),\n  error: diagnosticsChannel.channel('undici:request:error'),\n  // WebSocket\n  open: diagnosticsChannel.channel('undici:websocket:open'),\n  close: diagnosticsChannel.channel('undici:websocket:close'),\n  socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),\n  ping: diagnosticsChannel.channel('undici:websocket:ping'),\n  pong: diagnosticsChannel.channel('undici:websocket:pong')\n}\n\nif (undiciDebugLog.enabled || fetchDebuglog.enabled) {\n  const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog\n\n  // Track all Client events\n  diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host }\n    } = evt\n    debuglog(\n      'connecting to %s using %s%s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host }\n    } = evt\n    debuglog(\n      'connected to %s using %s%s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host },\n      error\n    } = evt\n    debuglog(\n      'connection to %s using %s%s errored - %s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version,\n      error.message\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n    const {\n      request: { method, path, origin }\n    } = evt\n    debuglog('sending request to %s %s/%s', method, origin, path)\n  })\n\n  // Track Request events\n  diagnosticsChannel.channel('undici:request:headers').subscribe(evt => {\n    const {\n      request: { method, path, origin },\n      response: { statusCode }\n    } = evt\n    debuglog(\n      'received response to %s %s/%s - HTTP %d',\n      method,\n      origin,\n      path,\n      statusCode\n    )\n  })\n\n  diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => {\n    const {\n      request: { method, path, origin }\n    } = evt\n    debuglog('trailers received from %s %s/%s', method, origin, path)\n  })\n\n  diagnosticsChannel.channel('undici:request:error').subscribe(evt => {\n    const {\n      request: { method, path, origin },\n      error\n    } = evt\n    debuglog(\n      'request to %s %s/%s errored - %s',\n      method,\n      origin,\n      path,\n      error.message\n    )\n  })\n\n  isClientSet = true\n}\n\nif (websocketDebuglog.enabled) {\n  if (!isClientSet) {\n    const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog\n    diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host }\n      } = evt\n      debuglog(\n        'connecting to %s%s using %s%s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host }\n      } = evt\n      debuglog(\n        'connected to %s%s using %s%s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host },\n        error\n      } = evt\n      debuglog(\n        'connection to %s%s using %s%s errored - %s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version,\n        error.message\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n      const {\n        request: { method, path, origin }\n      } = evt\n      debuglog('sending request to %s %s/%s', method, origin, path)\n    })\n  }\n\n  // Track all WebSocket events\n  diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => {\n    const {\n      address: { address, port }\n    } = evt\n    websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '')\n  })\n\n  diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => {\n    const { websocket, code, reason } = evt\n    websocketDebuglog(\n      'closed connection to %s - %s %s',\n      websocket.url,\n      code,\n      reason\n    )\n  })\n\n  diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => {\n    websocketDebuglog('connection errored - %s', err.message)\n  })\n\n  diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => {\n    websocketDebuglog('ping received')\n  })\n\n  diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => {\n    websocketDebuglog('pong received')\n  })\n}\n\nmodule.exports = {\n  channels\n}\n","'use strict'\n\nconst kUndiciError = Symbol.for('undici.error.UND_ERR')\nclass UndiciError extends Error {\n  constructor (message) {\n    super(message)\n    this.name = 'UndiciError'\n    this.code = 'UND_ERR'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kUndiciError] === true\n  }\n\n  [kUndiciError] = true\n}\n\nconst kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT')\nclass ConnectTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ConnectTimeoutError'\n    this.message = message || 'Connect Timeout Error'\n    this.code = 'UND_ERR_CONNECT_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kConnectTimeoutError] === true\n  }\n\n  [kConnectTimeoutError] = true\n}\n\nconst kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT')\nclass HeadersTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'HeadersTimeoutError'\n    this.message = message || 'Headers Timeout Error'\n    this.code = 'UND_ERR_HEADERS_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHeadersTimeoutError] === true\n  }\n\n  [kHeadersTimeoutError] = true\n}\n\nconst kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW')\nclass HeadersOverflowError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'HeadersOverflowError'\n    this.message = message || 'Headers Overflow Error'\n    this.code = 'UND_ERR_HEADERS_OVERFLOW'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHeadersOverflowError] === true\n  }\n\n  [kHeadersOverflowError] = true\n}\n\nconst kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT')\nclass BodyTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'BodyTimeoutError'\n    this.message = message || 'Body Timeout Error'\n    this.code = 'UND_ERR_BODY_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kBodyTimeoutError] === true\n  }\n\n  [kBodyTimeoutError] = true\n}\n\nconst kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE')\nclass ResponseStatusCodeError extends UndiciError {\n  constructor (message, statusCode, headers, body) {\n    super(message)\n    this.name = 'ResponseStatusCodeError'\n    this.message = message || 'Response Status Code Error'\n    this.code = 'UND_ERR_RESPONSE_STATUS_CODE'\n    this.body = body\n    this.status = statusCode\n    this.statusCode = statusCode\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseStatusCodeError] === true\n  }\n\n  [kResponseStatusCodeError] = true\n}\n\nconst kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG')\nclass InvalidArgumentError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InvalidArgumentError'\n    this.message = message || 'Invalid Argument Error'\n    this.code = 'UND_ERR_INVALID_ARG'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInvalidArgumentError] === true\n  }\n\n  [kInvalidArgumentError] = true\n}\n\nconst kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE')\nclass InvalidReturnValueError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InvalidReturnValueError'\n    this.message = message || 'Invalid Return Value Error'\n    this.code = 'UND_ERR_INVALID_RETURN_VALUE'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInvalidReturnValueError] === true\n  }\n\n  [kInvalidReturnValueError] = true\n}\n\nconst kAbortError = Symbol.for('undici.error.UND_ERR_ABORT')\nclass AbortError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'AbortError'\n    this.message = message || 'The operation was aborted'\n    this.code = 'UND_ERR_ABORT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kAbortError] === true\n  }\n\n  [kAbortError] = true\n}\n\nconst kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED')\nclass RequestAbortedError extends AbortError {\n  constructor (message) {\n    super(message)\n    this.name = 'AbortError'\n    this.message = message || 'Request aborted'\n    this.code = 'UND_ERR_ABORTED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestAbortedError] === true\n  }\n\n  [kRequestAbortedError] = true\n}\n\nconst kInformationalError = Symbol.for('undici.error.UND_ERR_INFO')\nclass InformationalError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InformationalError'\n    this.message = message || 'Request information'\n    this.code = 'UND_ERR_INFO'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInformationalError] === true\n  }\n\n  [kInformationalError] = true\n}\n\nconst kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH')\nclass RequestContentLengthMismatchError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'RequestContentLengthMismatchError'\n    this.message = message || 'Request body length does not match content-length header'\n    this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestContentLengthMismatchError] === true\n  }\n\n  [kRequestContentLengthMismatchError] = true\n}\n\nconst kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH')\nclass ResponseContentLengthMismatchError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ResponseContentLengthMismatchError'\n    this.message = message || 'Response body length does not match content-length header'\n    this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseContentLengthMismatchError] === true\n  }\n\n  [kResponseContentLengthMismatchError] = true\n}\n\nconst kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED')\nclass ClientDestroyedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ClientDestroyedError'\n    this.message = message || 'The client is destroyed'\n    this.code = 'UND_ERR_DESTROYED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kClientDestroyedError] === true\n  }\n\n  [kClientDestroyedError] = true\n}\n\nconst kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED')\nclass ClientClosedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ClientClosedError'\n    this.message = message || 'The client is closed'\n    this.code = 'UND_ERR_CLOSED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kClientClosedError] === true\n  }\n\n  [kClientClosedError] = true\n}\n\nconst kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET')\nclass SocketError extends UndiciError {\n  constructor (message, socket) {\n    super(message)\n    this.name = 'SocketError'\n    this.message = message || 'Socket error'\n    this.code = 'UND_ERR_SOCKET'\n    this.socket = socket\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kSocketError] === true\n  }\n\n  [kSocketError] = true\n}\n\nconst kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED')\nclass NotSupportedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'NotSupportedError'\n    this.message = message || 'Not supported error'\n    this.code = 'UND_ERR_NOT_SUPPORTED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kNotSupportedError] === true\n  }\n\n  [kNotSupportedError] = true\n}\n\nconst kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM')\nclass BalancedPoolMissingUpstreamError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'MissingUpstreamError'\n    this.message = message || 'No upstream has been added to the BalancedPool'\n    this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kBalancedPoolMissingUpstreamError] === true\n  }\n\n  [kBalancedPoolMissingUpstreamError] = true\n}\n\nconst kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')\nclass HTTPParserError extends Error {\n  constructor (message, code, data) {\n    super(message)\n    this.name = 'HTTPParserError'\n    this.code = code ? `HPE_${code}` : undefined\n    this.data = data ? data.toString() : undefined\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHTTPParserError] === true\n  }\n\n  [kHTTPParserError] = true\n}\n\nconst kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE')\nclass ResponseExceededMaxSizeError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ResponseExceededMaxSizeError'\n    this.message = message || 'Response content exceeded max size'\n    this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseExceededMaxSizeError] === true\n  }\n\n  [kResponseExceededMaxSizeError] = true\n}\n\nconst kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY')\nclass RequestRetryError extends UndiciError {\n  constructor (message, code, { headers, data }) {\n    super(message)\n    this.name = 'RequestRetryError'\n    this.message = message || 'Request retry error'\n    this.code = 'UND_ERR_REQ_RETRY'\n    this.statusCode = code\n    this.data = data\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestRetryError] === true\n  }\n\n  [kRequestRetryError] = true\n}\n\nconst kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')\nclass ResponseError extends UndiciError {\n  constructor (message, code, { headers, data }) {\n    super(message)\n    this.name = 'ResponseError'\n    this.message = message || 'Response error'\n    this.code = 'UND_ERR_RESPONSE'\n    this.statusCode = code\n    this.data = data\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseError] === true\n  }\n\n  [kResponseError] = true\n}\n\nconst kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS')\nclass SecureProxyConnectionError extends UndiciError {\n  constructor (cause, message, options) {\n    super(message, { cause, ...(options ?? {}) })\n    this.name = 'SecureProxyConnectionError'\n    this.message = message || 'Secure Proxy Connection failed'\n    this.code = 'UND_ERR_PRX_TLS'\n    this.cause = cause\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kSecureProxyConnectionError] === true\n  }\n\n  [kSecureProxyConnectionError] = true\n}\n\nconst kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED')\nclass MessageSizeExceededError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'MessageSizeExceededError'\n    this.message = message || 'Max decompressed message size exceeded'\n    this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kMessageSizeExceededError] === true\n  }\n\n  get [kMessageSizeExceededError] () {\n    return true\n  }\n}\n\nmodule.exports = {\n  AbortError,\n  HTTPParserError,\n  UndiciError,\n  HeadersTimeoutError,\n  HeadersOverflowError,\n  BodyTimeoutError,\n  RequestContentLengthMismatchError,\n  ConnectTimeoutError,\n  ResponseStatusCodeError,\n  InvalidArgumentError,\n  InvalidReturnValueError,\n  RequestAbortedError,\n  ClientDestroyedError,\n  ClientClosedError,\n  InformationalError,\n  SocketError,\n  NotSupportedError,\n  ResponseContentLengthMismatchError,\n  BalancedPoolMissingUpstreamError,\n  ResponseExceededMaxSizeError,\n  RequestRetryError,\n  ResponseError,\n  SecureProxyConnectionError,\n  MessageSizeExceededError\n}\n","'use strict'\n\nconst {\n  InvalidArgumentError,\n  NotSupportedError\n} = require('./errors')\nconst assert = require('node:assert')\nconst {\n  isValidHTTPToken,\n  isValidHeaderValue,\n  isStream,\n  destroy,\n  isBuffer,\n  isFormDataLike,\n  isIterable,\n  isBlobLike,\n  buildURL,\n  validateHandler,\n  getServerName,\n  normalizedMethodRecords\n} = require('./util')\nconst { channels } = require('./diagnostics.js')\nconst { headerNameLowerCasedRecord } = require('./constants')\n\n// Verifies that a given path is valid does not contain control chars \\x00 to \\x20\nconst invalidPathRegex = /[^\\u0021-\\u00ff]/\n\nconst kHandler = Symbol('handler')\n\nclass Request {\n  constructor (origin, {\n    path,\n    method,\n    body,\n    headers,\n    query,\n    idempotent,\n    blocking,\n    upgrade,\n    headersTimeout,\n    bodyTimeout,\n    reset,\n    throwOnError,\n    expectContinue,\n    servername\n  }, handler) {\n    if (typeof path !== 'string') {\n      throw new InvalidArgumentError('path must be a string')\n    } else if (\n      path[0] !== '/' &&\n      !(path.startsWith('http://') || path.startsWith('https://')) &&\n      method !== 'CONNECT'\n    ) {\n      throw new InvalidArgumentError('path must be an absolute URL or start with a slash')\n    } else if (invalidPathRegex.test(path)) {\n      throw new InvalidArgumentError('invalid request path')\n    }\n\n    if (typeof method !== 'string') {\n      throw new InvalidArgumentError('method must be a string')\n    } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {\n      throw new InvalidArgumentError('invalid request method')\n    }\n\n    if (upgrade && typeof upgrade !== 'string') {\n      throw new InvalidArgumentError('upgrade must be a string')\n    }\n\n    if (upgrade && !isValidHeaderValue(upgrade)) {\n      throw new InvalidArgumentError('invalid upgrade header')\n    }\n\n    if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n      throw new InvalidArgumentError('invalid headersTimeout')\n    }\n\n    if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n      throw new InvalidArgumentError('invalid bodyTimeout')\n    }\n\n    if (reset != null && typeof reset !== 'boolean') {\n      throw new InvalidArgumentError('invalid reset')\n    }\n\n    if (expectContinue != null && typeof expectContinue !== 'boolean') {\n      throw new InvalidArgumentError('invalid expectContinue')\n    }\n\n    this.headersTimeout = headersTimeout\n\n    this.bodyTimeout = bodyTimeout\n\n    this.throwOnError = throwOnError === true\n\n    this.method = method\n\n    this.abort = null\n\n    if (body == null) {\n      this.body = null\n    } else if (isStream(body)) {\n      this.body = body\n\n      const rState = this.body._readableState\n      if (!rState || !rState.autoDestroy) {\n        this.endHandler = function autoDestroy () {\n          destroy(this)\n        }\n        this.body.on('end', this.endHandler)\n      }\n\n      this.errorHandler = err => {\n        if (this.abort) {\n          this.abort(err)\n        } else {\n          this.error = err\n        }\n      }\n      this.body.on('error', this.errorHandler)\n    } else if (isBuffer(body)) {\n      this.body = body.byteLength ? body : null\n    } else if (ArrayBuffer.isView(body)) {\n      this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null\n    } else if (body instanceof ArrayBuffer) {\n      this.body = body.byteLength ? Buffer.from(body) : null\n    } else if (typeof body === 'string') {\n      this.body = body.length ? Buffer.from(body) : null\n    } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {\n      this.body = body\n    } else {\n      throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')\n    }\n\n    this.completed = false\n\n    this.aborted = false\n\n    this.upgrade = upgrade || null\n\n    this.path = query ? buildURL(path, query) : path\n\n    this.origin = origin\n\n    this.idempotent = idempotent == null\n      ? method === 'HEAD' || method === 'GET'\n      : idempotent\n\n    this.blocking = blocking == null ? false : blocking\n\n    this.reset = reset == null ? null : reset\n\n    this.host = null\n\n    this.contentLength = null\n\n    this.contentType = null\n\n    this.headers = []\n\n    // Only for H2\n    this.expectContinue = expectContinue != null ? expectContinue : false\n\n    if (Array.isArray(headers)) {\n      if (headers.length % 2 !== 0) {\n        throw new InvalidArgumentError('headers array must be even')\n      }\n      for (let i = 0; i < headers.length; i += 2) {\n        processHeader(this, headers[i], headers[i + 1])\n      }\n    } else if (headers && typeof headers === 'object') {\n      if (headers[Symbol.iterator]) {\n        for (const header of headers) {\n          if (!Array.isArray(header) || header.length !== 2) {\n            throw new InvalidArgumentError('headers must be in key-value pair format')\n          }\n          processHeader(this, header[0], header[1])\n        }\n      } else {\n        const keys = Object.keys(headers)\n        for (let i = 0; i < keys.length; ++i) {\n          processHeader(this, keys[i], headers[keys[i]])\n        }\n      }\n    } else if (headers != null) {\n      throw new InvalidArgumentError('headers must be an object or an array')\n    }\n\n    validateHandler(handler, method, upgrade)\n\n    this.servername = servername || getServerName(this.host)\n\n    this[kHandler] = handler\n\n    if (channels.create.hasSubscribers) {\n      channels.create.publish({ request: this })\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this[kHandler].onBodySent) {\n      try {\n        return this[kHandler].onBodySent(chunk)\n      } catch (err) {\n        this.abort(err)\n      }\n    }\n  }\n\n  onRequestSent () {\n    if (channels.bodySent.hasSubscribers) {\n      channels.bodySent.publish({ request: this })\n    }\n\n    if (this[kHandler].onRequestSent) {\n      try {\n        return this[kHandler].onRequestSent()\n      } catch (err) {\n        this.abort(err)\n      }\n    }\n  }\n\n  onConnect (abort) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    if (this.error) {\n      abort(this.error)\n    } else {\n      this.abort = abort\n      return this[kHandler].onConnect(abort)\n    }\n  }\n\n  onResponseStarted () {\n    return this[kHandler].onResponseStarted?.()\n  }\n\n  onHeaders (statusCode, headers, resume, statusText) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    if (channels.headers.hasSubscribers) {\n      channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n    }\n\n    try {\n      return this[kHandler].onHeaders(statusCode, headers, resume, statusText)\n    } catch (err) {\n      this.abort(err)\n    }\n  }\n\n  onData (chunk) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    try {\n      return this[kHandler].onData(chunk)\n    } catch (err) {\n      this.abort(err)\n      return false\n    }\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    return this[kHandler].onUpgrade(statusCode, headers, socket)\n  }\n\n  onComplete (trailers) {\n    this.onFinally()\n\n    assert(!this.aborted)\n\n    this.completed = true\n    if (channels.trailers.hasSubscribers) {\n      channels.trailers.publish({ request: this, trailers })\n    }\n\n    try {\n      return this[kHandler].onComplete(trailers)\n    } catch (err) {\n      // TODO (fix): This might be a bad idea?\n      this.onError(err)\n    }\n  }\n\n  onError (error) {\n    this.onFinally()\n\n    if (channels.error.hasSubscribers) {\n      channels.error.publish({ request: this, error })\n    }\n\n    if (this.aborted) {\n      return\n    }\n    this.aborted = true\n\n    return this[kHandler].onError(error)\n  }\n\n  onFinally () {\n    if (this.errorHandler) {\n      this.body.off('error', this.errorHandler)\n      this.errorHandler = null\n    }\n\n    if (this.endHandler) {\n      this.body.off('end', this.endHandler)\n      this.endHandler = null\n    }\n  }\n\n  addHeader (key, value) {\n    processHeader(this, key, value)\n    return this\n  }\n}\n\nfunction processHeader (request, key, val) {\n  if (val && (typeof val === 'object' && !Array.isArray(val))) {\n    throw new InvalidArgumentError(`invalid ${key} header`)\n  } else if (val === undefined) {\n    return\n  }\n\n  let headerName = headerNameLowerCasedRecord[key]\n\n  if (headerName === undefined) {\n    headerName = key.toLowerCase()\n    if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {\n      throw new InvalidArgumentError('invalid header key')\n    }\n  }\n\n  if (Array.isArray(val)) {\n    const arr = []\n    for (let i = 0; i < val.length; i++) {\n      if (typeof val[i] === 'string') {\n        if (!isValidHeaderValue(val[i])) {\n          throw new InvalidArgumentError(`invalid ${key} header`)\n        }\n        arr.push(val[i])\n      } else if (val[i] === null) {\n        arr.push('')\n      } else if (typeof val[i] === 'object') {\n        throw new InvalidArgumentError(`invalid ${key} header`)\n      } else {\n        arr.push(`${val[i]}`)\n      }\n    }\n    val = arr\n  } else if (typeof val === 'string') {\n    if (!isValidHeaderValue(val)) {\n      throw new InvalidArgumentError(`invalid ${key} header`)\n    }\n  } else if (val === null) {\n    val = ''\n  } else {\n    val = `${val}`\n  }\n\n  if (headerName === 'host') {\n    if (request.host !== null) {\n      throw new InvalidArgumentError('duplicate host header')\n    }\n    if (typeof val !== 'string') {\n      throw new InvalidArgumentError('invalid host header')\n    }\n    // Consumed by Client\n    request.host = val\n  } else if (headerName === 'content-length') {\n    if (request.contentLength !== null) {\n      throw new InvalidArgumentError('duplicate content-length header')\n    }\n    request.contentLength = parseInt(val, 10)\n    if (!Number.isFinite(request.contentLength)) {\n      throw new InvalidArgumentError('invalid content-length header')\n    }\n  } else if (request.contentType === null && headerName === 'content-type') {\n    request.contentType = val\n    request.headers.push(key, val)\n  } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {\n    throw new InvalidArgumentError(`invalid ${headerName} header`)\n  } else if (headerName === 'connection') {\n    const value = typeof val === 'string' ? val.toLowerCase() : null\n    if (value !== 'close' && value !== 'keep-alive') {\n      throw new InvalidArgumentError('invalid connection header')\n    }\n\n    if (value === 'close') {\n      request.reset = true\n    }\n  } else if (headerName === 'expect') {\n    throw new NotSupportedError('expect header not supported')\n  } else {\n    request.headers.push(key, val)\n  }\n}\n\nmodule.exports = Request\n","module.exports = {\n  kClose: Symbol('close'),\n  kDestroy: Symbol('destroy'),\n  kDispatch: Symbol('dispatch'),\n  kUrl: Symbol('url'),\n  kWriting: Symbol('writing'),\n  kResuming: Symbol('resuming'),\n  kQueue: Symbol('queue'),\n  kConnect: Symbol('connect'),\n  kConnecting: Symbol('connecting'),\n  kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),\n  kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),\n  kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),\n  kKeepAliveTimeoutValue: Symbol('keep alive timeout'),\n  kKeepAlive: Symbol('keep alive'),\n  kHeadersTimeout: Symbol('headers timeout'),\n  kBodyTimeout: Symbol('body timeout'),\n  kServerName: Symbol('server name'),\n  kLocalAddress: Symbol('local address'),\n  kHost: Symbol('host'),\n  kNoRef: Symbol('no ref'),\n  kBodyUsed: Symbol('used'),\n  kBody: Symbol('abstracted request body'),\n  kRunning: Symbol('running'),\n  kBlocking: Symbol('blocking'),\n  kPending: Symbol('pending'),\n  kSize: Symbol('size'),\n  kBusy: Symbol('busy'),\n  kQueued: Symbol('queued'),\n  kFree: Symbol('free'),\n  kConnected: Symbol('connected'),\n  kClosed: Symbol('closed'),\n  kNeedDrain: Symbol('need drain'),\n  kReset: Symbol('reset'),\n  kDestroyed: Symbol.for('nodejs.stream.destroyed'),\n  kResume: Symbol('resume'),\n  kOnError: Symbol('on error'),\n  kMaxHeadersSize: Symbol('max headers size'),\n  kRunningIdx: Symbol('running index'),\n  kPendingIdx: Symbol('pending index'),\n  kError: Symbol('error'),\n  kClients: Symbol('clients'),\n  kClient: Symbol('client'),\n  kParser: Symbol('parser'),\n  kOnDestroyed: Symbol('destroy callbacks'),\n  kPipelining: Symbol('pipelining'),\n  kSocket: Symbol('socket'),\n  kHostHeader: Symbol('host header'),\n  kConnector: Symbol('connector'),\n  kStrictContentLength: Symbol('strict content length'),\n  kMaxRedirections: Symbol('maxRedirections'),\n  kMaxRequests: Symbol('maxRequestsPerClient'),\n  kProxy: Symbol('proxy agent options'),\n  kCounter: Symbol('socket request counter'),\n  kInterceptors: Symbol('dispatch interceptors'),\n  kMaxResponseSize: Symbol('max response size'),\n  kHTTP2Session: Symbol('http2Session'),\n  kHTTP2SessionState: Symbol('http2Session state'),\n  kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),\n  kConstruct: Symbol('constructable'),\n  kListeners: Symbol('listeners'),\n  kHTTPContext: Symbol('http context'),\n  kMaxConcurrentStreams: Symbol('max concurrent streams'),\n  kNoProxyAgent: Symbol('no proxy agent'),\n  kHttpProxyAgent: Symbol('http proxy agent'),\n  kHttpsProxyAgent: Symbol('https proxy agent')\n}\n","'use strict'\n\nconst {\n  wellknownHeaderNames,\n  headerNameLowerCasedRecord\n} = require('./constants')\n\nclass TstNode {\n  /** @type {any} */\n  value = null\n  /** @type {null | TstNode} */\n  left = null\n  /** @type {null | TstNode} */\n  middle = null\n  /** @type {null | TstNode} */\n  right = null\n  /** @type {number} */\n  code\n  /**\n   * @param {string} key\n   * @param {any} value\n   * @param {number} index\n   */\n  constructor (key, value, index) {\n    if (index === undefined || index >= key.length) {\n      throw new TypeError('Unreachable')\n    }\n    const code = this.code = key.charCodeAt(index)\n    // check code is ascii string\n    if (code > 0x7F) {\n      throw new TypeError('key must be ascii string')\n    }\n    if (key.length !== ++index) {\n      this.middle = new TstNode(key, value, index)\n    } else {\n      this.value = value\n    }\n  }\n\n  /**\n   * @param {string} key\n   * @param {any} value\n   */\n  add (key, value) {\n    const length = key.length\n    if (length === 0) {\n      throw new TypeError('Unreachable')\n    }\n    let index = 0\n    let node = this\n    while (true) {\n      const code = key.charCodeAt(index)\n      // check code is ascii string\n      if (code > 0x7F) {\n        throw new TypeError('key must be ascii string')\n      }\n      if (node.code === code) {\n        if (length === ++index) {\n          node.value = value\n          break\n        } else if (node.middle !== null) {\n          node = node.middle\n        } else {\n          node.middle = new TstNode(key, value, index)\n          break\n        }\n      } else if (node.code < code) {\n        if (node.left !== null) {\n          node = node.left\n        } else {\n          node.left = new TstNode(key, value, index)\n          break\n        }\n      } else if (node.right !== null) {\n        node = node.right\n      } else {\n        node.right = new TstNode(key, value, index)\n        break\n      }\n    }\n  }\n\n  /**\n   * @param {Uint8Array} key\n   * @return {TstNode | null}\n   */\n  search (key) {\n    const keylength = key.length\n    let index = 0\n    let node = this\n    while (node !== null && index < keylength) {\n      let code = key[index]\n      // A-Z\n      // First check if it is bigger than 0x5a.\n      // Lowercase letters have higher char codes than uppercase ones.\n      // Also we assume that headers will mostly contain lowercase characters.\n      if (code <= 0x5a && code >= 0x41) {\n        // Lowercase for uppercase.\n        code |= 32\n      }\n      while (node !== null) {\n        if (code === node.code) {\n          if (keylength === ++index) {\n            // Returns Node since it is the last key.\n            return node\n          }\n          node = node.middle\n          break\n        }\n        node = node.code < code ? node.left : node.right\n      }\n    }\n    return null\n  }\n}\n\nclass TernarySearchTree {\n  /** @type {TstNode | null} */\n  node = null\n\n  /**\n   * @param {string} key\n   * @param {any} value\n   * */\n  insert (key, value) {\n    if (this.node === null) {\n      this.node = new TstNode(key, value, 0)\n    } else {\n      this.node.add(key, value)\n    }\n  }\n\n  /**\n   * @param {Uint8Array} key\n   * @return {any}\n   */\n  lookup (key) {\n    return this.node?.search(key)?.value ?? null\n  }\n}\n\nconst tree = new TernarySearchTree()\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n  const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]\n  tree.insert(key, key)\n}\n\nmodule.exports = {\n  TernarySearchTree,\n  tree\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')\nconst { IncomingMessage } = require('node:http')\nconst stream = require('node:stream')\nconst net = require('node:net')\nconst { Blob } = require('node:buffer')\nconst nodeUtil = require('node:util')\nconst { stringify } = require('node:querystring')\nconst { EventEmitter: EE } = require('node:events')\nconst { InvalidArgumentError } = require('./errors')\nconst { headerNameLowerCasedRecord } = require('./constants')\nconst { tree } = require('./tree')\n\nconst [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))\n\nclass BodyAsyncIterable {\n  constructor (body) {\n    this[kBody] = body\n    this[kBodyUsed] = false\n  }\n\n  async * [Symbol.asyncIterator] () {\n    assert(!this[kBodyUsed], 'disturbed')\n    this[kBodyUsed] = true\n    yield * this[kBody]\n  }\n}\n\nfunction wrapRequestBody (body) {\n  if (isStream(body)) {\n    // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n    // so that it can be dispatched again?\n    // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n    if (bodyLength(body) === 0) {\n      body\n        .on('data', function () {\n          assert(false)\n        })\n    }\n\n    if (typeof body.readableDidRead !== 'boolean') {\n      body[kBodyUsed] = false\n      EE.prototype.on.call(body, 'data', function () {\n        this[kBodyUsed] = true\n      })\n    }\n\n    return body\n  } else if (body && typeof body.pipeTo === 'function') {\n    // TODO (fix): We can't access ReadableStream internal state\n    // to determine whether or not it has been disturbed. This is just\n    // a workaround.\n    return new BodyAsyncIterable(body)\n  } else if (\n    body &&\n    typeof body !== 'string' &&\n    !ArrayBuffer.isView(body) &&\n    isIterable(body)\n  ) {\n    // TODO: Should we allow re-using iterable if !this.opts.idempotent\n    // or through some other flag?\n    return new BodyAsyncIterable(body)\n  } else {\n    return body\n  }\n}\n\nfunction nop () {}\n\nfunction isStream (obj) {\n  return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'\n}\n\n// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)\nfunction isBlobLike (object) {\n  if (object === null) {\n    return false\n  } else if (object instanceof Blob) {\n    return true\n  } else if (typeof object !== 'object') {\n    return false\n  } else {\n    const sTag = object[Symbol.toStringTag]\n\n    return (sTag === 'Blob' || sTag === 'File') && (\n      ('stream' in object && typeof object.stream === 'function') ||\n      ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')\n    )\n  }\n}\n\nfunction buildURL (url, queryParams) {\n  if (url.includes('?') || url.includes('#')) {\n    throw new Error('Query params cannot be passed when url already contains \"?\" or \"#\".')\n  }\n\n  const stringified = stringify(queryParams)\n\n  if (stringified) {\n    url += '?' + stringified\n  }\n\n  return url\n}\n\nfunction isValidPort (port) {\n  const value = parseInt(port, 10)\n  return (\n    value === Number(port) &&\n    value >= 0 &&\n    value <= 65535\n  )\n}\n\nfunction isHttpOrHttpsPrefixed (value) {\n  return (\n    value != null &&\n    value[0] === 'h' &&\n    value[1] === 't' &&\n    value[2] === 't' &&\n    value[3] === 'p' &&\n    (\n      value[4] === ':' ||\n      (\n        value[4] === 's' &&\n        value[5] === ':'\n      )\n    )\n  )\n}\n\nfunction parseURL (url) {\n  if (typeof url === 'string') {\n    url = new URL(url)\n\n    if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n      throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n    }\n\n    return url\n  }\n\n  if (!url || typeof url !== 'object') {\n    throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')\n  }\n\n  if (!(url instanceof URL)) {\n    if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {\n      throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')\n    }\n\n    if (url.path != null && typeof url.path !== 'string') {\n      throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')\n    }\n\n    if (url.pathname != null && typeof url.pathname !== 'string') {\n      throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')\n    }\n\n    if (url.hostname != null && typeof url.hostname !== 'string') {\n      throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')\n    }\n\n    if (url.origin != null && typeof url.origin !== 'string') {\n      throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')\n    }\n\n    if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n      throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n    }\n\n    const port = url.port != null\n      ? url.port\n      : (url.protocol === 'https:' ? 443 : 80)\n    let origin = url.origin != null\n      ? url.origin\n      : `${url.protocol || ''}//${url.hostname || ''}:${port}`\n    let path = url.path != null\n      ? url.path\n      : `${url.pathname || ''}${url.search || ''}`\n\n    if (origin[origin.length - 1] === '/') {\n      origin = origin.slice(0, origin.length - 1)\n    }\n\n    if (path && path[0] !== '/') {\n      path = `/${path}`\n    }\n    // new URL(path, origin) is unsafe when `path` contains an absolute URL\n    // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:\n    // If first parameter is a relative URL, second param is required, and will be used as the base URL.\n    // If first parameter is an absolute URL, a given second param will be ignored.\n    return new URL(`${origin}${path}`)\n  }\n\n  if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n    throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n  }\n\n  return url\n}\n\nfunction parseOrigin (url) {\n  url = parseURL(url)\n\n  if (url.pathname !== '/' || url.search || url.hash) {\n    throw new InvalidArgumentError('invalid url')\n  }\n\n  return url\n}\n\nfunction getHostname (host) {\n  if (host[0] === '[') {\n    const idx = host.indexOf(']')\n\n    assert(idx !== -1)\n    return host.substring(1, idx)\n  }\n\n  const idx = host.indexOf(':')\n  if (idx === -1) return host\n\n  return host.substring(0, idx)\n}\n\n// IP addresses are not valid server names per RFC6066\n// > Currently, the only server names supported are DNS hostnames\nfunction getServerName (host) {\n  if (!host) {\n    return null\n  }\n\n  assert(typeof host === 'string')\n\n  const servername = getHostname(host)\n  if (net.isIP(servername)) {\n    return ''\n  }\n\n  return servername\n}\n\nfunction deepClone (obj) {\n  return JSON.parse(JSON.stringify(obj))\n}\n\nfunction isAsyncIterable (obj) {\n  return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')\n}\n\nfunction isIterable (obj) {\n  return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))\n}\n\nfunction bodyLength (body) {\n  if (body == null) {\n    return 0\n  } else if (isStream(body)) {\n    const state = body._readableState\n    return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)\n      ? state.length\n      : null\n  } else if (isBlobLike(body)) {\n    return body.size != null ? body.size : null\n  } else if (isBuffer(body)) {\n    return body.byteLength\n  }\n\n  return null\n}\n\nfunction isDestroyed (body) {\n  return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))\n}\n\nfunction destroy (stream, err) {\n  if (stream == null || !isStream(stream) || isDestroyed(stream)) {\n    return\n  }\n\n  if (typeof stream.destroy === 'function') {\n    if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {\n      // See: https://github.com/nodejs/node/pull/38505/files\n      stream.socket = null\n    }\n\n    stream.destroy(err)\n  } else if (err) {\n    queueMicrotask(() => {\n      stream.emit('error', err)\n    })\n  }\n\n  if (stream.destroyed !== true) {\n    stream[kDestroyed] = true\n  }\n}\n\nconst KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/\nfunction parseKeepAliveTimeout (val) {\n  const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)\n  return m ? parseInt(m[1], 10) * 1000 : null\n}\n\n/**\n * Retrieves a header name and returns its lowercase value.\n * @param {string | Buffer} value Header name\n * @returns {string}\n */\nfunction headerNameToString (value) {\n  return typeof value === 'string'\n    ? headerNameLowerCasedRecord[value] ?? value.toLowerCase()\n    : tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * Receive the buffer as a string and return its lowercase value.\n * @param {Buffer} value Header name\n * @returns {string}\n */\nfunction bufferToLowerCasedHeaderName (value) {\n  return tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers\n * @param {Record} [obj]\n * @returns {Record}\n */\nfunction parseHeaders (headers, obj) {\n  if (obj === undefined) obj = {}\n  for (let i = 0; i < headers.length; i += 2) {\n    const key = headerNameToString(headers[i])\n    let val = obj[key]\n\n    if (val) {\n      if (typeof val === 'string') {\n        val = [val]\n        obj[key] = val\n      }\n      val.push(headers[i + 1].toString('utf8'))\n    } else {\n      const headersValue = headers[i + 1]\n      if (typeof headersValue === 'string') {\n        obj[key] = headersValue\n      } else {\n        obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')\n      }\n    }\n  }\n\n  // See https://github.com/nodejs/node/pull/46528\n  if ('content-length' in obj && 'content-disposition' in obj) {\n    obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')\n  }\n\n  return obj\n}\n\nfunction parseRawHeaders (headers) {\n  const len = headers.length\n  const ret = new Array(len)\n\n  let hasContentLength = false\n  let contentDispositionIdx = -1\n  let key\n  let val\n  let kLen = 0\n\n  for (let n = 0; n < headers.length; n += 2) {\n    key = headers[n]\n    val = headers[n + 1]\n\n    typeof key !== 'string' && (key = key.toString())\n    typeof val !== 'string' && (val = val.toString('utf8'))\n\n    kLen = key.length\n    if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {\n      hasContentLength = true\n    } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {\n      contentDispositionIdx = n + 1\n    }\n    ret[n] = key\n    ret[n + 1] = val\n  }\n\n  // See https://github.com/nodejs/node/pull/46528\n  if (hasContentLength && contentDispositionIdx !== -1) {\n    ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')\n  }\n\n  return ret\n}\n\nfunction isBuffer (buffer) {\n  // See, https://github.com/mcollina/undici/pull/319\n  return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)\n}\n\nfunction validateHandler (handler, method, upgrade) {\n  if (!handler || typeof handler !== 'object') {\n    throw new InvalidArgumentError('handler must be an object')\n  }\n\n  if (typeof handler.onConnect !== 'function') {\n    throw new InvalidArgumentError('invalid onConnect method')\n  }\n\n  if (typeof handler.onError !== 'function') {\n    throw new InvalidArgumentError('invalid onError method')\n  }\n\n  if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {\n    throw new InvalidArgumentError('invalid onBodySent method')\n  }\n\n  if (upgrade || method === 'CONNECT') {\n    if (typeof handler.onUpgrade !== 'function') {\n      throw new InvalidArgumentError('invalid onUpgrade method')\n    }\n  } else {\n    if (typeof handler.onHeaders !== 'function') {\n      throw new InvalidArgumentError('invalid onHeaders method')\n    }\n\n    if (typeof handler.onData !== 'function') {\n      throw new InvalidArgumentError('invalid onData method')\n    }\n\n    if (typeof handler.onComplete !== 'function') {\n      throw new InvalidArgumentError('invalid onComplete method')\n    }\n  }\n}\n\n// A body is disturbed if it has been read from and it cannot\n// be re-used without losing state or data.\nfunction isDisturbed (body) {\n  // TODO (fix): Why is body[kBodyUsed] needed?\n  return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))\n}\n\nfunction isErrored (body) {\n  return !!(body && stream.isErrored(body))\n}\n\nfunction isReadable (body) {\n  return !!(body && stream.isReadable(body))\n}\n\nfunction getSocketInfo (socket) {\n  return {\n    localAddress: socket.localAddress,\n    localPort: socket.localPort,\n    remoteAddress: socket.remoteAddress,\n    remotePort: socket.remotePort,\n    remoteFamily: socket.remoteFamily,\n    timeout: socket.timeout,\n    bytesWritten: socket.bytesWritten,\n    bytesRead: socket.bytesRead\n  }\n}\n\n/** @type {globalThis['ReadableStream']} */\nfunction ReadableStreamFrom (iterable) {\n  // We cannot use ReadableStream.from here because it does not return a byte stream.\n\n  let iterator\n  return new ReadableStream(\n    {\n      async start () {\n        iterator = iterable[Symbol.asyncIterator]()\n      },\n      async pull (controller) {\n        const { done, value } = await iterator.next()\n        if (done) {\n          queueMicrotask(() => {\n            controller.close()\n            controller.byobRequest?.respond(0)\n          })\n        } else {\n          const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)\n          if (buf.byteLength) {\n            controller.enqueue(new Uint8Array(buf))\n          }\n        }\n        return controller.desiredSize > 0\n      },\n      async cancel (reason) {\n        await iterator.return()\n      },\n      type: 'bytes'\n    }\n  )\n}\n\n// The chunk should be a FormData instance and contains\n// all the required methods.\nfunction isFormDataLike (object) {\n  return (\n    object &&\n    typeof object === 'object' &&\n    typeof object.append === 'function' &&\n    typeof object.delete === 'function' &&\n    typeof object.get === 'function' &&\n    typeof object.getAll === 'function' &&\n    typeof object.has === 'function' &&\n    typeof object.set === 'function' &&\n    object[Symbol.toStringTag] === 'FormData'\n  )\n}\n\nfunction addAbortListener (signal, listener) {\n  if ('addEventListener' in signal) {\n    signal.addEventListener('abort', listener, { once: true })\n    return () => signal.removeEventListener('abort', listener)\n  }\n  signal.addListener('abort', listener)\n  return () => signal.removeListener('abort', listener)\n}\n\nconst hasToWellFormed = typeof String.prototype.toWellFormed === 'function'\nconst hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'\n\n/**\n * @param {string} val\n */\nfunction toUSVString (val) {\n  return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)\n}\n\n/**\n * @param {string} val\n */\n// TODO: move this to webidl\nfunction isUSVString (val) {\n  return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`\n}\n\n/**\n * @see https://tools.ietf.org/html/rfc7230#section-3.2.6\n * @param {number} c\n */\nfunction isTokenCharCode (c) {\n  switch (c) {\n    case 0x22:\n    case 0x28:\n    case 0x29:\n    case 0x2c:\n    case 0x2f:\n    case 0x3a:\n    case 0x3b:\n    case 0x3c:\n    case 0x3d:\n    case 0x3e:\n    case 0x3f:\n    case 0x40:\n    case 0x5b:\n    case 0x5c:\n    case 0x5d:\n    case 0x7b:\n    case 0x7d:\n      // DQUOTE and \"(),/:;<=>?@[\\]{}\"\n      return false\n    default:\n      // VCHAR %x21-7E\n      return c >= 0x21 && c <= 0x7e\n  }\n}\n\n/**\n * @param {string} characters\n */\nfunction isValidHTTPToken (characters) {\n  if (characters.length === 0) {\n    return false\n  }\n  for (let i = 0; i < characters.length; ++i) {\n    if (!isTokenCharCode(characters.charCodeAt(i))) {\n      return false\n    }\n  }\n  return true\n}\n\n// headerCharRegex have been lifted from\n// https://github.com/nodejs/node/blob/main/lib/_http_common.js\n\n/**\n * Matches if val contains an invalid field-vchar\n *  field-value    = *( field-content / obs-fold )\n *  field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n *  field-vchar    = VCHAR / obs-text\n */\nconst headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/\n\n/**\n * @param {string} characters\n */\nfunction isValidHeaderValue (characters) {\n  return !headerCharRegex.test(characters)\n}\n\n// Parsed accordingly to RFC 9110\n// https://www.rfc-editor.org/rfc/rfc9110#field.content-range\nfunction parseRangeHeader (range) {\n  if (range == null || range === '') return { start: 0, end: null, size: null }\n\n  const m = range ? range.match(/^bytes (\\d+)-(\\d+)\\/(\\d+)?$/) : null\n  return m\n    ? {\n        start: parseInt(m[1]),\n        end: m[2] ? parseInt(m[2]) : null,\n        size: m[3] ? parseInt(m[3]) : null\n      }\n    : null\n}\n\nfunction addListener (obj, name, listener) {\n  const listeners = (obj[kListeners] ??= [])\n  listeners.push([name, listener])\n  obj.on(name, listener)\n  return obj\n}\n\nfunction removeAllListeners (obj) {\n  for (const [name, listener] of obj[kListeners] ?? []) {\n    obj.removeListener(name, listener)\n  }\n  obj[kListeners] = null\n}\n\nfunction errorRequest (client, request, err) {\n  try {\n    request.onError(err)\n    assert(request.aborted)\n  } catch (err) {\n    client.emit('error', err)\n  }\n}\n\nconst kEnumerableProperty = Object.create(null)\nkEnumerableProperty.enumerable = true\n\nconst normalizedMethodRecordsBase = {\n  delete: 'DELETE',\n  DELETE: 'DELETE',\n  get: 'GET',\n  GET: 'GET',\n  head: 'HEAD',\n  HEAD: 'HEAD',\n  options: 'OPTIONS',\n  OPTIONS: 'OPTIONS',\n  post: 'POST',\n  POST: 'POST',\n  put: 'PUT',\n  PUT: 'PUT'\n}\n\nconst normalizedMethodRecords = {\n  ...normalizedMethodRecordsBase,\n  patch: 'patch',\n  PATCH: 'PATCH'\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(normalizedMethodRecordsBase, null)\nObject.setPrototypeOf(normalizedMethodRecords, null)\n\nmodule.exports = {\n  kEnumerableProperty,\n  nop,\n  isDisturbed,\n  isErrored,\n  isReadable,\n  toUSVString,\n  isUSVString,\n  isBlobLike,\n  parseOrigin,\n  parseURL,\n  getServerName,\n  isStream,\n  isIterable,\n  isAsyncIterable,\n  isDestroyed,\n  headerNameToString,\n  bufferToLowerCasedHeaderName,\n  addListener,\n  removeAllListeners,\n  errorRequest,\n  parseRawHeaders,\n  parseHeaders,\n  parseKeepAliveTimeout,\n  destroy,\n  bodyLength,\n  deepClone,\n  ReadableStreamFrom,\n  isBuffer,\n  validateHandler,\n  getSocketInfo,\n  isFormDataLike,\n  buildURL,\n  addAbortListener,\n  isValidHTTPToken,\n  isValidHeaderValue,\n  isTokenCharCode,\n  parseRangeHeader,\n  normalizedMethodRecordsBase,\n  normalizedMethodRecords,\n  isValidPort,\n  isHttpOrHttpsPrefixed,\n  nodeMajor,\n  nodeMinor,\n  safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],\n  wrapRequestBody\n}\n","'use strict'\n\nconst { InvalidArgumentError } = require('../core/errors')\nconst { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst DispatcherBase = require('./dispatcher-base')\nconst Pool = require('./pool')\nconst Client = require('./client')\nconst util = require('../core/util')\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor')\n\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kMaxRedirections = Symbol('maxRedirections')\nconst kOnDrain = Symbol('onDrain')\nconst kFactory = Symbol('factory')\nconst kOptions = Symbol('options')\n\nfunction defaultFactory (origin, opts) {\n  return opts && opts.connections === 1\n    ? new Client(origin, opts)\n    : new Pool(origin, opts)\n}\n\nclass Agent extends DispatcherBase {\n  constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    super(options)\n\n    if (connect && typeof connect !== 'function') {\n      connect = { ...connect }\n    }\n\n    this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)\n      ? options.interceptors.Agent\n      : [createRedirectInterceptor({ maxRedirections })]\n\n    this[kOptions] = { ...util.deepClone(options), connect }\n    this[kOptions].interceptors = options.interceptors\n      ? { ...options.interceptors }\n      : undefined\n    this[kMaxRedirections] = maxRedirections\n    this[kFactory] = factory\n    this[kClients] = new Map()\n\n    this[kOnDrain] = (origin, targets) => {\n      this.emit('drain', origin, [this, ...targets])\n    }\n\n    this[kOnConnect] = (origin, targets) => {\n      this.emit('connect', origin, [this, ...targets])\n    }\n\n    this[kOnDisconnect] = (origin, targets, err) => {\n      this.emit('disconnect', origin, [this, ...targets], err)\n    }\n\n    this[kOnConnectionError] = (origin, targets, err) => {\n      this.emit('connectionError', origin, [this, ...targets], err)\n    }\n  }\n\n  get [kRunning] () {\n    let ret = 0\n    for (const client of this[kClients].values()) {\n      ret += client[kRunning]\n    }\n    return ret\n  }\n\n  [kDispatch] (opts, handler) {\n    let key\n    if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {\n      key = String(opts.origin)\n    } else {\n      throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')\n    }\n\n    let dispatcher = this[kClients].get(key)\n\n    if (!dispatcher) {\n      dispatcher = this[kFactory](opts.origin, this[kOptions])\n        .on('drain', this[kOnDrain])\n        .on('connect', this[kOnConnect])\n        .on('disconnect', this[kOnDisconnect])\n        .on('connectionError', this[kOnConnectionError])\n\n      // This introduces a tiny memory leak, as dispatchers are never removed from the map.\n      // TODO(mcollina): remove te timer when the client/pool do not have any more\n      // active connections.\n      this[kClients].set(key, dispatcher)\n    }\n\n    return dispatcher.dispatch(opts, handler)\n  }\n\n  async [kClose] () {\n    const closePromises = []\n    for (const client of this[kClients].values()) {\n      closePromises.push(client.close())\n    }\n    this[kClients].clear()\n\n    await Promise.all(closePromises)\n  }\n\n  async [kDestroy] (err) {\n    const destroyPromises = []\n    for (const client of this[kClients].values()) {\n      destroyPromises.push(client.destroy(err))\n    }\n    this[kClients].clear()\n\n    await Promise.all(destroyPromises)\n  }\n}\n\nmodule.exports = Agent\n","'use strict'\n\nconst {\n  BalancedPoolMissingUpstreamError,\n  InvalidArgumentError\n} = require('../core/errors')\nconst {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kRemoveClient,\n  kGetDispatcher\n} = require('./pool-base')\nconst Pool = require('./pool')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst { parseOrigin } = require('../core/util')\nconst kFactory = Symbol('factory')\n\nconst kOptions = Symbol('options')\nconst kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')\nconst kCurrentWeight = Symbol('kCurrentWeight')\nconst kIndex = Symbol('kIndex')\nconst kWeight = Symbol('kWeight')\nconst kMaxWeightPerServer = Symbol('kMaxWeightPerServer')\nconst kErrorPenalty = Symbol('kErrorPenalty')\n\n/**\n * Calculate the greatest common divisor of two numbers by\n * using the Euclidean algorithm.\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction getGreatestCommonDivisor (a, b) {\n  if (a === 0) return b\n\n  while (b !== 0) {\n    const t = b\n    b = a % b\n    a = t\n  }\n  return a\n}\n\nfunction defaultFactory (origin, opts) {\n  return new Pool(origin, opts)\n}\n\nclass BalancedPool extends PoolBase {\n  constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {\n    super()\n\n    this[kOptions] = opts\n    this[kIndex] = -1\n    this[kCurrentWeight] = 0\n\n    this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100\n    this[kErrorPenalty] = this[kOptions].errorPenalty || 15\n\n    if (!Array.isArray(upstreams)) {\n      upstreams = [upstreams]\n    }\n\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)\n      ? opts.interceptors.BalancedPool\n      : []\n    this[kFactory] = factory\n\n    for (const upstream of upstreams) {\n      this.addUpstream(upstream)\n    }\n    this._updateBalancedPoolStats()\n  }\n\n  addUpstream (upstream) {\n    const upstreamOrigin = parseOrigin(upstream).origin\n\n    if (this[kClients].find((pool) => (\n      pool[kUrl].origin === upstreamOrigin &&\n      pool.closed !== true &&\n      pool.destroyed !== true\n    ))) {\n      return this\n    }\n    const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))\n\n    this[kAddClient](pool)\n    pool.on('connect', () => {\n      pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])\n    })\n\n    pool.on('connectionError', () => {\n      pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n      this._updateBalancedPoolStats()\n    })\n\n    pool.on('disconnect', (...args) => {\n      const err = args[2]\n      if (err && err.code === 'UND_ERR_SOCKET') {\n        // decrease the weight of the pool.\n        pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n        this._updateBalancedPoolStats()\n      }\n    })\n\n    for (const client of this[kClients]) {\n      client[kWeight] = this[kMaxWeightPerServer]\n    }\n\n    this._updateBalancedPoolStats()\n\n    return this\n  }\n\n  _updateBalancedPoolStats () {\n    let result = 0\n    for (let i = 0; i < this[kClients].length; i++) {\n      result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)\n    }\n\n    this[kGreatestCommonDivisor] = result\n  }\n\n  removeUpstream (upstream) {\n    const upstreamOrigin = parseOrigin(upstream).origin\n\n    const pool = this[kClients].find((pool) => (\n      pool[kUrl].origin === upstreamOrigin &&\n      pool.closed !== true &&\n      pool.destroyed !== true\n    ))\n\n    if (pool) {\n      this[kRemoveClient](pool)\n    }\n\n    return this\n  }\n\n  get upstreams () {\n    return this[kClients]\n      .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)\n      .map((p) => p[kUrl].origin)\n  }\n\n  [kGetDispatcher] () {\n    // We validate that pools is greater than 0,\n    // otherwise we would have to wait until an upstream\n    // is added, which might never happen.\n    if (this[kClients].length === 0) {\n      throw new BalancedPoolMissingUpstreamError()\n    }\n\n    const dispatcher = this[kClients].find(dispatcher => (\n      !dispatcher[kNeedDrain] &&\n      dispatcher.closed !== true &&\n      dispatcher.destroyed !== true\n    ))\n\n    if (!dispatcher) {\n      return\n    }\n\n    const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)\n\n    if (allClientsBusy) {\n      return\n    }\n\n    let counter = 0\n\n    let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])\n\n    while (counter++ < this[kClients].length) {\n      this[kIndex] = (this[kIndex] + 1) % this[kClients].length\n      const pool = this[kClients][this[kIndex]]\n\n      // find pool index with the largest weight\n      if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {\n        maxWeightIndex = this[kIndex]\n      }\n\n      // decrease the current weight every `this[kClients].length`.\n      if (this[kIndex] === 0) {\n        // Set the current weight to the next lower weight.\n        this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]\n\n        if (this[kCurrentWeight] <= 0) {\n          this[kCurrentWeight] = this[kMaxWeightPerServer]\n        }\n      }\n      if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {\n        return pool\n      }\n    }\n\n    this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]\n    this[kIndex] = maxWeightIndex\n    return this[kClients][maxWeightIndex]\n  }\n}\n\nmodule.exports = BalancedPool\n","'use strict'\n\n/* global WebAssembly */\n\nconst assert = require('node:assert')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst timers = require('../util/timers.js')\nconst {\n  RequestContentLengthMismatchError,\n  ResponseContentLengthMismatchError,\n  RequestAbortedError,\n  HeadersTimeoutError,\n  HeadersOverflowError,\n  SocketError,\n  InformationalError,\n  BodyTimeoutError,\n  HTTPParserError,\n  ResponseExceededMaxSizeError\n} = require('../core/errors.js')\nconst {\n  kUrl,\n  kReset,\n  kClient,\n  kParser,\n  kBlocking,\n  kRunning,\n  kPending,\n  kSize,\n  kWriting,\n  kQueue,\n  kNoRef,\n  kKeepAliveDefaultTimeout,\n  kHostHeader,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kPipelining,\n  kSocket,\n  kKeepAliveTimeoutValue,\n  kMaxHeadersSize,\n  kKeepAliveMaxTimeout,\n  kKeepAliveTimeoutThreshold,\n  kHeadersTimeout,\n  kBodyTimeout,\n  kStrictContentLength,\n  kMaxRequests,\n  kCounter,\n  kMaxResponseSize,\n  kOnError,\n  kResume,\n  kHTTPContext\n} = require('../core/symbols.js')\n\nconst constants = require('../llhttp/constants.js')\nconst EMPTY_BUF = Buffer.alloc(0)\nconst FastBuffer = Buffer[Symbol.species]\nconst addListener = util.addListener\nconst removeAllListeners = util.removeAllListeners\nconst kIdleSocketValidation = Symbol('kIdleSocketValidation')\nconst kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout')\nconst kSocketUsed = Symbol('kSocketUsed')\n\nlet extractBody\n\nasync function lazyllhttp () {\n  const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined\n\n  let mod\n  try {\n    mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js'))\n  } catch (e) {\n    /* istanbul ignore next */\n\n    // We could check if the error was caused by the simd option not\n    // being enabled, but the occurring of this other error\n    // * https://github.com/emscripten-core/emscripten/issues/11495\n    // got me to remove that check to avoid breaking Node 12.\n    mod = await WebAssembly.compile(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))\n  }\n\n  return await WebAssembly.instantiate(mod, {\n    env: {\n      /* eslint-disable camelcase */\n\n      wasm_on_url: (p, at, len) => {\n        /* istanbul ignore next */\n        return 0\n      },\n      wasm_on_status: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_message_begin: (p) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onMessageBegin() || 0\n      },\n      wasm_on_header_field: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_header_value: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0\n      },\n      wasm_on_body: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_message_complete: (p) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onMessageComplete() || 0\n      }\n\n      /* eslint-enable camelcase */\n    }\n  })\n}\n\nlet llhttpInstance = null\nlet llhttpPromise = lazyllhttp()\nllhttpPromise.catch()\n\nlet currentParser = null\nlet currentBufferRef = null\nlet currentBufferSize = 0\nlet currentBufferPtr = null\n\nconst USE_NATIVE_TIMER = 0\nconst USE_FAST_TIMER = 1\n\n// Use fast timers for headers and body to take eventual event loop\n// latency into account.\nconst TIMEOUT_HEADERS = 2 | USE_FAST_TIMER\nconst TIMEOUT_BODY = 4 | USE_FAST_TIMER\n\n// Use native timers to ignore event loop latency for keep-alive\n// handling.\nconst TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER\n\nclass Parser {\n  constructor (client, socket, { exports }) {\n    assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)\n\n    this.llhttp = exports\n    this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)\n    this.client = client\n    this.socket = socket\n    this.timeout = null\n    this.timeoutValue = null\n    this.timeoutType = null\n    this.statusCode = null\n    this.statusText = ''\n    this.upgrade = false\n    this.headers = []\n    this.headersSize = 0\n    this.headersMaxSize = client[kMaxHeadersSize]\n    this.shouldKeepAlive = false\n    this.paused = false\n    this.resume = this.resume.bind(this)\n\n    this.bytesRead = 0\n\n    this.keepAlive = ''\n    this.contentLength = ''\n    this.connection = ''\n    this.maxResponseSize = client[kMaxResponseSize]\n  }\n\n  setTimeout (delay, type) {\n    // If the existing timer and the new timer are of different timer type\n    // (fast or native) or have different delay, we need to clear the existing\n    // timer and set a new one.\n    if (\n      delay !== this.timeoutValue ||\n      (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)\n    ) {\n      // If a timeout is already set, clear it with clearTimeout of the fast\n      // timer implementation, as it can clear fast and native timers.\n      if (this.timeout) {\n        timers.clearTimeout(this.timeout)\n        this.timeout = null\n      }\n\n      if (delay) {\n        if (type & USE_FAST_TIMER) {\n          this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this))\n        } else {\n          this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this))\n          this.timeout.unref()\n        }\n      }\n\n      this.timeoutValue = delay\n    } else if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    this.timeoutType = type\n  }\n\n  resume () {\n    if (this.socket.destroyed || !this.paused) {\n      return\n    }\n\n    assert(this.ptr != null)\n    assert(currentParser == null)\n\n    this.llhttp.llhttp_resume(this.ptr)\n\n    assert(this.timeoutType === TIMEOUT_BODY)\n    if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    this.paused = false\n    this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.\n    this.readMore()\n  }\n\n  readMore () {\n    while (!this.paused && this.ptr) {\n      const chunk = this.socket.read()\n      if (chunk === null) {\n        break\n      }\n      this.execute(chunk)\n    }\n  }\n\n  execute (data) {\n    assert(this.ptr != null)\n    assert(currentParser == null)\n    assert(!this.paused)\n\n    const { socket, llhttp } = this\n\n    if (data.length > currentBufferSize) {\n      if (currentBufferPtr) {\n        llhttp.free(currentBufferPtr)\n      }\n      currentBufferSize = Math.ceil(data.length / 4096) * 4096\n      currentBufferPtr = llhttp.malloc(currentBufferSize)\n    }\n\n    new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)\n\n    // Call `execute` on the wasm parser.\n    // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,\n    // and finally the length of bytes to parse.\n    // The return value is an error code or `constants.ERROR.OK`.\n    try {\n      let ret\n\n      try {\n        currentBufferRef = data\n        currentParser = this\n        ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)\n        /* eslint-disable-next-line no-useless-catch */\n      } catch (err) {\n        /* istanbul ignore next: difficult to make a test case for */\n        throw err\n      } finally {\n        currentParser = null\n        currentBufferRef = null\n      }\n\n      const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr\n\n      if (ret !== constants.ERROR.OK) {\n        const body = data.subarray(offset)\n\n        if (ret === constants.ERROR.PAUSED_UPGRADE) {\n          this.onUpgrade(body)\n        } else if (ret === constants.ERROR.PAUSED) {\n          this.paused = true\n          socket.unshift(body)\n        } else {\n          throw this.createError(ret, body)\n        }\n      }\n    } catch (err) {\n      util.destroy(socket, err)\n    }\n  }\n\n  finish () {\n    assert(currentParser === null)\n    assert(this.ptr != null)\n    assert(!this.paused)\n\n    const { llhttp } = this\n\n    let ret\n\n    try {\n      currentParser = this\n      ret = llhttp.llhttp_finish(this.ptr)\n    } finally {\n      currentParser = null\n    }\n\n    if (ret === constants.ERROR.OK) {\n      return null\n    }\n\n    if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {\n      this.paused = true\n      return null\n    }\n\n    return this.createError(ret, EMPTY_BUF)\n  }\n\n  createError (ret, data) {\n    const { llhttp, contentLength, bytesRead } = this\n\n    if (contentLength && bytesRead !== parseInt(contentLength, 10)) {\n      return new ResponseContentLengthMismatchError()\n    }\n\n    const ptr = llhttp.llhttp_get_error_reason(this.ptr)\n    let message = ''\n    if (ptr) {\n      const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)\n      message =\n        'Response does not match the HTTP/1.1 protocol (' +\n        Buffer.from(llhttp.memory.buffer, ptr, len).toString() +\n        ')'\n    }\n\n    return new HTTPParserError(message, constants.ERROR[ret], data)\n  }\n\n  destroy () {\n    assert(this.ptr != null)\n    assert(currentParser == null)\n\n    this.llhttp.llhttp_free(this.ptr)\n    this.ptr = null\n\n    this.timeout && timers.clearTimeout(this.timeout)\n    this.timeout = null\n    this.timeoutValue = null\n    this.timeoutType = null\n\n    this.paused = false\n  }\n\n  onStatus (buf) {\n    this.statusText = buf.toString()\n  }\n\n  onMessageBegin () {\n    const { socket, client } = this\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (socket.destroyed) {\n      return -1\n    }\n\n    if (client[kRunning] === 0) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n    if (!request) {\n      return -1\n    }\n    request.onResponseStarted()\n  }\n\n  onHeaderField (buf) {\n    const len = this.headers.length\n\n    if ((len & 1) === 0) {\n      this.headers.push(buf)\n    } else {\n      this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n    }\n\n    this.trackHeader(buf.length)\n  }\n\n  onHeaderValue (buf) {\n    let len = this.headers.length\n\n    if ((len & 1) === 1) {\n      this.headers.push(buf)\n      len += 1\n    } else {\n      this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n    }\n\n    const key = this.headers[len - 2]\n    if (key.length === 10) {\n      const headerName = util.bufferToLowerCasedHeaderName(key)\n      if (headerName === 'keep-alive') {\n        this.keepAlive += buf.toString()\n      } else if (headerName === 'connection') {\n        this.connection += buf.toString()\n      }\n    } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {\n      this.contentLength += buf.toString()\n    }\n\n    this.trackHeader(buf.length)\n  }\n\n  trackHeader (len) {\n    this.headersSize += len\n    if (this.headersSize >= this.headersMaxSize) {\n      util.destroy(this.socket, new HeadersOverflowError())\n    }\n  }\n\n  onUpgrade (head) {\n    const { upgrade, client, socket, headers, statusCode } = this\n\n    assert(upgrade)\n    assert(client[kSocket] === socket)\n    assert(!socket.destroyed)\n    assert(!this.paused)\n    assert((headers.length & 1) === 0)\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n    assert(request.upgrade || request.method === 'CONNECT')\n\n    this.statusCode = null\n    this.statusText = ''\n    this.shouldKeepAlive = null\n\n    this.headers = []\n    this.headersSize = 0\n\n    socket.unshift(head)\n\n    socket[kParser].destroy()\n    socket[kParser] = null\n\n    socket[kClient] = null\n    socket[kError] = null\n\n    removeAllListeners(socket)\n\n    client[kSocket] = null\n    client[kHTTPContext] = null // TODO (fix): This is hacky...\n    client[kQueue][client[kRunningIdx]++] = null\n    client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))\n\n    try {\n      request.onUpgrade(statusCode, headers, socket)\n    } catch (err) {\n      util.destroy(socket, err)\n    }\n\n    client[kResume]()\n  }\n\n  onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {\n    const { client, socket, headers, statusText } = this\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (socket.destroyed) {\n      return -1\n    }\n\n    if (client[kRunning] === 0) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (!request) {\n      return -1\n    }\n\n    assert(!this.upgrade)\n    assert(this.statusCode < 200)\n\n    if (statusCode === 100) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    /* this can only happen if server is misbehaving */\n    if (upgrade && !request.upgrade) {\n      util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    assert(this.timeoutType === TIMEOUT_HEADERS)\n\n    this.statusCode = statusCode\n    this.shouldKeepAlive = (\n      shouldKeepAlive ||\n      // Override llhttp value which does not allow keepAlive for HEAD.\n      (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')\n    )\n\n    if (this.statusCode >= 200) {\n      const bodyTimeout = request.bodyTimeout != null\n        ? request.bodyTimeout\n        : client[kBodyTimeout]\n      this.setTimeout(bodyTimeout, TIMEOUT_BODY)\n    } else if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    if (request.method === 'CONNECT') {\n      assert(client[kRunning] === 1)\n      this.upgrade = true\n      return 2\n    }\n\n    if (upgrade) {\n      assert(client[kRunning] === 1)\n      this.upgrade = true\n      return 2\n    }\n\n    assert((this.headers.length & 1) === 0)\n    this.headers = []\n    this.headersSize = 0\n\n    if (this.shouldKeepAlive && client[kPipelining]) {\n      const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null\n\n      if (keepAliveTimeout != null) {\n        const timeout = Math.min(\n          keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n          client[kKeepAliveMaxTimeout]\n        )\n        if (timeout <= 0) {\n          socket[kReset] = true\n        } else {\n          client[kKeepAliveTimeoutValue] = timeout\n        }\n      } else {\n        client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]\n      }\n    } else {\n      // Stop more requests from being dispatched.\n      socket[kReset] = true\n    }\n\n    const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false\n\n    if (request.aborted) {\n      return -1\n    }\n\n    if (request.method === 'HEAD') {\n      return 1\n    }\n\n    if (statusCode < 200) {\n      return 1\n    }\n\n    if (socket[kBlocking]) {\n      socket[kBlocking] = false\n      client[kResume]()\n    }\n\n    return pause ? constants.ERROR.PAUSED : 0\n  }\n\n  onBody (buf) {\n    const { client, socket, statusCode, maxResponseSize } = this\n\n    if (socket.destroyed) {\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n\n    assert(this.timeoutType === TIMEOUT_BODY)\n    if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    assert(statusCode >= 200)\n\n    if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n      util.destroy(socket, new ResponseExceededMaxSizeError())\n      return -1\n    }\n\n    this.bytesRead += buf.length\n\n    if (request.onData(buf) === false) {\n      return constants.ERROR.PAUSED\n    }\n  }\n\n  onMessageComplete () {\n    const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this\n\n    if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n      return -1\n    }\n\n    if (upgrade) {\n      return\n    }\n\n    assert(statusCode >= 100)\n    assert((this.headers.length & 1) === 0)\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n\n    this.statusCode = null\n    this.statusText = ''\n    this.bytesRead = 0\n    this.contentLength = ''\n    this.keepAlive = ''\n    this.connection = ''\n\n    this.headers = []\n    this.headersSize = 0\n\n    if (statusCode < 200) {\n      return\n    }\n\n    /* istanbul ignore next: should be handled by llhttp? */\n    if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n      util.destroy(socket, new ResponseContentLengthMismatchError())\n      return -1\n    }\n\n    request.onComplete(headers)\n\n    client[kQueue][client[kRunningIdx]++] = null\n    socket[kSocketUsed] = true\n\n    if (socket[kWriting]) {\n      assert(client[kRunning] === 0)\n      // Response completed before request.\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (!shouldKeepAlive) {\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (socket[kReset] && client[kRunning] === 0) {\n      // Destroy socket once all requests have completed.\n      // The request at the tail of the pipeline is the one\n      // that requested reset and no further requests should\n      // have been queued since then.\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (client[kPipelining] == null || client[kPipelining] === 1) {\n      // We must wait a full event loop cycle to reuse this socket to make sure\n      // that non-spec compliant servers are not closing the connection even if they\n      // said they won't.\n      setImmediate(() => client[kResume]())\n    } else {\n      client[kResume]()\n    }\n  }\n}\n\nfunction onParserTimeout (parser) {\n  const { socket, timeoutType, client, paused } = parser.deref()\n\n  /* istanbul ignore else */\n  if (timeoutType === TIMEOUT_HEADERS) {\n    if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n      assert(!paused, 'cannot be paused while waiting for headers')\n      util.destroy(socket, new HeadersTimeoutError())\n    }\n  } else if (timeoutType === TIMEOUT_BODY) {\n    if (!paused) {\n      util.destroy(socket, new BodyTimeoutError())\n    }\n  } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {\n    assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])\n    util.destroy(socket, new InformationalError('socket idle timeout'))\n  }\n}\n\nasync function connectH1 (client, socket) {\n  client[kSocket] = socket\n\n  if (!llhttpInstance) {\n    llhttpInstance = await llhttpPromise\n    llhttpPromise = null\n  }\n\n  socket[kNoRef] = false\n  socket[kWriting] = false\n  socket[kReset] = false\n  socket[kBlocking] = false\n  socket[kIdleSocketValidation] = 0\n  socket[kIdleSocketValidationTimeout] = null\n  socket[kSocketUsed] = false\n  socket[kParser] = new Parser(client, socket, llhttpInstance)\n\n  addListener(socket, 'error', function (err) {\n    assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n    const parser = this[kParser]\n\n    // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded\n    // to the user.\n    if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {\n      const parserErr = parser.finish()\n      if (parserErr) {\n        this[kError] = parserErr\n        this[kClient][kOnError](parserErr)\n      }\n      return\n    }\n\n    this[kError] = err\n\n    this[kClient][kOnError](err)\n  })\n  addListener(socket, 'readable', function () {\n    const parser = this[kParser]\n\n    if (parser) {\n      parser.readMore()\n    }\n  })\n  addListener(socket, 'end', function () {\n    const parser = this[kParser]\n\n    if (parser.statusCode && !parser.shouldKeepAlive) {\n      const parserErr = parser.finish()\n      if (parserErr) {\n        util.destroy(this, parserErr)\n      }\n      return\n    }\n\n    util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n  })\n  addListener(socket, 'close', function () {\n    const client = this[kClient]\n    const parser = this[kParser]\n\n    clearIdleSocketValidation(this)\n\n    if (parser) {\n      if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {\n        this[kError] = parser.finish() || this[kError]\n      }\n\n      this[kParser].destroy()\n      this[kParser] = null\n    }\n\n    const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n    client[kSocket] = null\n    client[kHTTPContext] = null // TODO (fix): This is hacky...\n\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n\n      // Fail entire queue.\n      const requests = client[kQueue].splice(client[kRunningIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(client, request, err)\n      }\n    } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {\n      // Fail head of pipeline.\n      const request = client[kQueue][client[kRunningIdx]]\n      client[kQueue][client[kRunningIdx]++] = null\n\n      util.errorRequest(client, request, err)\n    }\n\n    client[kPendingIdx] = client[kRunningIdx]\n\n    assert(client[kRunning] === 0)\n\n    client.emit('disconnect', client[kUrl], [client], err)\n\n    client[kResume]()\n  })\n\n  let closed = false\n  socket.on('close', () => {\n    closed = true\n  })\n\n  return {\n    version: 'h1',\n    defaultPipelining: 1,\n    write (...args) {\n      return writeH1(client, ...args)\n    },\n    resume () {\n      resumeH1(client)\n    },\n    destroy (err, callback) {\n      if (closed) {\n        queueMicrotask(callback)\n      } else {\n        socket.destroy(err).on('close', callback)\n      }\n    },\n    get destroyed () {\n      return socket.destroyed\n    },\n    busy (request) {\n      if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) {\n        return true\n      }\n\n      if (request) {\n        if (client[kRunning] > 0 && !request.idempotent) {\n          // Non-idempotent request cannot be retried.\n          // Ensure that no other requests are inflight and\n          // could cause failure.\n          return true\n        }\n\n        if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {\n          // Don't dispatch an upgrade until all preceding requests have completed.\n          // A misbehaving server might upgrade the connection before all pipelined\n          // request has completed.\n          return true\n        }\n\n        if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&\n          (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {\n          // Request with stream or iterator body can error while other requests\n          // are inflight and indirectly error those as well.\n          // Ensure this doesn't happen by waiting for inflight\n          // to complete before dispatching.\n\n          // Request with stream or iterator body cannot be retried.\n          // Ensure that no other requests are inflight and\n          // could cause failure.\n          return true\n        }\n      }\n\n      return false\n    }\n  }\n}\n\nfunction clearIdleSocketValidation (socket) {\n  if (socket[kIdleSocketValidationTimeout]) {\n    clearTimeout(socket[kIdleSocketValidationTimeout])\n    socket[kIdleSocketValidationTimeout] = null\n  }\n\n  socket[kIdleSocketValidation] = 0\n}\n\nfunction scheduleIdleSocketValidation (client, socket) {\n  socket[kIdleSocketValidation] = 1\n  socket[kIdleSocketValidationTimeout] = setTimeout(() => {\n    socket[kIdleSocketValidationTimeout] = null\n    socket[kIdleSocketValidation] = 2\n\n    if (client[kSocket] === socket && !socket.destroyed) {\n      client[kResume]()\n    }\n  }, 0)\n  socket[kIdleSocketValidationTimeout].unref?.()\n}\n\n/**\n * @param {import('./client.js')} client\n */\nfunction resumeH1 (client) {\n  const socket = client[kSocket]\n\n  if (socket && !socket.destroyed) {\n    if (client[kSize] === 0) {\n      if (!socket[kNoRef] && socket.unref) {\n        socket.unref()\n        socket[kNoRef] = true\n      }\n    } else if (socket[kNoRef] && socket.ref) {\n      socket.ref()\n      socket[kNoRef] = false\n    }\n\n    if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {\n      if (socket[kIdleSocketValidation] === 0) {\n        scheduleIdleSocketValidation(client, socket)\n        socket[kParser].readMore()\n        if (socket.destroyed) {\n          return\n        }\n        return\n      }\n\n      if (socket[kIdleSocketValidation] === 1) {\n        socket[kParser].readMore()\n        if (socket.destroyed) {\n          return\n        }\n        return\n      }\n    }\n\n    if (client[kRunning] === 0) {\n      socket[kParser].readMore()\n      if (socket.destroyed) {\n        return\n      }\n    }\n\n    if (client[kSize] === 0) {\n      if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {\n        socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)\n      }\n    } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n      if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n        const request = client[kQueue][client[kRunningIdx]]\n        const headersTimeout = request.headersTimeout != null\n          ? request.headersTimeout\n          : client[kHeadersTimeout]\n        socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)\n      }\n    }\n  }\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n  return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH1 (client, request) {\n  const { method, path, host, upgrade, blocking, reset } = request\n\n  let { body, headers, contentLength } = request\n\n  // https://tools.ietf.org/html/rfc7231#section-4.3.1\n  // https://tools.ietf.org/html/rfc7231#section-4.3.2\n  // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n  // Sending a payload body on a request that does not\n  // expect it can cause undefined behavior on some\n  // servers and corrupt connection state. Do not\n  // re-use the connection for further requests.\n\n  const expectsPayload = (\n    method === 'PUT' ||\n    method === 'POST' ||\n    method === 'PATCH' ||\n    method === 'QUERY' ||\n    method === 'PROPFIND' ||\n    method === 'PROPPATCH'\n  )\n\n  if (util.isFormDataLike(body)) {\n    if (!extractBody) {\n      extractBody = require('../web/fetch/body.js').extractBody\n    }\n\n    const [bodyStream, contentType] = extractBody(body)\n    if (request.contentType == null) {\n      headers.push('content-type', contentType)\n    }\n    body = bodyStream.stream\n    contentLength = bodyStream.length\n  } else if (util.isBlobLike(body) && request.contentType == null && body.type) {\n    headers.push('content-type', body.type)\n  }\n\n  if (body && typeof body.read === 'function') {\n    // Try to read EOF in order to get length.\n    body.read(0)\n  }\n\n  const bodyLength = util.bodyLength(body)\n\n  contentLength = bodyLength ?? contentLength\n\n  if (contentLength === null) {\n    contentLength = request.contentLength\n  }\n\n  if (contentLength === 0 && !expectsPayload) {\n    // https://tools.ietf.org/html/rfc7230#section-3.3.2\n    // A user agent SHOULD NOT send a Content-Length header field when\n    // the request message does not contain a payload body and the method\n    // semantics do not anticipate such a body.\n\n    contentLength = null\n  }\n\n  // https://github.com/nodejs/undici/issues/2046\n  // A user agent may send a Content-Length header with 0 value, this should be allowed.\n  if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {\n    if (client[kStrictContentLength]) {\n      util.errorRequest(client, request, new RequestContentLengthMismatchError())\n      return false\n    }\n\n    process.emitWarning(new RequestContentLengthMismatchError())\n  }\n\n  const socket = client[kSocket]\n  clearIdleSocketValidation(socket)\n\n  const abort = (err) => {\n    if (request.aborted || request.completed) {\n      return\n    }\n\n    util.errorRequest(client, request, err || new RequestAbortedError())\n\n    util.destroy(body)\n    util.destroy(socket, new InformationalError('aborted'))\n  }\n\n  try {\n    request.onConnect(abort)\n  } catch (err) {\n    util.errorRequest(client, request, err)\n  }\n\n  if (request.aborted) {\n    return false\n  }\n\n  if (method === 'HEAD') {\n    // https://github.com/mcollina/undici/issues/258\n    // Close after a HEAD request to interop with misbehaving servers\n    // that may send a body in the response.\n\n    socket[kReset] = true\n  }\n\n  if (upgrade || method === 'CONNECT') {\n    // On CONNECT or upgrade, block pipeline from dispatching further\n    // requests on this connection.\n\n    socket[kReset] = true\n  }\n\n  if (reset != null) {\n    socket[kReset] = reset\n  }\n\n  if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n    socket[kReset] = true\n  }\n\n  if (blocking) {\n    socket[kBlocking] = true\n  }\n\n  let header = `${method} ${path} HTTP/1.1\\r\\n`\n\n  if (typeof host === 'string') {\n    header += `host: ${host}\\r\\n`\n  } else {\n    header += client[kHostHeader]\n  }\n\n  if (upgrade) {\n    header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n  } else if (client[kPipelining] && !socket[kReset]) {\n    header += 'connection: keep-alive\\r\\n'\n  } else {\n    header += 'connection: close\\r\\n'\n  }\n\n  if (Array.isArray(headers)) {\n    for (let n = 0; n < headers.length; n += 2) {\n      const key = headers[n + 0]\n      const val = headers[n + 1]\n\n      if (Array.isArray(val)) {\n        for (let i = 0; i < val.length; i++) {\n          header += `${key}: ${val[i]}\\r\\n`\n        }\n      } else {\n        header += `${key}: ${val}\\r\\n`\n      }\n    }\n  }\n\n  if (channels.sendHeaders.hasSubscribers) {\n    channels.sendHeaders.publish({ request, headers: header, socket })\n  }\n\n  /* istanbul ignore else: assertion */\n  if (!body || bodyLength === 0) {\n    writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isBuffer(body)) {\n    writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isBlobLike(body)) {\n    if (typeof body.stream === 'function') {\n      writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)\n    } else {\n      writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)\n    }\n  } else if (util.isStream(body)) {\n    writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isIterable(body)) {\n    writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else {\n    assert(false)\n  }\n\n  return true\n}\n\nfunction writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n  let finished = false\n\n  const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n\n  const onData = function (chunk) {\n    if (finished) {\n      return\n    }\n\n    try {\n      if (!writer.write(chunk) && this.pause) {\n        this.pause()\n      }\n    } catch (err) {\n      util.destroy(this, err)\n    }\n  }\n  const onDrain = function () {\n    if (finished) {\n      return\n    }\n\n    if (body.resume) {\n      body.resume()\n    }\n  }\n  const onClose = function () {\n    // 'close' might be emitted *before* 'error' for\n    // broken streams. Wait a tick to avoid this case.\n    queueMicrotask(() => {\n      // It's only safe to remove 'error' listener after\n      // 'close'.\n      body.removeListener('error', onFinished)\n    })\n\n    if (!finished) {\n      const err = new RequestAbortedError()\n      queueMicrotask(() => onFinished(err))\n    }\n  }\n  const onFinished = function (err) {\n    if (finished) {\n      return\n    }\n\n    finished = true\n\n    assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))\n\n    socket\n      .off('drain', onDrain)\n      .off('error', onFinished)\n\n    body\n      .removeListener('data', onData)\n      .removeListener('end', onFinished)\n      .removeListener('close', onClose)\n\n    if (!err) {\n      try {\n        writer.end()\n      } catch (er) {\n        err = er\n      }\n    }\n\n    writer.destroy(err)\n\n    if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {\n      util.destroy(body, err)\n    } else {\n      util.destroy(body)\n    }\n  }\n\n  body\n    .on('data', onData)\n    .on('end', onFinished)\n    .on('error', onFinished)\n    .on('close', onClose)\n\n  if (body.resume) {\n    body.resume()\n  }\n\n  socket\n    .on('drain', onDrain)\n    .on('error', onFinished)\n\n  if (body.errorEmitted ?? body.errored) {\n    setImmediate(() => onFinished(body.errored))\n  } else if (body.endEmitted ?? body.readableEnded) {\n    setImmediate(() => onFinished(null))\n  }\n\n  if (body.closeEmitted ?? body.closed) {\n    setImmediate(onClose)\n  }\n}\n\nfunction writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  try {\n    if (!body) {\n      if (contentLength === 0) {\n        socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n      } else {\n        assert(contentLength === null, 'no body must not have content length')\n        socket.write(`${header}\\r\\n`, 'latin1')\n      }\n    } else if (util.isBuffer(body)) {\n      assert(contentLength === body.byteLength, 'buffer body must have content length')\n\n      socket.cork()\n      socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n      socket.write(body)\n      socket.uncork()\n      request.onBodySent(body)\n\n      if (!expectsPayload && request.reset !== false) {\n        socket[kReset] = true\n      }\n    }\n    request.onRequestSent()\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength === body.size, 'blob body must have content length')\n\n  try {\n    if (contentLength != null && contentLength !== body.size) {\n      throw new RequestContentLengthMismatchError()\n    }\n\n    const buffer = Buffer.from(await body.arrayBuffer())\n\n    socket.cork()\n    socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n    socket.write(buffer)\n    socket.uncork()\n\n    request.onBodySent(buffer)\n    request.onRequestSent()\n\n    if (!expectsPayload && request.reset !== false) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n  let callback = null\n  function onDrain () {\n    if (callback) {\n      const cb = callback\n      callback = null\n      cb()\n    }\n  }\n\n  const waitForDrain = () => new Promise((resolve, reject) => {\n    assert(callback === null)\n\n    if (socket[kError]) {\n      reject(socket[kError])\n    } else {\n      callback = resolve\n    }\n  })\n\n  socket\n    .on('close', onDrain)\n    .on('drain', onDrain)\n\n  const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n  try {\n    // It's up to the user to somehow abort the async iterable.\n    for await (const chunk of body) {\n      if (socket[kError]) {\n        throw socket[kError]\n      }\n\n      if (!writer.write(chunk)) {\n        await waitForDrain()\n      }\n    }\n\n    writer.end()\n  } catch (err) {\n    writer.destroy(err)\n  } finally {\n    socket\n      .off('close', onDrain)\n      .off('drain', onDrain)\n  }\n}\n\nclass AsyncWriter {\n  constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {\n    this.socket = socket\n    this.request = request\n    this.contentLength = contentLength\n    this.client = client\n    this.bytesWritten = 0\n    this.expectsPayload = expectsPayload\n    this.header = header\n    this.abort = abort\n\n    socket[kWriting] = true\n  }\n\n  write (chunk) {\n    const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this\n\n    if (socket[kError]) {\n      throw socket[kError]\n    }\n\n    if (socket.destroyed) {\n      return false\n    }\n\n    const len = Buffer.byteLength(chunk)\n    if (!len) {\n      return true\n    }\n\n    // We should defer writing chunks.\n    if (contentLength !== null && bytesWritten + len > contentLength) {\n      if (client[kStrictContentLength]) {\n        throw new RequestContentLengthMismatchError()\n      }\n\n      process.emitWarning(new RequestContentLengthMismatchError())\n    }\n\n    socket.cork()\n\n    if (bytesWritten === 0) {\n      if (!expectsPayload && request.reset !== false) {\n        socket[kReset] = true\n      }\n\n      if (contentLength === null) {\n        socket.write(`${header}transfer-encoding: chunked\\r\\n`, 'latin1')\n      } else {\n        socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n      }\n    }\n\n    if (contentLength === null) {\n      socket.write(`\\r\\n${len.toString(16)}\\r\\n`, 'latin1')\n    }\n\n    this.bytesWritten += len\n\n    const ret = socket.write(chunk)\n\n    socket.uncork()\n\n    request.onBodySent(chunk)\n\n    if (!ret) {\n      if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n        // istanbul ignore else: only for jest\n        if (socket[kParser].timeout.refresh) {\n          socket[kParser].timeout.refresh()\n        }\n      }\n    }\n\n    return ret\n  }\n\n  end () {\n    const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this\n    request.onRequestSent()\n\n    socket[kWriting] = false\n\n    if (socket[kError]) {\n      throw socket[kError]\n    }\n\n    if (socket.destroyed) {\n      return\n    }\n\n    if (bytesWritten === 0) {\n      if (expectsPayload) {\n        // https://tools.ietf.org/html/rfc7230#section-3.3.2\n        // A user agent SHOULD send a Content-Length in a request message when\n        // no Transfer-Encoding is sent and the request method defines a meaning\n        // for an enclosed payload body.\n\n        socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n      } else {\n        socket.write(`${header}\\r\\n`, 'latin1')\n      }\n    } else if (contentLength === null) {\n      socket.write('\\r\\n0\\r\\n\\r\\n', 'latin1')\n    }\n\n    if (contentLength !== null && bytesWritten !== contentLength) {\n      if (client[kStrictContentLength]) {\n        throw new RequestContentLengthMismatchError()\n      } else {\n        process.emitWarning(new RequestContentLengthMismatchError())\n      }\n    }\n\n    if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n      // istanbul ignore else: only for jest\n      if (socket[kParser].timeout.refresh) {\n        socket[kParser].timeout.refresh()\n      }\n    }\n\n    client[kResume]()\n  }\n\n  destroy (err) {\n    const { socket, client, abort } = this\n\n    socket[kWriting] = false\n\n    if (err) {\n      assert(client[kRunning] <= 1, 'pipeline should only contain this request')\n      abort(err)\n    }\n  }\n}\n\nmodule.exports = connectH1\n","'use strict'\n\nconst assert = require('node:assert')\nconst { pipeline } = require('node:stream')\nconst util = require('../core/util.js')\nconst {\n  RequestContentLengthMismatchError,\n  RequestAbortedError,\n  SocketError,\n  InformationalError\n} = require('../core/errors.js')\nconst {\n  kUrl,\n  kReset,\n  kClient,\n  kRunning,\n  kPending,\n  kQueue,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kSocket,\n  kStrictContentLength,\n  kOnError,\n  kMaxConcurrentStreams,\n  kHTTP2Session,\n  kResume,\n  kSize,\n  kHTTPContext\n} = require('../core/symbols.js')\n\nconst kOpenStreams = Symbol('open streams')\n\nlet extractBody\n\n// Experimental\nlet h2ExperimentalWarned = false\n\n/** @type {import('http2')} */\nlet http2\ntry {\n  http2 = require('node:http2')\n} catch {\n  // @ts-ignore\n  http2 = { constants: {} }\n}\n\nconst {\n  constants: {\n    HTTP2_HEADER_AUTHORITY,\n    HTTP2_HEADER_METHOD,\n    HTTP2_HEADER_PATH,\n    HTTP2_HEADER_SCHEME,\n    HTTP2_HEADER_CONTENT_LENGTH,\n    HTTP2_HEADER_EXPECT,\n    HTTP2_HEADER_STATUS\n  }\n} = http2\n\nfunction parseH2Headers (headers) {\n  const result = []\n\n  for (const [name, value] of Object.entries(headers)) {\n    // h2 may concat the header value by array\n    // e.g. Set-Cookie\n    if (Array.isArray(value)) {\n      for (const subvalue of value) {\n        // we need to provide each header value of header name\n        // because the headers handler expect name-value pair\n        result.push(Buffer.from(name), Buffer.from(subvalue))\n      }\n    } else {\n      result.push(Buffer.from(name), Buffer.from(value))\n    }\n  }\n\n  return result\n}\n\nasync function connectH2 (client, socket) {\n  client[kSocket] = socket\n\n  if (!h2ExperimentalWarned) {\n    h2ExperimentalWarned = true\n    process.emitWarning('H2 support is experimental, expect them to change at any time.', {\n      code: 'UNDICI-H2'\n    })\n  }\n\n  const session = http2.connect(client[kUrl], {\n    createConnection: () => socket,\n    peerMaxConcurrentStreams: client[kMaxConcurrentStreams]\n  })\n\n  session[kOpenStreams] = 0\n  session[kClient] = client\n  session[kSocket] = socket\n\n  util.addListener(session, 'error', onHttp2SessionError)\n  util.addListener(session, 'frameError', onHttp2FrameError)\n  util.addListener(session, 'end', onHttp2SessionEnd)\n  util.addListener(session, 'goaway', onHTTP2GoAway)\n  util.addListener(session, 'close', function () {\n    const { [kClient]: client } = this\n    const { [kSocket]: socket } = client\n\n    const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket))\n\n    client[kHTTP2Session] = null\n\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n\n      // Fail entire queue.\n      const requests = client[kQueue].splice(client[kRunningIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(client, request, err)\n      }\n    }\n  })\n\n  session.unref()\n\n  client[kHTTP2Session] = session\n  socket[kHTTP2Session] = session\n\n  util.addListener(socket, 'error', function (err) {\n    assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n    this[kError] = err\n\n    this[kClient][kOnError](err)\n  })\n\n  util.addListener(socket, 'end', function () {\n    util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n  })\n\n  util.addListener(socket, 'close', function () {\n    const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n    client[kSocket] = null\n\n    if (this[kHTTP2Session] != null) {\n      this[kHTTP2Session].destroy(err)\n    }\n\n    client[kPendingIdx] = client[kRunningIdx]\n\n    assert(client[kRunning] === 0)\n\n    client.emit('disconnect', client[kUrl], [client], err)\n\n    client[kResume]()\n  })\n\n  let closed = false\n  socket.on('close', () => {\n    closed = true\n  })\n\n  return {\n    version: 'h2',\n    defaultPipelining: Infinity,\n    write (...args) {\n      return writeH2(client, ...args)\n    },\n    resume () {\n      resumeH2(client)\n    },\n    destroy (err, callback) {\n      if (closed) {\n        queueMicrotask(callback)\n      } else {\n        // Destroying the socket will trigger the session close\n        socket.destroy(err).on('close', callback)\n      }\n    },\n    get destroyed () {\n      return socket.destroyed\n    },\n    busy () {\n      return false\n    }\n  }\n}\n\nfunction resumeH2 (client) {\n  const socket = client[kSocket]\n\n  if (socket?.destroyed === false) {\n    if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) {\n      socket.unref()\n      client[kHTTP2Session].unref()\n    } else {\n      socket.ref()\n      client[kHTTP2Session].ref()\n    }\n  }\n}\n\nfunction onHttp2SessionError (err) {\n  assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n  this[kSocket][kError] = err\n  this[kClient][kOnError](err)\n}\n\nfunction onHttp2FrameError (type, code, id) {\n  if (id === 0) {\n    const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n    this[kSocket][kError] = err\n    this[kClient][kOnError](err)\n  }\n}\n\nfunction onHttp2SessionEnd () {\n  const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket]))\n  this.destroy(err)\n  util.destroy(this[kSocket], err)\n}\n\n/**\n * This is the root cause of #3011\n * We need to handle GOAWAY frames properly, and trigger the session close\n * along with the socket right away\n */\nfunction onHTTP2GoAway (code) {\n  // We cannot recover, so best to close the session and the socket\n  const err = this[kError] || new SocketError(`HTTP/2: \"GOAWAY\" frame received with code ${code}`, util.getSocketInfo(this))\n  const client = this[kClient]\n\n  client[kSocket] = null\n  client[kHTTPContext] = null\n\n  if (this[kHTTP2Session] != null) {\n    this[kHTTP2Session].destroy(err)\n    this[kHTTP2Session] = null\n  }\n\n  util.destroy(this[kSocket], err)\n\n  // Fail head of pipeline.\n  if (client[kRunningIdx] < client[kQueue].length) {\n    const request = client[kQueue][client[kRunningIdx]]\n    client[kQueue][client[kRunningIdx]++] = null\n    util.errorRequest(client, request, err)\n    client[kPendingIdx] = client[kRunningIdx]\n  }\n\n  assert(client[kRunning] === 0)\n\n  client.emit('disconnect', client[kUrl], [client], err)\n\n  client[kResume]()\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n  return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH2 (client, request) {\n  const session = client[kHTTP2Session]\n  const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request\n  let { body } = request\n\n  if (upgrade) {\n    util.errorRequest(client, request, new Error('Upgrade not supported for H2'))\n    return false\n  }\n\n  const headers = {}\n  for (let n = 0; n < reqHeaders.length; n += 2) {\n    const key = reqHeaders[n + 0]\n    const val = reqHeaders[n + 1]\n\n    if (Array.isArray(val)) {\n      for (let i = 0; i < val.length; i++) {\n        if (headers[key]) {\n          headers[key] += `,${val[i]}`\n        } else {\n          headers[key] = val[i]\n        }\n      }\n    } else {\n      headers[key] = val\n    }\n  }\n\n  /** @type {import('node:http2').ClientHttp2Stream} */\n  let stream\n\n  const { hostname, port } = client[kUrl]\n\n  headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`\n  headers[HTTP2_HEADER_METHOD] = method\n\n  const abort = (err) => {\n    if (request.aborted || request.completed) {\n      return\n    }\n\n    err = err || new RequestAbortedError()\n\n    util.errorRequest(client, request, err)\n\n    if (stream != null) {\n      util.destroy(stream, err)\n    }\n\n    // We do not destroy the socket as we can continue using the session\n    // the stream get's destroyed and the session remains to create new streams\n    util.destroy(body, err)\n    client[kQueue][client[kRunningIdx]++] = null\n    client[kResume]()\n  }\n\n  try {\n    // We are already connected, streams are pending.\n    // We can call on connect, and wait for abort\n    request.onConnect(abort)\n  } catch (err) {\n    util.errorRequest(client, request, err)\n  }\n\n  if (request.aborted) {\n    return false\n  }\n\n  if (method === 'CONNECT') {\n    session.ref()\n    // We are already connected, streams are pending, first request\n    // will create a new stream. We trigger a request to create the stream and wait until\n    // `ready` event is triggered\n    // We disabled endStream to allow the user to write to the stream\n    stream = session.request(headers, { endStream: false, signal })\n\n    if (stream.id && !stream.pending) {\n      request.onUpgrade(null, null, stream)\n      ++session[kOpenStreams]\n      client[kQueue][client[kRunningIdx]++] = null\n    } else {\n      stream.once('ready', () => {\n        request.onUpgrade(null, null, stream)\n        ++session[kOpenStreams]\n        client[kQueue][client[kRunningIdx]++] = null\n      })\n    }\n\n    stream.once('close', () => {\n      session[kOpenStreams] -= 1\n      if (session[kOpenStreams] === 0) session.unref()\n    })\n\n    return true\n  }\n\n  // https://tools.ietf.org/html/rfc7540#section-8.3\n  // :path and :scheme headers must be omitted when sending CONNECT\n\n  headers[HTTP2_HEADER_PATH] = path\n  headers[HTTP2_HEADER_SCHEME] = 'https'\n\n  // https://tools.ietf.org/html/rfc7231#section-4.3.1\n  // https://tools.ietf.org/html/rfc7231#section-4.3.2\n  // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n  // Sending a payload body on a request that does not\n  // expect it can cause undefined behavior on some\n  // servers and corrupt connection state. Do not\n  // re-use the connection for further requests.\n\n  const expectsPayload = (\n    method === 'PUT' ||\n    method === 'POST' ||\n    method === 'PATCH'\n  )\n\n  if (body && typeof body.read === 'function') {\n    // Try to read EOF in order to get length.\n    body.read(0)\n  }\n\n  let contentLength = util.bodyLength(body)\n\n  if (util.isFormDataLike(body)) {\n    extractBody ??= require('../web/fetch/body.js').extractBody\n\n    const [bodyStream, contentType] = extractBody(body)\n    headers['content-type'] = contentType\n\n    body = bodyStream.stream\n    contentLength = bodyStream.length\n  }\n\n  if (contentLength == null) {\n    contentLength = request.contentLength\n  }\n\n  if (contentLength === 0 || !expectsPayload) {\n    // https://tools.ietf.org/html/rfc7230#section-3.3.2\n    // A user agent SHOULD NOT send a Content-Length header field when\n    // the request message does not contain a payload body and the method\n    // semantics do not anticipate such a body.\n\n    contentLength = null\n  }\n\n  // https://github.com/nodejs/undici/issues/2046\n  // A user agent may send a Content-Length header with 0 value, this should be allowed.\n  if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {\n    if (client[kStrictContentLength]) {\n      util.errorRequest(client, request, new RequestContentLengthMismatchError())\n      return false\n    }\n\n    process.emitWarning(new RequestContentLengthMismatchError())\n  }\n\n  if (contentLength != null) {\n    assert(body, 'no body must not have content length')\n    headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`\n  }\n\n  session.ref()\n\n  const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null\n  if (expectContinue) {\n    headers[HTTP2_HEADER_EXPECT] = '100-continue'\n    stream = session.request(headers, { endStream: shouldEndStream, signal })\n\n    stream.once('continue', writeBodyH2)\n  } else {\n    stream = session.request(headers, {\n      endStream: shouldEndStream,\n      signal\n    })\n    writeBodyH2()\n  }\n\n  // Increment counter as we have new streams open\n  ++session[kOpenStreams]\n\n  stream.once('response', headers => {\n    const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n    request.onResponseStarted()\n\n    // Due to the stream nature, it is possible we face a race condition\n    // where the stream has been assigned, but the request has been aborted\n    // the request remains in-flight and headers hasn't been received yet\n    // for those scenarios, best effort is to destroy the stream immediately\n    // as there's no value to keep it open.\n    if (request.aborted) {\n      const err = new RequestAbortedError()\n      util.errorRequest(client, request, err)\n      util.destroy(stream, err)\n      return\n    }\n\n    if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) {\n      stream.pause()\n    }\n\n    stream.on('data', (chunk) => {\n      if (request.onData(chunk) === false) {\n        stream.pause()\n      }\n    })\n  })\n\n  stream.once('end', () => {\n    // When state is null, it means we haven't consumed body and the stream still do not have\n    // a state.\n    // Present specially when using pipeline or stream\n    if (stream.state?.state == null || stream.state.state < 6) {\n      request.onComplete([])\n    }\n\n    if (session[kOpenStreams] === 0) {\n      // Stream is closed or half-closed-remote (6), decrement counter and cleanup\n      // It does not have sense to continue working with the stream as we do not\n      // have yet RST_STREAM support on client-side\n\n      session.unref()\n    }\n\n    abort(new InformationalError('HTTP/2: stream half-closed (remote)'))\n    client[kQueue][client[kRunningIdx]++] = null\n    client[kPendingIdx] = client[kRunningIdx]\n    client[kResume]()\n  })\n\n  stream.once('close', () => {\n    session[kOpenStreams] -= 1\n    if (session[kOpenStreams] === 0) {\n      session.unref()\n    }\n  })\n\n  stream.once('error', function (err) {\n    abort(err)\n  })\n\n  stream.once('frameError', (type, code) => {\n    abort(new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`))\n  })\n\n  // stream.on('aborted', () => {\n  //   // TODO(HTTP/2): Support aborted\n  // })\n\n  // stream.on('timeout', () => {\n  //   // TODO(HTTP/2): Support timeout\n  // })\n\n  // stream.on('push', headers => {\n  //   // TODO(HTTP/2): Support push\n  // })\n\n  // stream.on('trailers', headers => {\n  //   // TODO(HTTP/2): Support trailers\n  // })\n\n  return true\n\n  function writeBodyH2 () {\n    /* istanbul ignore else: assertion */\n    if (!body || contentLength === 0) {\n      writeBuffer(\n        abort,\n        stream,\n        null,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else if (util.isBuffer(body)) {\n      writeBuffer(\n        abort,\n        stream,\n        body,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else if (util.isBlobLike(body)) {\n      if (typeof body.stream === 'function') {\n        writeIterable(\n          abort,\n          stream,\n          body.stream(),\n          client,\n          request,\n          client[kSocket],\n          contentLength,\n          expectsPayload\n        )\n      } else {\n        writeBlob(\n          abort,\n          stream,\n          body,\n          client,\n          request,\n          client[kSocket],\n          contentLength,\n          expectsPayload\n        )\n      }\n    } else if (util.isStream(body)) {\n      writeStream(\n        abort,\n        client[kSocket],\n        expectsPayload,\n        stream,\n        body,\n        client,\n        request,\n        contentLength\n      )\n    } else if (util.isIterable(body)) {\n      writeIterable(\n        abort,\n        stream,\n        body,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else {\n      assert(false)\n    }\n  }\n}\n\nfunction writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  try {\n    if (body != null && util.isBuffer(body)) {\n      assert(contentLength === body.byteLength, 'buffer body must have content length')\n      h2stream.cork()\n      h2stream.write(body)\n      h2stream.uncork()\n      h2stream.end()\n\n      request.onBodySent(body)\n    }\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    request.onRequestSent()\n    client[kResume]()\n  } catch (error) {\n    abort(error)\n  }\n}\n\nfunction writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n  // For HTTP/2, is enough to pipe the stream\n  const pipe = pipeline(\n    body,\n    h2stream,\n    (err) => {\n      if (err) {\n        util.destroy(pipe, err)\n        abort(err)\n      } else {\n        util.removeAllListeners(pipe)\n        request.onRequestSent()\n\n        if (!expectsPayload) {\n          socket[kReset] = true\n        }\n\n        client[kResume]()\n      }\n    }\n  )\n\n  util.addListener(pipe, 'data', onPipeData)\n\n  function onPipeData (chunk) {\n    request.onBodySent(chunk)\n  }\n}\n\nasync function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  assert(contentLength === body.size, 'blob body must have content length')\n\n  try {\n    if (contentLength != null && contentLength !== body.size) {\n      throw new RequestContentLengthMismatchError()\n    }\n\n    const buffer = Buffer.from(await body.arrayBuffer())\n\n    h2stream.cork()\n    h2stream.write(buffer)\n    h2stream.uncork()\n    h2stream.end()\n\n    request.onBodySent(buffer)\n    request.onRequestSent()\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n  let callback = null\n  function onDrain () {\n    if (callback) {\n      const cb = callback\n      callback = null\n      cb()\n    }\n  }\n\n  const waitForDrain = () => new Promise((resolve, reject) => {\n    assert(callback === null)\n\n    if (socket[kError]) {\n      reject(socket[kError])\n    } else {\n      callback = resolve\n    }\n  })\n\n  h2stream\n    .on('close', onDrain)\n    .on('drain', onDrain)\n\n  try {\n    // It's up to the user to somehow abort the async iterable.\n    for await (const chunk of body) {\n      if (socket[kError]) {\n        throw socket[kError]\n      }\n\n      const res = h2stream.write(chunk)\n      request.onBodySent(chunk)\n      if (!res) {\n        await waitForDrain()\n      }\n    }\n\n    h2stream.end()\n\n    request.onRequestSent()\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  } finally {\n    h2stream\n      .off('close', onDrain)\n      .off('drain', onDrain)\n  }\n}\n\nmodule.exports = connectH2\n","// @ts-check\n\n'use strict'\n\nconst assert = require('node:assert')\nconst net = require('node:net')\nconst http = require('node:http')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst Request = require('../core/request.js')\nconst DispatcherBase = require('./dispatcher-base')\nconst {\n  InvalidArgumentError,\n  InformationalError,\n  ClientDestroyedError\n} = require('../core/errors.js')\nconst buildConnector = require('../core/connect.js')\nconst {\n  kUrl,\n  kServerName,\n  kClient,\n  kBusy,\n  kConnect,\n  kResuming,\n  kRunning,\n  kPending,\n  kSize,\n  kQueue,\n  kConnected,\n  kConnecting,\n  kNeedDrain,\n  kKeepAliveDefaultTimeout,\n  kHostHeader,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kPipelining,\n  kKeepAliveTimeoutValue,\n  kMaxHeadersSize,\n  kKeepAliveMaxTimeout,\n  kKeepAliveTimeoutThreshold,\n  kHeadersTimeout,\n  kBodyTimeout,\n  kStrictContentLength,\n  kConnector,\n  kMaxRedirections,\n  kMaxRequests,\n  kCounter,\n  kClose,\n  kDestroy,\n  kDispatch,\n  kInterceptors,\n  kLocalAddress,\n  kMaxResponseSize,\n  kOnError,\n  kHTTPContext,\n  kMaxConcurrentStreams,\n  kResume\n} = require('../core/symbols.js')\nconst connectH1 = require('./client-h1.js')\nconst connectH2 = require('./client-h2.js')\nlet deprecatedInterceptorWarned = false\n\nconst kClosedResolve = Symbol('kClosedResolve')\n\nconst noop = () => {}\n\nfunction getPipelining (client) {\n  return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1\n}\n\n/**\n * @type {import('../../types/client.js').default}\n */\nclass Client extends DispatcherBase {\n  /**\n   *\n   * @param {string|URL} url\n   * @param {import('../../types/client.js').Client.Options} options\n   */\n  constructor (url, {\n    interceptors,\n    maxHeaderSize,\n    headersTimeout,\n    socketTimeout,\n    requestTimeout,\n    connectTimeout,\n    bodyTimeout,\n    idleTimeout,\n    keepAlive,\n    keepAliveTimeout,\n    maxKeepAliveTimeout,\n    keepAliveMaxTimeout,\n    keepAliveTimeoutThreshold,\n    socketPath,\n    pipelining,\n    tls,\n    strictContentLength,\n    maxCachedSessions,\n    maxRedirections,\n    connect,\n    maxRequestsPerClient,\n    localAddress,\n    maxResponseSize,\n    autoSelectFamily,\n    autoSelectFamilyAttemptTimeout,\n    // h2\n    maxConcurrentStreams,\n    allowH2,\n    webSocket\n  } = {}) {\n    super({ webSocket })\n\n    if (keepAlive !== undefined) {\n      throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')\n    }\n\n    if (socketTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')\n    }\n\n    if (requestTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')\n    }\n\n    if (idleTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')\n    }\n\n    if (maxKeepAliveTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')\n    }\n\n    if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {\n      throw new InvalidArgumentError('invalid maxHeaderSize')\n    }\n\n    if (socketPath != null && typeof socketPath !== 'string') {\n      throw new InvalidArgumentError('invalid socketPath')\n    }\n\n    if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n      throw new InvalidArgumentError('invalid connectTimeout')\n    }\n\n    if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n      throw new InvalidArgumentError('invalid keepAliveTimeout')\n    }\n\n    if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n      throw new InvalidArgumentError('invalid keepAliveMaxTimeout')\n    }\n\n    if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n      throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')\n    }\n\n    if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n      throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')\n    }\n\n    if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n      throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n      throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')\n    }\n\n    if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {\n      throw new InvalidArgumentError('localAddress must be valid string IP address')\n    }\n\n    if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n      throw new InvalidArgumentError('maxResponseSize must be a positive number')\n    }\n\n    if (\n      autoSelectFamilyAttemptTimeout != null &&\n      (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)\n    ) {\n      throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')\n    }\n\n    // h2\n    if (allowH2 != null && typeof allowH2 !== 'boolean') {\n      throw new InvalidArgumentError('allowH2 must be a valid boolean value')\n    }\n\n    if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {\n      throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')\n    }\n\n    if (typeof connect !== 'function') {\n      connect = buildConnector({\n        ...tls,\n        maxCachedSessions,\n        allowH2,\n        socketPath,\n        timeout: connectTimeout,\n        ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n        ...connect\n      })\n    }\n\n    if (interceptors?.Client && Array.isArray(interceptors.Client)) {\n      this[kInterceptors] = interceptors.Client\n      if (!deprecatedInterceptorWarned) {\n        deprecatedInterceptorWarned = true\n        process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', {\n          code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED'\n        })\n      }\n    } else {\n      this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]\n    }\n\n    this[kUrl] = util.parseOrigin(url)\n    this[kConnector] = connect\n    this[kPipelining] = pipelining != null ? pipelining : 1\n    this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize\n    this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout\n    this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout\n    this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold\n    this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]\n    this[kServerName] = null\n    this[kLocalAddress] = localAddress != null ? localAddress : null\n    this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming\n    this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming\n    this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\\r\\n`\n    this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3\n    this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3\n    this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength\n    this[kMaxRedirections] = maxRedirections\n    this[kMaxRequests] = maxRequestsPerClient\n    this[kClosedResolve] = null\n    this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1\n    this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server\n    this[kHTTPContext] = null\n\n    // kQueue is built up of 3 sections separated by\n    // the kRunningIdx and kPendingIdx indices.\n    // |   complete   |   running   |   pending   |\n    //                ^ kRunningIdx ^ kPendingIdx ^ kQueue.length\n    // kRunningIdx points to the first running element.\n    // kPendingIdx points to the first pending element.\n    // This implements a fast queue with an amortized\n    // time of O(1).\n\n    this[kQueue] = []\n    this[kRunningIdx] = 0\n    this[kPendingIdx] = 0\n\n    this[kResume] = (sync) => resume(this, sync)\n    this[kOnError] = (err) => onError(this, err)\n  }\n\n  get pipelining () {\n    return this[kPipelining]\n  }\n\n  set pipelining (value) {\n    this[kPipelining] = value\n    this[kResume](true)\n  }\n\n  get [kPending] () {\n    return this[kQueue].length - this[kPendingIdx]\n  }\n\n  get [kRunning] () {\n    return this[kPendingIdx] - this[kRunningIdx]\n  }\n\n  get [kSize] () {\n    return this[kQueue].length - this[kRunningIdx]\n  }\n\n  get [kConnected] () {\n    return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed\n  }\n\n  get [kBusy] () {\n    return Boolean(\n      this[kHTTPContext]?.busy(null) ||\n      (this[kSize] >= (getPipelining(this) || 1)) ||\n      this[kPending] > 0\n    )\n  }\n\n  /* istanbul ignore: only used for test */\n  [kConnect] (cb) {\n    connect(this)\n    this.once('connect', cb)\n  }\n\n  [kDispatch] (opts, handler) {\n    const origin = opts.origin || this[kUrl].origin\n    const request = new Request(origin, opts, handler)\n\n    this[kQueue].push(request)\n    if (this[kResuming]) {\n      // Do nothing.\n    } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n      // Wait a tick in case stream/iterator is ended in the same tick.\n      this[kResuming] = 1\n      queueMicrotask(() => resume(this))\n    } else {\n      this[kResume](true)\n    }\n\n    if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n      this[kNeedDrain] = 2\n    }\n\n    return this[kNeedDrain] < 2\n  }\n\n  async [kClose] () {\n    // TODO: for H2 we need to gracefully flush the remaining enqueued\n    // request and close each stream.\n    return new Promise((resolve) => {\n      if (this[kSize]) {\n        this[kClosedResolve] = resolve\n      } else {\n        resolve(null)\n      }\n    })\n  }\n\n  async [kDestroy] (err) {\n    return new Promise((resolve) => {\n      const requests = this[kQueue].splice(this[kPendingIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(this, request, err)\n      }\n\n      const callback = () => {\n        if (this[kClosedResolve]) {\n          // TODO (fix): Should we error here with ClientDestroyedError?\n          this[kClosedResolve]()\n          this[kClosedResolve] = null\n        }\n        resolve(null)\n      }\n\n      if (this[kHTTPContext]) {\n        this[kHTTPContext].destroy(err, callback)\n        this[kHTTPContext] = null\n      } else {\n        queueMicrotask(callback)\n      }\n\n      this[kResume]()\n    })\n  }\n}\n\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor.js')\n\nfunction onError (client, err) {\n  if (\n    client[kRunning] === 0 &&\n    err.code !== 'UND_ERR_INFO' &&\n    err.code !== 'UND_ERR_SOCKET'\n  ) {\n    // Error is not caused by running request and not a recoverable\n    // socket error.\n\n    assert(client[kPendingIdx] === client[kRunningIdx])\n\n    const requests = client[kQueue].splice(client[kRunningIdx])\n\n    for (let i = 0; i < requests.length; i++) {\n      const request = requests[i]\n      util.errorRequest(client, request, err)\n    }\n    assert(client[kSize] === 0)\n  }\n}\n\n/**\n * @param {Client} client\n * @returns\n */\nasync function connect (client) {\n  assert(!client[kConnecting])\n  assert(!client[kHTTPContext])\n\n  let { host, hostname, protocol, port } = client[kUrl]\n\n  // Resolve ipv6\n  if (hostname[0] === '[') {\n    const idx = hostname.indexOf(']')\n\n    assert(idx !== -1)\n    const ip = hostname.substring(1, idx)\n\n    assert(net.isIP(ip))\n    hostname = ip\n  }\n\n  client[kConnecting] = true\n\n  if (channels.beforeConnect.hasSubscribers) {\n    channels.beforeConnect.publish({\n      connectParams: {\n        host,\n        hostname,\n        protocol,\n        port,\n        version: client[kHTTPContext]?.version,\n        servername: client[kServerName],\n        localAddress: client[kLocalAddress]\n      },\n      connector: client[kConnector]\n    })\n  }\n\n  try {\n    const socket = await new Promise((resolve, reject) => {\n      client[kConnector]({\n        host,\n        hostname,\n        protocol,\n        port,\n        servername: client[kServerName],\n        localAddress: client[kLocalAddress]\n      }, (err, socket) => {\n        if (err) {\n          reject(err)\n        } else {\n          resolve(socket)\n        }\n      })\n    })\n\n    if (client.destroyed) {\n      util.destroy(socket.on('error', noop), new ClientDestroyedError())\n      return\n    }\n\n    assert(socket)\n\n    try {\n      client[kHTTPContext] = socket.alpnProtocol === 'h2'\n        ? await connectH2(client, socket)\n        : await connectH1(client, socket)\n    } catch (err) {\n      socket.destroy().on('error', noop)\n      throw err\n    }\n\n    client[kConnecting] = false\n\n    socket[kCounter] = 0\n    socket[kMaxRequests] = client[kMaxRequests]\n    socket[kClient] = client\n    socket[kError] = null\n\n    if (channels.connected.hasSubscribers) {\n      channels.connected.publish({\n        connectParams: {\n          host,\n          hostname,\n          protocol,\n          port,\n          version: client[kHTTPContext]?.version,\n          servername: client[kServerName],\n          localAddress: client[kLocalAddress]\n        },\n        connector: client[kConnector],\n        socket\n      })\n    }\n    client.emit('connect', client[kUrl], [client])\n  } catch (err) {\n    if (client.destroyed) {\n      return\n    }\n\n    client[kConnecting] = false\n\n    if (channels.connectError.hasSubscribers) {\n      channels.connectError.publish({\n        connectParams: {\n          host,\n          hostname,\n          protocol,\n          port,\n          version: client[kHTTPContext]?.version,\n          servername: client[kServerName],\n          localAddress: client[kLocalAddress]\n        },\n        connector: client[kConnector],\n        error: err\n      })\n    }\n\n    if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n      assert(client[kRunning] === 0)\n      while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n        const request = client[kQueue][client[kPendingIdx]++]\n        util.errorRequest(client, request, err)\n      }\n    } else {\n      onError(client, err)\n    }\n\n    client.emit('connectionError', client[kUrl], [client], err)\n  }\n\n  client[kResume]()\n}\n\nfunction emitDrain (client) {\n  client[kNeedDrain] = 0\n  client.emit('drain', client[kUrl], [client])\n}\n\nfunction resume (client, sync) {\n  if (client[kResuming] === 2) {\n    return\n  }\n\n  client[kResuming] = 2\n\n  _resume(client, sync)\n  client[kResuming] = 0\n\n  if (client[kRunningIdx] > 256) {\n    client[kQueue].splice(0, client[kRunningIdx])\n    client[kPendingIdx] -= client[kRunningIdx]\n    client[kRunningIdx] = 0\n  }\n}\n\nfunction _resume (client, sync) {\n  while (true) {\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n      return\n    }\n\n    if (client[kClosedResolve] && !client[kSize]) {\n      client[kClosedResolve]()\n      client[kClosedResolve] = null\n      return\n    }\n\n    if (client[kHTTPContext]) {\n      client[kHTTPContext].resume()\n    }\n\n    if (client[kBusy]) {\n      client[kNeedDrain] = 2\n    } else if (client[kNeedDrain] === 2) {\n      if (sync) {\n        client[kNeedDrain] = 1\n        queueMicrotask(() => emitDrain(client))\n      } else {\n        emitDrain(client)\n      }\n      continue\n    }\n\n    if (client[kPending] === 0) {\n      return\n    }\n\n    if (client[kRunning] >= (getPipelining(client) || 1)) {\n      return\n    }\n\n    const request = client[kQueue][client[kPendingIdx]]\n\n    if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {\n      if (client[kRunning] > 0) {\n        return\n      }\n\n      client[kServerName] = request.servername\n      client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {\n        client[kHTTPContext] = null\n        resume(client)\n      })\n    }\n\n    if (client[kConnecting]) {\n      return\n    }\n\n    if (!client[kHTTPContext]) {\n      connect(client)\n      return\n    }\n\n    if (client[kHTTPContext].destroyed) {\n      return\n    }\n\n    if (client[kHTTPContext].busy(request)) {\n      return\n    }\n\n    if (!request.aborted && client[kHTTPContext].write(request)) {\n      client[kPendingIdx]++\n    } else {\n      client[kQueue].splice(client[kPendingIdx], 1)\n    }\n  }\n}\n\nmodule.exports = Client\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst {\n  ClientDestroyedError,\n  ClientClosedError,\n  InvalidArgumentError\n} = require('../core/errors')\nconst { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require('../core/symbols')\n\nconst kOnDestroyed = Symbol('onDestroyed')\nconst kOnClosed = Symbol('onClosed')\nconst kInterceptedDispatch = Symbol('Intercepted Dispatch')\nconst kWebSocketOptions = Symbol('webSocketOptions')\n\nclass DispatcherBase extends Dispatcher {\n  constructor (opts) {\n    super()\n\n    this[kDestroyed] = false\n    this[kOnDestroyed] = null\n    this[kClosed] = false\n    this[kOnClosed] = []\n    this[kWebSocketOptions] = opts?.webSocket ?? {}\n  }\n\n  get webSocketOptions () {\n    return {\n      maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,\n      maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024\n    }\n  }\n\n  get destroyed () {\n    return this[kDestroyed]\n  }\n\n  get closed () {\n    return this[kClosed]\n  }\n\n  get interceptors () {\n    return this[kInterceptors]\n  }\n\n  set interceptors (newInterceptors) {\n    if (newInterceptors) {\n      for (let i = newInterceptors.length - 1; i >= 0; i--) {\n        const interceptor = this[kInterceptors][i]\n        if (typeof interceptor !== 'function') {\n          throw new InvalidArgumentError('interceptor must be an function')\n        }\n      }\n    }\n\n    this[kInterceptors] = newInterceptors\n  }\n\n  close (callback) {\n    if (callback === undefined) {\n      return new Promise((resolve, reject) => {\n        this.close((err, data) => {\n          return err ? reject(err) : resolve(data)\n        })\n      })\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    if (this[kDestroyed]) {\n      queueMicrotask(() => callback(new ClientDestroyedError(), null))\n      return\n    }\n\n    if (this[kClosed]) {\n      if (this[kOnClosed]) {\n        this[kOnClosed].push(callback)\n      } else {\n        queueMicrotask(() => callback(null, null))\n      }\n      return\n    }\n\n    this[kClosed] = true\n    this[kOnClosed].push(callback)\n\n    const onClosed = () => {\n      const callbacks = this[kOnClosed]\n      this[kOnClosed] = null\n      for (let i = 0; i < callbacks.length; i++) {\n        callbacks[i](null, null)\n      }\n    }\n\n    // Should not error.\n    this[kClose]()\n      .then(() => this.destroy())\n      .then(() => {\n        queueMicrotask(onClosed)\n      })\n  }\n\n  destroy (err, callback) {\n    if (typeof err === 'function') {\n      callback = err\n      err = null\n    }\n\n    if (callback === undefined) {\n      return new Promise((resolve, reject) => {\n        this.destroy(err, (err, data) => {\n          return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)\n        })\n      })\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    if (this[kDestroyed]) {\n      if (this[kOnDestroyed]) {\n        this[kOnDestroyed].push(callback)\n      } else {\n        queueMicrotask(() => callback(null, null))\n      }\n      return\n    }\n\n    if (!err) {\n      err = new ClientDestroyedError()\n    }\n\n    this[kDestroyed] = true\n    this[kOnDestroyed] = this[kOnDestroyed] || []\n    this[kOnDestroyed].push(callback)\n\n    const onDestroyed = () => {\n      const callbacks = this[kOnDestroyed]\n      this[kOnDestroyed] = null\n      for (let i = 0; i < callbacks.length; i++) {\n        callbacks[i](null, null)\n      }\n    }\n\n    // Should not error.\n    this[kDestroy](err).then(() => {\n      queueMicrotask(onDestroyed)\n    })\n  }\n\n  [kInterceptedDispatch] (opts, handler) {\n    if (!this[kInterceptors] || this[kInterceptors].length === 0) {\n      this[kInterceptedDispatch] = this[kDispatch]\n      return this[kDispatch](opts, handler)\n    }\n\n    let dispatch = this[kDispatch].bind(this)\n    for (let i = this[kInterceptors].length - 1; i >= 0; i--) {\n      dispatch = this[kInterceptors][i](dispatch)\n    }\n    this[kInterceptedDispatch] = dispatch\n    return dispatch(opts, handler)\n  }\n\n  dispatch (opts, handler) {\n    if (!handler || typeof handler !== 'object') {\n      throw new InvalidArgumentError('handler must be an object')\n    }\n\n    try {\n      if (!opts || typeof opts !== 'object') {\n        throw new InvalidArgumentError('opts must be an object.')\n      }\n\n      if (this[kDestroyed] || this[kOnDestroyed]) {\n        throw new ClientDestroyedError()\n      }\n\n      if (this[kClosed]) {\n        throw new ClientClosedError()\n      }\n\n      return this[kInterceptedDispatch](opts, handler)\n    } catch (err) {\n      if (typeof handler.onError !== 'function') {\n        throw new InvalidArgumentError('invalid onError method')\n      }\n\n      handler.onError(err)\n\n      return false\n    }\n  }\n}\n\nmodule.exports = DispatcherBase\n","'use strict'\nconst EventEmitter = require('node:events')\n\nclass Dispatcher extends EventEmitter {\n  dispatch () {\n    throw new Error('not implemented')\n  }\n\n  close () {\n    throw new Error('not implemented')\n  }\n\n  destroy () {\n    throw new Error('not implemented')\n  }\n\n  compose (...args) {\n    // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...\n    const interceptors = Array.isArray(args[0]) ? args[0] : args\n    let dispatch = this.dispatch.bind(this)\n\n    for (const interceptor of interceptors) {\n      if (interceptor == null) {\n        continue\n      }\n\n      if (typeof interceptor !== 'function') {\n        throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)\n      }\n\n      dispatch = interceptor(dispatch)\n\n      if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {\n        throw new TypeError('invalid interceptor')\n      }\n    }\n\n    return new ComposedDispatcher(this, dispatch)\n  }\n}\n\nclass ComposedDispatcher extends Dispatcher {\n  #dispatcher = null\n  #dispatch = null\n\n  constructor (dispatcher, dispatch) {\n    super()\n    this.#dispatcher = dispatcher\n    this.#dispatch = dispatch\n  }\n\n  dispatch (...args) {\n    this.#dispatch(...args)\n  }\n\n  close (...args) {\n    return this.#dispatcher.close(...args)\n  }\n\n  destroy (...args) {\n    return this.#dispatcher.destroy(...args)\n  }\n}\n\nmodule.exports = Dispatcher\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require('../core/symbols')\nconst ProxyAgent = require('./proxy-agent')\nconst Agent = require('./agent')\n\nconst DEFAULT_PORTS = {\n  'http:': 80,\n  'https:': 443\n}\n\nlet experimentalWarned = false\n\nclass EnvHttpProxyAgent extends DispatcherBase {\n  #noProxyValue = null\n  #noProxyEntries = null\n  #opts = null\n\n  constructor (opts = {}) {\n    super()\n    this.#opts = opts\n\n    if (!experimentalWarned) {\n      experimentalWarned = true\n      process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', {\n        code: 'UNDICI-EHPA'\n      })\n    }\n\n    const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts\n\n    this[kNoProxyAgent] = new Agent(agentOpts)\n\n    const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY\n    if (HTTP_PROXY) {\n      this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY })\n    } else {\n      this[kHttpProxyAgent] = this[kNoProxyAgent]\n    }\n\n    const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY\n    if (HTTPS_PROXY) {\n      this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY })\n    } else {\n      this[kHttpsProxyAgent] = this[kHttpProxyAgent]\n    }\n\n    this.#parseNoProxy()\n  }\n\n  [kDispatch] (opts, handler) {\n    const url = new URL(opts.origin)\n    const agent = this.#getProxyAgentForUrl(url)\n    return agent.dispatch(opts, handler)\n  }\n\n  async [kClose] () {\n    await this[kNoProxyAgent].close()\n    if (!this[kHttpProxyAgent][kClosed]) {\n      await this[kHttpProxyAgent].close()\n    }\n    if (!this[kHttpsProxyAgent][kClosed]) {\n      await this[kHttpsProxyAgent].close()\n    }\n  }\n\n  async [kDestroy] (err) {\n    await this[kNoProxyAgent].destroy(err)\n    if (!this[kHttpProxyAgent][kDestroyed]) {\n      await this[kHttpProxyAgent].destroy(err)\n    }\n    if (!this[kHttpsProxyAgent][kDestroyed]) {\n      await this[kHttpsProxyAgent].destroy(err)\n    }\n  }\n\n  #getProxyAgentForUrl (url) {\n    let { protocol, host: hostname, port } = url\n\n    // Stripping ports in this way instead of using parsedUrl.hostname to make\n    // sure that the brackets around IPv6 addresses are kept.\n    hostname = hostname.replace(/:\\d*$/, '').toLowerCase()\n    port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0\n    if (!this.#shouldProxy(hostname, port)) {\n      return this[kNoProxyAgent]\n    }\n    if (protocol === 'https:') {\n      return this[kHttpsProxyAgent]\n    }\n    return this[kHttpProxyAgent]\n  }\n\n  #shouldProxy (hostname, port) {\n    if (this.#noProxyChanged) {\n      this.#parseNoProxy()\n    }\n\n    if (this.#noProxyEntries.length === 0) {\n      return true // Always proxy if NO_PROXY is not set or empty.\n    }\n    if (this.#noProxyValue === '*') {\n      return false // Never proxy if wildcard is set.\n    }\n\n    for (let i = 0; i < this.#noProxyEntries.length; i++) {\n      const entry = this.#noProxyEntries[i]\n      if (entry.port && entry.port !== port) {\n        continue // Skip if ports don't match.\n      }\n      if (!/^[.*]/.test(entry.hostname)) {\n        // No wildcards, so don't proxy only if there is not an exact match.\n        if (hostname === entry.hostname) {\n          return false\n        }\n      } else {\n        // Don't proxy if the hostname ends with the no_proxy host.\n        if (hostname.endsWith(entry.hostname.replace(/^\\*/, ''))) {\n          return false\n        }\n      }\n    }\n\n    return true\n  }\n\n  #parseNoProxy () {\n    const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv\n    const noProxySplit = noProxyValue.split(/[,\\s]/)\n    const noProxyEntries = []\n\n    for (let i = 0; i < noProxySplit.length; i++) {\n      const entry = noProxySplit[i]\n      if (!entry) {\n        continue\n      }\n      const parsed = entry.match(/^(.+):(\\d+)$/)\n      noProxyEntries.push({\n        hostname: (parsed ? parsed[1] : entry).toLowerCase(),\n        port: parsed ? Number.parseInt(parsed[2], 10) : 0\n      })\n    }\n\n    this.#noProxyValue = noProxyValue\n    this.#noProxyEntries = noProxyEntries\n  }\n\n  get #noProxyChanged () {\n    if (this.#opts.noProxy !== undefined) {\n      return false\n    }\n    return this.#noProxyValue !== this.#noProxyEnv\n  }\n\n  get #noProxyEnv () {\n    return process.env.no_proxy ?? process.env.NO_PROXY ?? ''\n  }\n}\n\nmodule.exports = EnvHttpProxyAgent\n","/* eslint-disable */\n\n'use strict'\n\n// Extracted from node/lib/internal/fixed_queue.js\n\n// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.\nconst kSize = 2048;\nconst kMask = kSize - 1;\n\n// The FixedQueue is implemented as a singly-linked list of fixed-size\n// circular buffers. It looks something like this:\n//\n//  head                                                       tail\n//    |                                                          |\n//    v                                                          v\n// +-----------+ <-----\\       +-----------+ <------\\         +-----------+\n// |  [null]   |        \\----- |   next    |         \\------- |   next    |\n// +-----------+               +-----------+                  +-----------+\n// |   item    | <-- bottom    |   item    | <-- bottom       |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |       bottom --> |   item    |\n// |   item    |               |   item    |                  |   item    |\n// |    ...    |               |    ...    |                  |    ...    |\n// |   item    |               |   item    |                  |   item    |\n// |   item    |               |   item    |                  |   item    |\n// |  [empty]  | <-- top       |   item    |                  |   item    |\n// |  [empty]  |               |   item    |                  |   item    |\n// |  [empty]  |               |  [empty]  | <-- top  top --> |  [empty]  |\n// +-----------+               +-----------+                  +-----------+\n//\n// Or, if there is only one circular buffer, it looks something\n// like either of these:\n//\n//  head   tail                                 head   tail\n//    |     |                                     |     |\n//    v     v                                     v     v\n// +-----------+                               +-----------+\n// |  [null]   |                               |  [null]   |\n// +-----------+                               +-----------+\n// |  [empty]  |                               |   item    |\n// |  [empty]  |                               |   item    |\n// |   item    | <-- bottom            top --> |  [empty]  |\n// |   item    |                               |  [empty]  |\n// |  [empty]  | <-- top            bottom --> |   item    |\n// |  [empty]  |                               |   item    |\n// +-----------+                               +-----------+\n//\n// Adding a value means moving `top` forward by one, removing means\n// moving `bottom` forward by one. After reaching the end, the queue\n// wraps around.\n//\n// When `top === bottom` the current queue is empty and when\n// `top + 1 === bottom` it's full. This wastes a single space of storage\n// but allows much quicker checks.\n\nclass FixedCircularBuffer {\n  constructor() {\n    this.bottom = 0;\n    this.top = 0;\n    this.list = new Array(kSize);\n    this.next = null;\n  }\n\n  isEmpty() {\n    return this.top === this.bottom;\n  }\n\n  isFull() {\n    return ((this.top + 1) & kMask) === this.bottom;\n  }\n\n  push(data) {\n    this.list[this.top] = data;\n    this.top = (this.top + 1) & kMask;\n  }\n\n  shift() {\n    const nextItem = this.list[this.bottom];\n    if (nextItem === undefined)\n      return null;\n    this.list[this.bottom] = undefined;\n    this.bottom = (this.bottom + 1) & kMask;\n    return nextItem;\n  }\n}\n\nmodule.exports = class FixedQueue {\n  constructor() {\n    this.head = this.tail = new FixedCircularBuffer();\n  }\n\n  isEmpty() {\n    return this.head.isEmpty();\n  }\n\n  push(data) {\n    if (this.head.isFull()) {\n      // Head is full: Creates a new queue, sets the old queue's `.next` to it,\n      // and sets it as the new main queue.\n      this.head = this.head.next = new FixedCircularBuffer();\n    }\n    this.head.push(data);\n  }\n\n  shift() {\n    const tail = this.tail;\n    const next = tail.shift();\n    if (tail.isEmpty() && tail.next !== null) {\n      // If there is another queue, it forms the new tail.\n      this.tail = tail.next;\n    }\n    return next;\n  }\n};\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst FixedQueue = require('./fixed-queue')\nconst { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('../core/symbols')\nconst PoolStats = require('./pool-stats')\n\nconst kClients = Symbol('clients')\nconst kNeedDrain = Symbol('needDrain')\nconst kQueue = Symbol('queue')\nconst kClosedResolve = Symbol('closed resolve')\nconst kOnDrain = Symbol('onDrain')\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kGetDispatcher = Symbol('get dispatcher')\nconst kAddClient = Symbol('add client')\nconst kRemoveClient = Symbol('remove client')\nconst kStats = Symbol('stats')\n\nclass PoolBase extends DispatcherBase {\n  constructor (opts) {\n    super(opts)\n\n    this[kQueue] = new FixedQueue()\n    this[kClients] = []\n    this[kQueued] = 0\n\n    const pool = this\n\n    this[kOnDrain] = function onDrain (origin, targets) {\n      const queue = pool[kQueue]\n\n      let needDrain = false\n\n      while (!needDrain) {\n        const item = queue.shift()\n        if (!item) {\n          break\n        }\n        pool[kQueued]--\n        needDrain = !this.dispatch(item.opts, item.handler)\n      }\n\n      this[kNeedDrain] = needDrain\n\n      if (!this[kNeedDrain] && pool[kNeedDrain]) {\n        pool[kNeedDrain] = false\n        pool.emit('drain', origin, [pool, ...targets])\n      }\n\n      if (pool[kClosedResolve] && queue.isEmpty()) {\n        Promise\n          .all(pool[kClients].map(c => c.close()))\n          .then(pool[kClosedResolve])\n      }\n    }\n\n    this[kOnConnect] = (origin, targets) => {\n      pool.emit('connect', origin, [pool, ...targets])\n    }\n\n    this[kOnDisconnect] = (origin, targets, err) => {\n      pool.emit('disconnect', origin, [pool, ...targets], err)\n    }\n\n    this[kOnConnectionError] = (origin, targets, err) => {\n      pool.emit('connectionError', origin, [pool, ...targets], err)\n    }\n\n    this[kStats] = new PoolStats(this)\n  }\n\n  get [kBusy] () {\n    return this[kNeedDrain]\n  }\n\n  get [kConnected] () {\n    return this[kClients].filter(client => client[kConnected]).length\n  }\n\n  get [kFree] () {\n    return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length\n  }\n\n  get [kPending] () {\n    let ret = this[kQueued]\n    for (const { [kPending]: pending } of this[kClients]) {\n      ret += pending\n    }\n    return ret\n  }\n\n  get [kRunning] () {\n    let ret = 0\n    for (const { [kRunning]: running } of this[kClients]) {\n      ret += running\n    }\n    return ret\n  }\n\n  get [kSize] () {\n    let ret = this[kQueued]\n    for (const { [kSize]: size } of this[kClients]) {\n      ret += size\n    }\n    return ret\n  }\n\n  get stats () {\n    return this[kStats]\n  }\n\n  async [kClose] () {\n    if (this[kQueue].isEmpty()) {\n      await Promise.all(this[kClients].map(c => c.close()))\n    } else {\n      await new Promise((resolve) => {\n        this[kClosedResolve] = resolve\n      })\n    }\n  }\n\n  async [kDestroy] (err) {\n    while (true) {\n      const item = this[kQueue].shift()\n      if (!item) {\n        break\n      }\n      item.handler.onError(err)\n    }\n\n    await Promise.all(this[kClients].map(c => c.destroy(err)))\n  }\n\n  [kDispatch] (opts, handler) {\n    const dispatcher = this[kGetDispatcher]()\n\n    if (!dispatcher) {\n      this[kNeedDrain] = true\n      this[kQueue].push({ opts, handler })\n      this[kQueued]++\n    } else if (!dispatcher.dispatch(opts, handler)) {\n      dispatcher[kNeedDrain] = true\n      this[kNeedDrain] = !this[kGetDispatcher]()\n    }\n\n    return !this[kNeedDrain]\n  }\n\n  [kAddClient] (client) {\n    client\n      .on('drain', this[kOnDrain])\n      .on('connect', this[kOnConnect])\n      .on('disconnect', this[kOnDisconnect])\n      .on('connectionError', this[kOnConnectionError])\n\n    this[kClients].push(client)\n\n    if (this[kNeedDrain]) {\n      queueMicrotask(() => {\n        if (this[kNeedDrain]) {\n          this[kOnDrain](client[kUrl], [this, client])\n        }\n      })\n    }\n\n    return this\n  }\n\n  [kRemoveClient] (client) {\n    client.close(() => {\n      const idx = this[kClients].indexOf(client)\n      if (idx !== -1) {\n        this[kClients].splice(idx, 1)\n      }\n    })\n\n    this[kNeedDrain] = this[kClients].some(dispatcher => (\n      !dispatcher[kNeedDrain] &&\n      dispatcher.closed !== true &&\n      dispatcher.destroyed !== true\n    ))\n  }\n}\n\nmodule.exports = {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kRemoveClient,\n  kGetDispatcher\n}\n","const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('../core/symbols')\nconst kPool = Symbol('pool')\n\nclass PoolStats {\n  constructor (pool) {\n    this[kPool] = pool\n  }\n\n  get connected () {\n    return this[kPool][kConnected]\n  }\n\n  get free () {\n    return this[kPool][kFree]\n  }\n\n  get pending () {\n    return this[kPool][kPending]\n  }\n\n  get queued () {\n    return this[kPool][kQueued]\n  }\n\n  get running () {\n    return this[kPool][kRunning]\n  }\n\n  get size () {\n    return this[kPool][kSize]\n  }\n}\n\nmodule.exports = PoolStats\n","'use strict'\n\nconst {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kGetDispatcher\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n  InvalidArgumentError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst buildConnector = require('../core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\n\nfunction defaultFactory (origin, opts) {\n  return new Client(origin, opts)\n}\n\nclass Pool extends PoolBase {\n  constructor (origin, {\n    connections,\n    factory = defaultFactory,\n    connect,\n    connectTimeout,\n    tls,\n    maxCachedSessions,\n    socketPath,\n    autoSelectFamily,\n    autoSelectFamilyAttemptTimeout,\n    allowH2,\n    ...options\n  } = {}) {\n    if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n      throw new InvalidArgumentError('invalid connections')\n    }\n\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (typeof connect !== 'function') {\n      connect = buildConnector({\n        ...tls,\n        maxCachedSessions,\n        allowH2,\n        socketPath,\n        timeout: connectTimeout,\n        ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n        ...connect\n      })\n    }\n\n    super(options)\n\n    this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool)\n      ? options.interceptors.Pool\n      : []\n    this[kConnections] = connections || null\n    this[kUrl] = util.parseOrigin(origin)\n    this[kOptions] = { ...util.deepClone(options), connect, allowH2 }\n    this[kOptions].interceptors = options.interceptors\n      ? { ...options.interceptors }\n      : undefined\n    this[kFactory] = factory\n\n    this.on('connectionError', (origin, targets, error) => {\n      // If a connection error occurs, we remove the client from the pool,\n      // and emit a connectionError event. They will not be re-used.\n      // Fixes https://github.com/nodejs/undici/issues/3895\n      for (const target of targets) {\n        // Do not use kRemoveClient here, as it will close the client,\n        // but the client cannot be closed in this state.\n        const idx = this[kClients].indexOf(target)\n        if (idx !== -1) {\n          this[kClients].splice(idx, 1)\n        }\n      }\n    })\n  }\n\n  [kGetDispatcher] () {\n    for (const client of this[kClients]) {\n      if (!client[kNeedDrain]) {\n        return client\n      }\n    }\n\n    if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n      const dispatcher = this[kFactory](this[kUrl], this[kOptions])\n      this[kAddClient](dispatcher)\n      return dispatcher\n    }\n  }\n}\n\nmodule.exports = Pool\n","'use strict'\n\nconst { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst { URL } = require('node:url')\nconst Agent = require('./agent')\nconst Pool = require('./pool')\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors')\nconst buildConnector = require('../core/connect')\nconst Client = require('./client')\n\nconst kAgent = Symbol('proxy agent')\nconst kClient = Symbol('proxy client')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kRequestTls = Symbol('request tls settings')\nconst kProxyTls = Symbol('proxy tls settings')\nconst kConnectEndpoint = Symbol('connect endpoint function')\nconst kTunnelProxy = Symbol('tunnel proxy')\n\nfunction defaultProtocolPort (protocol) {\n  return protocol === 'https:' ? 443 : 80\n}\n\nfunction defaultFactory (origin, opts) {\n  return new Pool(origin, opts)\n}\n\nconst noop = () => {}\n\nfunction defaultAgentFactory (origin, opts) {\n  if (opts.connections === 1) {\n    return new Client(origin, opts)\n  }\n  return new Pool(origin, opts)\n}\n\nclass Http1ProxyWrapper extends DispatcherBase {\n  #client\n\n  constructor (proxyUrl, { headers = {}, connect, factory }) {\n    super()\n    if (!proxyUrl) {\n      throw new InvalidArgumentError('Proxy URL is mandatory')\n    }\n\n    this[kProxyHeaders] = headers\n    if (factory) {\n      this.#client = factory(proxyUrl, { connect })\n    } else {\n      this.#client = new Client(proxyUrl, { connect })\n    }\n  }\n\n  [kDispatch] (opts, handler) {\n    const onHeaders = handler.onHeaders\n    handler.onHeaders = function (statusCode, data, resume) {\n      if (statusCode === 407) {\n        if (typeof handler.onError === 'function') {\n          handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)'))\n        }\n        return\n      }\n      if (onHeaders) onHeaders.call(this, statusCode, data, resume)\n    }\n\n    // Rewrite request as an HTTP1 Proxy request, without tunneling.\n    const {\n      origin,\n      path = '/',\n      headers = {}\n    } = opts\n\n    opts.path = origin + path\n\n    if (!('host' in headers) && !('Host' in headers)) {\n      const { host } = new URL(origin)\n      headers.host = host\n    }\n    opts.headers = { ...this[kProxyHeaders], ...headers }\n\n    return this.#client[kDispatch](opts, handler)\n  }\n\n  async [kClose] () {\n    return this.#client.close()\n  }\n\n  async [kDestroy] (err) {\n    return this.#client.destroy(err)\n  }\n}\n\nclass ProxyAgent extends DispatcherBase {\n  constructor (opts) {\n    super()\n\n    if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) {\n      throw new InvalidArgumentError('Proxy uri is mandatory')\n    }\n\n    const { clientFactory = defaultFactory } = opts\n    if (typeof clientFactory !== 'function') {\n      throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')\n    }\n\n    const { proxyTunnel = true } = opts\n\n    const url = this.#getUrl(opts)\n    const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url\n\n    this[kProxy] = { uri: href, protocol }\n    this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)\n      ? opts.interceptors.ProxyAgent\n      : []\n    this[kRequestTls] = opts.requestTls\n    this[kProxyTls] = opts.proxyTls\n    this[kProxyHeaders] = opts.headers || {}\n    this[kTunnelProxy] = proxyTunnel\n\n    if (opts.auth && opts.token) {\n      throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')\n    } else if (opts.auth) {\n      /* @deprecated in favour of opts.token */\n      this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`\n    } else if (opts.token) {\n      this[kProxyHeaders]['proxy-authorization'] = opts.token\n    } else if (username && password) {\n      this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`\n    }\n\n    const connect = buildConnector({ ...opts.proxyTls })\n    this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })\n\n    const agentFactory = opts.factory || defaultAgentFactory\n    const factory = (origin, options) => {\n      const { protocol } = new URL(origin)\n      if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') {\n        return new Http1ProxyWrapper(this[kProxy].uri, {\n          headers: this[kProxyHeaders],\n          connect,\n          factory: agentFactory\n        })\n      }\n      return agentFactory(origin, options)\n    }\n    this[kClient] = clientFactory(url, { connect })\n    this[kAgent] = new Agent({\n      ...opts,\n      factory,\n      connect: async (opts, callback) => {\n        let requestedPath = opts.host\n        if (!opts.port) {\n          requestedPath += `:${defaultProtocolPort(opts.protocol)}`\n        }\n        try {\n          const { socket, statusCode } = await this[kClient].connect({\n            origin,\n            port,\n            path: requestedPath,\n            signal: opts.signal,\n            headers: {\n              ...this[kProxyHeaders],\n              host: opts.host\n            },\n            servername: this[kProxyTls]?.servername || proxyHostname\n          })\n          if (statusCode !== 200) {\n            socket.on('error', noop).destroy()\n            callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))\n          }\n          if (opts.protocol !== 'https:') {\n            callback(null, socket)\n            return\n          }\n          let servername\n          if (this[kRequestTls]) {\n            servername = this[kRequestTls].servername\n          } else {\n            servername = opts.servername\n          }\n          this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)\n        } catch (err) {\n          if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n            // Throw a custom error to avoid loop in client.js#connect\n            callback(new SecureProxyConnectionError(err))\n          } else {\n            callback(err)\n          }\n        }\n      }\n    })\n  }\n\n  dispatch (opts, handler) {\n    const headers = buildHeaders(opts.headers)\n    throwIfProxyAuthIsSent(headers)\n\n    if (headers && !('host' in headers) && !('Host' in headers)) {\n      const { host } = new URL(opts.origin)\n      headers.host = host\n    }\n\n    return this[kAgent].dispatch(\n      {\n        ...opts,\n        headers\n      },\n      handler\n    )\n  }\n\n  /**\n   * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts\n   * @returns {URL}\n   */\n  #getUrl (opts) {\n    if (typeof opts === 'string') {\n      return new URL(opts)\n    } else if (opts instanceof URL) {\n      return opts\n    } else {\n      return new URL(opts.uri)\n    }\n  }\n\n  async [kClose] () {\n    await this[kAgent].close()\n    await this[kClient].close()\n  }\n\n  async [kDestroy] () {\n    await this[kAgent].destroy()\n    await this[kClient].destroy()\n  }\n}\n\n/**\n * @param {string[] | Record} headers\n * @returns {Record}\n */\nfunction buildHeaders (headers) {\n  // When using undici.fetch, the headers list is stored\n  // as an array.\n  if (Array.isArray(headers)) {\n    /** @type {Record} */\n    const headersPair = {}\n\n    for (let i = 0; i < headers.length; i += 2) {\n      headersPair[headers[i]] = headers[i + 1]\n    }\n\n    return headersPair\n  }\n\n  return headers\n}\n\n/**\n * @param {Record} headers\n *\n * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers\n * Nevertheless, it was changed and to avoid a security vulnerability by end users\n * this check was created.\n * It should be removed in the next major version for performance reasons\n */\nfunction throwIfProxyAuthIsSent (headers) {\n  const existProxyAuth = headers && Object.keys(headers)\n    .find((key) => key.toLowerCase() === 'proxy-authorization')\n  if (existProxyAuth) {\n    throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')\n  }\n}\n\nmodule.exports = ProxyAgent\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst RetryHandler = require('../handler/retry-handler')\n\nclass RetryAgent extends Dispatcher {\n  #agent = null\n  #options = null\n  constructor (agent, options = {}) {\n    super(options)\n    this.#agent = agent\n    this.#options = options\n  }\n\n  dispatch (opts, handler) {\n    const retry = new RetryHandler({\n      ...opts,\n      retryOptions: this.#options\n    }, {\n      dispatch: this.#agent.dispatch.bind(this.#agent),\n      handler\n    })\n    return this.#agent.dispatch(opts, retry)\n  }\n\n  close () {\n    return this.#agent.close()\n  }\n\n  destroy () {\n    return this.#agent.destroy()\n  }\n}\n\nmodule.exports = RetryAgent\n","'use strict'\n\n// We include a version number for the Dispatcher API. In case of breaking changes,\n// this version number must be increased to avoid conflicts.\nconst globalDispatcher = Symbol.for('undici.globalDispatcher.1')\nconst { InvalidArgumentError } = require('./core/errors')\nconst Agent = require('./dispatcher/agent')\n\nif (getGlobalDispatcher() === undefined) {\n  setGlobalDispatcher(new Agent())\n}\n\nfunction setGlobalDispatcher (agent) {\n  if (!agent || typeof agent.dispatch !== 'function') {\n    throw new InvalidArgumentError('Argument agent must implement Agent')\n  }\n  Object.defineProperty(globalThis, globalDispatcher, {\n    value: agent,\n    writable: true,\n    enumerable: false,\n    configurable: false\n  })\n}\n\nfunction getGlobalDispatcher () {\n  return globalThis[globalDispatcher]\n}\n\nmodule.exports = {\n  setGlobalDispatcher,\n  getGlobalDispatcher\n}\n","'use strict'\n\nmodule.exports = class DecoratorHandler {\n  #handler\n\n  constructor (handler) {\n    if (typeof handler !== 'object' || handler === null) {\n      throw new TypeError('handler must be an object')\n    }\n    this.#handler = handler\n  }\n\n  onConnect (...args) {\n    return this.#handler.onConnect?.(...args)\n  }\n\n  onError (...args) {\n    return this.#handler.onError?.(...args)\n  }\n\n  onUpgrade (...args) {\n    return this.#handler.onUpgrade?.(...args)\n  }\n\n  onResponseStarted (...args) {\n    return this.#handler.onResponseStarted?.(...args)\n  }\n\n  onHeaders (...args) {\n    return this.#handler.onHeaders?.(...args)\n  }\n\n  onData (...args) {\n    return this.#handler.onData?.(...args)\n  }\n\n  onComplete (...args) {\n    return this.#handler.onComplete?.(...args)\n  }\n\n  onBodySent (...args) {\n    return this.#handler.onBodySent?.(...args)\n  }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('node:assert')\nconst { InvalidArgumentError } = require('../core/errors')\nconst EE = require('node:events')\n\nconst redirectableStatusCodes = [300, 301, 302, 303, 307, 308]\n\nconst kBody = Symbol('body')\n\nclass BodyAsyncIterable {\n  constructor (body) {\n    this[kBody] = body\n    this[kBodyUsed] = false\n  }\n\n  async * [Symbol.asyncIterator] () {\n    assert(!this[kBodyUsed], 'disturbed')\n    this[kBodyUsed] = true\n    yield * this[kBody]\n  }\n}\n\nclass RedirectHandler {\n  constructor (dispatch, maxRedirections, opts, handler) {\n    if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    util.validateHandler(handler, opts.method, opts.upgrade)\n\n    this.dispatch = dispatch\n    this.location = null\n    this.abort = null\n    this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy\n    this.maxRedirections = maxRedirections\n    this.handler = handler\n    this.history = []\n    this.redirectionLimitReached = false\n\n    if (util.isStream(this.opts.body)) {\n      // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n      // so that it can be dispatched again?\n      // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n      if (util.bodyLength(this.opts.body) === 0) {\n        this.opts.body\n          .on('data', function () {\n            assert(false)\n          })\n      }\n\n      if (typeof this.opts.body.readableDidRead !== 'boolean') {\n        this.opts.body[kBodyUsed] = false\n        EE.prototype.on.call(this.opts.body, 'data', function () {\n          this[kBodyUsed] = true\n        })\n      }\n    } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {\n      // TODO (fix): We can't access ReadableStream internal state\n      // to determine whether or not it has been disturbed. This is just\n      // a workaround.\n      this.opts.body = new BodyAsyncIterable(this.opts.body)\n    } else if (\n      this.opts.body &&\n      typeof this.opts.body !== 'string' &&\n      !ArrayBuffer.isView(this.opts.body) &&\n      util.isIterable(this.opts.body)\n    ) {\n      // TODO: Should we allow re-using iterable if !this.opts.idempotent\n      // or through some other flag?\n      this.opts.body = new BodyAsyncIterable(this.opts.body)\n    }\n  }\n\n  onConnect (abort) {\n    this.abort = abort\n    this.handler.onConnect(abort, { history: this.history })\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    this.handler.onUpgrade(statusCode, headers, socket)\n  }\n\n  onError (error) {\n    this.handler.onError(error)\n  }\n\n  onHeaders (statusCode, headers, resume, statusText) {\n    this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)\n      ? null\n      : parseLocation(statusCode, headers)\n\n    if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {\n      if (this.request) {\n        this.request.abort(new Error('max redirects'))\n      }\n\n      this.redirectionLimitReached = true\n      this.abort(new Error('max redirects'))\n      return\n    }\n\n    if (this.opts.origin) {\n      this.history.push(new URL(this.opts.path, this.opts.origin))\n    }\n\n    if (!this.location) {\n      return this.handler.onHeaders(statusCode, headers, resume, statusText)\n    }\n\n    const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))\n    const path = search ? `${pathname}${search}` : pathname\n\n    // Remove headers referring to the original URL.\n    // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.\n    // https://tools.ietf.org/html/rfc7231#section-6.4\n    this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)\n    this.opts.path = path\n    this.opts.origin = origin\n    this.opts.maxRedirections = 0\n    this.opts.query = null\n\n    // https://tools.ietf.org/html/rfc7231#section-6.4.4\n    // In case of HTTP 303, always replace method to be either HEAD or GET\n    if (statusCode === 303 && this.opts.method !== 'HEAD') {\n      this.opts.method = 'GET'\n      this.opts.body = null\n    }\n  }\n\n  onData (chunk) {\n    if (this.location) {\n      /*\n        https://tools.ietf.org/html/rfc7231#section-6.4\n\n        TLDR: undici always ignores 3xx response bodies.\n\n        Redirection is used to serve the requested resource from another URL, so it is assumes that\n        no body is generated (and thus can be ignored). Even though generating a body is not prohibited.\n\n        For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually\n        (which means it's optional and not mandated) contain just an hyperlink to the value of\n        the Location response header, so the body can be ignored safely.\n\n        For status 300, which is \"Multiple Choices\", the spec mentions both generating a Location\n        response header AND a response body with the other possible location to follow.\n        Since the spec explicitly chooses not to specify a format for such body and leave it to\n        servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.\n      */\n    } else {\n      return this.handler.onData(chunk)\n    }\n  }\n\n  onComplete (trailers) {\n    if (this.location) {\n      /*\n        https://tools.ietf.org/html/rfc7231#section-6.4\n\n        TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections\n        and neither are useful if present.\n\n        See comment on onData method above for more detailed information.\n      */\n\n      this.location = null\n      this.abort = null\n\n      this.dispatch(this.opts, this)\n    } else {\n      this.handler.onComplete(trailers)\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this.handler.onBodySent) {\n      this.handler.onBodySent(chunk)\n    }\n  }\n}\n\nfunction parseLocation (statusCode, headers) {\n  if (redirectableStatusCodes.indexOf(statusCode) === -1) {\n    return null\n  }\n\n  for (let i = 0; i < headers.length; i += 2) {\n    if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') {\n      return headers[i + 1]\n    }\n  }\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4.4\nfunction shouldRemoveHeader (header, removeContent, unknownOrigin) {\n  if (header.length === 4) {\n    return util.headerNameToString(header) === 'host'\n  }\n  if (removeContent && util.headerNameToString(header).startsWith('content-')) {\n    return true\n  }\n  if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {\n    const name = util.headerNameToString(header)\n    return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'\n  }\n  return false\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4\nfunction cleanRequestHeaders (headers, removeContent, unknownOrigin) {\n  const ret = []\n  if (Array.isArray(headers)) {\n    for (let i = 0; i < headers.length; i += 2) {\n      if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n        ret.push(headers[i], headers[i + 1])\n      }\n    }\n  } else if (headers && typeof headers === 'object') {\n    for (const key of Object.keys(headers)) {\n      if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n        ret.push(key, headers[key])\n      }\n    }\n  } else {\n    assert(headers == null, 'headers must be an object or an array')\n  }\n  return ret\n}\n\nmodule.exports = RedirectHandler\n","'use strict'\nconst assert = require('node:assert')\n\nconst { kRetryHandlerDefaultRetry } = require('../core/symbols')\nconst { RequestRetryError } = require('../core/errors')\nconst {\n  isDisturbed,\n  parseHeaders,\n  parseRangeHeader,\n  wrapRequestBody\n} = require('../core/util')\n\nfunction calculateRetryAfterHeader (retryAfter) {\n  const current = Date.now()\n  return new Date(retryAfter).getTime() - current\n}\n\nclass RetryHandler {\n  constructor (opts, handlers) {\n    const { retryOptions, ...dispatchOpts } = opts\n    const {\n      // Retry scoped\n      retry: retryFn,\n      maxRetries,\n      maxTimeout,\n      minTimeout,\n      timeoutFactor,\n      // Response scoped\n      methods,\n      errorCodes,\n      retryAfter,\n      statusCodes\n    } = retryOptions ?? {}\n\n    this.dispatch = handlers.dispatch\n    this.handler = handlers.handler\n    this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }\n    this.abort = null\n    this.aborted = false\n    this.retryOpts = {\n      retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],\n      retryAfter: retryAfter ?? true,\n      maxTimeout: maxTimeout ?? 30 * 1000, // 30s,\n      minTimeout: minTimeout ?? 500, // .5s\n      timeoutFactor: timeoutFactor ?? 2,\n      maxRetries: maxRetries ?? 5,\n      // What errors we should retry\n      methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],\n      // Indicates which errors to retry\n      statusCodes: statusCodes ?? [500, 502, 503, 504, 429],\n      // List of errors to retry\n      errorCodes: errorCodes ?? [\n        'ECONNRESET',\n        'ECONNREFUSED',\n        'ENOTFOUND',\n        'ENETDOWN',\n        'ENETUNREACH',\n        'EHOSTDOWN',\n        'EHOSTUNREACH',\n        'EPIPE',\n        'UND_ERR_SOCKET'\n      ]\n    }\n\n    this.retryCount = 0\n    this.retryCountCheckpoint = 0\n    this.start = 0\n    this.end = null\n    this.etag = null\n    this.resume = null\n\n    // Handle possible onConnect duplication\n    this.handler.onConnect(reason => {\n      this.aborted = true\n      if (this.abort) {\n        this.abort(reason)\n      } else {\n        this.reason = reason\n      }\n    })\n  }\n\n  onRequestSent () {\n    if (this.handler.onRequestSent) {\n      this.handler.onRequestSent()\n    }\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    if (this.handler.onUpgrade) {\n      this.handler.onUpgrade(statusCode, headers, socket)\n    }\n  }\n\n  onConnect (abort) {\n    if (this.aborted) {\n      abort(this.reason)\n    } else {\n      this.abort = abort\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this.handler.onBodySent) return this.handler.onBodySent(chunk)\n  }\n\n  static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {\n    const { statusCode, code, headers } = err\n    const { method, retryOptions } = opts\n    const {\n      maxRetries,\n      minTimeout,\n      maxTimeout,\n      timeoutFactor,\n      statusCodes,\n      errorCodes,\n      methods\n    } = retryOptions\n    const { counter } = state\n\n    // Any code that is not a Undici's originated and allowed to retry\n    if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) {\n      cb(err)\n      return\n    }\n\n    // If a set of method are provided and the current method is not in the list\n    if (Array.isArray(methods) && !methods.includes(method)) {\n      cb(err)\n      return\n    }\n\n    // If a set of status code are provided and the current status code is not in the list\n    if (\n      statusCode != null &&\n      Array.isArray(statusCodes) &&\n      !statusCodes.includes(statusCode)\n    ) {\n      cb(err)\n      return\n    }\n\n    // If we reached the max number of retries\n    if (counter > maxRetries) {\n      cb(err)\n      return\n    }\n\n    let retryAfterHeader = headers?.['retry-after']\n    if (retryAfterHeader) {\n      retryAfterHeader = Number(retryAfterHeader)\n      retryAfterHeader = Number.isNaN(retryAfterHeader)\n        ? calculateRetryAfterHeader(retryAfterHeader)\n        : retryAfterHeader * 1e3 // Retry-After is in seconds\n    }\n\n    const retryTimeout =\n      retryAfterHeader > 0\n        ? Math.min(retryAfterHeader, maxTimeout)\n        : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)\n\n    setTimeout(() => cb(null), retryTimeout)\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const headers = parseHeaders(rawHeaders)\n\n    this.retryCount += 1\n\n    if (statusCode >= 300) {\n      if (this.retryOpts.statusCodes.includes(statusCode) === false) {\n        return this.handler.onHeaders(\n          statusCode,\n          rawHeaders,\n          resume,\n          statusMessage\n        )\n      } else {\n        this.abort(\n          new RequestRetryError('Request failed', statusCode, {\n            headers,\n            data: {\n              count: this.retryCount\n            }\n          })\n        )\n        return false\n      }\n    }\n\n    // Checkpoint for resume from where we left it\n    if (this.resume != null) {\n      this.resume = null\n\n      // Only Partial Content 206 supposed to provide Content-Range,\n      // any other status code that partially consumed the payload\n      // should not be retry because it would result in downstream\n      // wrongly concatanete multiple responses.\n      if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {\n        this.abort(\n          new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      const contentRange = parseRangeHeader(headers['content-range'])\n      // If no content range\n      if (!contentRange) {\n        this.abort(\n          new RequestRetryError('Content-Range mismatch', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      // Let's start with a weak etag check\n      if (this.etag != null && this.etag !== headers.etag) {\n        this.abort(\n          new RequestRetryError('ETag mismatch', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      const { start, size, end = size - 1 } = contentRange\n\n      assert(this.start === start, 'content-range mismatch')\n      assert(this.end == null || this.end === end, 'content-range mismatch')\n\n      this.resume = resume\n      return true\n    }\n\n    if (this.end == null) {\n      if (statusCode === 206) {\n        // First time we receive 206\n        const range = parseRangeHeader(headers['content-range'])\n\n        if (range == null) {\n          return this.handler.onHeaders(\n            statusCode,\n            rawHeaders,\n            resume,\n            statusMessage\n          )\n        }\n\n        const { start, size, end = size - 1 } = range\n        assert(\n          start != null && Number.isFinite(start),\n          'content-range mismatch'\n        )\n        assert(end != null && Number.isFinite(end), 'invalid content-length')\n\n        this.start = start\n        this.end = end\n      }\n\n      // We make our best to checkpoint the body for further range headers\n      if (this.end == null) {\n        const contentLength = headers['content-length']\n        this.end = contentLength != null ? Number(contentLength) - 1 : null\n      }\n\n      assert(Number.isFinite(this.start))\n      assert(\n        this.end == null || Number.isFinite(this.end),\n        'invalid content-length'\n      )\n\n      this.resume = resume\n      this.etag = headers.etag != null ? headers.etag : null\n\n      // Weak etags are not useful for comparison nor cache\n      // for instance not safe to assume if the response is byte-per-byte\n      // equal\n      if (this.etag != null && this.etag.startsWith('W/')) {\n        this.etag = null\n      }\n\n      return this.handler.onHeaders(\n        statusCode,\n        rawHeaders,\n        resume,\n        statusMessage\n      )\n    }\n\n    const err = new RequestRetryError('Request failed', statusCode, {\n      headers,\n      data: { count: this.retryCount }\n    })\n\n    this.abort(err)\n\n    return false\n  }\n\n  onData (chunk) {\n    this.start += chunk.length\n\n    return this.handler.onData(chunk)\n  }\n\n  onComplete (rawTrailers) {\n    this.retryCount = 0\n    return this.handler.onComplete(rawTrailers)\n  }\n\n  onError (err) {\n    if (this.aborted || isDisturbed(this.opts.body)) {\n      return this.handler.onError(err)\n    }\n\n    // We reconcile in case of a mix between network errors\n    // and server error response\n    if (this.retryCount - this.retryCountCheckpoint > 0) {\n      // We count the difference between the last checkpoint and the current retry count\n      this.retryCount =\n        this.retryCountCheckpoint +\n        (this.retryCount - this.retryCountCheckpoint)\n    } else {\n      this.retryCount += 1\n    }\n\n    this.retryOpts.retry(\n      err,\n      {\n        state: { counter: this.retryCount },\n        opts: { retryOptions: this.retryOpts, ...this.opts }\n      },\n      onRetry.bind(this)\n    )\n\n    function onRetry (err) {\n      if (err != null || this.aborted || isDisturbed(this.opts.body)) {\n        return this.handler.onError(err)\n      }\n\n      if (this.start !== 0) {\n        const headers = { range: `bytes=${this.start}-${this.end ?? ''}` }\n\n        // Weak etag check - weak etags will make comparison algorithms never match\n        if (this.etag != null) {\n          headers['if-match'] = this.etag\n        }\n\n        this.opts = {\n          ...this.opts,\n          headers: {\n            ...this.opts.headers,\n            ...headers\n          }\n        }\n      }\n\n      try {\n        this.retryCountCheckpoint = this.retryCount\n        this.dispatch(this.opts, this)\n      } catch (err) {\n        this.handler.onError(err)\n      }\n    }\n  }\n}\n\nmodule.exports = RetryHandler\n","'use strict'\nconst { isIP } = require('node:net')\nconst { lookup } = require('node:dns')\nconst DecoratorHandler = require('../handler/decorator-handler')\nconst { InvalidArgumentError, InformationalError } = require('../core/errors')\nconst maxInt = Math.pow(2, 31) - 1\n\nclass DNSInstance {\n  #maxTTL = 0\n  #maxItems = 0\n  #records = new Map()\n  dualStack = true\n  affinity = null\n  lookup = null\n  pick = null\n\n  constructor (opts) {\n    this.#maxTTL = opts.maxTTL\n    this.#maxItems = opts.maxItems\n    this.dualStack = opts.dualStack\n    this.affinity = opts.affinity\n    this.lookup = opts.lookup ?? this.#defaultLookup\n    this.pick = opts.pick ?? this.#defaultPick\n  }\n\n  get full () {\n    return this.#records.size === this.#maxItems\n  }\n\n  runLookup (origin, opts, cb) {\n    const ips = this.#records.get(origin.hostname)\n\n    // If full, we just return the origin\n    if (ips == null && this.full) {\n      cb(null, origin.origin)\n      return\n    }\n\n    const newOpts = {\n      affinity: this.affinity,\n      dualStack: this.dualStack,\n      lookup: this.lookup,\n      pick: this.pick,\n      ...opts.dns,\n      maxTTL: this.#maxTTL,\n      maxItems: this.#maxItems\n    }\n\n    // If no IPs we lookup\n    if (ips == null) {\n      this.lookup(origin, newOpts, (err, addresses) => {\n        if (err || addresses == null || addresses.length === 0) {\n          cb(err ?? new InformationalError('No DNS entries found'))\n          return\n        }\n\n        this.setRecords(origin, addresses)\n        const records = this.#records.get(origin.hostname)\n\n        const ip = this.pick(\n          origin,\n          records,\n          newOpts.affinity\n        )\n\n        let port\n        if (typeof ip.port === 'number') {\n          port = `:${ip.port}`\n        } else if (origin.port !== '') {\n          port = `:${origin.port}`\n        } else {\n          port = ''\n        }\n\n        cb(\n          null,\n          `${origin.protocol}//${\n            ip.family === 6 ? `[${ip.address}]` : ip.address\n          }${port}`\n        )\n      })\n    } else {\n      // If there's IPs we pick\n      const ip = this.pick(\n        origin,\n        ips,\n        newOpts.affinity\n      )\n\n      // If no IPs we lookup - deleting old records\n      if (ip == null) {\n        this.#records.delete(origin.hostname)\n        this.runLookup(origin, opts, cb)\n        return\n      }\n\n      let port\n      if (typeof ip.port === 'number') {\n        port = `:${ip.port}`\n      } else if (origin.port !== '') {\n        port = `:${origin.port}`\n      } else {\n        port = ''\n      }\n\n      cb(\n        null,\n        `${origin.protocol}//${\n          ip.family === 6 ? `[${ip.address}]` : ip.address\n        }${port}`\n      )\n    }\n  }\n\n  #defaultLookup (origin, opts, cb) {\n    lookup(\n      origin.hostname,\n      {\n        all: true,\n        family: this.dualStack === false ? this.affinity : 0,\n        order: 'ipv4first'\n      },\n      (err, addresses) => {\n        if (err) {\n          return cb(err)\n        }\n\n        const results = new Map()\n\n        for (const addr of addresses) {\n          // On linux we found duplicates, we attempt to remove them with\n          // the latest record\n          results.set(`${addr.address}:${addr.family}`, addr)\n        }\n\n        cb(null, results.values())\n      }\n    )\n  }\n\n  #defaultPick (origin, hostnameRecords, affinity) {\n    let ip = null\n    const { records, offset } = hostnameRecords\n\n    let family\n    if (this.dualStack) {\n      if (affinity == null) {\n        // Balance between ip families\n        if (offset == null || offset === maxInt) {\n          hostnameRecords.offset = 0\n          affinity = 4\n        } else {\n          hostnameRecords.offset++\n          affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4\n        }\n      }\n\n      if (records[affinity] != null && records[affinity].ips.length > 0) {\n        family = records[affinity]\n      } else {\n        family = records[affinity === 4 ? 6 : 4]\n      }\n    } else {\n      family = records[affinity]\n    }\n\n    // If no IPs we return null\n    if (family == null || family.ips.length === 0) {\n      return ip\n    }\n\n    if (family.offset == null || family.offset === maxInt) {\n      family.offset = 0\n    } else {\n      family.offset++\n    }\n\n    const position = family.offset % family.ips.length\n    ip = family.ips[position] ?? null\n\n    if (ip == null) {\n      return ip\n    }\n\n    if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms\n      // We delete expired records\n      // It is possible that they have different TTL, so we manage them individually\n      family.ips.splice(position, 1)\n      return this.pick(origin, hostnameRecords, affinity)\n    }\n\n    return ip\n  }\n\n  setRecords (origin, addresses) {\n    const timestamp = Date.now()\n    const records = { records: { 4: null, 6: null } }\n    for (const record of addresses) {\n      record.timestamp = timestamp\n      if (typeof record.ttl === 'number') {\n        // The record TTL is expected to be in ms\n        record.ttl = Math.min(record.ttl, this.#maxTTL)\n      } else {\n        record.ttl = this.#maxTTL\n      }\n\n      const familyRecords = records.records[record.family] ?? { ips: [] }\n\n      familyRecords.ips.push(record)\n      records.records[record.family] = familyRecords\n    }\n\n    this.#records.set(origin.hostname, records)\n  }\n\n  getHandler (meta, opts) {\n    return new DNSDispatchHandler(this, meta, opts)\n  }\n}\n\nclass DNSDispatchHandler extends DecoratorHandler {\n  #state = null\n  #opts = null\n  #dispatch = null\n  #handler = null\n  #origin = null\n\n  constructor (state, { origin, handler, dispatch }, opts) {\n    super(handler)\n    this.#origin = origin\n    this.#handler = handler\n    this.#opts = { ...opts }\n    this.#state = state\n    this.#dispatch = dispatch\n  }\n\n  onError (err) {\n    switch (err.code) {\n      case 'ETIMEDOUT':\n      case 'ECONNREFUSED': {\n        if (this.#state.dualStack) {\n          // We delete the record and retry\n          this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => {\n            if (err) {\n              return this.#handler.onError(err)\n            }\n\n            const dispatchOpts = {\n              ...this.#opts,\n              origin: newOrigin\n            }\n\n            this.#dispatch(dispatchOpts, this)\n          })\n\n          // if dual-stack disabled, we error out\n          return\n        }\n\n        this.#handler.onError(err)\n        return\n      }\n      case 'ENOTFOUND':\n        this.#state.deleteRecord(this.#origin)\n      // eslint-disable-next-line no-fallthrough\n      default:\n        this.#handler.onError(err)\n        break\n    }\n  }\n}\n\nmodule.exports = interceptorOpts => {\n  if (\n    interceptorOpts?.maxTTL != null &&\n    (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0)\n  ) {\n    throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number')\n  }\n\n  if (\n    interceptorOpts?.maxItems != null &&\n    (typeof interceptorOpts?.maxItems !== 'number' ||\n      interceptorOpts?.maxItems < 1)\n  ) {\n    throw new InvalidArgumentError(\n      'Invalid maxItems. Must be a positive number and greater than zero'\n    )\n  }\n\n  if (\n    interceptorOpts?.affinity != null &&\n    interceptorOpts?.affinity !== 4 &&\n    interceptorOpts?.affinity !== 6\n  ) {\n    throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6')\n  }\n\n  if (\n    interceptorOpts?.dualStack != null &&\n    typeof interceptorOpts?.dualStack !== 'boolean'\n  ) {\n    throw new InvalidArgumentError('Invalid dualStack. Must be a boolean')\n  }\n\n  if (\n    interceptorOpts?.lookup != null &&\n    typeof interceptorOpts?.lookup !== 'function'\n  ) {\n    throw new InvalidArgumentError('Invalid lookup. Must be a function')\n  }\n\n  if (\n    interceptorOpts?.pick != null &&\n    typeof interceptorOpts?.pick !== 'function'\n  ) {\n    throw new InvalidArgumentError('Invalid pick. Must be a function')\n  }\n\n  const dualStack = interceptorOpts?.dualStack ?? true\n  let affinity\n  if (dualStack) {\n    affinity = interceptorOpts?.affinity ?? null\n  } else {\n    affinity = interceptorOpts?.affinity ?? 4\n  }\n\n  const opts = {\n    maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms\n    lookup: interceptorOpts?.lookup ?? null,\n    pick: interceptorOpts?.pick ?? null,\n    dualStack,\n    affinity,\n    maxItems: interceptorOpts?.maxItems ?? Infinity\n  }\n\n  const instance = new DNSInstance(opts)\n\n  return dispatch => {\n    return function dnsInterceptor (origDispatchOpts, handler) {\n      const origin =\n        origDispatchOpts.origin.constructor === URL\n          ? origDispatchOpts.origin\n          : new URL(origDispatchOpts.origin)\n\n      if (isIP(origin.hostname) !== 0) {\n        return dispatch(origDispatchOpts, handler)\n      }\n\n      instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {\n        if (err) {\n          return handler.onError(err)\n        }\n\n        let dispatchOpts = null\n        dispatchOpts = {\n          ...origDispatchOpts,\n          servername: origin.hostname, // For SNI on TLS\n          origin: newOrigin,\n          headers: {\n            host: origin.hostname,\n            ...origDispatchOpts.headers\n          }\n        }\n\n        dispatch(\n          dispatchOpts,\n          instance.getHandler({ origin, dispatch, handler }, origDispatchOpts)\n        )\n      })\n\n      return true\n    }\n  }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst DecoratorHandler = require('../handler/decorator-handler')\n\nclass DumpHandler extends DecoratorHandler {\n  #maxSize = 1024 * 1024\n  #abort = null\n  #dumped = false\n  #aborted = false\n  #size = 0\n  #reason = null\n  #handler = null\n\n  constructor ({ maxSize }, handler) {\n    super(handler)\n\n    if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {\n      throw new InvalidArgumentError('maxSize must be a number greater than 0')\n    }\n\n    this.#maxSize = maxSize ?? this.#maxSize\n    this.#handler = handler\n  }\n\n  onConnect (abort) {\n    this.#abort = abort\n\n    this.#handler.onConnect(this.#customAbort.bind(this))\n  }\n\n  #customAbort (reason) {\n    this.#aborted = true\n    this.#reason = reason\n  }\n\n  // TODO: will require adjustment after new hooks are out\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const headers = util.parseHeaders(rawHeaders)\n    const contentLength = headers['content-length']\n\n    if (contentLength != null && contentLength > this.#maxSize) {\n      throw new RequestAbortedError(\n        `Response size (${contentLength}) larger than maxSize (${\n          this.#maxSize\n        })`\n      )\n    }\n\n    if (this.#aborted) {\n      return true\n    }\n\n    return this.#handler.onHeaders(\n      statusCode,\n      rawHeaders,\n      resume,\n      statusMessage\n    )\n  }\n\n  onError (err) {\n    if (this.#dumped) {\n      return\n    }\n\n    err = this.#reason ?? err\n\n    this.#handler.onError(err)\n  }\n\n  onData (chunk) {\n    this.#size = this.#size + chunk.length\n\n    if (this.#size >= this.#maxSize) {\n      this.#dumped = true\n\n      if (this.#aborted) {\n        this.#handler.onError(this.#reason)\n      } else {\n        this.#handler.onComplete([])\n      }\n    }\n\n    return true\n  }\n\n  onComplete (trailers) {\n    if (this.#dumped) {\n      return\n    }\n\n    if (this.#aborted) {\n      this.#handler.onError(this.reason)\n      return\n    }\n\n    this.#handler.onComplete(trailers)\n  }\n}\n\nfunction createDumpInterceptor (\n  { maxSize: defaultMaxSize } = {\n    maxSize: 1024 * 1024\n  }\n) {\n  return dispatch => {\n    return function Intercept (opts, handler) {\n      const { dumpMaxSize = defaultMaxSize } =\n        opts\n\n      const dumpHandler = new DumpHandler(\n        { maxSize: dumpMaxSize },\n        handler\n      )\n\n      return dispatch(opts, dumpHandler)\n    }\n  }\n}\n\nmodule.exports = createDumpInterceptor\n","'use strict'\n\nconst RedirectHandler = require('../handler/redirect-handler')\n\nfunction createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {\n  return (dispatch) => {\n    return function Intercept (opts, handler) {\n      const { maxRedirections = defaultMaxRedirections } = opts\n\n      if (!maxRedirections) {\n        return dispatch(opts, handler)\n      }\n\n      const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)\n      opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.\n      return dispatch(opts, redirectHandler)\n    }\n  }\n}\n\nmodule.exports = createRedirectInterceptor\n","'use strict'\nconst RedirectHandler = require('../handler/redirect-handler')\n\nmodule.exports = opts => {\n  const globalMaxRedirections = opts?.maxRedirections\n  return dispatch => {\n    return function redirectInterceptor (opts, handler) {\n      const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts\n\n      if (!maxRedirections) {\n        return dispatch(opts, handler)\n      }\n\n      const redirectHandler = new RedirectHandler(\n        dispatch,\n        maxRedirections,\n        opts,\n        handler\n      )\n\n      return dispatch(baseOpts, redirectHandler)\n    }\n  }\n}\n","'use strict'\nconst RetryHandler = require('../handler/retry-handler')\n\nmodule.exports = globalOpts => {\n  return dispatch => {\n    return function retryInterceptor (opts, handler) {\n      return dispatch(\n        opts,\n        new RetryHandler(\n          { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },\n          {\n            handler,\n            dispatch\n          }\n        )\n      )\n    }\n  }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;\nconst utils_1 = require(\"./utils\");\n// C headers\nvar ERROR;\n(function (ERROR) {\n    ERROR[ERROR[\"OK\"] = 0] = \"OK\";\n    ERROR[ERROR[\"INTERNAL\"] = 1] = \"INTERNAL\";\n    ERROR[ERROR[\"STRICT\"] = 2] = \"STRICT\";\n    ERROR[ERROR[\"LF_EXPECTED\"] = 3] = \"LF_EXPECTED\";\n    ERROR[ERROR[\"UNEXPECTED_CONTENT_LENGTH\"] = 4] = \"UNEXPECTED_CONTENT_LENGTH\";\n    ERROR[ERROR[\"CLOSED_CONNECTION\"] = 5] = \"CLOSED_CONNECTION\";\n    ERROR[ERROR[\"INVALID_METHOD\"] = 6] = \"INVALID_METHOD\";\n    ERROR[ERROR[\"INVALID_URL\"] = 7] = \"INVALID_URL\";\n    ERROR[ERROR[\"INVALID_CONSTANT\"] = 8] = \"INVALID_CONSTANT\";\n    ERROR[ERROR[\"INVALID_VERSION\"] = 9] = \"INVALID_VERSION\";\n    ERROR[ERROR[\"INVALID_HEADER_TOKEN\"] = 10] = \"INVALID_HEADER_TOKEN\";\n    ERROR[ERROR[\"INVALID_CONTENT_LENGTH\"] = 11] = \"INVALID_CONTENT_LENGTH\";\n    ERROR[ERROR[\"INVALID_CHUNK_SIZE\"] = 12] = \"INVALID_CHUNK_SIZE\";\n    ERROR[ERROR[\"INVALID_STATUS\"] = 13] = \"INVALID_STATUS\";\n    ERROR[ERROR[\"INVALID_EOF_STATE\"] = 14] = \"INVALID_EOF_STATE\";\n    ERROR[ERROR[\"INVALID_TRANSFER_ENCODING\"] = 15] = \"INVALID_TRANSFER_ENCODING\";\n    ERROR[ERROR[\"CB_MESSAGE_BEGIN\"] = 16] = \"CB_MESSAGE_BEGIN\";\n    ERROR[ERROR[\"CB_HEADERS_COMPLETE\"] = 17] = \"CB_HEADERS_COMPLETE\";\n    ERROR[ERROR[\"CB_MESSAGE_COMPLETE\"] = 18] = \"CB_MESSAGE_COMPLETE\";\n    ERROR[ERROR[\"CB_CHUNK_HEADER\"] = 19] = \"CB_CHUNK_HEADER\";\n    ERROR[ERROR[\"CB_CHUNK_COMPLETE\"] = 20] = \"CB_CHUNK_COMPLETE\";\n    ERROR[ERROR[\"PAUSED\"] = 21] = \"PAUSED\";\n    ERROR[ERROR[\"PAUSED_UPGRADE\"] = 22] = \"PAUSED_UPGRADE\";\n    ERROR[ERROR[\"PAUSED_H2_UPGRADE\"] = 23] = \"PAUSED_H2_UPGRADE\";\n    ERROR[ERROR[\"USER\"] = 24] = \"USER\";\n})(ERROR = exports.ERROR || (exports.ERROR = {}));\nvar TYPE;\n(function (TYPE) {\n    TYPE[TYPE[\"BOTH\"] = 0] = \"BOTH\";\n    TYPE[TYPE[\"REQUEST\"] = 1] = \"REQUEST\";\n    TYPE[TYPE[\"RESPONSE\"] = 2] = \"RESPONSE\";\n})(TYPE = exports.TYPE || (exports.TYPE = {}));\nvar FLAGS;\n(function (FLAGS) {\n    FLAGS[FLAGS[\"CONNECTION_KEEP_ALIVE\"] = 1] = \"CONNECTION_KEEP_ALIVE\";\n    FLAGS[FLAGS[\"CONNECTION_CLOSE\"] = 2] = \"CONNECTION_CLOSE\";\n    FLAGS[FLAGS[\"CONNECTION_UPGRADE\"] = 4] = \"CONNECTION_UPGRADE\";\n    FLAGS[FLAGS[\"CHUNKED\"] = 8] = \"CHUNKED\";\n    FLAGS[FLAGS[\"UPGRADE\"] = 16] = \"UPGRADE\";\n    FLAGS[FLAGS[\"CONTENT_LENGTH\"] = 32] = \"CONTENT_LENGTH\";\n    FLAGS[FLAGS[\"SKIPBODY\"] = 64] = \"SKIPBODY\";\n    FLAGS[FLAGS[\"TRAILING\"] = 128] = \"TRAILING\";\n    // 1 << 8 is unused\n    FLAGS[FLAGS[\"TRANSFER_ENCODING\"] = 512] = \"TRANSFER_ENCODING\";\n})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));\nvar LENIENT_FLAGS;\n(function (LENIENT_FLAGS) {\n    LENIENT_FLAGS[LENIENT_FLAGS[\"HEADERS\"] = 1] = \"HEADERS\";\n    LENIENT_FLAGS[LENIENT_FLAGS[\"CHUNKED_LENGTH\"] = 2] = \"CHUNKED_LENGTH\";\n    LENIENT_FLAGS[LENIENT_FLAGS[\"KEEP_ALIVE\"] = 4] = \"KEEP_ALIVE\";\n})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));\nvar METHODS;\n(function (METHODS) {\n    METHODS[METHODS[\"DELETE\"] = 0] = \"DELETE\";\n    METHODS[METHODS[\"GET\"] = 1] = \"GET\";\n    METHODS[METHODS[\"HEAD\"] = 2] = \"HEAD\";\n    METHODS[METHODS[\"POST\"] = 3] = \"POST\";\n    METHODS[METHODS[\"PUT\"] = 4] = \"PUT\";\n    /* pathological */\n    METHODS[METHODS[\"CONNECT\"] = 5] = \"CONNECT\";\n    METHODS[METHODS[\"OPTIONS\"] = 6] = \"OPTIONS\";\n    METHODS[METHODS[\"TRACE\"] = 7] = \"TRACE\";\n    /* WebDAV */\n    METHODS[METHODS[\"COPY\"] = 8] = \"COPY\";\n    METHODS[METHODS[\"LOCK\"] = 9] = \"LOCK\";\n    METHODS[METHODS[\"MKCOL\"] = 10] = \"MKCOL\";\n    METHODS[METHODS[\"MOVE\"] = 11] = \"MOVE\";\n    METHODS[METHODS[\"PROPFIND\"] = 12] = \"PROPFIND\";\n    METHODS[METHODS[\"PROPPATCH\"] = 13] = \"PROPPATCH\";\n    METHODS[METHODS[\"SEARCH\"] = 14] = \"SEARCH\";\n    METHODS[METHODS[\"UNLOCK\"] = 15] = \"UNLOCK\";\n    METHODS[METHODS[\"BIND\"] = 16] = \"BIND\";\n    METHODS[METHODS[\"REBIND\"] = 17] = \"REBIND\";\n    METHODS[METHODS[\"UNBIND\"] = 18] = \"UNBIND\";\n    METHODS[METHODS[\"ACL\"] = 19] = \"ACL\";\n    /* subversion */\n    METHODS[METHODS[\"REPORT\"] = 20] = \"REPORT\";\n    METHODS[METHODS[\"MKACTIVITY\"] = 21] = \"MKACTIVITY\";\n    METHODS[METHODS[\"CHECKOUT\"] = 22] = \"CHECKOUT\";\n    METHODS[METHODS[\"MERGE\"] = 23] = \"MERGE\";\n    /* upnp */\n    METHODS[METHODS[\"M-SEARCH\"] = 24] = \"M-SEARCH\";\n    METHODS[METHODS[\"NOTIFY\"] = 25] = \"NOTIFY\";\n    METHODS[METHODS[\"SUBSCRIBE\"] = 26] = \"SUBSCRIBE\";\n    METHODS[METHODS[\"UNSUBSCRIBE\"] = 27] = \"UNSUBSCRIBE\";\n    /* RFC-5789 */\n    METHODS[METHODS[\"PATCH\"] = 28] = \"PATCH\";\n    METHODS[METHODS[\"PURGE\"] = 29] = \"PURGE\";\n    /* CalDAV */\n    METHODS[METHODS[\"MKCALENDAR\"] = 30] = \"MKCALENDAR\";\n    /* RFC-2068, section 19.6.1.2 */\n    METHODS[METHODS[\"LINK\"] = 31] = \"LINK\";\n    METHODS[METHODS[\"UNLINK\"] = 32] = \"UNLINK\";\n    /* icecast */\n    METHODS[METHODS[\"SOURCE\"] = 33] = \"SOURCE\";\n    /* RFC-7540, section 11.6 */\n    METHODS[METHODS[\"PRI\"] = 34] = \"PRI\";\n    /* RFC-2326 RTSP */\n    METHODS[METHODS[\"DESCRIBE\"] = 35] = \"DESCRIBE\";\n    METHODS[METHODS[\"ANNOUNCE\"] = 36] = \"ANNOUNCE\";\n    METHODS[METHODS[\"SETUP\"] = 37] = \"SETUP\";\n    METHODS[METHODS[\"PLAY\"] = 38] = \"PLAY\";\n    METHODS[METHODS[\"PAUSE\"] = 39] = \"PAUSE\";\n    METHODS[METHODS[\"TEARDOWN\"] = 40] = \"TEARDOWN\";\n    METHODS[METHODS[\"GET_PARAMETER\"] = 41] = \"GET_PARAMETER\";\n    METHODS[METHODS[\"SET_PARAMETER\"] = 42] = \"SET_PARAMETER\";\n    METHODS[METHODS[\"REDIRECT\"] = 43] = \"REDIRECT\";\n    METHODS[METHODS[\"RECORD\"] = 44] = \"RECORD\";\n    /* RAOP */\n    METHODS[METHODS[\"FLUSH\"] = 45] = \"FLUSH\";\n})(METHODS = exports.METHODS || (exports.METHODS = {}));\nexports.METHODS_HTTP = [\n    METHODS.DELETE,\n    METHODS.GET,\n    METHODS.HEAD,\n    METHODS.POST,\n    METHODS.PUT,\n    METHODS.CONNECT,\n    METHODS.OPTIONS,\n    METHODS.TRACE,\n    METHODS.COPY,\n    METHODS.LOCK,\n    METHODS.MKCOL,\n    METHODS.MOVE,\n    METHODS.PROPFIND,\n    METHODS.PROPPATCH,\n    METHODS.SEARCH,\n    METHODS.UNLOCK,\n    METHODS.BIND,\n    METHODS.REBIND,\n    METHODS.UNBIND,\n    METHODS.ACL,\n    METHODS.REPORT,\n    METHODS.MKACTIVITY,\n    METHODS.CHECKOUT,\n    METHODS.MERGE,\n    METHODS['M-SEARCH'],\n    METHODS.NOTIFY,\n    METHODS.SUBSCRIBE,\n    METHODS.UNSUBSCRIBE,\n    METHODS.PATCH,\n    METHODS.PURGE,\n    METHODS.MKCALENDAR,\n    METHODS.LINK,\n    METHODS.UNLINK,\n    METHODS.PRI,\n    // TODO(indutny): should we allow it with HTTP?\n    METHODS.SOURCE,\n];\nexports.METHODS_ICE = [\n    METHODS.SOURCE,\n];\nexports.METHODS_RTSP = [\n    METHODS.OPTIONS,\n    METHODS.DESCRIBE,\n    METHODS.ANNOUNCE,\n    METHODS.SETUP,\n    METHODS.PLAY,\n    METHODS.PAUSE,\n    METHODS.TEARDOWN,\n    METHODS.GET_PARAMETER,\n    METHODS.SET_PARAMETER,\n    METHODS.REDIRECT,\n    METHODS.RECORD,\n    METHODS.FLUSH,\n    // For AirPlay\n    METHODS.GET,\n    METHODS.POST,\n];\nexports.METHOD_MAP = utils_1.enumToMap(METHODS);\nexports.H_METHOD_MAP = {};\nObject.keys(exports.METHOD_MAP).forEach((key) => {\n    if (/^H/.test(key)) {\n        exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];\n    }\n});\nvar FINISH;\n(function (FINISH) {\n    FINISH[FINISH[\"SAFE\"] = 0] = \"SAFE\";\n    FINISH[FINISH[\"SAFE_WITH_CB\"] = 1] = \"SAFE_WITH_CB\";\n    FINISH[FINISH[\"UNSAFE\"] = 2] = \"UNSAFE\";\n})(FINISH = exports.FINISH || (exports.FINISH = {}));\nexports.ALPHA = [];\nfor (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {\n    // Upper case\n    exports.ALPHA.push(String.fromCharCode(i));\n    // Lower case\n    exports.ALPHA.push(String.fromCharCode(i + 0x20));\n}\nexports.NUM_MAP = {\n    0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n    5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n};\nexports.HEX_MAP = {\n    0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n    5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n    A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,\n    a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,\n};\nexports.NUM = [\n    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n];\nexports.ALPHANUM = exports.ALPHA.concat(exports.NUM);\nexports.MARK = ['-', '_', '.', '!', '~', '*', '\\'', '(', ')'];\nexports.USERINFO_CHARS = exports.ALPHANUM\n    .concat(exports.MARK)\n    .concat(['%', ';', ':', '&', '=', '+', '$', ',']);\n// TODO(indutny): use RFC\nexports.STRICT_URL_CHAR = [\n    '!', '\"', '$', '%', '&', '\\'',\n    '(', ')', '*', '+', ',', '-', '.', '/',\n    ':', ';', '<', '=', '>',\n    '@', '[', '\\\\', ']', '^', '_',\n    '`',\n    '{', '|', '}', '~',\n].concat(exports.ALPHANUM);\nexports.URL_CHAR = exports.STRICT_URL_CHAR\n    .concat(['\\t', '\\f']);\n// All characters with 0x80 bit set to 1\nfor (let i = 0x80; i <= 0xff; i++) {\n    exports.URL_CHAR.push(i);\n}\nexports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);\n/* Tokens as defined by rfc 2616. Also lowercases them.\n *        token       = 1*\n *     separators     = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n *                    | \",\" | \";\" | \":\" | \"\\\" | <\">\n *                    | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n *                    | \"{\" | \"}\" | SP | HT\n */\nexports.STRICT_TOKEN = [\n    '!', '#', '$', '%', '&', '\\'',\n    '*', '+', '-', '.',\n    '^', '_', '`',\n    '|', '~',\n].concat(exports.ALPHANUM);\nexports.TOKEN = exports.STRICT_TOKEN.concat([' ']);\n/*\n * Verify that a char is a valid visible (printable) US-ASCII\n * character or %x80-FF\n */\nexports.HEADER_CHARS = ['\\t'];\nfor (let i = 32; i <= 255; i++) {\n    if (i !== 127) {\n        exports.HEADER_CHARS.push(i);\n    }\n}\n// ',' = \\x44\nexports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);\nexports.MAJOR = exports.NUM_MAP;\nexports.MINOR = exports.MAJOR;\nvar HEADER_STATE;\n(function (HEADER_STATE) {\n    HEADER_STATE[HEADER_STATE[\"GENERAL\"] = 0] = \"GENERAL\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION\"] = 1] = \"CONNECTION\";\n    HEADER_STATE[HEADER_STATE[\"CONTENT_LENGTH\"] = 2] = \"CONTENT_LENGTH\";\n    HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING\"] = 3] = \"TRANSFER_ENCODING\";\n    HEADER_STATE[HEADER_STATE[\"UPGRADE\"] = 4] = \"UPGRADE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_KEEP_ALIVE\"] = 5] = \"CONNECTION_KEEP_ALIVE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_CLOSE\"] = 6] = \"CONNECTION_CLOSE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_UPGRADE\"] = 7] = \"CONNECTION_UPGRADE\";\n    HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING_CHUNKED\"] = 8] = \"TRANSFER_ENCODING_CHUNKED\";\n})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));\nexports.SPECIAL_HEADERS = {\n    'connection': HEADER_STATE.CONNECTION,\n    'content-length': HEADER_STATE.CONTENT_LENGTH,\n    'proxy-connection': HEADER_STATE.CONNECTION,\n    'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,\n    'upgrade': HEADER_STATE.UPGRADE,\n};\n//# sourceMappingURL=constants.js.map","'use strict'\n\nconst { Buffer } = require('node:buffer')\n\nmodule.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0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AEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ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kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJ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Rw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw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BACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBC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EAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64')\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enumToMap = void 0;\nfunction enumToMap(obj) {\n    const res = {};\n    Object.keys(obj).forEach((key) => {\n        const value = obj[key];\n        if (typeof value === 'number') {\n            res[key] = value;\n        }\n    });\n    return res;\n}\nexports.enumToMap = enumToMap;\n//# sourceMappingURL=utils.js.map","'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../dispatcher/agent')\nconst {\n  kAgent,\n  kMockAgentSet,\n  kMockAgentGet,\n  kDispatches,\n  kIsMockActive,\n  kNetConnect,\n  kGetNetConnect,\n  kOptions,\n  kFactory\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, buildMockOptions } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher/dispatcher')\nconst Pluralizer = require('./pluralizer')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\n\nclass MockAgent extends Dispatcher {\n  constructor (opts) {\n    super(opts)\n\n    this[kNetConnect] = true\n    this[kIsMockActive] = true\n\n    // Instantiate Agent and encapsulate\n    if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n    const agent = opts?.agent ? opts.agent : new Agent(opts)\n    this[kAgent] = agent\n\n    this[kClients] = agent[kClients]\n    this[kOptions] = buildMockOptions(opts)\n  }\n\n  get (origin) {\n    let dispatcher = this[kMockAgentGet](origin)\n\n    if (!dispatcher) {\n      dispatcher = this[kFactory](origin)\n      this[kMockAgentSet](origin, dispatcher)\n    }\n    return dispatcher\n  }\n\n  dispatch (opts, handler) {\n    // Call MockAgent.get to perform additional setup before dispatching as normal\n    this.get(opts.origin)\n    return this[kAgent].dispatch(opts, handler)\n  }\n\n  async close () {\n    await this[kAgent].close()\n    this[kClients].clear()\n  }\n\n  deactivate () {\n    this[kIsMockActive] = false\n  }\n\n  activate () {\n    this[kIsMockActive] = true\n  }\n\n  enableNetConnect (matcher) {\n    if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n      if (Array.isArray(this[kNetConnect])) {\n        this[kNetConnect].push(matcher)\n      } else {\n        this[kNetConnect] = [matcher]\n      }\n    } else if (typeof matcher === 'undefined') {\n      this[kNetConnect] = true\n    } else {\n      throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n    }\n  }\n\n  disableNetConnect () {\n    this[kNetConnect] = false\n  }\n\n  // This is required to bypass issues caused by using global symbols - see:\n  // https://github.com/nodejs/undici/issues/1447\n  get isMockActive () {\n    return this[kIsMockActive]\n  }\n\n  [kMockAgentSet] (origin, dispatcher) {\n    this[kClients].set(origin, dispatcher)\n  }\n\n  [kFactory] (origin) {\n    const mockOptions = Object.assign({ agent: this }, this[kOptions])\n    return this[kOptions] && this[kOptions].connections === 1\n      ? new MockClient(origin, mockOptions)\n      : new MockPool(origin, mockOptions)\n  }\n\n  [kMockAgentGet] (origin) {\n    // First check if we can immediately find it\n    const client = this[kClients].get(origin)\n    if (client) {\n      return client\n    }\n\n    // If the origin is not a string create a dummy parent pool and return to user\n    if (typeof origin !== 'string') {\n      const dispatcher = this[kFactory]('http://localhost:9999')\n      this[kMockAgentSet](origin, dispatcher)\n      return dispatcher\n    }\n\n    // If we match, create a pool and assign the same dispatches\n    for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) {\n      if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n        const dispatcher = this[kFactory](origin)\n        this[kMockAgentSet](origin, dispatcher)\n        dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]\n        return dispatcher\n      }\n    }\n  }\n\n  [kGetNetConnect] () {\n    return this[kNetConnect]\n  }\n\n  pendingInterceptors () {\n    const mockAgentClients = this[kClients]\n\n    return Array.from(mockAgentClients.entries())\n      .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n      .filter(({ pending }) => pending)\n  }\n\n  assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n    const pending = this.pendingInterceptors()\n\n    if (pending.length === 0) {\n      return\n    }\n\n    const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)\n\n    throw new UndiciError(`\n${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:\n\n${pendingInterceptorsFormatter.format(pending)}\n`.trim())\n  }\n}\n\nmodule.exports = MockAgent\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Client = require('../dispatcher/client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kMockAgent,\n  kClose,\n  kOriginalClose,\n  kOrigin,\n  kOriginalDispatch,\n  kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n  constructor (origin, opts) {\n    super(origin, opts)\n\n    if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n\n    this[kMockAgent] = opts.agent\n    this[kOrigin] = origin\n    this[kDispatches] = []\n    this[kConnected] = 1\n    this[kOriginalDispatch] = this.dispatch\n    this[kOriginalClose] = this.close.bind(this)\n\n    this.dispatch = buildMockDispatch.call(this)\n    this.close = this[kClose]\n  }\n\n  get [Symbols.kConnected] () {\n    return this[kConnected]\n  }\n\n  /**\n   * Sets up the base interceptor for mocking replies from undici.\n   */\n  intercept (opts) {\n    return new MockInterceptor(opts, this[kDispatches])\n  }\n\n  async [kClose] () {\n    await promisify(this[kOriginalClose])()\n    this[kConnected] = 0\n    this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n  }\n}\n\nmodule.exports = MockClient\n","'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nconst kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')\n\n/**\n * The request does not match any registered mock dispatches.\n */\nclass MockNotMatchedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    Error.captureStackTrace(this, MockNotMatchedError)\n    this.name = 'MockNotMatchedError'\n    this.message = message || 'The request does not match any registered mock dispatches'\n    this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kMockNotMatchedError] === true\n  }\n\n  [kMockNotMatchedError] = true\n}\n\nmodule.exports = {\n  MockNotMatchedError\n}\n","'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kDispatchKey,\n  kDefaultHeaders,\n  kDefaultTrailers,\n  kContentLength,\n  kMockDispatch\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { buildURL } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n  constructor (mockDispatch) {\n    this[kMockDispatch] = mockDispatch\n  }\n\n  /**\n   * Delay a reply by a set amount in ms.\n   */\n  delay (waitInMs) {\n    if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n      throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n    }\n\n    this[kMockDispatch].delay = waitInMs\n    return this\n  }\n\n  /**\n   * For a defined reply, never mark as consumed.\n   */\n  persist () {\n    this[kMockDispatch].persist = true\n    return this\n  }\n\n  /**\n   * Allow one to define a reply for a set amount of matching requests.\n   */\n  times (repeatTimes) {\n    if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n      throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n    }\n\n    this[kMockDispatch].times = repeatTimes\n    return this\n  }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n  constructor (opts, mockDispatches) {\n    if (typeof opts !== 'object') {\n      throw new InvalidArgumentError('opts must be an object')\n    }\n    if (typeof opts.path === 'undefined') {\n      throw new InvalidArgumentError('opts.path must be defined')\n    }\n    if (typeof opts.method === 'undefined') {\n      opts.method = 'GET'\n    }\n    // See https://github.com/nodejs/undici/issues/1245\n    // As per RFC 3986, clients are not supposed to send URI\n    // fragments to servers when they retrieve a document,\n    if (typeof opts.path === 'string') {\n      if (opts.query) {\n        opts.path = buildURL(opts.path, opts.query)\n      } else {\n        // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811\n        const parsedURL = new URL(opts.path, 'data://')\n        opts.path = parsedURL.pathname + parsedURL.search\n      }\n    }\n    if (typeof opts.method === 'string') {\n      opts.method = opts.method.toUpperCase()\n    }\n\n    this[kDispatchKey] = buildKey(opts)\n    this[kDispatches] = mockDispatches\n    this[kDefaultHeaders] = {}\n    this[kDefaultTrailers] = {}\n    this[kContentLength] = false\n  }\n\n  createMockScopeDispatchData ({ statusCode, data, responseOptions }) {\n    const responseData = getResponseData(data)\n    const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n    const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n    const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n    return { statusCode, data, headers, trailers }\n  }\n\n  validateReplyParameters (replyParameters) {\n    if (typeof replyParameters.statusCode === 'undefined') {\n      throw new InvalidArgumentError('statusCode must be defined')\n    }\n    if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) {\n      throw new InvalidArgumentError('responseOptions must be an object')\n    }\n  }\n\n  /**\n   * Mock an undici request with a defined reply.\n   */\n  reply (replyOptionsCallbackOrStatusCode) {\n    // Values of reply aren't available right now as they\n    // can only be available when the reply callback is invoked.\n    if (typeof replyOptionsCallbackOrStatusCode === 'function') {\n      // We'll first wrap the provided callback in another function,\n      // this function will properly resolve the data from the callback\n      // when invoked.\n      const wrappedDefaultsCallback = (opts) => {\n        // Our reply options callback contains the parameter for statusCode, data and options.\n        const resolvedData = replyOptionsCallbackOrStatusCode(opts)\n\n        // Check if it is in the right format\n        if (typeof resolvedData !== 'object' || resolvedData === null) {\n          throw new InvalidArgumentError('reply options callback must return an object')\n        }\n\n        const replyParameters = { data: '', responseOptions: {}, ...resolvedData }\n        this.validateReplyParameters(replyParameters)\n        // Since the values can be obtained immediately we return them\n        // from this higher order function that will be resolved later.\n        return {\n          ...this.createMockScopeDispatchData(replyParameters)\n        }\n      }\n\n      // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n      const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)\n      return new MockScope(newMockDispatch)\n    }\n\n    // We can have either one or three parameters, if we get here,\n    // we should have 1-3 parameters. So we spread the arguments of\n    // this function to obtain the parameters, since replyData will always\n    // just be the statusCode.\n    const replyParameters = {\n      statusCode: replyOptionsCallbackOrStatusCode,\n      data: arguments[1] === undefined ? '' : arguments[1],\n      responseOptions: arguments[2] === undefined ? {} : arguments[2]\n    }\n    this.validateReplyParameters(replyParameters)\n\n    // Send in-already provided data like usual\n    const dispatchData = this.createMockScopeDispatchData(replyParameters)\n    const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)\n    return new MockScope(newMockDispatch)\n  }\n\n  /**\n   * Mock an undici request with a defined error.\n   */\n  replyWithError (error) {\n    if (typeof error === 'undefined') {\n      throw new InvalidArgumentError('error must be defined')\n    }\n\n    const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })\n    return new MockScope(newMockDispatch)\n  }\n\n  /**\n   * Set default reply headers on the interceptor for subsequent replies\n   */\n  defaultReplyHeaders (headers) {\n    if (typeof headers === 'undefined') {\n      throw new InvalidArgumentError('headers must be defined')\n    }\n\n    this[kDefaultHeaders] = headers\n    return this\n  }\n\n  /**\n   * Set default reply trailers on the interceptor for subsequent replies\n   */\n  defaultReplyTrailers (trailers) {\n    if (typeof trailers === 'undefined') {\n      throw new InvalidArgumentError('trailers must be defined')\n    }\n\n    this[kDefaultTrailers] = trailers\n    return this\n  }\n\n  /**\n   * Set reply content length header for replies on the interceptor\n   */\n  replyContentLength () {\n    this[kContentLength] = true\n    return this\n  }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Pool = require('../dispatcher/pool')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kMockAgent,\n  kClose,\n  kOriginalClose,\n  kOrigin,\n  kOriginalDispatch,\n  kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockPool provides an API that extends the Pool to influence the mockDispatches.\n */\nclass MockPool extends Pool {\n  constructor (origin, opts) {\n    super(origin, opts)\n\n    if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n\n    this[kMockAgent] = opts.agent\n    this[kOrigin] = origin\n    this[kDispatches] = []\n    this[kConnected] = 1\n    this[kOriginalDispatch] = this.dispatch\n    this[kOriginalClose] = this.close.bind(this)\n\n    this.dispatch = buildMockDispatch.call(this)\n    this.close = this[kClose]\n  }\n\n  get [Symbols.kConnected] () {\n    return this[kConnected]\n  }\n\n  /**\n   * Sets up the base interceptor for mocking replies from undici.\n   */\n  intercept (opts) {\n    return new MockInterceptor(opts, this[kDispatches])\n  }\n\n  async [kClose] () {\n    await promisify(this[kOriginalClose])()\n    this[kConnected] = 0\n    this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n  }\n}\n\nmodule.exports = MockPool\n","'use strict'\n\nmodule.exports = {\n  kAgent: Symbol('agent'),\n  kOptions: Symbol('options'),\n  kFactory: Symbol('factory'),\n  kDispatches: Symbol('dispatches'),\n  kDispatchKey: Symbol('dispatch key'),\n  kDefaultHeaders: Symbol('default headers'),\n  kDefaultTrailers: Symbol('default trailers'),\n  kContentLength: Symbol('content length'),\n  kMockAgent: Symbol('mock agent'),\n  kMockAgentSet: Symbol('mock agent set'),\n  kMockAgentGet: Symbol('mock agent get'),\n  kMockDispatch: Symbol('mock dispatch'),\n  kClose: Symbol('close'),\n  kOriginalClose: Symbol('original agent close'),\n  kOrigin: Symbol('origin'),\n  kIsMockActive: Symbol('is mock active'),\n  kNetConnect: Symbol('net connect'),\n  kGetNetConnect: Symbol('get net connect'),\n  kConnected: Symbol('connected')\n}\n","'use strict'\n\nconst { MockNotMatchedError } = require('./mock-errors')\nconst {\n  kDispatches,\n  kMockAgent,\n  kOriginalDispatch,\n  kOrigin,\n  kGetNetConnect\n} = require('./mock-symbols')\nconst { buildURL } = require('../core/util')\nconst { STATUS_CODES } = require('node:http')\nconst {\n  types: {\n    isPromise\n  }\n} = require('node:util')\n\nfunction matchValue (match, value) {\n  if (typeof match === 'string') {\n    return match === value\n  }\n  if (match instanceof RegExp) {\n    return match.test(value)\n  }\n  if (typeof match === 'function') {\n    return match(value) === true\n  }\n  return false\n}\n\nfunction lowerCaseEntries (headers) {\n  return Object.fromEntries(\n    Object.entries(headers).map(([headerName, headerValue]) => {\n      return [headerName.toLocaleLowerCase(), headerValue]\n    })\n  )\n}\n\n/**\n * @param {import('../../index').Headers|string[]|Record} headers\n * @param {string} key\n */\nfunction getHeaderByName (headers, key) {\n  if (Array.isArray(headers)) {\n    for (let i = 0; i < headers.length; i += 2) {\n      if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {\n        return headers[i + 1]\n      }\n    }\n\n    return undefined\n  } else if (typeof headers.get === 'function') {\n    return headers.get(key)\n  } else {\n    return lowerCaseEntries(headers)[key.toLocaleLowerCase()]\n  }\n}\n\n/** @param {string[]} headers */\nfunction buildHeadersFromArray (headers) { // fetch HeadersList\n  const clone = headers.slice()\n  const entries = []\n  for (let index = 0; index < clone.length; index += 2) {\n    entries.push([clone[index], clone[index + 1]])\n  }\n  return Object.fromEntries(entries)\n}\n\nfunction matchHeaders (mockDispatch, headers) {\n  if (typeof mockDispatch.headers === 'function') {\n    if (Array.isArray(headers)) { // fetch HeadersList\n      headers = buildHeadersFromArray(headers)\n    }\n    return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})\n  }\n  if (typeof mockDispatch.headers === 'undefined') {\n    return true\n  }\n  if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {\n    return false\n  }\n\n  for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {\n    const headerValue = getHeaderByName(headers, matchHeaderName)\n\n    if (!matchValue(matchHeaderValue, headerValue)) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction safeUrl (path) {\n  if (typeof path !== 'string') {\n    return path\n  }\n\n  const pathSegments = path.split('?')\n\n  if (pathSegments.length !== 2) {\n    return path\n  }\n\n  const qp = new URLSearchParams(pathSegments.pop())\n  qp.sort()\n  return [...pathSegments, qp.toString()].join('?')\n}\n\nfunction matchKey (mockDispatch, { path, method, body, headers }) {\n  const pathMatch = matchValue(mockDispatch.path, path)\n  const methodMatch = matchValue(mockDispatch.method, method)\n  const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true\n  const headersMatch = matchHeaders(mockDispatch, headers)\n  return pathMatch && methodMatch && bodyMatch && headersMatch\n}\n\nfunction getResponseData (data) {\n  if (Buffer.isBuffer(data)) {\n    return data\n  } else if (data instanceof Uint8Array) {\n    return data\n  } else if (data instanceof ArrayBuffer) {\n    return data\n  } else if (typeof data === 'object') {\n    return JSON.stringify(data)\n  } else {\n    return data.toString()\n  }\n}\n\nfunction getMockDispatch (mockDispatches, key) {\n  const basePath = key.query ? buildURL(key.path, key.query) : key.path\n  const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath\n\n  // Match path\n  let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)\n  }\n\n  // Match method\n  matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)\n  }\n\n  // Match body\n  matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)\n  }\n\n  // Match headers\n  matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))\n  if (matchedMockDispatches.length === 0) {\n    const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers\n    throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)\n  }\n\n  return matchedMockDispatches[0]\n}\n\nfunction addMockDispatch (mockDispatches, key, data) {\n  const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }\n  const replyData = typeof data === 'function' ? { callback: data } : { ...data }\n  const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }\n  mockDispatches.push(newMockDispatch)\n  return newMockDispatch\n}\n\nfunction deleteMockDispatch (mockDispatches, key) {\n  const index = mockDispatches.findIndex(dispatch => {\n    if (!dispatch.consumed) {\n      return false\n    }\n    return matchKey(dispatch, key)\n  })\n  if (index !== -1) {\n    mockDispatches.splice(index, 1)\n  }\n}\n\nfunction buildKey (opts) {\n  const { path, method, body, headers, query } = opts\n  return {\n    path,\n    method,\n    body,\n    headers,\n    query\n  }\n}\n\nfunction generateKeyValues (data) {\n  const keys = Object.keys(data)\n  const result = []\n  for (let i = 0; i < keys.length; ++i) {\n    const key = keys[i]\n    const value = data[key]\n    const name = Buffer.from(`${key}`)\n    if (Array.isArray(value)) {\n      for (let j = 0; j < value.length; ++j) {\n        result.push(name, Buffer.from(`${value[j]}`))\n      }\n    } else {\n      result.push(name, Buffer.from(`${value}`))\n    }\n  }\n  return result\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n * @param {number} statusCode\n */\nfunction getStatusText (statusCode) {\n  return STATUS_CODES[statusCode] || 'unknown'\n}\n\nasync function getResponse (body) {\n  const buffers = []\n  for await (const data of body) {\n    buffers.push(data)\n  }\n  return Buffer.concat(buffers).toString('utf8')\n}\n\n/**\n * Mock dispatch function used to simulate undici dispatches\n */\nfunction mockDispatch (opts, handler) {\n  // Get mock dispatch from built key\n  const key = buildKey(opts)\n  const mockDispatch = getMockDispatch(this[kDispatches], key)\n\n  mockDispatch.timesInvoked++\n\n  // Here's where we resolve a callback if a callback is present for the dispatch data.\n  if (mockDispatch.data.callback) {\n    mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }\n  }\n\n  // Parse mockDispatch data\n  const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch\n  const { timesInvoked, times } = mockDispatch\n\n  // If it's used up and not persistent, mark as consumed\n  mockDispatch.consumed = !persist && timesInvoked >= times\n  mockDispatch.pending = timesInvoked < times\n\n  // If specified, trigger dispatch error\n  if (error !== null) {\n    deleteMockDispatch(this[kDispatches], key)\n    handler.onError(error)\n    return true\n  }\n\n  // Handle the request with a delay if necessary\n  if (typeof delay === 'number' && delay > 0) {\n    setTimeout(() => {\n      handleReply(this[kDispatches])\n    }, delay)\n  } else {\n    handleReply(this[kDispatches])\n  }\n\n  function handleReply (mockDispatches, _data = data) {\n    // fetch's HeadersList is a 1D string array\n    const optsHeaders = Array.isArray(opts.headers)\n      ? buildHeadersFromArray(opts.headers)\n      : opts.headers\n    const body = typeof _data === 'function'\n      ? _data({ ...opts, headers: optsHeaders })\n      : _data\n\n    // util.types.isPromise is likely needed for jest.\n    if (isPromise(body)) {\n      // If handleReply is asynchronous, throwing an error\n      // in the callback will reject the promise, rather than\n      // synchronously throw the error, which breaks some tests.\n      // Rather, we wait for the callback to resolve if it is a\n      // promise, and then re-run handleReply with the new body.\n      body.then((newData) => handleReply(mockDispatches, newData))\n      return\n    }\n\n    const responseData = getResponseData(body)\n    const responseHeaders = generateKeyValues(headers)\n    const responseTrailers = generateKeyValues(trailers)\n\n    handler.onConnect?.(err => handler.onError(err), null)\n    handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))\n    handler.onData?.(Buffer.from(responseData))\n    handler.onComplete?.(responseTrailers)\n    deleteMockDispatch(mockDispatches, key)\n  }\n\n  function resume () {}\n\n  return true\n}\n\nfunction buildMockDispatch () {\n  const agent = this[kMockAgent]\n  const origin = this[kOrigin]\n  const originalDispatch = this[kOriginalDispatch]\n\n  return function dispatch (opts, handler) {\n    if (agent.isMockActive) {\n      try {\n        mockDispatch.call(this, opts, handler)\n      } catch (error) {\n        if (error instanceof MockNotMatchedError) {\n          const netConnect = agent[kGetNetConnect]()\n          if (netConnect === false) {\n            throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)\n          }\n          if (checkNetConnect(netConnect, origin)) {\n            originalDispatch.call(this, opts, handler)\n          } else {\n            throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)\n          }\n        } else {\n          throw error\n        }\n      }\n    } else {\n      originalDispatch.call(this, opts, handler)\n    }\n  }\n}\n\nfunction checkNetConnect (netConnect, origin) {\n  const url = new URL(origin)\n  if (netConnect === true) {\n    return true\n  } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {\n    return true\n  }\n  return false\n}\n\nfunction buildMockOptions (opts) {\n  if (opts) {\n    const { agent, ...mockOptions } = opts\n    return mockOptions\n  }\n}\n\nmodule.exports = {\n  getResponseData,\n  getMockDispatch,\n  addMockDispatch,\n  deleteMockDispatch,\n  buildKey,\n  generateKeyValues,\n  matchValue,\n  getResponse,\n  getStatusText,\n  mockDispatch,\n  buildMockDispatch,\n  checkNetConnect,\n  buildMockOptions,\n  getHeaderByName,\n  buildHeadersFromArray\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst { Console } = require('node:console')\n\nconst PERSISTENT = process.versions.icu ? '✅' : 'Y '\nconst NOT_PERSISTENT = process.versions.icu ? '❌' : 'N '\n\n/**\n * Gets the output of `console.table(…)` as a string.\n */\nmodule.exports = class PendingInterceptorsFormatter {\n  constructor ({ disableColors } = {}) {\n    this.transform = new Transform({\n      transform (chunk, _enc, cb) {\n        cb(null, chunk)\n      }\n    })\n\n    this.logger = new Console({\n      stdout: this.transform,\n      inspectOptions: {\n        colors: !disableColors && !process.env.CI\n      }\n    })\n  }\n\n  format (pendingInterceptors) {\n    const withPrettyHeaders = pendingInterceptors.map(\n      ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({\n        Method: method,\n        Origin: origin,\n        Path: path,\n        'Status code': statusCode,\n        Persistent: persist ? PERSISTENT : NOT_PERSISTENT,\n        Invocations: timesInvoked,\n        Remaining: persist ? Infinity : times - timesInvoked\n      }))\n\n    this.logger.table(withPrettyHeaders)\n    return this.transform.read().toString()\n  }\n}\n","'use strict'\n\nconst singulars = {\n  pronoun: 'it',\n  is: 'is',\n  was: 'was',\n  this: 'this'\n}\n\nconst plurals = {\n  pronoun: 'they',\n  is: 'are',\n  was: 'were',\n  this: 'these'\n}\n\nmodule.exports = class Pluralizer {\n  constructor (singular, plural) {\n    this.singular = singular\n    this.plural = plural\n  }\n\n  pluralize (count) {\n    const one = count === 1\n    const keys = one ? singulars : plurals\n    const noun = one ? this.singular : this.plural\n    return { ...keys, count, noun }\n  }\n}\n","'use strict'\n\n/**\n * This module offers an optimized timer implementation designed for scenarios\n * where high precision is not critical.\n *\n * The timer achieves faster performance by using a low-resolution approach,\n * with an accuracy target of within 500ms. This makes it particularly useful\n * for timers with delays of 1 second or more, where exact timing is less\n * crucial.\n *\n * It's important to note that Node.js timers are inherently imprecise, as\n * delays can occur due to the event loop being blocked by other operations.\n * Consequently, timers may trigger later than their scheduled time.\n */\n\n/**\n * The fastNow variable contains the internal fast timer clock value.\n *\n * @type {number}\n */\nlet fastNow = 0\n\n/**\n * RESOLUTION_MS represents the target resolution time in milliseconds.\n *\n * @type {number}\n * @default 1000\n */\nconst RESOLUTION_MS = 1e3\n\n/**\n * TICK_MS defines the desired interval in milliseconds between each tick.\n * The target value is set to half the resolution time, minus 1 ms, to account\n * for potential event loop overhead.\n *\n * @type {number}\n * @default 499\n */\nconst TICK_MS = (RESOLUTION_MS >> 1) - 1\n\n/**\n * fastNowTimeout is a Node.js timer used to manage and process\n * the FastTimers stored in the `fastTimers` array.\n *\n * @type {NodeJS.Timeout}\n */\nlet fastNowTimeout\n\n/**\n * The kFastTimer symbol is used to identify FastTimer instances.\n *\n * @type {Symbol}\n */\nconst kFastTimer = Symbol('kFastTimer')\n\n/**\n * The fastTimers array contains all active FastTimers.\n *\n * @type {FastTimer[]}\n */\nconst fastTimers = []\n\n/**\n * These constants represent the various states of a FastTimer.\n */\n\n/**\n * The `NOT_IN_LIST` constant indicates that the FastTimer is not included\n * in the `fastTimers` array. Timers with this status will not be processed\n * during the next tick by the `onTick` function.\n *\n * A FastTimer can be re-added to the `fastTimers` array by invoking the\n * `refresh` method on the FastTimer instance.\n *\n * @type {-2}\n */\nconst NOT_IN_LIST = -2\n\n/**\n * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled\n * for removal from the `fastTimers` array. A FastTimer in this state will\n * be removed in the next tick by the `onTick` function and will no longer\n * be processed.\n *\n * This status is also set when the `clear` method is called on the FastTimer instance.\n *\n * @type {-1}\n */\nconst TO_BE_CLEARED = -1\n\n/**\n * The `PENDING` constant signifies that the FastTimer is awaiting processing\n * in the next tick by the `onTick` function. Timers with this status will have\n * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick.\n *\n * @type {0}\n */\nconst PENDING = 0\n\n/**\n * The `ACTIVE` constant indicates that the FastTimer is active and waiting\n * for its timer to expire. During the next tick, the `onTick` function will\n * check if the timer has expired, and if so, it will execute the associated callback.\n *\n * @type {1}\n */\nconst ACTIVE = 1\n\n/**\n * The onTick function processes the fastTimers array.\n *\n * @returns {void}\n */\nfunction onTick () {\n  /**\n   * Increment the fastNow value by the TICK_MS value, despite the actual time\n   * that has passed since the last tick. This approach ensures independence\n   * from the system clock and delays caused by a blocked event loop.\n   *\n   * @type {number}\n   */\n  fastNow += TICK_MS\n\n  /**\n   * The `idx` variable is used to iterate over the `fastTimers` array.\n   * Expired timers are removed by replacing them with the last element in the array.\n   * Consequently, `idx` is only incremented when the current element is not removed.\n   *\n   * @type {number}\n   */\n  let idx = 0\n\n  /**\n   * The len variable will contain the length of the fastTimers array\n   * and will be decremented when a FastTimer should be removed from the\n   * fastTimers array.\n   *\n   * @type {number}\n   */\n  let len = fastTimers.length\n\n  while (idx < len) {\n    /**\n     * @type {FastTimer}\n     */\n    const timer = fastTimers[idx]\n\n    // If the timer is in the ACTIVE state and the timer has expired, it will\n    // be processed in the next tick.\n    if (timer._state === PENDING) {\n      // Set the _idleStart value to the fastNow value minus the TICK_MS value\n      // to account for the time the timer was in the PENDING state.\n      timer._idleStart = fastNow - TICK_MS\n      timer._state = ACTIVE\n    } else if (\n      timer._state === ACTIVE &&\n      fastNow >= timer._idleStart + timer._idleTimeout\n    ) {\n      timer._state = TO_BE_CLEARED\n      timer._idleStart = -1\n      timer._onTimeout(timer._timerArg)\n    }\n\n    if (timer._state === TO_BE_CLEARED) {\n      timer._state = NOT_IN_LIST\n\n      // Move the last element to the current index and decrement len if it is\n      // not the only element in the array.\n      if (--len !== 0) {\n        fastTimers[idx] = fastTimers[len]\n      }\n    } else {\n      ++idx\n    }\n  }\n\n  // Set the length of the fastTimers array to the new length and thus\n  // removing the excess FastTimers elements from the array.\n  fastTimers.length = len\n\n  // If there are still active FastTimers in the array, refresh the Timer.\n  // If there are no active FastTimers, the timer will be refreshed again\n  // when a new FastTimer is instantiated.\n  if (fastTimers.length !== 0) {\n    refreshTimeout()\n  }\n}\n\nfunction refreshTimeout () {\n  // If the fastNowTimeout is already set, refresh it.\n  if (fastNowTimeout) {\n    fastNowTimeout.refresh()\n  // fastNowTimeout is not instantiated yet, create a new Timer.\n  } else {\n    clearTimeout(fastNowTimeout)\n    fastNowTimeout = setTimeout(onTick, TICK_MS)\n\n    // If the Timer has an unref method, call it to allow the process to exit if\n    // there are no other active handles.\n    if (fastNowTimeout.unref) {\n      fastNowTimeout.unref()\n    }\n  }\n}\n\n/**\n * The `FastTimer` class is a data structure designed to store and manage\n * timer information.\n */\nclass FastTimer {\n  [kFastTimer] = true\n\n  /**\n   * The state of the timer, which can be one of the following:\n   * - NOT_IN_LIST (-2)\n   * - TO_BE_CLEARED (-1)\n   * - PENDING (0)\n   * - ACTIVE (1)\n   *\n   * @type {-2|-1|0|1}\n   * @private\n   */\n  _state = NOT_IN_LIST\n\n  /**\n   * The number of milliseconds to wait before calling the callback.\n   *\n   * @type {number}\n   * @private\n   */\n  _idleTimeout = -1\n\n  /**\n   * The time in milliseconds when the timer was started. This value is used to\n   * calculate when the timer should expire.\n   *\n   * @type {number}\n   * @default -1\n   * @private\n   */\n  _idleStart = -1\n\n  /**\n   * The function to be executed when the timer expires.\n   * @type {Function}\n   * @private\n   */\n  _onTimeout\n\n  /**\n   * The argument to be passed to the callback when the timer expires.\n   *\n   * @type {*}\n   * @private\n   */\n  _timerArg\n\n  /**\n   * @constructor\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should wait\n   * before the specified function or code is executed.\n   * @param {*} arg\n   */\n  constructor (callback, delay, arg) {\n    this._onTimeout = callback\n    this._idleTimeout = delay\n    this._timerArg = arg\n\n    this.refresh()\n  }\n\n  /**\n   * Sets the timer's start time to the current time, and reschedules the timer\n   * to call its callback at the previously specified duration adjusted to the\n   * current time.\n   * Using this on a timer that has already called its callback will reactivate\n   * the timer.\n   *\n   * @returns {void}\n   */\n  refresh () {\n    // In the special case that the timer is not in the list of active timers,\n    // add it back to the array to be processed in the next tick by the onTick\n    // function.\n    if (this._state === NOT_IN_LIST) {\n      fastTimers.push(this)\n    }\n\n    // If the timer is the only active timer, refresh the fastNowTimeout for\n    // better resolution.\n    if (!fastNowTimeout || fastTimers.length === 1) {\n      refreshTimeout()\n    }\n\n    // Setting the state to PENDING will cause the timer to be reset in the\n    // next tick by the onTick function.\n    this._state = PENDING\n  }\n\n  /**\n   * The `clear` method cancels the timer, preventing it from executing.\n   *\n   * @returns {void}\n   * @private\n   */\n  clear () {\n    // Set the state to TO_BE_CLEARED to mark the timer for removal in the next\n    // tick by the onTick function.\n    this._state = TO_BE_CLEARED\n\n    // Reset the _idleStart value to -1 to indicate that the timer is no longer\n    // active.\n    this._idleStart = -1\n  }\n}\n\n/**\n * This module exports a setTimeout and clearTimeout function that can be\n * used as a drop-in replacement for the native functions.\n */\nmodule.exports = {\n  /**\n   * The setTimeout() method sets a timer which executes a function once the\n   * timer expires.\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should\n   * wait before the specified function or code is executed.\n   * @param {*} [arg] An optional argument to be passed to the callback function\n   * when the timer expires.\n   * @returns {NodeJS.Timeout|FastTimer}\n   */\n  setTimeout (callback, delay, arg) {\n    // If the delay is less than or equal to the RESOLUTION_MS value return a\n    // native Node.js Timer instance.\n    return delay <= RESOLUTION_MS\n      ? setTimeout(callback, delay, arg)\n      : new FastTimer(callback, delay, arg)\n  },\n  /**\n   * The clearTimeout method cancels an instantiated Timer previously created\n   * by calling setTimeout.\n   *\n   * @param {NodeJS.Timeout|FastTimer} timeout\n   */\n  clearTimeout (timeout) {\n    // If the timeout is a FastTimer, call its own clear method.\n    if (timeout[kFastTimer]) {\n      /**\n       * @type {FastTimer}\n       */\n      timeout.clear()\n      // Otherwise it is an instance of a native NodeJS.Timeout, so call the\n      // Node.js native clearTimeout function.\n    } else {\n      clearTimeout(timeout)\n    }\n  },\n  /**\n   * The setFastTimeout() method sets a fastTimer which executes a function once\n   * the timer expires.\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should\n   * wait before the specified function or code is executed.\n   * @param {*} [arg] An optional argument to be passed to the callback function\n   * when the timer expires.\n   * @returns {FastTimer}\n   */\n  setFastTimeout (callback, delay, arg) {\n    return new FastTimer(callback, delay, arg)\n  },\n  /**\n   * The clearTimeout method cancels an instantiated FastTimer previously\n   * created by calling setFastTimeout.\n   *\n   * @param {FastTimer} timeout\n   */\n  clearFastTimeout (timeout) {\n    timeout.clear()\n  },\n  /**\n   * The now method returns the value of the internal fast timer clock.\n   *\n   * @returns {number}\n   */\n  now () {\n    return fastNow\n  },\n  /**\n   * Trigger the onTick function to process the fastTimers array.\n   * Exported for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   * @param {number} [delay=0] The delay in milliseconds to add to the now value.\n   */\n  tick (delay = 0) {\n    fastNow += delay - RESOLUTION_MS + 1\n    onTick()\n    onTick()\n  },\n  /**\n   * Reset FastTimers.\n   * Exported for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   */\n  reset () {\n    fastNow = 0\n    fastTimers.length = 0\n    clearTimeout(fastNowTimeout)\n    fastNowTimeout = null\n  },\n  /**\n   * Exporting for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   */\n  kFastTimer\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { urlEquals, getFieldValues } = require('./util')\nconst { kEnumerableProperty, isDisturbed } = require('../../core/util')\nconst { webidl } = require('../fetch/webidl')\nconst { Response, cloneResponse, fromInnerResponse } = require('../fetch/response')\nconst { Request, fromInnerRequest } = require('../fetch/request')\nconst { kState } = require('../fetch/symbols')\nconst { fetching } = require('../fetch/index')\nconst { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require('../fetch/util')\nconst assert = require('node:assert')\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation\n * @typedef {Object} CacheBatchOperation\n * @property {'delete' | 'put'} type\n * @property {any} request\n * @property {any} response\n * @property {import('../../types/cache').CacheQueryOptions} options\n */\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list\n * @typedef {[any, any][]} requestResponseList\n */\n\nclass Cache {\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list\n   * @type {requestResponseList}\n   */\n  #relevantRequestResponseList\n\n  constructor () {\n    if (arguments[0] !== kConstruct) {\n      webidl.illegalConstructor()\n    }\n\n    webidl.util.markAsUncloneable(this)\n    this.#relevantRequestResponseList = arguments[1]\n  }\n\n  async match (request, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.match'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    const p = this.#internalMatchAll(request, options, 1)\n\n    if (p.length === 0) {\n      return\n    }\n\n    return p[0]\n  }\n\n  async matchAll (request = undefined, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.matchAll'\n    if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    return this.#internalMatchAll(request, options)\n  }\n\n  async add (request) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.add'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n\n    // 1.\n    const requests = [request]\n\n    // 2.\n    const responseArrayPromise = this.addAll(requests)\n\n    // 3.\n    return await responseArrayPromise\n  }\n\n  async addAll (requests) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.addAll'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    // 1.\n    const responsePromises = []\n\n    // 2.\n    const requestList = []\n\n    // 3.\n    for (let request of requests) {\n      if (request === undefined) {\n        throw webidl.errors.conversionFailed({\n          prefix,\n          argument: 'Argument 1',\n          types: ['undefined is not allowed']\n        })\n      }\n\n      request = webidl.converters.RequestInfo(request)\n\n      if (typeof request === 'string') {\n        continue\n      }\n\n      // 3.1\n      const r = request[kState]\n\n      // 3.2\n      if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {\n        throw webidl.errors.exception({\n          header: prefix,\n          message: 'Expected http/s scheme when method is not GET.'\n        })\n      }\n    }\n\n    // 4.\n    /** @type {ReturnType[]} */\n    const fetchControllers = []\n\n    // 5.\n    for (const request of requests) {\n      // 5.1\n      const r = new Request(request)[kState]\n\n      // 5.2\n      if (!urlIsHttpHttpsScheme(r.url)) {\n        throw webidl.errors.exception({\n          header: prefix,\n          message: 'Expected http/s scheme.'\n        })\n      }\n\n      // 5.4\n      r.initiator = 'fetch'\n      r.destination = 'subresource'\n\n      // 5.5\n      requestList.push(r)\n\n      // 5.6\n      const responsePromise = createDeferredPromise()\n\n      // 5.7\n      fetchControllers.push(fetching({\n        request: r,\n        processResponse (response) {\n          // 1.\n          if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {\n            responsePromise.reject(webidl.errors.exception({\n              header: 'Cache.addAll',\n              message: 'Received an invalid status code or the request failed.'\n            }))\n          } else if (response.headersList.contains('vary')) { // 2.\n            // 2.1\n            const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n            // 2.2\n            for (const fieldValue of fieldValues) {\n              // 2.2.1\n              if (fieldValue === '*') {\n                responsePromise.reject(webidl.errors.exception({\n                  header: 'Cache.addAll',\n                  message: 'invalid vary field value'\n                }))\n\n                for (const controller of fetchControllers) {\n                  controller.abort()\n                }\n\n                return\n              }\n            }\n          }\n        },\n        processResponseEndOfBody (response) {\n          // 1.\n          if (response.aborted) {\n            responsePromise.reject(new DOMException('aborted', 'AbortError'))\n            return\n          }\n\n          // 2.\n          responsePromise.resolve(response)\n        }\n      }))\n\n      // 5.8\n      responsePromises.push(responsePromise.promise)\n    }\n\n    // 6.\n    const p = Promise.all(responsePromises)\n\n    // 7.\n    const responses = await p\n\n    // 7.1\n    const operations = []\n\n    // 7.2\n    let index = 0\n\n    // 7.3\n    for (const response of responses) {\n      // 7.3.1\n      /** @type {CacheBatchOperation} */\n      const operation = {\n        type: 'put', // 7.3.2\n        request: requestList[index], // 7.3.3\n        response // 7.3.4\n      }\n\n      operations.push(operation) // 7.3.5\n\n      index++ // 7.3.6\n    }\n\n    // 7.5\n    const cacheJobPromise = createDeferredPromise()\n\n    // 7.6.1\n    let errorData = null\n\n    // 7.6.2\n    try {\n      this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    // 7.6.3\n    queueMicrotask(() => {\n      // 7.6.3.1\n      if (errorData === null) {\n        cacheJobPromise.resolve(undefined)\n      } else {\n        // 7.6.3.2\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    // 7.7\n    return cacheJobPromise.promise\n  }\n\n  async put (request, response) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.put'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    response = webidl.converters.Response(response, prefix, 'response')\n\n    // 1.\n    let innerRequest = null\n\n    // 2.\n    if (request instanceof Request) {\n      innerRequest = request[kState]\n    } else { // 3.\n      innerRequest = new Request(request)[kState]\n    }\n\n    // 4.\n    if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Expected an http/s scheme when method is not GET'\n      })\n    }\n\n    // 5.\n    const innerResponse = response[kState]\n\n    // 6.\n    if (innerResponse.status === 206) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Got 206 status'\n      })\n    }\n\n    // 7.\n    if (innerResponse.headersList.contains('vary')) {\n      // 7.1.\n      const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))\n\n      // 7.2.\n      for (const fieldValue of fieldValues) {\n        // 7.2.1\n        if (fieldValue === '*') {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: 'Got * vary field value'\n          })\n        }\n      }\n    }\n\n    // 8.\n    if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Response body is locked or disturbed'\n      })\n    }\n\n    // 9.\n    const clonedResponse = cloneResponse(innerResponse)\n\n    // 10.\n    const bodyReadPromise = createDeferredPromise()\n\n    // 11.\n    if (innerResponse.body != null) {\n      // 11.1\n      const stream = innerResponse.body.stream\n\n      // 11.2\n      const reader = stream.getReader()\n\n      // 11.3\n      readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)\n    } else {\n      bodyReadPromise.resolve(undefined)\n    }\n\n    // 12.\n    /** @type {CacheBatchOperation[]} */\n    const operations = []\n\n    // 13.\n    /** @type {CacheBatchOperation} */\n    const operation = {\n      type: 'put', // 14.\n      request: innerRequest, // 15.\n      response: clonedResponse // 16.\n    }\n\n    // 17.\n    operations.push(operation)\n\n    // 19.\n    const bytes = await bodyReadPromise.promise\n\n    if (clonedResponse.body != null) {\n      clonedResponse.body.source = bytes\n    }\n\n    // 19.1\n    const cacheJobPromise = createDeferredPromise()\n\n    // 19.2.1\n    let errorData = null\n\n    // 19.2.2\n    try {\n      this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    // 19.2.3\n    queueMicrotask(() => {\n      // 19.2.3.1\n      if (errorData === null) {\n        cacheJobPromise.resolve()\n      } else { // 19.2.3.2\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    return cacheJobPromise.promise\n  }\n\n  async delete (request, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    /**\n     * @type {Request}\n     */\n    let r = null\n\n    if (request instanceof Request) {\n      r = request[kState]\n\n      if (r.method !== 'GET' && !options.ignoreMethod) {\n        return false\n      }\n    } else {\n      assert(typeof request === 'string')\n\n      r = new Request(request)[kState]\n    }\n\n    /** @type {CacheBatchOperation[]} */\n    const operations = []\n\n    /** @type {CacheBatchOperation} */\n    const operation = {\n      type: 'delete',\n      request: r,\n      options\n    }\n\n    operations.push(operation)\n\n    const cacheJobPromise = createDeferredPromise()\n\n    let errorData = null\n    let requestResponses\n\n    try {\n      requestResponses = this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    queueMicrotask(() => {\n      if (errorData === null) {\n        cacheJobPromise.resolve(!!requestResponses?.length)\n      } else {\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    return cacheJobPromise.promise\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys\n   * @param {any} request\n   * @param {import('../../types/cache').CacheQueryOptions} options\n   * @returns {Promise}\n   */\n  async keys (request = undefined, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.keys'\n\n    if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    // 1.\n    let r = null\n\n    // 2.\n    if (request !== undefined) {\n      // 2.1\n      if (request instanceof Request) {\n        // 2.1.1\n        r = request[kState]\n\n        // 2.1.2\n        if (r.method !== 'GET' && !options.ignoreMethod) {\n          return []\n        }\n      } else if (typeof request === 'string') { // 2.2\n        r = new Request(request)[kState]\n      }\n    }\n\n    // 4.\n    const promise = createDeferredPromise()\n\n    // 5.\n    // 5.1\n    const requests = []\n\n    // 5.2\n    if (request === undefined) {\n      // 5.2.1\n      for (const requestResponse of this.#relevantRequestResponseList) {\n        // 5.2.1.1\n        requests.push(requestResponse[0])\n      }\n    } else { // 5.3\n      // 5.3.1\n      const requestResponses = this.#queryCache(r, options)\n\n      // 5.3.2\n      for (const requestResponse of requestResponses) {\n        // 5.3.2.1\n        requests.push(requestResponse[0])\n      }\n    }\n\n    // 5.4\n    queueMicrotask(() => {\n      // 5.4.1\n      const requestList = []\n\n      // 5.4.2\n      for (const request of requests) {\n        const requestObject = fromInnerRequest(\n          request,\n          new AbortController().signal,\n          'immutable'\n        )\n        // 5.4.2.1\n        requestList.push(requestObject)\n      }\n\n      // 5.4.3\n      promise.resolve(Object.freeze(requestList))\n    })\n\n    return promise.promise\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm\n   * @param {CacheBatchOperation[]} operations\n   * @returns {requestResponseList}\n   */\n  #batchCacheOperations (operations) {\n    // 1.\n    const cache = this.#relevantRequestResponseList\n\n    // 2.\n    const backupCache = [...cache]\n\n    // 3.\n    const addedItems = []\n\n    // 4.1\n    const resultList = []\n\n    try {\n      // 4.2\n      for (const operation of operations) {\n        // 4.2.1\n        if (operation.type !== 'delete' && operation.type !== 'put') {\n          throw webidl.errors.exception({\n            header: 'Cache.#batchCacheOperations',\n            message: 'operation type does not match \"delete\" or \"put\"'\n          })\n        }\n\n        // 4.2.2\n        if (operation.type === 'delete' && operation.response != null) {\n          throw webidl.errors.exception({\n            header: 'Cache.#batchCacheOperations',\n            message: 'delete operation should not have an associated response'\n          })\n        }\n\n        // 4.2.3\n        if (this.#queryCache(operation.request, operation.options, addedItems).length) {\n          throw new DOMException('???', 'InvalidStateError')\n        }\n\n        // 4.2.4\n        let requestResponses\n\n        // 4.2.5\n        if (operation.type === 'delete') {\n          // 4.2.5.1\n          requestResponses = this.#queryCache(operation.request, operation.options)\n\n          // TODO: the spec is wrong, this is needed to pass WPTs\n          if (requestResponses.length === 0) {\n            return []\n          }\n\n          // 4.2.5.2\n          for (const requestResponse of requestResponses) {\n            const idx = cache.indexOf(requestResponse)\n            assert(idx !== -1)\n\n            // 4.2.5.2.1\n            cache.splice(idx, 1)\n          }\n        } else if (operation.type === 'put') { // 4.2.6\n          // 4.2.6.1\n          if (operation.response == null) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'put operation should have an associated response'\n            })\n          }\n\n          // 4.2.6.2\n          const r = operation.request\n\n          // 4.2.6.3\n          if (!urlIsHttpHttpsScheme(r.url)) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'expected http or https scheme'\n            })\n          }\n\n          // 4.2.6.4\n          if (r.method !== 'GET') {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'not get method'\n            })\n          }\n\n          // 4.2.6.5\n          if (operation.options != null) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'options must not be defined'\n            })\n          }\n\n          // 4.2.6.6\n          requestResponses = this.#queryCache(operation.request)\n\n          // 4.2.6.7\n          for (const requestResponse of requestResponses) {\n            const idx = cache.indexOf(requestResponse)\n            assert(idx !== -1)\n\n            // 4.2.6.7.1\n            cache.splice(idx, 1)\n          }\n\n          // 4.2.6.8\n          cache.push([operation.request, operation.response])\n\n          // 4.2.6.10\n          addedItems.push([operation.request, operation.response])\n        }\n\n        // 4.2.7\n        resultList.push([operation.request, operation.response])\n      }\n\n      // 4.3\n      return resultList\n    } catch (e) { // 5.\n      // 5.1\n      this.#relevantRequestResponseList.length = 0\n\n      // 5.2\n      this.#relevantRequestResponseList = backupCache\n\n      // 5.3\n      throw e\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#query-cache\n   * @param {any} requestQuery\n   * @param {import('../../types/cache').CacheQueryOptions} options\n   * @param {requestResponseList} targetStorage\n   * @returns {requestResponseList}\n   */\n  #queryCache (requestQuery, options, targetStorage) {\n    /** @type {requestResponseList} */\n    const resultList = []\n\n    const storage = targetStorage ?? this.#relevantRequestResponseList\n\n    for (const requestResponse of storage) {\n      const [cachedRequest, cachedResponse] = requestResponse\n      if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {\n        resultList.push(requestResponse)\n      }\n    }\n\n    return resultList\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm\n   * @param {any} requestQuery\n   * @param {any} request\n   * @param {any | null} response\n   * @param {import('../../types/cache').CacheQueryOptions | undefined} options\n   * @returns {boolean}\n   */\n  #requestMatchesCachedItem (requestQuery, request, response = null, options) {\n    // if (options?.ignoreMethod === false && request.method === 'GET') {\n    //   return false\n    // }\n\n    const queryURL = new URL(requestQuery.url)\n\n    const cachedURL = new URL(request.url)\n\n    if (options?.ignoreSearch) {\n      cachedURL.search = ''\n\n      queryURL.search = ''\n    }\n\n    if (!urlEquals(queryURL, cachedURL, true)) {\n      return false\n    }\n\n    if (\n      response == null ||\n      options?.ignoreVary ||\n      !response.headersList.contains('vary')\n    ) {\n      return true\n    }\n\n    const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n    for (const fieldValue of fieldValues) {\n      if (fieldValue === '*') {\n        return false\n      }\n\n      const requestValue = request.headersList.get(fieldValue)\n      const queryValue = requestQuery.headersList.get(fieldValue)\n\n      // If one has the header and the other doesn't, or one has\n      // a different value than the other, return false\n      if (requestValue !== queryValue) {\n        return false\n      }\n    }\n\n    return true\n  }\n\n  #internalMatchAll (request, options, maxResponses = Infinity) {\n    // 1.\n    let r = null\n\n    // 2.\n    if (request !== undefined) {\n      if (request instanceof Request) {\n        // 2.1.1\n        r = request[kState]\n\n        // 2.1.2\n        if (r.method !== 'GET' && !options.ignoreMethod) {\n          return []\n        }\n      } else if (typeof request === 'string') {\n        // 2.2.1\n        r = new Request(request)[kState]\n      }\n    }\n\n    // 5.\n    // 5.1\n    const responses = []\n\n    // 5.2\n    if (request === undefined) {\n      // 5.2.1\n      for (const requestResponse of this.#relevantRequestResponseList) {\n        responses.push(requestResponse[1])\n      }\n    } else { // 5.3\n      // 5.3.1\n      const requestResponses = this.#queryCache(r, options)\n\n      // 5.3.2\n      for (const requestResponse of requestResponses) {\n        responses.push(requestResponse[1])\n      }\n    }\n\n    // 5.4\n    // We don't implement CORs so we don't need to loop over the responses, yay!\n\n    // 5.5.1\n    const responseList = []\n\n    // 5.5.2\n    for (const response of responses) {\n      // 5.5.2.1\n      const responseObject = fromInnerResponse(response, 'immutable')\n\n      responseList.push(responseObject.clone())\n\n      if (responseList.length >= maxResponses) {\n        break\n      }\n    }\n\n    // 6.\n    return Object.freeze(responseList)\n  }\n}\n\nObject.defineProperties(Cache.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'Cache',\n    configurable: true\n  },\n  match: kEnumerableProperty,\n  matchAll: kEnumerableProperty,\n  add: kEnumerableProperty,\n  addAll: kEnumerableProperty,\n  put: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  keys: kEnumerableProperty\n})\n\nconst cacheQueryOptionConverters = [\n  {\n    key: 'ignoreSearch',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'ignoreMethod',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'ignoreVary',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n]\n\nwebidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)\n\nwebidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([\n  ...cacheQueryOptionConverters,\n  {\n    key: 'cacheName',\n    converter: webidl.converters.DOMString\n  }\n])\n\nwebidl.converters.Response = webidl.interfaceConverter(Response)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.RequestInfo\n)\n\nmodule.exports = {\n  Cache\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { Cache } = require('./cache')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass CacheStorage {\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map\n   * @type {Map}\n   */\n  async has (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.has'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    // 2.1.1\n    // 2.2\n    return this.#caches.has(cacheName)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open\n   * @param {string} cacheName\n   * @returns {Promise}\n   */\n  async open (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.open'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    // 2.1\n    if (this.#caches.has(cacheName)) {\n      // await caches.open('v1') !== await caches.open('v1')\n\n      // 2.1.1\n      const cache = this.#caches.get(cacheName)\n\n      // 2.1.1.1\n      return new Cache(kConstruct, cache)\n    }\n\n    // 2.2\n    const cache = []\n\n    // 2.3\n    this.#caches.set(cacheName, cache)\n\n    // 2.4\n    return new Cache(kConstruct, cache)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete\n   * @param {string} cacheName\n   * @returns {Promise}\n   */\n  async delete (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    return this.#caches.delete(cacheName)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys\n   * @returns {Promise}\n   */\n  async keys () {\n    webidl.brandCheck(this, CacheStorage)\n\n    // 2.1\n    const keys = this.#caches.keys()\n\n    // 2.2\n    return [...keys]\n  }\n}\n\nObject.defineProperties(CacheStorage.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'CacheStorage',\n    configurable: true\n  },\n  match: kEnumerableProperty,\n  has: kEnumerableProperty,\n  open: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  keys: kEnumerableProperty\n})\n\nmodule.exports = {\n  CacheStorage\n}\n","'use strict'\n\nmodule.exports = {\n  kConstruct: require('../../core/symbols').kConstruct\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { isValidHeaderName } = require('../fetch/util')\n\n/**\n * @see https://url.spec.whatwg.org/#concept-url-equals\n * @param {URL} A\n * @param {URL} B\n * @param {boolean | undefined} excludeFragment\n * @returns {boolean}\n */\nfunction urlEquals (A, B, excludeFragment = false) {\n  const serializedA = URLSerializer(A, excludeFragment)\n\n  const serializedB = URLSerializer(B, excludeFragment)\n\n  return serializedA === serializedB\n}\n\n/**\n * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262\n * @param {string} header\n */\nfunction getFieldValues (header) {\n  assert(header !== null)\n\n  const values = []\n\n  for (let value of header.split(',')) {\n    value = value.trim()\n\n    if (isValidHeaderName(value)) {\n      values.push(value)\n    }\n  }\n\n  return values\n}\n\nmodule.exports = {\n  urlEquals,\n  getFieldValues\n}\n","'use strict'\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size\nconst maxAttributeValueSize = 1024\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size\nconst maxNameValuePairSize = 4096\n\nmodule.exports = {\n  maxAttributeValueSize,\n  maxNameValuePairSize\n}\n","'use strict'\n\nconst { parseSetCookie } = require('./parse')\nconst { stringify } = require('./util')\nconst { webidl } = require('../fetch/webidl')\nconst { Headers } = require('../fetch/headers')\n\n/**\n * @typedef {Object} Cookie\n * @property {string} name\n * @property {string} value\n * @property {Date|number|undefined} expires\n * @property {number|undefined} maxAge\n * @property {string|undefined} domain\n * @property {string|undefined} path\n * @property {boolean|undefined} secure\n * @property {boolean|undefined} httpOnly\n * @property {'Strict'|'Lax'|'None'} sameSite\n * @property {string[]} unparsed\n */\n\n/**\n * @param {Headers} headers\n * @returns {Record}\n */\nfunction getCookies (headers) {\n  webidl.argumentLengthCheck(arguments, 1, 'getCookies')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const cookie = headers.get('cookie')\n  const out = {}\n\n  if (!cookie) {\n    return out\n  }\n\n  for (const piece of cookie.split(';')) {\n    const [name, ...value] = piece.split('=')\n\n    out[name.trim()] = value.join('=')\n  }\n\n  return out\n}\n\n/**\n * @param {Headers} headers\n * @param {string} name\n * @param {{ path?: string, domain?: string }|undefined} attributes\n * @returns {void}\n */\nfunction deleteCookie (headers, name, attributes) {\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const prefix = 'deleteCookie'\n  webidl.argumentLengthCheck(arguments, 2, prefix)\n\n  name = webidl.converters.DOMString(name, prefix, 'name')\n  attributes = webidl.converters.DeleteCookieAttributes(attributes)\n\n  // Matches behavior of\n  // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278\n  setCookie(headers, {\n    name,\n    value: '',\n    expires: new Date(0),\n    ...attributes\n  })\n}\n\n/**\n * @param {Headers} headers\n * @returns {Cookie[]}\n */\nfunction getSetCookies (headers) {\n  webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const cookies = headers.getSetCookie()\n\n  if (!cookies) {\n    return []\n  }\n\n  return cookies.map((pair) => parseSetCookie(pair))\n}\n\n/**\n * @param {Headers} headers\n * @param {Cookie} cookie\n * @returns {void}\n */\nfunction setCookie (headers, cookie) {\n  webidl.argumentLengthCheck(arguments, 2, 'setCookie')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  cookie = webidl.converters.Cookie(cookie)\n\n  const str = stringify(cookie)\n\n  if (str) {\n    headers.append('Set-Cookie', str)\n  }\n}\n\nwebidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'path',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'domain',\n    defaultValue: () => null\n  }\n])\n\nwebidl.converters.Cookie = webidl.dictionaryConverter([\n  {\n    converter: webidl.converters.DOMString,\n    key: 'name'\n  },\n  {\n    converter: webidl.converters.DOMString,\n    key: 'value'\n  },\n  {\n    converter: webidl.nullableConverter((value) => {\n      if (typeof value === 'number') {\n        return webidl.converters['unsigned long long'](value)\n      }\n\n      return new Date(value)\n    }),\n    key: 'expires',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters['long long']),\n    key: 'maxAge',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'domain',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'path',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.boolean),\n    key: 'secure',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.boolean),\n    key: 'httpOnly',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.converters.USVString,\n    key: 'sameSite',\n    allowedValues: ['Strict', 'Lax', 'None']\n  },\n  {\n    converter: webidl.sequenceConverter(webidl.converters.DOMString),\n    key: 'unparsed',\n    defaultValue: () => new Array(0)\n  }\n])\n\nmodule.exports = {\n  getCookies,\n  deleteCookie,\n  getSetCookies,\n  setCookie\n}\n","'use strict'\n\nconst { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')\nconst { isCTLExcludingHtab } = require('./util')\nconst { collectASequenceOfCodePointsFast } = require('../fetch/data-url')\nconst assert = require('node:assert')\n\n/**\n * @description Parses the field-value attributes of a set-cookie header string.\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} header\n * @returns if the header is invalid, null will be returned\n */\nfunction parseSetCookie (header) {\n  // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F\n  //    character (CTL characters excluding HTAB): Abort these steps and\n  //    ignore the set-cookie-string entirely.\n  if (isCTLExcludingHtab(header)) {\n    return null\n  }\n\n  let nameValuePair = ''\n  let unparsedAttributes = ''\n  let name = ''\n  let value = ''\n\n  // 2. If the set-cookie-string contains a %x3B (\";\") character:\n  if (header.includes(';')) {\n    // 1. The name-value-pair string consists of the characters up to,\n    //    but not including, the first %x3B (\";\"), and the unparsed-\n    //    attributes consist of the remainder of the set-cookie-string\n    //    (including the %x3B (\";\") in question).\n    const position = { position: 0 }\n\n    nameValuePair = collectASequenceOfCodePointsFast(';', header, position)\n    unparsedAttributes = header.slice(position.position)\n  } else {\n    // Otherwise:\n\n    // 1. The name-value-pair string consists of all the characters\n    //    contained in the set-cookie-string, and the unparsed-\n    //    attributes is the empty string.\n    nameValuePair = header\n  }\n\n  // 3. If the name-value-pair string lacks a %x3D (\"=\") character, then\n  //    the name string is empty, and the value string is the value of\n  //    name-value-pair.\n  if (!nameValuePair.includes('=')) {\n    value = nameValuePair\n  } else {\n    //    Otherwise, the name string consists of the characters up to, but\n    //    not including, the first %x3D (\"=\") character, and the (possibly\n    //    empty) value string consists of the characters after the first\n    //    %x3D (\"=\") character.\n    const position = { position: 0 }\n    name = collectASequenceOfCodePointsFast(\n      '=',\n      nameValuePair,\n      position\n    )\n    value = nameValuePair.slice(position.position + 1)\n  }\n\n  // 4. Remove any leading or trailing WSP characters from the name\n  //    string and the value string.\n  name = name.trim()\n  value = value.trim()\n\n  // 5. If the sum of the lengths of the name string and the value string\n  //    is more than 4096 octets, abort these steps and ignore the set-\n  //    cookie-string entirely.\n  if (name.length + value.length > maxNameValuePairSize) {\n    return null\n  }\n\n  // 6. The cookie-name is the name string, and the cookie-value is the\n  //    value string.\n  return {\n    name, value, ...parseUnparsedAttributes(unparsedAttributes)\n  }\n}\n\n/**\n * Parses the remaining attributes of a set-cookie header\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} unparsedAttributes\n * @param {[Object.]={}} cookieAttributeList\n */\nfunction parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {\n  // 1. If the unparsed-attributes string is empty, skip the rest of\n  //    these steps.\n  if (unparsedAttributes.length === 0) {\n    return cookieAttributeList\n  }\n\n  // 2. Discard the first character of the unparsed-attributes (which\n  //    will be a %x3B (\";\") character).\n  assert(unparsedAttributes[0] === ';')\n  unparsedAttributes = unparsedAttributes.slice(1)\n\n  let cookieAv = ''\n\n  // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n  //    character:\n  if (unparsedAttributes.includes(';')) {\n    // 1. Consume the characters of the unparsed-attributes up to, but\n    //    not including, the first %x3B (\";\") character.\n    cookieAv = collectASequenceOfCodePointsFast(\n      ';',\n      unparsedAttributes,\n      { position: 0 }\n    )\n    unparsedAttributes = unparsedAttributes.slice(cookieAv.length)\n  } else {\n    // Otherwise:\n\n    // 1. Consume the remainder of the unparsed-attributes.\n    cookieAv = unparsedAttributes\n    unparsedAttributes = ''\n  }\n\n  // Let the cookie-av string be the characters consumed in this step.\n\n  let attributeName = ''\n  let attributeValue = ''\n\n  // 4. If the cookie-av string contains a %x3D (\"=\") character:\n  if (cookieAv.includes('=')) {\n    // 1. The (possibly empty) attribute-name string consists of the\n    //    characters up to, but not including, the first %x3D (\"=\")\n    //    character, and the (possibly empty) attribute-value string\n    //    consists of the characters after the first %x3D (\"=\")\n    //    character.\n    const position = { position: 0 }\n\n    attributeName = collectASequenceOfCodePointsFast(\n      '=',\n      cookieAv,\n      position\n    )\n    attributeValue = cookieAv.slice(position.position + 1)\n  } else {\n    // Otherwise:\n\n    // 1. The attribute-name string consists of the entire cookie-av\n    //    string, and the attribute-value string is empty.\n    attributeName = cookieAv\n  }\n\n  // 5. Remove any leading or trailing WSP characters from the attribute-\n  //    name string and the attribute-value string.\n  attributeName = attributeName.trim()\n  attributeValue = attributeValue.trim()\n\n  // 6. If the attribute-value is longer than 1024 octets, ignore the\n  //    cookie-av string and return to Step 1 of this algorithm.\n  if (attributeValue.length > maxAttributeValueSize) {\n    return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n  }\n\n  // 7. Process the attribute-name and attribute-value according to the\n  //    requirements in the following subsections.  (Notice that\n  //    attributes with unrecognized attribute-names are ignored.)\n  const attributeNameLowercase = attributeName.toLowerCase()\n\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1\n  // If the attribute-name case-insensitively matches the string\n  // \"Expires\", the user agent MUST process the cookie-av as follows.\n  if (attributeNameLowercase === 'expires') {\n    // 1. Let the expiry-time be the result of parsing the attribute-value\n    //    as cookie-date (see Section 5.1.1).\n    const expiryTime = new Date(attributeValue)\n\n    // 2. If the attribute-value failed to parse as a cookie date, ignore\n    //    the cookie-av.\n\n    cookieAttributeList.expires = expiryTime\n  } else if (attributeNameLowercase === 'max-age') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2\n    // If the attribute-name case-insensitively matches the string \"Max-\n    // Age\", the user agent MUST process the cookie-av as follows.\n\n    // 1. If the first character of the attribute-value is not a DIGIT or a\n    //    \"-\" character, ignore the cookie-av.\n    const charCode = attributeValue.charCodeAt(0)\n\n    if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {\n      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n    }\n\n    // 2. If the remainder of attribute-value contains a non-DIGIT\n    //    character, ignore the cookie-av.\n    if (!/^\\d+$/.test(attributeValue)) {\n      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n    }\n\n    // 3. Let delta-seconds be the attribute-value converted to an integer.\n    const deltaSeconds = Number(attributeValue)\n\n    // 4. Let cookie-age-limit be the maximum age of the cookie (which\n    //    SHOULD be 400 days or less, see Section 4.1.2.2).\n\n    // 5. Set delta-seconds to the smaller of its present value and cookie-\n    //    age-limit.\n    // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)\n\n    // 6. If delta-seconds is less than or equal to zero (0), let expiry-\n    //    time be the earliest representable date and time.  Otherwise, let\n    //    the expiry-time be the current date and time plus delta-seconds\n    //    seconds.\n    // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds\n\n    // 7. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Max-Age and an attribute-value of expiry-time.\n    cookieAttributeList.maxAge = deltaSeconds\n  } else if (attributeNameLowercase === 'domain') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3\n    // If the attribute-name case-insensitively matches the string \"Domain\",\n    // the user agent MUST process the cookie-av as follows.\n\n    // 1. Let cookie-domain be the attribute-value.\n    let cookieDomain = attributeValue\n\n    // 2. If cookie-domain starts with %x2E (\".\"), let cookie-domain be\n    //    cookie-domain without its leading %x2E (\".\").\n    if (cookieDomain[0] === '.') {\n      cookieDomain = cookieDomain.slice(1)\n    }\n\n    // 3. Convert the cookie-domain to lower case.\n    cookieDomain = cookieDomain.toLowerCase()\n\n    // 4. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Domain and an attribute-value of cookie-domain.\n    cookieAttributeList.domain = cookieDomain\n  } else if (attributeNameLowercase === 'path') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4\n    // If the attribute-name case-insensitively matches the string \"Path\",\n    // the user agent MUST process the cookie-av as follows.\n\n    // 1. If the attribute-value is empty or if the first character of the\n    //    attribute-value is not %x2F (\"/\"):\n    let cookiePath = ''\n    if (attributeValue.length === 0 || attributeValue[0] !== '/') {\n      // 1. Let cookie-path be the default-path.\n      cookiePath = '/'\n    } else {\n      // Otherwise:\n\n      // 1. Let cookie-path be the attribute-value.\n      cookiePath = attributeValue\n    }\n\n    // 2. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Path and an attribute-value of cookie-path.\n    cookieAttributeList.path = cookiePath\n  } else if (attributeNameLowercase === 'secure') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5\n    // If the attribute-name case-insensitively matches the string \"Secure\",\n    // the user agent MUST append an attribute to the cookie-attribute-list\n    // with an attribute-name of Secure and an empty attribute-value.\n\n    cookieAttributeList.secure = true\n  } else if (attributeNameLowercase === 'httponly') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6\n    // If the attribute-name case-insensitively matches the string\n    // \"HttpOnly\", the user agent MUST append an attribute to the cookie-\n    // attribute-list with an attribute-name of HttpOnly and an empty\n    // attribute-value.\n\n    cookieAttributeList.httpOnly = true\n  } else if (attributeNameLowercase === 'samesite') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7\n    // If the attribute-name case-insensitively matches the string\n    // \"SameSite\", the user agent MUST process the cookie-av as follows:\n\n    const attributeValueLowercase = attributeValue.toLowerCase()\n\n    // 1. If cookie-av's attribute-value is a case-insensitive match for\n    //    \"None\", append an attribute to the cookie-attribute-list with an\n    //    attribute-name of \"SameSite\" and an attribute-value of \"None\".\n    if (attributeValueLowercase === 'none') {\n      cookieAttributeList.sameSite = 'None'\n    } else if (attributeValueLowercase === 'strict') {\n      // 2. If cookie-av's attribute-value is a case-insensitive match for\n      //    \"Strict\", append an attribute to the cookie-attribute-list with\n      //    an attribute-name of \"SameSite\" and an attribute-value of\n      //    \"Strict\".\n      cookieAttributeList.sameSite = 'Strict'\n    } else if (attributeValueLowercase === 'lax') {\n      // 3. If cookie-av's attribute-value is a case-insensitive match for\n      //    \"Lax\", append an attribute to the cookie-attribute-list with an\n      //    attribute-name of \"SameSite\" and an attribute-value of \"Lax\".\n      cookieAttributeList.sameSite = 'Lax'\n    }\n  } else {\n    cookieAttributeList.unparsed ??= []\n\n    cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)\n  }\n\n  // 8. Return to Step 1 of this algorithm.\n  return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n}\n\nmodule.exports = {\n  parseSetCookie,\n  parseUnparsedAttributes\n}\n","'use strict'\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction isCTLExcludingHtab (value) {\n  for (let i = 0; i < value.length; ++i) {\n    const code = value.charCodeAt(i)\n\n    if (\n      (code >= 0x00 && code <= 0x08) ||\n      (code >= 0x0A && code <= 0x1F) ||\n      code === 0x7F\n    ) {\n      return true\n    }\n  }\n  return false\n}\n\n/**\n CHAR           = \n token          = 1*\n separators     = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n                | \",\" | \";\" | \":\" | \"\\\" | <\">\n                | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n                | \"{\" | \"}\" | SP | HT\n * @param {string} name\n */\nfunction validateCookieName (name) {\n  for (let i = 0; i < name.length; ++i) {\n    const code = name.charCodeAt(i)\n\n    if (\n      code < 0x21 || // exclude CTLs (0-31), SP and HT\n      code > 0x7E || // exclude non-ascii and DEL\n      code === 0x22 || // \"\n      code === 0x28 || // (\n      code === 0x29 || // )\n      code === 0x3C || // <\n      code === 0x3E || // >\n      code === 0x40 || // @\n      code === 0x2C || // ,\n      code === 0x3B || // ;\n      code === 0x3A || // :\n      code === 0x5C || // \\\n      code === 0x2F || // /\n      code === 0x5B || // [\n      code === 0x5D || // ]\n      code === 0x3F || // ?\n      code === 0x3D || // =\n      code === 0x7B || // {\n      code === 0x7D // }\n    ) {\n      throw new Error('Invalid cookie name')\n    }\n  }\n}\n\n/**\n cookie-value      = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n cookie-octet      = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n                       ; US-ASCII characters excluding CTLs,\n                       ; whitespace DQUOTE, comma, semicolon,\n                       ; and backslash\n * @param {string} value\n */\nfunction validateCookieValue (value) {\n  let len = value.length\n  let i = 0\n\n  // if the value is wrapped in DQUOTE\n  if (value[0] === '\"') {\n    if (len === 1 || value[len - 1] !== '\"') {\n      throw new Error('Invalid cookie value')\n    }\n    --len\n    ++i\n  }\n\n  while (i < len) {\n    const code = value.charCodeAt(i++)\n\n    if (\n      code < 0x21 || // exclude CTLs (0-31)\n      code > 0x7E || // non-ascii and DEL (127)\n      code === 0x22 || // \"\n      code === 0x2C || // ,\n      code === 0x3B || // ;\n      code === 0x5C // \\\n    ) {\n      throw new Error('Invalid cookie value')\n    }\n  }\n}\n\n/**\n * path-value        = \n * @param {string} path\n */\nfunction validateCookiePath (path) {\n  for (let i = 0; i < path.length; ++i) {\n    const code = path.charCodeAt(i)\n\n    if (\n      code < 0x20 || // exclude CTLs (0-31)\n      code === 0x7F || // DEL\n      code === 0x3B // ;\n    ) {\n      throw new Error('Invalid cookie path')\n    }\n  }\n}\n\n/**\n * I have no idea why these values aren't allowed to be honest,\n * but Deno tests these. - Khafra\n * @param {string} domain\n */\nfunction validateCookieDomain (domain) {\n  if (\n    domain.startsWith('-') ||\n    domain.endsWith('.') ||\n    domain.endsWith('-')\n  ) {\n    throw new Error('Invalid cookie domain')\n  }\n}\n\nconst IMFDays = [\n  'Sun', 'Mon', 'Tue', 'Wed',\n  'Thu', 'Fri', 'Sat'\n]\n\nconst IMFMonths = [\n  'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n]\n\nconst IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1\n * @param {number|Date} date\n  IMF-fixdate  = day-name \",\" SP date1 SP time-of-day SP GMT\n  ; fixed length/zone/capitalization subset of the format\n  ; see Section 3.3 of [RFC5322]\n\n  day-name     = %x4D.6F.6E ; \"Mon\", case-sensitive\n              / %x54.75.65 ; \"Tue\", case-sensitive\n              / %x57.65.64 ; \"Wed\", case-sensitive\n              / %x54.68.75 ; \"Thu\", case-sensitive\n              / %x46.72.69 ; \"Fri\", case-sensitive\n              / %x53.61.74 ; \"Sat\", case-sensitive\n              / %x53.75.6E ; \"Sun\", case-sensitive\n  date1        = day SP month SP year\n                  ; e.g., 02 Jun 1982\n\n  day          = 2DIGIT\n  month        = %x4A.61.6E ; \"Jan\", case-sensitive\n              / %x46.65.62 ; \"Feb\", case-sensitive\n              / %x4D.61.72 ; \"Mar\", case-sensitive\n              / %x41.70.72 ; \"Apr\", case-sensitive\n              / %x4D.61.79 ; \"May\", case-sensitive\n              / %x4A.75.6E ; \"Jun\", case-sensitive\n              / %x4A.75.6C ; \"Jul\", case-sensitive\n              / %x41.75.67 ; \"Aug\", case-sensitive\n              / %x53.65.70 ; \"Sep\", case-sensitive\n              / %x4F.63.74 ; \"Oct\", case-sensitive\n              / %x4E.6F.76 ; \"Nov\", case-sensitive\n              / %x44.65.63 ; \"Dec\", case-sensitive\n  year         = 4DIGIT\n\n  GMT          = %x47.4D.54 ; \"GMT\", case-sensitive\n\n  time-of-day  = hour \":\" minute \":\" second\n              ; 00:00:00 - 23:59:60 (leap second)\n\n  hour         = 2DIGIT\n  minute       = 2DIGIT\n  second       = 2DIGIT\n */\nfunction toIMFDate (date) {\n  if (typeof date === 'number') {\n    date = new Date(date)\n  }\n\n  return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`\n}\n\n/**\n max-age-av        = \"Max-Age=\" non-zero-digit *DIGIT\n                       ; In practice, both expires-av and max-age-av\n                       ; are limited to dates representable by the\n                       ; user agent.\n * @param {number} maxAge\n */\nfunction validateCookieMaxAge (maxAge) {\n  if (maxAge < 0) {\n    throw new Error('Invalid cookie max-age')\n  }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1\n * @param {import('./index').Cookie} cookie\n */\nfunction stringify (cookie) {\n  if (cookie.name.length === 0) {\n    return null\n  }\n\n  validateCookieName(cookie.name)\n  validateCookieValue(cookie.value)\n\n  const out = [`${cookie.name}=${cookie.value}`]\n\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2\n  if (cookie.name.startsWith('__Secure-')) {\n    cookie.secure = true\n  }\n\n  if (cookie.name.startsWith('__Host-')) {\n    cookie.secure = true\n    cookie.domain = null\n    cookie.path = '/'\n  }\n\n  if (cookie.secure) {\n    out.push('Secure')\n  }\n\n  if (cookie.httpOnly) {\n    out.push('HttpOnly')\n  }\n\n  if (typeof cookie.maxAge === 'number') {\n    validateCookieMaxAge(cookie.maxAge)\n    out.push(`Max-Age=${cookie.maxAge}`)\n  }\n\n  if (cookie.domain) {\n    validateCookieDomain(cookie.domain)\n    out.push(`Domain=${cookie.domain}`)\n  }\n\n  if (cookie.path) {\n    validateCookiePath(cookie.path)\n    out.push(`Path=${cookie.path}`)\n  }\n\n  if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {\n    out.push(`Expires=${toIMFDate(cookie.expires)}`)\n  }\n\n  if (cookie.sameSite) {\n    out.push(`SameSite=${cookie.sameSite}`)\n  }\n\n  for (const part of cookie.unparsed) {\n    if (!part.includes('=')) {\n      throw new Error('Invalid unparsed')\n    }\n\n    const [key, ...value] = part.split('=')\n\n    out.push(`${key.trim()}=${value.join('=')}`)\n  }\n\n  return out.join('; ')\n}\n\nmodule.exports = {\n  isCTLExcludingHtab,\n  validateCookieName,\n  validateCookiePath,\n  validateCookieValue,\n  toIMFDate,\n  stringify\n}\n","'use strict'\nconst { Transform } = require('node:stream')\nconst { isASCIINumber, isValidLastEventId } = require('./util')\n\n/**\n * @type {number[]} BOM\n */\nconst BOM = [0xEF, 0xBB, 0xBF]\n/**\n * @type {10} LF\n */\nconst LF = 0x0A\n/**\n * @type {13} CR\n */\nconst CR = 0x0D\n/**\n * @type {58} COLON\n */\nconst COLON = 0x3A\n/**\n * @type {32} SPACE\n */\nconst SPACE = 0x20\n\n/**\n * @typedef {object} EventSourceStreamEvent\n * @type {object}\n * @property {string} [event] The event type.\n * @property {string} [data] The data of the message.\n * @property {string} [id] A unique ID for the event.\n * @property {string} [retry] The reconnection time, in milliseconds.\n */\n\n/**\n * @typedef eventSourceSettings\n * @type {object}\n * @property {string} lastEventId The last event ID received from the server.\n * @property {string} origin The origin of the event source.\n * @property {number} reconnectionTime The reconnection time, in milliseconds.\n */\n\nclass EventSourceStream extends Transform {\n  /**\n   * @type {eventSourceSettings}\n   */\n  state = null\n\n  /**\n   * Leading byte-order-mark check.\n   * @type {boolean}\n   */\n  checkBOM = true\n\n  /**\n   * @type {boolean}\n   */\n  crlfCheck = false\n\n  /**\n   * @type {boolean}\n   */\n  eventEndCheck = false\n\n  /**\n   * @type {Buffer}\n   */\n  buffer = null\n\n  pos = 0\n\n  event = {\n    data: undefined,\n    event: undefined,\n    id: undefined,\n    retry: undefined\n  }\n\n  /**\n   * @param {object} options\n   * @param {eventSourceSettings} options.eventSourceSettings\n   * @param {Function} [options.push]\n   */\n  constructor (options = {}) {\n    // Enable object mode as EventSourceStream emits objects of shape\n    // EventSourceStreamEvent\n    options.readableObjectMode = true\n\n    super(options)\n\n    this.state = options.eventSourceSettings || {}\n    if (options.push) {\n      this.push = options.push\n    }\n  }\n\n  /**\n   * @param {Buffer} chunk\n   * @param {string} _encoding\n   * @param {Function} callback\n   * @returns {void}\n   */\n  _transform (chunk, _encoding, callback) {\n    if (chunk.length === 0) {\n      callback()\n      return\n    }\n\n    // Cache the chunk in the buffer, as the data might not be complete while\n    // processing it\n    // TODO: Investigate if there is a more performant way to handle\n    // incoming chunks\n    // see: https://github.com/nodejs/undici/issues/2630\n    if (this.buffer) {\n      this.buffer = Buffer.concat([this.buffer, chunk])\n    } else {\n      this.buffer = chunk\n    }\n\n    // Strip leading byte-order-mark if we opened the stream and started\n    // the processing of the incoming data\n    if (this.checkBOM) {\n      switch (this.buffer.length) {\n        case 1:\n          // Check if the first byte is the same as the first byte of the BOM\n          if (this.buffer[0] === BOM[0]) {\n            // If it is, we need to wait for more data\n            callback()\n            return\n          }\n          // Set the checkBOM flag to false as we don't need to check for the\n          // BOM anymore\n          this.checkBOM = false\n\n          // The buffer only contains one byte so we need to wait for more data\n          callback()\n          return\n        case 2:\n          // Check if the first two bytes are the same as the first two bytes\n          // of the BOM\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1]\n          ) {\n            // If it is, we need to wait for more data, because the third byte\n            // is needed to determine if it is the BOM or not\n            callback()\n            return\n          }\n\n          // Set the checkBOM flag to false as we don't need to check for the\n          // BOM anymore\n          this.checkBOM = false\n          break\n        case 3:\n          // Check if the first three bytes are the same as the first three\n          // bytes of the BOM\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1] &&\n            this.buffer[2] === BOM[2]\n          ) {\n            // If it is, we can drop the buffered data, as it is only the BOM\n            this.buffer = Buffer.alloc(0)\n            // Set the checkBOM flag to false as we don't need to check for the\n            // BOM anymore\n            this.checkBOM = false\n\n            // Await more data\n            callback()\n            return\n          }\n          // If it is not the BOM, we can start processing the data\n          this.checkBOM = false\n          break\n        default:\n          // The buffer is longer than 3 bytes, so we can drop the BOM if it is\n          // present\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1] &&\n            this.buffer[2] === BOM[2]\n          ) {\n            // Remove the BOM from the buffer\n            this.buffer = this.buffer.subarray(3)\n          }\n\n          // Set the checkBOM flag to false as we don't need to check for the\n          this.checkBOM = false\n          break\n      }\n    }\n\n    while (this.pos < this.buffer.length) {\n      // If the previous line ended with an end-of-line, we need to check\n      // if the next character is also an end-of-line.\n      if (this.eventEndCheck) {\n        // If the the current character is an end-of-line, then the event\n        // is finished and we can process it\n\n        // If the previous line ended with a carriage return, we need to\n        // check if the current character is a line feed and remove it\n        // from the buffer.\n        if (this.crlfCheck) {\n          // If the current character is a line feed, we can remove it\n          // from the buffer and reset the crlfCheck flag\n          if (this.buffer[this.pos] === LF) {\n            this.buffer = this.buffer.subarray(this.pos + 1)\n            this.pos = 0\n            this.crlfCheck = false\n\n            // It is possible that the line feed is not the end of the\n            // event. We need to check if the next character is an\n            // end-of-line character to determine if the event is\n            // finished. We simply continue the loop to check the next\n            // character.\n\n            // As we removed the line feed from the buffer and set the\n            // crlfCheck flag to false, we basically don't make any\n            // distinction between a line feed and a carriage return.\n            continue\n          }\n          this.crlfCheck = false\n        }\n\n        if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n          // If the current character is a carriage return, we need to\n          // set the crlfCheck flag to true, as we need to check if the\n          // next character is a line feed so we can remove it from the\n          // buffer\n          if (this.buffer[this.pos] === CR) {\n            this.crlfCheck = true\n          }\n\n          this.buffer = this.buffer.subarray(this.pos + 1)\n          this.pos = 0\n          if (\n            this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {\n            this.processEvent(this.event)\n          }\n          this.clearEvent()\n          continue\n        }\n        // If the current character is not an end-of-line, then the event\n        // is not finished and we have to reset the eventEndCheck flag\n        this.eventEndCheck = false\n        continue\n      }\n\n      // If the current character is an end-of-line, we can process the\n      // line\n      if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n        // If the current character is a carriage return, we need to\n        // set the crlfCheck flag to true, as we need to check if the\n        // next character is a line feed\n        if (this.buffer[this.pos] === CR) {\n          this.crlfCheck = true\n        }\n\n        // In any case, we can process the line as we reached an\n        // end-of-line character\n        this.parseLine(this.buffer.subarray(0, this.pos), this.event)\n\n        // Remove the processed line from the buffer\n        this.buffer = this.buffer.subarray(this.pos + 1)\n        // Reset the position as we removed the processed line from the buffer\n        this.pos = 0\n        // A line was processed and this could be the end of the event. We need\n        // to check if the next line is empty to determine if the event is\n        // finished.\n        this.eventEndCheck = true\n        continue\n      }\n\n      this.pos++\n    }\n\n    callback()\n  }\n\n  /**\n   * @param {Buffer} line\n   * @param {EventStreamEvent} event\n   */\n  parseLine (line, event) {\n    // If the line is empty (a blank line)\n    // Dispatch the event, as defined below.\n    // This will be handled in the _transform method\n    if (line.length === 0) {\n      return\n    }\n\n    // If the line starts with a U+003A COLON character (:)\n    // Ignore the line.\n    const colonPosition = line.indexOf(COLON)\n    if (colonPosition === 0) {\n      return\n    }\n\n    let field = ''\n    let value = ''\n\n    // If the line contains a U+003A COLON character (:)\n    if (colonPosition !== -1) {\n      // Collect the characters on the line before the first U+003A COLON\n      // character (:), and let field be that string.\n      // TODO: Investigate if there is a more performant way to extract the\n      // field\n      // see: https://github.com/nodejs/undici/issues/2630\n      field = line.subarray(0, colonPosition).toString('utf8')\n\n      // Collect the characters on the line after the first U+003A COLON\n      // character (:), and let value be that string.\n      // If value starts with a U+0020 SPACE character, remove it from value.\n      let valueStart = colonPosition + 1\n      if (line[valueStart] === SPACE) {\n        ++valueStart\n      }\n      // TODO: Investigate if there is a more performant way to extract the\n      // value\n      // see: https://github.com/nodejs/undici/issues/2630\n      value = line.subarray(valueStart).toString('utf8')\n\n      // Otherwise, the string is not empty but does not contain a U+003A COLON\n      // character (:)\n    } else {\n      // Process the field using the steps described below, using the whole\n      // line as the field name, and the empty string as the field value.\n      field = line.toString('utf8')\n      value = ''\n    }\n\n    // Modify the event with the field name and value. The value is also\n    // decoded as UTF-8\n    switch (field) {\n      case 'data':\n        if (event[field] === undefined) {\n          event[field] = value\n        } else {\n          event[field] += `\\n${value}`\n        }\n        break\n      case 'retry':\n        if (isASCIINumber(value)) {\n          event[field] = value\n        }\n        break\n      case 'id':\n        if (isValidLastEventId(value)) {\n          event[field] = value\n        }\n        break\n      case 'event':\n        if (value.length > 0) {\n          event[field] = value\n        }\n        break\n    }\n  }\n\n  /**\n   * @param {EventSourceStreamEvent} event\n   */\n  processEvent (event) {\n    if (event.retry && isASCIINumber(event.retry)) {\n      this.state.reconnectionTime = parseInt(event.retry, 10)\n    }\n\n    if (event.id && isValidLastEventId(event.id)) {\n      this.state.lastEventId = event.id\n    }\n\n    // only dispatch event, when data is provided\n    if (event.data !== undefined) {\n      this.push({\n        type: event.event || 'message',\n        options: {\n          data: event.data,\n          lastEventId: this.state.lastEventId,\n          origin: this.state.origin\n        }\n      })\n    }\n  }\n\n  clearEvent () {\n    this.event = {\n      data: undefined,\n      event: undefined,\n      id: undefined,\n      retry: undefined\n    }\n  }\n}\n\nmodule.exports = {\n  EventSourceStream\n}\n","'use strict'\n\nconst { pipeline } = require('node:stream')\nconst { fetching } = require('../fetch')\nconst { makeRequest } = require('../fetch/request')\nconst { webidl } = require('../fetch/webidl')\nconst { EventSourceStream } = require('./eventsource-stream')\nconst { parseMIMEType } = require('../fetch/data-url')\nconst { createFastMessageEvent } = require('../websocket/events')\nconst { isNetworkError } = require('../fetch/response')\nconst { delay } = require('./util')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { environmentSettingsObject } = require('../fetch/util')\n\nlet experimentalWarned = false\n\n/**\n * A reconnection time, in milliseconds. This must initially be an implementation-defined value,\n * probably in the region of a few seconds.\n *\n * In Comparison:\n * - Chrome uses 3000ms.\n * - Deno uses 5000ms.\n *\n * @type {3000}\n */\nconst defaultReconnectionTime = 3000\n\n/**\n * The readyState attribute represents the state of the connection.\n * @enum\n * @readonly\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev\n */\n\n/**\n * The connection has not yet been established, or it was closed and the user\n * agent is reconnecting.\n * @type {0}\n */\nconst CONNECTING = 0\n\n/**\n * The user agent has an open connection and is dispatching events as it\n * receives them.\n * @type {1}\n */\nconst OPEN = 1\n\n/**\n * The connection is not open, and the user agent is not trying to reconnect.\n * @type {2}\n */\nconst CLOSED = 2\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"same-origin\".\n * @type {'anonymous'}\n */\nconst ANONYMOUS = 'anonymous'\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"include\".\n * @type {'use-credentials'}\n */\nconst USE_CREDENTIALS = 'use-credentials'\n\n/**\n * The EventSource interface is used to receive server-sent events. It\n * connects to a server over HTTP and receives events in text/event-stream\n * format without closing the connection.\n * @extends {EventTarget}\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events\n * @api public\n */\nclass EventSource extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    message: null\n  }\n\n  #url = null\n  #withCredentials = false\n\n  #readyState = CONNECTING\n\n  #request = null\n  #controller = null\n\n  #dispatcher\n\n  /**\n   * @type {import('./eventsource-stream').eventSourceSettings}\n   */\n  #state\n\n  /**\n   * Creates a new EventSource object.\n   * @param {string} url\n   * @param {EventSourceInit} [eventSourceInitDict]\n   * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface\n   */\n  constructor (url, eventSourceInitDict = {}) {\n    // 1. Let ev be a new EventSource object.\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'EventSource constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    if (!experimentalWarned) {\n      experimentalWarned = true\n      process.emitWarning('EventSource is experimental, expect them to change at any time.', {\n        code: 'UNDICI-ES'\n      })\n    }\n\n    url = webidl.converters.USVString(url, prefix, 'url')\n    eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')\n\n    this.#dispatcher = eventSourceInitDict.dispatcher\n    this.#state = {\n      lastEventId: '',\n      reconnectionTime: defaultReconnectionTime\n    }\n\n    // 2. Let settings be ev's relevant settings object.\n    // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object\n    const settings = environmentSettingsObject\n\n    let urlRecord\n\n    try {\n      // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.\n      urlRecord = new URL(url, settings.settingsObject.baseUrl)\n      this.#state.origin = urlRecord.origin\n    } catch (e) {\n      // 4. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n      throw new DOMException(e, 'SyntaxError')\n    }\n\n    // 5. Set ev's url to urlRecord.\n    this.#url = urlRecord.href\n\n    // 6. Let corsAttributeState be Anonymous.\n    let corsAttributeState = ANONYMOUS\n\n    // 7. If the value of eventSourceInitDict's withCredentials member is true,\n    // then set corsAttributeState to Use Credentials and set ev's\n    // withCredentials attribute to true.\n    if (eventSourceInitDict.withCredentials) {\n      corsAttributeState = USE_CREDENTIALS\n      this.#withCredentials = true\n    }\n\n    // 8. Let request be the result of creating a potential-CORS request given\n    // urlRecord, the empty string, and corsAttributeState.\n    const initRequest = {\n      redirect: 'follow',\n      keepalive: true,\n      // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes\n      mode: 'cors',\n      credentials: corsAttributeState === 'anonymous'\n        ? 'same-origin'\n        : 'omit',\n      referrer: 'no-referrer'\n    }\n\n    // 9. Set request's client to settings.\n    initRequest.client = environmentSettingsObject.settingsObject\n\n    // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.\n    initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]]\n\n    // 11. Set request's cache mode to \"no-store\".\n    initRequest.cache = 'no-store'\n\n    // 12. Set request's initiator type to \"other\".\n    initRequest.initiator = 'other'\n\n    initRequest.urlList = [new URL(this.#url)]\n\n    // 13. Set ev's request to request.\n    this.#request = makeRequest(initRequest)\n\n    this.#connect()\n  }\n\n  /**\n   * Returns the state of this EventSource object's connection. It can have the\n   * values described below.\n   * @returns {0|1|2}\n   * @readonly\n   */\n  get readyState () {\n    return this.#readyState\n  }\n\n  /**\n   * Returns the URL providing the event stream.\n   * @readonly\n   * @returns {string}\n   */\n  get url () {\n    return this.#url\n  }\n\n  /**\n   * Returns a boolean indicating whether the EventSource object was\n   * instantiated with CORS credentials set (true), or not (false, the default).\n   */\n  get withCredentials () {\n    return this.#withCredentials\n  }\n\n  #connect () {\n    if (this.#readyState === CLOSED) return\n\n    this.#readyState = CONNECTING\n\n    const fetchParams = {\n      request: this.#request,\n      dispatcher: this.#dispatcher\n    }\n\n    // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.\n    const processEventSourceEndOfBody = (response) => {\n      if (isNetworkError(response)) {\n        this.dispatchEvent(new Event('error'))\n        this.close()\n      }\n\n      this.#reconnect()\n    }\n\n    // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...\n    fetchParams.processResponseEndOfBody = processEventSourceEndOfBody\n\n    // and processResponse set to the following steps given response res:\n    fetchParams.processResponse = (response) => {\n      // 1. If res is an aborted network error, then fail the connection.\n\n      if (isNetworkError(response)) {\n        // 1. When a user agent is to fail the connection, the user agent\n        // must queue a task which, if the readyState attribute is set to a\n        // value other than CLOSED, sets the readyState attribute to CLOSED\n        // and fires an event named error at the EventSource object. Once the\n        // user agent has failed the connection, it does not attempt to\n        // reconnect.\n        if (response.aborted) {\n          this.close()\n          this.dispatchEvent(new Event('error'))\n          return\n          // 2. Otherwise, if res is a network error, then reestablish the\n          // connection, unless the user agent knows that to be futile, in\n          // which case the user agent may fail the connection.\n        } else {\n          this.#reconnect()\n          return\n        }\n      }\n\n      // 3. Otherwise, if res's status is not 200, or if res's `Content-Type`\n      // is not `text/event-stream`, then fail the connection.\n      const contentType = response.headersList.get('content-type', true)\n      const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'\n      const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'\n      if (\n        response.status !== 200 ||\n        contentTypeValid === false\n      ) {\n        this.close()\n        this.dispatchEvent(new Event('error'))\n        return\n      }\n\n      // 4. Otherwise, announce the connection and interpret res's body\n      // line by line.\n\n      // When a user agent is to announce the connection, the user agent\n      // must queue a task which, if the readyState attribute is set to a\n      // value other than CLOSED, sets the readyState attribute to OPEN\n      // and fires an event named open at the EventSource object.\n      // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n      this.#readyState = OPEN\n      this.dispatchEvent(new Event('open'))\n\n      // If redirected to a different origin, set the origin to the new origin.\n      this.#state.origin = response.urlList[response.urlList.length - 1].origin\n\n      const eventSourceStream = new EventSourceStream({\n        eventSourceSettings: this.#state,\n        push: (event) => {\n          this.dispatchEvent(createFastMessageEvent(\n            event.type,\n            event.options\n          ))\n        }\n      })\n\n      pipeline(response.body.stream,\n        eventSourceStream,\n        (error) => {\n          if (\n            error?.aborted === false\n          ) {\n            this.close()\n            this.dispatchEvent(new Event('error'))\n          }\n        })\n    }\n\n    this.#controller = fetching(fetchParams)\n  }\n\n  /**\n   * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n   * @returns {Promise}\n   */\n  async #reconnect () {\n    // When a user agent is to reestablish the connection, the user agent must\n    // run the following steps. These steps are run in parallel, not as part of\n    // a task. (The tasks that it queues, of course, are run like normal tasks\n    // and not themselves in parallel.)\n\n    // 1. Queue a task to run the following steps:\n\n    //   1. If the readyState attribute is set to CLOSED, abort the task.\n    if (this.#readyState === CLOSED) return\n\n    //   2. Set the readyState attribute to CONNECTING.\n    this.#readyState = CONNECTING\n\n    //   3. Fire an event named error at the EventSource object.\n    this.dispatchEvent(new Event('error'))\n\n    // 2. Wait a delay equal to the reconnection time of the event source.\n    await delay(this.#state.reconnectionTime)\n\n    // 5. Queue a task to run the following steps:\n\n    //   1. If the EventSource object's readyState attribute is not set to\n    //      CONNECTING, then return.\n    if (this.#readyState !== CONNECTING) return\n\n    //   2. Let request be the EventSource object's request.\n    //   3. If the EventSource object's last event ID string is not the empty\n    //      string, then:\n    //      1. Let lastEventIDValue be the EventSource object's last event ID\n    //         string, encoded as UTF-8.\n    //      2. Set (`Last-Event-ID`, lastEventIDValue) in request's header\n    //         list.\n    if (this.#state.lastEventId.length) {\n      this.#request.headersList.set('last-event-id', this.#state.lastEventId, true)\n    }\n\n    //   4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.\n    this.#connect()\n  }\n\n  /**\n   * Closes the connection, if any, and sets the readyState attribute to\n   * CLOSED.\n   */\n  close () {\n    webidl.brandCheck(this, EventSource)\n\n    if (this.#readyState === CLOSED) return\n    this.#readyState = CLOSED\n    this.#controller.abort()\n    this.#request = null\n  }\n\n  get onopen () {\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.open = fn\n      this.addEventListener('open', fn)\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onmessage () {\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.message = fn\n      this.addEventListener('message', fn)\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get onerror () {\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this.#events.error = null\n    }\n  }\n}\n\nconst constantsPropertyDescriptors = {\n  CONNECTING: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: CONNECTING,\n    writable: false\n  },\n  OPEN: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: OPEN,\n    writable: false\n  },\n  CLOSED: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: CLOSED,\n    writable: false\n  }\n}\n\nObject.defineProperties(EventSource, constantsPropertyDescriptors)\nObject.defineProperties(EventSource.prototype, constantsPropertyDescriptors)\n\nObject.defineProperties(EventSource.prototype, {\n  close: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  url: kEnumerableProperty,\n  withCredentials: kEnumerableProperty\n})\n\nwebidl.converters.EventSourceInitDict = webidl.dictionaryConverter([\n  {\n    key: 'withCredentials',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'dispatcher', // undici only\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = {\n  EventSource,\n  defaultReconnectionTime\n}\n","'use strict'\n\n/**\n * Checks if the given value is a valid LastEventId.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isValidLastEventId (value) {\n  // LastEventId should not contain U+0000 NULL\n  return value.indexOf('\\u0000') === -1\n}\n\n/**\n * Checks if the given value is a base 10 digit.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isASCIINumber (value) {\n  if (value.length === 0) return false\n  for (let i = 0; i < value.length; i++) {\n    if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false\n  }\n  return true\n}\n\n// https://github.com/nodejs/undici/issues/2664\nfunction delay (ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms).unref()\n  })\n}\n\nmodule.exports = {\n  isValidLastEventId,\n  isASCIINumber,\n  delay\n}\n","'use strict'\n\nconst util = require('../../core/util')\nconst {\n  ReadableStreamFrom,\n  isBlobLike,\n  isReadableStreamLike,\n  readableStreamClose,\n  createDeferredPromise,\n  fullyReadBody,\n  extractMimeType,\n  utf8DecodeBytes\n} = require('./util')\nconst { FormData } = require('./formdata')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { Blob } = require('node:buffer')\nconst assert = require('node:assert')\nconst { isErrored, isDisturbed } = require('node:stream')\nconst { isArrayBuffer } = require('node:util/types')\nconst { serializeAMimeType } = require('./data-url')\nconst { multipartFormDataParser } = require('./formdata-parser')\nlet random\n\ntry {\n  const crypto = require('node:crypto')\n  random = (max) => crypto.randomInt(0, max)\n} catch {\n  random = (max) => Math.floor(Math.random(max))\n}\n\nconst textEncoder = new TextEncoder()\nfunction noop () {}\n\nconst hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0\nlet streamRegistry\n\nif (hasFinalizationRegistry) {\n  streamRegistry = new FinalizationRegistry((weakRef) => {\n    const stream = weakRef.deref()\n    if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {\n      stream.cancel('Response object has been garbage collected').catch(noop)\n    }\n  })\n}\n\n// https://fetch.spec.whatwg.org/#concept-bodyinit-extract\nfunction extractBody (object, keepalive = false) {\n  // 1. Let stream be null.\n  let stream = null\n\n  // 2. If object is a ReadableStream object, then set stream to object.\n  if (object instanceof ReadableStream) {\n    stream = object\n  } else if (isBlobLike(object)) {\n    // 3. Otherwise, if object is a Blob object, set stream to the\n    //    result of running object’s get stream.\n    stream = object.stream()\n  } else {\n    // 4. Otherwise, set stream to a new ReadableStream object, and set\n    //    up stream with byte reading support.\n    stream = new ReadableStream({\n      async pull (controller) {\n        const buffer = typeof source === 'string' ? textEncoder.encode(source) : source\n\n        if (buffer.byteLength) {\n          controller.enqueue(buffer)\n        }\n\n        queueMicrotask(() => readableStreamClose(controller))\n      },\n      start () {},\n      type: 'bytes'\n    })\n  }\n\n  // 5. Assert: stream is a ReadableStream object.\n  assert(isReadableStreamLike(stream))\n\n  // 6. Let action be null.\n  let action = null\n\n  // 7. Let source be null.\n  let source = null\n\n  // 8. Let length be null.\n  let length = null\n\n  // 9. Let type be null.\n  let type = null\n\n  // 10. Switch on object:\n  if (typeof object === 'string') {\n    // Set source to the UTF-8 encoding of object.\n    // Note: setting source to a Uint8Array here breaks some mocking assumptions.\n    source = object\n\n    // Set type to `text/plain;charset=UTF-8`.\n    type = 'text/plain;charset=UTF-8'\n  } else if (object instanceof URLSearchParams) {\n    // URLSearchParams\n\n    // spec says to run application/x-www-form-urlencoded on body.list\n    // this is implemented in Node.js as apart of an URLSearchParams instance toString method\n    // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490\n    // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100\n\n    // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.\n    source = object.toString()\n\n    // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.\n    type = 'application/x-www-form-urlencoded;charset=UTF-8'\n  } else if (isArrayBuffer(object)) {\n    // BufferSource/ArrayBuffer\n\n    // Set source to a copy of the bytes held by object.\n    source = new Uint8Array(object.slice())\n  } else if (ArrayBuffer.isView(object)) {\n    // BufferSource/ArrayBufferView\n\n    // Set source to a copy of the bytes held by object.\n    source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))\n  } else if (util.isFormDataLike(object)) {\n    const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`\n    const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n    /*! formdata-polyfill. MIT License. Jimmy Wärting  */\n    const escape = (str) =>\n      str.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n    const normalizeLinefeeds = (value) => value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n\n    // Set action to this step: run the multipart/form-data\n    // encoding algorithm, with object’s entry list and UTF-8.\n    // - This ensures that the body is immutable and can't be changed afterwords\n    // - That the content-length is calculated in advance.\n    // - And that all parts are pre-encoded and ready to be sent.\n\n    const blobParts = []\n    const rn = new Uint8Array([13, 10]) // '\\r\\n'\n    length = 0\n    let hasUnknownSizeValue = false\n\n    for (const [name, value] of object) {\n      if (typeof value === 'string') {\n        const chunk = textEncoder.encode(prefix +\n          `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`)\n        blobParts.push(chunk)\n        length += chunk.byteLength\n      } else {\n        const chunk = textEncoder.encode(`${prefix}; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          (value.name ? `; filename=\"${escape(value.name)}\"` : '') + '\\r\\n' +\n          `Content-Type: ${\n            value.type || 'application/octet-stream'\n          }\\r\\n\\r\\n`)\n        blobParts.push(chunk, value, rn)\n        if (typeof value.size === 'number') {\n          length += chunk.byteLength + value.size + rn.byteLength\n        } else {\n          hasUnknownSizeValue = true\n        }\n      }\n    }\n\n    // CRLF is appended to the body to function with legacy servers and match other implementations.\n    // https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030\n    // https://github.com/form-data/form-data/issues/63\n    const chunk = textEncoder.encode(`--${boundary}--\\r\\n`)\n    blobParts.push(chunk)\n    length += chunk.byteLength\n    if (hasUnknownSizeValue) {\n      length = null\n    }\n\n    // Set source to object.\n    source = object\n\n    action = async function * () {\n      for (const part of blobParts) {\n        if (part.stream) {\n          yield * part.stream()\n        } else {\n          yield part\n        }\n      }\n    }\n\n    // Set type to `multipart/form-data; boundary=`,\n    // followed by the multipart/form-data boundary string generated\n    // by the multipart/form-data encoding algorithm.\n    type = `multipart/form-data; boundary=${boundary}`\n  } else if (isBlobLike(object)) {\n    // Blob\n\n    // Set source to object.\n    source = object\n\n    // Set length to object’s size.\n    length = object.size\n\n    // If object’s type attribute is not the empty byte sequence, set\n    // type to its value.\n    if (object.type) {\n      type = object.type\n    }\n  } else if (typeof object[Symbol.asyncIterator] === 'function') {\n    // If keepalive is true, then throw a TypeError.\n    if (keepalive) {\n      throw new TypeError('keepalive')\n    }\n\n    // If object is disturbed or locked, then throw a TypeError.\n    if (util.isDisturbed(object) || object.locked) {\n      throw new TypeError(\n        'Response body object should not be disturbed or locked'\n      )\n    }\n\n    stream =\n      object instanceof ReadableStream ? object : ReadableStreamFrom(object)\n  }\n\n  // 11. If source is a byte sequence, then set action to a\n  // step that returns source and length to source’s length.\n  if (typeof source === 'string' || util.isBuffer(source)) {\n    length = Buffer.byteLength(source)\n  }\n\n  // 12. If action is non-null, then run these steps in in parallel:\n  if (action != null) {\n    // Run action.\n    let iterator\n    stream = new ReadableStream({\n      async start () {\n        iterator = action(object)[Symbol.asyncIterator]()\n      },\n      async pull (controller) {\n        const { value, done } = await iterator.next()\n        if (done) {\n          // When running action is done, close stream.\n          queueMicrotask(() => {\n            controller.close()\n            controller.byobRequest?.respond(0)\n          })\n        } else {\n          // Whenever one or more bytes are available and stream is not errored,\n          // enqueue a Uint8Array wrapping an ArrayBuffer containing the available\n          // bytes into stream.\n          if (!isErrored(stream)) {\n            const buffer = new Uint8Array(value)\n            if (buffer.byteLength) {\n              controller.enqueue(buffer)\n            }\n          }\n        }\n        return controller.desiredSize > 0\n      },\n      async cancel (reason) {\n        await iterator.return()\n      },\n      type: 'bytes'\n    })\n  }\n\n  // 13. Let body be a body whose stream is stream, source is source,\n  // and length is length.\n  const body = { stream, source, length }\n\n  // 14. Return (body, type).\n  return [body, type]\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit-safely-extract\nfunction safelyExtractBody (object, keepalive = false) {\n  // To safely extract a body and a `Content-Type` value from\n  // a byte sequence or BodyInit object object, run these steps:\n\n  // 1. If object is a ReadableStream object, then:\n  if (object instanceof ReadableStream) {\n    // Assert: object is neither disturbed nor locked.\n    // istanbul ignore next\n    assert(!util.isDisturbed(object), 'The body has already been consumed.')\n    // istanbul ignore next\n    assert(!object.locked, 'The stream is locked.')\n  }\n\n  // 2. Return the results of extracting object.\n  return extractBody(object, keepalive)\n}\n\nfunction cloneBody (instance, body) {\n  // To clone a body body, run these steps:\n\n  // https://fetch.spec.whatwg.org/#concept-body-clone\n\n  // 1. Let « out1, out2 » be the result of teeing body’s stream.\n  const [out1, out2] = body.stream.tee()\n\n  // 2. Set body’s stream to out1.\n  body.stream = out1\n\n  // 3. Return a body whose stream is out2 and other members are copied from body.\n  return {\n    stream: out2,\n    length: body.length,\n    source: body.source\n  }\n}\n\nfunction throwIfAborted (state) {\n  if (state.aborted) {\n    throw new DOMException('The operation was aborted.', 'AbortError')\n  }\n}\n\nfunction bodyMixinMethods (instance) {\n  const methods = {\n    blob () {\n      // The blob() method steps are to return the result of\n      // running consume body with this and the following step\n      // given a byte sequence bytes: return a Blob whose\n      // contents are bytes and whose type attribute is this’s\n      // MIME type.\n      return consumeBody(this, (bytes) => {\n        let mimeType = bodyMimeType(this)\n\n        if (mimeType === null) {\n          mimeType = ''\n        } else if (mimeType) {\n          mimeType = serializeAMimeType(mimeType)\n        }\n\n        // Return a Blob whose contents are bytes and type attribute\n        // is mimeType.\n        return new Blob([bytes], { type: mimeType })\n      }, instance)\n    },\n\n    arrayBuffer () {\n      // The arrayBuffer() method steps are to return the result\n      // of running consume body with this and the following step\n      // given a byte sequence bytes: return a new ArrayBuffer\n      // whose contents are bytes.\n      return consumeBody(this, (bytes) => {\n        return new Uint8Array(bytes).buffer\n      }, instance)\n    },\n\n    text () {\n      // The text() method steps are to return the result of running\n      // consume body with this and UTF-8 decode.\n      return consumeBody(this, utf8DecodeBytes, instance)\n    },\n\n    json () {\n      // The json() method steps are to return the result of running\n      // consume body with this and parse JSON from bytes.\n      return consumeBody(this, parseJSONFromBytes, instance)\n    },\n\n    formData () {\n      // The formData() method steps are to return the result of running\n      // consume body with this and the following step given a byte sequence bytes:\n      return consumeBody(this, (value) => {\n        // 1. Let mimeType be the result of get the MIME type with this.\n        const mimeType = bodyMimeType(this)\n\n        // 2. If mimeType is non-null, then switch on mimeType’s essence and run\n        //    the corresponding steps:\n        if (mimeType !== null) {\n          switch (mimeType.essence) {\n            case 'multipart/form-data': {\n              // 1. ... [long step]\n              const parsed = multipartFormDataParser(value, mimeType)\n\n              // 2. If that fails for some reason, then throw a TypeError.\n              if (parsed === 'failure') {\n                throw new TypeError('Failed to parse body as FormData.')\n              }\n\n              // 3. Return a new FormData object, appending each entry,\n              //    resulting from the parsing operation, to its entry list.\n              const fd = new FormData()\n              fd[kState] = parsed\n\n              return fd\n            }\n            case 'application/x-www-form-urlencoded': {\n              // 1. Let entries be the result of parsing bytes.\n              const entries = new URLSearchParams(value.toString())\n\n              // 2. If entries is failure, then throw a TypeError.\n\n              // 3. Return a new FormData object whose entry list is entries.\n              const fd = new FormData()\n\n              for (const [name, value] of entries) {\n                fd.append(name, value)\n              }\n\n              return fd\n            }\n          }\n        }\n\n        // 3. Throw a TypeError.\n        throw new TypeError(\n          'Content-Type was not one of \"multipart/form-data\" or \"application/x-www-form-urlencoded\".'\n        )\n      }, instance)\n    },\n\n    bytes () {\n      // The bytes() method steps are to return the result of running consume body\n      // with this and the following step given a byte sequence bytes: return the\n      // result of creating a Uint8Array from bytes in this’s relevant realm.\n      return consumeBody(this, (bytes) => {\n        return new Uint8Array(bytes)\n      }, instance)\n    }\n  }\n\n  return methods\n}\n\nfunction mixinBody (prototype) {\n  Object.assign(prototype.prototype, bodyMixinMethods(prototype))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-consume-body\n * @param {Response|Request} object\n * @param {(value: unknown) => unknown} convertBytesToJSValue\n * @param {Response|Request} instance\n */\nasync function consumeBody (object, convertBytesToJSValue, instance) {\n  webidl.brandCheck(object, instance)\n\n  // 1. If object is unusable, then return a promise rejected\n  //    with a TypeError.\n  if (bodyUnusable(object)) {\n    throw new TypeError('Body is unusable: Body has already been read')\n  }\n\n  throwIfAborted(object[kState])\n\n  // 2. Let promise be a new promise.\n  const promise = createDeferredPromise()\n\n  // 3. Let errorSteps given error be to reject promise with error.\n  const errorSteps = (error) => promise.reject(error)\n\n  // 4. Let successSteps given a byte sequence data be to resolve\n  //    promise with the result of running convertBytesToJSValue\n  //    with data. If that threw an exception, then run errorSteps\n  //    with that exception.\n  const successSteps = (data) => {\n    try {\n      promise.resolve(convertBytesToJSValue(data))\n    } catch (e) {\n      errorSteps(e)\n    }\n  }\n\n  // 5. If object’s body is null, then run successSteps with an\n  //    empty byte sequence.\n  if (object[kState].body == null) {\n    successSteps(Buffer.allocUnsafe(0))\n    return promise.promise\n  }\n\n  // 6. Otherwise, fully read object’s body given successSteps,\n  //    errorSteps, and object’s relevant global object.\n  await fullyReadBody(object[kState].body, successSteps, errorSteps)\n\n  // 7. Return promise.\n  return promise.promise\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction bodyUnusable (object) {\n  const body = object[kState].body\n\n  // An object including the Body interface mixin is\n  // said to be unusable if its body is non-null and\n  // its body’s stream is disturbed or locked.\n  return body != null && (body.stream.locked || util.isDisturbed(body.stream))\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value\n * @param {Uint8Array} bytes\n */\nfunction parseJSONFromBytes (bytes) {\n  return JSON.parse(utf8DecodeBytes(bytes))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-mime-type\n * @param {import('./response').Response|import('./request').Request} requestOrResponse\n */\nfunction bodyMimeType (requestOrResponse) {\n  // 1. Let headers be null.\n  // 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.\n  // 3. Otherwise, set headers to requestOrResponse’s response’s header list.\n  /** @type {import('./headers').HeadersList} */\n  const headers = requestOrResponse[kState].headersList\n\n  // 4. Let mimeType be the result of extracting a MIME type from headers.\n  const mimeType = extractMimeType(headers)\n\n  // 5. If mimeType is failure, then return null.\n  if (mimeType === 'failure') {\n    return null\n  }\n\n  // 6. Return mimeType.\n  return mimeType\n}\n\nmodule.exports = {\n  extractBody,\n  safelyExtractBody,\n  cloneBody,\n  mixinBody,\n  streamRegistry,\n  hasFinalizationRegistry,\n  bodyUnusable\n}\n","'use strict'\n\nconst corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])\n\nconst redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])\nconst redirectStatusSet = new Set(redirectStatus)\n\n/**\n * @see https://fetch.spec.whatwg.org/#block-bad-port\n */\nconst badPorts = /** @type {const} */ ([\n  '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n  '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n  '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n  '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n  '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',\n  '6697', '10080'\n])\nconst badPortsSet = new Set(badPorts)\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\n */\nconst referrerPolicy = /** @type {const} */ ([\n  '',\n  'no-referrer',\n  'no-referrer-when-downgrade',\n  'same-origin',\n  'origin',\n  'strict-origin',\n  'origin-when-cross-origin',\n  'strict-origin-when-cross-origin',\n  'unsafe-url'\n])\nconst referrerPolicySet = new Set(referrerPolicy)\n\nconst requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])\n\nconst safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])\n\nconst requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])\n\nconst requestCache = /** @type {const} */ ([\n  'default',\n  'no-store',\n  'reload',\n  'no-cache',\n  'force-cache',\n  'only-if-cached'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-body-header-name\n */\nconst requestBodyHeader = /** @type {const} */ ([\n  'content-encoding',\n  'content-language',\n  'content-location',\n  'content-type',\n  // See https://github.com/nodejs/undici/issues/2021\n  // 'Content-Length' is a forbidden header name, which is typically\n  // removed in the Headers implementation. However, undici doesn't\n  // filter out headers, so we add it here.\n  'content-length'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex\n */\nconst requestDuplex = /** @type {const} */ ([\n  'half'\n])\n\n/**\n * @see http://fetch.spec.whatwg.org/#forbidden-method\n */\nconst forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = /** @type {const} */ ([\n  'audio',\n  'audioworklet',\n  'font',\n  'image',\n  'manifest',\n  'paintworklet',\n  'script',\n  'style',\n  'track',\n  'video',\n  'xslt',\n  ''\n])\nconst subresourceSet = new Set(subresource)\n\nmodule.exports = {\n  subresource,\n  forbiddenMethods,\n  requestBodyHeader,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  redirectStatus,\n  corsSafeListedMethods,\n  nullBodyStatus,\n  safeMethods,\n  badPorts,\n  requestDuplex,\n  subresourceSet,\n  badPortsSet,\n  redirectStatusSet,\n  corsSafeListedMethodsSet,\n  safeMethodsSet,\n  forbiddenMethodsSet,\n  referrerPolicySet\n}\n","'use strict'\n\nconst assert = require('node:assert')\n\nconst encoder = new TextEncoder()\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-token-code-point\n */\nconst HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\\-.^_|~A-Za-z0-9]+$/\nconst HTTP_WHITESPACE_REGEX = /[\\u000A\\u000D\\u0009\\u0020]/ // eslint-disable-line\nconst ASCII_WHITESPACE_REPLACE_REGEX = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/g // eslint-disable-line\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point\n */\nconst HTTP_QUOTED_STRING_TOKENS = /^[\\u0009\\u0020-\\u007E\\u0080-\\u00FF]+$/ // eslint-disable-line\n\n// https://fetch.spec.whatwg.org/#data-url-processor\n/** @param {URL} dataURL */\nfunction dataURLProcessor (dataURL) {\n  // 1. Assert: dataURL’s scheme is \"data\".\n  assert(dataURL.protocol === 'data:')\n\n  // 2. Let input be the result of running the URL\n  // serializer on dataURL with exclude fragment\n  // set to true.\n  let input = URLSerializer(dataURL, true)\n\n  // 3. Remove the leading \"data:\" string from input.\n  input = input.slice(5)\n\n  // 4. Let position point at the start of input.\n  const position = { position: 0 }\n\n  // 5. Let mimeType be the result of collecting a\n  // sequence of code points that are not equal\n  // to U+002C (,), given position.\n  let mimeType = collectASequenceOfCodePointsFast(\n    ',',\n    input,\n    position\n  )\n\n  // 6. Strip leading and trailing ASCII whitespace\n  // from mimeType.\n  // Undici implementation note: we need to store the\n  // length because if the mimetype has spaces removed,\n  // the wrong amount will be sliced from the input in\n  // step #9\n  const mimeTypeLength = mimeType.length\n  mimeType = removeASCIIWhitespace(mimeType, true, true)\n\n  // 7. If position is past the end of input, then\n  // return failure\n  if (position.position >= input.length) {\n    return 'failure'\n  }\n\n  // 8. Advance position by 1.\n  position.position++\n\n  // 9. Let encodedBody be the remainder of input.\n  const encodedBody = input.slice(mimeTypeLength + 1)\n\n  // 10. Let body be the percent-decoding of encodedBody.\n  let body = stringPercentDecode(encodedBody)\n\n  // 11. If mimeType ends with U+003B (;), followed by\n  // zero or more U+0020 SPACE, followed by an ASCII\n  // case-insensitive match for \"base64\", then:\n  if (/;(\\u0020){0,}base64$/i.test(mimeType)) {\n    // 1. Let stringBody be the isomorphic decode of body.\n    const stringBody = isomorphicDecode(body)\n\n    // 2. Set body to the forgiving-base64 decode of\n    // stringBody.\n    body = forgivingBase64(stringBody)\n\n    // 3. If body is failure, then return failure.\n    if (body === 'failure') {\n      return 'failure'\n    }\n\n    // 4. Remove the last 6 code points from mimeType.\n    mimeType = mimeType.slice(0, -6)\n\n    // 5. Remove trailing U+0020 SPACE code points from mimeType,\n    // if any.\n    mimeType = mimeType.replace(/(\\u0020)+$/, '')\n\n    // 6. Remove the last U+003B (;) code point from mimeType.\n    mimeType = mimeType.slice(0, -1)\n  }\n\n  // 12. If mimeType starts with U+003B (;), then prepend\n  // \"text/plain\" to mimeType.\n  if (mimeType.startsWith(';')) {\n    mimeType = 'text/plain' + mimeType\n  }\n\n  // 13. Let mimeTypeRecord be the result of parsing\n  // mimeType.\n  let mimeTypeRecord = parseMIMEType(mimeType)\n\n  // 14. If mimeTypeRecord is failure, then set\n  // mimeTypeRecord to text/plain;charset=US-ASCII.\n  if (mimeTypeRecord === 'failure') {\n    mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')\n  }\n\n  // 15. Return a new data: URL struct whose MIME\n  // type is mimeTypeRecord and body is body.\n  // https://fetch.spec.whatwg.org/#data-url-struct\n  return { mimeType: mimeTypeRecord, body }\n}\n\n// https://url.spec.whatwg.org/#concept-url-serializer\n/**\n * @param {URL} url\n * @param {boolean} excludeFragment\n */\nfunction URLSerializer (url, excludeFragment = false) {\n  if (!excludeFragment) {\n    return url.href\n  }\n\n  const href = url.href\n  const hashLength = url.hash.length\n\n  const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength)\n\n  if (!hashLength && href.endsWith('#')) {\n    return serialized.slice(0, -1)\n  }\n\n  return serialized\n}\n\n// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n/**\n * @param {(char: string) => boolean} condition\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePoints (condition, input, position) {\n  // 1. Let result be the empty string.\n  let result = ''\n\n  // 2. While position doesn’t point past the end of input and the\n  // code point at position within input meets the condition condition:\n  while (position.position < input.length && condition(input[position.position])) {\n    // 1. Append that code point to the end of result.\n    result += input[position.position]\n\n    // 2. Advance position by 1.\n    position.position++\n  }\n\n  // 3. Return result.\n  return result\n}\n\n/**\n * A faster collectASequenceOfCodePoints that only works when comparing a single character.\n * @param {string} char\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePointsFast (char, input, position) {\n  const idx = input.indexOf(char, position.position)\n  const start = position.position\n\n  if (idx === -1) {\n    position.position = input.length\n    return input.slice(start)\n  }\n\n  position.position = idx\n  return input.slice(start, position.position)\n}\n\n// https://url.spec.whatwg.org/#string-percent-decode\n/** @param {string} input */\nfunction stringPercentDecode (input) {\n  // 1. Let bytes be the UTF-8 encoding of input.\n  const bytes = encoder.encode(input)\n\n  // 2. Return the percent-decoding of bytes.\n  return percentDecode(bytes)\n}\n\n/**\n * @param {number} byte\n */\nfunction isHexCharByte (byte) {\n  // 0-9 A-F a-f\n  return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66)\n}\n\n/**\n * @param {number} byte\n */\nfunction hexByteToNumber (byte) {\n  return (\n    // 0-9\n    byte >= 0x30 && byte <= 0x39\n      ? (byte - 48)\n    // Convert to uppercase\n    // ((byte & 0xDF) - 65) + 10\n      : ((byte & 0xDF) - 55)\n  )\n}\n\n// https://url.spec.whatwg.org/#percent-decode\n/** @param {Uint8Array} input */\nfunction percentDecode (input) {\n  const length = input.length\n  // 1. Let output be an empty byte sequence.\n  /** @type {Uint8Array} */\n  const output = new Uint8Array(length)\n  let j = 0\n  // 2. For each byte byte in input:\n  for (let i = 0; i < length; ++i) {\n    const byte = input[i]\n\n    // 1. If byte is not 0x25 (%), then append byte to output.\n    if (byte !== 0x25) {\n      output[j++] = byte\n\n    // 2. Otherwise, if byte is 0x25 (%) and the next two bytes\n    // after byte in input are not in the ranges\n    // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),\n    // and 0x61 (a) to 0x66 (f), all inclusive, append byte\n    // to output.\n    } else if (\n      byte === 0x25 &&\n      !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))\n    ) {\n      output[j++] = 0x25\n\n    // 3. Otherwise:\n    } else {\n      // 1. Let bytePoint be the two bytes after byte in input,\n      // decoded, and then interpreted as hexadecimal number.\n      // 2. Append a byte whose value is bytePoint to output.\n      output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2])\n\n      // 3. Skip the next two bytes in input.\n      i += 2\n    }\n  }\n\n  // 3. Return output.\n  return length === j ? output : output.subarray(0, j)\n}\n\n// https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n/** @param {string} input */\nfunction parseMIMEType (input) {\n  // 1. Remove any leading and trailing HTTP whitespace\n  // from input.\n  input = removeHTTPWhitespace(input, true, true)\n\n  // 2. Let position be a position variable for input,\n  // initially pointing at the start of input.\n  const position = { position: 0 }\n\n  // 3. Let type be the result of collecting a sequence\n  // of code points that are not U+002F (/) from\n  // input, given position.\n  const type = collectASequenceOfCodePointsFast(\n    '/',\n    input,\n    position\n  )\n\n  // 4. If type is the empty string or does not solely\n  // contain HTTP token code points, then return failure.\n  // https://mimesniff.spec.whatwg.org/#http-token-code-point\n  if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n    return 'failure'\n  }\n\n  // 5. If position is past the end of input, then return\n  // failure\n  if (position.position > input.length) {\n    return 'failure'\n  }\n\n  // 6. Advance position by 1. (This skips past U+002F (/).)\n  position.position++\n\n  // 7. Let subtype be the result of collecting a sequence of\n  // code points that are not U+003B (;) from input, given\n  // position.\n  let subtype = collectASequenceOfCodePointsFast(\n    ';',\n    input,\n    position\n  )\n\n  // 8. Remove any trailing HTTP whitespace from subtype.\n  subtype = removeHTTPWhitespace(subtype, false, true)\n\n  // 9. If subtype is the empty string or does not solely\n  // contain HTTP token code points, then return failure.\n  if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n    return 'failure'\n  }\n\n  const typeLowercase = type.toLowerCase()\n  const subtypeLowercase = subtype.toLowerCase()\n\n  // 10. Let mimeType be a new MIME type record whose type\n  // is type, in ASCII lowercase, and subtype is subtype,\n  // in ASCII lowercase.\n  // https://mimesniff.spec.whatwg.org/#mime-type\n  const mimeType = {\n    type: typeLowercase,\n    subtype: subtypeLowercase,\n    /** @type {Map} */\n    parameters: new Map(),\n    // https://mimesniff.spec.whatwg.org/#mime-type-essence\n    essence: `${typeLowercase}/${subtypeLowercase}`\n  }\n\n  // 11. While position is not past the end of input:\n  while (position.position < input.length) {\n    // 1. Advance position by 1. (This skips past U+003B (;).)\n    position.position++\n\n    // 2. Collect a sequence of code points that are HTTP\n    // whitespace from input given position.\n    collectASequenceOfCodePoints(\n      // https://fetch.spec.whatwg.org/#http-whitespace\n      char => HTTP_WHITESPACE_REGEX.test(char),\n      input,\n      position\n    )\n\n    // 3. Let parameterName be the result of collecting a\n    // sequence of code points that are not U+003B (;)\n    // or U+003D (=) from input, given position.\n    let parameterName = collectASequenceOfCodePoints(\n      (char) => char !== ';' && char !== '=',\n      input,\n      position\n    )\n\n    // 4. Set parameterName to parameterName, in ASCII\n    // lowercase.\n    parameterName = parameterName.toLowerCase()\n\n    // 5. If position is not past the end of input, then:\n    if (position.position < input.length) {\n      // 1. If the code point at position within input is\n      // U+003B (;), then continue.\n      if (input[position.position] === ';') {\n        continue\n      }\n\n      // 2. Advance position by 1. (This skips past U+003D (=).)\n      position.position++\n    }\n\n    // 6. If position is past the end of input, then break.\n    if (position.position > input.length) {\n      break\n    }\n\n    // 7. Let parameterValue be null.\n    let parameterValue = null\n\n    // 8. If the code point at position within input is\n    // U+0022 (\"), then:\n    if (input[position.position] === '\"') {\n      // 1. Set parameterValue to the result of collecting\n      // an HTTP quoted string from input, given position\n      // and the extract-value flag.\n      parameterValue = collectAnHTTPQuotedString(input, position, true)\n\n      // 2. Collect a sequence of code points that are not\n      // U+003B (;) from input, given position.\n      collectASequenceOfCodePointsFast(\n        ';',\n        input,\n        position\n      )\n\n    // 9. Otherwise:\n    } else {\n      // 1. Set parameterValue to the result of collecting\n      // a sequence of code points that are not U+003B (;)\n      // from input, given position.\n      parameterValue = collectASequenceOfCodePointsFast(\n        ';',\n        input,\n        position\n      )\n\n      // 2. Remove any trailing HTTP whitespace from parameterValue.\n      parameterValue = removeHTTPWhitespace(parameterValue, false, true)\n\n      // 3. If parameterValue is the empty string, then continue.\n      if (parameterValue.length === 0) {\n        continue\n      }\n    }\n\n    // 10. If all of the following are true\n    // - parameterName is not the empty string\n    // - parameterName solely contains HTTP token code points\n    // - parameterValue solely contains HTTP quoted-string token code points\n    // - mimeType’s parameters[parameterName] does not exist\n    // then set mimeType’s parameters[parameterName] to parameterValue.\n    if (\n      parameterName.length !== 0 &&\n      HTTP_TOKEN_CODEPOINTS.test(parameterName) &&\n      (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&\n      !mimeType.parameters.has(parameterName)\n    ) {\n      mimeType.parameters.set(parameterName, parameterValue)\n    }\n  }\n\n  // 12. Return mimeType.\n  return mimeType\n}\n\n// https://infra.spec.whatwg.org/#forgiving-base64-decode\n/** @param {string} data */\nfunction forgivingBase64 (data) {\n  // 1. Remove all ASCII whitespace from data.\n  data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '')  // eslint-disable-line\n\n  let dataLength = data.length\n  // 2. If data’s code point length divides by 4 leaving\n  // no remainder, then:\n  if (dataLength % 4 === 0) {\n    // 1. If data ends with one or two U+003D (=) code points,\n    // then remove them from data.\n    if (data.charCodeAt(dataLength - 1) === 0x003D) {\n      --dataLength\n      if (data.charCodeAt(dataLength - 1) === 0x003D) {\n        --dataLength\n      }\n    }\n  }\n\n  // 3. If data’s code point length divides by 4 leaving\n  // a remainder of 1, then return failure.\n  if (dataLength % 4 === 1) {\n    return 'failure'\n  }\n\n  // 4. If data contains a code point that is not one of\n  //  U+002B (+)\n  //  U+002F (/)\n  //  ASCII alphanumeric\n  // then return failure.\n  if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {\n    return 'failure'\n  }\n\n  const buffer = Buffer.from(data, 'base64')\n  return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\n// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string\n// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string\n/**\n * @param {string} input\n * @param {{ position: number }} position\n * @param {boolean?} extractValue\n */\nfunction collectAnHTTPQuotedString (input, position, extractValue) {\n  // 1. Let positionStart be position.\n  const positionStart = position.position\n\n  // 2. Let value be the empty string.\n  let value = ''\n\n  // 3. Assert: the code point at position within input\n  // is U+0022 (\").\n  assert(input[position.position] === '\"')\n\n  // 4. Advance position by 1.\n  position.position++\n\n  // 5. While true:\n  while (true) {\n    // 1. Append the result of collecting a sequence of code points\n    // that are not U+0022 (\") or U+005C (\\) from input, given\n    // position, to value.\n    value += collectASequenceOfCodePoints(\n      (char) => char !== '\"' && char !== '\\\\',\n      input,\n      position\n    )\n\n    // 2. If position is past the end of input, then break.\n    if (position.position >= input.length) {\n      break\n    }\n\n    // 3. Let quoteOrBackslash be the code point at position within\n    // input.\n    const quoteOrBackslash = input[position.position]\n\n    // 4. Advance position by 1.\n    position.position++\n\n    // 5. If quoteOrBackslash is U+005C (\\), then:\n    if (quoteOrBackslash === '\\\\') {\n      // 1. If position is past the end of input, then append\n      // U+005C (\\) to value and break.\n      if (position.position >= input.length) {\n        value += '\\\\'\n        break\n      }\n\n      // 2. Append the code point at position within input to value.\n      value += input[position.position]\n\n      // 3. Advance position by 1.\n      position.position++\n\n    // 6. Otherwise:\n    } else {\n      // 1. Assert: quoteOrBackslash is U+0022 (\").\n      assert(quoteOrBackslash === '\"')\n\n      // 2. Break.\n      break\n    }\n  }\n\n  // 6. If the extract-value flag is set, then return value.\n  if (extractValue) {\n    return value\n  }\n\n  // 7. Return the code points from positionStart to position,\n  // inclusive, within input.\n  return input.slice(positionStart, position.position)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serializeAMimeType (mimeType) {\n  assert(mimeType !== 'failure')\n  const { parameters, essence } = mimeType\n\n  // 1. Let serialization be the concatenation of mimeType’s\n  //    type, U+002F (/), and mimeType’s subtype.\n  let serialization = essence\n\n  // 2. For each name → value of mimeType’s parameters:\n  for (let [name, value] of parameters.entries()) {\n    // 1. Append U+003B (;) to serialization.\n    serialization += ';'\n\n    // 2. Append name to serialization.\n    serialization += name\n\n    // 3. Append U+003D (=) to serialization.\n    serialization += '='\n\n    // 4. If value does not solely contain HTTP token code\n    //    points or value is the empty string, then:\n    if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n      // 1. Precede each occurrence of U+0022 (\") or\n      //    U+005C (\\) in value with U+005C (\\).\n      value = value.replace(/(\\\\|\")/g, '\\\\$1')\n\n      // 2. Prepend U+0022 (\") to value.\n      value = '\"' + value\n\n      // 3. Append U+0022 (\") to value.\n      value += '\"'\n    }\n\n    // 5. Append value to serialization.\n    serialization += value\n  }\n\n  // 3. Return serialization.\n  return serialization\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {number} char\n */\nfunction isHTTPWhiteSpace (char) {\n  // \"\\r\\n\\t \"\n  return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeHTTPWhitespace (str, leading = true, trailing = true) {\n  return removeChars(str, leading, trailing, isHTTPWhiteSpace)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n * @param {number} char\n */\nfunction isASCIIWhitespace (char) {\n  // \"\\r\\n\\t\\f \"\n  return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x00c || char === 0x020\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeASCIIWhitespace (str, leading = true, trailing = true) {\n  return removeChars(str, leading, trailing, isASCIIWhitespace)\n}\n\n/**\n * @param {string} str\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns\n */\nfunction removeChars (str, leading, trailing, predicate) {\n  let lead = 0\n  let trail = str.length - 1\n\n  if (leading) {\n    while (lead < str.length && predicate(str.charCodeAt(lead))) lead++\n  }\n\n  if (trailing) {\n    while (trail > 0 && predicate(str.charCodeAt(trail))) trail--\n  }\n\n  return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-decode\n * @param {Uint8Array} input\n * @returns {string}\n */\nfunction isomorphicDecode (input) {\n  // 1. To isomorphic decode a byte sequence input, return a string whose code point\n  //    length is equal to input’s length and whose code points have the same values\n  //    as the values of input’s bytes, in the same order.\n  const length = input.length\n  if ((2 << 15) - 1 > length) {\n    return String.fromCharCode.apply(null, input)\n  }\n  let result = ''; let i = 0\n  let addition = (2 << 15) - 1\n  while (i < length) {\n    if (i + addition > length) {\n      addition = length - i\n    }\n    result += String.fromCharCode.apply(null, input.subarray(i, i += addition))\n  }\n  return result\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type\n * @param {Exclude, 'failure'>} mimeType\n */\nfunction minimizeSupportedMimeType (mimeType) {\n  switch (mimeType.essence) {\n    case 'application/ecmascript':\n    case 'application/javascript':\n    case 'application/x-ecmascript':\n    case 'application/x-javascript':\n    case 'text/ecmascript':\n    case 'text/javascript':\n    case 'text/javascript1.0':\n    case 'text/javascript1.1':\n    case 'text/javascript1.2':\n    case 'text/javascript1.3':\n    case 'text/javascript1.4':\n    case 'text/javascript1.5':\n    case 'text/jscript':\n    case 'text/livescript':\n    case 'text/x-ecmascript':\n    case 'text/x-javascript':\n      // 1. If mimeType is a JavaScript MIME type, then return \"text/javascript\".\n      return 'text/javascript'\n    case 'application/json':\n    case 'text/json':\n      // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n      return 'application/json'\n    case 'image/svg+xml':\n      // 3. If mimeType’s essence is \"image/svg+xml\", then return \"image/svg+xml\".\n      return 'image/svg+xml'\n    case 'text/xml':\n    case 'application/xml':\n      // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n      return 'application/xml'\n  }\n\n  // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n  if (mimeType.subtype.endsWith('+json')) {\n    return 'application/json'\n  }\n\n  // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n  if (mimeType.subtype.endsWith('+xml')) {\n    return 'application/xml'\n  }\n\n  // 5. If mimeType is supported by the user agent, then return mimeType’s essence.\n  // Technically, node doesn't support any mimetypes.\n\n  // 6. Return the empty string.\n  return ''\n}\n\nmodule.exports = {\n  dataURLProcessor,\n  URLSerializer,\n  collectASequenceOfCodePoints,\n  collectASequenceOfCodePointsFast,\n  stringPercentDecode,\n  parseMIMEType,\n  collectAnHTTPQuotedString,\n  serializeAMimeType,\n  removeChars,\n  removeHTTPWhitespace,\n  minimizeSupportedMimeType,\n  HTTP_TOKEN_CODEPOINTS,\n  isomorphicDecode\n}\n","'use strict'\n\nconst { kConnected, kSize } = require('../../core/symbols')\n\nclass CompatWeakRef {\n  constructor (value) {\n    this.value = value\n  }\n\n  deref () {\n    return this.value[kConnected] === 0 && this.value[kSize] === 0\n      ? undefined\n      : this.value\n  }\n}\n\nclass CompatFinalizer {\n  constructor (finalizer) {\n    this.finalizer = finalizer\n  }\n\n  register (dispatcher, key) {\n    if (dispatcher.on) {\n      dispatcher.on('disconnect', () => {\n        if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {\n          this.finalizer(key)\n        }\n      })\n    }\n  }\n\n  unregister (key) {}\n}\n\nmodule.exports = function () {\n  // FIXME: remove workaround when the Node bug is backported to v18\n  // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\n  if (process.env.NODE_V8_COVERAGE && process.version.startsWith('v18')) {\n    process._rawDebug('Using compatibility WeakRef and FinalizationRegistry')\n    return {\n      WeakRef: CompatWeakRef,\n      FinalizationRegistry: CompatFinalizer\n    }\n  }\n  return { WeakRef, FinalizationRegistry }\n}\n","'use strict'\n\nconst { Blob, File } = require('node:buffer')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\n\n// TODO(@KhafraDev): remove\nclass FileLike {\n  constructor (blobLike, fileName, options = {}) {\n    // TODO: argument idl type check\n\n    // The File constructor is invoked with two or three parameters, depending\n    // on whether the optional dictionary parameter is used. When the File()\n    // constructor is invoked, user agents must run the following steps:\n\n    // 1. Let bytes be the result of processing blob parts given fileBits and\n    // options.\n\n    // 2. Let n be the fileName argument to the constructor.\n    const n = fileName\n\n    // 3. Process FilePropertyBag dictionary argument by running the following\n    // substeps:\n\n    //    1. If the type member is provided and is not the empty string, let t\n    //    be set to the type dictionary member. If t contains any characters\n    //    outside the range U+0020 to U+007E, then set t to the empty string\n    //    and return from these substeps.\n    //    TODO\n    const t = options.type\n\n    //    2. Convert every character in t to ASCII lowercase.\n    //    TODO\n\n    //    3. If the lastModified member is provided, let d be set to the\n    //    lastModified dictionary member. If it is not provided, set d to the\n    //    current date and time represented as the number of milliseconds since\n    //    the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n    const d = options.lastModified ?? Date.now()\n\n    // 4. Return a new File object F such that:\n    // F refers to the bytes byte sequence.\n    // F.size is set to the number of total bytes in bytes.\n    // F.name is set to n.\n    // F.type is set to t.\n    // F.lastModified is set to d.\n\n    this[kState] = {\n      blobLike,\n      name: n,\n      type: t,\n      lastModified: d\n    }\n  }\n\n  stream (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.stream(...args)\n  }\n\n  arrayBuffer (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.arrayBuffer(...args)\n  }\n\n  slice (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.slice(...args)\n  }\n\n  text (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.text(...args)\n  }\n\n  get size () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.size\n  }\n\n  get type () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.type\n  }\n\n  get name () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].name\n  }\n\n  get lastModified () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].lastModified\n  }\n\n  get [Symbol.toStringTag] () {\n    return 'File'\n  }\n}\n\nwebidl.converters.Blob = webidl.interfaceConverter(Blob)\n\n// If this function is moved to ./util.js, some tools (such as\n// rollup) will warn about circular dependencies. See:\n// https://github.com/nodejs/undici/issues/1629\nfunction isFileLike (object) {\n  return (\n    (object instanceof File) ||\n    (\n      object &&\n      (typeof object.stream === 'function' ||\n      typeof object.arrayBuffer === 'function') &&\n      object[Symbol.toStringTag] === 'File'\n    )\n  )\n}\n\nmodule.exports = { FileLike, isFileLike }\n","'use strict'\n\nconst { isUSVString, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { utf8DecodeBytes } = require('./util')\nconst { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require('./data-url')\nconst { isFileLike } = require('./file')\nconst { makeEntry } = require('./formdata')\nconst assert = require('node:assert')\nconst { File: NodeFile } = require('node:buffer')\n\nconst File = globalThis.File ?? NodeFile\n\nconst formDataNameBuffer = Buffer.from('form-data; name=\"')\nconst filenameBuffer = Buffer.from('; filename')\nconst dd = Buffer.from('--')\nconst ddcrlf = Buffer.from('--\\r\\n')\n\n/**\n * @param {string} chars\n */\nfunction isAsciiString (chars) {\n  for (let i = 0; i < chars.length; ++i) {\n    if ((chars.charCodeAt(i) & ~0x7F) !== 0) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary\n * @param {string} boundary\n */\nfunction validateBoundary (boundary) {\n  const length = boundary.length\n\n  // - its length is greater or equal to 27 and lesser or equal to 70, and\n  if (length < 27 || length > 70) {\n    return false\n  }\n\n  // - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or\n  //   0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),\n  //   0x2D (-) or 0x5F (_).\n  for (let i = 0; i < length; ++i) {\n    const cp = boundary.charCodeAt(i)\n\n    if (!(\n      (cp >= 0x30 && cp <= 0x39) ||\n      (cp >= 0x41 && cp <= 0x5a) ||\n      (cp >= 0x61 && cp <= 0x7a) ||\n      cp === 0x27 ||\n      cp === 0x2d ||\n      cp === 0x5f\n    )) {\n      return false\n    }\n  }\n\n  return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser\n * @param {Buffer} input\n * @param {ReturnType} mimeType\n */\nfunction multipartFormDataParser (input, mimeType) {\n  // 1. Assert: mimeType’s essence is \"multipart/form-data\".\n  assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')\n\n  const boundaryString = mimeType.parameters.get('boundary')\n\n  // 2. If mimeType’s parameters[\"boundary\"] does not exist, return failure.\n  //    Otherwise, let boundary be the result of UTF-8 decoding mimeType’s\n  //    parameters[\"boundary\"].\n  if (boundaryString === undefined) {\n    return 'failure'\n  }\n\n  const boundary = Buffer.from(`--${boundaryString}`, 'utf8')\n\n  // 3. Let entry list be an empty entry list.\n  const entryList = []\n\n  // 4. Let position be a pointer to a byte in input, initially pointing at\n  //    the first byte.\n  const position = { position: 0 }\n\n  // Note: undici addition, allows leading and trailing CRLFs.\n  while (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n    position.position += 2\n  }\n\n  let trailing = input.length\n\n  while (input[trailing - 1] === 0x0a && input[trailing - 2] === 0x0d) {\n    trailing -= 2\n  }\n\n  if (trailing !== input.length) {\n    input = input.subarray(0, trailing)\n  }\n\n  // 5. While true:\n  while (true) {\n    // 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D\n    //      (`--`) followed by boundary, advance position by 2 + the length of\n    //      boundary. Otherwise, return failure.\n    // Note: boundary is padded with 2 dashes already, no need to add 2.\n    if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {\n      position.position += boundary.length\n    } else {\n      return 'failure'\n    }\n\n    // 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A\n    //      (`--` followed by CR LF) followed by the end of input, return entry list.\n    // Note: a body does NOT need to end with CRLF. It can end with --.\n    if (\n      (position.position === input.length - 2 && bufferStartsWith(input, dd, position)) ||\n      (position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position))\n    ) {\n      return entryList\n    }\n\n    // 5.3. If position does not point to a sequence of bytes starting with 0x0D\n    //      0x0A (CR LF), return failure.\n    if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    }\n\n    // 5.4. Advance position by 2. (This skips past the newline.)\n    position.position += 2\n\n    // 5.5. Let name, filename and contentType be the result of parsing\n    //      multipart/form-data headers on input and position, if the result\n    //      is not failure. Otherwise, return failure.\n    const result = parseMultipartFormDataHeaders(input, position)\n\n    if (result === 'failure') {\n      return 'failure'\n    }\n\n    let { name, filename, contentType, encoding } = result\n\n    // 5.6. Advance position by 2. (This skips past the empty line that marks\n    //      the end of the headers.)\n    position.position += 2\n\n    // 5.7. Let body be the empty byte sequence.\n    let body\n\n    // 5.8. Body loop: While position is not past the end of input:\n    // TODO: the steps here are completely wrong\n    {\n      const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)\n\n      if (boundaryIndex === -1) {\n        return 'failure'\n      }\n\n      body = input.subarray(position.position, boundaryIndex - 4)\n\n      position.position += body.length\n\n      // Note: position must be advanced by the body's length before being\n      // decoded, otherwise the parsing will fail.\n      if (encoding === 'base64') {\n        body = Buffer.from(body.toString(), 'base64')\n      }\n    }\n\n    // 5.9. If position does not point to a sequence of bytes starting with\n    //      0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.\n    if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    } else {\n      position.position += 2\n    }\n\n    // 5.10. If filename is not null:\n    let value\n\n    if (filename !== null) {\n      // 5.10.1. If contentType is null, set contentType to \"text/plain\".\n      contentType ??= 'text/plain'\n\n      // 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.\n\n      // Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.\n      // Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.\n      if (!isAsciiString(contentType)) {\n        contentType = ''\n      }\n\n      // 5.10.3. Let value be a new File object with name filename, type contentType, and body body.\n      value = new File([body], filename, { type: contentType })\n    } else {\n      // 5.11. Otherwise:\n\n      // 5.11.1. Let value be the UTF-8 decoding without BOM of body.\n      value = utf8DecodeBytes(Buffer.from(body))\n    }\n\n    // 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.\n    assert(isUSVString(name))\n    assert((typeof value === 'string' && isUSVString(value)) || isFileLike(value))\n\n    // 5.13. Create an entry with name and value, and append it to entry list.\n    entryList.push(makeEntry(name, value, filename))\n  }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataHeaders (input, position) {\n  // 1. Let name, filename and contentType be null.\n  let name = null\n  let filename = null\n  let contentType = null\n  let encoding = null\n\n  // 2. While true:\n  while (true) {\n    // 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):\n    if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n      // 2.1.1. If name is null, return failure.\n      if (name === null) {\n        return 'failure'\n      }\n\n      // 2.1.2. Return name, filename and contentType.\n      return { name, filename, contentType, encoding }\n    }\n\n    // 2.2. Let header name be the result of collecting a sequence of bytes that are\n    //      not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.\n    let headerName = collectASequenceOfBytes(\n      (char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,\n      input,\n      position\n    )\n\n    // 2.3. Remove any HTTP tab or space bytes from the start or end of header name.\n    headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)\n\n    // 2.4. If header name does not match the field-name token production, return failure.\n    if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {\n      return 'failure'\n    }\n\n    // 2.5. If the byte at position is not 0x3A (:), return failure.\n    if (input[position.position] !== 0x3a) {\n      return 'failure'\n    }\n\n    // 2.6. Advance position by 1.\n    position.position++\n\n    // 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.\n    //      (Do nothing with those bytes.)\n    collectASequenceOfBytes(\n      (char) => char === 0x20 || char === 0x09,\n      input,\n      position\n    )\n\n    // 2.8. Byte-lowercase header name and switch on the result:\n    switch (bufferToLowerCasedHeaderName(headerName)) {\n      case 'content-disposition': {\n        // 1. Set name and filename to null.\n        name = filename = null\n\n        // 2. If position does not point to a sequence of bytes starting with\n        //    `form-data; name=\"`, return failure.\n        if (!bufferStartsWith(input, formDataNameBuffer, position)) {\n          return 'failure'\n        }\n\n        // 3. Advance position so it points at the byte after the next 0x22 (\")\n        //    byte (the one in the sequence of bytes matched above).\n        position.position += 17\n\n        // 4. Set name to the result of parsing a multipart/form-data name given\n        //    input and position, if the result is not failure. Otherwise, return\n        //    failure.\n        name = parseMultipartFormDataName(input, position)\n\n        if (name === null) {\n          return 'failure'\n        }\n\n        // 5. If position points to a sequence of bytes starting with `; filename=\"`:\n        if (bufferStartsWith(input, filenameBuffer, position)) {\n          // Note: undici also handles filename*\n          let check = position.position + filenameBuffer.length\n\n          if (input[check] === 0x2a) {\n            position.position += 1\n            check += 1\n          }\n\n          if (input[check] !== 0x3d || input[check + 1] !== 0x22) { // =\"\n            return 'failure'\n          }\n\n          // 1. Advance position so it points at the byte after the next 0x22 (\") byte\n          //    (the one in the sequence of bytes matched above).\n          position.position += 12\n\n          // 2. Set filename to the result of parsing a multipart/form-data name given\n          //    input and position, if the result is not failure. Otherwise, return failure.\n          filename = parseMultipartFormDataName(input, position)\n\n          if (filename === null) {\n            return 'failure'\n          }\n        }\n\n        break\n      }\n      case 'content-type': {\n        // 1. Let header value be the result of collecting a sequence of bytes that are\n        //    not 0x0A (LF) or 0x0D (CR), given position.\n        let headerValue = collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n\n        // 2. Remove any HTTP tab or space bytes from the end of header value.\n        headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n        // 3. Set contentType to the isomorphic decoding of header value.\n        contentType = isomorphicDecode(headerValue)\n\n        break\n      }\n      case 'content-transfer-encoding': {\n        let headerValue = collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n\n        headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n        encoding = isomorphicDecode(headerValue)\n\n        break\n      }\n      default: {\n        // Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.\n        // (Do nothing with those bytes.)\n        collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n      }\n    }\n\n    // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A\n    //      (CR LF), return failure. Otherwise, advance position by 2 (past the newline).\n    if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    } else {\n      position.position += 2\n    }\n  }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-a-multipart-form-data-name\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataName (input, position) {\n  // 1. Assert: The byte at (position - 1) is 0x22 (\").\n  assert(input[position.position - 1] === 0x22)\n\n  // 2. Let name be the result of collecting a sequence of bytes that are not 0x0A (LF), 0x0D (CR) or 0x22 (\"), given position.\n  /** @type {string | Buffer} */\n  let name = collectASequenceOfBytes(\n    (char) => char !== 0x0a && char !== 0x0d && char !== 0x22,\n    input,\n    position\n  )\n\n  // 3. If the byte at position is not 0x22 (\"), return failure. Otherwise, advance position by 1.\n  if (input[position.position] !== 0x22) {\n    return null // name could be 'failure'\n  } else {\n    position.position++\n  }\n\n  // 4. Replace any occurrence of the following subsequences in name with the given byte:\n  // - `%0A`: 0x0A (LF)\n  // - `%0D`: 0x0D (CR)\n  // - `%22`: 0x22 (\")\n  name = new TextDecoder().decode(name)\n    .replace(/%0A/ig, '\\n')\n    .replace(/%0D/ig, '\\r')\n    .replace(/%22/g, '\"')\n\n  // 5. Return the UTF-8 decoding without BOM of name.\n  return name\n}\n\n/**\n * @param {(char: number) => boolean} condition\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfBytes (condition, input, position) {\n  let start = position.position\n\n  while (start < input.length && condition(input[start])) {\n    ++start\n  }\n\n  return input.subarray(position.position, (position.position = start))\n}\n\n/**\n * @param {Buffer} buf\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns {Buffer}\n */\nfunction removeChars (buf, leading, trailing, predicate) {\n  let lead = 0\n  let trail = buf.length - 1\n\n  if (leading) {\n    while (lead < buf.length && predicate(buf[lead])) lead++\n  }\n\n  if (trailing) {\n    while (trail > 0 && predicate(buf[trail])) trail--\n  }\n\n  return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)\n}\n\n/**\n * Checks if {@param buffer} starts with {@param start}\n * @param {Buffer} buffer\n * @param {Buffer} start\n * @param {{ position: number }} position\n */\nfunction bufferStartsWith (buffer, start, position) {\n  if (buffer.length < start.length) {\n    return false\n  }\n\n  for (let i = 0; i < start.length; i++) {\n    if (start[i] !== buffer[position.position + i]) {\n      return false\n    }\n  }\n\n  return true\n}\n\nmodule.exports = {\n  multipartFormDataParser,\n  validateBoundary\n}\n","'use strict'\n\nconst { isBlobLike, iteratorMixin } = require('./util')\nconst { kState } = require('./symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { FileLike, isFileLike } = require('./file')\nconst { webidl } = require('./webidl')\nconst { File: NativeFile } = require('node:buffer')\nconst nodeUtil = require('node:util')\n\n/** @type {globalThis['File']} */\nconst File = globalThis.File ?? NativeFile\n\n// https://xhr.spec.whatwg.org/#formdata\nclass FormData {\n  constructor (form) {\n    webidl.util.markAsUncloneable(this)\n\n    if (form !== undefined) {\n      throw webidl.errors.conversionFailed({\n        prefix: 'FormData constructor',\n        argument: 'Argument 1',\n        types: ['undefined']\n      })\n    }\n\n    this[kState] = []\n  }\n\n  append (name, value, filename = undefined) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.append'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    if (arguments.length === 3 && !isBlobLike(value)) {\n      throw new TypeError(\n        \"Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'\"\n      )\n    }\n\n    // 1. Let value be value if given; otherwise blobValue.\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n    value = isBlobLike(value)\n      ? webidl.converters.Blob(value, prefix, 'value', { strict: false })\n      : webidl.converters.USVString(value, prefix, 'value')\n    filename = arguments.length === 3\n      ? webidl.converters.USVString(filename, prefix, 'filename')\n      : undefined\n\n    // 2. Let entry be the result of creating an entry with\n    // name, value, and filename if given.\n    const entry = makeEntry(name, value, filename)\n\n    // 3. Append entry to this’s entry list.\n    this[kState].push(entry)\n  }\n\n  delete (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // The delete(name) method steps are to remove all entries whose name\n    // is name from this’s entry list.\n    this[kState] = this[kState].filter(entry => entry.name !== name)\n  }\n\n  get (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.get'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // 1. If there is no entry whose name is name in this’s entry list,\n    // then return null.\n    const idx = this[kState].findIndex((entry) => entry.name === name)\n    if (idx === -1) {\n      return null\n    }\n\n    // 2. Return the value of the first entry whose name is name from\n    // this’s entry list.\n    return this[kState][idx].value\n  }\n\n  getAll (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.getAll'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // 1. If there is no entry whose name is name in this’s entry list,\n    // then return the empty list.\n    // 2. Return the values of all entries whose name is name, in order,\n    // from this’s entry list.\n    return this[kState]\n      .filter((entry) => entry.name === name)\n      .map((entry) => entry.value)\n  }\n\n  has (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.has'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // The has(name) method steps are to return true if there is an entry\n    // whose name is name in this’s entry list; otherwise false.\n    return this[kState].findIndex((entry) => entry.name === name) !== -1\n  }\n\n  set (name, value, filename = undefined) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.set'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    if (arguments.length === 3 && !isBlobLike(value)) {\n      throw new TypeError(\n        \"Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'\"\n      )\n    }\n\n    // The set(name, value) and set(name, blobValue, filename) method steps\n    // are:\n\n    // 1. Let value be value if given; otherwise blobValue.\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n    value = isBlobLike(value)\n      ? webidl.converters.Blob(value, prefix, 'name', { strict: false })\n      : webidl.converters.USVString(value, prefix, 'name')\n    filename = arguments.length === 3\n      ? webidl.converters.USVString(filename, prefix, 'name')\n      : undefined\n\n    // 2. Let entry be the result of creating an entry with name, value, and\n    // filename if given.\n    const entry = makeEntry(name, value, filename)\n\n    // 3. If there are entries in this’s entry list whose name is name, then\n    // replace the first such entry with entry and remove the others.\n    const idx = this[kState].findIndex((entry) => entry.name === name)\n    if (idx !== -1) {\n      this[kState] = [\n        ...this[kState].slice(0, idx),\n        entry,\n        ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)\n      ]\n    } else {\n      // 4. Otherwise, append entry to this’s entry list.\n      this[kState].push(entry)\n    }\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    const state = this[kState].reduce((a, b) => {\n      if (a[b.name]) {\n        if (Array.isArray(a[b.name])) {\n          a[b.name].push(b.value)\n        } else {\n          a[b.name] = [a[b.name], b.value]\n        }\n      } else {\n        a[b.name] = b.value\n      }\n\n      return a\n    }, { __proto__: null })\n\n    options.depth ??= depth\n    options.colors ??= true\n\n    const output = nodeUtil.formatWithOptions(options, state)\n\n    // remove [Object null prototype]\n    return `FormData ${output.slice(output.indexOf(']') + 2)}`\n  }\n}\n\niteratorMixin('FormData', FormData, kState, 'name', 'value')\n\nObject.defineProperties(FormData.prototype, {\n  append: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  get: kEnumerableProperty,\n  getAll: kEnumerableProperty,\n  has: kEnumerableProperty,\n  set: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'FormData',\n    configurable: true\n  }\n})\n\n/**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry\n * @param {string} name\n * @param {string|Blob} value\n * @param {?string} filename\n * @returns\n */\nfunction makeEntry (name, value, filename) {\n  // 1. Set name to the result of converting name into a scalar value string.\n  // Note: This operation was done by the webidl converter USVString.\n\n  // 2. If value is a string, then set value to the result of converting\n  //    value into a scalar value string.\n  if (typeof value === 'string') {\n    // Note: This operation was done by the webidl converter USVString.\n  } else {\n    // 3. Otherwise:\n\n    // 1. If value is not a File object, then set value to a new File object,\n    //    representing the same bytes, whose name attribute value is \"blob\"\n    if (!isFileLike(value)) {\n      value = value instanceof Blob\n        ? new File([value], 'blob', { type: value.type })\n        : new FileLike(value, 'blob', { type: value.type })\n    }\n\n    // 2. If filename is given, then set value to a new File object,\n    //    representing the same bytes, whose name attribute is filename.\n    if (filename !== undefined) {\n      /** @type {FilePropertyBag} */\n      const options = {\n        type: value.type,\n        lastModified: value.lastModified\n      }\n\n      value = value instanceof NativeFile\n        ? new File([value], filename, options)\n        : new FileLike(value, filename, options)\n    }\n  }\n\n  // 4. Return an entry whose name is name and whose value is value.\n  return { name, value }\n}\n\nmodule.exports = { FormData, makeEntry }\n","'use strict'\n\n// In case of breaking changes, increase the version\n// number to avoid conflicts.\nconst globalOrigin = Symbol.for('undici.globalOrigin.1')\n\nfunction getGlobalOrigin () {\n  return globalThis[globalOrigin]\n}\n\nfunction setGlobalOrigin (newOrigin) {\n  if (newOrigin === undefined) {\n    Object.defineProperty(globalThis, globalOrigin, {\n      value: undefined,\n      writable: true,\n      enumerable: false,\n      configurable: false\n    })\n\n    return\n  }\n\n  const parsedURL = new URL(newOrigin)\n\n  if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {\n    throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)\n  }\n\n  Object.defineProperty(globalThis, globalOrigin, {\n    value: parsedURL,\n    writable: true,\n    enumerable: false,\n    configurable: false\n  })\n}\n\nmodule.exports = {\n  getGlobalOrigin,\n  setGlobalOrigin\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst { kConstruct } = require('../../core/symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst {\n  iteratorMixin,\n  isValidHeaderName,\n  isValidHeaderValue\n} = require('./util')\nconst { webidl } = require('./webidl')\nconst assert = require('node:assert')\nconst util = require('node:util')\n\nconst kHeadersMap = Symbol('headers map')\nconst kHeadersSortedMap = Symbol('headers map sorted')\n\n/**\n * @param {number} code\n */\nfunction isHTTPWhiteSpaceCharCode (code) {\n  return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize\n * @param {string} potentialValue\n */\nfunction headerValueNormalize (potentialValue) {\n  //  To normalize a byte sequence potentialValue, remove\n  //  any leading and trailing HTTP whitespace bytes from\n  //  potentialValue.\n  let i = 0; let j = potentialValue.length\n\n  while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j\n  while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i\n\n  return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)\n}\n\nfunction fill (headers, object) {\n  // To fill a Headers object headers with a given object object, run these steps:\n\n  // 1. If object is a sequence, then for each header in object:\n  // Note: webidl conversion to array has already been done.\n  if (Array.isArray(object)) {\n    for (let i = 0; i < object.length; ++i) {\n      const header = object[i]\n      // 1. If header does not contain exactly two items, then throw a TypeError.\n      if (header.length !== 2) {\n        throw webidl.errors.exception({\n          header: 'Headers constructor',\n          message: `expected name/value pair to be length 2, found ${header.length}.`\n        })\n      }\n\n      // 2. Append (header’s first item, header’s second item) to headers.\n      appendHeader(headers, header[0], header[1])\n    }\n  } else if (typeof object === 'object' && object !== null) {\n    // Note: null should throw\n\n    // 2. Otherwise, object is a record, then for each key → value in object,\n    //    append (key, value) to headers\n    const keys = Object.keys(object)\n    for (let i = 0; i < keys.length; ++i) {\n      appendHeader(headers, keys[i], object[keys[i]])\n    }\n  } else {\n    throw webidl.errors.conversionFailed({\n      prefix: 'Headers constructor',\n      argument: 'Argument 1',\n      types: ['sequence>', 'record']\n    })\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-headers-append\n */\nfunction appendHeader (headers, name, value) {\n  // 1. Normalize value.\n  value = headerValueNormalize(value)\n\n  // 2. If name is not a header name or value is not a\n  //    header value, then throw a TypeError.\n  if (!isValidHeaderName(name)) {\n    throw webidl.errors.invalidArgument({\n      prefix: 'Headers.append',\n      value: name,\n      type: 'header name'\n    })\n  } else if (!isValidHeaderValue(value)) {\n    throw webidl.errors.invalidArgument({\n      prefix: 'Headers.append',\n      value,\n      type: 'header value'\n    })\n  }\n\n  // 3. If headers’s guard is \"immutable\", then throw a TypeError.\n  // 4. Otherwise, if headers’s guard is \"request\" and name is a\n  //    forbidden header name, return.\n  // 5. Otherwise, if headers’s guard is \"request-no-cors\":\n  //    TODO\n  // Note: undici does not implement forbidden header names\n  if (getHeadersGuard(headers) === 'immutable') {\n    throw new TypeError('immutable')\n  }\n\n  // 6. Otherwise, if headers’s guard is \"response\" and name is a\n  //    forbidden response-header name, return.\n\n  // 7. Append (name, value) to headers’s header list.\n  return getHeadersList(headers).append(name, value, false)\n\n  // 8. If headers’s guard is \"request-no-cors\", then remove\n  //    privileged no-CORS request headers from headers\n}\n\nfunction compareHeaderName (a, b) {\n  return a[0] < b[0] ? -1 : 1\n}\n\nclass HeadersList {\n  /** @type {[string, string][]|null} */\n  cookies = null\n\n  constructor (init) {\n    if (init instanceof HeadersList) {\n      this[kHeadersMap] = new Map(init[kHeadersMap])\n      this[kHeadersSortedMap] = init[kHeadersSortedMap]\n      this.cookies = init.cookies === null ? null : [...init.cookies]\n    } else {\n      this[kHeadersMap] = new Map(init)\n      this[kHeadersSortedMap] = null\n    }\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#header-list-contains\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   */\n  contains (name, isLowerCase) {\n    // A header list list contains a header name name if list\n    // contains a header whose name is a byte-case-insensitive\n    // match for name.\n\n    return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase())\n  }\n\n  clear () {\n    this[kHeadersMap].clear()\n    this[kHeadersSortedMap] = null\n    this.cookies = null\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-append\n   * @param {string} name\n   * @param {string} value\n   * @param {boolean} isLowerCase\n   */\n  append (name, value, isLowerCase) {\n    this[kHeadersSortedMap] = null\n\n    // 1. If list contains name, then set name to the first such\n    //    header’s name.\n    const lowercaseName = isLowerCase ? name : name.toLowerCase()\n    const exists = this[kHeadersMap].get(lowercaseName)\n\n    // 2. Append (name, value) to list.\n    if (exists) {\n      const delimiter = lowercaseName === 'cookie' ? '; ' : ', '\n      this[kHeadersMap].set(lowercaseName, {\n        name: exists.name,\n        value: `${exists.value}${delimiter}${value}`\n      })\n    } else {\n      this[kHeadersMap].set(lowercaseName, { name, value })\n    }\n\n    if (lowercaseName === 'set-cookie') {\n      (this.cookies ??= []).push(value)\n    }\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-set\n   * @param {string} name\n   * @param {string} value\n   * @param {boolean} isLowerCase\n   */\n  set (name, value, isLowerCase) {\n    this[kHeadersSortedMap] = null\n    const lowercaseName = isLowerCase ? name : name.toLowerCase()\n\n    if (lowercaseName === 'set-cookie') {\n      this.cookies = [value]\n    }\n\n    // 1. If list contains name, then set the value of\n    //    the first such header to value and remove the\n    //    others.\n    // 2. Otherwise, append header (name, value) to list.\n    this[kHeadersMap].set(lowercaseName, { name, value })\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-delete\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   */\n  delete (name, isLowerCase) {\n    this[kHeadersSortedMap] = null\n    if (!isLowerCase) name = name.toLowerCase()\n\n    if (name === 'set-cookie') {\n      this.cookies = null\n    }\n\n    this[kHeadersMap].delete(name)\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-get\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   * @returns {string | null}\n   */\n  get (name, isLowerCase) {\n    // 1. If list does not contain name, then return null.\n    // 2. Return the values of all headers in list whose name\n    //    is a byte-case-insensitive match for name,\n    //    separated from each other by 0x2C 0x20, in order.\n    return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null\n  }\n\n  * [Symbol.iterator] () {\n    // use the lowercased name\n    for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n      yield [name, value]\n    }\n  }\n\n  get entries () {\n    const headers = {}\n\n    if (this[kHeadersMap].size !== 0) {\n      for (const { name, value } of this[kHeadersMap].values()) {\n        headers[name] = value\n      }\n    }\n\n    return headers\n  }\n\n  rawValues () {\n    return this[kHeadersMap].values()\n  }\n\n  get entriesList () {\n    const headers = []\n\n    if (this[kHeadersMap].size !== 0) {\n      for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) {\n        if (lowerName === 'set-cookie') {\n          for (const cookie of this.cookies) {\n            headers.push([name, cookie])\n          }\n        } else {\n          headers.push([name, value])\n        }\n      }\n    }\n\n    return headers\n  }\n\n  // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set\n  toSortedArray () {\n    const size = this[kHeadersMap].size\n    const array = new Array(size)\n    // In most cases, you will use the fast-path.\n    // fast-path: Use binary insertion sort for small arrays.\n    if (size <= 32) {\n      if (size === 0) {\n        // If empty, it is an empty array. To avoid the first index assignment.\n        return array\n      }\n      // Improve performance by unrolling loop and avoiding double-loop.\n      // Double-loop-less version of the binary insertion sort.\n      const iterator = this[kHeadersMap][Symbol.iterator]()\n      const firstValue = iterator.next().value\n      // set [name, value] to first index.\n      array[0] = [firstValue[0], firstValue[1].value]\n      // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n      // 3.2.2. Assert: value is non-null.\n      assert(firstValue[1].value !== null)\n      for (\n        let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value;\n        i < size;\n        ++i\n      ) {\n        // get next value\n        value = iterator.next().value\n        // set [name, value] to current index.\n        x = array[i] = [value[0], value[1].value]\n        // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n        // 3.2.2. Assert: value is non-null.\n        assert(x[1] !== null)\n        left = 0\n        right = i\n        // binary search\n        while (left < right) {\n          // middle index\n          pivot = left + ((right - left) >> 1)\n          // compare header name\n          if (array[pivot][0] <= x[0]) {\n            left = pivot + 1\n          } else {\n            right = pivot\n          }\n        }\n        if (i !== pivot) {\n          j = i\n          while (j > left) {\n            array[j] = array[--j]\n          }\n          array[left] = x\n        }\n      }\n      /* c8 ignore next 4 */\n      if (!iterator.next().done) {\n        // This is for debugging and will never be called.\n        throw new TypeError('Unreachable')\n      }\n      return array\n    } else {\n      // This case would be a rare occurrence.\n      // slow-path: fallback\n      let i = 0\n      for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n        array[i++] = [name, value]\n        // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n        // 3.2.2. Assert: value is non-null.\n        assert(value !== null)\n      }\n      return array.sort(compareHeaderName)\n    }\n  }\n}\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n  #guard\n  #headersList\n\n  constructor (init = undefined) {\n    webidl.util.markAsUncloneable(this)\n\n    if (init === kConstruct) {\n      return\n    }\n\n    this.#headersList = new HeadersList()\n\n    // The new Headers(init) constructor steps are:\n\n    // 1. Set this’s guard to \"none\".\n    this.#guard = 'none'\n\n    // 2. If init is given, then fill this with init.\n    if (init !== undefined) {\n      init = webidl.converters.HeadersInit(init, 'Headers contructor', 'init')\n      fill(this, init)\n    }\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-append\n  append (name, value) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 2, 'Headers.append')\n\n    const prefix = 'Headers.append'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n    value = webidl.converters.ByteString(value, prefix, 'value')\n\n    return appendHeader(this, name, value)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-delete\n  delete (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')\n\n    const prefix = 'Headers.delete'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix: 'Headers.delete',\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. If this’s guard is \"immutable\", then throw a TypeError.\n    // 3. Otherwise, if this’s guard is \"request\" and name is a\n    //    forbidden header name, return.\n    // 4. Otherwise, if this’s guard is \"request-no-cors\", name\n    //    is not a no-CORS-safelisted request-header name, and\n    //    name is not a privileged no-CORS request-header name,\n    //    return.\n    // 5. Otherwise, if this’s guard is \"response\" and name is\n    //    a forbidden response-header name, return.\n    // Note: undici does not implement forbidden header names\n    if (this.#guard === 'immutable') {\n      throw new TypeError('immutable')\n    }\n\n    // 6. If this’s header list does not contain name, then\n    //    return.\n    if (!this.#headersList.contains(name, false)) {\n      return\n    }\n\n    // 7. Delete name from this’s header list.\n    // 8. If this’s guard is \"request-no-cors\", then remove\n    //    privileged no-CORS request headers from this.\n    this.#headersList.delete(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-get\n  get (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.get')\n\n    const prefix = 'Headers.get'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. Return the result of getting name from this’s header\n    //    list.\n    return this.#headersList.get(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-has\n  has (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.has')\n\n    const prefix = 'Headers.has'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. Return true if this’s header list contains name;\n    //    otherwise false.\n    return this.#headersList.contains(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-set\n  set (name, value) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 2, 'Headers.set')\n\n    const prefix = 'Headers.set'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n    value = webidl.converters.ByteString(value, prefix, 'value')\n\n    // 1. Normalize value.\n    value = headerValueNormalize(value)\n\n    // 2. If name is not a header name or value is not a\n    //    header value, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    } else if (!isValidHeaderValue(value)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value,\n        type: 'header value'\n      })\n    }\n\n    // 3. If this’s guard is \"immutable\", then throw a TypeError.\n    // 4. Otherwise, if this’s guard is \"request\" and name is a\n    //    forbidden header name, return.\n    // 5. Otherwise, if this’s guard is \"request-no-cors\" and\n    //    name/value is not a no-CORS-safelisted request-header,\n    //    return.\n    // 6. Otherwise, if this’s guard is \"response\" and name is a\n    //    forbidden response-header name, return.\n    // Note: undici does not implement forbidden header names\n    if (this.#guard === 'immutable') {\n      throw new TypeError('immutable')\n    }\n\n    // 7. Set (name, value) in this’s header list.\n    // 8. If this’s guard is \"request-no-cors\", then remove\n    //    privileged no-CORS request headers from this\n    this.#headersList.set(name, value, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n  getSetCookie () {\n    webidl.brandCheck(this, Headers)\n\n    // 1. If this’s header list does not contain `Set-Cookie`, then return « ».\n    // 2. Return the values of all headers in this’s header list whose name is\n    //    a byte-case-insensitive match for `Set-Cookie`, in order.\n\n    const list = this.#headersList.cookies\n\n    if (list) {\n      return [...list]\n    }\n\n    return []\n  }\n\n  // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n  get [kHeadersSortedMap] () {\n    if (this.#headersList[kHeadersSortedMap]) {\n      return this.#headersList[kHeadersSortedMap]\n    }\n\n    // 1. Let headers be an empty list of headers with the key being the name\n    //    and value the value.\n    const headers = []\n\n    // 2. Let names be the result of convert header names to a sorted-lowercase\n    //    set with all the names of the headers in list.\n    const names = this.#headersList.toSortedArray()\n\n    const cookies = this.#headersList.cookies\n\n    // fast-path\n    if (cookies === null || cookies.length === 1) {\n      // Note: The non-null assertion of value has already been done by `HeadersList#toSortedArray`\n      return (this.#headersList[kHeadersSortedMap] = names)\n    }\n\n    // 3. For each name of names:\n    for (let i = 0; i < names.length; ++i) {\n      const { 0: name, 1: value } = names[i]\n      // 1. If name is `set-cookie`, then:\n      if (name === 'set-cookie') {\n        // 1. Let values be a list of all values of headers in list whose name\n        //    is a byte-case-insensitive match for name, in order.\n\n        // 2. For each value of values:\n        // 1. Append (name, value) to headers.\n        for (let j = 0; j < cookies.length; ++j) {\n          headers.push([name, cookies[j]])\n        }\n      } else {\n        // 2. Otherwise:\n\n        // 1. Let value be the result of getting name from list.\n\n        // 2. Assert: value is non-null.\n        // Note: This operation was done by `HeadersList#toSortedArray`.\n\n        // 3. Append (name, value) to headers.\n        headers.push([name, value])\n      }\n    }\n\n    // 4. Return headers.\n    return (this.#headersList[kHeadersSortedMap] = headers)\n  }\n\n  [util.inspect.custom] (depth, options) {\n    options.depth ??= depth\n\n    return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`\n  }\n\n  static getHeadersGuard (o) {\n    return o.#guard\n  }\n\n  static setHeadersGuard (o, guard) {\n    o.#guard = guard\n  }\n\n  static getHeadersList (o) {\n    return o.#headersList\n  }\n\n  static setHeadersList (o, list) {\n    o.#headersList = list\n  }\n}\n\nconst { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers\nReflect.deleteProperty(Headers, 'getHeadersGuard')\nReflect.deleteProperty(Headers, 'setHeadersGuard')\nReflect.deleteProperty(Headers, 'getHeadersList')\nReflect.deleteProperty(Headers, 'setHeadersList')\n\niteratorMixin('Headers', Headers, kHeadersSortedMap, 0, 1)\n\nObject.defineProperties(Headers.prototype, {\n  append: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  get: kEnumerableProperty,\n  has: kEnumerableProperty,\n  set: kEnumerableProperty,\n  getSetCookie: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Headers',\n    configurable: true\n  },\n  [util.inspect.custom]: {\n    enumerable: false\n  }\n})\n\nwebidl.converters.HeadersInit = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === 'Object') {\n    const iterator = Reflect.get(V, Symbol.iterator)\n\n    // A work-around to ensure we send the properly-cased Headers when V is a Headers object.\n    // Read https://github.com/nodejs/undici/pull/3159#issuecomment-2075537226 before touching, please.\n    if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { // Headers object\n      try {\n        return getHeadersList(V).entriesList\n      } catch {\n        // fall-through\n      }\n    }\n\n    if (typeof iterator === 'function') {\n      return webidl.converters['sequence>'](V, prefix, argument, iterator.bind(V))\n    }\n\n    return webidl.converters['record'](V, prefix, argument)\n  }\n\n  throw webidl.errors.conversionFailed({\n    prefix: 'Headers constructor',\n    argument: 'Argument 1',\n    types: ['sequence>', 'record']\n  })\n}\n\nmodule.exports = {\n  fill,\n  // for test.\n  compareHeaderName,\n  Headers,\n  HeadersList,\n  getHeadersGuard,\n  setHeadersGuard,\n  setHeadersList,\n  getHeadersList\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst {\n  makeNetworkError,\n  makeAppropriateNetworkError,\n  filterResponse,\n  makeResponse,\n  fromInnerResponse\n} = require('./response')\nconst { HeadersList } = require('./headers')\nconst { Request, cloneRequest } = require('./request')\nconst zlib = require('node:zlib')\nconst {\n  bytesMatch,\n  makePolicyContainer,\n  clonePolicyContainer,\n  requestBadPort,\n  TAOCheck,\n  appendRequestOriginHeader,\n  responseLocationURL,\n  requestCurrentURL,\n  setRequestReferrerPolicyOnRedirect,\n  tryUpgradeRequestToAPotentiallyTrustworthyURL,\n  createOpaqueTimingInfo,\n  appendFetchMetadata,\n  corsCheck,\n  crossOriginResourcePolicyCheck,\n  determineRequestsReferrer,\n  coarsenedSharedCurrentTime,\n  createDeferredPromise,\n  isBlobLike,\n  sameOrigin,\n  isCancelled,\n  isAborted,\n  isErrorLike,\n  fullyReadBody,\n  readableStreamClose,\n  isomorphicEncode,\n  urlIsLocal,\n  urlIsHttpHttpsScheme,\n  urlHasHttpsScheme,\n  clampAndCoarsenConnectionTimingInfo,\n  simpleRangeHeaderValue,\n  buildContentRange,\n  createInflate,\n  extractMimeType\n} = require('./util')\nconst { kState, kDispatcher } = require('./symbols')\nconst assert = require('node:assert')\nconst { safelyExtractBody, extractBody } = require('./body')\nconst {\n  redirectStatusSet,\n  nullBodyStatus,\n  safeMethodsSet,\n  requestBodyHeader,\n  subresourceSet\n} = require('./constants')\nconst EE = require('node:events')\nconst { Readable, pipeline, finished } = require('node:stream')\nconst { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url')\nconst { getGlobalDispatcher } = require('../../global')\nconst { webidl } = require('./webidl')\nconst { STATUS_CODES } = require('node:http')\nconst GET_OR_HEAD = ['GET', 'HEAD']\n\nconst defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'\n  ? 'node'\n  : 'undici'\n\n/** @type {import('buffer').resolveObjectURL} */\nlet resolveObjectURL\n\nclass Fetch extends EE {\n  constructor (dispatcher) {\n    super()\n\n    this.dispatcher = dispatcher\n    this.connection = null\n    this.dump = false\n    this.state = 'ongoing'\n  }\n\n  terminate (reason) {\n    if (this.state !== 'ongoing') {\n      return\n    }\n\n    this.state = 'terminated'\n    this.connection?.destroy(reason)\n    this.emit('terminated', reason)\n  }\n\n  // https://fetch.spec.whatwg.org/#fetch-controller-abort\n  abort (error) {\n    if (this.state !== 'ongoing') {\n      return\n    }\n\n    // 1. Set controller’s state to \"aborted\".\n    this.state = 'aborted'\n\n    // 2. Let fallbackError be an \"AbortError\" DOMException.\n    // 3. Set error to fallbackError if it is not given.\n    if (!error) {\n      error = new DOMException('The operation was aborted.', 'AbortError')\n    }\n\n    // 4. Let serializedError be StructuredSerialize(error).\n    //    If that threw an exception, catch it, and let\n    //    serializedError be StructuredSerialize(fallbackError).\n\n    // 5. Set controller’s serialized abort reason to serializedError.\n    this.serializedAbortReason = error\n\n    this.connection?.destroy(error)\n    this.emit('terminated', error)\n  }\n}\n\nfunction handleFetchDone (response) {\n  finalizeAndReportTiming(response, 'fetch')\n}\n\n// https://fetch.spec.whatwg.org/#fetch-method\nfunction fetch (input, init = undefined) {\n  webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')\n\n  // 1. Let p be a new promise.\n  let p = createDeferredPromise()\n\n  // 2. Let requestObject be the result of invoking the initial value of\n  // Request as constructor with input and init as arguments. If this throws\n  // an exception, reject p with it and return p.\n  let requestObject\n\n  try {\n    requestObject = new Request(input, init)\n  } catch (e) {\n    p.reject(e)\n    return p.promise\n  }\n\n  // 3. Let request be requestObject’s request.\n  const request = requestObject[kState]\n\n  // 4. If requestObject’s signal’s aborted flag is set, then:\n  if (requestObject.signal.aborted) {\n    // 1. Abort the fetch() call with p, request, null, and\n    //    requestObject’s signal’s abort reason.\n    abortFetch(p, request, null, requestObject.signal.reason)\n\n    // 2. Return p.\n    return p.promise\n  }\n\n  // 5. Let globalObject be request’s client’s global object.\n  const globalObject = request.client.globalObject\n\n  // 6. If globalObject is a ServiceWorkerGlobalScope object, then set\n  // request’s service-workers mode to \"none\".\n  if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {\n    request.serviceWorkers = 'none'\n  }\n\n  // 7. Let responseObject be null.\n  let responseObject = null\n\n  // 8. Let relevantRealm be this’s relevant Realm.\n\n  // 9. Let locallyAborted be false.\n  let locallyAborted = false\n\n  // 10. Let controller be null.\n  let controller = null\n\n  // 11. Add the following abort steps to requestObject’s signal:\n  addAbortListener(\n    requestObject.signal,\n    () => {\n      // 1. Set locallyAborted to true.\n      locallyAborted = true\n\n      // 2. Assert: controller is non-null.\n      assert(controller != null)\n\n      // 3. Abort controller with requestObject’s signal’s abort reason.\n      controller.abort(requestObject.signal.reason)\n\n      const realResponse = responseObject?.deref()\n\n      // 4. Abort the fetch() call with p, request, responseObject,\n      //    and requestObject’s signal’s abort reason.\n      abortFetch(p, request, realResponse, requestObject.signal.reason)\n    }\n  )\n\n  // 12. Let handleFetchDone given response response be to finalize and\n  // report timing with response, globalObject, and \"fetch\".\n  // see function handleFetchDone\n\n  // 13. Set controller to the result of calling fetch given request,\n  // with processResponseEndOfBody set to handleFetchDone, and processResponse\n  // given response being these substeps:\n\n  const processResponse = (response) => {\n    // 1. If locallyAborted is true, terminate these substeps.\n    if (locallyAborted) {\n      return\n    }\n\n    // 2. If response’s aborted flag is set, then:\n    if (response.aborted) {\n      // 1. Let deserializedError be the result of deserialize a serialized\n      //    abort reason given controller’s serialized abort reason and\n      //    relevantRealm.\n\n      // 2. Abort the fetch() call with p, request, responseObject, and\n      //    deserializedError.\n\n      abortFetch(p, request, responseObject, controller.serializedAbortReason)\n      return\n    }\n\n    // 3. If response is a network error, then reject p with a TypeError\n    // and terminate these substeps.\n    if (response.type === 'error') {\n      p.reject(new TypeError('fetch failed', { cause: response.error }))\n      return\n    }\n\n    // 4. Set responseObject to the result of creating a Response object,\n    // given response, \"immutable\", and relevantRealm.\n    responseObject = new WeakRef(fromInnerResponse(response, 'immutable'))\n\n    // 5. Resolve p with responseObject.\n    p.resolve(responseObject.deref())\n    p = null\n  }\n\n  controller = fetching({\n    request,\n    processResponseEndOfBody: handleFetchDone,\n    processResponse,\n    dispatcher: requestObject[kDispatcher] // undici\n  })\n\n  // 14. Return p.\n  return p.promise\n}\n\n// https://fetch.spec.whatwg.org/#finalize-and-report-timing\nfunction finalizeAndReportTiming (response, initiatorType = 'other') {\n  // 1. If response is an aborted network error, then return.\n  if (response.type === 'error' && response.aborted) {\n    return\n  }\n\n  // 2. If response’s URL list is null or empty, then return.\n  if (!response.urlList?.length) {\n    return\n  }\n\n  // 3. Let originalURL be response’s URL list[0].\n  const originalURL = response.urlList[0]\n\n  // 4. Let timingInfo be response’s timing info.\n  let timingInfo = response.timingInfo\n\n  // 5. Let cacheState be response’s cache state.\n  let cacheState = response.cacheState\n\n  // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.\n  if (!urlIsHttpHttpsScheme(originalURL)) {\n    return\n  }\n\n  // 7. If timingInfo is null, then return.\n  if (timingInfo === null) {\n    return\n  }\n\n  // 8. If response’s timing allow passed flag is not set, then:\n  if (!response.timingAllowPassed) {\n    //  1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.\n    timingInfo = createOpaqueTimingInfo({\n      startTime: timingInfo.startTime\n    })\n\n    //  2. Set cacheState to the empty string.\n    cacheState = ''\n  }\n\n  // 9. Set timingInfo’s end time to the coarsened shared current time\n  // given global’s relevant settings object’s cross-origin isolated\n  // capability.\n  // TODO: given global’s relevant settings object’s cross-origin isolated\n  // capability?\n  timingInfo.endTime = coarsenedSharedCurrentTime()\n\n  // 10. Set response’s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 11. Mark resource timing for timingInfo, originalURL, initiatorType,\n  // global, and cacheState.\n  markResourceTiming(\n    timingInfo,\n    originalURL.href,\n    initiatorType,\n    globalThis,\n    cacheState\n  )\n}\n\n// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing\nconst markResourceTiming = performance.markResourceTiming\n\n// https://fetch.spec.whatwg.org/#abort-fetch\nfunction abortFetch (p, request, responseObject, error) {\n  // 1. Reject promise with error.\n  if (p) {\n    // We might have already resolved the promise at this stage\n    p.reject(error)\n  }\n\n  // 2. If request’s body is not null and is readable, then cancel request’s\n  // body with error.\n  if (request.body != null && isReadable(request.body?.stream)) {\n    request.body.stream.cancel(error).catch((err) => {\n      if (err.code === 'ERR_INVALID_STATE') {\n        // Node bug?\n        return\n      }\n      throw err\n    })\n  }\n\n  // 3. If responseObject is null, then return.\n  if (responseObject == null) {\n    return\n  }\n\n  // 4. Let response be responseObject’s response.\n  const response = responseObject[kState]\n\n  // 5. If response’s body is not null and is readable, then error response’s\n  // body with error.\n  if (response.body != null && isReadable(response.body?.stream)) {\n    response.body.stream.cancel(error).catch((err) => {\n      if (err.code === 'ERR_INVALID_STATE') {\n        // Node bug?\n        return\n      }\n      throw err\n    })\n  }\n}\n\n// https://fetch.spec.whatwg.org/#fetching\nfunction fetching ({\n  request,\n  processRequestBodyChunkLength,\n  processRequestEndOfBody,\n  processResponse,\n  processResponseEndOfBody,\n  processResponseConsumeBody,\n  useParallelQueue = false,\n  dispatcher = getGlobalDispatcher() // undici\n}) {\n  // Ensure that the dispatcher is set accordingly\n  assert(dispatcher)\n\n  // 1. Let taskDestination be null.\n  let taskDestination = null\n\n  // 2. Let crossOriginIsolatedCapability be false.\n  let crossOriginIsolatedCapability = false\n\n  // 3. If request’s client is non-null, then:\n  if (request.client != null) {\n    // 1. Set taskDestination to request’s client’s global object.\n    taskDestination = request.client.globalObject\n\n    // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin\n    // isolated capability.\n    crossOriginIsolatedCapability =\n      request.client.crossOriginIsolatedCapability\n  }\n\n  // 4. If useParallelQueue is true, then set taskDestination to the result of\n  // starting a new parallel queue.\n  // TODO\n\n  // 5. Let timingInfo be a new fetch timing info whose start time and\n  // post-redirect start time are the coarsened shared current time given\n  // crossOriginIsolatedCapability.\n  const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)\n  const timingInfo = createOpaqueTimingInfo({\n    startTime: currentTime\n  })\n\n  // 6. Let fetchParams be a new fetch params whose\n  // request is request,\n  // timing info is timingInfo,\n  // process request body chunk length is processRequestBodyChunkLength,\n  // process request end-of-body is processRequestEndOfBody,\n  // process response is processResponse,\n  // process response consume body is processResponseConsumeBody,\n  // process response end-of-body is processResponseEndOfBody,\n  // task destination is taskDestination,\n  // and cross-origin isolated capability is crossOriginIsolatedCapability.\n  const fetchParams = {\n    controller: new Fetch(dispatcher),\n    request,\n    timingInfo,\n    processRequestBodyChunkLength,\n    processRequestEndOfBody,\n    processResponse,\n    processResponseConsumeBody,\n    processResponseEndOfBody,\n    taskDestination,\n    crossOriginIsolatedCapability\n  }\n\n  // 7. If request’s body is a byte sequence, then set request’s body to\n  //    request’s body as a body.\n  // NOTE: Since fetching is only called from fetch, body should already be\n  // extracted.\n  assert(!request.body || request.body.stream)\n\n  // 8. If request’s window is \"client\", then set request’s window to request’s\n  // client, if request’s client’s global object is a Window object; otherwise\n  // \"no-window\".\n  if (request.window === 'client') {\n    // TODO: What if request.client is null?\n    request.window =\n      request.client?.globalObject?.constructor?.name === 'Window'\n        ? request.client\n        : 'no-window'\n  }\n\n  // 9. If request’s origin is \"client\", then set request’s origin to request’s\n  // client’s origin.\n  if (request.origin === 'client') {\n    request.origin = request.client.origin\n  }\n\n  // 10. If all of the following conditions are true:\n  // TODO\n\n  // 11. If request’s policy container is \"client\", then:\n  if (request.policyContainer === 'client') {\n    // 1. If request’s client is non-null, then set request’s policy\n    // container to a clone of request’s client’s policy container. [HTML]\n    if (request.client != null) {\n      request.policyContainer = clonePolicyContainer(\n        request.client.policyContainer\n      )\n    } else {\n      // 2. Otherwise, set request’s policy container to a new policy\n      // container.\n      request.policyContainer = makePolicyContainer()\n    }\n  }\n\n  // 12. If request’s header list does not contain `Accept`, then:\n  if (!request.headersList.contains('accept', true)) {\n    // 1. Let value be `*/*`.\n    const value = '*/*'\n\n    // 2. A user agent should set value to the first matching statement, if\n    // any, switching on request’s destination:\n    // \"document\"\n    // \"frame\"\n    // \"iframe\"\n    // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`\n    // \"image\"\n    // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`\n    // \"style\"\n    // `text/css,*/*;q=0.1`\n    // TODO\n\n    // 3. Append `Accept`/value to request’s header list.\n    request.headersList.append('accept', value, true)\n  }\n\n  // 13. If request’s header list does not contain `Accept-Language`, then\n  // user agents should append `Accept-Language`/an appropriate value to\n  // request’s header list.\n  if (!request.headersList.contains('accept-language', true)) {\n    request.headersList.append('accept-language', '*', true)\n  }\n\n  // 14. If request’s priority is null, then use request’s initiator and\n  // destination appropriately in setting request’s priority to a\n  // user-agent-defined object.\n  if (request.priority === null) {\n    // TODO\n  }\n\n  // 15. If request is a subresource request, then:\n  if (subresourceSet.has(request.destination)) {\n    // TODO\n  }\n\n  // 16. Run main fetch given fetchParams.\n  mainFetch(fetchParams)\n    .catch(err => {\n      fetchParams.controller.terminate(err)\n    })\n\n  // 17. Return fetchParam's controller\n  return fetchParams.controller\n}\n\n// https://fetch.spec.whatwg.org/#concept-main-fetch\nasync function mainFetch (fetchParams, recursive = false) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. If request’s local-URLs-only flag is set and request’s current URL is\n  // not local, then set response to a network error.\n  if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n    response = makeNetworkError('local URLs only')\n  }\n\n  // 4. Run report Content Security Policy violations for request.\n  // TODO\n\n  // 5. Upgrade request to a potentially trustworthy URL, if appropriate.\n  tryUpgradeRequestToAPotentiallyTrustworthyURL(request)\n\n  // 6. If should request be blocked due to a bad port, should fetching request\n  // be blocked as mixed content, or should request be blocked by Content\n  // Security Policy returns blocked, then set response to a network error.\n  if (requestBadPort(request) === 'blocked') {\n    response = makeNetworkError('bad port')\n  }\n  // TODO: should fetching request be blocked as mixed content?\n  // TODO: should request be blocked by Content Security Policy?\n\n  // 7. If request’s referrer policy is the empty string, then set request’s\n  // referrer policy to request’s policy container’s referrer policy.\n  if (request.referrerPolicy === '') {\n    request.referrerPolicy = request.policyContainer.referrerPolicy\n  }\n\n  // 8. If request’s referrer is not \"no-referrer\", then set request’s\n  // referrer to the result of invoking determine request’s referrer.\n  if (request.referrer !== 'no-referrer') {\n    request.referrer = determineRequestsReferrer(request)\n  }\n\n  // 9. Set request’s current URL’s scheme to \"https\" if all of the following\n  // conditions are true:\n  // - request’s current URL’s scheme is \"http\"\n  // - request’s current URL’s host is a domain\n  // - Matching request’s current URL’s host per Known HSTS Host Domain Name\n  //   Matching results in either a superdomain match with an asserted\n  //   includeSubDomains directive or a congruent match (with or without an\n  //   asserted includeSubDomains directive). [HSTS]\n  // TODO\n\n  // 10. If recursive is false, then run the remaining steps in parallel.\n  // TODO\n\n  // 11. If response is null, then set response to the result of running\n  // the steps corresponding to the first matching statement:\n  if (response === null) {\n    response = await (async () => {\n      const currentURL = requestCurrentURL(request)\n\n      if (\n        // - request’s current URL’s origin is same origin with request’s origin,\n        //   and request’s response tainting is \"basic\"\n        (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||\n        // request’s current URL’s scheme is \"data\"\n        (currentURL.protocol === 'data:') ||\n        // - request’s mode is \"navigate\" or \"websocket\"\n        (request.mode === 'navigate' || request.mode === 'websocket')\n      ) {\n        // 1. Set request’s response tainting to \"basic\".\n        request.responseTainting = 'basic'\n\n        // 2. Return the result of running scheme fetch given fetchParams.\n        return await schemeFetch(fetchParams)\n      }\n\n      // request’s mode is \"same-origin\"\n      if (request.mode === 'same-origin') {\n        // 1. Return a network error.\n        return makeNetworkError('request mode cannot be \"same-origin\"')\n      }\n\n      // request’s mode is \"no-cors\"\n      if (request.mode === 'no-cors') {\n        // 1. If request’s redirect mode is not \"follow\", then return a network\n        // error.\n        if (request.redirect !== 'follow') {\n          return makeNetworkError(\n            'redirect mode cannot be \"follow\" for \"no-cors\" request'\n          )\n        }\n\n        // 2. Set request’s response tainting to \"opaque\".\n        request.responseTainting = 'opaque'\n\n        // 3. Return the result of running scheme fetch given fetchParams.\n        return await schemeFetch(fetchParams)\n      }\n\n      // request’s current URL’s scheme is not an HTTP(S) scheme\n      if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n        // Return a network error.\n        return makeNetworkError('URL scheme must be a HTTP(S) scheme')\n      }\n\n      // - request’s use-CORS-preflight flag is set\n      // - request’s unsafe-request flag is set and either request’s method is\n      //   not a CORS-safelisted method or CORS-unsafe request-header names with\n      //   request’s header list is not empty\n      //    1. Set request’s response tainting to \"cors\".\n      //    2. Let corsWithPreflightResponse be the result of running HTTP fetch\n      //    given fetchParams and true.\n      //    3. If corsWithPreflightResponse is a network error, then clear cache\n      //    entries using request.\n      //    4. Return corsWithPreflightResponse.\n      // TODO\n\n      // Otherwise\n      //    1. Set request’s response tainting to \"cors\".\n      request.responseTainting = 'cors'\n\n      //    2. Return the result of running HTTP fetch given fetchParams.\n      return await httpFetch(fetchParams)\n    })()\n  }\n\n  // 12. If recursive is true, then return response.\n  if (recursive) {\n    return response\n  }\n\n  // 13. If response is not a network error and response is not a filtered\n  // response, then:\n  if (response.status !== 0 && !response.internalResponse) {\n    // If request’s response tainting is \"cors\", then:\n    if (request.responseTainting === 'cors') {\n      // 1. Let headerNames be the result of extracting header list values\n      // given `Access-Control-Expose-Headers` and response’s header list.\n      // TODO\n      // 2. If request’s credentials mode is not \"include\" and headerNames\n      // contains `*`, then set response’s CORS-exposed header-name list to\n      // all unique header names in response’s header list.\n      // TODO\n      // 3. Otherwise, if headerNames is not null or failure, then set\n      // response’s CORS-exposed header-name list to headerNames.\n      // TODO\n    }\n\n    // Set response to the following filtered response with response as its\n    // internal response, depending on request’s response tainting:\n    if (request.responseTainting === 'basic') {\n      response = filterResponse(response, 'basic')\n    } else if (request.responseTainting === 'cors') {\n      response = filterResponse(response, 'cors')\n    } else if (request.responseTainting === 'opaque') {\n      response = filterResponse(response, 'opaque')\n    } else {\n      assert(false)\n    }\n  }\n\n  // 14. Let internalResponse be response, if response is a network error,\n  // and response’s internal response otherwise.\n  let internalResponse =\n    response.status === 0 ? response : response.internalResponse\n\n  // 15. If internalResponse’s URL list is empty, then set it to a clone of\n  // request’s URL list.\n  if (internalResponse.urlList.length === 0) {\n    internalResponse.urlList.push(...request.urlList)\n  }\n\n  // 16. If request’s timing allow failed flag is unset, then set\n  // internalResponse’s timing allow passed flag.\n  if (!request.timingAllowFailed) {\n    response.timingAllowPassed = true\n  }\n\n  // 17. If response is not a network error and any of the following returns\n  // blocked\n  // - should internalResponse to request be blocked as mixed content\n  // - should internalResponse to request be blocked by Content Security Policy\n  // - should internalResponse to request be blocked due to its MIME type\n  // - should internalResponse to request be blocked due to nosniff\n  // TODO\n\n  // 18. If response’s type is \"opaque\", internalResponse’s status is 206,\n  // internalResponse’s range-requested flag is set, and request’s header\n  // list does not contain `Range`, then set response and internalResponse\n  // to a network error.\n  if (\n    response.type === 'opaque' &&\n    internalResponse.status === 206 &&\n    internalResponse.rangeRequested &&\n    !request.headers.contains('range', true)\n  ) {\n    response = internalResponse = makeNetworkError()\n  }\n\n  // 19. If response is not a network error and either request’s method is\n  // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,\n  // set internalResponse’s body to null and disregard any enqueuing toward\n  // it (if any).\n  if (\n    response.status !== 0 &&\n    (request.method === 'HEAD' ||\n      request.method === 'CONNECT' ||\n      nullBodyStatus.includes(internalResponse.status))\n  ) {\n    internalResponse.body = null\n    fetchParams.controller.dump = true\n  }\n\n  // 20. If request’s integrity metadata is not the empty string, then:\n  if (request.integrity) {\n    // 1. Let processBodyError be this step: run fetch finale given fetchParams\n    // and a network error.\n    const processBodyError = (reason) =>\n      fetchFinale(fetchParams, makeNetworkError(reason))\n\n    // 2. If request’s response tainting is \"opaque\", or response’s body is null,\n    // then run processBodyError and abort these steps.\n    if (request.responseTainting === 'opaque' || response.body == null) {\n      processBodyError(response.error)\n      return\n    }\n\n    // 3. Let processBody given bytes be these steps:\n    const processBody = (bytes) => {\n      // 1. If bytes do not match request’s integrity metadata,\n      // then run processBodyError and abort these steps. [SRI]\n      if (!bytesMatch(bytes, request.integrity)) {\n        processBodyError('integrity mismatch')\n        return\n      }\n\n      // 2. Set response’s body to bytes as a body.\n      response.body = safelyExtractBody(bytes)[0]\n\n      // 3. Run fetch finale given fetchParams and response.\n      fetchFinale(fetchParams, response)\n    }\n\n    // 4. Fully read response’s body given processBody and processBodyError.\n    await fullyReadBody(response.body, processBody, processBodyError)\n  } else {\n    // 21. Otherwise, run fetch finale given fetchParams and response.\n    fetchFinale(fetchParams, response)\n  }\n}\n\n// https://fetch.spec.whatwg.org/#concept-scheme-fetch\n// given a fetch params fetchParams\nfunction schemeFetch (fetchParams) {\n  // Note: since the connection is destroyed on redirect, which sets fetchParams to a\n  // cancelled state, we do not want this condition to trigger *unless* there have been\n  // no redirects. See https://github.com/nodejs/undici/issues/1776\n  // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n  if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n    return Promise.resolve(makeAppropriateNetworkError(fetchParams))\n  }\n\n  // 2. Let request be fetchParams’s request.\n  const { request } = fetchParams\n\n  const { protocol: scheme } = requestCurrentURL(request)\n\n  // 3. Switch on request’s current URL’s scheme and run the associated steps:\n  switch (scheme) {\n    case 'about:': {\n      // If request’s current URL’s path is the string \"blank\", then return a new response\n      // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,\n      // and body is the empty byte sequence as a body.\n\n      // Otherwise, return a network error.\n      return Promise.resolve(makeNetworkError('about scheme is not supported'))\n    }\n    case 'blob:': {\n      if (!resolveObjectURL) {\n        resolveObjectURL = require('node:buffer').resolveObjectURL\n      }\n\n      // 1. Let blobURLEntry be request’s current URL’s blob URL entry.\n      const blobURLEntry = requestCurrentURL(request)\n\n      // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56\n      // Buffer.resolveObjectURL does not ignore URL queries.\n      if (blobURLEntry.search.length !== 0) {\n        return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))\n      }\n\n      const blob = resolveObjectURL(blobURLEntry.toString())\n\n      // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s\n      //    object is not a Blob object, then return a network error.\n      if (request.method !== 'GET' || !isBlobLike(blob)) {\n        return Promise.resolve(makeNetworkError('invalid method'))\n      }\n\n      // 3. Let blob be blobURLEntry’s object.\n      // Note: done above\n\n      // 4. Let response be a new response.\n      const response = makeResponse()\n\n      // 5. Let fullLength be blob’s size.\n      const fullLength = blob.size\n\n      // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.\n      const serializedFullLength = isomorphicEncode(`${fullLength}`)\n\n      // 7. Let type be blob’s type.\n      const type = blob.type\n\n      // 8. If request’s header list does not contain `Range`:\n      // 9. Otherwise:\n      if (!request.headersList.contains('range', true)) {\n        // 1. Let bodyWithType be the result of safely extracting blob.\n        // Note: in the FileAPI a blob \"object\" is a Blob *or* a MediaSource.\n        // In node, this can only ever be a Blob. Therefore we can safely\n        // use extractBody directly.\n        const bodyWithType = extractBody(blob)\n\n        // 2. Set response’s status message to `OK`.\n        response.statusText = 'OK'\n\n        // 3. Set response’s body to bodyWithType’s body.\n        response.body = bodyWithType[0]\n\n        // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».\n        response.headersList.set('content-length', serializedFullLength, true)\n        response.headersList.set('content-type', type, true)\n      } else {\n        // 1. Set response’s range-requested flag.\n        response.rangeRequested = true\n\n        // 2. Let rangeHeader be the result of getting `Range` from request’s header list.\n        const rangeHeader = request.headersList.get('range', true)\n\n        // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true.\n        const rangeValue = simpleRangeHeaderValue(rangeHeader, true)\n\n        // 4. If rangeValue is failure, then return a network error.\n        if (rangeValue === 'failure') {\n          return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n        }\n\n        // 5. Let (rangeStart, rangeEnd) be rangeValue.\n        let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue\n\n        // 6. If rangeStart is null:\n        // 7. Otherwise:\n        if (rangeStart === null) {\n          // 1. Set rangeStart to fullLength − rangeEnd.\n          rangeStart = fullLength - rangeEnd\n\n          // 2. Set rangeEnd to rangeStart + rangeEnd − 1.\n          rangeEnd = rangeStart + rangeEnd - 1\n        } else {\n          // 1. If rangeStart is greater than or equal to fullLength, then return a network error.\n          if (rangeStart >= fullLength) {\n            return Promise.resolve(makeNetworkError('Range start is greater than the blob\\'s size.'))\n          }\n\n          // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set\n          //    rangeEnd to fullLength − 1.\n          if (rangeEnd === null || rangeEnd >= fullLength) {\n            rangeEnd = fullLength - 1\n          }\n        }\n\n        // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,\n        //    rangeEnd + 1, and type.\n        const slicedBlob = blob.slice(rangeStart, rangeEnd, type)\n\n        // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.\n        // Note: same reason as mentioned above as to why we use extractBody\n        const slicedBodyWithType = extractBody(slicedBlob)\n\n        // 10. Set response’s body to slicedBodyWithType’s body.\n        response.body = slicedBodyWithType[0]\n\n        // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.\n        const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`)\n\n        // 12. Let contentRange be the result of invoking build a content range given rangeStart,\n        //     rangeEnd, and fullLength.\n        const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength)\n\n        // 13. Set response’s status to 206.\n        response.status = 206\n\n        // 14. Set response’s status message to `Partial Content`.\n        response.statusText = 'Partial Content'\n\n        // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength),\n        //     (`Content-Type`, type), (`Content-Range`, contentRange) ».\n        response.headersList.set('content-length', serializedSlicedLength, true)\n        response.headersList.set('content-type', type, true)\n        response.headersList.set('content-range', contentRange, true)\n      }\n\n      // 10. Return response.\n      return Promise.resolve(response)\n    }\n    case 'data:': {\n      // 1. Let dataURLStruct be the result of running the\n      //    data: URL processor on request’s current URL.\n      const currentURL = requestCurrentURL(request)\n      const dataURLStruct = dataURLProcessor(currentURL)\n\n      // 2. If dataURLStruct is failure, then return a\n      //    network error.\n      if (dataURLStruct === 'failure') {\n        return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n      }\n\n      // 3. Let mimeType be dataURLStruct’s MIME type, serialized.\n      const mimeType = serializeAMimeType(dataURLStruct.mimeType)\n\n      // 4. Return a response whose status message is `OK`,\n      //    header list is « (`Content-Type`, mimeType) »,\n      //    and body is dataURLStruct’s body as a body.\n      return Promise.resolve(makeResponse({\n        statusText: 'OK',\n        headersList: [\n          ['content-type', { name: 'Content-Type', value: mimeType }]\n        ],\n        body: safelyExtractBody(dataURLStruct.body)[0]\n      }))\n    }\n    case 'file:': {\n      // For now, unfortunate as it is, file URLs are left as an exercise for the reader.\n      // When in doubt, return a network error.\n      return Promise.resolve(makeNetworkError('not implemented... yet...'))\n    }\n    case 'http:':\n    case 'https:': {\n      // Return the result of running HTTP fetch given fetchParams.\n\n      return httpFetch(fetchParams)\n        .catch((err) => makeNetworkError(err))\n    }\n    default: {\n      return Promise.resolve(makeNetworkError('unknown scheme'))\n    }\n  }\n}\n\n// https://fetch.spec.whatwg.org/#finalize-response\nfunction finalizeResponse (fetchParams, response) {\n  // 1. Set fetchParams’s request’s done flag.\n  fetchParams.request.done = true\n\n  // 2, If fetchParams’s process response done is not null, then queue a fetch\n  // task to run fetchParams’s process response done given response, with\n  // fetchParams’s task destination.\n  if (fetchParams.processResponseDone != null) {\n    queueMicrotask(() => fetchParams.processResponseDone(response))\n  }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-finale\nfunction fetchFinale (fetchParams, response) {\n  // 1. Let timingInfo be fetchParams’s timing info.\n  let timingInfo = fetchParams.timingInfo\n\n  // 2. If response is not a network error and fetchParams’s request’s client is a secure context,\n  //    then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting\n  //    `Server-Timing` from response’s internal response’s header list.\n  // TODO\n\n  // 3. Let processResponseEndOfBody be the following steps:\n  const processResponseEndOfBody = () => {\n    // 1. Let unsafeEndTime be the unsafe shared current time.\n    const unsafeEndTime = Date.now() // ?\n\n    // 2. If fetchParams’s request’s destination is \"document\", then set fetchParams’s controller’s\n    //    full timing info to fetchParams’s timing info.\n    if (fetchParams.request.destination === 'document') {\n      fetchParams.controller.fullTimingInfo = timingInfo\n    }\n\n    // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:\n    fetchParams.controller.reportTimingSteps = () => {\n      // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.\n      if (fetchParams.request.url.protocol !== 'https:') {\n        return\n      }\n\n      // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global.\n      timingInfo.endTime = unsafeEndTime\n\n      // 3. Let cacheState be response’s cache state.\n      let cacheState = response.cacheState\n\n      // 4. Let bodyInfo be response’s body info.\n      const bodyInfo = response.bodyInfo\n\n      // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an\n      //    opaque timing info for timingInfo and set cacheState to the empty string.\n      if (!response.timingAllowPassed) {\n        timingInfo = createOpaqueTimingInfo(timingInfo)\n\n        cacheState = ''\n      }\n\n      // 6. Let responseStatus be 0.\n      let responseStatus = 0\n\n      // 7. If fetchParams’s request’s mode is not \"navigate\" or response’s has-cross-origin-redirects is false:\n      if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {\n        // 1. Set responseStatus to response’s status.\n        responseStatus = response.status\n\n        // 2. Let mimeType be the result of extracting a MIME type from response’s header list.\n        const mimeType = extractMimeType(response.headersList)\n\n        // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType.\n        if (mimeType !== 'failure') {\n          bodyInfo.contentType = minimizeSupportedMimeType(mimeType)\n        }\n      }\n\n      // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo,\n      //    fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,\n      //    and responseStatus.\n      if (fetchParams.request.initiatorType != null) {\n        // TODO: update markresourcetiming\n        markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)\n      }\n    }\n\n    // 4. Let processResponseEndOfBodyTask be the following steps:\n    const processResponseEndOfBodyTask = () => {\n      // 1. Set fetchParams’s request’s done flag.\n      fetchParams.request.done = true\n\n      // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process\n      //    response end-of-body given response.\n      if (fetchParams.processResponseEndOfBody != null) {\n        queueMicrotask(() => fetchParams.processResponseEndOfBody(response))\n      }\n\n      // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s\n      //    global object is fetchParams’s task destination, then run fetchParams’s controller’s report\n      //    timing steps given fetchParams’s request’s client’s global object.\n      if (fetchParams.request.initiatorType != null) {\n        fetchParams.controller.reportTimingSteps()\n      }\n    }\n\n    // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination\n    queueMicrotask(() => processResponseEndOfBodyTask())\n  }\n\n  // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s\n  //    process response given response, with fetchParams’s task destination.\n  if (fetchParams.processResponse != null) {\n    queueMicrotask(() => {\n      fetchParams.processResponse(response)\n      fetchParams.processResponse = null\n    })\n  }\n\n  // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.\n  const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)\n\n  // 6. If internalResponse’s body is null, then run processResponseEndOfBody.\n  // 7. Otherwise:\n  if (internalResponse.body == null) {\n    processResponseEndOfBody()\n  } else {\n    // mcollina: all the following steps of the specs are skipped.\n    // The internal transform stream is not needed.\n    // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541\n\n    // 1. Let transformStream be a new TransformStream.\n    // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream.\n    // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm\n    //    set to processResponseEndOfBody.\n    // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.\n\n    finished(internalResponse.body.stream, () => {\n      processResponseEndOfBody()\n    })\n  }\n}\n\n// https://fetch.spec.whatwg.org/#http-fetch\nasync function httpFetch (fetchParams) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let actualResponse be null.\n  let actualResponse = null\n\n  // 4. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 5. If request’s service-workers mode is \"all\", then:\n  if (request.serviceWorkers === 'all') {\n    // TODO\n  }\n\n  // 6. If response is null, then:\n  if (response === null) {\n    // 1. If makeCORSPreflight is true and one of these conditions is true:\n    // TODO\n\n    // 2. If request’s redirect mode is \"follow\", then set request’s\n    // service-workers mode to \"none\".\n    if (request.redirect === 'follow') {\n      request.serviceWorkers = 'none'\n    }\n\n    // 3. Set response and actualResponse to the result of running\n    // HTTP-network-or-cache fetch given fetchParams.\n    actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n    // 4. If request’s response tainting is \"cors\" and a CORS check\n    // for request and response returns failure, then return a network error.\n    if (\n      request.responseTainting === 'cors' &&\n      corsCheck(request, response) === 'failure'\n    ) {\n      return makeNetworkError('cors failure')\n    }\n\n    // 5. If the TAO check for request and response returns failure, then set\n    // request’s timing allow failed flag.\n    if (TAOCheck(request, response) === 'failure') {\n      request.timingAllowFailed = true\n    }\n  }\n\n  // 7. If either request’s response tainting or response’s type\n  // is \"opaque\", and the cross-origin resource policy check with\n  // request’s origin, request’s client, request’s destination,\n  // and actualResponse returns blocked, then return a network error.\n  if (\n    (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n    crossOriginResourcePolicyCheck(\n      request.origin,\n      request.client,\n      request.destination,\n      actualResponse\n    ) === 'blocked'\n  ) {\n    return makeNetworkError('blocked')\n  }\n\n  // 8. If actualResponse’s status is a redirect status, then:\n  if (redirectStatusSet.has(actualResponse.status)) {\n    // 1. If actualResponse’s status is not 303, request’s body is not null,\n    // and the connection uses HTTP/2, then user agents may, and are even\n    // encouraged to, transmit an RST_STREAM frame.\n    // See, https://github.com/whatwg/fetch/issues/1288\n    if (request.redirect !== 'manual') {\n      fetchParams.controller.connection.destroy(undefined, false)\n    }\n\n    // 2. Switch on request’s redirect mode:\n    if (request.redirect === 'error') {\n      // Set response to a network error.\n      response = makeNetworkError('unexpected redirect')\n    } else if (request.redirect === 'manual') {\n      // Set response to an opaque-redirect filtered response whose internal\n      // response is actualResponse.\n      // NOTE(spec): On the web this would return an `opaqueredirect` response,\n      // but that doesn't make sense server side.\n      // See https://github.com/nodejs/undici/issues/1193.\n      response = actualResponse\n    } else if (request.redirect === 'follow') {\n      // Set response to the result of running HTTP-redirect fetch given\n      // fetchParams and response.\n      response = await httpRedirectFetch(fetchParams, response)\n    } else {\n      assert(false)\n    }\n  }\n\n  // 9. Set response’s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 10. Return response.\n  return response\n}\n\n// https://fetch.spec.whatwg.org/#http-redirect-fetch\nfunction httpRedirectFetch (fetchParams, response) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let actualResponse be response, if response is not a filtered response,\n  // and response’s internal response otherwise.\n  const actualResponse = response.internalResponse\n    ? response.internalResponse\n    : response\n\n  // 3. Let locationURL be actualResponse’s location URL given request’s current\n  // URL’s fragment.\n  let locationURL\n\n  try {\n    locationURL = responseLocationURL(\n      actualResponse,\n      requestCurrentURL(request).hash\n    )\n\n    // 4. If locationURL is null, then return response.\n    if (locationURL == null) {\n      return response\n    }\n  } catch (err) {\n    // 5. If locationURL is failure, then return a network error.\n    return Promise.resolve(makeNetworkError(err))\n  }\n\n  // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network\n  // error.\n  if (!urlIsHttpHttpsScheme(locationURL)) {\n    return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))\n  }\n\n  // 7. If request’s redirect count is 20, then return a network error.\n  if (request.redirectCount === 20) {\n    return Promise.resolve(makeNetworkError('redirect count exceeded'))\n  }\n\n  // 8. Increase request’s redirect count by 1.\n  request.redirectCount += 1\n\n  // 9. If request’s mode is \"cors\", locationURL includes credentials, and\n  // request’s origin is not same origin with locationURL’s origin, then return\n  //  a network error.\n  if (\n    request.mode === 'cors' &&\n    (locationURL.username || locationURL.password) &&\n    !sameOrigin(request, locationURL)\n  ) {\n    return Promise.resolve(makeNetworkError('cross origin not allowed for request mode \"cors\"'))\n  }\n\n  // 10. If request’s response tainting is \"cors\" and locationURL includes\n  // credentials, then return a network error.\n  if (\n    request.responseTainting === 'cors' &&\n    (locationURL.username || locationURL.password)\n  ) {\n    return Promise.resolve(makeNetworkError(\n      'URL cannot contain credentials for request mode \"cors\"'\n    ))\n  }\n\n  // 11. If actualResponse’s status is not 303, request’s body is non-null,\n  // and request’s body’s source is null, then return a network error.\n  if (\n    actualResponse.status !== 303 &&\n    request.body != null &&\n    request.body.source == null\n  ) {\n    return Promise.resolve(makeNetworkError())\n  }\n\n  // 12. If one of the following is true\n  // - actualResponse’s status is 301 or 302 and request’s method is `POST`\n  // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`\n  if (\n    ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||\n    (actualResponse.status === 303 &&\n      !GET_OR_HEAD.includes(request.method))\n  ) {\n    // then:\n    // 1. Set request’s method to `GET` and request’s body to null.\n    request.method = 'GET'\n    request.body = null\n\n    // 2. For each headerName of request-body-header name, delete headerName from\n    // request’s header list.\n    for (const headerName of requestBodyHeader) {\n      request.headersList.delete(headerName)\n    }\n  }\n\n  // 13. If request’s current URL’s origin is not same origin with locationURL’s\n  //     origin, then for each headerName of CORS non-wildcard request-header name,\n  //     delete headerName from request’s header list.\n  if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n    // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name\n    request.headersList.delete('authorization', true)\n\n    // https://fetch.spec.whatwg.org/#authentication-entries\n    request.headersList.delete('proxy-authorization', true)\n\n    // \"Cookie\" and \"Host\" are forbidden request-headers, which undici doesn't implement.\n    request.headersList.delete('cookie', true)\n    request.headersList.delete('host', true)\n  }\n\n  // 14. If request’s body is non-null, then set request’s body to the first return\n  // value of safely extracting request’s body’s source.\n  if (request.body != null) {\n    assert(request.body.source != null)\n    request.body = safelyExtractBody(request.body.source)[0]\n  }\n\n  // 15. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 16. Set timingInfo’s redirect end time and post-redirect start time to the\n  // coarsened shared current time given fetchParams’s cross-origin isolated\n  // capability.\n  timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =\n    coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n\n  // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s\n  //  redirect start time to timingInfo’s start time.\n  if (timingInfo.redirectStartTime === 0) {\n    timingInfo.redirectStartTime = timingInfo.startTime\n  }\n\n  // 18. Append locationURL to request’s URL list.\n  request.urlList.push(locationURL)\n\n  // 19. Invoke set request’s referrer policy on redirect on request and\n  // actualResponse.\n  setRequestReferrerPolicyOnRedirect(request, actualResponse)\n\n  // 20. Return the result of running main fetch given fetchParams and true.\n  return mainFetch(fetchParams, true)\n}\n\n// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch\nasync function httpNetworkOrCacheFetch (\n  fetchParams,\n  isAuthenticationFetch = false,\n  isNewConnectionFetch = false\n) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let httpFetchParams be null.\n  let httpFetchParams = null\n\n  // 3. Let httpRequest be null.\n  let httpRequest = null\n\n  // 4. Let response be null.\n  let response = null\n\n  // 5. Let storedResponse be null.\n  // TODO: cache\n\n  // 6. Let httpCache be null.\n  const httpCache = null\n\n  // 7. Let the revalidatingFlag be unset.\n  const revalidatingFlag = false\n\n  // 8. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. If request’s window is \"no-window\" and request’s redirect mode is\n  //    \"error\", then set httpFetchParams to fetchParams and httpRequest to\n  //    request.\n  if (request.window === 'no-window' && request.redirect === 'error') {\n    httpFetchParams = fetchParams\n    httpRequest = request\n  } else {\n    // Otherwise:\n\n    // 1. Set httpRequest to a clone of request.\n    httpRequest = cloneRequest(request)\n\n    // 2. Set httpFetchParams to a copy of fetchParams.\n    httpFetchParams = { ...fetchParams }\n\n    // 3. Set httpFetchParams’s request to httpRequest.\n    httpFetchParams.request = httpRequest\n  }\n\n  //    3. Let includeCredentials be true if one of\n  const includeCredentials =\n    request.credentials === 'include' ||\n    (request.credentials === 'same-origin' &&\n      request.responseTainting === 'basic')\n\n  //    4. Let contentLength be httpRequest’s body’s length, if httpRequest’s\n  //    body is non-null; otherwise null.\n  const contentLength = httpRequest.body ? httpRequest.body.length : null\n\n  //    5. Let contentLengthHeaderValue be null.\n  let contentLengthHeaderValue = null\n\n  //    6. If httpRequest’s body is null and httpRequest’s method is `POST` or\n  //    `PUT`, then set contentLengthHeaderValue to `0`.\n  if (\n    httpRequest.body == null &&\n    ['POST', 'PUT'].includes(httpRequest.method)\n  ) {\n    contentLengthHeaderValue = '0'\n  }\n\n  //    7. If contentLength is non-null, then set contentLengthHeaderValue to\n  //    contentLength, serialized and isomorphic encoded.\n  if (contentLength != null) {\n    contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)\n  }\n\n  //    8. If contentLengthHeaderValue is non-null, then append\n  //    `Content-Length`/contentLengthHeaderValue to httpRequest’s header\n  //    list.\n  if (contentLengthHeaderValue != null) {\n    httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)\n  }\n\n  //    9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,\n  //    contentLengthHeaderValue) to httpRequest’s header list.\n\n  //    10. If contentLength is non-null and httpRequest’s keepalive is true,\n  //    then:\n  if (contentLength != null && httpRequest.keepalive) {\n    // NOTE: keepalive is a noop outside of browser context.\n  }\n\n  //    11. If httpRequest’s referrer is a URL, then append\n  //    `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,\n  //     to httpRequest’s header list.\n  if (httpRequest.referrer instanceof URL) {\n    httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)\n  }\n\n  //    12. Append a request `Origin` header for httpRequest.\n  appendRequestOriginHeader(httpRequest)\n\n  //    13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]\n  appendFetchMetadata(httpRequest)\n\n  //    14. If httpRequest’s header list does not contain `User-Agent`, then\n  //    user agents should append `User-Agent`/default `User-Agent` value to\n  //    httpRequest’s header list.\n  if (!httpRequest.headersList.contains('user-agent', true)) {\n    httpRequest.headersList.append('user-agent', defaultUserAgent)\n  }\n\n  //    15. If httpRequest’s cache mode is \"default\" and httpRequest’s header\n  //    list contains `If-Modified-Since`, `If-None-Match`,\n  //    `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set\n  //    httpRequest’s cache mode to \"no-store\".\n  if (\n    httpRequest.cache === 'default' &&\n    (httpRequest.headersList.contains('if-modified-since', true) ||\n      httpRequest.headersList.contains('if-none-match', true) ||\n      httpRequest.headersList.contains('if-unmodified-since', true) ||\n      httpRequest.headersList.contains('if-match', true) ||\n      httpRequest.headersList.contains('if-range', true))\n  ) {\n    httpRequest.cache = 'no-store'\n  }\n\n  //    16. If httpRequest’s cache mode is \"no-cache\", httpRequest’s prevent\n  //    no-cache cache-control header modification flag is unset, and\n  //    httpRequest’s header list does not contain `Cache-Control`, then append\n  //    `Cache-Control`/`max-age=0` to httpRequest’s header list.\n  if (\n    httpRequest.cache === 'no-cache' &&\n    !httpRequest.preventNoCacheCacheControlHeaderModification &&\n    !httpRequest.headersList.contains('cache-control', true)\n  ) {\n    httpRequest.headersList.append('cache-control', 'max-age=0', true)\n  }\n\n  //    17. If httpRequest’s cache mode is \"no-store\" or \"reload\", then:\n  if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {\n    // 1. If httpRequest’s header list does not contain `Pragma`, then append\n    // `Pragma`/`no-cache` to httpRequest’s header list.\n    if (!httpRequest.headersList.contains('pragma', true)) {\n      httpRequest.headersList.append('pragma', 'no-cache', true)\n    }\n\n    // 2. If httpRequest’s header list does not contain `Cache-Control`,\n    // then append `Cache-Control`/`no-cache` to httpRequest’s header list.\n    if (!httpRequest.headersList.contains('cache-control', true)) {\n      httpRequest.headersList.append('cache-control', 'no-cache', true)\n    }\n  }\n\n  //    18. If httpRequest’s header list contains `Range`, then append\n  //    `Accept-Encoding`/`identity` to httpRequest’s header list.\n  if (httpRequest.headersList.contains('range', true)) {\n    httpRequest.headersList.append('accept-encoding', 'identity', true)\n  }\n\n  //    19. Modify httpRequest’s header list per HTTP. Do not append a given\n  //    header if httpRequest’s header list contains that header’s name.\n  //    TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129\n  if (!httpRequest.headersList.contains('accept-encoding', true)) {\n    if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n      httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)\n    } else {\n      httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)\n    }\n  }\n\n  httpRequest.headersList.delete('host', true)\n\n  //    20. If includeCredentials is true, then:\n  if (includeCredentials) {\n    // 1. If the user agent is not configured to block cookies for httpRequest\n    // (see section 7 of [COOKIES]), then:\n    // TODO: credentials\n    // 2. If httpRequest’s header list does not contain `Authorization`, then:\n    // TODO: credentials\n  }\n\n  //    21. If there’s a proxy-authentication entry, use it as appropriate.\n  //    TODO: proxy-authentication\n\n  //    22. Set httpCache to the result of determining the HTTP cache\n  //    partition, given httpRequest.\n  //    TODO: cache\n\n  //    23. If httpCache is null, then set httpRequest’s cache mode to\n  //    \"no-store\".\n  if (httpCache == null) {\n    httpRequest.cache = 'no-store'\n  }\n\n  //    24. If httpRequest’s cache mode is neither \"no-store\" nor \"reload\",\n  //    then:\n  if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {\n    // TODO: cache\n  }\n\n  // 9. If aborted, then return the appropriate network error for fetchParams.\n  // TODO\n\n  // 10. If response is null, then:\n  if (response == null) {\n    // 1. If httpRequest’s cache mode is \"only-if-cached\", then return a\n    // network error.\n    if (httpRequest.cache === 'only-if-cached') {\n      return makeNetworkError('only if cached')\n    }\n\n    // 2. Let forwardResponse be the result of running HTTP-network fetch\n    // given httpFetchParams, includeCredentials, and isNewConnectionFetch.\n    const forwardResponse = await httpNetworkFetch(\n      httpFetchParams,\n      includeCredentials,\n      isNewConnectionFetch\n    )\n\n    // 3. If httpRequest’s method is unsafe and forwardResponse’s status is\n    // in the range 200 to 399, inclusive, invalidate appropriate stored\n    // responses in httpCache, as per the \"Invalidation\" chapter of HTTP\n    // Caching, and set storedResponse to null. [HTTP-CACHING]\n    if (\n      !safeMethodsSet.has(httpRequest.method) &&\n      forwardResponse.status >= 200 &&\n      forwardResponse.status <= 399\n    ) {\n      // TODO: cache\n    }\n\n    // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,\n    // then:\n    if (revalidatingFlag && forwardResponse.status === 304) {\n      // TODO: cache\n    }\n\n    // 5. If response is null, then:\n    if (response == null) {\n      // 1. Set response to forwardResponse.\n      response = forwardResponse\n\n      // 2. Store httpRequest and forwardResponse in httpCache, as per the\n      // \"Storing Responses in Caches\" chapter of HTTP Caching. [HTTP-CACHING]\n      // TODO: cache\n    }\n  }\n\n  // 11. Set response’s URL list to a clone of httpRequest’s URL list.\n  response.urlList = [...httpRequest.urlList]\n\n  // 12. If httpRequest’s header list contains `Range`, then set response’s\n  // range-requested flag.\n  if (httpRequest.headersList.contains('range', true)) {\n    response.rangeRequested = true\n  }\n\n  // 13. Set response’s request-includes-credentials to includeCredentials.\n  response.requestIncludesCredentials = includeCredentials\n\n  // 14. If response’s status is 401, httpRequest’s response tainting is not\n  // \"cors\", includeCredentials is true, and request’s window is an environment\n  // settings object, then:\n  // TODO\n\n  // 15. If response’s status is 407, then:\n  if (response.status === 407) {\n    // 1. If request’s window is \"no-window\", then return a network error.\n    if (request.window === 'no-window') {\n      return makeNetworkError()\n    }\n\n    // 2. ???\n\n    // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n    if (isCancelled(fetchParams)) {\n      return makeAppropriateNetworkError(fetchParams)\n    }\n\n    // 4. Prompt the end user as appropriate in request’s window and store\n    // the result as a proxy-authentication entry. [HTTP-AUTH]\n    // TODO: Invoke some kind of callback?\n\n    // 5. Set response to the result of running HTTP-network-or-cache fetch given\n    // fetchParams.\n    // TODO\n    return makeNetworkError('proxy authentication required')\n  }\n\n  // 16. If all of the following are true\n  if (\n    // response’s status is 421\n    response.status === 421 &&\n    // isNewConnectionFetch is false\n    !isNewConnectionFetch &&\n    // request’s body is null, or request’s body is non-null and request’s body’s source is non-null\n    (request.body == null || request.body.source != null)\n  ) {\n    // then:\n\n    // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n    if (isCancelled(fetchParams)) {\n      return makeAppropriateNetworkError(fetchParams)\n    }\n\n    // 2. Set response to the result of running HTTP-network-or-cache\n    // fetch given fetchParams, isAuthenticationFetch, and true.\n\n    // TODO (spec): The spec doesn't specify this but we need to cancel\n    // the active response before we can start a new one.\n    // https://github.com/whatwg/fetch/issues/1293\n    fetchParams.controller.connection.destroy()\n\n    response = await httpNetworkOrCacheFetch(\n      fetchParams,\n      isAuthenticationFetch,\n      true\n    )\n  }\n\n  // 17. If isAuthenticationFetch is true, then create an authentication entry\n  if (isAuthenticationFetch) {\n    // TODO\n  }\n\n  // 18. Return response.\n  return response\n}\n\n// https://fetch.spec.whatwg.org/#http-network-fetch\nasync function httpNetworkFetch (\n  fetchParams,\n  includeCredentials = false,\n  forceNewConnection = false\n) {\n  assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)\n\n  fetchParams.controller.connection = {\n    abort: null,\n    destroyed: false,\n    destroy (err, abort = true) {\n      if (!this.destroyed) {\n        this.destroyed = true\n        if (abort) {\n          this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))\n        }\n      }\n    }\n  }\n\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 4. Let httpCache be the result of determining the HTTP cache partition,\n  // given request.\n  // TODO: cache\n  const httpCache = null\n\n  // 5. If httpCache is null, then set request’s cache mode to \"no-store\".\n  if (httpCache == null) {\n    request.cache = 'no-store'\n  }\n\n  // 6. Let networkPartitionKey be the result of determining the network\n  // partition key given request.\n  // TODO\n\n  // 7. Let newConnection be \"yes\" if forceNewConnection is true; otherwise\n  // \"no\".\n  const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars\n\n  // 8. Switch on request’s mode:\n  if (request.mode === 'websocket') {\n    // Let connection be the result of obtaining a WebSocket connection,\n    // given request’s current URL.\n    // TODO\n  } else {\n    // Let connection be the result of obtaining a connection, given\n    // networkPartitionKey, request’s current URL’s origin,\n    // includeCredentials, and forceNewConnection.\n    // TODO\n  }\n\n  // 9. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. If connection is failure, then return a network error.\n\n  //    2. Set timingInfo’s final connection timing info to the result of\n  //    calling clamp and coarsen connection timing info with connection’s\n  //    timing info, timingInfo’s post-redirect start time, and fetchParams’s\n  //    cross-origin isolated capability.\n\n  //    3. If connection is not an HTTP/2 connection, request’s body is non-null,\n  //    and request’s body’s source is null, then append (`Transfer-Encoding`,\n  //    `chunked`) to request’s header list.\n\n  //    4. Set timingInfo’s final network-request start time to the coarsened\n  //    shared current time given fetchParams’s cross-origin isolated\n  //    capability.\n\n  //    5. Set response to the result of making an HTTP request over connection\n  //    using request with the following caveats:\n\n  //        - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]\n  //        [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]\n\n  //        - If request’s body is non-null, and request’s body’s source is null,\n  //        then the user agent may have a buffer of up to 64 kibibytes and store\n  //        a part of request’s body in that buffer. If the user agent reads from\n  //        request’s body beyond that buffer’s size and the user agent needs to\n  //        resend request, then instead return a network error.\n\n  //        - Set timingInfo’s final network-response start time to the coarsened\n  //        shared current time given fetchParams’s cross-origin isolated capability,\n  //        immediately after the user agent’s HTTP parser receives the first byte\n  //        of the response (e.g., frame header bytes for HTTP/2 or response status\n  //        line for HTTP/1.x).\n\n  //        - Wait until all the headers are transmitted.\n\n  //        - Any responses whose status is in the range 100 to 199, inclusive,\n  //        and is not 101, are to be ignored, except for the purposes of setting\n  //        timingInfo’s final network-response start time above.\n\n  //    - If request’s header list contains `Transfer-Encoding`/`chunked` and\n  //    response is transferred via HTTP/1.0 or older, then return a network\n  //    error.\n\n  //    - If the HTTP request results in a TLS client certificate dialog, then:\n\n  //        1. If request’s window is an environment settings object, make the\n  //        dialog available in request’s window.\n\n  //        2. Otherwise, return a network error.\n\n  // To transmit request’s body body, run these steps:\n  let requestBody = null\n  // 1. If body is null and fetchParams’s process request end-of-body is\n  // non-null, then queue a fetch task given fetchParams’s process request\n  // end-of-body and fetchParams’s task destination.\n  if (request.body == null && fetchParams.processRequestEndOfBody) {\n    queueMicrotask(() => fetchParams.processRequestEndOfBody())\n  } else if (request.body != null) {\n    // 2. Otherwise, if body is non-null:\n\n    //    1. Let processBodyChunk given bytes be these steps:\n    const processBodyChunk = async function * (bytes) {\n      // 1. If the ongoing fetch is terminated, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. Run this step in parallel: transmit bytes.\n      yield bytes\n\n      // 3. If fetchParams’s process request body is non-null, then run\n      // fetchParams’s process request body given bytes’s length.\n      fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)\n    }\n\n    // 2. Let processEndOfBody be these steps:\n    const processEndOfBody = () => {\n      // 1. If fetchParams is canceled, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. If fetchParams’s process request end-of-body is non-null,\n      // then run fetchParams’s process request end-of-body.\n      if (fetchParams.processRequestEndOfBody) {\n        fetchParams.processRequestEndOfBody()\n      }\n    }\n\n    // 3. Let processBodyError given e be these steps:\n    const processBodyError = (e) => {\n      // 1. If fetchParams is canceled, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. If e is an \"AbortError\" DOMException, then abort fetchParams’s controller.\n      if (e.name === 'AbortError') {\n        fetchParams.controller.abort()\n      } else {\n        fetchParams.controller.terminate(e)\n      }\n    }\n\n    // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,\n    // processBodyError, and fetchParams’s task destination.\n    requestBody = (async function * () {\n      try {\n        for await (const bytes of request.body.stream) {\n          yield * processBodyChunk(bytes)\n        }\n        processEndOfBody()\n      } catch (err) {\n        processBodyError(err)\n      }\n    })()\n  }\n\n  try {\n    // socket is only provided for websockets\n    const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })\n\n    if (socket) {\n      response = makeResponse({ status, statusText, headersList, socket })\n    } else {\n      const iterator = body[Symbol.asyncIterator]()\n      fetchParams.controller.next = () => iterator.next()\n\n      response = makeResponse({ status, statusText, headersList })\n    }\n  } catch (err) {\n    // 10. If aborted, then:\n    if (err.name === 'AbortError') {\n      // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n      fetchParams.controller.connection.destroy()\n\n      // 2. Return the appropriate network error for fetchParams.\n      return makeAppropriateNetworkError(fetchParams, err)\n    }\n\n    return makeNetworkError(err)\n  }\n\n  // 11. Let pullAlgorithm be an action that resumes the ongoing fetch\n  // if it is suspended.\n  const pullAlgorithm = async () => {\n    await fetchParams.controller.resume()\n  }\n\n  // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s\n  // controller with reason, given reason.\n  const cancelAlgorithm = (reason) => {\n    // If the aborted fetch was already terminated, then we do not\n    // need to do anything.\n    if (!isCancelled(fetchParams)) {\n      fetchParams.controller.abort(reason)\n    }\n  }\n\n  // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by\n  // the user agent.\n  // TODO\n\n  // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object\n  // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.\n  // TODO\n\n  // 15. Let stream be a new ReadableStream.\n  // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm,\n  //     cancelAlgorithm set to cancelAlgorithm.\n  const stream = new ReadableStream(\n    {\n      async start (controller) {\n        fetchParams.controller.controller = controller\n      },\n      async pull (controller) {\n        await pullAlgorithm(controller)\n      },\n      async cancel (reason) {\n        await cancelAlgorithm(reason)\n      },\n      type: 'bytes'\n    }\n  )\n\n  // 17. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. Set response’s body to a new body whose stream is stream.\n  response.body = { stream, source: null, length: null }\n\n  //    2. If response is not a network error and request’s cache mode is\n  //    not \"no-store\", then update response in httpCache for request.\n  //    TODO\n\n  //    3. If includeCredentials is true and the user agent is not configured\n  //    to block cookies for request (see section 7 of [COOKIES]), then run the\n  //    \"set-cookie-string\" parsing algorithm (see section 5.2 of [COOKIES]) on\n  //    the value of each header whose name is a byte-case-insensitive match for\n  //    `Set-Cookie` in response’s header list, if any, and request’s current URL.\n  //    TODO\n\n  // 18. If aborted, then:\n  // TODO\n\n  // 19. Run these steps in parallel:\n\n  //    1. Run these steps, but abort when fetchParams is canceled:\n  fetchParams.controller.onAborted = onAborted\n  fetchParams.controller.on('terminated', onAborted)\n  fetchParams.controller.resume = async () => {\n    // 1. While true\n    while (true) {\n      // 1-3. See onData...\n\n      // 4. Set bytes to the result of handling content codings given\n      // codings and bytes.\n      let bytes\n      let isFailure\n      try {\n        const { done, value } = await fetchParams.controller.next()\n\n        if (isAborted(fetchParams)) {\n          break\n        }\n\n        bytes = done ? undefined : value\n      } catch (err) {\n        if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n          // zlib doesn't like empty streams.\n          bytes = undefined\n        } else {\n          bytes = err\n\n          // err may be propagated from the result of calling readablestream.cancel,\n          // which might not be an error. https://github.com/nodejs/undici/issues/2009\n          isFailure = true\n        }\n      }\n\n      if (bytes === undefined) {\n        // 2. Otherwise, if the bytes transmission for response’s message\n        // body is done normally and stream is readable, then close\n        // stream, finalize response for fetchParams and response, and\n        // abort these in-parallel steps.\n        readableStreamClose(fetchParams.controller.controller)\n\n        finalizeResponse(fetchParams, response)\n\n        return\n      }\n\n      // 5. Increase timingInfo’s decoded body size by bytes’s length.\n      timingInfo.decodedBodySize += bytes?.byteLength ?? 0\n\n      // 6. If bytes is failure, then terminate fetchParams’s controller.\n      if (isFailure) {\n        fetchParams.controller.terminate(bytes)\n        return\n      }\n\n      // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes\n      // into stream.\n      const buffer = new Uint8Array(bytes)\n      if (buffer.byteLength) {\n        fetchParams.controller.controller.enqueue(buffer)\n      }\n\n      // 8. If stream is errored, then terminate the ongoing fetch.\n      if (isErrored(stream)) {\n        fetchParams.controller.terminate()\n        return\n      }\n\n      // 9. If stream doesn’t need more data ask the user agent to suspend\n      // the ongoing fetch.\n      if (fetchParams.controller.controller.desiredSize <= 0) {\n        return\n      }\n    }\n  }\n\n  //    2. If aborted, then:\n  function onAborted (reason) {\n    // 2. If fetchParams is aborted, then:\n    if (isAborted(fetchParams)) {\n      // 1. Set response’s aborted flag.\n      response.aborted = true\n\n      // 2. If stream is readable, then error stream with the result of\n      //    deserialize a serialized abort reason given fetchParams’s\n      //    controller’s serialized abort reason and an\n      //    implementation-defined realm.\n      if (isReadable(stream)) {\n        fetchParams.controller.controller.error(\n          fetchParams.controller.serializedAbortReason\n        )\n      }\n    } else {\n      // 3. Otherwise, if stream is readable, error stream with a TypeError.\n      if (isReadable(stream)) {\n        fetchParams.controller.controller.error(new TypeError('terminated', {\n          cause: isErrorLike(reason) ? reason : undefined\n        }))\n      }\n    }\n\n    // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n    // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.\n    fetchParams.controller.connection.destroy()\n  }\n\n  // 20. Return response.\n  return response\n\n  function dispatch ({ body }) {\n    const url = requestCurrentURL(request)\n    /** @type {import('../..').Agent} */\n    const agent = fetchParams.controller.dispatcher\n\n    return new Promise((resolve, reject) => agent.dispatch(\n      {\n        path: url.pathname + url.search,\n        origin: url.origin,\n        method: request.method,\n        body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,\n        headers: request.headersList.entries,\n        maxRedirections: 0,\n        upgrade: request.mode === 'websocket' ? 'websocket' : undefined\n      },\n      {\n        body: null,\n        abort: null,\n\n        onConnect (abort) {\n          // TODO (fix): Do we need connection here?\n          const { connection } = fetchParams.controller\n\n          // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen\n          // connection timing info with connection’s timing info, timingInfo’s post-redirect start\n          // time, and fetchParams’s cross-origin isolated capability.\n          // TODO: implement connection timing\n          timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)\n\n          if (connection.destroyed) {\n            abort(new DOMException('The operation was aborted.', 'AbortError'))\n          } else {\n            fetchParams.controller.on('terminated', abort)\n            this.abort = connection.abort = abort\n          }\n\n          // Set timingInfo’s final network-request start time to the coarsened shared current time given\n          // fetchParams’s cross-origin isolated capability.\n          timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n        },\n\n        onResponseStarted () {\n          // Set timingInfo’s final network-response start time to the coarsened shared current\n          // time given fetchParams’s cross-origin isolated capability, immediately after the\n          // user agent’s HTTP parser receives the first byte of the response (e.g., frame header\n          // bytes for HTTP/2 or response status line for HTTP/1.x).\n          timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n        },\n\n        onHeaders (status, rawHeaders, resume, statusText) {\n          if (status < 200) {\n            return\n          }\n\n          let location = ''\n\n          const headersList = new HeadersList()\n\n          for (let i = 0; i < rawHeaders.length; i += 2) {\n            headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n          }\n          location = headersList.get('location', true)\n\n          this.body = new Readable({ read: resume })\n\n          const decoders = []\n\n          const willFollow = location && request.redirect === 'follow' &&\n            redirectStatusSet.has(status)\n\n          // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding\n          if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {\n            // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n            const contentEncoding = headersList.get('content-encoding', true)\n            // \"All content-coding values are case-insensitive...\"\n            /** @type {string[]} */\n            const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []\n\n            // Limit the number of content-encodings to prevent resource exhaustion.\n            // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).\n            const maxContentEncodings = 5\n            if (codings.length > maxContentEncodings) {\n              reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))\n              return true\n            }\n\n            for (let i = codings.length - 1; i >= 0; --i) {\n              const coding = codings[i].trim()\n              // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2\n              if (coding === 'x-gzip' || coding === 'gzip') {\n                decoders.push(zlib.createGunzip({\n                  // Be less strict when decoding compressed responses, since sometimes\n                  // servers send slightly invalid responses that are still accepted\n                  // by common browsers.\n                  // Always using Z_SYNC_FLUSH is what cURL does.\n                  flush: zlib.constants.Z_SYNC_FLUSH,\n                  finishFlush: zlib.constants.Z_SYNC_FLUSH\n                }))\n              } else if (coding === 'deflate') {\n                decoders.push(createInflate({\n                  flush: zlib.constants.Z_SYNC_FLUSH,\n                  finishFlush: zlib.constants.Z_SYNC_FLUSH\n                }))\n              } else if (coding === 'br') {\n                decoders.push(zlib.createBrotliDecompress({\n                  flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n                  finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n                }))\n              } else {\n                decoders.length = 0\n                break\n              }\n            }\n          }\n\n          const onError = this.onError.bind(this)\n\n          resolve({\n            status,\n            statusText,\n            headersList,\n            body: decoders.length\n              ? pipeline(this.body, ...decoders, (err) => {\n                if (err) {\n                  this.onError(err)\n                }\n              }).on('error', onError)\n              : this.body.on('error', onError)\n          })\n\n          return true\n        },\n\n        onData (chunk) {\n          if (fetchParams.controller.dump) {\n            return\n          }\n\n          // 1. If one or more bytes have been transmitted from response’s\n          // message body, then:\n\n          //  1. Let bytes be the transmitted bytes.\n          const bytes = chunk\n\n          //  2. Let codings be the result of extracting header list values\n          //  given `Content-Encoding` and response’s header list.\n          //  See pullAlgorithm.\n\n          //  3. Increase timingInfo’s encoded body size by bytes’s length.\n          timingInfo.encodedBodySize += bytes.byteLength\n\n          //  4. See pullAlgorithm...\n\n          return this.body.push(bytes)\n        },\n\n        onComplete () {\n          if (this.abort) {\n            fetchParams.controller.off('terminated', this.abort)\n          }\n\n          if (fetchParams.controller.onAborted) {\n            fetchParams.controller.off('terminated', fetchParams.controller.onAborted)\n          }\n\n          fetchParams.controller.ended = true\n\n          this.body.push(null)\n        },\n\n        onError (error) {\n          if (this.abort) {\n            fetchParams.controller.off('terminated', this.abort)\n          }\n\n          this.body?.destroy(error)\n\n          fetchParams.controller.terminate(error)\n\n          reject(error)\n        },\n\n        onUpgrade (status, rawHeaders, socket) {\n          if (status !== 101) {\n            return\n          }\n\n          const headersList = new HeadersList()\n\n          for (let i = 0; i < rawHeaders.length; i += 2) {\n            headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n          }\n\n          resolve({\n            status,\n            statusText: STATUS_CODES[status],\n            headersList,\n            socket\n          })\n\n          return true\n        }\n      }\n    ))\n  }\n}\n\nmodule.exports = {\n  fetch,\n  Fetch,\n  fetching,\n  finalizeAndReportTiming\n}\n","/* globals AbortController */\n\n'use strict'\n\nconst { extractBody, mixinBody, cloneBody, bodyUnusable } = require('./body')\nconst { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require('./headers')\nconst { FinalizationRegistry } = require('./dispatcher-weakref')()\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst {\n  isValidHTTPToken,\n  sameOrigin,\n  environmentSettingsObject\n} = require('./util')\nconst {\n  forbiddenMethodsSet,\n  corsSafeListedMethodsSet,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  requestDuplex\n} = require('./constants')\nconst { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util\nconst { kHeaders, kSignal, kState, kDispatcher } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('node:events')\n\nconst kAbortController = Symbol('abortController')\n\nconst requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n  signal.removeEventListener('abort', abort)\n})\n\nconst dependentControllerMap = new WeakMap()\n\nfunction buildAbort (acRef) {\n  return abort\n\n  function abort () {\n    const ac = acRef.deref()\n    if (ac !== undefined) {\n      // Currently, there is a problem with FinalizationRegistry.\n      // https://github.com/nodejs/node/issues/49344\n      // https://github.com/nodejs/node/issues/47748\n      // In the case of abort, the first step is to unregister from it.\n      // If the controller can refer to it, it is still registered.\n      // It will be removed in the future.\n      requestFinalizer.unregister(abort)\n\n      // Unsubscribe a listener.\n      // FinalizationRegistry will no longer be called, so this must be done.\n      this.removeEventListener('abort', abort)\n\n      ac.abort(this.reason)\n\n      const controllerList = dependentControllerMap.get(ac.signal)\n\n      if (controllerList !== undefined) {\n        if (controllerList.size !== 0) {\n          for (const ref of controllerList) {\n            const ctrl = ref.deref()\n            if (ctrl !== undefined) {\n              ctrl.abort(this.reason)\n            }\n          }\n          controllerList.clear()\n        }\n        dependentControllerMap.delete(ac.signal)\n      }\n    }\n  }\n}\n\nlet patchMethodWarning = false\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request {\n  // https://fetch.spec.whatwg.org/#dom-request\n  constructor (input, init = {}) {\n    webidl.util.markAsUncloneable(this)\n    if (input === kConstruct) {\n      return\n    }\n\n    const prefix = 'Request constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    input = webidl.converters.RequestInfo(input, prefix, 'input')\n    init = webidl.converters.RequestInit(init, prefix, 'init')\n\n    // 1. Let request be null.\n    let request = null\n\n    // 2. Let fallbackMode be null.\n    let fallbackMode = null\n\n    // 3. Let baseURL be this’s relevant settings object’s API base URL.\n    const baseUrl = environmentSettingsObject.settingsObject.baseUrl\n\n    // 4. Let signal be null.\n    let signal = null\n\n    // 5. If input is a string, then:\n    if (typeof input === 'string') {\n      this[kDispatcher] = init.dispatcher\n\n      // 1. Let parsedURL be the result of parsing input with baseURL.\n      // 2. If parsedURL is failure, then throw a TypeError.\n      let parsedURL\n      try {\n        parsedURL = new URL(input, baseUrl)\n      } catch (err) {\n        throw new TypeError('Failed to parse URL from ' + input, { cause: err })\n      }\n\n      // 3. If parsedURL includes credentials, then throw a TypeError.\n      if (parsedURL.username || parsedURL.password) {\n        throw new TypeError(\n          'Request cannot be constructed from a URL that includes credentials: ' +\n            input\n        )\n      }\n\n      // 4. Set request to a new request whose URL is parsedURL.\n      request = makeRequest({ urlList: [parsedURL] })\n\n      // 5. Set fallbackMode to \"cors\".\n      fallbackMode = 'cors'\n    } else {\n      this[kDispatcher] = init.dispatcher || input[kDispatcher]\n\n      // 6. Otherwise:\n\n      // 7. Assert: input is a Request object.\n      assert(input instanceof Request)\n\n      // 8. Set request to input’s request.\n      request = input[kState]\n\n      // 9. Set signal to input’s signal.\n      signal = input[kSignal]\n    }\n\n    // 7. Let origin be this’s relevant settings object’s origin.\n    const origin = environmentSettingsObject.settingsObject.origin\n\n    // 8. Let window be \"client\".\n    let window = 'client'\n\n    // 9. If request’s window is an environment settings object and its origin\n    // is same origin with origin, then set window to request’s window.\n    if (\n      request.window?.constructor?.name === 'EnvironmentSettingsObject' &&\n      sameOrigin(request.window, origin)\n    ) {\n      window = request.window\n    }\n\n    // 10. If init[\"window\"] exists and is non-null, then throw a TypeError.\n    if (init.window != null) {\n      throw new TypeError(`'window' option '${window}' must be null`)\n    }\n\n    // 11. If init[\"window\"] exists, then set window to \"no-window\".\n    if ('window' in init) {\n      window = 'no-window'\n    }\n\n    // 12. Set request to a new request with the following properties:\n    request = makeRequest({\n      // URL request’s URL.\n      // undici implementation note: this is set as the first item in request's urlList in makeRequest\n      // method request’s method.\n      method: request.method,\n      // header list A copy of request’s header list.\n      // undici implementation note: headersList is cloned in makeRequest\n      headersList: request.headersList,\n      // unsafe-request flag Set.\n      unsafeRequest: request.unsafeRequest,\n      // client This’s relevant settings object.\n      client: environmentSettingsObject.settingsObject,\n      // window window.\n      window,\n      // priority request’s priority.\n      priority: request.priority,\n      // origin request’s origin. The propagation of the origin is only significant for navigation requests\n      // being handled by a service worker. In this scenario a request can have an origin that is different\n      // from the current client.\n      origin: request.origin,\n      // referrer request’s referrer.\n      referrer: request.referrer,\n      // referrer policy request’s referrer policy.\n      referrerPolicy: request.referrerPolicy,\n      // mode request’s mode.\n      mode: request.mode,\n      // credentials mode request’s credentials mode.\n      credentials: request.credentials,\n      // cache mode request’s cache mode.\n      cache: request.cache,\n      // redirect mode request’s redirect mode.\n      redirect: request.redirect,\n      // integrity metadata request’s integrity metadata.\n      integrity: request.integrity,\n      // keepalive request’s keepalive.\n      keepalive: request.keepalive,\n      // reload-navigation flag request’s reload-navigation flag.\n      reloadNavigation: request.reloadNavigation,\n      // history-navigation flag request’s history-navigation flag.\n      historyNavigation: request.historyNavigation,\n      // URL list A clone of request’s URL list.\n      urlList: [...request.urlList]\n    })\n\n    const initHasKey = Object.keys(init).length !== 0\n\n    // 13. If init is not empty, then:\n    if (initHasKey) {\n      // 1. If request’s mode is \"navigate\", then set it to \"same-origin\".\n      if (request.mode === 'navigate') {\n        request.mode = 'same-origin'\n      }\n\n      // 2. Unset request’s reload-navigation flag.\n      request.reloadNavigation = false\n\n      // 3. Unset request’s history-navigation flag.\n      request.historyNavigation = false\n\n      // 4. Set request’s origin to \"client\".\n      request.origin = 'client'\n\n      // 5. Set request’s referrer to \"client\"\n      request.referrer = 'client'\n\n      // 6. Set request’s referrer policy to the empty string.\n      request.referrerPolicy = ''\n\n      // 7. Set request’s URL to request’s current URL.\n      request.url = request.urlList[request.urlList.length - 1]\n\n      // 8. Set request’s URL list to « request’s URL ».\n      request.urlList = [request.url]\n    }\n\n    // 14. If init[\"referrer\"] exists, then:\n    if (init.referrer !== undefined) {\n      // 1. Let referrer be init[\"referrer\"].\n      const referrer = init.referrer\n\n      // 2. If referrer is the empty string, then set request’s referrer to \"no-referrer\".\n      if (referrer === '') {\n        request.referrer = 'no-referrer'\n      } else {\n        // 1. Let parsedReferrer be the result of parsing referrer with\n        // baseURL.\n        // 2. If parsedReferrer is failure, then throw a TypeError.\n        let parsedReferrer\n        try {\n          parsedReferrer = new URL(referrer, baseUrl)\n        } catch (err) {\n          throw new TypeError(`Referrer \"${referrer}\" is not a valid URL.`, { cause: err })\n        }\n\n        // 3. If one of the following is true\n        // - parsedReferrer’s scheme is \"about\" and path is the string \"client\"\n        // - parsedReferrer’s origin is not same origin with origin\n        // then set request’s referrer to \"client\".\n        if (\n          (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||\n          (origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl))\n        ) {\n          request.referrer = 'client'\n        } else {\n          // 4. Otherwise, set request’s referrer to parsedReferrer.\n          request.referrer = parsedReferrer\n        }\n      }\n    }\n\n    // 15. If init[\"referrerPolicy\"] exists, then set request’s referrer policy\n    // to it.\n    if (init.referrerPolicy !== undefined) {\n      request.referrerPolicy = init.referrerPolicy\n    }\n\n    // 16. Let mode be init[\"mode\"] if it exists, and fallbackMode otherwise.\n    let mode\n    if (init.mode !== undefined) {\n      mode = init.mode\n    } else {\n      mode = fallbackMode\n    }\n\n    // 17. If mode is \"navigate\", then throw a TypeError.\n    if (mode === 'navigate') {\n      throw webidl.errors.exception({\n        header: 'Request constructor',\n        message: 'invalid request mode navigate.'\n      })\n    }\n\n    // 18. If mode is non-null, set request’s mode to mode.\n    if (mode != null) {\n      request.mode = mode\n    }\n\n    // 19. If init[\"credentials\"] exists, then set request’s credentials mode\n    // to it.\n    if (init.credentials !== undefined) {\n      request.credentials = init.credentials\n    }\n\n    // 18. If init[\"cache\"] exists, then set request’s cache mode to it.\n    if (init.cache !== undefined) {\n      request.cache = init.cache\n    }\n\n    // 21. If request’s cache mode is \"only-if-cached\" and request’s mode is\n    // not \"same-origin\", then throw a TypeError.\n    if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {\n      throw new TypeError(\n        \"'only-if-cached' can be set only with 'same-origin' mode\"\n      )\n    }\n\n    // 22. If init[\"redirect\"] exists, then set request’s redirect mode to it.\n    if (init.redirect !== undefined) {\n      request.redirect = init.redirect\n    }\n\n    // 23. If init[\"integrity\"] exists, then set request’s integrity metadata to it.\n    if (init.integrity != null) {\n      request.integrity = String(init.integrity)\n    }\n\n    // 24. If init[\"keepalive\"] exists, then set request’s keepalive to it.\n    if (init.keepalive !== undefined) {\n      request.keepalive = Boolean(init.keepalive)\n    }\n\n    // 25. If init[\"method\"] exists, then:\n    if (init.method !== undefined) {\n      // 1. Let method be init[\"method\"].\n      let method = init.method\n\n      const mayBeNormalized = normalizedMethodRecords[method]\n\n      if (mayBeNormalized !== undefined) {\n        // Note: Bypass validation DELETE, GET, HEAD, OPTIONS, POST, PUT, PATCH and these lowercase ones\n        request.method = mayBeNormalized\n      } else {\n        // 2. If method is not a method or method is a forbidden method, then\n        // throw a TypeError.\n        if (!isValidHTTPToken(method)) {\n          throw new TypeError(`'${method}' is not a valid HTTP method.`)\n        }\n\n        const upperCase = method.toUpperCase()\n\n        if (forbiddenMethodsSet.has(upperCase)) {\n          throw new TypeError(`'${method}' HTTP method is unsupported.`)\n        }\n\n        // 3. Normalize method.\n        // https://fetch.spec.whatwg.org/#concept-method-normalize\n        // Note: must be in uppercase\n        method = normalizedMethodRecordsBase[upperCase] ?? method\n\n        // 4. Set request’s method to method.\n        request.method = method\n      }\n\n      if (!patchMethodWarning && request.method === 'patch') {\n        process.emitWarning('Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.', {\n          code: 'UNDICI-FETCH-patch'\n        })\n\n        patchMethodWarning = true\n      }\n    }\n\n    // 26. If init[\"signal\"] exists, then set signal to it.\n    if (init.signal !== undefined) {\n      signal = init.signal\n    }\n\n    // 27. Set this’s request to request.\n    this[kState] = request\n\n    // 28. Set this’s signal to a new AbortSignal object with this’s relevant\n    // Realm.\n    // TODO: could this be simplified with AbortSignal.any\n    // (https://dom.spec.whatwg.org/#dom-abortsignal-any)\n    const ac = new AbortController()\n    this[kSignal] = ac.signal\n\n    // 29. If signal is not null, then make this’s signal follow signal.\n    if (signal != null) {\n      if (\n        !signal ||\n        typeof signal.aborted !== 'boolean' ||\n        typeof signal.addEventListener !== 'function'\n      ) {\n        throw new TypeError(\n          \"Failed to construct 'Request': member signal is not of type AbortSignal.\"\n        )\n      }\n\n      if (signal.aborted) {\n        ac.abort(signal.reason)\n      } else {\n        // Keep a strong ref to ac while request object\n        // is alive. This is needed to prevent AbortController\n        // from being prematurely garbage collected.\n        // See, https://github.com/nodejs/undici/issues/1926.\n        this[kAbortController] = ac\n\n        const acRef = new WeakRef(ac)\n        const abort = buildAbort(acRef)\n\n        // Third-party AbortControllers may not work with these.\n        // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.\n        try {\n          // If the max amount of listeners is equal to the default, increase it\n          // This is only available in node >= v19.9.0\n          if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {\n            setMaxListeners(1500, signal)\n          } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {\n            setMaxListeners(1500, signal)\n          }\n        } catch {}\n\n        util.addAbortListener(signal, abort)\n        // The third argument must be a registry key to be unregistered.\n        // Without it, you cannot unregister.\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n        // abort is used as the unregister key. (because it is unique)\n        requestFinalizer.register(ac, { signal, abort }, abort)\n      }\n    }\n\n    // 30. Set this’s headers to a new Headers object with this’s relevant\n    // Realm, whose header list is request’s header list and guard is\n    // \"request\".\n    this[kHeaders] = new Headers(kConstruct)\n    setHeadersList(this[kHeaders], request.headersList)\n    setHeadersGuard(this[kHeaders], 'request')\n\n    // 31. If this’s request’s mode is \"no-cors\", then:\n    if (mode === 'no-cors') {\n      // 1. If this’s request’s method is not a CORS-safelisted method,\n      // then throw a TypeError.\n      if (!corsSafeListedMethodsSet.has(request.method)) {\n        throw new TypeError(\n          `'${request.method} is unsupported in no-cors mode.`\n        )\n      }\n\n      // 2. Set this’s headers’s guard to \"request-no-cors\".\n      setHeadersGuard(this[kHeaders], 'request-no-cors')\n    }\n\n    // 32. If init is not empty, then:\n    if (initHasKey) {\n      /** @type {HeadersList} */\n      const headersList = getHeadersList(this[kHeaders])\n      // 1. Let headers be a copy of this’s headers and its associated header\n      // list.\n      // 2. If init[\"headers\"] exists, then set headers to init[\"headers\"].\n      const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)\n\n      // 3. Empty this’s headers’s header list.\n      headersList.clear()\n\n      // 4. If headers is a Headers object, then for each header in its header\n      // list, append header’s name/header’s value to this’s headers.\n      if (headers instanceof HeadersList) {\n        for (const { name, value } of headers.rawValues()) {\n          headersList.append(name, value, false)\n        }\n        // Note: Copy the `set-cookie` meta-data.\n        headersList.cookies = headers.cookies\n      } else {\n        // 5. Otherwise, fill this’s headers with headers.\n        fillHeaders(this[kHeaders], headers)\n      }\n    }\n\n    // 33. Let inputBody be input’s request’s body if input is a Request\n    // object; otherwise null.\n    const inputBody = input instanceof Request ? input[kState].body : null\n\n    // 34. If either init[\"body\"] exists and is non-null or inputBody is\n    // non-null, and request’s method is `GET` or `HEAD`, then throw a\n    // TypeError.\n    if (\n      (init.body != null || inputBody != null) &&\n      (request.method === 'GET' || request.method === 'HEAD')\n    ) {\n      throw new TypeError('Request with GET/HEAD method cannot have body.')\n    }\n\n    // 35. Let initBody be null.\n    let initBody = null\n\n    // 36. If init[\"body\"] exists and is non-null, then:\n    if (init.body != null) {\n      // 1. Let Content-Type be null.\n      // 2. Set initBody and Content-Type to the result of extracting\n      // init[\"body\"], with keepalive set to request’s keepalive.\n      const [extractedBody, contentType] = extractBody(\n        init.body,\n        request.keepalive\n      )\n      initBody = extractedBody\n\n      // 3, If Content-Type is non-null and this’s headers’s header list does\n      // not contain `Content-Type`, then append `Content-Type`/Content-Type to\n      // this’s headers.\n      if (contentType && !getHeadersList(this[kHeaders]).contains('content-type', true)) {\n        this[kHeaders].append('content-type', contentType)\n      }\n    }\n\n    // 37. Let inputOrInitBody be initBody if it is non-null; otherwise\n    // inputBody.\n    const inputOrInitBody = initBody ?? inputBody\n\n    // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is\n    // null, then:\n    if (inputOrInitBody != null && inputOrInitBody.source == null) {\n      // 1. If initBody is non-null and init[\"duplex\"] does not exist,\n      //    then throw a TypeError.\n      if (initBody != null && init.duplex == null) {\n        throw new TypeError('RequestInit: duplex option is required when sending a body.')\n      }\n\n      // 2. If this’s request’s mode is neither \"same-origin\" nor \"cors\",\n      // then throw a TypeError.\n      if (request.mode !== 'same-origin' && request.mode !== 'cors') {\n        throw new TypeError(\n          'If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"'\n        )\n      }\n\n      // 3. Set this’s request’s use-CORS-preflight flag.\n      request.useCORSPreflightFlag = true\n    }\n\n    // 39. Let finalBody be inputOrInitBody.\n    let finalBody = inputOrInitBody\n\n    // 40. If initBody is null and inputBody is non-null, then:\n    if (initBody == null && inputBody != null) {\n      // 1. If input is unusable, then throw a TypeError.\n      if (bodyUnusable(input)) {\n        throw new TypeError(\n          'Cannot construct a Request with a Request object that has already been used.'\n        )\n      }\n\n      // 2. Set finalBody to the result of creating a proxy for inputBody.\n      // https://streams.spec.whatwg.org/#readablestream-create-a-proxy\n      const identityTransform = new TransformStream()\n      inputBody.stream.pipeThrough(identityTransform)\n      finalBody = {\n        source: inputBody.source,\n        length: inputBody.length,\n        stream: identityTransform.readable\n      }\n    }\n\n    // 41. Set this’s request’s body to finalBody.\n    this[kState].body = finalBody\n  }\n\n  // Returns request’s HTTP method, which is \"GET\" by default.\n  get method () {\n    webidl.brandCheck(this, Request)\n\n    // The method getter steps are to return this’s request’s method.\n    return this[kState].method\n  }\n\n  // Returns the URL of request as a string.\n  get url () {\n    webidl.brandCheck(this, Request)\n\n    // The url getter steps are to return this’s request’s URL, serialized.\n    return URLSerializer(this[kState].url)\n  }\n\n  // Returns a Headers object consisting of the headers associated with request.\n  // Note that headers added in the network layer by the user agent will not\n  // be accounted for in this object, e.g., the \"Host\" header.\n  get headers () {\n    webidl.brandCheck(this, Request)\n\n    // The headers getter steps are to return this’s headers.\n    return this[kHeaders]\n  }\n\n  // Returns the kind of resource requested by request, e.g., \"document\"\n  // or \"script\".\n  get destination () {\n    webidl.brandCheck(this, Request)\n\n    // The destination getter are to return this’s request’s destination.\n    return this[kState].destination\n  }\n\n  // Returns the referrer of request. Its value can be a same-origin URL if\n  // explicitly set in init, the empty string to indicate no referrer, and\n  // \"about:client\" when defaulting to the global’s default. This is used\n  // during fetching to determine the value of the `Referer` header of the\n  // request being made.\n  get referrer () {\n    webidl.brandCheck(this, Request)\n\n    // 1. If this’s request’s referrer is \"no-referrer\", then return the\n    // empty string.\n    if (this[kState].referrer === 'no-referrer') {\n      return ''\n    }\n\n    // 2. If this’s request’s referrer is \"client\", then return\n    // \"about:client\".\n    if (this[kState].referrer === 'client') {\n      return 'about:client'\n    }\n\n    // Return this’s request’s referrer, serialized.\n    return this[kState].referrer.toString()\n  }\n\n  // Returns the referrer policy associated with request.\n  // This is used during fetching to compute the value of the request’s\n  // referrer.\n  get referrerPolicy () {\n    webidl.brandCheck(this, Request)\n\n    // The referrerPolicy getter steps are to return this’s request’s referrer policy.\n    return this[kState].referrerPolicy\n  }\n\n  // Returns the mode associated with request, which is a string indicating\n  // whether the request will use CORS, or will be restricted to same-origin\n  // URLs.\n  get mode () {\n    webidl.brandCheck(this, Request)\n\n    // The mode getter steps are to return this’s request’s mode.\n    return this[kState].mode\n  }\n\n  // Returns the credentials mode associated with request,\n  // which is a string indicating whether credentials will be sent with the\n  // request always, never, or only when sent to a same-origin URL.\n  get credentials () {\n    // The credentials getter steps are to return this’s request’s credentials mode.\n    return this[kState].credentials\n  }\n\n  // Returns the cache mode associated with request,\n  // which is a string indicating how the request will\n  // interact with the browser’s cache when fetching.\n  get cache () {\n    webidl.brandCheck(this, Request)\n\n    // The cache getter steps are to return this’s request’s cache mode.\n    return this[kState].cache\n  }\n\n  // Returns the redirect mode associated with request,\n  // which is a string indicating how redirects for the\n  // request will be handled during fetching. A request\n  // will follow redirects by default.\n  get redirect () {\n    webidl.brandCheck(this, Request)\n\n    // The redirect getter steps are to return this’s request’s redirect mode.\n    return this[kState].redirect\n  }\n\n  // Returns request’s subresource integrity metadata, which is a\n  // cryptographic hash of the resource being fetched. Its value\n  // consists of multiple hashes separated by whitespace. [SRI]\n  get integrity () {\n    webidl.brandCheck(this, Request)\n\n    // The integrity getter steps are to return this’s request’s integrity\n    // metadata.\n    return this[kState].integrity\n  }\n\n  // Returns a boolean indicating whether or not request can outlive the\n  // global in which it was created.\n  get keepalive () {\n    webidl.brandCheck(this, Request)\n\n    // The keepalive getter steps are to return this’s request’s keepalive.\n    return this[kState].keepalive\n  }\n\n  // Returns a boolean indicating whether or not request is for a reload\n  // navigation.\n  get isReloadNavigation () {\n    webidl.brandCheck(this, Request)\n\n    // The isReloadNavigation getter steps are to return true if this’s\n    // request’s reload-navigation flag is set; otherwise false.\n    return this[kState].reloadNavigation\n  }\n\n  // Returns a boolean indicating whether or not request is for a history\n  // navigation (a.k.a. back-forward navigation).\n  get isHistoryNavigation () {\n    webidl.brandCheck(this, Request)\n\n    // The isHistoryNavigation getter steps are to return true if this’s request’s\n    // history-navigation flag is set; otherwise false.\n    return this[kState].historyNavigation\n  }\n\n  // Returns the signal associated with request, which is an AbortSignal\n  // object indicating whether or not request has been aborted, and its\n  // abort event handler.\n  get signal () {\n    webidl.brandCheck(this, Request)\n\n    // The signal getter steps are to return this’s signal.\n    return this[kSignal]\n  }\n\n  get body () {\n    webidl.brandCheck(this, Request)\n\n    return this[kState].body ? this[kState].body.stream : null\n  }\n\n  get bodyUsed () {\n    webidl.brandCheck(this, Request)\n\n    return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n  }\n\n  get duplex () {\n    webidl.brandCheck(this, Request)\n\n    return 'half'\n  }\n\n  // Returns a clone of request.\n  clone () {\n    webidl.brandCheck(this, Request)\n\n    // 1. If this is unusable, then throw a TypeError.\n    if (bodyUnusable(this)) {\n      throw new TypeError('unusable')\n    }\n\n    // 2. Let clonedRequest be the result of cloning this’s request.\n    const clonedRequest = cloneRequest(this[kState])\n\n    // 3. Let clonedRequestObject be the result of creating a Request object,\n    // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.\n    // 4. Make clonedRequestObject’s signal follow this’s signal.\n    const ac = new AbortController()\n    if (this.signal.aborted) {\n      ac.abort(this.signal.reason)\n    } else {\n      let list = dependentControllerMap.get(this.signal)\n      if (list === undefined) {\n        list = new Set()\n        dependentControllerMap.set(this.signal, list)\n      }\n      const acRef = new WeakRef(ac)\n      list.add(acRef)\n      util.addAbortListener(\n        ac.signal,\n        buildAbort(acRef)\n      )\n    }\n\n    // 4. Return clonedRequestObject.\n    return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders]))\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    if (options.depth === null) {\n      options.depth = 2\n    }\n\n    options.colors ??= true\n\n    const properties = {\n      method: this.method,\n      url: this.url,\n      headers: this.headers,\n      destination: this.destination,\n      referrer: this.referrer,\n      referrerPolicy: this.referrerPolicy,\n      mode: this.mode,\n      credentials: this.credentials,\n      cache: this.cache,\n      redirect: this.redirect,\n      integrity: this.integrity,\n      keepalive: this.keepalive,\n      isReloadNavigation: this.isReloadNavigation,\n      isHistoryNavigation: this.isHistoryNavigation,\n      signal: this.signal\n    }\n\n    return `Request ${nodeUtil.formatWithOptions(options, properties)}`\n  }\n}\n\nmixinBody(Request)\n\n// https://fetch.spec.whatwg.org/#requests\nfunction makeRequest (init) {\n  return {\n    method: init.method ?? 'GET',\n    localURLsOnly: init.localURLsOnly ?? false,\n    unsafeRequest: init.unsafeRequest ?? false,\n    body: init.body ?? null,\n    client: init.client ?? null,\n    reservedClient: init.reservedClient ?? null,\n    replacesClientId: init.replacesClientId ?? '',\n    window: init.window ?? 'client',\n    keepalive: init.keepalive ?? false,\n    serviceWorkers: init.serviceWorkers ?? 'all',\n    initiator: init.initiator ?? '',\n    destination: init.destination ?? '',\n    priority: init.priority ?? null,\n    origin: init.origin ?? 'client',\n    policyContainer: init.policyContainer ?? 'client',\n    referrer: init.referrer ?? 'client',\n    referrerPolicy: init.referrerPolicy ?? '',\n    mode: init.mode ?? 'no-cors',\n    useCORSPreflightFlag: init.useCORSPreflightFlag ?? false,\n    credentials: init.credentials ?? 'same-origin',\n    useCredentials: init.useCredentials ?? false,\n    cache: init.cache ?? 'default',\n    redirect: init.redirect ?? 'follow',\n    integrity: init.integrity ?? '',\n    cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? '',\n    parserMetadata: init.parserMetadata ?? '',\n    reloadNavigation: init.reloadNavigation ?? false,\n    historyNavigation: init.historyNavigation ?? false,\n    userActivation: init.userActivation ?? false,\n    taintedOrigin: init.taintedOrigin ?? false,\n    redirectCount: init.redirectCount ?? 0,\n    responseTainting: init.responseTainting ?? 'basic',\n    preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false,\n    done: init.done ?? false,\n    timingAllowFailed: init.timingAllowFailed ?? false,\n    urlList: init.urlList,\n    url: init.urlList[0],\n    headersList: init.headersList\n      ? new HeadersList(init.headersList)\n      : new HeadersList()\n  }\n}\n\n// https://fetch.spec.whatwg.org/#concept-request-clone\nfunction cloneRequest (request) {\n  // To clone a request request, run these steps:\n\n  // 1. Let newRequest be a copy of request, except for its body.\n  const newRequest = makeRequest({ ...request, body: null })\n\n  // 2. If request’s body is non-null, set newRequest’s body to the\n  // result of cloning request’s body.\n  if (request.body != null) {\n    newRequest.body = cloneBody(newRequest, request.body)\n  }\n\n  // 3. Return newRequest.\n  return newRequest\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-create\n * @param {any} innerRequest\n * @param {AbortSignal} signal\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Request}\n */\nfunction fromInnerRequest (innerRequest, signal, guard) {\n  const request = new Request(kConstruct)\n  request[kState] = innerRequest\n  request[kSignal] = signal\n  request[kHeaders] = new Headers(kConstruct)\n  setHeadersList(request[kHeaders], innerRequest.headersList)\n  setHeadersGuard(request[kHeaders], guard)\n  return request\n}\n\nObject.defineProperties(Request.prototype, {\n  method: kEnumerableProperty,\n  url: kEnumerableProperty,\n  headers: kEnumerableProperty,\n  redirect: kEnumerableProperty,\n  clone: kEnumerableProperty,\n  signal: kEnumerableProperty,\n  duplex: kEnumerableProperty,\n  destination: kEnumerableProperty,\n  body: kEnumerableProperty,\n  bodyUsed: kEnumerableProperty,\n  isHistoryNavigation: kEnumerableProperty,\n  isReloadNavigation: kEnumerableProperty,\n  keepalive: kEnumerableProperty,\n  integrity: kEnumerableProperty,\n  cache: kEnumerableProperty,\n  credentials: kEnumerableProperty,\n  attribute: kEnumerableProperty,\n  referrerPolicy: kEnumerableProperty,\n  referrer: kEnumerableProperty,\n  mode: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Request',\n    configurable: true\n  }\n})\n\nwebidl.converters.Request = webidl.interfaceConverter(\n  Request\n)\n\n// https://fetch.spec.whatwg.org/#requestinfo\nwebidl.converters.RequestInfo = function (V, prefix, argument) {\n  if (typeof V === 'string') {\n    return webidl.converters.USVString(V, prefix, argument)\n  }\n\n  if (V instanceof Request) {\n    return webidl.converters.Request(V, prefix, argument)\n  }\n\n  return webidl.converters.USVString(V, prefix, argument)\n}\n\nwebidl.converters.AbortSignal = webidl.interfaceConverter(\n  AbortSignal\n)\n\n// https://fetch.spec.whatwg.org/#requestinit\nwebidl.converters.RequestInit = webidl.dictionaryConverter([\n  {\n    key: 'method',\n    converter: webidl.converters.ByteString\n  },\n  {\n    key: 'headers',\n    converter: webidl.converters.HeadersInit\n  },\n  {\n    key: 'body',\n    converter: webidl.nullableConverter(\n      webidl.converters.BodyInit\n    )\n  },\n  {\n    key: 'referrer',\n    converter: webidl.converters.USVString\n  },\n  {\n    key: 'referrerPolicy',\n    converter: webidl.converters.DOMString,\n    // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n    allowedValues: referrerPolicy\n  },\n  {\n    key: 'mode',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#concept-request-mode\n    allowedValues: requestMode\n  },\n  {\n    key: 'credentials',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestcredentials\n    allowedValues: requestCredentials\n  },\n  {\n    key: 'cache',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestcache\n    allowedValues: requestCache\n  },\n  {\n    key: 'redirect',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestredirect\n    allowedValues: requestRedirect\n  },\n  {\n    key: 'integrity',\n    converter: webidl.converters.DOMString\n  },\n  {\n    key: 'keepalive',\n    converter: webidl.converters.boolean\n  },\n  {\n    key: 'signal',\n    converter: webidl.nullableConverter(\n      (signal) => webidl.converters.AbortSignal(\n        signal,\n        'RequestInit',\n        'signal',\n        { strict: false }\n      )\n    )\n  },\n  {\n    key: 'window',\n    converter: webidl.converters.any\n  },\n  {\n    key: 'duplex',\n    converter: webidl.converters.DOMString,\n    allowedValues: requestDuplex\n  },\n  {\n    key: 'dispatcher', // undici specific option\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }\n","'use strict'\n\nconst { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require('./headers')\nconst { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require('./body')\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst { kEnumerableProperty } = util\nconst {\n  isValidReasonPhrase,\n  isCancelled,\n  isAborted,\n  isBlobLike,\n  serializeJavascriptValueToJSONString,\n  isErrorLike,\n  isomorphicEncode,\n  environmentSettingsObject: relevantRealm\n} = require('./util')\nconst {\n  redirectStatusSet,\n  nullBodyStatus\n} = require('./constants')\nconst { kState, kHeaders } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { FormData } = require('./formdata')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { types } = require('node:util')\n\nconst textEncoder = new TextEncoder('utf-8')\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response {\n  // Creates network error Response.\n  static error () {\n    // The static error() method steps are to return the result of creating a\n    // Response object, given a new network error, \"immutable\", and this’s\n    // relevant Realm.\n    const responseObject = fromInnerResponse(makeNetworkError(), 'immutable')\n\n    return responseObject\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-json\n  static json (data, init = {}) {\n    webidl.argumentLengthCheck(arguments, 1, 'Response.json')\n\n    if (init !== null) {\n      init = webidl.converters.ResponseInit(init)\n    }\n\n    // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.\n    const bytes = textEncoder.encode(\n      serializeJavascriptValueToJSONString(data)\n    )\n\n    // 2. Let body be the result of extracting bytes.\n    const body = extractBody(bytes)\n\n    // 3. Let responseObject be the result of creating a Response object, given a new response,\n    //    \"response\", and this’s relevant Realm.\n    const responseObject = fromInnerResponse(makeResponse({}), 'response')\n\n    // 4. Perform initialize a response given responseObject, init, and (body, \"application/json\").\n    initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })\n\n    // 5. Return responseObject.\n    return responseObject\n  }\n\n  // Creates a redirect Response that redirects to url with status status.\n  static redirect (url, status = 302) {\n    webidl.argumentLengthCheck(arguments, 1, 'Response.redirect')\n\n    url = webidl.converters.USVString(url)\n    status = webidl.converters['unsigned short'](status)\n\n    // 1. Let parsedURL be the result of parsing url with current settings\n    // object’s API base URL.\n    // 2. If parsedURL is failure, then throw a TypeError.\n    // TODO: base-URL?\n    let parsedURL\n    try {\n      parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl)\n    } catch (err) {\n      throw new TypeError(`Failed to parse URL from ${url}`, { cause: err })\n    }\n\n    // 3. If status is not a redirect status, then throw a RangeError.\n    if (!redirectStatusSet.has(status)) {\n      throw new RangeError(`Invalid status code ${status}`)\n    }\n\n    // 4. Let responseObject be the result of creating a Response object,\n    // given a new response, \"immutable\", and this’s relevant Realm.\n    const responseObject = fromInnerResponse(makeResponse({}), 'immutable')\n\n    // 5. Set responseObject’s response’s status to status.\n    responseObject[kState].status = status\n\n    // 6. Let value be parsedURL, serialized and isomorphic encoded.\n    const value = isomorphicEncode(URLSerializer(parsedURL))\n\n    // 7. Append `Location`/value to responseObject’s response’s header list.\n    responseObject[kState].headersList.append('location', value, true)\n\n    // 8. Return responseObject.\n    return responseObject\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response\n  constructor (body = null, init = {}) {\n    webidl.util.markAsUncloneable(this)\n    if (body === kConstruct) {\n      return\n    }\n\n    if (body !== null) {\n      body = webidl.converters.BodyInit(body)\n    }\n\n    init = webidl.converters.ResponseInit(init)\n\n    // 1. Set this’s response to a new response.\n    this[kState] = makeResponse({})\n\n    // 2. Set this’s headers to a new Headers object with this’s relevant\n    // Realm, whose header list is this’s response’s header list and guard\n    // is \"response\".\n    this[kHeaders] = new Headers(kConstruct)\n    setHeadersGuard(this[kHeaders], 'response')\n    setHeadersList(this[kHeaders], this[kState].headersList)\n\n    // 3. Let bodyWithType be null.\n    let bodyWithType = null\n\n    // 4. If body is non-null, then set bodyWithType to the result of extracting body.\n    if (body != null) {\n      const [extractedBody, type] = extractBody(body)\n      bodyWithType = { body: extractedBody, type }\n    }\n\n    // 5. Perform initialize a response given this, init, and bodyWithType.\n    initializeResponse(this, init, bodyWithType)\n  }\n\n  // Returns response’s type, e.g., \"cors\".\n  get type () {\n    webidl.brandCheck(this, Response)\n\n    // The type getter steps are to return this’s response’s type.\n    return this[kState].type\n  }\n\n  // Returns response’s URL, if it has one; otherwise the empty string.\n  get url () {\n    webidl.brandCheck(this, Response)\n\n    const urlList = this[kState].urlList\n\n    // The url getter steps are to return the empty string if this’s\n    // response’s URL is null; otherwise this’s response’s URL,\n    // serialized with exclude fragment set to true.\n    const url = urlList[urlList.length - 1] ?? null\n\n    if (url === null) {\n      return ''\n    }\n\n    return URLSerializer(url, true)\n  }\n\n  // Returns whether response was obtained through a redirect.\n  get redirected () {\n    webidl.brandCheck(this, Response)\n\n    // The redirected getter steps are to return true if this’s response’s URL\n    // list has more than one item; otherwise false.\n    return this[kState].urlList.length > 1\n  }\n\n  // Returns response’s status.\n  get status () {\n    webidl.brandCheck(this, Response)\n\n    // The status getter steps are to return this’s response’s status.\n    return this[kState].status\n  }\n\n  // Returns whether response’s status is an ok status.\n  get ok () {\n    webidl.brandCheck(this, Response)\n\n    // The ok getter steps are to return true if this’s response’s status is an\n    // ok status; otherwise false.\n    return this[kState].status >= 200 && this[kState].status <= 299\n  }\n\n  // Returns response’s status message.\n  get statusText () {\n    webidl.brandCheck(this, Response)\n\n    // The statusText getter steps are to return this’s response’s status\n    // message.\n    return this[kState].statusText\n  }\n\n  // Returns response’s headers as Headers.\n  get headers () {\n    webidl.brandCheck(this, Response)\n\n    // The headers getter steps are to return this’s headers.\n    return this[kHeaders]\n  }\n\n  get body () {\n    webidl.brandCheck(this, Response)\n\n    return this[kState].body ? this[kState].body.stream : null\n  }\n\n  get bodyUsed () {\n    webidl.brandCheck(this, Response)\n\n    return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n  }\n\n  // Returns a clone of response.\n  clone () {\n    webidl.brandCheck(this, Response)\n\n    // 1. If this is unusable, then throw a TypeError.\n    if (bodyUnusable(this)) {\n      throw webidl.errors.exception({\n        header: 'Response.clone',\n        message: 'Body has already been consumed.'\n      })\n    }\n\n    // 2. Let clonedResponse be the result of cloning this’s response.\n    const clonedResponse = cloneResponse(this[kState])\n\n    // Note: To re-register because of a new stream.\n    if (hasFinalizationRegistry && this[kState].body?.stream) {\n      streamRegistry.register(this, new WeakRef(this[kState].body.stream))\n    }\n\n    // 3. Return the result of creating a Response object, given\n    // clonedResponse, this’s headers’s guard, and this’s relevant Realm.\n    return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders]))\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    if (options.depth === null) {\n      options.depth = 2\n    }\n\n    options.colors ??= true\n\n    const properties = {\n      status: this.status,\n      statusText: this.statusText,\n      headers: this.headers,\n      body: this.body,\n      bodyUsed: this.bodyUsed,\n      ok: this.ok,\n      redirected: this.redirected,\n      type: this.type,\n      url: this.url\n    }\n\n    return `Response ${nodeUtil.formatWithOptions(options, properties)}`\n  }\n}\n\nmixinBody(Response)\n\nObject.defineProperties(Response.prototype, {\n  type: kEnumerableProperty,\n  url: kEnumerableProperty,\n  status: kEnumerableProperty,\n  ok: kEnumerableProperty,\n  redirected: kEnumerableProperty,\n  statusText: kEnumerableProperty,\n  headers: kEnumerableProperty,\n  clone: kEnumerableProperty,\n  body: kEnumerableProperty,\n  bodyUsed: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Response',\n    configurable: true\n  }\n})\n\nObject.defineProperties(Response, {\n  json: kEnumerableProperty,\n  redirect: kEnumerableProperty,\n  error: kEnumerableProperty\n})\n\n// https://fetch.spec.whatwg.org/#concept-response-clone\nfunction cloneResponse (response) {\n  // To clone a response response, run these steps:\n\n  // 1. If response is a filtered response, then return a new identical\n  // filtered response whose internal response is a clone of response’s\n  // internal response.\n  if (response.internalResponse) {\n    return filterResponse(\n      cloneResponse(response.internalResponse),\n      response.type\n    )\n  }\n\n  // 2. Let newResponse be a copy of response, except for its body.\n  const newResponse = makeResponse({ ...response, body: null })\n\n  // 3. If response’s body is non-null, then set newResponse’s body to the\n  // result of cloning response’s body.\n  if (response.body != null) {\n    newResponse.body = cloneBody(newResponse, response.body)\n  }\n\n  // 4. Return newResponse.\n  return newResponse\n}\n\nfunction makeResponse (init) {\n  return {\n    aborted: false,\n    rangeRequested: false,\n    timingAllowPassed: false,\n    requestIncludesCredentials: false,\n    type: 'default',\n    status: 200,\n    timingInfo: null,\n    cacheState: '',\n    statusText: '',\n    ...init,\n    headersList: init?.headersList\n      ? new HeadersList(init?.headersList)\n      : new HeadersList(),\n    urlList: init?.urlList ? [...init.urlList] : []\n  }\n}\n\nfunction makeNetworkError (reason) {\n  const isError = isErrorLike(reason)\n  return makeResponse({\n    type: 'error',\n    status: 0,\n    error: isError\n      ? reason\n      : new Error(reason ? String(reason) : reason),\n    aborted: reason && reason.name === 'AbortError'\n  })\n}\n\n// @see https://fetch.spec.whatwg.org/#concept-network-error\nfunction isNetworkError (response) {\n  return (\n    // A network error is a response whose type is \"error\",\n    response.type === 'error' &&\n    // status is 0\n    response.status === 0\n  )\n}\n\nfunction makeFilteredResponse (response, state) {\n  state = {\n    internalResponse: response,\n    ...state\n  }\n\n  return new Proxy(response, {\n    get (target, p) {\n      return p in state ? state[p] : target[p]\n    },\n    set (target, p, value) {\n      assert(!(p in state))\n      target[p] = value\n      return true\n    }\n  })\n}\n\n// https://fetch.spec.whatwg.org/#concept-filtered-response\nfunction filterResponse (response, type) {\n  // Set response to the following filtered response with response as its\n  // internal response, depending on request’s response tainting:\n  if (type === 'basic') {\n    // A basic filtered response is a filtered response whose type is \"basic\"\n    // and header list excludes any headers in internal response’s header list\n    // whose name is a forbidden response-header name.\n\n    // Note: undici does not implement forbidden response-header names\n    return makeFilteredResponse(response, {\n      type: 'basic',\n      headersList: response.headersList\n    })\n  } else if (type === 'cors') {\n    // A CORS filtered response is a filtered response whose type is \"cors\"\n    // and header list excludes any headers in internal response’s header\n    // list whose name is not a CORS-safelisted response-header name, given\n    // internal response’s CORS-exposed header-name list.\n\n    // Note: undici does not implement CORS-safelisted response-header names\n    return makeFilteredResponse(response, {\n      type: 'cors',\n      headersList: response.headersList\n    })\n  } else if (type === 'opaque') {\n    // An opaque filtered response is a filtered response whose type is\n    // \"opaque\", URL list is the empty list, status is 0, status message\n    // is the empty byte sequence, header list is empty, and body is null.\n\n    return makeFilteredResponse(response, {\n      type: 'opaque',\n      urlList: Object.freeze([]),\n      status: 0,\n      statusText: '',\n      body: null\n    })\n  } else if (type === 'opaqueredirect') {\n    // An opaque-redirect filtered response is a filtered response whose type\n    // is \"opaqueredirect\", status is 0, status message is the empty byte\n    // sequence, header list is empty, and body is null.\n\n    return makeFilteredResponse(response, {\n      type: 'opaqueredirect',\n      status: 0,\n      statusText: '',\n      headersList: [],\n      body: null\n    })\n  } else {\n    assert(false)\n  }\n}\n\n// https://fetch.spec.whatwg.org/#appropriate-network-error\nfunction makeAppropriateNetworkError (fetchParams, err = null) {\n  // 1. Assert: fetchParams is canceled.\n  assert(isCancelled(fetchParams))\n\n  // 2. Return an aborted network error if fetchParams is aborted;\n  // otherwise return a network error.\n  return isAborted(fetchParams)\n    ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))\n    : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))\n}\n\n// https://whatpr.org/fetch/1392.html#initialize-a-response\nfunction initializeResponse (response, init, body) {\n  // 1. If init[\"status\"] is not in the range 200 to 599, inclusive, then\n  //    throw a RangeError.\n  if (init.status !== null && (init.status < 200 || init.status > 599)) {\n    throw new RangeError('init[\"status\"] must be in the range of 200 to 599, inclusive.')\n  }\n\n  // 2. If init[\"statusText\"] does not match the reason-phrase token production,\n  //    then throw a TypeError.\n  if ('statusText' in init && init.statusText != null) {\n    // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:\n    //   reason-phrase  = *( HTAB / SP / VCHAR / obs-text )\n    if (!isValidReasonPhrase(String(init.statusText))) {\n      throw new TypeError('Invalid statusText')\n    }\n  }\n\n  // 3. Set response’s response’s status to init[\"status\"].\n  if ('status' in init && init.status != null) {\n    response[kState].status = init.status\n  }\n\n  // 4. Set response’s response’s status message to init[\"statusText\"].\n  if ('statusText' in init && init.statusText != null) {\n    response[kState].statusText = init.statusText\n  }\n\n  // 5. If init[\"headers\"] exists, then fill response’s headers with init[\"headers\"].\n  if ('headers' in init && init.headers != null) {\n    fill(response[kHeaders], init.headers)\n  }\n\n  // 6. If body was given, then:\n  if (body) {\n    // 1. If response's status is a null body status, then throw a TypeError.\n    if (nullBodyStatus.includes(response.status)) {\n      throw webidl.errors.exception({\n        header: 'Response constructor',\n        message: `Invalid response status code ${response.status}`\n      })\n    }\n\n    // 2. Set response's body to body's body.\n    response[kState].body = body.body\n\n    // 3. If body's type is non-null and response's header list does not contain\n    //    `Content-Type`, then append (`Content-Type`, body's type) to response's header list.\n    if (body.type != null && !response[kState].headersList.contains('content-type', true)) {\n      response[kState].headersList.append('content-type', body.type, true)\n    }\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#response-create\n * @param {any} innerResponse\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Response}\n */\nfunction fromInnerResponse (innerResponse, guard) {\n  const response = new Response(kConstruct)\n  response[kState] = innerResponse\n  response[kHeaders] = new Headers(kConstruct)\n  setHeadersList(response[kHeaders], innerResponse.headersList)\n  setHeadersGuard(response[kHeaders], guard)\n\n  if (hasFinalizationRegistry && innerResponse.body?.stream) {\n    // If the target (response) is reclaimed, the cleanup callback may be called at some point with\n    // the held value provided for it (innerResponse.body.stream). The held value can be any value:\n    // a primitive or an object, even undefined. If the held value is an object, the registry keeps\n    // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n    streamRegistry.register(response, new WeakRef(innerResponse.body.stream))\n  }\n\n  return response\n}\n\nwebidl.converters.ReadableStream = webidl.interfaceConverter(\n  ReadableStream\n)\n\nwebidl.converters.FormData = webidl.interfaceConverter(\n  FormData\n)\n\nwebidl.converters.URLSearchParams = webidl.interfaceConverter(\n  URLSearchParams\n)\n\n// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit\nwebidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) {\n  if (typeof V === 'string') {\n    return webidl.converters.USVString(V, prefix, name)\n  }\n\n  if (isBlobLike(V)) {\n    return webidl.converters.Blob(V, prefix, name, { strict: false })\n  }\n\n  if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n    return webidl.converters.BufferSource(V, prefix, name)\n  }\n\n  if (util.isFormDataLike(V)) {\n    return webidl.converters.FormData(V, prefix, name, { strict: false })\n  }\n\n  if (V instanceof URLSearchParams) {\n    return webidl.converters.URLSearchParams(V, prefix, name)\n  }\n\n  return webidl.converters.DOMString(V, prefix, name)\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit\nwebidl.converters.BodyInit = function (V, prefix, argument) {\n  if (V instanceof ReadableStream) {\n    return webidl.converters.ReadableStream(V, prefix, argument)\n  }\n\n  // Note: the spec doesn't include async iterables,\n  // this is an undici extension.\n  if (V?.[Symbol.asyncIterator]) {\n    return V\n  }\n\n  return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument)\n}\n\nwebidl.converters.ResponseInit = webidl.dictionaryConverter([\n  {\n    key: 'status',\n    converter: webidl.converters['unsigned short'],\n    defaultValue: () => 200\n  },\n  {\n    key: 'statusText',\n    converter: webidl.converters.ByteString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'headers',\n    converter: webidl.converters.HeadersInit\n  }\n])\n\nmodule.exports = {\n  isNetworkError,\n  makeNetworkError,\n  makeResponse,\n  makeAppropriateNetworkError,\n  filterResponse,\n  Response,\n  cloneResponse,\n  fromInnerResponse\n}\n","'use strict'\n\nmodule.exports = {\n  kUrl: Symbol('url'),\n  kHeaders: Symbol('headers'),\n  kSignal: Symbol('signal'),\n  kState: Symbol('state'),\n  kDispatcher: Symbol('dispatcher')\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst zlib = require('node:zlib')\nconst { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants')\nconst { getGlobalOrigin } = require('./global')\nconst { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require('./data-url')\nconst { performance } = require('node:perf_hooks')\nconst { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require('../../core/util')\nconst assert = require('node:assert')\nconst { isUint8Array } = require('node:util/types')\nconst { webidl } = require('./webidl')\n\nlet supportedHashes = []\n\n// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable\n/** @type {import('crypto')} */\nlet crypto\ntry {\n  crypto = require('node:crypto')\n  const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']\n  supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))\n/* c8 ignore next 3 */\n} catch {\n\n}\n\nfunction responseURL (response) {\n  // https://fetch.spec.whatwg.org/#responses\n  // A response has an associated URL. It is a pointer to the last URL\n  // in response’s URL list and null if response’s URL list is empty.\n  const urlList = response.urlList\n  const length = urlList.length\n  return length === 0 ? null : urlList[length - 1].toString()\n}\n\n// https://fetch.spec.whatwg.org/#concept-response-location-url\nfunction responseLocationURL (response, requestFragment) {\n  // 1. If response’s status is not a redirect status, then return null.\n  if (!redirectStatusSet.has(response.status)) {\n    return null\n  }\n\n  // 2. Let location be the result of extracting header list values given\n  // `Location` and response’s header list.\n  let location = response.headersList.get('location', true)\n\n  // 3. If location is a header value, then set location to the result of\n  //    parsing location with response’s URL.\n  if (location !== null && isValidHeaderValue(location)) {\n    if (!isValidEncodedURL(location)) {\n      // Some websites respond location header in UTF-8 form without encoding them as ASCII\n      // and major browsers redirect them to correctly UTF-8 encoded addresses.\n      // Here, we handle that behavior in the same way.\n      location = normalizeBinaryStringToUtf8(location)\n    }\n    location = new URL(location, responseURL(response))\n  }\n\n  // 4. If location is a URL whose fragment is null, then set location’s\n  // fragment to requestFragment.\n  if (location && !location.hash) {\n    location.hash = requestFragment\n  }\n\n  // 5. Return location.\n  return location\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2\n * @param {string} url\n * @returns {boolean}\n */\nfunction isValidEncodedURL (url) {\n  for (let i = 0; i < url.length; ++i) {\n    const code = url.charCodeAt(i)\n\n    if (\n      code > 0x7E || // Non-US-ASCII + DEL\n      code < 0x20 // Control characters NUL - US\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it.\n * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well.\n * @param {string} value\n * @returns {string}\n */\nfunction normalizeBinaryStringToUtf8 (value) {\n  return Buffer.from(value, 'binary').toString('utf8')\n}\n\n/** @returns {URL} */\nfunction requestCurrentURL (request) {\n  return request.urlList[request.urlList.length - 1]\n}\n\nfunction requestBadPort (request) {\n  // 1. Let url be request’s current URL.\n  const url = requestCurrentURL(request)\n\n  // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,\n  // then return blocked.\n  if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {\n    return 'blocked'\n  }\n\n  // 3. Return allowed.\n  return 'allowed'\n}\n\nfunction isErrorLike (object) {\n  return object instanceof Error || (\n    object?.constructor?.name === 'Error' ||\n    object?.constructor?.name === 'DOMException'\n  )\n}\n\n// Check whether |statusText| is a ByteString and\n// matches the Reason-Phrase token production.\n// RFC 2616: https://tools.ietf.org/html/rfc2616\n// RFC 7230: https://tools.ietf.org/html/rfc7230\n// \"reason-phrase = *( HTAB / SP / VCHAR / obs-text )\"\n// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116\nfunction isValidReasonPhrase (statusText) {\n  for (let i = 0; i < statusText.length; ++i) {\n    const c = statusText.charCodeAt(i)\n    if (\n      !(\n        (\n          c === 0x09 || // HTAB\n          (c >= 0x20 && c <= 0x7e) || // SP / VCHAR\n          (c >= 0x80 && c <= 0xff)\n        ) // obs-text\n      )\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-name\n * @param {string} potentialValue\n */\nconst isValidHeaderName = isValidHTTPToken\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value\n * @param {string} potentialValue\n */\nfunction isValidHeaderValue (potentialValue) {\n  // - Has no leading or trailing HTTP tab or space bytes.\n  // - Contains no 0x00 (NUL) or HTTP newline bytes.\n  return (\n    potentialValue[0] === '\\t' ||\n    potentialValue[0] === ' ' ||\n    potentialValue[potentialValue.length - 1] === '\\t' ||\n    potentialValue[potentialValue.length - 1] === ' ' ||\n    potentialValue.includes('\\n') ||\n    potentialValue.includes('\\r') ||\n    potentialValue.includes('\\0')\n  ) === false\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect\nfunction setRequestReferrerPolicyOnRedirect (request, actualResponse) {\n  //  Given a request request and a response actualResponse, this algorithm\n  //  updates request’s referrer policy according to the Referrer-Policy\n  //  header (if any) in actualResponse.\n\n  // 1. Let policy be the result of executing § 8.1 Parse a referrer policy\n  // from a Referrer-Policy header on actualResponse.\n\n  // 8.1 Parse a referrer policy from a Referrer-Policy header\n  // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.\n  const { headersList } = actualResponse\n  // 2. Let policy be the empty string.\n  // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.\n  // 4. Return policy.\n  const policyHeader = (headersList.get('referrer-policy', true) ?? '').split(',')\n\n  // Note: As the referrer-policy can contain multiple policies\n  // separated by comma, we need to loop through all of them\n  // and pick the first valid one.\n  // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy\n  let policy = ''\n  if (policyHeader.length > 0) {\n    // The right-most policy takes precedence.\n    // The left-most policy is the fallback.\n    for (let i = policyHeader.length; i !== 0; i--) {\n      const token = policyHeader[i - 1].trim()\n      if (referrerPolicyTokens.has(token)) {\n        policy = token\n        break\n      }\n    }\n  }\n\n  // 2. If policy is not the empty string, then set request’s referrer policy to policy.\n  if (policy !== '') {\n    request.referrerPolicy = policy\n  }\n}\n\n// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check\nfunction crossOriginResourcePolicyCheck () {\n  // TODO\n  return 'allowed'\n}\n\n// https://fetch.spec.whatwg.org/#concept-cors-check\nfunction corsCheck () {\n  // TODO\n  return 'success'\n}\n\n// https://fetch.spec.whatwg.org/#concept-tao-check\nfunction TAOCheck () {\n  // TODO\n  return 'success'\n}\n\nfunction appendFetchMetadata (httpRequest) {\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header\n  //  TODO\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header\n\n  //  1. Assert: r’s url is a potentially trustworthy URL.\n  //  TODO\n\n  //  2. Let header be a Structured Header whose value is a token.\n  let header = null\n\n  //  3. Set header’s value to r’s mode.\n  header = httpRequest.mode\n\n  //  4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.\n  httpRequest.headersList.set('sec-fetch-mode', header, true)\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header\n  //  TODO\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header\n  //  TODO\n}\n\n// https://fetch.spec.whatwg.org/#append-a-request-origin-header\nfunction appendRequestOriginHeader (request) {\n  // 1. Let serializedOrigin be the result of byte-serializing a request origin\n  //    with request.\n  // TODO: implement \"byte-serializing a request origin\"\n  let serializedOrigin = request.origin\n\n  // - \"'client' is changed to an origin during fetching.\"\n  //   This doesn't happen in undici (in most cases) because undici, by default,\n  //   has no concept of origin.\n  // - request.origin can also be set to request.client.origin (client being\n  //   an environment settings object), which is undefined without using\n  //   setGlobalOrigin.\n  if (serializedOrigin === 'client' || serializedOrigin === undefined) {\n    return\n  }\n\n  // 2. If request’s response tainting is \"cors\" or request’s mode is \"websocket\",\n  //    then append (`Origin`, serializedOrigin) to request’s header list.\n  // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:\n  if (request.responseTainting === 'cors' || request.mode === 'websocket') {\n    request.headersList.append('origin', serializedOrigin, true)\n  } else if (request.method !== 'GET' && request.method !== 'HEAD') {\n    // 1. Switch on request’s referrer policy:\n    switch (request.referrerPolicy) {\n      case 'no-referrer':\n        // Set serializedOrigin to `null`.\n        serializedOrigin = null\n        break\n      case 'no-referrer-when-downgrade':\n      case 'strict-origin':\n      case 'strict-origin-when-cross-origin':\n        // If request’s origin is a tuple origin, its scheme is \"https\", and\n        // request’s current URL’s scheme is not \"https\", then set\n        // serializedOrigin to `null`.\n        if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n          serializedOrigin = null\n        }\n        break\n      case 'same-origin':\n        // If request’s origin is not same origin with request’s current URL’s\n        // origin, then set serializedOrigin to `null`.\n        if (!sameOrigin(request, requestCurrentURL(request))) {\n          serializedOrigin = null\n        }\n        break\n      default:\n        // Do nothing.\n    }\n\n    // 2. Append (`Origin`, serializedOrigin) to request’s header list.\n    request.headersList.append('origin', serializedOrigin, true)\n  }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsen-time\nfunction coarsenTime (timestamp, crossOriginIsolatedCapability) {\n  // TODO\n  return timestamp\n}\n\n// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info\nfunction clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {\n  if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {\n    return {\n      domainLookupStartTime: defaultStartTime,\n      domainLookupEndTime: defaultStartTime,\n      connectionStartTime: defaultStartTime,\n      connectionEndTime: defaultStartTime,\n      secureConnectionStartTime: defaultStartTime,\n      ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol\n    }\n  }\n\n  return {\n    domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),\n    domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),\n    connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),\n    connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),\n    secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),\n    ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol\n  }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time\nfunction coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {\n  return coarsenTime(performance.now(), crossOriginIsolatedCapability)\n}\n\n// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info\nfunction createOpaqueTimingInfo (timingInfo) {\n  return {\n    startTime: timingInfo.startTime ?? 0,\n    redirectStartTime: 0,\n    redirectEndTime: 0,\n    postRedirectStartTime: timingInfo.startTime ?? 0,\n    finalServiceWorkerStartTime: 0,\n    finalNetworkResponseStartTime: 0,\n    finalNetworkRequestStartTime: 0,\n    endTime: 0,\n    encodedBodySize: 0,\n    decodedBodySize: 0,\n    finalConnectionTimingInfo: null\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#policy-container\nfunction makePolicyContainer () {\n  // Note: the fetch spec doesn't make use of embedder policy or CSP list\n  return {\n    referrerPolicy: 'strict-origin-when-cross-origin'\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container\nfunction clonePolicyContainer (policyContainer) {\n  return {\n    referrerPolicy: policyContainer.referrerPolicy\n  }\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer\nfunction determineRequestsReferrer (request) {\n  // 1. Let policy be request's referrer policy.\n  const policy = request.referrerPolicy\n\n  // Note: policy cannot (shouldn't) be null or an empty string.\n  assert(policy)\n\n  // 2. Let environment be request’s client.\n\n  let referrerSource = null\n\n  // 3. Switch on request’s referrer:\n  if (request.referrer === 'client') {\n    // Note: node isn't a browser and doesn't implement document/iframes,\n    // so we bypass this step and replace it with our own.\n\n    const globalOrigin = getGlobalOrigin()\n\n    if (!globalOrigin || globalOrigin.origin === 'null') {\n      return 'no-referrer'\n    }\n\n    // note: we need to clone it as it's mutated\n    referrerSource = new URL(globalOrigin)\n  } else if (request.referrer instanceof URL) {\n    // Let referrerSource be request’s referrer.\n    referrerSource = request.referrer\n  }\n\n  // 4. Let request’s referrerURL be the result of stripping referrerSource for\n  //    use as a referrer.\n  let referrerURL = stripURLForReferrer(referrerSource)\n\n  // 5. Let referrerOrigin be the result of stripping referrerSource for use as\n  //    a referrer, with the origin-only flag set to true.\n  const referrerOrigin = stripURLForReferrer(referrerSource, true)\n\n  // 6. If the result of serializing referrerURL is a string whose length is\n  //    greater than 4096, set referrerURL to referrerOrigin.\n  if (referrerURL.toString().length > 4096) {\n    referrerURL = referrerOrigin\n  }\n\n  const areSameOrigin = sameOrigin(request, referrerURL)\n  const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&\n    !isURLPotentiallyTrustworthy(request.url)\n\n  // 8. Execute the switch statements corresponding to the value of policy:\n  switch (policy) {\n    case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)\n    case 'unsafe-url': return referrerURL\n    case 'same-origin':\n      return areSameOrigin ? referrerOrigin : 'no-referrer'\n    case 'origin-when-cross-origin':\n      return areSameOrigin ? referrerURL : referrerOrigin\n    case 'strict-origin-when-cross-origin': {\n      const currentURL = requestCurrentURL(request)\n\n      // 1. If the origin of referrerURL and the origin of request’s current\n      //    URL are the same, then return referrerURL.\n      if (sameOrigin(referrerURL, currentURL)) {\n        return referrerURL\n      }\n\n      // 2. If referrerURL is a potentially trustworthy URL and request’s\n      //    current URL is not a potentially trustworthy URL, then return no\n      //    referrer.\n      if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n        return 'no-referrer'\n      }\n\n      // 3. Return referrerOrigin.\n      return referrerOrigin\n    }\n    case 'strict-origin': // eslint-disable-line\n      /**\n         * 1. If referrerURL is a potentially trustworthy URL and\n         * request’s current URL is not a potentially trustworthy URL,\n         * then return no referrer.\n         * 2. Return referrerOrigin\n        */\n    case 'no-referrer-when-downgrade': // eslint-disable-line\n      /**\n       * 1. If referrerURL is a potentially trustworthy URL and\n       * request’s current URL is not a potentially trustworthy URL,\n       * then return no referrer.\n       * 2. Return referrerOrigin\n      */\n\n    default: // eslint-disable-line\n      return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin\n  }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url\n * @param {URL} url\n * @param {boolean|undefined} originOnly\n */\nfunction stripURLForReferrer (url, originOnly) {\n  // 1. Assert: url is a URL.\n  assert(url instanceof URL)\n\n  url = new URL(url)\n\n  // 2. If url’s scheme is a local scheme, then return no referrer.\n  if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {\n    return 'no-referrer'\n  }\n\n  // 3. Set url’s username to the empty string.\n  url.username = ''\n\n  // 4. Set url’s password to the empty string.\n  url.password = ''\n\n  // 5. Set url’s fragment to null.\n  url.hash = ''\n\n  // 6. If the origin-only flag is true, then:\n  if (originOnly) {\n    // 1. Set url’s path to « the empty string ».\n    url.pathname = ''\n\n    // 2. Set url’s query to null.\n    url.search = ''\n  }\n\n  // 7. Return url.\n  return url\n}\n\nfunction isURLPotentiallyTrustworthy (url) {\n  if (!(url instanceof URL)) {\n    return false\n  }\n\n  // If child of about, return true\n  if (url.href === 'about:blank' || url.href === 'about:srcdoc') {\n    return true\n  }\n\n  // If scheme is data, return true\n  if (url.protocol === 'data:') return true\n\n  // If file, return true\n  if (url.protocol === 'file:') return true\n\n  return isOriginPotentiallyTrustworthy(url.origin)\n\n  function isOriginPotentiallyTrustworthy (origin) {\n    // If origin is explicitly null, return false\n    if (origin == null || origin === 'null') return false\n\n    const originAsURL = new URL(origin)\n\n    // If secure, return true\n    if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {\n      return true\n    }\n\n    // If localhost or variants, return true\n    if (/^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^\\[(?:0*:)*?:?0*1\\]$/.test(originAsURL.hostname) ||\n     (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||\n     (originAsURL.hostname.endsWith('.localhost'))) {\n      return true\n    }\n\n    // If any other, return false\n    return false\n  }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist\n * @param {Uint8Array} bytes\n * @param {string} metadataList\n */\nfunction bytesMatch (bytes, metadataList) {\n  // If node is not built with OpenSSL support, we cannot check\n  // a request's integrity, so allow it by default (the spec will\n  // allow requests if an invalid hash is given, as precedence).\n  /* istanbul ignore if: only if node is built with --without-ssl */\n  if (crypto === undefined) {\n    return true\n  }\n\n  // 1. Let parsedMetadata be the result of parsing metadataList.\n  const parsedMetadata = parseMetadata(metadataList)\n\n  // 2. If parsedMetadata is no metadata, return true.\n  if (parsedMetadata === 'no metadata') {\n    return true\n  }\n\n  // 3. If response is not eligible for integrity validation, return false.\n  // TODO\n\n  // 4. If parsedMetadata is the empty set, return true.\n  if (parsedMetadata.length === 0) {\n    return true\n  }\n\n  // 5. Let metadata be the result of getting the strongest\n  //    metadata from parsedMetadata.\n  const strongest = getStrongestMetadata(parsedMetadata)\n  const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)\n\n  // 6. For each item in metadata:\n  for (const item of metadata) {\n    // 1. Let algorithm be the alg component of item.\n    const algorithm = item.algo\n\n    // 2. Let expectedValue be the val component of item.\n    const expectedValue = item.hash\n\n    // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e\n    // \"be liberal with padding\". This is annoying, and it's not even in the spec.\n\n    // 3. Let actualValue be the result of applying algorithm to bytes.\n    let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')\n\n    if (actualValue[actualValue.length - 1] === '=') {\n      if (actualValue[actualValue.length - 2] === '=') {\n        actualValue = actualValue.slice(0, -2)\n      } else {\n        actualValue = actualValue.slice(0, -1)\n      }\n    }\n\n    // 4. If actualValue is a case-sensitive match for expectedValue,\n    //    return true.\n    if (compareBase64Mixed(actualValue, expectedValue)) {\n      return true\n    }\n  }\n\n  // 7. Return false.\n  return false\n}\n\n// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options\n// https://www.w3.org/TR/CSP2/#source-list-syntax\n// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1\nconst parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\\s|$)( +[!-~]*)?)?/i\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata\n * @param {string} metadata\n */\nfunction parseMetadata (metadata) {\n  // 1. Let result be the empty set.\n  /** @type {{ algo: string, hash: string }[]} */\n  const result = []\n\n  // 2. Let empty be equal to true.\n  let empty = true\n\n  // 3. For each token returned by splitting metadata on spaces:\n  for (const token of metadata.split(' ')) {\n    // 1. Set empty to false.\n    empty = false\n\n    // 2. Parse token as a hash-with-options.\n    const parsedToken = parseHashWithOptions.exec(token)\n\n    // 3. If token does not parse, continue to the next token.\n    if (\n      parsedToken === null ||\n      parsedToken.groups === undefined ||\n      parsedToken.groups.algo === undefined\n    ) {\n      // Note: Chromium blocks the request at this point, but Firefox\n      // gives a warning that an invalid integrity was given. The\n      // correct behavior is to ignore these, and subsequently not\n      // check the integrity of the resource.\n      continue\n    }\n\n    // 4. Let algorithm be the hash-algo component of token.\n    const algorithm = parsedToken.groups.algo.toLowerCase()\n\n    // 5. If algorithm is a hash function recognized by the user\n    //    agent, add the parsed token to result.\n    if (supportedHashes.includes(algorithm)) {\n      result.push(parsedToken.groups)\n    }\n  }\n\n  // 4. Return no metadata if empty is true, otherwise return result.\n  if (empty === true) {\n    return 'no metadata'\n  }\n\n  return result\n}\n\n/**\n * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList\n */\nfunction getStrongestMetadata (metadataList) {\n  // Let algorithm be the algo component of the first item in metadataList.\n  // Can be sha256\n  let algorithm = metadataList[0].algo\n  // If the algorithm is sha512, then it is the strongest\n  // and we can return immediately\n  if (algorithm[3] === '5') {\n    return algorithm\n  }\n\n  for (let i = 1; i < metadataList.length; ++i) {\n    const metadata = metadataList[i]\n    // If the algorithm is sha512, then it is the strongest\n    // and we can break the loop immediately\n    if (metadata.algo[3] === '5') {\n      algorithm = 'sha512'\n      break\n    // If the algorithm is sha384, then a potential sha256 or sha384 is ignored\n    } else if (algorithm[3] === '3') {\n      continue\n    // algorithm is sha256, check if algorithm is sha384 and if so, set it as\n    // the strongest\n    } else if (metadata.algo[3] === '3') {\n      algorithm = 'sha384'\n    }\n  }\n  return algorithm\n}\n\nfunction filterMetadataListByAlgorithm (metadataList, algorithm) {\n  if (metadataList.length === 1) {\n    return metadataList\n  }\n\n  let pos = 0\n  for (let i = 0; i < metadataList.length; ++i) {\n    if (metadataList[i].algo === algorithm) {\n      metadataList[pos++] = metadataList[i]\n    }\n  }\n\n  metadataList.length = pos\n\n  return metadataList\n}\n\n/**\n * Compares two base64 strings, allowing for base64url\n * in the second string.\n *\n* @param {string} actualValue always base64\n * @param {string} expectedValue base64 or base64url\n * @returns {boolean}\n */\nfunction compareBase64Mixed (actualValue, expectedValue) {\n  if (actualValue.length !== expectedValue.length) {\n    return false\n  }\n  for (let i = 0; i < actualValue.length; ++i) {\n    if (actualValue[i] !== expectedValue[i]) {\n      if (\n        (actualValue[i] === '+' && expectedValue[i] === '-') ||\n        (actualValue[i] === '/' && expectedValue[i] === '_')\n      ) {\n        continue\n      }\n      return false\n    }\n  }\n\n  return true\n}\n\n// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request\nfunction tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {\n  // TODO\n}\n\n/**\n * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}\n * @param {URL} A\n * @param {URL} B\n */\nfunction sameOrigin (A, B) {\n  // 1. If A and B are the same opaque origin, then return true.\n  if (A.origin === B.origin && A.origin === 'null') {\n    return true\n  }\n\n  // 2. If A and B are both tuple origins and their schemes,\n  //    hosts, and port are identical, then return true.\n  if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n    return true\n  }\n\n  // 3. Return false.\n  return false\n}\n\nfunction createDeferredPromise () {\n  let res\n  let rej\n  const promise = new Promise((resolve, reject) => {\n    res = resolve\n    rej = reject\n  })\n\n  return { promise, resolve: res, reject: rej }\n}\n\nfunction isAborted (fetchParams) {\n  return fetchParams.controller.state === 'aborted'\n}\n\nfunction isCancelled (fetchParams) {\n  return fetchParams.controller.state === 'aborted' ||\n    fetchParams.controller.state === 'terminated'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-method-normalize\n * @param {string} method\n */\nfunction normalizeMethod (method) {\n  return normalizedMethodRecordsBase[method.toLowerCase()] ?? method\n}\n\n// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string\nfunction serializeJavascriptValueToJSONString (value) {\n  // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).\n  const result = JSON.stringify(value)\n\n  // 2. If result is undefined, then throw a TypeError.\n  if (result === undefined) {\n    throw new TypeError('Value is not JSON serializable')\n  }\n\n  // 3. Assert: result is a string.\n  assert(typeof result === 'string')\n\n  // 4. Return result.\n  return result\n}\n\n// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object\nconst esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n  class FastIterableIterator {\n    /** @type {any} */\n    #target\n    /** @type {'key' | 'value' | 'key+value'} */\n    #kind\n    /** @type {number} */\n    #index\n\n    /**\n     * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object\n     * @param {unknown} target\n     * @param {'key' | 'value' | 'key+value'} kind\n     */\n    constructor (target, kind) {\n      this.#target = target\n      this.#kind = kind\n      this.#index = 0\n    }\n\n    next () {\n      // 1. Let interface be the interface for which the iterator prototype object exists.\n      // 2. Let thisValue be the this value.\n      // 3. Let object be ? ToObject(thisValue).\n      // 4. If object is a platform object, then perform a security\n      //    check, passing:\n      // 5. If object is not a default iterator object for interface,\n      //    then throw a TypeError.\n      if (typeof this !== 'object' || this === null || !(#target in this)) {\n        throw new TypeError(\n          `'next' called on an object that does not implement interface ${name} Iterator.`\n        )\n      }\n\n      // 6. Let index be object’s index.\n      // 7. Let kind be object’s kind.\n      // 8. Let values be object’s target's value pairs to iterate over.\n      const index = this.#index\n      const values = this.#target[kInternalIterator]\n\n      // 9. Let len be the length of values.\n      const len = values.length\n\n      // 10. If index is greater than or equal to len, then return\n      //     CreateIterResultObject(undefined, true).\n      if (index >= len) {\n        return {\n          value: undefined,\n          done: true\n        }\n      }\n\n      // 11. Let pair be the entry in values at index index.\n      const { [keyIndex]: key, [valueIndex]: value } = values[index]\n\n      // 12. Set object’s index to index + 1.\n      this.#index = index + 1\n\n      // 13. Return the iterator result for pair and kind.\n\n      // https://webidl.spec.whatwg.org/#iterator-result\n\n      // 1. Let result be a value determined by the value of kind:\n      let result\n      switch (this.#kind) {\n        case 'key':\n          // 1. Let idlKey be pair’s key.\n          // 2. Let key be the result of converting idlKey to an\n          //    ECMAScript value.\n          // 3. result is key.\n          result = key\n          break\n        case 'value':\n          // 1. Let idlValue be pair’s value.\n          // 2. Let value be the result of converting idlValue to\n          //    an ECMAScript value.\n          // 3. result is value.\n          result = value\n          break\n        case 'key+value':\n          // 1. Let idlKey be pair’s key.\n          // 2. Let idlValue be pair’s value.\n          // 3. Let key be the result of converting idlKey to an\n          //    ECMAScript value.\n          // 4. Let value be the result of converting idlValue to\n          //    an ECMAScript value.\n          // 5. Let array be ! ArrayCreate(2).\n          // 6. Call ! CreateDataProperty(array, \"0\", key).\n          // 7. Call ! CreateDataProperty(array, \"1\", value).\n          // 8. result is array.\n          result = [key, value]\n          break\n      }\n\n      // 2. Return CreateIterResultObject(result, false).\n      return {\n        value: result,\n        done: false\n      }\n    }\n  }\n\n  // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n  // @ts-ignore\n  delete FastIterableIterator.prototype.constructor\n\n  Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype)\n\n  Object.defineProperties(FastIterableIterator.prototype, {\n    [Symbol.toStringTag]: {\n      writable: false,\n      enumerable: false,\n      configurable: true,\n      value: `${name} Iterator`\n    },\n    next: { writable: true, enumerable: true, configurable: true }\n  })\n\n  /**\n   * @param {unknown} target\n   * @param {'key' | 'value' | 'key+value'} kind\n   * @returns {IterableIterator}\n   */\n  return function (target, kind) {\n    return new FastIterableIterator(target, kind)\n  }\n}\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {any} object class\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n  const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex)\n\n  const properties = {\n    keys: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function keys () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'key')\n      }\n    },\n    values: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function values () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'value')\n      }\n    },\n    entries: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function entries () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'key+value')\n      }\n    },\n    forEach: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function forEach (callbackfn, thisArg = globalThis) {\n        webidl.brandCheck(this, object)\n        webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`)\n        if (typeof callbackfn !== 'function') {\n          throw new TypeError(\n            `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`\n          )\n        }\n        for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) {\n          callbackfn.call(thisArg, value, key, this)\n        }\n      }\n    }\n  }\n\n  return Object.defineProperties(object.prototype, {\n    ...properties,\n    [Symbol.iterator]: {\n      writable: true,\n      enumerable: false,\n      configurable: true,\n      value: properties.entries.value\n    }\n  })\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-fully-read\n */\nasync function fullyReadBody (body, processBody, processBodyError) {\n  // 1. If taskDestination is null, then set taskDestination to\n  //    the result of starting a new parallel queue.\n\n  // 2. Let successSteps given a byte sequence bytes be to queue a\n  //    fetch task to run processBody given bytes, with taskDestination.\n  const successSteps = processBody\n\n  // 3. Let errorSteps be to queue a fetch task to run processBodyError,\n  //    with taskDestination.\n  const errorSteps = processBodyError\n\n  // 4. Let reader be the result of getting a reader for body’s stream.\n  //    If that threw an exception, then run errorSteps with that\n  //    exception and return.\n  let reader\n\n  try {\n    reader = body.stream.getReader()\n  } catch (e) {\n    errorSteps(e)\n    return\n  }\n\n  // 5. Read all bytes from reader, given successSteps and errorSteps.\n  try {\n    successSteps(await readAllBytes(reader))\n  } catch (e) {\n    errorSteps(e)\n  }\n}\n\nfunction isReadableStreamLike (stream) {\n  return stream instanceof ReadableStream || (\n    stream[Symbol.toStringTag] === 'ReadableStream' &&\n    typeof stream.tee === 'function'\n  )\n}\n\n/**\n * @param {ReadableStreamController} controller\n */\nfunction readableStreamClose (controller) {\n  try {\n    controller.close()\n    controller.byobRequest?.respond(0)\n  } catch (err) {\n    // TODO: add comment explaining why this error occurs.\n    if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {\n      throw err\n    }\n  }\n}\n\nconst invalidIsomorphicEncodeValueRegex = /[^\\x00-\\xFF]/ // eslint-disable-line\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-encode\n * @param {string} input\n */\nfunction isomorphicEncode (input) {\n  // 1. Assert: input contains no code points greater than U+00FF.\n  assert(!invalidIsomorphicEncodeValueRegex.test(input))\n\n  // 2. Return a byte sequence whose length is equal to input’s code\n  //    point length and whose bytes have the same values as the\n  //    values of input’s code points, in the same order\n  return input\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes\n * @see https://streams.spec.whatwg.org/#read-loop\n * @param {ReadableStreamDefaultReader} reader\n */\nasync function readAllBytes (reader) {\n  const bytes = []\n  let byteLength = 0\n\n  while (true) {\n    const { done, value: chunk } = await reader.read()\n\n    if (done) {\n      // 1. Call successSteps with bytes.\n      return Buffer.concat(bytes, byteLength)\n    }\n\n    // 1. If chunk is not a Uint8Array object, call failureSteps\n    //    with a TypeError and abort these steps.\n    if (!isUint8Array(chunk)) {\n      throw new TypeError('Received non-Uint8Array chunk')\n    }\n\n    // 2. Append the bytes represented by chunk to bytes.\n    bytes.push(chunk)\n    byteLength += chunk.length\n\n    // 3. Read-loop given reader, bytes, successSteps, and failureSteps.\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#is-local\n * @param {URL} url\n */\nfunction urlIsLocal (url) {\n  assert('protocol' in url) // ensure it's a url object\n\n  const protocol = url.protocol\n\n  return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'\n}\n\n/**\n * @param {string|URL} url\n * @returns {boolean}\n */\nfunction urlHasHttpsScheme (url) {\n  return (\n    (\n      typeof url === 'string' &&\n      url[5] === ':' &&\n      url[0] === 'h' &&\n      url[1] === 't' &&\n      url[2] === 't' &&\n      url[3] === 'p' &&\n      url[4] === 's'\n    ) ||\n    url.protocol === 'https:'\n  )\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-scheme\n * @param {URL} url\n */\nfunction urlIsHttpHttpsScheme (url) {\n  assert('protocol' in url) // ensure it's a url object\n\n  const protocol = url.protocol\n\n  return protocol === 'http:' || protocol === 'https:'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#simple-range-header-value\n * @param {string} value\n * @param {boolean} allowWhitespace\n */\nfunction simpleRangeHeaderValue (value, allowWhitespace) {\n  // 1. Let data be the isomorphic decoding of value.\n  // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string,\n  // nothing more. We obviously don't need to do that if value is a string already.\n  const data = value\n\n  // 2. If data does not start with \"bytes\", then return failure.\n  if (!data.startsWith('bytes')) {\n    return 'failure'\n  }\n\n  // 3. Let position be a position variable for data, initially pointing at the 5th code point of data.\n  const position = { position: 5 }\n\n  // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n  //    from data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 5. If the code point at position within data is not U+003D (=), then return failure.\n  if (data.charCodeAt(position.position) !== 0x3D) {\n    return 'failure'\n  }\n\n  // 6. Advance position by 1.\n  position.position++\n\n  // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from\n  //    data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits,\n  //    from data given position.\n  const rangeStart = collectASequenceOfCodePoints(\n    (char) => {\n      const code = char.charCodeAt(0)\n\n      return code >= 0x30 && code <= 0x39\n    },\n    data,\n    position\n  )\n\n  // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the\n  //    empty string; otherwise null.\n  const rangeStartValue = rangeStart.length ? Number(rangeStart) : null\n\n  // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n  //     from data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 11. If the code point at position within data is not U+002D (-), then return failure.\n  if (data.charCodeAt(position.position) !== 0x2D) {\n    return 'failure'\n  }\n\n  // 12. Advance position by 1.\n  position.position++\n\n  // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab\n  //     or space, from data given position.\n  // Note from Khafra: its the same step as in #8 again lol\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 14. Let rangeEnd be the result of collecting a sequence of code points that are\n  //     ASCII digits, from data given position.\n  // Note from Khafra: you wouldn't guess it, but this is also the same step as #8\n  const rangeEnd = collectASequenceOfCodePoints(\n    (char) => {\n      const code = char.charCodeAt(0)\n\n      return code >= 0x30 && code <= 0x39\n    },\n    data,\n    position\n  )\n\n  // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd\n  //     is not the empty string; otherwise null.\n  // Note from Khafra: THE SAME STEP, AGAIN!!!\n  // Note: why interpret as a decimal if we only collect ascii digits?\n  const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null\n\n  // 16. If position is not past the end of data, then return failure.\n  if (position.position < data.length) {\n    return 'failure'\n  }\n\n  // 17. If rangeEndValue and rangeStartValue are null, then return failure.\n  if (rangeEndValue === null && rangeStartValue === null) {\n    return 'failure'\n  }\n\n  // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is\n  //     greater than rangeEndValue, then return failure.\n  // Note: ... when can they not be numbers?\n  if (rangeStartValue > rangeEndValue) {\n    return 'failure'\n  }\n\n  // 19. Return (rangeStartValue, rangeEndValue).\n  return { rangeStartValue, rangeEndValue }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#build-a-content-range\n * @param {number} rangeStart\n * @param {number} rangeEnd\n * @param {number} fullLength\n */\nfunction buildContentRange (rangeStart, rangeEnd, fullLength) {\n  // 1. Let contentRange be `bytes `.\n  let contentRange = 'bytes '\n\n  // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange.\n  contentRange += isomorphicEncode(`${rangeStart}`)\n\n  // 3. Append 0x2D (-) to contentRange.\n  contentRange += '-'\n\n  // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange.\n  contentRange += isomorphicEncode(`${rangeEnd}`)\n\n  // 5. Append 0x2F (/) to contentRange.\n  contentRange += '/'\n\n  // 6. Append fullLength, serialized and isomorphic encoded to contentRange.\n  contentRange += isomorphicEncode(`${fullLength}`)\n\n  // 7. Return contentRange.\n  return contentRange\n}\n\n// A Stream, which pipes the response to zlib.createInflate() or\n// zlib.createInflateRaw() depending on the first byte of the Buffer.\n// If the lower byte of the first byte is 0x08, then the stream is\n// interpreted as a zlib stream, otherwise it's interpreted as a\n// raw deflate stream.\nclass InflateStream extends Transform {\n  #zlibOptions\n\n  /** @param {zlib.ZlibOptions} [zlibOptions] */\n  constructor (zlibOptions) {\n    super()\n    this.#zlibOptions = zlibOptions\n  }\n\n  _transform (chunk, encoding, callback) {\n    if (!this._inflateStream) {\n      if (chunk.length === 0) {\n        callback()\n        return\n      }\n      this._inflateStream = (chunk[0] & 0x0F) === 0x08\n        ? zlib.createInflate(this.#zlibOptions)\n        : zlib.createInflateRaw(this.#zlibOptions)\n\n      this._inflateStream.on('data', this.push.bind(this))\n      this._inflateStream.on('end', () => this.push(null))\n      this._inflateStream.on('error', (err) => this.destroy(err))\n    }\n\n    this._inflateStream.write(chunk, encoding, callback)\n  }\n\n  _final (callback) {\n    if (this._inflateStream) {\n      this._inflateStream.end()\n      this._inflateStream = null\n    }\n    callback()\n  }\n}\n\n/**\n * @param {zlib.ZlibOptions} [zlibOptions]\n * @returns {InflateStream}\n */\nfunction createInflate (zlibOptions) {\n  return new InflateStream(zlibOptions)\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type\n * @param {import('./headers').HeadersList} headers\n */\nfunction extractMimeType (headers) {\n  // 1. Let charset be null.\n  let charset = null\n\n  // 2. Let essence be null.\n  let essence = null\n\n  // 3. Let mimeType be null.\n  let mimeType = null\n\n  // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers.\n  const values = getDecodeSplit('content-type', headers)\n\n  // 5. If values is null, then return failure.\n  if (values === null) {\n    return 'failure'\n  }\n\n  // 6. For each value of values:\n  for (const value of values) {\n    // 6.1. Let temporaryMimeType be the result of parsing value.\n    const temporaryMimeType = parseMIMEType(value)\n\n    // 6.2. If temporaryMimeType is failure or its essence is \"*/*\", then continue.\n    if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') {\n      continue\n    }\n\n    // 6.3. Set mimeType to temporaryMimeType.\n    mimeType = temporaryMimeType\n\n    // 6.4. If mimeType’s essence is not essence, then:\n    if (mimeType.essence !== essence) {\n      // 6.4.1. Set charset to null.\n      charset = null\n\n      // 6.4.2. If mimeType’s parameters[\"charset\"] exists, then set charset to\n      //        mimeType’s parameters[\"charset\"].\n      if (mimeType.parameters.has('charset')) {\n        charset = mimeType.parameters.get('charset')\n      }\n\n      // 6.4.3. Set essence to mimeType’s essence.\n      essence = mimeType.essence\n    } else if (!mimeType.parameters.has('charset') && charset !== null) {\n      // 6.5. Otherwise, if mimeType’s parameters[\"charset\"] does not exist, and\n      //      charset is non-null, set mimeType’s parameters[\"charset\"] to charset.\n      mimeType.parameters.set('charset', charset)\n    }\n  }\n\n  // 7. If mimeType is null, then return failure.\n  if (mimeType == null) {\n    return 'failure'\n  }\n\n  // 8. Return mimeType.\n  return mimeType\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split\n * @param {string|null} value\n */\nfunction gettingDecodingSplitting (value) {\n  // 1. Let input be the result of isomorphic decoding value.\n  const input = value\n\n  // 2. Let position be a position variable for input, initially pointing at the start of input.\n  const position = { position: 0 }\n\n  // 3. Let values be a list of strings, initially empty.\n  const values = []\n\n  // 4. Let temporaryValue be the empty string.\n  let temporaryValue = ''\n\n  // 5. While position is not past the end of input:\n  while (position.position < input.length) {\n    // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (\")\n    //      or U+002C (,) from input, given position, to temporaryValue.\n    temporaryValue += collectASequenceOfCodePoints(\n      (char) => char !== '\"' && char !== ',',\n      input,\n      position\n    )\n\n    // 5.2. If position is not past the end of input, then:\n    if (position.position < input.length) {\n      // 5.2.1. If the code point at position within input is U+0022 (\"), then:\n      if (input.charCodeAt(position.position) === 0x22) {\n        // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue.\n        temporaryValue += collectAnHTTPQuotedString(\n          input,\n          position\n        )\n\n        // 5.2.1.2. If position is not past the end of input, then continue.\n        if (position.position < input.length) {\n          continue\n        }\n      } else {\n        // 5.2.2. Otherwise:\n\n        // 5.2.2.1. Assert: the code point at position within input is U+002C (,).\n        assert(input.charCodeAt(position.position) === 0x2C)\n\n        // 5.2.2.2. Advance position by 1.\n        position.position++\n      }\n    }\n\n    // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue.\n    temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20)\n\n    // 5.4. Append temporaryValue to values.\n    values.push(temporaryValue)\n\n    // 5.6. Set temporaryValue to the empty string.\n    temporaryValue = ''\n  }\n\n  // 6. Return values.\n  return values\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split\n * @param {string} name lowercase header name\n * @param {import('./headers').HeadersList} list\n */\nfunction getDecodeSplit (name, list) {\n  // 1. Let value be the result of getting name from list.\n  const value = list.get(name, true)\n\n  // 2. If value is null, then return null.\n  if (value === null) {\n    return null\n  }\n\n  // 3. Return the result of getting, decoding, and splitting value.\n  return gettingDecodingSplitting(value)\n}\n\nconst textDecoder = new TextDecoder()\n\n/**\n * @see https://encoding.spec.whatwg.org/#utf-8-decode\n * @param {Buffer} buffer\n */\nfunction utf8DecodeBytes (buffer) {\n  if (buffer.length === 0) {\n    return ''\n  }\n\n  // 1. Let buffer be the result of peeking three bytes from\n  //    ioQueue, converted to a byte sequence.\n\n  // 2. If buffer is 0xEF 0xBB 0xBF, then read three\n  //    bytes from ioQueue. (Do nothing with those bytes.)\n  if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {\n    buffer = buffer.subarray(3)\n  }\n\n  // 3. Process a queue with an instance of UTF-8’s\n  //    decoder, ioQueue, output, and \"replacement\".\n  const output = textDecoder.decode(buffer)\n\n  // 4. Return output.\n  return output\n}\n\nclass EnvironmentSettingsObjectBase {\n  get baseUrl () {\n    return getGlobalOrigin()\n  }\n\n  get origin () {\n    return this.baseUrl?.origin\n  }\n\n  policyContainer = makePolicyContainer()\n}\n\nclass EnvironmentSettingsObject {\n  settingsObject = new EnvironmentSettingsObjectBase()\n}\n\nconst environmentSettingsObject = new EnvironmentSettingsObject()\n\nmodule.exports = {\n  isAborted,\n  isCancelled,\n  isValidEncodedURL,\n  createDeferredPromise,\n  ReadableStreamFrom,\n  tryUpgradeRequestToAPotentiallyTrustworthyURL,\n  clampAndCoarsenConnectionTimingInfo,\n  coarsenedSharedCurrentTime,\n  determineRequestsReferrer,\n  makePolicyContainer,\n  clonePolicyContainer,\n  appendFetchMetadata,\n  appendRequestOriginHeader,\n  TAOCheck,\n  corsCheck,\n  crossOriginResourcePolicyCheck,\n  createOpaqueTimingInfo,\n  setRequestReferrerPolicyOnRedirect,\n  isValidHTTPToken,\n  requestBadPort,\n  requestCurrentURL,\n  responseURL,\n  responseLocationURL,\n  isBlobLike,\n  isURLPotentiallyTrustworthy,\n  isValidReasonPhrase,\n  sameOrigin,\n  normalizeMethod,\n  serializeJavascriptValueToJSONString,\n  iteratorMixin,\n  createIterator,\n  isValidHeaderName,\n  isValidHeaderValue,\n  isErrorLike,\n  fullyReadBody,\n  bytesMatch,\n  isReadableStreamLike,\n  readableStreamClose,\n  isomorphicEncode,\n  urlIsLocal,\n  urlHasHttpsScheme,\n  urlIsHttpHttpsScheme,\n  readAllBytes,\n  simpleRangeHeaderValue,\n  buildContentRange,\n  parseMetadata,\n  createInflate,\n  extractMimeType,\n  getDecodeSplit,\n  utf8DecodeBytes,\n  environmentSettingsObject\n}\n","'use strict'\n\nconst { types, inspect } = require('node:util')\nconst { markAsUncloneable } = require('node:worker_threads')\nconst { toUSVString } = require('../../core/util')\n\n/** @type {import('../../../types/webidl').Webidl} */\nconst webidl = {}\nwebidl.converters = {}\nwebidl.util = {}\nwebidl.errors = {}\n\nwebidl.errors.exception = function (message) {\n  return new TypeError(`${message.header}: ${message.message}`)\n}\n\nwebidl.errors.conversionFailed = function (context) {\n  const plural = context.types.length === 1 ? '' : ' one of'\n  const message =\n    `${context.argument} could not be converted to` +\n    `${plural}: ${context.types.join(', ')}.`\n\n  return webidl.errors.exception({\n    header: context.prefix,\n    message\n  })\n}\n\nwebidl.errors.invalidArgument = function (context) {\n  return webidl.errors.exception({\n    header: context.prefix,\n    message: `\"${context.value}\" is an invalid ${context.type}.`\n  })\n}\n\n// https://webidl.spec.whatwg.org/#implements\nwebidl.brandCheck = function (V, I, opts) {\n  if (opts?.strict !== false) {\n    if (!(V instanceof I)) {\n      const err = new TypeError('Illegal invocation')\n      err.code = 'ERR_INVALID_THIS' // node compat.\n      throw err\n    }\n  } else {\n    if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {\n      const err = new TypeError('Illegal invocation')\n      err.code = 'ERR_INVALID_THIS' // node compat.\n      throw err\n    }\n  }\n}\n\nwebidl.argumentLengthCheck = function ({ length }, min, ctx) {\n  if (length < min) {\n    throw webidl.errors.exception({\n      message: `${min} argument${min !== 1 ? 's' : ''} required, ` +\n               `but${length ? ' only' : ''} ${length} found.`,\n      header: ctx\n    })\n  }\n}\n\nwebidl.illegalConstructor = function () {\n  throw webidl.errors.exception({\n    header: 'TypeError',\n    message: 'Illegal constructor'\n  })\n}\n\n// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\nwebidl.util.Type = function (V) {\n  switch (typeof V) {\n    case 'undefined': return 'Undefined'\n    case 'boolean': return 'Boolean'\n    case 'string': return 'String'\n    case 'symbol': return 'Symbol'\n    case 'number': return 'Number'\n    case 'bigint': return 'BigInt'\n    case 'function':\n    case 'object': {\n      if (V === null) {\n        return 'Null'\n      }\n\n      return 'Object'\n    }\n  }\n}\n\nwebidl.util.markAsUncloneable = markAsUncloneable || (() => {})\n// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint\nwebidl.util.ConvertToInt = function (V, bitLength, signedness, opts) {\n  let upperBound\n  let lowerBound\n\n  // 1. If bitLength is 64, then:\n  if (bitLength === 64) {\n    // 1. Let upperBound be 2^53 − 1.\n    upperBound = Math.pow(2, 53) - 1\n\n    // 2. If signedness is \"unsigned\", then let lowerBound be 0.\n    if (signedness === 'unsigned') {\n      lowerBound = 0\n    } else {\n      // 3. Otherwise let lowerBound be −2^53 + 1.\n      lowerBound = Math.pow(-2, 53) + 1\n    }\n  } else if (signedness === 'unsigned') {\n    // 2. Otherwise, if signedness is \"unsigned\", then:\n\n    // 1. Let lowerBound be 0.\n    lowerBound = 0\n\n    // 2. Let upperBound be 2^bitLength − 1.\n    upperBound = Math.pow(2, bitLength) - 1\n  } else {\n    // 3. Otherwise:\n\n    // 1. Let lowerBound be -2^bitLength − 1.\n    lowerBound = Math.pow(-2, bitLength) - 1\n\n    // 2. Let upperBound be 2^bitLength − 1 − 1.\n    upperBound = Math.pow(2, bitLength - 1) - 1\n  }\n\n  // 4. Let x be ? ToNumber(V).\n  let x = Number(V)\n\n  // 5. If x is −0, then set x to +0.\n  if (x === 0) {\n    x = 0\n  }\n\n  // 6. If the conversion is to an IDL type associated\n  //    with the [EnforceRange] extended attribute, then:\n  if (opts?.enforceRange === true) {\n    // 1. If x is NaN, +∞, or −∞, then throw a TypeError.\n    if (\n      Number.isNaN(x) ||\n      x === Number.POSITIVE_INFINITY ||\n      x === Number.NEGATIVE_INFINITY\n    ) {\n      throw webidl.errors.exception({\n        header: 'Integer conversion',\n        message: `Could not convert ${webidl.util.Stringify(V)} to an integer.`\n      })\n    }\n\n    // 2. Set x to IntegerPart(x).\n    x = webidl.util.IntegerPart(x)\n\n    // 3. If x < lowerBound or x > upperBound, then\n    //    throw a TypeError.\n    if (x < lowerBound || x > upperBound) {\n      throw webidl.errors.exception({\n        header: 'Integer conversion',\n        message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n      })\n    }\n\n    // 4. Return x.\n    return x\n  }\n\n  // 7. If x is not NaN and the conversion is to an IDL\n  //    type associated with the [Clamp] extended\n  //    attribute, then:\n  if (!Number.isNaN(x) && opts?.clamp === true) {\n    // 1. Set x to min(max(x, lowerBound), upperBound).\n    x = Math.min(Math.max(x, lowerBound), upperBound)\n\n    // 2. Round x to the nearest integer, choosing the\n    //    even integer if it lies halfway between two,\n    //    and choosing +0 rather than −0.\n    if (Math.floor(x) % 2 === 0) {\n      x = Math.floor(x)\n    } else {\n      x = Math.ceil(x)\n    }\n\n    // 3. Return x.\n    return x\n  }\n\n  // 8. If x is NaN, +0, +∞, or −∞, then return +0.\n  if (\n    Number.isNaN(x) ||\n    (x === 0 && Object.is(0, x)) ||\n    x === Number.POSITIVE_INFINITY ||\n    x === Number.NEGATIVE_INFINITY\n  ) {\n    return 0\n  }\n\n  // 9. Set x to IntegerPart(x).\n  x = webidl.util.IntegerPart(x)\n\n  // 10. Set x to x modulo 2^bitLength.\n  x = x % Math.pow(2, bitLength)\n\n  // 11. If signedness is \"signed\" and x ≥ 2^bitLength − 1,\n  //    then return x − 2^bitLength.\n  if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {\n    return x - Math.pow(2, bitLength)\n  }\n\n  // 12. Otherwise, return x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart\nwebidl.util.IntegerPart = function (n) {\n  // 1. Let r be floor(abs(n)).\n  const r = Math.floor(Math.abs(n))\n\n  // 2. If n < 0, then return -1 × r.\n  if (n < 0) {\n    return -1 * r\n  }\n\n  // 3. Otherwise, return r.\n  return r\n}\n\nwebidl.util.Stringify = function (V) {\n  const type = webidl.util.Type(V)\n\n  switch (type) {\n    case 'Symbol':\n      return `Symbol(${V.description})`\n    case 'Object':\n      return inspect(V)\n    case 'String':\n      return `\"${V}\"`\n    default:\n      return `${V}`\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-sequence\nwebidl.sequenceConverter = function (converter) {\n  return (V, prefix, argument, Iterable) => {\n    // 1. If Type(V) is not Object, throw a TypeError.\n    if (webidl.util.Type(V) !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.`\n      })\n    }\n\n    // 2. Let method be ? GetMethod(V, @@iterator).\n    /** @type {Generator} */\n    const method = typeof Iterable === 'function' ? Iterable() : V?.[Symbol.iterator]?.()\n    const seq = []\n    let index = 0\n\n    // 3. If method is undefined, throw a TypeError.\n    if (\n      method === undefined ||\n      typeof method.next !== 'function'\n    ) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} is not iterable.`\n      })\n    }\n\n    // https://webidl.spec.whatwg.org/#create-sequence-from-iterable\n    while (true) {\n      const { done, value } = method.next()\n\n      if (done) {\n        break\n      }\n\n      seq.push(converter(value, prefix, `${argument}[${index++}]`))\n    }\n\n    return seq\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-to-record\nwebidl.recordConverter = function (keyConverter, valueConverter) {\n  return (O, prefix, argument) => {\n    // 1. If Type(O) is not Object, throw a TypeError.\n    if (webidl.util.Type(O) !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} (\"${webidl.util.Type(O)}\") is not an Object.`\n      })\n    }\n\n    // 2. Let result be a new empty instance of record.\n    const result = {}\n\n    if (!types.isProxy(O)) {\n      // 1. Let desc be ? O.[[GetOwnProperty]](key).\n      const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]\n\n      for (const key of keys) {\n        // 1. Let typedKey be key converted to an IDL value of type K.\n        const typedKey = keyConverter(key, prefix, argument)\n\n        // 2. Let value be ? Get(O, key).\n        // 3. Let typedValue be value converted to an IDL value of type V.\n        const typedValue = valueConverter(O[key], prefix, argument)\n\n        // 4. Set result[typedKey] to typedValue.\n        result[typedKey] = typedValue\n      }\n\n      // 5. Return result.\n      return result\n    }\n\n    // 3. Let keys be ? O.[[OwnPropertyKeys]]().\n    const keys = Reflect.ownKeys(O)\n\n    // 4. For each key of keys.\n    for (const key of keys) {\n      // 1. Let desc be ? O.[[GetOwnProperty]](key).\n      const desc = Reflect.getOwnPropertyDescriptor(O, key)\n\n      // 2. If desc is not undefined and desc.[[Enumerable]] is true:\n      if (desc?.enumerable) {\n        // 1. Let typedKey be key converted to an IDL value of type K.\n        const typedKey = keyConverter(key, prefix, argument)\n\n        // 2. Let value be ? Get(O, key).\n        // 3. Let typedValue be value converted to an IDL value of type V.\n        const typedValue = valueConverter(O[key], prefix, argument)\n\n        // 4. Set result[typedKey] to typedValue.\n        result[typedKey] = typedValue\n      }\n    }\n\n    // 5. Return result.\n    return result\n  }\n}\n\nwebidl.interfaceConverter = function (i) {\n  return (V, prefix, argument, opts) => {\n    if (opts?.strict !== false && !(V instanceof i)) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `Expected ${argument} (\"${webidl.util.Stringify(V)}\") to be an instance of ${i.name}.`\n      })\n    }\n\n    return V\n  }\n}\n\nwebidl.dictionaryConverter = function (converters) {\n  return (dictionary, prefix, argument) => {\n    const type = webidl.util.Type(dictionary)\n    const dict = {}\n\n    if (type === 'Null' || type === 'Undefined') {\n      return dict\n    } else if (type !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n      })\n    }\n\n    for (const options of converters) {\n      const { key, defaultValue, required, converter } = options\n\n      if (required === true) {\n        if (!Object.hasOwn(dictionary, key)) {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: `Missing required key \"${key}\".`\n          })\n        }\n      }\n\n      let value = dictionary[key]\n      const hasDefault = Object.hasOwn(options, 'defaultValue')\n\n      // Only use defaultValue if value is undefined and\n      // a defaultValue options was provided.\n      if (hasDefault && value !== null) {\n        value ??= defaultValue()\n      }\n\n      // A key can be optional and have no default value.\n      // When this happens, do not perform a conversion,\n      // and do not assign the key a value.\n      if (required || hasDefault || value !== undefined) {\n        value = converter(value, prefix, `${argument}.${key}`)\n\n        if (\n          options.allowedValues &&\n          !options.allowedValues.includes(value)\n        ) {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`\n          })\n        }\n\n        dict[key] = value\n      }\n    }\n\n    return dict\n  }\n}\n\nwebidl.nullableConverter = function (converter) {\n  return (V, prefix, argument) => {\n    if (V === null) {\n      return V\n    }\n\n    return converter(V, prefix, argument)\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-DOMString\nwebidl.converters.DOMString = function (V, prefix, argument, opts) {\n  // 1. If V is null and the conversion is to an IDL type\n  //    associated with the [LegacyNullToEmptyString]\n  //    extended attribute, then return the DOMString value\n  //    that represents the empty string.\n  if (V === null && opts?.legacyNullToEmptyString) {\n    return ''\n  }\n\n  // 2. Let x be ? ToString(V).\n  if (typeof V === 'symbol') {\n    throw webidl.errors.exception({\n      header: prefix,\n      message: `${argument} is a symbol, which cannot be converted to a DOMString.`\n    })\n  }\n\n  // 3. Return the IDL DOMString value that represents the\n  //    same sequence of code units as the one the\n  //    ECMAScript String value x represents.\n  return String(V)\n}\n\n// https://webidl.spec.whatwg.org/#es-ByteString\nwebidl.converters.ByteString = function (V, prefix, argument) {\n  // 1. Let x be ? ToString(V).\n  // Note: DOMString converter perform ? ToString(V)\n  const x = webidl.converters.DOMString(V, prefix, argument)\n\n  // 2. If the value of any element of x is greater than\n  //    255, then throw a TypeError.\n  for (let index = 0; index < x.length; index++) {\n    if (x.charCodeAt(index) > 255) {\n      throw new TypeError(\n        'Cannot convert argument to a ByteString because the character at ' +\n        `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`\n      )\n    }\n  }\n\n  // 3. Return an IDL ByteString value whose length is the\n  //    length of x, and where the value of each element is\n  //    the value of the corresponding element of x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-USVString\n// TODO: rewrite this so we can control the errors thrown\nwebidl.converters.USVString = toUSVString\n\n// https://webidl.spec.whatwg.org/#es-boolean\nwebidl.converters.boolean = function (V) {\n  // 1. Let x be the result of computing ToBoolean(V).\n  const x = Boolean(V)\n\n  // 2. Return the IDL boolean value that is the one that represents\n  //    the same truth value as the ECMAScript Boolean value x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-any\nwebidl.converters.any = function (V) {\n  return V\n}\n\n// https://webidl.spec.whatwg.org/#es-long-long\nwebidl.converters['long long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 64, \"signed\").\n  const x = webidl.util.ConvertToInt(V, 64, 'signed', undefined, prefix, argument)\n\n  // 2. Return the IDL long long value that represents\n  //    the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long-long\nwebidl.converters['unsigned long long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 64, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 64, 'unsigned', undefined, prefix, argument)\n\n  // 2. Return the IDL unsigned long long value that\n  //    represents the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long\nwebidl.converters['unsigned long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 32, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 32, 'unsigned', undefined, prefix, argument)\n\n  // 2. Return the IDL unsigned long value that\n  //    represents the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-short\nwebidl.converters['unsigned short'] = function (V, prefix, argument, opts) {\n  // 1. Let x be ? ConvertToInt(V, 16, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts, prefix, argument)\n\n  // 2. Return the IDL unsigned short value that represents\n  //    the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#idl-ArrayBuffer\nwebidl.converters.ArrayBuffer = function (V, prefix, argument, opts) {\n  // 1. If Type(V) is not Object, or V does not have an\n  //    [[ArrayBufferData]] internal slot, then throw a\n  //    TypeError.\n  // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances\n  // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances\n  if (\n    webidl.util.Type(V) !== 'Object' ||\n    !types.isAnyArrayBuffer(V)\n  ) {\n    throw webidl.errors.conversionFailed({\n      prefix,\n      argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n      types: ['ArrayBuffer']\n    })\n  }\n\n  // 2. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V) is true, then throw a\n  //    TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V) is true, then throw a\n  //    TypeError.\n  if (V.resizable || V.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 4. Return the IDL ArrayBuffer value that is a\n  //    reference to the same object as V.\n  return V\n}\n\nwebidl.converters.TypedArray = function (V, T, prefix, name, opts) {\n  // 1. Let T be the IDL type V is being converted to.\n\n  // 2. If Type(V) is not Object, or V does not have a\n  //    [[TypedArrayName]] internal slot with a value\n  //    equal to T’s name, then throw a TypeError.\n  if (\n    webidl.util.Type(V) !== 'Object' ||\n    !types.isTypedArray(V) ||\n    V.constructor.name !== T.name\n  ) {\n    throw webidl.errors.conversionFailed({\n      prefix,\n      argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n      types: [T.name]\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 4. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (V.buffer.resizable || V.buffer.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 5. Return the IDL value of type T that is a reference\n  //    to the same object as V.\n  return V\n}\n\nwebidl.converters.DataView = function (V, prefix, name, opts) {\n  // 1. If Type(V) is not Object, or V does not have a\n  //    [[DataView]] internal slot, then throw a TypeError.\n  if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {\n    throw webidl.errors.exception({\n      header: prefix,\n      message: `${name} is not a DataView.`\n    })\n  }\n\n  // 2. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,\n  //    then throw a TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (V.buffer.resizable || V.buffer.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 4. Return the IDL DataView value that is a reference\n  //    to the same object as V.\n  return V\n}\n\n// https://webidl.spec.whatwg.org/#BufferSource\nwebidl.converters.BufferSource = function (V, prefix, name, opts) {\n  if (types.isAnyArrayBuffer(V)) {\n    return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false })\n  }\n\n  if (types.isTypedArray(V)) {\n    return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false })\n  }\n\n  if (types.isDataView(V)) {\n    return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false })\n  }\n\n  throw webidl.errors.conversionFailed({\n    prefix,\n    argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n    types: ['BufferSource']\n  })\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.ByteString\n)\n\nwebidl.converters['sequence>'] = webidl.sequenceConverter(\n  webidl.converters['sequence']\n)\n\nwebidl.converters['record'] = webidl.recordConverter(\n  webidl.converters.ByteString,\n  webidl.converters.ByteString\n)\n\nmodule.exports = {\n  webidl\n}\n","'use strict'\n\n/**\n * @see https://encoding.spec.whatwg.org/#concept-encoding-get\n * @param {string|undefined} label\n */\nfunction getEncoding (label) {\n  if (!label) {\n    return 'failure'\n  }\n\n  // 1. Remove any leading and trailing ASCII whitespace from label.\n  // 2. If label is an ASCII case-insensitive match for any of the\n  //    labels listed in the table below, then return the\n  //    corresponding encoding; otherwise return failure.\n  switch (label.trim().toLowerCase()) {\n    case 'unicode-1-1-utf-8':\n    case 'unicode11utf8':\n    case 'unicode20utf8':\n    case 'utf-8':\n    case 'utf8':\n    case 'x-unicode20utf8':\n      return 'UTF-8'\n    case '866':\n    case 'cp866':\n    case 'csibm866':\n    case 'ibm866':\n      return 'IBM866'\n    case 'csisolatin2':\n    case 'iso-8859-2':\n    case 'iso-ir-101':\n    case 'iso8859-2':\n    case 'iso88592':\n    case 'iso_8859-2':\n    case 'iso_8859-2:1987':\n    case 'l2':\n    case 'latin2':\n      return 'ISO-8859-2'\n    case 'csisolatin3':\n    case 'iso-8859-3':\n    case 'iso-ir-109':\n    case 'iso8859-3':\n    case 'iso88593':\n    case 'iso_8859-3':\n    case 'iso_8859-3:1988':\n    case 'l3':\n    case 'latin3':\n      return 'ISO-8859-3'\n    case 'csisolatin4':\n    case 'iso-8859-4':\n    case 'iso-ir-110':\n    case 'iso8859-4':\n    case 'iso88594':\n    case 'iso_8859-4':\n    case 'iso_8859-4:1988':\n    case 'l4':\n    case 'latin4':\n      return 'ISO-8859-4'\n    case 'csisolatincyrillic':\n    case 'cyrillic':\n    case 'iso-8859-5':\n    case 'iso-ir-144':\n    case 'iso8859-5':\n    case 'iso88595':\n    case 'iso_8859-5':\n    case 'iso_8859-5:1988':\n      return 'ISO-8859-5'\n    case 'arabic':\n    case 'asmo-708':\n    case 'csiso88596e':\n    case 'csiso88596i':\n    case 'csisolatinarabic':\n    case 'ecma-114':\n    case 'iso-8859-6':\n    case 'iso-8859-6-e':\n    case 'iso-8859-6-i':\n    case 'iso-ir-127':\n    case 'iso8859-6':\n    case 'iso88596':\n    case 'iso_8859-6':\n    case 'iso_8859-6:1987':\n      return 'ISO-8859-6'\n    case 'csisolatingreek':\n    case 'ecma-118':\n    case 'elot_928':\n    case 'greek':\n    case 'greek8':\n    case 'iso-8859-7':\n    case 'iso-ir-126':\n    case 'iso8859-7':\n    case 'iso88597':\n    case 'iso_8859-7':\n    case 'iso_8859-7:1987':\n    case 'sun_eu_greek':\n      return 'ISO-8859-7'\n    case 'csiso88598e':\n    case 'csisolatinhebrew':\n    case 'hebrew':\n    case 'iso-8859-8':\n    case 'iso-8859-8-e':\n    case 'iso-ir-138':\n    case 'iso8859-8':\n    case 'iso88598':\n    case 'iso_8859-8':\n    case 'iso_8859-8:1988':\n    case 'visual':\n      return 'ISO-8859-8'\n    case 'csiso88598i':\n    case 'iso-8859-8-i':\n    case 'logical':\n      return 'ISO-8859-8-I'\n    case 'csisolatin6':\n    case 'iso-8859-10':\n    case 'iso-ir-157':\n    case 'iso8859-10':\n    case 'iso885910':\n    case 'l6':\n    case 'latin6':\n      return 'ISO-8859-10'\n    case 'iso-8859-13':\n    case 'iso8859-13':\n    case 'iso885913':\n      return 'ISO-8859-13'\n    case 'iso-8859-14':\n    case 'iso8859-14':\n    case 'iso885914':\n      return 'ISO-8859-14'\n    case 'csisolatin9':\n    case 'iso-8859-15':\n    case 'iso8859-15':\n    case 'iso885915':\n    case 'iso_8859-15':\n    case 'l9':\n      return 'ISO-8859-15'\n    case 'iso-8859-16':\n      return 'ISO-8859-16'\n    case 'cskoi8r':\n    case 'koi':\n    case 'koi8':\n    case 'koi8-r':\n    case 'koi8_r':\n      return 'KOI8-R'\n    case 'koi8-ru':\n    case 'koi8-u':\n      return 'KOI8-U'\n    case 'csmacintosh':\n    case 'mac':\n    case 'macintosh':\n    case 'x-mac-roman':\n      return 'macintosh'\n    case 'iso-8859-11':\n    case 'iso8859-11':\n    case 'iso885911':\n    case 'tis-620':\n    case 'windows-874':\n      return 'windows-874'\n    case 'cp1250':\n    case 'windows-1250':\n    case 'x-cp1250':\n      return 'windows-1250'\n    case 'cp1251':\n    case 'windows-1251':\n    case 'x-cp1251':\n      return 'windows-1251'\n    case 'ansi_x3.4-1968':\n    case 'ascii':\n    case 'cp1252':\n    case 'cp819':\n    case 'csisolatin1':\n    case 'ibm819':\n    case 'iso-8859-1':\n    case 'iso-ir-100':\n    case 'iso8859-1':\n    case 'iso88591':\n    case 'iso_8859-1':\n    case 'iso_8859-1:1987':\n    case 'l1':\n    case 'latin1':\n    case 'us-ascii':\n    case 'windows-1252':\n    case 'x-cp1252':\n      return 'windows-1252'\n    case 'cp1253':\n    case 'windows-1253':\n    case 'x-cp1253':\n      return 'windows-1253'\n    case 'cp1254':\n    case 'csisolatin5':\n    case 'iso-8859-9':\n    case 'iso-ir-148':\n    case 'iso8859-9':\n    case 'iso88599':\n    case 'iso_8859-9':\n    case 'iso_8859-9:1989':\n    case 'l5':\n    case 'latin5':\n    case 'windows-1254':\n    case 'x-cp1254':\n      return 'windows-1254'\n    case 'cp1255':\n    case 'windows-1255':\n    case 'x-cp1255':\n      return 'windows-1255'\n    case 'cp1256':\n    case 'windows-1256':\n    case 'x-cp1256':\n      return 'windows-1256'\n    case 'cp1257':\n    case 'windows-1257':\n    case 'x-cp1257':\n      return 'windows-1257'\n    case 'cp1258':\n    case 'windows-1258':\n    case 'x-cp1258':\n      return 'windows-1258'\n    case 'x-mac-cyrillic':\n    case 'x-mac-ukrainian':\n      return 'x-mac-cyrillic'\n    case 'chinese':\n    case 'csgb2312':\n    case 'csiso58gb231280':\n    case 'gb2312':\n    case 'gb_2312':\n    case 'gb_2312-80':\n    case 'gbk':\n    case 'iso-ir-58':\n    case 'x-gbk':\n      return 'GBK'\n    case 'gb18030':\n      return 'gb18030'\n    case 'big5':\n    case 'big5-hkscs':\n    case 'cn-big5':\n    case 'csbig5':\n    case 'x-x-big5':\n      return 'Big5'\n    case 'cseucpkdfmtjapanese':\n    case 'euc-jp':\n    case 'x-euc-jp':\n      return 'EUC-JP'\n    case 'csiso2022jp':\n    case 'iso-2022-jp':\n      return 'ISO-2022-JP'\n    case 'csshiftjis':\n    case 'ms932':\n    case 'ms_kanji':\n    case 'shift-jis':\n    case 'shift_jis':\n    case 'sjis':\n    case 'windows-31j':\n    case 'x-sjis':\n      return 'Shift_JIS'\n    case 'cseuckr':\n    case 'csksc56011987':\n    case 'euc-kr':\n    case 'iso-ir-149':\n    case 'korean':\n    case 'ks_c_5601-1987':\n    case 'ks_c_5601-1989':\n    case 'ksc5601':\n    case 'ksc_5601':\n    case 'windows-949':\n      return 'EUC-KR'\n    case 'csiso2022kr':\n    case 'hz-gb-2312':\n    case 'iso-2022-cn':\n    case 'iso-2022-cn-ext':\n    case 'iso-2022-kr':\n    case 'replacement':\n      return 'replacement'\n    case 'unicodefffe':\n    case 'utf-16be':\n      return 'UTF-16BE'\n    case 'csunicode':\n    case 'iso-10646-ucs-2':\n    case 'ucs-2':\n    case 'unicode':\n    case 'unicodefeff':\n    case 'utf-16':\n    case 'utf-16le':\n      return 'UTF-16LE'\n    case 'x-user-defined':\n      return 'x-user-defined'\n    default: return 'failure'\n  }\n}\n\nmodule.exports = {\n  getEncoding\n}\n","'use strict'\n\nconst {\n  staticPropertyDescriptors,\n  readOperation,\n  fireAProgressEvent\n} = require('./util')\nconst {\n  kState,\n  kError,\n  kResult,\n  kEvents,\n  kAborted\n} = require('./symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass FileReader extends EventTarget {\n  constructor () {\n    super()\n\n    this[kState] = 'empty'\n    this[kResult] = null\n    this[kError] = null\n    this[kEvents] = {\n      loadend: null,\n      error: null,\n      abort: null,\n      load: null,\n      progress: null,\n      loadstart: null\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer\n   * @param {import('buffer').Blob} blob\n   */\n  readAsArrayBuffer (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsArrayBuffer')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsArrayBuffer(blob) method, when invoked,\n    // must initiate a read operation for blob with ArrayBuffer.\n    readOperation(this, blob, 'ArrayBuffer')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#readAsBinaryString\n   * @param {import('buffer').Blob} blob\n   */\n  readAsBinaryString (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsBinaryString')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsBinaryString(blob) method, when invoked,\n    // must initiate a read operation for blob with BinaryString.\n    readOperation(this, blob, 'BinaryString')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#readAsDataText\n   * @param {import('buffer').Blob} blob\n   * @param {string?} encoding\n   */\n  readAsText (blob, encoding = undefined) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsText')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    if (encoding !== undefined) {\n      encoding = webidl.converters.DOMString(encoding, 'FileReader.readAsText', 'encoding')\n    }\n\n    // The readAsText(blob, encoding) method, when invoked,\n    // must initiate a read operation for blob with Text and encoding.\n    readOperation(this, blob, 'Text', encoding)\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL\n   * @param {import('buffer').Blob} blob\n   */\n  readAsDataURL (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsDataURL')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsDataURL(blob) method, when invoked, must\n    // initiate a read operation for blob with DataURL.\n    readOperation(this, blob, 'DataURL')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-abort\n   */\n  abort () {\n    // 1. If this's state is \"empty\" or if this's state is\n    //    \"done\" set this's result to null and terminate\n    //    this algorithm.\n    if (this[kState] === 'empty' || this[kState] === 'done') {\n      this[kResult] = null\n      return\n    }\n\n    // 2. If this's state is \"loading\" set this's state to\n    //    \"done\" and set this's result to null.\n    if (this[kState] === 'loading') {\n      this[kState] = 'done'\n      this[kResult] = null\n    }\n\n    // 3. If there are any tasks from this on the file reading\n    //    task source in an affiliated task queue, then remove\n    //    those tasks from that task queue.\n    this[kAborted] = true\n\n    // 4. Terminate the algorithm for the read method being processed.\n    // TODO\n\n    // 5. Fire a progress event called abort at this.\n    fireAProgressEvent('abort', this)\n\n    // 6. If this's state is not \"loading\", fire a progress\n    //    event called loadend at this.\n    if (this[kState] !== 'loading') {\n      fireAProgressEvent('loadend', this)\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate\n   */\n  get readyState () {\n    webidl.brandCheck(this, FileReader)\n\n    switch (this[kState]) {\n      case 'empty': return this.EMPTY\n      case 'loading': return this.LOADING\n      case 'done': return this.DONE\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-result\n   */\n  get result () {\n    webidl.brandCheck(this, FileReader)\n\n    // The result attribute’s getter, when invoked, must return\n    // this's result.\n    return this[kResult]\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-error\n   */\n  get error () {\n    webidl.brandCheck(this, FileReader)\n\n    // The error attribute’s getter, when invoked, must return\n    // this's error.\n    return this[kError]\n  }\n\n  get onloadend () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].loadend\n  }\n\n  set onloadend (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].loadend) {\n      this.removeEventListener('loadend', this[kEvents].loadend)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].loadend = fn\n      this.addEventListener('loadend', fn)\n    } else {\n      this[kEvents].loadend = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].error) {\n      this.removeEventListener('error', this[kEvents].error)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this[kEvents].error = null\n    }\n  }\n\n  get onloadstart () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].loadstart\n  }\n\n  set onloadstart (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].loadstart) {\n      this.removeEventListener('loadstart', this[kEvents].loadstart)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].loadstart = fn\n      this.addEventListener('loadstart', fn)\n    } else {\n      this[kEvents].loadstart = null\n    }\n  }\n\n  get onprogress () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].progress\n  }\n\n  set onprogress (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].progress) {\n      this.removeEventListener('progress', this[kEvents].progress)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].progress = fn\n      this.addEventListener('progress', fn)\n    } else {\n      this[kEvents].progress = null\n    }\n  }\n\n  get onload () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].load\n  }\n\n  set onload (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].load) {\n      this.removeEventListener('load', this[kEvents].load)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].load = fn\n      this.addEventListener('load', fn)\n    } else {\n      this[kEvents].load = null\n    }\n  }\n\n  get onabort () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].abort\n  }\n\n  set onabort (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].abort) {\n      this.removeEventListener('abort', this[kEvents].abort)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].abort = fn\n      this.addEventListener('abort', fn)\n    } else {\n      this[kEvents].abort = null\n    }\n  }\n}\n\n// https://w3c.github.io/FileAPI/#dom-filereader-empty\nFileReader.EMPTY = FileReader.prototype.EMPTY = 0\n// https://w3c.github.io/FileAPI/#dom-filereader-loading\nFileReader.LOADING = FileReader.prototype.LOADING = 1\n// https://w3c.github.io/FileAPI/#dom-filereader-done\nFileReader.DONE = FileReader.prototype.DONE = 2\n\nObject.defineProperties(FileReader.prototype, {\n  EMPTY: staticPropertyDescriptors,\n  LOADING: staticPropertyDescriptors,\n  DONE: staticPropertyDescriptors,\n  readAsArrayBuffer: kEnumerableProperty,\n  readAsBinaryString: kEnumerableProperty,\n  readAsText: kEnumerableProperty,\n  readAsDataURL: kEnumerableProperty,\n  abort: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  result: kEnumerableProperty,\n  error: kEnumerableProperty,\n  onloadstart: kEnumerableProperty,\n  onprogress: kEnumerableProperty,\n  onload: kEnumerableProperty,\n  onabort: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onloadend: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'FileReader',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(FileReader, {\n  EMPTY: staticPropertyDescriptors,\n  LOADING: staticPropertyDescriptors,\n  DONE: staticPropertyDescriptors\n})\n\nmodule.exports = {\n  FileReader\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\n\nconst kState = Symbol('ProgressEvent state')\n\n/**\n * @see https://xhr.spec.whatwg.org/#progressevent\n */\nclass ProgressEvent extends Event {\n  constructor (type, eventInitDict = {}) {\n    type = webidl.converters.DOMString(type, 'ProgressEvent constructor', 'type')\n    eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})\n\n    super(type, eventInitDict)\n\n    this[kState] = {\n      lengthComputable: eventInitDict.lengthComputable,\n      loaded: eventInitDict.loaded,\n      total: eventInitDict.total\n    }\n  }\n\n  get lengthComputable () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].lengthComputable\n  }\n\n  get loaded () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].loaded\n  }\n\n  get total () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].total\n  }\n}\n\nwebidl.converters.ProgressEventInit = webidl.dictionaryConverter([\n  {\n    key: 'lengthComputable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'loaded',\n    converter: webidl.converters['unsigned long long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'total',\n    converter: webidl.converters['unsigned long long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'bubbles',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'cancelable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'composed',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n])\n\nmodule.exports = {\n  ProgressEvent\n}\n","'use strict'\n\nmodule.exports = {\n  kState: Symbol('FileReader state'),\n  kResult: Symbol('FileReader result'),\n  kError: Symbol('FileReader error'),\n  kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),\n  kEvents: Symbol('FileReader events'),\n  kAborted: Symbol('FileReader aborted')\n}\n","'use strict'\n\nconst {\n  kState,\n  kError,\n  kResult,\n  kAborted,\n  kLastProgressEventFired\n} = require('./symbols')\nconst { ProgressEvent } = require('./progressevent')\nconst { getEncoding } = require('./encoding')\nconst { serializeAMimeType, parseMIMEType } = require('../fetch/data-url')\nconst { types } = require('node:util')\nconst { StringDecoder } = require('string_decoder')\nconst { btoa } = require('node:buffer')\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n  enumerable: true,\n  writable: false,\n  configurable: false\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#readOperation\n * @param {import('./filereader').FileReader} fr\n * @param {import('buffer').Blob} blob\n * @param {string} type\n * @param {string?} encodingName\n */\nfunction readOperation (fr, blob, type, encodingName) {\n  // 1. If fr’s state is \"loading\", throw an InvalidStateError\n  //    DOMException.\n  if (fr[kState] === 'loading') {\n    throw new DOMException('Invalid state', 'InvalidStateError')\n  }\n\n  // 2. Set fr’s state to \"loading\".\n  fr[kState] = 'loading'\n\n  // 3. Set fr’s result to null.\n  fr[kResult] = null\n\n  // 4. Set fr’s error to null.\n  fr[kError] = null\n\n  // 5. Let stream be the result of calling get stream on blob.\n  /** @type {import('stream/web').ReadableStream} */\n  const stream = blob.stream()\n\n  // 6. Let reader be the result of getting a reader from stream.\n  const reader = stream.getReader()\n\n  // 7. Let bytes be an empty byte sequence.\n  /** @type {Uint8Array[]} */\n  const bytes = []\n\n  // 8. Let chunkPromise be the result of reading a chunk from\n  //    stream with reader.\n  let chunkPromise = reader.read()\n\n  // 9. Let isFirstChunk be true.\n  let isFirstChunk = true\n\n  // 10. In parallel, while true:\n  // Note: \"In parallel\" just means non-blocking\n  // Note 2: readOperation itself cannot be async as double\n  // reading the body would then reject the promise, instead\n  // of throwing an error.\n  ;(async () => {\n    while (!fr[kAborted]) {\n      // 1. Wait for chunkPromise to be fulfilled or rejected.\n      try {\n        const { done, value } = await chunkPromise\n\n        // 2. If chunkPromise is fulfilled, and isFirstChunk is\n        //    true, queue a task to fire a progress event called\n        //    loadstart at fr.\n        if (isFirstChunk && !fr[kAborted]) {\n          queueMicrotask(() => {\n            fireAProgressEvent('loadstart', fr)\n          })\n        }\n\n        // 3. Set isFirstChunk to false.\n        isFirstChunk = false\n\n        // 4. If chunkPromise is fulfilled with an object whose\n        //    done property is false and whose value property is\n        //    a Uint8Array object, run these steps:\n        if (!done && types.isUint8Array(value)) {\n          // 1. Let bs be the byte sequence represented by the\n          //    Uint8Array object.\n\n          // 2. Append bs to bytes.\n          bytes.push(value)\n\n          // 3. If roughly 50ms have passed since these steps\n          //    were last invoked, queue a task to fire a\n          //    progress event called progress at fr.\n          if (\n            (\n              fr[kLastProgressEventFired] === undefined ||\n              Date.now() - fr[kLastProgressEventFired] >= 50\n            ) &&\n            !fr[kAborted]\n          ) {\n            fr[kLastProgressEventFired] = Date.now()\n            queueMicrotask(() => {\n              fireAProgressEvent('progress', fr)\n            })\n          }\n\n          // 4. Set chunkPromise to the result of reading a\n          //    chunk from stream with reader.\n          chunkPromise = reader.read()\n        } else if (done) {\n          // 5. Otherwise, if chunkPromise is fulfilled with an\n          //    object whose done property is true, queue a task\n          //    to run the following steps and abort this algorithm:\n          queueMicrotask(() => {\n            // 1. Set fr’s state to \"done\".\n            fr[kState] = 'done'\n\n            // 2. Let result be the result of package data given\n            //    bytes, type, blob’s type, and encodingName.\n            try {\n              const result = packageData(bytes, type, blob.type, encodingName)\n\n              // 4. Else:\n\n              if (fr[kAborted]) {\n                return\n              }\n\n              // 1. Set fr’s result to result.\n              fr[kResult] = result\n\n              // 2. Fire a progress event called load at the fr.\n              fireAProgressEvent('load', fr)\n            } catch (error) {\n              // 3. If package data threw an exception error:\n\n              // 1. Set fr’s error to error.\n              fr[kError] = error\n\n              // 2. Fire a progress event called error at fr.\n              fireAProgressEvent('error', fr)\n            }\n\n            // 5. If fr’s state is not \"loading\", fire a progress\n            //    event called loadend at the fr.\n            if (fr[kState] !== 'loading') {\n              fireAProgressEvent('loadend', fr)\n            }\n          })\n\n          break\n        }\n      } catch (error) {\n        if (fr[kAborted]) {\n          return\n        }\n\n        // 6. Otherwise, if chunkPromise is rejected with an\n        //    error error, queue a task to run the following\n        //    steps and abort this algorithm:\n        queueMicrotask(() => {\n          // 1. Set fr’s state to \"done\".\n          fr[kState] = 'done'\n\n          // 2. Set fr’s error to error.\n          fr[kError] = error\n\n          // 3. Fire a progress event called error at fr.\n          fireAProgressEvent('error', fr)\n\n          // 4. If fr’s state is not \"loading\", fire a progress\n          //    event called loadend at fr.\n          if (fr[kState] !== 'loading') {\n            fireAProgressEvent('loadend', fr)\n          }\n        })\n\n        break\n      }\n    }\n  })()\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#fire-a-progress-event\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e The name of the event\n * @param {import('./filereader').FileReader} reader\n */\nfunction fireAProgressEvent (e, reader) {\n  // The progress event e does not bubble. e.bubbles must be false\n  // The progress event e is NOT cancelable. e.cancelable must be false\n  const event = new ProgressEvent(e, {\n    bubbles: false,\n    cancelable: false\n  })\n\n  reader.dispatchEvent(event)\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#blob-package-data\n * @param {Uint8Array[]} bytes\n * @param {string} type\n * @param {string?} mimeType\n * @param {string?} encodingName\n */\nfunction packageData (bytes, type, mimeType, encodingName) {\n  // 1. A Blob has an associated package data algorithm, given\n  //    bytes, a type, a optional mimeType, and a optional\n  //    encodingName, which switches on type and runs the\n  //    associated steps:\n\n  switch (type) {\n    case 'DataURL': {\n      // 1. Return bytes as a DataURL [RFC2397] subject to\n      //    the considerations below:\n      //  * Use mimeType as part of the Data URL if it is\n      //    available in keeping with the Data URL\n      //    specification [RFC2397].\n      //  * If mimeType is not available return a Data URL\n      //    without a media-type. [RFC2397].\n\n      // https://datatracker.ietf.org/doc/html/rfc2397#section-3\n      // dataurl    := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n      // mediatype  := [ type \"/\" subtype ] *( \";\" parameter )\n      // data       := *urlchar\n      // parameter  := attribute \"=\" value\n      let dataURL = 'data:'\n\n      const parsed = parseMIMEType(mimeType || 'application/octet-stream')\n\n      if (parsed !== 'failure') {\n        dataURL += serializeAMimeType(parsed)\n      }\n\n      dataURL += ';base64,'\n\n      const decoder = new StringDecoder('latin1')\n\n      for (const chunk of bytes) {\n        dataURL += btoa(decoder.write(chunk))\n      }\n\n      dataURL += btoa(decoder.end())\n\n      return dataURL\n    }\n    case 'Text': {\n      // 1. Let encoding be failure\n      let encoding = 'failure'\n\n      // 2. If the encodingName is present, set encoding to the\n      //    result of getting an encoding from encodingName.\n      if (encodingName) {\n        encoding = getEncoding(encodingName)\n      }\n\n      // 3. If encoding is failure, and mimeType is present:\n      if (encoding === 'failure' && mimeType) {\n        // 1. Let type be the result of parse a MIME type\n        //    given mimeType.\n        const type = parseMIMEType(mimeType)\n\n        // 2. If type is not failure, set encoding to the result\n        //    of getting an encoding from type’s parameters[\"charset\"].\n        if (type !== 'failure') {\n          encoding = getEncoding(type.parameters.get('charset'))\n        }\n      }\n\n      // 4. If encoding is failure, then set encoding to UTF-8.\n      if (encoding === 'failure') {\n        encoding = 'UTF-8'\n      }\n\n      // 5. Decode bytes using fallback encoding encoding, and\n      //    return the result.\n      return decode(bytes, encoding)\n    }\n    case 'ArrayBuffer': {\n      // Return a new ArrayBuffer whose contents are bytes.\n      const sequence = combineByteSequences(bytes)\n\n      return sequence.buffer\n    }\n    case 'BinaryString': {\n      // Return bytes as a binary string, in which every byte\n      //  is represented by a code unit of equal value [0..255].\n      let binaryString = ''\n\n      const decoder = new StringDecoder('latin1')\n\n      for (const chunk of bytes) {\n        binaryString += decoder.write(chunk)\n      }\n\n      binaryString += decoder.end()\n\n      return binaryString\n    }\n  }\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#decode\n * @param {Uint8Array[]} ioQueue\n * @param {string} encoding\n */\nfunction decode (ioQueue, encoding) {\n  const bytes = combineByteSequences(ioQueue)\n\n  // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.\n  const BOMEncoding = BOMSniffing(bytes)\n\n  let slice = 0\n\n  // 2. If BOMEncoding is non-null:\n  if (BOMEncoding !== null) {\n    // 1. Set encoding to BOMEncoding.\n    encoding = BOMEncoding\n\n    // 2. Read three bytes from ioQueue, if BOMEncoding is\n    //    UTF-8; otherwise read two bytes.\n    //    (Do nothing with those bytes.)\n    slice = BOMEncoding === 'UTF-8' ? 3 : 2\n  }\n\n  // 3. Process a queue with an instance of encoding’s\n  //    decoder, ioQueue, output, and \"replacement\".\n\n  // 4. Return output.\n\n  const sliced = bytes.slice(slice)\n  return new TextDecoder(encoding).decode(sliced)\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#bom-sniff\n * @param {Uint8Array} ioQueue\n */\nfunction BOMSniffing (ioQueue) {\n  // 1. Let BOM be the result of peeking 3 bytes from ioQueue,\n  //    converted to a byte sequence.\n  const [a, b, c] = ioQueue\n\n  // 2. For each of the rows in the table below, starting with\n  //    the first one and going down, if BOM starts with the\n  //    bytes given in the first column, then return the\n  //    encoding given in the cell in the second column of that\n  //    row. Otherwise, return null.\n  if (a === 0xEF && b === 0xBB && c === 0xBF) {\n    return 'UTF-8'\n  } else if (a === 0xFE && b === 0xFF) {\n    return 'UTF-16BE'\n  } else if (a === 0xFF && b === 0xFE) {\n    return 'UTF-16LE'\n  }\n\n  return null\n}\n\n/**\n * @param {Uint8Array[]} sequences\n */\nfunction combineByteSequences (sequences) {\n  const size = sequences.reduce((a, b) => {\n    return a + b.byteLength\n  }, 0)\n\n  let offset = 0\n\n  return sequences.reduce((a, b) => {\n    a.set(b, offset)\n    offset += b.byteLength\n    return a\n  }, new Uint8Array(size))\n}\n\nmodule.exports = {\n  staticPropertyDescriptors,\n  readOperation,\n  fireAProgressEvent\n}\n","'use strict'\n\nconst { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require('./constants')\nconst {\n  kReadyState,\n  kSentClose,\n  kByteParser,\n  kReceivedClose,\n  kResponse\n} = require('./symbols')\nconst { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require('./util')\nconst { channels } = require('../../core/diagnostics')\nconst { CloseEvent } = require('./events')\nconst { makeRequest } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { Headers, getHeadersList } = require('../fetch/headers')\nconst { getDecodeSplit } = require('../fetch/util')\nconst { WebsocketFrameSend } = require('./frame')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n  crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#concept-websocket-establish\n * @param {URL} url\n * @param {string|string[]} protocols\n * @param {import('./websocket').WebSocket} ws\n * @param {(response: any, extensions: string[] | undefined) => void} onEstablish\n * @param {Partial} options\n */\nfunction establishWebSocketConnection (url, protocols, client, ws, onEstablish, options) {\n  // 1. Let requestURL be a copy of url, with its scheme set to \"http\", if url’s\n  //    scheme is \"ws\", and to \"https\" otherwise.\n  const requestURL = url\n\n  requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'\n\n  // 2. Let request be a new request, whose URL is requestURL, client is client,\n  //    service-workers mode is \"none\", referrer is \"no-referrer\", mode is\n  //    \"websocket\", credentials mode is \"include\", cache mode is \"no-store\" ,\n  //    and redirect mode is \"error\".\n  const request = makeRequest({\n    urlList: [requestURL],\n    client,\n    serviceWorkers: 'none',\n    referrer: 'no-referrer',\n    mode: 'websocket',\n    credentials: 'include',\n    cache: 'no-store',\n    redirect: 'error'\n  })\n\n  // Note: undici extension, allow setting custom headers.\n  if (options.headers) {\n    const headersList = getHeadersList(new Headers(options.headers))\n\n    request.headersList = headersList\n  }\n\n  // 3. Append (`Upgrade`, `websocket`) to request’s header list.\n  // 4. Append (`Connection`, `Upgrade`) to request’s header list.\n  // Note: both of these are handled by undici currently.\n  // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397\n\n  // 5. Let keyValue be a nonce consisting of a randomly selected\n  //    16-byte value that has been forgiving-base64-encoded and\n  //    isomorphic encoded.\n  const keyValue = crypto.randomBytes(16).toString('base64')\n\n  // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s\n  //    header list.\n  request.headersList.append('sec-websocket-key', keyValue)\n\n  // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s\n  //    header list.\n  request.headersList.append('sec-websocket-version', '13')\n\n  // 8. For each protocol in protocols, combine\n  //    (`Sec-WebSocket-Protocol`, protocol) in request’s header\n  //    list.\n  for (const protocol of protocols) {\n    request.headersList.append('sec-websocket-protocol', protocol)\n  }\n\n  // 9. Let permessageDeflate be a user-agent defined\n  //    \"permessage-deflate\" extension header value.\n  // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673\n  const permessageDeflate = 'permessage-deflate; client_max_window_bits'\n\n  // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to\n  //     request’s header list.\n  request.headersList.append('sec-websocket-extensions', permessageDeflate)\n\n  // 11. Fetch request with useParallelQueue set to true, and\n  //     processResponse given response being these steps:\n  const controller = fetching({\n    request,\n    useParallelQueue: true,\n    dispatcher: options.dispatcher,\n    processResponse (response) {\n      // 1. If response is a network error or its status is not 101,\n      //    fail the WebSocket connection.\n      if (response.type === 'error' || response.status !== 101) {\n        failWebsocketConnection(ws, 'Received network error or non-101 status code.')\n        return\n      }\n\n      // 2. If protocols is not the empty list and extracting header\n      //    list values given `Sec-WebSocket-Protocol` and response’s\n      //    header list results in null, failure, or the empty byte\n      //    sequence, then fail the WebSocket connection.\n      if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {\n        failWebsocketConnection(ws, 'Server did not respond with sent protocols.')\n        return\n      }\n\n      // 3. Follow the requirements stated step 2 to step 6, inclusive,\n      //    of the last set of steps in section 4.1 of The WebSocket\n      //    Protocol to validate response. This either results in fail\n      //    the WebSocket connection or the WebSocket connection is\n      //    established.\n\n      // 2. If the response lacks an |Upgrade| header field or the |Upgrade|\n      //    header field contains a value that is not an ASCII case-\n      //    insensitive match for the value \"websocket\", the client MUST\n      //    _Fail the WebSocket Connection_.\n      if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {\n        failWebsocketConnection(ws, 'Server did not set Upgrade header to \"websocket\".')\n        return\n      }\n\n      // 3. If the response lacks a |Connection| header field or the\n      //    |Connection| header field doesn't contain a token that is an\n      //    ASCII case-insensitive match for the value \"Upgrade\", the client\n      //    MUST _Fail the WebSocket Connection_.\n      if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {\n        failWebsocketConnection(ws, 'Server did not set Connection header to \"upgrade\".')\n        return\n      }\n\n      // 4. If the response lacks a |Sec-WebSocket-Accept| header field or\n      //    the |Sec-WebSocket-Accept| contains a value other than the\n      //    base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-\n      //    Key| (as a string, not base64-decoded) with the string \"258EAFA5-\n      //    E914-47DA-95CA-C5AB0DC85B11\" but ignoring any leading and\n      //    trailing whitespace, the client MUST _Fail the WebSocket\n      //    Connection_.\n      const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')\n      const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')\n      if (secWSAccept !== digest) {\n        failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')\n        return\n      }\n\n      // 5. If the response includes a |Sec-WebSocket-Extensions| header\n      //    field and this header field indicates the use of an extension\n      //    that was not present in the client's handshake (the server has\n      //    indicated an extension not requested by the client), the client\n      //    MUST _Fail the WebSocket Connection_.  (The parsing of this\n      //    header field to determine which extensions are requested is\n      //    discussed in Section 9.1.)\n      const secExtension = response.headersList.get('Sec-WebSocket-Extensions')\n      let extensions\n\n      if (secExtension !== null) {\n        extensions = parseExtensions(secExtension)\n\n        if (!extensions.has('permessage-deflate')) {\n          failWebsocketConnection(ws, 'Sec-WebSocket-Extensions header does not match.')\n          return\n        }\n      }\n\n      // 6. If the response includes a |Sec-WebSocket-Protocol| header field\n      //    and this header field indicates the use of a subprotocol that was\n      //    not present in the client's handshake (the server has indicated a\n      //    subprotocol not requested by the client), the client MUST _Fail\n      //    the WebSocket Connection_.\n      const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')\n\n      if (secProtocol !== null) {\n        const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList)\n\n        // The client can request that the server use a specific subprotocol by\n        // including the |Sec-WebSocket-Protocol| field in its handshake.  If it\n        // is specified, the server needs to include the same field and one of\n        // the selected subprotocol values in its response for the connection to\n        // be established.\n        if (!requestProtocols.includes(secProtocol)) {\n          failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')\n          return\n        }\n      }\n\n      response.socket.on('data', onSocketData)\n      response.socket.on('close', onSocketClose)\n      response.socket.on('error', onSocketError)\n\n      if (channels.open.hasSubscribers) {\n        channels.open.publish({\n          address: response.socket.address(),\n          protocol: secProtocol,\n          extensions: secExtension\n        })\n      }\n\n      onEstablish(response, extensions)\n    }\n  })\n\n  return controller\n}\n\nfunction closeWebSocketConnection (ws, code, reason, reasonByteLength) {\n  if (isClosing(ws) || isClosed(ws)) {\n    // If this's ready state is CLOSING (2) or CLOSED (3)\n    // Do nothing.\n  } else if (!isEstablished(ws)) {\n    // If the WebSocket connection is not yet established\n    // Fail the WebSocket connection and set this's ready state\n    // to CLOSING (2).\n    failWebsocketConnection(ws, 'Connection was closed before it was established.')\n    ws[kReadyState] = states.CLOSING\n  } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) {\n    // If the WebSocket closing handshake has not yet been started\n    // Start the WebSocket closing handshake and set this's ready\n    // state to CLOSING (2).\n    // - If neither code nor reason is present, the WebSocket Close\n    //   message must not have a body.\n    // - If code is present, then the status code to use in the\n    //   WebSocket Close message must be the integer given by code.\n    // - If reason is also present, then reasonBytes must be\n    //   provided in the Close message after the status code.\n\n    ws[kSentClose] = sentCloseFrameState.PROCESSING\n\n    const frame = new WebsocketFrameSend()\n\n    // If neither code nor reason is present, the WebSocket Close\n    // message must not have a body.\n\n    // If code is present, then the status code to use in the\n    // WebSocket Close message must be the integer given by code.\n    if (code !== undefined && reason === undefined) {\n      frame.frameData = Buffer.allocUnsafe(2)\n      frame.frameData.writeUInt16BE(code, 0)\n    } else if (code !== undefined && reason !== undefined) {\n      // If reason is also present, then reasonBytes must be\n      // provided in the Close message after the status code.\n      frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)\n      frame.frameData.writeUInt16BE(code, 0)\n      // the body MAY contain UTF-8-encoded data with value /reason/\n      frame.frameData.write(reason, 2, 'utf-8')\n    } else {\n      frame.frameData = emptyBuffer\n    }\n\n    /** @type {import('stream').Duplex} */\n    const socket = ws[kResponse].socket\n\n    socket.write(frame.createFrame(opcodes.CLOSE))\n\n    ws[kSentClose] = sentCloseFrameState.SENT\n\n    // Upon either sending or receiving a Close control frame, it is said\n    // that _The WebSocket Closing Handshake is Started_ and that the\n    // WebSocket connection is in the CLOSING state.\n    ws[kReadyState] = states.CLOSING\n  } else {\n    // Otherwise\n    // Set this's ready state to CLOSING (2).\n    ws[kReadyState] = states.CLOSING\n  }\n}\n\n/**\n * @param {Buffer} chunk\n */\nfunction onSocketData (chunk) {\n  if (!this.ws[kByteParser].write(chunk)) {\n    this.pause()\n  }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n */\nfunction onSocketClose () {\n  const { ws } = this\n  const { [kResponse]: response } = ws\n\n  response.socket.off('data', onSocketData)\n  response.socket.off('close', onSocketClose)\n  response.socket.off('error', onSocketError)\n\n  // If the TCP connection was closed after the\n  // WebSocket closing handshake was completed, the WebSocket connection\n  // is said to have been closed _cleanly_.\n  const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]\n\n  let code = 1005\n  let reason = ''\n\n  const result = ws[kByteParser].closingInfo\n\n  if (result && !result.error) {\n    code = result.code ?? 1005\n    reason = result.reason\n  } else if (!ws[kReceivedClose]) {\n    // If _The WebSocket\n    // Connection is Closed_ and no Close control frame was received by the\n    // endpoint (such as could occur if the underlying transport connection\n    // is lost), _The WebSocket Connection Close Code_ is considered to be\n    // 1006.\n    code = 1006\n  }\n\n  // 1. Change the ready state to CLOSED (3).\n  ws[kReadyState] = states.CLOSED\n\n  // 2. If the user agent was required to fail the WebSocket\n  //    connection, or if the WebSocket connection was closed\n  //    after being flagged as full, fire an event named error\n  //    at the WebSocket object.\n  // TODO\n\n  // 3. Fire an event named close at the WebSocket object,\n  //    using CloseEvent, with the wasClean attribute\n  //    initialized to true if the connection closed cleanly\n  //    and false otherwise, the code attribute initialized to\n  //    the WebSocket connection close code, and the reason\n  //    attribute initialized to the result of applying UTF-8\n  //    decode without BOM to the WebSocket connection close\n  //    reason.\n  // TODO: process.nextTick\n  fireEvent('close', ws, (type, init) => new CloseEvent(type, init), {\n    wasClean, code, reason\n  })\n\n  if (channels.close.hasSubscribers) {\n    channels.close.publish({\n      websocket: ws,\n      code,\n      reason\n    })\n  }\n}\n\nfunction onSocketError (error) {\n  const { ws } = this\n\n  ws[kReadyState] = states.CLOSING\n\n  if (channels.socketError.hasSubscribers) {\n    channels.socketError.publish(error)\n  }\n\n  this.destroy()\n}\n\nmodule.exports = {\n  establishWebSocketConnection,\n  closeWebSocketConnection\n}\n","'use strict'\n\n// This is a Globally Unique Identifier unique used\n// to validate that the endpoint accepts websocket\n// connections.\n// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3\nconst uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n  enumerable: true,\n  writable: false,\n  configurable: false\n}\n\nconst states = {\n  CONNECTING: 0,\n  OPEN: 1,\n  CLOSING: 2,\n  CLOSED: 3\n}\n\nconst sentCloseFrameState = {\n  NOT_SENT: 0,\n  PROCESSING: 1,\n  SENT: 2\n}\n\nconst opcodes = {\n  CONTINUATION: 0x0,\n  TEXT: 0x1,\n  BINARY: 0x2,\n  CLOSE: 0x8,\n  PING: 0x9,\n  PONG: 0xA\n}\n\nconst maxUnsigned16Bit = 2 ** 16 - 1 // 65535\n\nconst parserStates = {\n  INFO: 0,\n  PAYLOADLENGTH_16: 2,\n  PAYLOADLENGTH_64: 3,\n  READ_DATA: 4\n}\n\nconst emptyBuffer = Buffer.allocUnsafe(0)\n\nconst sendHints = {\n  string: 1,\n  typedArray: 2,\n  arrayBuffer: 3,\n  blob: 4\n}\n\nmodule.exports = {\n  uid,\n  sentCloseFrameState,\n  staticPropertyDescriptors,\n  states,\n  opcodes,\n  maxUnsigned16Bit,\n  parserStates,\n  emptyBuffer,\n  sendHints\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { kConstruct } = require('../../core/symbols')\nconst { MessagePort } = require('node:worker_threads')\n\n/**\n * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent\n */\nclass MessageEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict = {}) {\n    if (type === kConstruct) {\n      super(arguments[1], arguments[2])\n      webidl.util.markAsUncloneable(this)\n      return\n    }\n\n    const prefix = 'MessageEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')\n\n    super(type, eventInitDict)\n\n    this.#eventInit = eventInitDict\n    webidl.util.markAsUncloneable(this)\n  }\n\n  get data () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.data\n  }\n\n  get origin () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.origin\n  }\n\n  get lastEventId () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.lastEventId\n  }\n\n  get source () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.source\n  }\n\n  get ports () {\n    webidl.brandCheck(this, MessageEvent)\n\n    if (!Object.isFrozen(this.#eventInit.ports)) {\n      Object.freeze(this.#eventInit.ports)\n    }\n\n    return this.#eventInit.ports\n  }\n\n  initMessageEvent (\n    type,\n    bubbles = false,\n    cancelable = false,\n    data = null,\n    origin = '',\n    lastEventId = '',\n    source = null,\n    ports = []\n  ) {\n    webidl.brandCheck(this, MessageEvent)\n\n    webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')\n\n    return new MessageEvent(type, {\n      bubbles, cancelable, data, origin, lastEventId, source, ports\n    })\n  }\n\n  static createFastMessageEvent (type, init) {\n    const messageEvent = new MessageEvent(kConstruct, type, init)\n    messageEvent.#eventInit = init\n    messageEvent.#eventInit.data ??= null\n    messageEvent.#eventInit.origin ??= ''\n    messageEvent.#eventInit.lastEventId ??= ''\n    messageEvent.#eventInit.source ??= null\n    messageEvent.#eventInit.ports ??= []\n    return messageEvent\n  }\n}\n\nconst { createFastMessageEvent } = MessageEvent\ndelete MessageEvent.createFastMessageEvent\n\n/**\n * @see https://websockets.spec.whatwg.org/#the-closeevent-interface\n */\nclass CloseEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict = {}) {\n    const prefix = 'CloseEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.CloseEventInit(eventInitDict)\n\n    super(type, eventInitDict)\n\n    this.#eventInit = eventInitDict\n    webidl.util.markAsUncloneable(this)\n  }\n\n  get wasClean () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.wasClean\n  }\n\n  get code () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.code\n  }\n\n  get reason () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.reason\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface\nclass ErrorEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict) {\n    const prefix = 'ErrorEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    super(type, eventInitDict)\n    webidl.util.markAsUncloneable(this)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})\n\n    this.#eventInit = eventInitDict\n  }\n\n  get message () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.message\n  }\n\n  get filename () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.filename\n  }\n\n  get lineno () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.lineno\n  }\n\n  get colno () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.colno\n  }\n\n  get error () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.error\n  }\n}\n\nObject.defineProperties(MessageEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'MessageEvent',\n    configurable: true\n  },\n  data: kEnumerableProperty,\n  origin: kEnumerableProperty,\n  lastEventId: kEnumerableProperty,\n  source: kEnumerableProperty,\n  ports: kEnumerableProperty,\n  initMessageEvent: kEnumerableProperty\n})\n\nObject.defineProperties(CloseEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'CloseEvent',\n    configurable: true\n  },\n  reason: kEnumerableProperty,\n  code: kEnumerableProperty,\n  wasClean: kEnumerableProperty\n})\n\nObject.defineProperties(ErrorEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'ErrorEvent',\n    configurable: true\n  },\n  message: kEnumerableProperty,\n  filename: kEnumerableProperty,\n  lineno: kEnumerableProperty,\n  colno: kEnumerableProperty,\n  error: kEnumerableProperty\n})\n\nwebidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.MessagePort\n)\n\nconst eventInit = [\n  {\n    key: 'bubbles',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'cancelable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'composed',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n]\n\nwebidl.converters.MessageEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'data',\n    converter: webidl.converters.any,\n    defaultValue: () => null\n  },\n  {\n    key: 'origin',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'lastEventId',\n    converter: webidl.converters.DOMString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'source',\n    // Node doesn't implement WindowProxy or ServiceWorker, so the only\n    // valid value for source is a MessagePort.\n    converter: webidl.nullableConverter(webidl.converters.MessagePort),\n    defaultValue: () => null\n  },\n  {\n    key: 'ports',\n    converter: webidl.converters['sequence'],\n    defaultValue: () => new Array(0)\n  }\n])\n\nwebidl.converters.CloseEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'wasClean',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'code',\n    converter: webidl.converters['unsigned short'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'reason',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  }\n])\n\nwebidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'message',\n    converter: webidl.converters.DOMString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'filename',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'lineno',\n    converter: webidl.converters['unsigned long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'colno',\n    converter: webidl.converters['unsigned long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'error',\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = {\n  MessageEvent,\n  CloseEvent,\n  ErrorEvent,\n  createFastMessageEvent\n}\n","'use strict'\n\nconst { maxUnsigned16Bit } = require('./constants')\n\nconst BUFFER_SIZE = 16386\n\n/** @type {import('crypto')} */\nlet crypto\nlet buffer = null\nlet bufIdx = BUFFER_SIZE\n\ntry {\n  crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n  crypto = {\n    // not full compatibility, but minimum.\n    randomFillSync: function randomFillSync (buffer, _offset, _size) {\n      for (let i = 0; i < buffer.length; ++i) {\n        buffer[i] = Math.random() * 255 | 0\n      }\n      return buffer\n    }\n  }\n}\n\nfunction generateMask () {\n  if (bufIdx === BUFFER_SIZE) {\n    bufIdx = 0\n    crypto.randomFillSync((buffer ??= Buffer.allocUnsafe(BUFFER_SIZE)), 0, BUFFER_SIZE)\n  }\n  return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]\n}\n\nclass WebsocketFrameSend {\n  /**\n   * @param {Buffer|undefined} data\n   */\n  constructor (data) {\n    this.frameData = data\n  }\n\n  createFrame (opcode) {\n    const frameData = this.frameData\n    const maskKey = generateMask()\n    const bodyLength = frameData?.byteLength ?? 0\n\n    /** @type {number} */\n    let payloadLength = bodyLength // 0-125\n    let offset = 6\n\n    if (bodyLength > maxUnsigned16Bit) {\n      offset += 8 // payload length is next 8 bytes\n      payloadLength = 127\n    } else if (bodyLength > 125) {\n      offset += 2 // payload length is next 2 bytes\n      payloadLength = 126\n    }\n\n    const buffer = Buffer.allocUnsafe(bodyLength + offset)\n\n    // Clear first 2 bytes, everything else is overwritten\n    buffer[0] = buffer[1] = 0\n    buffer[0] |= 0x80 // FIN\n    buffer[0] = (buffer[0] & 0xF0) + opcode // opcode\n\n    /*! ws. MIT License. Einar Otto Stangvik  */\n    buffer[offset - 4] = maskKey[0]\n    buffer[offset - 3] = maskKey[1]\n    buffer[offset - 2] = maskKey[2]\n    buffer[offset - 1] = maskKey[3]\n\n    buffer[1] = payloadLength\n\n    if (payloadLength === 126) {\n      buffer.writeUInt16BE(bodyLength, 2)\n    } else if (payloadLength === 127) {\n      // Clear extended payload length\n      buffer[2] = buffer[3] = 0\n      buffer.writeUIntBE(bodyLength, 4, 6)\n    }\n\n    buffer[1] |= 0x80 // MASK\n\n    // mask body\n    for (let i = 0; i < bodyLength; ++i) {\n      buffer[offset + i] = frameData[i] ^ maskKey[i & 3]\n    }\n\n    return buffer\n  }\n}\n\nmodule.exports = {\n  WebsocketFrameSend\n}\n","'use strict'\n\nconst { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require('node:zlib')\nconst { isValidClientWindowBits } = require('./util')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nconst tail = Buffer.from([0x00, 0x00, 0xff, 0xff])\nconst kBuffer = Symbol('kBuffer')\nconst kLength = Symbol('kLength')\n\nclass PerMessageDeflate {\n  /** @type {import('node:zlib').InflateRaw} */\n  #inflate\n\n  #options = {}\n\n  #maxPayloadSize = 0\n\n  /**\n   * @param {Map} extensions\n   */\n  constructor (extensions, options) {\n    this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')\n    this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')\n\n    this.#maxPayloadSize = options.maxPayloadSize\n  }\n\n  /**\n   * Decompress a compressed payload.\n   * @param {Buffer} chunk Compressed data\n   * @param {boolean} fin Final fragment flag\n   * @param {Function} callback Callback function\n   */\n  decompress (chunk, fin, callback) {\n    // An endpoint uses the following algorithm to decompress a message.\n    // 1.  Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the\n    //     payload of the message.\n    // 2.  Decompress the resulting data using DEFLATE.\n    if (!this.#inflate) {\n      let windowBits = Z_DEFAULT_WINDOWBITS\n\n      if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS\n        if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {\n          callback(new Error('Invalid server_max_window_bits'))\n          return\n        }\n\n        windowBits = Number.parseInt(this.#options.serverMaxWindowBits)\n      }\n\n      try {\n        this.#inflate = createInflateRaw({ windowBits })\n      } catch (err) {\n        callback(err)\n        return\n      }\n      this.#inflate[kBuffer] = []\n      this.#inflate[kLength] = 0\n\n      this.#inflate.on('data', (data) => {\n        this.#inflate[kLength] += data.length\n\n        if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {\n          callback(new MessageSizeExceededError())\n          this.#inflate.removeAllListeners()\n          this.#inflate = null\n          return\n        }\n\n        this.#inflate[kBuffer].push(data)\n      })\n\n      this.#inflate.on('error', (err) => {\n        this.#inflate = null\n        callback(err)\n      })\n    }\n\n    this.#inflate.write(chunk)\n    if (fin) {\n      this.#inflate.write(tail)\n    }\n\n    this.#inflate.flush(() => {\n      if (!this.#inflate) {\n        return\n      }\n\n      const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])\n\n      this.#inflate[kBuffer].length = 0\n      this.#inflate[kLength] = 0\n\n      callback(null, full)\n    })\n  }\n}\n\nmodule.exports = { PerMessageDeflate }\n","'use strict'\n\nconst { Writable } = require('node:stream')\nconst assert = require('node:assert')\nconst { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require('./constants')\nconst { kReadyState, kSentClose, kResponse, kReceivedClose } = require('./symbols')\nconst { channels } = require('../../core/diagnostics')\nconst {\n  isValidStatusCode,\n  isValidOpcode,\n  failWebsocketConnection,\n  websocketMessageReceived,\n  utf8Decode,\n  isControlFrame,\n  isTextBinaryFrame,\n  isContinuationFrame\n} = require('./util')\nconst { WebsocketFrameSend } = require('./frame')\nconst { closeWebSocketConnection } = require('./connection')\nconst { PerMessageDeflate } = require('./permessage-deflate')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nfunction failWebsocketConnectionWithCode (ws, code, reason) {\n  closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason))\n  failWebsocketConnection(ws, reason)\n}\n\n// This code was influenced by ws released under the MIT license.\n// Copyright (c) 2011 Einar Otto Stangvik \n// Copyright (c) 2013 Arnout Kazemier and contributors\n// Copyright (c) 2016 Luigi Pinca and contributors\n\nclass ByteParser extends Writable {\n  #buffers = []\n  #fragmentsBytes = 0\n  #byteOffset = 0\n  #loop = false\n\n  #state = parserStates.INFO\n\n  #info = {}\n  #fragments = []\n\n  /** @type {Map} */\n  #extensions\n\n  /** @type {number} */\n  #maxFragments\n\n  /** @type {number} */\n  #maxPayloadSize\n\n  /**\n   * @param {import('./websocket').WebSocket} ws\n   * @param {Map|null} extensions\n   * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]\n   */\n  constructor (ws, extensions, options = {}) {\n    super()\n\n    this.ws = ws\n    this.#extensions = extensions == null ? new Map() : extensions\n    this.#maxFragments = options.maxFragments ?? 0\n    this.#maxPayloadSize = options.maxPayloadSize ?? 0\n\n    if (this.#extensions.has('permessage-deflate')) {\n      this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))\n    }\n  }\n\n  /**\n   * @param {Buffer} chunk\n   * @param {() => void} callback\n   */\n  _write (chunk, _, callback) {\n    this.#buffers.push(chunk)\n    this.#byteOffset += chunk.length\n    this.#loop = true\n\n    this.run(callback)\n  }\n\n  #validatePayloadLength () {\n    if (\n      this.#maxPayloadSize > 0 &&\n      !isControlFrame(this.#info.opcode) &&\n      this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize\n    ) {\n      failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size')\n      return false\n    }\n\n    return true\n  }\n\n  /**\n   * Runs whenever a new chunk is received.\n   * Callback is called whenever there are no more chunks buffering,\n   * or not enough bytes are buffered to parse.\n   */\n  run (callback) {\n    while (this.#loop) {\n      if (this.#state === parserStates.INFO) {\n        // If there aren't enough bytes to parse the payload length, etc.\n        if (this.#byteOffset < 2) {\n          return callback()\n        }\n\n        const buffer = this.consume(2)\n        const fin = (buffer[0] & 0x80) !== 0\n        const opcode = buffer[0] & 0x0F\n        const masked = (buffer[1] & 0x80) === 0x80\n\n        const fragmented = !fin && opcode !== opcodes.CONTINUATION\n        const payloadLength = buffer[1] & 0x7F\n\n        const rsv1 = buffer[0] & 0x40\n        const rsv2 = buffer[0] & 0x20\n        const rsv3 = buffer[0] & 0x10\n\n        if (!isValidOpcode(opcode)) {\n          failWebsocketConnection(this.ws, 'Invalid opcode received')\n          return callback()\n        }\n\n        if (masked) {\n          failWebsocketConnection(this.ws, 'Frame cannot be masked')\n          return callback()\n        }\n\n        // MUST be 0 unless an extension is negotiated that defines meanings\n        // for non-zero values.  If a nonzero value is received and none of\n        // the negotiated extensions defines the meaning of such a nonzero\n        // value, the receiving endpoint MUST _Fail the WebSocket\n        // Connection_.\n        // This document allocates the RSV1 bit of the WebSocket header for\n        // PMCEs and calls the bit the \"Per-Message Compressed\" bit.  On a\n        // WebSocket connection where a PMCE is in use, this bit indicates\n        // whether a message is compressed or not.\n        if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {\n          failWebsocketConnection(this.ws, 'Expected RSV1 to be clear.')\n          return\n        }\n\n        if (rsv2 !== 0 || rsv3 !== 0) {\n          failWebsocketConnection(this.ws, 'RSV1, RSV2, RSV3 must be clear')\n          return\n        }\n\n        if (fragmented && !isTextBinaryFrame(opcode)) {\n          // Only text and binary frames can be fragmented\n          failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')\n          return\n        }\n\n        // If we are already parsing a text/binary frame and do not receive either\n        // a continuation frame or close frame, fail the connection.\n        if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {\n          failWebsocketConnection(this.ws, 'Expected continuation frame')\n          return\n        }\n\n        if (this.#info.fragmented && fragmented) {\n          // A fragmented frame can't be fragmented itself\n          failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')\n          return\n        }\n\n        // \"All control frames MUST have a payload length of 125 bytes or less\n        // and MUST NOT be fragmented.\"\n        if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {\n          failWebsocketConnection(this.ws, 'Control frame either too large or fragmented')\n          return\n        }\n\n        if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {\n          failWebsocketConnection(this.ws, 'Unexpected continuation frame')\n          return\n        }\n\n        if (payloadLength <= 125) {\n          this.#info.payloadLength = payloadLength\n          this.#state = parserStates.READ_DATA\n\n          if (!this.#validatePayloadLength()) {\n            return\n          }\n        } else if (payloadLength === 126) {\n          this.#state = parserStates.PAYLOADLENGTH_16\n        } else if (payloadLength === 127) {\n          this.#state = parserStates.PAYLOADLENGTH_64\n        }\n\n        if (isTextBinaryFrame(opcode)) {\n          this.#info.binaryType = opcode\n          this.#info.compressed = rsv1 !== 0\n        }\n\n        this.#info.opcode = opcode\n        this.#info.masked = masked\n        this.#info.fin = fin\n        this.#info.fragmented = fragmented\n      } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n        if (this.#byteOffset < 2) {\n          return callback()\n        }\n\n        const buffer = this.consume(2)\n\n        this.#info.payloadLength = buffer.readUInt16BE(0)\n        this.#state = parserStates.READ_DATA\n\n        if (!this.#validatePayloadLength()) {\n          return\n        }\n      } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n        if (this.#byteOffset < 8) {\n          return callback()\n        }\n\n        const buffer = this.consume(8)\n        const upper = buffer.readUInt32BE(0)\n        const lower = buffer.readUInt32BE(4)\n\n        // 2^31 is the maximum bytes an arraybuffer can contain\n        // on 32-bit systems. Although, on 64-bit systems, this is\n        // 2^53-1 bytes.\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n        // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n        // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n        if (upper !== 0 || lower > 2 ** 31 - 1) {\n          failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')\n          return\n        }\n\n        this.#info.payloadLength = lower\n        this.#state = parserStates.READ_DATA\n\n        if (!this.#validatePayloadLength()) {\n          return\n        }\n      } else if (this.#state === parserStates.READ_DATA) {\n        if (this.#byteOffset < this.#info.payloadLength) {\n          return callback()\n        }\n\n        const body = this.consume(this.#info.payloadLength)\n\n        if (isControlFrame(this.#info.opcode)) {\n          this.#loop = this.parseControlFrame(body)\n          this.#state = parserStates.INFO\n        } else {\n          if (!this.#info.compressed) {\n            if (!this.writeFragments(body)) {\n              return\n            }\n\n            if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n              failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n              return\n            }\n\n            // If the frame is not fragmented, a message has been received.\n            // If the frame is fragmented, it will terminate with a fin bit set\n            // and an opcode of 0 (continuation), therefore we handle that when\n            // parsing continuation frames, not here.\n            if (!this.#info.fragmented && this.#info.fin) {\n              websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n            }\n\n            this.#state = parserStates.INFO\n          } else {\n            this.#extensions.get('permessage-deflate').decompress(\n              body,\n              this.#info.fin,\n              (error, data) => {\n                if (error) {\n                  const code = error instanceof MessageSizeExceededError ? 1009 : 1007\n                  failWebsocketConnectionWithCode(this.ws, code, error.message)\n                  return\n                }\n\n                if (!this.writeFragments(data)) {\n                  return\n                }\n\n                if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n                  failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n                  return\n                }\n\n                if (!this.#info.fin) {\n                  this.#state = parserStates.INFO\n                  this.#loop = true\n                  this.run(callback)\n                  return\n                }\n\n                websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n\n                this.#loop = true\n                this.#state = parserStates.INFO\n                this.run(callback)\n              }\n            )\n\n            this.#loop = false\n            break\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * Take n bytes from the buffered Buffers\n   * @param {number} n\n   * @returns {Buffer}\n   */\n  consume (n) {\n    if (n > this.#byteOffset) {\n      throw new Error('Called consume() before buffers satiated.')\n    } else if (n === 0) {\n      return emptyBuffer\n    }\n\n    if (this.#buffers[0].length === n) {\n      this.#byteOffset -= this.#buffers[0].length\n      return this.#buffers.shift()\n    }\n\n    const buffer = Buffer.allocUnsafe(n)\n    let offset = 0\n\n    while (offset !== n) {\n      const next = this.#buffers[0]\n      const { length } = next\n\n      if (length + offset === n) {\n        buffer.set(this.#buffers.shift(), offset)\n        break\n      } else if (length + offset > n) {\n        buffer.set(next.subarray(0, n - offset), offset)\n        this.#buffers[0] = next.subarray(n - offset)\n        break\n      } else {\n        buffer.set(this.#buffers.shift(), offset)\n        offset += next.length\n      }\n    }\n\n    this.#byteOffset -= n\n\n    return buffer\n  }\n\n  writeFragments (fragment) {\n    if (\n      this.#maxFragments > 0 &&\n      this.#fragments.length === this.#maxFragments\n    ) {\n      failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments')\n      return false\n    }\n\n    this.#fragmentsBytes += fragment.length\n    this.#fragments.push(fragment)\n    return true\n  }\n\n  consumeFragments () {\n    const fragments = this.#fragments\n\n    if (fragments.length === 1) {\n      this.#fragmentsBytes = 0\n      return fragments.shift()\n    }\n\n    const output = Buffer.concat(fragments, this.#fragmentsBytes)\n    this.#fragments = []\n    this.#fragmentsBytes = 0\n\n    return output\n  }\n\n  parseCloseBody (data) {\n    assert(data.length !== 1)\n\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n    /** @type {number|undefined} */\n    let code\n\n    if (data.length >= 2) {\n      // _The WebSocket Connection Close Code_ is\n      // defined as the status code (Section 7.4) contained in the first Close\n      // control frame received by the application\n      code = data.readUInt16BE(0)\n    }\n\n    if (code !== undefined && !isValidStatusCode(code)) {\n      return { code: 1002, reason: 'Invalid status code', error: true }\n    }\n\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6\n    /** @type {Buffer} */\n    let reason = data.subarray(2)\n\n    // Remove BOM\n    if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {\n      reason = reason.subarray(3)\n    }\n\n    try {\n      reason = utf8Decode(reason)\n    } catch {\n      return { code: 1007, reason: 'Invalid UTF-8', error: true }\n    }\n\n    return { code, reason, error: false }\n  }\n\n  /**\n   * Parses control frames.\n   * @param {Buffer} body\n   */\n  parseControlFrame (body) {\n    const { opcode, payloadLength } = this.#info\n\n    if (opcode === opcodes.CLOSE) {\n      if (payloadLength === 1) {\n        failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')\n        return false\n      }\n\n      this.#info.closeInfo = this.parseCloseBody(body)\n\n      if (this.#info.closeInfo.error) {\n        const { code, reason } = this.#info.closeInfo\n\n        closeWebSocketConnection(this.ws, code, reason, reason.length)\n        failWebsocketConnection(this.ws, reason)\n        return false\n      }\n\n      if (this.ws[kSentClose] !== sentCloseFrameState.SENT) {\n        // If an endpoint receives a Close frame and did not previously send a\n        // Close frame, the endpoint MUST send a Close frame in response.  (When\n        // sending a Close frame in response, the endpoint typically echos the\n        // status code it received.)\n        let body = emptyBuffer\n        if (this.#info.closeInfo.code) {\n          body = Buffer.allocUnsafe(2)\n          body.writeUInt16BE(this.#info.closeInfo.code, 0)\n        }\n        const closeFrame = new WebsocketFrameSend(body)\n\n        this.ws[kResponse].socket.write(\n          closeFrame.createFrame(opcodes.CLOSE),\n          (err) => {\n            if (!err) {\n              this.ws[kSentClose] = sentCloseFrameState.SENT\n            }\n          }\n        )\n      }\n\n      // Upon either sending or receiving a Close control frame, it is said\n      // that _The WebSocket Closing Handshake is Started_ and that the\n      // WebSocket connection is in the CLOSING state.\n      this.ws[kReadyState] = states.CLOSING\n      this.ws[kReceivedClose] = true\n\n      return false\n    } else if (opcode === opcodes.PING) {\n      // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n      // response, unless it already received a Close frame.\n      // A Pong frame sent in response to a Ping frame must have identical\n      // \"Application data\"\n\n      if (!this.ws[kReceivedClose]) {\n        const frame = new WebsocketFrameSend(body)\n\n        this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))\n\n        if (channels.ping.hasSubscribers) {\n          channels.ping.publish({\n            payload: body\n          })\n        }\n      }\n    } else if (opcode === opcodes.PONG) {\n      // A Pong frame MAY be sent unsolicited.  This serves as a\n      // unidirectional heartbeat.  A response to an unsolicited Pong frame is\n      // not expected.\n\n      if (channels.pong.hasSubscribers) {\n        channels.pong.publish({\n          payload: body\n        })\n      }\n    }\n\n    return true\n  }\n\n  get closingInfo () {\n    return this.#info.closeInfo\n  }\n}\n\nmodule.exports = {\n  ByteParser\n}\n","'use strict'\n\nconst { WebsocketFrameSend } = require('./frame')\nconst { opcodes, sendHints } = require('./constants')\nconst FixedQueue = require('../../dispatcher/fixed-queue')\n\n/** @type {typeof Uint8Array} */\nconst FastBuffer = Buffer[Symbol.species]\n\n/**\n * @typedef {object} SendQueueNode\n * @property {Promise | null} promise\n * @property {((...args: any[]) => any)} callback\n * @property {Buffer | null} frame\n */\n\nclass SendQueue {\n  /**\n   * @type {FixedQueue}\n   */\n  #queue = new FixedQueue()\n\n  /**\n   * @type {boolean}\n   */\n  #running = false\n\n  /** @type {import('node:net').Socket} */\n  #socket\n\n  constructor (socket) {\n    this.#socket = socket\n  }\n\n  add (item, cb, hint) {\n    if (hint !== sendHints.blob) {\n      const frame = createFrame(item, hint)\n      if (!this.#running) {\n        // fast-path\n        this.#socket.write(frame, cb)\n      } else {\n        /** @type {SendQueueNode} */\n        const node = {\n          promise: null,\n          callback: cb,\n          frame\n        }\n        this.#queue.push(node)\n      }\n      return\n    }\n\n    /** @type {SendQueueNode} */\n    const node = {\n      promise: item.arrayBuffer().then((ab) => {\n        node.promise = null\n        node.frame = createFrame(ab, hint)\n      }),\n      callback: cb,\n      frame: null\n    }\n\n    this.#queue.push(node)\n\n    if (!this.#running) {\n      this.#run()\n    }\n  }\n\n  async #run () {\n    this.#running = true\n    const queue = this.#queue\n    while (!queue.isEmpty()) {\n      const node = queue.shift()\n      // wait pending promise\n      if (node.promise !== null) {\n        await node.promise\n      }\n      // write\n      this.#socket.write(node.frame, node.callback)\n      // cleanup\n      node.callback = node.frame = null\n    }\n    this.#running = false\n  }\n}\n\nfunction createFrame (data, hint) {\n  return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY)\n}\n\nfunction toBuffer (data, hint) {\n  switch (hint) {\n    case sendHints.string:\n      return Buffer.from(data)\n    case sendHints.arrayBuffer:\n    case sendHints.blob:\n      return new FastBuffer(data)\n    case sendHints.typedArray:\n      return new FastBuffer(data.buffer, data.byteOffset, data.byteLength)\n  }\n}\n\nmodule.exports = { SendQueue }\n","'use strict'\n\nmodule.exports = {\n  kWebSocketURL: Symbol('url'),\n  kReadyState: Symbol('ready state'),\n  kController: Symbol('controller'),\n  kResponse: Symbol('response'),\n  kBinaryType: Symbol('binary type'),\n  kSentClose: Symbol('sent close'),\n  kReceivedClose: Symbol('received close'),\n  kByteParser: Symbol('byte parser')\n}\n","'use strict'\n\nconst { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require('./symbols')\nconst { states, opcodes } = require('./constants')\nconst { ErrorEvent, createFastMessageEvent } = require('./events')\nconst { isUtf8 } = require('node:buffer')\nconst { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require('../fetch/data-url')\n\n/* globals Blob */\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isConnecting (ws) {\n  // If the WebSocket connection is not yet established, and the connection\n  // is not yet closed, then the WebSocket connection is in the CONNECTING state.\n  return ws[kReadyState] === states.CONNECTING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isEstablished (ws) {\n  // If the server's response is validated as provided for above, it is\n  // said that _The WebSocket Connection is Established_ and that the\n  // WebSocket Connection is in the OPEN state.\n  return ws[kReadyState] === states.OPEN\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosing (ws) {\n  // Upon either sending or receiving a Close control frame, it is said\n  // that _The WebSocket Closing Handshake is Started_ and that the\n  // WebSocket connection is in the CLOSING state.\n  return ws[kReadyState] === states.CLOSING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosed (ws) {\n  return ws[kReadyState] === states.CLOSED\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e\n * @param {EventTarget} target\n * @param {(...args: ConstructorParameters) => Event} eventFactory\n * @param {EventInit | undefined} eventInitDict\n */\nfunction fireEvent (e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {\n  // 1. If eventConstructor is not given, then let eventConstructor be Event.\n\n  // 2. Let event be the result of creating an event given eventConstructor,\n  //    in the relevant realm of target.\n  // 3. Initialize event’s type attribute to e.\n  const event = eventFactory(e, eventInitDict)\n\n  // 4. Initialize any other IDL attributes of event as described in the\n  //    invocation of this algorithm.\n\n  // 5. Return the result of dispatching event at target, with legacy target\n  //    override flag set if set.\n  target.dispatchEvent(event)\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @param {import('./websocket').WebSocket} ws\n * @param {number} type Opcode\n * @param {Buffer} data application data\n */\nfunction websocketMessageReceived (ws, type, data) {\n  // 1. If ready state is not OPEN (1), then return.\n  if (ws[kReadyState] !== states.OPEN) {\n    return\n  }\n\n  // 2. Let dataForEvent be determined by switching on type and binary type:\n  let dataForEvent\n\n  if (type === opcodes.TEXT) {\n    // -> type indicates that the data is Text\n    //      a new DOMString containing data\n    try {\n      dataForEvent = utf8Decode(data)\n    } catch {\n      failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')\n      return\n    }\n  } else if (type === opcodes.BINARY) {\n    if (ws[kBinaryType] === 'blob') {\n      // -> type indicates that the data is Binary and binary type is \"blob\"\n      //      a new Blob object, created in the relevant Realm of the WebSocket\n      //      object, that represents data as its raw data\n      dataForEvent = new Blob([data])\n    } else {\n      // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n      //      a new ArrayBuffer object, created in the relevant Realm of the\n      //      WebSocket object, whose contents are data\n      dataForEvent = toArrayBuffer(data)\n    }\n  }\n\n  // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n  //    with the origin attribute initialized to the serialization of the WebSocket\n  //    object’s url's origin, and the data attribute initialized to dataForEvent.\n  fireEvent('message', ws, createFastMessageEvent, {\n    origin: ws[kWebSocketURL].origin,\n    data: dataForEvent\n  })\n}\n\nfunction toArrayBuffer (buffer) {\n  if (buffer.byteLength === buffer.buffer.byteLength) {\n    return buffer.buffer\n  }\n  return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455\n * @see https://datatracker.ietf.org/doc/html/rfc2616\n * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407\n * @param {string} protocol\n */\nfunction isValidSubprotocol (protocol) {\n  // If present, this value indicates one\n  // or more comma-separated subprotocol the client wishes to speak,\n  // ordered by preference.  The elements that comprise this value\n  // MUST be non-empty strings with characters in the range U+0021 to\n  // U+007E not including separator characters as defined in\n  // [RFC2616] and MUST all be unique strings.\n  if (protocol.length === 0) {\n    return false\n  }\n\n  for (let i = 0; i < protocol.length; ++i) {\n    const code = protocol.charCodeAt(i)\n\n    if (\n      code < 0x21 || // CTL, contains SP (0x20) and HT (0x09)\n      code > 0x7E ||\n      code === 0x22 || // \"\n      code === 0x28 || // (\n      code === 0x29 || // )\n      code === 0x2C || // ,\n      code === 0x2F || // /\n      code === 0x3A || // :\n      code === 0x3B || // ;\n      code === 0x3C || // <\n      code === 0x3D || // =\n      code === 0x3E || // >\n      code === 0x3F || // ?\n      code === 0x40 || // @\n      code === 0x5B || // [\n      code === 0x5C || // \\\n      code === 0x5D || // ]\n      code === 0x7B || // {\n      code === 0x7D // }\n    ) {\n      return false\n    }\n  }\n\n  return true\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4\n * @param {number} code\n */\nfunction isValidStatusCode (code) {\n  if (code >= 1000 && code < 1015) {\n    return (\n      code !== 1004 && // reserved\n      code !== 1005 && // \"MUST NOT be set as a status code\"\n      code !== 1006 // \"MUST NOT be set as a status code\"\n    )\n  }\n\n  return code >= 3000 && code <= 4999\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @param {string|undefined} reason\n */\nfunction failWebsocketConnection (ws, reason) {\n  const { [kController]: controller, [kResponse]: response } = ws\n\n  controller.abort()\n\n  if (response?.socket && !response.socket.destroyed) {\n    response.socket.destroy()\n  }\n\n  if (reason) {\n    // TODO: process.nextTick\n    fireEvent('error', ws, (type, init) => new ErrorEvent(type, init), {\n      error: new Error(reason),\n      message: reason\n    })\n  }\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5\n * @param {number} opcode\n */\nfunction isControlFrame (opcode) {\n  return (\n    opcode === opcodes.CLOSE ||\n    opcode === opcodes.PING ||\n    opcode === opcodes.PONG\n  )\n}\n\nfunction isContinuationFrame (opcode) {\n  return opcode === opcodes.CONTINUATION\n}\n\nfunction isTextBinaryFrame (opcode) {\n  return opcode === opcodes.TEXT || opcode === opcodes.BINARY\n}\n\nfunction isValidOpcode (opcode) {\n  return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode)\n}\n\n/**\n * Parses a Sec-WebSocket-Extensions header value.\n * @param {string} extensions\n * @returns {Map}\n */\n// TODO(@Uzlopak, @KhafraDev): make compliant https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\nfunction parseExtensions (extensions) {\n  const position = { position: 0 }\n  const extensionList = new Map()\n\n  while (position.position < extensions.length) {\n    const pair = collectASequenceOfCodePointsFast(';', extensions, position)\n    const [name, value = ''] = pair.split('=')\n\n    extensionList.set(\n      removeHTTPWhitespace(name, true, false),\n      removeHTTPWhitespace(value, false, true)\n    )\n\n    position.position++\n  }\n\n  return extensionList\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2\n * @description \"client-max-window-bits = 1*DIGIT\"\n * @param {string} value\n */\nfunction isValidClientWindowBits (value) {\n  // Must have at least one character\n  if (value.length === 0) {\n    return false\n  }\n\n  // Check all characters are ASCII digits\n  for (let i = 0; i < value.length; i++) {\n    const byte = value.charCodeAt(i)\n\n    if (byte < 0x30 || byte > 0x39) {\n      return false\n    }\n  }\n\n  // Check numeric range: zlib requires windowBits in range 8-15\n  const num = Number.parseInt(value, 10)\n  return num >= 8 && num <= 15\n}\n\n// https://nodejs.org/api/intl.html#detecting-internationalization-support\nconst hasIntl = typeof process.versions.icu === 'string'\nconst fatalDecoder = hasIntl ? new TextDecoder('utf-8', { fatal: true }) : undefined\n\n/**\n * Converts a Buffer to utf-8, even on platforms without icu.\n * @param {Buffer} buffer\n */\nconst utf8Decode = hasIntl\n  ? fatalDecoder.decode.bind(fatalDecoder)\n  : function (buffer) {\n    if (isUtf8(buffer)) {\n      return buffer.toString('utf-8')\n    }\n    throw new TypeError('Invalid utf-8 received.')\n  }\n\nmodule.exports = {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isClosed,\n  fireEvent,\n  isValidSubprotocol,\n  isValidStatusCode,\n  failWebsocketConnection,\n  websocketMessageReceived,\n  utf8Decode,\n  isControlFrame,\n  isContinuationFrame,\n  isTextBinaryFrame,\n  isValidOpcode,\n  parseExtensions,\n  isValidClientWindowBits\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { environmentSettingsObject } = require('../fetch/util')\nconst { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require('./constants')\nconst {\n  kWebSocketURL,\n  kReadyState,\n  kController,\n  kBinaryType,\n  kResponse,\n  kSentClose,\n  kByteParser\n} = require('./symbols')\nconst {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isValidSubprotocol,\n  fireEvent\n} = require('./util')\nconst { establishWebSocketConnection, closeWebSocketConnection } = require('./connection')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty, isBlobLike } = require('../../core/util')\nconst { getGlobalDispatcher } = require('../../global')\nconst { types } = require('node:util')\nconst { ErrorEvent, CloseEvent } = require('./events')\nconst { SendQueue } = require('./sender')\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    close: null,\n    message: null\n  }\n\n  #bufferedAmount = 0\n  #protocol = ''\n  #extensions = ''\n\n  /** @type {SendQueue} */\n  #sendQueue\n\n  /**\n   * @param {string} url\n   * @param {string|string[]} protocols\n   */\n  constructor (url, protocols = []) {\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'WebSocket constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols, prefix, 'options')\n\n    url = webidl.converters.USVString(url, prefix, 'url')\n    protocols = options.protocols\n\n    // 1. Let baseURL be this's relevant settings object's API base URL.\n    const baseURL = environmentSettingsObject.settingsObject.baseUrl\n\n    // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.\n    let urlRecord\n\n    try {\n      urlRecord = new URL(url, baseURL)\n    } catch (e) {\n      // 3. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n      throw new DOMException(e, 'SyntaxError')\n    }\n\n    // 4. If urlRecord’s scheme is \"http\", then set urlRecord’s scheme to \"ws\".\n    if (urlRecord.protocol === 'http:') {\n      urlRecord.protocol = 'ws:'\n    } else if (urlRecord.protocol === 'https:') {\n      // 5. Otherwise, if urlRecord’s scheme is \"https\", set urlRecord’s scheme to \"wss\".\n      urlRecord.protocol = 'wss:'\n    }\n\n    // 6. If urlRecord’s scheme is not \"ws\" or \"wss\", then throw a \"SyntaxError\" DOMException.\n    if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {\n      throw new DOMException(\n        `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,\n        'SyntaxError'\n      )\n    }\n\n    // 7. If urlRecord’s fragment is non-null, then throw a \"SyntaxError\"\n    //    DOMException.\n    if (urlRecord.hash || urlRecord.href.endsWith('#')) {\n      throw new DOMException('Got fragment', 'SyntaxError')\n    }\n\n    // 8. If protocols is a string, set protocols to a sequence consisting\n    //    of just that string.\n    if (typeof protocols === 'string') {\n      protocols = [protocols]\n    }\n\n    // 9. If any of the values in protocols occur more than once or otherwise\n    //    fail to match the requirements for elements that comprise the value\n    //    of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n    //    protocol, then throw a \"SyntaxError\" DOMException.\n    if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    // 10. Set this's url to urlRecord.\n    this[kWebSocketURL] = new URL(urlRecord.href)\n\n    // 11. Let client be this's relevant settings object.\n    const client = environmentSettingsObject.settingsObject\n\n    // 12. Run this step in parallel:\n\n    //    1. Establish a WebSocket connection given urlRecord, protocols,\n    //       and client.\n    this[kController] = establishWebSocketConnection(\n      urlRecord,\n      protocols,\n      client,\n      this,\n      (response, extensions) => this.#onConnectionEstablished(response, extensions),\n      options\n    )\n\n    // Each WebSocket object has an associated ready state, which is a\n    // number representing the state of the connection. Initially it must\n    // be CONNECTING (0).\n    this[kReadyState] = WebSocket.CONNECTING\n\n    this[kSentClose] = sentCloseFrameState.NOT_SENT\n\n    // The extensions attribute must initially return the empty string.\n\n    // The protocol attribute must initially return the empty string.\n\n    // Each WebSocket object has an associated binary type, which is a\n    // BinaryType. Initially it must be \"blob\".\n    this[kBinaryType] = 'blob'\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n   * @param {number|undefined} code\n   * @param {string|undefined} reason\n   */\n  close (code = undefined, reason = undefined) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.close'\n\n    if (code !== undefined) {\n      code = webidl.converters['unsigned short'](code, prefix, 'code', { clamp: true })\n    }\n\n    if (reason !== undefined) {\n      reason = webidl.converters.USVString(reason, prefix, 'reason')\n    }\n\n    // 1. If code is present, but is neither an integer equal to 1000 nor an\n    //    integer in the range 3000 to 4999, inclusive, throw an\n    //    \"InvalidAccessError\" DOMException.\n    if (code !== undefined) {\n      if (code !== 1000 && (code < 3000 || code > 4999)) {\n        throw new DOMException('invalid code', 'InvalidAccessError')\n      }\n    }\n\n    let reasonByteLength = 0\n\n    // 2. If reason is present, then run these substeps:\n    if (reason !== undefined) {\n      // 1. Let reasonBytes be the result of encoding reason.\n      // 2. If reasonBytes is longer than 123 bytes, then throw a\n      //    \"SyntaxError\" DOMException.\n      reasonByteLength = Buffer.byteLength(reason)\n\n      if (reasonByteLength > 123) {\n        throw new DOMException(\n          `Reason must be less than 123 bytes; received ${reasonByteLength}`,\n          'SyntaxError'\n        )\n      }\n    }\n\n    // 3. Run the first matching steps from the following list:\n    closeWebSocketConnection(this, code, reason, reasonByteLength)\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n   * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n   */\n  send (data) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.send'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    data = webidl.converters.WebSocketSendData(data, prefix, 'data')\n\n    // 1. If this's ready state is CONNECTING, then throw an\n    //    \"InvalidStateError\" DOMException.\n    if (isConnecting(this)) {\n      throw new DOMException('Sent before connected.', 'InvalidStateError')\n    }\n\n    // 2. Run the appropriate set of steps from the following list:\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n    if (!isEstablished(this) || isClosing(this)) {\n      return\n    }\n\n    // If data is a string\n    if (typeof data === 'string') {\n      // If the WebSocket connection is established and the WebSocket\n      // closing handshake has not yet started, then the user agent\n      // must send a WebSocket Message comprised of the data argument\n      // using a text frame opcode; if the data cannot be sent, e.g.\n      // because it would need to be buffered but the buffer is full,\n      // the user agent must flag the WebSocket as full and then close\n      // the WebSocket connection. Any invocation of this method with a\n      // string argument that does not throw an exception must increase\n      // the bufferedAmount attribute by the number of bytes needed to\n      // express the argument as UTF-8.\n\n      const length = Buffer.byteLength(data)\n\n      this.#bufferedAmount += length\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= length\n      }, sendHints.string)\n    } else if (types.isArrayBuffer(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need\n      // to be buffered but the buffer is full, the user agent must flag\n      // the WebSocket as full and then close the WebSocket connection.\n      // The data to be sent is the data stored in the buffer described\n      // by the ArrayBuffer object. Any invocation of this method with an\n      // ArrayBuffer argument that does not throw an exception must\n      // increase the bufferedAmount attribute by the length of the\n      // ArrayBuffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.arrayBuffer)\n    } else if (ArrayBuffer.isView(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The\n      // data to be sent is the data stored in the section of the buffer\n      // described by the ArrayBuffer object that data references. Any\n      // invocation of this method with this kind of argument that does\n      // not throw an exception must increase the bufferedAmount attribute\n      // by the length of data’s buffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.typedArray)\n    } else if (isBlobLike(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The data\n      // to be sent is the raw data represented by the Blob object. Any\n      // invocation of this method with a Blob argument that does not throw\n      // an exception must increase the bufferedAmount attribute by the size\n      // of the Blob object’s raw data, in bytes.\n\n      this.#bufferedAmount += data.size\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.size\n      }, sendHints.blob)\n    }\n  }\n\n  get readyState () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The readyState getter steps are to return this's ready state.\n    return this[kReadyState]\n  }\n\n  get bufferedAmount () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#bufferedAmount\n  }\n\n  get url () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The url getter steps are to return this's url, serialized.\n    return URLSerializer(this[kWebSocketURL])\n  }\n\n  get extensions () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#extensions\n  }\n\n  get protocol () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#protocol\n  }\n\n  get onopen () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.open = fn\n      this.addEventListener('open', fn)\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this.#events.error = null\n    }\n  }\n\n  get onclose () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.close\n  }\n\n  set onclose (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.close) {\n      this.removeEventListener('close', this.#events.close)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.close = fn\n      this.addEventListener('close', fn)\n    } else {\n      this.#events.close = null\n    }\n  }\n\n  get onmessage () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.message = fn\n      this.addEventListener('message', fn)\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get binaryType () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this[kBinaryType]\n  }\n\n  set binaryType (type) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (type !== 'blob' && type !== 'arraybuffer') {\n      this[kBinaryType] = 'blob'\n    } else {\n      this[kBinaryType] = type\n    }\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n   */\n  #onConnectionEstablished (response, parsedExtensions) {\n    // processResponse is called when the \"response's header list has been received and initialized.\"\n    // once this happens, the connection is open\n    this[kResponse] = response\n\n    const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions\n    const maxFragments = webSocketOptions?.maxFragments\n    const maxPayloadSize = webSocketOptions?.maxPayloadSize\n\n    const parser = new ByteParser(this, parsedExtensions, {\n      maxFragments,\n      maxPayloadSize\n    })\n    parser.on('drain', onParserDrain)\n    parser.on('error', onParserError.bind(this))\n\n    response.socket.ws = this\n    this[kByteParser] = parser\n\n    this.#sendQueue = new SendQueue(response.socket)\n\n    // 1. Change the ready state to OPEN (1).\n    this[kReadyState] = states.OPEN\n\n    // 2. Change the extensions attribute’s value to the extensions in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n    const extensions = response.headersList.get('sec-websocket-extensions')\n\n    if (extensions !== null) {\n      this.#extensions = extensions\n    }\n\n    // 3. Change the protocol attribute’s value to the subprotocol in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n    const protocol = response.headersList.get('sec-websocket-protocol')\n\n    if (protocol !== null) {\n      this.#protocol = protocol\n    }\n\n    // 4. Fire an event named open at the WebSocket object.\n    fireEvent('open', this)\n  }\n}\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors,\n  url: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  bufferedAmount: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onclose: kEnumerableProperty,\n  close: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  binaryType: kEnumerableProperty,\n  send: kEnumerableProperty,\n  extensions: kEnumerableProperty,\n  protocol: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'WebSocket',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(WebSocket, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence'] = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {\n    return webidl.converters['sequence'](V)\n  }\n\n  return webidl.converters.DOMString(V, prefix, argument)\n}\n\n// This implements the proposal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n  {\n    key: 'protocols',\n    converter: webidl.converters['DOMString or sequence'],\n    defaultValue: () => new Array(0)\n  },\n  {\n    key: 'dispatcher',\n    converter: webidl.converters.any,\n    defaultValue: () => getGlobalDispatcher()\n  },\n  {\n    key: 'headers',\n    converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n  }\n])\n\nwebidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {\n  if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {\n    return webidl.converters.WebSocketInit(V)\n  }\n\n  return { protocols: webidl.converters['DOMString or sequence'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n  if (webidl.util.Type(V) === 'Object') {\n    if (isBlobLike(V)) {\n      return webidl.converters.Blob(V, { strict: false })\n    }\n\n    if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n      return webidl.converters.BufferSource(V)\n    }\n  }\n\n  return webidl.converters.USVString(V)\n}\n\nfunction onParserDrain () {\n  this.ws[kResponse].socket.resume()\n}\n\nfunction onParserError (err) {\n  let message\n  let code\n\n  if (err instanceof CloseEvent) {\n    message = err.reason\n    code = err.code\n  } else {\n    message = err.message\n  }\n\n  fireEvent('error', this, () => new ErrorEvent('error', { error: err, message }))\n\n  closeWebSocketConnection(this, code)\n}\n\nmodule.exports = {\n  WebSocket\n}\n","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"https\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:async_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:buffer\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:console\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:crypto\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:diagnostics_channel\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:dns\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs/promises\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http2\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:path\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:perf_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:querystring\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:url\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util/types\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:worker_threads\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:zlib\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"string_decoder\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\\/\\/\\/\\w:/) ? 1 : 0, -1) + \"/\";","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"os\");","// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nexport function toCommandValue(input) {\n    if (input === null || input === undefined) {\n        return '';\n    }\n    else if (typeof input === 'string' || input instanceof String) {\n        return input;\n    }\n    return JSON.stringify(input);\n}\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nexport function toCommandProperties(annotationProperties) {\n    if (!Object.keys(annotationProperties).length) {\n        return {};\n    }\n    return {\n        title: annotationProperties.title,\n        file: annotationProperties.file,\n        line: annotationProperties.startLine,\n        endLine: annotationProperties.endLine,\n        col: annotationProperties.startColumn,\n        endColumn: annotationProperties.endColumn\n    };\n}\n//# sourceMappingURL=utils.js.map","import * as os from 'os';\nimport { toCommandValue } from './utils.js';\n/**\n * Issues a command to the GitHub Actions runner\n *\n * @param command - The command name to issue\n * @param properties - Additional properties for the command (key-value pairs)\n * @param message - The message to include with the command\n * @remarks\n * This function outputs a specially formatted string to stdout that the Actions\n * runner interprets as a command. These commands can control workflow behavior,\n * set outputs, create annotations, mask values, and more.\n *\n * Command Format:\n *   ::name key=value,key=value::message\n *\n * @example\n * ```typescript\n * // Issue a warning annotation\n * issueCommand('warning', {}, 'This is a warning message');\n * // Output: ::warning::This is a warning message\n *\n * // Set an environment variable\n * issueCommand('set-env', { name: 'MY_VAR' }, 'some value');\n * // Output: ::set-env name=MY_VAR::some value\n *\n * // Add a secret mask\n * issueCommand('add-mask', {}, 'secretValue123');\n * // Output: ::add-mask::secretValue123\n * ```\n *\n * @internal\n * This is an internal utility function that powers the public API functions\n * such as setSecret, warning, error, and exportVariable.\n */\nexport function issueCommand(command, properties, message) {\n    const cmd = new Command(command, properties, message);\n    process.stdout.write(cmd.toString() + os.EOL);\n}\nexport function issue(name, message = '') {\n    issueCommand(name, {}, message);\n}\nconst CMD_STRING = '::';\nclass Command {\n    constructor(command, properties, message) {\n        if (!command) {\n            command = 'missing.command';\n        }\n        this.command = command;\n        this.properties = properties;\n        this.message = message;\n    }\n    toString() {\n        let cmdStr = CMD_STRING + this.command;\n        if (this.properties && Object.keys(this.properties).length > 0) {\n            cmdStr += ' ';\n            let first = true;\n            for (const key in this.properties) {\n                if (this.properties.hasOwnProperty(key)) {\n                    const val = this.properties[key];\n                    if (val) {\n                        if (first) {\n                            first = false;\n                        }\n                        else {\n                            cmdStr += ',';\n                        }\n                        cmdStr += `${key}=${escapeProperty(val)}`;\n                    }\n                }\n            }\n        }\n        cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n        return cmdStr;\n    }\n}\nfunction escapeData(s) {\n    return toCommandValue(s)\n        .replace(/%/g, '%25')\n        .replace(/\\r/g, '%0D')\n        .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n    return toCommandValue(s)\n        .replace(/%/g, '%25')\n        .replace(/\\r/g, '%0D')\n        .replace(/\\n/g, '%0A')\n        .replace(/:/g, '%3A')\n        .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"crypto\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"fs\");","// For internal use, subject to change.\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as crypto from 'crypto';\nimport * as fs from 'fs';\nimport * as os from 'os';\nimport { toCommandValue } from './utils.js';\nexport function issueFileCommand(command, message) {\n    const filePath = process.env[`GITHUB_${command}`];\n    if (!filePath) {\n        throw new Error(`Unable to find environment variable for file command ${command}`);\n    }\n    if (!fs.existsSync(filePath)) {\n        throw new Error(`Missing file at path: ${filePath}`);\n    }\n    fs.appendFileSync(filePath, `${toCommandValue(message)}${os.EOL}`, {\n        encoding: 'utf8'\n    });\n}\nexport function prepareKeyValueMessage(key, value) {\n    const delimiter = `ghadelimiter_${crypto.randomUUID()}`;\n    const convertedValue = toCommandValue(value);\n    // These should realistically never happen, but just in case someone finds a\n    // way to exploit uuid generation let's not allow keys or values that contain\n    // the delimiter.\n    if (key.includes(delimiter)) {\n        throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n    }\n    if (convertedValue.includes(delimiter)) {\n        throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n    }\n    return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\n//# sourceMappingURL=file-command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"path\");","export function getProxyUrl(reqUrl) {\n    const usingSsl = reqUrl.protocol === 'https:';\n    if (checkBypass(reqUrl)) {\n        return undefined;\n    }\n    const proxyVar = (() => {\n        if (usingSsl) {\n            return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n        }\n        else {\n            return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n        }\n    })();\n    if (proxyVar) {\n        try {\n            return new DecodedURL(proxyVar);\n        }\n        catch (_a) {\n            if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))\n                return new DecodedURL(`http://${proxyVar}`);\n        }\n    }\n    else {\n        return undefined;\n    }\n}\nexport function checkBypass(reqUrl) {\n    if (!reqUrl.hostname) {\n        return false;\n    }\n    const reqHost = reqUrl.hostname;\n    if (isLoopbackAddress(reqHost)) {\n        return true;\n    }\n    const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n    if (!noProxy) {\n        return false;\n    }\n    // Determine the request port\n    let reqPort;\n    if (reqUrl.port) {\n        reqPort = Number(reqUrl.port);\n    }\n    else if (reqUrl.protocol === 'http:') {\n        reqPort = 80;\n    }\n    else if (reqUrl.protocol === 'https:') {\n        reqPort = 443;\n    }\n    // Format the request hostname and hostname with port\n    const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n    if (typeof reqPort === 'number') {\n        upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n    }\n    // Compare request host against noproxy\n    for (const upperNoProxyItem of noProxy\n        .split(',')\n        .map(x => x.trim().toUpperCase())\n        .filter(x => x)) {\n        if (upperNoProxyItem === '*' ||\n            upperReqHosts.some(x => x === upperNoProxyItem ||\n                x.endsWith(`.${upperNoProxyItem}`) ||\n                (upperNoProxyItem.startsWith('.') &&\n                    x.endsWith(`${upperNoProxyItem}`)))) {\n            return true;\n        }\n    }\n    return false;\n}\nfunction isLoopbackAddress(host) {\n    const hostLower = host.toLowerCase();\n    return (hostLower === 'localhost' ||\n        hostLower.startsWith('127.') ||\n        hostLower.startsWith('[::1]') ||\n        hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\nclass DecodedURL extends URL {\n    constructor(url, base) {\n        super(url, base);\n        this._decodedUsername = decodeURIComponent(super.username);\n        this._decodedPassword = decodeURIComponent(super.password);\n    }\n    get username() {\n        return this._decodedUsername;\n    }\n    get password() {\n        return this._decodedPassword;\n    }\n}\n//# sourceMappingURL=proxy.js.map","/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as pm from './proxy.js';\nimport * as tunnel from 'tunnel';\nimport { ProxyAgent } from 'undici';\nexport var HttpCodes;\n(function (HttpCodes) {\n    HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n    HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n    HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n    HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n    HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n    HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n    HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n    HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n    HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n    HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n    HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n    HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n    HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n    HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n    HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n    HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n    HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n    HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n    HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n    HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n    HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n    HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n    HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n    HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n    HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n    HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n    HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes || (HttpCodes = {}));\nexport var Headers;\n(function (Headers) {\n    Headers[\"Accept\"] = \"accept\";\n    Headers[\"ContentType\"] = \"content-type\";\n})(Headers || (Headers = {}));\nexport var MediaTypes;\n(function (MediaTypes) {\n    MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes || (MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl  The server URL where the request will be sent. For example, https://api.github.com\n */\nexport function getProxyUrl(serverUrl) {\n    const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n    return proxyUrl ? proxyUrl.href : '';\n}\nconst HttpRedirectCodes = [\n    HttpCodes.MovedPermanently,\n    HttpCodes.ResourceMoved,\n    HttpCodes.SeeOther,\n    HttpCodes.TemporaryRedirect,\n    HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n    HttpCodes.BadGateway,\n    HttpCodes.ServiceUnavailable,\n    HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nexport class HttpClientError extends Error {\n    constructor(message, statusCode) {\n        super(message);\n        this.name = 'HttpClientError';\n        this.statusCode = statusCode;\n        Object.setPrototypeOf(this, HttpClientError.prototype);\n    }\n}\nexport class HttpClientResponse {\n    constructor(message) {\n        this.message = message;\n    }\n    readBody() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n                let output = Buffer.alloc(0);\n                this.message.on('data', (chunk) => {\n                    output = Buffer.concat([output, chunk]);\n                });\n                this.message.on('end', () => {\n                    resolve(output.toString());\n                });\n            }));\n        });\n    }\n    readBodyBuffer() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n                const chunks = [];\n                this.message.on('data', (chunk) => {\n                    chunks.push(chunk);\n                });\n                this.message.on('end', () => {\n                    resolve(Buffer.concat(chunks));\n                });\n            }));\n        });\n    }\n}\nexport function isHttps(requestUrl) {\n    const parsedUrl = new URL(requestUrl);\n    return parsedUrl.protocol === 'https:';\n}\nexport class HttpClient {\n    constructor(userAgent, handlers, requestOptions) {\n        this._ignoreSslError = false;\n        this._allowRedirects = true;\n        this._allowRedirectDowngrade = false;\n        this._maxRedirects = 50;\n        this._allowRetries = false;\n        this._maxRetries = 1;\n        this._keepAlive = false;\n        this._disposed = false;\n        this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);\n        this.handlers = handlers || [];\n        this.requestOptions = requestOptions;\n        if (requestOptions) {\n            if (requestOptions.ignoreSslError != null) {\n                this._ignoreSslError = requestOptions.ignoreSslError;\n            }\n            this._socketTimeout = requestOptions.socketTimeout;\n            if (requestOptions.allowRedirects != null) {\n                this._allowRedirects = requestOptions.allowRedirects;\n            }\n            if (requestOptions.allowRedirectDowngrade != null) {\n                this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n            }\n            if (requestOptions.maxRedirects != null) {\n                this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n            }\n            if (requestOptions.keepAlive != null) {\n                this._keepAlive = requestOptions.keepAlive;\n            }\n            if (requestOptions.allowRetries != null) {\n                this._allowRetries = requestOptions.allowRetries;\n            }\n            if (requestOptions.maxRetries != null) {\n                this._maxRetries = requestOptions.maxRetries;\n            }\n        }\n    }\n    options(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    get(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('GET', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    del(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    post(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('POST', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    patch(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    put(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('PUT', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    head(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    sendStream(verb, requestUrl, stream, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request(verb, requestUrl, stream, additionalHeaders);\n        });\n    }\n    /**\n     * Gets a typed object from an endpoint\n     * Be aware that not found returns a null.  Other errors (4xx, 5xx) reject the promise\n     */\n    getJson(requestUrl_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            const res = yield this.get(requestUrl, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    postJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.post(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    putJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.put(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    patchJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.patch(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    /**\n     * Makes a raw http request.\n     * All other methods such as get, post, patch, and request ultimately call this.\n     * Prefer get, del, post and patch\n     */\n    request(verb, requestUrl, data, headers) {\n        return __awaiter(this, void 0, void 0, function* () {\n            if (this._disposed) {\n                throw new Error('Client has already been disposed.');\n            }\n            const parsedUrl = new URL(requestUrl);\n            let info = this._prepareRequest(verb, parsedUrl, headers);\n            // Only perform retries on reads since writes may not be idempotent.\n            const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n                ? this._maxRetries + 1\n                : 1;\n            let numTries = 0;\n            let response;\n            do {\n                response = yield this.requestRaw(info, data);\n                // Check if it's an authentication challenge\n                if (response &&\n                    response.message &&\n                    response.message.statusCode === HttpCodes.Unauthorized) {\n                    let authenticationHandler;\n                    for (const handler of this.handlers) {\n                        if (handler.canHandleAuthentication(response)) {\n                            authenticationHandler = handler;\n                            break;\n                        }\n                    }\n                    if (authenticationHandler) {\n                        return authenticationHandler.handleAuthentication(this, info, data);\n                    }\n                    else {\n                        // We have received an unauthorized response but have no handlers to handle it.\n                        // Let the response return to the caller.\n                        return response;\n                    }\n                }\n                let redirectsRemaining = this._maxRedirects;\n                while (response.message.statusCode &&\n                    HttpRedirectCodes.includes(response.message.statusCode) &&\n                    this._allowRedirects &&\n                    redirectsRemaining > 0) {\n                    const redirectUrl = response.message.headers['location'];\n                    if (!redirectUrl) {\n                        // if there's no location to redirect to, we won't\n                        break;\n                    }\n                    const parsedRedirectUrl = new URL(redirectUrl);\n                    if (parsedUrl.protocol === 'https:' &&\n                        parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n                        !this._allowRedirectDowngrade) {\n                        throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n                    }\n                    // we need to finish reading the response before reassigning response\n                    // which will leak the open socket.\n                    yield response.readBody();\n                    // strip authorization header if redirected to a different hostname\n                    if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n                        for (const header in headers) {\n                            // header names are case insensitive\n                            if (header.toLowerCase() === 'authorization') {\n                                delete headers[header];\n                            }\n                        }\n                    }\n                    // let's make the request with the new redirectUrl\n                    info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n                    response = yield this.requestRaw(info, data);\n                    redirectsRemaining--;\n                }\n                if (!response.message.statusCode ||\n                    !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n                    // If not a retry code, return immediately instead of retrying\n                    return response;\n                }\n                numTries += 1;\n                if (numTries < maxTries) {\n                    yield response.readBody();\n                    yield this._performExponentialBackoff(numTries);\n                }\n            } while (numTries < maxTries);\n            return response;\n        });\n    }\n    /**\n     * Needs to be called if keepAlive is set to true in request options.\n     */\n    dispose() {\n        if (this._agent) {\n            this._agent.destroy();\n        }\n        this._disposed = true;\n    }\n    /**\n     * Raw request.\n     * @param info\n     * @param data\n     */\n    requestRaw(info, data) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve, reject) => {\n                function callbackForResult(err, res) {\n                    if (err) {\n                        reject(err);\n                    }\n                    else if (!res) {\n                        // If `err` is not passed, then `res` must be passed.\n                        reject(new Error('Unknown error'));\n                    }\n                    else {\n                        resolve(res);\n                    }\n                }\n                this.requestRawWithCallback(info, data, callbackForResult);\n            });\n        });\n    }\n    /**\n     * Raw request with callback.\n     * @param info\n     * @param data\n     * @param onResult\n     */\n    requestRawWithCallback(info, data, onResult) {\n        if (typeof data === 'string') {\n            if (!info.options.headers) {\n                info.options.headers = {};\n            }\n            info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n        }\n        let callbackCalled = false;\n        function handleResult(err, res) {\n            if (!callbackCalled) {\n                callbackCalled = true;\n                onResult(err, res);\n            }\n        }\n        const req = info.httpModule.request(info.options, (msg) => {\n            const res = new HttpClientResponse(msg);\n            handleResult(undefined, res);\n        });\n        let socket;\n        req.on('socket', sock => {\n            socket = sock;\n        });\n        // If we ever get disconnected, we want the socket to timeout eventually\n        req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n            if (socket) {\n                socket.end();\n            }\n            handleResult(new Error(`Request timeout: ${info.options.path}`));\n        });\n        req.on('error', function (err) {\n            // err has statusCode property\n            // res should have headers\n            handleResult(err);\n        });\n        if (data && typeof data === 'string') {\n            req.write(data, 'utf8');\n        }\n        if (data && typeof data !== 'string') {\n            data.on('close', function () {\n                req.end();\n            });\n            data.pipe(req);\n        }\n        else {\n            req.end();\n        }\n    }\n    /**\n     * Gets an http agent. This function is useful when you need an http agent that handles\n     * routing through a proxy server - depending upon the url and proxy environment variables.\n     * @param serverUrl  The server URL where the request will be sent. For example, https://api.github.com\n     */\n    getAgent(serverUrl) {\n        const parsedUrl = new URL(serverUrl);\n        return this._getAgent(parsedUrl);\n    }\n    getAgentDispatcher(serverUrl) {\n        const parsedUrl = new URL(serverUrl);\n        const proxyUrl = pm.getProxyUrl(parsedUrl);\n        const useProxy = proxyUrl && proxyUrl.hostname;\n        if (!useProxy) {\n            return;\n        }\n        return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);\n    }\n    _prepareRequest(method, requestUrl, headers) {\n        const info = {};\n        info.parsedUrl = requestUrl;\n        const usingSsl = info.parsedUrl.protocol === 'https:';\n        info.httpModule = usingSsl ? https : http;\n        const defaultPort = usingSsl ? 443 : 80;\n        info.options = {};\n        info.options.host = info.parsedUrl.hostname;\n        info.options.port = info.parsedUrl.port\n            ? parseInt(info.parsedUrl.port)\n            : defaultPort;\n        info.options.path =\n            (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n        info.options.method = method;\n        info.options.headers = this._mergeHeaders(headers);\n        if (this.userAgent != null) {\n            info.options.headers['user-agent'] = this.userAgent;\n        }\n        info.options.agent = this._getAgent(info.parsedUrl);\n        // gives handlers an opportunity to participate\n        if (this.handlers) {\n            for (const handler of this.handlers) {\n                handler.prepareRequest(info.options);\n            }\n        }\n        return info;\n    }\n    _mergeHeaders(headers) {\n        if (this.requestOptions && this.requestOptions.headers) {\n            return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n        }\n        return lowercaseKeys(headers || {});\n    }\n    /**\n     * Gets an existing header value or returns a default.\n     * Handles converting number header values to strings since HTTP headers must be strings.\n     * Note: This returns string | string[] since some headers can have multiple values.\n     * For headers that must always be a single string (like Content-Type), use the\n     * specialized _getExistingOrDefaultContentTypeHeader method instead.\n     */\n    _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n        let clientHeader;\n        if (this.requestOptions && this.requestOptions.headers) {\n            const headerValue = lowercaseKeys(this.requestOptions.headers)[header];\n            if (headerValue) {\n                clientHeader =\n                    typeof headerValue === 'number' ? headerValue.toString() : headerValue;\n            }\n        }\n        const additionalValue = additionalHeaders[header];\n        if (additionalValue !== undefined) {\n            return typeof additionalValue === 'number'\n                ? additionalValue.toString()\n                : additionalValue;\n        }\n        if (clientHeader !== undefined) {\n            return clientHeader;\n        }\n        return _default;\n    }\n    /**\n     * Specialized version of _getExistingOrDefaultHeader for Content-Type header.\n     * Always returns a single string (not an array) since Content-Type should be a single value.\n     * Converts arrays to comma-separated strings and numbers to strings to ensure type safety.\n     * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers\n     * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).\n     */\n    _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {\n        let clientHeader;\n        if (this.requestOptions && this.requestOptions.headers) {\n            const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];\n            if (headerValue) {\n                if (typeof headerValue === 'number') {\n                    clientHeader = String(headerValue);\n                }\n                else if (Array.isArray(headerValue)) {\n                    clientHeader = headerValue.join(', ');\n                }\n                else {\n                    clientHeader = headerValue;\n                }\n            }\n        }\n        const additionalValue = additionalHeaders[Headers.ContentType];\n        // Return the first non-undefined value, converting numbers or arrays to strings if necessary\n        if (additionalValue !== undefined) {\n            if (typeof additionalValue === 'number') {\n                return String(additionalValue);\n            }\n            else if (Array.isArray(additionalValue)) {\n                return additionalValue.join(', ');\n            }\n            else {\n                return additionalValue;\n            }\n        }\n        if (clientHeader !== undefined) {\n            return clientHeader;\n        }\n        return _default;\n    }\n    _getAgent(parsedUrl) {\n        let agent;\n        const proxyUrl = pm.getProxyUrl(parsedUrl);\n        const useProxy = proxyUrl && proxyUrl.hostname;\n        if (this._keepAlive && useProxy) {\n            agent = this._proxyAgent;\n        }\n        if (!useProxy) {\n            agent = this._agent;\n        }\n        // if agent is already assigned use that agent.\n        if (agent) {\n            return agent;\n        }\n        const usingSsl = parsedUrl.protocol === 'https:';\n        let maxSockets = 100;\n        if (this.requestOptions) {\n            maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n        }\n        // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n        if (proxyUrl && proxyUrl.hostname) {\n            const agentOptions = {\n                maxSockets,\n                keepAlive: this._keepAlive,\n                proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n                    proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n                })), { host: proxyUrl.hostname, port: proxyUrl.port })\n            };\n            let tunnelAgent;\n            const overHttps = proxyUrl.protocol === 'https:';\n            if (usingSsl) {\n                tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n            }\n            else {\n                tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n            }\n            agent = tunnelAgent(agentOptions);\n            this._proxyAgent = agent;\n        }\n        // if tunneling agent isn't assigned create a new agent\n        if (!agent) {\n            const options = { keepAlive: this._keepAlive, maxSockets };\n            agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n            this._agent = agent;\n        }\n        if (usingSsl && this._ignoreSslError) {\n            // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n            // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n            // we have to cast it to any and change it directly\n            agent.options = Object.assign(agent.options || {}, {\n                rejectUnauthorized: false\n            });\n        }\n        return agent;\n    }\n    _getProxyAgentDispatcher(parsedUrl, proxyUrl) {\n        let proxyAgent;\n        if (this._keepAlive) {\n            proxyAgent = this._proxyAgentDispatcher;\n        }\n        // if agent is already assigned use that agent.\n        if (proxyAgent) {\n            return proxyAgent;\n        }\n        const usingSsl = parsedUrl.protocol === 'https:';\n        proxyAgent = new ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {\n            token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`\n        })));\n        this._proxyAgentDispatcher = proxyAgent;\n        if (usingSsl && this._ignoreSslError) {\n            // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n            // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n            // we have to cast it to any and change it directly\n            proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {\n                rejectUnauthorized: false\n            });\n        }\n        return proxyAgent;\n    }\n    _getUserAgentWithOrchestrationId(userAgent) {\n        const baseUserAgent = userAgent || 'actions/http-client';\n        const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];\n        if (orchId) {\n            // Sanitize the orchestration ID to ensure it contains only valid characters\n            // Valid characters: 0-9, a-z, _, -, .\n            const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');\n            return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;\n        }\n        return baseUserAgent;\n    }\n    _performExponentialBackoff(retryNumber) {\n        return __awaiter(this, void 0, void 0, function* () {\n            retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n            const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n            return new Promise(resolve => setTimeout(() => resolve(), ms));\n        });\n    }\n    _processResponse(res, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n                const statusCode = res.message.statusCode || 0;\n                const response = {\n                    statusCode,\n                    result: null,\n                    headers: {}\n                };\n                // not found leads to null obj returned\n                if (statusCode === HttpCodes.NotFound) {\n                    resolve(response);\n                }\n                // get the result from the body\n                function dateTimeDeserializer(key, value) {\n                    if (typeof value === 'string') {\n                        const a = new Date(value);\n                        if (!isNaN(a.valueOf())) {\n                            return a;\n                        }\n                    }\n                    return value;\n                }\n                let obj;\n                let contents;\n                try {\n                    contents = yield res.readBody();\n                    if (contents && contents.length > 0) {\n                        if (options && options.deserializeDates) {\n                            obj = JSON.parse(contents, dateTimeDeserializer);\n                        }\n                        else {\n                            obj = JSON.parse(contents);\n                        }\n                        response.result = obj;\n                    }\n                    response.headers = res.message.headers;\n                }\n                catch (err) {\n                    // Invalid resource (contents not json);  leaving result obj null\n                }\n                // note that 3xx redirects are handled by the http layer.\n                if (statusCode > 299) {\n                    let msg;\n                    // if exception/error in body, attempt to get better error\n                    if (obj && obj.message) {\n                        msg = obj.message;\n                    }\n                    else if (contents && contents.length > 0) {\n                        // it may be the case that the exception is in the body message as string\n                        msg = contents;\n                    }\n                    else {\n                        msg = `Failed request: (${statusCode})`;\n                    }\n                    const err = new HttpClientError(msg, statusCode);\n                    err.result = response.result;\n                    reject(err);\n                }\n                else {\n                    resolve(response);\n                }\n            }));\n        });\n    }\n}\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nexport class BasicCredentialHandler {\n    constructor(username, password) {\n        this.username = username;\n        this.password = password;\n    }\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\nexport class BearerCredentialHandler {\n    constructor(token) {\n        this.token = token;\n    }\n    // currently implements pre-authorization\n    // TODO: support preAuth = false where it hooks on 401\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Bearer ${this.token}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\nexport class PersonalAccessTokenCredentialHandler {\n    constructor(token) {\n        this.token = token;\n    }\n    // currently implements pre-authorization\n    // TODO: support preAuth = false where it hooks on 401\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\n//# sourceMappingURL=auth.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { HttpClient } from '@actions/http-client';\nimport { BearerCredentialHandler } from '@actions/http-client/lib/auth';\nimport { debug, setSecret } from './core.js';\nexport class OidcClient {\n    static createHttpClient(allowRetry = true, maxRetry = 10) {\n        const requestOptions = {\n            allowRetries: allowRetry,\n            maxRetries: maxRetry\n        };\n        return new HttpClient('actions/oidc-client', [new BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n    }\n    static getRequestToken() {\n        const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n        if (!token) {\n            throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n        }\n        return token;\n    }\n    static getIDTokenUrl() {\n        const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n        if (!runtimeUrl) {\n            throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n        }\n        return runtimeUrl;\n    }\n    static getCall(id_token_url) {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a;\n            const httpclient = OidcClient.createHttpClient();\n            const res = yield httpclient\n                .getJson(id_token_url)\n                .catch(error => {\n                throw new Error(`Failed to get ID Token. \\n \n        Error Code : ${error.statusCode}\\n \n        Error Message: ${error.message}`);\n            });\n            const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n            if (!id_token) {\n                throw new Error('Response json body do not have ID Token field');\n            }\n            return id_token;\n        });\n    }\n    static getIDToken(audience) {\n        return __awaiter(this, void 0, void 0, function* () {\n            try {\n                // New ID Token is requested from action service\n                let id_token_url = OidcClient.getIDTokenUrl();\n                if (audience) {\n                    const encodedAudience = encodeURIComponent(audience);\n                    id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n                }\n                debug(`ID token url is ${id_token_url}`);\n                const id_token = yield OidcClient.getCall(id_token_url);\n                setSecret(id_token);\n                return id_token;\n            }\n            catch (error) {\n                throw new Error(`Error message: ${error.message}`);\n            }\n        });\n    }\n}\n//# sourceMappingURL=oidc-utils.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { EOL } from 'os';\nimport { constants, promises } from 'fs';\nconst { access, appendFile, writeFile } = promises;\nexport const SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexport const SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n    constructor() {\n        this._buffer = '';\n    }\n    /**\n     * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n     * Also checks r/w permissions.\n     *\n     * @returns step summary file path\n     */\n    filePath() {\n        return __awaiter(this, void 0, void 0, function* () {\n            if (this._filePath) {\n                return this._filePath;\n            }\n            const pathFromEnv = process.env[SUMMARY_ENV_VAR];\n            if (!pathFromEnv) {\n                throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n            }\n            try {\n                yield access(pathFromEnv, constants.R_OK | constants.W_OK);\n            }\n            catch (_a) {\n                throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n            }\n            this._filePath = pathFromEnv;\n            return this._filePath;\n        });\n    }\n    /**\n     * Wraps content in an HTML tag, adding any HTML attributes\n     *\n     * @param {string} tag HTML tag to wrap\n     * @param {string | null} content content within the tag\n     * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n     *\n     * @returns {string} content wrapped in HTML element\n     */\n    wrap(tag, content, attrs = {}) {\n        const htmlAttrs = Object.entries(attrs)\n            .map(([key, value]) => ` ${key}=\"${value}\"`)\n            .join('');\n        if (!content) {\n            return `<${tag}${htmlAttrs}>`;\n        }\n        return `<${tag}${htmlAttrs}>${content}`;\n    }\n    /**\n     * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n     *\n     * @param {SummaryWriteOptions} [options] (optional) options for write operation\n     *\n     * @returns {Promise} summary instance\n     */\n    write(options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n            const filePath = yield this.filePath();\n            const writeFunc = overwrite ? writeFile : appendFile;\n            yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n            return this.emptyBuffer();\n        });\n    }\n    /**\n     * Clears the summary buffer and wipes the summary file\n     *\n     * @returns {Summary} summary instance\n     */\n    clear() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.emptyBuffer().write({ overwrite: true });\n        });\n    }\n    /**\n     * Returns the current summary buffer as a string\n     *\n     * @returns {string} string of summary buffer\n     */\n    stringify() {\n        return this._buffer;\n    }\n    /**\n     * If the summary buffer is empty\n     *\n     * @returns {boolen} true if the buffer is empty\n     */\n    isEmptyBuffer() {\n        return this._buffer.length === 0;\n    }\n    /**\n     * Resets the summary buffer without writing to summary file\n     *\n     * @returns {Summary} summary instance\n     */\n    emptyBuffer() {\n        this._buffer = '';\n        return this;\n    }\n    /**\n     * Adds raw text to the summary buffer\n     *\n     * @param {string} text content to add\n     * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n     *\n     * @returns {Summary} summary instance\n     */\n    addRaw(text, addEOL = false) {\n        this._buffer += text;\n        return addEOL ? this.addEOL() : this;\n    }\n    /**\n     * Adds the operating system-specific end-of-line marker to the buffer\n     *\n     * @returns {Summary} summary instance\n     */\n    addEOL() {\n        return this.addRaw(EOL);\n    }\n    /**\n     * Adds an HTML codeblock to the summary buffer\n     *\n     * @param {string} code content to render within fenced code block\n     * @param {string} lang (optional) language to syntax highlight code\n     *\n     * @returns {Summary} summary instance\n     */\n    addCodeBlock(code, lang) {\n        const attrs = Object.assign({}, (lang && { lang }));\n        const element = this.wrap('pre', this.wrap('code', code), attrs);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML list to the summary buffer\n     *\n     * @param {string[]} items list of items to render\n     * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n     *\n     * @returns {Summary} summary instance\n     */\n    addList(items, ordered = false) {\n        const tag = ordered ? 'ol' : 'ul';\n        const listItems = items.map(item => this.wrap('li', item)).join('');\n        const element = this.wrap(tag, listItems);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML table to the summary buffer\n     *\n     * @param {SummaryTableCell[]} rows table rows\n     *\n     * @returns {Summary} summary instance\n     */\n    addTable(rows) {\n        const tableBody = rows\n            .map(row => {\n            const cells = row\n                .map(cell => {\n                if (typeof cell === 'string') {\n                    return this.wrap('td', cell);\n                }\n                const { header, data, colspan, rowspan } = cell;\n                const tag = header ? 'th' : 'td';\n                const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n                return this.wrap(tag, data, attrs);\n            })\n                .join('');\n            return this.wrap('tr', cells);\n        })\n            .join('');\n        const element = this.wrap('table', tableBody);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds a collapsable HTML details element to the summary buffer\n     *\n     * @param {string} label text for the closed state\n     * @param {string} content collapsable content\n     *\n     * @returns {Summary} summary instance\n     */\n    addDetails(label, content) {\n        const element = this.wrap('details', this.wrap('summary', label) + content);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML image tag to the summary buffer\n     *\n     * @param {string} src path to the image you to embed\n     * @param {string} alt text description of the image\n     * @param {SummaryImageOptions} options (optional) addition image attributes\n     *\n     * @returns {Summary} summary instance\n     */\n    addImage(src, alt, options) {\n        const { width, height } = options || {};\n        const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n        const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML section heading element\n     *\n     * @param {string} text heading text\n     * @param {number | string} [level=1] (optional) the heading level, default: 1\n     *\n     * @returns {Summary} summary instance\n     */\n    addHeading(text, level) {\n        const tag = `h${level}`;\n        const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n            ? tag\n            : 'h1';\n        const element = this.wrap(allowedTag, text);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexport const markdownSummary = _summary;\nexport const summary = _summary;\n//# sourceMappingURL=summary.js.map","import * as path from 'path';\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nexport function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nexport function toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nexport function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\n//# sourceMappingURL=path-utils.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"child_process\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as fs from 'fs';\nimport * as path from 'path';\nexport const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises;\n// export const {open} = 'fs'\nexport const IS_WINDOWS = process.platform === 'win32';\n/**\n * Custom implementation of readlink to ensure Windows junctions\n * maintain trailing backslash for backward compatibility with Node.js < 24\n *\n * In Node.js 20, Windows junctions (directory symlinks) always returned paths\n * with trailing backslashes. Node.js 24 removed this behavior, which breaks\n * code that relied on this format for path operations.\n *\n * This implementation restores the Node 20 behavior by adding a trailing\n * backslash to all junction results on Windows.\n */\nexport function readlink(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield fs.promises.readlink(fsPath);\n // On Windows, restore Node 20 behavior: add trailing backslash to all results\n // since junctions on Windows are always directory links\n if (IS_WINDOWS && !result.endsWith('\\\\')) {\n return `${result}\\\\`;\n }\n return result;\n });\n}\n// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691\nexport const UV_FS_O_EXLOCK = 0x10000000;\nexport const READONLY = fs.constants.O_RDONLY;\nexport function exists(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n yield stat(fsPath);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n }\n return true;\n });\n}\nexport function isDirectory(fsPath_1) {\n return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) {\n const stats = useStat ? yield stat(fsPath) : yield lstat(fsPath);\n return stats.isDirectory();\n });\n}\n/**\n * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:\n * \\, \\hello, \\\\hello\\share, C:, and C:\\hello (and corresponding alternate separator cases).\n */\nexport function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}\n/**\n * Best effort attempt to determine whether a file exists and is executable.\n * @param filePath file path to check\n * @param extensions additional file extensions to try\n * @return if file exists and is executable, returns the file path. otherwise empty string.\n */\nexport function tryGetExecutablePath(filePath, extensions) {\n return __awaiter(this, void 0, void 0, function* () {\n let stats = undefined;\n try {\n // test file exists\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // on Windows, test for valid extension\n const upperExt = path.extname(filePath).toUpperCase();\n if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {\n return filePath;\n }\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n // try each extension\n const originalFilePath = filePath;\n for (const extension of extensions) {\n filePath = originalFilePath + extension;\n stats = undefined;\n try {\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // preserve the case of the actual file (since an extension was appended)\n try {\n const directory = path.dirname(filePath);\n const upperName = path.basename(filePath).toUpperCase();\n for (const actualName of yield readdir(directory)) {\n if (upperName === actualName.toUpperCase()) {\n filePath = path.join(directory, actualName);\n break;\n }\n }\n }\n catch (err) {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);\n }\n return filePath;\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n }\n return '';\n });\n}\nfunction normalizeSeparators(p) {\n p = p || '';\n if (IS_WINDOWS) {\n // convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // remove redundant slashes\n return p.replace(/\\\\\\\\+/g, '\\\\');\n }\n // remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n// on Mac/Linux, test the execute bit\n// R W X R W X R W X\n// 256 128 64 32 16 8 4 2 1\nfunction isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 &&\n process.getgid !== undefined &&\n stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 &&\n process.getuid !== undefined &&\n stats.uid === process.getuid()));\n}\n// Get the path of cmd.exe in windows\nexport function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}\n//# sourceMappingURL=io-util.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ok } from 'assert';\nimport * as path from 'path';\nimport * as ioUtil from './io-util.js';\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nexport function cp(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n const { force, recursive, copySourceDirectory } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory() && copySourceDirectory\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nexport function mv(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nexport function rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Check for invalid characters\n // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n if (/[*\"<>|]/.test(inputPath)) {\n throw new Error('File path must not contain `*`, `\"`, `<`, `>` or `|` on Windows');\n }\n }\n try {\n // note if path does not exist, error is silent\n yield ioUtil.rm(inputPath, {\n force: true,\n maxRetries: 3,\n recursive: true,\n retryDelay: 300\n });\n }\n catch (err) {\n throw new Error(`File was unable to be removed ${err}`);\n }\n });\n}\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nexport function mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n ok(fsPath, 'a path argument must be provided');\n yield ioUtil.mkdir(fsPath, { recursive: true });\n });\n}\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nexport function which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nexport function findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n const copySourceDirectory = options.copySourceDirectory == null\n ? true\n : Boolean(options.copySourceDirectory);\n return { force, recursive, copySourceDirectory };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"timers\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as os from 'os';\nimport * as events from 'events';\nimport * as child from 'child_process';\nimport * as path from 'path';\nimport * as io from '@actions/io';\nimport * as ioUtil from '@actions/io/lib/io-util';\nimport { setTimeout } from 'timers';\n/* eslint-disable @typescript-eslint/unbound-method */\nconst IS_WINDOWS = process.platform === 'win32';\n/*\n * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.\n */\nexport class ToolRunner extends events.EventEmitter {\n constructor(toolPath, args, options) {\n super();\n if (!toolPath) {\n throw new Error(\"Parameter 'toolPath' cannot be null or empty.\");\n }\n this.toolPath = toolPath;\n this.args = args || [];\n this.options = options || {};\n }\n _debug(message) {\n if (this.options.listeners && this.options.listeners.debug) {\n this.options.listeners.debug(message);\n }\n }\n _getCommandString(options, noPrefix) {\n const toolPath = this._getSpawnFileName();\n const args = this._getSpawnArgs(options);\n let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool\n if (IS_WINDOWS) {\n // Windows + cmd file\n if (this._isCmdFile()) {\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows + verbatim\n else if (options.windowsVerbatimArguments) {\n cmd += `\"${toolPath}\"`;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows (regular)\n else {\n cmd += this._windowsQuoteCmdArg(toolPath);\n for (const a of args) {\n cmd += ` ${this._windowsQuoteCmdArg(a)}`;\n }\n }\n }\n else {\n // OSX/Linux - this can likely be improved with some form of quoting.\n // creating processes on Unix is fundamentally different than Windows.\n // on Unix, execvp() takes an arg array.\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n return cmd;\n }\n _processLineBuffer(data, strBuffer, onLine) {\n try {\n let s = strBuffer + data.toString();\n let n = s.indexOf(os.EOL);\n while (n > -1) {\n const line = s.substring(0, n);\n onLine(line);\n // the rest of the string ...\n s = s.substring(n + os.EOL.length);\n n = s.indexOf(os.EOL);\n }\n return s;\n }\n catch (err) {\n // streaming lines to console is best effort. Don't fail a build.\n this._debug(`error processing line. Failed with error ${err}`);\n return '';\n }\n }\n _getSpawnFileName() {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n return process.env['COMSPEC'] || 'cmd.exe';\n }\n }\n return this.toolPath;\n }\n _getSpawnArgs(options) {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n let argline = `/D /S /C \"${this._windowsQuoteCmdArg(this.toolPath)}`;\n for (const a of this.args) {\n argline += ' ';\n argline += options.windowsVerbatimArguments\n ? a\n : this._windowsQuoteCmdArg(a);\n }\n argline += '\"';\n return [argline];\n }\n }\n return this.args;\n }\n _endsWith(str, end) {\n return str.endsWith(end);\n }\n _isCmdFile() {\n const upperToolPath = this.toolPath.toUpperCase();\n return (this._endsWith(upperToolPath, '.CMD') ||\n this._endsWith(upperToolPath, '.BAT'));\n }\n _windowsQuoteCmdArg(arg) {\n // for .exe, apply the normal quoting rules that libuv applies\n if (!this._isCmdFile()) {\n return this._uvQuoteCmdArg(arg);\n }\n // otherwise apply quoting rules specific to the cmd.exe command line parser.\n // the libuv rules are generic and are not designed specifically for cmd.exe\n // command line parser.\n //\n // for a detailed description of the cmd.exe command line parser, refer to\n // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912\n // need quotes for empty arg\n if (!arg) {\n return '\"\"';\n }\n // determine whether the arg needs to be quoted\n const cmdSpecialChars = [\n ' ',\n '\\t',\n '&',\n '(',\n ')',\n '[',\n ']',\n '{',\n '}',\n '^',\n '=',\n ';',\n '!',\n \"'\",\n '+',\n ',',\n '`',\n '~',\n '|',\n '<',\n '>',\n '\"'\n ];\n let needsQuotes = false;\n for (const char of arg) {\n if (cmdSpecialChars.some(x => x === char)) {\n needsQuotes = true;\n break;\n }\n }\n // short-circuit if quotes not needed\n if (!needsQuotes) {\n return arg;\n }\n // the following quoting rules are very similar to the rules that by libuv applies.\n //\n // 1) wrap the string in quotes\n //\n // 2) double-up quotes - i.e. \" => \"\"\n //\n // this is different from the libuv quoting rules. libuv replaces \" with \\\", which unfortunately\n // doesn't work well with a cmd.exe command line.\n //\n // note, replacing \" with \"\" also works well if the arg is passed to a downstream .NET console app.\n // for example, the command line:\n // foo.exe \"myarg:\"\"my val\"\"\"\n // is parsed by a .NET console app into an arg array:\n // [ \"myarg:\\\"my val\\\"\" ]\n // which is the same end result when applying libuv quoting rules. although the actual\n // command line from libuv quoting rules would look like:\n // foo.exe \"myarg:\\\"my val\\\"\"\n //\n // 3) double-up slashes that precede a quote,\n // e.g. hello \\world => \"hello \\world\"\n // hello\\\"world => \"hello\\\\\"\"world\"\n // hello\\\\\"world => \"hello\\\\\\\\\"\"world\"\n // hello world\\ => \"hello world\\\\\"\n //\n // technically this is not required for a cmd.exe command line, or the batch argument parser.\n // the reasons for including this as a .cmd quoting rule are:\n //\n // a) this is optimized for the scenario where the argument is passed from the .cmd file to an\n // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.\n //\n // b) it's what we've been doing previously (by deferring to node default behavior) and we\n // haven't heard any complaints about that aspect.\n //\n // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be\n // escaped when used on the command line directly - even though within a .cmd file % can be escaped\n // by using %%.\n //\n // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts\n // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.\n //\n // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would\n // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the\n // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args\n // to an external program.\n //\n // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.\n // % can be escaped within a .cmd file.\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\'; // double the slash\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\"'; // double the quote\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _uvQuoteCmdArg(arg) {\n // Tool runner wraps child_process.spawn() and needs to apply the same quoting as\n // Node in certain cases where the undocumented spawn option windowsVerbatimArguments\n // is used.\n //\n // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,\n // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),\n // pasting copyright notice from Node within this function:\n //\n // Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to\n // deal in the Software without restriction, including without limitation the\n // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n // sell copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n //\n // The above copyright notice and this permission notice shall be included in\n // all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n // IN THE SOFTWARE.\n if (!arg) {\n // Need double quotation for empty argument\n return '\"\"';\n }\n if (!arg.includes(' ') && !arg.includes('\\t') && !arg.includes('\"')) {\n // No quotation needed\n return arg;\n }\n if (!arg.includes('\"') && !arg.includes('\\\\')) {\n // No embedded double quotes or backslashes, so I can just wrap\n // quote marks around the whole thing.\n return `\"${arg}\"`;\n }\n // Expected input/output:\n // input : hello\"world\n // output: \"hello\\\"world\"\n // input : hello\"\"world\n // output: \"hello\\\"\\\"world\"\n // input : hello\\world\n // output: hello\\world\n // input : hello\\\\world\n // output: hello\\\\world\n // input : hello\\\"world\n // output: \"hello\\\\\\\"world\"\n // input : hello\\\\\"world\n // output: \"hello\\\\\\\\\\\"world\"\n // input : hello world\\\n // output: \"hello world\\\\\" - note the comment in libuv actually reads \"hello world\\\"\n // but it appears the comment is wrong, it should be \"hello world\\\\\"\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\';\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\\\\';\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _cloneExecOptions(options) {\n options = options || {};\n const result = {\n cwd: options.cwd || process.cwd(),\n env: options.env || process.env,\n silent: options.silent || false,\n windowsVerbatimArguments: options.windowsVerbatimArguments || false,\n failOnStdErr: options.failOnStdErr || false,\n ignoreReturnCode: options.ignoreReturnCode || false,\n delay: options.delay || 10000\n };\n result.outStream = options.outStream || process.stdout;\n result.errStream = options.errStream || process.stderr;\n return result;\n }\n _getSpawnOptions(options, toolPath) {\n options = options || {};\n const result = {};\n result.cwd = options.cwd;\n result.env = options.env;\n result['windowsVerbatimArguments'] =\n options.windowsVerbatimArguments || this._isCmdFile();\n if (options.windowsVerbatimArguments) {\n result.argv0 = `\"${toolPath}\"`;\n }\n return result;\n }\n /**\n * Exec a tool.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param tool path to tool to exec\n * @param options optional exec options. See ExecOptions\n * @returns number\n */\n exec() {\n return __awaiter(this, void 0, void 0, function* () {\n // root the tool path if it is unrooted and contains relative pathing\n if (!ioUtil.isRooted(this.toolPath) &&\n (this.toolPath.includes('/') ||\n (IS_WINDOWS && this.toolPath.includes('\\\\')))) {\n // prefer options.cwd if it is specified, however options.cwd may also need to be rooted\n this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);\n }\n // if the tool is only a file name, then resolve it from the PATH\n // otherwise verify it exists (add extension on Windows if necessary)\n this.toolPath = yield io.which(this.toolPath, true);\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n this._debug(`exec tool: ${this.toolPath}`);\n this._debug('arguments:');\n for (const arg of this.args) {\n this._debug(` ${arg}`);\n }\n const optionsNonNull = this._cloneExecOptions(this.options);\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);\n }\n const state = new ExecState(optionsNonNull, this.toolPath);\n state.on('debug', (message) => {\n this._debug(message);\n });\n if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {\n return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));\n }\n const fileName = this._getSpawnFileName();\n const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));\n let stdbuffer = '';\n if (cp.stdout) {\n cp.stdout.on('data', (data) => {\n if (this.options.listeners && this.options.listeners.stdout) {\n this.options.listeners.stdout(data);\n }\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(data);\n }\n stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.stdline) {\n this.options.listeners.stdline(line);\n }\n });\n });\n }\n let errbuffer = '';\n if (cp.stderr) {\n cp.stderr.on('data', (data) => {\n state.processStderr = true;\n if (this.options.listeners && this.options.listeners.stderr) {\n this.options.listeners.stderr(data);\n }\n if (!optionsNonNull.silent &&\n optionsNonNull.errStream &&\n optionsNonNull.outStream) {\n const s = optionsNonNull.failOnStdErr\n ? optionsNonNull.errStream\n : optionsNonNull.outStream;\n s.write(data);\n }\n errbuffer = this._processLineBuffer(data, errbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.errline) {\n this.options.listeners.errline(line);\n }\n });\n });\n }\n cp.on('error', (err) => {\n state.processError = err.message;\n state.processExited = true;\n state.processClosed = true;\n state.CheckComplete();\n });\n cp.on('exit', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n cp.on('close', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n state.processClosed = true;\n this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n state.on('done', (error, exitCode) => {\n if (stdbuffer.length > 0) {\n this.emit('stdline', stdbuffer);\n }\n if (errbuffer.length > 0) {\n this.emit('errline', errbuffer);\n }\n cp.removeAllListeners();\n if (error) {\n reject(error);\n }\n else {\n resolve(exitCode);\n }\n });\n if (this.options.input) {\n if (!cp.stdin) {\n throw new Error('child process missing stdin');\n }\n cp.stdin.end(this.options.input);\n }\n }));\n });\n }\n}\n/**\n * Convert an arg string to an array of args. Handles escaping\n *\n * @param argString string of arguments\n * @returns string[] array of arguments\n */\nexport function argStringToArray(argString) {\n const args = [];\n let inQuotes = false;\n let escaped = false;\n let arg = '';\n function append(c) {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\';\n }\n arg += c;\n escaped = false;\n }\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i);\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes;\n }\n else {\n append(c);\n }\n continue;\n }\n if (c === '\\\\' && escaped) {\n append(c);\n continue;\n }\n if (c === '\\\\' && inQuotes) {\n escaped = true;\n continue;\n }\n if (c === ' ' && !inQuotes) {\n if (arg.length > 0) {\n args.push(arg);\n arg = '';\n }\n continue;\n }\n append(c);\n }\n if (arg.length > 0) {\n args.push(arg.trim());\n }\n return args;\n}\nclass ExecState extends events.EventEmitter {\n constructor(options, toolPath) {\n super();\n this.processClosed = false; // tracks whether the process has exited and stdio is closed\n this.processError = '';\n this.processExitCode = 0;\n this.processExited = false; // tracks whether the process has exited\n this.processStderr = false; // tracks whether stderr was written to\n this.delay = 10000; // 10 seconds\n this.done = false;\n this.timeout = null;\n if (!toolPath) {\n throw new Error('toolPath must not be empty');\n }\n this.options = options;\n this.toolPath = toolPath;\n if (options.delay) {\n this.delay = options.delay;\n }\n }\n CheckComplete() {\n if (this.done) {\n return;\n }\n if (this.processClosed) {\n this._setResult();\n }\n else if (this.processExited) {\n this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);\n }\n }\n _debug(message) {\n this.emit('debug', message);\n }\n _setResult() {\n // determine whether there is an error\n let error;\n if (this.processExited) {\n if (this.processError) {\n error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);\n }\n else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {\n error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);\n }\n else if (this.processStderr && this.options.failOnStdErr) {\n error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);\n }\n }\n // clear the timeout\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.done = true;\n this.emit('done', error, this.processExitCode);\n }\n static HandleTimeout(state) {\n if (state.done) {\n return;\n }\n if (!state.processClosed && state.processExited) {\n const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;\n state._debug(message);\n }\n state._setResult();\n }\n}\n//# sourceMappingURL=toolrunner.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { StringDecoder } from 'string_decoder';\nimport * as tr from './toolrunner.js';\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nexport function exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\n/**\n * Exec a command and get the output.\n * Output will be streamed to the live console.\n * Returns promise with the exit code and collected stdout and stderr\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code, stdout, and stderr\n */\nexport function getExecOutput(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let stdout = '';\n let stderr = '';\n //Using string decoder covers the case where a mult-byte character is split\n const stdoutDecoder = new StringDecoder('utf8');\n const stderrDecoder = new StringDecoder('utf8');\n const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;\n const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;\n const stdErrListener = (data) => {\n stderr += stderrDecoder.write(data);\n if (originalStdErrListener) {\n originalStdErrListener(data);\n }\n };\n const stdOutListener = (data) => {\n stdout += stdoutDecoder.write(data);\n if (originalStdoutListener) {\n originalStdoutListener(data);\n }\n };\n const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });\n const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));\n //flush any remaining characters\n stdout += stdoutDecoder.end();\n stderr += stderrDecoder.end();\n return {\n exitCode,\n stdout,\n stderr\n };\n });\n}\n//# sourceMappingURL=exec.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport os from 'os';\nimport * as exec from '@actions/exec';\nconst getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout: version } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Version\"', undefined, {\n silent: true\n });\n const { stdout: name } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Caption\"', undefined, {\n silent: true\n });\n return {\n name: name.trim(),\n version: version.trim()\n };\n});\nconst getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d;\n const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {\n silent: true\n });\n const version = (_b = (_a = stdout.match(/ProductVersion:\\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';\n const name = (_d = (_c = stdout.match(/ProductName:\\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';\n return {\n name,\n version\n };\n});\nconst getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {\n silent: true\n });\n const [name, version] = stdout.trim().split('\\n');\n return {\n name,\n version\n };\n});\nexport const platform = os.platform();\nexport const arch = os.arch();\nexport const isWindows = platform === 'win32';\nexport const isMacOS = platform === 'darwin';\nexport const isLinux = platform === 'linux';\nexport function getDetails() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign(Object.assign({}, (yield (isWindows\n ? getWindowsInfo()\n : isMacOS\n ? getMacOsInfo()\n : getLinuxInfo()))), { platform,\n arch,\n isWindows,\n isMacOS,\n isLinux });\n });\n}\n//# sourceMappingURL=platform.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { issue, issueCommand } from './command.js';\nimport { issueFileCommand, prepareKeyValueMessage } from './file-command.js';\nimport { toCommandProperties, toCommandValue } from './utils.js';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { OidcClient } from './oidc-utils.js';\n/**\n * The code to exit an action\n */\nexport var ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode || (ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function exportVariable(name, val) {\n const convertedVal = toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return issueFileCommand('ENV', prepareKeyValueMessage(name, val));\n }\n issueCommand('set-env', { name }, convertedVal);\n}\n/**\n * Registers a secret which will get masked from logs\n *\n * @param secret - Value of the secret to be masked\n * @remarks\n * This function instructs the Actions runner to mask the specified value in any\n * logs produced during the workflow run. Once registered, the secret value will\n * be replaced with asterisks (***) whenever it appears in console output, logs,\n * or error messages.\n *\n * This is useful for protecting sensitive information such as:\n * - API keys\n * - Access tokens\n * - Authentication credentials\n * - URL parameters containing signatures (SAS tokens)\n *\n * Note that masking only affects future logs; any previous appearances of the\n * secret in logs before calling this function will remain unmasked.\n *\n * @example\n * ```typescript\n * // Register an API token as a secret\n * const apiToken = \"abc123xyz456\";\n * setSecret(apiToken);\n *\n * // Now any logs containing this value will show *** instead\n * console.log(`Using token: ${apiToken}`); // Outputs: \"Using token: ***\"\n * ```\n */\nexport function setSecret(secret) {\n issueCommand('add-mask', {}, secret);\n}\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nexport function addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n issueFileCommand('PATH', inputPath);\n }\n else {\n issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nexport function getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nexport function getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nexport function getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n issueCommand('set-output', { name }, toCommandValue(value));\n}\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nexport function setCommandEcho(enabled) {\n issue('echo', enabled ? 'on' : 'off');\n}\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nexport function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nexport function isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nexport function debug(message) {\n issueCommand('debug', {}, message);\n}\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function error(message, properties = {}) {\n issueCommand('error', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function warning(message, properties = {}) {\n issueCommand('warning', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function notice(message, properties = {}) {\n issueCommand('notice', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nexport function info(message) {\n process.stdout.write(message + os.EOL);\n}\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nexport function startGroup(name) {\n issue('group', name);\n}\n/**\n * End an output group.\n */\nexport function endGroup() {\n issue('endgroup');\n}\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nexport function group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return issueFileCommand('STATE', prepareKeyValueMessage(name, value));\n }\n issueCommand('save-state', { name }, toCommandValue(value));\n}\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nexport function getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexport function getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield OidcClient.getIDToken(aud);\n });\n}\n/**\n * Summary exports\n */\nexport { summary } from './summary.js';\n/**\n * @deprecated use core.summary\n */\nexport { markdownSummary } from './summary.js';\n/**\n * Path exports\n */\nexport { toPosixPath, toWin32Path, toPlatformPath } from './path-utils.js';\n/**\n * Platform utilities exports\n */\nexport * as platform from './platform.js';\n//# sourceMappingURL=core.js.map","class UploadUrlPool {\n /** Map from key (bucket ID or file ID) to a stack of available entries. */\n pools = /* @__PURE__ */ new Map();\n /**\n * Take an upload URL from the pool, or return null if none are available.\n *\n * @param key - The bucket ID or file ID to look up.\n *\n * @returns An upload URL entry, or null if the pool is empty for the given key.\n */\n checkout(key) {\n const pool = this.pools.get(key);\n if (!pool || pool.length === 0) return null;\n return pool.pop() ?? null;\n }\n /**\n * Return a still-valid upload URL to the pool for future reuse.\n *\n * @param key - The bucket ID or file ID the entry belongs to.\n * @param entry - The upload URL entry to return to the pool.\n */\n checkin(key, entry) {\n let pool = this.pools.get(key);\n if (!pool) {\n pool = [];\n this.pools.set(key, pool);\n }\n pool.push(entry);\n }\n /**\n * Remove a specific upload URL from the pool (e.g. after an upload error).\n *\n * @param key - The bucket ID or file ID the entry belongs to.\n * @param entry - The failed upload URL entry to remove.\n */\n evict(key, entry) {\n const pool = this.pools.get(key);\n if (!pool) return;\n const idx = pool.findIndex((e) => e.uploadUrl === entry.uploadUrl);\n if (idx !== -1) {\n pool.splice(idx, 1);\n }\n }\n /** Remove all entries from every key in the pool. */\n clear() {\n this.pools.clear();\n }\n}\nexport {\n UploadUrlPool\n};\n//# sourceMappingURL=upload-url-pool.js.map\n","import { UploadUrlPool } from \"./upload-url-pool.js\";\nclass InMemoryAccountInfo {\n /** Cached authorization response, or null before authorize() is called. */\n auth = null;\n /** Pool of reusable small-file upload URLs, keyed by bucket ID. */\n uploadUrls = new UploadUrlPool();\n /** Pool of reusable large-file part upload URLs, keyed by file ID. */\n partUploadUrls = new UploadUrlPool();\n /**\n * Store a fresh authorization response, replacing any previous state.\n *\n * @param auth - The authorize account response to store.\n */\n setAuth(auth) {\n this.auth = auth;\n this.uploadUrls.clear();\n this.partUploadUrls.clear();\n }\n /**\n * Return the current authorization response, or null if not authorized.\n *\n * @returns The cached authorization response, or null if not yet authorized.\n */\n getAuth() {\n return this.auth;\n }\n /** Discard all cached authorization state and upload URLs. */\n clear() {\n this.auth = null;\n this.uploadUrls.clear();\n this.partUploadUrls.clear();\n }\n /**\n * Base URL for B2 API calls.\n *\n * @returns The base URL for B2 API calls.\n *\n * @throws Error if not yet authorized.\n */\n getApiUrl() {\n return this.requireAuth().apiInfo.storageApi.apiUrl;\n }\n /**\n * Base URL for file downloads.\n *\n * @returns The base URL for file downloads.\n *\n * @throws Error if not yet authorized.\n */\n getDownloadUrl() {\n return this.requireAuth().apiInfo.storageApi.downloadUrl;\n }\n /**\n * Current authorization token.\n *\n * @returns The current authorization token.\n *\n * @throws Error if not yet authorized.\n */\n getAuthToken() {\n return this.requireAuth().authorizationToken;\n }\n /**\n * The authorized account ID.\n *\n * @returns The authorized account identifier.\n *\n * @throws Error if not yet authorized.\n */\n getAccountId() {\n return this.requireAuth().accountId;\n }\n /**\n * Server-recommended part size for large file uploads, in bytes.\n *\n * @returns The server-recommended part size in bytes.\n *\n * @throws Error if not yet authorized.\n */\n getRecommendedPartSize() {\n return this.requireAuth().apiInfo.storageApi.recommendedPartSize;\n }\n /**\n * Smallest allowed part size for large file uploads, in bytes.\n *\n * @returns The smallest allowed part size in bytes.\n *\n * @throws Error if not yet authorized.\n */\n getAbsoluteMinimumPartSize() {\n return this.requireAuth().apiInfo.storageApi.absoluteMinimumPartSize;\n }\n /**\n * Base URL for the S3-compatible API.\n *\n * @returns The base URL for the S3-compatible API.\n *\n * @throws Error if not yet authorized.\n */\n getS3ApiUrl() {\n return this.requireAuth().apiInfo.storageApi.s3ApiUrl;\n }\n /**\n * Bucket ID the key is restricted to, or null if unrestricted.\n *\n * @returns The restricted bucket identifier, or null if the key is unrestricted.\n *\n * @throws Error if not yet authorized.\n */\n getAllowedBucketId() {\n return this.requireAuth().apiInfo.storageApi.allowed.bucketId ?? null;\n }\n /**\n * Take an upload URL from the pool for the given bucket, or null if none available.\n *\n * @param bucketId - The bucket to check out an upload URL for.\n *\n * @returns A reusable upload URL entry, or null if none are available.\n */\n checkoutUploadUrl(bucketId) {\n return this.uploadUrls.checkout(bucketId);\n }\n /**\n * Return a still-valid upload URL to the pool for reuse.\n *\n * @param bucketId - The bucket the upload URL belongs to.\n * @param entry - The upload URL entry to return to the pool.\n */\n returnUploadUrl(bucketId, entry) {\n this.uploadUrls.checkin(bucketId, entry);\n }\n /**\n * Remove an upload URL from the pool after an upload error.\n *\n * @param bucketId - The bucket the failed upload URL belongs to.\n * @param entry - The upload URL entry to remove from the pool.\n */\n evictUploadUrl(bucketId, entry) {\n this.uploadUrls.evict(bucketId, entry);\n }\n /**\n * Take a large-file part upload URL from the pool, or null if none available.\n *\n * @param fileId - The large file to check out a part upload URL for.\n *\n * @returns A reusable part upload URL entry, or null if none are available.\n */\n checkoutPartUploadUrl(fileId) {\n return this.partUploadUrls.checkout(fileId);\n }\n /**\n * Return a still-valid part upload URL to the pool for reuse.\n *\n * @param fileId - The large file the part upload URL belongs to.\n * @param entry - The part upload URL entry to return to the pool.\n */\n returnPartUploadUrl(fileId, entry) {\n this.partUploadUrls.checkin(fileId, entry);\n }\n /**\n * Remove a part upload URL from the pool after an error.\n *\n * @param fileId - The large file the failed part upload URL belongs to.\n * @param entry - The part upload URL entry to remove from the pool.\n */\n evictPartUploadUrl(fileId, entry) {\n this.partUploadUrls.evict(fileId, entry);\n }\n /**\n * Retrieve the cached auth response or throw if not yet authorized.\n *\n * @returns The cached authorization response.\n *\n * @throws Error if authorize() has not been called.\n */\n requireAuth() {\n if (!this.auth) throw new Error(\"Not authorized. Call authorize() first.\");\n return this.auth;\n }\n}\nexport {\n InMemoryAccountInfo\n};\n//# sourceMappingURL=in-memory.js.map\n","const REALM_URLS = {\n production: \"https://api.backblazeb2.com\",\n staging: \"https://api.backblazeb2.com\"\n};\nfunction getRealmUrl(realm) {\n return REALM_URLS[realm] ?? realm;\n}\nexport {\n REALM_URLS,\n getRealmUrl\n};\n//# sourceMappingURL=realms.js.map\n","function accountId(raw) {\n return raw;\n}\nfunction bucketId(raw) {\n return raw;\n}\nfunction fileId(raw) {\n return raw;\n}\nfunction keyId(raw) {\n return raw;\n}\nfunction applicationKeyId(raw) {\n return raw;\n}\nfunction largeFileId(raw) {\n return raw;\n}\nexport {\n accountId,\n applicationKeyId,\n bucketId,\n fileId,\n keyId,\n largeFileId\n};\n//# sourceMappingURL=ids.js.map\n","async function bestEffort(fn) {\n try {\n await fn();\n } catch {\n }\n}\nexport {\n bestEffort\n};\n//# sourceMappingURL=best-effort.js.map\n","import { bestEffort } from \"../util/best-effort.js\";\nasync function cancelLargeFileBestEffort(raw, accountInfo, fileId) {\n await bestEffort(\n () => raw.cancelLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId })\n );\n}\nexport {\n cancelLargeFileBestEffort\n};\n//# sourceMappingURL=cancel.js.map\n","class Semaphore {\n /**\n * @param limit - Maximum number of concurrent acquisitions. Must be a\n * positive integer; values `<= 0` would create a semaphore that\n * never lets anything through (all `acquire()` calls would queue\n * forever), so the constructor throws fast instead.\n *\n * @throws `RangeError` when `limit` is not a positive integer.\n */\n constructor(limit) {\n this.limit = limit;\n if (!Number.isInteger(limit) || limit <= 0) {\n throw new RangeError(\n `Semaphore limit must be a positive integer; received ${limit}. A non-positive limit produces a deadlocked semaphore — fail fast at construction instead.`\n );\n }\n }\n current = 0;\n queue = [];\n /**\n * Acquires a slot, waiting if the limit has been reached.\n * @returns A promise that resolves when a slot is available.\n */\n async acquire() {\n if (this.current < this.limit) {\n this.current++;\n return;\n }\n return new Promise((resolve) => {\n this.queue.push(resolve);\n });\n }\n /** Releases a slot, unblocking the next queued caller if any. */\n release() {\n const next = this.queue.shift();\n if (next) {\n next();\n } else {\n this.current--;\n }\n }\n /**\n * Number of slots currently available.\n *\n * @returns The count of free concurrency slots.\n */\n get available() {\n return this.limit - this.current;\n }\n}\nexport {\n Semaphore\n};\n//# sourceMappingURL=concurrency.js.map\n","const DEFAULT_TRANSFER_CONCURRENCY = 4;\nconst DEFAULT_BULK_CONCURRENCY = 10;\nconst DEFAULT_PAGE_SIZE = 1e3;\nconst DEFAULT_CONTENT_TYPE = \"b2/x-auto\";\nexport {\n DEFAULT_BULK_CONCURRENCY,\n DEFAULT_CONTENT_TYPE,\n DEFAULT_PAGE_SIZE,\n DEFAULT_TRANSFER_CONCURRENCY\n};\n//# sourceMappingURL=defaults.js.map\n","function planRanges(totalSize, chunkSize) {\n const plans = [];\n let offset = 0;\n let index = 0;\n while (offset < totalSize) {\n const length = Math.min(chunkSize, totalSize - offset);\n const end = offset + length - 1;\n plans.push({\n partNumber: index + 1,\n index,\n offset,\n length,\n start: offset,\n end\n });\n offset += length;\n index++;\n }\n return plans;\n}\nfunction byteRangeHeader(start, end) {\n return `bytes=${start}-${end}`;\n}\nexport {\n byteRangeHeader,\n planRanges\n};\n//# sourceMappingURL=plan-ranges.js.map\n","import { fileId } from \"../types/ids.js\";\nimport { cancelLargeFileBestEffort } from \"../upload/cancel.js\";\nimport { Semaphore } from \"../upload/concurrency.js\";\nimport { DEFAULT_CONTENT_TYPE, DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { byteRangeHeader, planRanges } from \"../util/plan-ranges.js\";\nasync function copyLargeFile(raw, accountInfo, options) {\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const sourceInfo = await raw.getFileInfo(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: options.sourceFileId\n });\n const totalSize = sourceInfo.contentLength;\n if (totalSize <= partSize) {\n return raw.copyFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n sourceFileId: options.sourceFileId,\n fileName: options.fileName,\n ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : {},\n ...options.contentType !== void 0 ? { contentType: options.contentType } : {},\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}\n });\n }\n const destBucketId = options.destinationBucketId ?? sourceInfo.bucketId;\n const startResp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: destBucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? sourceInfo.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo: options.fileInfo ?? {},\n ...options.destinationServerSideEncryption !== void 0 ? { serverSideEncryption: options.destinationServerSideEncryption } : {}\n });\n const largeFileId = startResp.fileId;\n const ranges = planRanges(totalSize, partSize);\n const partSha1s = new Array(ranges.length);\n const sem = new Semaphore(concurrency);\n try {\n options.signal?.throwIfAborted();\n await Promise.all(\n ranges.map(async (range) => {\n await sem.acquire();\n try {\n options.signal?.throwIfAborted();\n const resp = await raw.copyPart(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n sourceFileId: options.sourceFileId,\n // `startLargeFile` returns `LargeFileId`; `copyPart` takes the\n // same value typed as `FileId`. Re-brand via the factory.\n largeFileId: fileId(largeFileId),\n partNumber: range.partNumber,\n range: byteRangeHeader(range.start, range.end),\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}\n });\n partSha1s[range.partNumber - 1] = resp.contentSha1;\n } finally {\n sem.release();\n }\n })\n );\n options.signal?.throwIfAborted();\n return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n}\nexport {\n copyLargeFile\n};\n//# sourceMappingURL=large.js.map\n","const utf8Encoder = new TextEncoder();\nconst utf8Decoder = new TextDecoder();\nexport {\n utf8Decoder,\n utf8Encoder\n};\n//# sourceMappingURL=text-codec.js.map\n","import { utf8Encoder } from \"../util/text-codec.js\";\nconst SAFE_CHARS = new Set(\n \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@/\".split(\"\")\n);\nfunction encodeFileName(name) {\n const encoded = [];\n for (const char of name) {\n if (SAFE_CHARS.has(char)) {\n encoded.push(char);\n } else {\n const bytes = utf8Encoder.encode(char);\n for (const byte of bytes) {\n encoded.push(`%${byte.toString(16).toUpperCase().padStart(2, \"0\")}`);\n }\n }\n }\n return encoded.join(\"\");\n}\nfunction decodeFileName(encoded) {\n return decodeURIComponent(encoded);\n}\nfunction buildFileInfoHeaders(fileInfo) {\n if (!fileInfo) return {};\n const headers = {};\n for (const [key, value] of Object.entries(fileInfo)) {\n headers[`X-Bz-Info-${encodeFileName(key)}`] = encodeFileName(value);\n }\n return headers;\n}\nfunction parseFileInfoHeaders(headers) {\n const info = {};\n headers.forEach((value, key) => {\n const lower = key.toLowerCase();\n if (lower.startsWith(\"x-bz-info-\")) {\n const infoKey = decodeFileName(lower.slice(\"x-bz-info-\".length));\n info[infoKey] = decodeFileName(value);\n }\n });\n return info;\n}\nexport {\n buildFileInfoHeaders,\n decodeFileName,\n encodeFileName,\n parseFileInfoHeaders\n};\n//# sourceMappingURL=encoding.js.map\n","class ProgressTracker {\n /**\n * Creates a new ProgressTracker.\n * @param listener - Callback to receive progress events, or undefined to disable.\n * @param totalBytes - Expected total bytes, or null if unknown.\n * @param totalParts - Expected total parts, or null if not a multipart transfer.\n */\n constructor(listener, totalBytes, totalParts) {\n this.listener = listener;\n this.totalBytes = totalBytes;\n this.totalParts = totalParts;\n this.startTime = Date.now();\n }\n /** Running total of bytes transferred. */\n bytesTransferred = 0;\n /** Running count of completed parts. */\n partsCompleted = 0;\n /** Timestamp when tracking began. */\n startTime;\n /**\n * Record that additional bytes have been transferred and notify the listener.\n * @param count - The number of additional bytes that were transferred.\n */\n addBytes(count) {\n this.bytesTransferred += count;\n this.emit();\n }\n /** Record that a multipart part has completed and notify the listener. */\n completePart() {\n this.partsCompleted++;\n this.emit();\n }\n /** Emit the current progress snapshot to the listener, if one is registered. */\n emit() {\n this.listener?.({\n bytesTransferred: this.bytesTransferred,\n totalBytes: this.totalBytes,\n partsCompleted: this.partsCompleted,\n totalParts: this.totalParts,\n elapsedMs: Date.now() - this.startTime\n });\n }\n}\nexport {\n ProgressTracker\n};\n//# sourceMappingURL=progress.js.map\n","function normalizeSha1(raw) {\n if (raw === null || raw === void 0 || raw === \"none\") return null;\n return raw;\n}\nfunction normalizeFileVersionSha1(fv) {\n return fv.contentSha1 === \"none\" ? { ...fv, contentSha1: null } : fv;\n}\nfunction normalizeFileVersionListSha1(resp) {\n return { ...resp, files: resp.files.map(normalizeFileVersionSha1) };\n}\nexport {\n normalizeFileVersionListSha1,\n normalizeFileVersionSha1,\n normalizeSha1\n};\n//# sourceMappingURL=normalize.js.map\n","import { parseFileInfoHeaders } from \"../raw/encoding.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { fileId } from \"../types/ids.js\";\nimport { bestEffort } from \"../util/best-effort.js\";\nimport { normalizeSha1 } from \"../util/normalize.js\";\nasync function downloadById(raw, accountInfo, options) {\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.fileId,\n toRawDownloadOptions(options)\n );\n const headers = extractDownloadHeaders(resp.headers);\n return {\n headers,\n // HEAD requests legitimately have no body; return an empty stream so the\n // result shape stays consistent.\n body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress)\n };\n}\nasync function downloadByName(raw, accountInfo, options) {\n const resp = await raw.downloadFileByName(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.bucketName,\n options.fileName,\n toRawDownloadOptions(options)\n );\n const headers = extractDownloadHeaders(resp.headers);\n return {\n headers,\n body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress)\n };\n}\nasync function headById(raw, accountInfo, options) {\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.fileId,\n { ...toRawDownloadOptions(options), method: \"HEAD\" }\n );\n if (resp.body !== null) {\n const body = resp.body;\n await bestEffort(() => body.cancel());\n }\n return { headers: extractDownloadHeaders(resp.headers) };\n}\nasync function headByName(raw, accountInfo, options) {\n const resp = await raw.downloadFileByName(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.bucketName,\n options.fileName,\n { ...toRawDownloadOptions(options), method: \"HEAD\" }\n );\n if (resp.body !== null) {\n const body = resp.body;\n await bestEffort(() => body.cancel());\n }\n return { headers: extractDownloadHeaders(resp.headers) };\n}\nfunction toRawDownloadOptions(options) {\n return {\n ...options.method !== void 0 ? { method: options.method } : {},\n ...options.range !== void 0 ? { range: options.range } : {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.b2ContentDisposition !== void 0 ? { b2ContentDisposition: options.b2ContentDisposition } : {},\n ...options.b2ContentLanguage !== void 0 ? { b2ContentLanguage: options.b2ContentLanguage } : {},\n ...options.b2ContentEncoding !== void 0 ? { b2ContentEncoding: options.b2ContentEncoding } : {},\n ...options.b2ContentType !== void 0 ? { b2ContentType: options.b2ContentType } : {},\n ...options.b2CacheControl !== void 0 ? { b2CacheControl: options.b2CacheControl } : {},\n ...options.b2Expires !== void 0 ? { b2Expires: options.b2Expires } : {},\n ...options.signal !== void 0 ? { signal: options.signal } : {}\n };\n}\nfunction emptyStream() {\n return new ReadableStream({\n start(controller) {\n controller.close();\n }\n });\n}\nfunction instrumentProgress(body, totalBytes, listener) {\n if (listener === void 0) return body;\n const tracker = new ProgressTracker(listener, totalBytes, 1);\n const transform = new TransformStream({\n transform(chunk, controller) {\n tracker.addBytes(chunk.byteLength);\n controller.enqueue(chunk);\n },\n flush() {\n tracker.completePart();\n }\n });\n return body.pipeThrough(transform);\n}\nfunction extractDownloadHeaders(headers) {\n const fileInfo = parseFileInfoHeaders(headers);\n return {\n contentType: headers.get(\"Content-Type\") ?? \"application/octet-stream\",\n contentLength: Number.parseInt(headers.get(\"Content-Length\") ?? \"0\", 10),\n // B2 sends the literal `'none'` for multipart-finished files; collapse\n // to `null` so the typed `string | null` actually means \"no SHA-1\".\n contentSha1: normalizeSha1(headers.get(\"X-Bz-Content-Sha1\")),\n fileId: fileId(headers.get(\"X-Bz-File-Id\") ?? \"\"),\n fileName: decodeURIComponent(headers.get(\"X-Bz-File-Name\") ?? \"\"),\n fileInfo,\n uploadTimestamp: Number.parseInt(headers.get(\"X-Bz-Upload-Timestamp\") ?? \"0\", 10)\n };\n}\nexport {\n downloadById,\n downloadByName,\n headById,\n headByName\n};\n//# sourceMappingURL=single.js.map\n","const DEFAULT_RETRY_OPTIONS = {\n maxRetries: 5,\n maxRetryDelayMs: 64e3,\n initialRetryDelayMs: 1e3\n};\nfunction computeBackoff(attempt, options, retryAfter) {\n if (retryAfter !== void 0 && retryAfter > 0) {\n return Math.min(retryAfter * 1e3, options.maxRetryDelayMs);\n }\n const base = options.initialRetryDelayMs * 2 ** attempt;\n const jitter = Math.random() * base * 0.5;\n return Math.min(base + jitter, options.maxRetryDelayMs);\n}\nfunction sleep(ms, signal) {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) {\n reject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n return;\n }\n const timer = setTimeout(resolve, ms);\n signal?.addEventListener(\n \"abort\",\n () => {\n clearTimeout(timer);\n reject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n },\n { once: true }\n );\n });\n}\nexport {\n DEFAULT_RETRY_OPTIONS,\n computeBackoff,\n sleep\n};\n//# sourceMappingURL=retry.js.map\n","async function collectStream(stream) {\n const reader = stream.getReader();\n try {\n const chunks = [];\n let total = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n total += value.byteLength;\n }\n const result = new Uint8Array(total);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return result;\n } finally {\n reader.releaseLock();\n }\n}\nexport {\n collectStream\n};\n//# sourceMappingURL=collect.js.map\n","import { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep } from \"../http/retry.js\";\nimport { collectStream } from \"../streams/collect.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { planRanges, byteRangeHeader } from \"../util/plan-ranges.js\";\nfunction createParallelDownloadStream(raw, accountInfo, options) {\n const rangeSize = options.rangeSize ?? 10 * 1024 * 1024;\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const totalSize = options.totalSize;\n const retryOptions = {\n ...DEFAULT_RETRY_OPTIONS,\n ...options.maxRetries !== void 0 ? { maxRetries: options.maxRetries } : {}\n };\n const abort = options.signal;\n const ranges = planRanges(totalSize, rangeSize);\n const windowSize = concurrency * 2;\n const inflight = /* @__PURE__ */ new Map();\n const buffer = /* @__PURE__ */ new Map();\n let nextToSchedule = 0;\n let nextToEmit = 0;\n let firstError = null;\n function scheduleNext() {\n while (firstError === null && // Honour abort here so a completed range that triggers a top-up\n // doesn't queue one final fetch after the caller aborted. Without\n // this gate, one extra range request fires post-abort before the\n // `pull()` loop notices.\n abort?.aborted !== true && nextToSchedule < ranges.length && inflight.size + buffer.size < windowSize) {\n const range = ranges[nextToSchedule];\n if (range === void 0) break;\n const idx = nextToSchedule;\n nextToSchedule++;\n const task = (async () => {\n try {\n const data = await fetchRangeWithRetry(\n raw,\n accountInfo,\n options.fileId,\n range.start,\n range.end,\n retryOptions,\n abort\n );\n buffer.set(idx, data);\n } catch (err) {\n if (firstError === null) firstError = err;\n } finally {\n inflight.delete(idx);\n }\n })();\n inflight.set(idx, task);\n }\n }\n return new ReadableStream({\n start(controller) {\n try {\n abort?.throwIfAborted();\n scheduleNext();\n } catch (err) {\n controller.error(err);\n }\n },\n async pull(controller) {\n try {\n while (!buffer.has(nextToEmit)) {\n abort?.throwIfAborted();\n if (firstError !== null) throw firstError;\n if (inflight.size === 0) {\n controller.close();\n return;\n }\n await Promise.race(inflight.values());\n }\n const data = buffer.get(nextToEmit);\n if (data !== void 0) {\n buffer.delete(nextToEmit);\n nextToEmit++;\n controller.enqueue(data);\n }\n scheduleNext();\n if (nextToEmit >= ranges.length && buffer.size === 0 && inflight.size === 0 && firstError === null) {\n controller.close();\n }\n } catch (err) {\n controller.error(err);\n }\n },\n cancel() {\n buffer.clear();\n }\n });\n}\nasync function fetchRangeWithRetry(raw, accountInfo, fileId, start, end, retryOptions, signal) {\n let lastError;\n for (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {\n if (attempt > 0) {\n const delay = computeBackoff(attempt - 1, retryOptions);\n await sleep(delay, signal);\n }\n try {\n signal?.throwIfAborted();\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n fileId,\n {\n range: byteRangeHeader(start, end),\n ...signal !== void 0 ? { signal } : {}\n }\n );\n if (!resp.body) throw new Error(\"Download chunk has no body\");\n return await collectStream(resp.body);\n } catch (err) {\n lastError = err;\n if (signal?.aborted) throw err;\n if (err instanceof DOMException && err.name === \"AbortError\") throw err;\n }\n }\n throw lastError instanceof Error ? lastError : new Error(\"Range download failed after retries\");\n}\nexport {\n createParallelDownloadStream\n};\n//# sourceMappingURL=parallel.js.map\n","let nodeCreateHash;\nasync function getNodeCreateHash() {\n if (nodeCreateHash !== void 0) return nodeCreateHash;\n try {\n const crypto2 = await import(\"node:crypto\");\n if (typeof crypto2.createHash !== \"function\") throw new Error(\"createHash unavailable\");\n nodeCreateHash = (algo) => {\n const h = crypto2.createHash(algo);\n return {\n update(data) {\n h.update(data);\n },\n digest(encoding) {\n return h.digest(encoding);\n }\n };\n };\n } catch {\n nodeCreateHash = null;\n }\n return nodeCreateHash;\n}\nclass IncrementalSha1 {\n /** Buffered chunks for WebCrypto fallback path. */\n chunks = [];\n /** Total bytes fed into the hash so far. */\n totalLength = 0;\n /** Node.js hash instance, or null if using WebCrypto fallback. */\n nodeHash = null;\n /** Resolves once the crypto backend has been loaded. */\n initPromise;\n /** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */\n constructor() {\n this.initPromise = getNodeCreateHash().then((factory) => {\n if (factory) this.nodeHash = factory(\"sha1\");\n });\n }\n /**\n * Feed data into the hash. Async because it lazily initializes the crypto backend.\n * @param data - The bytes to include in the hash computation.\n *\n * @returns A promise that resolves once the data has been consumed.\n */\n async update(data) {\n await this.initPromise;\n if (this.nodeHash) {\n this.nodeHash.update(data);\n } else {\n this.chunks.push(new Uint8Array(data));\n }\n this.totalLength += data.byteLength;\n }\n /**\n * Finalize the hash and return the hex-encoded SHA-1 digest.\n * @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.\n */\n async digest() {\n await this.initPromise;\n if (this.nodeHash) {\n return this.nodeHash.digest(\"hex\");\n }\n const combined = new Uint8Array(this.totalLength);\n let offset = 0;\n for (const chunk of this.chunks) {\n combined.set(chunk, offset);\n offset += chunk.byteLength;\n }\n const hashBuffer = await crypto.subtle.digest(\"SHA-1\", combined.buffer);\n return hexEncode(new Uint8Array(hashBuffer));\n }\n /**\n * Total number of bytes fed into the hash so far.\n *\n * @returns The cumulative byte count across all update calls.\n */\n get bytesProcessed() {\n return this.totalLength;\n }\n}\nfunction hexEncode(bytes) {\n const hex = [];\n for (const b of bytes) {\n hex.push(b.toString(16).padStart(2, \"0\"));\n }\n return hex.join(\"\");\n}\nasync function sha1Hex(data) {\n const factory = await getNodeCreateHash();\n if (factory) {\n const h = factory(\"sha1\");\n h.update(data);\n return h.digest(\"hex\");\n }\n const hashBuffer = await crypto.subtle.digest(\"SHA-1\", data.buffer);\n return hexEncode(new Uint8Array(hashBuffer));\n}\nexport {\n IncrementalSha1,\n sha1Hex\n};\n//# sourceMappingURL=hash.js.map\n","import { largeFileId } from \"../types/ids.js\";\nasync function findResumeCandidate(raw, accountInfo, bucketId, fileName) {\n const unfinished = await raw.listUnfinishedLargeFiles(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { bucketId }\n );\n const match = unfinished.files.find((f) => f.fileName === fileName);\n if (!match) return null;\n const fileId = largeFileId(match.fileId);\n const uploadedPartSha1s = await collectPartSha1s(raw, accountInfo, fileId);\n return { fileId, uploadedPartSha1s };\n}\nasync function collectPartSha1s(raw, accountInfo, fileId) {\n const sha1s = /* @__PURE__ */ new Map();\n let startPartNumber;\n while (true) {\n const page = await raw.listParts(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId,\n ...startPartNumber !== void 0 ? { startPartNumber } : {}\n });\n for (const part of page.parts) {\n sha1s.set(part.partNumber, part.contentSha1);\n }\n if (page.nextPartNumber === null) break;\n startPartNumber = page.nextPartNumber;\n }\n return sha1s;\n}\nexport {\n collectPartSha1s,\n findResumeCandidate\n};\n//# sourceMappingURL=resume.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY, DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nimport { planRanges } from \"../util/plan-ranges.js\";\nimport { cancelLargeFileBestEffort } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nimport { collectPartSha1s, findResumeCandidate } from \"./resume.js\";\nasync function uploadLargeFile(raw, accountInfo, options) {\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const totalSize = options.source.size;\n const parts = planRanges(totalSize, partSize);\n const fileInfo = { ...options.fileInfo };\n const startLargeFileRequest = {\n bucketId: options.bucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {}\n };\n let largeFileId;\n let preUploaded;\n if (options.resumeFileId !== void 0) {\n largeFileId = options.resumeFileId;\n preUploaded = await collectPartSha1s(raw, accountInfo, largeFileId);\n } else if (options.resume === true) {\n const candidate = await findResumeCandidate(\n raw,\n accountInfo,\n options.bucketId,\n options.fileName\n );\n if (candidate) {\n largeFileId = candidate.fileId;\n preUploaded = candidate.uploadedPartSha1s;\n } else {\n const startResp = await raw.startLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n startLargeFileRequest\n );\n largeFileId = startResp.fileId;\n preUploaded = /* @__PURE__ */ new Map();\n }\n } else {\n const startResp = await raw.startLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n startLargeFileRequest\n );\n largeFileId = startResp.fileId;\n preUploaded = /* @__PURE__ */ new Map();\n }\n const partSha1s = new Array(parts.length);\n const tracker = new ProgressTracker(options.onProgress, totalSize, parts.length);\n const sem = new Semaphore(concurrency);\n if (!options.source.canSlice) {\n if (options.resume === true || options.resumeFileId !== void 0) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw new Error(\n \"uploadLargeFile: resume is not supported on non-sliceable sources (e.g. StreamSource).\"\n );\n }\n try {\n await uploadPartsSequentially(\n raw,\n accountInfo,\n options,\n largeFileId,\n parts,\n partSha1s,\n tracker\n );\n return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n }\n try {\n const tasks = parts.map(async (part) => {\n await sem.acquire();\n try {\n options.signal?.throwIfAborted();\n const partSource = options.source.slice(part.offset, part.offset + part.length);\n const data = new Uint8Array(await partSource.toArrayBuffer());\n const partSha1 = new IncrementalSha1();\n await partSha1.update(data);\n const sha1Hex = await partSha1.digest();\n const serverSha1 = preUploaded.get(part.partNumber);\n if (serverSha1 !== void 0 && serverSha1 === sha1Hex) {\n partSha1s[part.partNumber - 1] = serverSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n return;\n }\n let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId }\n );\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result2 = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber: part.partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(largeFileId, uploadEntry);\n partSha1s[part.partNumber - 1] = result2.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(largeFileId, uploadEntry);\n throw err;\n }\n } finally {\n sem.release();\n }\n });\n await Promise.all(tasks);\n const result = await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n return result;\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n}\nasync function uploadPartsSequentially(raw, accountInfo, options, largeFileId, parts, partSha1s, tracker) {\n const reader = options.source.stream().getReader();\n let partNumber = 1;\n let carry = null;\n try {\n for (const planned of parts) {\n options.signal?.throwIfAborted();\n const buf = new Uint8Array(planned.length);\n let filled = 0;\n if (carry !== null) {\n const take = Math.min(carry.byteLength, buf.byteLength - filled);\n buf.set(carry.subarray(0, take), filled);\n filled += take;\n carry = take < carry.byteLength ? carry.subarray(take) : null;\n }\n while (filled < buf.byteLength) {\n const { done, value } = await reader.read();\n if (done) break;\n const take = Math.min(value.byteLength, buf.byteLength - filled);\n buf.set(value.subarray(0, take), filled);\n filled += take;\n if (take < value.byteLength) {\n carry = value.subarray(take);\n }\n }\n const data = filled === buf.byteLength ? buf : buf.subarray(0, filled);\n if (data.byteLength === 0) {\n throw new Error(\n `uploadLargeFile: source stream ended before part ${partNumber}; advertised size does not match emitted bytes.`\n );\n }\n const partSha1 = new IncrementalSha1();\n await partSha1.update(data);\n const sha1Hex = await partSha1.digest();\n let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId }\n );\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber: planned.partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(largeFileId, uploadEntry);\n partSha1s[planned.partNumber - 1] = result.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(largeFileId, uploadEntry);\n throw err;\n }\n partNumber++;\n }\n } finally {\n reader.releaseLock();\n }\n}\nexport {\n uploadLargeFile\n};\n//# sourceMappingURL=large.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nasync function uploadSmallFile(raw, accountInfo, options) {\n let uploadEntry = accountInfo.checkoutUploadUrl(options.bucketId);\n if (!uploadEntry) {\n const resp = await raw.getUploadUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: options.bucketId\n });\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n const data = new Uint8Array(await options.source.toArrayBuffer());\n const sha1 = new IncrementalSha1();\n await sha1.update(data);\n const sha1Hex = await sha1.digest();\n const tracker = new ProgressTracker(options.onProgress, data.byteLength, 1);\n try {\n const result = await raw.uploadFile(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {},\n ...options.lastModifiedMillis !== void 0 ? { lastModifiedMillis: options.lastModifiedMillis } : {}\n },\n data,\n options.signal\n );\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n accountInfo.returnUploadUrl(options.bucketId, uploadEntry);\n return result;\n } catch (err) {\n accountInfo.evictUploadUrl(options.bucketId, uploadEntry);\n throw err;\n }\n}\nexport {\n uploadSmallFile\n};\n//# sourceMappingURL=single.js.map\n","function toError(value) {\n return value instanceof Error ? value : new Error(String(value));\n}\nexport {\n toError\n};\n//# sourceMappingURL=to-error.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY, DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nimport { toError } from \"../util/to-error.js\";\nimport { cancelLargeFileBestEffort } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nfunction createWriteStream(raw, accountInfo, options) {\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const tracker = new ProgressTracker(options.onProgress, null, null);\n const sem = new Semaphore(concurrency);\n let largeFileId = null;\n let startPromise = null;\n let nextPartNumber = 1;\n let pendingBytes = 0;\n const pending = [];\n const partSha1s = [];\n const inflight = [];\n let errored = null;\n const {\n promise: done,\n resolve: resolveDone,\n reject: rejectDone\n } = Promise.withResolvers();\n done.catch(() => {\n });\n function ensureStarted() {\n if (largeFileId !== null) return Promise.resolve(largeFileId);\n if (startPromise !== null) return startPromise;\n startPromise = (async () => {\n const resp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: options.bucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo: options.fileInfo ?? {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n });\n largeFileId = resp.fileId;\n return largeFileId;\n })();\n return startPromise;\n }\n async function shipPart(data, partNumber) {\n const fileId = await ensureStarted();\n const sha1 = new IncrementalSha1();\n await sha1.update(data);\n const sha1Hex = await sha1.digest();\n let uploadEntry = accountInfo.checkoutPartUploadUrl(fileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId\n });\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(fileId, uploadEntry);\n partSha1s[partNumber - 1] = result.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(fileId, uploadEntry);\n throw err;\n }\n }\n function dispatchPart() {\n if (pending.length === 0) return;\n let data;\n if (pending.length === 1) {\n const head = pending[0];\n if (!head) return;\n data = head;\n } else {\n const total = pending.reduce((sum, chunk) => sum + chunk.byteLength, 0);\n data = new Uint8Array(total);\n let offset = 0;\n for (const chunk of pending) {\n data.set(chunk, offset);\n offset += chunk.byteLength;\n }\n }\n pending.length = 0;\n pendingBytes = 0;\n const partNumber = nextPartNumber++;\n const task = (async () => {\n await sem.acquire();\n try {\n await shipPart(data, partNumber);\n } catch (err) {\n errored = toError(err);\n throw err;\n } finally {\n sem.release();\n }\n })();\n inflight.push(task);\n task.catch(() => {\n });\n }\n const writable = new WritableStream({\n async write(chunk) {\n if (errored) throw errored;\n options.signal?.throwIfAborted();\n pending.push(chunk);\n pendingBytes += chunk.byteLength;\n while (pendingBytes >= partSize) {\n const carved = carveExact(pending, partSize);\n const partNumber = nextPartNumber++;\n pendingBytes -= partSize;\n const task = (async () => {\n await sem.acquire();\n try {\n await shipPart(carved, partNumber);\n } catch (err) {\n errored = toError(err);\n throw err;\n } finally {\n sem.release();\n }\n })();\n inflight.push(task);\n task.catch(() => {\n });\n }\n },\n async close() {\n try {\n if (errored) throw errored;\n options.signal?.throwIfAborted();\n if (pendingBytes > 0) {\n dispatchPart();\n }\n await Promise.all(inflight);\n if (errored) throw errored;\n if (largeFileId === null) {\n throw new Error(\"createWriteStream closed without any data written.\");\n }\n const result = await raw.finishLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId, partSha1Array: partSha1s }\n );\n resolveDone(result);\n } catch (err) {\n const fileIdToCancel = largeFileId;\n if (fileIdToCancel !== null) {\n await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel);\n }\n rejectDone(err);\n throw err;\n }\n },\n async abort(reason) {\n const fileIdToCancel = largeFileId;\n if (fileIdToCancel !== null) {\n await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel);\n }\n rejectDone(toError(reason));\n }\n });\n return { writable, done };\n}\nfunction carveExact(chunks, size) {\n const out = new Uint8Array(size);\n let written = 0;\n while (written < size && chunks.length > 0) {\n const head = chunks[0];\n if (!head) break;\n const need = size - written;\n if (head.byteLength <= need) {\n out.set(head, written);\n written += head.byteLength;\n chunks.shift();\n } else {\n out.set(head.subarray(0, need), written);\n chunks[0] = head.subarray(need);\n written += need;\n }\n }\n return out;\n}\nexport {\n createWriteStream\n};\n//# sourceMappingURL=stream.js.map\n","import { createParallelDownloadStream } from \"./download/parallel.js\";\nimport { downloadByName, headByName, downloadById, headById } from \"./download/single.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { createWriteStream } from \"./upload/stream.js\";\nclass B2Object {\n /** The file name (path) within the bucket. */\n fileName;\n client;\n bucket;\n /**\n * @param client - The parent B2Client instance.\n * @param bucket - The parent Bucket this object belongs to.\n * @param fileName - The file path within the bucket.\n *\n * @internal\n */\n constructor(client, bucket, fileName) {\n this.client = client;\n this.bucket = bucket;\n this.fileName = fileName;\n }\n /**\n * Uploads data to this file name. Automatically uses multipart upload for large files.\n * @param options - Upload configuration including data source and optional settings.\n *\n * @returns Metadata for the uploaded file version.\n */\n async upload(options) {\n const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n const isLarge = options.source.size > recommendedPartSize;\n if (isLarge) {\n return uploadLargeFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...options\n });\n }\n const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options;\n return uploadSmallFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...smallOptions\n });\n }\n /**\n * Downloads this file by name. Pass `method: 'HEAD'` to fetch only the\n * response headers (file metadata) without streaming the body.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result with response headers and body stream.\n */\n async download(options) {\n return downloadByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.bucket.name,\n fileName: this.fileName,\n ...options\n });\n }\n /**\n * Fetches response headers for this file via HTTP HEAD. Returns a\n * body-less result so callers never have to drain the (logically\n * empty) HEAD body themselves.\n *\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal. Same shape as {@link B2Object.download}'s\n * options minus `method` (always HEAD) and `onProgress` (no body).\n *\n * @returns Parsed download headers (content type, SHA-1, file info, etc.).\n */\n async head(options) {\n return headByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.bucket.name,\n fileName: this.fileName,\n ...options\n });\n }\n /**\n * Downloads a specific version of this file by ID. Pass `method: 'HEAD'`\n * to fetch only the response headers (file metadata) without streaming the body.\n * @param fileId - The file version ID to download.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result with response headers and body stream.\n */\n async downloadById(fileId, options) {\n return downloadById(this.client.raw, this.client.accountInfo, {\n fileId,\n ...options\n });\n }\n /**\n * Fetches response headers for a specific version of this file by ID\n * via HTTP HEAD. Returns a body-less result so callers never have to\n * drain the (logically empty) HEAD body themselves.\n *\n * @param fileId - The file version ID to inspect.\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal.\n *\n * @returns Parsed download headers.\n */\n async headById(fileId, options) {\n return headById(this.client.raw, this.client.accountInfo, {\n fileId,\n ...options\n });\n }\n /**\n * Creates a parallel-download ReadableStream that fetches the file in concurrent ranged chunks.\n * @param fileId - The file version ID to download.\n * @param totalSize - Total file size in bytes (needed to compute range boundaries).\n * @param options - Concurrency, range size, and abort signal.\n *\n * @returns A Web ReadableStream of file data in sequential order.\n */\n createReadStream(fileId, totalSize, options) {\n return createParallelDownloadStream(this.client.raw, this.client.accountInfo, {\n fileId,\n totalSize,\n ...options\n });\n }\n /**\n * Creates a Web `WritableStream` that uploads streamed data into this file\n * using the multipart protocol. Pipe a `ReadableStream` into the\n * returned `writable` and await `done` to get the final {@link FileVersion}.\n *\n * Note: streaming uploads do not support resume because the size and per-part\n * hashes are not known in advance. Use {@link upload} with a buffered source\n * when resume is required.\n *\n * @param options - Streaming upload parameters (part size, concurrency, encryption).\n *\n * @returns A handle with the writable sink and a completion promise.\n */\n createWriteStream(options) {\n return createWriteStream(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...options ?? {}\n });\n }\n /**\n * Retrieves metadata for a specific file version.\n * @param fileId - The file version ID to look up.\n *\n * @returns The file version metadata.\n */\n async getFileInfo(fileId) {\n return this.client.raw.getFileInfo(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileId }\n );\n }\n /**\n * Hides this file by creating a hide marker at this file name.\n *\n * @returns Metadata for the newly created hide marker.\n */\n async hide() {\n return this.bucket.hideFile(this.fileName);\n }\n /**\n * Permanently deletes a specific version of this file.\n * @param fileId - The unique identifier of the file version to delete.\n */\n async deleteVersion(fileId) {\n await this.bucket.deleteFileVersion(this.fileName, fileId);\n }\n /**\n * Sets or updates the Object Lock retention policy on a specific file\n * version of this file.\n *\n * The bucket must have Object Lock enabled (`fileLockEnabled: true` at\n * creation time). Governance-mode retention can be shortened or removed\n * by passing `bypassGovernance: true` together with an application key\n * that carries the `bypassGovernance` capability; compliance-mode\n * retention cannot be shortened by anyone until the\n * `retainUntilTimestamp` elapses.\n *\n * @param fileId - The file version to apply the policy to.\n * @param retention - The retention policy to apply.\n * @param options - Optional flag for shortening governance-mode retention.\n *\n * @returns Metadata for the updated file version.\n */\n async setRetention(fileId, retention, options) {\n return this.bucket.updateFileRetention(this.fileName, fileId, retention, options);\n }\n /**\n * Toggles the legal hold flag on a specific file version of this file.\n *\n * Legal hold is independent of retention: a file can be on legal hold\n * without any retention policy, and vice versa. The bucket must have\n * Object Lock enabled, and any caller must hold the `writeFileLegalHolds`\n * capability.\n *\n * @param fileId - The file version to apply the flag to.\n * @param legalHold - `'on'` to apply the hold, `'off'` to remove it.\n *\n * @returns Metadata for the updated file version.\n */\n async setLegalHold(fileId, legalHold) {\n return this.bucket.updateFileLegalHold(this.fileName, fileId, legalHold);\n }\n}\nexport {\n B2Object\n};\n//# sourceMappingURL=object.js.map\n","async function* paginatePages(fetcher, signal) {\n let cursor;\n while (true) {\n signal?.throwIfAborted();\n const { page, nextCursor } = await fetcher(cursor);\n yield page;\n if (nextCursor === void 0) return;\n cursor = nextCursor;\n }\n}\nasync function* paginateItems(fetcher, extractItems, signal) {\n for await (const page of paginatePages(fetcher, signal)) {\n yield* extractItems(page);\n }\n}\nexport {\n paginateItems,\n paginatePages\n};\n//# sourceMappingURL=paginator.js.map\n","import { copyLargeFile } from \"./copy/large.js\";\nimport { downloadByName, headByName } from \"./download/single.js\";\nimport { B2Object } from \"./object.js\";\nimport { accountId } from \"./types/ids.js\";\nimport { Semaphore } from \"./upload/concurrency.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { DEFAULT_PAGE_SIZE, DEFAULT_BULK_CONCURRENCY } from \"./util/defaults.js\";\nimport { paginateItems } from \"./util/paginator.js\";\nimport { toError } from \"./util/to-error.js\";\nclass Bucket {\n /** Unique identifier for this bucket. */\n id;\n /** Human-readable bucket name. */\n name;\n /** Full bucket metadata as returned by the B2 API. */\n info;\n client;\n /**\n * @param client - The parent B2Client instance.\n * @param info - The bucket metadata from the API.\n *\n * @internal\n */\n constructor(client, info) {\n this.client = client;\n this.info = info;\n this.id = info.bucketId;\n this.name = info.bucketName;\n }\n /**\n * Returns a {@link B2Object} handle for a specific file name in this bucket.\n * @param fileName - The file path within the bucket.\n *\n * @returns A B2Object handle bound to this bucket and file name.\n */\n file(fileName) {\n return new B2Object(this.client, this, fileName);\n }\n /**\n * Uploads a file to this bucket. Automatically uses multipart upload for files\n * larger than the recommended part size.\n * @param options - Upload configuration including file name, source data, and optional settings.\n *\n * @returns Metadata for the uploaded file version.\n */\n async upload(options) {\n const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n const isLarge = options.source.size > recommendedPartSize;\n if (isLarge) {\n return uploadLargeFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.id,\n ...options\n });\n }\n const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options;\n return uploadSmallFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.id,\n ...smallOptions\n });\n }\n /**\n * Downloads a file from this bucket by name. Pass `method: 'HEAD'` in\n * `options` to fetch only the response headers (file metadata) without\n * streaming the body.\n * @param fileName - The file name (path) to download.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result containing response headers and a readable body stream.\n */\n async download(fileName, options) {\n return downloadByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.name,\n fileName,\n ...options\n });\n }\n /**\n * Fetches the response headers (file metadata) for a file via HTTP\n * HEAD. Returns a body-less result so callers never have to drain\n * the (logically empty) HEAD body themselves.\n *\n * Use this for metadata-only checks like \"does this file exist\", \"what\n * is its current SHA-1\", \"what is its Content-Length\". For full file\n * retrieval use {@link Bucket.download}.\n *\n * @param fileName - The file name (path) to inspect.\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal. Same shape as {@link Bucket.download}'s\n * options minus `method` (always HEAD) and `onProgress` (no body).\n *\n * @returns Parsed download headers (content type, SHA-1, file info, etc.).\n *\n * @example\n * ```ts\n * const { headers } = await bucket.head('photos/2026/sunset.jpg')\n * console.log(headers.contentLength, headers.contentSha1)\n * ```\n */\n async head(fileName, options) {\n return headByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.name,\n fileName,\n ...options\n });\n }\n /**\n * Lists file names in this bucket (most recent versions only).\n * @param options - Optional filtering and pagination settings.\n *\n * @returns A page of file versions with an optional continuation token.\n */\n async listFileNames(options) {\n return this.client.raw.listFileNames(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n }\n );\n }\n /**\n * Lists all file versions in this bucket, including hidden files.\n * @param options - Optional filtering and pagination settings.\n *\n * @returns A page of file versions with an optional continuation token.\n */\n async listFileVersions(options) {\n return this.client.raw.listFileVersions(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n }\n );\n }\n /**\n * Async iterator that yields the latest visible version of every file in\n * the bucket, automatically handling pagination via `listFileNames`.\n *\n * Hidden files (those whose latest version is a hide marker) are NOT\n * yielded by this iterator. Use {@link paginateFileVersions} when you\n * need full version history.\n *\n * @param options - Filter + pagination + abort options. `pageSize` is\n * forwarded to `b2_list_file_names`'s `maxFileCount` (default 1000,\n * B2-capped at 10000).\n *\n * @returns An async iterable of {@link FileVersion} entries.\n *\n * @example\n * ```ts\n * for await (const file of bucket.paginateFileNames({ prefix: 'photos/' })) {\n * console.log(file.fileName, file.contentLength)\n * }\n * ```\n */\n paginateFileNames(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listFileNames({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startFileName: cursor } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n });\n return { page: resp, nextCursor: resp.nextFileName ?? void 0 };\n },\n // Real B2 surfaces hide markers as rows in `b2_list_file_names`. This\n // iterator's documented contract is \"latest VISIBLE version\", so we\n // drop hide-action rows here. Callers who need full history should\n // use `paginateFileVersions`.\n (page) => page.files.filter((f) => f.action !== \"hide\"),\n options?.signal\n );\n }\n /**\n * Async iterator that yields every version of every file in the bucket,\n * including hidden files and historical versions, automatically handling\n * pagination via `listFileVersions`.\n *\n * The two-cursor `(nextFileName, nextFileId)` continuation that the raw\n * endpoint exposes is threaded internally; callers iterate flat.\n *\n * @param options - Filter + pagination + abort options.\n *\n * @returns An async iterable of {@link FileVersion} entries.\n */\n paginateFileVersions(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listFileVersions({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startFileName: cursor.fileName } : {},\n ...cursor?.fileId !== void 0 ? { startFileId: cursor.fileId } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n });\n const nextCursor = resp.nextFileName !== null ? { fileName: resp.nextFileName, fileId: resp.nextFileId ?? void 0 } : void 0;\n return { page: resp, nextCursor };\n },\n (page) => page.files,\n options?.signal\n );\n }\n /**\n * Async iterator that yields every unfinished large file in the bucket,\n * automatically handling pagination via `listUnfinishedLargeFiles`.\n *\n * Useful for janitorial scripts that want to inspect or cancel abandoned\n * multipart uploads (typically followed by {@link cancelLargeFile} on\n * the underlying raw client).\n *\n * @param options - Filter + pagination + abort options. `pageSize` is\n * B2-capped at 100 for this endpoint.\n *\n * @returns An async iterable of unfinished-large-file metadata entries.\n */\n paginateUnfinishedLargeFiles(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listUnfinishedLargeFiles({\n pageSize: options?.pageSize ?? 100,\n ...cursor !== void 0 ? { startFileId: cursor } : {},\n ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {}\n });\n return { page: resp, nextCursor: resp.nextFileId ?? void 0 };\n },\n (page) => page.files,\n options?.signal\n );\n }\n /**\n * Async iterator that yields every uploaded part for a specific large\n * file, automatically handling pagination via `listParts`.\n *\n * @param largeFileId - The unfinished large file to enumerate parts of.\n * @param options - Pagination + abort options. `pageSize` is B2-capped\n * at 1000 for this endpoint; the default is 1000.\n *\n * @returns An async iterable of {@link PartInfo} entries.\n */\n paginateParts(largeFileId, options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.client.raw.listParts(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileId: largeFileId,\n maxPartCount: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startPartNumber: cursor } : {}\n }\n );\n return { page: resp, nextCursor: resp.nextPartNumber ?? void 0 };\n },\n (page) => page.parts,\n options?.signal\n );\n }\n /**\n * Looks up the latest visible version of a file by name.\n * Uses `listFileNames` under the hood; returns `null` when the file does not\n * exist or its latest version is a hide marker.\n * @param fileName - The exact file path to look up.\n *\n * @returns The latest {@link FileVersion}, or `null` if not found.\n */\n async getFileInfoByName(fileName) {\n const resp = await this.listFileNames({ prefix: fileName, pageSize: 1 });\n const match = resp.files.find((f) => f.fileName === fileName);\n if (!match || match.action === \"hide\") return null;\n return match;\n }\n /**\n * Removes the latest hide marker for a file, restoring visibility of the\n * previous upload. Returns the deleted hide marker, or `null` if there was\n * no hide marker to remove (file is already visible or does not exist).\n * @param fileName - The file path to unhide.\n *\n * @returns The deleted hide marker version, or `null` if nothing was hidden.\n */\n async unhideFile(fileName) {\n const resp = await this.listFileVersions({ prefix: fileName, pageSize: 100 });\n const versions = resp.files.filter((f) => f.fileName === fileName);\n if (versions.length === 0) return null;\n const latest = versions[0];\n if (!latest || latest.action !== \"hide\") return null;\n await this.deleteFileVersion(fileName, latest.fileId);\n return latest;\n }\n /**\n * Hides a file by creating a hide marker. The file remains in version history but is no longer visible in `listFileNames`.\n * @param fileName - The file path to hide.\n *\n * @returns Metadata for the newly created hide marker.\n */\n async hideFile(fileName) {\n return this.client.raw.hideFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, fileName }\n );\n }\n /**\n * Permanently deletes a specific file version. Both file name and file ID are required.\n *\n * If the file is under Object Lock retention, B2 will reject the\n * delete: compliance-mode files cannot be deleted until the retention\n * expires; governance-mode files require `bypassGovernance: true`\n * AND a calling key with the `bypassGovernance` capability. Files on\n * legal hold cannot be deleted by anyone until the hold is removed.\n *\n * @param fileName - The file path of the version to delete.\n * @param fileId - The unique identifier of the file version to delete.\n * @param options - Optional flag for bypassing governance retention.\n */\n async deleteFileVersion(fileName, fileId, options) {\n await this.client.raw.deleteFileVersion(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileName,\n fileId,\n ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n }\n );\n }\n /**\n * Cancels an in-progress large file upload so the partial parts are not\n * retained or billed. The most common reason to call this is to clean up\n * abandoned multipart uploads surfaced by {@link listUnfinishedLargeFiles}.\n * @param fileId - The unique identifier of the unfinished large file to cancel.\n *\n * @returns Metadata about the cancelled large file.\n */\n async cancelLargeFile(fileId) {\n return this.client.raw.cancelLargeFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileId }\n );\n }\n /**\n * Lists large files in this bucket that were started but never finished or\n * cancelled. Wraps `b2_list_unfinished_large_files`.\n * @param options - Optional pagination filters.\n *\n * @returns The page of unfinished large files plus a continuation token.\n */\n async listUnfinishedLargeFiles(options) {\n return this.client.raw.listUnfinishedLargeFiles(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},\n ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}\n }\n );\n }\n /**\n * Deletes many file versions with bounded concurrency. Errors from individual\n * deletes are collected and returned rather than thrown, so partial success\n * does not abort the run.\n *\n * When `options.signal` is supplied and aborted, in-flight deletes\n * complete (they're already on the wire), but no new deletes start\n * after the abort fires. Subsequent targets are short-circuited to an\n * error entry so the result tally reflects what actually happened.\n * @param targets - File versions to delete.\n * @param options - Optional concurrency override and abort signal.\n * Concurrency defaults to the SDK-wide bulk-metadata setting\n * (currently 10, higher than transfer concurrency because each\n * task is a single tiny API round-trip).\n *\n * @returns A summary of successes and per-target errors.\n */\n async deleteMany(targets, options) {\n const concurrency = options?.concurrency ?? DEFAULT_BULK_CONCURRENCY;\n const sem = new Semaphore(concurrency);\n const signal = options?.signal;\n let deleted = 0;\n const errors = [];\n await Promise.all(\n targets.map(async (target) => {\n await sem.acquire();\n try {\n if (signal?.aborted) {\n errors.push({\n target,\n error: toError(signal.reason ?? \"aborted\")\n });\n return;\n }\n await this.deleteFileVersion(target.fileName, target.fileId);\n deleted++;\n } catch (err) {\n errors.push({\n target,\n error: toError(err)\n });\n } finally {\n sem.release();\n }\n })\n );\n return { deleted, errors };\n }\n /**\n * Async generator that streams every file version in the bucket (optionally\n * filtered by prefix) and deletes each one. Yields a {@link DeleteAllEvent}\n * per file version. With `dryRun: true`, no deletes are performed but `skip`\n * events are still emitted.\n * @param options - Optional prefix filter, page size, and dry-run flag.\n *\n * @returns An async generator of per-file events.\n */\n async *deleteAll(options) {\n const dryRun = options?.dryRun ?? false;\n const pageSize = options?.pageSize ?? DEFAULT_PAGE_SIZE;\n let startFileName;\n let startFileId;\n while (true) {\n const page = await this.listFileVersions({\n pageSize,\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...startFileName !== void 0 ? { startFileName } : {},\n ...startFileId !== void 0 ? { startFileId } : {}\n });\n for (const version of page.files) {\n if (dryRun) {\n yield { type: \"skip\", fileName: version.fileName, fileId: version.fileId };\n continue;\n }\n try {\n await this.deleteFileVersion(version.fileName, version.fileId);\n yield { type: \"delete\", fileName: version.fileName, fileId: version.fileId };\n } catch (err) {\n yield {\n type: \"error\",\n fileName: version.fileName,\n fileId: version.fileId,\n message: toError(err).message\n };\n }\n }\n if (!page.nextFileName) break;\n startFileName = page.nextFileName;\n startFileId = page.nextFileId ?? void 0;\n }\n }\n /**\n * Creates a server-side copy of a file within or across buckets.\n * @param options - Copy configuration including source file ID and destination name.\n *\n * @returns Metadata for the newly created file version.\n */\n async copyFile(options) {\n return this.client.raw.copyFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n options\n );\n }\n /**\n * Copies a file via the server-side multipart protocol. Each part is copied\n * by reference through `b2_copy_part`; data never traverses the client. Falls\n * back to a single `copyFile` call when the source fits within a single part.\n * @param options - Copy parameters including source file ID, destination name, part size, and concurrency.\n *\n * @returns Metadata for the newly created destination file version.\n */\n async copyLargeFile(options) {\n return copyLargeFile(this.client.raw, this.client.accountInfo, {\n sourceFileId: options.sourceFileId,\n fileName: options.fileName,\n ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : { destinationBucketId: this.id },\n ...options.contentType !== void 0 ? { contentType: options.contentType } : {},\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n ...options.partSize !== void 0 ? { partSize: options.partSize } : {},\n ...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {},\n ...options.signal !== void 0 ? { signal: options.signal } : {}\n });\n }\n /**\n * Updates bucket settings such as type, CORS, lifecycle rules, and encryption.\n * @param options - Fields to update. Omitted fields are left unchanged.\n *\n * @returns Updated bucket metadata.\n */\n async update(options) {\n return this.client.raw.updateBucket(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n accountId: accountId(this.client.accountInfo.getAccountId()),\n bucketId: this.id,\n ...options\n }\n );\n }\n /**\n * Permanently deletes this bucket. The bucket must be empty (no file versions).\n *\n * @returns The deleted bucket metadata.\n */\n async delete() {\n return this.client.deleteBucket(this.id);\n }\n /**\n * Gets a download authorization token scoped to a file name prefix in this bucket.\n * @param fileNamePrefix - Only authorize downloads of files starting with this prefix.\n * @param validDurationInSeconds - How long the authorization is valid (1-604800 seconds).\n *\n * @returns The download authorization response containing a time-limited token.\n */\n async getDownloadAuthorization(fileNamePrefix, validDurationInSeconds) {\n return this.client.raw.getDownloadAuthorization(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, fileNamePrefix, validDurationInSeconds }\n );\n }\n /**\n * Gets the event notification rules configured for this bucket.\n *\n * @returns The current notification rules for this bucket.\n */\n async getNotificationRules() {\n return this.client.raw.getBucketNotificationRules(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id }\n );\n }\n /**\n * Replaces the event notification rules for this bucket.\n * @param rules - The new set of notification rules to apply.\n *\n * @returns The updated notification rules for this bucket.\n */\n async setNotificationRules(rules) {\n return this.client.raw.setBucketNotificationRules(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, eventNotificationRules: rules }\n );\n }\n /**\n * Updates the file retention policy for a specific file version. Requires file lock on the bucket.\n * @param fileName - The file path of the version to update.\n * @param fileId - The unique identifier of the file version.\n * @param retention - The new retention policy to apply.\n * @param options - Optional flags. Set `bypassGovernance: true` to shorten governance-mode retention.\n *\n * @returns The updated file retention metadata.\n */\n async updateFileRetention(fileName, fileId, retention, options) {\n return this.client.raw.updateFileRetention(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileName,\n fileId,\n fileRetention: retention,\n ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n }\n );\n }\n /**\n * Updates the legal hold status for a specific file version. Requires file lock on the bucket.\n * @param fileName - The file path of the version to update.\n * @param fileId - The unique identifier of the file version.\n * @param legalHold - The new legal hold status to apply.\n *\n * @returns The updated legal hold metadata.\n */\n async updateFileLegalHold(fileName, fileId, legalHold) {\n return this.client.raw.updateFileLegalHold(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileName, fileId, legalHold }\n );\n }\n /**\n * Refetches this bucket's metadata from B2 so callers operating on\n * replication / lifecycle / retention configuration always start from the\n * server-of-record state.\n *\n * Bucket configuration is monotonically revisioned by B2: B2 increments\n * `revision` on every accepted update. The local {@link info} snapshot\n * captured at construction time goes stale as soon as anyone else (or any\n * prior `update()` call) mutates the bucket, so the ergonomic\n * add/remove helpers below always refresh before composing the next\n * `setX()` call. The result is that each helper is safe to call without\n * the caller having to thread BucketInfo through their code.\n *\n * @returns Fresh {@link BucketInfo} for this bucket.\n *\n * @throws If the bucket no longer exists.\n */\n async refresh() {\n const fresh = await this.client.listBuckets({ bucketId: this.id });\n const found = fresh[0];\n if (!found) throw new Error(`Bucket ${this.id} not found`);\n return found.info;\n }\n /**\n * Returns the current cross-region replication configuration, refetched\n * from B2.\n *\n * Use this when you need to read replication state without composing a\n * write. For add/remove flows the helper methods below handle the\n * refresh-then-set sequence for you.\n *\n * @returns The current {@link ReplicationConfiguration}.\n */\n async getReplication() {\n const fresh = await this.refresh();\n return fresh.replicationConfiguration;\n }\n /**\n * Replaces this bucket's complete replication configuration.\n * @param replication - The new configuration. Pass an empty source/destination\n * pair (`{ asReplicationSource: null, asReplicationDestination: null }`)\n * to clear replication entirely.\n *\n * @returns The updated bucket metadata.\n */\n async setReplication(replication) {\n return this.update({ replicationConfiguration: replication });\n }\n /**\n * Adds (or replaces by `replicationRuleName`) a single replication rule\n * on this bucket while leaving any other rules, the source key, and the\n * destination key mapping untouched.\n *\n * When this is the very first source-side rule, `sourceApplicationKeyId`\n * must be supplied to seed `asReplicationSource.sourceApplicationKeyId`;\n * for subsequent calls the existing source key is reused unless the\n * caller explicitly overrides it.\n *\n * @param rule - The replication rule to add or replace.\n * @param options - Optional source application key ID override (or seed\n * when no source side exists yet).\n *\n * @returns The updated bucket metadata.\n *\n * @throws If no source-side replication exists yet and the caller did\n * not supply `sourceApplicationKeyId`.\n */\n async addReplicationRule(rule, options) {\n const current = (await this.refresh()).replicationConfiguration;\n const existingSource = current.asReplicationSource;\n const sourceKey = options?.sourceApplicationKeyId ?? existingSource?.sourceApplicationKeyId;\n if (!sourceKey) {\n throw new Error(\n \"addReplicationRule: no existing source-side replication; pass options.sourceApplicationKeyId\"\n );\n }\n const existingRules = existingSource?.replicationRules ?? [];\n const without = existingRules.filter((r) => r.replicationRuleName !== rule.replicationRuleName);\n return this.setReplication({\n asReplicationSource: {\n sourceApplicationKeyId: sourceKey,\n replicationRules: [...without, rule]\n },\n asReplicationDestination: current.asReplicationDestination\n });\n }\n /**\n * Removes a single replication rule by name. No-ops cleanly when the rule\n * is not present (returns the unchanged-but-revision-bumped bucket info).\n *\n * @param replicationRuleName - Name of the rule to remove.\n *\n * @returns The updated bucket metadata.\n */\n async removeReplicationRule(replicationRuleName) {\n const current = (await this.refresh()).replicationConfiguration;\n const existingSource = current.asReplicationSource;\n if (!existingSource) {\n return this.setReplication(current);\n }\n const filtered = existingSource.replicationRules.filter(\n (r) => r.replicationRuleName !== replicationRuleName\n );\n return this.setReplication({\n asReplicationSource: {\n sourceApplicationKeyId: existingSource.sourceApplicationKeyId,\n replicationRules: filtered\n },\n asReplicationDestination: current.asReplicationDestination\n });\n }\n /**\n * Returns the current lifecycle rules for this bucket, refetched from B2.\n *\n * @returns The current array of {@link LifecycleRule}s.\n */\n async getLifecycleRules() {\n const fresh = await this.refresh();\n return fresh.lifecycleRules;\n }\n /**\n * Replaces this bucket's lifecycle rules in their entirety.\n * @param rules - The new rule set. Pass `[]` to remove all lifecycle\n * automation.\n *\n * @returns The updated bucket metadata.\n */\n async setLifecycleRules(rules) {\n return this.update({ lifecycleRules: [...rules] });\n }\n /**\n * Adds (or replaces, matched by `fileNamePrefix`) a single lifecycle rule\n * while leaving any other rules untouched.\n *\n * Matching on prefix mirrors B2's own data model: each unique prefix can\n * have at most one rule, and a `b2_update_bucket` call that contains two\n * rules with the same prefix is rejected. The helper enforces this for\n * the caller.\n *\n * @param rule - The lifecycle rule to add or replace.\n *\n * @returns The updated bucket metadata.\n */\n async addLifecycleRule(rule) {\n const current = await this.getLifecycleRules();\n const without = current.filter((r) => r.fileNamePrefix !== rule.fileNamePrefix);\n return this.setLifecycleRules([...without, rule]);\n }\n /**\n * Removes a single lifecycle rule by prefix. No-ops cleanly when the rule\n * is not present.\n *\n * @param fileNamePrefix - The prefix of the rule to remove.\n *\n * @returns The updated bucket metadata.\n */\n async removeLifecycleRule(fileNamePrefix) {\n const current = await this.getLifecycleRules();\n return this.setLifecycleRules(current.filter((r) => r.fileNamePrefix !== fileNamePrefix));\n }\n /**\n * Returns the current default Object Lock retention policy for new\n * uploads to this bucket, refetched from B2.\n *\n * @returns The default {@link BucketRetentionPolicy} (which may be\n * `{ mode: 'none', period: null }` when Object Lock is enabled on the\n * bucket but no default is set).\n */\n async getDefaultRetention() {\n const fresh = await this.refresh();\n return fresh.defaultRetention;\n }\n /**\n * Sets (or clears, by passing `{ mode: 'none', period: null }`) the\n * default Object Lock retention policy applied to new uploads.\n *\n * Object Lock must already be enabled on the bucket. Buckets created\n * without `fileLockEnabled: true` cannot accept a default retention\n * policy and B2 will reject this call.\n *\n * @param policy - The new default retention policy.\n *\n * @returns The updated bucket metadata.\n */\n async setDefaultRetention(policy) {\n return this.update({ defaultRetention: policy });\n }\n}\nexport {\n Bucket\n};\n//# sourceMappingURL=bucket.js.map\n","class B2Error extends Error {\n /** HTTP status code returned by the B2 API. */\n status;\n /** B2 error code identifying the error type (e.g. `expired_auth_token`). */\n code;\n /** B2 request ID from the `X-Bz-Request-Id` response header, if present. */\n requestId;\n /** Retry delay in seconds from the `Retry-After` response header, if present. */\n retryAfter;\n /** Whether this error is transient and the request can be retried. */\n retryable;\n /**\n * Creates a new B2Error instance.\n * @param response - Parsed B2 error response body.\n * @param options - Optional retry and request metadata from response headers.\n */\n constructor(response, options) {\n super(response.message);\n this.name = \"B2Error\";\n this.status = response.status;\n this.code = response.code;\n if (options?.retryAfter !== void 0) this.retryAfter = options.retryAfter;\n if (options?.requestId !== void 0) this.requestId = options.requestId;\n this.retryable = isTransient(response.status, response.code);\n }\n}\nclass ExpiredAuthTokenError extends B2Error {\n /**\n * Creates a new ExpiredAuthTokenError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ExpiredAuthTokenError\";\n }\n}\nclass BadAuthTokenError extends B2Error {\n /**\n * Creates a new BadAuthTokenError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadAuthTokenError\";\n }\n}\nclass ServiceUnavailableError extends B2Error {\n /**\n * Creates a new ServiceUnavailableError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ServiceUnavailableError\";\n }\n}\nclass RequestTimeoutError extends B2Error {\n /**\n * Creates a new RequestTimeoutError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"RequestTimeoutError\";\n }\n}\nclass TooManyRequestsError extends B2Error {\n /**\n * Creates a new TooManyRequestsError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"TooManyRequestsError\";\n }\n}\nclass CapExceededError extends B2Error {\n /**\n * Creates a new CapExceededError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"CapExceededError\";\n }\n}\nclass AccessDeniedError extends B2Error {\n /**\n * Creates a new AccessDeniedError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"AccessDeniedError\";\n }\n}\nclass FileNotPresentError extends B2Error {\n /**\n * Creates a new FileNotPresentError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"FileNotPresentError\";\n }\n}\nclass DuplicateBucketNameError extends B2Error {\n /**\n * Creates a new DuplicateBucketNameError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"DuplicateBucketNameError\";\n }\n}\nclass BadRequestError extends B2Error {\n /**\n * Creates a new BadRequestError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadRequestError\";\n }\n}\nclass BadUploadUrlError extends B2Error {\n /**\n * Creates a new BadUploadUrlError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadUploadUrlError\";\n }\n}\nclass ChecksumMismatchError extends B2Error {\n /**\n * Creates a new ChecksumMismatchError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ChecksumMismatchError\";\n }\n}\nclass B2InsufficientCapabilityError extends Error {\n /** Capabilities that were required for the operation. */\n required;\n /** Capabilities that the current key actually has. */\n available;\n /** Capabilities present in `required` but not in `available`. */\n missing;\n /**\n * Creates a new B2InsufficientCapabilityError instance.\n *\n * @param required - Capabilities the operation requires.\n * @param available - Capabilities the current key holds.\n * @param missing - The subset of required that isn't available.\n */\n constructor(required, available, missing) {\n super(`Application key is missing capabilities: ${missing.join(\", \")}`);\n this.name = \"B2InsufficientCapabilityError\";\n this.required = required;\n this.available = available;\n this.missing = missing;\n }\n}\nclass B2SsrfError extends Error {\n /**\n * Creates a new {@link B2SsrfError}.\n *\n * @param message - Human-readable description of which URL was rejected and why.\n * @param url - The full URL that was rejected.\n */\n constructor(message, url) {\n super(message);\n this.url = url;\n this.name = \"B2SsrfError\";\n }\n /** Always `false` — this is a security failure, not transient. */\n retryable = false;\n}\nclass NetworkError extends Error {\n /**\n * Creates a new NetworkError instance.\n * @param message - Human-readable description of the network failure.\n * @param cause - The underlying error that caused this failure, if any.\n */\n constructor(message, cause) {\n super(message);\n this.cause = cause;\n this.name = \"NetworkError\";\n }\n /** Always `true` since network errors are transient. */\n retryable = true;\n}\nfunction isTransient(status, code) {\n if (status === 408 || status === 429 || status === 503) return true;\n if (code === \"expired_auth_token\") return true;\n if (code === \"service_unavailable\" || code === \"request_timeout\") return true;\n return false;\n}\nfunction classifyError(response, options) {\n switch (response.code) {\n case \"expired_auth_token\":\n return new ExpiredAuthTokenError(response, options);\n case \"bad_auth_token\":\n case \"unauthorized\":\n return new BadAuthTokenError(response, options);\n case \"service_unavailable\":\n return new ServiceUnavailableError(response, options);\n case \"request_timeout\":\n return new RequestTimeoutError(response, options);\n case \"cap_exceeded\":\n case \"storage_cap_exceeded\":\n case \"transaction_cap_exceeded\":\n case \"download_cap_exceeded\":\n return new CapExceededError(response, options);\n case \"access_denied\":\n return new AccessDeniedError(response, options);\n case \"file_not_present\":\n case \"no_such_file\":\n return new FileNotPresentError(response, options);\n case \"duplicate_bucket_name\":\n return new DuplicateBucketNameError(response, options);\n case \"bad_sha1_checksum\":\n return new ChecksumMismatchError(response, options);\n case \"bad_request\":\n return new BadRequestError(response, options);\n }\n if (response.status === 429) return new TooManyRequestsError(response, options);\n if (response.status === 503) return new ServiceUnavailableError(response, options);\n if (response.status === 408) return new RequestTimeoutError(response, options);\n return new B2Error(response, options);\n}\nexport {\n AccessDeniedError,\n B2Error,\n B2InsufficientCapabilityError,\n B2SsrfError,\n BadAuthTokenError,\n BadRequestError,\n BadUploadUrlError,\n CapExceededError,\n ChecksumMismatchError,\n DuplicateBucketNameError,\n ExpiredAuthTokenError,\n FileNotPresentError,\n NetworkError,\n RequestTimeoutError,\n ServiceUnavailableError,\n TooManyRequestsError,\n classifyError\n};\n//# sourceMappingURL=index.js.map\n","import { B2SsrfError } from \"../errors/index.js\";\nclass UrlGuard {\n allowedSuffixes = [];\n /**\n * Lock the guard to the given host suffixes. A suffix matches a host\n * either exactly or as a `*.suffix` subdomain. For example,\n * `backblazeb2.com` allows `api.backblazeb2.com` and\n * `s3.us-west-004.backblazeb2.com`.\n *\n * Passing an empty array disables the guard (used by the simulator and\n * other test setups). Production code should always lock the guard after\n * a successful `b2_authorize_account`.\n *\n * @param suffixes - Allowed host suffixes.\n */\n setAllowedSuffixes(suffixes) {\n this.allowedSuffixes = suffixes;\n }\n /**\n * Returns the current allowed-suffix list (for tests and diagnostics).\n *\n * @returns The currently-configured list of allowed host suffixes.\n */\n getAllowedSuffixes() {\n return this.allowedSuffixes;\n }\n /**\n * Validate `rawUrl` against the allow-list. Throws {@link B2SsrfError} if\n * the URL points at a literal IP, a known-internal hostname, or a host\n * outside the allowed suffixes. Permissive (no-op) when no suffixes have\n * been configured yet.\n *\n * @param rawUrl - The URL the caller is about to fetch.\n *\n * @throws A `B2SsrfError` when the URL is rejected.\n */\n check(rawUrl) {\n if (this.allowedSuffixes.length === 0) return;\n let parsed;\n try {\n parsed = new URL(rawUrl);\n } catch {\n throw new B2SsrfError(`malformed URL rejected by SSRF guard: ${rawUrl}`, rawUrl);\n }\n const host = parsed.hostname.toLowerCase();\n if (isLiteralIp(host)) {\n throw new B2SsrfError(\n `literal IP host not allowed by SSRF guard (use a hostname): ${host}`,\n rawUrl\n );\n }\n if (isInternalHostname(host)) {\n throw new B2SsrfError(`internal hostname not allowed by SSRF guard: ${host}`, rawUrl);\n }\n for (const suffix of this.allowedSuffixes) {\n const lowered = suffix.toLowerCase();\n if (host === lowered || host.endsWith(`.${lowered}`)) return;\n }\n throw new B2SsrfError(\n `host outside allowed B2 realm: ${host} (allowed suffixes: ${this.allowedSuffixes.join(\", \")})`,\n rawUrl\n );\n }\n}\nfunction deriveAllowedSuffixes(storageApi) {\n const suffixes = /* @__PURE__ */ new Set([\"backblaze.com\"]);\n for (const url of [storageApi.apiUrl, storageApi.downloadUrl, storageApi.s3ApiUrl]) {\n try {\n const host = new URL(url).hostname;\n const parts = host.split(\".\");\n if (parts.length >= 2) {\n suffixes.add(parts.slice(-2).join(\".\"));\n }\n } catch {\n }\n }\n return Array.from(suffixes).sort();\n}\nfunction isLiteralIp(host) {\n if (/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/.test(host)) return true;\n if (host.includes(\":\")) return true;\n return false;\n}\nfunction isInternalHostname(host) {\n if (host === \"localhost\") return true;\n if (host.endsWith(\".localhost\")) return true;\n if (host === \"metadata\") return true;\n if (host === \"metadata.google.internal\") return true;\n if (host.endsWith(\".internal\")) return true;\n if (host.endsWith(\".local\")) return true;\n return false;\n}\nexport {\n UrlGuard,\n deriveAllowedSuffixes\n};\n//# sourceMappingURL=url-guard.js.map\n","const version = \"0.1.0\";\nconst pkg = {\n version\n};\nexport {\n pkg as default,\n version\n};\n//# sourceMappingURL=package.json.js.map\n","import pkg from \"./package.json.js\";\nconst VERSION = pkg.version;\nexport {\n VERSION\n};\n//# sourceMappingURL=version.js.map\n","import { VERSION } from \"../version.js\";\nconst SDK_PRODUCT = \"b2-sdk-typescript\";\nconst SDK_PACKAGE = \"@backblaze-labs/b2-sdk\";\nfunction detectPlatform() {\n const g = globalThis;\n if (typeof g[\"Deno\"] !== \"undefined\") {\n const deno = g[\"Deno\"];\n return {\n runtime: deno.version?.deno ? `deno/${deno.version.deno}` : \"deno\",\n os: deno.build?.os,\n arch: deno.build?.arch\n };\n }\n if (typeof g[\"Bun\"] !== \"undefined\") {\n const bun = g[\"Bun\"];\n const proc = g[\"process\"];\n return {\n runtime: bun.version ? `bun/${bun.version}` : \"bun\",\n os: proc?.platform,\n arch: proc?.arch\n };\n }\n if (typeof g[\"process\"] !== \"undefined\") {\n const proc = g[\"process\"];\n if (proc.versions?.node) {\n return {\n runtime: `node/${proc.versions.node}`,\n os: proc.platform,\n arch: proc.arch\n };\n }\n }\n if (typeof g[\"navigator\"] !== \"undefined\") {\n return { runtime: \"browser\", os: void 0, arch: void 0 };\n }\n return { runtime: \"unknown\", os: void 0, arch: void 0 };\n}\nfunction getUserAgent(custom) {\n const { runtime, os, arch } = detectPlatform();\n const parts = [\"typescript\", SDK_PACKAGE, runtime];\n if (os !== void 0) parts.push(os);\n if (arch !== void 0) parts.push(arch);\n const base = `${SDK_PRODUCT}/${VERSION} (${parts.join(\"; \")})`;\n return custom ? `${custom} ${base}` : base;\n}\nexport {\n SDK_PACKAGE,\n SDK_PRODUCT,\n getUserAgent\n};\n//# sourceMappingURL=user-agent.js.map\n","import { classifyError, ExpiredAuthTokenError, B2Error, NetworkError } from \"../errors/index.js\";\nimport { DEFAULT_RETRY_OPTIONS, sleep, computeBackoff } from \"./retry.js\";\nimport { UrlGuard } from \"./url-guard.js\";\nimport { getUserAgent } from \"./user-agent.js\";\nclass FetchTransport {\n /** User-Agent string sent with every request. */\n userAgent;\n /** SSRF allow-list applied to every outgoing URL. Mutable so `B2Client.authorize()` can lock it down post-auth. */\n urlGuard;\n /**\n * Creates a new FetchTransport.\n * @param options - Optional configuration: custom User-Agent prefix and SSRF guard.\n */\n constructor(options) {\n this.userAgent = getUserAgent(options?.userAgent);\n this.urlGuard = options?.urlGuard ?? new UrlGuard();\n }\n /**\n * Sends the request using the global `fetch` function.\n * @param request - The HTTP request to execute.\n *\n * @returns The HTTP response.\n *\n * @throws B2SsrfError when the URL fails the configured SSRF guard.\n */\n async send(request) {\n this.urlGuard.check(request.url);\n const headers = new Headers(request.headers);\n if (!headers.has(\"User-Agent\")) {\n headers.set(\"User-Agent\", this.userAgent);\n }\n const response = await fetch(request.url, {\n method: request.method,\n headers,\n body: request.body ?? null,\n ...request.signal !== void 0 ? { signal: request.signal } : {}\n });\n return {\n status: response.status,\n headers: response.headers,\n body: response.body,\n json: () => response.json(),\n text: () => response.text(),\n arrayBuffer: () => response.arrayBuffer()\n };\n }\n}\nclass RetryTransport {\n /** The wrapped transport that performs actual HTTP requests. */\n inner;\n /** Resolved retry options (defaults merged with user overrides). */\n options;\n /** Optional callback to refresh auth credentials on 401 — returns the fresh token. */\n onReauth;\n /** Sleep implementation used between retries; injectable for tests. */\n sleepImpl;\n /**\n * Creates a new RetryTransport.\n * @param opts - Retry transport configuration.\n */\n constructor(opts) {\n this.inner = opts.transport;\n this.options = { ...DEFAULT_RETRY_OPTIONS, ...opts.retry };\n if (opts.onReauth !== void 0) this.onReauth = opts.onReauth;\n this.sleepImpl = opts.sleepImpl ?? sleep;\n }\n /**\n * Sends the request with automatic retry on transient failures.\n * On expired auth tokens, calls {@link RetryTransportOptions.onReauth} and retries.\n * @param originalRequest - The HTTP request to execute. The caller's\n * reference is not mutated; on reauth, a copy with a refreshed\n * Authorization header is sent.\n *\n * @returns The HTTP response.\n */\n async send(originalRequest) {\n let request = originalRequest;\n let lastError;\n for (let attempt = 0; attempt <= this.options.maxRetries; attempt++) {\n if (attempt > 0 && lastError) {\n const retryAfter = lastError instanceof NetworkError ? void 0 : lastError.retryAfter;\n const delay = computeBackoff(attempt - 1, this.options, retryAfter);\n await this.sleepImpl(delay, request.signal);\n }\n try {\n const response = await this.inner.send(request);\n if (response.status >= 200 && response.status < 300) {\n return response;\n }\n let errorBody;\n try {\n errorBody = await response.json();\n } catch {\n errorBody = {\n status: response.status,\n code: \"internal_error\",\n message: `HTTP ${response.status}`\n };\n }\n const retryAfterHeader = response.headers.get(\"Retry-After\");\n const retryAfterSec = retryAfterHeader ? Number.parseInt(retryAfterHeader, 10) : void 0;\n const requestId = response.headers.get(\"X-Bz-Request-Id\") ?? void 0;\n const error = classifyError(errorBody, {\n ...retryAfterSec !== void 0 ? { retryAfter: retryAfterSec } : {},\n ...requestId !== void 0 ? { requestId } : {}\n });\n if (error instanceof ExpiredAuthTokenError && this.onReauth) {\n const freshToken = await this.onReauth();\n request = {\n ...request,\n headers: { ...request.headers ?? {}, Authorization: freshToken }\n };\n continue;\n }\n if (!error.retryable || attempt === this.options.maxRetries) {\n throw error;\n }\n lastError = error;\n } catch (err) {\n if (err instanceof B2Error || err instanceof NetworkError) {\n throw err;\n }\n if (err instanceof DOMException && err.name === \"AbortError\") {\n throw err;\n }\n const networkErr = new NetworkError(\n err instanceof Error ? err.message : \"Network error\",\n err\n );\n if (attempt === this.options.maxRetries) {\n throw networkErr;\n }\n lastError = networkErr;\n }\n }\n throw lastError ?? new NetworkError(\"Max retries exceeded\");\n }\n}\nexport {\n FetchTransport,\n RetryTransport\n};\n//# sourceMappingURL=transport.js.map\n","const EncryptionAlgorithm = {\n /** AES with a 256-bit key. The only algorithm B2 currently supports. */\n Aes256: \"AES256\"\n};\nconst EncryptionMode = {\n /** B2-managed encryption keys. */\n SseB2: \"SSE-B2\",\n /** Customer-provided encryption keys. */\n SseC: \"SSE-C\",\n /** No encryption. */\n None: \"none\"\n};\nconst SSE_B2 = { mode: \"SSE-B2\", algorithm: \"AES256\" };\nconst SSE_NONE = { mode: \"none\" };\nfunction sseCustomer(customerKey, customerKeyMd5) {\n return { mode: \"SSE-C\", algorithm: \"AES256\", customerKey, customerKeyMd5 };\n}\nfunction bytesToBase64(bytes) {\n const g = globalThis;\n if (g.Buffer) {\n return g.Buffer.from(bytes).toString(\"base64\");\n }\n let binary = \"\";\n for (const b of bytes) binary += String.fromCharCode(b);\n return btoa(binary);\n}\nasync function md5Base64(bytes) {\n try {\n const { createHash } = await import(\"node:crypto\");\n if (typeof createHash !== \"function\") throw new Error(\"createHash unavailable\");\n return createHash(\"md5\").update(bytes).digest(\"base64\");\n } catch {\n return bytesToBase64(md5Bytes(bytes));\n }\n}\nfunction md5Bytes(data) {\n const originalBitLength = data.byteLength * 8;\n const padLength = (data.byteLength + 8 >>> 6) + 1;\n const padded = new Uint8Array(padLength * 64);\n padded.set(data);\n padded[data.byteLength] = 128;\n const lowBits = originalBitLength >>> 0;\n const highBits = Math.floor(originalBitLength / 4294967296) >>> 0;\n const lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8);\n lengthView.setUint32(0, lowBits, true);\n lengthView.setUint32(4, highBits, true);\n const s = [\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21\n ];\n const k = new Uint32Array([\n 3614090360,\n 3905402710,\n 606105819,\n 3250441966,\n 4118548399,\n 1200080426,\n 2821735955,\n 4249261313,\n 1770035416,\n 2336552879,\n 4294925233,\n 2304563134,\n 1804603682,\n 4254626195,\n 2792965006,\n 1236535329,\n 4129170786,\n 3225465664,\n 643717713,\n 3921069994,\n 3593408605,\n 38016083,\n 3634488961,\n 3889429448,\n 568446438,\n 3275163606,\n 4107603335,\n 1163531501,\n 2850285829,\n 4243563512,\n 1735328473,\n 2368359562,\n 4294588738,\n 2272392833,\n 1839030562,\n 4259657740,\n 2763975236,\n 1272893353,\n 4139469664,\n 3200236656,\n 681279174,\n 3936430074,\n 3572445317,\n 76029189,\n 3654602809,\n 3873151461,\n 530742520,\n 3299628645,\n 4096336452,\n 1126891415,\n 2878612391,\n 4237533241,\n 1700485571,\n 2399980690,\n 4293915773,\n 2240044497,\n 1873313359,\n 4264355552,\n 2734768916,\n 1309151649,\n 4149444226,\n 3174756917,\n 718787259,\n 3951481745\n ]);\n let a0 = 1732584193;\n let b0 = 4023233417;\n let c0 = 2562383102;\n let d0 = 271733878;\n const m = new Uint32Array(16);\n const view = new DataView(padded.buffer);\n for (let block = 0; block < padded.byteLength; block += 64) {\n for (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true);\n let A = a0;\n let B = b0;\n let C = c0;\n let D = d0;\n for (let i = 0; i < 64; i++) {\n let f;\n let g;\n if (i < 16) {\n f = B & C | ~B & D;\n g = i;\n } else if (i < 32) {\n f = D & B | ~D & C;\n g = (5 * i + 1) % 16;\n } else if (i < 48) {\n f = B ^ C ^ D;\n g = (3 * i + 5) % 16;\n } else {\n f = C ^ (B | ~D);\n g = 7 * i % 16;\n }\n const temp = D;\n D = C;\n C = B;\n const sum = A + f + (k[i] ?? 0) + (m[g] ?? 0) >>> 0;\n const shift = s[i] ?? 0;\n const rotated = (sum << shift | sum >>> 32 - shift) >>> 0;\n B = B + rotated >>> 0;\n A = temp;\n }\n a0 = a0 + A >>> 0;\n b0 = b0 + B >>> 0;\n c0 = c0 + C >>> 0;\n d0 = d0 + D >>> 0;\n }\n const out = new Uint8Array(16);\n const outView = new DataView(out.buffer);\n outView.setUint32(0, a0, true);\n outView.setUint32(4, b0, true);\n outView.setUint32(8, c0, true);\n outView.setUint32(12, d0, true);\n return out;\n}\nconst KEY_REDACTED = \"[redacted SSE-C key]\";\nclass EncryptionKey {\n /** Encryption mode discriminant. Always `'SSE-C'` for this class. */\n mode = \"SSE-C\";\n /** Encryption algorithm. B2's S3-compatible API only supports AES-256. */\n algorithm = \"AES256\";\n /** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */\n customerKey;\n /** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */\n customerKeyMd5;\n /**\n * Internal constructor. Use {@link EncryptionKey.fromBytes} or\n * {@link EncryptionKey.fromBase64} instead.\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @internal\n */\n constructor(customerKey, customerKeyMd5) {\n this.customerKey = customerKey;\n this.customerKeyMd5 = customerKeyMd5;\n }\n /**\n * Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the\n * required base64 MD5 digest internally.\n *\n * @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n *\n * @throws If the key is not exactly 32 bytes.\n */\n static async fromBytes(rawKey) {\n if (rawKey.byteLength !== 32) {\n throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`);\n }\n const customerKey = bytesToBase64(rawKey);\n const customerKeyMd5 = await md5Base64(rawKey);\n return new EncryptionKey(customerKey, customerKeyMd5);\n }\n /**\n * Builds an EncryptionKey from precomputed base64 strings. Use this in\n * environments where MD5 must be computed externally (e.g., browsers).\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n */\n static fromBase64(customerKey, customerKeyMd5) {\n return new EncryptionKey(customerKey, customerKeyMd5);\n }\n /**\n * Hides the key bytes from `JSON.stringify`.\n *\n * @returns A redacted shape: same mode and algorithm, but the key and MD5\n * replaced with a placeholder string.\n */\n toJSON() {\n return {\n mode: this.mode,\n algorithm: this.algorithm,\n customerKey: KEY_REDACTED,\n customerKeyMd5: KEY_REDACTED\n };\n }\n /**\n * Hides the key bytes from default `toString()`.\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n toString() {\n return `[EncryptionKey SSE-C ${KEY_REDACTED}]`;\n }\n /**\n * Hides the key bytes from Node's `util.inspect` (and therefore `console.log`).\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return this.toString();\n }\n}\nexport {\n EncryptionAlgorithm,\n EncryptionKey,\n EncryptionMode,\n SSE_B2,\n SSE_NONE,\n sseCustomer\n};\n//# sourceMappingURL=encryption.js.map\n","import { normalizeFileVersionSha1, normalizeFileVersionListSha1 } from \"../util/normalize.js\";\nimport { buildFileInfoHeaders, encodeFileName } from \"./encoding.js\";\nimport { decodeFileName, parseFileInfoHeaders } from \"./encoding.js\";\nimport { EncryptionMode, EncryptionAlgorithm } from \"../types/encryption.js\";\nclass RawClient {\n /** @internal */\n transport;\n /**\n * Creates a new RawClient with the given transport.\n * @param options - The constructor configuration.\n */\n constructor(options) {\n this.transport = options.transport;\n }\n // --- Auth ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}.\n * @param applicationKeyId - The application key ID for authentication.\n * @param applicationKey - The application key secret.\n * @param realmUrl - The B2 realm URL to authenticate against.\n *\n * @returns The authorization response with API URLs and credentials.\n */\n async authorizeAccount(applicationKeyId, applicationKey, realmUrl = \"https://api.backblazeb2.com\") {\n const response = await this.transport.send({\n url: `${realmUrl}/b2api/v3/b2_authorize_account`,\n method: \"GET\",\n headers: {\n Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}`\n }\n });\n return response.json();\n }\n // --- Buckets ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The created bucket metadata.\n */\n async createBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_create_bucket\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted bucket metadata.\n */\n async deleteBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_delete_bucket\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of matching buckets.\n */\n async listBuckets(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_buckets\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated bucket metadata.\n */\n async updateBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_update_bucket\", request);\n }\n // --- Files ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-url | b2_get_upload_url}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The upload URL and authorization token.\n */\n async getUploadUrl(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_get_upload_url\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-upload-file | b2_upload_file}.\n *\n * Unlike most methods, this posts directly to the `uploadUrl` obtained\n * from {@link getUploadUrl} rather than the API URL.\n * @param uploadUrl - The upload endpoint URL.\n * @param headers - The request headers including authorization and content metadata.\n * @param body - The file data to upload.\n * @param signal - An optional abort signal for cancellation.\n *\n * @returns The uploaded file version metadata.\n */\n async uploadFile(uploadUrl, headers, body, signal) {\n const reqHeaders = {\n Authorization: headers.authorization,\n \"X-Bz-File-Name\": encodeFileName(headers.fileName),\n \"Content-Type\": headers.contentType,\n \"Content-Length\": String(headers.contentLength),\n \"X-Bz-Content-Sha1\": headers.contentSha1,\n ...buildFileInfoHeaders(headers.fileInfo)\n };\n if (headers.lastModifiedMillis !== void 0) {\n reqHeaders[\"X-Bz-Info-src_last_modified_millis\"] = String(headers.lastModifiedMillis);\n }\n if (headers.contentDisposition) {\n reqHeaders[\"X-Bz-Info-b2-content-disposition\"] = headers.contentDisposition;\n }\n if (headers.contentLanguage) {\n reqHeaders[\"X-Bz-Info-b2-content-language\"] = headers.contentLanguage;\n }\n if (headers.expires) {\n reqHeaders[\"X-Bz-Info-b2-expires\"] = headers.expires;\n }\n if (headers.cacheControl) {\n reqHeaders[\"X-Bz-Info-b2-cache-control\"] = headers.cacheControl;\n }\n if (headers.contentEncoding) {\n reqHeaders[\"X-Bz-Info-b2-content-encoding\"] = headers.contentEncoding;\n }\n applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n applyRetentionHeaders(reqHeaders, headers.fileRetention);\n applyLegalHoldHeader(reqHeaders, headers.legalHold);\n const response = await this.transport.send({\n url: uploadUrl,\n method: \"POST\",\n headers: reqHeaders,\n body,\n ...signal !== void 0 ? { signal } : {}\n });\n return normalizeFileVersionSha1(await response.json());\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of file names and optional continuation token.\n */\n async listFileNames(apiUrl, authToken, request) {\n return normalizeFileVersionListSha1(\n await this.postJson(apiUrl, authToken, \"b2_list_file_names\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of file versions and optional continuation token.\n */\n async listFileVersions(apiUrl, authToken, request) {\n return normalizeFileVersionListSha1(\n await this.postJson(\n apiUrl,\n authToken,\n \"b2_list_file_versions\",\n request\n )\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The file version metadata.\n */\n async getFileInfo(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_get_file_info\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The hidden file version metadata.\n */\n async hideFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_hide_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted file version identifier.\n */\n async deleteFileVersion(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_delete_file_version\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The copied file version metadata.\n */\n async copyFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_copy_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The copied part metadata.\n */\n async copyPart(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_copy_part\", request);\n }\n // --- Large Files ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The started large file metadata with file ID.\n */\n async startLargeFile(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_start_large_file\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-part-url | b2_get_upload_part_url}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The upload part URL and authorization token.\n */\n async getUploadPartUrl(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_upload_part_url\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-upload-part | b2_upload_part}.\n *\n * Posts directly to the `uploadUrl` obtained from {@link getUploadPartUrl}\n * rather than the API URL.\n * @param uploadUrl - The upload endpoint URL.\n * @param headers - The request headers including authorization and content metadata.\n * @param body - The file data to upload.\n * @param signal - An optional abort signal for cancellation.\n *\n * @returns The uploaded part metadata.\n */\n async uploadPart(uploadUrl, headers, body, signal) {\n const reqHeaders = {\n Authorization: headers.authorization,\n \"X-Bz-Part-Number\": String(headers.partNumber),\n \"Content-Length\": String(headers.contentLength),\n \"X-Bz-Content-Sha1\": headers.contentSha1\n };\n applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n const response = await this.transport.send({\n url: uploadUrl,\n method: \"POST\",\n headers: reqHeaders,\n body,\n ...signal !== void 0 ? { signal } : {}\n });\n return response.json();\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The completed file version metadata.\n */\n async finishLargeFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_finish_large_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The cancelled large file metadata.\n */\n async cancelLargeFile(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_cancel_large_file\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of unfinished large files and optional continuation token.\n */\n async listUnfinishedLargeFiles(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_list_unfinished_large_files\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of uploaded parts and optional continuation token.\n */\n async listParts(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_parts\", request);\n }\n // --- Downloads ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}.\n * @param downloadUrl - The B2 download base URL.\n * @param authToken - The authorization token.\n * @param fileId - The unique identifier of the file to download.\n * @param options - Optional download parameters for range requests and cancellation.\n *\n * @returns The response headers, streaming body, and HTTP status code.\n */\n async downloadFileById(downloadUrl, authToken, fileId, options) {\n const headers = buildDownloadRequestHeaders(authToken, options);\n const url = appendDownloadOverrides(\n `${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`,\n options\n );\n const response = await this.transport.send({\n url,\n method: options?.method ?? \"GET\",\n headers,\n ...options?.signal !== void 0 ? { signal: options.signal } : {}\n });\n return { headers: response.headers, body: response.body, status: response.status };\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}.\n * @param downloadUrl - The B2 download base URL.\n * @param authToken - The authorization token.\n * @param bucketName - The name of the bucket containing the file.\n * @param fileName - The name of the file to download.\n * @param options - Optional download parameters for range requests and cancellation.\n *\n * @returns The response headers, streaming body, and HTTP status code.\n */\n async downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) {\n const headers = buildDownloadRequestHeaders(authToken, options);\n const url = appendDownloadOverrides(\n `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileName(fileName)}`,\n options\n );\n const response = await this.transport.send({\n url,\n method: options?.method ?? \"GET\",\n headers,\n ...options?.signal !== void 0 ? { signal: options.signal } : {}\n });\n return { headers: response.headers, body: response.body, status: response.status };\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The current session authorization token.\n * @param request - The API request parameters.\n *\n * @returns The download authorization token for the specified file prefix.\n */\n async getDownloadAuthorization(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_download_authorization\",\n request\n );\n }\n // --- Keys ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The newly created application key with secret.\n */\n async createKey(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_create_key\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of application keys and optional continuation token.\n */\n async listKeys(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_keys\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted application key metadata.\n */\n async deleteKey(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_delete_key\", request);\n }\n // --- Retention / Legal Hold ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated file retention settings.\n */\n async updateFileRetention(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_update_file_retention\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated file legal hold status.\n */\n async updateFileLegalHold(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_update_file_legal_hold\",\n request\n );\n }\n // --- Notifications ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The configured event notification rules for the specified bucket.\n */\n async getBucketNotificationRules(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_bucket_notification_rules\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated bucket notification rules.\n */\n async setBucketNotificationRules(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_set_bucket_notification_rules\",\n request\n );\n }\n // --- Internal ---\n /**\n * Sends a JSON POST request to the specified B2 API endpoint.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param endpoint - The B2 API endpoint name.\n * @param body - The JSON request body.\n *\n * @returns The parsed JSON response.\n */\n async postJson(apiUrl, authToken, endpoint, body) {\n const response = await this.transport.send({\n url: `${apiUrl}/b2api/v3/${endpoint}`,\n method: \"POST\",\n headers: {\n Authorization: authToken,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(body)\n });\n return response.json();\n }\n}\nfunction applyEncryptionHeaders(headers, encryption) {\n if (!encryption || encryption.mode === EncryptionMode.None) return;\n if (encryption.mode === EncryptionMode.SseB2) {\n headers[\"X-Bz-Server-Side-Encryption\"] = EncryptionAlgorithm.Aes256;\n } else if (encryption.mode === EncryptionMode.SseC) {\n headers[\"X-Bz-Server-Side-Encryption-Customer-Algorithm\"] = EncryptionAlgorithm.Aes256;\n headers[\"X-Bz-Server-Side-Encryption-Customer-Key\"] = encryption.customerKey;\n headers[\"X-Bz-Server-Side-Encryption-Customer-Key-Md5\"] = encryption.customerKeyMd5;\n }\n}\nconst DOWNLOAD_OVERRIDE_PARAMS = [\n \"b2ContentDisposition\",\n \"b2ContentLanguage\",\n \"b2ContentEncoding\",\n \"b2ContentType\",\n \"b2CacheControl\",\n \"b2Expires\"\n];\nfunction buildDownloadRequestHeaders(authToken, options) {\n const headers = { Authorization: authToken };\n if (options?.range) headers[\"Range\"] = options.range;\n if (options?.serverSideEncryption) {\n applyEncryptionHeaders(headers, {\n mode: EncryptionMode.SseC,\n ...options.serverSideEncryption\n });\n }\n return headers;\n}\nfunction appendDownloadOverrides(url, options) {\n if (!options) return url;\n const params = [];\n for (const key of DOWNLOAD_OVERRIDE_PARAMS) {\n const value = options[key];\n if (value !== void 0) {\n params.push(`${key}=${encodeURIComponent(value)}`);\n }\n }\n if (params.length === 0) return url;\n const separator = url.includes(\"?\") ? \"&\" : \"?\";\n return `${url}${separator}${params.join(\"&\")}`;\n}\nfunction applyRetentionHeaders(headers, retention) {\n if (!retention) return;\n if (retention.mode) {\n headers[\"X-Bz-File-Retention-Mode\"] = retention.mode;\n }\n if (retention.retainUntilTimestamp) {\n headers[\"X-Bz-File-Retention-Retain-Until-Timestamp\"] = String(retention.retainUntilTimestamp);\n }\n}\nfunction applyLegalHoldHeader(headers, legalHold) {\n if (!legalHold) return;\n headers[\"X-Bz-File-Legal-Hold\"] = legalHold;\n}\nexport {\n RawClient,\n buildFileInfoHeaders,\n decodeFileName,\n encodeFileName,\n parseFileInfoHeaders\n};\n//# sourceMappingURL=index.js.map\n","import { InMemoryAccountInfo } from \"./auth/in-memory.js\";\nimport { getRealmUrl } from \"./auth/realms.js\";\nimport { Bucket } from \"./bucket.js\";\nimport { FetchTransport, RetryTransport } from \"./http/transport.js\";\nimport { UrlGuard, deriveAllowedSuffixes } from \"./http/url-guard.js\";\nimport { RawClient } from \"./raw/index.js\";\nimport { accountId } from \"./types/ids.js\";\nimport { DEFAULT_PAGE_SIZE } from \"./util/defaults.js\";\nimport { paginateItems } from \"./util/paginator.js\";\nclass B2Client {\n /** Low-level client for direct B2 API calls. */\n raw;\n /** Authorization state storage (tokens, URLs, capabilities). */\n accountInfo;\n /**\n * SSRF allow-list applied by the default {@link FetchTransport}. `null` when\n * a custom transport was supplied — in that case the SDK does not own the\n * guard. Locked down by {@link B2Client.authorize}.\n */\n urlGuard;\n applicationKeyId;\n applicationKey;\n realmUrl;\n userAllowedSuffixes;\n /**\n * Creates a new B2Client. Call {@link authorize} before making API requests.\n * @param options - Configuration including credentials, realm, and transport settings.\n */\n constructor(options) {\n this.applicationKeyId = options.applicationKeyId;\n this.applicationKey = options.applicationKey;\n this.realmUrl = getRealmUrl(options.realm ?? \"production\");\n this.accountInfo = options.accountInfo ?? new InMemoryAccountInfo();\n this.userAllowedSuffixes = options.allowedHostSuffixes;\n let baseTransport;\n if (options.transport !== void 0) {\n baseTransport = options.transport;\n this.urlGuard = null;\n } else {\n const urlGuard = new UrlGuard();\n baseTransport = new FetchTransport({\n urlGuard,\n ...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {}\n });\n this.urlGuard = urlGuard;\n }\n const retryTransport = new RetryTransport({\n transport: baseTransport,\n ...options.retry !== void 0 ? { retry: options.retry } : {},\n onReauth: () => this.reauthorize()\n });\n this.raw = new RawClient({ transport: retryTransport });\n }\n /**\n * Authenticates with B2 and stores the authorization state. Must be called before other methods.\n *\n * @returns The authorization response containing tokens, URLs, and capabilities.\n */\n async authorize() {\n const auth = await this.raw.authorizeAccount(\n this.applicationKeyId,\n this.applicationKey,\n this.realmUrl\n );\n this.accountInfo.setAuth(auth);\n if (this.urlGuard !== null) {\n const derived = deriveAllowedSuffixes(auth.apiInfo.storageApi);\n const merged = this.userAllowedSuffixes !== void 0 ? Array.from(/* @__PURE__ */ new Set([...derived, ...this.userAllowedSuffixes])) : derived;\n this.urlGuard.setAllowedSuffixes(merged);\n }\n return auth;\n }\n /**\n * Refresh credentials after a 401. Returns the fresh auth token so\n * {@link RetryTransport} can rewrite the in-flight request's\n * Authorization header before retrying.\n *\n * @returns The fresh authorization token.\n */\n async reauthorize() {\n this.accountInfo.clear();\n const auth = await this.authorize();\n return auth.authorizationToken;\n }\n /**\n * Creates a new B2 bucket.\n * @param options - Bucket configuration including name, type, and optional settings.\n *\n * @returns A {@link Bucket} handle for the newly created bucket.\n */\n async createBucket(options) {\n const request = {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n };\n const info = await this.raw.createBucket(\n this.accountInfo.getApiUrl(),\n this.accountInfo.getAuthToken(),\n request\n );\n return new Bucket(this, info);\n }\n /**\n * Lists buckets in the account, optionally filtered by ID, name, or type.\n * @param options - Optional filters for bucket ID, name, or type.\n *\n * @returns An array of {@link Bucket} handles.\n */\n async listBuckets(options) {\n const resp = await this.raw.listBuckets(\n this.accountInfo.getApiUrl(),\n this.accountInfo.getAuthToken(),\n {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n }\n );\n return resp.buckets.map((info) => new Bucket(this, info));\n }\n /**\n * Looks up a single bucket by name.\n * @param bucketName - The name of the bucket to find.\n *\n * @returns The {@link Bucket} handle, or `null` if not found.\n */\n async getBucket(bucketName) {\n const buckets = await this.listBuckets({ bucketName });\n return buckets[0] ?? null;\n }\n /**\n * Permanently deletes a bucket. The bucket must be empty.\n * @param id - The unique identifier of the bucket to delete.\n *\n * @returns The deleted bucket metadata.\n */\n async deleteBucket(id) {\n return this.raw.deleteBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n bucketId: id\n });\n }\n /**\n * Creates a new application key with the specified capabilities.\n * @param options - Key configuration including capabilities, name, and optional restrictions.\n *\n * @returns The full key including the secret (only returned at creation time).\n */\n async createKey(options) {\n return this.raw.createKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n });\n }\n /**\n * Lists application keys in the account.\n * @param options - Optional pagination settings.\n *\n * @returns A page of application keys with an optional continuation token.\n */\n async listKeys(options) {\n return this.raw.listKeys(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options?.pageSize !== void 0 ? { maxKeyCount: options.pageSize } : {},\n ...options?.startApplicationKeyId !== void 0 ? { startApplicationKeyId: options.startApplicationKeyId } : {}\n });\n }\n /**\n * Async iterator that yields every application key on the account,\n * automatically handling pagination via `listKeys`.\n *\n * @param options - Pagination + abort options. `pageSize` is forwarded\n * to `maxKeyCount`; the default is 1000.\n *\n * @returns An async iterable of {@link ApplicationKey} entries.\n *\n * @example\n * ```ts\n * for await (const key of client.paginateKeys()) {\n * console.log(key.keyName, key.capabilities)\n * }\n * ```\n */\n paginateKeys(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listKeys({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startApplicationKeyId: cursor } : {}\n });\n return { page: resp, nextCursor: resp.nextApplicationKeyId ?? void 0 };\n },\n (page) => page.keys,\n options?.signal\n );\n }\n /**\n * Permanently deletes an application key.\n * @param applicationKeyId - The unique identifier of the key to delete.\n *\n * @returns The deleted application key metadata.\n */\n async deleteKey(applicationKeyId) {\n return this.raw.deleteKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n applicationKeyId\n });\n }\n /**\n * Checks whether the authorized application key carries every capability in\n * `needed`. Returns the missing capabilities so callers can fail fast with a\n * clear error instead of a generic 401/403 from the server.\n *\n * @param needed - The capabilities required by the planned operation.\n *\n * @returns An object with `ok: true` when every needed capability is\n * present, otherwise `{ ok: false, missing: [...] }`.\n *\n * @throws If {@link authorize} has not been called yet.\n */\n hasCapabilities(needed) {\n const auth = this.accountInfo.getAuth();\n if (!auth) throw new Error(\"Not authorized. Call authorize() first.\");\n const available = new Set(auth.apiInfo.storageApi.allowed.capabilities);\n const missing = needed.filter((cap) => !available.has(cap));\n return { ok: missing.length === 0, missing };\n }\n}\nexport {\n B2Client\n};\n//# sourceMappingURL=client.js.map\n","import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Action version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync: bumping `version` in package.json\n * automatically propagates here, into the User-Agent header, and into the\n * bundled `dist/index.js`.\n *\n * Works because:\n * - Node 22+ supports native JSON import attributes.\n * - ncc / webpack statically inlines the JSON at bundle time, so the\n * runtime artifact has the version baked in as a string literal.\n * - TypeScript's `resolveJsonModule` makes the import type-safe.\n */\nexport const VERSION: string = pkg.version\n","import * as core from '@actions/core'\nimport type { AuthorizeAccountResponse, FileVersion } from '@backblaze-labs/b2-sdk'\nimport {\n B2Client,\n type Bucket,\n type HttpTransport,\n InMemoryAccountInfo,\n} from '@backblaze-labs/b2-sdk'\nimport { VERSION } from './version.ts'\n\n/**\n * An authorized B2Client paired with the bucket name the action is scoped\n * to. Returned by {@link buildClient}; consumed by command dispatch sites\n * that need either the high-level client (cross-bucket copy, presign) or\n * the resolved bucket (via {@link getBucket}).\n */\nexport interface AuthorizedClient {\n /** The authorized SDK client. `client.accountInfo` is populated. */\n client: B2Client\n /** The destination bucket name as provided to the action's `bucket` input. */\n bucketName: string\n}\n\n/** Inputs to {@link buildClient}. */\nexport interface BuildClientOptions {\n /** B2 application key ID. Masked via `core.setSecret` by the dispatcher (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked via `core.setSecret` by the dispatcher. */\n applicationKey: string\n /** Target bucket name (stored on the result for later `getBucket` resolution). */\n bucket: string\n /** Override the default B2 realm endpoint. Only set for staging / custom realms. */\n endpoint?: string | undefined\n /** Inject a custom transport (used by tests with the SDK's `B2Simulator`). */\n transport?: HttpTransport | undefined\n}\n\nfunction maskAccountAuthToken(token: string | null | undefined): void {\n if (token) core.setSecret(token)\n}\n\nclass SecretMaskingAccountInfo extends InMemoryAccountInfo {\n // The SDK routes authorize() and transparent reauthorize() through the\n // supplied AccountInfo.setAuth. The reauth masking test is the CI guard for\n // this SDK coupling when the dependency is bumped.\n override setAuth(auth: AuthorizeAccountResponse): void {\n maskAccountAuthToken(auth.authorizationToken)\n super.setAuth(auth)\n }\n}\n\n/**\n * Build an authorized B2Client.\n *\n * Steps:\n * 1. Construct the client with `userAgent: 'b2-github-action/'`. The\n * SDK preserves its own `b2-sdk-typescript/` and `@backblaze-labs/b2-sdk` tokens before\n * ours so Backblaze server-side logs see both attribution layers.\n * 2. `await client.authorize()`. This is one-shot for the lifetime of the\n * action invocation. B2 auth tokens carry a 24h TTL; typical GitHub\n * Actions runs finish well inside that window. If a long-running job\n * outlives the token, the SDK transparently re-authorizes on the next\n * 401, so the action layer does not need its own refresh loop.\n * 3. Use an AccountInfo wrapper that masks each account authorization token\n * as it is stored, including SDK-driven reauthorization after token\n * expiry. The post-authorize mask is kept as a fallback in case a future\n * SDK version bypasses the wrapper for initial authorization.\n *\n * The `transport` parameter is only used by tests (the SDK's B2Simulator\n * provides one). Production callers leave it undefined to use the SDK's\n * default FetchTransport with its built-in SSRF guard.\n */\nexport async function buildClient(options: BuildClientOptions): Promise {\n const userAgent = `b2-github-action/${VERSION}`\n\n const client = new B2Client({\n applicationKeyId: options.applicationKeyId,\n applicationKey: options.applicationKey,\n accountInfo: new SecretMaskingAccountInfo(),\n userAgent,\n ...(options.transport !== undefined ? { transport: options.transport } : {}),\n ...(options.endpoint !== undefined ? { realm: options.endpoint } : {}),\n })\n\n await client.authorize()\n // Deliberately overlaps with setAuth for initial auth. If a future SDK\n // changes authorize() storage, the public AccountInfo getter still masks the\n // stored account token before command code can log.\n maskAccountAuthToken(client.accountInfo.getAuthToken())\n\n return { client, bucketName: options.bucket }\n}\n\n/**\n * Resolve a bucket by name. Throws a clear error rather than the SDK's\n * `undefined` return so the workflow log surfaces the misconfiguration.\n */\nexport async function getBucket(authorized: AuthorizedClient) {\n const bucket = await authorized.client.getBucket(authorized.bucketName)\n if (!bucket) {\n throw new Error(\n `Bucket \"${authorized.bucketName}\" not found, or the application key lacks listBuckets capability for it.`,\n )\n }\n return bucket\n}\n\n/**\n * Resolve an exact file name only when its latest version is an upload. If the\n * latest exact-name version is a hide marker, this intentionally reports the\n * file as not found instead of selecting an older upload from version history\n * or revealing hidden-object existence in default workflow logs. Throws when\n * the latest exact-name state is hidden, deleted, or absent. Used by `copy`,\n * `delete`, and `retention` to resolve a file name to a `fileId` before\n * operating on it.\n *\n * Consistency assumption: B2's `listFileNames` is read-after-write consistent\n * for a recently-uploaded file in the same region. The simulator returns\n * uploads immediately; production B2 in practice does the same, but a caller\n * that chains \"upload then operate on the same name\" across two action steps\n * is relying on observed behavior rather than a documented SLA.\n *\n * @param bucket - The bucket to search.\n * @param fileName - Exact file name (path) to look up.\n * @param bucketDisplayName - Optional label for the error message; defaults\n * to `bucket.name`. Used when looking up in a source bucket distinct from\n * the action's destination bucket (cross-bucket copy).\n */\nexport async function findFileByName(\n bucket: Bucket,\n fileName: string,\n bucketDisplayName?: string,\n): Promise {\n const display = bucketDisplayName ?? bucket.name\n const page = await bucket.listFileNames({ prefix: fileName, pageSize: 1 })\n const exactLatest = page.files.find((f) => f.fileName === fileName)\n if (exactLatest?.action === 'upload') return exactLatest\n\n throw new Error(`File not found in bucket \"${display}\": ${fileName}`)\n}\n","import { Buffer } from 'node:buffer'\nimport { createHash } from 'node:crypto'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { SSE_B2, sseCustomer } from '@backblaze-labs/b2-sdk'\n\nconst CANONICAL_BASE64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/\n\n/**\n * Parse the `sse` input into an SDK {@link EncryptionSetting}.\n *\n * Accepted forms:\n * - `undefined` / empty → no encryption setting passed (B2 still applies any\n * bucket-default SSE-B2; we just don't override it).\n * - `\"B2\"` (case-insensitive) → SSE-B2 with the B2-managed key (no cost).\n * - `\"C:\"` → SSE-C with a customer-provided key. We\n * compute the required base64 MD5 internally so the workflow author\n * doesn't have to.\n *\n * The action runs in Node only, so we use `node:crypto.createHash('md5')`\n * directly rather than the SDK's isomorphic key wrapper. We deliberately do\n * NOT log the key bytes; the only place they ever go is into the\n * `customerKey` field of the SDK setting which the SDK marks as a secret in\n * any error / debug output.\n */\nexport function parseSse(raw: string | undefined): EncryptionSetting | undefined {\n if (raw === undefined || raw === '') return undefined\n\n const normalized = raw.trim()\n if (normalized.toUpperCase() === 'B2') return SSE_B2\n\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n const base64Key = normalized.slice(2).trim()\n if (base64Key === '') {\n throw new Error(\"SSE-C key is empty. Use 'C:'.\")\n }\n // Node's `Buffer.from(str, 'base64')` silently drops invalid chars instead\n // of throwing, so validate the canonical alphabet and padding first.\n if (!CANONICAL_BASE64.test(base64Key)) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const keyBytes = Buffer.from(base64Key, 'base64')\n if (keyBytes.byteLength !== 32) {\n throw new Error(\n `SSE-C key must decode to exactly 32 bytes (256 bits); got ${keyBytes.byteLength}.`,\n )\n }\n const customerKey = keyBytes.toString('base64')\n if (customerKey !== base64Key) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const customerKeyMd5 = createHash('md5').update(keyBytes).digest('base64')\n return sseCustomer(customerKey, customerKeyMd5)\n }\n\n throw new Error(`Invalid 'sse' input: \"${raw}\". Expected \"B2\" or \"C:\".`)\n}\n","import * as core from '@actions/core'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { parseSse } from './sse.ts'\n\n/**\n * Discriminator the action's dispatcher switches on. Matches the values\n * accepted by the `action:` input in `action.yml`. Adding a new verb\n * requires updating this union, the runtime `VALID_ACTIONS` list,\n * `ACTION_EFFECTS`, the dispatcher in `src/main.ts`, and the documentation\n * surfaces.\n */\nexport type ActionName =\n | 'upload'\n | 'download'\n | 'sync'\n | 'copy'\n | 'delete'\n | 'presign'\n | 'list'\n | 'hide'\n | 'unhide'\n | 'verify'\n | 'retention'\n | 'head'\n | 'purge'\n\nconst VALID_ACTIONS: readonly ActionName[] = [\n 'upload',\n 'download',\n 'sync',\n 'copy',\n 'delete',\n 'presign',\n 'list',\n 'hide',\n 'unhide',\n 'verify',\n 'retention',\n 'head',\n 'purge',\n]\n\ntype ActionEffect = {\n readonly kind: 'read' | 'write'\n readonly honorsDryRun: boolean\n}\n\n/**\n * Runtime side-effect policy for each action verb.\n *\n * @internal\n */\nexport const ACTION_EFFECTS = {\n upload: { kind: 'write', honorsDryRun: false },\n download: { kind: 'read', honorsDryRun: false },\n sync: { kind: 'write', honorsDryRun: true },\n copy: { kind: 'write', honorsDryRun: false },\n delete: { kind: 'write', honorsDryRun: true },\n presign: { kind: 'read', honorsDryRun: false },\n list: { kind: 'read', honorsDryRun: false },\n hide: { kind: 'write', honorsDryRun: false },\n unhide: { kind: 'write', honorsDryRun: false },\n verify: { kind: 'read', honorsDryRun: false },\n retention: { kind: 'write', honorsDryRun: false },\n head: { kind: 'read', honorsDryRun: false },\n purge: { kind: 'write', honorsDryRun: true },\n} as const satisfies Record\n\n/** How `sync` decides whether two files match. Drives the SDK's `synchronize()`. */\nexport type CompareMode = 'modtime' | 'size' | 'none'\n/** What `sync` does with destination-only files when reconciling. */\nexport type KeepMode = 'no-delete' | 'delete' | 'keep-days'\n/** Direction of a `sync`: `auto` infers from whether `source` is local or remote. */\nexport type SyncDirection = 'auto' | 'up' | 'down'\n/** B2 Object Lock retention mode. `none` clears any prior retention. */\nexport type RetentionMode = 'compliance' | 'governance' | 'none'\n/** B2 Object Lock legal-hold state. */\nexport type LegalHold = 'on' | 'off'\n\nconst VALID_COMPARE: readonly CompareMode[] = ['modtime', 'size', 'none']\nconst VALID_KEEP: readonly KeepMode[] = ['no-delete', 'delete', 'keep-days']\nconst VALID_DIRECTION: readonly SyncDirection[] = ['auto', 'up', 'down']\nconst VALID_RETENTION_MODE: readonly RetentionMode[] = ['compliance', 'governance', 'none']\nconst VALID_LEGAL_HOLD: readonly LegalHold[] = ['on', 'off']\nconst APPLICATION_KEY_ID_ENV = 'B2_APPLICATION_KEY_ID'\nconst APPLICATION_KEY_ENV = 'B2_APPLICATION_KEY'\n\n/**\n * The fully-parsed, fully-validated action surface. Built by\n * {@link parseInputs} from `INPUT_*` env vars (via `@actions/core`); every\n * command in `src/commands/` consumes a frozen instance of this shape.\n *\n * Most fields map 1:1 to inputs declared in `action.yml`. Defaults and\n * optionality match the YAML surface; see `action.yml` for the user-facing\n * documentation per input.\n */\nexport interface ParsedInputs {\n /** Which verb to dispatch to. */\n action: ActionName\n /** B2 application key ID. Masked at parse time via `core.setSecret` (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked at parse time via `core.setSecret`. */\n applicationKey: string\n /** Destination bucket name for the action. */\n bucket: string\n /** Cross-bucket `copy` source bucket. Undefined means same-bucket copy. */\n sourceBucket: string | undefined\n /**\n * Verb-dependent source. Upload/sync: a local path or glob. Download/copy/\n * delete/presign/list/hide/unhide/verify/retention/head/purge: a B2 file\n * name or prefix (trailing `/` means prefix mode for verbs that support it).\n */\n source: string | undefined\n /**\n * Verb-dependent destination. Upload/sync: B2 file name or prefix.\n * Download: local path. Copy: destination file name. Other verbs: ignored.\n */\n destination: string | undefined\n /** Glob patterns to include during upload/sync expansion. */\n include: string[]\n /** Glob patterns to exclude during upload/sync expansion. Default: `.git/**`. */\n exclude: string[]\n /** Parallel parts/files for upload/sync. */\n concurrency: number\n /** Multipart part size in bytes. Undefined defers to the SDK's recommendation. */\n partSize: number | undefined\n /** Resume an in-progress multipart upload. */\n resume: boolean\n /** Content-Type to set on uploaded objects. Undefined leaves B2's auto-detect. */\n contentType: string | undefined\n /** Response Content-Disposition override for `download` and `presign`. */\n contentDisposition: string | undefined\n /** Response Content-Type override for `download` and `presign`. */\n responseContentType: string | undefined\n /** Response Cache-Control override for `download` and `presign`. */\n cacheControl: string | undefined\n /** Preview without executing (sync/delete/purge). */\n dryRun: boolean\n /** Permit whole-bucket purge when `source` is empty or `/`. */\n allowBucketPurge: boolean\n /** Presigned-URL TTL in seconds. */\n presignTtlSeconds: number\n /** Override B2 realm endpoint for staging / custom realms. */\n endpoint: string | undefined\n /** Fail the action when upload/sync matches zero files. */\n failOnEmpty: boolean\n /** Raw `sse:` input value as the user typed it. Retained for diagnostics. */\n sse: string | undefined\n /** Parsed SSE specification ready to hand to the SDK. */\n encryption: EncryptionSetting | undefined\n /** How `sync` compares files. */\n compareMode: CompareMode\n /** How `sync` treats destination-only files. */\n keepMode: KeepMode\n /** Direction of a `sync` (auto-detected when set to `auto`). */\n syncDirection: SyncDirection\n /** Cap on listed/presigned entries for `list` and prefix `presign`. */\n maxResults: number\n /** Literal SHA-1 to compare against in `verify` (when set, no local read). */\n expectedSha1: string | undefined\n /** Object Lock retention mode to apply (`retention` verb). */\n retentionMode: RetentionMode | undefined\n /** ISO-8601 timestamp until which retention applies. Required with `retentionMode`. */\n retentionUntil: string | undefined\n /** Legal-hold state to apply (`retention` verb). */\n legalHold: LegalHold | undefined\n /** Allow shortening a governance-mode retention (requires key capability). */\n bypassGovernance: boolean\n}\n\n/**\n * Sensitive raw values that can appear in parser-scope errors before\n * {@link parseInputs} returns its structured output.\n */\nexport function collectInputSecretsForScrubbing(): string[] {\n const secretValues = new Set()\n addSecretValue(secretValues, core.getInput('application-key-id'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ID_ENV])\n addSecretValue(secretValues, core.getInput('application-key'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ENV])\n addSseSecretValue(secretValues, core.getInput('sse'))\n return [...secretValues]\n}\n\n/**\n * Parse and validate inputs.\n *\n * Credentials lookup order:\n *\n * 1. `application-key-id` / `application-key` action inputs\n * 2. `B2_APPLICATION_KEY_ID` / `B2_APPLICATION_KEY` env vars (the official\n * contract used by the Backblaze b2 CLI and the @backblaze-labs/b2-sdk).\n *\n * The credential value, once resolved, is immediately masked via `core.setSecret`\n * so any accidental echo (including from a misbehaving sub-process) is redacted\n * in workflow logs.\n */\nexport function parseInputs(): ParsedInputs {\n const action = parseEnum('action', required('action').toLowerCase(), VALID_ACTIONS)\n\n const applicationKeyId = resolveCredential('application-key-id', APPLICATION_KEY_ID_ENV)\n const applicationKey = resolveCredential('application-key', APPLICATION_KEY_ENV)\n // The keyId is identifying (not the secret half of the HMAC pair), but mask\n // it anyway for defense in depth: the canonical AWS analogue mask AKIA-style\n // IDs in CI logs, and masking costs nothing in debuggability since the user\n // already knows which key they passed.\n core.setSecret(applicationKeyId)\n core.setSecret(applicationKey)\n\n const bucket = required('bucket')\n const sourceBucket = optional('source-bucket')\n const allowBucketPurge = parseBool(\n 'allow-bucket-purge',\n core.getInput('allow-bucket-purge') || 'false',\n )\n const source = optionalSource(action, allowBucketPurge)\n const destination = optional('destination')\n\n const include = splitCsv(optional('include'))\n const exclude = splitCsv(optional('exclude'))\n\n const concurrency = parsePositiveInt('concurrency', core.getInput('concurrency') || '4')\n const partSizeInput = optional('part-size')\n const partSize =\n partSizeInput !== undefined ? parsePositiveInt('part-size', partSizeInput) : undefined\n\n const resume = parseBool('resume', core.getInput('resume') || 'true')\n const dryRun = parseBool('dry-run', core.getInput('dry-run') || 'false')\n const failOnEmpty = parseBool('fail-on-empty', core.getInput('fail-on-empty') || 'true')\n const bypassGovernance = parseBool(\n 'bypass-governance',\n core.getInput('bypass-governance') || 'false',\n )\n\n const presignTtlSeconds = parsePositiveInt('presign-ttl', core.getInput('presign-ttl') || '3600')\n const maxResults = parsePositiveInt('max-results', core.getInput('max-results') || '1000')\n\n const contentType = optional('content-type')\n const contentDisposition = optional('content-disposition')\n const responseContentType = optional('response-content-type')\n const cacheControl = optional('cache-control')\n const endpoint = optional('endpoint')\n const sse = optional('sse')\n const encryption = parseSse(sse)\n const expectedSha1 = optional('expected-sha1')\n const retentionUntil = optional('retention-until')\n\n const compareMode = parseEnum(\n 'compare-mode',\n (core.getInput('compare-mode') || 'modtime').toLowerCase(),\n VALID_COMPARE,\n )\n const keepMode = parseEnum(\n 'keep-mode',\n (core.getInput('keep-mode') || 'no-delete').toLowerCase(),\n VALID_KEEP,\n )\n const syncDirection = parseEnum(\n 'direction',\n (core.getInput('direction') || 'auto').toLowerCase(),\n VALID_DIRECTION,\n )\n const retentionMode = parseOptionalEnum(\n 'retention-mode',\n optional('retention-mode')?.toLowerCase(),\n VALID_RETENTION_MODE,\n )\n const legalHold = parseOptionalEnum(\n 'legal-hold',\n optional('legal-hold')?.toLowerCase(),\n VALID_LEGAL_HOLD,\n )\n\n return {\n action,\n applicationKeyId,\n applicationKey,\n bucket,\n sourceBucket,\n source,\n destination,\n include,\n exclude,\n concurrency,\n partSize,\n resume,\n contentType,\n contentDisposition,\n responseContentType,\n cacheControl,\n dryRun,\n allowBucketPurge,\n presignTtlSeconds,\n endpoint,\n failOnEmpty,\n sse,\n encryption,\n compareMode,\n keepMode,\n syncDirection,\n maxResults,\n expectedSha1,\n retentionMode,\n retentionUntil,\n legalHold,\n bypassGovernance,\n }\n}\n\n/**\n * Validate that `inputs.source` is set and non-empty, returning the value.\n * Throws a uniform error message naming the verb so the workflow log surfaces\n * exactly what's missing. Commands that allow an empty-string source for\n * special semantics (e.g. `purge` with explicit whole-bucket scope) should\n * not use this helper.\n */\nexport function requireSource(\n source: string | undefined,\n verb: string,\n description?: string,\n): string {\n if (source === undefined || source === '') {\n const tail = description !== undefined ? ` (${description})` : ''\n throw new Error(`'source' input is required for '${verb}' action${tail}`)\n }\n return source\n}\n\n/**\n * Validate that `raw` is one of `valid`, narrowing the return type.\n *\n * Replaces the previous pattern of one type-guard + one throw per enum:\n *\n * const x = parseEnum('compare-mode', raw, VALID_COMPARE)\n *\n * Throws a uniform error message that lists the legal values.\n *\n * @internal\n */\nexport function parseEnum(name: string, raw: string, valid: readonly T[]): T {\n if ((valid as readonly string[]).includes(raw)) return raw as T\n throw new Error(`Invalid '${name}' input: \"${raw}\". Must be one of: ${valid.join(', ')}`)\n}\n\n/**\n * Like {@link parseEnum} but passes through `undefined`. Used for inputs that\n * are optional but, when set, must be one of a known set.\n */\nfunction parseOptionalEnum(\n name: string,\n raw: string | undefined,\n valid: readonly T[],\n): T | undefined {\n return raw === undefined ? undefined : parseEnum(name, raw, valid)\n}\n\nfunction required(name: string): string {\n // `@actions/core` throws on missing required inputs, so this never returns\n // empty. Wrapping the call only exists so the throw site has a uniform\n // shape with the rest of the input parsers.\n return core.getInput(name, { required: true })\n}\n\nfunction optional(name: string): string | undefined {\n const v = core.getInput(name)\n return v === '' ? undefined : v\n}\n\nfunction optionalSource(action: ActionName, allowBucketPurge: boolean): string | undefined {\n const v = core.getInput('source')\n if (v !== '') return v\n return action === 'purge' && allowBucketPurge ? '' : undefined\n}\n\nfunction addSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined || value === '') return\n const trimmed = value.trim()\n for (const secret of new Set([value, trimmed])) {\n if (secret === '' || secretValues.has(secret)) continue\n core.setSecret(secret)\n secretValues.add(secret)\n }\n}\n\nfunction addSseSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined) return\n const normalized = value.trim()\n if (normalized === '' || normalized.toUpperCase() === 'B2') return\n\n addSecretValue(secretValues, value)\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n addSecretValue(secretValues, normalized.slice(2).trim())\n }\n}\n\nfunction resolveCredential(inputName: string, envName: string): string {\n const fromInput = optional(inputName)\n if (fromInput !== undefined) return fromInput\n\n const fromEnv = process.env[envName]\n if (fromEnv !== undefined && fromEnv !== '') return fromEnv\n\n throw new Error(`Missing credential: set input '${inputName}' or env var '${envName}'`)\n}\n\n/**\n * Parse a comma-separated action input, trimming entries and dropping blanks.\n *\n * @internal\n */\nexport function splitCsv(value: string | undefined): string[] {\n if (value === undefined) return []\n return value\n .split(',')\n .map((s) => s.trim())\n .filter((s) => s.length > 0)\n}\n\n/**\n * Parse the documented boolean input spellings accepted by this action.\n *\n * @internal\n */\nexport function parseBool(name: string, raw: string): boolean {\n const v = raw.trim().toLowerCase()\n if (v === 'true' || v === '1' || v === 'yes') return true\n if (v === 'false' || v === '0' || v === 'no') return false\n throw new Error(`Invalid boolean for '${name}': \"${raw}\"`)\n}\n\n/**\n * Parse a strictly positive integer input.\n *\n * @internal\n */\nexport function parsePositiveInt(name: string, raw: string): number {\n const trimmed = raw.trim()\n const n = Number(trimmed)\n if (!/^\\d+$/.test(trimmed) || n <= 0 || !Number.isSafeInteger(n)) {\n throw new Error(`Invalid positive integer for '${name}': \"${raw}\"`)\n }\n return n\n}\n","import * as core from '@actions/core'\nimport type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link copyCommand}. Single-file (copy is always one-source-one-destination). */\nexport interface CopyResult {\n /** Source bucket name. */\n sourceBucket: string\n /** Source file name (the B2 key in the source bucket). */\n sourceFileName: string\n /** Destination bucket name. */\n destinationBucket: string\n /** Destination file name (the B2 key in the destination bucket). */\n destinationFileName: string\n /** B2 file ID of the newly-created destination object. */\n fileId: string\n /** Byte size of the copied object. */\n size: number\n}\n\n/**\n * Server-side copy of one B2 object to a new name, within the same bucket or\n * across two buckets in the same account.\n *\n * The copy is done by reference (`b2_copy_file` for small, `b2_copy_part` for\n * large): bytes never traverse the runner. This is dramatically faster and\n * cheaper than download-then-reupload for any non-trivial file.\n *\n * Cross-bucket: set `source-bucket` to the source bucket name. The action's\n * `bucket` input is the destination. The application key must have read\n * permission on the source bucket and write permission on the destination.\n */\nexport async function copyCommand(\n client: B2Client,\n destinationBucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'copy', 'the source B2 file name')\n const destination = inputs.destination\n if (destination === undefined || destination === '') {\n throw new Error(\n \"'destination' input is required for 'copy' action (the destination B2 file name)\",\n )\n }\n\n const sourceBucketName = inputs.sourceBucket ?? destinationBucket.name\n const sourceBucket =\n sourceBucketName === destinationBucket.name\n ? destinationBucket\n : await client.getBucket(sourceBucketName)\n if (!sourceBucket) {\n throw new Error(`Source bucket \"${sourceBucketName}\" not found, or key lacks listBuckets.`)\n }\n\n const hit = await findFileByName(sourceBucket, source, sourceBucketName)\n\n core.startGroup(\n `copy b2://${sourceBucketName}/${source} → b2://${destinationBucket.name}/${destination}`,\n )\n try {\n const recommendedPartSize = client.accountInfo.getRecommendedPartSize()\n const isLarge = hit.contentLength > recommendedPartSize\n const copyOptions = {\n sourceFileId: hit.fileId,\n fileName: destination,\n ...(sourceBucketName !== destinationBucket.name\n ? { destinationBucketId: destinationBucket.id }\n : {}),\n }\n\n const result = isLarge\n ? await destinationBucket.copyLargeFile({\n ...copyOptions,\n ...(signal !== undefined ? { signal } : {}),\n })\n : await destinationBucket.copyFile(copyOptions)\n\n core.info(` copied → fileId=${result.fileId}, size=${result.contentLength}`)\n return {\n sourceBucket: sourceBucketName,\n sourceFileName: source,\n destinationBucket: destinationBucket.name,\n destinationFileName: destination,\n fileId: result.fileId,\n size: result.contentLength,\n }\n } finally {\n core.endGroup()\n }\n}\n","import type {\n Bucket,\n DeleteAllDeleteEvent,\n DeleteAllErrorEvent,\n DeleteAllSkipEvent,\n FileAction,\n} from '@backblaze-labs/b2-sdk'\n\nconst DELETE_FAILED_MESSAGE = 'delete failed'\nconst OUT_OF_PREFIX_MESSAGE = 'listed file is outside requested prefix'\n\n// SDK-deleteAll-compatible events with local extensions for this bypass-governance shim.\nexport type DeleteAllVersionsDeleteEvent = DeleteAllDeleteEvent & {\n readonly action: FileAction\n}\n\nexport type DeleteAllVersionsEvent =\n | DeleteAllVersionsDeleteEvent\n | DeleteAllErrorEvent\n | DeleteAllSkipEvent\n\nexport interface DeleteAllVersionsOptions {\n prefix?: string\n dryRun: boolean\n bypassGovernance: boolean\n signal?: AbortSignal\n}\n\nexport async function* deleteAllVersions(\n bucket: Bucket,\n options: DeleteAllVersionsOptions,\n): AsyncGenerator {\n const versions = bucket.paginateFileVersions({\n ...(options.prefix !== undefined ? { prefix: options.prefix } : {}),\n ...(options.signal !== undefined ? { signal: options.signal } : {}),\n })\n\n while (true) {\n options.signal?.throwIfAborted()\n const next = await versions.next()\n options.signal?.throwIfAborted()\n if (next.done === true) break\n\n const version = next.value\n if (options.prefix !== undefined && !version.fileName.startsWith(options.prefix)) {\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: OUT_OF_PREFIX_MESSAGE,\n }\n continue\n }\n\n if (options.dryRun) {\n yield { type: 'skip', fileName: version.fileName, fileId: version.fileId }\n continue\n }\n\n options.signal?.throwIfAborted()\n try {\n if (options.bypassGovernance) {\n await bucket.deleteFileVersion(version.fileName, version.fileId, {\n bypassGovernance: true,\n })\n } else {\n await bucket.deleteFileVersion(version.fileName, version.fileId)\n }\n yield {\n type: 'delete',\n fileName: version.fileName,\n fileId: version.fileId,\n action: version.action,\n }\n } catch (error) {\n options.signal?.throwIfAborted()\n if (isAbortError(error)) throw error\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: DELETE_FAILED_MESSAGE,\n }\n }\n\n options.signal?.throwIfAborted()\n }\n}\n\nfunction isAbortError(error: unknown): boolean {\n return error instanceof Error && error.name === 'AbortError'\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link DeleteResult.files}. */\nexport interface DeletedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** True for dry-run previews; the file was not actually deleted. */\n skipped: boolean\n}\n\n/** Result of {@link deleteCommand}. */\nexport interface DeleteResult {\n /** One entry per matched file version (including hide markers). */\n files: DeletedFile[]\n /** Count of individual-file delete failures (non-fatal; sums into the dispatcher's `core.setFailed`). */\n errors: number\n}\n\n/**\n * Delete files from B2.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and delete every version\n * matching it.\n * - Otherwise delete the single file by name. We look up the latest version\n * via `listFileNames` to get its `fileId` and call `deleteFileVersion`.\n *\n * With `dry-run: true`, no actual deletions happen; the action reports what\n * would have been deleted.\n */\nexport async function deleteCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'delete', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n if (isPrefix) {\n return deletePrefix(bucket, source, inputs.dryRun, inputs.bypassGovernance, signal)\n }\n return deleteOne(bucket, source, inputs.dryRun, inputs.bypassGovernance)\n}\n\nasync function deletePrefix(\n bucket: Bucket,\n prefix: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n signal?: AbortSignal,\n): Promise {\n const files: DeletedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} prefix b2://${bucket.name}/${prefix}`)\n try {\n for await (const event of deleteAllVersions(bucket, {\n prefix,\n dryRun,\n bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n })) {\n if (event.type === 'delete') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: false })\n core.info(` deleted ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: true })\n core.info(` would delete ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to delete ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n\nasync function deleteOne(\n bucket: Bucket,\n fileName: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n): Promise {\n const hit = await findFileByName(bucket, fileName)\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} b2://${bucket.name}/${fileName}`)\n try {\n if (dryRun) {\n core.info(` would delete ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: true }],\n errors: 0,\n }\n }\n if (bypassGovernance) {\n await bucket.deleteFileVersion(fileName, hit.fileId, { bypassGovernance: true })\n } else {\n await bucket.deleteFileVersion(fileName, hit.fileId)\n }\n core.info(` deleted ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: false }],\n errors: 0,\n }\n } finally {\n core.endGroup()\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream/promises\");","import type { DownloadCallOptions } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from './inputs.ts'\n\nexport type DownloadHeaderOverrides = Pick<\n DownloadCallOptions,\n 'b2CacheControl' | 'b2ContentDisposition' | 'b2ContentType'\n>\n\nconst DOWNLOAD_OVERRIDE_QUERY_PARAMS = {\n b2ContentDisposition: 'b2ContentDisposition',\n b2ContentType: 'b2ContentType',\n b2CacheControl: 'b2CacheControl',\n} as const satisfies Record\n\nexport function downloadHeaderOverridesFromInputs(inputs: ParsedInputs): DownloadHeaderOverrides {\n return {\n ...(inputs.contentDisposition !== undefined\n ? { b2ContentDisposition: inputs.contentDisposition }\n : {}),\n ...(inputs.responseContentType !== undefined\n ? { b2ContentType: inputs.responseContentType }\n : {}),\n ...(inputs.cacheControl !== undefined ? { b2CacheControl: inputs.cacheControl } : {}),\n }\n}\n\nexport function appendDownloadHeaderOverrides(\n url: string,\n overrides: DownloadHeaderOverrides,\n): string {\n const entries = Object.entries(DOWNLOAD_OVERRIDE_QUERY_PARAMS) as Array<\n [keyof DownloadHeaderOverrides, string]\n >\n if (entries.every(([key]) => overrides[key] === undefined)) return url\n\n const parsed = new URL(url)\n for (const [key, param] of entries) {\n const value = overrides[key]\n if (value !== undefined) {\n parsed.searchParams.set(param, value)\n }\n }\n return parsed.toString()\n}\n","import type { Stats } from 'node:fs'\nimport { stat } from 'node:fs/promises'\n\n/**\n * `stat(path)` that returns `undefined` instead of throwing on ENOENT/EACCES\n * etc. Used at filesystem boundaries where the caller wants to distinguish\n * \"doesn't exist / not readable\" from \"exists with shape X\" without juggling\n * try/catch at every call site.\n */\nexport async function tryStat(path: string): Promise {\n return stat(path).catch(() => undefined)\n}\n","/**\n * Format a byte count with KB/MB/GB suffixes.\n *\n * Single source of truth so the workflow log (progress.ts) and the step\n * summary table (summary.ts) never drift on thresholds or rounding.\n */\nexport function formatBytes(n: number): string {\n if (n < 1024) return `${n} B`\n if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`\n if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`\n return `${(n / 1024 / 1024 / 1024).toFixed(2)} GB`\n}\n","import * as core from '@actions/core'\nimport type { ProgressEvent, ProgressListener } from '@backblaze-labs/b2-sdk'\nimport { formatBytes } from './format.ts'\n\n/**\n * Build a progress listener that throttles output to one update per\n * `intervalMs` (default 1s) so a long-running upload doesn't flood the\n * workflow log with thousands of lines. The first event and the final\n * event are always emitted.\n */\nexport function makeProgressListener(label: string, intervalMs = 1000): ProgressListener {\n let lastEmit = 0\n let lastBytes = 0\n let lastTime = Date.now()\n\n return (event: ProgressEvent) => {\n const now = Date.now()\n const isFirst = lastEmit === 0\n const isFinal = event.totalBytes !== null && event.bytesTransferred >= event.totalBytes\n const due = now - lastEmit >= intervalMs\n\n if (!isFirst && !isFinal && !due) return\n\n const elapsedMs = Math.max(1, now - lastTime)\n const deltaBytes = event.bytesTransferred - lastBytes\n const mbps = (deltaBytes / 1024 / 1024) * (1000 / elapsedMs)\n\n const pct =\n event.totalBytes !== null && event.totalBytes > 0\n ? `${Math.round((event.bytesTransferred / event.totalBytes) * 100)}%`\n : '?%'\n\n const parts =\n event.totalParts !== null ? ` (${event.partsCompleted}/${event.totalParts} parts)` : ''\n\n const totalSuffix = event.totalBytes !== null ? ` / ${formatBytes(event.totalBytes)}` : ''\n core.info(\n `${label} ${pct}${parts} ${formatBytes(event.bytesTransferred)}${totalSuffix} @ ${mbps.toFixed(2)} MB/s`,\n )\n\n lastEmit = now\n lastBytes = event.bytesTransferred\n lastTime = now\n }\n}\n","import { randomUUID } from 'node:crypto'\nimport { createWriteStream } from 'node:fs'\nimport { mkdir, realpath, rename, unlink, writeFile } from 'node:fs/promises'\nimport { dirname, isAbsolute, relative, resolve, sep } from 'node:path'\nimport { Readable, Transform } from 'node:stream'\nimport { pipeline } from 'node:stream/promises'\nimport * as core from '@actions/core'\nimport type { Bucket, SseCDownloadKey } from '@backblaze-labs/b2-sdk'\nimport {\n type DownloadHeaderOverrides,\n downloadHeaderOverridesFromInputs,\n} from '../download-overrides.ts'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link DownloadResult.files}. */\nexport interface DownloadedFile {\n /** B2 file name (the key that was fetched). */\n fileName: string\n /** Absolute path on the runner where the body landed. */\n localPath: string\n /** Byte size of the downloaded body. */\n size: number\n /** Remote SHA-1, or `null` if the file was multipart-uploaded (B2 doesn't store a whole-file SHA-1 in that case). */\n contentSha1: string | null\n}\n\n/** Result of {@link downloadCommand}. */\nexport interface DownloadResult {\n /** One entry per downloaded file. Single-file modes return a one-element array. */\n files: DownloadedFile[]\n /** Total bytes transferred across all files. */\n bytesTransferred: number\n}\n\ninterface PathSafetyContext {\n realRoot: string\n safeAncestorDirs: Set\n}\n\ninterface DownloadPathSafety {\n root: string\n realRoot: string\n}\n\ninterface PlannedDownload {\n fileName: string\n localPath: string\n}\n\ninterface LocalPathOwner {\n fileName: string\n localPath: string\n}\n\ninterface ReplaceDownloadedFileOptions {\n platform?: NodeJS.Platform\n renameFile?: typeof rename\n unlinkFile?: typeof unlink\n}\n\n/**\n * Download from B2 to the local runner.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and download every file\n * under it to the local directory at `destination` (defaults to `.`).\n * - Otherwise download a single file. If `destination` ends with `/` or\n * resolves to an existing directory, write into that directory using the\n * basename of `source`. Else `destination` is the exact output file path.\n * If unset, the file's basename is used in the current working directory.\n */\nexport async function downloadCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'download', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n const sseDownload = sseFromInputs(inputs)\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n\n if (isPrefix) {\n return downloadPrefix(\n bucket,\n source,\n inputs.destination ?? '.',\n sseDownload,\n downloadOverrides,\n signal,\n )\n }\n const out = await downloadOne(\n bucket,\n source,\n inputs.destination,\n sseDownload,\n downloadOverrides,\n signal,\n )\n return { files: [out], bytesTransferred: out.size }\n}\n\nfunction sseFromInputs(inputs: ParsedInputs): SseCDownloadKey | undefined {\n const e = inputs.encryption\n if (e === undefined || e.mode !== 'SSE-C') return undefined\n return {\n algorithm: 'AES256',\n customerKey: e.customerKey,\n customerKeyMd5: e.customerKeyMd5,\n }\n}\n\nasync function downloadPrefix(\n bucket: Bucket,\n prefix: string,\n destinationDir: string,\n sseDownload: SseCDownloadKey | undefined,\n downloadOverrides: DownloadHeaderOverrides,\n signal?: AbortSignal,\n): Promise {\n const destRoot = resolve(destinationDir)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n const downloadPathSafety = { root: destRoot, realRoot: pathSafety.realRoot }\n const caseInsensitivePaths = await isCaseInsensitiveDirectory(destRoot)\n\n const planned: PlannedDownload[] = []\n const localPathOwners = new Map()\n const localPathAncestorOwners = new Map()\n let startFileName: string | undefined\n\n for (;;) {\n signal?.throwIfAborted()\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n signal?.throwIfAborted()\n // `listFileNames({ prefix })` returns files matching `prefix` per the\n // SDK / B2 contract, so the slice is always safe. Empty `prefix`\n // leaves the name unchanged.\n const relName = f.fileName.slice(prefix.length)\n const localPath = await resolvePathUnderRoot(\n destRoot,\n safeRemotePathSegments(relName, f.fileName),\n f.fileName,\n pathSafety,\n )\n recordPlannedLocalPath(\n { fileName: f.fileName, localPath },\n destRoot,\n caseInsensitivePaths,\n localPathOwners,\n localPathAncestorOwners,\n )\n planned.push({ fileName: f.fileName, localPath })\n }\n // SDK contract: `nextFileName` is `string | null` per `ListFileNamesResponse`.\n // The \"not null\" arm fires for prefixes with >1000 files (covered by\n // the real-pagination test in coverage-stress).\n if (page.nextFileName === null) break\n startFileName = page.nextFileName\n }\n\n const files: DownloadedFile[] = []\n let total = 0\n for (const plan of planned) {\n signal?.throwIfAborted()\n core.startGroup(`download b2://${bucket.name}/${plan.fileName} → ${plan.localPath}`)\n try {\n const r = await downloadOne(\n bucket,\n plan.fileName,\n plan.localPath,\n sseDownload,\n downloadOverrides,\n signal,\n downloadPathSafety,\n )\n files.push(r)\n total += r.size\n } finally {\n core.endGroup()\n }\n }\n\n return { files, bytesTransferred: total }\n}\n\nasync function downloadOne(\n bucket: Bucket,\n fileName: string,\n destination: string | undefined,\n sseDownload: SseCDownloadKey | undefined,\n downloadOverrides: DownloadHeaderOverrides,\n signal?: AbortSignal,\n pathSafety?: DownloadPathSafety,\n): Promise {\n const localPath =\n pathSafety !== undefined && destination !== undefined\n ? resolve(destination)\n : await resolveLocalPath(fileName, destination)\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n await mkdir(dirname(localPath), { recursive: true })\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n\n const result = await bucket.download(fileName, {\n ...(sseDownload !== undefined ? { serverSideEncryption: sseDownload } : {}),\n ...downloadOverrides,\n ...(signal !== undefined ? { signal } : {}),\n })\n const size = result.headers.contentLength\n const sha1 = result.headers.contentSha1\n\n // Wrap the body in a byte-counting Transform that synthesizes ProgressEvents\n // for the shared progress listener. The SDK doesn't expose progress for\n // single-shot downloads; we compute it here from the known content-length.\n const onProgress = makeProgressListener(`download[${fileName}]`)\n const startedAt = Date.now()\n let bytesSeen = 0\n const counter = new Transform({\n transform(chunk: Buffer, _enc, cb) {\n // The transform only runs when the body has bytes to push; for a zero-\n // length response Node's stream pipeline closes without invoking it,\n // so `size` is provably > 0 here.\n bytesSeen += chunk.length\n onProgress({\n bytesTransferred: bytesSeen,\n totalBytes: size,\n partsCompleted: 0,\n totalParts: null,\n elapsedMs: Date.now() - startedAt,\n })\n cb(null, chunk)\n },\n })\n\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n const tempPath = `${localPath}.b2-action-download-${randomUUID()}.tmp`\n const writeStream = createWriteStream(tempPath, { flags: 'wx' })\n try {\n await pipeline(\n Readable.fromWeb(result.body as unknown as Parameters[0]),\n counter,\n writeStream,\n )\n await replaceDownloadedFile(tempPath, localPath)\n } catch (err) {\n // Partial download on disk is worse than no file. Write through a\n // same-directory temporary file and rename only after the body completes,\n // which also avoids following an existing symlink at the final leaf.\n try {\n await unlink(tempPath)\n } catch {\n // ignore: best-effort cleanup, the original error matters more\n }\n throw err\n }\n\n core.info(` wrote ${size} bytes to ${localPath} (sha1=${sha1 ?? 'multipart'})`)\n\n return { fileName, localPath, size, contentSha1: sha1 }\n}\n\n/**\n * Atomically move a completed same-directory download into place.\n *\n * @internal\n */\nexport async function replaceDownloadedFile(\n tempPath: string,\n localPath: string,\n {\n platform = process.platform,\n renameFile = rename,\n unlinkFile = unlink,\n }: ReplaceDownloadedFileOptions = {},\n): Promise {\n try {\n await renameFile(tempPath, localPath)\n } catch (renameError) {\n const retryWindowsOverwrite =\n platform === 'win32' &&\n typeof renameError === 'object' &&\n renameError !== null &&\n 'code' in renameError &&\n (renameError.code === 'EEXIST' || renameError.code === 'EPERM')\n if (!retryWindowsOverwrite) throw renameError\n\n // Windows refuses to rename over an existing leaf. Remove only the leaf\n // path, which unlinks symlinks instead of following them, then retry the\n // completed same-directory temp-file move.\n try {\n await unlinkFile(localPath)\n } catch (unlinkError) {\n if (!isFileNotFound(unlinkError)) throw unlinkError\n }\n await renameFile(tempPath, localPath)\n }\n}\n\n/**\n * Resolve the local target path for a single B2 download.\n *\n * @internal\n */\nexport async function resolveLocalPath(\n fileName: string,\n destination: string | undefined,\n): Promise {\n if (destination === undefined || destination === '') {\n return resolve(safeRemotePathTail(fileName))\n }\n if (destination.endsWith('/') || destination.endsWith('\\\\')) {\n const destRoot = resolve(destination)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n const s = await tryStat(destination)\n if (s?.isDirectory()) {\n const destRoot = resolve(destination)\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n return resolve(destination)\n}\n\nasync function resolvePathUnderRoot(\n root: string,\n segments: string[],\n fileName: string,\n pathSafety: PathSafetyContext,\n) {\n const localPath = resolve(root, ...segments)\n const rel = relative(root, localPath)\n if (!isPathInsideRootRelative(rel)) {\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n }\n await assertExistingAncestryInsideRoot(pathSafety, localPath, fileName)\n return localPath\n}\n\nfunction isPathInsideRootRelative(rel: string): boolean {\n return rel === '' || (!isAbsolute(rel) && rel !== '..' && !rel.startsWith(`..${sep}`))\n}\n\nasync function createPathSafetyContext(root: string): Promise {\n return { realRoot: await realpath(root), safeAncestorDirs: new Set([root]) }\n}\n\nasync function assertFreshAncestryInsideRoot(\n pathSafety: DownloadPathSafety,\n localPath: string,\n fileName: string,\n): Promise {\n await assertExistingAncestryInsideRoot(\n { realRoot: pathSafety.realRoot, safeAncestorDirs: new Set() },\n localPath,\n fileName,\n )\n}\n\nasync function assertExistingAncestryInsideRoot(\n pathSafety: PathSafetyContext,\n localPath: string,\n fileName: string,\n): Promise {\n let candidate = dirname(localPath)\n const checkedDirs: string[] = []\n\n for (;;) {\n if (pathSafety.safeAncestorDirs.has(candidate)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n checkedDirs.push(candidate)\n try {\n const realCandidate = await realpath(candidate)\n const rel = relative(pathSafety.realRoot, realCandidate)\n if (isPathInsideRootRelative(rel)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n } catch (error) {\n if (!isFileNotFound(error)) throw error\n const parent = dirname(candidate)\n if (parent === candidate) throw error\n candidate = parent\n }\n }\n}\n\nfunction isFileNotFound(error: unknown): boolean {\n return typeof error === 'object' && error !== null && 'code' in error && error.code === 'ENOENT'\n}\n\nasync function isCaseInsensitiveDirectory(dir: string): Promise {\n const marker = `.b2-action-case-check-${randomUUID()}`\n const lowerPath = resolve(dir, marker.toLowerCase())\n const upperPath = resolve(dir, marker.toUpperCase())\n\n try {\n await writeFile(lowerPath, '')\n } catch (error) {\n core.warning(\n `Could not probe case sensitivity in ${dir}; treating download collision checks as case-sensitive (${error instanceof Error ? error.message : String(error)})`,\n )\n return false\n }\n try {\n try {\n return (await realpath(lowerPath)) === (await realpath(upperPath))\n } catch (error) {\n if (isFileNotFound(error)) return false\n throw error\n }\n } finally {\n try {\n await unlink(lowerPath)\n } catch (error) {\n core.warning(\n `Could not remove B2 action case-sensitivity probe ${lowerPath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n}\n\nfunction localPathCollisionKey(localPath: string, caseInsensitivePaths: boolean): string {\n return caseInsensitivePaths ? localPath.toLowerCase() : localPath\n}\n\nfunction recordPlannedLocalPath(\n owner: LocalPathOwner,\n root: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n localPathAncestorOwners: Map,\n): void {\n const collisionKey = localPathCollisionKey(owner.localPath, caseInsensitivePaths)\n const existingFile = localPathOwners.get(collisionKey)\n if (existingFile !== undefined && existingFile.fileName !== owner.fileName) {\n throw new Error(\n `download path collision: B2 files \"${existingFile.fileName}\" and \"${owner.fileName}\" both map to \"${owner.localPath}\"`,\n )\n }\n\n const existingDescendant = localPathAncestorOwners.get(collisionKey)\n if (existingDescendant !== undefined && existingDescendant.fileName !== owner.fileName) {\n throwFileDirectoryCollision(owner, existingDescendant)\n }\n\n const existingAncestor = findLocalPathFileAncestor(\n root,\n owner.localPath,\n caseInsensitivePaths,\n localPathOwners,\n )\n if (existingAncestor !== undefined && existingAncestor.fileName !== owner.fileName) {\n throwFileDirectoryCollision(existingAncestor, owner)\n }\n\n localPathOwners.set(collisionKey, owner)\n rememberLocalPathAncestors(root, owner, caseInsensitivePaths, localPathAncestorOwners)\n}\n\nfunction findLocalPathFileAncestor(\n root: string,\n localPath: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n): LocalPathOwner | undefined {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return undefined\n const owner = localPathOwners.get(parentKey)\n if (owner !== undefined) return owner\n const next = dirname(parent)\n if (next === parent) return undefined\n parent = next\n }\n}\n\nfunction rememberLocalPathAncestors(\n root: string,\n owner: LocalPathOwner,\n caseInsensitivePaths: boolean,\n localPathAncestorOwners: Map,\n): void {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(owner.localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return\n if (!localPathAncestorOwners.has(parentKey)) localPathAncestorOwners.set(parentKey, owner)\n const next = dirname(parent)\n if (next === parent) return\n parent = next\n }\n}\n\nfunction throwFileDirectoryCollision(\n fileOwner: LocalPathOwner,\n descendantOwner: LocalPathOwner,\n): never {\n throw new Error(\n `download path collision: B2 file \"${fileOwner.fileName}\" maps to \"${fileOwner.localPath}\", which must be a file, but B2 file \"${descendantOwner.fileName}\" maps beneath it at \"${descendantOwner.localPath}\"`,\n )\n}\n\nfunction safeRemotePathSegments(fileName: string, displayName = fileName): string[] {\n const segments = fileName.split('/')\n for (const segment of segments) {\n validateRemotePathSegment(segment, displayName)\n }\n return segments\n}\n\nfunction safeRemotePathTail(fileName: string): string {\n const tail = fileName.split('/').at(-1) ?? ''\n validateRemotePathSegment(tail, fileName)\n return tail\n}\n\nfunction validateRemotePathSegment(segment: string, fileName: string): void {\n if (segment === '' || segment === '.' || segment === '..') {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains an empty, \".\" or \"..\" path segment`,\n )\n }\n for (const char of segment) {\n const codePoint = char.codePointAt(0)\n if (codePoint !== undefined && (codePoint <= 0x1f || codePoint === 0x7f)) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains a control character`,\n )\n }\n }\n\n // B2 keys are opaque, but prefix downloads must project `/`-separated\n // keys into the runner filesystem without path traversal or lossy rewrites.\n // POSIX runners can preserve characters such as `:`, `?`, trailing dots,\n // and Windows device names verbatim. Windows treats several of those as\n // separators or invalid/reserved filenames, so reject them there instead of\n // silently changing the on-disk name or risking two B2 keys overwriting one\n // local path.\n if (\n process.platform === 'win32' &&\n (/[<>:\"|?*\\\\]/u.test(segment) ||\n /[. ]$/u.test(segment) ||\n /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/iu.test(segment))\n ) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped on Windows because segment \"${segment}\" is reserved or contains a Windows path character`,\n )\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link headCommand}: metadata read from a HEAD request, no body. */\nexport interface HeadResult {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file (from `Content-Length`). */\n size: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** B2-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Custom `X-Bz-Info-*` headers attached at upload time. */\n fileInfo: Record\n}\n\n/**\n * HEAD-only metadata probe. Fetches the headers of an object without\n * downloading the body. Useful for cheap \"does this exist and what's its\n * size / sha1 / contentType?\" checks, or to inspect custom `fileInfo`\n * metadata that the uploader attached.\n *\n * Returns all output fields as step outputs so downstream steps can branch\n * on them.\n */\nexport async function headCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'head', 'the B2 file name')\n\n core.startGroup(`head b2://${bucket.name}/${source}`)\n try {\n // `bucket.head` returns only the parsed response headers; no body to\n // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n const { headers: h } = await bucket.head(source)\n core.info(\n ` size=${h.contentLength} type=${h.contentType} sha1=${h.contentSha1 ?? 'multipart'}`,\n )\n return {\n fileName: h.fileName,\n fileId: h.fileId,\n size: h.contentLength,\n contentType: h.contentType,\n contentSha1: h.contentSha1,\n uploadTimestamp: h.uploadTimestamp,\n fileInfo: h.fileInfo,\n }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link hideCommand}: identifies the hide marker that was just created. */\nexport interface HideResult {\n /** B2 file name that was hidden. */\n fileName: string\n /** File ID of the hide marker (a special version with `action: 'hide'`). */\n fileId: string\n}\n\n/**\n * Hide a file in B2 (creates a \"hide marker\" file version that masks the\n * previous version from `listFileNames` and downloads-by-name).\n *\n * Versioning is always on in B2, so hide is a soft-delete: the underlying\n * data and prior versions remain until lifecycle rules collect them. To\n * permanently delete, use the `delete` command.\n *\n * To unhide, run `delete` against the hide marker's `fileId` (use `list`\n * with versions if you need to discover it).\n */\nexport async function hideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'hide', 'the B2 file name')\n\n core.startGroup(`hide b2://${bucket.name}/${source}`)\n try {\n const result = await bucket.hideFile(source)\n core.info(` hidden: ${result.fileName} (marker fileId=${result.fileId})`)\n return { fileName: result.fileName, fileId: result.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\n\n/** One entry in {@link ListResult.files}. Mirrors the SDK's per-version metadata. */\nexport interface ListedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file. */\n size: number\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** Server-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Custom `X-Bz-Info-*` headers from upload time. */\n fileInfo: Record\n}\n\n/** Result of {@link listCommand}. */\nexport interface ListResult {\n /** Files matching the prefix, capped by `maxResults`. */\n files: ListedFile[]\n /** True when more visible upload files exist beyond `maxResults`. Use to detect pagination. */\n truncated: boolean\n}\n\n/**\n * List file names under a prefix.\n *\n * `source` is the prefix (use trailing `/` to list a \"directory\"). Empty\n * `source` lists everything the application key is allowed to see. Pagination\n * is followed transparently up to `max-results` matches.\n *\n * Useful for \"decide what to do next\" workflow steps:\n * - inventory before a delete\n * - find the most recent release artifact to promote\n * - emit a JSON manifest as a build output\n */\nexport async function listCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const prefix = inputs.source ?? ''\n const maxResults = inputs.maxResults\n const files: ListedFile[] = []\n let startFileName: string | undefined\n\n core.startGroup(`list b2://${bucket.name}/${prefix} (max ${maxResults})`)\n try {\n while (files.length < maxResults) {\n const remaining = maxResults - files.length\n const pageSize = Math.min(1000, remaining)\n const page = await bucket.listFileNames({\n prefix,\n pageSize,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n files.push({\n fileName: f.fileName,\n fileId: f.fileId,\n size: f.contentLength,\n contentSha1: f.contentSha1,\n uploadTimestamp: f.uploadTimestamp,\n contentType: f.contentType,\n fileInfo: f.fileInfo,\n })\n if (files.length >= maxResults) {\n if (!page.nextFileName) return { files, truncated: false }\n return {\n files,\n truncated: await hasVisibleUploadAfter(bucket, prefix, page.nextFileName),\n }\n }\n }\n\n if (!page.nextFileName) {\n return { files, truncated: false }\n }\n startFileName = page.nextFileName\n }\n\n return { files, truncated: true }\n } finally {\n core.info(` ${files.length} file(s) listed`)\n core.endGroup()\n }\n}\n\nasync function hasVisibleUploadAfter(\n bucket: Bucket,\n prefix: string,\n startFileName: string,\n): Promise {\n let cursor: string | undefined = startFileName\n\n while (cursor !== undefined) {\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n startFileName: cursor,\n })\n if (page.files.some((f) => f.action === 'upload')) return true\n cursor = page.nextFileName ?? undefined\n }\n\n return false\n}\n","function createS3ClientConfig(config) {\n const s3Url = config.accountInfo.getS3ApiUrl();\n const regionMatch = s3Url.match(/s3\\.([^.]+)\\.backblazeb2\\.com/);\n const region = config.region ?? regionMatch?.[1] ?? \"us-west-004\";\n return {\n endpoint: s3Url,\n region,\n credentials: {\n accessKeyId: config.applicationKeyId,\n secretAccessKey: config.applicationKey\n },\n forcePathStyle: true\n };\n}\nfunction presignGetObjectUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds = 3600) {\n const expires = Math.floor(Date.now() / 1e3) + validDurationInSeconds;\n return `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeURIComponent(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;\n}\nexport {\n createS3ClientConfig,\n presignGetObjectUrl\n};\n//# sourceMappingURL=index.js.map\n","import * as core from '@actions/core'\nimport type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'\nimport { presignGetObjectUrl } from '@backblaze-labs/b2-sdk/s3'\nimport {\n appendDownloadHeaderOverrides,\n type DownloadHeaderOverrides,\n downloadHeaderOverridesFromInputs,\n} from '../download-overrides.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** One entry in {@link PresignResult.files}. */\nexport interface PresignedFile {\n /** B2 file name (the key the URL grants access to). */\n fileName: string\n /** Presigned download URL. Masked via `core.setSecret` before this struct is logged. */\n url: string\n /** Expiration time as milliseconds since the epoch. */\n expiresAt: number\n}\n\n/** Result of {@link presignCommand}. */\nexport interface PresignResult {\n /** One entry per generated URL. Single-file mode returns a one-element array. */\n files: PresignedFile[]\n}\n\n/**\n * Generate a presigned download URL for one B2 file or every file under a\n * prefix.\n *\n * Modes:\n * - `source` ending in `/` → prefix mode. List the prefix and emit one\n * presigned URL per file (capped by `max-results`). All URLs share the\n * same `b2_get_download_authorization` token because the auth scope is\n * prefix-based; we just expand it into one URL per matched object.\n * - Otherwise → single-file mode (the original behavior).\n *\n * Every URL is masked via `core.setSecret` so subsequent log lines redact\n * them. The first URL is also exposed as the `presigned-url` step output\n * for the most common one-file workflow.\n */\nexport async function presignCommand(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'presign', 'the B2 file name or prefix')\n\n if (source.endsWith('/')) {\n return presignPrefix(client, bucket, inputs, source)\n }\n\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n return {\n files: [\n await presignOne(client, bucket, source, inputs.presignTtlSeconds, source, downloadOverrides),\n ],\n }\n}\n\nasync function presignPrefix(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n prefix: string,\n): Promise {\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n // One auth token covers the whole prefix (that's exactly what\n // `b2_get_download_authorization` is designed for).\n const auth = await client.raw.getDownloadAuthorization(\n client.accountInfo.getApiUrl(),\n client.accountInfo.getAuthToken(),\n {\n bucketId: bucket.id,\n fileNamePrefix: prefix,\n validDurationInSeconds: inputs.presignTtlSeconds,\n ...downloadOverrides,\n },\n )\n core.setSecret(auth.authorizationToken)\n const expiresAt = Math.floor(Date.now() / 1000) + inputs.presignTtlSeconds\n\n const files: PresignedFile[] = []\n let startFileName: string | undefined\n core.startGroup(`presign prefix b2://${bucket.name}/${prefix} (TTL ${inputs.presignTtlSeconds}s)`)\n try {\n while (files.length < inputs.maxResults) {\n const remaining = inputs.maxResults - files.length\n const page = await bucket.listFileNames({\n prefix,\n pageSize: Math.min(1000, remaining),\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n const url = appendDownloadHeaderOverrides(\n presignGetObjectUrl(\n downloadUrl,\n bucket.name,\n f.fileName,\n auth.authorizationToken,\n inputs.presignTtlSeconds,\n ),\n downloadOverrides,\n )\n core.setSecret(url)\n files.push({ fileName: f.fileName, url, expiresAt })\n if (files.length >= inputs.maxResults) break\n }\n if (!page.nextFileName) break\n startFileName = page.nextFileName\n }\n } finally {\n core.info(` generated ${files.length} presigned URL(s)`)\n core.endGroup()\n }\n return { files }\n}\n\nasync function presignOne(\n client: B2Client,\n bucket: Bucket,\n fileName: string,\n ttlSeconds: number,\n authPrefix: string,\n downloadOverrides: DownloadHeaderOverrides,\n): Promise {\n const auth = await client.raw.getDownloadAuthorization(\n client.accountInfo.getApiUrl(),\n client.accountInfo.getAuthToken(),\n {\n bucketId: bucket.id,\n fileNamePrefix: authPrefix,\n validDurationInSeconds: ttlSeconds,\n ...downloadOverrides,\n },\n )\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const url = appendDownloadHeaderOverrides(\n presignGetObjectUrl(downloadUrl, bucket.name, fileName, auth.authorizationToken, ttlSeconds),\n downloadOverrides,\n )\n core.setSecret(auth.authorizationToken)\n core.setSecret(url)\n const expiresAt = Math.floor(Date.now() / 1000) + ttlSeconds\n core.info(`presigned URL for ${fileName} valid for ${ttlSeconds}s (expires at ${expiresAt})`)\n return { fileName, url, expiresAt }\n}\n","import * as core from '@actions/core'\nimport type { Bucket, FileAction } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link PurgeResult.files}. */\nexport interface PurgedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID of the version that was purged. */\n fileId: string\n /** Which kind of version this entry refers to, or `skip` for dry-run previews. */\n action: FileAction | 'skip'\n /** True for dry-run previews; the version was not actually purged. */\n skipped: boolean\n}\n\n/** Result of {@link purgeCommand}. */\nexport interface PurgeResult {\n /** One entry per matched version (live, prior, and hide markers). */\n files: PurgedFile[]\n /** Count of individual-version purge failures. */\n errors: number\n}\n\n/**\n * Permanently delete every file version (including hide markers and historic\n * uploads) under a prefix. Differs from `delete` in that `delete`'s\n * implementation streams over `listFileVersions` and removes all versions,\n * but `purge` makes the wipe-the-prefix intent explicit and warns loudly.\n *\n * If `source` is empty or `/`, this purges the **entire bucket** only when\n * `allow-bucket-purge: true` is also set. Default behavior is to require a\n * scoped prefix so an omitted source cannot become a bucket-wide wipe.\n *\n * Supports `dry-run` to preview what would be deleted.\n */\nexport async function purgeCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const bucketWide = inputs.source === undefined || inputs.source === '' || inputs.source === '/'\n if (bucketWide && !inputs.allowBucketPurge) {\n throw new Error(\n \"'allow-bucket-purge' must be true for whole-bucket purge (set 'source' to a prefix for scoped purge)\",\n )\n }\n const source = inputs.source ?? ''\n const prefix = bucketWide ? '' : source.endsWith('/') ? source : `${source}/`\n const dryRun = inputs.dryRun\n\n if (prefix === '' && !dryRun) {\n core.warning(\n `purge will permanently delete EVERY version in bucket \"${bucket.name}\". Continuing because allow-bucket-purge is true.`,\n )\n }\n\n const files: PurgedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'purge'} b2://${bucket.name}/${prefix} (all versions)`)\n try {\n const opts = {\n ...(prefix !== '' ? { prefix } : {}),\n dryRun,\n bypassGovernance: inputs.bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n }\n for await (const event of deleteAllVersions(bucket, opts)) {\n if (event.type === 'delete') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: event.action,\n skipped: false,\n })\n core.info(` purged ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: 'skip',\n skipped: true,\n })\n core.info(` would purge ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to purge ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link retentionCommand}: describes what was applied to the target version. */\nexport interface RetentionResult {\n /** B2 file name the retention/hold was applied to. */\n fileName: string\n /** B2 file ID of the version that was modified. */\n fileId: string\n /** Retention mode after the call. `none` means retention was cleared. Undefined if only legal-hold was touched. */\n appliedMode: 'compliance' | 'governance' | 'none' | undefined\n /** Retention expiration timestamp (ms since the epoch). `null` when mode is `none`. */\n retainUntilTimestamp: number | null | undefined\n /** Legal-hold state after the call. Undefined when not touched by this invocation. */\n appliedLegalHold: 'on' | 'off' | undefined\n}\n\n/**\n * Apply Object Lock retention settings and/or a legal hold to a specific\n * file version.\n *\n * The bucket must have Object Lock enabled. Three inputs drive this command:\n * - `retention-mode`: `compliance` | `governance` | `none`. Required if\n * `retention-until` is set.\n * - `retention-until`: ISO 8601 timestamp (e.g. `2027-01-01T00:00:00Z`).\n * Required if `retention-mode` is `compliance` or `governance`.\n * - `legal-hold`: `on` | `off`. Independent of retention; can be set on\n * its own or alongside retention.\n * - `bypass-governance` (bool): allows shortening a governance retention.\n *\n * At least one of `retention-mode` / `legal-hold` must be supplied.\n *\n * The target file version is resolved by exact name only when the latest\n * version is an upload.\n */\nexport async function retentionCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'retention', 'the B2 file name')\n\n const mode = inputs.retentionMode\n const until = inputs.retentionUntil\n const legalHold = inputs.legalHold\n\n if (mode === undefined && legalHold === undefined) {\n throw new Error(\"retention requires at least one of 'retention-mode' or 'legal-hold' to be set\")\n }\n\n // Resolve the retention expiration up front so TypeScript narrows `until`\n // inside the parse branch and the downstream call site doesn't need a cast.\n let retainUntilMillis: number | null = null\n if (mode === 'compliance' || mode === 'governance') {\n if (until === undefined) {\n throw new Error(\n `'retention-until' (ISO 8601 timestamp) is required when 'retention-mode' is '${mode}'`,\n )\n }\n const parsed = Date.parse(until)\n if (Number.isNaN(parsed)) {\n throw new Error(`'retention-until' is not a valid ISO 8601 timestamp: \"${until}\"`)\n }\n // Reject past timestamps client-side. B2 also rejects them server-side\n // but with a generic 400; the action's check fails faster and tells the\n // user exactly what's wrong (especially helpful for timezone-skewed CI\n // runners). Allow a small clock-skew tolerance: anything within the\n // last 30 seconds is treated as \"now\" rather than past.\n const skewToleranceMs = 30_000\n if (parsed < Date.now() - skewToleranceMs) {\n throw new Error(\n `'retention-until' must be in the future; got \"${until}\" (${new Date(parsed).toISOString()})`,\n )\n }\n retainUntilMillis = parsed\n }\n\n // Resolve the file version we're operating on.\n const hit = await findFileByName(bucket, source)\n\n let appliedMode: RetentionResult['appliedMode']\n let retainUntilTimestamp: number | null | undefined\n let appliedLegalHold: RetentionResult['appliedLegalHold']\n\n core.startGroup(`retention b2://${bucket.name}/${source}`)\n try {\n if (mode !== undefined) {\n const retention = {\n mode: mode === 'none' ? null : mode,\n retainUntilTimestamp: retainUntilMillis,\n }\n const result = inputs.bypassGovernance\n ? await bucket.updateFileRetention(source, hit.fileId, retention, {\n bypassGovernance: true,\n })\n : await bucket.updateFileRetention(source, hit.fileId, retention)\n appliedMode = mode\n retainUntilTimestamp = result.fileRetention.retainUntilTimestamp\n core.info(` retention: mode=${mode} retainUntil=${retainUntilMillis}`)\n }\n\n if (legalHold !== undefined) {\n const result = await bucket.updateFileLegalHold(source, hit.fileId, legalHold)\n appliedLegalHold = result.legalHold\n core.info(` legal-hold: ${result.legalHold}`)\n }\n\n return {\n fileName: source,\n fileId: hit.fileId,\n appliedMode,\n retainUntilTimestamp,\n appliedLegalHold,\n }\n } finally {\n core.endGroup()\n }\n}\n","import { collectStream } from \"./collect.js\";\nclass BlobSource {\n /**\n * Create a BlobSource wrapping the given Blob.\n * @param blob - The Blob or File to use as the underlying content.\n */\n constructor(blob) {\n this.blob = blob;\n this.size = blob.size;\n }\n /** {@inheritDoc} */\n size;\n /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */\n canSlice = true;\n /**\n * Return a new BlobSource covering the specified byte range.\n * @param start - The zero-based byte offset to begin the slice.\n * @param end - The exclusive byte offset where the slice ends.\n *\n * @returns A new ContentSource representing the requested sub-range.\n */\n slice(start, end) {\n return new BlobSource(this.blob.slice(start, end));\n }\n /**\n * Open the Blob content as a ReadableStream.\n * @returns A ReadableStream of the Blob bytes.\n */\n stream() {\n return this.blob.stream();\n }\n /**\n * Read the entire Blob content into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n toArrayBuffer() {\n return this.blob.arrayBuffer();\n }\n}\nclass BufferSource {\n /**\n * Create a BufferSource wrapping the given Uint8Array.\n * @param buffer - The byte buffer to use as the underlying content.\n */\n constructor(buffer) {\n this.buffer = buffer;\n this.size = buffer.byteLength;\n }\n /** {@inheritDoc} */\n size;\n /** Random-access: the entire payload lives in memory. */\n canSlice = true;\n /**\n * Return a new BufferSource covering the specified byte range.\n * @param start - The zero-based byte offset to begin the slice.\n * @param end - The exclusive byte offset where the slice ends.\n *\n * @returns A new ContentSource representing the requested sub-range.\n */\n slice(start, end) {\n return new BufferSource(this.buffer.slice(start, end));\n }\n /**\n * Open the buffer content as a ReadableStream.\n * @returns A ReadableStream that emits the buffer bytes in a single chunk.\n */\n stream() {\n const buffer = this.buffer;\n return new ReadableStream({\n start(controller) {\n controller.enqueue(buffer);\n controller.close();\n }\n });\n }\n /**\n * Read the entire buffer content into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n toArrayBuffer() {\n return Promise.resolve(\n this.buffer.buffer.slice(\n this.buffer.byteOffset,\n this.buffer.byteOffset + this.buffer.byteLength\n )\n );\n }\n}\nclass StreamSource {\n /**\n * Create a StreamSource wrapping the given ReadableStream with a known byte size.\n * @param readable - The ReadableStream to wrap as a content source.\n * @param size - The total number of bytes the stream will produce.\n */\n constructor(readable, size) {\n this.readable = readable;\n this.size = size;\n }\n /** {@inheritDoc} */\n size;\n /**\n * Forward-only: ReadableStreams cannot be repositioned, so multipart\n * uploads must take the sequential path. See the interface comment on\n * `canSlice` for what the engine does with this flag.\n */\n canSlice = false;\n /** Whether the stream has already been read. */\n consumed = false;\n /**\n * Always throws because streams cannot be sliced. Buffer the stream first.\n *\n * @throws If slicing is attempted on a stream-backed source.\n */\n slice() {\n throw new Error(\"StreamSource does not support slicing. Buffer the stream first.\");\n }\n /**\n * Open the underlying ReadableStream. Can only be called once.\n * @returns The underlying ReadableStream of bytes.\n *\n * @throws If the stream has already been consumed.\n */\n stream() {\n if (this.consumed) throw new Error(\"StreamSource can only be consumed once.\");\n this.consumed = true;\n return this.readable;\n }\n /**\n * Read the entire stream into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n async toArrayBuffer() {\n const bytes = await collectStream(this.stream());\n return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);\n }\n}\nfunction toContentSource(input, size) {\n if (input instanceof Uint8Array) {\n return new BufferSource(input);\n }\n if (input instanceof Blob) {\n return new BlobSource(input);\n }\n if (size === void 0) {\n throw new Error(\"size is required when using a ReadableStream as input.\");\n }\n return new StreamSource(input, size);\n}\nexport {\n BlobSource,\n BufferSource,\n StreamSource,\n toContentSource\n};\n//# sourceMappingURL=source.js.map\n","class UploadAction {\n /**\n * Creates a new UploadAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param absolutePath - Absolute local filesystem path.\n * @param size - File size in bytes.\n * @param doUpload - Callback that performs the actual upload.\n */\n constructor(relativePath, absolutePath, size, doUpload) {\n this.relativePath = relativePath;\n this.absolutePath = absolutePath;\n this.size = size;\n this.doUpload = doUpload;\n }\n type = \"upload\";\n /**\n * Uploads the file (unless dryRun) and returns an 'upload-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doUpload(this.absolutePath, this.relativePath);\n }\n return { type: \"upload-done\", path: this.relativePath, size: this.size };\n }\n}\nclass DownloadAction {\n /**\n * Creates a new DownloadAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param size - File size in bytes.\n * @param doDownload - Callback that performs the actual download.\n */\n constructor(relativePath, size, doDownload) {\n this.relativePath = relativePath;\n this.size = size;\n this.doDownload = doDownload;\n }\n type = \"download\";\n /**\n * Downloads the file (unless dryRun) and returns a 'download-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDownload(this.relativePath);\n }\n return { type: \"download-done\", path: this.relativePath, size: this.size };\n }\n}\nclass CopyAction {\n /**\n * Creates a new CopyAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param size - File size in bytes.\n * @param doCopy - Callback that performs the server-side copy.\n */\n constructor(relativePath, size, doCopy) {\n this.relativePath = relativePath;\n this.size = size;\n this.doCopy = doCopy;\n }\n type = \"copy\";\n /**\n * Copies the file (unless dryRun) and returns a 'copy-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doCopy(this.relativePath);\n }\n return { type: \"copy-done\", path: this.relativePath, size: this.size };\n }\n}\nclass HideAction {\n /**\n * Creates a new HideAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param doHide - Callback that creates the hide marker.\n */\n constructor(relativePath, doHide) {\n this.relativePath = relativePath;\n this.doHide = doHide;\n }\n type = \"hide\";\n size = 0;\n /**\n * Hides the file (unless dryRun) and returns a 'hide' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doHide(this.relativePath);\n }\n return { type: \"hide\", path: this.relativePath, size: 0 };\n }\n}\nclass DeleteRemoteAction {\n /**\n * Creates a new DeleteRemoteAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param fileId - The B2 file version ID to delete.\n * @param doDelete - Callback that performs the deletion.\n */\n constructor(relativePath, fileId, doDelete) {\n this.relativePath = relativePath;\n this.fileId = fileId;\n this.doDelete = doDelete;\n }\n type = \"delete-remote\";\n size = 0;\n /**\n * Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDelete(this.fileId, this.relativePath);\n }\n return { type: \"delete-remote\", path: this.relativePath, size: 0 };\n }\n}\nclass DeleteLocalAction {\n /**\n * Creates a new DeleteLocalAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param absolutePath - Absolute local filesystem path.\n * @param doDelete - Callback that performs the deletion.\n */\n constructor(relativePath, absolutePath, doDelete) {\n this.relativePath = relativePath;\n this.absolutePath = absolutePath;\n this.doDelete = doDelete;\n }\n type = \"delete-local\";\n size = 0;\n /**\n * Deletes the local file (unless dryRun) and returns a 'delete-local' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDelete(this.absolutePath);\n }\n return { type: \"delete-local\", path: this.relativePath, size: 0 };\n }\n}\nclass SkipAction {\n /**\n * Creates a new SkipAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param reason - Human-readable explanation for why the file was skipped.\n */\n constructor(relativePath, reason) {\n this.relativePath = relativePath;\n this.reason = reason;\n }\n type = \"skip\";\n size = 0;\n /**\n * Returns a 'skip' event with the reason message. No I/O is performed.\n * @param _dryRun - Whether to simulate the action (unused for no-op).\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(_dryRun) {\n return { type: \"skip\", path: this.relativePath, size: 0, message: this.reason };\n }\n}\nexport {\n CopyAction,\n DeleteLocalAction,\n DeleteRemoteAction,\n DownloadAction,\n HideAction,\n SkipAction,\n UploadAction\n};\n//# sourceMappingURL=index.js.map\n","async function* zipFolders(source, dest) {\n const sourceIter = source.scan()[Symbol.asyncIterator]();\n const destIter = dest.scan()[Symbol.asyncIterator]();\n let sourceResult = await sourceIter.next();\n let destResult = await destIter.next();\n while (!sourceResult.done || !destResult.done) {\n const s = sourceResult.done ? null : sourceResult.value;\n const d = destResult.done ? null : destResult.value;\n if (s === null) {\n yield [null, d];\n destResult = await destIter.next();\n } else if (d === null) {\n yield [s, null];\n sourceResult = await sourceIter.next();\n } else if (s.relativePath < d.relativePath) {\n yield [s, null];\n sourceResult = await sourceIter.next();\n } else if (d.relativePath < s.relativePath) {\n yield [null, d];\n destResult = await destIter.next();\n } else {\n yield [s, d];\n sourceResult = await sourceIter.next();\n destResult = await destIter.next();\n }\n }\n}\nexport {\n zipFolders\n};\n//# sourceMappingURL=pairing.js.map\n","function filesAreDifferent(source, dest, compareMode, threshold = 0) {\n switch (compareMode) {\n case \"none\":\n return false;\n case \"size\":\n return Math.abs(source.size - dest.size) > threshold;\n case \"modtime\":\n return Math.abs(source.modTimeMillis - dest.modTimeMillis) > threshold;\n }\n}\nexport {\n filesAreDifferent\n};\n//# sourceMappingURL=compare.js.map\n","import { SkipAction } from \"../actions/index.js\";\nimport { filesAreDifferent } from \"./compare.js\";\nfunction* generateActions(pair, direction, compareMode, keepMode, keepDays, nowMillis, factory, compareThreshold) {\n const [source, dest] = pair;\n if (source !== null && dest === null) {\n yield* actionsForSourceOnly(source, direction, factory);\n } else if (source === null && dest !== null) {\n yield* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory);\n } else if (source !== null && dest !== null) {\n yield* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory);\n }\n}\nfunction* actionsForSourceOnly(source, direction, factory) {\n switch (direction) {\n case \"local-to-b2\":\n yield factory.upload(source);\n break;\n case \"b2-to-local\":\n yield factory.download(source);\n break;\n case \"b2-to-b2\":\n yield factory.copy(source, source.relativePath);\n break;\n }\n}\nfunction* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory) {\n if (keepMode === \"no-delete\") {\n yield new SkipAction(dest.relativePath, \"not in source, keep-mode is no-delete\");\n return;\n }\n if (keepMode === \"keep-days\") {\n const ageMillis = nowMillis - dest.modTimeMillis;\n const ageDays = ageMillis / (24 * 60 * 60 * 1e3);\n if (ageDays < keepDays) {\n yield new SkipAction(\n dest.relativePath,\n `not in source, keeping for ${Math.ceil(keepDays - ageDays)} more days`\n );\n return;\n }\n }\n switch (direction) {\n case \"local-to-b2\":\n yield factory.removeOrphan(dest);\n break;\n case \"b2-to-local\":\n yield factory.deleteLocal(dest);\n break;\n case \"b2-to-b2\":\n yield factory.removeOrphan(dest);\n break;\n }\n}\nfunction* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory) {\n if (!filesAreDifferent(source, dest, compareMode, compareThreshold)) {\n yield new SkipAction(source.relativePath, \"files are the same\");\n return;\n }\n switch (direction) {\n case \"local-to-b2\":\n yield factory.upload(source);\n break;\n case \"b2-to-local\":\n yield factory.download(source);\n break;\n case \"b2-to-b2\":\n yield factory.copy(source, dest.relativePath);\n break;\n }\n}\nexport {\n generateActions\n};\n//# sourceMappingURL=index.js.map\n","import { BufferSource } from \"../streams/source.js\";\nimport { fileId } from \"../types/ids.js\";\nimport { Semaphore } from \"../upload/concurrency.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { toError } from \"../util/to-error.js\";\nimport { DeleteLocalAction, DeleteRemoteAction, HideAction, CopyAction, DownloadAction, UploadAction } from \"./actions/index.js\";\nimport { zipFolders } from \"./pairing.js\";\nimport { generateActions } from \"./policies/index.js\";\nfunction resolveDirection(source, dest) {\n if (source.type === \"local\" && dest.type === \"b2\") return \"local-to-b2\";\n if (source.type === \"b2\" && dest.type === \"local\") return \"b2-to-local\";\n if (source.type === \"b2\" && dest.type === \"b2\") return \"b2-to-b2\";\n throw new Error(`Unsupported sync direction: ${source.type} to ${dest.type}`);\n}\nasync function* synchronize(config) {\n const { source, dest, options } = config;\n const direction = resolveDirection(source, dest);\n const dryRun = options.dryRun ?? false;\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const keepDays = options.keepDays ?? 0;\n const compareThreshold = options.compareThreshold ?? 0;\n const nowMillis = Date.now();\n const factory = createActionFactory(config);\n const actions = [];\n for await (const pair of zipFolders(source, dest)) {\n if (options.signal?.aborted) return;\n for (const action of generateActions(\n pair,\n direction,\n options.compareMode,\n options.keepMode,\n keepDays,\n nowMillis,\n factory,\n compareThreshold\n )) {\n actions.push(action);\n }\n yield { type: \"compare\", path: (pair[0] ?? pair[1])?.relativePath ?? \"\", size: 0 };\n }\n const sem = new Semaphore(concurrency);\n const results = [];\n const errors = [];\n const promises = actions.map(async (action) => {\n await sem.acquire();\n try {\n if (options.signal?.aborted) return;\n const event = await action.execute(dryRun);\n results.push(event);\n } catch (err) {\n const errorValue = toError(err);\n errors.push(errorValue);\n results.push({\n type: \"error\",\n path: action.relativePath,\n size: 0,\n message: errorValue.message\n });\n } finally {\n sem.release();\n }\n });\n await Promise.all(promises);\n for (const event of results) {\n yield event;\n }\n if (errors.length > 0) {\n yield {\n type: \"error\",\n path: \"\",\n size: 0,\n message: `${errors.length} action(s) failed`\n };\n }\n}\nfunction assertBucket(bucket, context) {\n if (!bucket) throw new Error(`Bucket required for ${context} actions`);\n}\nfunction createActionFactory(config) {\n const upConfig = config;\n const downConfig = config;\n const destBucket = upConfig.bucket ?? downConfig.bucket;\n const bucketIsLocked = destBucket?.info?.fileLockConfiguration?.value?.isFileLockEnabled ?? false;\n const factory = {\n upload(source) {\n const bucket = upConfig.bucket;\n const prefix = upConfig.prefix ?? \"\";\n assertBucket(bucket, \"upload\");\n return new UploadAction(\n source.relativePath,\n source.absolutePath,\n source.size,\n async (absPath, relPath) => {\n const { readFile } = await import(\"node:fs/promises\");\n const data = await readFile(absPath);\n await bucket.upload({\n fileName: `${prefix}${relPath}`,\n source: new BufferSource(new Uint8Array(data))\n });\n }\n );\n },\n download(source) {\n const bucket = downConfig.bucket;\n const root = downConfig.dest?.type === \"local\" ? downConfig.dest.root : \"\";\n assertBucket(bucket, \"download\");\n return new DownloadAction(source.relativePath, source.size, async (relPath) => {\n const result = await bucket.download(source.selectedVersion.fileName);\n const reader = result.body.getReader();\n let combined;\n try {\n const chunks = [];\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n let total = 0;\n for (const c of chunks) total += c.byteLength;\n combined = new Uint8Array(total);\n let offset = 0;\n for (const c of chunks) {\n combined.set(c, offset);\n offset += c.byteLength;\n }\n } finally {\n reader.releaseLock();\n }\n const { mkdir, writeFile } = await import(\"node:fs/promises\");\n const { dirname, join } = await import(\"node:path\");\n const destPath = join(root, relPath);\n await mkdir(dirname(destPath), { recursive: true });\n await writeFile(destPath, combined);\n });\n },\n copy(source, destPath) {\n const bucket = upConfig.bucket;\n assertBucket(bucket, \"copy\");\n return new CopyAction(source.relativePath, source.size, async () => {\n await bucket.copyFile({\n sourceFileId: source.selectedVersion.fileId,\n fileName: destPath\n });\n });\n },\n hide(path) {\n const bucket = upConfig.bucket ?? downConfig.bucket;\n assertBucket(bucket, \"hide\");\n return new HideAction(path, async (relPath) => {\n const prefix = upConfig.prefix ?? \"\";\n await bucket.hideFile(`${prefix}${relPath}`);\n });\n },\n deleteRemote(path) {\n const bucket = upConfig.bucket ?? downConfig.bucket;\n assertBucket(bucket, \"delete\");\n const b2FileName = path.selectedVersion.fileName;\n return new DeleteRemoteAction(\n path.relativePath,\n path.selectedVersion.fileId,\n async (fileId$1) => {\n await bucket.deleteFileVersion(b2FileName, fileId(fileId$1));\n }\n );\n },\n deleteLocal(path) {\n return new DeleteLocalAction(path.relativePath, path.absolutePath, async (absPath) => {\n const { unlink } = await import(\"node:fs/promises\");\n await unlink(absPath);\n });\n },\n removeOrphan(dest) {\n return bucketIsLocked ? factory.hide(dest.relativePath) : factory.deleteRemote(dest);\n }\n };\n return factory;\n}\nexport {\n synchronize\n};\n//# sourceMappingURL=synchronizer.js.map\n","import { readdir, stat } from \"node:fs/promises\";\nimport { join, relative, sep } from \"node:path\";\nclass LocalFolder {\n type = \"local\";\n /** Absolute path to the local root directory. */\n root;\n /**\n * Creates a new LocalFolder for the given root directory.\n * @param root - Absolute path to the local directory to scan.\n */\n constructor(root) {\n this.root = root;\n }\n /** Recursively walks the directory and yields files sorted by relative path. */\n async *scan() {\n const collected = [];\n await this.walk(this.root, collected);\n collected.sort((a, b) => a.relativePath.localeCompare(b.relativePath));\n for (const entry of collected) {\n yield entry;\n }\n }\n /**\n * Recursively collects files from {@link dir} into {@link out}.\n * @param dir - Absolute path of the directory to scan.\n * @param out - Accumulator array that receives discovered file entries.\n */\n async walk(dir, out) {\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n if (entry.isDirectory()) {\n await this.walk(fullPath, out);\n } else if (entry.isFile()) {\n try {\n const s = await stat(fullPath);\n const rel = relative(this.root, fullPath).split(sep).join(\"/\");\n out.push({\n relativePath: rel,\n absolutePath: fullPath,\n modTimeMillis: Math.floor(s.mtimeMs),\n size: s.size\n });\n } catch {\n }\n }\n }\n }\n}\nexport {\n LocalFolder\n};\n//# sourceMappingURL=local.js.map\n","const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: \"start\",\n /** Normal upload (small or finished large file). */\n Upload: \"upload\",\n /** Hide marker (soft delete). */\n Hide: \"hide\",\n /** Virtual folder marker. */\n Folder: \"folder\",\n /** Created via server-side copy. */\n Copy: \"copy\"\n};\nconst MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: \"COPY\",\n /** Use the values provided in the copy request. */\n Replace: \"REPLACE\"\n};\nexport {\n FileAction,\n MetadataDirective\n};\n//# sourceMappingURL=file.js.map\n","import { FileAction } from \"../../types/file.js\";\nclass B2Folder {\n type = \"b2\";\n bucket;\n prefix;\n /**\n * Creates a new B2Folder for the given bucket and optional prefix.\n * @param bucket - The B2 bucket to scan.\n * @param prefix - Optional key prefix to restrict the scan scope.\n */\n constructor(bucket, prefix = \"\") {\n this.bucket = bucket;\n this.prefix = prefix;\n }\n /** Lists all file versions in the bucket, groups by name, and yields the latest visible version. */\n async *scan() {\n const grouped = /* @__PURE__ */ new Map();\n let startFileName;\n let startFileId;\n while (true) {\n const listing = await this.bucket.listFileVersions({\n ...this.prefix !== \"\" ? { prefix: this.prefix } : {},\n ...startFileName !== void 0 ? { startFileName } : {},\n ...startFileId !== void 0 ? { startFileId } : {}\n });\n for (const fv of listing.files) {\n const existing = grouped.get(fv.fileName);\n if (existing) {\n existing.push(fv);\n } else {\n grouped.set(fv.fileName, [fv]);\n }\n }\n if (!listing.nextFileName) break;\n startFileName = listing.nextFileName;\n startFileId = listing.nextFileId;\n }\n const sorted = [...grouped.entries()].sort((a, b) => a[0].localeCompare(b[0]));\n for (const [fileName, versions] of sorted) {\n versions.sort((a, b) => b.uploadTimestamp - a.uploadTimestamp);\n const selected = versions[0];\n if (!selected || selected.action === FileAction.Hide) continue;\n const relativePath = this.prefix !== \"\" ? fileName.slice(this.prefix.length) : fileName;\n yield {\n relativePath,\n modTimeMillis: selected.uploadTimestamp,\n size: selected.contentLength,\n selectedVersion: selected,\n allVersions: versions\n };\n }\n }\n}\nexport {\n B2Folder\n};\n//# sourceMappingURL=b2.js.map\n","import { mkdir } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type {\n CompareMode,\n KeepMode,\n SyncEvent,\n SynchronizerDownConfig,\n SynchronizerUpConfig,\n} from '@backblaze-labs/b2-sdk/sync'\nimport { B2Folder, LocalFolder, synchronize } from '@backblaze-labs/b2-sdk/sync'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/**\n * Mutable counter bag fed by {@link processSyncEvent} as the action consumes\n * the SDK's `synchronize()` event stream. Exposed alongside the processor so\n * unit tests can drive each SyncEvent variant deterministically (notably the\n * `copy-start` / `copy-done` events that only fire in b2-to-b2 sync, which\n * the action's input surface doesn't currently expose).\n */\nexport interface SyncEventCounters {\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files removed (delete-remote, delete-local, or hide). */\n deleted: number\n /** Count of files left unchanged. */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred (upload + download). */\n bytesTransferred: number\n}\n\n/**\n * Apply one `SyncEvent` from the SDK's `synchronize()` stream to the running\n * counters and emit the corresponding log line. The action's `syncCommand`\n * calls this in a loop; the function is exported (and the {@link SyncEventCounters}\n * type with it) so tests can exercise every event variant independently,\n * including the `copy-*` events that require b2-to-b2 sync to fire from the\n * real engine.\n *\n * Informational lifecycle events (`upload-start`, `compare`, etc.) are\n * deliberate no-ops; listing them explicitly keeps the switch exhaustive\n * so TypeScript errors if the SDK adds a new variant.\n */\nexport function processSyncEvent(event: SyncEvent, counters: SyncEventCounters): void {\n switch (event.type) {\n case 'upload-done':\n counters.uploaded++\n counters.bytesTransferred += event.size\n core.info(` ↑ ${event.path} (${event.size}B)`)\n return\n case 'download-done':\n counters.downloaded++\n counters.bytesTransferred += event.size\n core.info(` ↓ ${event.path} (${event.size}B)`)\n return\n case 'delete-remote':\n counters.deleted++\n core.info(` − ${event.path}`)\n return\n case 'delete-local':\n counters.deleted++\n core.info(` − (local) ${event.path}`)\n return\n case 'hide':\n counters.deleted++\n core.info(` ⌀ ${event.path} (hidden)`)\n return\n case 'skip':\n counters.skipped++\n return\n case 'error':\n counters.errors++\n core.warning(` ! ${event.path}: ${event.message}`)\n return\n case 'upload-start':\n case 'compare':\n case 'download-start':\n case 'copy-start':\n case 'copy-done':\n return\n }\n}\n\n/**\n * Build a one-line summary of the first few sync errors for the dispatcher's\n * top-level failure message. Without this, a sync that fails on three files\n * surfaces only `Sync completed with 3 error(s)` to the user, who then has to\n * dig into the (possibly collapsed) per-file warnings or parse `summary-json`.\n * Including a sample makes the failure message itself diagnose-able.\n */\nexport function summarizeSyncErrors(events: SyncEvent[], limit = 3): string {\n const errors = events.filter(\n (e): e is Extract => e.type === 'error',\n )\n if (errors.length === 0) return ''\n const head = errors\n .slice(0, limit)\n .map((e) => `${e.path}: ${e.message}`)\n .join('; ')\n const tail = errors.length > limit ? `; +${errors.length - limit} more` : ''\n return `${head}${tail}`\n}\n\n/** Result of {@link syncCommand}: per-event log plus aggregate counters. */\nexport interface SyncResult {\n /** Per-file events emitted by the SDK's `synchronize()` (upload-done, download-done, skip, delete-*, hide, error). */\n events: SyncEvent[]\n /** Resolved direction of this sync (after `auto` resolution). */\n direction: 'local-to-b2' | 'b2-to-local'\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files deleted/hidden across both sides. */\n deleted: number\n /** Count of files left unchanged (already in sync). */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred across both directions. */\n bytesTransferred: number\n}\n\n/**\n * Sync a local directory to / from a B2 bucket prefix.\n *\n * Direction is determined by the `direction` input (`up` = local → B2,\n * `down` = B2 → local). With `direction: auto` (the default) we infer:\n * - if `source` is an existing local directory → `up`\n * - otherwise → `down` (source is a B2 prefix, destination is local)\n *\n * The SDK's {@link synchronize} returns an `AsyncGenerator` which we\n * relay to the workflow log (per-file) and aggregate into a typed result.\n */\nexport async function syncCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'sync', 'a local directory (up) or B2 prefix (down)')\n\n const direction = await resolveDirection(inputs.syncDirection, source)\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n\n const config = await buildConfig(bucket, source, inputs, direction, signal)\n\n core.startGroup(\n `sync ${direction === 'local-to-b2' ? source : `b2://${bucket.name}/${source}`} ` +\n `→ ${direction === 'local-to-b2' ? `b2://${bucket.name}/${inputs.destination ?? ''}` : (inputs.destination ?? '.')} ` +\n `(compare=${compareMode}, keep=${keepMode}${dryRun ? ', dry-run' : ''})`,\n )\n\n const events: SyncEvent[] = []\n const counters: SyncEventCounters = {\n uploaded: 0,\n downloaded: 0,\n deleted: 0,\n skipped: 0,\n errors: 0,\n bytesTransferred: 0,\n }\n\n try {\n for await (const event of synchronize(config)) {\n events.push(event)\n processSyncEvent(event, counters)\n }\n } finally {\n core.endGroup()\n }\n\n const { uploaded, downloaded, deleted, skipped, errors, bytesTransferred } = counters\n\n core.info(\n `sync done [${direction}]: ${uploaded} uploaded, ${downloaded} downloaded, ${deleted} removed, ${skipped} unchanged, ${errors} errors`,\n )\n\n return {\n events,\n direction,\n uploaded,\n downloaded,\n deleted,\n skipped,\n errors,\n bytesTransferred,\n }\n}\n\nasync function resolveDirection(\n requested: 'up' | 'down' | 'auto',\n source: string,\n): Promise<'local-to-b2' | 'b2-to-local'> {\n if (requested === 'up') return 'local-to-b2'\n if (requested === 'down') return 'b2-to-local'\n const localStat = await tryStat(source)\n return localStat?.isDirectory() ? 'local-to-b2' : 'b2-to-local'\n}\n\nasync function buildConfig(\n bucket: Bucket,\n source: string,\n inputs: ParsedInputs,\n direction: 'local-to-b2' | 'b2-to-local',\n signal?: AbortSignal,\n): Promise {\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n const concurrency = inputs.concurrency\n const options = {\n compareMode,\n keepMode,\n concurrency,\n dryRun,\n ...(signal !== undefined ? { signal } : {}),\n }\n\n if (direction === 'local-to-b2') {\n const stats = await tryStat(source)\n if (!stats?.isDirectory()) {\n throw new Error(`'sync' up requires 'source' to be an existing local directory: ${source}`)\n }\n const prefix = (inputs.destination ?? '').replace(/^\\/+|\\/+$/g, '')\n return {\n source: new LocalFolder(resolve(source)),\n dest: new B2Folder(bucket, prefix === '' ? '' : `${prefix}/`),\n bucket,\n prefix: prefix === '' ? '' : `${prefix}/`,\n options,\n }\n }\n\n const remotePrefix = source.replace(/^\\/+|\\/+$/g, '')\n const localDest = inputs.destination ?? '.'\n await mkdir(resolve(localDest), { recursive: true })\n return {\n source: new B2Folder(bucket, remotePrefix === '' ? '' : `${remotePrefix}/`),\n dest: new LocalFolder(resolve(localDest)),\n bucket,\n options,\n }\n}\n\nexport type { CompareMode, KeepMode }\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link unhideCommand}. */\nexport interface UnhideResult {\n /** B2 file name that was unhidden. */\n fileName: string\n /** File ID of the removed hide marker, or `null` if there was nothing hidden. */\n removedMarkerFileId: string | null\n}\n\n/**\n * Restore visibility of a file previously hidden by the `hide` command.\n *\n * Wraps the SDK's {@link Bucket.unhideFile}, which finds the most recent hide\n * marker for the file name and deletes it. If the file is already visible\n * (or never existed), no-ops and reports `removedMarkerFileId: null`.\n *\n * B2 has no native `b2_unhide_file` endpoint; the SDK implements unhide as\n * \"list versions → delete the top hide marker\", which is the canonical\n * recipe. We expose it here so workflow authors don't have to know that.\n */\nexport async function unhideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'unhide', 'the B2 file name')\n\n core.startGroup(`unhide b2://${bucket.name}/${source}`)\n try {\n const marker = await bucket.unhideFile(source)\n if (marker === null) {\n core.info(` no hide marker found for ${source} (already visible or non-existent)`)\n return { fileName: source, removedMarkerFileId: null }\n }\n core.info(` removed hide marker fileId=${marker.fileId}, ${source} is now visible`)\n return { fileName: source, removedMarkerFileId: marker.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core';\n/**\n * Returns a copy with defaults filled in.\n */\nexport function getOptions(copy) {\n const result = {\n followSymbolicLinks: true,\n implicitDescendants: true,\n matchDirectories: true,\n omitBrokenSymbolicLinks: true,\n excludeHiddenFiles: false\n };\n if (copy) {\n if (typeof copy.followSymbolicLinks === 'boolean') {\n result.followSymbolicLinks = copy.followSymbolicLinks;\n core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);\n }\n if (typeof copy.implicitDescendants === 'boolean') {\n result.implicitDescendants = copy.implicitDescendants;\n core.debug(`implicitDescendants '${result.implicitDescendants}'`);\n }\n if (typeof copy.matchDirectories === 'boolean') {\n result.matchDirectories = copy.matchDirectories;\n core.debug(`matchDirectories '${result.matchDirectories}'`);\n }\n if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {\n result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;\n core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);\n }\n if (typeof copy.excludeHiddenFiles === 'boolean') {\n result.excludeHiddenFiles = copy.excludeHiddenFiles;\n core.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`);\n }\n }\n return result;\n}\n//# sourceMappingURL=internal-glob-options-helper.js.map","import * as path from 'path';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.\n *\n * For example, on Linux/macOS:\n * - `/ => /`\n * - `/hello => /`\n *\n * For example, on Windows:\n * - `C:\\ => C:\\`\n * - `C:\\hello => C:\\`\n * - `C: => C:`\n * - `C:hello => C:`\n * - `\\ => \\`\n * - `\\hello => \\`\n * - `\\\\hello => \\\\hello`\n * - `\\\\hello\\world => \\\\hello\\world`\n */\nexport function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}\n/**\n * Roots the path if not already rooted. On Windows, relative roots like `\\`\n * or `C:` are expanded based on the current working directory.\n */\nexport function ensureAbsoluteRoot(root, itemPath) {\n assert(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);\n assert(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Already rooted\n if (hasAbsoluteRoot(itemPath)) {\n return itemPath;\n }\n // Windows\n if (IS_WINDOWS) {\n // Check for itemPath like C: or C:foo\n if (itemPath.match(/^[A-Z]:[^\\\\/]|^[A-Z]:$/i)) {\n let cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n // Drive letter matches cwd? Expand to cwd\n if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {\n // Drive only, e.g. C:\n if (itemPath.length === 2) {\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}`;\n }\n // Drive + path, e.g. C:foo\n else {\n if (!cwd.endsWith('\\\\')) {\n cwd += '\\\\';\n }\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}${itemPath.substr(2)}`;\n }\n }\n // Different drive\n else {\n return `${itemPath[0]}:\\\\${itemPath.substr(2)}`;\n }\n }\n // Check for itemPath like \\ or \\foo\n else if (normalizeSeparators(itemPath).match(/^\\\\$|^\\\\[^\\\\]/)) {\n const cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n return `${cwd[0]}:\\\\${itemPath.substr(1)}`;\n }\n }\n assert(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);\n // Otherwise ensure root ends with a separator\n if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\\\'))) {\n // Intentionally empty\n }\n else {\n // Append separator\n root += path.sep;\n }\n return root + itemPath;\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\\\hello\\share` and `C:\\hello` (and using alternate separator).\n */\nexport function hasAbsoluteRoot(itemPath) {\n assert(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\\\hello\\share or C:\\hello\n return itemPath.startsWith('\\\\\\\\') || /^[A-Z]:\\\\/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\`, `\\hello`, `\\\\hello\\share`, `C:`, and `C:\\hello` (and using alternate separator).\n */\nexport function hasRoot(itemPath) {\n assert(itemPath, `isRooted parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\ or \\hello or \\\\hello\n // E.g. C: or C:\\hello\n return itemPath.startsWith('\\\\') || /^[A-Z]:/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * Removes redundant slashes and converts `/` to `\\` on Windows\n */\nexport function normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n/**\n * Normalizes the path separators and trims the trailing separator (when safe).\n * For example, `/foo/ => /foo` but `/ => /`\n */\nexport function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}\n//# sourceMappingURL=internal-path-helper.js.map","/**\n * Indicates whether a pattern matches a path\n */\nexport var MatchKind;\n(function (MatchKind) {\n /** Not matched */\n MatchKind[MatchKind[\"None\"] = 0] = \"None\";\n /** Matched if the path is a directory */\n MatchKind[MatchKind[\"Directory\"] = 1] = \"Directory\";\n /** Matched if the path is a regular file */\n MatchKind[MatchKind[\"File\"] = 2] = \"File\";\n /** Matched */\n MatchKind[MatchKind[\"All\"] = 3] = \"All\";\n})(MatchKind || (MatchKind = {}));\n//# sourceMappingURL=internal-match-kind.js.map","import * as pathHelper from './internal-path-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Given an array of patterns, returns an array of paths to search.\n * Duplicates and paths under other included paths are filtered out.\n */\nexport function getSearchPaths(patterns) {\n // Ignore negate patterns\n patterns = patterns.filter(x => !x.negate);\n // Create a map of all search paths\n const searchPathMap = {};\n for (const pattern of patterns) {\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n searchPathMap[key] = 'candidate';\n }\n const result = [];\n for (const pattern of patterns) {\n // Check if already included\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n if (searchPathMap[key] === 'included') {\n continue;\n }\n // Check for an ancestor search path\n let foundAncestor = false;\n let tempKey = key;\n let parent = pathHelper.dirname(tempKey);\n while (parent !== tempKey) {\n if (searchPathMap[parent]) {\n foundAncestor = true;\n break;\n }\n tempKey = parent;\n parent = pathHelper.dirname(tempKey);\n }\n // Include the search pattern in the result\n if (!foundAncestor) {\n result.push(pattern.searchPath);\n searchPathMap[key] = 'included';\n }\n }\n return result;\n}\n/**\n * Matches the patterns against the path\n */\nexport function match(patterns, itemPath) {\n let result = MatchKind.None;\n for (const pattern of patterns) {\n if (pattern.negate) {\n result &= ~pattern.match(itemPath);\n }\n else {\n result |= pattern.match(itemPath);\n }\n }\n return result;\n}\n/**\n * Checks whether to descend further into the directory\n */\nexport function partialMatch(patterns, itemPath) {\n return patterns.some(x => !x.negate && x.partialMatch(itemPath));\n}\n//# sourceMappingURL=internal-pattern-helper.js.map","export const balanced = (a, b, str) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a;\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b;\n const r = ma !== null && mb != null && range(ma, mb, str);\n return (r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n });\n};\nconst maybeMatch = (reg, str) => {\n const m = str.match(reg);\n return m ? m[0] : null;\n};\nexport const range = (a, b, str) => {\n let begs, beg, left, right = undefined, result;\n let ai = str.indexOf(a);\n let bi = str.indexOf(b, ai + 1);\n let i = ai;\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n }\n else if (begs.length === 1) {\n const r = begs.pop();\n if (r !== undefined)\n result = [r, bi];\n }\n else {\n beg = begs.pop();\n if (beg !== undefined && beg < left) {\n left = beg;\n right = bi;\n }\n bi = str.indexOf(b, i + 1);\n }\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n if (begs.length && right !== undefined) {\n result = [left, right];\n }\n }\n return result;\n};\n//# sourceMappingURL=index.js.map","import { balanced } from 'balanced-match';\nconst escSlash = '\\0SLASH' + Math.random() + '\\0';\nconst escOpen = '\\0OPEN' + Math.random() + '\\0';\nconst escClose = '\\0CLOSE' + Math.random() + '\\0';\nconst escComma = '\\0COMMA' + Math.random() + '\\0';\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0';\nconst escSlashPattern = new RegExp(escSlash, 'g');\nconst escOpenPattern = new RegExp(escOpen, 'g');\nconst escClosePattern = new RegExp(escClose, 'g');\nconst escCommaPattern = new RegExp(escComma, 'g');\nconst escPeriodPattern = new RegExp(escPeriod, 'g');\nconst slashPattern = /\\\\\\\\/g;\nconst openPattern = /\\\\{/g;\nconst closePattern = /\\\\}/g;\nconst commaPattern = /\\\\,/g;\nconst periodPattern = /\\\\\\./g;\nexport const EXPANSION_MAX = 100_000;\nfunction numeric(str) {\n return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);\n}\nfunction escapeBraces(str) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod);\n}\nfunction unescapeBraces(str) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.');\n}\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str) {\n if (!str) {\n return [''];\n }\n const parts = [];\n const m = balanced('{', '}', str);\n if (!m) {\n return str.split(',');\n }\n const { pre, body, post } = m;\n const p = pre.split(',');\n p[p.length - 1] += '{' + body + '}';\n const postParts = parseCommaParts(post);\n if (post.length) {\n ;\n p[p.length - 1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n parts.push.apply(parts, p);\n return parts;\n}\nexport function expand(str, options = {}) {\n if (!str) {\n return [];\n }\n const { max = EXPANSION_MAX } = options;\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2);\n }\n return expand_(escapeBraces(str), max, true).map(unescapeBraces);\n}\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\nfunction expand_(str, max, isTop) {\n /** @type {string[]} */\n const expansions = [];\n const m = balanced('{', '}', str);\n if (!m)\n return [str];\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre;\n const post = m.post.length ? expand_(m.post, max, false) : [''];\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k];\n expansions.push(expansion);\n }\n }\n else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n const isSequence = isNumericSequence || isAlphaSequence;\n const isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand_(str, max, true);\n }\n return [str];\n }\n let n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n }\n else {\n n = parseCommaParts(m.body);\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace);\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p);\n }\n /* c8 ignore stop */\n }\n }\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N;\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0]);\n const y = numeric(n[1]);\n const width = Math.max(n[0].length, n[1].length);\n let incr = n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n let test = lte;\n const reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n const pad = n.some(isPadded);\n N = [];\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\') {\n c = '';\n }\n }\n else {\n c = String(i);\n if (pad) {\n const need = width - c.length;\n if (need > 0) {\n const z = new Array(need + 1).join('0');\n if (i < 0) {\n c = '-' + z + c.slice(1);\n }\n else {\n c = z + c;\n }\n }\n }\n }\n N.push(c);\n }\n }\n else {\n N = [];\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j], max, false));\n }\n }\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion);\n }\n }\n }\n }\n return expansions;\n}\n//# sourceMappingURL=index.js.map","const MAX_PATTERN_LENGTH = 1024 * 64;\nexport const assertValidPattern = (pattern) => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern');\n }\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long');\n }\n};\n//# sourceMappingURL=assert-valid-pattern.js.map","// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n// { : [, /u flag required, negated]\nconst posixClasses = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n};\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s) => s.replace(/[[\\]\\\\-]/g, '\\\\$&');\n// escape all regexp magic characters\nconst regexpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges) => ranges.join('');\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (glob, position) => {\n const pos = position;\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression');\n }\n /* c8 ignore stop */\n const ranges = [];\n const negs = [];\n let i = pos + 1;\n let sawStart = false;\n let uflag = false;\n let escaping = false;\n let negate = false;\n let endPos = pos;\n let rangeStart = '';\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i);\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true;\n i++;\n continue;\n }\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1;\n break;\n }\n sawStart = true;\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true;\n i++;\n continue;\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true];\n }\n i += cls.length;\n if (neg)\n negs.push(unip);\n else\n ranges.push(unip);\n uflag = uflag || u;\n continue WHILE;\n }\n }\n }\n // now it's just a normal character, effectively\n escaping = false;\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));\n }\n else if (c === rangeStart) {\n ranges.push(braceEscape(c));\n }\n rangeStart = '';\n i++;\n continue;\n }\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'));\n i += 2;\n continue;\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c;\n i += 2;\n continue;\n }\n // not the start of a range, just a single character\n ranges.push(braceEscape(c));\n i++;\n }\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false];\n }\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true];\n }\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];\n return [regexpEscape(r), false, endPos - pos, false];\n }\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';\n const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs;\n return [comb, uflag, endPos - pos, true];\n};\n//# sourceMappingURL=brace-expressions.js.map","/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\nexport const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1');\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1');\n};\n//# sourceMappingURL=unescape.js.map","// parse a single path portion\nvar _a;\nimport { parseClass } from './brace-expressions.js';\nimport { unescape } from './unescape.js';\nconst types = new Set(['!', '?', '+', '*', '@']);\nconst isExtglobType = (c) => types.has(c);\nconst isExtglobAST = (c) => isExtglobType(c.type);\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n]);\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n]);\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n]);\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n]);\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))';\nconst startNoDot = '(?!\\\\.)';\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.']);\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.']);\nconst reSpecials = new Set('().*{}+?[]^$\\\\!');\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// any single thing other than /\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?';\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\nlet ID = 0;\nexport class AST {\n type;\n #root;\n #hasMagic;\n #uflag = false;\n #parts = [];\n #parent;\n #parentIndex;\n #negs;\n #filledNegs = false;\n #options;\n #toString;\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt = false;\n id = ++ID;\n get depth() {\n return (this.#parent?.depth ?? -1) + 1;\n }\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n };\n }\n constructor(type, parent, options = {}) {\n this.type = type;\n // extglobs are inherently magical\n if (type)\n this.#hasMagic = true;\n this.#parent = parent;\n this.#root = this.#parent ? this.#parent.#root : this;\n this.#options = this.#root === this ? options : this.#root.#options;\n this.#negs = this.#root === this ? [] : this.#root.#negs;\n if (type === '!' && !this.#root.#filledNegs)\n this.#negs.push(this);\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;\n }\n get hasMagic() {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined)\n return this.#hasMagic;\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string')\n continue;\n if (p.type || p.hasMagic)\n return (this.#hasMagic = true);\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic;\n }\n // reconstructs the pattern\n toString() {\n return (this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')'));\n }\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root)\n throw new Error('should only call on root');\n if (this.#filledNegs)\n return this;\n /* c8 ignore stop */\n // call toString() once to fill this out\n this.toString();\n this.#filledNegs = true;\n let n;\n while ((n = this.#negs.pop())) {\n if (n.type !== '!')\n continue;\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p = n;\n let pp = p.#parent;\n while (pp) {\n for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??');\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i]);\n }\n }\n p = pp;\n pp = p.#parent;\n }\n }\n return this;\n }\n push(...parts) {\n for (const p of parts) {\n if (p === '')\n continue;\n /* c8 ignore start */\n if (typeof p !== 'string' &&\n !(p instanceof _a && p.#parent === this)) {\n throw new Error('invalid part: ' + p);\n }\n /* c8 ignore stop */\n this.#parts.push(p);\n }\n }\n toJSON() {\n const ret = this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => p.toJSON())];\n if (this.isStart() && !this.type)\n ret.unshift([]);\n if (this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))) {\n ret.push({});\n }\n return ret;\n }\n isStart() {\n if (this.#root === this)\n return true;\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart())\n return false;\n if (this.#parentIndex === 0)\n return true;\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent;\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i];\n if (!(pp instanceof _a && pp.type === '!')) {\n return false;\n }\n }\n return true;\n }\n isEnd() {\n if (this.#root === this)\n return true;\n if (this.#parent?.type === '!')\n return true;\n if (!this.#parent?.isEnd())\n return false;\n if (!this.type)\n return this.#parent?.isEnd();\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0;\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1;\n }\n copyIn(part) {\n if (typeof part === 'string')\n this.push(part);\n else\n this.push(part.clone(this));\n }\n clone(parent) {\n const c = new _a(this.type, parent);\n for (const p of this.#parts) {\n c.copyIn(p);\n }\n return c;\n }\n static #parseAST(str, ast, pos, opt, extDepth) {\n const maxDepth = opt.maxExtglobRecursion ?? 2;\n let escaping = false;\n let inBrace = false;\n let braceStart = -1;\n let braceNeg = false;\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos;\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth;\n if (doRecurse) {\n ast.push(acc);\n acc = '';\n const ext = new _a(c, ast);\n i = _a.#parseAST(str, ext, i, opt, extDepth + 1);\n ast.push(ext);\n continue;\n }\n acc += c;\n }\n ast.push(acc);\n return i;\n }\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1;\n let part = new _a(null, ast);\n const parts = [];\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;\n part.push(acc);\n acc = '';\n const ext = new _a(c, part);\n part.push(ext);\n i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);\n continue;\n }\n if (c === '|') {\n part.push(acc);\n acc = '';\n parts.push(part);\n part = new _a(null, ast);\n continue;\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true;\n }\n part.push(acc);\n acc = '';\n ast.push(...parts, part);\n return i;\n }\n acc += c;\n }\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null;\n ast.#hasMagic = undefined;\n ast.#parts = [str.substring(pos - 1)];\n return i;\n }\n #canAdoptWithSpace(child) {\n return this.#canAdopt(child, adoptionWithSpaceMap);\n }\n #canAdopt(child, map = adoptionMap) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canAdoptType(gc.type, map);\n }\n #canAdoptType(c, map = adoptionAnyMap) {\n return !!map.get(this.type)?.includes(c);\n }\n #adoptWithSpace(child, index) {\n const gc = child.#parts[0];\n const blank = new _a(null, gc, this.options);\n blank.#parts.push('');\n gc.push(blank);\n this.#adopt(child, index);\n }\n #adopt(child, index) {\n const gc = child.#parts[0];\n this.#parts.splice(index, 1, ...gc.#parts);\n for (const p of gc.#parts) {\n if (typeof p === 'object')\n p.#parent = this;\n }\n this.#toString = undefined;\n }\n #canUsurpType(c) {\n const m = usurpMap.get(this.type);\n return !!m?.has(c);\n }\n #canUsurp(child) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canUsurpType(gc.type);\n }\n #usurp(child) {\n const m = usurpMap.get(this.type);\n const gc = child.#parts[0];\n const nt = m?.get(gc.type);\n /* c8 ignore start - impossible */\n if (!nt)\n return false;\n /* c8 ignore stop */\n this.#parts = gc.#parts;\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this;\n }\n }\n this.type = nt;\n this.#toString = undefined;\n this.#emptyExt = false;\n }\n static fromGlob(pattern, options = {}) {\n const ast = new _a(null, undefined, options);\n _a.#parseAST(pattern, ast, 0, options, 0);\n return ast;\n }\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern() {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root)\n return this.#root.toMMPattern();\n /* c8 ignore stop */\n const glob = this.toString();\n const [re, body, hasMagic, uflag] = this.toRegExpSource();\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic = hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase());\n if (!anyMagic) {\n return body;\n }\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n });\n }\n get options() {\n return this.#options;\n }\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(allowDot) {\n const dot = allowDot ?? !!this.#options.dot;\n if (this.#root === this) {\n this.#flatten();\n this.#fillNegs();\n }\n if (!isExtglobAST(this)) {\n const noEmpty = this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string');\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] = typeof p === 'string' ?\n _a.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot);\n this.#hasMagic = this.#hasMagic || hasMagic;\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .join('');\n let start = '';\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);\n if (!dotTravAllowed) {\n const aps = addPatternStart;\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav = \n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)));\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : '';\n }\n }\n }\n // append the \"end of path portion\" pattern to negation tails\n let end = '';\n if (this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!') {\n end = '(?:$|\\\\/)';\n }\n const final = start + src + end;\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n const repeated = this.type === '*' || this.type === '+';\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:';\n let body = this.#partsToRegExp(dot);\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString();\n const me = this;\n me.#parts = [s];\n me.type = null;\n me.#hasMagic = undefined;\n return [s, unescape(this.toString()), false, false];\n }\n let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true);\n if (bodyDotAllowed === body) {\n bodyDotAllowed = '';\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`;\n }\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = '';\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;\n }\n else {\n const close = this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`;\n final = start + body + close;\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten();\n }\n }\n }\n else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0;\n let done = false;\n do {\n done = true;\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i];\n if (typeof c === 'object') {\n c.#flatten();\n if (this.#canAdopt(c)) {\n done = false;\n this.#adopt(c, i);\n }\n else if (this.#canAdoptWithSpace(c)) {\n done = false;\n this.#adoptWithSpace(c, i);\n }\n else if (this.#canUsurp(c)) {\n done = false;\n this.#usurp(c);\n }\n }\n }\n } while (!done && ++iterations < 10);\n }\n this.#toString = undefined;\n }\n #partsToRegExp(dot) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??');\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|');\n }\n static #parseGlob(glob, hasMagic, noEmpty = false) {\n let escaping = false;\n let re = '';\n let uflag = false;\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false;\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i);\n if (escaping) {\n escaping = false;\n re += (reSpecials.has(c) ? '\\\\' : '') + c;\n continue;\n }\n if (c === '*') {\n if (inStar)\n continue;\n inStar = true;\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;\n hasMagic = true;\n continue;\n }\n else {\n inStar = false;\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\';\n }\n else {\n escaping = true;\n }\n continue;\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i);\n if (consumed) {\n re += src;\n uflag = uflag || needUflag;\n i += consumed - 1;\n hasMagic = hasMagic || magic;\n continue;\n }\n }\n if (c === '?') {\n re += qmark;\n hasMagic = true;\n continue;\n }\n re += regExpEscape(c);\n }\n return [re, unescape(glob), !!hasMagic, uflag];\n }\n}\n_a = AST;\n//# sourceMappingURL=ast.js.map","/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&');\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&');\n};\n//# sourceMappingURL=escape.js.map","import { expand } from 'brace-expansion';\nimport { assertValidPattern } from './assert-valid-pattern.js';\nimport { AST } from './ast.js';\nimport { escape } from './escape.js';\nimport { unescape } from './unescape.js';\nexport const minimatch = (p, pattern, options = {}) => {\n assertValidPattern(pattern);\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false;\n }\n return new Minimatch(pattern, options).match(p);\n};\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/;\nconst starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);\nconst starDotExtTestDot = (ext) => (f) => f.endsWith(ext);\nconst starDotExtTestNocase = (ext) => {\n ext = ext.toLowerCase();\n return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);\n};\nconst starDotExtTestNocaseDot = (ext) => {\n ext = ext.toLowerCase();\n return (f) => f.toLowerCase().endsWith(ext);\n};\nconst starDotStarRE = /^\\*+\\.\\*+$/;\nconst starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');\nconst starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');\nconst dotStarRE = /^\\.\\*+$/;\nconst dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');\nconst starRE = /^\\*+$/;\nconst starTest = (f) => f.length !== 0 && !f.startsWith('.');\nconst starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/;\nconst qmarksTestNocase = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestNocaseDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTest = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTestNoExt = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && !f.startsWith('.');\n};\nconst qmarksTestNoExtDot = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && f !== '.' && f !== '..';\n};\n/* c8 ignore start */\nconst defaultPlatform = (typeof process === 'object' && process ?\n (typeof process.env === 'object' &&\n process.env &&\n process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n process.platform\n : 'posix');\nconst path = {\n win32: { sep: '\\\\' },\n posix: { sep: '/' },\n};\n/* c8 ignore stop */\nexport const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;\nminimatch.sep = sep;\nexport const GLOBSTAR = Symbol('globstar **');\nminimatch.GLOBSTAR = GLOBSTAR;\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?';\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?';\nexport const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);\nminimatch.filter = filter;\nconst ext = (a, b = {}) => Object.assign({}, a, b);\nexport const defaults = (def) => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch;\n }\n const orig = minimatch;\n const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));\n return Object.assign(m, {\n Minimatch: class Minimatch extends orig.Minimatch {\n constructor(pattern, options = {}) {\n super(pattern, ext(def, options));\n }\n static defaults(options) {\n return orig.defaults(ext(def, options)).Minimatch;\n }\n },\n AST: class AST extends orig.AST {\n /* c8 ignore start */\n constructor(type, parent, options = {}) {\n super(type, parent, ext(def, options));\n }\n /* c8 ignore stop */\n static fromGlob(pattern, options = {}) {\n return orig.AST.fromGlob(pattern, ext(def, options));\n }\n },\n unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),\n escape: (s, options = {}) => orig.escape(s, ext(def, options)),\n filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),\n defaults: (options) => orig.defaults(ext(def, options)),\n makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),\n braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),\n match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),\n sep: orig.sep,\n GLOBSTAR: GLOBSTAR,\n });\n};\nminimatch.defaults = defaults;\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (pattern, options = {}) => {\n assertValidPattern(pattern);\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern];\n }\n return expand(pattern, { max: options.braceExpandMax });\n};\nminimatch.braceExpand = braceExpand;\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nexport const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();\nminimatch.makeRe = makeRe;\nexport const match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options);\n list = list.filter(f => mm.match(f));\n if (mm.options.nonull && !list.length) {\n list.push(pattern);\n }\n return list;\n};\nminimatch.match = match;\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/;\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\nexport class Minimatch {\n options;\n set;\n pattern;\n windowsPathsNoEscape;\n nonegate;\n negate;\n comment;\n empty;\n preserveMultipleSlashes;\n partial;\n globSet;\n globParts;\n nocase;\n isWindows;\n platform;\n windowsNoMagicRoot;\n maxGlobstarRecursion;\n regexp;\n constructor(pattern, options = {}) {\n assertValidPattern(pattern);\n options = options || {};\n this.options = options;\n this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;\n this.pattern = pattern;\n this.platform = options.platform || defaultPlatform;\n this.isWindows = this.platform === 'win32';\n // avoid the annoying deprecation flag lol\n const awe = ('allowWindow' + 'sEscape');\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options[awe] === false;\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/');\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;\n this.regexp = null;\n this.negate = false;\n this.nonegate = !!options.nonegate;\n this.comment = false;\n this.empty = false;\n this.partial = !!options.partial;\n this.nocase = !!this.options.nocase;\n this.windowsNoMagicRoot =\n options.windowsNoMagicRoot !== undefined ?\n options.windowsNoMagicRoot\n : !!(this.isWindows && this.nocase);\n this.globSet = [];\n this.globParts = [];\n this.set = [];\n // make the set of regexps etc.\n this.make();\n }\n hasMagic() {\n if (this.options.magicalBraces && this.set.length > 1) {\n return true;\n }\n for (const pattern of this.set) {\n for (const part of pattern) {\n if (typeof part !== 'string')\n return true;\n }\n }\n return false;\n }\n debug(..._) { }\n make() {\n const pattern = this.pattern;\n const options = this.options;\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true;\n return;\n }\n if (!pattern) {\n this.empty = true;\n return;\n }\n // step 1: figure out negation, etc.\n this.parseNegate();\n // step 2: expand braces\n this.globSet = [...new Set(this.braceExpand())];\n if (options.debug) {\n //oxlint-disable-next-line no-console\n this.debug = (...args) => console.error(...args);\n }\n this.debug(this.pattern, this.globSet);\n // step 3: now we have a set, so turn each one into a series of\n // path-portion matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n //\n // First, we preprocess to make the glob pattern sets a bit simpler\n // and deduped. There are some perf-killing patterns that can cause\n // problems with a glob walk, but we can simplify them down a bit.\n const rawGlobParts = this.globSet.map(s => this.slashSplit(s));\n this.globParts = this.preprocess(rawGlobParts);\n this.debug(this.pattern, this.globParts);\n // glob --> regexps\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path.\n const isUNC = s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n !globMagic.test(s[3]);\n const isDrive = /^[a-z]:/i.test(s[0]);\n if (isUNC) {\n return [\n ...s.slice(0, 4),\n ...s.slice(4).map(ss => this.parse(ss)),\n ];\n }\n else if (isDrive) {\n return [s[0], ...s.slice(1).map(ss => this.parse(ss))];\n }\n }\n return s.map(ss => this.parse(ss));\n });\n this.debug(this.pattern, set);\n // filter out everything that didn't compile properly.\n this.set = set.filter(s => s.indexOf(false) === -1);\n // do not treat the ? in UNC paths as magic\n if (this.isWindows) {\n for (let i = 0; i < this.set.length; i++) {\n const p = this.set[i];\n if (p[0] === '' &&\n p[1] === '' &&\n this.globParts[i][2] === '?' &&\n typeof p[3] === 'string' &&\n /^[a-z]:$/i.test(p[3])) {\n p[2] = '?';\n }\n }\n }\n this.debug(this.pattern, this.set);\n }\n // various transforms to equivalent pattern sets that are\n // faster to process in a filesystem walk. The goal is to\n // eliminate what we can, and push all ** patterns as far\n // to the right as possible, even if it increases the number\n // of patterns that we have to process.\n preprocess(globParts) {\n // if we're not in globstar mode, then turn ** into *\n if (this.options.noglobstar) {\n for (const partset of globParts) {\n for (let j = 0; j < partset.length; j++) {\n if (partset[j] === '**') {\n partset[j] = '*';\n }\n }\n }\n }\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n // aggressive optimization for the purpose of fs walking\n globParts = this.firstPhasePreProcess(globParts);\n globParts = this.secondPhasePreProcess(globParts);\n }\n else if (optimizationLevel >= 1) {\n // just basic optimizations to remove some .. parts\n globParts = this.levelOneOptimize(globParts);\n }\n else {\n // just collapse multiple ** portions into one\n globParts = this.adjascentGlobstarOptimize(globParts);\n }\n return globParts;\n }\n // just get rid of adjascent ** portions\n adjascentGlobstarOptimize(globParts) {\n return globParts.map(parts => {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let i = gs;\n while (parts[i + 1] === '**') {\n i++;\n }\n if (i !== gs) {\n parts.splice(gs, i - gs);\n }\n }\n return parts;\n });\n }\n // get rid of adjascent ** and resolve .. portions\n levelOneOptimize(globParts) {\n return globParts.map(parts => {\n parts = parts.reduce((set, part) => {\n const prev = set[set.length - 1];\n if (part === '**' && prev === '**') {\n return set;\n }\n if (part === '..') {\n if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n set.pop();\n return set;\n }\n }\n set.push(part);\n return set;\n }, []);\n return parts.length === 0 ? [''] : parts;\n });\n }\n levelTwoFileOptimize(parts) {\n if (!Array.isArray(parts)) {\n parts = this.slashSplit(parts);\n }\n let didSomething = false;\n do {\n didSomething = false;\n //
// -> 
/\n            if (!this.preserveMultipleSlashes) {\n                for (let i = 1; i < parts.length - 1; i++) {\n                    const p = parts[i];\n                    // don't squeeze out UNC patterns\n                    if (i === 1 && p === '' && parts[0] === '')\n                        continue;\n                    if (p === '.' || p === '') {\n                        didSomething = true;\n                        parts.splice(i, 1);\n                        i--;\n                    }\n                }\n                if (parts[0] === '.' &&\n                    parts.length === 2 &&\n                    (parts[1] === '.' || parts[1] === '')) {\n                    didSomething = true;\n                    parts.pop();\n                }\n            }\n            // 
/

/../ ->

/\n            let dd = 0;\n            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                const p = parts[dd - 1];\n                if (p &&\n                    p !== '.' &&\n                    p !== '..' &&\n                    p !== '**' &&\n                    !(this.isWindows && /^[a-z]:$/i.test(p))) {\n                    didSomething = true;\n                    parts.splice(dd - 1, 2);\n                    dd -= 2;\n                }\n            }\n        } while (didSomething);\n        return parts.length === 0 ? [''] : parts;\n    }\n    // First phase: single-pattern processing\n    // 
 is 1 or more portions\n    //  is 1 or more portions\n    // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n    // 
/

/../ ->

/\n    // **/**/ -> **/\n    //\n    // **/*/ -> */**/ <== not valid because ** doesn't follow\n    // this WOULD be allowed if ** did follow symlinks, or * didn't\n    firstPhasePreProcess(globParts) {\n        let didSomething = false;\n        do {\n            didSomething = false;\n            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss = gs;\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n                        gss++;\n                    }\n                    // eg, if gs is 2 and gss is 4, that means we have 3 **\n                    // parts, and can remove 2 of them.\n                    if (gss > gs) {\n                        parts.splice(gs + 1, gss - gs);\n                    }\n                    let next = parts[gs + 1];\n                    const p = parts[gs + 2];\n                    const p2 = parts[gs + 3];\n                    if (next !== '..')\n                        continue;\n                    if (!p ||\n                        p === '.' ||\n                        p === '..' ||\n                        !p2 ||\n                        p2 === '.' ||\n                        p2 === '..') {\n                        continue;\n                    }\n                    didSomething = true;\n                    // edit parts in place, and push the new one\n                    parts.splice(gs, 1);\n                    const other = parts.slice(0);\n                    other[gs] = '**';\n                    globParts.push(other);\n                    gs--;\n                }\n                // 
// -> 
/\n                if (!this.preserveMultipleSlashes) {\n                    for (let i = 1; i < parts.length - 1; i++) {\n                        const p = parts[i];\n                        // don't squeeze out UNC patterns\n                        if (i === 1 && p === '' && parts[0] === '')\n                            continue;\n                        if (p === '.' || p === '') {\n                            didSomething = true;\n                            parts.splice(i, 1);\n                            i--;\n                        }\n                    }\n                    if (parts[0] === '.' &&\n                        parts.length === 2 &&\n                        (parts[1] === '.' || parts[1] === '')) {\n                        didSomething = true;\n                        parts.pop();\n                    }\n                }\n                // 
/

/../ ->

/\n                let dd = 0;\n                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                    const p = parts[dd - 1];\n                    if (p && p !== '.' && p !== '..' && p !== '**') {\n                        didSomething = true;\n                        const needDot = dd === 1 && parts[dd + 1] === '**';\n                        const splin = needDot ? ['.'] : [];\n                        parts.splice(dd - 1, 2, ...splin);\n                        if (parts.length === 0)\n                            parts.push('');\n                        dd -= 2;\n                    }\n                }\n            }\n        } while (didSomething);\n        return globParts;\n    }\n    // second phase: multi-pattern dedupes\n    // {
/*/,
/

/} ->

/*/\n    // {
/,
/} -> 
/\n    // {
/**/,
/} -> 
/**/\n    //\n    // {
/**/,
/**/

/} ->

/**/\n    // ^-- not valid because ** doens't follow symlinks\n    secondPhasePreProcess(globParts) {\n        for (let i = 0; i < globParts.length - 1; i++) {\n            for (let j = i + 1; j < globParts.length; j++) {\n                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);\n                if (matched) {\n                    globParts[i] = [];\n                    globParts[j] = matched;\n                    break;\n                }\n            }\n        }\n        return globParts.filter(gs => gs.length);\n    }\n    partsMatch(a, b, emptyGSMatch = false) {\n        let ai = 0;\n        let bi = 0;\n        let result = [];\n        let which = '';\n        while (ai < a.length && bi < b.length) {\n            if (a[ai] === b[bi]) {\n                result.push(which === 'b' ? b[bi] : a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n                result.push(a[ai]);\n                ai++;\n            }\n            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n                result.push(b[bi]);\n                bi++;\n            }\n            else if (a[ai] === '*' &&\n                b[bi] &&\n                (this.options.dot || !b[bi].startsWith('.')) &&\n                b[bi] !== '**') {\n                if (which === 'b')\n                    return false;\n                which = 'a';\n                result.push(a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (b[bi] === '*' &&\n                a[ai] &&\n                (this.options.dot || !a[ai].startsWith('.')) &&\n                a[ai] !== '**') {\n                if (which === 'a')\n                    return false;\n                which = 'b';\n                result.push(b[bi]);\n                ai++;\n                bi++;\n            }\n            else {\n                return false;\n            }\n        }\n        // if we fall out of the loop, it means they two are identical\n        // as long as their lengths match\n        return a.length === b.length && result;\n    }\n    parseNegate() {\n        if (this.nonegate)\n            return;\n        const pattern = this.pattern;\n        let negate = false;\n        let negateOffset = 0;\n        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n            negate = !negate;\n            negateOffset++;\n        }\n        if (negateOffset)\n            this.pattern = pattern.slice(negateOffset);\n        this.negate = negate;\n    }\n    // set partial to true to test if, for example,\n    // \"/a/b\" matches the start of \"/*/b/*/d\"\n    // Partial means, if you run out of file before you run\n    // out of pattern, then that's fine, as long as all\n    // the parts match.\n    matchOne(file, pattern, partial = false) {\n        let fileStartIndex = 0;\n        let patternStartIndex = 0;\n        // UNC paths like //?/X:/... can match X:/... and vice versa\n        // Drive letters in absolute drive or unc paths are always compared\n        // case-insensitively.\n        if (this.isWindows) {\n            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);\n            const fileUNC = !fileDrive &&\n                file[0] === '' &&\n                file[1] === '' &&\n                file[2] === '?' &&\n                /^[a-z]:$/i.test(file[3]);\n            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);\n            const patternUNC = !patternDrive &&\n                pattern[0] === '' &&\n                pattern[1] === '' &&\n                pattern[2] === '?' &&\n                typeof pattern[3] === 'string' &&\n                /^[a-z]:$/i.test(pattern[3]);\n            const fdi = fileUNC ? 3\n                : fileDrive ? 0\n                    : undefined;\n            const pdi = patternUNC ? 3\n                : patternDrive ? 0\n                    : undefined;\n            if (typeof fdi === 'number' && typeof pdi === 'number') {\n                const [fd, pd] = [\n                    file[fdi],\n                    pattern[pdi],\n                ];\n                // start matching at the drive letter index of each\n                if (fd.toLowerCase() === pd.toLowerCase()) {\n                    pattern[pdi] = fd;\n                    patternStartIndex = pdi;\n                    fileStartIndex = fdi;\n                }\n            }\n        }\n        // resolve and reduce . and .. portions in the file as well.\n        // don't need to do the second phase, because it's only one string[]\n        const { optimizationLevel = 1 } = this.options;\n        if (optimizationLevel >= 2) {\n            file = this.levelTwoFileOptimize(file);\n        }\n        if (pattern.includes(GLOBSTAR)) {\n            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);\n        }\n        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);\n    }\n    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {\n        // split the pattern into head, tail, and middle of ** delimited parts\n        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);\n        const lastgs = pattern.lastIndexOf(GLOBSTAR);\n        // split the pattern up into globstar-delimited sections\n        // the tail has to be at the end, and the others just have\n        // to be found in order from the head.\n        const [head, body, tail] = partial ?\n            [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1),\n                [],\n            ]\n            : [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1, lastgs),\n                pattern.slice(lastgs + 1),\n            ];\n        // check the head, from the current file/pattern index.\n        if (head.length) {\n            const fileHead = file.slice(fileIndex, fileIndex + head.length);\n            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n                return false;\n            }\n            fileIndex += head.length;\n            patternIndex += head.length;\n        }\n        // now we know the head matches!\n        // if the last portion is not empty, it MUST match the end\n        // check the tail\n        let fileTailMatch = 0;\n        if (tail.length) {\n            // if head + tail > file, then we cannot possibly match\n            if (tail.length + fileIndex > file.length)\n                return false;\n            // try to match the tail\n            let tailStart = file.length - tail.length;\n            if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n                fileTailMatch = tail.length;\n            }\n            else {\n                // affordance for stuff like a/**/* matching a/b/\n                // if the last file portion is '', and there's more to the pattern\n                // then try without the '' bit.\n                if (file[file.length - 1] !== '' ||\n                    fileIndex + tail.length === file.length) {\n                    return false;\n                }\n                tailStart--;\n                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n                    return false;\n                }\n                fileTailMatch = tail.length + 1;\n            }\n        }\n        // now we know the tail matches!\n        // the middle is zero or more portions wrapped in **, possibly\n        // containing more ** sections.\n        // so a/**/b/**/c/**/d has become **/b/**/c/**\n        // if it's empty, it means a/**/b, just verify we have no bad dots\n        // if there's no tail, so it ends on /**, then we must have *something*\n        // after the head, or it's not a matc\n        if (!body.length) {\n            let sawSome = !!fileTailMatch;\n            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n                const f = String(file[i]);\n                sawSome = true;\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            // in partial mode, we just need to get past all file parts\n            return partial || sawSome;\n        }\n        // now we know that there's one or more body sections, which can\n        // be matched anywhere from the 0 index (because the head was pruned)\n        // through to the length-fileTailMatch index.\n        // split the body up into sections, and note the minimum index it can\n        // be found at (start with the length of all previous segments)\n        // [section, before, after]\n        const bodySegments = [[[], 0]];\n        let currentBody = bodySegments[0];\n        let nonGsParts = 0;\n        const nonGsPartsSums = [0];\n        for (const b of body) {\n            if (b === GLOBSTAR) {\n                nonGsPartsSums.push(nonGsParts);\n                currentBody = [[], 0];\n                bodySegments.push(currentBody);\n            }\n            else {\n                currentBody[0].push(b);\n                nonGsParts++;\n            }\n        }\n        let i = bodySegments.length - 1;\n        const fileLength = file.length - fileTailMatch;\n        for (const b of bodySegments) {\n            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);\n        }\n        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);\n    }\n    // return false for \"nope, not matching\"\n    // return null for \"not matching, cannot keep trying\"\n    #matchGlobStarBodySections(file, \n    // pattern section, last possible position for it\n    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {\n        // take the first body segment, and walk from fileIndex to its \"after\"\n        // value at the end\n        // If it doesn't match at that position, we increment, until we hit\n        // that final possible position, and give up.\n        // If it does match, then advance and try to rest.\n        // If any of them fail we keep walking forward.\n        // this is still a bit recursively painful, but it's more constrained\n        // than previous implementations, because we never test something that\n        // can't possibly be a valid matching condition.\n        const bs = bodySegments[bodyIndex];\n        if (!bs) {\n            // just make sure that there's no bad dots\n            for (let i = fileIndex; i < file.length; i++) {\n                sawTail = true;\n                const f = file[i];\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            return sawTail;\n        }\n        // have a non-globstar body section to test\n        const [body, after] = bs;\n        while (fileIndex <= after) {\n            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);\n            // if limit exceeded, no match. intentional false negative,\n            // acceptable break in correctness for security.\n            if (m && globStarDepth < this.maxGlobstarRecursion) {\n                // match! see if the rest match. if so, we're done!\n                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);\n                if (sub !== false) {\n                    return sub;\n                }\n            }\n            const f = file[fileIndex];\n            if (f === '.' ||\n                f === '..' ||\n                (!this.options.dot && f.startsWith('.'))) {\n                return false;\n            }\n            fileIndex++;\n        }\n        // walked off. no point continuing\n        return partial || null;\n    }\n    #matchOne(file, pattern, partial, fileIndex, patternIndex) {\n        let fi;\n        let pi;\n        let pl;\n        let fl;\n        for (fi = fileIndex,\n            pi = patternIndex,\n            fl = file.length,\n            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {\n            this.debug('matchOne loop');\n            let p = pattern[pi];\n            let f = file[fi];\n            this.debug(pattern, p, f);\n            // should be impossible.\n            // some invalid regexp stuff in the set.\n            /* c8 ignore start */\n            if (p === false || p === GLOBSTAR) {\n                return false;\n            }\n            /* c8 ignore stop */\n            // something other than **\n            // non-magic patterns just have to match exactly\n            // patterns with magic have been turned into regexps.\n            let hit;\n            if (typeof p === 'string') {\n                hit = f === p;\n                this.debug('string match', p, f, hit);\n            }\n            else {\n                hit = p.test(f);\n                this.debug('pattern match', p, f, hit);\n            }\n            if (!hit)\n                return false;\n        }\n        // Note: ending in / means that we'll get a final \"\"\n        // at the end of the pattern.  This can only match a\n        // corresponding \"\" at the end of the file.\n        // If the file ends in /, then it can only match a\n        // a pattern that ends in /, unless the pattern just\n        // doesn't have any more for it. But, a/b/ should *not*\n        // match \"a/b/*\", even though \"\" matches against the\n        // [^/]*? pattern, except in partial mode, where it might\n        // simply not be reached yet.\n        // However, a/b/ should still satisfy a/*\n        // now either we fell off the end of the pattern, or we're done.\n        if (fi === fl && pi === pl) {\n            // ran out of pattern and filename at the same time.\n            // an exact hit!\n            return true;\n        }\n        else if (fi === fl) {\n            // ran out of file, but still had pattern left.\n            // this is ok if we're doing the match as part of\n            // a glob fs traversal.\n            return partial;\n        }\n        else if (pi === pl) {\n            // ran out of pattern, still have file left.\n            // this is only acceptable if we're on the very last\n            // empty segment of a file with a trailing slash.\n            // a/* should match a/b/\n            return fi === fl - 1 && file[fi] === '';\n            /* c8 ignore start */\n        }\n        else {\n            // should be unreachable.\n            throw new Error('wtf?');\n        }\n        /* c8 ignore stop */\n    }\n    braceExpand() {\n        return braceExpand(this.pattern, this.options);\n    }\n    parse(pattern) {\n        assertValidPattern(pattern);\n        const options = this.options;\n        // shortcuts\n        if (pattern === '**')\n            return GLOBSTAR;\n        if (pattern === '')\n            return '';\n        // far and away, the most common glob pattern parts are\n        // *, *.*, and *.  Add a fast check method for those.\n        let m;\n        let fastTest = null;\n        if ((m = pattern.match(starRE))) {\n            fastTest = options.dot ? starTestDot : starTest;\n        }\n        else if ((m = pattern.match(starDotExtRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    starDotExtTestNocaseDot\n                    : starDotExtTestNocase\n                : options.dot ? starDotExtTestDot\n                    : starDotExtTest)(m[1]);\n        }\n        else if ((m = pattern.match(qmarksRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    qmarksTestNocaseDot\n                    : qmarksTestNocase\n                : options.dot ? qmarksTestDot\n                    : qmarksTest)(m);\n        }\n        else if ((m = pattern.match(starDotStarRE))) {\n            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;\n        }\n        else if ((m = pattern.match(dotStarRE))) {\n            fastTest = dotStarTest;\n        }\n        const re = AST.fromGlob(pattern, this.options).toMMPattern();\n        if (fastTest && typeof re === 'object') {\n            // Avoids overriding in frozen environments\n            Reflect.defineProperty(re, 'test', { value: fastTest });\n        }\n        return re;\n    }\n    makeRe() {\n        if (this.regexp || this.regexp === false)\n            return this.regexp;\n        // at this point, this.set is a 2d array of partial\n        // pattern strings, or \"**\".\n        //\n        // It's better to use .match().  This function shouldn't\n        // be used, really, but it's pretty convenient sometimes,\n        // when you just want to work with a regex.\n        const set = this.set;\n        if (!set.length) {\n            this.regexp = false;\n            return this.regexp;\n        }\n        const options = this.options;\n        const twoStar = options.noglobstar ? star\n            : options.dot ? twoStarDot\n                : twoStarNoDot;\n        const flags = new Set(options.nocase ? ['i'] : []);\n        // regexpify non-globstar patterns\n        // if ** is only item, then we just do one twoStar\n        // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n        // if ** is last, append (\\/twoStar|) to previous\n        // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n        // then filter out GLOBSTAR symbols\n        let re = set\n            .map(pattern => {\n            const pp = pattern.map(p => {\n                if (p instanceof RegExp) {\n                    for (const f of p.flags.split(''))\n                        flags.add(f);\n                }\n                return (typeof p === 'string' ? regExpEscape(p)\n                    : p === GLOBSTAR ? GLOBSTAR\n                        : p._src);\n            });\n            pp.forEach((p, i) => {\n                const next = pp[i + 1];\n                const prev = pp[i - 1];\n                if (p !== GLOBSTAR || prev === GLOBSTAR) {\n                    return;\n                }\n                if (prev === undefined) {\n                    if (next !== undefined && next !== GLOBSTAR) {\n                        pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next;\n                    }\n                    else {\n                        pp[i] = twoStar;\n                    }\n                }\n                else if (next === undefined) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?';\n                }\n                else if (next !== GLOBSTAR) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next;\n                    pp[i + 1] = GLOBSTAR;\n                }\n            });\n            const filtered = pp.filter(p => p !== GLOBSTAR);\n            // For partial matches, we need to make the pattern match\n            // any prefix of the full path. We do this by generating\n            // alternative patterns that match progressively longer prefixes.\n            if (this.partial && filtered.length >= 1) {\n                const prefixes = [];\n                for (let i = 1; i <= filtered.length; i++) {\n                    prefixes.push(filtered.slice(0, i).join('/'));\n                }\n                return '(?:' + prefixes.join('|') + ')';\n            }\n            return filtered.join('/');\n        })\n            .join('|');\n        // need to wrap in parens if we had more than one thing with |,\n        // otherwise only the first will be anchored to ^ and the last to $\n        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];\n        // must match entire pattern\n        // ending in a * or ** will make it less strict.\n        re = '^' + open + re + close + '$';\n        // In partial mode, '/' should always match as it's a valid prefix for any pattern\n        if (this.partial) {\n            re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$';\n        }\n        // can match anything, as long as it's not this.\n        if (this.negate)\n            re = '^(?!' + re + ').+$';\n        try {\n            this.regexp = new RegExp(re, [...flags].join(''));\n            /* c8 ignore start */\n        }\n        catch {\n            // should be impossible\n            this.regexp = false;\n        }\n        /* c8 ignore stop */\n        return this.regexp;\n    }\n    slashSplit(p) {\n        // if p starts with // on windows, we preserve that\n        // so that UNC paths aren't broken.  Otherwise, any number of\n        // / characters are coalesced into one, unless\n        // preserveMultipleSlashes is set to true.\n        if (this.preserveMultipleSlashes) {\n            return p.split('/');\n        }\n        else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n            // add an extra '' for the one we lose\n            return ['', ...p.split(/\\/+/)];\n        }\n        else {\n            return p.split(/\\/+/);\n        }\n    }\n    match(f, partial = this.partial) {\n        this.debug('match', f, this.pattern);\n        // short-circuit in the case of busted things.\n        // comments, etc.\n        if (this.comment) {\n            return false;\n        }\n        if (this.empty) {\n            return f === '';\n        }\n        if (f === '/' && partial) {\n            return true;\n        }\n        const options = this.options;\n        // windows: need to use /, not \\\n        if (this.isWindows) {\n            f = f.split('\\\\').join('/');\n        }\n        // treat the test path as a set of pathparts.\n        const ff = this.slashSplit(f);\n        this.debug(this.pattern, 'split', ff);\n        // just ONE of the pattern sets in this.set needs to match\n        // in order for it to be valid.  If negating, then just one\n        // match means that we have failed.\n        // Either way, return on the first hit.\n        const set = this.set;\n        this.debug(this.pattern, 'set', set);\n        // Find the basename of the path by looking for the last non-empty segment\n        let filename = ff[ff.length - 1];\n        if (!filename) {\n            for (let i = ff.length - 2; !filename && i >= 0; i--) {\n                filename = ff[i];\n            }\n        }\n        for (const pattern of set) {\n            let file = ff;\n            if (options.matchBase && pattern.length === 1) {\n                file = [filename];\n            }\n            const hit = this.matchOne(file, pattern, partial);\n            if (hit) {\n                if (options.flipNegate) {\n                    return true;\n                }\n                return !this.negate;\n            }\n        }\n        // didn't get any hits.  this is success if it's a negative\n        // pattern, failure otherwise.\n        if (options.flipNegate) {\n            return false;\n        }\n        return this.negate;\n    }\n    static defaults(def) {\n        return minimatch.defaults(def).Minimatch;\n    }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js';\nexport { escape } from './escape.js';\nexport { unescape } from './unescape.js';\n/* c8 ignore stop */\nminimatch.AST = AST;\nminimatch.Minimatch = Minimatch;\nminimatch.escape = escape;\nminimatch.unescape = unescape;\n//# sourceMappingURL=index.js.map","import * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Helper class for parsing paths into segments\n */\nexport class Path {\n    /**\n     * Constructs a Path\n     * @param itemPath Path or array of segments\n     */\n    constructor(itemPath) {\n        this.segments = [];\n        // String\n        if (typeof itemPath === 'string') {\n            assert(itemPath, `Parameter 'itemPath' must not be empty`);\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n            // Not rooted\n            if (!pathHelper.hasRoot(itemPath)) {\n                this.segments = itemPath.split(path.sep);\n            }\n            // Rooted\n            else {\n                // Add all segments, while not at the root\n                let remaining = itemPath;\n                let dir = pathHelper.dirname(remaining);\n                while (dir !== remaining) {\n                    // Add the segment\n                    const basename = path.basename(remaining);\n                    this.segments.unshift(basename);\n                    // Truncate the last segment\n                    remaining = dir;\n                    dir = pathHelper.dirname(remaining);\n                }\n                // Remainder is the root\n                this.segments.unshift(remaining);\n            }\n        }\n        // Array\n        else {\n            // Must not be empty\n            assert(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);\n            // Each segment\n            for (let i = 0; i < itemPath.length; i++) {\n                let segment = itemPath[i];\n                // Must not be empty\n                assert(segment, `Parameter 'itemPath' must not contain any empty segments`);\n                // Normalize slashes\n                segment = pathHelper.normalizeSeparators(itemPath[i]);\n                // Root segment\n                if (i === 0 && pathHelper.hasRoot(segment)) {\n                    segment = pathHelper.safeTrimTrailingSeparator(segment);\n                    assert(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);\n                    this.segments.push(segment);\n                }\n                // All other segments\n                else {\n                    // Must not contain slash\n                    assert(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);\n                    this.segments.push(segment);\n                }\n            }\n        }\n    }\n    /**\n     * Converts the path to it's string representation\n     */\n    toString() {\n        // First segment\n        let result = this.segments[0];\n        // All others\n        let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n        for (let i = 1; i < this.segments.length; i++) {\n            if (skipSlash) {\n                skipSlash = false;\n            }\n            else {\n                result += path.sep;\n            }\n            result += this.segments[i];\n        }\n        return result;\n    }\n}\n//# sourceMappingURL=internal-path.js.map","import * as os from 'os';\nimport * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nimport { Minimatch } from 'minimatch';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Path } from './internal-path.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class Pattern {\n    constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) {\n        /**\n         * Indicates whether matches should be excluded from the result set\n         */\n        this.negate = false;\n        // Pattern overload\n        let pattern;\n        if (typeof patternOrNegate === 'string') {\n            pattern = patternOrNegate.trim();\n        }\n        // Segments overload\n        else {\n            // Convert to pattern\n            segments = segments || [];\n            assert(segments.length, `Parameter 'segments' must not empty`);\n            const root = Pattern.getLiteral(segments[0]);\n            assert(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);\n            pattern = new Path(segments).toString().trim();\n            if (patternOrNegate) {\n                pattern = `!${pattern}`;\n            }\n        }\n        // Negate\n        while (pattern.startsWith('!')) {\n            this.negate = !this.negate;\n            pattern = pattern.substr(1).trim();\n        }\n        // Normalize slashes and ensures absolute root\n        pattern = Pattern.fixupPattern(pattern, homedir);\n        // Segments\n        this.segments = new Path(pattern).segments;\n        // Trailing slash indicates the pattern should only match directories, not regular files\n        this.trailingSeparator = pathHelper\n            .normalizeSeparators(pattern)\n            .endsWith(path.sep);\n        pattern = pathHelper.safeTrimTrailingSeparator(pattern);\n        // Search path (literal path prior to the first glob segment)\n        let foundGlob = false;\n        const searchSegments = this.segments\n            .map(x => Pattern.getLiteral(x))\n            .filter(x => !foundGlob && !(foundGlob = x === ''));\n        this.searchPath = new Path(searchSegments).toString();\n        // Root RegExp (required when determining partial match)\n        this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : '');\n        this.isImplicitPattern = isImplicitPattern;\n        // Create minimatch\n        const minimatchOptions = {\n            dot: true,\n            nobrace: true,\n            nocase: IS_WINDOWS,\n            nocomment: true,\n            noext: true,\n            nonegate: true\n        };\n        pattern = IS_WINDOWS ? pattern.replace(/\\\\/g, '/') : pattern;\n        this.minimatch = new Minimatch(pattern, minimatchOptions);\n    }\n    /**\n     * Matches the pattern against the specified path\n     */\n    match(itemPath) {\n        // Last segment is globstar?\n        if (this.segments[this.segments.length - 1] === '**') {\n            // Normalize slashes\n            itemPath = pathHelper.normalizeSeparators(itemPath);\n            // Append a trailing slash. Otherwise Minimatch will not match the directory immediately\n            // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns\n            // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.\n            if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) {\n                // Note, this is safe because the constructor ensures the pattern has an absolute root.\n                // For example, formats like C: and C:foo on Windows are resolved to an absolute root.\n                itemPath = `${itemPath}${path.sep}`;\n            }\n        }\n        else {\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        }\n        // Match\n        if (this.minimatch.match(itemPath)) {\n            return this.trailingSeparator ? MatchKind.Directory : MatchKind.All;\n        }\n        return MatchKind.None;\n    }\n    /**\n     * Indicates whether the pattern may match descendants of the specified path\n     */\n    partialMatch(itemPath) {\n        // Normalize slashes and trim unnecessary trailing slash\n        itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        // matchOne does not handle root path correctly\n        if (pathHelper.dirname(itemPath) === itemPath) {\n            return this.rootRegExp.test(itemPath);\n        }\n        return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\\\+/ : /\\/+/), this.minimatch.set[0], true);\n    }\n    /**\n     * Escapes glob patterns within a path\n     */\n    static globEscape(s) {\n        return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n            .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n            .replace(/\\?/g, '[?]') // escape '?'\n            .replace(/\\*/g, '[*]'); // escape '*'\n    }\n    /**\n     * Normalizes slashes and ensures absolute root\n     */\n    static fixupPattern(pattern, homedir) {\n        // Empty\n        assert(pattern, 'pattern cannot be empty');\n        // Must not contain `.` segment, unless first segment\n        // Must not contain `..` segment\n        const literalSegments = new Path(pattern).segments.map(x => Pattern.getLiteral(x));\n        assert(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);\n        // Must not contain globs in root, e.g. Windows UNC path \\\\foo\\b*r\n        assert(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);\n        // Normalize slashes\n        pattern = pathHelper.normalizeSeparators(pattern);\n        // Replace leading `.` segment\n        if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) {\n            pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1);\n        }\n        // Replace leading `~` segment\n        else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {\n            homedir = homedir || os.homedir();\n            assert(homedir, 'Unable to determine HOME directory');\n            assert(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);\n            pattern = Pattern.globEscape(homedir) + pattern.substr(1);\n        }\n        // Replace relative drive root, e.g. pattern is C: or C:foo\n        else if (IS_WINDOWS &&\n            (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\\\]/i))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', pattern.substr(0, 2));\n            if (pattern.length > 2 && !root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(2);\n        }\n        // Replace relative root, e.g. pattern is \\ or \\foo\n        else if (IS_WINDOWS && (pattern === '\\\\' || pattern.match(/^\\\\[^\\\\]/))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', '\\\\');\n            if (!root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(1);\n        }\n        // Otherwise ensure absolute root\n        else {\n            pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern);\n        }\n        return pathHelper.normalizeSeparators(pattern);\n    }\n    /**\n     * Attempts to unescape a pattern segment to create a literal path segment.\n     * Otherwise returns empty string.\n     */\n    static getLiteral(segment) {\n        let literal = '';\n        for (let i = 0; i < segment.length; i++) {\n            const c = segment[i];\n            // Escape\n            if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n                literal += segment[++i];\n                continue;\n            }\n            // Wildcard\n            else if (c === '*' || c === '?') {\n                return '';\n            }\n            // Character set\n            else if (c === '[' && i + 1 < segment.length) {\n                let set = '';\n                let closed = -1;\n                for (let i2 = i + 1; i2 < segment.length; i2++) {\n                    const c2 = segment[i2];\n                    // Escape\n                    if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n                        set += segment[++i2];\n                        continue;\n                    }\n                    // Closed\n                    else if (c2 === ']') {\n                        closed = i2;\n                        break;\n                    }\n                    // Otherwise\n                    else {\n                        set += c2;\n                    }\n                }\n                // Closed?\n                if (closed >= 0) {\n                    // Cannot convert\n                    if (set.length > 1) {\n                        return '';\n                    }\n                    // Convert to literal\n                    if (set) {\n                        literal += set;\n                        i = closed;\n                        continue;\n                    }\n                }\n                // Otherwise fall thru\n            }\n            // Append\n            literal += c;\n        }\n        return literal;\n    }\n    /**\n     * Escapes regexp special characters\n     * https://javascript.info/regexp-escaping\n     */\n    static regExpEscape(s) {\n        return s.replace(/[[\\\\^$.|?*+()]/g, '\\\\$&');\n    }\n}\n//# sourceMappingURL=internal-pattern.js.map","export class SearchState {\n    constructor(path, level) {\n        this.path = path;\n        this.level = level;\n    }\n}\n//# sourceMappingURL=internal-search-state.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\n    return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n    function fulfill(value) { resume(\"next\", value); }\n    function reject(value) { resume(\"throw\", value); }\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as globOptionsHelper from './internal-glob-options-helper.js';\nimport * as path from 'path';\nimport * as patternHelper from './internal-pattern-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Pattern } from './internal-pattern.js';\nimport { SearchState } from './internal-search-state.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class DefaultGlobber {\n    constructor(options) {\n        this.patterns = [];\n        this.searchPaths = [];\n        this.options = globOptionsHelper.getOptions(options);\n    }\n    getSearchPaths() {\n        // Return a copy\n        return this.searchPaths.slice();\n    }\n    glob() {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a, e_1, _b, _c;\n            const result = [];\n            try {\n                for (var _d = true, _e = __asyncValues(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {\n                    _c = _f.value;\n                    _d = false;\n                    const itemPath = _c;\n                    result.push(itemPath);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            return result;\n        });\n    }\n    globGenerator() {\n        return __asyncGenerator(this, arguments, function* globGenerator_1() {\n            // Fill in defaults options\n            const options = globOptionsHelper.getOptions(this.options);\n            // Implicit descendants?\n            const patterns = [];\n            for (const pattern of this.patterns) {\n                patterns.push(pattern);\n                if (options.implicitDescendants &&\n                    (pattern.trailingSeparator ||\n                        pattern.segments[pattern.segments.length - 1] !== '**')) {\n                    patterns.push(new Pattern(pattern.negate, true, pattern.segments.concat('**')));\n                }\n            }\n            // Push the search paths\n            const stack = [];\n            for (const searchPath of patternHelper.getSearchPaths(patterns)) {\n                core.debug(`Search path '${searchPath}'`);\n                // Exists?\n                try {\n                    // Intentionally using lstat. Detection for broken symlink\n                    // will be performed later (if following symlinks).\n                    yield __await(fs.promises.lstat(searchPath));\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        continue;\n                    }\n                    throw err;\n                }\n                stack.unshift(new SearchState(searchPath, 1));\n            }\n            // Search\n            const traversalChain = []; // used to detect cycles\n            while (stack.length) {\n                // Pop\n                const item = stack.pop();\n                // Match?\n                const match = patternHelper.match(patterns, item.path);\n                const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path);\n                if (!match && !partialMatch) {\n                    continue;\n                }\n                // Stat\n                const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain)\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                );\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                if (!stats) {\n                    continue;\n                }\n                // Hidden file or directory?\n                if (options.excludeHiddenFiles && path.basename(item.path).match(/^\\./)) {\n                    continue;\n                }\n                // Directory\n                if (stats.isDirectory()) {\n                    // Matched\n                    if (match & MatchKind.Directory && options.matchDirectories) {\n                        yield yield __await(item.path);\n                    }\n                    // Descend?\n                    else if (!partialMatch) {\n                        continue;\n                    }\n                    // Push the child items in reverse\n                    const childLevel = item.level + 1;\n                    const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new SearchState(path.join(item.path, x), childLevel));\n                    stack.push(...childItems.reverse());\n                }\n                // File\n                else if (match & MatchKind.File) {\n                    yield yield __await(item.path);\n                }\n            }\n        });\n    }\n    /**\n     * Constructs a DefaultGlobber\n     */\n    static create(patterns, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const result = new DefaultGlobber(options);\n            if (IS_WINDOWS) {\n                patterns = patterns.replace(/\\r\\n/g, '\\n');\n                patterns = patterns.replace(/\\r/g, '\\n');\n            }\n            const lines = patterns.split('\\n').map(x => x.trim());\n            for (const line of lines) {\n                // Empty or comment\n                if (!line || line.startsWith('#')) {\n                    continue;\n                }\n                // Pattern\n                else {\n                    result.patterns.push(new Pattern(line));\n                }\n            }\n            result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns));\n            return result;\n        });\n    }\n    static stat(item, options, traversalChain) {\n        return __awaiter(this, void 0, void 0, function* () {\n            // Note:\n            // `stat` returns info about the target of a symlink (or symlink chain)\n            // `lstat` returns info about a symlink itself\n            let stats;\n            if (options.followSymbolicLinks) {\n                try {\n                    // Use `stat` (following symlinks)\n                    stats = yield fs.promises.stat(item.path);\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        if (options.omitBrokenSymbolicLinks) {\n                            core.debug(`Broken symlink '${item.path}'`);\n                            return undefined;\n                        }\n                        throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);\n                    }\n                    throw err;\n                }\n            }\n            else {\n                // Use `lstat` (not following symlinks)\n                stats = yield fs.promises.lstat(item.path);\n            }\n            // Note, isDirectory() returns false for the lstat of a symlink\n            if (stats.isDirectory() && options.followSymbolicLinks) {\n                // Get the realpath\n                const realPath = yield fs.promises.realpath(item.path);\n                // Fixup the traversal chain to match the item level\n                while (traversalChain.length >= item.level) {\n                    traversalChain.pop();\n                }\n                // Test for a cycle\n                if (traversalChain.some((x) => x === realPath)) {\n                    core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);\n                    return undefined;\n                }\n                // Update the traversal chain\n                traversalChain.push(realPath);\n            }\n            return stats;\n        });\n    }\n}\n//# sourceMappingURL=internal-globber.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"stream\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nimport * as crypto from 'crypto';\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as stream from 'stream';\nimport * as util from 'util';\nimport * as path from 'path';\nexport function hashFiles(globber_1, currentWorkspace_1) {\n    return __awaiter(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) {\n        var _a, e_1, _b, _c;\n        var _d;\n        const writeDelegate = verbose ? core.info : core.debug;\n        let hasMatch = false;\n        const githubWorkspace = currentWorkspace\n            ? currentWorkspace\n            : ((_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd());\n        const result = crypto.createHash('sha256');\n        let count = 0;\n        try {\n            for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {\n                _c = _g.value;\n                _e = false;\n                const file = _c;\n                writeDelegate(file);\n                if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {\n                    writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);\n                    continue;\n                }\n                if (fs.statSync(file).isDirectory()) {\n                    writeDelegate(`Skip directory '${file}'.`);\n                    continue;\n                }\n                const hash = crypto.createHash('sha256');\n                const pipeline = util.promisify(stream.pipeline);\n                yield pipeline(fs.createReadStream(file), hash);\n                result.write(hash.digest());\n                count++;\n                if (!hasMatch) {\n                    hasMatch = true;\n                }\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        result.end();\n        if (hasMatch) {\n            writeDelegate(`Found ${count} files to hash.`);\n            return result.digest('hex');\n        }\n        else {\n            writeDelegate(`No matches found for glob`);\n            return '';\n        }\n    });\n}\n//# sourceMappingURL=internal-hash-files.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { DefaultGlobber } from './internal-globber.js';\nimport { hashFiles as _hashFiles } from './internal-hash-files.js';\n/**\n * Constructs a globber\n *\n * @param patterns  Patterns separated by newlines\n * @param options   Glob options\n */\nexport function create(patterns, options) {\n    return __awaiter(this, void 0, void 0, function* () {\n        return yield DefaultGlobber.create(patterns, options);\n    });\n}\n/**\n * Computes the sha256 hash of a glob\n *\n * @param patterns  Patterns separated by newlines\n * @param currentWorkspace  Workspace used when matching files\n * @param options   Glob options\n * @param verbose   Enables verbose logging\n */\nexport function hashFiles(patterns_1) {\n    return __awaiter(this, arguments, void 0, function* (patterns, currentWorkspace = '', options, verbose = false) {\n        let followSymbolicLinks = true;\n        if (options && typeof options.followSymbolicLinks === 'boolean') {\n            followSymbolicLinks = options.followSymbolicLinks;\n        }\n        const globber = yield create(patterns, { followSymbolicLinks });\n        return _hashFiles(globber, currentWorkspace, verbose);\n    });\n}\n//# sourceMappingURL=glob.js.map","import { createReadStream } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { basename, posix, relative, resolve, sep } from 'node:path'\nimport { Readable } from 'node:stream'\nimport * as core from '@actions/core'\nimport * as glob from '@actions/glob'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { StreamSource } from '@backblaze-labs/b2-sdk/streams'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link UploadResult.files}. */\nexport interface UploadedFile {\n  /** Absolute path on the runner that was uploaded. */\n  localPath: string\n  /** B2 file name (the key) the upload landed under. */\n  fileName: string\n  /** B2 file ID assigned by the server. */\n  fileId: string\n  /** Byte size of the upload. */\n  size: number\n  /** Whole-file SHA-1, or `null` when the file was multipart-uploaded. */\n  contentSha1: string | null\n}\n\n/** Result of {@link uploadCommand}. */\nexport interface UploadResult {\n  /** One entry per uploaded file. Single-file mode returns a one-element array. */\n  files: UploadedFile[]\n  /** Total bytes uploaded across all files. */\n  bytesTransferred: number\n}\n\n/**\n * Upload one or more files to B2.\n *\n * Mode selection:\n *   - If `source` is a plain file path (no glob metacharacters and the path\n *     exists as a regular file), upload that single file. The B2 file name is\n *     `destination` if set; otherwise `basename(source)`.\n *   - Otherwise treat `source` (plus any `include` patterns) as glob(s). Each\n *     matched file is uploaded preserving its path relative to the glob root,\n *     prefixed by `destination` (default empty).\n *\n * Large files are streamed (StreamSource over a fs ReadStream-as-Web-Stream)\n * so we don't buffer the whole payload in RAM. The SDK's `Bucket.upload`\n * routes to multipart automatically when size exceeds the recommended part\n * size and parallelizes parts up to `concurrency`.\n */\nexport async function uploadCommand(\n  bucket: Bucket,\n  inputs: ParsedInputs,\n  signal?: AbortSignal,\n): Promise {\n  const source = requireSource(inputs.source, 'upload')\n\n  const { files, isSingleExplicitFile } = await resolveFiles(source, inputs.include, inputs.exclude)\n  if (files.length === 0) {\n    if (inputs.failOnEmpty) {\n      throw new Error(`No files matched: ${source}`)\n    }\n    core.warning(`No files matched: ${source}`)\n    return { files: [], bytesTransferred: 0 }\n  }\n\n  const fileConcurrency = isSingleExplicitFile ? 1 : inputs.concurrency\n  // Multi-file uploads spend the concurrency budget across files and keep each\n  // file's multipart upload sequential so total in-flight B2 requests remain\n  // bounded by the user-supplied `concurrency` value.\n  const partConcurrency = isSingleExplicitFile || files.length === 1 ? inputs.concurrency : 1\n\n  const uploaded = await mapWithConcurrency(files, fileConcurrency, async (f) => {\n    signal?.throwIfAborted()\n    const fileName = remapFileName(f, inputs.destination, isSingleExplicitFile)\n    const uploadLabel = `upload ${f.localPath} → b2://${bucket.name}/${fileName}`\n    const groupedLog = files.length === 1 || fileConcurrency === 1\n    if (groupedLog) {\n      core.startGroup(uploadLabel)\n    } else {\n      core.info(uploadLabel)\n    }\n    try {\n      return await uploadOne(\n        bucket,\n        f.localPath,\n        fileName,\n        inputs,\n        partConcurrency,\n        groupedLog,\n        signal,\n      )\n    } finally {\n      if (groupedLog) core.endGroup()\n    }\n  })\n  const totalBytes = uploaded.reduce((sum, file) => sum + file.size, 0)\n\n  return { files: uploaded, bytesTransferred: totalBytes }\n}\n\nasync function mapWithConcurrency(\n  items: T[],\n  concurrency: number,\n  mapper: (item: T) => Promise,\n): Promise {\n  const results = new Array(items.length)\n  let next = 0\n  let firstError: unknown\n  let failed = false\n\n  async function worker(): Promise {\n    while (true) {\n      if (failed) return\n      const index = next++\n      if (index >= items.length) return\n      try {\n        results[index] = await mapper(items[index] as T)\n      } catch (error) {\n        if (!failed) {\n          failed = true\n          firstError = error\n        }\n        return\n      }\n    }\n  }\n\n  const workerCount = Math.min(concurrency, items.length)\n  await Promise.all(Array.from({ length: workerCount }, () => worker()))\n  if (failed) throw firstError\n  return results\n}\n\ninterface ResolvedFiles {\n  files: ResolvedFile[]\n  isSingleExplicitFile: boolean\n}\n\n/**\n * Local file resolved from an upload source.\n *\n * @internal\n */\nexport interface ResolvedFile {\n  localPath: string\n  /** Path relative to the glob root, used when computing the B2 key. */\n  fileName: string\n}\n\nasync function resolveFiles(\n  source: string,\n  include: string[],\n  exclude: string[],\n): Promise {\n  const explicitFile = await tryStat(source)\n  const looksLikeGlob = /[*?[\\]]/.test(source)\n\n  if (explicitFile?.isFile() && !looksLikeGlob && include.length === 0) {\n    return {\n      files: [{ localPath: resolve(source), fileName: basename(source) }],\n      isSingleExplicitFile: true,\n    }\n  }\n\n  const patterns: string[] = []\n  if (explicitFile?.isDirectory()) {\n    patterns.push(`${resolve(source)}/**`)\n  } else {\n    patterns.push(source)\n  }\n  for (const p of include) patterns.push(p)\n  for (const p of exclude) patterns.push(`!${p}`)\n\n  const globber = await glob.create(patterns.join('\\n'), {\n    followSymbolicLinks: false,\n    matchDirectories: false,\n  })\n  const matches = await globber.glob()\n  const root = explicitFile?.isDirectory() ? resolve(source) : process.cwd()\n\n  const out: ResolvedFile[] = []\n  for (const m of matches) {\n    const s = await tryStat(m)\n    // Filesystem boundary: skip entries that aren't readable files (broken\n    // symlinks, races where a file is unlinked between glob and stat, etc.).\n    if (!s?.isFile()) continue\n    const rel = relative(root, m).split(sep).join(posix.sep)\n    out.push({ localPath: m, fileName: rel })\n  }\n  out.sort(compareResolvedFiles)\n  return { files: out, isSingleExplicitFile: false }\n}\n\nfunction compareResolvedFiles(a: ResolvedFile, b: ResolvedFile): number {\n  return compareStrings(a.fileName, b.fileName) || compareStrings(a.localPath, b.localPath)\n}\n\nfunction compareStrings(a: string, b: string): number {\n  if (a < b) return -1\n  if (a > b) return 1\n  return 0\n}\n\n/**\n * Map a local source file to its B2 file name under the requested destination.\n *\n * @internal\n */\nexport function remapFileName(\n  file: ResolvedFile,\n  destination: string | undefined,\n  isSingleExplicitFile: boolean,\n): string {\n  if (destination === undefined || destination === '') return file.fileName\n  const dest = destination.replace(/\\/+$/, '')\n  if (isSingleExplicitFile && !destination.endsWith('/')) return dest\n  return `${dest}/${file.fileName}`\n}\n\nasync function uploadOne(\n  bucket: Bucket,\n  localPath: string,\n  fileName: string,\n  inputs: ParsedInputs,\n  partConcurrency: number,\n  groupedLog: boolean,\n  signal?: AbortSignal,\n): Promise {\n  const fileStat = await stat(localPath)\n  const size = fileStat.size\n\n  // Stream the file from disk. The SDK's `bucket.upload` routes files larger\n  // than the recommended part size through `uploadLargeFile`, which now\n  // detects non-sliceable sources (StreamSource) and reads the stream once,\n  // shipping one part at a time. Peak memory ≈ partSize regardless of file\n  // size, so multi-GB uploads stay bounded.\n  const nodeStream = createReadStream(localPath)\n  const webStream = Readable.toWeb(nodeStream) as ReadableStream\n  const source = new StreamSource(webStream, size)\n\n  const onProgress = makeProgressListener(`upload[${fileName}]`)\n\n  // `inputs.resume` is parsed but deliberately NOT forwarded to the SDK.\n  // The SDK's resume implementation requires a sliceable source so it can\n  // re-upload specific part offsets after a crash. The action uses\n  // `StreamSource` (memory-bounded streaming from disk), which is read-once-\n  // sequential and not sliceable; passing `resume: true` here would throw\n  // `\"resume is not supported on non-sliceable sources\"`. The input is\n  // kept in the action surface so this can be re-enabled if the action\n  // ever offers a `BufferSource` fallback for users willing to trade RAM\n  // for resumability.\n  const result = await bucket.upload({\n    fileName,\n    source,\n    concurrency: partConcurrency,\n    ...(inputs.partSize !== undefined ? { partSize: inputs.partSize } : {}),\n    ...(inputs.contentType !== undefined ? { contentType: inputs.contentType } : {}),\n    ...(inputs.encryption !== undefined ? { serverSideEncryption: inputs.encryption } : {}),\n    ...(signal !== undefined ? { signal } : {}),\n    onProgress,\n  })\n\n  // SDK now normalizes multipart `'none'` to `null` at the boundary, so\n  // `result.contentSha1` is `string | null` directly.\n  const sha1 = result.contentSha1\n  const detailPrefix = groupedLog ? '  ' : ''\n  core.info(`${detailPrefix}fileId=${result.fileId} sha1=${sha1 ?? 'multipart'}`)\n\n  return {\n    localPath,\n    fileName: result.fileName,\n    fileId: result.fileId,\n    size,\n    contentSha1: sha1,\n  }\n}\n","import { createReadStream } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { IncrementalSha1 } from '@backblaze-labs/b2-sdk/streams'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link verifyCommand}. */\nexport interface VerifyResult {\n  /** B2 file name that was checked. */\n  fileName: string\n  /** Server-reported byte size of the remote object. */\n  remoteSize: number\n  /**\n   * Remote SHA-1 result: normalized lowercase digest when comparable, raw B2\n   * value for non-comparable headers such as `none` or `unverified:`,\n   * or `null` when B2 does not expose one.\n   */\n  remoteSha1: string | null\n  /** Locally-computed SHA-1, or `null` if no local file was provided. */\n  localSha1: string | null\n  /** True when remote SHA-1 matches the expected value. */\n  verified: boolean\n  /** Human-readable failure reason; `undefined` on success. */\n  reason: string | undefined\n}\n\n/**\n * Verify that a B2 object matches a local file (or an expected SHA-1) without\n * transferring the body.\n *\n * Three modes, in priority order:\n *   1. `expected-sha1` input set → compare the remote object's SHA-1 to that\n *      literal value. No local read.\n *   2. `destination` input is an existing local file → compute that file's\n *      SHA-1 locally and compare to the remote.\n *   3. Neither → fail.\n *\n * In all modes, the remote SHA-1 is fetched via a HEAD request (header\n * `x-bz-content-sha1`). Large files uploaded via multipart return `null` from\n * B2 here because B2 stores the per-part SHA-1s but not a whole-file SHA-1;\n * HEAD-only verification cannot validate those objects, even when\n * `expected-sha1` is supplied.\n */\nexport async function verifyCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n  const source = requireSource(inputs.source, 'verify', 'the B2 file name')\n\n  core.startGroup(`verify b2://${bucket.name}/${source}`)\n  try {\n    // `bucket.head` returns only the parsed response headers; no body to\n    // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n    const { headers } = await bucket.head(source)\n    const remoteSize = headers.contentLength\n    const remoteSha1 = headers.contentSha1\n\n    let localSha1: string | null = null\n    let expected: string | null =\n      inputs.expectedSha1 !== undefined ? normalizeSha1(inputs.expectedSha1, 'expected-sha1') : null\n\n    if (expected === null && inputs.destination !== undefined && inputs.destination !== '') {\n      localSha1 = await sha1OfFile(inputs.destination)\n      expected = normalizeSha1(localSha1, 'destination')\n    }\n\n    if (expected === null) {\n      throw new Error(\n        \"verify needs either 'expected-sha1' (literal) or 'destination' (local file path) to compare against\",\n      )\n    }\n\n    const normalizedRemoteSha1 = remoteSha1 === null ? null : normalizeRemoteSha1(remoteSha1)\n    if (normalizedRemoteSha1 === null) {\n      const reason = unavailableRemoteSha1Reason(remoteSha1)\n      core.warning(`  ${reason}`)\n      return {\n        fileName: source,\n        remoteSize,\n        remoteSha1,\n        localSha1,\n        verified: false,\n        reason,\n      }\n    }\n\n    const verified = normalizedRemoteSha1 === expected\n    const reason = verified\n      ? undefined\n      : `SHA-1 mismatch: remote=${normalizedRemoteSha1} expected=${expected}`\n    if (verified) {\n      core.info(`  ✓ SHA-1 matches (${normalizedRemoteSha1}), size=${remoteSize}B`)\n    } else {\n      core.warning(`  ${reason}`)\n    }\n\n    return {\n      fileName: source,\n      remoteSize,\n      remoteSha1: normalizedRemoteSha1,\n      localSha1,\n      verified,\n      reason,\n    }\n  } finally {\n    core.endGroup()\n  }\n}\n\n/**\n * Normalize and validate a SHA-1 digest for case-insensitive comparison.\n *\n * @internal\n */\nexport function normalizeSha1(raw: string, label = 'SHA-1'): string {\n  const normalized = raw.trim().toLowerCase()\n  if (!/^[a-f0-9]{40}$/.test(normalized)) {\n    throw new Error(`Invalid ${label}: expected a 40-character hexadecimal SHA-1 digest`)\n  }\n  return normalized\n}\n\nfunction normalizeRemoteSha1(raw: string): string | null {\n  const normalized = raw.trim().toLowerCase()\n  return /^[a-f0-9]{40}$/.test(normalized) ? normalized : null\n}\n\nfunction unavailableRemoteSha1Reason(remoteSha1: string | null): string {\n  if (remoteSha1 === null) {\n    return 'remote SHA-1 is unavailable because B2 does not expose a whole-file SHA-1 for multipart-uploaded files; HEAD-only verify cannot validate this object, even with expected-sha1'\n  }\n  return `remote SHA-1 is unavailable because B2 reported ${JSON.stringify(remoteSha1)} instead of a verified 40-character whole-file SHA-1; HEAD-only verify cannot validate this object, even with expected-sha1`\n}\n\nasync function sha1OfFile(path: string): Promise {\n  const fileStat = await stat(path)\n  if (!fileStat.isFile()) {\n    throw new Error(`verify: 'destination' must be an existing file, got: ${path}`)\n  }\n  const hasher = new IncrementalSha1()\n  const stream = createReadStream(path)\n  for await (const chunk of stream) {\n    await hasher.update(chunk as Uint8Array)\n  }\n  return hasher.digest()\n}\n","import {\n  AccessDeniedError,\n  B2Error,\n  B2InsufficientCapabilityError,\n  B2SsrfError,\n  BadAuthTokenError,\n  NetworkError,\n} from '@backblaze-labs/b2-sdk/errors'\nimport { ACTION_EFFECTS, type ActionName } from './inputs.ts'\n\nconst SAFE_RETRY_HINT = 'safe to retry this workflow.'\nconst DRY_RUN_RETRY_HINT = 'safe to retry this dry-run workflow.'\nconst MUTATING_RETRY_SUFFIX =\n  'action may have partially committed; inspect B2 state before rerunning to avoid duplicate file versions, orphaned large-file uploads, or unintended deletes.'\nconst UNKNOWN_RETRY_HINT =\n  'retry may be appropriate after checking whether the request had side effects.'\nconst SSRF_FAILURE_MESSAGE =\n  'B2 endpoint safety check failed: rejected an unsafe B2 endpoint or server-provided URL. Check the endpoint input and B2 realm configuration.'\nconst MAX_LOG_FIELD_LENGTH = 1_000\nconst MAX_LOG_INPUT_LENGTH = MAX_LOG_FIELD_LENGTH * 2\nconst MAX_SECRET_BOUNDARY_WINDOW = MAX_LOG_INPUT_LENGTH\nconst MAX_DERIVED_SECRET_LENGTH = 512\nconst DEFAULT_NETWORK_RETRY_AFTER_SECONDS = 30\nconst MAX_RETRY_AFTER_SECONDS = 3_600\nconst MAX_CAUSE_DEPTH = 32\n\nexport interface ActionErrorOptions {\n  action?: ActionName\n  dryRun?: boolean\n  secretValues?: readonly string[]\n}\n\nexport interface ClassifiedActionError {\n  message: string\n  retryable: boolean | undefined\n  retryAfter: number | undefined\n}\n\nexport function classifyActionError(\n  err: unknown,\n  options: ActionErrorOptions = {},\n): ClassifiedActionError {\n  // Order matters: specific SDK classes first, then retryable B2Error, then\n  // the generic B2Error fallback last so new subclasses are not shadowed.\n  if (hasSsrfCause(err)) {\n    return failure(SSRF_FAILURE_MESSAGE, false)\n  }\n  if (err instanceof BadAuthTokenError && isAuthorizationScopeFailure(err)) {\n    return failure(\n      `B2 permission denied: application key is missing required capabilities or is outside the bucket/prefix scope. Update the key capabilities or use a key scoped to this bucket/prefix. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof BadAuthTokenError) {\n    return failure(\n      `B2 authentication failed: check application-key-id and application-key, and confirm the key is active. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof B2InsufficientCapabilityError) {\n    const missing = err.missing.length > 0 ? err.missing.join(', ') : '(unknown)'\n    return failure(\n      `B2 permission denied: application key is missing required capabilities: ${sanitizeLogField(missing, options)}. Update the key capabilities or use a key scoped to this bucket/prefix.`,\n      false,\n    )\n  }\n  if (err instanceof AccessDeniedError) {\n    return failure(\n      `B2 permission denied: check application key capabilities, bucket access, and file name prefix restrictions. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof NetworkError) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient network error talking to B2: ${retry.hint} ${sanitizeLogField(err.message, options)}`,\n      retry.safe,\n      retry.safe ? DEFAULT_NETWORK_RETRY_AFTER_SECONDS : undefined,\n    )\n  }\n  if (err instanceof B2Error && err.retryable) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient B2 error: ${retry.hint} ${formatB2Details(err, options)}`,\n      retry.safe,\n      retry.safe ? err.retryAfter : undefined,\n    )\n  }\n  if (err instanceof B2Error) {\n    return failure(\n      `B2 request failed: ${formatGenericB2Guidance(err, options)} ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  const message = err instanceof Error ? err.message : String(err)\n  return failure(sanitizeLogField(message, options), undefined)\n}\n\nexport function formatActionDebugError(err: unknown, options: ActionErrorOptions = {}): string {\n  const message = err instanceof Error ? (err.stack ?? err.message) : String(err)\n  return sanitizeLogField(message, options)\n}\n\nfunction failure(\n  message: string,\n  retryable: boolean | undefined,\n  retryAfter?: number | undefined,\n): ClassifiedActionError {\n  return { message, retryable, retryAfter: normalizeRetryAfter(retryAfter) }\n}\n\nfunction formatB2Details(err: B2Error, options: ActionErrorOptions): string {\n  const details = [\n    `status ${sanitizeLogField(String(err.status), options)}`,\n    `code ${sanitizeLogField(err.code, options)}`,\n  ]\n  const retryAfter = normalizeRetryAfter(err.retryAfter)\n  if (retryAfter !== undefined) {\n    details.push(`retry after ${sanitizeLogField(String(retryAfter), options)}s`)\n  }\n  return `B2 response details: ${details.join(', ')}`\n}\n\nfunction formatGenericB2Guidance(err: B2Error, options: ActionErrorOptions): string {\n  const message = sanitizeLogField(err.message, options)\n  switch (err.code) {\n    case 'file_not_present':\n    case 'no_such_file':\n      return `File not found; check the bucket and file name. B2 said: ${message}.`\n    case 'duplicate_bucket_name':\n      return `Bucket name already exists; choose a unique bucket name. B2 said: ${message}.`\n    case 'cap_exceeded':\n    case 'storage_cap_exceeded':\n    case 'transaction_cap_exceeded':\n    case 'download_cap_exceeded':\n      return `B2 account cap was exceeded; reduce usage or wait before retrying. B2 said: ${message}.`\n    case 'bad_request':\n      return `Bad request; check the action inputs for invalid values. B2 said: ${message}.`\n    default:\n      return `B2 said: ${message}.`\n  }\n}\n\nfunction retryPolicy(options: ActionErrorOptions): { safe: boolean; hint: string } {\n  const { action } = options\n  if (action === undefined) return { safe: false, hint: UNKNOWN_RETRY_HINT }\n  const effect = ACTION_EFFECTS[action]\n  if (options.dryRun === true && effect.honorsDryRun) {\n    return { safe: true, hint: DRY_RUN_RETRY_HINT }\n  }\n  if (effect.kind === 'read') return { safe: true, hint: SAFE_RETRY_HINT }\n  return { safe: false, hint: `the ${action} ${MUTATING_RETRY_SUFFIX}` }\n}\n\nfunction isAuthorizationScopeFailure(err: BadAuthTokenError): boolean {\n  if (err.code !== 'unauthorized') return false\n  // The SDK currently exposes scoped-key `unauthorized` responses as\n  // BadAuthTokenError with only server prose to distinguish capability/scope\n  // misses. Keep this as best-effort until a structured subtype exists.\n  return /\\b(capability|capabilities|scope|bucket|prefix|permission|not authorized|unauthorized)\\b/i.test(\n    err.message,\n  )\n}\n\nfunction hasSsrfCause(err: unknown): boolean {\n  const seen = new Set()\n  let current: unknown = err\n  for (let depth = 0; current instanceof Error && depth < MAX_CAUSE_DEPTH; depth += 1) {\n    if (current instanceof B2SsrfError) return true\n    if (seen.has(current)) return false\n    seen.add(current)\n    current = current.cause\n  }\n  return false\n}\n\nfunction normalizeRetryAfter(retryAfter: number | undefined): number | undefined {\n  if (retryAfter === undefined || !Number.isFinite(retryAfter) || retryAfter < 0) return undefined\n  return Math.min(Math.ceil(retryAfter), MAX_RETRY_AFTER_SECONDS)\n}\n\nfunction sanitizeUntrustedText(value: string): string {\n  return value\n    .replace(/\\bhttps?:\\/\\/\\S+/gi, '[redacted-url]')\n    .replace(/\\bBearer\\s+[A-Za-z0-9._~+/=-]+/gi, 'Bearer ***')\n}\n\nfunction sanitizeLogField(value: string, options: ActionErrorOptions): string {\n  const secretValues = options.secretValues ?? []\n  const scrubInputLength =\n    secretValues.length > 0\n      ? MAX_LOG_INPUT_LENGTH + MAX_SECRET_BOUNDARY_WINDOW\n      : MAX_LOG_INPUT_LENGTH\n  const bounded = value.length > scrubInputLength ? value.slice(0, scrubInputLength) : value\n  const masked = maskSecrets(bounded, secretValues)\n  const scrubbed =\n    masked.length > MAX_LOG_INPUT_LENGTH ? masked.slice(0, MAX_LOG_INPUT_LENGTH) : masked\n  const sanitized = sanitizeUntrustedText(scrubbed)\n  if (sanitized.length <= MAX_LOG_FIELD_LENGTH) return sanitized\n  return `${sanitized.slice(0, MAX_LOG_FIELD_LENGTH)}... [truncated]`\n}\n\nfunction maskSecrets(value: string, secretValues: readonly string[]): string {\n  let masked = value\n  for (const secret of secretValues) {\n    for (const variant of secretVariants(secret)) {\n      masked = masked.split(variant).join('***')\n    }\n  }\n  return masked\n}\n\nfunction secretVariants(secret: string): string[] {\n  if (secret === '') return []\n  const variants = new Set()\n  addSecretVariant(variants, secret)\n  if (secret.length > MAX_LOG_INPUT_LENGTH) {\n    addSecretVariant(variants, secret.slice(0, MAX_LOG_INPUT_LENGTH))\n  }\n  if (secret.length >= 4 && secret.length <= MAX_DERIVED_SECRET_LENGTH) {\n    const base64 = Buffer.from(secret, 'utf8').toString('base64')\n    const base64Url = base64.replaceAll('+', '-').replaceAll('/', '_')\n    addUriEncodedSecretVariant(variants, secret)\n    addSecretVariant(variants, base64)\n    addSecretVariant(variants, base64Url)\n    addSecretVariant(variants, base64Url.replace(/=+$/u, ''))\n    addSecretVariant(variants, Buffer.from(secret, 'utf8').toString('hex'))\n  }\n  return [...variants].sort((a, b) => b.length - a.length)\n}\n\nfunction addSecretVariant(variants: Set, value: string): void {\n  if (value !== '') variants.add(value)\n}\n\nfunction addUriEncodedSecretVariant(variants: Set, secret: string): void {\n  try {\n    addSecretVariant(variants, encodeURIComponent(secret))\n  } catch {\n    // Malformed surrogate pairs are valid JavaScript strings but invalid URI\n    // components. Keep raw/base64/hex masking without letting scrubbing fail.\n  }\n}\n","import { Buffer } from 'node:buffer'\nimport * as core from '@actions/core'\n\nexport const SUMMARY_JSON_PREVIEW_MAX_ENTRIES = 100\nexport const SUMMARY_JSON_MAX_UTF8_BYTES = 256 * 1024\nconst SUMMARY_JSON_OUTPUT_NAME = 'summary-json'\nconst SUMMARY_JSON_TRUNCATED_OUTPUT_NAME = 'summary-json-truncated'\nexport const SUMMARY_JSON_NOTICE_OUTPUT_NAME = 'summary-json-notice'\nexport const SUMMARY_JSON_PREVIEW_OUTPUT_NAME = 'summary-json-preview'\n\nexport type SummaryJsonPayload = CompleteSummaryJsonPayload | TruncatedSummaryJsonPayload\n\nexport interface CompleteSummaryJsonPayload {\n  json: string\n  totalCount: number\n  truncated: false\n}\n\nexport interface TruncatedSummaryJsonPayload {\n  json: string\n  noticeJson: string\n  previewJson: string\n  totalCount: number\n  previewCount: number\n  reason: string\n  truncated: true\n}\n\nexport interface SummaryJsonOutputOptions {\n  item?: (item: T) => unknown\n}\n\ninterface BoundedJsonArray {\n  json: string\n  emittedCount: number\n  byteLimitExceeded: boolean\n  serializationFailed: boolean\n}\n\n/**\n * Serialize per-file command details into the bounded `summary-json` output.\n *\n * GitHub Actions writes outputs as UTF-8 and caps all action outputs for a job\n * at 1 MB. Keep this single structured output well below that job-level\n * budget so scalar outputs, $GITHUB_OUTPUT framing, and caller-defined outputs\n * still have room.\n *\n * `summary-json` remains a complete array when the full manifest fits. When a\n * result exceeds the supported byte cap, `summary-json` remains an array\n * (`[]`) rather than changing shape or carrying a partial manifest.\n * `summary-json-notice` receives a small JSON object describing the\n * truncation, `summary-json-preview` receives a bounded diagnostic prefix, and\n * `summary-json-truncated` is set to `true`. The action step may still succeed\n * because the B2 operation itself has already completed. Scalar count outputs\n * (`file-count`, `files-listed`, etc.) remain the authoritative totals.\n *\n * The serializer also omits credential-bearing field names for every command:\n * `url`, fields ending in `url`, and fields containing `authorization`,\n * `signature`, or `token` after case/underscore/hyphen normalization. Commands\n * that need to expose similarly named non-secret data should project it to an\n * explicit safe field name before calling this helper.\n */\nexport function buildSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): SummaryJsonPayload {\n  const serialized = serializeJsonArrayPrefix(items, options, items.length)\n  if (!serialized.byteLimitExceeded && !serialized.serializationFailed) {\n    return {\n      json: serialized.json,\n      totalCount: items.length,\n      truncated: false,\n    }\n  }\n\n  return buildTruncatedSummaryJsonPayload(\n    items,\n    options,\n    serialized.serializationFailed\n      ? 'summary-json could not be serialized within the supported output contract'\n      : 'summary-json exceeded the supported UTF-8 output size cap',\n  )\n}\n\nfunction buildTruncatedSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  reason: string,\n): TruncatedSummaryJsonPayload {\n  const preview = buildSummaryJsonPreview(items, options)\n\n  return {\n    json: '[]',\n    noticeJson: JSON.stringify({\n      truncated: true,\n      reason,\n      totalCount: items.length,\n      previewCount: preview.emittedCount,\n      previewOutput: SUMMARY_JSON_PREVIEW_OUTPUT_NAME,\n    }),\n    previewJson: preview.json,\n    totalCount: items.length,\n    previewCount: preview.emittedCount,\n    reason,\n    truncated: true,\n  }\n}\n\nfunction buildSummaryJsonPreview(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n): {\n  json: string\n  emittedCount: number\n} {\n  const preview = serializeJsonArrayPrefix(items, options, SUMMARY_JSON_PREVIEW_MAX_ENTRIES)\n  return { json: preview.json, emittedCount: preview.emittedCount }\n}\n\nexport function setSummaryJsonOutput(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): void {\n  const payload = buildSummaryJsonPayload(items, options)\n\n  core.setOutput(SUMMARY_JSON_TRUNCATED_OUTPUT_NAME, String(payload.truncated))\n  core.setOutput(SUMMARY_JSON_OUTPUT_NAME, payload.json)\n  if (!payload.truncated) {\n    return\n  }\n\n  core.setOutput(SUMMARY_JSON_NOTICE_OUTPUT_NAME, payload.noticeJson)\n  core.setOutput(SUMMARY_JSON_PREVIEW_OUTPUT_NAME, payload.previewJson)\n  core.warning(\n    `summary-json truncated: ${payload.reason}; preview contains ` +\n      `${payload.previewCount} of ${payload.totalCount} item(s). ` +\n      `summary-json is [] and summary-json-notice describes the truncation. ` +\n      `limit is ${formatKiB(SUMMARY_JSON_MAX_UTF8_BYTES)} of UTF-8 JSON text`,\n  )\n}\n\nfunction serializeJsonArrayPrefix(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  maxEntries: number,\n): BoundedJsonArray {\n  const parts: string[] = ['[']\n  let bytes = 2\n  let emittedCount = 0\n  const count = Math.min(items.length, maxEntries)\n\n  for (let index = 0; index < count; index++) {\n    let itemJson: string\n    try {\n      itemJson = stringifyArrayItem(projectItem(items[index] as T, options))\n    } catch {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: false,\n        serializationFailed: true,\n      }\n    }\n\n    const separator = emittedCount === 0 ? '' : ','\n    const additionalBytes = utf8ByteLength(separator) + utf8ByteLength(itemJson)\n    if (bytes + additionalBytes > SUMMARY_JSON_MAX_UTF8_BYTES) {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: true,\n        serializationFailed: false,\n      }\n    }\n\n    if (separator !== '') parts.push(separator)\n    parts.push(itemJson)\n    bytes += additionalBytes\n    emittedCount++\n  }\n\n  parts.push(']')\n  return {\n    json: parts.join(''),\n    emittedCount,\n    byteLimitExceeded: false,\n    serializationFailed: false,\n  }\n}\n\nfunction projectItem(item: T, options: SummaryJsonOutputOptions): unknown {\n  return options.item === undefined ? item : options.item(item)\n}\n\nfunction stringifyArrayItem(item: unknown): string {\n  const json = JSON.stringify(item, sensitiveSummaryJsonFieldReplacer)\n  return json === undefined ? 'null' : json\n}\n\nfunction sensitiveSummaryJsonFieldReplacer(key: string, value: unknown): unknown {\n  return key !== '' && isSensitiveSummaryJsonField(key) ? undefined : value\n}\n\nfunction isSensitiveSummaryJsonField(key: string): boolean {\n  const normalized = key.replaceAll('-', '').replaceAll('_', '').toLowerCase()\n  return (\n    normalized === 'url' ||\n    normalized.endsWith('url') ||\n    normalized.includes('authorization') ||\n    normalized.includes('signature') ||\n    normalized.includes('token')\n  )\n}\n\nfunction utf8ByteLength(value: string): number {\n  return Buffer.byteLength(value, 'utf8')\n}\n\nfunction formatKiB(bytes: number): string {\n  return `${Math.floor(bytes / 1024)} KiB`\n}\n","import { appendFile } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport { formatBytes } from './format.ts'\n\n/** Maximum per-file rows rendered in a GitHub Actions step summary table. */\nexport const STEP_SUMMARY_MAX_ROWS = 100\n\n/**\n * One row in the `$GITHUB_STEP_SUMMARY` table emitted by a verb. Only\n * `fileName` is required; the other cells render empty when omitted.\n */\nexport interface SummaryRow {\n  /** B2 file name or display label (e.g. `(uploaded)`, `(removed)`). */\n  fileName: string\n  /** Byte size of the file. Rendered via {@link formatBytes}. */\n  size?: number | undefined\n  /** B2 file ID (rendered as inline code). */\n  fileId?: string | undefined\n  /** Content SHA-1. Truncated to 12 chars in the table for readability. */\n  sha1?: string | null | undefined\n  /** Free-form status cell (e.g. `uploaded`, `would delete`, `deleted`). */\n  status?: string | undefined\n}\n\n/**\n * Append a markdown summary block to `$GITHUB_STEP_SUMMARY`. No-ops when\n * the env var is unset (e.g. running the bundle locally for a smoke test).\n *\n * @param opts.title - Heading rendered as `## {title}`.\n * @param opts.rows - One row per file. Empty rows render an empty table body.\n * @param opts.totals - Optional aggregate line printed above the table.\n * @param opts.totalRows - Optional source row count when callers pre-slice rows.\n */\nexport async function writeStepSummary(opts: {\n  title: string\n  rows: readonly SummaryRow[]\n  totals?: { files: number; bytes: number } | undefined\n  totalRows?: number | undefined\n}): Promise {\n  const path = process.env.GITHUB_STEP_SUMMARY\n  if (!path) return\n\n  // Keep the writer defensive for direct callers even though dispatcher\n  // call sites pre-slice rows to avoid mapping very large result sets.\n  const rows = opts.rows.slice(0, STEP_SUMMARY_MAX_ROWS)\n  const totalRows = opts.totalRows ?? opts.rows.length\n  const lines: string[] = []\n  lines.push(`## ${opts.title}`)\n  lines.push('')\n\n  if (opts.totals !== undefined) {\n    lines.push(`**${opts.totals.files}** files, **${formatBytes(opts.totals.bytes)}** total.`)\n    lines.push('')\n  }\n\n  if (totalRows > rows.length) {\n    lines.push(`Showing first ${rows.length} of ${totalRows} rows.`)\n    lines.push('')\n  }\n\n  if (rows.length > 0) {\n    lines.push('| File | Size | File ID | SHA-1 | Status |')\n    lines.push('|------|------|---------|-------|--------|')\n    for (const r of rows) {\n      lines.push(\n        `| ${inlineCodeCell(r.fileName)} | ${r.size !== undefined ? formatBytes(r.size) : ''} | ${\n          r.fileId !== undefined ? inlineCodeCell(r.fileId) : ''\n        } | ${r.sha1 != null ? `\\`${r.sha1.slice(0, 12)}…\\`` : ''} | ${\n          r.status !== undefined ? inlineCodeCell(r.status) : ''\n        } |`,\n      )\n    }\n  }\n\n  lines.push('')\n\n  try {\n    await appendFile(path, `${lines.join('\\n')}\\n`)\n  } catch (err) {\n    // $GITHUB_STEP_SUMMARY might point at an unwritable path (e.g. a\n    // directory, or a file the runner lacks permission to extend). The\n    // summary is informational; degrading to a warning is better than\n    // failing an otherwise-successful step.\n    core.warning(`Failed to write step summary: ${(err as Error).message}`)\n  }\n}\n\nfunction inlineCodeCell(value: string): string {\n  return `${escapeHtml(value).replaceAll('|', '|')}`\n}\n\nfunction escapeHtml(value: string): string {\n  // Single-pass escape so correctness never depends on replace ordering\n  // (a chained version must escape '&' first or it would re-escape '<').\n  const map = { '&': '&', '<': '<', '>': '>' } as const\n  return value.replace(/[&<>]/g, (ch) => map[ch as keyof typeof map])\n}\n","import { realpathSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport * as core from '@actions/core'\nimport { buildClient, getBucket } from './client.ts'\nimport { copyCommand } from './commands/copy.ts'\nimport { deleteCommand } from './commands/delete.ts'\nimport { downloadCommand } from './commands/download.ts'\nimport { headCommand } from './commands/head.ts'\nimport { hideCommand } from './commands/hide.ts'\nimport { listCommand } from './commands/list.ts'\nimport { type PresignedFile, presignCommand } from './commands/presign.ts'\nimport { purgeCommand } from './commands/purge.ts'\nimport { retentionCommand } from './commands/retention.ts'\nimport { summarizeSyncErrors, syncCommand } from './commands/sync.ts'\nimport { unhideCommand } from './commands/unhide.ts'\nimport { uploadCommand } from './commands/upload.ts'\nimport { verifyCommand } from './commands/verify.ts'\nimport { classifyActionError, formatActionDebugError } from './errors.ts'\nimport { collectInputSecretsForScrubbing, type ParsedInputs, parseInputs } from './inputs.ts'\nimport { setSummaryJsonOutput } from './outputs.ts'\nimport { STEP_SUMMARY_MAX_ROWS, type SummaryRow, writeStepSummary } from './summary.ts'\n\n/**\n * Action entrypoint. Parses inputs, builds an authorized B2Client, dispatches\n * to the requested subcommand, and writes structured outputs back via\n * `core.setOutput`. Any thrown error is reported through `core.setFailed`\n * so the workflow step surfaces with a clear message and a non-zero exit.\n *\n * Each command path also publishes a `$GITHUB_STEP_SUMMARY` markdown block so\n * the run's summary page shows a per-file table without scrolling through the\n * live log.\n */\nexport async function run(): Promise {\n  // Wire workflow-cancellation signals (`SIGTERM` when the user cancels the\n  // job or a sibling fails fast; `SIGINT` for Ctrl+C in local dev) to an\n  // AbortController that long-running SDK operations subscribe to. Aborting\n  // mid-upload lets the SDK cancel in-flight multipart sessions cleanly\n  // rather than leaving them dangling for the user to pay storage on.\n  const controller = new AbortController()\n  const onSignal = (sig: NodeJS.Signals) => {\n    core.warning(`Received ${sig}; cancelling in-flight B2 operations.`)\n    controller.abort(new Error(`${sig} received`))\n  }\n  const onSigterm = () => onSignal('SIGTERM')\n  const onSigint = () => onSignal('SIGINT')\n  process.once('SIGTERM', onSigterm)\n  process.once('SIGINT', onSigint)\n  const signal = controller.signal\n  let action: ParsedInputs['action'] | undefined\n  let dryRun: boolean | undefined\n  const secretValues: string[] = []\n\n  try {\n    // These values are a defensive formatter scrub list for parser and\n    // dispatcher-scope credentials and tokens. Command-level secrets such as\n    // presigned URLs are masked at the command site with core.setSecret. Any\n    // SDK free-form B2 messages that reach failure output are sanitized in\n    // errors.ts.\n    secretValues.push(...collectInputSecretsForScrubbing())\n    const inputs = parseInputs()\n    action = inputs.action\n    dryRun = inputs.dryRun\n\n    const authorized = await buildClient({\n      applicationKeyId: inputs.applicationKeyId,\n      applicationKey: inputs.applicationKey,\n      bucket: inputs.bucket,\n      ...(inputs.endpoint !== undefined ? { endpoint: inputs.endpoint } : {}),\n    })\n    const authToken = authorized.client.accountInfo.getAuthToken()\n    if (authToken) registerSecretValue(secretValues, authToken)\n    const bucket = await getBucket(authorized)\n\n    switch (inputs.action) {\n      case 'upload': {\n        const result = await uploadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-id', first.fileId)\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-uploaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`uploaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: upload',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: 'uploaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'download': {\n        const result = await downloadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-downloaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`downloaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: download',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            sha1: f.contentSha1,\n            status: 'downloaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'sync': {\n        const result = await syncCommand(bucket, inputs, signal)\n        core.setOutput('files-uploaded', String(result.uploaded))\n        core.setOutput('files-downloaded', String(result.downloaded))\n        core.setOutput('files-deleted', String(result.deleted))\n        setFileCountOutput(result.uploaded + result.downloaded + result.deleted + result.skipped)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        setSummaryJsonOutput(result.events)\n        if (result.errors > 0) {\n          const sample = summarizeSyncErrors(result.events)\n          throw new Error(`Sync completed with ${result.errors} error(s): ${sample}`)\n        }\n        const syncTitlePrefix = inputs.dryRun\n          ? 'Backblaze B2: sync (dry-run)'\n          : 'Backblaze B2: sync'\n        await writeStepSummary({\n          title: `${syncTitlePrefix} [${result.direction}]`,\n          totals: {\n            files: result.uploaded + result.downloaded + result.deleted,\n            bytes: result.bytesTransferred,\n          },\n          rows: [\n            {\n              fileName: '(uploaded)',\n              size: result.direction === 'local-to-b2' ? result.bytesTransferred : 0,\n              status: String(result.uploaded),\n            },\n            {\n              fileName: '(downloaded)',\n              size: result.direction === 'b2-to-local' ? result.bytesTransferred : 0,\n              status: String(result.downloaded),\n            },\n            { fileName: '(removed)', status: String(result.deleted) },\n            { fileName: '(unchanged)', status: String(result.skipped) },\n          ],\n        })\n        return\n      }\n      case 'copy': {\n        const result = await copyCommand(authorized.client, bucket, inputs, signal)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.destinationFileName)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', String(result.size))\n        await writeStepSummary({\n          title: 'Backblaze B2: copy',\n          rows: [\n            {\n              fileName: `b2://${result.sourceBucket}/${result.sourceFileName} → b2://${result.destinationBucket}/${result.destinationFileName}`,\n              size: result.size,\n              fileId: result.fileId,\n              status: 'copied (server-side)',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'delete': {\n        const result = await deleteCommand(bucket, inputs, signal)\n        await emitDeletionSummary('delete', result, inputs)\n        return\n      }\n      case 'presign': {\n        const result = await presignCommand(authorized.client, bucket, inputs)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('presigned-url', first.url)\n          core.setOutput('file-name', first.fileName)\n        }\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        await writeStepSummary({\n          title: `Backblaze B2: presign (${result.files.length})`,\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            status: `expires at ${new Date(f.expiresAt * 1000).toISOString()}`,\n          })),\n        })\n        setSummaryJsonOutput(result.files, { item: presignSummaryItem })\n        return\n      }\n      case 'list': {\n        const result = await listCommand(bucket, inputs)\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        if (result.truncated) {\n          core.warning(\n            `list result truncated at max-results=${inputs.maxResults}; raise it to see more`,\n          )\n        }\n        await writeStepSummary({\n          title: `Backblaze B2: list (${result.files.length}${result.truncated ? '+' : ''})`,\n          totals: {\n            files: result.files.length,\n            bytes: result.files.reduce((s, f) => s + f.size, 0),\n          },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: f.contentType,\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'hide': {\n        const result = await hideCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: hide',\n          rows: [{ fileName: result.fileName, fileId: result.fileId, status: 'hidden' }],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'unhide': {\n        const result = await unhideCommand(bucket, inputs)\n        core.setOutput('file-name', result.fileName)\n        if (result.removedMarkerFileId !== null) {\n          core.setOutput('file-id', result.removedMarkerFileId)\n        }\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: unhide',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.removedMarkerFileId ?? undefined,\n              status: result.removedMarkerFileId === null ? 'no-op (not hidden)' : 'unhidden',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'verify': {\n        const result = await verifyCommand(bucket, inputs)\n        core.setOutput('verified', String(result.verified))\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        if (result.remoteSha1 !== null) core.setOutput('remote-sha1', result.remoteSha1)\n        if (result.localSha1 !== null) core.setOutput('local-sha1', result.localSha1)\n        await writeStepSummary({\n          title: result.verified ? 'Backblaze B2: verify ✓' : 'Backblaze B2: verify ✗',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.remoteSize,\n              sha1: result.remoteSha1,\n              status: result.verified ? 'matches' : (result.reason ?? 'mismatch'),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        if (!result.verified) {\n          throw new Error(result.reason ?? 'verify failed: SHA-1 mismatch')\n        }\n        return\n      }\n      case 'retention': {\n        const result = await retentionCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: retention',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.fileId,\n              status: retentionStatusLine(result),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'head': {\n        const result = await headCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        if (result.contentSha1 !== null) core.setOutput('content-sha1', result.contentSha1)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', '0')\n        await writeStepSummary({\n          title: 'Backblaze B2: head',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.size,\n              fileId: result.fileId,\n              sha1: result.contentSha1,\n              status: result.contentType,\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'purge': {\n        const result = await purgeCommand(bucket, inputs, signal)\n        await emitDeletionSummary('purge', result, inputs)\n        return\n      }\n    }\n  } catch (err) {\n    const failure = classifyActionError(err, {\n      ...(action !== undefined ? { action } : {}),\n      ...(dryRun !== undefined ? { dryRun } : {}),\n      secretValues,\n    })\n    core.debug(formatActionDebugError(err, { secretValues }))\n    if (failure.retryable !== undefined) core.setOutput('retryable', String(failure.retryable))\n    if (failure.retryAfter !== undefined) core.setOutput('retry-after', String(failure.retryAfter))\n    core.setFailed(failure.message)\n  } finally {\n    process.off('SIGTERM', onSigterm)\n    process.off('SIGINT', onSigint)\n  }\n}\n\n/**\n * Checks whether this module is the process entrypoint.\n *\n * @param metaUrl - The current module URL from `import.meta.url`.\n * @param argv1 - The executable script path from `process.argv[1]`.\n * @returns `true` when the current module path matches the invoked script.\n */\nexport function isEntrypoint(metaUrl: string, argv1: string | undefined): boolean {\n  if (argv1 === undefined) return false\n  try {\n    return realpathSync(fileURLToPath(metaUrl)) === realpathSync(resolve(argv1))\n  } catch {\n    return false\n  }\n}\n\n/**\n * Shared output-emission + step-summary for the two deletion verbs.\n * `delete` and `purge` returned-shape and dispatcher-side handling are\n * structurally identical (filter into actually-deleted vs would-delete,\n * set the same outputs, render the same capped row table); they differ only\n * in the verb label and the per-row status string.\n */\nasync function emitDeletionSummary(\n  verb: 'delete' | 'purge',\n  result: {\n    files: { fileName: string; fileId: string; skipped: boolean }[]\n    errors: number\n  },\n  inputs: ParsedInputs,\n): Promise {\n  const actuallyDeleted = result.files.filter((f) => !f.skipped).length\n  const wouldDelete = result.files.filter((f) => f.skipped).length\n  core.setOutput('files-deleted', String(actuallyDeleted))\n  setFileCountOutput(result.files.length)\n  setSummaryJsonOutput(result.files)\n  if (result.errors > 0) {\n    const labels = { delete: 'Delete', purge: 'Purge' } as const\n    throw new Error(`${labels[verb]} completed with ${result.errors} error(s)`)\n  }\n  const past = verb === 'delete' ? 'deleted' : 'purged'\n  const future = verb === 'delete' ? 'would delete' : 'would purge'\n  await writeStepSummary({\n    title: inputs.dryRun ? `Backblaze B2: ${verb} (dry-run)` : `Backblaze B2: ${verb}`,\n    totals: { files: actuallyDeleted + wouldDelete, bytes: 0 },\n    ...stepSummaryRows(result.files, (f) => ({\n      fileName: f.fileName,\n      fileId: f.fileId,\n      status: f.skipped ? future : past,\n    })),\n  })\n}\n\nfunction stepSummaryRows(\n  items: readonly T[],\n  row: (item: T) => SummaryRow,\n): { rows: SummaryRow[]; totalRows?: number } {\n  // Pre-slice here to avoid mapping very large result sets; writeStepSummary\n  // keeps its own defensive cap for direct callers.\n  const rows = items.slice(0, STEP_SUMMARY_MAX_ROWS).map(row)\n  return rows.length < items.length ? { rows, totalRows: items.length } : { rows }\n}\n\nfunction presignSummaryItem(file: PresignedFile): Pick {\n  return { fileName: file.fileName, expiresAt: file.expiresAt }\n}\n\nfunction setFileCountOutput(count: number): void {\n  core.setOutput('file-count', String(count))\n}\n\nfunction registerSecretValue(secretValues: string[], value: string): void {\n  const trimmed = value.trim()\n  for (const secret of [value, trimmed]) {\n    if (secret === '' || secretValues.includes(secret)) continue\n    core.setSecret(secret)\n    secretValues.push(secret)\n  }\n}\n\nfunction retentionStatusLine(result: {\n  appliedMode: 'compliance' | 'governance' | 'none' | undefined\n  retainUntilTimestamp: number | null | undefined\n  appliedLegalHold: 'on' | 'off' | undefined\n}): string {\n  const parts: string[] = [`mode=${result.appliedMode ?? '-'}`]\n  if (result.retainUntilTimestamp != null) {\n    parts.push(`until=${new Date(result.retainUntilTimestamp).toISOString()}`)\n  }\n  if (result.appliedLegalHold !== undefined) {\n    parts.push(`legal-hold=${result.appliedLegalHold}`)\n  }\n  return parts.join(' ')\n}\n\nif (isEntrypoint(import.meta.url, process.argv[1])) {\n  void run()\n}\n"],"names":[],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"index.js","mappings":";;;;;;AAAA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9sBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC98CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrRA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC11BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/dA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/tEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5gCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/lDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACllBA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACNA;AACA;;;;;;;;;;;;ACDA;;;;;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AChCA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9QA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACTA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACrDA;AACA;AACA;AACA;AAMA;AACA;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzEA;AACA;AAIA;AACA;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC7NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9CA;AACA;AACA;AAGA;AACA;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACnNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACpxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmBA;AACA;;;AC3QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AChGA;AACA;AACA;AACA;AAIA;AACA;;;ACRA;AACA;AAGA;AACA;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;;;AChUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;;;ACxlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;;;ACrOA;AAEA;;;;;;;;;;;AAWA;AACA;;;ACdA;AAEA;AAMA;AA6BA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AAKA;AACA;AACA;AACA;AAAA;AAEA;AACA;;;;;;;AC3IA;AACA;AAEA;AAEA;AAEA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;;;AC3DA;AAEA;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AAqFA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;AAYA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAKA;AAKA;AAKA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;AAUA;AACA;AACA;AAAA;AACA;AACA;AAEA;;;AAGA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAEA;;;;AAIA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1bA;AAEA;AACA;AAkBA;;;;;;;;;;;AAWA;AACA;AAMA;AACA;AACA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACnFA;AACA;AAmBA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC3FA;AAEA;AACA;AACA;AAoBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAEA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;;;;;ACpHA;;ACQA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAOA;AAEA;AACA;AAOA;AAEA;AACA;AAOA;AAEA;AAOA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;;;ACnMA;AAEA;;;;;AAKA;AACA;AACA;AACA;;;ACXA;;;;;AAKA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;;;ACXA;AAEA;AAEA;;;;;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAGA;AACA;AAIA;AACA;AACA;AACA;AACA;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAgDA;;;;;;;;;;AAUA;AACA;AAKA;AACA;AAEA;AACA;AAEA;AACA;AAQA;AACA;AAQA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AAOA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AASA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;;;;AAIA;AACA;AASA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAKA;AAKA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAGA;AACA;;;ACvkBA;AAEA;AAoBA;;;;;;;;AAQA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtDA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;AClCA;AA8BA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACtBA;AAEA;AACA;AAKA;AAkBA;;;;;;;;;;;;;;AAcA;AACA;AAKA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAUA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AAOA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;;;ACnKA;AAGA;AAsBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AChGA;AAEA;AACA;AAgBA;;;;;;;;;;;;;;;;;AAiBA;AACA;AAIA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACxDA;AACA;AACA;AASA;AACA;AACA;AAwBA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAGA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;;;;;;;;;;AAUA;AACA;AAKA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1PA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACx0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzlCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpOA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAwBA;;;;;;;;;;;;;;;AAeA;AACA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AASA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAkBA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AAKA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAEA;AASA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpRA;AACA;AACA;AAEA;AACA;AAsBA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC/IA;AAQA;AAEA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;;;AClPA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AA+BA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AAEA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AAEA;AAIA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC9NA;AACA;AACA;AAEA;AACA;AAmBA;;;;;;;;AAQA;AACA;AAMA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA","sources":[".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js",".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/abort-signal.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-pipeline.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-upgrade.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/readable.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/diagnostics.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/tree.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/balanced-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h1.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h2.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/fixed-queue.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-stats.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/retry-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/decorator-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/redirect-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/retry-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dns.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dump.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/retry.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pluralizer.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/util/timers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cache.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cachestorage.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/parse.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/body.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/data-url.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/dispatcher-weakref.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/file.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata-parser.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/headers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/response.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/webidl.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/encoding.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/filereader.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/progressevent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/connection.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/events.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/frame.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/permessage-deflate.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/receiver.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/sender.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/websocket.js","../external node-commonjs \"assert\"","../external node-commonjs \"events\"","../external node-commonjs \"http\"","../external node-commonjs \"https\"","../external node-commonjs \"net\"","../external node-commonjs \"node:assert\"","../external node-commonjs \"node:async_hooks\"","../external node-commonjs \"node:buffer\"","../external node-commonjs \"node:console\"","../external node-commonjs \"node:crypto\"","../external node-commonjs \"node:diagnostics_channel\"","../external node-commonjs \"node:dns\"","../external node-commonjs \"node:events\"","../external node-commonjs \"node:fs/promises\"","../external node-commonjs \"node:http\"","../external node-commonjs \"node:http2\"","../external node-commonjs \"node:net\"","../external node-commonjs \"node:path\"","../external node-commonjs \"node:perf_hooks\"","../external node-commonjs \"node:querystring\"","../external node-commonjs \"node:stream\"","../external node-commonjs \"node:tls\"","../external node-commonjs \"node:url\"","../external node-commonjs \"node:util\"","../external node-commonjs \"node:util/types\"","../external node-commonjs \"node:worker_threads\"","../external node-commonjs \"node:zlib\"","../external node-commonjs \"string_decoder\"","../external node-commonjs \"tls\"","../external node-commonjs \"util\"","../webpack/bootstrap","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/compat","../external node-commonjs \"node:fs\"","../external node-commonjs \"os\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/command.js","../external node-commonjs \"crypto\"","../external node-commonjs \"fs\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/file-command.js","../external node-commonjs \"path\"",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/proxy.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/index.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/auth.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/oidc-utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/summary.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/path-utils.js","../external node-commonjs \"child_process\"",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io-util.js",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io.js","../external node-commonjs \"timers\"",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/toolrunner.js",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/exec.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/platform.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/core.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/upload-url-pool.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/in-memory.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/realms.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/ids.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/best-effort.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/cancel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/concurrency.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/defaults.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/plan-ranges.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/copy/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/text-codec.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/encoding.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/progress.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/normalize.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/retry.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/collect.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/parallel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/hash.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/resume.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/to-error.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/stream.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/object.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/paginator.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/bucket.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/errors/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/url-guard.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/package.json.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/version.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/user-agent.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/transport.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/encryption.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/client.js",".././src/version.ts",".././src/client.ts",".././src/sse.ts",".././src/inputs.ts",".././src/commands/copy.ts",".././src/commands/delete-all.ts",".././src/commands/delete.ts","../external node-commonjs \"node:stream/promises\"",".././src/download-overrides.ts",".././src/fs.ts",".././src/format.ts",".././src/progress.ts",".././src/commands/download.ts",".././src/commands/head.ts",".././src/commands/hide.ts",".././src/commands/list.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/s3/index.js",".././src/commands/presign.ts",".././src/commands/purge.ts",".././src/commands/retention.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/source.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/actions/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/pairing.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/compare.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/synchronizer.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/local.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/file.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/b2.js",".././src/commands/sync.ts",".././src/commands/unhide.ts",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-glob-options-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-match-kind.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern-helper.js",".././node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js",".././node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/esm/index.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/brace-expressions.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/unescape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/ast.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/escape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-search-state.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-globber.js","../external node-commonjs \"stream\"",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-hash-files.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/glob.js",".././src/commands/upload.ts",".././src/commands/verify.ts",".././src/errors.ts",".././src/outputs.ts",".././src/summary.ts",".././src/main.ts"],"sourcesContent":["module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = http.request;\n  return agent;\n}\n\nfunction httpsOverHttp(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = http.request;\n  agent.createSocket = createSecureSocket;\n  agent.defaultPort = 443;\n  return agent;\n}\n\nfunction httpOverHttps(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = https.request;\n  return agent;\n}\n\nfunction httpsOverHttps(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = https.request;\n  agent.createSocket = createSecureSocket;\n  agent.defaultPort = 443;\n  return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n  var self = this;\n  self.options = options || {};\n  self.proxyOptions = self.options.proxy || {};\n  self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n  self.requests = [];\n  self.sockets = [];\n\n  self.on('free', function onFree(socket, host, port, localAddress) {\n    var options = toOptions(host, port, localAddress);\n    for (var i = 0, len = self.requests.length; i < len; ++i) {\n      var pending = self.requests[i];\n      if (pending.host === options.host && pending.port === options.port) {\n        // Detect the request to connect same origin server,\n        // reuse the connection.\n        self.requests.splice(i, 1);\n        pending.request.onSocket(socket);\n        return;\n      }\n    }\n    socket.destroy();\n    self.removeSocket(socket);\n  });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n  var self = this;\n  var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n  if (self.sockets.length >= this.maxSockets) {\n    // We are over limit so we'll add it to the queue.\n    self.requests.push(options);\n    return;\n  }\n\n  // If we are under maxSockets create a new one.\n  self.createSocket(options, function(socket) {\n    socket.on('free', onFree);\n    socket.on('close', onCloseOrRemove);\n    socket.on('agentRemove', onCloseOrRemove);\n    req.onSocket(socket);\n\n    function onFree() {\n      self.emit('free', socket, options);\n    }\n\n    function onCloseOrRemove(err) {\n      self.removeSocket(socket);\n      socket.removeListener('free', onFree);\n      socket.removeListener('close', onCloseOrRemove);\n      socket.removeListener('agentRemove', onCloseOrRemove);\n    }\n  });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n  var self = this;\n  var placeholder = {};\n  self.sockets.push(placeholder);\n\n  var connectOptions = mergeOptions({}, self.proxyOptions, {\n    method: 'CONNECT',\n    path: options.host + ':' + options.port,\n    agent: false,\n    headers: {\n      host: options.host + ':' + options.port\n    }\n  });\n  if (options.localAddress) {\n    connectOptions.localAddress = options.localAddress;\n  }\n  if (connectOptions.proxyAuth) {\n    connectOptions.headers = connectOptions.headers || {};\n    connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n        new Buffer(connectOptions.proxyAuth).toString('base64');\n  }\n\n  debug('making CONNECT request');\n  var connectReq = self.request(connectOptions);\n  connectReq.useChunkedEncodingByDefault = false; // for v0.6\n  connectReq.once('response', onResponse); // for v0.6\n  connectReq.once('upgrade', onUpgrade);   // for v0.6\n  connectReq.once('connect', onConnect);   // for v0.7 or later\n  connectReq.once('error', onError);\n  connectReq.end();\n\n  function onResponse(res) {\n    // Very hacky. This is necessary to avoid http-parser leaks.\n    res.upgrade = true;\n  }\n\n  function onUpgrade(res, socket, head) {\n    // Hacky.\n    process.nextTick(function() {\n      onConnect(res, socket, head);\n    });\n  }\n\n  function onConnect(res, socket, head) {\n    connectReq.removeAllListeners();\n    socket.removeAllListeners();\n\n    if (res.statusCode !== 200) {\n      debug('tunneling socket could not be established, statusCode=%d',\n        res.statusCode);\n      socket.destroy();\n      var error = new Error('tunneling socket could not be established, ' +\n        'statusCode=' + res.statusCode);\n      error.code = 'ECONNRESET';\n      options.request.emit('error', error);\n      self.removeSocket(placeholder);\n      return;\n    }\n    if (head.length > 0) {\n      debug('got illegal response body from proxy');\n      socket.destroy();\n      var error = new Error('got illegal response body from proxy');\n      error.code = 'ECONNRESET';\n      options.request.emit('error', error);\n      self.removeSocket(placeholder);\n      return;\n    }\n    debug('tunneling connection has established');\n    self.sockets[self.sockets.indexOf(placeholder)] = socket;\n    return cb(socket);\n  }\n\n  function onError(cause) {\n    connectReq.removeAllListeners();\n\n    debug('tunneling socket could not be established, cause=%s\\n',\n          cause.message, cause.stack);\n    var error = new Error('tunneling socket could not be established, ' +\n                          'cause=' + cause.message);\n    error.code = 'ECONNRESET';\n    options.request.emit('error', error);\n    self.removeSocket(placeholder);\n  }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n  var pos = this.sockets.indexOf(socket)\n  if (pos === -1) {\n    return;\n  }\n  this.sockets.splice(pos, 1);\n\n  var pending = this.requests.shift();\n  if (pending) {\n    // If we have pending requests and a socket gets closed a new one\n    // needs to be created to take over in the pool for the one that closed.\n    this.createSocket(pending, function(socket) {\n      pending.request.onSocket(socket);\n    });\n  }\n};\n\nfunction createSecureSocket(options, cb) {\n  var self = this;\n  TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n    var hostHeader = options.request.getHeader('host');\n    var tlsOptions = mergeOptions({}, self.options, {\n      socket: socket,\n      servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n    });\n\n    // 0 is dummy port for v0.6\n    var secureSocket = tls.connect(0, tlsOptions);\n    self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n    cb(secureSocket);\n  });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n  if (typeof host === 'string') { // since v0.10\n    return {\n      host: host,\n      port: port,\n      localAddress: localAddress\n    };\n  }\n  return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n  for (var i = 1, len = arguments.length; i < len; ++i) {\n    var overrides = arguments[i];\n    if (typeof overrides === 'object') {\n      var keys = Object.keys(overrides);\n      for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n        var k = keys[j];\n        if (overrides[k] !== undefined) {\n          target[k] = overrides[k];\n        }\n      }\n    }\n  }\n  return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n  debug = function() {\n    var args = Array.prototype.slice.call(arguments);\n    if (typeof args[0] === 'string') {\n      args[0] = 'TUNNEL: ' + args[0];\n    } else {\n      args.unshift('TUNNEL:');\n    }\n    console.error.apply(console, args);\n  }\n} else {\n  debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict'\n\nconst Client = require('./lib/dispatcher/client')\nconst Dispatcher = require('./lib/dispatcher/dispatcher')\nconst Pool = require('./lib/dispatcher/pool')\nconst BalancedPool = require('./lib/dispatcher/balanced-pool')\nconst Agent = require('./lib/dispatcher/agent')\nconst ProxyAgent = require('./lib/dispatcher/proxy-agent')\nconst EnvHttpProxyAgent = require('./lib/dispatcher/env-http-proxy-agent')\nconst RetryAgent = require('./lib/dispatcher/retry-agent')\nconst errors = require('./lib/core/errors')\nconst util = require('./lib/core/util')\nconst { InvalidArgumentError } = errors\nconst api = require('./lib/api')\nconst buildConnector = require('./lib/core/connect')\nconst MockClient = require('./lib/mock/mock-client')\nconst MockAgent = require('./lib/mock/mock-agent')\nconst MockPool = require('./lib/mock/mock-pool')\nconst mockErrors = require('./lib/mock/mock-errors')\nconst RetryHandler = require('./lib/handler/retry-handler')\nconst { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global')\nconst DecoratorHandler = require('./lib/handler/decorator-handler')\nconst RedirectHandler = require('./lib/handler/redirect-handler')\nconst createRedirectInterceptor = require('./lib/interceptor/redirect-interceptor')\n\nObject.assign(Dispatcher.prototype, api)\n\nmodule.exports.Dispatcher = Dispatcher\nmodule.exports.Client = Client\nmodule.exports.Pool = Pool\nmodule.exports.BalancedPool = BalancedPool\nmodule.exports.Agent = Agent\nmodule.exports.ProxyAgent = ProxyAgent\nmodule.exports.EnvHttpProxyAgent = EnvHttpProxyAgent\nmodule.exports.RetryAgent = RetryAgent\nmodule.exports.RetryHandler = RetryHandler\n\nmodule.exports.DecoratorHandler = DecoratorHandler\nmodule.exports.RedirectHandler = RedirectHandler\nmodule.exports.createRedirectInterceptor = createRedirectInterceptor\nmodule.exports.interceptors = {\n  redirect: require('./lib/interceptor/redirect'),\n  retry: require('./lib/interceptor/retry'),\n  dump: require('./lib/interceptor/dump'),\n  dns: require('./lib/interceptor/dns')\n}\n\nmodule.exports.buildConnector = buildConnector\nmodule.exports.errors = errors\nmodule.exports.util = {\n  parseHeaders: util.parseHeaders,\n  headerNameToString: util.headerNameToString\n}\n\nfunction makeDispatcher (fn) {\n  return (url, opts, handler) => {\n    if (typeof opts === 'function') {\n      handler = opts\n      opts = null\n    }\n\n    if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {\n      throw new InvalidArgumentError('invalid url')\n    }\n\n    if (opts != null && typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (opts && opts.path != null) {\n      if (typeof opts.path !== 'string') {\n        throw new InvalidArgumentError('invalid opts.path')\n      }\n\n      let path = opts.path\n      if (!opts.path.startsWith('/')) {\n        path = `/${path}`\n      }\n\n      url = new URL(util.parseOrigin(url).origin + path)\n    } else {\n      if (!opts) {\n        opts = typeof url === 'object' ? url : {}\n      }\n\n      url = util.parseURL(url)\n    }\n\n    const { agent, dispatcher = getGlobalDispatcher() } = opts\n\n    if (agent) {\n      throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')\n    }\n\n    return fn.call(dispatcher, {\n      ...opts,\n      origin: url.origin,\n      path: url.search ? `${url.pathname}${url.search}` : url.pathname,\n      method: opts.method || (opts.body ? 'PUT' : 'GET')\n    }, handler)\n  }\n}\n\nmodule.exports.setGlobalDispatcher = setGlobalDispatcher\nmodule.exports.getGlobalDispatcher = getGlobalDispatcher\n\nconst fetchImpl = require('./lib/web/fetch').fetch\nmodule.exports.fetch = async function fetch (init, options = undefined) {\n  try {\n    return await fetchImpl(init, options)\n  } catch (err) {\n    if (err && typeof err === 'object') {\n      Error.captureStackTrace(err)\n    }\n\n    throw err\n  }\n}\nmodule.exports.Headers = require('./lib/web/fetch/headers').Headers\nmodule.exports.Response = require('./lib/web/fetch/response').Response\nmodule.exports.Request = require('./lib/web/fetch/request').Request\nmodule.exports.FormData = require('./lib/web/fetch/formdata').FormData\nmodule.exports.File = globalThis.File ?? require('node:buffer').File\nmodule.exports.FileReader = require('./lib/web/fileapi/filereader').FileReader\n\nconst { setGlobalOrigin, getGlobalOrigin } = require('./lib/web/fetch/global')\n\nmodule.exports.setGlobalOrigin = setGlobalOrigin\nmodule.exports.getGlobalOrigin = getGlobalOrigin\n\nconst { CacheStorage } = require('./lib/web/cache/cachestorage')\nconst { kConstruct } = require('./lib/web/cache/symbols')\n\n// Cache & CacheStorage are tightly coupled with fetch. Even if it may run\n// in an older version of Node, it doesn't have any use without fetch.\nmodule.exports.caches = new CacheStorage(kConstruct)\n\nconst { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/web/cookies')\n\nmodule.exports.deleteCookie = deleteCookie\nmodule.exports.getCookies = getCookies\nmodule.exports.getSetCookies = getSetCookies\nmodule.exports.setCookie = setCookie\n\nconst { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/data-url')\n\nmodule.exports.parseMIMEType = parseMIMEType\nmodule.exports.serializeAMimeType = serializeAMimeType\n\nconst { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/web/websocket/events')\nmodule.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket\nmodule.exports.CloseEvent = CloseEvent\nmodule.exports.ErrorEvent = ErrorEvent\nmodule.exports.MessageEvent = MessageEvent\n\nmodule.exports.request = makeDispatcher(api.request)\nmodule.exports.stream = makeDispatcher(api.stream)\nmodule.exports.pipeline = makeDispatcher(api.pipeline)\nmodule.exports.connect = makeDispatcher(api.connect)\nmodule.exports.upgrade = makeDispatcher(api.upgrade)\n\nmodule.exports.MockClient = MockClient\nmodule.exports.MockPool = MockPool\nmodule.exports.MockAgent = MockAgent\nmodule.exports.mockErrors = mockErrors\n\nconst { EventSource } = require('./lib/web/eventsource/eventsource')\n\nmodule.exports.EventSource = EventSource\n","const { addAbortListener } = require('../core/util')\nconst { RequestAbortedError } = require('../core/errors')\n\nconst kListener = Symbol('kListener')\nconst kSignal = Symbol('kSignal')\n\nfunction abort (self) {\n  if (self.abort) {\n    self.abort(self[kSignal]?.reason)\n  } else {\n    self.reason = self[kSignal]?.reason ?? new RequestAbortedError()\n  }\n  removeSignal(self)\n}\n\nfunction addSignal (self, signal) {\n  self.reason = null\n\n  self[kSignal] = null\n  self[kListener] = null\n\n  if (!signal) {\n    return\n  }\n\n  if (signal.aborted) {\n    abort(self)\n    return\n  }\n\n  self[kSignal] = signal\n  self[kListener] = () => {\n    abort(self)\n  }\n\n  addAbortListener(self[kSignal], self[kListener])\n}\n\nfunction removeSignal (self) {\n  if (!self[kSignal]) {\n    return\n  }\n\n  if ('removeEventListener' in self[kSignal]) {\n    self[kSignal].removeEventListener('abort', self[kListener])\n  } else {\n    self[kSignal].removeListener('abort', self[kListener])\n  }\n\n  self[kSignal] = null\n  self[kListener] = null\n}\n\nmodule.exports = {\n  addSignal,\n  removeSignal\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { AsyncResource } = require('node:async_hooks')\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass ConnectHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    const { signal, opaque, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    super('UNDICI_CONNECT')\n\n    this.opaque = opaque || null\n    this.responseHeaders = responseHeaders || null\n    this.callback = callback\n    this.abort = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders () {\n    throw new SocketError('bad connect', null)\n  }\n\n  onUpgrade (statusCode, rawHeaders, socket) {\n    const { callback, opaque, context } = this\n\n    removeSignal(this)\n\n    this.callback = null\n\n    let headers = rawHeaders\n    // Indicates is an HTTP2Session\n    if (headers != null) {\n      headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n    }\n\n    this.runInAsyncScope(callback, null, null, {\n      statusCode,\n      headers,\n      socket,\n      opaque,\n      context\n    })\n  }\n\n  onError (err) {\n    const { callback, opaque } = this\n\n    removeSignal(this)\n\n    if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n  }\n}\n\nfunction connect (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      connect.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    const connectHandler = new ConnectHandler(opts, callback)\n    this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = connect\n","'use strict'\n\nconst {\n  Readable,\n  Duplex,\n  PassThrough\n} = require('node:stream')\nconst {\n  InvalidArgumentError,\n  InvalidReturnValueError,\n  RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nconst kResume = Symbol('resume')\n\nclass PipelineRequest extends Readable {\n  constructor () {\n    super({ autoDestroy: true })\n\n    this[kResume] = null\n  }\n\n  _read () {\n    const { [kResume]: resume } = this\n\n    if (resume) {\n      this[kResume] = null\n      resume()\n    }\n  }\n\n  _destroy (err, callback) {\n    this._read()\n\n    callback(err)\n  }\n}\n\nclass PipelineResponse extends Readable {\n  constructor (resume) {\n    super({ autoDestroy: true })\n    this[kResume] = resume\n  }\n\n  _read () {\n    this[kResume]()\n  }\n\n  _destroy (err, callback) {\n    if (!err && !this._readableState.endEmitted) {\n      err = new RequestAbortedError()\n    }\n\n    callback(err)\n  }\n}\n\nclass PipelineHandler extends AsyncResource {\n  constructor (opts, handler) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof handler !== 'function') {\n      throw new InvalidArgumentError('invalid handler')\n    }\n\n    const { signal, method, opaque, onInfo, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    if (method === 'CONNECT') {\n      throw new InvalidArgumentError('invalid method')\n    }\n\n    if (onInfo && typeof onInfo !== 'function') {\n      throw new InvalidArgumentError('invalid onInfo callback')\n    }\n\n    super('UNDICI_PIPELINE')\n\n    this.opaque = opaque || null\n    this.responseHeaders = responseHeaders || null\n    this.handler = handler\n    this.abort = null\n    this.context = null\n    this.onInfo = onInfo || null\n\n    this.req = new PipelineRequest().on('error', util.nop)\n\n    this.ret = new Duplex({\n      readableObjectMode: opts.objectMode,\n      autoDestroy: true,\n      read: () => {\n        const { body } = this\n\n        if (body?.resume) {\n          body.resume()\n        }\n      },\n      write: (chunk, encoding, callback) => {\n        const { req } = this\n\n        if (req.push(chunk, encoding) || req._readableState.destroyed) {\n          callback()\n        } else {\n          req[kResume] = callback\n        }\n      },\n      destroy: (err, callback) => {\n        const { body, req, res, ret, abort } = this\n\n        if (!err && !ret._readableState.endEmitted) {\n          err = new RequestAbortedError()\n        }\n\n        if (abort && err) {\n          abort()\n        }\n\n        util.destroy(body, err)\n        util.destroy(req, err)\n        util.destroy(res, err)\n\n        removeSignal(this)\n\n        callback(err)\n      }\n    }).on('prefinish', () => {\n      const { req } = this\n\n      // Node < 15 does not call _final in same tick.\n      req.push(null)\n    })\n\n    this.res = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    const { ret, res } = this\n\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(!res, 'pipeline cannot be retried')\n    assert(!ret.destroyed)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume) {\n    const { opaque, handler, context } = this\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    this.res = new PipelineResponse(resume)\n\n    let body\n    try {\n      this.handler = null\n      const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n      body = this.runInAsyncScope(handler, null, {\n        statusCode,\n        headers,\n        opaque,\n        body: this.res,\n        context\n      })\n    } catch (err) {\n      this.res.on('error', util.nop)\n      throw err\n    }\n\n    if (!body || typeof body.on !== 'function') {\n      throw new InvalidReturnValueError('expected Readable')\n    }\n\n    body\n      .on('data', (chunk) => {\n        const { ret, body } = this\n\n        if (!ret.push(chunk) && body.pause) {\n          body.pause()\n        }\n      })\n      .on('error', (err) => {\n        const { ret } = this\n\n        util.destroy(ret, err)\n      })\n      .on('end', () => {\n        const { ret } = this\n\n        ret.push(null)\n      })\n      .on('close', () => {\n        const { ret } = this\n\n        if (!ret._readableState.ended) {\n          util.destroy(ret, new RequestAbortedError())\n        }\n      })\n\n    this.body = body\n  }\n\n  onData (chunk) {\n    const { res } = this\n    return res.push(chunk)\n  }\n\n  onComplete (trailers) {\n    const { res } = this\n    res.push(null)\n  }\n\n  onError (err) {\n    const { ret } = this\n    this.handler = null\n    util.destroy(ret, err)\n  }\n}\n\nfunction pipeline (opts, handler) {\n  try {\n    const pipelineHandler = new PipelineHandler(opts, handler)\n    this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)\n    return pipelineHandler.ret\n  } catch (err) {\n    return new PassThrough().destroy(err)\n  }\n}\n\nmodule.exports = pipeline\n","'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('./readable')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\n\nclass RequestHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts\n\n    try {\n      if (typeof callback !== 'function') {\n        throw new InvalidArgumentError('invalid callback')\n      }\n\n      if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {\n        throw new InvalidArgumentError('invalid highWaterMark')\n      }\n\n      if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n        throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n      }\n\n      if (method === 'CONNECT') {\n        throw new InvalidArgumentError('invalid method')\n      }\n\n      if (onInfo && typeof onInfo !== 'function') {\n        throw new InvalidArgumentError('invalid onInfo callback')\n      }\n\n      super('UNDICI_REQUEST')\n    } catch (err) {\n      if (util.isStream(body)) {\n        util.destroy(body.on('error', util.nop), err)\n      }\n      throw err\n    }\n\n    this.method = method\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.callback = callback\n    this.res = null\n    this.abort = null\n    this.body = body\n    this.trailers = {}\n    this.context = null\n    this.onInfo = onInfo || null\n    this.throwOnError = throwOnError\n    this.highWaterMark = highWaterMark\n    this.signal = signal\n    this.reason = null\n    this.removeAbortListener = null\n\n    if (util.isStream(body)) {\n      body.on('error', (err) => {\n        this.onError(err)\n      })\n    }\n\n    if (this.signal) {\n      if (this.signal.aborted) {\n        this.reason = this.signal.reason ?? new RequestAbortedError()\n      } else {\n        this.removeAbortListener = util.addAbortListener(this.signal, () => {\n          this.reason = this.signal.reason ?? new RequestAbortedError()\n          if (this.res) {\n            util.destroy(this.res.on('error', util.nop), this.reason)\n          } else if (this.abort) {\n            this.abort(this.reason)\n          }\n\n          if (this.removeAbortListener) {\n            this.res?.off('close', this.removeAbortListener)\n            this.removeAbortListener()\n            this.removeAbortListener = null\n          }\n        })\n      }\n    }\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this\n\n    const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n    const contentType = parsedHeaders['content-type']\n    const contentLength = parsedHeaders['content-length']\n    const res = new Readable({\n      resume,\n      abort,\n      contentType,\n      contentLength: this.method !== 'HEAD' && contentLength\n        ? Number(contentLength)\n        : null,\n      highWaterMark\n    })\n\n    if (this.removeAbortListener) {\n      res.on('close', this.removeAbortListener)\n    }\n\n    this.callback = null\n    this.res = res\n    if (callback !== null) {\n      if (this.throwOnError && statusCode >= 400) {\n        this.runInAsyncScope(getResolveErrorBodyCallback, null,\n          { callback, body: res, contentType, statusCode, statusMessage, headers }\n        )\n      } else {\n        this.runInAsyncScope(callback, null, null, {\n          statusCode,\n          headers,\n          trailers: this.trailers,\n          opaque,\n          body: res,\n          context\n        })\n      }\n    }\n  }\n\n  onData (chunk) {\n    return this.res.push(chunk)\n  }\n\n  onComplete (trailers) {\n    util.parseHeaders(trailers, this.trailers)\n    this.res.push(null)\n  }\n\n  onError (err) {\n    const { res, callback, body, opaque } = this\n\n    if (callback) {\n      // TODO: Does this need queueMicrotask?\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n\n    if (res) {\n      this.res = null\n      // Ensure all queued handlers are invoked before destroying res.\n      queueMicrotask(() => {\n        util.destroy(res, err)\n      })\n    }\n\n    if (body) {\n      this.body = null\n      util.destroy(body, err)\n    }\n\n    if (this.removeAbortListener) {\n      res?.off('close', this.removeAbortListener)\n      this.removeAbortListener()\n      this.removeAbortListener = null\n    }\n  }\n}\n\nfunction request (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      request.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    this.dispatch(opts, new RequestHandler(opts, callback))\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = request\nmodule.exports.RequestHandler = RequestHandler\n","'use strict'\n\nconst assert = require('node:assert')\nconst { finished, PassThrough } = require('node:stream')\nconst { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass StreamHandler extends AsyncResource {\n  constructor (opts, factory, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts\n\n    try {\n      if (typeof callback !== 'function') {\n        throw new InvalidArgumentError('invalid callback')\n      }\n\n      if (typeof factory !== 'function') {\n        throw new InvalidArgumentError('invalid factory')\n      }\n\n      if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n        throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n      }\n\n      if (method === 'CONNECT') {\n        throw new InvalidArgumentError('invalid method')\n      }\n\n      if (onInfo && typeof onInfo !== 'function') {\n        throw new InvalidArgumentError('invalid onInfo callback')\n      }\n\n      super('UNDICI_STREAM')\n    } catch (err) {\n      if (util.isStream(body)) {\n        util.destroy(body.on('error', util.nop), err)\n      }\n      throw err\n    }\n\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.factory = factory\n    this.callback = callback\n    this.res = null\n    this.abort = null\n    this.context = null\n    this.trailers = null\n    this.body = body\n    this.onInfo = onInfo || null\n    this.throwOnError = throwOnError || false\n\n    if (util.isStream(body)) {\n      body.on('error', (err) => {\n        this.onError(err)\n      })\n    }\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const { factory, opaque, context, callback, responseHeaders } = this\n\n    const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    this.factory = null\n\n    let res\n\n    if (this.throwOnError && statusCode >= 400) {\n      const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n      const contentType = parsedHeaders['content-type']\n      res = new PassThrough()\n\n      this.callback = null\n      this.runInAsyncScope(getResolveErrorBodyCallback, null,\n        { callback, body: res, contentType, statusCode, statusMessage, headers }\n      )\n    } else {\n      if (factory === null) {\n        return\n      }\n\n      res = this.runInAsyncScope(factory, null, {\n        statusCode,\n        headers,\n        opaque,\n        context\n      })\n\n      if (\n        !res ||\n        typeof res.write !== 'function' ||\n        typeof res.end !== 'function' ||\n        typeof res.on !== 'function'\n      ) {\n        throw new InvalidReturnValueError('expected Writable')\n      }\n\n      // TODO: Avoid finished. It registers an unnecessary amount of listeners.\n      finished(res, { readable: false }, (err) => {\n        const { callback, res, opaque, trailers, abort } = this\n\n        this.res = null\n        if (err || !res.readable) {\n          util.destroy(res, err)\n        }\n\n        this.callback = null\n        this.runInAsyncScope(callback, null, err || null, { opaque, trailers })\n\n        if (err) {\n          abort()\n        }\n      })\n    }\n\n    res.on('drain', resume)\n\n    this.res = res\n\n    const needDrain = res.writableNeedDrain !== undefined\n      ? res.writableNeedDrain\n      : res._writableState?.needDrain\n\n    return needDrain !== true\n  }\n\n  onData (chunk) {\n    const { res } = this\n\n    return res ? res.write(chunk) : true\n  }\n\n  onComplete (trailers) {\n    const { res } = this\n\n    removeSignal(this)\n\n    if (!res) {\n      return\n    }\n\n    this.trailers = util.parseHeaders(trailers)\n\n    res.end()\n  }\n\n  onError (err) {\n    const { res, callback, opaque, body } = this\n\n    removeSignal(this)\n\n    this.factory = null\n\n    if (res) {\n      this.res = null\n      util.destroy(res, err)\n    } else if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n\n    if (body) {\n      this.body = null\n      util.destroy(body, err)\n    }\n  }\n}\n\nfunction stream (opts, factory, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      stream.call(this, opts, factory, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    this.dispatch(opts, new StreamHandler(opts, factory, callback))\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = stream\n","'use strict'\n\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst { AsyncResource } = require('node:async_hooks')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nclass UpgradeHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    const { signal, opaque, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    super('UNDICI_UPGRADE')\n\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.callback = callback\n    this.abort = null\n    this.context = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = null\n  }\n\n  onHeaders () {\n    throw new SocketError('bad upgrade', null)\n  }\n\n  onUpgrade (statusCode, rawHeaders, socket) {\n    assert(statusCode === 101)\n\n    const { callback, opaque, context } = this\n\n    removeSignal(this)\n\n    this.callback = null\n    const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n    this.runInAsyncScope(callback, null, null, {\n      headers,\n      socket,\n      opaque,\n      context\n    })\n  }\n\n  onError (err) {\n    const { callback, opaque } = this\n\n    removeSignal(this)\n\n    if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n  }\n}\n\nfunction upgrade (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      upgrade.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    const upgradeHandler = new UpgradeHandler(opts, callback)\n    this.dispatch({\n      ...opts,\n      method: opts.method || 'GET',\n      upgrade: opts.protocol || 'Websocket'\n    }, upgradeHandler)\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = upgrade\n","'use strict'\n\nmodule.exports.request = require('./api-request')\nmodule.exports.stream = require('./api-stream')\nmodule.exports.pipeline = require('./api-pipeline')\nmodule.exports.upgrade = require('./api-upgrade')\nmodule.exports.connect = require('./api-connect')\n","// Ported from https://github.com/nodejs/undici/pull/907\n\n'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('node:stream')\nconst { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require('../core/errors')\nconst util = require('../core/util')\nconst { ReadableStreamFrom } = require('../core/util')\n\nconst kConsume = Symbol('kConsume')\nconst kReading = Symbol('kReading')\nconst kBody = Symbol('kBody')\nconst kAbort = Symbol('kAbort')\nconst kContentType = Symbol('kContentType')\nconst kContentLength = Symbol('kContentLength')\n\nconst noop = () => {}\n\nclass BodyReadable extends Readable {\n  constructor ({\n    resume,\n    abort,\n    contentType = '',\n    contentLength,\n    highWaterMark = 64 * 1024 // Same as nodejs fs streams.\n  }) {\n    super({\n      autoDestroy: true,\n      read: resume,\n      highWaterMark\n    })\n\n    this._readableState.dataEmitted = false\n\n    this[kAbort] = abort\n    this[kConsume] = null\n    this[kBody] = null\n    this[kContentType] = contentType\n    this[kContentLength] = contentLength\n\n    // Is stream being consumed through Readable API?\n    // This is an optimization so that we avoid checking\n    // for 'data' and 'readable' listeners in the hot path\n    // inside push().\n    this[kReading] = false\n  }\n\n  destroy (err) {\n    if (!err && !this._readableState.endEmitted) {\n      err = new RequestAbortedError()\n    }\n\n    if (err) {\n      this[kAbort]()\n    }\n\n    return super.destroy(err)\n  }\n\n  _destroy (err, callback) {\n    // Workaround for Node \"bug\". If the stream is destroyed in same\n    // tick as it is created, then a user who is waiting for a\n    // promise (i.e micro tick) for installing a 'error' listener will\n    // never get a chance and will always encounter an unhandled exception.\n    if (!this[kReading]) {\n      setImmediate(() => {\n        callback(err)\n      })\n    } else {\n      callback(err)\n    }\n  }\n\n  on (ev, ...args) {\n    if (ev === 'data' || ev === 'readable') {\n      this[kReading] = true\n    }\n    return super.on(ev, ...args)\n  }\n\n  addListener (ev, ...args) {\n    return this.on(ev, ...args)\n  }\n\n  off (ev, ...args) {\n    const ret = super.off(ev, ...args)\n    if (ev === 'data' || ev === 'readable') {\n      this[kReading] = (\n        this.listenerCount('data') > 0 ||\n        this.listenerCount('readable') > 0\n      )\n    }\n    return ret\n  }\n\n  removeListener (ev, ...args) {\n    return this.off(ev, ...args)\n  }\n\n  push (chunk) {\n    if (this[kConsume] && chunk !== null) {\n      consumePush(this[kConsume], chunk)\n      return this[kReading] ? super.push(chunk) : true\n    }\n    return super.push(chunk)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-text\n  async text () {\n    return consume(this, 'text')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-json\n  async json () {\n    return consume(this, 'json')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-blob\n  async blob () {\n    return consume(this, 'blob')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bytes\n  async bytes () {\n    return consume(this, 'bytes')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n  async arrayBuffer () {\n    return consume(this, 'arrayBuffer')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-formdata\n  async formData () {\n    // TODO: Implement.\n    throw new NotSupportedError()\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bodyused\n  get bodyUsed () {\n    return util.isDisturbed(this)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-body\n  get body () {\n    if (!this[kBody]) {\n      this[kBody] = ReadableStreamFrom(this)\n      if (this[kConsume]) {\n        // TODO: Is this the best way to force a lock?\n        this[kBody].getReader() // Ensure stream is locked.\n        assert(this[kBody].locked)\n      }\n    }\n    return this[kBody]\n  }\n\n  async dump (opts) {\n    let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024\n    const signal = opts?.signal\n\n    if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) {\n      throw new InvalidArgumentError('signal must be an AbortSignal')\n    }\n\n    signal?.throwIfAborted()\n\n    if (this._readableState.closeEmitted) {\n      return null\n    }\n\n    return await new Promise((resolve, reject) => {\n      if (this[kContentLength] > limit) {\n        this.destroy(new AbortError())\n      }\n\n      const onAbort = () => {\n        this.destroy(signal.reason ?? new AbortError())\n      }\n      signal?.addEventListener('abort', onAbort)\n\n      this\n        .on('close', function () {\n          signal?.removeEventListener('abort', onAbort)\n          if (signal?.aborted) {\n            reject(signal.reason ?? new AbortError())\n          } else {\n            resolve(null)\n          }\n        })\n        .on('error', noop)\n        .on('data', function (chunk) {\n          limit -= chunk.length\n          if (limit <= 0) {\n            this.destroy()\n          }\n        })\n        .resume()\n    })\n  }\n}\n\n// https://streams.spec.whatwg.org/#readablestream-locked\nfunction isLocked (self) {\n  // Consume is an implicit lock.\n  return (self[kBody] && self[kBody].locked === true) || self[kConsume]\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction isUnusable (self) {\n  return util.isDisturbed(self) || isLocked(self)\n}\n\nasync function consume (stream, type) {\n  assert(!stream[kConsume])\n\n  return new Promise((resolve, reject) => {\n    if (isUnusable(stream)) {\n      const rState = stream._readableState\n      if (rState.destroyed && rState.closeEmitted === false) {\n        stream\n          .on('error', err => {\n            reject(err)\n          })\n          .on('close', () => {\n            reject(new TypeError('unusable'))\n          })\n      } else {\n        reject(rState.errored ?? new TypeError('unusable'))\n      }\n    } else {\n      queueMicrotask(() => {\n        stream[kConsume] = {\n          type,\n          stream,\n          resolve,\n          reject,\n          length: 0,\n          body: []\n        }\n\n        stream\n          .on('error', function (err) {\n            consumeFinish(this[kConsume], err)\n          })\n          .on('close', function () {\n            if (this[kConsume].body !== null) {\n              consumeFinish(this[kConsume], new RequestAbortedError())\n            }\n          })\n\n        consumeStart(stream[kConsume])\n      })\n    }\n  })\n}\n\nfunction consumeStart (consume) {\n  if (consume.body === null) {\n    return\n  }\n\n  const { _readableState: state } = consume.stream\n\n  if (state.bufferIndex) {\n    const start = state.bufferIndex\n    const end = state.buffer.length\n    for (let n = start; n < end; n++) {\n      consumePush(consume, state.buffer[n])\n    }\n  } else {\n    for (const chunk of state.buffer) {\n      consumePush(consume, chunk)\n    }\n  }\n\n  if (state.endEmitted) {\n    consumeEnd(this[kConsume])\n  } else {\n    consume.stream.on('end', function () {\n      consumeEnd(this[kConsume])\n    })\n  }\n\n  consume.stream.resume()\n\n  while (consume.stream.read() != null) {\n    // Loop\n  }\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n */\nfunction chunksDecode (chunks, length) {\n  if (chunks.length === 0 || length === 0) {\n    return ''\n  }\n  const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length)\n  const bufferLength = buffer.length\n\n  // Skip BOM.\n  const start =\n    bufferLength > 2 &&\n    buffer[0] === 0xef &&\n    buffer[1] === 0xbb &&\n    buffer[2] === 0xbf\n      ? 3\n      : 0\n  return buffer.utf8Slice(start, bufferLength)\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n * @returns {Uint8Array}\n */\nfunction chunksConcat (chunks, length) {\n  if (chunks.length === 0 || length === 0) {\n    return new Uint8Array(0)\n  }\n  if (chunks.length === 1) {\n    // fast-path\n    return new Uint8Array(chunks[0])\n  }\n  const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer)\n\n  let offset = 0\n  for (let i = 0; i < chunks.length; ++i) {\n    const chunk = chunks[i]\n    buffer.set(chunk, offset)\n    offset += chunk.length\n  }\n\n  return buffer\n}\n\nfunction consumeEnd (consume) {\n  const { type, body, resolve, stream, length } = consume\n\n  try {\n    if (type === 'text') {\n      resolve(chunksDecode(body, length))\n    } else if (type === 'json') {\n      resolve(JSON.parse(chunksDecode(body, length)))\n    } else if (type === 'arrayBuffer') {\n      resolve(chunksConcat(body, length).buffer)\n    } else if (type === 'blob') {\n      resolve(new Blob(body, { type: stream[kContentType] }))\n    } else if (type === 'bytes') {\n      resolve(chunksConcat(body, length))\n    }\n\n    consumeFinish(consume)\n  } catch (err) {\n    stream.destroy(err)\n  }\n}\n\nfunction consumePush (consume, chunk) {\n  consume.length += chunk.length\n  consume.body.push(chunk)\n}\n\nfunction consumeFinish (consume, err) {\n  if (consume.body === null) {\n    return\n  }\n\n  if (err) {\n    consume.reject(err)\n  } else {\n    consume.resolve()\n  }\n\n  consume.type = null\n  consume.stream = null\n  consume.resolve = null\n  consume.reject = null\n  consume.length = 0\n  consume.body = null\n}\n\nmodule.exports = { Readable: BodyReadable, chunksDecode }\n","const assert = require('node:assert')\nconst {\n  ResponseStatusCodeError\n} = require('../core/errors')\n\nconst { chunksDecode } = require('./readable')\nconst CHUNK_LIMIT = 128 * 1024\n\nasync function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {\n  assert(body)\n\n  let chunks = []\n  let length = 0\n\n  try {\n    for await (const chunk of body) {\n      chunks.push(chunk)\n      length += chunk.length\n      if (length > CHUNK_LIMIT) {\n        chunks = []\n        length = 0\n        break\n      }\n    }\n  } catch {\n    chunks = []\n    length = 0\n    // Do nothing....\n  }\n\n  const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`\n\n  if (statusCode === 204 || !contentType || !length) {\n    queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)))\n    return\n  }\n\n  const stackTraceLimit = Error.stackTraceLimit\n  Error.stackTraceLimit = 0\n  let payload\n\n  try {\n    if (isContentTypeApplicationJson(contentType)) {\n      payload = JSON.parse(chunksDecode(chunks, length))\n    } else if (isContentTypeText(contentType)) {\n      payload = chunksDecode(chunks, length)\n    }\n  } catch {\n    // process in a callback to avoid throwing in the microtask queue\n  } finally {\n    Error.stackTraceLimit = stackTraceLimit\n  }\n  queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)))\n}\n\nconst isContentTypeApplicationJson = (contentType) => {\n  return (\n    contentType.length > 15 &&\n    contentType[11] === '/' &&\n    contentType[0] === 'a' &&\n    contentType[1] === 'p' &&\n    contentType[2] === 'p' &&\n    contentType[3] === 'l' &&\n    contentType[4] === 'i' &&\n    contentType[5] === 'c' &&\n    contentType[6] === 'a' &&\n    contentType[7] === 't' &&\n    contentType[8] === 'i' &&\n    contentType[9] === 'o' &&\n    contentType[10] === 'n' &&\n    contentType[12] === 'j' &&\n    contentType[13] === 's' &&\n    contentType[14] === 'o' &&\n    contentType[15] === 'n'\n  )\n}\n\nconst isContentTypeText = (contentType) => {\n  return (\n    contentType.length > 4 &&\n    contentType[4] === '/' &&\n    contentType[0] === 't' &&\n    contentType[1] === 'e' &&\n    contentType[2] === 'x' &&\n    contentType[3] === 't'\n  )\n}\n\nmodule.exports = {\n  getResolveErrorBodyCallback,\n  isContentTypeApplicationJson,\n  isContentTypeText\n}\n","'use strict'\n\nconst net = require('node:net')\nconst assert = require('node:assert')\nconst util = require('./util')\nconst { InvalidArgumentError, ConnectTimeoutError } = require('./errors')\nconst timers = require('../util/timers')\n\nfunction noop () {}\n\nlet tls // include tls conditionally since it is not always available\n\n// TODO: session re-use does not wait for the first\n// connection to resolve the session and might therefore\n// resolve the same servername multiple times even when\n// re-use is enabled.\n\nlet SessionCache\n// FIXME: remove workaround when the Node bug is fixed\n// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\nif (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) {\n  SessionCache = class WeakSessionCache {\n    constructor (maxCachedSessions) {\n      this._maxCachedSessions = maxCachedSessions\n      this._sessionCache = new Map()\n      this._sessionRegistry = new global.FinalizationRegistry((key) => {\n        if (this._sessionCache.size < this._maxCachedSessions) {\n          return\n        }\n\n        const ref = this._sessionCache.get(key)\n        if (ref !== undefined && ref.deref() === undefined) {\n          this._sessionCache.delete(key)\n        }\n      })\n    }\n\n    get (sessionKey) {\n      const ref = this._sessionCache.get(sessionKey)\n      return ref ? ref.deref() : null\n    }\n\n    set (sessionKey, session) {\n      if (this._maxCachedSessions === 0) {\n        return\n      }\n\n      this._sessionCache.set(sessionKey, new WeakRef(session))\n      this._sessionRegistry.register(session, sessionKey)\n    }\n  }\n} else {\n  SessionCache = class SimpleSessionCache {\n    constructor (maxCachedSessions) {\n      this._maxCachedSessions = maxCachedSessions\n      this._sessionCache = new Map()\n    }\n\n    get (sessionKey) {\n      return this._sessionCache.get(sessionKey)\n    }\n\n    set (sessionKey, session) {\n      if (this._maxCachedSessions === 0) {\n        return\n      }\n\n      if (this._sessionCache.size >= this._maxCachedSessions) {\n        // remove the oldest session\n        const { value: oldestKey } = this._sessionCache.keys().next()\n        this._sessionCache.delete(oldestKey)\n      }\n\n      this._sessionCache.set(sessionKey, session)\n    }\n  }\n}\n\nfunction buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {\n  if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n    throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')\n  }\n\n  const options = { path: socketPath, ...opts }\n  const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)\n  timeout = timeout == null ? 10e3 : timeout\n  allowH2 = allowH2 != null ? allowH2 : false\n  return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n    let socket\n    if (protocol === 'https:') {\n      if (!tls) {\n        tls = require('node:tls')\n      }\n      servername = servername || options.servername || util.getServerName(host) || null\n\n      const sessionKey = servername || hostname\n      assert(sessionKey)\n\n      const session = customSession || sessionCache.get(sessionKey) || null\n\n      port = port || 443\n\n      socket = tls.connect({\n        highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...\n        ...options,\n        servername,\n        session,\n        localAddress,\n        // TODO(HTTP/2): Add support for h2c\n        ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],\n        socket: httpSocket, // upgrade socket connection\n        port,\n        host: hostname\n      })\n\n      socket\n        .on('session', function (session) {\n          // TODO (fix): Can a session become invalid once established? Don't think so?\n          sessionCache.set(sessionKey, session)\n        })\n    } else {\n      assert(!httpSocket, 'httpSocket can only be sent on TLS update')\n\n      port = port || 80\n\n      socket = net.connect({\n        highWaterMark: 64 * 1024, // Same as nodejs fs streams.\n        ...options,\n        localAddress,\n        port,\n        host: hostname\n      })\n    }\n\n    // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket\n    if (options.keepAlive == null || options.keepAlive) {\n      const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay\n      socket.setKeepAlive(true, keepAliveInitialDelay)\n    }\n\n    const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port })\n\n    socket\n      .setNoDelay(true)\n      .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {\n        queueMicrotask(clearConnectTimeout)\n\n        if (callback) {\n          const cb = callback\n          callback = null\n          cb(null, this)\n        }\n      })\n      .on('error', function (err) {\n        queueMicrotask(clearConnectTimeout)\n\n        if (callback) {\n          const cb = callback\n          callback = null\n          cb(err)\n        }\n      })\n\n    return socket\n  }\n}\n\n/**\n * @param {WeakRef} socketWeakRef\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n * @returns {() => void}\n */\nconst setupConnectTimeout = process.platform === 'win32'\n  ? (socketWeakRef, opts) => {\n      if (!opts.timeout) {\n        return noop\n      }\n\n      let s1 = null\n      let s2 = null\n      const fastTimer = timers.setFastTimeout(() => {\n      // setImmediate is added to make sure that we prioritize socket error events over timeouts\n        s1 = setImmediate(() => {\n        // Windows needs an extra setImmediate probably due to implementation differences in the socket logic\n          s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))\n        })\n      }, opts.timeout)\n      return () => {\n        timers.clearFastTimeout(fastTimer)\n        clearImmediate(s1)\n        clearImmediate(s2)\n      }\n    }\n  : (socketWeakRef, opts) => {\n      if (!opts.timeout) {\n        return noop\n      }\n\n      let s1 = null\n      const fastTimer = timers.setFastTimeout(() => {\n      // setImmediate is added to make sure that we prioritize socket error events over timeouts\n        s1 = setImmediate(() => {\n          onConnectTimeout(socketWeakRef.deref(), opts)\n        })\n      }, opts.timeout)\n      return () => {\n        timers.clearFastTimeout(fastTimer)\n        clearImmediate(s1)\n      }\n    }\n\n/**\n * @param {net.Socket} socket\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n */\nfunction onConnectTimeout (socket, opts) {\n  // The socket could be already garbage collected\n  if (socket == null) {\n    return\n  }\n\n  let message = 'Connect Timeout Error'\n  if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {\n    message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`\n  } else {\n    message += ` (attempted address: ${opts.hostname}:${opts.port},`\n  }\n\n  message += ` timeout: ${opts.timeout}ms)`\n\n  util.destroy(socket, new ConnectTimeoutError(message))\n}\n\nmodule.exports = buildConnector\n","'use strict'\n\n/** @type {Record} */\nconst headerNameLowerCasedRecord = {}\n\n// https://developer.mozilla.org/docs/Web/HTTP/Headers\nconst wellknownHeaderNames = [\n  'Accept',\n  'Accept-Encoding',\n  'Accept-Language',\n  'Accept-Ranges',\n  'Access-Control-Allow-Credentials',\n  'Access-Control-Allow-Headers',\n  'Access-Control-Allow-Methods',\n  'Access-Control-Allow-Origin',\n  'Access-Control-Expose-Headers',\n  'Access-Control-Max-Age',\n  'Access-Control-Request-Headers',\n  'Access-Control-Request-Method',\n  'Age',\n  'Allow',\n  'Alt-Svc',\n  'Alt-Used',\n  'Authorization',\n  'Cache-Control',\n  'Clear-Site-Data',\n  'Connection',\n  'Content-Disposition',\n  'Content-Encoding',\n  'Content-Language',\n  'Content-Length',\n  'Content-Location',\n  'Content-Range',\n  'Content-Security-Policy',\n  'Content-Security-Policy-Report-Only',\n  'Content-Type',\n  'Cookie',\n  'Cross-Origin-Embedder-Policy',\n  'Cross-Origin-Opener-Policy',\n  'Cross-Origin-Resource-Policy',\n  'Date',\n  'Device-Memory',\n  'Downlink',\n  'ECT',\n  'ETag',\n  'Expect',\n  'Expect-CT',\n  'Expires',\n  'Forwarded',\n  'From',\n  'Host',\n  'If-Match',\n  'If-Modified-Since',\n  'If-None-Match',\n  'If-Range',\n  'If-Unmodified-Since',\n  'Keep-Alive',\n  'Last-Modified',\n  'Link',\n  'Location',\n  'Max-Forwards',\n  'Origin',\n  'Permissions-Policy',\n  'Pragma',\n  'Proxy-Authenticate',\n  'Proxy-Authorization',\n  'RTT',\n  'Range',\n  'Referer',\n  'Referrer-Policy',\n  'Refresh',\n  'Retry-After',\n  'Sec-WebSocket-Accept',\n  'Sec-WebSocket-Extensions',\n  'Sec-WebSocket-Key',\n  'Sec-WebSocket-Protocol',\n  'Sec-WebSocket-Version',\n  'Server',\n  'Server-Timing',\n  'Service-Worker-Allowed',\n  'Service-Worker-Navigation-Preload',\n  'Set-Cookie',\n  'SourceMap',\n  'Strict-Transport-Security',\n  'Supports-Loading-Mode',\n  'TE',\n  'Timing-Allow-Origin',\n  'Trailer',\n  'Transfer-Encoding',\n  'Upgrade',\n  'Upgrade-Insecure-Requests',\n  'User-Agent',\n  'Vary',\n  'Via',\n  'WWW-Authenticate',\n  'X-Content-Type-Options',\n  'X-DNS-Prefetch-Control',\n  'X-Frame-Options',\n  'X-Permitted-Cross-Domain-Policies',\n  'X-Powered-By',\n  'X-Requested-With',\n  'X-XSS-Protection'\n]\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n  const key = wellknownHeaderNames[i]\n  const lowerCasedKey = key.toLowerCase()\n  headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =\n    lowerCasedKey\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(headerNameLowerCasedRecord, null)\n\nmodule.exports = {\n  wellknownHeaderNames,\n  headerNameLowerCasedRecord\n}\n","'use strict'\nconst diagnosticsChannel = require('node:diagnostics_channel')\nconst util = require('node:util')\n\nconst undiciDebugLog = util.debuglog('undici')\nconst fetchDebuglog = util.debuglog('fetch')\nconst websocketDebuglog = util.debuglog('websocket')\nlet isClientSet = false\nconst channels = {\n  // Client\n  beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),\n  connected: diagnosticsChannel.channel('undici:client:connected'),\n  connectError: diagnosticsChannel.channel('undici:client:connectError'),\n  sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),\n  // Request\n  create: diagnosticsChannel.channel('undici:request:create'),\n  bodySent: diagnosticsChannel.channel('undici:request:bodySent'),\n  headers: diagnosticsChannel.channel('undici:request:headers'),\n  trailers: diagnosticsChannel.channel('undici:request:trailers'),\n  error: diagnosticsChannel.channel('undici:request:error'),\n  // WebSocket\n  open: diagnosticsChannel.channel('undici:websocket:open'),\n  close: diagnosticsChannel.channel('undici:websocket:close'),\n  socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),\n  ping: diagnosticsChannel.channel('undici:websocket:ping'),\n  pong: diagnosticsChannel.channel('undici:websocket:pong')\n}\n\nif (undiciDebugLog.enabled || fetchDebuglog.enabled) {\n  const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog\n\n  // Track all Client events\n  diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host }\n    } = evt\n    debuglog(\n      'connecting to %s using %s%s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host }\n    } = evt\n    debuglog(\n      'connected to %s using %s%s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host },\n      error\n    } = evt\n    debuglog(\n      'connection to %s using %s%s errored - %s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version,\n      error.message\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n    const {\n      request: { method, path, origin }\n    } = evt\n    debuglog('sending request to %s %s/%s', method, origin, path)\n  })\n\n  // Track Request events\n  diagnosticsChannel.channel('undici:request:headers').subscribe(evt => {\n    const {\n      request: { method, path, origin },\n      response: { statusCode }\n    } = evt\n    debuglog(\n      'received response to %s %s/%s - HTTP %d',\n      method,\n      origin,\n      path,\n      statusCode\n    )\n  })\n\n  diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => {\n    const {\n      request: { method, path, origin }\n    } = evt\n    debuglog('trailers received from %s %s/%s', method, origin, path)\n  })\n\n  diagnosticsChannel.channel('undici:request:error').subscribe(evt => {\n    const {\n      request: { method, path, origin },\n      error\n    } = evt\n    debuglog(\n      'request to %s %s/%s errored - %s',\n      method,\n      origin,\n      path,\n      error.message\n    )\n  })\n\n  isClientSet = true\n}\n\nif (websocketDebuglog.enabled) {\n  if (!isClientSet) {\n    const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog\n    diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host }\n      } = evt\n      debuglog(\n        'connecting to %s%s using %s%s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host }\n      } = evt\n      debuglog(\n        'connected to %s%s using %s%s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host },\n        error\n      } = evt\n      debuglog(\n        'connection to %s%s using %s%s errored - %s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version,\n        error.message\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n      const {\n        request: { method, path, origin }\n      } = evt\n      debuglog('sending request to %s %s/%s', method, origin, path)\n    })\n  }\n\n  // Track all WebSocket events\n  diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => {\n    const {\n      address: { address, port }\n    } = evt\n    websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '')\n  })\n\n  diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => {\n    const { websocket, code, reason } = evt\n    websocketDebuglog(\n      'closed connection to %s - %s %s',\n      websocket.url,\n      code,\n      reason\n    )\n  })\n\n  diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => {\n    websocketDebuglog('connection errored - %s', err.message)\n  })\n\n  diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => {\n    websocketDebuglog('ping received')\n  })\n\n  diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => {\n    websocketDebuglog('pong received')\n  })\n}\n\nmodule.exports = {\n  channels\n}\n","'use strict'\n\nconst kUndiciError = Symbol.for('undici.error.UND_ERR')\nclass UndiciError extends Error {\n  constructor (message) {\n    super(message)\n    this.name = 'UndiciError'\n    this.code = 'UND_ERR'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kUndiciError] === true\n  }\n\n  [kUndiciError] = true\n}\n\nconst kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT')\nclass ConnectTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ConnectTimeoutError'\n    this.message = message || 'Connect Timeout Error'\n    this.code = 'UND_ERR_CONNECT_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kConnectTimeoutError] === true\n  }\n\n  [kConnectTimeoutError] = true\n}\n\nconst kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT')\nclass HeadersTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'HeadersTimeoutError'\n    this.message = message || 'Headers Timeout Error'\n    this.code = 'UND_ERR_HEADERS_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHeadersTimeoutError] === true\n  }\n\n  [kHeadersTimeoutError] = true\n}\n\nconst kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW')\nclass HeadersOverflowError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'HeadersOverflowError'\n    this.message = message || 'Headers Overflow Error'\n    this.code = 'UND_ERR_HEADERS_OVERFLOW'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHeadersOverflowError] === true\n  }\n\n  [kHeadersOverflowError] = true\n}\n\nconst kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT')\nclass BodyTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'BodyTimeoutError'\n    this.message = message || 'Body Timeout Error'\n    this.code = 'UND_ERR_BODY_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kBodyTimeoutError] === true\n  }\n\n  [kBodyTimeoutError] = true\n}\n\nconst kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE')\nclass ResponseStatusCodeError extends UndiciError {\n  constructor (message, statusCode, headers, body) {\n    super(message)\n    this.name = 'ResponseStatusCodeError'\n    this.message = message || 'Response Status Code Error'\n    this.code = 'UND_ERR_RESPONSE_STATUS_CODE'\n    this.body = body\n    this.status = statusCode\n    this.statusCode = statusCode\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseStatusCodeError] === true\n  }\n\n  [kResponseStatusCodeError] = true\n}\n\nconst kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG')\nclass InvalidArgumentError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InvalidArgumentError'\n    this.message = message || 'Invalid Argument Error'\n    this.code = 'UND_ERR_INVALID_ARG'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInvalidArgumentError] === true\n  }\n\n  [kInvalidArgumentError] = true\n}\n\nconst kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE')\nclass InvalidReturnValueError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InvalidReturnValueError'\n    this.message = message || 'Invalid Return Value Error'\n    this.code = 'UND_ERR_INVALID_RETURN_VALUE'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInvalidReturnValueError] === true\n  }\n\n  [kInvalidReturnValueError] = true\n}\n\nconst kAbortError = Symbol.for('undici.error.UND_ERR_ABORT')\nclass AbortError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'AbortError'\n    this.message = message || 'The operation was aborted'\n    this.code = 'UND_ERR_ABORT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kAbortError] === true\n  }\n\n  [kAbortError] = true\n}\n\nconst kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED')\nclass RequestAbortedError extends AbortError {\n  constructor (message) {\n    super(message)\n    this.name = 'AbortError'\n    this.message = message || 'Request aborted'\n    this.code = 'UND_ERR_ABORTED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestAbortedError] === true\n  }\n\n  [kRequestAbortedError] = true\n}\n\nconst kInformationalError = Symbol.for('undici.error.UND_ERR_INFO')\nclass InformationalError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InformationalError'\n    this.message = message || 'Request information'\n    this.code = 'UND_ERR_INFO'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInformationalError] === true\n  }\n\n  [kInformationalError] = true\n}\n\nconst kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH')\nclass RequestContentLengthMismatchError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'RequestContentLengthMismatchError'\n    this.message = message || 'Request body length does not match content-length header'\n    this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestContentLengthMismatchError] === true\n  }\n\n  [kRequestContentLengthMismatchError] = true\n}\n\nconst kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH')\nclass ResponseContentLengthMismatchError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ResponseContentLengthMismatchError'\n    this.message = message || 'Response body length does not match content-length header'\n    this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseContentLengthMismatchError] === true\n  }\n\n  [kResponseContentLengthMismatchError] = true\n}\n\nconst kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED')\nclass ClientDestroyedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ClientDestroyedError'\n    this.message = message || 'The client is destroyed'\n    this.code = 'UND_ERR_DESTROYED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kClientDestroyedError] === true\n  }\n\n  [kClientDestroyedError] = true\n}\n\nconst kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED')\nclass ClientClosedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ClientClosedError'\n    this.message = message || 'The client is closed'\n    this.code = 'UND_ERR_CLOSED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kClientClosedError] === true\n  }\n\n  [kClientClosedError] = true\n}\n\nconst kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET')\nclass SocketError extends UndiciError {\n  constructor (message, socket) {\n    super(message)\n    this.name = 'SocketError'\n    this.message = message || 'Socket error'\n    this.code = 'UND_ERR_SOCKET'\n    this.socket = socket\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kSocketError] === true\n  }\n\n  [kSocketError] = true\n}\n\nconst kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED')\nclass NotSupportedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'NotSupportedError'\n    this.message = message || 'Not supported error'\n    this.code = 'UND_ERR_NOT_SUPPORTED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kNotSupportedError] === true\n  }\n\n  [kNotSupportedError] = true\n}\n\nconst kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM')\nclass BalancedPoolMissingUpstreamError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'MissingUpstreamError'\n    this.message = message || 'No upstream has been added to the BalancedPool'\n    this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kBalancedPoolMissingUpstreamError] === true\n  }\n\n  [kBalancedPoolMissingUpstreamError] = true\n}\n\nconst kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')\nclass HTTPParserError extends Error {\n  constructor (message, code, data) {\n    super(message)\n    this.name = 'HTTPParserError'\n    this.code = code ? `HPE_${code}` : undefined\n    this.data = data ? data.toString() : undefined\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHTTPParserError] === true\n  }\n\n  [kHTTPParserError] = true\n}\n\nconst kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE')\nclass ResponseExceededMaxSizeError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ResponseExceededMaxSizeError'\n    this.message = message || 'Response content exceeded max size'\n    this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseExceededMaxSizeError] === true\n  }\n\n  [kResponseExceededMaxSizeError] = true\n}\n\nconst kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY')\nclass RequestRetryError extends UndiciError {\n  constructor (message, code, { headers, data }) {\n    super(message)\n    this.name = 'RequestRetryError'\n    this.message = message || 'Request retry error'\n    this.code = 'UND_ERR_REQ_RETRY'\n    this.statusCode = code\n    this.data = data\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestRetryError] === true\n  }\n\n  [kRequestRetryError] = true\n}\n\nconst kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')\nclass ResponseError extends UndiciError {\n  constructor (message, code, { headers, data }) {\n    super(message)\n    this.name = 'ResponseError'\n    this.message = message || 'Response error'\n    this.code = 'UND_ERR_RESPONSE'\n    this.statusCode = code\n    this.data = data\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseError] === true\n  }\n\n  [kResponseError] = true\n}\n\nconst kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS')\nclass SecureProxyConnectionError extends UndiciError {\n  constructor (cause, message, options) {\n    super(message, { cause, ...(options ?? {}) })\n    this.name = 'SecureProxyConnectionError'\n    this.message = message || 'Secure Proxy Connection failed'\n    this.code = 'UND_ERR_PRX_TLS'\n    this.cause = cause\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kSecureProxyConnectionError] === true\n  }\n\n  [kSecureProxyConnectionError] = true\n}\n\nconst kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED')\nclass MessageSizeExceededError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'MessageSizeExceededError'\n    this.message = message || 'Max decompressed message size exceeded'\n    this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kMessageSizeExceededError] === true\n  }\n\n  get [kMessageSizeExceededError] () {\n    return true\n  }\n}\n\nmodule.exports = {\n  AbortError,\n  HTTPParserError,\n  UndiciError,\n  HeadersTimeoutError,\n  HeadersOverflowError,\n  BodyTimeoutError,\n  RequestContentLengthMismatchError,\n  ConnectTimeoutError,\n  ResponseStatusCodeError,\n  InvalidArgumentError,\n  InvalidReturnValueError,\n  RequestAbortedError,\n  ClientDestroyedError,\n  ClientClosedError,\n  InformationalError,\n  SocketError,\n  NotSupportedError,\n  ResponseContentLengthMismatchError,\n  BalancedPoolMissingUpstreamError,\n  ResponseExceededMaxSizeError,\n  RequestRetryError,\n  ResponseError,\n  SecureProxyConnectionError,\n  MessageSizeExceededError\n}\n","'use strict'\n\nconst {\n  InvalidArgumentError,\n  NotSupportedError\n} = require('./errors')\nconst assert = require('node:assert')\nconst {\n  isValidHTTPToken,\n  isValidHeaderValue,\n  isStream,\n  destroy,\n  isBuffer,\n  isFormDataLike,\n  isIterable,\n  isBlobLike,\n  buildURL,\n  validateHandler,\n  getServerName,\n  normalizedMethodRecords\n} = require('./util')\nconst { channels } = require('./diagnostics.js')\nconst { headerNameLowerCasedRecord } = require('./constants')\n\n// Verifies that a given path is valid does not contain control chars \\x00 to \\x20\nconst invalidPathRegex = /[^\\u0021-\\u00ff]/\n\nconst kHandler = Symbol('handler')\n\nclass Request {\n  constructor (origin, {\n    path,\n    method,\n    body,\n    headers,\n    query,\n    idempotent,\n    blocking,\n    upgrade,\n    headersTimeout,\n    bodyTimeout,\n    reset,\n    throwOnError,\n    expectContinue,\n    servername\n  }, handler) {\n    if (typeof path !== 'string') {\n      throw new InvalidArgumentError('path must be a string')\n    } else if (\n      path[0] !== '/' &&\n      !(path.startsWith('http://') || path.startsWith('https://')) &&\n      method !== 'CONNECT'\n    ) {\n      throw new InvalidArgumentError('path must be an absolute URL or start with a slash')\n    } else if (invalidPathRegex.test(path)) {\n      throw new InvalidArgumentError('invalid request path')\n    }\n\n    if (typeof method !== 'string') {\n      throw new InvalidArgumentError('method must be a string')\n    } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {\n      throw new InvalidArgumentError('invalid request method')\n    }\n\n    if (upgrade && typeof upgrade !== 'string') {\n      throw new InvalidArgumentError('upgrade must be a string')\n    }\n\n    if (upgrade && !isValidHeaderValue(upgrade)) {\n      throw new InvalidArgumentError('invalid upgrade header')\n    }\n\n    if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n      throw new InvalidArgumentError('invalid headersTimeout')\n    }\n\n    if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n      throw new InvalidArgumentError('invalid bodyTimeout')\n    }\n\n    if (reset != null && typeof reset !== 'boolean') {\n      throw new InvalidArgumentError('invalid reset')\n    }\n\n    if (expectContinue != null && typeof expectContinue !== 'boolean') {\n      throw new InvalidArgumentError('invalid expectContinue')\n    }\n\n    this.headersTimeout = headersTimeout\n\n    this.bodyTimeout = bodyTimeout\n\n    this.throwOnError = throwOnError === true\n\n    this.method = method\n\n    this.abort = null\n\n    if (body == null) {\n      this.body = null\n    } else if (isStream(body)) {\n      this.body = body\n\n      const rState = this.body._readableState\n      if (!rState || !rState.autoDestroy) {\n        this.endHandler = function autoDestroy () {\n          destroy(this)\n        }\n        this.body.on('end', this.endHandler)\n      }\n\n      this.errorHandler = err => {\n        if (this.abort) {\n          this.abort(err)\n        } else {\n          this.error = err\n        }\n      }\n      this.body.on('error', this.errorHandler)\n    } else if (isBuffer(body)) {\n      this.body = body.byteLength ? body : null\n    } else if (ArrayBuffer.isView(body)) {\n      this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null\n    } else if (body instanceof ArrayBuffer) {\n      this.body = body.byteLength ? Buffer.from(body) : null\n    } else if (typeof body === 'string') {\n      this.body = body.length ? Buffer.from(body) : null\n    } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {\n      this.body = body\n    } else {\n      throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')\n    }\n\n    this.completed = false\n\n    this.aborted = false\n\n    this.upgrade = upgrade || null\n\n    this.path = query ? buildURL(path, query) : path\n\n    this.origin = origin\n\n    this.idempotent = idempotent == null\n      ? method === 'HEAD' || method === 'GET'\n      : idempotent\n\n    this.blocking = blocking == null ? false : blocking\n\n    this.reset = reset == null ? null : reset\n\n    this.host = null\n\n    this.contentLength = null\n\n    this.contentType = null\n\n    this.headers = []\n\n    // Only for H2\n    this.expectContinue = expectContinue != null ? expectContinue : false\n\n    if (Array.isArray(headers)) {\n      if (headers.length % 2 !== 0) {\n        throw new InvalidArgumentError('headers array must be even')\n      }\n      for (let i = 0; i < headers.length; i += 2) {\n        processHeader(this, headers[i], headers[i + 1])\n      }\n    } else if (headers && typeof headers === 'object') {\n      if (headers[Symbol.iterator]) {\n        for (const header of headers) {\n          if (!Array.isArray(header) || header.length !== 2) {\n            throw new InvalidArgumentError('headers must be in key-value pair format')\n          }\n          processHeader(this, header[0], header[1])\n        }\n      } else {\n        const keys = Object.keys(headers)\n        for (let i = 0; i < keys.length; ++i) {\n          processHeader(this, keys[i], headers[keys[i]])\n        }\n      }\n    } else if (headers != null) {\n      throw new InvalidArgumentError('headers must be an object or an array')\n    }\n\n    validateHandler(handler, method, upgrade)\n\n    this.servername = servername || getServerName(this.host)\n\n    this[kHandler] = handler\n\n    if (channels.create.hasSubscribers) {\n      channels.create.publish({ request: this })\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this[kHandler].onBodySent) {\n      try {\n        return this[kHandler].onBodySent(chunk)\n      } catch (err) {\n        this.abort(err)\n      }\n    }\n  }\n\n  onRequestSent () {\n    if (channels.bodySent.hasSubscribers) {\n      channels.bodySent.publish({ request: this })\n    }\n\n    if (this[kHandler].onRequestSent) {\n      try {\n        return this[kHandler].onRequestSent()\n      } catch (err) {\n        this.abort(err)\n      }\n    }\n  }\n\n  onConnect (abort) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    if (this.error) {\n      abort(this.error)\n    } else {\n      this.abort = abort\n      return this[kHandler].onConnect(abort)\n    }\n  }\n\n  onResponseStarted () {\n    return this[kHandler].onResponseStarted?.()\n  }\n\n  onHeaders (statusCode, headers, resume, statusText) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    if (channels.headers.hasSubscribers) {\n      channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n    }\n\n    try {\n      return this[kHandler].onHeaders(statusCode, headers, resume, statusText)\n    } catch (err) {\n      this.abort(err)\n    }\n  }\n\n  onData (chunk) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    try {\n      return this[kHandler].onData(chunk)\n    } catch (err) {\n      this.abort(err)\n      return false\n    }\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    return this[kHandler].onUpgrade(statusCode, headers, socket)\n  }\n\n  onComplete (trailers) {\n    this.onFinally()\n\n    assert(!this.aborted)\n\n    this.completed = true\n    if (channels.trailers.hasSubscribers) {\n      channels.trailers.publish({ request: this, trailers })\n    }\n\n    try {\n      return this[kHandler].onComplete(trailers)\n    } catch (err) {\n      // TODO (fix): This might be a bad idea?\n      this.onError(err)\n    }\n  }\n\n  onError (error) {\n    this.onFinally()\n\n    if (channels.error.hasSubscribers) {\n      channels.error.publish({ request: this, error })\n    }\n\n    if (this.aborted) {\n      return\n    }\n    this.aborted = true\n\n    return this[kHandler].onError(error)\n  }\n\n  onFinally () {\n    if (this.errorHandler) {\n      this.body.off('error', this.errorHandler)\n      this.errorHandler = null\n    }\n\n    if (this.endHandler) {\n      this.body.off('end', this.endHandler)\n      this.endHandler = null\n    }\n  }\n\n  addHeader (key, value) {\n    processHeader(this, key, value)\n    return this\n  }\n}\n\nfunction processHeader (request, key, val) {\n  if (val && (typeof val === 'object' && !Array.isArray(val))) {\n    throw new InvalidArgumentError(`invalid ${key} header`)\n  } else if (val === undefined) {\n    return\n  }\n\n  let headerName = headerNameLowerCasedRecord[key]\n\n  if (headerName === undefined) {\n    headerName = key.toLowerCase()\n    if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {\n      throw new InvalidArgumentError('invalid header key')\n    }\n  }\n\n  if (Array.isArray(val)) {\n    const arr = []\n    for (let i = 0; i < val.length; i++) {\n      if (typeof val[i] === 'string') {\n        if (!isValidHeaderValue(val[i])) {\n          throw new InvalidArgumentError(`invalid ${key} header`)\n        }\n        arr.push(val[i])\n      } else if (val[i] === null) {\n        arr.push('')\n      } else if (typeof val[i] === 'object') {\n        throw new InvalidArgumentError(`invalid ${key} header`)\n      } else {\n        arr.push(`${val[i]}`)\n      }\n    }\n    val = arr\n  } else if (typeof val === 'string') {\n    if (!isValidHeaderValue(val)) {\n      throw new InvalidArgumentError(`invalid ${key} header`)\n    }\n  } else if (val === null) {\n    val = ''\n  } else {\n    val = `${val}`\n  }\n\n  if (headerName === 'host') {\n    if (request.host !== null) {\n      throw new InvalidArgumentError('duplicate host header')\n    }\n    if (typeof val !== 'string') {\n      throw new InvalidArgumentError('invalid host header')\n    }\n    // Consumed by Client\n    request.host = val\n  } else if (headerName === 'content-length') {\n    if (request.contentLength !== null) {\n      throw new InvalidArgumentError('duplicate content-length header')\n    }\n    request.contentLength = parseInt(val, 10)\n    if (!Number.isFinite(request.contentLength)) {\n      throw new InvalidArgumentError('invalid content-length header')\n    }\n  } else if (request.contentType === null && headerName === 'content-type') {\n    request.contentType = val\n    request.headers.push(key, val)\n  } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {\n    throw new InvalidArgumentError(`invalid ${headerName} header`)\n  } else if (headerName === 'connection') {\n    const value = typeof val === 'string' ? val.toLowerCase() : null\n    if (value !== 'close' && value !== 'keep-alive') {\n      throw new InvalidArgumentError('invalid connection header')\n    }\n\n    if (value === 'close') {\n      request.reset = true\n    }\n  } else if (headerName === 'expect') {\n    throw new NotSupportedError('expect header not supported')\n  } else {\n    request.headers.push(key, val)\n  }\n}\n\nmodule.exports = Request\n","module.exports = {\n  kClose: Symbol('close'),\n  kDestroy: Symbol('destroy'),\n  kDispatch: Symbol('dispatch'),\n  kUrl: Symbol('url'),\n  kWriting: Symbol('writing'),\n  kResuming: Symbol('resuming'),\n  kQueue: Symbol('queue'),\n  kConnect: Symbol('connect'),\n  kConnecting: Symbol('connecting'),\n  kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),\n  kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),\n  kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),\n  kKeepAliveTimeoutValue: Symbol('keep alive timeout'),\n  kKeepAlive: Symbol('keep alive'),\n  kHeadersTimeout: Symbol('headers timeout'),\n  kBodyTimeout: Symbol('body timeout'),\n  kServerName: Symbol('server name'),\n  kLocalAddress: Symbol('local address'),\n  kHost: Symbol('host'),\n  kNoRef: Symbol('no ref'),\n  kBodyUsed: Symbol('used'),\n  kBody: Symbol('abstracted request body'),\n  kRunning: Symbol('running'),\n  kBlocking: Symbol('blocking'),\n  kPending: Symbol('pending'),\n  kSize: Symbol('size'),\n  kBusy: Symbol('busy'),\n  kQueued: Symbol('queued'),\n  kFree: Symbol('free'),\n  kConnected: Symbol('connected'),\n  kClosed: Symbol('closed'),\n  kNeedDrain: Symbol('need drain'),\n  kReset: Symbol('reset'),\n  kDestroyed: Symbol.for('nodejs.stream.destroyed'),\n  kResume: Symbol('resume'),\n  kOnError: Symbol('on error'),\n  kMaxHeadersSize: Symbol('max headers size'),\n  kRunningIdx: Symbol('running index'),\n  kPendingIdx: Symbol('pending index'),\n  kError: Symbol('error'),\n  kClients: Symbol('clients'),\n  kClient: Symbol('client'),\n  kParser: Symbol('parser'),\n  kOnDestroyed: Symbol('destroy callbacks'),\n  kPipelining: Symbol('pipelining'),\n  kSocket: Symbol('socket'),\n  kHostHeader: Symbol('host header'),\n  kConnector: Symbol('connector'),\n  kStrictContentLength: Symbol('strict content length'),\n  kMaxRedirections: Symbol('maxRedirections'),\n  kMaxRequests: Symbol('maxRequestsPerClient'),\n  kProxy: Symbol('proxy agent options'),\n  kCounter: Symbol('socket request counter'),\n  kInterceptors: Symbol('dispatch interceptors'),\n  kMaxResponseSize: Symbol('max response size'),\n  kHTTP2Session: Symbol('http2Session'),\n  kHTTP2SessionState: Symbol('http2Session state'),\n  kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),\n  kConstruct: Symbol('constructable'),\n  kListeners: Symbol('listeners'),\n  kHTTPContext: Symbol('http context'),\n  kMaxConcurrentStreams: Symbol('max concurrent streams'),\n  kNoProxyAgent: Symbol('no proxy agent'),\n  kHttpProxyAgent: Symbol('http proxy agent'),\n  kHttpsProxyAgent: Symbol('https proxy agent')\n}\n","'use strict'\n\nconst {\n  wellknownHeaderNames,\n  headerNameLowerCasedRecord\n} = require('./constants')\n\nclass TstNode {\n  /** @type {any} */\n  value = null\n  /** @type {null | TstNode} */\n  left = null\n  /** @type {null | TstNode} */\n  middle = null\n  /** @type {null | TstNode} */\n  right = null\n  /** @type {number} */\n  code\n  /**\n   * @param {string} key\n   * @param {any} value\n   * @param {number} index\n   */\n  constructor (key, value, index) {\n    if (index === undefined || index >= key.length) {\n      throw new TypeError('Unreachable')\n    }\n    const code = this.code = key.charCodeAt(index)\n    // check code is ascii string\n    if (code > 0x7F) {\n      throw new TypeError('key must be ascii string')\n    }\n    if (key.length !== ++index) {\n      this.middle = new TstNode(key, value, index)\n    } else {\n      this.value = value\n    }\n  }\n\n  /**\n   * @param {string} key\n   * @param {any} value\n   */\n  add (key, value) {\n    const length = key.length\n    if (length === 0) {\n      throw new TypeError('Unreachable')\n    }\n    let index = 0\n    let node = this\n    while (true) {\n      const code = key.charCodeAt(index)\n      // check code is ascii string\n      if (code > 0x7F) {\n        throw new TypeError('key must be ascii string')\n      }\n      if (node.code === code) {\n        if (length === ++index) {\n          node.value = value\n          break\n        } else if (node.middle !== null) {\n          node = node.middle\n        } else {\n          node.middle = new TstNode(key, value, index)\n          break\n        }\n      } else if (node.code < code) {\n        if (node.left !== null) {\n          node = node.left\n        } else {\n          node.left = new TstNode(key, value, index)\n          break\n        }\n      } else if (node.right !== null) {\n        node = node.right\n      } else {\n        node.right = new TstNode(key, value, index)\n        break\n      }\n    }\n  }\n\n  /**\n   * @param {Uint8Array} key\n   * @return {TstNode | null}\n   */\n  search (key) {\n    const keylength = key.length\n    let index = 0\n    let node = this\n    while (node !== null && index < keylength) {\n      let code = key[index]\n      // A-Z\n      // First check if it is bigger than 0x5a.\n      // Lowercase letters have higher char codes than uppercase ones.\n      // Also we assume that headers will mostly contain lowercase characters.\n      if (code <= 0x5a && code >= 0x41) {\n        // Lowercase for uppercase.\n        code |= 32\n      }\n      while (node !== null) {\n        if (code === node.code) {\n          if (keylength === ++index) {\n            // Returns Node since it is the last key.\n            return node\n          }\n          node = node.middle\n          break\n        }\n        node = node.code < code ? node.left : node.right\n      }\n    }\n    return null\n  }\n}\n\nclass TernarySearchTree {\n  /** @type {TstNode | null} */\n  node = null\n\n  /**\n   * @param {string} key\n   * @param {any} value\n   * */\n  insert (key, value) {\n    if (this.node === null) {\n      this.node = new TstNode(key, value, 0)\n    } else {\n      this.node.add(key, value)\n    }\n  }\n\n  /**\n   * @param {Uint8Array} key\n   * @return {any}\n   */\n  lookup (key) {\n    return this.node?.search(key)?.value ?? null\n  }\n}\n\nconst tree = new TernarySearchTree()\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n  const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]\n  tree.insert(key, key)\n}\n\nmodule.exports = {\n  TernarySearchTree,\n  tree\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')\nconst { IncomingMessage } = require('node:http')\nconst stream = require('node:stream')\nconst net = require('node:net')\nconst { Blob } = require('node:buffer')\nconst nodeUtil = require('node:util')\nconst { stringify } = require('node:querystring')\nconst { EventEmitter: EE } = require('node:events')\nconst { InvalidArgumentError } = require('./errors')\nconst { headerNameLowerCasedRecord } = require('./constants')\nconst { tree } = require('./tree')\n\nconst [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))\n\nclass BodyAsyncIterable {\n  constructor (body) {\n    this[kBody] = body\n    this[kBodyUsed] = false\n  }\n\n  async * [Symbol.asyncIterator] () {\n    assert(!this[kBodyUsed], 'disturbed')\n    this[kBodyUsed] = true\n    yield * this[kBody]\n  }\n}\n\nfunction wrapRequestBody (body) {\n  if (isStream(body)) {\n    // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n    // so that it can be dispatched again?\n    // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n    if (bodyLength(body) === 0) {\n      body\n        .on('data', function () {\n          assert(false)\n        })\n    }\n\n    if (typeof body.readableDidRead !== 'boolean') {\n      body[kBodyUsed] = false\n      EE.prototype.on.call(body, 'data', function () {\n        this[kBodyUsed] = true\n      })\n    }\n\n    return body\n  } else if (body && typeof body.pipeTo === 'function') {\n    // TODO (fix): We can't access ReadableStream internal state\n    // to determine whether or not it has been disturbed. This is just\n    // a workaround.\n    return new BodyAsyncIterable(body)\n  } else if (\n    body &&\n    typeof body !== 'string' &&\n    !ArrayBuffer.isView(body) &&\n    isIterable(body)\n  ) {\n    // TODO: Should we allow re-using iterable if !this.opts.idempotent\n    // or through some other flag?\n    return new BodyAsyncIterable(body)\n  } else {\n    return body\n  }\n}\n\nfunction nop () {}\n\nfunction isStream (obj) {\n  return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'\n}\n\n// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)\nfunction isBlobLike (object) {\n  if (object === null) {\n    return false\n  } else if (object instanceof Blob) {\n    return true\n  } else if (typeof object !== 'object') {\n    return false\n  } else {\n    const sTag = object[Symbol.toStringTag]\n\n    return (sTag === 'Blob' || sTag === 'File') && (\n      ('stream' in object && typeof object.stream === 'function') ||\n      ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')\n    )\n  }\n}\n\nfunction buildURL (url, queryParams) {\n  if (url.includes('?') || url.includes('#')) {\n    throw new Error('Query params cannot be passed when url already contains \"?\" or \"#\".')\n  }\n\n  const stringified = stringify(queryParams)\n\n  if (stringified) {\n    url += '?' + stringified\n  }\n\n  return url\n}\n\nfunction isValidPort (port) {\n  const value = parseInt(port, 10)\n  return (\n    value === Number(port) &&\n    value >= 0 &&\n    value <= 65535\n  )\n}\n\nfunction isHttpOrHttpsPrefixed (value) {\n  return (\n    value != null &&\n    value[0] === 'h' &&\n    value[1] === 't' &&\n    value[2] === 't' &&\n    value[3] === 'p' &&\n    (\n      value[4] === ':' ||\n      (\n        value[4] === 's' &&\n        value[5] === ':'\n      )\n    )\n  )\n}\n\nfunction parseURL (url) {\n  if (typeof url === 'string') {\n    url = new URL(url)\n\n    if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n      throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n    }\n\n    return url\n  }\n\n  if (!url || typeof url !== 'object') {\n    throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')\n  }\n\n  if (!(url instanceof URL)) {\n    if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {\n      throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')\n    }\n\n    if (url.path != null && typeof url.path !== 'string') {\n      throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')\n    }\n\n    if (url.pathname != null && typeof url.pathname !== 'string') {\n      throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')\n    }\n\n    if (url.hostname != null && typeof url.hostname !== 'string') {\n      throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')\n    }\n\n    if (url.origin != null && typeof url.origin !== 'string') {\n      throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')\n    }\n\n    if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n      throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n    }\n\n    const port = url.port != null\n      ? url.port\n      : (url.protocol === 'https:' ? 443 : 80)\n    let origin = url.origin != null\n      ? url.origin\n      : `${url.protocol || ''}//${url.hostname || ''}:${port}`\n    let path = url.path != null\n      ? url.path\n      : `${url.pathname || ''}${url.search || ''}`\n\n    if (origin[origin.length - 1] === '/') {\n      origin = origin.slice(0, origin.length - 1)\n    }\n\n    if (path && path[0] !== '/') {\n      path = `/${path}`\n    }\n    // new URL(path, origin) is unsafe when `path` contains an absolute URL\n    // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:\n    // If first parameter is a relative URL, second param is required, and will be used as the base URL.\n    // If first parameter is an absolute URL, a given second param will be ignored.\n    return new URL(`${origin}${path}`)\n  }\n\n  if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n    throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n  }\n\n  return url\n}\n\nfunction parseOrigin (url) {\n  url = parseURL(url)\n\n  if (url.pathname !== '/' || url.search || url.hash) {\n    throw new InvalidArgumentError('invalid url')\n  }\n\n  return url\n}\n\nfunction getHostname (host) {\n  if (host[0] === '[') {\n    const idx = host.indexOf(']')\n\n    assert(idx !== -1)\n    return host.substring(1, idx)\n  }\n\n  const idx = host.indexOf(':')\n  if (idx === -1) return host\n\n  return host.substring(0, idx)\n}\n\n// IP addresses are not valid server names per RFC6066\n// > Currently, the only server names supported are DNS hostnames\nfunction getServerName (host) {\n  if (!host) {\n    return null\n  }\n\n  assert(typeof host === 'string')\n\n  const servername = getHostname(host)\n  if (net.isIP(servername)) {\n    return ''\n  }\n\n  return servername\n}\n\nfunction deepClone (obj) {\n  return JSON.parse(JSON.stringify(obj))\n}\n\nfunction isAsyncIterable (obj) {\n  return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')\n}\n\nfunction isIterable (obj) {\n  return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))\n}\n\nfunction bodyLength (body) {\n  if (body == null) {\n    return 0\n  } else if (isStream(body)) {\n    const state = body._readableState\n    return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)\n      ? state.length\n      : null\n  } else if (isBlobLike(body)) {\n    return body.size != null ? body.size : null\n  } else if (isBuffer(body)) {\n    return body.byteLength\n  }\n\n  return null\n}\n\nfunction isDestroyed (body) {\n  return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))\n}\n\nfunction destroy (stream, err) {\n  if (stream == null || !isStream(stream) || isDestroyed(stream)) {\n    return\n  }\n\n  if (typeof stream.destroy === 'function') {\n    if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {\n      // See: https://github.com/nodejs/node/pull/38505/files\n      stream.socket = null\n    }\n\n    stream.destroy(err)\n  } else if (err) {\n    queueMicrotask(() => {\n      stream.emit('error', err)\n    })\n  }\n\n  if (stream.destroyed !== true) {\n    stream[kDestroyed] = true\n  }\n}\n\nconst KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/\nfunction parseKeepAliveTimeout (val) {\n  const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)\n  return m ? parseInt(m[1], 10) * 1000 : null\n}\n\n/**\n * Retrieves a header name and returns its lowercase value.\n * @param {string | Buffer} value Header name\n * @returns {string}\n */\nfunction headerNameToString (value) {\n  return typeof value === 'string'\n    ? headerNameLowerCasedRecord[value] ?? value.toLowerCase()\n    : tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * Receive the buffer as a string and return its lowercase value.\n * @param {Buffer} value Header name\n * @returns {string}\n */\nfunction bufferToLowerCasedHeaderName (value) {\n  return tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers\n * @param {Record} [obj]\n * @returns {Record}\n */\nfunction parseHeaders (headers, obj) {\n  if (obj === undefined) obj = {}\n  for (let i = 0; i < headers.length; i += 2) {\n    const key = headerNameToString(headers[i])\n    let val = obj[key]\n\n    if (val) {\n      if (typeof val === 'string') {\n        val = [val]\n        obj[key] = val\n      }\n      val.push(headers[i + 1].toString('utf8'))\n    } else {\n      const headersValue = headers[i + 1]\n      if (typeof headersValue === 'string') {\n        obj[key] = headersValue\n      } else {\n        obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')\n      }\n    }\n  }\n\n  // See https://github.com/nodejs/node/pull/46528\n  if ('content-length' in obj && 'content-disposition' in obj) {\n    obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')\n  }\n\n  return obj\n}\n\nfunction parseRawHeaders (headers) {\n  const len = headers.length\n  const ret = new Array(len)\n\n  let hasContentLength = false\n  let contentDispositionIdx = -1\n  let key\n  let val\n  let kLen = 0\n\n  for (let n = 0; n < headers.length; n += 2) {\n    key = headers[n]\n    val = headers[n + 1]\n\n    typeof key !== 'string' && (key = key.toString())\n    typeof val !== 'string' && (val = val.toString('utf8'))\n\n    kLen = key.length\n    if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {\n      hasContentLength = true\n    } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {\n      contentDispositionIdx = n + 1\n    }\n    ret[n] = key\n    ret[n + 1] = val\n  }\n\n  // See https://github.com/nodejs/node/pull/46528\n  if (hasContentLength && contentDispositionIdx !== -1) {\n    ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')\n  }\n\n  return ret\n}\n\nfunction isBuffer (buffer) {\n  // See, https://github.com/mcollina/undici/pull/319\n  return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)\n}\n\nfunction validateHandler (handler, method, upgrade) {\n  if (!handler || typeof handler !== 'object') {\n    throw new InvalidArgumentError('handler must be an object')\n  }\n\n  if (typeof handler.onConnect !== 'function') {\n    throw new InvalidArgumentError('invalid onConnect method')\n  }\n\n  if (typeof handler.onError !== 'function') {\n    throw new InvalidArgumentError('invalid onError method')\n  }\n\n  if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {\n    throw new InvalidArgumentError('invalid onBodySent method')\n  }\n\n  if (upgrade || method === 'CONNECT') {\n    if (typeof handler.onUpgrade !== 'function') {\n      throw new InvalidArgumentError('invalid onUpgrade method')\n    }\n  } else {\n    if (typeof handler.onHeaders !== 'function') {\n      throw new InvalidArgumentError('invalid onHeaders method')\n    }\n\n    if (typeof handler.onData !== 'function') {\n      throw new InvalidArgumentError('invalid onData method')\n    }\n\n    if (typeof handler.onComplete !== 'function') {\n      throw new InvalidArgumentError('invalid onComplete method')\n    }\n  }\n}\n\n// A body is disturbed if it has been read from and it cannot\n// be re-used without losing state or data.\nfunction isDisturbed (body) {\n  // TODO (fix): Why is body[kBodyUsed] needed?\n  return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))\n}\n\nfunction isErrored (body) {\n  return !!(body && stream.isErrored(body))\n}\n\nfunction isReadable (body) {\n  return !!(body && stream.isReadable(body))\n}\n\nfunction getSocketInfo (socket) {\n  return {\n    localAddress: socket.localAddress,\n    localPort: socket.localPort,\n    remoteAddress: socket.remoteAddress,\n    remotePort: socket.remotePort,\n    remoteFamily: socket.remoteFamily,\n    timeout: socket.timeout,\n    bytesWritten: socket.bytesWritten,\n    bytesRead: socket.bytesRead\n  }\n}\n\n/** @type {globalThis['ReadableStream']} */\nfunction ReadableStreamFrom (iterable) {\n  // We cannot use ReadableStream.from here because it does not return a byte stream.\n\n  let iterator\n  return new ReadableStream(\n    {\n      async start () {\n        iterator = iterable[Symbol.asyncIterator]()\n      },\n      async pull (controller) {\n        const { done, value } = await iterator.next()\n        if (done) {\n          queueMicrotask(() => {\n            controller.close()\n            controller.byobRequest?.respond(0)\n          })\n        } else {\n          const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)\n          if (buf.byteLength) {\n            controller.enqueue(new Uint8Array(buf))\n          }\n        }\n        return controller.desiredSize > 0\n      },\n      async cancel (reason) {\n        await iterator.return()\n      },\n      type: 'bytes'\n    }\n  )\n}\n\n// The chunk should be a FormData instance and contains\n// all the required methods.\nfunction isFormDataLike (object) {\n  return (\n    object &&\n    typeof object === 'object' &&\n    typeof object.append === 'function' &&\n    typeof object.delete === 'function' &&\n    typeof object.get === 'function' &&\n    typeof object.getAll === 'function' &&\n    typeof object.has === 'function' &&\n    typeof object.set === 'function' &&\n    object[Symbol.toStringTag] === 'FormData'\n  )\n}\n\nfunction addAbortListener (signal, listener) {\n  if ('addEventListener' in signal) {\n    signal.addEventListener('abort', listener, { once: true })\n    return () => signal.removeEventListener('abort', listener)\n  }\n  signal.addListener('abort', listener)\n  return () => signal.removeListener('abort', listener)\n}\n\nconst hasToWellFormed = typeof String.prototype.toWellFormed === 'function'\nconst hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'\n\n/**\n * @param {string} val\n */\nfunction toUSVString (val) {\n  return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)\n}\n\n/**\n * @param {string} val\n */\n// TODO: move this to webidl\nfunction isUSVString (val) {\n  return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`\n}\n\n/**\n * @see https://tools.ietf.org/html/rfc7230#section-3.2.6\n * @param {number} c\n */\nfunction isTokenCharCode (c) {\n  switch (c) {\n    case 0x22:\n    case 0x28:\n    case 0x29:\n    case 0x2c:\n    case 0x2f:\n    case 0x3a:\n    case 0x3b:\n    case 0x3c:\n    case 0x3d:\n    case 0x3e:\n    case 0x3f:\n    case 0x40:\n    case 0x5b:\n    case 0x5c:\n    case 0x5d:\n    case 0x7b:\n    case 0x7d:\n      // DQUOTE and \"(),/:;<=>?@[\\]{}\"\n      return false\n    default:\n      // VCHAR %x21-7E\n      return c >= 0x21 && c <= 0x7e\n  }\n}\n\n/**\n * @param {string} characters\n */\nfunction isValidHTTPToken (characters) {\n  if (characters.length === 0) {\n    return false\n  }\n  for (let i = 0; i < characters.length; ++i) {\n    if (!isTokenCharCode(characters.charCodeAt(i))) {\n      return false\n    }\n  }\n  return true\n}\n\n// headerCharRegex have been lifted from\n// https://github.com/nodejs/node/blob/main/lib/_http_common.js\n\n/**\n * Matches if val contains an invalid field-vchar\n *  field-value    = *( field-content / obs-fold )\n *  field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n *  field-vchar    = VCHAR / obs-text\n */\nconst headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/\n\n/**\n * @param {string} characters\n */\nfunction isValidHeaderValue (characters) {\n  return !headerCharRegex.test(characters)\n}\n\n// Parsed accordingly to RFC 9110\n// https://www.rfc-editor.org/rfc/rfc9110#field.content-range\nfunction parseRangeHeader (range) {\n  if (range == null || range === '') return { start: 0, end: null, size: null }\n\n  const m = range ? range.match(/^bytes (\\d+)-(\\d+)\\/(\\d+)?$/) : null\n  return m\n    ? {\n        start: parseInt(m[1]),\n        end: m[2] ? parseInt(m[2]) : null,\n        size: m[3] ? parseInt(m[3]) : null\n      }\n    : null\n}\n\nfunction addListener (obj, name, listener) {\n  const listeners = (obj[kListeners] ??= [])\n  listeners.push([name, listener])\n  obj.on(name, listener)\n  return obj\n}\n\nfunction removeAllListeners (obj) {\n  for (const [name, listener] of obj[kListeners] ?? []) {\n    obj.removeListener(name, listener)\n  }\n  obj[kListeners] = null\n}\n\nfunction errorRequest (client, request, err) {\n  try {\n    request.onError(err)\n    assert(request.aborted)\n  } catch (err) {\n    client.emit('error', err)\n  }\n}\n\nconst kEnumerableProperty = Object.create(null)\nkEnumerableProperty.enumerable = true\n\nconst normalizedMethodRecordsBase = {\n  delete: 'DELETE',\n  DELETE: 'DELETE',\n  get: 'GET',\n  GET: 'GET',\n  head: 'HEAD',\n  HEAD: 'HEAD',\n  options: 'OPTIONS',\n  OPTIONS: 'OPTIONS',\n  post: 'POST',\n  POST: 'POST',\n  put: 'PUT',\n  PUT: 'PUT'\n}\n\nconst normalizedMethodRecords = {\n  ...normalizedMethodRecordsBase,\n  patch: 'patch',\n  PATCH: 'PATCH'\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(normalizedMethodRecordsBase, null)\nObject.setPrototypeOf(normalizedMethodRecords, null)\n\nmodule.exports = {\n  kEnumerableProperty,\n  nop,\n  isDisturbed,\n  isErrored,\n  isReadable,\n  toUSVString,\n  isUSVString,\n  isBlobLike,\n  parseOrigin,\n  parseURL,\n  getServerName,\n  isStream,\n  isIterable,\n  isAsyncIterable,\n  isDestroyed,\n  headerNameToString,\n  bufferToLowerCasedHeaderName,\n  addListener,\n  removeAllListeners,\n  errorRequest,\n  parseRawHeaders,\n  parseHeaders,\n  parseKeepAliveTimeout,\n  destroy,\n  bodyLength,\n  deepClone,\n  ReadableStreamFrom,\n  isBuffer,\n  validateHandler,\n  getSocketInfo,\n  isFormDataLike,\n  buildURL,\n  addAbortListener,\n  isValidHTTPToken,\n  isValidHeaderValue,\n  isTokenCharCode,\n  parseRangeHeader,\n  normalizedMethodRecordsBase,\n  normalizedMethodRecords,\n  isValidPort,\n  isHttpOrHttpsPrefixed,\n  nodeMajor,\n  nodeMinor,\n  safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],\n  wrapRequestBody\n}\n","'use strict'\n\nconst { InvalidArgumentError } = require('../core/errors')\nconst { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst DispatcherBase = require('./dispatcher-base')\nconst Pool = require('./pool')\nconst Client = require('./client')\nconst util = require('../core/util')\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor')\n\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kMaxRedirections = Symbol('maxRedirections')\nconst kOnDrain = Symbol('onDrain')\nconst kFactory = Symbol('factory')\nconst kOptions = Symbol('options')\n\nfunction defaultFactory (origin, opts) {\n  return opts && opts.connections === 1\n    ? new Client(origin, opts)\n    : new Pool(origin, opts)\n}\n\nclass Agent extends DispatcherBase {\n  constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    super(options)\n\n    if (connect && typeof connect !== 'function') {\n      connect = { ...connect }\n    }\n\n    this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)\n      ? options.interceptors.Agent\n      : [createRedirectInterceptor({ maxRedirections })]\n\n    this[kOptions] = { ...util.deepClone(options), connect }\n    this[kOptions].interceptors = options.interceptors\n      ? { ...options.interceptors }\n      : undefined\n    this[kMaxRedirections] = maxRedirections\n    this[kFactory] = factory\n    this[kClients] = new Map()\n\n    this[kOnDrain] = (origin, targets) => {\n      this.emit('drain', origin, [this, ...targets])\n    }\n\n    this[kOnConnect] = (origin, targets) => {\n      this.emit('connect', origin, [this, ...targets])\n    }\n\n    this[kOnDisconnect] = (origin, targets, err) => {\n      this.emit('disconnect', origin, [this, ...targets], err)\n    }\n\n    this[kOnConnectionError] = (origin, targets, err) => {\n      this.emit('connectionError', origin, [this, ...targets], err)\n    }\n  }\n\n  get [kRunning] () {\n    let ret = 0\n    for (const client of this[kClients].values()) {\n      ret += client[kRunning]\n    }\n    return ret\n  }\n\n  [kDispatch] (opts, handler) {\n    let key\n    if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {\n      key = String(opts.origin)\n    } else {\n      throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')\n    }\n\n    let dispatcher = this[kClients].get(key)\n\n    if (!dispatcher) {\n      dispatcher = this[kFactory](opts.origin, this[kOptions])\n        .on('drain', this[kOnDrain])\n        .on('connect', this[kOnConnect])\n        .on('disconnect', this[kOnDisconnect])\n        .on('connectionError', this[kOnConnectionError])\n\n      // This introduces a tiny memory leak, as dispatchers are never removed from the map.\n      // TODO(mcollina): remove te timer when the client/pool do not have any more\n      // active connections.\n      this[kClients].set(key, dispatcher)\n    }\n\n    return dispatcher.dispatch(opts, handler)\n  }\n\n  async [kClose] () {\n    const closePromises = []\n    for (const client of this[kClients].values()) {\n      closePromises.push(client.close())\n    }\n    this[kClients].clear()\n\n    await Promise.all(closePromises)\n  }\n\n  async [kDestroy] (err) {\n    const destroyPromises = []\n    for (const client of this[kClients].values()) {\n      destroyPromises.push(client.destroy(err))\n    }\n    this[kClients].clear()\n\n    await Promise.all(destroyPromises)\n  }\n}\n\nmodule.exports = Agent\n","'use strict'\n\nconst {\n  BalancedPoolMissingUpstreamError,\n  InvalidArgumentError\n} = require('../core/errors')\nconst {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kRemoveClient,\n  kGetDispatcher\n} = require('./pool-base')\nconst Pool = require('./pool')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst { parseOrigin } = require('../core/util')\nconst kFactory = Symbol('factory')\n\nconst kOptions = Symbol('options')\nconst kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')\nconst kCurrentWeight = Symbol('kCurrentWeight')\nconst kIndex = Symbol('kIndex')\nconst kWeight = Symbol('kWeight')\nconst kMaxWeightPerServer = Symbol('kMaxWeightPerServer')\nconst kErrorPenalty = Symbol('kErrorPenalty')\n\n/**\n * Calculate the greatest common divisor of two numbers by\n * using the Euclidean algorithm.\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction getGreatestCommonDivisor (a, b) {\n  if (a === 0) return b\n\n  while (b !== 0) {\n    const t = b\n    b = a % b\n    a = t\n  }\n  return a\n}\n\nfunction defaultFactory (origin, opts) {\n  return new Pool(origin, opts)\n}\n\nclass BalancedPool extends PoolBase {\n  constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {\n    super()\n\n    this[kOptions] = opts\n    this[kIndex] = -1\n    this[kCurrentWeight] = 0\n\n    this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100\n    this[kErrorPenalty] = this[kOptions].errorPenalty || 15\n\n    if (!Array.isArray(upstreams)) {\n      upstreams = [upstreams]\n    }\n\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)\n      ? opts.interceptors.BalancedPool\n      : []\n    this[kFactory] = factory\n\n    for (const upstream of upstreams) {\n      this.addUpstream(upstream)\n    }\n    this._updateBalancedPoolStats()\n  }\n\n  addUpstream (upstream) {\n    const upstreamOrigin = parseOrigin(upstream).origin\n\n    if (this[kClients].find((pool) => (\n      pool[kUrl].origin === upstreamOrigin &&\n      pool.closed !== true &&\n      pool.destroyed !== true\n    ))) {\n      return this\n    }\n    const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))\n\n    this[kAddClient](pool)\n    pool.on('connect', () => {\n      pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])\n    })\n\n    pool.on('connectionError', () => {\n      pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n      this._updateBalancedPoolStats()\n    })\n\n    pool.on('disconnect', (...args) => {\n      const err = args[2]\n      if (err && err.code === 'UND_ERR_SOCKET') {\n        // decrease the weight of the pool.\n        pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n        this._updateBalancedPoolStats()\n      }\n    })\n\n    for (const client of this[kClients]) {\n      client[kWeight] = this[kMaxWeightPerServer]\n    }\n\n    this._updateBalancedPoolStats()\n\n    return this\n  }\n\n  _updateBalancedPoolStats () {\n    let result = 0\n    for (let i = 0; i < this[kClients].length; i++) {\n      result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)\n    }\n\n    this[kGreatestCommonDivisor] = result\n  }\n\n  removeUpstream (upstream) {\n    const upstreamOrigin = parseOrigin(upstream).origin\n\n    const pool = this[kClients].find((pool) => (\n      pool[kUrl].origin === upstreamOrigin &&\n      pool.closed !== true &&\n      pool.destroyed !== true\n    ))\n\n    if (pool) {\n      this[kRemoveClient](pool)\n    }\n\n    return this\n  }\n\n  get upstreams () {\n    return this[kClients]\n      .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)\n      .map((p) => p[kUrl].origin)\n  }\n\n  [kGetDispatcher] () {\n    // We validate that pools is greater than 0,\n    // otherwise we would have to wait until an upstream\n    // is added, which might never happen.\n    if (this[kClients].length === 0) {\n      throw new BalancedPoolMissingUpstreamError()\n    }\n\n    const dispatcher = this[kClients].find(dispatcher => (\n      !dispatcher[kNeedDrain] &&\n      dispatcher.closed !== true &&\n      dispatcher.destroyed !== true\n    ))\n\n    if (!dispatcher) {\n      return\n    }\n\n    const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)\n\n    if (allClientsBusy) {\n      return\n    }\n\n    let counter = 0\n\n    let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])\n\n    while (counter++ < this[kClients].length) {\n      this[kIndex] = (this[kIndex] + 1) % this[kClients].length\n      const pool = this[kClients][this[kIndex]]\n\n      // find pool index with the largest weight\n      if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {\n        maxWeightIndex = this[kIndex]\n      }\n\n      // decrease the current weight every `this[kClients].length`.\n      if (this[kIndex] === 0) {\n        // Set the current weight to the next lower weight.\n        this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]\n\n        if (this[kCurrentWeight] <= 0) {\n          this[kCurrentWeight] = this[kMaxWeightPerServer]\n        }\n      }\n      if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {\n        return pool\n      }\n    }\n\n    this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]\n    this[kIndex] = maxWeightIndex\n    return this[kClients][maxWeightIndex]\n  }\n}\n\nmodule.exports = BalancedPool\n","'use strict'\n\n/* global WebAssembly */\n\nconst assert = require('node:assert')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst timers = require('../util/timers.js')\nconst {\n  RequestContentLengthMismatchError,\n  ResponseContentLengthMismatchError,\n  RequestAbortedError,\n  HeadersTimeoutError,\n  HeadersOverflowError,\n  SocketError,\n  InformationalError,\n  BodyTimeoutError,\n  HTTPParserError,\n  ResponseExceededMaxSizeError\n} = require('../core/errors.js')\nconst {\n  kUrl,\n  kReset,\n  kClient,\n  kParser,\n  kBlocking,\n  kRunning,\n  kPending,\n  kSize,\n  kWriting,\n  kQueue,\n  kNoRef,\n  kKeepAliveDefaultTimeout,\n  kHostHeader,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kPipelining,\n  kSocket,\n  kKeepAliveTimeoutValue,\n  kMaxHeadersSize,\n  kKeepAliveMaxTimeout,\n  kKeepAliveTimeoutThreshold,\n  kHeadersTimeout,\n  kBodyTimeout,\n  kStrictContentLength,\n  kMaxRequests,\n  kCounter,\n  kMaxResponseSize,\n  kOnError,\n  kResume,\n  kHTTPContext\n} = require('../core/symbols.js')\n\nconst constants = require('../llhttp/constants.js')\nconst EMPTY_BUF = Buffer.alloc(0)\nconst FastBuffer = Buffer[Symbol.species]\nconst addListener = util.addListener\nconst removeAllListeners = util.removeAllListeners\nconst kIdleSocketValidation = Symbol('kIdleSocketValidation')\nconst kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout')\nconst kSocketUsed = Symbol('kSocketUsed')\n\nlet extractBody\n\nasync function lazyllhttp () {\n  const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined\n\n  let mod\n  try {\n    mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js'))\n  } catch (e) {\n    /* istanbul ignore next */\n\n    // We could check if the error was caused by the simd option not\n    // being enabled, but the occurring of this other error\n    // * https://github.com/emscripten-core/emscripten/issues/11495\n    // got me to remove that check to avoid breaking Node 12.\n    mod = await WebAssembly.compile(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))\n  }\n\n  return await WebAssembly.instantiate(mod, {\n    env: {\n      /* eslint-disable camelcase */\n\n      wasm_on_url: (p, at, len) => {\n        /* istanbul ignore next */\n        return 0\n      },\n      wasm_on_status: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_message_begin: (p) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onMessageBegin() || 0\n      },\n      wasm_on_header_field: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_header_value: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0\n      },\n      wasm_on_body: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_message_complete: (p) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onMessageComplete() || 0\n      }\n\n      /* eslint-enable camelcase */\n    }\n  })\n}\n\nlet llhttpInstance = null\nlet llhttpPromise = lazyllhttp()\nllhttpPromise.catch()\n\nlet currentParser = null\nlet currentBufferRef = null\nlet currentBufferSize = 0\nlet currentBufferPtr = null\n\nconst USE_NATIVE_TIMER = 0\nconst USE_FAST_TIMER = 1\n\n// Use fast timers for headers and body to take eventual event loop\n// latency into account.\nconst TIMEOUT_HEADERS = 2 | USE_FAST_TIMER\nconst TIMEOUT_BODY = 4 | USE_FAST_TIMER\n\n// Use native timers to ignore event loop latency for keep-alive\n// handling.\nconst TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER\n\nclass Parser {\n  constructor (client, socket, { exports }) {\n    assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)\n\n    this.llhttp = exports\n    this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)\n    this.client = client\n    this.socket = socket\n    this.timeout = null\n    this.timeoutValue = null\n    this.timeoutType = null\n    this.statusCode = null\n    this.statusText = ''\n    this.upgrade = false\n    this.headers = []\n    this.headersSize = 0\n    this.headersMaxSize = client[kMaxHeadersSize]\n    this.shouldKeepAlive = false\n    this.paused = false\n    this.resume = this.resume.bind(this)\n\n    this.bytesRead = 0\n\n    this.keepAlive = ''\n    this.contentLength = ''\n    this.connection = ''\n    this.maxResponseSize = client[kMaxResponseSize]\n  }\n\n  setTimeout (delay, type) {\n    // If the existing timer and the new timer are of different timer type\n    // (fast or native) or have different delay, we need to clear the existing\n    // timer and set a new one.\n    if (\n      delay !== this.timeoutValue ||\n      (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)\n    ) {\n      // If a timeout is already set, clear it with clearTimeout of the fast\n      // timer implementation, as it can clear fast and native timers.\n      if (this.timeout) {\n        timers.clearTimeout(this.timeout)\n        this.timeout = null\n      }\n\n      if (delay) {\n        if (type & USE_FAST_TIMER) {\n          this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this))\n        } else {\n          this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this))\n          this.timeout.unref()\n        }\n      }\n\n      this.timeoutValue = delay\n    } else if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    this.timeoutType = type\n  }\n\n  resume () {\n    if (this.socket.destroyed || !this.paused) {\n      return\n    }\n\n    assert(this.ptr != null)\n    assert(currentParser == null)\n\n    this.llhttp.llhttp_resume(this.ptr)\n\n    assert(this.timeoutType === TIMEOUT_BODY)\n    if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    this.paused = false\n    this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.\n    this.readMore()\n  }\n\n  readMore () {\n    while (!this.paused && this.ptr) {\n      const chunk = this.socket.read()\n      if (chunk === null) {\n        break\n      }\n      this.execute(chunk)\n    }\n  }\n\n  execute (data) {\n    assert(this.ptr != null)\n    assert(currentParser == null)\n    assert(!this.paused)\n\n    const { socket, llhttp } = this\n\n    if (data.length > currentBufferSize) {\n      if (currentBufferPtr) {\n        llhttp.free(currentBufferPtr)\n      }\n      currentBufferSize = Math.ceil(data.length / 4096) * 4096\n      currentBufferPtr = llhttp.malloc(currentBufferSize)\n    }\n\n    new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)\n\n    // Call `execute` on the wasm parser.\n    // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,\n    // and finally the length of bytes to parse.\n    // The return value is an error code or `constants.ERROR.OK`.\n    try {\n      let ret\n\n      try {\n        currentBufferRef = data\n        currentParser = this\n        ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)\n        /* eslint-disable-next-line no-useless-catch */\n      } catch (err) {\n        /* istanbul ignore next: difficult to make a test case for */\n        throw err\n      } finally {\n        currentParser = null\n        currentBufferRef = null\n      }\n\n      const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr\n\n      if (ret !== constants.ERROR.OK) {\n        const body = data.subarray(offset)\n\n        if (ret === constants.ERROR.PAUSED_UPGRADE) {\n          this.onUpgrade(body)\n        } else if (ret === constants.ERROR.PAUSED) {\n          this.paused = true\n          socket.unshift(body)\n        } else {\n          throw this.createError(ret, body)\n        }\n      }\n    } catch (err) {\n      util.destroy(socket, err)\n    }\n  }\n\n  finish () {\n    assert(currentParser === null)\n    assert(this.ptr != null)\n    assert(!this.paused)\n\n    const { llhttp } = this\n\n    let ret\n\n    try {\n      currentParser = this\n      ret = llhttp.llhttp_finish(this.ptr)\n    } finally {\n      currentParser = null\n    }\n\n    if (ret === constants.ERROR.OK) {\n      return null\n    }\n\n    if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {\n      this.paused = true\n      return null\n    }\n\n    return this.createError(ret, EMPTY_BUF)\n  }\n\n  createError (ret, data) {\n    const { llhttp, contentLength, bytesRead } = this\n\n    if (contentLength && bytesRead !== parseInt(contentLength, 10)) {\n      return new ResponseContentLengthMismatchError()\n    }\n\n    const ptr = llhttp.llhttp_get_error_reason(this.ptr)\n    let message = ''\n    if (ptr) {\n      const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)\n      message =\n        'Response does not match the HTTP/1.1 protocol (' +\n        Buffer.from(llhttp.memory.buffer, ptr, len).toString() +\n        ')'\n    }\n\n    return new HTTPParserError(message, constants.ERROR[ret], data)\n  }\n\n  destroy () {\n    assert(this.ptr != null)\n    assert(currentParser == null)\n\n    this.llhttp.llhttp_free(this.ptr)\n    this.ptr = null\n\n    this.timeout && timers.clearTimeout(this.timeout)\n    this.timeout = null\n    this.timeoutValue = null\n    this.timeoutType = null\n\n    this.paused = false\n  }\n\n  onStatus (buf) {\n    this.statusText = buf.toString()\n  }\n\n  onMessageBegin () {\n    const { socket, client } = this\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (socket.destroyed) {\n      return -1\n    }\n\n    if (client[kRunning] === 0) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n    if (!request) {\n      return -1\n    }\n    request.onResponseStarted()\n  }\n\n  onHeaderField (buf) {\n    const len = this.headers.length\n\n    if ((len & 1) === 0) {\n      this.headers.push(buf)\n    } else {\n      this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n    }\n\n    this.trackHeader(buf.length)\n  }\n\n  onHeaderValue (buf) {\n    let len = this.headers.length\n\n    if ((len & 1) === 1) {\n      this.headers.push(buf)\n      len += 1\n    } else {\n      this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n    }\n\n    const key = this.headers[len - 2]\n    if (key.length === 10) {\n      const headerName = util.bufferToLowerCasedHeaderName(key)\n      if (headerName === 'keep-alive') {\n        this.keepAlive += buf.toString()\n      } else if (headerName === 'connection') {\n        this.connection += buf.toString()\n      }\n    } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {\n      this.contentLength += buf.toString()\n    }\n\n    this.trackHeader(buf.length)\n  }\n\n  trackHeader (len) {\n    this.headersSize += len\n    if (this.headersSize >= this.headersMaxSize) {\n      util.destroy(this.socket, new HeadersOverflowError())\n    }\n  }\n\n  onUpgrade (head) {\n    const { upgrade, client, socket, headers, statusCode } = this\n\n    assert(upgrade)\n    assert(client[kSocket] === socket)\n    assert(!socket.destroyed)\n    assert(!this.paused)\n    assert((headers.length & 1) === 0)\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n    assert(request.upgrade || request.method === 'CONNECT')\n\n    this.statusCode = null\n    this.statusText = ''\n    this.shouldKeepAlive = null\n\n    this.headers = []\n    this.headersSize = 0\n\n    socket.unshift(head)\n\n    socket[kParser].destroy()\n    socket[kParser] = null\n\n    socket[kClient] = null\n    socket[kError] = null\n\n    removeAllListeners(socket)\n\n    client[kSocket] = null\n    client[kHTTPContext] = null // TODO (fix): This is hacky...\n    client[kQueue][client[kRunningIdx]++] = null\n    client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))\n\n    try {\n      request.onUpgrade(statusCode, headers, socket)\n    } catch (err) {\n      util.destroy(socket, err)\n    }\n\n    client[kResume]()\n  }\n\n  onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {\n    const { client, socket, headers, statusText } = this\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (socket.destroyed) {\n      return -1\n    }\n\n    if (client[kRunning] === 0) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (!request) {\n      return -1\n    }\n\n    assert(!this.upgrade)\n    assert(this.statusCode < 200)\n\n    if (statusCode === 100) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    /* this can only happen if server is misbehaving */\n    if (upgrade && !request.upgrade) {\n      util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    assert(this.timeoutType === TIMEOUT_HEADERS)\n\n    this.statusCode = statusCode\n    this.shouldKeepAlive = (\n      shouldKeepAlive ||\n      // Override llhttp value which does not allow keepAlive for HEAD.\n      (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')\n    )\n\n    if (this.statusCode >= 200) {\n      const bodyTimeout = request.bodyTimeout != null\n        ? request.bodyTimeout\n        : client[kBodyTimeout]\n      this.setTimeout(bodyTimeout, TIMEOUT_BODY)\n    } else if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    if (request.method === 'CONNECT') {\n      assert(client[kRunning] === 1)\n      this.upgrade = true\n      return 2\n    }\n\n    if (upgrade) {\n      assert(client[kRunning] === 1)\n      this.upgrade = true\n      return 2\n    }\n\n    assert((this.headers.length & 1) === 0)\n    this.headers = []\n    this.headersSize = 0\n\n    if (this.shouldKeepAlive && client[kPipelining]) {\n      const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null\n\n      if (keepAliveTimeout != null) {\n        const timeout = Math.min(\n          keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n          client[kKeepAliveMaxTimeout]\n        )\n        if (timeout <= 0) {\n          socket[kReset] = true\n        } else {\n          client[kKeepAliveTimeoutValue] = timeout\n        }\n      } else {\n        client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]\n      }\n    } else {\n      // Stop more requests from being dispatched.\n      socket[kReset] = true\n    }\n\n    const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false\n\n    if (request.aborted) {\n      return -1\n    }\n\n    if (request.method === 'HEAD') {\n      return 1\n    }\n\n    if (statusCode < 200) {\n      return 1\n    }\n\n    if (socket[kBlocking]) {\n      socket[kBlocking] = false\n      client[kResume]()\n    }\n\n    return pause ? constants.ERROR.PAUSED : 0\n  }\n\n  onBody (buf) {\n    const { client, socket, statusCode, maxResponseSize } = this\n\n    if (socket.destroyed) {\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n\n    assert(this.timeoutType === TIMEOUT_BODY)\n    if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    assert(statusCode >= 200)\n\n    if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n      util.destroy(socket, new ResponseExceededMaxSizeError())\n      return -1\n    }\n\n    this.bytesRead += buf.length\n\n    if (request.onData(buf) === false) {\n      return constants.ERROR.PAUSED\n    }\n  }\n\n  onMessageComplete () {\n    const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this\n\n    if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n      return -1\n    }\n\n    if (upgrade) {\n      return\n    }\n\n    assert(statusCode >= 100)\n    assert((this.headers.length & 1) === 0)\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n\n    this.statusCode = null\n    this.statusText = ''\n    this.bytesRead = 0\n    this.contentLength = ''\n    this.keepAlive = ''\n    this.connection = ''\n\n    this.headers = []\n    this.headersSize = 0\n\n    if (statusCode < 200) {\n      return\n    }\n\n    /* istanbul ignore next: should be handled by llhttp? */\n    if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n      util.destroy(socket, new ResponseContentLengthMismatchError())\n      return -1\n    }\n\n    request.onComplete(headers)\n\n    client[kQueue][client[kRunningIdx]++] = null\n    socket[kSocketUsed] = true\n\n    if (socket[kWriting]) {\n      assert(client[kRunning] === 0)\n      // Response completed before request.\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (!shouldKeepAlive) {\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (socket[kReset] && client[kRunning] === 0) {\n      // Destroy socket once all requests have completed.\n      // The request at the tail of the pipeline is the one\n      // that requested reset and no further requests should\n      // have been queued since then.\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (client[kPipelining] == null || client[kPipelining] === 1) {\n      // We must wait a full event loop cycle to reuse this socket to make sure\n      // that non-spec compliant servers are not closing the connection even if they\n      // said they won't.\n      setImmediate(() => client[kResume]())\n    } else {\n      client[kResume]()\n    }\n  }\n}\n\nfunction onParserTimeout (parser) {\n  const { socket, timeoutType, client, paused } = parser.deref()\n\n  /* istanbul ignore else */\n  if (timeoutType === TIMEOUT_HEADERS) {\n    if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n      assert(!paused, 'cannot be paused while waiting for headers')\n      util.destroy(socket, new HeadersTimeoutError())\n    }\n  } else if (timeoutType === TIMEOUT_BODY) {\n    if (!paused) {\n      util.destroy(socket, new BodyTimeoutError())\n    }\n  } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {\n    assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])\n    util.destroy(socket, new InformationalError('socket idle timeout'))\n  }\n}\n\nasync function connectH1 (client, socket) {\n  client[kSocket] = socket\n\n  if (!llhttpInstance) {\n    llhttpInstance = await llhttpPromise\n    llhttpPromise = null\n  }\n\n  socket[kNoRef] = false\n  socket[kWriting] = false\n  socket[kReset] = false\n  socket[kBlocking] = false\n  socket[kIdleSocketValidation] = 0\n  socket[kIdleSocketValidationTimeout] = null\n  socket[kSocketUsed] = false\n  socket[kParser] = new Parser(client, socket, llhttpInstance)\n\n  addListener(socket, 'error', function (err) {\n    assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n    const parser = this[kParser]\n\n    // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded\n    // to the user.\n    if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {\n      const parserErr = parser.finish()\n      if (parserErr) {\n        this[kError] = parserErr\n        this[kClient][kOnError](parserErr)\n      }\n      return\n    }\n\n    this[kError] = err\n\n    this[kClient][kOnError](err)\n  })\n  addListener(socket, 'readable', function () {\n    const parser = this[kParser]\n\n    if (parser) {\n      parser.readMore()\n    }\n  })\n  addListener(socket, 'end', function () {\n    const parser = this[kParser]\n\n    if (parser.statusCode && !parser.shouldKeepAlive) {\n      const parserErr = parser.finish()\n      if (parserErr) {\n        util.destroy(this, parserErr)\n      }\n      return\n    }\n\n    util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n  })\n  addListener(socket, 'close', function () {\n    const client = this[kClient]\n    const parser = this[kParser]\n\n    clearIdleSocketValidation(this)\n\n    if (parser) {\n      if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {\n        this[kError] = parser.finish() || this[kError]\n      }\n\n      this[kParser].destroy()\n      this[kParser] = null\n    }\n\n    const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n    client[kSocket] = null\n    client[kHTTPContext] = null // TODO (fix): This is hacky...\n\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n\n      // Fail entire queue.\n      const requests = client[kQueue].splice(client[kRunningIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(client, request, err)\n      }\n    } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {\n      // Fail head of pipeline.\n      const request = client[kQueue][client[kRunningIdx]]\n      client[kQueue][client[kRunningIdx]++] = null\n\n      util.errorRequest(client, request, err)\n    }\n\n    client[kPendingIdx] = client[kRunningIdx]\n\n    assert(client[kRunning] === 0)\n\n    client.emit('disconnect', client[kUrl], [client], err)\n\n    client[kResume]()\n  })\n\n  let closed = false\n  socket.on('close', () => {\n    closed = true\n  })\n\n  return {\n    version: 'h1',\n    defaultPipelining: 1,\n    write (...args) {\n      return writeH1(client, ...args)\n    },\n    resume () {\n      resumeH1(client)\n    },\n    destroy (err, callback) {\n      if (closed) {\n        queueMicrotask(callback)\n      } else {\n        socket.destroy(err).on('close', callback)\n      }\n    },\n    get destroyed () {\n      return socket.destroyed\n    },\n    busy (request) {\n      if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) {\n        return true\n      }\n\n      if (request) {\n        if (client[kRunning] > 0 && !request.idempotent) {\n          // Non-idempotent request cannot be retried.\n          // Ensure that no other requests are inflight and\n          // could cause failure.\n          return true\n        }\n\n        if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {\n          // Don't dispatch an upgrade until all preceding requests have completed.\n          // A misbehaving server might upgrade the connection before all pipelined\n          // request has completed.\n          return true\n        }\n\n        if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&\n          (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {\n          // Request with stream or iterator body can error while other requests\n          // are inflight and indirectly error those as well.\n          // Ensure this doesn't happen by waiting for inflight\n          // to complete before dispatching.\n\n          // Request with stream or iterator body cannot be retried.\n          // Ensure that no other requests are inflight and\n          // could cause failure.\n          return true\n        }\n      }\n\n      return false\n    }\n  }\n}\n\nfunction clearIdleSocketValidation (socket) {\n  if (socket[kIdleSocketValidationTimeout]) {\n    clearTimeout(socket[kIdleSocketValidationTimeout])\n    socket[kIdleSocketValidationTimeout] = null\n  }\n\n  socket[kIdleSocketValidation] = 0\n}\n\nfunction scheduleIdleSocketValidation (client, socket) {\n  socket[kIdleSocketValidation] = 1\n  socket[kIdleSocketValidationTimeout] = setTimeout(() => {\n    socket[kIdleSocketValidationTimeout] = null\n    socket[kIdleSocketValidation] = 2\n\n    if (client[kSocket] === socket && !socket.destroyed) {\n      client[kResume]()\n    }\n  }, 0)\n  socket[kIdleSocketValidationTimeout].unref?.()\n}\n\n/**\n * @param {import('./client.js')} client\n */\nfunction resumeH1 (client) {\n  const socket = client[kSocket]\n\n  if (socket && !socket.destroyed) {\n    if (client[kSize] === 0) {\n      if (!socket[kNoRef] && socket.unref) {\n        socket.unref()\n        socket[kNoRef] = true\n      }\n    } else if (socket[kNoRef] && socket.ref) {\n      socket.ref()\n      socket[kNoRef] = false\n    }\n\n    if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {\n      if (socket[kIdleSocketValidation] === 0) {\n        scheduleIdleSocketValidation(client, socket)\n        socket[kParser].readMore()\n        if (socket.destroyed) {\n          return\n        }\n        return\n      }\n\n      if (socket[kIdleSocketValidation] === 1) {\n        socket[kParser].readMore()\n        if (socket.destroyed) {\n          return\n        }\n        return\n      }\n    }\n\n    if (client[kRunning] === 0) {\n      socket[kParser].readMore()\n      if (socket.destroyed) {\n        return\n      }\n    }\n\n    if (client[kSize] === 0) {\n      if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {\n        socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)\n      }\n    } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n      if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n        const request = client[kQueue][client[kRunningIdx]]\n        const headersTimeout = request.headersTimeout != null\n          ? request.headersTimeout\n          : client[kHeadersTimeout]\n        socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)\n      }\n    }\n  }\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n  return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH1 (client, request) {\n  const { method, path, host, upgrade, blocking, reset } = request\n\n  let { body, headers, contentLength } = request\n\n  // https://tools.ietf.org/html/rfc7231#section-4.3.1\n  // https://tools.ietf.org/html/rfc7231#section-4.3.2\n  // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n  // Sending a payload body on a request that does not\n  // expect it can cause undefined behavior on some\n  // servers and corrupt connection state. Do not\n  // re-use the connection for further requests.\n\n  const expectsPayload = (\n    method === 'PUT' ||\n    method === 'POST' ||\n    method === 'PATCH' ||\n    method === 'QUERY' ||\n    method === 'PROPFIND' ||\n    method === 'PROPPATCH'\n  )\n\n  if (util.isFormDataLike(body)) {\n    if (!extractBody) {\n      extractBody = require('../web/fetch/body.js').extractBody\n    }\n\n    const [bodyStream, contentType] = extractBody(body)\n    if (request.contentType == null) {\n      headers.push('content-type', contentType)\n    }\n    body = bodyStream.stream\n    contentLength = bodyStream.length\n  } else if (util.isBlobLike(body) && request.contentType == null && body.type) {\n    headers.push('content-type', body.type)\n  }\n\n  if (body && typeof body.read === 'function') {\n    // Try to read EOF in order to get length.\n    body.read(0)\n  }\n\n  const bodyLength = util.bodyLength(body)\n\n  contentLength = bodyLength ?? contentLength\n\n  if (contentLength === null) {\n    contentLength = request.contentLength\n  }\n\n  if (contentLength === 0 && !expectsPayload) {\n    // https://tools.ietf.org/html/rfc7230#section-3.3.2\n    // A user agent SHOULD NOT send a Content-Length header field when\n    // the request message does not contain a payload body and the method\n    // semantics do not anticipate such a body.\n\n    contentLength = null\n  }\n\n  // https://github.com/nodejs/undici/issues/2046\n  // A user agent may send a Content-Length header with 0 value, this should be allowed.\n  if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {\n    if (client[kStrictContentLength]) {\n      util.errorRequest(client, request, new RequestContentLengthMismatchError())\n      return false\n    }\n\n    process.emitWarning(new RequestContentLengthMismatchError())\n  }\n\n  const socket = client[kSocket]\n  clearIdleSocketValidation(socket)\n\n  const abort = (err) => {\n    if (request.aborted || request.completed) {\n      return\n    }\n\n    util.errorRequest(client, request, err || new RequestAbortedError())\n\n    util.destroy(body)\n    util.destroy(socket, new InformationalError('aborted'))\n  }\n\n  try {\n    request.onConnect(abort)\n  } catch (err) {\n    util.errorRequest(client, request, err)\n  }\n\n  if (request.aborted) {\n    return false\n  }\n\n  if (method === 'HEAD') {\n    // https://github.com/mcollina/undici/issues/258\n    // Close after a HEAD request to interop with misbehaving servers\n    // that may send a body in the response.\n\n    socket[kReset] = true\n  }\n\n  if (upgrade || method === 'CONNECT') {\n    // On CONNECT or upgrade, block pipeline from dispatching further\n    // requests on this connection.\n\n    socket[kReset] = true\n  }\n\n  if (reset != null) {\n    socket[kReset] = reset\n  }\n\n  if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n    socket[kReset] = true\n  }\n\n  if (blocking) {\n    socket[kBlocking] = true\n  }\n\n  let header = `${method} ${path} HTTP/1.1\\r\\n`\n\n  if (typeof host === 'string') {\n    header += `host: ${host}\\r\\n`\n  } else {\n    header += client[kHostHeader]\n  }\n\n  if (upgrade) {\n    header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n  } else if (client[kPipelining] && !socket[kReset]) {\n    header += 'connection: keep-alive\\r\\n'\n  } else {\n    header += 'connection: close\\r\\n'\n  }\n\n  if (Array.isArray(headers)) {\n    for (let n = 0; n < headers.length; n += 2) {\n      const key = headers[n + 0]\n      const val = headers[n + 1]\n\n      if (Array.isArray(val)) {\n        for (let i = 0; i < val.length; i++) {\n          header += `${key}: ${val[i]}\\r\\n`\n        }\n      } else {\n        header += `${key}: ${val}\\r\\n`\n      }\n    }\n  }\n\n  if (channels.sendHeaders.hasSubscribers) {\n    channels.sendHeaders.publish({ request, headers: header, socket })\n  }\n\n  /* istanbul ignore else: assertion */\n  if (!body || bodyLength === 0) {\n    writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isBuffer(body)) {\n    writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isBlobLike(body)) {\n    if (typeof body.stream === 'function') {\n      writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)\n    } else {\n      writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)\n    }\n  } else if (util.isStream(body)) {\n    writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isIterable(body)) {\n    writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else {\n    assert(false)\n  }\n\n  return true\n}\n\nfunction writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n  let finished = false\n\n  const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n\n  const onData = function (chunk) {\n    if (finished) {\n      return\n    }\n\n    try {\n      if (!writer.write(chunk) && this.pause) {\n        this.pause()\n      }\n    } catch (err) {\n      util.destroy(this, err)\n    }\n  }\n  const onDrain = function () {\n    if (finished) {\n      return\n    }\n\n    if (body.resume) {\n      body.resume()\n    }\n  }\n  const onClose = function () {\n    // 'close' might be emitted *before* 'error' for\n    // broken streams. Wait a tick to avoid this case.\n    queueMicrotask(() => {\n      // It's only safe to remove 'error' listener after\n      // 'close'.\n      body.removeListener('error', onFinished)\n    })\n\n    if (!finished) {\n      const err = new RequestAbortedError()\n      queueMicrotask(() => onFinished(err))\n    }\n  }\n  const onFinished = function (err) {\n    if (finished) {\n      return\n    }\n\n    finished = true\n\n    assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))\n\n    socket\n      .off('drain', onDrain)\n      .off('error', onFinished)\n\n    body\n      .removeListener('data', onData)\n      .removeListener('end', onFinished)\n      .removeListener('close', onClose)\n\n    if (!err) {\n      try {\n        writer.end()\n      } catch (er) {\n        err = er\n      }\n    }\n\n    writer.destroy(err)\n\n    if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {\n      util.destroy(body, err)\n    } else {\n      util.destroy(body)\n    }\n  }\n\n  body\n    .on('data', onData)\n    .on('end', onFinished)\n    .on('error', onFinished)\n    .on('close', onClose)\n\n  if (body.resume) {\n    body.resume()\n  }\n\n  socket\n    .on('drain', onDrain)\n    .on('error', onFinished)\n\n  if (body.errorEmitted ?? body.errored) {\n    setImmediate(() => onFinished(body.errored))\n  } else if (body.endEmitted ?? body.readableEnded) {\n    setImmediate(() => onFinished(null))\n  }\n\n  if (body.closeEmitted ?? body.closed) {\n    setImmediate(onClose)\n  }\n}\n\nfunction writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  try {\n    if (!body) {\n      if (contentLength === 0) {\n        socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n      } else {\n        assert(contentLength === null, 'no body must not have content length')\n        socket.write(`${header}\\r\\n`, 'latin1')\n      }\n    } else if (util.isBuffer(body)) {\n      assert(contentLength === body.byteLength, 'buffer body must have content length')\n\n      socket.cork()\n      socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n      socket.write(body)\n      socket.uncork()\n      request.onBodySent(body)\n\n      if (!expectsPayload && request.reset !== false) {\n        socket[kReset] = true\n      }\n    }\n    request.onRequestSent()\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength === body.size, 'blob body must have content length')\n\n  try {\n    if (contentLength != null && contentLength !== body.size) {\n      throw new RequestContentLengthMismatchError()\n    }\n\n    const buffer = Buffer.from(await body.arrayBuffer())\n\n    socket.cork()\n    socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n    socket.write(buffer)\n    socket.uncork()\n\n    request.onBodySent(buffer)\n    request.onRequestSent()\n\n    if (!expectsPayload && request.reset !== false) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n  let callback = null\n  function onDrain () {\n    if (callback) {\n      const cb = callback\n      callback = null\n      cb()\n    }\n  }\n\n  const waitForDrain = () => new Promise((resolve, reject) => {\n    assert(callback === null)\n\n    if (socket[kError]) {\n      reject(socket[kError])\n    } else {\n      callback = resolve\n    }\n  })\n\n  socket\n    .on('close', onDrain)\n    .on('drain', onDrain)\n\n  const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n  try {\n    // It's up to the user to somehow abort the async iterable.\n    for await (const chunk of body) {\n      if (socket[kError]) {\n        throw socket[kError]\n      }\n\n      if (!writer.write(chunk)) {\n        await waitForDrain()\n      }\n    }\n\n    writer.end()\n  } catch (err) {\n    writer.destroy(err)\n  } finally {\n    socket\n      .off('close', onDrain)\n      .off('drain', onDrain)\n  }\n}\n\nclass AsyncWriter {\n  constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {\n    this.socket = socket\n    this.request = request\n    this.contentLength = contentLength\n    this.client = client\n    this.bytesWritten = 0\n    this.expectsPayload = expectsPayload\n    this.header = header\n    this.abort = abort\n\n    socket[kWriting] = true\n  }\n\n  write (chunk) {\n    const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this\n\n    if (socket[kError]) {\n      throw socket[kError]\n    }\n\n    if (socket.destroyed) {\n      return false\n    }\n\n    const len = Buffer.byteLength(chunk)\n    if (!len) {\n      return true\n    }\n\n    // We should defer writing chunks.\n    if (contentLength !== null && bytesWritten + len > contentLength) {\n      if (client[kStrictContentLength]) {\n        throw new RequestContentLengthMismatchError()\n      }\n\n      process.emitWarning(new RequestContentLengthMismatchError())\n    }\n\n    socket.cork()\n\n    if (bytesWritten === 0) {\n      if (!expectsPayload && request.reset !== false) {\n        socket[kReset] = true\n      }\n\n      if (contentLength === null) {\n        socket.write(`${header}transfer-encoding: chunked\\r\\n`, 'latin1')\n      } else {\n        socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n      }\n    }\n\n    if (contentLength === null) {\n      socket.write(`\\r\\n${len.toString(16)}\\r\\n`, 'latin1')\n    }\n\n    this.bytesWritten += len\n\n    const ret = socket.write(chunk)\n\n    socket.uncork()\n\n    request.onBodySent(chunk)\n\n    if (!ret) {\n      if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n        // istanbul ignore else: only for jest\n        if (socket[kParser].timeout.refresh) {\n          socket[kParser].timeout.refresh()\n        }\n      }\n    }\n\n    return ret\n  }\n\n  end () {\n    const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this\n    request.onRequestSent()\n\n    socket[kWriting] = false\n\n    if (socket[kError]) {\n      throw socket[kError]\n    }\n\n    if (socket.destroyed) {\n      return\n    }\n\n    if (bytesWritten === 0) {\n      if (expectsPayload) {\n        // https://tools.ietf.org/html/rfc7230#section-3.3.2\n        // A user agent SHOULD send a Content-Length in a request message when\n        // no Transfer-Encoding is sent and the request method defines a meaning\n        // for an enclosed payload body.\n\n        socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n      } else {\n        socket.write(`${header}\\r\\n`, 'latin1')\n      }\n    } else if (contentLength === null) {\n      socket.write('\\r\\n0\\r\\n\\r\\n', 'latin1')\n    }\n\n    if (contentLength !== null && bytesWritten !== contentLength) {\n      if (client[kStrictContentLength]) {\n        throw new RequestContentLengthMismatchError()\n      } else {\n        process.emitWarning(new RequestContentLengthMismatchError())\n      }\n    }\n\n    if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n      // istanbul ignore else: only for jest\n      if (socket[kParser].timeout.refresh) {\n        socket[kParser].timeout.refresh()\n      }\n    }\n\n    client[kResume]()\n  }\n\n  destroy (err) {\n    const { socket, client, abort } = this\n\n    socket[kWriting] = false\n\n    if (err) {\n      assert(client[kRunning] <= 1, 'pipeline should only contain this request')\n      abort(err)\n    }\n  }\n}\n\nmodule.exports = connectH1\n","'use strict'\n\nconst assert = require('node:assert')\nconst { pipeline } = require('node:stream')\nconst util = require('../core/util.js')\nconst {\n  RequestContentLengthMismatchError,\n  RequestAbortedError,\n  SocketError,\n  InformationalError\n} = require('../core/errors.js')\nconst {\n  kUrl,\n  kReset,\n  kClient,\n  kRunning,\n  kPending,\n  kQueue,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kSocket,\n  kStrictContentLength,\n  kOnError,\n  kMaxConcurrentStreams,\n  kHTTP2Session,\n  kResume,\n  kSize,\n  kHTTPContext\n} = require('../core/symbols.js')\n\nconst kOpenStreams = Symbol('open streams')\n\nlet extractBody\n\n// Experimental\nlet h2ExperimentalWarned = false\n\n/** @type {import('http2')} */\nlet http2\ntry {\n  http2 = require('node:http2')\n} catch {\n  // @ts-ignore\n  http2 = { constants: {} }\n}\n\nconst {\n  constants: {\n    HTTP2_HEADER_AUTHORITY,\n    HTTP2_HEADER_METHOD,\n    HTTP2_HEADER_PATH,\n    HTTP2_HEADER_SCHEME,\n    HTTP2_HEADER_CONTENT_LENGTH,\n    HTTP2_HEADER_EXPECT,\n    HTTP2_HEADER_STATUS\n  }\n} = http2\n\nfunction parseH2Headers (headers) {\n  const result = []\n\n  for (const [name, value] of Object.entries(headers)) {\n    // h2 may concat the header value by array\n    // e.g. Set-Cookie\n    if (Array.isArray(value)) {\n      for (const subvalue of value) {\n        // we need to provide each header value of header name\n        // because the headers handler expect name-value pair\n        result.push(Buffer.from(name), Buffer.from(subvalue))\n      }\n    } else {\n      result.push(Buffer.from(name), Buffer.from(value))\n    }\n  }\n\n  return result\n}\n\nasync function connectH2 (client, socket) {\n  client[kSocket] = socket\n\n  if (!h2ExperimentalWarned) {\n    h2ExperimentalWarned = true\n    process.emitWarning('H2 support is experimental, expect them to change at any time.', {\n      code: 'UNDICI-H2'\n    })\n  }\n\n  const session = http2.connect(client[kUrl], {\n    createConnection: () => socket,\n    peerMaxConcurrentStreams: client[kMaxConcurrentStreams]\n  })\n\n  session[kOpenStreams] = 0\n  session[kClient] = client\n  session[kSocket] = socket\n\n  util.addListener(session, 'error', onHttp2SessionError)\n  util.addListener(session, 'frameError', onHttp2FrameError)\n  util.addListener(session, 'end', onHttp2SessionEnd)\n  util.addListener(session, 'goaway', onHTTP2GoAway)\n  util.addListener(session, 'close', function () {\n    const { [kClient]: client } = this\n    const { [kSocket]: socket } = client\n\n    const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket))\n\n    client[kHTTP2Session] = null\n\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n\n      // Fail entire queue.\n      const requests = client[kQueue].splice(client[kRunningIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(client, request, err)\n      }\n    }\n  })\n\n  session.unref()\n\n  client[kHTTP2Session] = session\n  socket[kHTTP2Session] = session\n\n  util.addListener(socket, 'error', function (err) {\n    assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n    this[kError] = err\n\n    this[kClient][kOnError](err)\n  })\n\n  util.addListener(socket, 'end', function () {\n    util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n  })\n\n  util.addListener(socket, 'close', function () {\n    const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n    client[kSocket] = null\n\n    if (this[kHTTP2Session] != null) {\n      this[kHTTP2Session].destroy(err)\n    }\n\n    client[kPendingIdx] = client[kRunningIdx]\n\n    assert(client[kRunning] === 0)\n\n    client.emit('disconnect', client[kUrl], [client], err)\n\n    client[kResume]()\n  })\n\n  let closed = false\n  socket.on('close', () => {\n    closed = true\n  })\n\n  return {\n    version: 'h2',\n    defaultPipelining: Infinity,\n    write (...args) {\n      return writeH2(client, ...args)\n    },\n    resume () {\n      resumeH2(client)\n    },\n    destroy (err, callback) {\n      if (closed) {\n        queueMicrotask(callback)\n      } else {\n        // Destroying the socket will trigger the session close\n        socket.destroy(err).on('close', callback)\n      }\n    },\n    get destroyed () {\n      return socket.destroyed\n    },\n    busy () {\n      return false\n    }\n  }\n}\n\nfunction resumeH2 (client) {\n  const socket = client[kSocket]\n\n  if (socket?.destroyed === false) {\n    if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) {\n      socket.unref()\n      client[kHTTP2Session].unref()\n    } else {\n      socket.ref()\n      client[kHTTP2Session].ref()\n    }\n  }\n}\n\nfunction onHttp2SessionError (err) {\n  assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n  this[kSocket][kError] = err\n  this[kClient][kOnError](err)\n}\n\nfunction onHttp2FrameError (type, code, id) {\n  if (id === 0) {\n    const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n    this[kSocket][kError] = err\n    this[kClient][kOnError](err)\n  }\n}\n\nfunction onHttp2SessionEnd () {\n  const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket]))\n  this.destroy(err)\n  util.destroy(this[kSocket], err)\n}\n\n/**\n * This is the root cause of #3011\n * We need to handle GOAWAY frames properly, and trigger the session close\n * along with the socket right away\n */\nfunction onHTTP2GoAway (code) {\n  // We cannot recover, so best to close the session and the socket\n  const err = this[kError] || new SocketError(`HTTP/2: \"GOAWAY\" frame received with code ${code}`, util.getSocketInfo(this))\n  const client = this[kClient]\n\n  client[kSocket] = null\n  client[kHTTPContext] = null\n\n  if (this[kHTTP2Session] != null) {\n    this[kHTTP2Session].destroy(err)\n    this[kHTTP2Session] = null\n  }\n\n  util.destroy(this[kSocket], err)\n\n  // Fail head of pipeline.\n  if (client[kRunningIdx] < client[kQueue].length) {\n    const request = client[kQueue][client[kRunningIdx]]\n    client[kQueue][client[kRunningIdx]++] = null\n    util.errorRequest(client, request, err)\n    client[kPendingIdx] = client[kRunningIdx]\n  }\n\n  assert(client[kRunning] === 0)\n\n  client.emit('disconnect', client[kUrl], [client], err)\n\n  client[kResume]()\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n  return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH2 (client, request) {\n  const session = client[kHTTP2Session]\n  const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request\n  let { body } = request\n\n  if (upgrade) {\n    util.errorRequest(client, request, new Error('Upgrade not supported for H2'))\n    return false\n  }\n\n  const headers = {}\n  for (let n = 0; n < reqHeaders.length; n += 2) {\n    const key = reqHeaders[n + 0]\n    const val = reqHeaders[n + 1]\n\n    if (Array.isArray(val)) {\n      for (let i = 0; i < val.length; i++) {\n        if (headers[key]) {\n          headers[key] += `,${val[i]}`\n        } else {\n          headers[key] = val[i]\n        }\n      }\n    } else {\n      headers[key] = val\n    }\n  }\n\n  /** @type {import('node:http2').ClientHttp2Stream} */\n  let stream\n\n  const { hostname, port } = client[kUrl]\n\n  headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`\n  headers[HTTP2_HEADER_METHOD] = method\n\n  const abort = (err) => {\n    if (request.aborted || request.completed) {\n      return\n    }\n\n    err = err || new RequestAbortedError()\n\n    util.errorRequest(client, request, err)\n\n    if (stream != null) {\n      util.destroy(stream, err)\n    }\n\n    // We do not destroy the socket as we can continue using the session\n    // the stream get's destroyed and the session remains to create new streams\n    util.destroy(body, err)\n    client[kQueue][client[kRunningIdx]++] = null\n    client[kResume]()\n  }\n\n  try {\n    // We are already connected, streams are pending.\n    // We can call on connect, and wait for abort\n    request.onConnect(abort)\n  } catch (err) {\n    util.errorRequest(client, request, err)\n  }\n\n  if (request.aborted) {\n    return false\n  }\n\n  if (method === 'CONNECT') {\n    session.ref()\n    // We are already connected, streams are pending, first request\n    // will create a new stream. We trigger a request to create the stream and wait until\n    // `ready` event is triggered\n    // We disabled endStream to allow the user to write to the stream\n    stream = session.request(headers, { endStream: false, signal })\n\n    if (stream.id && !stream.pending) {\n      request.onUpgrade(null, null, stream)\n      ++session[kOpenStreams]\n      client[kQueue][client[kRunningIdx]++] = null\n    } else {\n      stream.once('ready', () => {\n        request.onUpgrade(null, null, stream)\n        ++session[kOpenStreams]\n        client[kQueue][client[kRunningIdx]++] = null\n      })\n    }\n\n    stream.once('close', () => {\n      session[kOpenStreams] -= 1\n      if (session[kOpenStreams] === 0) session.unref()\n    })\n\n    return true\n  }\n\n  // https://tools.ietf.org/html/rfc7540#section-8.3\n  // :path and :scheme headers must be omitted when sending CONNECT\n\n  headers[HTTP2_HEADER_PATH] = path\n  headers[HTTP2_HEADER_SCHEME] = 'https'\n\n  // https://tools.ietf.org/html/rfc7231#section-4.3.1\n  // https://tools.ietf.org/html/rfc7231#section-4.3.2\n  // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n  // Sending a payload body on a request that does not\n  // expect it can cause undefined behavior on some\n  // servers and corrupt connection state. Do not\n  // re-use the connection for further requests.\n\n  const expectsPayload = (\n    method === 'PUT' ||\n    method === 'POST' ||\n    method === 'PATCH'\n  )\n\n  if (body && typeof body.read === 'function') {\n    // Try to read EOF in order to get length.\n    body.read(0)\n  }\n\n  let contentLength = util.bodyLength(body)\n\n  if (util.isFormDataLike(body)) {\n    extractBody ??= require('../web/fetch/body.js').extractBody\n\n    const [bodyStream, contentType] = extractBody(body)\n    headers['content-type'] = contentType\n\n    body = bodyStream.stream\n    contentLength = bodyStream.length\n  }\n\n  if (contentLength == null) {\n    contentLength = request.contentLength\n  }\n\n  if (contentLength === 0 || !expectsPayload) {\n    // https://tools.ietf.org/html/rfc7230#section-3.3.2\n    // A user agent SHOULD NOT send a Content-Length header field when\n    // the request message does not contain a payload body and the method\n    // semantics do not anticipate such a body.\n\n    contentLength = null\n  }\n\n  // https://github.com/nodejs/undici/issues/2046\n  // A user agent may send a Content-Length header with 0 value, this should be allowed.\n  if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {\n    if (client[kStrictContentLength]) {\n      util.errorRequest(client, request, new RequestContentLengthMismatchError())\n      return false\n    }\n\n    process.emitWarning(new RequestContentLengthMismatchError())\n  }\n\n  if (contentLength != null) {\n    assert(body, 'no body must not have content length')\n    headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`\n  }\n\n  session.ref()\n\n  const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null\n  if (expectContinue) {\n    headers[HTTP2_HEADER_EXPECT] = '100-continue'\n    stream = session.request(headers, { endStream: shouldEndStream, signal })\n\n    stream.once('continue', writeBodyH2)\n  } else {\n    stream = session.request(headers, {\n      endStream: shouldEndStream,\n      signal\n    })\n    writeBodyH2()\n  }\n\n  // Increment counter as we have new streams open\n  ++session[kOpenStreams]\n\n  stream.once('response', headers => {\n    const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n    request.onResponseStarted()\n\n    // Due to the stream nature, it is possible we face a race condition\n    // where the stream has been assigned, but the request has been aborted\n    // the request remains in-flight and headers hasn't been received yet\n    // for those scenarios, best effort is to destroy the stream immediately\n    // as there's no value to keep it open.\n    if (request.aborted) {\n      const err = new RequestAbortedError()\n      util.errorRequest(client, request, err)\n      util.destroy(stream, err)\n      return\n    }\n\n    if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) {\n      stream.pause()\n    }\n\n    stream.on('data', (chunk) => {\n      if (request.onData(chunk) === false) {\n        stream.pause()\n      }\n    })\n  })\n\n  stream.once('end', () => {\n    // When state is null, it means we haven't consumed body and the stream still do not have\n    // a state.\n    // Present specially when using pipeline or stream\n    if (stream.state?.state == null || stream.state.state < 6) {\n      request.onComplete([])\n    }\n\n    if (session[kOpenStreams] === 0) {\n      // Stream is closed or half-closed-remote (6), decrement counter and cleanup\n      // It does not have sense to continue working with the stream as we do not\n      // have yet RST_STREAM support on client-side\n\n      session.unref()\n    }\n\n    abort(new InformationalError('HTTP/2: stream half-closed (remote)'))\n    client[kQueue][client[kRunningIdx]++] = null\n    client[kPendingIdx] = client[kRunningIdx]\n    client[kResume]()\n  })\n\n  stream.once('close', () => {\n    session[kOpenStreams] -= 1\n    if (session[kOpenStreams] === 0) {\n      session.unref()\n    }\n  })\n\n  stream.once('error', function (err) {\n    abort(err)\n  })\n\n  stream.once('frameError', (type, code) => {\n    abort(new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`))\n  })\n\n  // stream.on('aborted', () => {\n  //   // TODO(HTTP/2): Support aborted\n  // })\n\n  // stream.on('timeout', () => {\n  //   // TODO(HTTP/2): Support timeout\n  // })\n\n  // stream.on('push', headers => {\n  //   // TODO(HTTP/2): Support push\n  // })\n\n  // stream.on('trailers', headers => {\n  //   // TODO(HTTP/2): Support trailers\n  // })\n\n  return true\n\n  function writeBodyH2 () {\n    /* istanbul ignore else: assertion */\n    if (!body || contentLength === 0) {\n      writeBuffer(\n        abort,\n        stream,\n        null,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else if (util.isBuffer(body)) {\n      writeBuffer(\n        abort,\n        stream,\n        body,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else if (util.isBlobLike(body)) {\n      if (typeof body.stream === 'function') {\n        writeIterable(\n          abort,\n          stream,\n          body.stream(),\n          client,\n          request,\n          client[kSocket],\n          contentLength,\n          expectsPayload\n        )\n      } else {\n        writeBlob(\n          abort,\n          stream,\n          body,\n          client,\n          request,\n          client[kSocket],\n          contentLength,\n          expectsPayload\n        )\n      }\n    } else if (util.isStream(body)) {\n      writeStream(\n        abort,\n        client[kSocket],\n        expectsPayload,\n        stream,\n        body,\n        client,\n        request,\n        contentLength\n      )\n    } else if (util.isIterable(body)) {\n      writeIterable(\n        abort,\n        stream,\n        body,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else {\n      assert(false)\n    }\n  }\n}\n\nfunction writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  try {\n    if (body != null && util.isBuffer(body)) {\n      assert(contentLength === body.byteLength, 'buffer body must have content length')\n      h2stream.cork()\n      h2stream.write(body)\n      h2stream.uncork()\n      h2stream.end()\n\n      request.onBodySent(body)\n    }\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    request.onRequestSent()\n    client[kResume]()\n  } catch (error) {\n    abort(error)\n  }\n}\n\nfunction writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n  // For HTTP/2, is enough to pipe the stream\n  const pipe = pipeline(\n    body,\n    h2stream,\n    (err) => {\n      if (err) {\n        util.destroy(pipe, err)\n        abort(err)\n      } else {\n        util.removeAllListeners(pipe)\n        request.onRequestSent()\n\n        if (!expectsPayload) {\n          socket[kReset] = true\n        }\n\n        client[kResume]()\n      }\n    }\n  )\n\n  util.addListener(pipe, 'data', onPipeData)\n\n  function onPipeData (chunk) {\n    request.onBodySent(chunk)\n  }\n}\n\nasync function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  assert(contentLength === body.size, 'blob body must have content length')\n\n  try {\n    if (contentLength != null && contentLength !== body.size) {\n      throw new RequestContentLengthMismatchError()\n    }\n\n    const buffer = Buffer.from(await body.arrayBuffer())\n\n    h2stream.cork()\n    h2stream.write(buffer)\n    h2stream.uncork()\n    h2stream.end()\n\n    request.onBodySent(buffer)\n    request.onRequestSent()\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n  let callback = null\n  function onDrain () {\n    if (callback) {\n      const cb = callback\n      callback = null\n      cb()\n    }\n  }\n\n  const waitForDrain = () => new Promise((resolve, reject) => {\n    assert(callback === null)\n\n    if (socket[kError]) {\n      reject(socket[kError])\n    } else {\n      callback = resolve\n    }\n  })\n\n  h2stream\n    .on('close', onDrain)\n    .on('drain', onDrain)\n\n  try {\n    // It's up to the user to somehow abort the async iterable.\n    for await (const chunk of body) {\n      if (socket[kError]) {\n        throw socket[kError]\n      }\n\n      const res = h2stream.write(chunk)\n      request.onBodySent(chunk)\n      if (!res) {\n        await waitForDrain()\n      }\n    }\n\n    h2stream.end()\n\n    request.onRequestSent()\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  } finally {\n    h2stream\n      .off('close', onDrain)\n      .off('drain', onDrain)\n  }\n}\n\nmodule.exports = connectH2\n","// @ts-check\n\n'use strict'\n\nconst assert = require('node:assert')\nconst net = require('node:net')\nconst http = require('node:http')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst Request = require('../core/request.js')\nconst DispatcherBase = require('./dispatcher-base')\nconst {\n  InvalidArgumentError,\n  InformationalError,\n  ClientDestroyedError\n} = require('../core/errors.js')\nconst buildConnector = require('../core/connect.js')\nconst {\n  kUrl,\n  kServerName,\n  kClient,\n  kBusy,\n  kConnect,\n  kResuming,\n  kRunning,\n  kPending,\n  kSize,\n  kQueue,\n  kConnected,\n  kConnecting,\n  kNeedDrain,\n  kKeepAliveDefaultTimeout,\n  kHostHeader,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kPipelining,\n  kKeepAliveTimeoutValue,\n  kMaxHeadersSize,\n  kKeepAliveMaxTimeout,\n  kKeepAliveTimeoutThreshold,\n  kHeadersTimeout,\n  kBodyTimeout,\n  kStrictContentLength,\n  kConnector,\n  kMaxRedirections,\n  kMaxRequests,\n  kCounter,\n  kClose,\n  kDestroy,\n  kDispatch,\n  kInterceptors,\n  kLocalAddress,\n  kMaxResponseSize,\n  kOnError,\n  kHTTPContext,\n  kMaxConcurrentStreams,\n  kResume\n} = require('../core/symbols.js')\nconst connectH1 = require('./client-h1.js')\nconst connectH2 = require('./client-h2.js')\nlet deprecatedInterceptorWarned = false\n\nconst kClosedResolve = Symbol('kClosedResolve')\n\nconst noop = () => {}\n\nfunction getPipelining (client) {\n  return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1\n}\n\n/**\n * @type {import('../../types/client.js').default}\n */\nclass Client extends DispatcherBase {\n  /**\n   *\n   * @param {string|URL} url\n   * @param {import('../../types/client.js').Client.Options} options\n   */\n  constructor (url, {\n    interceptors,\n    maxHeaderSize,\n    headersTimeout,\n    socketTimeout,\n    requestTimeout,\n    connectTimeout,\n    bodyTimeout,\n    idleTimeout,\n    keepAlive,\n    keepAliveTimeout,\n    maxKeepAliveTimeout,\n    keepAliveMaxTimeout,\n    keepAliveTimeoutThreshold,\n    socketPath,\n    pipelining,\n    tls,\n    strictContentLength,\n    maxCachedSessions,\n    maxRedirections,\n    connect,\n    maxRequestsPerClient,\n    localAddress,\n    maxResponseSize,\n    autoSelectFamily,\n    autoSelectFamilyAttemptTimeout,\n    // h2\n    maxConcurrentStreams,\n    allowH2,\n    webSocket\n  } = {}) {\n    super({ webSocket })\n\n    if (keepAlive !== undefined) {\n      throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')\n    }\n\n    if (socketTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')\n    }\n\n    if (requestTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')\n    }\n\n    if (idleTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')\n    }\n\n    if (maxKeepAliveTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')\n    }\n\n    if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {\n      throw new InvalidArgumentError('invalid maxHeaderSize')\n    }\n\n    if (socketPath != null && typeof socketPath !== 'string') {\n      throw new InvalidArgumentError('invalid socketPath')\n    }\n\n    if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n      throw new InvalidArgumentError('invalid connectTimeout')\n    }\n\n    if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n      throw new InvalidArgumentError('invalid keepAliveTimeout')\n    }\n\n    if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n      throw new InvalidArgumentError('invalid keepAliveMaxTimeout')\n    }\n\n    if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n      throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')\n    }\n\n    if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n      throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')\n    }\n\n    if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n      throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n      throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')\n    }\n\n    if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {\n      throw new InvalidArgumentError('localAddress must be valid string IP address')\n    }\n\n    if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n      throw new InvalidArgumentError('maxResponseSize must be a positive number')\n    }\n\n    if (\n      autoSelectFamilyAttemptTimeout != null &&\n      (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)\n    ) {\n      throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')\n    }\n\n    // h2\n    if (allowH2 != null && typeof allowH2 !== 'boolean') {\n      throw new InvalidArgumentError('allowH2 must be a valid boolean value')\n    }\n\n    if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {\n      throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')\n    }\n\n    if (typeof connect !== 'function') {\n      connect = buildConnector({\n        ...tls,\n        maxCachedSessions,\n        allowH2,\n        socketPath,\n        timeout: connectTimeout,\n        ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n        ...connect\n      })\n    }\n\n    if (interceptors?.Client && Array.isArray(interceptors.Client)) {\n      this[kInterceptors] = interceptors.Client\n      if (!deprecatedInterceptorWarned) {\n        deprecatedInterceptorWarned = true\n        process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', {\n          code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED'\n        })\n      }\n    } else {\n      this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]\n    }\n\n    this[kUrl] = util.parseOrigin(url)\n    this[kConnector] = connect\n    this[kPipelining] = pipelining != null ? pipelining : 1\n    this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize\n    this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout\n    this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout\n    this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold\n    this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]\n    this[kServerName] = null\n    this[kLocalAddress] = localAddress != null ? localAddress : null\n    this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming\n    this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming\n    this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\\r\\n`\n    this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3\n    this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3\n    this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength\n    this[kMaxRedirections] = maxRedirections\n    this[kMaxRequests] = maxRequestsPerClient\n    this[kClosedResolve] = null\n    this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1\n    this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server\n    this[kHTTPContext] = null\n\n    // kQueue is built up of 3 sections separated by\n    // the kRunningIdx and kPendingIdx indices.\n    // |   complete   |   running   |   pending   |\n    //                ^ kRunningIdx ^ kPendingIdx ^ kQueue.length\n    // kRunningIdx points to the first running element.\n    // kPendingIdx points to the first pending element.\n    // This implements a fast queue with an amortized\n    // time of O(1).\n\n    this[kQueue] = []\n    this[kRunningIdx] = 0\n    this[kPendingIdx] = 0\n\n    this[kResume] = (sync) => resume(this, sync)\n    this[kOnError] = (err) => onError(this, err)\n  }\n\n  get pipelining () {\n    return this[kPipelining]\n  }\n\n  set pipelining (value) {\n    this[kPipelining] = value\n    this[kResume](true)\n  }\n\n  get [kPending] () {\n    return this[kQueue].length - this[kPendingIdx]\n  }\n\n  get [kRunning] () {\n    return this[kPendingIdx] - this[kRunningIdx]\n  }\n\n  get [kSize] () {\n    return this[kQueue].length - this[kRunningIdx]\n  }\n\n  get [kConnected] () {\n    return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed\n  }\n\n  get [kBusy] () {\n    return Boolean(\n      this[kHTTPContext]?.busy(null) ||\n      (this[kSize] >= (getPipelining(this) || 1)) ||\n      this[kPending] > 0\n    )\n  }\n\n  /* istanbul ignore: only used for test */\n  [kConnect] (cb) {\n    connect(this)\n    this.once('connect', cb)\n  }\n\n  [kDispatch] (opts, handler) {\n    const origin = opts.origin || this[kUrl].origin\n    const request = new Request(origin, opts, handler)\n\n    this[kQueue].push(request)\n    if (this[kResuming]) {\n      // Do nothing.\n    } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n      // Wait a tick in case stream/iterator is ended in the same tick.\n      this[kResuming] = 1\n      queueMicrotask(() => resume(this))\n    } else {\n      this[kResume](true)\n    }\n\n    if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n      this[kNeedDrain] = 2\n    }\n\n    return this[kNeedDrain] < 2\n  }\n\n  async [kClose] () {\n    // TODO: for H2 we need to gracefully flush the remaining enqueued\n    // request and close each stream.\n    return new Promise((resolve) => {\n      if (this[kSize]) {\n        this[kClosedResolve] = resolve\n      } else {\n        resolve(null)\n      }\n    })\n  }\n\n  async [kDestroy] (err) {\n    return new Promise((resolve) => {\n      const requests = this[kQueue].splice(this[kPendingIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(this, request, err)\n      }\n\n      const callback = () => {\n        if (this[kClosedResolve]) {\n          // TODO (fix): Should we error here with ClientDestroyedError?\n          this[kClosedResolve]()\n          this[kClosedResolve] = null\n        }\n        resolve(null)\n      }\n\n      if (this[kHTTPContext]) {\n        this[kHTTPContext].destroy(err, callback)\n        this[kHTTPContext] = null\n      } else {\n        queueMicrotask(callback)\n      }\n\n      this[kResume]()\n    })\n  }\n}\n\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor.js')\n\nfunction onError (client, err) {\n  if (\n    client[kRunning] === 0 &&\n    err.code !== 'UND_ERR_INFO' &&\n    err.code !== 'UND_ERR_SOCKET'\n  ) {\n    // Error is not caused by running request and not a recoverable\n    // socket error.\n\n    assert(client[kPendingIdx] === client[kRunningIdx])\n\n    const requests = client[kQueue].splice(client[kRunningIdx])\n\n    for (let i = 0; i < requests.length; i++) {\n      const request = requests[i]\n      util.errorRequest(client, request, err)\n    }\n    assert(client[kSize] === 0)\n  }\n}\n\n/**\n * @param {Client} client\n * @returns\n */\nasync function connect (client) {\n  assert(!client[kConnecting])\n  assert(!client[kHTTPContext])\n\n  let { host, hostname, protocol, port } = client[kUrl]\n\n  // Resolve ipv6\n  if (hostname[0] === '[') {\n    const idx = hostname.indexOf(']')\n\n    assert(idx !== -1)\n    const ip = hostname.substring(1, idx)\n\n    assert(net.isIP(ip))\n    hostname = ip\n  }\n\n  client[kConnecting] = true\n\n  if (channels.beforeConnect.hasSubscribers) {\n    channels.beforeConnect.publish({\n      connectParams: {\n        host,\n        hostname,\n        protocol,\n        port,\n        version: client[kHTTPContext]?.version,\n        servername: client[kServerName],\n        localAddress: client[kLocalAddress]\n      },\n      connector: client[kConnector]\n    })\n  }\n\n  try {\n    const socket = await new Promise((resolve, reject) => {\n      client[kConnector]({\n        host,\n        hostname,\n        protocol,\n        port,\n        servername: client[kServerName],\n        localAddress: client[kLocalAddress]\n      }, (err, socket) => {\n        if (err) {\n          reject(err)\n        } else {\n          resolve(socket)\n        }\n      })\n    })\n\n    if (client.destroyed) {\n      util.destroy(socket.on('error', noop), new ClientDestroyedError())\n      return\n    }\n\n    assert(socket)\n\n    try {\n      client[kHTTPContext] = socket.alpnProtocol === 'h2'\n        ? await connectH2(client, socket)\n        : await connectH1(client, socket)\n    } catch (err) {\n      socket.destroy().on('error', noop)\n      throw err\n    }\n\n    client[kConnecting] = false\n\n    socket[kCounter] = 0\n    socket[kMaxRequests] = client[kMaxRequests]\n    socket[kClient] = client\n    socket[kError] = null\n\n    if (channels.connected.hasSubscribers) {\n      channels.connected.publish({\n        connectParams: {\n          host,\n          hostname,\n          protocol,\n          port,\n          version: client[kHTTPContext]?.version,\n          servername: client[kServerName],\n          localAddress: client[kLocalAddress]\n        },\n        connector: client[kConnector],\n        socket\n      })\n    }\n    client.emit('connect', client[kUrl], [client])\n  } catch (err) {\n    if (client.destroyed) {\n      return\n    }\n\n    client[kConnecting] = false\n\n    if (channels.connectError.hasSubscribers) {\n      channels.connectError.publish({\n        connectParams: {\n          host,\n          hostname,\n          protocol,\n          port,\n          version: client[kHTTPContext]?.version,\n          servername: client[kServerName],\n          localAddress: client[kLocalAddress]\n        },\n        connector: client[kConnector],\n        error: err\n      })\n    }\n\n    if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n      assert(client[kRunning] === 0)\n      while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n        const request = client[kQueue][client[kPendingIdx]++]\n        util.errorRequest(client, request, err)\n      }\n    } else {\n      onError(client, err)\n    }\n\n    client.emit('connectionError', client[kUrl], [client], err)\n  }\n\n  client[kResume]()\n}\n\nfunction emitDrain (client) {\n  client[kNeedDrain] = 0\n  client.emit('drain', client[kUrl], [client])\n}\n\nfunction resume (client, sync) {\n  if (client[kResuming] === 2) {\n    return\n  }\n\n  client[kResuming] = 2\n\n  _resume(client, sync)\n  client[kResuming] = 0\n\n  if (client[kRunningIdx] > 256) {\n    client[kQueue].splice(0, client[kRunningIdx])\n    client[kPendingIdx] -= client[kRunningIdx]\n    client[kRunningIdx] = 0\n  }\n}\n\nfunction _resume (client, sync) {\n  while (true) {\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n      return\n    }\n\n    if (client[kClosedResolve] && !client[kSize]) {\n      client[kClosedResolve]()\n      client[kClosedResolve] = null\n      return\n    }\n\n    if (client[kHTTPContext]) {\n      client[kHTTPContext].resume()\n    }\n\n    if (client[kBusy]) {\n      client[kNeedDrain] = 2\n    } else if (client[kNeedDrain] === 2) {\n      if (sync) {\n        client[kNeedDrain] = 1\n        queueMicrotask(() => emitDrain(client))\n      } else {\n        emitDrain(client)\n      }\n      continue\n    }\n\n    if (client[kPending] === 0) {\n      return\n    }\n\n    if (client[kRunning] >= (getPipelining(client) || 1)) {\n      return\n    }\n\n    const request = client[kQueue][client[kPendingIdx]]\n\n    if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {\n      if (client[kRunning] > 0) {\n        return\n      }\n\n      client[kServerName] = request.servername\n      client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {\n        client[kHTTPContext] = null\n        resume(client)\n      })\n    }\n\n    if (client[kConnecting]) {\n      return\n    }\n\n    if (!client[kHTTPContext]) {\n      connect(client)\n      return\n    }\n\n    if (client[kHTTPContext].destroyed) {\n      return\n    }\n\n    if (client[kHTTPContext].busy(request)) {\n      return\n    }\n\n    if (!request.aborted && client[kHTTPContext].write(request)) {\n      client[kPendingIdx]++\n    } else {\n      client[kQueue].splice(client[kPendingIdx], 1)\n    }\n  }\n}\n\nmodule.exports = Client\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst {\n  ClientDestroyedError,\n  ClientClosedError,\n  InvalidArgumentError\n} = require('../core/errors')\nconst { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require('../core/symbols')\n\nconst kOnDestroyed = Symbol('onDestroyed')\nconst kOnClosed = Symbol('onClosed')\nconst kInterceptedDispatch = Symbol('Intercepted Dispatch')\nconst kWebSocketOptions = Symbol('webSocketOptions')\n\nclass DispatcherBase extends Dispatcher {\n  constructor (opts) {\n    super()\n\n    this[kDestroyed] = false\n    this[kOnDestroyed] = null\n    this[kClosed] = false\n    this[kOnClosed] = []\n    this[kWebSocketOptions] = opts?.webSocket ?? {}\n  }\n\n  get webSocketOptions () {\n    return {\n      maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,\n      maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024\n    }\n  }\n\n  get destroyed () {\n    return this[kDestroyed]\n  }\n\n  get closed () {\n    return this[kClosed]\n  }\n\n  get interceptors () {\n    return this[kInterceptors]\n  }\n\n  set interceptors (newInterceptors) {\n    if (newInterceptors) {\n      for (let i = newInterceptors.length - 1; i >= 0; i--) {\n        const interceptor = this[kInterceptors][i]\n        if (typeof interceptor !== 'function') {\n          throw new InvalidArgumentError('interceptor must be an function')\n        }\n      }\n    }\n\n    this[kInterceptors] = newInterceptors\n  }\n\n  close (callback) {\n    if (callback === undefined) {\n      return new Promise((resolve, reject) => {\n        this.close((err, data) => {\n          return err ? reject(err) : resolve(data)\n        })\n      })\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    if (this[kDestroyed]) {\n      queueMicrotask(() => callback(new ClientDestroyedError(), null))\n      return\n    }\n\n    if (this[kClosed]) {\n      if (this[kOnClosed]) {\n        this[kOnClosed].push(callback)\n      } else {\n        queueMicrotask(() => callback(null, null))\n      }\n      return\n    }\n\n    this[kClosed] = true\n    this[kOnClosed].push(callback)\n\n    const onClosed = () => {\n      const callbacks = this[kOnClosed]\n      this[kOnClosed] = null\n      for (let i = 0; i < callbacks.length; i++) {\n        callbacks[i](null, null)\n      }\n    }\n\n    // Should not error.\n    this[kClose]()\n      .then(() => this.destroy())\n      .then(() => {\n        queueMicrotask(onClosed)\n      })\n  }\n\n  destroy (err, callback) {\n    if (typeof err === 'function') {\n      callback = err\n      err = null\n    }\n\n    if (callback === undefined) {\n      return new Promise((resolve, reject) => {\n        this.destroy(err, (err, data) => {\n          return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)\n        })\n      })\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    if (this[kDestroyed]) {\n      if (this[kOnDestroyed]) {\n        this[kOnDestroyed].push(callback)\n      } else {\n        queueMicrotask(() => callback(null, null))\n      }\n      return\n    }\n\n    if (!err) {\n      err = new ClientDestroyedError()\n    }\n\n    this[kDestroyed] = true\n    this[kOnDestroyed] = this[kOnDestroyed] || []\n    this[kOnDestroyed].push(callback)\n\n    const onDestroyed = () => {\n      const callbacks = this[kOnDestroyed]\n      this[kOnDestroyed] = null\n      for (let i = 0; i < callbacks.length; i++) {\n        callbacks[i](null, null)\n      }\n    }\n\n    // Should not error.\n    this[kDestroy](err).then(() => {\n      queueMicrotask(onDestroyed)\n    })\n  }\n\n  [kInterceptedDispatch] (opts, handler) {\n    if (!this[kInterceptors] || this[kInterceptors].length === 0) {\n      this[kInterceptedDispatch] = this[kDispatch]\n      return this[kDispatch](opts, handler)\n    }\n\n    let dispatch = this[kDispatch].bind(this)\n    for (let i = this[kInterceptors].length - 1; i >= 0; i--) {\n      dispatch = this[kInterceptors][i](dispatch)\n    }\n    this[kInterceptedDispatch] = dispatch\n    return dispatch(opts, handler)\n  }\n\n  dispatch (opts, handler) {\n    if (!handler || typeof handler !== 'object') {\n      throw new InvalidArgumentError('handler must be an object')\n    }\n\n    try {\n      if (!opts || typeof opts !== 'object') {\n        throw new InvalidArgumentError('opts must be an object.')\n      }\n\n      if (this[kDestroyed] || this[kOnDestroyed]) {\n        throw new ClientDestroyedError()\n      }\n\n      if (this[kClosed]) {\n        throw new ClientClosedError()\n      }\n\n      return this[kInterceptedDispatch](opts, handler)\n    } catch (err) {\n      if (typeof handler.onError !== 'function') {\n        throw new InvalidArgumentError('invalid onError method')\n      }\n\n      handler.onError(err)\n\n      return false\n    }\n  }\n}\n\nmodule.exports = DispatcherBase\n","'use strict'\nconst EventEmitter = require('node:events')\n\nclass Dispatcher extends EventEmitter {\n  dispatch () {\n    throw new Error('not implemented')\n  }\n\n  close () {\n    throw new Error('not implemented')\n  }\n\n  destroy () {\n    throw new Error('not implemented')\n  }\n\n  compose (...args) {\n    // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...\n    const interceptors = Array.isArray(args[0]) ? args[0] : args\n    let dispatch = this.dispatch.bind(this)\n\n    for (const interceptor of interceptors) {\n      if (interceptor == null) {\n        continue\n      }\n\n      if (typeof interceptor !== 'function') {\n        throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)\n      }\n\n      dispatch = interceptor(dispatch)\n\n      if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {\n        throw new TypeError('invalid interceptor')\n      }\n    }\n\n    return new ComposedDispatcher(this, dispatch)\n  }\n}\n\nclass ComposedDispatcher extends Dispatcher {\n  #dispatcher = null\n  #dispatch = null\n\n  constructor (dispatcher, dispatch) {\n    super()\n    this.#dispatcher = dispatcher\n    this.#dispatch = dispatch\n  }\n\n  dispatch (...args) {\n    this.#dispatch(...args)\n  }\n\n  close (...args) {\n    return this.#dispatcher.close(...args)\n  }\n\n  destroy (...args) {\n    return this.#dispatcher.destroy(...args)\n  }\n}\n\nmodule.exports = Dispatcher\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require('../core/symbols')\nconst ProxyAgent = require('./proxy-agent')\nconst Agent = require('./agent')\n\nconst DEFAULT_PORTS = {\n  'http:': 80,\n  'https:': 443\n}\n\nlet experimentalWarned = false\n\nclass EnvHttpProxyAgent extends DispatcherBase {\n  #noProxyValue = null\n  #noProxyEntries = null\n  #opts = null\n\n  constructor (opts = {}) {\n    super()\n    this.#opts = opts\n\n    if (!experimentalWarned) {\n      experimentalWarned = true\n      process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', {\n        code: 'UNDICI-EHPA'\n      })\n    }\n\n    const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts\n\n    this[kNoProxyAgent] = new Agent(agentOpts)\n\n    const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY\n    if (HTTP_PROXY) {\n      this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY })\n    } else {\n      this[kHttpProxyAgent] = this[kNoProxyAgent]\n    }\n\n    const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY\n    if (HTTPS_PROXY) {\n      this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY })\n    } else {\n      this[kHttpsProxyAgent] = this[kHttpProxyAgent]\n    }\n\n    this.#parseNoProxy()\n  }\n\n  [kDispatch] (opts, handler) {\n    const url = new URL(opts.origin)\n    const agent = this.#getProxyAgentForUrl(url)\n    return agent.dispatch(opts, handler)\n  }\n\n  async [kClose] () {\n    await this[kNoProxyAgent].close()\n    if (!this[kHttpProxyAgent][kClosed]) {\n      await this[kHttpProxyAgent].close()\n    }\n    if (!this[kHttpsProxyAgent][kClosed]) {\n      await this[kHttpsProxyAgent].close()\n    }\n  }\n\n  async [kDestroy] (err) {\n    await this[kNoProxyAgent].destroy(err)\n    if (!this[kHttpProxyAgent][kDestroyed]) {\n      await this[kHttpProxyAgent].destroy(err)\n    }\n    if (!this[kHttpsProxyAgent][kDestroyed]) {\n      await this[kHttpsProxyAgent].destroy(err)\n    }\n  }\n\n  #getProxyAgentForUrl (url) {\n    let { protocol, host: hostname, port } = url\n\n    // Stripping ports in this way instead of using parsedUrl.hostname to make\n    // sure that the brackets around IPv6 addresses are kept.\n    hostname = hostname.replace(/:\\d*$/, '').toLowerCase()\n    port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0\n    if (!this.#shouldProxy(hostname, port)) {\n      return this[kNoProxyAgent]\n    }\n    if (protocol === 'https:') {\n      return this[kHttpsProxyAgent]\n    }\n    return this[kHttpProxyAgent]\n  }\n\n  #shouldProxy (hostname, port) {\n    if (this.#noProxyChanged) {\n      this.#parseNoProxy()\n    }\n\n    if (this.#noProxyEntries.length === 0) {\n      return true // Always proxy if NO_PROXY is not set or empty.\n    }\n    if (this.#noProxyValue === '*') {\n      return false // Never proxy if wildcard is set.\n    }\n\n    for (let i = 0; i < this.#noProxyEntries.length; i++) {\n      const entry = this.#noProxyEntries[i]\n      if (entry.port && entry.port !== port) {\n        continue // Skip if ports don't match.\n      }\n      if (!/^[.*]/.test(entry.hostname)) {\n        // No wildcards, so don't proxy only if there is not an exact match.\n        if (hostname === entry.hostname) {\n          return false\n        }\n      } else {\n        // Don't proxy if the hostname ends with the no_proxy host.\n        if (hostname.endsWith(entry.hostname.replace(/^\\*/, ''))) {\n          return false\n        }\n      }\n    }\n\n    return true\n  }\n\n  #parseNoProxy () {\n    const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv\n    const noProxySplit = noProxyValue.split(/[,\\s]/)\n    const noProxyEntries = []\n\n    for (let i = 0; i < noProxySplit.length; i++) {\n      const entry = noProxySplit[i]\n      if (!entry) {\n        continue\n      }\n      const parsed = entry.match(/^(.+):(\\d+)$/)\n      noProxyEntries.push({\n        hostname: (parsed ? parsed[1] : entry).toLowerCase(),\n        port: parsed ? Number.parseInt(parsed[2], 10) : 0\n      })\n    }\n\n    this.#noProxyValue = noProxyValue\n    this.#noProxyEntries = noProxyEntries\n  }\n\n  get #noProxyChanged () {\n    if (this.#opts.noProxy !== undefined) {\n      return false\n    }\n    return this.#noProxyValue !== this.#noProxyEnv\n  }\n\n  get #noProxyEnv () {\n    return process.env.no_proxy ?? process.env.NO_PROXY ?? ''\n  }\n}\n\nmodule.exports = EnvHttpProxyAgent\n","/* eslint-disable */\n\n'use strict'\n\n// Extracted from node/lib/internal/fixed_queue.js\n\n// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.\nconst kSize = 2048;\nconst kMask = kSize - 1;\n\n// The FixedQueue is implemented as a singly-linked list of fixed-size\n// circular buffers. It looks something like this:\n//\n//  head                                                       tail\n//    |                                                          |\n//    v                                                          v\n// +-----------+ <-----\\       +-----------+ <------\\         +-----------+\n// |  [null]   |        \\----- |   next    |         \\------- |   next    |\n// +-----------+               +-----------+                  +-----------+\n// |   item    | <-- bottom    |   item    | <-- bottom       |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |       bottom --> |   item    |\n// |   item    |               |   item    |                  |   item    |\n// |    ...    |               |    ...    |                  |    ...    |\n// |   item    |               |   item    |                  |   item    |\n// |   item    |               |   item    |                  |   item    |\n// |  [empty]  | <-- top       |   item    |                  |   item    |\n// |  [empty]  |               |   item    |                  |   item    |\n// |  [empty]  |               |  [empty]  | <-- top  top --> |  [empty]  |\n// +-----------+               +-----------+                  +-----------+\n//\n// Or, if there is only one circular buffer, it looks something\n// like either of these:\n//\n//  head   tail                                 head   tail\n//    |     |                                     |     |\n//    v     v                                     v     v\n// +-----------+                               +-----------+\n// |  [null]   |                               |  [null]   |\n// +-----------+                               +-----------+\n// |  [empty]  |                               |   item    |\n// |  [empty]  |                               |   item    |\n// |   item    | <-- bottom            top --> |  [empty]  |\n// |   item    |                               |  [empty]  |\n// |  [empty]  | <-- top            bottom --> |   item    |\n// |  [empty]  |                               |   item    |\n// +-----------+                               +-----------+\n//\n// Adding a value means moving `top` forward by one, removing means\n// moving `bottom` forward by one. After reaching the end, the queue\n// wraps around.\n//\n// When `top === bottom` the current queue is empty and when\n// `top + 1 === bottom` it's full. This wastes a single space of storage\n// but allows much quicker checks.\n\nclass FixedCircularBuffer {\n  constructor() {\n    this.bottom = 0;\n    this.top = 0;\n    this.list = new Array(kSize);\n    this.next = null;\n  }\n\n  isEmpty() {\n    return this.top === this.bottom;\n  }\n\n  isFull() {\n    return ((this.top + 1) & kMask) === this.bottom;\n  }\n\n  push(data) {\n    this.list[this.top] = data;\n    this.top = (this.top + 1) & kMask;\n  }\n\n  shift() {\n    const nextItem = this.list[this.bottom];\n    if (nextItem === undefined)\n      return null;\n    this.list[this.bottom] = undefined;\n    this.bottom = (this.bottom + 1) & kMask;\n    return nextItem;\n  }\n}\n\nmodule.exports = class FixedQueue {\n  constructor() {\n    this.head = this.tail = new FixedCircularBuffer();\n  }\n\n  isEmpty() {\n    return this.head.isEmpty();\n  }\n\n  push(data) {\n    if (this.head.isFull()) {\n      // Head is full: Creates a new queue, sets the old queue's `.next` to it,\n      // and sets it as the new main queue.\n      this.head = this.head.next = new FixedCircularBuffer();\n    }\n    this.head.push(data);\n  }\n\n  shift() {\n    const tail = this.tail;\n    const next = tail.shift();\n    if (tail.isEmpty() && tail.next !== null) {\n      // If there is another queue, it forms the new tail.\n      this.tail = tail.next;\n    }\n    return next;\n  }\n};\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst FixedQueue = require('./fixed-queue')\nconst { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('../core/symbols')\nconst PoolStats = require('./pool-stats')\n\nconst kClients = Symbol('clients')\nconst kNeedDrain = Symbol('needDrain')\nconst kQueue = Symbol('queue')\nconst kClosedResolve = Symbol('closed resolve')\nconst kOnDrain = Symbol('onDrain')\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kGetDispatcher = Symbol('get dispatcher')\nconst kAddClient = Symbol('add client')\nconst kRemoveClient = Symbol('remove client')\nconst kStats = Symbol('stats')\n\nclass PoolBase extends DispatcherBase {\n  constructor (opts) {\n    super(opts)\n\n    this[kQueue] = new FixedQueue()\n    this[kClients] = []\n    this[kQueued] = 0\n\n    const pool = this\n\n    this[kOnDrain] = function onDrain (origin, targets) {\n      const queue = pool[kQueue]\n\n      let needDrain = false\n\n      while (!needDrain) {\n        const item = queue.shift()\n        if (!item) {\n          break\n        }\n        pool[kQueued]--\n        needDrain = !this.dispatch(item.opts, item.handler)\n      }\n\n      this[kNeedDrain] = needDrain\n\n      if (!this[kNeedDrain] && pool[kNeedDrain]) {\n        pool[kNeedDrain] = false\n        pool.emit('drain', origin, [pool, ...targets])\n      }\n\n      if (pool[kClosedResolve] && queue.isEmpty()) {\n        Promise\n          .all(pool[kClients].map(c => c.close()))\n          .then(pool[kClosedResolve])\n      }\n    }\n\n    this[kOnConnect] = (origin, targets) => {\n      pool.emit('connect', origin, [pool, ...targets])\n    }\n\n    this[kOnDisconnect] = (origin, targets, err) => {\n      pool.emit('disconnect', origin, [pool, ...targets], err)\n    }\n\n    this[kOnConnectionError] = (origin, targets, err) => {\n      pool.emit('connectionError', origin, [pool, ...targets], err)\n    }\n\n    this[kStats] = new PoolStats(this)\n  }\n\n  get [kBusy] () {\n    return this[kNeedDrain]\n  }\n\n  get [kConnected] () {\n    return this[kClients].filter(client => client[kConnected]).length\n  }\n\n  get [kFree] () {\n    return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length\n  }\n\n  get [kPending] () {\n    let ret = this[kQueued]\n    for (const { [kPending]: pending } of this[kClients]) {\n      ret += pending\n    }\n    return ret\n  }\n\n  get [kRunning] () {\n    let ret = 0\n    for (const { [kRunning]: running } of this[kClients]) {\n      ret += running\n    }\n    return ret\n  }\n\n  get [kSize] () {\n    let ret = this[kQueued]\n    for (const { [kSize]: size } of this[kClients]) {\n      ret += size\n    }\n    return ret\n  }\n\n  get stats () {\n    return this[kStats]\n  }\n\n  async [kClose] () {\n    if (this[kQueue].isEmpty()) {\n      await Promise.all(this[kClients].map(c => c.close()))\n    } else {\n      await new Promise((resolve) => {\n        this[kClosedResolve] = resolve\n      })\n    }\n  }\n\n  async [kDestroy] (err) {\n    while (true) {\n      const item = this[kQueue].shift()\n      if (!item) {\n        break\n      }\n      item.handler.onError(err)\n    }\n\n    await Promise.all(this[kClients].map(c => c.destroy(err)))\n  }\n\n  [kDispatch] (opts, handler) {\n    const dispatcher = this[kGetDispatcher]()\n\n    if (!dispatcher) {\n      this[kNeedDrain] = true\n      this[kQueue].push({ opts, handler })\n      this[kQueued]++\n    } else if (!dispatcher.dispatch(opts, handler)) {\n      dispatcher[kNeedDrain] = true\n      this[kNeedDrain] = !this[kGetDispatcher]()\n    }\n\n    return !this[kNeedDrain]\n  }\n\n  [kAddClient] (client) {\n    client\n      .on('drain', this[kOnDrain])\n      .on('connect', this[kOnConnect])\n      .on('disconnect', this[kOnDisconnect])\n      .on('connectionError', this[kOnConnectionError])\n\n    this[kClients].push(client)\n\n    if (this[kNeedDrain]) {\n      queueMicrotask(() => {\n        if (this[kNeedDrain]) {\n          this[kOnDrain](client[kUrl], [this, client])\n        }\n      })\n    }\n\n    return this\n  }\n\n  [kRemoveClient] (client) {\n    client.close(() => {\n      const idx = this[kClients].indexOf(client)\n      if (idx !== -1) {\n        this[kClients].splice(idx, 1)\n      }\n    })\n\n    this[kNeedDrain] = this[kClients].some(dispatcher => (\n      !dispatcher[kNeedDrain] &&\n      dispatcher.closed !== true &&\n      dispatcher.destroyed !== true\n    ))\n  }\n}\n\nmodule.exports = {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kRemoveClient,\n  kGetDispatcher\n}\n","const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('../core/symbols')\nconst kPool = Symbol('pool')\n\nclass PoolStats {\n  constructor (pool) {\n    this[kPool] = pool\n  }\n\n  get connected () {\n    return this[kPool][kConnected]\n  }\n\n  get free () {\n    return this[kPool][kFree]\n  }\n\n  get pending () {\n    return this[kPool][kPending]\n  }\n\n  get queued () {\n    return this[kPool][kQueued]\n  }\n\n  get running () {\n    return this[kPool][kRunning]\n  }\n\n  get size () {\n    return this[kPool][kSize]\n  }\n}\n\nmodule.exports = PoolStats\n","'use strict'\n\nconst {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kGetDispatcher\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n  InvalidArgumentError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst buildConnector = require('../core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\n\nfunction defaultFactory (origin, opts) {\n  return new Client(origin, opts)\n}\n\nclass Pool extends PoolBase {\n  constructor (origin, {\n    connections,\n    factory = defaultFactory,\n    connect,\n    connectTimeout,\n    tls,\n    maxCachedSessions,\n    socketPath,\n    autoSelectFamily,\n    autoSelectFamilyAttemptTimeout,\n    allowH2,\n    ...options\n  } = {}) {\n    if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n      throw new InvalidArgumentError('invalid connections')\n    }\n\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (typeof connect !== 'function') {\n      connect = buildConnector({\n        ...tls,\n        maxCachedSessions,\n        allowH2,\n        socketPath,\n        timeout: connectTimeout,\n        ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n        ...connect\n      })\n    }\n\n    super(options)\n\n    this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool)\n      ? options.interceptors.Pool\n      : []\n    this[kConnections] = connections || null\n    this[kUrl] = util.parseOrigin(origin)\n    this[kOptions] = { ...util.deepClone(options), connect, allowH2 }\n    this[kOptions].interceptors = options.interceptors\n      ? { ...options.interceptors }\n      : undefined\n    this[kFactory] = factory\n\n    this.on('connectionError', (origin, targets, error) => {\n      // If a connection error occurs, we remove the client from the pool,\n      // and emit a connectionError event. They will not be re-used.\n      // Fixes https://github.com/nodejs/undici/issues/3895\n      for (const target of targets) {\n        // Do not use kRemoveClient here, as it will close the client,\n        // but the client cannot be closed in this state.\n        const idx = this[kClients].indexOf(target)\n        if (idx !== -1) {\n          this[kClients].splice(idx, 1)\n        }\n      }\n    })\n  }\n\n  [kGetDispatcher] () {\n    for (const client of this[kClients]) {\n      if (!client[kNeedDrain]) {\n        return client\n      }\n    }\n\n    if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n      const dispatcher = this[kFactory](this[kUrl], this[kOptions])\n      this[kAddClient](dispatcher)\n      return dispatcher\n    }\n  }\n}\n\nmodule.exports = Pool\n","'use strict'\n\nconst { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst { URL } = require('node:url')\nconst Agent = require('./agent')\nconst Pool = require('./pool')\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors')\nconst buildConnector = require('../core/connect')\nconst Client = require('./client')\n\nconst kAgent = Symbol('proxy agent')\nconst kClient = Symbol('proxy client')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kRequestTls = Symbol('request tls settings')\nconst kProxyTls = Symbol('proxy tls settings')\nconst kConnectEndpoint = Symbol('connect endpoint function')\nconst kTunnelProxy = Symbol('tunnel proxy')\n\nfunction defaultProtocolPort (protocol) {\n  return protocol === 'https:' ? 443 : 80\n}\n\nfunction defaultFactory (origin, opts) {\n  return new Pool(origin, opts)\n}\n\nconst noop = () => {}\n\nfunction defaultAgentFactory (origin, opts) {\n  if (opts.connections === 1) {\n    return new Client(origin, opts)\n  }\n  return new Pool(origin, opts)\n}\n\nclass Http1ProxyWrapper extends DispatcherBase {\n  #client\n\n  constructor (proxyUrl, { headers = {}, connect, factory }) {\n    super()\n    if (!proxyUrl) {\n      throw new InvalidArgumentError('Proxy URL is mandatory')\n    }\n\n    this[kProxyHeaders] = headers\n    if (factory) {\n      this.#client = factory(proxyUrl, { connect })\n    } else {\n      this.#client = new Client(proxyUrl, { connect })\n    }\n  }\n\n  [kDispatch] (opts, handler) {\n    const onHeaders = handler.onHeaders\n    handler.onHeaders = function (statusCode, data, resume) {\n      if (statusCode === 407) {\n        if (typeof handler.onError === 'function') {\n          handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)'))\n        }\n        return\n      }\n      if (onHeaders) onHeaders.call(this, statusCode, data, resume)\n    }\n\n    // Rewrite request as an HTTP1 Proxy request, without tunneling.\n    const {\n      origin,\n      path = '/',\n      headers = {}\n    } = opts\n\n    opts.path = origin + path\n\n    if (!('host' in headers) && !('Host' in headers)) {\n      const { host } = new URL(origin)\n      headers.host = host\n    }\n    opts.headers = { ...this[kProxyHeaders], ...headers }\n\n    return this.#client[kDispatch](opts, handler)\n  }\n\n  async [kClose] () {\n    return this.#client.close()\n  }\n\n  async [kDestroy] (err) {\n    return this.#client.destroy(err)\n  }\n}\n\nclass ProxyAgent extends DispatcherBase {\n  constructor (opts) {\n    super()\n\n    if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) {\n      throw new InvalidArgumentError('Proxy uri is mandatory')\n    }\n\n    const { clientFactory = defaultFactory } = opts\n    if (typeof clientFactory !== 'function') {\n      throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')\n    }\n\n    const { proxyTunnel = true } = opts\n\n    const url = this.#getUrl(opts)\n    const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url\n\n    this[kProxy] = { uri: href, protocol }\n    this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)\n      ? opts.interceptors.ProxyAgent\n      : []\n    this[kRequestTls] = opts.requestTls\n    this[kProxyTls] = opts.proxyTls\n    this[kProxyHeaders] = opts.headers || {}\n    this[kTunnelProxy] = proxyTunnel\n\n    if (opts.auth && opts.token) {\n      throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')\n    } else if (opts.auth) {\n      /* @deprecated in favour of opts.token */\n      this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`\n    } else if (opts.token) {\n      this[kProxyHeaders]['proxy-authorization'] = opts.token\n    } else if (username && password) {\n      this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`\n    }\n\n    const connect = buildConnector({ ...opts.proxyTls })\n    this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })\n\n    const agentFactory = opts.factory || defaultAgentFactory\n    const factory = (origin, options) => {\n      const { protocol } = new URL(origin)\n      if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') {\n        return new Http1ProxyWrapper(this[kProxy].uri, {\n          headers: this[kProxyHeaders],\n          connect,\n          factory: agentFactory\n        })\n      }\n      return agentFactory(origin, options)\n    }\n    this[kClient] = clientFactory(url, { connect })\n    this[kAgent] = new Agent({\n      ...opts,\n      factory,\n      connect: async (opts, callback) => {\n        let requestedPath = opts.host\n        if (!opts.port) {\n          requestedPath += `:${defaultProtocolPort(opts.protocol)}`\n        }\n        try {\n          const { socket, statusCode } = await this[kClient].connect({\n            origin,\n            port,\n            path: requestedPath,\n            signal: opts.signal,\n            headers: {\n              ...this[kProxyHeaders],\n              host: opts.host\n            },\n            servername: this[kProxyTls]?.servername || proxyHostname\n          })\n          if (statusCode !== 200) {\n            socket.on('error', noop).destroy()\n            callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))\n          }\n          if (opts.protocol !== 'https:') {\n            callback(null, socket)\n            return\n          }\n          let servername\n          if (this[kRequestTls]) {\n            servername = this[kRequestTls].servername\n          } else {\n            servername = opts.servername\n          }\n          this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)\n        } catch (err) {\n          if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n            // Throw a custom error to avoid loop in client.js#connect\n            callback(new SecureProxyConnectionError(err))\n          } else {\n            callback(err)\n          }\n        }\n      }\n    })\n  }\n\n  dispatch (opts, handler) {\n    const headers = buildHeaders(opts.headers)\n    throwIfProxyAuthIsSent(headers)\n\n    if (headers && !('host' in headers) && !('Host' in headers)) {\n      const { host } = new URL(opts.origin)\n      headers.host = host\n    }\n\n    return this[kAgent].dispatch(\n      {\n        ...opts,\n        headers\n      },\n      handler\n    )\n  }\n\n  /**\n   * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts\n   * @returns {URL}\n   */\n  #getUrl (opts) {\n    if (typeof opts === 'string') {\n      return new URL(opts)\n    } else if (opts instanceof URL) {\n      return opts\n    } else {\n      return new URL(opts.uri)\n    }\n  }\n\n  async [kClose] () {\n    await this[kAgent].close()\n    await this[kClient].close()\n  }\n\n  async [kDestroy] () {\n    await this[kAgent].destroy()\n    await this[kClient].destroy()\n  }\n}\n\n/**\n * @param {string[] | Record} headers\n * @returns {Record}\n */\nfunction buildHeaders (headers) {\n  // When using undici.fetch, the headers list is stored\n  // as an array.\n  if (Array.isArray(headers)) {\n    /** @type {Record} */\n    const headersPair = {}\n\n    for (let i = 0; i < headers.length; i += 2) {\n      headersPair[headers[i]] = headers[i + 1]\n    }\n\n    return headersPair\n  }\n\n  return headers\n}\n\n/**\n * @param {Record} headers\n *\n * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers\n * Nevertheless, it was changed and to avoid a security vulnerability by end users\n * this check was created.\n * It should be removed in the next major version for performance reasons\n */\nfunction throwIfProxyAuthIsSent (headers) {\n  const existProxyAuth = headers && Object.keys(headers)\n    .find((key) => key.toLowerCase() === 'proxy-authorization')\n  if (existProxyAuth) {\n    throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')\n  }\n}\n\nmodule.exports = ProxyAgent\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst RetryHandler = require('../handler/retry-handler')\n\nclass RetryAgent extends Dispatcher {\n  #agent = null\n  #options = null\n  constructor (agent, options = {}) {\n    super(options)\n    this.#agent = agent\n    this.#options = options\n  }\n\n  dispatch (opts, handler) {\n    const retry = new RetryHandler({\n      ...opts,\n      retryOptions: this.#options\n    }, {\n      dispatch: this.#agent.dispatch.bind(this.#agent),\n      handler\n    })\n    return this.#agent.dispatch(opts, retry)\n  }\n\n  close () {\n    return this.#agent.close()\n  }\n\n  destroy () {\n    return this.#agent.destroy()\n  }\n}\n\nmodule.exports = RetryAgent\n","'use strict'\n\n// We include a version number for the Dispatcher API. In case of breaking changes,\n// this version number must be increased to avoid conflicts.\nconst globalDispatcher = Symbol.for('undici.globalDispatcher.1')\nconst { InvalidArgumentError } = require('./core/errors')\nconst Agent = require('./dispatcher/agent')\n\nif (getGlobalDispatcher() === undefined) {\n  setGlobalDispatcher(new Agent())\n}\n\nfunction setGlobalDispatcher (agent) {\n  if (!agent || typeof agent.dispatch !== 'function') {\n    throw new InvalidArgumentError('Argument agent must implement Agent')\n  }\n  Object.defineProperty(globalThis, globalDispatcher, {\n    value: agent,\n    writable: true,\n    enumerable: false,\n    configurable: false\n  })\n}\n\nfunction getGlobalDispatcher () {\n  return globalThis[globalDispatcher]\n}\n\nmodule.exports = {\n  setGlobalDispatcher,\n  getGlobalDispatcher\n}\n","'use strict'\n\nmodule.exports = class DecoratorHandler {\n  #handler\n\n  constructor (handler) {\n    if (typeof handler !== 'object' || handler === null) {\n      throw new TypeError('handler must be an object')\n    }\n    this.#handler = handler\n  }\n\n  onConnect (...args) {\n    return this.#handler.onConnect?.(...args)\n  }\n\n  onError (...args) {\n    return this.#handler.onError?.(...args)\n  }\n\n  onUpgrade (...args) {\n    return this.#handler.onUpgrade?.(...args)\n  }\n\n  onResponseStarted (...args) {\n    return this.#handler.onResponseStarted?.(...args)\n  }\n\n  onHeaders (...args) {\n    return this.#handler.onHeaders?.(...args)\n  }\n\n  onData (...args) {\n    return this.#handler.onData?.(...args)\n  }\n\n  onComplete (...args) {\n    return this.#handler.onComplete?.(...args)\n  }\n\n  onBodySent (...args) {\n    return this.#handler.onBodySent?.(...args)\n  }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('node:assert')\nconst { InvalidArgumentError } = require('../core/errors')\nconst EE = require('node:events')\n\nconst redirectableStatusCodes = [300, 301, 302, 303, 307, 308]\n\nconst kBody = Symbol('body')\n\nclass BodyAsyncIterable {\n  constructor (body) {\n    this[kBody] = body\n    this[kBodyUsed] = false\n  }\n\n  async * [Symbol.asyncIterator] () {\n    assert(!this[kBodyUsed], 'disturbed')\n    this[kBodyUsed] = true\n    yield * this[kBody]\n  }\n}\n\nclass RedirectHandler {\n  constructor (dispatch, maxRedirections, opts, handler) {\n    if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    util.validateHandler(handler, opts.method, opts.upgrade)\n\n    this.dispatch = dispatch\n    this.location = null\n    this.abort = null\n    this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy\n    this.maxRedirections = maxRedirections\n    this.handler = handler\n    this.history = []\n    this.redirectionLimitReached = false\n\n    if (util.isStream(this.opts.body)) {\n      // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n      // so that it can be dispatched again?\n      // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n      if (util.bodyLength(this.opts.body) === 0) {\n        this.opts.body\n          .on('data', function () {\n            assert(false)\n          })\n      }\n\n      if (typeof this.opts.body.readableDidRead !== 'boolean') {\n        this.opts.body[kBodyUsed] = false\n        EE.prototype.on.call(this.opts.body, 'data', function () {\n          this[kBodyUsed] = true\n        })\n      }\n    } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {\n      // TODO (fix): We can't access ReadableStream internal state\n      // to determine whether or not it has been disturbed. This is just\n      // a workaround.\n      this.opts.body = new BodyAsyncIterable(this.opts.body)\n    } else if (\n      this.opts.body &&\n      typeof this.opts.body !== 'string' &&\n      !ArrayBuffer.isView(this.opts.body) &&\n      util.isIterable(this.opts.body)\n    ) {\n      // TODO: Should we allow re-using iterable if !this.opts.idempotent\n      // or through some other flag?\n      this.opts.body = new BodyAsyncIterable(this.opts.body)\n    }\n  }\n\n  onConnect (abort) {\n    this.abort = abort\n    this.handler.onConnect(abort, { history: this.history })\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    this.handler.onUpgrade(statusCode, headers, socket)\n  }\n\n  onError (error) {\n    this.handler.onError(error)\n  }\n\n  onHeaders (statusCode, headers, resume, statusText) {\n    this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)\n      ? null\n      : parseLocation(statusCode, headers)\n\n    if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {\n      if (this.request) {\n        this.request.abort(new Error('max redirects'))\n      }\n\n      this.redirectionLimitReached = true\n      this.abort(new Error('max redirects'))\n      return\n    }\n\n    if (this.opts.origin) {\n      this.history.push(new URL(this.opts.path, this.opts.origin))\n    }\n\n    if (!this.location) {\n      return this.handler.onHeaders(statusCode, headers, resume, statusText)\n    }\n\n    const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))\n    const path = search ? `${pathname}${search}` : pathname\n\n    // Remove headers referring to the original URL.\n    // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.\n    // https://tools.ietf.org/html/rfc7231#section-6.4\n    this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)\n    this.opts.path = path\n    this.opts.origin = origin\n    this.opts.maxRedirections = 0\n    this.opts.query = null\n\n    // https://tools.ietf.org/html/rfc7231#section-6.4.4\n    // In case of HTTP 303, always replace method to be either HEAD or GET\n    if (statusCode === 303 && this.opts.method !== 'HEAD') {\n      this.opts.method = 'GET'\n      this.opts.body = null\n    }\n  }\n\n  onData (chunk) {\n    if (this.location) {\n      /*\n        https://tools.ietf.org/html/rfc7231#section-6.4\n\n        TLDR: undici always ignores 3xx response bodies.\n\n        Redirection is used to serve the requested resource from another URL, so it is assumes that\n        no body is generated (and thus can be ignored). Even though generating a body is not prohibited.\n\n        For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually\n        (which means it's optional and not mandated) contain just an hyperlink to the value of\n        the Location response header, so the body can be ignored safely.\n\n        For status 300, which is \"Multiple Choices\", the spec mentions both generating a Location\n        response header AND a response body with the other possible location to follow.\n        Since the spec explicitly chooses not to specify a format for such body and leave it to\n        servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.\n      */\n    } else {\n      return this.handler.onData(chunk)\n    }\n  }\n\n  onComplete (trailers) {\n    if (this.location) {\n      /*\n        https://tools.ietf.org/html/rfc7231#section-6.4\n\n        TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections\n        and neither are useful if present.\n\n        See comment on onData method above for more detailed information.\n      */\n\n      this.location = null\n      this.abort = null\n\n      this.dispatch(this.opts, this)\n    } else {\n      this.handler.onComplete(trailers)\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this.handler.onBodySent) {\n      this.handler.onBodySent(chunk)\n    }\n  }\n}\n\nfunction parseLocation (statusCode, headers) {\n  if (redirectableStatusCodes.indexOf(statusCode) === -1) {\n    return null\n  }\n\n  for (let i = 0; i < headers.length; i += 2) {\n    if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') {\n      return headers[i + 1]\n    }\n  }\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4.4\nfunction shouldRemoveHeader (header, removeContent, unknownOrigin) {\n  if (header.length === 4) {\n    return util.headerNameToString(header) === 'host'\n  }\n  if (removeContent && util.headerNameToString(header).startsWith('content-')) {\n    return true\n  }\n  if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {\n    const name = util.headerNameToString(header)\n    return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'\n  }\n  return false\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4\nfunction cleanRequestHeaders (headers, removeContent, unknownOrigin) {\n  const ret = []\n  if (Array.isArray(headers)) {\n    for (let i = 0; i < headers.length; i += 2) {\n      if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n        ret.push(headers[i], headers[i + 1])\n      }\n    }\n  } else if (headers && typeof headers === 'object') {\n    for (const key of Object.keys(headers)) {\n      if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n        ret.push(key, headers[key])\n      }\n    }\n  } else {\n    assert(headers == null, 'headers must be an object or an array')\n  }\n  return ret\n}\n\nmodule.exports = RedirectHandler\n","'use strict'\nconst assert = require('node:assert')\n\nconst { kRetryHandlerDefaultRetry } = require('../core/symbols')\nconst { RequestRetryError } = require('../core/errors')\nconst {\n  isDisturbed,\n  parseHeaders,\n  parseRangeHeader,\n  wrapRequestBody\n} = require('../core/util')\n\nfunction calculateRetryAfterHeader (retryAfter) {\n  const current = Date.now()\n  return new Date(retryAfter).getTime() - current\n}\n\nclass RetryHandler {\n  constructor (opts, handlers) {\n    const { retryOptions, ...dispatchOpts } = opts\n    const {\n      // Retry scoped\n      retry: retryFn,\n      maxRetries,\n      maxTimeout,\n      minTimeout,\n      timeoutFactor,\n      // Response scoped\n      methods,\n      errorCodes,\n      retryAfter,\n      statusCodes\n    } = retryOptions ?? {}\n\n    this.dispatch = handlers.dispatch\n    this.handler = handlers.handler\n    this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }\n    this.abort = null\n    this.aborted = false\n    this.retryOpts = {\n      retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],\n      retryAfter: retryAfter ?? true,\n      maxTimeout: maxTimeout ?? 30 * 1000, // 30s,\n      minTimeout: minTimeout ?? 500, // .5s\n      timeoutFactor: timeoutFactor ?? 2,\n      maxRetries: maxRetries ?? 5,\n      // What errors we should retry\n      methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],\n      // Indicates which errors to retry\n      statusCodes: statusCodes ?? [500, 502, 503, 504, 429],\n      // List of errors to retry\n      errorCodes: errorCodes ?? [\n        'ECONNRESET',\n        'ECONNREFUSED',\n        'ENOTFOUND',\n        'ENETDOWN',\n        'ENETUNREACH',\n        'EHOSTDOWN',\n        'EHOSTUNREACH',\n        'EPIPE',\n        'UND_ERR_SOCKET'\n      ]\n    }\n\n    this.retryCount = 0\n    this.retryCountCheckpoint = 0\n    this.start = 0\n    this.end = null\n    this.etag = null\n    this.resume = null\n\n    // Handle possible onConnect duplication\n    this.handler.onConnect(reason => {\n      this.aborted = true\n      if (this.abort) {\n        this.abort(reason)\n      } else {\n        this.reason = reason\n      }\n    })\n  }\n\n  onRequestSent () {\n    if (this.handler.onRequestSent) {\n      this.handler.onRequestSent()\n    }\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    if (this.handler.onUpgrade) {\n      this.handler.onUpgrade(statusCode, headers, socket)\n    }\n  }\n\n  onConnect (abort) {\n    if (this.aborted) {\n      abort(this.reason)\n    } else {\n      this.abort = abort\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this.handler.onBodySent) return this.handler.onBodySent(chunk)\n  }\n\n  static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {\n    const { statusCode, code, headers } = err\n    const { method, retryOptions } = opts\n    const {\n      maxRetries,\n      minTimeout,\n      maxTimeout,\n      timeoutFactor,\n      statusCodes,\n      errorCodes,\n      methods\n    } = retryOptions\n    const { counter } = state\n\n    // Any code that is not a Undici's originated and allowed to retry\n    if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) {\n      cb(err)\n      return\n    }\n\n    // If a set of method are provided and the current method is not in the list\n    if (Array.isArray(methods) && !methods.includes(method)) {\n      cb(err)\n      return\n    }\n\n    // If a set of status code are provided and the current status code is not in the list\n    if (\n      statusCode != null &&\n      Array.isArray(statusCodes) &&\n      !statusCodes.includes(statusCode)\n    ) {\n      cb(err)\n      return\n    }\n\n    // If we reached the max number of retries\n    if (counter > maxRetries) {\n      cb(err)\n      return\n    }\n\n    let retryAfterHeader = headers?.['retry-after']\n    if (retryAfterHeader) {\n      retryAfterHeader = Number(retryAfterHeader)\n      retryAfterHeader = Number.isNaN(retryAfterHeader)\n        ? calculateRetryAfterHeader(retryAfterHeader)\n        : retryAfterHeader * 1e3 // Retry-After is in seconds\n    }\n\n    const retryTimeout =\n      retryAfterHeader > 0\n        ? Math.min(retryAfterHeader, maxTimeout)\n        : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)\n\n    setTimeout(() => cb(null), retryTimeout)\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const headers = parseHeaders(rawHeaders)\n\n    this.retryCount += 1\n\n    if (statusCode >= 300) {\n      if (this.retryOpts.statusCodes.includes(statusCode) === false) {\n        return this.handler.onHeaders(\n          statusCode,\n          rawHeaders,\n          resume,\n          statusMessage\n        )\n      } else {\n        this.abort(\n          new RequestRetryError('Request failed', statusCode, {\n            headers,\n            data: {\n              count: this.retryCount\n            }\n          })\n        )\n        return false\n      }\n    }\n\n    // Checkpoint for resume from where we left it\n    if (this.resume != null) {\n      this.resume = null\n\n      // Only Partial Content 206 supposed to provide Content-Range,\n      // any other status code that partially consumed the payload\n      // should not be retry because it would result in downstream\n      // wrongly concatanete multiple responses.\n      if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {\n        this.abort(\n          new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      const contentRange = parseRangeHeader(headers['content-range'])\n      // If no content range\n      if (!contentRange) {\n        this.abort(\n          new RequestRetryError('Content-Range mismatch', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      // Let's start with a weak etag check\n      if (this.etag != null && this.etag !== headers.etag) {\n        this.abort(\n          new RequestRetryError('ETag mismatch', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      const { start, size, end = size - 1 } = contentRange\n\n      assert(this.start === start, 'content-range mismatch')\n      assert(this.end == null || this.end === end, 'content-range mismatch')\n\n      this.resume = resume\n      return true\n    }\n\n    if (this.end == null) {\n      if (statusCode === 206) {\n        // First time we receive 206\n        const range = parseRangeHeader(headers['content-range'])\n\n        if (range == null) {\n          return this.handler.onHeaders(\n            statusCode,\n            rawHeaders,\n            resume,\n            statusMessage\n          )\n        }\n\n        const { start, size, end = size - 1 } = range\n        assert(\n          start != null && Number.isFinite(start),\n          'content-range mismatch'\n        )\n        assert(end != null && Number.isFinite(end), 'invalid content-length')\n\n        this.start = start\n        this.end = end\n      }\n\n      // We make our best to checkpoint the body for further range headers\n      if (this.end == null) {\n        const contentLength = headers['content-length']\n        this.end = contentLength != null ? Number(contentLength) - 1 : null\n      }\n\n      assert(Number.isFinite(this.start))\n      assert(\n        this.end == null || Number.isFinite(this.end),\n        'invalid content-length'\n      )\n\n      this.resume = resume\n      this.etag = headers.etag != null ? headers.etag : null\n\n      // Weak etags are not useful for comparison nor cache\n      // for instance not safe to assume if the response is byte-per-byte\n      // equal\n      if (this.etag != null && this.etag.startsWith('W/')) {\n        this.etag = null\n      }\n\n      return this.handler.onHeaders(\n        statusCode,\n        rawHeaders,\n        resume,\n        statusMessage\n      )\n    }\n\n    const err = new RequestRetryError('Request failed', statusCode, {\n      headers,\n      data: { count: this.retryCount }\n    })\n\n    this.abort(err)\n\n    return false\n  }\n\n  onData (chunk) {\n    this.start += chunk.length\n\n    return this.handler.onData(chunk)\n  }\n\n  onComplete (rawTrailers) {\n    this.retryCount = 0\n    return this.handler.onComplete(rawTrailers)\n  }\n\n  onError (err) {\n    if (this.aborted || isDisturbed(this.opts.body)) {\n      return this.handler.onError(err)\n    }\n\n    // We reconcile in case of a mix between network errors\n    // and server error response\n    if (this.retryCount - this.retryCountCheckpoint > 0) {\n      // We count the difference between the last checkpoint and the current retry count\n      this.retryCount =\n        this.retryCountCheckpoint +\n        (this.retryCount - this.retryCountCheckpoint)\n    } else {\n      this.retryCount += 1\n    }\n\n    this.retryOpts.retry(\n      err,\n      {\n        state: { counter: this.retryCount },\n        opts: { retryOptions: this.retryOpts, ...this.opts }\n      },\n      onRetry.bind(this)\n    )\n\n    function onRetry (err) {\n      if (err != null || this.aborted || isDisturbed(this.opts.body)) {\n        return this.handler.onError(err)\n      }\n\n      if (this.start !== 0) {\n        const headers = { range: `bytes=${this.start}-${this.end ?? ''}` }\n\n        // Weak etag check - weak etags will make comparison algorithms never match\n        if (this.etag != null) {\n          headers['if-match'] = this.etag\n        }\n\n        this.opts = {\n          ...this.opts,\n          headers: {\n            ...this.opts.headers,\n            ...headers\n          }\n        }\n      }\n\n      try {\n        this.retryCountCheckpoint = this.retryCount\n        this.dispatch(this.opts, this)\n      } catch (err) {\n        this.handler.onError(err)\n      }\n    }\n  }\n}\n\nmodule.exports = RetryHandler\n","'use strict'\nconst { isIP } = require('node:net')\nconst { lookup } = require('node:dns')\nconst DecoratorHandler = require('../handler/decorator-handler')\nconst { InvalidArgumentError, InformationalError } = require('../core/errors')\nconst maxInt = Math.pow(2, 31) - 1\n\nclass DNSInstance {\n  #maxTTL = 0\n  #maxItems = 0\n  #records = new Map()\n  dualStack = true\n  affinity = null\n  lookup = null\n  pick = null\n\n  constructor (opts) {\n    this.#maxTTL = opts.maxTTL\n    this.#maxItems = opts.maxItems\n    this.dualStack = opts.dualStack\n    this.affinity = opts.affinity\n    this.lookup = opts.lookup ?? this.#defaultLookup\n    this.pick = opts.pick ?? this.#defaultPick\n  }\n\n  get full () {\n    return this.#records.size === this.#maxItems\n  }\n\n  runLookup (origin, opts, cb) {\n    const ips = this.#records.get(origin.hostname)\n\n    // If full, we just return the origin\n    if (ips == null && this.full) {\n      cb(null, origin.origin)\n      return\n    }\n\n    const newOpts = {\n      affinity: this.affinity,\n      dualStack: this.dualStack,\n      lookup: this.lookup,\n      pick: this.pick,\n      ...opts.dns,\n      maxTTL: this.#maxTTL,\n      maxItems: this.#maxItems\n    }\n\n    // If no IPs we lookup\n    if (ips == null) {\n      this.lookup(origin, newOpts, (err, addresses) => {\n        if (err || addresses == null || addresses.length === 0) {\n          cb(err ?? new InformationalError('No DNS entries found'))\n          return\n        }\n\n        this.setRecords(origin, addresses)\n        const records = this.#records.get(origin.hostname)\n\n        const ip = this.pick(\n          origin,\n          records,\n          newOpts.affinity\n        )\n\n        let port\n        if (typeof ip.port === 'number') {\n          port = `:${ip.port}`\n        } else if (origin.port !== '') {\n          port = `:${origin.port}`\n        } else {\n          port = ''\n        }\n\n        cb(\n          null,\n          `${origin.protocol}//${\n            ip.family === 6 ? `[${ip.address}]` : ip.address\n          }${port}`\n        )\n      })\n    } else {\n      // If there's IPs we pick\n      const ip = this.pick(\n        origin,\n        ips,\n        newOpts.affinity\n      )\n\n      // If no IPs we lookup - deleting old records\n      if (ip == null) {\n        this.#records.delete(origin.hostname)\n        this.runLookup(origin, opts, cb)\n        return\n      }\n\n      let port\n      if (typeof ip.port === 'number') {\n        port = `:${ip.port}`\n      } else if (origin.port !== '') {\n        port = `:${origin.port}`\n      } else {\n        port = ''\n      }\n\n      cb(\n        null,\n        `${origin.protocol}//${\n          ip.family === 6 ? `[${ip.address}]` : ip.address\n        }${port}`\n      )\n    }\n  }\n\n  #defaultLookup (origin, opts, cb) {\n    lookup(\n      origin.hostname,\n      {\n        all: true,\n        family: this.dualStack === false ? this.affinity : 0,\n        order: 'ipv4first'\n      },\n      (err, addresses) => {\n        if (err) {\n          return cb(err)\n        }\n\n        const results = new Map()\n\n        for (const addr of addresses) {\n          // On linux we found duplicates, we attempt to remove them with\n          // the latest record\n          results.set(`${addr.address}:${addr.family}`, addr)\n        }\n\n        cb(null, results.values())\n      }\n    )\n  }\n\n  #defaultPick (origin, hostnameRecords, affinity) {\n    let ip = null\n    const { records, offset } = hostnameRecords\n\n    let family\n    if (this.dualStack) {\n      if (affinity == null) {\n        // Balance between ip families\n        if (offset == null || offset === maxInt) {\n          hostnameRecords.offset = 0\n          affinity = 4\n        } else {\n          hostnameRecords.offset++\n          affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4\n        }\n      }\n\n      if (records[affinity] != null && records[affinity].ips.length > 0) {\n        family = records[affinity]\n      } else {\n        family = records[affinity === 4 ? 6 : 4]\n      }\n    } else {\n      family = records[affinity]\n    }\n\n    // If no IPs we return null\n    if (family == null || family.ips.length === 0) {\n      return ip\n    }\n\n    if (family.offset == null || family.offset === maxInt) {\n      family.offset = 0\n    } else {\n      family.offset++\n    }\n\n    const position = family.offset % family.ips.length\n    ip = family.ips[position] ?? null\n\n    if (ip == null) {\n      return ip\n    }\n\n    if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms\n      // We delete expired records\n      // It is possible that they have different TTL, so we manage them individually\n      family.ips.splice(position, 1)\n      return this.pick(origin, hostnameRecords, affinity)\n    }\n\n    return ip\n  }\n\n  setRecords (origin, addresses) {\n    const timestamp = Date.now()\n    const records = { records: { 4: null, 6: null } }\n    for (const record of addresses) {\n      record.timestamp = timestamp\n      if (typeof record.ttl === 'number') {\n        // The record TTL is expected to be in ms\n        record.ttl = Math.min(record.ttl, this.#maxTTL)\n      } else {\n        record.ttl = this.#maxTTL\n      }\n\n      const familyRecords = records.records[record.family] ?? { ips: [] }\n\n      familyRecords.ips.push(record)\n      records.records[record.family] = familyRecords\n    }\n\n    this.#records.set(origin.hostname, records)\n  }\n\n  getHandler (meta, opts) {\n    return new DNSDispatchHandler(this, meta, opts)\n  }\n}\n\nclass DNSDispatchHandler extends DecoratorHandler {\n  #state = null\n  #opts = null\n  #dispatch = null\n  #handler = null\n  #origin = null\n\n  constructor (state, { origin, handler, dispatch }, opts) {\n    super(handler)\n    this.#origin = origin\n    this.#handler = handler\n    this.#opts = { ...opts }\n    this.#state = state\n    this.#dispatch = dispatch\n  }\n\n  onError (err) {\n    switch (err.code) {\n      case 'ETIMEDOUT':\n      case 'ECONNREFUSED': {\n        if (this.#state.dualStack) {\n          // We delete the record and retry\n          this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => {\n            if (err) {\n              return this.#handler.onError(err)\n            }\n\n            const dispatchOpts = {\n              ...this.#opts,\n              origin: newOrigin\n            }\n\n            this.#dispatch(dispatchOpts, this)\n          })\n\n          // if dual-stack disabled, we error out\n          return\n        }\n\n        this.#handler.onError(err)\n        return\n      }\n      case 'ENOTFOUND':\n        this.#state.deleteRecord(this.#origin)\n      // eslint-disable-next-line no-fallthrough\n      default:\n        this.#handler.onError(err)\n        break\n    }\n  }\n}\n\nmodule.exports = interceptorOpts => {\n  if (\n    interceptorOpts?.maxTTL != null &&\n    (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0)\n  ) {\n    throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number')\n  }\n\n  if (\n    interceptorOpts?.maxItems != null &&\n    (typeof interceptorOpts?.maxItems !== 'number' ||\n      interceptorOpts?.maxItems < 1)\n  ) {\n    throw new InvalidArgumentError(\n      'Invalid maxItems. Must be a positive number and greater than zero'\n    )\n  }\n\n  if (\n    interceptorOpts?.affinity != null &&\n    interceptorOpts?.affinity !== 4 &&\n    interceptorOpts?.affinity !== 6\n  ) {\n    throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6')\n  }\n\n  if (\n    interceptorOpts?.dualStack != null &&\n    typeof interceptorOpts?.dualStack !== 'boolean'\n  ) {\n    throw new InvalidArgumentError('Invalid dualStack. Must be a boolean')\n  }\n\n  if (\n    interceptorOpts?.lookup != null &&\n    typeof interceptorOpts?.lookup !== 'function'\n  ) {\n    throw new InvalidArgumentError('Invalid lookup. Must be a function')\n  }\n\n  if (\n    interceptorOpts?.pick != null &&\n    typeof interceptorOpts?.pick !== 'function'\n  ) {\n    throw new InvalidArgumentError('Invalid pick. Must be a function')\n  }\n\n  const dualStack = interceptorOpts?.dualStack ?? true\n  let affinity\n  if (dualStack) {\n    affinity = interceptorOpts?.affinity ?? null\n  } else {\n    affinity = interceptorOpts?.affinity ?? 4\n  }\n\n  const opts = {\n    maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms\n    lookup: interceptorOpts?.lookup ?? null,\n    pick: interceptorOpts?.pick ?? null,\n    dualStack,\n    affinity,\n    maxItems: interceptorOpts?.maxItems ?? Infinity\n  }\n\n  const instance = new DNSInstance(opts)\n\n  return dispatch => {\n    return function dnsInterceptor (origDispatchOpts, handler) {\n      const origin =\n        origDispatchOpts.origin.constructor === URL\n          ? origDispatchOpts.origin\n          : new URL(origDispatchOpts.origin)\n\n      if (isIP(origin.hostname) !== 0) {\n        return dispatch(origDispatchOpts, handler)\n      }\n\n      instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {\n        if (err) {\n          return handler.onError(err)\n        }\n\n        let dispatchOpts = null\n        dispatchOpts = {\n          ...origDispatchOpts,\n          servername: origin.hostname, // For SNI on TLS\n          origin: newOrigin,\n          headers: {\n            host: origin.hostname,\n            ...origDispatchOpts.headers\n          }\n        }\n\n        dispatch(\n          dispatchOpts,\n          instance.getHandler({ origin, dispatch, handler }, origDispatchOpts)\n        )\n      })\n\n      return true\n    }\n  }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst DecoratorHandler = require('../handler/decorator-handler')\n\nclass DumpHandler extends DecoratorHandler {\n  #maxSize = 1024 * 1024\n  #abort = null\n  #dumped = false\n  #aborted = false\n  #size = 0\n  #reason = null\n  #handler = null\n\n  constructor ({ maxSize }, handler) {\n    super(handler)\n\n    if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {\n      throw new InvalidArgumentError('maxSize must be a number greater than 0')\n    }\n\n    this.#maxSize = maxSize ?? this.#maxSize\n    this.#handler = handler\n  }\n\n  onConnect (abort) {\n    this.#abort = abort\n\n    this.#handler.onConnect(this.#customAbort.bind(this))\n  }\n\n  #customAbort (reason) {\n    this.#aborted = true\n    this.#reason = reason\n  }\n\n  // TODO: will require adjustment after new hooks are out\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const headers = util.parseHeaders(rawHeaders)\n    const contentLength = headers['content-length']\n\n    if (contentLength != null && contentLength > this.#maxSize) {\n      throw new RequestAbortedError(\n        `Response size (${contentLength}) larger than maxSize (${\n          this.#maxSize\n        })`\n      )\n    }\n\n    if (this.#aborted) {\n      return true\n    }\n\n    return this.#handler.onHeaders(\n      statusCode,\n      rawHeaders,\n      resume,\n      statusMessage\n    )\n  }\n\n  onError (err) {\n    if (this.#dumped) {\n      return\n    }\n\n    err = this.#reason ?? err\n\n    this.#handler.onError(err)\n  }\n\n  onData (chunk) {\n    this.#size = this.#size + chunk.length\n\n    if (this.#size >= this.#maxSize) {\n      this.#dumped = true\n\n      if (this.#aborted) {\n        this.#handler.onError(this.#reason)\n      } else {\n        this.#handler.onComplete([])\n      }\n    }\n\n    return true\n  }\n\n  onComplete (trailers) {\n    if (this.#dumped) {\n      return\n    }\n\n    if (this.#aborted) {\n      this.#handler.onError(this.reason)\n      return\n    }\n\n    this.#handler.onComplete(trailers)\n  }\n}\n\nfunction createDumpInterceptor (\n  { maxSize: defaultMaxSize } = {\n    maxSize: 1024 * 1024\n  }\n) {\n  return dispatch => {\n    return function Intercept (opts, handler) {\n      const { dumpMaxSize = defaultMaxSize } =\n        opts\n\n      const dumpHandler = new DumpHandler(\n        { maxSize: dumpMaxSize },\n        handler\n      )\n\n      return dispatch(opts, dumpHandler)\n    }\n  }\n}\n\nmodule.exports = createDumpInterceptor\n","'use strict'\n\nconst RedirectHandler = require('../handler/redirect-handler')\n\nfunction createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {\n  return (dispatch) => {\n    return function Intercept (opts, handler) {\n      const { maxRedirections = defaultMaxRedirections } = opts\n\n      if (!maxRedirections) {\n        return dispatch(opts, handler)\n      }\n\n      const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)\n      opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.\n      return dispatch(opts, redirectHandler)\n    }\n  }\n}\n\nmodule.exports = createRedirectInterceptor\n","'use strict'\nconst RedirectHandler = require('../handler/redirect-handler')\n\nmodule.exports = opts => {\n  const globalMaxRedirections = opts?.maxRedirections\n  return dispatch => {\n    return function redirectInterceptor (opts, handler) {\n      const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts\n\n      if (!maxRedirections) {\n        return dispatch(opts, handler)\n      }\n\n      const redirectHandler = new RedirectHandler(\n        dispatch,\n        maxRedirections,\n        opts,\n        handler\n      )\n\n      return dispatch(baseOpts, redirectHandler)\n    }\n  }\n}\n","'use strict'\nconst RetryHandler = require('../handler/retry-handler')\n\nmodule.exports = globalOpts => {\n  return dispatch => {\n    return function retryInterceptor (opts, handler) {\n      return dispatch(\n        opts,\n        new RetryHandler(\n          { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },\n          {\n            handler,\n            dispatch\n          }\n        )\n      )\n    }\n  }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;\nconst utils_1 = require(\"./utils\");\n// C headers\nvar ERROR;\n(function (ERROR) {\n    ERROR[ERROR[\"OK\"] = 0] = \"OK\";\n    ERROR[ERROR[\"INTERNAL\"] = 1] = \"INTERNAL\";\n    ERROR[ERROR[\"STRICT\"] = 2] = \"STRICT\";\n    ERROR[ERROR[\"LF_EXPECTED\"] = 3] = \"LF_EXPECTED\";\n    ERROR[ERROR[\"UNEXPECTED_CONTENT_LENGTH\"] = 4] = \"UNEXPECTED_CONTENT_LENGTH\";\n    ERROR[ERROR[\"CLOSED_CONNECTION\"] = 5] = \"CLOSED_CONNECTION\";\n    ERROR[ERROR[\"INVALID_METHOD\"] = 6] = \"INVALID_METHOD\";\n    ERROR[ERROR[\"INVALID_URL\"] = 7] = \"INVALID_URL\";\n    ERROR[ERROR[\"INVALID_CONSTANT\"] = 8] = \"INVALID_CONSTANT\";\n    ERROR[ERROR[\"INVALID_VERSION\"] = 9] = \"INVALID_VERSION\";\n    ERROR[ERROR[\"INVALID_HEADER_TOKEN\"] = 10] = \"INVALID_HEADER_TOKEN\";\n    ERROR[ERROR[\"INVALID_CONTENT_LENGTH\"] = 11] = \"INVALID_CONTENT_LENGTH\";\n    ERROR[ERROR[\"INVALID_CHUNK_SIZE\"] = 12] = \"INVALID_CHUNK_SIZE\";\n    ERROR[ERROR[\"INVALID_STATUS\"] = 13] = \"INVALID_STATUS\";\n    ERROR[ERROR[\"INVALID_EOF_STATE\"] = 14] = \"INVALID_EOF_STATE\";\n    ERROR[ERROR[\"INVALID_TRANSFER_ENCODING\"] = 15] = \"INVALID_TRANSFER_ENCODING\";\n    ERROR[ERROR[\"CB_MESSAGE_BEGIN\"] = 16] = \"CB_MESSAGE_BEGIN\";\n    ERROR[ERROR[\"CB_HEADERS_COMPLETE\"] = 17] = \"CB_HEADERS_COMPLETE\";\n    ERROR[ERROR[\"CB_MESSAGE_COMPLETE\"] = 18] = \"CB_MESSAGE_COMPLETE\";\n    ERROR[ERROR[\"CB_CHUNK_HEADER\"] = 19] = \"CB_CHUNK_HEADER\";\n    ERROR[ERROR[\"CB_CHUNK_COMPLETE\"] = 20] = \"CB_CHUNK_COMPLETE\";\n    ERROR[ERROR[\"PAUSED\"] = 21] = \"PAUSED\";\n    ERROR[ERROR[\"PAUSED_UPGRADE\"] = 22] = \"PAUSED_UPGRADE\";\n    ERROR[ERROR[\"PAUSED_H2_UPGRADE\"] = 23] = \"PAUSED_H2_UPGRADE\";\n    ERROR[ERROR[\"USER\"] = 24] = \"USER\";\n})(ERROR = exports.ERROR || (exports.ERROR = {}));\nvar TYPE;\n(function (TYPE) {\n    TYPE[TYPE[\"BOTH\"] = 0] = \"BOTH\";\n    TYPE[TYPE[\"REQUEST\"] = 1] = \"REQUEST\";\n    TYPE[TYPE[\"RESPONSE\"] = 2] = \"RESPONSE\";\n})(TYPE = exports.TYPE || (exports.TYPE = {}));\nvar FLAGS;\n(function (FLAGS) {\n    FLAGS[FLAGS[\"CONNECTION_KEEP_ALIVE\"] = 1] = \"CONNECTION_KEEP_ALIVE\";\n    FLAGS[FLAGS[\"CONNECTION_CLOSE\"] = 2] = \"CONNECTION_CLOSE\";\n    FLAGS[FLAGS[\"CONNECTION_UPGRADE\"] = 4] = \"CONNECTION_UPGRADE\";\n    FLAGS[FLAGS[\"CHUNKED\"] = 8] = \"CHUNKED\";\n    FLAGS[FLAGS[\"UPGRADE\"] = 16] = \"UPGRADE\";\n    FLAGS[FLAGS[\"CONTENT_LENGTH\"] = 32] = \"CONTENT_LENGTH\";\n    FLAGS[FLAGS[\"SKIPBODY\"] = 64] = \"SKIPBODY\";\n    FLAGS[FLAGS[\"TRAILING\"] = 128] = \"TRAILING\";\n    // 1 << 8 is unused\n    FLAGS[FLAGS[\"TRANSFER_ENCODING\"] = 512] = \"TRANSFER_ENCODING\";\n})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));\nvar LENIENT_FLAGS;\n(function (LENIENT_FLAGS) {\n    LENIENT_FLAGS[LENIENT_FLAGS[\"HEADERS\"] = 1] = \"HEADERS\";\n    LENIENT_FLAGS[LENIENT_FLAGS[\"CHUNKED_LENGTH\"] = 2] = \"CHUNKED_LENGTH\";\n    LENIENT_FLAGS[LENIENT_FLAGS[\"KEEP_ALIVE\"] = 4] = \"KEEP_ALIVE\";\n})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));\nvar METHODS;\n(function (METHODS) {\n    METHODS[METHODS[\"DELETE\"] = 0] = \"DELETE\";\n    METHODS[METHODS[\"GET\"] = 1] = \"GET\";\n    METHODS[METHODS[\"HEAD\"] = 2] = \"HEAD\";\n    METHODS[METHODS[\"POST\"] = 3] = \"POST\";\n    METHODS[METHODS[\"PUT\"] = 4] = \"PUT\";\n    /* pathological */\n    METHODS[METHODS[\"CONNECT\"] = 5] = \"CONNECT\";\n    METHODS[METHODS[\"OPTIONS\"] = 6] = \"OPTIONS\";\n    METHODS[METHODS[\"TRACE\"] = 7] = \"TRACE\";\n    /* WebDAV */\n    METHODS[METHODS[\"COPY\"] = 8] = \"COPY\";\n    METHODS[METHODS[\"LOCK\"] = 9] = \"LOCK\";\n    METHODS[METHODS[\"MKCOL\"] = 10] = \"MKCOL\";\n    METHODS[METHODS[\"MOVE\"] = 11] = \"MOVE\";\n    METHODS[METHODS[\"PROPFIND\"] = 12] = \"PROPFIND\";\n    METHODS[METHODS[\"PROPPATCH\"] = 13] = \"PROPPATCH\";\n    METHODS[METHODS[\"SEARCH\"] = 14] = \"SEARCH\";\n    METHODS[METHODS[\"UNLOCK\"] = 15] = \"UNLOCK\";\n    METHODS[METHODS[\"BIND\"] = 16] = \"BIND\";\n    METHODS[METHODS[\"REBIND\"] = 17] = \"REBIND\";\n    METHODS[METHODS[\"UNBIND\"] = 18] = \"UNBIND\";\n    METHODS[METHODS[\"ACL\"] = 19] = \"ACL\";\n    /* subversion */\n    METHODS[METHODS[\"REPORT\"] = 20] = \"REPORT\";\n    METHODS[METHODS[\"MKACTIVITY\"] = 21] = \"MKACTIVITY\";\n    METHODS[METHODS[\"CHECKOUT\"] = 22] = \"CHECKOUT\";\n    METHODS[METHODS[\"MERGE\"] = 23] = \"MERGE\";\n    /* upnp */\n    METHODS[METHODS[\"M-SEARCH\"] = 24] = \"M-SEARCH\";\n    METHODS[METHODS[\"NOTIFY\"] = 25] = \"NOTIFY\";\n    METHODS[METHODS[\"SUBSCRIBE\"] = 26] = \"SUBSCRIBE\";\n    METHODS[METHODS[\"UNSUBSCRIBE\"] = 27] = \"UNSUBSCRIBE\";\n    /* RFC-5789 */\n    METHODS[METHODS[\"PATCH\"] = 28] = \"PATCH\";\n    METHODS[METHODS[\"PURGE\"] = 29] = \"PURGE\";\n    /* CalDAV */\n    METHODS[METHODS[\"MKCALENDAR\"] = 30] = \"MKCALENDAR\";\n    /* RFC-2068, section 19.6.1.2 */\n    METHODS[METHODS[\"LINK\"] = 31] = \"LINK\";\n    METHODS[METHODS[\"UNLINK\"] = 32] = \"UNLINK\";\n    /* icecast */\n    METHODS[METHODS[\"SOURCE\"] = 33] = \"SOURCE\";\n    /* RFC-7540, section 11.6 */\n    METHODS[METHODS[\"PRI\"] = 34] = \"PRI\";\n    /* RFC-2326 RTSP */\n    METHODS[METHODS[\"DESCRIBE\"] = 35] = \"DESCRIBE\";\n    METHODS[METHODS[\"ANNOUNCE\"] = 36] = \"ANNOUNCE\";\n    METHODS[METHODS[\"SETUP\"] = 37] = \"SETUP\";\n    METHODS[METHODS[\"PLAY\"] = 38] = \"PLAY\";\n    METHODS[METHODS[\"PAUSE\"] = 39] = \"PAUSE\";\n    METHODS[METHODS[\"TEARDOWN\"] = 40] = \"TEARDOWN\";\n    METHODS[METHODS[\"GET_PARAMETER\"] = 41] = \"GET_PARAMETER\";\n    METHODS[METHODS[\"SET_PARAMETER\"] = 42] = \"SET_PARAMETER\";\n    METHODS[METHODS[\"REDIRECT\"] = 43] = \"REDIRECT\";\n    METHODS[METHODS[\"RECORD\"] = 44] = \"RECORD\";\n    /* RAOP */\n    METHODS[METHODS[\"FLUSH\"] = 45] = \"FLUSH\";\n})(METHODS = exports.METHODS || (exports.METHODS = {}));\nexports.METHODS_HTTP = [\n    METHODS.DELETE,\n    METHODS.GET,\n    METHODS.HEAD,\n    METHODS.POST,\n    METHODS.PUT,\n    METHODS.CONNECT,\n    METHODS.OPTIONS,\n    METHODS.TRACE,\n    METHODS.COPY,\n    METHODS.LOCK,\n    METHODS.MKCOL,\n    METHODS.MOVE,\n    METHODS.PROPFIND,\n    METHODS.PROPPATCH,\n    METHODS.SEARCH,\n    METHODS.UNLOCK,\n    METHODS.BIND,\n    METHODS.REBIND,\n    METHODS.UNBIND,\n    METHODS.ACL,\n    METHODS.REPORT,\n    METHODS.MKACTIVITY,\n    METHODS.CHECKOUT,\n    METHODS.MERGE,\n    METHODS['M-SEARCH'],\n    METHODS.NOTIFY,\n    METHODS.SUBSCRIBE,\n    METHODS.UNSUBSCRIBE,\n    METHODS.PATCH,\n    METHODS.PURGE,\n    METHODS.MKCALENDAR,\n    METHODS.LINK,\n    METHODS.UNLINK,\n    METHODS.PRI,\n    // TODO(indutny): should we allow it with HTTP?\n    METHODS.SOURCE,\n];\nexports.METHODS_ICE = [\n    METHODS.SOURCE,\n];\nexports.METHODS_RTSP = [\n    METHODS.OPTIONS,\n    METHODS.DESCRIBE,\n    METHODS.ANNOUNCE,\n    METHODS.SETUP,\n    METHODS.PLAY,\n    METHODS.PAUSE,\n    METHODS.TEARDOWN,\n    METHODS.GET_PARAMETER,\n    METHODS.SET_PARAMETER,\n    METHODS.REDIRECT,\n    METHODS.RECORD,\n    METHODS.FLUSH,\n    // For AirPlay\n    METHODS.GET,\n    METHODS.POST,\n];\nexports.METHOD_MAP = utils_1.enumToMap(METHODS);\nexports.H_METHOD_MAP = {};\nObject.keys(exports.METHOD_MAP).forEach((key) => {\n    if (/^H/.test(key)) {\n        exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];\n    }\n});\nvar FINISH;\n(function (FINISH) {\n    FINISH[FINISH[\"SAFE\"] = 0] = \"SAFE\";\n    FINISH[FINISH[\"SAFE_WITH_CB\"] = 1] = \"SAFE_WITH_CB\";\n    FINISH[FINISH[\"UNSAFE\"] = 2] = \"UNSAFE\";\n})(FINISH = exports.FINISH || (exports.FINISH = {}));\nexports.ALPHA = [];\nfor (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {\n    // Upper case\n    exports.ALPHA.push(String.fromCharCode(i));\n    // Lower case\n    exports.ALPHA.push(String.fromCharCode(i + 0x20));\n}\nexports.NUM_MAP = {\n    0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n    5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n};\nexports.HEX_MAP = {\n    0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n    5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n    A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,\n    a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,\n};\nexports.NUM = [\n    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n];\nexports.ALPHANUM = exports.ALPHA.concat(exports.NUM);\nexports.MARK = ['-', '_', '.', '!', '~', '*', '\\'', '(', ')'];\nexports.USERINFO_CHARS = exports.ALPHANUM\n    .concat(exports.MARK)\n    .concat(['%', ';', ':', '&', '=', '+', '$', ',']);\n// TODO(indutny): use RFC\nexports.STRICT_URL_CHAR = [\n    '!', '\"', '$', '%', '&', '\\'',\n    '(', ')', '*', '+', ',', '-', '.', '/',\n    ':', ';', '<', '=', '>',\n    '@', '[', '\\\\', ']', '^', '_',\n    '`',\n    '{', '|', '}', '~',\n].concat(exports.ALPHANUM);\nexports.URL_CHAR = exports.STRICT_URL_CHAR\n    .concat(['\\t', '\\f']);\n// All characters with 0x80 bit set to 1\nfor (let i = 0x80; i <= 0xff; i++) {\n    exports.URL_CHAR.push(i);\n}\nexports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);\n/* Tokens as defined by rfc 2616. Also lowercases them.\n *        token       = 1*\n *     separators     = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n *                    | \",\" | \";\" | \":\" | \"\\\" | <\">\n *                    | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n *                    | \"{\" | \"}\" | SP | HT\n */\nexports.STRICT_TOKEN = [\n    '!', '#', '$', '%', '&', '\\'',\n    '*', '+', '-', '.',\n    '^', '_', '`',\n    '|', '~',\n].concat(exports.ALPHANUM);\nexports.TOKEN = exports.STRICT_TOKEN.concat([' ']);\n/*\n * Verify that a char is a valid visible (printable) US-ASCII\n * character or %x80-FF\n */\nexports.HEADER_CHARS = ['\\t'];\nfor (let i = 32; i <= 255; i++) {\n    if (i !== 127) {\n        exports.HEADER_CHARS.push(i);\n    }\n}\n// ',' = \\x44\nexports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);\nexports.MAJOR = exports.NUM_MAP;\nexports.MINOR = exports.MAJOR;\nvar HEADER_STATE;\n(function (HEADER_STATE) {\n    HEADER_STATE[HEADER_STATE[\"GENERAL\"] = 0] = \"GENERAL\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION\"] = 1] = \"CONNECTION\";\n    HEADER_STATE[HEADER_STATE[\"CONTENT_LENGTH\"] = 2] = \"CONTENT_LENGTH\";\n    HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING\"] = 3] = \"TRANSFER_ENCODING\";\n    HEADER_STATE[HEADER_STATE[\"UPGRADE\"] = 4] = \"UPGRADE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_KEEP_ALIVE\"] = 5] = \"CONNECTION_KEEP_ALIVE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_CLOSE\"] = 6] = \"CONNECTION_CLOSE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_UPGRADE\"] = 7] = \"CONNECTION_UPGRADE\";\n    HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING_CHUNKED\"] = 8] = \"TRANSFER_ENCODING_CHUNKED\";\n})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));\nexports.SPECIAL_HEADERS = {\n    'connection': HEADER_STATE.CONNECTION,\n    'content-length': HEADER_STATE.CONTENT_LENGTH,\n    'proxy-connection': HEADER_STATE.CONNECTION,\n    'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,\n    'upgrade': HEADER_STATE.UPGRADE,\n};\n//# sourceMappingURL=constants.js.map","'use strict'\n\nconst { Buffer } = require('node:buffer')\n\nmodule.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbG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NgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZL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ASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5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AJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsB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mohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAE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0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQe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BAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64')\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enumToMap = void 0;\nfunction enumToMap(obj) {\n    const res = {};\n    Object.keys(obj).forEach((key) => {\n        const value = obj[key];\n        if (typeof value === 'number') {\n            res[key] = value;\n        }\n    });\n    return res;\n}\nexports.enumToMap = enumToMap;\n//# sourceMappingURL=utils.js.map","'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../dispatcher/agent')\nconst {\n  kAgent,\n  kMockAgentSet,\n  kMockAgentGet,\n  kDispatches,\n  kIsMockActive,\n  kNetConnect,\n  kGetNetConnect,\n  kOptions,\n  kFactory\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, buildMockOptions } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher/dispatcher')\nconst Pluralizer = require('./pluralizer')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\n\nclass MockAgent extends Dispatcher {\n  constructor (opts) {\n    super(opts)\n\n    this[kNetConnect] = true\n    this[kIsMockActive] = true\n\n    // Instantiate Agent and encapsulate\n    if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n    const agent = opts?.agent ? opts.agent : new Agent(opts)\n    this[kAgent] = agent\n\n    this[kClients] = agent[kClients]\n    this[kOptions] = buildMockOptions(opts)\n  }\n\n  get (origin) {\n    let dispatcher = this[kMockAgentGet](origin)\n\n    if (!dispatcher) {\n      dispatcher = this[kFactory](origin)\n      this[kMockAgentSet](origin, dispatcher)\n    }\n    return dispatcher\n  }\n\n  dispatch (opts, handler) {\n    // Call MockAgent.get to perform additional setup before dispatching as normal\n    this.get(opts.origin)\n    return this[kAgent].dispatch(opts, handler)\n  }\n\n  async close () {\n    await this[kAgent].close()\n    this[kClients].clear()\n  }\n\n  deactivate () {\n    this[kIsMockActive] = false\n  }\n\n  activate () {\n    this[kIsMockActive] = true\n  }\n\n  enableNetConnect (matcher) {\n    if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n      if (Array.isArray(this[kNetConnect])) {\n        this[kNetConnect].push(matcher)\n      } else {\n        this[kNetConnect] = [matcher]\n      }\n    } else if (typeof matcher === 'undefined') {\n      this[kNetConnect] = true\n    } else {\n      throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n    }\n  }\n\n  disableNetConnect () {\n    this[kNetConnect] = false\n  }\n\n  // This is required to bypass issues caused by using global symbols - see:\n  // https://github.com/nodejs/undici/issues/1447\n  get isMockActive () {\n    return this[kIsMockActive]\n  }\n\n  [kMockAgentSet] (origin, dispatcher) {\n    this[kClients].set(origin, dispatcher)\n  }\n\n  [kFactory] (origin) {\n    const mockOptions = Object.assign({ agent: this }, this[kOptions])\n    return this[kOptions] && this[kOptions].connections === 1\n      ? new MockClient(origin, mockOptions)\n      : new MockPool(origin, mockOptions)\n  }\n\n  [kMockAgentGet] (origin) {\n    // First check if we can immediately find it\n    const client = this[kClients].get(origin)\n    if (client) {\n      return client\n    }\n\n    // If the origin is not a string create a dummy parent pool and return to user\n    if (typeof origin !== 'string') {\n      const dispatcher = this[kFactory]('http://localhost:9999')\n      this[kMockAgentSet](origin, dispatcher)\n      return dispatcher\n    }\n\n    // If we match, create a pool and assign the same dispatches\n    for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) {\n      if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n        const dispatcher = this[kFactory](origin)\n        this[kMockAgentSet](origin, dispatcher)\n        dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]\n        return dispatcher\n      }\n    }\n  }\n\n  [kGetNetConnect] () {\n    return this[kNetConnect]\n  }\n\n  pendingInterceptors () {\n    const mockAgentClients = this[kClients]\n\n    return Array.from(mockAgentClients.entries())\n      .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n      .filter(({ pending }) => pending)\n  }\n\n  assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n    const pending = this.pendingInterceptors()\n\n    if (pending.length === 0) {\n      return\n    }\n\n    const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)\n\n    throw new UndiciError(`\n${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:\n\n${pendingInterceptorsFormatter.format(pending)}\n`.trim())\n  }\n}\n\nmodule.exports = MockAgent\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Client = require('../dispatcher/client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kMockAgent,\n  kClose,\n  kOriginalClose,\n  kOrigin,\n  kOriginalDispatch,\n  kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n  constructor (origin, opts) {\n    super(origin, opts)\n\n    if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n\n    this[kMockAgent] = opts.agent\n    this[kOrigin] = origin\n    this[kDispatches] = []\n    this[kConnected] = 1\n    this[kOriginalDispatch] = this.dispatch\n    this[kOriginalClose] = this.close.bind(this)\n\n    this.dispatch = buildMockDispatch.call(this)\n    this.close = this[kClose]\n  }\n\n  get [Symbols.kConnected] () {\n    return this[kConnected]\n  }\n\n  /**\n   * Sets up the base interceptor for mocking replies from undici.\n   */\n  intercept (opts) {\n    return new MockInterceptor(opts, this[kDispatches])\n  }\n\n  async [kClose] () {\n    await promisify(this[kOriginalClose])()\n    this[kConnected] = 0\n    this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n  }\n}\n\nmodule.exports = MockClient\n","'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nconst kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')\n\n/**\n * The request does not match any registered mock dispatches.\n */\nclass MockNotMatchedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    Error.captureStackTrace(this, MockNotMatchedError)\n    this.name = 'MockNotMatchedError'\n    this.message = message || 'The request does not match any registered mock dispatches'\n    this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kMockNotMatchedError] === true\n  }\n\n  [kMockNotMatchedError] = true\n}\n\nmodule.exports = {\n  MockNotMatchedError\n}\n","'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kDispatchKey,\n  kDefaultHeaders,\n  kDefaultTrailers,\n  kContentLength,\n  kMockDispatch\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { buildURL } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n  constructor (mockDispatch) {\n    this[kMockDispatch] = mockDispatch\n  }\n\n  /**\n   * Delay a reply by a set amount in ms.\n   */\n  delay (waitInMs) {\n    if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n      throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n    }\n\n    this[kMockDispatch].delay = waitInMs\n    return this\n  }\n\n  /**\n   * For a defined reply, never mark as consumed.\n   */\n  persist () {\n    this[kMockDispatch].persist = true\n    return this\n  }\n\n  /**\n   * Allow one to define a reply for a set amount of matching requests.\n   */\n  times (repeatTimes) {\n    if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n      throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n    }\n\n    this[kMockDispatch].times = repeatTimes\n    return this\n  }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n  constructor (opts, mockDispatches) {\n    if (typeof opts !== 'object') {\n      throw new InvalidArgumentError('opts must be an object')\n    }\n    if (typeof opts.path === 'undefined') {\n      throw new InvalidArgumentError('opts.path must be defined')\n    }\n    if (typeof opts.method === 'undefined') {\n      opts.method = 'GET'\n    }\n    // See https://github.com/nodejs/undici/issues/1245\n    // As per RFC 3986, clients are not supposed to send URI\n    // fragments to servers when they retrieve a document,\n    if (typeof opts.path === 'string') {\n      if (opts.query) {\n        opts.path = buildURL(opts.path, opts.query)\n      } else {\n        // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811\n        const parsedURL = new URL(opts.path, 'data://')\n        opts.path = parsedURL.pathname + parsedURL.search\n      }\n    }\n    if (typeof opts.method === 'string') {\n      opts.method = opts.method.toUpperCase()\n    }\n\n    this[kDispatchKey] = buildKey(opts)\n    this[kDispatches] = mockDispatches\n    this[kDefaultHeaders] = {}\n    this[kDefaultTrailers] = {}\n    this[kContentLength] = false\n  }\n\n  createMockScopeDispatchData ({ statusCode, data, responseOptions }) {\n    const responseData = getResponseData(data)\n    const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n    const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n    const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n    return { statusCode, data, headers, trailers }\n  }\n\n  validateReplyParameters (replyParameters) {\n    if (typeof replyParameters.statusCode === 'undefined') {\n      throw new InvalidArgumentError('statusCode must be defined')\n    }\n    if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) {\n      throw new InvalidArgumentError('responseOptions must be an object')\n    }\n  }\n\n  /**\n   * Mock an undici request with a defined reply.\n   */\n  reply (replyOptionsCallbackOrStatusCode) {\n    // Values of reply aren't available right now as they\n    // can only be available when the reply callback is invoked.\n    if (typeof replyOptionsCallbackOrStatusCode === 'function') {\n      // We'll first wrap the provided callback in another function,\n      // this function will properly resolve the data from the callback\n      // when invoked.\n      const wrappedDefaultsCallback = (opts) => {\n        // Our reply options callback contains the parameter for statusCode, data and options.\n        const resolvedData = replyOptionsCallbackOrStatusCode(opts)\n\n        // Check if it is in the right format\n        if (typeof resolvedData !== 'object' || resolvedData === null) {\n          throw new InvalidArgumentError('reply options callback must return an object')\n        }\n\n        const replyParameters = { data: '', responseOptions: {}, ...resolvedData }\n        this.validateReplyParameters(replyParameters)\n        // Since the values can be obtained immediately we return them\n        // from this higher order function that will be resolved later.\n        return {\n          ...this.createMockScopeDispatchData(replyParameters)\n        }\n      }\n\n      // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n      const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)\n      return new MockScope(newMockDispatch)\n    }\n\n    // We can have either one or three parameters, if we get here,\n    // we should have 1-3 parameters. So we spread the arguments of\n    // this function to obtain the parameters, since replyData will always\n    // just be the statusCode.\n    const replyParameters = {\n      statusCode: replyOptionsCallbackOrStatusCode,\n      data: arguments[1] === undefined ? '' : arguments[1],\n      responseOptions: arguments[2] === undefined ? {} : arguments[2]\n    }\n    this.validateReplyParameters(replyParameters)\n\n    // Send in-already provided data like usual\n    const dispatchData = this.createMockScopeDispatchData(replyParameters)\n    const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)\n    return new MockScope(newMockDispatch)\n  }\n\n  /**\n   * Mock an undici request with a defined error.\n   */\n  replyWithError (error) {\n    if (typeof error === 'undefined') {\n      throw new InvalidArgumentError('error must be defined')\n    }\n\n    const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })\n    return new MockScope(newMockDispatch)\n  }\n\n  /**\n   * Set default reply headers on the interceptor for subsequent replies\n   */\n  defaultReplyHeaders (headers) {\n    if (typeof headers === 'undefined') {\n      throw new InvalidArgumentError('headers must be defined')\n    }\n\n    this[kDefaultHeaders] = headers\n    return this\n  }\n\n  /**\n   * Set default reply trailers on the interceptor for subsequent replies\n   */\n  defaultReplyTrailers (trailers) {\n    if (typeof trailers === 'undefined') {\n      throw new InvalidArgumentError('trailers must be defined')\n    }\n\n    this[kDefaultTrailers] = trailers\n    return this\n  }\n\n  /**\n   * Set reply content length header for replies on the interceptor\n   */\n  replyContentLength () {\n    this[kContentLength] = true\n    return this\n  }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Pool = require('../dispatcher/pool')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kMockAgent,\n  kClose,\n  kOriginalClose,\n  kOrigin,\n  kOriginalDispatch,\n  kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockPool provides an API that extends the Pool to influence the mockDispatches.\n */\nclass MockPool extends Pool {\n  constructor (origin, opts) {\n    super(origin, opts)\n\n    if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n\n    this[kMockAgent] = opts.agent\n    this[kOrigin] = origin\n    this[kDispatches] = []\n    this[kConnected] = 1\n    this[kOriginalDispatch] = this.dispatch\n    this[kOriginalClose] = this.close.bind(this)\n\n    this.dispatch = buildMockDispatch.call(this)\n    this.close = this[kClose]\n  }\n\n  get [Symbols.kConnected] () {\n    return this[kConnected]\n  }\n\n  /**\n   * Sets up the base interceptor for mocking replies from undici.\n   */\n  intercept (opts) {\n    return new MockInterceptor(opts, this[kDispatches])\n  }\n\n  async [kClose] () {\n    await promisify(this[kOriginalClose])()\n    this[kConnected] = 0\n    this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n  }\n}\n\nmodule.exports = MockPool\n","'use strict'\n\nmodule.exports = {\n  kAgent: Symbol('agent'),\n  kOptions: Symbol('options'),\n  kFactory: Symbol('factory'),\n  kDispatches: Symbol('dispatches'),\n  kDispatchKey: Symbol('dispatch key'),\n  kDefaultHeaders: Symbol('default headers'),\n  kDefaultTrailers: Symbol('default trailers'),\n  kContentLength: Symbol('content length'),\n  kMockAgent: Symbol('mock agent'),\n  kMockAgentSet: Symbol('mock agent set'),\n  kMockAgentGet: Symbol('mock agent get'),\n  kMockDispatch: Symbol('mock dispatch'),\n  kClose: Symbol('close'),\n  kOriginalClose: Symbol('original agent close'),\n  kOrigin: Symbol('origin'),\n  kIsMockActive: Symbol('is mock active'),\n  kNetConnect: Symbol('net connect'),\n  kGetNetConnect: Symbol('get net connect'),\n  kConnected: Symbol('connected')\n}\n","'use strict'\n\nconst { MockNotMatchedError } = require('./mock-errors')\nconst {\n  kDispatches,\n  kMockAgent,\n  kOriginalDispatch,\n  kOrigin,\n  kGetNetConnect\n} = require('./mock-symbols')\nconst { buildURL } = require('../core/util')\nconst { STATUS_CODES } = require('node:http')\nconst {\n  types: {\n    isPromise\n  }\n} = require('node:util')\n\nfunction matchValue (match, value) {\n  if (typeof match === 'string') {\n    return match === value\n  }\n  if (match instanceof RegExp) {\n    return match.test(value)\n  }\n  if (typeof match === 'function') {\n    return match(value) === true\n  }\n  return false\n}\n\nfunction lowerCaseEntries (headers) {\n  return Object.fromEntries(\n    Object.entries(headers).map(([headerName, headerValue]) => {\n      return [headerName.toLocaleLowerCase(), headerValue]\n    })\n  )\n}\n\n/**\n * @param {import('../../index').Headers|string[]|Record} headers\n * @param {string} key\n */\nfunction getHeaderByName (headers, key) {\n  if (Array.isArray(headers)) {\n    for (let i = 0; i < headers.length; i += 2) {\n      if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {\n        return headers[i + 1]\n      }\n    }\n\n    return undefined\n  } else if (typeof headers.get === 'function') {\n    return headers.get(key)\n  } else {\n    return lowerCaseEntries(headers)[key.toLocaleLowerCase()]\n  }\n}\n\n/** @param {string[]} headers */\nfunction buildHeadersFromArray (headers) { // fetch HeadersList\n  const clone = headers.slice()\n  const entries = []\n  for (let index = 0; index < clone.length; index += 2) {\n    entries.push([clone[index], clone[index + 1]])\n  }\n  return Object.fromEntries(entries)\n}\n\nfunction matchHeaders (mockDispatch, headers) {\n  if (typeof mockDispatch.headers === 'function') {\n    if (Array.isArray(headers)) { // fetch HeadersList\n      headers = buildHeadersFromArray(headers)\n    }\n    return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})\n  }\n  if (typeof mockDispatch.headers === 'undefined') {\n    return true\n  }\n  if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {\n    return false\n  }\n\n  for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {\n    const headerValue = getHeaderByName(headers, matchHeaderName)\n\n    if (!matchValue(matchHeaderValue, headerValue)) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction safeUrl (path) {\n  if (typeof path !== 'string') {\n    return path\n  }\n\n  const pathSegments = path.split('?')\n\n  if (pathSegments.length !== 2) {\n    return path\n  }\n\n  const qp = new URLSearchParams(pathSegments.pop())\n  qp.sort()\n  return [...pathSegments, qp.toString()].join('?')\n}\n\nfunction matchKey (mockDispatch, { path, method, body, headers }) {\n  const pathMatch = matchValue(mockDispatch.path, path)\n  const methodMatch = matchValue(mockDispatch.method, method)\n  const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true\n  const headersMatch = matchHeaders(mockDispatch, headers)\n  return pathMatch && methodMatch && bodyMatch && headersMatch\n}\n\nfunction getResponseData (data) {\n  if (Buffer.isBuffer(data)) {\n    return data\n  } else if (data instanceof Uint8Array) {\n    return data\n  } else if (data instanceof ArrayBuffer) {\n    return data\n  } else if (typeof data === 'object') {\n    return JSON.stringify(data)\n  } else {\n    return data.toString()\n  }\n}\n\nfunction getMockDispatch (mockDispatches, key) {\n  const basePath = key.query ? buildURL(key.path, key.query) : key.path\n  const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath\n\n  // Match path\n  let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)\n  }\n\n  // Match method\n  matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)\n  }\n\n  // Match body\n  matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)\n  }\n\n  // Match headers\n  matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))\n  if (matchedMockDispatches.length === 0) {\n    const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers\n    throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)\n  }\n\n  return matchedMockDispatches[0]\n}\n\nfunction addMockDispatch (mockDispatches, key, data) {\n  const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }\n  const replyData = typeof data === 'function' ? { callback: data } : { ...data }\n  const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }\n  mockDispatches.push(newMockDispatch)\n  return newMockDispatch\n}\n\nfunction deleteMockDispatch (mockDispatches, key) {\n  const index = mockDispatches.findIndex(dispatch => {\n    if (!dispatch.consumed) {\n      return false\n    }\n    return matchKey(dispatch, key)\n  })\n  if (index !== -1) {\n    mockDispatches.splice(index, 1)\n  }\n}\n\nfunction buildKey (opts) {\n  const { path, method, body, headers, query } = opts\n  return {\n    path,\n    method,\n    body,\n    headers,\n    query\n  }\n}\n\nfunction generateKeyValues (data) {\n  const keys = Object.keys(data)\n  const result = []\n  for (let i = 0; i < keys.length; ++i) {\n    const key = keys[i]\n    const value = data[key]\n    const name = Buffer.from(`${key}`)\n    if (Array.isArray(value)) {\n      for (let j = 0; j < value.length; ++j) {\n        result.push(name, Buffer.from(`${value[j]}`))\n      }\n    } else {\n      result.push(name, Buffer.from(`${value}`))\n    }\n  }\n  return result\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n * @param {number} statusCode\n */\nfunction getStatusText (statusCode) {\n  return STATUS_CODES[statusCode] || 'unknown'\n}\n\nasync function getResponse (body) {\n  const buffers = []\n  for await (const data of body) {\n    buffers.push(data)\n  }\n  return Buffer.concat(buffers).toString('utf8')\n}\n\n/**\n * Mock dispatch function used to simulate undici dispatches\n */\nfunction mockDispatch (opts, handler) {\n  // Get mock dispatch from built key\n  const key = buildKey(opts)\n  const mockDispatch = getMockDispatch(this[kDispatches], key)\n\n  mockDispatch.timesInvoked++\n\n  // Here's where we resolve a callback if a callback is present for the dispatch data.\n  if (mockDispatch.data.callback) {\n    mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }\n  }\n\n  // Parse mockDispatch data\n  const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch\n  const { timesInvoked, times } = mockDispatch\n\n  // If it's used up and not persistent, mark as consumed\n  mockDispatch.consumed = !persist && timesInvoked >= times\n  mockDispatch.pending = timesInvoked < times\n\n  // If specified, trigger dispatch error\n  if (error !== null) {\n    deleteMockDispatch(this[kDispatches], key)\n    handler.onError(error)\n    return true\n  }\n\n  // Handle the request with a delay if necessary\n  if (typeof delay === 'number' && delay > 0) {\n    setTimeout(() => {\n      handleReply(this[kDispatches])\n    }, delay)\n  } else {\n    handleReply(this[kDispatches])\n  }\n\n  function handleReply (mockDispatches, _data = data) {\n    // fetch's HeadersList is a 1D string array\n    const optsHeaders = Array.isArray(opts.headers)\n      ? buildHeadersFromArray(opts.headers)\n      : opts.headers\n    const body = typeof _data === 'function'\n      ? _data({ ...opts, headers: optsHeaders })\n      : _data\n\n    // util.types.isPromise is likely needed for jest.\n    if (isPromise(body)) {\n      // If handleReply is asynchronous, throwing an error\n      // in the callback will reject the promise, rather than\n      // synchronously throw the error, which breaks some tests.\n      // Rather, we wait for the callback to resolve if it is a\n      // promise, and then re-run handleReply with the new body.\n      body.then((newData) => handleReply(mockDispatches, newData))\n      return\n    }\n\n    const responseData = getResponseData(body)\n    const responseHeaders = generateKeyValues(headers)\n    const responseTrailers = generateKeyValues(trailers)\n\n    handler.onConnect?.(err => handler.onError(err), null)\n    handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))\n    handler.onData?.(Buffer.from(responseData))\n    handler.onComplete?.(responseTrailers)\n    deleteMockDispatch(mockDispatches, key)\n  }\n\n  function resume () {}\n\n  return true\n}\n\nfunction buildMockDispatch () {\n  const agent = this[kMockAgent]\n  const origin = this[kOrigin]\n  const originalDispatch = this[kOriginalDispatch]\n\n  return function dispatch (opts, handler) {\n    if (agent.isMockActive) {\n      try {\n        mockDispatch.call(this, opts, handler)\n      } catch (error) {\n        if (error instanceof MockNotMatchedError) {\n          const netConnect = agent[kGetNetConnect]()\n          if (netConnect === false) {\n            throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)\n          }\n          if (checkNetConnect(netConnect, origin)) {\n            originalDispatch.call(this, opts, handler)\n          } else {\n            throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)\n          }\n        } else {\n          throw error\n        }\n      }\n    } else {\n      originalDispatch.call(this, opts, handler)\n    }\n  }\n}\n\nfunction checkNetConnect (netConnect, origin) {\n  const url = new URL(origin)\n  if (netConnect === true) {\n    return true\n  } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {\n    return true\n  }\n  return false\n}\n\nfunction buildMockOptions (opts) {\n  if (opts) {\n    const { agent, ...mockOptions } = opts\n    return mockOptions\n  }\n}\n\nmodule.exports = {\n  getResponseData,\n  getMockDispatch,\n  addMockDispatch,\n  deleteMockDispatch,\n  buildKey,\n  generateKeyValues,\n  matchValue,\n  getResponse,\n  getStatusText,\n  mockDispatch,\n  buildMockDispatch,\n  checkNetConnect,\n  buildMockOptions,\n  getHeaderByName,\n  buildHeadersFromArray\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst { Console } = require('node:console')\n\nconst PERSISTENT = process.versions.icu ? '✅' : 'Y '\nconst NOT_PERSISTENT = process.versions.icu ? '❌' : 'N '\n\n/**\n * Gets the output of `console.table(…)` as a string.\n */\nmodule.exports = class PendingInterceptorsFormatter {\n  constructor ({ disableColors } = {}) {\n    this.transform = new Transform({\n      transform (chunk, _enc, cb) {\n        cb(null, chunk)\n      }\n    })\n\n    this.logger = new Console({\n      stdout: this.transform,\n      inspectOptions: {\n        colors: !disableColors && !process.env.CI\n      }\n    })\n  }\n\n  format (pendingInterceptors) {\n    const withPrettyHeaders = pendingInterceptors.map(\n      ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({\n        Method: method,\n        Origin: origin,\n        Path: path,\n        'Status code': statusCode,\n        Persistent: persist ? PERSISTENT : NOT_PERSISTENT,\n        Invocations: timesInvoked,\n        Remaining: persist ? Infinity : times - timesInvoked\n      }))\n\n    this.logger.table(withPrettyHeaders)\n    return this.transform.read().toString()\n  }\n}\n","'use strict'\n\nconst singulars = {\n  pronoun: 'it',\n  is: 'is',\n  was: 'was',\n  this: 'this'\n}\n\nconst plurals = {\n  pronoun: 'they',\n  is: 'are',\n  was: 'were',\n  this: 'these'\n}\n\nmodule.exports = class Pluralizer {\n  constructor (singular, plural) {\n    this.singular = singular\n    this.plural = plural\n  }\n\n  pluralize (count) {\n    const one = count === 1\n    const keys = one ? singulars : plurals\n    const noun = one ? this.singular : this.plural\n    return { ...keys, count, noun }\n  }\n}\n","'use strict'\n\n/**\n * This module offers an optimized timer implementation designed for scenarios\n * where high precision is not critical.\n *\n * The timer achieves faster performance by using a low-resolution approach,\n * with an accuracy target of within 500ms. This makes it particularly useful\n * for timers with delays of 1 second or more, where exact timing is less\n * crucial.\n *\n * It's important to note that Node.js timers are inherently imprecise, as\n * delays can occur due to the event loop being blocked by other operations.\n * Consequently, timers may trigger later than their scheduled time.\n */\n\n/**\n * The fastNow variable contains the internal fast timer clock value.\n *\n * @type {number}\n */\nlet fastNow = 0\n\n/**\n * RESOLUTION_MS represents the target resolution time in milliseconds.\n *\n * @type {number}\n * @default 1000\n */\nconst RESOLUTION_MS = 1e3\n\n/**\n * TICK_MS defines the desired interval in milliseconds between each tick.\n * The target value is set to half the resolution time, minus 1 ms, to account\n * for potential event loop overhead.\n *\n * @type {number}\n * @default 499\n */\nconst TICK_MS = (RESOLUTION_MS >> 1) - 1\n\n/**\n * fastNowTimeout is a Node.js timer used to manage and process\n * the FastTimers stored in the `fastTimers` array.\n *\n * @type {NodeJS.Timeout}\n */\nlet fastNowTimeout\n\n/**\n * The kFastTimer symbol is used to identify FastTimer instances.\n *\n * @type {Symbol}\n */\nconst kFastTimer = Symbol('kFastTimer')\n\n/**\n * The fastTimers array contains all active FastTimers.\n *\n * @type {FastTimer[]}\n */\nconst fastTimers = []\n\n/**\n * These constants represent the various states of a FastTimer.\n */\n\n/**\n * The `NOT_IN_LIST` constant indicates that the FastTimer is not included\n * in the `fastTimers` array. Timers with this status will not be processed\n * during the next tick by the `onTick` function.\n *\n * A FastTimer can be re-added to the `fastTimers` array by invoking the\n * `refresh` method on the FastTimer instance.\n *\n * @type {-2}\n */\nconst NOT_IN_LIST = -2\n\n/**\n * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled\n * for removal from the `fastTimers` array. A FastTimer in this state will\n * be removed in the next tick by the `onTick` function and will no longer\n * be processed.\n *\n * This status is also set when the `clear` method is called on the FastTimer instance.\n *\n * @type {-1}\n */\nconst TO_BE_CLEARED = -1\n\n/**\n * The `PENDING` constant signifies that the FastTimer is awaiting processing\n * in the next tick by the `onTick` function. Timers with this status will have\n * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick.\n *\n * @type {0}\n */\nconst PENDING = 0\n\n/**\n * The `ACTIVE` constant indicates that the FastTimer is active and waiting\n * for its timer to expire. During the next tick, the `onTick` function will\n * check if the timer has expired, and if so, it will execute the associated callback.\n *\n * @type {1}\n */\nconst ACTIVE = 1\n\n/**\n * The onTick function processes the fastTimers array.\n *\n * @returns {void}\n */\nfunction onTick () {\n  /**\n   * Increment the fastNow value by the TICK_MS value, despite the actual time\n   * that has passed since the last tick. This approach ensures independence\n   * from the system clock and delays caused by a blocked event loop.\n   *\n   * @type {number}\n   */\n  fastNow += TICK_MS\n\n  /**\n   * The `idx` variable is used to iterate over the `fastTimers` array.\n   * Expired timers are removed by replacing them with the last element in the array.\n   * Consequently, `idx` is only incremented when the current element is not removed.\n   *\n   * @type {number}\n   */\n  let idx = 0\n\n  /**\n   * The len variable will contain the length of the fastTimers array\n   * and will be decremented when a FastTimer should be removed from the\n   * fastTimers array.\n   *\n   * @type {number}\n   */\n  let len = fastTimers.length\n\n  while (idx < len) {\n    /**\n     * @type {FastTimer}\n     */\n    const timer = fastTimers[idx]\n\n    // If the timer is in the ACTIVE state and the timer has expired, it will\n    // be processed in the next tick.\n    if (timer._state === PENDING) {\n      // Set the _idleStart value to the fastNow value minus the TICK_MS value\n      // to account for the time the timer was in the PENDING state.\n      timer._idleStart = fastNow - TICK_MS\n      timer._state = ACTIVE\n    } else if (\n      timer._state === ACTIVE &&\n      fastNow >= timer._idleStart + timer._idleTimeout\n    ) {\n      timer._state = TO_BE_CLEARED\n      timer._idleStart = -1\n      timer._onTimeout(timer._timerArg)\n    }\n\n    if (timer._state === TO_BE_CLEARED) {\n      timer._state = NOT_IN_LIST\n\n      // Move the last element to the current index and decrement len if it is\n      // not the only element in the array.\n      if (--len !== 0) {\n        fastTimers[idx] = fastTimers[len]\n      }\n    } else {\n      ++idx\n    }\n  }\n\n  // Set the length of the fastTimers array to the new length and thus\n  // removing the excess FastTimers elements from the array.\n  fastTimers.length = len\n\n  // If there are still active FastTimers in the array, refresh the Timer.\n  // If there are no active FastTimers, the timer will be refreshed again\n  // when a new FastTimer is instantiated.\n  if (fastTimers.length !== 0) {\n    refreshTimeout()\n  }\n}\n\nfunction refreshTimeout () {\n  // If the fastNowTimeout is already set, refresh it.\n  if (fastNowTimeout) {\n    fastNowTimeout.refresh()\n  // fastNowTimeout is not instantiated yet, create a new Timer.\n  } else {\n    clearTimeout(fastNowTimeout)\n    fastNowTimeout = setTimeout(onTick, TICK_MS)\n\n    // If the Timer has an unref method, call it to allow the process to exit if\n    // there are no other active handles.\n    if (fastNowTimeout.unref) {\n      fastNowTimeout.unref()\n    }\n  }\n}\n\n/**\n * The `FastTimer` class is a data structure designed to store and manage\n * timer information.\n */\nclass FastTimer {\n  [kFastTimer] = true\n\n  /**\n   * The state of the timer, which can be one of the following:\n   * - NOT_IN_LIST (-2)\n   * - TO_BE_CLEARED (-1)\n   * - PENDING (0)\n   * - ACTIVE (1)\n   *\n   * @type {-2|-1|0|1}\n   * @private\n   */\n  _state = NOT_IN_LIST\n\n  /**\n   * The number of milliseconds to wait before calling the callback.\n   *\n   * @type {number}\n   * @private\n   */\n  _idleTimeout = -1\n\n  /**\n   * The time in milliseconds when the timer was started. This value is used to\n   * calculate when the timer should expire.\n   *\n   * @type {number}\n   * @default -1\n   * @private\n   */\n  _idleStart = -1\n\n  /**\n   * The function to be executed when the timer expires.\n   * @type {Function}\n   * @private\n   */\n  _onTimeout\n\n  /**\n   * The argument to be passed to the callback when the timer expires.\n   *\n   * @type {*}\n   * @private\n   */\n  _timerArg\n\n  /**\n   * @constructor\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should wait\n   * before the specified function or code is executed.\n   * @param {*} arg\n   */\n  constructor (callback, delay, arg) {\n    this._onTimeout = callback\n    this._idleTimeout = delay\n    this._timerArg = arg\n\n    this.refresh()\n  }\n\n  /**\n   * Sets the timer's start time to the current time, and reschedules the timer\n   * to call its callback at the previously specified duration adjusted to the\n   * current time.\n   * Using this on a timer that has already called its callback will reactivate\n   * the timer.\n   *\n   * @returns {void}\n   */\n  refresh () {\n    // In the special case that the timer is not in the list of active timers,\n    // add it back to the array to be processed in the next tick by the onTick\n    // function.\n    if (this._state === NOT_IN_LIST) {\n      fastTimers.push(this)\n    }\n\n    // If the timer is the only active timer, refresh the fastNowTimeout for\n    // better resolution.\n    if (!fastNowTimeout || fastTimers.length === 1) {\n      refreshTimeout()\n    }\n\n    // Setting the state to PENDING will cause the timer to be reset in the\n    // next tick by the onTick function.\n    this._state = PENDING\n  }\n\n  /**\n   * The `clear` method cancels the timer, preventing it from executing.\n   *\n   * @returns {void}\n   * @private\n   */\n  clear () {\n    // Set the state to TO_BE_CLEARED to mark the timer for removal in the next\n    // tick by the onTick function.\n    this._state = TO_BE_CLEARED\n\n    // Reset the _idleStart value to -1 to indicate that the timer is no longer\n    // active.\n    this._idleStart = -1\n  }\n}\n\n/**\n * This module exports a setTimeout and clearTimeout function that can be\n * used as a drop-in replacement for the native functions.\n */\nmodule.exports = {\n  /**\n   * The setTimeout() method sets a timer which executes a function once the\n   * timer expires.\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should\n   * wait before the specified function or code is executed.\n   * @param {*} [arg] An optional argument to be passed to the callback function\n   * when the timer expires.\n   * @returns {NodeJS.Timeout|FastTimer}\n   */\n  setTimeout (callback, delay, arg) {\n    // If the delay is less than or equal to the RESOLUTION_MS value return a\n    // native Node.js Timer instance.\n    return delay <= RESOLUTION_MS\n      ? setTimeout(callback, delay, arg)\n      : new FastTimer(callback, delay, arg)\n  },\n  /**\n   * The clearTimeout method cancels an instantiated Timer previously created\n   * by calling setTimeout.\n   *\n   * @param {NodeJS.Timeout|FastTimer} timeout\n   */\n  clearTimeout (timeout) {\n    // If the timeout is a FastTimer, call its own clear method.\n    if (timeout[kFastTimer]) {\n      /**\n       * @type {FastTimer}\n       */\n      timeout.clear()\n      // Otherwise it is an instance of a native NodeJS.Timeout, so call the\n      // Node.js native clearTimeout function.\n    } else {\n      clearTimeout(timeout)\n    }\n  },\n  /**\n   * The setFastTimeout() method sets a fastTimer which executes a function once\n   * the timer expires.\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should\n   * wait before the specified function or code is executed.\n   * @param {*} [arg] An optional argument to be passed to the callback function\n   * when the timer expires.\n   * @returns {FastTimer}\n   */\n  setFastTimeout (callback, delay, arg) {\n    return new FastTimer(callback, delay, arg)\n  },\n  /**\n   * The clearTimeout method cancels an instantiated FastTimer previously\n   * created by calling setFastTimeout.\n   *\n   * @param {FastTimer} timeout\n   */\n  clearFastTimeout (timeout) {\n    timeout.clear()\n  },\n  /**\n   * The now method returns the value of the internal fast timer clock.\n   *\n   * @returns {number}\n   */\n  now () {\n    return fastNow\n  },\n  /**\n   * Trigger the onTick function to process the fastTimers array.\n   * Exported for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   * @param {number} [delay=0] The delay in milliseconds to add to the now value.\n   */\n  tick (delay = 0) {\n    fastNow += delay - RESOLUTION_MS + 1\n    onTick()\n    onTick()\n  },\n  /**\n   * Reset FastTimers.\n   * Exported for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   */\n  reset () {\n    fastNow = 0\n    fastTimers.length = 0\n    clearTimeout(fastNowTimeout)\n    fastNowTimeout = null\n  },\n  /**\n   * Exporting for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   */\n  kFastTimer\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { urlEquals, getFieldValues } = require('./util')\nconst { kEnumerableProperty, isDisturbed } = require('../../core/util')\nconst { webidl } = require('../fetch/webidl')\nconst { Response, cloneResponse, fromInnerResponse } = require('../fetch/response')\nconst { Request, fromInnerRequest } = require('../fetch/request')\nconst { kState } = require('../fetch/symbols')\nconst { fetching } = require('../fetch/index')\nconst { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require('../fetch/util')\nconst assert = require('node:assert')\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation\n * @typedef {Object} CacheBatchOperation\n * @property {'delete' | 'put'} type\n * @property {any} request\n * @property {any} response\n * @property {import('../../types/cache').CacheQueryOptions} options\n */\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list\n * @typedef {[any, any][]} requestResponseList\n */\n\nclass Cache {\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list\n   * @type {requestResponseList}\n   */\n  #relevantRequestResponseList\n\n  constructor () {\n    if (arguments[0] !== kConstruct) {\n      webidl.illegalConstructor()\n    }\n\n    webidl.util.markAsUncloneable(this)\n    this.#relevantRequestResponseList = arguments[1]\n  }\n\n  async match (request, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.match'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    const p = this.#internalMatchAll(request, options, 1)\n\n    if (p.length === 0) {\n      return\n    }\n\n    return p[0]\n  }\n\n  async matchAll (request = undefined, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.matchAll'\n    if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    return this.#internalMatchAll(request, options)\n  }\n\n  async add (request) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.add'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n\n    // 1.\n    const requests = [request]\n\n    // 2.\n    const responseArrayPromise = this.addAll(requests)\n\n    // 3.\n    return await responseArrayPromise\n  }\n\n  async addAll (requests) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.addAll'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    // 1.\n    const responsePromises = []\n\n    // 2.\n    const requestList = []\n\n    // 3.\n    for (let request of requests) {\n      if (request === undefined) {\n        throw webidl.errors.conversionFailed({\n          prefix,\n          argument: 'Argument 1',\n          types: ['undefined is not allowed']\n        })\n      }\n\n      request = webidl.converters.RequestInfo(request)\n\n      if (typeof request === 'string') {\n        continue\n      }\n\n      // 3.1\n      const r = request[kState]\n\n      // 3.2\n      if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {\n        throw webidl.errors.exception({\n          header: prefix,\n          message: 'Expected http/s scheme when method is not GET.'\n        })\n      }\n    }\n\n    // 4.\n    /** @type {ReturnType[]} */\n    const fetchControllers = []\n\n    // 5.\n    for (const request of requests) {\n      // 5.1\n      const r = new Request(request)[kState]\n\n      // 5.2\n      if (!urlIsHttpHttpsScheme(r.url)) {\n        throw webidl.errors.exception({\n          header: prefix,\n          message: 'Expected http/s scheme.'\n        })\n      }\n\n      // 5.4\n      r.initiator = 'fetch'\n      r.destination = 'subresource'\n\n      // 5.5\n      requestList.push(r)\n\n      // 5.6\n      const responsePromise = createDeferredPromise()\n\n      // 5.7\n      fetchControllers.push(fetching({\n        request: r,\n        processResponse (response) {\n          // 1.\n          if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {\n            responsePromise.reject(webidl.errors.exception({\n              header: 'Cache.addAll',\n              message: 'Received an invalid status code or the request failed.'\n            }))\n          } else if (response.headersList.contains('vary')) { // 2.\n            // 2.1\n            const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n            // 2.2\n            for (const fieldValue of fieldValues) {\n              // 2.2.1\n              if (fieldValue === '*') {\n                responsePromise.reject(webidl.errors.exception({\n                  header: 'Cache.addAll',\n                  message: 'invalid vary field value'\n                }))\n\n                for (const controller of fetchControllers) {\n                  controller.abort()\n                }\n\n                return\n              }\n            }\n          }\n        },\n        processResponseEndOfBody (response) {\n          // 1.\n          if (response.aborted) {\n            responsePromise.reject(new DOMException('aborted', 'AbortError'))\n            return\n          }\n\n          // 2.\n          responsePromise.resolve(response)\n        }\n      }))\n\n      // 5.8\n      responsePromises.push(responsePromise.promise)\n    }\n\n    // 6.\n    const p = Promise.all(responsePromises)\n\n    // 7.\n    const responses = await p\n\n    // 7.1\n    const operations = []\n\n    // 7.2\n    let index = 0\n\n    // 7.3\n    for (const response of responses) {\n      // 7.3.1\n      /** @type {CacheBatchOperation} */\n      const operation = {\n        type: 'put', // 7.3.2\n        request: requestList[index], // 7.3.3\n        response // 7.3.4\n      }\n\n      operations.push(operation) // 7.3.5\n\n      index++ // 7.3.6\n    }\n\n    // 7.5\n    const cacheJobPromise = createDeferredPromise()\n\n    // 7.6.1\n    let errorData = null\n\n    // 7.6.2\n    try {\n      this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    // 7.6.3\n    queueMicrotask(() => {\n      // 7.6.3.1\n      if (errorData === null) {\n        cacheJobPromise.resolve(undefined)\n      } else {\n        // 7.6.3.2\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    // 7.7\n    return cacheJobPromise.promise\n  }\n\n  async put (request, response) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.put'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    response = webidl.converters.Response(response, prefix, 'response')\n\n    // 1.\n    let innerRequest = null\n\n    // 2.\n    if (request instanceof Request) {\n      innerRequest = request[kState]\n    } else { // 3.\n      innerRequest = new Request(request)[kState]\n    }\n\n    // 4.\n    if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Expected an http/s scheme when method is not GET'\n      })\n    }\n\n    // 5.\n    const innerResponse = response[kState]\n\n    // 6.\n    if (innerResponse.status === 206) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Got 206 status'\n      })\n    }\n\n    // 7.\n    if (innerResponse.headersList.contains('vary')) {\n      // 7.1.\n      const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))\n\n      // 7.2.\n      for (const fieldValue of fieldValues) {\n        // 7.2.1\n        if (fieldValue === '*') {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: 'Got * vary field value'\n          })\n        }\n      }\n    }\n\n    // 8.\n    if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Response body is locked or disturbed'\n      })\n    }\n\n    // 9.\n    const clonedResponse = cloneResponse(innerResponse)\n\n    // 10.\n    const bodyReadPromise = createDeferredPromise()\n\n    // 11.\n    if (innerResponse.body != null) {\n      // 11.1\n      const stream = innerResponse.body.stream\n\n      // 11.2\n      const reader = stream.getReader()\n\n      // 11.3\n      readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)\n    } else {\n      bodyReadPromise.resolve(undefined)\n    }\n\n    // 12.\n    /** @type {CacheBatchOperation[]} */\n    const operations = []\n\n    // 13.\n    /** @type {CacheBatchOperation} */\n    const operation = {\n      type: 'put', // 14.\n      request: innerRequest, // 15.\n      response: clonedResponse // 16.\n    }\n\n    // 17.\n    operations.push(operation)\n\n    // 19.\n    const bytes = await bodyReadPromise.promise\n\n    if (clonedResponse.body != null) {\n      clonedResponse.body.source = bytes\n    }\n\n    // 19.1\n    const cacheJobPromise = createDeferredPromise()\n\n    // 19.2.1\n    let errorData = null\n\n    // 19.2.2\n    try {\n      this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    // 19.2.3\n    queueMicrotask(() => {\n      // 19.2.3.1\n      if (errorData === null) {\n        cacheJobPromise.resolve()\n      } else { // 19.2.3.2\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    return cacheJobPromise.promise\n  }\n\n  async delete (request, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    /**\n     * @type {Request}\n     */\n    let r = null\n\n    if (request instanceof Request) {\n      r = request[kState]\n\n      if (r.method !== 'GET' && !options.ignoreMethod) {\n        return false\n      }\n    } else {\n      assert(typeof request === 'string')\n\n      r = new Request(request)[kState]\n    }\n\n    /** @type {CacheBatchOperation[]} */\n    const operations = []\n\n    /** @type {CacheBatchOperation} */\n    const operation = {\n      type: 'delete',\n      request: r,\n      options\n    }\n\n    operations.push(operation)\n\n    const cacheJobPromise = createDeferredPromise()\n\n    let errorData = null\n    let requestResponses\n\n    try {\n      requestResponses = this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    queueMicrotask(() => {\n      if (errorData === null) {\n        cacheJobPromise.resolve(!!requestResponses?.length)\n      } else {\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    return cacheJobPromise.promise\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys\n   * @param {any} request\n   * @param {import('../../types/cache').CacheQueryOptions} options\n   * @returns {Promise}\n   */\n  async keys (request = undefined, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.keys'\n\n    if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    // 1.\n    let r = null\n\n    // 2.\n    if (request !== undefined) {\n      // 2.1\n      if (request instanceof Request) {\n        // 2.1.1\n        r = request[kState]\n\n        // 2.1.2\n        if (r.method !== 'GET' && !options.ignoreMethod) {\n          return []\n        }\n      } else if (typeof request === 'string') { // 2.2\n        r = new Request(request)[kState]\n      }\n    }\n\n    // 4.\n    const promise = createDeferredPromise()\n\n    // 5.\n    // 5.1\n    const requests = []\n\n    // 5.2\n    if (request === undefined) {\n      // 5.2.1\n      for (const requestResponse of this.#relevantRequestResponseList) {\n        // 5.2.1.1\n        requests.push(requestResponse[0])\n      }\n    } else { // 5.3\n      // 5.3.1\n      const requestResponses = this.#queryCache(r, options)\n\n      // 5.3.2\n      for (const requestResponse of requestResponses) {\n        // 5.3.2.1\n        requests.push(requestResponse[0])\n      }\n    }\n\n    // 5.4\n    queueMicrotask(() => {\n      // 5.4.1\n      const requestList = []\n\n      // 5.4.2\n      for (const request of requests) {\n        const requestObject = fromInnerRequest(\n          request,\n          new AbortController().signal,\n          'immutable'\n        )\n        // 5.4.2.1\n        requestList.push(requestObject)\n      }\n\n      // 5.4.3\n      promise.resolve(Object.freeze(requestList))\n    })\n\n    return promise.promise\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm\n   * @param {CacheBatchOperation[]} operations\n   * @returns {requestResponseList}\n   */\n  #batchCacheOperations (operations) {\n    // 1.\n    const cache = this.#relevantRequestResponseList\n\n    // 2.\n    const backupCache = [...cache]\n\n    // 3.\n    const addedItems = []\n\n    // 4.1\n    const resultList = []\n\n    try {\n      // 4.2\n      for (const operation of operations) {\n        // 4.2.1\n        if (operation.type !== 'delete' && operation.type !== 'put') {\n          throw webidl.errors.exception({\n            header: 'Cache.#batchCacheOperations',\n            message: 'operation type does not match \"delete\" or \"put\"'\n          })\n        }\n\n        // 4.2.2\n        if (operation.type === 'delete' && operation.response != null) {\n          throw webidl.errors.exception({\n            header: 'Cache.#batchCacheOperations',\n            message: 'delete operation should not have an associated response'\n          })\n        }\n\n        // 4.2.3\n        if (this.#queryCache(operation.request, operation.options, addedItems).length) {\n          throw new DOMException('???', 'InvalidStateError')\n        }\n\n        // 4.2.4\n        let requestResponses\n\n        // 4.2.5\n        if (operation.type === 'delete') {\n          // 4.2.5.1\n          requestResponses = this.#queryCache(operation.request, operation.options)\n\n          // TODO: the spec is wrong, this is needed to pass WPTs\n          if (requestResponses.length === 0) {\n            return []\n          }\n\n          // 4.2.5.2\n          for (const requestResponse of requestResponses) {\n            const idx = cache.indexOf(requestResponse)\n            assert(idx !== -1)\n\n            // 4.2.5.2.1\n            cache.splice(idx, 1)\n          }\n        } else if (operation.type === 'put') { // 4.2.6\n          // 4.2.6.1\n          if (operation.response == null) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'put operation should have an associated response'\n            })\n          }\n\n          // 4.2.6.2\n          const r = operation.request\n\n          // 4.2.6.3\n          if (!urlIsHttpHttpsScheme(r.url)) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'expected http or https scheme'\n            })\n          }\n\n          // 4.2.6.4\n          if (r.method !== 'GET') {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'not get method'\n            })\n          }\n\n          // 4.2.6.5\n          if (operation.options != null) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'options must not be defined'\n            })\n          }\n\n          // 4.2.6.6\n          requestResponses = this.#queryCache(operation.request)\n\n          // 4.2.6.7\n          for (const requestResponse of requestResponses) {\n            const idx = cache.indexOf(requestResponse)\n            assert(idx !== -1)\n\n            // 4.2.6.7.1\n            cache.splice(idx, 1)\n          }\n\n          // 4.2.6.8\n          cache.push([operation.request, operation.response])\n\n          // 4.2.6.10\n          addedItems.push([operation.request, operation.response])\n        }\n\n        // 4.2.7\n        resultList.push([operation.request, operation.response])\n      }\n\n      // 4.3\n      return resultList\n    } catch (e) { // 5.\n      // 5.1\n      this.#relevantRequestResponseList.length = 0\n\n      // 5.2\n      this.#relevantRequestResponseList = backupCache\n\n      // 5.3\n      throw e\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#query-cache\n   * @param {any} requestQuery\n   * @param {import('../../types/cache').CacheQueryOptions} options\n   * @param {requestResponseList} targetStorage\n   * @returns {requestResponseList}\n   */\n  #queryCache (requestQuery, options, targetStorage) {\n    /** @type {requestResponseList} */\n    const resultList = []\n\n    const storage = targetStorage ?? this.#relevantRequestResponseList\n\n    for (const requestResponse of storage) {\n      const [cachedRequest, cachedResponse] = requestResponse\n      if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {\n        resultList.push(requestResponse)\n      }\n    }\n\n    return resultList\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm\n   * @param {any} requestQuery\n   * @param {any} request\n   * @param {any | null} response\n   * @param {import('../../types/cache').CacheQueryOptions | undefined} options\n   * @returns {boolean}\n   */\n  #requestMatchesCachedItem (requestQuery, request, response = null, options) {\n    // if (options?.ignoreMethod === false && request.method === 'GET') {\n    //   return false\n    // }\n\n    const queryURL = new URL(requestQuery.url)\n\n    const cachedURL = new URL(request.url)\n\n    if (options?.ignoreSearch) {\n      cachedURL.search = ''\n\n      queryURL.search = ''\n    }\n\n    if (!urlEquals(queryURL, cachedURL, true)) {\n      return false\n    }\n\n    if (\n      response == null ||\n      options?.ignoreVary ||\n      !response.headersList.contains('vary')\n    ) {\n      return true\n    }\n\n    const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n    for (const fieldValue of fieldValues) {\n      if (fieldValue === '*') {\n        return false\n      }\n\n      const requestValue = request.headersList.get(fieldValue)\n      const queryValue = requestQuery.headersList.get(fieldValue)\n\n      // If one has the header and the other doesn't, or one has\n      // a different value than the other, return false\n      if (requestValue !== queryValue) {\n        return false\n      }\n    }\n\n    return true\n  }\n\n  #internalMatchAll (request, options, maxResponses = Infinity) {\n    // 1.\n    let r = null\n\n    // 2.\n    if (request !== undefined) {\n      if (request instanceof Request) {\n        // 2.1.1\n        r = request[kState]\n\n        // 2.1.2\n        if (r.method !== 'GET' && !options.ignoreMethod) {\n          return []\n        }\n      } else if (typeof request === 'string') {\n        // 2.2.1\n        r = new Request(request)[kState]\n      }\n    }\n\n    // 5.\n    // 5.1\n    const responses = []\n\n    // 5.2\n    if (request === undefined) {\n      // 5.2.1\n      for (const requestResponse of this.#relevantRequestResponseList) {\n        responses.push(requestResponse[1])\n      }\n    } else { // 5.3\n      // 5.3.1\n      const requestResponses = this.#queryCache(r, options)\n\n      // 5.3.2\n      for (const requestResponse of requestResponses) {\n        responses.push(requestResponse[1])\n      }\n    }\n\n    // 5.4\n    // We don't implement CORs so we don't need to loop over the responses, yay!\n\n    // 5.5.1\n    const responseList = []\n\n    // 5.5.2\n    for (const response of responses) {\n      // 5.5.2.1\n      const responseObject = fromInnerResponse(response, 'immutable')\n\n      responseList.push(responseObject.clone())\n\n      if (responseList.length >= maxResponses) {\n        break\n      }\n    }\n\n    // 6.\n    return Object.freeze(responseList)\n  }\n}\n\nObject.defineProperties(Cache.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'Cache',\n    configurable: true\n  },\n  match: kEnumerableProperty,\n  matchAll: kEnumerableProperty,\n  add: kEnumerableProperty,\n  addAll: kEnumerableProperty,\n  put: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  keys: kEnumerableProperty\n})\n\nconst cacheQueryOptionConverters = [\n  {\n    key: 'ignoreSearch',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'ignoreMethod',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'ignoreVary',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n]\n\nwebidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)\n\nwebidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([\n  ...cacheQueryOptionConverters,\n  {\n    key: 'cacheName',\n    converter: webidl.converters.DOMString\n  }\n])\n\nwebidl.converters.Response = webidl.interfaceConverter(Response)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.RequestInfo\n)\n\nmodule.exports = {\n  Cache\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { Cache } = require('./cache')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass CacheStorage {\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map\n   * @type {Map}\n   */\n  async has (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.has'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    // 2.1.1\n    // 2.2\n    return this.#caches.has(cacheName)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open\n   * @param {string} cacheName\n   * @returns {Promise}\n   */\n  async open (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.open'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    // 2.1\n    if (this.#caches.has(cacheName)) {\n      // await caches.open('v1') !== await caches.open('v1')\n\n      // 2.1.1\n      const cache = this.#caches.get(cacheName)\n\n      // 2.1.1.1\n      return new Cache(kConstruct, cache)\n    }\n\n    // 2.2\n    const cache = []\n\n    // 2.3\n    this.#caches.set(cacheName, cache)\n\n    // 2.4\n    return new Cache(kConstruct, cache)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete\n   * @param {string} cacheName\n   * @returns {Promise}\n   */\n  async delete (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    return this.#caches.delete(cacheName)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys\n   * @returns {Promise}\n   */\n  async keys () {\n    webidl.brandCheck(this, CacheStorage)\n\n    // 2.1\n    const keys = this.#caches.keys()\n\n    // 2.2\n    return [...keys]\n  }\n}\n\nObject.defineProperties(CacheStorage.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'CacheStorage',\n    configurable: true\n  },\n  match: kEnumerableProperty,\n  has: kEnumerableProperty,\n  open: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  keys: kEnumerableProperty\n})\n\nmodule.exports = {\n  CacheStorage\n}\n","'use strict'\n\nmodule.exports = {\n  kConstruct: require('../../core/symbols').kConstruct\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { isValidHeaderName } = require('../fetch/util')\n\n/**\n * @see https://url.spec.whatwg.org/#concept-url-equals\n * @param {URL} A\n * @param {URL} B\n * @param {boolean | undefined} excludeFragment\n * @returns {boolean}\n */\nfunction urlEquals (A, B, excludeFragment = false) {\n  const serializedA = URLSerializer(A, excludeFragment)\n\n  const serializedB = URLSerializer(B, excludeFragment)\n\n  return serializedA === serializedB\n}\n\n/**\n * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262\n * @param {string} header\n */\nfunction getFieldValues (header) {\n  assert(header !== null)\n\n  const values = []\n\n  for (let value of header.split(',')) {\n    value = value.trim()\n\n    if (isValidHeaderName(value)) {\n      values.push(value)\n    }\n  }\n\n  return values\n}\n\nmodule.exports = {\n  urlEquals,\n  getFieldValues\n}\n","'use strict'\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size\nconst maxAttributeValueSize = 1024\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size\nconst maxNameValuePairSize = 4096\n\nmodule.exports = {\n  maxAttributeValueSize,\n  maxNameValuePairSize\n}\n","'use strict'\n\nconst { parseSetCookie } = require('./parse')\nconst { stringify } = require('./util')\nconst { webidl } = require('../fetch/webidl')\nconst { Headers } = require('../fetch/headers')\n\n/**\n * @typedef {Object} Cookie\n * @property {string} name\n * @property {string} value\n * @property {Date|number|undefined} expires\n * @property {number|undefined} maxAge\n * @property {string|undefined} domain\n * @property {string|undefined} path\n * @property {boolean|undefined} secure\n * @property {boolean|undefined} httpOnly\n * @property {'Strict'|'Lax'|'None'} sameSite\n * @property {string[]} unparsed\n */\n\n/**\n * @param {Headers} headers\n * @returns {Record}\n */\nfunction getCookies (headers) {\n  webidl.argumentLengthCheck(arguments, 1, 'getCookies')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const cookie = headers.get('cookie')\n  const out = {}\n\n  if (!cookie) {\n    return out\n  }\n\n  for (const piece of cookie.split(';')) {\n    const [name, ...value] = piece.split('=')\n\n    out[name.trim()] = value.join('=')\n  }\n\n  return out\n}\n\n/**\n * @param {Headers} headers\n * @param {string} name\n * @param {{ path?: string, domain?: string }|undefined} attributes\n * @returns {void}\n */\nfunction deleteCookie (headers, name, attributes) {\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const prefix = 'deleteCookie'\n  webidl.argumentLengthCheck(arguments, 2, prefix)\n\n  name = webidl.converters.DOMString(name, prefix, 'name')\n  attributes = webidl.converters.DeleteCookieAttributes(attributes)\n\n  // Matches behavior of\n  // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278\n  setCookie(headers, {\n    name,\n    value: '',\n    expires: new Date(0),\n    ...attributes\n  })\n}\n\n/**\n * @param {Headers} headers\n * @returns {Cookie[]}\n */\nfunction getSetCookies (headers) {\n  webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const cookies = headers.getSetCookie()\n\n  if (!cookies) {\n    return []\n  }\n\n  return cookies.map((pair) => parseSetCookie(pair))\n}\n\n/**\n * @param {Headers} headers\n * @param {Cookie} cookie\n * @returns {void}\n */\nfunction setCookie (headers, cookie) {\n  webidl.argumentLengthCheck(arguments, 2, 'setCookie')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  cookie = webidl.converters.Cookie(cookie)\n\n  const str = stringify(cookie)\n\n  if (str) {\n    headers.append('Set-Cookie', str)\n  }\n}\n\nwebidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'path',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'domain',\n    defaultValue: () => null\n  }\n])\n\nwebidl.converters.Cookie = webidl.dictionaryConverter([\n  {\n    converter: webidl.converters.DOMString,\n    key: 'name'\n  },\n  {\n    converter: webidl.converters.DOMString,\n    key: 'value'\n  },\n  {\n    converter: webidl.nullableConverter((value) => {\n      if (typeof value === 'number') {\n        return webidl.converters['unsigned long long'](value)\n      }\n\n      return new Date(value)\n    }),\n    key: 'expires',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters['long long']),\n    key: 'maxAge',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'domain',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'path',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.boolean),\n    key: 'secure',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.boolean),\n    key: 'httpOnly',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.converters.USVString,\n    key: 'sameSite',\n    allowedValues: ['Strict', 'Lax', 'None']\n  },\n  {\n    converter: webidl.sequenceConverter(webidl.converters.DOMString),\n    key: 'unparsed',\n    defaultValue: () => new Array(0)\n  }\n])\n\nmodule.exports = {\n  getCookies,\n  deleteCookie,\n  getSetCookies,\n  setCookie\n}\n","'use strict'\n\nconst { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')\nconst { isCTLExcludingHtab } = require('./util')\nconst { collectASequenceOfCodePointsFast } = require('../fetch/data-url')\nconst assert = require('node:assert')\n\n/**\n * @description Parses the field-value attributes of a set-cookie header string.\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} header\n * @returns if the header is invalid, null will be returned\n */\nfunction parseSetCookie (header) {\n  // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F\n  //    character (CTL characters excluding HTAB): Abort these steps and\n  //    ignore the set-cookie-string entirely.\n  if (isCTLExcludingHtab(header)) {\n    return null\n  }\n\n  let nameValuePair = ''\n  let unparsedAttributes = ''\n  let name = ''\n  let value = ''\n\n  // 2. If the set-cookie-string contains a %x3B (\";\") character:\n  if (header.includes(';')) {\n    // 1. The name-value-pair string consists of the characters up to,\n    //    but not including, the first %x3B (\";\"), and the unparsed-\n    //    attributes consist of the remainder of the set-cookie-string\n    //    (including the %x3B (\";\") in question).\n    const position = { position: 0 }\n\n    nameValuePair = collectASequenceOfCodePointsFast(';', header, position)\n    unparsedAttributes = header.slice(position.position)\n  } else {\n    // Otherwise:\n\n    // 1. The name-value-pair string consists of all the characters\n    //    contained in the set-cookie-string, and the unparsed-\n    //    attributes is the empty string.\n    nameValuePair = header\n  }\n\n  // 3. If the name-value-pair string lacks a %x3D (\"=\") character, then\n  //    the name string is empty, and the value string is the value of\n  //    name-value-pair.\n  if (!nameValuePair.includes('=')) {\n    value = nameValuePair\n  } else {\n    //    Otherwise, the name string consists of the characters up to, but\n    //    not including, the first %x3D (\"=\") character, and the (possibly\n    //    empty) value string consists of the characters after the first\n    //    %x3D (\"=\") character.\n    const position = { position: 0 }\n    name = collectASequenceOfCodePointsFast(\n      '=',\n      nameValuePair,\n      position\n    )\n    value = nameValuePair.slice(position.position + 1)\n  }\n\n  // 4. Remove any leading or trailing WSP characters from the name\n  //    string and the value string.\n  name = name.trim()\n  value = value.trim()\n\n  // 5. If the sum of the lengths of the name string and the value string\n  //    is more than 4096 octets, abort these steps and ignore the set-\n  //    cookie-string entirely.\n  if (name.length + value.length > maxNameValuePairSize) {\n    return null\n  }\n\n  // 6. The cookie-name is the name string, and the cookie-value is the\n  //    value string.\n  return {\n    name, value, ...parseUnparsedAttributes(unparsedAttributes)\n  }\n}\n\n/**\n * Parses the remaining attributes of a set-cookie header\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} unparsedAttributes\n * @param {[Object.]={}} cookieAttributeList\n */\nfunction parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {\n  // 1. If the unparsed-attributes string is empty, skip the rest of\n  //    these steps.\n  if (unparsedAttributes.length === 0) {\n    return cookieAttributeList\n  }\n\n  // 2. Discard the first character of the unparsed-attributes (which\n  //    will be a %x3B (\";\") character).\n  assert(unparsedAttributes[0] === ';')\n  unparsedAttributes = unparsedAttributes.slice(1)\n\n  let cookieAv = ''\n\n  // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n  //    character:\n  if (unparsedAttributes.includes(';')) {\n    // 1. Consume the characters of the unparsed-attributes up to, but\n    //    not including, the first %x3B (\";\") character.\n    cookieAv = collectASequenceOfCodePointsFast(\n      ';',\n      unparsedAttributes,\n      { position: 0 }\n    )\n    unparsedAttributes = unparsedAttributes.slice(cookieAv.length)\n  } else {\n    // Otherwise:\n\n    // 1. Consume the remainder of the unparsed-attributes.\n    cookieAv = unparsedAttributes\n    unparsedAttributes = ''\n  }\n\n  // Let the cookie-av string be the characters consumed in this step.\n\n  let attributeName = ''\n  let attributeValue = ''\n\n  // 4. If the cookie-av string contains a %x3D (\"=\") character:\n  if (cookieAv.includes('=')) {\n    // 1. The (possibly empty) attribute-name string consists of the\n    //    characters up to, but not including, the first %x3D (\"=\")\n    //    character, and the (possibly empty) attribute-value string\n    //    consists of the characters after the first %x3D (\"=\")\n    //    character.\n    const position = { position: 0 }\n\n    attributeName = collectASequenceOfCodePointsFast(\n      '=',\n      cookieAv,\n      position\n    )\n    attributeValue = cookieAv.slice(position.position + 1)\n  } else {\n    // Otherwise:\n\n    // 1. The attribute-name string consists of the entire cookie-av\n    //    string, and the attribute-value string is empty.\n    attributeName = cookieAv\n  }\n\n  // 5. Remove any leading or trailing WSP characters from the attribute-\n  //    name string and the attribute-value string.\n  attributeName = attributeName.trim()\n  attributeValue = attributeValue.trim()\n\n  // 6. If the attribute-value is longer than 1024 octets, ignore the\n  //    cookie-av string and return to Step 1 of this algorithm.\n  if (attributeValue.length > maxAttributeValueSize) {\n    return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n  }\n\n  // 7. Process the attribute-name and attribute-value according to the\n  //    requirements in the following subsections.  (Notice that\n  //    attributes with unrecognized attribute-names are ignored.)\n  const attributeNameLowercase = attributeName.toLowerCase()\n\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1\n  // If the attribute-name case-insensitively matches the string\n  // \"Expires\", the user agent MUST process the cookie-av as follows.\n  if (attributeNameLowercase === 'expires') {\n    // 1. Let the expiry-time be the result of parsing the attribute-value\n    //    as cookie-date (see Section 5.1.1).\n    const expiryTime = new Date(attributeValue)\n\n    // 2. If the attribute-value failed to parse as a cookie date, ignore\n    //    the cookie-av.\n\n    cookieAttributeList.expires = expiryTime\n  } else if (attributeNameLowercase === 'max-age') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2\n    // If the attribute-name case-insensitively matches the string \"Max-\n    // Age\", the user agent MUST process the cookie-av as follows.\n\n    // 1. If the first character of the attribute-value is not a DIGIT or a\n    //    \"-\" character, ignore the cookie-av.\n    const charCode = attributeValue.charCodeAt(0)\n\n    if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {\n      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n    }\n\n    // 2. If the remainder of attribute-value contains a non-DIGIT\n    //    character, ignore the cookie-av.\n    if (!/^\\d+$/.test(attributeValue)) {\n      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n    }\n\n    // 3. Let delta-seconds be the attribute-value converted to an integer.\n    const deltaSeconds = Number(attributeValue)\n\n    // 4. Let cookie-age-limit be the maximum age of the cookie (which\n    //    SHOULD be 400 days or less, see Section 4.1.2.2).\n\n    // 5. Set delta-seconds to the smaller of its present value and cookie-\n    //    age-limit.\n    // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)\n\n    // 6. If delta-seconds is less than or equal to zero (0), let expiry-\n    //    time be the earliest representable date and time.  Otherwise, let\n    //    the expiry-time be the current date and time plus delta-seconds\n    //    seconds.\n    // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds\n\n    // 7. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Max-Age and an attribute-value of expiry-time.\n    cookieAttributeList.maxAge = deltaSeconds\n  } else if (attributeNameLowercase === 'domain') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3\n    // If the attribute-name case-insensitively matches the string \"Domain\",\n    // the user agent MUST process the cookie-av as follows.\n\n    // 1. Let cookie-domain be the attribute-value.\n    let cookieDomain = attributeValue\n\n    // 2. If cookie-domain starts with %x2E (\".\"), let cookie-domain be\n    //    cookie-domain without its leading %x2E (\".\").\n    if (cookieDomain[0] === '.') {\n      cookieDomain = cookieDomain.slice(1)\n    }\n\n    // 3. Convert the cookie-domain to lower case.\n    cookieDomain = cookieDomain.toLowerCase()\n\n    // 4. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Domain and an attribute-value of cookie-domain.\n    cookieAttributeList.domain = cookieDomain\n  } else if (attributeNameLowercase === 'path') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4\n    // If the attribute-name case-insensitively matches the string \"Path\",\n    // the user agent MUST process the cookie-av as follows.\n\n    // 1. If the attribute-value is empty or if the first character of the\n    //    attribute-value is not %x2F (\"/\"):\n    let cookiePath = ''\n    if (attributeValue.length === 0 || attributeValue[0] !== '/') {\n      // 1. Let cookie-path be the default-path.\n      cookiePath = '/'\n    } else {\n      // Otherwise:\n\n      // 1. Let cookie-path be the attribute-value.\n      cookiePath = attributeValue\n    }\n\n    // 2. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Path and an attribute-value of cookie-path.\n    cookieAttributeList.path = cookiePath\n  } else if (attributeNameLowercase === 'secure') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5\n    // If the attribute-name case-insensitively matches the string \"Secure\",\n    // the user agent MUST append an attribute to the cookie-attribute-list\n    // with an attribute-name of Secure and an empty attribute-value.\n\n    cookieAttributeList.secure = true\n  } else if (attributeNameLowercase === 'httponly') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6\n    // If the attribute-name case-insensitively matches the string\n    // \"HttpOnly\", the user agent MUST append an attribute to the cookie-\n    // attribute-list with an attribute-name of HttpOnly and an empty\n    // attribute-value.\n\n    cookieAttributeList.httpOnly = true\n  } else if (attributeNameLowercase === 'samesite') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7\n    // If the attribute-name case-insensitively matches the string\n    // \"SameSite\", the user agent MUST process the cookie-av as follows:\n\n    const attributeValueLowercase = attributeValue.toLowerCase()\n\n    // 1. If cookie-av's attribute-value is a case-insensitive match for\n    //    \"None\", append an attribute to the cookie-attribute-list with an\n    //    attribute-name of \"SameSite\" and an attribute-value of \"None\".\n    if (attributeValueLowercase === 'none') {\n      cookieAttributeList.sameSite = 'None'\n    } else if (attributeValueLowercase === 'strict') {\n      // 2. If cookie-av's attribute-value is a case-insensitive match for\n      //    \"Strict\", append an attribute to the cookie-attribute-list with\n      //    an attribute-name of \"SameSite\" and an attribute-value of\n      //    \"Strict\".\n      cookieAttributeList.sameSite = 'Strict'\n    } else if (attributeValueLowercase === 'lax') {\n      // 3. If cookie-av's attribute-value is a case-insensitive match for\n      //    \"Lax\", append an attribute to the cookie-attribute-list with an\n      //    attribute-name of \"SameSite\" and an attribute-value of \"Lax\".\n      cookieAttributeList.sameSite = 'Lax'\n    }\n  } else {\n    cookieAttributeList.unparsed ??= []\n\n    cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)\n  }\n\n  // 8. Return to Step 1 of this algorithm.\n  return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n}\n\nmodule.exports = {\n  parseSetCookie,\n  parseUnparsedAttributes\n}\n","'use strict'\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction isCTLExcludingHtab (value) {\n  for (let i = 0; i < value.length; ++i) {\n    const code = value.charCodeAt(i)\n\n    if (\n      (code >= 0x00 && code <= 0x08) ||\n      (code >= 0x0A && code <= 0x1F) ||\n      code === 0x7F\n    ) {\n      return true\n    }\n  }\n  return false\n}\n\n/**\n CHAR           = \n token          = 1*\n separators     = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n                | \",\" | \";\" | \":\" | \"\\\" | <\">\n                | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n                | \"{\" | \"}\" | SP | HT\n * @param {string} name\n */\nfunction validateCookieName (name) {\n  for (let i = 0; i < name.length; ++i) {\n    const code = name.charCodeAt(i)\n\n    if (\n      code < 0x21 || // exclude CTLs (0-31), SP and HT\n      code > 0x7E || // exclude non-ascii and DEL\n      code === 0x22 || // \"\n      code === 0x28 || // (\n      code === 0x29 || // )\n      code === 0x3C || // <\n      code === 0x3E || // >\n      code === 0x40 || // @\n      code === 0x2C || // ,\n      code === 0x3B || // ;\n      code === 0x3A || // :\n      code === 0x5C || // \\\n      code === 0x2F || // /\n      code === 0x5B || // [\n      code === 0x5D || // ]\n      code === 0x3F || // ?\n      code === 0x3D || // =\n      code === 0x7B || // {\n      code === 0x7D // }\n    ) {\n      throw new Error('Invalid cookie name')\n    }\n  }\n}\n\n/**\n cookie-value      = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n cookie-octet      = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n                       ; US-ASCII characters excluding CTLs,\n                       ; whitespace DQUOTE, comma, semicolon,\n                       ; and backslash\n * @param {string} value\n */\nfunction validateCookieValue (value) {\n  let len = value.length\n  let i = 0\n\n  // if the value is wrapped in DQUOTE\n  if (value[0] === '\"') {\n    if (len === 1 || value[len - 1] !== '\"') {\n      throw new Error('Invalid cookie value')\n    }\n    --len\n    ++i\n  }\n\n  while (i < len) {\n    const code = value.charCodeAt(i++)\n\n    if (\n      code < 0x21 || // exclude CTLs (0-31)\n      code > 0x7E || // non-ascii and DEL (127)\n      code === 0x22 || // \"\n      code === 0x2C || // ,\n      code === 0x3B || // ;\n      code === 0x5C // \\\n    ) {\n      throw new Error('Invalid cookie value')\n    }\n  }\n}\n\n/**\n * path-value        = \n * @param {string} path\n */\nfunction validateCookiePath (path) {\n  for (let i = 0; i < path.length; ++i) {\n    const code = path.charCodeAt(i)\n\n    if (\n      code < 0x20 || // exclude CTLs (0-31)\n      code === 0x7F || // DEL\n      code === 0x3B // ;\n    ) {\n      throw new Error('Invalid cookie path')\n    }\n  }\n}\n\n/**\n * I have no idea why these values aren't allowed to be honest,\n * but Deno tests these. - Khafra\n * @param {string} domain\n */\nfunction validateCookieDomain (domain) {\n  if (\n    domain.startsWith('-') ||\n    domain.endsWith('.') ||\n    domain.endsWith('-')\n  ) {\n    throw new Error('Invalid cookie domain')\n  }\n}\n\nconst IMFDays = [\n  'Sun', 'Mon', 'Tue', 'Wed',\n  'Thu', 'Fri', 'Sat'\n]\n\nconst IMFMonths = [\n  'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n]\n\nconst IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1\n * @param {number|Date} date\n  IMF-fixdate  = day-name \",\" SP date1 SP time-of-day SP GMT\n  ; fixed length/zone/capitalization subset of the format\n  ; see Section 3.3 of [RFC5322]\n\n  day-name     = %x4D.6F.6E ; \"Mon\", case-sensitive\n              / %x54.75.65 ; \"Tue\", case-sensitive\n              / %x57.65.64 ; \"Wed\", case-sensitive\n              / %x54.68.75 ; \"Thu\", case-sensitive\n              / %x46.72.69 ; \"Fri\", case-sensitive\n              / %x53.61.74 ; \"Sat\", case-sensitive\n              / %x53.75.6E ; \"Sun\", case-sensitive\n  date1        = day SP month SP year\n                  ; e.g., 02 Jun 1982\n\n  day          = 2DIGIT\n  month        = %x4A.61.6E ; \"Jan\", case-sensitive\n              / %x46.65.62 ; \"Feb\", case-sensitive\n              / %x4D.61.72 ; \"Mar\", case-sensitive\n              / %x41.70.72 ; \"Apr\", case-sensitive\n              / %x4D.61.79 ; \"May\", case-sensitive\n              / %x4A.75.6E ; \"Jun\", case-sensitive\n              / %x4A.75.6C ; \"Jul\", case-sensitive\n              / %x41.75.67 ; \"Aug\", case-sensitive\n              / %x53.65.70 ; \"Sep\", case-sensitive\n              / %x4F.63.74 ; \"Oct\", case-sensitive\n              / %x4E.6F.76 ; \"Nov\", case-sensitive\n              / %x44.65.63 ; \"Dec\", case-sensitive\n  year         = 4DIGIT\n\n  GMT          = %x47.4D.54 ; \"GMT\", case-sensitive\n\n  time-of-day  = hour \":\" minute \":\" second\n              ; 00:00:00 - 23:59:60 (leap second)\n\n  hour         = 2DIGIT\n  minute       = 2DIGIT\n  second       = 2DIGIT\n */\nfunction toIMFDate (date) {\n  if (typeof date === 'number') {\n    date = new Date(date)\n  }\n\n  return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`\n}\n\n/**\n max-age-av        = \"Max-Age=\" non-zero-digit *DIGIT\n                       ; In practice, both expires-av and max-age-av\n                       ; are limited to dates representable by the\n                       ; user agent.\n * @param {number} maxAge\n */\nfunction validateCookieMaxAge (maxAge) {\n  if (maxAge < 0) {\n    throw new Error('Invalid cookie max-age')\n  }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1\n * @param {import('./index').Cookie} cookie\n */\nfunction stringify (cookie) {\n  if (cookie.name.length === 0) {\n    return null\n  }\n\n  validateCookieName(cookie.name)\n  validateCookieValue(cookie.value)\n\n  const out = [`${cookie.name}=${cookie.value}`]\n\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2\n  if (cookie.name.startsWith('__Secure-')) {\n    cookie.secure = true\n  }\n\n  if (cookie.name.startsWith('__Host-')) {\n    cookie.secure = true\n    cookie.domain = null\n    cookie.path = '/'\n  }\n\n  if (cookie.secure) {\n    out.push('Secure')\n  }\n\n  if (cookie.httpOnly) {\n    out.push('HttpOnly')\n  }\n\n  if (typeof cookie.maxAge === 'number') {\n    validateCookieMaxAge(cookie.maxAge)\n    out.push(`Max-Age=${cookie.maxAge}`)\n  }\n\n  if (cookie.domain) {\n    validateCookieDomain(cookie.domain)\n    out.push(`Domain=${cookie.domain}`)\n  }\n\n  if (cookie.path) {\n    validateCookiePath(cookie.path)\n    out.push(`Path=${cookie.path}`)\n  }\n\n  if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {\n    out.push(`Expires=${toIMFDate(cookie.expires)}`)\n  }\n\n  if (cookie.sameSite) {\n    out.push(`SameSite=${cookie.sameSite}`)\n  }\n\n  for (const part of cookie.unparsed) {\n    if (!part.includes('=')) {\n      throw new Error('Invalid unparsed')\n    }\n\n    const [key, ...value] = part.split('=')\n\n    out.push(`${key.trim()}=${value.join('=')}`)\n  }\n\n  return out.join('; ')\n}\n\nmodule.exports = {\n  isCTLExcludingHtab,\n  validateCookieName,\n  validateCookiePath,\n  validateCookieValue,\n  toIMFDate,\n  stringify\n}\n","'use strict'\nconst { Transform } = require('node:stream')\nconst { isASCIINumber, isValidLastEventId } = require('./util')\n\n/**\n * @type {number[]} BOM\n */\nconst BOM = [0xEF, 0xBB, 0xBF]\n/**\n * @type {10} LF\n */\nconst LF = 0x0A\n/**\n * @type {13} CR\n */\nconst CR = 0x0D\n/**\n * @type {58} COLON\n */\nconst COLON = 0x3A\n/**\n * @type {32} SPACE\n */\nconst SPACE = 0x20\n\n/**\n * @typedef {object} EventSourceStreamEvent\n * @type {object}\n * @property {string} [event] The event type.\n * @property {string} [data] The data of the message.\n * @property {string} [id] A unique ID for the event.\n * @property {string} [retry] The reconnection time, in milliseconds.\n */\n\n/**\n * @typedef eventSourceSettings\n * @type {object}\n * @property {string} lastEventId The last event ID received from the server.\n * @property {string} origin The origin of the event source.\n * @property {number} reconnectionTime The reconnection time, in milliseconds.\n */\n\nclass EventSourceStream extends Transform {\n  /**\n   * @type {eventSourceSettings}\n   */\n  state = null\n\n  /**\n   * Leading byte-order-mark check.\n   * @type {boolean}\n   */\n  checkBOM = true\n\n  /**\n   * @type {boolean}\n   */\n  crlfCheck = false\n\n  /**\n   * @type {boolean}\n   */\n  eventEndCheck = false\n\n  /**\n   * @type {Buffer}\n   */\n  buffer = null\n\n  pos = 0\n\n  event = {\n    data: undefined,\n    event: undefined,\n    id: undefined,\n    retry: undefined\n  }\n\n  /**\n   * @param {object} options\n   * @param {eventSourceSettings} options.eventSourceSettings\n   * @param {Function} [options.push]\n   */\n  constructor (options = {}) {\n    // Enable object mode as EventSourceStream emits objects of shape\n    // EventSourceStreamEvent\n    options.readableObjectMode = true\n\n    super(options)\n\n    this.state = options.eventSourceSettings || {}\n    if (options.push) {\n      this.push = options.push\n    }\n  }\n\n  /**\n   * @param {Buffer} chunk\n   * @param {string} _encoding\n   * @param {Function} callback\n   * @returns {void}\n   */\n  _transform (chunk, _encoding, callback) {\n    if (chunk.length === 0) {\n      callback()\n      return\n    }\n\n    // Cache the chunk in the buffer, as the data might not be complete while\n    // processing it\n    // TODO: Investigate if there is a more performant way to handle\n    // incoming chunks\n    // see: https://github.com/nodejs/undici/issues/2630\n    if (this.buffer) {\n      this.buffer = Buffer.concat([this.buffer, chunk])\n    } else {\n      this.buffer = chunk\n    }\n\n    // Strip leading byte-order-mark if we opened the stream and started\n    // the processing of the incoming data\n    if (this.checkBOM) {\n      switch (this.buffer.length) {\n        case 1:\n          // Check if the first byte is the same as the first byte of the BOM\n          if (this.buffer[0] === BOM[0]) {\n            // If it is, we need to wait for more data\n            callback()\n            return\n          }\n          // Set the checkBOM flag to false as we don't need to check for the\n          // BOM anymore\n          this.checkBOM = false\n\n          // The buffer only contains one byte so we need to wait for more data\n          callback()\n          return\n        case 2:\n          // Check if the first two bytes are the same as the first two bytes\n          // of the BOM\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1]\n          ) {\n            // If it is, we need to wait for more data, because the third byte\n            // is needed to determine if it is the BOM or not\n            callback()\n            return\n          }\n\n          // Set the checkBOM flag to false as we don't need to check for the\n          // BOM anymore\n          this.checkBOM = false\n          break\n        case 3:\n          // Check if the first three bytes are the same as the first three\n          // bytes of the BOM\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1] &&\n            this.buffer[2] === BOM[2]\n          ) {\n            // If it is, we can drop the buffered data, as it is only the BOM\n            this.buffer = Buffer.alloc(0)\n            // Set the checkBOM flag to false as we don't need to check for the\n            // BOM anymore\n            this.checkBOM = false\n\n            // Await more data\n            callback()\n            return\n          }\n          // If it is not the BOM, we can start processing the data\n          this.checkBOM = false\n          break\n        default:\n          // The buffer is longer than 3 bytes, so we can drop the BOM if it is\n          // present\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1] &&\n            this.buffer[2] === BOM[2]\n          ) {\n            // Remove the BOM from the buffer\n            this.buffer = this.buffer.subarray(3)\n          }\n\n          // Set the checkBOM flag to false as we don't need to check for the\n          this.checkBOM = false\n          break\n      }\n    }\n\n    while (this.pos < this.buffer.length) {\n      // If the previous line ended with an end-of-line, we need to check\n      // if the next character is also an end-of-line.\n      if (this.eventEndCheck) {\n        // If the the current character is an end-of-line, then the event\n        // is finished and we can process it\n\n        // If the previous line ended with a carriage return, we need to\n        // check if the current character is a line feed and remove it\n        // from the buffer.\n        if (this.crlfCheck) {\n          // If the current character is a line feed, we can remove it\n          // from the buffer and reset the crlfCheck flag\n          if (this.buffer[this.pos] === LF) {\n            this.buffer = this.buffer.subarray(this.pos + 1)\n            this.pos = 0\n            this.crlfCheck = false\n\n            // It is possible that the line feed is not the end of the\n            // event. We need to check if the next character is an\n            // end-of-line character to determine if the event is\n            // finished. We simply continue the loop to check the next\n            // character.\n\n            // As we removed the line feed from the buffer and set the\n            // crlfCheck flag to false, we basically don't make any\n            // distinction between a line feed and a carriage return.\n            continue\n          }\n          this.crlfCheck = false\n        }\n\n        if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n          // If the current character is a carriage return, we need to\n          // set the crlfCheck flag to true, as we need to check if the\n          // next character is a line feed so we can remove it from the\n          // buffer\n          if (this.buffer[this.pos] === CR) {\n            this.crlfCheck = true\n          }\n\n          this.buffer = this.buffer.subarray(this.pos + 1)\n          this.pos = 0\n          if (\n            this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {\n            this.processEvent(this.event)\n          }\n          this.clearEvent()\n          continue\n        }\n        // If the current character is not an end-of-line, then the event\n        // is not finished and we have to reset the eventEndCheck flag\n        this.eventEndCheck = false\n        continue\n      }\n\n      // If the current character is an end-of-line, we can process the\n      // line\n      if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n        // If the current character is a carriage return, we need to\n        // set the crlfCheck flag to true, as we need to check if the\n        // next character is a line feed\n        if (this.buffer[this.pos] === CR) {\n          this.crlfCheck = true\n        }\n\n        // In any case, we can process the line as we reached an\n        // end-of-line character\n        this.parseLine(this.buffer.subarray(0, this.pos), this.event)\n\n        // Remove the processed line from the buffer\n        this.buffer = this.buffer.subarray(this.pos + 1)\n        // Reset the position as we removed the processed line from the buffer\n        this.pos = 0\n        // A line was processed and this could be the end of the event. We need\n        // to check if the next line is empty to determine if the event is\n        // finished.\n        this.eventEndCheck = true\n        continue\n      }\n\n      this.pos++\n    }\n\n    callback()\n  }\n\n  /**\n   * @param {Buffer} line\n   * @param {EventStreamEvent} event\n   */\n  parseLine (line, event) {\n    // If the line is empty (a blank line)\n    // Dispatch the event, as defined below.\n    // This will be handled in the _transform method\n    if (line.length === 0) {\n      return\n    }\n\n    // If the line starts with a U+003A COLON character (:)\n    // Ignore the line.\n    const colonPosition = line.indexOf(COLON)\n    if (colonPosition === 0) {\n      return\n    }\n\n    let field = ''\n    let value = ''\n\n    // If the line contains a U+003A COLON character (:)\n    if (colonPosition !== -1) {\n      // Collect the characters on the line before the first U+003A COLON\n      // character (:), and let field be that string.\n      // TODO: Investigate if there is a more performant way to extract the\n      // field\n      // see: https://github.com/nodejs/undici/issues/2630\n      field = line.subarray(0, colonPosition).toString('utf8')\n\n      // Collect the characters on the line after the first U+003A COLON\n      // character (:), and let value be that string.\n      // If value starts with a U+0020 SPACE character, remove it from value.\n      let valueStart = colonPosition + 1\n      if (line[valueStart] === SPACE) {\n        ++valueStart\n      }\n      // TODO: Investigate if there is a more performant way to extract the\n      // value\n      // see: https://github.com/nodejs/undici/issues/2630\n      value = line.subarray(valueStart).toString('utf8')\n\n      // Otherwise, the string is not empty but does not contain a U+003A COLON\n      // character (:)\n    } else {\n      // Process the field using the steps described below, using the whole\n      // line as the field name, and the empty string as the field value.\n      field = line.toString('utf8')\n      value = ''\n    }\n\n    // Modify the event with the field name and value. The value is also\n    // decoded as UTF-8\n    switch (field) {\n      case 'data':\n        if (event[field] === undefined) {\n          event[field] = value\n        } else {\n          event[field] += `\\n${value}`\n        }\n        break\n      case 'retry':\n        if (isASCIINumber(value)) {\n          event[field] = value\n        }\n        break\n      case 'id':\n        if (isValidLastEventId(value)) {\n          event[field] = value\n        }\n        break\n      case 'event':\n        if (value.length > 0) {\n          event[field] = value\n        }\n        break\n    }\n  }\n\n  /**\n   * @param {EventSourceStreamEvent} event\n   */\n  processEvent (event) {\n    if (event.retry && isASCIINumber(event.retry)) {\n      this.state.reconnectionTime = parseInt(event.retry, 10)\n    }\n\n    if (event.id && isValidLastEventId(event.id)) {\n      this.state.lastEventId = event.id\n    }\n\n    // only dispatch event, when data is provided\n    if (event.data !== undefined) {\n      this.push({\n        type: event.event || 'message',\n        options: {\n          data: event.data,\n          lastEventId: this.state.lastEventId,\n          origin: this.state.origin\n        }\n      })\n    }\n  }\n\n  clearEvent () {\n    this.event = {\n      data: undefined,\n      event: undefined,\n      id: undefined,\n      retry: undefined\n    }\n  }\n}\n\nmodule.exports = {\n  EventSourceStream\n}\n","'use strict'\n\nconst { pipeline } = require('node:stream')\nconst { fetching } = require('../fetch')\nconst { makeRequest } = require('../fetch/request')\nconst { webidl } = require('../fetch/webidl')\nconst { EventSourceStream } = require('./eventsource-stream')\nconst { parseMIMEType } = require('../fetch/data-url')\nconst { createFastMessageEvent } = require('../websocket/events')\nconst { isNetworkError } = require('../fetch/response')\nconst { delay } = require('./util')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { environmentSettingsObject } = require('../fetch/util')\n\nlet experimentalWarned = false\n\n/**\n * A reconnection time, in milliseconds. This must initially be an implementation-defined value,\n * probably in the region of a few seconds.\n *\n * In Comparison:\n * - Chrome uses 3000ms.\n * - Deno uses 5000ms.\n *\n * @type {3000}\n */\nconst defaultReconnectionTime = 3000\n\n/**\n * The readyState attribute represents the state of the connection.\n * @enum\n * @readonly\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev\n */\n\n/**\n * The connection has not yet been established, or it was closed and the user\n * agent is reconnecting.\n * @type {0}\n */\nconst CONNECTING = 0\n\n/**\n * The user agent has an open connection and is dispatching events as it\n * receives them.\n * @type {1}\n */\nconst OPEN = 1\n\n/**\n * The connection is not open, and the user agent is not trying to reconnect.\n * @type {2}\n */\nconst CLOSED = 2\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"same-origin\".\n * @type {'anonymous'}\n */\nconst ANONYMOUS = 'anonymous'\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"include\".\n * @type {'use-credentials'}\n */\nconst USE_CREDENTIALS = 'use-credentials'\n\n/**\n * The EventSource interface is used to receive server-sent events. It\n * connects to a server over HTTP and receives events in text/event-stream\n * format without closing the connection.\n * @extends {EventTarget}\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events\n * @api public\n */\nclass EventSource extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    message: null\n  }\n\n  #url = null\n  #withCredentials = false\n\n  #readyState = CONNECTING\n\n  #request = null\n  #controller = null\n\n  #dispatcher\n\n  /**\n   * @type {import('./eventsource-stream').eventSourceSettings}\n   */\n  #state\n\n  /**\n   * Creates a new EventSource object.\n   * @param {string} url\n   * @param {EventSourceInit} [eventSourceInitDict]\n   * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface\n   */\n  constructor (url, eventSourceInitDict = {}) {\n    // 1. Let ev be a new EventSource object.\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'EventSource constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    if (!experimentalWarned) {\n      experimentalWarned = true\n      process.emitWarning('EventSource is experimental, expect them to change at any time.', {\n        code: 'UNDICI-ES'\n      })\n    }\n\n    url = webidl.converters.USVString(url, prefix, 'url')\n    eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')\n\n    this.#dispatcher = eventSourceInitDict.dispatcher\n    this.#state = {\n      lastEventId: '',\n      reconnectionTime: defaultReconnectionTime\n    }\n\n    // 2. Let settings be ev's relevant settings object.\n    // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object\n    const settings = environmentSettingsObject\n\n    let urlRecord\n\n    try {\n      // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.\n      urlRecord = new URL(url, settings.settingsObject.baseUrl)\n      this.#state.origin = urlRecord.origin\n    } catch (e) {\n      // 4. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n      throw new DOMException(e, 'SyntaxError')\n    }\n\n    // 5. Set ev's url to urlRecord.\n    this.#url = urlRecord.href\n\n    // 6. Let corsAttributeState be Anonymous.\n    let corsAttributeState = ANONYMOUS\n\n    // 7. If the value of eventSourceInitDict's withCredentials member is true,\n    // then set corsAttributeState to Use Credentials and set ev's\n    // withCredentials attribute to true.\n    if (eventSourceInitDict.withCredentials) {\n      corsAttributeState = USE_CREDENTIALS\n      this.#withCredentials = true\n    }\n\n    // 8. Let request be the result of creating a potential-CORS request given\n    // urlRecord, the empty string, and corsAttributeState.\n    const initRequest = {\n      redirect: 'follow',\n      keepalive: true,\n      // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes\n      mode: 'cors',\n      credentials: corsAttributeState === 'anonymous'\n        ? 'same-origin'\n        : 'omit',\n      referrer: 'no-referrer'\n    }\n\n    // 9. Set request's client to settings.\n    initRequest.client = environmentSettingsObject.settingsObject\n\n    // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.\n    initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]]\n\n    // 11. Set request's cache mode to \"no-store\".\n    initRequest.cache = 'no-store'\n\n    // 12. Set request's initiator type to \"other\".\n    initRequest.initiator = 'other'\n\n    initRequest.urlList = [new URL(this.#url)]\n\n    // 13. Set ev's request to request.\n    this.#request = makeRequest(initRequest)\n\n    this.#connect()\n  }\n\n  /**\n   * Returns the state of this EventSource object's connection. It can have the\n   * values described below.\n   * @returns {0|1|2}\n   * @readonly\n   */\n  get readyState () {\n    return this.#readyState\n  }\n\n  /**\n   * Returns the URL providing the event stream.\n   * @readonly\n   * @returns {string}\n   */\n  get url () {\n    return this.#url\n  }\n\n  /**\n   * Returns a boolean indicating whether the EventSource object was\n   * instantiated with CORS credentials set (true), or not (false, the default).\n   */\n  get withCredentials () {\n    return this.#withCredentials\n  }\n\n  #connect () {\n    if (this.#readyState === CLOSED) return\n\n    this.#readyState = CONNECTING\n\n    const fetchParams = {\n      request: this.#request,\n      dispatcher: this.#dispatcher\n    }\n\n    // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.\n    const processEventSourceEndOfBody = (response) => {\n      if (isNetworkError(response)) {\n        this.dispatchEvent(new Event('error'))\n        this.close()\n      }\n\n      this.#reconnect()\n    }\n\n    // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...\n    fetchParams.processResponseEndOfBody = processEventSourceEndOfBody\n\n    // and processResponse set to the following steps given response res:\n    fetchParams.processResponse = (response) => {\n      // 1. If res is an aborted network error, then fail the connection.\n\n      if (isNetworkError(response)) {\n        // 1. When a user agent is to fail the connection, the user agent\n        // must queue a task which, if the readyState attribute is set to a\n        // value other than CLOSED, sets the readyState attribute to CLOSED\n        // and fires an event named error at the EventSource object. Once the\n        // user agent has failed the connection, it does not attempt to\n        // reconnect.\n        if (response.aborted) {\n          this.close()\n          this.dispatchEvent(new Event('error'))\n          return\n          // 2. Otherwise, if res is a network error, then reestablish the\n          // connection, unless the user agent knows that to be futile, in\n          // which case the user agent may fail the connection.\n        } else {\n          this.#reconnect()\n          return\n        }\n      }\n\n      // 3. Otherwise, if res's status is not 200, or if res's `Content-Type`\n      // is not `text/event-stream`, then fail the connection.\n      const contentType = response.headersList.get('content-type', true)\n      const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'\n      const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'\n      if (\n        response.status !== 200 ||\n        contentTypeValid === false\n      ) {\n        this.close()\n        this.dispatchEvent(new Event('error'))\n        return\n      }\n\n      // 4. Otherwise, announce the connection and interpret res's body\n      // line by line.\n\n      // When a user agent is to announce the connection, the user agent\n      // must queue a task which, if the readyState attribute is set to a\n      // value other than CLOSED, sets the readyState attribute to OPEN\n      // and fires an event named open at the EventSource object.\n      // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n      this.#readyState = OPEN\n      this.dispatchEvent(new Event('open'))\n\n      // If redirected to a different origin, set the origin to the new origin.\n      this.#state.origin = response.urlList[response.urlList.length - 1].origin\n\n      const eventSourceStream = new EventSourceStream({\n        eventSourceSettings: this.#state,\n        push: (event) => {\n          this.dispatchEvent(createFastMessageEvent(\n            event.type,\n            event.options\n          ))\n        }\n      })\n\n      pipeline(response.body.stream,\n        eventSourceStream,\n        (error) => {\n          if (\n            error?.aborted === false\n          ) {\n            this.close()\n            this.dispatchEvent(new Event('error'))\n          }\n        })\n    }\n\n    this.#controller = fetching(fetchParams)\n  }\n\n  /**\n   * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n   * @returns {Promise}\n   */\n  async #reconnect () {\n    // When a user agent is to reestablish the connection, the user agent must\n    // run the following steps. These steps are run in parallel, not as part of\n    // a task. (The tasks that it queues, of course, are run like normal tasks\n    // and not themselves in parallel.)\n\n    // 1. Queue a task to run the following steps:\n\n    //   1. If the readyState attribute is set to CLOSED, abort the task.\n    if (this.#readyState === CLOSED) return\n\n    //   2. Set the readyState attribute to CONNECTING.\n    this.#readyState = CONNECTING\n\n    //   3. Fire an event named error at the EventSource object.\n    this.dispatchEvent(new Event('error'))\n\n    // 2. Wait a delay equal to the reconnection time of the event source.\n    await delay(this.#state.reconnectionTime)\n\n    // 5. Queue a task to run the following steps:\n\n    //   1. If the EventSource object's readyState attribute is not set to\n    //      CONNECTING, then return.\n    if (this.#readyState !== CONNECTING) return\n\n    //   2. Let request be the EventSource object's request.\n    //   3. If the EventSource object's last event ID string is not the empty\n    //      string, then:\n    //      1. Let lastEventIDValue be the EventSource object's last event ID\n    //         string, encoded as UTF-8.\n    //      2. Set (`Last-Event-ID`, lastEventIDValue) in request's header\n    //         list.\n    if (this.#state.lastEventId.length) {\n      this.#request.headersList.set('last-event-id', this.#state.lastEventId, true)\n    }\n\n    //   4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.\n    this.#connect()\n  }\n\n  /**\n   * Closes the connection, if any, and sets the readyState attribute to\n   * CLOSED.\n   */\n  close () {\n    webidl.brandCheck(this, EventSource)\n\n    if (this.#readyState === CLOSED) return\n    this.#readyState = CLOSED\n    this.#controller.abort()\n    this.#request = null\n  }\n\n  get onopen () {\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.open = fn\n      this.addEventListener('open', fn)\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onmessage () {\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.message = fn\n      this.addEventListener('message', fn)\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get onerror () {\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this.#events.error = null\n    }\n  }\n}\n\nconst constantsPropertyDescriptors = {\n  CONNECTING: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: CONNECTING,\n    writable: false\n  },\n  OPEN: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: OPEN,\n    writable: false\n  },\n  CLOSED: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: CLOSED,\n    writable: false\n  }\n}\n\nObject.defineProperties(EventSource, constantsPropertyDescriptors)\nObject.defineProperties(EventSource.prototype, constantsPropertyDescriptors)\n\nObject.defineProperties(EventSource.prototype, {\n  close: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  url: kEnumerableProperty,\n  withCredentials: kEnumerableProperty\n})\n\nwebidl.converters.EventSourceInitDict = webidl.dictionaryConverter([\n  {\n    key: 'withCredentials',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'dispatcher', // undici only\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = {\n  EventSource,\n  defaultReconnectionTime\n}\n","'use strict'\n\n/**\n * Checks if the given value is a valid LastEventId.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isValidLastEventId (value) {\n  // LastEventId should not contain U+0000 NULL\n  return value.indexOf('\\u0000') === -1\n}\n\n/**\n * Checks if the given value is a base 10 digit.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isASCIINumber (value) {\n  if (value.length === 0) return false\n  for (let i = 0; i < value.length; i++) {\n    if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false\n  }\n  return true\n}\n\n// https://github.com/nodejs/undici/issues/2664\nfunction delay (ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms).unref()\n  })\n}\n\nmodule.exports = {\n  isValidLastEventId,\n  isASCIINumber,\n  delay\n}\n","'use strict'\n\nconst util = require('../../core/util')\nconst {\n  ReadableStreamFrom,\n  isBlobLike,\n  isReadableStreamLike,\n  readableStreamClose,\n  createDeferredPromise,\n  fullyReadBody,\n  extractMimeType,\n  utf8DecodeBytes\n} = require('./util')\nconst { FormData } = require('./formdata')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { Blob } = require('node:buffer')\nconst assert = require('node:assert')\nconst { isErrored, isDisturbed } = require('node:stream')\nconst { isArrayBuffer } = require('node:util/types')\nconst { serializeAMimeType } = require('./data-url')\nconst { multipartFormDataParser } = require('./formdata-parser')\nlet random\n\ntry {\n  const crypto = require('node:crypto')\n  random = (max) => crypto.randomInt(0, max)\n} catch {\n  random = (max) => Math.floor(Math.random(max))\n}\n\nconst textEncoder = new TextEncoder()\nfunction noop () {}\n\nconst hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0\nlet streamRegistry\n\nif (hasFinalizationRegistry) {\n  streamRegistry = new FinalizationRegistry((weakRef) => {\n    const stream = weakRef.deref()\n    if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {\n      stream.cancel('Response object has been garbage collected').catch(noop)\n    }\n  })\n}\n\n// https://fetch.spec.whatwg.org/#concept-bodyinit-extract\nfunction extractBody (object, keepalive = false) {\n  // 1. Let stream be null.\n  let stream = null\n\n  // 2. If object is a ReadableStream object, then set stream to object.\n  if (object instanceof ReadableStream) {\n    stream = object\n  } else if (isBlobLike(object)) {\n    // 3. Otherwise, if object is a Blob object, set stream to the\n    //    result of running object’s get stream.\n    stream = object.stream()\n  } else {\n    // 4. Otherwise, set stream to a new ReadableStream object, and set\n    //    up stream with byte reading support.\n    stream = new ReadableStream({\n      async pull (controller) {\n        const buffer = typeof source === 'string' ? textEncoder.encode(source) : source\n\n        if (buffer.byteLength) {\n          controller.enqueue(buffer)\n        }\n\n        queueMicrotask(() => readableStreamClose(controller))\n      },\n      start () {},\n      type: 'bytes'\n    })\n  }\n\n  // 5. Assert: stream is a ReadableStream object.\n  assert(isReadableStreamLike(stream))\n\n  // 6. Let action be null.\n  let action = null\n\n  // 7. Let source be null.\n  let source = null\n\n  // 8. Let length be null.\n  let length = null\n\n  // 9. Let type be null.\n  let type = null\n\n  // 10. Switch on object:\n  if (typeof object === 'string') {\n    // Set source to the UTF-8 encoding of object.\n    // Note: setting source to a Uint8Array here breaks some mocking assumptions.\n    source = object\n\n    // Set type to `text/plain;charset=UTF-8`.\n    type = 'text/plain;charset=UTF-8'\n  } else if (object instanceof URLSearchParams) {\n    // URLSearchParams\n\n    // spec says to run application/x-www-form-urlencoded on body.list\n    // this is implemented in Node.js as apart of an URLSearchParams instance toString method\n    // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490\n    // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100\n\n    // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.\n    source = object.toString()\n\n    // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.\n    type = 'application/x-www-form-urlencoded;charset=UTF-8'\n  } else if (isArrayBuffer(object)) {\n    // BufferSource/ArrayBuffer\n\n    // Set source to a copy of the bytes held by object.\n    source = new Uint8Array(object.slice())\n  } else if (ArrayBuffer.isView(object)) {\n    // BufferSource/ArrayBufferView\n\n    // Set source to a copy of the bytes held by object.\n    source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))\n  } else if (util.isFormDataLike(object)) {\n    const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`\n    const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n    /*! formdata-polyfill. MIT License. Jimmy Wärting  */\n    const escape = (str) =>\n      str.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n    const normalizeLinefeeds = (value) => value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n\n    // Set action to this step: run the multipart/form-data\n    // encoding algorithm, with object’s entry list and UTF-8.\n    // - This ensures that the body is immutable and can't be changed afterwords\n    // - That the content-length is calculated in advance.\n    // - And that all parts are pre-encoded and ready to be sent.\n\n    const blobParts = []\n    const rn = new Uint8Array([13, 10]) // '\\r\\n'\n    length = 0\n    let hasUnknownSizeValue = false\n\n    for (const [name, value] of object) {\n      if (typeof value === 'string') {\n        const chunk = textEncoder.encode(prefix +\n          `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`)\n        blobParts.push(chunk)\n        length += chunk.byteLength\n      } else {\n        const chunk = textEncoder.encode(`${prefix}; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          (value.name ? `; filename=\"${escape(value.name)}\"` : '') + '\\r\\n' +\n          `Content-Type: ${\n            value.type || 'application/octet-stream'\n          }\\r\\n\\r\\n`)\n        blobParts.push(chunk, value, rn)\n        if (typeof value.size === 'number') {\n          length += chunk.byteLength + value.size + rn.byteLength\n        } else {\n          hasUnknownSizeValue = true\n        }\n      }\n    }\n\n    // CRLF is appended to the body to function with legacy servers and match other implementations.\n    // https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030\n    // https://github.com/form-data/form-data/issues/63\n    const chunk = textEncoder.encode(`--${boundary}--\\r\\n`)\n    blobParts.push(chunk)\n    length += chunk.byteLength\n    if (hasUnknownSizeValue) {\n      length = null\n    }\n\n    // Set source to object.\n    source = object\n\n    action = async function * () {\n      for (const part of blobParts) {\n        if (part.stream) {\n          yield * part.stream()\n        } else {\n          yield part\n        }\n      }\n    }\n\n    // Set type to `multipart/form-data; boundary=`,\n    // followed by the multipart/form-data boundary string generated\n    // by the multipart/form-data encoding algorithm.\n    type = `multipart/form-data; boundary=${boundary}`\n  } else if (isBlobLike(object)) {\n    // Blob\n\n    // Set source to object.\n    source = object\n\n    // Set length to object’s size.\n    length = object.size\n\n    // If object’s type attribute is not the empty byte sequence, set\n    // type to its value.\n    if (object.type) {\n      type = object.type\n    }\n  } else if (typeof object[Symbol.asyncIterator] === 'function') {\n    // If keepalive is true, then throw a TypeError.\n    if (keepalive) {\n      throw new TypeError('keepalive')\n    }\n\n    // If object is disturbed or locked, then throw a TypeError.\n    if (util.isDisturbed(object) || object.locked) {\n      throw new TypeError(\n        'Response body object should not be disturbed or locked'\n      )\n    }\n\n    stream =\n      object instanceof ReadableStream ? object : ReadableStreamFrom(object)\n  }\n\n  // 11. If source is a byte sequence, then set action to a\n  // step that returns source and length to source’s length.\n  if (typeof source === 'string' || util.isBuffer(source)) {\n    length = Buffer.byteLength(source)\n  }\n\n  // 12. If action is non-null, then run these steps in in parallel:\n  if (action != null) {\n    // Run action.\n    let iterator\n    stream = new ReadableStream({\n      async start () {\n        iterator = action(object)[Symbol.asyncIterator]()\n      },\n      async pull (controller) {\n        const { value, done } = await iterator.next()\n        if (done) {\n          // When running action is done, close stream.\n          queueMicrotask(() => {\n            controller.close()\n            controller.byobRequest?.respond(0)\n          })\n        } else {\n          // Whenever one or more bytes are available and stream is not errored,\n          // enqueue a Uint8Array wrapping an ArrayBuffer containing the available\n          // bytes into stream.\n          if (!isErrored(stream)) {\n            const buffer = new Uint8Array(value)\n            if (buffer.byteLength) {\n              controller.enqueue(buffer)\n            }\n          }\n        }\n        return controller.desiredSize > 0\n      },\n      async cancel (reason) {\n        await iterator.return()\n      },\n      type: 'bytes'\n    })\n  }\n\n  // 13. Let body be a body whose stream is stream, source is source,\n  // and length is length.\n  const body = { stream, source, length }\n\n  // 14. Return (body, type).\n  return [body, type]\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit-safely-extract\nfunction safelyExtractBody (object, keepalive = false) {\n  // To safely extract a body and a `Content-Type` value from\n  // a byte sequence or BodyInit object object, run these steps:\n\n  // 1. If object is a ReadableStream object, then:\n  if (object instanceof ReadableStream) {\n    // Assert: object is neither disturbed nor locked.\n    // istanbul ignore next\n    assert(!util.isDisturbed(object), 'The body has already been consumed.')\n    // istanbul ignore next\n    assert(!object.locked, 'The stream is locked.')\n  }\n\n  // 2. Return the results of extracting object.\n  return extractBody(object, keepalive)\n}\n\nfunction cloneBody (instance, body) {\n  // To clone a body body, run these steps:\n\n  // https://fetch.spec.whatwg.org/#concept-body-clone\n\n  // 1. Let « out1, out2 » be the result of teeing body’s stream.\n  const [out1, out2] = body.stream.tee()\n\n  // 2. Set body’s stream to out1.\n  body.stream = out1\n\n  // 3. Return a body whose stream is out2 and other members are copied from body.\n  return {\n    stream: out2,\n    length: body.length,\n    source: body.source\n  }\n}\n\nfunction throwIfAborted (state) {\n  if (state.aborted) {\n    throw new DOMException('The operation was aborted.', 'AbortError')\n  }\n}\n\nfunction bodyMixinMethods (instance) {\n  const methods = {\n    blob () {\n      // The blob() method steps are to return the result of\n      // running consume body with this and the following step\n      // given a byte sequence bytes: return a Blob whose\n      // contents are bytes and whose type attribute is this’s\n      // MIME type.\n      return consumeBody(this, (bytes) => {\n        let mimeType = bodyMimeType(this)\n\n        if (mimeType === null) {\n          mimeType = ''\n        } else if (mimeType) {\n          mimeType = serializeAMimeType(mimeType)\n        }\n\n        // Return a Blob whose contents are bytes and type attribute\n        // is mimeType.\n        return new Blob([bytes], { type: mimeType })\n      }, instance)\n    },\n\n    arrayBuffer () {\n      // The arrayBuffer() method steps are to return the result\n      // of running consume body with this and the following step\n      // given a byte sequence bytes: return a new ArrayBuffer\n      // whose contents are bytes.\n      return consumeBody(this, (bytes) => {\n        return new Uint8Array(bytes).buffer\n      }, instance)\n    },\n\n    text () {\n      // The text() method steps are to return the result of running\n      // consume body with this and UTF-8 decode.\n      return consumeBody(this, utf8DecodeBytes, instance)\n    },\n\n    json () {\n      // The json() method steps are to return the result of running\n      // consume body with this and parse JSON from bytes.\n      return consumeBody(this, parseJSONFromBytes, instance)\n    },\n\n    formData () {\n      // The formData() method steps are to return the result of running\n      // consume body with this and the following step given a byte sequence bytes:\n      return consumeBody(this, (value) => {\n        // 1. Let mimeType be the result of get the MIME type with this.\n        const mimeType = bodyMimeType(this)\n\n        // 2. If mimeType is non-null, then switch on mimeType’s essence and run\n        //    the corresponding steps:\n        if (mimeType !== null) {\n          switch (mimeType.essence) {\n            case 'multipart/form-data': {\n              // 1. ... [long step]\n              const parsed = multipartFormDataParser(value, mimeType)\n\n              // 2. If that fails for some reason, then throw a TypeError.\n              if (parsed === 'failure') {\n                throw new TypeError('Failed to parse body as FormData.')\n              }\n\n              // 3. Return a new FormData object, appending each entry,\n              //    resulting from the parsing operation, to its entry list.\n              const fd = new FormData()\n              fd[kState] = parsed\n\n              return fd\n            }\n            case 'application/x-www-form-urlencoded': {\n              // 1. Let entries be the result of parsing bytes.\n              const entries = new URLSearchParams(value.toString())\n\n              // 2. If entries is failure, then throw a TypeError.\n\n              // 3. Return a new FormData object whose entry list is entries.\n              const fd = new FormData()\n\n              for (const [name, value] of entries) {\n                fd.append(name, value)\n              }\n\n              return fd\n            }\n          }\n        }\n\n        // 3. Throw a TypeError.\n        throw new TypeError(\n          'Content-Type was not one of \"multipart/form-data\" or \"application/x-www-form-urlencoded\".'\n        )\n      }, instance)\n    },\n\n    bytes () {\n      // The bytes() method steps are to return the result of running consume body\n      // with this and the following step given a byte sequence bytes: return the\n      // result of creating a Uint8Array from bytes in this’s relevant realm.\n      return consumeBody(this, (bytes) => {\n        return new Uint8Array(bytes)\n      }, instance)\n    }\n  }\n\n  return methods\n}\n\nfunction mixinBody (prototype) {\n  Object.assign(prototype.prototype, bodyMixinMethods(prototype))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-consume-body\n * @param {Response|Request} object\n * @param {(value: unknown) => unknown} convertBytesToJSValue\n * @param {Response|Request} instance\n */\nasync function consumeBody (object, convertBytesToJSValue, instance) {\n  webidl.brandCheck(object, instance)\n\n  // 1. If object is unusable, then return a promise rejected\n  //    with a TypeError.\n  if (bodyUnusable(object)) {\n    throw new TypeError('Body is unusable: Body has already been read')\n  }\n\n  throwIfAborted(object[kState])\n\n  // 2. Let promise be a new promise.\n  const promise = createDeferredPromise()\n\n  // 3. Let errorSteps given error be to reject promise with error.\n  const errorSteps = (error) => promise.reject(error)\n\n  // 4. Let successSteps given a byte sequence data be to resolve\n  //    promise with the result of running convertBytesToJSValue\n  //    with data. If that threw an exception, then run errorSteps\n  //    with that exception.\n  const successSteps = (data) => {\n    try {\n      promise.resolve(convertBytesToJSValue(data))\n    } catch (e) {\n      errorSteps(e)\n    }\n  }\n\n  // 5. If object’s body is null, then run successSteps with an\n  //    empty byte sequence.\n  if (object[kState].body == null) {\n    successSteps(Buffer.allocUnsafe(0))\n    return promise.promise\n  }\n\n  // 6. Otherwise, fully read object’s body given successSteps,\n  //    errorSteps, and object’s relevant global object.\n  await fullyReadBody(object[kState].body, successSteps, errorSteps)\n\n  // 7. Return promise.\n  return promise.promise\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction bodyUnusable (object) {\n  const body = object[kState].body\n\n  // An object including the Body interface mixin is\n  // said to be unusable if its body is non-null and\n  // its body’s stream is disturbed or locked.\n  return body != null && (body.stream.locked || util.isDisturbed(body.stream))\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value\n * @param {Uint8Array} bytes\n */\nfunction parseJSONFromBytes (bytes) {\n  return JSON.parse(utf8DecodeBytes(bytes))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-mime-type\n * @param {import('./response').Response|import('./request').Request} requestOrResponse\n */\nfunction bodyMimeType (requestOrResponse) {\n  // 1. Let headers be null.\n  // 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.\n  // 3. Otherwise, set headers to requestOrResponse’s response’s header list.\n  /** @type {import('./headers').HeadersList} */\n  const headers = requestOrResponse[kState].headersList\n\n  // 4. Let mimeType be the result of extracting a MIME type from headers.\n  const mimeType = extractMimeType(headers)\n\n  // 5. If mimeType is failure, then return null.\n  if (mimeType === 'failure') {\n    return null\n  }\n\n  // 6. Return mimeType.\n  return mimeType\n}\n\nmodule.exports = {\n  extractBody,\n  safelyExtractBody,\n  cloneBody,\n  mixinBody,\n  streamRegistry,\n  hasFinalizationRegistry,\n  bodyUnusable\n}\n","'use strict'\n\nconst corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])\n\nconst redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])\nconst redirectStatusSet = new Set(redirectStatus)\n\n/**\n * @see https://fetch.spec.whatwg.org/#block-bad-port\n */\nconst badPorts = /** @type {const} */ ([\n  '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n  '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n  '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n  '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n  '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',\n  '6697', '10080'\n])\nconst badPortsSet = new Set(badPorts)\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\n */\nconst referrerPolicy = /** @type {const} */ ([\n  '',\n  'no-referrer',\n  'no-referrer-when-downgrade',\n  'same-origin',\n  'origin',\n  'strict-origin',\n  'origin-when-cross-origin',\n  'strict-origin-when-cross-origin',\n  'unsafe-url'\n])\nconst referrerPolicySet = new Set(referrerPolicy)\n\nconst requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])\n\nconst safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])\n\nconst requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])\n\nconst requestCache = /** @type {const} */ ([\n  'default',\n  'no-store',\n  'reload',\n  'no-cache',\n  'force-cache',\n  'only-if-cached'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-body-header-name\n */\nconst requestBodyHeader = /** @type {const} */ ([\n  'content-encoding',\n  'content-language',\n  'content-location',\n  'content-type',\n  // See https://github.com/nodejs/undici/issues/2021\n  // 'Content-Length' is a forbidden header name, which is typically\n  // removed in the Headers implementation. However, undici doesn't\n  // filter out headers, so we add it here.\n  'content-length'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex\n */\nconst requestDuplex = /** @type {const} */ ([\n  'half'\n])\n\n/**\n * @see http://fetch.spec.whatwg.org/#forbidden-method\n */\nconst forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = /** @type {const} */ ([\n  'audio',\n  'audioworklet',\n  'font',\n  'image',\n  'manifest',\n  'paintworklet',\n  'script',\n  'style',\n  'track',\n  'video',\n  'xslt',\n  ''\n])\nconst subresourceSet = new Set(subresource)\n\nmodule.exports = {\n  subresource,\n  forbiddenMethods,\n  requestBodyHeader,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  redirectStatus,\n  corsSafeListedMethods,\n  nullBodyStatus,\n  safeMethods,\n  badPorts,\n  requestDuplex,\n  subresourceSet,\n  badPortsSet,\n  redirectStatusSet,\n  corsSafeListedMethodsSet,\n  safeMethodsSet,\n  forbiddenMethodsSet,\n  referrerPolicySet\n}\n","'use strict'\n\nconst assert = require('node:assert')\n\nconst encoder = new TextEncoder()\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-token-code-point\n */\nconst HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\\-.^_|~A-Za-z0-9]+$/\nconst HTTP_WHITESPACE_REGEX = /[\\u000A\\u000D\\u0009\\u0020]/ // eslint-disable-line\nconst ASCII_WHITESPACE_REPLACE_REGEX = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/g // eslint-disable-line\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point\n */\nconst HTTP_QUOTED_STRING_TOKENS = /^[\\u0009\\u0020-\\u007E\\u0080-\\u00FF]+$/ // eslint-disable-line\n\n// https://fetch.spec.whatwg.org/#data-url-processor\n/** @param {URL} dataURL */\nfunction dataURLProcessor (dataURL) {\n  // 1. Assert: dataURL’s scheme is \"data\".\n  assert(dataURL.protocol === 'data:')\n\n  // 2. Let input be the result of running the URL\n  // serializer on dataURL with exclude fragment\n  // set to true.\n  let input = URLSerializer(dataURL, true)\n\n  // 3. Remove the leading \"data:\" string from input.\n  input = input.slice(5)\n\n  // 4. Let position point at the start of input.\n  const position = { position: 0 }\n\n  // 5. Let mimeType be the result of collecting a\n  // sequence of code points that are not equal\n  // to U+002C (,), given position.\n  let mimeType = collectASequenceOfCodePointsFast(\n    ',',\n    input,\n    position\n  )\n\n  // 6. Strip leading and trailing ASCII whitespace\n  // from mimeType.\n  // Undici implementation note: we need to store the\n  // length because if the mimetype has spaces removed,\n  // the wrong amount will be sliced from the input in\n  // step #9\n  const mimeTypeLength = mimeType.length\n  mimeType = removeASCIIWhitespace(mimeType, true, true)\n\n  // 7. If position is past the end of input, then\n  // return failure\n  if (position.position >= input.length) {\n    return 'failure'\n  }\n\n  // 8. Advance position by 1.\n  position.position++\n\n  // 9. Let encodedBody be the remainder of input.\n  const encodedBody = input.slice(mimeTypeLength + 1)\n\n  // 10. Let body be the percent-decoding of encodedBody.\n  let body = stringPercentDecode(encodedBody)\n\n  // 11. If mimeType ends with U+003B (;), followed by\n  // zero or more U+0020 SPACE, followed by an ASCII\n  // case-insensitive match for \"base64\", then:\n  if (/;(\\u0020){0,}base64$/i.test(mimeType)) {\n    // 1. Let stringBody be the isomorphic decode of body.\n    const stringBody = isomorphicDecode(body)\n\n    // 2. Set body to the forgiving-base64 decode of\n    // stringBody.\n    body = forgivingBase64(stringBody)\n\n    // 3. If body is failure, then return failure.\n    if (body === 'failure') {\n      return 'failure'\n    }\n\n    // 4. Remove the last 6 code points from mimeType.\n    mimeType = mimeType.slice(0, -6)\n\n    // 5. Remove trailing U+0020 SPACE code points from mimeType,\n    // if any.\n    mimeType = mimeType.replace(/(\\u0020)+$/, '')\n\n    // 6. Remove the last U+003B (;) code point from mimeType.\n    mimeType = mimeType.slice(0, -1)\n  }\n\n  // 12. If mimeType starts with U+003B (;), then prepend\n  // \"text/plain\" to mimeType.\n  if (mimeType.startsWith(';')) {\n    mimeType = 'text/plain' + mimeType\n  }\n\n  // 13. Let mimeTypeRecord be the result of parsing\n  // mimeType.\n  let mimeTypeRecord = parseMIMEType(mimeType)\n\n  // 14. If mimeTypeRecord is failure, then set\n  // mimeTypeRecord to text/plain;charset=US-ASCII.\n  if (mimeTypeRecord === 'failure') {\n    mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')\n  }\n\n  // 15. Return a new data: URL struct whose MIME\n  // type is mimeTypeRecord and body is body.\n  // https://fetch.spec.whatwg.org/#data-url-struct\n  return { mimeType: mimeTypeRecord, body }\n}\n\n// https://url.spec.whatwg.org/#concept-url-serializer\n/**\n * @param {URL} url\n * @param {boolean} excludeFragment\n */\nfunction URLSerializer (url, excludeFragment = false) {\n  if (!excludeFragment) {\n    return url.href\n  }\n\n  const href = url.href\n  const hashLength = url.hash.length\n\n  const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength)\n\n  if (!hashLength && href.endsWith('#')) {\n    return serialized.slice(0, -1)\n  }\n\n  return serialized\n}\n\n// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n/**\n * @param {(char: string) => boolean} condition\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePoints (condition, input, position) {\n  // 1. Let result be the empty string.\n  let result = ''\n\n  // 2. While position doesn’t point past the end of input and the\n  // code point at position within input meets the condition condition:\n  while (position.position < input.length && condition(input[position.position])) {\n    // 1. Append that code point to the end of result.\n    result += input[position.position]\n\n    // 2. Advance position by 1.\n    position.position++\n  }\n\n  // 3. Return result.\n  return result\n}\n\n/**\n * A faster collectASequenceOfCodePoints that only works when comparing a single character.\n * @param {string} char\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePointsFast (char, input, position) {\n  const idx = input.indexOf(char, position.position)\n  const start = position.position\n\n  if (idx === -1) {\n    position.position = input.length\n    return input.slice(start)\n  }\n\n  position.position = idx\n  return input.slice(start, position.position)\n}\n\n// https://url.spec.whatwg.org/#string-percent-decode\n/** @param {string} input */\nfunction stringPercentDecode (input) {\n  // 1. Let bytes be the UTF-8 encoding of input.\n  const bytes = encoder.encode(input)\n\n  // 2. Return the percent-decoding of bytes.\n  return percentDecode(bytes)\n}\n\n/**\n * @param {number} byte\n */\nfunction isHexCharByte (byte) {\n  // 0-9 A-F a-f\n  return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66)\n}\n\n/**\n * @param {number} byte\n */\nfunction hexByteToNumber (byte) {\n  return (\n    // 0-9\n    byte >= 0x30 && byte <= 0x39\n      ? (byte - 48)\n    // Convert to uppercase\n    // ((byte & 0xDF) - 65) + 10\n      : ((byte & 0xDF) - 55)\n  )\n}\n\n// https://url.spec.whatwg.org/#percent-decode\n/** @param {Uint8Array} input */\nfunction percentDecode (input) {\n  const length = input.length\n  // 1. Let output be an empty byte sequence.\n  /** @type {Uint8Array} */\n  const output = new Uint8Array(length)\n  let j = 0\n  // 2. For each byte byte in input:\n  for (let i = 0; i < length; ++i) {\n    const byte = input[i]\n\n    // 1. If byte is not 0x25 (%), then append byte to output.\n    if (byte !== 0x25) {\n      output[j++] = byte\n\n    // 2. Otherwise, if byte is 0x25 (%) and the next two bytes\n    // after byte in input are not in the ranges\n    // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),\n    // and 0x61 (a) to 0x66 (f), all inclusive, append byte\n    // to output.\n    } else if (\n      byte === 0x25 &&\n      !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))\n    ) {\n      output[j++] = 0x25\n\n    // 3. Otherwise:\n    } else {\n      // 1. Let bytePoint be the two bytes after byte in input,\n      // decoded, and then interpreted as hexadecimal number.\n      // 2. Append a byte whose value is bytePoint to output.\n      output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2])\n\n      // 3. Skip the next two bytes in input.\n      i += 2\n    }\n  }\n\n  // 3. Return output.\n  return length === j ? output : output.subarray(0, j)\n}\n\n// https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n/** @param {string} input */\nfunction parseMIMEType (input) {\n  // 1. Remove any leading and trailing HTTP whitespace\n  // from input.\n  input = removeHTTPWhitespace(input, true, true)\n\n  // 2. Let position be a position variable for input,\n  // initially pointing at the start of input.\n  const position = { position: 0 }\n\n  // 3. Let type be the result of collecting a sequence\n  // of code points that are not U+002F (/) from\n  // input, given position.\n  const type = collectASequenceOfCodePointsFast(\n    '/',\n    input,\n    position\n  )\n\n  // 4. If type is the empty string or does not solely\n  // contain HTTP token code points, then return failure.\n  // https://mimesniff.spec.whatwg.org/#http-token-code-point\n  if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n    return 'failure'\n  }\n\n  // 5. If position is past the end of input, then return\n  // failure\n  if (position.position > input.length) {\n    return 'failure'\n  }\n\n  // 6. Advance position by 1. (This skips past U+002F (/).)\n  position.position++\n\n  // 7. Let subtype be the result of collecting a sequence of\n  // code points that are not U+003B (;) from input, given\n  // position.\n  let subtype = collectASequenceOfCodePointsFast(\n    ';',\n    input,\n    position\n  )\n\n  // 8. Remove any trailing HTTP whitespace from subtype.\n  subtype = removeHTTPWhitespace(subtype, false, true)\n\n  // 9. If subtype is the empty string or does not solely\n  // contain HTTP token code points, then return failure.\n  if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n    return 'failure'\n  }\n\n  const typeLowercase = type.toLowerCase()\n  const subtypeLowercase = subtype.toLowerCase()\n\n  // 10. Let mimeType be a new MIME type record whose type\n  // is type, in ASCII lowercase, and subtype is subtype,\n  // in ASCII lowercase.\n  // https://mimesniff.spec.whatwg.org/#mime-type\n  const mimeType = {\n    type: typeLowercase,\n    subtype: subtypeLowercase,\n    /** @type {Map} */\n    parameters: new Map(),\n    // https://mimesniff.spec.whatwg.org/#mime-type-essence\n    essence: `${typeLowercase}/${subtypeLowercase}`\n  }\n\n  // 11. While position is not past the end of input:\n  while (position.position < input.length) {\n    // 1. Advance position by 1. (This skips past U+003B (;).)\n    position.position++\n\n    // 2. Collect a sequence of code points that are HTTP\n    // whitespace from input given position.\n    collectASequenceOfCodePoints(\n      // https://fetch.spec.whatwg.org/#http-whitespace\n      char => HTTP_WHITESPACE_REGEX.test(char),\n      input,\n      position\n    )\n\n    // 3. Let parameterName be the result of collecting a\n    // sequence of code points that are not U+003B (;)\n    // or U+003D (=) from input, given position.\n    let parameterName = collectASequenceOfCodePoints(\n      (char) => char !== ';' && char !== '=',\n      input,\n      position\n    )\n\n    // 4. Set parameterName to parameterName, in ASCII\n    // lowercase.\n    parameterName = parameterName.toLowerCase()\n\n    // 5. If position is not past the end of input, then:\n    if (position.position < input.length) {\n      // 1. If the code point at position within input is\n      // U+003B (;), then continue.\n      if (input[position.position] === ';') {\n        continue\n      }\n\n      // 2. Advance position by 1. (This skips past U+003D (=).)\n      position.position++\n    }\n\n    // 6. If position is past the end of input, then break.\n    if (position.position > input.length) {\n      break\n    }\n\n    // 7. Let parameterValue be null.\n    let parameterValue = null\n\n    // 8. If the code point at position within input is\n    // U+0022 (\"), then:\n    if (input[position.position] === '\"') {\n      // 1. Set parameterValue to the result of collecting\n      // an HTTP quoted string from input, given position\n      // and the extract-value flag.\n      parameterValue = collectAnHTTPQuotedString(input, position, true)\n\n      // 2. Collect a sequence of code points that are not\n      // U+003B (;) from input, given position.\n      collectASequenceOfCodePointsFast(\n        ';',\n        input,\n        position\n      )\n\n    // 9. Otherwise:\n    } else {\n      // 1. Set parameterValue to the result of collecting\n      // a sequence of code points that are not U+003B (;)\n      // from input, given position.\n      parameterValue = collectASequenceOfCodePointsFast(\n        ';',\n        input,\n        position\n      )\n\n      // 2. Remove any trailing HTTP whitespace from parameterValue.\n      parameterValue = removeHTTPWhitespace(parameterValue, false, true)\n\n      // 3. If parameterValue is the empty string, then continue.\n      if (parameterValue.length === 0) {\n        continue\n      }\n    }\n\n    // 10. If all of the following are true\n    // - parameterName is not the empty string\n    // - parameterName solely contains HTTP token code points\n    // - parameterValue solely contains HTTP quoted-string token code points\n    // - mimeType’s parameters[parameterName] does not exist\n    // then set mimeType’s parameters[parameterName] to parameterValue.\n    if (\n      parameterName.length !== 0 &&\n      HTTP_TOKEN_CODEPOINTS.test(parameterName) &&\n      (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&\n      !mimeType.parameters.has(parameterName)\n    ) {\n      mimeType.parameters.set(parameterName, parameterValue)\n    }\n  }\n\n  // 12. Return mimeType.\n  return mimeType\n}\n\n// https://infra.spec.whatwg.org/#forgiving-base64-decode\n/** @param {string} data */\nfunction forgivingBase64 (data) {\n  // 1. Remove all ASCII whitespace from data.\n  data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '')  // eslint-disable-line\n\n  let dataLength = data.length\n  // 2. If data’s code point length divides by 4 leaving\n  // no remainder, then:\n  if (dataLength % 4 === 0) {\n    // 1. If data ends with one or two U+003D (=) code points,\n    // then remove them from data.\n    if (data.charCodeAt(dataLength - 1) === 0x003D) {\n      --dataLength\n      if (data.charCodeAt(dataLength - 1) === 0x003D) {\n        --dataLength\n      }\n    }\n  }\n\n  // 3. If data’s code point length divides by 4 leaving\n  // a remainder of 1, then return failure.\n  if (dataLength % 4 === 1) {\n    return 'failure'\n  }\n\n  // 4. If data contains a code point that is not one of\n  //  U+002B (+)\n  //  U+002F (/)\n  //  ASCII alphanumeric\n  // then return failure.\n  if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {\n    return 'failure'\n  }\n\n  const buffer = Buffer.from(data, 'base64')\n  return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\n// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string\n// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string\n/**\n * @param {string} input\n * @param {{ position: number }} position\n * @param {boolean?} extractValue\n */\nfunction collectAnHTTPQuotedString (input, position, extractValue) {\n  // 1. Let positionStart be position.\n  const positionStart = position.position\n\n  // 2. Let value be the empty string.\n  let value = ''\n\n  // 3. Assert: the code point at position within input\n  // is U+0022 (\").\n  assert(input[position.position] === '\"')\n\n  // 4. Advance position by 1.\n  position.position++\n\n  // 5. While true:\n  while (true) {\n    // 1. Append the result of collecting a sequence of code points\n    // that are not U+0022 (\") or U+005C (\\) from input, given\n    // position, to value.\n    value += collectASequenceOfCodePoints(\n      (char) => char !== '\"' && char !== '\\\\',\n      input,\n      position\n    )\n\n    // 2. If position is past the end of input, then break.\n    if (position.position >= input.length) {\n      break\n    }\n\n    // 3. Let quoteOrBackslash be the code point at position within\n    // input.\n    const quoteOrBackslash = input[position.position]\n\n    // 4. Advance position by 1.\n    position.position++\n\n    // 5. If quoteOrBackslash is U+005C (\\), then:\n    if (quoteOrBackslash === '\\\\') {\n      // 1. If position is past the end of input, then append\n      // U+005C (\\) to value and break.\n      if (position.position >= input.length) {\n        value += '\\\\'\n        break\n      }\n\n      // 2. Append the code point at position within input to value.\n      value += input[position.position]\n\n      // 3. Advance position by 1.\n      position.position++\n\n    // 6. Otherwise:\n    } else {\n      // 1. Assert: quoteOrBackslash is U+0022 (\").\n      assert(quoteOrBackslash === '\"')\n\n      // 2. Break.\n      break\n    }\n  }\n\n  // 6. If the extract-value flag is set, then return value.\n  if (extractValue) {\n    return value\n  }\n\n  // 7. Return the code points from positionStart to position,\n  // inclusive, within input.\n  return input.slice(positionStart, position.position)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serializeAMimeType (mimeType) {\n  assert(mimeType !== 'failure')\n  const { parameters, essence } = mimeType\n\n  // 1. Let serialization be the concatenation of mimeType’s\n  //    type, U+002F (/), and mimeType’s subtype.\n  let serialization = essence\n\n  // 2. For each name → value of mimeType’s parameters:\n  for (let [name, value] of parameters.entries()) {\n    // 1. Append U+003B (;) to serialization.\n    serialization += ';'\n\n    // 2. Append name to serialization.\n    serialization += name\n\n    // 3. Append U+003D (=) to serialization.\n    serialization += '='\n\n    // 4. If value does not solely contain HTTP token code\n    //    points or value is the empty string, then:\n    if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n      // 1. Precede each occurrence of U+0022 (\") or\n      //    U+005C (\\) in value with U+005C (\\).\n      value = value.replace(/(\\\\|\")/g, '\\\\$1')\n\n      // 2. Prepend U+0022 (\") to value.\n      value = '\"' + value\n\n      // 3. Append U+0022 (\") to value.\n      value += '\"'\n    }\n\n    // 5. Append value to serialization.\n    serialization += value\n  }\n\n  // 3. Return serialization.\n  return serialization\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {number} char\n */\nfunction isHTTPWhiteSpace (char) {\n  // \"\\r\\n\\t \"\n  return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeHTTPWhitespace (str, leading = true, trailing = true) {\n  return removeChars(str, leading, trailing, isHTTPWhiteSpace)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n * @param {number} char\n */\nfunction isASCIIWhitespace (char) {\n  // \"\\r\\n\\t\\f \"\n  return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x00c || char === 0x020\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeASCIIWhitespace (str, leading = true, trailing = true) {\n  return removeChars(str, leading, trailing, isASCIIWhitespace)\n}\n\n/**\n * @param {string} str\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns\n */\nfunction removeChars (str, leading, trailing, predicate) {\n  let lead = 0\n  let trail = str.length - 1\n\n  if (leading) {\n    while (lead < str.length && predicate(str.charCodeAt(lead))) lead++\n  }\n\n  if (trailing) {\n    while (trail > 0 && predicate(str.charCodeAt(trail))) trail--\n  }\n\n  return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-decode\n * @param {Uint8Array} input\n * @returns {string}\n */\nfunction isomorphicDecode (input) {\n  // 1. To isomorphic decode a byte sequence input, return a string whose code point\n  //    length is equal to input’s length and whose code points have the same values\n  //    as the values of input’s bytes, in the same order.\n  const length = input.length\n  if ((2 << 15) - 1 > length) {\n    return String.fromCharCode.apply(null, input)\n  }\n  let result = ''; let i = 0\n  let addition = (2 << 15) - 1\n  while (i < length) {\n    if (i + addition > length) {\n      addition = length - i\n    }\n    result += String.fromCharCode.apply(null, input.subarray(i, i += addition))\n  }\n  return result\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type\n * @param {Exclude, 'failure'>} mimeType\n */\nfunction minimizeSupportedMimeType (mimeType) {\n  switch (mimeType.essence) {\n    case 'application/ecmascript':\n    case 'application/javascript':\n    case 'application/x-ecmascript':\n    case 'application/x-javascript':\n    case 'text/ecmascript':\n    case 'text/javascript':\n    case 'text/javascript1.0':\n    case 'text/javascript1.1':\n    case 'text/javascript1.2':\n    case 'text/javascript1.3':\n    case 'text/javascript1.4':\n    case 'text/javascript1.5':\n    case 'text/jscript':\n    case 'text/livescript':\n    case 'text/x-ecmascript':\n    case 'text/x-javascript':\n      // 1. If mimeType is a JavaScript MIME type, then return \"text/javascript\".\n      return 'text/javascript'\n    case 'application/json':\n    case 'text/json':\n      // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n      return 'application/json'\n    case 'image/svg+xml':\n      // 3. If mimeType’s essence is \"image/svg+xml\", then return \"image/svg+xml\".\n      return 'image/svg+xml'\n    case 'text/xml':\n    case 'application/xml':\n      // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n      return 'application/xml'\n  }\n\n  // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n  if (mimeType.subtype.endsWith('+json')) {\n    return 'application/json'\n  }\n\n  // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n  if (mimeType.subtype.endsWith('+xml')) {\n    return 'application/xml'\n  }\n\n  // 5. If mimeType is supported by the user agent, then return mimeType’s essence.\n  // Technically, node doesn't support any mimetypes.\n\n  // 6. Return the empty string.\n  return ''\n}\n\nmodule.exports = {\n  dataURLProcessor,\n  URLSerializer,\n  collectASequenceOfCodePoints,\n  collectASequenceOfCodePointsFast,\n  stringPercentDecode,\n  parseMIMEType,\n  collectAnHTTPQuotedString,\n  serializeAMimeType,\n  removeChars,\n  removeHTTPWhitespace,\n  minimizeSupportedMimeType,\n  HTTP_TOKEN_CODEPOINTS,\n  isomorphicDecode\n}\n","'use strict'\n\nconst { kConnected, kSize } = require('../../core/symbols')\n\nclass CompatWeakRef {\n  constructor (value) {\n    this.value = value\n  }\n\n  deref () {\n    return this.value[kConnected] === 0 && this.value[kSize] === 0\n      ? undefined\n      : this.value\n  }\n}\n\nclass CompatFinalizer {\n  constructor (finalizer) {\n    this.finalizer = finalizer\n  }\n\n  register (dispatcher, key) {\n    if (dispatcher.on) {\n      dispatcher.on('disconnect', () => {\n        if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {\n          this.finalizer(key)\n        }\n      })\n    }\n  }\n\n  unregister (key) {}\n}\n\nmodule.exports = function () {\n  // FIXME: remove workaround when the Node bug is backported to v18\n  // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\n  if (process.env.NODE_V8_COVERAGE && process.version.startsWith('v18')) {\n    process._rawDebug('Using compatibility WeakRef and FinalizationRegistry')\n    return {\n      WeakRef: CompatWeakRef,\n      FinalizationRegistry: CompatFinalizer\n    }\n  }\n  return { WeakRef, FinalizationRegistry }\n}\n","'use strict'\n\nconst { Blob, File } = require('node:buffer')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\n\n// TODO(@KhafraDev): remove\nclass FileLike {\n  constructor (blobLike, fileName, options = {}) {\n    // TODO: argument idl type check\n\n    // The File constructor is invoked with two or three parameters, depending\n    // on whether the optional dictionary parameter is used. When the File()\n    // constructor is invoked, user agents must run the following steps:\n\n    // 1. Let bytes be the result of processing blob parts given fileBits and\n    // options.\n\n    // 2. Let n be the fileName argument to the constructor.\n    const n = fileName\n\n    // 3. Process FilePropertyBag dictionary argument by running the following\n    // substeps:\n\n    //    1. If the type member is provided and is not the empty string, let t\n    //    be set to the type dictionary member. If t contains any characters\n    //    outside the range U+0020 to U+007E, then set t to the empty string\n    //    and return from these substeps.\n    //    TODO\n    const t = options.type\n\n    //    2. Convert every character in t to ASCII lowercase.\n    //    TODO\n\n    //    3. If the lastModified member is provided, let d be set to the\n    //    lastModified dictionary member. If it is not provided, set d to the\n    //    current date and time represented as the number of milliseconds since\n    //    the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n    const d = options.lastModified ?? Date.now()\n\n    // 4. Return a new File object F such that:\n    // F refers to the bytes byte sequence.\n    // F.size is set to the number of total bytes in bytes.\n    // F.name is set to n.\n    // F.type is set to t.\n    // F.lastModified is set to d.\n\n    this[kState] = {\n      blobLike,\n      name: n,\n      type: t,\n      lastModified: d\n    }\n  }\n\n  stream (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.stream(...args)\n  }\n\n  arrayBuffer (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.arrayBuffer(...args)\n  }\n\n  slice (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.slice(...args)\n  }\n\n  text (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.text(...args)\n  }\n\n  get size () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.size\n  }\n\n  get type () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.type\n  }\n\n  get name () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].name\n  }\n\n  get lastModified () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].lastModified\n  }\n\n  get [Symbol.toStringTag] () {\n    return 'File'\n  }\n}\n\nwebidl.converters.Blob = webidl.interfaceConverter(Blob)\n\n// If this function is moved to ./util.js, some tools (such as\n// rollup) will warn about circular dependencies. See:\n// https://github.com/nodejs/undici/issues/1629\nfunction isFileLike (object) {\n  return (\n    (object instanceof File) ||\n    (\n      object &&\n      (typeof object.stream === 'function' ||\n      typeof object.arrayBuffer === 'function') &&\n      object[Symbol.toStringTag] === 'File'\n    )\n  )\n}\n\nmodule.exports = { FileLike, isFileLike }\n","'use strict'\n\nconst { isUSVString, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { utf8DecodeBytes } = require('./util')\nconst { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require('./data-url')\nconst { isFileLike } = require('./file')\nconst { makeEntry } = require('./formdata')\nconst assert = require('node:assert')\nconst { File: NodeFile } = require('node:buffer')\n\nconst File = globalThis.File ?? NodeFile\n\nconst formDataNameBuffer = Buffer.from('form-data; name=\"')\nconst filenameBuffer = Buffer.from('; filename')\nconst dd = Buffer.from('--')\nconst ddcrlf = Buffer.from('--\\r\\n')\n\n/**\n * @param {string} chars\n */\nfunction isAsciiString (chars) {\n  for (let i = 0; i < chars.length; ++i) {\n    if ((chars.charCodeAt(i) & ~0x7F) !== 0) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary\n * @param {string} boundary\n */\nfunction validateBoundary (boundary) {\n  const length = boundary.length\n\n  // - its length is greater or equal to 27 and lesser or equal to 70, and\n  if (length < 27 || length > 70) {\n    return false\n  }\n\n  // - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or\n  //   0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),\n  //   0x2D (-) or 0x5F (_).\n  for (let i = 0; i < length; ++i) {\n    const cp = boundary.charCodeAt(i)\n\n    if (!(\n      (cp >= 0x30 && cp <= 0x39) ||\n      (cp >= 0x41 && cp <= 0x5a) ||\n      (cp >= 0x61 && cp <= 0x7a) ||\n      cp === 0x27 ||\n      cp === 0x2d ||\n      cp === 0x5f\n    )) {\n      return false\n    }\n  }\n\n  return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser\n * @param {Buffer} input\n * @param {ReturnType} mimeType\n */\nfunction multipartFormDataParser (input, mimeType) {\n  // 1. Assert: mimeType’s essence is \"multipart/form-data\".\n  assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')\n\n  const boundaryString = mimeType.parameters.get('boundary')\n\n  // 2. If mimeType’s parameters[\"boundary\"] does not exist, return failure.\n  //    Otherwise, let boundary be the result of UTF-8 decoding mimeType’s\n  //    parameters[\"boundary\"].\n  if (boundaryString === undefined) {\n    return 'failure'\n  }\n\n  const boundary = Buffer.from(`--${boundaryString}`, 'utf8')\n\n  // 3. Let entry list be an empty entry list.\n  const entryList = []\n\n  // 4. Let position be a pointer to a byte in input, initially pointing at\n  //    the first byte.\n  const position = { position: 0 }\n\n  // Note: undici addition, allows leading and trailing CRLFs.\n  while (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n    position.position += 2\n  }\n\n  let trailing = input.length\n\n  while (input[trailing - 1] === 0x0a && input[trailing - 2] === 0x0d) {\n    trailing -= 2\n  }\n\n  if (trailing !== input.length) {\n    input = input.subarray(0, trailing)\n  }\n\n  // 5. While true:\n  while (true) {\n    // 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D\n    //      (`--`) followed by boundary, advance position by 2 + the length of\n    //      boundary. Otherwise, return failure.\n    // Note: boundary is padded with 2 dashes already, no need to add 2.\n    if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {\n      position.position += boundary.length\n    } else {\n      return 'failure'\n    }\n\n    // 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A\n    //      (`--` followed by CR LF) followed by the end of input, return entry list.\n    // Note: a body does NOT need to end with CRLF. It can end with --.\n    if (\n      (position.position === input.length - 2 && bufferStartsWith(input, dd, position)) ||\n      (position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position))\n    ) {\n      return entryList\n    }\n\n    // 5.3. If position does not point to a sequence of bytes starting with 0x0D\n    //      0x0A (CR LF), return failure.\n    if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    }\n\n    // 5.4. Advance position by 2. (This skips past the newline.)\n    position.position += 2\n\n    // 5.5. Let name, filename and contentType be the result of parsing\n    //      multipart/form-data headers on input and position, if the result\n    //      is not failure. Otherwise, return failure.\n    const result = parseMultipartFormDataHeaders(input, position)\n\n    if (result === 'failure') {\n      return 'failure'\n    }\n\n    let { name, filename, contentType, encoding } = result\n\n    // 5.6. Advance position by 2. (This skips past the empty line that marks\n    //      the end of the headers.)\n    position.position += 2\n\n    // 5.7. Let body be the empty byte sequence.\n    let body\n\n    // 5.8. Body loop: While position is not past the end of input:\n    // TODO: the steps here are completely wrong\n    {\n      const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)\n\n      if (boundaryIndex === -1) {\n        return 'failure'\n      }\n\n      body = input.subarray(position.position, boundaryIndex - 4)\n\n      position.position += body.length\n\n      // Note: position must be advanced by the body's length before being\n      // decoded, otherwise the parsing will fail.\n      if (encoding === 'base64') {\n        body = Buffer.from(body.toString(), 'base64')\n      }\n    }\n\n    // 5.9. If position does not point to a sequence of bytes starting with\n    //      0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.\n    if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    } else {\n      position.position += 2\n    }\n\n    // 5.10. If filename is not null:\n    let value\n\n    if (filename !== null) {\n      // 5.10.1. If contentType is null, set contentType to \"text/plain\".\n      contentType ??= 'text/plain'\n\n      // 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.\n\n      // Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.\n      // Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.\n      if (!isAsciiString(contentType)) {\n        contentType = ''\n      }\n\n      // 5.10.3. Let value be a new File object with name filename, type contentType, and body body.\n      value = new File([body], filename, { type: contentType })\n    } else {\n      // 5.11. Otherwise:\n\n      // 5.11.1. Let value be the UTF-8 decoding without BOM of body.\n      value = utf8DecodeBytes(Buffer.from(body))\n    }\n\n    // 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.\n    assert(isUSVString(name))\n    assert((typeof value === 'string' && isUSVString(value)) || isFileLike(value))\n\n    // 5.13. Create an entry with name and value, and append it to entry list.\n    entryList.push(makeEntry(name, value, filename))\n  }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataHeaders (input, position) {\n  // 1. Let name, filename and contentType be null.\n  let name = null\n  let filename = null\n  let contentType = null\n  let encoding = null\n\n  // 2. While true:\n  while (true) {\n    // 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):\n    if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n      // 2.1.1. If name is null, return failure.\n      if (name === null) {\n        return 'failure'\n      }\n\n      // 2.1.2. Return name, filename and contentType.\n      return { name, filename, contentType, encoding }\n    }\n\n    // 2.2. Let header name be the result of collecting a sequence of bytes that are\n    //      not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.\n    let headerName = collectASequenceOfBytes(\n      (char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,\n      input,\n      position\n    )\n\n    // 2.3. Remove any HTTP tab or space bytes from the start or end of header name.\n    headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)\n\n    // 2.4. If header name does not match the field-name token production, return failure.\n    if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {\n      return 'failure'\n    }\n\n    // 2.5. If the byte at position is not 0x3A (:), return failure.\n    if (input[position.position] !== 0x3a) {\n      return 'failure'\n    }\n\n    // 2.6. Advance position by 1.\n    position.position++\n\n    // 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.\n    //      (Do nothing with those bytes.)\n    collectASequenceOfBytes(\n      (char) => char === 0x20 || char === 0x09,\n      input,\n      position\n    )\n\n    // 2.8. Byte-lowercase header name and switch on the result:\n    switch (bufferToLowerCasedHeaderName(headerName)) {\n      case 'content-disposition': {\n        // 1. Set name and filename to null.\n        name = filename = null\n\n        // 2. If position does not point to a sequence of bytes starting with\n        //    `form-data; name=\"`, return failure.\n        if (!bufferStartsWith(input, formDataNameBuffer, position)) {\n          return 'failure'\n        }\n\n        // 3. Advance position so it points at the byte after the next 0x22 (\")\n        //    byte (the one in the sequence of bytes matched above).\n        position.position += 17\n\n        // 4. Set name to the result of parsing a multipart/form-data name given\n        //    input and position, if the result is not failure. Otherwise, return\n        //    failure.\n        name = parseMultipartFormDataName(input, position)\n\n        if (name === null) {\n          return 'failure'\n        }\n\n        // 5. If position points to a sequence of bytes starting with `; filename=\"`:\n        if (bufferStartsWith(input, filenameBuffer, position)) {\n          // Note: undici also handles filename*\n          let check = position.position + filenameBuffer.length\n\n          if (input[check] === 0x2a) {\n            position.position += 1\n            check += 1\n          }\n\n          if (input[check] !== 0x3d || input[check + 1] !== 0x22) { // =\"\n            return 'failure'\n          }\n\n          // 1. Advance position so it points at the byte after the next 0x22 (\") byte\n          //    (the one in the sequence of bytes matched above).\n          position.position += 12\n\n          // 2. Set filename to the result of parsing a multipart/form-data name given\n          //    input and position, if the result is not failure. Otherwise, return failure.\n          filename = parseMultipartFormDataName(input, position)\n\n          if (filename === null) {\n            return 'failure'\n          }\n        }\n\n        break\n      }\n      case 'content-type': {\n        // 1. Let header value be the result of collecting a sequence of bytes that are\n        //    not 0x0A (LF) or 0x0D (CR), given position.\n        let headerValue = collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n\n        // 2. Remove any HTTP tab or space bytes from the end of header value.\n        headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n        // 3. Set contentType to the isomorphic decoding of header value.\n        contentType = isomorphicDecode(headerValue)\n\n        break\n      }\n      case 'content-transfer-encoding': {\n        let headerValue = collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n\n        headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n        encoding = isomorphicDecode(headerValue)\n\n        break\n      }\n      default: {\n        // Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.\n        // (Do nothing with those bytes.)\n        collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n      }\n    }\n\n    // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A\n    //      (CR LF), return failure. Otherwise, advance position by 2 (past the newline).\n    if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    } else {\n      position.position += 2\n    }\n  }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-a-multipart-form-data-name\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataName (input, position) {\n  // 1. Assert: The byte at (position - 1) is 0x22 (\").\n  assert(input[position.position - 1] === 0x22)\n\n  // 2. Let name be the result of collecting a sequence of bytes that are not 0x0A (LF), 0x0D (CR) or 0x22 (\"), given position.\n  /** @type {string | Buffer} */\n  let name = collectASequenceOfBytes(\n    (char) => char !== 0x0a && char !== 0x0d && char !== 0x22,\n    input,\n    position\n  )\n\n  // 3. If the byte at position is not 0x22 (\"), return failure. Otherwise, advance position by 1.\n  if (input[position.position] !== 0x22) {\n    return null // name could be 'failure'\n  } else {\n    position.position++\n  }\n\n  // 4. Replace any occurrence of the following subsequences in name with the given byte:\n  // - `%0A`: 0x0A (LF)\n  // - `%0D`: 0x0D (CR)\n  // - `%22`: 0x22 (\")\n  name = new TextDecoder().decode(name)\n    .replace(/%0A/ig, '\\n')\n    .replace(/%0D/ig, '\\r')\n    .replace(/%22/g, '\"')\n\n  // 5. Return the UTF-8 decoding without BOM of name.\n  return name\n}\n\n/**\n * @param {(char: number) => boolean} condition\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfBytes (condition, input, position) {\n  let start = position.position\n\n  while (start < input.length && condition(input[start])) {\n    ++start\n  }\n\n  return input.subarray(position.position, (position.position = start))\n}\n\n/**\n * @param {Buffer} buf\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns {Buffer}\n */\nfunction removeChars (buf, leading, trailing, predicate) {\n  let lead = 0\n  let trail = buf.length - 1\n\n  if (leading) {\n    while (lead < buf.length && predicate(buf[lead])) lead++\n  }\n\n  if (trailing) {\n    while (trail > 0 && predicate(buf[trail])) trail--\n  }\n\n  return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)\n}\n\n/**\n * Checks if {@param buffer} starts with {@param start}\n * @param {Buffer} buffer\n * @param {Buffer} start\n * @param {{ position: number }} position\n */\nfunction bufferStartsWith (buffer, start, position) {\n  if (buffer.length < start.length) {\n    return false\n  }\n\n  for (let i = 0; i < start.length; i++) {\n    if (start[i] !== buffer[position.position + i]) {\n      return false\n    }\n  }\n\n  return true\n}\n\nmodule.exports = {\n  multipartFormDataParser,\n  validateBoundary\n}\n","'use strict'\n\nconst { isBlobLike, iteratorMixin } = require('./util')\nconst { kState } = require('./symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { FileLike, isFileLike } = require('./file')\nconst { webidl } = require('./webidl')\nconst { File: NativeFile } = require('node:buffer')\nconst nodeUtil = require('node:util')\n\n/** @type {globalThis['File']} */\nconst File = globalThis.File ?? NativeFile\n\n// https://xhr.spec.whatwg.org/#formdata\nclass FormData {\n  constructor (form) {\n    webidl.util.markAsUncloneable(this)\n\n    if (form !== undefined) {\n      throw webidl.errors.conversionFailed({\n        prefix: 'FormData constructor',\n        argument: 'Argument 1',\n        types: ['undefined']\n      })\n    }\n\n    this[kState] = []\n  }\n\n  append (name, value, filename = undefined) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.append'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    if (arguments.length === 3 && !isBlobLike(value)) {\n      throw new TypeError(\n        \"Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'\"\n      )\n    }\n\n    // 1. Let value be value if given; otherwise blobValue.\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n    value = isBlobLike(value)\n      ? webidl.converters.Blob(value, prefix, 'value', { strict: false })\n      : webidl.converters.USVString(value, prefix, 'value')\n    filename = arguments.length === 3\n      ? webidl.converters.USVString(filename, prefix, 'filename')\n      : undefined\n\n    // 2. Let entry be the result of creating an entry with\n    // name, value, and filename if given.\n    const entry = makeEntry(name, value, filename)\n\n    // 3. Append entry to this’s entry list.\n    this[kState].push(entry)\n  }\n\n  delete (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // The delete(name) method steps are to remove all entries whose name\n    // is name from this’s entry list.\n    this[kState] = this[kState].filter(entry => entry.name !== name)\n  }\n\n  get (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.get'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // 1. If there is no entry whose name is name in this’s entry list,\n    // then return null.\n    const idx = this[kState].findIndex((entry) => entry.name === name)\n    if (idx === -1) {\n      return null\n    }\n\n    // 2. Return the value of the first entry whose name is name from\n    // this’s entry list.\n    return this[kState][idx].value\n  }\n\n  getAll (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.getAll'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // 1. If there is no entry whose name is name in this’s entry list,\n    // then return the empty list.\n    // 2. Return the values of all entries whose name is name, in order,\n    // from this’s entry list.\n    return this[kState]\n      .filter((entry) => entry.name === name)\n      .map((entry) => entry.value)\n  }\n\n  has (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.has'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // The has(name) method steps are to return true if there is an entry\n    // whose name is name in this’s entry list; otherwise false.\n    return this[kState].findIndex((entry) => entry.name === name) !== -1\n  }\n\n  set (name, value, filename = undefined) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.set'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    if (arguments.length === 3 && !isBlobLike(value)) {\n      throw new TypeError(\n        \"Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'\"\n      )\n    }\n\n    // The set(name, value) and set(name, blobValue, filename) method steps\n    // are:\n\n    // 1. Let value be value if given; otherwise blobValue.\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n    value = isBlobLike(value)\n      ? webidl.converters.Blob(value, prefix, 'name', { strict: false })\n      : webidl.converters.USVString(value, prefix, 'name')\n    filename = arguments.length === 3\n      ? webidl.converters.USVString(filename, prefix, 'name')\n      : undefined\n\n    // 2. Let entry be the result of creating an entry with name, value, and\n    // filename if given.\n    const entry = makeEntry(name, value, filename)\n\n    // 3. If there are entries in this’s entry list whose name is name, then\n    // replace the first such entry with entry and remove the others.\n    const idx = this[kState].findIndex((entry) => entry.name === name)\n    if (idx !== -1) {\n      this[kState] = [\n        ...this[kState].slice(0, idx),\n        entry,\n        ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)\n      ]\n    } else {\n      // 4. Otherwise, append entry to this’s entry list.\n      this[kState].push(entry)\n    }\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    const state = this[kState].reduce((a, b) => {\n      if (a[b.name]) {\n        if (Array.isArray(a[b.name])) {\n          a[b.name].push(b.value)\n        } else {\n          a[b.name] = [a[b.name], b.value]\n        }\n      } else {\n        a[b.name] = b.value\n      }\n\n      return a\n    }, { __proto__: null })\n\n    options.depth ??= depth\n    options.colors ??= true\n\n    const output = nodeUtil.formatWithOptions(options, state)\n\n    // remove [Object null prototype]\n    return `FormData ${output.slice(output.indexOf(']') + 2)}`\n  }\n}\n\niteratorMixin('FormData', FormData, kState, 'name', 'value')\n\nObject.defineProperties(FormData.prototype, {\n  append: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  get: kEnumerableProperty,\n  getAll: kEnumerableProperty,\n  has: kEnumerableProperty,\n  set: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'FormData',\n    configurable: true\n  }\n})\n\n/**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry\n * @param {string} name\n * @param {string|Blob} value\n * @param {?string} filename\n * @returns\n */\nfunction makeEntry (name, value, filename) {\n  // 1. Set name to the result of converting name into a scalar value string.\n  // Note: This operation was done by the webidl converter USVString.\n\n  // 2. If value is a string, then set value to the result of converting\n  //    value into a scalar value string.\n  if (typeof value === 'string') {\n    // Note: This operation was done by the webidl converter USVString.\n  } else {\n    // 3. Otherwise:\n\n    // 1. If value is not a File object, then set value to a new File object,\n    //    representing the same bytes, whose name attribute value is \"blob\"\n    if (!isFileLike(value)) {\n      value = value instanceof Blob\n        ? new File([value], 'blob', { type: value.type })\n        : new FileLike(value, 'blob', { type: value.type })\n    }\n\n    // 2. If filename is given, then set value to a new File object,\n    //    representing the same bytes, whose name attribute is filename.\n    if (filename !== undefined) {\n      /** @type {FilePropertyBag} */\n      const options = {\n        type: value.type,\n        lastModified: value.lastModified\n      }\n\n      value = value instanceof NativeFile\n        ? new File([value], filename, options)\n        : new FileLike(value, filename, options)\n    }\n  }\n\n  // 4. Return an entry whose name is name and whose value is value.\n  return { name, value }\n}\n\nmodule.exports = { FormData, makeEntry }\n","'use strict'\n\n// In case of breaking changes, increase the version\n// number to avoid conflicts.\nconst globalOrigin = Symbol.for('undici.globalOrigin.1')\n\nfunction getGlobalOrigin () {\n  return globalThis[globalOrigin]\n}\n\nfunction setGlobalOrigin (newOrigin) {\n  if (newOrigin === undefined) {\n    Object.defineProperty(globalThis, globalOrigin, {\n      value: undefined,\n      writable: true,\n      enumerable: false,\n      configurable: false\n    })\n\n    return\n  }\n\n  const parsedURL = new URL(newOrigin)\n\n  if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {\n    throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)\n  }\n\n  Object.defineProperty(globalThis, globalOrigin, {\n    value: parsedURL,\n    writable: true,\n    enumerable: false,\n    configurable: false\n  })\n}\n\nmodule.exports = {\n  getGlobalOrigin,\n  setGlobalOrigin\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst { kConstruct } = require('../../core/symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst {\n  iteratorMixin,\n  isValidHeaderName,\n  isValidHeaderValue\n} = require('./util')\nconst { webidl } = require('./webidl')\nconst assert = require('node:assert')\nconst util = require('node:util')\n\nconst kHeadersMap = Symbol('headers map')\nconst kHeadersSortedMap = Symbol('headers map sorted')\n\n/**\n * @param {number} code\n */\nfunction isHTTPWhiteSpaceCharCode (code) {\n  return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize\n * @param {string} potentialValue\n */\nfunction headerValueNormalize (potentialValue) {\n  //  To normalize a byte sequence potentialValue, remove\n  //  any leading and trailing HTTP whitespace bytes from\n  //  potentialValue.\n  let i = 0; let j = potentialValue.length\n\n  while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j\n  while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i\n\n  return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)\n}\n\nfunction fill (headers, object) {\n  // To fill a Headers object headers with a given object object, run these steps:\n\n  // 1. If object is a sequence, then for each header in object:\n  // Note: webidl conversion to array has already been done.\n  if (Array.isArray(object)) {\n    for (let i = 0; i < object.length; ++i) {\n      const header = object[i]\n      // 1. If header does not contain exactly two items, then throw a TypeError.\n      if (header.length !== 2) {\n        throw webidl.errors.exception({\n          header: 'Headers constructor',\n          message: `expected name/value pair to be length 2, found ${header.length}.`\n        })\n      }\n\n      // 2. Append (header’s first item, header’s second item) to headers.\n      appendHeader(headers, header[0], header[1])\n    }\n  } else if (typeof object === 'object' && object !== null) {\n    // Note: null should throw\n\n    // 2. Otherwise, object is a record, then for each key → value in object,\n    //    append (key, value) to headers\n    const keys = Object.keys(object)\n    for (let i = 0; i < keys.length; ++i) {\n      appendHeader(headers, keys[i], object[keys[i]])\n    }\n  } else {\n    throw webidl.errors.conversionFailed({\n      prefix: 'Headers constructor',\n      argument: 'Argument 1',\n      types: ['sequence>', 'record']\n    })\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-headers-append\n */\nfunction appendHeader (headers, name, value) {\n  // 1. Normalize value.\n  value = headerValueNormalize(value)\n\n  // 2. If name is not a header name or value is not a\n  //    header value, then throw a TypeError.\n  if (!isValidHeaderName(name)) {\n    throw webidl.errors.invalidArgument({\n      prefix: 'Headers.append',\n      value: name,\n      type: 'header name'\n    })\n  } else if (!isValidHeaderValue(value)) {\n    throw webidl.errors.invalidArgument({\n      prefix: 'Headers.append',\n      value,\n      type: 'header value'\n    })\n  }\n\n  // 3. If headers’s guard is \"immutable\", then throw a TypeError.\n  // 4. Otherwise, if headers’s guard is \"request\" and name is a\n  //    forbidden header name, return.\n  // 5. Otherwise, if headers’s guard is \"request-no-cors\":\n  //    TODO\n  // Note: undici does not implement forbidden header names\n  if (getHeadersGuard(headers) === 'immutable') {\n    throw new TypeError('immutable')\n  }\n\n  // 6. Otherwise, if headers’s guard is \"response\" and name is a\n  //    forbidden response-header name, return.\n\n  // 7. Append (name, value) to headers’s header list.\n  return getHeadersList(headers).append(name, value, false)\n\n  // 8. If headers’s guard is \"request-no-cors\", then remove\n  //    privileged no-CORS request headers from headers\n}\n\nfunction compareHeaderName (a, b) {\n  return a[0] < b[0] ? -1 : 1\n}\n\nclass HeadersList {\n  /** @type {[string, string][]|null} */\n  cookies = null\n\n  constructor (init) {\n    if (init instanceof HeadersList) {\n      this[kHeadersMap] = new Map(init[kHeadersMap])\n      this[kHeadersSortedMap] = init[kHeadersSortedMap]\n      this.cookies = init.cookies === null ? null : [...init.cookies]\n    } else {\n      this[kHeadersMap] = new Map(init)\n      this[kHeadersSortedMap] = null\n    }\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#header-list-contains\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   */\n  contains (name, isLowerCase) {\n    // A header list list contains a header name name if list\n    // contains a header whose name is a byte-case-insensitive\n    // match for name.\n\n    return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase())\n  }\n\n  clear () {\n    this[kHeadersMap].clear()\n    this[kHeadersSortedMap] = null\n    this.cookies = null\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-append\n   * @param {string} name\n   * @param {string} value\n   * @param {boolean} isLowerCase\n   */\n  append (name, value, isLowerCase) {\n    this[kHeadersSortedMap] = null\n\n    // 1. If list contains name, then set name to the first such\n    //    header’s name.\n    const lowercaseName = isLowerCase ? name : name.toLowerCase()\n    const exists = this[kHeadersMap].get(lowercaseName)\n\n    // 2. Append (name, value) to list.\n    if (exists) {\n      const delimiter = lowercaseName === 'cookie' ? '; ' : ', '\n      this[kHeadersMap].set(lowercaseName, {\n        name: exists.name,\n        value: `${exists.value}${delimiter}${value}`\n      })\n    } else {\n      this[kHeadersMap].set(lowercaseName, { name, value })\n    }\n\n    if (lowercaseName === 'set-cookie') {\n      (this.cookies ??= []).push(value)\n    }\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-set\n   * @param {string} name\n   * @param {string} value\n   * @param {boolean} isLowerCase\n   */\n  set (name, value, isLowerCase) {\n    this[kHeadersSortedMap] = null\n    const lowercaseName = isLowerCase ? name : name.toLowerCase()\n\n    if (lowercaseName === 'set-cookie') {\n      this.cookies = [value]\n    }\n\n    // 1. If list contains name, then set the value of\n    //    the first such header to value and remove the\n    //    others.\n    // 2. Otherwise, append header (name, value) to list.\n    this[kHeadersMap].set(lowercaseName, { name, value })\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-delete\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   */\n  delete (name, isLowerCase) {\n    this[kHeadersSortedMap] = null\n    if (!isLowerCase) name = name.toLowerCase()\n\n    if (name === 'set-cookie') {\n      this.cookies = null\n    }\n\n    this[kHeadersMap].delete(name)\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-get\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   * @returns {string | null}\n   */\n  get (name, isLowerCase) {\n    // 1. If list does not contain name, then return null.\n    // 2. Return the values of all headers in list whose name\n    //    is a byte-case-insensitive match for name,\n    //    separated from each other by 0x2C 0x20, in order.\n    return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null\n  }\n\n  * [Symbol.iterator] () {\n    // use the lowercased name\n    for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n      yield [name, value]\n    }\n  }\n\n  get entries () {\n    const headers = {}\n\n    if (this[kHeadersMap].size !== 0) {\n      for (const { name, value } of this[kHeadersMap].values()) {\n        headers[name] = value\n      }\n    }\n\n    return headers\n  }\n\n  rawValues () {\n    return this[kHeadersMap].values()\n  }\n\n  get entriesList () {\n    const headers = []\n\n    if (this[kHeadersMap].size !== 0) {\n      for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) {\n        if (lowerName === 'set-cookie') {\n          for (const cookie of this.cookies) {\n            headers.push([name, cookie])\n          }\n        } else {\n          headers.push([name, value])\n        }\n      }\n    }\n\n    return headers\n  }\n\n  // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set\n  toSortedArray () {\n    const size = this[kHeadersMap].size\n    const array = new Array(size)\n    // In most cases, you will use the fast-path.\n    // fast-path: Use binary insertion sort for small arrays.\n    if (size <= 32) {\n      if (size === 0) {\n        // If empty, it is an empty array. To avoid the first index assignment.\n        return array\n      }\n      // Improve performance by unrolling loop and avoiding double-loop.\n      // Double-loop-less version of the binary insertion sort.\n      const iterator = this[kHeadersMap][Symbol.iterator]()\n      const firstValue = iterator.next().value\n      // set [name, value] to first index.\n      array[0] = [firstValue[0], firstValue[1].value]\n      // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n      // 3.2.2. Assert: value is non-null.\n      assert(firstValue[1].value !== null)\n      for (\n        let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value;\n        i < size;\n        ++i\n      ) {\n        // get next value\n        value = iterator.next().value\n        // set [name, value] to current index.\n        x = array[i] = [value[0], value[1].value]\n        // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n        // 3.2.2. Assert: value is non-null.\n        assert(x[1] !== null)\n        left = 0\n        right = i\n        // binary search\n        while (left < right) {\n          // middle index\n          pivot = left + ((right - left) >> 1)\n          // compare header name\n          if (array[pivot][0] <= x[0]) {\n            left = pivot + 1\n          } else {\n            right = pivot\n          }\n        }\n        if (i !== pivot) {\n          j = i\n          while (j > left) {\n            array[j] = array[--j]\n          }\n          array[left] = x\n        }\n      }\n      /* c8 ignore next 4 */\n      if (!iterator.next().done) {\n        // This is for debugging and will never be called.\n        throw new TypeError('Unreachable')\n      }\n      return array\n    } else {\n      // This case would be a rare occurrence.\n      // slow-path: fallback\n      let i = 0\n      for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n        array[i++] = [name, value]\n        // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n        // 3.2.2. Assert: value is non-null.\n        assert(value !== null)\n      }\n      return array.sort(compareHeaderName)\n    }\n  }\n}\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n  #guard\n  #headersList\n\n  constructor (init = undefined) {\n    webidl.util.markAsUncloneable(this)\n\n    if (init === kConstruct) {\n      return\n    }\n\n    this.#headersList = new HeadersList()\n\n    // The new Headers(init) constructor steps are:\n\n    // 1. Set this’s guard to \"none\".\n    this.#guard = 'none'\n\n    // 2. If init is given, then fill this with init.\n    if (init !== undefined) {\n      init = webidl.converters.HeadersInit(init, 'Headers contructor', 'init')\n      fill(this, init)\n    }\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-append\n  append (name, value) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 2, 'Headers.append')\n\n    const prefix = 'Headers.append'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n    value = webidl.converters.ByteString(value, prefix, 'value')\n\n    return appendHeader(this, name, value)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-delete\n  delete (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')\n\n    const prefix = 'Headers.delete'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix: 'Headers.delete',\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. If this’s guard is \"immutable\", then throw a TypeError.\n    // 3. Otherwise, if this’s guard is \"request\" and name is a\n    //    forbidden header name, return.\n    // 4. Otherwise, if this’s guard is \"request-no-cors\", name\n    //    is not a no-CORS-safelisted request-header name, and\n    //    name is not a privileged no-CORS request-header name,\n    //    return.\n    // 5. Otherwise, if this’s guard is \"response\" and name is\n    //    a forbidden response-header name, return.\n    // Note: undici does not implement forbidden header names\n    if (this.#guard === 'immutable') {\n      throw new TypeError('immutable')\n    }\n\n    // 6. If this’s header list does not contain name, then\n    //    return.\n    if (!this.#headersList.contains(name, false)) {\n      return\n    }\n\n    // 7. Delete name from this’s header list.\n    // 8. If this’s guard is \"request-no-cors\", then remove\n    //    privileged no-CORS request headers from this.\n    this.#headersList.delete(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-get\n  get (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.get')\n\n    const prefix = 'Headers.get'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. Return the result of getting name from this’s header\n    //    list.\n    return this.#headersList.get(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-has\n  has (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.has')\n\n    const prefix = 'Headers.has'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. Return true if this’s header list contains name;\n    //    otherwise false.\n    return this.#headersList.contains(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-set\n  set (name, value) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 2, 'Headers.set')\n\n    const prefix = 'Headers.set'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n    value = webidl.converters.ByteString(value, prefix, 'value')\n\n    // 1. Normalize value.\n    value = headerValueNormalize(value)\n\n    // 2. If name is not a header name or value is not a\n    //    header value, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    } else if (!isValidHeaderValue(value)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value,\n        type: 'header value'\n      })\n    }\n\n    // 3. If this’s guard is \"immutable\", then throw a TypeError.\n    // 4. Otherwise, if this’s guard is \"request\" and name is a\n    //    forbidden header name, return.\n    // 5. Otherwise, if this’s guard is \"request-no-cors\" and\n    //    name/value is not a no-CORS-safelisted request-header,\n    //    return.\n    // 6. Otherwise, if this’s guard is \"response\" and name is a\n    //    forbidden response-header name, return.\n    // Note: undici does not implement forbidden header names\n    if (this.#guard === 'immutable') {\n      throw new TypeError('immutable')\n    }\n\n    // 7. Set (name, value) in this’s header list.\n    // 8. If this’s guard is \"request-no-cors\", then remove\n    //    privileged no-CORS request headers from this\n    this.#headersList.set(name, value, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n  getSetCookie () {\n    webidl.brandCheck(this, Headers)\n\n    // 1. If this’s header list does not contain `Set-Cookie`, then return « ».\n    // 2. Return the values of all headers in this’s header list whose name is\n    //    a byte-case-insensitive match for `Set-Cookie`, in order.\n\n    const list = this.#headersList.cookies\n\n    if (list) {\n      return [...list]\n    }\n\n    return []\n  }\n\n  // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n  get [kHeadersSortedMap] () {\n    if (this.#headersList[kHeadersSortedMap]) {\n      return this.#headersList[kHeadersSortedMap]\n    }\n\n    // 1. Let headers be an empty list of headers with the key being the name\n    //    and value the value.\n    const headers = []\n\n    // 2. Let names be the result of convert header names to a sorted-lowercase\n    //    set with all the names of the headers in list.\n    const names = this.#headersList.toSortedArray()\n\n    const cookies = this.#headersList.cookies\n\n    // fast-path\n    if (cookies === null || cookies.length === 1) {\n      // Note: The non-null assertion of value has already been done by `HeadersList#toSortedArray`\n      return (this.#headersList[kHeadersSortedMap] = names)\n    }\n\n    // 3. For each name of names:\n    for (let i = 0; i < names.length; ++i) {\n      const { 0: name, 1: value } = names[i]\n      // 1. If name is `set-cookie`, then:\n      if (name === 'set-cookie') {\n        // 1. Let values be a list of all values of headers in list whose name\n        //    is a byte-case-insensitive match for name, in order.\n\n        // 2. For each value of values:\n        // 1. Append (name, value) to headers.\n        for (let j = 0; j < cookies.length; ++j) {\n          headers.push([name, cookies[j]])\n        }\n      } else {\n        // 2. Otherwise:\n\n        // 1. Let value be the result of getting name from list.\n\n        // 2. Assert: value is non-null.\n        // Note: This operation was done by `HeadersList#toSortedArray`.\n\n        // 3. Append (name, value) to headers.\n        headers.push([name, value])\n      }\n    }\n\n    // 4. Return headers.\n    return (this.#headersList[kHeadersSortedMap] = headers)\n  }\n\n  [util.inspect.custom] (depth, options) {\n    options.depth ??= depth\n\n    return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`\n  }\n\n  static getHeadersGuard (o) {\n    return o.#guard\n  }\n\n  static setHeadersGuard (o, guard) {\n    o.#guard = guard\n  }\n\n  static getHeadersList (o) {\n    return o.#headersList\n  }\n\n  static setHeadersList (o, list) {\n    o.#headersList = list\n  }\n}\n\nconst { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers\nReflect.deleteProperty(Headers, 'getHeadersGuard')\nReflect.deleteProperty(Headers, 'setHeadersGuard')\nReflect.deleteProperty(Headers, 'getHeadersList')\nReflect.deleteProperty(Headers, 'setHeadersList')\n\niteratorMixin('Headers', Headers, kHeadersSortedMap, 0, 1)\n\nObject.defineProperties(Headers.prototype, {\n  append: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  get: kEnumerableProperty,\n  has: kEnumerableProperty,\n  set: kEnumerableProperty,\n  getSetCookie: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Headers',\n    configurable: true\n  },\n  [util.inspect.custom]: {\n    enumerable: false\n  }\n})\n\nwebidl.converters.HeadersInit = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === 'Object') {\n    const iterator = Reflect.get(V, Symbol.iterator)\n\n    // A work-around to ensure we send the properly-cased Headers when V is a Headers object.\n    // Read https://github.com/nodejs/undici/pull/3159#issuecomment-2075537226 before touching, please.\n    if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { // Headers object\n      try {\n        return getHeadersList(V).entriesList\n      } catch {\n        // fall-through\n      }\n    }\n\n    if (typeof iterator === 'function') {\n      return webidl.converters['sequence>'](V, prefix, argument, iterator.bind(V))\n    }\n\n    return webidl.converters['record'](V, prefix, argument)\n  }\n\n  throw webidl.errors.conversionFailed({\n    prefix: 'Headers constructor',\n    argument: 'Argument 1',\n    types: ['sequence>', 'record']\n  })\n}\n\nmodule.exports = {\n  fill,\n  // for test.\n  compareHeaderName,\n  Headers,\n  HeadersList,\n  getHeadersGuard,\n  setHeadersGuard,\n  setHeadersList,\n  getHeadersList\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst {\n  makeNetworkError,\n  makeAppropriateNetworkError,\n  filterResponse,\n  makeResponse,\n  fromInnerResponse\n} = require('./response')\nconst { HeadersList } = require('./headers')\nconst { Request, cloneRequest } = require('./request')\nconst zlib = require('node:zlib')\nconst {\n  bytesMatch,\n  makePolicyContainer,\n  clonePolicyContainer,\n  requestBadPort,\n  TAOCheck,\n  appendRequestOriginHeader,\n  responseLocationURL,\n  requestCurrentURL,\n  setRequestReferrerPolicyOnRedirect,\n  tryUpgradeRequestToAPotentiallyTrustworthyURL,\n  createOpaqueTimingInfo,\n  appendFetchMetadata,\n  corsCheck,\n  crossOriginResourcePolicyCheck,\n  determineRequestsReferrer,\n  coarsenedSharedCurrentTime,\n  createDeferredPromise,\n  isBlobLike,\n  sameOrigin,\n  isCancelled,\n  isAborted,\n  isErrorLike,\n  fullyReadBody,\n  readableStreamClose,\n  isomorphicEncode,\n  urlIsLocal,\n  urlIsHttpHttpsScheme,\n  urlHasHttpsScheme,\n  clampAndCoarsenConnectionTimingInfo,\n  simpleRangeHeaderValue,\n  buildContentRange,\n  createInflate,\n  extractMimeType\n} = require('./util')\nconst { kState, kDispatcher } = require('./symbols')\nconst assert = require('node:assert')\nconst { safelyExtractBody, extractBody } = require('./body')\nconst {\n  redirectStatusSet,\n  nullBodyStatus,\n  safeMethodsSet,\n  requestBodyHeader,\n  subresourceSet\n} = require('./constants')\nconst EE = require('node:events')\nconst { Readable, pipeline, finished } = require('node:stream')\nconst { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url')\nconst { getGlobalDispatcher } = require('../../global')\nconst { webidl } = require('./webidl')\nconst { STATUS_CODES } = require('node:http')\nconst GET_OR_HEAD = ['GET', 'HEAD']\n\nconst defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'\n  ? 'node'\n  : 'undici'\n\n/** @type {import('buffer').resolveObjectURL} */\nlet resolveObjectURL\n\nclass Fetch extends EE {\n  constructor (dispatcher) {\n    super()\n\n    this.dispatcher = dispatcher\n    this.connection = null\n    this.dump = false\n    this.state = 'ongoing'\n  }\n\n  terminate (reason) {\n    if (this.state !== 'ongoing') {\n      return\n    }\n\n    this.state = 'terminated'\n    this.connection?.destroy(reason)\n    this.emit('terminated', reason)\n  }\n\n  // https://fetch.spec.whatwg.org/#fetch-controller-abort\n  abort (error) {\n    if (this.state !== 'ongoing') {\n      return\n    }\n\n    // 1. Set controller’s state to \"aborted\".\n    this.state = 'aborted'\n\n    // 2. Let fallbackError be an \"AbortError\" DOMException.\n    // 3. Set error to fallbackError if it is not given.\n    if (!error) {\n      error = new DOMException('The operation was aborted.', 'AbortError')\n    }\n\n    // 4. Let serializedError be StructuredSerialize(error).\n    //    If that threw an exception, catch it, and let\n    //    serializedError be StructuredSerialize(fallbackError).\n\n    // 5. Set controller’s serialized abort reason to serializedError.\n    this.serializedAbortReason = error\n\n    this.connection?.destroy(error)\n    this.emit('terminated', error)\n  }\n}\n\nfunction handleFetchDone (response) {\n  finalizeAndReportTiming(response, 'fetch')\n}\n\n// https://fetch.spec.whatwg.org/#fetch-method\nfunction fetch (input, init = undefined) {\n  webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')\n\n  // 1. Let p be a new promise.\n  let p = createDeferredPromise()\n\n  // 2. Let requestObject be the result of invoking the initial value of\n  // Request as constructor with input and init as arguments. If this throws\n  // an exception, reject p with it and return p.\n  let requestObject\n\n  try {\n    requestObject = new Request(input, init)\n  } catch (e) {\n    p.reject(e)\n    return p.promise\n  }\n\n  // 3. Let request be requestObject’s request.\n  const request = requestObject[kState]\n\n  // 4. If requestObject’s signal’s aborted flag is set, then:\n  if (requestObject.signal.aborted) {\n    // 1. Abort the fetch() call with p, request, null, and\n    //    requestObject’s signal’s abort reason.\n    abortFetch(p, request, null, requestObject.signal.reason)\n\n    // 2. Return p.\n    return p.promise\n  }\n\n  // 5. Let globalObject be request’s client’s global object.\n  const globalObject = request.client.globalObject\n\n  // 6. If globalObject is a ServiceWorkerGlobalScope object, then set\n  // request’s service-workers mode to \"none\".\n  if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {\n    request.serviceWorkers = 'none'\n  }\n\n  // 7. Let responseObject be null.\n  let responseObject = null\n\n  // 8. Let relevantRealm be this’s relevant Realm.\n\n  // 9. Let locallyAborted be false.\n  let locallyAborted = false\n\n  // 10. Let controller be null.\n  let controller = null\n\n  // 11. Add the following abort steps to requestObject’s signal:\n  addAbortListener(\n    requestObject.signal,\n    () => {\n      // 1. Set locallyAborted to true.\n      locallyAborted = true\n\n      // 2. Assert: controller is non-null.\n      assert(controller != null)\n\n      // 3. Abort controller with requestObject’s signal’s abort reason.\n      controller.abort(requestObject.signal.reason)\n\n      const realResponse = responseObject?.deref()\n\n      // 4. Abort the fetch() call with p, request, responseObject,\n      //    and requestObject’s signal’s abort reason.\n      abortFetch(p, request, realResponse, requestObject.signal.reason)\n    }\n  )\n\n  // 12. Let handleFetchDone given response response be to finalize and\n  // report timing with response, globalObject, and \"fetch\".\n  // see function handleFetchDone\n\n  // 13. Set controller to the result of calling fetch given request,\n  // with processResponseEndOfBody set to handleFetchDone, and processResponse\n  // given response being these substeps:\n\n  const processResponse = (response) => {\n    // 1. If locallyAborted is true, terminate these substeps.\n    if (locallyAborted) {\n      return\n    }\n\n    // 2. If response’s aborted flag is set, then:\n    if (response.aborted) {\n      // 1. Let deserializedError be the result of deserialize a serialized\n      //    abort reason given controller’s serialized abort reason and\n      //    relevantRealm.\n\n      // 2. Abort the fetch() call with p, request, responseObject, and\n      //    deserializedError.\n\n      abortFetch(p, request, responseObject, controller.serializedAbortReason)\n      return\n    }\n\n    // 3. If response is a network error, then reject p with a TypeError\n    // and terminate these substeps.\n    if (response.type === 'error') {\n      p.reject(new TypeError('fetch failed', { cause: response.error }))\n      return\n    }\n\n    // 4. Set responseObject to the result of creating a Response object,\n    // given response, \"immutable\", and relevantRealm.\n    responseObject = new WeakRef(fromInnerResponse(response, 'immutable'))\n\n    // 5. Resolve p with responseObject.\n    p.resolve(responseObject.deref())\n    p = null\n  }\n\n  controller = fetching({\n    request,\n    processResponseEndOfBody: handleFetchDone,\n    processResponse,\n    dispatcher: requestObject[kDispatcher] // undici\n  })\n\n  // 14. Return p.\n  return p.promise\n}\n\n// https://fetch.spec.whatwg.org/#finalize-and-report-timing\nfunction finalizeAndReportTiming (response, initiatorType = 'other') {\n  // 1. If response is an aborted network error, then return.\n  if (response.type === 'error' && response.aborted) {\n    return\n  }\n\n  // 2. If response’s URL list is null or empty, then return.\n  if (!response.urlList?.length) {\n    return\n  }\n\n  // 3. Let originalURL be response’s URL list[0].\n  const originalURL = response.urlList[0]\n\n  // 4. Let timingInfo be response’s timing info.\n  let timingInfo = response.timingInfo\n\n  // 5. Let cacheState be response’s cache state.\n  let cacheState = response.cacheState\n\n  // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.\n  if (!urlIsHttpHttpsScheme(originalURL)) {\n    return\n  }\n\n  // 7. If timingInfo is null, then return.\n  if (timingInfo === null) {\n    return\n  }\n\n  // 8. If response’s timing allow passed flag is not set, then:\n  if (!response.timingAllowPassed) {\n    //  1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.\n    timingInfo = createOpaqueTimingInfo({\n      startTime: timingInfo.startTime\n    })\n\n    //  2. Set cacheState to the empty string.\n    cacheState = ''\n  }\n\n  // 9. Set timingInfo’s end time to the coarsened shared current time\n  // given global’s relevant settings object’s cross-origin isolated\n  // capability.\n  // TODO: given global’s relevant settings object’s cross-origin isolated\n  // capability?\n  timingInfo.endTime = coarsenedSharedCurrentTime()\n\n  // 10. Set response’s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 11. Mark resource timing for timingInfo, originalURL, initiatorType,\n  // global, and cacheState.\n  markResourceTiming(\n    timingInfo,\n    originalURL.href,\n    initiatorType,\n    globalThis,\n    cacheState\n  )\n}\n\n// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing\nconst markResourceTiming = performance.markResourceTiming\n\n// https://fetch.spec.whatwg.org/#abort-fetch\nfunction abortFetch (p, request, responseObject, error) {\n  // 1. Reject promise with error.\n  if (p) {\n    // We might have already resolved the promise at this stage\n    p.reject(error)\n  }\n\n  // 2. If request’s body is not null and is readable, then cancel request’s\n  // body with error.\n  if (request.body != null && isReadable(request.body?.stream)) {\n    request.body.stream.cancel(error).catch((err) => {\n      if (err.code === 'ERR_INVALID_STATE') {\n        // Node bug?\n        return\n      }\n      throw err\n    })\n  }\n\n  // 3. If responseObject is null, then return.\n  if (responseObject == null) {\n    return\n  }\n\n  // 4. Let response be responseObject’s response.\n  const response = responseObject[kState]\n\n  // 5. If response’s body is not null and is readable, then error response’s\n  // body with error.\n  if (response.body != null && isReadable(response.body?.stream)) {\n    response.body.stream.cancel(error).catch((err) => {\n      if (err.code === 'ERR_INVALID_STATE') {\n        // Node bug?\n        return\n      }\n      throw err\n    })\n  }\n}\n\n// https://fetch.spec.whatwg.org/#fetching\nfunction fetching ({\n  request,\n  processRequestBodyChunkLength,\n  processRequestEndOfBody,\n  processResponse,\n  processResponseEndOfBody,\n  processResponseConsumeBody,\n  useParallelQueue = false,\n  dispatcher = getGlobalDispatcher() // undici\n}) {\n  // Ensure that the dispatcher is set accordingly\n  assert(dispatcher)\n\n  // 1. Let taskDestination be null.\n  let taskDestination = null\n\n  // 2. Let crossOriginIsolatedCapability be false.\n  let crossOriginIsolatedCapability = false\n\n  // 3. If request’s client is non-null, then:\n  if (request.client != null) {\n    // 1. Set taskDestination to request’s client’s global object.\n    taskDestination = request.client.globalObject\n\n    // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin\n    // isolated capability.\n    crossOriginIsolatedCapability =\n      request.client.crossOriginIsolatedCapability\n  }\n\n  // 4. If useParallelQueue is true, then set taskDestination to the result of\n  // starting a new parallel queue.\n  // TODO\n\n  // 5. Let timingInfo be a new fetch timing info whose start time and\n  // post-redirect start time are the coarsened shared current time given\n  // crossOriginIsolatedCapability.\n  const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)\n  const timingInfo = createOpaqueTimingInfo({\n    startTime: currentTime\n  })\n\n  // 6. Let fetchParams be a new fetch params whose\n  // request is request,\n  // timing info is timingInfo,\n  // process request body chunk length is processRequestBodyChunkLength,\n  // process request end-of-body is processRequestEndOfBody,\n  // process response is processResponse,\n  // process response consume body is processResponseConsumeBody,\n  // process response end-of-body is processResponseEndOfBody,\n  // task destination is taskDestination,\n  // and cross-origin isolated capability is crossOriginIsolatedCapability.\n  const fetchParams = {\n    controller: new Fetch(dispatcher),\n    request,\n    timingInfo,\n    processRequestBodyChunkLength,\n    processRequestEndOfBody,\n    processResponse,\n    processResponseConsumeBody,\n    processResponseEndOfBody,\n    taskDestination,\n    crossOriginIsolatedCapability\n  }\n\n  // 7. If request’s body is a byte sequence, then set request’s body to\n  //    request’s body as a body.\n  // NOTE: Since fetching is only called from fetch, body should already be\n  // extracted.\n  assert(!request.body || request.body.stream)\n\n  // 8. If request’s window is \"client\", then set request’s window to request’s\n  // client, if request’s client’s global object is a Window object; otherwise\n  // \"no-window\".\n  if (request.window === 'client') {\n    // TODO: What if request.client is null?\n    request.window =\n      request.client?.globalObject?.constructor?.name === 'Window'\n        ? request.client\n        : 'no-window'\n  }\n\n  // 9. If request’s origin is \"client\", then set request’s origin to request’s\n  // client’s origin.\n  if (request.origin === 'client') {\n    request.origin = request.client.origin\n  }\n\n  // 10. If all of the following conditions are true:\n  // TODO\n\n  // 11. If request’s policy container is \"client\", then:\n  if (request.policyContainer === 'client') {\n    // 1. If request’s client is non-null, then set request’s policy\n    // container to a clone of request’s client’s policy container. [HTML]\n    if (request.client != null) {\n      request.policyContainer = clonePolicyContainer(\n        request.client.policyContainer\n      )\n    } else {\n      // 2. Otherwise, set request’s policy container to a new policy\n      // container.\n      request.policyContainer = makePolicyContainer()\n    }\n  }\n\n  // 12. If request’s header list does not contain `Accept`, then:\n  if (!request.headersList.contains('accept', true)) {\n    // 1. Let value be `*/*`.\n    const value = '*/*'\n\n    // 2. A user agent should set value to the first matching statement, if\n    // any, switching on request’s destination:\n    // \"document\"\n    // \"frame\"\n    // \"iframe\"\n    // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`\n    // \"image\"\n    // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`\n    // \"style\"\n    // `text/css,*/*;q=0.1`\n    // TODO\n\n    // 3. Append `Accept`/value to request’s header list.\n    request.headersList.append('accept', value, true)\n  }\n\n  // 13. If request’s header list does not contain `Accept-Language`, then\n  // user agents should append `Accept-Language`/an appropriate value to\n  // request’s header list.\n  if (!request.headersList.contains('accept-language', true)) {\n    request.headersList.append('accept-language', '*', true)\n  }\n\n  // 14. If request’s priority is null, then use request’s initiator and\n  // destination appropriately in setting request’s priority to a\n  // user-agent-defined object.\n  if (request.priority === null) {\n    // TODO\n  }\n\n  // 15. If request is a subresource request, then:\n  if (subresourceSet.has(request.destination)) {\n    // TODO\n  }\n\n  // 16. Run main fetch given fetchParams.\n  mainFetch(fetchParams)\n    .catch(err => {\n      fetchParams.controller.terminate(err)\n    })\n\n  // 17. Return fetchParam's controller\n  return fetchParams.controller\n}\n\n// https://fetch.spec.whatwg.org/#concept-main-fetch\nasync function mainFetch (fetchParams, recursive = false) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. If request’s local-URLs-only flag is set and request’s current URL is\n  // not local, then set response to a network error.\n  if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n    response = makeNetworkError('local URLs only')\n  }\n\n  // 4. Run report Content Security Policy violations for request.\n  // TODO\n\n  // 5. Upgrade request to a potentially trustworthy URL, if appropriate.\n  tryUpgradeRequestToAPotentiallyTrustworthyURL(request)\n\n  // 6. If should request be blocked due to a bad port, should fetching request\n  // be blocked as mixed content, or should request be blocked by Content\n  // Security Policy returns blocked, then set response to a network error.\n  if (requestBadPort(request) === 'blocked') {\n    response = makeNetworkError('bad port')\n  }\n  // TODO: should fetching request be blocked as mixed content?\n  // TODO: should request be blocked by Content Security Policy?\n\n  // 7. If request’s referrer policy is the empty string, then set request’s\n  // referrer policy to request’s policy container’s referrer policy.\n  if (request.referrerPolicy === '') {\n    request.referrerPolicy = request.policyContainer.referrerPolicy\n  }\n\n  // 8. If request’s referrer is not \"no-referrer\", then set request’s\n  // referrer to the result of invoking determine request’s referrer.\n  if (request.referrer !== 'no-referrer') {\n    request.referrer = determineRequestsReferrer(request)\n  }\n\n  // 9. Set request’s current URL’s scheme to \"https\" if all of the following\n  // conditions are true:\n  // - request’s current URL’s scheme is \"http\"\n  // - request’s current URL’s host is a domain\n  // - Matching request’s current URL’s host per Known HSTS Host Domain Name\n  //   Matching results in either a superdomain match with an asserted\n  //   includeSubDomains directive or a congruent match (with or without an\n  //   asserted includeSubDomains directive). [HSTS]\n  // TODO\n\n  // 10. If recursive is false, then run the remaining steps in parallel.\n  // TODO\n\n  // 11. If response is null, then set response to the result of running\n  // the steps corresponding to the first matching statement:\n  if (response === null) {\n    response = await (async () => {\n      const currentURL = requestCurrentURL(request)\n\n      if (\n        // - request’s current URL’s origin is same origin with request’s origin,\n        //   and request’s response tainting is \"basic\"\n        (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||\n        // request’s current URL’s scheme is \"data\"\n        (currentURL.protocol === 'data:') ||\n        // - request’s mode is \"navigate\" or \"websocket\"\n        (request.mode === 'navigate' || request.mode === 'websocket')\n      ) {\n        // 1. Set request’s response tainting to \"basic\".\n        request.responseTainting = 'basic'\n\n        // 2. Return the result of running scheme fetch given fetchParams.\n        return await schemeFetch(fetchParams)\n      }\n\n      // request’s mode is \"same-origin\"\n      if (request.mode === 'same-origin') {\n        // 1. Return a network error.\n        return makeNetworkError('request mode cannot be \"same-origin\"')\n      }\n\n      // request’s mode is \"no-cors\"\n      if (request.mode === 'no-cors') {\n        // 1. If request’s redirect mode is not \"follow\", then return a network\n        // error.\n        if (request.redirect !== 'follow') {\n          return makeNetworkError(\n            'redirect mode cannot be \"follow\" for \"no-cors\" request'\n          )\n        }\n\n        // 2. Set request’s response tainting to \"opaque\".\n        request.responseTainting = 'opaque'\n\n        // 3. Return the result of running scheme fetch given fetchParams.\n        return await schemeFetch(fetchParams)\n      }\n\n      // request’s current URL’s scheme is not an HTTP(S) scheme\n      if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n        // Return a network error.\n        return makeNetworkError('URL scheme must be a HTTP(S) scheme')\n      }\n\n      // - request’s use-CORS-preflight flag is set\n      // - request’s unsafe-request flag is set and either request’s method is\n      //   not a CORS-safelisted method or CORS-unsafe request-header names with\n      //   request’s header list is not empty\n      //    1. Set request’s response tainting to \"cors\".\n      //    2. Let corsWithPreflightResponse be the result of running HTTP fetch\n      //    given fetchParams and true.\n      //    3. If corsWithPreflightResponse is a network error, then clear cache\n      //    entries using request.\n      //    4. Return corsWithPreflightResponse.\n      // TODO\n\n      // Otherwise\n      //    1. Set request’s response tainting to \"cors\".\n      request.responseTainting = 'cors'\n\n      //    2. Return the result of running HTTP fetch given fetchParams.\n      return await httpFetch(fetchParams)\n    })()\n  }\n\n  // 12. If recursive is true, then return response.\n  if (recursive) {\n    return response\n  }\n\n  // 13. If response is not a network error and response is not a filtered\n  // response, then:\n  if (response.status !== 0 && !response.internalResponse) {\n    // If request’s response tainting is \"cors\", then:\n    if (request.responseTainting === 'cors') {\n      // 1. Let headerNames be the result of extracting header list values\n      // given `Access-Control-Expose-Headers` and response’s header list.\n      // TODO\n      // 2. If request’s credentials mode is not \"include\" and headerNames\n      // contains `*`, then set response’s CORS-exposed header-name list to\n      // all unique header names in response’s header list.\n      // TODO\n      // 3. Otherwise, if headerNames is not null or failure, then set\n      // response’s CORS-exposed header-name list to headerNames.\n      // TODO\n    }\n\n    // Set response to the following filtered response with response as its\n    // internal response, depending on request’s response tainting:\n    if (request.responseTainting === 'basic') {\n      response = filterResponse(response, 'basic')\n    } else if (request.responseTainting === 'cors') {\n      response = filterResponse(response, 'cors')\n    } else if (request.responseTainting === 'opaque') {\n      response = filterResponse(response, 'opaque')\n    } else {\n      assert(false)\n    }\n  }\n\n  // 14. Let internalResponse be response, if response is a network error,\n  // and response’s internal response otherwise.\n  let internalResponse =\n    response.status === 0 ? response : response.internalResponse\n\n  // 15. If internalResponse’s URL list is empty, then set it to a clone of\n  // request’s URL list.\n  if (internalResponse.urlList.length === 0) {\n    internalResponse.urlList.push(...request.urlList)\n  }\n\n  // 16. If request’s timing allow failed flag is unset, then set\n  // internalResponse’s timing allow passed flag.\n  if (!request.timingAllowFailed) {\n    response.timingAllowPassed = true\n  }\n\n  // 17. If response is not a network error and any of the following returns\n  // blocked\n  // - should internalResponse to request be blocked as mixed content\n  // - should internalResponse to request be blocked by Content Security Policy\n  // - should internalResponse to request be blocked due to its MIME type\n  // - should internalResponse to request be blocked due to nosniff\n  // TODO\n\n  // 18. If response’s type is \"opaque\", internalResponse’s status is 206,\n  // internalResponse’s range-requested flag is set, and request’s header\n  // list does not contain `Range`, then set response and internalResponse\n  // to a network error.\n  if (\n    response.type === 'opaque' &&\n    internalResponse.status === 206 &&\n    internalResponse.rangeRequested &&\n    !request.headers.contains('range', true)\n  ) {\n    response = internalResponse = makeNetworkError()\n  }\n\n  // 19. If response is not a network error and either request’s method is\n  // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,\n  // set internalResponse’s body to null and disregard any enqueuing toward\n  // it (if any).\n  if (\n    response.status !== 0 &&\n    (request.method === 'HEAD' ||\n      request.method === 'CONNECT' ||\n      nullBodyStatus.includes(internalResponse.status))\n  ) {\n    internalResponse.body = null\n    fetchParams.controller.dump = true\n  }\n\n  // 20. If request’s integrity metadata is not the empty string, then:\n  if (request.integrity) {\n    // 1. Let processBodyError be this step: run fetch finale given fetchParams\n    // and a network error.\n    const processBodyError = (reason) =>\n      fetchFinale(fetchParams, makeNetworkError(reason))\n\n    // 2. If request’s response tainting is \"opaque\", or response’s body is null,\n    // then run processBodyError and abort these steps.\n    if (request.responseTainting === 'opaque' || response.body == null) {\n      processBodyError(response.error)\n      return\n    }\n\n    // 3. Let processBody given bytes be these steps:\n    const processBody = (bytes) => {\n      // 1. If bytes do not match request’s integrity metadata,\n      // then run processBodyError and abort these steps. [SRI]\n      if (!bytesMatch(bytes, request.integrity)) {\n        processBodyError('integrity mismatch')\n        return\n      }\n\n      // 2. Set response’s body to bytes as a body.\n      response.body = safelyExtractBody(bytes)[0]\n\n      // 3. Run fetch finale given fetchParams and response.\n      fetchFinale(fetchParams, response)\n    }\n\n    // 4. Fully read response’s body given processBody and processBodyError.\n    await fullyReadBody(response.body, processBody, processBodyError)\n  } else {\n    // 21. Otherwise, run fetch finale given fetchParams and response.\n    fetchFinale(fetchParams, response)\n  }\n}\n\n// https://fetch.spec.whatwg.org/#concept-scheme-fetch\n// given a fetch params fetchParams\nfunction schemeFetch (fetchParams) {\n  // Note: since the connection is destroyed on redirect, which sets fetchParams to a\n  // cancelled state, we do not want this condition to trigger *unless* there have been\n  // no redirects. See https://github.com/nodejs/undici/issues/1776\n  // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n  if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n    return Promise.resolve(makeAppropriateNetworkError(fetchParams))\n  }\n\n  // 2. Let request be fetchParams’s request.\n  const { request } = fetchParams\n\n  const { protocol: scheme } = requestCurrentURL(request)\n\n  // 3. Switch on request’s current URL’s scheme and run the associated steps:\n  switch (scheme) {\n    case 'about:': {\n      // If request’s current URL’s path is the string \"blank\", then return a new response\n      // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,\n      // and body is the empty byte sequence as a body.\n\n      // Otherwise, return a network error.\n      return Promise.resolve(makeNetworkError('about scheme is not supported'))\n    }\n    case 'blob:': {\n      if (!resolveObjectURL) {\n        resolveObjectURL = require('node:buffer').resolveObjectURL\n      }\n\n      // 1. Let blobURLEntry be request’s current URL’s blob URL entry.\n      const blobURLEntry = requestCurrentURL(request)\n\n      // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56\n      // Buffer.resolveObjectURL does not ignore URL queries.\n      if (blobURLEntry.search.length !== 0) {\n        return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))\n      }\n\n      const blob = resolveObjectURL(blobURLEntry.toString())\n\n      // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s\n      //    object is not a Blob object, then return a network error.\n      if (request.method !== 'GET' || !isBlobLike(blob)) {\n        return Promise.resolve(makeNetworkError('invalid method'))\n      }\n\n      // 3. Let blob be blobURLEntry’s object.\n      // Note: done above\n\n      // 4. Let response be a new response.\n      const response = makeResponse()\n\n      // 5. Let fullLength be blob’s size.\n      const fullLength = blob.size\n\n      // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.\n      const serializedFullLength = isomorphicEncode(`${fullLength}`)\n\n      // 7. Let type be blob’s type.\n      const type = blob.type\n\n      // 8. If request’s header list does not contain `Range`:\n      // 9. Otherwise:\n      if (!request.headersList.contains('range', true)) {\n        // 1. Let bodyWithType be the result of safely extracting blob.\n        // Note: in the FileAPI a blob \"object\" is a Blob *or* a MediaSource.\n        // In node, this can only ever be a Blob. Therefore we can safely\n        // use extractBody directly.\n        const bodyWithType = extractBody(blob)\n\n        // 2. Set response’s status message to `OK`.\n        response.statusText = 'OK'\n\n        // 3. Set response’s body to bodyWithType’s body.\n        response.body = bodyWithType[0]\n\n        // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».\n        response.headersList.set('content-length', serializedFullLength, true)\n        response.headersList.set('content-type', type, true)\n      } else {\n        // 1. Set response’s range-requested flag.\n        response.rangeRequested = true\n\n        // 2. Let rangeHeader be the result of getting `Range` from request’s header list.\n        const rangeHeader = request.headersList.get('range', true)\n\n        // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true.\n        const rangeValue = simpleRangeHeaderValue(rangeHeader, true)\n\n        // 4. If rangeValue is failure, then return a network error.\n        if (rangeValue === 'failure') {\n          return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n        }\n\n        // 5. Let (rangeStart, rangeEnd) be rangeValue.\n        let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue\n\n        // 6. If rangeStart is null:\n        // 7. Otherwise:\n        if (rangeStart === null) {\n          // 1. Set rangeStart to fullLength − rangeEnd.\n          rangeStart = fullLength - rangeEnd\n\n          // 2. Set rangeEnd to rangeStart + rangeEnd − 1.\n          rangeEnd = rangeStart + rangeEnd - 1\n        } else {\n          // 1. If rangeStart is greater than or equal to fullLength, then return a network error.\n          if (rangeStart >= fullLength) {\n            return Promise.resolve(makeNetworkError('Range start is greater than the blob\\'s size.'))\n          }\n\n          // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set\n          //    rangeEnd to fullLength − 1.\n          if (rangeEnd === null || rangeEnd >= fullLength) {\n            rangeEnd = fullLength - 1\n          }\n        }\n\n        // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,\n        //    rangeEnd + 1, and type.\n        const slicedBlob = blob.slice(rangeStart, rangeEnd, type)\n\n        // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.\n        // Note: same reason as mentioned above as to why we use extractBody\n        const slicedBodyWithType = extractBody(slicedBlob)\n\n        // 10. Set response’s body to slicedBodyWithType’s body.\n        response.body = slicedBodyWithType[0]\n\n        // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.\n        const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`)\n\n        // 12. Let contentRange be the result of invoking build a content range given rangeStart,\n        //     rangeEnd, and fullLength.\n        const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength)\n\n        // 13. Set response’s status to 206.\n        response.status = 206\n\n        // 14. Set response’s status message to `Partial Content`.\n        response.statusText = 'Partial Content'\n\n        // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength),\n        //     (`Content-Type`, type), (`Content-Range`, contentRange) ».\n        response.headersList.set('content-length', serializedSlicedLength, true)\n        response.headersList.set('content-type', type, true)\n        response.headersList.set('content-range', contentRange, true)\n      }\n\n      // 10. Return response.\n      return Promise.resolve(response)\n    }\n    case 'data:': {\n      // 1. Let dataURLStruct be the result of running the\n      //    data: URL processor on request’s current URL.\n      const currentURL = requestCurrentURL(request)\n      const dataURLStruct = dataURLProcessor(currentURL)\n\n      // 2. If dataURLStruct is failure, then return a\n      //    network error.\n      if (dataURLStruct === 'failure') {\n        return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n      }\n\n      // 3. Let mimeType be dataURLStruct’s MIME type, serialized.\n      const mimeType = serializeAMimeType(dataURLStruct.mimeType)\n\n      // 4. Return a response whose status message is `OK`,\n      //    header list is « (`Content-Type`, mimeType) »,\n      //    and body is dataURLStruct’s body as a body.\n      return Promise.resolve(makeResponse({\n        statusText: 'OK',\n        headersList: [\n          ['content-type', { name: 'Content-Type', value: mimeType }]\n        ],\n        body: safelyExtractBody(dataURLStruct.body)[0]\n      }))\n    }\n    case 'file:': {\n      // For now, unfortunate as it is, file URLs are left as an exercise for the reader.\n      // When in doubt, return a network error.\n      return Promise.resolve(makeNetworkError('not implemented... yet...'))\n    }\n    case 'http:':\n    case 'https:': {\n      // Return the result of running HTTP fetch given fetchParams.\n\n      return httpFetch(fetchParams)\n        .catch((err) => makeNetworkError(err))\n    }\n    default: {\n      return Promise.resolve(makeNetworkError('unknown scheme'))\n    }\n  }\n}\n\n// https://fetch.spec.whatwg.org/#finalize-response\nfunction finalizeResponse (fetchParams, response) {\n  // 1. Set fetchParams’s request’s done flag.\n  fetchParams.request.done = true\n\n  // 2, If fetchParams’s process response done is not null, then queue a fetch\n  // task to run fetchParams’s process response done given response, with\n  // fetchParams’s task destination.\n  if (fetchParams.processResponseDone != null) {\n    queueMicrotask(() => fetchParams.processResponseDone(response))\n  }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-finale\nfunction fetchFinale (fetchParams, response) {\n  // 1. Let timingInfo be fetchParams’s timing info.\n  let timingInfo = fetchParams.timingInfo\n\n  // 2. If response is not a network error and fetchParams’s request’s client is a secure context,\n  //    then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting\n  //    `Server-Timing` from response’s internal response’s header list.\n  // TODO\n\n  // 3. Let processResponseEndOfBody be the following steps:\n  const processResponseEndOfBody = () => {\n    // 1. Let unsafeEndTime be the unsafe shared current time.\n    const unsafeEndTime = Date.now() // ?\n\n    // 2. If fetchParams’s request’s destination is \"document\", then set fetchParams’s controller’s\n    //    full timing info to fetchParams’s timing info.\n    if (fetchParams.request.destination === 'document') {\n      fetchParams.controller.fullTimingInfo = timingInfo\n    }\n\n    // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:\n    fetchParams.controller.reportTimingSteps = () => {\n      // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.\n      if (fetchParams.request.url.protocol !== 'https:') {\n        return\n      }\n\n      // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global.\n      timingInfo.endTime = unsafeEndTime\n\n      // 3. Let cacheState be response’s cache state.\n      let cacheState = response.cacheState\n\n      // 4. Let bodyInfo be response’s body info.\n      const bodyInfo = response.bodyInfo\n\n      // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an\n      //    opaque timing info for timingInfo and set cacheState to the empty string.\n      if (!response.timingAllowPassed) {\n        timingInfo = createOpaqueTimingInfo(timingInfo)\n\n        cacheState = ''\n      }\n\n      // 6. Let responseStatus be 0.\n      let responseStatus = 0\n\n      // 7. If fetchParams’s request’s mode is not \"navigate\" or response’s has-cross-origin-redirects is false:\n      if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {\n        // 1. Set responseStatus to response’s status.\n        responseStatus = response.status\n\n        // 2. Let mimeType be the result of extracting a MIME type from response’s header list.\n        const mimeType = extractMimeType(response.headersList)\n\n        // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType.\n        if (mimeType !== 'failure') {\n          bodyInfo.contentType = minimizeSupportedMimeType(mimeType)\n        }\n      }\n\n      // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo,\n      //    fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,\n      //    and responseStatus.\n      if (fetchParams.request.initiatorType != null) {\n        // TODO: update markresourcetiming\n        markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)\n      }\n    }\n\n    // 4. Let processResponseEndOfBodyTask be the following steps:\n    const processResponseEndOfBodyTask = () => {\n      // 1. Set fetchParams’s request’s done flag.\n      fetchParams.request.done = true\n\n      // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process\n      //    response end-of-body given response.\n      if (fetchParams.processResponseEndOfBody != null) {\n        queueMicrotask(() => fetchParams.processResponseEndOfBody(response))\n      }\n\n      // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s\n      //    global object is fetchParams’s task destination, then run fetchParams’s controller’s report\n      //    timing steps given fetchParams’s request’s client’s global object.\n      if (fetchParams.request.initiatorType != null) {\n        fetchParams.controller.reportTimingSteps()\n      }\n    }\n\n    // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination\n    queueMicrotask(() => processResponseEndOfBodyTask())\n  }\n\n  // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s\n  //    process response given response, with fetchParams’s task destination.\n  if (fetchParams.processResponse != null) {\n    queueMicrotask(() => {\n      fetchParams.processResponse(response)\n      fetchParams.processResponse = null\n    })\n  }\n\n  // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.\n  const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)\n\n  // 6. If internalResponse’s body is null, then run processResponseEndOfBody.\n  // 7. Otherwise:\n  if (internalResponse.body == null) {\n    processResponseEndOfBody()\n  } else {\n    // mcollina: all the following steps of the specs are skipped.\n    // The internal transform stream is not needed.\n    // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541\n\n    // 1. Let transformStream be a new TransformStream.\n    // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream.\n    // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm\n    //    set to processResponseEndOfBody.\n    // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.\n\n    finished(internalResponse.body.stream, () => {\n      processResponseEndOfBody()\n    })\n  }\n}\n\n// https://fetch.spec.whatwg.org/#http-fetch\nasync function httpFetch (fetchParams) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let actualResponse be null.\n  let actualResponse = null\n\n  // 4. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 5. If request’s service-workers mode is \"all\", then:\n  if (request.serviceWorkers === 'all') {\n    // TODO\n  }\n\n  // 6. If response is null, then:\n  if (response === null) {\n    // 1. If makeCORSPreflight is true and one of these conditions is true:\n    // TODO\n\n    // 2. If request’s redirect mode is \"follow\", then set request’s\n    // service-workers mode to \"none\".\n    if (request.redirect === 'follow') {\n      request.serviceWorkers = 'none'\n    }\n\n    // 3. Set response and actualResponse to the result of running\n    // HTTP-network-or-cache fetch given fetchParams.\n    actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n    // 4. If request’s response tainting is \"cors\" and a CORS check\n    // for request and response returns failure, then return a network error.\n    if (\n      request.responseTainting === 'cors' &&\n      corsCheck(request, response) === 'failure'\n    ) {\n      return makeNetworkError('cors failure')\n    }\n\n    // 5. If the TAO check for request and response returns failure, then set\n    // request’s timing allow failed flag.\n    if (TAOCheck(request, response) === 'failure') {\n      request.timingAllowFailed = true\n    }\n  }\n\n  // 7. If either request’s response tainting or response’s type\n  // is \"opaque\", and the cross-origin resource policy check with\n  // request’s origin, request’s client, request’s destination,\n  // and actualResponse returns blocked, then return a network error.\n  if (\n    (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n    crossOriginResourcePolicyCheck(\n      request.origin,\n      request.client,\n      request.destination,\n      actualResponse\n    ) === 'blocked'\n  ) {\n    return makeNetworkError('blocked')\n  }\n\n  // 8. If actualResponse’s status is a redirect status, then:\n  if (redirectStatusSet.has(actualResponse.status)) {\n    // 1. If actualResponse’s status is not 303, request’s body is not null,\n    // and the connection uses HTTP/2, then user agents may, and are even\n    // encouraged to, transmit an RST_STREAM frame.\n    // See, https://github.com/whatwg/fetch/issues/1288\n    if (request.redirect !== 'manual') {\n      fetchParams.controller.connection.destroy(undefined, false)\n    }\n\n    // 2. Switch on request’s redirect mode:\n    if (request.redirect === 'error') {\n      // Set response to a network error.\n      response = makeNetworkError('unexpected redirect')\n    } else if (request.redirect === 'manual') {\n      // Set response to an opaque-redirect filtered response whose internal\n      // response is actualResponse.\n      // NOTE(spec): On the web this would return an `opaqueredirect` response,\n      // but that doesn't make sense server side.\n      // See https://github.com/nodejs/undici/issues/1193.\n      response = actualResponse\n    } else if (request.redirect === 'follow') {\n      // Set response to the result of running HTTP-redirect fetch given\n      // fetchParams and response.\n      response = await httpRedirectFetch(fetchParams, response)\n    } else {\n      assert(false)\n    }\n  }\n\n  // 9. Set response’s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 10. Return response.\n  return response\n}\n\n// https://fetch.spec.whatwg.org/#http-redirect-fetch\nfunction httpRedirectFetch (fetchParams, response) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let actualResponse be response, if response is not a filtered response,\n  // and response’s internal response otherwise.\n  const actualResponse = response.internalResponse\n    ? response.internalResponse\n    : response\n\n  // 3. Let locationURL be actualResponse’s location URL given request’s current\n  // URL’s fragment.\n  let locationURL\n\n  try {\n    locationURL = responseLocationURL(\n      actualResponse,\n      requestCurrentURL(request).hash\n    )\n\n    // 4. If locationURL is null, then return response.\n    if (locationURL == null) {\n      return response\n    }\n  } catch (err) {\n    // 5. If locationURL is failure, then return a network error.\n    return Promise.resolve(makeNetworkError(err))\n  }\n\n  // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network\n  // error.\n  if (!urlIsHttpHttpsScheme(locationURL)) {\n    return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))\n  }\n\n  // 7. If request’s redirect count is 20, then return a network error.\n  if (request.redirectCount === 20) {\n    return Promise.resolve(makeNetworkError('redirect count exceeded'))\n  }\n\n  // 8. Increase request’s redirect count by 1.\n  request.redirectCount += 1\n\n  // 9. If request’s mode is \"cors\", locationURL includes credentials, and\n  // request’s origin is not same origin with locationURL’s origin, then return\n  //  a network error.\n  if (\n    request.mode === 'cors' &&\n    (locationURL.username || locationURL.password) &&\n    !sameOrigin(request, locationURL)\n  ) {\n    return Promise.resolve(makeNetworkError('cross origin not allowed for request mode \"cors\"'))\n  }\n\n  // 10. If request’s response tainting is \"cors\" and locationURL includes\n  // credentials, then return a network error.\n  if (\n    request.responseTainting === 'cors' &&\n    (locationURL.username || locationURL.password)\n  ) {\n    return Promise.resolve(makeNetworkError(\n      'URL cannot contain credentials for request mode \"cors\"'\n    ))\n  }\n\n  // 11. If actualResponse’s status is not 303, request’s body is non-null,\n  // and request’s body’s source is null, then return a network error.\n  if (\n    actualResponse.status !== 303 &&\n    request.body != null &&\n    request.body.source == null\n  ) {\n    return Promise.resolve(makeNetworkError())\n  }\n\n  // 12. If one of the following is true\n  // - actualResponse’s status is 301 or 302 and request’s method is `POST`\n  // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`\n  if (\n    ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||\n    (actualResponse.status === 303 &&\n      !GET_OR_HEAD.includes(request.method))\n  ) {\n    // then:\n    // 1. Set request’s method to `GET` and request’s body to null.\n    request.method = 'GET'\n    request.body = null\n\n    // 2. For each headerName of request-body-header name, delete headerName from\n    // request’s header list.\n    for (const headerName of requestBodyHeader) {\n      request.headersList.delete(headerName)\n    }\n  }\n\n  // 13. If request’s current URL’s origin is not same origin with locationURL’s\n  //     origin, then for each headerName of CORS non-wildcard request-header name,\n  //     delete headerName from request’s header list.\n  if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n    // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name\n    request.headersList.delete('authorization', true)\n\n    // https://fetch.spec.whatwg.org/#authentication-entries\n    request.headersList.delete('proxy-authorization', true)\n\n    // \"Cookie\" and \"Host\" are forbidden request-headers, which undici doesn't implement.\n    request.headersList.delete('cookie', true)\n    request.headersList.delete('host', true)\n  }\n\n  // 14. If request’s body is non-null, then set request’s body to the first return\n  // value of safely extracting request’s body’s source.\n  if (request.body != null) {\n    assert(request.body.source != null)\n    request.body = safelyExtractBody(request.body.source)[0]\n  }\n\n  // 15. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 16. Set timingInfo’s redirect end time and post-redirect start time to the\n  // coarsened shared current time given fetchParams’s cross-origin isolated\n  // capability.\n  timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =\n    coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n\n  // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s\n  //  redirect start time to timingInfo’s start time.\n  if (timingInfo.redirectStartTime === 0) {\n    timingInfo.redirectStartTime = timingInfo.startTime\n  }\n\n  // 18. Append locationURL to request’s URL list.\n  request.urlList.push(locationURL)\n\n  // 19. Invoke set request’s referrer policy on redirect on request and\n  // actualResponse.\n  setRequestReferrerPolicyOnRedirect(request, actualResponse)\n\n  // 20. Return the result of running main fetch given fetchParams and true.\n  return mainFetch(fetchParams, true)\n}\n\n// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch\nasync function httpNetworkOrCacheFetch (\n  fetchParams,\n  isAuthenticationFetch = false,\n  isNewConnectionFetch = false\n) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let httpFetchParams be null.\n  let httpFetchParams = null\n\n  // 3. Let httpRequest be null.\n  let httpRequest = null\n\n  // 4. Let response be null.\n  let response = null\n\n  // 5. Let storedResponse be null.\n  // TODO: cache\n\n  // 6. Let httpCache be null.\n  const httpCache = null\n\n  // 7. Let the revalidatingFlag be unset.\n  const revalidatingFlag = false\n\n  // 8. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. If request’s window is \"no-window\" and request’s redirect mode is\n  //    \"error\", then set httpFetchParams to fetchParams and httpRequest to\n  //    request.\n  if (request.window === 'no-window' && request.redirect === 'error') {\n    httpFetchParams = fetchParams\n    httpRequest = request\n  } else {\n    // Otherwise:\n\n    // 1. Set httpRequest to a clone of request.\n    httpRequest = cloneRequest(request)\n\n    // 2. Set httpFetchParams to a copy of fetchParams.\n    httpFetchParams = { ...fetchParams }\n\n    // 3. Set httpFetchParams’s request to httpRequest.\n    httpFetchParams.request = httpRequest\n  }\n\n  //    3. Let includeCredentials be true if one of\n  const includeCredentials =\n    request.credentials === 'include' ||\n    (request.credentials === 'same-origin' &&\n      request.responseTainting === 'basic')\n\n  //    4. Let contentLength be httpRequest’s body’s length, if httpRequest’s\n  //    body is non-null; otherwise null.\n  const contentLength = httpRequest.body ? httpRequest.body.length : null\n\n  //    5. Let contentLengthHeaderValue be null.\n  let contentLengthHeaderValue = null\n\n  //    6. If httpRequest’s body is null and httpRequest’s method is `POST` or\n  //    `PUT`, then set contentLengthHeaderValue to `0`.\n  if (\n    httpRequest.body == null &&\n    ['POST', 'PUT'].includes(httpRequest.method)\n  ) {\n    contentLengthHeaderValue = '0'\n  }\n\n  //    7. If contentLength is non-null, then set contentLengthHeaderValue to\n  //    contentLength, serialized and isomorphic encoded.\n  if (contentLength != null) {\n    contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)\n  }\n\n  //    8. If contentLengthHeaderValue is non-null, then append\n  //    `Content-Length`/contentLengthHeaderValue to httpRequest’s header\n  //    list.\n  if (contentLengthHeaderValue != null) {\n    httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)\n  }\n\n  //    9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,\n  //    contentLengthHeaderValue) to httpRequest’s header list.\n\n  //    10. If contentLength is non-null and httpRequest’s keepalive is true,\n  //    then:\n  if (contentLength != null && httpRequest.keepalive) {\n    // NOTE: keepalive is a noop outside of browser context.\n  }\n\n  //    11. If httpRequest’s referrer is a URL, then append\n  //    `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,\n  //     to httpRequest’s header list.\n  if (httpRequest.referrer instanceof URL) {\n    httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)\n  }\n\n  //    12. Append a request `Origin` header for httpRequest.\n  appendRequestOriginHeader(httpRequest)\n\n  //    13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]\n  appendFetchMetadata(httpRequest)\n\n  //    14. If httpRequest’s header list does not contain `User-Agent`, then\n  //    user agents should append `User-Agent`/default `User-Agent` value to\n  //    httpRequest’s header list.\n  if (!httpRequest.headersList.contains('user-agent', true)) {\n    httpRequest.headersList.append('user-agent', defaultUserAgent)\n  }\n\n  //    15. If httpRequest’s cache mode is \"default\" and httpRequest’s header\n  //    list contains `If-Modified-Since`, `If-None-Match`,\n  //    `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set\n  //    httpRequest’s cache mode to \"no-store\".\n  if (\n    httpRequest.cache === 'default' &&\n    (httpRequest.headersList.contains('if-modified-since', true) ||\n      httpRequest.headersList.contains('if-none-match', true) ||\n      httpRequest.headersList.contains('if-unmodified-since', true) ||\n      httpRequest.headersList.contains('if-match', true) ||\n      httpRequest.headersList.contains('if-range', true))\n  ) {\n    httpRequest.cache = 'no-store'\n  }\n\n  //    16. If httpRequest’s cache mode is \"no-cache\", httpRequest’s prevent\n  //    no-cache cache-control header modification flag is unset, and\n  //    httpRequest’s header list does not contain `Cache-Control`, then append\n  //    `Cache-Control`/`max-age=0` to httpRequest’s header list.\n  if (\n    httpRequest.cache === 'no-cache' &&\n    !httpRequest.preventNoCacheCacheControlHeaderModification &&\n    !httpRequest.headersList.contains('cache-control', true)\n  ) {\n    httpRequest.headersList.append('cache-control', 'max-age=0', true)\n  }\n\n  //    17. If httpRequest’s cache mode is \"no-store\" or \"reload\", then:\n  if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {\n    // 1. If httpRequest’s header list does not contain `Pragma`, then append\n    // `Pragma`/`no-cache` to httpRequest’s header list.\n    if (!httpRequest.headersList.contains('pragma', true)) {\n      httpRequest.headersList.append('pragma', 'no-cache', true)\n    }\n\n    // 2. If httpRequest’s header list does not contain `Cache-Control`,\n    // then append `Cache-Control`/`no-cache` to httpRequest’s header list.\n    if (!httpRequest.headersList.contains('cache-control', true)) {\n      httpRequest.headersList.append('cache-control', 'no-cache', true)\n    }\n  }\n\n  //    18. If httpRequest’s header list contains `Range`, then append\n  //    `Accept-Encoding`/`identity` to httpRequest’s header list.\n  if (httpRequest.headersList.contains('range', true)) {\n    httpRequest.headersList.append('accept-encoding', 'identity', true)\n  }\n\n  //    19. Modify httpRequest’s header list per HTTP. Do not append a given\n  //    header if httpRequest’s header list contains that header’s name.\n  //    TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129\n  if (!httpRequest.headersList.contains('accept-encoding', true)) {\n    if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n      httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)\n    } else {\n      httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)\n    }\n  }\n\n  httpRequest.headersList.delete('host', true)\n\n  //    20. If includeCredentials is true, then:\n  if (includeCredentials) {\n    // 1. If the user agent is not configured to block cookies for httpRequest\n    // (see section 7 of [COOKIES]), then:\n    // TODO: credentials\n    // 2. If httpRequest’s header list does not contain `Authorization`, then:\n    // TODO: credentials\n  }\n\n  //    21. If there’s a proxy-authentication entry, use it as appropriate.\n  //    TODO: proxy-authentication\n\n  //    22. Set httpCache to the result of determining the HTTP cache\n  //    partition, given httpRequest.\n  //    TODO: cache\n\n  //    23. If httpCache is null, then set httpRequest’s cache mode to\n  //    \"no-store\".\n  if (httpCache == null) {\n    httpRequest.cache = 'no-store'\n  }\n\n  //    24. If httpRequest’s cache mode is neither \"no-store\" nor \"reload\",\n  //    then:\n  if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {\n    // TODO: cache\n  }\n\n  // 9. If aborted, then return the appropriate network error for fetchParams.\n  // TODO\n\n  // 10. If response is null, then:\n  if (response == null) {\n    // 1. If httpRequest’s cache mode is \"only-if-cached\", then return a\n    // network error.\n    if (httpRequest.cache === 'only-if-cached') {\n      return makeNetworkError('only if cached')\n    }\n\n    // 2. Let forwardResponse be the result of running HTTP-network fetch\n    // given httpFetchParams, includeCredentials, and isNewConnectionFetch.\n    const forwardResponse = await httpNetworkFetch(\n      httpFetchParams,\n      includeCredentials,\n      isNewConnectionFetch\n    )\n\n    // 3. If httpRequest’s method is unsafe and forwardResponse’s status is\n    // in the range 200 to 399, inclusive, invalidate appropriate stored\n    // responses in httpCache, as per the \"Invalidation\" chapter of HTTP\n    // Caching, and set storedResponse to null. [HTTP-CACHING]\n    if (\n      !safeMethodsSet.has(httpRequest.method) &&\n      forwardResponse.status >= 200 &&\n      forwardResponse.status <= 399\n    ) {\n      // TODO: cache\n    }\n\n    // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,\n    // then:\n    if (revalidatingFlag && forwardResponse.status === 304) {\n      // TODO: cache\n    }\n\n    // 5. If response is null, then:\n    if (response == null) {\n      // 1. Set response to forwardResponse.\n      response = forwardResponse\n\n      // 2. Store httpRequest and forwardResponse in httpCache, as per the\n      // \"Storing Responses in Caches\" chapter of HTTP Caching. [HTTP-CACHING]\n      // TODO: cache\n    }\n  }\n\n  // 11. Set response’s URL list to a clone of httpRequest’s URL list.\n  response.urlList = [...httpRequest.urlList]\n\n  // 12. If httpRequest’s header list contains `Range`, then set response’s\n  // range-requested flag.\n  if (httpRequest.headersList.contains('range', true)) {\n    response.rangeRequested = true\n  }\n\n  // 13. Set response’s request-includes-credentials to includeCredentials.\n  response.requestIncludesCredentials = includeCredentials\n\n  // 14. If response’s status is 401, httpRequest’s response tainting is not\n  // \"cors\", includeCredentials is true, and request’s window is an environment\n  // settings object, then:\n  // TODO\n\n  // 15. If response’s status is 407, then:\n  if (response.status === 407) {\n    // 1. If request’s window is \"no-window\", then return a network error.\n    if (request.window === 'no-window') {\n      return makeNetworkError()\n    }\n\n    // 2. ???\n\n    // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n    if (isCancelled(fetchParams)) {\n      return makeAppropriateNetworkError(fetchParams)\n    }\n\n    // 4. Prompt the end user as appropriate in request’s window and store\n    // the result as a proxy-authentication entry. [HTTP-AUTH]\n    // TODO: Invoke some kind of callback?\n\n    // 5. Set response to the result of running HTTP-network-or-cache fetch given\n    // fetchParams.\n    // TODO\n    return makeNetworkError('proxy authentication required')\n  }\n\n  // 16. If all of the following are true\n  if (\n    // response’s status is 421\n    response.status === 421 &&\n    // isNewConnectionFetch is false\n    !isNewConnectionFetch &&\n    // request’s body is null, or request’s body is non-null and request’s body’s source is non-null\n    (request.body == null || request.body.source != null)\n  ) {\n    // then:\n\n    // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n    if (isCancelled(fetchParams)) {\n      return makeAppropriateNetworkError(fetchParams)\n    }\n\n    // 2. Set response to the result of running HTTP-network-or-cache\n    // fetch given fetchParams, isAuthenticationFetch, and true.\n\n    // TODO (spec): The spec doesn't specify this but we need to cancel\n    // the active response before we can start a new one.\n    // https://github.com/whatwg/fetch/issues/1293\n    fetchParams.controller.connection.destroy()\n\n    response = await httpNetworkOrCacheFetch(\n      fetchParams,\n      isAuthenticationFetch,\n      true\n    )\n  }\n\n  // 17. If isAuthenticationFetch is true, then create an authentication entry\n  if (isAuthenticationFetch) {\n    // TODO\n  }\n\n  // 18. Return response.\n  return response\n}\n\n// https://fetch.spec.whatwg.org/#http-network-fetch\nasync function httpNetworkFetch (\n  fetchParams,\n  includeCredentials = false,\n  forceNewConnection = false\n) {\n  assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)\n\n  fetchParams.controller.connection = {\n    abort: null,\n    destroyed: false,\n    destroy (err, abort = true) {\n      if (!this.destroyed) {\n        this.destroyed = true\n        if (abort) {\n          this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))\n        }\n      }\n    }\n  }\n\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 4. Let httpCache be the result of determining the HTTP cache partition,\n  // given request.\n  // TODO: cache\n  const httpCache = null\n\n  // 5. If httpCache is null, then set request’s cache mode to \"no-store\".\n  if (httpCache == null) {\n    request.cache = 'no-store'\n  }\n\n  // 6. Let networkPartitionKey be the result of determining the network\n  // partition key given request.\n  // TODO\n\n  // 7. Let newConnection be \"yes\" if forceNewConnection is true; otherwise\n  // \"no\".\n  const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars\n\n  // 8. Switch on request’s mode:\n  if (request.mode === 'websocket') {\n    // Let connection be the result of obtaining a WebSocket connection,\n    // given request’s current URL.\n    // TODO\n  } else {\n    // Let connection be the result of obtaining a connection, given\n    // networkPartitionKey, request’s current URL’s origin,\n    // includeCredentials, and forceNewConnection.\n    // TODO\n  }\n\n  // 9. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. If connection is failure, then return a network error.\n\n  //    2. Set timingInfo’s final connection timing info to the result of\n  //    calling clamp and coarsen connection timing info with connection’s\n  //    timing info, timingInfo’s post-redirect start time, and fetchParams’s\n  //    cross-origin isolated capability.\n\n  //    3. If connection is not an HTTP/2 connection, request’s body is non-null,\n  //    and request’s body’s source is null, then append (`Transfer-Encoding`,\n  //    `chunked`) to request’s header list.\n\n  //    4. Set timingInfo’s final network-request start time to the coarsened\n  //    shared current time given fetchParams’s cross-origin isolated\n  //    capability.\n\n  //    5. Set response to the result of making an HTTP request over connection\n  //    using request with the following caveats:\n\n  //        - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]\n  //        [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]\n\n  //        - If request’s body is non-null, and request’s body’s source is null,\n  //        then the user agent may have a buffer of up to 64 kibibytes and store\n  //        a part of request’s body in that buffer. If the user agent reads from\n  //        request’s body beyond that buffer’s size and the user agent needs to\n  //        resend request, then instead return a network error.\n\n  //        - Set timingInfo’s final network-response start time to the coarsened\n  //        shared current time given fetchParams’s cross-origin isolated capability,\n  //        immediately after the user agent’s HTTP parser receives the first byte\n  //        of the response (e.g., frame header bytes for HTTP/2 or response status\n  //        line for HTTP/1.x).\n\n  //        - Wait until all the headers are transmitted.\n\n  //        - Any responses whose status is in the range 100 to 199, inclusive,\n  //        and is not 101, are to be ignored, except for the purposes of setting\n  //        timingInfo’s final network-response start time above.\n\n  //    - If request’s header list contains `Transfer-Encoding`/`chunked` and\n  //    response is transferred via HTTP/1.0 or older, then return a network\n  //    error.\n\n  //    - If the HTTP request results in a TLS client certificate dialog, then:\n\n  //        1. If request’s window is an environment settings object, make the\n  //        dialog available in request’s window.\n\n  //        2. Otherwise, return a network error.\n\n  // To transmit request’s body body, run these steps:\n  let requestBody = null\n  // 1. If body is null and fetchParams’s process request end-of-body is\n  // non-null, then queue a fetch task given fetchParams’s process request\n  // end-of-body and fetchParams’s task destination.\n  if (request.body == null && fetchParams.processRequestEndOfBody) {\n    queueMicrotask(() => fetchParams.processRequestEndOfBody())\n  } else if (request.body != null) {\n    // 2. Otherwise, if body is non-null:\n\n    //    1. Let processBodyChunk given bytes be these steps:\n    const processBodyChunk = async function * (bytes) {\n      // 1. If the ongoing fetch is terminated, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. Run this step in parallel: transmit bytes.\n      yield bytes\n\n      // 3. If fetchParams’s process request body is non-null, then run\n      // fetchParams’s process request body given bytes’s length.\n      fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)\n    }\n\n    // 2. Let processEndOfBody be these steps:\n    const processEndOfBody = () => {\n      // 1. If fetchParams is canceled, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. If fetchParams’s process request end-of-body is non-null,\n      // then run fetchParams’s process request end-of-body.\n      if (fetchParams.processRequestEndOfBody) {\n        fetchParams.processRequestEndOfBody()\n      }\n    }\n\n    // 3. Let processBodyError given e be these steps:\n    const processBodyError = (e) => {\n      // 1. If fetchParams is canceled, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. If e is an \"AbortError\" DOMException, then abort fetchParams’s controller.\n      if (e.name === 'AbortError') {\n        fetchParams.controller.abort()\n      } else {\n        fetchParams.controller.terminate(e)\n      }\n    }\n\n    // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,\n    // processBodyError, and fetchParams’s task destination.\n    requestBody = (async function * () {\n      try {\n        for await (const bytes of request.body.stream) {\n          yield * processBodyChunk(bytes)\n        }\n        processEndOfBody()\n      } catch (err) {\n        processBodyError(err)\n      }\n    })()\n  }\n\n  try {\n    // socket is only provided for websockets\n    const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })\n\n    if (socket) {\n      response = makeResponse({ status, statusText, headersList, socket })\n    } else {\n      const iterator = body[Symbol.asyncIterator]()\n      fetchParams.controller.next = () => iterator.next()\n\n      response = makeResponse({ status, statusText, headersList })\n    }\n  } catch (err) {\n    // 10. If aborted, then:\n    if (err.name === 'AbortError') {\n      // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n      fetchParams.controller.connection.destroy()\n\n      // 2. Return the appropriate network error for fetchParams.\n      return makeAppropriateNetworkError(fetchParams, err)\n    }\n\n    return makeNetworkError(err)\n  }\n\n  // 11. Let pullAlgorithm be an action that resumes the ongoing fetch\n  // if it is suspended.\n  const pullAlgorithm = async () => {\n    await fetchParams.controller.resume()\n  }\n\n  // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s\n  // controller with reason, given reason.\n  const cancelAlgorithm = (reason) => {\n    // If the aborted fetch was already terminated, then we do not\n    // need to do anything.\n    if (!isCancelled(fetchParams)) {\n      fetchParams.controller.abort(reason)\n    }\n  }\n\n  // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by\n  // the user agent.\n  // TODO\n\n  // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object\n  // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.\n  // TODO\n\n  // 15. Let stream be a new ReadableStream.\n  // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm,\n  //     cancelAlgorithm set to cancelAlgorithm.\n  const stream = new ReadableStream(\n    {\n      async start (controller) {\n        fetchParams.controller.controller = controller\n      },\n      async pull (controller) {\n        await pullAlgorithm(controller)\n      },\n      async cancel (reason) {\n        await cancelAlgorithm(reason)\n      },\n      type: 'bytes'\n    }\n  )\n\n  // 17. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. Set response’s body to a new body whose stream is stream.\n  response.body = { stream, source: null, length: null }\n\n  //    2. If response is not a network error and request’s cache mode is\n  //    not \"no-store\", then update response in httpCache for request.\n  //    TODO\n\n  //    3. If includeCredentials is true and the user agent is not configured\n  //    to block cookies for request (see section 7 of [COOKIES]), then run the\n  //    \"set-cookie-string\" parsing algorithm (see section 5.2 of [COOKIES]) on\n  //    the value of each header whose name is a byte-case-insensitive match for\n  //    `Set-Cookie` in response’s header list, if any, and request’s current URL.\n  //    TODO\n\n  // 18. If aborted, then:\n  // TODO\n\n  // 19. Run these steps in parallel:\n\n  //    1. Run these steps, but abort when fetchParams is canceled:\n  fetchParams.controller.onAborted = onAborted\n  fetchParams.controller.on('terminated', onAborted)\n  fetchParams.controller.resume = async () => {\n    // 1. While true\n    while (true) {\n      // 1-3. See onData...\n\n      // 4. Set bytes to the result of handling content codings given\n      // codings and bytes.\n      let bytes\n      let isFailure\n      try {\n        const { done, value } = await fetchParams.controller.next()\n\n        if (isAborted(fetchParams)) {\n          break\n        }\n\n        bytes = done ? undefined : value\n      } catch (err) {\n        if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n          // zlib doesn't like empty streams.\n          bytes = undefined\n        } else {\n          bytes = err\n\n          // err may be propagated from the result of calling readablestream.cancel,\n          // which might not be an error. https://github.com/nodejs/undici/issues/2009\n          isFailure = true\n        }\n      }\n\n      if (bytes === undefined) {\n        // 2. Otherwise, if the bytes transmission for response’s message\n        // body is done normally and stream is readable, then close\n        // stream, finalize response for fetchParams and response, and\n        // abort these in-parallel steps.\n        readableStreamClose(fetchParams.controller.controller)\n\n        finalizeResponse(fetchParams, response)\n\n        return\n      }\n\n      // 5. Increase timingInfo’s decoded body size by bytes’s length.\n      timingInfo.decodedBodySize += bytes?.byteLength ?? 0\n\n      // 6. If bytes is failure, then terminate fetchParams’s controller.\n      if (isFailure) {\n        fetchParams.controller.terminate(bytes)\n        return\n      }\n\n      // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes\n      // into stream.\n      const buffer = new Uint8Array(bytes)\n      if (buffer.byteLength) {\n        fetchParams.controller.controller.enqueue(buffer)\n      }\n\n      // 8. If stream is errored, then terminate the ongoing fetch.\n      if (isErrored(stream)) {\n        fetchParams.controller.terminate()\n        return\n      }\n\n      // 9. If stream doesn’t need more data ask the user agent to suspend\n      // the ongoing fetch.\n      if (fetchParams.controller.controller.desiredSize <= 0) {\n        return\n      }\n    }\n  }\n\n  //    2. If aborted, then:\n  function onAborted (reason) {\n    // 2. If fetchParams is aborted, then:\n    if (isAborted(fetchParams)) {\n      // 1. Set response’s aborted flag.\n      response.aborted = true\n\n      // 2. If stream is readable, then error stream with the result of\n      //    deserialize a serialized abort reason given fetchParams’s\n      //    controller’s serialized abort reason and an\n      //    implementation-defined realm.\n      if (isReadable(stream)) {\n        fetchParams.controller.controller.error(\n          fetchParams.controller.serializedAbortReason\n        )\n      }\n    } else {\n      // 3. Otherwise, if stream is readable, error stream with a TypeError.\n      if (isReadable(stream)) {\n        fetchParams.controller.controller.error(new TypeError('terminated', {\n          cause: isErrorLike(reason) ? reason : undefined\n        }))\n      }\n    }\n\n    // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n    // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.\n    fetchParams.controller.connection.destroy()\n  }\n\n  // 20. Return response.\n  return response\n\n  function dispatch ({ body }) {\n    const url = requestCurrentURL(request)\n    /** @type {import('../..').Agent} */\n    const agent = fetchParams.controller.dispatcher\n\n    return new Promise((resolve, reject) => agent.dispatch(\n      {\n        path: url.pathname + url.search,\n        origin: url.origin,\n        method: request.method,\n        body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,\n        headers: request.headersList.entries,\n        maxRedirections: 0,\n        upgrade: request.mode === 'websocket' ? 'websocket' : undefined\n      },\n      {\n        body: null,\n        abort: null,\n\n        onConnect (abort) {\n          // TODO (fix): Do we need connection here?\n          const { connection } = fetchParams.controller\n\n          // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen\n          // connection timing info with connection’s timing info, timingInfo’s post-redirect start\n          // time, and fetchParams’s cross-origin isolated capability.\n          // TODO: implement connection timing\n          timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)\n\n          if (connection.destroyed) {\n            abort(new DOMException('The operation was aborted.', 'AbortError'))\n          } else {\n            fetchParams.controller.on('terminated', abort)\n            this.abort = connection.abort = abort\n          }\n\n          // Set timingInfo’s final network-request start time to the coarsened shared current time given\n          // fetchParams’s cross-origin isolated capability.\n          timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n        },\n\n        onResponseStarted () {\n          // Set timingInfo’s final network-response start time to the coarsened shared current\n          // time given fetchParams’s cross-origin isolated capability, immediately after the\n          // user agent’s HTTP parser receives the first byte of the response (e.g., frame header\n          // bytes for HTTP/2 or response status line for HTTP/1.x).\n          timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n        },\n\n        onHeaders (status, rawHeaders, resume, statusText) {\n          if (status < 200) {\n            return\n          }\n\n          let location = ''\n\n          const headersList = new HeadersList()\n\n          for (let i = 0; i < rawHeaders.length; i += 2) {\n            headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n          }\n          location = headersList.get('location', true)\n\n          this.body = new Readable({ read: resume })\n\n          const decoders = []\n\n          const willFollow = location && request.redirect === 'follow' &&\n            redirectStatusSet.has(status)\n\n          // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding\n          if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {\n            // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n            const contentEncoding = headersList.get('content-encoding', true)\n            // \"All content-coding values are case-insensitive...\"\n            /** @type {string[]} */\n            const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []\n\n            // Limit the number of content-encodings to prevent resource exhaustion.\n            // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).\n            const maxContentEncodings = 5\n            if (codings.length > maxContentEncodings) {\n              reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))\n              return true\n            }\n\n            for (let i = codings.length - 1; i >= 0; --i) {\n              const coding = codings[i].trim()\n              // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2\n              if (coding === 'x-gzip' || coding === 'gzip') {\n                decoders.push(zlib.createGunzip({\n                  // Be less strict when decoding compressed responses, since sometimes\n                  // servers send slightly invalid responses that are still accepted\n                  // by common browsers.\n                  // Always using Z_SYNC_FLUSH is what cURL does.\n                  flush: zlib.constants.Z_SYNC_FLUSH,\n                  finishFlush: zlib.constants.Z_SYNC_FLUSH\n                }))\n              } else if (coding === 'deflate') {\n                decoders.push(createInflate({\n                  flush: zlib.constants.Z_SYNC_FLUSH,\n                  finishFlush: zlib.constants.Z_SYNC_FLUSH\n                }))\n              } else if (coding === 'br') {\n                decoders.push(zlib.createBrotliDecompress({\n                  flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n                  finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n                }))\n              } else {\n                decoders.length = 0\n                break\n              }\n            }\n          }\n\n          const onError = this.onError.bind(this)\n\n          resolve({\n            status,\n            statusText,\n            headersList,\n            body: decoders.length\n              ? pipeline(this.body, ...decoders, (err) => {\n                if (err) {\n                  this.onError(err)\n                }\n              }).on('error', onError)\n              : this.body.on('error', onError)\n          })\n\n          return true\n        },\n\n        onData (chunk) {\n          if (fetchParams.controller.dump) {\n            return\n          }\n\n          // 1. If one or more bytes have been transmitted from response’s\n          // message body, then:\n\n          //  1. Let bytes be the transmitted bytes.\n          const bytes = chunk\n\n          //  2. Let codings be the result of extracting header list values\n          //  given `Content-Encoding` and response’s header list.\n          //  See pullAlgorithm.\n\n          //  3. Increase timingInfo’s encoded body size by bytes’s length.\n          timingInfo.encodedBodySize += bytes.byteLength\n\n          //  4. See pullAlgorithm...\n\n          return this.body.push(bytes)\n        },\n\n        onComplete () {\n          if (this.abort) {\n            fetchParams.controller.off('terminated', this.abort)\n          }\n\n          if (fetchParams.controller.onAborted) {\n            fetchParams.controller.off('terminated', fetchParams.controller.onAborted)\n          }\n\n          fetchParams.controller.ended = true\n\n          this.body.push(null)\n        },\n\n        onError (error) {\n          if (this.abort) {\n            fetchParams.controller.off('terminated', this.abort)\n          }\n\n          this.body?.destroy(error)\n\n          fetchParams.controller.terminate(error)\n\n          reject(error)\n        },\n\n        onUpgrade (status, rawHeaders, socket) {\n          if (status !== 101) {\n            return\n          }\n\n          const headersList = new HeadersList()\n\n          for (let i = 0; i < rawHeaders.length; i += 2) {\n            headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n          }\n\n          resolve({\n            status,\n            statusText: STATUS_CODES[status],\n            headersList,\n            socket\n          })\n\n          return true\n        }\n      }\n    ))\n  }\n}\n\nmodule.exports = {\n  fetch,\n  Fetch,\n  fetching,\n  finalizeAndReportTiming\n}\n","/* globals AbortController */\n\n'use strict'\n\nconst { extractBody, mixinBody, cloneBody, bodyUnusable } = require('./body')\nconst { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require('./headers')\nconst { FinalizationRegistry } = require('./dispatcher-weakref')()\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst {\n  isValidHTTPToken,\n  sameOrigin,\n  environmentSettingsObject\n} = require('./util')\nconst {\n  forbiddenMethodsSet,\n  corsSafeListedMethodsSet,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  requestDuplex\n} = require('./constants')\nconst { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util\nconst { kHeaders, kSignal, kState, kDispatcher } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('node:events')\n\nconst kAbortController = Symbol('abortController')\n\nconst requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n  signal.removeEventListener('abort', abort)\n})\n\nconst dependentControllerMap = new WeakMap()\n\nfunction buildAbort (acRef) {\n  return abort\n\n  function abort () {\n    const ac = acRef.deref()\n    if (ac !== undefined) {\n      // Currently, there is a problem with FinalizationRegistry.\n      // https://github.com/nodejs/node/issues/49344\n      // https://github.com/nodejs/node/issues/47748\n      // In the case of abort, the first step is to unregister from it.\n      // If the controller can refer to it, it is still registered.\n      // It will be removed in the future.\n      requestFinalizer.unregister(abort)\n\n      // Unsubscribe a listener.\n      // FinalizationRegistry will no longer be called, so this must be done.\n      this.removeEventListener('abort', abort)\n\n      ac.abort(this.reason)\n\n      const controllerList = dependentControllerMap.get(ac.signal)\n\n      if (controllerList !== undefined) {\n        if (controllerList.size !== 0) {\n          for (const ref of controllerList) {\n            const ctrl = ref.deref()\n            if (ctrl !== undefined) {\n              ctrl.abort(this.reason)\n            }\n          }\n          controllerList.clear()\n        }\n        dependentControllerMap.delete(ac.signal)\n      }\n    }\n  }\n}\n\nlet patchMethodWarning = false\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request {\n  // https://fetch.spec.whatwg.org/#dom-request\n  constructor (input, init = {}) {\n    webidl.util.markAsUncloneable(this)\n    if (input === kConstruct) {\n      return\n    }\n\n    const prefix = 'Request constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    input = webidl.converters.RequestInfo(input, prefix, 'input')\n    init = webidl.converters.RequestInit(init, prefix, 'init')\n\n    // 1. Let request be null.\n    let request = null\n\n    // 2. Let fallbackMode be null.\n    let fallbackMode = null\n\n    // 3. Let baseURL be this’s relevant settings object’s API base URL.\n    const baseUrl = environmentSettingsObject.settingsObject.baseUrl\n\n    // 4. Let signal be null.\n    let signal = null\n\n    // 5. If input is a string, then:\n    if (typeof input === 'string') {\n      this[kDispatcher] = init.dispatcher\n\n      // 1. Let parsedURL be the result of parsing input with baseURL.\n      // 2. If parsedURL is failure, then throw a TypeError.\n      let parsedURL\n      try {\n        parsedURL = new URL(input, baseUrl)\n      } catch (err) {\n        throw new TypeError('Failed to parse URL from ' + input, { cause: err })\n      }\n\n      // 3. If parsedURL includes credentials, then throw a TypeError.\n      if (parsedURL.username || parsedURL.password) {\n        throw new TypeError(\n          'Request cannot be constructed from a URL that includes credentials: ' +\n            input\n        )\n      }\n\n      // 4. Set request to a new request whose URL is parsedURL.\n      request = makeRequest({ urlList: [parsedURL] })\n\n      // 5. Set fallbackMode to \"cors\".\n      fallbackMode = 'cors'\n    } else {\n      this[kDispatcher] = init.dispatcher || input[kDispatcher]\n\n      // 6. Otherwise:\n\n      // 7. Assert: input is a Request object.\n      assert(input instanceof Request)\n\n      // 8. Set request to input’s request.\n      request = input[kState]\n\n      // 9. Set signal to input’s signal.\n      signal = input[kSignal]\n    }\n\n    // 7. Let origin be this’s relevant settings object’s origin.\n    const origin = environmentSettingsObject.settingsObject.origin\n\n    // 8. Let window be \"client\".\n    let window = 'client'\n\n    // 9. If request’s window is an environment settings object and its origin\n    // is same origin with origin, then set window to request’s window.\n    if (\n      request.window?.constructor?.name === 'EnvironmentSettingsObject' &&\n      sameOrigin(request.window, origin)\n    ) {\n      window = request.window\n    }\n\n    // 10. If init[\"window\"] exists and is non-null, then throw a TypeError.\n    if (init.window != null) {\n      throw new TypeError(`'window' option '${window}' must be null`)\n    }\n\n    // 11. If init[\"window\"] exists, then set window to \"no-window\".\n    if ('window' in init) {\n      window = 'no-window'\n    }\n\n    // 12. Set request to a new request with the following properties:\n    request = makeRequest({\n      // URL request’s URL.\n      // undici implementation note: this is set as the first item in request's urlList in makeRequest\n      // method request’s method.\n      method: request.method,\n      // header list A copy of request’s header list.\n      // undici implementation note: headersList is cloned in makeRequest\n      headersList: request.headersList,\n      // unsafe-request flag Set.\n      unsafeRequest: request.unsafeRequest,\n      // client This’s relevant settings object.\n      client: environmentSettingsObject.settingsObject,\n      // window window.\n      window,\n      // priority request’s priority.\n      priority: request.priority,\n      // origin request’s origin. The propagation of the origin is only significant for navigation requests\n      // being handled by a service worker. In this scenario a request can have an origin that is different\n      // from the current client.\n      origin: request.origin,\n      // referrer request’s referrer.\n      referrer: request.referrer,\n      // referrer policy request’s referrer policy.\n      referrerPolicy: request.referrerPolicy,\n      // mode request’s mode.\n      mode: request.mode,\n      // credentials mode request’s credentials mode.\n      credentials: request.credentials,\n      // cache mode request’s cache mode.\n      cache: request.cache,\n      // redirect mode request’s redirect mode.\n      redirect: request.redirect,\n      // integrity metadata request’s integrity metadata.\n      integrity: request.integrity,\n      // keepalive request’s keepalive.\n      keepalive: request.keepalive,\n      // reload-navigation flag request’s reload-navigation flag.\n      reloadNavigation: request.reloadNavigation,\n      // history-navigation flag request’s history-navigation flag.\n      historyNavigation: request.historyNavigation,\n      // URL list A clone of request’s URL list.\n      urlList: [...request.urlList]\n    })\n\n    const initHasKey = Object.keys(init).length !== 0\n\n    // 13. If init is not empty, then:\n    if (initHasKey) {\n      // 1. If request’s mode is \"navigate\", then set it to \"same-origin\".\n      if (request.mode === 'navigate') {\n        request.mode = 'same-origin'\n      }\n\n      // 2. Unset request’s reload-navigation flag.\n      request.reloadNavigation = false\n\n      // 3. Unset request’s history-navigation flag.\n      request.historyNavigation = false\n\n      // 4. Set request’s origin to \"client\".\n      request.origin = 'client'\n\n      // 5. Set request’s referrer to \"client\"\n      request.referrer = 'client'\n\n      // 6. Set request’s referrer policy to the empty string.\n      request.referrerPolicy = ''\n\n      // 7. Set request’s URL to request’s current URL.\n      request.url = request.urlList[request.urlList.length - 1]\n\n      // 8. Set request’s URL list to « request’s URL ».\n      request.urlList = [request.url]\n    }\n\n    // 14. If init[\"referrer\"] exists, then:\n    if (init.referrer !== undefined) {\n      // 1. Let referrer be init[\"referrer\"].\n      const referrer = init.referrer\n\n      // 2. If referrer is the empty string, then set request’s referrer to \"no-referrer\".\n      if (referrer === '') {\n        request.referrer = 'no-referrer'\n      } else {\n        // 1. Let parsedReferrer be the result of parsing referrer with\n        // baseURL.\n        // 2. If parsedReferrer is failure, then throw a TypeError.\n        let parsedReferrer\n        try {\n          parsedReferrer = new URL(referrer, baseUrl)\n        } catch (err) {\n          throw new TypeError(`Referrer \"${referrer}\" is not a valid URL.`, { cause: err })\n        }\n\n        // 3. If one of the following is true\n        // - parsedReferrer’s scheme is \"about\" and path is the string \"client\"\n        // - parsedReferrer’s origin is not same origin with origin\n        // then set request’s referrer to \"client\".\n        if (\n          (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||\n          (origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl))\n        ) {\n          request.referrer = 'client'\n        } else {\n          // 4. Otherwise, set request’s referrer to parsedReferrer.\n          request.referrer = parsedReferrer\n        }\n      }\n    }\n\n    // 15. If init[\"referrerPolicy\"] exists, then set request’s referrer policy\n    // to it.\n    if (init.referrerPolicy !== undefined) {\n      request.referrerPolicy = init.referrerPolicy\n    }\n\n    // 16. Let mode be init[\"mode\"] if it exists, and fallbackMode otherwise.\n    let mode\n    if (init.mode !== undefined) {\n      mode = init.mode\n    } else {\n      mode = fallbackMode\n    }\n\n    // 17. If mode is \"navigate\", then throw a TypeError.\n    if (mode === 'navigate') {\n      throw webidl.errors.exception({\n        header: 'Request constructor',\n        message: 'invalid request mode navigate.'\n      })\n    }\n\n    // 18. If mode is non-null, set request’s mode to mode.\n    if (mode != null) {\n      request.mode = mode\n    }\n\n    // 19. If init[\"credentials\"] exists, then set request’s credentials mode\n    // to it.\n    if (init.credentials !== undefined) {\n      request.credentials = init.credentials\n    }\n\n    // 18. If init[\"cache\"] exists, then set request’s cache mode to it.\n    if (init.cache !== undefined) {\n      request.cache = init.cache\n    }\n\n    // 21. If request’s cache mode is \"only-if-cached\" and request’s mode is\n    // not \"same-origin\", then throw a TypeError.\n    if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {\n      throw new TypeError(\n        \"'only-if-cached' can be set only with 'same-origin' mode\"\n      )\n    }\n\n    // 22. If init[\"redirect\"] exists, then set request’s redirect mode to it.\n    if (init.redirect !== undefined) {\n      request.redirect = init.redirect\n    }\n\n    // 23. If init[\"integrity\"] exists, then set request’s integrity metadata to it.\n    if (init.integrity != null) {\n      request.integrity = String(init.integrity)\n    }\n\n    // 24. If init[\"keepalive\"] exists, then set request’s keepalive to it.\n    if (init.keepalive !== undefined) {\n      request.keepalive = Boolean(init.keepalive)\n    }\n\n    // 25. If init[\"method\"] exists, then:\n    if (init.method !== undefined) {\n      // 1. Let method be init[\"method\"].\n      let method = init.method\n\n      const mayBeNormalized = normalizedMethodRecords[method]\n\n      if (mayBeNormalized !== undefined) {\n        // Note: Bypass validation DELETE, GET, HEAD, OPTIONS, POST, PUT, PATCH and these lowercase ones\n        request.method = mayBeNormalized\n      } else {\n        // 2. If method is not a method or method is a forbidden method, then\n        // throw a TypeError.\n        if (!isValidHTTPToken(method)) {\n          throw new TypeError(`'${method}' is not a valid HTTP method.`)\n        }\n\n        const upperCase = method.toUpperCase()\n\n        if (forbiddenMethodsSet.has(upperCase)) {\n          throw new TypeError(`'${method}' HTTP method is unsupported.`)\n        }\n\n        // 3. Normalize method.\n        // https://fetch.spec.whatwg.org/#concept-method-normalize\n        // Note: must be in uppercase\n        method = normalizedMethodRecordsBase[upperCase] ?? method\n\n        // 4. Set request’s method to method.\n        request.method = method\n      }\n\n      if (!patchMethodWarning && request.method === 'patch') {\n        process.emitWarning('Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.', {\n          code: 'UNDICI-FETCH-patch'\n        })\n\n        patchMethodWarning = true\n      }\n    }\n\n    // 26. If init[\"signal\"] exists, then set signal to it.\n    if (init.signal !== undefined) {\n      signal = init.signal\n    }\n\n    // 27. Set this’s request to request.\n    this[kState] = request\n\n    // 28. Set this’s signal to a new AbortSignal object with this’s relevant\n    // Realm.\n    // TODO: could this be simplified with AbortSignal.any\n    // (https://dom.spec.whatwg.org/#dom-abortsignal-any)\n    const ac = new AbortController()\n    this[kSignal] = ac.signal\n\n    // 29. If signal is not null, then make this’s signal follow signal.\n    if (signal != null) {\n      if (\n        !signal ||\n        typeof signal.aborted !== 'boolean' ||\n        typeof signal.addEventListener !== 'function'\n      ) {\n        throw new TypeError(\n          \"Failed to construct 'Request': member signal is not of type AbortSignal.\"\n        )\n      }\n\n      if (signal.aborted) {\n        ac.abort(signal.reason)\n      } else {\n        // Keep a strong ref to ac while request object\n        // is alive. This is needed to prevent AbortController\n        // from being prematurely garbage collected.\n        // See, https://github.com/nodejs/undici/issues/1926.\n        this[kAbortController] = ac\n\n        const acRef = new WeakRef(ac)\n        const abort = buildAbort(acRef)\n\n        // Third-party AbortControllers may not work with these.\n        // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.\n        try {\n          // If the max amount of listeners is equal to the default, increase it\n          // This is only available in node >= v19.9.0\n          if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {\n            setMaxListeners(1500, signal)\n          } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {\n            setMaxListeners(1500, signal)\n          }\n        } catch {}\n\n        util.addAbortListener(signal, abort)\n        // The third argument must be a registry key to be unregistered.\n        // Without it, you cannot unregister.\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n        // abort is used as the unregister key. (because it is unique)\n        requestFinalizer.register(ac, { signal, abort }, abort)\n      }\n    }\n\n    // 30. Set this’s headers to a new Headers object with this’s relevant\n    // Realm, whose header list is request’s header list and guard is\n    // \"request\".\n    this[kHeaders] = new Headers(kConstruct)\n    setHeadersList(this[kHeaders], request.headersList)\n    setHeadersGuard(this[kHeaders], 'request')\n\n    // 31. If this’s request’s mode is \"no-cors\", then:\n    if (mode === 'no-cors') {\n      // 1. If this’s request’s method is not a CORS-safelisted method,\n      // then throw a TypeError.\n      if (!corsSafeListedMethodsSet.has(request.method)) {\n        throw new TypeError(\n          `'${request.method} is unsupported in no-cors mode.`\n        )\n      }\n\n      // 2. Set this’s headers’s guard to \"request-no-cors\".\n      setHeadersGuard(this[kHeaders], 'request-no-cors')\n    }\n\n    // 32. If init is not empty, then:\n    if (initHasKey) {\n      /** @type {HeadersList} */\n      const headersList = getHeadersList(this[kHeaders])\n      // 1. Let headers be a copy of this’s headers and its associated header\n      // list.\n      // 2. If init[\"headers\"] exists, then set headers to init[\"headers\"].\n      const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)\n\n      // 3. Empty this’s headers’s header list.\n      headersList.clear()\n\n      // 4. If headers is a Headers object, then for each header in its header\n      // list, append header’s name/header’s value to this’s headers.\n      if (headers instanceof HeadersList) {\n        for (const { name, value } of headers.rawValues()) {\n          headersList.append(name, value, false)\n        }\n        // Note: Copy the `set-cookie` meta-data.\n        headersList.cookies = headers.cookies\n      } else {\n        // 5. Otherwise, fill this’s headers with headers.\n        fillHeaders(this[kHeaders], headers)\n      }\n    }\n\n    // 33. Let inputBody be input’s request’s body if input is a Request\n    // object; otherwise null.\n    const inputBody = input instanceof Request ? input[kState].body : null\n\n    // 34. If either init[\"body\"] exists and is non-null or inputBody is\n    // non-null, and request’s method is `GET` or `HEAD`, then throw a\n    // TypeError.\n    if (\n      (init.body != null || inputBody != null) &&\n      (request.method === 'GET' || request.method === 'HEAD')\n    ) {\n      throw new TypeError('Request with GET/HEAD method cannot have body.')\n    }\n\n    // 35. Let initBody be null.\n    let initBody = null\n\n    // 36. If init[\"body\"] exists and is non-null, then:\n    if (init.body != null) {\n      // 1. Let Content-Type be null.\n      // 2. Set initBody and Content-Type to the result of extracting\n      // init[\"body\"], with keepalive set to request’s keepalive.\n      const [extractedBody, contentType] = extractBody(\n        init.body,\n        request.keepalive\n      )\n      initBody = extractedBody\n\n      // 3, If Content-Type is non-null and this’s headers’s header list does\n      // not contain `Content-Type`, then append `Content-Type`/Content-Type to\n      // this’s headers.\n      if (contentType && !getHeadersList(this[kHeaders]).contains('content-type', true)) {\n        this[kHeaders].append('content-type', contentType)\n      }\n    }\n\n    // 37. Let inputOrInitBody be initBody if it is non-null; otherwise\n    // inputBody.\n    const inputOrInitBody = initBody ?? inputBody\n\n    // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is\n    // null, then:\n    if (inputOrInitBody != null && inputOrInitBody.source == null) {\n      // 1. If initBody is non-null and init[\"duplex\"] does not exist,\n      //    then throw a TypeError.\n      if (initBody != null && init.duplex == null) {\n        throw new TypeError('RequestInit: duplex option is required when sending a body.')\n      }\n\n      // 2. If this’s request’s mode is neither \"same-origin\" nor \"cors\",\n      // then throw a TypeError.\n      if (request.mode !== 'same-origin' && request.mode !== 'cors') {\n        throw new TypeError(\n          'If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"'\n        )\n      }\n\n      // 3. Set this’s request’s use-CORS-preflight flag.\n      request.useCORSPreflightFlag = true\n    }\n\n    // 39. Let finalBody be inputOrInitBody.\n    let finalBody = inputOrInitBody\n\n    // 40. If initBody is null and inputBody is non-null, then:\n    if (initBody == null && inputBody != null) {\n      // 1. If input is unusable, then throw a TypeError.\n      if (bodyUnusable(input)) {\n        throw new TypeError(\n          'Cannot construct a Request with a Request object that has already been used.'\n        )\n      }\n\n      // 2. Set finalBody to the result of creating a proxy for inputBody.\n      // https://streams.spec.whatwg.org/#readablestream-create-a-proxy\n      const identityTransform = new TransformStream()\n      inputBody.stream.pipeThrough(identityTransform)\n      finalBody = {\n        source: inputBody.source,\n        length: inputBody.length,\n        stream: identityTransform.readable\n      }\n    }\n\n    // 41. Set this’s request’s body to finalBody.\n    this[kState].body = finalBody\n  }\n\n  // Returns request’s HTTP method, which is \"GET\" by default.\n  get method () {\n    webidl.brandCheck(this, Request)\n\n    // The method getter steps are to return this’s request’s method.\n    return this[kState].method\n  }\n\n  // Returns the URL of request as a string.\n  get url () {\n    webidl.brandCheck(this, Request)\n\n    // The url getter steps are to return this’s request’s URL, serialized.\n    return URLSerializer(this[kState].url)\n  }\n\n  // Returns a Headers object consisting of the headers associated with request.\n  // Note that headers added in the network layer by the user agent will not\n  // be accounted for in this object, e.g., the \"Host\" header.\n  get headers () {\n    webidl.brandCheck(this, Request)\n\n    // The headers getter steps are to return this’s headers.\n    return this[kHeaders]\n  }\n\n  // Returns the kind of resource requested by request, e.g., \"document\"\n  // or \"script\".\n  get destination () {\n    webidl.brandCheck(this, Request)\n\n    // The destination getter are to return this’s request’s destination.\n    return this[kState].destination\n  }\n\n  // Returns the referrer of request. Its value can be a same-origin URL if\n  // explicitly set in init, the empty string to indicate no referrer, and\n  // \"about:client\" when defaulting to the global’s default. This is used\n  // during fetching to determine the value of the `Referer` header of the\n  // request being made.\n  get referrer () {\n    webidl.brandCheck(this, Request)\n\n    // 1. If this’s request’s referrer is \"no-referrer\", then return the\n    // empty string.\n    if (this[kState].referrer === 'no-referrer') {\n      return ''\n    }\n\n    // 2. If this’s request’s referrer is \"client\", then return\n    // \"about:client\".\n    if (this[kState].referrer === 'client') {\n      return 'about:client'\n    }\n\n    // Return this’s request’s referrer, serialized.\n    return this[kState].referrer.toString()\n  }\n\n  // Returns the referrer policy associated with request.\n  // This is used during fetching to compute the value of the request’s\n  // referrer.\n  get referrerPolicy () {\n    webidl.brandCheck(this, Request)\n\n    // The referrerPolicy getter steps are to return this’s request’s referrer policy.\n    return this[kState].referrerPolicy\n  }\n\n  // Returns the mode associated with request, which is a string indicating\n  // whether the request will use CORS, or will be restricted to same-origin\n  // URLs.\n  get mode () {\n    webidl.brandCheck(this, Request)\n\n    // The mode getter steps are to return this’s request’s mode.\n    return this[kState].mode\n  }\n\n  // Returns the credentials mode associated with request,\n  // which is a string indicating whether credentials will be sent with the\n  // request always, never, or only when sent to a same-origin URL.\n  get credentials () {\n    // The credentials getter steps are to return this’s request’s credentials mode.\n    return this[kState].credentials\n  }\n\n  // Returns the cache mode associated with request,\n  // which is a string indicating how the request will\n  // interact with the browser’s cache when fetching.\n  get cache () {\n    webidl.brandCheck(this, Request)\n\n    // The cache getter steps are to return this’s request’s cache mode.\n    return this[kState].cache\n  }\n\n  // Returns the redirect mode associated with request,\n  // which is a string indicating how redirects for the\n  // request will be handled during fetching. A request\n  // will follow redirects by default.\n  get redirect () {\n    webidl.brandCheck(this, Request)\n\n    // The redirect getter steps are to return this’s request’s redirect mode.\n    return this[kState].redirect\n  }\n\n  // Returns request’s subresource integrity metadata, which is a\n  // cryptographic hash of the resource being fetched. Its value\n  // consists of multiple hashes separated by whitespace. [SRI]\n  get integrity () {\n    webidl.brandCheck(this, Request)\n\n    // The integrity getter steps are to return this’s request’s integrity\n    // metadata.\n    return this[kState].integrity\n  }\n\n  // Returns a boolean indicating whether or not request can outlive the\n  // global in which it was created.\n  get keepalive () {\n    webidl.brandCheck(this, Request)\n\n    // The keepalive getter steps are to return this’s request’s keepalive.\n    return this[kState].keepalive\n  }\n\n  // Returns a boolean indicating whether or not request is for a reload\n  // navigation.\n  get isReloadNavigation () {\n    webidl.brandCheck(this, Request)\n\n    // The isReloadNavigation getter steps are to return true if this’s\n    // request’s reload-navigation flag is set; otherwise false.\n    return this[kState].reloadNavigation\n  }\n\n  // Returns a boolean indicating whether or not request is for a history\n  // navigation (a.k.a. back-forward navigation).\n  get isHistoryNavigation () {\n    webidl.brandCheck(this, Request)\n\n    // The isHistoryNavigation getter steps are to return true if this’s request’s\n    // history-navigation flag is set; otherwise false.\n    return this[kState].historyNavigation\n  }\n\n  // Returns the signal associated with request, which is an AbortSignal\n  // object indicating whether or not request has been aborted, and its\n  // abort event handler.\n  get signal () {\n    webidl.brandCheck(this, Request)\n\n    // The signal getter steps are to return this’s signal.\n    return this[kSignal]\n  }\n\n  get body () {\n    webidl.brandCheck(this, Request)\n\n    return this[kState].body ? this[kState].body.stream : null\n  }\n\n  get bodyUsed () {\n    webidl.brandCheck(this, Request)\n\n    return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n  }\n\n  get duplex () {\n    webidl.brandCheck(this, Request)\n\n    return 'half'\n  }\n\n  // Returns a clone of request.\n  clone () {\n    webidl.brandCheck(this, Request)\n\n    // 1. If this is unusable, then throw a TypeError.\n    if (bodyUnusable(this)) {\n      throw new TypeError('unusable')\n    }\n\n    // 2. Let clonedRequest be the result of cloning this’s request.\n    const clonedRequest = cloneRequest(this[kState])\n\n    // 3. Let clonedRequestObject be the result of creating a Request object,\n    // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.\n    // 4. Make clonedRequestObject’s signal follow this’s signal.\n    const ac = new AbortController()\n    if (this.signal.aborted) {\n      ac.abort(this.signal.reason)\n    } else {\n      let list = dependentControllerMap.get(this.signal)\n      if (list === undefined) {\n        list = new Set()\n        dependentControllerMap.set(this.signal, list)\n      }\n      const acRef = new WeakRef(ac)\n      list.add(acRef)\n      util.addAbortListener(\n        ac.signal,\n        buildAbort(acRef)\n      )\n    }\n\n    // 4. Return clonedRequestObject.\n    return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders]))\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    if (options.depth === null) {\n      options.depth = 2\n    }\n\n    options.colors ??= true\n\n    const properties = {\n      method: this.method,\n      url: this.url,\n      headers: this.headers,\n      destination: this.destination,\n      referrer: this.referrer,\n      referrerPolicy: this.referrerPolicy,\n      mode: this.mode,\n      credentials: this.credentials,\n      cache: this.cache,\n      redirect: this.redirect,\n      integrity: this.integrity,\n      keepalive: this.keepalive,\n      isReloadNavigation: this.isReloadNavigation,\n      isHistoryNavigation: this.isHistoryNavigation,\n      signal: this.signal\n    }\n\n    return `Request ${nodeUtil.formatWithOptions(options, properties)}`\n  }\n}\n\nmixinBody(Request)\n\n// https://fetch.spec.whatwg.org/#requests\nfunction makeRequest (init) {\n  return {\n    method: init.method ?? 'GET',\n    localURLsOnly: init.localURLsOnly ?? false,\n    unsafeRequest: init.unsafeRequest ?? false,\n    body: init.body ?? null,\n    client: init.client ?? null,\n    reservedClient: init.reservedClient ?? null,\n    replacesClientId: init.replacesClientId ?? '',\n    window: init.window ?? 'client',\n    keepalive: init.keepalive ?? false,\n    serviceWorkers: init.serviceWorkers ?? 'all',\n    initiator: init.initiator ?? '',\n    destination: init.destination ?? '',\n    priority: init.priority ?? null,\n    origin: init.origin ?? 'client',\n    policyContainer: init.policyContainer ?? 'client',\n    referrer: init.referrer ?? 'client',\n    referrerPolicy: init.referrerPolicy ?? '',\n    mode: init.mode ?? 'no-cors',\n    useCORSPreflightFlag: init.useCORSPreflightFlag ?? false,\n    credentials: init.credentials ?? 'same-origin',\n    useCredentials: init.useCredentials ?? false,\n    cache: init.cache ?? 'default',\n    redirect: init.redirect ?? 'follow',\n    integrity: init.integrity ?? '',\n    cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? '',\n    parserMetadata: init.parserMetadata ?? '',\n    reloadNavigation: init.reloadNavigation ?? false,\n    historyNavigation: init.historyNavigation ?? false,\n    userActivation: init.userActivation ?? false,\n    taintedOrigin: init.taintedOrigin ?? false,\n    redirectCount: init.redirectCount ?? 0,\n    responseTainting: init.responseTainting ?? 'basic',\n    preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false,\n    done: init.done ?? false,\n    timingAllowFailed: init.timingAllowFailed ?? false,\n    urlList: init.urlList,\n    url: init.urlList[0],\n    headersList: init.headersList\n      ? new HeadersList(init.headersList)\n      : new HeadersList()\n  }\n}\n\n// https://fetch.spec.whatwg.org/#concept-request-clone\nfunction cloneRequest (request) {\n  // To clone a request request, run these steps:\n\n  // 1. Let newRequest be a copy of request, except for its body.\n  const newRequest = makeRequest({ ...request, body: null })\n\n  // 2. If request’s body is non-null, set newRequest’s body to the\n  // result of cloning request’s body.\n  if (request.body != null) {\n    newRequest.body = cloneBody(newRequest, request.body)\n  }\n\n  // 3. Return newRequest.\n  return newRequest\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-create\n * @param {any} innerRequest\n * @param {AbortSignal} signal\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Request}\n */\nfunction fromInnerRequest (innerRequest, signal, guard) {\n  const request = new Request(kConstruct)\n  request[kState] = innerRequest\n  request[kSignal] = signal\n  request[kHeaders] = new Headers(kConstruct)\n  setHeadersList(request[kHeaders], innerRequest.headersList)\n  setHeadersGuard(request[kHeaders], guard)\n  return request\n}\n\nObject.defineProperties(Request.prototype, {\n  method: kEnumerableProperty,\n  url: kEnumerableProperty,\n  headers: kEnumerableProperty,\n  redirect: kEnumerableProperty,\n  clone: kEnumerableProperty,\n  signal: kEnumerableProperty,\n  duplex: kEnumerableProperty,\n  destination: kEnumerableProperty,\n  body: kEnumerableProperty,\n  bodyUsed: kEnumerableProperty,\n  isHistoryNavigation: kEnumerableProperty,\n  isReloadNavigation: kEnumerableProperty,\n  keepalive: kEnumerableProperty,\n  integrity: kEnumerableProperty,\n  cache: kEnumerableProperty,\n  credentials: kEnumerableProperty,\n  attribute: kEnumerableProperty,\n  referrerPolicy: kEnumerableProperty,\n  referrer: kEnumerableProperty,\n  mode: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Request',\n    configurable: true\n  }\n})\n\nwebidl.converters.Request = webidl.interfaceConverter(\n  Request\n)\n\n// https://fetch.spec.whatwg.org/#requestinfo\nwebidl.converters.RequestInfo = function (V, prefix, argument) {\n  if (typeof V === 'string') {\n    return webidl.converters.USVString(V, prefix, argument)\n  }\n\n  if (V instanceof Request) {\n    return webidl.converters.Request(V, prefix, argument)\n  }\n\n  return webidl.converters.USVString(V, prefix, argument)\n}\n\nwebidl.converters.AbortSignal = webidl.interfaceConverter(\n  AbortSignal\n)\n\n// https://fetch.spec.whatwg.org/#requestinit\nwebidl.converters.RequestInit = webidl.dictionaryConverter([\n  {\n    key: 'method',\n    converter: webidl.converters.ByteString\n  },\n  {\n    key: 'headers',\n    converter: webidl.converters.HeadersInit\n  },\n  {\n    key: 'body',\n    converter: webidl.nullableConverter(\n      webidl.converters.BodyInit\n    )\n  },\n  {\n    key: 'referrer',\n    converter: webidl.converters.USVString\n  },\n  {\n    key: 'referrerPolicy',\n    converter: webidl.converters.DOMString,\n    // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n    allowedValues: referrerPolicy\n  },\n  {\n    key: 'mode',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#concept-request-mode\n    allowedValues: requestMode\n  },\n  {\n    key: 'credentials',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestcredentials\n    allowedValues: requestCredentials\n  },\n  {\n    key: 'cache',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestcache\n    allowedValues: requestCache\n  },\n  {\n    key: 'redirect',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestredirect\n    allowedValues: requestRedirect\n  },\n  {\n    key: 'integrity',\n    converter: webidl.converters.DOMString\n  },\n  {\n    key: 'keepalive',\n    converter: webidl.converters.boolean\n  },\n  {\n    key: 'signal',\n    converter: webidl.nullableConverter(\n      (signal) => webidl.converters.AbortSignal(\n        signal,\n        'RequestInit',\n        'signal',\n        { strict: false }\n      )\n    )\n  },\n  {\n    key: 'window',\n    converter: webidl.converters.any\n  },\n  {\n    key: 'duplex',\n    converter: webidl.converters.DOMString,\n    allowedValues: requestDuplex\n  },\n  {\n    key: 'dispatcher', // undici specific option\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }\n","'use strict'\n\nconst { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require('./headers')\nconst { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require('./body')\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst { kEnumerableProperty } = util\nconst {\n  isValidReasonPhrase,\n  isCancelled,\n  isAborted,\n  isBlobLike,\n  serializeJavascriptValueToJSONString,\n  isErrorLike,\n  isomorphicEncode,\n  environmentSettingsObject: relevantRealm\n} = require('./util')\nconst {\n  redirectStatusSet,\n  nullBodyStatus\n} = require('./constants')\nconst { kState, kHeaders } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { FormData } = require('./formdata')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { types } = require('node:util')\n\nconst textEncoder = new TextEncoder('utf-8')\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response {\n  // Creates network error Response.\n  static error () {\n    // The static error() method steps are to return the result of creating a\n    // Response object, given a new network error, \"immutable\", and this’s\n    // relevant Realm.\n    const responseObject = fromInnerResponse(makeNetworkError(), 'immutable')\n\n    return responseObject\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-json\n  static json (data, init = {}) {\n    webidl.argumentLengthCheck(arguments, 1, 'Response.json')\n\n    if (init !== null) {\n      init = webidl.converters.ResponseInit(init)\n    }\n\n    // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.\n    const bytes = textEncoder.encode(\n      serializeJavascriptValueToJSONString(data)\n    )\n\n    // 2. Let body be the result of extracting bytes.\n    const body = extractBody(bytes)\n\n    // 3. Let responseObject be the result of creating a Response object, given a new response,\n    //    \"response\", and this’s relevant Realm.\n    const responseObject = fromInnerResponse(makeResponse({}), 'response')\n\n    // 4. Perform initialize a response given responseObject, init, and (body, \"application/json\").\n    initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })\n\n    // 5. Return responseObject.\n    return responseObject\n  }\n\n  // Creates a redirect Response that redirects to url with status status.\n  static redirect (url, status = 302) {\n    webidl.argumentLengthCheck(arguments, 1, 'Response.redirect')\n\n    url = webidl.converters.USVString(url)\n    status = webidl.converters['unsigned short'](status)\n\n    // 1. Let parsedURL be the result of parsing url with current settings\n    // object’s API base URL.\n    // 2. If parsedURL is failure, then throw a TypeError.\n    // TODO: base-URL?\n    let parsedURL\n    try {\n      parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl)\n    } catch (err) {\n      throw new TypeError(`Failed to parse URL from ${url}`, { cause: err })\n    }\n\n    // 3. If status is not a redirect status, then throw a RangeError.\n    if (!redirectStatusSet.has(status)) {\n      throw new RangeError(`Invalid status code ${status}`)\n    }\n\n    // 4. Let responseObject be the result of creating a Response object,\n    // given a new response, \"immutable\", and this’s relevant Realm.\n    const responseObject = fromInnerResponse(makeResponse({}), 'immutable')\n\n    // 5. Set responseObject’s response’s status to status.\n    responseObject[kState].status = status\n\n    // 6. Let value be parsedURL, serialized and isomorphic encoded.\n    const value = isomorphicEncode(URLSerializer(parsedURL))\n\n    // 7. Append `Location`/value to responseObject’s response’s header list.\n    responseObject[kState].headersList.append('location', value, true)\n\n    // 8. Return responseObject.\n    return responseObject\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response\n  constructor (body = null, init = {}) {\n    webidl.util.markAsUncloneable(this)\n    if (body === kConstruct) {\n      return\n    }\n\n    if (body !== null) {\n      body = webidl.converters.BodyInit(body)\n    }\n\n    init = webidl.converters.ResponseInit(init)\n\n    // 1. Set this’s response to a new response.\n    this[kState] = makeResponse({})\n\n    // 2. Set this’s headers to a new Headers object with this’s relevant\n    // Realm, whose header list is this’s response’s header list and guard\n    // is \"response\".\n    this[kHeaders] = new Headers(kConstruct)\n    setHeadersGuard(this[kHeaders], 'response')\n    setHeadersList(this[kHeaders], this[kState].headersList)\n\n    // 3. Let bodyWithType be null.\n    let bodyWithType = null\n\n    // 4. If body is non-null, then set bodyWithType to the result of extracting body.\n    if (body != null) {\n      const [extractedBody, type] = extractBody(body)\n      bodyWithType = { body: extractedBody, type }\n    }\n\n    // 5. Perform initialize a response given this, init, and bodyWithType.\n    initializeResponse(this, init, bodyWithType)\n  }\n\n  // Returns response’s type, e.g., \"cors\".\n  get type () {\n    webidl.brandCheck(this, Response)\n\n    // The type getter steps are to return this’s response’s type.\n    return this[kState].type\n  }\n\n  // Returns response’s URL, if it has one; otherwise the empty string.\n  get url () {\n    webidl.brandCheck(this, Response)\n\n    const urlList = this[kState].urlList\n\n    // The url getter steps are to return the empty string if this’s\n    // response’s URL is null; otherwise this’s response’s URL,\n    // serialized with exclude fragment set to true.\n    const url = urlList[urlList.length - 1] ?? null\n\n    if (url === null) {\n      return ''\n    }\n\n    return URLSerializer(url, true)\n  }\n\n  // Returns whether response was obtained through a redirect.\n  get redirected () {\n    webidl.brandCheck(this, Response)\n\n    // The redirected getter steps are to return true if this’s response’s URL\n    // list has more than one item; otherwise false.\n    return this[kState].urlList.length > 1\n  }\n\n  // Returns response’s status.\n  get status () {\n    webidl.brandCheck(this, Response)\n\n    // The status getter steps are to return this’s response’s status.\n    return this[kState].status\n  }\n\n  // Returns whether response’s status is an ok status.\n  get ok () {\n    webidl.brandCheck(this, Response)\n\n    // The ok getter steps are to return true if this’s response’s status is an\n    // ok status; otherwise false.\n    return this[kState].status >= 200 && this[kState].status <= 299\n  }\n\n  // Returns response’s status message.\n  get statusText () {\n    webidl.brandCheck(this, Response)\n\n    // The statusText getter steps are to return this’s response’s status\n    // message.\n    return this[kState].statusText\n  }\n\n  // Returns response’s headers as Headers.\n  get headers () {\n    webidl.brandCheck(this, Response)\n\n    // The headers getter steps are to return this’s headers.\n    return this[kHeaders]\n  }\n\n  get body () {\n    webidl.brandCheck(this, Response)\n\n    return this[kState].body ? this[kState].body.stream : null\n  }\n\n  get bodyUsed () {\n    webidl.brandCheck(this, Response)\n\n    return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n  }\n\n  // Returns a clone of response.\n  clone () {\n    webidl.brandCheck(this, Response)\n\n    // 1. If this is unusable, then throw a TypeError.\n    if (bodyUnusable(this)) {\n      throw webidl.errors.exception({\n        header: 'Response.clone',\n        message: 'Body has already been consumed.'\n      })\n    }\n\n    // 2. Let clonedResponse be the result of cloning this’s response.\n    const clonedResponse = cloneResponse(this[kState])\n\n    // Note: To re-register because of a new stream.\n    if (hasFinalizationRegistry && this[kState].body?.stream) {\n      streamRegistry.register(this, new WeakRef(this[kState].body.stream))\n    }\n\n    // 3. Return the result of creating a Response object, given\n    // clonedResponse, this’s headers’s guard, and this’s relevant Realm.\n    return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders]))\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    if (options.depth === null) {\n      options.depth = 2\n    }\n\n    options.colors ??= true\n\n    const properties = {\n      status: this.status,\n      statusText: this.statusText,\n      headers: this.headers,\n      body: this.body,\n      bodyUsed: this.bodyUsed,\n      ok: this.ok,\n      redirected: this.redirected,\n      type: this.type,\n      url: this.url\n    }\n\n    return `Response ${nodeUtil.formatWithOptions(options, properties)}`\n  }\n}\n\nmixinBody(Response)\n\nObject.defineProperties(Response.prototype, {\n  type: kEnumerableProperty,\n  url: kEnumerableProperty,\n  status: kEnumerableProperty,\n  ok: kEnumerableProperty,\n  redirected: kEnumerableProperty,\n  statusText: kEnumerableProperty,\n  headers: kEnumerableProperty,\n  clone: kEnumerableProperty,\n  body: kEnumerableProperty,\n  bodyUsed: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Response',\n    configurable: true\n  }\n})\n\nObject.defineProperties(Response, {\n  json: kEnumerableProperty,\n  redirect: kEnumerableProperty,\n  error: kEnumerableProperty\n})\n\n// https://fetch.spec.whatwg.org/#concept-response-clone\nfunction cloneResponse (response) {\n  // To clone a response response, run these steps:\n\n  // 1. If response is a filtered response, then return a new identical\n  // filtered response whose internal response is a clone of response’s\n  // internal response.\n  if (response.internalResponse) {\n    return filterResponse(\n      cloneResponse(response.internalResponse),\n      response.type\n    )\n  }\n\n  // 2. Let newResponse be a copy of response, except for its body.\n  const newResponse = makeResponse({ ...response, body: null })\n\n  // 3. If response’s body is non-null, then set newResponse’s body to the\n  // result of cloning response’s body.\n  if (response.body != null) {\n    newResponse.body = cloneBody(newResponse, response.body)\n  }\n\n  // 4. Return newResponse.\n  return newResponse\n}\n\nfunction makeResponse (init) {\n  return {\n    aborted: false,\n    rangeRequested: false,\n    timingAllowPassed: false,\n    requestIncludesCredentials: false,\n    type: 'default',\n    status: 200,\n    timingInfo: null,\n    cacheState: '',\n    statusText: '',\n    ...init,\n    headersList: init?.headersList\n      ? new HeadersList(init?.headersList)\n      : new HeadersList(),\n    urlList: init?.urlList ? [...init.urlList] : []\n  }\n}\n\nfunction makeNetworkError (reason) {\n  const isError = isErrorLike(reason)\n  return makeResponse({\n    type: 'error',\n    status: 0,\n    error: isError\n      ? reason\n      : new Error(reason ? String(reason) : reason),\n    aborted: reason && reason.name === 'AbortError'\n  })\n}\n\n// @see https://fetch.spec.whatwg.org/#concept-network-error\nfunction isNetworkError (response) {\n  return (\n    // A network error is a response whose type is \"error\",\n    response.type === 'error' &&\n    // status is 0\n    response.status === 0\n  )\n}\n\nfunction makeFilteredResponse (response, state) {\n  state = {\n    internalResponse: response,\n    ...state\n  }\n\n  return new Proxy(response, {\n    get (target, p) {\n      return p in state ? state[p] : target[p]\n    },\n    set (target, p, value) {\n      assert(!(p in state))\n      target[p] = value\n      return true\n    }\n  })\n}\n\n// https://fetch.spec.whatwg.org/#concept-filtered-response\nfunction filterResponse (response, type) {\n  // Set response to the following filtered response with response as its\n  // internal response, depending on request’s response tainting:\n  if (type === 'basic') {\n    // A basic filtered response is a filtered response whose type is \"basic\"\n    // and header list excludes any headers in internal response’s header list\n    // whose name is a forbidden response-header name.\n\n    // Note: undici does not implement forbidden response-header names\n    return makeFilteredResponse(response, {\n      type: 'basic',\n      headersList: response.headersList\n    })\n  } else if (type === 'cors') {\n    // A CORS filtered response is a filtered response whose type is \"cors\"\n    // and header list excludes any headers in internal response’s header\n    // list whose name is not a CORS-safelisted response-header name, given\n    // internal response’s CORS-exposed header-name list.\n\n    // Note: undici does not implement CORS-safelisted response-header names\n    return makeFilteredResponse(response, {\n      type: 'cors',\n      headersList: response.headersList\n    })\n  } else if (type === 'opaque') {\n    // An opaque filtered response is a filtered response whose type is\n    // \"opaque\", URL list is the empty list, status is 0, status message\n    // is the empty byte sequence, header list is empty, and body is null.\n\n    return makeFilteredResponse(response, {\n      type: 'opaque',\n      urlList: Object.freeze([]),\n      status: 0,\n      statusText: '',\n      body: null\n    })\n  } else if (type === 'opaqueredirect') {\n    // An opaque-redirect filtered response is a filtered response whose type\n    // is \"opaqueredirect\", status is 0, status message is the empty byte\n    // sequence, header list is empty, and body is null.\n\n    return makeFilteredResponse(response, {\n      type: 'opaqueredirect',\n      status: 0,\n      statusText: '',\n      headersList: [],\n      body: null\n    })\n  } else {\n    assert(false)\n  }\n}\n\n// https://fetch.spec.whatwg.org/#appropriate-network-error\nfunction makeAppropriateNetworkError (fetchParams, err = null) {\n  // 1. Assert: fetchParams is canceled.\n  assert(isCancelled(fetchParams))\n\n  // 2. Return an aborted network error if fetchParams is aborted;\n  // otherwise return a network error.\n  return isAborted(fetchParams)\n    ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))\n    : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))\n}\n\n// https://whatpr.org/fetch/1392.html#initialize-a-response\nfunction initializeResponse (response, init, body) {\n  // 1. If init[\"status\"] is not in the range 200 to 599, inclusive, then\n  //    throw a RangeError.\n  if (init.status !== null && (init.status < 200 || init.status > 599)) {\n    throw new RangeError('init[\"status\"] must be in the range of 200 to 599, inclusive.')\n  }\n\n  // 2. If init[\"statusText\"] does not match the reason-phrase token production,\n  //    then throw a TypeError.\n  if ('statusText' in init && init.statusText != null) {\n    // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:\n    //   reason-phrase  = *( HTAB / SP / VCHAR / obs-text )\n    if (!isValidReasonPhrase(String(init.statusText))) {\n      throw new TypeError('Invalid statusText')\n    }\n  }\n\n  // 3. Set response’s response’s status to init[\"status\"].\n  if ('status' in init && init.status != null) {\n    response[kState].status = init.status\n  }\n\n  // 4. Set response’s response’s status message to init[\"statusText\"].\n  if ('statusText' in init && init.statusText != null) {\n    response[kState].statusText = init.statusText\n  }\n\n  // 5. If init[\"headers\"] exists, then fill response’s headers with init[\"headers\"].\n  if ('headers' in init && init.headers != null) {\n    fill(response[kHeaders], init.headers)\n  }\n\n  // 6. If body was given, then:\n  if (body) {\n    // 1. If response's status is a null body status, then throw a TypeError.\n    if (nullBodyStatus.includes(response.status)) {\n      throw webidl.errors.exception({\n        header: 'Response constructor',\n        message: `Invalid response status code ${response.status}`\n      })\n    }\n\n    // 2. Set response's body to body's body.\n    response[kState].body = body.body\n\n    // 3. If body's type is non-null and response's header list does not contain\n    //    `Content-Type`, then append (`Content-Type`, body's type) to response's header list.\n    if (body.type != null && !response[kState].headersList.contains('content-type', true)) {\n      response[kState].headersList.append('content-type', body.type, true)\n    }\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#response-create\n * @param {any} innerResponse\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Response}\n */\nfunction fromInnerResponse (innerResponse, guard) {\n  const response = new Response(kConstruct)\n  response[kState] = innerResponse\n  response[kHeaders] = new Headers(kConstruct)\n  setHeadersList(response[kHeaders], innerResponse.headersList)\n  setHeadersGuard(response[kHeaders], guard)\n\n  if (hasFinalizationRegistry && innerResponse.body?.stream) {\n    // If the target (response) is reclaimed, the cleanup callback may be called at some point with\n    // the held value provided for it (innerResponse.body.stream). The held value can be any value:\n    // a primitive or an object, even undefined. If the held value is an object, the registry keeps\n    // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n    streamRegistry.register(response, new WeakRef(innerResponse.body.stream))\n  }\n\n  return response\n}\n\nwebidl.converters.ReadableStream = webidl.interfaceConverter(\n  ReadableStream\n)\n\nwebidl.converters.FormData = webidl.interfaceConverter(\n  FormData\n)\n\nwebidl.converters.URLSearchParams = webidl.interfaceConverter(\n  URLSearchParams\n)\n\n// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit\nwebidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) {\n  if (typeof V === 'string') {\n    return webidl.converters.USVString(V, prefix, name)\n  }\n\n  if (isBlobLike(V)) {\n    return webidl.converters.Blob(V, prefix, name, { strict: false })\n  }\n\n  if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n    return webidl.converters.BufferSource(V, prefix, name)\n  }\n\n  if (util.isFormDataLike(V)) {\n    return webidl.converters.FormData(V, prefix, name, { strict: false })\n  }\n\n  if (V instanceof URLSearchParams) {\n    return webidl.converters.URLSearchParams(V, prefix, name)\n  }\n\n  return webidl.converters.DOMString(V, prefix, name)\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit\nwebidl.converters.BodyInit = function (V, prefix, argument) {\n  if (V instanceof ReadableStream) {\n    return webidl.converters.ReadableStream(V, prefix, argument)\n  }\n\n  // Note: the spec doesn't include async iterables,\n  // this is an undici extension.\n  if (V?.[Symbol.asyncIterator]) {\n    return V\n  }\n\n  return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument)\n}\n\nwebidl.converters.ResponseInit = webidl.dictionaryConverter([\n  {\n    key: 'status',\n    converter: webidl.converters['unsigned short'],\n    defaultValue: () => 200\n  },\n  {\n    key: 'statusText',\n    converter: webidl.converters.ByteString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'headers',\n    converter: webidl.converters.HeadersInit\n  }\n])\n\nmodule.exports = {\n  isNetworkError,\n  makeNetworkError,\n  makeResponse,\n  makeAppropriateNetworkError,\n  filterResponse,\n  Response,\n  cloneResponse,\n  fromInnerResponse\n}\n","'use strict'\n\nmodule.exports = {\n  kUrl: Symbol('url'),\n  kHeaders: Symbol('headers'),\n  kSignal: Symbol('signal'),\n  kState: Symbol('state'),\n  kDispatcher: Symbol('dispatcher')\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst zlib = require('node:zlib')\nconst { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants')\nconst { getGlobalOrigin } = require('./global')\nconst { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require('./data-url')\nconst { performance } = require('node:perf_hooks')\nconst { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require('../../core/util')\nconst assert = require('node:assert')\nconst { isUint8Array } = require('node:util/types')\nconst { webidl } = require('./webidl')\n\nlet supportedHashes = []\n\n// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable\n/** @type {import('crypto')} */\nlet crypto\ntry {\n  crypto = require('node:crypto')\n  const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']\n  supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))\n/* c8 ignore next 3 */\n} catch {\n\n}\n\nfunction responseURL (response) {\n  // https://fetch.spec.whatwg.org/#responses\n  // A response has an associated URL. It is a pointer to the last URL\n  // in response’s URL list and null if response’s URL list is empty.\n  const urlList = response.urlList\n  const length = urlList.length\n  return length === 0 ? null : urlList[length - 1].toString()\n}\n\n// https://fetch.spec.whatwg.org/#concept-response-location-url\nfunction responseLocationURL (response, requestFragment) {\n  // 1. If response’s status is not a redirect status, then return null.\n  if (!redirectStatusSet.has(response.status)) {\n    return null\n  }\n\n  // 2. Let location be the result of extracting header list values given\n  // `Location` and response’s header list.\n  let location = response.headersList.get('location', true)\n\n  // 3. If location is a header value, then set location to the result of\n  //    parsing location with response’s URL.\n  if (location !== null && isValidHeaderValue(location)) {\n    if (!isValidEncodedURL(location)) {\n      // Some websites respond location header in UTF-8 form without encoding them as ASCII\n      // and major browsers redirect them to correctly UTF-8 encoded addresses.\n      // Here, we handle that behavior in the same way.\n      location = normalizeBinaryStringToUtf8(location)\n    }\n    location = new URL(location, responseURL(response))\n  }\n\n  // 4. If location is a URL whose fragment is null, then set location’s\n  // fragment to requestFragment.\n  if (location && !location.hash) {\n    location.hash = requestFragment\n  }\n\n  // 5. Return location.\n  return location\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2\n * @param {string} url\n * @returns {boolean}\n */\nfunction isValidEncodedURL (url) {\n  for (let i = 0; i < url.length; ++i) {\n    const code = url.charCodeAt(i)\n\n    if (\n      code > 0x7E || // Non-US-ASCII + DEL\n      code < 0x20 // Control characters NUL - US\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it.\n * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well.\n * @param {string} value\n * @returns {string}\n */\nfunction normalizeBinaryStringToUtf8 (value) {\n  return Buffer.from(value, 'binary').toString('utf8')\n}\n\n/** @returns {URL} */\nfunction requestCurrentURL (request) {\n  return request.urlList[request.urlList.length - 1]\n}\n\nfunction requestBadPort (request) {\n  // 1. Let url be request’s current URL.\n  const url = requestCurrentURL(request)\n\n  // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,\n  // then return blocked.\n  if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {\n    return 'blocked'\n  }\n\n  // 3. Return allowed.\n  return 'allowed'\n}\n\nfunction isErrorLike (object) {\n  return object instanceof Error || (\n    object?.constructor?.name === 'Error' ||\n    object?.constructor?.name === 'DOMException'\n  )\n}\n\n// Check whether |statusText| is a ByteString and\n// matches the Reason-Phrase token production.\n// RFC 2616: https://tools.ietf.org/html/rfc2616\n// RFC 7230: https://tools.ietf.org/html/rfc7230\n// \"reason-phrase = *( HTAB / SP / VCHAR / obs-text )\"\n// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116\nfunction isValidReasonPhrase (statusText) {\n  for (let i = 0; i < statusText.length; ++i) {\n    const c = statusText.charCodeAt(i)\n    if (\n      !(\n        (\n          c === 0x09 || // HTAB\n          (c >= 0x20 && c <= 0x7e) || // SP / VCHAR\n          (c >= 0x80 && c <= 0xff)\n        ) // obs-text\n      )\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-name\n * @param {string} potentialValue\n */\nconst isValidHeaderName = isValidHTTPToken\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value\n * @param {string} potentialValue\n */\nfunction isValidHeaderValue (potentialValue) {\n  // - Has no leading or trailing HTTP tab or space bytes.\n  // - Contains no 0x00 (NUL) or HTTP newline bytes.\n  return (\n    potentialValue[0] === '\\t' ||\n    potentialValue[0] === ' ' ||\n    potentialValue[potentialValue.length - 1] === '\\t' ||\n    potentialValue[potentialValue.length - 1] === ' ' ||\n    potentialValue.includes('\\n') ||\n    potentialValue.includes('\\r') ||\n    potentialValue.includes('\\0')\n  ) === false\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect\nfunction setRequestReferrerPolicyOnRedirect (request, actualResponse) {\n  //  Given a request request and a response actualResponse, this algorithm\n  //  updates request’s referrer policy according to the Referrer-Policy\n  //  header (if any) in actualResponse.\n\n  // 1. Let policy be the result of executing § 8.1 Parse a referrer policy\n  // from a Referrer-Policy header on actualResponse.\n\n  // 8.1 Parse a referrer policy from a Referrer-Policy header\n  // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.\n  const { headersList } = actualResponse\n  // 2. Let policy be the empty string.\n  // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.\n  // 4. Return policy.\n  const policyHeader = (headersList.get('referrer-policy', true) ?? '').split(',')\n\n  // Note: As the referrer-policy can contain multiple policies\n  // separated by comma, we need to loop through all of them\n  // and pick the first valid one.\n  // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy\n  let policy = ''\n  if (policyHeader.length > 0) {\n    // The right-most policy takes precedence.\n    // The left-most policy is the fallback.\n    for (let i = policyHeader.length; i !== 0; i--) {\n      const token = policyHeader[i - 1].trim()\n      if (referrerPolicyTokens.has(token)) {\n        policy = token\n        break\n      }\n    }\n  }\n\n  // 2. If policy is not the empty string, then set request’s referrer policy to policy.\n  if (policy !== '') {\n    request.referrerPolicy = policy\n  }\n}\n\n// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check\nfunction crossOriginResourcePolicyCheck () {\n  // TODO\n  return 'allowed'\n}\n\n// https://fetch.spec.whatwg.org/#concept-cors-check\nfunction corsCheck () {\n  // TODO\n  return 'success'\n}\n\n// https://fetch.spec.whatwg.org/#concept-tao-check\nfunction TAOCheck () {\n  // TODO\n  return 'success'\n}\n\nfunction appendFetchMetadata (httpRequest) {\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header\n  //  TODO\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header\n\n  //  1. Assert: r’s url is a potentially trustworthy URL.\n  //  TODO\n\n  //  2. Let header be a Structured Header whose value is a token.\n  let header = null\n\n  //  3. Set header’s value to r’s mode.\n  header = httpRequest.mode\n\n  //  4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.\n  httpRequest.headersList.set('sec-fetch-mode', header, true)\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header\n  //  TODO\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header\n  //  TODO\n}\n\n// https://fetch.spec.whatwg.org/#append-a-request-origin-header\nfunction appendRequestOriginHeader (request) {\n  // 1. Let serializedOrigin be the result of byte-serializing a request origin\n  //    with request.\n  // TODO: implement \"byte-serializing a request origin\"\n  let serializedOrigin = request.origin\n\n  // - \"'client' is changed to an origin during fetching.\"\n  //   This doesn't happen in undici (in most cases) because undici, by default,\n  //   has no concept of origin.\n  // - request.origin can also be set to request.client.origin (client being\n  //   an environment settings object), which is undefined without using\n  //   setGlobalOrigin.\n  if (serializedOrigin === 'client' || serializedOrigin === undefined) {\n    return\n  }\n\n  // 2. If request’s response tainting is \"cors\" or request’s mode is \"websocket\",\n  //    then append (`Origin`, serializedOrigin) to request’s header list.\n  // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:\n  if (request.responseTainting === 'cors' || request.mode === 'websocket') {\n    request.headersList.append('origin', serializedOrigin, true)\n  } else if (request.method !== 'GET' && request.method !== 'HEAD') {\n    // 1. Switch on request’s referrer policy:\n    switch (request.referrerPolicy) {\n      case 'no-referrer':\n        // Set serializedOrigin to `null`.\n        serializedOrigin = null\n        break\n      case 'no-referrer-when-downgrade':\n      case 'strict-origin':\n      case 'strict-origin-when-cross-origin':\n        // If request’s origin is a tuple origin, its scheme is \"https\", and\n        // request’s current URL’s scheme is not \"https\", then set\n        // serializedOrigin to `null`.\n        if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n          serializedOrigin = null\n        }\n        break\n      case 'same-origin':\n        // If request’s origin is not same origin with request’s current URL’s\n        // origin, then set serializedOrigin to `null`.\n        if (!sameOrigin(request, requestCurrentURL(request))) {\n          serializedOrigin = null\n        }\n        break\n      default:\n        // Do nothing.\n    }\n\n    // 2. Append (`Origin`, serializedOrigin) to request’s header list.\n    request.headersList.append('origin', serializedOrigin, true)\n  }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsen-time\nfunction coarsenTime (timestamp, crossOriginIsolatedCapability) {\n  // TODO\n  return timestamp\n}\n\n// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info\nfunction clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {\n  if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {\n    return {\n      domainLookupStartTime: defaultStartTime,\n      domainLookupEndTime: defaultStartTime,\n      connectionStartTime: defaultStartTime,\n      connectionEndTime: defaultStartTime,\n      secureConnectionStartTime: defaultStartTime,\n      ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol\n    }\n  }\n\n  return {\n    domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),\n    domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),\n    connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),\n    connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),\n    secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),\n    ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol\n  }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time\nfunction coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {\n  return coarsenTime(performance.now(), crossOriginIsolatedCapability)\n}\n\n// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info\nfunction createOpaqueTimingInfo (timingInfo) {\n  return {\n    startTime: timingInfo.startTime ?? 0,\n    redirectStartTime: 0,\n    redirectEndTime: 0,\n    postRedirectStartTime: timingInfo.startTime ?? 0,\n    finalServiceWorkerStartTime: 0,\n    finalNetworkResponseStartTime: 0,\n    finalNetworkRequestStartTime: 0,\n    endTime: 0,\n    encodedBodySize: 0,\n    decodedBodySize: 0,\n    finalConnectionTimingInfo: null\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#policy-container\nfunction makePolicyContainer () {\n  // Note: the fetch spec doesn't make use of embedder policy or CSP list\n  return {\n    referrerPolicy: 'strict-origin-when-cross-origin'\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container\nfunction clonePolicyContainer (policyContainer) {\n  return {\n    referrerPolicy: policyContainer.referrerPolicy\n  }\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer\nfunction determineRequestsReferrer (request) {\n  // 1. Let policy be request's referrer policy.\n  const policy = request.referrerPolicy\n\n  // Note: policy cannot (shouldn't) be null or an empty string.\n  assert(policy)\n\n  // 2. Let environment be request’s client.\n\n  let referrerSource = null\n\n  // 3. Switch on request’s referrer:\n  if (request.referrer === 'client') {\n    // Note: node isn't a browser and doesn't implement document/iframes,\n    // so we bypass this step and replace it with our own.\n\n    const globalOrigin = getGlobalOrigin()\n\n    if (!globalOrigin || globalOrigin.origin === 'null') {\n      return 'no-referrer'\n    }\n\n    // note: we need to clone it as it's mutated\n    referrerSource = new URL(globalOrigin)\n  } else if (request.referrer instanceof URL) {\n    // Let referrerSource be request’s referrer.\n    referrerSource = request.referrer\n  }\n\n  // 4. Let request’s referrerURL be the result of stripping referrerSource for\n  //    use as a referrer.\n  let referrerURL = stripURLForReferrer(referrerSource)\n\n  // 5. Let referrerOrigin be the result of stripping referrerSource for use as\n  //    a referrer, with the origin-only flag set to true.\n  const referrerOrigin = stripURLForReferrer(referrerSource, true)\n\n  // 6. If the result of serializing referrerURL is a string whose length is\n  //    greater than 4096, set referrerURL to referrerOrigin.\n  if (referrerURL.toString().length > 4096) {\n    referrerURL = referrerOrigin\n  }\n\n  const areSameOrigin = sameOrigin(request, referrerURL)\n  const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&\n    !isURLPotentiallyTrustworthy(request.url)\n\n  // 8. Execute the switch statements corresponding to the value of policy:\n  switch (policy) {\n    case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)\n    case 'unsafe-url': return referrerURL\n    case 'same-origin':\n      return areSameOrigin ? referrerOrigin : 'no-referrer'\n    case 'origin-when-cross-origin':\n      return areSameOrigin ? referrerURL : referrerOrigin\n    case 'strict-origin-when-cross-origin': {\n      const currentURL = requestCurrentURL(request)\n\n      // 1. If the origin of referrerURL and the origin of request’s current\n      //    URL are the same, then return referrerURL.\n      if (sameOrigin(referrerURL, currentURL)) {\n        return referrerURL\n      }\n\n      // 2. If referrerURL is a potentially trustworthy URL and request’s\n      //    current URL is not a potentially trustworthy URL, then return no\n      //    referrer.\n      if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n        return 'no-referrer'\n      }\n\n      // 3. Return referrerOrigin.\n      return referrerOrigin\n    }\n    case 'strict-origin': // eslint-disable-line\n      /**\n         * 1. If referrerURL is a potentially trustworthy URL and\n         * request’s current URL is not a potentially trustworthy URL,\n         * then return no referrer.\n         * 2. Return referrerOrigin\n        */\n    case 'no-referrer-when-downgrade': // eslint-disable-line\n      /**\n       * 1. If referrerURL is a potentially trustworthy URL and\n       * request’s current URL is not a potentially trustworthy URL,\n       * then return no referrer.\n       * 2. Return referrerOrigin\n      */\n\n    default: // eslint-disable-line\n      return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin\n  }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url\n * @param {URL} url\n * @param {boolean|undefined} originOnly\n */\nfunction stripURLForReferrer (url, originOnly) {\n  // 1. Assert: url is a URL.\n  assert(url instanceof URL)\n\n  url = new URL(url)\n\n  // 2. If url’s scheme is a local scheme, then return no referrer.\n  if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {\n    return 'no-referrer'\n  }\n\n  // 3. Set url’s username to the empty string.\n  url.username = ''\n\n  // 4. Set url’s password to the empty string.\n  url.password = ''\n\n  // 5. Set url’s fragment to null.\n  url.hash = ''\n\n  // 6. If the origin-only flag is true, then:\n  if (originOnly) {\n    // 1. Set url’s path to « the empty string ».\n    url.pathname = ''\n\n    // 2. Set url’s query to null.\n    url.search = ''\n  }\n\n  // 7. Return url.\n  return url\n}\n\nfunction isURLPotentiallyTrustworthy (url) {\n  if (!(url instanceof URL)) {\n    return false\n  }\n\n  // If child of about, return true\n  if (url.href === 'about:blank' || url.href === 'about:srcdoc') {\n    return true\n  }\n\n  // If scheme is data, return true\n  if (url.protocol === 'data:') return true\n\n  // If file, return true\n  if (url.protocol === 'file:') return true\n\n  return isOriginPotentiallyTrustworthy(url.origin)\n\n  function isOriginPotentiallyTrustworthy (origin) {\n    // If origin is explicitly null, return false\n    if (origin == null || origin === 'null') return false\n\n    const originAsURL = new URL(origin)\n\n    // If secure, return true\n    if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {\n      return true\n    }\n\n    // If localhost or variants, return true\n    if (/^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^\\[(?:0*:)*?:?0*1\\]$/.test(originAsURL.hostname) ||\n     (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||\n     (originAsURL.hostname.endsWith('.localhost'))) {\n      return true\n    }\n\n    // If any other, return false\n    return false\n  }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist\n * @param {Uint8Array} bytes\n * @param {string} metadataList\n */\nfunction bytesMatch (bytes, metadataList) {\n  // If node is not built with OpenSSL support, we cannot check\n  // a request's integrity, so allow it by default (the spec will\n  // allow requests if an invalid hash is given, as precedence).\n  /* istanbul ignore if: only if node is built with --without-ssl */\n  if (crypto === undefined) {\n    return true\n  }\n\n  // 1. Let parsedMetadata be the result of parsing metadataList.\n  const parsedMetadata = parseMetadata(metadataList)\n\n  // 2. If parsedMetadata is no metadata, return true.\n  if (parsedMetadata === 'no metadata') {\n    return true\n  }\n\n  // 3. If response is not eligible for integrity validation, return false.\n  // TODO\n\n  // 4. If parsedMetadata is the empty set, return true.\n  if (parsedMetadata.length === 0) {\n    return true\n  }\n\n  // 5. Let metadata be the result of getting the strongest\n  //    metadata from parsedMetadata.\n  const strongest = getStrongestMetadata(parsedMetadata)\n  const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)\n\n  // 6. For each item in metadata:\n  for (const item of metadata) {\n    // 1. Let algorithm be the alg component of item.\n    const algorithm = item.algo\n\n    // 2. Let expectedValue be the val component of item.\n    const expectedValue = item.hash\n\n    // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e\n    // \"be liberal with padding\". This is annoying, and it's not even in the spec.\n\n    // 3. Let actualValue be the result of applying algorithm to bytes.\n    let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')\n\n    if (actualValue[actualValue.length - 1] === '=') {\n      if (actualValue[actualValue.length - 2] === '=') {\n        actualValue = actualValue.slice(0, -2)\n      } else {\n        actualValue = actualValue.slice(0, -1)\n      }\n    }\n\n    // 4. If actualValue is a case-sensitive match for expectedValue,\n    //    return true.\n    if (compareBase64Mixed(actualValue, expectedValue)) {\n      return true\n    }\n  }\n\n  // 7. Return false.\n  return false\n}\n\n// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options\n// https://www.w3.org/TR/CSP2/#source-list-syntax\n// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1\nconst parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\\s|$)( +[!-~]*)?)?/i\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata\n * @param {string} metadata\n */\nfunction parseMetadata (metadata) {\n  // 1. Let result be the empty set.\n  /** @type {{ algo: string, hash: string }[]} */\n  const result = []\n\n  // 2. Let empty be equal to true.\n  let empty = true\n\n  // 3. For each token returned by splitting metadata on spaces:\n  for (const token of metadata.split(' ')) {\n    // 1. Set empty to false.\n    empty = false\n\n    // 2. Parse token as a hash-with-options.\n    const parsedToken = parseHashWithOptions.exec(token)\n\n    // 3. If token does not parse, continue to the next token.\n    if (\n      parsedToken === null ||\n      parsedToken.groups === undefined ||\n      parsedToken.groups.algo === undefined\n    ) {\n      // Note: Chromium blocks the request at this point, but Firefox\n      // gives a warning that an invalid integrity was given. The\n      // correct behavior is to ignore these, and subsequently not\n      // check the integrity of the resource.\n      continue\n    }\n\n    // 4. Let algorithm be the hash-algo component of token.\n    const algorithm = parsedToken.groups.algo.toLowerCase()\n\n    // 5. If algorithm is a hash function recognized by the user\n    //    agent, add the parsed token to result.\n    if (supportedHashes.includes(algorithm)) {\n      result.push(parsedToken.groups)\n    }\n  }\n\n  // 4. Return no metadata if empty is true, otherwise return result.\n  if (empty === true) {\n    return 'no metadata'\n  }\n\n  return result\n}\n\n/**\n * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList\n */\nfunction getStrongestMetadata (metadataList) {\n  // Let algorithm be the algo component of the first item in metadataList.\n  // Can be sha256\n  let algorithm = metadataList[0].algo\n  // If the algorithm is sha512, then it is the strongest\n  // and we can return immediately\n  if (algorithm[3] === '5') {\n    return algorithm\n  }\n\n  for (let i = 1; i < metadataList.length; ++i) {\n    const metadata = metadataList[i]\n    // If the algorithm is sha512, then it is the strongest\n    // and we can break the loop immediately\n    if (metadata.algo[3] === '5') {\n      algorithm = 'sha512'\n      break\n    // If the algorithm is sha384, then a potential sha256 or sha384 is ignored\n    } else if (algorithm[3] === '3') {\n      continue\n    // algorithm is sha256, check if algorithm is sha384 and if so, set it as\n    // the strongest\n    } else if (metadata.algo[3] === '3') {\n      algorithm = 'sha384'\n    }\n  }\n  return algorithm\n}\n\nfunction filterMetadataListByAlgorithm (metadataList, algorithm) {\n  if (metadataList.length === 1) {\n    return metadataList\n  }\n\n  let pos = 0\n  for (let i = 0; i < metadataList.length; ++i) {\n    if (metadataList[i].algo === algorithm) {\n      metadataList[pos++] = metadataList[i]\n    }\n  }\n\n  metadataList.length = pos\n\n  return metadataList\n}\n\n/**\n * Compares two base64 strings, allowing for base64url\n * in the second string.\n *\n* @param {string} actualValue always base64\n * @param {string} expectedValue base64 or base64url\n * @returns {boolean}\n */\nfunction compareBase64Mixed (actualValue, expectedValue) {\n  if (actualValue.length !== expectedValue.length) {\n    return false\n  }\n  for (let i = 0; i < actualValue.length; ++i) {\n    if (actualValue[i] !== expectedValue[i]) {\n      if (\n        (actualValue[i] === '+' && expectedValue[i] === '-') ||\n        (actualValue[i] === '/' && expectedValue[i] === '_')\n      ) {\n        continue\n      }\n      return false\n    }\n  }\n\n  return true\n}\n\n// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request\nfunction tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {\n  // TODO\n}\n\n/**\n * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}\n * @param {URL} A\n * @param {URL} B\n */\nfunction sameOrigin (A, B) {\n  // 1. If A and B are the same opaque origin, then return true.\n  if (A.origin === B.origin && A.origin === 'null') {\n    return true\n  }\n\n  // 2. If A and B are both tuple origins and their schemes,\n  //    hosts, and port are identical, then return true.\n  if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n    return true\n  }\n\n  // 3. Return false.\n  return false\n}\n\nfunction createDeferredPromise () {\n  let res\n  let rej\n  const promise = new Promise((resolve, reject) => {\n    res = resolve\n    rej = reject\n  })\n\n  return { promise, resolve: res, reject: rej }\n}\n\nfunction isAborted (fetchParams) {\n  return fetchParams.controller.state === 'aborted'\n}\n\nfunction isCancelled (fetchParams) {\n  return fetchParams.controller.state === 'aborted' ||\n    fetchParams.controller.state === 'terminated'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-method-normalize\n * @param {string} method\n */\nfunction normalizeMethod (method) {\n  return normalizedMethodRecordsBase[method.toLowerCase()] ?? method\n}\n\n// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string\nfunction serializeJavascriptValueToJSONString (value) {\n  // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).\n  const result = JSON.stringify(value)\n\n  // 2. If result is undefined, then throw a TypeError.\n  if (result === undefined) {\n    throw new TypeError('Value is not JSON serializable')\n  }\n\n  // 3. Assert: result is a string.\n  assert(typeof result === 'string')\n\n  // 4. Return result.\n  return result\n}\n\n// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object\nconst esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n  class FastIterableIterator {\n    /** @type {any} */\n    #target\n    /** @type {'key' | 'value' | 'key+value'} */\n    #kind\n    /** @type {number} */\n    #index\n\n    /**\n     * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object\n     * @param {unknown} target\n     * @param {'key' | 'value' | 'key+value'} kind\n     */\n    constructor (target, kind) {\n      this.#target = target\n      this.#kind = kind\n      this.#index = 0\n    }\n\n    next () {\n      // 1. Let interface be the interface for which the iterator prototype object exists.\n      // 2. Let thisValue be the this value.\n      // 3. Let object be ? ToObject(thisValue).\n      // 4. If object is a platform object, then perform a security\n      //    check, passing:\n      // 5. If object is not a default iterator object for interface,\n      //    then throw a TypeError.\n      if (typeof this !== 'object' || this === null || !(#target in this)) {\n        throw new TypeError(\n          `'next' called on an object that does not implement interface ${name} Iterator.`\n        )\n      }\n\n      // 6. Let index be object’s index.\n      // 7. Let kind be object’s kind.\n      // 8. Let values be object’s target's value pairs to iterate over.\n      const index = this.#index\n      const values = this.#target[kInternalIterator]\n\n      // 9. Let len be the length of values.\n      const len = values.length\n\n      // 10. If index is greater than or equal to len, then return\n      //     CreateIterResultObject(undefined, true).\n      if (index >= len) {\n        return {\n          value: undefined,\n          done: true\n        }\n      }\n\n      // 11. Let pair be the entry in values at index index.\n      const { [keyIndex]: key, [valueIndex]: value } = values[index]\n\n      // 12. Set object’s index to index + 1.\n      this.#index = index + 1\n\n      // 13. Return the iterator result for pair and kind.\n\n      // https://webidl.spec.whatwg.org/#iterator-result\n\n      // 1. Let result be a value determined by the value of kind:\n      let result\n      switch (this.#kind) {\n        case 'key':\n          // 1. Let idlKey be pair’s key.\n          // 2. Let key be the result of converting idlKey to an\n          //    ECMAScript value.\n          // 3. result is key.\n          result = key\n          break\n        case 'value':\n          // 1. Let idlValue be pair’s value.\n          // 2. Let value be the result of converting idlValue to\n          //    an ECMAScript value.\n          // 3. result is value.\n          result = value\n          break\n        case 'key+value':\n          // 1. Let idlKey be pair’s key.\n          // 2. Let idlValue be pair’s value.\n          // 3. Let key be the result of converting idlKey to an\n          //    ECMAScript value.\n          // 4. Let value be the result of converting idlValue to\n          //    an ECMAScript value.\n          // 5. Let array be ! ArrayCreate(2).\n          // 6. Call ! CreateDataProperty(array, \"0\", key).\n          // 7. Call ! CreateDataProperty(array, \"1\", value).\n          // 8. result is array.\n          result = [key, value]\n          break\n      }\n\n      // 2. Return CreateIterResultObject(result, false).\n      return {\n        value: result,\n        done: false\n      }\n    }\n  }\n\n  // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n  // @ts-ignore\n  delete FastIterableIterator.prototype.constructor\n\n  Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype)\n\n  Object.defineProperties(FastIterableIterator.prototype, {\n    [Symbol.toStringTag]: {\n      writable: false,\n      enumerable: false,\n      configurable: true,\n      value: `${name} Iterator`\n    },\n    next: { writable: true, enumerable: true, configurable: true }\n  })\n\n  /**\n   * @param {unknown} target\n   * @param {'key' | 'value' | 'key+value'} kind\n   * @returns {IterableIterator}\n   */\n  return function (target, kind) {\n    return new FastIterableIterator(target, kind)\n  }\n}\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {any} object class\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n  const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex)\n\n  const properties = {\n    keys: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function keys () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'key')\n      }\n    },\n    values: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function values () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'value')\n      }\n    },\n    entries: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function entries () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'key+value')\n      }\n    },\n    forEach: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function forEach (callbackfn, thisArg = globalThis) {\n        webidl.brandCheck(this, object)\n        webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`)\n        if (typeof callbackfn !== 'function') {\n          throw new TypeError(\n            `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`\n          )\n        }\n        for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) {\n          callbackfn.call(thisArg, value, key, this)\n        }\n      }\n    }\n  }\n\n  return Object.defineProperties(object.prototype, {\n    ...properties,\n    [Symbol.iterator]: {\n      writable: true,\n      enumerable: false,\n      configurable: true,\n      value: properties.entries.value\n    }\n  })\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-fully-read\n */\nasync function fullyReadBody (body, processBody, processBodyError) {\n  // 1. If taskDestination is null, then set taskDestination to\n  //    the result of starting a new parallel queue.\n\n  // 2. Let successSteps given a byte sequence bytes be to queue a\n  //    fetch task to run processBody given bytes, with taskDestination.\n  const successSteps = processBody\n\n  // 3. Let errorSteps be to queue a fetch task to run processBodyError,\n  //    with taskDestination.\n  const errorSteps = processBodyError\n\n  // 4. Let reader be the result of getting a reader for body’s stream.\n  //    If that threw an exception, then run errorSteps with that\n  //    exception and return.\n  let reader\n\n  try {\n    reader = body.stream.getReader()\n  } catch (e) {\n    errorSteps(e)\n    return\n  }\n\n  // 5. Read all bytes from reader, given successSteps and errorSteps.\n  try {\n    successSteps(await readAllBytes(reader))\n  } catch (e) {\n    errorSteps(e)\n  }\n}\n\nfunction isReadableStreamLike (stream) {\n  return stream instanceof ReadableStream || (\n    stream[Symbol.toStringTag] === 'ReadableStream' &&\n    typeof stream.tee === 'function'\n  )\n}\n\n/**\n * @param {ReadableStreamController} controller\n */\nfunction readableStreamClose (controller) {\n  try {\n    controller.close()\n    controller.byobRequest?.respond(0)\n  } catch (err) {\n    // TODO: add comment explaining why this error occurs.\n    if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {\n      throw err\n    }\n  }\n}\n\nconst invalidIsomorphicEncodeValueRegex = /[^\\x00-\\xFF]/ // eslint-disable-line\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-encode\n * @param {string} input\n */\nfunction isomorphicEncode (input) {\n  // 1. Assert: input contains no code points greater than U+00FF.\n  assert(!invalidIsomorphicEncodeValueRegex.test(input))\n\n  // 2. Return a byte sequence whose length is equal to input’s code\n  //    point length and whose bytes have the same values as the\n  //    values of input’s code points, in the same order\n  return input\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes\n * @see https://streams.spec.whatwg.org/#read-loop\n * @param {ReadableStreamDefaultReader} reader\n */\nasync function readAllBytes (reader) {\n  const bytes = []\n  let byteLength = 0\n\n  while (true) {\n    const { done, value: chunk } = await reader.read()\n\n    if (done) {\n      // 1. Call successSteps with bytes.\n      return Buffer.concat(bytes, byteLength)\n    }\n\n    // 1. If chunk is not a Uint8Array object, call failureSteps\n    //    with a TypeError and abort these steps.\n    if (!isUint8Array(chunk)) {\n      throw new TypeError('Received non-Uint8Array chunk')\n    }\n\n    // 2. Append the bytes represented by chunk to bytes.\n    bytes.push(chunk)\n    byteLength += chunk.length\n\n    // 3. Read-loop given reader, bytes, successSteps, and failureSteps.\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#is-local\n * @param {URL} url\n */\nfunction urlIsLocal (url) {\n  assert('protocol' in url) // ensure it's a url object\n\n  const protocol = url.protocol\n\n  return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'\n}\n\n/**\n * @param {string|URL} url\n * @returns {boolean}\n */\nfunction urlHasHttpsScheme (url) {\n  return (\n    (\n      typeof url === 'string' &&\n      url[5] === ':' &&\n      url[0] === 'h' &&\n      url[1] === 't' &&\n      url[2] === 't' &&\n      url[3] === 'p' &&\n      url[4] === 's'\n    ) ||\n    url.protocol === 'https:'\n  )\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-scheme\n * @param {URL} url\n */\nfunction urlIsHttpHttpsScheme (url) {\n  assert('protocol' in url) // ensure it's a url object\n\n  const protocol = url.protocol\n\n  return protocol === 'http:' || protocol === 'https:'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#simple-range-header-value\n * @param {string} value\n * @param {boolean} allowWhitespace\n */\nfunction simpleRangeHeaderValue (value, allowWhitespace) {\n  // 1. Let data be the isomorphic decoding of value.\n  // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string,\n  // nothing more. We obviously don't need to do that if value is a string already.\n  const data = value\n\n  // 2. If data does not start with \"bytes\", then return failure.\n  if (!data.startsWith('bytes')) {\n    return 'failure'\n  }\n\n  // 3. Let position be a position variable for data, initially pointing at the 5th code point of data.\n  const position = { position: 5 }\n\n  // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n  //    from data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 5. If the code point at position within data is not U+003D (=), then return failure.\n  if (data.charCodeAt(position.position) !== 0x3D) {\n    return 'failure'\n  }\n\n  // 6. Advance position by 1.\n  position.position++\n\n  // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from\n  //    data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits,\n  //    from data given position.\n  const rangeStart = collectASequenceOfCodePoints(\n    (char) => {\n      const code = char.charCodeAt(0)\n\n      return code >= 0x30 && code <= 0x39\n    },\n    data,\n    position\n  )\n\n  // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the\n  //    empty string; otherwise null.\n  const rangeStartValue = rangeStart.length ? Number(rangeStart) : null\n\n  // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n  //     from data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 11. If the code point at position within data is not U+002D (-), then return failure.\n  if (data.charCodeAt(position.position) !== 0x2D) {\n    return 'failure'\n  }\n\n  // 12. Advance position by 1.\n  position.position++\n\n  // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab\n  //     or space, from data given position.\n  // Note from Khafra: its the same step as in #8 again lol\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 14. Let rangeEnd be the result of collecting a sequence of code points that are\n  //     ASCII digits, from data given position.\n  // Note from Khafra: you wouldn't guess it, but this is also the same step as #8\n  const rangeEnd = collectASequenceOfCodePoints(\n    (char) => {\n      const code = char.charCodeAt(0)\n\n      return code >= 0x30 && code <= 0x39\n    },\n    data,\n    position\n  )\n\n  // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd\n  //     is not the empty string; otherwise null.\n  // Note from Khafra: THE SAME STEP, AGAIN!!!\n  // Note: why interpret as a decimal if we only collect ascii digits?\n  const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null\n\n  // 16. If position is not past the end of data, then return failure.\n  if (position.position < data.length) {\n    return 'failure'\n  }\n\n  // 17. If rangeEndValue and rangeStartValue are null, then return failure.\n  if (rangeEndValue === null && rangeStartValue === null) {\n    return 'failure'\n  }\n\n  // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is\n  //     greater than rangeEndValue, then return failure.\n  // Note: ... when can they not be numbers?\n  if (rangeStartValue > rangeEndValue) {\n    return 'failure'\n  }\n\n  // 19. Return (rangeStartValue, rangeEndValue).\n  return { rangeStartValue, rangeEndValue }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#build-a-content-range\n * @param {number} rangeStart\n * @param {number} rangeEnd\n * @param {number} fullLength\n */\nfunction buildContentRange (rangeStart, rangeEnd, fullLength) {\n  // 1. Let contentRange be `bytes `.\n  let contentRange = 'bytes '\n\n  // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange.\n  contentRange += isomorphicEncode(`${rangeStart}`)\n\n  // 3. Append 0x2D (-) to contentRange.\n  contentRange += '-'\n\n  // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange.\n  contentRange += isomorphicEncode(`${rangeEnd}`)\n\n  // 5. Append 0x2F (/) to contentRange.\n  contentRange += '/'\n\n  // 6. Append fullLength, serialized and isomorphic encoded to contentRange.\n  contentRange += isomorphicEncode(`${fullLength}`)\n\n  // 7. Return contentRange.\n  return contentRange\n}\n\n// A Stream, which pipes the response to zlib.createInflate() or\n// zlib.createInflateRaw() depending on the first byte of the Buffer.\n// If the lower byte of the first byte is 0x08, then the stream is\n// interpreted as a zlib stream, otherwise it's interpreted as a\n// raw deflate stream.\nclass InflateStream extends Transform {\n  #zlibOptions\n\n  /** @param {zlib.ZlibOptions} [zlibOptions] */\n  constructor (zlibOptions) {\n    super()\n    this.#zlibOptions = zlibOptions\n  }\n\n  _transform (chunk, encoding, callback) {\n    if (!this._inflateStream) {\n      if (chunk.length === 0) {\n        callback()\n        return\n      }\n      this._inflateStream = (chunk[0] & 0x0F) === 0x08\n        ? zlib.createInflate(this.#zlibOptions)\n        : zlib.createInflateRaw(this.#zlibOptions)\n\n      this._inflateStream.on('data', this.push.bind(this))\n      this._inflateStream.on('end', () => this.push(null))\n      this._inflateStream.on('error', (err) => this.destroy(err))\n    }\n\n    this._inflateStream.write(chunk, encoding, callback)\n  }\n\n  _final (callback) {\n    if (this._inflateStream) {\n      this._inflateStream.end()\n      this._inflateStream = null\n    }\n    callback()\n  }\n}\n\n/**\n * @param {zlib.ZlibOptions} [zlibOptions]\n * @returns {InflateStream}\n */\nfunction createInflate (zlibOptions) {\n  return new InflateStream(zlibOptions)\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type\n * @param {import('./headers').HeadersList} headers\n */\nfunction extractMimeType (headers) {\n  // 1. Let charset be null.\n  let charset = null\n\n  // 2. Let essence be null.\n  let essence = null\n\n  // 3. Let mimeType be null.\n  let mimeType = null\n\n  // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers.\n  const values = getDecodeSplit('content-type', headers)\n\n  // 5. If values is null, then return failure.\n  if (values === null) {\n    return 'failure'\n  }\n\n  // 6. For each value of values:\n  for (const value of values) {\n    // 6.1. Let temporaryMimeType be the result of parsing value.\n    const temporaryMimeType = parseMIMEType(value)\n\n    // 6.2. If temporaryMimeType is failure or its essence is \"*/*\", then continue.\n    if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') {\n      continue\n    }\n\n    // 6.3. Set mimeType to temporaryMimeType.\n    mimeType = temporaryMimeType\n\n    // 6.4. If mimeType’s essence is not essence, then:\n    if (mimeType.essence !== essence) {\n      // 6.4.1. Set charset to null.\n      charset = null\n\n      // 6.4.2. If mimeType’s parameters[\"charset\"] exists, then set charset to\n      //        mimeType’s parameters[\"charset\"].\n      if (mimeType.parameters.has('charset')) {\n        charset = mimeType.parameters.get('charset')\n      }\n\n      // 6.4.3. Set essence to mimeType’s essence.\n      essence = mimeType.essence\n    } else if (!mimeType.parameters.has('charset') && charset !== null) {\n      // 6.5. Otherwise, if mimeType’s parameters[\"charset\"] does not exist, and\n      //      charset is non-null, set mimeType’s parameters[\"charset\"] to charset.\n      mimeType.parameters.set('charset', charset)\n    }\n  }\n\n  // 7. If mimeType is null, then return failure.\n  if (mimeType == null) {\n    return 'failure'\n  }\n\n  // 8. Return mimeType.\n  return mimeType\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split\n * @param {string|null} value\n */\nfunction gettingDecodingSplitting (value) {\n  // 1. Let input be the result of isomorphic decoding value.\n  const input = value\n\n  // 2. Let position be a position variable for input, initially pointing at the start of input.\n  const position = { position: 0 }\n\n  // 3. Let values be a list of strings, initially empty.\n  const values = []\n\n  // 4. Let temporaryValue be the empty string.\n  let temporaryValue = ''\n\n  // 5. While position is not past the end of input:\n  while (position.position < input.length) {\n    // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (\")\n    //      or U+002C (,) from input, given position, to temporaryValue.\n    temporaryValue += collectASequenceOfCodePoints(\n      (char) => char !== '\"' && char !== ',',\n      input,\n      position\n    )\n\n    // 5.2. If position is not past the end of input, then:\n    if (position.position < input.length) {\n      // 5.2.1. If the code point at position within input is U+0022 (\"), then:\n      if (input.charCodeAt(position.position) === 0x22) {\n        // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue.\n        temporaryValue += collectAnHTTPQuotedString(\n          input,\n          position\n        )\n\n        // 5.2.1.2. If position is not past the end of input, then continue.\n        if (position.position < input.length) {\n          continue\n        }\n      } else {\n        // 5.2.2. Otherwise:\n\n        // 5.2.2.1. Assert: the code point at position within input is U+002C (,).\n        assert(input.charCodeAt(position.position) === 0x2C)\n\n        // 5.2.2.2. Advance position by 1.\n        position.position++\n      }\n    }\n\n    // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue.\n    temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20)\n\n    // 5.4. Append temporaryValue to values.\n    values.push(temporaryValue)\n\n    // 5.6. Set temporaryValue to the empty string.\n    temporaryValue = ''\n  }\n\n  // 6. Return values.\n  return values\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split\n * @param {string} name lowercase header name\n * @param {import('./headers').HeadersList} list\n */\nfunction getDecodeSplit (name, list) {\n  // 1. Let value be the result of getting name from list.\n  const value = list.get(name, true)\n\n  // 2. If value is null, then return null.\n  if (value === null) {\n    return null\n  }\n\n  // 3. Return the result of getting, decoding, and splitting value.\n  return gettingDecodingSplitting(value)\n}\n\nconst textDecoder = new TextDecoder()\n\n/**\n * @see https://encoding.spec.whatwg.org/#utf-8-decode\n * @param {Buffer} buffer\n */\nfunction utf8DecodeBytes (buffer) {\n  if (buffer.length === 0) {\n    return ''\n  }\n\n  // 1. Let buffer be the result of peeking three bytes from\n  //    ioQueue, converted to a byte sequence.\n\n  // 2. If buffer is 0xEF 0xBB 0xBF, then read three\n  //    bytes from ioQueue. (Do nothing with those bytes.)\n  if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {\n    buffer = buffer.subarray(3)\n  }\n\n  // 3. Process a queue with an instance of UTF-8’s\n  //    decoder, ioQueue, output, and \"replacement\".\n  const output = textDecoder.decode(buffer)\n\n  // 4. Return output.\n  return output\n}\n\nclass EnvironmentSettingsObjectBase {\n  get baseUrl () {\n    return getGlobalOrigin()\n  }\n\n  get origin () {\n    return this.baseUrl?.origin\n  }\n\n  policyContainer = makePolicyContainer()\n}\n\nclass EnvironmentSettingsObject {\n  settingsObject = new EnvironmentSettingsObjectBase()\n}\n\nconst environmentSettingsObject = new EnvironmentSettingsObject()\n\nmodule.exports = {\n  isAborted,\n  isCancelled,\n  isValidEncodedURL,\n  createDeferredPromise,\n  ReadableStreamFrom,\n  tryUpgradeRequestToAPotentiallyTrustworthyURL,\n  clampAndCoarsenConnectionTimingInfo,\n  coarsenedSharedCurrentTime,\n  determineRequestsReferrer,\n  makePolicyContainer,\n  clonePolicyContainer,\n  appendFetchMetadata,\n  appendRequestOriginHeader,\n  TAOCheck,\n  corsCheck,\n  crossOriginResourcePolicyCheck,\n  createOpaqueTimingInfo,\n  setRequestReferrerPolicyOnRedirect,\n  isValidHTTPToken,\n  requestBadPort,\n  requestCurrentURL,\n  responseURL,\n  responseLocationURL,\n  isBlobLike,\n  isURLPotentiallyTrustworthy,\n  isValidReasonPhrase,\n  sameOrigin,\n  normalizeMethod,\n  serializeJavascriptValueToJSONString,\n  iteratorMixin,\n  createIterator,\n  isValidHeaderName,\n  isValidHeaderValue,\n  isErrorLike,\n  fullyReadBody,\n  bytesMatch,\n  isReadableStreamLike,\n  readableStreamClose,\n  isomorphicEncode,\n  urlIsLocal,\n  urlHasHttpsScheme,\n  urlIsHttpHttpsScheme,\n  readAllBytes,\n  simpleRangeHeaderValue,\n  buildContentRange,\n  parseMetadata,\n  createInflate,\n  extractMimeType,\n  getDecodeSplit,\n  utf8DecodeBytes,\n  environmentSettingsObject\n}\n","'use strict'\n\nconst { types, inspect } = require('node:util')\nconst { markAsUncloneable } = require('node:worker_threads')\nconst { toUSVString } = require('../../core/util')\n\n/** @type {import('../../../types/webidl').Webidl} */\nconst webidl = {}\nwebidl.converters = {}\nwebidl.util = {}\nwebidl.errors = {}\n\nwebidl.errors.exception = function (message) {\n  return new TypeError(`${message.header}: ${message.message}`)\n}\n\nwebidl.errors.conversionFailed = function (context) {\n  const plural = context.types.length === 1 ? '' : ' one of'\n  const message =\n    `${context.argument} could not be converted to` +\n    `${plural}: ${context.types.join(', ')}.`\n\n  return webidl.errors.exception({\n    header: context.prefix,\n    message\n  })\n}\n\nwebidl.errors.invalidArgument = function (context) {\n  return webidl.errors.exception({\n    header: context.prefix,\n    message: `\"${context.value}\" is an invalid ${context.type}.`\n  })\n}\n\n// https://webidl.spec.whatwg.org/#implements\nwebidl.brandCheck = function (V, I, opts) {\n  if (opts?.strict !== false) {\n    if (!(V instanceof I)) {\n      const err = new TypeError('Illegal invocation')\n      err.code = 'ERR_INVALID_THIS' // node compat.\n      throw err\n    }\n  } else {\n    if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {\n      const err = new TypeError('Illegal invocation')\n      err.code = 'ERR_INVALID_THIS' // node compat.\n      throw err\n    }\n  }\n}\n\nwebidl.argumentLengthCheck = function ({ length }, min, ctx) {\n  if (length < min) {\n    throw webidl.errors.exception({\n      message: `${min} argument${min !== 1 ? 's' : ''} required, ` +\n               `but${length ? ' only' : ''} ${length} found.`,\n      header: ctx\n    })\n  }\n}\n\nwebidl.illegalConstructor = function () {\n  throw webidl.errors.exception({\n    header: 'TypeError',\n    message: 'Illegal constructor'\n  })\n}\n\n// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\nwebidl.util.Type = function (V) {\n  switch (typeof V) {\n    case 'undefined': return 'Undefined'\n    case 'boolean': return 'Boolean'\n    case 'string': return 'String'\n    case 'symbol': return 'Symbol'\n    case 'number': return 'Number'\n    case 'bigint': return 'BigInt'\n    case 'function':\n    case 'object': {\n      if (V === null) {\n        return 'Null'\n      }\n\n      return 'Object'\n    }\n  }\n}\n\nwebidl.util.markAsUncloneable = markAsUncloneable || (() => {})\n// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint\nwebidl.util.ConvertToInt = function (V, bitLength, signedness, opts) {\n  let upperBound\n  let lowerBound\n\n  // 1. If bitLength is 64, then:\n  if (bitLength === 64) {\n    // 1. Let upperBound be 2^53 − 1.\n    upperBound = Math.pow(2, 53) - 1\n\n    // 2. If signedness is \"unsigned\", then let lowerBound be 0.\n    if (signedness === 'unsigned') {\n      lowerBound = 0\n    } else {\n      // 3. Otherwise let lowerBound be −2^53 + 1.\n      lowerBound = Math.pow(-2, 53) + 1\n    }\n  } else if (signedness === 'unsigned') {\n    // 2. Otherwise, if signedness is \"unsigned\", then:\n\n    // 1. Let lowerBound be 0.\n    lowerBound = 0\n\n    // 2. Let upperBound be 2^bitLength − 1.\n    upperBound = Math.pow(2, bitLength) - 1\n  } else {\n    // 3. Otherwise:\n\n    // 1. Let lowerBound be -2^bitLength − 1.\n    lowerBound = Math.pow(-2, bitLength) - 1\n\n    // 2. Let upperBound be 2^bitLength − 1 − 1.\n    upperBound = Math.pow(2, bitLength - 1) - 1\n  }\n\n  // 4. Let x be ? ToNumber(V).\n  let x = Number(V)\n\n  // 5. If x is −0, then set x to +0.\n  if (x === 0) {\n    x = 0\n  }\n\n  // 6. If the conversion is to an IDL type associated\n  //    with the [EnforceRange] extended attribute, then:\n  if (opts?.enforceRange === true) {\n    // 1. If x is NaN, +∞, or −∞, then throw a TypeError.\n    if (\n      Number.isNaN(x) ||\n      x === Number.POSITIVE_INFINITY ||\n      x === Number.NEGATIVE_INFINITY\n    ) {\n      throw webidl.errors.exception({\n        header: 'Integer conversion',\n        message: `Could not convert ${webidl.util.Stringify(V)} to an integer.`\n      })\n    }\n\n    // 2. Set x to IntegerPart(x).\n    x = webidl.util.IntegerPart(x)\n\n    // 3. If x < lowerBound or x > upperBound, then\n    //    throw a TypeError.\n    if (x < lowerBound || x > upperBound) {\n      throw webidl.errors.exception({\n        header: 'Integer conversion',\n        message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n      })\n    }\n\n    // 4. Return x.\n    return x\n  }\n\n  // 7. If x is not NaN and the conversion is to an IDL\n  //    type associated with the [Clamp] extended\n  //    attribute, then:\n  if (!Number.isNaN(x) && opts?.clamp === true) {\n    // 1. Set x to min(max(x, lowerBound), upperBound).\n    x = Math.min(Math.max(x, lowerBound), upperBound)\n\n    // 2. Round x to the nearest integer, choosing the\n    //    even integer if it lies halfway between two,\n    //    and choosing +0 rather than −0.\n    if (Math.floor(x) % 2 === 0) {\n      x = Math.floor(x)\n    } else {\n      x = Math.ceil(x)\n    }\n\n    // 3. Return x.\n    return x\n  }\n\n  // 8. If x is NaN, +0, +∞, or −∞, then return +0.\n  if (\n    Number.isNaN(x) ||\n    (x === 0 && Object.is(0, x)) ||\n    x === Number.POSITIVE_INFINITY ||\n    x === Number.NEGATIVE_INFINITY\n  ) {\n    return 0\n  }\n\n  // 9. Set x to IntegerPart(x).\n  x = webidl.util.IntegerPart(x)\n\n  // 10. Set x to x modulo 2^bitLength.\n  x = x % Math.pow(2, bitLength)\n\n  // 11. If signedness is \"signed\" and x ≥ 2^bitLength − 1,\n  //    then return x − 2^bitLength.\n  if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {\n    return x - Math.pow(2, bitLength)\n  }\n\n  // 12. Otherwise, return x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart\nwebidl.util.IntegerPart = function (n) {\n  // 1. Let r be floor(abs(n)).\n  const r = Math.floor(Math.abs(n))\n\n  // 2. If n < 0, then return -1 × r.\n  if (n < 0) {\n    return -1 * r\n  }\n\n  // 3. Otherwise, return r.\n  return r\n}\n\nwebidl.util.Stringify = function (V) {\n  const type = webidl.util.Type(V)\n\n  switch (type) {\n    case 'Symbol':\n      return `Symbol(${V.description})`\n    case 'Object':\n      return inspect(V)\n    case 'String':\n      return `\"${V}\"`\n    default:\n      return `${V}`\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-sequence\nwebidl.sequenceConverter = function (converter) {\n  return (V, prefix, argument, Iterable) => {\n    // 1. If Type(V) is not Object, throw a TypeError.\n    if (webidl.util.Type(V) !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.`\n      })\n    }\n\n    // 2. Let method be ? GetMethod(V, @@iterator).\n    /** @type {Generator} */\n    const method = typeof Iterable === 'function' ? Iterable() : V?.[Symbol.iterator]?.()\n    const seq = []\n    let index = 0\n\n    // 3. If method is undefined, throw a TypeError.\n    if (\n      method === undefined ||\n      typeof method.next !== 'function'\n    ) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} is not iterable.`\n      })\n    }\n\n    // https://webidl.spec.whatwg.org/#create-sequence-from-iterable\n    while (true) {\n      const { done, value } = method.next()\n\n      if (done) {\n        break\n      }\n\n      seq.push(converter(value, prefix, `${argument}[${index++}]`))\n    }\n\n    return seq\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-to-record\nwebidl.recordConverter = function (keyConverter, valueConverter) {\n  return (O, prefix, argument) => {\n    // 1. If Type(O) is not Object, throw a TypeError.\n    if (webidl.util.Type(O) !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} (\"${webidl.util.Type(O)}\") is not an Object.`\n      })\n    }\n\n    // 2. Let result be a new empty instance of record.\n    const result = {}\n\n    if (!types.isProxy(O)) {\n      // 1. Let desc be ? O.[[GetOwnProperty]](key).\n      const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]\n\n      for (const key of keys) {\n        // 1. Let typedKey be key converted to an IDL value of type K.\n        const typedKey = keyConverter(key, prefix, argument)\n\n        // 2. Let value be ? Get(O, key).\n        // 3. Let typedValue be value converted to an IDL value of type V.\n        const typedValue = valueConverter(O[key], prefix, argument)\n\n        // 4. Set result[typedKey] to typedValue.\n        result[typedKey] = typedValue\n      }\n\n      // 5. Return result.\n      return result\n    }\n\n    // 3. Let keys be ? O.[[OwnPropertyKeys]]().\n    const keys = Reflect.ownKeys(O)\n\n    // 4. For each key of keys.\n    for (const key of keys) {\n      // 1. Let desc be ? O.[[GetOwnProperty]](key).\n      const desc = Reflect.getOwnPropertyDescriptor(O, key)\n\n      // 2. If desc is not undefined and desc.[[Enumerable]] is true:\n      if (desc?.enumerable) {\n        // 1. Let typedKey be key converted to an IDL value of type K.\n        const typedKey = keyConverter(key, prefix, argument)\n\n        // 2. Let value be ? Get(O, key).\n        // 3. Let typedValue be value converted to an IDL value of type V.\n        const typedValue = valueConverter(O[key], prefix, argument)\n\n        // 4. Set result[typedKey] to typedValue.\n        result[typedKey] = typedValue\n      }\n    }\n\n    // 5. Return result.\n    return result\n  }\n}\n\nwebidl.interfaceConverter = function (i) {\n  return (V, prefix, argument, opts) => {\n    if (opts?.strict !== false && !(V instanceof i)) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `Expected ${argument} (\"${webidl.util.Stringify(V)}\") to be an instance of ${i.name}.`\n      })\n    }\n\n    return V\n  }\n}\n\nwebidl.dictionaryConverter = function (converters) {\n  return (dictionary, prefix, argument) => {\n    const type = webidl.util.Type(dictionary)\n    const dict = {}\n\n    if (type === 'Null' || type === 'Undefined') {\n      return dict\n    } else if (type !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n      })\n    }\n\n    for (const options of converters) {\n      const { key, defaultValue, required, converter } = options\n\n      if (required === true) {\n        if (!Object.hasOwn(dictionary, key)) {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: `Missing required key \"${key}\".`\n          })\n        }\n      }\n\n      let value = dictionary[key]\n      const hasDefault = Object.hasOwn(options, 'defaultValue')\n\n      // Only use defaultValue if value is undefined and\n      // a defaultValue options was provided.\n      if (hasDefault && value !== null) {\n        value ??= defaultValue()\n      }\n\n      // A key can be optional and have no default value.\n      // When this happens, do not perform a conversion,\n      // and do not assign the key a value.\n      if (required || hasDefault || value !== undefined) {\n        value = converter(value, prefix, `${argument}.${key}`)\n\n        if (\n          options.allowedValues &&\n          !options.allowedValues.includes(value)\n        ) {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`\n          })\n        }\n\n        dict[key] = value\n      }\n    }\n\n    return dict\n  }\n}\n\nwebidl.nullableConverter = function (converter) {\n  return (V, prefix, argument) => {\n    if (V === null) {\n      return V\n    }\n\n    return converter(V, prefix, argument)\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-DOMString\nwebidl.converters.DOMString = function (V, prefix, argument, opts) {\n  // 1. If V is null and the conversion is to an IDL type\n  //    associated with the [LegacyNullToEmptyString]\n  //    extended attribute, then return the DOMString value\n  //    that represents the empty string.\n  if (V === null && opts?.legacyNullToEmptyString) {\n    return ''\n  }\n\n  // 2. Let x be ? ToString(V).\n  if (typeof V === 'symbol') {\n    throw webidl.errors.exception({\n      header: prefix,\n      message: `${argument} is a symbol, which cannot be converted to a DOMString.`\n    })\n  }\n\n  // 3. Return the IDL DOMString value that represents the\n  //    same sequence of code units as the one the\n  //    ECMAScript String value x represents.\n  return String(V)\n}\n\n// https://webidl.spec.whatwg.org/#es-ByteString\nwebidl.converters.ByteString = function (V, prefix, argument) {\n  // 1. Let x be ? ToString(V).\n  // Note: DOMString converter perform ? ToString(V)\n  const x = webidl.converters.DOMString(V, prefix, argument)\n\n  // 2. If the value of any element of x is greater than\n  //    255, then throw a TypeError.\n  for (let index = 0; index < x.length; index++) {\n    if (x.charCodeAt(index) > 255) {\n      throw new TypeError(\n        'Cannot convert argument to a ByteString because the character at ' +\n        `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`\n      )\n    }\n  }\n\n  // 3. Return an IDL ByteString value whose length is the\n  //    length of x, and where the value of each element is\n  //    the value of the corresponding element of x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-USVString\n// TODO: rewrite this so we can control the errors thrown\nwebidl.converters.USVString = toUSVString\n\n// https://webidl.spec.whatwg.org/#es-boolean\nwebidl.converters.boolean = function (V) {\n  // 1. Let x be the result of computing ToBoolean(V).\n  const x = Boolean(V)\n\n  // 2. Return the IDL boolean value that is the one that represents\n  //    the same truth value as the ECMAScript Boolean value x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-any\nwebidl.converters.any = function (V) {\n  return V\n}\n\n// https://webidl.spec.whatwg.org/#es-long-long\nwebidl.converters['long long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 64, \"signed\").\n  const x = webidl.util.ConvertToInt(V, 64, 'signed', undefined, prefix, argument)\n\n  // 2. Return the IDL long long value that represents\n  //    the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long-long\nwebidl.converters['unsigned long long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 64, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 64, 'unsigned', undefined, prefix, argument)\n\n  // 2. Return the IDL unsigned long long value that\n  //    represents the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long\nwebidl.converters['unsigned long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 32, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 32, 'unsigned', undefined, prefix, argument)\n\n  // 2. Return the IDL unsigned long value that\n  //    represents the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-short\nwebidl.converters['unsigned short'] = function (V, prefix, argument, opts) {\n  // 1. Let x be ? ConvertToInt(V, 16, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts, prefix, argument)\n\n  // 2. Return the IDL unsigned short value that represents\n  //    the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#idl-ArrayBuffer\nwebidl.converters.ArrayBuffer = function (V, prefix, argument, opts) {\n  // 1. If Type(V) is not Object, or V does not have an\n  //    [[ArrayBufferData]] internal slot, then throw a\n  //    TypeError.\n  // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances\n  // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances\n  if (\n    webidl.util.Type(V) !== 'Object' ||\n    !types.isAnyArrayBuffer(V)\n  ) {\n    throw webidl.errors.conversionFailed({\n      prefix,\n      argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n      types: ['ArrayBuffer']\n    })\n  }\n\n  // 2. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V) is true, then throw a\n  //    TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V) is true, then throw a\n  //    TypeError.\n  if (V.resizable || V.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 4. Return the IDL ArrayBuffer value that is a\n  //    reference to the same object as V.\n  return V\n}\n\nwebidl.converters.TypedArray = function (V, T, prefix, name, opts) {\n  // 1. Let T be the IDL type V is being converted to.\n\n  // 2. If Type(V) is not Object, or V does not have a\n  //    [[TypedArrayName]] internal slot with a value\n  //    equal to T’s name, then throw a TypeError.\n  if (\n    webidl.util.Type(V) !== 'Object' ||\n    !types.isTypedArray(V) ||\n    V.constructor.name !== T.name\n  ) {\n    throw webidl.errors.conversionFailed({\n      prefix,\n      argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n      types: [T.name]\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 4. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (V.buffer.resizable || V.buffer.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 5. Return the IDL value of type T that is a reference\n  //    to the same object as V.\n  return V\n}\n\nwebidl.converters.DataView = function (V, prefix, name, opts) {\n  // 1. If Type(V) is not Object, or V does not have a\n  //    [[DataView]] internal slot, then throw a TypeError.\n  if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {\n    throw webidl.errors.exception({\n      header: prefix,\n      message: `${name} is not a DataView.`\n    })\n  }\n\n  // 2. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,\n  //    then throw a TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (V.buffer.resizable || V.buffer.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 4. Return the IDL DataView value that is a reference\n  //    to the same object as V.\n  return V\n}\n\n// https://webidl.spec.whatwg.org/#BufferSource\nwebidl.converters.BufferSource = function (V, prefix, name, opts) {\n  if (types.isAnyArrayBuffer(V)) {\n    return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false })\n  }\n\n  if (types.isTypedArray(V)) {\n    return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false })\n  }\n\n  if (types.isDataView(V)) {\n    return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false })\n  }\n\n  throw webidl.errors.conversionFailed({\n    prefix,\n    argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n    types: ['BufferSource']\n  })\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.ByteString\n)\n\nwebidl.converters['sequence>'] = webidl.sequenceConverter(\n  webidl.converters['sequence']\n)\n\nwebidl.converters['record'] = webidl.recordConverter(\n  webidl.converters.ByteString,\n  webidl.converters.ByteString\n)\n\nmodule.exports = {\n  webidl\n}\n","'use strict'\n\n/**\n * @see https://encoding.spec.whatwg.org/#concept-encoding-get\n * @param {string|undefined} label\n */\nfunction getEncoding (label) {\n  if (!label) {\n    return 'failure'\n  }\n\n  // 1. Remove any leading and trailing ASCII whitespace from label.\n  // 2. If label is an ASCII case-insensitive match for any of the\n  //    labels listed in the table below, then return the\n  //    corresponding encoding; otherwise return failure.\n  switch (label.trim().toLowerCase()) {\n    case 'unicode-1-1-utf-8':\n    case 'unicode11utf8':\n    case 'unicode20utf8':\n    case 'utf-8':\n    case 'utf8':\n    case 'x-unicode20utf8':\n      return 'UTF-8'\n    case '866':\n    case 'cp866':\n    case 'csibm866':\n    case 'ibm866':\n      return 'IBM866'\n    case 'csisolatin2':\n    case 'iso-8859-2':\n    case 'iso-ir-101':\n    case 'iso8859-2':\n    case 'iso88592':\n    case 'iso_8859-2':\n    case 'iso_8859-2:1987':\n    case 'l2':\n    case 'latin2':\n      return 'ISO-8859-2'\n    case 'csisolatin3':\n    case 'iso-8859-3':\n    case 'iso-ir-109':\n    case 'iso8859-3':\n    case 'iso88593':\n    case 'iso_8859-3':\n    case 'iso_8859-3:1988':\n    case 'l3':\n    case 'latin3':\n      return 'ISO-8859-3'\n    case 'csisolatin4':\n    case 'iso-8859-4':\n    case 'iso-ir-110':\n    case 'iso8859-4':\n    case 'iso88594':\n    case 'iso_8859-4':\n    case 'iso_8859-4:1988':\n    case 'l4':\n    case 'latin4':\n      return 'ISO-8859-4'\n    case 'csisolatincyrillic':\n    case 'cyrillic':\n    case 'iso-8859-5':\n    case 'iso-ir-144':\n    case 'iso8859-5':\n    case 'iso88595':\n    case 'iso_8859-5':\n    case 'iso_8859-5:1988':\n      return 'ISO-8859-5'\n    case 'arabic':\n    case 'asmo-708':\n    case 'csiso88596e':\n    case 'csiso88596i':\n    case 'csisolatinarabic':\n    case 'ecma-114':\n    case 'iso-8859-6':\n    case 'iso-8859-6-e':\n    case 'iso-8859-6-i':\n    case 'iso-ir-127':\n    case 'iso8859-6':\n    case 'iso88596':\n    case 'iso_8859-6':\n    case 'iso_8859-6:1987':\n      return 'ISO-8859-6'\n    case 'csisolatingreek':\n    case 'ecma-118':\n    case 'elot_928':\n    case 'greek':\n    case 'greek8':\n    case 'iso-8859-7':\n    case 'iso-ir-126':\n    case 'iso8859-7':\n    case 'iso88597':\n    case 'iso_8859-7':\n    case 'iso_8859-7:1987':\n    case 'sun_eu_greek':\n      return 'ISO-8859-7'\n    case 'csiso88598e':\n    case 'csisolatinhebrew':\n    case 'hebrew':\n    case 'iso-8859-8':\n    case 'iso-8859-8-e':\n    case 'iso-ir-138':\n    case 'iso8859-8':\n    case 'iso88598':\n    case 'iso_8859-8':\n    case 'iso_8859-8:1988':\n    case 'visual':\n      return 'ISO-8859-8'\n    case 'csiso88598i':\n    case 'iso-8859-8-i':\n    case 'logical':\n      return 'ISO-8859-8-I'\n    case 'csisolatin6':\n    case 'iso-8859-10':\n    case 'iso-ir-157':\n    case 'iso8859-10':\n    case 'iso885910':\n    case 'l6':\n    case 'latin6':\n      return 'ISO-8859-10'\n    case 'iso-8859-13':\n    case 'iso8859-13':\n    case 'iso885913':\n      return 'ISO-8859-13'\n    case 'iso-8859-14':\n    case 'iso8859-14':\n    case 'iso885914':\n      return 'ISO-8859-14'\n    case 'csisolatin9':\n    case 'iso-8859-15':\n    case 'iso8859-15':\n    case 'iso885915':\n    case 'iso_8859-15':\n    case 'l9':\n      return 'ISO-8859-15'\n    case 'iso-8859-16':\n      return 'ISO-8859-16'\n    case 'cskoi8r':\n    case 'koi':\n    case 'koi8':\n    case 'koi8-r':\n    case 'koi8_r':\n      return 'KOI8-R'\n    case 'koi8-ru':\n    case 'koi8-u':\n      return 'KOI8-U'\n    case 'csmacintosh':\n    case 'mac':\n    case 'macintosh':\n    case 'x-mac-roman':\n      return 'macintosh'\n    case 'iso-8859-11':\n    case 'iso8859-11':\n    case 'iso885911':\n    case 'tis-620':\n    case 'windows-874':\n      return 'windows-874'\n    case 'cp1250':\n    case 'windows-1250':\n    case 'x-cp1250':\n      return 'windows-1250'\n    case 'cp1251':\n    case 'windows-1251':\n    case 'x-cp1251':\n      return 'windows-1251'\n    case 'ansi_x3.4-1968':\n    case 'ascii':\n    case 'cp1252':\n    case 'cp819':\n    case 'csisolatin1':\n    case 'ibm819':\n    case 'iso-8859-1':\n    case 'iso-ir-100':\n    case 'iso8859-1':\n    case 'iso88591':\n    case 'iso_8859-1':\n    case 'iso_8859-1:1987':\n    case 'l1':\n    case 'latin1':\n    case 'us-ascii':\n    case 'windows-1252':\n    case 'x-cp1252':\n      return 'windows-1252'\n    case 'cp1253':\n    case 'windows-1253':\n    case 'x-cp1253':\n      return 'windows-1253'\n    case 'cp1254':\n    case 'csisolatin5':\n    case 'iso-8859-9':\n    case 'iso-ir-148':\n    case 'iso8859-9':\n    case 'iso88599':\n    case 'iso_8859-9':\n    case 'iso_8859-9:1989':\n    case 'l5':\n    case 'latin5':\n    case 'windows-1254':\n    case 'x-cp1254':\n      return 'windows-1254'\n    case 'cp1255':\n    case 'windows-1255':\n    case 'x-cp1255':\n      return 'windows-1255'\n    case 'cp1256':\n    case 'windows-1256':\n    case 'x-cp1256':\n      return 'windows-1256'\n    case 'cp1257':\n    case 'windows-1257':\n    case 'x-cp1257':\n      return 'windows-1257'\n    case 'cp1258':\n    case 'windows-1258':\n    case 'x-cp1258':\n      return 'windows-1258'\n    case 'x-mac-cyrillic':\n    case 'x-mac-ukrainian':\n      return 'x-mac-cyrillic'\n    case 'chinese':\n    case 'csgb2312':\n    case 'csiso58gb231280':\n    case 'gb2312':\n    case 'gb_2312':\n    case 'gb_2312-80':\n    case 'gbk':\n    case 'iso-ir-58':\n    case 'x-gbk':\n      return 'GBK'\n    case 'gb18030':\n      return 'gb18030'\n    case 'big5':\n    case 'big5-hkscs':\n    case 'cn-big5':\n    case 'csbig5':\n    case 'x-x-big5':\n      return 'Big5'\n    case 'cseucpkdfmtjapanese':\n    case 'euc-jp':\n    case 'x-euc-jp':\n      return 'EUC-JP'\n    case 'csiso2022jp':\n    case 'iso-2022-jp':\n      return 'ISO-2022-JP'\n    case 'csshiftjis':\n    case 'ms932':\n    case 'ms_kanji':\n    case 'shift-jis':\n    case 'shift_jis':\n    case 'sjis':\n    case 'windows-31j':\n    case 'x-sjis':\n      return 'Shift_JIS'\n    case 'cseuckr':\n    case 'csksc56011987':\n    case 'euc-kr':\n    case 'iso-ir-149':\n    case 'korean':\n    case 'ks_c_5601-1987':\n    case 'ks_c_5601-1989':\n    case 'ksc5601':\n    case 'ksc_5601':\n    case 'windows-949':\n      return 'EUC-KR'\n    case 'csiso2022kr':\n    case 'hz-gb-2312':\n    case 'iso-2022-cn':\n    case 'iso-2022-cn-ext':\n    case 'iso-2022-kr':\n    case 'replacement':\n      return 'replacement'\n    case 'unicodefffe':\n    case 'utf-16be':\n      return 'UTF-16BE'\n    case 'csunicode':\n    case 'iso-10646-ucs-2':\n    case 'ucs-2':\n    case 'unicode':\n    case 'unicodefeff':\n    case 'utf-16':\n    case 'utf-16le':\n      return 'UTF-16LE'\n    case 'x-user-defined':\n      return 'x-user-defined'\n    default: return 'failure'\n  }\n}\n\nmodule.exports = {\n  getEncoding\n}\n","'use strict'\n\nconst {\n  staticPropertyDescriptors,\n  readOperation,\n  fireAProgressEvent\n} = require('./util')\nconst {\n  kState,\n  kError,\n  kResult,\n  kEvents,\n  kAborted\n} = require('./symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass FileReader extends EventTarget {\n  constructor () {\n    super()\n\n    this[kState] = 'empty'\n    this[kResult] = null\n    this[kError] = null\n    this[kEvents] = {\n      loadend: null,\n      error: null,\n      abort: null,\n      load: null,\n      progress: null,\n      loadstart: null\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer\n   * @param {import('buffer').Blob} blob\n   */\n  readAsArrayBuffer (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsArrayBuffer')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsArrayBuffer(blob) method, when invoked,\n    // must initiate a read operation for blob with ArrayBuffer.\n    readOperation(this, blob, 'ArrayBuffer')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#readAsBinaryString\n   * @param {import('buffer').Blob} blob\n   */\n  readAsBinaryString (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsBinaryString')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsBinaryString(blob) method, when invoked,\n    // must initiate a read operation for blob with BinaryString.\n    readOperation(this, blob, 'BinaryString')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#readAsDataText\n   * @param {import('buffer').Blob} blob\n   * @param {string?} encoding\n   */\n  readAsText (blob, encoding = undefined) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsText')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    if (encoding !== undefined) {\n      encoding = webidl.converters.DOMString(encoding, 'FileReader.readAsText', 'encoding')\n    }\n\n    // The readAsText(blob, encoding) method, when invoked,\n    // must initiate a read operation for blob with Text and encoding.\n    readOperation(this, blob, 'Text', encoding)\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL\n   * @param {import('buffer').Blob} blob\n   */\n  readAsDataURL (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsDataURL')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsDataURL(blob) method, when invoked, must\n    // initiate a read operation for blob with DataURL.\n    readOperation(this, blob, 'DataURL')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-abort\n   */\n  abort () {\n    // 1. If this's state is \"empty\" or if this's state is\n    //    \"done\" set this's result to null and terminate\n    //    this algorithm.\n    if (this[kState] === 'empty' || this[kState] === 'done') {\n      this[kResult] = null\n      return\n    }\n\n    // 2. If this's state is \"loading\" set this's state to\n    //    \"done\" and set this's result to null.\n    if (this[kState] === 'loading') {\n      this[kState] = 'done'\n      this[kResult] = null\n    }\n\n    // 3. If there are any tasks from this on the file reading\n    //    task source in an affiliated task queue, then remove\n    //    those tasks from that task queue.\n    this[kAborted] = true\n\n    // 4. Terminate the algorithm for the read method being processed.\n    // TODO\n\n    // 5. Fire a progress event called abort at this.\n    fireAProgressEvent('abort', this)\n\n    // 6. If this's state is not \"loading\", fire a progress\n    //    event called loadend at this.\n    if (this[kState] !== 'loading') {\n      fireAProgressEvent('loadend', this)\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate\n   */\n  get readyState () {\n    webidl.brandCheck(this, FileReader)\n\n    switch (this[kState]) {\n      case 'empty': return this.EMPTY\n      case 'loading': return this.LOADING\n      case 'done': return this.DONE\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-result\n   */\n  get result () {\n    webidl.brandCheck(this, FileReader)\n\n    // The result attribute’s getter, when invoked, must return\n    // this's result.\n    return this[kResult]\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-error\n   */\n  get error () {\n    webidl.brandCheck(this, FileReader)\n\n    // The error attribute’s getter, when invoked, must return\n    // this's error.\n    return this[kError]\n  }\n\n  get onloadend () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].loadend\n  }\n\n  set onloadend (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].loadend) {\n      this.removeEventListener('loadend', this[kEvents].loadend)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].loadend = fn\n      this.addEventListener('loadend', fn)\n    } else {\n      this[kEvents].loadend = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].error) {\n      this.removeEventListener('error', this[kEvents].error)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this[kEvents].error = null\n    }\n  }\n\n  get onloadstart () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].loadstart\n  }\n\n  set onloadstart (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].loadstart) {\n      this.removeEventListener('loadstart', this[kEvents].loadstart)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].loadstart = fn\n      this.addEventListener('loadstart', fn)\n    } else {\n      this[kEvents].loadstart = null\n    }\n  }\n\n  get onprogress () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].progress\n  }\n\n  set onprogress (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].progress) {\n      this.removeEventListener('progress', this[kEvents].progress)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].progress = fn\n      this.addEventListener('progress', fn)\n    } else {\n      this[kEvents].progress = null\n    }\n  }\n\n  get onload () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].load\n  }\n\n  set onload (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].load) {\n      this.removeEventListener('load', this[kEvents].load)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].load = fn\n      this.addEventListener('load', fn)\n    } else {\n      this[kEvents].load = null\n    }\n  }\n\n  get onabort () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].abort\n  }\n\n  set onabort (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].abort) {\n      this.removeEventListener('abort', this[kEvents].abort)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].abort = fn\n      this.addEventListener('abort', fn)\n    } else {\n      this[kEvents].abort = null\n    }\n  }\n}\n\n// https://w3c.github.io/FileAPI/#dom-filereader-empty\nFileReader.EMPTY = FileReader.prototype.EMPTY = 0\n// https://w3c.github.io/FileAPI/#dom-filereader-loading\nFileReader.LOADING = FileReader.prototype.LOADING = 1\n// https://w3c.github.io/FileAPI/#dom-filereader-done\nFileReader.DONE = FileReader.prototype.DONE = 2\n\nObject.defineProperties(FileReader.prototype, {\n  EMPTY: staticPropertyDescriptors,\n  LOADING: staticPropertyDescriptors,\n  DONE: staticPropertyDescriptors,\n  readAsArrayBuffer: kEnumerableProperty,\n  readAsBinaryString: kEnumerableProperty,\n  readAsText: kEnumerableProperty,\n  readAsDataURL: kEnumerableProperty,\n  abort: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  result: kEnumerableProperty,\n  error: kEnumerableProperty,\n  onloadstart: kEnumerableProperty,\n  onprogress: kEnumerableProperty,\n  onload: kEnumerableProperty,\n  onabort: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onloadend: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'FileReader',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(FileReader, {\n  EMPTY: staticPropertyDescriptors,\n  LOADING: staticPropertyDescriptors,\n  DONE: staticPropertyDescriptors\n})\n\nmodule.exports = {\n  FileReader\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\n\nconst kState = Symbol('ProgressEvent state')\n\n/**\n * @see https://xhr.spec.whatwg.org/#progressevent\n */\nclass ProgressEvent extends Event {\n  constructor (type, eventInitDict = {}) {\n    type = webidl.converters.DOMString(type, 'ProgressEvent constructor', 'type')\n    eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})\n\n    super(type, eventInitDict)\n\n    this[kState] = {\n      lengthComputable: eventInitDict.lengthComputable,\n      loaded: eventInitDict.loaded,\n      total: eventInitDict.total\n    }\n  }\n\n  get lengthComputable () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].lengthComputable\n  }\n\n  get loaded () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].loaded\n  }\n\n  get total () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].total\n  }\n}\n\nwebidl.converters.ProgressEventInit = webidl.dictionaryConverter([\n  {\n    key: 'lengthComputable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'loaded',\n    converter: webidl.converters['unsigned long long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'total',\n    converter: webidl.converters['unsigned long long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'bubbles',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'cancelable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'composed',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n])\n\nmodule.exports = {\n  ProgressEvent\n}\n","'use strict'\n\nmodule.exports = {\n  kState: Symbol('FileReader state'),\n  kResult: Symbol('FileReader result'),\n  kError: Symbol('FileReader error'),\n  kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),\n  kEvents: Symbol('FileReader events'),\n  kAborted: Symbol('FileReader aborted')\n}\n","'use strict'\n\nconst {\n  kState,\n  kError,\n  kResult,\n  kAborted,\n  kLastProgressEventFired\n} = require('./symbols')\nconst { ProgressEvent } = require('./progressevent')\nconst { getEncoding } = require('./encoding')\nconst { serializeAMimeType, parseMIMEType } = require('../fetch/data-url')\nconst { types } = require('node:util')\nconst { StringDecoder } = require('string_decoder')\nconst { btoa } = require('node:buffer')\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n  enumerable: true,\n  writable: false,\n  configurable: false\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#readOperation\n * @param {import('./filereader').FileReader} fr\n * @param {import('buffer').Blob} blob\n * @param {string} type\n * @param {string?} encodingName\n */\nfunction readOperation (fr, blob, type, encodingName) {\n  // 1. If fr’s state is \"loading\", throw an InvalidStateError\n  //    DOMException.\n  if (fr[kState] === 'loading') {\n    throw new DOMException('Invalid state', 'InvalidStateError')\n  }\n\n  // 2. Set fr’s state to \"loading\".\n  fr[kState] = 'loading'\n\n  // 3. Set fr’s result to null.\n  fr[kResult] = null\n\n  // 4. Set fr’s error to null.\n  fr[kError] = null\n\n  // 5. Let stream be the result of calling get stream on blob.\n  /** @type {import('stream/web').ReadableStream} */\n  const stream = blob.stream()\n\n  // 6. Let reader be the result of getting a reader from stream.\n  const reader = stream.getReader()\n\n  // 7. Let bytes be an empty byte sequence.\n  /** @type {Uint8Array[]} */\n  const bytes = []\n\n  // 8. Let chunkPromise be the result of reading a chunk from\n  //    stream with reader.\n  let chunkPromise = reader.read()\n\n  // 9. Let isFirstChunk be true.\n  let isFirstChunk = true\n\n  // 10. In parallel, while true:\n  // Note: \"In parallel\" just means non-blocking\n  // Note 2: readOperation itself cannot be async as double\n  // reading the body would then reject the promise, instead\n  // of throwing an error.\n  ;(async () => {\n    while (!fr[kAborted]) {\n      // 1. Wait for chunkPromise to be fulfilled or rejected.\n      try {\n        const { done, value } = await chunkPromise\n\n        // 2. If chunkPromise is fulfilled, and isFirstChunk is\n        //    true, queue a task to fire a progress event called\n        //    loadstart at fr.\n        if (isFirstChunk && !fr[kAborted]) {\n          queueMicrotask(() => {\n            fireAProgressEvent('loadstart', fr)\n          })\n        }\n\n        // 3. Set isFirstChunk to false.\n        isFirstChunk = false\n\n        // 4. If chunkPromise is fulfilled with an object whose\n        //    done property is false and whose value property is\n        //    a Uint8Array object, run these steps:\n        if (!done && types.isUint8Array(value)) {\n          // 1. Let bs be the byte sequence represented by the\n          //    Uint8Array object.\n\n          // 2. Append bs to bytes.\n          bytes.push(value)\n\n          // 3. If roughly 50ms have passed since these steps\n          //    were last invoked, queue a task to fire a\n          //    progress event called progress at fr.\n          if (\n            (\n              fr[kLastProgressEventFired] === undefined ||\n              Date.now() - fr[kLastProgressEventFired] >= 50\n            ) &&\n            !fr[kAborted]\n          ) {\n            fr[kLastProgressEventFired] = Date.now()\n            queueMicrotask(() => {\n              fireAProgressEvent('progress', fr)\n            })\n          }\n\n          // 4. Set chunkPromise to the result of reading a\n          //    chunk from stream with reader.\n          chunkPromise = reader.read()\n        } else if (done) {\n          // 5. Otherwise, if chunkPromise is fulfilled with an\n          //    object whose done property is true, queue a task\n          //    to run the following steps and abort this algorithm:\n          queueMicrotask(() => {\n            // 1. Set fr’s state to \"done\".\n            fr[kState] = 'done'\n\n            // 2. Let result be the result of package data given\n            //    bytes, type, blob’s type, and encodingName.\n            try {\n              const result = packageData(bytes, type, blob.type, encodingName)\n\n              // 4. Else:\n\n              if (fr[kAborted]) {\n                return\n              }\n\n              // 1. Set fr’s result to result.\n              fr[kResult] = result\n\n              // 2. Fire a progress event called load at the fr.\n              fireAProgressEvent('load', fr)\n            } catch (error) {\n              // 3. If package data threw an exception error:\n\n              // 1. Set fr’s error to error.\n              fr[kError] = error\n\n              // 2. Fire a progress event called error at fr.\n              fireAProgressEvent('error', fr)\n            }\n\n            // 5. If fr’s state is not \"loading\", fire a progress\n            //    event called loadend at the fr.\n            if (fr[kState] !== 'loading') {\n              fireAProgressEvent('loadend', fr)\n            }\n          })\n\n          break\n        }\n      } catch (error) {\n        if (fr[kAborted]) {\n          return\n        }\n\n        // 6. Otherwise, if chunkPromise is rejected with an\n        //    error error, queue a task to run the following\n        //    steps and abort this algorithm:\n        queueMicrotask(() => {\n          // 1. Set fr’s state to \"done\".\n          fr[kState] = 'done'\n\n          // 2. Set fr’s error to error.\n          fr[kError] = error\n\n          // 3. Fire a progress event called error at fr.\n          fireAProgressEvent('error', fr)\n\n          // 4. If fr’s state is not \"loading\", fire a progress\n          //    event called loadend at fr.\n          if (fr[kState] !== 'loading') {\n            fireAProgressEvent('loadend', fr)\n          }\n        })\n\n        break\n      }\n    }\n  })()\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#fire-a-progress-event\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e The name of the event\n * @param {import('./filereader').FileReader} reader\n */\nfunction fireAProgressEvent (e, reader) {\n  // The progress event e does not bubble. e.bubbles must be false\n  // The progress event e is NOT cancelable. e.cancelable must be false\n  const event = new ProgressEvent(e, {\n    bubbles: false,\n    cancelable: false\n  })\n\n  reader.dispatchEvent(event)\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#blob-package-data\n * @param {Uint8Array[]} bytes\n * @param {string} type\n * @param {string?} mimeType\n * @param {string?} encodingName\n */\nfunction packageData (bytes, type, mimeType, encodingName) {\n  // 1. A Blob has an associated package data algorithm, given\n  //    bytes, a type, a optional mimeType, and a optional\n  //    encodingName, which switches on type and runs the\n  //    associated steps:\n\n  switch (type) {\n    case 'DataURL': {\n      // 1. Return bytes as a DataURL [RFC2397] subject to\n      //    the considerations below:\n      //  * Use mimeType as part of the Data URL if it is\n      //    available in keeping with the Data URL\n      //    specification [RFC2397].\n      //  * If mimeType is not available return a Data URL\n      //    without a media-type. [RFC2397].\n\n      // https://datatracker.ietf.org/doc/html/rfc2397#section-3\n      // dataurl    := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n      // mediatype  := [ type \"/\" subtype ] *( \";\" parameter )\n      // data       := *urlchar\n      // parameter  := attribute \"=\" value\n      let dataURL = 'data:'\n\n      const parsed = parseMIMEType(mimeType || 'application/octet-stream')\n\n      if (parsed !== 'failure') {\n        dataURL += serializeAMimeType(parsed)\n      }\n\n      dataURL += ';base64,'\n\n      const decoder = new StringDecoder('latin1')\n\n      for (const chunk of bytes) {\n        dataURL += btoa(decoder.write(chunk))\n      }\n\n      dataURL += btoa(decoder.end())\n\n      return dataURL\n    }\n    case 'Text': {\n      // 1. Let encoding be failure\n      let encoding = 'failure'\n\n      // 2. If the encodingName is present, set encoding to the\n      //    result of getting an encoding from encodingName.\n      if (encodingName) {\n        encoding = getEncoding(encodingName)\n      }\n\n      // 3. If encoding is failure, and mimeType is present:\n      if (encoding === 'failure' && mimeType) {\n        // 1. Let type be the result of parse a MIME type\n        //    given mimeType.\n        const type = parseMIMEType(mimeType)\n\n        // 2. If type is not failure, set encoding to the result\n        //    of getting an encoding from type’s parameters[\"charset\"].\n        if (type !== 'failure') {\n          encoding = getEncoding(type.parameters.get('charset'))\n        }\n      }\n\n      // 4. If encoding is failure, then set encoding to UTF-8.\n      if (encoding === 'failure') {\n        encoding = 'UTF-8'\n      }\n\n      // 5. Decode bytes using fallback encoding encoding, and\n      //    return the result.\n      return decode(bytes, encoding)\n    }\n    case 'ArrayBuffer': {\n      // Return a new ArrayBuffer whose contents are bytes.\n      const sequence = combineByteSequences(bytes)\n\n      return sequence.buffer\n    }\n    case 'BinaryString': {\n      // Return bytes as a binary string, in which every byte\n      //  is represented by a code unit of equal value [0..255].\n      let binaryString = ''\n\n      const decoder = new StringDecoder('latin1')\n\n      for (const chunk of bytes) {\n        binaryString += decoder.write(chunk)\n      }\n\n      binaryString += decoder.end()\n\n      return binaryString\n    }\n  }\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#decode\n * @param {Uint8Array[]} ioQueue\n * @param {string} encoding\n */\nfunction decode (ioQueue, encoding) {\n  const bytes = combineByteSequences(ioQueue)\n\n  // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.\n  const BOMEncoding = BOMSniffing(bytes)\n\n  let slice = 0\n\n  // 2. If BOMEncoding is non-null:\n  if (BOMEncoding !== null) {\n    // 1. Set encoding to BOMEncoding.\n    encoding = BOMEncoding\n\n    // 2. Read three bytes from ioQueue, if BOMEncoding is\n    //    UTF-8; otherwise read two bytes.\n    //    (Do nothing with those bytes.)\n    slice = BOMEncoding === 'UTF-8' ? 3 : 2\n  }\n\n  // 3. Process a queue with an instance of encoding’s\n  //    decoder, ioQueue, output, and \"replacement\".\n\n  // 4. Return output.\n\n  const sliced = bytes.slice(slice)\n  return new TextDecoder(encoding).decode(sliced)\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#bom-sniff\n * @param {Uint8Array} ioQueue\n */\nfunction BOMSniffing (ioQueue) {\n  // 1. Let BOM be the result of peeking 3 bytes from ioQueue,\n  //    converted to a byte sequence.\n  const [a, b, c] = ioQueue\n\n  // 2. For each of the rows in the table below, starting with\n  //    the first one and going down, if BOM starts with the\n  //    bytes given in the first column, then return the\n  //    encoding given in the cell in the second column of that\n  //    row. Otherwise, return null.\n  if (a === 0xEF && b === 0xBB && c === 0xBF) {\n    return 'UTF-8'\n  } else if (a === 0xFE && b === 0xFF) {\n    return 'UTF-16BE'\n  } else if (a === 0xFF && b === 0xFE) {\n    return 'UTF-16LE'\n  }\n\n  return null\n}\n\n/**\n * @param {Uint8Array[]} sequences\n */\nfunction combineByteSequences (sequences) {\n  const size = sequences.reduce((a, b) => {\n    return a + b.byteLength\n  }, 0)\n\n  let offset = 0\n\n  return sequences.reduce((a, b) => {\n    a.set(b, offset)\n    offset += b.byteLength\n    return a\n  }, new Uint8Array(size))\n}\n\nmodule.exports = {\n  staticPropertyDescriptors,\n  readOperation,\n  fireAProgressEvent\n}\n","'use strict'\n\nconst { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require('./constants')\nconst {\n  kReadyState,\n  kSentClose,\n  kByteParser,\n  kReceivedClose,\n  kResponse\n} = require('./symbols')\nconst { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require('./util')\nconst { channels } = require('../../core/diagnostics')\nconst { CloseEvent } = require('./events')\nconst { makeRequest } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { Headers, getHeadersList } = require('../fetch/headers')\nconst { getDecodeSplit } = require('../fetch/util')\nconst { WebsocketFrameSend } = require('./frame')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n  crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#concept-websocket-establish\n * @param {URL} url\n * @param {string|string[]} protocols\n * @param {import('./websocket').WebSocket} ws\n * @param {(response: any, extensions: string[] | undefined) => void} onEstablish\n * @param {Partial} options\n */\nfunction establishWebSocketConnection (url, protocols, client, ws, onEstablish, options) {\n  // 1. Let requestURL be a copy of url, with its scheme set to \"http\", if url’s\n  //    scheme is \"ws\", and to \"https\" otherwise.\n  const requestURL = url\n\n  requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'\n\n  // 2. Let request be a new request, whose URL is requestURL, client is client,\n  //    service-workers mode is \"none\", referrer is \"no-referrer\", mode is\n  //    \"websocket\", credentials mode is \"include\", cache mode is \"no-store\" ,\n  //    and redirect mode is \"error\".\n  const request = makeRequest({\n    urlList: [requestURL],\n    client,\n    serviceWorkers: 'none',\n    referrer: 'no-referrer',\n    mode: 'websocket',\n    credentials: 'include',\n    cache: 'no-store',\n    redirect: 'error'\n  })\n\n  // Note: undici extension, allow setting custom headers.\n  if (options.headers) {\n    const headersList = getHeadersList(new Headers(options.headers))\n\n    request.headersList = headersList\n  }\n\n  // 3. Append (`Upgrade`, `websocket`) to request’s header list.\n  // 4. Append (`Connection`, `Upgrade`) to request’s header list.\n  // Note: both of these are handled by undici currently.\n  // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397\n\n  // 5. Let keyValue be a nonce consisting of a randomly selected\n  //    16-byte value that has been forgiving-base64-encoded and\n  //    isomorphic encoded.\n  const keyValue = crypto.randomBytes(16).toString('base64')\n\n  // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s\n  //    header list.\n  request.headersList.append('sec-websocket-key', keyValue)\n\n  // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s\n  //    header list.\n  request.headersList.append('sec-websocket-version', '13')\n\n  // 8. For each protocol in protocols, combine\n  //    (`Sec-WebSocket-Protocol`, protocol) in request’s header\n  //    list.\n  for (const protocol of protocols) {\n    request.headersList.append('sec-websocket-protocol', protocol)\n  }\n\n  // 9. Let permessageDeflate be a user-agent defined\n  //    \"permessage-deflate\" extension header value.\n  // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673\n  const permessageDeflate = 'permessage-deflate; client_max_window_bits'\n\n  // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to\n  //     request’s header list.\n  request.headersList.append('sec-websocket-extensions', permessageDeflate)\n\n  // 11. Fetch request with useParallelQueue set to true, and\n  //     processResponse given response being these steps:\n  const controller = fetching({\n    request,\n    useParallelQueue: true,\n    dispatcher: options.dispatcher,\n    processResponse (response) {\n      // 1. If response is a network error or its status is not 101,\n      //    fail the WebSocket connection.\n      if (response.type === 'error' || response.status !== 101) {\n        failWebsocketConnection(ws, 'Received network error or non-101 status code.')\n        return\n      }\n\n      // 2. If protocols is not the empty list and extracting header\n      //    list values given `Sec-WebSocket-Protocol` and response’s\n      //    header list results in null, failure, or the empty byte\n      //    sequence, then fail the WebSocket connection.\n      if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {\n        failWebsocketConnection(ws, 'Server did not respond with sent protocols.')\n        return\n      }\n\n      // 3. Follow the requirements stated step 2 to step 6, inclusive,\n      //    of the last set of steps in section 4.1 of The WebSocket\n      //    Protocol to validate response. This either results in fail\n      //    the WebSocket connection or the WebSocket connection is\n      //    established.\n\n      // 2. If the response lacks an |Upgrade| header field or the |Upgrade|\n      //    header field contains a value that is not an ASCII case-\n      //    insensitive match for the value \"websocket\", the client MUST\n      //    _Fail the WebSocket Connection_.\n      if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {\n        failWebsocketConnection(ws, 'Server did not set Upgrade header to \"websocket\".')\n        return\n      }\n\n      // 3. If the response lacks a |Connection| header field or the\n      //    |Connection| header field doesn't contain a token that is an\n      //    ASCII case-insensitive match for the value \"Upgrade\", the client\n      //    MUST _Fail the WebSocket Connection_.\n      if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {\n        failWebsocketConnection(ws, 'Server did not set Connection header to \"upgrade\".')\n        return\n      }\n\n      // 4. If the response lacks a |Sec-WebSocket-Accept| header field or\n      //    the |Sec-WebSocket-Accept| contains a value other than the\n      //    base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-\n      //    Key| (as a string, not base64-decoded) with the string \"258EAFA5-\n      //    E914-47DA-95CA-C5AB0DC85B11\" but ignoring any leading and\n      //    trailing whitespace, the client MUST _Fail the WebSocket\n      //    Connection_.\n      const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')\n      const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')\n      if (secWSAccept !== digest) {\n        failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')\n        return\n      }\n\n      // 5. If the response includes a |Sec-WebSocket-Extensions| header\n      //    field and this header field indicates the use of an extension\n      //    that was not present in the client's handshake (the server has\n      //    indicated an extension not requested by the client), the client\n      //    MUST _Fail the WebSocket Connection_.  (The parsing of this\n      //    header field to determine which extensions are requested is\n      //    discussed in Section 9.1.)\n      const secExtension = response.headersList.get('Sec-WebSocket-Extensions')\n      let extensions\n\n      if (secExtension !== null) {\n        extensions = parseExtensions(secExtension)\n\n        if (!extensions.has('permessage-deflate')) {\n          failWebsocketConnection(ws, 'Sec-WebSocket-Extensions header does not match.')\n          return\n        }\n      }\n\n      // 6. If the response includes a |Sec-WebSocket-Protocol| header field\n      //    and this header field indicates the use of a subprotocol that was\n      //    not present in the client's handshake (the server has indicated a\n      //    subprotocol not requested by the client), the client MUST _Fail\n      //    the WebSocket Connection_.\n      const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')\n\n      if (secProtocol !== null) {\n        const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList)\n\n        // The client can request that the server use a specific subprotocol by\n        // including the |Sec-WebSocket-Protocol| field in its handshake.  If it\n        // is specified, the server needs to include the same field and one of\n        // the selected subprotocol values in its response for the connection to\n        // be established.\n        if (!requestProtocols.includes(secProtocol)) {\n          failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')\n          return\n        }\n      }\n\n      response.socket.on('data', onSocketData)\n      response.socket.on('close', onSocketClose)\n      response.socket.on('error', onSocketError)\n\n      if (channels.open.hasSubscribers) {\n        channels.open.publish({\n          address: response.socket.address(),\n          protocol: secProtocol,\n          extensions: secExtension\n        })\n      }\n\n      onEstablish(response, extensions)\n    }\n  })\n\n  return controller\n}\n\nfunction closeWebSocketConnection (ws, code, reason, reasonByteLength) {\n  if (isClosing(ws) || isClosed(ws)) {\n    // If this's ready state is CLOSING (2) or CLOSED (3)\n    // Do nothing.\n  } else if (!isEstablished(ws)) {\n    // If the WebSocket connection is not yet established\n    // Fail the WebSocket connection and set this's ready state\n    // to CLOSING (2).\n    failWebsocketConnection(ws, 'Connection was closed before it was established.')\n    ws[kReadyState] = states.CLOSING\n  } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) {\n    // If the WebSocket closing handshake has not yet been started\n    // Start the WebSocket closing handshake and set this's ready\n    // state to CLOSING (2).\n    // - If neither code nor reason is present, the WebSocket Close\n    //   message must not have a body.\n    // - If code is present, then the status code to use in the\n    //   WebSocket Close message must be the integer given by code.\n    // - If reason is also present, then reasonBytes must be\n    //   provided in the Close message after the status code.\n\n    ws[kSentClose] = sentCloseFrameState.PROCESSING\n\n    const frame = new WebsocketFrameSend()\n\n    // If neither code nor reason is present, the WebSocket Close\n    // message must not have a body.\n\n    // If code is present, then the status code to use in the\n    // WebSocket Close message must be the integer given by code.\n    if (code !== undefined && reason === undefined) {\n      frame.frameData = Buffer.allocUnsafe(2)\n      frame.frameData.writeUInt16BE(code, 0)\n    } else if (code !== undefined && reason !== undefined) {\n      // If reason is also present, then reasonBytes must be\n      // provided in the Close message after the status code.\n      frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)\n      frame.frameData.writeUInt16BE(code, 0)\n      // the body MAY contain UTF-8-encoded data with value /reason/\n      frame.frameData.write(reason, 2, 'utf-8')\n    } else {\n      frame.frameData = emptyBuffer\n    }\n\n    /** @type {import('stream').Duplex} */\n    const socket = ws[kResponse].socket\n\n    socket.write(frame.createFrame(opcodes.CLOSE))\n\n    ws[kSentClose] = sentCloseFrameState.SENT\n\n    // Upon either sending or receiving a Close control frame, it is said\n    // that _The WebSocket Closing Handshake is Started_ and that the\n    // WebSocket connection is in the CLOSING state.\n    ws[kReadyState] = states.CLOSING\n  } else {\n    // Otherwise\n    // Set this's ready state to CLOSING (2).\n    ws[kReadyState] = states.CLOSING\n  }\n}\n\n/**\n * @param {Buffer} chunk\n */\nfunction onSocketData (chunk) {\n  if (!this.ws[kByteParser].write(chunk)) {\n    this.pause()\n  }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n */\nfunction onSocketClose () {\n  const { ws } = this\n  const { [kResponse]: response } = ws\n\n  response.socket.off('data', onSocketData)\n  response.socket.off('close', onSocketClose)\n  response.socket.off('error', onSocketError)\n\n  // If the TCP connection was closed after the\n  // WebSocket closing handshake was completed, the WebSocket connection\n  // is said to have been closed _cleanly_.\n  const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]\n\n  let code = 1005\n  let reason = ''\n\n  const result = ws[kByteParser].closingInfo\n\n  if (result && !result.error) {\n    code = result.code ?? 1005\n    reason = result.reason\n  } else if (!ws[kReceivedClose]) {\n    // If _The WebSocket\n    // Connection is Closed_ and no Close control frame was received by the\n    // endpoint (such as could occur if the underlying transport connection\n    // is lost), _The WebSocket Connection Close Code_ is considered to be\n    // 1006.\n    code = 1006\n  }\n\n  // 1. Change the ready state to CLOSED (3).\n  ws[kReadyState] = states.CLOSED\n\n  // 2. If the user agent was required to fail the WebSocket\n  //    connection, or if the WebSocket connection was closed\n  //    after being flagged as full, fire an event named error\n  //    at the WebSocket object.\n  // TODO\n\n  // 3. Fire an event named close at the WebSocket object,\n  //    using CloseEvent, with the wasClean attribute\n  //    initialized to true if the connection closed cleanly\n  //    and false otherwise, the code attribute initialized to\n  //    the WebSocket connection close code, and the reason\n  //    attribute initialized to the result of applying UTF-8\n  //    decode without BOM to the WebSocket connection close\n  //    reason.\n  // TODO: process.nextTick\n  fireEvent('close', ws, (type, init) => new CloseEvent(type, init), {\n    wasClean, code, reason\n  })\n\n  if (channels.close.hasSubscribers) {\n    channels.close.publish({\n      websocket: ws,\n      code,\n      reason\n    })\n  }\n}\n\nfunction onSocketError (error) {\n  const { ws } = this\n\n  ws[kReadyState] = states.CLOSING\n\n  if (channels.socketError.hasSubscribers) {\n    channels.socketError.publish(error)\n  }\n\n  this.destroy()\n}\n\nmodule.exports = {\n  establishWebSocketConnection,\n  closeWebSocketConnection\n}\n","'use strict'\n\n// This is a Globally Unique Identifier unique used\n// to validate that the endpoint accepts websocket\n// connections.\n// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3\nconst uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n  enumerable: true,\n  writable: false,\n  configurable: false\n}\n\nconst states = {\n  CONNECTING: 0,\n  OPEN: 1,\n  CLOSING: 2,\n  CLOSED: 3\n}\n\nconst sentCloseFrameState = {\n  NOT_SENT: 0,\n  PROCESSING: 1,\n  SENT: 2\n}\n\nconst opcodes = {\n  CONTINUATION: 0x0,\n  TEXT: 0x1,\n  BINARY: 0x2,\n  CLOSE: 0x8,\n  PING: 0x9,\n  PONG: 0xA\n}\n\nconst maxUnsigned16Bit = 2 ** 16 - 1 // 65535\n\nconst parserStates = {\n  INFO: 0,\n  PAYLOADLENGTH_16: 2,\n  PAYLOADLENGTH_64: 3,\n  READ_DATA: 4\n}\n\nconst emptyBuffer = Buffer.allocUnsafe(0)\n\nconst sendHints = {\n  string: 1,\n  typedArray: 2,\n  arrayBuffer: 3,\n  blob: 4\n}\n\nmodule.exports = {\n  uid,\n  sentCloseFrameState,\n  staticPropertyDescriptors,\n  states,\n  opcodes,\n  maxUnsigned16Bit,\n  parserStates,\n  emptyBuffer,\n  sendHints\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { kConstruct } = require('../../core/symbols')\nconst { MessagePort } = require('node:worker_threads')\n\n/**\n * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent\n */\nclass MessageEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict = {}) {\n    if (type === kConstruct) {\n      super(arguments[1], arguments[2])\n      webidl.util.markAsUncloneable(this)\n      return\n    }\n\n    const prefix = 'MessageEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')\n\n    super(type, eventInitDict)\n\n    this.#eventInit = eventInitDict\n    webidl.util.markAsUncloneable(this)\n  }\n\n  get data () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.data\n  }\n\n  get origin () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.origin\n  }\n\n  get lastEventId () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.lastEventId\n  }\n\n  get source () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.source\n  }\n\n  get ports () {\n    webidl.brandCheck(this, MessageEvent)\n\n    if (!Object.isFrozen(this.#eventInit.ports)) {\n      Object.freeze(this.#eventInit.ports)\n    }\n\n    return this.#eventInit.ports\n  }\n\n  initMessageEvent (\n    type,\n    bubbles = false,\n    cancelable = false,\n    data = null,\n    origin = '',\n    lastEventId = '',\n    source = null,\n    ports = []\n  ) {\n    webidl.brandCheck(this, MessageEvent)\n\n    webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')\n\n    return new MessageEvent(type, {\n      bubbles, cancelable, data, origin, lastEventId, source, ports\n    })\n  }\n\n  static createFastMessageEvent (type, init) {\n    const messageEvent = new MessageEvent(kConstruct, type, init)\n    messageEvent.#eventInit = init\n    messageEvent.#eventInit.data ??= null\n    messageEvent.#eventInit.origin ??= ''\n    messageEvent.#eventInit.lastEventId ??= ''\n    messageEvent.#eventInit.source ??= null\n    messageEvent.#eventInit.ports ??= []\n    return messageEvent\n  }\n}\n\nconst { createFastMessageEvent } = MessageEvent\ndelete MessageEvent.createFastMessageEvent\n\n/**\n * @see https://websockets.spec.whatwg.org/#the-closeevent-interface\n */\nclass CloseEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict = {}) {\n    const prefix = 'CloseEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.CloseEventInit(eventInitDict)\n\n    super(type, eventInitDict)\n\n    this.#eventInit = eventInitDict\n    webidl.util.markAsUncloneable(this)\n  }\n\n  get wasClean () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.wasClean\n  }\n\n  get code () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.code\n  }\n\n  get reason () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.reason\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface\nclass ErrorEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict) {\n    const prefix = 'ErrorEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    super(type, eventInitDict)\n    webidl.util.markAsUncloneable(this)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})\n\n    this.#eventInit = eventInitDict\n  }\n\n  get message () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.message\n  }\n\n  get filename () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.filename\n  }\n\n  get lineno () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.lineno\n  }\n\n  get colno () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.colno\n  }\n\n  get error () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.error\n  }\n}\n\nObject.defineProperties(MessageEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'MessageEvent',\n    configurable: true\n  },\n  data: kEnumerableProperty,\n  origin: kEnumerableProperty,\n  lastEventId: kEnumerableProperty,\n  source: kEnumerableProperty,\n  ports: kEnumerableProperty,\n  initMessageEvent: kEnumerableProperty\n})\n\nObject.defineProperties(CloseEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'CloseEvent',\n    configurable: true\n  },\n  reason: kEnumerableProperty,\n  code: kEnumerableProperty,\n  wasClean: kEnumerableProperty\n})\n\nObject.defineProperties(ErrorEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'ErrorEvent',\n    configurable: true\n  },\n  message: kEnumerableProperty,\n  filename: kEnumerableProperty,\n  lineno: kEnumerableProperty,\n  colno: kEnumerableProperty,\n  error: kEnumerableProperty\n})\n\nwebidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.MessagePort\n)\n\nconst eventInit = [\n  {\n    key: 'bubbles',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'cancelable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'composed',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n]\n\nwebidl.converters.MessageEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'data',\n    converter: webidl.converters.any,\n    defaultValue: () => null\n  },\n  {\n    key: 'origin',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'lastEventId',\n    converter: webidl.converters.DOMString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'source',\n    // Node doesn't implement WindowProxy or ServiceWorker, so the only\n    // valid value for source is a MessagePort.\n    converter: webidl.nullableConverter(webidl.converters.MessagePort),\n    defaultValue: () => null\n  },\n  {\n    key: 'ports',\n    converter: webidl.converters['sequence'],\n    defaultValue: () => new Array(0)\n  }\n])\n\nwebidl.converters.CloseEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'wasClean',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'code',\n    converter: webidl.converters['unsigned short'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'reason',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  }\n])\n\nwebidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'message',\n    converter: webidl.converters.DOMString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'filename',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'lineno',\n    converter: webidl.converters['unsigned long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'colno',\n    converter: webidl.converters['unsigned long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'error',\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = {\n  MessageEvent,\n  CloseEvent,\n  ErrorEvent,\n  createFastMessageEvent\n}\n","'use strict'\n\nconst { maxUnsigned16Bit } = require('./constants')\n\nconst BUFFER_SIZE = 16386\n\n/** @type {import('crypto')} */\nlet crypto\nlet buffer = null\nlet bufIdx = BUFFER_SIZE\n\ntry {\n  crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n  crypto = {\n    // not full compatibility, but minimum.\n    randomFillSync: function randomFillSync (buffer, _offset, _size) {\n      for (let i = 0; i < buffer.length; ++i) {\n        buffer[i] = Math.random() * 255 | 0\n      }\n      return buffer\n    }\n  }\n}\n\nfunction generateMask () {\n  if (bufIdx === BUFFER_SIZE) {\n    bufIdx = 0\n    crypto.randomFillSync((buffer ??= Buffer.allocUnsafe(BUFFER_SIZE)), 0, BUFFER_SIZE)\n  }\n  return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]\n}\n\nclass WebsocketFrameSend {\n  /**\n   * @param {Buffer|undefined} data\n   */\n  constructor (data) {\n    this.frameData = data\n  }\n\n  createFrame (opcode) {\n    const frameData = this.frameData\n    const maskKey = generateMask()\n    const bodyLength = frameData?.byteLength ?? 0\n\n    /** @type {number} */\n    let payloadLength = bodyLength // 0-125\n    let offset = 6\n\n    if (bodyLength > maxUnsigned16Bit) {\n      offset += 8 // payload length is next 8 bytes\n      payloadLength = 127\n    } else if (bodyLength > 125) {\n      offset += 2 // payload length is next 2 bytes\n      payloadLength = 126\n    }\n\n    const buffer = Buffer.allocUnsafe(bodyLength + offset)\n\n    // Clear first 2 bytes, everything else is overwritten\n    buffer[0] = buffer[1] = 0\n    buffer[0] |= 0x80 // FIN\n    buffer[0] = (buffer[0] & 0xF0) + opcode // opcode\n\n    /*! ws. MIT License. Einar Otto Stangvik  */\n    buffer[offset - 4] = maskKey[0]\n    buffer[offset - 3] = maskKey[1]\n    buffer[offset - 2] = maskKey[2]\n    buffer[offset - 1] = maskKey[3]\n\n    buffer[1] = payloadLength\n\n    if (payloadLength === 126) {\n      buffer.writeUInt16BE(bodyLength, 2)\n    } else if (payloadLength === 127) {\n      // Clear extended payload length\n      buffer[2] = buffer[3] = 0\n      buffer.writeUIntBE(bodyLength, 4, 6)\n    }\n\n    buffer[1] |= 0x80 // MASK\n\n    // mask body\n    for (let i = 0; i < bodyLength; ++i) {\n      buffer[offset + i] = frameData[i] ^ maskKey[i & 3]\n    }\n\n    return buffer\n  }\n}\n\nmodule.exports = {\n  WebsocketFrameSend\n}\n","'use strict'\n\nconst { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require('node:zlib')\nconst { isValidClientWindowBits } = require('./util')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nconst tail = Buffer.from([0x00, 0x00, 0xff, 0xff])\nconst kBuffer = Symbol('kBuffer')\nconst kLength = Symbol('kLength')\n\nclass PerMessageDeflate {\n  /** @type {import('node:zlib').InflateRaw} */\n  #inflate\n\n  #options = {}\n\n  #maxPayloadSize = 0\n\n  /**\n   * @param {Map} extensions\n   */\n  constructor (extensions, options) {\n    this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')\n    this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')\n\n    this.#maxPayloadSize = options.maxPayloadSize\n  }\n\n  /**\n   * Decompress a compressed payload.\n   * @param {Buffer} chunk Compressed data\n   * @param {boolean} fin Final fragment flag\n   * @param {Function} callback Callback function\n   */\n  decompress (chunk, fin, callback) {\n    // An endpoint uses the following algorithm to decompress a message.\n    // 1.  Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the\n    //     payload of the message.\n    // 2.  Decompress the resulting data using DEFLATE.\n    if (!this.#inflate) {\n      let windowBits = Z_DEFAULT_WINDOWBITS\n\n      if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS\n        if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {\n          callback(new Error('Invalid server_max_window_bits'))\n          return\n        }\n\n        windowBits = Number.parseInt(this.#options.serverMaxWindowBits)\n      }\n\n      try {\n        this.#inflate = createInflateRaw({ windowBits })\n      } catch (err) {\n        callback(err)\n        return\n      }\n      this.#inflate[kBuffer] = []\n      this.#inflate[kLength] = 0\n\n      this.#inflate.on('data', (data) => {\n        this.#inflate[kLength] += data.length\n\n        if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {\n          callback(new MessageSizeExceededError())\n          this.#inflate.removeAllListeners()\n          this.#inflate = null\n          return\n        }\n\n        this.#inflate[kBuffer].push(data)\n      })\n\n      this.#inflate.on('error', (err) => {\n        this.#inflate = null\n        callback(err)\n      })\n    }\n\n    this.#inflate.write(chunk)\n    if (fin) {\n      this.#inflate.write(tail)\n    }\n\n    this.#inflate.flush(() => {\n      if (!this.#inflate) {\n        return\n      }\n\n      const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])\n\n      this.#inflate[kBuffer].length = 0\n      this.#inflate[kLength] = 0\n\n      callback(null, full)\n    })\n  }\n}\n\nmodule.exports = { PerMessageDeflate }\n","'use strict'\n\nconst { Writable } = require('node:stream')\nconst assert = require('node:assert')\nconst { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require('./constants')\nconst { kReadyState, kSentClose, kResponse, kReceivedClose } = require('./symbols')\nconst { channels } = require('../../core/diagnostics')\nconst {\n  isValidStatusCode,\n  isValidOpcode,\n  failWebsocketConnection,\n  websocketMessageReceived,\n  utf8Decode,\n  isControlFrame,\n  isTextBinaryFrame,\n  isContinuationFrame\n} = require('./util')\nconst { WebsocketFrameSend } = require('./frame')\nconst { closeWebSocketConnection } = require('./connection')\nconst { PerMessageDeflate } = require('./permessage-deflate')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nfunction failWebsocketConnectionWithCode (ws, code, reason) {\n  closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason))\n  failWebsocketConnection(ws, reason)\n}\n\n// This code was influenced by ws released under the MIT license.\n// Copyright (c) 2011 Einar Otto Stangvik \n// Copyright (c) 2013 Arnout Kazemier and contributors\n// Copyright (c) 2016 Luigi Pinca and contributors\n\nclass ByteParser extends Writable {\n  #buffers = []\n  #fragmentsBytes = 0\n  #byteOffset = 0\n  #loop = false\n\n  #state = parserStates.INFO\n\n  #info = {}\n  #fragments = []\n\n  /** @type {Map} */\n  #extensions\n\n  /** @type {number} */\n  #maxFragments\n\n  /** @type {number} */\n  #maxPayloadSize\n\n  /**\n   * @param {import('./websocket').WebSocket} ws\n   * @param {Map|null} extensions\n   * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]\n   */\n  constructor (ws, extensions, options = {}) {\n    super()\n\n    this.ws = ws\n    this.#extensions = extensions == null ? new Map() : extensions\n    this.#maxFragments = options.maxFragments ?? 0\n    this.#maxPayloadSize = options.maxPayloadSize ?? 0\n\n    if (this.#extensions.has('permessage-deflate')) {\n      this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))\n    }\n  }\n\n  /**\n   * @param {Buffer} chunk\n   * @param {() => void} callback\n   */\n  _write (chunk, _, callback) {\n    this.#buffers.push(chunk)\n    this.#byteOffset += chunk.length\n    this.#loop = true\n\n    this.run(callback)\n  }\n\n  #validatePayloadLength () {\n    if (\n      this.#maxPayloadSize > 0 &&\n      !isControlFrame(this.#info.opcode) &&\n      this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize\n    ) {\n      failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size')\n      return false\n    }\n\n    return true\n  }\n\n  /**\n   * Runs whenever a new chunk is received.\n   * Callback is called whenever there are no more chunks buffering,\n   * or not enough bytes are buffered to parse.\n   */\n  run (callback) {\n    while (this.#loop) {\n      if (this.#state === parserStates.INFO) {\n        // If there aren't enough bytes to parse the payload length, etc.\n        if (this.#byteOffset < 2) {\n          return callback()\n        }\n\n        const buffer = this.consume(2)\n        const fin = (buffer[0] & 0x80) !== 0\n        const opcode = buffer[0] & 0x0F\n        const masked = (buffer[1] & 0x80) === 0x80\n\n        const fragmented = !fin && opcode !== opcodes.CONTINUATION\n        const payloadLength = buffer[1] & 0x7F\n\n        const rsv1 = buffer[0] & 0x40\n        const rsv2 = buffer[0] & 0x20\n        const rsv3 = buffer[0] & 0x10\n\n        if (!isValidOpcode(opcode)) {\n          failWebsocketConnection(this.ws, 'Invalid opcode received')\n          return callback()\n        }\n\n        if (masked) {\n          failWebsocketConnection(this.ws, 'Frame cannot be masked')\n          return callback()\n        }\n\n        // MUST be 0 unless an extension is negotiated that defines meanings\n        // for non-zero values.  If a nonzero value is received and none of\n        // the negotiated extensions defines the meaning of such a nonzero\n        // value, the receiving endpoint MUST _Fail the WebSocket\n        // Connection_.\n        // This document allocates the RSV1 bit of the WebSocket header for\n        // PMCEs and calls the bit the \"Per-Message Compressed\" bit.  On a\n        // WebSocket connection where a PMCE is in use, this bit indicates\n        // whether a message is compressed or not.\n        if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {\n          failWebsocketConnection(this.ws, 'Expected RSV1 to be clear.')\n          return\n        }\n\n        if (rsv2 !== 0 || rsv3 !== 0) {\n          failWebsocketConnection(this.ws, 'RSV1, RSV2, RSV3 must be clear')\n          return\n        }\n\n        if (fragmented && !isTextBinaryFrame(opcode)) {\n          // Only text and binary frames can be fragmented\n          failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')\n          return\n        }\n\n        // If we are already parsing a text/binary frame and do not receive either\n        // a continuation frame or close frame, fail the connection.\n        if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {\n          failWebsocketConnection(this.ws, 'Expected continuation frame')\n          return\n        }\n\n        if (this.#info.fragmented && fragmented) {\n          // A fragmented frame can't be fragmented itself\n          failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')\n          return\n        }\n\n        // \"All control frames MUST have a payload length of 125 bytes or less\n        // and MUST NOT be fragmented.\"\n        if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {\n          failWebsocketConnection(this.ws, 'Control frame either too large or fragmented')\n          return\n        }\n\n        if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {\n          failWebsocketConnection(this.ws, 'Unexpected continuation frame')\n          return\n        }\n\n        if (payloadLength <= 125) {\n          this.#info.payloadLength = payloadLength\n          this.#state = parserStates.READ_DATA\n\n          if (!this.#validatePayloadLength()) {\n            return\n          }\n        } else if (payloadLength === 126) {\n          this.#state = parserStates.PAYLOADLENGTH_16\n        } else if (payloadLength === 127) {\n          this.#state = parserStates.PAYLOADLENGTH_64\n        }\n\n        if (isTextBinaryFrame(opcode)) {\n          this.#info.binaryType = opcode\n          this.#info.compressed = rsv1 !== 0\n        }\n\n        this.#info.opcode = opcode\n        this.#info.masked = masked\n        this.#info.fin = fin\n        this.#info.fragmented = fragmented\n      } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n        if (this.#byteOffset < 2) {\n          return callback()\n        }\n\n        const buffer = this.consume(2)\n\n        this.#info.payloadLength = buffer.readUInt16BE(0)\n        this.#state = parserStates.READ_DATA\n\n        if (!this.#validatePayloadLength()) {\n          return\n        }\n      } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n        if (this.#byteOffset < 8) {\n          return callback()\n        }\n\n        const buffer = this.consume(8)\n        const upper = buffer.readUInt32BE(0)\n        const lower = buffer.readUInt32BE(4)\n\n        // 2^31 is the maximum bytes an arraybuffer can contain\n        // on 32-bit systems. Although, on 64-bit systems, this is\n        // 2^53-1 bytes.\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n        // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n        // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n        if (upper !== 0 || lower > 2 ** 31 - 1) {\n          failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')\n          return\n        }\n\n        this.#info.payloadLength = lower\n        this.#state = parserStates.READ_DATA\n\n        if (!this.#validatePayloadLength()) {\n          return\n        }\n      } else if (this.#state === parserStates.READ_DATA) {\n        if (this.#byteOffset < this.#info.payloadLength) {\n          return callback()\n        }\n\n        const body = this.consume(this.#info.payloadLength)\n\n        if (isControlFrame(this.#info.opcode)) {\n          this.#loop = this.parseControlFrame(body)\n          this.#state = parserStates.INFO\n        } else {\n          if (!this.#info.compressed) {\n            if (!this.writeFragments(body)) {\n              return\n            }\n\n            if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n              failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n              return\n            }\n\n            // If the frame is not fragmented, a message has been received.\n            // If the frame is fragmented, it will terminate with a fin bit set\n            // and an opcode of 0 (continuation), therefore we handle that when\n            // parsing continuation frames, not here.\n            if (!this.#info.fragmented && this.#info.fin) {\n              websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n            }\n\n            this.#state = parserStates.INFO\n          } else {\n            this.#extensions.get('permessage-deflate').decompress(\n              body,\n              this.#info.fin,\n              (error, data) => {\n                if (error) {\n                  const code = error instanceof MessageSizeExceededError ? 1009 : 1007\n                  failWebsocketConnectionWithCode(this.ws, code, error.message)\n                  return\n                }\n\n                if (!this.writeFragments(data)) {\n                  return\n                }\n\n                if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n                  failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n                  return\n                }\n\n                if (!this.#info.fin) {\n                  this.#state = parserStates.INFO\n                  this.#loop = true\n                  this.run(callback)\n                  return\n                }\n\n                websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n\n                this.#loop = true\n                this.#state = parserStates.INFO\n                this.run(callback)\n              }\n            )\n\n            this.#loop = false\n            break\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * Take n bytes from the buffered Buffers\n   * @param {number} n\n   * @returns {Buffer}\n   */\n  consume (n) {\n    if (n > this.#byteOffset) {\n      throw new Error('Called consume() before buffers satiated.')\n    } else if (n === 0) {\n      return emptyBuffer\n    }\n\n    if (this.#buffers[0].length === n) {\n      this.#byteOffset -= this.#buffers[0].length\n      return this.#buffers.shift()\n    }\n\n    const buffer = Buffer.allocUnsafe(n)\n    let offset = 0\n\n    while (offset !== n) {\n      const next = this.#buffers[0]\n      const { length } = next\n\n      if (length + offset === n) {\n        buffer.set(this.#buffers.shift(), offset)\n        break\n      } else if (length + offset > n) {\n        buffer.set(next.subarray(0, n - offset), offset)\n        this.#buffers[0] = next.subarray(n - offset)\n        break\n      } else {\n        buffer.set(this.#buffers.shift(), offset)\n        offset += next.length\n      }\n    }\n\n    this.#byteOffset -= n\n\n    return buffer\n  }\n\n  writeFragments (fragment) {\n    if (\n      this.#maxFragments > 0 &&\n      this.#fragments.length === this.#maxFragments\n    ) {\n      failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments')\n      return false\n    }\n\n    this.#fragmentsBytes += fragment.length\n    this.#fragments.push(fragment)\n    return true\n  }\n\n  consumeFragments () {\n    const fragments = this.#fragments\n\n    if (fragments.length === 1) {\n      this.#fragmentsBytes = 0\n      return fragments.shift()\n    }\n\n    const output = Buffer.concat(fragments, this.#fragmentsBytes)\n    this.#fragments = []\n    this.#fragmentsBytes = 0\n\n    return output\n  }\n\n  parseCloseBody (data) {\n    assert(data.length !== 1)\n\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n    /** @type {number|undefined} */\n    let code\n\n    if (data.length >= 2) {\n      // _The WebSocket Connection Close Code_ is\n      // defined as the status code (Section 7.4) contained in the first Close\n      // control frame received by the application\n      code = data.readUInt16BE(0)\n    }\n\n    if (code !== undefined && !isValidStatusCode(code)) {\n      return { code: 1002, reason: 'Invalid status code', error: true }\n    }\n\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6\n    /** @type {Buffer} */\n    let reason = data.subarray(2)\n\n    // Remove BOM\n    if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {\n      reason = reason.subarray(3)\n    }\n\n    try {\n      reason = utf8Decode(reason)\n    } catch {\n      return { code: 1007, reason: 'Invalid UTF-8', error: true }\n    }\n\n    return { code, reason, error: false }\n  }\n\n  /**\n   * Parses control frames.\n   * @param {Buffer} body\n   */\n  parseControlFrame (body) {\n    const { opcode, payloadLength } = this.#info\n\n    if (opcode === opcodes.CLOSE) {\n      if (payloadLength === 1) {\n        failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')\n        return false\n      }\n\n      this.#info.closeInfo = this.parseCloseBody(body)\n\n      if (this.#info.closeInfo.error) {\n        const { code, reason } = this.#info.closeInfo\n\n        closeWebSocketConnection(this.ws, code, reason, reason.length)\n        failWebsocketConnection(this.ws, reason)\n        return false\n      }\n\n      if (this.ws[kSentClose] !== sentCloseFrameState.SENT) {\n        // If an endpoint receives a Close frame and did not previously send a\n        // Close frame, the endpoint MUST send a Close frame in response.  (When\n        // sending a Close frame in response, the endpoint typically echos the\n        // status code it received.)\n        let body = emptyBuffer\n        if (this.#info.closeInfo.code) {\n          body = Buffer.allocUnsafe(2)\n          body.writeUInt16BE(this.#info.closeInfo.code, 0)\n        }\n        const closeFrame = new WebsocketFrameSend(body)\n\n        this.ws[kResponse].socket.write(\n          closeFrame.createFrame(opcodes.CLOSE),\n          (err) => {\n            if (!err) {\n              this.ws[kSentClose] = sentCloseFrameState.SENT\n            }\n          }\n        )\n      }\n\n      // Upon either sending or receiving a Close control frame, it is said\n      // that _The WebSocket Closing Handshake is Started_ and that the\n      // WebSocket connection is in the CLOSING state.\n      this.ws[kReadyState] = states.CLOSING\n      this.ws[kReceivedClose] = true\n\n      return false\n    } else if (opcode === opcodes.PING) {\n      // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n      // response, unless it already received a Close frame.\n      // A Pong frame sent in response to a Ping frame must have identical\n      // \"Application data\"\n\n      if (!this.ws[kReceivedClose]) {\n        const frame = new WebsocketFrameSend(body)\n\n        this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))\n\n        if (channels.ping.hasSubscribers) {\n          channels.ping.publish({\n            payload: body\n          })\n        }\n      }\n    } else if (opcode === opcodes.PONG) {\n      // A Pong frame MAY be sent unsolicited.  This serves as a\n      // unidirectional heartbeat.  A response to an unsolicited Pong frame is\n      // not expected.\n\n      if (channels.pong.hasSubscribers) {\n        channels.pong.publish({\n          payload: body\n        })\n      }\n    }\n\n    return true\n  }\n\n  get closingInfo () {\n    return this.#info.closeInfo\n  }\n}\n\nmodule.exports = {\n  ByteParser\n}\n","'use strict'\n\nconst { WebsocketFrameSend } = require('./frame')\nconst { opcodes, sendHints } = require('./constants')\nconst FixedQueue = require('../../dispatcher/fixed-queue')\n\n/** @type {typeof Uint8Array} */\nconst FastBuffer = Buffer[Symbol.species]\n\n/**\n * @typedef {object} SendQueueNode\n * @property {Promise | null} promise\n * @property {((...args: any[]) => any)} callback\n * @property {Buffer | null} frame\n */\n\nclass SendQueue {\n  /**\n   * @type {FixedQueue}\n   */\n  #queue = new FixedQueue()\n\n  /**\n   * @type {boolean}\n   */\n  #running = false\n\n  /** @type {import('node:net').Socket} */\n  #socket\n\n  constructor (socket) {\n    this.#socket = socket\n  }\n\n  add (item, cb, hint) {\n    if (hint !== sendHints.blob) {\n      const frame = createFrame(item, hint)\n      if (!this.#running) {\n        // fast-path\n        this.#socket.write(frame, cb)\n      } else {\n        /** @type {SendQueueNode} */\n        const node = {\n          promise: null,\n          callback: cb,\n          frame\n        }\n        this.#queue.push(node)\n      }\n      return\n    }\n\n    /** @type {SendQueueNode} */\n    const node = {\n      promise: item.arrayBuffer().then((ab) => {\n        node.promise = null\n        node.frame = createFrame(ab, hint)\n      }),\n      callback: cb,\n      frame: null\n    }\n\n    this.#queue.push(node)\n\n    if (!this.#running) {\n      this.#run()\n    }\n  }\n\n  async #run () {\n    this.#running = true\n    const queue = this.#queue\n    while (!queue.isEmpty()) {\n      const node = queue.shift()\n      // wait pending promise\n      if (node.promise !== null) {\n        await node.promise\n      }\n      // write\n      this.#socket.write(node.frame, node.callback)\n      // cleanup\n      node.callback = node.frame = null\n    }\n    this.#running = false\n  }\n}\n\nfunction createFrame (data, hint) {\n  return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY)\n}\n\nfunction toBuffer (data, hint) {\n  switch (hint) {\n    case sendHints.string:\n      return Buffer.from(data)\n    case sendHints.arrayBuffer:\n    case sendHints.blob:\n      return new FastBuffer(data)\n    case sendHints.typedArray:\n      return new FastBuffer(data.buffer, data.byteOffset, data.byteLength)\n  }\n}\n\nmodule.exports = { SendQueue }\n","'use strict'\n\nmodule.exports = {\n  kWebSocketURL: Symbol('url'),\n  kReadyState: Symbol('ready state'),\n  kController: Symbol('controller'),\n  kResponse: Symbol('response'),\n  kBinaryType: Symbol('binary type'),\n  kSentClose: Symbol('sent close'),\n  kReceivedClose: Symbol('received close'),\n  kByteParser: Symbol('byte parser')\n}\n","'use strict'\n\nconst { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require('./symbols')\nconst { states, opcodes } = require('./constants')\nconst { ErrorEvent, createFastMessageEvent } = require('./events')\nconst { isUtf8 } = require('node:buffer')\nconst { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require('../fetch/data-url')\n\n/* globals Blob */\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isConnecting (ws) {\n  // If the WebSocket connection is not yet established, and the connection\n  // is not yet closed, then the WebSocket connection is in the CONNECTING state.\n  return ws[kReadyState] === states.CONNECTING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isEstablished (ws) {\n  // If the server's response is validated as provided for above, it is\n  // said that _The WebSocket Connection is Established_ and that the\n  // WebSocket Connection is in the OPEN state.\n  return ws[kReadyState] === states.OPEN\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosing (ws) {\n  // Upon either sending or receiving a Close control frame, it is said\n  // that _The WebSocket Closing Handshake is Started_ and that the\n  // WebSocket connection is in the CLOSING state.\n  return ws[kReadyState] === states.CLOSING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosed (ws) {\n  return ws[kReadyState] === states.CLOSED\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e\n * @param {EventTarget} target\n * @param {(...args: ConstructorParameters) => Event} eventFactory\n * @param {EventInit | undefined} eventInitDict\n */\nfunction fireEvent (e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {\n  // 1. If eventConstructor is not given, then let eventConstructor be Event.\n\n  // 2. Let event be the result of creating an event given eventConstructor,\n  //    in the relevant realm of target.\n  // 3. Initialize event’s type attribute to e.\n  const event = eventFactory(e, eventInitDict)\n\n  // 4. Initialize any other IDL attributes of event as described in the\n  //    invocation of this algorithm.\n\n  // 5. Return the result of dispatching event at target, with legacy target\n  //    override flag set if set.\n  target.dispatchEvent(event)\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @param {import('./websocket').WebSocket} ws\n * @param {number} type Opcode\n * @param {Buffer} data application data\n */\nfunction websocketMessageReceived (ws, type, data) {\n  // 1. If ready state is not OPEN (1), then return.\n  if (ws[kReadyState] !== states.OPEN) {\n    return\n  }\n\n  // 2. Let dataForEvent be determined by switching on type and binary type:\n  let dataForEvent\n\n  if (type === opcodes.TEXT) {\n    // -> type indicates that the data is Text\n    //      a new DOMString containing data\n    try {\n      dataForEvent = utf8Decode(data)\n    } catch {\n      failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')\n      return\n    }\n  } else if (type === opcodes.BINARY) {\n    if (ws[kBinaryType] === 'blob') {\n      // -> type indicates that the data is Binary and binary type is \"blob\"\n      //      a new Blob object, created in the relevant Realm of the WebSocket\n      //      object, that represents data as its raw data\n      dataForEvent = new Blob([data])\n    } else {\n      // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n      //      a new ArrayBuffer object, created in the relevant Realm of the\n      //      WebSocket object, whose contents are data\n      dataForEvent = toArrayBuffer(data)\n    }\n  }\n\n  // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n  //    with the origin attribute initialized to the serialization of the WebSocket\n  //    object’s url's origin, and the data attribute initialized to dataForEvent.\n  fireEvent('message', ws, createFastMessageEvent, {\n    origin: ws[kWebSocketURL].origin,\n    data: dataForEvent\n  })\n}\n\nfunction toArrayBuffer (buffer) {\n  if (buffer.byteLength === buffer.buffer.byteLength) {\n    return buffer.buffer\n  }\n  return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455\n * @see https://datatracker.ietf.org/doc/html/rfc2616\n * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407\n * @param {string} protocol\n */\nfunction isValidSubprotocol (protocol) {\n  // If present, this value indicates one\n  // or more comma-separated subprotocol the client wishes to speak,\n  // ordered by preference.  The elements that comprise this value\n  // MUST be non-empty strings with characters in the range U+0021 to\n  // U+007E not including separator characters as defined in\n  // [RFC2616] and MUST all be unique strings.\n  if (protocol.length === 0) {\n    return false\n  }\n\n  for (let i = 0; i < protocol.length; ++i) {\n    const code = protocol.charCodeAt(i)\n\n    if (\n      code < 0x21 || // CTL, contains SP (0x20) and HT (0x09)\n      code > 0x7E ||\n      code === 0x22 || // \"\n      code === 0x28 || // (\n      code === 0x29 || // )\n      code === 0x2C || // ,\n      code === 0x2F || // /\n      code === 0x3A || // :\n      code === 0x3B || // ;\n      code === 0x3C || // <\n      code === 0x3D || // =\n      code === 0x3E || // >\n      code === 0x3F || // ?\n      code === 0x40 || // @\n      code === 0x5B || // [\n      code === 0x5C || // \\\n      code === 0x5D || // ]\n      code === 0x7B || // {\n      code === 0x7D // }\n    ) {\n      return false\n    }\n  }\n\n  return true\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4\n * @param {number} code\n */\nfunction isValidStatusCode (code) {\n  if (code >= 1000 && code < 1015) {\n    return (\n      code !== 1004 && // reserved\n      code !== 1005 && // \"MUST NOT be set as a status code\"\n      code !== 1006 // \"MUST NOT be set as a status code\"\n    )\n  }\n\n  return code >= 3000 && code <= 4999\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @param {string|undefined} reason\n */\nfunction failWebsocketConnection (ws, reason) {\n  const { [kController]: controller, [kResponse]: response } = ws\n\n  controller.abort()\n\n  if (response?.socket && !response.socket.destroyed) {\n    response.socket.destroy()\n  }\n\n  if (reason) {\n    // TODO: process.nextTick\n    fireEvent('error', ws, (type, init) => new ErrorEvent(type, init), {\n      error: new Error(reason),\n      message: reason\n    })\n  }\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5\n * @param {number} opcode\n */\nfunction isControlFrame (opcode) {\n  return (\n    opcode === opcodes.CLOSE ||\n    opcode === opcodes.PING ||\n    opcode === opcodes.PONG\n  )\n}\n\nfunction isContinuationFrame (opcode) {\n  return opcode === opcodes.CONTINUATION\n}\n\nfunction isTextBinaryFrame (opcode) {\n  return opcode === opcodes.TEXT || opcode === opcodes.BINARY\n}\n\nfunction isValidOpcode (opcode) {\n  return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode)\n}\n\n/**\n * Parses a Sec-WebSocket-Extensions header value.\n * @param {string} extensions\n * @returns {Map}\n */\n// TODO(@Uzlopak, @KhafraDev): make compliant https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\nfunction parseExtensions (extensions) {\n  const position = { position: 0 }\n  const extensionList = new Map()\n\n  while (position.position < extensions.length) {\n    const pair = collectASequenceOfCodePointsFast(';', extensions, position)\n    const [name, value = ''] = pair.split('=')\n\n    extensionList.set(\n      removeHTTPWhitespace(name, true, false),\n      removeHTTPWhitespace(value, false, true)\n    )\n\n    position.position++\n  }\n\n  return extensionList\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2\n * @description \"client-max-window-bits = 1*DIGIT\"\n * @param {string} value\n */\nfunction isValidClientWindowBits (value) {\n  // Must have at least one character\n  if (value.length === 0) {\n    return false\n  }\n\n  // Check all characters are ASCII digits\n  for (let i = 0; i < value.length; i++) {\n    const byte = value.charCodeAt(i)\n\n    if (byte < 0x30 || byte > 0x39) {\n      return false\n    }\n  }\n\n  // Check numeric range: zlib requires windowBits in range 8-15\n  const num = Number.parseInt(value, 10)\n  return num >= 8 && num <= 15\n}\n\n// https://nodejs.org/api/intl.html#detecting-internationalization-support\nconst hasIntl = typeof process.versions.icu === 'string'\nconst fatalDecoder = hasIntl ? new TextDecoder('utf-8', { fatal: true }) : undefined\n\n/**\n * Converts a Buffer to utf-8, even on platforms without icu.\n * @param {Buffer} buffer\n */\nconst utf8Decode = hasIntl\n  ? fatalDecoder.decode.bind(fatalDecoder)\n  : function (buffer) {\n    if (isUtf8(buffer)) {\n      return buffer.toString('utf-8')\n    }\n    throw new TypeError('Invalid utf-8 received.')\n  }\n\nmodule.exports = {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isClosed,\n  fireEvent,\n  isValidSubprotocol,\n  isValidStatusCode,\n  failWebsocketConnection,\n  websocketMessageReceived,\n  utf8Decode,\n  isControlFrame,\n  isContinuationFrame,\n  isTextBinaryFrame,\n  isValidOpcode,\n  parseExtensions,\n  isValidClientWindowBits\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { environmentSettingsObject } = require('../fetch/util')\nconst { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require('./constants')\nconst {\n  kWebSocketURL,\n  kReadyState,\n  kController,\n  kBinaryType,\n  kResponse,\n  kSentClose,\n  kByteParser\n} = require('./symbols')\nconst {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isValidSubprotocol,\n  fireEvent\n} = require('./util')\nconst { establishWebSocketConnection, closeWebSocketConnection } = require('./connection')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty, isBlobLike } = require('../../core/util')\nconst { getGlobalDispatcher } = require('../../global')\nconst { types } = require('node:util')\nconst { ErrorEvent, CloseEvent } = require('./events')\nconst { SendQueue } = require('./sender')\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    close: null,\n    message: null\n  }\n\n  #bufferedAmount = 0\n  #protocol = ''\n  #extensions = ''\n\n  /** @type {SendQueue} */\n  #sendQueue\n\n  /**\n   * @param {string} url\n   * @param {string|string[]} protocols\n   */\n  constructor (url, protocols = []) {\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'WebSocket constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols, prefix, 'options')\n\n    url = webidl.converters.USVString(url, prefix, 'url')\n    protocols = options.protocols\n\n    // 1. Let baseURL be this's relevant settings object's API base URL.\n    const baseURL = environmentSettingsObject.settingsObject.baseUrl\n\n    // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.\n    let urlRecord\n\n    try {\n      urlRecord = new URL(url, baseURL)\n    } catch (e) {\n      // 3. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n      throw new DOMException(e, 'SyntaxError')\n    }\n\n    // 4. If urlRecord’s scheme is \"http\", then set urlRecord’s scheme to \"ws\".\n    if (urlRecord.protocol === 'http:') {\n      urlRecord.protocol = 'ws:'\n    } else if (urlRecord.protocol === 'https:') {\n      // 5. Otherwise, if urlRecord’s scheme is \"https\", set urlRecord’s scheme to \"wss\".\n      urlRecord.protocol = 'wss:'\n    }\n\n    // 6. If urlRecord’s scheme is not \"ws\" or \"wss\", then throw a \"SyntaxError\" DOMException.\n    if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {\n      throw new DOMException(\n        `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,\n        'SyntaxError'\n      )\n    }\n\n    // 7. If urlRecord’s fragment is non-null, then throw a \"SyntaxError\"\n    //    DOMException.\n    if (urlRecord.hash || urlRecord.href.endsWith('#')) {\n      throw new DOMException('Got fragment', 'SyntaxError')\n    }\n\n    // 8. If protocols is a string, set protocols to a sequence consisting\n    //    of just that string.\n    if (typeof protocols === 'string') {\n      protocols = [protocols]\n    }\n\n    // 9. If any of the values in protocols occur more than once or otherwise\n    //    fail to match the requirements for elements that comprise the value\n    //    of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n    //    protocol, then throw a \"SyntaxError\" DOMException.\n    if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    // 10. Set this's url to urlRecord.\n    this[kWebSocketURL] = new URL(urlRecord.href)\n\n    // 11. Let client be this's relevant settings object.\n    const client = environmentSettingsObject.settingsObject\n\n    // 12. Run this step in parallel:\n\n    //    1. Establish a WebSocket connection given urlRecord, protocols,\n    //       and client.\n    this[kController] = establishWebSocketConnection(\n      urlRecord,\n      protocols,\n      client,\n      this,\n      (response, extensions) => this.#onConnectionEstablished(response, extensions),\n      options\n    )\n\n    // Each WebSocket object has an associated ready state, which is a\n    // number representing the state of the connection. Initially it must\n    // be CONNECTING (0).\n    this[kReadyState] = WebSocket.CONNECTING\n\n    this[kSentClose] = sentCloseFrameState.NOT_SENT\n\n    // The extensions attribute must initially return the empty string.\n\n    // The protocol attribute must initially return the empty string.\n\n    // Each WebSocket object has an associated binary type, which is a\n    // BinaryType. Initially it must be \"blob\".\n    this[kBinaryType] = 'blob'\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n   * @param {number|undefined} code\n   * @param {string|undefined} reason\n   */\n  close (code = undefined, reason = undefined) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.close'\n\n    if (code !== undefined) {\n      code = webidl.converters['unsigned short'](code, prefix, 'code', { clamp: true })\n    }\n\n    if (reason !== undefined) {\n      reason = webidl.converters.USVString(reason, prefix, 'reason')\n    }\n\n    // 1. If code is present, but is neither an integer equal to 1000 nor an\n    //    integer in the range 3000 to 4999, inclusive, throw an\n    //    \"InvalidAccessError\" DOMException.\n    if (code !== undefined) {\n      if (code !== 1000 && (code < 3000 || code > 4999)) {\n        throw new DOMException('invalid code', 'InvalidAccessError')\n      }\n    }\n\n    let reasonByteLength = 0\n\n    // 2. If reason is present, then run these substeps:\n    if (reason !== undefined) {\n      // 1. Let reasonBytes be the result of encoding reason.\n      // 2. If reasonBytes is longer than 123 bytes, then throw a\n      //    \"SyntaxError\" DOMException.\n      reasonByteLength = Buffer.byteLength(reason)\n\n      if (reasonByteLength > 123) {\n        throw new DOMException(\n          `Reason must be less than 123 bytes; received ${reasonByteLength}`,\n          'SyntaxError'\n        )\n      }\n    }\n\n    // 3. Run the first matching steps from the following list:\n    closeWebSocketConnection(this, code, reason, reasonByteLength)\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n   * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n   */\n  send (data) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.send'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    data = webidl.converters.WebSocketSendData(data, prefix, 'data')\n\n    // 1. If this's ready state is CONNECTING, then throw an\n    //    \"InvalidStateError\" DOMException.\n    if (isConnecting(this)) {\n      throw new DOMException('Sent before connected.', 'InvalidStateError')\n    }\n\n    // 2. Run the appropriate set of steps from the following list:\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n    if (!isEstablished(this) || isClosing(this)) {\n      return\n    }\n\n    // If data is a string\n    if (typeof data === 'string') {\n      // If the WebSocket connection is established and the WebSocket\n      // closing handshake has not yet started, then the user agent\n      // must send a WebSocket Message comprised of the data argument\n      // using a text frame opcode; if the data cannot be sent, e.g.\n      // because it would need to be buffered but the buffer is full,\n      // the user agent must flag the WebSocket as full and then close\n      // the WebSocket connection. Any invocation of this method with a\n      // string argument that does not throw an exception must increase\n      // the bufferedAmount attribute by the number of bytes needed to\n      // express the argument as UTF-8.\n\n      const length = Buffer.byteLength(data)\n\n      this.#bufferedAmount += length\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= length\n      }, sendHints.string)\n    } else if (types.isArrayBuffer(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need\n      // to be buffered but the buffer is full, the user agent must flag\n      // the WebSocket as full and then close the WebSocket connection.\n      // The data to be sent is the data stored in the buffer described\n      // by the ArrayBuffer object. Any invocation of this method with an\n      // ArrayBuffer argument that does not throw an exception must\n      // increase the bufferedAmount attribute by the length of the\n      // ArrayBuffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.arrayBuffer)\n    } else if (ArrayBuffer.isView(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The\n      // data to be sent is the data stored in the section of the buffer\n      // described by the ArrayBuffer object that data references. Any\n      // invocation of this method with this kind of argument that does\n      // not throw an exception must increase the bufferedAmount attribute\n      // by the length of data’s buffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.typedArray)\n    } else if (isBlobLike(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The data\n      // to be sent is the raw data represented by the Blob object. Any\n      // invocation of this method with a Blob argument that does not throw\n      // an exception must increase the bufferedAmount attribute by the size\n      // of the Blob object’s raw data, in bytes.\n\n      this.#bufferedAmount += data.size\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.size\n      }, sendHints.blob)\n    }\n  }\n\n  get readyState () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The readyState getter steps are to return this's ready state.\n    return this[kReadyState]\n  }\n\n  get bufferedAmount () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#bufferedAmount\n  }\n\n  get url () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The url getter steps are to return this's url, serialized.\n    return URLSerializer(this[kWebSocketURL])\n  }\n\n  get extensions () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#extensions\n  }\n\n  get protocol () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#protocol\n  }\n\n  get onopen () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.open = fn\n      this.addEventListener('open', fn)\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this.#events.error = null\n    }\n  }\n\n  get onclose () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.close\n  }\n\n  set onclose (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.close) {\n      this.removeEventListener('close', this.#events.close)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.close = fn\n      this.addEventListener('close', fn)\n    } else {\n      this.#events.close = null\n    }\n  }\n\n  get onmessage () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.message = fn\n      this.addEventListener('message', fn)\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get binaryType () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this[kBinaryType]\n  }\n\n  set binaryType (type) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (type !== 'blob' && type !== 'arraybuffer') {\n      this[kBinaryType] = 'blob'\n    } else {\n      this[kBinaryType] = type\n    }\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n   */\n  #onConnectionEstablished (response, parsedExtensions) {\n    // processResponse is called when the \"response's header list has been received and initialized.\"\n    // once this happens, the connection is open\n    this[kResponse] = response\n\n    const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions\n    const maxFragments = webSocketOptions?.maxFragments\n    const maxPayloadSize = webSocketOptions?.maxPayloadSize\n\n    const parser = new ByteParser(this, parsedExtensions, {\n      maxFragments,\n      maxPayloadSize\n    })\n    parser.on('drain', onParserDrain)\n    parser.on('error', onParserError.bind(this))\n\n    response.socket.ws = this\n    this[kByteParser] = parser\n\n    this.#sendQueue = new SendQueue(response.socket)\n\n    // 1. Change the ready state to OPEN (1).\n    this[kReadyState] = states.OPEN\n\n    // 2. Change the extensions attribute’s value to the extensions in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n    const extensions = response.headersList.get('sec-websocket-extensions')\n\n    if (extensions !== null) {\n      this.#extensions = extensions\n    }\n\n    // 3. Change the protocol attribute’s value to the subprotocol in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n    const protocol = response.headersList.get('sec-websocket-protocol')\n\n    if (protocol !== null) {\n      this.#protocol = protocol\n    }\n\n    // 4. Fire an event named open at the WebSocket object.\n    fireEvent('open', this)\n  }\n}\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors,\n  url: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  bufferedAmount: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onclose: kEnumerableProperty,\n  close: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  binaryType: kEnumerableProperty,\n  send: kEnumerableProperty,\n  extensions: kEnumerableProperty,\n  protocol: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'WebSocket',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(WebSocket, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence'] = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {\n    return webidl.converters['sequence'](V)\n  }\n\n  return webidl.converters.DOMString(V, prefix, argument)\n}\n\n// This implements the proposal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n  {\n    key: 'protocols',\n    converter: webidl.converters['DOMString or sequence'],\n    defaultValue: () => new Array(0)\n  },\n  {\n    key: 'dispatcher',\n    converter: webidl.converters.any,\n    defaultValue: () => getGlobalDispatcher()\n  },\n  {\n    key: 'headers',\n    converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n  }\n])\n\nwebidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {\n  if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {\n    return webidl.converters.WebSocketInit(V)\n  }\n\n  return { protocols: webidl.converters['DOMString or sequence'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n  if (webidl.util.Type(V) === 'Object') {\n    if (isBlobLike(V)) {\n      return webidl.converters.Blob(V, { strict: false })\n    }\n\n    if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n      return webidl.converters.BufferSource(V)\n    }\n  }\n\n  return webidl.converters.USVString(V)\n}\n\nfunction onParserDrain () {\n  this.ws[kResponse].socket.resume()\n}\n\nfunction onParserError (err) {\n  let message\n  let code\n\n  if (err instanceof CloseEvent) {\n    message = err.reason\n    code = err.code\n  } else {\n    message = err.message\n  }\n\n  fireEvent('error', this, () => new ErrorEvent('error', { error: err, message }))\n\n  closeWebSocketConnection(this, code)\n}\n\nmodule.exports = {\n  WebSocket\n}\n","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"https\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:async_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:buffer\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:console\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:crypto\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:diagnostics_channel\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:dns\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs/promises\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http2\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:path\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:perf_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:querystring\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:url\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util/types\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:worker_threads\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:zlib\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"string_decoder\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\\/\\/\\/\\w:/) ? 1 : 0, -1) + \"/\";","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"os\");","// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nexport function toCommandValue(input) {\n    if (input === null || input === undefined) {\n        return '';\n    }\n    else if (typeof input === 'string' || input instanceof String) {\n        return input;\n    }\n    return JSON.stringify(input);\n}\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nexport function toCommandProperties(annotationProperties) {\n    if (!Object.keys(annotationProperties).length) {\n        return {};\n    }\n    return {\n        title: annotationProperties.title,\n        file: annotationProperties.file,\n        line: annotationProperties.startLine,\n        endLine: annotationProperties.endLine,\n        col: annotationProperties.startColumn,\n        endColumn: annotationProperties.endColumn\n    };\n}\n//# sourceMappingURL=utils.js.map","import * as os from 'os';\nimport { toCommandValue } from './utils.js';\n/**\n * Issues a command to the GitHub Actions runner\n *\n * @param command - The command name to issue\n * @param properties - Additional properties for the command (key-value pairs)\n * @param message - The message to include with the command\n * @remarks\n * This function outputs a specially formatted string to stdout that the Actions\n * runner interprets as a command. These commands can control workflow behavior,\n * set outputs, create annotations, mask values, and more.\n *\n * Command Format:\n *   ::name key=value,key=value::message\n *\n * @example\n * ```typescript\n * // Issue a warning annotation\n * issueCommand('warning', {}, 'This is a warning message');\n * // Output: ::warning::This is a warning message\n *\n * // Set an environment variable\n * issueCommand('set-env', { name: 'MY_VAR' }, 'some value');\n * // Output: ::set-env name=MY_VAR::some value\n *\n * // Add a secret mask\n * issueCommand('add-mask', {}, 'secretValue123');\n * // Output: ::add-mask::secretValue123\n * ```\n *\n * @internal\n * This is an internal utility function that powers the public API functions\n * such as setSecret, warning, error, and exportVariable.\n */\nexport function issueCommand(command, properties, message) {\n    const cmd = new Command(command, properties, message);\n    process.stdout.write(cmd.toString() + os.EOL);\n}\nexport function issue(name, message = '') {\n    issueCommand(name, {}, message);\n}\nconst CMD_STRING = '::';\nclass Command {\n    constructor(command, properties, message) {\n        if (!command) {\n            command = 'missing.command';\n        }\n        this.command = command;\n        this.properties = properties;\n        this.message = message;\n    }\n    toString() {\n        let cmdStr = CMD_STRING + this.command;\n        if (this.properties && Object.keys(this.properties).length > 0) {\n            cmdStr += ' ';\n            let first = true;\n            for (const key in this.properties) {\n                if (this.properties.hasOwnProperty(key)) {\n                    const val = this.properties[key];\n                    if (val) {\n                        if (first) {\n                            first = false;\n                        }\n                        else {\n                            cmdStr += ',';\n                        }\n                        cmdStr += `${key}=${escapeProperty(val)}`;\n                    }\n                }\n            }\n        }\n        cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n        return cmdStr;\n    }\n}\nfunction escapeData(s) {\n    return toCommandValue(s)\n        .replace(/%/g, '%25')\n        .replace(/\\r/g, '%0D')\n        .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n    return toCommandValue(s)\n        .replace(/%/g, '%25')\n        .replace(/\\r/g, '%0D')\n        .replace(/\\n/g, '%0A')\n        .replace(/:/g, '%3A')\n        .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"crypto\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"fs\");","// For internal use, subject to change.\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as crypto from 'crypto';\nimport * as fs from 'fs';\nimport * as os from 'os';\nimport { toCommandValue } from './utils.js';\nexport function issueFileCommand(command, message) {\n    const filePath = process.env[`GITHUB_${command}`];\n    if (!filePath) {\n        throw new Error(`Unable to find environment variable for file command ${command}`);\n    }\n    if (!fs.existsSync(filePath)) {\n        throw new Error(`Missing file at path: ${filePath}`);\n    }\n    fs.appendFileSync(filePath, `${toCommandValue(message)}${os.EOL}`, {\n        encoding: 'utf8'\n    });\n}\nexport function prepareKeyValueMessage(key, value) {\n    const delimiter = `ghadelimiter_${crypto.randomUUID()}`;\n    const convertedValue = toCommandValue(value);\n    // These should realistically never happen, but just in case someone finds a\n    // way to exploit uuid generation let's not allow keys or values that contain\n    // the delimiter.\n    if (key.includes(delimiter)) {\n        throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n    }\n    if (convertedValue.includes(delimiter)) {\n        throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n    }\n    return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\n//# sourceMappingURL=file-command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"path\");","export function getProxyUrl(reqUrl) {\n    const usingSsl = reqUrl.protocol === 'https:';\n    if (checkBypass(reqUrl)) {\n        return undefined;\n    }\n    const proxyVar = (() => {\n        if (usingSsl) {\n            return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n        }\n        else {\n            return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n        }\n    })();\n    if (proxyVar) {\n        try {\n            return new DecodedURL(proxyVar);\n        }\n        catch (_a) {\n            if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))\n                return new DecodedURL(`http://${proxyVar}`);\n        }\n    }\n    else {\n        return undefined;\n    }\n}\nexport function checkBypass(reqUrl) {\n    if (!reqUrl.hostname) {\n        return false;\n    }\n    const reqHost = reqUrl.hostname;\n    if (isLoopbackAddress(reqHost)) {\n        return true;\n    }\n    const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n    if (!noProxy) {\n        return false;\n    }\n    // Determine the request port\n    let reqPort;\n    if (reqUrl.port) {\n        reqPort = Number(reqUrl.port);\n    }\n    else if (reqUrl.protocol === 'http:') {\n        reqPort = 80;\n    }\n    else if (reqUrl.protocol === 'https:') {\n        reqPort = 443;\n    }\n    // Format the request hostname and hostname with port\n    const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n    if (typeof reqPort === 'number') {\n        upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n    }\n    // Compare request host against noproxy\n    for (const upperNoProxyItem of noProxy\n        .split(',')\n        .map(x => x.trim().toUpperCase())\n        .filter(x => x)) {\n        if (upperNoProxyItem === '*' ||\n            upperReqHosts.some(x => x === upperNoProxyItem ||\n                x.endsWith(`.${upperNoProxyItem}`) ||\n                (upperNoProxyItem.startsWith('.') &&\n                    x.endsWith(`${upperNoProxyItem}`)))) {\n            return true;\n        }\n    }\n    return false;\n}\nfunction isLoopbackAddress(host) {\n    const hostLower = host.toLowerCase();\n    return (hostLower === 'localhost' ||\n        hostLower.startsWith('127.') ||\n        hostLower.startsWith('[::1]') ||\n        hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\nclass DecodedURL extends URL {\n    constructor(url, base) {\n        super(url, base);\n        this._decodedUsername = decodeURIComponent(super.username);\n        this._decodedPassword = decodeURIComponent(super.password);\n    }\n    get username() {\n        return this._decodedUsername;\n    }\n    get password() {\n        return this._decodedPassword;\n    }\n}\n//# sourceMappingURL=proxy.js.map","/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as pm from './proxy.js';\nimport * as tunnel from 'tunnel';\nimport { ProxyAgent } from 'undici';\nexport var HttpCodes;\n(function (HttpCodes) {\n    HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n    HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n    HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n    HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n    HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n    HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n    HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n    HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n    HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n    HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n    HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n    HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n    HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n    HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n    HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n    HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n    HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n    HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n    HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n    HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n    HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n    HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n    HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n    HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n    HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n    HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n    HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes || (HttpCodes = {}));\nexport var Headers;\n(function (Headers) {\n    Headers[\"Accept\"] = \"accept\";\n    Headers[\"ContentType\"] = \"content-type\";\n})(Headers || (Headers = {}));\nexport var MediaTypes;\n(function (MediaTypes) {\n    MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes || (MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl  The server URL where the request will be sent. For example, https://api.github.com\n */\nexport function getProxyUrl(serverUrl) {\n    const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n    return proxyUrl ? proxyUrl.href : '';\n}\nconst HttpRedirectCodes = [\n    HttpCodes.MovedPermanently,\n    HttpCodes.ResourceMoved,\n    HttpCodes.SeeOther,\n    HttpCodes.TemporaryRedirect,\n    HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n    HttpCodes.BadGateway,\n    HttpCodes.ServiceUnavailable,\n    HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nexport class HttpClientError extends Error {\n    constructor(message, statusCode) {\n        super(message);\n        this.name = 'HttpClientError';\n        this.statusCode = statusCode;\n        Object.setPrototypeOf(this, HttpClientError.prototype);\n    }\n}\nexport class HttpClientResponse {\n    constructor(message) {\n        this.message = message;\n    }\n    readBody() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n                let output = Buffer.alloc(0);\n                this.message.on('data', (chunk) => {\n                    output = Buffer.concat([output, chunk]);\n                });\n                this.message.on('end', () => {\n                    resolve(output.toString());\n                });\n            }));\n        });\n    }\n    readBodyBuffer() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n                const chunks = [];\n                this.message.on('data', (chunk) => {\n                    chunks.push(chunk);\n                });\n                this.message.on('end', () => {\n                    resolve(Buffer.concat(chunks));\n                });\n            }));\n        });\n    }\n}\nexport function isHttps(requestUrl) {\n    const parsedUrl = new URL(requestUrl);\n    return parsedUrl.protocol === 'https:';\n}\nexport class HttpClient {\n    constructor(userAgent, handlers, requestOptions) {\n        this._ignoreSslError = false;\n        this._allowRedirects = true;\n        this._allowRedirectDowngrade = false;\n        this._maxRedirects = 50;\n        this._allowRetries = false;\n        this._maxRetries = 1;\n        this._keepAlive = false;\n        this._disposed = false;\n        this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);\n        this.handlers = handlers || [];\n        this.requestOptions = requestOptions;\n        if (requestOptions) {\n            if (requestOptions.ignoreSslError != null) {\n                this._ignoreSslError = requestOptions.ignoreSslError;\n            }\n            this._socketTimeout = requestOptions.socketTimeout;\n            if (requestOptions.allowRedirects != null) {\n                this._allowRedirects = requestOptions.allowRedirects;\n            }\n            if (requestOptions.allowRedirectDowngrade != null) {\n                this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n            }\n            if (requestOptions.maxRedirects != null) {\n                this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n            }\n            if (requestOptions.keepAlive != null) {\n                this._keepAlive = requestOptions.keepAlive;\n            }\n            if (requestOptions.allowRetries != null) {\n                this._allowRetries = requestOptions.allowRetries;\n            }\n            if (requestOptions.maxRetries != null) {\n                this._maxRetries = requestOptions.maxRetries;\n            }\n        }\n    }\n    options(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    get(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('GET', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    del(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    post(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('POST', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    patch(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    put(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('PUT', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    head(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    sendStream(verb, requestUrl, stream, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request(verb, requestUrl, stream, additionalHeaders);\n        });\n    }\n    /**\n     * Gets a typed object from an endpoint\n     * Be aware that not found returns a null.  Other errors (4xx, 5xx) reject the promise\n     */\n    getJson(requestUrl_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            const res = yield this.get(requestUrl, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    postJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.post(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    putJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.put(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    patchJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.patch(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    /**\n     * Makes a raw http request.\n     * All other methods such as get, post, patch, and request ultimately call this.\n     * Prefer get, del, post and patch\n     */\n    request(verb, requestUrl, data, headers) {\n        return __awaiter(this, void 0, void 0, function* () {\n            if (this._disposed) {\n                throw new Error('Client has already been disposed.');\n            }\n            const parsedUrl = new URL(requestUrl);\n            let info = this._prepareRequest(verb, parsedUrl, headers);\n            // Only perform retries on reads since writes may not be idempotent.\n            const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n                ? this._maxRetries + 1\n                : 1;\n            let numTries = 0;\n            let response;\n            do {\n                response = yield this.requestRaw(info, data);\n                // Check if it's an authentication challenge\n                if (response &&\n                    response.message &&\n                    response.message.statusCode === HttpCodes.Unauthorized) {\n                    let authenticationHandler;\n                    for (const handler of this.handlers) {\n                        if (handler.canHandleAuthentication(response)) {\n                            authenticationHandler = handler;\n                            break;\n                        }\n                    }\n                    if (authenticationHandler) {\n                        return authenticationHandler.handleAuthentication(this, info, data);\n                    }\n                    else {\n                        // We have received an unauthorized response but have no handlers to handle it.\n                        // Let the response return to the caller.\n                        return response;\n                    }\n                }\n                let redirectsRemaining = this._maxRedirects;\n                while (response.message.statusCode &&\n                    HttpRedirectCodes.includes(response.message.statusCode) &&\n                    this._allowRedirects &&\n                    redirectsRemaining > 0) {\n                    const redirectUrl = response.message.headers['location'];\n                    if (!redirectUrl) {\n                        // if there's no location to redirect to, we won't\n                        break;\n                    }\n                    const parsedRedirectUrl = new URL(redirectUrl);\n                    if (parsedUrl.protocol === 'https:' &&\n                        parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n                        !this._allowRedirectDowngrade) {\n                        throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n                    }\n                    // we need to finish reading the response before reassigning response\n                    // which will leak the open socket.\n                    yield response.readBody();\n                    // strip authorization header if redirected to a different hostname\n                    if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n                        for (const header in headers) {\n                            // header names are case insensitive\n                            if (header.toLowerCase() === 'authorization') {\n                                delete headers[header];\n                            }\n                        }\n                    }\n                    // let's make the request with the new redirectUrl\n                    info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n                    response = yield this.requestRaw(info, data);\n                    redirectsRemaining--;\n                }\n                if (!response.message.statusCode ||\n                    !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n                    // If not a retry code, return immediately instead of retrying\n                    return response;\n                }\n                numTries += 1;\n                if (numTries < maxTries) {\n                    yield response.readBody();\n                    yield this._performExponentialBackoff(numTries);\n                }\n            } while (numTries < maxTries);\n            return response;\n        });\n    }\n    /**\n     * Needs to be called if keepAlive is set to true in request options.\n     */\n    dispose() {\n        if (this._agent) {\n            this._agent.destroy();\n        }\n        this._disposed = true;\n    }\n    /**\n     * Raw request.\n     * @param info\n     * @param data\n     */\n    requestRaw(info, data) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve, reject) => {\n                function callbackForResult(err, res) {\n                    if (err) {\n                        reject(err);\n                    }\n                    else if (!res) {\n                        // If `err` is not passed, then `res` must be passed.\n                        reject(new Error('Unknown error'));\n                    }\n                    else {\n                        resolve(res);\n                    }\n                }\n                this.requestRawWithCallback(info, data, callbackForResult);\n            });\n        });\n    }\n    /**\n     * Raw request with callback.\n     * @param info\n     * @param data\n     * @param onResult\n     */\n    requestRawWithCallback(info, data, onResult) {\n        if (typeof data === 'string') {\n            if (!info.options.headers) {\n                info.options.headers = {};\n            }\n            info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n        }\n        let callbackCalled = false;\n        function handleResult(err, res) {\n            if (!callbackCalled) {\n                callbackCalled = true;\n                onResult(err, res);\n            }\n        }\n        const req = info.httpModule.request(info.options, (msg) => {\n            const res = new HttpClientResponse(msg);\n            handleResult(undefined, res);\n        });\n        let socket;\n        req.on('socket', sock => {\n            socket = sock;\n        });\n        // If we ever get disconnected, we want the socket to timeout eventually\n        req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n            if (socket) {\n                socket.end();\n            }\n            handleResult(new Error(`Request timeout: ${info.options.path}`));\n        });\n        req.on('error', function (err) {\n            // err has statusCode property\n            // res should have headers\n            handleResult(err);\n        });\n        if (data && typeof data === 'string') {\n            req.write(data, 'utf8');\n        }\n        if (data && typeof data !== 'string') {\n            data.on('close', function () {\n                req.end();\n            });\n            data.pipe(req);\n        }\n        else {\n            req.end();\n        }\n    }\n    /**\n     * Gets an http agent. This function is useful when you need an http agent that handles\n     * routing through a proxy server - depending upon the url and proxy environment variables.\n     * @param serverUrl  The server URL where the request will be sent. For example, https://api.github.com\n     */\n    getAgent(serverUrl) {\n        const parsedUrl = new URL(serverUrl);\n        return this._getAgent(parsedUrl);\n    }\n    getAgentDispatcher(serverUrl) {\n        const parsedUrl = new URL(serverUrl);\n        const proxyUrl = pm.getProxyUrl(parsedUrl);\n        const useProxy = proxyUrl && proxyUrl.hostname;\n        if (!useProxy) {\n            return;\n        }\n        return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);\n    }\n    _prepareRequest(method, requestUrl, headers) {\n        const info = {};\n        info.parsedUrl = requestUrl;\n        const usingSsl = info.parsedUrl.protocol === 'https:';\n        info.httpModule = usingSsl ? https : http;\n        const defaultPort = usingSsl ? 443 : 80;\n        info.options = {};\n        info.options.host = info.parsedUrl.hostname;\n        info.options.port = info.parsedUrl.port\n            ? parseInt(info.parsedUrl.port)\n            : defaultPort;\n        info.options.path =\n            (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n        info.options.method = method;\n        info.options.headers = this._mergeHeaders(headers);\n        if (this.userAgent != null) {\n            info.options.headers['user-agent'] = this.userAgent;\n        }\n        info.options.agent = this._getAgent(info.parsedUrl);\n        // gives handlers an opportunity to participate\n        if (this.handlers) {\n            for (const handler of this.handlers) {\n                handler.prepareRequest(info.options);\n            }\n        }\n        return info;\n    }\n    _mergeHeaders(headers) {\n        if (this.requestOptions && this.requestOptions.headers) {\n            return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n        }\n        return lowercaseKeys(headers || {});\n    }\n    /**\n     * Gets an existing header value or returns a default.\n     * Handles converting number header values to strings since HTTP headers must be strings.\n     * Note: This returns string | string[] since some headers can have multiple values.\n     * For headers that must always be a single string (like Content-Type), use the\n     * specialized _getExistingOrDefaultContentTypeHeader method instead.\n     */\n    _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n        let clientHeader;\n        if (this.requestOptions && this.requestOptions.headers) {\n            const headerValue = lowercaseKeys(this.requestOptions.headers)[header];\n            if (headerValue) {\n                clientHeader =\n                    typeof headerValue === 'number' ? headerValue.toString() : headerValue;\n            }\n        }\n        const additionalValue = additionalHeaders[header];\n        if (additionalValue !== undefined) {\n            return typeof additionalValue === 'number'\n                ? additionalValue.toString()\n                : additionalValue;\n        }\n        if (clientHeader !== undefined) {\n            return clientHeader;\n        }\n        return _default;\n    }\n    /**\n     * Specialized version of _getExistingOrDefaultHeader for Content-Type header.\n     * Always returns a single string (not an array) since Content-Type should be a single value.\n     * Converts arrays to comma-separated strings and numbers to strings to ensure type safety.\n     * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers\n     * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).\n     */\n    _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {\n        let clientHeader;\n        if (this.requestOptions && this.requestOptions.headers) {\n            const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];\n            if (headerValue) {\n                if (typeof headerValue === 'number') {\n                    clientHeader = String(headerValue);\n                }\n                else if (Array.isArray(headerValue)) {\n                    clientHeader = headerValue.join(', ');\n                }\n                else {\n                    clientHeader = headerValue;\n                }\n            }\n        }\n        const additionalValue = additionalHeaders[Headers.ContentType];\n        // Return the first non-undefined value, converting numbers or arrays to strings if necessary\n        if (additionalValue !== undefined) {\n            if (typeof additionalValue === 'number') {\n                return String(additionalValue);\n            }\n            else if (Array.isArray(additionalValue)) {\n                return additionalValue.join(', ');\n            }\n            else {\n                return additionalValue;\n            }\n        }\n        if (clientHeader !== undefined) {\n            return clientHeader;\n        }\n        return _default;\n    }\n    _getAgent(parsedUrl) {\n        let agent;\n        const proxyUrl = pm.getProxyUrl(parsedUrl);\n        const useProxy = proxyUrl && proxyUrl.hostname;\n        if (this._keepAlive && useProxy) {\n            agent = this._proxyAgent;\n        }\n        if (!useProxy) {\n            agent = this._agent;\n        }\n        // if agent is already assigned use that agent.\n        if (agent) {\n            return agent;\n        }\n        const usingSsl = parsedUrl.protocol === 'https:';\n        let maxSockets = 100;\n        if (this.requestOptions) {\n            maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n        }\n        // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n        if (proxyUrl && proxyUrl.hostname) {\n            const agentOptions = {\n                maxSockets,\n                keepAlive: this._keepAlive,\n                proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n                    proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n                })), { host: proxyUrl.hostname, port: proxyUrl.port })\n            };\n            let tunnelAgent;\n            const overHttps = proxyUrl.protocol === 'https:';\n            if (usingSsl) {\n                tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n            }\n            else {\n                tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n            }\n            agent = tunnelAgent(agentOptions);\n            this._proxyAgent = agent;\n        }\n        // if tunneling agent isn't assigned create a new agent\n        if (!agent) {\n            const options = { keepAlive: this._keepAlive, maxSockets };\n            agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n            this._agent = agent;\n        }\n        if (usingSsl && this._ignoreSslError) {\n            // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n            // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n            // we have to cast it to any and change it directly\n            agent.options = Object.assign(agent.options || {}, {\n                rejectUnauthorized: false\n            });\n        }\n        return agent;\n    }\n    _getProxyAgentDispatcher(parsedUrl, proxyUrl) {\n        let proxyAgent;\n        if (this._keepAlive) {\n            proxyAgent = this._proxyAgentDispatcher;\n        }\n        // if agent is already assigned use that agent.\n        if (proxyAgent) {\n            return proxyAgent;\n        }\n        const usingSsl = parsedUrl.protocol === 'https:';\n        proxyAgent = new ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {\n            token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`\n        })));\n        this._proxyAgentDispatcher = proxyAgent;\n        if (usingSsl && this._ignoreSslError) {\n            // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n            // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n            // we have to cast it to any and change it directly\n            proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {\n                rejectUnauthorized: false\n            });\n        }\n        return proxyAgent;\n    }\n    _getUserAgentWithOrchestrationId(userAgent) {\n        const baseUserAgent = userAgent || 'actions/http-client';\n        const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];\n        if (orchId) {\n            // Sanitize the orchestration ID to ensure it contains only valid characters\n            // Valid characters: 0-9, a-z, _, -, .\n            const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');\n            return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;\n        }\n        return baseUserAgent;\n    }\n    _performExponentialBackoff(retryNumber) {\n        return __awaiter(this, void 0, void 0, function* () {\n            retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n            const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n            return new Promise(resolve => setTimeout(() => resolve(), ms));\n        });\n    }\n    _processResponse(res, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n                const statusCode = res.message.statusCode || 0;\n                const response = {\n                    statusCode,\n                    result: null,\n                    headers: {}\n                };\n                // not found leads to null obj returned\n                if (statusCode === HttpCodes.NotFound) {\n                    resolve(response);\n                }\n                // get the result from the body\n                function dateTimeDeserializer(key, value) {\n                    if (typeof value === 'string') {\n                        const a = new Date(value);\n                        if (!isNaN(a.valueOf())) {\n                            return a;\n                        }\n                    }\n                    return value;\n                }\n                let obj;\n                let contents;\n                try {\n                    contents = yield res.readBody();\n                    if (contents && contents.length > 0) {\n                        if (options && options.deserializeDates) {\n                            obj = JSON.parse(contents, dateTimeDeserializer);\n                        }\n                        else {\n                            obj = JSON.parse(contents);\n                        }\n                        response.result = obj;\n                    }\n                    response.headers = res.message.headers;\n                }\n                catch (err) {\n                    // Invalid resource (contents not json);  leaving result obj null\n                }\n                // note that 3xx redirects are handled by the http layer.\n                if (statusCode > 299) {\n                    let msg;\n                    // if exception/error in body, attempt to get better error\n                    if (obj && obj.message) {\n                        msg = obj.message;\n                    }\n                    else if (contents && contents.length > 0) {\n                        // it may be the case that the exception is in the body message as string\n                        msg = contents;\n                    }\n                    else {\n                        msg = `Failed request: (${statusCode})`;\n                    }\n                    const err = new HttpClientError(msg, statusCode);\n                    err.result = response.result;\n                    reject(err);\n                }\n                else {\n                    resolve(response);\n                }\n            }));\n        });\n    }\n}\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nexport class BasicCredentialHandler {\n    constructor(username, password) {\n        this.username = username;\n        this.password = password;\n    }\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\nexport class BearerCredentialHandler {\n    constructor(token) {\n        this.token = token;\n    }\n    // currently implements pre-authorization\n    // TODO: support preAuth = false where it hooks on 401\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Bearer ${this.token}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\nexport class PersonalAccessTokenCredentialHandler {\n    constructor(token) {\n        this.token = token;\n    }\n    // currently implements pre-authorization\n    // TODO: support preAuth = false where it hooks on 401\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\n//# sourceMappingURL=auth.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { HttpClient } from '@actions/http-client';\nimport { BearerCredentialHandler } from '@actions/http-client/lib/auth';\nimport { debug, setSecret } from './core.js';\nexport class OidcClient {\n    static createHttpClient(allowRetry = true, maxRetry = 10) {\n        const requestOptions = {\n            allowRetries: allowRetry,\n            maxRetries: maxRetry\n        };\n        return new HttpClient('actions/oidc-client', [new BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n    }\n    static getRequestToken() {\n        const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n        if (!token) {\n            throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n        }\n        return token;\n    }\n    static getIDTokenUrl() {\n        const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n        if (!runtimeUrl) {\n            throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n        }\n        return runtimeUrl;\n    }\n    static getCall(id_token_url) {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a;\n            const httpclient = OidcClient.createHttpClient();\n            const res = yield httpclient\n                .getJson(id_token_url)\n                .catch(error => {\n                throw new Error(`Failed to get ID Token. \\n \n        Error Code : ${error.statusCode}\\n \n        Error Message: ${error.message}`);\n            });\n            const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n            if (!id_token) {\n                throw new Error('Response json body do not have ID Token field');\n            }\n            return id_token;\n        });\n    }\n    static getIDToken(audience) {\n        return __awaiter(this, void 0, void 0, function* () {\n            try {\n                // New ID Token is requested from action service\n                let id_token_url = OidcClient.getIDTokenUrl();\n                if (audience) {\n                    const encodedAudience = encodeURIComponent(audience);\n                    id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n                }\n                debug(`ID token url is ${id_token_url}`);\n                const id_token = yield OidcClient.getCall(id_token_url);\n                setSecret(id_token);\n                return id_token;\n            }\n            catch (error) {\n                throw new Error(`Error message: ${error.message}`);\n            }\n        });\n    }\n}\n//# sourceMappingURL=oidc-utils.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { EOL } from 'os';\nimport { constants, promises } from 'fs';\nconst { access, appendFile, writeFile } = promises;\nexport const SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexport const SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n    constructor() {\n        this._buffer = '';\n    }\n    /**\n     * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n     * Also checks r/w permissions.\n     *\n     * @returns step summary file path\n     */\n    filePath() {\n        return __awaiter(this, void 0, void 0, function* () {\n            if (this._filePath) {\n                return this._filePath;\n            }\n            const pathFromEnv = process.env[SUMMARY_ENV_VAR];\n            if (!pathFromEnv) {\n                throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n            }\n            try {\n                yield access(pathFromEnv, constants.R_OK | constants.W_OK);\n            }\n            catch (_a) {\n                throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n            }\n            this._filePath = pathFromEnv;\n            return this._filePath;\n        });\n    }\n    /**\n     * Wraps content in an HTML tag, adding any HTML attributes\n     *\n     * @param {string} tag HTML tag to wrap\n     * @param {string | null} content content within the tag\n     * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n     *\n     * @returns {string} content wrapped in HTML element\n     */\n    wrap(tag, content, attrs = {}) {\n        const htmlAttrs = Object.entries(attrs)\n            .map(([key, value]) => ` ${key}=\"${value}\"`)\n            .join('');\n        if (!content) {\n            return `<${tag}${htmlAttrs}>`;\n        }\n        return `<${tag}${htmlAttrs}>${content}`;\n    }\n    /**\n     * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n     *\n     * @param {SummaryWriteOptions} [options] (optional) options for write operation\n     *\n     * @returns {Promise} summary instance\n     */\n    write(options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n            const filePath = yield this.filePath();\n            const writeFunc = overwrite ? writeFile : appendFile;\n            yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n            return this.emptyBuffer();\n        });\n    }\n    /**\n     * Clears the summary buffer and wipes the summary file\n     *\n     * @returns {Summary} summary instance\n     */\n    clear() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.emptyBuffer().write({ overwrite: true });\n        });\n    }\n    /**\n     * Returns the current summary buffer as a string\n     *\n     * @returns {string} string of summary buffer\n     */\n    stringify() {\n        return this._buffer;\n    }\n    /**\n     * If the summary buffer is empty\n     *\n     * @returns {boolen} true if the buffer is empty\n     */\n    isEmptyBuffer() {\n        return this._buffer.length === 0;\n    }\n    /**\n     * Resets the summary buffer without writing to summary file\n     *\n     * @returns {Summary} summary instance\n     */\n    emptyBuffer() {\n        this._buffer = '';\n        return this;\n    }\n    /**\n     * Adds raw text to the summary buffer\n     *\n     * @param {string} text content to add\n     * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n     *\n     * @returns {Summary} summary instance\n     */\n    addRaw(text, addEOL = false) {\n        this._buffer += text;\n        return addEOL ? this.addEOL() : this;\n    }\n    /**\n     * Adds the operating system-specific end-of-line marker to the buffer\n     *\n     * @returns {Summary} summary instance\n     */\n    addEOL() {\n        return this.addRaw(EOL);\n    }\n    /**\n     * Adds an HTML codeblock to the summary buffer\n     *\n     * @param {string} code content to render within fenced code block\n     * @param {string} lang (optional) language to syntax highlight code\n     *\n     * @returns {Summary} summary instance\n     */\n    addCodeBlock(code, lang) {\n        const attrs = Object.assign({}, (lang && { lang }));\n        const element = this.wrap('pre', this.wrap('code', code), attrs);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML list to the summary buffer\n     *\n     * @param {string[]} items list of items to render\n     * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n     *\n     * @returns {Summary} summary instance\n     */\n    addList(items, ordered = false) {\n        const tag = ordered ? 'ol' : 'ul';\n        const listItems = items.map(item => this.wrap('li', item)).join('');\n        const element = this.wrap(tag, listItems);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML table to the summary buffer\n     *\n     * @param {SummaryTableCell[]} rows table rows\n     *\n     * @returns {Summary} summary instance\n     */\n    addTable(rows) {\n        const tableBody = rows\n            .map(row => {\n            const cells = row\n                .map(cell => {\n                if (typeof cell === 'string') {\n                    return this.wrap('td', cell);\n                }\n                const { header, data, colspan, rowspan } = cell;\n                const tag = header ? 'th' : 'td';\n                const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n                return this.wrap(tag, data, attrs);\n            })\n                .join('');\n            return this.wrap('tr', cells);\n        })\n            .join('');\n        const element = this.wrap('table', tableBody);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds a collapsable HTML details element to the summary buffer\n     *\n     * @param {string} label text for the closed state\n     * @param {string} content collapsable content\n     *\n     * @returns {Summary} summary instance\n     */\n    addDetails(label, content) {\n        const element = this.wrap('details', this.wrap('summary', label) + content);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML image tag to the summary buffer\n     *\n     * @param {string} src path to the image you to embed\n     * @param {string} alt text description of the image\n     * @param {SummaryImageOptions} options (optional) addition image attributes\n     *\n     * @returns {Summary} summary instance\n     */\n    addImage(src, alt, options) {\n        const { width, height } = options || {};\n        const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n        const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML section heading element\n     *\n     * @param {string} text heading text\n     * @param {number | string} [level=1] (optional) the heading level, default: 1\n     *\n     * @returns {Summary} summary instance\n     */\n    addHeading(text, level) {\n        const tag = `h${level}`;\n        const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n            ? tag\n            : 'h1';\n        const element = this.wrap(allowedTag, text);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexport const markdownSummary = _summary;\nexport const summary = _summary;\n//# sourceMappingURL=summary.js.map","import * as path from 'path';\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nexport function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nexport function toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nexport function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\n//# sourceMappingURL=path-utils.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"child_process\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as fs from 'fs';\nimport * as path from 'path';\nexport const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises;\n// export const {open} = 'fs'\nexport const IS_WINDOWS = process.platform === 'win32';\n/**\n * Custom implementation of readlink to ensure Windows junctions\n * maintain trailing backslash for backward compatibility with Node.js < 24\n *\n * In Node.js 20, Windows junctions (directory symlinks) always returned paths\n * with trailing backslashes. Node.js 24 removed this behavior, which breaks\n * code that relied on this format for path operations.\n *\n * This implementation restores the Node 20 behavior by adding a trailing\n * backslash to all junction results on Windows.\n */\nexport function readlink(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield fs.promises.readlink(fsPath);\n // On Windows, restore Node 20 behavior: add trailing backslash to all results\n // since junctions on Windows are always directory links\n if (IS_WINDOWS && !result.endsWith('\\\\')) {\n return `${result}\\\\`;\n }\n return result;\n });\n}\n// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691\nexport const UV_FS_O_EXLOCK = 0x10000000;\nexport const READONLY = fs.constants.O_RDONLY;\nexport function exists(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n yield stat(fsPath);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n }\n return true;\n });\n}\nexport function isDirectory(fsPath_1) {\n return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) {\n const stats = useStat ? yield stat(fsPath) : yield lstat(fsPath);\n return stats.isDirectory();\n });\n}\n/**\n * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:\n * \\, \\hello, \\\\hello\\share, C:, and C:\\hello (and corresponding alternate separator cases).\n */\nexport function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}\n/**\n * Best effort attempt to determine whether a file exists and is executable.\n * @param filePath file path to check\n * @param extensions additional file extensions to try\n * @return if file exists and is executable, returns the file path. otherwise empty string.\n */\nexport function tryGetExecutablePath(filePath, extensions) {\n return __awaiter(this, void 0, void 0, function* () {\n let stats = undefined;\n try {\n // test file exists\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // on Windows, test for valid extension\n const upperExt = path.extname(filePath).toUpperCase();\n if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {\n return filePath;\n }\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n // try each extension\n const originalFilePath = filePath;\n for (const extension of extensions) {\n filePath = originalFilePath + extension;\n stats = undefined;\n try {\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // preserve the case of the actual file (since an extension was appended)\n try {\n const directory = path.dirname(filePath);\n const upperName = path.basename(filePath).toUpperCase();\n for (const actualName of yield readdir(directory)) {\n if (upperName === actualName.toUpperCase()) {\n filePath = path.join(directory, actualName);\n break;\n }\n }\n }\n catch (err) {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);\n }\n return filePath;\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n }\n return '';\n });\n}\nfunction normalizeSeparators(p) {\n p = p || '';\n if (IS_WINDOWS) {\n // convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // remove redundant slashes\n return p.replace(/\\\\\\\\+/g, '\\\\');\n }\n // remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n// on Mac/Linux, test the execute bit\n// R W X R W X R W X\n// 256 128 64 32 16 8 4 2 1\nfunction isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 &&\n process.getgid !== undefined &&\n stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 &&\n process.getuid !== undefined &&\n stats.uid === process.getuid()));\n}\n// Get the path of cmd.exe in windows\nexport function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}\n//# sourceMappingURL=io-util.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ok } from 'assert';\nimport * as path from 'path';\nimport * as ioUtil from './io-util.js';\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nexport function cp(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n const { force, recursive, copySourceDirectory } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory() && copySourceDirectory\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nexport function mv(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nexport function rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Check for invalid characters\n // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n if (/[*\"<>|]/.test(inputPath)) {\n throw new Error('File path must not contain `*`, `\"`, `<`, `>` or `|` on Windows');\n }\n }\n try {\n // note if path does not exist, error is silent\n yield ioUtil.rm(inputPath, {\n force: true,\n maxRetries: 3,\n recursive: true,\n retryDelay: 300\n });\n }\n catch (err) {\n throw new Error(`File was unable to be removed ${err}`);\n }\n });\n}\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nexport function mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n ok(fsPath, 'a path argument must be provided');\n yield ioUtil.mkdir(fsPath, { recursive: true });\n });\n}\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nexport function which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nexport function findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n const copySourceDirectory = options.copySourceDirectory == null\n ? true\n : Boolean(options.copySourceDirectory);\n return { force, recursive, copySourceDirectory };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"timers\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as os from 'os';\nimport * as events from 'events';\nimport * as child from 'child_process';\nimport * as path from 'path';\nimport * as io from '@actions/io';\nimport * as ioUtil from '@actions/io/lib/io-util';\nimport { setTimeout } from 'timers';\n/* eslint-disable @typescript-eslint/unbound-method */\nconst IS_WINDOWS = process.platform === 'win32';\n/*\n * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.\n */\nexport class ToolRunner extends events.EventEmitter {\n constructor(toolPath, args, options) {\n super();\n if (!toolPath) {\n throw new Error(\"Parameter 'toolPath' cannot be null or empty.\");\n }\n this.toolPath = toolPath;\n this.args = args || [];\n this.options = options || {};\n }\n _debug(message) {\n if (this.options.listeners && this.options.listeners.debug) {\n this.options.listeners.debug(message);\n }\n }\n _getCommandString(options, noPrefix) {\n const toolPath = this._getSpawnFileName();\n const args = this._getSpawnArgs(options);\n let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool\n if (IS_WINDOWS) {\n // Windows + cmd file\n if (this._isCmdFile()) {\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows + verbatim\n else if (options.windowsVerbatimArguments) {\n cmd += `\"${toolPath}\"`;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows (regular)\n else {\n cmd += this._windowsQuoteCmdArg(toolPath);\n for (const a of args) {\n cmd += ` ${this._windowsQuoteCmdArg(a)}`;\n }\n }\n }\n else {\n // OSX/Linux - this can likely be improved with some form of quoting.\n // creating processes on Unix is fundamentally different than Windows.\n // on Unix, execvp() takes an arg array.\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n return cmd;\n }\n _processLineBuffer(data, strBuffer, onLine) {\n try {\n let s = strBuffer + data.toString();\n let n = s.indexOf(os.EOL);\n while (n > -1) {\n const line = s.substring(0, n);\n onLine(line);\n // the rest of the string ...\n s = s.substring(n + os.EOL.length);\n n = s.indexOf(os.EOL);\n }\n return s;\n }\n catch (err) {\n // streaming lines to console is best effort. Don't fail a build.\n this._debug(`error processing line. Failed with error ${err}`);\n return '';\n }\n }\n _getSpawnFileName() {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n return process.env['COMSPEC'] || 'cmd.exe';\n }\n }\n return this.toolPath;\n }\n _getSpawnArgs(options) {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n let argline = `/D /S /C \"${this._windowsQuoteCmdArg(this.toolPath)}`;\n for (const a of this.args) {\n argline += ' ';\n argline += options.windowsVerbatimArguments\n ? a\n : this._windowsQuoteCmdArg(a);\n }\n argline += '\"';\n return [argline];\n }\n }\n return this.args;\n }\n _endsWith(str, end) {\n return str.endsWith(end);\n }\n _isCmdFile() {\n const upperToolPath = this.toolPath.toUpperCase();\n return (this._endsWith(upperToolPath, '.CMD') ||\n this._endsWith(upperToolPath, '.BAT'));\n }\n _windowsQuoteCmdArg(arg) {\n // for .exe, apply the normal quoting rules that libuv applies\n if (!this._isCmdFile()) {\n return this._uvQuoteCmdArg(arg);\n }\n // otherwise apply quoting rules specific to the cmd.exe command line parser.\n // the libuv rules are generic and are not designed specifically for cmd.exe\n // command line parser.\n //\n // for a detailed description of the cmd.exe command line parser, refer to\n // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912\n // need quotes for empty arg\n if (!arg) {\n return '\"\"';\n }\n // determine whether the arg needs to be quoted\n const cmdSpecialChars = [\n ' ',\n '\\t',\n '&',\n '(',\n ')',\n '[',\n ']',\n '{',\n '}',\n '^',\n '=',\n ';',\n '!',\n \"'\",\n '+',\n ',',\n '`',\n '~',\n '|',\n '<',\n '>',\n '\"'\n ];\n let needsQuotes = false;\n for (const char of arg) {\n if (cmdSpecialChars.some(x => x === char)) {\n needsQuotes = true;\n break;\n }\n }\n // short-circuit if quotes not needed\n if (!needsQuotes) {\n return arg;\n }\n // the following quoting rules are very similar to the rules that by libuv applies.\n //\n // 1) wrap the string in quotes\n //\n // 2) double-up quotes - i.e. \" => \"\"\n //\n // this is different from the libuv quoting rules. libuv replaces \" with \\\", which unfortunately\n // doesn't work well with a cmd.exe command line.\n //\n // note, replacing \" with \"\" also works well if the arg is passed to a downstream .NET console app.\n // for example, the command line:\n // foo.exe \"myarg:\"\"my val\"\"\"\n // is parsed by a .NET console app into an arg array:\n // [ \"myarg:\\\"my val\\\"\" ]\n // which is the same end result when applying libuv quoting rules. although the actual\n // command line from libuv quoting rules would look like:\n // foo.exe \"myarg:\\\"my val\\\"\"\n //\n // 3) double-up slashes that precede a quote,\n // e.g. hello \\world => \"hello \\world\"\n // hello\\\"world => \"hello\\\\\"\"world\"\n // hello\\\\\"world => \"hello\\\\\\\\\"\"world\"\n // hello world\\ => \"hello world\\\\\"\n //\n // technically this is not required for a cmd.exe command line, or the batch argument parser.\n // the reasons for including this as a .cmd quoting rule are:\n //\n // a) this is optimized for the scenario where the argument is passed from the .cmd file to an\n // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.\n //\n // b) it's what we've been doing previously (by deferring to node default behavior) and we\n // haven't heard any complaints about that aspect.\n //\n // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be\n // escaped when used on the command line directly - even though within a .cmd file % can be escaped\n // by using %%.\n //\n // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts\n // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.\n //\n // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would\n // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the\n // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args\n // to an external program.\n //\n // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.\n // % can be escaped within a .cmd file.\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\'; // double the slash\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\"'; // double the quote\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _uvQuoteCmdArg(arg) {\n // Tool runner wraps child_process.spawn() and needs to apply the same quoting as\n // Node in certain cases where the undocumented spawn option windowsVerbatimArguments\n // is used.\n //\n // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,\n // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),\n // pasting copyright notice from Node within this function:\n //\n // Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to\n // deal in the Software without restriction, including without limitation the\n // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n // sell copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n //\n // The above copyright notice and this permission notice shall be included in\n // all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n // IN THE SOFTWARE.\n if (!arg) {\n // Need double quotation for empty argument\n return '\"\"';\n }\n if (!arg.includes(' ') && !arg.includes('\\t') && !arg.includes('\"')) {\n // No quotation needed\n return arg;\n }\n if (!arg.includes('\"') && !arg.includes('\\\\')) {\n // No embedded double quotes or backslashes, so I can just wrap\n // quote marks around the whole thing.\n return `\"${arg}\"`;\n }\n // Expected input/output:\n // input : hello\"world\n // output: \"hello\\\"world\"\n // input : hello\"\"world\n // output: \"hello\\\"\\\"world\"\n // input : hello\\world\n // output: hello\\world\n // input : hello\\\\world\n // output: hello\\\\world\n // input : hello\\\"world\n // output: \"hello\\\\\\\"world\"\n // input : hello\\\\\"world\n // output: \"hello\\\\\\\\\\\"world\"\n // input : hello world\\\n // output: \"hello world\\\\\" - note the comment in libuv actually reads \"hello world\\\"\n // but it appears the comment is wrong, it should be \"hello world\\\\\"\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\';\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\\\\';\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _cloneExecOptions(options) {\n options = options || {};\n const result = {\n cwd: options.cwd || process.cwd(),\n env: options.env || process.env,\n silent: options.silent || false,\n windowsVerbatimArguments: options.windowsVerbatimArguments || false,\n failOnStdErr: options.failOnStdErr || false,\n ignoreReturnCode: options.ignoreReturnCode || false,\n delay: options.delay || 10000\n };\n result.outStream = options.outStream || process.stdout;\n result.errStream = options.errStream || process.stderr;\n return result;\n }\n _getSpawnOptions(options, toolPath) {\n options = options || {};\n const result = {};\n result.cwd = options.cwd;\n result.env = options.env;\n result['windowsVerbatimArguments'] =\n options.windowsVerbatimArguments || this._isCmdFile();\n if (options.windowsVerbatimArguments) {\n result.argv0 = `\"${toolPath}\"`;\n }\n return result;\n }\n /**\n * Exec a tool.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param tool path to tool to exec\n * @param options optional exec options. See ExecOptions\n * @returns number\n */\n exec() {\n return __awaiter(this, void 0, void 0, function* () {\n // root the tool path if it is unrooted and contains relative pathing\n if (!ioUtil.isRooted(this.toolPath) &&\n (this.toolPath.includes('/') ||\n (IS_WINDOWS && this.toolPath.includes('\\\\')))) {\n // prefer options.cwd if it is specified, however options.cwd may also need to be rooted\n this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);\n }\n // if the tool is only a file name, then resolve it from the PATH\n // otherwise verify it exists (add extension on Windows if necessary)\n this.toolPath = yield io.which(this.toolPath, true);\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n this._debug(`exec tool: ${this.toolPath}`);\n this._debug('arguments:');\n for (const arg of this.args) {\n this._debug(` ${arg}`);\n }\n const optionsNonNull = this._cloneExecOptions(this.options);\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);\n }\n const state = new ExecState(optionsNonNull, this.toolPath);\n state.on('debug', (message) => {\n this._debug(message);\n });\n if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {\n return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));\n }\n const fileName = this._getSpawnFileName();\n const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));\n let stdbuffer = '';\n if (cp.stdout) {\n cp.stdout.on('data', (data) => {\n if (this.options.listeners && this.options.listeners.stdout) {\n this.options.listeners.stdout(data);\n }\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(data);\n }\n stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.stdline) {\n this.options.listeners.stdline(line);\n }\n });\n });\n }\n let errbuffer = '';\n if (cp.stderr) {\n cp.stderr.on('data', (data) => {\n state.processStderr = true;\n if (this.options.listeners && this.options.listeners.stderr) {\n this.options.listeners.stderr(data);\n }\n if (!optionsNonNull.silent &&\n optionsNonNull.errStream &&\n optionsNonNull.outStream) {\n const s = optionsNonNull.failOnStdErr\n ? optionsNonNull.errStream\n : optionsNonNull.outStream;\n s.write(data);\n }\n errbuffer = this._processLineBuffer(data, errbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.errline) {\n this.options.listeners.errline(line);\n }\n });\n });\n }\n cp.on('error', (err) => {\n state.processError = err.message;\n state.processExited = true;\n state.processClosed = true;\n state.CheckComplete();\n });\n cp.on('exit', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n cp.on('close', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n state.processClosed = true;\n this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n state.on('done', (error, exitCode) => {\n if (stdbuffer.length > 0) {\n this.emit('stdline', stdbuffer);\n }\n if (errbuffer.length > 0) {\n this.emit('errline', errbuffer);\n }\n cp.removeAllListeners();\n if (error) {\n reject(error);\n }\n else {\n resolve(exitCode);\n }\n });\n if (this.options.input) {\n if (!cp.stdin) {\n throw new Error('child process missing stdin');\n }\n cp.stdin.end(this.options.input);\n }\n }));\n });\n }\n}\n/**\n * Convert an arg string to an array of args. Handles escaping\n *\n * @param argString string of arguments\n * @returns string[] array of arguments\n */\nexport function argStringToArray(argString) {\n const args = [];\n let inQuotes = false;\n let escaped = false;\n let arg = '';\n function append(c) {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\';\n }\n arg += c;\n escaped = false;\n }\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i);\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes;\n }\n else {\n append(c);\n }\n continue;\n }\n if (c === '\\\\' && escaped) {\n append(c);\n continue;\n }\n if (c === '\\\\' && inQuotes) {\n escaped = true;\n continue;\n }\n if (c === ' ' && !inQuotes) {\n if (arg.length > 0) {\n args.push(arg);\n arg = '';\n }\n continue;\n }\n append(c);\n }\n if (arg.length > 0) {\n args.push(arg.trim());\n }\n return args;\n}\nclass ExecState extends events.EventEmitter {\n constructor(options, toolPath) {\n super();\n this.processClosed = false; // tracks whether the process has exited and stdio is closed\n this.processError = '';\n this.processExitCode = 0;\n this.processExited = false; // tracks whether the process has exited\n this.processStderr = false; // tracks whether stderr was written to\n this.delay = 10000; // 10 seconds\n this.done = false;\n this.timeout = null;\n if (!toolPath) {\n throw new Error('toolPath must not be empty');\n }\n this.options = options;\n this.toolPath = toolPath;\n if (options.delay) {\n this.delay = options.delay;\n }\n }\n CheckComplete() {\n if (this.done) {\n return;\n }\n if (this.processClosed) {\n this._setResult();\n }\n else if (this.processExited) {\n this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);\n }\n }\n _debug(message) {\n this.emit('debug', message);\n }\n _setResult() {\n // determine whether there is an error\n let error;\n if (this.processExited) {\n if (this.processError) {\n error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);\n }\n else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {\n error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);\n }\n else if (this.processStderr && this.options.failOnStdErr) {\n error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);\n }\n }\n // clear the timeout\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.done = true;\n this.emit('done', error, this.processExitCode);\n }\n static HandleTimeout(state) {\n if (state.done) {\n return;\n }\n if (!state.processClosed && state.processExited) {\n const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;\n state._debug(message);\n }\n state._setResult();\n }\n}\n//# sourceMappingURL=toolrunner.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { StringDecoder } from 'string_decoder';\nimport * as tr from './toolrunner.js';\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nexport function exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\n/**\n * Exec a command and get the output.\n * Output will be streamed to the live console.\n * Returns promise with the exit code and collected stdout and stderr\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code, stdout, and stderr\n */\nexport function getExecOutput(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let stdout = '';\n let stderr = '';\n //Using string decoder covers the case where a mult-byte character is split\n const stdoutDecoder = new StringDecoder('utf8');\n const stderrDecoder = new StringDecoder('utf8');\n const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;\n const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;\n const stdErrListener = (data) => {\n stderr += stderrDecoder.write(data);\n if (originalStdErrListener) {\n originalStdErrListener(data);\n }\n };\n const stdOutListener = (data) => {\n stdout += stdoutDecoder.write(data);\n if (originalStdoutListener) {\n originalStdoutListener(data);\n }\n };\n const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });\n const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));\n //flush any remaining characters\n stdout += stdoutDecoder.end();\n stderr += stderrDecoder.end();\n return {\n exitCode,\n stdout,\n stderr\n };\n });\n}\n//# sourceMappingURL=exec.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport os from 'os';\nimport * as exec from '@actions/exec';\nconst getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout: version } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Version\"', undefined, {\n silent: true\n });\n const { stdout: name } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Caption\"', undefined, {\n silent: true\n });\n return {\n name: name.trim(),\n version: version.trim()\n };\n});\nconst getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d;\n const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {\n silent: true\n });\n const version = (_b = (_a = stdout.match(/ProductVersion:\\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';\n const name = (_d = (_c = stdout.match(/ProductName:\\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';\n return {\n name,\n version\n };\n});\nconst getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {\n silent: true\n });\n const [name, version] = stdout.trim().split('\\n');\n return {\n name,\n version\n };\n});\nexport const platform = os.platform();\nexport const arch = os.arch();\nexport const isWindows = platform === 'win32';\nexport const isMacOS = platform === 'darwin';\nexport const isLinux = platform === 'linux';\nexport function getDetails() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign(Object.assign({}, (yield (isWindows\n ? getWindowsInfo()\n : isMacOS\n ? getMacOsInfo()\n : getLinuxInfo()))), { platform,\n arch,\n isWindows,\n isMacOS,\n isLinux });\n });\n}\n//# sourceMappingURL=platform.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { issue, issueCommand } from './command.js';\nimport { issueFileCommand, prepareKeyValueMessage } from './file-command.js';\nimport { toCommandProperties, toCommandValue } from './utils.js';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { OidcClient } from './oidc-utils.js';\n/**\n * The code to exit an action\n */\nexport var ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode || (ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function exportVariable(name, val) {\n const convertedVal = toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return issueFileCommand('ENV', prepareKeyValueMessage(name, val));\n }\n issueCommand('set-env', { name }, convertedVal);\n}\n/**\n * Registers a secret which will get masked from logs\n *\n * @param secret - Value of the secret to be masked\n * @remarks\n * This function instructs the Actions runner to mask the specified value in any\n * logs produced during the workflow run. Once registered, the secret value will\n * be replaced with asterisks (***) whenever it appears in console output, logs,\n * or error messages.\n *\n * This is useful for protecting sensitive information such as:\n * - API keys\n * - Access tokens\n * - Authentication credentials\n * - URL parameters containing signatures (SAS tokens)\n *\n * Note that masking only affects future logs; any previous appearances of the\n * secret in logs before calling this function will remain unmasked.\n *\n * @example\n * ```typescript\n * // Register an API token as a secret\n * const apiToken = \"abc123xyz456\";\n * setSecret(apiToken);\n *\n * // Now any logs containing this value will show *** instead\n * console.log(`Using token: ${apiToken}`); // Outputs: \"Using token: ***\"\n * ```\n */\nexport function setSecret(secret) {\n issueCommand('add-mask', {}, secret);\n}\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nexport function addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n issueFileCommand('PATH', inputPath);\n }\n else {\n issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nexport function getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nexport function getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nexport function getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n issueCommand('set-output', { name }, toCommandValue(value));\n}\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nexport function setCommandEcho(enabled) {\n issue('echo', enabled ? 'on' : 'off');\n}\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nexport function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nexport function isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nexport function debug(message) {\n issueCommand('debug', {}, message);\n}\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function error(message, properties = {}) {\n issueCommand('error', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function warning(message, properties = {}) {\n issueCommand('warning', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function notice(message, properties = {}) {\n issueCommand('notice', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nexport function info(message) {\n process.stdout.write(message + os.EOL);\n}\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nexport function startGroup(name) {\n issue('group', name);\n}\n/**\n * End an output group.\n */\nexport function endGroup() {\n issue('endgroup');\n}\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nexport function group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return issueFileCommand('STATE', prepareKeyValueMessage(name, value));\n }\n issueCommand('save-state', { name }, toCommandValue(value));\n}\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nexport function getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexport function getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield OidcClient.getIDToken(aud);\n });\n}\n/**\n * Summary exports\n */\nexport { summary } from './summary.js';\n/**\n * @deprecated use core.summary\n */\nexport { markdownSummary } from './summary.js';\n/**\n * Path exports\n */\nexport { toPosixPath, toWin32Path, toPlatformPath } from './path-utils.js';\n/**\n * Platform utilities exports\n */\nexport * as platform from './platform.js';\n//# sourceMappingURL=core.js.map","class UploadUrlPool {\n /** Map from key (bucket ID or file ID) to a stack of available entries. */\n pools = /* @__PURE__ */ new Map();\n /**\n * Take an upload URL from the pool, or return null if none are available.\n *\n * @param key - The bucket ID or file ID to look up.\n *\n * @returns An upload URL entry, or null if the pool is empty for the given key.\n */\n checkout(key) {\n const pool = this.pools.get(key);\n if (!pool || pool.length === 0) return null;\n return pool.pop() ?? null;\n }\n /**\n * Return a still-valid upload URL to the pool for future reuse.\n *\n * @param key - The bucket ID or file ID the entry belongs to.\n * @param entry - The upload URL entry to return to the pool.\n */\n checkin(key, entry) {\n let pool = this.pools.get(key);\n if (!pool) {\n pool = [];\n this.pools.set(key, pool);\n }\n pool.push(entry);\n }\n /**\n * Remove a specific upload URL from the pool (e.g. after an upload error).\n *\n * @param key - The bucket ID or file ID the entry belongs to.\n * @param entry - The failed upload URL entry to remove.\n */\n evict(key, entry) {\n const pool = this.pools.get(key);\n if (!pool) return;\n const idx = pool.findIndex((e) => e.uploadUrl === entry.uploadUrl);\n if (idx !== -1) {\n pool.splice(idx, 1);\n }\n }\n /** Remove all entries from every key in the pool. */\n clear() {\n this.pools.clear();\n }\n}\nexport {\n UploadUrlPool\n};\n//# sourceMappingURL=upload-url-pool.js.map\n","import { UploadUrlPool } from \"./upload-url-pool.js\";\nclass InMemoryAccountInfo {\n /** Cached authorization response, or null before authorize() is called. */\n auth = null;\n /** Pool of reusable small-file upload URLs, keyed by bucket ID. */\n uploadUrls = new UploadUrlPool();\n /** Pool of reusable large-file part upload URLs, keyed by file ID. */\n partUploadUrls = new UploadUrlPool();\n /**\n * Store a fresh authorization response, replacing any previous state.\n *\n * @param auth - The authorize account response to store.\n */\n setAuth(auth) {\n this.auth = auth;\n this.uploadUrls.clear();\n this.partUploadUrls.clear();\n }\n /**\n * Return the current authorization response, or null if not authorized.\n *\n * @returns The cached authorization response, or null if not yet authorized.\n */\n getAuth() {\n return this.auth;\n }\n /** Discard all cached authorization state and upload URLs. */\n clear() {\n this.auth = null;\n this.uploadUrls.clear();\n this.partUploadUrls.clear();\n }\n /**\n * Base URL for B2 API calls.\n *\n * @returns The base URL for B2 API calls.\n *\n * @throws Error if not yet authorized.\n */\n getApiUrl() {\n return this.requireAuth().apiInfo.storageApi.apiUrl;\n }\n /**\n * Base URL for file downloads.\n *\n * @returns The base URL for file downloads.\n *\n * @throws Error if not yet authorized.\n */\n getDownloadUrl() {\n return this.requireAuth().apiInfo.storageApi.downloadUrl;\n }\n /**\n * Current authorization token.\n *\n * @returns The current authorization token.\n *\n * @throws Error if not yet authorized.\n */\n getAuthToken() {\n return this.requireAuth().authorizationToken;\n }\n /**\n * The authorized account ID.\n *\n * @returns The authorized account identifier.\n *\n * @throws Error if not yet authorized.\n */\n getAccountId() {\n return this.requireAuth().accountId;\n }\n /**\n * Server-recommended part size for large file uploads, in bytes.\n *\n * @returns The server-recommended part size in bytes.\n *\n * @throws Error if not yet authorized.\n */\n getRecommendedPartSize() {\n return this.requireAuth().apiInfo.storageApi.recommendedPartSize;\n }\n /**\n * Smallest allowed part size for large file uploads, in bytes.\n *\n * @returns The smallest allowed part size in bytes.\n *\n * @throws Error if not yet authorized.\n */\n getAbsoluteMinimumPartSize() {\n return this.requireAuth().apiInfo.storageApi.absoluteMinimumPartSize;\n }\n /**\n * Base URL for the S3-compatible API.\n *\n * @returns The base URL for the S3-compatible API.\n *\n * @throws Error if not yet authorized.\n */\n getS3ApiUrl() {\n return this.requireAuth().apiInfo.storageApi.s3ApiUrl;\n }\n /**\n * Bucket ID the key is restricted to, or null if unrestricted.\n *\n * @returns The restricted bucket identifier, or null if the key is unrestricted.\n *\n * @throws Error if not yet authorized.\n */\n getAllowedBucketId() {\n return this.requireAuth().apiInfo.storageApi.allowed.bucketId ?? null;\n }\n /**\n * Take an upload URL from the pool for the given bucket, or null if none available.\n *\n * @param bucketId - The bucket to check out an upload URL for.\n *\n * @returns A reusable upload URL entry, or null if none are available.\n */\n checkoutUploadUrl(bucketId) {\n return this.uploadUrls.checkout(bucketId);\n }\n /**\n * Return a still-valid upload URL to the pool for reuse.\n *\n * @param bucketId - The bucket the upload URL belongs to.\n * @param entry - The upload URL entry to return to the pool.\n */\n returnUploadUrl(bucketId, entry) {\n this.uploadUrls.checkin(bucketId, entry);\n }\n /**\n * Remove an upload URL from the pool after an upload error.\n *\n * @param bucketId - The bucket the failed upload URL belongs to.\n * @param entry - The upload URL entry to remove from the pool.\n */\n evictUploadUrl(bucketId, entry) {\n this.uploadUrls.evict(bucketId, entry);\n }\n /**\n * Take a large-file part upload URL from the pool, or null if none available.\n *\n * @param fileId - The large file to check out a part upload URL for.\n *\n * @returns A reusable part upload URL entry, or null if none are available.\n */\n checkoutPartUploadUrl(fileId) {\n return this.partUploadUrls.checkout(fileId);\n }\n /**\n * Return a still-valid part upload URL to the pool for reuse.\n *\n * @param fileId - The large file the part upload URL belongs to.\n * @param entry - The part upload URL entry to return to the pool.\n */\n returnPartUploadUrl(fileId, entry) {\n this.partUploadUrls.checkin(fileId, entry);\n }\n /**\n * Remove a part upload URL from the pool after an error.\n *\n * @param fileId - The large file the failed part upload URL belongs to.\n * @param entry - The part upload URL entry to remove from the pool.\n */\n evictPartUploadUrl(fileId, entry) {\n this.partUploadUrls.evict(fileId, entry);\n }\n /**\n * Retrieve the cached auth response or throw if not yet authorized.\n *\n * @returns The cached authorization response.\n *\n * @throws Error if authorize() has not been called.\n */\n requireAuth() {\n if (!this.auth) throw new Error(\"Not authorized. Call authorize() first.\");\n return this.auth;\n }\n}\nexport {\n InMemoryAccountInfo\n};\n//# sourceMappingURL=in-memory.js.map\n","const REALM_URLS = {\n production: \"https://api.backblazeb2.com\",\n staging: \"https://api.backblazeb2.com\"\n};\nfunction getRealmUrl(realm) {\n return REALM_URLS[realm] ?? realm;\n}\nexport {\n REALM_URLS,\n getRealmUrl\n};\n//# sourceMappingURL=realms.js.map\n","function accountId(raw) {\n return raw;\n}\nfunction bucketId(raw) {\n return raw;\n}\nfunction fileId(raw) {\n return raw;\n}\nfunction keyId(raw) {\n return raw;\n}\nfunction applicationKeyId(raw) {\n return raw;\n}\nfunction largeFileId(raw) {\n return raw;\n}\nexport {\n accountId,\n applicationKeyId,\n bucketId,\n fileId,\n keyId,\n largeFileId\n};\n//# sourceMappingURL=ids.js.map\n","async function bestEffort(fn) {\n try {\n await fn();\n } catch {\n }\n}\nexport {\n bestEffort\n};\n//# sourceMappingURL=best-effort.js.map\n","import { bestEffort } from \"../util/best-effort.js\";\nasync function cancelLargeFileBestEffort(raw, accountInfo, fileId) {\n await bestEffort(\n () => raw.cancelLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId })\n );\n}\nexport {\n cancelLargeFileBestEffort\n};\n//# sourceMappingURL=cancel.js.map\n","class Semaphore {\n /**\n * @param limit - Maximum number of concurrent acquisitions. Must be a\n * positive integer; values `<= 0` would create a semaphore that\n * never lets anything through (all `acquire()` calls would queue\n * forever), so the constructor throws fast instead.\n *\n * @throws `RangeError` when `limit` is not a positive integer.\n */\n constructor(limit) {\n this.limit = limit;\n if (!Number.isInteger(limit) || limit <= 0) {\n throw new RangeError(\n `Semaphore limit must be a positive integer; received ${limit}. A non-positive limit produces a deadlocked semaphore — fail fast at construction instead.`\n );\n }\n }\n current = 0;\n queue = [];\n /**\n * Acquires a slot, waiting if the limit has been reached.\n * @returns A promise that resolves when a slot is available.\n */\n async acquire() {\n if (this.current < this.limit) {\n this.current++;\n return;\n }\n return new Promise((resolve) => {\n this.queue.push(resolve);\n });\n }\n /** Releases a slot, unblocking the next queued caller if any. */\n release() {\n const next = this.queue.shift();\n if (next) {\n next();\n } else {\n this.current--;\n }\n }\n /**\n * Number of slots currently available.\n *\n * @returns The count of free concurrency slots.\n */\n get available() {\n return this.limit - this.current;\n }\n}\nexport {\n Semaphore\n};\n//# sourceMappingURL=concurrency.js.map\n","const DEFAULT_TRANSFER_CONCURRENCY = 4;\nconst DEFAULT_BULK_CONCURRENCY = 10;\nconst DEFAULT_PAGE_SIZE = 1e3;\nconst DEFAULT_CONTENT_TYPE = \"b2/x-auto\";\nexport {\n DEFAULT_BULK_CONCURRENCY,\n DEFAULT_CONTENT_TYPE,\n DEFAULT_PAGE_SIZE,\n DEFAULT_TRANSFER_CONCURRENCY\n};\n//# sourceMappingURL=defaults.js.map\n","function planRanges(totalSize, chunkSize) {\n const plans = [];\n let offset = 0;\n let index = 0;\n while (offset < totalSize) {\n const length = Math.min(chunkSize, totalSize - offset);\n const end = offset + length - 1;\n plans.push({\n partNumber: index + 1,\n index,\n offset,\n length,\n start: offset,\n end\n });\n offset += length;\n index++;\n }\n return plans;\n}\nfunction byteRangeHeader(start, end) {\n return `bytes=${start}-${end}`;\n}\nexport {\n byteRangeHeader,\n planRanges\n};\n//# sourceMappingURL=plan-ranges.js.map\n","import { fileId } from \"../types/ids.js\";\nimport { cancelLargeFileBestEffort } from \"../upload/cancel.js\";\nimport { Semaphore } from \"../upload/concurrency.js\";\nimport { DEFAULT_CONTENT_TYPE, DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { byteRangeHeader, planRanges } from \"../util/plan-ranges.js\";\nasync function copyLargeFile(raw, accountInfo, options) {\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const sourceInfo = await raw.getFileInfo(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: options.sourceFileId\n });\n const totalSize = sourceInfo.contentLength;\n if (totalSize <= partSize) {\n return raw.copyFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n sourceFileId: options.sourceFileId,\n fileName: options.fileName,\n ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : {},\n ...options.contentType !== void 0 ? { contentType: options.contentType } : {},\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}\n });\n }\n const destBucketId = options.destinationBucketId ?? sourceInfo.bucketId;\n const startResp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: destBucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? sourceInfo.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo: options.fileInfo ?? {},\n ...options.destinationServerSideEncryption !== void 0 ? { serverSideEncryption: options.destinationServerSideEncryption } : {}\n });\n const largeFileId = startResp.fileId;\n const ranges = planRanges(totalSize, partSize);\n const partSha1s = new Array(ranges.length);\n const sem = new Semaphore(concurrency);\n try {\n options.signal?.throwIfAborted();\n await Promise.all(\n ranges.map(async (range) => {\n await sem.acquire();\n try {\n options.signal?.throwIfAborted();\n const resp = await raw.copyPart(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n sourceFileId: options.sourceFileId,\n // `startLargeFile` returns `LargeFileId`; `copyPart` takes the\n // same value typed as `FileId`. Re-brand via the factory.\n largeFileId: fileId(largeFileId),\n partNumber: range.partNumber,\n range: byteRangeHeader(range.start, range.end),\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}\n });\n partSha1s[range.partNumber - 1] = resp.contentSha1;\n } finally {\n sem.release();\n }\n })\n );\n options.signal?.throwIfAborted();\n return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n}\nexport {\n copyLargeFile\n};\n//# sourceMappingURL=large.js.map\n","const utf8Encoder = new TextEncoder();\nconst utf8Decoder = new TextDecoder();\nexport {\n utf8Decoder,\n utf8Encoder\n};\n//# sourceMappingURL=text-codec.js.map\n","import { utf8Encoder } from \"../util/text-codec.js\";\nconst SAFE_CHARS = new Set(\n \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@/\".split(\"\")\n);\nfunction encodeFileName(name) {\n const encoded = [];\n for (const char of name) {\n if (SAFE_CHARS.has(char)) {\n encoded.push(char);\n } else {\n const bytes = utf8Encoder.encode(char);\n for (const byte of bytes) {\n encoded.push(`%${byte.toString(16).toUpperCase().padStart(2, \"0\")}`);\n }\n }\n }\n return encoded.join(\"\");\n}\nfunction decodeFileName(encoded) {\n return decodeURIComponent(encoded);\n}\nfunction buildFileInfoHeaders(fileInfo) {\n if (!fileInfo) return {};\n const headers = {};\n for (const [key, value] of Object.entries(fileInfo)) {\n headers[`X-Bz-Info-${encodeFileName(key)}`] = encodeFileName(value);\n }\n return headers;\n}\nfunction parseFileInfoHeaders(headers) {\n const info = {};\n headers.forEach((value, key) => {\n const lower = key.toLowerCase();\n if (lower.startsWith(\"x-bz-info-\")) {\n const infoKey = decodeFileName(lower.slice(\"x-bz-info-\".length));\n info[infoKey] = decodeFileName(value);\n }\n });\n return info;\n}\nexport {\n buildFileInfoHeaders,\n decodeFileName,\n encodeFileName,\n parseFileInfoHeaders\n};\n//# sourceMappingURL=encoding.js.map\n","class ProgressTracker {\n /**\n * Creates a new ProgressTracker.\n * @param listener - Callback to receive progress events, or undefined to disable.\n * @param totalBytes - Expected total bytes, or null if unknown.\n * @param totalParts - Expected total parts, or null if not a multipart transfer.\n */\n constructor(listener, totalBytes, totalParts) {\n this.listener = listener;\n this.totalBytes = totalBytes;\n this.totalParts = totalParts;\n this.startTime = Date.now();\n }\n /** Running total of bytes transferred. */\n bytesTransferred = 0;\n /** Running count of completed parts. */\n partsCompleted = 0;\n /** Timestamp when tracking began. */\n startTime;\n /**\n * Record that additional bytes have been transferred and notify the listener.\n * @param count - The number of additional bytes that were transferred.\n */\n addBytes(count) {\n this.bytesTransferred += count;\n this.emit();\n }\n /** Record that a multipart part has completed and notify the listener. */\n completePart() {\n this.partsCompleted++;\n this.emit();\n }\n /** Emit the current progress snapshot to the listener, if one is registered. */\n emit() {\n this.listener?.({\n bytesTransferred: this.bytesTransferred,\n totalBytes: this.totalBytes,\n partsCompleted: this.partsCompleted,\n totalParts: this.totalParts,\n elapsedMs: Date.now() - this.startTime\n });\n }\n}\nexport {\n ProgressTracker\n};\n//# sourceMappingURL=progress.js.map\n","function normalizeSha1(raw) {\n if (raw === null || raw === void 0 || raw === \"none\") return null;\n return raw;\n}\nfunction normalizeFileVersionSha1(fv) {\n return fv.contentSha1 === \"none\" ? { ...fv, contentSha1: null } : fv;\n}\nfunction normalizeFileVersionListSha1(resp) {\n return { ...resp, files: resp.files.map(normalizeFileVersionSha1) };\n}\nexport {\n normalizeFileVersionListSha1,\n normalizeFileVersionSha1,\n normalizeSha1\n};\n//# sourceMappingURL=normalize.js.map\n","import { parseFileInfoHeaders } from \"../raw/encoding.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { fileId } from \"../types/ids.js\";\nimport { bestEffort } from \"../util/best-effort.js\";\nimport { normalizeSha1 } from \"../util/normalize.js\";\nasync function downloadById(raw, accountInfo, options) {\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.fileId,\n toRawDownloadOptions(options)\n );\n const headers = extractDownloadHeaders(resp.headers);\n return {\n headers,\n // HEAD requests legitimately have no body; return an empty stream so the\n // result shape stays consistent.\n body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress)\n };\n}\nasync function downloadByName(raw, accountInfo, options) {\n const resp = await raw.downloadFileByName(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.bucketName,\n options.fileName,\n toRawDownloadOptions(options)\n );\n const headers = extractDownloadHeaders(resp.headers);\n return {\n headers,\n body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress)\n };\n}\nasync function headById(raw, accountInfo, options) {\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.fileId,\n { ...toRawDownloadOptions(options), method: \"HEAD\" }\n );\n if (resp.body !== null) {\n const body = resp.body;\n await bestEffort(() => body.cancel());\n }\n return { headers: extractDownloadHeaders(resp.headers) };\n}\nasync function headByName(raw, accountInfo, options) {\n const resp = await raw.downloadFileByName(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.bucketName,\n options.fileName,\n { ...toRawDownloadOptions(options), method: \"HEAD\" }\n );\n if (resp.body !== null) {\n const body = resp.body;\n await bestEffort(() => body.cancel());\n }\n return { headers: extractDownloadHeaders(resp.headers) };\n}\nfunction toRawDownloadOptions(options) {\n return {\n ...options.method !== void 0 ? { method: options.method } : {},\n ...options.range !== void 0 ? { range: options.range } : {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.b2ContentDisposition !== void 0 ? { b2ContentDisposition: options.b2ContentDisposition } : {},\n ...options.b2ContentLanguage !== void 0 ? { b2ContentLanguage: options.b2ContentLanguage } : {},\n ...options.b2ContentEncoding !== void 0 ? { b2ContentEncoding: options.b2ContentEncoding } : {},\n ...options.b2ContentType !== void 0 ? { b2ContentType: options.b2ContentType } : {},\n ...options.b2CacheControl !== void 0 ? { b2CacheControl: options.b2CacheControl } : {},\n ...options.b2Expires !== void 0 ? { b2Expires: options.b2Expires } : {},\n ...options.signal !== void 0 ? { signal: options.signal } : {}\n };\n}\nfunction emptyStream() {\n return new ReadableStream({\n start(controller) {\n controller.close();\n }\n });\n}\nfunction instrumentProgress(body, totalBytes, listener) {\n if (listener === void 0) return body;\n const tracker = new ProgressTracker(listener, totalBytes, 1);\n const transform = new TransformStream({\n transform(chunk, controller) {\n tracker.addBytes(chunk.byteLength);\n controller.enqueue(chunk);\n },\n flush() {\n tracker.completePart();\n }\n });\n return body.pipeThrough(transform);\n}\nfunction extractDownloadHeaders(headers) {\n const fileInfo = parseFileInfoHeaders(headers);\n return {\n contentType: headers.get(\"Content-Type\") ?? \"application/octet-stream\",\n contentLength: Number.parseInt(headers.get(\"Content-Length\") ?? \"0\", 10),\n // B2 sends the literal `'none'` for multipart-finished files; collapse\n // to `null` so the typed `string | null` actually means \"no SHA-1\".\n contentSha1: normalizeSha1(headers.get(\"X-Bz-Content-Sha1\")),\n fileId: fileId(headers.get(\"X-Bz-File-Id\") ?? \"\"),\n fileName: decodeURIComponent(headers.get(\"X-Bz-File-Name\") ?? \"\"),\n fileInfo,\n uploadTimestamp: Number.parseInt(headers.get(\"X-Bz-Upload-Timestamp\") ?? \"0\", 10)\n };\n}\nexport {\n downloadById,\n downloadByName,\n headById,\n headByName\n};\n//# sourceMappingURL=single.js.map\n","const DEFAULT_RETRY_OPTIONS = {\n maxRetries: 5,\n maxRetryDelayMs: 64e3,\n initialRetryDelayMs: 1e3\n};\nfunction computeBackoff(attempt, options, retryAfter) {\n if (retryAfter !== void 0 && retryAfter > 0) {\n return Math.min(retryAfter * 1e3, options.maxRetryDelayMs);\n }\n const base = options.initialRetryDelayMs * 2 ** attempt;\n const jitter = Math.random() * base * 0.5;\n return Math.min(base + jitter, options.maxRetryDelayMs);\n}\nfunction sleep(ms, signal) {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) {\n reject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n return;\n }\n const timer = setTimeout(resolve, ms);\n signal?.addEventListener(\n \"abort\",\n () => {\n clearTimeout(timer);\n reject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n },\n { once: true }\n );\n });\n}\nexport {\n DEFAULT_RETRY_OPTIONS,\n computeBackoff,\n sleep\n};\n//# sourceMappingURL=retry.js.map\n","async function collectStream(stream) {\n const reader = stream.getReader();\n try {\n const chunks = [];\n let total = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n total += value.byteLength;\n }\n const result = new Uint8Array(total);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return result;\n } finally {\n reader.releaseLock();\n }\n}\nexport {\n collectStream\n};\n//# sourceMappingURL=collect.js.map\n","import { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep } from \"../http/retry.js\";\nimport { collectStream } from \"../streams/collect.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { planRanges, byteRangeHeader } from \"../util/plan-ranges.js\";\nfunction createParallelDownloadStream(raw, accountInfo, options) {\n const rangeSize = options.rangeSize ?? 10 * 1024 * 1024;\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const totalSize = options.totalSize;\n const retryOptions = {\n ...DEFAULT_RETRY_OPTIONS,\n ...options.maxRetries !== void 0 ? { maxRetries: options.maxRetries } : {}\n };\n const abort = options.signal;\n const ranges = planRanges(totalSize, rangeSize);\n const windowSize = concurrency * 2;\n const inflight = /* @__PURE__ */ new Map();\n const buffer = /* @__PURE__ */ new Map();\n let nextToSchedule = 0;\n let nextToEmit = 0;\n let firstError = null;\n function scheduleNext() {\n while (firstError === null && // Honour abort here so a completed range that triggers a top-up\n // doesn't queue one final fetch after the caller aborted. Without\n // this gate, one extra range request fires post-abort before the\n // `pull()` loop notices.\n abort?.aborted !== true && nextToSchedule < ranges.length && inflight.size + buffer.size < windowSize) {\n const range = ranges[nextToSchedule];\n if (range === void 0) break;\n const idx = nextToSchedule;\n nextToSchedule++;\n const task = (async () => {\n try {\n const data = await fetchRangeWithRetry(\n raw,\n accountInfo,\n options.fileId,\n range.start,\n range.end,\n retryOptions,\n abort\n );\n buffer.set(idx, data);\n } catch (err) {\n if (firstError === null) firstError = err;\n } finally {\n inflight.delete(idx);\n }\n })();\n inflight.set(idx, task);\n }\n }\n return new ReadableStream({\n start(controller) {\n try {\n abort?.throwIfAborted();\n scheduleNext();\n } catch (err) {\n controller.error(err);\n }\n },\n async pull(controller) {\n try {\n while (!buffer.has(nextToEmit)) {\n abort?.throwIfAborted();\n if (firstError !== null) throw firstError;\n if (inflight.size === 0) {\n controller.close();\n return;\n }\n await Promise.race(inflight.values());\n }\n const data = buffer.get(nextToEmit);\n if (data !== void 0) {\n buffer.delete(nextToEmit);\n nextToEmit++;\n controller.enqueue(data);\n }\n scheduleNext();\n if (nextToEmit >= ranges.length && buffer.size === 0 && inflight.size === 0 && firstError === null) {\n controller.close();\n }\n } catch (err) {\n controller.error(err);\n }\n },\n cancel() {\n buffer.clear();\n }\n });\n}\nasync function fetchRangeWithRetry(raw, accountInfo, fileId, start, end, retryOptions, signal) {\n let lastError;\n for (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {\n if (attempt > 0) {\n const delay = computeBackoff(attempt - 1, retryOptions);\n await sleep(delay, signal);\n }\n try {\n signal?.throwIfAborted();\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n fileId,\n {\n range: byteRangeHeader(start, end),\n ...signal !== void 0 ? { signal } : {}\n }\n );\n if (!resp.body) throw new Error(\"Download chunk has no body\");\n return await collectStream(resp.body);\n } catch (err) {\n lastError = err;\n if (signal?.aborted) throw err;\n if (err instanceof DOMException && err.name === \"AbortError\") throw err;\n }\n }\n throw lastError instanceof Error ? lastError : new Error(\"Range download failed after retries\");\n}\nexport {\n createParallelDownloadStream\n};\n//# sourceMappingURL=parallel.js.map\n","let nodeCreateHash;\nasync function getNodeCreateHash() {\n if (nodeCreateHash !== void 0) return nodeCreateHash;\n try {\n const crypto2 = await import(\"node:crypto\");\n if (typeof crypto2.createHash !== \"function\") throw new Error(\"createHash unavailable\");\n nodeCreateHash = (algo) => {\n const h = crypto2.createHash(algo);\n return {\n update(data) {\n h.update(data);\n },\n digest(encoding) {\n return h.digest(encoding);\n }\n };\n };\n } catch {\n nodeCreateHash = null;\n }\n return nodeCreateHash;\n}\nclass IncrementalSha1 {\n /** Buffered chunks for WebCrypto fallback path. */\n chunks = [];\n /** Total bytes fed into the hash so far. */\n totalLength = 0;\n /** Node.js hash instance, or null if using WebCrypto fallback. */\n nodeHash = null;\n /** Resolves once the crypto backend has been loaded. */\n initPromise;\n /** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */\n constructor() {\n this.initPromise = getNodeCreateHash().then((factory) => {\n if (factory) this.nodeHash = factory(\"sha1\");\n });\n }\n /**\n * Feed data into the hash. Async because it lazily initializes the crypto backend.\n * @param data - The bytes to include in the hash computation.\n *\n * @returns A promise that resolves once the data has been consumed.\n */\n async update(data) {\n await this.initPromise;\n if (this.nodeHash) {\n this.nodeHash.update(data);\n } else {\n this.chunks.push(new Uint8Array(data));\n }\n this.totalLength += data.byteLength;\n }\n /**\n * Finalize the hash and return the hex-encoded SHA-1 digest.\n * @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.\n */\n async digest() {\n await this.initPromise;\n if (this.nodeHash) {\n return this.nodeHash.digest(\"hex\");\n }\n const combined = new Uint8Array(this.totalLength);\n let offset = 0;\n for (const chunk of this.chunks) {\n combined.set(chunk, offset);\n offset += chunk.byteLength;\n }\n const hashBuffer = await crypto.subtle.digest(\"SHA-1\", combined.buffer);\n return hexEncode(new Uint8Array(hashBuffer));\n }\n /**\n * Total number of bytes fed into the hash so far.\n *\n * @returns The cumulative byte count across all update calls.\n */\n get bytesProcessed() {\n return this.totalLength;\n }\n}\nfunction hexEncode(bytes) {\n const hex = [];\n for (const b of bytes) {\n hex.push(b.toString(16).padStart(2, \"0\"));\n }\n return hex.join(\"\");\n}\nasync function sha1Hex(data) {\n const factory = await getNodeCreateHash();\n if (factory) {\n const h = factory(\"sha1\");\n h.update(data);\n return h.digest(\"hex\");\n }\n const hashBuffer = await crypto.subtle.digest(\"SHA-1\", data.buffer);\n return hexEncode(new Uint8Array(hashBuffer));\n}\nexport {\n IncrementalSha1,\n sha1Hex\n};\n//# sourceMappingURL=hash.js.map\n","import { largeFileId } from \"../types/ids.js\";\nasync function findResumeCandidate(raw, accountInfo, bucketId, fileName) {\n const unfinished = await raw.listUnfinishedLargeFiles(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { bucketId }\n );\n const match = unfinished.files.find((f) => f.fileName === fileName);\n if (!match) return null;\n const fileId = largeFileId(match.fileId);\n const uploadedPartSha1s = await collectPartSha1s(raw, accountInfo, fileId);\n return { fileId, uploadedPartSha1s };\n}\nasync function collectPartSha1s(raw, accountInfo, fileId) {\n const sha1s = /* @__PURE__ */ new Map();\n let startPartNumber;\n while (true) {\n const page = await raw.listParts(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId,\n ...startPartNumber !== void 0 ? { startPartNumber } : {}\n });\n for (const part of page.parts) {\n sha1s.set(part.partNumber, part.contentSha1);\n }\n if (page.nextPartNumber === null) break;\n startPartNumber = page.nextPartNumber;\n }\n return sha1s;\n}\nexport {\n collectPartSha1s,\n findResumeCandidate\n};\n//# sourceMappingURL=resume.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY, DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nimport { planRanges } from \"../util/plan-ranges.js\";\nimport { cancelLargeFileBestEffort } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nimport { collectPartSha1s, findResumeCandidate } from \"./resume.js\";\nasync function uploadLargeFile(raw, accountInfo, options) {\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const totalSize = options.source.size;\n const parts = planRanges(totalSize, partSize);\n const fileInfo = { ...options.fileInfo };\n const startLargeFileRequest = {\n bucketId: options.bucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {}\n };\n let largeFileId;\n let preUploaded;\n if (options.resumeFileId !== void 0) {\n largeFileId = options.resumeFileId;\n preUploaded = await collectPartSha1s(raw, accountInfo, largeFileId);\n } else if (options.resume === true) {\n const candidate = await findResumeCandidate(\n raw,\n accountInfo,\n options.bucketId,\n options.fileName\n );\n if (candidate) {\n largeFileId = candidate.fileId;\n preUploaded = candidate.uploadedPartSha1s;\n } else {\n const startResp = await raw.startLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n startLargeFileRequest\n );\n largeFileId = startResp.fileId;\n preUploaded = /* @__PURE__ */ new Map();\n }\n } else {\n const startResp = await raw.startLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n startLargeFileRequest\n );\n largeFileId = startResp.fileId;\n preUploaded = /* @__PURE__ */ new Map();\n }\n const partSha1s = new Array(parts.length);\n const tracker = new ProgressTracker(options.onProgress, totalSize, parts.length);\n const sem = new Semaphore(concurrency);\n if (!options.source.canSlice) {\n if (options.resume === true || options.resumeFileId !== void 0) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw new Error(\n \"uploadLargeFile: resume is not supported on non-sliceable sources (e.g. StreamSource).\"\n );\n }\n try {\n await uploadPartsSequentially(\n raw,\n accountInfo,\n options,\n largeFileId,\n parts,\n partSha1s,\n tracker\n );\n return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n }\n try {\n const tasks = parts.map(async (part) => {\n await sem.acquire();\n try {\n options.signal?.throwIfAborted();\n const partSource = options.source.slice(part.offset, part.offset + part.length);\n const data = new Uint8Array(await partSource.toArrayBuffer());\n const partSha1 = new IncrementalSha1();\n await partSha1.update(data);\n const sha1Hex = await partSha1.digest();\n const serverSha1 = preUploaded.get(part.partNumber);\n if (serverSha1 !== void 0 && serverSha1 === sha1Hex) {\n partSha1s[part.partNumber - 1] = serverSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n return;\n }\n let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId }\n );\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result2 = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber: part.partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(largeFileId, uploadEntry);\n partSha1s[part.partNumber - 1] = result2.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(largeFileId, uploadEntry);\n throw err;\n }\n } finally {\n sem.release();\n }\n });\n await Promise.all(tasks);\n const result = await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n return result;\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n}\nasync function uploadPartsSequentially(raw, accountInfo, options, largeFileId, parts, partSha1s, tracker) {\n const reader = options.source.stream().getReader();\n let partNumber = 1;\n let carry = null;\n try {\n for (const planned of parts) {\n options.signal?.throwIfAborted();\n const buf = new Uint8Array(planned.length);\n let filled = 0;\n if (carry !== null) {\n const take = Math.min(carry.byteLength, buf.byteLength - filled);\n buf.set(carry.subarray(0, take), filled);\n filled += take;\n carry = take < carry.byteLength ? carry.subarray(take) : null;\n }\n while (filled < buf.byteLength) {\n const { done, value } = await reader.read();\n if (done) break;\n const take = Math.min(value.byteLength, buf.byteLength - filled);\n buf.set(value.subarray(0, take), filled);\n filled += take;\n if (take < value.byteLength) {\n carry = value.subarray(take);\n }\n }\n const data = filled === buf.byteLength ? buf : buf.subarray(0, filled);\n if (data.byteLength === 0) {\n throw new Error(\n `uploadLargeFile: source stream ended before part ${partNumber}; advertised size does not match emitted bytes.`\n );\n }\n const partSha1 = new IncrementalSha1();\n await partSha1.update(data);\n const sha1Hex = await partSha1.digest();\n let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId }\n );\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber: planned.partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(largeFileId, uploadEntry);\n partSha1s[planned.partNumber - 1] = result.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(largeFileId, uploadEntry);\n throw err;\n }\n partNumber++;\n }\n } finally {\n reader.releaseLock();\n }\n}\nexport {\n uploadLargeFile\n};\n//# sourceMappingURL=large.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nasync function uploadSmallFile(raw, accountInfo, options) {\n let uploadEntry = accountInfo.checkoutUploadUrl(options.bucketId);\n if (!uploadEntry) {\n const resp = await raw.getUploadUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: options.bucketId\n });\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n const data = new Uint8Array(await options.source.toArrayBuffer());\n const sha1 = new IncrementalSha1();\n await sha1.update(data);\n const sha1Hex = await sha1.digest();\n const tracker = new ProgressTracker(options.onProgress, data.byteLength, 1);\n try {\n const result = await raw.uploadFile(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {},\n ...options.lastModifiedMillis !== void 0 ? { lastModifiedMillis: options.lastModifiedMillis } : {}\n },\n data,\n options.signal\n );\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n accountInfo.returnUploadUrl(options.bucketId, uploadEntry);\n return result;\n } catch (err) {\n accountInfo.evictUploadUrl(options.bucketId, uploadEntry);\n throw err;\n }\n}\nexport {\n uploadSmallFile\n};\n//# sourceMappingURL=single.js.map\n","function toError(value) {\n return value instanceof Error ? value : new Error(String(value));\n}\nexport {\n toError\n};\n//# sourceMappingURL=to-error.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY, DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nimport { toError } from \"../util/to-error.js\";\nimport { cancelLargeFileBestEffort } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nfunction createWriteStream(raw, accountInfo, options) {\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const tracker = new ProgressTracker(options.onProgress, null, null);\n const sem = new Semaphore(concurrency);\n let largeFileId = null;\n let startPromise = null;\n let nextPartNumber = 1;\n let pendingBytes = 0;\n const pending = [];\n const partSha1s = [];\n const inflight = [];\n let errored = null;\n const {\n promise: done,\n resolve: resolveDone,\n reject: rejectDone\n } = Promise.withResolvers();\n done.catch(() => {\n });\n function ensureStarted() {\n if (largeFileId !== null) return Promise.resolve(largeFileId);\n if (startPromise !== null) return startPromise;\n startPromise = (async () => {\n const resp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: options.bucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo: options.fileInfo ?? {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n });\n largeFileId = resp.fileId;\n return largeFileId;\n })();\n return startPromise;\n }\n async function shipPart(data, partNumber) {\n const fileId = await ensureStarted();\n const sha1 = new IncrementalSha1();\n await sha1.update(data);\n const sha1Hex = await sha1.digest();\n let uploadEntry = accountInfo.checkoutPartUploadUrl(fileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId\n });\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(fileId, uploadEntry);\n partSha1s[partNumber - 1] = result.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(fileId, uploadEntry);\n throw err;\n }\n }\n function dispatchPart() {\n if (pending.length === 0) return;\n let data;\n if (pending.length === 1) {\n const head = pending[0];\n if (!head) return;\n data = head;\n } else {\n const total = pending.reduce((sum, chunk) => sum + chunk.byteLength, 0);\n data = new Uint8Array(total);\n let offset = 0;\n for (const chunk of pending) {\n data.set(chunk, offset);\n offset += chunk.byteLength;\n }\n }\n pending.length = 0;\n pendingBytes = 0;\n const partNumber = nextPartNumber++;\n const task = (async () => {\n await sem.acquire();\n try {\n await shipPart(data, partNumber);\n } catch (err) {\n errored = toError(err);\n throw err;\n } finally {\n sem.release();\n }\n })();\n inflight.push(task);\n task.catch(() => {\n });\n }\n const writable = new WritableStream({\n async write(chunk) {\n if (errored) throw errored;\n options.signal?.throwIfAborted();\n pending.push(chunk);\n pendingBytes += chunk.byteLength;\n while (pendingBytes >= partSize) {\n const carved = carveExact(pending, partSize);\n const partNumber = nextPartNumber++;\n pendingBytes -= partSize;\n const task = (async () => {\n await sem.acquire();\n try {\n await shipPart(carved, partNumber);\n } catch (err) {\n errored = toError(err);\n throw err;\n } finally {\n sem.release();\n }\n })();\n inflight.push(task);\n task.catch(() => {\n });\n }\n },\n async close() {\n try {\n if (errored) throw errored;\n options.signal?.throwIfAborted();\n if (pendingBytes > 0) {\n dispatchPart();\n }\n await Promise.all(inflight);\n if (errored) throw errored;\n if (largeFileId === null) {\n throw new Error(\"createWriteStream closed without any data written.\");\n }\n const result = await raw.finishLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId, partSha1Array: partSha1s }\n );\n resolveDone(result);\n } catch (err) {\n const fileIdToCancel = largeFileId;\n if (fileIdToCancel !== null) {\n await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel);\n }\n rejectDone(err);\n throw err;\n }\n },\n async abort(reason) {\n const fileIdToCancel = largeFileId;\n if (fileIdToCancel !== null) {\n await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel);\n }\n rejectDone(toError(reason));\n }\n });\n return { writable, done };\n}\nfunction carveExact(chunks, size) {\n const out = new Uint8Array(size);\n let written = 0;\n while (written < size && chunks.length > 0) {\n const head = chunks[0];\n if (!head) break;\n const need = size - written;\n if (head.byteLength <= need) {\n out.set(head, written);\n written += head.byteLength;\n chunks.shift();\n } else {\n out.set(head.subarray(0, need), written);\n chunks[0] = head.subarray(need);\n written += need;\n }\n }\n return out;\n}\nexport {\n createWriteStream\n};\n//# sourceMappingURL=stream.js.map\n","import { createParallelDownloadStream } from \"./download/parallel.js\";\nimport { downloadByName, headByName, downloadById, headById } from \"./download/single.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { createWriteStream } from \"./upload/stream.js\";\nclass B2Object {\n /** The file name (path) within the bucket. */\n fileName;\n client;\n bucket;\n /**\n * @param client - The parent B2Client instance.\n * @param bucket - The parent Bucket this object belongs to.\n * @param fileName - The file path within the bucket.\n *\n * @internal\n */\n constructor(client, bucket, fileName) {\n this.client = client;\n this.bucket = bucket;\n this.fileName = fileName;\n }\n /**\n * Uploads data to this file name. Automatically uses multipart upload for large files.\n * @param options - Upload configuration including data source and optional settings.\n *\n * @returns Metadata for the uploaded file version.\n */\n async upload(options) {\n const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n const isLarge = options.source.size > recommendedPartSize;\n if (isLarge) {\n return uploadLargeFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...options\n });\n }\n const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options;\n return uploadSmallFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...smallOptions\n });\n }\n /**\n * Downloads this file by name. Pass `method: 'HEAD'` to fetch only the\n * response headers (file metadata) without streaming the body.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result with response headers and body stream.\n */\n async download(options) {\n return downloadByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.bucket.name,\n fileName: this.fileName,\n ...options\n });\n }\n /**\n * Fetches response headers for this file via HTTP HEAD. Returns a\n * body-less result so callers never have to drain the (logically\n * empty) HEAD body themselves.\n *\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal. Same shape as {@link B2Object.download}'s\n * options minus `method` (always HEAD) and `onProgress` (no body).\n *\n * @returns Parsed download headers (content type, SHA-1, file info, etc.).\n */\n async head(options) {\n return headByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.bucket.name,\n fileName: this.fileName,\n ...options\n });\n }\n /**\n * Downloads a specific version of this file by ID. Pass `method: 'HEAD'`\n * to fetch only the response headers (file metadata) without streaming the body.\n * @param fileId - The file version ID to download.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result with response headers and body stream.\n */\n async downloadById(fileId, options) {\n return downloadById(this.client.raw, this.client.accountInfo, {\n fileId,\n ...options\n });\n }\n /**\n * Fetches response headers for a specific version of this file by ID\n * via HTTP HEAD. Returns a body-less result so callers never have to\n * drain the (logically empty) HEAD body themselves.\n *\n * @param fileId - The file version ID to inspect.\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal.\n *\n * @returns Parsed download headers.\n */\n async headById(fileId, options) {\n return headById(this.client.raw, this.client.accountInfo, {\n fileId,\n ...options\n });\n }\n /**\n * Creates a parallel-download ReadableStream that fetches the file in concurrent ranged chunks.\n * @param fileId - The file version ID to download.\n * @param totalSize - Total file size in bytes (needed to compute range boundaries).\n * @param options - Concurrency, range size, and abort signal.\n *\n * @returns A Web ReadableStream of file data in sequential order.\n */\n createReadStream(fileId, totalSize, options) {\n return createParallelDownloadStream(this.client.raw, this.client.accountInfo, {\n fileId,\n totalSize,\n ...options\n });\n }\n /**\n * Creates a Web `WritableStream` that uploads streamed data into this file\n * using the multipart protocol. Pipe a `ReadableStream` into the\n * returned `writable` and await `done` to get the final {@link FileVersion}.\n *\n * Note: streaming uploads do not support resume because the size and per-part\n * hashes are not known in advance. Use {@link upload} with a buffered source\n * when resume is required.\n *\n * @param options - Streaming upload parameters (part size, concurrency, encryption).\n *\n * @returns A handle with the writable sink and a completion promise.\n */\n createWriteStream(options) {\n return createWriteStream(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...options ?? {}\n });\n }\n /**\n * Retrieves metadata for a specific file version.\n * @param fileId - The file version ID to look up.\n *\n * @returns The file version metadata.\n */\n async getFileInfo(fileId) {\n return this.client.raw.getFileInfo(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileId }\n );\n }\n /**\n * Hides this file by creating a hide marker at this file name.\n *\n * @returns Metadata for the newly created hide marker.\n */\n async hide() {\n return this.bucket.hideFile(this.fileName);\n }\n /**\n * Permanently deletes a specific version of this file.\n * @param fileId - The unique identifier of the file version to delete.\n */\n async deleteVersion(fileId) {\n await this.bucket.deleteFileVersion(this.fileName, fileId);\n }\n /**\n * Sets or updates the Object Lock retention policy on a specific file\n * version of this file.\n *\n * The bucket must have Object Lock enabled (`fileLockEnabled: true` at\n * creation time). Governance-mode retention can be shortened or removed\n * by passing `bypassGovernance: true` together with an application key\n * that carries the `bypassGovernance` capability; compliance-mode\n * retention cannot be shortened by anyone until the\n * `retainUntilTimestamp` elapses.\n *\n * @param fileId - The file version to apply the policy to.\n * @param retention - The retention policy to apply.\n * @param options - Optional flag for shortening governance-mode retention.\n *\n * @returns Metadata for the updated file version.\n */\n async setRetention(fileId, retention, options) {\n return this.bucket.updateFileRetention(this.fileName, fileId, retention, options);\n }\n /**\n * Toggles the legal hold flag on a specific file version of this file.\n *\n * Legal hold is independent of retention: a file can be on legal hold\n * without any retention policy, and vice versa. The bucket must have\n * Object Lock enabled, and any caller must hold the `writeFileLegalHolds`\n * capability.\n *\n * @param fileId - The file version to apply the flag to.\n * @param legalHold - `'on'` to apply the hold, `'off'` to remove it.\n *\n * @returns Metadata for the updated file version.\n */\n async setLegalHold(fileId, legalHold) {\n return this.bucket.updateFileLegalHold(this.fileName, fileId, legalHold);\n }\n}\nexport {\n B2Object\n};\n//# sourceMappingURL=object.js.map\n","async function* paginatePages(fetcher, signal) {\n let cursor;\n while (true) {\n signal?.throwIfAborted();\n const { page, nextCursor } = await fetcher(cursor);\n yield page;\n if (nextCursor === void 0) return;\n cursor = nextCursor;\n }\n}\nasync function* paginateItems(fetcher, extractItems, signal) {\n for await (const page of paginatePages(fetcher, signal)) {\n yield* extractItems(page);\n }\n}\nexport {\n paginateItems,\n paginatePages\n};\n//# sourceMappingURL=paginator.js.map\n","import { copyLargeFile } from \"./copy/large.js\";\nimport { downloadByName, headByName } from \"./download/single.js\";\nimport { B2Object } from \"./object.js\";\nimport { accountId } from \"./types/ids.js\";\nimport { Semaphore } from \"./upload/concurrency.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { DEFAULT_PAGE_SIZE, DEFAULT_BULK_CONCURRENCY } from \"./util/defaults.js\";\nimport { paginateItems } from \"./util/paginator.js\";\nimport { toError } from \"./util/to-error.js\";\nclass Bucket {\n /** Unique identifier for this bucket. */\n id;\n /** Human-readable bucket name. */\n name;\n /** Full bucket metadata as returned by the B2 API. */\n info;\n client;\n /**\n * @param client - The parent B2Client instance.\n * @param info - The bucket metadata from the API.\n *\n * @internal\n */\n constructor(client, info) {\n this.client = client;\n this.info = info;\n this.id = info.bucketId;\n this.name = info.bucketName;\n }\n /**\n * Returns a {@link B2Object} handle for a specific file name in this bucket.\n * @param fileName - The file path within the bucket.\n *\n * @returns A B2Object handle bound to this bucket and file name.\n */\n file(fileName) {\n return new B2Object(this.client, this, fileName);\n }\n /**\n * Uploads a file to this bucket. Automatically uses multipart upload for files\n * larger than the recommended part size.\n * @param options - Upload configuration including file name, source data, and optional settings.\n *\n * @returns Metadata for the uploaded file version.\n */\n async upload(options) {\n const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n const isLarge = options.source.size > recommendedPartSize;\n if (isLarge) {\n return uploadLargeFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.id,\n ...options\n });\n }\n const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options;\n return uploadSmallFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.id,\n ...smallOptions\n });\n }\n /**\n * Downloads a file from this bucket by name. Pass `method: 'HEAD'` in\n * `options` to fetch only the response headers (file metadata) without\n * streaming the body.\n * @param fileName - The file name (path) to download.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result containing response headers and a readable body stream.\n */\n async download(fileName, options) {\n return downloadByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.name,\n fileName,\n ...options\n });\n }\n /**\n * Fetches the response headers (file metadata) for a file via HTTP\n * HEAD. Returns a body-less result so callers never have to drain\n * the (logically empty) HEAD body themselves.\n *\n * Use this for metadata-only checks like \"does this file exist\", \"what\n * is its current SHA-1\", \"what is its Content-Length\". For full file\n * retrieval use {@link Bucket.download}.\n *\n * @param fileName - The file name (path) to inspect.\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal. Same shape as {@link Bucket.download}'s\n * options minus `method` (always HEAD) and `onProgress` (no body).\n *\n * @returns Parsed download headers (content type, SHA-1, file info, etc.).\n *\n * @example\n * ```ts\n * const { headers } = await bucket.head('photos/2026/sunset.jpg')\n * console.log(headers.contentLength, headers.contentSha1)\n * ```\n */\n async head(fileName, options) {\n return headByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.name,\n fileName,\n ...options\n });\n }\n /**\n * Lists file names in this bucket (most recent versions only).\n * @param options - Optional filtering and pagination settings.\n *\n * @returns A page of file versions with an optional continuation token.\n */\n async listFileNames(options) {\n return this.client.raw.listFileNames(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n }\n );\n }\n /**\n * Lists all file versions in this bucket, including hidden files.\n * @param options - Optional filtering and pagination settings.\n *\n * @returns A page of file versions with an optional continuation token.\n */\n async listFileVersions(options) {\n return this.client.raw.listFileVersions(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n }\n );\n }\n /**\n * Async iterator that yields the latest visible version of every file in\n * the bucket, automatically handling pagination via `listFileNames`.\n *\n * Hidden files (those whose latest version is a hide marker) are NOT\n * yielded by this iterator. Use {@link paginateFileVersions} when you\n * need full version history.\n *\n * @param options - Filter + pagination + abort options. `pageSize` is\n * forwarded to `b2_list_file_names`'s `maxFileCount` (default 1000,\n * B2-capped at 10000).\n *\n * @returns An async iterable of {@link FileVersion} entries.\n *\n * @example\n * ```ts\n * for await (const file of bucket.paginateFileNames({ prefix: 'photos/' })) {\n * console.log(file.fileName, file.contentLength)\n * }\n * ```\n */\n paginateFileNames(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listFileNames({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startFileName: cursor } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n });\n return { page: resp, nextCursor: resp.nextFileName ?? void 0 };\n },\n // Real B2 surfaces hide markers as rows in `b2_list_file_names`. This\n // iterator's documented contract is \"latest VISIBLE version\", so we\n // drop hide-action rows here. Callers who need full history should\n // use `paginateFileVersions`.\n (page) => page.files.filter((f) => f.action !== \"hide\"),\n options?.signal\n );\n }\n /**\n * Async iterator that yields every version of every file in the bucket,\n * including hidden files and historical versions, automatically handling\n * pagination via `listFileVersions`.\n *\n * The two-cursor `(nextFileName, nextFileId)` continuation that the raw\n * endpoint exposes is threaded internally; callers iterate flat.\n *\n * @param options - Filter + pagination + abort options.\n *\n * @returns An async iterable of {@link FileVersion} entries.\n */\n paginateFileVersions(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listFileVersions({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startFileName: cursor.fileName } : {},\n ...cursor?.fileId !== void 0 ? { startFileId: cursor.fileId } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n });\n const nextCursor = resp.nextFileName !== null ? { fileName: resp.nextFileName, fileId: resp.nextFileId ?? void 0 } : void 0;\n return { page: resp, nextCursor };\n },\n (page) => page.files,\n options?.signal\n );\n }\n /**\n * Async iterator that yields every unfinished large file in the bucket,\n * automatically handling pagination via `listUnfinishedLargeFiles`.\n *\n * Useful for janitorial scripts that want to inspect or cancel abandoned\n * multipart uploads (typically followed by {@link cancelLargeFile} on\n * the underlying raw client).\n *\n * @param options - Filter + pagination + abort options. `pageSize` is\n * B2-capped at 100 for this endpoint.\n *\n * @returns An async iterable of unfinished-large-file metadata entries.\n */\n paginateUnfinishedLargeFiles(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listUnfinishedLargeFiles({\n pageSize: options?.pageSize ?? 100,\n ...cursor !== void 0 ? { startFileId: cursor } : {},\n ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {}\n });\n return { page: resp, nextCursor: resp.nextFileId ?? void 0 };\n },\n (page) => page.files,\n options?.signal\n );\n }\n /**\n * Async iterator that yields every uploaded part for a specific large\n * file, automatically handling pagination via `listParts`.\n *\n * @param largeFileId - The unfinished large file to enumerate parts of.\n * @param options - Pagination + abort options. `pageSize` is B2-capped\n * at 1000 for this endpoint; the default is 1000.\n *\n * @returns An async iterable of {@link PartInfo} entries.\n */\n paginateParts(largeFileId, options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.client.raw.listParts(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileId: largeFileId,\n maxPartCount: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startPartNumber: cursor } : {}\n }\n );\n return { page: resp, nextCursor: resp.nextPartNumber ?? void 0 };\n },\n (page) => page.parts,\n options?.signal\n );\n }\n /**\n * Looks up the latest visible version of a file by name.\n * Uses `listFileNames` under the hood; returns `null` when the file does not\n * exist or its latest version is a hide marker.\n * @param fileName - The exact file path to look up.\n *\n * @returns The latest {@link FileVersion}, or `null` if not found.\n */\n async getFileInfoByName(fileName) {\n const resp = await this.listFileNames({ prefix: fileName, pageSize: 1 });\n const match = resp.files.find((f) => f.fileName === fileName);\n if (!match || match.action === \"hide\") return null;\n return match;\n }\n /**\n * Removes the latest hide marker for a file, restoring visibility of the\n * previous upload. Returns the deleted hide marker, or `null` if there was\n * no hide marker to remove (file is already visible or does not exist).\n * @param fileName - The file path to unhide.\n *\n * @returns The deleted hide marker version, or `null` if nothing was hidden.\n */\n async unhideFile(fileName) {\n const resp = await this.listFileVersions({ prefix: fileName, pageSize: 100 });\n const versions = resp.files.filter((f) => f.fileName === fileName);\n if (versions.length === 0) return null;\n const latest = versions[0];\n if (!latest || latest.action !== \"hide\") return null;\n await this.deleteFileVersion(fileName, latest.fileId);\n return latest;\n }\n /**\n * Hides a file by creating a hide marker. The file remains in version history but is no longer visible in `listFileNames`.\n * @param fileName - The file path to hide.\n *\n * @returns Metadata for the newly created hide marker.\n */\n async hideFile(fileName) {\n return this.client.raw.hideFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, fileName }\n );\n }\n /**\n * Permanently deletes a specific file version. Both file name and file ID are required.\n *\n * If the file is under Object Lock retention, B2 will reject the\n * delete: compliance-mode files cannot be deleted until the retention\n * expires; governance-mode files require `bypassGovernance: true`\n * AND a calling key with the `bypassGovernance` capability. Files on\n * legal hold cannot be deleted by anyone until the hold is removed.\n *\n * @param fileName - The file path of the version to delete.\n * @param fileId - The unique identifier of the file version to delete.\n * @param options - Optional flag for bypassing governance retention.\n */\n async deleteFileVersion(fileName, fileId, options) {\n await this.client.raw.deleteFileVersion(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileName,\n fileId,\n ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n }\n );\n }\n /**\n * Cancels an in-progress large file upload so the partial parts are not\n * retained or billed. The most common reason to call this is to clean up\n * abandoned multipart uploads surfaced by {@link listUnfinishedLargeFiles}.\n * @param fileId - The unique identifier of the unfinished large file to cancel.\n *\n * @returns Metadata about the cancelled large file.\n */\n async cancelLargeFile(fileId) {\n return this.client.raw.cancelLargeFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileId }\n );\n }\n /**\n * Lists large files in this bucket that were started but never finished or\n * cancelled. Wraps `b2_list_unfinished_large_files`.\n * @param options - Optional pagination filters.\n *\n * @returns The page of unfinished large files plus a continuation token.\n */\n async listUnfinishedLargeFiles(options) {\n return this.client.raw.listUnfinishedLargeFiles(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},\n ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}\n }\n );\n }\n /**\n * Deletes many file versions with bounded concurrency. Errors from individual\n * deletes are collected and returned rather than thrown, so partial success\n * does not abort the run.\n *\n * When `options.signal` is supplied and aborted, in-flight deletes\n * complete (they're already on the wire), but no new deletes start\n * after the abort fires. Subsequent targets are short-circuited to an\n * error entry so the result tally reflects what actually happened.\n * @param targets - File versions to delete.\n * @param options - Optional concurrency override and abort signal.\n * Concurrency defaults to the SDK-wide bulk-metadata setting\n * (currently 10, higher than transfer concurrency because each\n * task is a single tiny API round-trip).\n *\n * @returns A summary of successes and per-target errors.\n */\n async deleteMany(targets, options) {\n const concurrency = options?.concurrency ?? DEFAULT_BULK_CONCURRENCY;\n const sem = new Semaphore(concurrency);\n const signal = options?.signal;\n let deleted = 0;\n const errors = [];\n await Promise.all(\n targets.map(async (target) => {\n await sem.acquire();\n try {\n if (signal?.aborted) {\n errors.push({\n target,\n error: toError(signal.reason ?? \"aborted\")\n });\n return;\n }\n await this.deleteFileVersion(target.fileName, target.fileId);\n deleted++;\n } catch (err) {\n errors.push({\n target,\n error: toError(err)\n });\n } finally {\n sem.release();\n }\n })\n );\n return { deleted, errors };\n }\n /**\n * Async generator that streams every file version in the bucket (optionally\n * filtered by prefix) and deletes each one. Yields a {@link DeleteAllEvent}\n * per file version. With `dryRun: true`, no deletes are performed but `skip`\n * events are still emitted.\n * @param options - Optional prefix filter, page size, and dry-run flag.\n *\n * @returns An async generator of per-file events.\n */\n async *deleteAll(options) {\n const dryRun = options?.dryRun ?? false;\n const pageSize = options?.pageSize ?? DEFAULT_PAGE_SIZE;\n let startFileName;\n let startFileId;\n while (true) {\n const page = await this.listFileVersions({\n pageSize,\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...startFileName !== void 0 ? { startFileName } : {},\n ...startFileId !== void 0 ? { startFileId } : {}\n });\n for (const version of page.files) {\n if (dryRun) {\n yield { type: \"skip\", fileName: version.fileName, fileId: version.fileId };\n continue;\n }\n try {\n await this.deleteFileVersion(version.fileName, version.fileId);\n yield { type: \"delete\", fileName: version.fileName, fileId: version.fileId };\n } catch (err) {\n yield {\n type: \"error\",\n fileName: version.fileName,\n fileId: version.fileId,\n message: toError(err).message\n };\n }\n }\n if (!page.nextFileName) break;\n startFileName = page.nextFileName;\n startFileId = page.nextFileId ?? void 0;\n }\n }\n /**\n * Creates a server-side copy of a file within or across buckets.\n * @param options - Copy configuration including source file ID and destination name.\n *\n * @returns Metadata for the newly created file version.\n */\n async copyFile(options) {\n return this.client.raw.copyFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n options\n );\n }\n /**\n * Copies a file via the server-side multipart protocol. Each part is copied\n * by reference through `b2_copy_part`; data never traverses the client. Falls\n * back to a single `copyFile` call when the source fits within a single part.\n * @param options - Copy parameters including source file ID, destination name, part size, and concurrency.\n *\n * @returns Metadata for the newly created destination file version.\n */\n async copyLargeFile(options) {\n return copyLargeFile(this.client.raw, this.client.accountInfo, {\n sourceFileId: options.sourceFileId,\n fileName: options.fileName,\n ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : { destinationBucketId: this.id },\n ...options.contentType !== void 0 ? { contentType: options.contentType } : {},\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n ...options.partSize !== void 0 ? { partSize: options.partSize } : {},\n ...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {},\n ...options.signal !== void 0 ? { signal: options.signal } : {}\n });\n }\n /**\n * Updates bucket settings such as type, CORS, lifecycle rules, and encryption.\n * @param options - Fields to update. Omitted fields are left unchanged.\n *\n * @returns Updated bucket metadata.\n */\n async update(options) {\n return this.client.raw.updateBucket(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n accountId: accountId(this.client.accountInfo.getAccountId()),\n bucketId: this.id,\n ...options\n }\n );\n }\n /**\n * Permanently deletes this bucket. The bucket must be empty (no file versions).\n *\n * @returns The deleted bucket metadata.\n */\n async delete() {\n return this.client.deleteBucket(this.id);\n }\n /**\n * Gets a download authorization token scoped to a file name prefix in this bucket.\n * @param fileNamePrefix - Only authorize downloads of files starting with this prefix.\n * @param validDurationInSeconds - How long the authorization is valid (1-604800 seconds).\n *\n * @returns The download authorization response containing a time-limited token.\n */\n async getDownloadAuthorization(fileNamePrefix, validDurationInSeconds) {\n return this.client.raw.getDownloadAuthorization(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, fileNamePrefix, validDurationInSeconds }\n );\n }\n /**\n * Gets the event notification rules configured for this bucket.\n *\n * @returns The current notification rules for this bucket.\n */\n async getNotificationRules() {\n return this.client.raw.getBucketNotificationRules(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id }\n );\n }\n /**\n * Replaces the event notification rules for this bucket.\n * @param rules - The new set of notification rules to apply.\n *\n * @returns The updated notification rules for this bucket.\n */\n async setNotificationRules(rules) {\n return this.client.raw.setBucketNotificationRules(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, eventNotificationRules: rules }\n );\n }\n /**\n * Updates the file retention policy for a specific file version. Requires file lock on the bucket.\n * @param fileName - The file path of the version to update.\n * @param fileId - The unique identifier of the file version.\n * @param retention - The new retention policy to apply.\n * @param options - Optional flags. Set `bypassGovernance: true` to shorten governance-mode retention.\n *\n * @returns The updated file retention metadata.\n */\n async updateFileRetention(fileName, fileId, retention, options) {\n return this.client.raw.updateFileRetention(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileName,\n fileId,\n fileRetention: retention,\n ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n }\n );\n }\n /**\n * Updates the legal hold status for a specific file version. Requires file lock on the bucket.\n * @param fileName - The file path of the version to update.\n * @param fileId - The unique identifier of the file version.\n * @param legalHold - The new legal hold status to apply.\n *\n * @returns The updated legal hold metadata.\n */\n async updateFileLegalHold(fileName, fileId, legalHold) {\n return this.client.raw.updateFileLegalHold(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileName, fileId, legalHold }\n );\n }\n /**\n * Refetches this bucket's metadata from B2 so callers operating on\n * replication / lifecycle / retention configuration always start from the\n * server-of-record state.\n *\n * Bucket configuration is monotonically revisioned by B2: B2 increments\n * `revision` on every accepted update. The local {@link info} snapshot\n * captured at construction time goes stale as soon as anyone else (or any\n * prior `update()` call) mutates the bucket, so the ergonomic\n * add/remove helpers below always refresh before composing the next\n * `setX()` call. The result is that each helper is safe to call without\n * the caller having to thread BucketInfo through their code.\n *\n * @returns Fresh {@link BucketInfo} for this bucket.\n *\n * @throws If the bucket no longer exists.\n */\n async refresh() {\n const fresh = await this.client.listBuckets({ bucketId: this.id });\n const found = fresh[0];\n if (!found) throw new Error(`Bucket ${this.id} not found`);\n return found.info;\n }\n /**\n * Returns the current cross-region replication configuration, refetched\n * from B2.\n *\n * Use this when you need to read replication state without composing a\n * write. For add/remove flows the helper methods below handle the\n * refresh-then-set sequence for you.\n *\n * @returns The current {@link ReplicationConfiguration}.\n */\n async getReplication() {\n const fresh = await this.refresh();\n return fresh.replicationConfiguration;\n }\n /**\n * Replaces this bucket's complete replication configuration.\n * @param replication - The new configuration. Pass an empty source/destination\n * pair (`{ asReplicationSource: null, asReplicationDestination: null }`)\n * to clear replication entirely.\n *\n * @returns The updated bucket metadata.\n */\n async setReplication(replication) {\n return this.update({ replicationConfiguration: replication });\n }\n /**\n * Adds (or replaces by `replicationRuleName`) a single replication rule\n * on this bucket while leaving any other rules, the source key, and the\n * destination key mapping untouched.\n *\n * When this is the very first source-side rule, `sourceApplicationKeyId`\n * must be supplied to seed `asReplicationSource.sourceApplicationKeyId`;\n * for subsequent calls the existing source key is reused unless the\n * caller explicitly overrides it.\n *\n * @param rule - The replication rule to add or replace.\n * @param options - Optional source application key ID override (or seed\n * when no source side exists yet).\n *\n * @returns The updated bucket metadata.\n *\n * @throws If no source-side replication exists yet and the caller did\n * not supply `sourceApplicationKeyId`.\n */\n async addReplicationRule(rule, options) {\n const current = (await this.refresh()).replicationConfiguration;\n const existingSource = current.asReplicationSource;\n const sourceKey = options?.sourceApplicationKeyId ?? existingSource?.sourceApplicationKeyId;\n if (!sourceKey) {\n throw new Error(\n \"addReplicationRule: no existing source-side replication; pass options.sourceApplicationKeyId\"\n );\n }\n const existingRules = existingSource?.replicationRules ?? [];\n const without = existingRules.filter((r) => r.replicationRuleName !== rule.replicationRuleName);\n return this.setReplication({\n asReplicationSource: {\n sourceApplicationKeyId: sourceKey,\n replicationRules: [...without, rule]\n },\n asReplicationDestination: current.asReplicationDestination\n });\n }\n /**\n * Removes a single replication rule by name. No-ops cleanly when the rule\n * is not present (returns the unchanged-but-revision-bumped bucket info).\n *\n * @param replicationRuleName - Name of the rule to remove.\n *\n * @returns The updated bucket metadata.\n */\n async removeReplicationRule(replicationRuleName) {\n const current = (await this.refresh()).replicationConfiguration;\n const existingSource = current.asReplicationSource;\n if (!existingSource) {\n return this.setReplication(current);\n }\n const filtered = existingSource.replicationRules.filter(\n (r) => r.replicationRuleName !== replicationRuleName\n );\n return this.setReplication({\n asReplicationSource: {\n sourceApplicationKeyId: existingSource.sourceApplicationKeyId,\n replicationRules: filtered\n },\n asReplicationDestination: current.asReplicationDestination\n });\n }\n /**\n * Returns the current lifecycle rules for this bucket, refetched from B2.\n *\n * @returns The current array of {@link LifecycleRule}s.\n */\n async getLifecycleRules() {\n const fresh = await this.refresh();\n return fresh.lifecycleRules;\n }\n /**\n * Replaces this bucket's lifecycle rules in their entirety.\n * @param rules - The new rule set. Pass `[]` to remove all lifecycle\n * automation.\n *\n * @returns The updated bucket metadata.\n */\n async setLifecycleRules(rules) {\n return this.update({ lifecycleRules: [...rules] });\n }\n /**\n * Adds (or replaces, matched by `fileNamePrefix`) a single lifecycle rule\n * while leaving any other rules untouched.\n *\n * Matching on prefix mirrors B2's own data model: each unique prefix can\n * have at most one rule, and a `b2_update_bucket` call that contains two\n * rules with the same prefix is rejected. The helper enforces this for\n * the caller.\n *\n * @param rule - The lifecycle rule to add or replace.\n *\n * @returns The updated bucket metadata.\n */\n async addLifecycleRule(rule) {\n const current = await this.getLifecycleRules();\n const without = current.filter((r) => r.fileNamePrefix !== rule.fileNamePrefix);\n return this.setLifecycleRules([...without, rule]);\n }\n /**\n * Removes a single lifecycle rule by prefix. No-ops cleanly when the rule\n * is not present.\n *\n * @param fileNamePrefix - The prefix of the rule to remove.\n *\n * @returns The updated bucket metadata.\n */\n async removeLifecycleRule(fileNamePrefix) {\n const current = await this.getLifecycleRules();\n return this.setLifecycleRules(current.filter((r) => r.fileNamePrefix !== fileNamePrefix));\n }\n /**\n * Returns the current default Object Lock retention policy for new\n * uploads to this bucket, refetched from B2.\n *\n * @returns The default {@link BucketRetentionPolicy} (which may be\n * `{ mode: 'none', period: null }` when Object Lock is enabled on the\n * bucket but no default is set).\n */\n async getDefaultRetention() {\n const fresh = await this.refresh();\n return fresh.defaultRetention;\n }\n /**\n * Sets (or clears, by passing `{ mode: 'none', period: null }`) the\n * default Object Lock retention policy applied to new uploads.\n *\n * Object Lock must already be enabled on the bucket. Buckets created\n * without `fileLockEnabled: true` cannot accept a default retention\n * policy and B2 will reject this call.\n *\n * @param policy - The new default retention policy.\n *\n * @returns The updated bucket metadata.\n */\n async setDefaultRetention(policy) {\n return this.update({ defaultRetention: policy });\n }\n}\nexport {\n Bucket\n};\n//# sourceMappingURL=bucket.js.map\n","class B2Error extends Error {\n /** HTTP status code returned by the B2 API. */\n status;\n /** B2 error code identifying the error type (e.g. `expired_auth_token`). */\n code;\n /** B2 request ID from the `X-Bz-Request-Id` response header, if present. */\n requestId;\n /** Retry delay in seconds from the `Retry-After` response header, if present. */\n retryAfter;\n /** Whether this error is transient and the request can be retried. */\n retryable;\n /**\n * Creates a new B2Error instance.\n * @param response - Parsed B2 error response body.\n * @param options - Optional retry and request metadata from response headers.\n */\n constructor(response, options) {\n super(response.message);\n this.name = \"B2Error\";\n this.status = response.status;\n this.code = response.code;\n if (options?.retryAfter !== void 0) this.retryAfter = options.retryAfter;\n if (options?.requestId !== void 0) this.requestId = options.requestId;\n this.retryable = isTransient(response.status, response.code);\n }\n}\nclass ExpiredAuthTokenError extends B2Error {\n /**\n * Creates a new ExpiredAuthTokenError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ExpiredAuthTokenError\";\n }\n}\nclass BadAuthTokenError extends B2Error {\n /**\n * Creates a new BadAuthTokenError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadAuthTokenError\";\n }\n}\nclass ServiceUnavailableError extends B2Error {\n /**\n * Creates a new ServiceUnavailableError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ServiceUnavailableError\";\n }\n}\nclass RequestTimeoutError extends B2Error {\n /**\n * Creates a new RequestTimeoutError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"RequestTimeoutError\";\n }\n}\nclass TooManyRequestsError extends B2Error {\n /**\n * Creates a new TooManyRequestsError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"TooManyRequestsError\";\n }\n}\nclass CapExceededError extends B2Error {\n /**\n * Creates a new CapExceededError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"CapExceededError\";\n }\n}\nclass AccessDeniedError extends B2Error {\n /**\n * Creates a new AccessDeniedError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"AccessDeniedError\";\n }\n}\nclass FileNotPresentError extends B2Error {\n /**\n * Creates a new FileNotPresentError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"FileNotPresentError\";\n }\n}\nclass DuplicateBucketNameError extends B2Error {\n /**\n * Creates a new DuplicateBucketNameError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"DuplicateBucketNameError\";\n }\n}\nclass BadRequestError extends B2Error {\n /**\n * Creates a new BadRequestError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadRequestError\";\n }\n}\nclass BadUploadUrlError extends B2Error {\n /**\n * Creates a new BadUploadUrlError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadUploadUrlError\";\n }\n}\nclass ChecksumMismatchError extends B2Error {\n /**\n * Creates a new ChecksumMismatchError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ChecksumMismatchError\";\n }\n}\nclass B2InsufficientCapabilityError extends Error {\n /** Capabilities that were required for the operation. */\n required;\n /** Capabilities that the current key actually has. */\n available;\n /** Capabilities present in `required` but not in `available`. */\n missing;\n /**\n * Creates a new B2InsufficientCapabilityError instance.\n *\n * @param required - Capabilities the operation requires.\n * @param available - Capabilities the current key holds.\n * @param missing - The subset of required that isn't available.\n */\n constructor(required, available, missing) {\n super(`Application key is missing capabilities: ${missing.join(\", \")}`);\n this.name = \"B2InsufficientCapabilityError\";\n this.required = required;\n this.available = available;\n this.missing = missing;\n }\n}\nclass B2SsrfError extends Error {\n /**\n * Creates a new {@link B2SsrfError}.\n *\n * @param message - Human-readable description of which URL was rejected and why.\n * @param url - The full URL that was rejected.\n */\n constructor(message, url) {\n super(message);\n this.url = url;\n this.name = \"B2SsrfError\";\n }\n /** Always `false` — this is a security failure, not transient. */\n retryable = false;\n}\nclass NetworkError extends Error {\n /**\n * Creates a new NetworkError instance.\n * @param message - Human-readable description of the network failure.\n * @param cause - The underlying error that caused this failure, if any.\n */\n constructor(message, cause) {\n super(message);\n this.cause = cause;\n this.name = \"NetworkError\";\n }\n /** Always `true` since network errors are transient. */\n retryable = true;\n}\nfunction isTransient(status, code) {\n if (status === 408 || status === 429 || status === 503) return true;\n if (code === \"expired_auth_token\") return true;\n if (code === \"service_unavailable\" || code === \"request_timeout\") return true;\n return false;\n}\nfunction classifyError(response, options) {\n switch (response.code) {\n case \"expired_auth_token\":\n return new ExpiredAuthTokenError(response, options);\n case \"bad_auth_token\":\n case \"unauthorized\":\n return new BadAuthTokenError(response, options);\n case \"service_unavailable\":\n return new ServiceUnavailableError(response, options);\n case \"request_timeout\":\n return new RequestTimeoutError(response, options);\n case \"cap_exceeded\":\n case \"storage_cap_exceeded\":\n case \"transaction_cap_exceeded\":\n case \"download_cap_exceeded\":\n return new CapExceededError(response, options);\n case \"access_denied\":\n return new AccessDeniedError(response, options);\n case \"file_not_present\":\n case \"no_such_file\":\n return new FileNotPresentError(response, options);\n case \"duplicate_bucket_name\":\n return new DuplicateBucketNameError(response, options);\n case \"bad_sha1_checksum\":\n return new ChecksumMismatchError(response, options);\n case \"bad_request\":\n return new BadRequestError(response, options);\n }\n if (response.status === 429) return new TooManyRequestsError(response, options);\n if (response.status === 503) return new ServiceUnavailableError(response, options);\n if (response.status === 408) return new RequestTimeoutError(response, options);\n return new B2Error(response, options);\n}\nexport {\n AccessDeniedError,\n B2Error,\n B2InsufficientCapabilityError,\n B2SsrfError,\n BadAuthTokenError,\n BadRequestError,\n BadUploadUrlError,\n CapExceededError,\n ChecksumMismatchError,\n DuplicateBucketNameError,\n ExpiredAuthTokenError,\n FileNotPresentError,\n NetworkError,\n RequestTimeoutError,\n ServiceUnavailableError,\n TooManyRequestsError,\n classifyError\n};\n//# sourceMappingURL=index.js.map\n","import { B2SsrfError } from \"../errors/index.js\";\nclass UrlGuard {\n allowedSuffixes = [];\n /**\n * Lock the guard to the given host suffixes. A suffix matches a host\n * either exactly or as a `*.suffix` subdomain. For example,\n * `backblazeb2.com` allows `api.backblazeb2.com` and\n * `s3.us-west-004.backblazeb2.com`.\n *\n * Passing an empty array disables the guard (used by the simulator and\n * other test setups). Production code should always lock the guard after\n * a successful `b2_authorize_account`.\n *\n * @param suffixes - Allowed host suffixes.\n */\n setAllowedSuffixes(suffixes) {\n this.allowedSuffixes = suffixes;\n }\n /**\n * Returns the current allowed-suffix list (for tests and diagnostics).\n *\n * @returns The currently-configured list of allowed host suffixes.\n */\n getAllowedSuffixes() {\n return this.allowedSuffixes;\n }\n /**\n * Validate `rawUrl` against the allow-list. Throws {@link B2SsrfError} if\n * the URL points at a literal IP, a known-internal hostname, or a host\n * outside the allowed suffixes. Permissive (no-op) when no suffixes have\n * been configured yet.\n *\n * @param rawUrl - The URL the caller is about to fetch.\n *\n * @throws A `B2SsrfError` when the URL is rejected.\n */\n check(rawUrl) {\n if (this.allowedSuffixes.length === 0) return;\n let parsed;\n try {\n parsed = new URL(rawUrl);\n } catch {\n throw new B2SsrfError(`malformed URL rejected by SSRF guard: ${rawUrl}`, rawUrl);\n }\n const host = parsed.hostname.toLowerCase();\n if (isLiteralIp(host)) {\n throw new B2SsrfError(\n `literal IP host not allowed by SSRF guard (use a hostname): ${host}`,\n rawUrl\n );\n }\n if (isInternalHostname(host)) {\n throw new B2SsrfError(`internal hostname not allowed by SSRF guard: ${host}`, rawUrl);\n }\n for (const suffix of this.allowedSuffixes) {\n const lowered = suffix.toLowerCase();\n if (host === lowered || host.endsWith(`.${lowered}`)) return;\n }\n throw new B2SsrfError(\n `host outside allowed B2 realm: ${host} (allowed suffixes: ${this.allowedSuffixes.join(\", \")})`,\n rawUrl\n );\n }\n}\nfunction deriveAllowedSuffixes(storageApi) {\n const suffixes = /* @__PURE__ */ new Set([\"backblaze.com\"]);\n for (const url of [storageApi.apiUrl, storageApi.downloadUrl, storageApi.s3ApiUrl]) {\n try {\n const host = new URL(url).hostname;\n const parts = host.split(\".\");\n if (parts.length >= 2) {\n suffixes.add(parts.slice(-2).join(\".\"));\n }\n } catch {\n }\n }\n return Array.from(suffixes).sort();\n}\nfunction isLiteralIp(host) {\n if (/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/.test(host)) return true;\n if (host.includes(\":\")) return true;\n return false;\n}\nfunction isInternalHostname(host) {\n if (host === \"localhost\") return true;\n if (host.endsWith(\".localhost\")) return true;\n if (host === \"metadata\") return true;\n if (host === \"metadata.google.internal\") return true;\n if (host.endsWith(\".internal\")) return true;\n if (host.endsWith(\".local\")) return true;\n return false;\n}\nexport {\n UrlGuard,\n deriveAllowedSuffixes\n};\n//# sourceMappingURL=url-guard.js.map\n","const version = \"0.1.0\";\nconst pkg = {\n version\n};\nexport {\n pkg as default,\n version\n};\n//# sourceMappingURL=package.json.js.map\n","import pkg from \"./package.json.js\";\nconst VERSION = pkg.version;\nexport {\n VERSION\n};\n//# sourceMappingURL=version.js.map\n","import { VERSION } from \"../version.js\";\nconst SDK_PRODUCT = \"b2-sdk-typescript\";\nconst SDK_PACKAGE = \"@backblaze-labs/b2-sdk\";\nfunction detectPlatform() {\n const g = globalThis;\n if (typeof g[\"Deno\"] !== \"undefined\") {\n const deno = g[\"Deno\"];\n return {\n runtime: deno.version?.deno ? `deno/${deno.version.deno}` : \"deno\",\n os: deno.build?.os,\n arch: deno.build?.arch\n };\n }\n if (typeof g[\"Bun\"] !== \"undefined\") {\n const bun = g[\"Bun\"];\n const proc = g[\"process\"];\n return {\n runtime: bun.version ? `bun/${bun.version}` : \"bun\",\n os: proc?.platform,\n arch: proc?.arch\n };\n }\n if (typeof g[\"process\"] !== \"undefined\") {\n const proc = g[\"process\"];\n if (proc.versions?.node) {\n return {\n runtime: `node/${proc.versions.node}`,\n os: proc.platform,\n arch: proc.arch\n };\n }\n }\n if (typeof g[\"navigator\"] !== \"undefined\") {\n return { runtime: \"browser\", os: void 0, arch: void 0 };\n }\n return { runtime: \"unknown\", os: void 0, arch: void 0 };\n}\nfunction getUserAgent(custom) {\n const { runtime, os, arch } = detectPlatform();\n const parts = [\"typescript\", SDK_PACKAGE, runtime];\n if (os !== void 0) parts.push(os);\n if (arch !== void 0) parts.push(arch);\n const base = `${SDK_PRODUCT}/${VERSION} (${parts.join(\"; \")})`;\n return custom ? `${custom} ${base}` : base;\n}\nexport {\n SDK_PACKAGE,\n SDK_PRODUCT,\n getUserAgent\n};\n//# sourceMappingURL=user-agent.js.map\n","import { classifyError, ExpiredAuthTokenError, B2Error, NetworkError } from \"../errors/index.js\";\nimport { DEFAULT_RETRY_OPTIONS, sleep, computeBackoff } from \"./retry.js\";\nimport { UrlGuard } from \"./url-guard.js\";\nimport { getUserAgent } from \"./user-agent.js\";\nclass FetchTransport {\n /** User-Agent string sent with every request. */\n userAgent;\n /** SSRF allow-list applied to every outgoing URL. Mutable so `B2Client.authorize()` can lock it down post-auth. */\n urlGuard;\n /**\n * Creates a new FetchTransport.\n * @param options - Optional configuration: custom User-Agent prefix and SSRF guard.\n */\n constructor(options) {\n this.userAgent = getUserAgent(options?.userAgent);\n this.urlGuard = options?.urlGuard ?? new UrlGuard();\n }\n /**\n * Sends the request using the global `fetch` function.\n * @param request - The HTTP request to execute.\n *\n * @returns The HTTP response.\n *\n * @throws B2SsrfError when the URL fails the configured SSRF guard.\n */\n async send(request) {\n this.urlGuard.check(request.url);\n const headers = new Headers(request.headers);\n if (!headers.has(\"User-Agent\")) {\n headers.set(\"User-Agent\", this.userAgent);\n }\n const response = await fetch(request.url, {\n method: request.method,\n headers,\n body: request.body ?? null,\n ...request.signal !== void 0 ? { signal: request.signal } : {}\n });\n return {\n status: response.status,\n headers: response.headers,\n body: response.body,\n json: () => response.json(),\n text: () => response.text(),\n arrayBuffer: () => response.arrayBuffer()\n };\n }\n}\nclass RetryTransport {\n /** The wrapped transport that performs actual HTTP requests. */\n inner;\n /** Resolved retry options (defaults merged with user overrides). */\n options;\n /** Optional callback to refresh auth credentials on 401 — returns the fresh token. */\n onReauth;\n /** Sleep implementation used between retries; injectable for tests. */\n sleepImpl;\n /**\n * Creates a new RetryTransport.\n * @param opts - Retry transport configuration.\n */\n constructor(opts) {\n this.inner = opts.transport;\n this.options = { ...DEFAULT_RETRY_OPTIONS, ...opts.retry };\n if (opts.onReauth !== void 0) this.onReauth = opts.onReauth;\n this.sleepImpl = opts.sleepImpl ?? sleep;\n }\n /**\n * Sends the request with automatic retry on transient failures.\n * On expired auth tokens, calls {@link RetryTransportOptions.onReauth} and retries.\n * @param originalRequest - The HTTP request to execute. The caller's\n * reference is not mutated; on reauth, a copy with a refreshed\n * Authorization header is sent.\n *\n * @returns The HTTP response.\n */\n async send(originalRequest) {\n let request = originalRequest;\n let lastError;\n for (let attempt = 0; attempt <= this.options.maxRetries; attempt++) {\n if (attempt > 0 && lastError) {\n const retryAfter = lastError instanceof NetworkError ? void 0 : lastError.retryAfter;\n const delay = computeBackoff(attempt - 1, this.options, retryAfter);\n await this.sleepImpl(delay, request.signal);\n }\n try {\n const response = await this.inner.send(request);\n if (response.status >= 200 && response.status < 300) {\n return response;\n }\n let errorBody;\n try {\n errorBody = await response.json();\n } catch {\n errorBody = {\n status: response.status,\n code: \"internal_error\",\n message: `HTTP ${response.status}`\n };\n }\n const retryAfterHeader = response.headers.get(\"Retry-After\");\n const retryAfterSec = retryAfterHeader ? Number.parseInt(retryAfterHeader, 10) : void 0;\n const requestId = response.headers.get(\"X-Bz-Request-Id\") ?? void 0;\n const error = classifyError(errorBody, {\n ...retryAfterSec !== void 0 ? { retryAfter: retryAfterSec } : {},\n ...requestId !== void 0 ? { requestId } : {}\n });\n if (error instanceof ExpiredAuthTokenError && this.onReauth) {\n const freshToken = await this.onReauth();\n request = {\n ...request,\n headers: { ...request.headers ?? {}, Authorization: freshToken }\n };\n continue;\n }\n if (!error.retryable || attempt === this.options.maxRetries) {\n throw error;\n }\n lastError = error;\n } catch (err) {\n if (err instanceof B2Error || err instanceof NetworkError) {\n throw err;\n }\n if (err instanceof DOMException && err.name === \"AbortError\") {\n throw err;\n }\n const networkErr = new NetworkError(\n err instanceof Error ? err.message : \"Network error\",\n err\n );\n if (attempt === this.options.maxRetries) {\n throw networkErr;\n }\n lastError = networkErr;\n }\n }\n throw lastError ?? new NetworkError(\"Max retries exceeded\");\n }\n}\nexport {\n FetchTransport,\n RetryTransport\n};\n//# sourceMappingURL=transport.js.map\n","const EncryptionAlgorithm = {\n /** AES with a 256-bit key. The only algorithm B2 currently supports. */\n Aes256: \"AES256\"\n};\nconst EncryptionMode = {\n /** B2-managed encryption keys. */\n SseB2: \"SSE-B2\",\n /** Customer-provided encryption keys. */\n SseC: \"SSE-C\",\n /** No encryption. */\n None: \"none\"\n};\nconst SSE_B2 = { mode: \"SSE-B2\", algorithm: \"AES256\" };\nconst SSE_NONE = { mode: \"none\" };\nfunction sseCustomer(customerKey, customerKeyMd5) {\n return { mode: \"SSE-C\", algorithm: \"AES256\", customerKey, customerKeyMd5 };\n}\nfunction bytesToBase64(bytes) {\n const g = globalThis;\n if (g.Buffer) {\n return g.Buffer.from(bytes).toString(\"base64\");\n }\n let binary = \"\";\n for (const b of bytes) binary += String.fromCharCode(b);\n return btoa(binary);\n}\nasync function md5Base64(bytes) {\n try {\n const { createHash } = await import(\"node:crypto\");\n if (typeof createHash !== \"function\") throw new Error(\"createHash unavailable\");\n return createHash(\"md5\").update(bytes).digest(\"base64\");\n } catch {\n return bytesToBase64(md5Bytes(bytes));\n }\n}\nfunction md5Bytes(data) {\n const originalBitLength = data.byteLength * 8;\n const padLength = (data.byteLength + 8 >>> 6) + 1;\n const padded = new Uint8Array(padLength * 64);\n padded.set(data);\n padded[data.byteLength] = 128;\n const lowBits = originalBitLength >>> 0;\n const highBits = Math.floor(originalBitLength / 4294967296) >>> 0;\n const lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8);\n lengthView.setUint32(0, lowBits, true);\n lengthView.setUint32(4, highBits, true);\n const s = [\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21\n ];\n const k = new Uint32Array([\n 3614090360,\n 3905402710,\n 606105819,\n 3250441966,\n 4118548399,\n 1200080426,\n 2821735955,\n 4249261313,\n 1770035416,\n 2336552879,\n 4294925233,\n 2304563134,\n 1804603682,\n 4254626195,\n 2792965006,\n 1236535329,\n 4129170786,\n 3225465664,\n 643717713,\n 3921069994,\n 3593408605,\n 38016083,\n 3634488961,\n 3889429448,\n 568446438,\n 3275163606,\n 4107603335,\n 1163531501,\n 2850285829,\n 4243563512,\n 1735328473,\n 2368359562,\n 4294588738,\n 2272392833,\n 1839030562,\n 4259657740,\n 2763975236,\n 1272893353,\n 4139469664,\n 3200236656,\n 681279174,\n 3936430074,\n 3572445317,\n 76029189,\n 3654602809,\n 3873151461,\n 530742520,\n 3299628645,\n 4096336452,\n 1126891415,\n 2878612391,\n 4237533241,\n 1700485571,\n 2399980690,\n 4293915773,\n 2240044497,\n 1873313359,\n 4264355552,\n 2734768916,\n 1309151649,\n 4149444226,\n 3174756917,\n 718787259,\n 3951481745\n ]);\n let a0 = 1732584193;\n let b0 = 4023233417;\n let c0 = 2562383102;\n let d0 = 271733878;\n const m = new Uint32Array(16);\n const view = new DataView(padded.buffer);\n for (let block = 0; block < padded.byteLength; block += 64) {\n for (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true);\n let A = a0;\n let B = b0;\n let C = c0;\n let D = d0;\n for (let i = 0; i < 64; i++) {\n let f;\n let g;\n if (i < 16) {\n f = B & C | ~B & D;\n g = i;\n } else if (i < 32) {\n f = D & B | ~D & C;\n g = (5 * i + 1) % 16;\n } else if (i < 48) {\n f = B ^ C ^ D;\n g = (3 * i + 5) % 16;\n } else {\n f = C ^ (B | ~D);\n g = 7 * i % 16;\n }\n const temp = D;\n D = C;\n C = B;\n const sum = A + f + (k[i] ?? 0) + (m[g] ?? 0) >>> 0;\n const shift = s[i] ?? 0;\n const rotated = (sum << shift | sum >>> 32 - shift) >>> 0;\n B = B + rotated >>> 0;\n A = temp;\n }\n a0 = a0 + A >>> 0;\n b0 = b0 + B >>> 0;\n c0 = c0 + C >>> 0;\n d0 = d0 + D >>> 0;\n }\n const out = new Uint8Array(16);\n const outView = new DataView(out.buffer);\n outView.setUint32(0, a0, true);\n outView.setUint32(4, b0, true);\n outView.setUint32(8, c0, true);\n outView.setUint32(12, d0, true);\n return out;\n}\nconst KEY_REDACTED = \"[redacted SSE-C key]\";\nclass EncryptionKey {\n /** Encryption mode discriminant. Always `'SSE-C'` for this class. */\n mode = \"SSE-C\";\n /** Encryption algorithm. B2's S3-compatible API only supports AES-256. */\n algorithm = \"AES256\";\n /** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */\n customerKey;\n /** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */\n customerKeyMd5;\n /**\n * Internal constructor. Use {@link EncryptionKey.fromBytes} or\n * {@link EncryptionKey.fromBase64} instead.\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @internal\n */\n constructor(customerKey, customerKeyMd5) {\n this.customerKey = customerKey;\n this.customerKeyMd5 = customerKeyMd5;\n }\n /**\n * Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the\n * required base64 MD5 digest internally.\n *\n * @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n *\n * @throws If the key is not exactly 32 bytes.\n */\n static async fromBytes(rawKey) {\n if (rawKey.byteLength !== 32) {\n throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`);\n }\n const customerKey = bytesToBase64(rawKey);\n const customerKeyMd5 = await md5Base64(rawKey);\n return new EncryptionKey(customerKey, customerKeyMd5);\n }\n /**\n * Builds an EncryptionKey from precomputed base64 strings. Use this in\n * environments where MD5 must be computed externally (e.g., browsers).\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n */\n static fromBase64(customerKey, customerKeyMd5) {\n return new EncryptionKey(customerKey, customerKeyMd5);\n }\n /**\n * Hides the key bytes from `JSON.stringify`.\n *\n * @returns A redacted shape: same mode and algorithm, but the key and MD5\n * replaced with a placeholder string.\n */\n toJSON() {\n return {\n mode: this.mode,\n algorithm: this.algorithm,\n customerKey: KEY_REDACTED,\n customerKeyMd5: KEY_REDACTED\n };\n }\n /**\n * Hides the key bytes from default `toString()`.\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n toString() {\n return `[EncryptionKey SSE-C ${KEY_REDACTED}]`;\n }\n /**\n * Hides the key bytes from Node's `util.inspect` (and therefore `console.log`).\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return this.toString();\n }\n}\nexport {\n EncryptionAlgorithm,\n EncryptionKey,\n EncryptionMode,\n SSE_B2,\n SSE_NONE,\n sseCustomer\n};\n//# sourceMappingURL=encryption.js.map\n","import { normalizeFileVersionSha1, normalizeFileVersionListSha1 } from \"../util/normalize.js\";\nimport { buildFileInfoHeaders, encodeFileName } from \"./encoding.js\";\nimport { decodeFileName, parseFileInfoHeaders } from \"./encoding.js\";\nimport { EncryptionMode, EncryptionAlgorithm } from \"../types/encryption.js\";\nclass RawClient {\n /** @internal */\n transport;\n /**\n * Creates a new RawClient with the given transport.\n * @param options - The constructor configuration.\n */\n constructor(options) {\n this.transport = options.transport;\n }\n // --- Auth ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}.\n * @param applicationKeyId - The application key ID for authentication.\n * @param applicationKey - The application key secret.\n * @param realmUrl - The B2 realm URL to authenticate against.\n *\n * @returns The authorization response with API URLs and credentials.\n */\n async authorizeAccount(applicationKeyId, applicationKey, realmUrl = \"https://api.backblazeb2.com\") {\n const response = await this.transport.send({\n url: `${realmUrl}/b2api/v3/b2_authorize_account`,\n method: \"GET\",\n headers: {\n Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}`\n }\n });\n return response.json();\n }\n // --- Buckets ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The created bucket metadata.\n */\n async createBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_create_bucket\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted bucket metadata.\n */\n async deleteBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_delete_bucket\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of matching buckets.\n */\n async listBuckets(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_buckets\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated bucket metadata.\n */\n async updateBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_update_bucket\", request);\n }\n // --- Files ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-url | b2_get_upload_url}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The upload URL and authorization token.\n */\n async getUploadUrl(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_get_upload_url\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-upload-file | b2_upload_file}.\n *\n * Unlike most methods, this posts directly to the `uploadUrl` obtained\n * from {@link getUploadUrl} rather than the API URL.\n * @param uploadUrl - The upload endpoint URL.\n * @param headers - The request headers including authorization and content metadata.\n * @param body - The file data to upload.\n * @param signal - An optional abort signal for cancellation.\n *\n * @returns The uploaded file version metadata.\n */\n async uploadFile(uploadUrl, headers, body, signal) {\n const reqHeaders = {\n Authorization: headers.authorization,\n \"X-Bz-File-Name\": encodeFileName(headers.fileName),\n \"Content-Type\": headers.contentType,\n \"Content-Length\": String(headers.contentLength),\n \"X-Bz-Content-Sha1\": headers.contentSha1,\n ...buildFileInfoHeaders(headers.fileInfo)\n };\n if (headers.lastModifiedMillis !== void 0) {\n reqHeaders[\"X-Bz-Info-src_last_modified_millis\"] = String(headers.lastModifiedMillis);\n }\n if (headers.contentDisposition) {\n reqHeaders[\"X-Bz-Info-b2-content-disposition\"] = headers.contentDisposition;\n }\n if (headers.contentLanguage) {\n reqHeaders[\"X-Bz-Info-b2-content-language\"] = headers.contentLanguage;\n }\n if (headers.expires) {\n reqHeaders[\"X-Bz-Info-b2-expires\"] = headers.expires;\n }\n if (headers.cacheControl) {\n reqHeaders[\"X-Bz-Info-b2-cache-control\"] = headers.cacheControl;\n }\n if (headers.contentEncoding) {\n reqHeaders[\"X-Bz-Info-b2-content-encoding\"] = headers.contentEncoding;\n }\n applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n applyRetentionHeaders(reqHeaders, headers.fileRetention);\n applyLegalHoldHeader(reqHeaders, headers.legalHold);\n const response = await this.transport.send({\n url: uploadUrl,\n method: \"POST\",\n headers: reqHeaders,\n body,\n ...signal !== void 0 ? { signal } : {}\n });\n return normalizeFileVersionSha1(await response.json());\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of file names and optional continuation token.\n */\n async listFileNames(apiUrl, authToken, request) {\n return normalizeFileVersionListSha1(\n await this.postJson(apiUrl, authToken, \"b2_list_file_names\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of file versions and optional continuation token.\n */\n async listFileVersions(apiUrl, authToken, request) {\n return normalizeFileVersionListSha1(\n await this.postJson(\n apiUrl,\n authToken,\n \"b2_list_file_versions\",\n request\n )\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The file version metadata.\n */\n async getFileInfo(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_get_file_info\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The hidden file version metadata.\n */\n async hideFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_hide_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted file version identifier.\n */\n async deleteFileVersion(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_delete_file_version\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The copied file version metadata.\n */\n async copyFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_copy_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The copied part metadata.\n */\n async copyPart(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_copy_part\", request);\n }\n // --- Large Files ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The started large file metadata with file ID.\n */\n async startLargeFile(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_start_large_file\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-part-url | b2_get_upload_part_url}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The upload part URL and authorization token.\n */\n async getUploadPartUrl(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_upload_part_url\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-upload-part | b2_upload_part}.\n *\n * Posts directly to the `uploadUrl` obtained from {@link getUploadPartUrl}\n * rather than the API URL.\n * @param uploadUrl - The upload endpoint URL.\n * @param headers - The request headers including authorization and content metadata.\n * @param body - The file data to upload.\n * @param signal - An optional abort signal for cancellation.\n *\n * @returns The uploaded part metadata.\n */\n async uploadPart(uploadUrl, headers, body, signal) {\n const reqHeaders = {\n Authorization: headers.authorization,\n \"X-Bz-Part-Number\": String(headers.partNumber),\n \"Content-Length\": String(headers.contentLength),\n \"X-Bz-Content-Sha1\": headers.contentSha1\n };\n applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n const response = await this.transport.send({\n url: uploadUrl,\n method: \"POST\",\n headers: reqHeaders,\n body,\n ...signal !== void 0 ? { signal } : {}\n });\n return response.json();\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The completed file version metadata.\n */\n async finishLargeFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_finish_large_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The cancelled large file metadata.\n */\n async cancelLargeFile(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_cancel_large_file\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of unfinished large files and optional continuation token.\n */\n async listUnfinishedLargeFiles(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_list_unfinished_large_files\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of uploaded parts and optional continuation token.\n */\n async listParts(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_parts\", request);\n }\n // --- Downloads ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}.\n * @param downloadUrl - The B2 download base URL.\n * @param authToken - The authorization token.\n * @param fileId - The unique identifier of the file to download.\n * @param options - Optional download parameters for range requests and cancellation.\n *\n * @returns The response headers, streaming body, and HTTP status code.\n */\n async downloadFileById(downloadUrl, authToken, fileId, options) {\n const headers = buildDownloadRequestHeaders(authToken, options);\n const url = appendDownloadOverrides(\n `${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`,\n options\n );\n const response = await this.transport.send({\n url,\n method: options?.method ?? \"GET\",\n headers,\n ...options?.signal !== void 0 ? { signal: options.signal } : {}\n });\n return { headers: response.headers, body: response.body, status: response.status };\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}.\n * @param downloadUrl - The B2 download base URL.\n * @param authToken - The authorization token.\n * @param bucketName - The name of the bucket containing the file.\n * @param fileName - The name of the file to download.\n * @param options - Optional download parameters for range requests and cancellation.\n *\n * @returns The response headers, streaming body, and HTTP status code.\n */\n async downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) {\n const headers = buildDownloadRequestHeaders(authToken, options);\n const url = appendDownloadOverrides(\n `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileName(fileName)}`,\n options\n );\n const response = await this.transport.send({\n url,\n method: options?.method ?? \"GET\",\n headers,\n ...options?.signal !== void 0 ? { signal: options.signal } : {}\n });\n return { headers: response.headers, body: response.body, status: response.status };\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The current session authorization token.\n * @param request - The API request parameters.\n *\n * @returns The download authorization token for the specified file prefix.\n */\n async getDownloadAuthorization(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_download_authorization\",\n request\n );\n }\n // --- Keys ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The newly created application key with secret.\n */\n async createKey(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_create_key\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of application keys and optional continuation token.\n */\n async listKeys(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_keys\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted application key metadata.\n */\n async deleteKey(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_delete_key\", request);\n }\n // --- Retention / Legal Hold ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated file retention settings.\n */\n async updateFileRetention(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_update_file_retention\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated file legal hold status.\n */\n async updateFileLegalHold(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_update_file_legal_hold\",\n request\n );\n }\n // --- Notifications ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The configured event notification rules for the specified bucket.\n */\n async getBucketNotificationRules(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_bucket_notification_rules\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated bucket notification rules.\n */\n async setBucketNotificationRules(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_set_bucket_notification_rules\",\n request\n );\n }\n // --- Internal ---\n /**\n * Sends a JSON POST request to the specified B2 API endpoint.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param endpoint - The B2 API endpoint name.\n * @param body - The JSON request body.\n *\n * @returns The parsed JSON response.\n */\n async postJson(apiUrl, authToken, endpoint, body) {\n const response = await this.transport.send({\n url: `${apiUrl}/b2api/v3/${endpoint}`,\n method: \"POST\",\n headers: {\n Authorization: authToken,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(body)\n });\n return response.json();\n }\n}\nfunction applyEncryptionHeaders(headers, encryption) {\n if (!encryption || encryption.mode === EncryptionMode.None) return;\n if (encryption.mode === EncryptionMode.SseB2) {\n headers[\"X-Bz-Server-Side-Encryption\"] = EncryptionAlgorithm.Aes256;\n } else if (encryption.mode === EncryptionMode.SseC) {\n headers[\"X-Bz-Server-Side-Encryption-Customer-Algorithm\"] = EncryptionAlgorithm.Aes256;\n headers[\"X-Bz-Server-Side-Encryption-Customer-Key\"] = encryption.customerKey;\n headers[\"X-Bz-Server-Side-Encryption-Customer-Key-Md5\"] = encryption.customerKeyMd5;\n }\n}\nconst DOWNLOAD_OVERRIDE_PARAMS = [\n \"b2ContentDisposition\",\n \"b2ContentLanguage\",\n \"b2ContentEncoding\",\n \"b2ContentType\",\n \"b2CacheControl\",\n \"b2Expires\"\n];\nfunction buildDownloadRequestHeaders(authToken, options) {\n const headers = { Authorization: authToken };\n if (options?.range) headers[\"Range\"] = options.range;\n if (options?.serverSideEncryption) {\n applyEncryptionHeaders(headers, {\n mode: EncryptionMode.SseC,\n ...options.serverSideEncryption\n });\n }\n return headers;\n}\nfunction appendDownloadOverrides(url, options) {\n if (!options) return url;\n const params = [];\n for (const key of DOWNLOAD_OVERRIDE_PARAMS) {\n const value = options[key];\n if (value !== void 0) {\n params.push(`${key}=${encodeURIComponent(value)}`);\n }\n }\n if (params.length === 0) return url;\n const separator = url.includes(\"?\") ? \"&\" : \"?\";\n return `${url}${separator}${params.join(\"&\")}`;\n}\nfunction applyRetentionHeaders(headers, retention) {\n if (!retention) return;\n if (retention.mode) {\n headers[\"X-Bz-File-Retention-Mode\"] = retention.mode;\n }\n if (retention.retainUntilTimestamp) {\n headers[\"X-Bz-File-Retention-Retain-Until-Timestamp\"] = String(retention.retainUntilTimestamp);\n }\n}\nfunction applyLegalHoldHeader(headers, legalHold) {\n if (!legalHold) return;\n headers[\"X-Bz-File-Legal-Hold\"] = legalHold;\n}\nexport {\n RawClient,\n buildFileInfoHeaders,\n decodeFileName,\n encodeFileName,\n parseFileInfoHeaders\n};\n//# sourceMappingURL=index.js.map\n","import { InMemoryAccountInfo } from \"./auth/in-memory.js\";\nimport { getRealmUrl } from \"./auth/realms.js\";\nimport { Bucket } from \"./bucket.js\";\nimport { FetchTransport, RetryTransport } from \"./http/transport.js\";\nimport { UrlGuard, deriveAllowedSuffixes } from \"./http/url-guard.js\";\nimport { RawClient } from \"./raw/index.js\";\nimport { accountId } from \"./types/ids.js\";\nimport { DEFAULT_PAGE_SIZE } from \"./util/defaults.js\";\nimport { paginateItems } from \"./util/paginator.js\";\nclass B2Client {\n /** Low-level client for direct B2 API calls. */\n raw;\n /** Authorization state storage (tokens, URLs, capabilities). */\n accountInfo;\n /**\n * SSRF allow-list applied by the default {@link FetchTransport}. `null` when\n * a custom transport was supplied — in that case the SDK does not own the\n * guard. Locked down by {@link B2Client.authorize}.\n */\n urlGuard;\n applicationKeyId;\n applicationKey;\n realmUrl;\n userAllowedSuffixes;\n /**\n * Creates a new B2Client. Call {@link authorize} before making API requests.\n * @param options - Configuration including credentials, realm, and transport settings.\n */\n constructor(options) {\n this.applicationKeyId = options.applicationKeyId;\n this.applicationKey = options.applicationKey;\n this.realmUrl = getRealmUrl(options.realm ?? \"production\");\n this.accountInfo = options.accountInfo ?? new InMemoryAccountInfo();\n this.userAllowedSuffixes = options.allowedHostSuffixes;\n let baseTransport;\n if (options.transport !== void 0) {\n baseTransport = options.transport;\n this.urlGuard = null;\n } else {\n const urlGuard = new UrlGuard();\n baseTransport = new FetchTransport({\n urlGuard,\n ...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {}\n });\n this.urlGuard = urlGuard;\n }\n const retryTransport = new RetryTransport({\n transport: baseTransport,\n ...options.retry !== void 0 ? { retry: options.retry } : {},\n onReauth: () => this.reauthorize()\n });\n this.raw = new RawClient({ transport: retryTransport });\n }\n /**\n * Authenticates with B2 and stores the authorization state. Must be called before other methods.\n *\n * @returns The authorization response containing tokens, URLs, and capabilities.\n */\n async authorize() {\n const auth = await this.raw.authorizeAccount(\n this.applicationKeyId,\n this.applicationKey,\n this.realmUrl\n );\n this.accountInfo.setAuth(auth);\n if (this.urlGuard !== null) {\n const derived = deriveAllowedSuffixes(auth.apiInfo.storageApi);\n const merged = this.userAllowedSuffixes !== void 0 ? Array.from(/* @__PURE__ */ new Set([...derived, ...this.userAllowedSuffixes])) : derived;\n this.urlGuard.setAllowedSuffixes(merged);\n }\n return auth;\n }\n /**\n * Refresh credentials after a 401. Returns the fresh auth token so\n * {@link RetryTransport} can rewrite the in-flight request's\n * Authorization header before retrying.\n *\n * @returns The fresh authorization token.\n */\n async reauthorize() {\n this.accountInfo.clear();\n const auth = await this.authorize();\n return auth.authorizationToken;\n }\n /**\n * Creates a new B2 bucket.\n * @param options - Bucket configuration including name, type, and optional settings.\n *\n * @returns A {@link Bucket} handle for the newly created bucket.\n */\n async createBucket(options) {\n const request = {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n };\n const info = await this.raw.createBucket(\n this.accountInfo.getApiUrl(),\n this.accountInfo.getAuthToken(),\n request\n );\n return new Bucket(this, info);\n }\n /**\n * Lists buckets in the account, optionally filtered by ID, name, or type.\n * @param options - Optional filters for bucket ID, name, or type.\n *\n * @returns An array of {@link Bucket} handles.\n */\n async listBuckets(options) {\n const resp = await this.raw.listBuckets(\n this.accountInfo.getApiUrl(),\n this.accountInfo.getAuthToken(),\n {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n }\n );\n return resp.buckets.map((info) => new Bucket(this, info));\n }\n /**\n * Looks up a single bucket by name.\n * @param bucketName - The name of the bucket to find.\n *\n * @returns The {@link Bucket} handle, or `null` if not found.\n */\n async getBucket(bucketName) {\n const buckets = await this.listBuckets({ bucketName });\n return buckets[0] ?? null;\n }\n /**\n * Permanently deletes a bucket. The bucket must be empty.\n * @param id - The unique identifier of the bucket to delete.\n *\n * @returns The deleted bucket metadata.\n */\n async deleteBucket(id) {\n return this.raw.deleteBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n bucketId: id\n });\n }\n /**\n * Creates a new application key with the specified capabilities.\n * @param options - Key configuration including capabilities, name, and optional restrictions.\n *\n * @returns The full key including the secret (only returned at creation time).\n */\n async createKey(options) {\n return this.raw.createKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n });\n }\n /**\n * Lists application keys in the account.\n * @param options - Optional pagination settings.\n *\n * @returns A page of application keys with an optional continuation token.\n */\n async listKeys(options) {\n return this.raw.listKeys(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options?.pageSize !== void 0 ? { maxKeyCount: options.pageSize } : {},\n ...options?.startApplicationKeyId !== void 0 ? { startApplicationKeyId: options.startApplicationKeyId } : {}\n });\n }\n /**\n * Async iterator that yields every application key on the account,\n * automatically handling pagination via `listKeys`.\n *\n * @param options - Pagination + abort options. `pageSize` is forwarded\n * to `maxKeyCount`; the default is 1000.\n *\n * @returns An async iterable of {@link ApplicationKey} entries.\n *\n * @example\n * ```ts\n * for await (const key of client.paginateKeys()) {\n * console.log(key.keyName, key.capabilities)\n * }\n * ```\n */\n paginateKeys(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listKeys({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startApplicationKeyId: cursor } : {}\n });\n return { page: resp, nextCursor: resp.nextApplicationKeyId ?? void 0 };\n },\n (page) => page.keys,\n options?.signal\n );\n }\n /**\n * Permanently deletes an application key.\n * @param applicationKeyId - The unique identifier of the key to delete.\n *\n * @returns The deleted application key metadata.\n */\n async deleteKey(applicationKeyId) {\n return this.raw.deleteKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n applicationKeyId\n });\n }\n /**\n * Checks whether the authorized application key carries every capability in\n * `needed`. Returns the missing capabilities so callers can fail fast with a\n * clear error instead of a generic 401/403 from the server.\n *\n * @param needed - The capabilities required by the planned operation.\n *\n * @returns An object with `ok: true` when every needed capability is\n * present, otherwise `{ ok: false, missing: [...] }`.\n *\n * @throws If {@link authorize} has not been called yet.\n */\n hasCapabilities(needed) {\n const auth = this.accountInfo.getAuth();\n if (!auth) throw new Error(\"Not authorized. Call authorize() first.\");\n const available = new Set(auth.apiInfo.storageApi.allowed.capabilities);\n const missing = needed.filter((cap) => !available.has(cap));\n return { ok: missing.length === 0, missing };\n }\n}\nexport {\n B2Client\n};\n//# sourceMappingURL=client.js.map\n","import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Action version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync: bumping `version` in package.json\n * automatically propagates here, into the User-Agent header, and into the\n * bundled `dist/index.js`.\n *\n * Works because:\n * - Node 22+ supports native JSON import attributes.\n * - ncc / webpack statically inlines the JSON at bundle time, so the\n * runtime artifact has the version baked in as a string literal.\n * - TypeScript's `resolveJsonModule` makes the import type-safe.\n */\nexport const VERSION: string = pkg.version\n","import * as core from '@actions/core'\nimport type { AuthorizeAccountResponse, FileVersion } from '@backblaze-labs/b2-sdk'\nimport {\n B2Client,\n type Bucket,\n type HttpTransport,\n InMemoryAccountInfo,\n} from '@backblaze-labs/b2-sdk'\nimport { VERSION } from './version.ts'\n\n/**\n * An authorized B2Client paired with the bucket name the action is scoped\n * to. Returned by {@link buildClient}; consumed by command dispatch sites\n * that need either the high-level client (cross-bucket copy, presign) or\n * the resolved bucket (via {@link getBucket}).\n */\nexport interface AuthorizedClient {\n /** The authorized SDK client. `client.accountInfo` is populated. */\n client: B2Client\n /** The destination bucket name as provided to the action's `bucket` input. */\n bucketName: string\n}\n\n/** Inputs to {@link buildClient}. */\nexport interface BuildClientOptions {\n /** B2 application key ID. Masked via `core.setSecret` by the dispatcher (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked via `core.setSecret` by the dispatcher. */\n applicationKey: string\n /** Target bucket name (stored on the result for later `getBucket` resolution). */\n bucket: string\n /** Override the default B2 realm endpoint. Only set for staging / custom realms. */\n endpoint?: string | undefined\n /** Inject a custom transport (used by tests with the SDK's `B2Simulator`). */\n transport?: HttpTransport | undefined\n}\n\nfunction maskAccountAuthToken(token: string | null | undefined): void {\n if (token) core.setSecret(token)\n}\n\nclass SecretMaskingAccountInfo extends InMemoryAccountInfo {\n // The SDK routes authorize() and transparent reauthorize() through the\n // supplied AccountInfo.setAuth. The reauth masking test is the CI guard for\n // this SDK coupling when the dependency is bumped.\n override setAuth(auth: AuthorizeAccountResponse): void {\n maskAccountAuthToken(auth.authorizationToken)\n super.setAuth(auth)\n }\n}\n\n/**\n * Build an authorized B2Client.\n *\n * Steps:\n * 1. Construct the client with `userAgent: 'b2-github-action/'`. The\n * SDK preserves its own `b2-sdk-typescript/` and `@backblaze-labs/b2-sdk` tokens before\n * ours so Backblaze server-side logs see both attribution layers.\n * 2. `await client.authorize()`. This is one-shot for the lifetime of the\n * action invocation. B2 auth tokens carry a 24h TTL; typical GitHub\n * Actions runs finish well inside that window. If a long-running job\n * outlives the token, the SDK transparently re-authorizes on the next\n * 401, so the action layer does not need its own refresh loop.\n * 3. Use an AccountInfo wrapper that masks each account authorization token\n * as it is stored, including SDK-driven reauthorization after token\n * expiry. The post-authorize mask is kept as a fallback in case a future\n * SDK version bypasses the wrapper for initial authorization.\n *\n * The `transport` parameter is only used by tests (the SDK's B2Simulator\n * provides one). Production callers leave it undefined to use the SDK's\n * default FetchTransport with its built-in SSRF guard.\n */\nexport async function buildClient(options: BuildClientOptions): Promise {\n const userAgent = `b2-github-action/${VERSION}`\n\n const client = new B2Client({\n applicationKeyId: options.applicationKeyId,\n applicationKey: options.applicationKey,\n accountInfo: new SecretMaskingAccountInfo(),\n userAgent,\n ...(options.transport !== undefined ? { transport: options.transport } : {}),\n ...(options.endpoint !== undefined ? { realm: options.endpoint } : {}),\n })\n\n await client.authorize()\n // Deliberately overlaps with setAuth for initial auth. If a future SDK\n // changes authorize() storage, the public AccountInfo getter still masks the\n // stored account token before command code can log.\n maskAccountAuthToken(client.accountInfo.getAuthToken())\n\n return { client, bucketName: options.bucket }\n}\n\n/**\n * Resolve a bucket by name. Throws a clear error rather than the SDK's\n * `undefined` return so the workflow log surfaces the misconfiguration.\n */\nexport async function getBucket(authorized: AuthorizedClient) {\n const bucket = await authorized.client.getBucket(authorized.bucketName)\n if (!bucket) {\n throw new Error(\n `Bucket \"${authorized.bucketName}\" not found, or the application key lacks listBuckets capability for it.`,\n )\n }\n return bucket\n}\n\n/**\n * Resolve an exact file name only when its latest version is an upload. If the\n * latest exact-name version is a hide marker, this intentionally reports the\n * file as not found instead of selecting an older upload from version history\n * or revealing hidden-object existence in default workflow logs. Throws when\n * the latest exact-name state is hidden, deleted, or absent. Used by `copy`,\n * `delete`, and `retention` to resolve a file name to a `fileId` before\n * operating on it.\n *\n * Consistency assumption: B2's `listFileNames` is read-after-write consistent\n * for a recently-uploaded file in the same region. The simulator returns\n * uploads immediately; production B2 in practice does the same, but a caller\n * that chains \"upload then operate on the same name\" across two action steps\n * is relying on observed behavior rather than a documented SLA.\n *\n * @param bucket - The bucket to search.\n * @param fileName - Exact file name (path) to look up.\n * @param bucketDisplayName - Optional label for the error message; defaults\n * to `bucket.name`. Used when looking up in a source bucket distinct from\n * the action's destination bucket (cross-bucket copy).\n */\nexport async function findFileByName(\n bucket: Bucket,\n fileName: string,\n bucketDisplayName?: string,\n): Promise {\n const display = bucketDisplayName ?? bucket.name\n const page = await bucket.listFileNames({ prefix: fileName, pageSize: 1 })\n const exactLatest = page.files.find((f) => f.fileName === fileName)\n if (exactLatest?.action === 'upload') return exactLatest\n\n throw new Error(`File not found in bucket \"${display}\": ${fileName}`)\n}\n","import { Buffer } from 'node:buffer'\nimport { createHash } from 'node:crypto'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { SSE_B2, sseCustomer } from '@backblaze-labs/b2-sdk'\n\nconst CANONICAL_BASE64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/\n\n/**\n * Parse the `sse` input into an SDK {@link EncryptionSetting}.\n *\n * Accepted forms:\n * - `undefined` / empty → no encryption setting passed (B2 still applies any\n * bucket-default SSE-B2; we just don't override it).\n * - `\"B2\"` (case-insensitive) → SSE-B2 with the B2-managed key (no cost).\n * - `\"C:\"` → SSE-C with a customer-provided key. We\n * compute the required base64 MD5 internally so the workflow author\n * doesn't have to.\n *\n * The action runs in Node only, so we use `node:crypto.createHash('md5')`\n * directly rather than the SDK's isomorphic key wrapper. We deliberately do\n * NOT log the key bytes; the only place they ever go is into the\n * `customerKey` field of the SDK setting which the SDK marks as a secret in\n * any error / debug output.\n */\nexport function parseSse(raw: string | undefined): EncryptionSetting | undefined {\n if (raw === undefined || raw === '') return undefined\n\n const normalized = raw.trim()\n if (normalized.toUpperCase() === 'B2') return SSE_B2\n\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n const base64Key = normalized.slice(2).trim()\n if (base64Key === '') {\n throw new Error(\"SSE-C key is empty. Use 'C:'.\")\n }\n // Node's `Buffer.from(str, 'base64')` silently drops invalid chars instead\n // of throwing, so validate the canonical alphabet and padding first.\n if (!CANONICAL_BASE64.test(base64Key)) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const keyBytes = Buffer.from(base64Key, 'base64')\n if (keyBytes.byteLength !== 32) {\n throw new Error(\n `SSE-C key must decode to exactly 32 bytes (256 bits); got ${keyBytes.byteLength}.`,\n )\n }\n const customerKey = keyBytes.toString('base64')\n if (customerKey !== base64Key) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const customerKeyMd5 = createHash('md5').update(keyBytes).digest('base64')\n return sseCustomer(customerKey, customerKeyMd5)\n }\n\n throw new Error(`Invalid 'sse' input: \"${raw}\". Expected \"B2\" or \"C:\".`)\n}\n","import * as core from '@actions/core'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { parseSse } from './sse.ts'\n\n/**\n * Discriminator the action's dispatcher switches on. Matches the values\n * accepted by the `action:` input in `action.yml`. Adding a new verb\n * requires updating this union, the runtime `VALID_ACTIONS` list,\n * `ACTION_EFFECTS`, the dispatcher in `src/main.ts`, and the documentation\n * surfaces.\n */\nexport type ActionName =\n | 'upload'\n | 'download'\n | 'sync'\n | 'copy'\n | 'delete'\n | 'presign'\n | 'list'\n | 'hide'\n | 'unhide'\n | 'verify'\n | 'retention'\n | 'head'\n | 'purge'\n\nconst VALID_ACTIONS: readonly ActionName[] = [\n 'upload',\n 'download',\n 'sync',\n 'copy',\n 'delete',\n 'presign',\n 'list',\n 'hide',\n 'unhide',\n 'verify',\n 'retention',\n 'head',\n 'purge',\n]\n\ntype ActionEffect = {\n readonly kind: 'read' | 'write'\n readonly honorsDryRun: boolean\n}\n\n/**\n * Runtime side-effect policy for each action verb.\n *\n * @internal\n */\nexport const ACTION_EFFECTS = {\n upload: { kind: 'write', honorsDryRun: false },\n download: { kind: 'read', honorsDryRun: false },\n sync: { kind: 'write', honorsDryRun: true },\n copy: { kind: 'write', honorsDryRun: false },\n delete: { kind: 'write', honorsDryRun: true },\n presign: { kind: 'read', honorsDryRun: false },\n list: { kind: 'read', honorsDryRun: false },\n hide: { kind: 'write', honorsDryRun: false },\n unhide: { kind: 'write', honorsDryRun: false },\n verify: { kind: 'read', honorsDryRun: false },\n retention: { kind: 'write', honorsDryRun: false },\n head: { kind: 'read', honorsDryRun: false },\n purge: { kind: 'write', honorsDryRun: true },\n} as const satisfies Record\n\n/** How `sync` decides whether two files match. Drives the SDK's `synchronize()`. */\nexport type CompareMode = 'modtime' | 'size' | 'none'\n/** What `sync` does with destination-only files when reconciling. */\nexport type KeepMode = 'no-delete' | 'delete' | 'keep-days'\n/** Direction of a `sync`: `auto` infers from whether `source` is local or remote. */\nexport type SyncDirection = 'auto' | 'up' | 'down'\n/** B2 Object Lock retention mode. `none` clears any prior retention. */\nexport type RetentionMode = 'compliance' | 'governance' | 'none'\n/** B2 Object Lock legal-hold state. */\nexport type LegalHold = 'on' | 'off'\n\nconst VALID_COMPARE: readonly CompareMode[] = ['modtime', 'size', 'none']\nconst VALID_KEEP: readonly KeepMode[] = ['no-delete', 'delete', 'keep-days']\nconst VALID_DIRECTION: readonly SyncDirection[] = ['auto', 'up', 'down']\nconst VALID_RETENTION_MODE: readonly RetentionMode[] = ['compliance', 'governance', 'none']\nconst VALID_LEGAL_HOLD: readonly LegalHold[] = ['on', 'off']\nconst APPLICATION_KEY_ID_ENV = 'B2_APPLICATION_KEY_ID'\nconst APPLICATION_KEY_ENV = 'B2_APPLICATION_KEY'\n\n/**\n * The fully-parsed, fully-validated action surface. Built by\n * {@link parseInputs} from `INPUT_*` env vars (via `@actions/core`); every\n * command in `src/commands/` consumes a frozen instance of this shape.\n *\n * Most fields map 1:1 to inputs declared in `action.yml`. Defaults and\n * optionality match the YAML surface; see `action.yml` for the user-facing\n * documentation per input.\n */\nexport interface ParsedInputs {\n /** Which verb to dispatch to. */\n action: ActionName\n /** B2 application key ID. Masked at parse time via `core.setSecret` (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked at parse time via `core.setSecret`. */\n applicationKey: string\n /** Destination bucket name for the action. */\n bucket: string\n /** Cross-bucket `copy` source bucket. Undefined means same-bucket copy. */\n sourceBucket: string | undefined\n /**\n * Verb-dependent source. Upload/sync: a local path or glob. Download/copy/\n * delete/presign/list/hide/unhide/verify/retention/head/purge: a B2 file\n * name or prefix (trailing `/` means prefix mode for verbs that support it).\n */\n source: string | undefined\n /**\n * Verb-dependent destination. Upload/sync: B2 file name or prefix.\n * Download: local path. Copy: destination file name. Other verbs: ignored.\n */\n destination: string | undefined\n /** Glob patterns to include during upload/sync expansion. */\n include: string[]\n /** Glob patterns to exclude during upload/sync expansion. Default: `.git/**`. */\n exclude: string[]\n /** Parallel parts/files for upload/sync. */\n concurrency: number\n /** Multipart part size in bytes. Undefined defers to the SDK's recommendation. */\n partSize: number | undefined\n /** Resume an in-progress multipart upload. */\n resume: boolean\n /** Content-Type to set on uploaded objects. Undefined leaves B2's auto-detect. */\n contentType: string | undefined\n /** Response Content-Disposition override for `download` and `presign`. */\n responseContentDisposition: string | undefined\n /** Response Content-Type override for `download` and `presign`. */\n responseContentType: string | undefined\n /** Response Cache-Control override for `download` and `presign`. */\n responseCacheControl: string | undefined\n /** Preview without executing (sync/delete/purge). */\n dryRun: boolean\n /** Permit whole-bucket purge when `source` is empty or `/`. */\n allowBucketPurge: boolean\n /** Presigned-URL TTL in seconds. */\n presignTtlSeconds: number\n /** Override B2 realm endpoint for staging / custom realms. */\n endpoint: string | undefined\n /** Fail the action when upload/sync matches zero files. */\n failOnEmpty: boolean\n /** Raw `sse:` input value as the user typed it. Retained for diagnostics. */\n sse: string | undefined\n /** Parsed SSE specification ready to hand to the SDK. */\n encryption: EncryptionSetting | undefined\n /** How `sync` compares files. */\n compareMode: CompareMode\n /** How `sync` treats destination-only files. */\n keepMode: KeepMode\n /** Direction of a `sync` (auto-detected when set to `auto`). */\n syncDirection: SyncDirection\n /** Cap on listed/presigned entries for `list` and prefix `presign`. */\n maxResults: number\n /** Literal SHA-1 to compare against in `verify` (when set, no local read). */\n expectedSha1: string | undefined\n /** Object Lock retention mode to apply (`retention` verb). */\n retentionMode: RetentionMode | undefined\n /** ISO-8601 timestamp until which retention applies. Required with `retentionMode`. */\n retentionUntil: string | undefined\n /** Legal-hold state to apply (`retention` verb). */\n legalHold: LegalHold | undefined\n /** Allow shortening a governance-mode retention (requires key capability). */\n bypassGovernance: boolean\n}\n\n/**\n * Sensitive raw values that can appear in parser-scope errors before\n * {@link parseInputs} returns its structured output.\n */\nexport function collectInputSecretsForScrubbing(): string[] {\n const secretValues = new Set()\n addSecretValue(secretValues, core.getInput('application-key-id'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ID_ENV])\n addSecretValue(secretValues, core.getInput('application-key'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ENV])\n addSseSecretValue(secretValues, core.getInput('sse'))\n return [...secretValues]\n}\n\n/**\n * Parse and validate inputs.\n *\n * Credentials lookup order:\n *\n * 1. `application-key-id` / `application-key` action inputs\n * 2. `B2_APPLICATION_KEY_ID` / `B2_APPLICATION_KEY` env vars (the official\n * contract used by the Backblaze b2 CLI and the @backblaze-labs/b2-sdk).\n *\n * The credential value, once resolved, is immediately masked via `core.setSecret`\n * so any accidental echo (including from a misbehaving sub-process) is redacted\n * in workflow logs.\n */\nexport function parseInputs(): ParsedInputs {\n const action = parseEnum('action', required('action').toLowerCase(), VALID_ACTIONS)\n\n const applicationKeyId = resolveCredential('application-key-id', APPLICATION_KEY_ID_ENV)\n const applicationKey = resolveCredential('application-key', APPLICATION_KEY_ENV)\n // The keyId is identifying (not the secret half of the HMAC pair), but mask\n // it anyway for defense in depth: the canonical AWS analogue mask AKIA-style\n // IDs in CI logs, and masking costs nothing in debuggability since the user\n // already knows which key they passed.\n core.setSecret(applicationKeyId)\n core.setSecret(applicationKey)\n\n const bucket = required('bucket')\n const sourceBucket = optional('source-bucket')\n const allowBucketPurge = parseBool(\n 'allow-bucket-purge',\n core.getInput('allow-bucket-purge') || 'false',\n )\n const source = optionalSource(action, allowBucketPurge)\n const destination = optional('destination')\n\n const include = splitCsv(optional('include'))\n const exclude = splitCsv(optional('exclude'))\n\n const concurrency = parsePositiveInt('concurrency', core.getInput('concurrency') || '4')\n const partSizeInput = optional('part-size')\n const partSize =\n partSizeInput !== undefined ? parsePositiveInt('part-size', partSizeInput) : undefined\n\n const resume = parseBool('resume', core.getInput('resume') || 'true')\n const dryRun = parseBool('dry-run', core.getInput('dry-run') || 'false')\n const failOnEmpty = parseBool('fail-on-empty', core.getInput('fail-on-empty') || 'true')\n const bypassGovernance = parseBool(\n 'bypass-governance',\n core.getInput('bypass-governance') || 'false',\n )\n\n const presignTtlSeconds = parsePositiveInt('presign-ttl', core.getInput('presign-ttl') || '3600')\n const maxResults = parsePositiveInt('max-results', core.getInput('max-results') || '1000')\n\n const contentType = optional('content-type')\n const responseContentDisposition = optional('response-content-disposition')\n const responseContentType = optional('response-content-type')\n const responseCacheControl = optional('response-cache-control')\n const endpoint = optional('endpoint')\n const sse = optional('sse')\n const encryption = parseSse(sse)\n const expectedSha1 = optional('expected-sha1')\n const retentionUntil = optional('retention-until')\n\n const compareMode = parseEnum(\n 'compare-mode',\n (core.getInput('compare-mode') || 'modtime').toLowerCase(),\n VALID_COMPARE,\n )\n const keepMode = parseEnum(\n 'keep-mode',\n (core.getInput('keep-mode') || 'no-delete').toLowerCase(),\n VALID_KEEP,\n )\n const syncDirection = parseEnum(\n 'direction',\n (core.getInput('direction') || 'auto').toLowerCase(),\n VALID_DIRECTION,\n )\n const retentionMode = parseOptionalEnum(\n 'retention-mode',\n optional('retention-mode')?.toLowerCase(),\n VALID_RETENTION_MODE,\n )\n const legalHold = parseOptionalEnum(\n 'legal-hold',\n optional('legal-hold')?.toLowerCase(),\n VALID_LEGAL_HOLD,\n )\n\n return {\n action,\n applicationKeyId,\n applicationKey,\n bucket,\n sourceBucket,\n source,\n destination,\n include,\n exclude,\n concurrency,\n partSize,\n resume,\n contentType,\n responseContentDisposition,\n responseContentType,\n responseCacheControl,\n dryRun,\n allowBucketPurge,\n presignTtlSeconds,\n endpoint,\n failOnEmpty,\n sse,\n encryption,\n compareMode,\n keepMode,\n syncDirection,\n maxResults,\n expectedSha1,\n retentionMode,\n retentionUntil,\n legalHold,\n bypassGovernance,\n }\n}\n\n/**\n * Validate that `inputs.source` is set and non-empty, returning the value.\n * Throws a uniform error message naming the verb so the workflow log surfaces\n * exactly what's missing. Commands that allow an empty-string source for\n * special semantics (e.g. `purge` with explicit whole-bucket scope) should\n * not use this helper.\n */\nexport function requireSource(\n source: string | undefined,\n verb: string,\n description?: string,\n): string {\n if (source === undefined || source === '') {\n const tail = description !== undefined ? ` (${description})` : ''\n throw new Error(`'source' input is required for '${verb}' action${tail}`)\n }\n return source\n}\n\n/**\n * Validate that `raw` is one of `valid`, narrowing the return type.\n *\n * Replaces the previous pattern of one type-guard + one throw per enum:\n *\n * const x = parseEnum('compare-mode', raw, VALID_COMPARE)\n *\n * Throws a uniform error message that lists the legal values.\n *\n * @internal\n */\nexport function parseEnum(name: string, raw: string, valid: readonly T[]): T {\n if ((valid as readonly string[]).includes(raw)) return raw as T\n throw new Error(`Invalid '${name}' input: \"${raw}\". Must be one of: ${valid.join(', ')}`)\n}\n\n/**\n * Like {@link parseEnum} but passes through `undefined`. Used for inputs that\n * are optional but, when set, must be one of a known set.\n */\nfunction parseOptionalEnum(\n name: string,\n raw: string | undefined,\n valid: readonly T[],\n): T | undefined {\n return raw === undefined ? undefined : parseEnum(name, raw, valid)\n}\n\nfunction required(name: string): string {\n // `@actions/core` throws on missing required inputs, so this never returns\n // empty. Wrapping the call only exists so the throw site has a uniform\n // shape with the rest of the input parsers.\n return core.getInput(name, { required: true })\n}\n\nfunction optional(name: string): string | undefined {\n const v = core.getInput(name)\n return v === '' ? undefined : v\n}\n\nfunction optionalSource(action: ActionName, allowBucketPurge: boolean): string | undefined {\n const v = core.getInput('source')\n if (v !== '') return v\n return action === 'purge' && allowBucketPurge ? '' : undefined\n}\n\nfunction addSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined || value === '') return\n const trimmed = value.trim()\n for (const secret of new Set([value, trimmed])) {\n if (secret === '' || secretValues.has(secret)) continue\n core.setSecret(secret)\n secretValues.add(secret)\n }\n}\n\nfunction addSseSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined) return\n const normalized = value.trim()\n if (normalized === '' || normalized.toUpperCase() === 'B2') return\n\n addSecretValue(secretValues, value)\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n addSecretValue(secretValues, normalized.slice(2).trim())\n }\n}\n\nfunction resolveCredential(inputName: string, envName: string): string {\n const fromInput = optional(inputName)\n if (fromInput !== undefined) return fromInput\n\n const fromEnv = process.env[envName]\n if (fromEnv !== undefined && fromEnv !== '') return fromEnv\n\n throw new Error(`Missing credential: set input '${inputName}' or env var '${envName}'`)\n}\n\n/**\n * Parse a comma-separated action input, trimming entries and dropping blanks.\n *\n * @internal\n */\nexport function splitCsv(value: string | undefined): string[] {\n if (value === undefined) return []\n return value\n .split(',')\n .map((s) => s.trim())\n .filter((s) => s.length > 0)\n}\n\n/**\n * Parse the documented boolean input spellings accepted by this action.\n *\n * @internal\n */\nexport function parseBool(name: string, raw: string): boolean {\n const v = raw.trim().toLowerCase()\n if (v === 'true' || v === '1' || v === 'yes') return true\n if (v === 'false' || v === '0' || v === 'no') return false\n throw new Error(`Invalid boolean for '${name}': \"${raw}\"`)\n}\n\n/**\n * Parse a strictly positive integer input.\n *\n * @internal\n */\nexport function parsePositiveInt(name: string, raw: string): number {\n const trimmed = raw.trim()\n const n = Number(trimmed)\n if (!/^\\d+$/.test(trimmed) || n <= 0 || !Number.isSafeInteger(n)) {\n throw new Error(`Invalid positive integer for '${name}': \"${raw}\"`)\n }\n return n\n}\n","import * as core from '@actions/core'\nimport type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link copyCommand}. Single-file (copy is always one-source-one-destination). */\nexport interface CopyResult {\n /** Source bucket name. */\n sourceBucket: string\n /** Source file name (the B2 key in the source bucket). */\n sourceFileName: string\n /** Destination bucket name. */\n destinationBucket: string\n /** Destination file name (the B2 key in the destination bucket). */\n destinationFileName: string\n /** B2 file ID of the newly-created destination object. */\n fileId: string\n /** Byte size of the copied object. */\n size: number\n}\n\n/**\n * Server-side copy of one B2 object to a new name, within the same bucket or\n * across two buckets in the same account.\n *\n * The copy is done by reference (`b2_copy_file` for small, `b2_copy_part` for\n * large): bytes never traverse the runner. This is dramatically faster and\n * cheaper than download-then-reupload for any non-trivial file.\n *\n * Cross-bucket: set `source-bucket` to the source bucket name. The action's\n * `bucket` input is the destination. The application key must have read\n * permission on the source bucket and write permission on the destination.\n */\nexport async function copyCommand(\n client: B2Client,\n destinationBucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'copy', 'the source B2 file name')\n const destination = inputs.destination\n if (destination === undefined || destination === '') {\n throw new Error(\n \"'destination' input is required for 'copy' action (the destination B2 file name)\",\n )\n }\n\n const sourceBucketName = inputs.sourceBucket ?? destinationBucket.name\n const sourceBucket =\n sourceBucketName === destinationBucket.name\n ? destinationBucket\n : await client.getBucket(sourceBucketName)\n if (!sourceBucket) {\n throw new Error(`Source bucket \"${sourceBucketName}\" not found, or key lacks listBuckets.`)\n }\n\n const hit = await findFileByName(sourceBucket, source, sourceBucketName)\n\n core.startGroup(\n `copy b2://${sourceBucketName}/${source} → b2://${destinationBucket.name}/${destination}`,\n )\n try {\n const recommendedPartSize = client.accountInfo.getRecommendedPartSize()\n const isLarge = hit.contentLength > recommendedPartSize\n const copyOptions = {\n sourceFileId: hit.fileId,\n fileName: destination,\n ...(sourceBucketName !== destinationBucket.name\n ? { destinationBucketId: destinationBucket.id }\n : {}),\n }\n\n const result = isLarge\n ? await destinationBucket.copyLargeFile({\n ...copyOptions,\n ...(signal !== undefined ? { signal } : {}),\n })\n : await destinationBucket.copyFile(copyOptions)\n\n core.info(` copied → fileId=${result.fileId}, size=${result.contentLength}`)\n return {\n sourceBucket: sourceBucketName,\n sourceFileName: source,\n destinationBucket: destinationBucket.name,\n destinationFileName: destination,\n fileId: result.fileId,\n size: result.contentLength,\n }\n } finally {\n core.endGroup()\n }\n}\n","import type {\n Bucket,\n DeleteAllDeleteEvent,\n DeleteAllErrorEvent,\n DeleteAllSkipEvent,\n FileAction,\n} from '@backblaze-labs/b2-sdk'\n\nconst DELETE_FAILED_MESSAGE = 'delete failed'\nconst OUT_OF_PREFIX_MESSAGE = 'listed file is outside requested prefix'\n\n// SDK-deleteAll-compatible events with local extensions for this bypass-governance shim.\nexport type DeleteAllVersionsDeleteEvent = DeleteAllDeleteEvent & {\n readonly action: FileAction\n}\n\nexport type DeleteAllVersionsEvent =\n | DeleteAllVersionsDeleteEvent\n | DeleteAllErrorEvent\n | DeleteAllSkipEvent\n\nexport interface DeleteAllVersionsOptions {\n prefix?: string\n dryRun: boolean\n bypassGovernance: boolean\n signal?: AbortSignal\n}\n\nexport async function* deleteAllVersions(\n bucket: Bucket,\n options: DeleteAllVersionsOptions,\n): AsyncGenerator {\n const versions = bucket.paginateFileVersions({\n ...(options.prefix !== undefined ? { prefix: options.prefix } : {}),\n ...(options.signal !== undefined ? { signal: options.signal } : {}),\n })\n\n while (true) {\n options.signal?.throwIfAborted()\n const next = await versions.next()\n options.signal?.throwIfAborted()\n if (next.done === true) break\n\n const version = next.value\n if (options.prefix !== undefined && !version.fileName.startsWith(options.prefix)) {\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: OUT_OF_PREFIX_MESSAGE,\n }\n continue\n }\n\n if (options.dryRun) {\n yield { type: 'skip', fileName: version.fileName, fileId: version.fileId }\n continue\n }\n\n options.signal?.throwIfAborted()\n try {\n if (options.bypassGovernance) {\n await bucket.deleteFileVersion(version.fileName, version.fileId, {\n bypassGovernance: true,\n })\n } else {\n await bucket.deleteFileVersion(version.fileName, version.fileId)\n }\n yield {\n type: 'delete',\n fileName: version.fileName,\n fileId: version.fileId,\n action: version.action,\n }\n } catch (error) {\n options.signal?.throwIfAborted()\n if (isAbortError(error)) throw error\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: DELETE_FAILED_MESSAGE,\n }\n }\n\n options.signal?.throwIfAborted()\n }\n}\n\nfunction isAbortError(error: unknown): boolean {\n return error instanceof Error && error.name === 'AbortError'\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link DeleteResult.files}. */\nexport interface DeletedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** True for dry-run previews; the file was not actually deleted. */\n skipped: boolean\n}\n\n/** Result of {@link deleteCommand}. */\nexport interface DeleteResult {\n /** One entry per matched file version (including hide markers). */\n files: DeletedFile[]\n /** Count of individual-file delete failures (non-fatal; sums into the dispatcher's `core.setFailed`). */\n errors: number\n}\n\n/**\n * Delete files from B2.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and delete every version\n * matching it.\n * - Otherwise delete the single file by name. We look up the latest version\n * via `listFileNames` to get its `fileId` and call `deleteFileVersion`.\n *\n * With `dry-run: true`, no actual deletions happen; the action reports what\n * would have been deleted.\n */\nexport async function deleteCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'delete', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n if (isPrefix) {\n return deletePrefix(bucket, source, inputs.dryRun, inputs.bypassGovernance, signal)\n }\n return deleteOne(bucket, source, inputs.dryRun, inputs.bypassGovernance)\n}\n\nasync function deletePrefix(\n bucket: Bucket,\n prefix: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n signal?: AbortSignal,\n): Promise {\n const files: DeletedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} prefix b2://${bucket.name}/${prefix}`)\n try {\n for await (const event of deleteAllVersions(bucket, {\n prefix,\n dryRun,\n bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n })) {\n if (event.type === 'delete') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: false })\n core.info(` deleted ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: true })\n core.info(` would delete ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to delete ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n\nasync function deleteOne(\n bucket: Bucket,\n fileName: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n): Promise {\n const hit = await findFileByName(bucket, fileName)\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} b2://${bucket.name}/${fileName}`)\n try {\n if (dryRun) {\n core.info(` would delete ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: true }],\n errors: 0,\n }\n }\n if (bypassGovernance) {\n await bucket.deleteFileVersion(fileName, hit.fileId, { bypassGovernance: true })\n } else {\n await bucket.deleteFileVersion(fileName, hit.fileId)\n }\n core.info(` deleted ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: false }],\n errors: 0,\n }\n } finally {\n core.endGroup()\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream/promises\");","import type { DownloadCallOptions } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from './inputs.ts'\n\nexport type DownloadHeaderOverrides = Pick<\n DownloadCallOptions,\n 'b2CacheControl' | 'b2ContentDisposition' | 'b2ContentType'\n>\n\nconst DOWNLOAD_OVERRIDE_QUERY_PARAMS = {\n b2ContentDisposition: 'b2ContentDisposition',\n b2ContentType: 'b2ContentType',\n b2CacheControl: 'b2CacheControl',\n} as const satisfies Record\n\nconst HTTP_TOKEN_RE = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/\nconst MAX_CONTENT_DISPOSITION_LENGTH = 1024\nconst MAX_CONTENT_TYPE_LENGTH = 255\nconst MAX_CACHE_CONTROL_LENGTH = 1024\n\nexport function downloadHeaderOverridesFromInputs(inputs: ParsedInputs): DownloadHeaderOverrides {\n const contentDisposition = validateContentDisposition(inputs.responseContentDisposition)\n const contentType = validateContentType(inputs.responseContentType)\n const cacheControl = validateCacheControl(inputs.responseCacheControl)\n\n return {\n ...(contentDisposition !== undefined ? { b2ContentDisposition: contentDisposition } : {}),\n ...(contentType !== undefined ? { b2ContentType: contentType } : {}),\n ...(cacheControl !== undefined ? { b2CacheControl: cacheControl } : {}),\n }\n}\n\nexport function appendDownloadHeaderOverrides(\n url: string,\n overrides: DownloadHeaderOverrides,\n): string {\n const entries = Object.entries(DOWNLOAD_OVERRIDE_QUERY_PARAMS) as Array<\n [keyof DownloadHeaderOverrides, string]\n >\n if (entries.every(([key]) => overrides[key] === undefined)) return url\n\n const parsed = new URL(url)\n for (const [key, param] of entries) {\n const value = overrides[key]\n if (value !== undefined) {\n parsed.searchParams.set(param, value)\n }\n }\n return parsed.toString()\n}\n\nfunction validateContentDisposition(value: string | undefined): string | undefined {\n return validateHeaderValue(\n 'response-content-disposition',\n value,\n MAX_CONTENT_DISPOSITION_LENGTH,\n isContentDisposition,\n 'must start with a disposition token and contain only valid parameters',\n )\n}\n\nfunction validateContentType(value: string | undefined): string | undefined {\n return validateHeaderValue(\n 'response-content-type',\n value,\n MAX_CONTENT_TYPE_LENGTH,\n isContentType,\n 'must be a media type such as application/pdf, with optional valid parameters',\n )\n}\n\nfunction validateCacheControl(value: string | undefined): string | undefined {\n return validateHeaderValue(\n 'response-cache-control',\n value,\n MAX_CACHE_CONTROL_LENGTH,\n isCacheControl,\n 'must contain comma-separated Cache-Control directives',\n )\n}\n\nfunction validateHeaderValue(\n inputName: string,\n value: string | undefined,\n maxLength: number,\n isValidFormat: (value: string) => boolean,\n formatDescription: string,\n): string | undefined {\n if (value === undefined) return undefined\n if (value.length > maxLength) {\n throw new Error(`Invalid '${inputName}' input: must be at most ${maxLength} characters`)\n }\n if (containsHttpControlCharacter(value)) {\n throw new Error(`Invalid '${inputName}' input: must not contain HTTP control characters`)\n }\n if (!isValidFormat(value)) {\n throw new Error(`Invalid '${inputName}' input: ${formatDescription}`)\n }\n return value\n}\n\nfunction containsHttpControlCharacter(value: string): boolean {\n for (let i = 0; i < value.length; i += 1) {\n const code = value.charCodeAt(i)\n if (code <= 0x1f || code === 0x7f) return true\n }\n return false\n}\n\nfunction isContentDisposition(value: string): boolean {\n const parts = splitOutsideQuotes(value, ';')\n if (parts === null || parts.length === 0 || !isHttpToken(parts[0])) return false\n return parts.slice(1).every(isParameter)\n}\n\nfunction isContentType(value: string): boolean {\n const parts = splitOutsideQuotes(value, ';')\n if (parts === null || parts.length === 0) return false\n\n const [type, subtype, ...extra] = parts[0]?.split('/') ?? []\n if (extra.length > 0 || !isHttpToken(type) || !isHttpToken(subtype)) return false\n return parts.slice(1).every(isParameter)\n}\n\nfunction isCacheControl(value: string): boolean {\n const directives = splitOutsideQuotes(value, ',')\n if (directives === null || directives.length === 0) return false\n return directives.every((directive) => {\n if (directive === '') return false\n const equals = directive.indexOf('=')\n if (equals === -1) return isHttpToken(directive)\n\n const name = directive.slice(0, equals).trim()\n const rawValue = directive.slice(equals + 1).trim()\n return isHttpToken(name) && isHeaderParameterValue(rawValue)\n })\n}\n\nfunction isParameter(value: string): boolean {\n const equals = value.indexOf('=')\n if (equals <= 0) return false\n\n const name = value.slice(0, equals).trim()\n const rawValue = value.slice(equals + 1).trim()\n return isHttpToken(name) && isHeaderParameterValue(rawValue)\n}\n\nfunction isHeaderParameterValue(value: string): boolean {\n return isHttpToken(value) || isQuotedString(value)\n}\n\nfunction isHttpToken(value: string | undefined): boolean {\n return value !== undefined && HTTP_TOKEN_RE.test(value)\n}\n\nfunction isQuotedString(value: string): boolean {\n if (value.length < 2 || !value.startsWith('\"') || !value.endsWith('\"')) return false\n for (let i = 1; i < value.length - 1; i += 1) {\n const char = value[i]\n if (char === '\"') return false\n if (char === '\\\\') {\n i += 1\n if (i >= value.length - 1) return false\n }\n }\n return true\n}\n\nfunction splitOutsideQuotes(value: string, separator: ';' | ','): string[] | null {\n const parts: string[] = []\n let start = 0\n let quoted = false\n let escaped = false\n\n for (let i = 0; i < value.length; i += 1) {\n const char = value[i]\n if (escaped) {\n escaped = false\n continue\n }\n if (quoted && char === '\\\\') {\n escaped = true\n continue\n }\n if (char === '\"') {\n quoted = !quoted\n continue\n }\n if (!quoted && char === separator) {\n parts.push(value.slice(start, i).trim())\n start = i + 1\n }\n }\n\n if (quoted || escaped) return null\n parts.push(value.slice(start).trim())\n return parts\n}\n","import type { Stats } from 'node:fs'\nimport { stat } from 'node:fs/promises'\n\n/**\n * `stat(path)` that returns `undefined` instead of throwing on ENOENT/EACCES\n * etc. Used at filesystem boundaries where the caller wants to distinguish\n * \"doesn't exist / not readable\" from \"exists with shape X\" without juggling\n * try/catch at every call site.\n */\nexport async function tryStat(path: string): Promise {\n return stat(path).catch(() => undefined)\n}\n","/**\n * Format a byte count with KB/MB/GB suffixes.\n *\n * Single source of truth so the workflow log (progress.ts) and the step\n * summary table (summary.ts) never drift on thresholds or rounding.\n */\nexport function formatBytes(n: number): string {\n if (n < 1024) return `${n} B`\n if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`\n if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`\n return `${(n / 1024 / 1024 / 1024).toFixed(2)} GB`\n}\n","import * as core from '@actions/core'\nimport type { ProgressEvent, ProgressListener } from '@backblaze-labs/b2-sdk'\nimport { formatBytes } from './format.ts'\n\n/**\n * Build a progress listener that throttles output to one update per\n * `intervalMs` (default 1s) so a long-running upload doesn't flood the\n * workflow log with thousands of lines. The first event and the final\n * event are always emitted.\n */\nexport function makeProgressListener(label: string, intervalMs = 1000): ProgressListener {\n let lastEmit = 0\n let lastBytes = 0\n let lastTime = Date.now()\n\n return (event: ProgressEvent) => {\n const now = Date.now()\n const isFirst = lastEmit === 0\n const isFinal = event.totalBytes !== null && event.bytesTransferred >= event.totalBytes\n const due = now - lastEmit >= intervalMs\n\n if (!isFirst && !isFinal && !due) return\n\n const elapsedMs = Math.max(1, now - lastTime)\n const deltaBytes = event.bytesTransferred - lastBytes\n const mbps = (deltaBytes / 1024 / 1024) * (1000 / elapsedMs)\n\n const pct =\n event.totalBytes !== null && event.totalBytes > 0\n ? `${Math.round((event.bytesTransferred / event.totalBytes) * 100)}%`\n : '?%'\n\n const parts =\n event.totalParts !== null ? ` (${event.partsCompleted}/${event.totalParts} parts)` : ''\n\n const totalSuffix = event.totalBytes !== null ? ` / ${formatBytes(event.totalBytes)}` : ''\n core.info(\n `${label} ${pct}${parts} ${formatBytes(event.bytesTransferred)}${totalSuffix} @ ${mbps.toFixed(2)} MB/s`,\n )\n\n lastEmit = now\n lastBytes = event.bytesTransferred\n lastTime = now\n }\n}\n","import { randomUUID } from 'node:crypto'\nimport { createWriteStream } from 'node:fs'\nimport { mkdir, realpath, rename, unlink, writeFile } from 'node:fs/promises'\nimport { dirname, isAbsolute, relative, resolve, sep } from 'node:path'\nimport { Readable, Transform } from 'node:stream'\nimport { pipeline } from 'node:stream/promises'\nimport * as core from '@actions/core'\nimport type { Bucket, SseCDownloadKey } from '@backblaze-labs/b2-sdk'\nimport {\n type DownloadHeaderOverrides,\n downloadHeaderOverridesFromInputs,\n} from '../download-overrides.ts'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link DownloadResult.files}. */\nexport interface DownloadedFile {\n /** B2 file name (the key that was fetched). */\n fileName: string\n /** Absolute path on the runner where the body landed. */\n localPath: string\n /** Byte size of the downloaded body. */\n size: number\n /** Remote SHA-1, or `null` if the file was multipart-uploaded (B2 doesn't store a whole-file SHA-1 in that case). */\n contentSha1: string | null\n}\n\n/** Result of {@link downloadCommand}. */\nexport interface DownloadResult {\n /** One entry per downloaded file. Single-file modes return a one-element array. */\n files: DownloadedFile[]\n /** Total bytes transferred across all files. */\n bytesTransferred: number\n}\n\ninterface PathSafetyContext {\n realRoot: string\n safeAncestorDirs: Set\n}\n\ninterface DownloadPathSafety {\n root: string\n realRoot: string\n}\n\ninterface PlannedDownload {\n fileName: string\n localPath: string\n}\n\ninterface LocalPathOwner {\n fileName: string\n localPath: string\n}\n\ninterface ReplaceDownloadedFileOptions {\n platform?: NodeJS.Platform\n renameFile?: typeof rename\n unlinkFile?: typeof unlink\n}\n\n/**\n * Download from B2 to the local runner.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and download every file\n * under it to the local directory at `destination` (defaults to `.`).\n * - Otherwise download a single file. If `destination` ends with `/` or\n * resolves to an existing directory, write into that directory using the\n * basename of `source`. Else `destination` is the exact output file path.\n * If unset, the file's basename is used in the current working directory.\n */\nexport async function downloadCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'download', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n const sseDownload = sseFromInputs(inputs)\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n\n if (isPrefix) {\n return downloadPrefix(\n bucket,\n source,\n inputs.destination ?? '.',\n sseDownload,\n downloadOverrides,\n signal,\n )\n }\n const out = await downloadOne(\n bucket,\n source,\n inputs.destination,\n sseDownload,\n downloadOverrides,\n signal,\n )\n return { files: [out], bytesTransferred: out.size }\n}\n\nfunction sseFromInputs(inputs: ParsedInputs): SseCDownloadKey | undefined {\n const e = inputs.encryption\n if (e === undefined || e.mode !== 'SSE-C') return undefined\n return {\n algorithm: 'AES256',\n customerKey: e.customerKey,\n customerKeyMd5: e.customerKeyMd5,\n }\n}\n\nasync function downloadPrefix(\n bucket: Bucket,\n prefix: string,\n destinationDir: string,\n sseDownload: SseCDownloadKey | undefined,\n downloadOverrides: DownloadHeaderOverrides,\n signal?: AbortSignal,\n): Promise {\n const destRoot = resolve(destinationDir)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n const downloadPathSafety = { root: destRoot, realRoot: pathSafety.realRoot }\n const caseInsensitivePaths = await isCaseInsensitiveDirectory(destRoot)\n\n const planned: PlannedDownload[] = []\n const localPathOwners = new Map()\n const localPathAncestorOwners = new Map()\n let startFileName: string | undefined\n\n for (;;) {\n signal?.throwIfAborted()\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n signal?.throwIfAborted()\n // `listFileNames({ prefix })` returns files matching `prefix` per the\n // SDK / B2 contract, so the slice is always safe. Empty `prefix`\n // leaves the name unchanged.\n const relName = f.fileName.slice(prefix.length)\n const localPath = await resolvePathUnderRoot(\n destRoot,\n safeRemotePathSegments(relName, f.fileName),\n f.fileName,\n pathSafety,\n )\n recordPlannedLocalPath(\n { fileName: f.fileName, localPath },\n destRoot,\n caseInsensitivePaths,\n localPathOwners,\n localPathAncestorOwners,\n )\n planned.push({ fileName: f.fileName, localPath })\n }\n // SDK contract: `nextFileName` is `string | null` per `ListFileNamesResponse`.\n // The \"not null\" arm fires for prefixes with >1000 files (covered by\n // the real-pagination test in coverage-stress).\n if (page.nextFileName === null) break\n startFileName = page.nextFileName\n }\n\n const files: DownloadedFile[] = []\n let total = 0\n for (const plan of planned) {\n signal?.throwIfAborted()\n core.startGroup(`download b2://${bucket.name}/${plan.fileName} → ${plan.localPath}`)\n try {\n const r = await downloadOne(\n bucket,\n plan.fileName,\n plan.localPath,\n sseDownload,\n downloadOverrides,\n signal,\n downloadPathSafety,\n )\n files.push(r)\n total += r.size\n } finally {\n core.endGroup()\n }\n }\n\n return { files, bytesTransferred: total }\n}\n\nasync function downloadOne(\n bucket: Bucket,\n fileName: string,\n destination: string | undefined,\n sseDownload: SseCDownloadKey | undefined,\n downloadOverrides: DownloadHeaderOverrides,\n signal?: AbortSignal,\n pathSafety?: DownloadPathSafety,\n): Promise {\n const localPath =\n pathSafety !== undefined && destination !== undefined\n ? resolve(destination)\n : await resolveLocalPath(fileName, destination)\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n await mkdir(dirname(localPath), { recursive: true })\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n\n const result = await bucket.download(fileName, {\n ...(sseDownload !== undefined ? { serverSideEncryption: sseDownload } : {}),\n ...downloadOverrides,\n ...(signal !== undefined ? { signal } : {}),\n })\n const size = result.headers.contentLength\n const sha1 = result.headers.contentSha1\n\n // Wrap the body in a byte-counting Transform that synthesizes ProgressEvents\n // for the shared progress listener. The SDK doesn't expose progress for\n // single-shot downloads; we compute it here from the known content-length.\n const onProgress = makeProgressListener(`download[${fileName}]`)\n const startedAt = Date.now()\n let bytesSeen = 0\n const counter = new Transform({\n transform(chunk: Buffer, _enc, cb) {\n // The transform only runs when the body has bytes to push; for a zero-\n // length response Node's stream pipeline closes without invoking it,\n // so `size` is provably > 0 here.\n bytesSeen += chunk.length\n onProgress({\n bytesTransferred: bytesSeen,\n totalBytes: size,\n partsCompleted: 0,\n totalParts: null,\n elapsedMs: Date.now() - startedAt,\n })\n cb(null, chunk)\n },\n })\n\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n const tempPath = `${localPath}.b2-action-download-${randomUUID()}.tmp`\n const writeStream = createWriteStream(tempPath, { flags: 'wx' })\n try {\n await pipeline(\n Readable.fromWeb(result.body as unknown as Parameters[0]),\n counter,\n writeStream,\n )\n await replaceDownloadedFile(tempPath, localPath)\n } catch (err) {\n // Partial download on disk is worse than no file. Write through a\n // same-directory temporary file and rename only after the body completes,\n // which also avoids following an existing symlink at the final leaf.\n try {\n await unlink(tempPath)\n } catch {\n // ignore: best-effort cleanup, the original error matters more\n }\n throw err\n }\n\n core.info(` wrote ${size} bytes to ${localPath} (sha1=${sha1 ?? 'multipart'})`)\n\n return { fileName, localPath, size, contentSha1: sha1 }\n}\n\n/**\n * Atomically move a completed same-directory download into place.\n *\n * @internal\n */\nexport async function replaceDownloadedFile(\n tempPath: string,\n localPath: string,\n {\n platform = process.platform,\n renameFile = rename,\n unlinkFile = unlink,\n }: ReplaceDownloadedFileOptions = {},\n): Promise {\n try {\n await renameFile(tempPath, localPath)\n } catch (renameError) {\n const retryWindowsOverwrite =\n platform === 'win32' &&\n typeof renameError === 'object' &&\n renameError !== null &&\n 'code' in renameError &&\n (renameError.code === 'EEXIST' || renameError.code === 'EPERM')\n if (!retryWindowsOverwrite) throw renameError\n\n // Windows refuses to rename over an existing leaf. Remove only the leaf\n // path, which unlinks symlinks instead of following them, then retry the\n // completed same-directory temp-file move.\n try {\n await unlinkFile(localPath)\n } catch (unlinkError) {\n if (!isFileNotFound(unlinkError)) throw unlinkError\n }\n await renameFile(tempPath, localPath)\n }\n}\n\n/**\n * Resolve the local target path for a single B2 download.\n *\n * @internal\n */\nexport async function resolveLocalPath(\n fileName: string,\n destination: string | undefined,\n): Promise {\n if (destination === undefined || destination === '') {\n return resolve(safeRemotePathTail(fileName))\n }\n if (destination.endsWith('/') || destination.endsWith('\\\\')) {\n const destRoot = resolve(destination)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n const s = await tryStat(destination)\n if (s?.isDirectory()) {\n const destRoot = resolve(destination)\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n return resolve(destination)\n}\n\nasync function resolvePathUnderRoot(\n root: string,\n segments: string[],\n fileName: string,\n pathSafety: PathSafetyContext,\n) {\n const localPath = resolve(root, ...segments)\n const rel = relative(root, localPath)\n if (!isPathInsideRootRelative(rel)) {\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n }\n await assertExistingAncestryInsideRoot(pathSafety, localPath, fileName)\n return localPath\n}\n\nfunction isPathInsideRootRelative(rel: string): boolean {\n return rel === '' || (!isAbsolute(rel) && rel !== '..' && !rel.startsWith(`..${sep}`))\n}\n\nasync function createPathSafetyContext(root: string): Promise {\n return { realRoot: await realpath(root), safeAncestorDirs: new Set([root]) }\n}\n\nasync function assertFreshAncestryInsideRoot(\n pathSafety: DownloadPathSafety,\n localPath: string,\n fileName: string,\n): Promise {\n await assertExistingAncestryInsideRoot(\n { realRoot: pathSafety.realRoot, safeAncestorDirs: new Set() },\n localPath,\n fileName,\n )\n}\n\nasync function assertExistingAncestryInsideRoot(\n pathSafety: PathSafetyContext,\n localPath: string,\n fileName: string,\n): Promise {\n let candidate = dirname(localPath)\n const checkedDirs: string[] = []\n\n for (;;) {\n if (pathSafety.safeAncestorDirs.has(candidate)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n checkedDirs.push(candidate)\n try {\n const realCandidate = await realpath(candidate)\n const rel = relative(pathSafety.realRoot, realCandidate)\n if (isPathInsideRootRelative(rel)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n } catch (error) {\n if (!isFileNotFound(error)) throw error\n const parent = dirname(candidate)\n if (parent === candidate) throw error\n candidate = parent\n }\n }\n}\n\nfunction isFileNotFound(error: unknown): boolean {\n return typeof error === 'object' && error !== null && 'code' in error && error.code === 'ENOENT'\n}\n\nasync function isCaseInsensitiveDirectory(dir: string): Promise {\n const marker = `.b2-action-case-check-${randomUUID()}`\n const lowerPath = resolve(dir, marker.toLowerCase())\n const upperPath = resolve(dir, marker.toUpperCase())\n\n try {\n await writeFile(lowerPath, '')\n } catch (error) {\n core.warning(\n `Could not probe case sensitivity in ${dir}; treating download collision checks as case-sensitive (${error instanceof Error ? error.message : String(error)})`,\n )\n return false\n }\n try {\n try {\n return (await realpath(lowerPath)) === (await realpath(upperPath))\n } catch (error) {\n if (isFileNotFound(error)) return false\n throw error\n }\n } finally {\n try {\n await unlink(lowerPath)\n } catch (error) {\n core.warning(\n `Could not remove B2 action case-sensitivity probe ${lowerPath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n}\n\nfunction localPathCollisionKey(localPath: string, caseInsensitivePaths: boolean): string {\n return caseInsensitivePaths ? localPath.toLowerCase() : localPath\n}\n\nfunction recordPlannedLocalPath(\n owner: LocalPathOwner,\n root: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n localPathAncestorOwners: Map,\n): void {\n const collisionKey = localPathCollisionKey(owner.localPath, caseInsensitivePaths)\n const existingFile = localPathOwners.get(collisionKey)\n if (existingFile !== undefined && existingFile.fileName !== owner.fileName) {\n throw new Error(\n `download path collision: B2 files \"${existingFile.fileName}\" and \"${owner.fileName}\" both map to \"${owner.localPath}\"`,\n )\n }\n\n const existingDescendant = localPathAncestorOwners.get(collisionKey)\n if (existingDescendant !== undefined && existingDescendant.fileName !== owner.fileName) {\n throwFileDirectoryCollision(owner, existingDescendant)\n }\n\n const existingAncestor = findLocalPathFileAncestor(\n root,\n owner.localPath,\n caseInsensitivePaths,\n localPathOwners,\n )\n if (existingAncestor !== undefined && existingAncestor.fileName !== owner.fileName) {\n throwFileDirectoryCollision(existingAncestor, owner)\n }\n\n localPathOwners.set(collisionKey, owner)\n rememberLocalPathAncestors(root, owner, caseInsensitivePaths, localPathAncestorOwners)\n}\n\nfunction findLocalPathFileAncestor(\n root: string,\n localPath: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n): LocalPathOwner | undefined {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return undefined\n const owner = localPathOwners.get(parentKey)\n if (owner !== undefined) return owner\n const next = dirname(parent)\n if (next === parent) return undefined\n parent = next\n }\n}\n\nfunction rememberLocalPathAncestors(\n root: string,\n owner: LocalPathOwner,\n caseInsensitivePaths: boolean,\n localPathAncestorOwners: Map,\n): void {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(owner.localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return\n if (!localPathAncestorOwners.has(parentKey)) localPathAncestorOwners.set(parentKey, owner)\n const next = dirname(parent)\n if (next === parent) return\n parent = next\n }\n}\n\nfunction throwFileDirectoryCollision(\n fileOwner: LocalPathOwner,\n descendantOwner: LocalPathOwner,\n): never {\n throw new Error(\n `download path collision: B2 file \"${fileOwner.fileName}\" maps to \"${fileOwner.localPath}\", which must be a file, but B2 file \"${descendantOwner.fileName}\" maps beneath it at \"${descendantOwner.localPath}\"`,\n )\n}\n\nfunction safeRemotePathSegments(fileName: string, displayName = fileName): string[] {\n const segments = fileName.split('/')\n for (const segment of segments) {\n validateRemotePathSegment(segment, displayName)\n }\n return segments\n}\n\nfunction safeRemotePathTail(fileName: string): string {\n const tail = fileName.split('/').at(-1) ?? ''\n validateRemotePathSegment(tail, fileName)\n return tail\n}\n\nfunction validateRemotePathSegment(segment: string, fileName: string): void {\n if (segment === '' || segment === '.' || segment === '..') {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains an empty, \".\" or \"..\" path segment`,\n )\n }\n for (const char of segment) {\n const codePoint = char.codePointAt(0)\n if (codePoint !== undefined && (codePoint <= 0x1f || codePoint === 0x7f)) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains a control character`,\n )\n }\n }\n\n // B2 keys are opaque, but prefix downloads must project `/`-separated\n // keys into the runner filesystem without path traversal or lossy rewrites.\n // POSIX runners can preserve characters such as `:`, `?`, trailing dots,\n // and Windows device names verbatim. Windows treats several of those as\n // separators or invalid/reserved filenames, so reject them there instead of\n // silently changing the on-disk name or risking two B2 keys overwriting one\n // local path.\n if (\n process.platform === 'win32' &&\n (/[<>:\"|?*\\\\]/u.test(segment) ||\n /[. ]$/u.test(segment) ||\n /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/iu.test(segment))\n ) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped on Windows because segment \"${segment}\" is reserved or contains a Windows path character`,\n )\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link headCommand}: metadata read from a HEAD request, no body. */\nexport interface HeadResult {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file (from `Content-Length`). */\n size: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** B2-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Custom `X-Bz-Info-*` headers attached at upload time. */\n fileInfo: Record\n}\n\n/**\n * HEAD-only metadata probe. Fetches the headers of an object without\n * downloading the body. Useful for cheap \"does this exist and what's its\n * size / sha1 / contentType?\" checks, or to inspect custom `fileInfo`\n * metadata that the uploader attached.\n *\n * Returns all output fields as step outputs so downstream steps can branch\n * on them.\n */\nexport async function headCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'head', 'the B2 file name')\n\n core.startGroup(`head b2://${bucket.name}/${source}`)\n try {\n // `bucket.head` returns only the parsed response headers; no body to\n // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n const { headers: h } = await bucket.head(source)\n core.info(\n ` size=${h.contentLength} type=${h.contentType} sha1=${h.contentSha1 ?? 'multipart'}`,\n )\n return {\n fileName: h.fileName,\n fileId: h.fileId,\n size: h.contentLength,\n contentType: h.contentType,\n contentSha1: h.contentSha1,\n uploadTimestamp: h.uploadTimestamp,\n fileInfo: h.fileInfo,\n }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link hideCommand}: identifies the hide marker that was just created. */\nexport interface HideResult {\n /** B2 file name that was hidden. */\n fileName: string\n /** File ID of the hide marker (a special version with `action: 'hide'`). */\n fileId: string\n}\n\n/**\n * Hide a file in B2 (creates a \"hide marker\" file version that masks the\n * previous version from `listFileNames` and downloads-by-name).\n *\n * Versioning is always on in B2, so hide is a soft-delete: the underlying\n * data and prior versions remain until lifecycle rules collect them. To\n * permanently delete, use the `delete` command.\n *\n * To unhide, run `delete` against the hide marker's `fileId` (use `list`\n * with versions if you need to discover it).\n */\nexport async function hideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'hide', 'the B2 file name')\n\n core.startGroup(`hide b2://${bucket.name}/${source}`)\n try {\n const result = await bucket.hideFile(source)\n core.info(` hidden: ${result.fileName} (marker fileId=${result.fileId})`)\n return { fileName: result.fileName, fileId: result.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\n\n/** One entry in {@link ListResult.files}. Mirrors the SDK's per-version metadata. */\nexport interface ListedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file. */\n size: number\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** Server-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Custom `X-Bz-Info-*` headers from upload time. */\n fileInfo: Record\n}\n\n/** Result of {@link listCommand}. */\nexport interface ListResult {\n /** Files matching the prefix, capped by `maxResults`. */\n files: ListedFile[]\n /** True when more visible upload files exist beyond `maxResults`. Use to detect pagination. */\n truncated: boolean\n}\n\n/**\n * List file names under a prefix.\n *\n * `source` is the prefix (use trailing `/` to list a \"directory\"). Empty\n * `source` lists everything the application key is allowed to see. Pagination\n * is followed transparently up to `max-results` matches.\n *\n * Useful for \"decide what to do next\" workflow steps:\n * - inventory before a delete\n * - find the most recent release artifact to promote\n * - emit a JSON manifest as a build output\n */\nexport async function listCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const prefix = inputs.source ?? ''\n const maxResults = inputs.maxResults\n const files: ListedFile[] = []\n let startFileName: string | undefined\n\n core.startGroup(`list b2://${bucket.name}/${prefix} (max ${maxResults})`)\n try {\n while (files.length < maxResults) {\n const remaining = maxResults - files.length\n const pageSize = Math.min(1000, remaining)\n const page = await bucket.listFileNames({\n prefix,\n pageSize,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n files.push({\n fileName: f.fileName,\n fileId: f.fileId,\n size: f.contentLength,\n contentSha1: f.contentSha1,\n uploadTimestamp: f.uploadTimestamp,\n contentType: f.contentType,\n fileInfo: f.fileInfo,\n })\n if (files.length >= maxResults) {\n if (!page.nextFileName) return { files, truncated: false }\n return {\n files,\n truncated: await hasVisibleUploadAfter(bucket, prefix, page.nextFileName),\n }\n }\n }\n\n if (!page.nextFileName) {\n return { files, truncated: false }\n }\n startFileName = page.nextFileName\n }\n\n return { files, truncated: true }\n } finally {\n core.info(` ${files.length} file(s) listed`)\n core.endGroup()\n }\n}\n\nasync function hasVisibleUploadAfter(\n bucket: Bucket,\n prefix: string,\n startFileName: string,\n): Promise {\n let cursor: string | undefined = startFileName\n\n while (cursor !== undefined) {\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n startFileName: cursor,\n })\n if (page.files.some((f) => f.action === 'upload')) return true\n cursor = page.nextFileName ?? undefined\n }\n\n return false\n}\n","function createS3ClientConfig(config) {\n const s3Url = config.accountInfo.getS3ApiUrl();\n const regionMatch = s3Url.match(/s3\\.([^.]+)\\.backblazeb2\\.com/);\n const region = config.region ?? regionMatch?.[1] ?? \"us-west-004\";\n return {\n endpoint: s3Url,\n region,\n credentials: {\n accessKeyId: config.applicationKeyId,\n secretAccessKey: config.applicationKey\n },\n forcePathStyle: true\n };\n}\nfunction presignGetObjectUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds = 3600) {\n const expires = Math.floor(Date.now() / 1e3) + validDurationInSeconds;\n return `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeURIComponent(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;\n}\nexport {\n createS3ClientConfig,\n presignGetObjectUrl\n};\n//# sourceMappingURL=index.js.map\n","import * as core from '@actions/core'\nimport type { B2Client, Bucket, DownloadAuthorizationRequest } from '@backblaze-labs/b2-sdk'\nimport { presignGetObjectUrl } from '@backblaze-labs/b2-sdk/s3'\nimport {\n appendDownloadHeaderOverrides,\n type DownloadHeaderOverrides,\n downloadHeaderOverridesFromInputs,\n} from '../download-overrides.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** One entry in {@link PresignResult.files}. */\nexport interface PresignedFile {\n /** B2 file name (the key the URL grants access to). */\n fileName: string\n /** Presigned download URL. Masked via `core.setSecret` before this struct is logged. */\n url: string\n /** Expiration time as milliseconds since the epoch. */\n expiresAt: number\n}\n\n/** Result of {@link presignCommand}. */\nexport interface PresignResult {\n /** One entry per generated URL. Single-file mode returns a one-element array. */\n files: PresignedFile[]\n}\n\n/**\n * Generate a presigned download URL for one B2 file or every file under a\n * prefix.\n *\n * Modes:\n * - `source` ending in `/` → prefix mode. List the prefix and emit one\n * presigned URL per file (capped by `max-results`). All URLs share the\n * same `b2_get_download_authorization` token because the auth scope is\n * prefix-based; we just expand it into one URL per matched object.\n * - Otherwise → single-file mode (the original behavior).\n *\n * Every URL is masked via `core.setSecret` so subsequent log lines redact\n * them. The first URL is also exposed as the `presigned-url` step output\n * for the most common one-file workflow.\n */\nexport async function presignCommand(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'presign', 'the B2 file name or prefix')\n\n if (source.endsWith('/')) {\n return presignPrefix(client, bucket, inputs, source)\n }\n\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n return {\n files: [\n await presignOne(client, bucket, source, inputs.presignTtlSeconds, source, downloadOverrides),\n ],\n }\n}\n\nasync function presignPrefix(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n prefix: string,\n): Promise {\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n // One auth token covers the whole prefix (that's exactly what\n // `b2_get_download_authorization` is designed for).\n const auth = await getDownloadAuthorization(\n client,\n bucket,\n prefix,\n inputs.presignTtlSeconds,\n downloadOverrides,\n )\n core.setSecret(auth.authorizationToken)\n const expiresAt = Math.floor(Date.now() / 1000) + inputs.presignTtlSeconds\n\n const files: PresignedFile[] = []\n let startFileName: string | undefined\n core.startGroup(`presign prefix b2://${bucket.name}/${prefix} (TTL ${inputs.presignTtlSeconds}s)`)\n try {\n while (files.length < inputs.maxResults) {\n const remaining = inputs.maxResults - files.length\n const page = await bucket.listFileNames({\n prefix,\n pageSize: Math.min(1000, remaining),\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n const url = appendDownloadHeaderOverrides(\n presignGetObjectUrl(\n downloadUrl,\n bucket.name,\n f.fileName,\n auth.authorizationToken,\n inputs.presignTtlSeconds,\n ),\n downloadOverrides,\n )\n core.setSecret(url)\n files.push({ fileName: f.fileName, url, expiresAt })\n if (files.length >= inputs.maxResults) break\n }\n if (!page.nextFileName) break\n startFileName = page.nextFileName\n }\n } finally {\n core.info(` generated ${files.length} presigned URL(s)`)\n core.endGroup()\n }\n return { files }\n}\n\nasync function presignOne(\n client: B2Client,\n bucket: Bucket,\n fileName: string,\n ttlSeconds: number,\n authPrefix: string,\n downloadOverrides: DownloadHeaderOverrides,\n): Promise {\n const auth = await getDownloadAuthorization(\n client,\n bucket,\n authPrefix,\n ttlSeconds,\n downloadOverrides,\n )\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const url = appendDownloadHeaderOverrides(\n presignGetObjectUrl(downloadUrl, bucket.name, fileName, auth.authorizationToken, ttlSeconds),\n downloadOverrides,\n )\n core.setSecret(auth.authorizationToken)\n core.setSecret(url)\n const expiresAt = Math.floor(Date.now() / 1000) + ttlSeconds\n core.info(`presigned URL for ${fileName} valid for ${ttlSeconds}s (expires at ${expiresAt})`)\n return { fileName, url, expiresAt }\n}\n\nasync function getDownloadAuthorization(\n client: B2Client,\n bucket: Bucket,\n fileNamePrefix: string,\n validDurationInSeconds: number,\n downloadOverrides: DownloadHeaderOverrides,\n) {\n const request = {\n bucketId: bucket.id,\n fileNamePrefix,\n validDurationInSeconds,\n ...downloadOverrides,\n } satisfies DownloadAuthorizationRequest\n\n return await client.raw.getDownloadAuthorization(\n client.accountInfo.getApiUrl(),\n client.accountInfo.getAuthToken(),\n request,\n )\n}\n","import * as core from '@actions/core'\nimport type { Bucket, FileAction } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link PurgeResult.files}. */\nexport interface PurgedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID of the version that was purged. */\n fileId: string\n /** Which kind of version this entry refers to, or `skip` for dry-run previews. */\n action: FileAction | 'skip'\n /** True for dry-run previews; the version was not actually purged. */\n skipped: boolean\n}\n\n/** Result of {@link purgeCommand}. */\nexport interface PurgeResult {\n /** One entry per matched version (live, prior, and hide markers). */\n files: PurgedFile[]\n /** Count of individual-version purge failures. */\n errors: number\n}\n\n/**\n * Permanently delete every file version (including hide markers and historic\n * uploads) under a prefix. Differs from `delete` in that `delete`'s\n * implementation streams over `listFileVersions` and removes all versions,\n * but `purge` makes the wipe-the-prefix intent explicit and warns loudly.\n *\n * If `source` is empty or `/`, this purges the **entire bucket** only when\n * `allow-bucket-purge: true` is also set. Default behavior is to require a\n * scoped prefix so an omitted source cannot become a bucket-wide wipe.\n *\n * Supports `dry-run` to preview what would be deleted.\n */\nexport async function purgeCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const bucketWide = inputs.source === undefined || inputs.source === '' || inputs.source === '/'\n if (bucketWide && !inputs.allowBucketPurge) {\n throw new Error(\n \"'allow-bucket-purge' must be true for whole-bucket purge (set 'source' to a prefix for scoped purge)\",\n )\n }\n const source = inputs.source ?? ''\n const prefix = bucketWide ? '' : source.endsWith('/') ? source : `${source}/`\n const dryRun = inputs.dryRun\n\n if (prefix === '' && !dryRun) {\n core.warning(\n `purge will permanently delete EVERY version in bucket \"${bucket.name}\". Continuing because allow-bucket-purge is true.`,\n )\n }\n\n const files: PurgedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'purge'} b2://${bucket.name}/${prefix} (all versions)`)\n try {\n const opts = {\n ...(prefix !== '' ? { prefix } : {}),\n dryRun,\n bypassGovernance: inputs.bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n }\n for await (const event of deleteAllVersions(bucket, opts)) {\n if (event.type === 'delete') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: event.action,\n skipped: false,\n })\n core.info(` purged ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: 'skip',\n skipped: true,\n })\n core.info(` would purge ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to purge ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link retentionCommand}: describes what was applied to the target version. */\nexport interface RetentionResult {\n /** B2 file name the retention/hold was applied to. */\n fileName: string\n /** B2 file ID of the version that was modified. */\n fileId: string\n /** Retention mode after the call. `none` means retention was cleared. Undefined if only legal-hold was touched. */\n appliedMode: 'compliance' | 'governance' | 'none' | undefined\n /** Retention expiration timestamp (ms since the epoch). `null` when mode is `none`. */\n retainUntilTimestamp: number | null | undefined\n /** Legal-hold state after the call. Undefined when not touched by this invocation. */\n appliedLegalHold: 'on' | 'off' | undefined\n}\n\n/**\n * Apply Object Lock retention settings and/or a legal hold to a specific\n * file version.\n *\n * The bucket must have Object Lock enabled. Three inputs drive this command:\n * - `retention-mode`: `compliance` | `governance` | `none`. Required if\n * `retention-until` is set.\n * - `retention-until`: ISO 8601 timestamp (e.g. `2027-01-01T00:00:00Z`).\n * Required if `retention-mode` is `compliance` or `governance`.\n * - `legal-hold`: `on` | `off`. Independent of retention; can be set on\n * its own or alongside retention.\n * - `bypass-governance` (bool): allows shortening a governance retention.\n *\n * At least one of `retention-mode` / `legal-hold` must be supplied.\n *\n * The target file version is resolved by exact name only when the latest\n * version is an upload.\n */\nexport async function retentionCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'retention', 'the B2 file name')\n\n const mode = inputs.retentionMode\n const until = inputs.retentionUntil\n const legalHold = inputs.legalHold\n\n if (mode === undefined && legalHold === undefined) {\n throw new Error(\"retention requires at least one of 'retention-mode' or 'legal-hold' to be set\")\n }\n\n // Resolve the retention expiration up front so TypeScript narrows `until`\n // inside the parse branch and the downstream call site doesn't need a cast.\n let retainUntilMillis: number | null = null\n if (mode === 'compliance' || mode === 'governance') {\n if (until === undefined) {\n throw new Error(\n `'retention-until' (ISO 8601 timestamp) is required when 'retention-mode' is '${mode}'`,\n )\n }\n const parsed = Date.parse(until)\n if (Number.isNaN(parsed)) {\n throw new Error(`'retention-until' is not a valid ISO 8601 timestamp: \"${until}\"`)\n }\n // Reject past timestamps client-side. B2 also rejects them server-side\n // but with a generic 400; the action's check fails faster and tells the\n // user exactly what's wrong (especially helpful for timezone-skewed CI\n // runners). Allow a small clock-skew tolerance: anything within the\n // last 30 seconds is treated as \"now\" rather than past.\n const skewToleranceMs = 30_000\n if (parsed < Date.now() - skewToleranceMs) {\n throw new Error(\n `'retention-until' must be in the future; got \"${until}\" (${new Date(parsed).toISOString()})`,\n )\n }\n retainUntilMillis = parsed\n }\n\n // Resolve the file version we're operating on.\n const hit = await findFileByName(bucket, source)\n\n let appliedMode: RetentionResult['appliedMode']\n let retainUntilTimestamp: number | null | undefined\n let appliedLegalHold: RetentionResult['appliedLegalHold']\n\n core.startGroup(`retention b2://${bucket.name}/${source}`)\n try {\n if (mode !== undefined) {\n const retention = {\n mode: mode === 'none' ? null : mode,\n retainUntilTimestamp: retainUntilMillis,\n }\n const result = inputs.bypassGovernance\n ? await bucket.updateFileRetention(source, hit.fileId, retention, {\n bypassGovernance: true,\n })\n : await bucket.updateFileRetention(source, hit.fileId, retention)\n appliedMode = mode\n retainUntilTimestamp = result.fileRetention.retainUntilTimestamp\n core.info(` retention: mode=${mode} retainUntil=${retainUntilMillis}`)\n }\n\n if (legalHold !== undefined) {\n const result = await bucket.updateFileLegalHold(source, hit.fileId, legalHold)\n appliedLegalHold = result.legalHold\n core.info(` legal-hold: ${result.legalHold}`)\n }\n\n return {\n fileName: source,\n fileId: hit.fileId,\n appliedMode,\n retainUntilTimestamp,\n appliedLegalHold,\n }\n } finally {\n core.endGroup()\n }\n}\n","import { collectStream } from \"./collect.js\";\nclass BlobSource {\n /**\n * Create a BlobSource wrapping the given Blob.\n * @param blob - The Blob or File to use as the underlying content.\n */\n constructor(blob) {\n this.blob = blob;\n this.size = blob.size;\n }\n /** {@inheritDoc} */\n size;\n /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */\n canSlice = true;\n /**\n * Return a new BlobSource covering the specified byte range.\n * @param start - The zero-based byte offset to begin the slice.\n * @param end - The exclusive byte offset where the slice ends.\n *\n * @returns A new ContentSource representing the requested sub-range.\n */\n slice(start, end) {\n return new BlobSource(this.blob.slice(start, end));\n }\n /**\n * Open the Blob content as a ReadableStream.\n * @returns A ReadableStream of the Blob bytes.\n */\n stream() {\n return this.blob.stream();\n }\n /**\n * Read the entire Blob content into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n toArrayBuffer() {\n return this.blob.arrayBuffer();\n }\n}\nclass BufferSource {\n /**\n * Create a BufferSource wrapping the given Uint8Array.\n * @param buffer - The byte buffer to use as the underlying content.\n */\n constructor(buffer) {\n this.buffer = buffer;\n this.size = buffer.byteLength;\n }\n /** {@inheritDoc} */\n size;\n /** Random-access: the entire payload lives in memory. */\n canSlice = true;\n /**\n * Return a new BufferSource covering the specified byte range.\n * @param start - The zero-based byte offset to begin the slice.\n * @param end - The exclusive byte offset where the slice ends.\n *\n * @returns A new ContentSource representing the requested sub-range.\n */\n slice(start, end) {\n return new BufferSource(this.buffer.slice(start, end));\n }\n /**\n * Open the buffer content as a ReadableStream.\n * @returns A ReadableStream that emits the buffer bytes in a single chunk.\n */\n stream() {\n const buffer = this.buffer;\n return new ReadableStream({\n start(controller) {\n controller.enqueue(buffer);\n controller.close();\n }\n });\n }\n /**\n * Read the entire buffer content into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n toArrayBuffer() {\n return Promise.resolve(\n this.buffer.buffer.slice(\n this.buffer.byteOffset,\n this.buffer.byteOffset + this.buffer.byteLength\n )\n );\n }\n}\nclass StreamSource {\n /**\n * Create a StreamSource wrapping the given ReadableStream with a known byte size.\n * @param readable - The ReadableStream to wrap as a content source.\n * @param size - The total number of bytes the stream will produce.\n */\n constructor(readable, size) {\n this.readable = readable;\n this.size = size;\n }\n /** {@inheritDoc} */\n size;\n /**\n * Forward-only: ReadableStreams cannot be repositioned, so multipart\n * uploads must take the sequential path. See the interface comment on\n * `canSlice` for what the engine does with this flag.\n */\n canSlice = false;\n /** Whether the stream has already been read. */\n consumed = false;\n /**\n * Always throws because streams cannot be sliced. Buffer the stream first.\n *\n * @throws If slicing is attempted on a stream-backed source.\n */\n slice() {\n throw new Error(\"StreamSource does not support slicing. Buffer the stream first.\");\n }\n /**\n * Open the underlying ReadableStream. Can only be called once.\n * @returns The underlying ReadableStream of bytes.\n *\n * @throws If the stream has already been consumed.\n */\n stream() {\n if (this.consumed) throw new Error(\"StreamSource can only be consumed once.\");\n this.consumed = true;\n return this.readable;\n }\n /**\n * Read the entire stream into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n async toArrayBuffer() {\n const bytes = await collectStream(this.stream());\n return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);\n }\n}\nfunction toContentSource(input, size) {\n if (input instanceof Uint8Array) {\n return new BufferSource(input);\n }\n if (input instanceof Blob) {\n return new BlobSource(input);\n }\n if (size === void 0) {\n throw new Error(\"size is required when using a ReadableStream as input.\");\n }\n return new StreamSource(input, size);\n}\nexport {\n BlobSource,\n BufferSource,\n StreamSource,\n toContentSource\n};\n//# sourceMappingURL=source.js.map\n","class UploadAction {\n /**\n * Creates a new UploadAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param absolutePath - Absolute local filesystem path.\n * @param size - File size in bytes.\n * @param doUpload - Callback that performs the actual upload.\n */\n constructor(relativePath, absolutePath, size, doUpload) {\n this.relativePath = relativePath;\n this.absolutePath = absolutePath;\n this.size = size;\n this.doUpload = doUpload;\n }\n type = \"upload\";\n /**\n * Uploads the file (unless dryRun) and returns an 'upload-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doUpload(this.absolutePath, this.relativePath);\n }\n return { type: \"upload-done\", path: this.relativePath, size: this.size };\n }\n}\nclass DownloadAction {\n /**\n * Creates a new DownloadAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param size - File size in bytes.\n * @param doDownload - Callback that performs the actual download.\n */\n constructor(relativePath, size, doDownload) {\n this.relativePath = relativePath;\n this.size = size;\n this.doDownload = doDownload;\n }\n type = \"download\";\n /**\n * Downloads the file (unless dryRun) and returns a 'download-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDownload(this.relativePath);\n }\n return { type: \"download-done\", path: this.relativePath, size: this.size };\n }\n}\nclass CopyAction {\n /**\n * Creates a new CopyAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param size - File size in bytes.\n * @param doCopy - Callback that performs the server-side copy.\n */\n constructor(relativePath, size, doCopy) {\n this.relativePath = relativePath;\n this.size = size;\n this.doCopy = doCopy;\n }\n type = \"copy\";\n /**\n * Copies the file (unless dryRun) and returns a 'copy-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doCopy(this.relativePath);\n }\n return { type: \"copy-done\", path: this.relativePath, size: this.size };\n }\n}\nclass HideAction {\n /**\n * Creates a new HideAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param doHide - Callback that creates the hide marker.\n */\n constructor(relativePath, doHide) {\n this.relativePath = relativePath;\n this.doHide = doHide;\n }\n type = \"hide\";\n size = 0;\n /**\n * Hides the file (unless dryRun) and returns a 'hide' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doHide(this.relativePath);\n }\n return { type: \"hide\", path: this.relativePath, size: 0 };\n }\n}\nclass DeleteRemoteAction {\n /**\n * Creates a new DeleteRemoteAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param fileId - The B2 file version ID to delete.\n * @param doDelete - Callback that performs the deletion.\n */\n constructor(relativePath, fileId, doDelete) {\n this.relativePath = relativePath;\n this.fileId = fileId;\n this.doDelete = doDelete;\n }\n type = \"delete-remote\";\n size = 0;\n /**\n * Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDelete(this.fileId, this.relativePath);\n }\n return { type: \"delete-remote\", path: this.relativePath, size: 0 };\n }\n}\nclass DeleteLocalAction {\n /**\n * Creates a new DeleteLocalAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param absolutePath - Absolute local filesystem path.\n * @param doDelete - Callback that performs the deletion.\n */\n constructor(relativePath, absolutePath, doDelete) {\n this.relativePath = relativePath;\n this.absolutePath = absolutePath;\n this.doDelete = doDelete;\n }\n type = \"delete-local\";\n size = 0;\n /**\n * Deletes the local file (unless dryRun) and returns a 'delete-local' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDelete(this.absolutePath);\n }\n return { type: \"delete-local\", path: this.relativePath, size: 0 };\n }\n}\nclass SkipAction {\n /**\n * Creates a new SkipAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param reason - Human-readable explanation for why the file was skipped.\n */\n constructor(relativePath, reason) {\n this.relativePath = relativePath;\n this.reason = reason;\n }\n type = \"skip\";\n size = 0;\n /**\n * Returns a 'skip' event with the reason message. No I/O is performed.\n * @param _dryRun - Whether to simulate the action (unused for no-op).\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(_dryRun) {\n return { type: \"skip\", path: this.relativePath, size: 0, message: this.reason };\n }\n}\nexport {\n CopyAction,\n DeleteLocalAction,\n DeleteRemoteAction,\n DownloadAction,\n HideAction,\n SkipAction,\n UploadAction\n};\n//# sourceMappingURL=index.js.map\n","async function* zipFolders(source, dest) {\n const sourceIter = source.scan()[Symbol.asyncIterator]();\n const destIter = dest.scan()[Symbol.asyncIterator]();\n let sourceResult = await sourceIter.next();\n let destResult = await destIter.next();\n while (!sourceResult.done || !destResult.done) {\n const s = sourceResult.done ? null : sourceResult.value;\n const d = destResult.done ? null : destResult.value;\n if (s === null) {\n yield [null, d];\n destResult = await destIter.next();\n } else if (d === null) {\n yield [s, null];\n sourceResult = await sourceIter.next();\n } else if (s.relativePath < d.relativePath) {\n yield [s, null];\n sourceResult = await sourceIter.next();\n } else if (d.relativePath < s.relativePath) {\n yield [null, d];\n destResult = await destIter.next();\n } else {\n yield [s, d];\n sourceResult = await sourceIter.next();\n destResult = await destIter.next();\n }\n }\n}\nexport {\n zipFolders\n};\n//# sourceMappingURL=pairing.js.map\n","function filesAreDifferent(source, dest, compareMode, threshold = 0) {\n switch (compareMode) {\n case \"none\":\n return false;\n case \"size\":\n return Math.abs(source.size - dest.size) > threshold;\n case \"modtime\":\n return Math.abs(source.modTimeMillis - dest.modTimeMillis) > threshold;\n }\n}\nexport {\n filesAreDifferent\n};\n//# sourceMappingURL=compare.js.map\n","import { SkipAction } from \"../actions/index.js\";\nimport { filesAreDifferent } from \"./compare.js\";\nfunction* generateActions(pair, direction, compareMode, keepMode, keepDays, nowMillis, factory, compareThreshold) {\n const [source, dest] = pair;\n if (source !== null && dest === null) {\n yield* actionsForSourceOnly(source, direction, factory);\n } else if (source === null && dest !== null) {\n yield* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory);\n } else if (source !== null && dest !== null) {\n yield* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory);\n }\n}\nfunction* actionsForSourceOnly(source, direction, factory) {\n switch (direction) {\n case \"local-to-b2\":\n yield factory.upload(source);\n break;\n case \"b2-to-local\":\n yield factory.download(source);\n break;\n case \"b2-to-b2\":\n yield factory.copy(source, source.relativePath);\n break;\n }\n}\nfunction* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory) {\n if (keepMode === \"no-delete\") {\n yield new SkipAction(dest.relativePath, \"not in source, keep-mode is no-delete\");\n return;\n }\n if (keepMode === \"keep-days\") {\n const ageMillis = nowMillis - dest.modTimeMillis;\n const ageDays = ageMillis / (24 * 60 * 60 * 1e3);\n if (ageDays < keepDays) {\n yield new SkipAction(\n dest.relativePath,\n `not in source, keeping for ${Math.ceil(keepDays - ageDays)} more days`\n );\n return;\n }\n }\n switch (direction) {\n case \"local-to-b2\":\n yield factory.removeOrphan(dest);\n break;\n case \"b2-to-local\":\n yield factory.deleteLocal(dest);\n break;\n case \"b2-to-b2\":\n yield factory.removeOrphan(dest);\n break;\n }\n}\nfunction* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory) {\n if (!filesAreDifferent(source, dest, compareMode, compareThreshold)) {\n yield new SkipAction(source.relativePath, \"files are the same\");\n return;\n }\n switch (direction) {\n case \"local-to-b2\":\n yield factory.upload(source);\n break;\n case \"b2-to-local\":\n yield factory.download(source);\n break;\n case \"b2-to-b2\":\n yield factory.copy(source, dest.relativePath);\n break;\n }\n}\nexport {\n generateActions\n};\n//# sourceMappingURL=index.js.map\n","import { BufferSource } from \"../streams/source.js\";\nimport { fileId } from \"../types/ids.js\";\nimport { Semaphore } from \"../upload/concurrency.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { toError } from \"../util/to-error.js\";\nimport { DeleteLocalAction, DeleteRemoteAction, HideAction, CopyAction, DownloadAction, UploadAction } from \"./actions/index.js\";\nimport { zipFolders } from \"./pairing.js\";\nimport { generateActions } from \"./policies/index.js\";\nfunction resolveDirection(source, dest) {\n if (source.type === \"local\" && dest.type === \"b2\") return \"local-to-b2\";\n if (source.type === \"b2\" && dest.type === \"local\") return \"b2-to-local\";\n if (source.type === \"b2\" && dest.type === \"b2\") return \"b2-to-b2\";\n throw new Error(`Unsupported sync direction: ${source.type} to ${dest.type}`);\n}\nasync function* synchronize(config) {\n const { source, dest, options } = config;\n const direction = resolveDirection(source, dest);\n const dryRun = options.dryRun ?? false;\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const keepDays = options.keepDays ?? 0;\n const compareThreshold = options.compareThreshold ?? 0;\n const nowMillis = Date.now();\n const factory = createActionFactory(config);\n const actions = [];\n for await (const pair of zipFolders(source, dest)) {\n if (options.signal?.aborted) return;\n for (const action of generateActions(\n pair,\n direction,\n options.compareMode,\n options.keepMode,\n keepDays,\n nowMillis,\n factory,\n compareThreshold\n )) {\n actions.push(action);\n }\n yield { type: \"compare\", path: (pair[0] ?? pair[1])?.relativePath ?? \"\", size: 0 };\n }\n const sem = new Semaphore(concurrency);\n const results = [];\n const errors = [];\n const promises = actions.map(async (action) => {\n await sem.acquire();\n try {\n if (options.signal?.aborted) return;\n const event = await action.execute(dryRun);\n results.push(event);\n } catch (err) {\n const errorValue = toError(err);\n errors.push(errorValue);\n results.push({\n type: \"error\",\n path: action.relativePath,\n size: 0,\n message: errorValue.message\n });\n } finally {\n sem.release();\n }\n });\n await Promise.all(promises);\n for (const event of results) {\n yield event;\n }\n if (errors.length > 0) {\n yield {\n type: \"error\",\n path: \"\",\n size: 0,\n message: `${errors.length} action(s) failed`\n };\n }\n}\nfunction assertBucket(bucket, context) {\n if (!bucket) throw new Error(`Bucket required for ${context} actions`);\n}\nfunction createActionFactory(config) {\n const upConfig = config;\n const downConfig = config;\n const destBucket = upConfig.bucket ?? downConfig.bucket;\n const bucketIsLocked = destBucket?.info?.fileLockConfiguration?.value?.isFileLockEnabled ?? false;\n const factory = {\n upload(source) {\n const bucket = upConfig.bucket;\n const prefix = upConfig.prefix ?? \"\";\n assertBucket(bucket, \"upload\");\n return new UploadAction(\n source.relativePath,\n source.absolutePath,\n source.size,\n async (absPath, relPath) => {\n const { readFile } = await import(\"node:fs/promises\");\n const data = await readFile(absPath);\n await bucket.upload({\n fileName: `${prefix}${relPath}`,\n source: new BufferSource(new Uint8Array(data))\n });\n }\n );\n },\n download(source) {\n const bucket = downConfig.bucket;\n const root = downConfig.dest?.type === \"local\" ? downConfig.dest.root : \"\";\n assertBucket(bucket, \"download\");\n return new DownloadAction(source.relativePath, source.size, async (relPath) => {\n const result = await bucket.download(source.selectedVersion.fileName);\n const reader = result.body.getReader();\n let combined;\n try {\n const chunks = [];\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n let total = 0;\n for (const c of chunks) total += c.byteLength;\n combined = new Uint8Array(total);\n let offset = 0;\n for (const c of chunks) {\n combined.set(c, offset);\n offset += c.byteLength;\n }\n } finally {\n reader.releaseLock();\n }\n const { mkdir, writeFile } = await import(\"node:fs/promises\");\n const { dirname, join } = await import(\"node:path\");\n const destPath = join(root, relPath);\n await mkdir(dirname(destPath), { recursive: true });\n await writeFile(destPath, combined);\n });\n },\n copy(source, destPath) {\n const bucket = upConfig.bucket;\n assertBucket(bucket, \"copy\");\n return new CopyAction(source.relativePath, source.size, async () => {\n await bucket.copyFile({\n sourceFileId: source.selectedVersion.fileId,\n fileName: destPath\n });\n });\n },\n hide(path) {\n const bucket = upConfig.bucket ?? downConfig.bucket;\n assertBucket(bucket, \"hide\");\n return new HideAction(path, async (relPath) => {\n const prefix = upConfig.prefix ?? \"\";\n await bucket.hideFile(`${prefix}${relPath}`);\n });\n },\n deleteRemote(path) {\n const bucket = upConfig.bucket ?? downConfig.bucket;\n assertBucket(bucket, \"delete\");\n const b2FileName = path.selectedVersion.fileName;\n return new DeleteRemoteAction(\n path.relativePath,\n path.selectedVersion.fileId,\n async (fileId$1) => {\n await bucket.deleteFileVersion(b2FileName, fileId(fileId$1));\n }\n );\n },\n deleteLocal(path) {\n return new DeleteLocalAction(path.relativePath, path.absolutePath, async (absPath) => {\n const { unlink } = await import(\"node:fs/promises\");\n await unlink(absPath);\n });\n },\n removeOrphan(dest) {\n return bucketIsLocked ? factory.hide(dest.relativePath) : factory.deleteRemote(dest);\n }\n };\n return factory;\n}\nexport {\n synchronize\n};\n//# sourceMappingURL=synchronizer.js.map\n","import { readdir, stat } from \"node:fs/promises\";\nimport { join, relative, sep } from \"node:path\";\nclass LocalFolder {\n type = \"local\";\n /** Absolute path to the local root directory. */\n root;\n /**\n * Creates a new LocalFolder for the given root directory.\n * @param root - Absolute path to the local directory to scan.\n */\n constructor(root) {\n this.root = root;\n }\n /** Recursively walks the directory and yields files sorted by relative path. */\n async *scan() {\n const collected = [];\n await this.walk(this.root, collected);\n collected.sort((a, b) => a.relativePath.localeCompare(b.relativePath));\n for (const entry of collected) {\n yield entry;\n }\n }\n /**\n * Recursively collects files from {@link dir} into {@link out}.\n * @param dir - Absolute path of the directory to scan.\n * @param out - Accumulator array that receives discovered file entries.\n */\n async walk(dir, out) {\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n if (entry.isDirectory()) {\n await this.walk(fullPath, out);\n } else if (entry.isFile()) {\n try {\n const s = await stat(fullPath);\n const rel = relative(this.root, fullPath).split(sep).join(\"/\");\n out.push({\n relativePath: rel,\n absolutePath: fullPath,\n modTimeMillis: Math.floor(s.mtimeMs),\n size: s.size\n });\n } catch {\n }\n }\n }\n }\n}\nexport {\n LocalFolder\n};\n//# sourceMappingURL=local.js.map\n","const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: \"start\",\n /** Normal upload (small or finished large file). */\n Upload: \"upload\",\n /** Hide marker (soft delete). */\n Hide: \"hide\",\n /** Virtual folder marker. */\n Folder: \"folder\",\n /** Created via server-side copy. */\n Copy: \"copy\"\n};\nconst MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: \"COPY\",\n /** Use the values provided in the copy request. */\n Replace: \"REPLACE\"\n};\nexport {\n FileAction,\n MetadataDirective\n};\n//# sourceMappingURL=file.js.map\n","import { FileAction } from \"../../types/file.js\";\nclass B2Folder {\n type = \"b2\";\n bucket;\n prefix;\n /**\n * Creates a new B2Folder for the given bucket and optional prefix.\n * @param bucket - The B2 bucket to scan.\n * @param prefix - Optional key prefix to restrict the scan scope.\n */\n constructor(bucket, prefix = \"\") {\n this.bucket = bucket;\n this.prefix = prefix;\n }\n /** Lists all file versions in the bucket, groups by name, and yields the latest visible version. */\n async *scan() {\n const grouped = /* @__PURE__ */ new Map();\n let startFileName;\n let startFileId;\n while (true) {\n const listing = await this.bucket.listFileVersions({\n ...this.prefix !== \"\" ? { prefix: this.prefix } : {},\n ...startFileName !== void 0 ? { startFileName } : {},\n ...startFileId !== void 0 ? { startFileId } : {}\n });\n for (const fv of listing.files) {\n const existing = grouped.get(fv.fileName);\n if (existing) {\n existing.push(fv);\n } else {\n grouped.set(fv.fileName, [fv]);\n }\n }\n if (!listing.nextFileName) break;\n startFileName = listing.nextFileName;\n startFileId = listing.nextFileId;\n }\n const sorted = [...grouped.entries()].sort((a, b) => a[0].localeCompare(b[0]));\n for (const [fileName, versions] of sorted) {\n versions.sort((a, b) => b.uploadTimestamp - a.uploadTimestamp);\n const selected = versions[0];\n if (!selected || selected.action === FileAction.Hide) continue;\n const relativePath = this.prefix !== \"\" ? fileName.slice(this.prefix.length) : fileName;\n yield {\n relativePath,\n modTimeMillis: selected.uploadTimestamp,\n size: selected.contentLength,\n selectedVersion: selected,\n allVersions: versions\n };\n }\n }\n}\nexport {\n B2Folder\n};\n//# sourceMappingURL=b2.js.map\n","import { mkdir } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type {\n CompareMode,\n KeepMode,\n SyncEvent,\n SynchronizerDownConfig,\n SynchronizerUpConfig,\n} from '@backblaze-labs/b2-sdk/sync'\nimport { B2Folder, LocalFolder, synchronize } from '@backblaze-labs/b2-sdk/sync'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/**\n * Mutable counter bag fed by {@link processSyncEvent} as the action consumes\n * the SDK's `synchronize()` event stream. Exposed alongside the processor so\n * unit tests can drive each SyncEvent variant deterministically (notably the\n * `copy-start` / `copy-done` events that only fire in b2-to-b2 sync, which\n * the action's input surface doesn't currently expose).\n */\nexport interface SyncEventCounters {\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files removed (delete-remote, delete-local, or hide). */\n deleted: number\n /** Count of files left unchanged. */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred (upload + download). */\n bytesTransferred: number\n}\n\n/**\n * Apply one `SyncEvent` from the SDK's `synchronize()` stream to the running\n * counters and emit the corresponding log line. The action's `syncCommand`\n * calls this in a loop; the function is exported (and the {@link SyncEventCounters}\n * type with it) so tests can exercise every event variant independently,\n * including the `copy-*` events that require b2-to-b2 sync to fire from the\n * real engine.\n *\n * Informational lifecycle events (`upload-start`, `compare`, etc.) are\n * deliberate no-ops; listing them explicitly keeps the switch exhaustive\n * so TypeScript errors if the SDK adds a new variant.\n */\nexport function processSyncEvent(event: SyncEvent, counters: SyncEventCounters): void {\n switch (event.type) {\n case 'upload-done':\n counters.uploaded++\n counters.bytesTransferred += event.size\n core.info(` ↑ ${event.path} (${event.size}B)`)\n return\n case 'download-done':\n counters.downloaded++\n counters.bytesTransferred += event.size\n core.info(` ↓ ${event.path} (${event.size}B)`)\n return\n case 'delete-remote':\n counters.deleted++\n core.info(` − ${event.path}`)\n return\n case 'delete-local':\n counters.deleted++\n core.info(` − (local) ${event.path}`)\n return\n case 'hide':\n counters.deleted++\n core.info(` ⌀ ${event.path} (hidden)`)\n return\n case 'skip':\n counters.skipped++\n return\n case 'error':\n counters.errors++\n core.warning(` ! ${event.path}: ${event.message}`)\n return\n case 'upload-start':\n case 'compare':\n case 'download-start':\n case 'copy-start':\n case 'copy-done':\n return\n }\n}\n\n/**\n * Build a one-line summary of the first few sync errors for the dispatcher's\n * top-level failure message. Without this, a sync that fails on three files\n * surfaces only `Sync completed with 3 error(s)` to the user, who then has to\n * dig into the (possibly collapsed) per-file warnings or parse `summary-json`.\n * Including a sample makes the failure message itself diagnose-able.\n */\nexport function summarizeSyncErrors(events: SyncEvent[], limit = 3): string {\n const errors = events.filter(\n (e): e is Extract => e.type === 'error',\n )\n if (errors.length === 0) return ''\n const head = errors\n .slice(0, limit)\n .map((e) => `${e.path}: ${e.message}`)\n .join('; ')\n const tail = errors.length > limit ? `; +${errors.length - limit} more` : ''\n return `${head}${tail}`\n}\n\n/** Result of {@link syncCommand}: per-event log plus aggregate counters. */\nexport interface SyncResult {\n /** Per-file events emitted by the SDK's `synchronize()` (upload-done, download-done, skip, delete-*, hide, error). */\n events: SyncEvent[]\n /** Resolved direction of this sync (after `auto` resolution). */\n direction: 'local-to-b2' | 'b2-to-local'\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files deleted/hidden across both sides. */\n deleted: number\n /** Count of files left unchanged (already in sync). */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred across both directions. */\n bytesTransferred: number\n}\n\n/**\n * Sync a local directory to / from a B2 bucket prefix.\n *\n * Direction is determined by the `direction` input (`up` = local → B2,\n * `down` = B2 → local). With `direction: auto` (the default) we infer:\n * - if `source` is an existing local directory → `up`\n * - otherwise → `down` (source is a B2 prefix, destination is local)\n *\n * The SDK's {@link synchronize} returns an `AsyncGenerator` which we\n * relay to the workflow log (per-file) and aggregate into a typed result.\n */\nexport async function syncCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'sync', 'a local directory (up) or B2 prefix (down)')\n\n const direction = await resolveDirection(inputs.syncDirection, source)\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n\n const config = await buildConfig(bucket, source, inputs, direction, signal)\n\n core.startGroup(\n `sync ${direction === 'local-to-b2' ? source : `b2://${bucket.name}/${source}`} ` +\n `→ ${direction === 'local-to-b2' ? `b2://${bucket.name}/${inputs.destination ?? ''}` : (inputs.destination ?? '.')} ` +\n `(compare=${compareMode}, keep=${keepMode}${dryRun ? ', dry-run' : ''})`,\n )\n\n const events: SyncEvent[] = []\n const counters: SyncEventCounters = {\n uploaded: 0,\n downloaded: 0,\n deleted: 0,\n skipped: 0,\n errors: 0,\n bytesTransferred: 0,\n }\n\n try {\n for await (const event of synchronize(config)) {\n events.push(event)\n processSyncEvent(event, counters)\n }\n } finally {\n core.endGroup()\n }\n\n const { uploaded, downloaded, deleted, skipped, errors, bytesTransferred } = counters\n\n core.info(\n `sync done [${direction}]: ${uploaded} uploaded, ${downloaded} downloaded, ${deleted} removed, ${skipped} unchanged, ${errors} errors`,\n )\n\n return {\n events,\n direction,\n uploaded,\n downloaded,\n deleted,\n skipped,\n errors,\n bytesTransferred,\n }\n}\n\nasync function resolveDirection(\n requested: 'up' | 'down' | 'auto',\n source: string,\n): Promise<'local-to-b2' | 'b2-to-local'> {\n if (requested === 'up') return 'local-to-b2'\n if (requested === 'down') return 'b2-to-local'\n const localStat = await tryStat(source)\n return localStat?.isDirectory() ? 'local-to-b2' : 'b2-to-local'\n}\n\nasync function buildConfig(\n bucket: Bucket,\n source: string,\n inputs: ParsedInputs,\n direction: 'local-to-b2' | 'b2-to-local',\n signal?: AbortSignal,\n): Promise {\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n const concurrency = inputs.concurrency\n const options = {\n compareMode,\n keepMode,\n concurrency,\n dryRun,\n ...(signal !== undefined ? { signal } : {}),\n }\n\n if (direction === 'local-to-b2') {\n const stats = await tryStat(source)\n if (!stats?.isDirectory()) {\n throw new Error(`'sync' up requires 'source' to be an existing local directory: ${source}`)\n }\n const prefix = (inputs.destination ?? '').replace(/^\\/+|\\/+$/g, '')\n return {\n source: new LocalFolder(resolve(source)),\n dest: new B2Folder(bucket, prefix === '' ? '' : `${prefix}/`),\n bucket,\n prefix: prefix === '' ? '' : `${prefix}/`,\n options,\n }\n }\n\n const remotePrefix = source.replace(/^\\/+|\\/+$/g, '')\n const localDest = inputs.destination ?? '.'\n await mkdir(resolve(localDest), { recursive: true })\n return {\n source: new B2Folder(bucket, remotePrefix === '' ? '' : `${remotePrefix}/`),\n dest: new LocalFolder(resolve(localDest)),\n bucket,\n options,\n }\n}\n\nexport type { CompareMode, KeepMode }\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link unhideCommand}. */\nexport interface UnhideResult {\n /** B2 file name that was unhidden. */\n fileName: string\n /** File ID of the removed hide marker, or `null` if there was nothing hidden. */\n removedMarkerFileId: string | null\n}\n\n/**\n * Restore visibility of a file previously hidden by the `hide` command.\n *\n * Wraps the SDK's {@link Bucket.unhideFile}, which finds the most recent hide\n * marker for the file name and deletes it. If the file is already visible\n * (or never existed), no-ops and reports `removedMarkerFileId: null`.\n *\n * B2 has no native `b2_unhide_file` endpoint; the SDK implements unhide as\n * \"list versions → delete the top hide marker\", which is the canonical\n * recipe. We expose it here so workflow authors don't have to know that.\n */\nexport async function unhideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'unhide', 'the B2 file name')\n\n core.startGroup(`unhide b2://${bucket.name}/${source}`)\n try {\n const marker = await bucket.unhideFile(source)\n if (marker === null) {\n core.info(` no hide marker found for ${source} (already visible or non-existent)`)\n return { fileName: source, removedMarkerFileId: null }\n }\n core.info(` removed hide marker fileId=${marker.fileId}, ${source} is now visible`)\n return { fileName: source, removedMarkerFileId: marker.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core';\n/**\n * Returns a copy with defaults filled in.\n */\nexport function getOptions(copy) {\n const result = {\n followSymbolicLinks: true,\n implicitDescendants: true,\n matchDirectories: true,\n omitBrokenSymbolicLinks: true,\n excludeHiddenFiles: false\n };\n if (copy) {\n if (typeof copy.followSymbolicLinks === 'boolean') {\n result.followSymbolicLinks = copy.followSymbolicLinks;\n core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);\n }\n if (typeof copy.implicitDescendants === 'boolean') {\n result.implicitDescendants = copy.implicitDescendants;\n core.debug(`implicitDescendants '${result.implicitDescendants}'`);\n }\n if (typeof copy.matchDirectories === 'boolean') {\n result.matchDirectories = copy.matchDirectories;\n core.debug(`matchDirectories '${result.matchDirectories}'`);\n }\n if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {\n result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;\n core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);\n }\n if (typeof copy.excludeHiddenFiles === 'boolean') {\n result.excludeHiddenFiles = copy.excludeHiddenFiles;\n core.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`);\n }\n }\n return result;\n}\n//# sourceMappingURL=internal-glob-options-helper.js.map","import * as path from 'path';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.\n *\n * For example, on Linux/macOS:\n * - `/ => /`\n * - `/hello => /`\n *\n * For example, on Windows:\n * - `C:\\ => C:\\`\n * - `C:\\hello => C:\\`\n * - `C: => C:`\n * - `C:hello => C:`\n * - `\\ => \\`\n * - `\\hello => \\`\n * - `\\\\hello => \\\\hello`\n * - `\\\\hello\\world => \\\\hello\\world`\n */\nexport function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}\n/**\n * Roots the path if not already rooted. On Windows, relative roots like `\\`\n * or `C:` are expanded based on the current working directory.\n */\nexport function ensureAbsoluteRoot(root, itemPath) {\n assert(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);\n assert(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Already rooted\n if (hasAbsoluteRoot(itemPath)) {\n return itemPath;\n }\n // Windows\n if (IS_WINDOWS) {\n // Check for itemPath like C: or C:foo\n if (itemPath.match(/^[A-Z]:[^\\\\/]|^[A-Z]:$/i)) {\n let cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n // Drive letter matches cwd? Expand to cwd\n if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {\n // Drive only, e.g. C:\n if (itemPath.length === 2) {\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}`;\n }\n // Drive + path, e.g. C:foo\n else {\n if (!cwd.endsWith('\\\\')) {\n cwd += '\\\\';\n }\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}${itemPath.substr(2)}`;\n }\n }\n // Different drive\n else {\n return `${itemPath[0]}:\\\\${itemPath.substr(2)}`;\n }\n }\n // Check for itemPath like \\ or \\foo\n else if (normalizeSeparators(itemPath).match(/^\\\\$|^\\\\[^\\\\]/)) {\n const cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n return `${cwd[0]}:\\\\${itemPath.substr(1)}`;\n }\n }\n assert(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);\n // Otherwise ensure root ends with a separator\n if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\\\'))) {\n // Intentionally empty\n }\n else {\n // Append separator\n root += path.sep;\n }\n return root + itemPath;\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\\\hello\\share` and `C:\\hello` (and using alternate separator).\n */\nexport function hasAbsoluteRoot(itemPath) {\n assert(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\\\hello\\share or C:\\hello\n return itemPath.startsWith('\\\\\\\\') || /^[A-Z]:\\\\/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\`, `\\hello`, `\\\\hello\\share`, `C:`, and `C:\\hello` (and using alternate separator).\n */\nexport function hasRoot(itemPath) {\n assert(itemPath, `isRooted parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\ or \\hello or \\\\hello\n // E.g. C: or C:\\hello\n return itemPath.startsWith('\\\\') || /^[A-Z]:/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * Removes redundant slashes and converts `/` to `\\` on Windows\n */\nexport function normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n/**\n * Normalizes the path separators and trims the trailing separator (when safe).\n * For example, `/foo/ => /foo` but `/ => /`\n */\nexport function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}\n//# sourceMappingURL=internal-path-helper.js.map","/**\n * Indicates whether a pattern matches a path\n */\nexport var MatchKind;\n(function (MatchKind) {\n /** Not matched */\n MatchKind[MatchKind[\"None\"] = 0] = \"None\";\n /** Matched if the path is a directory */\n MatchKind[MatchKind[\"Directory\"] = 1] = \"Directory\";\n /** Matched if the path is a regular file */\n MatchKind[MatchKind[\"File\"] = 2] = \"File\";\n /** Matched */\n MatchKind[MatchKind[\"All\"] = 3] = \"All\";\n})(MatchKind || (MatchKind = {}));\n//# sourceMappingURL=internal-match-kind.js.map","import * as pathHelper from './internal-path-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Given an array of patterns, returns an array of paths to search.\n * Duplicates and paths under other included paths are filtered out.\n */\nexport function getSearchPaths(patterns) {\n // Ignore negate patterns\n patterns = patterns.filter(x => !x.negate);\n // Create a map of all search paths\n const searchPathMap = {};\n for (const pattern of patterns) {\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n searchPathMap[key] = 'candidate';\n }\n const result = [];\n for (const pattern of patterns) {\n // Check if already included\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n if (searchPathMap[key] === 'included') {\n continue;\n }\n // Check for an ancestor search path\n let foundAncestor = false;\n let tempKey = key;\n let parent = pathHelper.dirname(tempKey);\n while (parent !== tempKey) {\n if (searchPathMap[parent]) {\n foundAncestor = true;\n break;\n }\n tempKey = parent;\n parent = pathHelper.dirname(tempKey);\n }\n // Include the search pattern in the result\n if (!foundAncestor) {\n result.push(pattern.searchPath);\n searchPathMap[key] = 'included';\n }\n }\n return result;\n}\n/**\n * Matches the patterns against the path\n */\nexport function match(patterns, itemPath) {\n let result = MatchKind.None;\n for (const pattern of patterns) {\n if (pattern.negate) {\n result &= ~pattern.match(itemPath);\n }\n else {\n result |= pattern.match(itemPath);\n }\n }\n return result;\n}\n/**\n * Checks whether to descend further into the directory\n */\nexport function partialMatch(patterns, itemPath) {\n return patterns.some(x => !x.negate && x.partialMatch(itemPath));\n}\n//# sourceMappingURL=internal-pattern-helper.js.map","export const balanced = (a, b, str) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a;\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b;\n const r = ma !== null && mb != null && range(ma, mb, str);\n return (r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n });\n};\nconst maybeMatch = (reg, str) => {\n const m = str.match(reg);\n return m ? m[0] : null;\n};\nexport const range = (a, b, str) => {\n let begs, beg, left, right = undefined, result;\n let ai = str.indexOf(a);\n let bi = str.indexOf(b, ai + 1);\n let i = ai;\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n }\n else if (begs.length === 1) {\n const r = begs.pop();\n if (r !== undefined)\n result = [r, bi];\n }\n else {\n beg = begs.pop();\n if (beg !== undefined && beg < left) {\n left = beg;\n right = bi;\n }\n bi = str.indexOf(b, i + 1);\n }\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n if (begs.length && right !== undefined) {\n result = [left, right];\n }\n }\n return result;\n};\n//# sourceMappingURL=index.js.map","import { balanced } from 'balanced-match';\nconst escSlash = '\\0SLASH' + Math.random() + '\\0';\nconst escOpen = '\\0OPEN' + Math.random() + '\\0';\nconst escClose = '\\0CLOSE' + Math.random() + '\\0';\nconst escComma = '\\0COMMA' + Math.random() + '\\0';\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0';\nconst escSlashPattern = new RegExp(escSlash, 'g');\nconst escOpenPattern = new RegExp(escOpen, 'g');\nconst escClosePattern = new RegExp(escClose, 'g');\nconst escCommaPattern = new RegExp(escComma, 'g');\nconst escPeriodPattern = new RegExp(escPeriod, 'g');\nconst slashPattern = /\\\\\\\\/g;\nconst openPattern = /\\\\{/g;\nconst closePattern = /\\\\}/g;\nconst commaPattern = /\\\\,/g;\nconst periodPattern = /\\\\\\./g;\nexport const EXPANSION_MAX = 100_000;\nfunction numeric(str) {\n return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);\n}\nfunction escapeBraces(str) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod);\n}\nfunction unescapeBraces(str) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.');\n}\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str) {\n if (!str) {\n return [''];\n }\n const parts = [];\n const m = balanced('{', '}', str);\n if (!m) {\n return str.split(',');\n }\n const { pre, body, post } = m;\n const p = pre.split(',');\n p[p.length - 1] += '{' + body + '}';\n const postParts = parseCommaParts(post);\n if (post.length) {\n ;\n p[p.length - 1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n parts.push.apply(parts, p);\n return parts;\n}\nexport function expand(str, options = {}) {\n if (!str) {\n return [];\n }\n const { max = EXPANSION_MAX } = options;\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2);\n }\n return expand_(escapeBraces(str), max, true).map(unescapeBraces);\n}\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\nfunction expand_(str, max, isTop) {\n /** @type {string[]} */\n const expansions = [];\n const m = balanced('{', '}', str);\n if (!m)\n return [str];\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre;\n const post = m.post.length ? expand_(m.post, max, false) : [''];\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k];\n expansions.push(expansion);\n }\n }\n else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n const isSequence = isNumericSequence || isAlphaSequence;\n const isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand_(str, max, true);\n }\n return [str];\n }\n let n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n }\n else {\n n = parseCommaParts(m.body);\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace);\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p);\n }\n /* c8 ignore stop */\n }\n }\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N;\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0]);\n const y = numeric(n[1]);\n const width = Math.max(n[0].length, n[1].length);\n let incr = n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n let test = lte;\n const reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n const pad = n.some(isPadded);\n N = [];\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\') {\n c = '';\n }\n }\n else {\n c = String(i);\n if (pad) {\n const need = width - c.length;\n if (need > 0) {\n const z = new Array(need + 1).join('0');\n if (i < 0) {\n c = '-' + z + c.slice(1);\n }\n else {\n c = z + c;\n }\n }\n }\n }\n N.push(c);\n }\n }\n else {\n N = [];\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j], max, false));\n }\n }\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion);\n }\n }\n }\n }\n return expansions;\n}\n//# sourceMappingURL=index.js.map","const MAX_PATTERN_LENGTH = 1024 * 64;\nexport const assertValidPattern = (pattern) => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern');\n }\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long');\n }\n};\n//# sourceMappingURL=assert-valid-pattern.js.map","// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n// { : [, /u flag required, negated]\nconst posixClasses = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n};\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s) => s.replace(/[[\\]\\\\-]/g, '\\\\$&');\n// escape all regexp magic characters\nconst regexpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges) => ranges.join('');\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (glob, position) => {\n const pos = position;\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression');\n }\n /* c8 ignore stop */\n const ranges = [];\n const negs = [];\n let i = pos + 1;\n let sawStart = false;\n let uflag = false;\n let escaping = false;\n let negate = false;\n let endPos = pos;\n let rangeStart = '';\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i);\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true;\n i++;\n continue;\n }\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1;\n break;\n }\n sawStart = true;\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true;\n i++;\n continue;\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true];\n }\n i += cls.length;\n if (neg)\n negs.push(unip);\n else\n ranges.push(unip);\n uflag = uflag || u;\n continue WHILE;\n }\n }\n }\n // now it's just a normal character, effectively\n escaping = false;\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));\n }\n else if (c === rangeStart) {\n ranges.push(braceEscape(c));\n }\n rangeStart = '';\n i++;\n continue;\n }\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'));\n i += 2;\n continue;\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c;\n i += 2;\n continue;\n }\n // not the start of a range, just a single character\n ranges.push(braceEscape(c));\n i++;\n }\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false];\n }\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true];\n }\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];\n return [regexpEscape(r), false, endPos - pos, false];\n }\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';\n const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs;\n return [comb, uflag, endPos - pos, true];\n};\n//# sourceMappingURL=brace-expressions.js.map","/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\nexport const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1');\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1');\n};\n//# sourceMappingURL=unescape.js.map","// parse a single path portion\nvar _a;\nimport { parseClass } from './brace-expressions.js';\nimport { unescape } from './unescape.js';\nconst types = new Set(['!', '?', '+', '*', '@']);\nconst isExtglobType = (c) => types.has(c);\nconst isExtglobAST = (c) => isExtglobType(c.type);\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n]);\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n]);\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n]);\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n]);\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))';\nconst startNoDot = '(?!\\\\.)';\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.']);\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.']);\nconst reSpecials = new Set('().*{}+?[]^$\\\\!');\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// any single thing other than /\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?';\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\nlet ID = 0;\nexport class AST {\n type;\n #root;\n #hasMagic;\n #uflag = false;\n #parts = [];\n #parent;\n #parentIndex;\n #negs;\n #filledNegs = false;\n #options;\n #toString;\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt = false;\n id = ++ID;\n get depth() {\n return (this.#parent?.depth ?? -1) + 1;\n }\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n };\n }\n constructor(type, parent, options = {}) {\n this.type = type;\n // extglobs are inherently magical\n if (type)\n this.#hasMagic = true;\n this.#parent = parent;\n this.#root = this.#parent ? this.#parent.#root : this;\n this.#options = this.#root === this ? options : this.#root.#options;\n this.#negs = this.#root === this ? [] : this.#root.#negs;\n if (type === '!' && !this.#root.#filledNegs)\n this.#negs.push(this);\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;\n }\n get hasMagic() {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined)\n return this.#hasMagic;\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string')\n continue;\n if (p.type || p.hasMagic)\n return (this.#hasMagic = true);\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic;\n }\n // reconstructs the pattern\n toString() {\n return (this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')'));\n }\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root)\n throw new Error('should only call on root');\n if (this.#filledNegs)\n return this;\n /* c8 ignore stop */\n // call toString() once to fill this out\n this.toString();\n this.#filledNegs = true;\n let n;\n while ((n = this.#negs.pop())) {\n if (n.type !== '!')\n continue;\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p = n;\n let pp = p.#parent;\n while (pp) {\n for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??');\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i]);\n }\n }\n p = pp;\n pp = p.#parent;\n }\n }\n return this;\n }\n push(...parts) {\n for (const p of parts) {\n if (p === '')\n continue;\n /* c8 ignore start */\n if (typeof p !== 'string' &&\n !(p instanceof _a && p.#parent === this)) {\n throw new Error('invalid part: ' + p);\n }\n /* c8 ignore stop */\n this.#parts.push(p);\n }\n }\n toJSON() {\n const ret = this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => p.toJSON())];\n if (this.isStart() && !this.type)\n ret.unshift([]);\n if (this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))) {\n ret.push({});\n }\n return ret;\n }\n isStart() {\n if (this.#root === this)\n return true;\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart())\n return false;\n if (this.#parentIndex === 0)\n return true;\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent;\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i];\n if (!(pp instanceof _a && pp.type === '!')) {\n return false;\n }\n }\n return true;\n }\n isEnd() {\n if (this.#root === this)\n return true;\n if (this.#parent?.type === '!')\n return true;\n if (!this.#parent?.isEnd())\n return false;\n if (!this.type)\n return this.#parent?.isEnd();\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0;\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1;\n }\n copyIn(part) {\n if (typeof part === 'string')\n this.push(part);\n else\n this.push(part.clone(this));\n }\n clone(parent) {\n const c = new _a(this.type, parent);\n for (const p of this.#parts) {\n c.copyIn(p);\n }\n return c;\n }\n static #parseAST(str, ast, pos, opt, extDepth) {\n const maxDepth = opt.maxExtglobRecursion ?? 2;\n let escaping = false;\n let inBrace = false;\n let braceStart = -1;\n let braceNeg = false;\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos;\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth;\n if (doRecurse) {\n ast.push(acc);\n acc = '';\n const ext = new _a(c, ast);\n i = _a.#parseAST(str, ext, i, opt, extDepth + 1);\n ast.push(ext);\n continue;\n }\n acc += c;\n }\n ast.push(acc);\n return i;\n }\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1;\n let part = new _a(null, ast);\n const parts = [];\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;\n part.push(acc);\n acc = '';\n const ext = new _a(c, part);\n part.push(ext);\n i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);\n continue;\n }\n if (c === '|') {\n part.push(acc);\n acc = '';\n parts.push(part);\n part = new _a(null, ast);\n continue;\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true;\n }\n part.push(acc);\n acc = '';\n ast.push(...parts, part);\n return i;\n }\n acc += c;\n }\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null;\n ast.#hasMagic = undefined;\n ast.#parts = [str.substring(pos - 1)];\n return i;\n }\n #canAdoptWithSpace(child) {\n return this.#canAdopt(child, adoptionWithSpaceMap);\n }\n #canAdopt(child, map = adoptionMap) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canAdoptType(gc.type, map);\n }\n #canAdoptType(c, map = adoptionAnyMap) {\n return !!map.get(this.type)?.includes(c);\n }\n #adoptWithSpace(child, index) {\n const gc = child.#parts[0];\n const blank = new _a(null, gc, this.options);\n blank.#parts.push('');\n gc.push(blank);\n this.#adopt(child, index);\n }\n #adopt(child, index) {\n const gc = child.#parts[0];\n this.#parts.splice(index, 1, ...gc.#parts);\n for (const p of gc.#parts) {\n if (typeof p === 'object')\n p.#parent = this;\n }\n this.#toString = undefined;\n }\n #canUsurpType(c) {\n const m = usurpMap.get(this.type);\n return !!m?.has(c);\n }\n #canUsurp(child) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canUsurpType(gc.type);\n }\n #usurp(child) {\n const m = usurpMap.get(this.type);\n const gc = child.#parts[0];\n const nt = m?.get(gc.type);\n /* c8 ignore start - impossible */\n if (!nt)\n return false;\n /* c8 ignore stop */\n this.#parts = gc.#parts;\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this;\n }\n }\n this.type = nt;\n this.#toString = undefined;\n this.#emptyExt = false;\n }\n static fromGlob(pattern, options = {}) {\n const ast = new _a(null, undefined, options);\n _a.#parseAST(pattern, ast, 0, options, 0);\n return ast;\n }\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern() {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root)\n return this.#root.toMMPattern();\n /* c8 ignore stop */\n const glob = this.toString();\n const [re, body, hasMagic, uflag] = this.toRegExpSource();\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic = hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase());\n if (!anyMagic) {\n return body;\n }\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n });\n }\n get options() {\n return this.#options;\n }\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(allowDot) {\n const dot = allowDot ?? !!this.#options.dot;\n if (this.#root === this) {\n this.#flatten();\n this.#fillNegs();\n }\n if (!isExtglobAST(this)) {\n const noEmpty = this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string');\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] = typeof p === 'string' ?\n _a.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot);\n this.#hasMagic = this.#hasMagic || hasMagic;\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .join('');\n let start = '';\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);\n if (!dotTravAllowed) {\n const aps = addPatternStart;\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav = \n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)));\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : '';\n }\n }\n }\n // append the \"end of path portion\" pattern to negation tails\n let end = '';\n if (this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!') {\n end = '(?:$|\\\\/)';\n }\n const final = start + src + end;\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n const repeated = this.type === '*' || this.type === '+';\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:';\n let body = this.#partsToRegExp(dot);\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString();\n const me = this;\n me.#parts = [s];\n me.type = null;\n me.#hasMagic = undefined;\n return [s, unescape(this.toString()), false, false];\n }\n let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true);\n if (bodyDotAllowed === body) {\n bodyDotAllowed = '';\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`;\n }\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = '';\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;\n }\n else {\n const close = this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`;\n final = start + body + close;\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten();\n }\n }\n }\n else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0;\n let done = false;\n do {\n done = true;\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i];\n if (typeof c === 'object') {\n c.#flatten();\n if (this.#canAdopt(c)) {\n done = false;\n this.#adopt(c, i);\n }\n else if (this.#canAdoptWithSpace(c)) {\n done = false;\n this.#adoptWithSpace(c, i);\n }\n else if (this.#canUsurp(c)) {\n done = false;\n this.#usurp(c);\n }\n }\n }\n } while (!done && ++iterations < 10);\n }\n this.#toString = undefined;\n }\n #partsToRegExp(dot) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??');\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|');\n }\n static #parseGlob(glob, hasMagic, noEmpty = false) {\n let escaping = false;\n let re = '';\n let uflag = false;\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false;\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i);\n if (escaping) {\n escaping = false;\n re += (reSpecials.has(c) ? '\\\\' : '') + c;\n continue;\n }\n if (c === '*') {\n if (inStar)\n continue;\n inStar = true;\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;\n hasMagic = true;\n continue;\n }\n else {\n inStar = false;\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\';\n }\n else {\n escaping = true;\n }\n continue;\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i);\n if (consumed) {\n re += src;\n uflag = uflag || needUflag;\n i += consumed - 1;\n hasMagic = hasMagic || magic;\n continue;\n }\n }\n if (c === '?') {\n re += qmark;\n hasMagic = true;\n continue;\n }\n re += regExpEscape(c);\n }\n return [re, unescape(glob), !!hasMagic, uflag];\n }\n}\n_a = AST;\n//# sourceMappingURL=ast.js.map","/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&');\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&');\n};\n//# sourceMappingURL=escape.js.map","import { expand } from 'brace-expansion';\nimport { assertValidPattern } from './assert-valid-pattern.js';\nimport { AST } from './ast.js';\nimport { escape } from './escape.js';\nimport { unescape } from './unescape.js';\nexport const minimatch = (p, pattern, options = {}) => {\n assertValidPattern(pattern);\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false;\n }\n return new Minimatch(pattern, options).match(p);\n};\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/;\nconst starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);\nconst starDotExtTestDot = (ext) => (f) => f.endsWith(ext);\nconst starDotExtTestNocase = (ext) => {\n ext = ext.toLowerCase();\n return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);\n};\nconst starDotExtTestNocaseDot = (ext) => {\n ext = ext.toLowerCase();\n return (f) => f.toLowerCase().endsWith(ext);\n};\nconst starDotStarRE = /^\\*+\\.\\*+$/;\nconst starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');\nconst starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');\nconst dotStarRE = /^\\.\\*+$/;\nconst dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');\nconst starRE = /^\\*+$/;\nconst starTest = (f) => f.length !== 0 && !f.startsWith('.');\nconst starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/;\nconst qmarksTestNocase = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestNocaseDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTest = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTestNoExt = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && !f.startsWith('.');\n};\nconst qmarksTestNoExtDot = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && f !== '.' && f !== '..';\n};\n/* c8 ignore start */\nconst defaultPlatform = (typeof process === 'object' && process ?\n (typeof process.env === 'object' &&\n process.env &&\n process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n process.platform\n : 'posix');\nconst path = {\n win32: { sep: '\\\\' },\n posix: { sep: '/' },\n};\n/* c8 ignore stop */\nexport const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;\nminimatch.sep = sep;\nexport const GLOBSTAR = Symbol('globstar **');\nminimatch.GLOBSTAR = GLOBSTAR;\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?';\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?';\nexport const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);\nminimatch.filter = filter;\nconst ext = (a, b = {}) => Object.assign({}, a, b);\nexport const defaults = (def) => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch;\n }\n const orig = minimatch;\n const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));\n return Object.assign(m, {\n Minimatch: class Minimatch extends orig.Minimatch {\n constructor(pattern, options = {}) {\n super(pattern, ext(def, options));\n }\n static defaults(options) {\n return orig.defaults(ext(def, options)).Minimatch;\n }\n },\n AST: class AST extends orig.AST {\n /* c8 ignore start */\n constructor(type, parent, options = {}) {\n super(type, parent, ext(def, options));\n }\n /* c8 ignore stop */\n static fromGlob(pattern, options = {}) {\n return orig.AST.fromGlob(pattern, ext(def, options));\n }\n },\n unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),\n escape: (s, options = {}) => orig.escape(s, ext(def, options)),\n filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),\n defaults: (options) => orig.defaults(ext(def, options)),\n makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),\n braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),\n match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),\n sep: orig.sep,\n GLOBSTAR: GLOBSTAR,\n });\n};\nminimatch.defaults = defaults;\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (pattern, options = {}) => {\n assertValidPattern(pattern);\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern];\n }\n return expand(pattern, { max: options.braceExpandMax });\n};\nminimatch.braceExpand = braceExpand;\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nexport const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();\nminimatch.makeRe = makeRe;\nexport const match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options);\n list = list.filter(f => mm.match(f));\n if (mm.options.nonull && !list.length) {\n list.push(pattern);\n }\n return list;\n};\nminimatch.match = match;\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/;\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\nexport class Minimatch {\n options;\n set;\n pattern;\n windowsPathsNoEscape;\n nonegate;\n negate;\n comment;\n empty;\n preserveMultipleSlashes;\n partial;\n globSet;\n globParts;\n nocase;\n isWindows;\n platform;\n windowsNoMagicRoot;\n maxGlobstarRecursion;\n regexp;\n constructor(pattern, options = {}) {\n assertValidPattern(pattern);\n options = options || {};\n this.options = options;\n this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;\n this.pattern = pattern;\n this.platform = options.platform || defaultPlatform;\n this.isWindows = this.platform === 'win32';\n // avoid the annoying deprecation flag lol\n const awe = ('allowWindow' + 'sEscape');\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options[awe] === false;\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/');\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;\n this.regexp = null;\n this.negate = false;\n this.nonegate = !!options.nonegate;\n this.comment = false;\n this.empty = false;\n this.partial = !!options.partial;\n this.nocase = !!this.options.nocase;\n this.windowsNoMagicRoot =\n options.windowsNoMagicRoot !== undefined ?\n options.windowsNoMagicRoot\n : !!(this.isWindows && this.nocase);\n this.globSet = [];\n this.globParts = [];\n this.set = [];\n // make the set of regexps etc.\n this.make();\n }\n hasMagic() {\n if (this.options.magicalBraces && this.set.length > 1) {\n return true;\n }\n for (const pattern of this.set) {\n for (const part of pattern) {\n if (typeof part !== 'string')\n return true;\n }\n }\n return false;\n }\n debug(..._) { }\n make() {\n const pattern = this.pattern;\n const options = this.options;\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true;\n return;\n }\n if (!pattern) {\n this.empty = true;\n return;\n }\n // step 1: figure out negation, etc.\n this.parseNegate();\n // step 2: expand braces\n this.globSet = [...new Set(this.braceExpand())];\n if (options.debug) {\n //oxlint-disable-next-line no-console\n this.debug = (...args) => console.error(...args);\n }\n this.debug(this.pattern, this.globSet);\n // step 3: now we have a set, so turn each one into a series of\n // path-portion matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n //\n // First, we preprocess to make the glob pattern sets a bit simpler\n // and deduped. There are some perf-killing patterns that can cause\n // problems with a glob walk, but we can simplify them down a bit.\n const rawGlobParts = this.globSet.map(s => this.slashSplit(s));\n this.globParts = this.preprocess(rawGlobParts);\n this.debug(this.pattern, this.globParts);\n // glob --> regexps\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path.\n const isUNC = s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n !globMagic.test(s[3]);\n const isDrive = /^[a-z]:/i.test(s[0]);\n if (isUNC) {\n return [\n ...s.slice(0, 4),\n ...s.slice(4).map(ss => this.parse(ss)),\n ];\n }\n else if (isDrive) {\n return [s[0], ...s.slice(1).map(ss => this.parse(ss))];\n }\n }\n return s.map(ss => this.parse(ss));\n });\n this.debug(this.pattern, set);\n // filter out everything that didn't compile properly.\n this.set = set.filter(s => s.indexOf(false) === -1);\n // do not treat the ? in UNC paths as magic\n if (this.isWindows) {\n for (let i = 0; i < this.set.length; i++) {\n const p = this.set[i];\n if (p[0] === '' &&\n p[1] === '' &&\n this.globParts[i][2] === '?' &&\n typeof p[3] === 'string' &&\n /^[a-z]:$/i.test(p[3])) {\n p[2] = '?';\n }\n }\n }\n this.debug(this.pattern, this.set);\n }\n // various transforms to equivalent pattern sets that are\n // faster to process in a filesystem walk. The goal is to\n // eliminate what we can, and push all ** patterns as far\n // to the right as possible, even if it increases the number\n // of patterns that we have to process.\n preprocess(globParts) {\n // if we're not in globstar mode, then turn ** into *\n if (this.options.noglobstar) {\n for (const partset of globParts) {\n for (let j = 0; j < partset.length; j++) {\n if (partset[j] === '**') {\n partset[j] = '*';\n }\n }\n }\n }\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n // aggressive optimization for the purpose of fs walking\n globParts = this.firstPhasePreProcess(globParts);\n globParts = this.secondPhasePreProcess(globParts);\n }\n else if (optimizationLevel >= 1) {\n // just basic optimizations to remove some .. parts\n globParts = this.levelOneOptimize(globParts);\n }\n else {\n // just collapse multiple ** portions into one\n globParts = this.adjascentGlobstarOptimize(globParts);\n }\n return globParts;\n }\n // just get rid of adjascent ** portions\n adjascentGlobstarOptimize(globParts) {\n return globParts.map(parts => {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let i = gs;\n while (parts[i + 1] === '**') {\n i++;\n }\n if (i !== gs) {\n parts.splice(gs, i - gs);\n }\n }\n return parts;\n });\n }\n // get rid of adjascent ** and resolve .. portions\n levelOneOptimize(globParts) {\n return globParts.map(parts => {\n parts = parts.reduce((set, part) => {\n const prev = set[set.length - 1];\n if (part === '**' && prev === '**') {\n return set;\n }\n if (part === '..') {\n if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n set.pop();\n return set;\n }\n }\n set.push(part);\n return set;\n }, []);\n return parts.length === 0 ? [''] : parts;\n });\n }\n levelTwoFileOptimize(parts) {\n if (!Array.isArray(parts)) {\n parts = this.slashSplit(parts);\n }\n let didSomething = false;\n do {\n didSomething = false;\n //
// -> 
/\n            if (!this.preserveMultipleSlashes) {\n                for (let i = 1; i < parts.length - 1; i++) {\n                    const p = parts[i];\n                    // don't squeeze out UNC patterns\n                    if (i === 1 && p === '' && parts[0] === '')\n                        continue;\n                    if (p === '.' || p === '') {\n                        didSomething = true;\n                        parts.splice(i, 1);\n                        i--;\n                    }\n                }\n                if (parts[0] === '.' &&\n                    parts.length === 2 &&\n                    (parts[1] === '.' || parts[1] === '')) {\n                    didSomething = true;\n                    parts.pop();\n                }\n            }\n            // 
/

/../ ->

/\n            let dd = 0;\n            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                const p = parts[dd - 1];\n                if (p &&\n                    p !== '.' &&\n                    p !== '..' &&\n                    p !== '**' &&\n                    !(this.isWindows && /^[a-z]:$/i.test(p))) {\n                    didSomething = true;\n                    parts.splice(dd - 1, 2);\n                    dd -= 2;\n                }\n            }\n        } while (didSomething);\n        return parts.length === 0 ? [''] : parts;\n    }\n    // First phase: single-pattern processing\n    // 
 is 1 or more portions\n    //  is 1 or more portions\n    // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n    // 
/

/../ ->

/\n    // **/**/ -> **/\n    //\n    // **/*/ -> */**/ <== not valid because ** doesn't follow\n    // this WOULD be allowed if ** did follow symlinks, or * didn't\n    firstPhasePreProcess(globParts) {\n        let didSomething = false;\n        do {\n            didSomething = false;\n            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss = gs;\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n                        gss++;\n                    }\n                    // eg, if gs is 2 and gss is 4, that means we have 3 **\n                    // parts, and can remove 2 of them.\n                    if (gss > gs) {\n                        parts.splice(gs + 1, gss - gs);\n                    }\n                    let next = parts[gs + 1];\n                    const p = parts[gs + 2];\n                    const p2 = parts[gs + 3];\n                    if (next !== '..')\n                        continue;\n                    if (!p ||\n                        p === '.' ||\n                        p === '..' ||\n                        !p2 ||\n                        p2 === '.' ||\n                        p2 === '..') {\n                        continue;\n                    }\n                    didSomething = true;\n                    // edit parts in place, and push the new one\n                    parts.splice(gs, 1);\n                    const other = parts.slice(0);\n                    other[gs] = '**';\n                    globParts.push(other);\n                    gs--;\n                }\n                // 
// -> 
/\n                if (!this.preserveMultipleSlashes) {\n                    for (let i = 1; i < parts.length - 1; i++) {\n                        const p = parts[i];\n                        // don't squeeze out UNC patterns\n                        if (i === 1 && p === '' && parts[0] === '')\n                            continue;\n                        if (p === '.' || p === '') {\n                            didSomething = true;\n                            parts.splice(i, 1);\n                            i--;\n                        }\n                    }\n                    if (parts[0] === '.' &&\n                        parts.length === 2 &&\n                        (parts[1] === '.' || parts[1] === '')) {\n                        didSomething = true;\n                        parts.pop();\n                    }\n                }\n                // 
/

/../ ->

/\n                let dd = 0;\n                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                    const p = parts[dd - 1];\n                    if (p && p !== '.' && p !== '..' && p !== '**') {\n                        didSomething = true;\n                        const needDot = dd === 1 && parts[dd + 1] === '**';\n                        const splin = needDot ? ['.'] : [];\n                        parts.splice(dd - 1, 2, ...splin);\n                        if (parts.length === 0)\n                            parts.push('');\n                        dd -= 2;\n                    }\n                }\n            }\n        } while (didSomething);\n        return globParts;\n    }\n    // second phase: multi-pattern dedupes\n    // {
/*/,
/

/} ->

/*/\n    // {
/,
/} -> 
/\n    // {
/**/,
/} -> 
/**/\n    //\n    // {
/**/,
/**/

/} ->

/**/\n    // ^-- not valid because ** doens't follow symlinks\n    secondPhasePreProcess(globParts) {\n        for (let i = 0; i < globParts.length - 1; i++) {\n            for (let j = i + 1; j < globParts.length; j++) {\n                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);\n                if (matched) {\n                    globParts[i] = [];\n                    globParts[j] = matched;\n                    break;\n                }\n            }\n        }\n        return globParts.filter(gs => gs.length);\n    }\n    partsMatch(a, b, emptyGSMatch = false) {\n        let ai = 0;\n        let bi = 0;\n        let result = [];\n        let which = '';\n        while (ai < a.length && bi < b.length) {\n            if (a[ai] === b[bi]) {\n                result.push(which === 'b' ? b[bi] : a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n                result.push(a[ai]);\n                ai++;\n            }\n            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n                result.push(b[bi]);\n                bi++;\n            }\n            else if (a[ai] === '*' &&\n                b[bi] &&\n                (this.options.dot || !b[bi].startsWith('.')) &&\n                b[bi] !== '**') {\n                if (which === 'b')\n                    return false;\n                which = 'a';\n                result.push(a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (b[bi] === '*' &&\n                a[ai] &&\n                (this.options.dot || !a[ai].startsWith('.')) &&\n                a[ai] !== '**') {\n                if (which === 'a')\n                    return false;\n                which = 'b';\n                result.push(b[bi]);\n                ai++;\n                bi++;\n            }\n            else {\n                return false;\n            }\n        }\n        // if we fall out of the loop, it means they two are identical\n        // as long as their lengths match\n        return a.length === b.length && result;\n    }\n    parseNegate() {\n        if (this.nonegate)\n            return;\n        const pattern = this.pattern;\n        let negate = false;\n        let negateOffset = 0;\n        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n            negate = !negate;\n            negateOffset++;\n        }\n        if (negateOffset)\n            this.pattern = pattern.slice(negateOffset);\n        this.negate = negate;\n    }\n    // set partial to true to test if, for example,\n    // \"/a/b\" matches the start of \"/*/b/*/d\"\n    // Partial means, if you run out of file before you run\n    // out of pattern, then that's fine, as long as all\n    // the parts match.\n    matchOne(file, pattern, partial = false) {\n        let fileStartIndex = 0;\n        let patternStartIndex = 0;\n        // UNC paths like //?/X:/... can match X:/... and vice versa\n        // Drive letters in absolute drive or unc paths are always compared\n        // case-insensitively.\n        if (this.isWindows) {\n            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);\n            const fileUNC = !fileDrive &&\n                file[0] === '' &&\n                file[1] === '' &&\n                file[2] === '?' &&\n                /^[a-z]:$/i.test(file[3]);\n            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);\n            const patternUNC = !patternDrive &&\n                pattern[0] === '' &&\n                pattern[1] === '' &&\n                pattern[2] === '?' &&\n                typeof pattern[3] === 'string' &&\n                /^[a-z]:$/i.test(pattern[3]);\n            const fdi = fileUNC ? 3\n                : fileDrive ? 0\n                    : undefined;\n            const pdi = patternUNC ? 3\n                : patternDrive ? 0\n                    : undefined;\n            if (typeof fdi === 'number' && typeof pdi === 'number') {\n                const [fd, pd] = [\n                    file[fdi],\n                    pattern[pdi],\n                ];\n                // start matching at the drive letter index of each\n                if (fd.toLowerCase() === pd.toLowerCase()) {\n                    pattern[pdi] = fd;\n                    patternStartIndex = pdi;\n                    fileStartIndex = fdi;\n                }\n            }\n        }\n        // resolve and reduce . and .. portions in the file as well.\n        // don't need to do the second phase, because it's only one string[]\n        const { optimizationLevel = 1 } = this.options;\n        if (optimizationLevel >= 2) {\n            file = this.levelTwoFileOptimize(file);\n        }\n        if (pattern.includes(GLOBSTAR)) {\n            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);\n        }\n        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);\n    }\n    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {\n        // split the pattern into head, tail, and middle of ** delimited parts\n        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);\n        const lastgs = pattern.lastIndexOf(GLOBSTAR);\n        // split the pattern up into globstar-delimited sections\n        // the tail has to be at the end, and the others just have\n        // to be found in order from the head.\n        const [head, body, tail] = partial ?\n            [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1),\n                [],\n            ]\n            : [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1, lastgs),\n                pattern.slice(lastgs + 1),\n            ];\n        // check the head, from the current file/pattern index.\n        if (head.length) {\n            const fileHead = file.slice(fileIndex, fileIndex + head.length);\n            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n                return false;\n            }\n            fileIndex += head.length;\n            patternIndex += head.length;\n        }\n        // now we know the head matches!\n        // if the last portion is not empty, it MUST match the end\n        // check the tail\n        let fileTailMatch = 0;\n        if (tail.length) {\n            // if head + tail > file, then we cannot possibly match\n            if (tail.length + fileIndex > file.length)\n                return false;\n            // try to match the tail\n            let tailStart = file.length - tail.length;\n            if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n                fileTailMatch = tail.length;\n            }\n            else {\n                // affordance for stuff like a/**/* matching a/b/\n                // if the last file portion is '', and there's more to the pattern\n                // then try without the '' bit.\n                if (file[file.length - 1] !== '' ||\n                    fileIndex + tail.length === file.length) {\n                    return false;\n                }\n                tailStart--;\n                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n                    return false;\n                }\n                fileTailMatch = tail.length + 1;\n            }\n        }\n        // now we know the tail matches!\n        // the middle is zero or more portions wrapped in **, possibly\n        // containing more ** sections.\n        // so a/**/b/**/c/**/d has become **/b/**/c/**\n        // if it's empty, it means a/**/b, just verify we have no bad dots\n        // if there's no tail, so it ends on /**, then we must have *something*\n        // after the head, or it's not a matc\n        if (!body.length) {\n            let sawSome = !!fileTailMatch;\n            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n                const f = String(file[i]);\n                sawSome = true;\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            // in partial mode, we just need to get past all file parts\n            return partial || sawSome;\n        }\n        // now we know that there's one or more body sections, which can\n        // be matched anywhere from the 0 index (because the head was pruned)\n        // through to the length-fileTailMatch index.\n        // split the body up into sections, and note the minimum index it can\n        // be found at (start with the length of all previous segments)\n        // [section, before, after]\n        const bodySegments = [[[], 0]];\n        let currentBody = bodySegments[0];\n        let nonGsParts = 0;\n        const nonGsPartsSums = [0];\n        for (const b of body) {\n            if (b === GLOBSTAR) {\n                nonGsPartsSums.push(nonGsParts);\n                currentBody = [[], 0];\n                bodySegments.push(currentBody);\n            }\n            else {\n                currentBody[0].push(b);\n                nonGsParts++;\n            }\n        }\n        let i = bodySegments.length - 1;\n        const fileLength = file.length - fileTailMatch;\n        for (const b of bodySegments) {\n            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);\n        }\n        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);\n    }\n    // return false for \"nope, not matching\"\n    // return null for \"not matching, cannot keep trying\"\n    #matchGlobStarBodySections(file, \n    // pattern section, last possible position for it\n    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {\n        // take the first body segment, and walk from fileIndex to its \"after\"\n        // value at the end\n        // If it doesn't match at that position, we increment, until we hit\n        // that final possible position, and give up.\n        // If it does match, then advance and try to rest.\n        // If any of them fail we keep walking forward.\n        // this is still a bit recursively painful, but it's more constrained\n        // than previous implementations, because we never test something that\n        // can't possibly be a valid matching condition.\n        const bs = bodySegments[bodyIndex];\n        if (!bs) {\n            // just make sure that there's no bad dots\n            for (let i = fileIndex; i < file.length; i++) {\n                sawTail = true;\n                const f = file[i];\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            return sawTail;\n        }\n        // have a non-globstar body section to test\n        const [body, after] = bs;\n        while (fileIndex <= after) {\n            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);\n            // if limit exceeded, no match. intentional false negative,\n            // acceptable break in correctness for security.\n            if (m && globStarDepth < this.maxGlobstarRecursion) {\n                // match! see if the rest match. if so, we're done!\n                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);\n                if (sub !== false) {\n                    return sub;\n                }\n            }\n            const f = file[fileIndex];\n            if (f === '.' ||\n                f === '..' ||\n                (!this.options.dot && f.startsWith('.'))) {\n                return false;\n            }\n            fileIndex++;\n        }\n        // walked off. no point continuing\n        return partial || null;\n    }\n    #matchOne(file, pattern, partial, fileIndex, patternIndex) {\n        let fi;\n        let pi;\n        let pl;\n        let fl;\n        for (fi = fileIndex,\n            pi = patternIndex,\n            fl = file.length,\n            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {\n            this.debug('matchOne loop');\n            let p = pattern[pi];\n            let f = file[fi];\n            this.debug(pattern, p, f);\n            // should be impossible.\n            // some invalid regexp stuff in the set.\n            /* c8 ignore start */\n            if (p === false || p === GLOBSTAR) {\n                return false;\n            }\n            /* c8 ignore stop */\n            // something other than **\n            // non-magic patterns just have to match exactly\n            // patterns with magic have been turned into regexps.\n            let hit;\n            if (typeof p === 'string') {\n                hit = f === p;\n                this.debug('string match', p, f, hit);\n            }\n            else {\n                hit = p.test(f);\n                this.debug('pattern match', p, f, hit);\n            }\n            if (!hit)\n                return false;\n        }\n        // Note: ending in / means that we'll get a final \"\"\n        // at the end of the pattern.  This can only match a\n        // corresponding \"\" at the end of the file.\n        // If the file ends in /, then it can only match a\n        // a pattern that ends in /, unless the pattern just\n        // doesn't have any more for it. But, a/b/ should *not*\n        // match \"a/b/*\", even though \"\" matches against the\n        // [^/]*? pattern, except in partial mode, where it might\n        // simply not be reached yet.\n        // However, a/b/ should still satisfy a/*\n        // now either we fell off the end of the pattern, or we're done.\n        if (fi === fl && pi === pl) {\n            // ran out of pattern and filename at the same time.\n            // an exact hit!\n            return true;\n        }\n        else if (fi === fl) {\n            // ran out of file, but still had pattern left.\n            // this is ok if we're doing the match as part of\n            // a glob fs traversal.\n            return partial;\n        }\n        else if (pi === pl) {\n            // ran out of pattern, still have file left.\n            // this is only acceptable if we're on the very last\n            // empty segment of a file with a trailing slash.\n            // a/* should match a/b/\n            return fi === fl - 1 && file[fi] === '';\n            /* c8 ignore start */\n        }\n        else {\n            // should be unreachable.\n            throw new Error('wtf?');\n        }\n        /* c8 ignore stop */\n    }\n    braceExpand() {\n        return braceExpand(this.pattern, this.options);\n    }\n    parse(pattern) {\n        assertValidPattern(pattern);\n        const options = this.options;\n        // shortcuts\n        if (pattern === '**')\n            return GLOBSTAR;\n        if (pattern === '')\n            return '';\n        // far and away, the most common glob pattern parts are\n        // *, *.*, and *.  Add a fast check method for those.\n        let m;\n        let fastTest = null;\n        if ((m = pattern.match(starRE))) {\n            fastTest = options.dot ? starTestDot : starTest;\n        }\n        else if ((m = pattern.match(starDotExtRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    starDotExtTestNocaseDot\n                    : starDotExtTestNocase\n                : options.dot ? starDotExtTestDot\n                    : starDotExtTest)(m[1]);\n        }\n        else if ((m = pattern.match(qmarksRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    qmarksTestNocaseDot\n                    : qmarksTestNocase\n                : options.dot ? qmarksTestDot\n                    : qmarksTest)(m);\n        }\n        else if ((m = pattern.match(starDotStarRE))) {\n            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;\n        }\n        else if ((m = pattern.match(dotStarRE))) {\n            fastTest = dotStarTest;\n        }\n        const re = AST.fromGlob(pattern, this.options).toMMPattern();\n        if (fastTest && typeof re === 'object') {\n            // Avoids overriding in frozen environments\n            Reflect.defineProperty(re, 'test', { value: fastTest });\n        }\n        return re;\n    }\n    makeRe() {\n        if (this.regexp || this.regexp === false)\n            return this.regexp;\n        // at this point, this.set is a 2d array of partial\n        // pattern strings, or \"**\".\n        //\n        // It's better to use .match().  This function shouldn't\n        // be used, really, but it's pretty convenient sometimes,\n        // when you just want to work with a regex.\n        const set = this.set;\n        if (!set.length) {\n            this.regexp = false;\n            return this.regexp;\n        }\n        const options = this.options;\n        const twoStar = options.noglobstar ? star\n            : options.dot ? twoStarDot\n                : twoStarNoDot;\n        const flags = new Set(options.nocase ? ['i'] : []);\n        // regexpify non-globstar patterns\n        // if ** is only item, then we just do one twoStar\n        // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n        // if ** is last, append (\\/twoStar|) to previous\n        // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n        // then filter out GLOBSTAR symbols\n        let re = set\n            .map(pattern => {\n            const pp = pattern.map(p => {\n                if (p instanceof RegExp) {\n                    for (const f of p.flags.split(''))\n                        flags.add(f);\n                }\n                return (typeof p === 'string' ? regExpEscape(p)\n                    : p === GLOBSTAR ? GLOBSTAR\n                        : p._src);\n            });\n            pp.forEach((p, i) => {\n                const next = pp[i + 1];\n                const prev = pp[i - 1];\n                if (p !== GLOBSTAR || prev === GLOBSTAR) {\n                    return;\n                }\n                if (prev === undefined) {\n                    if (next !== undefined && next !== GLOBSTAR) {\n                        pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next;\n                    }\n                    else {\n                        pp[i] = twoStar;\n                    }\n                }\n                else if (next === undefined) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?';\n                }\n                else if (next !== GLOBSTAR) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next;\n                    pp[i + 1] = GLOBSTAR;\n                }\n            });\n            const filtered = pp.filter(p => p !== GLOBSTAR);\n            // For partial matches, we need to make the pattern match\n            // any prefix of the full path. We do this by generating\n            // alternative patterns that match progressively longer prefixes.\n            if (this.partial && filtered.length >= 1) {\n                const prefixes = [];\n                for (let i = 1; i <= filtered.length; i++) {\n                    prefixes.push(filtered.slice(0, i).join('/'));\n                }\n                return '(?:' + prefixes.join('|') + ')';\n            }\n            return filtered.join('/');\n        })\n            .join('|');\n        // need to wrap in parens if we had more than one thing with |,\n        // otherwise only the first will be anchored to ^ and the last to $\n        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];\n        // must match entire pattern\n        // ending in a * or ** will make it less strict.\n        re = '^' + open + re + close + '$';\n        // In partial mode, '/' should always match as it's a valid prefix for any pattern\n        if (this.partial) {\n            re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$';\n        }\n        // can match anything, as long as it's not this.\n        if (this.negate)\n            re = '^(?!' + re + ').+$';\n        try {\n            this.regexp = new RegExp(re, [...flags].join(''));\n            /* c8 ignore start */\n        }\n        catch {\n            // should be impossible\n            this.regexp = false;\n        }\n        /* c8 ignore stop */\n        return this.regexp;\n    }\n    slashSplit(p) {\n        // if p starts with // on windows, we preserve that\n        // so that UNC paths aren't broken.  Otherwise, any number of\n        // / characters are coalesced into one, unless\n        // preserveMultipleSlashes is set to true.\n        if (this.preserveMultipleSlashes) {\n            return p.split('/');\n        }\n        else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n            // add an extra '' for the one we lose\n            return ['', ...p.split(/\\/+/)];\n        }\n        else {\n            return p.split(/\\/+/);\n        }\n    }\n    match(f, partial = this.partial) {\n        this.debug('match', f, this.pattern);\n        // short-circuit in the case of busted things.\n        // comments, etc.\n        if (this.comment) {\n            return false;\n        }\n        if (this.empty) {\n            return f === '';\n        }\n        if (f === '/' && partial) {\n            return true;\n        }\n        const options = this.options;\n        // windows: need to use /, not \\\n        if (this.isWindows) {\n            f = f.split('\\\\').join('/');\n        }\n        // treat the test path as a set of pathparts.\n        const ff = this.slashSplit(f);\n        this.debug(this.pattern, 'split', ff);\n        // just ONE of the pattern sets in this.set needs to match\n        // in order for it to be valid.  If negating, then just one\n        // match means that we have failed.\n        // Either way, return on the first hit.\n        const set = this.set;\n        this.debug(this.pattern, 'set', set);\n        // Find the basename of the path by looking for the last non-empty segment\n        let filename = ff[ff.length - 1];\n        if (!filename) {\n            for (let i = ff.length - 2; !filename && i >= 0; i--) {\n                filename = ff[i];\n            }\n        }\n        for (const pattern of set) {\n            let file = ff;\n            if (options.matchBase && pattern.length === 1) {\n                file = [filename];\n            }\n            const hit = this.matchOne(file, pattern, partial);\n            if (hit) {\n                if (options.flipNegate) {\n                    return true;\n                }\n                return !this.negate;\n            }\n        }\n        // didn't get any hits.  this is success if it's a negative\n        // pattern, failure otherwise.\n        if (options.flipNegate) {\n            return false;\n        }\n        return this.negate;\n    }\n    static defaults(def) {\n        return minimatch.defaults(def).Minimatch;\n    }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js';\nexport { escape } from './escape.js';\nexport { unescape } from './unescape.js';\n/* c8 ignore stop */\nminimatch.AST = AST;\nminimatch.Minimatch = Minimatch;\nminimatch.escape = escape;\nminimatch.unescape = unescape;\n//# sourceMappingURL=index.js.map","import * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Helper class for parsing paths into segments\n */\nexport class Path {\n    /**\n     * Constructs a Path\n     * @param itemPath Path or array of segments\n     */\n    constructor(itemPath) {\n        this.segments = [];\n        // String\n        if (typeof itemPath === 'string') {\n            assert(itemPath, `Parameter 'itemPath' must not be empty`);\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n            // Not rooted\n            if (!pathHelper.hasRoot(itemPath)) {\n                this.segments = itemPath.split(path.sep);\n            }\n            // Rooted\n            else {\n                // Add all segments, while not at the root\n                let remaining = itemPath;\n                let dir = pathHelper.dirname(remaining);\n                while (dir !== remaining) {\n                    // Add the segment\n                    const basename = path.basename(remaining);\n                    this.segments.unshift(basename);\n                    // Truncate the last segment\n                    remaining = dir;\n                    dir = pathHelper.dirname(remaining);\n                }\n                // Remainder is the root\n                this.segments.unshift(remaining);\n            }\n        }\n        // Array\n        else {\n            // Must not be empty\n            assert(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);\n            // Each segment\n            for (let i = 0; i < itemPath.length; i++) {\n                let segment = itemPath[i];\n                // Must not be empty\n                assert(segment, `Parameter 'itemPath' must not contain any empty segments`);\n                // Normalize slashes\n                segment = pathHelper.normalizeSeparators(itemPath[i]);\n                // Root segment\n                if (i === 0 && pathHelper.hasRoot(segment)) {\n                    segment = pathHelper.safeTrimTrailingSeparator(segment);\n                    assert(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);\n                    this.segments.push(segment);\n                }\n                // All other segments\n                else {\n                    // Must not contain slash\n                    assert(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);\n                    this.segments.push(segment);\n                }\n            }\n        }\n    }\n    /**\n     * Converts the path to it's string representation\n     */\n    toString() {\n        // First segment\n        let result = this.segments[0];\n        // All others\n        let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n        for (let i = 1; i < this.segments.length; i++) {\n            if (skipSlash) {\n                skipSlash = false;\n            }\n            else {\n                result += path.sep;\n            }\n            result += this.segments[i];\n        }\n        return result;\n    }\n}\n//# sourceMappingURL=internal-path.js.map","import * as os from 'os';\nimport * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nimport { Minimatch } from 'minimatch';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Path } from './internal-path.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class Pattern {\n    constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) {\n        /**\n         * Indicates whether matches should be excluded from the result set\n         */\n        this.negate = false;\n        // Pattern overload\n        let pattern;\n        if (typeof patternOrNegate === 'string') {\n            pattern = patternOrNegate.trim();\n        }\n        // Segments overload\n        else {\n            // Convert to pattern\n            segments = segments || [];\n            assert(segments.length, `Parameter 'segments' must not empty`);\n            const root = Pattern.getLiteral(segments[0]);\n            assert(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);\n            pattern = new Path(segments).toString().trim();\n            if (patternOrNegate) {\n                pattern = `!${pattern}`;\n            }\n        }\n        // Negate\n        while (pattern.startsWith('!')) {\n            this.negate = !this.negate;\n            pattern = pattern.substr(1).trim();\n        }\n        // Normalize slashes and ensures absolute root\n        pattern = Pattern.fixupPattern(pattern, homedir);\n        // Segments\n        this.segments = new Path(pattern).segments;\n        // Trailing slash indicates the pattern should only match directories, not regular files\n        this.trailingSeparator = pathHelper\n            .normalizeSeparators(pattern)\n            .endsWith(path.sep);\n        pattern = pathHelper.safeTrimTrailingSeparator(pattern);\n        // Search path (literal path prior to the first glob segment)\n        let foundGlob = false;\n        const searchSegments = this.segments\n            .map(x => Pattern.getLiteral(x))\n            .filter(x => !foundGlob && !(foundGlob = x === ''));\n        this.searchPath = new Path(searchSegments).toString();\n        // Root RegExp (required when determining partial match)\n        this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : '');\n        this.isImplicitPattern = isImplicitPattern;\n        // Create minimatch\n        const minimatchOptions = {\n            dot: true,\n            nobrace: true,\n            nocase: IS_WINDOWS,\n            nocomment: true,\n            noext: true,\n            nonegate: true\n        };\n        pattern = IS_WINDOWS ? pattern.replace(/\\\\/g, '/') : pattern;\n        this.minimatch = new Minimatch(pattern, minimatchOptions);\n    }\n    /**\n     * Matches the pattern against the specified path\n     */\n    match(itemPath) {\n        // Last segment is globstar?\n        if (this.segments[this.segments.length - 1] === '**') {\n            // Normalize slashes\n            itemPath = pathHelper.normalizeSeparators(itemPath);\n            // Append a trailing slash. Otherwise Minimatch will not match the directory immediately\n            // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns\n            // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.\n            if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) {\n                // Note, this is safe because the constructor ensures the pattern has an absolute root.\n                // For example, formats like C: and C:foo on Windows are resolved to an absolute root.\n                itemPath = `${itemPath}${path.sep}`;\n            }\n        }\n        else {\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        }\n        // Match\n        if (this.minimatch.match(itemPath)) {\n            return this.trailingSeparator ? MatchKind.Directory : MatchKind.All;\n        }\n        return MatchKind.None;\n    }\n    /**\n     * Indicates whether the pattern may match descendants of the specified path\n     */\n    partialMatch(itemPath) {\n        // Normalize slashes and trim unnecessary trailing slash\n        itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        // matchOne does not handle root path correctly\n        if (pathHelper.dirname(itemPath) === itemPath) {\n            return this.rootRegExp.test(itemPath);\n        }\n        return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\\\+/ : /\\/+/), this.minimatch.set[0], true);\n    }\n    /**\n     * Escapes glob patterns within a path\n     */\n    static globEscape(s) {\n        return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n            .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n            .replace(/\\?/g, '[?]') // escape '?'\n            .replace(/\\*/g, '[*]'); // escape '*'\n    }\n    /**\n     * Normalizes slashes and ensures absolute root\n     */\n    static fixupPattern(pattern, homedir) {\n        // Empty\n        assert(pattern, 'pattern cannot be empty');\n        // Must not contain `.` segment, unless first segment\n        // Must not contain `..` segment\n        const literalSegments = new Path(pattern).segments.map(x => Pattern.getLiteral(x));\n        assert(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);\n        // Must not contain globs in root, e.g. Windows UNC path \\\\foo\\b*r\n        assert(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);\n        // Normalize slashes\n        pattern = pathHelper.normalizeSeparators(pattern);\n        // Replace leading `.` segment\n        if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) {\n            pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1);\n        }\n        // Replace leading `~` segment\n        else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {\n            homedir = homedir || os.homedir();\n            assert(homedir, 'Unable to determine HOME directory');\n            assert(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);\n            pattern = Pattern.globEscape(homedir) + pattern.substr(1);\n        }\n        // Replace relative drive root, e.g. pattern is C: or C:foo\n        else if (IS_WINDOWS &&\n            (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\\\]/i))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', pattern.substr(0, 2));\n            if (pattern.length > 2 && !root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(2);\n        }\n        // Replace relative root, e.g. pattern is \\ or \\foo\n        else if (IS_WINDOWS && (pattern === '\\\\' || pattern.match(/^\\\\[^\\\\]/))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', '\\\\');\n            if (!root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(1);\n        }\n        // Otherwise ensure absolute root\n        else {\n            pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern);\n        }\n        return pathHelper.normalizeSeparators(pattern);\n    }\n    /**\n     * Attempts to unescape a pattern segment to create a literal path segment.\n     * Otherwise returns empty string.\n     */\n    static getLiteral(segment) {\n        let literal = '';\n        for (let i = 0; i < segment.length; i++) {\n            const c = segment[i];\n            // Escape\n            if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n                literal += segment[++i];\n                continue;\n            }\n            // Wildcard\n            else if (c === '*' || c === '?') {\n                return '';\n            }\n            // Character set\n            else if (c === '[' && i + 1 < segment.length) {\n                let set = '';\n                let closed = -1;\n                for (let i2 = i + 1; i2 < segment.length; i2++) {\n                    const c2 = segment[i2];\n                    // Escape\n                    if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n                        set += segment[++i2];\n                        continue;\n                    }\n                    // Closed\n                    else if (c2 === ']') {\n                        closed = i2;\n                        break;\n                    }\n                    // Otherwise\n                    else {\n                        set += c2;\n                    }\n                }\n                // Closed?\n                if (closed >= 0) {\n                    // Cannot convert\n                    if (set.length > 1) {\n                        return '';\n                    }\n                    // Convert to literal\n                    if (set) {\n                        literal += set;\n                        i = closed;\n                        continue;\n                    }\n                }\n                // Otherwise fall thru\n            }\n            // Append\n            literal += c;\n        }\n        return literal;\n    }\n    /**\n     * Escapes regexp special characters\n     * https://javascript.info/regexp-escaping\n     */\n    static regExpEscape(s) {\n        return s.replace(/[[\\\\^$.|?*+()]/g, '\\\\$&');\n    }\n}\n//# sourceMappingURL=internal-pattern.js.map","export class SearchState {\n    constructor(path, level) {\n        this.path = path;\n        this.level = level;\n    }\n}\n//# sourceMappingURL=internal-search-state.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\n    return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n    function fulfill(value) { resume(\"next\", value); }\n    function reject(value) { resume(\"throw\", value); }\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as globOptionsHelper from './internal-glob-options-helper.js';\nimport * as path from 'path';\nimport * as patternHelper from './internal-pattern-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Pattern } from './internal-pattern.js';\nimport { SearchState } from './internal-search-state.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class DefaultGlobber {\n    constructor(options) {\n        this.patterns = [];\n        this.searchPaths = [];\n        this.options = globOptionsHelper.getOptions(options);\n    }\n    getSearchPaths() {\n        // Return a copy\n        return this.searchPaths.slice();\n    }\n    glob() {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a, e_1, _b, _c;\n            const result = [];\n            try {\n                for (var _d = true, _e = __asyncValues(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {\n                    _c = _f.value;\n                    _d = false;\n                    const itemPath = _c;\n                    result.push(itemPath);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            return result;\n        });\n    }\n    globGenerator() {\n        return __asyncGenerator(this, arguments, function* globGenerator_1() {\n            // Fill in defaults options\n            const options = globOptionsHelper.getOptions(this.options);\n            // Implicit descendants?\n            const patterns = [];\n            for (const pattern of this.patterns) {\n                patterns.push(pattern);\n                if (options.implicitDescendants &&\n                    (pattern.trailingSeparator ||\n                        pattern.segments[pattern.segments.length - 1] !== '**')) {\n                    patterns.push(new Pattern(pattern.negate, true, pattern.segments.concat('**')));\n                }\n            }\n            // Push the search paths\n            const stack = [];\n            for (const searchPath of patternHelper.getSearchPaths(patterns)) {\n                core.debug(`Search path '${searchPath}'`);\n                // Exists?\n                try {\n                    // Intentionally using lstat. Detection for broken symlink\n                    // will be performed later (if following symlinks).\n                    yield __await(fs.promises.lstat(searchPath));\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        continue;\n                    }\n                    throw err;\n                }\n                stack.unshift(new SearchState(searchPath, 1));\n            }\n            // Search\n            const traversalChain = []; // used to detect cycles\n            while (stack.length) {\n                // Pop\n                const item = stack.pop();\n                // Match?\n                const match = patternHelper.match(patterns, item.path);\n                const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path);\n                if (!match && !partialMatch) {\n                    continue;\n                }\n                // Stat\n                const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain)\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                );\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                if (!stats) {\n                    continue;\n                }\n                // Hidden file or directory?\n                if (options.excludeHiddenFiles && path.basename(item.path).match(/^\\./)) {\n                    continue;\n                }\n                // Directory\n                if (stats.isDirectory()) {\n                    // Matched\n                    if (match & MatchKind.Directory && options.matchDirectories) {\n                        yield yield __await(item.path);\n                    }\n                    // Descend?\n                    else if (!partialMatch) {\n                        continue;\n                    }\n                    // Push the child items in reverse\n                    const childLevel = item.level + 1;\n                    const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new SearchState(path.join(item.path, x), childLevel));\n                    stack.push(...childItems.reverse());\n                }\n                // File\n                else if (match & MatchKind.File) {\n                    yield yield __await(item.path);\n                }\n            }\n        });\n    }\n    /**\n     * Constructs a DefaultGlobber\n     */\n    static create(patterns, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const result = new DefaultGlobber(options);\n            if (IS_WINDOWS) {\n                patterns = patterns.replace(/\\r\\n/g, '\\n');\n                patterns = patterns.replace(/\\r/g, '\\n');\n            }\n            const lines = patterns.split('\\n').map(x => x.trim());\n            for (const line of lines) {\n                // Empty or comment\n                if (!line || line.startsWith('#')) {\n                    continue;\n                }\n                // Pattern\n                else {\n                    result.patterns.push(new Pattern(line));\n                }\n            }\n            result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns));\n            return result;\n        });\n    }\n    static stat(item, options, traversalChain) {\n        return __awaiter(this, void 0, void 0, function* () {\n            // Note:\n            // `stat` returns info about the target of a symlink (or symlink chain)\n            // `lstat` returns info about a symlink itself\n            let stats;\n            if (options.followSymbolicLinks) {\n                try {\n                    // Use `stat` (following symlinks)\n                    stats = yield fs.promises.stat(item.path);\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        if (options.omitBrokenSymbolicLinks) {\n                            core.debug(`Broken symlink '${item.path}'`);\n                            return undefined;\n                        }\n                        throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);\n                    }\n                    throw err;\n                }\n            }\n            else {\n                // Use `lstat` (not following symlinks)\n                stats = yield fs.promises.lstat(item.path);\n            }\n            // Note, isDirectory() returns false for the lstat of a symlink\n            if (stats.isDirectory() && options.followSymbolicLinks) {\n                // Get the realpath\n                const realPath = yield fs.promises.realpath(item.path);\n                // Fixup the traversal chain to match the item level\n                while (traversalChain.length >= item.level) {\n                    traversalChain.pop();\n                }\n                // Test for a cycle\n                if (traversalChain.some((x) => x === realPath)) {\n                    core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);\n                    return undefined;\n                }\n                // Update the traversal chain\n                traversalChain.push(realPath);\n            }\n            return stats;\n        });\n    }\n}\n//# sourceMappingURL=internal-globber.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"stream\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nimport * as crypto from 'crypto';\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as stream from 'stream';\nimport * as util from 'util';\nimport * as path from 'path';\nexport function hashFiles(globber_1, currentWorkspace_1) {\n    return __awaiter(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) {\n        var _a, e_1, _b, _c;\n        var _d;\n        const writeDelegate = verbose ? core.info : core.debug;\n        let hasMatch = false;\n        const githubWorkspace = currentWorkspace\n            ? currentWorkspace\n            : ((_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd());\n        const result = crypto.createHash('sha256');\n        let count = 0;\n        try {\n            for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {\n                _c = _g.value;\n                _e = false;\n                const file = _c;\n                writeDelegate(file);\n                if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {\n                    writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);\n                    continue;\n                }\n                if (fs.statSync(file).isDirectory()) {\n                    writeDelegate(`Skip directory '${file}'.`);\n                    continue;\n                }\n                const hash = crypto.createHash('sha256');\n                const pipeline = util.promisify(stream.pipeline);\n                yield pipeline(fs.createReadStream(file), hash);\n                result.write(hash.digest());\n                count++;\n                if (!hasMatch) {\n                    hasMatch = true;\n                }\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        result.end();\n        if (hasMatch) {\n            writeDelegate(`Found ${count} files to hash.`);\n            return result.digest('hex');\n        }\n        else {\n            writeDelegate(`No matches found for glob`);\n            return '';\n        }\n    });\n}\n//# sourceMappingURL=internal-hash-files.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { DefaultGlobber } from './internal-globber.js';\nimport { hashFiles as _hashFiles } from './internal-hash-files.js';\n/**\n * Constructs a globber\n *\n * @param patterns  Patterns separated by newlines\n * @param options   Glob options\n */\nexport function create(patterns, options) {\n    return __awaiter(this, void 0, void 0, function* () {\n        return yield DefaultGlobber.create(patterns, options);\n    });\n}\n/**\n * Computes the sha256 hash of a glob\n *\n * @param patterns  Patterns separated by newlines\n * @param currentWorkspace  Workspace used when matching files\n * @param options   Glob options\n * @param verbose   Enables verbose logging\n */\nexport function hashFiles(patterns_1) {\n    return __awaiter(this, arguments, void 0, function* (patterns, currentWorkspace = '', options, verbose = false) {\n        let followSymbolicLinks = true;\n        if (options && typeof options.followSymbolicLinks === 'boolean') {\n            followSymbolicLinks = options.followSymbolicLinks;\n        }\n        const globber = yield create(patterns, { followSymbolicLinks });\n        return _hashFiles(globber, currentWorkspace, verbose);\n    });\n}\n//# sourceMappingURL=glob.js.map","import { createReadStream } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { basename, posix, relative, resolve, sep } from 'node:path'\nimport { Readable } from 'node:stream'\nimport * as core from '@actions/core'\nimport * as glob from '@actions/glob'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { StreamSource } from '@backblaze-labs/b2-sdk/streams'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link UploadResult.files}. */\nexport interface UploadedFile {\n  /** Absolute path on the runner that was uploaded. */\n  localPath: string\n  /** B2 file name (the key) the upload landed under. */\n  fileName: string\n  /** B2 file ID assigned by the server. */\n  fileId: string\n  /** Byte size of the upload. */\n  size: number\n  /** Whole-file SHA-1, or `null` when the file was multipart-uploaded. */\n  contentSha1: string | null\n}\n\n/** Result of {@link uploadCommand}. */\nexport interface UploadResult {\n  /** One entry per uploaded file. Single-file mode returns a one-element array. */\n  files: UploadedFile[]\n  /** Total bytes uploaded across all files. */\n  bytesTransferred: number\n}\n\n/**\n * Upload one or more files to B2.\n *\n * Mode selection:\n *   - If `source` is a plain file path (no glob metacharacters and the path\n *     exists as a regular file), upload that single file. The B2 file name is\n *     `destination` if set; otherwise `basename(source)`.\n *   - Otherwise treat `source` (plus any `include` patterns) as glob(s). Each\n *     matched file is uploaded preserving its path relative to the glob root,\n *     prefixed by `destination` (default empty).\n *\n * Large files are streamed (StreamSource over a fs ReadStream-as-Web-Stream)\n * so we don't buffer the whole payload in RAM. The SDK's `Bucket.upload`\n * routes to multipart automatically when size exceeds the recommended part\n * size and parallelizes parts up to `concurrency`.\n */\nexport async function uploadCommand(\n  bucket: Bucket,\n  inputs: ParsedInputs,\n  signal?: AbortSignal,\n): Promise {\n  const source = requireSource(inputs.source, 'upload')\n\n  const { files, isSingleExplicitFile } = await resolveFiles(source, inputs.include, inputs.exclude)\n  if (files.length === 0) {\n    if (inputs.failOnEmpty) {\n      throw new Error(`No files matched: ${source}`)\n    }\n    core.warning(`No files matched: ${source}`)\n    return { files: [], bytesTransferred: 0 }\n  }\n\n  const fileConcurrency = isSingleExplicitFile ? 1 : inputs.concurrency\n  // Multi-file uploads spend the concurrency budget across files and keep each\n  // file's multipart upload sequential so total in-flight B2 requests remain\n  // bounded by the user-supplied `concurrency` value.\n  const partConcurrency = isSingleExplicitFile || files.length === 1 ? inputs.concurrency : 1\n\n  const uploaded = await mapWithConcurrency(files, fileConcurrency, async (f) => {\n    signal?.throwIfAborted()\n    const fileName = remapFileName(f, inputs.destination, isSingleExplicitFile)\n    const uploadLabel = `upload ${f.localPath} → b2://${bucket.name}/${fileName}`\n    const groupedLog = files.length === 1 || fileConcurrency === 1\n    if (groupedLog) {\n      core.startGroup(uploadLabel)\n    } else {\n      core.info(uploadLabel)\n    }\n    try {\n      return await uploadOne(\n        bucket,\n        f.localPath,\n        fileName,\n        inputs,\n        partConcurrency,\n        groupedLog,\n        signal,\n      )\n    } finally {\n      if (groupedLog) core.endGroup()\n    }\n  })\n  const totalBytes = uploaded.reduce((sum, file) => sum + file.size, 0)\n\n  return { files: uploaded, bytesTransferred: totalBytes }\n}\n\nasync function mapWithConcurrency(\n  items: T[],\n  concurrency: number,\n  mapper: (item: T) => Promise,\n): Promise {\n  const results = new Array(items.length)\n  let next = 0\n  let firstError: unknown\n  let failed = false\n\n  async function worker(): Promise {\n    while (true) {\n      if (failed) return\n      const index = next++\n      if (index >= items.length) return\n      try {\n        results[index] = await mapper(items[index] as T)\n      } catch (error) {\n        if (!failed) {\n          failed = true\n          firstError = error\n        }\n        return\n      }\n    }\n  }\n\n  const workerCount = Math.min(concurrency, items.length)\n  await Promise.all(Array.from({ length: workerCount }, () => worker()))\n  if (failed) throw firstError\n  return results\n}\n\ninterface ResolvedFiles {\n  files: ResolvedFile[]\n  isSingleExplicitFile: boolean\n}\n\n/**\n * Local file resolved from an upload source.\n *\n * @internal\n */\nexport interface ResolvedFile {\n  localPath: string\n  /** Path relative to the glob root, used when computing the B2 key. */\n  fileName: string\n}\n\nasync function resolveFiles(\n  source: string,\n  include: string[],\n  exclude: string[],\n): Promise {\n  const explicitFile = await tryStat(source)\n  const looksLikeGlob = /[*?[\\]]/.test(source)\n\n  if (explicitFile?.isFile() && !looksLikeGlob && include.length === 0) {\n    return {\n      files: [{ localPath: resolve(source), fileName: basename(source) }],\n      isSingleExplicitFile: true,\n    }\n  }\n\n  const patterns: string[] = []\n  if (explicitFile?.isDirectory()) {\n    patterns.push(`${resolve(source)}/**`)\n  } else {\n    patterns.push(source)\n  }\n  for (const p of include) patterns.push(p)\n  for (const p of exclude) patterns.push(`!${p}`)\n\n  const globber = await glob.create(patterns.join('\\n'), {\n    followSymbolicLinks: false,\n    matchDirectories: false,\n  })\n  const matches = await globber.glob()\n  const root = explicitFile?.isDirectory() ? resolve(source) : process.cwd()\n\n  const out: ResolvedFile[] = []\n  for (const m of matches) {\n    const s = await tryStat(m)\n    // Filesystem boundary: skip entries that aren't readable files (broken\n    // symlinks, races where a file is unlinked between glob and stat, etc.).\n    if (!s?.isFile()) continue\n    const rel = relative(root, m).split(sep).join(posix.sep)\n    out.push({ localPath: m, fileName: rel })\n  }\n  out.sort(compareResolvedFiles)\n  return { files: out, isSingleExplicitFile: false }\n}\n\nfunction compareResolvedFiles(a: ResolvedFile, b: ResolvedFile): number {\n  return compareStrings(a.fileName, b.fileName) || compareStrings(a.localPath, b.localPath)\n}\n\nfunction compareStrings(a: string, b: string): number {\n  if (a < b) return -1\n  if (a > b) return 1\n  return 0\n}\n\n/**\n * Map a local source file to its B2 file name under the requested destination.\n *\n * @internal\n */\nexport function remapFileName(\n  file: ResolvedFile,\n  destination: string | undefined,\n  isSingleExplicitFile: boolean,\n): string {\n  if (destination === undefined || destination === '') return file.fileName\n  const dest = destination.replace(/\\/+$/, '')\n  if (isSingleExplicitFile && !destination.endsWith('/')) return dest\n  return `${dest}/${file.fileName}`\n}\n\nasync function uploadOne(\n  bucket: Bucket,\n  localPath: string,\n  fileName: string,\n  inputs: ParsedInputs,\n  partConcurrency: number,\n  groupedLog: boolean,\n  signal?: AbortSignal,\n): Promise {\n  const fileStat = await stat(localPath)\n  const size = fileStat.size\n\n  // Stream the file from disk. The SDK's `bucket.upload` routes files larger\n  // than the recommended part size through `uploadLargeFile`, which now\n  // detects non-sliceable sources (StreamSource) and reads the stream once,\n  // shipping one part at a time. Peak memory ≈ partSize regardless of file\n  // size, so multi-GB uploads stay bounded.\n  const nodeStream = createReadStream(localPath)\n  const webStream = Readable.toWeb(nodeStream) as ReadableStream\n  const source = new StreamSource(webStream, size)\n\n  const onProgress = makeProgressListener(`upload[${fileName}]`)\n\n  // `inputs.resume` is parsed but deliberately NOT forwarded to the SDK.\n  // The SDK's resume implementation requires a sliceable source so it can\n  // re-upload specific part offsets after a crash. The action uses\n  // `StreamSource` (memory-bounded streaming from disk), which is read-once-\n  // sequential and not sliceable; passing `resume: true` here would throw\n  // `\"resume is not supported on non-sliceable sources\"`. The input is\n  // kept in the action surface so this can be re-enabled if the action\n  // ever offers a `BufferSource` fallback for users willing to trade RAM\n  // for resumability.\n  const result = await bucket.upload({\n    fileName,\n    source,\n    concurrency: partConcurrency,\n    ...(inputs.partSize !== undefined ? { partSize: inputs.partSize } : {}),\n    ...(inputs.contentType !== undefined ? { contentType: inputs.contentType } : {}),\n    ...(inputs.encryption !== undefined ? { serverSideEncryption: inputs.encryption } : {}),\n    ...(signal !== undefined ? { signal } : {}),\n    onProgress,\n  })\n\n  // SDK now normalizes multipart `'none'` to `null` at the boundary, so\n  // `result.contentSha1` is `string | null` directly.\n  const sha1 = result.contentSha1\n  const detailPrefix = groupedLog ? '  ' : ''\n  core.info(`${detailPrefix}fileId=${result.fileId} sha1=${sha1 ?? 'multipart'}`)\n\n  return {\n    localPath,\n    fileName: result.fileName,\n    fileId: result.fileId,\n    size,\n    contentSha1: sha1,\n  }\n}\n","import { createReadStream } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { IncrementalSha1 } from '@backblaze-labs/b2-sdk/streams'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link verifyCommand}. */\nexport interface VerifyResult {\n  /** B2 file name that was checked. */\n  fileName: string\n  /** Server-reported byte size of the remote object. */\n  remoteSize: number\n  /**\n   * Remote SHA-1 result: normalized lowercase digest when comparable, raw B2\n   * value for non-comparable headers such as `none` or `unverified:`,\n   * or `null` when B2 does not expose one.\n   */\n  remoteSha1: string | null\n  /** Locally-computed SHA-1, or `null` if no local file was provided. */\n  localSha1: string | null\n  /** True when remote SHA-1 matches the expected value. */\n  verified: boolean\n  /** Human-readable failure reason; `undefined` on success. */\n  reason: string | undefined\n}\n\n/**\n * Verify that a B2 object matches a local file (or an expected SHA-1) without\n * transferring the body.\n *\n * Three modes, in priority order:\n *   1. `expected-sha1` input set → compare the remote object's SHA-1 to that\n *      literal value. No local read.\n *   2. `destination` input is an existing local file → compute that file's\n *      SHA-1 locally and compare to the remote.\n *   3. Neither → fail.\n *\n * In all modes, the remote SHA-1 is fetched via a HEAD request (header\n * `x-bz-content-sha1`). Large files uploaded via multipart return `null` from\n * B2 here because B2 stores the per-part SHA-1s but not a whole-file SHA-1;\n * HEAD-only verification cannot validate those objects, even when\n * `expected-sha1` is supplied.\n */\nexport async function verifyCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n  const source = requireSource(inputs.source, 'verify', 'the B2 file name')\n\n  core.startGroup(`verify b2://${bucket.name}/${source}`)\n  try {\n    // `bucket.head` returns only the parsed response headers; no body to\n    // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n    const { headers } = await bucket.head(source)\n    const remoteSize = headers.contentLength\n    const remoteSha1 = headers.contentSha1\n\n    let localSha1: string | null = null\n    let expected: string | null =\n      inputs.expectedSha1 !== undefined ? normalizeSha1(inputs.expectedSha1, 'expected-sha1') : null\n\n    if (expected === null && inputs.destination !== undefined && inputs.destination !== '') {\n      localSha1 = await sha1OfFile(inputs.destination)\n      expected = normalizeSha1(localSha1, 'destination')\n    }\n\n    if (expected === null) {\n      throw new Error(\n        \"verify needs either 'expected-sha1' (literal) or 'destination' (local file path) to compare against\",\n      )\n    }\n\n    const normalizedRemoteSha1 = remoteSha1 === null ? null : normalizeRemoteSha1(remoteSha1)\n    if (normalizedRemoteSha1 === null) {\n      const reason = unavailableRemoteSha1Reason(remoteSha1)\n      core.warning(`  ${reason}`)\n      return {\n        fileName: source,\n        remoteSize,\n        remoteSha1,\n        localSha1,\n        verified: false,\n        reason,\n      }\n    }\n\n    const verified = normalizedRemoteSha1 === expected\n    const reason = verified\n      ? undefined\n      : `SHA-1 mismatch: remote=${normalizedRemoteSha1} expected=${expected}`\n    if (verified) {\n      core.info(`  ✓ SHA-1 matches (${normalizedRemoteSha1}), size=${remoteSize}B`)\n    } else {\n      core.warning(`  ${reason}`)\n    }\n\n    return {\n      fileName: source,\n      remoteSize,\n      remoteSha1: normalizedRemoteSha1,\n      localSha1,\n      verified,\n      reason,\n    }\n  } finally {\n    core.endGroup()\n  }\n}\n\n/**\n * Normalize and validate a SHA-1 digest for case-insensitive comparison.\n *\n * @internal\n */\nexport function normalizeSha1(raw: string, label = 'SHA-1'): string {\n  const normalized = raw.trim().toLowerCase()\n  if (!/^[a-f0-9]{40}$/.test(normalized)) {\n    throw new Error(`Invalid ${label}: expected a 40-character hexadecimal SHA-1 digest`)\n  }\n  return normalized\n}\n\nfunction normalizeRemoteSha1(raw: string): string | null {\n  const normalized = raw.trim().toLowerCase()\n  return /^[a-f0-9]{40}$/.test(normalized) ? normalized : null\n}\n\nfunction unavailableRemoteSha1Reason(remoteSha1: string | null): string {\n  if (remoteSha1 === null) {\n    return 'remote SHA-1 is unavailable because B2 does not expose a whole-file SHA-1 for multipart-uploaded files; HEAD-only verify cannot validate this object, even with expected-sha1'\n  }\n  return `remote SHA-1 is unavailable because B2 reported ${JSON.stringify(remoteSha1)} instead of a verified 40-character whole-file SHA-1; HEAD-only verify cannot validate this object, even with expected-sha1`\n}\n\nasync function sha1OfFile(path: string): Promise {\n  const fileStat = await stat(path)\n  if (!fileStat.isFile()) {\n    throw new Error(`verify: 'destination' must be an existing file, got: ${path}`)\n  }\n  const hasher = new IncrementalSha1()\n  const stream = createReadStream(path)\n  for await (const chunk of stream) {\n    await hasher.update(chunk as Uint8Array)\n  }\n  return hasher.digest()\n}\n","import {\n  AccessDeniedError,\n  B2Error,\n  B2InsufficientCapabilityError,\n  B2SsrfError,\n  BadAuthTokenError,\n  NetworkError,\n} from '@backblaze-labs/b2-sdk/errors'\nimport { ACTION_EFFECTS, type ActionName } from './inputs.ts'\n\nconst SAFE_RETRY_HINT = 'safe to retry this workflow.'\nconst DRY_RUN_RETRY_HINT = 'safe to retry this dry-run workflow.'\nconst MUTATING_RETRY_SUFFIX =\n  'action may have partially committed; inspect B2 state before rerunning to avoid duplicate file versions, orphaned large-file uploads, or unintended deletes.'\nconst UNKNOWN_RETRY_HINT =\n  'retry may be appropriate after checking whether the request had side effects.'\nconst SSRF_FAILURE_MESSAGE =\n  'B2 endpoint safety check failed: rejected an unsafe B2 endpoint or server-provided URL. Check the endpoint input and B2 realm configuration.'\nconst MAX_LOG_FIELD_LENGTH = 1_000\nconst MAX_LOG_INPUT_LENGTH = MAX_LOG_FIELD_LENGTH * 2\nconst MAX_SECRET_BOUNDARY_WINDOW = MAX_LOG_INPUT_LENGTH\nconst MAX_DERIVED_SECRET_LENGTH = 512\nconst DEFAULT_NETWORK_RETRY_AFTER_SECONDS = 30\nconst MAX_RETRY_AFTER_SECONDS = 3_600\nconst MAX_CAUSE_DEPTH = 32\n\nexport interface ActionErrorOptions {\n  action?: ActionName\n  dryRun?: boolean\n  secretValues?: readonly string[]\n}\n\nexport interface ClassifiedActionError {\n  message: string\n  retryable: boolean | undefined\n  retryAfter: number | undefined\n}\n\nexport function classifyActionError(\n  err: unknown,\n  options: ActionErrorOptions = {},\n): ClassifiedActionError {\n  // Order matters: specific SDK classes first, then retryable B2Error, then\n  // the generic B2Error fallback last so new subclasses are not shadowed.\n  if (hasSsrfCause(err)) {\n    return failure(SSRF_FAILURE_MESSAGE, false)\n  }\n  if (err instanceof BadAuthTokenError && isAuthorizationScopeFailure(err)) {\n    return failure(\n      `B2 permission denied: application key is missing required capabilities or is outside the bucket/prefix scope. Update the key capabilities or use a key scoped to this bucket/prefix. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof BadAuthTokenError) {\n    return failure(\n      `B2 authentication failed: check application-key-id and application-key, and confirm the key is active. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof B2InsufficientCapabilityError) {\n    const missing = err.missing.length > 0 ? err.missing.join(', ') : '(unknown)'\n    return failure(\n      `B2 permission denied: application key is missing required capabilities: ${sanitizeLogField(missing, options)}. Update the key capabilities or use a key scoped to this bucket/prefix.`,\n      false,\n    )\n  }\n  if (err instanceof AccessDeniedError) {\n    return failure(\n      `B2 permission denied: check application key capabilities, bucket access, and file name prefix restrictions. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof NetworkError) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient network error talking to B2: ${retry.hint} ${sanitizeLogField(err.message, options)}`,\n      retry.safe,\n      retry.safe ? DEFAULT_NETWORK_RETRY_AFTER_SECONDS : undefined,\n    )\n  }\n  if (err instanceof B2Error && err.retryable) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient B2 error: ${retry.hint} ${formatB2Details(err, options)}`,\n      retry.safe,\n      retry.safe ? err.retryAfter : undefined,\n    )\n  }\n  if (err instanceof B2Error) {\n    return failure(\n      `B2 request failed: ${formatGenericB2Guidance(err, options)} ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  const message = err instanceof Error ? err.message : String(err)\n  return failure(sanitizeLogField(message, options), undefined)\n}\n\nexport function formatActionDebugError(err: unknown, options: ActionErrorOptions = {}): string {\n  const message = err instanceof Error ? (err.stack ?? err.message) : String(err)\n  return sanitizeLogField(message, options)\n}\n\nfunction failure(\n  message: string,\n  retryable: boolean | undefined,\n  retryAfter?: number | undefined,\n): ClassifiedActionError {\n  return { message, retryable, retryAfter: normalizeRetryAfter(retryAfter) }\n}\n\nfunction formatB2Details(err: B2Error, options: ActionErrorOptions): string {\n  const details = [\n    `status ${sanitizeLogField(String(err.status), options)}`,\n    `code ${sanitizeLogField(err.code, options)}`,\n  ]\n  const retryAfter = normalizeRetryAfter(err.retryAfter)\n  if (retryAfter !== undefined) {\n    details.push(`retry after ${sanitizeLogField(String(retryAfter), options)}s`)\n  }\n  return `B2 response details: ${details.join(', ')}`\n}\n\nfunction formatGenericB2Guidance(err: B2Error, options: ActionErrorOptions): string {\n  const message = sanitizeLogField(err.message, options)\n  switch (err.code) {\n    case 'file_not_present':\n    case 'no_such_file':\n      return `File not found; check the bucket and file name. B2 said: ${message}.`\n    case 'duplicate_bucket_name':\n      return `Bucket name already exists; choose a unique bucket name. B2 said: ${message}.`\n    case 'cap_exceeded':\n    case 'storage_cap_exceeded':\n    case 'transaction_cap_exceeded':\n    case 'download_cap_exceeded':\n      return `B2 account cap was exceeded; reduce usage or wait before retrying. B2 said: ${message}.`\n    case 'bad_request':\n      return `Bad request; check the action inputs for invalid values. B2 said: ${message}.`\n    default:\n      return `B2 said: ${message}.`\n  }\n}\n\nfunction retryPolicy(options: ActionErrorOptions): { safe: boolean; hint: string } {\n  const { action } = options\n  if (action === undefined) return { safe: false, hint: UNKNOWN_RETRY_HINT }\n  const effect = ACTION_EFFECTS[action]\n  if (options.dryRun === true && effect.honorsDryRun) {\n    return { safe: true, hint: DRY_RUN_RETRY_HINT }\n  }\n  if (effect.kind === 'read') return { safe: true, hint: SAFE_RETRY_HINT }\n  return { safe: false, hint: `the ${action} ${MUTATING_RETRY_SUFFIX}` }\n}\n\nfunction isAuthorizationScopeFailure(err: BadAuthTokenError): boolean {\n  if (err.code !== 'unauthorized') return false\n  // The SDK currently exposes scoped-key `unauthorized` responses as\n  // BadAuthTokenError with only server prose to distinguish capability/scope\n  // misses. Keep this as best-effort until a structured subtype exists.\n  return /\\b(capability|capabilities|scope|bucket|prefix|permission|not authorized|unauthorized)\\b/i.test(\n    err.message,\n  )\n}\n\nfunction hasSsrfCause(err: unknown): boolean {\n  const seen = new Set()\n  let current: unknown = err\n  for (let depth = 0; current instanceof Error && depth < MAX_CAUSE_DEPTH; depth += 1) {\n    if (current instanceof B2SsrfError) return true\n    if (seen.has(current)) return false\n    seen.add(current)\n    current = current.cause\n  }\n  return false\n}\n\nfunction normalizeRetryAfter(retryAfter: number | undefined): number | undefined {\n  if (retryAfter === undefined || !Number.isFinite(retryAfter) || retryAfter < 0) return undefined\n  return Math.min(Math.ceil(retryAfter), MAX_RETRY_AFTER_SECONDS)\n}\n\nfunction sanitizeUntrustedText(value: string): string {\n  return value\n    .replace(/\\bhttps?:\\/\\/\\S+/gi, '[redacted-url]')\n    .replace(/\\bBearer\\s+[A-Za-z0-9._~+/=-]+/gi, 'Bearer ***')\n}\n\nfunction sanitizeLogField(value: string, options: ActionErrorOptions): string {\n  const secretValues = options.secretValues ?? []\n  const scrubInputLength =\n    secretValues.length > 0\n      ? MAX_LOG_INPUT_LENGTH + MAX_SECRET_BOUNDARY_WINDOW\n      : MAX_LOG_INPUT_LENGTH\n  const bounded = value.length > scrubInputLength ? value.slice(0, scrubInputLength) : value\n  const masked = maskSecrets(bounded, secretValues)\n  const scrubbed =\n    masked.length > MAX_LOG_INPUT_LENGTH ? masked.slice(0, MAX_LOG_INPUT_LENGTH) : masked\n  const sanitized = sanitizeUntrustedText(scrubbed)\n  if (sanitized.length <= MAX_LOG_FIELD_LENGTH) return sanitized\n  return `${sanitized.slice(0, MAX_LOG_FIELD_LENGTH)}... [truncated]`\n}\n\nfunction maskSecrets(value: string, secretValues: readonly string[]): string {\n  let masked = value\n  for (const secret of secretValues) {\n    for (const variant of secretVariants(secret)) {\n      masked = masked.split(variant).join('***')\n    }\n  }\n  return masked\n}\n\nfunction secretVariants(secret: string): string[] {\n  if (secret === '') return []\n  const variants = new Set()\n  addSecretVariant(variants, secret)\n  if (secret.length > MAX_LOG_INPUT_LENGTH) {\n    addSecretVariant(variants, secret.slice(0, MAX_LOG_INPUT_LENGTH))\n  }\n  if (secret.length >= 4 && secret.length <= MAX_DERIVED_SECRET_LENGTH) {\n    const base64 = Buffer.from(secret, 'utf8').toString('base64')\n    const base64Url = base64.replaceAll('+', '-').replaceAll('/', '_')\n    addUriEncodedSecretVariant(variants, secret)\n    addSecretVariant(variants, base64)\n    addSecretVariant(variants, base64Url)\n    addSecretVariant(variants, base64Url.replace(/=+$/u, ''))\n    addSecretVariant(variants, Buffer.from(secret, 'utf8').toString('hex'))\n  }\n  return [...variants].sort((a, b) => b.length - a.length)\n}\n\nfunction addSecretVariant(variants: Set, value: string): void {\n  if (value !== '') variants.add(value)\n}\n\nfunction addUriEncodedSecretVariant(variants: Set, secret: string): void {\n  try {\n    addSecretVariant(variants, encodeURIComponent(secret))\n  } catch {\n    // Malformed surrogate pairs are valid JavaScript strings but invalid URI\n    // components. Keep raw/base64/hex masking without letting scrubbing fail.\n  }\n}\n","import { Buffer } from 'node:buffer'\nimport * as core from '@actions/core'\n\nexport const SUMMARY_JSON_PREVIEW_MAX_ENTRIES = 100\nexport const SUMMARY_JSON_MAX_UTF8_BYTES = 256 * 1024\nconst SUMMARY_JSON_OUTPUT_NAME = 'summary-json'\nconst SUMMARY_JSON_TRUNCATED_OUTPUT_NAME = 'summary-json-truncated'\nexport const SUMMARY_JSON_NOTICE_OUTPUT_NAME = 'summary-json-notice'\nexport const SUMMARY_JSON_PREVIEW_OUTPUT_NAME = 'summary-json-preview'\n\nexport type SummaryJsonPayload = CompleteSummaryJsonPayload | TruncatedSummaryJsonPayload\n\nexport interface CompleteSummaryJsonPayload {\n  json: string\n  totalCount: number\n  truncated: false\n}\n\nexport interface TruncatedSummaryJsonPayload {\n  json: string\n  noticeJson: string\n  previewJson: string\n  totalCount: number\n  previewCount: number\n  reason: string\n  truncated: true\n}\n\nexport interface SummaryJsonOutputOptions {\n  item?: (item: T) => unknown\n}\n\ninterface BoundedJsonArray {\n  json: string\n  emittedCount: number\n  byteLimitExceeded: boolean\n  serializationFailed: boolean\n}\n\n/**\n * Serialize per-file command details into the bounded `summary-json` output.\n *\n * GitHub Actions writes outputs as UTF-8 and caps all action outputs for a job\n * at 1 MB. Keep this single structured output well below that job-level\n * budget so scalar outputs, $GITHUB_OUTPUT framing, and caller-defined outputs\n * still have room.\n *\n * `summary-json` remains a complete array when the full manifest fits. When a\n * result exceeds the supported byte cap, `summary-json` remains an array\n * (`[]`) rather than changing shape or carrying a partial manifest.\n * `summary-json-notice` receives a small JSON object describing the\n * truncation, `summary-json-preview` receives a bounded diagnostic prefix, and\n * `summary-json-truncated` is set to `true`. The action step may still succeed\n * because the B2 operation itself has already completed. Scalar count outputs\n * (`file-count`, `files-listed`, etc.) remain the authoritative totals.\n *\n * The serializer also omits credential-bearing field names for every command:\n * `url`, fields ending in `url`, and fields containing `authorization`,\n * `signature`, or `token` after case/underscore/hyphen normalization. Commands\n * that need to expose similarly named non-secret data should project it to an\n * explicit safe field name before calling this helper.\n */\nexport function buildSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): SummaryJsonPayload {\n  const serialized = serializeJsonArrayPrefix(items, options, items.length)\n  if (!serialized.byteLimitExceeded && !serialized.serializationFailed) {\n    return {\n      json: serialized.json,\n      totalCount: items.length,\n      truncated: false,\n    }\n  }\n\n  return buildTruncatedSummaryJsonPayload(\n    items,\n    options,\n    serialized.serializationFailed\n      ? 'summary-json could not be serialized within the supported output contract'\n      : 'summary-json exceeded the supported UTF-8 output size cap',\n  )\n}\n\nfunction buildTruncatedSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  reason: string,\n): TruncatedSummaryJsonPayload {\n  const preview = buildSummaryJsonPreview(items, options)\n\n  return {\n    json: '[]',\n    noticeJson: JSON.stringify({\n      truncated: true,\n      reason,\n      totalCount: items.length,\n      previewCount: preview.emittedCount,\n      previewOutput: SUMMARY_JSON_PREVIEW_OUTPUT_NAME,\n    }),\n    previewJson: preview.json,\n    totalCount: items.length,\n    previewCount: preview.emittedCount,\n    reason,\n    truncated: true,\n  }\n}\n\nfunction buildSummaryJsonPreview(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n): {\n  json: string\n  emittedCount: number\n} {\n  const preview = serializeJsonArrayPrefix(items, options, SUMMARY_JSON_PREVIEW_MAX_ENTRIES)\n  return { json: preview.json, emittedCount: preview.emittedCount }\n}\n\nexport function setSummaryJsonOutput(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): void {\n  const payload = buildSummaryJsonPayload(items, options)\n\n  core.setOutput(SUMMARY_JSON_TRUNCATED_OUTPUT_NAME, String(payload.truncated))\n  core.setOutput(SUMMARY_JSON_OUTPUT_NAME, payload.json)\n  if (!payload.truncated) {\n    return\n  }\n\n  core.setOutput(SUMMARY_JSON_NOTICE_OUTPUT_NAME, payload.noticeJson)\n  core.setOutput(SUMMARY_JSON_PREVIEW_OUTPUT_NAME, payload.previewJson)\n  core.warning(\n    `summary-json truncated: ${payload.reason}; preview contains ` +\n      `${payload.previewCount} of ${payload.totalCount} item(s). ` +\n      `summary-json is [] and summary-json-notice describes the truncation. ` +\n      `limit is ${formatKiB(SUMMARY_JSON_MAX_UTF8_BYTES)} of UTF-8 JSON text`,\n  )\n}\n\nfunction serializeJsonArrayPrefix(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  maxEntries: number,\n): BoundedJsonArray {\n  const parts: string[] = ['[']\n  let bytes = 2\n  let emittedCount = 0\n  const count = Math.min(items.length, maxEntries)\n\n  for (let index = 0; index < count; index++) {\n    let itemJson: string\n    try {\n      itemJson = stringifyArrayItem(projectItem(items[index] as T, options))\n    } catch {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: false,\n        serializationFailed: true,\n      }\n    }\n\n    const separator = emittedCount === 0 ? '' : ','\n    const additionalBytes = utf8ByteLength(separator) + utf8ByteLength(itemJson)\n    if (bytes + additionalBytes > SUMMARY_JSON_MAX_UTF8_BYTES) {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: true,\n        serializationFailed: false,\n      }\n    }\n\n    if (separator !== '') parts.push(separator)\n    parts.push(itemJson)\n    bytes += additionalBytes\n    emittedCount++\n  }\n\n  parts.push(']')\n  return {\n    json: parts.join(''),\n    emittedCount,\n    byteLimitExceeded: false,\n    serializationFailed: false,\n  }\n}\n\nfunction projectItem(item: T, options: SummaryJsonOutputOptions): unknown {\n  return options.item === undefined ? item : options.item(item)\n}\n\nfunction stringifyArrayItem(item: unknown): string {\n  const json = JSON.stringify(item, sensitiveSummaryJsonFieldReplacer)\n  return json === undefined ? 'null' : json\n}\n\nfunction sensitiveSummaryJsonFieldReplacer(key: string, value: unknown): unknown {\n  return key !== '' && isSensitiveSummaryJsonField(key) ? undefined : value\n}\n\nfunction isSensitiveSummaryJsonField(key: string): boolean {\n  const normalized = key.replaceAll('-', '').replaceAll('_', '').toLowerCase()\n  return (\n    normalized === 'url' ||\n    normalized.endsWith('url') ||\n    normalized.includes('authorization') ||\n    normalized.includes('signature') ||\n    normalized.includes('token')\n  )\n}\n\nfunction utf8ByteLength(value: string): number {\n  return Buffer.byteLength(value, 'utf8')\n}\n\nfunction formatKiB(bytes: number): string {\n  return `${Math.floor(bytes / 1024)} KiB`\n}\n","import { appendFile } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport { formatBytes } from './format.ts'\n\n/** Maximum per-file rows rendered in a GitHub Actions step summary table. */\nexport const STEP_SUMMARY_MAX_ROWS = 100\n\n/**\n * One row in the `$GITHUB_STEP_SUMMARY` table emitted by a verb. Only\n * `fileName` is required; the other cells render empty when omitted.\n */\nexport interface SummaryRow {\n  /** B2 file name or display label (e.g. `(uploaded)`, `(removed)`). */\n  fileName: string\n  /** Byte size of the file. Rendered via {@link formatBytes}. */\n  size?: number | undefined\n  /** B2 file ID (rendered as inline code). */\n  fileId?: string | undefined\n  /** Content SHA-1. Truncated to 12 chars in the table for readability. */\n  sha1?: string | null | undefined\n  /** Free-form status cell (e.g. `uploaded`, `would delete`, `deleted`). */\n  status?: string | undefined\n}\n\n/**\n * Append a markdown summary block to `$GITHUB_STEP_SUMMARY`. No-ops when\n * the env var is unset (e.g. running the bundle locally for a smoke test).\n *\n * @param opts.title - Heading rendered as `## {title}`.\n * @param opts.rows - One row per file. Empty rows render an empty table body.\n * @param opts.totals - Optional aggregate line printed above the table.\n * @param opts.totalRows - Optional source row count when callers pre-slice rows.\n */\nexport async function writeStepSummary(opts: {\n  title: string\n  rows: readonly SummaryRow[]\n  totals?: { files: number; bytes: number } | undefined\n  totalRows?: number | undefined\n}): Promise {\n  const path = process.env.GITHUB_STEP_SUMMARY\n  if (!path) return\n\n  // Keep the writer defensive for direct callers even though dispatcher\n  // call sites pre-slice rows to avoid mapping very large result sets.\n  const rows = opts.rows.slice(0, STEP_SUMMARY_MAX_ROWS)\n  const totalRows = opts.totalRows ?? opts.rows.length\n  const lines: string[] = []\n  lines.push(`## ${opts.title}`)\n  lines.push('')\n\n  if (opts.totals !== undefined) {\n    lines.push(`**${opts.totals.files}** files, **${formatBytes(opts.totals.bytes)}** total.`)\n    lines.push('')\n  }\n\n  if (totalRows > rows.length) {\n    lines.push(`Showing first ${rows.length} of ${totalRows} rows.`)\n    lines.push('')\n  }\n\n  if (rows.length > 0) {\n    lines.push('| File | Size | File ID | SHA-1 | Status |')\n    lines.push('|------|------|---------|-------|--------|')\n    for (const r of rows) {\n      lines.push(\n        `| ${inlineCodeCell(r.fileName)} | ${r.size !== undefined ? formatBytes(r.size) : ''} | ${\n          r.fileId !== undefined ? inlineCodeCell(r.fileId) : ''\n        } | ${r.sha1 != null ? `\\`${r.sha1.slice(0, 12)}…\\`` : ''} | ${\n          r.status !== undefined ? inlineCodeCell(r.status) : ''\n        } |`,\n      )\n    }\n  }\n\n  lines.push('')\n\n  try {\n    await appendFile(path, `${lines.join('\\n')}\\n`)\n  } catch (err) {\n    // $GITHUB_STEP_SUMMARY might point at an unwritable path (e.g. a\n    // directory, or a file the runner lacks permission to extend). The\n    // summary is informational; degrading to a warning is better than\n    // failing an otherwise-successful step.\n    core.warning(`Failed to write step summary: ${(err as Error).message}`)\n  }\n}\n\nfunction inlineCodeCell(value: string): string {\n  return `${escapeHtml(value).replaceAll('|', '|')}`\n}\n\nfunction escapeHtml(value: string): string {\n  // Single-pass escape so correctness never depends on replace ordering\n  // (a chained version must escape '&' first or it would re-escape '<').\n  const map = { '&': '&', '<': '<', '>': '>' } as const\n  return value.replace(/[&<>]/g, (ch) => map[ch as keyof typeof map])\n}\n","import { realpathSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport * as core from '@actions/core'\nimport { buildClient, getBucket } from './client.ts'\nimport { copyCommand } from './commands/copy.ts'\nimport { deleteCommand } from './commands/delete.ts'\nimport { downloadCommand } from './commands/download.ts'\nimport { headCommand } from './commands/head.ts'\nimport { hideCommand } from './commands/hide.ts'\nimport { listCommand } from './commands/list.ts'\nimport { type PresignedFile, presignCommand } from './commands/presign.ts'\nimport { purgeCommand } from './commands/purge.ts'\nimport { retentionCommand } from './commands/retention.ts'\nimport { summarizeSyncErrors, syncCommand } from './commands/sync.ts'\nimport { unhideCommand } from './commands/unhide.ts'\nimport { uploadCommand } from './commands/upload.ts'\nimport { verifyCommand } from './commands/verify.ts'\nimport { classifyActionError, formatActionDebugError } from './errors.ts'\nimport { collectInputSecretsForScrubbing, type ParsedInputs, parseInputs } from './inputs.ts'\nimport { setSummaryJsonOutput } from './outputs.ts'\nimport { STEP_SUMMARY_MAX_ROWS, type SummaryRow, writeStepSummary } from './summary.ts'\n\n/**\n * Action entrypoint. Parses inputs, builds an authorized B2Client, dispatches\n * to the requested subcommand, and writes structured outputs back via\n * `core.setOutput`. Any thrown error is reported through `core.setFailed`\n * so the workflow step surfaces with a clear message and a non-zero exit.\n *\n * Each command path also publishes a `$GITHUB_STEP_SUMMARY` markdown block so\n * the run's summary page shows a per-file table without scrolling through the\n * live log.\n */\nexport async function run(): Promise {\n  // Wire workflow-cancellation signals (`SIGTERM` when the user cancels the\n  // job or a sibling fails fast; `SIGINT` for Ctrl+C in local dev) to an\n  // AbortController that long-running SDK operations subscribe to. Aborting\n  // mid-upload lets the SDK cancel in-flight multipart sessions cleanly\n  // rather than leaving them dangling for the user to pay storage on.\n  const controller = new AbortController()\n  const onSignal = (sig: NodeJS.Signals) => {\n    core.warning(`Received ${sig}; cancelling in-flight B2 operations.`)\n    controller.abort(new Error(`${sig} received`))\n  }\n  const onSigterm = () => onSignal('SIGTERM')\n  const onSigint = () => onSignal('SIGINT')\n  process.once('SIGTERM', onSigterm)\n  process.once('SIGINT', onSigint)\n  const signal = controller.signal\n  let action: ParsedInputs['action'] | undefined\n  let dryRun: boolean | undefined\n  const secretValues: string[] = []\n\n  try {\n    // These values are a defensive formatter scrub list for parser and\n    // dispatcher-scope credentials and tokens. Command-level secrets such as\n    // presigned URLs are masked at the command site with core.setSecret. Any\n    // SDK free-form B2 messages that reach failure output are sanitized in\n    // errors.ts.\n    secretValues.push(...collectInputSecretsForScrubbing())\n    const inputs = parseInputs()\n    action = inputs.action\n    dryRun = inputs.dryRun\n\n    const authorized = await buildClient({\n      applicationKeyId: inputs.applicationKeyId,\n      applicationKey: inputs.applicationKey,\n      bucket: inputs.bucket,\n      ...(inputs.endpoint !== undefined ? { endpoint: inputs.endpoint } : {}),\n    })\n    const authToken = authorized.client.accountInfo.getAuthToken()\n    if (authToken) registerSecretValue(secretValues, authToken)\n    const bucket = await getBucket(authorized)\n\n    switch (inputs.action) {\n      case 'upload': {\n        const result = await uploadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-id', first.fileId)\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-uploaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`uploaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: upload',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: 'uploaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'download': {\n        const result = await downloadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-downloaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`downloaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: download',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            sha1: f.contentSha1,\n            status: 'downloaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'sync': {\n        const result = await syncCommand(bucket, inputs, signal)\n        core.setOutput('files-uploaded', String(result.uploaded))\n        core.setOutput('files-downloaded', String(result.downloaded))\n        core.setOutput('files-deleted', String(result.deleted))\n        setFileCountOutput(result.uploaded + result.downloaded + result.deleted + result.skipped)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        setSummaryJsonOutput(result.events)\n        if (result.errors > 0) {\n          const sample = summarizeSyncErrors(result.events)\n          throw new Error(`Sync completed with ${result.errors} error(s): ${sample}`)\n        }\n        const syncTitlePrefix = inputs.dryRun\n          ? 'Backblaze B2: sync (dry-run)'\n          : 'Backblaze B2: sync'\n        await writeStepSummary({\n          title: `${syncTitlePrefix} [${result.direction}]`,\n          totals: {\n            files: result.uploaded + result.downloaded + result.deleted,\n            bytes: result.bytesTransferred,\n          },\n          rows: [\n            {\n              fileName: '(uploaded)',\n              size: result.direction === 'local-to-b2' ? result.bytesTransferred : 0,\n              status: String(result.uploaded),\n            },\n            {\n              fileName: '(downloaded)',\n              size: result.direction === 'b2-to-local' ? result.bytesTransferred : 0,\n              status: String(result.downloaded),\n            },\n            { fileName: '(removed)', status: String(result.deleted) },\n            { fileName: '(unchanged)', status: String(result.skipped) },\n          ],\n        })\n        return\n      }\n      case 'copy': {\n        const result = await copyCommand(authorized.client, bucket, inputs, signal)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.destinationFileName)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', String(result.size))\n        await writeStepSummary({\n          title: 'Backblaze B2: copy',\n          rows: [\n            {\n              fileName: `b2://${result.sourceBucket}/${result.sourceFileName} → b2://${result.destinationBucket}/${result.destinationFileName}`,\n              size: result.size,\n              fileId: result.fileId,\n              status: 'copied (server-side)',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'delete': {\n        const result = await deleteCommand(bucket, inputs, signal)\n        await emitDeletionSummary('delete', result, inputs)\n        return\n      }\n      case 'presign': {\n        const result = await presignCommand(authorized.client, bucket, inputs)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('presigned-url', first.url)\n          core.setOutput('file-name', first.fileName)\n        }\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        await writeStepSummary({\n          title: `Backblaze B2: presign (${result.files.length})`,\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            status: `expires at ${new Date(f.expiresAt * 1000).toISOString()}`,\n          })),\n        })\n        setSummaryJsonOutput(result.files, { item: presignSummaryItem })\n        return\n      }\n      case 'list': {\n        const result = await listCommand(bucket, inputs)\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        if (result.truncated) {\n          core.warning(\n            `list result truncated at max-results=${inputs.maxResults}; raise it to see more`,\n          )\n        }\n        await writeStepSummary({\n          title: `Backblaze B2: list (${result.files.length}${result.truncated ? '+' : ''})`,\n          totals: {\n            files: result.files.length,\n            bytes: result.files.reduce((s, f) => s + f.size, 0),\n          },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: f.contentType,\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'hide': {\n        const result = await hideCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: hide',\n          rows: [{ fileName: result.fileName, fileId: result.fileId, status: 'hidden' }],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'unhide': {\n        const result = await unhideCommand(bucket, inputs)\n        core.setOutput('file-name', result.fileName)\n        if (result.removedMarkerFileId !== null) {\n          core.setOutput('file-id', result.removedMarkerFileId)\n        }\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: unhide',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.removedMarkerFileId ?? undefined,\n              status: result.removedMarkerFileId === null ? 'no-op (not hidden)' : 'unhidden',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'verify': {\n        const result = await verifyCommand(bucket, inputs)\n        core.setOutput('verified', String(result.verified))\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        if (result.remoteSha1 !== null) core.setOutput('remote-sha1', result.remoteSha1)\n        if (result.localSha1 !== null) core.setOutput('local-sha1', result.localSha1)\n        await writeStepSummary({\n          title: result.verified ? 'Backblaze B2: verify ✓' : 'Backblaze B2: verify ✗',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.remoteSize,\n              sha1: result.remoteSha1,\n              status: result.verified ? 'matches' : (result.reason ?? 'mismatch'),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        if (!result.verified) {\n          throw new Error(result.reason ?? 'verify failed: SHA-1 mismatch')\n        }\n        return\n      }\n      case 'retention': {\n        const result = await retentionCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: retention',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.fileId,\n              status: retentionStatusLine(result),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'head': {\n        const result = await headCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        if (result.contentSha1 !== null) core.setOutput('content-sha1', result.contentSha1)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', '0')\n        await writeStepSummary({\n          title: 'Backblaze B2: head',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.size,\n              fileId: result.fileId,\n              sha1: result.contentSha1,\n              status: result.contentType,\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'purge': {\n        const result = await purgeCommand(bucket, inputs, signal)\n        await emitDeletionSummary('purge', result, inputs)\n        return\n      }\n    }\n  } catch (err) {\n    const failure = classifyActionError(err, {\n      ...(action !== undefined ? { action } : {}),\n      ...(dryRun !== undefined ? { dryRun } : {}),\n      secretValues,\n    })\n    core.debug(formatActionDebugError(err, { secretValues }))\n    if (failure.retryable !== undefined) core.setOutput('retryable', String(failure.retryable))\n    if (failure.retryAfter !== undefined) core.setOutput('retry-after', String(failure.retryAfter))\n    core.setFailed(failure.message)\n  } finally {\n    process.off('SIGTERM', onSigterm)\n    process.off('SIGINT', onSigint)\n  }\n}\n\n/**\n * Checks whether this module is the process entrypoint.\n *\n * @param metaUrl - The current module URL from `import.meta.url`.\n * @param argv1 - The executable script path from `process.argv[1]`.\n * @returns `true` when the current module path matches the invoked script.\n */\nexport function isEntrypoint(metaUrl: string, argv1: string | undefined): boolean {\n  if (argv1 === undefined) return false\n  try {\n    return realpathSync(fileURLToPath(metaUrl)) === realpathSync(resolve(argv1))\n  } catch {\n    return false\n  }\n}\n\n/**\n * Shared output-emission + step-summary for the two deletion verbs.\n * `delete` and `purge` returned-shape and dispatcher-side handling are\n * structurally identical (filter into actually-deleted vs would-delete,\n * set the same outputs, render the same capped row table); they differ only\n * in the verb label and the per-row status string.\n */\nasync function emitDeletionSummary(\n  verb: 'delete' | 'purge',\n  result: {\n    files: { fileName: string; fileId: string; skipped: boolean }[]\n    errors: number\n  },\n  inputs: ParsedInputs,\n): Promise {\n  const actuallyDeleted = result.files.filter((f) => !f.skipped).length\n  const wouldDelete = result.files.filter((f) => f.skipped).length\n  core.setOutput('files-deleted', String(actuallyDeleted))\n  setFileCountOutput(result.files.length)\n  setSummaryJsonOutput(result.files)\n  if (result.errors > 0) {\n    const labels = { delete: 'Delete', purge: 'Purge' } as const\n    throw new Error(`${labels[verb]} completed with ${result.errors} error(s)`)\n  }\n  const past = verb === 'delete' ? 'deleted' : 'purged'\n  const future = verb === 'delete' ? 'would delete' : 'would purge'\n  await writeStepSummary({\n    title: inputs.dryRun ? `Backblaze B2: ${verb} (dry-run)` : `Backblaze B2: ${verb}`,\n    totals: { files: actuallyDeleted + wouldDelete, bytes: 0 },\n    ...stepSummaryRows(result.files, (f) => ({\n      fileName: f.fileName,\n      fileId: f.fileId,\n      status: f.skipped ? future : past,\n    })),\n  })\n}\n\nfunction stepSummaryRows(\n  items: readonly T[],\n  row: (item: T) => SummaryRow,\n): { rows: SummaryRow[]; totalRows?: number } {\n  // Pre-slice here to avoid mapping very large result sets; writeStepSummary\n  // keeps its own defensive cap for direct callers.\n  const rows = items.slice(0, STEP_SUMMARY_MAX_ROWS).map(row)\n  return rows.length < items.length ? { rows, totalRows: items.length } : { rows }\n}\n\nfunction presignSummaryItem(file: PresignedFile): Pick {\n  return { fileName: file.fileName, expiresAt: file.expiresAt }\n}\n\nfunction setFileCountOutput(count: number): void {\n  core.setOutput('file-count', String(count))\n}\n\nfunction registerSecretValue(secretValues: string[], value: string): void {\n  const trimmed = value.trim()\n  for (const secret of [value, trimmed]) {\n    if (secret === '' || secretValues.includes(secret)) continue\n    core.setSecret(secret)\n    secretValues.push(secret)\n  }\n}\n\nfunction retentionStatusLine(result: {\n  appliedMode: 'compliance' | 'governance' | 'none' | undefined\n  retainUntilTimestamp: number | null | undefined\n  appliedLegalHold: 'on' | 'off' | undefined\n}): string {\n  const parts: string[] = [`mode=${result.appliedMode ?? '-'}`]\n  if (result.retainUntilTimestamp != null) {\n    parts.push(`until=${new Date(result.retainUntilTimestamp).toISOString()}`)\n  }\n  if (result.appliedLegalHold !== undefined) {\n    parts.push(`legal-hold=${result.appliedLegalHold}`)\n  }\n  return parts.join(' ')\n}\n\nif (isEntrypoint(import.meta.url, process.argv[1])) {\n  void run()\n}\n"],"names":[],"sourceRoot":""}
\ No newline at end of file
diff --git a/src/commands/presign.ts b/src/commands/presign.ts
index 6475a03..11ae1c6 100644
--- a/src/commands/presign.ts
+++ b/src/commands/presign.ts
@@ -1,5 +1,5 @@
 import * as core from '@actions/core'
-import type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'
+import type { B2Client, Bucket, DownloadAuthorizationRequest } from '@backblaze-labs/b2-sdk'
 import { presignGetObjectUrl } from '@backblaze-labs/b2-sdk/s3'
 import {
   appendDownloadHeaderOverrides,
@@ -68,15 +68,12 @@ async function presignPrefix(
   const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)
   // One auth token covers the whole prefix (that's exactly what
   // `b2_get_download_authorization` is designed for).
-  const auth = await client.raw.getDownloadAuthorization(
-    client.accountInfo.getApiUrl(),
-    client.accountInfo.getAuthToken(),
-    {
-      bucketId: bucket.id,
-      fileNamePrefix: prefix,
-      validDurationInSeconds: inputs.presignTtlSeconds,
-      ...downloadOverrides,
-    },
+  const auth = await getDownloadAuthorization(
+    client,
+    bucket,
+    prefix,
+    inputs.presignTtlSeconds,
+    downloadOverrides,
   )
   core.setSecret(auth.authorizationToken)
   const expiresAt = Math.floor(Date.now() / 1000) + inputs.presignTtlSeconds
@@ -126,15 +123,12 @@ async function presignOne(
   authPrefix: string,
   downloadOverrides: DownloadHeaderOverrides,
 ): Promise {
-  const auth = await client.raw.getDownloadAuthorization(
-    client.accountInfo.getApiUrl(),
-    client.accountInfo.getAuthToken(),
-    {
-      bucketId: bucket.id,
-      fileNamePrefix: authPrefix,
-      validDurationInSeconds: ttlSeconds,
-      ...downloadOverrides,
-    },
+  const auth = await getDownloadAuthorization(
+    client,
+    bucket,
+    authPrefix,
+    ttlSeconds,
+    downloadOverrides,
   )
   const downloadUrl = client.accountInfo.getDownloadUrl()
   const url = appendDownloadHeaderOverrides(
@@ -147,3 +141,24 @@ async function presignOne(
   core.info(`presigned URL for ${fileName} valid for ${ttlSeconds}s (expires at ${expiresAt})`)
   return { fileName, url, expiresAt }
 }
+
+async function getDownloadAuthorization(
+  client: B2Client,
+  bucket: Bucket,
+  fileNamePrefix: string,
+  validDurationInSeconds: number,
+  downloadOverrides: DownloadHeaderOverrides,
+) {
+  const request = {
+    bucketId: bucket.id,
+    fileNamePrefix,
+    validDurationInSeconds,
+    ...downloadOverrides,
+  } satisfies DownloadAuthorizationRequest
+
+  return await client.raw.getDownloadAuthorization(
+    client.accountInfo.getApiUrl(),
+    client.accountInfo.getAuthToken(),
+    request,
+  )
+}
diff --git a/src/download-overrides.ts b/src/download-overrides.ts
index 7985041..0f067d5 100644
--- a/src/download-overrides.ts
+++ b/src/download-overrides.ts
@@ -12,15 +12,20 @@ const DOWNLOAD_OVERRIDE_QUERY_PARAMS = {
   b2CacheControl: 'b2CacheControl',
 } as const satisfies Record
 
+const HTTP_TOKEN_RE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/
+const MAX_CONTENT_DISPOSITION_LENGTH = 1024
+const MAX_CONTENT_TYPE_LENGTH = 255
+const MAX_CACHE_CONTROL_LENGTH = 1024
+
 export function downloadHeaderOverridesFromInputs(inputs: ParsedInputs): DownloadHeaderOverrides {
+  const contentDisposition = validateContentDisposition(inputs.responseContentDisposition)
+  const contentType = validateContentType(inputs.responseContentType)
+  const cacheControl = validateCacheControl(inputs.responseCacheControl)
+
   return {
-    ...(inputs.contentDisposition !== undefined
-      ? { b2ContentDisposition: inputs.contentDisposition }
-      : {}),
-    ...(inputs.responseContentType !== undefined
-      ? { b2ContentType: inputs.responseContentType }
-      : {}),
-    ...(inputs.cacheControl !== undefined ? { b2CacheControl: inputs.cacheControl } : {}),
+    ...(contentDisposition !== undefined ? { b2ContentDisposition: contentDisposition } : {}),
+    ...(contentType !== undefined ? { b2ContentType: contentType } : {}),
+    ...(cacheControl !== undefined ? { b2CacheControl: cacheControl } : {}),
   }
 }
 
@@ -42,3 +47,151 @@ export function appendDownloadHeaderOverrides(
   }
   return parsed.toString()
 }
+
+function validateContentDisposition(value: string | undefined): string | undefined {
+  return validateHeaderValue(
+    'response-content-disposition',
+    value,
+    MAX_CONTENT_DISPOSITION_LENGTH,
+    isContentDisposition,
+    'must start with a disposition token and contain only valid parameters',
+  )
+}
+
+function validateContentType(value: string | undefined): string | undefined {
+  return validateHeaderValue(
+    'response-content-type',
+    value,
+    MAX_CONTENT_TYPE_LENGTH,
+    isContentType,
+    'must be a media type such as application/pdf, with optional valid parameters',
+  )
+}
+
+function validateCacheControl(value: string | undefined): string | undefined {
+  return validateHeaderValue(
+    'response-cache-control',
+    value,
+    MAX_CACHE_CONTROL_LENGTH,
+    isCacheControl,
+    'must contain comma-separated Cache-Control directives',
+  )
+}
+
+function validateHeaderValue(
+  inputName: string,
+  value: string | undefined,
+  maxLength: number,
+  isValidFormat: (value: string) => boolean,
+  formatDescription: string,
+): string | undefined {
+  if (value === undefined) return undefined
+  if (value.length > maxLength) {
+    throw new Error(`Invalid '${inputName}' input: must be at most ${maxLength} characters`)
+  }
+  if (containsHttpControlCharacter(value)) {
+    throw new Error(`Invalid '${inputName}' input: must not contain HTTP control characters`)
+  }
+  if (!isValidFormat(value)) {
+    throw new Error(`Invalid '${inputName}' input: ${formatDescription}`)
+  }
+  return value
+}
+
+function containsHttpControlCharacter(value: string): boolean {
+  for (let i = 0; i < value.length; i += 1) {
+    const code = value.charCodeAt(i)
+    if (code <= 0x1f || code === 0x7f) return true
+  }
+  return false
+}
+
+function isContentDisposition(value: string): boolean {
+  const parts = splitOutsideQuotes(value, ';')
+  if (parts === null || parts.length === 0 || !isHttpToken(parts[0])) return false
+  return parts.slice(1).every(isParameter)
+}
+
+function isContentType(value: string): boolean {
+  const parts = splitOutsideQuotes(value, ';')
+  if (parts === null || parts.length === 0) return false
+
+  const [type, subtype, ...extra] = parts[0]?.split('/') ?? []
+  if (extra.length > 0 || !isHttpToken(type) || !isHttpToken(subtype)) return false
+  return parts.slice(1).every(isParameter)
+}
+
+function isCacheControl(value: string): boolean {
+  const directives = splitOutsideQuotes(value, ',')
+  if (directives === null || directives.length === 0) return false
+  return directives.every((directive) => {
+    if (directive === '') return false
+    const equals = directive.indexOf('=')
+    if (equals === -1) return isHttpToken(directive)
+
+    const name = directive.slice(0, equals).trim()
+    const rawValue = directive.slice(equals + 1).trim()
+    return isHttpToken(name) && isHeaderParameterValue(rawValue)
+  })
+}
+
+function isParameter(value: string): boolean {
+  const equals = value.indexOf('=')
+  if (equals <= 0) return false
+
+  const name = value.slice(0, equals).trim()
+  const rawValue = value.slice(equals + 1).trim()
+  return isHttpToken(name) && isHeaderParameterValue(rawValue)
+}
+
+function isHeaderParameterValue(value: string): boolean {
+  return isHttpToken(value) || isQuotedString(value)
+}
+
+function isHttpToken(value: string | undefined): boolean {
+  return value !== undefined && HTTP_TOKEN_RE.test(value)
+}
+
+function isQuotedString(value: string): boolean {
+  if (value.length < 2 || !value.startsWith('"') || !value.endsWith('"')) return false
+  for (let i = 1; i < value.length - 1; i += 1) {
+    const char = value[i]
+    if (char === '"') return false
+    if (char === '\\') {
+      i += 1
+      if (i >= value.length - 1) return false
+    }
+  }
+  return true
+}
+
+function splitOutsideQuotes(value: string, separator: ';' | ','): string[] | null {
+  const parts: string[] = []
+  let start = 0
+  let quoted = false
+  let escaped = false
+
+  for (let i = 0; i < value.length; i += 1) {
+    const char = value[i]
+    if (escaped) {
+      escaped = false
+      continue
+    }
+    if (quoted && char === '\\') {
+      escaped = true
+      continue
+    }
+    if (char === '"') {
+      quoted = !quoted
+      continue
+    }
+    if (!quoted && char === separator) {
+      parts.push(value.slice(start, i).trim())
+      start = i + 1
+    }
+  }
+
+  if (quoted || escaped) return null
+  parts.push(value.slice(start).trim())
+  return parts
+}
diff --git a/src/inputs.ts b/src/inputs.ts
index 65e10ef..da2231f 100644
--- a/src/inputs.ts
+++ b/src/inputs.ts
@@ -139,11 +139,11 @@ export interface ParsedInputs {
   /** Preserve each local file's mtime as B2 `src_last_modified_millis`. */
   preserveMtime: boolean
   /** Response Content-Disposition override for `download` and `presign`. */
-  contentDisposition: string | undefined
+  responseContentDisposition: string | undefined
   /** Response Content-Type override for `download` and `presign`. */
   responseContentType: string | undefined
   /** Response Cache-Control override for `download` and `presign`. */
-  cacheControl: string | undefined
+  responseCacheControl: string | undefined
   /** Preview without executing (sync/delete/purge). */
   dryRun: boolean
   /** Permit whole-bucket purge when `source` is empty or `/`. */
@@ -247,8 +247,10 @@ export function parseInputs(): ParsedInputs {
 
   const contentType = optional('content-type')
   const contentDisposition = optional('content-disposition')
-  const responseContentType = optional('response-content-type')
   const cacheControl = optional('cache-control')
+  const responseContentDisposition = optional('response-content-disposition')
+  const responseContentType = optional('response-content-type')
+  const responseCacheControl = optional('response-cache-control')
   const endpoint = optional('endpoint')
   const sse = optional('sse')
   const encryption = parseSse(sse)
@@ -312,9 +314,9 @@ export function parseInputs(): ParsedInputs {
     contentType,
     fileInfo,
     preserveMtime,
-    contentDisposition,
+    responseContentDisposition,
     responseContentType,
-    cacheControl,
+    responseCacheControl,
     dryRun,
     allowBucketPurge,
     presignTtlSeconds,

From 127d408a9c6ec36053479fefeda98c023ab462f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= 
Date: Wed, 8 Jul 2026 18:26:16 -0500
Subject: [PATCH 3/3] chore: refresh generated bundle

---
 dist/index.js     | 18022 +++++++++++++++++++++++++++++++-------------
 dist/index.js.map |     2 +-
 2 files changed, 12804 insertions(+), 5220 deletions(-)

diff --git a/dist/index.js b/dist/index.js
index 557b32f..8ab299d 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,15 +1,15 @@
 import './sourcemap-register.cjs';import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";
 /******/ var __webpack_modules__ = ({
 
-/***/ 1410:
+/***/ 2345:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
-/* unused reexport */ __nccwpck_require__(1578);
+/* unused reexport */ __nccwpck_require__(6979);
 
 
 /***/ }),
 
-/***/ 1578:
+/***/ 6979:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 var __webpack_unused_export__;
@@ -281,34 +281,34 @@ __webpack_unused_export__ = debug; // for test
 
 /***/ }),
 
-/***/ 7253:
+/***/ 5476:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 var __webpack_unused_export__;
 
 
-const Client = __nccwpck_require__(9116)
-const Dispatcher = __nccwpck_require__(5774)
-const Pool = __nccwpck_require__(3761)
-const BalancedPool = __nccwpck_require__(1046)
-const Agent = __nccwpck_require__(7698)
-const ProxyAgent = __nccwpck_require__(2571)
-const EnvHttpProxyAgent = __nccwpck_require__(9456)
-const RetryAgent = __nccwpck_require__(6838)
-const errors = __nccwpck_require__(9270)
-const util = __nccwpck_require__(4457)
+const Client = __nccwpck_require__(7921)
+const Dispatcher = __nccwpck_require__(1815)
+const Pool = __nccwpck_require__(3848)
+const BalancedPool = __nccwpck_require__(7497)
+const Agent = __nccwpck_require__(4161)
+const ProxyAgent = __nccwpck_require__(9012)
+const EnvHttpProxyAgent = __nccwpck_require__(7077)
+const RetryAgent = __nccwpck_require__(4734)
+const errors = __nccwpck_require__(55)
+const util = __nccwpck_require__(3564)
 const { InvalidArgumentError } = errors
-const api = __nccwpck_require__(9142)
-const buildConnector = __nccwpck_require__(7135)
-const MockClient = __nccwpck_require__(1298)
-const MockAgent = __nccwpck_require__(2116)
-const MockPool = __nccwpck_require__(6495)
-const mockErrors = __nccwpck_require__(4158)
-const RetryHandler = __nccwpck_require__(397)
-const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(9098)
-const DecoratorHandler = __nccwpck_require__(9638)
-const RedirectHandler = __nccwpck_require__(1805)
-const createRedirectInterceptor = __nccwpck_require__(631)
+const api = __nccwpck_require__(8419)
+const buildConnector = __nccwpck_require__(6564)
+const MockClient = __nccwpck_require__(6009)
+const MockAgent = __nccwpck_require__(8201)
+const MockPool = __nccwpck_require__(7520)
+const mockErrors = __nccwpck_require__(7185)
+const RetryHandler = __nccwpck_require__(452)
+const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1209)
+const DecoratorHandler = __nccwpck_require__(2495)
+const RedirectHandler = __nccwpck_require__(6134)
+const createRedirectInterceptor = __nccwpck_require__(4024)
 
 Object.assign(Dispatcher.prototype, api)
 
@@ -326,10 +326,10 @@ __webpack_unused_export__ = DecoratorHandler
 __webpack_unused_export__ = RedirectHandler
 __webpack_unused_export__ = createRedirectInterceptor
 __webpack_unused_export__ = {
-  redirect: __nccwpck_require__(9113),
-  retry: __nccwpck_require__(6879),
-  dump: __nccwpck_require__(8103),
-  dns: __nccwpck_require__(6038)
+  redirect: __nccwpck_require__(9782),
+  retry: __nccwpck_require__(6158),
+  dump: __nccwpck_require__(3792),
+  dns: __nccwpck_require__(5023)
 }
 
 __webpack_unused_export__ = buildConnector
@@ -391,7 +391,7 @@ function makeDispatcher (fn) {
 __webpack_unused_export__ = setGlobalDispatcher
 __webpack_unused_export__ = getGlobalDispatcher
 
-const fetchImpl = (__nccwpck_require__(831).fetch)
+const fetchImpl = (__nccwpck_require__(90).fetch)
 __webpack_unused_export__ = async function fetch (init, options = undefined) {
   try {
     return await fetchImpl(init, options)
@@ -403,39 +403,39 @@ __webpack_unused_export__ = async function fetch (init, options = undefined) {
     throw err
   }
 }
-/* unused reexport */ __nccwpck_require__(5057).Headers
-/* unused reexport */ __nccwpck_require__(2536).Response
-/* unused reexport */ __nccwpck_require__(6454).Request
-/* unused reexport */ __nccwpck_require__(6557).FormData
+/* unused reexport */ __nccwpck_require__(32).Headers
+/* unused reexport */ __nccwpck_require__(9559).Response
+/* unused reexport */ __nccwpck_require__(3459).Request
+/* unused reexport */ __nccwpck_require__(5498).FormData
 __webpack_unused_export__ = globalThis.File ?? (__nccwpck_require__(4573).File)
-/* unused reexport */ __nccwpck_require__(5556).FileReader
+/* unused reexport */ __nccwpck_require__(6463).FileReader
 
-const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(3424)
+const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(8303)
 
 __webpack_unused_export__ = setGlobalOrigin
 __webpack_unused_export__ = getGlobalOrigin
 
-const { CacheStorage } = __nccwpck_require__(4382)
-const { kConstruct } = __nccwpck_require__(2812)
+const { CacheStorage } = __nccwpck_require__(6577)
+const { kConstruct } = __nccwpck_require__(1449)
 
 // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
 // in an older version of Node, it doesn't have any use without fetch.
 __webpack_unused_export__ = new CacheStorage(kConstruct)
 
-const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(9156)
+const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(8865)
 
 __webpack_unused_export__ = deleteCookie
 __webpack_unused_export__ = getCookies
 __webpack_unused_export__ = getSetCookies
 __webpack_unused_export__ = setCookie
 
-const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4883)
+const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(2992)
 
 __webpack_unused_export__ = parseMIMEType
 __webpack_unused_export__ = serializeAMimeType
 
-const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(2203)
-/* unused reexport */ __nccwpck_require__(7799).WebSocket
+const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(6344)
+/* unused reexport */ __nccwpck_require__(3690).WebSocket
 __webpack_unused_export__ = CloseEvent
 __webpack_unused_export__ = ErrorEvent
 __webpack_unused_export__ = MessageEvent
@@ -451,18 +451,18 @@ __webpack_unused_export__ = MockPool
 __webpack_unused_export__ = MockAgent
 __webpack_unused_export__ = mockErrors
 
-const { EventSource } = __nccwpck_require__(8207)
+const { EventSource } = __nccwpck_require__(1106)
 
 __webpack_unused_export__ = EventSource
 
 
 /***/ }),
 
-/***/ 61:
+/***/ 2810:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
-const { addAbortListener } = __nccwpck_require__(4457)
-const { RequestAbortedError } = __nccwpck_require__(9270)
+const { addAbortListener } = __nccwpck_require__(3564)
+const { RequestAbortedError } = __nccwpck_require__(55)
 
 const kListener = Symbol('kListener')
 const kSignal = Symbol('kSignal')
@@ -522,16 +522,16 @@ module.exports = {
 
 /***/ }),
 
-/***/ 9121:
+/***/ 9579:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const assert = __nccwpck_require__(4589)
-const { AsyncResource } = __nccwpck_require__(6698)
-const { InvalidArgumentError, SocketError } = __nccwpck_require__(9270)
-const util = __nccwpck_require__(4457)
-const { addSignal, removeSignal } = __nccwpck_require__(61)
+const { AsyncResource } = __nccwpck_require__(4317)
+const { InvalidArgumentError, SocketError } = __nccwpck_require__(55)
+const util = __nccwpck_require__(3564)
+const { addSignal, removeSignal } = __nccwpck_require__(2810)
 
 class ConnectHandler extends AsyncResource {
   constructor (opts, callback) {
@@ -637,7 +637,7 @@ module.exports = connect
 
 /***/ }),
 
-/***/ 3737:
+/***/ 4658:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -651,10 +651,10 @@ const {
   InvalidArgumentError,
   InvalidReturnValueError,
   RequestAbortedError
-} = __nccwpck_require__(9270)
-const util = __nccwpck_require__(4457)
-const { AsyncResource } = __nccwpck_require__(6698)
-const { addSignal, removeSignal } = __nccwpck_require__(61)
+} = __nccwpck_require__(55)
+const util = __nccwpck_require__(3564)
+const { AsyncResource } = __nccwpck_require__(4317)
+const { addSignal, removeSignal } = __nccwpck_require__(2810)
 const assert = __nccwpck_require__(4589)
 
 const kResume = Symbol('resume')
@@ -895,17 +895,17 @@ module.exports = pipeline
 
 /***/ }),
 
-/***/ 7010:
+/***/ 8295:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const assert = __nccwpck_require__(4589)
-const { Readable } = __nccwpck_require__(3468)
-const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9270)
-const util = __nccwpck_require__(4457)
-const { getResolveErrorBodyCallback } = __nccwpck_require__(3640)
-const { AsyncResource } = __nccwpck_require__(6698)
+const { Readable } = __nccwpck_require__(8547)
+const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(55)
+const util = __nccwpck_require__(3564)
+const { getResolveErrorBodyCallback } = __nccwpck_require__(8651)
+const { AsyncResource } = __nccwpck_require__(4317)
 
 class RequestHandler extends AsyncResource {
   constructor (opts, callback) {
@@ -1116,18 +1116,18 @@ module.exports.RequestHandler = RequestHandler
 
 /***/ }),
 
-/***/ 5095:
+/***/ 2596:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const assert = __nccwpck_require__(4589)
 const { finished, PassThrough } = __nccwpck_require__(7075)
-const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(9270)
-const util = __nccwpck_require__(4457)
-const { getResolveErrorBodyCallback } = __nccwpck_require__(3640)
-const { AsyncResource } = __nccwpck_require__(6698)
-const { addSignal, removeSignal } = __nccwpck_require__(61)
+const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(55)
+const util = __nccwpck_require__(3564)
+const { getResolveErrorBodyCallback } = __nccwpck_require__(8651)
+const { AsyncResource } = __nccwpck_require__(4317)
+const { addSignal, removeSignal } = __nccwpck_require__(2810)
 
 class StreamHandler extends AsyncResource {
   constructor (opts, factory, callback) {
@@ -1343,15 +1343,15 @@ module.exports = stream
 
 /***/ }),
 
-/***/ 5355:
+/***/ 9238:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { InvalidArgumentError, SocketError } = __nccwpck_require__(9270)
-const { AsyncResource } = __nccwpck_require__(6698)
-const util = __nccwpck_require__(4457)
-const { addSignal, removeSignal } = __nccwpck_require__(61)
+const { InvalidArgumentError, SocketError } = __nccwpck_require__(55)
+const { AsyncResource } = __nccwpck_require__(4317)
+const util = __nccwpck_require__(3564)
+const { addSignal, removeSignal } = __nccwpck_require__(2810)
 const assert = __nccwpck_require__(4589)
 
 class UpgradeHandler extends AsyncResource {
@@ -1458,21 +1458,21 @@ module.exports = upgrade
 
 /***/ }),
 
-/***/ 9142:
+/***/ 8419:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-module.exports.request = __nccwpck_require__(7010)
-module.exports.stream = __nccwpck_require__(5095)
-module.exports.pipeline = __nccwpck_require__(3737)
-module.exports.upgrade = __nccwpck_require__(5355)
-module.exports.connect = __nccwpck_require__(9121)
+module.exports.request = __nccwpck_require__(8295)
+module.exports.stream = __nccwpck_require__(2596)
+module.exports.pipeline = __nccwpck_require__(4658)
+module.exports.upgrade = __nccwpck_require__(9238)
+module.exports.connect = __nccwpck_require__(9579)
 
 
 /***/ }),
 
-/***/ 3468:
+/***/ 8547:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 // Ported from https://github.com/nodejs/undici/pull/907
@@ -1481,9 +1481,9 @@ module.exports.connect = __nccwpck_require__(9121)
 
 const assert = __nccwpck_require__(4589)
 const { Readable } = __nccwpck_require__(7075)
-const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(9270)
-const util = __nccwpck_require__(4457)
-const { ReadableStreamFrom } = __nccwpck_require__(4457)
+const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(55)
+const util = __nccwpck_require__(3564)
+const { ReadableStreamFrom } = __nccwpck_require__(3564)
 
 const kConsume = Symbol('kConsume')
 const kReading = Symbol('kReading')
@@ -1864,15 +1864,15 @@ module.exports = { Readable: BodyReadable, chunksDecode }
 
 /***/ }),
 
-/***/ 3640:
+/***/ 8651:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 const assert = __nccwpck_require__(4589)
 const {
   ResponseStatusCodeError
-} = __nccwpck_require__(9270)
+} = __nccwpck_require__(55)
 
-const { chunksDecode } = __nccwpck_require__(3468)
+const { chunksDecode } = __nccwpck_require__(8547)
 const CHUNK_LIMIT = 128 * 1024
 
 async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
@@ -1964,16 +1964,16 @@ module.exports = {
 
 /***/ }),
 
-/***/ 7135:
+/***/ 6564:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const net = __nccwpck_require__(7030)
 const assert = __nccwpck_require__(4589)
-const util = __nccwpck_require__(4457)
-const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(9270)
-const timers = __nccwpck_require__(4462)
+const util = __nccwpck_require__(3564)
+const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(55)
+const timers = __nccwpck_require__(303)
 
 function noop () {}
 
@@ -2211,7 +2211,7 @@ module.exports = buildConnector
 
 /***/ }),
 
-/***/ 1048:
+/***/ 6483:
 /***/ ((module) => {
 
 
@@ -2336,7 +2336,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 3677:
+/***/ 7778:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -2545,7 +2545,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 9270:
+/***/ 55:
 /***/ ((module) => {
 
 
@@ -2977,7 +2977,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 6676:
+/***/ 6315:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -2985,7 +2985,7 @@ module.exports = {
 const {
   InvalidArgumentError,
   NotSupportedError
-} = __nccwpck_require__(9270)
+} = __nccwpck_require__(55)
 const assert = __nccwpck_require__(4589)
 const {
   isValidHTTPToken,
@@ -3000,9 +3000,9 @@ const {
   validateHandler,
   getServerName,
   normalizedMethodRecords
-} = __nccwpck_require__(4457)
-const { channels } = __nccwpck_require__(3677)
-const { headerNameLowerCasedRecord } = __nccwpck_require__(1048)
+} = __nccwpck_require__(3564)
+const { channels } = __nccwpck_require__(7778)
+const { headerNameLowerCasedRecord } = __nccwpck_require__(6483)
 
 // Verifies that a given path is valid does not contain control chars \x00 to \x20
 const invalidPathRegex = /[^\u0021-\u00ff]/
@@ -3389,7 +3389,7 @@ module.exports = Request
 
 /***/ }),
 
-/***/ 1912:
+/***/ 8015:
 /***/ ((module) => {
 
 module.exports = {
@@ -3463,7 +3463,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 3153:
+/***/ 4212:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -3471,7 +3471,7 @@ module.exports = {
 const {
   wellknownHeaderNames,
   headerNameLowerCasedRecord
-} = __nccwpck_require__(1048)
+} = __nccwpck_require__(6483)
 
 class TstNode {
   /** @type {any} */
@@ -3622,13 +3622,13 @@ module.exports = {
 
 /***/ }),
 
-/***/ 4457:
+/***/ 3564:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const assert = __nccwpck_require__(4589)
-const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(1912)
+const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(8015)
 const { IncomingMessage } = __nccwpck_require__(7067)
 const stream = __nccwpck_require__(7075)
 const net = __nccwpck_require__(7030)
@@ -3636,9 +3636,9 @@ const { Blob } = __nccwpck_require__(4573)
 const nodeUtil = __nccwpck_require__(7975)
 const { stringify } = __nccwpck_require__(1792)
 const { EventEmitter: EE } = __nccwpck_require__(8474)
-const { InvalidArgumentError } = __nccwpck_require__(9270)
-const { headerNameLowerCasedRecord } = __nccwpck_require__(1048)
-const { tree } = __nccwpck_require__(3153)
+const { InvalidArgumentError } = __nccwpck_require__(55)
+const { headerNameLowerCasedRecord } = __nccwpck_require__(6483)
+const { tree } = __nccwpck_require__(4212)
 
 const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
 
@@ -4348,18 +4348,18 @@ module.exports = {
 
 /***/ }),
 
-/***/ 7698:
+/***/ 4161:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { InvalidArgumentError } = __nccwpck_require__(9270)
-const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1912)
-const DispatcherBase = __nccwpck_require__(9726)
-const Pool = __nccwpck_require__(3761)
-const Client = __nccwpck_require__(9116)
-const util = __nccwpck_require__(4457)
-const createRedirectInterceptor = __nccwpck_require__(631)
+const { InvalidArgumentError } = __nccwpck_require__(55)
+const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8015)
+const DispatcherBase = __nccwpck_require__(9661)
+const Pool = __nccwpck_require__(3848)
+const Client = __nccwpck_require__(7921)
+const util = __nccwpck_require__(3564)
+const createRedirectInterceptor = __nccwpck_require__(4024)
 
 const kOnConnect = Symbol('onConnect')
 const kOnDisconnect = Symbol('onDisconnect')
@@ -4484,7 +4484,7 @@ module.exports = Agent
 
 /***/ }),
 
-/***/ 1046:
+/***/ 7497:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -4492,7 +4492,7 @@ module.exports = Agent
 const {
   BalancedPoolMissingUpstreamError,
   InvalidArgumentError
-} = __nccwpck_require__(9270)
+} = __nccwpck_require__(55)
 const {
   PoolBase,
   kClients,
@@ -4500,10 +4500,10 @@ const {
   kAddClient,
   kRemoveClient,
   kGetDispatcher
-} = __nccwpck_require__(2347)
-const Pool = __nccwpck_require__(3761)
-const { kUrl, kInterceptors } = __nccwpck_require__(1912)
-const { parseOrigin } = __nccwpck_require__(4457)
+} = __nccwpck_require__(3164)
+const Pool = __nccwpck_require__(3848)
+const { kUrl, kInterceptors } = __nccwpck_require__(8015)
+const { parseOrigin } = __nccwpck_require__(3564)
 const kFactory = Symbol('factory')
 
 const kOptions = Symbol('options')
@@ -4700,7 +4700,7 @@ module.exports = BalancedPool
 
 /***/ }),
 
-/***/ 4858:
+/***/ 9641:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -4708,9 +4708,9 @@ module.exports = BalancedPool
 /* global WebAssembly */
 
 const assert = __nccwpck_require__(4589)
-const util = __nccwpck_require__(4457)
-const { channels } = __nccwpck_require__(3677)
-const timers = __nccwpck_require__(4462)
+const util = __nccwpck_require__(3564)
+const { channels } = __nccwpck_require__(7778)
+const timers = __nccwpck_require__(303)
 const {
   RequestContentLengthMismatchError,
   ResponseContentLengthMismatchError,
@@ -4722,7 +4722,7 @@ const {
   BodyTimeoutError,
   HTTPParserError,
   ResponseExceededMaxSizeError
-} = __nccwpck_require__(9270)
+} = __nccwpck_require__(55)
 const {
   kUrl,
   kReset,
@@ -4755,9 +4755,9 @@ const {
   kOnError,
   kResume,
   kHTTPContext
-} = __nccwpck_require__(1912)
+} = __nccwpck_require__(8015)
 
-const constants = __nccwpck_require__(3779)
+const constants = __nccwpck_require__(5052)
 const EMPTY_BUF = Buffer.alloc(0)
 const FastBuffer = Buffer[Symbol.species]
 const addListener = util.addListener
@@ -4769,11 +4769,11 @@ const kSocketUsed = Symbol('kSocketUsed')
 let extractBody
 
 async function lazyllhttp () {
-  const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1789) : undefined
+  const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(5330) : undefined
 
   let mod
   try {
-    mod = await WebAssembly.compile(__nccwpck_require__(7279))
+    mod = await WebAssembly.compile(__nccwpck_require__(2430))
   } catch (e) {
     /* istanbul ignore next */
 
@@ -4781,7 +4781,7 @@ async function lazyllhttp () {
     // being enabled, but the occurring of this other error
     // * https://github.com/emscripten-core/emscripten/issues/11495
     // got me to remove that check to avoid breaking Node 12.
-    mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(1789))
+    mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(5330))
   }
 
   return await WebAssembly.instantiate(mod, {
@@ -5689,7 +5689,7 @@ function writeH1 (client, request) {
 
   if (util.isFormDataLike(body)) {
     if (!extractBody) {
-      extractBody = (__nccwpck_require__(6831).extractBody)
+      extractBody = (__nccwpck_require__(1960).extractBody)
     }
 
     const [bodyStream, contentType] = extractBody(body)
@@ -6194,20 +6194,20 @@ module.exports = connectH1
 
 /***/ }),
 
-/***/ 5415:
+/***/ 6688:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const assert = __nccwpck_require__(4589)
 const { pipeline } = __nccwpck_require__(7075)
-const util = __nccwpck_require__(4457)
+const util = __nccwpck_require__(3564)
 const {
   RequestContentLengthMismatchError,
   RequestAbortedError,
   SocketError,
   InformationalError
-} = __nccwpck_require__(9270)
+} = __nccwpck_require__(55)
 const {
   kUrl,
   kReset,
@@ -6226,7 +6226,7 @@ const {
   kResume,
   kSize,
   kHTTPContext
-} = __nccwpck_require__(1912)
+} = __nccwpck_require__(8015)
 
 const kOpenStreams = Symbol('open streams')
 
@@ -6585,7 +6585,7 @@ function writeH2 (client, request) {
   let contentLength = util.bodyLength(body)
 
   if (util.isFormDataLike(body)) {
-    extractBody ??= (__nccwpck_require__(6831).extractBody)
+    extractBody ??= (__nccwpck_require__(1960).extractBody)
 
     const [bodyStream, contentType] = extractBody(body)
     headers['content-type'] = contentType
@@ -6945,7 +6945,7 @@ module.exports = connectH2
 
 /***/ }),
 
-/***/ 9116:
+/***/ 7921:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 // @ts-check
@@ -6955,16 +6955,16 @@ module.exports = connectH2
 const assert = __nccwpck_require__(4589)
 const net = __nccwpck_require__(7030)
 const http = __nccwpck_require__(7067)
-const util = __nccwpck_require__(4457)
-const { channels } = __nccwpck_require__(3677)
-const Request = __nccwpck_require__(6676)
-const DispatcherBase = __nccwpck_require__(9726)
+const util = __nccwpck_require__(3564)
+const { channels } = __nccwpck_require__(7778)
+const Request = __nccwpck_require__(6315)
+const DispatcherBase = __nccwpck_require__(9661)
 const {
   InvalidArgumentError,
   InformationalError,
   ClientDestroyedError
-} = __nccwpck_require__(9270)
-const buildConnector = __nccwpck_require__(7135)
+} = __nccwpck_require__(55)
+const buildConnector = __nccwpck_require__(6564)
 const {
   kUrl,
   kServerName,
@@ -7006,9 +7006,9 @@ const {
   kHTTPContext,
   kMaxConcurrentStreams,
   kResume
-} = __nccwpck_require__(1912)
-const connectH1 = __nccwpck_require__(4858)
-const connectH2 = __nccwpck_require__(5415)
+} = __nccwpck_require__(8015)
+const connectH1 = __nccwpck_require__(9641)
+const connectH2 = __nccwpck_require__(6688)
 let deprecatedInterceptorWarned = false
 
 const kClosedResolve = Symbol('kClosedResolve')
@@ -7315,7 +7315,7 @@ class Client extends DispatcherBase {
   }
 }
 
-const createRedirectInterceptor = __nccwpck_require__(631)
+const createRedirectInterceptor = __nccwpck_require__(4024)
 
 function onError (client, err) {
   if (
@@ -7575,18 +7575,18 @@ module.exports = Client
 
 /***/ }),
 
-/***/ 9726:
+/***/ 9661:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const Dispatcher = __nccwpck_require__(5774)
+const Dispatcher = __nccwpck_require__(1815)
 const {
   ClientDestroyedError,
   ClientClosedError,
   InvalidArgumentError
-} = __nccwpck_require__(9270)
-const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(1912)
+} = __nccwpck_require__(55)
+const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(8015)
 
 const kOnDestroyed = Symbol('onDestroyed')
 const kOnClosed = Symbol('onClosed')
@@ -7781,7 +7781,7 @@ module.exports = DispatcherBase
 
 /***/ }),
 
-/***/ 5774:
+/***/ 1815:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -7853,15 +7853,15 @@ module.exports = Dispatcher
 
 /***/ }),
 
-/***/ 9456:
+/***/ 7077:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const DispatcherBase = __nccwpck_require__(9726)
-const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(1912)
-const ProxyAgent = __nccwpck_require__(2571)
-const Agent = __nccwpck_require__(7698)
+const DispatcherBase = __nccwpck_require__(9661)
+const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(8015)
+const ProxyAgent = __nccwpck_require__(9012)
+const Agent = __nccwpck_require__(4161)
 
 const DEFAULT_PORTS = {
   'http:': 80,
@@ -8020,7 +8020,7 @@ module.exports = EnvHttpProxyAgent
 
 /***/ }),
 
-/***/ 8591:
+/***/ 7816:
 /***/ ((module) => {
 
 /* eslint-disable */
@@ -8144,15 +8144,15 @@ module.exports = class FixedQueue {
 
 /***/ }),
 
-/***/ 2347:
+/***/ 3164:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const DispatcherBase = __nccwpck_require__(9726)
-const FixedQueue = __nccwpck_require__(8591)
-const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(1912)
-const PoolStats = __nccwpck_require__(8327)
+const DispatcherBase = __nccwpck_require__(9661)
+const FixedQueue = __nccwpck_require__(7816)
+const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(8015)
+const PoolStats = __nccwpck_require__(6698)
 
 const kClients = Symbol('clients')
 const kNeedDrain = Symbol('needDrain')
@@ -8345,10 +8345,10 @@ module.exports = {
 
 /***/ }),
 
-/***/ 8327:
+/***/ 6698:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
-const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(1912)
+const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(8015)
 const kPool = Symbol('pool')
 
 class PoolStats {
@@ -8386,7 +8386,7 @@ module.exports = PoolStats
 
 /***/ }),
 
-/***/ 3761:
+/***/ 3848:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -8397,14 +8397,14 @@ const {
   kNeedDrain,
   kAddClient,
   kGetDispatcher
-} = __nccwpck_require__(2347)
-const Client = __nccwpck_require__(9116)
+} = __nccwpck_require__(3164)
+const Client = __nccwpck_require__(7921)
 const {
   InvalidArgumentError
-} = __nccwpck_require__(9270)
-const util = __nccwpck_require__(4457)
-const { kUrl, kInterceptors } = __nccwpck_require__(1912)
-const buildConnector = __nccwpck_require__(7135)
+} = __nccwpck_require__(55)
+const util = __nccwpck_require__(3564)
+const { kUrl, kInterceptors } = __nccwpck_require__(8015)
+const buildConnector = __nccwpck_require__(6564)
 
 const kOptions = Symbol('options')
 const kConnections = Symbol('connections')
@@ -8500,19 +8500,19 @@ module.exports = Pool
 
 /***/ }),
 
-/***/ 2571:
+/***/ 9012:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1912)
+const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8015)
 const { URL } = __nccwpck_require__(3136)
-const Agent = __nccwpck_require__(7698)
-const Pool = __nccwpck_require__(3761)
-const DispatcherBase = __nccwpck_require__(9726)
-const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(9270)
-const buildConnector = __nccwpck_require__(7135)
-const Client = __nccwpck_require__(9116)
+const Agent = __nccwpck_require__(4161)
+const Pool = __nccwpck_require__(3848)
+const DispatcherBase = __nccwpck_require__(9661)
+const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(55)
+const buildConnector = __nccwpck_require__(6564)
+const Client = __nccwpck_require__(7921)
 
 const kAgent = Symbol('proxy agent')
 const kClient = Symbol('proxy client')
@@ -8781,13 +8781,13 @@ module.exports = ProxyAgent
 
 /***/ }),
 
-/***/ 6838:
+/***/ 4734:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const Dispatcher = __nccwpck_require__(5774)
-const RetryHandler = __nccwpck_require__(397)
+const Dispatcher = __nccwpck_require__(1815)
+const RetryHandler = __nccwpck_require__(452)
 
 class RetryAgent extends Dispatcher {
   #agent = null
@@ -8823,7 +8823,7 @@ module.exports = RetryAgent
 
 /***/ }),
 
-/***/ 9098:
+/***/ 1209:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -8831,8 +8831,8 @@ module.exports = RetryAgent
 // We include a version number for the Dispatcher API. In case of breaking changes,
 // this version number must be increased to avoid conflicts.
 const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
-const { InvalidArgumentError } = __nccwpck_require__(9270)
-const Agent = __nccwpck_require__(7698)
+const { InvalidArgumentError } = __nccwpck_require__(55)
+const Agent = __nccwpck_require__(4161)
 
 if (getGlobalDispatcher() === undefined) {
   setGlobalDispatcher(new Agent())
@@ -8862,7 +8862,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 9638:
+/***/ 2495:
 /***/ ((module) => {
 
 
@@ -8913,15 +8913,15 @@ module.exports = class DecoratorHandler {
 
 /***/ }),
 
-/***/ 1805:
+/***/ 6134:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const util = __nccwpck_require__(4457)
-const { kBodyUsed } = __nccwpck_require__(1912)
+const util = __nccwpck_require__(3564)
+const { kBodyUsed } = __nccwpck_require__(8015)
 const assert = __nccwpck_require__(4589)
-const { InvalidArgumentError } = __nccwpck_require__(9270)
+const { InvalidArgumentError } = __nccwpck_require__(55)
 const EE = __nccwpck_require__(8474)
 
 const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
@@ -9152,20 +9152,20 @@ module.exports = RedirectHandler
 
 /***/ }),
 
-/***/ 397:
+/***/ 452:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 const assert = __nccwpck_require__(4589)
 
-const { kRetryHandlerDefaultRetry } = __nccwpck_require__(1912)
-const { RequestRetryError } = __nccwpck_require__(9270)
+const { kRetryHandlerDefaultRetry } = __nccwpck_require__(8015)
+const { RequestRetryError } = __nccwpck_require__(55)
 const {
   isDisturbed,
   parseHeaders,
   parseRangeHeader,
   wrapRequestBody
-} = __nccwpck_require__(4457)
+} = __nccwpck_require__(3564)
 
 function calculateRetryAfterHeader (retryAfter) {
   const current = Date.now()
@@ -9533,14 +9533,14 @@ module.exports = RetryHandler
 
 /***/ }),
 
-/***/ 6038:
+/***/ 5023:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 const { isIP } = __nccwpck_require__(7030)
 const { lookup } = __nccwpck_require__(610)
-const DecoratorHandler = __nccwpck_require__(9638)
-const { InvalidArgumentError, InformationalError } = __nccwpck_require__(9270)
+const DecoratorHandler = __nccwpck_require__(2495)
+const { InvalidArgumentError, InformationalError } = __nccwpck_require__(55)
 const maxInt = Math.pow(2, 31) - 1
 
 class DNSInstance {
@@ -9915,14 +9915,14 @@ module.exports = interceptorOpts => {
 
 /***/ }),
 
-/***/ 8103:
+/***/ 3792:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const util = __nccwpck_require__(4457)
-const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9270)
-const DecoratorHandler = __nccwpck_require__(9638)
+const util = __nccwpck_require__(3564)
+const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(55)
+const DecoratorHandler = __nccwpck_require__(2495)
 
 class DumpHandler extends DecoratorHandler {
   #maxSize = 1024 * 1024
@@ -10045,12 +10045,12 @@ module.exports = createDumpInterceptor
 
 /***/ }),
 
-/***/ 631:
+/***/ 4024:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const RedirectHandler = __nccwpck_require__(1805)
+const RedirectHandler = __nccwpck_require__(6134)
 
 function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
   return (dispatch) => {
@@ -10073,11 +10073,11 @@ module.exports = createRedirectInterceptor
 
 /***/ }),
 
-/***/ 9113:
+/***/ 9782:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
-const RedirectHandler = __nccwpck_require__(1805)
+const RedirectHandler = __nccwpck_require__(6134)
 
 module.exports = opts => {
   const globalMaxRedirections = opts?.maxRedirections
@@ -10104,11 +10104,11 @@ module.exports = opts => {
 
 /***/ }),
 
-/***/ 6879:
+/***/ 6158:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
-const RetryHandler = __nccwpck_require__(397)
+const RetryHandler = __nccwpck_require__(452)
 
 module.exports = globalOpts => {
   return dispatch => {
@@ -10130,13 +10130,13 @@ module.exports = globalOpts => {
 
 /***/ }),
 
-/***/ 3779:
+/***/ 5052:
 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
 
 
 Object.defineProperty(exports, "__esModule", ({ value: true }));
 exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
-const utils_1 = __nccwpck_require__(4579);
+const utils_1 = __nccwpck_require__(480);
 // C headers
 var ERROR;
 (function (ERROR) {
@@ -10414,7 +10414,7 @@ exports.SPECIAL_HEADERS = {
 
 /***/ }),
 
-/***/ 1789:
+/***/ 5330:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -10426,7 +10426,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3
 
 /***/ }),
 
-/***/ 7279:
+/***/ 2430:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -10438,7 +10438,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3
 
 /***/ }),
 
-/***/ 4579:
+/***/ 480:
 /***/ ((__unused_webpack_module, exports) => {
 
 
@@ -10459,13 +10459,13 @@ exports.enumToMap = enumToMap;
 
 /***/ }),
 
-/***/ 2116:
+/***/ 8201:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { kClients } = __nccwpck_require__(1912)
-const Agent = __nccwpck_require__(7698)
+const { kClients } = __nccwpck_require__(8015)
+const Agent = __nccwpck_require__(4161)
 const {
   kAgent,
   kMockAgentSet,
@@ -10476,14 +10476,14 @@ const {
   kGetNetConnect,
   kOptions,
   kFactory
-} = __nccwpck_require__(1024)
-const MockClient = __nccwpck_require__(1298)
-const MockPool = __nccwpck_require__(6495)
-const { matchValue, buildMockOptions } = __nccwpck_require__(6948)
-const { InvalidArgumentError, UndiciError } = __nccwpck_require__(9270)
-const Dispatcher = __nccwpck_require__(5774)
-const Pluralizer = __nccwpck_require__(9556)
-const PendingInterceptorsFormatter = __nccwpck_require__(1651)
+} = __nccwpck_require__(8305)
+const MockClient = __nccwpck_require__(6009)
+const MockPool = __nccwpck_require__(7520)
+const { matchValue, buildMockOptions } = __nccwpck_require__(4521)
+const { InvalidArgumentError, UndiciError } = __nccwpck_require__(55)
+const Dispatcher = __nccwpck_require__(1815)
+const Pluralizer = __nccwpck_require__(2269)
+const PendingInterceptorsFormatter = __nccwpck_require__(5290)
 
 class MockAgent extends Dispatcher {
   constructor (opts) {
@@ -10626,14 +10626,14 @@ module.exports = MockAgent
 
 /***/ }),
 
-/***/ 1298:
+/***/ 6009:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const { promisify } = __nccwpck_require__(7975)
-const Client = __nccwpck_require__(9116)
-const { buildMockDispatch } = __nccwpck_require__(6948)
+const Client = __nccwpck_require__(7921)
+const { buildMockDispatch } = __nccwpck_require__(4521)
 const {
   kDispatches,
   kMockAgent,
@@ -10642,10 +10642,10 @@ const {
   kOrigin,
   kOriginalDispatch,
   kConnected
-} = __nccwpck_require__(1024)
-const { MockInterceptor } = __nccwpck_require__(8222)
-const Symbols = __nccwpck_require__(1912)
-const { InvalidArgumentError } = __nccwpck_require__(9270)
+} = __nccwpck_require__(8305)
+const { MockInterceptor } = __nccwpck_require__(8579)
+const Symbols = __nccwpck_require__(8015)
+const { InvalidArgumentError } = __nccwpck_require__(55)
 
 /**
  * MockClient provides an API that extends the Client to influence the mockDispatches.
@@ -10692,12 +10692,12 @@ module.exports = MockClient
 
 /***/ }),
 
-/***/ 4158:
+/***/ 7185:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { UndiciError } = __nccwpck_require__(9270)
+const { UndiciError } = __nccwpck_require__(55)
 
 const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')
 
@@ -10727,12 +10727,12 @@ module.exports = {
 
 /***/ }),
 
-/***/ 8222:
+/***/ 8579:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(6948)
+const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(4521)
 const {
   kDispatches,
   kDispatchKey,
@@ -10740,9 +10740,9 @@ const {
   kDefaultTrailers,
   kContentLength,
   kMockDispatch
-} = __nccwpck_require__(1024)
-const { InvalidArgumentError } = __nccwpck_require__(9270)
-const { buildURL } = __nccwpck_require__(4457)
+} = __nccwpck_require__(8305)
+const { InvalidArgumentError } = __nccwpck_require__(55)
+const { buildURL } = __nccwpck_require__(3564)
 
 /**
  * Defines the scope API for an interceptor reply
@@ -10941,14 +10941,14 @@ module.exports.MockScope = MockScope
 
 /***/ }),
 
-/***/ 6495:
+/***/ 7520:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const { promisify } = __nccwpck_require__(7975)
-const Pool = __nccwpck_require__(3761)
-const { buildMockDispatch } = __nccwpck_require__(6948)
+const Pool = __nccwpck_require__(3848)
+const { buildMockDispatch } = __nccwpck_require__(4521)
 const {
   kDispatches,
   kMockAgent,
@@ -10957,10 +10957,10 @@ const {
   kOrigin,
   kOriginalDispatch,
   kConnected
-} = __nccwpck_require__(1024)
-const { MockInterceptor } = __nccwpck_require__(8222)
-const Symbols = __nccwpck_require__(1912)
-const { InvalidArgumentError } = __nccwpck_require__(9270)
+} = __nccwpck_require__(8305)
+const { MockInterceptor } = __nccwpck_require__(8579)
+const Symbols = __nccwpck_require__(8015)
+const { InvalidArgumentError } = __nccwpck_require__(55)
 
 /**
  * MockPool provides an API that extends the Pool to influence the mockDispatches.
@@ -11007,7 +11007,7 @@ module.exports = MockPool
 
 /***/ }),
 
-/***/ 1024:
+/***/ 8305:
 /***/ ((module) => {
 
 
@@ -11037,20 +11037,20 @@ module.exports = {
 
 /***/ }),
 
-/***/ 6948:
+/***/ 4521:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { MockNotMatchedError } = __nccwpck_require__(4158)
+const { MockNotMatchedError } = __nccwpck_require__(7185)
 const {
   kDispatches,
   kMockAgent,
   kOriginalDispatch,
   kOrigin,
   kGetNetConnect
-} = __nccwpck_require__(1024)
-const { buildURL } = __nccwpck_require__(4457)
+} = __nccwpck_require__(8305)
+const { buildURL } = __nccwpck_require__(3564)
 const { STATUS_CODES } = __nccwpck_require__(7067)
 const {
   types: {
@@ -11411,7 +11411,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 1651:
+/***/ 5290:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -11461,7 +11461,7 @@ module.exports = class PendingInterceptorsFormatter {
 
 /***/ }),
 
-/***/ 9556:
+/***/ 2269:
 /***/ ((module) => {
 
 
@@ -11497,7 +11497,7 @@ module.exports = class Pluralizer {
 
 /***/ }),
 
-/***/ 4462:
+/***/ 303:
 /***/ ((module) => {
 
 
@@ -11927,20 +11927,20 @@ module.exports = {
 
 /***/ }),
 
-/***/ 1939:
+/***/ 2542:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { kConstruct } = __nccwpck_require__(2812)
-const { urlEquals, getFieldValues } = __nccwpck_require__(2453)
-const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(4457)
-const { webidl } = __nccwpck_require__(6709)
-const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(2536)
-const { Request, fromInnerRequest } = __nccwpck_require__(6454)
-const { kState } = __nccwpck_require__(2082)
-const { fetching } = __nccwpck_require__(831)
-const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(5535)
+const { kConstruct } = __nccwpck_require__(1449)
+const { urlEquals, getFieldValues } = __nccwpck_require__(2)
+const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3564)
+const { webidl } = __nccwpck_require__(9057)
+const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(9559)
+const { Request, fromInnerRequest } = __nccwpck_require__(3459)
+const { kState } = __nccwpck_require__(327)
+const { fetching } = __nccwpck_require__(90)
+const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(8116)
 const assert = __nccwpck_require__(4589)
 
 /**
@@ -12793,15 +12793,15 @@ module.exports = {
 
 /***/ }),
 
-/***/ 4382:
+/***/ 6577:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { kConstruct } = __nccwpck_require__(2812)
-const { Cache } = __nccwpck_require__(1939)
-const { webidl } = __nccwpck_require__(6709)
-const { kEnumerableProperty } = __nccwpck_require__(4457)
+const { kConstruct } = __nccwpck_require__(1449)
+const { Cache } = __nccwpck_require__(2542)
+const { webidl } = __nccwpck_require__(9057)
+const { kEnumerableProperty } = __nccwpck_require__(3564)
 
 class CacheStorage {
   /**
@@ -12952,26 +12952,26 @@ module.exports = {
 
 /***/ }),
 
-/***/ 2812:
+/***/ 1449:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 module.exports = {
-  kConstruct: (__nccwpck_require__(1912).kConstruct)
+  kConstruct: (__nccwpck_require__(8015).kConstruct)
 }
 
 
 /***/ }),
 
-/***/ 2453:
+/***/ 2:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const assert = __nccwpck_require__(4589)
-const { URLSerializer } = __nccwpck_require__(4883)
-const { isValidHeaderName } = __nccwpck_require__(5535)
+const { URLSerializer } = __nccwpck_require__(2992)
+const { isValidHeaderName } = __nccwpck_require__(8116)
 
 /**
  * @see https://url.spec.whatwg.org/#concept-url-equals
@@ -13016,7 +13016,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 8841:
+/***/ 4488:
 /***/ ((module) => {
 
 
@@ -13035,15 +13035,15 @@ module.exports = {
 
 /***/ }),
 
-/***/ 9156:
+/***/ 8865:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { parseSetCookie } = __nccwpck_require__(6583)
-const { stringify } = __nccwpck_require__(1542)
-const { webidl } = __nccwpck_require__(6709)
-const { Headers } = __nccwpck_require__(5057)
+const { parseSetCookie } = __nccwpck_require__(6806)
+const { stringify } = __nccwpck_require__(7033)
+const { webidl } = __nccwpck_require__(9057)
+const { Headers } = __nccwpck_require__(32)
 
 /**
  * @typedef {Object} Cookie
@@ -13226,14 +13226,14 @@ module.exports = {
 
 /***/ }),
 
-/***/ 6583:
+/***/ 6806:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(8841)
-const { isCTLExcludingHtab } = __nccwpck_require__(1542)
-const { collectASequenceOfCodePointsFast } = __nccwpck_require__(4883)
+const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(4488)
+const { isCTLExcludingHtab } = __nccwpck_require__(7033)
+const { collectASequenceOfCodePointsFast } = __nccwpck_require__(2992)
 const assert = __nccwpck_require__(4589)
 
 /**
@@ -13543,7 +13543,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 1542:
+/***/ 7033:
 /***/ ((module) => {
 
 
@@ -13832,12 +13832,12 @@ module.exports = {
 
 /***/ }),
 
-/***/ 2892:
+/***/ 8083:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 const { Transform } = __nccwpck_require__(7075)
-const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(5872)
+const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(5799)
 
 /**
  * @type {number[]} BOM
@@ -14237,22 +14237,22 @@ module.exports = {
 
 /***/ }),
 
-/***/ 8207:
+/***/ 1106:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const { pipeline } = __nccwpck_require__(7075)
-const { fetching } = __nccwpck_require__(831)
-const { makeRequest } = __nccwpck_require__(6454)
-const { webidl } = __nccwpck_require__(6709)
-const { EventSourceStream } = __nccwpck_require__(2892)
-const { parseMIMEType } = __nccwpck_require__(4883)
-const { createFastMessageEvent } = __nccwpck_require__(2203)
-const { isNetworkError } = __nccwpck_require__(2536)
-const { delay } = __nccwpck_require__(5872)
-const { kEnumerableProperty } = __nccwpck_require__(4457)
-const { environmentSettingsObject } = __nccwpck_require__(5535)
+const { fetching } = __nccwpck_require__(90)
+const { makeRequest } = __nccwpck_require__(3459)
+const { webidl } = __nccwpck_require__(9057)
+const { EventSourceStream } = __nccwpck_require__(8083)
+const { parseMIMEType } = __nccwpck_require__(2992)
+const { createFastMessageEvent } = __nccwpck_require__(6344)
+const { isNetworkError } = __nccwpck_require__(9559)
+const { delay } = __nccwpck_require__(5799)
+const { kEnumerableProperty } = __nccwpck_require__(3564)
+const { environmentSettingsObject } = __nccwpck_require__(8116)
 
 let experimentalWarned = false
 
@@ -14724,7 +14724,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 5872:
+/***/ 5799:
 /***/ ((module) => {
 
 
@@ -14768,12 +14768,12 @@ module.exports = {
 
 /***/ }),
 
-/***/ 6831:
+/***/ 1960:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const util = __nccwpck_require__(4457)
+const util = __nccwpck_require__(3564)
 const {
   ReadableStreamFrom,
   isBlobLike,
@@ -14783,16 +14783,16 @@ const {
   fullyReadBody,
   extractMimeType,
   utf8DecodeBytes
-} = __nccwpck_require__(5535)
-const { FormData } = __nccwpck_require__(6557)
-const { kState } = __nccwpck_require__(2082)
-const { webidl } = __nccwpck_require__(6709)
+} = __nccwpck_require__(8116)
+const { FormData } = __nccwpck_require__(5498)
+const { kState } = __nccwpck_require__(327)
+const { webidl } = __nccwpck_require__(9057)
 const { Blob } = __nccwpck_require__(4573)
 const assert = __nccwpck_require__(4589)
 const { isErrored, isDisturbed } = __nccwpck_require__(7075)
 const { isArrayBuffer } = __nccwpck_require__(3429)
-const { serializeAMimeType } = __nccwpck_require__(4883)
-const { multipartFormDataParser } = __nccwpck_require__(9301)
+const { serializeAMimeType } = __nccwpck_require__(2992)
+const { multipartFormDataParser } = __nccwpck_require__(9424)
 let random
 
 try {
@@ -15304,7 +15304,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 578:
+/***/ 4123:
 /***/ ((module) => {
 
 
@@ -15435,7 +15435,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 4883:
+/***/ 2992:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -16186,12 +16186,12 @@ module.exports = {
 
 /***/ }),
 
-/***/ 7434:
+/***/ 4057:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { kConnected, kSize } = __nccwpck_require__(1912)
+const { kConnected, kSize } = __nccwpck_require__(8015)
 
 class CompatWeakRef {
   constructor (value) {
@@ -16239,14 +16239,14 @@ module.exports = function () {
 
 /***/ }),
 
-/***/ 9261:
+/***/ 3358:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const { Blob, File } = __nccwpck_require__(4573)
-const { kState } = __nccwpck_require__(2082)
-const { webidl } = __nccwpck_require__(6709)
+const { kState } = __nccwpck_require__(327)
+const { webidl } = __nccwpck_require__(9057)
 
 // TODO(@KhafraDev): remove
 class FileLike {
@@ -16372,16 +16372,16 @@ module.exports = { FileLike, isFileLike }
 
 /***/ }),
 
-/***/ 9301:
+/***/ 9424:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(4457)
-const { utf8DecodeBytes } = __nccwpck_require__(5535)
-const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(4883)
-const { isFileLike } = __nccwpck_require__(9261)
-const { makeEntry } = __nccwpck_require__(6557)
+const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(3564)
+const { utf8DecodeBytes } = __nccwpck_require__(8116)
+const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(2992)
+const { isFileLike } = __nccwpck_require__(3358)
+const { makeEntry } = __nccwpck_require__(5498)
 const assert = __nccwpck_require__(4589)
 const { File: NodeFile } = __nccwpck_require__(4573)
 
@@ -16853,16 +16853,16 @@ module.exports = {
 
 /***/ }),
 
-/***/ 6557:
+/***/ 5498:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { isBlobLike, iteratorMixin } = __nccwpck_require__(5535)
-const { kState } = __nccwpck_require__(2082)
-const { kEnumerableProperty } = __nccwpck_require__(4457)
-const { FileLike, isFileLike } = __nccwpck_require__(9261)
-const { webidl } = __nccwpck_require__(6709)
+const { isBlobLike, iteratorMixin } = __nccwpck_require__(8116)
+const { kState } = __nccwpck_require__(327)
+const { kEnumerableProperty } = __nccwpck_require__(3564)
+const { FileLike, isFileLike } = __nccwpck_require__(3358)
+const { webidl } = __nccwpck_require__(9057)
 const { File: NativeFile } = __nccwpck_require__(4573)
 const nodeUtil = __nccwpck_require__(7975)
 
@@ -17112,7 +17112,7 @@ module.exports = { FormData, makeEntry }
 
 /***/ }),
 
-/***/ 3424:
+/***/ 8303:
 /***/ ((module) => {
 
 
@@ -17159,21 +17159,21 @@ module.exports = {
 
 /***/ }),
 
-/***/ 5057:
+/***/ 32:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 // https://github.com/Ethan-Arrowood/undici-fetch
 
 
 
-const { kConstruct } = __nccwpck_require__(1912)
-const { kEnumerableProperty } = __nccwpck_require__(4457)
+const { kConstruct } = __nccwpck_require__(8015)
+const { kEnumerableProperty } = __nccwpck_require__(3564)
 const {
   iteratorMixin,
   isValidHeaderName,
   isValidHeaderValue
-} = __nccwpck_require__(5535)
-const { webidl } = __nccwpck_require__(6709)
+} = __nccwpck_require__(8116)
+const { webidl } = __nccwpck_require__(9057)
 const assert = __nccwpck_require__(4589)
 const util = __nccwpck_require__(7975)
 
@@ -17853,7 +17853,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 831:
+/***/ 90:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 // https://github.com/Ethan-Arrowood/undici-fetch
@@ -17866,9 +17866,9 @@ const {
   filterResponse,
   makeResponse,
   fromInnerResponse
-} = __nccwpck_require__(2536)
-const { HeadersList } = __nccwpck_require__(5057)
-const { Request, cloneRequest } = __nccwpck_require__(6454)
+} = __nccwpck_require__(9559)
+const { HeadersList } = __nccwpck_require__(32)
+const { Request, cloneRequest } = __nccwpck_require__(3459)
 const zlib = __nccwpck_require__(8522)
 const {
   bytesMatch,
@@ -17904,23 +17904,23 @@ const {
   buildContentRange,
   createInflate,
   extractMimeType
-} = __nccwpck_require__(5535)
-const { kState, kDispatcher } = __nccwpck_require__(2082)
+} = __nccwpck_require__(8116)
+const { kState, kDispatcher } = __nccwpck_require__(327)
 const assert = __nccwpck_require__(4589)
-const { safelyExtractBody, extractBody } = __nccwpck_require__(6831)
+const { safelyExtractBody, extractBody } = __nccwpck_require__(1960)
 const {
   redirectStatusSet,
   nullBodyStatus,
   safeMethodsSet,
   requestBodyHeader,
   subresourceSet
-} = __nccwpck_require__(578)
+} = __nccwpck_require__(4123)
 const EE = __nccwpck_require__(8474)
 const { Readable, pipeline, finished } = __nccwpck_require__(7075)
-const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(4457)
-const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(4883)
-const { getGlobalDispatcher } = __nccwpck_require__(9098)
-const { webidl } = __nccwpck_require__(6709)
+const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(3564)
+const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(2992)
+const { getGlobalDispatcher } = __nccwpck_require__(1209)
+const { webidl } = __nccwpck_require__(9057)
 const { STATUS_CODES } = __nccwpck_require__(7067)
 const GET_OR_HEAD = ['GET', 'HEAD']
 
@@ -20132,23 +20132,23 @@ module.exports = {
 
 /***/ }),
 
-/***/ 6454:
+/***/ 3459:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 /* globals AbortController */
 
 
 
-const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(6831)
-const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(5057)
-const { FinalizationRegistry } = __nccwpck_require__(7434)()
-const util = __nccwpck_require__(4457)
+const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(1960)
+const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(32)
+const { FinalizationRegistry } = __nccwpck_require__(4057)()
+const util = __nccwpck_require__(3564)
 const nodeUtil = __nccwpck_require__(7975)
 const {
   isValidHTTPToken,
   sameOrigin,
   environmentSettingsObject
-} = __nccwpck_require__(5535)
+} = __nccwpck_require__(8116)
 const {
   forbiddenMethodsSet,
   corsSafeListedMethodsSet,
@@ -20158,12 +20158,12 @@ const {
   requestCredentials,
   requestCache,
   requestDuplex
-} = __nccwpck_require__(578)
+} = __nccwpck_require__(4123)
 const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util
-const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(2082)
-const { webidl } = __nccwpck_require__(6709)
-const { URLSerializer } = __nccwpck_require__(4883)
-const { kConstruct } = __nccwpck_require__(1912)
+const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(327)
+const { webidl } = __nccwpck_require__(9057)
+const { URLSerializer } = __nccwpck_require__(2992)
+const { kConstruct } = __nccwpck_require__(8015)
 const assert = __nccwpck_require__(4589)
 const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(8474)
 
@@ -21176,14 +21176,14 @@ module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }
 
 /***/ }),
 
-/***/ 2536:
+/***/ 9559:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(5057)
-const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(6831)
-const util = __nccwpck_require__(4457)
+const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(32)
+const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(1960)
+const util = __nccwpck_require__(3564)
 const nodeUtil = __nccwpck_require__(7975)
 const { kEnumerableProperty } = util
 const {
@@ -21195,16 +21195,16 @@ const {
   isErrorLike,
   isomorphicEncode,
   environmentSettingsObject: relevantRealm
-} = __nccwpck_require__(5535)
+} = __nccwpck_require__(8116)
 const {
   redirectStatusSet,
   nullBodyStatus
-} = __nccwpck_require__(578)
-const { kState, kHeaders } = __nccwpck_require__(2082)
-const { webidl } = __nccwpck_require__(6709)
-const { FormData } = __nccwpck_require__(6557)
-const { URLSerializer } = __nccwpck_require__(4883)
-const { kConstruct } = __nccwpck_require__(1912)
+} = __nccwpck_require__(4123)
+const { kState, kHeaders } = __nccwpck_require__(327)
+const { webidl } = __nccwpck_require__(9057)
+const { FormData } = __nccwpck_require__(5498)
+const { URLSerializer } = __nccwpck_require__(2992)
+const { kConstruct } = __nccwpck_require__(8015)
 const assert = __nccwpck_require__(4589)
 const { types } = __nccwpck_require__(7975)
 
@@ -21793,7 +21793,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 2082:
+/***/ 327:
 /***/ ((module) => {
 
 
@@ -21809,21 +21809,21 @@ module.exports = {
 
 /***/ }),
 
-/***/ 5535:
+/***/ 8116:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const { Transform } = __nccwpck_require__(7075)
 const zlib = __nccwpck_require__(8522)
-const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(578)
-const { getGlobalOrigin } = __nccwpck_require__(3424)
-const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(4883)
+const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(4123)
+const { getGlobalOrigin } = __nccwpck_require__(8303)
+const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(2992)
 const { performance } = __nccwpck_require__(643)
-const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(4457)
+const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(3564)
 const assert = __nccwpck_require__(4589)
 const { isUint8Array } = __nccwpck_require__(3429)
-const { webidl } = __nccwpck_require__(6709)
+const { webidl } = __nccwpck_require__(9057)
 
 let supportedHashes = []
 
@@ -23448,14 +23448,14 @@ module.exports = {
 
 /***/ }),
 
-/***/ 6709:
+/***/ 9057:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const { types, inspect } = __nccwpck_require__(7975)
 const { markAsUncloneable } = __nccwpck_require__(5919)
-const { toUSVString } = __nccwpck_require__(4457)
+const { toUSVString } = __nccwpck_require__(3564)
 
 /** @type {import('../../../types/webidl').Webidl} */
 const webidl = {}
@@ -24150,7 +24150,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 4560:
+/***/ 3707:
 /***/ ((module) => {
 
 
@@ -24447,7 +24447,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 5556:
+/***/ 6463:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -24456,16 +24456,16 @@ const {
   staticPropertyDescriptors,
   readOperation,
   fireAProgressEvent
-} = __nccwpck_require__(5665)
+} = __nccwpck_require__(686)
 const {
   kState,
   kError,
   kResult,
   kEvents,
   kAborted
-} = __nccwpck_require__(1184)
-const { webidl } = __nccwpck_require__(6709)
-const { kEnumerableProperty } = __nccwpck_require__(4457)
+} = __nccwpck_require__(2429)
+const { webidl } = __nccwpck_require__(9057)
+const { kEnumerableProperty } = __nccwpck_require__(3564)
 
 class FileReader extends EventTarget {
   constructor () {
@@ -24798,12 +24798,12 @@ module.exports = {
 
 /***/ }),
 
-/***/ 1044:
+/***/ 9617:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { webidl } = __nccwpck_require__(6709)
+const { webidl } = __nccwpck_require__(9057)
 
 const kState = Symbol('ProgressEvent state')
 
@@ -24883,7 +24883,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 1184:
+/***/ 2429:
 /***/ ((module) => {
 
 
@@ -24900,7 +24900,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 5665:
+/***/ 686:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
@@ -24911,10 +24911,10 @@ const {
   kResult,
   kAborted,
   kLastProgressEventFired
-} = __nccwpck_require__(1184)
-const { ProgressEvent } = __nccwpck_require__(1044)
-const { getEncoding } = __nccwpck_require__(4560)
-const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(4883)
+} = __nccwpck_require__(2429)
+const { ProgressEvent } = __nccwpck_require__(9617)
+const { getEncoding } = __nccwpck_require__(3707)
+const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(2992)
 const { types } = __nccwpck_require__(7975)
 const { StringDecoder } = __nccwpck_require__(3193)
 const { btoa } = __nccwpck_require__(4573)
@@ -25298,27 +25298,27 @@ module.exports = {
 
 /***/ }),
 
-/***/ 2882:
+/***/ 8341:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(541)
+const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(7916)
 const {
   kReadyState,
   kSentClose,
   kByteParser,
   kReceivedClose,
   kResponse
-} = __nccwpck_require__(7193)
-const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(5122)
-const { channels } = __nccwpck_require__(3677)
-const { CloseEvent } = __nccwpck_require__(2203)
-const { makeRequest } = __nccwpck_require__(6454)
-const { fetching } = __nccwpck_require__(831)
-const { Headers, getHeadersList } = __nccwpck_require__(5057)
-const { getDecodeSplit } = __nccwpck_require__(5535)
-const { WebsocketFrameSend } = __nccwpck_require__(1481)
+} = __nccwpck_require__(2060)
+const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(6437)
+const { channels } = __nccwpck_require__(7778)
+const { CloseEvent } = __nccwpck_require__(6344)
+const { makeRequest } = __nccwpck_require__(3459)
+const { fetching } = __nccwpck_require__(90)
+const { Headers, getHeadersList } = __nccwpck_require__(32)
+const { getDecodeSplit } = __nccwpck_require__(8116)
+const { WebsocketFrameSend } = __nccwpck_require__(8332)
 
 /** @type {import('crypto')} */
 let crypto
@@ -25676,7 +25676,7 @@ module.exports = {
 
 /***/ }),
 
-/***/ 541:
+/***/ 7916:
 /***/ ((module) => {
 
 
@@ -25749,14 +25749,14 @@ module.exports = {
 
 /***/ }),
 
-/***/ 2203:
+/***/ 6344:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { webidl } = __nccwpck_require__(6709)
-const { kEnumerableProperty } = __nccwpck_require__(4457)
-const { kConstruct } = __nccwpck_require__(1912)
+const { webidl } = __nccwpck_require__(9057)
+const { kEnumerableProperty } = __nccwpck_require__(3564)
+const { kConstruct } = __nccwpck_require__(8015)
 const { MessagePort } = __nccwpck_require__(5919)
 
 /**
@@ -26085,12 +26085,12 @@ module.exports = {
 
 /***/ }),
 
-/***/ 1481:
+/***/ 8332:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { maxUnsigned16Bit } = __nccwpck_require__(541)
+const { maxUnsigned16Bit } = __nccwpck_require__(7916)
 
 const BUFFER_SIZE = 16386
 
@@ -26188,14 +26188,14 @@ module.exports = {
 
 /***/ }),
 
-/***/ 6190:
+/***/ 617:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __nccwpck_require__(8522)
-const { isValidClientWindowBits } = __nccwpck_require__(5122)
-const { MessageSizeExceededError } = __nccwpck_require__(9270)
+const { isValidClientWindowBits } = __nccwpck_require__(6437)
+const { MessageSizeExceededError } = __nccwpck_require__(55)
 
 const tail = Buffer.from([0x00, 0x00, 0xff, 0xff])
 const kBuffer = Symbol('kBuffer')
@@ -26295,16 +26295,16 @@ module.exports = { PerMessageDeflate }
 
 /***/ }),
 
-/***/ 8359:
+/***/ 8368:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
 const { Writable } = __nccwpck_require__(7075)
 const assert = __nccwpck_require__(4589)
-const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(541)
-const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7193)
-const { channels } = __nccwpck_require__(3677)
+const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(7916)
+const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(2060)
+const { channels } = __nccwpck_require__(7778)
 const {
   isValidStatusCode,
   isValidOpcode,
@@ -26314,11 +26314,11 @@ const {
   isControlFrame,
   isTextBinaryFrame,
   isContinuationFrame
-} = __nccwpck_require__(5122)
-const { WebsocketFrameSend } = __nccwpck_require__(1481)
-const { closeWebSocketConnection } = __nccwpck_require__(2882)
-const { PerMessageDeflate } = __nccwpck_require__(6190)
-const { MessageSizeExceededError } = __nccwpck_require__(9270)
+} = __nccwpck_require__(6437)
+const { WebsocketFrameSend } = __nccwpck_require__(8332)
+const { closeWebSocketConnection } = __nccwpck_require__(8341)
+const { PerMessageDeflate } = __nccwpck_require__(617)
+const { MessageSizeExceededError } = __nccwpck_require__(55)
 
 function failWebsocketConnectionWithCode (ws, code, reason) {
   closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason))
@@ -26815,14 +26815,14 @@ module.exports = {
 
 /***/ }),
 
-/***/ 8323:
+/***/ 8184:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { WebsocketFrameSend } = __nccwpck_require__(1481)
-const { opcodes, sendHints } = __nccwpck_require__(541)
-const FixedQueue = __nccwpck_require__(8591)
+const { WebsocketFrameSend } = __nccwpck_require__(8332)
+const { opcodes, sendHints } = __nccwpck_require__(7916)
+const FixedQueue = __nccwpck_require__(7816)
 
 /** @type {typeof Uint8Array} */
 const FastBuffer = Buffer[Symbol.species]
@@ -26926,7 +26926,7 @@ module.exports = { SendQueue }
 
 /***/ }),
 
-/***/ 7193:
+/***/ 2060:
 /***/ ((module) => {
 
 
@@ -26945,16 +26945,16 @@ module.exports = {
 
 /***/ }),
 
-/***/ 5122:
+/***/ 6437:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7193)
-const { states, opcodes } = __nccwpck_require__(541)
-const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(2203)
+const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(2060)
+const { states, opcodes } = __nccwpck_require__(7916)
+const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(6344)
 const { isUtf8 } = __nccwpck_require__(4573)
-const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(4883)
+const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(2992)
 
 /* globals Blob */
 
@@ -27274,15 +27274,15 @@ module.exports = {
 
 /***/ }),
 
-/***/ 7799:
+/***/ 3690:
 /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
 
 
-const { webidl } = __nccwpck_require__(6709)
-const { URLSerializer } = __nccwpck_require__(4883)
-const { environmentSettingsObject } = __nccwpck_require__(5535)
-const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(541)
+const { webidl } = __nccwpck_require__(9057)
+const { URLSerializer } = __nccwpck_require__(2992)
+const { environmentSettingsObject } = __nccwpck_require__(8116)
+const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(7916)
 const {
   kWebSocketURL,
   kReadyState,
@@ -27291,21 +27291,21 @@ const {
   kResponse,
   kSentClose,
   kByteParser
-} = __nccwpck_require__(7193)
+} = __nccwpck_require__(2060)
 const {
   isConnecting,
   isEstablished,
   isClosing,
   isValidSubprotocol,
   fireEvent
-} = __nccwpck_require__(5122)
-const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(2882)
-const { ByteParser } = __nccwpck_require__(8359)
-const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(4457)
-const { getGlobalDispatcher } = __nccwpck_require__(9098)
+} = __nccwpck_require__(6437)
+const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(8341)
+const { ByteParser } = __nccwpck_require__(8368)
+const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3564)
+const { getGlobalDispatcher } = __nccwpck_require__(1209)
 const { types } = __nccwpck_require__(7975)
-const { ErrorEvent, CloseEvent } = __nccwpck_require__(2203)
-const { SendQueue } = __nccwpck_require__(8323)
+const { ErrorEvent, CloseEvent } = __nccwpck_require__(6344)
+const { SendQueue } = __nccwpck_require__(8184)
 
 // https://websockets.spec.whatwg.org/#interface-definition
 class WebSocket extends EventTarget {
@@ -27918,7 +27918,7 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:assert"
 
 /***/ }),
 
-/***/ 6698:
+/***/ 4317:
 /***/ ((module) => {
 
 module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:async_hooks");
@@ -27967,6 +27967,13 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events"
 
 /***/ }),
 
+/***/ 3024:
+/***/ ((module) => {
+
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
+
+/***/ }),
+
 /***/ 1455:
 /***/ ((module) => {
 
@@ -28190,8 +28197,8 @@ __nccwpck_require__.d(__webpack_exports__, {
   e: () => (/* binding */ run)
 });
 
-;// CONCATENATED MODULE: external "node:fs"
-const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
+// EXTERNAL MODULE: external "node:fs"
+var external_node_fs_ = __nccwpck_require__(3024);
 // EXTERNAL MODULE: external "node:path"
 var external_node_path_ = __nccwpck_require__(6760);
 // EXTERNAL MODULE: external "node:url"
@@ -28463,9 +28470,9 @@ class DecodedURL extends URL {
 }
 //# sourceMappingURL=proxy.js.map
 // EXTERNAL MODULE: ./node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js
-var node_modules_tunnel = __nccwpck_require__(1410);
+var node_modules_tunnel = __nccwpck_require__(2345);
 // EXTERNAL MODULE: ./node_modules/.pnpm/undici@6.27.0/node_modules/undici/index.js
-var undici = __nccwpck_require__(7253);
+var undici = __nccwpck_require__(5476);
 ;// CONCATENATED MODULE: ./node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/index.js
 /* eslint-disable @typescript-eslint/no-explicit-any */
 var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -31141,999 +31148,4000 @@ function getIDToken(aud) {
  */
 
 //# sourceMappingURL=core.js.map
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/upload-url-pool.js
-class UploadUrlPool {
-  /** Map from key (bucket ID or file ID) to a stack of available entries. */
-  pools = /* @__PURE__ */ new Map();
-  /**
-   * Take an upload URL from the pool, or return null if none are available.
-   *
-   * @param key - The bucket ID or file ID to look up.
-   *
-   * @returns An upload URL entry, or null if the pool is empty for the given key.
-   */
-  checkout(key) {
-    const pool = this.pools.get(key);
-    if (!pool || pool.length === 0) return null;
-    return pool.pop() ?? null;
-  }
-  /**
-   * Return a still-valid upload URL to the pool for future reuse.
-   *
-   * @param key - The bucket ID or file ID the entry belongs to.
-   * @param entry - The upload URL entry to return to the pool.
-   */
-  checkin(key, entry) {
-    let pool = this.pools.get(key);
-    if (!pool) {
-      pool = [];
-      this.pools.set(key, pool);
-    }
-    pool.push(entry);
-  }
-  /**
-   * Remove a specific upload URL from the pool (e.g. after an upload error).
-   *
-   * @param key - The bucket ID or file ID the entry belongs to.
-   * @param entry - The failed upload URL entry to remove.
-   */
-  evict(key, entry) {
-    const pool = this.pools.get(key);
-    if (!pool) return;
-    const idx = pool.findIndex((e) => e.uploadUrl === entry.uploadUrl);
-    if (idx !== -1) {
-      pool.splice(idx, 1);
-    }
-  }
-  /** Remove all entries from every key in the pool. */
-  clear() {
-    this.pools.clear();
-  }
-}
-
-//# sourceMappingURL=upload-url-pool.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/in-memory.js
-
-class InMemoryAccountInfo {
-  /** Cached authorization response, or null before authorize() is called. */
-  auth = null;
-  /** Pool of reusable small-file upload URLs, keyed by bucket ID. */
-  uploadUrls = new UploadUrlPool();
-  /** Pool of reusable large-file part upload URLs, keyed by file ID. */
-  partUploadUrls = new UploadUrlPool();
-  /**
-   * Store a fresh authorization response, replacing any previous state.
-   *
-   * @param auth - The authorize account response to store.
-   */
-  setAuth(auth) {
-    this.auth = auth;
-    this.uploadUrls.clear();
-    this.partUploadUrls.clear();
-  }
-  /**
-   * Return the current authorization response, or null if not authorized.
-   *
-   * @returns The cached authorization response, or null if not yet authorized.
-   */
-  getAuth() {
-    return this.auth;
-  }
-  /** Discard all cached authorization state and upload URLs. */
-  clear() {
-    this.auth = null;
-    this.uploadUrls.clear();
-    this.partUploadUrls.clear();
-  }
-  /**
-   * Base URL for B2 API calls.
-   *
-   * @returns The base URL for B2 API calls.
-   *
-   * @throws Error if not yet authorized.
-   */
-  getApiUrl() {
-    return this.requireAuth().apiInfo.storageApi.apiUrl;
-  }
-  /**
-   * Base URL for file downloads.
-   *
-   * @returns The base URL for file downloads.
-   *
-   * @throws Error if not yet authorized.
-   */
-  getDownloadUrl() {
-    return this.requireAuth().apiInfo.storageApi.downloadUrl;
-  }
-  /**
-   * Current authorization token.
-   *
-   * @returns The current authorization token.
-   *
-   * @throws Error if not yet authorized.
-   */
-  getAuthToken() {
-    return this.requireAuth().authorizationToken;
-  }
-  /**
-   * The authorized account ID.
-   *
-   * @returns The authorized account identifier.
-   *
-   * @throws Error if not yet authorized.
-   */
-  getAccountId() {
-    return this.requireAuth().accountId;
-  }
-  /**
-   * Server-recommended part size for large file uploads, in bytes.
-   *
-   * @returns The server-recommended part size in bytes.
-   *
-   * @throws Error if not yet authorized.
-   */
-  getRecommendedPartSize() {
-    return this.requireAuth().apiInfo.storageApi.recommendedPartSize;
-  }
-  /**
-   * Smallest allowed part size for large file uploads, in bytes.
-   *
-   * @returns The smallest allowed part size in bytes.
-   *
-   * @throws Error if not yet authorized.
-   */
-  getAbsoluteMinimumPartSize() {
-    return this.requireAuth().apiInfo.storageApi.absoluteMinimumPartSize;
-  }
-  /**
-   * Base URL for the S3-compatible API.
-   *
-   * @returns The base URL for the S3-compatible API.
-   *
-   * @throws Error if not yet authorized.
-   */
-  getS3ApiUrl() {
-    return this.requireAuth().apiInfo.storageApi.s3ApiUrl;
-  }
-  /**
-   * Bucket ID the key is restricted to, or null if unrestricted.
-   *
-   * @returns The restricted bucket identifier, or null if the key is unrestricted.
-   *
-   * @throws Error if not yet authorized.
-   */
-  getAllowedBucketId() {
-    return this.requireAuth().apiInfo.storageApi.allowed.bucketId ?? null;
-  }
-  /**
-   * Take an upload URL from the pool for the given bucket, or null if none available.
-   *
-   * @param bucketId - The bucket to check out an upload URL for.
-   *
-   * @returns A reusable upload URL entry, or null if none are available.
-   */
-  checkoutUploadUrl(bucketId) {
-    return this.uploadUrls.checkout(bucketId);
-  }
-  /**
-   * Return a still-valid upload URL to the pool for reuse.
-   *
-   * @param bucketId - The bucket the upload URL belongs to.
-   * @param entry - The upload URL entry to return to the pool.
-   */
-  returnUploadUrl(bucketId, entry) {
-    this.uploadUrls.checkin(bucketId, entry);
-  }
-  /**
-   * Remove an upload URL from the pool after an upload error.
-   *
-   * @param bucketId - The bucket the failed upload URL belongs to.
-   * @param entry - The upload URL entry to remove from the pool.
-   */
-  evictUploadUrl(bucketId, entry) {
-    this.uploadUrls.evict(bucketId, entry);
-  }
-  /**
-   * Take a large-file part upload URL from the pool, or null if none available.
-   *
-   * @param fileId - The large file to check out a part upload URL for.
-   *
-   * @returns A reusable part upload URL entry, or null if none are available.
-   */
-  checkoutPartUploadUrl(fileId) {
-    return this.partUploadUrls.checkout(fileId);
-  }
-  /**
-   * Return a still-valid part upload URL to the pool for reuse.
-   *
-   * @param fileId - The large file the part upload URL belongs to.
-   * @param entry - The part upload URL entry to return to the pool.
-   */
-  returnPartUploadUrl(fileId, entry) {
-    this.partUploadUrls.checkin(fileId, entry);
-  }
-  /**
-   * Remove a part upload URL from the pool after an error.
-   *
-   * @param fileId - The large file the failed part upload URL belongs to.
-   * @param entry - The part upload URL entry to remove from the pool.
-   */
-  evictPartUploadUrl(fileId, entry) {
-    this.partUploadUrls.evict(fileId, entry);
-  }
-  /**
-   * Retrieve the cached auth response or throw if not yet authorized.
-   *
-   * @returns The cached authorization response.
-   *
-   * @throws Error if authorize() has not been called.
-   */
-  requireAuth() {
-    if (!this.auth) throw new Error("Not authorized. Call authorize() first.");
-    return this.auth;
-  }
-}
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/upload-url-pool.js
+//#region src/auth/upload-url-pool.ts
+/**
+* Manages a pool of reusable upload URLs keyed by bucket ID or file ID.
+* URLs are checked out before an upload, checked back in on success, and
+* evicted on error so they are not reused.
+*/
+var UploadUrlPool = class {
+	/** Map from key (bucket ID or file ID) to a stack of available entries. */
+	pools = /* @__PURE__ */ new Map();
+	/**
+	* Take an upload URL from the pool, or return null if none are available.
+	*
+	* @param key - The bucket ID or file ID to look up.
+	*
+	* @returns An upload URL entry, or null if the pool is empty for the given key.
+	*/
+	checkout(key) {
+		const pool = this.pools.get(key);
+		if (!pool || pool.length === 0) return null;
+		return pool.pop() ?? null;
+	}
+	/**
+	* Return a still-valid upload URL to the pool for future reuse.
+	*
+	* @param key - The bucket ID or file ID the entry belongs to.
+	* @param entry - The upload URL entry to return to the pool.
+	*/
+	checkin(key, entry) {
+		let pool = this.pools.get(key);
+		if (!pool) {
+			pool = [];
+			this.pools.set(key, pool);
+		}
+		pool.push(entry);
+	}
+	/**
+	* Remove a specific upload URL from the pool (e.g. after an upload error).
+	*
+	* @param key - The bucket ID or file ID the entry belongs to.
+	* @param entry - The failed upload URL entry to remove.
+	*/
+	evict(key, entry) {
+		const pool = this.pools.get(key);
+		if (!pool) return;
+		const idx = pool.findIndex((e) => e.uploadUrl === entry.uploadUrl);
+		if (idx !== -1) pool.splice(idx, 1);
+	}
+	/** Remove all entries from every key in the pool. */
+	clear() {
+		this.pools.clear();
+	}
+};
+//#endregion
 
-//# sourceMappingURL=in-memory.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/realms.js
-const REALM_URLS = {
-  production: "https://api.backblazeb2.com",
-  staging: "https://api.backblazeb2.com"
+//# sourceMappingURL=upload-url-pool.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/in-memory.js
+
+//#region src/auth/in-memory.ts
+/**
+* In-memory implementation of {@link AccountInfo}.
+* Stores the authorization response and upload URL pools in plain object fields.
+* Suitable for short-lived processes or tests; state is lost when the process exits.
+*/
+var InMemoryAccountInfo = class {
+	/** Cached authorization response, or null before authorize() is called. */
+	auth = null;
+	/** Pool of reusable small-file upload URLs, keyed by bucket ID. */
+	uploadUrls = new UploadUrlPool();
+	/** Pool of reusable large-file part upload URLs, keyed by file ID. */
+	partUploadUrls = new UploadUrlPool();
+	/**
+	* Store a fresh authorization response, replacing any previous state.
+	*
+	* @param auth - The authorize account response to store.
+	*/
+	setAuth(auth) {
+		this.auth = auth;
+		this.uploadUrls.clear();
+		this.partUploadUrls.clear();
+	}
+	/**
+	* Return the current authorization response, or null if not authorized.
+	*
+	* @returns The cached authorization response, or null if not yet authorized.
+	*/
+	getAuth() {
+		return this.auth;
+	}
+	/** Discard all cached authorization state and upload URLs. */
+	clear() {
+		this.auth = null;
+		this.uploadUrls.clear();
+		this.partUploadUrls.clear();
+	}
+	/**
+	* Base URL for B2 API calls.
+	*
+	* @returns The base URL for B2 API calls.
+	*
+	* @throws Error if not yet authorized.
+	*/
+	getApiUrl() {
+		return this.requireAuth().apiInfo.storageApi.apiUrl;
+	}
+	/**
+	* Base URL for file downloads.
+	*
+	* @returns The base URL for file downloads.
+	*
+	* @throws Error if not yet authorized.
+	*/
+	getDownloadUrl() {
+		return this.requireAuth().apiInfo.storageApi.downloadUrl;
+	}
+	/**
+	* Current authorization token.
+	*
+	* @returns The current authorization token.
+	*
+	* @throws Error if not yet authorized.
+	*/
+	getAuthToken() {
+		return this.requireAuth().authorizationToken;
+	}
+	/**
+	* The authorized account ID.
+	*
+	* @returns The authorized account identifier.
+	*
+	* @throws Error if not yet authorized.
+	*/
+	getAccountId() {
+		return this.requireAuth().accountId;
+	}
+	/**
+	* Server-recommended part size for large file uploads, in bytes.
+	*
+	* @returns The server-recommended part size in bytes.
+	*
+	* @throws Error if not yet authorized.
+	*/
+	getRecommendedPartSize() {
+		return this.requireAuth().apiInfo.storageApi.recommendedPartSize;
+	}
+	/**
+	* Smallest allowed part size for large file uploads, in bytes.
+	*
+	* @returns The smallest allowed part size in bytes.
+	*
+	* @throws Error if not yet authorized.
+	*/
+	getAbsoluteMinimumPartSize() {
+		return this.requireAuth().apiInfo.storageApi.absoluteMinimumPartSize;
+	}
+	/**
+	* Base URL for the S3-compatible API.
+	*
+	* @returns The base URL for the S3-compatible API.
+	*
+	* @throws Error if not yet authorized.
+	*/
+	getS3ApiUrl() {
+		return this.requireAuth().apiInfo.storageApi.s3ApiUrl;
+	}
+	/**
+	* Bucket ID the key is restricted to, or null if unrestricted.
+	*
+	* @returns The restricted bucket identifier, or null if the key is unrestricted.
+	*
+	* @throws Error if not yet authorized.
+	*/
+	getAllowedBucketId() {
+		const allowed = this.requireAuth().apiInfo.storageApi.allowed;
+		const buckets = allowed.buckets;
+		if (buckets === void 0) return allowed.bucketId ?? null;
+		if (buckets !== null) {
+			if (buckets.length !== 1) throw new Error("Authorized key is not restricted to exactly one bucket; use getAllowedBucketIds()");
+			return buckets[0]?.id ?? null;
+		}
+		return null;
+	}
+	/**
+	* Bucket IDs the key is restricted to, or null if unrestricted.
+	*
+	* @returns The restricted bucket identifiers, or null if the key is unrestricted.
+	*
+	* @throws Error if not yet authorized.
+	*/
+	getAllowedBucketIds() {
+		const allowed = this.requireAuth().apiInfo.storageApi.allowed;
+		const buckets = allowed.buckets;
+		if (buckets === void 0) {
+			const legacyBucketId = allowed.bucketId ?? null;
+			return legacyBucketId === null ? null : [legacyBucketId];
+		}
+		return buckets === null ? null : buckets.map((bucket) => bucket.id);
+	}
+	/**
+	* Take an upload URL from the pool for the given bucket, or null if none available.
+	*
+	* @param bucketId - The bucket to check out an upload URL for.
+	*
+	* @returns A reusable upload URL entry, or null if none are available.
+	*/
+	checkoutUploadUrl(bucketId) {
+		return this.uploadUrls.checkout(bucketId);
+	}
+	/**
+	* Return a still-valid upload URL to the pool for reuse.
+	*
+	* @param bucketId - The bucket the upload URL belongs to.
+	* @param entry - The upload URL entry to return to the pool.
+	*/
+	returnUploadUrl(bucketId, entry) {
+		this.uploadUrls.checkin(bucketId, entry);
+	}
+	/**
+	* Remove an upload URL from the pool after an upload error.
+	*
+	* @param bucketId - The bucket the failed upload URL belongs to.
+	* @param entry - The upload URL entry to remove from the pool.
+	*/
+	evictUploadUrl(bucketId, entry) {
+		this.uploadUrls.evict(bucketId, entry);
+	}
+	/**
+	* Take a large-file part upload URL from the pool, or null if none available.
+	*
+	* @param fileId - The large file to check out a part upload URL for.
+	*
+	* @returns A reusable part upload URL entry, or null if none are available.
+	*/
+	checkoutPartUploadUrl(fileId) {
+		return this.partUploadUrls.checkout(fileId);
+	}
+	/**
+	* Return a still-valid part upload URL to the pool for reuse.
+	*
+	* @param fileId - The large file the part upload URL belongs to.
+	* @param entry - The part upload URL entry to return to the pool.
+	*/
+	returnPartUploadUrl(fileId, entry) {
+		this.partUploadUrls.checkin(fileId, entry);
+	}
+	/**
+	* Remove a part upload URL from the pool after an error.
+	*
+	* @param fileId - The large file the failed part upload URL belongs to.
+	* @param entry - The part upload URL entry to remove from the pool.
+	*/
+	evictPartUploadUrl(fileId, entry) {
+		this.partUploadUrls.evict(fileId, entry);
+	}
+	/**
+	* Retrieve the cached auth response or throw if not yet authorized.
+	*
+	* @returns The cached authorization response.
+	*
+	* @throws Error if authorize() has not been called.
+	*/
+	requireAuth() {
+		if (!this.auth) throw new Error("Not authorized. Call authorize() first.");
+		return this.auth;
+	}
 };
-function getRealmUrl(realm) {
-  return REALM_URLS[realm] ?? realm;
-}
+//#endregion
 
-//# sourceMappingURL=realms.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/ids.js
+//# sourceMappingURL=in-memory.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/ids.js
+//#region src/types/ids.ts
+/**
+* Creates a branded {@link AccountId} from a raw string.
+* @param raw - The raw account ID string from the B2 API.
+*
+* @returns A branded AccountId value.
+*/
 function accountId(raw) {
-  return raw;
+	return raw;
 }
+/**
+* Creates a branded {@link BucketId} from a raw string.
+* @param raw - The raw bucket ID string from the B2 API.
+*
+* @returns A branded BucketId value.
+*/
 function bucketId(raw) {
-  return raw;
+	return raw;
 }
+/**
+* Creates a branded {@link FileId} from a raw string.
+* @param raw - The raw file ID string from the B2 API.
+*
+* @returns A branded FileId value.
+*/
 function fileId(raw) {
-  return raw;
+	return raw;
 }
+/**
+* Creates a branded {@link KeyId} from a raw string.
+* @param raw - The raw key ID string from the B2 API.
+*
+* @returns A branded KeyId value.
+*/
 function keyId(raw) {
-  return raw;
+	return raw;
 }
+/**
+* Creates a branded {@link ApplicationKeyId} from a raw string.
+* @param raw - The raw application key ID string from the B2 API.
+*
+* @returns A branded ApplicationKeyId value.
+*/
 function applicationKeyId(raw) {
-  return raw;
-}
+	return raw;
+}
+/**
+* Creates a branded {@link LargeFileId} from a raw string.
+*
+* `LargeFileId` is the same wire-level shape as `FileId` but is a
+* distinct brand so that "ID of an in-progress multipart upload" and
+* "ID of a committed file version" don't get mixed up by accident.
+* `b2_start_large_file` returns one; `b2_finish_large_file` consumes it
+* and produces a regular `FileId`.
+*
+* @param raw - The raw large-file ID string from the B2 API.
+*
+* @returns A branded LargeFileId value.
+*/
 function largeFileId(raw) {
-  return raw;
+	return raw;
 }
+//#endregion
+
 
 //# sourceMappingURL=ids.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/retry.js
+//#region src/http/retry.ts
+/** Default retry settings: 5 retries, 1s initial delay, 64s max delay, 15 minute timeout. */
+var DEFAULT_RETRY_OPTIONS = {
+	maxRetries: 5,
+	maxRetryDelayMs: 64e3,
+	initialRetryDelayMs: 1e3,
+	requestTimeoutMs: 15 * 6e4
+};
+/**
+* Computes the delay before the next retry using exponential backoff with jitter.
+* If a `Retry-After` value is provided by the server, it takes precedence over
+* the calculated backoff (still capped at {@link RetryOptions.maxRetryDelayMs}).
+*
+* @param attempt - Zero-based retry attempt index.
+* @param options - Retry configuration with delay bounds.
+* @param retryAfter - Server-provided retry delay in seconds, if any.
+*
+* @returns The delay in milliseconds before the next retry attempt.
+*/
+function computeBackoff(attempt, options, retryAfter) {
+	if (retryAfter !== void 0 && retryAfter > 0) return Math.min(retryAfter * 1e3, options.maxRetryDelayMs);
+	const base = options.initialRetryDelayMs * 2 ** attempt;
+	const jitter = Math.random() * base * .5;
+	return Math.min(base + jitter, options.maxRetryDelayMs);
+}
+/**
+* Returns a promise that resolves after the given delay. Supports cancellation
+* via an optional AbortSignal.
+*
+* @param ms - Delay in milliseconds.
+* @param signal - Optional abort signal to cancel the sleep early.
+*
+* @returns A promise that resolves when the delay elapses or rejects if aborted.
+*/
+function sleep(ms, signal) {
+	return new Promise((resolve, reject) => {
+		if (signal?.aborted) {
+			reject(signal.reason ?? new DOMException("Aborted", "AbortError"));
+			return;
+		}
+		const timer = setTimeout(resolve, ms);
+		signal?.addEventListener("abort", () => {
+			clearTimeout(timer);
+			reject(signal.reason ?? new DOMException("Aborted", "AbortError"));
+		}, { once: true });
+	});
+}
+//#endregion
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/best-effort.js
-async function bestEffort(fn) {
-  try {
-    await fn();
-  } catch {
-  }
+
+//# sourceMappingURL=retry.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/paginator.js
+//#region src/util/paginator.ts
+/**
+* Async-iterates one page at a time. Stops when `fetcher` returns
+* `nextCursor: undefined`.
+*
+* @typeParam Page - The per-page response shape.
+* @typeParam Cursor - The cursor type used to request the next page.
+*
+* @param fetcher - Function that fetches one page given the current cursor.
+* @param signal - Optional abort signal. Checked before each fetch.
+*
+* @returns An async iterable of pages.
+*
+* @throws DOMException When `signal` is aborted between fetches.
+*
+* @example
+* ```ts
+* for await (const page of paginatePages(
+*   async (cursor) => {
+*     const resp = await bucket.listFileNames({ startFileName: cursor })
+*     return { page: resp, nextCursor: resp.nextFileName ?? undefined }
+*   },
+*   abortSignal,
+* )) {
+*   for (const file of page.files) { ... }
+* }
+* ```
+*/
+async function* paginatePages(fetcher, signal) {
+	let cursor;
+	while (true) {
+		signal?.throwIfAborted();
+		const { page, nextCursor } = await fetcher(cursor);
+		yield page;
+		if (nextCursor === void 0) return;
+		cursor = nextCursor;
+	}
+}
+/**
+* Async-iterates items by flattening pages. The `extractItems` function
+* pulls the relevant array out of each page (e.g. `page.files`,
+* `page.keys`, `page.parts`). Each item is yielded individually so the
+* caller can `for await (const item of paginator)` rather than nest loops.
+*
+* Aborts between **pages**, not between items: if `signal` is aborted while
+* the caller is processing the items of page N, the iterator will still
+* yield all of page N's remaining items before checking the signal before
+* fetching page N+1.
+*
+* @typeParam Page - The per-page response shape.
+* @typeParam Cursor - The cursor type used to request the next page.
+* @typeParam Item - The item type the caller wants to iterate.
+*
+* @param fetcher - Function that fetches one page given the current cursor.
+* @param extractItems - Pulls the iterable items out of a page.
+* @param signal - Optional abort signal. Checked before each fetch.
+*
+* @returns An async iterable of individual items.
+*
+* @throws DOMException When `signal` is aborted between fetches.
+*/
+async function* paginateItems(fetcher, extractItems, signal) {
+	for await (const page of paginatePages(fetcher, signal)) yield* extractItems(page);
 }
+//#endregion
 
-//# sourceMappingURL=best-effort.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/cancel.js
+//# sourceMappingURL=paginator.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/concurrency.js
+//#region src/upload/concurrency.ts
+/**
+* Bounded concurrency primitive.
+*
+* Limits the number of concurrent operations to a fixed maximum. Callers
+* {@link acquire} a slot before starting work and {@link release} it when done.
+* If all slots are taken, `acquire` returns a promise that resolves when a slot
+* becomes available.
+*/
+var Semaphore = class {
+	limit;
+	current = 0;
+	queue = [];
+	/**
+	* @param limit - Maximum number of concurrent acquisitions. Must be a
+	*   positive integer; values `<= 0` would create a semaphore that
+	*   never lets anything through (all `acquire()` calls would queue
+	*   forever), so the constructor throws fast instead.
+	*
+	* @throws `RangeError` when `limit` is not a positive integer.
+	*/
+	constructor(limit) {
+		this.limit = limit;
+		if (!Number.isInteger(limit) || limit <= 0) throw new RangeError(`Semaphore limit must be a positive integer; received ${limit}. A non-positive limit produces a deadlocked semaphore — fail fast at construction instead.`);
+	}
+	/**
+	* Acquires a slot, waiting if the limit has been reached.
+	* @returns A promise that resolves when a slot is available.
+	*/
+	async acquire() {
+		if (this.current < this.limit) {
+			this.current++;
+			return;
+		}
+		return new Promise((resolve) => {
+			this.queue.push(resolve);
+		});
+	}
+	/** Releases a slot, unblocking the next queued caller if any. */
+	release() {
+		const next = this.queue.shift();
+		if (next) next();
+		else this.current--;
+	}
+	/**
+	* Number of slots currently available.
+	*
+	* @returns The count of free concurrency slots.
+	*/
+	get available() {
+		return this.limit - this.current;
+	}
+};
+/**
+* Maps over an array with bounded concurrency.
+*
+* @param items - Input items to process.
+* @param concurrency - Maximum number of items processed in parallel.
+* @param fn - Async function applied to each item.
+*
+* @returns Results in the same order as the input items.
+*/
+async function mapConcurrent(items, concurrency, fn) {
+	const sem = new Semaphore(concurrency);
+	const results = new Array(items.length);
+	const tasks = items.map(async (item, i) => {
+		await sem.acquire();
+		try {
+			results[i] = await fn(item, i);
+		} finally {
+			sem.release();
+		}
+	});
+	await Promise.all(tasks);
+	return results;
+}
+//#endregion
 
-async function cancelLargeFileBestEffort(raw, accountInfo, fileId) {
-  await bestEffort(
-    () => raw.cancelLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId })
-  );
-}
 
-//# sourceMappingURL=cancel.js.map
+//# sourceMappingURL=concurrency.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/file.js
+//#region src/types/file.ts
+/**
+* Named constants for the action that created a file version.
+*
+* @example
+* ```ts
+* if (file.action === FileAction.Hide) { ... }
+* ```
+*/
+var FileAction = {
+	/** Large file upload started but not yet finished. */
+	Start: "start",
+	/** Normal upload (small or finished large file). */
+	Upload: "upload",
+	/** Hide marker (soft delete). */
+	Hide: "hide",
+	/** Virtual folder marker. */
+	Folder: "folder",
+	/** Created via server-side copy. */
+	Copy: "copy"
+};
+/**
+* Named constants for how metadata is handled during a file copy.
+*
+* @example
+* ```ts
+* await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })
+* ```
+*/
+var MetadataDirective = {
+	/** Preserve the source file's contentType and fileInfo. */
+	Copy: "COPY",
+	/** Use the values provided in the copy request. */
+	Replace: "REPLACE"
+};
+//#endregion
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/concurrency.js
-class Semaphore {
-  /**
-   * @param limit - Maximum number of concurrent acquisitions. Must be a
-   *   positive integer; values `<= 0` would create a semaphore that
-   *   never lets anything through (all `acquire()` calls would queue
-   *   forever), so the constructor throws fast instead.
-   *
-   * @throws `RangeError` when `limit` is not a positive integer.
-   */
-  constructor(limit) {
-    this.limit = limit;
-    if (!Number.isInteger(limit) || limit <= 0) {
-      throw new RangeError(
-        `Semaphore limit must be a positive integer; received ${limit}. A non-positive limit produces a deadlocked semaphore — fail fast at construction instead.`
-      );
-    }
-  }
-  current = 0;
-  queue = [];
-  /**
-   * Acquires a slot, waiting if the limit has been reached.
-   * @returns A promise that resolves when a slot is available.
-   */
-  async acquire() {
-    if (this.current < this.limit) {
-      this.current++;
-      return;
-    }
-    return new Promise((resolve) => {
-      this.queue.push(resolve);
-    });
-  }
-  /** Releases a slot, unblocking the next queued caller if any. */
-  release() {
-    const next = this.queue.shift();
-    if (next) {
-      next();
-    } else {
-      this.current--;
-    }
-  }
-  /**
-   * Number of slots currently available.
-   *
-   * @returns The count of free concurrency slots.
-   */
-  get available() {
-    return this.limit - this.current;
-  }
+
+//# sourceMappingURL=file.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/abort-scope.js
+//#region src/upload/abort-scope.ts
+/**
+* Creates an abort scope linked to an optional upstream signal.
+* Task failures can abort the same scope so sibling tasks stop promptly.
+* @param upstream - Caller-provided abort signal, if any.
+*
+* @returns A linked abort scope.
+*/
+function createAbortScope(upstream) {
+	const controller = new AbortController();
+	let upstreamAbort;
+	const abort = (reason) => {
+		if (!controller.signal.aborted) controller.abort(reason);
+	};
+	if (upstream?.aborted === true) abort(upstream.reason);
+	else if (upstream !== void 0) {
+		upstreamAbort = () => abort(upstream.reason);
+		upstream.addEventListener("abort", upstreamAbort, { once: true });
+	}
+	return {
+		signal: controller.signal,
+		abort,
+		dispose() {
+			if (upstreamAbort !== void 0) upstream?.removeEventListener("abort", upstreamAbort);
+		}
+	};
+}
+/**
+* Throws the abort reason or first task rejection from a settled task set.
+* @param settled - Results from `Promise.allSettled`.
+* @param abortScope - Scope that coordinated the tasks.
+*
+* @throws The abort reason or first rejected task reason.
+*/
+function throwRejectedOrAbortReason(settled, abortScope) {
+	const rejected = settled.find((result) => result.status === "rejected");
+	if (rejected === void 0) return;
+	if (abortScope.signal.aborted && abortScope.signal.reason !== void 0) throw abortScope.signal.reason;
+	/* v8 ignore next -- Defensive fallback for unexpected task rejections outside the abort scope. */
+	throw rejected.reason;
+}
+/**
+* Returns the observable reason for an aborted signal.
+* @param signal - Aborted signal to inspect.
+*
+* @returns The signal's reason, or a standard AbortError when the runtime did not provide one.
+*/
+function abortReason(signal) {
+	return signal.reason ?? new DOMException("Aborted", "AbortError");
+}
+/**
+* Races a request promise against an abort signal.
+*
+* The underlying request must still receive the same signal so transports can
+* cancel their network work. This helper makes callers stop waiting promptly
+* even when a test double or custom transport ignores the signal.
+*
+* @param promise - Request promise to observe.
+* @param signal - Signal that should stop waiting for the request.
+*
+* @returns The request result if it settles before the signal aborts.
+*
+* @throws The abort reason if the signal aborts first, or the request rejection.
+*/
+async function raceWithAbort(promise, signal) {
+	if (signal.aborted) {
+		promise.catch(() => {});
+		throw abortReason(signal);
+	}
+	let removeAbortListener;
+	const abort = new Promise((_, reject) => {
+		const onAbort = () => reject(abortReason(signal));
+		signal.addEventListener("abort", onAbort, { once: true });
+		removeAbortListener = () => signal.removeEventListener("abort", onAbort);
+	});
+	try {
+		return await Promise.race([promise, abort]);
+	} catch (err) {
+		if (signal.aborted) promise.catch(() => {});
+		throw err;
+	} finally {
+		removeAbortListener?.();
+	}
+}
+//#endregion
+
+
+//# sourceMappingURL=abort-scope.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/internal/url-redaction.js
+//#region src/internal/url-redaction.ts
+/**
+* Redact a URL before including it in an error message.
+*
+* @param url - Absolute URL, relative URL, or parsed URL to redact.
+* @param options - Optional base URL and invalid-URL placeholder.
+*
+* @returns A URL string with userinfo, query string, fragment, and path
+* segments removed.
+*/
+function url_redaction_redactUrlForError(url, options = {}) {
+	try {
+		const parsed = url instanceof URL ? new URL(url) : options.baseUrl !== void 0 ? new URL(url, options.baseUrl) : new URL(url);
+		if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return options.invalidUrlLabel ?? "";
+		parsed.username = "";
+		parsed.password = "";
+		parsed.search = "";
+		parsed.hash = "";
+		parsed.pathname = redactPathname(parsed.pathname);
+		return parsed.toString();
+	} catch {
+		return options.invalidUrlLabel ?? "";
+	}
+}
+function redactPathname(pathname) {
+	return pathname.split("/").some(Boolean) ? "/..." : pathname;
+}
+//#endregion
+
+
+//# sourceMappingURL=url-redaction.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/errors.js
+//#region src/types/errors.ts
+/**
+* B2 API error codes documented by the SDK.
+* This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback
+* so callers can receive unknown future server codes while keeping autocomplete
+* for known values.
+*/
+var KNOWN_B2_ERROR_CODES = [
+	"expired_auth_token",
+	"bad_auth_token",
+	"unauthorized",
+	"bad_request",
+	"bad_bucket_name",
+	"bad_bucket_id",
+	"not_found",
+	"method_not_allowed",
+	"request_timeout",
+	"too_many_requests",
+	"conflict",
+	"duplicate_bucket_name",
+	"too_many_buckets",
+	"too_many_files",
+	"cap_exceeded",
+	"storage_cap_exceeded",
+	"transaction_cap_exceeded",
+	"download_cap_exceeded",
+	"access_denied",
+	"service_unavailable",
+	"internal_error",
+	"bad_json",
+	"invalid_bucket_id",
+	"invalid_bucket_name",
+	"invalid_bucket_info",
+	"file_not_present",
+	"no_such_file",
+	"out_of_range",
+	"range_not_satisfiable",
+	"invalid_file_id",
+	"invalid_file_name",
+	"invalid_file_info",
+	"invalid_part_number",
+	"bad_sha1_checksum"
+];
+//#endregion
+
+
+//# sourceMappingURL=errors.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/errors/index.js
+
+
+//#region src/errors/index.ts
+/**
+* Typed error hierarchy for B2 API failures.
+*
+* Every B2 error response maps to a specific {@link B2Error} subclass.
+* Retry behavior is exposed through {@link B2Error.retryable}.
+* Examples include {@link ExpiredAuthTokenError} and {@link CapExceededError}.
+* Use {@link classifyError} to convert a raw error response into the
+* appropriate subclass.
+*
+* Convention: most `B2Error` subclasses represent failures returned by the B2
+* API. The client-side exception is {@link B2RealmConfigurationError}; it
+* extends `B2Error` so realm-validation failures can be handled with the SDK
+* error hierarchy before credentials are sent.
+*
+* Other programming errors and SDK preconditions, such as "not yet authorized",
+* "stream consumed twice", or "called before init", use the native `Error`
+* constructor instead. The direct `Error` outliers are
+* {@link B2InsufficientCapabilityError}, {@link B2RedirectError},
+* {@link B2SsrfError}, {@link NetworkError},
+* {@link ResumeFileIdMismatchError}, {@link UploadResponseBodyError}, and
+* {@link FinishLargeFileResponseBodyError}.
+*
+* @packageDocumentation
+*/
+/** Thrown when an explicit resumeFileId is not compatible with the requested upload. */
+var ResumeFileIdMismatchError = class extends Error {
+	/** Caller-supplied unfinished large file ID that failed verification. */
+	fileId;
+	/** Requested destination file name. */
+	fileName;
+	/**
+	* Creates a new resume-file ID mismatch error.
+	* @param fileId - Caller-supplied unfinished large file ID that failed verification.
+	* @param fileName - Requested destination file name.
+	*/
+	constructor(fileId, fileName) {
+		super(`uploadLargeFile: resumeFileId ${fileId} does not identify a compatible unfinished large file for ${fileName}.`);
+		this.name = "ResumeFileIdMismatchError";
+		this.fileId = fileId;
+		this.fileName = fileName;
+	}
+};
+/**
+* Base error class for all B2 API errors.
+* Contains the HTTP status, B2 error code, and retry metadata from the response.
+*/
+var B2Error = class extends Error {
+	/** HTTP status code returned by the B2 API. */
+	status;
+	/** B2 error code identifying the error type (e.g. `expired_auth_token`). */
+	code;
+	/** B2 request ID from the `X-Bz-Request-Id` response header, if present. */
+	requestId;
+	/** Retry delay in seconds from the `Retry-After` response header, if present. */
+	retryAfter;
+	/** Whether this error is transient and the request can be retried. */
+	retryable;
+	/**
+	* Creates a new B2Error instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional retry and request metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response.message);
+		this.name = "B2Error";
+		this.status = response.status;
+		this.code = response.code;
+		if (options?.retryAfter !== void 0) this.retryAfter = options.retryAfter;
+		if (options?.requestId !== void 0) this.requestId = options.requestId;
+		this.retryable = isTransient(response.status, response.code);
+	}
+};
+/** Thrown when the auth token has expired. Triggers automatic re-authorization. */
+var ExpiredAuthTokenError = class extends B2Error {
+	/**
+	* Creates a new ExpiredAuthTokenError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "ExpiredAuthTokenError";
+	}
+};
+/** Thrown when the auth token is invalid or unauthorized. */
+var BadAuthTokenError = class extends B2Error {
+	/**
+	* Creates a new BadAuthTokenError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "BadAuthTokenError";
+	}
+};
+/** Thrown when the B2 service is temporarily unavailable (HTTP 503). */
+var ServiceUnavailableError = class extends B2Error {
+	/**
+	* Creates a new ServiceUnavailableError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "ServiceUnavailableError";
+	}
+};
+/** Thrown when B2 reports an internal server error. */
+var InternalError = class extends B2Error {
+	/**
+	* Creates a new InternalError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "InternalError";
+	}
+};
+/** Thrown when a request times out on the server side (HTTP 408). */
+var RequestTimeoutError = class extends B2Error {
+	/**
+	* Creates a new RequestTimeoutError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "RequestTimeoutError";
+	}
+};
+/** Thrown when the client has sent too many requests (HTTP 429). */
+var TooManyRequestsError = class extends B2Error {
+	/**
+	* Creates a new TooManyRequestsError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "TooManyRequestsError";
+	}
+};
+/** Thrown when the account has reached the maximum number of buckets. */
+var TooManyBucketsError = class extends B2Error {
+	/**
+	* Creates a new TooManyBucketsError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "TooManyBucketsError";
+	}
+};
+/** Thrown when the bucket or request has reached the maximum number of files. */
+var TooManyFilesError = class extends B2Error {
+	/**
+	* Creates a new TooManyFilesError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "TooManyFilesError";
+	}
+};
+/** Thrown when a storage, transaction, or download cap has been exceeded. */
+var CapExceededError = class extends B2Error {
+	/**
+	* Creates a new CapExceededError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "CapExceededError";
+	}
+};
+/** Thrown when the application key does not have permission for the requested operation. */
+var AccessDeniedError = class extends B2Error {
+	/**
+	* Creates a new AccessDeniedError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "AccessDeniedError";
+	}
+};
+/** Thrown when the requested file does not exist. */
+var FileNotPresentError = class extends B2Error {
+	/**
+	* Creates a new FileNotPresentError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "FileNotPresentError";
+	}
+};
+/** Thrown when a requested B2 resource does not exist. */
+var NotFoundError = class extends B2Error {
+	/**
+	* Creates a new NotFoundError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "NotFoundError";
+	}
+};
+/** Thrown when creating a bucket with a name that already exists in the account. */
+var DuplicateBucketNameError = class extends B2Error {
+	/**
+	* Creates a new DuplicateBucketNameError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "DuplicateBucketNameError";
+	}
+};
+/** Thrown when a bucket name is malformed, reserved, or otherwise rejected by B2. */
+var InvalidBucketNameError = class extends B2Error {
+	/**
+	* Creates a new InvalidBucketNameError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "InvalidBucketNameError";
+	}
+};
+/** Thrown when bucket metadata fails B2 validation. */
+var InvalidBucketInfoError = class extends B2Error {
+	/**
+	* Creates a new InvalidBucketInfoError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "InvalidBucketInfoError";
+	}
+};
+/** Thrown when a bucket ID is malformed or does not identify a valid bucket. */
+var BadBucketIdError = class extends B2Error {
+	/**
+	* Creates a new BadBucketIdError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "BadBucketIdError";
+	}
+};
+/** Thrown when the B2 endpoint does not allow the request method. */
+var MethodNotAllowedError = class extends B2Error {
+	/**
+	* Creates a new MethodNotAllowedError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "MethodNotAllowedError";
+	}
+};
+/** Thrown when the request conflicts with current B2 resource state. */
+var ConflictError = class extends B2Error {
+	/**
+	* Creates a new ConflictError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "ConflictError";
+	}
+};
+/** Thrown for general bad request errors (HTTP 400) not covered by a more specific subclass. */
+var BadRequestError = class extends B2Error {
+	/**
+	* Creates a new BadRequestError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "BadRequestError";
+	}
+};
+/** Thrown when B2 cannot parse the JSON request body. */
+var BadJsonError = class extends B2Error {
+	/**
+	* Creates a new BadJsonError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "BadJsonError";
+	}
+};
+/** Thrown when a bucket ID has a valid shape but does not identify a usable bucket. */
+var InvalidBucketIdError = class extends B2Error {
+	/**
+	* Creates a new InvalidBucketIdError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "InvalidBucketIdError";
+	}
+};
+/** Thrown when a numeric request parameter is outside the allowed range. */
+var OutOfRangeError = class extends B2Error {
+	/**
+	* Creates a new OutOfRangeError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "OutOfRangeError";
+	}
+};
+/** Thrown when a requested byte range cannot be satisfied. */
+var RangeNotSatisfiableError = class extends B2Error {
+	/**
+	* Creates a new RangeNotSatisfiableError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "RangeNotSatisfiableError";
+	}
+};
+/** Thrown when a file name is malformed or otherwise rejected by B2. */
+var InvalidFileNameError = class extends B2Error {
+	/**
+	* Creates a new InvalidFileNameError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "InvalidFileNameError";
+	}
+};
+/** Thrown when file metadata fails B2 validation. */
+var InvalidFileInfoError = class extends B2Error {
+	/**
+	* Creates a new InvalidFileInfoError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "InvalidFileInfoError";
+	}
+};
+/** Thrown when a file ID is malformed or does not identify a valid file. */
+var InvalidFileIdError = class extends B2Error {
+	/**
+	* Creates a new InvalidFileIdError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "InvalidFileIdError";
+	}
+};
+/** Thrown when a multipart upload part number is invalid. */
+var InvalidPartNumberError = class extends B2Error {
+	/**
+	* Creates a new InvalidPartNumberError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "InvalidPartNumberError";
+	}
+};
+/**
+* Thrown when an upload URL is no longer valid and must be refreshed.
+*
+* Forward-compat insurance: B2 does not currently surface a distinct
+* error code for this case, so {@link classifyError} never actually
+* instantiates this class today. It's part of the public API so
+* consumers can pre-write `instanceof` checks; when B2 documents a
+* `bad_upload_url` (or similar) error code, the `classifyError`
+* switch gets a matching case and existing consumer code starts
+* catching the typed error without any changes on their side.
+*
+* Until then, expect `BadRequestError` for upload-URL invalidation
+* scenarios — that's what B2 currently returns.
+*/
+var BadUploadUrlError = class extends B2Error {
+	/**
+	* Creates a new BadUploadUrlError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "BadUploadUrlError";
+	}
+};
+/**
+* Thrown when the uploaded file's SHA-1 checksum does not match the
+* expected value.
+*
+* When B2 returns `bad_sha1_checksum`, {@link classifyError} instantiates
+* this class so callers can handle checksum failures with `instanceof`.
+* Generic `bad_request` checksum failures continue to classify as
+* {@link BadRequestError}.
+*/
+var ChecksumMismatchError = class extends B2Error {
+	/**
+	* Creates a new ChecksumMismatchError instance.
+	* @param response - Parsed B2 error response body.
+	* @param options - Optional metadata from response headers.
+	*/
+	constructor(response, options) {
+		super(response, options);
+		this.name = "ChecksumMismatchError";
+	}
+};
+/**
+* Thrown by client-side capability checks when the application key is missing
+* capabilities required by an operation. Not raised by the server.
+*/
+var B2InsufficientCapabilityError = class extends Error {
+	/** Capabilities that were required for the operation. */
+	required;
+	/** Capabilities that the current key actually has. */
+	available;
+	/** Capabilities present in `required` but not in `available`. */
+	missing;
+	/**
+	* Creates a new B2InsufficientCapabilityError instance.
+	*
+	* @param required - Capabilities the operation requires.
+	* @param available - Capabilities the current key holds.
+	* @param missing - The subset of required that isn't available.
+	*/
+	constructor(required, available, missing) {
+		super(`Application key is missing capabilities: ${missing.join(", ")}`);
+		this.name = "B2InsufficientCapabilityError";
+		this.required = required;
+		this.available = available;
+		this.missing = missing;
+	}
+};
+/**
+* Thrown when the SDK is asked to fetch a URL whose host is outside the
+* authorized B2 realm. Defense against SSRF / URL-substitution attacks where
+* a compromised or hostile B2 endpoint returns an upload URL pointing at an
+* internal service (e.g. cloud metadata at `169.254.169.254`).
+*
+* Not retryable.
+*/
+var B2SsrfError = class extends Error {
+	/** Always `false` — this is a security failure, not transient. */
+	retryable = false;
+	/**
+	* Creates a new {@link B2SsrfError}.
+	*
+	* @param message - Human-readable description of which URL was rejected and why.
+	* @param url - The URL that was rejected. Stored as a sanitized URL.
+	*/
+	constructor(message, url) {
+		const safeUrl = url_redaction_redactUrlForError(url);
+		super(`${message.split(url).join(safeUrl)} (${safeUrl})`);
+		this.name = "B2SsrfError";
+		this.url = safeUrl;
+	}
+	/** Sanitized URL that was rejected. */
+	url;
+};
+/** Thrown when a configured auth realm cannot safely be used for authorization. */
+var B2RealmConfigurationError = class extends B2Error {
+	/**
+	* Creates a new B2RealmConfigurationError instance.
+	*
+	* @param message - Human-readable description of the invalid realm setting.
+	*/
+	constructor(message) {
+		super({
+			status: 400,
+			code: "bad_request",
+			message
+		});
+		this.name = "B2RealmConfigurationError";
+	}
+};
+/** Thrown when the SDK refuses to follow an HTTP redirect automatically. */
+var B2RedirectError = class extends Error {
+	/** Always `false` because a blocked redirect is deterministic. */
+	retryable = false;
+	/** Sanitized request URL whose response attempted to redirect. */
+	url;
+	/** HTTP redirect status code, or 0 for an opaque browser redirect. */
+	status;
+	/** Sanitized redirect target, or `null` when no Location header was present. */
+	location;
+	/**
+	* Creates a new B2RedirectError instance.
+	*
+	* @param url - Request URL whose response attempted to redirect. Stored as a sanitized URL.
+	* @param status - HTTP redirect status code.
+	* @param location - Redirect Location header, if present. Stored as a sanitized URL.
+	*/
+	constructor(url, status, location) {
+		const safeUrl = url_redaction_redactUrlForError(url);
+		const safeLocation = location !== null ? url_redaction_redactUrlForError(location, { baseUrl: url }) : null;
+		super(safeLocation !== null ? `HTTP ${status} redirect blocked for ${safeUrl} to ${safeLocation}` : `HTTP ${status} redirect blocked for ${safeUrl}`);
+		this.name = "B2RedirectError";
+		this.url = safeUrl;
+		this.status = status;
+		this.location = safeLocation;
+	}
+};
+/** Thrown when a network-level failure occurs (DNS, TCP, TLS). Always retryable. */
+var NetworkError = class extends Error {
+	cause;
+	/** Always `true` since network errors are transient. */
+	retryable = true;
+	/**
+	* Creates a new NetworkError instance.
+	* @param message - Human-readable description of the network failure.
+	* @param cause - The underlying error that caused this failure, if any.
+	*/
+	constructor(message, cause) {
+		super(message);
+		this.cause = cause;
+		this.name = "NetworkError";
+	}
+};
+/**
+* Thrown when an upload POST returned a response but its body could not be
+* read. The upload may already have been stored by B2, so retrying this error
+* can create duplicate file versions or parts.
+*/
+var UploadResponseBodyError = class extends Error {
+	/** Underlying response body error, when available. */
+	cause;
+	/**
+	* Creates a new UploadResponseBodyError instance.
+	* @param message - Human-readable description of the response read failure.
+	* @param options - Optional cause.
+	*/
+	constructor(message, options = {}) {
+		super(message, { cause: options.cause });
+		this.name = "UploadResponseBodyError";
+		if (options.cause !== void 0) this.cause = options.cause;
+	}
+};
+/**
+* Thrown when `b2_finish_large_file` returned a response but its body could not
+* be read. The large file may already be committed server-side, so high-level
+* upload paths do not cancel the large file after this error.
+*/
+var FinishLargeFileResponseBodyError = class extends Error {
+	/** Ambiguous large file ID that may already be committed server-side. */
+	fileId;
+	/** Bucket requested by the high-level upload, when available. */
+	bucketId;
+	/** File name requested by the high-level upload, when available. */
+	fileName;
+	/**
+	* Creates a new FinishLargeFileResponseBodyError instance.
+	* @param message - Human-readable description of the response read failure.
+	* @param options - Optional cause and reconciliation metadata.
+	*/
+	constructor(message, options = {}) {
+		super(message, { cause: options.cause });
+		this.name = "FinishLargeFileResponseBodyError";
+		if (options.cause !== void 0) this.cause = options.cause;
+		if (options.fileId !== void 0) this.fileId = options.fileId;
+		if (options.bucketId !== void 0) this.bucketId = options.bucketId;
+		if (options.fileName !== void 0) this.fileName = options.fileName;
+	}
+};
+function isTransient(status, code) {
+	if (status === 408 || status === 429) return true;
+	if (status === 500 || status === 502 || status === 503 || status === 504) return true;
+	if (code === "expired_auth_token") return true;
+	if (code === "service_unavailable" || code === "request_timeout") return true;
+	return false;
+}
+var knownB2ErrorCodes = new Set(KNOWN_B2_ERROR_CODES);
+function isKnownB2ErrorCode(code) {
+	return knownB2ErrorCodes.has(code);
+}
+function assertNever(value) {
+	throw new Error(`Unhandled B2 error code: ${String(value)}`);
+}
+function classifyKnownError(response, code, options) {
+	switch (code) {
+		case "expired_auth_token": return new ExpiredAuthTokenError(response, options);
+		case "bad_auth_token":
+		case "unauthorized": return new BadAuthTokenError(response, options);
+		case "bad_request": return new BadRequestError(response, options);
+		case "bad_bucket_name":
+		case "invalid_bucket_name": return new InvalidBucketNameError(response, options);
+		case "bad_bucket_id": return new BadBucketIdError(response, options);
+		case "not_found": return new NotFoundError(response, options);
+		case "method_not_allowed": return new MethodNotAllowedError(response, options);
+		case "request_timeout": return new RequestTimeoutError(response, options);
+		case "too_many_requests": return new TooManyRequestsError(response, options);
+		case "conflict": return new ConflictError(response, options);
+		case "duplicate_bucket_name": return new DuplicateBucketNameError(response, options);
+		case "too_many_buckets": return new TooManyBucketsError(response, options);
+		case "too_many_files": return new TooManyFilesError(response, options);
+		case "cap_exceeded":
+		case "storage_cap_exceeded":
+		case "transaction_cap_exceeded":
+		case "download_cap_exceeded": return new CapExceededError(response, options);
+		case "access_denied": return new AccessDeniedError(response, options);
+		case "service_unavailable": return new ServiceUnavailableError(response, options);
+		case "internal_error": return new InternalError(response, options);
+		case "bad_json": return new BadJsonError(response, options);
+		case "invalid_bucket_id": return new InvalidBucketIdError(response, options);
+		case "invalid_bucket_info": return new InvalidBucketInfoError(response, options);
+		case "file_not_present":
+		case "no_such_file": return new FileNotPresentError(response, options);
+		case "out_of_range": return new OutOfRangeError(response, options);
+		case "range_not_satisfiable": return new RangeNotSatisfiableError(response, options);
+		case "invalid_file_id": return new InvalidFileIdError(response, options);
+		case "invalid_file_name": return new InvalidFileNameError(response, options);
+		case "invalid_file_info": return new InvalidFileInfoError(response, options);
+		case "invalid_part_number": return new InvalidPartNumberError(response, options);
+		case "bad_sha1_checksum": return new ChecksumMismatchError(response, options);
+		default: return assertNever(code);
+	}
+}
+function classifyUnknownError(response, options) {
+	if (response.status === 429) return new TooManyRequestsError(response, options);
+	if (response.status === 503) return new ServiceUnavailableError(response, options);
+	if (response.status === 408) return new RequestTimeoutError(response, options);
+	return new B2Error(response, options);
+}
+/**
+* Maps a B2 error response to the appropriate {@link B2Error} subclass.
+* Uses known error codes for exact matching, then falls back to HTTP status
+* codes for unknown future B2 codes.
+*
+* Maintainer note: when B2 documents a new error code, add it to
+* `KNOWN_B2_ERROR_CODES` in `src/types/errors.ts` and add a matching
+* `classifyKnownError` switch case. Unknown codes fall through to the
+* HTTP-status-based heuristic and finally to a generic `B2Error`, which is
+* safe but loses semantic specificity (the caller can't `instanceof` against
+* a precise subclass and the retry decision relies on status alone).
+*
+* @param response - Parsed B2 error response body.
+* @param options - Optional retry and request metadata from response headers.
+*
+* @returns A typed B2Error subclass instance.
+*/
+function classifyError(response, options) {
+	if (response.code === "internal_error" && response.status !== 500) return classifyUnknownError(response, options);
+	if (isKnownB2ErrorCode(response.code)) return classifyKnownError(response, response.code, options);
+	return classifyUnknownError(response, options);
 }
+//#endregion
+
+
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/best-effort.js
+//#region src/util/best-effort.ts
+/**
+* Runs an async cleanup operation and swallows any rejection.
+*
+* Used at error-handling boundaries (e.g. after a multipart upload fails,
+* when trying to `cancelLargeFile` on the orphaned upload). The primary
+* error is what the caller wants to see; a secondary failure during
+* cleanup must not shadow it.
+*
+* Naming the pattern instead of inlining a try/catch with an empty catch
+* makes the intent explicit at the call site: this is best-effort cleanup,
+* not a silent error swallow.
+*
+* @param fn - Cleanup async function. Its return value is ignored; any
+*   thrown error or rejected promise is caught and discarded.
+* @param onError - Optional observer called with the swallowed cleanup error.
+*
+* @returns A promise that always resolves, regardless of `fn`'s outcome.
+*
+* @example
+* ```ts
+* try {
+*   await uploadParts(...)
+* } catch (err) {
+*   await bestEffort(() =>
+*     raw.cancelLargeFile(apiUrl, authToken, { fileId: largeFileId }),
+*   )
+*   throw err
+* }
+* ```
+*/
+async function bestEffort(fn, onError) {
+	try {
+		await fn();
+	} catch (error) {
+		try {
+			onError?.(error);
+		} catch {}
+	}
+}
+//#endregion
 
-//# sourceMappingURL=concurrency.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/defaults.js
-const DEFAULT_TRANSFER_CONCURRENCY = 4;
-const DEFAULT_BULK_CONCURRENCY = 10;
-const DEFAULT_PAGE_SIZE = 1e3;
-const DEFAULT_CONTENT_TYPE = "b2/x-auto";
+//# sourceMappingURL=best-effort.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/cancel.js
+
+
+//#region src/upload/cancel.ts
+/** Default wall-clock bound for best-effort cleanup calls after upload failure. */
+var DEFAULT_CLEANUP_TIMEOUT_MS = 3e4;
+var fallbackCleanupDisposers = /* @__PURE__ */ new WeakMap();
+/**
+* Cancels an unfinished large file on a best-effort basis. Used at every
+* error-handling boundary in the multipart upload, write-stream, and
+* server-side copy paths to roll back in-progress uploads without
+* letting a cancellation failure mask the underlying error the caller
+* is about to see.
+*
+* Centralising the call removes a five-line `bestEffort` block that
+* recurred at six sites with identical shape — the only thing that
+* changed was the captured `fileId` and the surrounding error trail.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state for the API URL + token.
+* @param fileId - The in-progress large file ID to cancel.
+* @param options - Optional request controls and cleanup-failure observer.
+*
+* @returns A promise that always resolves, regardless of the cancel
+*   call's outcome.
+*/
+async function cancelLargeFileBestEffort(raw, accountInfo, fileId, options) {
+	await bestEffort(async () => {
+		const requestOptions = cleanupRequestOptions(options?.signal);
+		await waitForCleanup(raw.cancelLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId }, requestOptions), requestOptions.signal);
+	}, (error) => options?.onCleanupFailure?.({
+		fileId,
+		error,
+		reason: "cancel-failed"
+	}));
+}
+/**
+* Returns cleanup request controls with a live timeout signal.
+*
+* @param signal - Caller-provided abort signal, if any.
+* @param timeoutMs - Maximum time to spend waiting for cleanup.
+*
+* @returns Request controls with a signal independent of an already-aborted caller signal.
+*/
+function cleanupRequestOptions(signal, timeoutMs = DEFAULT_CLEANUP_TIMEOUT_MS) {
+	return { signal: createCleanupSignal(signal, timeoutMs) };
+}
+function createCleanupSignal(signal, timeoutMs) {
+	if (typeof AbortSignal.timeout === "function") {
+		if (signal === void 0 || signal.aborted) return AbortSignal.timeout(timeoutMs);
+		if (typeof AbortSignal.any === "function") return AbortSignal.any([signal, AbortSignal.timeout(timeoutMs)]);
+	}
+	return createFallbackCleanupSignal(signal, timeoutMs);
+}
+function createFallbackCleanupSignal(signal, timeoutMs) {
+	const controller = new AbortController();
+	const timeout = setTimeout(() => {
+		abortFallbackCleanup(controller, cleanupTimeoutReason(), cleanup);
+	}, timeoutMs);
+	const onAbort = () => {
+		const reason = signal === void 0 ? cleanupDomException("Cleanup aborted", "AbortError") : cleanupAbortReason(signal);
+		abortFallbackCleanup(controller, reason, cleanup);
+	};
+	const cleanup = () => {
+		clearTimeout(timeout);
+		signal?.removeEventListener("abort", onAbort);
+		fallbackCleanupDisposers.delete(controller.signal);
+	};
+	fallbackCleanupDisposers.set(controller.signal, cleanup);
+	if (signal === void 0 || signal.aborted) return controller.signal;
+	signal.addEventListener("abort", onAbort, { once: true });
+	controller.signal.addEventListener("abort", cleanup, { once: true });
+	return controller.signal;
+}
+function abortFallbackCleanup(controller, reason, cleanup) {
+	if (!controller.signal.aborted) controller.abort(reason);
+	cleanup();
+}
+async function waitForCleanup(request, signal) {
+	if (signal.aborted) throw cleanupAbortReason(signal);
+	let removeAbortListener;
+	const aborted = new Promise((_resolve, reject) => {
+		const onAbort = () => reject(cleanupAbortReason(signal));
+		signal.addEventListener("abort", onAbort, { once: true });
+		removeAbortListener = () => signal.removeEventListener("abort", onAbort);
+	});
+	try {
+		await Promise.race([request, aborted]);
+	} finally {
+		removeAbortListener?.();
+		fallbackCleanupDisposers.get(signal)?.();
+		request.catch(() => {});
+	}
+}
+function cleanupAbortReason(signal) {
+	return signal.reason ?? cleanupDomException("Cleanup aborted", "AbortError");
+}
+function cleanupTimeoutReason() {
+	return cleanupDomException("Cleanup timed out", "TimeoutError");
+}
+function cleanupDomException(message, name) {
+	if (typeof DOMException === "function") return new DOMException(message, name);
+	const error = new Error(message);
+	error.name = name;
+	return error;
+}
+/**
+* Emits an observable cleanup event when cancellation is deliberately skipped
+* because `b2_finish_large_file` may already have committed the file.
+* @param fileId - Large file whose final state is ambiguous.
+* @param error - Ambiguous finish error that will be thrown to the caller.
+* @param onCleanupFailure - Optional observer for cleanup-related events.
+*/
+function notifyAmbiguousLargeFileCleanupSkipped(fileId, error, onCleanupFailure) {
+	try {
+		onCleanupFailure?.({
+			fileId,
+			error,
+			reason: "finish-ambiguous"
+		});
+	} catch {}
+}
+/**
+* Adds high-level reconciliation metadata to an ambiguous finish response-body
+* error and notifies the cleanup observer that cancellation was skipped.
+*
+* @param err - Raw finish response-body error from the low-level client.
+* @param options - Large-file context used for reconciliation.
+*
+* @returns The enriched {@link FinishLargeFileResponseBodyError}.
+*/
+function handleAmbiguousFinishLargeFileResponseBodyError(err, options) {
+	const enriched = err.fileId === options.fileId && err.bucketId === options.bucketId && err.fileName === options.fileName ? err : new FinishLargeFileResponseBodyError(err.message, {
+		cause: err.cause ?? err,
+		fileId: options.fileId,
+		bucketId: options.bucketId,
+		fileName: options.fileName
+	});
+	notifyAmbiguousLargeFileCleanupSkipped(options.fileId, enriched, options.onCleanupFailure);
+	return enriched;
+}
+/**
+* Performs the shared large-file failure policy: ambiguous finish-body errors
+* are enriched and left uncancelled, while all pre-finish errors trigger
+* best-effort cancellation.
+*
+* @param err - Error from a multipart upload/copy/write-stream path.
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param context - Large file metadata used for cleanup and diagnostics.
+* @param options - Cleanup policy controls.
+*
+* @returns The error that should be surfaced to the caller.
+*/
+async function resolveLargeFileErrorAfterCleanup(err, raw, accountInfo, context, options = {}) {
+	if (err instanceof FinishLargeFileResponseBodyError) return handleAmbiguousFinishLargeFileResponseBodyError(err, context);
+	if (options.cancelOnError ?? true) await cancelLargeFileBestEffort(raw, accountInfo, context.fileId, {
+		...context.signal !== void 0 ? { signal: context.signal } : {},
+		...context.onCleanupFailure !== void 0 ? { onCleanupFailure: context.onCleanupFailure } : {}
+	});
+	return err;
+}
+/**
+* Throwing wrapper around {@link resolveLargeFileErrorAfterCleanup} for paths
+* that can surface the error directly.
+* @param err - Error from a multipart upload/copy/write-stream path.
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param context - Large file metadata used for cleanup and diagnostics.
+* @param options - Cleanup policy controls.
+*
+* @throws The resolved large-file error after cleanup policy is applied.
+*/
+async function cleanupAfterLargeFileError(err, raw, accountInfo, context, options) {
+	throw await resolveLargeFileErrorAfterCleanup(err, raw, accountInfo, context, options);
+}
+//#endregion
 
-//# sourceMappingURL=defaults.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/plan-ranges.js
+//# sourceMappingURL=cancel.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/finish.js
+
+//#region src/upload/finish.ts
+/**
+* Calls `b2_finish_large_file` and classifies failures after dispatch that can
+* hide an already-committed file as ambiguous finish failures.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param context - Finish request data and reconciliation metadata.
+*
+* @returns The completed file version metadata.
+*/
+async function finishLargeFileWithAbortReconciliation(raw, accountInfo, context) {
+	context.signal?.throwIfAborted();
+	try {
+		return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
+			fileId: context.fileId,
+			partSha1Array: context.partSha1s
+		}, context.signal === void 0 && context.retry === void 0 ? void 0 : {
+			...context.signal !== void 0 ? { signal: context.signal } : {},
+			...context.retry !== void 0 ? { retry: context.retry } : {}
+		});
+	} catch (err) {
+		if (err instanceof FinishLargeFileResponseBodyError) throw finishLargeFileResponseBodyErrorWithContext(err, context);
+		if (isAmbiguousFinishDispatchFailure(err, context.signal)) throw new FinishLargeFileResponseBodyError("b2_finish_large_file failed after dispatch; final file state is ambiguous.", {
+			cause: err,
+			fileId: context.fileId,
+			bucketId: context.bucketId,
+			fileName: context.fileName
+		});
+		throw err;
+	}
+}
+function finishLargeFileResponseBodyErrorWithContext(err, context) {
+	if (err.fileId === context.fileId && err.bucketId === context.bucketId && err.fileName === context.fileName) return err;
+	return new FinishLargeFileResponseBodyError(err.message, {
+		cause: err.cause ?? err,
+		fileId: context.fileId,
+		bucketId: context.bucketId,
+		fileName: context.fileName
+	});
+}
+function isAmbiguousFinishDispatchFailure(err, signal) {
+	if (err instanceof NetworkError) return true;
+	if (isTimeoutError(err)) return true;
+	if (signal?.aborted !== true) return false;
+	if (signal.reason !== void 0 && Object.is(err, signal.reason)) return true;
+	return isAbortError(err);
+}
+function isAbortError(err) {
+	return err instanceof DOMException && err.name === "AbortError" || err instanceof Error && err.name === "AbortError";
+}
+function isTimeoutError(err) {
+	return err instanceof DOMException && err.name === "TimeoutError" || err instanceof Error && err.name === "TimeoutError";
+}
+//#endregion
+
+
+//# sourceMappingURL=finish.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/plan-ranges.js
+//#region src/util/plan-ranges.ts
+/**
+* Lays out a sequence of contiguous, non-overlapping byte ranges over
+* `[0, totalSize)`. Every produced range is at most `chunkSize` bytes
+* long; the final range may be shorter if `totalSize` is not a multiple
+* of `chunkSize`.
+*
+* Replaces three near-identical hand-rolled loops in
+* `upload/large.ts`, `copy/large.ts`, and `download/parallel.ts`.
+*
+* @param totalSize - Total number of bytes to cover.
+* @param chunkSize - Target size of each range in bytes (last range may be smaller).
+*
+* @returns Ordered, non-overlapping range plans. Empty array when `totalSize === 0`.
+*/
 function planRanges(totalSize, chunkSize) {
-  const plans = [];
-  let offset = 0;
-  let index = 0;
-  while (offset < totalSize) {
-    const length = Math.min(chunkSize, totalSize - offset);
-    const end = offset + length - 1;
-    plans.push({
-      partNumber: index + 1,
-      index,
-      offset,
-      length,
-      start: offset,
-      end
-    });
-    offset += length;
-    index++;
-  }
-  return plans;
-}
+	const plans = [];
+	let offset = 0;
+	let index = 0;
+	while (offset < totalSize) {
+		const length = Math.min(chunkSize, totalSize - offset);
+		const end = offset + length - 1;
+		plans.push({
+			partNumber: index + 1,
+			index,
+			offset,
+			length,
+			start: offset,
+			end
+		});
+		offset += length;
+		index++;
+	}
+	return plans;
+}
+/**
+* Format an HTTP `Range:` request-header value covering the given
+* inclusive byte offsets. Centralises the `bytes=-` template
+* so the upload, copy, and download paths agree on syntax.
+*
+* @param start - Inclusive starting byte.
+* @param end - Inclusive ending byte.
+*
+* @returns The header value (e.g. `'bytes=0-99'`).
+*/
 function byteRangeHeader(start, end) {
-  return `bytes=${start}-${end}`;
+	return `bytes=${start}-${end}`;
 }
+//#endregion
+
 
 //# sourceMappingURL=plan-ranges.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/copy/large.js
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/copy/large.js
 
 
 
 
 
+
+
+//#region src/copy/large.ts
+/**
+* Performs a server-side copy of a file using the multipart `b2_copy_part` protocol.
+* The source bytes never traverse the client; B2 copies each range internally.
+*
+* Falls back to a single `copyFile` call when the source fits in one part.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state (used to resolve API URL, recommended part size).
+* @param options - Copy parameters including source, destination, and concurrency.
+*
+* @returns The resulting destination {@link FileVersion}.
+*/
 async function copyLargeFile(raw, accountInfo, options) {
-  const recommendedPartSize = accountInfo.getRecommendedPartSize();
-  const minPartSize = accountInfo.getAbsoluteMinimumPartSize();
-  const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);
-  const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;
-  const sourceInfo = await raw.getFileInfo(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-    fileId: options.sourceFileId
-  });
-  const totalSize = sourceInfo.contentLength;
-  if (totalSize <= partSize) {
-    return raw.copyFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-      sourceFileId: options.sourceFileId,
-      fileName: options.fileName,
-      ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : {},
-      ...options.contentType !== void 0 ? { contentType: options.contentType } : {},
-      ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},
-      ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},
-      ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}
-    });
-  }
-  const destBucketId = options.destinationBucketId ?? sourceInfo.bucketId;
-  const startResp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-    bucketId: destBucketId,
-    fileName: options.fileName,
-    contentType: options.contentType ?? sourceInfo.contentType ?? DEFAULT_CONTENT_TYPE,
-    fileInfo: options.fileInfo ?? {},
-    ...options.destinationServerSideEncryption !== void 0 ? { serverSideEncryption: options.destinationServerSideEncryption } : {}
-  });
-  const largeFileId = startResp.fileId;
-  const ranges = planRanges(totalSize, partSize);
-  const partSha1s = new Array(ranges.length);
-  const sem = new Semaphore(concurrency);
-  try {
-    options.signal?.throwIfAborted();
-    await Promise.all(
-      ranges.map(async (range) => {
-        await sem.acquire();
-        try {
-          options.signal?.throwIfAborted();
-          const resp = await raw.copyPart(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-            sourceFileId: options.sourceFileId,
-            // `startLargeFile` returns `LargeFileId`; `copyPart` takes the
-            // same value typed as `FileId`. Re-brand via the factory.
-            largeFileId: fileId(largeFileId),
-            partNumber: range.partNumber,
-            range: byteRangeHeader(range.start, range.end),
-            ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},
-            ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}
-          });
-          partSha1s[range.partNumber - 1] = resp.contentSha1;
-        } finally {
-          sem.release();
-        }
-      })
-    );
-    options.signal?.throwIfAborted();
-    return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-      fileId: largeFileId,
-      partSha1Array: partSha1s
-    });
-  } catch (err) {
-    await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);
-    throw err;
-  }
-}
+	options.signal?.throwIfAborted();
+	const recommendedPartSize = accountInfo.getRecommendedPartSize();
+	const minPartSize = accountInfo.getAbsoluteMinimumPartSize();
+	const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);
+	const concurrency = options.concurrency ?? 4;
+	const sourceInfo = await raw.getFileInfo(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId: options.sourceFileId });
+	const totalSize = sourceInfo.contentLength;
+	if (totalSize <= partSize) {
+		options.signal?.throwIfAborted();
+		const replaceMetadata = options.contentType !== void 0 || options.fileInfo !== void 0;
+		return raw.copyFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
+			sourceFileId: options.sourceFileId,
+			fileName: options.fileName,
+			...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : {},
+			...replaceMetadata ? {
+				metadataDirective: MetadataDirective.Replace,
+				contentType: options.contentType ?? sourceInfo.contentType ?? "b2/x-auto",
+				fileInfo: options.fileInfo ?? {}
+			} : {},
+			...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},
+			...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}
+		}, options.signal !== void 0 ? { signal: options.signal } : void 0);
+	}
+	const destBucketId = options.destinationBucketId ?? sourceInfo.bucketId;
+	const ranges = planRanges(totalSize, partSize);
+	const partSha1s = new Array(ranges.length);
+	const sem = new Semaphore(concurrency);
+	const abortScope = createAbortScope(options.signal);
+	let largeFileId;
+	try {
+		abortScope.signal.throwIfAborted();
+		const startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
+			bucketId: destBucketId,
+			fileName: options.fileName,
+			contentType: options.contentType ?? sourceInfo.contentType ?? "b2/x-auto",
+			fileInfo: options.fileInfo ?? {},
+			...options.destinationServerSideEncryption !== void 0 ? { serverSideEncryption: options.destinationServerSideEncryption } : {}
+		}, { signal: abortScope.signal });
+		try {
+			largeFileId = (await raceWithAbort(startPromise, abortScope.signal)).fileId;
+		} catch (err) {
+			if (abortScope.signal.aborted) cancelLargeFileAfterStart(startPromise, raw, accountInfo, options.onCleanupFailure);
+			throw err;
+		}
+		const startedLargeFileId = largeFileId;
+		if (startedLargeFileId === void 0) throw new Error("copyLargeFile: start did not return a large file ID.");
+		const tasks = ranges.map(async (range) => {
+			await sem.acquire();
+			try {
+				abortScope.signal.throwIfAborted();
+				const resp = await raceWithAbort(raw.copyPart(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
+					sourceFileId: options.sourceFileId,
+					largeFileId: fileId(startedLargeFileId),
+					partNumber: range.partNumber,
+					range: byteRangeHeader(range.start, range.end),
+					...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},
+					...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}
+				}, { signal: abortScope.signal }), abortScope.signal);
+				partSha1s[range.partNumber - 1] = resp.contentSha1;
+			} catch (err) {
+				abortScope.abort(err);
+				throw err;
+			} finally {
+				sem.release();
+			}
+		});
+		throwRejectedOrAbortReason(await Promise.allSettled(tasks), abortScope);
+		return await finishLargeFileWithAbortReconciliation(raw, accountInfo, {
+			fileId: startedLargeFileId,
+			bucketId: destBucketId,
+			fileName: options.fileName,
+			partSha1s,
+			signal: abortScope.signal
+		});
+	} catch (err) {
+		abortScope.abort(err);
+		if (largeFileId === void 0) throw err;
+		return await cleanupAfterLargeFileError(err, raw, accountInfo, {
+			fileId: largeFileId,
+			bucketId: destBucketId,
+			fileName: options.fileName,
+			signal: options.signal,
+			onCleanupFailure: options.onCleanupFailure
+		});
+	} finally {
+		abortScope.dispose();
+	}
+}
+function cancelLargeFileAfterStart(started, raw, accountInfo, onCleanupFailure) {
+	started.then((resp) => cancelLargeFileBestEffort(raw, accountInfo, resp.fileId, onCleanupFailure === void 0 ? void 0 : { onCleanupFailure })).catch(() => {});
+}
+//#endregion
+
 
 //# sourceMappingURL=large.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/text-codec.js
+//#region src/util/text-codec.ts
+/**
+* Shared UTF-8 codec singletons.
+*
+* Every byte boundary in this SDK is UTF-8: JSON request and response bodies,
+* webhook payloads, simulator stream chunks, and B2 percent-encoding inputs.
+* Allocating a fresh `TextEncoder` / `TextDecoder` per call is wasteful and
+* makes the encoding assumption invisible. Importing these constants makes
+* "we use UTF-8" explicit at every call site and avoids the per-call
+* allocation entirely.
+*
+* Both classes are spec-defined as stateless across encode / decode calls,
+* so a process-wide singleton is safe.
+*
+* @packageDocumentation
+*/
+/**
+* Process-wide UTF-8 `TextEncoder`. Use this instead of
+* `new TextEncoder()` for any string → bytes conversion in the SDK.
+*/
+var utf8Encoder = new TextEncoder();
+/**
+* Process-wide UTF-8 `TextDecoder`. Use this instead of
+* `new TextDecoder()` for any bytes → string conversion in the SDK.
+*/
+var utf8Decoder = new TextDecoder();
+//#endregion
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/text-codec.js
-const utf8Encoder = new TextEncoder();
-const utf8Decoder = new TextDecoder();
 
 //# sourceMappingURL=text-codec.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/encoding.js
-
-const SAFE_CHARS = new Set(
-  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@/".split("")
-);
-function encodeFileName(name) {
-  const encoded = [];
-  for (const char of name) {
-    if (SAFE_CHARS.has(char)) {
-      encoded.push(char);
-    } else {
-      const bytes = utf8Encoder.encode(char);
-      for (const byte of bytes) {
-        encoded.push(`%${byte.toString(16).toUpperCase().padStart(2, "0")}`);
-      }
-    }
-  }
-  return encoded.join("");
-}
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/encoding.js
+
+//#region src/raw/encoding.ts
+/**
+* Characters that B2 treats as safe (not percent-encoded) in file names.
+*
+* Per the B2 docs, everything except `a-z A-Z 0-9 - . _ ~ / ! $ & ' ( ) * + , ; = : @`
+* must be percent-encoded using UTF-8 byte values.
+*/
+var SAFE_CHARS = new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@/".split(""));
+/**
+* Percent-encodes a file name using the B2-specific encoding rules.
+*
+* Unlike standard `encodeURIComponent`, B2 keeps `/` and several other
+* characters unencoded while encoding all other non-ASCII and special
+* characters as uppercase percent-encoded UTF-8 bytes.
+*
+* @param name - The raw (unencoded) file name.
+*
+* @returns The percent-encoded file name suitable for `X-Bz-File-Name` headers.
+*/
+function encoding_encodeFileName(name) {
+	const encoded = [];
+	for (const char of name) if (SAFE_CHARS.has(char)) encoded.push(char);
+	else {
+		const bytes = utf8Encoder.encode(char);
+		for (const byte of bytes) encoded.push(`%${byte.toString(16).toUpperCase().padStart(2, "0")}`);
+	}
+	return encoded.join("");
+}
+/**
+* Decodes a B2 percent-encoded file name back to a plain string.
+*
+* B2 percent-encoding is compatible with standard `decodeURIComponent`,
+* so this is a thin wrapper.
+*
+* @param encoded - The percent-encoded file name from B2.
+*
+* @returns The decoded file name.
+*/
 function decodeFileName(encoded) {
-  return decodeURIComponent(encoded);
-}
+	return decodeURIComponent(encoded);
+}
+/**
+* Converts a file-info map into `X-Bz-Info-*` HTTP headers.
+*
+* Both keys and values are percent-encoded with {@link encodeFileName}
+* to satisfy B2 header requirements.
+*
+* @param fileInfo - Key/value pairs to attach as custom file info, or `undefined`.
+*
+* @returns A record of header name/value pairs (empty if `fileInfo` is `undefined`).
+*/
 function buildFileInfoHeaders(fileInfo) {
-  if (!fileInfo) return {};
-  const headers = {};
-  for (const [key, value] of Object.entries(fileInfo)) {
-    headers[`X-Bz-Info-${encodeFileName(key)}`] = encodeFileName(value);
-  }
-  return headers;
-}
+	if (!fileInfo) return {};
+	const headers = {};
+	for (const [key, value] of Object.entries(fileInfo)) headers[`X-Bz-Info-${encoding_encodeFileName(key)}`] = encoding_encodeFileName(value);
+	return headers;
+}
+/**
+* Extracts custom file-info key/value pairs from B2 response headers.
+*
+* Scans for headers prefixed with `x-bz-info-` and decodes both the
+* key suffix and value using {@link decodeFileName}.
+*
+* @param headers - The HTTP response headers from a B2 download or file-info call.
+*
+* @returns A record of decoded file-info key/value pairs.
+*/
 function parseFileInfoHeaders(headers) {
-  const info = {};
-  headers.forEach((value, key) => {
-    const lower = key.toLowerCase();
-    if (lower.startsWith("x-bz-info-")) {
-      const infoKey = decodeFileName(lower.slice("x-bz-info-".length));
-      info[infoKey] = decodeFileName(value);
-    }
-  });
-  return info;
+	const info = {};
+	headers.forEach((value, key) => {
+		const lower = key.toLowerCase();
+		if (lower.startsWith("x-bz-info-")) {
+			const infoKey = decodeFileName(lower.slice(10));
+			info[infoKey] = decodeFileName(value);
+		}
+	});
+	return info;
 }
+//#endregion
+
 
 //# sourceMappingURL=encoding.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/progress.js
+//#region src/streams/progress.ts
+/**
+* Accumulates byte and part counts and emits {@link ProgressEvent}s to a listener.
+*
+* Internal building block. The SDK wires one of these inside every
+* transfer that accepts an `onProgress` option; users supply the
+* listener callback, not the tracker. Exported only so SDK source
+* modules can import it; not re-exported through any subpath.
+*
+* @internal
+*/
+var ProgressTracker = class {
+	listener;
+	totalBytes;
+	totalParts;
+	/** Running total of bytes transferred. */
+	bytesTransferred = 0;
+	/** Running count of completed parts. */
+	partsCompleted = 0;
+	/** Timestamp when tracking began. */
+	startTime;
+	/**
+	* Creates a new ProgressTracker.
+	* @param listener - Callback to receive progress events, or undefined to disable.
+	* @param totalBytes - Expected total bytes, or null if unknown.
+	* @param totalParts - Expected total parts, or null if not a multipart transfer.
+	*/
+	constructor(listener, totalBytes, totalParts) {
+		this.listener = listener;
+		this.totalBytes = totalBytes;
+		this.totalParts = totalParts;
+		this.startTime = Date.now();
+	}
+	/**
+	* Record that additional bytes have been transferred and notify the listener.
+	* @param count - The number of additional bytes that were transferred.
+	*/
+	addBytes(count) {
+		this.bytesTransferred += count;
+		this.emit();
+	}
+	/** Record that a multipart part has completed and notify the listener. */
+	completePart() {
+		this.partsCompleted++;
+		this.emit();
+	}
+	/** Emit the current progress snapshot to the listener, if one is registered. */
+	emit() {
+		this.listener?.({
+			bytesTransferred: this.bytesTransferred,
+			totalBytes: this.totalBytes,
+			partsCompleted: this.partsCompleted,
+			totalParts: this.totalParts,
+			elapsedMs: Date.now() - this.startTime
+		});
+	}
+};
+//#endregion
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/progress.js
-class ProgressTracker {
-  /**
-   * Creates a new ProgressTracker.
-   * @param listener - Callback to receive progress events, or undefined to disable.
-   * @param totalBytes - Expected total bytes, or null if unknown.
-   * @param totalParts - Expected total parts, or null if not a multipart transfer.
-   */
-  constructor(listener, totalBytes, totalParts) {
-    this.listener = listener;
-    this.totalBytes = totalBytes;
-    this.totalParts = totalParts;
-    this.startTime = Date.now();
-  }
-  /** Running total of bytes transferred. */
-  bytesTransferred = 0;
-  /** Running count of completed parts. */
-  partsCompleted = 0;
-  /** Timestamp when tracking began. */
-  startTime;
-  /**
-   * Record that additional bytes have been transferred and notify the listener.
-   * @param count - The number of additional bytes that were transferred.
-   */
-  addBytes(count) {
-    this.bytesTransferred += count;
-    this.emit();
-  }
-  /** Record that a multipart part has completed and notify the listener. */
-  completePart() {
-    this.partsCompleted++;
-    this.emit();
-  }
-  /** Emit the current progress snapshot to the listener, if one is registered. */
-  emit() {
-    this.listener?.({
-      bytesTransferred: this.bytesTransferred,
-      totalBytes: this.totalBytes,
-      partsCompleted: this.partsCompleted,
-      totalParts: this.totalParts,
-      elapsedMs: Date.now() - this.startTime
-    });
-  }
-}
 
 //# sourceMappingURL=progress.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/normalize.js
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/normalize.js
+//#region src/util/normalize.ts
+/**
+* Wire-shape → SDK-shape normalization helpers.
+*
+* B2 occasionally uses sentinel strings on the wire where a missing
+* value would be more idiomatic in TypeScript. The biggest offender is
+* `contentSha1: 'none'` on files completed via `b2_finish_large_file`
+* (multipart-finished files don't have a whole-file SHA-1; B2 sends the
+* literal three-letter string). The SDK's `FileVersion.contentSha1` is
+* typed `string | null` to signal that absence — this module collapses
+* the wire sentinel to `null` so callers can write
+* `if (fv.contentSha1) { ... }` without an extra `=== 'none'` guard.
+*
+* Normalization happens at the RawClient boundary so every SDK consumer
+* (RawClient direct users, the high-level facade, the simulator-driven
+* tests, generated docs) sees the same `null` value.
+*
+* @packageDocumentation
+*/
+/**
+* Collapses the B2 wire sentinel `'none'` (and `undefined`) to `null` for
+* SHA-1-shaped fields. Any other string passes through unchanged.
+*
+* @param raw - SHA-1 string from the wire, or `null`/`undefined`.
+*
+* @returns A hex SHA-1 string, or `null` when the wire said "no hash".
+*/
 function normalizeSha1(raw) {
-  if (raw === null || raw === void 0 || raw === "none") return null;
-  return raw;
-}
+	if (raw === null || raw === void 0 || raw === "none") return null;
+	return raw;
+}
+/**
+* Returns a new file-version-shaped object with the `contentSha1: 'none'`
+* sentinel collapsed to `null`. Pass-through when the value is already
+* `null` or a real hash. The object reference is preserved if no
+* substitution was needed, so callers paying for change detection
+* (e.g. React memo) see referential stability.
+*
+* @typeParam T - Any object with a `contentSha1: string | null` field.
+*
+* @param fv - The wire-shape file-version object.
+*
+* @returns Either `fv` unchanged or a shallow copy with `contentSha1: null`.
+*/
 function normalizeFileVersionSha1(fv) {
-  return fv.contentSha1 === "none" ? { ...fv, contentSha1: null } : fv;
-}
+	return fv.contentSha1 === "none" ? {
+		...fv,
+		contentSha1: null
+	} : fv;
+}
+/**
+* Returns a new list-response object with `normalizeFileVersionSha1`
+* applied to every entry in `files`. Used at the `b2_list_file_names` /
+* `b2_list_file_versions` boundary so list output shares the same
+* SHA-1 semantics as the singular endpoints.
+*
+* @typeParam F - Any object with a `contentSha1: string | null` field.
+* @typeParam R - The list-response shape (must have a `files` array of `F`).
+*
+* @param resp - The wire-shape list response.
+*
+* @returns A response with normalized `files`. `resp.files` is a new array.
+*/
 function normalizeFileVersionListSha1(resp) {
-  return { ...resp, files: resp.files.map(normalizeFileVersionSha1) };
+	return {
+		...resp,
+		files: resp.files.map(normalizeFileVersionSha1)
+	};
 }
+//#endregion
 
-//# sourceMappingURL=normalize.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/single.js
 
+//# sourceMappingURL=normalize.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/hash.js
 
 
+//#region src/streams/hash.ts
+var nodeCreateHash;
+/**
+* Lazily loads `node:crypto` and caches the factory. Returns null in non-Node runtimes.
+*
+* @returns The cached hash factory, or null if Node crypto is unavailable.
+*/
+async function getNodeCreateHash() {
+	if (nodeCreateHash !== void 0) return nodeCreateHash;
+	try {
+		const crypto = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 7598, 19));
+		if (typeof crypto.createHash !== "function") throw new Error("createHash unavailable");
+		nodeCreateHash = (algo) => {
+			const h = crypto.createHash(algo);
+			return {
+				update(data) {
+					h.update(data);
+				},
+				digest(encoding) {
+					return h.digest(encoding);
+				}
+			};
+		};
+	} catch {
+		/* v8 ignore next -- non-Node runtime fallback, unreachable in Node coverage. */
+		nodeCreateHash = null;
+	}
+	return nodeCreateHash;
+}
+/**
+* Incrementally computes SHA-1 hashes over streaming data.
+* Uses Node.js `crypto` when available, falling back to a dependency-free
+* incremental JavaScript implementation.
+*/
+var IncrementalSha1 = class {
+	/** Total bytes fed into the hash so far. */
+	totalLength = 0;
+	/** Node.js hash instance, or null if using the JavaScript fallback. */
+	nodeHash = null;
+	/** Streaming JavaScript fallback used when Node crypto is unavailable. */
+	jsHash = new JsSha1Hasher();
+	/** Resolves once the crypto backend has been loaded. */
+	initPromise;
+	/** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */
+	constructor() {
+		this.initPromise = getNodeCreateHash().then((factory) => {
+			if (factory) this.nodeHash = factory("sha1");
+		});
+	}
+	/**
+	* Feed data into the hash. Async because it lazily initializes the crypto backend.
+	* @param data - The bytes to include in the hash computation.
+	*
+	* @returns A promise that resolves once the data has been consumed.
+	*/
+	async update(data) {
+		await this.initPromise;
+		if (this.nodeHash) this.nodeHash.update(data);
+		else
+ /* v8 ignore next -- WebCrypto fallback is exercised by browser-mode tests. */
+		this.jsHash.update(data);
+		this.totalLength += data.byteLength;
+	}
+	/**
+	* Finalize the hash and return the hex-encoded SHA-1 digest.
+	* @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.
+	*/
+	async digest() {
+		await this.initPromise;
+		if (this.nodeHash) return this.nodeHash.digest("hex");
+		/* v8 ignore next -- non-Node runtime fallback, exercised by browser-mode tests */
+		return this.jsHash.digest();
+	}
+	/**
+	* Total number of bytes fed into the hash so far.
+	*
+	* @returns The cumulative byte count across all update calls.
+	*/
+	get bytesProcessed() {
+		return this.totalLength;
+	}
+};
+/* v8 ignore start -- JavaScript fallback path, exercised by browser-mode tests */
+var JsSha1Hasher = class {
+	h0 = 1732584193;
+	h1 = 4023233417;
+	h2 = 2562383102;
+	h3 = 271733878;
+	h4 = 3285377520;
+	block = /* @__PURE__ */ new Uint8Array(64);
+	blockLength = 0;
+	bytesProcessed = 0;
+	digested = false;
+	words = /* @__PURE__ */ new Uint32Array(80);
+	update(data) {
+		if (this.digested) throw new Error("SHA-1 digest has already been finalized");
+		this.bytesProcessed += data.byteLength;
+		let offset = 0;
+		if (this.blockLength > 0) {
+			const toCopy = Math.min(64 - this.blockLength, data.byteLength);
+			this.block.set(data.subarray(0, toCopy), this.blockLength);
+			this.blockLength += toCopy;
+			offset = toCopy;
+			if (this.blockLength === 64) {
+				this.processBlock(this.block, 0);
+				this.blockLength = 0;
+			}
+		}
+		while (offset + 64 <= data.byteLength) {
+			this.processBlock(data, offset);
+			offset += 64;
+		}
+		if (offset < data.byteLength) {
+			this.block.set(data.subarray(offset), 0);
+			this.blockLength = data.byteLength - offset;
+		}
+	}
+	digest() {
+		if (this.digested) throw new Error("SHA-1 digest has already been finalized");
+		this.digested = true;
+		const bitLengthHigh = Math.floor(this.bytesProcessed / 536870912);
+		const bitLengthLow = this.bytesProcessed << 3 >>> 0;
+		this.block[this.blockLength] = 128;
+		this.blockLength++;
+		if (this.blockLength > 56) {
+			this.block.fill(0, this.blockLength, 64);
+			this.processBlock(this.block, 0);
+			this.blockLength = 0;
+		}
+		this.block.fill(0, this.blockLength, 56);
+		this.writeUint32(56, bitLengthHigh);
+		this.writeUint32(60, bitLengthLow);
+		this.processBlock(this.block, 0);
+		return wordToHex(this.h0) + wordToHex(this.h1) + wordToHex(this.h2) + wordToHex(this.h3) + wordToHex(this.h4);
+	}
+	writeUint32(offset, value) {
+		this.block[offset] = value >>> 24 & 255;
+		this.block[offset + 1] = value >>> 16 & 255;
+		this.block[offset + 2] = value >>> 8 & 255;
+		this.block[offset + 3] = value & 255;
+	}
+	processBlock(block, offset) {
+		const words = this.words;
+		for (let i = 0; i < 16; i++) {
+			const j = offset + i * 4;
+			words[i] = (block[j] ?? 0) << 24 | (block[j + 1] ?? 0) << 16 | (block[j + 2] ?? 0) << 8 | (block[j + 3] ?? 0);
+		}
+		for (let i = 16; i < 80; i++) words[i] = rotateLeft((words[i - 3] ?? 0) ^ (words[i - 8] ?? 0) ^ (words[i - 14] ?? 0) ^ (words[i - 16] ?? 0), 1);
+		let a = this.h0;
+		let b = this.h1;
+		let c = this.h2;
+		let d = this.h3;
+		let e = this.h4;
+		for (let i = 0; i < 80; i++) {
+			let f;
+			let k;
+			if (i < 20) {
+				f = b & c | ~b & d;
+				k = 1518500249;
+			} else if (i < 40) {
+				f = b ^ c ^ d;
+				k = 1859775393;
+			} else if (i < 60) {
+				f = b & c | b & d | c & d;
+				k = 2400959708;
+			} else {
+				f = b ^ c ^ d;
+				k = 3395469782;
+			}
+			const temp = rotateLeft(a, 5) + f + e + k + (words[i] ?? 0) >>> 0;
+			e = d;
+			d = c;
+			c = rotateLeft(b, 30);
+			b = a;
+			a = temp;
+		}
+		this.h0 = this.h0 + a >>> 0;
+		this.h1 = this.h1 + b >>> 0;
+		this.h2 = this.h2 + c >>> 0;
+		this.h3 = this.h3 + d >>> 0;
+		this.h4 = this.h4 + e >>> 0;
+	}
+};
+function rotateLeft(value, bits) {
+	return (value << bits | value >>> 32 - bits) >>> 0;
+}
+function wordToHex(word) {
+	return word.toString(16).padStart(8, "0");
+}
+/* v8 ignore stop */
+/**
+* Compute the SHA-1 hex digest of a complete byte array in one shot.
+* @param data - The byte array to hash.
+*
+* @returns The lowercase hex-encoded SHA-1 digest of the input.
+*/
+async function sha1Hex(data) {
+	const factory = await getNodeCreateHash();
+	if (factory) {
+		const h = factory("sha1");
+		h.update(data);
+		return h.digest("hex");
+	}
+	/* v8 ignore start -- WebCrypto fallback, only reachable when node:crypto is unavailable */
+	const hashBuffer = await crypto.subtle.digest("SHA-1", arrayBufferFor(data));
+	return hexEncode(new Uint8Array(hashBuffer));
+	/* v8 ignore stop */
+}
+//#endregion
 
 
+//# sourceMappingURL=hash.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/sha1.js
+//#region src/util/sha1.ts
+var sha1HexPattern = /^[0-9a-f]{40}$/i;
+/**
+* Returns whether a value is a verifiable 40-character hexadecimal SHA-1 digest.
+*
+* @param sha1 - SHA-1 value, or null/undefined when unavailable.
+*
+* @returns True when the value is a 40-character hexadecimal SHA-1 digest.
+*/
+function isVerifiableSha1(sha1) {
+	return sha1 !== null && sha1 !== void 0 && sha1HexPattern.test(sha1);
+}
+/**
+* Normalizes a verifiable SHA-1 digest to lowercase.
+*
+* @param sha1 - SHA-1 value, or null/undefined when unavailable.
+*
+* @returns A lowercase SHA-1 digest, or null when the value is not verifiable.
+*/
+function normalizeVerifiableSha1(sha1) {
+	return isVerifiableSha1(sha1) ? sha1.toLowerCase() : null;
+}
+//#endregion
+
+
+//# sourceMappingURL=sha1.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/checksum.js
+
+
+
+//#region src/download/checksum.ts
+/**
+* Client-side checksum helpers for download streams.
+*
+* B2 sends `X-Bz-Content-Sha1` on download responses when a whole-file
+* checksum is available. These helpers verify streamed bytes against that
+* header without buffering the full response in memory.
+*
+* @packageDocumentation
+*/
+/**
+* Builds the typed error used when downloaded bytes fail SHA-1 verification.
+*
+* @param expectedSha1 - SHA-1 digest advertised by the download response.
+* @param actualSha1 - SHA-1 digest computed from the downloaded bytes.
+*
+* @returns A typed checksum mismatch error.
+*/
+function createDownloadChecksumMismatchError(expectedSha1, actualSha1) {
+	return new ChecksumMismatchError({
+		status: 400,
+		code: "bad_sha1_checksum",
+		message: `Downloaded content SHA-1 mismatch: expected ${expectedSha1.toLowerCase()}, got ${actualSha1.toLowerCase()}`
+	});
+}
+/**
+* Throws when a computed download SHA-1 does not match the expected value.
+*
+* @param expectedSha1 - SHA-1 digest advertised by the download response.
+* @param actualSha1 - SHA-1 digest computed from the downloaded bytes.
+*
+* @throws ChecksumMismatchError when the two digests differ.
+*/
+function assertDownloadSha1(expectedSha1, actualSha1) {
+	if (actualSha1.toLowerCase() !== expectedSha1.toLowerCase()) throw createDownloadChecksumMismatchError(expectedSha1, actualSha1);
+}
+/**
+* Throws when two range responses disagree about the expected whole-file SHA-1.
+*
+* @param expectedSha1 - The first range's verifiable SHA-1, or null when unavailable.
+* @param actualSha1 - The current range's verifiable SHA-1, or null when unavailable.
+*
+* @throws ChecksumMismatchError when the two header states differ.
+*/
+function assertDownloadSha1HeaderAgreement(expectedSha1, actualSha1) {
+	if (expectedSha1 === actualSha1) return;
+	throw new ChecksumMismatchError({
+		status: 400,
+		code: "bad_sha1_checksum",
+		message: `Downloaded content SHA-1 header mismatch: expected ${formatSha1ForMessage(expectedSha1)}, got ${formatSha1ForMessage(actualSha1)}`
+	});
+}
+/**
+* Wraps a download stream with whole-body SHA-1 verification.
+*
+* If B2 did not provide a verifiable whole-file SHA-1 (for example,
+* multipart-finished files report `none`), the original stream is returned.
+*
+* @param body - Download response body.
+* @param expectedSha1 - Normalized SHA-1 header value, or null when unavailable.
+*
+* @returns A stream that emits the same bytes and errors on checksum mismatch.
+*/
+function verifyDownloadStream(body, expectedSha1) {
+	if (!isVerifiableSha1(expectedSha1)) return body;
+	const sha1 = new IncrementalSha1();
+	const transform = new TransformStream({
+		async transform(chunk, controller) {
+			await sha1.update(chunk);
+			controller.enqueue(chunk);
+		},
+		async flush() {
+			assertDownloadSha1(expectedSha1, await sha1.digest());
+		}
+	});
+	return body.pipeThrough(transform);
+}
+function formatSha1ForMessage(sha1) {
+	return sha1 === null ? "missing or unverifiable" : sha1.toLowerCase();
+}
+//#endregion
+
+
+//# sourceMappingURL=checksum.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/single.js
+
+
+
+
+
+
+//#region src/download/single.ts
+/**
+* Downloads a file by its unique ID in a single HTTP request.
+*
+* Returns a streaming body suitable for small-to-medium files. For large files
+* that benefit from concurrent ranged fetches, use
+* {@link createParallelDownloadStream} instead.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param options - Download parameters.
+*
+* @returns Parsed headers and a readable stream of file bytes.
+*/
 async function downloadById(raw, accountInfo, options) {
-  const resp = await raw.downloadFileById(
-    accountInfo.getDownloadUrl(),
-    accountInfo.getAuthToken(),
-    options.fileId,
-    toRawDownloadOptions(options)
-  );
-  const headers = extractDownloadHeaders(resp.headers);
-  return {
-    headers,
-    // HEAD requests legitimately have no body; return an empty stream so the
-    // result shape stays consistent.
-    body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress)
-  };
-}
+	const resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.fileId, toRawDownloadOptions(options));
+	const headers = extractDownloadHeaders(resp.headers);
+	return {
+		headers,
+		body: prepareDownloadBody(resp.body ?? emptyStream(), headers, options)
+	};
+}
+/**
+* Downloads a file by bucket name and file path in a single HTTP request.
+*
+* Returns a streaming body suitable for small-to-medium files. For large files
+* that benefit from concurrent ranged fetches, use
+* {@link createParallelDownloadStream} instead.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param options - Download parameters.
+*
+* @returns Parsed headers and a readable stream of file bytes.
+*/
 async function downloadByName(raw, accountInfo, options) {
-  const resp = await raw.downloadFileByName(
-    accountInfo.getDownloadUrl(),
-    accountInfo.getAuthToken(),
-    options.bucketName,
-    options.fileName,
-    toRawDownloadOptions(options)
-  );
-  const headers = extractDownloadHeaders(resp.headers);
-  return {
-    headers,
-    body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress)
-  };
-}
+	const resp = await raw.downloadFileByName(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.bucketName, options.fileName, toRawDownloadOptions(options));
+	const headers = extractDownloadHeaders(resp.headers);
+	return {
+		headers,
+		body: prepareDownloadBody(resp.body ?? emptyStream(), headers, options)
+	};
+}
+/**
+* Issues a HEAD-by-ID request and returns parsed headers only. Drains
+* the (logically empty) response body internally so callers don't have
+* to remember to `body.cancel()` themselves.
+*
+* Prefer this over `downloadById({ method: 'HEAD' })` — same wire-level
+* effect, but the caller-facing result has no `body` field at all so
+* there's nothing to clean up.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param options - HEAD parameters (file ID + the same response-header
+*   overrides and abort signal that `downloadById` accepts).
+*
+* @returns Parsed download headers (no body field).
+*/
 async function headById(raw, accountInfo, options) {
-  const resp = await raw.downloadFileById(
-    accountInfo.getDownloadUrl(),
-    accountInfo.getAuthToken(),
-    options.fileId,
-    { ...toRawDownloadOptions(options), method: "HEAD" }
-  );
-  if (resp.body !== null) {
-    const body = resp.body;
-    await bestEffort(() => body.cancel());
-  }
-  return { headers: extractDownloadHeaders(resp.headers) };
-}
+	const resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.fileId, {
+		...toRawDownloadOptions(options),
+		method: "HEAD"
+	});
+	if (resp.body !== null) {
+		const body = resp.body;
+		await bestEffort(() => body.cancel());
+	}
+	return { headers: extractDownloadHeaders(resp.headers) };
+}
+/**
+* Issues a HEAD-by-name request and returns parsed headers only. Drains
+* the (logically empty) response body internally so callers don't have
+* to remember to `body.cancel()` themselves.
+*
+* Prefer this over `downloadByName({ method: 'HEAD' })` — same wire-level
+* effect, but the caller-facing result has no `body` field at all so
+* there's nothing to clean up.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param options - HEAD parameters (bucket + file name + the same
+*   response-header overrides and abort signal that `downloadByName`
+*   accepts).
+*
+* @returns Parsed download headers (no body field).
+*/
 async function headByName(raw, accountInfo, options) {
-  const resp = await raw.downloadFileByName(
-    accountInfo.getDownloadUrl(),
-    accountInfo.getAuthToken(),
-    options.bucketName,
-    options.fileName,
-    { ...toRawDownloadOptions(options), method: "HEAD" }
-  );
-  if (resp.body !== null) {
-    const body = resp.body;
-    await bestEffort(() => body.cancel());
-  }
-  return { headers: extractDownloadHeaders(resp.headers) };
-}
+	const resp = await raw.downloadFileByName(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.bucketName, options.fileName, {
+		...toRawDownloadOptions(options),
+		method: "HEAD"
+	});
+	if (resp.body !== null) {
+		const body = resp.body;
+		await bestEffort(() => body.cancel());
+	}
+	return { headers: extractDownloadHeaders(resp.headers) };
+}
+/**
+* Translates the public download-options shape into the raw client's
+* {@link DownloadFileOptions}, dropping the request-target fields (`fileId`,
+* `bucketName`, `fileName`) that don't apply at the transport layer.
+*
+* @param options - Caller-supplied download options.
+*
+* @returns The raw transport-layer options.
+*/
 function toRawDownloadOptions(options) {
-  return {
-    ...options.method !== void 0 ? { method: options.method } : {},
-    ...options.range !== void 0 ? { range: options.range } : {},
-    ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},
-    ...options.b2ContentDisposition !== void 0 ? { b2ContentDisposition: options.b2ContentDisposition } : {},
-    ...options.b2ContentLanguage !== void 0 ? { b2ContentLanguage: options.b2ContentLanguage } : {},
-    ...options.b2ContentEncoding !== void 0 ? { b2ContentEncoding: options.b2ContentEncoding } : {},
-    ...options.b2ContentType !== void 0 ? { b2ContentType: options.b2ContentType } : {},
-    ...options.b2CacheControl !== void 0 ? { b2CacheControl: options.b2CacheControl } : {},
-    ...options.b2Expires !== void 0 ? { b2Expires: options.b2Expires } : {},
-    ...options.signal !== void 0 ? { signal: options.signal } : {}
-  };
-}
+	return {
+		...options.method !== void 0 ? { method: options.method } : {},
+		...options.range !== void 0 ? { range: options.range } : {},
+		...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},
+		...options.b2ContentDisposition !== void 0 ? { b2ContentDisposition: options.b2ContentDisposition } : {},
+		...options.b2ContentLanguage !== void 0 ? { b2ContentLanguage: options.b2ContentLanguage } : {},
+		...options.b2ContentEncoding !== void 0 ? { b2ContentEncoding: options.b2ContentEncoding } : {},
+		...options.b2ContentType !== void 0 ? { b2ContentType: options.b2ContentType } : {},
+		...options.b2CacheControl !== void 0 ? { b2CacheControl: options.b2CacheControl } : {},
+		...options.b2Expires !== void 0 ? { b2Expires: options.b2Expires } : {},
+		...options.signal !== void 0 ? { signal: options.signal } : {}
+	};
+}
+/**
+* Builds an immediately-closed empty ReadableStream. Used as the body of a
+* HEAD download response so callers always get a stream they can `pipeTo`.
+*
+* @returns A ReadableStream that yields zero bytes and immediately closes.
+*/
 function emptyStream() {
-  return new ReadableStream({
-    start(controller) {
-      controller.close();
-    }
-  });
-}
+	return new ReadableStream({ start(controller) {
+		controller.close();
+	} });
+}
+/**
+* Applies stream wrappers common to single-request downloads.
+*
+* Full-body GET downloads are checksum-verified when B2 supplies a real
+* whole-file SHA-1. HEAD requests and ranged GETs are skipped because the
+* response body is empty or partial while `X-Bz-Content-Sha1` describes the
+* full file version.
+*
+* @param body - Download response body.
+* @param headers - Parsed download headers.
+* @param options - Caller-supplied download options.
+*
+* @returns A stream wrapped for checksum verification and progress reporting.
+*/
+function prepareDownloadBody(body, headers, options) {
+	return instrumentProgress(options.method !== "HEAD" && options.range === void 0 ? verifyDownloadStream(body, headers.contentSha1) : body, headers.contentLength, options.onProgress);
+}
+/**
+* Wraps a body stream with a `TransformStream` that increments a
+* {@link ProgressTracker} for each chunk and reports `partsCompleted: 1`
+* when the stream finishes.
+*
+* When `listener` is undefined the function short-circuits and returns
+* the original stream, so unobserved downloads pay no overhead.
+*
+* @param body - The download response body to wrap.
+* @param totalBytes - Expected total bytes (response `Content-Length`).
+* @param listener - Caller-supplied progress callback, or undefined.
+*
+* @returns A stream that emits the same bytes and reports progress.
+*/
 function instrumentProgress(body, totalBytes, listener) {
-  if (listener === void 0) return body;
-  const tracker = new ProgressTracker(listener, totalBytes, 1);
-  const transform = new TransformStream({
-    transform(chunk, controller) {
-      tracker.addBytes(chunk.byteLength);
-      controller.enqueue(chunk);
-    },
-    flush() {
-      tracker.completePart();
-    }
-  });
-  return body.pipeThrough(transform);
-}
+	if (listener === void 0) return body;
+	const tracker = new ProgressTracker(listener, totalBytes, 1);
+	const transform = new TransformStream({
+		transform(chunk, controller) {
+			tracker.addBytes(chunk.byteLength);
+			controller.enqueue(chunk);
+		},
+		flush() {
+			tracker.completePart();
+		}
+	});
+	return body.pipeThrough(transform);
+}
+/**
+* Extracts B2-specific download headers into a structured object.
+* @param headers - The HTTP response headers from the download.
+*
+* @returns The parsed download metadata.
+*/
 function extractDownloadHeaders(headers) {
-  const fileInfo = parseFileInfoHeaders(headers);
-  return {
-    contentType: headers.get("Content-Type") ?? "application/octet-stream",
-    contentLength: Number.parseInt(headers.get("Content-Length") ?? "0", 10),
-    // B2 sends the literal `'none'` for multipart-finished files; collapse
-    // to `null` so the typed `string | null` actually means "no SHA-1".
-    contentSha1: normalizeSha1(headers.get("X-Bz-Content-Sha1")),
-    fileId: fileId(headers.get("X-Bz-File-Id") ?? ""),
-    fileName: decodeURIComponent(headers.get("X-Bz-File-Name") ?? ""),
-    fileInfo,
-    uploadTimestamp: Number.parseInt(headers.get("X-Bz-Upload-Timestamp") ?? "0", 10)
-  };
+	const fileInfo = parseFileInfoHeaders(headers);
+	return {
+		contentType: headers.get("Content-Type") ?? "application/octet-stream",
+		contentLength: Number.parseInt(headers.get("Content-Length") ?? "0", 10),
+		contentSha1: normalizeSha1(headers.get("X-Bz-Content-Sha1")),
+		fileId: fileId(headers.get("X-Bz-File-Id") ?? ""),
+		fileName: decodeURIComponent(headers.get("X-Bz-File-Name") ?? ""),
+		fileInfo,
+		uploadTimestamp: Number.parseInt(headers.get("X-Bz-Upload-Timestamp") ?? "0", 10)
+	};
 }
+//#endregion
 
-//# sourceMappingURL=single.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/retry.js
-const DEFAULT_RETRY_OPTIONS = {
-  maxRetries: 5,
-  maxRetryDelayMs: 64e3,
-  initialRetryDelayMs: 1e3
+//# sourceMappingURL=single.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/internal/upload-retry-options.js
+//#region src/internal/upload-retry-options.ts
+/**
+* Merges client upload retry defaults with a per-call override.
+* @param defaults - Resolved client upload retry defaults.
+* @param override - Per-call retry option overrides, if any.
+*
+* @returns Retry options for one high-level upload operation.
+*
+* @internal
+*/
+function mergeUploadRetryOptions(defaults, override) {
+	if (override === void 0) return defaults;
+	return {
+		...defaults,
+		...override
+	};
+}
+//#endregion
+
+
+//# sourceMappingURL=upload-retry-options.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/source.js
+
+
+
+//#region src/streams/source.ts
+var READABLE_STREAM_SIZE_REQUIRED_ERROR = "size is required when using a ReadableStream as input.";
+var FORWARD_ONLY_SIZE_REQUIRED_ERROR = "size is required when using a forward-only content source as input.";
+var STREAM_SOURCE_ENDED_EARLY_ERROR = "StreamSource ended before the advertised byte count.";
+var STREAM_SOURCE_TOO_MANY_BYTES_ERROR = "StreamSource emitted more bytes than the advertised byte count.";
+var STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR = "StreamSource emitted too many empty chunks without data.";
+/** Maximum consecutive empty chunks tolerated from a forward-only stream. */
+var MAX_EMPTY_STREAM_CHUNKS = 1024;
+function asyncIterableToReadableStream(iterable) {
+	const iterator = iterable[Symbol.asyncIterator]();
+	return new ReadableStream({
+		async pull(controller) {
+			try {
+				const { done, value } = await iterator.next();
+				if (done === true) {
+					controller.close();
+					return;
+				}
+				if (!(value instanceof Uint8Array)) throw new TypeError("Async iterable content sources must yield Uint8Array chunks.");
+				controller.enqueue(value);
+			} catch (err) {
+				/* v8 ignore next -- Iterator-return failure must not mask the pull error. */
+				await returnAsyncIteratorBestEffort(iterator);
+				throw err;
+			}
+		},
+		async cancel(reason) {
+			await returnAsyncIteratorBestEffort(iterator, reason);
+		}
+	});
+}
+async function returnAsyncIteratorBestEffort(iterator, reason) {
+	try {
+		await iterator.return?.(reason);
+	} catch {}
+}
+function isAsyncIterable(input) {
+	return typeof input === "object" && input !== null && Symbol.asyncIterator in input && typeof input[Symbol.asyncIterator] === "function";
+}
+function isReadableStream(input) {
+	return typeof input === "object" && input !== null && typeof input.getReader === "function";
+}
+/** ContentSource backed by a Blob or File. */
+var BlobSource = class BlobSource {
+	blob;
+	/** {@inheritDoc} */
+	size;
+	/** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */
+	canSlice = true;
+	/**
+	* Create a BlobSource wrapping the given Blob.
+	* @param blob - The Blob or File to use as the underlying content.
+	*/
+	constructor(blob) {
+		this.blob = blob;
+		this.size = blob.size;
+	}
+	/**
+	* Return a new BlobSource covering the specified byte range.
+	* @param start - The zero-based byte offset to begin the slice.
+	* @param end - The exclusive byte offset where the slice ends.
+	*
+	* @returns A new ContentSource representing the requested sub-range.
+	*/
+	slice(start, end) {
+		return new BlobSource(this.blob.slice(start, end));
+	}
+	/**
+	* Open the Blob content as a ReadableStream.
+	* @returns A ReadableStream of the Blob bytes.
+	*/
+	stream() {
+		return this.blob.stream();
+	}
+	/**
+	* Read the entire Blob content into an ArrayBuffer.
+	* @param options - Optional abort signal used while reading.
+	*
+	* @returns A promise that resolves with the full content as an ArrayBuffer.
+	*/
+	async toArrayBuffer(options = {}) {
+		options.signal?.throwIfAborted();
+		if (options.signal === void 0) return this.blob.arrayBuffer();
+		return arrayBufferFor(await collectStream(this.stream(), options));
+	}
 };
-function computeBackoff(attempt, options, retryAfter) {
-  if (retryAfter !== void 0 && retryAfter > 0) {
-    return Math.min(retryAfter * 1e3, options.maxRetryDelayMs);
-  }
-  const base = options.initialRetryDelayMs * 2 ** attempt;
-  const jitter = Math.random() * base * 0.5;
-  return Math.min(base + jitter, options.maxRetryDelayMs);
-}
-function sleep(ms, signal) {
-  return new Promise((resolve, reject) => {
-    if (signal?.aborted) {
-      reject(signal.reason ?? new DOMException("Aborted", "AbortError"));
-      return;
-    }
-    const timer = setTimeout(resolve, ms);
-    signal?.addEventListener(
-      "abort",
-      () => {
-        clearTimeout(timer);
-        reject(signal.reason ?? new DOMException("Aborted", "AbortError"));
-      },
-      { once: true }
-    );
-  });
+/** ContentSource backed by a Uint8Array buffer. */
+var BufferSource = class BufferSource {
+	buffer;
+	/** {@inheritDoc} */
+	size;
+	/** Random-access: the entire payload lives in memory. */
+	canSlice = true;
+	/**
+	* Create a BufferSource wrapping the given Uint8Array.
+	* @param buffer - The byte buffer to use as the underlying content.
+	*/
+	constructor(buffer) {
+		this.buffer = buffer;
+		this.size = buffer.byteLength;
+	}
+	/**
+	* Return a new BufferSource covering the specified byte range.
+	* @param start - The zero-based byte offset to begin the slice.
+	* @param end - The exclusive byte offset where the slice ends.
+	*
+	* @returns A new ContentSource representing the requested sub-range.
+	*/
+	slice(start, end) {
+		return new BufferSource(this.buffer.slice(start, end));
+	}
+	/**
+	* Open the buffer content as a ReadableStream.
+	* @returns A ReadableStream that emits the buffer bytes in a single chunk.
+	*/
+	stream() {
+		const buffer = this.buffer;
+		return new ReadableStream({ start(controller) {
+			controller.enqueue(buffer);
+			controller.close();
+		} });
+	}
+	/**
+	* Read the entire buffer content into an ArrayBuffer.
+	* @param options - Optional abort signal checked before returning bytes.
+	*
+	* @returns A promise that resolves with the full content as an ArrayBuffer.
+	*/
+	async toArrayBuffer(options = {}) {
+		options.signal?.throwIfAborted();
+		return arrayBufferFor(this.buffer);
+	}
+};
+/** ContentSource backed by a ReadableStream. Can only be consumed once and does not support slicing. */
+var StreamSource = class {
+	readable;
+	/** {@inheritDoc} */
+	size;
+	/**
+	* Forward-only: ReadableStreams cannot be repositioned, so multipart
+	* uploads must take the sequential path. See the interface comment on
+	* `canSlice` for what the engine does with this flag.
+	*/
+	canSlice = false;
+	/** Whether the stream has already been read. */
+	consumed = false;
+	/**
+	* Create a StreamSource wrapping the given ReadableStream with a known byte size.
+	* @param readable - The ReadableStream to wrap as a content source.
+	* @param size - The total number of bytes the stream will produce.
+	*/
+	constructor(readable, size) {
+		this.readable = readable;
+		validateStreamSourceSize(size);
+		this.size = size;
+	}
+	/**
+	* Always throws because streams cannot be sliced. Buffer the stream first.
+	*
+	* @throws If slicing is attempted on a stream-backed source.
+	*/
+	slice() {
+		throw new Error("StreamSource does not support slicing. Buffer the stream first.");
+	}
+	/**
+	* Open the underlying ReadableStream. Can only be called once.
+	* @returns The underlying ReadableStream of bytes.
+	*
+	* @throws If the stream has already been consumed.
+	*/
+	stream() {
+		if (this.consumed) throw new Error("StreamSource can only be consumed once.");
+		this.consumed = true;
+		return this.readable;
+	}
+	/**
+	* Read the entire stream into an ArrayBuffer.
+	* @param options - Optional abort signal used while reading.
+	*
+	* @returns A promise that resolves with the full content as an ArrayBuffer.
+	*/
+	async toArrayBuffer(options = {}) {
+		return (await collectStreamExactly(this.stream(), this.size, options.signal)).buffer;
+	}
+};
+function validateStreamSourceSize(size) {
+	if (!Number.isFinite(size) || !Number.isInteger(size) || size < 0) throw new RangeError("StreamSource size must be a non-negative finite integer.");
+}
+/**
+* Reads exactly the advertised number of bytes from a stream.
+* @param stream - Stream to consume.
+* @param expectedSize - Exact number of bytes expected from the stream.
+* @param signal - Optional abort signal for cancelling the read.
+*
+* @returns A byte array of length `expectedSize`.
+*
+* @throws If the stream emits too few bytes, too many bytes, too many empty chunks, or aborts.
+*/
+async function collectStreamExactly(stream, expectedSize, signal) {
+	const reader = stream.getReader();
+	const chunks = [];
+	let total = 0;
+	let completed = false;
+	try {
+		while (total < expectedSize) {
+			const { done, value } = await readNextNonEmptyStreamChunk(reader, STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR, signal);
+			if (done) throw new Error(STREAM_SOURCE_ENDED_EARLY_ERROR);
+			if (total + value.byteLength > expectedSize) throw new Error(STREAM_SOURCE_TOO_MANY_BYTES_ERROR);
+			chunks.push(value);
+			total += value.byteLength;
+		}
+		if (!(await readNextNonEmptyStreamChunk(reader, STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR, signal)).done) throw new Error(STREAM_SOURCE_TOO_MANY_BYTES_ERROR);
+		const result = new Uint8Array(expectedSize);
+		let offset = 0;
+		for (const chunk of chunks) {
+			result.set(chunk, offset);
+			offset += chunk.byteLength;
+		}
+		completed = true;
+		return result;
+	} finally {
+		if (!completed) cancelReaderBestEffort(reader);
+		try {
+			reader.releaseLock();
+		} catch {}
+	}
+}
+/**
+* Reads from a stream until it receives data, EOF, or too many consecutive empty chunks.
+* @param reader - Locked reader for a Uint8Array stream.
+* @param emptyChunkErrorMessage - Error message to throw when the empty-chunk limit is exceeded.
+* @param signal - Optional abort signal that cancels the reader and rejects the read.
+*
+* @returns The next non-empty chunk or EOF result.
+*/
+async function readNextNonEmptyStreamChunk(reader, emptyChunkErrorMessage, signal) {
+	let emptyChunks = 0;
+	while (true) {
+		const result = await readStreamChunk(reader, signal);
+		if (result.done || result.value.byteLength > 0) return result;
+		emptyChunks += 1;
+		if (emptyChunks > 1024) throw new Error(emptyChunkErrorMessage);
+	}
+}
+async function readStreamChunk(reader, signal) {
+	if (signal === void 0) return reader.read();
+	if (signal.aborted) {
+		const reason = signal.reason ?? new DOMException("Aborted", "AbortError");
+		cancelReaderBestEffort(reader, reason);
+		throw reason;
+	}
+	let removeAbortListener;
+	const abort = new Promise((_, reject) => {
+		const onAbort = () => {
+			const reason = signal.reason ?? new DOMException("Aborted", "AbortError");
+			cancelReaderBestEffort(reader, reason);
+			reject(reason);
+		};
+		signal.addEventListener("abort", onAbort, { once: true });
+		removeAbortListener = () => signal.removeEventListener("abort", onAbort);
+	});
+	try {
+		const result = await Promise.race([reader.read(), abort]);
+		if (signal.aborted) {
+			const reason = signal.reason ?? new DOMException("Aborted", "AbortError");
+			cancelReaderBestEffort(reader, reason);
+			throw reason;
+		}
+		return result;
+	} finally {
+		removeAbortListener?.();
+	}
+}
+function cancelReaderBestEffort(reader, reason) {
+	/* v8 ignore next -- Reader cancellation failure is deliberately best-effort. */
+	reader.cancel(reason).catch(() => {});
+}
+/** ContentSource backed by a forward-only async iterable of Uint8Array chunks. */
+var AsyncIterableSource = class extends StreamSource {
+	/**
+	* Create an AsyncIterableSource from a known-size async iterable.
+	* @param iterable - Async iterable that yields Uint8Array chunks.
+	* @param size - Total byte length the iterable will produce.
+	*/
+	constructor(iterable, size) {
+		super(asyncIterableToReadableStream(iterable), size);
+	}
+};
+/**
+* Convert a Uint8Array, Blob, ReadableStream, or async iterable into a {@link ContentSource}.
+* When passing a ReadableStream or async iterable, the `size` parameter is required.
+* @param input - The content to wrap.
+* @param size - The total byte length, required for forward-only inputs.
+*
+* @returns A ContentSource adapter for the given input.
+*
+* @throws If input is forward-only and size is not provided.
+*/
+function toContentSource(input, size) {
+	if (input instanceof Uint8Array) return new BufferSource(input);
+	if (input instanceof Blob) return new BlobSource(input);
+	if (isReadableStream(input)) {
+		if (size === void 0) throw new Error(READABLE_STREAM_SIZE_REQUIRED_ERROR);
+		return new StreamSource(input, size);
+	}
+	if (isAsyncIterable(input)) {
+		if (size === void 0) throw new Error(FORWARD_ONLY_SIZE_REQUIRED_ERROR);
+		return new AsyncIterableSource(input, size);
+	}
+	throw new TypeError("Unsupported content source input.");
 }
+//#endregion
 
-//# sourceMappingURL=retry.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/collect.js
-async function collectStream(stream) {
-  const reader = stream.getReader();
-  try {
-    const chunks = [];
-    let total = 0;
-    while (true) {
-      const { done, value } = await reader.read();
-      if (done) break;
-      chunks.push(value);
-      total += value.byteLength;
-    }
-    const result = new Uint8Array(total);
-    let offset = 0;
-    for (const chunk of chunks) {
-      result.set(chunk, offset);
-      offset += chunk.byteLength;
-    }
-    return result;
-  } finally {
-    reader.releaseLock();
-  }
-}
+//# sourceMappingURL=source.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/bucket.js
+//#region src/types/bucket.ts
+/**
+* Named constants for the bucket access level.
+*
+* The {@link BucketType} type alias is derived from the values of this
+* object, so the const is the single source of truth: adding a key here
+* automatically widens the type union.
+*
+* @example
+* ```ts
+* await client.createBucket({ bucketName: 'my-app-logs', bucketType: BucketType.AllPrivate })
+* ```
+*/
+var BucketType = {
+	/** Publicly downloadable without authentication. */
+	AllPublic: "allPublic",
+	/** Requires a valid auth token to download. */
+	AllPrivate: "allPrivate",
+	/** Internal snapshot bucket type, generally not user-created. */
+	Snapshot: "snapshot",
+	/** B2-restricted bucket (e.g., for S3-compatible workflows). */
+	Restricted: "restricted"
+};
+/**
+* Named constants for the B2 + S3 operations a CORS rule can permit.
+*
+* @example
+* ```ts
+* await bucket.update({
+*   corsRules: [{
+*     corsRuleName: 'browser-downloads',
+*     allowedOrigins: ['https://example.com'],
+*     allowedOperations: [CorsOperation.B2DownloadFileByName, CorsOperation.S3Get],
+*     allowedHeaders: null,
+*     exposeHeaders: null,
+*     maxAgeSeconds: 3600,
+*   }],
+* })
+* ```
+*/
+var CorsOperation = {
+	/** Native B2 download-by-name request. */
+	B2DownloadFileByName: "b2_download_file_by_name",
+	/** Native B2 download-by-id request. */
+	B2DownloadFileById: "b2_download_file_by_id",
+	/** Native B2 small-file upload. */
+	B2UploadFile: "b2_upload_file",
+	/** Native B2 multipart-part upload. */
+	B2UploadPart: "b2_upload_part",
+	/** S3-compatible DELETE. */
+	S3Delete: "s3_delete",
+	/** S3-compatible GET. */
+	S3Get: "s3_get",
+	/** S3-compatible HEAD. */
+	S3Head: "s3_head",
+	/** S3-compatible POST. */
+	S3Post: "s3_post",
+	/** S3-compatible PUT. */
+	S3Put: "s3_put"
+};
+/**
+* Named constants for the bucket-level Object Lock retention mode.
+*
+* Pair with {@link BucketRetentionPolicy} when setting a bucket's default
+* retention: `{ mode: BucketRetentionMode.Compliance, period: { duration: 30, unit: 'days' } }`.
+*/
+var BucketRetentionMode = {
+	/** Files cannot be deleted or modified during the retention period, even by the account owner. */
+	Compliance: "compliance",
+	/** Files cannot be deleted during retention except by callers with the `bypassGovernance` capability. */
+	Governance: "governance",
+	/** No default retention is applied to new uploads. */
+	None: "none"
+};
+//#endregion
 
-//# sourceMappingURL=collect.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/parallel.js
+//# sourceMappingURL=bucket.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/encryption.js
+//#region src/types/encryption.ts
+/** Named constants for the supported server-side encryption algorithms. */
+var EncryptionAlgorithm = { 
+/** AES with a 256-bit key. The only algorithm B2 currently supports. */
+Aes256: "AES256" };
+/**
+* Named constants for the server-side encryption mode used by a file.
+*
+* Most callers should use the {@link SSE_B2}, {@link SSE_NONE}, and
+* {@link sseCustomer} helpers below which return complete
+* {@link EncryptionSetting} objects. These constants are useful when you
+* need the bare mode discriminator (e.g., when introspecting a file's
+* current encryption setting).
+*/
+var EncryptionMode = {
+	/** B2-managed encryption keys. */
+	SseB2: "SSE-B2",
+	/** Customer-provided encryption keys. */
+	SseC: "SSE-C",
+	/** No encryption. */
+	None: "none"
+};
+/** Pre-built SSE-B2 encryption setting using AES-256. */
+var SSE_B2 = {
+	mode: "SSE-B2",
+	algorithm: "AES256"
+};
+/** Pre-built setting indicating no server-side encryption. */
+var SSE_NONE = { mode: "none" };
+/**
+* Creates an SSE-C encryption setting with a customer-provided key.
+* @param customerKey - Base64-encoded 256-bit encryption key.
+* @param customerKeyMd5 - Base64-encoded MD5 digest of the key.
+*
+* @returns An SSE-C encryption setting ready to pass to upload or download calls.
+*/
+function sseCustomer(customerKey, customerKeyMd5) {
+	return {
+		mode: "SSE-C",
+		algorithm: "AES256",
+		customerKey,
+		customerKeyMd5
+	};
+}
+/**
+* Encodes raw bytes as base64 in an isomorphic way (Node Buffer fallback to btoa).
+*
+* @param bytes - The raw bytes to encode.
+*
+* @returns The base64-encoded string.
+*/
+function bytesToBase64(bytes) {
+	const g = globalThis;
+	if (g.Buffer) return g.Buffer.from(bytes).toString("base64");
+	let binary = "";
+	for (const b of bytes) binary += String.fromCharCode(b);
+	return btoa(binary);
+}
+/**
+* Computes the MD5 digest of the given bytes as a base64 string. Prefers
+* `node:crypto` for native speed when available; falls back to a pure-JS
+* implementation in browser / edge runtimes because WebCrypto's
+* `crypto.subtle.digest` deliberately does not support MD5.
+*
+* MD5 is used here only for SSE-C key integrity (matching the B2 wire
+* protocol). It is **not** a security boundary; the customer key itself is
+* the secret. Bundling a pure-JS fallback keeps `EncryptionKey.fromBytes`
+* isomorphic.
+*
+* @param bytes - The bytes to digest.
+*
+* @returns The base64-encoded MD5 digest.
+*/
+async function md5Base64(bytes) {
+	try {
+		const { createHash } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 7598, 19));
+		if (typeof createHash !== "function") throw new Error("createHash unavailable");
+		return createHash("md5").update(bytes).digest("base64");
+	} catch {
+		return bytesToBase64(md5Bytes(bytes));
+	}
+}
+/**
+* Pure-JS MD5 implementation per RFC 1321. Returns the 16-byte digest of the
+* input. Used as a browser fallback for SSE-C key MD5 computation; not
+* intended for security-sensitive purposes (MD5 is broken cryptographically).
+*
+* @param data - The bytes to hash.
+*
+* @returns The 16-byte MD5 digest.
+*/
+function md5Bytes(data) {
+	const originalBitLength = data.byteLength * 8;
+	const padLength = (data.byteLength + 8 >>> 6) + 1;
+	const padded = new Uint8Array(padLength * 64);
+	padded.set(data);
+	padded[data.byteLength] = 128;
+	const lowBits = originalBitLength >>> 0;
+	const highBits = Math.floor(originalBitLength / 4294967296) >>> 0;
+	const lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8);
+	lengthView.setUint32(0, lowBits, true);
+	lengthView.setUint32(4, highBits, true);
+	const s = [
+		7,
+		12,
+		17,
+		22,
+		7,
+		12,
+		17,
+		22,
+		7,
+		12,
+		17,
+		22,
+		7,
+		12,
+		17,
+		22,
+		5,
+		9,
+		14,
+		20,
+		5,
+		9,
+		14,
+		20,
+		5,
+		9,
+		14,
+		20,
+		5,
+		9,
+		14,
+		20,
+		4,
+		11,
+		16,
+		23,
+		4,
+		11,
+		16,
+		23,
+		4,
+		11,
+		16,
+		23,
+		4,
+		11,
+		16,
+		23,
+		6,
+		10,
+		15,
+		21,
+		6,
+		10,
+		15,
+		21,
+		6,
+		10,
+		15,
+		21,
+		6,
+		10,
+		15,
+		21
+	];
+	const k = new Uint32Array([
+		3614090360,
+		3905402710,
+		606105819,
+		3250441966,
+		4118548399,
+		1200080426,
+		2821735955,
+		4249261313,
+		1770035416,
+		2336552879,
+		4294925233,
+		2304563134,
+		1804603682,
+		4254626195,
+		2792965006,
+		1236535329,
+		4129170786,
+		3225465664,
+		643717713,
+		3921069994,
+		3593408605,
+		38016083,
+		3634488961,
+		3889429448,
+		568446438,
+		3275163606,
+		4107603335,
+		1163531501,
+		2850285829,
+		4243563512,
+		1735328473,
+		2368359562,
+		4294588738,
+		2272392833,
+		1839030562,
+		4259657740,
+		2763975236,
+		1272893353,
+		4139469664,
+		3200236656,
+		681279174,
+		3936430074,
+		3572445317,
+		76029189,
+		3654602809,
+		3873151461,
+		530742520,
+		3299628645,
+		4096336452,
+		1126891415,
+		2878612391,
+		4237533241,
+		1700485571,
+		2399980690,
+		4293915773,
+		2240044497,
+		1873313359,
+		4264355552,
+		2734768916,
+		1309151649,
+		4149444226,
+		3174756917,
+		718787259,
+		3951481745
+	]);
+	let a0 = 1732584193;
+	let b0 = 4023233417;
+	let c0 = 2562383102;
+	let d0 = 271733878;
+	const m = /* @__PURE__ */ new Uint32Array(16);
+	const view = new DataView(padded.buffer);
+	for (let block = 0; block < padded.byteLength; block += 64) {
+		for (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true);
+		let A = a0;
+		let B = b0;
+		let C = c0;
+		let D = d0;
+		for (let i = 0; i < 64; i++) {
+			let f;
+			let g;
+			if (i < 16) {
+				f = B & C | ~B & D;
+				g = i;
+			} else if (i < 32) {
+				f = D & B | ~D & C;
+				g = (5 * i + 1) % 16;
+			} else if (i < 48) {
+				f = B ^ C ^ D;
+				g = (3 * i + 5) % 16;
+			} else {
+				f = C ^ (B | ~D);
+				g = 7 * i % 16;
+			}
+			const temp = D;
+			D = C;
+			C = B;
+			const sum = A + f + (k[i] ?? 0) + (m[g] ?? 0) >>> 0;
+			const shift = s[i] ?? 0;
+			const rotated = (sum << shift | sum >>> 32 - shift) >>> 0;
+			B = B + rotated >>> 0;
+			A = temp;
+		}
+		a0 = a0 + A >>> 0;
+		b0 = b0 + B >>> 0;
+		c0 = c0 + C >>> 0;
+		d0 = d0 + D >>> 0;
+	}
+	const out = /* @__PURE__ */ new Uint8Array(16);
+	const outView = new DataView(out.buffer);
+	outView.setUint32(0, a0, true);
+	outView.setUint32(4, b0, true);
+	outView.setUint32(8, c0, true);
+	outView.setUint32(12, d0, true);
+	return out;
+}
+var KEY_REDACTED = "[redacted SSE-C key]";
+/**
+* Safe wrapper around an SSE-C customer key. Hides the key bytes from
+* `JSON.stringify`, `console.log`, and Node's `util.inspect`. Use {@link EncryptionKey.fromBytes}
+* to construct one from a raw 32-byte key; the MD5 digest is computed internally.
+*/
+var EncryptionKey = class EncryptionKey {
+	/** Encryption mode discriminant. Always `'SSE-C'` for this class. */
+	mode = "SSE-C";
+	/** Encryption algorithm. B2's S3-compatible API only supports AES-256. */
+	algorithm = "AES256";
+	/** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */
+	customerKey;
+	/** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */
+	customerKeyMd5;
+	/**
+	* Internal constructor. Use {@link EncryptionKey.fromBytes} or
+	* {@link EncryptionKey.fromBase64} instead.
+	*
+	* @param customerKey - Base64-encoded 256-bit encryption key.
+	* @param customerKeyMd5 - Base64-encoded MD5 digest of the key.
+	*
+	* @internal
+	*/
+	constructor(customerKey, customerKeyMd5) {
+		this.customerKey = customerKey;
+		this.customerKeyMd5 = customerKeyMd5;
+	}
+	/**
+	* Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the
+	* required base64 MD5 digest internally.
+	*
+	* @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes.
+	*
+	* @returns A safely-wrapped EncryptionKey ready for upload/download.
+	*
+	* @throws If the key is not exactly 32 bytes.
+	*/
+	static async fromBytes(rawKey) {
+		if (rawKey.byteLength !== 32) throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`);
+		const customerKey = bytesToBase64(rawKey);
+		const customerKeyMd5 = await md5Base64(rawKey);
+		return new EncryptionKey(customerKey, customerKeyMd5);
+	}
+	/**
+	* Builds an EncryptionKey from precomputed base64 strings. Use this in
+	* environments where MD5 must be computed externally (e.g., browsers).
+	*
+	* @param customerKey - Base64-encoded 256-bit encryption key.
+	* @param customerKeyMd5 - Base64-encoded MD5 digest of the key.
+	*
+	* @returns A safely-wrapped EncryptionKey ready for upload/download.
+	*/
+	static fromBase64(customerKey, customerKeyMd5) {
+		return new EncryptionKey(customerKey, customerKeyMd5);
+	}
+	/**
+	* Hides the key bytes from `JSON.stringify`.
+	*
+	* @returns A redacted shape: same mode and algorithm, but the key and MD5
+	*   replaced with a placeholder string.
+	*/
+	toJSON() {
+		return {
+			mode: this.mode,
+			algorithm: this.algorithm,
+			customerKey: KEY_REDACTED,
+			customerKeyMd5: KEY_REDACTED
+		};
+	}
+	/**
+	* Hides the key bytes from default `toString()`.
+	*
+	* @returns A short opaque label indicating this is an SSE-C key.
+	*/
+	toString() {
+		return `[EncryptionKey SSE-C ${KEY_REDACTED}]`;
+	}
+	/**
+	* Hides the key bytes from Node's `util.inspect` (and therefore `console.log`).
+	*
+	* @returns A short opaque label indicating this is an SSE-C key.
+	*/
+	[Symbol.for("nodejs.util.inspect.custom")]() {
+		return this.toString();
+	}
+};
+//#endregion
 
 
+//# sourceMappingURL=encryption.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/resume.js
+
+
+
+
+//#region src/upload/resume.ts
+/** Compatibility-only file-info key read from legacy unfinished uploads; new uploads do not write it. */
+var RESUME_SOURCE_SIZE_INFO_KEY = "b2_sdk_resume_source_size";
+/** Compatibility-only file-info key read from legacy unfinished uploads; new uploads do not write it. */
+var RESUME_PART_SIZE_INFO_KEY = "b2_sdk_resume_part_size";
+var DEFAULT_MAX_RESUME_LIST_PAGES = 10;
+var DEFAULT_MAX_RESUME_PART_CANDIDATES = 25;
+var DEFAULT_MAX_RESUME_PART_PAGES = 10;
+var LIST_PARTS_PAGE_SIZE = 100;
+/**
+* Finds an unfinished large file matching the given bucket and file name.
+* Returns `null` when no compatible candidate exists.
+*
+* With criteria, the newest compatible candidate is selected; incompatible
+* same-name uploads are ignored and optionally reported via
+* `onCandidateRejected`.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param bucketId - Target bucket of the upload.
+* @param fileName - Destination file name of the upload.
+* @param criteria - Upload identity and option checks.
+*
+* @returns A {@link ResumeCandidate} describing the candidate and its uploaded parts, or `null`.
+*/
+async function findResumeCandidate(raw, accountInfo, bucketId, fileName, criteria) {
+	const discoverySignal = createResumeDiscoverySignal(criteria);
+	try {
+		return await findResumeCandidateWithSignal(raw, accountInfo, bucketId, fileName, criteria, discoverySignal.signal);
+	} finally {
+		discoverySignal.dispose();
+	}
+}
+async function findResumeCandidateWithSignal(raw, accountInfo, bucketId, fileName, criteria, signal) {
+	const matches = [];
+	const maxListPages = criteria.maxListPages ?? DEFAULT_MAX_RESUME_LIST_PAGES;
+	const maxPartCandidates = criteria.maxPartCandidates ?? DEFAULT_MAX_RESUME_PART_CANDIDATES;
+	let sequence = 0;
+	let pageCount = 0;
+	const explicitResumeFileId = criteria.resumeFileId;
+	let startFileId = explicitResumeFileId;
+	let truncated = false;
+	while (pageCount < maxListPages) {
+		signal?.throwIfAborted();
+		const unfinished = await abortableRequest(raw.listUnfinishedLargeFiles(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
+			bucketId,
+			maxFileCount: explicitResumeFileId !== void 0 ? 1 : 100,
+			namePrefix: fileName,
+			...startFileId !== void 0 ? { startFileId } : {}
+		}, signal !== void 0 ? { signal } : void 0), signal);
+		pageCount++;
+		for (const file of unfinished.files) {
+			if (explicitResumeFileId !== void 0 ? file.fileId === explicitResumeFileId : file.fileName === fileName) matches.push({
+				file,
+				sequence
+			});
+			sequence++;
+		}
+		if (explicitResumeFileId !== void 0) break;
+		if (unfinished.nextFileId === null) break;
+		startFileId = unfinished.nextFileId;
+		truncated = pageCount >= maxListPages;
+	}
+	if (truncated) emitCandidateRejected(criteria, {
+		requestedFileName: fileName,
+		reason: "search-truncated"
+	});
+	matches.sort(compareNewestFirst);
+	let partCandidatesInspected = 0;
+	for (const match of matches) {
+		signal?.throwIfAborted();
+		const rejection = candidateMetadataRejectReason(match.file, fileName, criteria);
+		if (rejection !== null) {
+			notifyCandidateRejected(criteria, match.file, fileName, rejection);
+			continue;
+		}
+		if (partCandidatesInspected >= maxPartCandidates) {
+			notifyCandidateRejected(criteria, match.file, fileName, "candidate-limit");
+			break;
+		}
+		partCandidatesInspected++;
+		const fileId = largeFileId(match.file.fileId);
+		const uploadedPartsResult = await collectResumePartInfo(raw, accountInfo, fileId, {
+			maxPages: criteria.maxPartPages ?? DEFAULT_MAX_RESUME_PART_PAGES,
+			maxParts: criteria.parts.length,
+			...signal !== void 0 ? { signal } : {}
+		});
+		const uploadedParts = uploadedPartsResult.parts;
+		if (uploadedPartsResult.truncated || !uploadedPartsMatchPlan(uploadedParts, criteria.parts)) {
+			notifyCandidateRejected(criteria, match.file, fileName, "part-length-mismatch");
+			continue;
+		}
+		return {
+			fileId,
+			uploadedPartSha1s: partInfoToSha1s(uploadedParts)
+		};
+	}
+	return null;
+}
+async function collectResumePartInfo(raw, accountInfo, fileId, options) {
+	const parts = /* @__PURE__ */ new Map();
+	const maxPages = options.maxPages ?? Number.POSITIVE_INFINITY;
+	const maxParts = options.maxParts ?? Number.POSITIVE_INFINITY;
+	let startPartNumber;
+	let pageCount = 0;
+	while (pageCount < maxPages) {
+		options.signal?.throwIfAborted();
+		const remainingParts = maxParts === Number.POSITIVE_INFINITY ? void 0 : Math.max(1, Math.min(LIST_PARTS_PAGE_SIZE, maxParts - parts.size + 1));
+		const page = await abortableRequest(raw.listParts(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
+			fileId,
+			...startPartNumber !== void 0 ? { startPartNumber } : {},
+			...remainingParts !== void 0 ? { maxPartCount: remainingParts } : {}
+		}, options.signal !== void 0 ? { signal: options.signal } : void 0), options.signal);
+		pageCount++;
+		for (const part of page.parts) {
+			parts.set(part.partNumber, {
+				contentSha1: part.contentSha1,
+				contentLength: part.contentLength
+			});
+			if (parts.size > maxParts) return {
+				parts,
+				truncated: true
+			};
+		}
+		if (page.nextPartNumber === null) return {
+			parts,
+			truncated: false
+		};
+		assertAdvancingPartCursor(fileId, startPartNumber, page.nextPartNumber);
+		startPartNumber = page.nextPartNumber;
+	}
+	return {
+		parts,
+		truncated: true
+	};
+}
+function compareNewestFirst(a, b) {
+	const aTime = a.file.uploadTimestamp ?? Number.NEGATIVE_INFINITY;
+	const bTime = b.file.uploadTimestamp ?? Number.NEGATIVE_INFINITY;
+	if (aTime !== bTime) return bTime - aTime;
+	return b.sequence - a.sequence;
+}
+function candidateMetadataRejectReason(candidate, fileName, criteria) {
+	if (candidate.fileName !== fileName) return "file-name-mismatch";
+	if (criteria.contentType === "b2/x-auto" && criteria.resumeFileId === void 0 && candidate.contentType !== "b2/x-auto") return "content-type-mismatch";
+	if (criteria.contentType !== "b2/x-auto" && candidate.contentType !== criteria.contentType) return "content-type-mismatch";
+	const candidateInfo = splitResumeFileInfo(candidate.fileInfo ?? {});
+	if (!recordEquals(candidateInfo.fileInfo, criteria.fileInfo)) return "file-info-mismatch";
+	if (candidateInfo.sourceSize !== void 0 && candidateInfo.sourceSize !== String(criteria.sourceSize)) return "source-size-mismatch";
+	if (candidateInfo.partSize !== void 0 && candidateInfo.partSize !== String(criteria.partSize)) return "part-size-mismatch";
+	const encryptionRejectReason = serverSideEncryptionRejectReason(candidate.serverSideEncryption, criteria.serverSideEncryption);
+	if (encryptionRejectReason !== null) return encryptionRejectReason;
+	if (!fileRetentionMatches(candidate.fileRetention, criteria.fileRetention, criteria.defaultFileRetention, criteria.defaultFileRetentionUnreadable === true, candidate.uploadTimestamp)) return "retention-mismatch";
+	if (!legalHoldMatches(candidate.legalHold, criteria.legalHold)) return "legal-hold-mismatch";
+	return null;
+}
+function notifyCandidateRejected(criteria, candidate, requestedFileName, reason) {
+	emitCandidateRejected(criteria, {
+		fileId: largeFileId(candidate.fileId),
+		requestedFileName,
+		candidateFileName: candidate.fileName,
+		reason
+	});
+}
+function emitCandidateRejected(criteria, event) {
+	try {
+		criteria.onCandidateRejected?.(event);
+	} catch {}
+}
+function uploadedPartsMatchPlan(uploadedParts, plans) {
+	for (const [partNumber, part] of uploadedParts) {
+		const planned = plans[partNumber - 1];
+		if (planned === void 0) return false;
+		if (planned.partNumber !== partNumber) return false;
+		if (planned.length !== part.contentLength) return false;
+	}
+	return true;
+}
+function partInfoToSha1s(parts) {
+	const sha1s = /* @__PURE__ */ new Map();
+	for (const [partNumber, part] of parts) sha1s.set(partNumber, part.contentSha1);
+	return sha1s;
+}
+function recordEquals(a, b) {
+	const aKeys = Object.keys(a);
+	const bKeys = Object.keys(b);
+	if (aKeys.length !== bKeys.length) return false;
+	for (const key of aKeys) if (a[key] !== b[key]) return false;
+	return true;
+}
+function splitResumeFileInfo(fileInfo) {
+	const userFileInfo = Object.create(null);
+	let sourceSize;
+	let partSize;
+	for (const [key, value] of Object.entries(fileInfo)) if (key === "b2_sdk_resume_source_size") sourceSize = value;
+	else if (key === "b2_sdk_resume_part_size") partSize = value;
+	else userFileInfo[key] = value;
+	return {
+		fileInfo: userFileInfo,
+		...sourceSize !== void 0 ? { sourceSize } : {},
+		...partSize !== void 0 ? { partSize } : {}
+	};
+}
+function fileRetentionMatches(candidate, expected, defaultExpected, defaultUnreadable, uploadTimestamp) {
+	if (expected === void 0 && defaultUnreadable) return false;
+	if (expected === void 0 && defaultExpected !== void 0) {
+		if (defaultExpected.mode === BucketRetentionMode.None) {
+			if (candidate === void 0) return true;
+			if (!candidate.isClientAuthorizedToRead) return false;
+			return fileRetentionValueEquals(candidate.value, null);
+		}
+		if (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false;
+		return fileRetentionValueMatchesBucketDefault(candidate.value, defaultExpected, uploadTimestamp);
+	}
+	if (expected === void 0) {
+		if (candidate === void 0) return true;
+		if (!candidate.isClientAuthorizedToRead) return false;
+		return fileRetentionValueEquals(candidate.value, null);
+	}
+	if (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false;
+	return fileRetentionValueEquals(candidate.value, expected);
+}
+function fileRetentionValueMatchesBucketDefault(candidate, expected, uploadTimestamp) {
+	if (expected.period === null) return false;
+	if (candidate?.mode !== expected.mode || candidate.retainUntilTimestamp === null) return false;
+	if (uploadTimestamp === void 0) return false;
+	return candidate.retainUntilTimestamp === uploadTimestamp + retentionPeriodMillis(expected.period);
+}
+function retentionPeriodMillis(period) {
+	if (period === null) return 0;
+	return (period.unit === "days" ? period.duration : period.duration * 365) * 24 * 60 * 60 * 1e3;
+}
+function fileRetentionValueEquals(a, b) {
+	return (a?.mode ?? null) === (b?.mode ?? null) && (a?.retainUntilTimestamp ?? null) === (b?.retainUntilTimestamp ?? null);
+}
+function legalHoldMatches(candidate, expected) {
+	if (expected === void 0) {
+		if (candidate === void 0) return true;
+		if (!candidate.isClientAuthorizedToRead) return false;
+		return candidate.value === null || candidate.value === "off";
+	}
+	if (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false;
+	return candidate.value === expected;
+}
+function createResumeDiscoverySignal(criteria) {
+	if (criteria.signal !== void 0) return {
+		signal: criteria.signal,
+		dispose() {}
+	};
+	if (criteria.discoveryTimeoutMs === void 0) return { dispose() {} };
+	const timeoutMs = criteria.discoveryTimeoutMs;
+	if (timeoutMs === Number.POSITIVE_INFINITY) return { dispose() {} };
+	const controller = new AbortController();
+	const timeout = setTimeout(() => {
+		controller.abort(resumeDiscoveryTimeoutReason(timeoutMs));
+	}, Math.max(0, timeoutMs));
+	return {
+		signal: controller.signal,
+		dispose() {
+			clearTimeout(timeout);
+		}
+	};
+}
+async function abortableRequest(request, signal) {
+	if (signal === void 0) return request;
+	if (signal.aborted) throw resumeAbortReason(signal);
+	let removeAbortListener;
+	const aborted = new Promise((_resolve, reject) => {
+		const onAbort = () => reject(resumeAbortReason(signal));
+		signal.addEventListener("abort", onAbort, { once: true });
+		removeAbortListener = () => signal.removeEventListener("abort", onAbort);
+	});
+	try {
+		return await Promise.race([request, aborted]);
+	} finally {
+		removeAbortListener?.();
+		request.catch(() => {});
+	}
+}
+function resumeAbortReason(signal) {
+	return signal.reason ?? resumeAbortFallbackReason();
+}
+function resumeAbortFallbackReason() {
+	if (typeof DOMException === "function") return new DOMException("Resume discovery aborted", "AbortError");
+	const error = /* @__PURE__ */ new Error("Resume discovery aborted");
+	error.name = "AbortError";
+	return error;
+}
+function resumeDiscoveryTimeoutReason(timeoutMs) {
+	if (typeof DOMException === "function") return new DOMException(`Resume discovery timed out after ${timeoutMs} ms`, "TimeoutError");
+	const error = /* @__PURE__ */ new Error(`Resume discovery timed out after ${timeoutMs} ms`);
+	error.name = "TimeoutError";
+	return error;
+}
+function serverSideEncryptionRejectReason(candidate, expected) {
+	if (expected?.mode === EncryptionMode.SseC) return "sse-c-unsupported";
+	const actual = normalizeEncryption(candidate);
+	if (expected === void 0) {
+		if (candidate === void 0) return null;
+		if (actual === void 0) return "encryption-mismatch";
+		if (actual.mode === EncryptionMode.None) return null;
+		if (actual.mode === EncryptionMode.SseB2) return null;
+		return actual.mode === EncryptionMode.SseC ? "sse-c-unsupported" : "encryption-mismatch";
+	}
+	const normalizedExpected = normalizeEncryption(expected);
+	if (normalizedExpected?.mode === EncryptionMode.None && candidate === void 0) return null;
+	if (actual === void 0 || normalizedExpected === void 0) return "encryption-mismatch";
+	if (actual.mode !== normalizedExpected.mode) return "encryption-mismatch";
+	if (actual.mode === EncryptionMode.None) return null;
+	return actual.algorithm === normalizedExpected.algorithm ? null : "encryption-mismatch";
+}
+function normalizeEncryption(encryption) {
+	if (encryption === void 0) return void 0;
+	if (encryption.mode === null || encryption.mode === EncryptionMode.None) return { mode: EncryptionMode.None };
+	if (encryption.mode !== EncryptionMode.SseB2 && encryption.mode !== EncryptionMode.SseC) return;
+	return {
+		mode: encryption.mode,
+		algorithm: encryption.algorithm
+	};
+}
+function assertAdvancingPartCursor(fileId, previous, next) {
+	if (!Number.isInteger(next) || next < 1 || previous !== void 0 && next <= previous) throw new Error(`uploadLargeFile: listParts returned a non-advancing nextPartNumber for ${fileId}; aborting resume.`);
+}
+//#endregion
 
 
-function createParallelDownloadStream(raw, accountInfo, options) {
-  const rangeSize = options.rangeSize ?? 10 * 1024 * 1024;
-  const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;
-  const totalSize = options.totalSize;
-  const retryOptions = {
-    ...DEFAULT_RETRY_OPTIONS,
-    ...options.maxRetries !== void 0 ? { maxRetries: options.maxRetries } : {}
-  };
-  const abort = options.signal;
-  const ranges = planRanges(totalSize, rangeSize);
-  const windowSize = concurrency * 2;
-  const inflight = /* @__PURE__ */ new Map();
-  const buffer = /* @__PURE__ */ new Map();
-  let nextToSchedule = 0;
-  let nextToEmit = 0;
-  let firstError = null;
-  function scheduleNext() {
-    while (firstError === null && // Honour abort here so a completed range that triggers a top-up
-    // doesn't queue one final fetch after the caller aborted. Without
-    // this gate, one extra range request fires post-abort before the
-    // `pull()` loop notices.
-    abort?.aborted !== true && nextToSchedule < ranges.length && inflight.size + buffer.size < windowSize) {
-      const range = ranges[nextToSchedule];
-      if (range === void 0) break;
-      const idx = nextToSchedule;
-      nextToSchedule++;
-      const task = (async () => {
-        try {
-          const data = await fetchRangeWithRetry(
-            raw,
-            accountInfo,
-            options.fileId,
-            range.start,
-            range.end,
-            retryOptions,
-            abort
-          );
-          buffer.set(idx, data);
-        } catch (err) {
-          if (firstError === null) firstError = err;
-        } finally {
-          inflight.delete(idx);
-        }
-      })();
-      inflight.set(idx, task);
-    }
-  }
-  return new ReadableStream({
-    start(controller) {
-      try {
-        abort?.throwIfAborted();
-        scheduleNext();
-      } catch (err) {
-        controller.error(err);
-      }
-    },
-    async pull(controller) {
-      try {
-        while (!buffer.has(nextToEmit)) {
-          abort?.throwIfAborted();
-          if (firstError !== null) throw firstError;
-          if (inflight.size === 0) {
-            controller.close();
-            return;
-          }
-          await Promise.race(inflight.values());
-        }
-        const data = buffer.get(nextToEmit);
-        if (data !== void 0) {
-          buffer.delete(nextToEmit);
-          nextToEmit++;
-          controller.enqueue(data);
-        }
-        scheduleNext();
-        if (nextToEmit >= ranges.length && buffer.size === 0 && inflight.size === 0 && firstError === null) {
-          controller.close();
-        }
-      } catch (err) {
-        controller.error(err);
-      }
-    },
-    cancel() {
-      buffer.clear();
-    }
-  });
-}
-async function fetchRangeWithRetry(raw, accountInfo, fileId, start, end, retryOptions, signal) {
-  let lastError;
-  for (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {
-    if (attempt > 0) {
-      const delay = computeBackoff(attempt - 1, retryOptions);
-      await sleep(delay, signal);
-    }
-    try {
-      signal?.throwIfAborted();
-      const resp = await raw.downloadFileById(
-        accountInfo.getDownloadUrl(),
-        accountInfo.getAuthToken(),
-        fileId,
-        {
-          range: byteRangeHeader(start, end),
-          ...signal !== void 0 ? { signal } : {}
-        }
-      );
-      if (!resp.body) throw new Error("Download chunk has no body");
-      return await collectStream(resp.body);
-    } catch (err) {
-      lastError = err;
-      if (signal?.aborted) throw err;
-      if (err instanceof DOMException && err.name === "AbortError") throw err;
-    }
-  }
-  throw lastError instanceof Error ? lastError : new Error("Range download failed after retries");
-}
+//# sourceMappingURL=resume.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/retry.js
+
+
+//#region src/upload/retry.ts
+var freshUrlRetryOverride = { maxRetries: 0 };
+/**
+* Resolves the public default for `retryResponseBodyFailures`. Callers must
+* opt into replaying ambiguous upload POST failures for every upload mode.
+*
+* @param value - Caller-provided override, if any.
+*
+* @returns The boolean value passed to the upload retry helper.
+*/
+function resolveRetryResponseBodyFailures(value) {
+	return value ?? false;
+}
+/**
+* Fetches a small-file upload URL, bypassing the pool.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param bucketId - Bucket to upload into.
+* @param signal - Optional abort signal for the fresh URL request.
+*
+* @returns A fresh upload URL entry.
+*/
+async function fetchFreshUploadUrl(raw, accountInfo, bucketId, signal) {
+	const resp = await raw.getUploadUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { bucketId }, {
+		...signal !== void 0 ? { signal } : {},
+		retry: freshUrlRetryOverride
+	});
+	return {
+		uploadUrl: resp.uploadUrl,
+		authorizationToken: resp.authorizationToken
+	};
+}
+/**
+* Fetches a large-file part upload URL, bypassing the pool.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param fileId - Large file to upload a part into.
+* @param signal - Optional abort signal for the fresh URL request.
+*
+* @returns A fresh part upload URL entry.
+*/
+async function fetchFreshPartUploadUrl(raw, accountInfo, fileId, signal) {
+	const resp = await raw.getUploadPartUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId }, {
+		...signal !== void 0 ? { signal } : {},
+		retry: freshUrlRetryOverride
+	});
+	return {
+		uploadUrl: resp.uploadUrl,
+		authorizationToken: resp.authorizationToken
+	};
+}
+/**
+* Uploads one multipart part with fresh-URL retry.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param fileId - Large file to upload a part into.
+* @param options - Part upload parameters and retry settings.
+*
+* @returns The uploaded part response.
+*/
+function uploadPartWithFreshUrl(raw, accountInfo, fileId, options) {
+	return withFreshUploadUrlRetry({
+		fileName: options.fileName,
+		partNumber: options.partNumber,
+		retry: options.retry,
+		signal: options.signal,
+		onUploadRetry: options.onUploadRetry,
+		retryResponseBodyFailures: options.retryResponseBodyFailures,
+		checkout: () => accountInfo.checkoutPartUploadUrl(fileId),
+		fetchFresh: () => fetchFreshPartUploadUrl(raw, accountInfo, fileId, options.signal),
+		returnEntry: (entry) => accountInfo.returnPartUploadUrl(fileId, entry),
+		evictEntry: (entry) => accountInfo.evictPartUploadUrl(fileId, entry),
+		upload: (entry) => raw.uploadPart(entry.uploadUrl, {
+			authorization: entry.authorizationToken,
+			partNumber: options.partNumber,
+			contentLength: options.contentLength,
+			contentSha1: options.contentSha1,
+			...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}
+		}, options.data, {
+			...options.signal !== void 0 ? { signal: options.signal } : {},
+			...options.retry !== void 0 ? { retry: options.retry } : {}
+		})
+	});
+}
+/**
+* Runs an upload operation with B2's documented retry flow: evict the failed
+* upload URL, back off, fetch a fresh upload URL, and retry there.
+*
+* For single-request file uploads, sending the POST again after a lost success
+* response can create a duplicate file version. Multipart retries re-send the
+* same part number instead. Response-body retry defaults are caller-specific:
+* single-request uploads keep them off by default, while multipart callers can
+* opt in with `retryResponseBodyFailures: true` when replaying the same part
+* number is acceptable.
+*
+* @param options - URL checkout, upload, eviction, and retry callbacks.
+*
+* @returns The successful upload result.
+*/
+async function withFreshUploadUrlRetry(options) {
+	const retryOptions = {
+		...DEFAULT_RETRY_OPTIONS,
+		...options.retry
+	};
+	for (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {
+		let uploadEntry;
+		let uploadStarted = false;
+		try {
+			options.signal?.throwIfAborted();
+			uploadEntry = attempt === 0 ? options.checkout() ?? await options.fetchFresh() : await options.fetchFresh();
+			uploadStarted = true;
+			const result = await options.upload(uploadEntry);
+			options.returnEntry(uploadEntry);
+			return result;
+		} catch (err) {
+			const retryError = normalizeUploadRetryError(err, options);
+			if (uploadEntry !== void 0) if (isUploadRateLimitError(retryError)) options.returnEntry(uploadEntry);
+			else options.evictEntry(uploadEntry);
+			if (options.signal?.aborted) throw err;
+			if (isUploadRateLimitError(retryError) && uploadEntry !== void 0) throw retryError;
+			if (!isUploadRetryable(retryError, {
+				...options,
+				uploadStarted
+			}) || attempt === retryOptions.maxRetries) throw retryError;
+			const retryAttempt = attempt + 1;
+			const retryAfter = retryError instanceof B2Error ? retryError.retryAfter : void 0;
+			const delayMs = computeBackoff(attempt, retryOptions, retryAfter);
+			notifyUploadRetry(options, {
+				fileName: options.fileName,
+				partNumber: options.partNumber,
+				attempt: retryAttempt,
+				maxRetries: retryOptions.maxRetries,
+				delayMs,
+				error: retryError
+			});
+			await sleep(delayMs, options.signal);
+		}
+	}
+	/* v8 ignore next -- defensive return-path guard. */
+	throw new NetworkError("Upload retry budget exhausted");
+}
+function notifyUploadRetry(options, event) {
+	try {
+		options.onUploadRetry?.(event);
+	} catch {}
+}
+function isUploadRetryable(err, options) {
+	if (err instanceof NetworkError) {
+		if (err.cause instanceof B2SsrfError) return false;
+		if (!options.uploadStarted) return true;
+		return options.retryResponseBodyFailures === true;
+	}
+	if (err instanceof BadAuthTokenError) return true;
+	if (isUploadUrlInvalidationError(err)) return true;
+	return err instanceof B2Error && err.retryable;
+}
+function isUploadRateLimitError(err) {
+	return err instanceof B2Error && err.status === 429;
+}
+function normalizeUploadRetryError(err, options) {
+	if (err instanceof B2Error || err instanceof NetworkError) return err;
+	if (err instanceof UploadResponseBodyError) {
+		if (!options.retryResponseBodyFailures) return err;
+		return new NetworkError(err.message, err);
+	}
+	if (err instanceof DOMException && err.name === "AbortError") return err;
+	if (err instanceof TypeError || err instanceof SyntaxError || err instanceof DOMException) return new NetworkError(err instanceof Error ? err.message : "Upload response read failed", err);
+	return err;
+}
+function isUploadUrlInvalidationError(err) {
+	if (err instanceof BadUploadUrlError) return true;
+	return err instanceof BadRequestError && /upload url/i.test(err.message);
+}
+//#endregion
 
-//# sourceMappingURL=parallel.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/hash.js
-let nodeCreateHash;
-async function getNodeCreateHash() {
-  if (nodeCreateHash !== void 0) return nodeCreateHash;
-  try {
-    const crypto2 = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 7598, 19));
-    if (typeof crypto2.createHash !== "function") throw new Error("createHash unavailable");
-    nodeCreateHash = (algo) => {
-      const h = crypto2.createHash(algo);
-      return {
-        update(data) {
-          h.update(data);
-        },
-        digest(encoding) {
-          return h.digest(encoding);
-        }
-      };
-    };
-  } catch {
-    nodeCreateHash = null;
-  }
-  return nodeCreateHash;
-}
-class IncrementalSha1 {
-  /** Buffered chunks for WebCrypto fallback path. */
-  chunks = [];
-  /** Total bytes fed into the hash so far. */
-  totalLength = 0;
-  /** Node.js hash instance, or null if using WebCrypto fallback. */
-  nodeHash = null;
-  /** Resolves once the crypto backend has been loaded. */
-  initPromise;
-  /** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */
-  constructor() {
-    this.initPromise = getNodeCreateHash().then((factory) => {
-      if (factory) this.nodeHash = factory("sha1");
-    });
-  }
-  /**
-   * Feed data into the hash. Async because it lazily initializes the crypto backend.
-   * @param data - The bytes to include in the hash computation.
-   *
-   * @returns A promise that resolves once the data has been consumed.
-   */
-  async update(data) {
-    await this.initPromise;
-    if (this.nodeHash) {
-      this.nodeHash.update(data);
-    } else {
-      this.chunks.push(new Uint8Array(data));
-    }
-    this.totalLength += data.byteLength;
-  }
-  /**
-   * Finalize the hash and return the hex-encoded SHA-1 digest.
-   * @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.
-   */
-  async digest() {
-    await this.initPromise;
-    if (this.nodeHash) {
-      return this.nodeHash.digest("hex");
-    }
-    const combined = new Uint8Array(this.totalLength);
-    let offset = 0;
-    for (const chunk of this.chunks) {
-      combined.set(chunk, offset);
-      offset += chunk.byteLength;
-    }
-    const hashBuffer = await crypto.subtle.digest("SHA-1", combined.buffer);
-    return hexEncode(new Uint8Array(hashBuffer));
-  }
-  /**
-   * Total number of bytes fed into the hash so far.
-   *
-   * @returns The cumulative byte count across all update calls.
-   */
-  get bytesProcessed() {
-    return this.totalLength;
-  }
-}
-function hexEncode(bytes) {
-  const hex = [];
-  for (const b of bytes) {
-    hex.push(b.toString(16).padStart(2, "0"));
-  }
-  return hex.join("");
-}
-async function sha1Hex(data) {
-  const factory = await getNodeCreateHash();
-  if (factory) {
-    const h = factory("sha1");
-    h.update(data);
-    return h.digest("hex");
-  }
-  const hashBuffer = await crypto.subtle.digest("SHA-1", data.buffer);
-  return hexEncode(new Uint8Array(hashBuffer));
-}
+//# sourceMappingURL=retry.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/large.js
 
-//# sourceMappingURL=hash.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/resume.js
-
-async function findResumeCandidate(raw, accountInfo, bucketId, fileName) {
-  const unfinished = await raw.listUnfinishedLargeFiles(
-    accountInfo.getApiUrl(),
-    accountInfo.getAuthToken(),
-    { bucketId }
-  );
-  const match = unfinished.files.find((f) => f.fileName === fileName);
-  if (!match) return null;
-  const fileId = largeFileId(match.fileId);
-  const uploadedPartSha1s = await collectPartSha1s(raw, accountInfo, fileId);
-  return { fileId, uploadedPartSha1s };
-}
-async function collectPartSha1s(raw, accountInfo, fileId) {
-  const sha1s = /* @__PURE__ */ new Map();
-  let startPartNumber;
-  while (true) {
-    const page = await raw.listParts(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-      fileId,
-      ...startPartNumber !== void 0 ? { startPartNumber } : {}
-    });
-    for (const part of page.parts) {
-      sha1s.set(part.partNumber, part.contentSha1);
-    }
-    if (page.nextPartNumber === null) break;
-    startPartNumber = page.nextPartNumber;
-  }
-  return sha1s;
-}
 
-//# sourceMappingURL=resume.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/large.js
 
 
 
@@ -32141,3188 +35149,3821 @@ async function collectPartSha1s(raw, accountInfo, fileId) {
 
 
 
+
+//#region src/upload/large.ts
+var MAX_CONSECUTIVE_EMPTY_STREAM_CHUNKS = 1024;
+function createResumeCandidateCriteria(options, request, totalSize, partSize, parts) {
+	return {
+		contentType: request.contentType,
+		fileInfo: request.fileInfo,
+		sourceSize: totalSize,
+		partSize,
+		parts,
+		...options.signal !== void 0 ? { signal: options.signal } : {},
+		...request.serverSideEncryption !== void 0 ? { serverSideEncryption: request.serverSideEncryption } : options.bucketDefaultServerSideEncryption !== void 0 ? { serverSideEncryption: options.bucketDefaultServerSideEncryption } : {},
+		...request.fileRetention !== void 0 ? { fileRetention: request.fileRetention } : options.bucketDefaultRetention !== void 0 ? { defaultFileRetention: options.bucketDefaultRetention } : options.bucketDefaultRetentionUnreadable === true ? { defaultFileRetentionUnreadable: true } : {},
+		...request.legalHold !== void 0 ? { legalHold: request.legalHold } : {},
+		...options.resumeDiscoveryTimeoutMs !== void 0 ? { discoveryTimeoutMs: options.resumeDiscoveryTimeoutMs } : {},
+		...options.onResumeCandidateRejected !== void 0 ? { onCandidateRejected: options.onResumeCandidateRejected } : {},
+		...options.resumeMaxListPages !== void 0 ? { maxListPages: options.resumeMaxListPages } : {},
+		...options.resumeMaxPartCandidates !== void 0 ? { maxPartCandidates: options.resumeMaxPartCandidates } : {},
+		...options.resumeMaxPartPages !== void 0 ? { maxPartPages: options.resumeMaxPartPages } : {}
+	};
+}
+/**
+* Uploads a file using the B2 multipart (large file) protocol.
+*
+* The source is sliced into parts and uploaded concurrently via
+* `b2_upload_part`. This is appropriate for files larger than the recommended
+* part size. For smaller files, use {@link uploadSmallFile} which sends the
+* entire payload in a single request.
+*
+* On failure, the in-progress large file is cancelled on a best-effort basis.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state (tokens, URLs, upload URL pool).
+* @param options - Upload parameters including part size and concurrency.
+*
+* @returns The resulting {@link FileVersion} metadata.
+*/
 async function uploadLargeFile(raw, accountInfo, options) {
-  const recommendedPartSize = accountInfo.getRecommendedPartSize();
-  const minPartSize = accountInfo.getAbsoluteMinimumPartSize();
-  const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);
-  const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;
-  const totalSize = options.source.size;
-  const parts = planRanges(totalSize, partSize);
-  const fileInfo = { ...options.fileInfo };
-  const startLargeFileRequest = {
-    bucketId: options.bucketId,
-    fileName: options.fileName,
-    contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,
-    fileInfo,
-    ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},
-    ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},
-    ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {}
-  };
-  let largeFileId;
-  let preUploaded;
-  if (options.resumeFileId !== void 0) {
-    largeFileId = options.resumeFileId;
-    preUploaded = await collectPartSha1s(raw, accountInfo, largeFileId);
-  } else if (options.resume === true) {
-    const candidate = await findResumeCandidate(
-      raw,
-      accountInfo,
-      options.bucketId,
-      options.fileName
-    );
-    if (candidate) {
-      largeFileId = candidate.fileId;
-      preUploaded = candidate.uploadedPartSha1s;
-    } else {
-      const startResp = await raw.startLargeFile(
-        accountInfo.getApiUrl(),
-        accountInfo.getAuthToken(),
-        startLargeFileRequest
-      );
-      largeFileId = startResp.fileId;
-      preUploaded = /* @__PURE__ */ new Map();
-    }
-  } else {
-    const startResp = await raw.startLargeFile(
-      accountInfo.getApiUrl(),
-      accountInfo.getAuthToken(),
-      startLargeFileRequest
-    );
-    largeFileId = startResp.fileId;
-    preUploaded = /* @__PURE__ */ new Map();
-  }
-  const partSha1s = new Array(parts.length);
-  const tracker = new ProgressTracker(options.onProgress, totalSize, parts.length);
-  const sem = new Semaphore(concurrency);
-  if (!options.source.canSlice) {
-    if (options.resume === true || options.resumeFileId !== void 0) {
-      await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);
-      throw new Error(
-        "uploadLargeFile: resume is not supported on non-sliceable sources (e.g. StreamSource)."
-      );
-    }
-    try {
-      await uploadPartsSequentially(
-        raw,
-        accountInfo,
-        options,
-        largeFileId,
-        parts,
-        partSha1s,
-        tracker
-      );
-      return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-        fileId: largeFileId,
-        partSha1Array: partSha1s
-      });
-    } catch (err) {
-      await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);
-      throw err;
-    }
-  }
-  try {
-    const tasks = parts.map(async (part) => {
-      await sem.acquire();
-      try {
-        options.signal?.throwIfAborted();
-        const partSource = options.source.slice(part.offset, part.offset + part.length);
-        const data = new Uint8Array(await partSource.toArrayBuffer());
-        const partSha1 = new IncrementalSha1();
-        await partSha1.update(data);
-        const sha1Hex = await partSha1.digest();
-        const serverSha1 = preUploaded.get(part.partNumber);
-        if (serverSha1 !== void 0 && serverSha1 === sha1Hex) {
-          partSha1s[part.partNumber - 1] = serverSha1;
-          tracker.addBytes(data.byteLength);
-          tracker.completePart();
-          return;
-        }
-        let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId);
-        if (!uploadEntry) {
-          const resp = await raw.getUploadPartUrl(
-            accountInfo.getApiUrl(),
-            accountInfo.getAuthToken(),
-            { fileId: largeFileId }
-          );
-          uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };
-        }
-        try {
-          const result2 = await raw.uploadPart(
-            uploadEntry.uploadUrl,
-            {
-              authorization: uploadEntry.authorizationToken,
-              partNumber: part.partNumber,
-              contentLength: data.byteLength,
-              contentSha1: sha1Hex,
-              ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}
-            },
-            data,
-            options.signal
-          );
-          accountInfo.returnPartUploadUrl(largeFileId, uploadEntry);
-          partSha1s[part.partNumber - 1] = result2.contentSha1;
-          tracker.addBytes(data.byteLength);
-          tracker.completePart();
-        } catch (err) {
-          accountInfo.evictPartUploadUrl(largeFileId, uploadEntry);
-          throw err;
-        }
-      } finally {
-        sem.release();
-      }
-    });
-    await Promise.all(tasks);
-    const result = await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-      fileId: largeFileId,
-      partSha1Array: partSha1s
-    });
-    return result;
-  } catch (err) {
-    await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);
-    throw err;
-  }
+	const recommendedPartSize = accountInfo.getRecommendedPartSize();
+	const minPartSize = accountInfo.getAbsoluteMinimumPartSize();
+	const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);
+	const concurrency = options.concurrency ?? 4;
+	const totalSize = options.source.size;
+	const parts = planRanges(totalSize, partSize);
+	const fileInfo = Object.create(null);
+	if (options.fileInfo !== void 0) for (const [key, value] of Object.entries(options.fileInfo)) fileInfo[key] = value;
+	const startLargeFileRequest = {
+		bucketId: options.bucketId,
+		fileName: options.fileName,
+		contentType: options.contentType ?? "b2/x-auto",
+		fileInfo,
+		...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},
+		...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},
+		...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {}
+	};
+	const resumeCandidateCriteria = createResumeCandidateCriteria(options, startLargeFileRequest, totalSize, partSize, parts);
+	if (!options.source.canSlice && options.resumeFileId !== void 0) throw new Error("uploadLargeFile: resume is not supported on non-sliceable sources.");
+	let largeFileId;
+	let preUploaded = /* @__PURE__ */ new Map();
+	let createdLargeFile = false;
+	const abortScope = createAbortScope(options.signal);
+	const startFreshLargeFile = async () => {
+		if (abortScope.signal.aborted && !options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason);
+		abortScope.signal.throwIfAborted();
+		const startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), startLargeFileRequest, {
+			signal: abortScope.signal,
+			...options.retry !== void 0 ? { retry: options.retry } : {}
+		});
+		try {
+			largeFileId = (await raceWithAbort(startPromise, abortScope.signal)).fileId;
+		} catch (err) {
+			if (abortScope.signal.aborted) {
+				if (!options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason).catch(() => {});
+				large_cancelLargeFileAfterStart(startPromise, raw, accountInfo, options.onCleanupFailure);
+			}
+			throw err;
+		}
+		preUploaded = /* @__PURE__ */ new Map();
+		createdLargeFile = true;
+	};
+	try {
+		if (abortScope.signal.aborted && !options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason);
+		abortScope.signal.throwIfAborted();
+		if (options.resumeFileId !== void 0) {
+			const candidate = await findResumeCandidate(raw, accountInfo, options.bucketId, options.fileName, {
+				...resumeCandidateCriteria,
+				resumeFileId: options.resumeFileId
+			});
+			if (candidate === null) throw new ResumeFileIdMismatchError(options.resumeFileId, options.fileName);
+			largeFileId = candidate.fileId;
+			preUploaded = candidate.uploadedPartSha1s;
+		} else if (options.resume === true && options.source.canSlice) {
+			const candidate = await findResumeCandidate(raw, accountInfo, options.bucketId, options.fileName, resumeCandidateCriteria);
+			if (candidate) {
+				largeFileId = candidate.fileId;
+				preUploaded = /* @__PURE__ */ new Map();
+			} else await startFreshLargeFile();
+		} else await startFreshLargeFile();
+		const activeLargeFileId = largeFileId;
+		if (activeLargeFileId === void 0) throw new Error("uploadLargeFile: start did not return a large file ID.");
+		const partSha1s = new Array(parts.length);
+		const tracker = new ProgressTracker(options.onProgress, totalSize, parts.length);
+		const sem = new Semaphore(concurrency);
+		if (!options.source.canSlice) {
+			await uploadPartsSequentially(raw, accountInfo, options, activeLargeFileId, parts, partSha1s, tracker, abortScope.signal);
+			return await finishLargeFileWithAbortReconciliation(raw, accountInfo, {
+				fileId: activeLargeFileId,
+				bucketId: options.bucketId,
+				fileName: options.fileName,
+				partSha1s,
+				signal: abortScope.signal,
+				...options.retry !== void 0 ? { retry: options.retry } : {}
+			});
+		}
+		const tasks = parts.map(async (part) => {
+			await sem.acquire();
+			try {
+				abortScope.signal.throwIfAborted();
+				const partSource = options.source.slice(part.offset, part.offset + part.length);
+				const data = new Uint8Array(await partSource.toArrayBuffer({ signal: abortScope.signal }));
+				abortScope.signal.throwIfAborted();
+				const partSha1 = new IncrementalSha1();
+				await partSha1.update(data);
+				const sha1Hex = await partSha1.digest();
+				abortScope.signal.throwIfAborted();
+				const serverSha1 = preUploaded.get(part.partNumber);
+				if (serverSha1 !== void 0 && serverSha1 === sha1Hex) {
+					notifyResumePartReused(options.onResumePartReused, {
+						fileName: options.fileName,
+						fileId: activeLargeFileId,
+						partNumber: part.partNumber,
+						contentLength: data.byteLength,
+						contentSha1: serverSha1
+					});
+					partSha1s[part.partNumber - 1] = serverSha1;
+					tracker.addBytes(data.byteLength);
+					tracker.completePart();
+					return;
+				}
+				const result = await uploadPartWithFreshUrl(raw, accountInfo, activeLargeFileId, {
+					fileName: options.fileName,
+					partNumber: part.partNumber,
+					data,
+					contentLength: data.byteLength,
+					contentSha1: sha1Hex,
+					retry: options.retry,
+					signal: abortScope.signal,
+					onUploadRetry: options.onUploadRetry,
+					retryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),
+					...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}
+				});
+				partSha1s[part.partNumber - 1] = result.contentSha1;
+				tracker.addBytes(data.byteLength);
+				tracker.completePart();
+			} catch (err) {
+				abortScope.abort(err);
+				throw err;
+			} finally {
+				sem.release();
+			}
+		});
+		throwRejectedOrAbortReason(await Promise.allSettled(tasks), abortScope);
+		return await finishLargeFileWithAbortReconciliation(raw, accountInfo, {
+			fileId: activeLargeFileId,
+			bucketId: options.bucketId,
+			fileName: options.fileName,
+			partSha1s,
+			signal: abortScope.signal,
+			...options.retry !== void 0 ? { retry: options.retry } : {}
+		});
+	} catch (err) {
+		abortScope.abort(err);
+		if (largeFileId === void 0) throw err;
+		return await cleanupAfterUploadLargeFileError(err, raw, accountInfo, options, largeFileId, createdLargeFile);
+	} finally {
+		abortScope.dispose();
+	}
+}
+function large_cancelLargeFileAfterStart(started, raw, accountInfo, onCleanupFailure) {
+	started.then((resp) => cancelLargeFileBestEffort(raw, accountInfo, resp.fileId, onCleanupFailure === void 0 ? void 0 : { onCleanupFailure })).catch(() => {});
+}
+async function cleanupAfterUploadLargeFileError(err, raw, accountInfo, options, largeFileId, createdLargeFile) {
+	return await cleanupAfterLargeFileError(err, raw, accountInfo, {
+		fileId: largeFileId,
+		bucketId: options.bucketId,
+		fileName: options.fileName,
+		signal: options.signal,
+		onCleanupFailure: options.onCleanupFailure
+	}, { cancelOnError: createdLargeFile });
+}
+/**
+* Sequential upload path for non-sliceable sources.
+*
+* Reads the source's `stream()` once and accumulates exactly `partSize`
+* bytes into an in-memory buffer per iteration. Each filled buffer is
+* hashed, dispatched to `b2_upload_part`, then released before the next
+* part starts — so peak memory is ~partSize regardless of file size.
+*
+* Concurrency is forced to 1 here because the stream is a single
+* forward-only cursor; the engine can't read part N+1 until part N is
+* fully consumed.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param options - The original `uploadLargeFile` options.
+* @param largeFileId - ID of the in-progress large file (already started).
+* @param parts - Pre-planned part layout (used for part numbers + count).
+* @param partSha1s - Output array, written in-place at index `partNumber - 1`.
+* @param tracker - Progress tracker; bytes added per chunk, part completed
+*   each time a part finishes.
+* @param signal - Linked abort signal for source reads and part uploads.
+*/
+async function uploadPartsSequentially(raw, accountInfo, options, largeFileId, parts, partSha1s, tracker, signal) {
+	const reader = options.source.stream().getReader();
+	let bytesRead = 0;
+	let carry = null;
+	try {
+		for (const planned of parts) {
+			signal.throwIfAborted();
+			const buf = new Uint8Array(planned.length);
+			let filled = 0;
+			if (carry !== null) {
+				const take = Math.min(carry.byteLength, buf.byteLength - filled);
+				buf.set(carry.subarray(0, take), filled);
+				filled += take;
+				carry = take < carry.byteLength ? carry.subarray(take) : null;
+			}
+			while (filled < buf.byteLength) {
+				const { done, value } = await readNextNonEmptyStreamChunk(reader, emptyChunkError(), signal);
+				if (done) throw new Error(`uploadLargeFile: source stream ended after ${bytesRead} bytes, expected ${options.source.size}.`);
+				bytesRead += value.byteLength;
+				const take = Math.min(value.byteLength, buf.byteLength - filled);
+				buf.set(value.subarray(0, take), filled);
+				filled += take;
+				if (take < value.byteLength) carry = value.subarray(take);
+			}
+			signal.throwIfAborted();
+			const data = buf;
+			const partSha1 = new IncrementalSha1();
+			await partSha1.update(data);
+			const sha1Hex = await partSha1.digest();
+			signal.throwIfAborted();
+			const result = await uploadPartWithFreshUrl(raw, accountInfo, largeFileId, {
+				fileName: options.fileName,
+				partNumber: planned.partNumber,
+				data,
+				contentLength: data.byteLength,
+				contentSha1: sha1Hex,
+				retry: options.retry,
+				signal,
+				onUploadRetry: options.onUploadRetry,
+				retryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),
+				...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}
+			});
+			partSha1s[planned.partNumber - 1] = result.contentSha1;
+			tracker.addBytes(data.byteLength);
+			tracker.completePart();
+		}
+		if (carry !== null && carry.byteLength > 0) throw new Error(tooManyBytesError(options.source.size));
+		const extra = await readNextNonEmptyStreamChunk(reader, emptyChunkError(), signal);
+		if (!extra.done) {
+			bytesRead += extra.value.byteLength;
+			throw new Error(tooManyBytesError(options.source.size));
+		}
+	} catch (err) {
+		await reader.cancel(err).catch(() => {});
+		throw err;
+	} finally {
+		reader.releaseLock();
+	}
+}
+function emptyChunkError() {
+	return `uploadLargeFile: source stream emitted more than ${MAX_CONSECUTIVE_EMPTY_STREAM_CHUNKS} consecutive empty chunks. too many empty chunks.`;
+}
+function tooManyBytesError(advertisedSize) {
+	return `uploadLargeFile: source stream emitted more than advertised ${advertisedSize} bytes. source stream emitted more bytes than advertised size.`;
+}
+async function cancelForwardOnlySource(source, reason) {
+	const reader = source.stream().getReader();
+	try {
+		await reader.cancel(reason);
+	} finally {
+		reader.releaseLock();
+	}
+}
+function notifyResumePartReused(listener, event) {
+	try {
+		listener?.(event);
+	} catch {}
+}
+//#endregion
+
+
+//# sourceMappingURL=large.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/options.js
+//#region src/upload/options.ts
+/**
+* Explicit resume targets are multipart-only and must fail closed on small uploads.
+*
+* @param options - High-level upload options.
+* @param caller - Public method name used in the thrown error.
+*
+* @throws Error when an explicit resume target is supplied for a small upload.
+*/
+function rejectSmallResumeFileId(options, caller) {
+	if (options.resumeFileId !== void 0) throw new Error(`${caller}: resumeFileId is only supported for multipart uploads.`);
 }
-async function uploadPartsSequentially(raw, accountInfo, options, largeFileId, parts, partSha1s, tracker) {
-  const reader = options.source.stream().getReader();
-  let partNumber = 1;
-  let carry = null;
-  try {
-    for (const planned of parts) {
-      options.signal?.throwIfAborted();
-      const buf = new Uint8Array(planned.length);
-      let filled = 0;
-      if (carry !== null) {
-        const take = Math.min(carry.byteLength, buf.byteLength - filled);
-        buf.set(carry.subarray(0, take), filled);
-        filled += take;
-        carry = take < carry.byteLength ? carry.subarray(take) : null;
-      }
-      while (filled < buf.byteLength) {
-        const { done, value } = await reader.read();
-        if (done) break;
-        const take = Math.min(value.byteLength, buf.byteLength - filled);
-        buf.set(value.subarray(0, take), filled);
-        filled += take;
-        if (take < value.byteLength) {
-          carry = value.subarray(take);
-        }
-      }
-      const data = filled === buf.byteLength ? buf : buf.subarray(0, filled);
-      if (data.byteLength === 0) {
-        throw new Error(
-          `uploadLargeFile: source stream ended before part ${partNumber}; advertised size does not match emitted bytes.`
-        );
-      }
-      const partSha1 = new IncrementalSha1();
-      await partSha1.update(data);
-      const sha1Hex = await partSha1.digest();
-      let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId);
-      if (!uploadEntry) {
-        const resp = await raw.getUploadPartUrl(
-          accountInfo.getApiUrl(),
-          accountInfo.getAuthToken(),
-          { fileId: largeFileId }
-        );
-        uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };
-      }
-      try {
-        const result = await raw.uploadPart(
-          uploadEntry.uploadUrl,
-          {
-            authorization: uploadEntry.authorizationToken,
-            partNumber: planned.partNumber,
-            contentLength: data.byteLength,
-            contentSha1: sha1Hex,
-            ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}
-          },
-          data,
-          options.signal
-        );
-        accountInfo.returnPartUploadUrl(largeFileId, uploadEntry);
-        partSha1s[planned.partNumber - 1] = result.contentSha1;
-        tracker.addBytes(data.byteLength);
-        tracker.completePart();
-      } catch (err) {
-        accountInfo.evictPartUploadUrl(largeFileId, uploadEntry);
-        throw err;
-      }
-      partNumber++;
-    }
-  } finally {
-    reader.releaseLock();
-  }
+/**
+* Removes resume-only options before forwarding to the small-file upload path.
+*
+* @param options - High-level upload options.
+*
+* @returns Options accepted by the single-request upload implementation.
+*/
+function stripResumeOnlyOptions(options) {
+	const { resume: _resume, resumeFileId: _resumeFileId, onResumeCandidateRejected: _onResumeCandidateRejected, onResumePartReused: _onResumePartReused, resumeDiscoveryTimeoutMs: _resumeDiscoveryTimeoutMs, resumeMaxListPages: _resumeMaxListPages, resumeMaxPartCandidates: _resumeMaxPartCandidates, resumeMaxPartPages: _resumeMaxPartPages, ...smallOptions } = options;
+	return smallOptions;
 }
+//#endregion
 
-//# sourceMappingURL=large.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/single.js
+//# sourceMappingURL=options.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/single.js
+
 
 
 
+
+//#region src/upload/single.ts
+/**
+* Uploads a file in a single HTTP request (suitable for files up to ~100 MB).
+*
+* The entire file content is read into memory, SHA-1 hashed, and sent in one
+* `b2_upload_file` call. For files larger than the recommended part size, use
+* {@link uploadLargeFile} which splits the file into parts uploaded in parallel.
+*
+* Upload URLs are pooled via {@link AccountInfo} and recycled on success or
+* evicted on failure.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state (tokens, URLs, upload URL pool).
+* @param options - Upload parameters.
+*
+* @returns The resulting {@link FileVersion} metadata.
+*/
 async function uploadSmallFile(raw, accountInfo, options) {
-  let uploadEntry = accountInfo.checkoutUploadUrl(options.bucketId);
-  if (!uploadEntry) {
-    const resp = await raw.getUploadUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-      bucketId: options.bucketId
-    });
-    uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };
-  }
-  const data = new Uint8Array(await options.source.toArrayBuffer());
-  const sha1 = new IncrementalSha1();
-  await sha1.update(data);
-  const sha1Hex = await sha1.digest();
-  const tracker = new ProgressTracker(options.onProgress, data.byteLength, 1);
-  try {
-    const result = await raw.uploadFile(
-      uploadEntry.uploadUrl,
-      {
-        authorization: uploadEntry.authorizationToken,
-        fileName: options.fileName,
-        contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,
-        contentLength: data.byteLength,
-        contentSha1: sha1Hex,
-        ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},
-        ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},
-        ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},
-        ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {},
-        ...options.lastModifiedMillis !== void 0 ? { lastModifiedMillis: options.lastModifiedMillis } : {}
-      },
-      data,
-      options.signal
-    );
-    tracker.addBytes(data.byteLength);
-    tracker.completePart();
-    accountInfo.returnUploadUrl(options.bucketId, uploadEntry);
-    return result;
-  } catch (err) {
-    accountInfo.evictUploadUrl(options.bucketId, uploadEntry);
-    throw err;
-  }
-}
+	const data = await readSmallFileSource(options.source, options.signal);
+	if (data.byteLength !== options.source.size) throw new Error(`uploadSmallFile: source byte count does not match advertised size (expected ${options.source.size} bytes, got ${data.byteLength} bytes).`);
+	const sha1 = new IncrementalSha1();
+	await sha1.update(data);
+	const sha1Hex = await sha1.digest();
+	const tracker = new ProgressTracker(options.onProgress, data.byteLength, 1);
+	const result = await withFreshUploadUrlRetry({
+		fileName: options.fileName,
+		partNumber: null,
+		retry: options.retry,
+		signal: options.signal,
+		onUploadRetry: options.onUploadRetry,
+		retryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),
+		checkout: () => accountInfo.checkoutUploadUrl(options.bucketId),
+		fetchFresh: () => fetchFreshUploadUrl(raw, accountInfo, options.bucketId, options.signal),
+		returnEntry: (entry) => accountInfo.returnUploadUrl(options.bucketId, entry),
+		evictEntry: (entry) => accountInfo.evictUploadUrl(options.bucketId, entry),
+		upload: (entry) => raw.uploadFile(entry.uploadUrl, {
+			authorization: entry.authorizationToken,
+			fileName: options.fileName,
+			contentType: options.contentType ?? "b2/x-auto",
+			contentLength: data.byteLength,
+			contentSha1: sha1Hex,
+			...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},
+			...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},
+			...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},
+			...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {},
+			...options.lastModifiedMillis !== void 0 ? { lastModifiedMillis: options.lastModifiedMillis } : {}
+		}, data, {
+			...options.signal !== void 0 ? { signal: options.signal } : {},
+			...options.retry !== void 0 ? { retry: options.retry } : {}
+		})
+	});
+	tracker.addBytes(data.byteLength);
+	tracker.completePart();
+	return result;
+}
+async function readSmallFileSource(source, signal) {
+	signal?.throwIfAborted();
+	if (!source.canSlice) return collectStreamExactly(source.stream(), source.size, signal);
+	const data = new Uint8Array(await (signal === void 0 ? source.toArrayBuffer() : source.toArrayBuffer({ signal })));
+	signal?.throwIfAborted();
+	return data;
+}
+//#endregion
 
-//# sourceMappingURL=single.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/to-error.js
+//# sourceMappingURL=single.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/to-error.js
+//#region src/util/to-error.ts
+/**
+* Coerce an unknown caught value to a real error instance.
+*
+* Existing error objects pass through unchanged so call sites preserve
+* the original stack and any subclass identity. Other values are
+* wrapped in a fresh Error whose message is `String(value)`. Centralises
+* the conditional that previously recurred at every async-boundary
+* catch site in the upload, copy, sync, and stream paths.
+*
+* @param value - Value caught from a `try`/`catch` or rejected promise.
+*
+* @returns An `Error` representing `value`.
+*/
 function toError(value) {
-  return value instanceof Error ? value : new Error(String(value));
+	return value instanceof Error ? value : new Error(String(value));
 }
+//#endregion
+
 
 //# sourceMappingURL=to-error.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/collect.js
+//#region src/streams/collect.ts
+/**
+* Drain a `ReadableStream` into a single contiguous
+* `Uint8Array`. Releases the reader lock on both the happy and error
+* paths so the underlying stream can propagate close / error events to
+* the upstream producer.
+*
+* Used by both `createParallelDownloadStream` (per-range fetch) and
+* `StreamSource.toArrayBuffer` (whole-source materialisation). The two
+* code paths previously hand-rolled the same accumulate-then-concat
+* loop; consolidating here removes ~25 duplicated lines and a class of
+* lock-leak bugs.
+*
+* @param stream - Readable stream to consume. Will be fully drained.
+* @param options - Optional abort signal used to stop a pending read.
+*
+* @returns A new `Uint8Array` containing every byte the stream produced.
+*/
+async function collect_collectStream(stream, options = {}) {
+	const reader = stream.getReader();
+	try {
+		const chunks = [];
+		let total = 0;
+		while (true) {
+			const { done, value } = await readStreamChunkWithSignal(reader, options.signal);
+			if (done) break;
+			chunks.push(value);
+			total += value.byteLength;
+		}
+		const result = new Uint8Array(total);
+		let offset = 0;
+		for (const chunk of chunks) {
+			result.set(chunk, offset);
+			offset += chunk.byteLength;
+		}
+		return result;
+	} finally {
+		reader.releaseLock();
+	}
+}
+/**
+* Reads one chunk and rejects when the supplied signal aborts.
+* @param reader - Stream reader to read from.
+* @param signal - Optional abort signal that cancels the read.
+*
+* @returns The next stream read result.
+*
+* @internal
+*/
+async function readStreamChunkWithSignal(reader, signal) {
+	if (signal === void 0) return reader.read();
+	signal.throwIfAborted();
+	let removeAbortListener;
+	const abortPromise = new Promise((_, reject) => {
+		const onAbort = () => {
+			const reason = collect_abortReason(signal);
+			reject(reason);
+			reader.cancel(reason).catch(() => {});
+		};
+		signal.addEventListener("abort", onAbort, { once: true });
+		removeAbortListener = () => signal.removeEventListener("abort", onAbort);
+	});
+	try {
+		return await Promise.race([reader.read(), abortPromise]);
+	} finally {
+		removeAbortListener?.();
+	}
+}
+function collect_abortReason(signal) {
+	return signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
+}
+//#endregion
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/stream.js
 
+//# sourceMappingURL=collect.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/parallel.js
 
 
 
 
 
-function createWriteStream(raw, accountInfo, options) {
-  const minPartSize = accountInfo.getAbsoluteMinimumPartSize();
-  const recommendedPartSize = accountInfo.getRecommendedPartSize();
-  const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);
-  const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;
-  const tracker = new ProgressTracker(options.onProgress, null, null);
-  const sem = new Semaphore(concurrency);
-  let largeFileId = null;
-  let startPromise = null;
-  let nextPartNumber = 1;
-  let pendingBytes = 0;
-  const pending = [];
-  const partSha1s = [];
-  const inflight = [];
-  let errored = null;
-  const {
-    promise: done,
-    resolve: resolveDone,
-    reject: rejectDone
-  } = Promise.withResolvers();
-  done.catch(() => {
-  });
-  function ensureStarted() {
-    if (largeFileId !== null) return Promise.resolve(largeFileId);
-    if (startPromise !== null) return startPromise;
-    startPromise = (async () => {
-      const resp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-        bucketId: options.bucketId,
-        fileName: options.fileName,
-        contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,
-        fileInfo: options.fileInfo ?? {},
-        ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}
-      });
-      largeFileId = resp.fileId;
-      return largeFileId;
-    })();
-    return startPromise;
-  }
-  async function shipPart(data, partNumber) {
-    const fileId = await ensureStarted();
-    const sha1 = new IncrementalSha1();
-    await sha1.update(data);
-    const sha1Hex = await sha1.digest();
-    let uploadEntry = accountInfo.checkoutPartUploadUrl(fileId);
-    if (!uploadEntry) {
-      const resp = await raw.getUploadPartUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
-        fileId
-      });
-      uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };
-    }
-    try {
-      const result = await raw.uploadPart(
-        uploadEntry.uploadUrl,
-        {
-          authorization: uploadEntry.authorizationToken,
-          partNumber,
-          contentLength: data.byteLength,
-          contentSha1: sha1Hex,
-          ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}
-        },
-        data,
-        options.signal
-      );
-      accountInfo.returnPartUploadUrl(fileId, uploadEntry);
-      partSha1s[partNumber - 1] = result.contentSha1;
-      tracker.addBytes(data.byteLength);
-      tracker.completePart();
-    } catch (err) {
-      accountInfo.evictPartUploadUrl(fileId, uploadEntry);
-      throw err;
-    }
-  }
-  function dispatchPart() {
-    if (pending.length === 0) return;
-    let data;
-    if (pending.length === 1) {
-      const head = pending[0];
-      if (!head) return;
-      data = head;
-    } else {
-      const total = pending.reduce((sum, chunk) => sum + chunk.byteLength, 0);
-      data = new Uint8Array(total);
-      let offset = 0;
-      for (const chunk of pending) {
-        data.set(chunk, offset);
-        offset += chunk.byteLength;
-      }
-    }
-    pending.length = 0;
-    pendingBytes = 0;
-    const partNumber = nextPartNumber++;
-    const task = (async () => {
-      await sem.acquire();
-      try {
-        await shipPart(data, partNumber);
-      } catch (err) {
-        errored = toError(err);
-        throw err;
-      } finally {
-        sem.release();
-      }
-    })();
-    inflight.push(task);
-    task.catch(() => {
-    });
-  }
-  const writable = new WritableStream({
-    async write(chunk) {
-      if (errored) throw errored;
-      options.signal?.throwIfAborted();
-      pending.push(chunk);
-      pendingBytes += chunk.byteLength;
-      while (pendingBytes >= partSize) {
-        const carved = carveExact(pending, partSize);
-        const partNumber = nextPartNumber++;
-        pendingBytes -= partSize;
-        const task = (async () => {
-          await sem.acquire();
-          try {
-            await shipPart(carved, partNumber);
-          } catch (err) {
-            errored = toError(err);
-            throw err;
-          } finally {
-            sem.release();
-          }
-        })();
-        inflight.push(task);
-        task.catch(() => {
-        });
-      }
-    },
-    async close() {
-      try {
-        if (errored) throw errored;
-        options.signal?.throwIfAborted();
-        if (pendingBytes > 0) {
-          dispatchPart();
-        }
-        await Promise.all(inflight);
-        if (errored) throw errored;
-        if (largeFileId === null) {
-          throw new Error("createWriteStream closed without any data written.");
-        }
-        const result = await raw.finishLargeFile(
-          accountInfo.getApiUrl(),
-          accountInfo.getAuthToken(),
-          { fileId: largeFileId, partSha1Array: partSha1s }
-        );
-        resolveDone(result);
-      } catch (err) {
-        const fileIdToCancel = largeFileId;
-        if (fileIdToCancel !== null) {
-          await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel);
-        }
-        rejectDone(err);
-        throw err;
-      }
-    },
-    async abort(reason) {
-      const fileIdToCancel = largeFileId;
-      if (fileIdToCancel !== null) {
-        await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel);
-      }
-      rejectDone(toError(reason));
-    }
-  });
-  return { writable, done };
-}
-function carveExact(chunks, size) {
-  const out = new Uint8Array(size);
-  let written = 0;
-  while (written < size && chunks.length > 0) {
-    const head = chunks[0];
-    if (!head) break;
-    const need = size - written;
-    if (head.byteLength <= need) {
-      out.set(head, written);
-      written += head.byteLength;
-      chunks.shift();
-    } else {
-      out.set(head.subarray(0, need), written);
-      chunks[0] = head.subarray(need);
-      written += need;
-    }
-  }
-  return out;
-}
 
-//# sourceMappingURL=stream.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/object.js
 
 
+//#region src/download/parallel.ts
+/**
+* Creates a readable stream that downloads a file using parallel byte-range requests.
+*
+* The file is split into fixed-size ranges fetched in a **sliding
+* window** keyed off the consumer's read pace. The window size is
+* `concurrency * 2`: up to `concurrency` ranges are in flight at once,
+* plus up to `concurrency` completed-but-not-yet-emitted ranges buffered
+* ahead of the read head. New fetches kick off only when the consumer
+* reads a chunk, so a slow downstream pipe (e.g. a saturated network
+* sink or a `pipeTo` consumer that drains slowly) backpressures into
+* the SDK and bounds peak memory to `(concurrency * 2) * rangeSize`.
+*
+* The previous eager implementation scheduled every range into
+* `Promise.all` up front; a slow head-of-line range could hold the
+* entire file in memory while later ranges finished and waited.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param options - Parallel download parameters (file ID, size, concurrency).
+*
+* @returns A `ReadableStream` that yields file bytes in order.
+*/
+function createParallelDownloadStream(raw, accountInfo, options) {
+	const rangeSize = options.rangeSize ?? 10 * 1024 * 1024;
+	const concurrency = options.concurrency ?? 4;
+	const totalSize = options.totalSize;
+	const retryOptions = {
+		...DEFAULT_RETRY_OPTIONS,
+		maxRetries: options.maxRetries ?? 0
+	};
+	const abort = options.signal;
+	const ranges = planRanges(totalSize, rangeSize);
+	const windowSize = concurrency * 2;
+	const inflight = /* @__PURE__ */ new Map();
+	const buffer = /* @__PURE__ */ new Map();
+	let assembledSha1 = null;
+	let nextToSchedule = 0;
+	let nextToEmit = 0;
+	let expectedSha1;
+	let firstError = null;
+	function scheduleNext() {
+		while (firstError === null && abort?.aborted !== true && nextToSchedule < ranges.length && inflight.size + buffer.size < windowSize) {
+			const range = ranges[nextToSchedule];
+			if (range === void 0) break;
+			const idx = nextToSchedule;
+			nextToSchedule++;
+			const task = (async () => {
+				try {
+					const result = await fetchRangeWithRetry(raw, accountInfo, options.fileId, range.start, range.end, totalSize, retryOptions, abort);
+					buffer.set(idx, result);
+				} catch (err) {
+					if (firstError === null) firstError = err;
+				} finally {
+					inflight.delete(idx);
+				}
+			})();
+			inflight.set(idx, task);
+		}
+	}
+	return new ReadableStream({
+		start(controller) {
+			try {
+				abort?.throwIfAborted();
+				scheduleNext();
+			} catch (err) {
+				controller.error(err);
+			}
+		},
+		async pull(controller) {
+			try {
+				while (!buffer.has(nextToEmit)) {
+					abort?.throwIfAborted();
+					if (firstError !== null) throw firstError;
+					if (inflight.size === 0) {
+						controller.close();
+						return;
+					}
+					await Promise.race(inflight.values());
+				}
+				const result = buffer.get(nextToEmit);
+				if (result !== void 0) {
+					buffer.delete(nextToEmit);
+					nextToEmit++;
+					const rangeSha1 = normalizeVerifiableSha1(result.contentSha1);
+					if (expectedSha1 === void 0) expectedSha1 = rangeSha1;
+					else assertDownloadSha1HeaderAgreement(expectedSha1, rangeSha1);
+					if (expectedSha1 !== null) {
+						assembledSha1 ??= new IncrementalSha1();
+						await assembledSha1.update(result.data);
+					}
+					controller.enqueue(result.data);
+				}
+				scheduleNext();
+				if (nextToEmit >= ranges.length && buffer.size === 0 && inflight.size === 0 && firstError === null) {
+					if (expectedSha1 !== void 0 && expectedSha1 !== null && assembledSha1 !== null) assertDownloadSha1(expectedSha1, await assembledSha1.digest());
+					controller.close();
+				}
+			} catch (err) {
+				controller.error(err);
+			}
+		},
+		cancel() {
+			buffer.clear();
+		}
+	});
+}
+/**
+* Fetches a single byte range with bounded retry on transient failures.
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state.
+* @param fileId - ID of the file being downloaded.
+* @param start - Inclusive byte offset where the range begins.
+* @param end - Inclusive byte offset where the range ends.
+* @param totalSize - Expected complete file size.
+* @param retryOptions - Retry settings controlling attempts and backoff.
+* @param signal - Optional abort signal that cancels the range and any pending retry.
+*
+* @returns The range's bytes, or throws after exhausting all retry attempts.
+*/
+async function fetchRangeWithRetry(raw, accountInfo, fileId, start, end, totalSize, retryOptions, signal) {
+	let lastError;
+	for (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {
+		if (attempt > 0) {
+			const retryAfter = lastError instanceof B2Error && lastError.retryAfter !== void 0 ? lastError.retryAfter : void 0;
+			await sleep(computeBackoff(attempt - 1, retryOptions, retryAfter), signal);
+		}
+		try {
+			signal?.throwIfAborted();
+			const resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), fileId, {
+				range: byteRangeHeader(start, end),
+				...signal !== void 0 ? { signal } : {}
+			});
+			if (resp.status < 200 || resp.status >= 300) throw await classifyDownloadResponseError(resp);
+			if (!resp.body) throw new Error("Download chunk has no body");
+			const data = await collect_collectStream(resp.body);
+			validateRangeResponse(resp, start, end, totalSize, data.byteLength);
+			return {
+				data,
+				contentSha1: normalizeSha1(resp.headers.get("X-Bz-Content-Sha1"))
+			};
+		} catch (err) {
+			lastError = err;
+			if (signal?.aborted) throw err;
+			if (err instanceof DOMException && err.name === "AbortError") throw err;
+			if (!isRetryableRangeError(err) || attempt === retryOptions.maxRetries) throw err;
+		}
+	}
+	throw lastError instanceof Error ? lastError : /* @__PURE__ */ new Error("Range download failed after retries");
+}
+var RangeValidationError = class extends Error {
+	retryable = false;
+	constructor(message) {
+		super(message);
+		this.name = "RangeValidationError";
+	}
+};
+function validateRangeResponse(response, start, end, totalSize, byteLength) {
+	const expectedLength = end - start + 1;
+	if (response.status !== 206) throw new RangeValidationError(`Expected HTTP 206 Partial Content for range ${start}-${end}, got ${response.status}`);
+	const contentRange = response.headers.get("Content-Range");
+	if (contentRange === null) throw new RangeValidationError(`Missing Content-Range for range ${start}-${end}`);
+	const match = contentRange.match(/^bytes (\d+)-(\d+)\/(\d+|\*)$/);
+	if (match === null) throw new RangeValidationError(`Invalid Content-Range for range ${start}-${end}: ${contentRange}`);
+	const actualStart = Number.parseInt(match[1] ?? "", 10);
+	const actualEnd = Number.parseInt(match[2] ?? "", 10);
+	const actualTotal = match[3] ?? "";
+	if (actualStart !== start || actualEnd !== end) throw new RangeValidationError(`Content-Range ${contentRange} does not match requested range ${start}-${end}`);
+	if (actualTotal === "*") throw new RangeValidationError(`Content-Range ${contentRange} does not include total size`);
+	if (Number.parseInt(actualTotal, 10) !== totalSize) throw new RangeValidationError(`Content-Range ${contentRange} does not match expected total size ${totalSize}`);
+	if (byteLength !== expectedLength) throw new RangeValidationError(`Expected ${expectedLength} bytes for range ${start}-${end}, got ${byteLength}`);
+}
+async function classifyDownloadResponseError(response) {
+	let errorBody = {
+		status: response.status,
+		code: "internal_error",
+		message: `HTTP ${response.status}`
+	};
+	if (response.body !== null) {
+		const bytes = await collect_collectStream(response.body);
+		try {
+			const parsed = JSON.parse(utf8Decoder.decode(bytes));
+			errorBody = {
+				status: response.status,
+				code: parsed.code ?? "internal_error",
+				message: parsed.message ?? `HTTP ${response.status}`
+			};
+		} catch {}
+	}
+	const retryAfterHeader = response.headers.get("Retry-After");
+	const retryAfter = retryAfterHeader !== null ? Number.parseInt(retryAfterHeader, 10) : void 0;
+	const requestId = response.headers.get("X-Bz-Request-Id") ?? void 0;
+	return classifyError(errorBody, {
+		...retryAfter !== void 0 ? { retryAfter } : {},
+		...requestId !== void 0 ? { requestId } : {}
+	});
+}
+function isRetryableRangeError(err) {
+	if (err instanceof B2Error || err instanceof NetworkError) return err.retryable;
+	if (hasRetryableFlag(err)) return err.retryable;
+	return err instanceof TypeError;
+}
+function hasRetryableFlag(err) {
+	return typeof err === "object" && err !== null && "retryable" in err && typeof err.retryable === "boolean";
+}
+//#endregion
 
 
+//# sourceMappingURL=parallel.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/stream.js
 
-class B2Object {
-  /** The file name (path) within the bucket. */
-  fileName;
-  client;
-  bucket;
-  /**
-   * @param client - The parent B2Client instance.
-   * @param bucket - The parent Bucket this object belongs to.
-   * @param fileName - The file path within the bucket.
-   *
-   * @internal
-   */
-  constructor(client, bucket, fileName) {
-    this.client = client;
-    this.bucket = bucket;
-    this.fileName = fileName;
-  }
-  /**
-   * Uploads data to this file name. Automatically uses multipart upload for large files.
-   * @param options - Upload configuration including data source and optional settings.
-   *
-   * @returns Metadata for the uploaded file version.
-   */
-  async upload(options) {
-    const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();
-    const isLarge = options.source.size > recommendedPartSize;
-    if (isLarge) {
-      return uploadLargeFile(this.client.raw, this.client.accountInfo, {
-        bucketId: this.bucket.id,
-        fileName: this.fileName,
-        ...options
-      });
-    }
-    const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options;
-    return uploadSmallFile(this.client.raw, this.client.accountInfo, {
-      bucketId: this.bucket.id,
-      fileName: this.fileName,
-      ...smallOptions
-    });
-  }
-  /**
-   * Downloads this file by name. Pass `method: 'HEAD'` to fetch only the
-   * response headers (file metadata) without streaming the body.
-   * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.
-   *
-   * @returns The download result with response headers and body stream.
-   */
-  async download(options) {
-    return downloadByName(this.client.raw, this.client.accountInfo, {
-      bucketName: this.bucket.name,
-      fileName: this.fileName,
-      ...options
-    });
-  }
-  /**
-   * Fetches response headers for this file via HTTP HEAD. Returns a
-   * body-less result so callers never have to drain the (logically
-   * empty) HEAD body themselves.
-   *
-   * @param options - Optional range, SSE-C decryption, response-header
-   *   overrides, and abort signal. Same shape as {@link B2Object.download}'s
-   *   options minus `method` (always HEAD) and `onProgress` (no body).
-   *
-   * @returns Parsed download headers (content type, SHA-1, file info, etc.).
-   */
-  async head(options) {
-    return headByName(this.client.raw, this.client.accountInfo, {
-      bucketName: this.bucket.name,
-      fileName: this.fileName,
-      ...options
-    });
-  }
-  /**
-   * Downloads a specific version of this file by ID. Pass `method: 'HEAD'`
-   * to fetch only the response headers (file metadata) without streaming the body.
-   * @param fileId - The file version ID to download.
-   * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.
-   *
-   * @returns The download result with response headers and body stream.
-   */
-  async downloadById(fileId, options) {
-    return downloadById(this.client.raw, this.client.accountInfo, {
-      fileId,
-      ...options
-    });
-  }
-  /**
-   * Fetches response headers for a specific version of this file by ID
-   * via HTTP HEAD. Returns a body-less result so callers never have to
-   * drain the (logically empty) HEAD body themselves.
-   *
-   * @param fileId - The file version ID to inspect.
-   * @param options - Optional range, SSE-C decryption, response-header
-   *   overrides, and abort signal.
-   *
-   * @returns Parsed download headers.
-   */
-  async headById(fileId, options) {
-    return headById(this.client.raw, this.client.accountInfo, {
-      fileId,
-      ...options
-    });
-  }
-  /**
-   * Creates a parallel-download ReadableStream that fetches the file in concurrent ranged chunks.
-   * @param fileId - The file version ID to download.
-   * @param totalSize - Total file size in bytes (needed to compute range boundaries).
-   * @param options - Concurrency, range size, and abort signal.
-   *
-   * @returns A Web ReadableStream of file data in sequential order.
-   */
-  createReadStream(fileId, totalSize, options) {
-    return createParallelDownloadStream(this.client.raw, this.client.accountInfo, {
-      fileId,
-      totalSize,
-      ...options
-    });
-  }
-  /**
-   * Creates a Web `WritableStream` that uploads streamed data into this file
-   * using the multipart protocol. Pipe a `ReadableStream` into the
-   * returned `writable` and await `done` to get the final {@link FileVersion}.
-   *
-   * Note: streaming uploads do not support resume because the size and per-part
-   * hashes are not known in advance. Use {@link upload} with a buffered source
-   * when resume is required.
-   *
-   * @param options - Streaming upload parameters (part size, concurrency, encryption).
-   *
-   * @returns A handle with the writable sink and a completion promise.
-   */
-  createWriteStream(options) {
-    return createWriteStream(this.client.raw, this.client.accountInfo, {
-      bucketId: this.bucket.id,
-      fileName: this.fileName,
-      ...options ?? {}
-    });
-  }
-  /**
-   * Retrieves metadata for a specific file version.
-   * @param fileId - The file version ID to look up.
-   *
-   * @returns The file version metadata.
-   */
-  async getFileInfo(fileId) {
-    return this.client.raw.getFileInfo(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      { fileId }
-    );
-  }
-  /**
-   * Hides this file by creating a hide marker at this file name.
-   *
-   * @returns Metadata for the newly created hide marker.
-   */
-  async hide() {
-    return this.bucket.hideFile(this.fileName);
-  }
-  /**
-   * Permanently deletes a specific version of this file.
-   * @param fileId - The unique identifier of the file version to delete.
-   */
-  async deleteVersion(fileId) {
-    await this.bucket.deleteFileVersion(this.fileName, fileId);
-  }
-  /**
-   * Sets or updates the Object Lock retention policy on a specific file
-   * version of this file.
-   *
-   * The bucket must have Object Lock enabled (`fileLockEnabled: true` at
-   * creation time). Governance-mode retention can be shortened or removed
-   * by passing `bypassGovernance: true` together with an application key
-   * that carries the `bypassGovernance` capability; compliance-mode
-   * retention cannot be shortened by anyone until the
-   * `retainUntilTimestamp` elapses.
-   *
-   * @param fileId - The file version to apply the policy to.
-   * @param retention - The retention policy to apply.
-   * @param options - Optional flag for shortening governance-mode retention.
-   *
-   * @returns Metadata for the updated file version.
-   */
-  async setRetention(fileId, retention, options) {
-    return this.bucket.updateFileRetention(this.fileName, fileId, retention, options);
-  }
-  /**
-   * Toggles the legal hold flag on a specific file version of this file.
-   *
-   * Legal hold is independent of retention: a file can be on legal hold
-   * without any retention policy, and vice versa. The bucket must have
-   * Object Lock enabled, and any caller must hold the `writeFileLegalHolds`
-   * capability.
-   *
-   * @param fileId - The file version to apply the flag to.
-   * @param legalHold - `'on'` to apply the hold, `'off'` to remove it.
-   *
-   * @returns Metadata for the updated file version.
-   */
-  async setLegalHold(fileId, legalHold) {
-    return this.bucket.updateFileLegalHold(this.fileName, fileId, legalHold);
-  }
-}
 
-//# sourceMappingURL=object.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/paginator.js
-async function* paginatePages(fetcher, signal) {
-  let cursor;
-  while (true) {
-    signal?.throwIfAborted();
-    const { page, nextCursor } = await fetcher(cursor);
-    yield page;
-    if (nextCursor === void 0) return;
-    cursor = nextCursor;
-  }
-}
-async function* paginateItems(fetcher, extractItems, signal) {
-  for await (const page of paginatePages(fetcher, signal)) {
-    yield* extractItems(page);
-  }
-}
 
-//# sourceMappingURL=paginator.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/bucket.js
 
 
 
 
+//#region src/upload/stream.ts
+/**
+* Creates a {@link WritableStream} that streams data into a B2 multipart upload.
+*
+* Buffers incoming chunks until `partSize` bytes are accumulated, ships each
+* complete part through the standard multipart engine, and finalizes the file
+* once the stream is closed. Honours backpressure via the queue's bounded
+* concurrency. Streaming uploads do not support resume because the total size
+* and per-part hashes aren't known in advance; use {@link uploadLargeFile} with
+* a buffered source when resume is required.
+*
+* @param raw - Low-level B2 API client.
+* @param accountInfo - Authorized account state (tokens, URLs, part URL pool).
+* @param options - Streaming upload parameters.
+*
+* @returns A {@link UploadWriteHandle} with the writable sink and a completion promise.
+*/
+function createWriteStream(raw, accountInfo, options) {
+	const minPartSize = accountInfo.getAbsoluteMinimumPartSize();
+	const recommendedPartSize = accountInfo.getRecommendedPartSize();
+	const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);
+	const concurrency = options.concurrency ?? 4;
+	const tracker = new ProgressTracker(options.onProgress, null, null);
+	const sem = new Semaphore(concurrency);
+	const abortScope = createAbortScope(options.signal);
+	let largeFileId = null;
+	let startPromise = null;
+	let cancelAfterStartScheduled = false;
+	let nextPartNumber = 1;
+	let pendingBytes = 0;
+	const pending = [];
+	const partSha1s = [];
+	const inflight = [];
+	let errored = null;
+	const { promise: done, resolve: resolveDone, reject: rejectDone } = Promise.withResolvers();
+	done.catch(() => {});
+	function ensureStarted() {
+		if (largeFileId !== null) return Promise.resolve(largeFileId);
+		if (startPromise === null) startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {
+			bucketId: options.bucketId,
+			fileName: options.fileName,
+			contentType: options.contentType ?? "b2/x-auto",
+			fileInfo: options.fileInfo ?? {},
+			...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}
+		}, {
+			signal: abortScope.signal,
+			...options.retry !== void 0 ? { retry: options.retry } : {}
+		}).then((resp) => {
+			largeFileId = resp.fileId;
+			if (abortScope.signal.aborted || errored !== null) cancelStartedLargeFile(largeFileId);
+			return largeFileId;
+		});
+		const started = startPromise;
+		return raceWithAbort(started, abortScope.signal).catch((err) => {
+			if (abortScope.signal.aborted) scheduleCancelLargeFileAfterStart(started);
+			throw err;
+		});
+	}
+	async function shipPart(data, partNumber) {
+		if (errored !== null) throw errored;
+		abortScope.signal.throwIfAborted();
+		const fileId = await ensureStarted();
+		if (errored !== null) throw errored;
+		abortScope.signal.throwIfAborted();
+		const sha1 = new IncrementalSha1();
+		await sha1.update(data);
+		const sha1Hex = await sha1.digest();
+		abortScope.signal.throwIfAborted();
+		const result = await uploadPartWithFreshUrl(raw, accountInfo, fileId, {
+			fileName: options.fileName,
+			partNumber,
+			data,
+			contentLength: data.byteLength,
+			contentSha1: sha1Hex,
+			retry: options.retry,
+			signal: abortScope.signal,
+			onUploadRetry: options.onUploadRetry,
+			retryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),
+			...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}
+		});
+		partSha1s[partNumber - 1] = result.contentSha1;
+		tracker.addBytes(data.byteLength);
+		tracker.completePart();
+	}
+	function markErrored(err) {
+		const error = toError(err);
+		errored = error;
+		abortScope.abort(error);
+		return error;
+	}
+	function cancelStartedLargeFile(fileId) {
+		if (cancelAfterStartScheduled) return;
+		cancelAfterStartScheduled = true;
+		cancelLargeFileBestEffort(raw, accountInfo, fileId, cleanupWriteStreamOptions(options));
+	}
+	function scheduleCancelLargeFileAfterStart(started) {
+		started.then((fileId) => cancelStartedLargeFile(fileId)).catch(() => {});
+	}
+	async function settleInflightForClose() {
+		const settled = Promise.allSettled(inflight);
+		if (startPromise === null || largeFileId !== null) return await settled;
+		const abortWaiter = waitForAbort(abortScope.signal);
+		try {
+			if (await Promise.race([
+				settled.then(() => "settled"),
+				startPromise.then(() => "start-settled", () => "start-settled"),
+				abortWaiter.promise.then(() => "aborted")
+			]) === "aborted" && largeFileId === null) throw abortReason(abortScope.signal);
+			return await settled;
+		} finally {
+			abortWaiter.dispose();
+		}
+	}
+	function startPartWithAcquiredSlot(data, partNumber) {
+		const task = (async () => {
+			try {
+				await shipPart(data, partNumber);
+			} catch (err) {
+				markErrored(err);
+				throw err;
+			} finally {
+				sem.release();
+			}
+		})();
+		inflight.push(task);
+		task.catch(() => {});
+	}
+	async function acquirePartSlot() {
+		await sem.acquire();
+		if (errored !== null) {
+			sem.release();
+			throw errored;
+		}
+		try {
+			abortScope.signal.throwIfAborted();
+		} catch (err) {
+			sem.release();
+			throw err;
+		}
+	}
+	async function waitForInflightPartsToSettle(timeoutMs = DEFAULT_CLEANUP_TIMEOUT_MS) {
+		if (inflight.length === 0) return;
+		let timeout;
+		try {
+			await Promise.race([Promise.allSettled(inflight).then(() => void 0), new Promise((resolve) => {
+				timeout = setTimeout(resolve, timeoutMs);
+			})]);
+		} finally {
+			if (timeout !== void 0) clearTimeout(timeout);
+		}
+	}
+	async function dispatchPart() {
+		if (pending.length === 0) return;
+		await acquirePartSlot();
+		let data;
+		if (pending.length === 1) {
+			const head = pending[0];
+			if (!head) {
+				sem.release();
+				return;
+			}
+			data = head;
+		} else {
+			const total = pending.reduce((sum, chunk) => sum + chunk.byteLength, 0);
+			data = new Uint8Array(total);
+			let offset = 0;
+			for (const chunk of pending) {
+				data.set(chunk, offset);
+				offset += chunk.byteLength;
+			}
+		}
+		pending.length = 0;
+		pendingBytes = 0;
+		const partNumber = nextPartNumber++;
+		startPartWithAcquiredSlot(data, partNumber);
+	}
+	return {
+		writable: new WritableStream({
+			async write(chunk) {
+				if (errored) throw errored;
+				abortScope.signal.throwIfAborted();
+				if (chunk.byteLength === 0) return;
+				pending.push(chunk);
+				pendingBytes += chunk.byteLength;
+				while (pendingBytes >= partSize) {
+					await acquirePartSlot();
+					if (errored) {
+						sem.release();
+						throw errored;
+					}
+					const carved = carveExact(pending, partSize);
+					const partNumber = nextPartNumber++;
+					pendingBytes -= partSize;
+					startPartWithAcquiredSlot(carved, partNumber);
+				}
+			},
+			async close() {
+				try {
+					if (errored) throw errored;
+					abortScope.signal.throwIfAborted();
+					if (pendingBytes > 0) await dispatchPart();
+					const rejected = (await settleInflightForClose()).find((result) => result.status === "rejected");
+					if (rejected !== void 0 && errored === null) markErrored(rejected.reason);
+					if (errored) throw errored;
+					if (largeFileId === null) throw new Error("createWriteStream closed without any data written.");
+					const result = await finishLargeFileWithAbortReconciliation(raw, accountInfo, {
+						fileId: largeFileId,
+						bucketId: options.bucketId,
+						fileName: options.fileName,
+						partSha1s,
+						signal: abortScope.signal,
+						...options.retry !== void 0 ? { retry: options.retry } : {}
+					});
+					abortScope.dispose();
+					resolveDone(result);
+				} catch (err) {
+					const closeError = toError(err);
+					if (errored === null) errored = closeError;
+					abortScope.abort(errored);
+					const observedError = errored;
+					const fileIdToCancel = largeFileId;
+					if (fileIdToCancel === null && startPromise !== null) {
+						scheduleCancelLargeFileAfterStart(startPromise);
+						abortScope.dispose();
+						rejectDone(observedError);
+						throw observedError;
+					}
+					await Promise.allSettled(inflight);
+					let finalError = observedError;
+					if (fileIdToCancel !== null) finalError = await resolveLargeFileErrorAfterCleanup(observedError, raw, accountInfo, {
+						fileId: fileIdToCancel,
+						bucketId: options.bucketId,
+						fileName: options.fileName,
+						signal: options.signal,
+						onCleanupFailure: options.onCleanupFailure
+					});
+					abortScope.dispose();
+					rejectDone(finalError);
+					throw finalError;
+				}
+			},
+			async abort(reason) {
+				const abortError = markErrored(reason);
+				pending.length = 0;
+				pendingBytes = 0;
+				const fileIdToCancel = largeFileId;
+				if (fileIdToCancel === null && startPromise !== null) scheduleCancelLargeFileAfterStart(startPromise);
+				if (fileIdToCancel !== null) {
+					await waitForInflightPartsToSettle();
+					await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel, cleanupWriteStreamOptions(options));
+				}
+				abortScope.dispose();
+				rejectDone(abortError);
+			}
+		}),
+		done
+	};
+}
+function cleanupWriteStreamOptions(options) {
+	return {
+		...options.signal !== void 0 ? { signal: options.signal } : {},
+		...options.onCleanupFailure !== void 0 ? { onCleanupFailure: options.onCleanupFailure } : {}
+	};
+}
+/**
+* Removes exactly `size` bytes from the front of `chunks` (mutates) and returns
+* them as a contiguous Uint8Array. Any trailing remainder of the last chunk
+* stays at the front of `chunks` for the next part.
+*
+* @param chunks - Queue of pending chunks. Modified in place.
+* @param size - Number of bytes to carve off the front.
+*
+* @returns A new Uint8Array containing exactly `size` bytes.
+*/
+function carveExact(chunks, size) {
+	const out = new Uint8Array(size);
+	let written = 0;
+	while (written < size && chunks.length > 0) {
+		const head = chunks[0];
+		if (!head) break;
+		const need = size - written;
+		if (head.byteLength <= need) {
+			out.set(head, written);
+			written += head.byteLength;
+			chunks.shift();
+		} else {
+			out.set(head.subarray(0, need), written);
+			chunks[0] = head.subarray(need);
+			written += need;
+		}
+	}
+	return out;
+}
+function waitForAbort(signal) {
+	if (signal.aborted) return {
+		promise: Promise.resolve(abortReason(signal)),
+		dispose() {}
+	};
+	let onAbort;
+	return {
+		promise: new Promise((resolve) => {
+			onAbort = () => resolve(abortReason(signal));
+			signal.addEventListener("abort", onAbort, { once: true });
+		}),
+		dispose() {
+			if (onAbort !== void 0) signal.removeEventListener("abort", onAbort);
+		}
+	};
+}
+//#endregion
 
 
+//# sourceMappingURL=stream.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/object.js
+
+
+
+
+
+
+
+//#region src/object.ts
+function bucketDefaultRetentionSnapshot(info) {
+	const fileLock = info.fileLockConfiguration;
+	if (!fileLock.isClientAuthorizedToRead) return { unreadable: true };
+	if (fileLock.value === null) return { unreadable: false };
+	return {
+		retention: fileLock.value.defaultRetention,
+		unreadable: false
+	};
+}
+function resumeNeedsFreshBucketDefaults(options) {
+	return (options.resume === true || options.resumeFileId !== void 0) && (options.serverSideEncryption === void 0 || options.fileRetention === void 0);
+}
+/**
+* Handle to a specific file (by name) within a B2 bucket.
+*
+* Provides file-scoped upload, download, and management operations.
+* Obtained via {@link Bucket.file}.
+*
+* @example
+* ```ts
+* const obj = bucket.file('photos/2026/sunset.jpg')
+* await obj.upload({ source: new BufferSource(data) })
+* const result = await obj.download()
+* ```
+*/
+var B2Object = class {
+	/** The file name (path) within the bucket. */
+	fileName;
+	client;
+	bucket;
+	uploadRetryOptions;
+	/**
+	* @param client - The parent B2Client instance.
+	* @param bucket - The parent Bucket this object belongs to.
+	* @param fileName - The file path within the bucket.
+	* @param uploadRetryOptions - Resolved client upload retry defaults.
+	*
+	* @internal
+	*/
+	constructor(client, bucket, fileName, uploadRetryOptions) {
+		this.client = client;
+		this.bucket = bucket;
+		this.fileName = fileName;
+		this.uploadRetryOptions = uploadRetryOptions;
+	}
+	/**
+	* Uploads data to this file name. Automatically uses multipart upload for large files.
+	* @param options - Upload configuration including data source and optional settings.
+	*
+	* @returns Metadata for the uploaded file version.
+	*/
+	async upload(options) {
+		const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();
+		const isLarge = options.source.size > recommendedPartSize;
+		const uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options.retry);
+		if (isLarge) {
+			const bucketInfo = resumeNeedsFreshBucketDefaults(options) ? await this.fetchFreshBucketInfo() : this.bucket.info;
+			const bucketDefaultRetention = bucketDefaultRetentionSnapshot(bucketInfo);
+			return uploadLargeFile(this.client.raw, this.client.accountInfo, {
+				...options,
+				bucketId: this.bucket.id,
+				fileName: this.fileName,
+				retry: uploadRetryOptions,
+				bucketDefaultServerSideEncryption: bucketInfo.defaultServerSideEncryption,
+				...bucketDefaultRetention.retention !== void 0 ? { bucketDefaultRetention: bucketDefaultRetention.retention } : {},
+				...bucketDefaultRetention.unreadable ? { bucketDefaultRetentionUnreadable: true } : {}
+			});
+		}
+		rejectSmallResumeFileId(options, "B2Object.upload");
+		const smallOptions = stripResumeOnlyOptions(options);
+		return uploadSmallFile(this.client.raw, this.client.accountInfo, {
+			...smallOptions,
+			bucketId: this.bucket.id,
+			fileName: this.fileName,
+			retry: uploadRetryOptions
+		});
+	}
+	async fetchFreshBucketInfo() {
+		const found = (await this.client.listBuckets({ bucketId: this.bucket.id }))[0];
+		if (!found) throw new Error(`Bucket ${this.bucket.id} not found`);
+		return found.info;
+	}
+	/**
+	* Downloads this file by name. Pass `method: 'HEAD'` to fetch only the
+	* response headers (file metadata) without streaming the body.
+	* @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.
+	*
+	* @returns The download result with response headers and body stream.
+	*/
+	async download(options) {
+		return downloadByName(this.client.raw, this.client.accountInfo, {
+			bucketName: this.bucket.name,
+			fileName: this.fileName,
+			...options
+		});
+	}
+	/**
+	* Fetches response headers for this file via HTTP HEAD. Returns a
+	* body-less result so callers never have to drain the (logically
+	* empty) HEAD body themselves.
+	*
+	* @param options - Optional range, SSE-C decryption, response-header
+	*   overrides, and abort signal. Same shape as {@link B2Object.download}'s
+	*   options minus `method` (always HEAD) and `onProgress` (no body).
+	*
+	* @returns Parsed download headers (content type, SHA-1, file info, etc.).
+	*/
+	async head(options) {
+		return headByName(this.client.raw, this.client.accountInfo, {
+			bucketName: this.bucket.name,
+			fileName: this.fileName,
+			...options
+		});
+	}
+	/**
+	* Downloads a specific version of this file by ID. Pass `method: 'HEAD'`
+	* to fetch only the response headers (file metadata) without streaming the body.
+	* @param fileId - The file version ID to download.
+	* @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.
+	*
+	* @returns The download result with response headers and body stream.
+	*/
+	async downloadById(fileId, options) {
+		return downloadById(this.client.raw, this.client.accountInfo, {
+			fileId,
+			...options
+		});
+	}
+	/**
+	* Fetches response headers for a specific version of this file by ID
+	* via HTTP HEAD. Returns a body-less result so callers never have to
+	* drain the (logically empty) HEAD body themselves.
+	*
+	* @param fileId - The file version ID to inspect.
+	* @param options - Optional range, SSE-C decryption, response-header
+	*   overrides, and abort signal.
+	*
+	* @returns Parsed download headers.
+	*/
+	async headById(fileId, options) {
+		return headById(this.client.raw, this.client.accountInfo, {
+			fileId,
+			...options
+		});
+	}
+	/**
+	* Creates a parallel-download ReadableStream that fetches the file in concurrent ranged chunks.
+	* @param fileId - The file version ID to download.
+	* @param totalSize - Total file size in bytes (needed to compute range boundaries).
+	* @param options - Concurrency, range size, and abort signal.
+	*
+	* @returns A Web ReadableStream of file data in sequential order.
+	*/
+	createReadStream(fileId, totalSize, options) {
+		return createParallelDownloadStream(this.client.raw, this.client.accountInfo, {
+			fileId,
+			totalSize,
+			...options
+		});
+	}
+	/**
+	* Creates a Web `WritableStream` that uploads streamed data into this file
+	* using the multipart protocol. Pipe a `ReadableStream` into the
+	* returned `writable` and await `done` to get the final {@link FileVersion}.
+	*
+	* Note: streaming uploads do not support resume because the size and per-part
+	* hashes are not known in advance. Use {@link upload} with a buffered source
+	* when resume is required.
+	*
+	* @param options - Streaming upload parameters (part size, concurrency, encryption).
+	*
+	* @returns A handle with the writable sink and a completion promise.
+	*/
+	createWriteStream(options) {
+		const uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options?.retry);
+		return createWriteStream(this.client.raw, this.client.accountInfo, {
+			...options ?? {},
+			bucketId: this.bucket.id,
+			fileName: this.fileName,
+			retry: uploadRetryOptions
+		});
+	}
+	/**
+	* Retrieves metadata for a specific file version.
+	* @param fileId - The file version ID to look up.
+	*
+	* @returns The file version metadata.
+	*/
+	async getFileInfo(fileId) {
+		return this.client.raw.getFileInfo(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { fileId });
+	}
+	/**
+	* Hides this file by creating a hide marker at this file name.
+	*
+	* @returns Metadata for the newly created hide marker.
+	*/
+	async hide() {
+		return this.bucket.hideFile(this.fileName);
+	}
+	/**
+	* Permanently deletes a specific version of this file.
+	* @param fileId - The unique identifier of the file version to delete.
+	*/
+	async deleteVersion(fileId) {
+		await this.bucket.deleteFileVersion(this.fileName, fileId);
+	}
+	/**
+	* Sets or updates the Object Lock retention policy on a specific file
+	* version of this file.
+	*
+	* The bucket must have Object Lock enabled (`fileLockEnabled: true` at
+	* creation time). Governance-mode retention can be shortened or removed
+	* by passing `bypassGovernance: true` together with an application key
+	* that carries the `bypassGovernance` capability; compliance-mode
+	* retention cannot be shortened by anyone until the
+	* `retainUntilTimestamp` elapses.
+	*
+	* @param fileId - The file version to apply the policy to.
+	* @param retention - The retention policy to apply.
+	* @param options - Optional flag for shortening governance-mode retention.
+	*
+	* @returns Metadata for the updated file version.
+	*/
+	async setRetention(fileId, retention, options) {
+		return this.bucket.updateFileRetention(this.fileName, fileId, retention, options);
+	}
+	/**
+	* Toggles the legal hold flag on a specific file version of this file.
+	*
+	* Legal hold is independent of retention: a file can be on legal hold
+	* without any retention policy, and vice versa. The bucket must have
+	* Object Lock enabled, and any caller must hold the `writeFileLegalHolds`
+	* capability.
+	*
+	* @param fileId - The file version to apply the flag to.
+	* @param legalHold - `'on'` to apply the hold, `'off'` to remove it.
+	*
+	* @returns Metadata for the updated file version.
+	*/
+	async setLegalHold(fileId, legalHold) {
+		return this.bucket.updateFileLegalHold(this.fileName, fileId, legalHold);
+	}
+};
+//#endregion
 
 
+//# sourceMappingURL=object.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/bucket.js
+
+
+
+
+
+
+
+
+
+
+
+
+//#region src/bucket.ts
+function bucket_bucketDefaultRetentionSnapshot(info) {
+	const fileLock = info.fileLockConfiguration;
+	if (!fileLock.isClientAuthorizedToRead) return { unreadable: true };
+	if (fileLock.value === null) return { unreadable: false };
+	return {
+		retention: fileLock.value.defaultRetention,
+		unreadable: false
+	};
+}
+function bucket_resumeNeedsFreshBucketDefaults(options) {
+	return (options.resume === true || options.resumeFileId !== void 0) && (options.serverSideEncryption === void 0 || options.fileRetention === void 0);
+}
+/**
+* Handle to a B2 bucket providing upload, download, listing, and management operations.
+*
+* Obtained via {@link B2Client.createBucket}, {@link B2Client.listBuckets}, or {@link B2Client.getBucket}.
+*
+* @example
+* ```ts
+* const bucket = await client.getBucket('my-bucket')
+* await bucket.upload({ fileName: 'hello.txt', source: new BufferSource(data) })
+* ```
+*/
+var Bucket = class {
+	/** Unique identifier for this bucket. */
+	id;
+	/** Human-readable bucket name. */
+	name;
+	/** Full bucket metadata as returned by the B2 API. */
+	info;
+	client;
+	uploadRetryOptions;
+	/**
+	* @param client - The parent B2Client instance.
+	* @param info - The bucket metadata from the API.
+	* @param uploadRetryOptions - Resolved client upload retry defaults.
+	*
+	* @internal
+	*/
+	constructor(client, info, uploadRetryOptions) {
+		this.client = client;
+		this.info = info;
+		this.id = info.bucketId;
+		this.name = info.bucketName;
+		this.uploadRetryOptions = uploadRetryOptions;
+	}
+	/**
+	* Returns a {@link B2Object} handle for a specific file name in this bucket.
+	* @param fileName - The file path within the bucket.
+	*
+	* @returns A B2Object handle bound to this bucket and file name.
+	*/
+	file(fileName) {
+		return new B2Object(this.client, this, fileName, this.uploadRetryOptions);
+	}
+	/**
+	* Uploads a file to this bucket. Automatically uses multipart upload for files
+	* larger than the recommended part size.
+	* @param options - Upload configuration including file name, source data, and optional settings.
+	*
+	* @returns Metadata for the uploaded file version.
+	*/
+	async upload(options) {
+		const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();
+		const isLarge = options.source.size > recommendedPartSize;
+		const uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options.retry);
+		if (isLarge) {
+			const bucketInfo = bucket_resumeNeedsFreshBucketDefaults(options) ? await this.refresh() : this.info;
+			const bucketDefaultRetention = bucket_bucketDefaultRetentionSnapshot(bucketInfo);
+			return uploadLargeFile(this.client.raw, this.client.accountInfo, {
+				...options,
+				bucketId: this.id,
+				retry: uploadRetryOptions,
+				bucketDefaultServerSideEncryption: bucketInfo.defaultServerSideEncryption,
+				...bucketDefaultRetention.retention !== void 0 ? { bucketDefaultRetention: bucketDefaultRetention.retention } : {},
+				...bucketDefaultRetention.unreadable ? { bucketDefaultRetentionUnreadable: true } : {}
+			});
+		}
+		rejectSmallResumeFileId(options, "Bucket.upload");
+		const smallOptions = stripResumeOnlyOptions(options);
+		return uploadSmallFile(this.client.raw, this.client.accountInfo, {
+			...smallOptions,
+			bucketId: this.id,
+			retry: uploadRetryOptions
+		});
+	}
+	/**
+	* Downloads a file from this bucket by name. Pass `method: 'HEAD'` in
+	* `options` to fetch only the response headers (file metadata) without
+	* streaming the body.
+	* @param fileName - The file name (path) to download.
+	* @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.
+	*
+	* @returns The download result containing response headers and a readable body stream.
+	*/
+	async download(fileName, options) {
+		return downloadByName(this.client.raw, this.client.accountInfo, {
+			bucketName: this.name,
+			fileName,
+			...options
+		});
+	}
+	/**
+	* Fetches the response headers (file metadata) for a file via HTTP
+	* HEAD. Returns a body-less result so callers never have to drain
+	* the (logically empty) HEAD body themselves.
+	*
+	* Use this for metadata-only checks like "does this file exist", "what
+	* is its current SHA-1", "what is its Content-Length". For full file
+	* retrieval use {@link Bucket.download}.
+	*
+	* @param fileName - The file name (path) to inspect.
+	* @param options - Optional range, SSE-C decryption, response-header
+	*   overrides, and abort signal. Same shape as {@link Bucket.download}'s
+	*   options minus `method` (always HEAD) and `onProgress` (no body).
+	*
+	* @returns Parsed download headers (content type, SHA-1, file info, etc.).
+	*
+	* @example
+	* ```ts
+	* const { headers } = await bucket.head('photos/2026/sunset.jpg')
+	* console.log(headers.contentLength, headers.contentSha1)
+	* ```
+	*/
+	async head(fileName, options) {
+		return headByName(this.client.raw, this.client.accountInfo, {
+			bucketName: this.name,
+			fileName,
+			...options
+		});
+	}
+	/**
+	* Lists file names in this bucket (most recent versions only).
+	* @param options - Optional filtering and pagination settings.
+	*
+	* @returns A page of file versions with an optional continuation token.
+	*/
+	async listFileNames(options) {
+		return this.client.raw.listFileNames(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			bucketId: this.id,
+			...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},
+			...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},
+			...options?.prefix !== void 0 ? { prefix: options.prefix } : {},
+			...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}
+		}, { ...options?.signal !== void 0 ? { signal: options.signal } : {} });
+	}
+	/**
+	* Lists all file versions in this bucket, including hidden files.
+	* @param options - Optional filtering and pagination settings.
+	*
+	* @returns A page of file versions with an optional continuation token.
+	*/
+	async listFileVersions(options) {
+		return this.client.raw.listFileVersions(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			bucketId: this.id,
+			...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},
+			...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},
+			...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},
+			...options?.prefix !== void 0 ? { prefix: options.prefix } : {},
+			...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}
+		}, { ...options?.signal !== void 0 ? { signal: options.signal } : {} });
+	}
+	/**
+	* Async iterator that yields the latest visible version of every file in
+	* the bucket, automatically handling pagination via `listFileNames`.
+	*
+	* Hidden files (those whose latest version is a hide marker) are NOT
+	* yielded by this iterator. Use {@link paginateFileVersions} when you
+	* need full version history.
+	*
+	* @param options - Filter + pagination + abort options. `pageSize` is
+	*   forwarded to `b2_list_file_names`'s `maxFileCount` (default 1000,
+	*   B2-capped at 10000).
+	*
+	* @returns An async iterable of {@link FileVersion} entries.
+	*
+	* @example
+	* ```ts
+	* for await (const file of bucket.paginateFileNames({ prefix: 'photos/' })) {
+	*   console.log(file.fileName, file.contentLength)
+	* }
+	* ```
+	*/
+	paginateFileNames(options) {
+		return paginateItems(async (cursor) => {
+			const resp = await this.listFileNames({
+				pageSize: options?.pageSize ?? 1e3,
+				...cursor !== void 0 ? { startFileName: cursor } : {},
+				...options?.prefix !== void 0 ? { prefix: options.prefix } : {},
+				...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {},
+				...options?.signal !== void 0 ? { signal: options.signal } : {}
+			});
+			return {
+				page: resp,
+				nextCursor: resp.nextFileName ?? void 0
+			};
+		}, (page) => page.files.filter((f) => f.action !== "hide"), options?.signal);
+	}
+	/**
+	* Async iterator that yields every version of every file in the bucket,
+	* including hidden files and historical versions, automatically handling
+	* pagination via `listFileVersions`.
+	*
+	* The two-cursor `(nextFileName, nextFileId)` continuation that the raw
+	* endpoint exposes is threaded internally; callers iterate flat.
+	*
+	* @param options - Filter + pagination + abort options.
+	*
+	* @returns An async iterable of {@link FileVersion} entries.
+	*/
+	paginateFileVersions(options) {
+		return paginateItems(async (cursor) => {
+			const resp = await this.listFileVersions({
+				pageSize: options?.pageSize ?? 1e3,
+				...cursor !== void 0 ? { startFileName: cursor.fileName } : {},
+				...cursor?.fileId !== void 0 ? { startFileId: cursor.fileId } : {},
+				...options?.prefix !== void 0 ? { prefix: options.prefix } : {},
+				...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {},
+				...options?.signal !== void 0 ? { signal: options.signal } : {}
+			});
+			return {
+				page: resp,
+				nextCursor: resp.nextFileName !== null ? {
+					fileName: resp.nextFileName,
+					fileId: resp.nextFileId ?? void 0
+				} : void 0
+			};
+		}, (page) => page.files, options?.signal);
+	}
+	/**
+	* Async iterator that yields every unfinished large file in the bucket,
+	* automatically handling pagination via `listUnfinishedLargeFiles`.
+	*
+	* Useful for janitorial scripts that want to inspect or cancel abandoned
+	* multipart uploads (typically followed by {@link cancelLargeFile} on
+	* the underlying raw client).
+	*
+	* @param options - Filter + pagination + abort options. `pageSize` is
+	*   B2-capped at 100 for this endpoint.
+	*
+	* @returns An async iterable of unfinished-large-file metadata entries.
+	*/
+	paginateUnfinishedLargeFiles(options) {
+		return paginateItems(async (cursor) => {
+			const resp = await this.listUnfinishedLargeFiles({
+				pageSize: options?.pageSize ?? 100,
+				...cursor !== void 0 ? { startFileId: cursor } : {},
+				...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},
+				...options?.signal !== void 0 ? { signal: options.signal } : {}
+			});
+			return {
+				page: resp,
+				nextCursor: resp.nextFileId ?? void 0
+			};
+		}, (page) => page.files, options?.signal);
+	}
+	/**
+	* Async iterator that yields every uploaded part for a specific large
+	* file, automatically handling pagination via `listParts`.
+	*
+	* @param largeFileId - The unfinished large file to enumerate parts of.
+	* @param options - Pagination + abort options. `pageSize` is B2-capped
+	*   at 1000 for this endpoint; the default is 1000.
+	*
+	* @returns An async iterable of {@link PartInfo} entries.
+	*/
+	paginateParts(largeFileId, options) {
+		return paginateItems(async (cursor) => {
+			const resp = await this.client.raw.listParts(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+				fileId: largeFileId,
+				maxPartCount: options?.pageSize ?? 1e3,
+				...cursor !== void 0 ? { startPartNumber: cursor } : {}
+			}, options?.signal !== void 0 ? { signal: options.signal } : void 0);
+			return {
+				page: resp,
+				nextCursor: resp.nextPartNumber ?? void 0
+			};
+		}, (page) => page.parts, options?.signal);
+	}
+	/**
+	* Looks up the latest visible version of a file by name.
+	* Uses `listFileNames` under the hood; returns `null` when the file does not
+	* exist or its latest version is a hide marker.
+	* @param fileName - The exact file path to look up.
+	*
+	* @returns The latest {@link FileVersion}, or `null` if not found.
+	*/
+	async getFileInfoByName(fileName) {
+		const match = (await this.listFileNames({
+			prefix: fileName,
+			pageSize: 1
+		})).files.find((f) => f.fileName === fileName);
+		if (!match || match.action === "hide") return null;
+		return match;
+	}
+	/**
+	* Removes the latest hide marker for a file, restoring visibility of the
+	* previous upload. Returns the deleted hide marker, or `null` if there was
+	* no hide marker to remove (file is already visible or does not exist).
+	* @param fileName - The file path to unhide.
+	*
+	* @returns The deleted hide marker version, or `null` if nothing was hidden.
+	*/
+	async unhideFile(fileName) {
+		const versions = (await this.listFileVersions({
+			prefix: fileName,
+			pageSize: 100
+		})).files.filter((f) => f.fileName === fileName);
+		if (versions.length === 0) return null;
+		const latest = versions[0];
+		if (latest?.action !== "hide") return null;
+		await this.deleteFileVersion(fileName, latest.fileId);
+		return latest;
+	}
+	/**
+	* Hides a file by creating a hide marker. The file remains in version history but is no longer visible in `listFileNames`.
+	* @param fileName - The file path to hide.
+	* @param options - Optional request controls such as an abort signal.
+	*
+	* @returns Metadata for the newly created hide marker.
+	*/
+	async hideFile(fileName, options) {
+		return this.client.raw.hideFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			bucketId: this.id,
+			fileName
+		}, options);
+	}
+	/**
+	* Permanently deletes a specific file version. Both file name and file ID are required.
+	*
+	* If the file is under Object Lock retention, B2 will reject the
+	* delete: compliance-mode files cannot be deleted until the retention
+	* expires; governance-mode files require `bypassGovernance: true`
+	* AND a calling key with the `bypassGovernance` capability. Files on
+	* legal hold cannot be deleted by anyone until the hold is removed.
+	*
+	* @param fileName - The file path of the version to delete.
+	* @param fileId - The unique identifier of the file version to delete.
+	* @param options - Optional governance and abort controls.
+	*/
+	async deleteFileVersion(fileName, fileId, options) {
+		await this.client.raw.deleteFileVersion(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			fileName,
+			fileId,
+			...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}
+		}, options?.signal !== void 0 ? { signal: options.signal } : void 0);
+	}
+	/**
+	* Cancels an in-progress large file upload so the partial parts are not
+	* retained or billed. The most common reason to call this is to clean up
+	* abandoned multipart uploads surfaced by {@link listUnfinishedLargeFiles}.
+	* @param fileId - The unique identifier of the unfinished large file to cancel.
+	*
+	* @returns Metadata about the cancelled large file.
+	*/
+	async cancelLargeFile(fileId) {
+		return this.client.raw.cancelLargeFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { fileId });
+	}
+	/**
+	* Lists large files in this bucket that were started but never finished or
+	* cancelled. Wraps `b2_list_unfinished_large_files`.
+	* @param options - Optional pagination filters.
+	*
+	* @returns The page of unfinished large files plus a continuation token.
+	*/
+	async listUnfinishedLargeFiles(options) {
+		return this.client.raw.listUnfinishedLargeFiles(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			bucketId: this.id,
+			...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},
+			...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},
+			...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}
+		}, options?.signal !== void 0 ? { signal: options.signal } : void 0);
+	}
+	/**
+	* Deletes many file versions with bounded concurrency. Errors from individual
+	* deletes are collected and returned rather than thrown, so partial success
+	* does not abort the run.
+	*
+	* When `options.signal` is supplied and aborted, in-flight deletes
+	* complete (they're already on the wire), but no new deletes start
+	* after the abort fires. Subsequent targets are short-circuited to an
+	* error entry so the result tally reflects what actually happened.
+	* @param targets - File versions to delete.
+	* @param options - Optional concurrency override and abort signal.
+	*   Concurrency defaults to the SDK-wide bulk-metadata setting
+	*   (currently 10, higher than transfer concurrency because each
+	*   task is a single tiny API round-trip).
+	*
+	* @returns A summary of successes and per-target errors.
+	*/
+	async deleteMany(targets, options) {
+		const sem = new Semaphore(options?.concurrency ?? 10);
+		const signal = options?.signal;
+		let deleted = 0;
+		const errors = [];
+		await Promise.all(targets.map(async (target) => {
+			await sem.acquire();
+			try {
+				if (signal?.aborted) {
+					errors.push({
+						target,
+						error: toError(signal.reason ?? "aborted")
+					});
+					return;
+				}
+				await this.deleteFileVersion(target.fileName, target.fileId);
+				deleted++;
+			} catch (err) {
+				errors.push({
+					target,
+					error: toError(err)
+				});
+			} finally {
+				sem.release();
+			}
+		}));
+		return {
+			deleted,
+			errors
+		};
+	}
+	/**
+	* Async generator that streams every file version in the bucket (optionally
+	* filtered by prefix) and deletes each one. Yields a {@link DeleteAllEvent}
+	* per file version. With `dryRun: true`, no deletes are performed but `skip`
+	* events are still emitted.
+	* @param options - Optional prefix filter, page size, and dry-run flag.
+	*
+	* @returns An async generator of per-file events.
+	*/
+	async *deleteAll(options) {
+		const dryRun = options?.dryRun ?? false;
+		const pageSize = options?.pageSize ?? 1e3;
+		let startFileName;
+		let startFileId;
+		while (true) {
+			const page = await this.listFileVersions({
+				pageSize,
+				...options?.prefix !== void 0 ? { prefix: options.prefix } : {},
+				...startFileName !== void 0 ? { startFileName } : {},
+				...startFileId !== void 0 ? { startFileId } : {}
+			});
+			for (const version of page.files) {
+				if (dryRun) {
+					yield {
+						type: "skip",
+						fileName: version.fileName,
+						fileId: version.fileId
+					};
+					continue;
+				}
+				try {
+					await this.deleteFileVersion(version.fileName, version.fileId);
+					yield {
+						type: "delete",
+						fileName: version.fileName,
+						fileId: version.fileId
+					};
+				} catch (err) {
+					yield {
+						type: "error",
+						fileName: version.fileName,
+						fileId: version.fileId,
+						message: toError(err).message
+					};
+				}
+			}
+			if (!page.nextFileName) break;
+			startFileName = page.nextFileName;
+			startFileId = page.nextFileId ?? void 0;
+		}
+	}
+	/**
+	* Creates a server-side copy of a file within or across buckets.
+	* @param options - Copy configuration including source file ID and destination name.
+	*
+	* @returns Metadata for the newly created file version.
+	*/
+	async copyFile(options) {
+		const { serverSideEncryption, destinationServerSideEncryption, signal, ...copyOptions } = options;
+		const destinationEncryption = destinationServerSideEncryption ?? serverSideEncryption;
+		return this.client.raw.copyFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			...copyOptions,
+			...destinationEncryption !== void 0 ? { destinationServerSideEncryption: destinationEncryption } : {}
+		}, signal !== void 0 ? { signal } : void 0);
+	}
+	/**
+	* Copies a file via the server-side multipart protocol. Each part is copied
+	* by reference through `b2_copy_part`; data never traverses the client. Falls
+	* back to a single `copyFile` call when the source fits within a single part.
+	* @param options - Copy parameters including source file ID, destination name, part size, and concurrency.
+	*
+	* @returns Metadata for the newly created destination file version.
+	*/
+	async copyLargeFile(options) {
+		return copyLargeFile(this.client.raw, this.client.accountInfo, {
+			sourceFileId: options.sourceFileId,
+			fileName: options.fileName,
+			...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : { destinationBucketId: this.id },
+			...options.contentType !== void 0 ? { contentType: options.contentType } : {},
+			...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},
+			...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},
+			...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},
+			...options.partSize !== void 0 ? { partSize: options.partSize } : {},
+			...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {},
+			...options.onCleanupFailure !== void 0 ? { onCleanupFailure: options.onCleanupFailure } : {},
+			...options.signal !== void 0 ? { signal: options.signal } : {}
+		});
+	}
+	/**
+	* Updates bucket settings such as type, CORS, lifecycle rules, and encryption.
+	* @param options - Fields to update. Omitted fields are left unchanged.
+	*
+	* @returns Updated bucket metadata.
+	*/
+	async update(options) {
+		return this.client.raw.updateBucket(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			accountId: accountId(this.client.accountInfo.getAccountId()),
+			bucketId: this.id,
+			...options
+		});
+	}
+	/**
+	* Permanently deletes this bucket. The bucket must be empty (no file versions).
+	*
+	* @returns The deleted bucket metadata.
+	*/
+	async delete() {
+		return this.client.deleteBucket(this.id);
+	}
+	/**
+	* Gets a download authorization token scoped to a file name prefix in this bucket.
+	* @param fileNamePrefix - Only authorize downloads of files starting with this prefix.
+	* @param validDurationInSeconds - How long the authorization is valid (1-604800 seconds).
+	*
+	* @returns The download authorization response containing a time-limited token.
+	*/
+	async getDownloadAuthorization(fileNamePrefix, validDurationInSeconds) {
+		return this.client.raw.getDownloadAuthorization(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			bucketId: this.id,
+			fileNamePrefix,
+			validDurationInSeconds
+		});
+	}
+	/**
+	* Gets the event notification rules configured for this bucket.
+	*
+	* @returns The current notification rules for this bucket.
+	*/
+	async getNotificationRules() {
+		return this.client.raw.getBucketNotificationRules(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { bucketId: this.id });
+	}
+	/**
+	* Replaces the event notification rules for this bucket.
+	* @param rules - The new set of notification rules to apply.
+	*
+	* @returns The updated notification rules for this bucket.
+	*/
+	async setNotificationRules(rules) {
+		return this.client.raw.setBucketNotificationRules(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			bucketId: this.id,
+			eventNotificationRules: rules
+		});
+	}
+	/**
+	* Updates the file retention policy for a specific file version. Requires file lock on the bucket.
+	* @param fileName - The file path of the version to update.
+	* @param fileId - The unique identifier of the file version.
+	* @param retention - The new retention policy to apply.
+	* @param options - Optional flags. Set `bypassGovernance: true` to shorten governance-mode retention.
+	*
+	* @returns The updated file retention metadata.
+	*/
+	async updateFileRetention(fileName, fileId, retention, options) {
+		return this.client.raw.updateFileRetention(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			fileName,
+			fileId,
+			fileRetention: retention,
+			...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}
+		});
+	}
+	/**
+	* Updates the legal hold status for a specific file version. Requires file lock on the bucket.
+	* @param fileName - The file path of the version to update.
+	* @param fileId - The unique identifier of the file version.
+	* @param legalHold - The new legal hold status to apply.
+	*
+	* @returns The updated legal hold metadata.
+	*/
+	async updateFileLegalHold(fileName, fileId, legalHold) {
+		return this.client.raw.updateFileLegalHold(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {
+			fileName,
+			fileId,
+			legalHold
+		});
+	}
+	/**
+	* Refetches this bucket's metadata from B2 so callers operating on
+	* replication / lifecycle / retention configuration always start from the
+	* server-of-record state.
+	*
+	* Bucket configuration is monotonically revisioned by B2: B2 increments
+	* `revision` on every accepted update. The local {@link info} snapshot
+	* captured at construction time goes stale as soon as anyone else (or any
+	* prior `update()` call) mutates the bucket, so the ergonomic
+	* add/remove helpers below always refresh before composing the next
+	* `setX()` call. The result is that each helper is safe to call without
+	* the caller having to thread BucketInfo through their code.
+	*
+	* @returns Fresh {@link BucketInfo} for this bucket.
+	*
+	* @throws If the bucket no longer exists.
+	*/
+	async refresh() {
+		const found = (await this.client.listBuckets({ bucketId: this.id }))[0];
+		if (!found) throw new Error(`Bucket ${this.id} not found`);
+		return found.info;
+	}
+	/**
+	* Returns the current cross-region replication configuration, refetched
+	* from B2.
+	*
+	* Use this when you need to read replication state without composing a
+	* write. For add/remove flows the helper methods below handle the
+	* refresh-then-set sequence for you.
+	*
+	* @returns The current {@link ReplicationConfiguration}.
+	*/
+	async getReplication() {
+		return (await this.refresh()).replicationConfiguration;
+	}
+	/**
+	* Replaces this bucket's complete replication configuration.
+	* @param replication - The new configuration. Pass an empty source/destination
+	*   pair (`{ asReplicationSource: null, asReplicationDestination: null }`)
+	*   to clear replication entirely.
+	*
+	* @returns The updated bucket metadata.
+	*/
+	async setReplication(replication) {
+		return this.update({ replicationConfiguration: replication });
+	}
+	/**
+	* Adds (or replaces by `replicationRuleName`) a single replication rule
+	* on this bucket while leaving any other rules, the source key, and the
+	* destination key mapping untouched.
+	*
+	* When this is the very first source-side rule, `sourceApplicationKeyId`
+	* must be supplied to seed `asReplicationSource.sourceApplicationKeyId`;
+	* for subsequent calls the existing source key is reused unless the
+	* caller explicitly overrides it.
+	*
+	* @param rule - The replication rule to add or replace.
+	* @param options - Optional source application key ID override (or seed
+	*   when no source side exists yet).
+	*
+	* @returns The updated bucket metadata.
+	*
+	* @throws If no source-side replication exists yet and the caller did
+	*   not supply `sourceApplicationKeyId`.
+	*/
+	async addReplicationRule(rule, options) {
+		const current = (await this.refresh()).replicationConfiguration;
+		const existingSource = current.asReplicationSource;
+		const sourceKey = options?.sourceApplicationKeyId ?? existingSource?.sourceApplicationKeyId;
+		if (!sourceKey) throw new Error("addReplicationRule: no existing source-side replication; pass options.sourceApplicationKeyId");
+		const without = (existingSource?.replicationRules ?? []).filter((r) => r.replicationRuleName !== rule.replicationRuleName);
+		return this.setReplication({
+			asReplicationSource: {
+				sourceApplicationKeyId: sourceKey,
+				replicationRules: [...without, rule]
+			},
+			asReplicationDestination: current.asReplicationDestination
+		});
+	}
+	/**
+	* Removes a single replication rule by name. No-ops cleanly when the rule
+	* is not present (returns the unchanged-but-revision-bumped bucket info).
+	*
+	* @param replicationRuleName - Name of the rule to remove.
+	*
+	* @returns The updated bucket metadata.
+	*/
+	async removeReplicationRule(replicationRuleName) {
+		const current = (await this.refresh()).replicationConfiguration;
+		const existingSource = current.asReplicationSource;
+		if (!existingSource) return this.setReplication(current);
+		const filtered = existingSource.replicationRules.filter((r) => r.replicationRuleName !== replicationRuleName);
+		return this.setReplication({
+			asReplicationSource: {
+				sourceApplicationKeyId: existingSource.sourceApplicationKeyId,
+				replicationRules: filtered
+			},
+			asReplicationDestination: current.asReplicationDestination
+		});
+	}
+	/**
+	* Returns the current lifecycle rules for this bucket, refetched from B2.
+	*
+	* @returns The current array of {@link LifecycleRule}s.
+	*/
+	async getLifecycleRules() {
+		return (await this.refresh()).lifecycleRules;
+	}
+	/**
+	* Replaces this bucket's lifecycle rules in their entirety.
+	* @param rules - The new rule set. Pass `[]` to remove all lifecycle
+	*   automation.
+	*
+	* @returns The updated bucket metadata.
+	*/
+	async setLifecycleRules(rules) {
+		return this.update({ lifecycleRules: [...rules] });
+	}
+	/**
+	* Adds (or replaces, matched by `fileNamePrefix`) a single lifecycle rule
+	* while leaving any other rules untouched.
+	*
+	* Matching on prefix mirrors B2's own data model: each unique prefix can
+	* have at most one rule, and a `b2_update_bucket` call that contains two
+	* rules with the same prefix is rejected. The helper enforces this for
+	* the caller.
+	*
+	* @param rule - The lifecycle rule to add or replace.
+	*
+	* @returns The updated bucket metadata.
+	*/
+	async addLifecycleRule(rule) {
+		const without = (await this.getLifecycleRules()).filter((r) => r.fileNamePrefix !== rule.fileNamePrefix);
+		return this.setLifecycleRules([...without, rule]);
+	}
+	/**
+	* Removes a single lifecycle rule by prefix. No-ops cleanly when the rule
+	* is not present.
+	*
+	* @param fileNamePrefix - The prefix of the rule to remove.
+	*
+	* @returns The updated bucket metadata.
+	*/
+	async removeLifecycleRule(fileNamePrefix) {
+		const current = await this.getLifecycleRules();
+		return this.setLifecycleRules(current.filter((r) => r.fileNamePrefix !== fileNamePrefix));
+	}
+	/**
+	* Returns the current default Object Lock retention policy for new
+	* uploads to this bucket, refetched from B2.
+	*
+	* @returns The default {@link BucketRetentionPolicy} (which may be
+	*   `{ mode: 'none', period: null }` when Object Lock is enabled on the
+	*   bucket but no default is set).
+	*/
+	async getDefaultRetention() {
+		return (await this.refresh()).defaultRetention;
+	}
+	/**
+	* Sets (or clears, by passing `{ mode: 'none', period: null }`) the
+	* default Object Lock retention policy applied to new uploads.
+	*
+	* Object Lock must already be enabled on the bucket. Buckets created
+	* without `fileLockEnabled: true` cannot accept a default retention
+	* policy and B2 will reject this call.
+	*
+	* @param policy - The new default retention policy.
+	*
+	* @returns The updated bucket metadata.
+	*/
+	async setDefaultRetention(policy) {
+		return this.update({ defaultRetention: policy });
+	}
+};
+//#endregion
 
 
-class Bucket {
-  /** Unique identifier for this bucket. */
-  id;
-  /** Human-readable bucket name. */
-  name;
-  /** Full bucket metadata as returned by the B2 API. */
-  info;
-  client;
-  /**
-   * @param client - The parent B2Client instance.
-   * @param info - The bucket metadata from the API.
-   *
-   * @internal
-   */
-  constructor(client, info) {
-    this.client = client;
-    this.info = info;
-    this.id = info.bucketId;
-    this.name = info.bucketName;
-  }
-  /**
-   * Returns a {@link B2Object} handle for a specific file name in this bucket.
-   * @param fileName - The file path within the bucket.
-   *
-   * @returns A B2Object handle bound to this bucket and file name.
-   */
-  file(fileName) {
-    return new B2Object(this.client, this, fileName);
-  }
-  /**
-   * Uploads a file to this bucket. Automatically uses multipart upload for files
-   * larger than the recommended part size.
-   * @param options - Upload configuration including file name, source data, and optional settings.
-   *
-   * @returns Metadata for the uploaded file version.
-   */
-  async upload(options) {
-    const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();
-    const isLarge = options.source.size > recommendedPartSize;
-    if (isLarge) {
-      return uploadLargeFile(this.client.raw, this.client.accountInfo, {
-        bucketId: this.id,
-        ...options
-      });
-    }
-    const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options;
-    return uploadSmallFile(this.client.raw, this.client.accountInfo, {
-      bucketId: this.id,
-      ...smallOptions
-    });
-  }
-  /**
-   * Downloads a file from this bucket by name. Pass `method: 'HEAD'` in
-   * `options` to fetch only the response headers (file metadata) without
-   * streaming the body.
-   * @param fileName - The file name (path) to download.
-   * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.
-   *
-   * @returns The download result containing response headers and a readable body stream.
-   */
-  async download(fileName, options) {
-    return downloadByName(this.client.raw, this.client.accountInfo, {
-      bucketName: this.name,
-      fileName,
-      ...options
-    });
-  }
-  /**
-   * Fetches the response headers (file metadata) for a file via HTTP
-   * HEAD. Returns a body-less result so callers never have to drain
-   * the (logically empty) HEAD body themselves.
-   *
-   * Use this for metadata-only checks like "does this file exist", "what
-   * is its current SHA-1", "what is its Content-Length". For full file
-   * retrieval use {@link Bucket.download}.
-   *
-   * @param fileName - The file name (path) to inspect.
-   * @param options - Optional range, SSE-C decryption, response-header
-   *   overrides, and abort signal. Same shape as {@link Bucket.download}'s
-   *   options minus `method` (always HEAD) and `onProgress` (no body).
-   *
-   * @returns Parsed download headers (content type, SHA-1, file info, etc.).
-   *
-   * @example
-   * ```ts
-   * const { headers } = await bucket.head('photos/2026/sunset.jpg')
-   * console.log(headers.contentLength, headers.contentSha1)
-   * ```
-   */
-  async head(fileName, options) {
-    return headByName(this.client.raw, this.client.accountInfo, {
-      bucketName: this.name,
-      fileName,
-      ...options
-    });
-  }
-  /**
-   * Lists file names in this bucket (most recent versions only).
-   * @param options - Optional filtering and pagination settings.
-   *
-   * @returns A page of file versions with an optional continuation token.
-   */
-  async listFileNames(options) {
-    return this.client.raw.listFileNames(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      {
-        bucketId: this.id,
-        ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},
-        ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},
-        ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},
-        ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}
-      }
-    );
-  }
-  /**
-   * Lists all file versions in this bucket, including hidden files.
-   * @param options - Optional filtering and pagination settings.
-   *
-   * @returns A page of file versions with an optional continuation token.
-   */
-  async listFileVersions(options) {
-    return this.client.raw.listFileVersions(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      {
-        bucketId: this.id,
-        ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},
-        ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},
-        ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},
-        ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},
-        ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}
-      }
-    );
-  }
-  /**
-   * Async iterator that yields the latest visible version of every file in
-   * the bucket, automatically handling pagination via `listFileNames`.
-   *
-   * Hidden files (those whose latest version is a hide marker) are NOT
-   * yielded by this iterator. Use {@link paginateFileVersions} when you
-   * need full version history.
-   *
-   * @param options - Filter + pagination + abort options. `pageSize` is
-   *   forwarded to `b2_list_file_names`'s `maxFileCount` (default 1000,
-   *   B2-capped at 10000).
-   *
-   * @returns An async iterable of {@link FileVersion} entries.
-   *
-   * @example
-   * ```ts
-   * for await (const file of bucket.paginateFileNames({ prefix: 'photos/' })) {
-   *   console.log(file.fileName, file.contentLength)
-   * }
-   * ```
-   */
-  paginateFileNames(options) {
-    return paginateItems(
-      async (cursor) => {
-        const resp = await this.listFileNames({
-          pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,
-          ...cursor !== void 0 ? { startFileName: cursor } : {},
-          ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},
-          ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}
-        });
-        return { page: resp, nextCursor: resp.nextFileName ?? void 0 };
-      },
-      // Real B2 surfaces hide markers as rows in `b2_list_file_names`. This
-      // iterator's documented contract is "latest VISIBLE version", so we
-      // drop hide-action rows here. Callers who need full history should
-      // use `paginateFileVersions`.
-      (page) => page.files.filter((f) => f.action !== "hide"),
-      options?.signal
-    );
-  }
-  /**
-   * Async iterator that yields every version of every file in the bucket,
-   * including hidden files and historical versions, automatically handling
-   * pagination via `listFileVersions`.
-   *
-   * The two-cursor `(nextFileName, nextFileId)` continuation that the raw
-   * endpoint exposes is threaded internally; callers iterate flat.
-   *
-   * @param options - Filter + pagination + abort options.
-   *
-   * @returns An async iterable of {@link FileVersion} entries.
-   */
-  paginateFileVersions(options) {
-    return paginateItems(
-      async (cursor) => {
-        const resp = await this.listFileVersions({
-          pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,
-          ...cursor !== void 0 ? { startFileName: cursor.fileName } : {},
-          ...cursor?.fileId !== void 0 ? { startFileId: cursor.fileId } : {},
-          ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},
-          ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}
-        });
-        const nextCursor = resp.nextFileName !== null ? { fileName: resp.nextFileName, fileId: resp.nextFileId ?? void 0 } : void 0;
-        return { page: resp, nextCursor };
-      },
-      (page) => page.files,
-      options?.signal
-    );
-  }
-  /**
-   * Async iterator that yields every unfinished large file in the bucket,
-   * automatically handling pagination via `listUnfinishedLargeFiles`.
-   *
-   * Useful for janitorial scripts that want to inspect or cancel abandoned
-   * multipart uploads (typically followed by {@link cancelLargeFile} on
-   * the underlying raw client).
-   *
-   * @param options - Filter + pagination + abort options. `pageSize` is
-   *   B2-capped at 100 for this endpoint.
-   *
-   * @returns An async iterable of unfinished-large-file metadata entries.
-   */
-  paginateUnfinishedLargeFiles(options) {
-    return paginateItems(
-      async (cursor) => {
-        const resp = await this.listUnfinishedLargeFiles({
-          pageSize: options?.pageSize ?? 100,
-          ...cursor !== void 0 ? { startFileId: cursor } : {},
-          ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {}
-        });
-        return { page: resp, nextCursor: resp.nextFileId ?? void 0 };
-      },
-      (page) => page.files,
-      options?.signal
-    );
-  }
-  /**
-   * Async iterator that yields every uploaded part for a specific large
-   * file, automatically handling pagination via `listParts`.
-   *
-   * @param largeFileId - The unfinished large file to enumerate parts of.
-   * @param options - Pagination + abort options. `pageSize` is B2-capped
-   *   at 1000 for this endpoint; the default is 1000.
-   *
-   * @returns An async iterable of {@link PartInfo} entries.
-   */
-  paginateParts(largeFileId, options) {
-    return paginateItems(
-      async (cursor) => {
-        const resp = await this.client.raw.listParts(
-          this.client.accountInfo.getApiUrl(),
-          this.client.accountInfo.getAuthToken(),
-          {
-            fileId: largeFileId,
-            maxPartCount: options?.pageSize ?? DEFAULT_PAGE_SIZE,
-            ...cursor !== void 0 ? { startPartNumber: cursor } : {}
-          }
-        );
-        return { page: resp, nextCursor: resp.nextPartNumber ?? void 0 };
-      },
-      (page) => page.parts,
-      options?.signal
-    );
-  }
-  /**
-   * Looks up the latest visible version of a file by name.
-   * Uses `listFileNames` under the hood; returns `null` when the file does not
-   * exist or its latest version is a hide marker.
-   * @param fileName - The exact file path to look up.
-   *
-   * @returns The latest {@link FileVersion}, or `null` if not found.
-   */
-  async getFileInfoByName(fileName) {
-    const resp = await this.listFileNames({ prefix: fileName, pageSize: 1 });
-    const match = resp.files.find((f) => f.fileName === fileName);
-    if (!match || match.action === "hide") return null;
-    return match;
-  }
-  /**
-   * Removes the latest hide marker for a file, restoring visibility of the
-   * previous upload. Returns the deleted hide marker, or `null` if there was
-   * no hide marker to remove (file is already visible or does not exist).
-   * @param fileName - The file path to unhide.
-   *
-   * @returns The deleted hide marker version, or `null` if nothing was hidden.
-   */
-  async unhideFile(fileName) {
-    const resp = await this.listFileVersions({ prefix: fileName, pageSize: 100 });
-    const versions = resp.files.filter((f) => f.fileName === fileName);
-    if (versions.length === 0) return null;
-    const latest = versions[0];
-    if (!latest || latest.action !== "hide") return null;
-    await this.deleteFileVersion(fileName, latest.fileId);
-    return latest;
-  }
-  /**
-   * Hides a file by creating a hide marker. The file remains in version history but is no longer visible in `listFileNames`.
-   * @param fileName - The file path to hide.
-   *
-   * @returns Metadata for the newly created hide marker.
-   */
-  async hideFile(fileName) {
-    return this.client.raw.hideFile(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      { bucketId: this.id, fileName }
-    );
-  }
-  /**
-   * Permanently deletes a specific file version. Both file name and file ID are required.
-   *
-   * If the file is under Object Lock retention, B2 will reject the
-   * delete: compliance-mode files cannot be deleted until the retention
-   * expires; governance-mode files require `bypassGovernance: true`
-   * AND a calling key with the `bypassGovernance` capability. Files on
-   * legal hold cannot be deleted by anyone until the hold is removed.
-   *
-   * @param fileName - The file path of the version to delete.
-   * @param fileId - The unique identifier of the file version to delete.
-   * @param options - Optional flag for bypassing governance retention.
-   */
-  async deleteFileVersion(fileName, fileId, options) {
-    await this.client.raw.deleteFileVersion(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      {
-        fileName,
-        fileId,
-        ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}
-      }
-    );
-  }
-  /**
-   * Cancels an in-progress large file upload so the partial parts are not
-   * retained or billed. The most common reason to call this is to clean up
-   * abandoned multipart uploads surfaced by {@link listUnfinishedLargeFiles}.
-   * @param fileId - The unique identifier of the unfinished large file to cancel.
-   *
-   * @returns Metadata about the cancelled large file.
-   */
-  async cancelLargeFile(fileId) {
-    return this.client.raw.cancelLargeFile(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      { fileId }
-    );
-  }
-  /**
-   * Lists large files in this bucket that were started but never finished or
-   * cancelled. Wraps `b2_list_unfinished_large_files`.
-   * @param options - Optional pagination filters.
-   *
-   * @returns The page of unfinished large files plus a continuation token.
-   */
-  async listUnfinishedLargeFiles(options) {
-    return this.client.raw.listUnfinishedLargeFiles(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      {
-        bucketId: this.id,
-        ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},
-        ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},
-        ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}
-      }
-    );
-  }
-  /**
-   * Deletes many file versions with bounded concurrency. Errors from individual
-   * deletes are collected and returned rather than thrown, so partial success
-   * does not abort the run.
-   *
-   * When `options.signal` is supplied and aborted, in-flight deletes
-   * complete (they're already on the wire), but no new deletes start
-   * after the abort fires. Subsequent targets are short-circuited to an
-   * error entry so the result tally reflects what actually happened.
-   * @param targets - File versions to delete.
-   * @param options - Optional concurrency override and abort signal.
-   *   Concurrency defaults to the SDK-wide bulk-metadata setting
-   *   (currently 10, higher than transfer concurrency because each
-   *   task is a single tiny API round-trip).
-   *
-   * @returns A summary of successes and per-target errors.
-   */
-  async deleteMany(targets, options) {
-    const concurrency = options?.concurrency ?? DEFAULT_BULK_CONCURRENCY;
-    const sem = new Semaphore(concurrency);
-    const signal = options?.signal;
-    let deleted = 0;
-    const errors = [];
-    await Promise.all(
-      targets.map(async (target) => {
-        await sem.acquire();
-        try {
-          if (signal?.aborted) {
-            errors.push({
-              target,
-              error: toError(signal.reason ?? "aborted")
-            });
-            return;
-          }
-          await this.deleteFileVersion(target.fileName, target.fileId);
-          deleted++;
-        } catch (err) {
-          errors.push({
-            target,
-            error: toError(err)
-          });
-        } finally {
-          sem.release();
-        }
-      })
-    );
-    return { deleted, errors };
-  }
-  /**
-   * Async generator that streams every file version in the bucket (optionally
-   * filtered by prefix) and deletes each one. Yields a {@link DeleteAllEvent}
-   * per file version. With `dryRun: true`, no deletes are performed but `skip`
-   * events are still emitted.
-   * @param options - Optional prefix filter, page size, and dry-run flag.
-   *
-   * @returns An async generator of per-file events.
-   */
-  async *deleteAll(options) {
-    const dryRun = options?.dryRun ?? false;
-    const pageSize = options?.pageSize ?? DEFAULT_PAGE_SIZE;
-    let startFileName;
-    let startFileId;
-    while (true) {
-      const page = await this.listFileVersions({
-        pageSize,
-        ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},
-        ...startFileName !== void 0 ? { startFileName } : {},
-        ...startFileId !== void 0 ? { startFileId } : {}
-      });
-      for (const version of page.files) {
-        if (dryRun) {
-          yield { type: "skip", fileName: version.fileName, fileId: version.fileId };
-          continue;
-        }
-        try {
-          await this.deleteFileVersion(version.fileName, version.fileId);
-          yield { type: "delete", fileName: version.fileName, fileId: version.fileId };
-        } catch (err) {
-          yield {
-            type: "error",
-            fileName: version.fileName,
-            fileId: version.fileId,
-            message: toError(err).message
-          };
-        }
-      }
-      if (!page.nextFileName) break;
-      startFileName = page.nextFileName;
-      startFileId = page.nextFileId ?? void 0;
-    }
-  }
-  /**
-   * Creates a server-side copy of a file within or across buckets.
-   * @param options - Copy configuration including source file ID and destination name.
-   *
-   * @returns Metadata for the newly created file version.
-   */
-  async copyFile(options) {
-    return this.client.raw.copyFile(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      options
-    );
-  }
-  /**
-   * Copies a file via the server-side multipart protocol. Each part is copied
-   * by reference through `b2_copy_part`; data never traverses the client. Falls
-   * back to a single `copyFile` call when the source fits within a single part.
-   * @param options - Copy parameters including source file ID, destination name, part size, and concurrency.
-   *
-   * @returns Metadata for the newly created destination file version.
-   */
-  async copyLargeFile(options) {
-    return copyLargeFile(this.client.raw, this.client.accountInfo, {
-      sourceFileId: options.sourceFileId,
-      fileName: options.fileName,
-      ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : { destinationBucketId: this.id },
-      ...options.contentType !== void 0 ? { contentType: options.contentType } : {},
-      ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},
-      ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},
-      ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},
-      ...options.partSize !== void 0 ? { partSize: options.partSize } : {},
-      ...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {},
-      ...options.signal !== void 0 ? { signal: options.signal } : {}
-    });
-  }
-  /**
-   * Updates bucket settings such as type, CORS, lifecycle rules, and encryption.
-   * @param options - Fields to update. Omitted fields are left unchanged.
-   *
-   * @returns Updated bucket metadata.
-   */
-  async update(options) {
-    return this.client.raw.updateBucket(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      {
-        accountId: accountId(this.client.accountInfo.getAccountId()),
-        bucketId: this.id,
-        ...options
-      }
-    );
-  }
-  /**
-   * Permanently deletes this bucket. The bucket must be empty (no file versions).
-   *
-   * @returns The deleted bucket metadata.
-   */
-  async delete() {
-    return this.client.deleteBucket(this.id);
-  }
-  /**
-   * Gets a download authorization token scoped to a file name prefix in this bucket.
-   * @param fileNamePrefix - Only authorize downloads of files starting with this prefix.
-   * @param validDurationInSeconds - How long the authorization is valid (1-604800 seconds).
-   *
-   * @returns The download authorization response containing a time-limited token.
-   */
-  async getDownloadAuthorization(fileNamePrefix, validDurationInSeconds) {
-    return this.client.raw.getDownloadAuthorization(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      { bucketId: this.id, fileNamePrefix, validDurationInSeconds }
-    );
-  }
-  /**
-   * Gets the event notification rules configured for this bucket.
-   *
-   * @returns The current notification rules for this bucket.
-   */
-  async getNotificationRules() {
-    return this.client.raw.getBucketNotificationRules(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      { bucketId: this.id }
-    );
-  }
-  /**
-   * Replaces the event notification rules for this bucket.
-   * @param rules - The new set of notification rules to apply.
-   *
-   * @returns The updated notification rules for this bucket.
-   */
-  async setNotificationRules(rules) {
-    return this.client.raw.setBucketNotificationRules(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      { bucketId: this.id, eventNotificationRules: rules }
-    );
-  }
-  /**
-   * Updates the file retention policy for a specific file version. Requires file lock on the bucket.
-   * @param fileName - The file path of the version to update.
-   * @param fileId - The unique identifier of the file version.
-   * @param retention - The new retention policy to apply.
-   * @param options - Optional flags. Set `bypassGovernance: true` to shorten governance-mode retention.
-   *
-   * @returns The updated file retention metadata.
-   */
-  async updateFileRetention(fileName, fileId, retention, options) {
-    return this.client.raw.updateFileRetention(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      {
-        fileName,
-        fileId,
-        fileRetention: retention,
-        ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}
-      }
-    );
-  }
-  /**
-   * Updates the legal hold status for a specific file version. Requires file lock on the bucket.
-   * @param fileName - The file path of the version to update.
-   * @param fileId - The unique identifier of the file version.
-   * @param legalHold - The new legal hold status to apply.
-   *
-   * @returns The updated legal hold metadata.
-   */
-  async updateFileLegalHold(fileName, fileId, legalHold) {
-    return this.client.raw.updateFileLegalHold(
-      this.client.accountInfo.getApiUrl(),
-      this.client.accountInfo.getAuthToken(),
-      { fileName, fileId, legalHold }
-    );
-  }
-  /**
-   * Refetches this bucket's metadata from B2 so callers operating on
-   * replication / lifecycle / retention configuration always start from the
-   * server-of-record state.
-   *
-   * Bucket configuration is monotonically revisioned by B2: B2 increments
-   * `revision` on every accepted update. The local {@link info} snapshot
-   * captured at construction time goes stale as soon as anyone else (or any
-   * prior `update()` call) mutates the bucket, so the ergonomic
-   * add/remove helpers below always refresh before composing the next
-   * `setX()` call. The result is that each helper is safe to call without
-   * the caller having to thread BucketInfo through their code.
-   *
-   * @returns Fresh {@link BucketInfo} for this bucket.
-   *
-   * @throws If the bucket no longer exists.
-   */
-  async refresh() {
-    const fresh = await this.client.listBuckets({ bucketId: this.id });
-    const found = fresh[0];
-    if (!found) throw new Error(`Bucket ${this.id} not found`);
-    return found.info;
-  }
-  /**
-   * Returns the current cross-region replication configuration, refetched
-   * from B2.
-   *
-   * Use this when you need to read replication state without composing a
-   * write. For add/remove flows the helper methods below handle the
-   * refresh-then-set sequence for you.
-   *
-   * @returns The current {@link ReplicationConfiguration}.
-   */
-  async getReplication() {
-    const fresh = await this.refresh();
-    return fresh.replicationConfiguration;
-  }
-  /**
-   * Replaces this bucket's complete replication configuration.
-   * @param replication - The new configuration. Pass an empty source/destination
-   *   pair (`{ asReplicationSource: null, asReplicationDestination: null }`)
-   *   to clear replication entirely.
-   *
-   * @returns The updated bucket metadata.
-   */
-  async setReplication(replication) {
-    return this.update({ replicationConfiguration: replication });
-  }
-  /**
-   * Adds (or replaces by `replicationRuleName`) a single replication rule
-   * on this bucket while leaving any other rules, the source key, and the
-   * destination key mapping untouched.
-   *
-   * When this is the very first source-side rule, `sourceApplicationKeyId`
-   * must be supplied to seed `asReplicationSource.sourceApplicationKeyId`;
-   * for subsequent calls the existing source key is reused unless the
-   * caller explicitly overrides it.
-   *
-   * @param rule - The replication rule to add or replace.
-   * @param options - Optional source application key ID override (or seed
-   *   when no source side exists yet).
-   *
-   * @returns The updated bucket metadata.
-   *
-   * @throws If no source-side replication exists yet and the caller did
-   *   not supply `sourceApplicationKeyId`.
-   */
-  async addReplicationRule(rule, options) {
-    const current = (await this.refresh()).replicationConfiguration;
-    const existingSource = current.asReplicationSource;
-    const sourceKey = options?.sourceApplicationKeyId ?? existingSource?.sourceApplicationKeyId;
-    if (!sourceKey) {
-      throw new Error(
-        "addReplicationRule: no existing source-side replication; pass options.sourceApplicationKeyId"
-      );
-    }
-    const existingRules = existingSource?.replicationRules ?? [];
-    const without = existingRules.filter((r) => r.replicationRuleName !== rule.replicationRuleName);
-    return this.setReplication({
-      asReplicationSource: {
-        sourceApplicationKeyId: sourceKey,
-        replicationRules: [...without, rule]
-      },
-      asReplicationDestination: current.asReplicationDestination
-    });
-  }
-  /**
-   * Removes a single replication rule by name. No-ops cleanly when the rule
-   * is not present (returns the unchanged-but-revision-bumped bucket info).
-   *
-   * @param replicationRuleName - Name of the rule to remove.
-   *
-   * @returns The updated bucket metadata.
-   */
-  async removeReplicationRule(replicationRuleName) {
-    const current = (await this.refresh()).replicationConfiguration;
-    const existingSource = current.asReplicationSource;
-    if (!existingSource) {
-      return this.setReplication(current);
-    }
-    const filtered = existingSource.replicationRules.filter(
-      (r) => r.replicationRuleName !== replicationRuleName
-    );
-    return this.setReplication({
-      asReplicationSource: {
-        sourceApplicationKeyId: existingSource.sourceApplicationKeyId,
-        replicationRules: filtered
-      },
-      asReplicationDestination: current.asReplicationDestination
-    });
-  }
-  /**
-   * Returns the current lifecycle rules for this bucket, refetched from B2.
-   *
-   * @returns The current array of {@link LifecycleRule}s.
-   */
-  async getLifecycleRules() {
-    const fresh = await this.refresh();
-    return fresh.lifecycleRules;
-  }
-  /**
-   * Replaces this bucket's lifecycle rules in their entirety.
-   * @param rules - The new rule set. Pass `[]` to remove all lifecycle
-   *   automation.
-   *
-   * @returns The updated bucket metadata.
-   */
-  async setLifecycleRules(rules) {
-    return this.update({ lifecycleRules: [...rules] });
-  }
-  /**
-   * Adds (or replaces, matched by `fileNamePrefix`) a single lifecycle rule
-   * while leaving any other rules untouched.
-   *
-   * Matching on prefix mirrors B2's own data model: each unique prefix can
-   * have at most one rule, and a `b2_update_bucket` call that contains two
-   * rules with the same prefix is rejected. The helper enforces this for
-   * the caller.
-   *
-   * @param rule - The lifecycle rule to add or replace.
-   *
-   * @returns The updated bucket metadata.
-   */
-  async addLifecycleRule(rule) {
-    const current = await this.getLifecycleRules();
-    const without = current.filter((r) => r.fileNamePrefix !== rule.fileNamePrefix);
-    return this.setLifecycleRules([...without, rule]);
-  }
-  /**
-   * Removes a single lifecycle rule by prefix. No-ops cleanly when the rule
-   * is not present.
-   *
-   * @param fileNamePrefix - The prefix of the rule to remove.
-   *
-   * @returns The updated bucket metadata.
-   */
-  async removeLifecycleRule(fileNamePrefix) {
-    const current = await this.getLifecycleRules();
-    return this.setLifecycleRules(current.filter((r) => r.fileNamePrefix !== fileNamePrefix));
-  }
-  /**
-   * Returns the current default Object Lock retention policy for new
-   * uploads to this bucket, refetched from B2.
-   *
-   * @returns The default {@link BucketRetentionPolicy} (which may be
-   *   `{ mode: 'none', period: null }` when Object Lock is enabled on the
-   *   bucket but no default is set).
-   */
-  async getDefaultRetention() {
-    const fresh = await this.refresh();
-    return fresh.defaultRetention;
-  }
-  /**
-   * Sets (or clears, by passing `{ mode: 'none', period: null }`) the
-   * default Object Lock retention policy applied to new uploads.
-   *
-   * Object Lock must already be enabled on the bucket. Buckets created
-   * without `fileLockEnabled: true` cannot accept a default retention
-   * policy and B2 will reject this call.
-   *
-   * @param policy - The new default retention policy.
-   *
-   * @returns The updated bucket metadata.
-   */
-  async setDefaultRetention(policy) {
-    return this.update({ defaultRetention: policy });
-  }
-}
-
 //# sourceMappingURL=bucket.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/realms.js
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/errors/index.js
-class B2Error extends Error {
-  /** HTTP status code returned by the B2 API. */
-  status;
-  /** B2 error code identifying the error type (e.g. `expired_auth_token`). */
-  code;
-  /** B2 request ID from the `X-Bz-Request-Id` response header, if present. */
-  requestId;
-  /** Retry delay in seconds from the `Retry-After` response header, if present. */
-  retryAfter;
-  /** Whether this error is transient and the request can be retried. */
-  retryable;
-  /**
-   * Creates a new B2Error instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - Optional retry and request metadata from response headers.
-   */
-  constructor(response, options) {
-    super(response.message);
-    this.name = "B2Error";
-    this.status = response.status;
-    this.code = response.code;
-    if (options?.retryAfter !== void 0) this.retryAfter = options.retryAfter;
-    if (options?.requestId !== void 0) this.requestId = options.requestId;
-    this.retryable = isTransient(response.status, response.code);
-  }
-}
-class ExpiredAuthTokenError extends B2Error {
-  /**
-   * Creates a new ExpiredAuthTokenError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "ExpiredAuthTokenError";
-  }
-}
-class BadAuthTokenError extends B2Error {
-  /**
-   * Creates a new BadAuthTokenError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "BadAuthTokenError";
-  }
-}
-class ServiceUnavailableError extends B2Error {
-  /**
-   * Creates a new ServiceUnavailableError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "ServiceUnavailableError";
-  }
-}
-class RequestTimeoutError extends B2Error {
-  /**
-   * Creates a new RequestTimeoutError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "RequestTimeoutError";
-  }
-}
-class TooManyRequestsError extends B2Error {
-  /**
-   * Creates a new TooManyRequestsError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "TooManyRequestsError";
-  }
-}
-class CapExceededError extends B2Error {
-  /**
-   * Creates a new CapExceededError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "CapExceededError";
-  }
-}
-class AccessDeniedError extends B2Error {
-  /**
-   * Creates a new AccessDeniedError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "AccessDeniedError";
-  }
-}
-class FileNotPresentError extends B2Error {
-  /**
-   * Creates a new FileNotPresentError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "FileNotPresentError";
-  }
-}
-class DuplicateBucketNameError extends B2Error {
-  /**
-   * Creates a new DuplicateBucketNameError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "DuplicateBucketNameError";
-  }
-}
-class BadRequestError extends B2Error {
-  /**
-   * Creates a new BadRequestError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "BadRequestError";
-  }
-}
-class BadUploadUrlError extends B2Error {
-  /**
-   * Creates a new BadUploadUrlError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "BadUploadUrlError";
-  }
-}
-class ChecksumMismatchError extends B2Error {
-  /**
-   * Creates a new ChecksumMismatchError instance.
-   * @param response - Parsed B2 error response body.
-   * @param options - The error details including HTTP status, error code, message, and optional request ID.
-   */
-  constructor(response, options) {
-    super(response, options);
-    this.name = "ChecksumMismatchError";
-  }
-}
-class B2InsufficientCapabilityError extends Error {
-  /** Capabilities that were required for the operation. */
-  required;
-  /** Capabilities that the current key actually has. */
-  available;
-  /** Capabilities present in `required` but not in `available`. */
-  missing;
-  /**
-   * Creates a new B2InsufficientCapabilityError instance.
-   *
-   * @param required - Capabilities the operation requires.
-   * @param available - Capabilities the current key holds.
-   * @param missing - The subset of required that isn't available.
-   */
-  constructor(required, available, missing) {
-    super(`Application key is missing capabilities: ${missing.join(", ")}`);
-    this.name = "B2InsufficientCapabilityError";
-    this.required = required;
-    this.available = available;
-    this.missing = missing;
-  }
-}
-class B2SsrfError extends Error {
-  /**
-   * Creates a new {@link B2SsrfError}.
-   *
-   * @param message - Human-readable description of which URL was rejected and why.
-   * @param url - The full URL that was rejected.
-   */
-  constructor(message, url) {
-    super(message);
-    this.url = url;
-    this.name = "B2SsrfError";
-  }
-  /** Always `false` — this is a security failure, not transient. */
-  retryable = false;
-}
-class NetworkError extends Error {
-  /**
-   * Creates a new NetworkError instance.
-   * @param message - Human-readable description of the network failure.
-   * @param cause - The underlying error that caused this failure, if any.
-   */
-  constructor(message, cause) {
-    super(message);
-    this.cause = cause;
-    this.name = "NetworkError";
-  }
-  /** Always `true` since network errors are transient. */
-  retryable = true;
-}
-function isTransient(status, code) {
-  if (status === 408 || status === 429 || status === 503) return true;
-  if (code === "expired_auth_token") return true;
-  if (code === "service_unavailable" || code === "request_timeout") return true;
-  return false;
-}
-function classifyError(response, options) {
-  switch (response.code) {
-    case "expired_auth_token":
-      return new ExpiredAuthTokenError(response, options);
-    case "bad_auth_token":
-    case "unauthorized":
-      return new BadAuthTokenError(response, options);
-    case "service_unavailable":
-      return new ServiceUnavailableError(response, options);
-    case "request_timeout":
-      return new RequestTimeoutError(response, options);
-    case "cap_exceeded":
-    case "storage_cap_exceeded":
-    case "transaction_cap_exceeded":
-    case "download_cap_exceeded":
-      return new CapExceededError(response, options);
-    case "access_denied":
-      return new AccessDeniedError(response, options);
-    case "file_not_present":
-    case "no_such_file":
-      return new FileNotPresentError(response, options);
-    case "duplicate_bucket_name":
-      return new DuplicateBucketNameError(response, options);
-    case "bad_sha1_checksum":
-      return new ChecksumMismatchError(response, options);
-    case "bad_request":
-      return new BadRequestError(response, options);
-  }
-  if (response.status === 429) return new TooManyRequestsError(response, options);
-  if (response.status === 503) return new ServiceUnavailableError(response, options);
-  if (response.status === 408) return new RequestTimeoutError(response, options);
-  return new B2Error(response, options);
-}
 
-//# sourceMappingURL=index.js.map
+//#region src/auth/realms.ts
+var VERIFIED_REALM_URLS = {
+	/** Public production B2 Native API authorize endpoint. */
+	production: "https://api.backblazeb2.com",
+	/** Backblaze staging authorize endpoint from the official Python SDK realm map. */
+	staging: "https://api.backblaze.net"
+};
+/**
+* Built-in realm aliases to their `b2_authorize_account` base API URLs.
+* The object remains a mutable `Record` for source
+* compatibility with earlier SDK versions that let applications add local
+* aliases. SDK internals validate only the built-in aliases in
+* `VERIFIED_REALM_URLS`; pass direct custom realm URLs to `B2Client` instead
+* of relying on mutation for new code.
+*/
+var REALM_URLS = { ...VERIFIED_REALM_URLS };
+var HTTP_REALM_URL_WITH_HOST = /^https?:\/\/[^/?#]/i;
+function parseAbsoluteRealmUrl(realmUrl) {
+	try {
+		return new URL(realmUrl);
+	} catch {
+		return null;
+	}
+}
+function realmUrlForError(realmUrl, url = parseAbsoluteRealmUrl(realmUrl)) {
+	return url_redaction_redactUrlForError(url ?? realmUrl, { invalidUrlLabel: "" });
+}
+function isLoopbackHost(hostname) {
+	const host = hostname.toLowerCase();
+	if (host === "[::1]" || host === "::1") return true;
+	const parts = host.split(".");
+	return parts.length === 4 && parts[0] === "127" && parts.every((part) => /^\d+$/.test(part) && Number(part) <= 255);
+}
+function assertAuthorizableRealmScheme(realmUrl, url) {
+	if ((url.protocol === "https:" || url.protocol === "http:") && (!HTTP_REALM_URL_WITH_HOST.test(realmUrl) || url.hostname === "")) throw new B2RealmConfigurationError(`realm URL must be an absolute HTTP(S) URL with a hostname for authorization: ${realmUrlForError(realmUrl, url)}`);
+	if (url.protocol === "https:") return;
+	if (url.protocol === "http:" && isLoopbackHost(url.hostname)) return;
+	if (url.protocol === "http:") throw new B2RealmConfigurationError(`refusing to send credentials over plaintext HTTP realm: ${realmUrlForError(realmUrl, url)}`);
+	throw new B2RealmConfigurationError(`realm URL must use HTTPS or loopback IP HTTP for authorization: ${realmUrlForError(realmUrl, url)}`);
+}
+function assertRealmBaseUrl(realmUrl, url) {
+	if (url.username === "" && url.password === "" && url.search === "" && url.hash === "") return;
+	throw new B2RealmConfigurationError(`realm URL must not include credentials, query, or fragment for authorization: ${realmUrlForError(realmUrl, url)}`);
+}
+/**
+* Validate a realm URL before it is used for credential-bearing authorization.
+* Any accepted custom HTTPS host receives the application key during authorize;
+* do not derive custom realm URLs from untrusted input. Realm URLs must be base
+* URLs without userinfo, query strings, or fragments.
+*
+* @param realmUrl - The resolved realm URL to validate.
+*
+* @throws B2RealmConfigurationError when the realm URL is not absolute, is not
+* a base URL, uses an unsupported scheme, or uses non-loopback plaintext HTTP.
+* Loopback IP HTTP is accepted only for local testing and sends the application
+* key unencrypted to whichever process is listening on that address and port.
+*/
+function assertSecureRealmUrl(realmUrl) {
+	const url = parseAbsoluteRealmUrl(realmUrl);
+	if (url === null) throw new B2RealmConfigurationError(`realm URL must be absolute for authorization: ${realmUrlForError(realmUrl, url)}`);
+	assertRealmBaseUrl(realmUrl, url);
+	assertAuthorizableRealmScheme(realmUrl, url);
+}
+function isRealmName(realm) {
+	return Object.hasOwn(VERIFIED_REALM_URLS, realm);
+}
+/**
+* Resolve a realm name to its base API URL. Unknown strings are returned
+* unchanged so callers can resolve custom aliases before authorization.
+*
+* @param realm - The realm name or direct URL to resolve.
+*
+* @returns The mapped base API URL for a known realm, otherwise `realm`.
+*/
+function getRealmUrl(realm) {
+	return isRealmName(realm) ? VERIFIED_REALM_URLS[realm] : realm;
+}
+//#endregion
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/url-guard.js
 
-class UrlGuard {
-  allowedSuffixes = [];
-  /**
-   * Lock the guard to the given host suffixes. A suffix matches a host
-   * either exactly or as a `*.suffix` subdomain. For example,
-   * `backblazeb2.com` allows `api.backblazeb2.com` and
-   * `s3.us-west-004.backblazeb2.com`.
-   *
-   * Passing an empty array disables the guard (used by the simulator and
-   * other test setups). Production code should always lock the guard after
-   * a successful `b2_authorize_account`.
-   *
-   * @param suffixes - Allowed host suffixes.
-   */
-  setAllowedSuffixes(suffixes) {
-    this.allowedSuffixes = suffixes;
-  }
-  /**
-   * Returns the current allowed-suffix list (for tests and diagnostics).
-   *
-   * @returns The currently-configured list of allowed host suffixes.
-   */
-  getAllowedSuffixes() {
-    return this.allowedSuffixes;
-  }
-  /**
-   * Validate `rawUrl` against the allow-list. Throws {@link B2SsrfError} if
-   * the URL points at a literal IP, a known-internal hostname, or a host
-   * outside the allowed suffixes. Permissive (no-op) when no suffixes have
-   * been configured yet.
-   *
-   * @param rawUrl - The URL the caller is about to fetch.
-   *
-   * @throws A `B2SsrfError` when the URL is rejected.
-   */
-  check(rawUrl) {
-    if (this.allowedSuffixes.length === 0) return;
-    let parsed;
-    try {
-      parsed = new URL(rawUrl);
-    } catch {
-      throw new B2SsrfError(`malformed URL rejected by SSRF guard: ${rawUrl}`, rawUrl);
-    }
-    const host = parsed.hostname.toLowerCase();
-    if (isLiteralIp(host)) {
-      throw new B2SsrfError(
-        `literal IP host not allowed by SSRF guard (use a hostname): ${host}`,
-        rawUrl
-      );
-    }
-    if (isInternalHostname(host)) {
-      throw new B2SsrfError(`internal hostname not allowed by SSRF guard: ${host}`, rawUrl);
-    }
-    for (const suffix of this.allowedSuffixes) {
-      const lowered = suffix.toLowerCase();
-      if (host === lowered || host.endsWith(`.${lowered}`)) return;
-    }
-    throw new B2SsrfError(
-      `host outside allowed B2 realm: ${host} (allowed suffixes: ${this.allowedSuffixes.join(", ")})`,
-      rawUrl
-    );
-  }
-}
+//# sourceMappingURL=realms.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/url-guard.js
+
+//#region src/http/url-guard.ts
+/**
+* URL allow-list guard. Defends against SSRF / URL-substitution attacks where
+* a compromised or hostile B2 endpoint returns an upload URL pointing at an
+* internal service (e.g. cloud metadata at `169.254.169.254`).
+*
+* The guard is built once per `B2Client` and updated by `B2Client.authorize()`.
+* Before authorization it is permissive (so the very first
+* `b2_authorize_account` request, whose URL the user configured, can succeed).
+* After authorization it is locked to host suffixes derived from the realm's
+* apiUrl/downloadUrl/s3ApiUrl, plus the well-known B2 upload-pod parent
+* domain `backblaze.com`.
+*
+* The guard runs in `FetchTransport` before any outgoing request. It rejects:
+*
+*   1. Literal IPv4/IPv6 addresses (defense in depth, covers attempts to
+*      bypass DNS-based checks with raw IPs).
+*   2. Well-known internal hostnames (`localhost`, `metadata`,
+*      `metadata.google.internal`, `.internal`, `.local`).
+*   3. Hosts not matching any allowed suffix once the SDK is locked.
+*
+* Users supplying a custom `transport` to `B2Client` bypass the guard. That
+* is their responsibility to document for their threat model.
+*
+* Threat-model note: the guard checks the URL's hostname before the
+* `fetch()` call. It does NOT pin the resolved IP. A DNS rebinding attack
+* could in principle resolve a permitted hostname to an internal IP between
+* the guard's check and `fetch()`'s own resolution. This is theoretical
+* against B2 because the allow-list is locked to a small set of stable
+* Backblaze hostnames (the realm's apiUrl/downloadUrl/s3ApiUrl plus the
+* `backblaze.com` parent), and DNS rebinding requires a hostname under
+* attacker control. Defense in depth — pinning the IP from the first
+* resolution and rejecting subsequent mismatches — would break legitimate
+* CDN failovers and is not justified at this surface area. If your
+* threat model requires it, supply a custom transport that does.
+*/
+/** A URL allow-list that can be reconfigured after construction. */
+var UrlGuard = class {
+	allowedSuffixes = [];
+	/**
+	* Lock the guard to the given host suffixes. A suffix matches a host
+	* either exactly or as a `*.suffix` subdomain. For example,
+	* `backblazeb2.com` allows `api.backblazeb2.com` and
+	* `s3.us-west-004.backblazeb2.com`.
+	*
+	* Passing an empty array disables the guard (used by the simulator and
+	* other test setups). Production code should always lock the guard after
+	* a successful `b2_authorize_account`.
+	*
+	* @param suffixes - Allowed host suffixes.
+	*/
+	setAllowedSuffixes(suffixes) {
+		this.allowedSuffixes = suffixes;
+	}
+	/**
+	* Returns the current allowed-suffix list (for tests and diagnostics).
+	*
+	* @returns The currently-configured list of allowed host suffixes.
+	*/
+	getAllowedSuffixes() {
+		return this.allowedSuffixes;
+	}
+	/**
+	* Validate `rawUrl` against the allow-list. Throws {@link B2SsrfError} if
+	* the URL points at a literal IP, a known-internal hostname, or a host
+	* outside the allowed suffixes. Permissive (no-op) when no suffixes have
+	* been configured yet.
+	*
+	* @param rawUrl - The URL the caller is about to fetch.
+	*
+	* @throws A `B2SsrfError` when the URL is rejected.
+	*/
+	check(rawUrl) {
+		if (this.allowedSuffixes.length === 0) return;
+		let parsed;
+		try {
+			parsed = new URL(rawUrl);
+		} catch {
+			throw new B2SsrfError(`malformed URL rejected by SSRF guard: ${rawUrl}`, rawUrl);
+		}
+		const host = parsed.hostname.toLowerCase();
+		if (isLiteralIp(host)) throw new B2SsrfError(`literal IP host not allowed by SSRF guard (use a hostname): ${host}`, rawUrl);
+		if (isInternalHostname(host)) throw new B2SsrfError(`internal hostname not allowed by SSRF guard: ${host}`, rawUrl);
+		if (hostMatchesAnyAllowedSuffix(host, this.allowedSuffixes)) return;
+		throw new B2SsrfError(`host outside allowed B2 realm: ${host} (allowed suffixes: ${this.allowedSuffixes.join(", ")})`, rawUrl);
+	}
+};
+/**
+* Extract host suffixes to allow from a B2 authorize-account response.
+*
+* Known B2 realm hosts under `backblazeb2.com` are collapsed to that parent.
+* Unknown or custom realm hosts are used as scoped suffixes: the returned
+* hostname and its subdomains are allowed, but sibling hosts and parent
+* domains are not. This avoids accidentally trusting broad public suffixes
+* such as `co.uk`.
+*
+* Always includes `backblaze.com` because upload-pod URLs returned by
+* `b2_get_upload_url` use that parent domain (`pod-NNN-NNNN-NN.backblaze.com`)
+* rather than `backblazeb2.com`.
+*
+* @param storageApi - The `apiInfo.storageApi` portion of the authorize response.
+*
+* @returns Sorted list of unique host suffixes to allow.
+*/
 function deriveAllowedSuffixes(storageApi) {
-  const suffixes = /* @__PURE__ */ new Set(["backblaze.com"]);
-  for (const url of [storageApi.apiUrl, storageApi.downloadUrl, storageApi.s3ApiUrl]) {
-    try {
-      const host = new URL(url).hostname;
-      const parts = host.split(".");
-      if (parts.length >= 2) {
-        suffixes.add(parts.slice(-2).join("."));
-      }
-    } catch {
-    }
-  }
-  return Array.from(suffixes).sort();
+	const suffixes = /* @__PURE__ */ new Set(["backblaze.com"]);
+	for (const url of [
+		storageApi.apiUrl,
+		storageApi.downloadUrl,
+		storageApi.s3ApiUrl
+	]) try {
+		const host = new URL(url).hostname;
+		suffixes.add(host === "backblazeb2.com" || host.endsWith(".backblazeb2.com") ? "backblazeb2.com" : host);
+	} catch {}
+	return Array.from(suffixes).sort();
+}
+/**
+* Checks a hostname against one allowed suffix using the SDK's exact-or-subdomain rule.
+*
+* @param hostname - URL hostname to check.
+* @param suffix - Domain suffix that may match exactly or as a parent domain.
+*
+* @returns Whether the hostname is exactly the suffix or a subdomain of it.
+*/
+function url_guard_hostMatchesAllowedSuffix(hostname, suffix) {
+	const host = hostname.toLowerCase();
+	const lowered = suffix.toLowerCase();
+	return host === lowered || host.endsWith(`.${lowered}`);
+}
+/**
+* Checks a hostname against an allowed-suffix list.
+*
+* @param hostname - URL hostname to check.
+* @param suffixes - Domain suffixes to test with the SDK's suffix-matching rule.
+*
+* @returns Whether any suffix matches the hostname.
+*/
+function hostMatchesAnyAllowedSuffix(hostname, suffixes) {
+	return suffixes.some((suffix) => url_guard_hostMatchesAllowedSuffix(hostname, suffix));
 }
 function isLiteralIp(host) {
-  if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host)) return true;
-  if (host.includes(":")) return true;
-  return false;
+	if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host)) return true;
+	if (host.includes(":")) return true;
+	return false;
 }
 function isInternalHostname(host) {
-  if (host === "localhost") return true;
-  if (host.endsWith(".localhost")) return true;
-  if (host === "metadata") return true;
-  if (host === "metadata.google.internal") return true;
-  if (host.endsWith(".internal")) return true;
-  if (host.endsWith(".local")) return true;
-  return false;
+	if (host === "localhost") return true;
+	if (host.endsWith(".localhost")) return true;
+	if (host === "metadata") return true;
+	if (host === "metadata.google.internal") return true;
+	if (host.endsWith(".internal")) return true;
+	if (host.endsWith(".local")) return true;
+	return false;
 }
+//#endregion
+
 
 //# sourceMappingURL=url-guard.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/_virtual/_b2-sdk-version-json.js
+//#region \0b2-sdk-version-json
+var _b2_sdk_version_json_default = { "version": "0.2.0" };
+//#endregion
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/package.json.js
-const version = "0.1.0";
-const pkg = {
-  version
-};
 
-//# sourceMappingURL=package.json.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/version.js
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/version.js
+//#region src/version.ts
+/**
+* Current SDK version. Read directly from package.json so there is no
+* second-source-of-truth to keep in sync — bumping `version` in package.json
+* automatically propagates here, into the SDK's User-Agent header, and into
+* the published artifact.
+*
+* Works in every runtime the SDK targets:
+*   - Node 22.3+, Bun, Deno: native JSON import attributes.
+*   - Vite builds: the JSON import is replaced with a version-only shim so
+*     published runtime chunks do not carry unrelated package metadata.
+*   - Vitest browser mode: Vite handles the import the same way as build.
+*/
+var VERSION = _b2_sdk_version_json_default.version;
+//#endregion
 
-const VERSION = pkg.version;
 
 //# sourceMappingURL=version.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/user-agent.js
-
-const SDK_PRODUCT = "b2-sdk-typescript";
-const SDK_PACKAGE = "@backblaze-labs/b2-sdk";
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/user-agent.js
+
+//#region src/http/user-agent.ts
+/**
+* Stable identifier Backblaze can grep server logs for to find every request
+* issued by this SDK regardless of how the User-Agent comment evolves.
+* Treat as part of the public contract: do NOT rename without coordinating.
+*/
+var SDK_PRODUCT = "b2-sdk-typescript";
+/**
+* The npm package name. Embedded in the User-Agent comment alongside
+* {@link SDK_PRODUCT} so log queries that grep on either token work.
+*/
+var SDK_PACKAGE = "@backblaze-labs/b2-sdk";
+/**
+* Best-effort detection of the JS runtime and host OS. Used to populate the
+* User-Agent comment so server-side logs can spot Bun/Deno adoption and
+* triage OS-specific issues without asking for a repro environment.
+*
+* @returns The detected runtime, OS, and architecture tokens.
+*/
 function detectPlatform() {
-  const g = globalThis;
-  if (typeof g["Deno"] !== "undefined") {
-    const deno = g["Deno"];
-    return {
-      runtime: deno.version?.deno ? `deno/${deno.version.deno}` : "deno",
-      os: deno.build?.os,
-      arch: deno.build?.arch
-    };
-  }
-  if (typeof g["Bun"] !== "undefined") {
-    const bun = g["Bun"];
-    const proc = g["process"];
-    return {
-      runtime: bun.version ? `bun/${bun.version}` : "bun",
-      os: proc?.platform,
-      arch: proc?.arch
-    };
-  }
-  if (typeof g["process"] !== "undefined") {
-    const proc = g["process"];
-    if (proc.versions?.node) {
-      return {
-        runtime: `node/${proc.versions.node}`,
-        os: proc.platform,
-        arch: proc.arch
-      };
-    }
-  }
-  if (typeof g["navigator"] !== "undefined") {
-    return { runtime: "browser", os: void 0, arch: void 0 };
-  }
-  return { runtime: "unknown", os: void 0, arch: void 0 };
-}
+	const g = globalThis;
+	if (typeof g["Deno"] !== "undefined") {
+		const deno = g["Deno"];
+		return {
+			runtime: deno.version?.deno ? `deno/${deno.version.deno}` : "deno",
+			os: deno.build?.os,
+			arch: deno.build?.arch
+		};
+	}
+	if (typeof g["Bun"] !== "undefined") {
+		const bun = g["Bun"];
+		const proc = g["process"];
+		return {
+			runtime: bun.version ? `bun/${bun.version}` : "bun",
+			os: proc?.platform,
+			arch: proc?.arch
+		};
+	}
+	if (typeof g["process"] !== "undefined") {
+		const proc = g["process"];
+		if (proc.versions?.node) return {
+			runtime: `node/${proc.versions.node}`,
+			os: proc.platform,
+			arch: proc.arch
+		};
+	}
+	if (typeof g["navigator"] !== "undefined") return {
+		runtime: "browser",
+		os: void 0,
+		arch: void 0
+	};
+	return {
+		runtime: "unknown",
+		os: void 0,
+		arch: void 0
+	};
+}
+/**
+* Build the User-Agent header value the SDK sends on every B2 request.
+*
+* The product token, npm package name, language label, runtime, OS, and
+* architecture are emitted in that order, separated by semicolons inside a
+* single parenthesised comment block. OS and architecture are omitted on
+* runtimes that don't expose them (notably browsers). A custom prefix passed
+* via `B2ClientOptions.userAgent` is prepended verbatim so app-level
+* identifiers come first. See the README "Identifying your traffic" section
+* for examples.
+*
+* @param custom - Optional prefix prepended to the default User-Agent.
+*
+* @returns The formatted User-Agent header string.
+*/
 function getUserAgent(custom) {
-  const { runtime, os, arch } = detectPlatform();
-  const parts = ["typescript", SDK_PACKAGE, runtime];
-  if (os !== void 0) parts.push(os);
-  if (arch !== void 0) parts.push(arch);
-  const base = `${SDK_PRODUCT}/${VERSION} (${parts.join("; ")})`;
-  return custom ? `${custom} ${base}` : base;
+	const { runtime, os, arch } = detectPlatform();
+	const parts = [
+		"typescript",
+		SDK_PACKAGE,
+		runtime
+	];
+	if (os !== void 0) parts.push(os);
+	if (arch !== void 0) parts.push(arch);
+	const base = `${SDK_PRODUCT}/${VERSION} (${parts.join("; ")})`;
+	return custom ? `${custom} ${base}` : base;
 }
-
-//# sourceMappingURL=user-agent.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/transport.js
+//#endregion
 
 
+//# sourceMappingURL=user-agent.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/transport.js
 
 
-class FetchTransport {
-  /** User-Agent string sent with every request. */
-  userAgent;
-  /** SSRF allow-list applied to every outgoing URL. Mutable so `B2Client.authorize()` can lock it down post-auth. */
-  urlGuard;
-  /**
-   * Creates a new FetchTransport.
-   * @param options - Optional configuration: custom User-Agent prefix and SSRF guard.
-   */
-  constructor(options) {
-    this.userAgent = getUserAgent(options?.userAgent);
-    this.urlGuard = options?.urlGuard ?? new UrlGuard();
-  }
-  /**
-   * Sends the request using the global `fetch` function.
-   * @param request - The HTTP request to execute.
-   *
-   * @returns The HTTP response.
-   *
-   * @throws B2SsrfError when the URL fails the configured SSRF guard.
-   */
-  async send(request) {
-    this.urlGuard.check(request.url);
-    const headers = new Headers(request.headers);
-    if (!headers.has("User-Agent")) {
-      headers.set("User-Agent", this.userAgent);
-    }
-    const response = await fetch(request.url, {
-      method: request.method,
-      headers,
-      body: request.body ?? null,
-      ...request.signal !== void 0 ? { signal: request.signal } : {}
-    });
-    return {
-      status: response.status,
-      headers: response.headers,
-      body: response.body,
-      json: () => response.json(),
-      text: () => response.text(),
-      arrayBuffer: () => response.arrayBuffer()
-    };
-  }
-}
-class RetryTransport {
-  /** The wrapped transport that performs actual HTTP requests. */
-  inner;
-  /** Resolved retry options (defaults merged with user overrides). */
-  options;
-  /** Optional callback to refresh auth credentials on 401 — returns the fresh token. */
-  onReauth;
-  /** Sleep implementation used between retries; injectable for tests. */
-  sleepImpl;
-  /**
-   * Creates a new RetryTransport.
-   * @param opts - Retry transport configuration.
-   */
-  constructor(opts) {
-    this.inner = opts.transport;
-    this.options = { ...DEFAULT_RETRY_OPTIONS, ...opts.retry };
-    if (opts.onReauth !== void 0) this.onReauth = opts.onReauth;
-    this.sleepImpl = opts.sleepImpl ?? sleep;
-  }
-  /**
-   * Sends the request with automatic retry on transient failures.
-   * On expired auth tokens, calls {@link RetryTransportOptions.onReauth} and retries.
-   * @param originalRequest - The HTTP request to execute. The caller's
-   *   reference is not mutated; on reauth, a copy with a refreshed
-   *   Authorization header is sent.
-   *
-   * @returns The HTTP response.
-   */
-  async send(originalRequest) {
-    let request = originalRequest;
-    let lastError;
-    for (let attempt = 0; attempt <= this.options.maxRetries; attempt++) {
-      if (attempt > 0 && lastError) {
-        const retryAfter = lastError instanceof NetworkError ? void 0 : lastError.retryAfter;
-        const delay = computeBackoff(attempt - 1, this.options, retryAfter);
-        await this.sleepImpl(delay, request.signal);
-      }
-      try {
-        const response = await this.inner.send(request);
-        if (response.status >= 200 && response.status < 300) {
-          return response;
-        }
-        let errorBody;
-        try {
-          errorBody = await response.json();
-        } catch {
-          errorBody = {
-            status: response.status,
-            code: "internal_error",
-            message: `HTTP ${response.status}`
-          };
-        }
-        const retryAfterHeader = response.headers.get("Retry-After");
-        const retryAfterSec = retryAfterHeader ? Number.parseInt(retryAfterHeader, 10) : void 0;
-        const requestId = response.headers.get("X-Bz-Request-Id") ?? void 0;
-        const error = classifyError(errorBody, {
-          ...retryAfterSec !== void 0 ? { retryAfter: retryAfterSec } : {},
-          ...requestId !== void 0 ? { requestId } : {}
-        });
-        if (error instanceof ExpiredAuthTokenError && this.onReauth) {
-          const freshToken = await this.onReauth();
-          request = {
-            ...request,
-            headers: { ...request.headers ?? {}, Authorization: freshToken }
-          };
-          continue;
-        }
-        if (!error.retryable || attempt === this.options.maxRetries) {
-          throw error;
-        }
-        lastError = error;
-      } catch (err) {
-        if (err instanceof B2Error || err instanceof NetworkError) {
-          throw err;
-        }
-        if (err instanceof DOMException && err.name === "AbortError") {
-          throw err;
-        }
-        const networkErr = new NetworkError(
-          err instanceof Error ? err.message : "Network error",
-          err
-        );
-        if (attempt === this.options.maxRetries) {
-          throw networkErr;
-        }
-        lastError = networkErr;
-      }
-    }
-    throw lastError ?? new NetworkError("Max retries exceeded");
-  }
-}
 
-//# sourceMappingURL=transport.js.map
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/encryption.js
-const EncryptionAlgorithm = {
-  /** AES with a 256-bit key. The only algorithm B2 currently supports. */
-  Aes256: "AES256"
+//#region src/http/transport.ts
+var REDIRECT_STATUSES = /* @__PURE__ */ new Set([
+	301,
+	302,
+	303,
+	307,
+	308
+]);
+var MAX_SAME_ORIGIN_REDIRECTS = 5;
+/**
+* Default transport implementation using the global `fetch` API.
+* Automatically sets the User-Agent header on each request and applies the
+* SSRF {@link UrlGuard} (if configured) before opening the connection.
+* Redirect following is disabled so redirected URLs cannot bypass the guard or
+* receive credential-bearing headers without an explicit checked request.
+*/
+var FetchTransport = class {
+	/** User-Agent string sent with every request. */
+	userAgent;
+	/** Whether same-origin GET/HEAD redirects should be followed after guard checks. */
+	followSameOriginRedirects;
+	/** SSRF allow-list applied to every outgoing URL. Mutable so `B2Client.authorize()` can lock it down post-auth. */
+	urlGuard;
+	/**
+	* Creates a new FetchTransport.
+	* @param options - Optional configuration: custom User-Agent prefix and SSRF guard.
+	*/
+	constructor(options) {
+		this.userAgent = getUserAgent(options?.userAgent);
+		this.followSameOriginRedirects = options?.followSameOriginRedirects ?? true;
+		this.urlGuard = options?.urlGuard ?? new UrlGuard();
+	}
+	/**
+	* Sends the request using the global `fetch` function.
+	* @param request - The HTTP request to execute.
+	*
+	* @returns The HTTP response.
+	*
+	* @throws B2SsrfError when the URL fails the configured SSRF guard.
+	* @throws B2RedirectError when a response attempts to redirect.
+	*/
+	async send(request) {
+		let currentRequest = request;
+		let redirectCount = 0;
+		while (true) {
+			this.urlGuard.check(currentRequest.url);
+			const headers = new Headers(currentRequest.headers);
+			if (!headers.has("User-Agent")) headers.set("User-Agent", this.userAgent);
+			const timeoutScope = createRequestTimeoutScope(currentRequest);
+			let response;
+			try {
+				response = await fetch(currentRequest.url, {
+					method: currentRequest.method,
+					headers,
+					body: currentRequest.body ?? null,
+					redirect: "manual",
+					...timeoutScope.signal !== void 0 ? { signal: timeoutScope.signal } : {}
+				});
+			} catch (err) {
+				timeoutScope.dispose();
+				if (timeoutScope.timedOut) throw createRequestTimeoutError(timeoutScope);
+				throw err;
+			}
+			if (isBlockedRedirect(response)) {
+				const location = response.headers.get("Location");
+				if (this.followSameOriginRedirects && location !== null && redirectCount < MAX_SAME_ORIGIN_REDIRECTS && canFollowSameOriginRedirect(currentRequest, location)) {
+					const nextUrl = new URL(location, currentRequest.url).toString();
+					await cancelResponseBody(response);
+					timeoutScope.dispose();
+					this.urlGuard.check(nextUrl);
+					currentRequest = {
+						...currentRequest,
+						url: nextUrl
+					};
+					redirectCount += 1;
+					continue;
+				}
+				await cancelResponseBody(response);
+				timeoutScope.dispose();
+				throw new B2RedirectError(currentRequest.url, response.status, location);
+			}
+			return createTimedHttpResponse(response, timeoutScope);
+		}
+	}
 };
-const EncryptionMode = {
-  /** B2-managed encryption keys. */
-  SseB2: "SSE-B2",
-  /** Customer-provided encryption keys. */
-  SseC: "SSE-C",
-  /** No encryption. */
-  None: "none"
+function createRequestTimeoutScope(request) {
+	const timeoutMs = request.retry?.requestTimeoutMs ?? DEFAULT_RETRY_OPTIONS.requestTimeoutMs;
+	if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
+		const scope = {
+			timeoutMs: 0,
+			timedOut: false,
+			reset() {},
+			dispose() {}
+		};
+		if (request.signal !== void 0) return {
+			...scope,
+			signal: request.signal
+		};
+		return scope;
+	}
+	const controller = new AbortController();
+	let timedOut = false;
+	let timer;
+	const abortFromUpstream = () => {
+		clearTimeout(timer);
+		controller.abort(request.signal?.reason ?? new DOMException("Aborted", "AbortError"));
+	};
+	const armTimer = () => {
+		const nextTimer = setTimeout(() => {
+			timedOut = true;
+			controller.abort(new DOMException("HTTP request timed out", "TimeoutError"));
+		}, timeoutMs);
+		unrefTimer(nextTimer);
+		return nextTimer;
+	};
+	timer = armTimer();
+	const reset = () => {
+		if (timedOut || controller.signal.aborted) return;
+		clearTimeout(timer);
+		timer = armTimer();
+	};
+	if (request.signal?.aborted === true) {
+		clearTimeout(timer);
+		abortFromUpstream();
+	} else request.signal?.addEventListener("abort", abortFromUpstream, { once: true });
+	return {
+		signal: controller.signal,
+		timeoutMs,
+		get timedOut() {
+			return timedOut;
+		},
+		reset,
+		dispose() {
+			clearTimeout(timer);
+			request.signal?.removeEventListener("abort", abortFromUpstream);
+		}
+	};
+}
+function unrefTimer(timer) {
+	const maybeUnref = timer.unref;
+	if (typeof maybeUnref === "function") maybeUnref.call(timer);
+}
+function createRequestTimeoutError(scope) {
+	return new DOMException(`HTTP request timed out after ${scope.timeoutMs} ms`, "TimeoutError");
+}
+function createTimedHttpResponse(response, timeoutScope) {
+	const body = response.body;
+	if (body === null) timeoutScope.dispose();
+	let timedBody;
+	return {
+		status: response.status,
+		headers: response.headers,
+		get body() {
+			if (body === null) return null;
+			timedBody ??= createTimedResponseBody(body, timeoutScope);
+			return timedBody;
+		},
+		json: () => readTimedResponseBody(timeoutScope, response, () => response.json()),
+		text: () => readTimedResponseBody(timeoutScope, response, () => response.text()),
+		arrayBuffer: () => readTimedResponseBody(timeoutScope, response, () => response.arrayBuffer())
+	};
+}
+async function readTimedResponseBody(timeoutScope, response, read) {
+	try {
+		return await raceBodyReadWithAbort(timeoutScope, read(), (reason) => cancelResponseBody(response, reason));
+	} catch (err) {
+		if (timeoutScope.timedOut) throw createRequestTimeoutError(timeoutScope);
+		throw err;
+	} finally {
+		timeoutScope.dispose();
+	}
+}
+function createTimedResponseBody(body, timeoutScope) {
+	let reader;
+	let disposed = false;
+	const dispose = () => {
+		if (disposed) return;
+		disposed = true;
+		timeoutScope.dispose();
+	};
+	return new ReadableStream({
+		async pull(controller) {
+			reader ??= body.getReader();
+			try {
+				const result = await raceBodyReadWithAbort(timeoutScope, reader.read(), (reason) => reader?.cancel(reason));
+				if (result.done) {
+					dispose();
+					controller.close();
+					return;
+				}
+				timeoutScope.reset();
+				controller.enqueue(result.value);
+			} catch (err) {
+				dispose();
+				if (timeoutScope.timedOut) {
+					controller.error(createRequestTimeoutError(timeoutScope));
+					return;
+				}
+				controller.error(err);
+			}
+		},
+		async cancel(reason) {
+			dispose();
+			try {
+				if (reader !== void 0) {
+					await reader.cancel(reason);
+					return;
+				}
+				await body.cancel(reason);
+			} catch {}
+		}
+	});
+}
+async function raceBodyReadWithAbort(timeoutScope, read, abortCleanup) {
+	const signal = timeoutScope.signal;
+	if (signal === void 0) return read;
+	const abortReason = () => signal.reason ?? new DOMException("Aborted", "AbortError");
+	if (signal.aborted) {
+		read.catch(() => {});
+		const reason = abortReason();
+		await runAbortCleanup(abortCleanup, reason);
+		throw reason;
+	}
+	let removeAbortListener;
+	const abort = new Promise((_, reject) => {
+		const onAbort = () => {
+			const reason = abortReason();
+			read.catch(() => {});
+			reject(reason);
+			runAbortCleanup(abortCleanup, reason);
+		};
+		signal.addEventListener("abort", onAbort, { once: true });
+		removeAbortListener = () => signal.removeEventListener("abort", onAbort);
+	});
+	try {
+		return await Promise.race([read, abort]);
+	} finally {
+		removeAbortListener?.();
+	}
+}
+async function runAbortCleanup(abortCleanup, reason) {
+	try {
+		await abortCleanup?.(reason);
+	} catch {}
+}
+function isBlockedRedirect(response) {
+	return response.type === "opaqueredirect" || REDIRECT_STATUSES.has(response.status);
+}
+function canFollowSameOriginRedirect(request, location) {
+	if (request.method !== "GET" && request.method !== "HEAD") return false;
+	try {
+		return new URL(request.url).origin === new URL(location, request.url).origin;
+	} catch {
+		return false;
+	}
+}
+async function cancelResponseBody(response, reason) {
+	try {
+		await response.body?.cancel(reason);
+	} catch {}
+}
+/**
+* Decide whether `url` points at a URL-pinned upload POST endpoint.
+*
+* @param url - Request URL to inspect.
+*
+* @returns Whether the request is a direct upload endpoint.
+*/
+function isUploadEndpoint(url) {
+	const endpoint = b2ApiEndpointName(url);
+	return endpoint === "b2_upload_file" || endpoint === "b2_upload_part";
+}
+function isFinishLargeFileEndpoint(url) {
+	return b2ApiEndpointName(url) === "b2_finish_large_file";
+}
+function isStartLargeFileEndpoint(url) {
+	return b2ApiEndpointName(url) === "b2_start_large_file";
+}
+function b2ApiEndpointName(url) {
+	const [, root, , endpoint] = new URL(url).pathname.split("/");
+	if (root !== "b2api") return void 0;
+	return endpoint;
+}
+function isReplayUnsafePostEndpoint(url) {
+	return isUploadEndpoint(url) || isStartLargeFileEndpoint(url) || isFinishLargeFileEndpoint(url);
+}
+/**
+* Decide whether a classified error should be retried in place for `url`.
+* Transient errors normally retry; upload endpoints bubble to the upload layer
+* for fresh-URL retry except account-level 429 throttling, where fetching a new
+* upload URL only amplifies the rate limit.
+*
+* @param error - The classified, retryability-tagged error.
+* @param url - The request URL (used to detect upload endpoints).
+*
+* @returns Whether to retry the request in place.
+*/
+function shouldRetryInPlace(error, url) {
+	if (!error.retryable) return false;
+	if (isStartLargeFileEndpoint(url) || isFinishLargeFileEndpoint(url)) return false;
+	if (isUploadEndpoint(url) && error.status === 429) return true;
+	if (isUploadEndpoint(url)) return false;
+	return true;
+}
+function isRequestTimeoutError(err) {
+	return err instanceof DOMException && err.name === "TimeoutError";
+}
+function isTerminalTransportError(err) {
+	return err instanceof B2Error || err instanceof B2RedirectError || err instanceof NetworkError || err instanceof B2SsrfError || err instanceof DOMException && err.name === "AbortError";
+}
+/**
+* Transport wrapper that adds automatic retry with exponential backoff.
+* Handles transient errors (408, 429, and the transient 5xx set 500/502/503/504),
+* expired auth tokens, and network failures. Delegates to an inner
+* {@link HttpTransport}.
+*
+* Upload endpoints (`b2_upload_file` / `b2_upload_part`) are URL-pinned. Their
+* retryable pod failures bubble to the upload layer, which evicts the failed
+* URL, fetches a fresh one, and retries there. HTTP 429 remains an in-place
+* retry so account-level throttling does not trigger extra upload URL fetches.
+*/
+var RetryTransport = class {
+	/** The wrapped transport that performs actual HTTP requests. */
+	inner;
+	/** Resolved retry options (defaults merged with user overrides). */
+	options;
+	/** Optional callback to refresh auth credentials on 401 — returns the fresh token. */
+	onReauth;
+	/** Sleep implementation used between retries; injectable for tests. */
+	sleepImpl;
+	/**
+	* Creates a new RetryTransport.
+	* @param opts - Retry transport configuration.
+	*/
+	constructor(opts) {
+		this.inner = opts.transport;
+		this.options = {
+			...DEFAULT_RETRY_OPTIONS,
+			...opts.retry
+		};
+		if (opts.onReauth !== void 0) this.onReauth = opts.onReauth;
+		this.sleepImpl = opts.sleepImpl ?? sleep;
+	}
+	/**
+	* Sends the request with automatic retry on transient failures.
+	* On expired auth tokens, calls {@link RetryTransportOptions.onReauth} and retries.
+	* @param originalRequest - The HTTP request to execute. The caller's
+	*   reference is not mutated; on reauth, a copy with a refreshed
+	*   Authorization header is sent.
+	*
+	* @returns The HTTP response.
+	*/
+	async send(originalRequest) {
+		let request = originalRequest;
+		const retryOptions = {
+			...this.options,
+			...originalRequest.retry
+		};
+		let lastError;
+		let didReauth = false;
+		let attempt = 0;
+		while (attempt <= retryOptions.maxRetries) {
+			throwIfSignalAborted(request.signal);
+			if (attempt > 0 && lastError) {
+				const retryAfter = lastError instanceof NetworkError ? void 0 : lastError.retryAfter;
+				const delay = computeBackoff(attempt - 1, retryOptions, retryAfter);
+				await this.sleepImpl(delay, request.signal);
+			}
+			try {
+				const response = await this.inner.send({
+					...request,
+					retry: retryOptions
+				});
+				await throwIfSignalAbortedAfterResponse(request.signal, response);
+				if (response.status >= 200 && response.status < 300) return response;
+				let errorBody;
+				try {
+					errorBody = await response.json();
+				} catch (err) {
+					if (isRequestTimeoutError(err)) throw err;
+					errorBody = {
+						status: response.status,
+						code: "internal_error",
+						message: `HTTP ${response.status}`
+					};
+				}
+				const retryAfterHeader = response.headers.get("Retry-After");
+				const retryAfterSec = retryAfterHeader ? Number.parseInt(retryAfterHeader, 10) : void 0;
+				const requestId = response.headers.get("X-Bz-Request-Id") ?? void 0;
+				const error = classifyError(errorBody, {
+					...retryAfterSec !== void 0 ? { retryAfter: retryAfterSec } : {},
+					...requestId !== void 0 ? { requestId } : {}
+				});
+				if (error instanceof ExpiredAuthTokenError && this.onReauth && !isUploadEndpoint(request.url) && !didReauth) {
+					const freshToken = await this.onReauth();
+					request = {
+						...request,
+						headers: {
+							...request.headers ?? {},
+							Authorization: freshToken
+						}
+					};
+					didReauth = true;
+					lastError = void 0;
+					continue;
+				}
+				if (!shouldRetryInPlace(error, request.url) || attempt === retryOptions.maxRetries) throw error;
+				lastError = error;
+				attempt += 1;
+			} catch (err) {
+				throwIfSignalAborted(request.signal);
+				if (isTerminalTransportError(err)) throw err;
+				const networkErr = new NetworkError(err instanceof Error ? err.message : "Network error", err);
+				if (isReplayUnsafePostEndpoint(request.url) || attempt === retryOptions.maxRetries) throw networkErr;
+				lastError = networkErr;
+				attempt += 1;
+			}
+		}
+		throw lastError ?? new NetworkError("Max retries exceeded");
+	}
 };
-const SSE_B2 = { mode: "SSE-B2", algorithm: "AES256" };
-const SSE_NONE = { mode: "none" };
-function sseCustomer(customerKey, customerKeyMd5) {
-  return { mode: "SSE-C", algorithm: "AES256", customerKey, customerKeyMd5 };
-}
-function bytesToBase64(bytes) {
-  const g = globalThis;
-  if (g.Buffer) {
-    return g.Buffer.from(bytes).toString("base64");
-  }
-  let binary = "";
-  for (const b of bytes) binary += String.fromCharCode(b);
-  return btoa(binary);
-}
-async function md5Base64(bytes) {
-  try {
-    const { createHash } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 7598, 19));
-    if (typeof createHash !== "function") throw new Error("createHash unavailable");
-    return createHash("md5").update(bytes).digest("base64");
-  } catch {
-    return bytesToBase64(md5Bytes(bytes));
-  }
+function throwIfSignalAborted(signal) {
+	if (signal?.aborted === true) throw signal.reason ?? new DOMException("Aborted", "AbortError");
 }
-function md5Bytes(data) {
-  const originalBitLength = data.byteLength * 8;
-  const padLength = (data.byteLength + 8 >>> 6) + 1;
-  const padded = new Uint8Array(padLength * 64);
-  padded.set(data);
-  padded[data.byteLength] = 128;
-  const lowBits = originalBitLength >>> 0;
-  const highBits = Math.floor(originalBitLength / 4294967296) >>> 0;
-  const lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8);
-  lengthView.setUint32(0, lowBits, true);
-  lengthView.setUint32(4, highBits, true);
-  const s = [
-    7,
-    12,
-    17,
-    22,
-    7,
-    12,
-    17,
-    22,
-    7,
-    12,
-    17,
-    22,
-    7,
-    12,
-    17,
-    22,
-    5,
-    9,
-    14,
-    20,
-    5,
-    9,
-    14,
-    20,
-    5,
-    9,
-    14,
-    20,
-    5,
-    9,
-    14,
-    20,
-    4,
-    11,
-    16,
-    23,
-    4,
-    11,
-    16,
-    23,
-    4,
-    11,
-    16,
-    23,
-    4,
-    11,
-    16,
-    23,
-    6,
-    10,
-    15,
-    21,
-    6,
-    10,
-    15,
-    21,
-    6,
-    10,
-    15,
-    21,
-    6,
-    10,
-    15,
-    21
-  ];
-  const k = new Uint32Array([
-    3614090360,
-    3905402710,
-    606105819,
-    3250441966,
-    4118548399,
-    1200080426,
-    2821735955,
-    4249261313,
-    1770035416,
-    2336552879,
-    4294925233,
-    2304563134,
-    1804603682,
-    4254626195,
-    2792965006,
-    1236535329,
-    4129170786,
-    3225465664,
-    643717713,
-    3921069994,
-    3593408605,
-    38016083,
-    3634488961,
-    3889429448,
-    568446438,
-    3275163606,
-    4107603335,
-    1163531501,
-    2850285829,
-    4243563512,
-    1735328473,
-    2368359562,
-    4294588738,
-    2272392833,
-    1839030562,
-    4259657740,
-    2763975236,
-    1272893353,
-    4139469664,
-    3200236656,
-    681279174,
-    3936430074,
-    3572445317,
-    76029189,
-    3654602809,
-    3873151461,
-    530742520,
-    3299628645,
-    4096336452,
-    1126891415,
-    2878612391,
-    4237533241,
-    1700485571,
-    2399980690,
-    4293915773,
-    2240044497,
-    1873313359,
-    4264355552,
-    2734768916,
-    1309151649,
-    4149444226,
-    3174756917,
-    718787259,
-    3951481745
-  ]);
-  let a0 = 1732584193;
-  let b0 = 4023233417;
-  let c0 = 2562383102;
-  let d0 = 271733878;
-  const m = new Uint32Array(16);
-  const view = new DataView(padded.buffer);
-  for (let block = 0; block < padded.byteLength; block += 64) {
-    for (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true);
-    let A = a0;
-    let B = b0;
-    let C = c0;
-    let D = d0;
-    for (let i = 0; i < 64; i++) {
-      let f;
-      let g;
-      if (i < 16) {
-        f = B & C | ~B & D;
-        g = i;
-      } else if (i < 32) {
-        f = D & B | ~D & C;
-        g = (5 * i + 1) % 16;
-      } else if (i < 48) {
-        f = B ^ C ^ D;
-        g = (3 * i + 5) % 16;
-      } else {
-        f = C ^ (B | ~D);
-        g = 7 * i % 16;
-      }
-      const temp = D;
-      D = C;
-      C = B;
-      const sum = A + f + (k[i] ?? 0) + (m[g] ?? 0) >>> 0;
-      const shift = s[i] ?? 0;
-      const rotated = (sum << shift | sum >>> 32 - shift) >>> 0;
-      B = B + rotated >>> 0;
-      A = temp;
-    }
-    a0 = a0 + A >>> 0;
-    b0 = b0 + B >>> 0;
-    c0 = c0 + C >>> 0;
-    d0 = d0 + D >>> 0;
-  }
-  const out = new Uint8Array(16);
-  const outView = new DataView(out.buffer);
-  outView.setUint32(0, a0, true);
-  outView.setUint32(4, b0, true);
-  outView.setUint32(8, c0, true);
-  outView.setUint32(12, d0, true);
-  return out;
-}
-const KEY_REDACTED = "[redacted SSE-C key]";
-class EncryptionKey {
-  /** Encryption mode discriminant. Always `'SSE-C'` for this class. */
-  mode = "SSE-C";
-  /** Encryption algorithm. B2's S3-compatible API only supports AES-256. */
-  algorithm = "AES256";
-  /** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */
-  customerKey;
-  /** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */
-  customerKeyMd5;
-  /**
-   * Internal constructor. Use {@link EncryptionKey.fromBytes} or
-   * {@link EncryptionKey.fromBase64} instead.
-   *
-   * @param customerKey - Base64-encoded 256-bit encryption key.
-   * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.
-   *
-   * @internal
-   */
-  constructor(customerKey, customerKeyMd5) {
-    this.customerKey = customerKey;
-    this.customerKeyMd5 = customerKeyMd5;
-  }
-  /**
-   * Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the
-   * required base64 MD5 digest internally.
-   *
-   * @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes.
-   *
-   * @returns A safely-wrapped EncryptionKey ready for upload/download.
-   *
-   * @throws If the key is not exactly 32 bytes.
-   */
-  static async fromBytes(rawKey) {
-    if (rawKey.byteLength !== 32) {
-      throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`);
-    }
-    const customerKey = bytesToBase64(rawKey);
-    const customerKeyMd5 = await md5Base64(rawKey);
-    return new EncryptionKey(customerKey, customerKeyMd5);
-  }
-  /**
-   * Builds an EncryptionKey from precomputed base64 strings. Use this in
-   * environments where MD5 must be computed externally (e.g., browsers).
-   *
-   * @param customerKey - Base64-encoded 256-bit encryption key.
-   * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.
-   *
-   * @returns A safely-wrapped EncryptionKey ready for upload/download.
-   */
-  static fromBase64(customerKey, customerKeyMd5) {
-    return new EncryptionKey(customerKey, customerKeyMd5);
-  }
-  /**
-   * Hides the key bytes from `JSON.stringify`.
-   *
-   * @returns A redacted shape: same mode and algorithm, but the key and MD5
-   *   replaced with a placeholder string.
-   */
-  toJSON() {
-    return {
-      mode: this.mode,
-      algorithm: this.algorithm,
-      customerKey: KEY_REDACTED,
-      customerKeyMd5: KEY_REDACTED
-    };
-  }
-  /**
-   * Hides the key bytes from default `toString()`.
-   *
-   * @returns A short opaque label indicating this is an SSE-C key.
-   */
-  toString() {
-    return `[EncryptionKey SSE-C ${KEY_REDACTED}]`;
-  }
-  /**
-   * Hides the key bytes from Node's `util.inspect` (and therefore `console.log`).
-   *
-   * @returns A short opaque label indicating this is an SSE-C key.
-   */
-  [Symbol.for("nodejs.util.inspect.custom")]() {
-    return this.toString();
-  }
+async function throwIfSignalAbortedAfterResponse(signal, response) {
+	if (signal?.aborted !== true) return;
+	const reason = signal.reason ?? new DOMException("Aborted", "AbortError");
+	try {
+		await response.body?.cancel(reason);
+	} catch {}
+	throw reason;
 }
-
-//# sourceMappingURL=encryption.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/index.js
-
+//#endregion
 
 
-
-class RawClient {
-  /** @internal */
-  transport;
-  /**
-   * Creates a new RawClient with the given transport.
-   * @param options - The constructor configuration.
-   */
-  constructor(options) {
-    this.transport = options.transport;
-  }
-  // --- Auth ---
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}.
-   * @param applicationKeyId - The application key ID for authentication.
-   * @param applicationKey - The application key secret.
-   * @param realmUrl - The B2 realm URL to authenticate against.
-   *
-   * @returns The authorization response with API URLs and credentials.
-   */
-  async authorizeAccount(applicationKeyId, applicationKey, realmUrl = "https://api.backblazeb2.com") {
-    const response = await this.transport.send({
-      url: `${realmUrl}/b2api/v3/b2_authorize_account`,
-      method: "GET",
-      headers: {
-        Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}`
-      }
-    });
-    return response.json();
-  }
-  // --- Buckets ---
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The created bucket metadata.
-   */
-  async createBucket(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_create_bucket", request);
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The deleted bucket metadata.
-   */
-  async deleteBucket(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_delete_bucket", request);
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The list of matching buckets.
-   */
-  async listBuckets(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_list_buckets", request);
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The updated bucket metadata.
-   */
-  async updateBucket(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_update_bucket", request);
-  }
-  // --- Files ---
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-url | b2_get_upload_url}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The upload URL and authorization token.
-   */
-  async getUploadUrl(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_get_upload_url", request);
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-upload-file | b2_upload_file}.
-   *
-   * Unlike most methods, this posts directly to the `uploadUrl` obtained
-   * from {@link getUploadUrl} rather than the API URL.
-   * @param uploadUrl - The upload endpoint URL.
-   * @param headers - The request headers including authorization and content metadata.
-   * @param body - The file data to upload.
-   * @param signal - An optional abort signal for cancellation.
-   *
-   * @returns The uploaded file version metadata.
-   */
-  async uploadFile(uploadUrl, headers, body, signal) {
-    const reqHeaders = {
-      Authorization: headers.authorization,
-      "X-Bz-File-Name": encodeFileName(headers.fileName),
-      "Content-Type": headers.contentType,
-      "Content-Length": String(headers.contentLength),
-      "X-Bz-Content-Sha1": headers.contentSha1,
-      ...buildFileInfoHeaders(headers.fileInfo)
-    };
-    if (headers.lastModifiedMillis !== void 0) {
-      reqHeaders["X-Bz-Info-src_last_modified_millis"] = String(headers.lastModifiedMillis);
-    }
-    if (headers.contentDisposition) {
-      reqHeaders["X-Bz-Info-b2-content-disposition"] = headers.contentDisposition;
-    }
-    if (headers.contentLanguage) {
-      reqHeaders["X-Bz-Info-b2-content-language"] = headers.contentLanguage;
-    }
-    if (headers.expires) {
-      reqHeaders["X-Bz-Info-b2-expires"] = headers.expires;
-    }
-    if (headers.cacheControl) {
-      reqHeaders["X-Bz-Info-b2-cache-control"] = headers.cacheControl;
-    }
-    if (headers.contentEncoding) {
-      reqHeaders["X-Bz-Info-b2-content-encoding"] = headers.contentEncoding;
-    }
-    applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);
-    applyRetentionHeaders(reqHeaders, headers.fileRetention);
-    applyLegalHoldHeader(reqHeaders, headers.legalHold);
-    const response = await this.transport.send({
-      url: uploadUrl,
-      method: "POST",
-      headers: reqHeaders,
-      body,
-      ...signal !== void 0 ? { signal } : {}
-    });
-    return normalizeFileVersionSha1(await response.json());
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The list of file names and optional continuation token.
-   */
-  async listFileNames(apiUrl, authToken, request) {
-    return normalizeFileVersionListSha1(
-      await this.postJson(apiUrl, authToken, "b2_list_file_names", request)
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The list of file versions and optional continuation token.
-   */
-  async listFileVersions(apiUrl, authToken, request) {
-    return normalizeFileVersionListSha1(
-      await this.postJson(
-        apiUrl,
-        authToken,
-        "b2_list_file_versions",
-        request
-      )
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The file version metadata.
-   */
-  async getFileInfo(apiUrl, authToken, request) {
-    return normalizeFileVersionSha1(
-      await this.postJson(apiUrl, authToken, "b2_get_file_info", request)
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The hidden file version metadata.
-   */
-  async hideFile(apiUrl, authToken, request) {
-    return normalizeFileVersionSha1(
-      await this.postJson(apiUrl, authToken, "b2_hide_file", request)
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The deleted file version identifier.
-   */
-  async deleteFileVersion(apiUrl, authToken, request) {
-    return this.postJson(
-      apiUrl,
-      authToken,
-      "b2_delete_file_version",
-      request
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The copied file version metadata.
-   */
-  async copyFile(apiUrl, authToken, request) {
-    return normalizeFileVersionSha1(
-      await this.postJson(apiUrl, authToken, "b2_copy_file", request)
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The copied part metadata.
-   */
-  async copyPart(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_copy_part", request);
-  }
-  // --- Large Files ---
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The started large file metadata with file ID.
-   */
-  async startLargeFile(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_start_large_file", request);
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-part-url | b2_get_upload_part_url}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The upload part URL and authorization token.
-   */
-  async getUploadPartUrl(apiUrl, authToken, request) {
-    return this.postJson(
-      apiUrl,
-      authToken,
-      "b2_get_upload_part_url",
-      request
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-upload-part | b2_upload_part}.
-   *
-   * Posts directly to the `uploadUrl` obtained from {@link getUploadPartUrl}
-   * rather than the API URL.
-   * @param uploadUrl - The upload endpoint URL.
-   * @param headers - The request headers including authorization and content metadata.
-   * @param body - The file data to upload.
-   * @param signal - An optional abort signal for cancellation.
-   *
-   * @returns The uploaded part metadata.
-   */
-  async uploadPart(uploadUrl, headers, body, signal) {
-    const reqHeaders = {
-      Authorization: headers.authorization,
-      "X-Bz-Part-Number": String(headers.partNumber),
-      "Content-Length": String(headers.contentLength),
-      "X-Bz-Content-Sha1": headers.contentSha1
-    };
-    applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);
-    const response = await this.transport.send({
-      url: uploadUrl,
-      method: "POST",
-      headers: reqHeaders,
-      body,
-      ...signal !== void 0 ? { signal } : {}
-    });
-    return response.json();
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The completed file version metadata.
-   */
-  async finishLargeFile(apiUrl, authToken, request) {
-    return normalizeFileVersionSha1(
-      await this.postJson(apiUrl, authToken, "b2_finish_large_file", request)
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The cancelled large file metadata.
-   */
-  async cancelLargeFile(apiUrl, authToken, request) {
-    return this.postJson(
-      apiUrl,
-      authToken,
-      "b2_cancel_large_file",
-      request
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The list of unfinished large files and optional continuation token.
-   */
-  async listUnfinishedLargeFiles(apiUrl, authToken, request) {
-    return this.postJson(
-      apiUrl,
-      authToken,
-      "b2_list_unfinished_large_files",
-      request
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The list of uploaded parts and optional continuation token.
-   */
-  async listParts(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_list_parts", request);
-  }
-  // --- Downloads ---
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}.
-   * @param downloadUrl - The B2 download base URL.
-   * @param authToken - The authorization token.
-   * @param fileId - The unique identifier of the file to download.
-   * @param options - Optional download parameters for range requests and cancellation.
-   *
-   * @returns The response headers, streaming body, and HTTP status code.
-   */
-  async downloadFileById(downloadUrl, authToken, fileId, options) {
-    const headers = buildDownloadRequestHeaders(authToken, options);
-    const url = appendDownloadOverrides(
-      `${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`,
-      options
-    );
-    const response = await this.transport.send({
-      url,
-      method: options?.method ?? "GET",
-      headers,
-      ...options?.signal !== void 0 ? { signal: options.signal } : {}
-    });
-    return { headers: response.headers, body: response.body, status: response.status };
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}.
-   * @param downloadUrl - The B2 download base URL.
-   * @param authToken - The authorization token.
-   * @param bucketName - The name of the bucket containing the file.
-   * @param fileName - The name of the file to download.
-   * @param options - Optional download parameters for range requests and cancellation.
-   *
-   * @returns The response headers, streaming body, and HTTP status code.
-   */
-  async downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) {
-    const headers = buildDownloadRequestHeaders(authToken, options);
-    const url = appendDownloadOverrides(
-      `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileName(fileName)}`,
-      options
-    );
-    const response = await this.transport.send({
-      url,
-      method: options?.method ?? "GET",
-      headers,
-      ...options?.signal !== void 0 ? { signal: options.signal } : {}
-    });
-    return { headers: response.headers, body: response.body, status: response.status };
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The current session authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The download authorization token for the specified file prefix.
-   */
-  async getDownloadAuthorization(apiUrl, authToken, request) {
-    return this.postJson(
-      apiUrl,
-      authToken,
-      "b2_get_download_authorization",
-      request
-    );
-  }
-  // --- Keys ---
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The newly created application key with secret.
-   */
-  async createKey(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_create_key", request);
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The list of application keys and optional continuation token.
-   */
-  async listKeys(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_list_keys", request);
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The deleted application key metadata.
-   */
-  async deleteKey(apiUrl, authToken, request) {
-    return this.postJson(apiUrl, authToken, "b2_delete_key", request);
-  }
-  // --- Retention / Legal Hold ---
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The updated file retention settings.
-   */
-  async updateFileRetention(apiUrl, authToken, request) {
-    return this.postJson(
-      apiUrl,
-      authToken,
-      "b2_update_file_retention",
-      request
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The updated file legal hold status.
-   */
-  async updateFileLegalHold(apiUrl, authToken, request) {
-    return this.postJson(
-      apiUrl,
-      authToken,
-      "b2_update_file_legal_hold",
-      request
-    );
-  }
-  // --- Notifications ---
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The configured event notification rules for the specified bucket.
-   */
-  async getBucketNotificationRules(apiUrl, authToken, request) {
-    return this.postJson(
-      apiUrl,
-      authToken,
-      "b2_get_bucket_notification_rules",
-      request
-    );
-  }
-  /**
-   * Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param request - The API request parameters.
-   *
-   * @returns The updated bucket notification rules.
-   */
-  async setBucketNotificationRules(apiUrl, authToken, request) {
-    return this.postJson(
-      apiUrl,
-      authToken,
-      "b2_set_bucket_notification_rules",
-      request
-    );
-  }
-  // --- Internal ---
-  /**
-   * Sends a JSON POST request to the specified B2 API endpoint.
-   * @param apiUrl - The B2 API base URL.
-   * @param authToken - The authorization token.
-   * @param endpoint - The B2 API endpoint name.
-   * @param body - The JSON request body.
-   *
-   * @returns The parsed JSON response.
-   */
-  async postJson(apiUrl, authToken, endpoint, body) {
-    const response = await this.transport.send({
-      url: `${apiUrl}/b2api/v3/${endpoint}`,
-      method: "POST",
-      headers: {
-        Authorization: authToken,
-        "Content-Type": "application/json"
-      },
-      body: JSON.stringify(body)
-    });
-    return response.json();
-  }
-}
+//# sourceMappingURL=transport.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/index.js
+
+
+
+
+
+//#region src/raw/index.ts
+/**
+* Low-level 1:1 bindings for every B2 native API endpoint.
+*
+* Each method on {@link RawClient} maps directly to a single `b2_*` HTTP call
+* with fully typed request and response objects. No retry logic, no URL pooling,
+* no automatic reauthorization. Use this when you need precise control over
+* individual API calls; for most use cases prefer the high-level `B2Client`.
+*
+* @packageDocumentation
+*/
+function normalizeRawRequestOptions(optionsOrSignal, retry) {
+	if (optionsOrSignal === void 0) return retry === void 0 ? void 0 : { retry };
+	if (isAbortSignal(optionsOrSignal)) return {
+		signal: optionsOrSignal,
+		...retry !== void 0 ? { retry } : {}
+	};
+	return retry === void 0 ? optionsOrSignal : {
+		...optionsOrSignal,
+		retry
+	};
+}
+function isAbortSignal(value) {
+	return typeof value === "object" && value !== null && "aborted" in value && typeof value.addEventListener === "function";
+}
+function normalizeCreateKeyRequest(request) {
+	const { bucketId, ...withoutDeprecatedBucketId } = request;
+	if (bucketId !== void 0 && withoutDeprecatedBucketId.bucketIds !== void 0) throw new TypeError("createKey accepts either bucketIds or deprecated bucketId, not both");
+	if (bucketId === void 0) return withoutDeprecatedBucketId;
+	return {
+		...withoutDeprecatedBucketId,
+		bucketIds: [bucketId]
+	};
+}
+function singleBucketId(bucketIds) {
+	return bucketIds?.length === 1 ? bucketIds[0] ?? null : null;
+}
+function normalizeKeyResponse(key) {
+	return {
+		...key,
+		bucketId: singleBucketId(key.bucketIds)
+	};
+}
+function normalizeAllowedBuckets(storageApi) {
+	const allowed = storageApi.allowed;
+	if (allowed?.buckets !== void 0) return allowed.buckets === null ? null : allowed.buckets.map((bucket) => ({ ...bucket }));
+	const bucketId = allowed?.bucketId ?? storageApi.bucketId ?? null;
+	if (bucketId === null) return null;
+	return [{
+		id: bucketId,
+		name: allowed?.bucketName ?? storageApi.bucketName ?? null
+	}];
+}
+function normalizeAuthorizeAccountResponse(response) {
+	const storageApi = response.apiInfo.storageApi;
+	const allowed = storageApi.allowed;
+	const buckets = normalizeAllowedBuckets(storageApi);
+	const singleBucket = buckets?.length === 1 ? buckets[0] : void 0;
+	const bucketId = singleBucket?.id ?? null;
+	const bucketName = singleBucket?.name ?? null;
+	const namePrefix = allowed?.namePrefix ?? storageApi.namePrefix ?? null;
+	const capabilities = allowed?.capabilities ?? storageApi.capabilities ?? [];
+	const { allowed: _wireAllowed, capabilities: _legacyCapabilities, ...storageApiBase } = storageApi;
+	return {
+		...response,
+		apiInfo: {
+			...response.apiInfo,
+			storageApi: {
+				...storageApiBase,
+				bucketId,
+				bucketName,
+				downloadUrl: storageApi.downloadUrl,
+				infoType: "storageApi",
+				namePrefix,
+				allowed: {
+					...allowed ?? {},
+					capabilities,
+					buckets,
+					bucketId,
+					bucketName,
+					namePrefix
+				}
+			}
+		}
+	};
+}
+function uploadResponseBodyError(err, signal) {
+	if (signal?.aborted === true) throw signal.reason ?? new DOMException("Aborted", "AbortError");
+	return new UploadResponseBodyError(err instanceof Error ? err.message : "Upload response body could not be read", { cause: err });
+}
+/**
+* Low-level client providing 1:1 bindings to all B2 native API endpoints.
+*
+* Each method maps directly to a single B2 API call. Most methods accept
+* `(apiUrl, authToken, request)` and return the JSON response. Upload and
+* download methods accept endpoint-specific parameters instead.
+*/
+var RawClient = class {
+	/** @internal */
+	transport;
+	/**
+	* Creates a new RawClient with the given transport.
+	* @param options - The constructor configuration.
+	*/
+	constructor(options) {
+		this.transport = options.transport;
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}.
+	* @param applicationKeyId - The application key ID for authentication.
+	* @param applicationKey - The application key secret.
+	* @param realmUrl - The B2 realm URL to authenticate against.
+	*
+	* @returns The authorization response with API URLs and credentials.
+	*/
+	async authorizeAccount(applicationKeyId, applicationKey, realmUrl = "https://api.backblazeb2.com") {
+		assertSecureRealmUrl(realmUrl);
+		return normalizeAuthorizeAccountResponse(await (await this.transport.send({
+			url: `${realmUrl}/b2api/v4/b2_authorize_account`,
+			method: "GET",
+			headers: { Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}` }
+		})).json());
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The created bucket metadata.
+	*/
+	async createBucket(apiUrl, authToken, request) {
+		return this.postJson(apiUrl, authToken, "b2_create_bucket", request);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The deleted bucket metadata.
+	*/
+	async deleteBucket(apiUrl, authToken, request) {
+		return this.postJson(apiUrl, authToken, "b2_delete_bucket", request);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The list of matching buckets.
+	*/
+	async listBuckets(apiUrl, authToken, request) {
+		return this.postJson(apiUrl, authToken, "b2_list_buckets", request);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The updated bucket metadata.
+	*/
+	async updateBucket(apiUrl, authToken, request) {
+		return this.postJson(apiUrl, authToken, "b2_update_bucket", request);
+	}
+	/**
+	* Implementation for both upload URL request-control signatures.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param optionsOrSignal - Options bag or legacy abort signal.
+	* @param retry - Optional legacy per-request retry override.
+	*
+	* @returns The upload URL and authorization token.
+	*/
+	async getUploadUrl(apiUrl, authToken, request, optionsOrSignal, retry) {
+		return this.postJson(apiUrl, authToken, "b2_get_upload_url", request, normalizeRawRequestOptions(optionsOrSignal, retry));
+	}
+	/**
+	* Implementation for both upload-file request-control signatures.
+	* @param uploadUrl - The upload endpoint URL.
+	* @param headers - The request headers including authorization and content metadata.
+	* @param body - The file data to upload.
+	* @param optionsOrSignal - Options bag or legacy abort signal.
+	* @param retry - Optional legacy per-request retry override.
+	*
+	* @returns The uploaded file version metadata.
+	*/
+	async uploadFile(uploadUrl, headers, body, optionsOrSignal, retry) {
+		const options = normalizeRawRequestOptions(optionsOrSignal, retry);
+		const reqHeaders = {
+			Authorization: headers.authorization,
+			"X-Bz-File-Name": encoding_encodeFileName(headers.fileName),
+			"Content-Type": headers.contentType,
+			"Content-Length": String(headers.contentLength),
+			"X-Bz-Content-Sha1": headers.contentSha1,
+			...buildFileInfoHeaders(headers.fileInfo)
+		};
+		if (headers.lastModifiedMillis !== void 0) reqHeaders["X-Bz-Info-src_last_modified_millis"] = String(headers.lastModifiedMillis);
+		if (headers.contentDisposition) reqHeaders["X-Bz-Info-b2-content-disposition"] = headers.contentDisposition;
+		if (headers.contentLanguage) reqHeaders["X-Bz-Info-b2-content-language"] = headers.contentLanguage;
+		if (headers.expires) reqHeaders["X-Bz-Info-b2-expires"] = headers.expires;
+		if (headers.cacheControl) reqHeaders["X-Bz-Info-b2-cache-control"] = headers.cacheControl;
+		if (headers.contentEncoding) reqHeaders["X-Bz-Info-b2-content-encoding"] = headers.contentEncoding;
+		applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);
+		applyRetentionHeaders(reqHeaders, headers.fileRetention);
+		applyLegalHoldHeader(reqHeaders, headers.legalHold);
+		const response = await this.transport.send({
+			url: uploadUrl,
+			method: "POST",
+			headers: reqHeaders,
+			body,
+			...options?.signal !== void 0 ? { signal: options.signal } : {},
+			...options?.retry !== void 0 ? { retry: options.retry } : {}
+		});
+		try {
+			return normalizeFileVersionSha1(await response.json());
+		} catch (err) {
+			throw uploadResponseBodyError(err, options?.signal);
+		}
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional request controls such as an abort signal.
+	*
+	* @returns The list of file names and optional continuation token.
+	*/
+	async listFileNames(apiUrl, authToken, request, options) {
+		return normalizeFileVersionListSha1(await this.postJson(apiUrl, authToken, "b2_list_file_names", request, options));
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional request controls such as an abort signal.
+	*
+	* @returns The list of file versions and optional continuation token.
+	*/
+	async listFileVersions(apiUrl, authToken, request, options) {
+		return normalizeFileVersionListSha1(await this.postJson(apiUrl, authToken, "b2_list_file_versions", request, options));
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The file version metadata.
+	*/
+	async getFileInfo(apiUrl, authToken, request) {
+		return normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, "b2_get_file_info", request));
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional request controls such as an abort signal.
+	*
+	* @returns The hidden file version metadata.
+	*/
+	async hideFile(apiUrl, authToken, request, options) {
+		return normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, "b2_hide_file", request, options));
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional request controls such as an abort signal.
+	*
+	* @returns The deleted file version identifier.
+	*/
+	async deleteFileVersion(apiUrl, authToken, request, options) {
+		return this.postJson(apiUrl, authToken, "b2_delete_file_version", request, options);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional request controls such as an abort signal.
+	*
+	* @returns The copied file version metadata.
+	*/
+	async copyFile(apiUrl, authToken, request, options) {
+		return normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, "b2_copy_file", request, options));
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional abort and retry controls.
+	*
+	* @returns The copied part metadata.
+	*/
+	async copyPart(apiUrl, authToken, request, options) {
+		return this.postJson(apiUrl, authToken, "b2_copy_part", request, options);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional abort and retry controls.
+	*
+	* @returns The started large file metadata with file ID.
+	*/
+	async startLargeFile(apiUrl, authToken, request, options) {
+		return this.postJson(apiUrl, authToken, "b2_start_large_file", request, options);
+	}
+	/**
+	* Implementation for both upload part URL request-control signatures.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param optionsOrSignal - Options bag or legacy abort signal.
+	* @param retry - Optional legacy per-request retry override.
+	*
+	* @returns The upload part URL and authorization token.
+	*/
+	async getUploadPartUrl(apiUrl, authToken, request, optionsOrSignal, retry) {
+		return this.postJson(apiUrl, authToken, "b2_get_upload_part_url", request, normalizeRawRequestOptions(optionsOrSignal, retry));
+	}
+	/**
+	* Implementation for both upload-part request-control signatures.
+	* @param uploadUrl - The upload endpoint URL.
+	* @param headers - The request headers including authorization and content metadata.
+	* @param body - The file data to upload.
+	* @param optionsOrSignal - Options bag or legacy abort signal.
+	* @param retry - Optional legacy per-request retry override.
+	*
+	* @returns The uploaded part metadata.
+	*/
+	async uploadPart(uploadUrl, headers, body, optionsOrSignal, retry) {
+		const options = normalizeRawRequestOptions(optionsOrSignal, retry);
+		const reqHeaders = {
+			Authorization: headers.authorization,
+			"X-Bz-Part-Number": String(headers.partNumber),
+			"Content-Length": String(headers.contentLength),
+			"X-Bz-Content-Sha1": headers.contentSha1
+		};
+		applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);
+		const response = await this.transport.send({
+			url: uploadUrl,
+			method: "POST",
+			headers: reqHeaders,
+			body,
+			...options?.signal !== void 0 ? { signal: options.signal } : {},
+			...options?.retry !== void 0 ? { retry: options.retry } : {}
+		});
+		try {
+			return await response.json();
+		} catch (err) {
+			throw uploadResponseBodyError(err, options?.signal);
+		}
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional abort and retry controls.
+	*
+	* @returns The completed file version metadata.
+	*/
+	async finishLargeFile(apiUrl, authToken, request, options) {
+		const response = await this.transport.send({
+			url: `${apiUrl}/b2api/v3/b2_finish_large_file`,
+			method: "POST",
+			headers: {
+				Authorization: authToken,
+				"Content-Type": "application/json"
+			},
+			body: JSON.stringify(request),
+			...options?.signal !== void 0 ? { signal: options.signal } : {},
+			...options?.retry !== void 0 ? { retry: options.retry } : {}
+		});
+		let fileVersion;
+		try {
+			fileVersion = await response.json();
+		} catch (err) {
+			throw new FinishLargeFileResponseBodyError(err instanceof Error ? err.message : "Finish large file response body could not be read", {
+				cause: err,
+				fileId: request.fileId
+			});
+		}
+		return normalizeFileVersionSha1(fileVersion);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional request controls such as cancellation and retry overrides.
+	*
+	* @returns The cancelled large file metadata.
+	*/
+	async cancelLargeFile(apiUrl, authToken, request, options) {
+		return this.postJson(apiUrl, authToken, "b2_cancel_large_file", request, options);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional request controls such as cancellation and retry.
+	*
+	* @returns The list of unfinished large files and optional continuation token.
+	*/
+	async listUnfinishedLargeFiles(apiUrl, authToken, request, options) {
+		return this.postJson(apiUrl, authToken, "b2_list_unfinished_large_files", request, options);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	* @param options - Optional request controls such as cancellation and retry.
+	*
+	* @returns The list of uploaded parts and optional continuation token.
+	*/
+	async listParts(apiUrl, authToken, request, options) {
+		return this.postJson(apiUrl, authToken, "b2_list_parts", request, options);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}.
+	* @param downloadUrl - The B2 download base URL.
+	* @param authToken - The authorization token.
+	* @param fileId - The unique identifier of the file to download.
+	* @param options - Optional download parameters for range requests and cancellation.
+	*
+	* @returns The response headers, streaming body, and HTTP status code.
+	*/
+	async downloadFileById(downloadUrl, authToken, fileId, options) {
+		const headers = buildDownloadRequestHeaders(authToken, options);
+		const url = appendDownloadOverrides(`${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`, options);
+		const response = await this.transport.send({
+			url,
+			method: options?.method ?? "GET",
+			headers,
+			...options?.signal !== void 0 ? { signal: options.signal } : {}
+		});
+		return {
+			headers: response.headers,
+			body: response.body,
+			status: response.status
+		};
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}.
+	* @param downloadUrl - The B2 download base URL.
+	* @param authToken - The authorization token.
+	* @param bucketName - The name of the bucket containing the file.
+	* @param fileName - The name of the file to download.
+	* @param options - Optional download parameters for range requests and cancellation.
+	*
+	* @returns The response headers, streaming body, and HTTP status code.
+	*/
+	async downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) {
+		const headers = buildDownloadRequestHeaders(authToken, options);
+		const url = appendDownloadOverrides(`${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encoding_encodeFileName(fileName)}`, options);
+		const response = await this.transport.send({
+			url,
+			method: options?.method ?? "GET",
+			headers,
+			...options?.signal !== void 0 ? { signal: options.signal } : {}
+		});
+		return {
+			headers: response.headers,
+			body: response.body,
+			status: response.status
+		};
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The current session authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The download authorization token for the specified file prefix.
+	*/
+	async getDownloadAuthorization(apiUrl, authToken, request) {
+		return this.postJson(apiUrl, authToken, "b2_get_download_authorization", request);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The newly created application key with secret.
+	*/
+	async createKey(apiUrl, authToken, request) {
+		return normalizeKeyResponse(await this.postJson(apiUrl, authToken, "b2_create_key", normalizeCreateKeyRequest(request), void 0, "v4"));
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The list of application keys and optional continuation token.
+	*/
+	async listKeys(apiUrl, authToken, request) {
+		const response = await this.postJson(apiUrl, authToken, "b2_list_keys", request, void 0, "v4");
+		return {
+			...response,
+			keys: response.keys.map((key) => normalizeKeyResponse(key))
+		};
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The deleted application key metadata.
+	*/
+	async deleteKey(apiUrl, authToken, request) {
+		return normalizeKeyResponse(await this.postJson(apiUrl, authToken, "b2_delete_key", request, void 0, "v4"));
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The updated file retention settings.
+	*/
+	async updateFileRetention(apiUrl, authToken, request) {
+		return this.postJson(apiUrl, authToken, "b2_update_file_retention", request);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The updated file legal hold status.
+	*/
+	async updateFileLegalHold(apiUrl, authToken, request) {
+		return this.postJson(apiUrl, authToken, "b2_update_file_legal_hold", request);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The configured event notification rules for the specified bucket.
+	*/
+	async getBucketNotificationRules(apiUrl, authToken, request) {
+		return this.postJson(apiUrl, authToken, "b2_get_bucket_notification_rules", request);
+	}
+	/**
+	* Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param request - The API request parameters.
+	*
+	* @returns The updated bucket notification rules.
+	*/
+	async setBucketNotificationRules(apiUrl, authToken, request) {
+		return this.postJson(apiUrl, authToken, "b2_set_bucket_notification_rules", request);
+	}
+	/**
+	* Sends a JSON POST request to the specified B2 API endpoint.
+	* @param apiUrl - The B2 API base URL.
+	* @param authToken - The authorization token.
+	* @param endpoint - The B2 API endpoint name.
+	* @param body - The JSON request body.
+	* @param options - Optional abort and per-request retry settings.
+	* @param apiVersion - B2 Native API version segment for this endpoint.
+	*
+	* @returns The parsed JSON response.
+	*/
+	async postJson(apiUrl, authToken, endpoint, body, options, apiVersion = "v3") {
+		return (await this.transport.send({
+			url: `${apiUrl}/b2api/${apiVersion}/${endpoint}`,
+			method: "POST",
+			headers: {
+				Authorization: authToken,
+				"Content-Type": "application/json"
+			},
+			body: JSON.stringify(body),
+			...options?.signal !== void 0 ? { signal: options.signal } : {},
+			...options?.retry !== void 0 ? { retry: options.retry } : {}
+		})).json();
+	}
+};
+/**
+* Applies server-side encryption headers to the request.
+* @param headers - The mutable headers object to populate.
+* @param encryption - The encryption settings, or undefined to skip.
+*/
 function applyEncryptionHeaders(headers, encryption) {
-  if (!encryption || encryption.mode === EncryptionMode.None) return;
-  if (encryption.mode === EncryptionMode.SseB2) {
-    headers["X-Bz-Server-Side-Encryption"] = EncryptionAlgorithm.Aes256;
-  } else if (encryption.mode === EncryptionMode.SseC) {
-    headers["X-Bz-Server-Side-Encryption-Customer-Algorithm"] = EncryptionAlgorithm.Aes256;
-    headers["X-Bz-Server-Side-Encryption-Customer-Key"] = encryption.customerKey;
-    headers["X-Bz-Server-Side-Encryption-Customer-Key-Md5"] = encryption.customerKeyMd5;
-  }
-}
-const DOWNLOAD_OVERRIDE_PARAMS = [
-  "b2ContentDisposition",
-  "b2ContentLanguage",
-  "b2ContentEncoding",
-  "b2ContentType",
-  "b2CacheControl",
-  "b2Expires"
+	if (!encryption || encryption.mode === EncryptionMode.None) return;
+	if (encryption.mode === EncryptionMode.SseB2) headers["X-Bz-Server-Side-Encryption"] = EncryptionAlgorithm.Aes256;
+	else if (encryption.mode === EncryptionMode.SseC) {
+		headers["X-Bz-Server-Side-Encryption-Customer-Algorithm"] = EncryptionAlgorithm.Aes256;
+		headers["X-Bz-Server-Side-Encryption-Customer-Key"] = encryption.customerKey;
+		headers["X-Bz-Server-Side-Encryption-Customer-Key-Md5"] = encryption.customerKeyMd5;
+	}
+}
+var DOWNLOAD_OVERRIDE_PARAMS = [
+	"b2ContentDisposition",
+	"b2ContentLanguage",
+	"b2ContentEncoding",
+	"b2ContentType",
+	"b2CacheControl",
+	"b2Expires"
 ];
+/**
+* Builds the HTTP request headers for a download: Authorization, optional
+* Range, and optional SSE-C decryption headers.
+*
+* @param authToken - The B2 session authorization token.
+* @param options - Caller-supplied download options.
+*
+* @returns The header map to send with the request.
+*/
 function buildDownloadRequestHeaders(authToken, options) {
-  const headers = { Authorization: authToken };
-  if (options?.range) headers["Range"] = options.range;
-  if (options?.serverSideEncryption) {
-    applyEncryptionHeaders(headers, {
-      mode: EncryptionMode.SseC,
-      ...options.serverSideEncryption
-    });
-  }
-  return headers;
-}
+	const headers = { Authorization: authToken };
+	if (options?.range) headers["Range"] = options.range;
+	if (options?.serverSideEncryption) applyEncryptionHeaders(headers, {
+		mode: EncryptionMode.SseC,
+		...options.serverSideEncryption
+	});
+	return headers;
+}
+/**
+* Appends the documented `b2Content*` response-header overrides to a download
+* URL as query-string parameters. B2 echoes the values into the response
+* headers so callers can control content type, disposition, and caching.
+*
+* @param url - The base download URL.
+* @param options - Caller-supplied download options.
+*
+* @returns The URL with any override parameters appended.
+*/
 function appendDownloadOverrides(url, options) {
-  if (!options) return url;
-  const params = [];
-  for (const key of DOWNLOAD_OVERRIDE_PARAMS) {
-    const value = options[key];
-    if (value !== void 0) {
-      params.push(`${key}=${encodeURIComponent(value)}`);
-    }
-  }
-  if (params.length === 0) return url;
-  const separator = url.includes("?") ? "&" : "?";
-  return `${url}${separator}${params.join("&")}`;
-}
+	if (!options) return url;
+	const params = [];
+	for (const key of DOWNLOAD_OVERRIDE_PARAMS) {
+		const value = options[key];
+		if (value !== void 0) params.push(`${key}=${encodeURIComponent(value)}`);
+	}
+	if (params.length === 0) return url;
+	return `${url}${url.includes("?") ? "&" : "?"}${params.join("&")}`;
+}
+/**
+* Applies file retention headers to the request.
+* @param headers - The mutable headers object to populate.
+* @param retention - The retention settings, or undefined to skip.
+*/
 function applyRetentionHeaders(headers, retention) {
-  if (!retention) return;
-  if (retention.mode) {
-    headers["X-Bz-File-Retention-Mode"] = retention.mode;
-  }
-  if (retention.retainUntilTimestamp) {
-    headers["X-Bz-File-Retention-Retain-Until-Timestamp"] = String(retention.retainUntilTimestamp);
-  }
+	if (!retention) return;
+	if (retention.mode) headers["X-Bz-File-Retention-Mode"] = retention.mode;
+	if (retention.retainUntilTimestamp) headers["X-Bz-File-Retention-Retain-Until-Timestamp"] = String(retention.retainUntilTimestamp);
 }
+/**
+* Applies the legal hold header to the request.
+* @param headers - The mutable headers object to populate.
+* @param legalHold - The legal hold value, or undefined to skip.
+*/
 function applyLegalHoldHeader(headers, legalHold) {
-  if (!legalHold) return;
-  headers["X-Bz-File-Legal-Hold"] = legalHold;
+	if (!legalHold) return;
+	headers["X-Bz-File-Legal-Hold"] = legalHold;
 }
-
-//# sourceMappingURL=index.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/client.js
-
-
+//#endregion
 
 
-
-
-
-
-
-class B2Client {
-  /** Low-level client for direct B2 API calls. */
-  raw;
-  /** Authorization state storage (tokens, URLs, capabilities). */
-  accountInfo;
-  /**
-   * SSRF allow-list applied by the default {@link FetchTransport}. `null` when
-   * a custom transport was supplied — in that case the SDK does not own the
-   * guard. Locked down by {@link B2Client.authorize}.
-   */
-  urlGuard;
-  applicationKeyId;
-  applicationKey;
-  realmUrl;
-  userAllowedSuffixes;
-  /**
-   * Creates a new B2Client. Call {@link authorize} before making API requests.
-   * @param options - Configuration including credentials, realm, and transport settings.
-   */
-  constructor(options) {
-    this.applicationKeyId = options.applicationKeyId;
-    this.applicationKey = options.applicationKey;
-    this.realmUrl = getRealmUrl(options.realm ?? "production");
-    this.accountInfo = options.accountInfo ?? new InMemoryAccountInfo();
-    this.userAllowedSuffixes = options.allowedHostSuffixes;
-    let baseTransport;
-    if (options.transport !== void 0) {
-      baseTransport = options.transport;
-      this.urlGuard = null;
-    } else {
-      const urlGuard = new UrlGuard();
-      baseTransport = new FetchTransport({
-        urlGuard,
-        ...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {}
-      });
-      this.urlGuard = urlGuard;
-    }
-    const retryTransport = new RetryTransport({
-      transport: baseTransport,
-      ...options.retry !== void 0 ? { retry: options.retry } : {},
-      onReauth: () => this.reauthorize()
-    });
-    this.raw = new RawClient({ transport: retryTransport });
-  }
-  /**
-   * Authenticates with B2 and stores the authorization state. Must be called before other methods.
-   *
-   * @returns The authorization response containing tokens, URLs, and capabilities.
-   */
-  async authorize() {
-    const auth = await this.raw.authorizeAccount(
-      this.applicationKeyId,
-      this.applicationKey,
-      this.realmUrl
-    );
-    this.accountInfo.setAuth(auth);
-    if (this.urlGuard !== null) {
-      const derived = deriveAllowedSuffixes(auth.apiInfo.storageApi);
-      const merged = this.userAllowedSuffixes !== void 0 ? Array.from(/* @__PURE__ */ new Set([...derived, ...this.userAllowedSuffixes])) : derived;
-      this.urlGuard.setAllowedSuffixes(merged);
-    }
-    return auth;
-  }
-  /**
-   * Refresh credentials after a 401. Returns the fresh auth token so
-   * {@link RetryTransport} can rewrite the in-flight request's
-   * Authorization header before retrying.
-   *
-   * @returns The fresh authorization token.
-   */
-  async reauthorize() {
-    this.accountInfo.clear();
-    const auth = await this.authorize();
-    return auth.authorizationToken;
-  }
-  /**
-   * Creates a new B2 bucket.
-   * @param options - Bucket configuration including name, type, and optional settings.
-   *
-   * @returns A {@link Bucket} handle for the newly created bucket.
-   */
-  async createBucket(options) {
-    const request = {
-      accountId: accountId(this.accountInfo.getAccountId()),
-      ...options
-    };
-    const info = await this.raw.createBucket(
-      this.accountInfo.getApiUrl(),
-      this.accountInfo.getAuthToken(),
-      request
-    );
-    return new Bucket(this, info);
-  }
-  /**
-   * Lists buckets in the account, optionally filtered by ID, name, or type.
-   * @param options - Optional filters for bucket ID, name, or type.
-   *
-   * @returns An array of {@link Bucket} handles.
-   */
-  async listBuckets(options) {
-    const resp = await this.raw.listBuckets(
-      this.accountInfo.getApiUrl(),
-      this.accountInfo.getAuthToken(),
-      {
-        accountId: accountId(this.accountInfo.getAccountId()),
-        ...options
-      }
-    );
-    return resp.buckets.map((info) => new Bucket(this, info));
-  }
-  /**
-   * Looks up a single bucket by name.
-   * @param bucketName - The name of the bucket to find.
-   *
-   * @returns The {@link Bucket} handle, or `null` if not found.
-   */
-  async getBucket(bucketName) {
-    const buckets = await this.listBuckets({ bucketName });
-    return buckets[0] ?? null;
-  }
-  /**
-   * Permanently deletes a bucket. The bucket must be empty.
-   * @param id - The unique identifier of the bucket to delete.
-   *
-   * @returns The deleted bucket metadata.
-   */
-  async deleteBucket(id) {
-    return this.raw.deleteBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {
-      accountId: accountId(this.accountInfo.getAccountId()),
-      bucketId: id
-    });
-  }
-  /**
-   * Creates a new application key with the specified capabilities.
-   * @param options - Key configuration including capabilities, name, and optional restrictions.
-   *
-   * @returns The full key including the secret (only returned at creation time).
-   */
-  async createKey(options) {
-    return this.raw.createKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {
-      accountId: accountId(this.accountInfo.getAccountId()),
-      ...options
-    });
-  }
-  /**
-   * Lists application keys in the account.
-   * @param options - Optional pagination settings.
-   *
-   * @returns A page of application keys with an optional continuation token.
-   */
-  async listKeys(options) {
-    return this.raw.listKeys(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {
-      accountId: accountId(this.accountInfo.getAccountId()),
-      ...options?.pageSize !== void 0 ? { maxKeyCount: options.pageSize } : {},
-      ...options?.startApplicationKeyId !== void 0 ? { startApplicationKeyId: options.startApplicationKeyId } : {}
-    });
-  }
-  /**
-   * Async iterator that yields every application key on the account,
-   * automatically handling pagination via `listKeys`.
-   *
-   * @param options - Pagination + abort options. `pageSize` is forwarded
-   *   to `maxKeyCount`; the default is 1000.
-   *
-   * @returns An async iterable of {@link ApplicationKey} entries.
-   *
-   * @example
-   * ```ts
-   * for await (const key of client.paginateKeys()) {
-   *   console.log(key.keyName, key.capabilities)
-   * }
-   * ```
-   */
-  paginateKeys(options) {
-    return paginateItems(
-      async (cursor) => {
-        const resp = await this.listKeys({
-          pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,
-          ...cursor !== void 0 ? { startApplicationKeyId: cursor } : {}
-        });
-        return { page: resp, nextCursor: resp.nextApplicationKeyId ?? void 0 };
-      },
-      (page) => page.keys,
-      options?.signal
-    );
-  }
-  /**
-   * Permanently deletes an application key.
-   * @param applicationKeyId - The unique identifier of the key to delete.
-   *
-   * @returns The deleted application key metadata.
-   */
-  async deleteKey(applicationKeyId) {
-    return this.raw.deleteKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {
-      applicationKeyId
-    });
-  }
-  /**
-   * Checks whether the authorized application key carries every capability in
-   * `needed`. Returns the missing capabilities so callers can fail fast with a
-   * clear error instead of a generic 401/403 from the server.
-   *
-   * @param needed - The capabilities required by the planned operation.
-   *
-   * @returns An object with `ok: true` when every needed capability is
-   *   present, otherwise `{ ok: false, missing: [...] }`.
-   *
-   * @throws If {@link authorize} has not been called yet.
-   */
-  hasCapabilities(needed) {
-    const auth = this.accountInfo.getAuth();
-    if (!auth) throw new Error("Not authorized. Call authorize() first.");
-    const available = new Set(auth.apiInfo.storageApi.allowed.capabilities);
-    const missing = needed.filter((cap) => !available.has(cap));
-    return { ok: missing.length === 0, missing };
-  }
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/client.js
+
+
+
+
+
+
+
+
+
+
+//#region src/client.ts
+/**
+* High-level B2 client providing ergonomic access to buckets, files, and keys.
+*
+* @example
+* ```ts
+* const client = new B2Client({
+*   applicationKeyId: process.env.B2_APPLICATION_KEY_ID,
+*   applicationKey: process.env.B2_APPLICATION_KEY,
+* })
+* await client.authorize()
+* const buckets = await client.listBuckets()
+* ```
+*/
+var B2Client = class {
+	/** Low-level client for direct B2 API calls. */
+	raw;
+	/** Authorization state storage (tokens, URLs, capabilities). */
+	accountInfo;
+	/**
+	* SSRF allow-list applied by the default {@link FetchTransport}. `null` when
+	* a custom transport was supplied — in that case the SDK does not own the
+	* guard. Locked down by {@link B2Client.authorize}.
+	*/
+	urlGuard;
+	applicationKeyId;
+	applicationKey;
+	realmUrl;
+	userAllowedSuffixes;
+	resolvedUploadRetryOptions;
+	/**
+	* Creates a new B2Client. Call {@link authorize} before making API requests.
+	* @param options - Configuration including credentials, realm, and transport settings.
+	*/
+	constructor(options) {
+		this.applicationKeyId = options.applicationKeyId;
+		this.applicationKey = options.applicationKey;
+		this.realmUrl = getRealmUrl(options.realm ?? "production");
+		this.accountInfo = options.accountInfo ?? new InMemoryAccountInfo();
+		bindAccountInfoAuthContext(this.accountInfo, this.realmUrl, this.applicationKeyId);
+		this.userAllowedSuffixes = options.allowedHostSuffixes;
+		this.resolvedUploadRetryOptions = {
+			...DEFAULT_RETRY_OPTIONS,
+			...options.retry
+		};
+		let baseTransport;
+		if (options.transport !== void 0) {
+			baseTransport = options.transport;
+			this.urlGuard = null;
+		} else {
+			const urlGuard = new UrlGuard();
+			baseTransport = new FetchTransport({
+				urlGuard,
+				...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {},
+				...options.followSameOriginRedirects !== void 0 ? { followSameOriginRedirects: options.followSameOriginRedirects } : {}
+			});
+			this.urlGuard = urlGuard;
+		}
+		const retryTransport = new RetryTransport({
+			transport: baseTransport,
+			retry: this.resolvedUploadRetryOptions,
+			onReauth: () => this.reauthorize()
+		});
+		const cachedAuth = this.accountInfo.getAuth();
+		if (cachedAuth !== null) this.lockUrlGuard(cachedAuth);
+		this.raw = new RawClient({ transport: retryTransport });
+	}
+	/**
+	* Authenticates with B2 and stores the authorization state. Must be called before other methods.
+	*
+	* @returns The authorization response containing tokens, URLs, and capabilities.
+	*/
+	async authorize() {
+		const auth = await this.raw.authorizeAccount(this.applicationKeyId, this.applicationKey, this.realmUrl);
+		this.accountInfo.setAuth(auth);
+		this.lockUrlGuard(auth);
+		return auth;
+	}
+	lockUrlGuard(auth) {
+		if (this.urlGuard !== null) {
+			const derived = deriveAllowedSuffixes(auth.apiInfo.storageApi);
+			const merged = this.userAllowedSuffixes !== void 0 ? this.userAllowedSuffixes.length === 0 ? [] : Array.from(/* @__PURE__ */ new Set([...derived, ...this.userAllowedSuffixes])) : derived;
+			this.urlGuard.setAllowedSuffixes(merged);
+		}
+	}
+	/**
+	* Refresh credentials after a 401. Returns the fresh auth token so
+	* {@link RetryTransport} can rewrite the in-flight request's
+	* Authorization header before retrying.
+	*
+	* @returns The fresh authorization token.
+	*/
+	async reauthorize() {
+		this.accountInfo.clear();
+		return (await this.authorize()).authorizationToken;
+	}
+	/**
+	* Creates a new B2 bucket.
+	* @param options - Bucket configuration including name, type, and optional settings.
+	*
+	* @returns A {@link Bucket} handle for the newly created bucket.
+	*/
+	async createBucket(options) {
+		const request = {
+			accountId: accountId(this.accountInfo.getAccountId()),
+			...options
+		};
+		const info = await this.raw.createBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), request);
+		return new Bucket(this, info, this.resolvedUploadRetryOptions);
+	}
+	/**
+	* Lists buckets in the account, optionally filtered by ID, name, or type.
+	* @param options - Optional filters for bucket ID, name, or type.
+	*
+	* @returns An array of {@link Bucket} handles.
+	*/
+	async listBuckets(options) {
+		return (await this.raw.listBuckets(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {
+			accountId: accountId(this.accountInfo.getAccountId()),
+			...options
+		})).buckets.map((info) => new Bucket(this, info, this.resolvedUploadRetryOptions));
+	}
+	/**
+	* Looks up a single bucket by name.
+	* @param bucketName - The name of the bucket to find.
+	*
+	* @returns The {@link Bucket} handle, or `null` if not found.
+	*/
+	async getBucket(bucketName) {
+		const filteredMatch = (await this.listBuckets({ bucketName }))[0];
+		if (filteredMatch !== void 0) return filteredMatch;
+		return (await this.listBuckets()).find((bucket) => bucket.name === bucketName) ?? null;
+	}
+	/**
+	* Permanently deletes a bucket. The bucket must be empty.
+	* @param id - The unique identifier of the bucket to delete.
+	*
+	* @returns The deleted bucket metadata.
+	*/
+	async deleteBucket(id) {
+		return this.raw.deleteBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {
+			accountId: accountId(this.accountInfo.getAccountId()),
+			bucketId: id
+		});
+	}
+	/**
+	* Creates a new application key with the specified capabilities.
+	* @param options - Key configuration including capabilities, name, and optional restrictions.
+	*
+	* @returns The full key including the secret (only returned at creation time).
+	*/
+	async createKey(options) {
+		return this.raw.createKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {
+			accountId: accountId(this.accountInfo.getAccountId()),
+			...options
+		});
+	}
+	/**
+	* Lists application keys in the account.
+	* @param options - Optional pagination settings.
+	*
+	* @returns A page of application keys with an optional continuation token.
+	*/
+	async listKeys(options) {
+		return this.raw.listKeys(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {
+			accountId: accountId(this.accountInfo.getAccountId()),
+			...options?.pageSize !== void 0 ? { maxKeyCount: options.pageSize } : {},
+			...options?.startApplicationKeyId !== void 0 ? { startApplicationKeyId: options.startApplicationKeyId } : {}
+		});
+	}
+	/**
+	* Async iterator that yields every application key on the account,
+	* automatically handling pagination via `listKeys`.
+	*
+	* @param options - Pagination + abort options. `pageSize` is forwarded
+	*   to `maxKeyCount`; the default is 1000.
+	*
+	* @returns An async iterable of {@link ApplicationKey} entries.
+	*
+	* @example
+	* ```ts
+	* for await (const key of client.paginateKeys()) {
+	*   console.log(key.keyName, key.capabilities)
+	* }
+	* ```
+	*/
+	paginateKeys(options) {
+		return paginateItems(async (cursor) => {
+			const resp = await this.listKeys({
+				pageSize: options?.pageSize ?? 1e3,
+				...cursor !== void 0 ? { startApplicationKeyId: cursor } : {}
+			});
+			return {
+				page: resp,
+				nextCursor: resp.nextApplicationKeyId ?? void 0
+			};
+		}, (page) => page.keys, options?.signal);
+	}
+	/**
+	* Permanently deletes an application key.
+	* @param applicationKeyId - The unique identifier of the key to delete.
+	*
+	* @returns The deleted application key metadata.
+	*/
+	async deleteKey(applicationKeyId) {
+		return this.raw.deleteKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { applicationKeyId });
+	}
+	/**
+	* Checks whether the authorized application key carries every capability in
+	* `needed`. Returns the missing capabilities so callers can fail fast with a
+	* clear error instead of a generic 401/403 from the server.
+	*
+	* @param needed - The capabilities required by the planned operation.
+	*
+	* @returns An object with `ok: true` when every needed capability is
+	*   present, otherwise `{ ok: false, missing: [...] }`.
+	*
+	* @throws If {@link authorize} has not been called yet.
+	*/
+	hasCapabilities(needed) {
+		const auth = this.accountInfo.getAuth();
+		if (!auth) throw new Error("Not authorized. Call authorize() first.");
+		const available = new Set(auth.apiInfo.storageApi.allowed.capabilities);
+		const missing = needed.filter((cap) => !available.has(cap));
+		return {
+			ok: missing.length === 0,
+			missing
+		};
+	}
+};
+function bindAccountInfoAuthContext(accountInfo, realmUrl, applicationKeyId) {
+	accountInfo.setApplicationKeyId?.(applicationKeyId);
+	accountInfo.setRealmUrl?.(realmUrl);
 }
+//#endregion
 
-//# sourceMappingURL=client.js.map
 
+//# sourceMappingURL=client.js.map
 ;// CONCATENATED MODULE: ./package.json
 const package_namespaceObject = {"rE":"1.1.0"};
 ;// CONCATENATED MODULE: ./src/version.ts
@@ -35538,6 +39179,12 @@ const VALID_RETENTION_MODE = ['compliance', 'governance', 'none'];
 const VALID_LEGAL_HOLD = ['on', 'off'];
 const APPLICATION_KEY_ID_ENV = 'B2_APPLICATION_KEY_ID';
 const APPLICATION_KEY_ENV = 'B2_APPLICATION_KEY';
+const FILE_INFO_KEY_PATTERN = /^[a-zA-Z0-9_.`~!#$%^&*'|+-]+$/;
+const FILE_INFO_KEY_MAX_BYTES = 50;
+const FILE_INFO_MAX_ENTRIES = 10;
+const FILE_INFO_TOTAL_MAX_BYTES = 7000;
+const FILE_INFO_TOTAL_MAX_BYTES_WITH_ENCRYPTION = 2048;
+const inputs_utf8Encoder = new TextEncoder();
 /**
  * Sensitive raw values that can appear in parser-scope errors before
  * {@link parseInputs} returns its structured output.
@@ -35591,12 +39238,28 @@ function parseInputs() {
     const presignTtlSeconds = parsePositiveInt('presign-ttl', getInput('presign-ttl') || '3600');
     const maxResults = parsePositiveInt('max-results', getInput('max-results') || '1000');
     const contentType = optional('content-type');
+    const contentDisposition = optional('content-disposition');
+    const cacheControl = optional('cache-control');
     const responseContentDisposition = optional('response-content-disposition');
     const responseContentType = optional('response-content-type');
     const responseCacheControl = optional('response-cache-control');
     const endpoint = optional('endpoint');
     const sse = optional('sse');
     const encryption = parseSse(sse);
+    const fileInfo = parseFileInfo(optional('file-info'));
+    addFileInfo(fileInfo, 'b2-cache-control', cacheControl, 'cache-control', { allowReserved: true });
+    addFileInfo(fileInfo, 'b2-content-disposition', contentDisposition, 'content-disposition', {
+        allowReserved: true,
+    });
+    addFileInfo(fileInfo, 'b2-content-language', optional('content-language'), 'content-language', {
+        allowReserved: true,
+    });
+    addFileInfo(fileInfo, 'b2-expires', optional('expires'), 'expires', { allowReserved: true });
+    validateFileInfo(fileInfo, uploadFileInfoTotalMaxBytes(encryption));
+    const preserveMtime = parseBool('preserve-mtime', getInput('preserve-mtime') || 'false');
+    if (preserveMtime && Object.hasOwn(fileInfo, 'src_last_modified_millis')) {
+        throw new Error(`Duplicate fileInfo key "src_last_modified_millis" from 'preserve-mtime' input`);
+    }
     const expectedSha1 = optional('expected-sha1');
     const retentionUntil = optional('retention-until');
     const compareMode = parseEnum('compare-mode', (getInput('compare-mode') || 'modtime').toLowerCase(), VALID_COMPARE);
@@ -35618,6 +39281,8 @@ function parseInputs() {
         partSize,
         resume,
         contentType,
+        fileInfo,
+        preserveMtime,
         responseContentDisposition,
         responseContentType,
         responseCacheControl,
@@ -35736,6 +39401,90 @@ function splitCsv(value) {
         .map((s) => s.trim())
         .filter((s) => s.length > 0);
 }
+/**
+ * Parse upload fileInfo metadata from newline-delimited or simple
+ * comma-separated `key=value` entries. Newline mode preserves commas inside
+ * values.
+ *
+ * @internal
+ */
+function parseFileInfo(value) {
+    if (value === undefined || value.trim() === '')
+        return {};
+    const pairs = /[\r\n]/.test(value) ? value.split(/\r?\n|\r/) : value.split(',');
+    const fileInfo = {};
+    for (const rawPair of pairs) {
+        const pair = rawPair.trim();
+        if (pair === '')
+            continue;
+        const equalsIndex = pair.indexOf('=');
+        if (equalsIndex <= 0) {
+            throw new Error(`Invalid 'file-info' entry "${pair}". Expected key=value.`);
+        }
+        const key = pair.slice(0, equalsIndex).trim();
+        const parsedValue = pair.slice(equalsIndex + 1).trim();
+        addFileInfo(fileInfo, key, parsedValue, 'file-info', { allowReserved: false });
+    }
+    return fileInfo;
+}
+function addFileInfo(fileInfo, key, value, inputName, options) {
+    if (value === undefined)
+        return;
+    const canonicalKey = key.toLowerCase();
+    if (!options.allowReserved && canonicalKey.startsWith('b2-')) {
+        throw new Error(`Reserved fileInfo key "${key}" from '${inputName}' input must use the dedicated upload inputs such as content-type, cache-control, content-disposition, content-language, or expires`);
+    }
+    if (Object.hasOwn(fileInfo, canonicalKey)) {
+        throw new Error(`Duplicate fileInfo key "${key}" from '${inputName}' input`);
+    }
+    fileInfo[canonicalKey] = value;
+}
+/**
+ * Return the upload fileInfo byte budget for the active encryption mode.
+ *
+ * @internal
+ */
+function uploadFileInfoTotalMaxBytes(encryption) {
+    return encryption === undefined
+        ? FILE_INFO_TOTAL_MAX_BYTES
+        : FILE_INFO_TOTAL_MAX_BYTES_WITH_ENCRYPTION;
+}
+/**
+ * Validate upload fileInfo metadata before forwarding it to the B2 SDK.
+ *
+ * @internal
+ */
+function validateFileInfo(fileInfo, totalMaxBytes = FILE_INFO_TOTAL_MAX_BYTES) {
+    const entries = Object.entries(fileInfo);
+    if (entries.length > FILE_INFO_MAX_ENTRIES) {
+        throw new Error(`Invalid fileInfo: ${entries.length} entries exceeds ${FILE_INFO_MAX_ENTRIES}`);
+    }
+    let totalBytes = 0;
+    const seenCanonicalKeys = new Set();
+    for (const [key, value] of entries) {
+        const canonicalKey = key.toLowerCase();
+        if (seenCanonicalKeys.has(canonicalKey)) {
+            throw new Error(`Duplicate fileInfo key "${key}" from upload metadata`);
+        }
+        seenCanonicalKeys.add(canonicalKey);
+        if (!FILE_INFO_KEY_PATTERN.test(key)) {
+            throw new Error(`Invalid fileInfo key "${key}" from 'file-info'. Keys must match ${FILE_INFO_KEY_PATTERN.source}`);
+        }
+        const keyBytes = inputs_utf8Encoder.encode(key).byteLength;
+        if (keyBytes > FILE_INFO_KEY_MAX_BYTES) {
+            throw new Error(`Invalid fileInfo key "${key}": ${keyBytes} bytes exceeds ${FILE_INFO_KEY_MAX_BYTES}`);
+        }
+        const valueBytes = inputs_utf8Encoder.encode(value).byteLength;
+        const remainingValueBytes = Math.max(0, totalMaxBytes - totalBytes - keyBytes);
+        if (valueBytes > remainingValueBytes) {
+            throw new Error(`Invalid fileInfo value for "${key}": ${valueBytes} bytes exceeds ${remainingValueBytes}`);
+        }
+        totalBytes += keyBytes + valueBytes;
+    }
+    if (totalBytes > totalMaxBytes) {
+        throw new Error(`Invalid fileInfo: total size ${totalBytes} bytes exceeds ${totalMaxBytes}`);
+    }
+}
 /**
  * Parse the documented boolean input spellings accepted by this action.
  *
@@ -35872,7 +39621,7 @@ async function* deleteAllVersions(bucket, options) {
         }
         catch (error) {
             options.signal?.throwIfAborted();
-            if (isAbortError(error))
+            if (delete_all_isAbortError(error))
                 throw error;
             yield {
                 type: 'error',
@@ -35884,7 +39633,7 @@ async function* deleteAllVersions(bucket, options) {
         options.signal?.throwIfAborted();
     }
 }
-function isAbortError(error) {
+function delete_all_isAbortError(error) {
     return error instanceof Error && error.name === 'AbortError';
 }
 
@@ -36334,7 +40083,7 @@ async function downloadOne(bucket, fileName, destination, sseDownload, downloadO
         await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName);
     }
     const tempPath = `${localPath}.b2-action-download-${(0,external_node_crypto_.randomUUID)()}.tmp`;
-    const writeStream = (0,external_node_fs_namespaceObject.createWriteStream)(tempPath, { flags: 'wx' });
+    const writeStream = (0,external_node_fs_.createWriteStream)(tempPath, { flags: 'wx' });
     try {
         await (0,external_node_stream_promises_namespaceObject.pipeline)(external_node_stream_.Readable.fromWeb(result.body), counter, writeStream);
         await replaceDownloadedFile(tempPath, localPath);
@@ -36718,28 +40467,359 @@ async function hasVisibleUploadAfter(bucket, prefix, startFileName) {
     return false;
 }
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/s3/index.js
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/s3/index.js
+
+
+
+
+
+
+//#region src/s3/index.ts
+var HTTP_HEADER_TOKEN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
+var HTTP_MEDIA_TYPE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+\/[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
+var DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN = 3600;
+var TRUSTED_NATIVE_DOWNLOAD_HOST_SUFFIXES = (/* unused pure expression or super */ null && ([
+	"backblazeb2.com",
+	"backblaze.com",
+	"backblaze.net",
+	"b2-staging.io"
+]));
+var BROWSER_EXECUTABLE_CONTENT_TYPES = /* @__PURE__ */ new Set([
+	"text/html",
+	"application/xhtml+xml",
+	"image/svg+xml",
+	"application/javascript",
+	"text/javascript",
+	"application/x-javascript",
+	"text/x-javascript",
+	"application/ecmascript",
+	"text/ecmascript",
+	"application/x-ecmascript",
+	"text/x-ecmascript",
+	"text/xml",
+	"application/xml"
+]);
+/**
+* Server-side opt-in token for unsafe S3 presign options.
+*
+* Use this token as the value for `allowBrowserExecutableContentType`,
+* `allowBrowserExecutableResponseContentType`, or
+* `allowInlineResponseContentDisposition` only when active content or inline
+* rendering from the storage origin is intentional and trusted.
+*/
+var trustedUnsafeS3PresignOptIn = Object.freeze({ __trustedUnsafeS3PresignOptIn: "trustedUnsafeS3PresignOptIn" });
+/**
+* Derives an S3-compatible client configuration from B2 authorization state.
+* Pass the result to `new S3Client(config)` from `@aws-sdk/client-s3`.
+*
+* Non-standard, custom, or proxied endpoints require an explicit `region`; set
+* it before deploying this SDK to those endpoints. The SDK no longer falls back
+* to `us-west-004` because that can mis-sign requests.
+*
+* @param config - B2 auth state, application key credentials, and optional region override.
+*
+* @returns Configuration ready for the AWS S3 SDK.
+*
+* @example
+* ```ts
+* const { B2_APPLICATION_KEY_ID, B2_APPLICATION_KEY } = process.env
+* if (!B2_APPLICATION_KEY_ID || !B2_APPLICATION_KEY) throw new Error('Missing B2 credentials')
+* const s3 = new S3Client(createS3ClientConfig({
+*   accountInfo: client.accountInfo,
+*   applicationKeyId: B2_APPLICATION_KEY_ID,
+*   applicationKey: B2_APPLICATION_KEY,
+* }))
+* ```
+*/
 function createS3ClientConfig(config) {
-  const s3Url = config.accountInfo.getS3ApiUrl();
-  const regionMatch = s3Url.match(/s3\.([^.]+)\.backblazeb2\.com/);
-  const region = config.region ?? regionMatch?.[1] ?? "us-west-004";
-  return {
-    endpoint: s3Url,
-    region,
-    credentials: {
-      accessKeyId: config.applicationKeyId,
-      secretAccessKey: config.applicationKey
-    },
-    forcePathStyle: true
-  };
-}
-function presignGetObjectUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds = 3600) {
-  const expires = Math.floor(Date.now() / 1e3) + validDurationInSeconds;
-  return `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeURIComponent(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;
-}
+	const s3Url = config.accountInfo.getS3ApiUrl();
+	const region = config.region ?? deriveRequiredS3Region(s3Url);
+	assertNonEmptyStringOption("applicationKeyId", config.applicationKeyId);
+	assertNonEmptyStringOption("applicationKey", config.applicationKey);
+	assertNonEmptyStringOption("region", region);
+	assertSigV4CredentialScopeComponent("applicationKeyId", config.applicationKeyId);
+	assertSigV4CredentialScopeComponent("region", region);
+	return {
+		endpoint: s3Url,
+		region,
+		credentials: {
+			accessKeyId: config.applicationKeyId,
+			secretAccessKey: config.applicationKey
+		},
+		forcePathStyle: true
+	};
+}
+/**
+* Extracts the B2 S3 region from a standard B2 S3 endpoint.
+*
+* Custom endpoints cannot be inferred safely. Pass `region` explicitly to
+* {@link createS3ClientConfig}, {@link presignS3GetObjectUrl}, or
+* {@link presignS3PutObjectUrl} when this returns `null`.
+*
+* @param endpoint - The S3 endpoint URL.
+*
+* @returns The derived region, or `null` when the endpoint is not a standard B2 S3 URL.
+*/
+function deriveS3RegionFromEndpoint(endpoint) {
+	let hostname;
+	try {
+		hostname = new URL(endpoint).hostname.toLowerCase();
+	} catch {
+		return null;
+	}
+	return /^s3\.([a-z0-9-]+)\.backblazeb2\.com$/.exec(hostname)?.[1] ?? null;
+}
+/**
+* Generates an AWS Signature Version 4 presigned GET URL for B2's S3-compatible API.
+*
+* This helper signs internally and does not pass the B2 application key to
+* runtime peer dependencies. Response override options are signed into the URL
+* and control headers served from the storage origin; do not populate them from
+* untrusted input without an allow-list. Presign success does not prove the URL
+* will be accepted later; keep URL-generating hosts clock-synchronized and
+* check clock skew when downstream use returns SigV4 403 errors.
+*
+* @param options - B2 auth state, S3 credentials, target object, and signing options.
+*
+* @returns The presigned URL string.
+*/
+async function presignS3GetObjectUrl(options) {
+	const query = [["x-id", "GetObject"]];
+	if (options.versionId !== void 0) {
+		assertSafeQueryValue("versionId", options.versionId);
+		query.push(["versionId", options.versionId]);
+	}
+	if (options.responseCacheControl !== void 0) {
+		assertSafeResponseOverride("responseCacheControl", options.responseCacheControl);
+		query.push(["response-cache-control", options.responseCacheControl]);
+	}
+	if (options.responseContentDisposition !== void 0) {
+		assertSafeResponseContentDisposition(options.responseContentDisposition, isTrustedUnsafeS3PresignOptIn(options.allowInlineResponseContentDisposition));
+		query.push(["response-content-disposition", options.responseContentDisposition]);
+	}
+	if (options.responseContentEncoding !== void 0) {
+		assertSafeResponseOverride("responseContentEncoding", options.responseContentEncoding);
+		query.push(["response-content-encoding", options.responseContentEncoding]);
+	}
+	if (options.responseContentLanguage !== void 0) {
+		assertSafeResponseOverride("responseContentLanguage", options.responseContentLanguage);
+		query.push(["response-content-language", options.responseContentLanguage]);
+	}
+	if (options.responseContentType !== void 0) {
+		if (isTrustedUnsafeS3PresignOptIn(options.allowBrowserExecutableResponseContentType)) assertSafeContentTypeValue("responseContentType", options.responseContentType, "response header value");
+		else assertSafeResponseContentType(options.responseContentType);
+		query.push(["response-content-type", options.responseContentType]);
+	}
+	if (options.responseExpires !== void 0) query.push(["response-expires", normalizeResponseExpires(options.responseExpires)]);
+	return await presignS3Request("GET", createSigV4PresignOptions(options), query, []);
+}
+/**
+* Returns a B2-native download-authorization URL, not an S3 presigned URL.
+*
+* This deprecated helper preserves the legacy positional output contract where
+* the whole file name is encoded as one URL component, including `/` as `%2F`.
+* It keeps the legacy string-building contract for callers that relied on
+* custom/local download URLs or permissive inputs. Use
+* {@link createNativeDownloadAuthorizationUrl} for strict validation.
+*
+* @param downloadUrl - The B2 download URL from authorization.
+* @param bucketName - The bucket containing the file.
+* @param fileName - The file name (path) to download.
+* @param authorizationToken - A download authorization token from `b2_get_download_authorization`.
+* @param validDurationInSeconds - Compatibility-only value for the non-authoritative `expires` query.
+*
+* @returns The B2 native download-authorization URL string.
+*
+* @deprecated Use {@link createNativeDownloadAuthorizationUrl} for B2 native
+* download-token URLs, or {@link presignS3GetObjectUrl} for real S3-compatible
+* AWS Signature Version 4 presigned GET URLs.
+*/
+function presignGetObjectUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds) {
+	const expires = Math.floor(Date.now() / 1e3) + (validDurationInSeconds ?? DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN);
+	return `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeURIComponent(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;
+}
+/**
+* Generates an AWS Signature Version 4 presigned PUT URL for browser or
+* third-party uploads through B2's S3-compatible API.
+*
+* This helper signs internally and does not pass the B2 application key to
+* runtime peer dependencies. A presigned PUT URL is a replayable bearer
+* credential for writing one key until expiry. Retried PUTs can create
+* duplicate B2 file versions when a response is lost after B2 stored the object.
+* Use unique keys or reconcile uploaded file IDs/checksums, and configure
+* lifecycle/version cleanup where duplicate versions must be removed
+* automatically. If `contentType` and `contentLength` are omitted, the holder
+* can choose any content type, including browser-executable types, and any size
+* accepted by B2; bind both values before handing URLs to untrusted uploaders
+* to limit financial-DoS and content-type smuggling risk.
+*
+* @param options - B2 auth state, S3 credentials, target object, and signing options.
+*
+* @returns The presigned URL string.
+*/
+async function presignS3PutObjectUrl(options) {
+	const headers = [];
+	if (options.contentType !== void 0) {
+		if (isTrustedUnsafeS3PresignOptIn(options.allowBrowserExecutableContentType)) assertSafeContentTypeValue("contentType", options.contentType, "stored object Content-Type");
+		else assertSafePutContentType(options.contentType);
+		headers.push(["content-type", options.contentType]);
+	}
+	if (options.contentLength !== void 0) headers.push(["content-length", normalizeContentLength(options.contentLength)]);
+	headers.push(...normalizeMetadataHeaders(options.metadata));
+	return await presignS3Request("PUT", createSigV4PresignOptions(options), [["x-id", "PutObject"]], headers);
+}
+/**
+* Generates an AWS Signature Version 4 presigned PUT URL for B2's
+* S3-compatible API.
+*
+* @param options - B2 auth state, S3 credentials, target object, and signing options.
+*
+* @returns The presigned URL string.
+*
+* @deprecated Use {@link presignS3PutObjectUrl}; this alias is retained for
+* pre-release callers that adopted the shorter name.
+*/
+async function presignPutObjectUrl(options) {
+	return await presignS3PutObjectUrl(options);
+}
+/**
+* Constructs a B2-native download URL using a token from `b2_get_download_authorization`.
+* This is not an S3 presigned URL.
+*
+* The token lifetime is fixed when `b2_get_download_authorization` creates the
+* token. `validDurationInSeconds` is retained only for compatibility with the
+* legacy `presignGetObjectUrl` helper's decorative `expires` query parameter;
+* changing it here does not shorten or extend access.
+* Because the returned URL carries a bearer token, `downloadUrl` must be an
+* HTTPS Backblaze download origin without userinfo, path, query, or fragment.
+*
+* @param downloadUrl - The B2 download URL from authorization (e.g., `https://f004.backblazeb2.com`).
+* @param bucketName - The bucket containing the file.
+* @param fileName - The file name (path) to download.
+* @param authorizationToken - A download authorization token from `b2_get_download_authorization`.
+* @param validDurationInSeconds - Compatibility-only value for the non-authoritative `expires` query.
+*
+* @returns The B2 native download-authorization URL string, not an S3 presigned URL.
+*/
+function createNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds = DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN) {
+	return buildNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds, encodeFileName, assertNativeDownloadFileName);
+}
+function deriveRequiredS3Region(endpoint) {
+	const region = deriveS3RegionFromEndpoint(endpoint);
+	if (region !== null) return region;
+	throw new Error(`Unable to derive B2 S3 region from endpoint "${redactUrlForError(endpoint, { invalidUrlLabel: "" })}". Pass an explicit \`region\` option before deploying custom or proxied endpoints.`);
+}
+function createSigV4PresignOptions(options) {
+	const clientConfig = createS3ClientConfig(options);
+	return {
+		endpoint: clientConfig.endpoint,
+		region: clientConfig.region,
+		accessKeyId: clientConfig.credentials.accessKeyId,
+		secretAccessKey: clientConfig.credentials.secretAccessKey,
+		bucketName: options.bucketName,
+		fileName: options.fileName,
+		...options.expiresIn !== void 0 ? { expiresIn: options.expiresIn } : {}
+	};
+}
+function normalizeContentLength(contentLength) {
+	if (!Number.isSafeInteger(contentLength) || contentLength < 0) throw new RangeError(`contentLength must be a non-negative safe integer; received ${String(contentLength)}.`);
+	return String(contentLength);
+}
+function normalizeValidDurationInSeconds(validDurationInSeconds) {
+	if (!Number.isSafeInteger(validDurationInSeconds) || validDurationInSeconds < 0) throw new RangeError(`validDurationInSeconds must be a non-negative safe integer; received ${String(validDurationInSeconds)}.`);
+	return validDurationInSeconds;
+}
+function assertNonEmptyStringOption(name, value) {
+	if (typeof value !== "string" || value.trim().length === 0) throw new TypeError(`${name} must be a non-empty string.`);
+}
+function assertSigV4CredentialScopeComponent(name, value) {
+	if (/[\s/]/u.test(value) || hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain whitespace, control characters, or "/" because it is embedded in the SigV4 credential scope.`);
+}
+function isTrustedUnsafeS3PresignOptIn(value) {
+	return value === trustedUnsafeS3PresignOptIn;
+}
+function buildNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds, encodeFileNameForUrl, assertFileName) {
+	const baseUrl = parseNativeDownloadBaseUrl(downloadUrl);
+	assertSafeBucketName(bucketName);
+	assertFileName(fileName);
+	const expires = Math.floor(Date.now() / 1e3) + normalizeValidDurationInSeconds(validDurationInSeconds);
+	return `${baseUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileNameForUrl(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;
+}
+function parseNativeDownloadBaseUrl(downloadUrl) {
+	let base;
+	try {
+		base = new URL(downloadUrl);
+	} catch {
+		throw new TypeError(`Native download-authorization URLs require a valid https: downloadUrl; received "${redactUrlForError(downloadUrl, { invalidUrlLabel: "" })}".`);
+	}
+	if (base.protocol !== "https:") throw new TypeError(`Native download-authorization URLs require an https: downloadUrl; received "${redactUrlForError(base)}".`);
+	if (base.username !== "" || base.password !== "") throw new TypeError("Native download-authorization URLs must not include userinfo.");
+	if (base.search !== "" || base.hash !== "") throw new TypeError("Native download-authorization URLs must not include query or fragment.");
+	if (base.pathname !== "" && base.pathname !== "/") throw new TypeError("Native download-authorization URLs must not include a path.");
+	if (!isTrustedNativeDownloadHost(base.hostname)) throw new TypeError(`Native download-authorization URLs require a Backblaze download host; received "${redactUrlForError(base)}".`);
+	return base.origin;
+}
+function normalizeMetadataHeaders(metadata) {
+	const headers = [];
+	const seenKeys = /* @__PURE__ */ new Set();
+	for (const [key, value] of Object.entries(metadata ?? {})) {
+		if (!HTTP_HEADER_TOKEN.test(key)) throw new TypeError(`metadata key "${key}" must be a non-empty valid HTTP header token.`);
+		if (typeof value !== "string") throw new TypeError(`metadata value for "${key}" must be a string.`);
+		const lowerKey = key.toLowerCase();
+		if (seenKeys.has(lowerKey)) throw new TypeError(`metadata key "${key}" must not differ only by case.`);
+		seenKeys.add(lowerKey);
+		headers.push([`x-amz-meta-${lowerKey}`, value]);
+	}
+	return headers;
+}
+function normalizeResponseExpires(responseExpires) {
+	if (!Number.isFinite(responseExpires.getTime())) throw new RangeError("responseExpires must be a valid Date.");
+	return responseExpires.toUTCString();
+}
+function assertSafeResponseOverride(name, value) {
+	assertSafeHeaderValue(name, value, "response header value");
+}
+function assertSafeQueryValue(name, value) {
+	if (hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain control characters because it becomes a query parameter.`);
+}
+function assertSafeHeaderValue(name, value, target) {
+	if (hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain control characters because it becomes a ${target}.`);
+}
+function assertSafeResponseContentType(contentType) {
+	assertNonExecutableContentType("responseContentType", contentType, "response header value", "allow-list a safe content type before signing response overrides");
+}
+function assertSafePutContentType(contentType) {
+	assertNonExecutableContentType("contentType", contentType, "stored object Content-Type", "pass allowBrowserExecutableContentType only when active content is intentional");
+}
+function assertSafeResponseContentDisposition(contentDisposition, allowInline) {
+	assertSafeResponseOverride("responseContentDisposition", contentDisposition);
+	const disposition = contentDisposition.split(";", 1)[0]?.trim().toLowerCase();
+	if (!allowInline && disposition === "inline") throw new TypeError("responseContentDisposition must not force inline rendering; use an attachment disposition for response overrides.");
+}
+function mediaTypeFor(contentType) {
+	return contentType.split(";", 1)[0]?.trim().toLowerCase() ?? "";
+}
+function assertSafeContentTypeValue(name, contentType, target) {
+	assertSafeHeaderValue(name, contentType, target);
+	const mediaType = mediaTypeFor(contentType);
+	if (mediaType.length === 0) throw new TypeError(`${name} must include a non-empty media type.`);
+	if (!HTTP_MEDIA_TYPE.test(mediaType)) throw new TypeError(`${name} must include a valid media type.`);
+	return mediaType;
+}
+function assertNonExecutableContentType(name, contentType, target, guidance) {
+	const mediaType = assertSafeContentTypeValue(name, contentType, target);
+	if (isBrowserExecutableContentType(mediaType)) throw new TypeError(`${name} "${mediaType}" can execute in browsers; ${guidance}.`);
+}
+function isBrowserExecutableContentType(mediaType) {
+	return BROWSER_EXECUTABLE_CONTENT_TYPES.has(mediaType) || mediaType.endsWith("+xml");
+}
+function isTrustedNativeDownloadHost(hostname) {
+	return TRUSTED_NATIVE_DOWNLOAD_HOST_SUFFIXES.some((suffix) => hostMatchesAllowedSuffix(hostname, suffix));
+}
+//#endregion
 
-//# sourceMappingURL=index.js.map
 
+//# sourceMappingURL=index.js.map
 ;// CONCATENATED MODULE: ./src/commands/presign.ts
 
 
@@ -36989,780 +41069,4234 @@ async function retentionCommand(bucket, inputs) {
     }
 }
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/source.js
-
-class BlobSource {
-  /**
-   * Create a BlobSource wrapping the given Blob.
-   * @param blob - The Blob or File to use as the underlying content.
-   */
-  constructor(blob) {
-    this.blob = blob;
-    this.size = blob.size;
-  }
-  /** {@inheritDoc} */
-  size;
-  /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */
-  canSlice = true;
-  /**
-   * Return a new BlobSource covering the specified byte range.
-   * @param start - The zero-based byte offset to begin the slice.
-   * @param end - The exclusive byte offset where the slice ends.
-   *
-   * @returns A new ContentSource representing the requested sub-range.
-   */
-  slice(start, end) {
-    return new BlobSource(this.blob.slice(start, end));
-  }
-  /**
-   * Open the Blob content as a ReadableStream.
-   * @returns A ReadableStream of the Blob bytes.
-   */
-  stream() {
-    return this.blob.stream();
-  }
-  /**
-   * Read the entire Blob content into an ArrayBuffer.
-   * @returns A promise that resolves with the full content as an ArrayBuffer.
-   */
-  toArrayBuffer() {
-    return this.blob.arrayBuffer();
-  }
-}
-class BufferSource {
-  /**
-   * Create a BufferSource wrapping the given Uint8Array.
-   * @param buffer - The byte buffer to use as the underlying content.
-   */
-  constructor(buffer) {
-    this.buffer = buffer;
-    this.size = buffer.byteLength;
-  }
-  /** {@inheritDoc} */
-  size;
-  /** Random-access: the entire payload lives in memory. */
-  canSlice = true;
-  /**
-   * Return a new BufferSource covering the specified byte range.
-   * @param start - The zero-based byte offset to begin the slice.
-   * @param end - The exclusive byte offset where the slice ends.
-   *
-   * @returns A new ContentSource representing the requested sub-range.
-   */
-  slice(start, end) {
-    return new BufferSource(this.buffer.slice(start, end));
-  }
-  /**
-   * Open the buffer content as a ReadableStream.
-   * @returns A ReadableStream that emits the buffer bytes in a single chunk.
-   */
-  stream() {
-    const buffer = this.buffer;
-    return new ReadableStream({
-      start(controller) {
-        controller.enqueue(buffer);
-        controller.close();
-      }
-    });
-  }
-  /**
-   * Read the entire buffer content into an ArrayBuffer.
-   * @returns A promise that resolves with the full content as an ArrayBuffer.
-   */
-  toArrayBuffer() {
-    return Promise.resolve(
-      this.buffer.buffer.slice(
-        this.buffer.byteOffset,
-        this.buffer.byteOffset + this.buffer.byteLength
-      )
-    );
-  }
-}
-class StreamSource {
-  /**
-   * Create a StreamSource wrapping the given ReadableStream with a known byte size.
-   * @param readable - The ReadableStream to wrap as a content source.
-   * @param size - The total number of bytes the stream will produce.
-   */
-  constructor(readable, size) {
-    this.readable = readable;
-    this.size = size;
-  }
-  /** {@inheritDoc} */
-  size;
-  /**
-   * Forward-only: ReadableStreams cannot be repositioned, so multipart
-   * uploads must take the sequential path. See the interface comment on
-   * `canSlice` for what the engine does with this flag.
-   */
-  canSlice = false;
-  /** Whether the stream has already been read. */
-  consumed = false;
-  /**
-   * Always throws because streams cannot be sliced. Buffer the stream first.
-   *
-   * @throws If slicing is attempted on a stream-backed source.
-   */
-  slice() {
-    throw new Error("StreamSource does not support slicing. Buffer the stream first.");
-  }
-  /**
-   * Open the underlying ReadableStream. Can only be called once.
-   * @returns The underlying ReadableStream of bytes.
-   *
-   * @throws If the stream has already been consumed.
-   */
-  stream() {
-    if (this.consumed) throw new Error("StreamSource can only be consumed once.");
-    this.consumed = true;
-    return this.readable;
-  }
-  /**
-   * Read the entire stream into an ArrayBuffer.
-   * @returns A promise that resolves with the full content as an ArrayBuffer.
-   */
-  async toArrayBuffer() {
-    const bytes = await collectStream(this.stream());
-    return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
-  }
-}
-function toContentSource(input, size) {
-  if (input instanceof Uint8Array) {
-    return new BufferSource(input);
-  }
-  if (input instanceof Blob) {
-    return new BlobSource(input);
-  }
-  if (size === void 0) {
-    throw new Error("size is required when using a ReadableStream as input.");
-  }
-  return new StreamSource(input, size);
-}
-
-//# sourceMappingURL=source.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/file-source.js
+//#region src/streams/file-source.ts
+var FILE_STREAM_CHUNK_SIZE = 16 * 1024 * 1024;
+var FILE_SOURCE_INTERNAL = Symbol("FileSource.internal");
+/** @internal */
+var fileSourceTestHooks = {};
+function getNodeFsSync() {
+	const fs = globalThis.process?.getBuiltinModule?.("node:fs");
+	if (!isNodeFsSync(fs)) throw new Error("FileSource constructor requires Node.js 22.3+ synchronous filesystem APIs; use FileSource.fromPath() when synchronous filesystem access is unavailable.");
+	return fs;
+}
+function isNodeFsSync(value) {
+	if (typeof value !== "object" || value === null) return false;
+	return typeof value["lstatSync"] === "function";
+}
+async function fileOpenFlags() {
+	const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19));
+	return constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);
+}
+function normalizeSliceOffset(value, size) {
+	if (!Number.isFinite(value)) throw new RangeError("FileSource slice offsets must be finite.");
+	const integer = Math.trunc(value);
+	const offset = integer < 0 ? size + integer : integer;
+	return Math.min(Math.max(offset, 0), size);
+}
+function formatFilePath(path) {
+	return path instanceof URL ? path.href : path;
+}
+function identityFromStats(stats) {
+	return {
+		dev: stats.dev,
+		ino: stats.ino,
+		size: stats.size,
+		mtimeMs: stats.mtimeMs,
+		ctimeMs: stats.ctimeMs
+	};
+}
+function assertStableIdentity(path, stats) {
+	if (stats.dev === 0 && stats.ino === 0) throw new Error(`FileSource: ${formatFilePath(path)} is on a filesystem that does not expose stable file identity.`);
+}
+function assertRegularFile(path, stats) {
+	if (!stats.isFile()) throw new Error(`FileSource: ${formatFilePath(path)} is not a regular file.`);
+}
+function validatedIdentityFromStats(path, stats) {
+	assertRegularFile(path, stats);
+	if (shouldComparePosixFileIdentity()) assertStableIdentity(path, stats);
+	return identityFromStats(stats);
+}
+function assertSameIdentity(path, expected, actual, when) {
+	if (shouldComparePosixFileIdentity()) assertStableIdentity(path, actual);
+	if (shouldComparePosixFileIdentity() && (actual.dev !== expected.dev || actual.ino !== expected.ino)) throw new Error(`FileSource: ${formatFilePath(path)} changed ${when}.`);
+	if (actual.size !== expected.size || actual.mtimeMs !== expected.mtimeMs) throw new Error(`FileSource: ${formatFilePath(path)} was modified ${when}.`);
+	if (shouldComparePosixChangeTime() && actual.ctimeMs !== expected.ctimeMs) throw new Error(`FileSource: ${formatFilePath(path)} was modified ${when}.`);
+}
+function file_source_isWindows() {
+	if (fileSourceTestHooks.platform !== void 0) return fileSourceTestHooks.platform === "win32";
+	return globalThis.process?.platform === "win32";
+}
+function shouldComparePosixFileIdentity() {
+	return !file_source_isWindows();
+}
+function shouldComparePosixChangeTime() {
+	return !file_source_isWindows();
+}
+function throwIfAborted(signal) {
+	if (signal === void 0 || !signal.aborted) return;
+	throw signal.reason ?? new DOMException("Aborted", "AbortError");
+}
+function maxReadSize() {
+	return fileSourceTestHooks.maxReadSize ?? FILE_STREAM_CHUNK_SIZE;
+}
+/* v8 ignore start -- Requires a file to pass identity checks and still EOF mid-range. */
+function rangeEndedEarlyError(path, offset, size) {
+	const end = offset + size;
+	return /* @__PURE__ */ new Error(`FileSource: ${formatFilePath(path)} ended before byte range [${offset}, ${end}) was fully read.`);
+}
+/* v8 ignore stop */
+async function openValidatedFile(path, identity) {
+	const open = fileSourceTestHooks.openFile ?? (await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19))).open;
+	let file;
+	try {
+		file = await open(path, await fileOpenFlags());
+	} catch (err) {
+		const message = err instanceof Error ? err.message : String(err);
+		throw new Error(`FileSource: ${formatFilePath(path)} could not be opened: ${message}`);
+	}
+	try {
+		const stats = await file.stat();
+		assertRegularFile(path, stats);
+		assertSameIdentity(path, identity, stats, "before read");
+		return file;
+	} catch (err) {
+		/* v8 ignore next -- Cleanup failure is deliberately best-effort. */
+		await file.close().catch(() => {});
+		throw err;
+	}
+}
+async function lstatNodeFile(path) {
+	const { lstat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	return lstat(path);
+}
+async function readFileRange(path, identity, offset, size, signal) {
+	throwIfAborted(signal);
+	if (size === 0) {
+		await verifyFileIdentityForEmptyRead(path, identity, signal);
+		return /* @__PURE__ */ new Uint8Array(0);
+	}
+	throwIfAborted(signal);
+	const file = await openValidatedFile(path, identity);
+	const data = new Uint8Array(size);
+	let filled = 0;
+	try {
+		while (filled < data.byteLength) {
+			throwIfAborted(signal);
+			const length = Math.min(maxReadSize(), data.byteLength - filled);
+			const { bytesRead } = await file.read(data, filled, length, offset + filled);
+			if (bytesRead === 0) throw rangeEndedEarlyError(path, offset, size);
+			filled += bytesRead;
+			await fileSourceTestHooks.afterReadIteration?.(filled);
+		}
+		throwIfAborted(signal);
+		assertSameIdentity(path, identity, await file.stat(), "while being read");
+		return data;
+	} finally {
+		/* v8 ignore next -- Cleanup failure is deliberately best-effort. */
+		await file.close().catch(() => {});
+	}
+}
+async function verifyFileIdentityForEmptyRead(path, identity, signal) {
+	throwIfAborted(signal);
+	const file = await openValidatedFile(path, identity);
+	try {
+		throwIfAborted(signal);
+		return;
+	} finally {
+		/* v8 ignore next -- Cleanup failure is deliberately best-effort. */
+		await file.close().catch(() => {});
+	}
+}
+function sliceFileRange(path, identity, offset, size, start, end) {
+	const normalizedStart = normalizeSliceOffset(start, size);
+	const normalizedEnd = normalizeSliceOffset(end, size);
+	return new FileSliceSource(path, identity, offset + normalizedStart, Math.max(normalizedEnd - normalizedStart, 0));
+}
+function streamFileRange(path, identity, offset, size) {
+	let position = offset;
+	let remaining = size;
+	let verifiedEmpty = false;
+	const abortController = new AbortController();
+	return new ReadableStream({
+		async pull(controller) {
+			try {
+				if (remaining === 0) {
+					if (!verifiedEmpty) {
+						verifiedEmpty = true;
+						await verifyFileIdentityForEmptyRead(path, identity);
+					}
+					controller.close();
+					return;
+				}
+				const data = await readFileRange(path, identity, position, Math.min(FILE_STREAM_CHUNK_SIZE, remaining), abortController.signal);
+				position += data.byteLength;
+				remaining -= data.byteLength;
+				controller.enqueue(data);
+				if (remaining === 0) controller.close();
+			} catch (err) {
+				controller.error(err);
+			}
+		},
+		cancel(reason) {
+			abortController.abort(reason);
+		}
+	});
+}
+async function fileRangeToArrayBuffer(path, identity, offset, size, options = {}) {
+	return (await readFileRange(path, identity, offset, size, options.signal)).buffer;
+}
+var FileSliceSource = class {
+	path;
+	identity;
+	offset;
+	size;
+	canSlice = true;
+	constructor(path, identity, offset, size) {
+		this.path = path;
+		this.identity = identity;
+		this.offset = offset;
+		this.size = size;
+	}
+	slice(start, end) {
+		return sliceFileRange(this.path, this.identity, this.offset, this.size, start, end);
+	}
+	stream() {
+		return streamFileRange(this.path, this.identity, this.offset, this.size);
+	}
+	toArrayBuffer(options = {}) {
+		return fileRangeToArrayBuffer(this.path, this.identity, this.offset, this.size, options);
+	}
+};
+/**
+* ContentSource backed by a local filesystem path.
+*
+* `FileSource` is Node-only but safe to import in browser builds: it touches
+* Node filesystem APIs only when constructed or read. The constructor performs
+* synchronous filesystem validation so `size` is immediately available; request
+* handlers, sync loops, and other latency-sensitive code should use
+* {@link FileSource.fromPath}. Both paths capture a best-effort regular file
+* identity and reject a symlink as the final path component; parent directory
+* symlinks are followed by the operating system, so callers that constrain
+* paths under a trusted root should validate those parents separately. Reads
+* reject if the path is replaced, if the filesystem cannot report stable
+* identity on POSIX platforms, or if size/mtime/ctime changes before the
+* configured byte range is read. On Windows, reads avoid unreliable dev/inode
+* identity comparisons and validate size/mtime instead.
+* Slices preserve the captured identity, so multipart uploads can read
+* disjoint ranges without materialising the whole file in memory or following
+* later leaf path swaps.
+*/
+var FileSource = class {
+	/** Random-access: file ranges are read by absolute byte offset. */
+	canSlice = true;
+	/** File size captured at construction time. */
+	size;
+	path;
+	identity;
+	/**
+	* Internal constructor path for async validation.
+	* @param path - Local filesystem path or file URL.
+	* @param internal - Module-private validated identity payload.
+	*
+	* @internal
+	*/
+	constructor(path, internal) {
+		const resolvedIdentity = internal?.key === FILE_SOURCE_INTERNAL ? internal.identity : validatedIdentityFromStats(path, getNodeFsSync().lstatSync(path));
+		this.path = path;
+		this.identity = resolvedIdentity;
+		this.size = resolvedIdentity.size;
+	}
+	/**
+	* Return a new file-backed source covering the specified byte range.
+	* @param start - The zero-based byte offset to begin the slice.
+	* @param end - The exclusive byte offset where the slice ends.
+	*
+	* @returns A new ContentSource representing the requested sub-range.
+	*/
+	slice(start, end) {
+		return sliceFileRange(this.path, this.identity, 0, this.size, start, end);
+	}
+	/**
+	* Open this file as a Web ReadableStream.
+	* @returns A ReadableStream that reads the file lazily.
+	*/
+	stream() {
+		return streamFileRange(this.path, this.identity, 0, this.size);
+	}
+	/**
+	* Read this file into an ArrayBuffer.
+	* @param options - Optional abort signal used while reading.
+	*
+	* @returns A promise resolving with the file bytes.
+	*/
+	toArrayBuffer(options = {}) {
+		return fileRangeToArrayBuffer(this.path, this.identity, 0, this.size, options);
+	}
+	/**
+	* Create a FileSource using asynchronous filesystem validation.
+	* @param path - Local filesystem path or file URL.
+	*
+	* @returns A FileSource bound to the validated file identity.
+	*
+	* @throws If the path does not reference a regular non-symlink file.
+	* @throws If a POSIX filesystem cannot report stable file identity.
+	*/
+	static async fromPath(path) {
+		return constructFileSourceFromIdentity(path, validatedIdentityFromStats(path, await lstatNodeFile(path)));
+	}
+};
+function constructFileSourceFromIdentity(path, identity) {
+	return Reflect.construct(FileSource, [path, {
+		key: FILE_SOURCE_INTERNAL,
+		identity
+	}]);
+}
+//#endregion
+
+
+//# sourceMappingURL=file-source.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/actions/index.js
+//#region src/sync/actions/index.ts
+/** Uploads a local file to B2. */
+var UploadAction = class {
+	relativePath;
+	absolutePath;
+	size;
+	doUpload;
+	type = "upload";
+	/**
+	* Creates a new UploadAction for the given relative path.
+	* @param relativePath - Path relative to the sync root.
+	* @param absolutePath - Absolute local filesystem path.
+	* @param size - File size in bytes.
+	* @param doUpload - Callback that performs the actual upload.
+	*/
+	constructor(relativePath, absolutePath, size, doUpload) {
+		this.relativePath = relativePath;
+		this.absolutePath = absolutePath;
+		this.size = size;
+		this.doUpload = doUpload;
+	}
+	/**
+	* Uploads the file (unless dryRun) and returns an 'upload-done' event.
+	* @param dryRun - Whether to simulate the action without making changes.
+	* @param signal - Optional abort signal for canceling the upload.
+	*
+	* @returns A promise resolving to the sync event produced by the action.
+	*/
+	async execute(dryRun, signal) {
+		if (!dryRun) await this.doUpload(this.absolutePath, this.relativePath, signal);
+		return {
+			type: "upload-done",
+			path: this.relativePath,
+			size: this.size
+		};
+	}
+};
+/** Downloads a B2 file to the local filesystem. */
+var DownloadAction = class {
+	relativePath;
+	size;
+	doDownload;
+	type = "download";
+	/**
+	* Creates a new DownloadAction for the given relative path.
+	* @param relativePath - Path relative to the sync root.
+	* @param size - File size in bytes.
+	* @param doDownload - Callback that performs the actual download.
+	*/
+	constructor(relativePath, size, doDownload) {
+		this.relativePath = relativePath;
+		this.size = size;
+		this.doDownload = doDownload;
+	}
+	/**
+	* Downloads the file (unless dryRun) and returns a 'download-done' event.
+	* @param dryRun - Whether to simulate the action without making changes.
+	* @param signal - Optional abort signal for canceling the download.
+	*
+	* @returns A promise resolving to the sync event produced by the action.
+	*/
+	async execute(dryRun, signal) {
+		if (!dryRun) await this.doDownload(this.relativePath, signal);
+		return {
+			type: "download-done",
+			path: this.relativePath,
+			size: this.size
+		};
+	}
+};
+/** Server-side copies a B2 file to a new key within the same or different bucket. */
+var CopyAction = class {
+	relativePath;
+	size;
+	doCopy;
+	type = "copy";
+	/**
+	* Creates a new CopyAction for the given relative path.
+	* @param relativePath - Path relative to the sync root.
+	* @param size - File size in bytes.
+	* @param doCopy - Callback that performs the server-side copy.
+	*/
+	constructor(relativePath, size, doCopy) {
+		this.relativePath = relativePath;
+		this.size = size;
+		this.doCopy = doCopy;
+	}
+	/**
+	* Copies the file (unless dryRun) and returns a 'copy-done' event.
+	* @param dryRun - Whether to simulate the action without making changes.
+	* @param signal - Optional abort signal for canceling the copy.
+	*
+	* @returns A promise resolving to the sync event produced by the action.
+	*/
+	async execute(dryRun, signal) {
+		if (!dryRun) await this.doCopy(this.relativePath, signal);
+		return {
+			type: "copy-done",
+			path: this.relativePath,
+			size: this.size
+		};
+	}
+};
+/** Hides a file in B2 by creating a hide marker (soft delete). */
+var HideAction = class {
+	relativePath;
+	doHide;
+	type = "hide";
+	size = 0;
+	/**
+	* Creates a new HideAction for the given relative path.
+	* @param relativePath - Path relative to the sync root.
+	* @param doHide - Callback that creates the hide marker.
+	*/
+	constructor(relativePath, doHide) {
+		this.relativePath = relativePath;
+		this.doHide = doHide;
+	}
+	/**
+	* Hides the file (unless dryRun) and returns a 'hide' event.
+	* @param dryRun - Whether to simulate the action without making changes.
+	* @param signal - Optional abort signal for canceling the hide request.
+	*
+	* @returns A promise resolving to the sync event produced by the action.
+	*/
+	async execute(dryRun, signal) {
+		if (!dryRun) await this.doHide(this.relativePath, signal);
+		return {
+			type: "hide",
+			path: this.relativePath,
+			size: 0
+		};
+	}
+};
+/** Permanently deletes a specific file version from B2. */
+var DeleteRemoteAction = class {
+	relativePath;
+	fileId;
+	doDelete;
+	type = "delete-remote";
+	size = 0;
+	/**
+	* Creates a new DeleteRemoteAction for the given relative path.
+	* @param relativePath - Path relative to the sync root.
+	* @param fileId - The B2 file version ID to delete.
+	* @param doDelete - Callback that performs the deletion.
+	*/
+	constructor(relativePath, fileId, doDelete) {
+		this.relativePath = relativePath;
+		this.fileId = fileId;
+		this.doDelete = doDelete;
+	}
+	/**
+	* Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event.
+	* @param dryRun - Whether to simulate the action without making changes.
+	* @param signal - Optional abort signal for canceling the delete request.
+	*
+	* @returns A promise resolving to the sync event produced by the action.
+	*/
+	async execute(dryRun, signal) {
+		if (!dryRun) await this.doDelete(this.fileId, this.relativePath, signal);
+		return {
+			type: "delete-remote",
+			path: this.relativePath,
+			size: 0
+		};
+	}
+};
+/** Deletes a file from the local filesystem. */
+var DeleteLocalAction = class {
+	relativePath;
+	absolutePath;
+	doDelete;
+	type = "delete-local";
+	size = 0;
+	/**
+	* Creates a new DeleteLocalAction for the given relative path.
+	* @param relativePath - Path relative to the sync root.
+	* @param absolutePath - Absolute local filesystem path.
+	* @param doDelete - Callback that performs the deletion.
+	*/
+	constructor(relativePath, absolutePath, doDelete) {
+		this.relativePath = relativePath;
+		this.absolutePath = absolutePath;
+		this.doDelete = doDelete;
+	}
+	/**
+	* Deletes the local file (unless dryRun) and returns a 'delete-local' event.
+	* @param dryRun - Whether to simulate the action without making changes.
+	* @param signal - Optional abort signal checked before deleting.
+	*
+	* @returns A promise resolving to the sync event produced by the action.
+	*/
+	async execute(dryRun, signal) {
+		if (!dryRun) await this.doDelete(this.absolutePath, signal);
+		return {
+			type: "delete-local",
+			path: this.relativePath,
+			size: 0
+		};
+	}
+};
+/** Represents a no-op action for files that do not need syncing. */
+var SkipAction = class {
+	relativePath;
+	reason;
+	type = "skip";
+	size = 0;
+	/**
+	* Creates a new SkipAction for the given relative path.
+	* @param relativePath - Path relative to the sync root.
+	* @param reason - Human-readable explanation for why the file was skipped.
+	*/
+	constructor(relativePath, reason) {
+		this.relativePath = relativePath;
+		this.reason = reason;
+	}
+	/**
+	* Returns a 'skip' event with the reason message. No I/O is performed.
+	* @param _dryRun - Whether to simulate the action (unused for no-op).
+	* @param _signal - Unused abort signal accepted for the shared action interface.
+	*
+	* @returns A promise resolving to the sync event produced by the action.
+	*/
+	async execute(_dryRun, _signal) {
+		return {
+			type: "skip",
+			path: this.relativePath,
+			size: 0,
+			message: this.reason
+		};
+	}
+};
+//#endregion
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/actions/index.js
-class UploadAction {
-  /**
-   * Creates a new UploadAction for the given relative path.
-   * @param relativePath - Path relative to the sync root.
-   * @param absolutePath - Absolute local filesystem path.
-   * @param size - File size in bytes.
-   * @param doUpload - Callback that performs the actual upload.
-   */
-  constructor(relativePath, absolutePath, size, doUpload) {
-    this.relativePath = relativePath;
-    this.absolutePath = absolutePath;
-    this.size = size;
-    this.doUpload = doUpload;
-  }
-  type = "upload";
-  /**
-   * Uploads the file (unless dryRun) and returns an 'upload-done' event.
-   * @param dryRun - Whether to simulate the action without making changes.
-   *
-   * @returns An async generator yielding sync progress events.
-   */
-  async execute(dryRun) {
-    if (!dryRun) {
-      await this.doUpload(this.absolutePath, this.relativePath);
-    }
-    return { type: "upload-done", path: this.relativePath, size: this.size };
-  }
-}
-class DownloadAction {
-  /**
-   * Creates a new DownloadAction for the given relative path.
-   * @param relativePath - Path relative to the sync root.
-   * @param size - File size in bytes.
-   * @param doDownload - Callback that performs the actual download.
-   */
-  constructor(relativePath, size, doDownload) {
-    this.relativePath = relativePath;
-    this.size = size;
-    this.doDownload = doDownload;
-  }
-  type = "download";
-  /**
-   * Downloads the file (unless dryRun) and returns a 'download-done' event.
-   * @param dryRun - Whether to simulate the action without making changes.
-   *
-   * @returns An async generator yielding sync progress events.
-   */
-  async execute(dryRun) {
-    if (!dryRun) {
-      await this.doDownload(this.relativePath);
-    }
-    return { type: "download-done", path: this.relativePath, size: this.size };
-  }
-}
-class CopyAction {
-  /**
-   * Creates a new CopyAction for the given relative path.
-   * @param relativePath - Path relative to the sync root.
-   * @param size - File size in bytes.
-   * @param doCopy - Callback that performs the server-side copy.
-   */
-  constructor(relativePath, size, doCopy) {
-    this.relativePath = relativePath;
-    this.size = size;
-    this.doCopy = doCopy;
-  }
-  type = "copy";
-  /**
-   * Copies the file (unless dryRun) and returns a 'copy-done' event.
-   * @param dryRun - Whether to simulate the action without making changes.
-   *
-   * @returns An async generator yielding sync progress events.
-   */
-  async execute(dryRun) {
-    if (!dryRun) {
-      await this.doCopy(this.relativePath);
-    }
-    return { type: "copy-done", path: this.relativePath, size: this.size };
-  }
-}
-class HideAction {
-  /**
-   * Creates a new HideAction for the given relative path.
-   * @param relativePath - Path relative to the sync root.
-   * @param doHide - Callback that creates the hide marker.
-   */
-  constructor(relativePath, doHide) {
-    this.relativePath = relativePath;
-    this.doHide = doHide;
-  }
-  type = "hide";
-  size = 0;
-  /**
-   * Hides the file (unless dryRun) and returns a 'hide' event.
-   * @param dryRun - Whether to simulate the action without making changes.
-   *
-   * @returns An async generator yielding sync progress events.
-   */
-  async execute(dryRun) {
-    if (!dryRun) {
-      await this.doHide(this.relativePath);
-    }
-    return { type: "hide", path: this.relativePath, size: 0 };
-  }
-}
-class DeleteRemoteAction {
-  /**
-   * Creates a new DeleteRemoteAction for the given relative path.
-   * @param relativePath - Path relative to the sync root.
-   * @param fileId - The B2 file version ID to delete.
-   * @param doDelete - Callback that performs the deletion.
-   */
-  constructor(relativePath, fileId, doDelete) {
-    this.relativePath = relativePath;
-    this.fileId = fileId;
-    this.doDelete = doDelete;
-  }
-  type = "delete-remote";
-  size = 0;
-  /**
-   * Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event.
-   * @param dryRun - Whether to simulate the action without making changes.
-   *
-   * @returns An async generator yielding sync progress events.
-   */
-  async execute(dryRun) {
-    if (!dryRun) {
-      await this.doDelete(this.fileId, this.relativePath);
-    }
-    return { type: "delete-remote", path: this.relativePath, size: 0 };
-  }
-}
-class DeleteLocalAction {
-  /**
-   * Creates a new DeleteLocalAction for the given relative path.
-   * @param relativePath - Path relative to the sync root.
-   * @param absolutePath - Absolute local filesystem path.
-   * @param doDelete - Callback that performs the deletion.
-   */
-  constructor(relativePath, absolutePath, doDelete) {
-    this.relativePath = relativePath;
-    this.absolutePath = absolutePath;
-    this.doDelete = doDelete;
-  }
-  type = "delete-local";
-  size = 0;
-  /**
-   * Deletes the local file (unless dryRun) and returns a 'delete-local' event.
-   * @param dryRun - Whether to simulate the action without making changes.
-   *
-   * @returns An async generator yielding sync progress events.
-   */
-  async execute(dryRun) {
-    if (!dryRun) {
-      await this.doDelete(this.absolutePath);
-    }
-    return { type: "delete-local", path: this.relativePath, size: 0 };
-  }
-}
-class SkipAction {
-  /**
-   * Creates a new SkipAction for the given relative path.
-   * @param relativePath - Path relative to the sync root.
-   * @param reason - Human-readable explanation for why the file was skipped.
-   */
-  constructor(relativePath, reason) {
-    this.relativePath = relativePath;
-    this.reason = reason;
-  }
-  type = "skip";
-  size = 0;
-  /**
-   * Returns a 'skip' event with the reason message. No I/O is performed.
-   * @param _dryRun - Whether to simulate the action (unused for no-op).
-   *
-   * @returns An async generator yielding sync progress events.
-   */
-  async execute(_dryRun) {
-    return { type: "skip", path: this.relativePath, size: 0, message: this.reason };
-  }
-}
 
 //# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/regexp-safety.js
+//#region src/sync/regexp-safety.ts
+var MAX_REGEXP_SOURCE_LENGTH = 512;
+var MAX_REGEXP_INPUT_LENGTH = 1024;
+var MAX_REGEXP_UNBOUNDED_QUANTIFIERS = 1;
+var MAX_REGEXP_BOUNDED_QUANTIFIER = 200;
+var MAX_REGEXP_BOUNDED_QUANTIFIERS = 16;
+var MAX_REGEXP_BOUNDED_QUANTIFIER_PRODUCT = 1e4;
+var safeRegExpCache = /* @__PURE__ */ new WeakMap();
+var validatedFilterCache = /* @__PURE__ */ new WeakSet();
+/**
+* Validates every RegExp filter in an include/exclude filter set.
+*
+* @param filters - Optional include and exclude filters to validate.
+*
+* @throws When a RegExp filter is too large or structurally unsafe.
+*/
+function validateSyncFilters(filters) {
+	if (filters === void 0) return;
+	if (validatedFilterCache.has(filters)) return;
+	validateSyncFilterList("include", filters.include);
+	validateSyncFilterList("exclude", filters.exclude);
+	validatedFilterCache.add(filters);
+}
+/**
+* Tests a path with a caller-provided RegExp without retaining `lastIndex` state.
+*
+* @param relativePath - Folder-relative path to test.
+* @param pattern - Caller-provided RegExp filter.
+*
+* @returns True when the RegExp matches the relative path.
+*
+* @throws When the RegExp filter is too large or structurally unsafe.
+*/
+function regexpMatchesSyncPath(relativePath, pattern) {
+	if (pathExceedsSafeRegExpInput(relativePath)) return false;
+	return regexpWithoutState(pattern).test(relativePath);
+}
+/**
+* Tests whether a relative path is too long to feed to caller-provided RegExp filters.
+*
+* @param relativePath - Folder-relative path to test.
+*
+* @returns True when RegExp filters should not be evaluated for the path.
+*/
+function pathExceedsSafeRegExpInput(relativePath) {
+	return relativePath.length > MAX_REGEXP_INPUT_LENGTH;
+}
+function validateSyncFilterList(kind, patterns) {
+	for (const pattern of patterns ?? []) if (typeof pattern !== "string") regexpWithoutState(pattern, kind);
+}
+function regexpWithoutState(pattern, kind = "pattern") {
+	const cached = safeRegExpCache.get(pattern);
+	if (cached !== void 0) return cached;
+	assertSafeRegExp(pattern, kind);
+	const compiled = new RegExp(pattern.source, pattern.flags.replace(/[gy]/g, ""));
+	safeRegExpCache.set(pattern, compiled);
+	return compiled;
+}
+function assertSafeRegExp(pattern, kind) {
+	const source = pattern.source;
+	if (source.length > MAX_REGEXP_SOURCE_LENGTH) throw new Error(`Sync filter RegExp is too long (${kind}: /${source}/)`);
+	if (!regexpSourceLooksSafe(source)) throw new Error(`Sync filter RegExp is too complex (${kind}: /${source}/)`);
+}
+/**
+* Best-effort linear RegExp guard for filters matched synchronously on attacker-controlled paths.
+*
+* The accepted subset intentionally rejects constructs that are hard to bound in the JavaScript
+* RegExp engine: backreferences, unterminated escapes/classes/groups, repeated unbounded
+* quantifiers, bounded quantifiers above {@link MAX_REGEXP_BOUNDED_QUANTIFIER}, too many bounded
+* quantifiers or too large a bounded-quantifier product, and any quantified group whose subtree
+* already contains a quantifier or alternation. Group state is propagated upward so nested groups
+* cannot hide a quantified or alternated subtree before an outer bounded or unbounded quantifier.
+*
+* @param source - RegExp source text to inspect.
+*
+* @returns True when the source passes the SDK's structural safety heuristic.
+*/
+function regexpSourceLooksSafe(source) {
+	let escaped = false;
+	let inClass = false;
+	let unboundedQuantifiers = 0;
+	let boundedQuantifiers = 0;
+	let boundedQuantifierProduct = 1;
+	const groups = [];
+	let lastToken = null;
+	for (let i = 0; i < source.length; i++) {
+		const char = source[i] ?? "";
+		if (escaped) {
+			if (!inClass && char === "k" && source[i + 1] === "<") return false;
+			if (!inClass && /[1-9]/.test(char)) return false;
+			escaped = false;
+			lastToken = { type: "atom" };
+			continue;
+		}
+		if (char === "\\") {
+			escaped = true;
+			continue;
+		}
+		if (inClass) {
+			if (char === "]") inClass = false;
+			continue;
+		}
+		if (char === "[") {
+			inClass = true;
+			lastToken = { type: "atom" };
+			continue;
+		}
+		if (char === "(") {
+			groups.push({
+				hasQuantifier: false,
+				hasAlternation: false
+			});
+			lastToken = null;
+			continue;
+		}
+		if (char === ")") {
+			const group = groups.pop();
+			if (!group) return false;
+			const parent = groups.at(-1);
+			if (parent) mergeGroupState(parent, group);
+			lastToken = {
+				type: "group",
+				...group
+			};
+			continue;
+		}
+		if (char === "|") {
+			const group = groups.at(-1);
+			if (group) group.hasAlternation = true;
+			lastToken = null;
+			continue;
+		}
+		const quantifier = lastToken !== null ? parseQuantifier(source, i) : null;
+		if (lastToken !== null && quantifier !== null) {
+			if (lastToken?.type === "group" && (lastToken.hasQuantifier || lastToken.hasAlternation)) return false;
+			if (quantifier.unbounded) {
+				unboundedQuantifiers++;
+				if (unboundedQuantifiers > MAX_REGEXP_UNBOUNDED_QUANTIFIERS) return false;
+			} else {
+				boundedQuantifiers++;
+				if (boundedQuantifiers > MAX_REGEXP_BOUNDED_QUANTIFIERS) return false;
+				if (quantifier.maxRepetitions > MAX_REGEXP_BOUNDED_QUANTIFIER) return false;
+				boundedQuantifierProduct *= Math.max(quantifier.maxRepetitions, 1);
+				if (boundedQuantifierProduct > MAX_REGEXP_BOUNDED_QUANTIFIER_PRODUCT) return false;
+			}
+			const group = groups.at(-1);
+			if (group) group.hasQuantifier = true;
+			i = quantifier.endIndex;
+			lastToken = null;
+			continue;
+		}
+		lastToken = { type: "atom" };
+	}
+	return !escaped && !inClass && groups.length === 0;
+}
+function mergeGroupState(target, source) {
+	target.hasQuantifier = target.hasQuantifier || source.hasQuantifier;
+	target.hasAlternation = target.hasAlternation || source.hasAlternation;
+}
+function parseQuantifier(source, index) {
+	const char = source[index];
+	if (char === "*" || char === "+") return {
+		endIndex: index,
+		maxRepetitions: Number.POSITIVE_INFINITY,
+		unbounded: true
+	};
+	if (char === "?") return {
+		endIndex: index,
+		maxRepetitions: 1,
+		unbounded: false
+	};
+	if (char !== "{") return null;
+	const end = source.indexOf("}", index + 1);
+	if (end === -1) return null;
+	const body = source.slice(index + 1, end);
+	const match = /^(\d+)(?:,(\d*))?$/.exec(body);
+	if (!match) return null;
+	const min = Number(match[1]);
+	const maxText = match[2];
+	const unbounded = body.includes(",") && maxText === "";
+	return {
+		endIndex: end,
+		maxRepetitions: unbounded ? Number.POSITIVE_INFINITY : Number(maxText ?? min),
+		unbounded
+	};
+}
+//#endregion
+
+
+//# sourceMappingURL=regexp-safety.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scan-events.js
+//#region src/sync/scan-events.ts
+/**
+* Emits a scanner skip event without letting observer failures abort the scan.
+*
+* @param filters - Scan options that may include an onSkip callback.
+* @param event - Skip event to report.
+*/
+function emitScannerSkip(filters, event) {
+	try {
+		filters?.onSkip?.(event);
+	} catch {}
+}
+/**
+* Builds a consistent skip event for paths that cannot be safely tested against RegExp filters.
+*
+* @param relativePath - Sync-relative path that exceeded the RegExp input limit.
+*
+* @returns A typed scanner skip event.
+*/
+function regexpInputTooLongSkip(relativePath) {
+	return {
+		type: "skip",
+		path: relativePath,
+		size: 0,
+		message: `Skipped sync path ${JSON.stringify(relativePath)}: path exceeds the RegExp filter input limit`,
+		reason: "path-too-long-for-regexp"
+	};
+}
+//#endregion
+
+
+//# sourceMappingURL=scan-events.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/filters.js
+
+
+//#region src/sync/filters.ts
+/**
+* Tests whether a relative sync path is included by the configured include/exclude filters.
+* Exclude filters win over include filters when both match the same path.
+*
+* @param relativePath - Folder-relative path using forward slashes.
+* @param filters - Optional include and exclude filters.
+*
+* @returns True when the path should remain in the sync scan.
+*/
+function pathPassesSyncFilters(relativePath, filters) {
+	validateSyncFilters(filters);
+	const path = normalizePath(relativePath);
+	if (normalizedPathSkippedByRegExpInputLimit(path, filters)) return false;
+	const include = filters?.include ?? [];
+	const exclude = filters?.exclude ?? [];
+	if (include.length > 0) {
+		if (!include.some((pattern) => matchesPattern(path, pattern))) return false;
+	}
+	return !exclude.some((pattern) => matchesPattern(path, pattern));
+}
+/**
+* Tests whether a directory may contain paths admitted by the configured filters.
+*
+* @param relativePath - Folder-relative directory path using forward slashes.
+* @param filters - Optional include and exclude filters.
+*
+* @returns True when the scanner should descend into the directory.
+*/
+function directoryMayContainSyncPaths(relativePath, filters) {
+	validateSyncFilters(filters);
+	const path = normalizePath(relativePath);
+	if (path === "") return true;
+	if ((filters?.exclude ?? []).some((pattern) => stringPatternExcludesAllDescendants(path, pattern))) return false;
+	const include = filters?.include ?? [];
+	return include.length === 0 || include.some((pattern) => patternMayMatchDescendant(path, pattern));
+}
+/**
+* Returns the safe literal prefix that B2 listing can use for include filters.
+* Exclude filters are not considered because they cannot narrow a B2 prefix.
+*
+* @param filters - Optional include and exclude filters.
+*
+* @returns A folder-relative literal prefix, or an empty string when no safe narrowing exists.
+*/
+function literalPrefixForSyncFilters(filters) {
+	validateSyncFilters(filters);
+	const include = filters?.include ?? [];
+	let commonPrefix;
+	for (const pattern of include) {
+		if (patternIsRegExp(pattern)) return "";
+		const glob = normalizePath(pattern);
+		if (!glob.includes("/")) return "";
+		const prefix = literalPrefixForGlob(glob);
+		if (prefix === "") return "";
+		commonPrefix = commonPrefix === void 0 ? prefix : commonLiteralPrefix(commonPrefix, prefix);
+	}
+	return commonPrefix ?? "";
+}
+/**
+* Filters an async iterable of sync paths while preserving the original item type.
+*
+* @typeParam T - Concrete sync path shape yielded by the source folder.
+*
+* @param paths - Async iterable of folder scan results.
+* @param filters - Optional include and exclude filters.
+*
+* @returns A filtered async generator of sync paths.
+*/
+async function* filterSyncPaths(paths, filters) {
+	for await (const path of paths) if (pathPassesSyncFilters(path.relativePath, filters)) yield path;
+	else if (pathSkippedByRegExpInputLimit(path.relativePath, filters)) emitScannerSkip(filters, regexpInputTooLongSkip(normalizePath(path.relativePath)));
+}
+/**
+* Tests whether a path is skipped because RegExp filters are configured and the normalized path
+* exceeds the SDK RegExp input guard.
+*
+* @param relativePath - Folder-relative path using forward slashes.
+* @param filters - Optional include and exclude filters.
+*
+* @returns True when any RegExp filter is present and the path is too long to evaluate.
+*/
+function pathSkippedByRegExpInputLimit(relativePath, filters) {
+	validateSyncFilters(filters);
+	return normalizedPathSkippedByRegExpInputLimit(normalizePath(relativePath), filters);
+}
+function normalizedPathSkippedByRegExpInputLimit(normalizedPath, filters) {
+	if (!pathExceedsSafeRegExpInput(normalizedPath) || !filtersContainRegExp(filters)) return false;
+	return true;
+}
+function matchesPattern(relativePath, pattern) {
+	if (patternIsRegExp(pattern)) return regexpMatchesSyncPath(relativePath, pattern);
+	const glob = normalizePath(pattern);
+	if (glob === "") return relativePath === "";
+	const segments = splitPath(relativePath);
+	if (!glob.includes("/")) return segments.some((segment) => matchSegmentGlob(segment, glob));
+	return matchPathGlob(segments, splitPath(glob));
+}
+function stringPatternExcludesAllDescendants(relativePath, pattern) {
+	if (patternIsRegExp(pattern)) return false;
+	const glob = normalizePath(pattern);
+	if (glob === "") return false;
+	if (!glob.includes("/")) return matchesPattern(relativePath, pattern);
+	const globSegments = splitPath(glob);
+	return globSegments.at(-1) === "**" && matchPathGlob(splitPath(relativePath), globSegments);
+}
+function filtersContainRegExp(filters) {
+	return filters?.include?.some(patternIsRegExp) === true || filters?.exclude?.some(patternIsRegExp) === true;
+}
+function patternMayMatchDescendant(relativePath, pattern) {
+	if (patternIsRegExp(pattern)) return true;
+	const glob = normalizePath(pattern);
+	if (glob === "" || !glob.includes("/")) return true;
+	const pathSegments = splitPath(relativePath);
+	const globSegments = splitPath(glob);
+	const length = Math.min(pathSegments.length, globSegments.length);
+	for (let i = 0; i < length; i++) {
+		const globSegment = globSegments[i];
+		if (globSegment === "**" || globSegment === void 0 || hasGlobWildcard(globSegment)) return true;
+		if (globSegment !== pathSegments[i]) return false;
+	}
+	return true;
+}
+function matchPathGlob(pathSegments, globSegments) {
+	let reachable = new Array(pathSegments.length + 1).fill(false);
+	reachable[0] = true;
+	for (const globSegment of globSegments) {
+		const next = new Array(pathSegments.length + 1).fill(false);
+		if (globSegment === "**") {
+			let canReach = false;
+			for (let i = 0; i <= pathSegments.length; i++) {
+				canReach = canReach || reachable[i] === true;
+				next[i] = canReach;
+			}
+		} else for (let i = 0; i < pathSegments.length; i++) if (reachable[i] === true && matchSegmentGlob(pathSegments[i] ?? "", globSegment)) next[i + 1] = true;
+		reachable = next;
+	}
+	return reachable[pathSegments.length] === true;
+}
+function matchSegmentGlob(segment, glob) {
+	let segmentIndex = 0;
+	let globIndex = 0;
+	let starIndex = -1;
+	let starMatchIndex = 0;
+	while (segmentIndex < segment.length) {
+		const globChar = glob[globIndex];
+		if (globChar === "?" || globChar === segment[segmentIndex]) {
+			globIndex++;
+			segmentIndex++;
+		} else if (globChar === "*") {
+			while (glob[globIndex + 1] === "*") globIndex++;
+			starIndex = globIndex;
+			starMatchIndex = segmentIndex;
+			globIndex++;
+		} else if (starIndex !== -1) {
+			globIndex = starIndex + 1;
+			starMatchIndex++;
+			segmentIndex = starMatchIndex;
+		} else return false;
+	}
+	while (glob[globIndex] === "*") globIndex++;
+	return globIndex === glob.length;
+}
+function literalPrefixForGlob(glob) {
+	const segments = splitPath(glob);
+	const literalSegments = [];
+	let firstWildcardIndex = segments.length;
+	for (const [index, segment] of segments.entries()) {
+		if (segment === "**" || hasGlobWildcard(segment)) {
+			firstWildcardIndex = index;
+			break;
+		}
+		literalSegments.push(segment);
+	}
+	if (literalSegments.length === 0) return "";
+	const prefix = literalSegments.join("/");
+	const wildcardTail = segments.slice(firstWildcardIndex);
+	if (wildcardTail.length > 0 && wildcardTail.every((segment) => segment === "**")) return prefix;
+	return literalSegments.length < segments.length ? `${prefix}/` : prefix;
+}
+function commonLiteralPrefix(a, b) {
+	let end = 0;
+	const max = Math.min(a.length, b.length);
+	while (end < max && a[end] === b[end]) end++;
+	return trimTrailingHighSurrogate(a.slice(0, end));
+}
+function trimTrailingHighSurrogate(value) {
+	const lastCodeUnit = value.charCodeAt(value.length - 1);
+	return lastCodeUnit >= 55296 && lastCodeUnit <= 56319 ? value.slice(0, -1) : value;
+}
+function hasGlobWildcard(glob) {
+	return glob.includes("*") || glob.includes("?");
+}
+function patternIsRegExp(pattern) {
+	return typeof pattern !== "string";
+}
+function splitPath(path) {
+	if (path === "") return [];
+	return path.split("/").filter((segment) => segment !== "");
+}
+function normalizePath(path) {
+	let normalized = path.split("\\").join("/");
+	while (normalized.startsWith("./")) normalized = normalized.slice(2);
+	while (normalized.startsWith("/")) normalized = normalized.slice(1);
+	while (normalized.endsWith("/") && normalized.length > 1) normalized = normalized.slice(0, -1);
+	return normalized;
+}
+//#endregion
+
+
+//# sourceMappingURL=filters.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/path-order.js
+//#region src/sync/path-order.ts
+/**
+* Compares sync-relative paths using the same code-unit order everywhere sorted scans are consumed.
+*
+* @param left - First sync-relative path.
+* @param right - Second sync-relative path.
+*
+* @returns Negative, zero, or positive using JavaScript code-unit order.
+*/
+function compareSyncRelativePaths(left, right) {
+	return compareCodeUnits(left, right);
+}
+/**
+* Compares strings by JavaScript code-unit order.
+*
+* @param left - First string.
+* @param right - Second string.
+*
+* @returns Negative, zero, or positive using code-unit order.
+*/
+function compareCodeUnits(left, right) {
+	if (left < right) return -1;
+	if (left > right) return 1;
+	return 0;
+}
+//#endregion
+
+
+//# sourceMappingURL=path-order.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scan-limit.js
+//#region src/sync/scan-limit.ts
+/** Default maximum number of entries a sync scanner may retain before failing. */
+var DEFAULT_MAX_SCAN_ENTRIES = 1e6;
+/**
+* Resolves and validates the effective scan entry limit.
+* @param options - Optional scan options carrying an override.
+*
+* @returns The configured or default scan entry limit.
+*
+* @throws When the configured limit is not a positive safe integer or Infinity.
+*/
+function scanEntryLimit(options) {
+	const limit = options?.maxScanEntries ?? 1e6;
+	if (limit === Number.POSITIVE_INFINITY) return limit;
+	if (!Number.isSafeInteger(limit) || limit < 1) throw new Error("maxScanEntries must be a positive safe integer or Infinity");
+	return limit;
+}
+/**
+* Throws when a scanner has retained more entries than the configured limit.
+* @param count - Number of retained entries.
+* @param limit - Maximum allowed retained entries.
+*
+* @throws When count is greater than limit.
+*/
+function assertScanEntryLimit(count, limit) {
+	if (count > limit) throw new Error(`Sync scan entry limit exceeded: maxScanEntries=${limit} was exceeded after ${count} scanned entries; raising maxScanEntries increases peak scanner memory`);
+}
+//#endregion
+
+
+//# sourceMappingURL=scan-limit.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/pairing.js
+
+
+
+
+//#region src/sync/pairing.ts
+/**
+* Merge-joins two sorted folder scans by relative path, yielding paired tuples.
+* Files present only in source yield `[source, null]`, only in dest yield `[null, dest]`,
+* and files in both yield `[source, dest]`.
+*
+* @param source - The source folder to scan.
+* @param dest - The destination folder to scan.
+* @param options - Optional scan controls and filters shared by both folders.
+* @param scanCallbacks - Optional internal source/destination skip callbacks.
+*/
+async function* zipFolders(source, dest, options = {}, scanCallbacks = {}) {
+	validateSyncFilters(options);
+	const sourceOptions = scanOptionsSnapshot(options, scanCallbacks.onSourceSkip);
+	const destOptions = scanOptionsSnapshot(options, scanCallbacks.onDestSkip);
+	const sourceIter = scanWithFilters(source, sourceOptions)[Symbol.asyncIterator]();
+	const destIter = scanWithFilters(dest, destOptions)[Symbol.asyncIterator]();
+	let sourceDone = false;
+	let destDone = false;
+	try {
+		let [sourceResult, destResult] = await Promise.all([sourceIter.next(), destIter.next()]);
+		sourceDone = sourceResult.done === true;
+		destDone = destResult.done === true;
+		while (!sourceResult.done || !destResult.done) {
+			const s = sourceResult.done ? null : sourceResult.value;
+			const d = destResult.done ? null : destResult.value;
+			if (s === null) {
+				yield [null, d];
+				destResult = await destIter.next();
+				destDone = destResult.done === true;
+			} else if (d === null) {
+				yield [s, null];
+				sourceResult = await sourceIter.next();
+				sourceDone = sourceResult.done === true;
+			} else {
+				const comparison = compareSyncRelativePaths(s.relativePath, d.relativePath);
+				if (comparison < 0) {
+					yield [s, null];
+					sourceResult = await sourceIter.next();
+					sourceDone = sourceResult.done === true;
+				} else if (comparison > 0) {
+					yield [null, d];
+					destResult = await destIter.next();
+					destDone = destResult.done === true;
+				} else {
+					yield [s, d];
+					sourceResult = await sourceIter.next();
+					destResult = await destIter.next();
+					sourceDone = sourceResult.done === true;
+					destDone = destResult.done === true;
+				}
+			}
+		}
+	} finally {
+		await closeScanIterator(sourceIter, sourceDone);
+		await closeScanIterator(destIter, destDone);
+	}
+}
+async function closeScanIterator(iterator, alreadyDone) {
+	if (alreadyDone || iterator.return === void 0) return;
+	try {
+		await iterator.return();
+	} catch {}
+}
+function scanWithFilters(folder, options) {
+	const scanned = filterSyncPaths(folder.scan(options.scanner), options.sdk);
+	if (folder.appliesScanSorting === true) return limitSyncPaths(scanned, options.sdk);
+	return sortSyncPaths(scanned, options.sdk);
+}
+async function* limitSyncPaths(paths, filters) {
+	const maxScanEntries = scanEntryLimit(filters);
+	let count = 0;
+	for await (const path of paths) {
+		count++;
+		assertScanEntryLimit(count, maxScanEntries);
+		yield path;
+	}
+}
+async function* sortSyncPaths(paths, filters) {
+	const maxScanEntries = scanEntryLimit(filters);
+	const collected = [];
+	for await (const path of paths) {
+		collected.push(path);
+		assertScanEntryLimit(collected.length, maxScanEntries);
+	}
+	collected.sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath));
+	yield* collected;
+}
+function scanOptionsSnapshot(options, onSkip) {
+	const onSkipSnapshot = options.onSkip === void 0 && onSkip === void 0 ? void 0 : (event) => {
+		options.onSkip?.(event);
+		onSkip?.(event);
+	};
+	return {
+		scanner: frozenScanOptions(options, frozenPatterns(options.include), frozenPatterns(options.exclude), onSkipSnapshot),
+		sdk: frozenScanOptions(options, frozenPatterns(options.include), frozenPatterns(options.exclude), onSkipSnapshot)
+	};
+}
+function frozenScanOptions(options, include, exclude, onSkip) {
+	return Object.freeze({
+		...include !== void 0 ? { include } : {},
+		...exclude !== void 0 ? { exclude } : {},
+		...options.signal !== void 0 ? { signal: options.signal } : {},
+		...options.onError !== void 0 ? { onError: options.onError } : {},
+		...onSkip !== void 0 ? { onSkip } : {},
+		...options.requireLocalSafePaths !== void 0 ? { requireLocalSafePaths: options.requireLocalSafePaths } : {},
+		...options.maxScanEntries !== void 0 ? { maxScanEntries: options.maxScanEntries } : {}
+	});
+}
+function frozenPatterns(patterns) {
+	return patterns === void 0 ? void 0 : Object.freeze([...patterns]);
+}
+//#endregion
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/pairing.js
-async function* zipFolders(source, dest) {
-  const sourceIter = source.scan()[Symbol.asyncIterator]();
-  const destIter = dest.scan()[Symbol.asyncIterator]();
-  let sourceResult = await sourceIter.next();
-  let destResult = await destIter.next();
-  while (!sourceResult.done || !destResult.done) {
-    const s = sourceResult.done ? null : sourceResult.value;
-    const d = destResult.done ? null : destResult.value;
-    if (s === null) {
-      yield [null, d];
-      destResult = await destIter.next();
-    } else if (d === null) {
-      yield [s, null];
-      sourceResult = await sourceIter.next();
-    } else if (s.relativePath < d.relativePath) {
-      yield [s, null];
-      sourceResult = await sourceIter.next();
-    } else if (d.relativePath < s.relativePath) {
-      yield [null, d];
-      destResult = await destIter.next();
-    } else {
-      yield [s, d];
-      sourceResult = await sourceIter.next();
-      destResult = await destIter.next();
-    }
-  }
-}
 
 //# sourceMappingURL=pairing.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/compare.js
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/error-reason.js
+
+//#region src/util/error-reason.ts
+/**
+* Formats an unknown error for public diagnostics without leaking filesystem paths.
+*
+* @param err - Unknown thrown value.
+*
+* @returns A stable, sanitized reason.
+*/
+function sanitizeErrorReason(err) {
+	const error = toError(err);
+	const code = error.code;
+	if (typeof code === "string" && code.length > 0) {
+		const reason = cleanReason(code);
+		if (reason.length > 0) return reason;
+	}
+	const message = cleanReason(error.message);
+	if (message.length > 0 && !/[\\/]/.test(message)) return message;
+	const name = cleanReason(error.name);
+	if (name.length > 0) return name;
+	return "Error";
+}
+function cleanReason(value) {
+	let cleaned = "";
+	let sawNonWhitespace = false;
+	for (const char of value) {
+		const code = char.charCodeAt(0);
+		if (code < 32 || code === 127) continue;
+		if (!sawNonWhitespace) {
+			if (char.trim().length === 0) continue;
+			sawNonWhitespace = true;
+		}
+		cleaned += char;
+		if (cleaned.length >= 200) break;
+	}
+	return cleaned.trimEnd();
+}
+//#endregion
+
+
+//# sourceMappingURL=error-reason.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/sha1-options.js
+//#region src/sync/sha1-options.ts
+/** Default idle/no-progress timeout for SHA-1 reads. */
+var DEFAULT_SHA1_IDLE_TIMEOUT_MILLIS = 3e4;
+/** Default absolute deadline for one untrusted B2 SHA-1 verification read. */
+var DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS = 3e5;
+/**
+* Normalizes a user-provided SHA-1 timeout value.
+*
+* @param value - Optional timeout in milliseconds.
+* @param defaultValue - Default timeout when the value is missing or invalid.
+*
+* @returns A positive integer timeout in milliseconds.
+*/
+function normalizeSha1TimeoutMillis(value, defaultValue = DEFAULT_SHA1_IDLE_TIMEOUT_MILLIS) {
+	if (value === void 0 || !Number.isFinite(value) || value < 1) return defaultValue;
+	return Math.floor(value);
+}
+//#endregion
+
+
+//# sourceMappingURL=sha1-options.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-file-identity.js
+//#region src/sync/local-file-identity.ts
+/**
+* Converts Node file stats into the sync scanner's persisted identity shape.
+* @param stats - Node file stats to convert.
+*
+* @returns The scanner identity stored with a local sync path.
+*
+* @internal
+*/
+function localFileIdentityFromStats(stats) {
+	return {
+		deviceId: stats.dev,
+		inode: stats.ino,
+		size: stats.size,
+		modTimeMillis: Math.floor(stats.mtimeMs),
+		changeTimeMillis: Math.floor(stats.ctimeMs)
+	};
+}
+/**
+* Verifies that current local stats still match a previously scanned regular file.
+* @param stats - Current filesystem stats for the candidate file.
+* @param path - Previously scanned local sync path.
+* @param operation - Operation name used in mutation diagnostics.
+* @param options - Platform and ctime comparison overrides for controlled filesystem moves.
+*
+* @throws If the current file is not the scanned regular file.
+*
+* @internal
+*/
+function assertSameScannedRegularFile(stats, path, operation = "upload", options = {}) {
+	const reason = `local file changed before ${operation}`;
+	if (!stats.isFile()) {
+		if (operation === "delete") throw Object.assign(/* @__PURE__ */ new Error(`${reason}: not a regular file`), { code: "EISDIR" });
+		throw new Error(`${reason}: not a regular file`);
+	}
+	if (stats.size !== path.size) throw new Error(`${reason}: size changed`);
+	const identity = path.fileIdentity;
+	if (identity === void 0) return;
+	if (!sameLocalIdentity(stats, identity, {
+		compareChangeTime: options.compareChangeTime,
+		platform: options.platform ?? currentPlatform()
+	})) throw new Error(reason);
+}
+function sameLocalIdentity(stats, identity, options) {
+	const compareChangeTime = options.compareChangeTime ?? local_file_identity_shouldComparePosixChangeTime(options.platform);
+	return (!local_file_identity_shouldComparePosixFileIdentity(options.platform) || stats.dev === identity.deviceId && stats.ino === identity.inode) && stats.size === identity.size && Math.floor(stats.mtimeMs) === identity.modTimeMillis && (!compareChangeTime || identity.changeTimeMillis === void 0 || Math.floor(stats.ctimeMs) === identity.changeTimeMillis);
+}
+function local_file_identity_shouldComparePosixFileIdentity(platform) {
+	return platform !== "win32";
+}
+function local_file_identity_shouldComparePosixChangeTime(platform) {
+	return platform !== "win32";
+}
+function currentPlatform() {
+	return globalThis.process?.platform;
+}
+//#endregion
+
+
+//# sourceMappingURL=local-file-identity.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-sha1.js
+
+
+
+
+
+//#region src/sync/local-sha1.ts
+/**
+* Formats a hash error for public sync events without leaking filesystem paths.
+*
+* @param error - Error thrown while hashing.
+*
+* @returns A sanitized reason suitable for event messages.
+*/
+function formatHashError(error) {
+	return sanitizeErrorReason(error);
+}
+/**
+* Returns whether an error represents an abort.
+*
+* @param err - Unknown thrown value.
+*
+* @returns True for AbortError values.
+*/
+function local_sha1_isAbortError(err) {
+	return toError(err).name === "AbortError";
+}
+/**
+* Reads a local file and computes its SHA-1 digest with non-regular-file rejection,
+* scanned-size bounds, abort support, and an idle/no-progress timeout.
+*
+* @param path - Local sync path to hash.
+* @param signal - Optional abort signal.
+* @param options - Optional idle timeout override.
+*
+* @returns The lowercase SHA-1 digest of the file bytes.
+*/
+async function readLocalSha1File(path, signal, options = {}) {
+	const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19));
+	const { lstat, open } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	const timeoutMillis = normalizeSha1TimeoutMillis(options.timeoutMillis);
+	const flags = constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);
+	const hash = new IncrementalSha1();
+	let stream;
+	let file;
+	let timeout;
+	function armTimeout(onTimeout) {
+		if (timeout !== void 0) clearTimeout(timeout);
+		timeout = setTimeout(onTimeout, timeoutMillis);
+	}
+	try {
+		signal?.throwIfAborted();
+		assertSameScannedRegularFile(await withTimeout(lstat(path.absolutePath), timeoutMillis, "sha1 file status"), path, "sha1 comparison");
+		file = await openWithTimeout(open(path.absolutePath, flags), timeoutMillis);
+		assertSameScannedRegularFile(await withTimeout(lstat(path.absolutePath), timeoutMillis, "sha1 file status"), path, "sha1 comparison");
+		assertSameScannedRegularFile(await withTimeout(file.stat(), timeoutMillis, "sha1 file status"), path, "sha1 comparison");
+		stream = file.createReadStream({
+			...path.size > 0 ? {
+				start: 0,
+				end: path.size - 1
+			} : {},
+			...signal !== void 0 ? { signal } : {}
+		});
+		let bytesRead = 0;
+		/* v8 ignore next 3 -- idle-timeout firing is timing-dependent in filesystem tests */
+		armTimeout(() => {
+			stream?.destroy(/* @__PURE__ */ new Error(`sha1 read stalled for ${timeoutMillis} ms`));
+		});
+		for await (const chunk of stream) {
+			bytesRead += chunk.byteLength;
+			await hash.update(chunk);
+			/* v8 ignore next 3 -- idle-timeout firing is timing-dependent in filesystem tests */
+			armTimeout(() => {
+				stream?.destroy(/* @__PURE__ */ new Error(`sha1 read stalled for ${timeoutMillis} ms`));
+			});
+		}
+		/* v8 ignore next -- defensive TOCTOU guard after the bounded stream completes */
+		if (bytesRead !== path.size) throw new Error("file changed during sha1 comparison");
+		return hash.digest();
+	} finally {
+		if (timeout !== void 0) clearTimeout(timeout);
+		stream?.destroy();
+		await file?.close().catch(() => {});
+	}
+}
+/* v8 ignore start -- defensive stale-filesystem stall handling is not portable to trigger */
+async function withTimeout(promise, timeoutMillis, operation) {
+	let timeout;
+	try {
+		return await Promise.race([promise, new Promise((_, reject) => {
+			timeout = setTimeout(() => {
+				reject(/* @__PURE__ */ new Error(`${operation} stalled for ${timeoutMillis} ms`));
+			}, timeoutMillis);
+		})]);
+	} finally {
+		if (timeout !== void 0) clearTimeout(timeout);
+	}
+}
+async function openWithTimeout(promise, timeoutMillis) {
+	let timedOut = false;
+	const tracked = promise.then((file) => {
+		if (timedOut) file.close().catch(() => {});
+		return file;
+	}, (err) => {
+		throw err;
+	});
+	try {
+		return await withTimeout(tracked, timeoutMillis, "sha1 file open");
+	} catch (err) {
+		timedOut = true;
+		throw err;
+	}
+}
+/* v8 ignore stop */
+//#endregion
+
+
+//# sourceMappingURL=local-sha1.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/sha1-metadata.js
+
+//#region src/sync/sha1-metadata.ts
+/** Prefix used to mark SHA-1 metadata that must not prove equality without byte verification. */
+var untrustedSha1Prefix = "unverified:";
+/**
+* Marks a verifiable SHA-1 digest as untrusted provider metadata.
+*
+* @param sha1 - Verifiable 40-character hexadecimal SHA-1 digest.
+*
+* @returns The untrusted SHA-1 sentinel value.
+*
+* @throws When the supplied value is not a verifiable SHA-1 digest.
+*/
+function untrustedSha1(sha1) {
+	const normalized = normalizeVerifiableSha1(sha1);
+	if (normalized === null) throw new Error("untrusted SHA-1 metadata must be verifiable");
+	return `${untrustedSha1Prefix}${normalized}`;
+}
+/**
+* Extracts the best comparable SHA-1 value from a B2 file version.
+*
+* B2's primary `contentSha1` is authoritative for single-part uploads when it is a verifiable
+* digest. Large/multipart B2 files report `contentSha1: null`; `fileInfo.large_file_sha1` is
+* caller-provided metadata, so it is returned as an untrusted hint that cannot prove equality
+* until the high-level synchronizer hashes the selected version's bytes.
+*
+* @param version - B2 file version metadata.
+*
+* @returns A lowercase comparable SHA-1, an untrusted sentinel, or null when unavailable.
+*/
+function selectB2ComparableSha1(version) {
+	const originalContentSha1 = version.contentSha1;
+	if (typeof originalContentSha1 === "string") {
+		if (isUntrustedSha1(originalContentSha1)) return originalContentSha1.toLowerCase();
+		return normalizeVerifiableSha1(originalContentSha1) ?? originalContentSha1.toLowerCase();
+	}
+	const largeFileSha1 = normalizeVerifiableSha1(version.fileInfo["large_file_sha1"]);
+	return largeFileSha1 === null ? null : untrustedSha1(largeFileSha1);
+}
+/**
+* Returns whether a SHA-1 value is marked as untrusted metadata.
+*
+* @param sha1 - Candidate SHA-1 metadata.
+*
+* @returns True when the value carries B2's unverified sentinel prefix.
+*/
+function isUntrustedSha1(sha1) {
+	return sha1?.toLowerCase().startsWith("unverified:") ?? false;
+}
+/**
+* Parses the public `SyncPath.contentSha1` value into an explicit trust/availability state.
+*
+* @param sha1 - The raw `contentSha1` field from a sync path.
+*
+* @returns A discriminated state so custom scanners do not need to decode sentinels directly.
+*/
+function parseSyncContentSha1(sha1) {
+	if (sha1 === void 0) return { kind: "pending" };
+	if (sha1 === null) return { kind: "unavailable" };
+	if (isUntrustedSha1(sha1)) return {
+		kind: "untrusted",
+		raw: sha1,
+		value: normalizeVerifiableSha1(sha1.slice(11))
+	};
+	const normalized = normalizeVerifiableSha1(sha1);
+	if (normalized === null) return {
+		kind: "untrusted",
+		raw: sha1,
+		value: null
+	};
+	return {
+		kind: "verified",
+		value: normalized
+	};
+}
+/**
+* Reads an explicit SHA-1 state when present, otherwise parses the compatibility field.
+*
+* @param path - Object carrying SHA-1 metadata.
+*
+* @returns The explicit or parsed SHA-1 state.
+*/
+function syncSha1StateOf(path) {
+	return path.contentSha1State ?? parseSyncContentSha1(path.contentSha1);
+}
+//#endregion
+
+
+//# sourceMappingURL=sha1-metadata.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/compare.js
+
+
+
+
+
+//#region src/sync/policies/compare.ts
+/**
+* Determines whether two files should be considered different based on the compare mode.
+* For `sha1`, callers that use the low-level policy helpers should first prepare the pair so
+* local hashes and comparable B2 hashes are populated.
+*
+* @param source - The source file metadata.
+* @param dest - The destination file metadata.
+* @param compareMode - The comparison strategy: 'modtime', 'size', 'sha1', or 'none'.
+* @param threshold - Tolerance for the comparison (bytes for size, milliseconds for modtime).
+*
+* @returns `true` if the files are considered different.
+*
+* @throws When `compareMode` is not one of the supported compare modes.
+*/
 function filesAreDifferent(source, dest, compareMode, threshold = 0) {
-  switch (compareMode) {
-    case "none":
-      return false;
-    case "size":
-      return Math.abs(source.size - dest.size) > threshold;
-    case "modtime":
-      return Math.abs(source.modTimeMillis - dest.modTimeMillis) > threshold;
-  }
-}
-
-//# sourceMappingURL=compare.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/index.js
+	switch (compareMode) {
+		case "none": return false;
+		case "size": return Math.abs(source.size - dest.size) > threshold;
+		case "sha1": return sha1ValuesAreDifferent(source, dest);
+		case "modtime": return Math.abs(source.modTimeMillis - dest.modTimeMillis) > threshold;
+		default: throw new Error(`Unsupported compare mode: ${String(compareMode)}`);
+	}
+}
+/**
+* Throws when a runtime compare mode value is unsupported.
+*
+* @param compareMode - User-supplied compare mode.
+*
+* @throws When `compareMode` is not one of the supported values.
+*/
+function assertSupportedCompareMode(compareMode) {
+	switch (compareMode) {
+		case "none":
+		case "size":
+		case "sha1":
+		case "modtime": return;
+		default: throw new Error(`Unsupported compare mode: ${String(compareMode)}`);
+	}
+}
+function sha1ValuesAreDifferent(source, dest) {
+	if (source.size !== dest.size) return true;
+	const sourceSha1 = comparableSha1(source);
+	const destSha1 = comparableSha1(dest);
+	if (sourceSha1.kind === "untrusted" || destSha1.kind === "untrusted") return true;
+	if (sourceSha1.kind === "unavailable" || destSha1.kind === "unavailable") return true;
+	return sourceSha1.value !== destSha1.value;
+}
+/**
+* Prepares a pair for the selected compare mode.
+*
+* For `sha1`, this fills missing B2 hashes from comparable metadata and, when an explicit local
+* reader is supplied, hashes the local side only when size cannot already prove a difference.
+* Reader failures are converted into per-file sync events instead of aborting the whole run.
+*
+* @param pair - Source/destination pair from {@link zipFolders}.
+* @param compareMode - The comparison strategy.
+* @param options - Optional hashing dependencies and cancellation signal.
+*
+* @returns The prepared pair plus any preparation events.
+*/
+async function preparePairForCompare(pair, compareMode, options = {}) {
+	assertSupportedCompareMode(compareMode);
+	if (compareMode !== "sha1") return readyComparePair(pair);
+	const [source, dest] = pair;
+	if (source === null || dest === null) return readyComparePair(pair);
+	if (source.size !== dest.size) return readyComparePair(pair);
+	const metadataPair = [withB2ContentSha1(source), withB2ContentSha1(dest)];
+	if (hasUnavailableB2Sha1(metadataPair)) return skipped(metadataPair, unavailableSha1Event(metadataPair));
+	if (options.readB2Sha1 === void 0 && hasUntrustedSha1(metadataPair) && !hasVerifiableUntrustedSha1(metadataPair)) return readyComparePair(metadataPair);
+	const [metadataSource, metadataDest] = metadataPair;
+	if (metadataSource === null || metadataDest === null) return readyComparePair(metadataPair);
+	const sourceResult = await prepareLocalPathSha1(metadataSource, options);
+	if (sourceResult.aborted) return aborted(metadataPair);
+	if (sourceResult.event) return skipped(metadataPair, sourceResult.event, sourceResult.error, sourceResult.bytesHashed);
+	const destResult = await prepareLocalPathSha1(metadataDest, options);
+	if (destResult.aborted) return aborted([sourceResult.path, destResult.path]);
+	if (destResult.event) return skipped([sourceResult.path, destResult.path], destResult.event, destResult.error, sourceResult.bytesHashed);
+	const preparedPair = [sourceResult.path, destResult.path];
+	const sourceState = comparableSha1(sourceResult.path);
+	const destState = comparableSha1(destResult.path);
+	const bytesHashed = sourceResult.bytesHashed + destResult.bytesHashed;
+	if (sourceState.kind === "unavailable" || destState.kind === "unavailable") return skipped(preparedPair, unavailableSha1Event(preparedPair), void 0, bytesHashed);
+	const shouldVerifyB2Bytes = untrustedSha1CouldSuppressTransfer(sourceState, destState);
+	const readB2Sha1 = options.readB2Sha1;
+	if (shouldVerifyB2Bytes && hasB2Path(preparedPair) && readB2Sha1 !== void 0) return verifyB2Sha1Bytes(preparedPair, {
+		...options,
+		readB2Sha1
+	}, bytesHashed);
+	return readyComparePair(preparedPair, bytesHashed);
+}
+/**
+* Prepares a list of pairs for the selected compare mode with bounded concurrency.
+*
+* @param pairs - Source/destination pairs from {@link zipFolders}.
+* @param compareMode - The comparison strategy.
+* @param options - Optional hashing dependencies, cancellation signal, and concurrency.
+*
+* @returns Prepared results in the same order as the input pairs.
+*/
+async function preparePairsForCompare(pairs, compareMode, options = {}) {
+	assertSupportedCompareMode(compareMode);
+	if (compareMode !== "sha1") return pairs.map((pair) => ({
+		originalPair: pair,
+		prepared: readyComparePair(pair)
+	}));
+	return mapConcurrent(pairs, normalizeConcurrency(options.concurrency), async (pair) => {
+		if (options.signal?.aborted) return {
+			originalPair: pair,
+			prepared: aborted(pair)
+		};
+		return {
+			originalPair: pair,
+			prepared: await preparePairForCompare(pair, compareMode, options)
+		};
+	});
+}
+async function prepareLocalPathSha1(path, options) {
+	if (!isLocalSyncPath(path)) return {
+		path,
+		bytesHashed: 0,
+		bytesVerified: 0,
+		aborted: false
+	};
+	if (options.signal?.aborted) return {
+		path,
+		bytesHashed: 0,
+		bytesVerified: 0,
+		aborted: true
+	};
+	try {
+		const state = syncSha1StateOf(path);
+		if (state.kind === "verified") return {
+			path: {
+				...path,
+				contentSha1: state.value
+			},
+			bytesHashed: 0,
+			bytesVerified: 0,
+			aborted: false
+		};
+		if (state.kind === "unavailable") return {
+			path: {
+				...path,
+				contentSha1: null
+			},
+			bytesHashed: 0,
+			bytesVerified: 0,
+			aborted: false
+		};
+		const readLocalSha1 = options.readLocalSha1;
+		if (readLocalSha1 === void 0) return {
+			path: {
+				...path,
+				contentSha1: path.contentSha1 ?? null
+			},
+			bytesHashed: 0,
+			bytesVerified: 0,
+			aborted: false
+		};
+		const contentSha1 = await readLocalSha1(path, options.signal, { ...options.sha1ReadTimeoutMillis !== void 0 ? { timeoutMillis: options.sha1ReadTimeoutMillis } : {} });
+		return {
+			path: {
+				...path,
+				contentSha1
+			},
+			bytesHashed: normalizeVerifiableSha1(contentSha1) === null ? 0 : path.size,
+			bytesVerified: 0,
+			aborted: false
+		};
+	} catch (err) {
+		if (options.signal?.aborted || local_sha1_isAbortError(err)) return {
+			path,
+			bytesHashed: 0,
+			bytesVerified: 0,
+			aborted: true
+		};
+		const error = toError(err);
+		return {
+			path,
+			bytesHashed: 0,
+			event: {
+				type: "error",
+				path: path.relativePath,
+				size: 0,
+				message: `failed to hash local file for sha1 comparison: ${formatHashError(error)}`
+			},
+			error,
+			bytesVerified: 0,
+			aborted: false
+		};
+	}
+}
+async function verifyB2Sha1Bytes(pair, options, bytesHashed) {
+	const [source, dest] = pair;
+	/* v8 ignore next -- callers only verify B2 bytes for paired compare results */
+	if (source === null || dest === null) return readyComparePair(pair, bytesHashed);
+	const sourceResult = await prepareUntrustedB2PathSha1(source, options);
+	const sourceBytesVerified = sourceResult.bytesVerified;
+	if (sourceResult.aborted) return aborted(pair);
+	if (sourceResult.event) return skipped([sourceResult.path, dest], sourceResult.event, sourceResult.error, bytesHashed, sourceBytesVerified);
+	const destResult = await prepareUntrustedB2PathSha1(dest, options);
+	const bytesVerified = sourceBytesVerified + destResult.bytesVerified;
+	/* v8 ignore next -- destination abort mirrors the covered source abort path */
+	if (destResult.aborted) return aborted([sourceResult.path, destResult.path]);
+	if (destResult.event) return skipped([sourceResult.path, destResult.path], destResult.event, destResult.error, bytesHashed, bytesVerified);
+	return readyComparePair([sourceResult.path, destResult.path], bytesHashed, bytesVerified);
+}
+async function prepareUntrustedB2PathSha1(path, options) {
+	if (!isB2SyncPath(path) || comparableSha1(path).kind !== "untrusted") return {
+		path,
+		bytesHashed: 0,
+		bytesVerified: 0,
+		aborted: false
+	};
+	return prepareB2PathSha1(path, options);
+}
+async function prepareB2PathSha1(path, options) {
+	/* v8 ignore next -- pre-aborted B2 reads are covered at pair level */
+	if (options.signal?.aborted) return {
+		path,
+		bytesHashed: 0,
+		bytesVerified: 0,
+		aborted: true
+	};
+	try {
+		const result = await options.readB2Sha1(path, options.signal);
+		const contentSha1 = typeof result === "object" && result !== null ? result.contentSha1 : result;
+		const bytesVerified = typeof result === "object" && result !== null ? Math.max(0, result.bytesRead) : 0;
+		const preparedPath = {
+			...path,
+			contentSha1,
+			contentSha1State: syncSha1StateOf({ contentSha1 })
+		};
+		if (contentSha1 === null) return {
+			path: preparedPath,
+			bytesHashed: 0,
+			bytesVerified,
+			event: unavailableSha1PathEvent(path),
+			aborted: false
+		};
+		return {
+			path: preparedPath,
+			bytesHashed: 0,
+			bytesVerified,
+			aborted: false
+		};
+	} catch (err) {
+		if (options.signal?.aborted || local_sha1_isAbortError(err)) return {
+			path,
+			bytesHashed: 0,
+			bytesVerified: 0,
+			aborted: true
+		};
+		const error = toError(err);
+		return {
+			path,
+			bytesHashed: 0,
+			bytesVerified: 0,
+			event: {
+				type: "skip",
+				path: path.relativePath,
+				size: 0,
+				message: `sha1 comparison skipped because B2 verification failed: ${formatHashError(error)}`
+			},
+			aborted: false
+		};
+	}
+}
+function comparableSha1(path) {
+	const state = syncSha1StateOf(path);
+	if (state.kind === "verified") return {
+		kind: "verified",
+		value: state.value
+	};
+	if (state.kind === "untrusted") return {
+		kind: "untrusted",
+		value: state.value
+	};
+	return { kind: "unavailable" };
+}
+function untrustedSha1CouldSuppressTransfer(source, dest) {
+	if (source.kind === "untrusted" && dest.kind === "verified") return source.value === dest.value;
+	if (dest.kind === "untrusted" && source.kind === "verified") return dest.value === source.value;
+	if (source.kind === "untrusted" && dest.kind === "untrusted") return source.value !== null && source.value === dest.value;
+	return false;
+}
+function withB2ContentSha1(path) {
+	if (!isB2SyncPath(path) || path.contentSha1 !== void 0 || path.contentSha1State !== void 0) return path;
+	const contentSha1 = selectB2ComparableSha1(path.selectedVersion);
+	return {
+		...path,
+		contentSha1,
+		contentSha1State: syncSha1StateOf({ contentSha1 })
+	};
+}
+function hasUnavailableB2Sha1(pair) {
+	const [source, dest] = pair;
+	return source !== null && isB2SyncPath(source) && comparableSha1(source).kind === "unavailable" || dest !== null && isB2SyncPath(dest) && comparableSha1(dest).kind === "unavailable";
+}
+function hasUntrustedSha1(pair) {
+	const [source, dest] = pair;
+	return source !== null && comparableSha1(source).kind === "untrusted" || dest !== null && comparableSha1(dest).kind === "untrusted";
+}
+function hasVerifiableUntrustedSha1(pair) {
+	const [source, dest] = pair;
+	return source !== null && verifiableUntrustedSha1(source) || dest !== null && verifiableUntrustedSha1(dest);
+}
+function verifiableUntrustedSha1(path) {
+	const state = comparableSha1(path);
+	return state.kind === "untrusted" && state.value !== null;
+}
+function hasB2Path(pair) {
+	const [source, dest] = pair;
+	return source !== null && isB2SyncPath(source) || dest !== null && isB2SyncPath(dest);
+}
+function isB2SyncPath(path) {
+	return "selectedVersion" in path;
+}
+function isLocalSyncPath(path) {
+	return "absolutePath" in path;
+}
+/**
+* Creates a successful no-op compare preparation result for a pair.
+*
+* @param pair - Source/destination pair from {@link zipFolders}.
+* @param bytesHashed - Local file bytes read while preparing the pair.
+* @param bytesVerified - B2 bytes read while verifying untrusted SHA-1 metadata.
+*
+* @returns A ready preparation result that allows action generation.
+*/
+function readyComparePair(pair, bytesHashed = 0, bytesVerified = 0) {
+	return {
+		pair,
+		events: [],
+		errors: [],
+		bytesHashed,
+		bytesVerified,
+		skipActionGeneration: false,
+		aborted: false
+	};
+}
+function skipped(pair, event, error, bytesHashed = 0, bytesVerified = 0) {
+	return {
+		pair,
+		events: [event],
+		errors: error !== void 0 ? [error] : [],
+		bytesHashed,
+		bytesVerified,
+		skipActionGeneration: true,
+		aborted: false
+	};
+}
+function aborted(pair) {
+	return {
+		pair,
+		events: [],
+		errors: [],
+		bytesHashed: 0,
+		bytesVerified: 0,
+		skipActionGeneration: true,
+		aborted: true
+	};
+}
+function unavailableSha1Event(pair) {
+	return unavailableSha1PathEvent({ relativePath: (pair[0] ?? pair[1])?.relativePath ?? "" });
+}
+function unavailableSha1PathEvent(path) {
+	return {
+		type: "skip",
+		path: path.relativePath,
+		size: 0,
+		message: "sha1 comparison skipped because a verifiable SHA-1 is unavailable"
+	};
+}
+function normalizeConcurrency(value) {
+	if (value === void 0 || !Number.isFinite(value) || value < 1) return 1;
+	return Math.max(1, Math.floor(value));
+}
+//#endregion
 
 
+//# sourceMappingURL=compare.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/index.js
+
+
+//#region src/sync/policies/index.ts
+/**
+* Converts a paired source/dest tuple into zero or more sync actions based on the
+* sync direction, compare mode, and keep policy.
+* For `compareMode: 'sha1'`, prefer the high-level `synchronize()` API so local
+* file hashes and comparable B2 hashes are prepared before actions are generated.
+* Low-level callers must pass pairs with local `contentSha1` values already
+* computed and B2 `contentSha1` values containing any comparable metadata fallback.
+*
+* @param pair - The source/dest file pair from {@link zipFolders}.
+* @param direction - The sync direction.
+* @param compareMode - How to compare files for differences.
+* @param keepMode - Policy for destination-only files.
+* @param keepDays - Retention period when keepMode is 'keep-days'.
+* @param nowMillis - Current time in milliseconds, used for keep-days calculation.
+* @param factory - Factory to create the concrete action objects.
+* @param compareThreshold - Tolerance for the comparison.
+*/
 function* generateActions(pair, direction, compareMode, keepMode, keepDays, nowMillis, factory, compareThreshold) {
-  const [source, dest] = pair;
-  if (source !== null && dest === null) {
-    yield* actionsForSourceOnly(source, direction, factory);
-  } else if (source === null && dest !== null) {
-    yield* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory);
-  } else if (source !== null && dest !== null) {
-    yield* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory);
-  }
+	assertSupportedCompareMode(compareMode);
+	const [source, dest] = pair;
+	if (source !== null && dest === null) yield* actionsForSourceOnly(source, direction, factory);
+	else if (source === null && dest !== null) yield* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory);
+	else if (source !== null && dest !== null) yield* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory);
 }
 function* actionsForSourceOnly(source, direction, factory) {
-  switch (direction) {
-    case "local-to-b2":
-      yield factory.upload(source);
-      break;
-    case "b2-to-local":
-      yield factory.download(source);
-      break;
-    case "b2-to-b2":
-      yield factory.copy(source, source.relativePath);
-      break;
-  }
+	switch (direction) {
+		case "local-to-b2":
+			yield factory.upload(source);
+			break;
+		case "b2-to-local":
+			yield factory.download(source, null);
+			break;
+		case "b2-to-b2":
+			yield factory.copy(source, source.relativePath);
+			break;
+	}
 }
 function* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory) {
-  if (keepMode === "no-delete") {
-    yield new SkipAction(dest.relativePath, "not in source, keep-mode is no-delete");
-    return;
-  }
-  if (keepMode === "keep-days") {
-    const ageMillis = nowMillis - dest.modTimeMillis;
-    const ageDays = ageMillis / (24 * 60 * 60 * 1e3);
-    if (ageDays < keepDays) {
-      yield new SkipAction(
-        dest.relativePath,
-        `not in source, keeping for ${Math.ceil(keepDays - ageDays)} more days`
-      );
-      return;
-    }
-  }
-  switch (direction) {
-    case "local-to-b2":
-      yield factory.removeOrphan(dest);
-      break;
-    case "b2-to-local":
-      yield factory.deleteLocal(dest);
-      break;
-    case "b2-to-b2":
-      yield factory.removeOrphan(dest);
-      break;
-  }
+	if (keepMode === "no-delete") {
+		yield new SkipAction(dest.relativePath, "not in source, keep-mode is no-delete");
+		return;
+	}
+	if (keepMode === "keep-days") {
+		const ageDays = (nowMillis - dest.modTimeMillis) / (1440 * 60 * 1e3);
+		if (ageDays < keepDays) {
+			yield new SkipAction(dest.relativePath, `not in source, keeping for ${Math.ceil(keepDays - ageDays)} more days`);
+			return;
+		}
+	}
+	switch (direction) {
+		case "local-to-b2":
+			yield factory.removeOrphan(dest);
+			break;
+		case "b2-to-local":
+			yield factory.deleteLocal(dest);
+			break;
+		case "b2-to-b2":
+			yield factory.removeOrphan(dest);
+			break;
+	}
 }
 function* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory) {
-  if (!filesAreDifferent(source, dest, compareMode, compareThreshold)) {
-    yield new SkipAction(source.relativePath, "files are the same");
-    return;
-  }
-  switch (direction) {
-    case "local-to-b2":
-      yield factory.upload(source);
-      break;
-    case "b2-to-local":
-      yield factory.download(source);
-      break;
-    case "b2-to-b2":
-      yield factory.copy(source, dest.relativePath);
-      break;
-  }
-}
-
-//# sourceMappingURL=index.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/synchronizer.js
-
-
-
-
-
-
+	if (!filesAreDifferent(source, dest, compareMode, compareThreshold)) {
+		yield new SkipAction(source.relativePath, "files are the same");
+		return;
+	}
+	switch (direction) {
+		case "local-to-b2":
+			yield factory.upload(source, dest);
+			break;
+		case "b2-to-local":
+			yield factory.download(source, dest);
+			break;
+		case "b2-to-b2":
+			yield factory.copyB2Path?.(source, dest) ?? factory.copy(source, dest.relativePath);
+			break;
+	}
+}
+//#endregion
 
 
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/path-safety.js
+//#region src/sync/path-safety.ts
+var RESERVED_SYNC_TEMP_FILE_RE = /^\.b2sdk-[0-9a-f]{24}-[^/\\]+-[0-9a-f]{32}\.partial$/i;
+var UUID_HEX_RE = /^[0-9a-f]{32}$/i;
+/**
+* Checks whether a basename is reserved for SDK-owned sync partial files.
+* @param name - Basename to inspect.
+*
+* @returns Whether the basename matches the SDK reserved partial-file pattern.
+*
+* @internal
+*/
+function isReservedSyncTempFileName(name) {
+	return RESERVED_SYNC_TEMP_FILE_RE.test(name);
+}
+/**
+* Rejects sync paths whose basename is reserved for SDK-owned temporary files.
+* @param relativePath - Sync-relative path using slash separators.
+*
+* @throws If any path segment uses the SDK's reserved temporary-file pattern.
+*
+* @internal
+*/
+function assertSyncPathAllowed(relativePath) {
+	if (relativePath.split(/[\\/]+/).filter(Boolean).some((part) => isReservedSyncTempFileName(part))) throw new Error(`Sync path uses reserved SDK temporary-file name: ${relativePath}`);
+}
+/**
+* Creates a download staging basename inside the SDK-reserved temp namespace.
+* @param finalName - Final destination basename.
+* @param uuid - UUID used to make the temp basename unique.
+*
+* @returns A basename that local and B2 scanners reject as SDK-owned temp data.
+*
+* @throws If the provided UUID cannot be normalized to 32 hex characters.
+*
+* @internal
+*/
+function makeReservedSyncTempFileName(finalName, uuid) {
+	if (finalName.length === 0 || /[\\/]/.test(finalName)) throw new Error("invalid sync temporary-file basename");
+	const hex = uuid.replaceAll("-", "").toLowerCase();
+	if (!UUID_HEX_RE.test(hex)) throw new Error("invalid sync temporary-file nonce");
+	return `.b2sdk-${hex.slice(0, 24)}-${finalName}-${hex}.partial`;
+}
+/**
+* Validates B2 relative names before they are materialized on a local filesystem.
+*
+* @param relPath - B2-style relative path.
+*
+* @returns Validated path segments.
+*
+* @throws When the path is empty, absolute, platform-ambiguous, or contains traversal.
+*
+* @internal
+*/
+function safeRelativePathSegments(relPath) {
+	assertSyncPathAllowed(relPath);
+	if (relPath.length === 0 || relPath.includes("\0") || relPath.includes("\\") || relPath.startsWith("/") || /^[A-Za-z]:/.test(relPath)) throw new Error("unsafe local destination path");
+	const segments = relPath.split("/");
+	if (segments.some((segment) => segment.length === 0 || segment === "." || segment === ".." || segment.includes(":") || segment.endsWith(".") || segment.endsWith(" ") || WINDOWS_RESERVED_NAME.test(segment))) throw new Error("unsafe local destination path");
+	return segments;
+}
+var WINDOWS_RESERVED_NAME = /^(con|prn|aux|nul|conin\$|conout\$|com[0-9\u00b9\u00b2\u00b3]|lpt[0-9\u00b9\u00b2\u00b3])(?:\..*)?$/i;
+/**
+* Throws if {@link target} is outside {@link root} or names the root itself.
+*
+* @param root - Resolved filesystem root.
+* @param target - Candidate path to validate.
+* @param path - Node path module.
+*
+* @throws When the target is outside the root or equal to the root.
+*
+* @internal
+*/
+function assertPathInsideRoot(root, target, path) {
+	const relative = path.relative(root, target);
+	if (relative.length === 0 || relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) throw new Error("unsafe local destination path");
+}
+/**
+* Returns the platform's no-follow open flag when available.
+*
+* @param constants - Node filesystem constants.
+*
+* @returns The `O_NOFOLLOW` bit or `0`.
+*
+* @internal
+*/
+function noFollowFlag(constants) {
+	return constants.O_NOFOLLOW ?? 0;
+}
+/**
+* Checks whether an unknown thrown value has a specific Node error code.
+*
+* @param err - Unknown thrown value.
+* @param code - Expected Node error code.
+*
+* @returns True when the value exposes the expected code.
+*
+* @internal
+*/
+function hasErrorCode(err, code) {
+	return err.code === code;
+}
+//#endregion
+
+
+//# sourceMappingURL=path-safety.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/download-staging.js
+
+//#region src/sync/download-staging.ts
+/** @internal */
+var DOWNLOAD_STAGING_DIRECTORY_NAME = ".b2sdk-download-staging";
+/** @internal */
+var DOWNLOAD_STAGING_MARKER_NAME = ".b2sdk-staging-marker.partial";
+var CANONICAL_DOWNLOAD_STAGING_DIRECTORY_NAME = canonicalLocalFilesystemSegment(DOWNLOAD_STAGING_DIRECTORY_NAME);
+var DOWNLOAD_STAGING_ENTRY_SUFFIX = ".download";
+var STALE_DOWNLOAD_STAGING_AGE_MS = 1440 * 60 * 1e3;
+var MAX_STAGING_CLEANUP_CONCURRENCY = 8;
+var MAX_CLEANUP_WARNING_ENTRIES = 3;
+/** @internal */
+var DOWNLOAD_STAGING_ACTIVITY_ENTRY_LIMIT = 1024;
+var reapedManagedDirectories = /* @__PURE__ */ new Map();
+/**
+* Checks whether a single path segment matches the SDK-managed staging directory name.
+* @param segment - Candidate path segment.
+*
+* @returns True when the segment is the reserved staging directory name under
+* local filesystem canonicalization.
+*
+* @internal
+*/
+function isDownloadStagingDirectorySegment(segment) {
+	return segment !== void 0 && canonicalLocalFilesystemSegment(segment) === CANONICAL_DOWNLOAD_STAGING_DIRECTORY_NAME;
+}
+/**
+* Creates a private SDK-managed staging directory under a local sync root.
+* @param rootRealPath - Resolved local sync root path.
+* @param path - Node path module used for platform-specific path operations.
+* @param randomUUID - UUID provider used to create unique staging entries.
+* @param statForDeviceCheck - Stat function used to verify filesystem devices.
+* @param beforeStagingMarkerWrite - Test hook called before marker creation.
+*
+* @returns The resolved staging directory path.
+*
+* @internal
+*/
+async function createDownloadStagingDirectory(rootRealPath, path, randomUUID, statForDeviceCheck, beforeStagingMarkerWrite) {
+	const { chmod, lstat, mkdir, readdir, realpath, rm } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	const managedDirectory = path.join(rootRealPath, DOWNLOAD_STAGING_DIRECTORY_NAME);
+	try {
+		await mkdir(managedDirectory, { mode: PRIVATE_DOWNLOAD_DIRECTORY_MODE });
+	} catch (err) {
+		if (!hasErrorCode(err, "EEXIST")) throw err;
+	}
+	if (!(await lstat(managedDirectory)).isDirectory()) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is not a directory`);
+	const realManagedDirectory = await realpath(managedDirectory);
+	assertPathInsideRoot(rootRealPath, realManagedDirectory, path);
+	await assertDownloadPathSameDevice(rootRealPath, realManagedDirectory, statForDeviceCheck, "unsafe local destination path: cannot stage download across filesystems");
+	if (!await isManagedDownloadStagingRoot(realManagedDirectory)) {
+		if ((await readdir(realManagedDirectory)).length > 0 && !await isManagedDownloadStagingRoot(realManagedDirectory)) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is reserved for SDK download staging`);
+	}
+	await beforeStagingMarkerWrite?.(realManagedDirectory);
+	await writeStagingMarker(realManagedDirectory, path);
+	/* v8 ignore next -- best-effort chmod */
+	await chmod(realManagedDirectory, PRIVATE_DOWNLOAD_DIRECTORY_MODE).catch(() => {});
+	await reapStaleDownloadStagingDirectoriesOnce(realManagedDirectory, path, Date.now());
+	const stagingDirectory = path.join(realManagedDirectory, `${Date.now()}-${randomUUID()}${DOWNLOAD_STAGING_ENTRY_SUFFIX}`);
+	await mkdir(stagingDirectory, { mode: PRIVATE_DOWNLOAD_DIRECTORY_MODE });
+	/* v8 ignore next -- best-effort chmod */
+	await chmod(stagingDirectory, PRIVATE_DOWNLOAD_DIRECTORY_MODE).catch(() => {});
+	try {
+		const realStagingDirectory = await realpath(stagingDirectory);
+		assertPathInsideRoot(realManagedDirectory, realStagingDirectory, path);
+		await assertDownloadPathSameDevice(rootRealPath, realStagingDirectory, statForDeviceCheck, "unsafe local destination path: cannot stage download across filesystems");
+		await beforeStagingMarkerWrite?.(realStagingDirectory);
+		await writeStagingMarker(realStagingDirectory, path);
+		return realStagingDirectory;
+	} catch (err) {
+		/* v8 ignore next -- best-effort cleanup */
+		await rm(stagingDirectory, {
+			recursive: true,
+			force: true
+		}).catch(() => {});
+		throw err;
+	}
+}
+/**
+* Returns true when a scan-root entry is an SDK-managed download staging root.
+* @param directory - Candidate directory to inspect.
+*
+* @returns True when the directory contains SDK staging markers.
+*
+* @internal
+*/
+async function isManagedDownloadStagingRoot(directory) {
+	const { lstat, readdir } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	const path = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19));
+	try {
+		if ((await lstat(path.join(directory, ".b2sdk-staging-marker.partial"))).isFile()) return true;
+	} catch (err) {
+		if (!hasErrorCode(err, "ENOENT")) return false;
+	}
+	let entries;
+	try {
+		entries = await readdir(directory, { withFileTypes: true });
+	} catch {
+		return false;
+	}
+	for (const entry of entries) {
+		if (!entry.isDirectory() || !entry.name.endsWith(DOWNLOAD_STAGING_ENTRY_SUFFIX)) continue;
+		try {
+			if ((await lstat(path.join(directory, entry.name, ".b2sdk-staging-marker.partial"))).isFile()) return true;
+		} catch {}
+	}
+	return false;
+}
+var PRIVATE_DOWNLOAD_FILE_MODE = 384;
+var PRIVATE_DOWNLOAD_DIRECTORY_MODE = 448;
+async function writeStagingMarker(directory, path) {
+	const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19));
+	const { lstat, open } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	const markerPath = path.join(directory, DOWNLOAD_STAGING_MARKER_NAME);
+	let handle;
+	try {
+		handle = await open(markerPath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | noFollowFlag(constants), PRIVATE_DOWNLOAD_FILE_MODE);
+		/* v8 ignore next -- best-effort chmod */
+		await handle.chmod(PRIVATE_DOWNLOAD_FILE_MODE).catch(() => {});
+	} catch (err) {
+		if (hasErrorCode(err, "EEXIST") || hasErrorCode(err, "ELOOP")) {
+			if ((await lstat(markerPath).catch(() => void 0))?.isFile() === true) return;
+			throw new Error("unsafe local destination path: staging marker is not a regular file");
+		}
+		throw err;
+	} finally {
+		/* v8 ignore next -- best-effort close */
+		await handle?.close().catch(() => {});
+	}
+}
+/**
+* Verifies that a candidate path is on the same filesystem device as the root.
+* @param rootRealPath - Resolved local sync root path.
+* @param candidateRealPath - Resolved candidate path to compare.
+* @param statForDeviceCheck - Stat function used to read device IDs.
+* @param message - Error message used when devices differ.
+*
+* @internal
+*/
+async function assertDownloadPathSameDevice(rootRealPath, candidateRealPath, statForDeviceCheck, message) {
+	const [rootStats, candidateStats] = await Promise.all([statForDeviceCheck(rootRealPath), statForDeviceCheck(candidateRealPath)]);
+	if (rootStats.dev !== candidateStats.dev) throw new Error(message);
+}
+async function reapStaleDownloadStagingDirectoriesOnce(managedDirectory, path, nowMillis) {
+	const previous = reapedManagedDirectories.get(managedDirectory);
+	if (previous !== void 0) {
+		await previous;
+		return;
+	}
+	const next = reapStaleDownloadStagingDirectories(managedDirectory, path, nowMillis).finally(() => {
+		if (reapedManagedDirectories.get(managedDirectory) === next) reapedManagedDirectories.delete(managedDirectory);
+	});
+	reapedManagedDirectories.set(managedDirectory, next);
+	await next;
+}
+async function reapStaleDownloadStagingDirectories(managedDirectory, path, nowMillis) {
+	const { readdir, realpath, rm } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	let entries;
+	try {
+		entries = await readdir(managedDirectory, { withFileTypes: true });
+	} catch (err) {
+		if (hasErrorCode(err, "ENOENT")) return;
+		emitCleanupWarning("failed to inspect B2 SDK download staging entries");
+		return;
+	}
+	const cleanupErrors = [];
+	await forEachWithConcurrency(entries, MAX_STAGING_CLEANUP_CONCURRENCY, async (entry) => {
+		if (!entry.isDirectory() || !entry.name.endsWith(DOWNLOAD_STAGING_ENTRY_SUFFIX)) return;
+		const candidate = path.join(managedDirectory, entry.name);
+		const activity = await readManagedStagingEntryActivity(candidate, path);
+		if (activity === void 0 || !stagingActivityIsStale(activity, nowMillis)) return;
+		const realCandidate = await realpath(candidate).catch(() => {
+			cleanupErrors.push({
+				entryName: entry.name,
+				operation: "inspect"
+			});
+		});
+		if (realCandidate === void 0) return;
+		try {
+			assertPathInsideRoot(managedDirectory, realCandidate, path);
+			const latestActivity = await readManagedStagingEntryActivity(candidate, path);
+			if (latestActivity === void 0 || latestActivity.signature !== activity.signature || !stagingActivityIsStale(latestActivity, nowMillis)) return;
+			await rm(realCandidate, {
+				recursive: true,
+				force: true
+			});
+		} catch {
+			cleanupErrors.push({
+				entryName: entry.name,
+				operation: "remove"
+			});
+		}
+	});
+	if (cleanupErrors.length > 0) {
+		const noun = cleanupErrors.length === 1 ? "entry" : "entries";
+		emitCleanupWarning(`failed to reap ${cleanupErrors.length} stale B2 SDK download staging ${noun}: ${cleanupErrors.slice(0, MAX_CLEANUP_WARNING_ENTRIES).map(formatCleanupWarning).join("; ")}`);
+	}
+}
+async function readManagedStagingEntryActivity(candidate, path) {
+	const { lstat, readdir } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	try {
+		const [directoryStats, markerStats] = await Promise.all([lstat(candidate), lstat(path.join(candidate, DOWNLOAD_STAGING_MARKER_NAME))]);
+		if (!directoryStats.isDirectory() || !markerStats.isFile()) return void 0;
+		const entries = await readdir(candidate, { withFileTypes: true });
+		if (entries.length > 1024) return void 0;
+		const statsParts = [`.:${stagingStatsSignature(directoryStats)}`, `${DOWNLOAD_STAGING_MARKER_NAME}:${stagingStatsSignature(markerStats)}`];
+		let newestActivityMs = Math.max(stagingStatsActivityMs(directoryStats), stagingStatsActivityMs(markerStats));
+		for (const entry of [...entries].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
+			const stats = await lstat(path.join(candidate, entry.name));
+			statsParts.push(`${entry.name}:${stagingStatsSignature(stats)}`);
+			newestActivityMs = Math.max(newestActivityMs, stagingStatsActivityMs(stats));
+		}
+		return {
+			newestActivityMs,
+			signature: statsParts.join("|")
+		};
+	} catch {
+		return;
+	}
+}
+function stagingStatsActivityMs(stats) {
+	return stats.mtimeMs;
+}
+function stagingStatsSignature(stats) {
+	return `${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeMs}:${stats.ctimeMs}`;
+}
+function stagingActivityIsStale(activity, nowMillis) {
+	return nowMillis - activity.newestActivityMs >= STALE_DOWNLOAD_STAGING_AGE_MS;
+}
+function formatCleanupWarning(error) {
+	return `${error.operation} ${safeWarningName(error.entryName)}`;
+}
+function safeWarningName(name) {
+	const chars = Array.from(name);
+	const bounded = chars.slice(0, 80).join("");
+	const suffix = chars.length > 80 ? "..." : "";
+	return JSON.stringify(`${bounded.replace(/[^A-Za-z0-9._-]/g, "?")}${suffix}`);
+}
+function canonicalLocalFilesystemSegment(segment) {
+	return segment.normalize("NFC").toLocaleLowerCase("en-US");
+}
+async function forEachWithConcurrency(items, concurrency, fn) {
+	let index = 0;
+	const workers = Array.from({ length: Math.min(concurrency, items.length) }, async () => {
+		while (index < items.length) {
+			const item = items[index];
+			index += 1;
+			if (item !== void 0) await fn(item);
+		}
+	});
+	await Promise.all(workers);
+}
+function emitCleanupWarning(message) {
+	globalThis.process?.emitWarning?.(message, { code: "B2SDK_DOWNLOAD_STAGING_CLEANUP_FAILED" });
+}
+//#endregion
+
+
+//# sourceMappingURL=download-staging.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/prefix.js
+
+//#region src/sync/prefix.ts
+/**
+* Treats the supplied string as a raw B2 key prefix without adding a folder boundary.
+*
+* B2 keys are byte-oriented names, not local filesystem paths. A backslash in a prefix is a real
+* key character and must not be rewritten to `/`; callers that want slash-delimited prefixes should
+* pass `/` explicitly.
+*
+* @param prefix - User-supplied raw B2 key prefix.
+*
+* @returns Raw B2 key prefix.
+*/
+function asRawB2KeyPrefix(prefix) {
+	return prefix;
+}
+/**
+* Normalizes a B2 object name into a safe folder-relative sync path.
+*
+* Object names are converted to forward-slash sync paths for local compatibility. Callers that scan
+* B2 must detect normalized-path collisions between distinct raw B2 keys before yielding entries.
+*
+* @param path - B2 object name or prefix-stripped suffix returned by a listing.
+* @param options - Optional normalization behavior for legacy slashless raw prefixes.
+*
+* @returns Folder-relative sync path.
+*
+* @throws When the object name cannot be represented as a safe relative path.
+*/
+function normalizeB2RelativePath(path, options = {}) {
+	const slashPath = path.split("\\").join("/");
+	const relativePath = options.stripLeadingSlashes === true ? stripSingleLeadingSlash(slashPath) : slashPath;
+	const segments = relativePath.split("/");
+	if (/^[A-Za-z]:/.test(relativePath) || segments.some((segment) => segmentIsUnsafe(segment))) throw new Error("Unsafe B2 file name cannot be used as a sync relative path");
+	return relativePath;
+}
+/**
+* Converts a B2 object key under a configured raw prefix into a sync relative path.
+*
+* @param prefix - Raw B2 key prefix used for the scan or mutation guard.
+* @param fileName - Full B2 object key.
+*
+* @returns The normalized sync relative path for the key suffix.
+*/
+function b2KeyToRelativePathUnderPrefix(prefix, fileName) {
+	const rawPrefix = asRawB2KeyPrefix(prefix);
+	return normalizeB2RelativePath(rawPrefix === "" ? fileName : fileName.slice(rawPrefix.length), { stripLeadingSlashes: rawPrefix !== "" && !rawPrefix.endsWith("/") });
+}
+/**
+* Returns whether a sync path is unsafe to materialize on Windows-compatible local filesystems.
+* B2-to-B2 syncs can preserve these object names, but B2-to-local syncs skip them before writing.
+*
+* @param relativePath - Folder-relative sync path.
+*
+* @returns True when any segment is Windows-dangerous or ambiguous.
+*/
+function localFilesystemSyncPathIsUnsafe(relativePath) {
+	const segments = relativePath.split("/");
+	return isDownloadStagingDirectorySegment(segments[0]) || segments.some((segment) => segmentIsLocalFilesystemUnsafe(segment));
+}
+/**
+* Produces an approximate Windows/macOS-style canonical key for local collision detection.
+*
+* @param relativePath - Folder-relative sync path.
+*
+* @returns A canonicalized path key for detecting case/Unicode collisions before local writes.
+*/
+function localFilesystemCanonicalSyncPath(relativePath) {
+	return relativePath.split("/").map((segment) => segment.normalize("NFC").toLocaleLowerCase("en-US")).join("/");
+}
+function segmentIsUnsafe(segment) {
+	return segment === "" || segment === "." || segment === ".." || containsControlCharacter(segment);
+}
+function segmentIsLocalFilesystemUnsafe(segment) {
+	if (segment.includes(":") || segment.endsWith(".") || segment.endsWith(" ")) return true;
+	const basename = segment.split(".")[0]?.toUpperCase();
+	return basename !== void 0 && /^(CON|PRN|AUX|NUL|CONIN\$|CONOUT\$|COM[0-9¹²³]|LPT[0-9¹²³])$/u.test(basename);
+}
+function containsControlCharacter(segment) {
+	for (let index = 0; index < segment.length; index++) {
+		const code = segment.charCodeAt(index);
+		if (code >= 0 && code <= 31) return true;
+	}
+	return false;
+}
+function stripSingleLeadingSlash(path) {
+	return path.startsWith("/") ? path.slice(1) : path;
+}
+//#endregion
+
+
+//# sourceMappingURL=prefix.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/filesystem-errors.js
+
+//#region src/sync/filesystem-errors.ts
+/**
+* Formats local filesystem errors without including host filesystem paths.
+* @param err - Unknown filesystem error.
+*
+* @returns A path-independent code or error name.
+*/
+function localFilesystemErrorReason(err) {
+	const error = toError(err);
+	const code = cleanFilesystemErrorPart(error.code);
+	if (code !== "") return code;
+	const name = cleanFilesystemErrorPart(error.name);
+	if (name !== "") return name;
+	return "Error";
+}
+function cleanFilesystemErrorPart(value) {
+	if (typeof value !== "string") return "";
+	let cleaned = "";
+	for (const char of value) {
+		const code = char.charCodeAt(0);
+		if (code < 32 || code === 127) continue;
+		cleaned += char;
+		if (cleaned.length >= 80) break;
+	}
+	const trimmed = cleaned.trim();
+	return /[\\/]/.test(trimmed) ? "" : trimmed;
+}
+//#endregion
+
+
+//# sourceMappingURL=filesystem-errors.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-filesystem-root.js
+//#region src/sync/local-filesystem-root.ts
+var localFilesystemRoots = /* @__PURE__ */ new WeakSet();
+/**
+* Privately marks SDK local folders that are backed by the filesystem.
+* @param folder - Local folder instance to mark.
+*
+* @internal
+*/
+function registerLocalFilesystemRoot(folder) {
+	localFilesystemRoots.add(folder);
+}
+/**
+* Returns true for SDK local folders backed by the filesystem.
+* @param folder - Sync folder to inspect.
+*
+* @returns True when the folder was registered as an SDK filesystem root.
+*
+* @internal
+*/
+function isLocalFilesystemRoot(folder) {
+	return localFilesystemRoots.has(folder);
+}
+//#endregion
+
+
+//# sourceMappingURL=local-filesystem-root.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/b2-sha1-reader.js
+
+
+//#region src/sync/b2-sha1-reader.ts
+var MAX_CONSECUTIVE_EMPTY_READ_CHUNKS = 1024;
+/**
+* Reads one non-empty stream chunk with an idle timeout and optional abort signal.
+* Empty chunks are not progress; too many consecutive empty chunks fail with the
+* same stalled-read diagnostic used for pending reads.
+*
+* @param reader - Locked reader to read from.
+* @param timeoutMillis - Idle timeout in milliseconds for this read.
+* @param stalledMessage - Error message used when the read makes no progress.
+* @param signal - Optional abort signal to observe while reading.
+*
+* @returns The next stream read result.
+*
+* @internal
+*/
+async function readStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal) {
+	let emptyChunks = 0;
+	while (true) {
+		const result = await readRawStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal);
+		if (result.done || result.value.byteLength > 0) return result;
+		emptyChunks += 1;
+		if (emptyChunks > MAX_CONSECUTIVE_EMPTY_READ_CHUNKS) throw new Error(stalledMessage);
+	}
+}
+async function readRawStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal) {
+	signal?.throwIfAborted();
+	let timeout;
+	let removeAbortListener;
+	const readPromise = reader.read();
+	const timeoutPromise = timeoutMillis === Number.POSITIVE_INFINITY ? void 0 : new Promise((_, reject) => {
+		timeout = setTimeout(() => {
+			reject(new Error(stalledMessage));
+		}, timeoutMillis);
+	});
+	const abortPromise = signal === void 0 ? void 0 : new Promise((_, reject) => {
+		const onAbort = () => reject(signal.reason ?? /* @__PURE__ */ new Error("aborted"));
+		signal.addEventListener("abort", onAbort, { once: true });
+		removeAbortListener = () => signal.removeEventListener("abort", onAbort);
+	});
+	try {
+		if (timeoutPromise === void 0 && abortPromise === void 0) return await readPromise;
+		const candidates = [readPromise];
+		if (timeoutPromise !== void 0) candidates.push(timeoutPromise);
+		if (abortPromise !== void 0) candidates.push(abortPromise);
+		return await Promise.race(candidates);
+	} finally {
+		if (timeout !== void 0) clearTimeout(timeout);
+		removeAbortListener?.();
+		readPromise.catch(() => {});
+	}
+}
+/**
+* Hashes a B2 response body as SHA-1 with idle timeout, abort, and size checks.
+*
+* @param body - Response body stream to hash.
+* @param signal - Optional abort signal to observe while reading.
+* @param options - Optional timeout and byte-count limits.
+*
+* @returns The computed SHA-1 and number of bytes read.
+*
+* @internal
+*/
+async function hashReadableStreamSha1(body, signal, options) {
+	const hash = new IncrementalSha1();
+	const reader = body.getReader();
+	const idleTimeoutMillis = options?.idleTimeoutMillis ?? normalizeSha1TimeoutMillis(void 0);
+	const maxBytes = options?.maxBytes ?? Number.POSITIVE_INFINITY;
+	const expectedBytes = options?.expectedBytes;
+	let bytesRead = 0;
+	try {
+		while (true) {
+			const { done, value } = await readStreamChunkWithTimeout(reader, idleTimeoutMillis, `sha1 B2 read stalled for ${idleTimeoutMillis} ms`, signal);
+			if (done) break;
+			bytesRead += value.byteLength;
+			if (bytesRead > maxBytes) throw new Error(`sha1 B2 read exceeded ${maxBytes} byte verification budget`);
+			await hash.update(value);
+		}
+		if (expectedBytes !== void 0 && bytesRead !== expectedBytes) throw new Error(`sha1 B2 read ended after ${bytesRead} bytes, expected ${expectedBytes}`);
+		return {
+			contentSha1: await hash.digest(),
+			bytesRead
+		};
+	} catch (err) {
+		reader.cancel(err).catch(() => {});
+		throw err;
+	} finally {
+		reader.releaseLock();
+	}
+}
+/**
+* Applies an absolute verification deadline while forwarding parent aborts.
+*
+* @param signal - Optional parent abort signal.
+* @param timeoutMillis - Absolute deadline in milliseconds.
+* @param run - Operation to run with the derived deadline signal.
+*
+* @returns The operation result.
+*
+* @internal
+*/
+async function withSha1VerificationDeadline(signal, timeoutMillis, run) {
+	const controller = new AbortController();
+	const abortFromParent = () => controller.abort(signal?.reason);
+	if (signal?.aborted) abortFromParent();
+	signal?.addEventListener("abort", abortFromParent, { once: true });
+	let timeout;
+	const timeoutPromise = new Promise((_, reject) => {
+		timeout = setTimeout(() => {
+			const error = /* @__PURE__ */ new Error(`sha1 B2 verification exceeded ${timeoutMillis} ms`);
+			controller.abort(error);
+			reject(error);
+		}, timeoutMillis);
+	});
+	const runPromise = run(controller.signal);
+	try {
+		return await Promise.race([runPromise, timeoutPromise]);
+	} finally {
+		if (timeout !== void 0) clearTimeout(timeout);
+		signal?.removeEventListener("abort", abortFromParent);
+		runPromise.catch(() => {});
+	}
+}
+/**
+* Bounds B2 SHA-1 verification downloads to the selected object's size and optional ceiling.
+*
+* @param contentLength - Selected B2 object byte length.
+* @param ceiling - Optional lower verification budget.
+*
+* @returns The byte budget to enforce.
+*
+* @internal
+*/
+function normalizeSha1VerificationMaxBytes(contentLength, ceiling) {
+	const contentBudget = Math.max(0, Math.floor(contentLength));
+	if (ceiling === void 0) return contentBudget;
+	if (!Number.isFinite(ceiling) || ceiling < 0) return contentBudget;
+	return Math.min(contentBudget, Math.floor(ceiling));
+}
+//#endregion
+
+
+//# sourceMappingURL=b2-sha1-reader.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-file-io.js
+
+
+
+
+
+//#region src/sync/local-file-io.ts
+/** @internal */
+var localFileIoTestHooks = {};
+/**
+* Verifies that a previously scanned local file still points at the same regular file.
+*
+* @param path - Scanned local path and file identity.
+*
+* @internal
+*/
+async function validateScannedLocalFile(path) {
+	await (await openValidatedScannedLocalFile(path)).close();
+}
+async function openValidatedScannedLocalFile(path) {
+	const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19));
+	const { open } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	const flags = constants.O_RDONLY | noFollowFlag(constants) | (constants.O_NONBLOCK ?? 0);
+	const handle = await open(path.absolutePath, flags).catch((err) => {
+		if (hasErrorCode(err, "ELOOP")) throw new Error("local file changed before upload: not a regular file");
+		throw new Error(`local file changed before upload: could not open scanned file: ${sanitizeErrorReason(err)}`);
+	});
+	try {
+		assertSameScannedRegularFile(await handle.stat(), path, "upload", { platform: localFileIoTestHooks.platform });
+		return handle;
+	} catch (err) {
+		await handle.close().catch(() => {});
+		throw err;
+	}
+}
+/**
+* Streams a B2 download under a local sync root with path, timeout, and size checks.
+*
+* @param root - Local sync root.
+* @param relPath - Destination path relative to the root.
+* @param body - Download body stream.
+* @param options - Expected byte count, idle timeout, and optional abort signal.
+*
+* @internal
+*/
+async function writeLocalStreamInsideRoot(root, relPath, body, options) {
+	const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19));
+	const { link, lstat, mkdir, open, realpath, rename, rm, stat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	const path = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19));
+	const { randomUUID } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 7598, 19));
+	assertValidExpectedBytes(options.expectedBytes);
+	const segments = safeRelativePathSegments(relPath);
+	if (isDownloadStagingDirectorySegment(segments[0])) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is reserved for SDK download staging`);
+	const rootRealPath = await realpath(root);
+	let current = rootRealPath;
+	for (const segment of segments.slice(0, -1)) {
+		current = path.join(current, segment);
+		try {
+			await mkdir(current);
+		} catch (err) {
+			if (!hasErrorCode(err, "EEXIST")) throw err;
+		}
+		if (!(await lstat(current)).isDirectory()) throw new Error("unsafe local destination path: parent is not a directory");
+		await localFileIoTestHooks.afterParentDirectoryValidated?.(current);
+	}
+	const destPath = path.join(rootRealPath, ...segments);
+	assertPathInsideRoot(rootRealPath, destPath, path);
+	const parentRealPath = await realpath(path.dirname(destPath));
+	const finalPath = path.join(parentRealPath, path.basename(destPath));
+	assertPathInsideRoot(rootRealPath, finalPath, path);
+	try {
+		const targetStats = await lstat(finalPath);
+		if (targetStats.isSymbolicLink()) throw new Error("unsafe local destination path: target is a symbolic link");
+		if (targetStats.isFile() && targetStats.nlink > 1) throw new Error("unsafe local destination path: target has multiple hard links");
+	} catch (err) {
+		if (!hasErrorCode(err, "ENOENT")) throw err;
+	}
+	const statForDeviceCheck = localFileIoTestHooks.statForDeviceCheck ?? stat;
+	await assertDownloadPathSameDevice(rootRealPath, parentRealPath, statForDeviceCheck, "unsafe local destination path: cannot publish download across filesystems");
+	let parentHandle;
+	let anchoredParentPath;
+	/* v8 ignore start -- Linux-only fd-relative path support is covered by Linux CI */
+	if (globalThis.process?.platform === "linux" && constants.O_DIRECTORY !== void 0 && localFileIoTestHooks.disableProcFdAnchoring !== true) try {
+		parentHandle = await open(parentRealPath, constants.O_RDONLY | constants.O_DIRECTORY | noFollowFlag(constants));
+		anchoredParentPath = `/proc/self/fd/${parentHandle.fd}`;
+	} catch (err) {
+		if (hasErrorCode(err, "ELOOP") || hasErrorCode(err, "ENOTDIR")) throw new Error("unsafe local destination path: parent is not a directory");
+		throw err;
+	}
+	/* v8 ignore stop */
+	const finalName = path.basename(destPath);
+	const finalWritePath = path.join(anchoredParentPath ?? parentRealPath, finalName);
+	let publishMode;
+	try {
+		publishMode = await replacementFileMode(finalPath);
+	} catch (err) {
+		/* v8 ignore next -- best-effort close during setup failure */
+		await parentHandle?.close().catch(() => {});
+		throw err;
+	}
+	let stagingDirectory;
+	try {
+		stagingDirectory = await createDownloadStagingDirectory(rootRealPath, path, randomUUID, statForDeviceCheck, localFileIoTestHooks.beforeStagingMarkerWrite);
+	} catch (err) {
+		/* v8 ignore next -- best-effort close during setup failure */
+		await parentHandle?.close().catch(() => {});
+		throw err;
+	}
+	const tmpPath = path.join(stagingDirectory, `.b2sdk-${randomUUID()}.partial`);
+	let handle;
+	try {
+		handle = await open(tmpPath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | noFollowFlag(constants), local_file_io_PRIVATE_DOWNLOAD_FILE_MODE);
+		/* v8 ignore next -- best-effort chmod */
+		await handle.chmod(local_file_io_PRIVATE_DOWNLOAD_FILE_MODE).catch(() => {});
+		await localFileIoTestHooks.afterTempFileCreated?.(tmpPath, stagingDirectory);
+	} catch (err) {
+		await parentHandle?.close().catch(() => {});
+		await rm(stagingDirectory, {
+			recursive: true,
+			force: true
+		}).catch(() => {});
+		throw err;
+	}
+	/* v8 ignore stop */
+	try {
+		const tmpRealPath = await realpath(tmpPath);
+		assertPathInsideRoot(stagingDirectory, tmpRealPath, path);
+	} catch (err) {
+		/* v8 ignore next -- best-effort cleanup */
+		await handle?.close().catch(() => {});
+		/* v8 ignore next -- best-effort cleanup */
+		await rm(tmpPath, { force: true }).catch(() => {});
+		/* v8 ignore next -- best-effort cleanup */
+		await rm(stagingDirectory, {
+			recursive: true,
+			force: true
+		}).catch(() => {});
+		/* v8 ignore next -- best-effort cleanup */
+		await parentHandle?.close().catch(() => {});
+		throw err;
+	}
+	const writeHandle = handle;
+	const reader = body.getReader();
+	let completed = false;
+	try {
+		let bytesWritten = 0;
+		while (true) {
+			const { done, value } = await readStreamChunkWithTimeout(reader, options.idleTimeoutMillis, `download read stalled for ${options.idleTimeoutMillis} ms`, options.signal);
+			if (done) break;
+			if (bytesWritten + value.byteLength > options.expectedBytes) throw new Error(`download read exceeded ${options.expectedBytes} byte limit`);
+			await writeAll(writeHandle, value, bytesWritten);
+			bytesWritten += value.byteLength;
+		}
+		if (bytesWritten !== options.expectedBytes) throw new Error(`download read ended after ${bytesWritten} bytes, expected ${options.expectedBytes}`);
+		if (publishMode !== local_file_io_PRIVATE_DOWNLOAD_FILE_MODE)
+ /* v8 ignore next -- best-effort mode preservation */
+		await writeHandle.chmod(publishMode).catch(() => {});
+		await writeHandle.close();
+		handle = void 0;
+		const [parentRealPathBeforeRename, parentStatsBeforeRename] = await Promise.all([realpath(path.dirname(destPath)), stat(path.dirname(destPath))]);
+		assertPathInsideRoot(rootRealPath, path.join(parentRealPathBeforeRename, path.basename(destPath)), path);
+		await localFileIoTestHooks.beforeFinalRename?.(parentRealPathBeforeRename);
+		let publishPath = finalWritePath;
+		if (anchoredParentPath === void 0) {
+			const [parentRealPathAfterHook, parentStatsAfterHook] = await Promise.all([realpath(path.dirname(destPath)), stat(path.dirname(destPath))]);
+			if (parentRealPathAfterHook !== parentRealPathBeforeRename || !sameParentIdentity(parentStatsAfterHook, parentStatsBeforeRename)) throw new Error("unsafe local destination path: parent changed before final publish");
+			publishPath = path.join(parentRealPathAfterHook, path.basename(destPath));
+			assertPathInsideRoot(rootRealPath, publishPath, path);
+		}
+		await publishDownload(lstat, link, path, randomUUID, rename, rm, tmpPath, publishPath, options.expectedDestination);
+		completed = true;
+	} catch (err) {
+		/* v8 ignore next -- best-effort cleanup */
+		reader.cancel(err).catch(() => {});
+		throw err;
+	} finally {
+		reader.releaseLock();
+		if (!completed) {
+			/* v8 ignore next -- best-effort cleanup */
+			await handle?.close().catch(() => {});
+			/* v8 ignore next -- best-effort cleanup */
+			await rm(tmpPath, { force: true }).catch(() => {});
+		}
+		/* v8 ignore next -- best-effort cleanup */
+		await rm(stagingDirectory, {
+			recursive: true,
+			force: true
+		}).catch(() => {});
+		/* v8 ignore next -- best-effort cleanup */
+		await parentHandle?.close().catch(() => {});
+	}
+}
+function assertValidExpectedBytes(expectedBytes) {
+	if (!Number.isSafeInteger(expectedBytes) || expectedBytes < 0) throw new Error("download expectedBytes must be a non-negative safe integer");
+}
+async function assertExpectedDownloadDestination(lstat, finalPath, expectedDestination) {
+	if (expectedDestination === void 0) return;
+	try {
+		const stats = await lstat(finalPath);
+		if (expectedDestination === null) throw new Error("local destination changed before download: file was created");
+		assertSameScannedRegularFile(stats, {
+			...expectedDestination,
+			absolutePath: finalPath
+		}, "download", { platform: localFileIoTestHooks.platform });
+	} catch (err) {
+		if (hasErrorCode(err, "ENOENT")) {
+			if (expectedDestination === null) return;
+			throw new Error("local file changed before download: file missing");
+		}
+		throw err;
+	}
+}
+async function publishDownload(lstat, link, path, randomUUID, rename, rm, tmpPath, publishPath, expectedDestination) {
+	await assertExpectedDownloadDestination(lstat, publishPath, expectedDestination);
+	await localFileIoTestHooks.beforeDownloadPublish?.(publishPath);
+	if (expectedDestination === void 0) {
+		await rename(tmpPath, publishPath);
+		return;
+	}
+	if (expectedDestination === null) {
+		await linkDownloadNoOverwrite(link, tmpPath, publishPath, "local destination changed before download: file was created");
+		/* v8 ignore next -- staging cleanup is best-effort after a guarded publish succeeds. */
+		await rm(tmpPath, { force: true }).catch(() => {});
+		return;
+	}
+	const backupPath = path.join(path.dirname(publishPath), makeReservedSyncTempFileName(path.basename(publishPath), randomUUID()));
+	let backupExists = false;
+	let removeBackup = false;
+	try {
+		try {
+			await rename(publishPath, backupPath);
+			backupExists = true;
+			await localFileIoTestHooks.afterDownloadBackupRename?.(backupPath);
+		} catch (err) {
+			if (hasErrorCode(err, "ENOENT")) throw new Error("local file changed before download: file missing");
+			throw err;
+		}
+		assertSameScannedRegularFile(await lstat(backupPath), {
+			...expectedDestination,
+			absolutePath: backupPath
+		}, "download", {
+			compareChangeTime: false,
+			platform: localFileIoTestHooks.platform
+		});
+		await linkDownloadNoOverwrite(link, tmpPath, publishPath, "local destination changed before download: file was created");
+		removeBackup = true;
+		/* v8 ignore next -- staging cleanup is best-effort after a guarded publish succeeds. */
+		await rm(tmpPath, { force: true }).catch(() => {});
+	} catch (err) {
+		if (backupExists && !removeBackup) await restoreBackupWithoutOverwrite(link, rm, backupPath, publishPath).catch(() => {});
+		throw err;
+	} finally {
+		if (removeBackup)
+ /* v8 ignore next -- old destination cleanup is best-effort after publish succeeds. */
+		await rm(backupPath, { force: true }).catch(() => {});
+	}
+}
+async function linkDownloadNoOverwrite(link, sourcePath, destPath, message) {
+	try {
+		await link(sourcePath, destPath);
+	} catch (err) {
+		if (hasErrorCode(err, "EEXIST")) throw new Error(message);
+		throw err;
+	}
+}
+async function restoreBackupWithoutOverwrite(link, rm, backupPath, publishPath) {
+	try {
+		await link(backupPath, publishPath);
+		await rm(backupPath, { force: true });
+	} catch (err) {
+		if (hasErrorCode(err, "EEXIST")) return;
+		throw err;
+	}
+}
+var local_file_io_PRIVATE_DOWNLOAD_FILE_MODE = 384;
+async function replacementFileMode(filePath) {
+	const { lstat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	try {
+		const stats = await lstat(filePath);
+		return stats.isFile() ? stats.mode & 511 : local_file_io_PRIVATE_DOWNLOAD_FILE_MODE;
+	} catch (err) {
+		if (hasErrorCode(err, "ENOENT")) return local_file_io_PRIVATE_DOWNLOAD_FILE_MODE;
+		throw err;
+	}
+}
+/**
+* Deletes a scanned local file under a sync root without re-resolving attacker-controlled parents.
+*
+* @param root - Local sync root.
+* @param scannedPath - Previously scanned local file metadata.
+*
+* @internal
+*/
+async function deleteLocalFileInsideRoot(root, scannedPath) {
+	if (root === "") throw new Error("Local sync root required for filesystem mutation");
+	const { constants } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 19));
+	const { lstat, open, realpath, stat, unlink } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	const path = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19));
+	const segments = safeRelativePathSegments(scannedPath.relativePath);
+	const safeRoot = path.resolve(root);
+	const rootStats = await lstat(safeRoot);
+	if (rootStats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${scannedPath.relativePath}`);
+	if (!rootStats.isDirectory()) throw new Error(`Local sync root is not a directory: ${scannedPath.relativePath}`);
+	const rootRealPath = await realpath(safeRoot);
+	const expectedPath = path.join(rootRealPath, ...segments);
+	assertPathInsideRoot(rootRealPath, expectedPath, path);
+	if (path.resolve(scannedPath.absolutePath) !== expectedPath) throw new Error(`Refusing to delete outside sync root: ${scannedPath.relativePath}`);
+	const [parentRealPath, parentStats] = await Promise.all([realpath(path.dirname(expectedPath)), stat(path.dirname(expectedPath))]);
+	const finalPath = path.join(parentRealPath, path.basename(expectedPath));
+	assertPathInsideRoot(rootRealPath, finalPath, path);
+	const platform = globalThis.process?.platform;
+	let parentHandle;
+	let anchoredParentPath;
+	/* v8 ignore start -- Linux-only fd-relative path support is covered by Linux CI */
+	if (platform === "linux" && constants.O_DIRECTORY !== void 0 && localFileIoTestHooks.disableProcFdAnchoring !== true) try {
+		await localFileIoTestHooks.beforeLocalDeleteOpenParent?.(parentRealPath);
+		parentHandle = await open(parentRealPath, constants.O_RDONLY | constants.O_DIRECTORY | noFollowFlag(constants));
+		anchoredParentPath = `/proc/self/fd/${parentHandle.fd}`;
+	} catch (err) {
+		if (hasErrorCode(err, "ELOOP") || hasErrorCode(err, "ENOTDIR")) throw new Error("unsafe local delete path: parent is not a directory");
+		throw err;
+	}
+	/* v8 ignore stop */
+	try {
+		const unlinkPath = anchoredParentPath === void 0 ? finalPath : path.join(anchoredParentPath, path.basename(expectedPath));
+		assertSameScannedRegularFile(await lstat(unlinkPath), {
+			...scannedPath,
+			absolutePath: unlinkPath
+		}, "delete", { platform: localFileIoTestHooks.platform });
+		await localFileIoTestHooks.beforeLocalDeleteUnlink?.(parentRealPath);
+		if (anchoredParentPath === void 0 && localFileIoTestHooks.disableProcFdAnchoring === true && parentRealPath !== rootRealPath) throw new Error("unsafe local delete path: stable parent handle unavailable for unlink");
+		if (anchoredParentPath === void 0) {
+			const [parentRealPathBeforeUnlink, parentStatsBeforeUnlink] = await Promise.all([realpath(path.dirname(expectedPath)), stat(path.dirname(expectedPath))]);
+			if (parentRealPathBeforeUnlink !== parentRealPath || !sameParentIdentity(parentStatsBeforeUnlink, parentStats)) throw new Error("unsafe local delete path: parent changed before unlink");
+		}
+		assertSameScannedRegularFile(await lstat(unlinkPath), {
+			...scannedPath,
+			absolutePath: unlinkPath
+		}, "delete", { platform: localFileIoTestHooks.platform });
+		await unlink(unlinkPath);
+	} finally {
+		/* v8 ignore next -- best-effort cleanup */
+		await parentHandle?.close().catch(() => {});
+	}
+}
+function sameParentIdentity(current, expected) {
+	return current.dev === expected.dev && current.ino === expected.ino;
+}
+async function writeAll(handle, data, position) {
+	let offset = 0;
+	while (offset < data.byteLength) {
+		const { bytesWritten } = await handle.write(data, offset, data.byteLength - offset, position + offset);
+		/* v8 ignore next -- defensive: FileHandle.write should progress for non-empty chunks. */
+		if (bytesWritten <= 0) throw new Error("download write made no progress");
+		offset += bytesWritten;
+	}
+}
+//#endregion
+
+
+//# sourceMappingURL=local-file-io.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/synchronizer.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//#region src/sync/synchronizer.ts
+var MAX_BUFFERED_SCAN_EVENTS = 100;
+var MAX_AGGREGATE_FAILED_PATHS = 100;
+var DEFAULT_DOWNLOAD_IDLE_TIMEOUT_MILLIS = 6e4;
+/**
+* Test hooks for bounded planning behavior.
+*
+* @internal
+*/
+var synchronizerTestHooks = {};
+/**
+* Infers the sync direction from the source and destination folder types.
+* @param source - The folder to read files from.
+* @param dest - The folder to write files to.
+*
+* @returns The resolved sync direction based on folder types.
+*
+* @throws When the source and destination folder types form an unsupported combination.
+*/
 function resolveDirection(source, dest) {
-  if (source.type === "local" && dest.type === "b2") return "local-to-b2";
-  if (source.type === "b2" && dest.type === "local") return "b2-to-local";
-  if (source.type === "b2" && dest.type === "b2") return "b2-to-b2";
-  throw new Error(`Unsupported sync direction: ${source.type} to ${dest.type}`);
+	if (source.type === "local" && dest.type === "b2") return "local-to-b2";
+	if (source.type === "b2" && dest.type === "local") return "b2-to-local";
+	if (source.type === "b2" && dest.type === "b2") return "b2-to-b2";
+	throw new Error(`Unsupported sync direction: ${source.type} to ${dest.type}`);
 }
 async function* synchronize(config) {
-  const { source, dest, options } = config;
-  const direction = resolveDirection(source, dest);
-  const dryRun = options.dryRun ?? false;
-  const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;
-  const keepDays = options.keepDays ?? 0;
-  const compareThreshold = options.compareThreshold ?? 0;
-  const nowMillis = Date.now();
-  const factory = createActionFactory(config);
-  const actions = [];
-  for await (const pair of zipFolders(source, dest)) {
-    if (options.signal?.aborted) return;
-    for (const action of generateActions(
-      pair,
-      direction,
-      options.compareMode,
-      options.keepMode,
-      keepDays,
-      nowMillis,
-      factory,
-      compareThreshold
-    )) {
-      actions.push(action);
-    }
-    yield { type: "compare", path: (pair[0] ?? pair[1])?.relativePath ?? "", size: 0 };
-  }
-  const sem = new Semaphore(concurrency);
-  const results = [];
-  const errors = [];
-  const promises = actions.map(async (action) => {
-    await sem.acquire();
-    try {
-      if (options.signal?.aborted) return;
-      const event = await action.execute(dryRun);
-      results.push(event);
-    } catch (err) {
-      const errorValue = toError(err);
-      errors.push(errorValue);
-      results.push({
-        type: "error",
-        path: action.relativePath,
-        size: 0,
-        message: errorValue.message
-      });
-    } finally {
-      sem.release();
-    }
-  });
-  await Promise.all(promises);
-  for (const event of results) {
-    yield event;
-  }
-  if (errors.length > 0) {
-    yield {
-      type: "error",
-      path: "",
-      size: 0,
-      message: `${errors.length} action(s) failed`
-    };
-  }
-}
+	const { source, dest, options } = config;
+	assertSupportedCompareMode(options.compareMode);
+	const direction = resolveDirection(source, dest);
+	const dryRun = options.dryRun ?? false;
+	const concurrency = normalizeSyncConcurrency(options.concurrency);
+	const keepDays = options.keepDays ?? 0;
+	const compareThreshold = options.compareThreshold ?? 0;
+	const nowMillis = Date.now();
+	const localRootContexts = await resolveLocalRootContexts(config);
+	const queuedEvents = [];
+	const failedPaths = [];
+	const failedPathSet = /* @__PURE__ */ new Set();
+	let errorCount = 0;
+	let failedPathOmittedCount = 0;
+	let scanHadError = false;
+	const runningActions = /* @__PURE__ */ new Set();
+	const scanEvents = {
+		events: [],
+		dropped: 0
+	};
+	const scanOptions = {
+		...options.include !== void 0 ? { include: options.include } : {},
+		...options.exclude !== void 0 ? { exclude: options.exclude } : {},
+		...options.signal !== void 0 ? { signal: options.signal } : {},
+		...options.maxScanEntries !== void 0 ? { maxScanEntries: options.maxScanEntries } : {},
+		...direction === "b2-to-local" ? { requireLocalSafePaths: true } : {},
+		onError: (event) => {
+			scanHadError = true;
+			recordSyncError(event);
+			queueEvent(event);
+		}
+	};
+	const factory = createActionFactory(config, localRootContexts);
+	const readB2Sha1 = dryRun ? void 0 : createB2Sha1Reader(config);
+	const actionAbortController = new AbortController();
+	const removeAbortForwarder = forwardAbortSignal(options.signal, actionAbortController);
+	let completed = false;
+	async function* finishAfterAbort() {
+		await drainActions();
+		yield* emitQueuedEvents();
+	}
+	try {
+		let pairs;
+		try {
+			pairs = await collectPairs();
+		} catch (err) {
+			await drainActions();
+			if (options.signal?.aborted) {
+				yield* finishAfterAbort();
+				return;
+			}
+			if (!scanHadError) {
+				yield* emitQueuedEvents();
+				throw err;
+			}
+			yield* emitQueuedEvents();
+			yield aggregateErrorEvent();
+			completed = true;
+			return;
+		}
+		yield* emitQueuedEvents();
+		const filesystemError = scanFilesystemError(scanEvents);
+		if (filesystemError !== void 0) throw filesystemError;
+		if (options.signal?.aborted) {
+			yield* finishAfterAbort();
+			return;
+		}
+		if (scanHadError) {
+			if (errorCount > 0) yield aggregateErrorEvent();
+			completed = true;
+			return;
+		}
+		if (options.compareMode === "sha1") {
+			const compareBatchSize = concurrency;
+			for (let index = 0; index < pairs.length; index += compareBatchSize) if (yield* emitSha1Batch(pairs.slice(index, index + compareBatchSize))) return;
+		} else for (let index = 0; index < pairs.length; index += concurrency) {
+			const items = pairs.slice(index, index + concurrency).map((pair) => planPreparedPair(pair, readyComparePair(pair)));
+			synchronizerTestHooks.afterNonSha1PlanBatch?.(items.length);
+			if (yield* emitPreparedItems(items)) return;
+		}
+		await drainActions();
+		yield* emitQueuedEvents();
+		if (errorCount > 0) yield aggregateErrorEvent();
+		completed = true;
+	} finally {
+		if (!completed) abortActionController(actionAbortController, new DOMException("Sync iterator closed", "AbortError"));
+		removeAbortForwarder();
+		await drainActions();
+	}
+	async function collectPairs() {
+		const pairs = [];
+		for await (const pair of zipFolders(source, dest, scanOptions, {
+			onSourceSkip(event) {
+				bufferScanEvent(scanEvents, event, direction, "source");
+			},
+			onDestSkip(event) {
+				bufferScanEvent(scanEvents, event, direction, "dest");
+			}
+		})) {
+			if (options.signal?.aborted) return pairs;
+			validateB2SourcePairPrefix(pair, config);
+			pairs.push(pair);
+		}
+		return pairs;
+	}
+	async function* emitSha1Batch(batch) {
+		if (batch.length === 0) return false;
+		await drainActions();
+		yield* emitQueuedEvents();
+		const preparedBatch = await processPreparedBatch(batch);
+		if (yield* emitPreparedItems(preparedBatch.items)) return true;
+		if (preparedBatch.aborted || options.signal?.aborted) {
+			yield* finishAfterAbort();
+			return true;
+		}
+		return false;
+	}
+	async function* emitPreparedItems(items) {
+		for (const item of items) {
+			yield* emitQueuedEvents();
+			yield item.event;
+			yield* emitQueuedEvents();
+			/* v8 ignore next -- abort between compare yield and scheduling is timing-dependent */
+			if (options.signal?.aborted) {
+				yield* finishAfterAbort();
+				return true;
+			}
+			for (const action of item.actions) {
+				await scheduleAction(action);
+				yield* emitQueuedEvents();
+			}
+		}
+		return false;
+	}
+	async function processPreparedBatch(batch) {
+		if (batch.length === 0) return {
+			items: [],
+			aborted: false
+		};
+		const preparedPairs = await preparePairsForCompare(batch, "sha1", {
+			concurrency,
+			...options.signal !== void 0 ? { signal: options.signal } : {},
+			...options.sha1ReadTimeoutMillis !== void 0 ? { sha1ReadTimeoutMillis: options.sha1ReadTimeoutMillis } : {},
+			readLocalSha1: readLocalSha1File,
+			...readB2Sha1 !== void 0 ? { readB2Sha1 } : {}
+		});
+		const items = [];
+		for (const { originalPair, prepared } of preparedPairs) {
+			if (prepared.aborted || options.signal?.aborted) return {
+				items,
+				aborted: true
+			};
+			items.push(planPreparedPair(originalPair, prepared));
+		}
+		return {
+			items,
+			aborted: false
+		};
+	}
+	function planPreparedPair(pair, prepared) {
+		const event = {
+			type: "compare",
+			path: (pair[0] ?? pair[1])?.relativePath ?? "",
+			size: 0,
+			bytesHashed: prepared.bytesHashed,
+			...prepared.bytesVerified > 0 ? { bytesVerified: prepared.bytesVerified } : {}
+		};
+		let preparedErrorEventCount = 0;
+		for (const preparedEvent of prepared.events) {
+			queueEvent(preparedEvent);
+			if (preparedEvent.type === "error") {
+				preparedErrorEventCount++;
+				recordFailurePath(preparedEvent.path);
+			}
+		}
+		errorCount += prepared.errors.length;
+		for (let index = preparedErrorEventCount; index < prepared.errors.length; index++) recordFailurePath(event.path);
+		if (prepared.skipActionGeneration) return {
+			event,
+			actions: []
+		};
+		if ((scanHadError || scanHadFilesystemError(scanEvents)) && prepared.pair[0] === null && prepared.pair[1] !== null) return {
+			event,
+			actions: [new SkipAction(prepared.pair[1].relativePath, "not removed because scan errors occurred")]
+		};
+		if (sourceInventoryIncomplete(scanEvents) && prepared.pair[0] === null && prepared.pair[1] !== null) return {
+			event,
+			actions: [new SkipAction(prepared.pair[1].relativePath, scanEvents.sourceInventoryIncompleteMessage ?? "not removed because the source scan skipped unsafe B2 names")]
+		};
+		return {
+			event,
+			actions: [...generateActions(prepared.pair, direction, options.compareMode, options.keepMode, keepDays, nowMillis, factory, compareThreshold)]
+		};
+	}
+	async function scheduleAction(action) {
+		const task = executeAction(action).finally(() => {
+			runningActions.delete(task);
+		});
+		runningActions.add(task);
+		if (runningActions.size >= concurrency) await Promise.race(runningActions);
+	}
+	async function executeAction(action) {
+		try {
+			if (actionAbortController.signal.aborted) return;
+			queueEvent(await action.execute(dryRun, actionAbortController.signal));
+		} catch (err) {
+			const event = {
+				type: "error",
+				path: action.relativePath,
+				size: 0,
+				message: sanitizeErrorReason(err)
+			};
+			recordSyncError(event);
+			queueEvent(event);
+		}
+	}
+	function recordSyncError(event) {
+		errorCount += 1;
+		recordFailurePath(event.path);
+	}
+	function recordFailurePath(path) {
+		if (path === "") return;
+		if (failedPathSet.has(path)) return;
+		failedPathSet.add(path);
+		if (failedPaths.length < MAX_AGGREGATE_FAILED_PATHS) failedPaths.push(path);
+		else failedPathOmittedCount++;
+	}
+	function aggregateErrorEvent() {
+		return {
+			type: "error",
+			path: "",
+			size: 0,
+			message: `${errorCount} sync error(s) occurred`,
+			failureCount: errorCount,
+			failedPaths: [...failedPaths],
+			...failedPathOmittedCount > 0 ? { failedPathOmittedCount } : {}
+		};
+	}
+	function queueEvent(event) {
+		queuedEvents.push(event);
+	}
+	async function* emitQueuedEvents() {
+		yield* drainScanEvents(scanEvents);
+		for (const event of queuedEvents.splice(0)) yield event;
+	}
+	async function drainActions() {
+		while (runningActions.size > 0) await Promise.race(runningActions);
+	}
+}
+/**
+* Normalizes user-provided sync concurrency before it controls compare batches and transfers.
+*
+* @param value - Optional concurrency value from sync options.
+*
+* @returns A positive integer concurrency value.
+*
+* @throws When the configured concurrency is not a positive integer.
+*/
+function normalizeSyncConcurrency(value) {
+	const candidate = value ?? 4;
+	if (!Number.isInteger(candidate) || candidate < 1) throw new RangeError("Sync concurrency must be a positive integer");
+	return candidate;
+}
+function normalizeDownloadIdleTimeoutMillis(value) {
+	if (value === void 0) return DEFAULT_DOWNLOAD_IDLE_TIMEOUT_MILLIS;
+	if (value === Number.POSITIVE_INFINITY) return value;
+	if (!Number.isFinite(value) || value < 1) throw new RangeError("downloadIdleTimeoutMillis must be a positive finite number or Infinity");
+	return Math.floor(value);
+}
+function assertValidB2ContentLength(contentLength) {
+	if (!Number.isSafeInteger(contentLength) || contentLength < 0) throw new Error("B2 contentLength must be a non-negative safe integer");
+	return contentLength;
+}
+function createB2Sha1Reader(config) {
+	const upConfig = config;
+	const downConfig = config;
+	const bucket = upConfig.bucket ?? downConfig.bucket;
+	if (bucket === void 0) return void 0;
+	const readablePrefixes = b2ReadableRawPrefixes(config);
+	const idleTimeoutMillis = normalizeSha1TimeoutMillis(config.options.sha1ReadTimeoutMillis);
+	const verificationTimeoutMillis = normalizeSha1TimeoutMillis(config.options.sha1VerificationTimeoutMillis, DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS);
+	return async (path, signal) => {
+		const expectedBytes = assertValidB2ContentLength(path.selectedVersion.contentLength);
+		const maxBytes = normalizeSha1VerificationMaxBytes(expectedBytes, config.options.sha1VerificationMaxBytes);
+		return withSha1VerificationDeadline(signal, verificationTimeoutMillis, async (deadlineSignal) => {
+			deadlineSignal.throwIfAborted();
+			if (maxBytes < expectedBytes) throw new Error(`sha1 B2 verification skipped because contentLength ${expectedBytes} exceeds ${maxBytes} byte verification budget`);
+			const serverSideEncryption = toSseCDownloadKey(config.options.encryptionProvider?.getSettingForDownload(path.selectedVersion));
+			const fileName = validateB2SyncPathInAnyPrefix(readablePrefixes, path, "read");
+			const verified = await hashReadableStreamSha1((await bucket.file(fileName).downloadById(path.selectedVersion.fileId, {
+				...serverSideEncryption !== void 0 ? { serverSideEncryption } : {},
+				signal: deadlineSignal
+			})).body, deadlineSignal, {
+				idleTimeoutMillis,
+				maxBytes,
+				expectedBytes
+			});
+			return {
+				contentSha1: verified.contentSha1,
+				bytesRead: verified.bytesRead
+			};
+		});
+	};
+}
+function forwardAbortSignal(source, controller) {
+	if (source === void 0) return () => void 0;
+	if (source.aborted) {
+		abortActionController(controller, source.reason);
+		return () => void 0;
+	}
+	const abort = () => abortActionController(controller, source.reason);
+	source.addEventListener("abort", abort, { once: true });
+	return () => source.removeEventListener("abort", abort);
+}
+function abortActionController(controller, reason) {
+	if (!controller.signal.aborted) controller.abort(reason);
+}
+/**
+* Narrowing assertion that a `Bucket` is present for an action that requires
+* it. Throws with a consistent, context-tagged message when the configured
+* direction did not supply one (e.g. `b2-to-local` direction asking for an
+* upload action).
+*
+* Uses TypeScript's `asserts` signature so call-site flow narrows
+* `bucket` from `Bucket | undefined` to `Bucket` after the check, without
+* requiring a separate `if (!bucket) throw ...` line per action factory.
+*
+* @param bucket - The (possibly missing) bucket reference.
+* @param context - Short verb describing the action being constructed
+*   (e.g. `'upload'`, `'download'`). Surfaced in the error message.
+*
+* @throws `Error` when `bucket` is `undefined` or `null`.
+*/
 function assertBucket(bucket, context) {
-  if (!bucket) throw new Error(`Bucket required for ${context} actions`);
-}
-function createActionFactory(config) {
-  const upConfig = config;
-  const downConfig = config;
-  const destBucket = upConfig.bucket ?? downConfig.bucket;
-  const bucketIsLocked = destBucket?.info?.fileLockConfiguration?.value?.isFileLockEnabled ?? false;
-  const factory = {
-    upload(source) {
-      const bucket = upConfig.bucket;
-      const prefix = upConfig.prefix ?? "";
-      assertBucket(bucket, "upload");
-      return new UploadAction(
-        source.relativePath,
-        source.absolutePath,
-        source.size,
-        async (absPath, relPath) => {
-          const { readFile } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
-          const data = await readFile(absPath);
-          await bucket.upload({
-            fileName: `${prefix}${relPath}`,
-            source: new BufferSource(new Uint8Array(data))
-          });
-        }
-      );
-    },
-    download(source) {
-      const bucket = downConfig.bucket;
-      const root = downConfig.dest?.type === "local" ? downConfig.dest.root : "";
-      assertBucket(bucket, "download");
-      return new DownloadAction(source.relativePath, source.size, async (relPath) => {
-        const result = await bucket.download(source.selectedVersion.fileName);
-        const reader = result.body.getReader();
-        let combined;
-        try {
-          const chunks = [];
-          while (true) {
-            const { done, value } = await reader.read();
-            if (done) break;
-            chunks.push(value);
-          }
-          let total = 0;
-          for (const c of chunks) total += c.byteLength;
-          combined = new Uint8Array(total);
-          let offset = 0;
-          for (const c of chunks) {
-            combined.set(c, offset);
-            offset += c.byteLength;
-          }
-        } finally {
-          reader.releaseLock();
-        }
-        const { mkdir, writeFile } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
-        const { dirname, join } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19));
-        const destPath = join(root, relPath);
-        await mkdir(dirname(destPath), { recursive: true });
-        await writeFile(destPath, combined);
-      });
-    },
-    copy(source, destPath) {
-      const bucket = upConfig.bucket;
-      assertBucket(bucket, "copy");
-      return new CopyAction(source.relativePath, source.size, async () => {
-        await bucket.copyFile({
-          sourceFileId: source.selectedVersion.fileId,
-          fileName: destPath
-        });
-      });
-    },
-    hide(path) {
-      const bucket = upConfig.bucket ?? downConfig.bucket;
-      assertBucket(bucket, "hide");
-      return new HideAction(path, async (relPath) => {
-        const prefix = upConfig.prefix ?? "";
-        await bucket.hideFile(`${prefix}${relPath}`);
-      });
-    },
-    deleteRemote(path) {
-      const bucket = upConfig.bucket ?? downConfig.bucket;
-      assertBucket(bucket, "delete");
-      const b2FileName = path.selectedVersion.fileName;
-      return new DeleteRemoteAction(
-        path.relativePath,
-        path.selectedVersion.fileId,
-        async (fileId$1) => {
-          await bucket.deleteFileVersion(b2FileName, fileId(fileId$1));
-        }
-      );
-    },
-    deleteLocal(path) {
-      return new DeleteLocalAction(path.relativePath, path.absolutePath, async (absPath) => {
-        const { unlink } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
-        await unlink(absPath);
-      });
-    },
-    removeOrphan(dest) {
-      return bucketIsLocked ? factory.hide(dest.relativePath) : factory.deleteRemote(dest);
-    }
-  };
-  return factory;
-}
-
-//# sourceMappingURL=synchronizer.js.map
+	if (!bucket) throw new Error(`Bucket required for ${context} actions`);
+}
+/**
+* Returns the root for a local sync folder required by an action.
+*
+* @param folder - The configured folder to validate.
+* @param role - Whether the local folder is the source or destination.
+* @param context - Short verb describing the action being constructed.
+*
+* @returns The local filesystem root.
+*
+* @throws `Error` when the folder is not local or has no root.
+*/
+function requireLocalRoot(folder, role, context) {
+	const root = folder?.type === "local" ? folder.root : void 0;
+	if (typeof root !== "string" || root === "") throw new Error(`Local ${role} root required for ${context} actions`);
+	return root;
+}
+async function resolveLocalRootContexts(config) {
+	const sourceIsLocalFilesystem = isLocalFilesystemFolder(config.source);
+	const destIsLocalFilesystem = isLocalFilesystemFolder(config.dest);
+	if (!sourceIsLocalFilesystem && !destIsLocalFilesystem) return {};
+	const sourceContext = config.dest.type === "b2" ? "upload" : "sync";
+	const destContext = config.source.type === "b2" ? "download" : "sync";
+	return {
+		...sourceIsLocalFilesystem ? { source: await resolveLocalRootContext(requireLocalRoot(config.source, "source", sourceContext)) } : {},
+		...destIsLocalFilesystem ? { dest: await resolveLocalRootContext(requireLocalRoot(config.dest, "destination", destContext)) } : {}
+	};
+}
+async function resolveLocalRootContext(root) {
+	const { realpath, stat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	const { resolve } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19));
+	const safeRoot = resolve(root);
+	const realPath = await realpath(safeRoot).catch((err) => {
+		if (isNotFoundError(err)) return safeRoot;
+		throw err;
+	});
+	const stats = await stat(realPath).catch((err) => {
+		if (isNotFoundError(err)) return void 0;
+		throw err;
+	});
+	if (stats !== void 0 && !stats.isDirectory()) throw new Error("Local sync root is not a directory");
+	return {
+		root: safeRoot,
+		realPath,
+		...stats === void 0 ? {} : { identity: {
+			deviceId: stats.dev,
+			inode: stats.ino
+		} }
+	};
+}
+function isLocalFilesystemFolder(folder) {
+	return folder?.type === "local" && isLocalFilesystemRoot(folder);
+}
+/**
+* Narrows a setting to SSE-C; non-SSE-C source settings need no key on read.
+*
+* @param setting - Provider-supplied encryption setting, or undefined.
+*
+* @returns The SSE-C setting when one is provided; otherwise undefined.
+*/
+function toSseCEncryptionSetting(setting) {
+	if (setting?.mode !== "SSE-C") return void 0;
+	return setting;
+}
+/**
+* Returns a download key from SSE-C settings; non-SSE-C downloads need no key.
+*
+* @param setting - Provider-supplied encryption setting, or undefined.
+*
+* @returns A download key for SSE-C files; otherwise undefined.
+*/
+function toSseCDownloadKey(setting) {
+	return toSseCEncryptionSetting(setting);
+}
+/**
+* Creates a configured sync engine wired to the bucket and paths in the given config.
+*
+* For sync operations that may need to remove destination-only files (the
+* `keepMode: 'delete'` policy), the factory reads the destination
+* bucket's cached `fileLockConfiguration` once so `removeOrphan` can
+* dispatch to either `hide` (locked buckets) or `deleteFileVersion`
+* (vanilla buckets) without a per-file branch. The cache is whatever
+* `client.listBuckets()` or `client.createBucket()` returned — callers
+* who flipped lock state mid-sync (rare) should refresh before
+* synchronize().
+*
+* @param config - Synchronizer configuration containing source, destination, and options.
+* @param localRootContexts - Resolved filesystem roots captured before action creation.
+*
+* @returns An action factory bound to the provided configuration.
+*/
+function createActionFactory(config, localRootContexts) {
+	const upConfig = config;
+	const downConfig = config;
+	const uploadPrefix = asRawB2KeyPrefix(upConfig.prefix ?? b2FolderRawPrefix(config.dest) ?? "");
+	const sourceB2Prefix = b2FolderRawPrefix(config.source);
+	const bucketIsLocked = (upConfig.bucket ?? downConfig.bucket)?.info?.fileLockConfiguration?.value?.isFileLockEnabled ?? false;
+	const factory = {
+		upload(source, dest) {
+			const bucket = upConfig.bucket;
+			assertBucket(bucket, "upload");
+			return new UploadAction(source.relativePath, source.absolutePath, source.size, async (absPath, relPath, signal) => {
+				const rootContext = localRootContexts.source;
+				const root = rootContext?.root ?? upConfig.source.root ?? "";
+				const fileName = dest !== void 0 ? validateB2SyncPathInPrefix(uploadPrefix, dest) : `${uploadPrefix}${relPath}`;
+				if (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, relPath, { allowSymlinkRoot: true });
+				const targetPath = rootContext === void 0 ? await resolveContainedLocalPath(root, source.relativePath, absPath) : await resolveContainedLocalPath(rootContext.realPath, source.relativePath);
+				synchronizer_throwIfAborted(signal);
+				const fileSource = await createValidatedUploadFileSource(source, targetPath);
+				synchronizer_throwIfAborted(signal);
+				const serverSideEncryption = config.options.encryptionProvider?.getSettingForUpload(fileName, fileSource.size);
+				await bucket.upload({
+					fileName,
+					source: fileSource,
+					...serverSideEncryption !== void 0 ? { serverSideEncryption } : {},
+					...signal !== void 0 ? { signal } : {}
+				});
+			});
+		},
+		download(source, scannedDest) {
+			const bucket = downConfig.bucket;
+			assertBucket(bucket, "download");
+			return new DownloadAction(source.relativePath, source.size, async (relPath, signal) => {
+				const rootContext = localRootContexts.dest;
+				const root = rootContext?.root ?? downConfig.dest.root ?? "";
+				safeRelativePathSegments(relPath);
+				const b2FileName = sourceB2Prefix === void 0 ? source.selectedVersion.fileName : validateB2SyncPathInPrefix(sourceB2Prefix, source, "read");
+				const idleTimeoutMillis = normalizeDownloadIdleTimeoutMillis(config.options.downloadIdleTimeoutMillis);
+				const expectedBytes = assertValidB2ContentLength(source.selectedVersion.contentLength);
+				if (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, relPath, { allowSymlinkRoot: false });
+				await ensureLocalSyncRootDirectory(root, relPath);
+				const serverSideEncryption = toSseCDownloadKey(config.options.encryptionProvider?.getSettingForDownload(source.selectedVersion));
+				const result = await bucket.file(b2FileName).downloadById(source.selectedVersion.fileId, {
+					...serverSideEncryption !== void 0 ? { serverSideEncryption } : {},
+					...signal !== void 0 ? { signal } : {}
+				});
+				try {
+					await writeLocalStreamInsideRoot(root, relPath, result.body, {
+						expectedBytes,
+						...scannedDest !== void 0 ? { expectedDestination: scannedDest } : {},
+						idleTimeoutMillis,
+						...signal !== void 0 ? { signal } : {}
+					});
+				} catch (err) {
+					await cancelReadableStreamBody(result.body, err);
+					throw err;
+				}
+			});
+		},
+		copy(source, destRelativePath) {
+			return copyToB2Key(source, `${uploadPrefix}${destRelativePath}`);
+		},
+		copyB2Path(source, dest) {
+			return copyToB2Key(source, validateB2SyncPathInPrefix(uploadPrefix, dest));
+		},
+		hide(path) {
+			const bucket = upConfig.bucket ?? downConfig.bucket;
+			assertBucket(bucket, "hide");
+			return new HideAction(path, async (_relPath, signal) => {
+				await bucket.hideFile(`${uploadPrefix}${path}`, signal === void 0 ? void 0 : { signal });
+			});
+		},
+		hideB2Path(path) {
+			const bucket = upConfig.bucket ?? downConfig.bucket;
+			assertBucket(bucket, "hide");
+			const b2FileName = validateB2SyncPathInPrefix(uploadPrefix, path);
+			return new HideAction(path.relativePath, async (_relPath, signal) => {
+				await bucket.hideFile(b2FileName, signal === void 0 ? void 0 : { signal });
+			});
+		},
+		deleteRemote(path) {
+			const bucket = upConfig.bucket ?? downConfig.bucket;
+			assertBucket(bucket, "delete");
+			const b2FileName = validateB2SyncPathInPrefix(uploadPrefix, path);
+			return new DeleteRemoteAction(path.relativePath, path.selectedVersion.fileId, async (fileId$1, _fileName, signal) => {
+				await bucket.deleteFileVersion(b2FileName, fileId(fileId$1), signal === void 0 ? void 0 : { signal });
+			});
+		},
+		deleteLocal(path) {
+			const rootContext = localRootContexts.dest;
+			const root = rootContext?.root ?? localSyncRoot(downConfig.dest);
+			return new DeleteLocalAction(path.relativePath, path.absolutePath, async (absPath, signal) => {
+				signal?.throwIfAborted();
+				if (absPath !== path.absolutePath) throw new Error(`Refusing to delete outside sync root: ${path.relativePath}`);
+				signal?.throwIfAborted();
+				try {
+					if (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, path.relativePath, { allowSymlinkRoot: false });
+					await deleteLocalFileInsideRoot(root, path);
+				} catch (err) {
+					if (isLocalDeleteSafetyError(err)) throw err;
+					throw new Error(`failed to delete local file: ${localFilesystemErrorReason(err)}`);
+				}
+			});
+		},
+		removeOrphan(dest) {
+			return bucketIsLocked ? factory.hideB2Path?.(dest) ?? factory.hide(dest.relativePath) : factory.deleteRemote(dest);
+		}
+	};
+	function copyToB2Key(source, targetPath) {
+		const bucket = upConfig.bucket;
+		assertBucket(bucket, "copy");
+		return new CopyAction(source.relativePath, source.size, async (_relPath, signal) => {
+			if (sourceB2Prefix !== void 0) validateB2SyncPathInPrefix(sourceB2Prefix, source, "read");
+			const destinationServerSideEncryption = config.options.encryptionProvider?.getSettingForUpload(targetPath, source.size);
+			const sourceServerSideEncryption = toSseCEncryptionSetting(config.options.encryptionProvider?.getSettingForDownload(source.selectedVersion));
+			await bucket.copyFile({
+				sourceFileId: source.selectedVersion.fileId,
+				fileName: targetPath,
+				...destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption } : {},
+				...sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption } : {},
+				...signal !== void 0 ? { signal } : {}
+			});
+		});
+	}
+	return factory;
+}
+async function createValidatedUploadFileSource(source, absolutePath) {
+	try {
+		const fileSource = await FileSource.fromPath(absolutePath);
+		await validateScannedLocalFile({
+			...source,
+			absolutePath
+		});
+		return fileSource;
+	} catch (err) {
+		throw normalizeLocalUploadSourceError(err);
+	}
+}
+function normalizeLocalUploadSourceError(err) {
+	if (err instanceof Error && err.message.startsWith("local file changed before upload")) return err;
+	const message = err instanceof Error ? err.message : String(err);
+	if (message.includes("not a regular file")) return /* @__PURE__ */ new Error("local file changed before upload: not a regular file");
+	if (message.includes("changed") || message.includes("modified")) return /* @__PURE__ */ new Error("local file changed before upload");
+	return /* @__PURE__ */ new Error(`local file changed before upload: ${sanitizeErrorReason(err)}`);
+}
+function localSyncRoot(folder) {
+	return folder?.type === "local" ? folder.root : "";
+}
+function b2FolderRawPrefix(folder) {
+	if (folder?.type !== "b2") return void 0;
+	const rawPrefix = folder.rawPrefix;
+	return typeof rawPrefix === "string" ? rawPrefix : void 0;
+}
+function validateB2SourcePairPrefix(pair, config) {
+	const [source] = pair;
+	if (config.source.type !== "b2" || source === null || !synchronizer_isB2SyncPath(source)) return;
+	const sourcePrefix = b2FolderRawPrefix(config.source);
+	if (sourcePrefix === void 0) return;
+	validateB2SyncPathInPrefix(sourcePrefix, source, "read");
+}
+function b2ReadableRawPrefixes(config) {
+	const prefixes = [];
+	const sourcePrefix = b2FolderRawPrefix(config.source);
+	if (config.source.type === "b2") prefixes.push(sourcePrefix ?? "");
+	const upConfig = config;
+	if (config.dest.type === "b2") prefixes.push(upConfig.prefix ?? b2FolderRawPrefix(config.dest) ?? "");
+	return [...new Set(prefixes.map((prefix) => asRawB2KeyPrefix(prefix)))];
+}
+function validateB2SyncPathInAnyPrefix(prefixes, path, operation) {
+	let firstError = /* @__PURE__ */ new Error(`Refusing to ${operation} B2 key: ${path.relativePath}`);
+	for (const prefix of prefixes) try {
+		return validateB2SyncPathInPrefix(prefix, path, operation);
+	} catch (err) {
+		if (err instanceof Error) firstError = err;
+	}
+	throw firstError;
+}
+function validateB2SyncPathInPrefix(prefix, path, operation = "mutate") {
+	const fileName = path.selectedVersion.fileName;
+	if (!fileName.startsWith(prefix)) throw new Error(`Refusing to ${operation} B2 key outside configured prefix: ${path.relativePath}`);
+	if (b2KeyToRelativePathUnderPrefix(prefix, fileName) !== path.relativePath) throw new Error(`Refusing to ${operation} mismatched B2 key for sync path: ${path.relativePath}`);
+	return fileName;
+}
+function synchronizer_isB2SyncPath(path) {
+	return "selectedVersion" in path;
+}
+function synchronizer_throwIfAborted(signal) {
+	if (signal?.aborted === true) throw signal.reason ?? new DOMException("Aborted", "AbortError");
+}
+async function cancelReadableStreamBody(body, reason) {
+	if (body.locked) return;
+	try {
+		await body.cancel(reason);
+	} catch {}
+}
+async function assertLocalRootContextCurrent(context, relativePath, options) {
+	if (context.identity === void 0) return;
+	const { lstat, realpath, stat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	let currentRealPath;
+	try {
+		const rootLinkStats = await lstat(context.root);
+		if (!options.allowSymlinkRoot && rootLinkStats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`);
+		currentRealPath = await realpath(context.root);
+	} catch (err) {
+		if (err instanceof Error && err.message.startsWith("Refusing to access sync root")) throw err;
+		throw new Error(`Local sync root changed before filesystem action: ${relativePath}`);
+	}
+	if (currentRealPath !== context.realPath) throw new Error(`Local sync root changed before filesystem action: ${relativePath}`);
+	let currentStats;
+	try {
+		currentStats = await stat(context.realPath);
+	} catch {
+		throw new Error(`Local sync root changed before filesystem action: ${relativePath}`);
+	}
+	if (!currentStats.isDirectory() || currentStats.dev !== context.identity.deviceId || currentStats.ino !== context.identity.inode) throw new Error(`Local sync root changed before filesystem action: ${relativePath}`);
+}
+async function ensureLocalSyncRootDirectory(root, relativePath) {
+	if (root === "") throw new Error("Local sync root required for filesystem mutation");
+	const { lstat, mkdir } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	const { resolve } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19));
+	const safeRoot = resolve(root);
+	try {
+		const stats = await lstat(safeRoot);
+		if (stats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`);
+		if (!stats.isDirectory()) throw new Error(`Local sync root is not a directory: ${relativePath}`);
+		return;
+	} catch (error) {
+		if (!isNotFoundError(error)) throw error;
+	}
+	await mkdir(safeRoot, { recursive: true });
+	await assertLocalRootHasNoSymlink(safeRoot, relativePath);
+}
+function bufferScanEvent(buffer, event, direction, scanSide) {
+	if (event.type === "skip" && event.reason === "filesystem-error") buffer.fatalFilesystemErrorMessage ??= event.message;
+	if (sourceSkipMakesInventoryIncomplete(event, direction, scanSide)) buffer.sourceInventoryIncompleteMessage ??= sourceInventoryIncompleteMessage(direction);
+	if (buffer.events.length < MAX_BUFFERED_SCAN_EVENTS) buffer.events.push(event);
+	else buffer.dropped++;
+}
+function* drainScanEvents(buffer) {
+	while (buffer.events.length > 0) {
+		const event = buffer.events.shift();
+		if (event) yield event;
+	}
+	if (buffer.dropped > 0) {
+		yield {
+			type: "skip",
+			path: "",
+			size: 0,
+			reason: "scan-skip-overflow",
+			message: `${buffer.dropped} scanner skip event(s) were omitted after ${MAX_BUFFERED_SCAN_EVENTS} buffered diagnostics`
+		};
+		buffer.dropped = 0;
+	}
+}
+function scanHadFilesystemError(scanEvents) {
+	return scanEvents.fatalFilesystemErrorMessage !== void 0;
+}
+function sourceInventoryIncomplete(scanEvents) {
+	return scanEvents.sourceInventoryIncompleteMessage !== void 0;
+}
+function scanFilesystemError(scanEvents) {
+	return scanEvents.fatalFilesystemErrorMessage === void 0 ? void 0 : new Error(scanEvents.fatalFilesystemErrorMessage);
+}
+function sourceSkipMakesInventoryIncomplete(event, direction, scanSide) {
+	if (scanSide !== "source" || event.type !== "skip") return false;
+	if (direction === "local-to-b2") return event.reason === "unsafe-name" || event.reason === "stale-download-partial" || event.reason === "path-too-long-for-regexp";
+	if (direction === "b2-to-local" || direction === "b2-to-b2") return event.reason === "unsafe-name" || event.reason === "local-unsafe-name" || event.reason === "relative-path-collision" || event.reason === "local-path-collision" || event.reason === "path-too-long-for-regexp";
+	return false;
+}
+function sourceInventoryIncompleteMessage(direction) {
+	return direction === "local-to-b2" ? "not removed because the source scan skipped local paths" : "not removed because the source scan skipped unsafe B2 names";
+}
+function isLocalDeleteSafetyError(err) {
+	if (!(err instanceof Error)) return false;
+	return err.message === "Local sync root required for filesystem mutation" || err.message.startsWith("Local sync root changed before filesystem action: ") || err.message.startsWith("Refusing to ") || err.message.startsWith("Local sync root is not a directory: ") || err.message.startsWith("unsafe local delete path: ");
+}
+async function resolveContainedLocalPath(root, relativePath, absolutePath) {
+	if (root === "") throw new Error("Local sync root required for filesystem mutation");
+	const { isAbsolute, relative, resolve, sep } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19));
+	const safeRoot = resolve(root);
+	const target = absolutePath === void 0 ? resolve(safeRoot, relativePath) : resolve(absolutePath);
+	const pathFromRoot = relative(safeRoot, target);
+	/* v8 ignore next -- defense-in-depth after prior no-follow and symlink checks. */
+	if (pathFromRoot === ".." || pathFromRoot.startsWith(`..${sep}`) || isAbsolute(pathFromRoot)) throw new Error(`Refusing to access path outside sync root: ${relativePath}`);
+	await assertLocalRootHasNoSymlink(safeRoot, relativePath);
+	await assertPathHasNoSymlinkComponents(safeRoot, pathFromRoot, relativePath);
+	return target;
+}
+async function assertLocalRootHasNoSymlink(safeRoot, relativePath) {
+	const { lstat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	try {
+		if ((await lstat(safeRoot)).isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`);
+	} catch (error) {
+		if (isNotFoundError(error)) return;
+		throw error;
+	}
+}
+async function assertPathHasNoSymlinkComponents(safeRoot, pathFromRoot, relativePath) {
+	if (pathFromRoot === "") return;
+	const { lstat } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19));
+	const { join, sep } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19));
+	let current = safeRoot;
+	for (const segment of pathFromRoot.split(sep)) {
+		current = join(current, segment);
+		let stats;
+		try {
+			stats = await lstat(current);
+		} catch (error) {
+			if (isNotFoundError(error)) return;
+			throw error;
+		}
+		if (stats.isSymbolicLink()) throw new Error(`Refusing to access path through symlink: ${relativePath}`);
+	}
+}
+function isNotFoundError(error) {
+	return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
+}
+//#endregion
 
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/local.js
 
+//# sourceMappingURL=synchronizer.js.map
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/local.js
+
+
+
+
+
+
+
+
+
+
+//#region src/sync/scanners/local.ts
+/**
+* Scans a local directory tree and yields {@link LocalSyncPath} entries sorted by relative path.
+* A root directory read failure aborts the scan with an error diagnostic. Per-entry file or
+* directory failures are reported through `onError` and the scan continues over readable siblings.
+* SDK-managed partial download file names are skipped so unfinished internal
+* temp files are not synchronized.
+* The current implementation collects matching entries before sorting, so memory usage is
+* proportional to the number of matched files.
+*/
+var LocalFolder = class {
+	type = "local";
+	appliesScanFilters = true;
+	appliesScanSorting = true;
+	/** Resolved absolute path to the local root directory. */
+	root;
+	/**
+	* Creates a new LocalFolder for the given root directory.
+	* @param root - Absolute or relative path to the local directory to scan.
+	*/
+	constructor(root) {
+		this.root = resolvePathAtConstruction(root);
+		registerLocalFilesystemRoot(this);
+	}
+	/**
+	* Recursively walks the directory and yields files in sync path order.
+	* @param options - Optional scan controls.
+	*/
+	async *scan(options = {}) {
+		validateSyncFilters(options);
+		const nodeDeps = await loadLocalNodeDeps();
+		const root = nodeDeps.resolve(this.root);
+		const collected = [];
+		await this.walk(root, root, collected, options, scanEntryLimit(options), nodeDeps);
+		collected.sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath));
+		for (const entry of collected) {
+			throwIfScanAborted(options);
+			yield entry;
+		}
+	}
+	/**
+	* Recursively collects files from {@link dir} into {@link out}.
+	* @param root - Resolved scan root used for relative path calculation.
+	* @param dir - Absolute path of the directory to scan.
+	* @param out - Accumulator array that receives discovered file entries.
+	* @param options - Optional scan controls.
+	* @param maxScanEntries - Maximum number of entries to retain before failing.
+	* @param nodeDeps - Lazy-loaded Node filesystem and path helpers.
+	*/
+	async walk(root, dir, out, options, maxScanEntries, nodeDeps) {
+		throwIfScanAborted(options);
+		let entries;
+		try {
+			entries = await nodeDeps.readdir(dir, { withFileTypes: true });
+		} catch (err) {
+			const error = this.emitScanError(options, relativePathFromRoot(root, dir, nodeDeps), "directory", err);
+			if (dir === root) throw error;
+			return;
+		}
+		for (const entry of entries) {
+			throwIfScanAborted(options);
+			const fullPath = nodeDeps.join(dir, entry.name);
+			const rel = relativePathFromRoot(root, fullPath, nodeDeps);
+			if (isDownloadStagingDirectorySegment(rel) && entry.isDirectory() && isDownloadStagingDirectorySegment(entry.name) && await isManagedDownloadStagingRoot(fullPath)) continue;
+			if (rel.includes("\\")) {
+				emitScannerSkip(options, {
+					type: "skip",
+					path: rel,
+					size: 0,
+					reason: "unsafe-name",
+					message: `Skipped local path ${JSON.stringify(rel)}: backslashes are not safe sync path characters`
+				});
+				continue;
+			}
+			if (isReservedSyncTempFileName(entry.name)) {
+				emitScannerSkip(options, {
+					type: "skip",
+					path: rel,
+					size: 0,
+					reason: "stale-download-partial",
+					message: `Skipped local path ${JSON.stringify(rel)}: reserved SDK partial download file`
+				});
+				continue;
+			}
+			if (entry.isDirectory()) {
+				if (directoryMayContainSyncPaths(rel, options)) await this.walk(root, fullPath, out, options, maxScanEntries, nodeDeps);
+			} else if (entry.isFile()) {
+				if (!pathPassesSyncFilters(rel, options)) {
+					if (pathSkippedByRegExpInputLimit(rel, options)) emitScannerSkip(options, regexpInputTooLongSkip(rel));
+					continue;
+				}
+				let s;
+				try {
+					s = await nodeDeps.lstat(fullPath);
+					/* v8 ignore start -- lstat race after a Dirent file result is not deterministic */
+					if (!s.isFile()) {
+						this.emitScanError(options, rel, "file", /* @__PURE__ */ new Error("not a regular file"));
+						continue;
+					}
+				} catch (err) {
+					/* v8 ignore next -- stat TOCTOU failures are not deterministic to trigger */
+					this.emitScanError(options, relativePathFromRoot(root, fullPath, nodeDeps), "file", err);
+					continue;
+				}
+				assertScanEntryLimit(out.length + 1, maxScanEntries);
+				out.push({
+					relativePath: rel,
+					absolutePath: fullPath,
+					modTimeMillis: Math.floor(s.mtimeMs),
+					size: s.size,
+					fileIdentity: localFileIdentityFromStats(s)
+				});
+			}
+		}
+	}
+	emitScanError(options, path, kind, err) {
+		const event = {
+			type: "error",
+			path,
+			size: 0,
+			message: `failed to scan local ${kind}: ${localFilesystemErrorReason(err)}`
+		};
+		options.onError?.(event);
+		return new Error(event.message);
+	}
+};
+async function loadLocalNodeDeps() {
+	const [fsPromises, path] = await Promise.all([Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 1455, 19)), Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 6760, 19))]);
+	return {
+		readdir: fsPromises.readdir,
+		lstat: fsPromises.lstat,
+		join: path.join,
+		relative: path.relative,
+		resolve: path.resolve,
+		sep: path.sep
+	};
+}
+function resolvePathAtConstruction(root) {
+	const processLike = globalThis.process;
+	if (typeof processLike?.cwd !== "function") return root;
+	const cwd = processLike.cwd();
+	if (processLike.platform === "win32") return resolveWindowsPath(cwd, root);
+	return resolvePosixPath(cwd, root);
+}
+function resolvePosixPath(cwd, root) {
+	const resolved = normalizePathSegments((root.startsWith("/") ? root : `${cwd}/${root}`).split("/"), "/");
+	return resolved === "" ? "/" : `/${resolved}`;
+}
+function resolveWindowsPath(cwd, root) {
+	const normalizedRoot = root.replaceAll("/", "\\");
+	const normalizedCwd = cwd.replaceAll("/", "\\");
+	const drive = /^[A-Za-z]:/.exec(normalizedCwd)?.[0] ?? "";
+	const cwdUnc = splitUncPath(normalizedCwd);
+	if (/^\\\\/.test(normalizedRoot)) return normalizeUncPath(normalizedRoot);
+	if (/^[A-Za-z]:\\/.test(normalizedRoot)) return joinWindowsRoot(normalizedRoot.slice(0, 2), normalizePathSegments(normalizedRoot.slice(3).split("\\"), "\\"));
+	if (/^[A-Za-z]:/.test(normalizedRoot)) throw new Error("LocalFolder root must not be a drive-relative Windows path");
+	if (normalizedRoot.startsWith("\\")) {
+		const rest = normalizePathSegments(normalizedRoot.slice(1).split("\\"), "\\");
+		return joinWindowsRoot(cwdUnc?.prefix ?? drive, rest);
+	}
+	if (cwdUnc !== void 0) {
+		const resolved = normalizePathSegments([...cwdUnc.rest, ...normalizedRoot.split("\\")], "\\");
+		return joinWindowsRoot(cwdUnc.prefix, resolved);
+	}
+	const base = /^[A-Za-z]:\\/.test(normalizedCwd) ? normalizedCwd : `${drive}\\`;
+	const prefix = /^[A-Za-z]:/.exec(base)?.[0] ?? drive;
+	return joinWindowsRoot(prefix, normalizePathSegments([...base.slice(prefix.length).replace(/^\\/, "").split("\\"), ...normalizedRoot.split("\\")], "\\"));
+}
+function normalizeUncPath(path) {
+	const unc = splitUncPath(path);
+	if (unc === void 0) return path;
+	return joinWindowsRoot(unc.prefix, normalizePathSegments(unc.rest, "\\"));
+}
+function splitUncPath(path) {
+	if (!path.startsWith("\\\\")) return void 0;
+	const [server, share, ...rest] = path.split("\\").filter((part) => part !== "");
+	if (server === void 0 || share === void 0) return void 0;
+	return {
+		prefix: `\\\\${server}\\${share}`,
+		rest
+	};
+}
+function joinWindowsRoot(prefix, rest) {
+	return rest === "" ? `${prefix}\\` : `${prefix}\\${rest}`;
+}
+function normalizePathSegments(segments, separator) {
+	const out = [];
+	for (const segment of segments) {
+		if (segment === "" || segment === ".") continue;
+		if (segment === "..") {
+			out.pop();
+			continue;
+		}
+		out.push(segment);
+	}
+	return out.join(separator);
+}
+function relativePathFromRoot(root, path, nodeDeps) {
+	return nodeDeps.relative(root, path).split(nodeDeps.sep).join("/");
+}
+function throwIfScanAborted(options) {
+	if (options.signal?.aborted === true) throw options.signal.reason ?? new DOMException("Aborted", "AbortError");
+}
+//#endregion
 
-class LocalFolder {
-  type = "local";
-  /** Absolute path to the local root directory. */
-  root;
-  /**
-   * Creates a new LocalFolder for the given root directory.
-   * @param root - Absolute path to the local directory to scan.
-   */
-  constructor(root) {
-    this.root = root;
-  }
-  /** Recursively walks the directory and yields files sorted by relative path. */
-  async *scan() {
-    const collected = [];
-    await this.walk(this.root, collected);
-    collected.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
-    for (const entry of collected) {
-      yield entry;
-    }
-  }
-  /**
-   * Recursively collects files from {@link dir} into {@link out}.
-   * @param dir - Absolute path of the directory to scan.
-   * @param out - Accumulator array that receives discovered file entries.
-   */
-  async walk(dir, out) {
-    let entries;
-    try {
-      entries = await (0,promises_.readdir)(dir, { withFileTypes: true });
-    } catch {
-      return;
-    }
-    for (const entry of entries) {
-      const fullPath = (0,external_node_path_.join)(dir, entry.name);
-      if (entry.isDirectory()) {
-        await this.walk(fullPath, out);
-      } else if (entry.isFile()) {
-        try {
-          const s = await (0,promises_.stat)(fullPath);
-          const rel = (0,external_node_path_.relative)(this.root, fullPath).split(external_node_path_.sep).join("/");
-          out.push({
-            relativePath: rel,
-            absolutePath: fullPath,
-            modTimeMillis: Math.floor(s.mtimeMs),
-            size: s.size
-          });
-        } catch {
-        }
-      }
-    }
-  }
-}
 
 //# sourceMappingURL=local.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/file.js
-const FileAction = {
-  /** Large file upload started but not yet finished. */
-  Start: "start",
-  /** Normal upload (small or finished large file). */
-  Upload: "upload",
-  /** Hide marker (soft delete). */
-  Hide: "hide",
-  /** Virtual folder marker. */
-  Folder: "folder",
-  /** Created via server-side copy. */
-  Copy: "copy"
-};
-const MetadataDirective = {
-  /** Preserve the source file's contentType and fileInfo. */
-  Copy: "COPY",
-  /** Use the values provided in the copy request. */
-  Replace: "REPLACE"
+;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/b2.js
+
+
+
+
+
+
+
+
+
+
+
+//#region src/sync/scanners/b2.ts
+var MAX_EMPTY_B2_SCAN_PAGES = 100;
+/**
+* Scans a B2 bucket (optionally filtered by a raw B2 key prefix) and yields
+* {@link B2SyncPath} entries sorted by `compareSyncRelativePaths(relativePath)`. Hidden files are excluded.
+* Raw B2 file names are used only as an internal tie-breaker after collision handling.
+* All versions for the listed prefix are fetched, grouped, and sorted before
+* yielding; exclude filters are applied client-side and do not reduce that
+* B2 listing memory footprint.
+* SDK-reserved temporary names fail the scan because syncing them could corrupt
+* in-progress transfers.
+*/
+var B2Folder = class {
+	type = "b2";
+	appliesScanFilters = true;
+	appliesScanSorting = true;
+	/** Raw B2 key prefix this folder scans, preserving caller-provided separators verbatim. */
+	rawPrefix;
+	bucket;
+	/**
+	* Creates a new B2Folder for the given bucket and optional prefix.
+	* @param bucket - The B2 bucket to scan.
+	* @param prefix - Optional raw B2 key prefix to restrict the scan scope.
+	* Backslashes are preserved as raw B2 key characters; pass `/` explicitly for slash prefixes.
+	*/
+	constructor(bucket, prefix = "") {
+		this.bucket = bucket;
+		this.rawPrefix = asRawB2KeyPrefix(prefix);
+	}
+	/**
+	* Lists all file versions in the bucket, groups by name, and yields the latest visible version.
+	* @param options - Optional scan controls.
+	*/
+	async *scan(options = {}) {
+		validateSyncFilters(options);
+		const maxScanEntries = scanEntryLimit(options);
+		const grouped = /* @__PURE__ */ new Map();
+		const listPrefix = this.listPrefixFor(options);
+		let listedVersions = 0;
+		let startFileName;
+		let startFileId;
+		let emptyPageCount = 0;
+		while (true) {
+			if (scanIsAborted(options)) return;
+			let listing;
+			try {
+				listing = await this.bucket.listFileVersions({
+					...listPrefix !== "" ? { prefix: listPrefix } : {},
+					...startFileName !== void 0 ? { startFileName } : {},
+					...startFileId !== void 0 ? { startFileId } : {},
+					...options.signal !== void 0 ? { signal: options.signal } : {}
+				});
+			} catch (err) {
+				if (scanIsAborted(options) || local_sha1_isAbortError(err)) return;
+				throw emitScanError(options, "failed to scan B2 file versions", err);
+			}
+			if (scanIsAborted(options)) return;
+			if (listing.files.length === 0) {
+				emptyPageCount++;
+				if (emptyPageCount > MAX_EMPTY_B2_SCAN_PAGES) throw emitScanError(options, "failed to scan B2 file versions", /* @__PURE__ */ new Error("B2 pagination returned too many empty pages"));
+			} else emptyPageCount = 0;
+			for (const fv of listing.files) {
+				if (scanIsAborted(options)) return;
+				assertScanEntryLimit(listedVersions + 1, maxScanEntries);
+				listedVersions++;
+				if (this.rawPrefix !== "" && !fv.fileName.startsWith(this.rawPrefix)) {
+					this.emitSkip(options, fv.fileName, fv.fileName, "outside-prefix", `listed object is outside configured B2 prefix ${JSON.stringify(this.rawPrefix)}`);
+					continue;
+				}
+				if (options.requireLocalSafePaths === true && fv.fileName.includes("\\")) {
+					this.emitSkip(options, fv.fileName, fv.fileName, "local-unsafe-name", "object name contains a backslash that is unsafe for local filesystem destinations");
+					continue;
+				}
+				const relativePath = this.tryToRelativePath(fv.fileName);
+				if (relativePath === null) {
+					this.emitSkip(options, fv.fileName, fv.fileName, "unsafe-name", "object name cannot be represented as a safe sync relative path");
+					continue;
+				}
+				if (!pathPassesSyncFilters(relativePath, options)) {
+					if (pathSkippedByRegExpInputLimit(relativePath, options)) emitScannerSkip(options, {
+						...regexpInputTooLongSkip(relativePath),
+						b2FileName: fv.fileName
+					});
+					continue;
+				}
+				const existing = grouped.get(fv.fileName);
+				if (existing) existing.versions.push(fv);
+				else grouped.set(fv.fileName, {
+					relativePath,
+					versions: [fv]
+				});
+			}
+			if (!listing.nextFileName) break;
+			if (listing.nextFileName === startFileName && (listing.nextFileId ?? void 0) === startFileId) throw emitScanError(options, "failed to scan B2 file versions", /* @__PURE__ */ new Error("B2 pagination did not advance"));
+			startFileName = listing.nextFileName;
+			startFileId = listing.nextFileId ?? void 0;
+		}
+		const visible = this.visibleCandidates(grouped, options);
+		const withoutRelativeCollisions = this.rejectRelativePathCollisions(visible, options);
+		const sorted = (options.requireLocalSafePaths === true ? this.rejectLocalPathCollisions(withoutRelativeCollisions, options) : withoutRelativeCollisions).sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath) || compareCodeUnits(a.fileName, b.fileName));
+		for (const { relativePath, versions, selectedVersion } of sorted) {
+			if (scanIsAborted(options)) return;
+			assertSyncPathAllowed(relativePath);
+			const contentSha1 = selectB2ComparableSha1(selectedVersion);
+			yield {
+				relativePath,
+				modTimeMillis: selectedVersion.uploadTimestamp,
+				size: selectedVersion.contentLength,
+				contentSha1,
+				contentSha1State: syncSha1StateOf({ contentSha1 }),
+				selectedVersion,
+				allVersions: versions
+			};
+		}
+	}
+	tryToRelativePath(fileName) {
+		try {
+			return b2KeyToRelativePathUnderPrefix(this.rawPrefix, fileName);
+		} catch {
+			return null;
+		}
+	}
+	listPrefixFor(filters) {
+		const filterPrefix = literalPrefixForSyncFilters(filters);
+		if (filterPrefix === "") return this.rawPrefix;
+		if (this.rawPrefix !== "" && !this.rawPrefix.endsWith("/")) return this.rawPrefix;
+		return `${this.rawPrefix}${rawPrefixBeforeNormalizedSeparator(filterPrefix)}`;
+	}
+	visibleCandidates(grouped, filters) {
+		const visible = [];
+		for (const [fileName, entry] of grouped) {
+			entry.versions.sort((a, b) => b.uploadTimestamp - a.uploadTimestamp);
+			const selected = entry.versions[0];
+			if (!selected || selected.action === FileAction.Hide) continue;
+			if (filters?.requireLocalSafePaths === true && localFilesystemSyncPathIsUnsafe(entry.relativePath)) {
+				this.emitSkip(filters, entry.relativePath, fileName, "local-unsafe-name", "object name is unsafe for a local filesystem destination");
+				continue;
+			}
+			visible.push({
+				fileName,
+				relativePath: entry.relativePath,
+				versions: entry.versions,
+				selectedVersion: selected
+			});
+		}
+		return visible;
+	}
+	rejectRelativePathCollisions(candidates, filters) {
+		const accepted = [];
+		const owners = /* @__PURE__ */ new Map();
+		const collidedRelativePaths = /* @__PURE__ */ new Set();
+		for (const candidate of candidates) {
+			if (collidedRelativePaths.has(candidate.relativePath)) {
+				this.emitSkip(filters, candidate.relativePath, candidate.fileName, "relative-path-collision", "object normalizes to a relative path already rejected because of another raw B2 key");
+				continue;
+			}
+			const owner = owners.get(candidate.relativePath);
+			if (owner !== void 0 && owner.fileName !== candidate.fileName) {
+				owners.delete(candidate.relativePath);
+				removeAcceptedCandidate(accepted, owner);
+				collidedRelativePaths.add(candidate.relativePath);
+				this.emitSkip(filters, candidate.relativePath, owner.fileName, "relative-path-collision", `object normalizes to the same relative path as ${JSON.stringify(candidate.fileName)}`);
+				this.emitSkip(filters, candidate.relativePath, candidate.fileName, "relative-path-collision", `object normalizes to the same relative path as ${JSON.stringify(owner.fileName)}`);
+				continue;
+			}
+			owners.set(candidate.relativePath, candidate);
+			accepted.push(candidate);
+		}
+		return accepted;
+	}
+	rejectLocalPathCollisions(candidates, filters) {
+		const accepted = [];
+		const owners = /* @__PURE__ */ new Map();
+		const collidedLocalPaths = /* @__PURE__ */ new Set();
+		for (const candidate of candidates) {
+			const canonicalPath = localFilesystemCanonicalSyncPath(candidate.relativePath);
+			if (collidedLocalPaths.has(canonicalPath)) {
+				this.emitSkip(filters, candidate.relativePath, candidate.fileName, "local-path-collision", "object collides with another object on case-insensitive or Unicode-normalizing filesystems");
+				continue;
+			}
+			const owner = owners.get(canonicalPath);
+			if (owner !== void 0) {
+				owners.delete(canonicalPath);
+				removeAcceptedCandidate(accepted, owner);
+				collidedLocalPaths.add(canonicalPath);
+				this.emitSkip(filters, owner.relativePath, owner.fileName, "local-path-collision", `object collides with ${JSON.stringify(candidate.fileName)} on local filesystems`);
+				this.emitSkip(filters, candidate.relativePath, candidate.fileName, "local-path-collision", `object collides with ${JSON.stringify(owner.fileName)} on local filesystems`);
+				continue;
+			}
+			owners.set(canonicalPath, candidate);
+			accepted.push(candidate);
+		}
+		return accepted;
+	}
+	emitSkip(filters, path, b2FileName, reason, message) {
+		emitScannerSkip(filters, {
+			type: "skip",
+			path,
+			size: 0,
+			message: `Skipped B2 object ${JSON.stringify(b2FileName)}: ${message}`,
+			reason,
+			b2FileName
+		});
+	}
 };
-
-//# sourceMappingURL=file.js.map
-
-;// CONCATENATED MODULE: ./node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/b2.js
-
-class B2Folder {
-  type = "b2";
-  bucket;
-  prefix;
-  /**
-   * Creates a new B2Folder for the given bucket and optional prefix.
-   * @param bucket - The B2 bucket to scan.
-   * @param prefix - Optional key prefix to restrict the scan scope.
-   */
-  constructor(bucket, prefix = "") {
-    this.bucket = bucket;
-    this.prefix = prefix;
-  }
-  /** Lists all file versions in the bucket, groups by name, and yields the latest visible version. */
-  async *scan() {
-    const grouped = /* @__PURE__ */ new Map();
-    let startFileName;
-    let startFileId;
-    while (true) {
-      const listing = await this.bucket.listFileVersions({
-        ...this.prefix !== "" ? { prefix: this.prefix } : {},
-        ...startFileName !== void 0 ? { startFileName } : {},
-        ...startFileId !== void 0 ? { startFileId } : {}
-      });
-      for (const fv of listing.files) {
-        const existing = grouped.get(fv.fileName);
-        if (existing) {
-          existing.push(fv);
-        } else {
-          grouped.set(fv.fileName, [fv]);
-        }
-      }
-      if (!listing.nextFileName) break;
-      startFileName = listing.nextFileName;
-      startFileId = listing.nextFileId;
-    }
-    const sorted = [...grouped.entries()].sort((a, b) => a[0].localeCompare(b[0]));
-    for (const [fileName, versions] of sorted) {
-      versions.sort((a, b) => b.uploadTimestamp - a.uploadTimestamp);
-      const selected = versions[0];
-      if (!selected || selected.action === FileAction.Hide) continue;
-      const relativePath = this.prefix !== "" ? fileName.slice(this.prefix.length) : fileName;
-      yield {
-        relativePath,
-        modTimeMillis: selected.uploadTimestamp,
-        size: selected.contentLength,
-        selectedVersion: selected,
-        allVersions: versions
-      };
-    }
-  }
+function rawPrefixBeforeNormalizedSeparator(filterPrefix) {
+	const separatorIndex = filterPrefix.indexOf("/");
+	return separatorIndex === -1 ? filterPrefix : filterPrefix.slice(0, separatorIndex);
+}
+function emitScanError(options, message, err) {
+	const event = {
+		type: "error",
+		path: "",
+		size: 0,
+		message: `${message}: ${sanitizeErrorReason(err)}`
+	};
+	options.onError?.(event);
+	return new Error(event.message);
 }
+function removeAcceptedCandidate(candidates, target) {
+	const index = candidates.indexOf(target);
+	if (index !== -1) candidates.splice(index, 1);
+}
+function scanIsAborted(filters) {
+	return filters?.signal?.aborted === true;
+}
+//#endregion
 
-//# sourceMappingURL=b2.js.map
 
+//# sourceMappingURL=b2.js.map
 ;// CONCATENATED MODULE: ./src/commands/sync.ts
 
 
@@ -37927,14 +45461,22 @@ async function buildConfig(bucket, source, inputs, direction, signal) {
     }
     const remotePrefix = source.replace(/^\/+|\/+$/g, '');
     const localDest = inputs.destination ?? '.';
-    await (0,promises_.mkdir)((0,external_node_path_.resolve)(localDest), { recursive: true });
+    const localRoot = await prepareLocalDestinationRoot(localDest);
     return {
         source: new B2Folder(bucket, remotePrefix === '' ? '' : `${remotePrefix}/`),
-        dest: new LocalFolder((0,external_node_path_.resolve)(localDest)),
+        dest: new LocalFolder(localRoot),
         bucket,
         options,
     };
 }
+async function prepareLocalDestinationRoot(localDest) {
+    const resolved = (0,external_node_path_.resolve)(localDest);
+    await (0,promises_.mkdir)(resolved, { recursive: true });
+    const stats = await (0,promises_.lstat)(resolved);
+    if (stats.isSymbolicLink())
+        return resolved;
+    return (0,promises_.realpath)(resolved);
+}
 
 ;// CONCATENATED MODULE: ./src/commands/unhide.ts
 
@@ -41367,7 +48909,6 @@ function glob_hashFiles(patterns_1) {
 
 
 
-
 /**
  * Upload one or more files to B2.
  *
@@ -41399,11 +48940,14 @@ async function uploadCommand(bucket, inputs, signal) {
     // file's multipart upload sequential so total in-flight B2 requests remain
     // bounded by the user-supplied `concurrency` value.
     const partConcurrency = isSingleExplicitFile || files.length === 1 ? inputs.concurrency : 1;
-    const uploaded = await mapWithConcurrency(files, fileConcurrency, async (f) => {
+    const uploadPlans = await mapWithConcurrency(files, fileConcurrency, async (f) => {
+        signal?.throwIfAborted();
+        return await prepareUploadPlan(f, inputs, isSingleExplicitFile);
+    });
+    const uploaded = await mapWithConcurrency(uploadPlans, fileConcurrency, async (plan) => {
         signal?.throwIfAborted();
-        const fileName = remapFileName(f, inputs.destination, isSingleExplicitFile);
-        const uploadLabel = `upload ${f.localPath} → b2://${bucket.name}/${fileName}`;
-        const groupedLog = files.length === 1 || fileConcurrency === 1;
+        const uploadLabel = `upload ${plan.localPath} → b2://${bucket.name}/${plan.fileName}`;
+        const groupedLog = uploadPlans.length === 1 || fileConcurrency === 1;
         if (groupedLog) {
             startGroup(uploadLabel);
         }
@@ -41411,7 +48955,7 @@ async function uploadCommand(bucket, inputs, signal) {
             info(uploadLabel);
         }
         try {
-            return await uploadOne(bucket, f.localPath, fileName, inputs, partConcurrency, groupedLog, signal);
+            return await uploadOne(bucket, plan, inputs, partConcurrency, groupedLog, signal);
         }
         finally {
             if (groupedLog)
@@ -41456,7 +49000,14 @@ async function resolveFiles(source, include, exclude) {
     const looksLikeGlob = /[*?[\]]/.test(source);
     if (explicitFile?.isFile() && !looksLikeGlob && include.length === 0) {
         return {
-            files: [{ localPath: (0,external_node_path_.resolve)(source), fileName: (0,external_node_path_.basename)(source) }],
+            files: [
+                {
+                    localPath: (0,external_node_path_.resolve)(source),
+                    fileName: (0,external_node_path_.basename)(source),
+                    size: explicitFile.size,
+                    mtimeMs: explicitFile.mtimeMs,
+                },
+            ],
             isSingleExplicitFile: true,
         };
     }
@@ -41485,7 +49036,7 @@ async function resolveFiles(source, include, exclude) {
         if (!s?.isFile())
             continue;
         const rel = (0,external_node_path_.relative)(root, m).split(external_node_path_.sep).join(external_node_path_.posix.sep);
-        out.push({ localPath: m, fileName: rel });
+        out.push({ localPath: m, fileName: rel, size: s.size, mtimeMs: s.mtimeMs });
     }
     out.sort(compareResolvedFiles);
     return { files: out, isSingleExplicitFile: false };
@@ -41513,15 +49064,27 @@ function remapFileName(file, destination, isSingleExplicitFile) {
         return dest;
     return `${dest}/${file.fileName}`;
 }
-async function uploadOne(bucket, localPath, fileName, inputs, partConcurrency, groupedLog, signal) {
-    const fileStat = await (0,promises_.stat)(localPath);
-    const size = fileStat.size;
+async function prepareUploadPlan(file, inputs, isSingleExplicitFile) {
+    const size = file.size;
+    const lastModifiedMillis = inputs.preserveMtime ? Math.trunc(file.mtimeMs) : undefined;
+    const fileInfo = buildUploadFileInfo(inputs.fileInfo, lastModifiedMillis);
+    validateFileInfo(fileInfo, uploadFileInfoTotalMaxBytes(inputs.encryption));
+    return {
+        localPath: file.localPath,
+        fileName: remapFileName(file, inputs.destination, isSingleExplicitFile),
+        size,
+        lastModifiedMillis,
+        fileInfo,
+    };
+}
+async function uploadOne(bucket, plan, inputs, partConcurrency, groupedLog, signal) {
+    const { fileInfo, fileName, lastModifiedMillis, localPath, size } = plan;
     // Stream the file from disk. The SDK's `bucket.upload` routes files larger
     // than the recommended part size through `uploadLargeFile`, which now
     // detects non-sliceable sources (StreamSource) and reads the stream once,
     // shipping one part at a time. Peak memory ≈ partSize regardless of file
     // size, so multi-GB uploads stay bounded.
-    const nodeStream = (0,external_node_fs_namespaceObject.createReadStream)(localPath);
+    const nodeStream = (0,external_node_fs_.createReadStream)(localPath);
     const webStream = external_node_stream_.Readable.toWeb(nodeStream);
     const source = new StreamSource(webStream, size);
     const onProgress = makeProgressListener(`upload[${fileName}]`);
@@ -41540,6 +49103,8 @@ async function uploadOne(bucket, localPath, fileName, inputs, partConcurrency, g
         concurrency: partConcurrency,
         ...(inputs.partSize !== undefined ? { partSize: inputs.partSize } : {}),
         ...(inputs.contentType !== undefined ? { contentType: inputs.contentType } : {}),
+        ...(Object.keys(fileInfo).length > 0 ? { fileInfo } : {}),
+        ...(lastModifiedMillis !== undefined ? { lastModifiedMillis } : {}),
         ...(inputs.encryption !== undefined ? { serverSideEncryption: inputs.encryption } : {}),
         ...(signal !== undefined ? { signal } : {}),
         onProgress,
@@ -41549,14 +49114,33 @@ async function uploadOne(bucket, localPath, fileName, inputs, partConcurrency, g
     const sha1 = result.contentSha1;
     const detailPrefix = groupedLog ? '  ' : '';
     info(`${detailPrefix}fileId=${result.fileId} sha1=${sha1 ?? 'multipart'}`);
+    const resultFileInfo = Object.keys(result.fileInfo).length > 0 ? result.fileInfo : fileInfo;
     return {
         localPath,
         fileName: result.fileName,
         fileId: result.fileId,
         size,
         contentSha1: sha1,
+        fileInfo: resultFileInfo,
     };
 }
+function buildUploadFileInfo(inputFileInfo, lastModifiedMillis) {
+    const fileInfo = {};
+    for (const [key, value] of Object.entries(inputFileInfo)) {
+        const canonicalKey = key.toLowerCase();
+        if (Object.hasOwn(fileInfo, canonicalKey)) {
+            throw new Error(`Duplicate fileInfo key "${key}" from upload metadata`);
+        }
+        fileInfo[canonicalKey] = value;
+    }
+    if (lastModifiedMillis !== undefined) {
+        if (Object.hasOwn(fileInfo, 'src_last_modified_millis')) {
+            throw new Error(`Duplicate fileInfo key "src_last_modified_millis" from 'preserve-mtime' input`);
+        }
+        fileInfo.src_last_modified_millis = String(lastModifiedMillis);
+    }
+    return fileInfo;
+}
 
 ;// CONCATENATED MODULE: ./src/commands/verify.ts
 
@@ -41663,7 +49247,7 @@ async function sha1OfFile(path) {
         throw new Error(`verify: 'destination' must be an existing file, got: ${path}`);
     }
     const hasher = new IncrementalSha1();
-    const stream = (0,external_node_fs_namespaceObject.createReadStream)(path);
+    const stream = (0,external_node_fs_.createReadStream)(path);
     for await (const chunk of stream) {
         await hasher.update(chunk);
     }
@@ -42432,7 +50016,7 @@ function isEntrypoint(metaUrl, argv1) {
     if (argv1 === undefined)
         return false;
     try {
-        return (0,external_node_fs_namespaceObject.realpathSync)((0,external_node_url_.fileURLToPath)(metaUrl)) === (0,external_node_fs_namespaceObject.realpathSync)((0,external_node_path_.resolve)(argv1));
+        return (0,external_node_fs_.realpathSync)((0,external_node_url_.fileURLToPath)(metaUrl)) === (0,external_node_fs_.realpathSync)((0,external_node_path_.resolve)(argv1));
     }
     catch {
         return false;
diff --git a/dist/index.js.map b/dist/index.js.map
index 5baa2b8..9826904 100644
--- a/dist/index.js.map
+++ b/dist/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","mappings":";;;;;;AAAA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9sBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC98CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrRA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC11BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/dA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/tEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5gCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/lDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACllBA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACNA;AACA;;;;;;;;;;;;ACDA;;;;;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AChCA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9QA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACTA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACrDA;AACA;AACA;AACA;AAMA;AACA;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzEA;AACA;AAIA;AACA;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC7NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9CA;AACA;AACA;AAGA;AACA;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACnNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACpxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmBA;AACA;;;AC3QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AChGA;AACA;AACA;AACA;AAIA;AACA;;;ACRA;AACA;AAGA;AACA;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;;;AChUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;;;ACxlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;;;ACrOA;AAEA;;;;;;;;;;;AAWA;AACA;;;ACdA;AAEA;AAMA;AA6BA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AAKA;AACA;AACA;AACA;AAAA;AAEA;AACA;;;;;;;AC3IA;AACA;AAEA;AAEA;AAEA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;;;AC3DA;AAEA;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AAqFA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;AAYA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAKA;AAKA;AAKA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;AAUA;AACA;AACA;AAAA;AACA;AACA;AAEA;;;AAGA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAEA;;;;AAIA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1bA;AAEA;AACA;AAkBA;;;;;;;;;;;AAWA;AACA;AAMA;AACA;AACA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACnFA;AACA;AAmBA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC3FA;AAEA;AACA;AACA;AAoBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAEA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;;;;;ACpHA;;ACQA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAOA;AAEA;AACA;AAOA;AAEA;AACA;AAOA;AAEA;AAOA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;;;ACnMA;AAEA;;;;;AAKA;AACA;AACA;AACA;;;ACXA;;;;;AAKA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;;;ACXA;AAEA;AAEA;;;;;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAGA;AACA;AAIA;AACA;AACA;AACA;AACA;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAgDA;;;;;;;;;;AAUA;AACA;AAKA;AACA;AAEA;AACA;AAEA;AACA;AAQA;AACA;AAQA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AAOA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AASA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;;;;AAIA;AACA;AASA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAKA;AAKA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAGA;AACA;;;ACvkBA;AAEA;AAoBA;;;;;;;;AAQA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtDA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;AClCA;AA8BA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACtBA;AAEA;AACA;AAKA;AAkBA;;;;;;;;;;;;;;AAcA;AACA;AAKA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAUA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AAOA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;;;ACnKA;AAGA;AAsBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AChGA;AAEA;AACA;AAgBA;;;;;;;;;;;;;;;;;AAiBA;AACA;AAIA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;;ACxDA;AACA;AACA;AASA;AACA;AACA;AAwBA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAGA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;;;;;;;;;;AAUA;AACA;AAKA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1PA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACx0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzlCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpOA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAwBA;;;;;;;;;;;;;;;AAeA;AACA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AASA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAkBA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AAKA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAEA;AASA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpRA;AACA;AACA;AAEA;AACA;AAsBA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC/IA;AAQA;AAEA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;;;AClPA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AA+BA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AAEA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AAEA;AAIA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC9NA;AACA;AACA;AAEA;AACA;AAmBA;;;;;;;;AAQA;AACA;AAMA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA","sources":[".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js",".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/abort-signal.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-pipeline.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-upgrade.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/readable.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/diagnostics.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/tree.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/balanced-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h1.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h2.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/fixed-queue.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-stats.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/retry-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/decorator-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/redirect-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/retry-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dns.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dump.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/retry.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pluralizer.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/util/timers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cache.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cachestorage.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/parse.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/body.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/data-url.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/dispatcher-weakref.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/file.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata-parser.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/headers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/response.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/webidl.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/encoding.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/filereader.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/progressevent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/connection.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/events.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/frame.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/permessage-deflate.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/receiver.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/sender.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/websocket.js","../external node-commonjs \"assert\"","../external node-commonjs \"events\"","../external node-commonjs \"http\"","../external node-commonjs \"https\"","../external node-commonjs \"net\"","../external node-commonjs \"node:assert\"","../external node-commonjs \"node:async_hooks\"","../external node-commonjs \"node:buffer\"","../external node-commonjs \"node:console\"","../external node-commonjs \"node:crypto\"","../external node-commonjs \"node:diagnostics_channel\"","../external node-commonjs \"node:dns\"","../external node-commonjs \"node:events\"","../external node-commonjs \"node:fs/promises\"","../external node-commonjs \"node:http\"","../external node-commonjs \"node:http2\"","../external node-commonjs \"node:net\"","../external node-commonjs \"node:path\"","../external node-commonjs \"node:perf_hooks\"","../external node-commonjs \"node:querystring\"","../external node-commonjs \"node:stream\"","../external node-commonjs \"node:tls\"","../external node-commonjs \"node:url\"","../external node-commonjs \"node:util\"","../external node-commonjs \"node:util/types\"","../external node-commonjs \"node:worker_threads\"","../external node-commonjs \"node:zlib\"","../external node-commonjs \"string_decoder\"","../external node-commonjs \"tls\"","../external node-commonjs \"util\"","../webpack/bootstrap","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/compat","../external node-commonjs \"node:fs\"","../external node-commonjs \"os\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/command.js","../external node-commonjs \"crypto\"","../external node-commonjs \"fs\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/file-command.js","../external node-commonjs \"path\"",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/proxy.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/index.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/auth.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/oidc-utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/summary.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/path-utils.js","../external node-commonjs \"child_process\"",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io-util.js",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io.js","../external node-commonjs \"timers\"",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/toolrunner.js",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/exec.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/platform.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/core.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/upload-url-pool.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/in-memory.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/realms.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/ids.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/best-effort.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/cancel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/concurrency.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/defaults.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/plan-ranges.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/copy/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/text-codec.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/encoding.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/progress.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/normalize.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/retry.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/collect.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/download/parallel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/hash.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/resume.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/to-error.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/stream.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/object.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/util/paginator.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/bucket.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/errors/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/url-guard.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/package.json.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/version.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/user-agent.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/http/transport.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/encryption.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/client.js",".././src/version.ts",".././src/client.ts",".././src/sse.ts",".././src/inputs.ts",".././src/commands/copy.ts",".././src/commands/delete-all.ts",".././src/commands/delete.ts","../external node-commonjs \"node:stream/promises\"",".././src/download-overrides.ts",".././src/fs.ts",".././src/format.ts",".././src/progress.ts",".././src/commands/download.ts",".././src/commands/head.ts",".././src/commands/hide.ts",".././src/commands/list.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/s3/index.js",".././src/commands/presign.ts",".././src/commands/purge.ts",".././src/commands/retention.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/source.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/actions/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/pairing.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/compare.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/synchronizer.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/local.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/types/file.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.1.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/b2.js",".././src/commands/sync.ts",".././src/commands/unhide.ts",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-glob-options-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-match-kind.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern-helper.js",".././node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js",".././node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/esm/index.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/brace-expressions.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/unescape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/ast.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/escape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-search-state.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-globber.js","../external node-commonjs \"stream\"",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-hash-files.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/glob.js",".././src/commands/upload.ts",".././src/commands/verify.ts",".././src/errors.ts",".././src/outputs.ts",".././src/summary.ts",".././src/main.ts"],"sourcesContent":["module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = http.request;\n  return agent;\n}\n\nfunction httpsOverHttp(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = http.request;\n  agent.createSocket = createSecureSocket;\n  agent.defaultPort = 443;\n  return agent;\n}\n\nfunction httpOverHttps(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = https.request;\n  return agent;\n}\n\nfunction httpsOverHttps(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = https.request;\n  agent.createSocket = createSecureSocket;\n  agent.defaultPort = 443;\n  return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n  var self = this;\n  self.options = options || {};\n  self.proxyOptions = self.options.proxy || {};\n  self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n  self.requests = [];\n  self.sockets = [];\n\n  self.on('free', function onFree(socket, host, port, localAddress) {\n    var options = toOptions(host, port, localAddress);\n    for (var i = 0, len = self.requests.length; i < len; ++i) {\n      var pending = self.requests[i];\n      if (pending.host === options.host && pending.port === options.port) {\n        // Detect the request to connect same origin server,\n        // reuse the connection.\n        self.requests.splice(i, 1);\n        pending.request.onSocket(socket);\n        return;\n      }\n    }\n    socket.destroy();\n    self.removeSocket(socket);\n  });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n  var self = this;\n  var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n  if (self.sockets.length >= this.maxSockets) {\n    // We are over limit so we'll add it to the queue.\n    self.requests.push(options);\n    return;\n  }\n\n  // If we are under maxSockets create a new one.\n  self.createSocket(options, function(socket) {\n    socket.on('free', onFree);\n    socket.on('close', onCloseOrRemove);\n    socket.on('agentRemove', onCloseOrRemove);\n    req.onSocket(socket);\n\n    function onFree() {\n      self.emit('free', socket, options);\n    }\n\n    function onCloseOrRemove(err) {\n      self.removeSocket(socket);\n      socket.removeListener('free', onFree);\n      socket.removeListener('close', onCloseOrRemove);\n      socket.removeListener('agentRemove', onCloseOrRemove);\n    }\n  });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n  var self = this;\n  var placeholder = {};\n  self.sockets.push(placeholder);\n\n  var connectOptions = mergeOptions({}, self.proxyOptions, {\n    method: 'CONNECT',\n    path: options.host + ':' + options.port,\n    agent: false,\n    headers: {\n      host: options.host + ':' + options.port\n    }\n  });\n  if (options.localAddress) {\n    connectOptions.localAddress = options.localAddress;\n  }\n  if (connectOptions.proxyAuth) {\n    connectOptions.headers = connectOptions.headers || {};\n    connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n        new Buffer(connectOptions.proxyAuth).toString('base64');\n  }\n\n  debug('making CONNECT request');\n  var connectReq = self.request(connectOptions);\n  connectReq.useChunkedEncodingByDefault = false; // for v0.6\n  connectReq.once('response', onResponse); // for v0.6\n  connectReq.once('upgrade', onUpgrade);   // for v0.6\n  connectReq.once('connect', onConnect);   // for v0.7 or later\n  connectReq.once('error', onError);\n  connectReq.end();\n\n  function onResponse(res) {\n    // Very hacky. This is necessary to avoid http-parser leaks.\n    res.upgrade = true;\n  }\n\n  function onUpgrade(res, socket, head) {\n    // Hacky.\n    process.nextTick(function() {\n      onConnect(res, socket, head);\n    });\n  }\n\n  function onConnect(res, socket, head) {\n    connectReq.removeAllListeners();\n    socket.removeAllListeners();\n\n    if (res.statusCode !== 200) {\n      debug('tunneling socket could not be established, statusCode=%d',\n        res.statusCode);\n      socket.destroy();\n      var error = new Error('tunneling socket could not be established, ' +\n        'statusCode=' + res.statusCode);\n      error.code = 'ECONNRESET';\n      options.request.emit('error', error);\n      self.removeSocket(placeholder);\n      return;\n    }\n    if (head.length > 0) {\n      debug('got illegal response body from proxy');\n      socket.destroy();\n      var error = new Error('got illegal response body from proxy');\n      error.code = 'ECONNRESET';\n      options.request.emit('error', error);\n      self.removeSocket(placeholder);\n      return;\n    }\n    debug('tunneling connection has established');\n    self.sockets[self.sockets.indexOf(placeholder)] = socket;\n    return cb(socket);\n  }\n\n  function onError(cause) {\n    connectReq.removeAllListeners();\n\n    debug('tunneling socket could not be established, cause=%s\\n',\n          cause.message, cause.stack);\n    var error = new Error('tunneling socket could not be established, ' +\n                          'cause=' + cause.message);\n    error.code = 'ECONNRESET';\n    options.request.emit('error', error);\n    self.removeSocket(placeholder);\n  }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n  var pos = this.sockets.indexOf(socket)\n  if (pos === -1) {\n    return;\n  }\n  this.sockets.splice(pos, 1);\n\n  var pending = this.requests.shift();\n  if (pending) {\n    // If we have pending requests and a socket gets closed a new one\n    // needs to be created to take over in the pool for the one that closed.\n    this.createSocket(pending, function(socket) {\n      pending.request.onSocket(socket);\n    });\n  }\n};\n\nfunction createSecureSocket(options, cb) {\n  var self = this;\n  TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n    var hostHeader = options.request.getHeader('host');\n    var tlsOptions = mergeOptions({}, self.options, {\n      socket: socket,\n      servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n    });\n\n    // 0 is dummy port for v0.6\n    var secureSocket = tls.connect(0, tlsOptions);\n    self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n    cb(secureSocket);\n  });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n  if (typeof host === 'string') { // since v0.10\n    return {\n      host: host,\n      port: port,\n      localAddress: localAddress\n    };\n  }\n  return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n  for (var i = 1, len = arguments.length; i < len; ++i) {\n    var overrides = arguments[i];\n    if (typeof overrides === 'object') {\n      var keys = Object.keys(overrides);\n      for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n        var k = keys[j];\n        if (overrides[k] !== undefined) {\n          target[k] = overrides[k];\n        }\n      }\n    }\n  }\n  return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n  debug = function() {\n    var args = Array.prototype.slice.call(arguments);\n    if (typeof args[0] === 'string') {\n      args[0] = 'TUNNEL: ' + args[0];\n    } else {\n      args.unshift('TUNNEL:');\n    }\n    console.error.apply(console, args);\n  }\n} else {\n  debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict'\n\nconst Client = require('./lib/dispatcher/client')\nconst Dispatcher = require('./lib/dispatcher/dispatcher')\nconst Pool = require('./lib/dispatcher/pool')\nconst BalancedPool = require('./lib/dispatcher/balanced-pool')\nconst Agent = require('./lib/dispatcher/agent')\nconst ProxyAgent = require('./lib/dispatcher/proxy-agent')\nconst EnvHttpProxyAgent = require('./lib/dispatcher/env-http-proxy-agent')\nconst RetryAgent = require('./lib/dispatcher/retry-agent')\nconst errors = require('./lib/core/errors')\nconst util = require('./lib/core/util')\nconst { InvalidArgumentError } = errors\nconst api = require('./lib/api')\nconst buildConnector = require('./lib/core/connect')\nconst MockClient = require('./lib/mock/mock-client')\nconst MockAgent = require('./lib/mock/mock-agent')\nconst MockPool = require('./lib/mock/mock-pool')\nconst mockErrors = require('./lib/mock/mock-errors')\nconst RetryHandler = require('./lib/handler/retry-handler')\nconst { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global')\nconst DecoratorHandler = require('./lib/handler/decorator-handler')\nconst RedirectHandler = require('./lib/handler/redirect-handler')\nconst createRedirectInterceptor = require('./lib/interceptor/redirect-interceptor')\n\nObject.assign(Dispatcher.prototype, api)\n\nmodule.exports.Dispatcher = Dispatcher\nmodule.exports.Client = Client\nmodule.exports.Pool = Pool\nmodule.exports.BalancedPool = BalancedPool\nmodule.exports.Agent = Agent\nmodule.exports.ProxyAgent = ProxyAgent\nmodule.exports.EnvHttpProxyAgent = EnvHttpProxyAgent\nmodule.exports.RetryAgent = RetryAgent\nmodule.exports.RetryHandler = RetryHandler\n\nmodule.exports.DecoratorHandler = DecoratorHandler\nmodule.exports.RedirectHandler = RedirectHandler\nmodule.exports.createRedirectInterceptor = createRedirectInterceptor\nmodule.exports.interceptors = {\n  redirect: require('./lib/interceptor/redirect'),\n  retry: require('./lib/interceptor/retry'),\n  dump: require('./lib/interceptor/dump'),\n  dns: require('./lib/interceptor/dns')\n}\n\nmodule.exports.buildConnector = buildConnector\nmodule.exports.errors = errors\nmodule.exports.util = {\n  parseHeaders: util.parseHeaders,\n  headerNameToString: util.headerNameToString\n}\n\nfunction makeDispatcher (fn) {\n  return (url, opts, handler) => {\n    if (typeof opts === 'function') {\n      handler = opts\n      opts = null\n    }\n\n    if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {\n      throw new InvalidArgumentError('invalid url')\n    }\n\n    if (opts != null && typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (opts && opts.path != null) {\n      if (typeof opts.path !== 'string') {\n        throw new InvalidArgumentError('invalid opts.path')\n      }\n\n      let path = opts.path\n      if (!opts.path.startsWith('/')) {\n        path = `/${path}`\n      }\n\n      url = new URL(util.parseOrigin(url).origin + path)\n    } else {\n      if (!opts) {\n        opts = typeof url === 'object' ? url : {}\n      }\n\n      url = util.parseURL(url)\n    }\n\n    const { agent, dispatcher = getGlobalDispatcher() } = opts\n\n    if (agent) {\n      throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')\n    }\n\n    return fn.call(dispatcher, {\n      ...opts,\n      origin: url.origin,\n      path: url.search ? `${url.pathname}${url.search}` : url.pathname,\n      method: opts.method || (opts.body ? 'PUT' : 'GET')\n    }, handler)\n  }\n}\n\nmodule.exports.setGlobalDispatcher = setGlobalDispatcher\nmodule.exports.getGlobalDispatcher = getGlobalDispatcher\n\nconst fetchImpl = require('./lib/web/fetch').fetch\nmodule.exports.fetch = async function fetch (init, options = undefined) {\n  try {\n    return await fetchImpl(init, options)\n  } catch (err) {\n    if (err && typeof err === 'object') {\n      Error.captureStackTrace(err)\n    }\n\n    throw err\n  }\n}\nmodule.exports.Headers = require('./lib/web/fetch/headers').Headers\nmodule.exports.Response = require('./lib/web/fetch/response').Response\nmodule.exports.Request = require('./lib/web/fetch/request').Request\nmodule.exports.FormData = require('./lib/web/fetch/formdata').FormData\nmodule.exports.File = globalThis.File ?? require('node:buffer').File\nmodule.exports.FileReader = require('./lib/web/fileapi/filereader').FileReader\n\nconst { setGlobalOrigin, getGlobalOrigin } = require('./lib/web/fetch/global')\n\nmodule.exports.setGlobalOrigin = setGlobalOrigin\nmodule.exports.getGlobalOrigin = getGlobalOrigin\n\nconst { CacheStorage } = require('./lib/web/cache/cachestorage')\nconst { kConstruct } = require('./lib/web/cache/symbols')\n\n// Cache & CacheStorage are tightly coupled with fetch. Even if it may run\n// in an older version of Node, it doesn't have any use without fetch.\nmodule.exports.caches = new CacheStorage(kConstruct)\n\nconst { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/web/cookies')\n\nmodule.exports.deleteCookie = deleteCookie\nmodule.exports.getCookies = getCookies\nmodule.exports.getSetCookies = getSetCookies\nmodule.exports.setCookie = setCookie\n\nconst { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/data-url')\n\nmodule.exports.parseMIMEType = parseMIMEType\nmodule.exports.serializeAMimeType = serializeAMimeType\n\nconst { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/web/websocket/events')\nmodule.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket\nmodule.exports.CloseEvent = CloseEvent\nmodule.exports.ErrorEvent = ErrorEvent\nmodule.exports.MessageEvent = MessageEvent\n\nmodule.exports.request = makeDispatcher(api.request)\nmodule.exports.stream = makeDispatcher(api.stream)\nmodule.exports.pipeline = makeDispatcher(api.pipeline)\nmodule.exports.connect = makeDispatcher(api.connect)\nmodule.exports.upgrade = makeDispatcher(api.upgrade)\n\nmodule.exports.MockClient = MockClient\nmodule.exports.MockPool = MockPool\nmodule.exports.MockAgent = MockAgent\nmodule.exports.mockErrors = mockErrors\n\nconst { EventSource } = require('./lib/web/eventsource/eventsource')\n\nmodule.exports.EventSource = EventSource\n","const { addAbortListener } = require('../core/util')\nconst { RequestAbortedError } = require('../core/errors')\n\nconst kListener = Symbol('kListener')\nconst kSignal = Symbol('kSignal')\n\nfunction abort (self) {\n  if (self.abort) {\n    self.abort(self[kSignal]?.reason)\n  } else {\n    self.reason = self[kSignal]?.reason ?? new RequestAbortedError()\n  }\n  removeSignal(self)\n}\n\nfunction addSignal (self, signal) {\n  self.reason = null\n\n  self[kSignal] = null\n  self[kListener] = null\n\n  if (!signal) {\n    return\n  }\n\n  if (signal.aborted) {\n    abort(self)\n    return\n  }\n\n  self[kSignal] = signal\n  self[kListener] = () => {\n    abort(self)\n  }\n\n  addAbortListener(self[kSignal], self[kListener])\n}\n\nfunction removeSignal (self) {\n  if (!self[kSignal]) {\n    return\n  }\n\n  if ('removeEventListener' in self[kSignal]) {\n    self[kSignal].removeEventListener('abort', self[kListener])\n  } else {\n    self[kSignal].removeListener('abort', self[kListener])\n  }\n\n  self[kSignal] = null\n  self[kListener] = null\n}\n\nmodule.exports = {\n  addSignal,\n  removeSignal\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { AsyncResource } = require('node:async_hooks')\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass ConnectHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    const { signal, opaque, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    super('UNDICI_CONNECT')\n\n    this.opaque = opaque || null\n    this.responseHeaders = responseHeaders || null\n    this.callback = callback\n    this.abort = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders () {\n    throw new SocketError('bad connect', null)\n  }\n\n  onUpgrade (statusCode, rawHeaders, socket) {\n    const { callback, opaque, context } = this\n\n    removeSignal(this)\n\n    this.callback = null\n\n    let headers = rawHeaders\n    // Indicates is an HTTP2Session\n    if (headers != null) {\n      headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n    }\n\n    this.runInAsyncScope(callback, null, null, {\n      statusCode,\n      headers,\n      socket,\n      opaque,\n      context\n    })\n  }\n\n  onError (err) {\n    const { callback, opaque } = this\n\n    removeSignal(this)\n\n    if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n  }\n}\n\nfunction connect (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      connect.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    const connectHandler = new ConnectHandler(opts, callback)\n    this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = connect\n","'use strict'\n\nconst {\n  Readable,\n  Duplex,\n  PassThrough\n} = require('node:stream')\nconst {\n  InvalidArgumentError,\n  InvalidReturnValueError,\n  RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nconst kResume = Symbol('resume')\n\nclass PipelineRequest extends Readable {\n  constructor () {\n    super({ autoDestroy: true })\n\n    this[kResume] = null\n  }\n\n  _read () {\n    const { [kResume]: resume } = this\n\n    if (resume) {\n      this[kResume] = null\n      resume()\n    }\n  }\n\n  _destroy (err, callback) {\n    this._read()\n\n    callback(err)\n  }\n}\n\nclass PipelineResponse extends Readable {\n  constructor (resume) {\n    super({ autoDestroy: true })\n    this[kResume] = resume\n  }\n\n  _read () {\n    this[kResume]()\n  }\n\n  _destroy (err, callback) {\n    if (!err && !this._readableState.endEmitted) {\n      err = new RequestAbortedError()\n    }\n\n    callback(err)\n  }\n}\n\nclass PipelineHandler extends AsyncResource {\n  constructor (opts, handler) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof handler !== 'function') {\n      throw new InvalidArgumentError('invalid handler')\n    }\n\n    const { signal, method, opaque, onInfo, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    if (method === 'CONNECT') {\n      throw new InvalidArgumentError('invalid method')\n    }\n\n    if (onInfo && typeof onInfo !== 'function') {\n      throw new InvalidArgumentError('invalid onInfo callback')\n    }\n\n    super('UNDICI_PIPELINE')\n\n    this.opaque = opaque || null\n    this.responseHeaders = responseHeaders || null\n    this.handler = handler\n    this.abort = null\n    this.context = null\n    this.onInfo = onInfo || null\n\n    this.req = new PipelineRequest().on('error', util.nop)\n\n    this.ret = new Duplex({\n      readableObjectMode: opts.objectMode,\n      autoDestroy: true,\n      read: () => {\n        const { body } = this\n\n        if (body?.resume) {\n          body.resume()\n        }\n      },\n      write: (chunk, encoding, callback) => {\n        const { req } = this\n\n        if (req.push(chunk, encoding) || req._readableState.destroyed) {\n          callback()\n        } else {\n          req[kResume] = callback\n        }\n      },\n      destroy: (err, callback) => {\n        const { body, req, res, ret, abort } = this\n\n        if (!err && !ret._readableState.endEmitted) {\n          err = new RequestAbortedError()\n        }\n\n        if (abort && err) {\n          abort()\n        }\n\n        util.destroy(body, err)\n        util.destroy(req, err)\n        util.destroy(res, err)\n\n        removeSignal(this)\n\n        callback(err)\n      }\n    }).on('prefinish', () => {\n      const { req } = this\n\n      // Node < 15 does not call _final in same tick.\n      req.push(null)\n    })\n\n    this.res = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    const { ret, res } = this\n\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(!res, 'pipeline cannot be retried')\n    assert(!ret.destroyed)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume) {\n    const { opaque, handler, context } = this\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    this.res = new PipelineResponse(resume)\n\n    let body\n    try {\n      this.handler = null\n      const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n      body = this.runInAsyncScope(handler, null, {\n        statusCode,\n        headers,\n        opaque,\n        body: this.res,\n        context\n      })\n    } catch (err) {\n      this.res.on('error', util.nop)\n      throw err\n    }\n\n    if (!body || typeof body.on !== 'function') {\n      throw new InvalidReturnValueError('expected Readable')\n    }\n\n    body\n      .on('data', (chunk) => {\n        const { ret, body } = this\n\n        if (!ret.push(chunk) && body.pause) {\n          body.pause()\n        }\n      })\n      .on('error', (err) => {\n        const { ret } = this\n\n        util.destroy(ret, err)\n      })\n      .on('end', () => {\n        const { ret } = this\n\n        ret.push(null)\n      })\n      .on('close', () => {\n        const { ret } = this\n\n        if (!ret._readableState.ended) {\n          util.destroy(ret, new RequestAbortedError())\n        }\n      })\n\n    this.body = body\n  }\n\n  onData (chunk) {\n    const { res } = this\n    return res.push(chunk)\n  }\n\n  onComplete (trailers) {\n    const { res } = this\n    res.push(null)\n  }\n\n  onError (err) {\n    const { ret } = this\n    this.handler = null\n    util.destroy(ret, err)\n  }\n}\n\nfunction pipeline (opts, handler) {\n  try {\n    const pipelineHandler = new PipelineHandler(opts, handler)\n    this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)\n    return pipelineHandler.ret\n  } catch (err) {\n    return new PassThrough().destroy(err)\n  }\n}\n\nmodule.exports = pipeline\n","'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('./readable')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\n\nclass RequestHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts\n\n    try {\n      if (typeof callback !== 'function') {\n        throw new InvalidArgumentError('invalid callback')\n      }\n\n      if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {\n        throw new InvalidArgumentError('invalid highWaterMark')\n      }\n\n      if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n        throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n      }\n\n      if (method === 'CONNECT') {\n        throw new InvalidArgumentError('invalid method')\n      }\n\n      if (onInfo && typeof onInfo !== 'function') {\n        throw new InvalidArgumentError('invalid onInfo callback')\n      }\n\n      super('UNDICI_REQUEST')\n    } catch (err) {\n      if (util.isStream(body)) {\n        util.destroy(body.on('error', util.nop), err)\n      }\n      throw err\n    }\n\n    this.method = method\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.callback = callback\n    this.res = null\n    this.abort = null\n    this.body = body\n    this.trailers = {}\n    this.context = null\n    this.onInfo = onInfo || null\n    this.throwOnError = throwOnError\n    this.highWaterMark = highWaterMark\n    this.signal = signal\n    this.reason = null\n    this.removeAbortListener = null\n\n    if (util.isStream(body)) {\n      body.on('error', (err) => {\n        this.onError(err)\n      })\n    }\n\n    if (this.signal) {\n      if (this.signal.aborted) {\n        this.reason = this.signal.reason ?? new RequestAbortedError()\n      } else {\n        this.removeAbortListener = util.addAbortListener(this.signal, () => {\n          this.reason = this.signal.reason ?? new RequestAbortedError()\n          if (this.res) {\n            util.destroy(this.res.on('error', util.nop), this.reason)\n          } else if (this.abort) {\n            this.abort(this.reason)\n          }\n\n          if (this.removeAbortListener) {\n            this.res?.off('close', this.removeAbortListener)\n            this.removeAbortListener()\n            this.removeAbortListener = null\n          }\n        })\n      }\n    }\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this\n\n    const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n    const contentType = parsedHeaders['content-type']\n    const contentLength = parsedHeaders['content-length']\n    const res = new Readable({\n      resume,\n      abort,\n      contentType,\n      contentLength: this.method !== 'HEAD' && contentLength\n        ? Number(contentLength)\n        : null,\n      highWaterMark\n    })\n\n    if (this.removeAbortListener) {\n      res.on('close', this.removeAbortListener)\n    }\n\n    this.callback = null\n    this.res = res\n    if (callback !== null) {\n      if (this.throwOnError && statusCode >= 400) {\n        this.runInAsyncScope(getResolveErrorBodyCallback, null,\n          { callback, body: res, contentType, statusCode, statusMessage, headers }\n        )\n      } else {\n        this.runInAsyncScope(callback, null, null, {\n          statusCode,\n          headers,\n          trailers: this.trailers,\n          opaque,\n          body: res,\n          context\n        })\n      }\n    }\n  }\n\n  onData (chunk) {\n    return this.res.push(chunk)\n  }\n\n  onComplete (trailers) {\n    util.parseHeaders(trailers, this.trailers)\n    this.res.push(null)\n  }\n\n  onError (err) {\n    const { res, callback, body, opaque } = this\n\n    if (callback) {\n      // TODO: Does this need queueMicrotask?\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n\n    if (res) {\n      this.res = null\n      // Ensure all queued handlers are invoked before destroying res.\n      queueMicrotask(() => {\n        util.destroy(res, err)\n      })\n    }\n\n    if (body) {\n      this.body = null\n      util.destroy(body, err)\n    }\n\n    if (this.removeAbortListener) {\n      res?.off('close', this.removeAbortListener)\n      this.removeAbortListener()\n      this.removeAbortListener = null\n    }\n  }\n}\n\nfunction request (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      request.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    this.dispatch(opts, new RequestHandler(opts, callback))\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = request\nmodule.exports.RequestHandler = RequestHandler\n","'use strict'\n\nconst assert = require('node:assert')\nconst { finished, PassThrough } = require('node:stream')\nconst { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass StreamHandler extends AsyncResource {\n  constructor (opts, factory, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts\n\n    try {\n      if (typeof callback !== 'function') {\n        throw new InvalidArgumentError('invalid callback')\n      }\n\n      if (typeof factory !== 'function') {\n        throw new InvalidArgumentError('invalid factory')\n      }\n\n      if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n        throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n      }\n\n      if (method === 'CONNECT') {\n        throw new InvalidArgumentError('invalid method')\n      }\n\n      if (onInfo && typeof onInfo !== 'function') {\n        throw new InvalidArgumentError('invalid onInfo callback')\n      }\n\n      super('UNDICI_STREAM')\n    } catch (err) {\n      if (util.isStream(body)) {\n        util.destroy(body.on('error', util.nop), err)\n      }\n      throw err\n    }\n\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.factory = factory\n    this.callback = callback\n    this.res = null\n    this.abort = null\n    this.context = null\n    this.trailers = null\n    this.body = body\n    this.onInfo = onInfo || null\n    this.throwOnError = throwOnError || false\n\n    if (util.isStream(body)) {\n      body.on('error', (err) => {\n        this.onError(err)\n      })\n    }\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const { factory, opaque, context, callback, responseHeaders } = this\n\n    const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    this.factory = null\n\n    let res\n\n    if (this.throwOnError && statusCode >= 400) {\n      const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n      const contentType = parsedHeaders['content-type']\n      res = new PassThrough()\n\n      this.callback = null\n      this.runInAsyncScope(getResolveErrorBodyCallback, null,\n        { callback, body: res, contentType, statusCode, statusMessage, headers }\n      )\n    } else {\n      if (factory === null) {\n        return\n      }\n\n      res = this.runInAsyncScope(factory, null, {\n        statusCode,\n        headers,\n        opaque,\n        context\n      })\n\n      if (\n        !res ||\n        typeof res.write !== 'function' ||\n        typeof res.end !== 'function' ||\n        typeof res.on !== 'function'\n      ) {\n        throw new InvalidReturnValueError('expected Writable')\n      }\n\n      // TODO: Avoid finished. It registers an unnecessary amount of listeners.\n      finished(res, { readable: false }, (err) => {\n        const { callback, res, opaque, trailers, abort } = this\n\n        this.res = null\n        if (err || !res.readable) {\n          util.destroy(res, err)\n        }\n\n        this.callback = null\n        this.runInAsyncScope(callback, null, err || null, { opaque, trailers })\n\n        if (err) {\n          abort()\n        }\n      })\n    }\n\n    res.on('drain', resume)\n\n    this.res = res\n\n    const needDrain = res.writableNeedDrain !== undefined\n      ? res.writableNeedDrain\n      : res._writableState?.needDrain\n\n    return needDrain !== true\n  }\n\n  onData (chunk) {\n    const { res } = this\n\n    return res ? res.write(chunk) : true\n  }\n\n  onComplete (trailers) {\n    const { res } = this\n\n    removeSignal(this)\n\n    if (!res) {\n      return\n    }\n\n    this.trailers = util.parseHeaders(trailers)\n\n    res.end()\n  }\n\n  onError (err) {\n    const { res, callback, opaque, body } = this\n\n    removeSignal(this)\n\n    this.factory = null\n\n    if (res) {\n      this.res = null\n      util.destroy(res, err)\n    } else if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n\n    if (body) {\n      this.body = null\n      util.destroy(body, err)\n    }\n  }\n}\n\nfunction stream (opts, factory, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      stream.call(this, opts, factory, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    this.dispatch(opts, new StreamHandler(opts, factory, callback))\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = stream\n","'use strict'\n\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst { AsyncResource } = require('node:async_hooks')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nclass UpgradeHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    const { signal, opaque, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    super('UNDICI_UPGRADE')\n\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.callback = callback\n    this.abort = null\n    this.context = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = null\n  }\n\n  onHeaders () {\n    throw new SocketError('bad upgrade', null)\n  }\n\n  onUpgrade (statusCode, rawHeaders, socket) {\n    assert(statusCode === 101)\n\n    const { callback, opaque, context } = this\n\n    removeSignal(this)\n\n    this.callback = null\n    const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n    this.runInAsyncScope(callback, null, null, {\n      headers,\n      socket,\n      opaque,\n      context\n    })\n  }\n\n  onError (err) {\n    const { callback, opaque } = this\n\n    removeSignal(this)\n\n    if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n  }\n}\n\nfunction upgrade (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      upgrade.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    const upgradeHandler = new UpgradeHandler(opts, callback)\n    this.dispatch({\n      ...opts,\n      method: opts.method || 'GET',\n      upgrade: opts.protocol || 'Websocket'\n    }, upgradeHandler)\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = upgrade\n","'use strict'\n\nmodule.exports.request = require('./api-request')\nmodule.exports.stream = require('./api-stream')\nmodule.exports.pipeline = require('./api-pipeline')\nmodule.exports.upgrade = require('./api-upgrade')\nmodule.exports.connect = require('./api-connect')\n","// Ported from https://github.com/nodejs/undici/pull/907\n\n'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('node:stream')\nconst { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require('../core/errors')\nconst util = require('../core/util')\nconst { ReadableStreamFrom } = require('../core/util')\n\nconst kConsume = Symbol('kConsume')\nconst kReading = Symbol('kReading')\nconst kBody = Symbol('kBody')\nconst kAbort = Symbol('kAbort')\nconst kContentType = Symbol('kContentType')\nconst kContentLength = Symbol('kContentLength')\n\nconst noop = () => {}\n\nclass BodyReadable extends Readable {\n  constructor ({\n    resume,\n    abort,\n    contentType = '',\n    contentLength,\n    highWaterMark = 64 * 1024 // Same as nodejs fs streams.\n  }) {\n    super({\n      autoDestroy: true,\n      read: resume,\n      highWaterMark\n    })\n\n    this._readableState.dataEmitted = false\n\n    this[kAbort] = abort\n    this[kConsume] = null\n    this[kBody] = null\n    this[kContentType] = contentType\n    this[kContentLength] = contentLength\n\n    // Is stream being consumed through Readable API?\n    // This is an optimization so that we avoid checking\n    // for 'data' and 'readable' listeners in the hot path\n    // inside push().\n    this[kReading] = false\n  }\n\n  destroy (err) {\n    if (!err && !this._readableState.endEmitted) {\n      err = new RequestAbortedError()\n    }\n\n    if (err) {\n      this[kAbort]()\n    }\n\n    return super.destroy(err)\n  }\n\n  _destroy (err, callback) {\n    // Workaround for Node \"bug\". If the stream is destroyed in same\n    // tick as it is created, then a user who is waiting for a\n    // promise (i.e micro tick) for installing a 'error' listener will\n    // never get a chance and will always encounter an unhandled exception.\n    if (!this[kReading]) {\n      setImmediate(() => {\n        callback(err)\n      })\n    } else {\n      callback(err)\n    }\n  }\n\n  on (ev, ...args) {\n    if (ev === 'data' || ev === 'readable') {\n      this[kReading] = true\n    }\n    return super.on(ev, ...args)\n  }\n\n  addListener (ev, ...args) {\n    return this.on(ev, ...args)\n  }\n\n  off (ev, ...args) {\n    const ret = super.off(ev, ...args)\n    if (ev === 'data' || ev === 'readable') {\n      this[kReading] = (\n        this.listenerCount('data') > 0 ||\n        this.listenerCount('readable') > 0\n      )\n    }\n    return ret\n  }\n\n  removeListener (ev, ...args) {\n    return this.off(ev, ...args)\n  }\n\n  push (chunk) {\n    if (this[kConsume] && chunk !== null) {\n      consumePush(this[kConsume], chunk)\n      return this[kReading] ? super.push(chunk) : true\n    }\n    return super.push(chunk)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-text\n  async text () {\n    return consume(this, 'text')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-json\n  async json () {\n    return consume(this, 'json')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-blob\n  async blob () {\n    return consume(this, 'blob')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bytes\n  async bytes () {\n    return consume(this, 'bytes')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n  async arrayBuffer () {\n    return consume(this, 'arrayBuffer')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-formdata\n  async formData () {\n    // TODO: Implement.\n    throw new NotSupportedError()\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bodyused\n  get bodyUsed () {\n    return util.isDisturbed(this)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-body\n  get body () {\n    if (!this[kBody]) {\n      this[kBody] = ReadableStreamFrom(this)\n      if (this[kConsume]) {\n        // TODO: Is this the best way to force a lock?\n        this[kBody].getReader() // Ensure stream is locked.\n        assert(this[kBody].locked)\n      }\n    }\n    return this[kBody]\n  }\n\n  async dump (opts) {\n    let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024\n    const signal = opts?.signal\n\n    if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) {\n      throw new InvalidArgumentError('signal must be an AbortSignal')\n    }\n\n    signal?.throwIfAborted()\n\n    if (this._readableState.closeEmitted) {\n      return null\n    }\n\n    return await new Promise((resolve, reject) => {\n      if (this[kContentLength] > limit) {\n        this.destroy(new AbortError())\n      }\n\n      const onAbort = () => {\n        this.destroy(signal.reason ?? new AbortError())\n      }\n      signal?.addEventListener('abort', onAbort)\n\n      this\n        .on('close', function () {\n          signal?.removeEventListener('abort', onAbort)\n          if (signal?.aborted) {\n            reject(signal.reason ?? new AbortError())\n          } else {\n            resolve(null)\n          }\n        })\n        .on('error', noop)\n        .on('data', function (chunk) {\n          limit -= chunk.length\n          if (limit <= 0) {\n            this.destroy()\n          }\n        })\n        .resume()\n    })\n  }\n}\n\n// https://streams.spec.whatwg.org/#readablestream-locked\nfunction isLocked (self) {\n  // Consume is an implicit lock.\n  return (self[kBody] && self[kBody].locked === true) || self[kConsume]\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction isUnusable (self) {\n  return util.isDisturbed(self) || isLocked(self)\n}\n\nasync function consume (stream, type) {\n  assert(!stream[kConsume])\n\n  return new Promise((resolve, reject) => {\n    if (isUnusable(stream)) {\n      const rState = stream._readableState\n      if (rState.destroyed && rState.closeEmitted === false) {\n        stream\n          .on('error', err => {\n            reject(err)\n          })\n          .on('close', () => {\n            reject(new TypeError('unusable'))\n          })\n      } else {\n        reject(rState.errored ?? new TypeError('unusable'))\n      }\n    } else {\n      queueMicrotask(() => {\n        stream[kConsume] = {\n          type,\n          stream,\n          resolve,\n          reject,\n          length: 0,\n          body: []\n        }\n\n        stream\n          .on('error', function (err) {\n            consumeFinish(this[kConsume], err)\n          })\n          .on('close', function () {\n            if (this[kConsume].body !== null) {\n              consumeFinish(this[kConsume], new RequestAbortedError())\n            }\n          })\n\n        consumeStart(stream[kConsume])\n      })\n    }\n  })\n}\n\nfunction consumeStart (consume) {\n  if (consume.body === null) {\n    return\n  }\n\n  const { _readableState: state } = consume.stream\n\n  if (state.bufferIndex) {\n    const start = state.bufferIndex\n    const end = state.buffer.length\n    for (let n = start; n < end; n++) {\n      consumePush(consume, state.buffer[n])\n    }\n  } else {\n    for (const chunk of state.buffer) {\n      consumePush(consume, chunk)\n    }\n  }\n\n  if (state.endEmitted) {\n    consumeEnd(this[kConsume])\n  } else {\n    consume.stream.on('end', function () {\n      consumeEnd(this[kConsume])\n    })\n  }\n\n  consume.stream.resume()\n\n  while (consume.stream.read() != null) {\n    // Loop\n  }\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n */\nfunction chunksDecode (chunks, length) {\n  if (chunks.length === 0 || length === 0) {\n    return ''\n  }\n  const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length)\n  const bufferLength = buffer.length\n\n  // Skip BOM.\n  const start =\n    bufferLength > 2 &&\n    buffer[0] === 0xef &&\n    buffer[1] === 0xbb &&\n    buffer[2] === 0xbf\n      ? 3\n      : 0\n  return buffer.utf8Slice(start, bufferLength)\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n * @returns {Uint8Array}\n */\nfunction chunksConcat (chunks, length) {\n  if (chunks.length === 0 || length === 0) {\n    return new Uint8Array(0)\n  }\n  if (chunks.length === 1) {\n    // fast-path\n    return new Uint8Array(chunks[0])\n  }\n  const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer)\n\n  let offset = 0\n  for (let i = 0; i < chunks.length; ++i) {\n    const chunk = chunks[i]\n    buffer.set(chunk, offset)\n    offset += chunk.length\n  }\n\n  return buffer\n}\n\nfunction consumeEnd (consume) {\n  const { type, body, resolve, stream, length } = consume\n\n  try {\n    if (type === 'text') {\n      resolve(chunksDecode(body, length))\n    } else if (type === 'json') {\n      resolve(JSON.parse(chunksDecode(body, length)))\n    } else if (type === 'arrayBuffer') {\n      resolve(chunksConcat(body, length).buffer)\n    } else if (type === 'blob') {\n      resolve(new Blob(body, { type: stream[kContentType] }))\n    } else if (type === 'bytes') {\n      resolve(chunksConcat(body, length))\n    }\n\n    consumeFinish(consume)\n  } catch (err) {\n    stream.destroy(err)\n  }\n}\n\nfunction consumePush (consume, chunk) {\n  consume.length += chunk.length\n  consume.body.push(chunk)\n}\n\nfunction consumeFinish (consume, err) {\n  if (consume.body === null) {\n    return\n  }\n\n  if (err) {\n    consume.reject(err)\n  } else {\n    consume.resolve()\n  }\n\n  consume.type = null\n  consume.stream = null\n  consume.resolve = null\n  consume.reject = null\n  consume.length = 0\n  consume.body = null\n}\n\nmodule.exports = { Readable: BodyReadable, chunksDecode }\n","const assert = require('node:assert')\nconst {\n  ResponseStatusCodeError\n} = require('../core/errors')\n\nconst { chunksDecode } = require('./readable')\nconst CHUNK_LIMIT = 128 * 1024\n\nasync function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {\n  assert(body)\n\n  let chunks = []\n  let length = 0\n\n  try {\n    for await (const chunk of body) {\n      chunks.push(chunk)\n      length += chunk.length\n      if (length > CHUNK_LIMIT) {\n        chunks = []\n        length = 0\n        break\n      }\n    }\n  } catch {\n    chunks = []\n    length = 0\n    // Do nothing....\n  }\n\n  const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`\n\n  if (statusCode === 204 || !contentType || !length) {\n    queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)))\n    return\n  }\n\n  const stackTraceLimit = Error.stackTraceLimit\n  Error.stackTraceLimit = 0\n  let payload\n\n  try {\n    if (isContentTypeApplicationJson(contentType)) {\n      payload = JSON.parse(chunksDecode(chunks, length))\n    } else if (isContentTypeText(contentType)) {\n      payload = chunksDecode(chunks, length)\n    }\n  } catch {\n    // process in a callback to avoid throwing in the microtask queue\n  } finally {\n    Error.stackTraceLimit = stackTraceLimit\n  }\n  queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)))\n}\n\nconst isContentTypeApplicationJson = (contentType) => {\n  return (\n    contentType.length > 15 &&\n    contentType[11] === '/' &&\n    contentType[0] === 'a' &&\n    contentType[1] === 'p' &&\n    contentType[2] === 'p' &&\n    contentType[3] === 'l' &&\n    contentType[4] === 'i' &&\n    contentType[5] === 'c' &&\n    contentType[6] === 'a' &&\n    contentType[7] === 't' &&\n    contentType[8] === 'i' &&\n    contentType[9] === 'o' &&\n    contentType[10] === 'n' &&\n    contentType[12] === 'j' &&\n    contentType[13] === 's' &&\n    contentType[14] === 'o' &&\n    contentType[15] === 'n'\n  )\n}\n\nconst isContentTypeText = (contentType) => {\n  return (\n    contentType.length > 4 &&\n    contentType[4] === '/' &&\n    contentType[0] === 't' &&\n    contentType[1] === 'e' &&\n    contentType[2] === 'x' &&\n    contentType[3] === 't'\n  )\n}\n\nmodule.exports = {\n  getResolveErrorBodyCallback,\n  isContentTypeApplicationJson,\n  isContentTypeText\n}\n","'use strict'\n\nconst net = require('node:net')\nconst assert = require('node:assert')\nconst util = require('./util')\nconst { InvalidArgumentError, ConnectTimeoutError } = require('./errors')\nconst timers = require('../util/timers')\n\nfunction noop () {}\n\nlet tls // include tls conditionally since it is not always available\n\n// TODO: session re-use does not wait for the first\n// connection to resolve the session and might therefore\n// resolve the same servername multiple times even when\n// re-use is enabled.\n\nlet SessionCache\n// FIXME: remove workaround when the Node bug is fixed\n// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\nif (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) {\n  SessionCache = class WeakSessionCache {\n    constructor (maxCachedSessions) {\n      this._maxCachedSessions = maxCachedSessions\n      this._sessionCache = new Map()\n      this._sessionRegistry = new global.FinalizationRegistry((key) => {\n        if (this._sessionCache.size < this._maxCachedSessions) {\n          return\n        }\n\n        const ref = this._sessionCache.get(key)\n        if (ref !== undefined && ref.deref() === undefined) {\n          this._sessionCache.delete(key)\n        }\n      })\n    }\n\n    get (sessionKey) {\n      const ref = this._sessionCache.get(sessionKey)\n      return ref ? ref.deref() : null\n    }\n\n    set (sessionKey, session) {\n      if (this._maxCachedSessions === 0) {\n        return\n      }\n\n      this._sessionCache.set(sessionKey, new WeakRef(session))\n      this._sessionRegistry.register(session, sessionKey)\n    }\n  }\n} else {\n  SessionCache = class SimpleSessionCache {\n    constructor (maxCachedSessions) {\n      this._maxCachedSessions = maxCachedSessions\n      this._sessionCache = new Map()\n    }\n\n    get (sessionKey) {\n      return this._sessionCache.get(sessionKey)\n    }\n\n    set (sessionKey, session) {\n      if (this._maxCachedSessions === 0) {\n        return\n      }\n\n      if (this._sessionCache.size >= this._maxCachedSessions) {\n        // remove the oldest session\n        const { value: oldestKey } = this._sessionCache.keys().next()\n        this._sessionCache.delete(oldestKey)\n      }\n\n      this._sessionCache.set(sessionKey, session)\n    }\n  }\n}\n\nfunction buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {\n  if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n    throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')\n  }\n\n  const options = { path: socketPath, ...opts }\n  const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)\n  timeout = timeout == null ? 10e3 : timeout\n  allowH2 = allowH2 != null ? allowH2 : false\n  return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n    let socket\n    if (protocol === 'https:') {\n      if (!tls) {\n        tls = require('node:tls')\n      }\n      servername = servername || options.servername || util.getServerName(host) || null\n\n      const sessionKey = servername || hostname\n      assert(sessionKey)\n\n      const session = customSession || sessionCache.get(sessionKey) || null\n\n      port = port || 443\n\n      socket = tls.connect({\n        highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...\n        ...options,\n        servername,\n        session,\n        localAddress,\n        // TODO(HTTP/2): Add support for h2c\n        ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],\n        socket: httpSocket, // upgrade socket connection\n        port,\n        host: hostname\n      })\n\n      socket\n        .on('session', function (session) {\n          // TODO (fix): Can a session become invalid once established? Don't think so?\n          sessionCache.set(sessionKey, session)\n        })\n    } else {\n      assert(!httpSocket, 'httpSocket can only be sent on TLS update')\n\n      port = port || 80\n\n      socket = net.connect({\n        highWaterMark: 64 * 1024, // Same as nodejs fs streams.\n        ...options,\n        localAddress,\n        port,\n        host: hostname\n      })\n    }\n\n    // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket\n    if (options.keepAlive == null || options.keepAlive) {\n      const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay\n      socket.setKeepAlive(true, keepAliveInitialDelay)\n    }\n\n    const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port })\n\n    socket\n      .setNoDelay(true)\n      .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {\n        queueMicrotask(clearConnectTimeout)\n\n        if (callback) {\n          const cb = callback\n          callback = null\n          cb(null, this)\n        }\n      })\n      .on('error', function (err) {\n        queueMicrotask(clearConnectTimeout)\n\n        if (callback) {\n          const cb = callback\n          callback = null\n          cb(err)\n        }\n      })\n\n    return socket\n  }\n}\n\n/**\n * @param {WeakRef} socketWeakRef\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n * @returns {() => void}\n */\nconst setupConnectTimeout = process.platform === 'win32'\n  ? (socketWeakRef, opts) => {\n      if (!opts.timeout) {\n        return noop\n      }\n\n      let s1 = null\n      let s2 = null\n      const fastTimer = timers.setFastTimeout(() => {\n      // setImmediate is added to make sure that we prioritize socket error events over timeouts\n        s1 = setImmediate(() => {\n        // Windows needs an extra setImmediate probably due to implementation differences in the socket logic\n          s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))\n        })\n      }, opts.timeout)\n      return () => {\n        timers.clearFastTimeout(fastTimer)\n        clearImmediate(s1)\n        clearImmediate(s2)\n      }\n    }\n  : (socketWeakRef, opts) => {\n      if (!opts.timeout) {\n        return noop\n      }\n\n      let s1 = null\n      const fastTimer = timers.setFastTimeout(() => {\n      // setImmediate is added to make sure that we prioritize socket error events over timeouts\n        s1 = setImmediate(() => {\n          onConnectTimeout(socketWeakRef.deref(), opts)\n        })\n      }, opts.timeout)\n      return () => {\n        timers.clearFastTimeout(fastTimer)\n        clearImmediate(s1)\n      }\n    }\n\n/**\n * @param {net.Socket} socket\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n */\nfunction onConnectTimeout (socket, opts) {\n  // The socket could be already garbage collected\n  if (socket == null) {\n    return\n  }\n\n  let message = 'Connect Timeout Error'\n  if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {\n    message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`\n  } else {\n    message += ` (attempted address: ${opts.hostname}:${opts.port},`\n  }\n\n  message += ` timeout: ${opts.timeout}ms)`\n\n  util.destroy(socket, new ConnectTimeoutError(message))\n}\n\nmodule.exports = buildConnector\n","'use strict'\n\n/** @type {Record} */\nconst headerNameLowerCasedRecord = {}\n\n// https://developer.mozilla.org/docs/Web/HTTP/Headers\nconst wellknownHeaderNames = [\n  'Accept',\n  'Accept-Encoding',\n  'Accept-Language',\n  'Accept-Ranges',\n  'Access-Control-Allow-Credentials',\n  'Access-Control-Allow-Headers',\n  'Access-Control-Allow-Methods',\n  'Access-Control-Allow-Origin',\n  'Access-Control-Expose-Headers',\n  'Access-Control-Max-Age',\n  'Access-Control-Request-Headers',\n  'Access-Control-Request-Method',\n  'Age',\n  'Allow',\n  'Alt-Svc',\n  'Alt-Used',\n  'Authorization',\n  'Cache-Control',\n  'Clear-Site-Data',\n  'Connection',\n  'Content-Disposition',\n  'Content-Encoding',\n  'Content-Language',\n  'Content-Length',\n  'Content-Location',\n  'Content-Range',\n  'Content-Security-Policy',\n  'Content-Security-Policy-Report-Only',\n  'Content-Type',\n  'Cookie',\n  'Cross-Origin-Embedder-Policy',\n  'Cross-Origin-Opener-Policy',\n  'Cross-Origin-Resource-Policy',\n  'Date',\n  'Device-Memory',\n  'Downlink',\n  'ECT',\n  'ETag',\n  'Expect',\n  'Expect-CT',\n  'Expires',\n  'Forwarded',\n  'From',\n  'Host',\n  'If-Match',\n  'If-Modified-Since',\n  'If-None-Match',\n  'If-Range',\n  'If-Unmodified-Since',\n  'Keep-Alive',\n  'Last-Modified',\n  'Link',\n  'Location',\n  'Max-Forwards',\n  'Origin',\n  'Permissions-Policy',\n  'Pragma',\n  'Proxy-Authenticate',\n  'Proxy-Authorization',\n  'RTT',\n  'Range',\n  'Referer',\n  'Referrer-Policy',\n  'Refresh',\n  'Retry-After',\n  'Sec-WebSocket-Accept',\n  'Sec-WebSocket-Extensions',\n  'Sec-WebSocket-Key',\n  'Sec-WebSocket-Protocol',\n  'Sec-WebSocket-Version',\n  'Server',\n  'Server-Timing',\n  'Service-Worker-Allowed',\n  'Service-Worker-Navigation-Preload',\n  'Set-Cookie',\n  'SourceMap',\n  'Strict-Transport-Security',\n  'Supports-Loading-Mode',\n  'TE',\n  'Timing-Allow-Origin',\n  'Trailer',\n  'Transfer-Encoding',\n  'Upgrade',\n  'Upgrade-Insecure-Requests',\n  'User-Agent',\n  'Vary',\n  'Via',\n  'WWW-Authenticate',\n  'X-Content-Type-Options',\n  'X-DNS-Prefetch-Control',\n  'X-Frame-Options',\n  'X-Permitted-Cross-Domain-Policies',\n  'X-Powered-By',\n  'X-Requested-With',\n  'X-XSS-Protection'\n]\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n  const key = wellknownHeaderNames[i]\n  const lowerCasedKey = key.toLowerCase()\n  headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =\n    lowerCasedKey\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(headerNameLowerCasedRecord, null)\n\nmodule.exports = {\n  wellknownHeaderNames,\n  headerNameLowerCasedRecord\n}\n","'use strict'\nconst diagnosticsChannel = require('node:diagnostics_channel')\nconst util = require('node:util')\n\nconst undiciDebugLog = util.debuglog('undici')\nconst fetchDebuglog = util.debuglog('fetch')\nconst websocketDebuglog = util.debuglog('websocket')\nlet isClientSet = false\nconst channels = {\n  // Client\n  beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),\n  connected: diagnosticsChannel.channel('undici:client:connected'),\n  connectError: diagnosticsChannel.channel('undici:client:connectError'),\n  sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),\n  // Request\n  create: diagnosticsChannel.channel('undici:request:create'),\n  bodySent: diagnosticsChannel.channel('undici:request:bodySent'),\n  headers: diagnosticsChannel.channel('undici:request:headers'),\n  trailers: diagnosticsChannel.channel('undici:request:trailers'),\n  error: diagnosticsChannel.channel('undici:request:error'),\n  // WebSocket\n  open: diagnosticsChannel.channel('undici:websocket:open'),\n  close: diagnosticsChannel.channel('undici:websocket:close'),\n  socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),\n  ping: diagnosticsChannel.channel('undici:websocket:ping'),\n  pong: diagnosticsChannel.channel('undici:websocket:pong')\n}\n\nif (undiciDebugLog.enabled || fetchDebuglog.enabled) {\n  const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog\n\n  // Track all Client events\n  diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host }\n    } = evt\n    debuglog(\n      'connecting to %s using %s%s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host }\n    } = evt\n    debuglog(\n      'connected to %s using %s%s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host },\n      error\n    } = evt\n    debuglog(\n      'connection to %s using %s%s errored - %s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version,\n      error.message\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n    const {\n      request: { method, path, origin }\n    } = evt\n    debuglog('sending request to %s %s/%s', method, origin, path)\n  })\n\n  // Track Request events\n  diagnosticsChannel.channel('undici:request:headers').subscribe(evt => {\n    const {\n      request: { method, path, origin },\n      response: { statusCode }\n    } = evt\n    debuglog(\n      'received response to %s %s/%s - HTTP %d',\n      method,\n      origin,\n      path,\n      statusCode\n    )\n  })\n\n  diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => {\n    const {\n      request: { method, path, origin }\n    } = evt\n    debuglog('trailers received from %s %s/%s', method, origin, path)\n  })\n\n  diagnosticsChannel.channel('undici:request:error').subscribe(evt => {\n    const {\n      request: { method, path, origin },\n      error\n    } = evt\n    debuglog(\n      'request to %s %s/%s errored - %s',\n      method,\n      origin,\n      path,\n      error.message\n    )\n  })\n\n  isClientSet = true\n}\n\nif (websocketDebuglog.enabled) {\n  if (!isClientSet) {\n    const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog\n    diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host }\n      } = evt\n      debuglog(\n        'connecting to %s%s using %s%s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host }\n      } = evt\n      debuglog(\n        'connected to %s%s using %s%s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host },\n        error\n      } = evt\n      debuglog(\n        'connection to %s%s using %s%s errored - %s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version,\n        error.message\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n      const {\n        request: { method, path, origin }\n      } = evt\n      debuglog('sending request to %s %s/%s', method, origin, path)\n    })\n  }\n\n  // Track all WebSocket events\n  diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => {\n    const {\n      address: { address, port }\n    } = evt\n    websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '')\n  })\n\n  diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => {\n    const { websocket, code, reason } = evt\n    websocketDebuglog(\n      'closed connection to %s - %s %s',\n      websocket.url,\n      code,\n      reason\n    )\n  })\n\n  diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => {\n    websocketDebuglog('connection errored - %s', err.message)\n  })\n\n  diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => {\n    websocketDebuglog('ping received')\n  })\n\n  diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => {\n    websocketDebuglog('pong received')\n  })\n}\n\nmodule.exports = {\n  channels\n}\n","'use strict'\n\nconst kUndiciError = Symbol.for('undici.error.UND_ERR')\nclass UndiciError extends Error {\n  constructor (message) {\n    super(message)\n    this.name = 'UndiciError'\n    this.code = 'UND_ERR'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kUndiciError] === true\n  }\n\n  [kUndiciError] = true\n}\n\nconst kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT')\nclass ConnectTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ConnectTimeoutError'\n    this.message = message || 'Connect Timeout Error'\n    this.code = 'UND_ERR_CONNECT_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kConnectTimeoutError] === true\n  }\n\n  [kConnectTimeoutError] = true\n}\n\nconst kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT')\nclass HeadersTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'HeadersTimeoutError'\n    this.message = message || 'Headers Timeout Error'\n    this.code = 'UND_ERR_HEADERS_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHeadersTimeoutError] === true\n  }\n\n  [kHeadersTimeoutError] = true\n}\n\nconst kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW')\nclass HeadersOverflowError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'HeadersOverflowError'\n    this.message = message || 'Headers Overflow Error'\n    this.code = 'UND_ERR_HEADERS_OVERFLOW'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHeadersOverflowError] === true\n  }\n\n  [kHeadersOverflowError] = true\n}\n\nconst kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT')\nclass BodyTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'BodyTimeoutError'\n    this.message = message || 'Body Timeout Error'\n    this.code = 'UND_ERR_BODY_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kBodyTimeoutError] === true\n  }\n\n  [kBodyTimeoutError] = true\n}\n\nconst kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE')\nclass ResponseStatusCodeError extends UndiciError {\n  constructor (message, statusCode, headers, body) {\n    super(message)\n    this.name = 'ResponseStatusCodeError'\n    this.message = message || 'Response Status Code Error'\n    this.code = 'UND_ERR_RESPONSE_STATUS_CODE'\n    this.body = body\n    this.status = statusCode\n    this.statusCode = statusCode\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseStatusCodeError] === true\n  }\n\n  [kResponseStatusCodeError] = true\n}\n\nconst kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG')\nclass InvalidArgumentError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InvalidArgumentError'\n    this.message = message || 'Invalid Argument Error'\n    this.code = 'UND_ERR_INVALID_ARG'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInvalidArgumentError] === true\n  }\n\n  [kInvalidArgumentError] = true\n}\n\nconst kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE')\nclass InvalidReturnValueError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InvalidReturnValueError'\n    this.message = message || 'Invalid Return Value Error'\n    this.code = 'UND_ERR_INVALID_RETURN_VALUE'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInvalidReturnValueError] === true\n  }\n\n  [kInvalidReturnValueError] = true\n}\n\nconst kAbortError = Symbol.for('undici.error.UND_ERR_ABORT')\nclass AbortError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'AbortError'\n    this.message = message || 'The operation was aborted'\n    this.code = 'UND_ERR_ABORT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kAbortError] === true\n  }\n\n  [kAbortError] = true\n}\n\nconst kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED')\nclass RequestAbortedError extends AbortError {\n  constructor (message) {\n    super(message)\n    this.name = 'AbortError'\n    this.message = message || 'Request aborted'\n    this.code = 'UND_ERR_ABORTED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestAbortedError] === true\n  }\n\n  [kRequestAbortedError] = true\n}\n\nconst kInformationalError = Symbol.for('undici.error.UND_ERR_INFO')\nclass InformationalError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InformationalError'\n    this.message = message || 'Request information'\n    this.code = 'UND_ERR_INFO'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInformationalError] === true\n  }\n\n  [kInformationalError] = true\n}\n\nconst kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH')\nclass RequestContentLengthMismatchError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'RequestContentLengthMismatchError'\n    this.message = message || 'Request body length does not match content-length header'\n    this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestContentLengthMismatchError] === true\n  }\n\n  [kRequestContentLengthMismatchError] = true\n}\n\nconst kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH')\nclass ResponseContentLengthMismatchError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ResponseContentLengthMismatchError'\n    this.message = message || 'Response body length does not match content-length header'\n    this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseContentLengthMismatchError] === true\n  }\n\n  [kResponseContentLengthMismatchError] = true\n}\n\nconst kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED')\nclass ClientDestroyedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ClientDestroyedError'\n    this.message = message || 'The client is destroyed'\n    this.code = 'UND_ERR_DESTROYED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kClientDestroyedError] === true\n  }\n\n  [kClientDestroyedError] = true\n}\n\nconst kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED')\nclass ClientClosedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ClientClosedError'\n    this.message = message || 'The client is closed'\n    this.code = 'UND_ERR_CLOSED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kClientClosedError] === true\n  }\n\n  [kClientClosedError] = true\n}\n\nconst kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET')\nclass SocketError extends UndiciError {\n  constructor (message, socket) {\n    super(message)\n    this.name = 'SocketError'\n    this.message = message || 'Socket error'\n    this.code = 'UND_ERR_SOCKET'\n    this.socket = socket\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kSocketError] === true\n  }\n\n  [kSocketError] = true\n}\n\nconst kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED')\nclass NotSupportedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'NotSupportedError'\n    this.message = message || 'Not supported error'\n    this.code = 'UND_ERR_NOT_SUPPORTED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kNotSupportedError] === true\n  }\n\n  [kNotSupportedError] = true\n}\n\nconst kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM')\nclass BalancedPoolMissingUpstreamError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'MissingUpstreamError'\n    this.message = message || 'No upstream has been added to the BalancedPool'\n    this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kBalancedPoolMissingUpstreamError] === true\n  }\n\n  [kBalancedPoolMissingUpstreamError] = true\n}\n\nconst kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')\nclass HTTPParserError extends Error {\n  constructor (message, code, data) {\n    super(message)\n    this.name = 'HTTPParserError'\n    this.code = code ? `HPE_${code}` : undefined\n    this.data = data ? data.toString() : undefined\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHTTPParserError] === true\n  }\n\n  [kHTTPParserError] = true\n}\n\nconst kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE')\nclass ResponseExceededMaxSizeError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ResponseExceededMaxSizeError'\n    this.message = message || 'Response content exceeded max size'\n    this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseExceededMaxSizeError] === true\n  }\n\n  [kResponseExceededMaxSizeError] = true\n}\n\nconst kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY')\nclass RequestRetryError extends UndiciError {\n  constructor (message, code, { headers, data }) {\n    super(message)\n    this.name = 'RequestRetryError'\n    this.message = message || 'Request retry error'\n    this.code = 'UND_ERR_REQ_RETRY'\n    this.statusCode = code\n    this.data = data\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestRetryError] === true\n  }\n\n  [kRequestRetryError] = true\n}\n\nconst kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')\nclass ResponseError extends UndiciError {\n  constructor (message, code, { headers, data }) {\n    super(message)\n    this.name = 'ResponseError'\n    this.message = message || 'Response error'\n    this.code = 'UND_ERR_RESPONSE'\n    this.statusCode = code\n    this.data = data\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseError] === true\n  }\n\n  [kResponseError] = true\n}\n\nconst kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS')\nclass SecureProxyConnectionError extends UndiciError {\n  constructor (cause, message, options) {\n    super(message, { cause, ...(options ?? {}) })\n    this.name = 'SecureProxyConnectionError'\n    this.message = message || 'Secure Proxy Connection failed'\n    this.code = 'UND_ERR_PRX_TLS'\n    this.cause = cause\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kSecureProxyConnectionError] === true\n  }\n\n  [kSecureProxyConnectionError] = true\n}\n\nconst kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED')\nclass MessageSizeExceededError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'MessageSizeExceededError'\n    this.message = message || 'Max decompressed message size exceeded'\n    this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kMessageSizeExceededError] === true\n  }\n\n  get [kMessageSizeExceededError] () {\n    return true\n  }\n}\n\nmodule.exports = {\n  AbortError,\n  HTTPParserError,\n  UndiciError,\n  HeadersTimeoutError,\n  HeadersOverflowError,\n  BodyTimeoutError,\n  RequestContentLengthMismatchError,\n  ConnectTimeoutError,\n  ResponseStatusCodeError,\n  InvalidArgumentError,\n  InvalidReturnValueError,\n  RequestAbortedError,\n  ClientDestroyedError,\n  ClientClosedError,\n  InformationalError,\n  SocketError,\n  NotSupportedError,\n  ResponseContentLengthMismatchError,\n  BalancedPoolMissingUpstreamError,\n  ResponseExceededMaxSizeError,\n  RequestRetryError,\n  ResponseError,\n  SecureProxyConnectionError,\n  MessageSizeExceededError\n}\n","'use strict'\n\nconst {\n  InvalidArgumentError,\n  NotSupportedError\n} = require('./errors')\nconst assert = require('node:assert')\nconst {\n  isValidHTTPToken,\n  isValidHeaderValue,\n  isStream,\n  destroy,\n  isBuffer,\n  isFormDataLike,\n  isIterable,\n  isBlobLike,\n  buildURL,\n  validateHandler,\n  getServerName,\n  normalizedMethodRecords\n} = require('./util')\nconst { channels } = require('./diagnostics.js')\nconst { headerNameLowerCasedRecord } = require('./constants')\n\n// Verifies that a given path is valid does not contain control chars \\x00 to \\x20\nconst invalidPathRegex = /[^\\u0021-\\u00ff]/\n\nconst kHandler = Symbol('handler')\n\nclass Request {\n  constructor (origin, {\n    path,\n    method,\n    body,\n    headers,\n    query,\n    idempotent,\n    blocking,\n    upgrade,\n    headersTimeout,\n    bodyTimeout,\n    reset,\n    throwOnError,\n    expectContinue,\n    servername\n  }, handler) {\n    if (typeof path !== 'string') {\n      throw new InvalidArgumentError('path must be a string')\n    } else if (\n      path[0] !== '/' &&\n      !(path.startsWith('http://') || path.startsWith('https://')) &&\n      method !== 'CONNECT'\n    ) {\n      throw new InvalidArgumentError('path must be an absolute URL or start with a slash')\n    } else if (invalidPathRegex.test(path)) {\n      throw new InvalidArgumentError('invalid request path')\n    }\n\n    if (typeof method !== 'string') {\n      throw new InvalidArgumentError('method must be a string')\n    } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {\n      throw new InvalidArgumentError('invalid request method')\n    }\n\n    if (upgrade && typeof upgrade !== 'string') {\n      throw new InvalidArgumentError('upgrade must be a string')\n    }\n\n    if (upgrade && !isValidHeaderValue(upgrade)) {\n      throw new InvalidArgumentError('invalid upgrade header')\n    }\n\n    if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n      throw new InvalidArgumentError('invalid headersTimeout')\n    }\n\n    if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n      throw new InvalidArgumentError('invalid bodyTimeout')\n    }\n\n    if (reset != null && typeof reset !== 'boolean') {\n      throw new InvalidArgumentError('invalid reset')\n    }\n\n    if (expectContinue != null && typeof expectContinue !== 'boolean') {\n      throw new InvalidArgumentError('invalid expectContinue')\n    }\n\n    this.headersTimeout = headersTimeout\n\n    this.bodyTimeout = bodyTimeout\n\n    this.throwOnError = throwOnError === true\n\n    this.method = method\n\n    this.abort = null\n\n    if (body == null) {\n      this.body = null\n    } else if (isStream(body)) {\n      this.body = body\n\n      const rState = this.body._readableState\n      if (!rState || !rState.autoDestroy) {\n        this.endHandler = function autoDestroy () {\n          destroy(this)\n        }\n        this.body.on('end', this.endHandler)\n      }\n\n      this.errorHandler = err => {\n        if (this.abort) {\n          this.abort(err)\n        } else {\n          this.error = err\n        }\n      }\n      this.body.on('error', this.errorHandler)\n    } else if (isBuffer(body)) {\n      this.body = body.byteLength ? body : null\n    } else if (ArrayBuffer.isView(body)) {\n      this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null\n    } else if (body instanceof ArrayBuffer) {\n      this.body = body.byteLength ? Buffer.from(body) : null\n    } else if (typeof body === 'string') {\n      this.body = body.length ? Buffer.from(body) : null\n    } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {\n      this.body = body\n    } else {\n      throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')\n    }\n\n    this.completed = false\n\n    this.aborted = false\n\n    this.upgrade = upgrade || null\n\n    this.path = query ? buildURL(path, query) : path\n\n    this.origin = origin\n\n    this.idempotent = idempotent == null\n      ? method === 'HEAD' || method === 'GET'\n      : idempotent\n\n    this.blocking = blocking == null ? false : blocking\n\n    this.reset = reset == null ? null : reset\n\n    this.host = null\n\n    this.contentLength = null\n\n    this.contentType = null\n\n    this.headers = []\n\n    // Only for H2\n    this.expectContinue = expectContinue != null ? expectContinue : false\n\n    if (Array.isArray(headers)) {\n      if (headers.length % 2 !== 0) {\n        throw new InvalidArgumentError('headers array must be even')\n      }\n      for (let i = 0; i < headers.length; i += 2) {\n        processHeader(this, headers[i], headers[i + 1])\n      }\n    } else if (headers && typeof headers === 'object') {\n      if (headers[Symbol.iterator]) {\n        for (const header of headers) {\n          if (!Array.isArray(header) || header.length !== 2) {\n            throw new InvalidArgumentError('headers must be in key-value pair format')\n          }\n          processHeader(this, header[0], header[1])\n        }\n      } else {\n        const keys = Object.keys(headers)\n        for (let i = 0; i < keys.length; ++i) {\n          processHeader(this, keys[i], headers[keys[i]])\n        }\n      }\n    } else if (headers != null) {\n      throw new InvalidArgumentError('headers must be an object or an array')\n    }\n\n    validateHandler(handler, method, upgrade)\n\n    this.servername = servername || getServerName(this.host)\n\n    this[kHandler] = handler\n\n    if (channels.create.hasSubscribers) {\n      channels.create.publish({ request: this })\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this[kHandler].onBodySent) {\n      try {\n        return this[kHandler].onBodySent(chunk)\n      } catch (err) {\n        this.abort(err)\n      }\n    }\n  }\n\n  onRequestSent () {\n    if (channels.bodySent.hasSubscribers) {\n      channels.bodySent.publish({ request: this })\n    }\n\n    if (this[kHandler].onRequestSent) {\n      try {\n        return this[kHandler].onRequestSent()\n      } catch (err) {\n        this.abort(err)\n      }\n    }\n  }\n\n  onConnect (abort) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    if (this.error) {\n      abort(this.error)\n    } else {\n      this.abort = abort\n      return this[kHandler].onConnect(abort)\n    }\n  }\n\n  onResponseStarted () {\n    return this[kHandler].onResponseStarted?.()\n  }\n\n  onHeaders (statusCode, headers, resume, statusText) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    if (channels.headers.hasSubscribers) {\n      channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n    }\n\n    try {\n      return this[kHandler].onHeaders(statusCode, headers, resume, statusText)\n    } catch (err) {\n      this.abort(err)\n    }\n  }\n\n  onData (chunk) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    try {\n      return this[kHandler].onData(chunk)\n    } catch (err) {\n      this.abort(err)\n      return false\n    }\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    return this[kHandler].onUpgrade(statusCode, headers, socket)\n  }\n\n  onComplete (trailers) {\n    this.onFinally()\n\n    assert(!this.aborted)\n\n    this.completed = true\n    if (channels.trailers.hasSubscribers) {\n      channels.trailers.publish({ request: this, trailers })\n    }\n\n    try {\n      return this[kHandler].onComplete(trailers)\n    } catch (err) {\n      // TODO (fix): This might be a bad idea?\n      this.onError(err)\n    }\n  }\n\n  onError (error) {\n    this.onFinally()\n\n    if (channels.error.hasSubscribers) {\n      channels.error.publish({ request: this, error })\n    }\n\n    if (this.aborted) {\n      return\n    }\n    this.aborted = true\n\n    return this[kHandler].onError(error)\n  }\n\n  onFinally () {\n    if (this.errorHandler) {\n      this.body.off('error', this.errorHandler)\n      this.errorHandler = null\n    }\n\n    if (this.endHandler) {\n      this.body.off('end', this.endHandler)\n      this.endHandler = null\n    }\n  }\n\n  addHeader (key, value) {\n    processHeader(this, key, value)\n    return this\n  }\n}\n\nfunction processHeader (request, key, val) {\n  if (val && (typeof val === 'object' && !Array.isArray(val))) {\n    throw new InvalidArgumentError(`invalid ${key} header`)\n  } else if (val === undefined) {\n    return\n  }\n\n  let headerName = headerNameLowerCasedRecord[key]\n\n  if (headerName === undefined) {\n    headerName = key.toLowerCase()\n    if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {\n      throw new InvalidArgumentError('invalid header key')\n    }\n  }\n\n  if (Array.isArray(val)) {\n    const arr = []\n    for (let i = 0; i < val.length; i++) {\n      if (typeof val[i] === 'string') {\n        if (!isValidHeaderValue(val[i])) {\n          throw new InvalidArgumentError(`invalid ${key} header`)\n        }\n        arr.push(val[i])\n      } else if (val[i] === null) {\n        arr.push('')\n      } else if (typeof val[i] === 'object') {\n        throw new InvalidArgumentError(`invalid ${key} header`)\n      } else {\n        arr.push(`${val[i]}`)\n      }\n    }\n    val = arr\n  } else if (typeof val === 'string') {\n    if (!isValidHeaderValue(val)) {\n      throw new InvalidArgumentError(`invalid ${key} header`)\n    }\n  } else if (val === null) {\n    val = ''\n  } else {\n    val = `${val}`\n  }\n\n  if (headerName === 'host') {\n    if (request.host !== null) {\n      throw new InvalidArgumentError('duplicate host header')\n    }\n    if (typeof val !== 'string') {\n      throw new InvalidArgumentError('invalid host header')\n    }\n    // Consumed by Client\n    request.host = val\n  } else if (headerName === 'content-length') {\n    if (request.contentLength !== null) {\n      throw new InvalidArgumentError('duplicate content-length header')\n    }\n    request.contentLength = parseInt(val, 10)\n    if (!Number.isFinite(request.contentLength)) {\n      throw new InvalidArgumentError('invalid content-length header')\n    }\n  } else if (request.contentType === null && headerName === 'content-type') {\n    request.contentType = val\n    request.headers.push(key, val)\n  } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {\n    throw new InvalidArgumentError(`invalid ${headerName} header`)\n  } else if (headerName === 'connection') {\n    const value = typeof val === 'string' ? val.toLowerCase() : null\n    if (value !== 'close' && value !== 'keep-alive') {\n      throw new InvalidArgumentError('invalid connection header')\n    }\n\n    if (value === 'close') {\n      request.reset = true\n    }\n  } else if (headerName === 'expect') {\n    throw new NotSupportedError('expect header not supported')\n  } else {\n    request.headers.push(key, val)\n  }\n}\n\nmodule.exports = Request\n","module.exports = {\n  kClose: Symbol('close'),\n  kDestroy: Symbol('destroy'),\n  kDispatch: Symbol('dispatch'),\n  kUrl: Symbol('url'),\n  kWriting: Symbol('writing'),\n  kResuming: Symbol('resuming'),\n  kQueue: Symbol('queue'),\n  kConnect: Symbol('connect'),\n  kConnecting: Symbol('connecting'),\n  kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),\n  kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),\n  kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),\n  kKeepAliveTimeoutValue: Symbol('keep alive timeout'),\n  kKeepAlive: Symbol('keep alive'),\n  kHeadersTimeout: Symbol('headers timeout'),\n  kBodyTimeout: Symbol('body timeout'),\n  kServerName: Symbol('server name'),\n  kLocalAddress: Symbol('local address'),\n  kHost: Symbol('host'),\n  kNoRef: Symbol('no ref'),\n  kBodyUsed: Symbol('used'),\n  kBody: Symbol('abstracted request body'),\n  kRunning: Symbol('running'),\n  kBlocking: Symbol('blocking'),\n  kPending: Symbol('pending'),\n  kSize: Symbol('size'),\n  kBusy: Symbol('busy'),\n  kQueued: Symbol('queued'),\n  kFree: Symbol('free'),\n  kConnected: Symbol('connected'),\n  kClosed: Symbol('closed'),\n  kNeedDrain: Symbol('need drain'),\n  kReset: Symbol('reset'),\n  kDestroyed: Symbol.for('nodejs.stream.destroyed'),\n  kResume: Symbol('resume'),\n  kOnError: Symbol('on error'),\n  kMaxHeadersSize: Symbol('max headers size'),\n  kRunningIdx: Symbol('running index'),\n  kPendingIdx: Symbol('pending index'),\n  kError: Symbol('error'),\n  kClients: Symbol('clients'),\n  kClient: Symbol('client'),\n  kParser: Symbol('parser'),\n  kOnDestroyed: Symbol('destroy callbacks'),\n  kPipelining: Symbol('pipelining'),\n  kSocket: Symbol('socket'),\n  kHostHeader: Symbol('host header'),\n  kConnector: Symbol('connector'),\n  kStrictContentLength: Symbol('strict content length'),\n  kMaxRedirections: Symbol('maxRedirections'),\n  kMaxRequests: Symbol('maxRequestsPerClient'),\n  kProxy: Symbol('proxy agent options'),\n  kCounter: Symbol('socket request counter'),\n  kInterceptors: Symbol('dispatch interceptors'),\n  kMaxResponseSize: Symbol('max response size'),\n  kHTTP2Session: Symbol('http2Session'),\n  kHTTP2SessionState: Symbol('http2Session state'),\n  kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),\n  kConstruct: Symbol('constructable'),\n  kListeners: Symbol('listeners'),\n  kHTTPContext: Symbol('http context'),\n  kMaxConcurrentStreams: Symbol('max concurrent streams'),\n  kNoProxyAgent: Symbol('no proxy agent'),\n  kHttpProxyAgent: Symbol('http proxy agent'),\n  kHttpsProxyAgent: Symbol('https proxy agent')\n}\n","'use strict'\n\nconst {\n  wellknownHeaderNames,\n  headerNameLowerCasedRecord\n} = require('./constants')\n\nclass TstNode {\n  /** @type {any} */\n  value = null\n  /** @type {null | TstNode} */\n  left = null\n  /** @type {null | TstNode} */\n  middle = null\n  /** @type {null | TstNode} */\n  right = null\n  /** @type {number} */\n  code\n  /**\n   * @param {string} key\n   * @param {any} value\n   * @param {number} index\n   */\n  constructor (key, value, index) {\n    if (index === undefined || index >= key.length) {\n      throw new TypeError('Unreachable')\n    }\n    const code = this.code = key.charCodeAt(index)\n    // check code is ascii string\n    if (code > 0x7F) {\n      throw new TypeError('key must be ascii string')\n    }\n    if (key.length !== ++index) {\n      this.middle = new TstNode(key, value, index)\n    } else {\n      this.value = value\n    }\n  }\n\n  /**\n   * @param {string} key\n   * @param {any} value\n   */\n  add (key, value) {\n    const length = key.length\n    if (length === 0) {\n      throw new TypeError('Unreachable')\n    }\n    let index = 0\n    let node = this\n    while (true) {\n      const code = key.charCodeAt(index)\n      // check code is ascii string\n      if (code > 0x7F) {\n        throw new TypeError('key must be ascii string')\n      }\n      if (node.code === code) {\n        if (length === ++index) {\n          node.value = value\n          break\n        } else if (node.middle !== null) {\n          node = node.middle\n        } else {\n          node.middle = new TstNode(key, value, index)\n          break\n        }\n      } else if (node.code < code) {\n        if (node.left !== null) {\n          node = node.left\n        } else {\n          node.left = new TstNode(key, value, index)\n          break\n        }\n      } else if (node.right !== null) {\n        node = node.right\n      } else {\n        node.right = new TstNode(key, value, index)\n        break\n      }\n    }\n  }\n\n  /**\n   * @param {Uint8Array} key\n   * @return {TstNode | null}\n   */\n  search (key) {\n    const keylength = key.length\n    let index = 0\n    let node = this\n    while (node !== null && index < keylength) {\n      let code = key[index]\n      // A-Z\n      // First check if it is bigger than 0x5a.\n      // Lowercase letters have higher char codes than uppercase ones.\n      // Also we assume that headers will mostly contain lowercase characters.\n      if (code <= 0x5a && code >= 0x41) {\n        // Lowercase for uppercase.\n        code |= 32\n      }\n      while (node !== null) {\n        if (code === node.code) {\n          if (keylength === ++index) {\n            // Returns Node since it is the last key.\n            return node\n          }\n          node = node.middle\n          break\n        }\n        node = node.code < code ? node.left : node.right\n      }\n    }\n    return null\n  }\n}\n\nclass TernarySearchTree {\n  /** @type {TstNode | null} */\n  node = null\n\n  /**\n   * @param {string} key\n   * @param {any} value\n   * */\n  insert (key, value) {\n    if (this.node === null) {\n      this.node = new TstNode(key, value, 0)\n    } else {\n      this.node.add(key, value)\n    }\n  }\n\n  /**\n   * @param {Uint8Array} key\n   * @return {any}\n   */\n  lookup (key) {\n    return this.node?.search(key)?.value ?? null\n  }\n}\n\nconst tree = new TernarySearchTree()\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n  const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]\n  tree.insert(key, key)\n}\n\nmodule.exports = {\n  TernarySearchTree,\n  tree\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')\nconst { IncomingMessage } = require('node:http')\nconst stream = require('node:stream')\nconst net = require('node:net')\nconst { Blob } = require('node:buffer')\nconst nodeUtil = require('node:util')\nconst { stringify } = require('node:querystring')\nconst { EventEmitter: EE } = require('node:events')\nconst { InvalidArgumentError } = require('./errors')\nconst { headerNameLowerCasedRecord } = require('./constants')\nconst { tree } = require('./tree')\n\nconst [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))\n\nclass BodyAsyncIterable {\n  constructor (body) {\n    this[kBody] = body\n    this[kBodyUsed] = false\n  }\n\n  async * [Symbol.asyncIterator] () {\n    assert(!this[kBodyUsed], 'disturbed')\n    this[kBodyUsed] = true\n    yield * this[kBody]\n  }\n}\n\nfunction wrapRequestBody (body) {\n  if (isStream(body)) {\n    // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n    // so that it can be dispatched again?\n    // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n    if (bodyLength(body) === 0) {\n      body\n        .on('data', function () {\n          assert(false)\n        })\n    }\n\n    if (typeof body.readableDidRead !== 'boolean') {\n      body[kBodyUsed] = false\n      EE.prototype.on.call(body, 'data', function () {\n        this[kBodyUsed] = true\n      })\n    }\n\n    return body\n  } else if (body && typeof body.pipeTo === 'function') {\n    // TODO (fix): We can't access ReadableStream internal state\n    // to determine whether or not it has been disturbed. This is just\n    // a workaround.\n    return new BodyAsyncIterable(body)\n  } else if (\n    body &&\n    typeof body !== 'string' &&\n    !ArrayBuffer.isView(body) &&\n    isIterable(body)\n  ) {\n    // TODO: Should we allow re-using iterable if !this.opts.idempotent\n    // or through some other flag?\n    return new BodyAsyncIterable(body)\n  } else {\n    return body\n  }\n}\n\nfunction nop () {}\n\nfunction isStream (obj) {\n  return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'\n}\n\n// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)\nfunction isBlobLike (object) {\n  if (object === null) {\n    return false\n  } else if (object instanceof Blob) {\n    return true\n  } else if (typeof object !== 'object') {\n    return false\n  } else {\n    const sTag = object[Symbol.toStringTag]\n\n    return (sTag === 'Blob' || sTag === 'File') && (\n      ('stream' in object && typeof object.stream === 'function') ||\n      ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')\n    )\n  }\n}\n\nfunction buildURL (url, queryParams) {\n  if (url.includes('?') || url.includes('#')) {\n    throw new Error('Query params cannot be passed when url already contains \"?\" or \"#\".')\n  }\n\n  const stringified = stringify(queryParams)\n\n  if (stringified) {\n    url += '?' + stringified\n  }\n\n  return url\n}\n\nfunction isValidPort (port) {\n  const value = parseInt(port, 10)\n  return (\n    value === Number(port) &&\n    value >= 0 &&\n    value <= 65535\n  )\n}\n\nfunction isHttpOrHttpsPrefixed (value) {\n  return (\n    value != null &&\n    value[0] === 'h' &&\n    value[1] === 't' &&\n    value[2] === 't' &&\n    value[3] === 'p' &&\n    (\n      value[4] === ':' ||\n      (\n        value[4] === 's' &&\n        value[5] === ':'\n      )\n    )\n  )\n}\n\nfunction parseURL (url) {\n  if (typeof url === 'string') {\n    url = new URL(url)\n\n    if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n      throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n    }\n\n    return url\n  }\n\n  if (!url || typeof url !== 'object') {\n    throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')\n  }\n\n  if (!(url instanceof URL)) {\n    if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {\n      throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')\n    }\n\n    if (url.path != null && typeof url.path !== 'string') {\n      throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')\n    }\n\n    if (url.pathname != null && typeof url.pathname !== 'string') {\n      throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')\n    }\n\n    if (url.hostname != null && typeof url.hostname !== 'string') {\n      throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')\n    }\n\n    if (url.origin != null && typeof url.origin !== 'string') {\n      throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')\n    }\n\n    if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n      throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n    }\n\n    const port = url.port != null\n      ? url.port\n      : (url.protocol === 'https:' ? 443 : 80)\n    let origin = url.origin != null\n      ? url.origin\n      : `${url.protocol || ''}//${url.hostname || ''}:${port}`\n    let path = url.path != null\n      ? url.path\n      : `${url.pathname || ''}${url.search || ''}`\n\n    if (origin[origin.length - 1] === '/') {\n      origin = origin.slice(0, origin.length - 1)\n    }\n\n    if (path && path[0] !== '/') {\n      path = `/${path}`\n    }\n    // new URL(path, origin) is unsafe when `path` contains an absolute URL\n    // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:\n    // If first parameter is a relative URL, second param is required, and will be used as the base URL.\n    // If first parameter is an absolute URL, a given second param will be ignored.\n    return new URL(`${origin}${path}`)\n  }\n\n  if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n    throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n  }\n\n  return url\n}\n\nfunction parseOrigin (url) {\n  url = parseURL(url)\n\n  if (url.pathname !== '/' || url.search || url.hash) {\n    throw new InvalidArgumentError('invalid url')\n  }\n\n  return url\n}\n\nfunction getHostname (host) {\n  if (host[0] === '[') {\n    const idx = host.indexOf(']')\n\n    assert(idx !== -1)\n    return host.substring(1, idx)\n  }\n\n  const idx = host.indexOf(':')\n  if (idx === -1) return host\n\n  return host.substring(0, idx)\n}\n\n// IP addresses are not valid server names per RFC6066\n// > Currently, the only server names supported are DNS hostnames\nfunction getServerName (host) {\n  if (!host) {\n    return null\n  }\n\n  assert(typeof host === 'string')\n\n  const servername = getHostname(host)\n  if (net.isIP(servername)) {\n    return ''\n  }\n\n  return servername\n}\n\nfunction deepClone (obj) {\n  return JSON.parse(JSON.stringify(obj))\n}\n\nfunction isAsyncIterable (obj) {\n  return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')\n}\n\nfunction isIterable (obj) {\n  return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))\n}\n\nfunction bodyLength (body) {\n  if (body == null) {\n    return 0\n  } else if (isStream(body)) {\n    const state = body._readableState\n    return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)\n      ? state.length\n      : null\n  } else if (isBlobLike(body)) {\n    return body.size != null ? body.size : null\n  } else if (isBuffer(body)) {\n    return body.byteLength\n  }\n\n  return null\n}\n\nfunction isDestroyed (body) {\n  return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))\n}\n\nfunction destroy (stream, err) {\n  if (stream == null || !isStream(stream) || isDestroyed(stream)) {\n    return\n  }\n\n  if (typeof stream.destroy === 'function') {\n    if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {\n      // See: https://github.com/nodejs/node/pull/38505/files\n      stream.socket = null\n    }\n\n    stream.destroy(err)\n  } else if (err) {\n    queueMicrotask(() => {\n      stream.emit('error', err)\n    })\n  }\n\n  if (stream.destroyed !== true) {\n    stream[kDestroyed] = true\n  }\n}\n\nconst KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/\nfunction parseKeepAliveTimeout (val) {\n  const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)\n  return m ? parseInt(m[1], 10) * 1000 : null\n}\n\n/**\n * Retrieves a header name and returns its lowercase value.\n * @param {string | Buffer} value Header name\n * @returns {string}\n */\nfunction headerNameToString (value) {\n  return typeof value === 'string'\n    ? headerNameLowerCasedRecord[value] ?? value.toLowerCase()\n    : tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * Receive the buffer as a string and return its lowercase value.\n * @param {Buffer} value Header name\n * @returns {string}\n */\nfunction bufferToLowerCasedHeaderName (value) {\n  return tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers\n * @param {Record} [obj]\n * @returns {Record}\n */\nfunction parseHeaders (headers, obj) {\n  if (obj === undefined) obj = {}\n  for (let i = 0; i < headers.length; i += 2) {\n    const key = headerNameToString(headers[i])\n    let val = obj[key]\n\n    if (val) {\n      if (typeof val === 'string') {\n        val = [val]\n        obj[key] = val\n      }\n      val.push(headers[i + 1].toString('utf8'))\n    } else {\n      const headersValue = headers[i + 1]\n      if (typeof headersValue === 'string') {\n        obj[key] = headersValue\n      } else {\n        obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')\n      }\n    }\n  }\n\n  // See https://github.com/nodejs/node/pull/46528\n  if ('content-length' in obj && 'content-disposition' in obj) {\n    obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')\n  }\n\n  return obj\n}\n\nfunction parseRawHeaders (headers) {\n  const len = headers.length\n  const ret = new Array(len)\n\n  let hasContentLength = false\n  let contentDispositionIdx = -1\n  let key\n  let val\n  let kLen = 0\n\n  for (let n = 0; n < headers.length; n += 2) {\n    key = headers[n]\n    val = headers[n + 1]\n\n    typeof key !== 'string' && (key = key.toString())\n    typeof val !== 'string' && (val = val.toString('utf8'))\n\n    kLen = key.length\n    if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {\n      hasContentLength = true\n    } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {\n      contentDispositionIdx = n + 1\n    }\n    ret[n] = key\n    ret[n + 1] = val\n  }\n\n  // See https://github.com/nodejs/node/pull/46528\n  if (hasContentLength && contentDispositionIdx !== -1) {\n    ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')\n  }\n\n  return ret\n}\n\nfunction isBuffer (buffer) {\n  // See, https://github.com/mcollina/undici/pull/319\n  return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)\n}\n\nfunction validateHandler (handler, method, upgrade) {\n  if (!handler || typeof handler !== 'object') {\n    throw new InvalidArgumentError('handler must be an object')\n  }\n\n  if (typeof handler.onConnect !== 'function') {\n    throw new InvalidArgumentError('invalid onConnect method')\n  }\n\n  if (typeof handler.onError !== 'function') {\n    throw new InvalidArgumentError('invalid onError method')\n  }\n\n  if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {\n    throw new InvalidArgumentError('invalid onBodySent method')\n  }\n\n  if (upgrade || method === 'CONNECT') {\n    if (typeof handler.onUpgrade !== 'function') {\n      throw new InvalidArgumentError('invalid onUpgrade method')\n    }\n  } else {\n    if (typeof handler.onHeaders !== 'function') {\n      throw new InvalidArgumentError('invalid onHeaders method')\n    }\n\n    if (typeof handler.onData !== 'function') {\n      throw new InvalidArgumentError('invalid onData method')\n    }\n\n    if (typeof handler.onComplete !== 'function') {\n      throw new InvalidArgumentError('invalid onComplete method')\n    }\n  }\n}\n\n// A body is disturbed if it has been read from and it cannot\n// be re-used without losing state or data.\nfunction isDisturbed (body) {\n  // TODO (fix): Why is body[kBodyUsed] needed?\n  return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))\n}\n\nfunction isErrored (body) {\n  return !!(body && stream.isErrored(body))\n}\n\nfunction isReadable (body) {\n  return !!(body && stream.isReadable(body))\n}\n\nfunction getSocketInfo (socket) {\n  return {\n    localAddress: socket.localAddress,\n    localPort: socket.localPort,\n    remoteAddress: socket.remoteAddress,\n    remotePort: socket.remotePort,\n    remoteFamily: socket.remoteFamily,\n    timeout: socket.timeout,\n    bytesWritten: socket.bytesWritten,\n    bytesRead: socket.bytesRead\n  }\n}\n\n/** @type {globalThis['ReadableStream']} */\nfunction ReadableStreamFrom (iterable) {\n  // We cannot use ReadableStream.from here because it does not return a byte stream.\n\n  let iterator\n  return new ReadableStream(\n    {\n      async start () {\n        iterator = iterable[Symbol.asyncIterator]()\n      },\n      async pull (controller) {\n        const { done, value } = await iterator.next()\n        if (done) {\n          queueMicrotask(() => {\n            controller.close()\n            controller.byobRequest?.respond(0)\n          })\n        } else {\n          const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)\n          if (buf.byteLength) {\n            controller.enqueue(new Uint8Array(buf))\n          }\n        }\n        return controller.desiredSize > 0\n      },\n      async cancel (reason) {\n        await iterator.return()\n      },\n      type: 'bytes'\n    }\n  )\n}\n\n// The chunk should be a FormData instance and contains\n// all the required methods.\nfunction isFormDataLike (object) {\n  return (\n    object &&\n    typeof object === 'object' &&\n    typeof object.append === 'function' &&\n    typeof object.delete === 'function' &&\n    typeof object.get === 'function' &&\n    typeof object.getAll === 'function' &&\n    typeof object.has === 'function' &&\n    typeof object.set === 'function' &&\n    object[Symbol.toStringTag] === 'FormData'\n  )\n}\n\nfunction addAbortListener (signal, listener) {\n  if ('addEventListener' in signal) {\n    signal.addEventListener('abort', listener, { once: true })\n    return () => signal.removeEventListener('abort', listener)\n  }\n  signal.addListener('abort', listener)\n  return () => signal.removeListener('abort', listener)\n}\n\nconst hasToWellFormed = typeof String.prototype.toWellFormed === 'function'\nconst hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'\n\n/**\n * @param {string} val\n */\nfunction toUSVString (val) {\n  return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)\n}\n\n/**\n * @param {string} val\n */\n// TODO: move this to webidl\nfunction isUSVString (val) {\n  return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`\n}\n\n/**\n * @see https://tools.ietf.org/html/rfc7230#section-3.2.6\n * @param {number} c\n */\nfunction isTokenCharCode (c) {\n  switch (c) {\n    case 0x22:\n    case 0x28:\n    case 0x29:\n    case 0x2c:\n    case 0x2f:\n    case 0x3a:\n    case 0x3b:\n    case 0x3c:\n    case 0x3d:\n    case 0x3e:\n    case 0x3f:\n    case 0x40:\n    case 0x5b:\n    case 0x5c:\n    case 0x5d:\n    case 0x7b:\n    case 0x7d:\n      // DQUOTE and \"(),/:;<=>?@[\\]{}\"\n      return false\n    default:\n      // VCHAR %x21-7E\n      return c >= 0x21 && c <= 0x7e\n  }\n}\n\n/**\n * @param {string} characters\n */\nfunction isValidHTTPToken (characters) {\n  if (characters.length === 0) {\n    return false\n  }\n  for (let i = 0; i < characters.length; ++i) {\n    if (!isTokenCharCode(characters.charCodeAt(i))) {\n      return false\n    }\n  }\n  return true\n}\n\n// headerCharRegex have been lifted from\n// https://github.com/nodejs/node/blob/main/lib/_http_common.js\n\n/**\n * Matches if val contains an invalid field-vchar\n *  field-value    = *( field-content / obs-fold )\n *  field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n *  field-vchar    = VCHAR / obs-text\n */\nconst headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/\n\n/**\n * @param {string} characters\n */\nfunction isValidHeaderValue (characters) {\n  return !headerCharRegex.test(characters)\n}\n\n// Parsed accordingly to RFC 9110\n// https://www.rfc-editor.org/rfc/rfc9110#field.content-range\nfunction parseRangeHeader (range) {\n  if (range == null || range === '') return { start: 0, end: null, size: null }\n\n  const m = range ? range.match(/^bytes (\\d+)-(\\d+)\\/(\\d+)?$/) : null\n  return m\n    ? {\n        start: parseInt(m[1]),\n        end: m[2] ? parseInt(m[2]) : null,\n        size: m[3] ? parseInt(m[3]) : null\n      }\n    : null\n}\n\nfunction addListener (obj, name, listener) {\n  const listeners = (obj[kListeners] ??= [])\n  listeners.push([name, listener])\n  obj.on(name, listener)\n  return obj\n}\n\nfunction removeAllListeners (obj) {\n  for (const [name, listener] of obj[kListeners] ?? []) {\n    obj.removeListener(name, listener)\n  }\n  obj[kListeners] = null\n}\n\nfunction errorRequest (client, request, err) {\n  try {\n    request.onError(err)\n    assert(request.aborted)\n  } catch (err) {\n    client.emit('error', err)\n  }\n}\n\nconst kEnumerableProperty = Object.create(null)\nkEnumerableProperty.enumerable = true\n\nconst normalizedMethodRecordsBase = {\n  delete: 'DELETE',\n  DELETE: 'DELETE',\n  get: 'GET',\n  GET: 'GET',\n  head: 'HEAD',\n  HEAD: 'HEAD',\n  options: 'OPTIONS',\n  OPTIONS: 'OPTIONS',\n  post: 'POST',\n  POST: 'POST',\n  put: 'PUT',\n  PUT: 'PUT'\n}\n\nconst normalizedMethodRecords = {\n  ...normalizedMethodRecordsBase,\n  patch: 'patch',\n  PATCH: 'PATCH'\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(normalizedMethodRecordsBase, null)\nObject.setPrototypeOf(normalizedMethodRecords, null)\n\nmodule.exports = {\n  kEnumerableProperty,\n  nop,\n  isDisturbed,\n  isErrored,\n  isReadable,\n  toUSVString,\n  isUSVString,\n  isBlobLike,\n  parseOrigin,\n  parseURL,\n  getServerName,\n  isStream,\n  isIterable,\n  isAsyncIterable,\n  isDestroyed,\n  headerNameToString,\n  bufferToLowerCasedHeaderName,\n  addListener,\n  removeAllListeners,\n  errorRequest,\n  parseRawHeaders,\n  parseHeaders,\n  parseKeepAliveTimeout,\n  destroy,\n  bodyLength,\n  deepClone,\n  ReadableStreamFrom,\n  isBuffer,\n  validateHandler,\n  getSocketInfo,\n  isFormDataLike,\n  buildURL,\n  addAbortListener,\n  isValidHTTPToken,\n  isValidHeaderValue,\n  isTokenCharCode,\n  parseRangeHeader,\n  normalizedMethodRecordsBase,\n  normalizedMethodRecords,\n  isValidPort,\n  isHttpOrHttpsPrefixed,\n  nodeMajor,\n  nodeMinor,\n  safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],\n  wrapRequestBody\n}\n","'use strict'\n\nconst { InvalidArgumentError } = require('../core/errors')\nconst { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst DispatcherBase = require('./dispatcher-base')\nconst Pool = require('./pool')\nconst Client = require('./client')\nconst util = require('../core/util')\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor')\n\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kMaxRedirections = Symbol('maxRedirections')\nconst kOnDrain = Symbol('onDrain')\nconst kFactory = Symbol('factory')\nconst kOptions = Symbol('options')\n\nfunction defaultFactory (origin, opts) {\n  return opts && opts.connections === 1\n    ? new Client(origin, opts)\n    : new Pool(origin, opts)\n}\n\nclass Agent extends DispatcherBase {\n  constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    super(options)\n\n    if (connect && typeof connect !== 'function') {\n      connect = { ...connect }\n    }\n\n    this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)\n      ? options.interceptors.Agent\n      : [createRedirectInterceptor({ maxRedirections })]\n\n    this[kOptions] = { ...util.deepClone(options), connect }\n    this[kOptions].interceptors = options.interceptors\n      ? { ...options.interceptors }\n      : undefined\n    this[kMaxRedirections] = maxRedirections\n    this[kFactory] = factory\n    this[kClients] = new Map()\n\n    this[kOnDrain] = (origin, targets) => {\n      this.emit('drain', origin, [this, ...targets])\n    }\n\n    this[kOnConnect] = (origin, targets) => {\n      this.emit('connect', origin, [this, ...targets])\n    }\n\n    this[kOnDisconnect] = (origin, targets, err) => {\n      this.emit('disconnect', origin, [this, ...targets], err)\n    }\n\n    this[kOnConnectionError] = (origin, targets, err) => {\n      this.emit('connectionError', origin, [this, ...targets], err)\n    }\n  }\n\n  get [kRunning] () {\n    let ret = 0\n    for (const client of this[kClients].values()) {\n      ret += client[kRunning]\n    }\n    return ret\n  }\n\n  [kDispatch] (opts, handler) {\n    let key\n    if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {\n      key = String(opts.origin)\n    } else {\n      throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')\n    }\n\n    let dispatcher = this[kClients].get(key)\n\n    if (!dispatcher) {\n      dispatcher = this[kFactory](opts.origin, this[kOptions])\n        .on('drain', this[kOnDrain])\n        .on('connect', this[kOnConnect])\n        .on('disconnect', this[kOnDisconnect])\n        .on('connectionError', this[kOnConnectionError])\n\n      // This introduces a tiny memory leak, as dispatchers are never removed from the map.\n      // TODO(mcollina): remove te timer when the client/pool do not have any more\n      // active connections.\n      this[kClients].set(key, dispatcher)\n    }\n\n    return dispatcher.dispatch(opts, handler)\n  }\n\n  async [kClose] () {\n    const closePromises = []\n    for (const client of this[kClients].values()) {\n      closePromises.push(client.close())\n    }\n    this[kClients].clear()\n\n    await Promise.all(closePromises)\n  }\n\n  async [kDestroy] (err) {\n    const destroyPromises = []\n    for (const client of this[kClients].values()) {\n      destroyPromises.push(client.destroy(err))\n    }\n    this[kClients].clear()\n\n    await Promise.all(destroyPromises)\n  }\n}\n\nmodule.exports = Agent\n","'use strict'\n\nconst {\n  BalancedPoolMissingUpstreamError,\n  InvalidArgumentError\n} = require('../core/errors')\nconst {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kRemoveClient,\n  kGetDispatcher\n} = require('./pool-base')\nconst Pool = require('./pool')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst { parseOrigin } = require('../core/util')\nconst kFactory = Symbol('factory')\n\nconst kOptions = Symbol('options')\nconst kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')\nconst kCurrentWeight = Symbol('kCurrentWeight')\nconst kIndex = Symbol('kIndex')\nconst kWeight = Symbol('kWeight')\nconst kMaxWeightPerServer = Symbol('kMaxWeightPerServer')\nconst kErrorPenalty = Symbol('kErrorPenalty')\n\n/**\n * Calculate the greatest common divisor of two numbers by\n * using the Euclidean algorithm.\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction getGreatestCommonDivisor (a, b) {\n  if (a === 0) return b\n\n  while (b !== 0) {\n    const t = b\n    b = a % b\n    a = t\n  }\n  return a\n}\n\nfunction defaultFactory (origin, opts) {\n  return new Pool(origin, opts)\n}\n\nclass BalancedPool extends PoolBase {\n  constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {\n    super()\n\n    this[kOptions] = opts\n    this[kIndex] = -1\n    this[kCurrentWeight] = 0\n\n    this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100\n    this[kErrorPenalty] = this[kOptions].errorPenalty || 15\n\n    if (!Array.isArray(upstreams)) {\n      upstreams = [upstreams]\n    }\n\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)\n      ? opts.interceptors.BalancedPool\n      : []\n    this[kFactory] = factory\n\n    for (const upstream of upstreams) {\n      this.addUpstream(upstream)\n    }\n    this._updateBalancedPoolStats()\n  }\n\n  addUpstream (upstream) {\n    const upstreamOrigin = parseOrigin(upstream).origin\n\n    if (this[kClients].find((pool) => (\n      pool[kUrl].origin === upstreamOrigin &&\n      pool.closed !== true &&\n      pool.destroyed !== true\n    ))) {\n      return this\n    }\n    const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))\n\n    this[kAddClient](pool)\n    pool.on('connect', () => {\n      pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])\n    })\n\n    pool.on('connectionError', () => {\n      pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n      this._updateBalancedPoolStats()\n    })\n\n    pool.on('disconnect', (...args) => {\n      const err = args[2]\n      if (err && err.code === 'UND_ERR_SOCKET') {\n        // decrease the weight of the pool.\n        pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n        this._updateBalancedPoolStats()\n      }\n    })\n\n    for (const client of this[kClients]) {\n      client[kWeight] = this[kMaxWeightPerServer]\n    }\n\n    this._updateBalancedPoolStats()\n\n    return this\n  }\n\n  _updateBalancedPoolStats () {\n    let result = 0\n    for (let i = 0; i < this[kClients].length; i++) {\n      result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)\n    }\n\n    this[kGreatestCommonDivisor] = result\n  }\n\n  removeUpstream (upstream) {\n    const upstreamOrigin = parseOrigin(upstream).origin\n\n    const pool = this[kClients].find((pool) => (\n      pool[kUrl].origin === upstreamOrigin &&\n      pool.closed !== true &&\n      pool.destroyed !== true\n    ))\n\n    if (pool) {\n      this[kRemoveClient](pool)\n    }\n\n    return this\n  }\n\n  get upstreams () {\n    return this[kClients]\n      .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)\n      .map((p) => p[kUrl].origin)\n  }\n\n  [kGetDispatcher] () {\n    // We validate that pools is greater than 0,\n    // otherwise we would have to wait until an upstream\n    // is added, which might never happen.\n    if (this[kClients].length === 0) {\n      throw new BalancedPoolMissingUpstreamError()\n    }\n\n    const dispatcher = this[kClients].find(dispatcher => (\n      !dispatcher[kNeedDrain] &&\n      dispatcher.closed !== true &&\n      dispatcher.destroyed !== true\n    ))\n\n    if (!dispatcher) {\n      return\n    }\n\n    const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)\n\n    if (allClientsBusy) {\n      return\n    }\n\n    let counter = 0\n\n    let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])\n\n    while (counter++ < this[kClients].length) {\n      this[kIndex] = (this[kIndex] + 1) % this[kClients].length\n      const pool = this[kClients][this[kIndex]]\n\n      // find pool index with the largest weight\n      if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {\n        maxWeightIndex = this[kIndex]\n      }\n\n      // decrease the current weight every `this[kClients].length`.\n      if (this[kIndex] === 0) {\n        // Set the current weight to the next lower weight.\n        this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]\n\n        if (this[kCurrentWeight] <= 0) {\n          this[kCurrentWeight] = this[kMaxWeightPerServer]\n        }\n      }\n      if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {\n        return pool\n      }\n    }\n\n    this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]\n    this[kIndex] = maxWeightIndex\n    return this[kClients][maxWeightIndex]\n  }\n}\n\nmodule.exports = BalancedPool\n","'use strict'\n\n/* global WebAssembly */\n\nconst assert = require('node:assert')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst timers = require('../util/timers.js')\nconst {\n  RequestContentLengthMismatchError,\n  ResponseContentLengthMismatchError,\n  RequestAbortedError,\n  HeadersTimeoutError,\n  HeadersOverflowError,\n  SocketError,\n  InformationalError,\n  BodyTimeoutError,\n  HTTPParserError,\n  ResponseExceededMaxSizeError\n} = require('../core/errors.js')\nconst {\n  kUrl,\n  kReset,\n  kClient,\n  kParser,\n  kBlocking,\n  kRunning,\n  kPending,\n  kSize,\n  kWriting,\n  kQueue,\n  kNoRef,\n  kKeepAliveDefaultTimeout,\n  kHostHeader,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kPipelining,\n  kSocket,\n  kKeepAliveTimeoutValue,\n  kMaxHeadersSize,\n  kKeepAliveMaxTimeout,\n  kKeepAliveTimeoutThreshold,\n  kHeadersTimeout,\n  kBodyTimeout,\n  kStrictContentLength,\n  kMaxRequests,\n  kCounter,\n  kMaxResponseSize,\n  kOnError,\n  kResume,\n  kHTTPContext\n} = require('../core/symbols.js')\n\nconst constants = require('../llhttp/constants.js')\nconst EMPTY_BUF = Buffer.alloc(0)\nconst FastBuffer = Buffer[Symbol.species]\nconst addListener = util.addListener\nconst removeAllListeners = util.removeAllListeners\nconst kIdleSocketValidation = Symbol('kIdleSocketValidation')\nconst kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout')\nconst kSocketUsed = Symbol('kSocketUsed')\n\nlet extractBody\n\nasync function lazyllhttp () {\n  const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined\n\n  let mod\n  try {\n    mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js'))\n  } catch (e) {\n    /* istanbul ignore next */\n\n    // We could check if the error was caused by the simd option not\n    // being enabled, but the occurring of this other error\n    // * https://github.com/emscripten-core/emscripten/issues/11495\n    // got me to remove that check to avoid breaking Node 12.\n    mod = await WebAssembly.compile(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))\n  }\n\n  return await WebAssembly.instantiate(mod, {\n    env: {\n      /* eslint-disable camelcase */\n\n      wasm_on_url: (p, at, len) => {\n        /* istanbul ignore next */\n        return 0\n      },\n      wasm_on_status: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_message_begin: (p) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onMessageBegin() || 0\n      },\n      wasm_on_header_field: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_header_value: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0\n      },\n      wasm_on_body: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_message_complete: (p) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onMessageComplete() || 0\n      }\n\n      /* eslint-enable camelcase */\n    }\n  })\n}\n\nlet llhttpInstance = null\nlet llhttpPromise = lazyllhttp()\nllhttpPromise.catch()\n\nlet currentParser = null\nlet currentBufferRef = null\nlet currentBufferSize = 0\nlet currentBufferPtr = null\n\nconst USE_NATIVE_TIMER = 0\nconst USE_FAST_TIMER = 1\n\n// Use fast timers for headers and body to take eventual event loop\n// latency into account.\nconst TIMEOUT_HEADERS = 2 | USE_FAST_TIMER\nconst TIMEOUT_BODY = 4 | USE_FAST_TIMER\n\n// Use native timers to ignore event loop latency for keep-alive\n// handling.\nconst TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER\n\nclass Parser {\n  constructor (client, socket, { exports }) {\n    assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)\n\n    this.llhttp = exports\n    this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)\n    this.client = client\n    this.socket = socket\n    this.timeout = null\n    this.timeoutValue = null\n    this.timeoutType = null\n    this.statusCode = null\n    this.statusText = ''\n    this.upgrade = false\n    this.headers = []\n    this.headersSize = 0\n    this.headersMaxSize = client[kMaxHeadersSize]\n    this.shouldKeepAlive = false\n    this.paused = false\n    this.resume = this.resume.bind(this)\n\n    this.bytesRead = 0\n\n    this.keepAlive = ''\n    this.contentLength = ''\n    this.connection = ''\n    this.maxResponseSize = client[kMaxResponseSize]\n  }\n\n  setTimeout (delay, type) {\n    // If the existing timer and the new timer are of different timer type\n    // (fast or native) or have different delay, we need to clear the existing\n    // timer and set a new one.\n    if (\n      delay !== this.timeoutValue ||\n      (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)\n    ) {\n      // If a timeout is already set, clear it with clearTimeout of the fast\n      // timer implementation, as it can clear fast and native timers.\n      if (this.timeout) {\n        timers.clearTimeout(this.timeout)\n        this.timeout = null\n      }\n\n      if (delay) {\n        if (type & USE_FAST_TIMER) {\n          this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this))\n        } else {\n          this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this))\n          this.timeout.unref()\n        }\n      }\n\n      this.timeoutValue = delay\n    } else if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    this.timeoutType = type\n  }\n\n  resume () {\n    if (this.socket.destroyed || !this.paused) {\n      return\n    }\n\n    assert(this.ptr != null)\n    assert(currentParser == null)\n\n    this.llhttp.llhttp_resume(this.ptr)\n\n    assert(this.timeoutType === TIMEOUT_BODY)\n    if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    this.paused = false\n    this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.\n    this.readMore()\n  }\n\n  readMore () {\n    while (!this.paused && this.ptr) {\n      const chunk = this.socket.read()\n      if (chunk === null) {\n        break\n      }\n      this.execute(chunk)\n    }\n  }\n\n  execute (data) {\n    assert(this.ptr != null)\n    assert(currentParser == null)\n    assert(!this.paused)\n\n    const { socket, llhttp } = this\n\n    if (data.length > currentBufferSize) {\n      if (currentBufferPtr) {\n        llhttp.free(currentBufferPtr)\n      }\n      currentBufferSize = Math.ceil(data.length / 4096) * 4096\n      currentBufferPtr = llhttp.malloc(currentBufferSize)\n    }\n\n    new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)\n\n    // Call `execute` on the wasm parser.\n    // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,\n    // and finally the length of bytes to parse.\n    // The return value is an error code or `constants.ERROR.OK`.\n    try {\n      let ret\n\n      try {\n        currentBufferRef = data\n        currentParser = this\n        ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)\n        /* eslint-disable-next-line no-useless-catch */\n      } catch (err) {\n        /* istanbul ignore next: difficult to make a test case for */\n        throw err\n      } finally {\n        currentParser = null\n        currentBufferRef = null\n      }\n\n      const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr\n\n      if (ret !== constants.ERROR.OK) {\n        const body = data.subarray(offset)\n\n        if (ret === constants.ERROR.PAUSED_UPGRADE) {\n          this.onUpgrade(body)\n        } else if (ret === constants.ERROR.PAUSED) {\n          this.paused = true\n          socket.unshift(body)\n        } else {\n          throw this.createError(ret, body)\n        }\n      }\n    } catch (err) {\n      util.destroy(socket, err)\n    }\n  }\n\n  finish () {\n    assert(currentParser === null)\n    assert(this.ptr != null)\n    assert(!this.paused)\n\n    const { llhttp } = this\n\n    let ret\n\n    try {\n      currentParser = this\n      ret = llhttp.llhttp_finish(this.ptr)\n    } finally {\n      currentParser = null\n    }\n\n    if (ret === constants.ERROR.OK) {\n      return null\n    }\n\n    if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {\n      this.paused = true\n      return null\n    }\n\n    return this.createError(ret, EMPTY_BUF)\n  }\n\n  createError (ret, data) {\n    const { llhttp, contentLength, bytesRead } = this\n\n    if (contentLength && bytesRead !== parseInt(contentLength, 10)) {\n      return new ResponseContentLengthMismatchError()\n    }\n\n    const ptr = llhttp.llhttp_get_error_reason(this.ptr)\n    let message = ''\n    if (ptr) {\n      const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)\n      message =\n        'Response does not match the HTTP/1.1 protocol (' +\n        Buffer.from(llhttp.memory.buffer, ptr, len).toString() +\n        ')'\n    }\n\n    return new HTTPParserError(message, constants.ERROR[ret], data)\n  }\n\n  destroy () {\n    assert(this.ptr != null)\n    assert(currentParser == null)\n\n    this.llhttp.llhttp_free(this.ptr)\n    this.ptr = null\n\n    this.timeout && timers.clearTimeout(this.timeout)\n    this.timeout = null\n    this.timeoutValue = null\n    this.timeoutType = null\n\n    this.paused = false\n  }\n\n  onStatus (buf) {\n    this.statusText = buf.toString()\n  }\n\n  onMessageBegin () {\n    const { socket, client } = this\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (socket.destroyed) {\n      return -1\n    }\n\n    if (client[kRunning] === 0) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n    if (!request) {\n      return -1\n    }\n    request.onResponseStarted()\n  }\n\n  onHeaderField (buf) {\n    const len = this.headers.length\n\n    if ((len & 1) === 0) {\n      this.headers.push(buf)\n    } else {\n      this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n    }\n\n    this.trackHeader(buf.length)\n  }\n\n  onHeaderValue (buf) {\n    let len = this.headers.length\n\n    if ((len & 1) === 1) {\n      this.headers.push(buf)\n      len += 1\n    } else {\n      this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n    }\n\n    const key = this.headers[len - 2]\n    if (key.length === 10) {\n      const headerName = util.bufferToLowerCasedHeaderName(key)\n      if (headerName === 'keep-alive') {\n        this.keepAlive += buf.toString()\n      } else if (headerName === 'connection') {\n        this.connection += buf.toString()\n      }\n    } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {\n      this.contentLength += buf.toString()\n    }\n\n    this.trackHeader(buf.length)\n  }\n\n  trackHeader (len) {\n    this.headersSize += len\n    if (this.headersSize >= this.headersMaxSize) {\n      util.destroy(this.socket, new HeadersOverflowError())\n    }\n  }\n\n  onUpgrade (head) {\n    const { upgrade, client, socket, headers, statusCode } = this\n\n    assert(upgrade)\n    assert(client[kSocket] === socket)\n    assert(!socket.destroyed)\n    assert(!this.paused)\n    assert((headers.length & 1) === 0)\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n    assert(request.upgrade || request.method === 'CONNECT')\n\n    this.statusCode = null\n    this.statusText = ''\n    this.shouldKeepAlive = null\n\n    this.headers = []\n    this.headersSize = 0\n\n    socket.unshift(head)\n\n    socket[kParser].destroy()\n    socket[kParser] = null\n\n    socket[kClient] = null\n    socket[kError] = null\n\n    removeAllListeners(socket)\n\n    client[kSocket] = null\n    client[kHTTPContext] = null // TODO (fix): This is hacky...\n    client[kQueue][client[kRunningIdx]++] = null\n    client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))\n\n    try {\n      request.onUpgrade(statusCode, headers, socket)\n    } catch (err) {\n      util.destroy(socket, err)\n    }\n\n    client[kResume]()\n  }\n\n  onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {\n    const { client, socket, headers, statusText } = this\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (socket.destroyed) {\n      return -1\n    }\n\n    if (client[kRunning] === 0) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (!request) {\n      return -1\n    }\n\n    assert(!this.upgrade)\n    assert(this.statusCode < 200)\n\n    if (statusCode === 100) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    /* this can only happen if server is misbehaving */\n    if (upgrade && !request.upgrade) {\n      util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    assert(this.timeoutType === TIMEOUT_HEADERS)\n\n    this.statusCode = statusCode\n    this.shouldKeepAlive = (\n      shouldKeepAlive ||\n      // Override llhttp value which does not allow keepAlive for HEAD.\n      (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')\n    )\n\n    if (this.statusCode >= 200) {\n      const bodyTimeout = request.bodyTimeout != null\n        ? request.bodyTimeout\n        : client[kBodyTimeout]\n      this.setTimeout(bodyTimeout, TIMEOUT_BODY)\n    } else if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    if (request.method === 'CONNECT') {\n      assert(client[kRunning] === 1)\n      this.upgrade = true\n      return 2\n    }\n\n    if (upgrade) {\n      assert(client[kRunning] === 1)\n      this.upgrade = true\n      return 2\n    }\n\n    assert((this.headers.length & 1) === 0)\n    this.headers = []\n    this.headersSize = 0\n\n    if (this.shouldKeepAlive && client[kPipelining]) {\n      const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null\n\n      if (keepAliveTimeout != null) {\n        const timeout = Math.min(\n          keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n          client[kKeepAliveMaxTimeout]\n        )\n        if (timeout <= 0) {\n          socket[kReset] = true\n        } else {\n          client[kKeepAliveTimeoutValue] = timeout\n        }\n      } else {\n        client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]\n      }\n    } else {\n      // Stop more requests from being dispatched.\n      socket[kReset] = true\n    }\n\n    const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false\n\n    if (request.aborted) {\n      return -1\n    }\n\n    if (request.method === 'HEAD') {\n      return 1\n    }\n\n    if (statusCode < 200) {\n      return 1\n    }\n\n    if (socket[kBlocking]) {\n      socket[kBlocking] = false\n      client[kResume]()\n    }\n\n    return pause ? constants.ERROR.PAUSED : 0\n  }\n\n  onBody (buf) {\n    const { client, socket, statusCode, maxResponseSize } = this\n\n    if (socket.destroyed) {\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n\n    assert(this.timeoutType === TIMEOUT_BODY)\n    if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    assert(statusCode >= 200)\n\n    if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n      util.destroy(socket, new ResponseExceededMaxSizeError())\n      return -1\n    }\n\n    this.bytesRead += buf.length\n\n    if (request.onData(buf) === false) {\n      return constants.ERROR.PAUSED\n    }\n  }\n\n  onMessageComplete () {\n    const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this\n\n    if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n      return -1\n    }\n\n    if (upgrade) {\n      return\n    }\n\n    assert(statusCode >= 100)\n    assert((this.headers.length & 1) === 0)\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n\n    this.statusCode = null\n    this.statusText = ''\n    this.bytesRead = 0\n    this.contentLength = ''\n    this.keepAlive = ''\n    this.connection = ''\n\n    this.headers = []\n    this.headersSize = 0\n\n    if (statusCode < 200) {\n      return\n    }\n\n    /* istanbul ignore next: should be handled by llhttp? */\n    if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n      util.destroy(socket, new ResponseContentLengthMismatchError())\n      return -1\n    }\n\n    request.onComplete(headers)\n\n    client[kQueue][client[kRunningIdx]++] = null\n    socket[kSocketUsed] = true\n\n    if (socket[kWriting]) {\n      assert(client[kRunning] === 0)\n      // Response completed before request.\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (!shouldKeepAlive) {\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (socket[kReset] && client[kRunning] === 0) {\n      // Destroy socket once all requests have completed.\n      // The request at the tail of the pipeline is the one\n      // that requested reset and no further requests should\n      // have been queued since then.\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (client[kPipelining] == null || client[kPipelining] === 1) {\n      // We must wait a full event loop cycle to reuse this socket to make sure\n      // that non-spec compliant servers are not closing the connection even if they\n      // said they won't.\n      setImmediate(() => client[kResume]())\n    } else {\n      client[kResume]()\n    }\n  }\n}\n\nfunction onParserTimeout (parser) {\n  const { socket, timeoutType, client, paused } = parser.deref()\n\n  /* istanbul ignore else */\n  if (timeoutType === TIMEOUT_HEADERS) {\n    if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n      assert(!paused, 'cannot be paused while waiting for headers')\n      util.destroy(socket, new HeadersTimeoutError())\n    }\n  } else if (timeoutType === TIMEOUT_BODY) {\n    if (!paused) {\n      util.destroy(socket, new BodyTimeoutError())\n    }\n  } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {\n    assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])\n    util.destroy(socket, new InformationalError('socket idle timeout'))\n  }\n}\n\nasync function connectH1 (client, socket) {\n  client[kSocket] = socket\n\n  if (!llhttpInstance) {\n    llhttpInstance = await llhttpPromise\n    llhttpPromise = null\n  }\n\n  socket[kNoRef] = false\n  socket[kWriting] = false\n  socket[kReset] = false\n  socket[kBlocking] = false\n  socket[kIdleSocketValidation] = 0\n  socket[kIdleSocketValidationTimeout] = null\n  socket[kSocketUsed] = false\n  socket[kParser] = new Parser(client, socket, llhttpInstance)\n\n  addListener(socket, 'error', function (err) {\n    assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n    const parser = this[kParser]\n\n    // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded\n    // to the user.\n    if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {\n      const parserErr = parser.finish()\n      if (parserErr) {\n        this[kError] = parserErr\n        this[kClient][kOnError](parserErr)\n      }\n      return\n    }\n\n    this[kError] = err\n\n    this[kClient][kOnError](err)\n  })\n  addListener(socket, 'readable', function () {\n    const parser = this[kParser]\n\n    if (parser) {\n      parser.readMore()\n    }\n  })\n  addListener(socket, 'end', function () {\n    const parser = this[kParser]\n\n    if (parser.statusCode && !parser.shouldKeepAlive) {\n      const parserErr = parser.finish()\n      if (parserErr) {\n        util.destroy(this, parserErr)\n      }\n      return\n    }\n\n    util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n  })\n  addListener(socket, 'close', function () {\n    const client = this[kClient]\n    const parser = this[kParser]\n\n    clearIdleSocketValidation(this)\n\n    if (parser) {\n      if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {\n        this[kError] = parser.finish() || this[kError]\n      }\n\n      this[kParser].destroy()\n      this[kParser] = null\n    }\n\n    const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n    client[kSocket] = null\n    client[kHTTPContext] = null // TODO (fix): This is hacky...\n\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n\n      // Fail entire queue.\n      const requests = client[kQueue].splice(client[kRunningIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(client, request, err)\n      }\n    } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {\n      // Fail head of pipeline.\n      const request = client[kQueue][client[kRunningIdx]]\n      client[kQueue][client[kRunningIdx]++] = null\n\n      util.errorRequest(client, request, err)\n    }\n\n    client[kPendingIdx] = client[kRunningIdx]\n\n    assert(client[kRunning] === 0)\n\n    client.emit('disconnect', client[kUrl], [client], err)\n\n    client[kResume]()\n  })\n\n  let closed = false\n  socket.on('close', () => {\n    closed = true\n  })\n\n  return {\n    version: 'h1',\n    defaultPipelining: 1,\n    write (...args) {\n      return writeH1(client, ...args)\n    },\n    resume () {\n      resumeH1(client)\n    },\n    destroy (err, callback) {\n      if (closed) {\n        queueMicrotask(callback)\n      } else {\n        socket.destroy(err).on('close', callback)\n      }\n    },\n    get destroyed () {\n      return socket.destroyed\n    },\n    busy (request) {\n      if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) {\n        return true\n      }\n\n      if (request) {\n        if (client[kRunning] > 0 && !request.idempotent) {\n          // Non-idempotent request cannot be retried.\n          // Ensure that no other requests are inflight and\n          // could cause failure.\n          return true\n        }\n\n        if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {\n          // Don't dispatch an upgrade until all preceding requests have completed.\n          // A misbehaving server might upgrade the connection before all pipelined\n          // request has completed.\n          return true\n        }\n\n        if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&\n          (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {\n          // Request with stream or iterator body can error while other requests\n          // are inflight and indirectly error those as well.\n          // Ensure this doesn't happen by waiting for inflight\n          // to complete before dispatching.\n\n          // Request with stream or iterator body cannot be retried.\n          // Ensure that no other requests are inflight and\n          // could cause failure.\n          return true\n        }\n      }\n\n      return false\n    }\n  }\n}\n\nfunction clearIdleSocketValidation (socket) {\n  if (socket[kIdleSocketValidationTimeout]) {\n    clearTimeout(socket[kIdleSocketValidationTimeout])\n    socket[kIdleSocketValidationTimeout] = null\n  }\n\n  socket[kIdleSocketValidation] = 0\n}\n\nfunction scheduleIdleSocketValidation (client, socket) {\n  socket[kIdleSocketValidation] = 1\n  socket[kIdleSocketValidationTimeout] = setTimeout(() => {\n    socket[kIdleSocketValidationTimeout] = null\n    socket[kIdleSocketValidation] = 2\n\n    if (client[kSocket] === socket && !socket.destroyed) {\n      client[kResume]()\n    }\n  }, 0)\n  socket[kIdleSocketValidationTimeout].unref?.()\n}\n\n/**\n * @param {import('./client.js')} client\n */\nfunction resumeH1 (client) {\n  const socket = client[kSocket]\n\n  if (socket && !socket.destroyed) {\n    if (client[kSize] === 0) {\n      if (!socket[kNoRef] && socket.unref) {\n        socket.unref()\n        socket[kNoRef] = true\n      }\n    } else if (socket[kNoRef] && socket.ref) {\n      socket.ref()\n      socket[kNoRef] = false\n    }\n\n    if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {\n      if (socket[kIdleSocketValidation] === 0) {\n        scheduleIdleSocketValidation(client, socket)\n        socket[kParser].readMore()\n        if (socket.destroyed) {\n          return\n        }\n        return\n      }\n\n      if (socket[kIdleSocketValidation] === 1) {\n        socket[kParser].readMore()\n        if (socket.destroyed) {\n          return\n        }\n        return\n      }\n    }\n\n    if (client[kRunning] === 0) {\n      socket[kParser].readMore()\n      if (socket.destroyed) {\n        return\n      }\n    }\n\n    if (client[kSize] === 0) {\n      if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {\n        socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)\n      }\n    } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n      if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n        const request = client[kQueue][client[kRunningIdx]]\n        const headersTimeout = request.headersTimeout != null\n          ? request.headersTimeout\n          : client[kHeadersTimeout]\n        socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)\n      }\n    }\n  }\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n  return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH1 (client, request) {\n  const { method, path, host, upgrade, blocking, reset } = request\n\n  let { body, headers, contentLength } = request\n\n  // https://tools.ietf.org/html/rfc7231#section-4.3.1\n  // https://tools.ietf.org/html/rfc7231#section-4.3.2\n  // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n  // Sending a payload body on a request that does not\n  // expect it can cause undefined behavior on some\n  // servers and corrupt connection state. Do not\n  // re-use the connection for further requests.\n\n  const expectsPayload = (\n    method === 'PUT' ||\n    method === 'POST' ||\n    method === 'PATCH' ||\n    method === 'QUERY' ||\n    method === 'PROPFIND' ||\n    method === 'PROPPATCH'\n  )\n\n  if (util.isFormDataLike(body)) {\n    if (!extractBody) {\n      extractBody = require('../web/fetch/body.js').extractBody\n    }\n\n    const [bodyStream, contentType] = extractBody(body)\n    if (request.contentType == null) {\n      headers.push('content-type', contentType)\n    }\n    body = bodyStream.stream\n    contentLength = bodyStream.length\n  } else if (util.isBlobLike(body) && request.contentType == null && body.type) {\n    headers.push('content-type', body.type)\n  }\n\n  if (body && typeof body.read === 'function') {\n    // Try to read EOF in order to get length.\n    body.read(0)\n  }\n\n  const bodyLength = util.bodyLength(body)\n\n  contentLength = bodyLength ?? contentLength\n\n  if (contentLength === null) {\n    contentLength = request.contentLength\n  }\n\n  if (contentLength === 0 && !expectsPayload) {\n    // https://tools.ietf.org/html/rfc7230#section-3.3.2\n    // A user agent SHOULD NOT send a Content-Length header field when\n    // the request message does not contain a payload body and the method\n    // semantics do not anticipate such a body.\n\n    contentLength = null\n  }\n\n  // https://github.com/nodejs/undici/issues/2046\n  // A user agent may send a Content-Length header with 0 value, this should be allowed.\n  if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {\n    if (client[kStrictContentLength]) {\n      util.errorRequest(client, request, new RequestContentLengthMismatchError())\n      return false\n    }\n\n    process.emitWarning(new RequestContentLengthMismatchError())\n  }\n\n  const socket = client[kSocket]\n  clearIdleSocketValidation(socket)\n\n  const abort = (err) => {\n    if (request.aborted || request.completed) {\n      return\n    }\n\n    util.errorRequest(client, request, err || new RequestAbortedError())\n\n    util.destroy(body)\n    util.destroy(socket, new InformationalError('aborted'))\n  }\n\n  try {\n    request.onConnect(abort)\n  } catch (err) {\n    util.errorRequest(client, request, err)\n  }\n\n  if (request.aborted) {\n    return false\n  }\n\n  if (method === 'HEAD') {\n    // https://github.com/mcollina/undici/issues/258\n    // Close after a HEAD request to interop with misbehaving servers\n    // that may send a body in the response.\n\n    socket[kReset] = true\n  }\n\n  if (upgrade || method === 'CONNECT') {\n    // On CONNECT or upgrade, block pipeline from dispatching further\n    // requests on this connection.\n\n    socket[kReset] = true\n  }\n\n  if (reset != null) {\n    socket[kReset] = reset\n  }\n\n  if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n    socket[kReset] = true\n  }\n\n  if (blocking) {\n    socket[kBlocking] = true\n  }\n\n  let header = `${method} ${path} HTTP/1.1\\r\\n`\n\n  if (typeof host === 'string') {\n    header += `host: ${host}\\r\\n`\n  } else {\n    header += client[kHostHeader]\n  }\n\n  if (upgrade) {\n    header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n  } else if (client[kPipelining] && !socket[kReset]) {\n    header += 'connection: keep-alive\\r\\n'\n  } else {\n    header += 'connection: close\\r\\n'\n  }\n\n  if (Array.isArray(headers)) {\n    for (let n = 0; n < headers.length; n += 2) {\n      const key = headers[n + 0]\n      const val = headers[n + 1]\n\n      if (Array.isArray(val)) {\n        for (let i = 0; i < val.length; i++) {\n          header += `${key}: ${val[i]}\\r\\n`\n        }\n      } else {\n        header += `${key}: ${val}\\r\\n`\n      }\n    }\n  }\n\n  if (channels.sendHeaders.hasSubscribers) {\n    channels.sendHeaders.publish({ request, headers: header, socket })\n  }\n\n  /* istanbul ignore else: assertion */\n  if (!body || bodyLength === 0) {\n    writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isBuffer(body)) {\n    writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isBlobLike(body)) {\n    if (typeof body.stream === 'function') {\n      writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)\n    } else {\n      writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)\n    }\n  } else if (util.isStream(body)) {\n    writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isIterable(body)) {\n    writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else {\n    assert(false)\n  }\n\n  return true\n}\n\nfunction writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n  let finished = false\n\n  const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n\n  const onData = function (chunk) {\n    if (finished) {\n      return\n    }\n\n    try {\n      if (!writer.write(chunk) && this.pause) {\n        this.pause()\n      }\n    } catch (err) {\n      util.destroy(this, err)\n    }\n  }\n  const onDrain = function () {\n    if (finished) {\n      return\n    }\n\n    if (body.resume) {\n      body.resume()\n    }\n  }\n  const onClose = function () {\n    // 'close' might be emitted *before* 'error' for\n    // broken streams. Wait a tick to avoid this case.\n    queueMicrotask(() => {\n      // It's only safe to remove 'error' listener after\n      // 'close'.\n      body.removeListener('error', onFinished)\n    })\n\n    if (!finished) {\n      const err = new RequestAbortedError()\n      queueMicrotask(() => onFinished(err))\n    }\n  }\n  const onFinished = function (err) {\n    if (finished) {\n      return\n    }\n\n    finished = true\n\n    assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))\n\n    socket\n      .off('drain', onDrain)\n      .off('error', onFinished)\n\n    body\n      .removeListener('data', onData)\n      .removeListener('end', onFinished)\n      .removeListener('close', onClose)\n\n    if (!err) {\n      try {\n        writer.end()\n      } catch (er) {\n        err = er\n      }\n    }\n\n    writer.destroy(err)\n\n    if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {\n      util.destroy(body, err)\n    } else {\n      util.destroy(body)\n    }\n  }\n\n  body\n    .on('data', onData)\n    .on('end', onFinished)\n    .on('error', onFinished)\n    .on('close', onClose)\n\n  if (body.resume) {\n    body.resume()\n  }\n\n  socket\n    .on('drain', onDrain)\n    .on('error', onFinished)\n\n  if (body.errorEmitted ?? body.errored) {\n    setImmediate(() => onFinished(body.errored))\n  } else if (body.endEmitted ?? body.readableEnded) {\n    setImmediate(() => onFinished(null))\n  }\n\n  if (body.closeEmitted ?? body.closed) {\n    setImmediate(onClose)\n  }\n}\n\nfunction writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  try {\n    if (!body) {\n      if (contentLength === 0) {\n        socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n      } else {\n        assert(contentLength === null, 'no body must not have content length')\n        socket.write(`${header}\\r\\n`, 'latin1')\n      }\n    } else if (util.isBuffer(body)) {\n      assert(contentLength === body.byteLength, 'buffer body must have content length')\n\n      socket.cork()\n      socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n      socket.write(body)\n      socket.uncork()\n      request.onBodySent(body)\n\n      if (!expectsPayload && request.reset !== false) {\n        socket[kReset] = true\n      }\n    }\n    request.onRequestSent()\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength === body.size, 'blob body must have content length')\n\n  try {\n    if (contentLength != null && contentLength !== body.size) {\n      throw new RequestContentLengthMismatchError()\n    }\n\n    const buffer = Buffer.from(await body.arrayBuffer())\n\n    socket.cork()\n    socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n    socket.write(buffer)\n    socket.uncork()\n\n    request.onBodySent(buffer)\n    request.onRequestSent()\n\n    if (!expectsPayload && request.reset !== false) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n  let callback = null\n  function onDrain () {\n    if (callback) {\n      const cb = callback\n      callback = null\n      cb()\n    }\n  }\n\n  const waitForDrain = () => new Promise((resolve, reject) => {\n    assert(callback === null)\n\n    if (socket[kError]) {\n      reject(socket[kError])\n    } else {\n      callback = resolve\n    }\n  })\n\n  socket\n    .on('close', onDrain)\n    .on('drain', onDrain)\n\n  const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n  try {\n    // It's up to the user to somehow abort the async iterable.\n    for await (const chunk of body) {\n      if (socket[kError]) {\n        throw socket[kError]\n      }\n\n      if (!writer.write(chunk)) {\n        await waitForDrain()\n      }\n    }\n\n    writer.end()\n  } catch (err) {\n    writer.destroy(err)\n  } finally {\n    socket\n      .off('close', onDrain)\n      .off('drain', onDrain)\n  }\n}\n\nclass AsyncWriter {\n  constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {\n    this.socket = socket\n    this.request = request\n    this.contentLength = contentLength\n    this.client = client\n    this.bytesWritten = 0\n    this.expectsPayload = expectsPayload\n    this.header = header\n    this.abort = abort\n\n    socket[kWriting] = true\n  }\n\n  write (chunk) {\n    const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this\n\n    if (socket[kError]) {\n      throw socket[kError]\n    }\n\n    if (socket.destroyed) {\n      return false\n    }\n\n    const len = Buffer.byteLength(chunk)\n    if (!len) {\n      return true\n    }\n\n    // We should defer writing chunks.\n    if (contentLength !== null && bytesWritten + len > contentLength) {\n      if (client[kStrictContentLength]) {\n        throw new RequestContentLengthMismatchError()\n      }\n\n      process.emitWarning(new RequestContentLengthMismatchError())\n    }\n\n    socket.cork()\n\n    if (bytesWritten === 0) {\n      if (!expectsPayload && request.reset !== false) {\n        socket[kReset] = true\n      }\n\n      if (contentLength === null) {\n        socket.write(`${header}transfer-encoding: chunked\\r\\n`, 'latin1')\n      } else {\n        socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n      }\n    }\n\n    if (contentLength === null) {\n      socket.write(`\\r\\n${len.toString(16)}\\r\\n`, 'latin1')\n    }\n\n    this.bytesWritten += len\n\n    const ret = socket.write(chunk)\n\n    socket.uncork()\n\n    request.onBodySent(chunk)\n\n    if (!ret) {\n      if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n        // istanbul ignore else: only for jest\n        if (socket[kParser].timeout.refresh) {\n          socket[kParser].timeout.refresh()\n        }\n      }\n    }\n\n    return ret\n  }\n\n  end () {\n    const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this\n    request.onRequestSent()\n\n    socket[kWriting] = false\n\n    if (socket[kError]) {\n      throw socket[kError]\n    }\n\n    if (socket.destroyed) {\n      return\n    }\n\n    if (bytesWritten === 0) {\n      if (expectsPayload) {\n        // https://tools.ietf.org/html/rfc7230#section-3.3.2\n        // A user agent SHOULD send a Content-Length in a request message when\n        // no Transfer-Encoding is sent and the request method defines a meaning\n        // for an enclosed payload body.\n\n        socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n      } else {\n        socket.write(`${header}\\r\\n`, 'latin1')\n      }\n    } else if (contentLength === null) {\n      socket.write('\\r\\n0\\r\\n\\r\\n', 'latin1')\n    }\n\n    if (contentLength !== null && bytesWritten !== contentLength) {\n      if (client[kStrictContentLength]) {\n        throw new RequestContentLengthMismatchError()\n      } else {\n        process.emitWarning(new RequestContentLengthMismatchError())\n      }\n    }\n\n    if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n      // istanbul ignore else: only for jest\n      if (socket[kParser].timeout.refresh) {\n        socket[kParser].timeout.refresh()\n      }\n    }\n\n    client[kResume]()\n  }\n\n  destroy (err) {\n    const { socket, client, abort } = this\n\n    socket[kWriting] = false\n\n    if (err) {\n      assert(client[kRunning] <= 1, 'pipeline should only contain this request')\n      abort(err)\n    }\n  }\n}\n\nmodule.exports = connectH1\n","'use strict'\n\nconst assert = require('node:assert')\nconst { pipeline } = require('node:stream')\nconst util = require('../core/util.js')\nconst {\n  RequestContentLengthMismatchError,\n  RequestAbortedError,\n  SocketError,\n  InformationalError\n} = require('../core/errors.js')\nconst {\n  kUrl,\n  kReset,\n  kClient,\n  kRunning,\n  kPending,\n  kQueue,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kSocket,\n  kStrictContentLength,\n  kOnError,\n  kMaxConcurrentStreams,\n  kHTTP2Session,\n  kResume,\n  kSize,\n  kHTTPContext\n} = require('../core/symbols.js')\n\nconst kOpenStreams = Symbol('open streams')\n\nlet extractBody\n\n// Experimental\nlet h2ExperimentalWarned = false\n\n/** @type {import('http2')} */\nlet http2\ntry {\n  http2 = require('node:http2')\n} catch {\n  // @ts-ignore\n  http2 = { constants: {} }\n}\n\nconst {\n  constants: {\n    HTTP2_HEADER_AUTHORITY,\n    HTTP2_HEADER_METHOD,\n    HTTP2_HEADER_PATH,\n    HTTP2_HEADER_SCHEME,\n    HTTP2_HEADER_CONTENT_LENGTH,\n    HTTP2_HEADER_EXPECT,\n    HTTP2_HEADER_STATUS\n  }\n} = http2\n\nfunction parseH2Headers (headers) {\n  const result = []\n\n  for (const [name, value] of Object.entries(headers)) {\n    // h2 may concat the header value by array\n    // e.g. Set-Cookie\n    if (Array.isArray(value)) {\n      for (const subvalue of value) {\n        // we need to provide each header value of header name\n        // because the headers handler expect name-value pair\n        result.push(Buffer.from(name), Buffer.from(subvalue))\n      }\n    } else {\n      result.push(Buffer.from(name), Buffer.from(value))\n    }\n  }\n\n  return result\n}\n\nasync function connectH2 (client, socket) {\n  client[kSocket] = socket\n\n  if (!h2ExperimentalWarned) {\n    h2ExperimentalWarned = true\n    process.emitWarning('H2 support is experimental, expect them to change at any time.', {\n      code: 'UNDICI-H2'\n    })\n  }\n\n  const session = http2.connect(client[kUrl], {\n    createConnection: () => socket,\n    peerMaxConcurrentStreams: client[kMaxConcurrentStreams]\n  })\n\n  session[kOpenStreams] = 0\n  session[kClient] = client\n  session[kSocket] = socket\n\n  util.addListener(session, 'error', onHttp2SessionError)\n  util.addListener(session, 'frameError', onHttp2FrameError)\n  util.addListener(session, 'end', onHttp2SessionEnd)\n  util.addListener(session, 'goaway', onHTTP2GoAway)\n  util.addListener(session, 'close', function () {\n    const { [kClient]: client } = this\n    const { [kSocket]: socket } = client\n\n    const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket))\n\n    client[kHTTP2Session] = null\n\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n\n      // Fail entire queue.\n      const requests = client[kQueue].splice(client[kRunningIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(client, request, err)\n      }\n    }\n  })\n\n  session.unref()\n\n  client[kHTTP2Session] = session\n  socket[kHTTP2Session] = session\n\n  util.addListener(socket, 'error', function (err) {\n    assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n    this[kError] = err\n\n    this[kClient][kOnError](err)\n  })\n\n  util.addListener(socket, 'end', function () {\n    util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n  })\n\n  util.addListener(socket, 'close', function () {\n    const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n    client[kSocket] = null\n\n    if (this[kHTTP2Session] != null) {\n      this[kHTTP2Session].destroy(err)\n    }\n\n    client[kPendingIdx] = client[kRunningIdx]\n\n    assert(client[kRunning] === 0)\n\n    client.emit('disconnect', client[kUrl], [client], err)\n\n    client[kResume]()\n  })\n\n  let closed = false\n  socket.on('close', () => {\n    closed = true\n  })\n\n  return {\n    version: 'h2',\n    defaultPipelining: Infinity,\n    write (...args) {\n      return writeH2(client, ...args)\n    },\n    resume () {\n      resumeH2(client)\n    },\n    destroy (err, callback) {\n      if (closed) {\n        queueMicrotask(callback)\n      } else {\n        // Destroying the socket will trigger the session close\n        socket.destroy(err).on('close', callback)\n      }\n    },\n    get destroyed () {\n      return socket.destroyed\n    },\n    busy () {\n      return false\n    }\n  }\n}\n\nfunction resumeH2 (client) {\n  const socket = client[kSocket]\n\n  if (socket?.destroyed === false) {\n    if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) {\n      socket.unref()\n      client[kHTTP2Session].unref()\n    } else {\n      socket.ref()\n      client[kHTTP2Session].ref()\n    }\n  }\n}\n\nfunction onHttp2SessionError (err) {\n  assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n  this[kSocket][kError] = err\n  this[kClient][kOnError](err)\n}\n\nfunction onHttp2FrameError (type, code, id) {\n  if (id === 0) {\n    const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n    this[kSocket][kError] = err\n    this[kClient][kOnError](err)\n  }\n}\n\nfunction onHttp2SessionEnd () {\n  const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket]))\n  this.destroy(err)\n  util.destroy(this[kSocket], err)\n}\n\n/**\n * This is the root cause of #3011\n * We need to handle GOAWAY frames properly, and trigger the session close\n * along with the socket right away\n */\nfunction onHTTP2GoAway (code) {\n  // We cannot recover, so best to close the session and the socket\n  const err = this[kError] || new SocketError(`HTTP/2: \"GOAWAY\" frame received with code ${code}`, util.getSocketInfo(this))\n  const client = this[kClient]\n\n  client[kSocket] = null\n  client[kHTTPContext] = null\n\n  if (this[kHTTP2Session] != null) {\n    this[kHTTP2Session].destroy(err)\n    this[kHTTP2Session] = null\n  }\n\n  util.destroy(this[kSocket], err)\n\n  // Fail head of pipeline.\n  if (client[kRunningIdx] < client[kQueue].length) {\n    const request = client[kQueue][client[kRunningIdx]]\n    client[kQueue][client[kRunningIdx]++] = null\n    util.errorRequest(client, request, err)\n    client[kPendingIdx] = client[kRunningIdx]\n  }\n\n  assert(client[kRunning] === 0)\n\n  client.emit('disconnect', client[kUrl], [client], err)\n\n  client[kResume]()\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n  return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH2 (client, request) {\n  const session = client[kHTTP2Session]\n  const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request\n  let { body } = request\n\n  if (upgrade) {\n    util.errorRequest(client, request, new Error('Upgrade not supported for H2'))\n    return false\n  }\n\n  const headers = {}\n  for (let n = 0; n < reqHeaders.length; n += 2) {\n    const key = reqHeaders[n + 0]\n    const val = reqHeaders[n + 1]\n\n    if (Array.isArray(val)) {\n      for (let i = 0; i < val.length; i++) {\n        if (headers[key]) {\n          headers[key] += `,${val[i]}`\n        } else {\n          headers[key] = val[i]\n        }\n      }\n    } else {\n      headers[key] = val\n    }\n  }\n\n  /** @type {import('node:http2').ClientHttp2Stream} */\n  let stream\n\n  const { hostname, port } = client[kUrl]\n\n  headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`\n  headers[HTTP2_HEADER_METHOD] = method\n\n  const abort = (err) => {\n    if (request.aborted || request.completed) {\n      return\n    }\n\n    err = err || new RequestAbortedError()\n\n    util.errorRequest(client, request, err)\n\n    if (stream != null) {\n      util.destroy(stream, err)\n    }\n\n    // We do not destroy the socket as we can continue using the session\n    // the stream get's destroyed and the session remains to create new streams\n    util.destroy(body, err)\n    client[kQueue][client[kRunningIdx]++] = null\n    client[kResume]()\n  }\n\n  try {\n    // We are already connected, streams are pending.\n    // We can call on connect, and wait for abort\n    request.onConnect(abort)\n  } catch (err) {\n    util.errorRequest(client, request, err)\n  }\n\n  if (request.aborted) {\n    return false\n  }\n\n  if (method === 'CONNECT') {\n    session.ref()\n    // We are already connected, streams are pending, first request\n    // will create a new stream. We trigger a request to create the stream and wait until\n    // `ready` event is triggered\n    // We disabled endStream to allow the user to write to the stream\n    stream = session.request(headers, { endStream: false, signal })\n\n    if (stream.id && !stream.pending) {\n      request.onUpgrade(null, null, stream)\n      ++session[kOpenStreams]\n      client[kQueue][client[kRunningIdx]++] = null\n    } else {\n      stream.once('ready', () => {\n        request.onUpgrade(null, null, stream)\n        ++session[kOpenStreams]\n        client[kQueue][client[kRunningIdx]++] = null\n      })\n    }\n\n    stream.once('close', () => {\n      session[kOpenStreams] -= 1\n      if (session[kOpenStreams] === 0) session.unref()\n    })\n\n    return true\n  }\n\n  // https://tools.ietf.org/html/rfc7540#section-8.3\n  // :path and :scheme headers must be omitted when sending CONNECT\n\n  headers[HTTP2_HEADER_PATH] = path\n  headers[HTTP2_HEADER_SCHEME] = 'https'\n\n  // https://tools.ietf.org/html/rfc7231#section-4.3.1\n  // https://tools.ietf.org/html/rfc7231#section-4.3.2\n  // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n  // Sending a payload body on a request that does not\n  // expect it can cause undefined behavior on some\n  // servers and corrupt connection state. Do not\n  // re-use the connection for further requests.\n\n  const expectsPayload = (\n    method === 'PUT' ||\n    method === 'POST' ||\n    method === 'PATCH'\n  )\n\n  if (body && typeof body.read === 'function') {\n    // Try to read EOF in order to get length.\n    body.read(0)\n  }\n\n  let contentLength = util.bodyLength(body)\n\n  if (util.isFormDataLike(body)) {\n    extractBody ??= require('../web/fetch/body.js').extractBody\n\n    const [bodyStream, contentType] = extractBody(body)\n    headers['content-type'] = contentType\n\n    body = bodyStream.stream\n    contentLength = bodyStream.length\n  }\n\n  if (contentLength == null) {\n    contentLength = request.contentLength\n  }\n\n  if (contentLength === 0 || !expectsPayload) {\n    // https://tools.ietf.org/html/rfc7230#section-3.3.2\n    // A user agent SHOULD NOT send a Content-Length header field when\n    // the request message does not contain a payload body and the method\n    // semantics do not anticipate such a body.\n\n    contentLength = null\n  }\n\n  // https://github.com/nodejs/undici/issues/2046\n  // A user agent may send a Content-Length header with 0 value, this should be allowed.\n  if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {\n    if (client[kStrictContentLength]) {\n      util.errorRequest(client, request, new RequestContentLengthMismatchError())\n      return false\n    }\n\n    process.emitWarning(new RequestContentLengthMismatchError())\n  }\n\n  if (contentLength != null) {\n    assert(body, 'no body must not have content length')\n    headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`\n  }\n\n  session.ref()\n\n  const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null\n  if (expectContinue) {\n    headers[HTTP2_HEADER_EXPECT] = '100-continue'\n    stream = session.request(headers, { endStream: shouldEndStream, signal })\n\n    stream.once('continue', writeBodyH2)\n  } else {\n    stream = session.request(headers, {\n      endStream: shouldEndStream,\n      signal\n    })\n    writeBodyH2()\n  }\n\n  // Increment counter as we have new streams open\n  ++session[kOpenStreams]\n\n  stream.once('response', headers => {\n    const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n    request.onResponseStarted()\n\n    // Due to the stream nature, it is possible we face a race condition\n    // where the stream has been assigned, but the request has been aborted\n    // the request remains in-flight and headers hasn't been received yet\n    // for those scenarios, best effort is to destroy the stream immediately\n    // as there's no value to keep it open.\n    if (request.aborted) {\n      const err = new RequestAbortedError()\n      util.errorRequest(client, request, err)\n      util.destroy(stream, err)\n      return\n    }\n\n    if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) {\n      stream.pause()\n    }\n\n    stream.on('data', (chunk) => {\n      if (request.onData(chunk) === false) {\n        stream.pause()\n      }\n    })\n  })\n\n  stream.once('end', () => {\n    // When state is null, it means we haven't consumed body and the stream still do not have\n    // a state.\n    // Present specially when using pipeline or stream\n    if (stream.state?.state == null || stream.state.state < 6) {\n      request.onComplete([])\n    }\n\n    if (session[kOpenStreams] === 0) {\n      // Stream is closed or half-closed-remote (6), decrement counter and cleanup\n      // It does not have sense to continue working with the stream as we do not\n      // have yet RST_STREAM support on client-side\n\n      session.unref()\n    }\n\n    abort(new InformationalError('HTTP/2: stream half-closed (remote)'))\n    client[kQueue][client[kRunningIdx]++] = null\n    client[kPendingIdx] = client[kRunningIdx]\n    client[kResume]()\n  })\n\n  stream.once('close', () => {\n    session[kOpenStreams] -= 1\n    if (session[kOpenStreams] === 0) {\n      session.unref()\n    }\n  })\n\n  stream.once('error', function (err) {\n    abort(err)\n  })\n\n  stream.once('frameError', (type, code) => {\n    abort(new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`))\n  })\n\n  // stream.on('aborted', () => {\n  //   // TODO(HTTP/2): Support aborted\n  // })\n\n  // stream.on('timeout', () => {\n  //   // TODO(HTTP/2): Support timeout\n  // })\n\n  // stream.on('push', headers => {\n  //   // TODO(HTTP/2): Support push\n  // })\n\n  // stream.on('trailers', headers => {\n  //   // TODO(HTTP/2): Support trailers\n  // })\n\n  return true\n\n  function writeBodyH2 () {\n    /* istanbul ignore else: assertion */\n    if (!body || contentLength === 0) {\n      writeBuffer(\n        abort,\n        stream,\n        null,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else if (util.isBuffer(body)) {\n      writeBuffer(\n        abort,\n        stream,\n        body,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else if (util.isBlobLike(body)) {\n      if (typeof body.stream === 'function') {\n        writeIterable(\n          abort,\n          stream,\n          body.stream(),\n          client,\n          request,\n          client[kSocket],\n          contentLength,\n          expectsPayload\n        )\n      } else {\n        writeBlob(\n          abort,\n          stream,\n          body,\n          client,\n          request,\n          client[kSocket],\n          contentLength,\n          expectsPayload\n        )\n      }\n    } else if (util.isStream(body)) {\n      writeStream(\n        abort,\n        client[kSocket],\n        expectsPayload,\n        stream,\n        body,\n        client,\n        request,\n        contentLength\n      )\n    } else if (util.isIterable(body)) {\n      writeIterable(\n        abort,\n        stream,\n        body,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else {\n      assert(false)\n    }\n  }\n}\n\nfunction writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  try {\n    if (body != null && util.isBuffer(body)) {\n      assert(contentLength === body.byteLength, 'buffer body must have content length')\n      h2stream.cork()\n      h2stream.write(body)\n      h2stream.uncork()\n      h2stream.end()\n\n      request.onBodySent(body)\n    }\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    request.onRequestSent()\n    client[kResume]()\n  } catch (error) {\n    abort(error)\n  }\n}\n\nfunction writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n  // For HTTP/2, is enough to pipe the stream\n  const pipe = pipeline(\n    body,\n    h2stream,\n    (err) => {\n      if (err) {\n        util.destroy(pipe, err)\n        abort(err)\n      } else {\n        util.removeAllListeners(pipe)\n        request.onRequestSent()\n\n        if (!expectsPayload) {\n          socket[kReset] = true\n        }\n\n        client[kResume]()\n      }\n    }\n  )\n\n  util.addListener(pipe, 'data', onPipeData)\n\n  function onPipeData (chunk) {\n    request.onBodySent(chunk)\n  }\n}\n\nasync function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  assert(contentLength === body.size, 'blob body must have content length')\n\n  try {\n    if (contentLength != null && contentLength !== body.size) {\n      throw new RequestContentLengthMismatchError()\n    }\n\n    const buffer = Buffer.from(await body.arrayBuffer())\n\n    h2stream.cork()\n    h2stream.write(buffer)\n    h2stream.uncork()\n    h2stream.end()\n\n    request.onBodySent(buffer)\n    request.onRequestSent()\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n  let callback = null\n  function onDrain () {\n    if (callback) {\n      const cb = callback\n      callback = null\n      cb()\n    }\n  }\n\n  const waitForDrain = () => new Promise((resolve, reject) => {\n    assert(callback === null)\n\n    if (socket[kError]) {\n      reject(socket[kError])\n    } else {\n      callback = resolve\n    }\n  })\n\n  h2stream\n    .on('close', onDrain)\n    .on('drain', onDrain)\n\n  try {\n    // It's up to the user to somehow abort the async iterable.\n    for await (const chunk of body) {\n      if (socket[kError]) {\n        throw socket[kError]\n      }\n\n      const res = h2stream.write(chunk)\n      request.onBodySent(chunk)\n      if (!res) {\n        await waitForDrain()\n      }\n    }\n\n    h2stream.end()\n\n    request.onRequestSent()\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  } finally {\n    h2stream\n      .off('close', onDrain)\n      .off('drain', onDrain)\n  }\n}\n\nmodule.exports = connectH2\n","// @ts-check\n\n'use strict'\n\nconst assert = require('node:assert')\nconst net = require('node:net')\nconst http = require('node:http')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst Request = require('../core/request.js')\nconst DispatcherBase = require('./dispatcher-base')\nconst {\n  InvalidArgumentError,\n  InformationalError,\n  ClientDestroyedError\n} = require('../core/errors.js')\nconst buildConnector = require('../core/connect.js')\nconst {\n  kUrl,\n  kServerName,\n  kClient,\n  kBusy,\n  kConnect,\n  kResuming,\n  kRunning,\n  kPending,\n  kSize,\n  kQueue,\n  kConnected,\n  kConnecting,\n  kNeedDrain,\n  kKeepAliveDefaultTimeout,\n  kHostHeader,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kPipelining,\n  kKeepAliveTimeoutValue,\n  kMaxHeadersSize,\n  kKeepAliveMaxTimeout,\n  kKeepAliveTimeoutThreshold,\n  kHeadersTimeout,\n  kBodyTimeout,\n  kStrictContentLength,\n  kConnector,\n  kMaxRedirections,\n  kMaxRequests,\n  kCounter,\n  kClose,\n  kDestroy,\n  kDispatch,\n  kInterceptors,\n  kLocalAddress,\n  kMaxResponseSize,\n  kOnError,\n  kHTTPContext,\n  kMaxConcurrentStreams,\n  kResume\n} = require('../core/symbols.js')\nconst connectH1 = require('./client-h1.js')\nconst connectH2 = require('./client-h2.js')\nlet deprecatedInterceptorWarned = false\n\nconst kClosedResolve = Symbol('kClosedResolve')\n\nconst noop = () => {}\n\nfunction getPipelining (client) {\n  return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1\n}\n\n/**\n * @type {import('../../types/client.js').default}\n */\nclass Client extends DispatcherBase {\n  /**\n   *\n   * @param {string|URL} url\n   * @param {import('../../types/client.js').Client.Options} options\n   */\n  constructor (url, {\n    interceptors,\n    maxHeaderSize,\n    headersTimeout,\n    socketTimeout,\n    requestTimeout,\n    connectTimeout,\n    bodyTimeout,\n    idleTimeout,\n    keepAlive,\n    keepAliveTimeout,\n    maxKeepAliveTimeout,\n    keepAliveMaxTimeout,\n    keepAliveTimeoutThreshold,\n    socketPath,\n    pipelining,\n    tls,\n    strictContentLength,\n    maxCachedSessions,\n    maxRedirections,\n    connect,\n    maxRequestsPerClient,\n    localAddress,\n    maxResponseSize,\n    autoSelectFamily,\n    autoSelectFamilyAttemptTimeout,\n    // h2\n    maxConcurrentStreams,\n    allowH2,\n    webSocket\n  } = {}) {\n    super({ webSocket })\n\n    if (keepAlive !== undefined) {\n      throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')\n    }\n\n    if (socketTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')\n    }\n\n    if (requestTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')\n    }\n\n    if (idleTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')\n    }\n\n    if (maxKeepAliveTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')\n    }\n\n    if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {\n      throw new InvalidArgumentError('invalid maxHeaderSize')\n    }\n\n    if (socketPath != null && typeof socketPath !== 'string') {\n      throw new InvalidArgumentError('invalid socketPath')\n    }\n\n    if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n      throw new InvalidArgumentError('invalid connectTimeout')\n    }\n\n    if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n      throw new InvalidArgumentError('invalid keepAliveTimeout')\n    }\n\n    if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n      throw new InvalidArgumentError('invalid keepAliveMaxTimeout')\n    }\n\n    if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n      throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')\n    }\n\n    if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n      throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')\n    }\n\n    if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n      throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n      throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')\n    }\n\n    if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {\n      throw new InvalidArgumentError('localAddress must be valid string IP address')\n    }\n\n    if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n      throw new InvalidArgumentError('maxResponseSize must be a positive number')\n    }\n\n    if (\n      autoSelectFamilyAttemptTimeout != null &&\n      (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)\n    ) {\n      throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')\n    }\n\n    // h2\n    if (allowH2 != null && typeof allowH2 !== 'boolean') {\n      throw new InvalidArgumentError('allowH2 must be a valid boolean value')\n    }\n\n    if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {\n      throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')\n    }\n\n    if (typeof connect !== 'function') {\n      connect = buildConnector({\n        ...tls,\n        maxCachedSessions,\n        allowH2,\n        socketPath,\n        timeout: connectTimeout,\n        ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n        ...connect\n      })\n    }\n\n    if (interceptors?.Client && Array.isArray(interceptors.Client)) {\n      this[kInterceptors] = interceptors.Client\n      if (!deprecatedInterceptorWarned) {\n        deprecatedInterceptorWarned = true\n        process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', {\n          code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED'\n        })\n      }\n    } else {\n      this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]\n    }\n\n    this[kUrl] = util.parseOrigin(url)\n    this[kConnector] = connect\n    this[kPipelining] = pipelining != null ? pipelining : 1\n    this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize\n    this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout\n    this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout\n    this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold\n    this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]\n    this[kServerName] = null\n    this[kLocalAddress] = localAddress != null ? localAddress : null\n    this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming\n    this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming\n    this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\\r\\n`\n    this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3\n    this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3\n    this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength\n    this[kMaxRedirections] = maxRedirections\n    this[kMaxRequests] = maxRequestsPerClient\n    this[kClosedResolve] = null\n    this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1\n    this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server\n    this[kHTTPContext] = null\n\n    // kQueue is built up of 3 sections separated by\n    // the kRunningIdx and kPendingIdx indices.\n    // |   complete   |   running   |   pending   |\n    //                ^ kRunningIdx ^ kPendingIdx ^ kQueue.length\n    // kRunningIdx points to the first running element.\n    // kPendingIdx points to the first pending element.\n    // This implements a fast queue with an amortized\n    // time of O(1).\n\n    this[kQueue] = []\n    this[kRunningIdx] = 0\n    this[kPendingIdx] = 0\n\n    this[kResume] = (sync) => resume(this, sync)\n    this[kOnError] = (err) => onError(this, err)\n  }\n\n  get pipelining () {\n    return this[kPipelining]\n  }\n\n  set pipelining (value) {\n    this[kPipelining] = value\n    this[kResume](true)\n  }\n\n  get [kPending] () {\n    return this[kQueue].length - this[kPendingIdx]\n  }\n\n  get [kRunning] () {\n    return this[kPendingIdx] - this[kRunningIdx]\n  }\n\n  get [kSize] () {\n    return this[kQueue].length - this[kRunningIdx]\n  }\n\n  get [kConnected] () {\n    return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed\n  }\n\n  get [kBusy] () {\n    return Boolean(\n      this[kHTTPContext]?.busy(null) ||\n      (this[kSize] >= (getPipelining(this) || 1)) ||\n      this[kPending] > 0\n    )\n  }\n\n  /* istanbul ignore: only used for test */\n  [kConnect] (cb) {\n    connect(this)\n    this.once('connect', cb)\n  }\n\n  [kDispatch] (opts, handler) {\n    const origin = opts.origin || this[kUrl].origin\n    const request = new Request(origin, opts, handler)\n\n    this[kQueue].push(request)\n    if (this[kResuming]) {\n      // Do nothing.\n    } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n      // Wait a tick in case stream/iterator is ended in the same tick.\n      this[kResuming] = 1\n      queueMicrotask(() => resume(this))\n    } else {\n      this[kResume](true)\n    }\n\n    if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n      this[kNeedDrain] = 2\n    }\n\n    return this[kNeedDrain] < 2\n  }\n\n  async [kClose] () {\n    // TODO: for H2 we need to gracefully flush the remaining enqueued\n    // request and close each stream.\n    return new Promise((resolve) => {\n      if (this[kSize]) {\n        this[kClosedResolve] = resolve\n      } else {\n        resolve(null)\n      }\n    })\n  }\n\n  async [kDestroy] (err) {\n    return new Promise((resolve) => {\n      const requests = this[kQueue].splice(this[kPendingIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(this, request, err)\n      }\n\n      const callback = () => {\n        if (this[kClosedResolve]) {\n          // TODO (fix): Should we error here with ClientDestroyedError?\n          this[kClosedResolve]()\n          this[kClosedResolve] = null\n        }\n        resolve(null)\n      }\n\n      if (this[kHTTPContext]) {\n        this[kHTTPContext].destroy(err, callback)\n        this[kHTTPContext] = null\n      } else {\n        queueMicrotask(callback)\n      }\n\n      this[kResume]()\n    })\n  }\n}\n\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor.js')\n\nfunction onError (client, err) {\n  if (\n    client[kRunning] === 0 &&\n    err.code !== 'UND_ERR_INFO' &&\n    err.code !== 'UND_ERR_SOCKET'\n  ) {\n    // Error is not caused by running request and not a recoverable\n    // socket error.\n\n    assert(client[kPendingIdx] === client[kRunningIdx])\n\n    const requests = client[kQueue].splice(client[kRunningIdx])\n\n    for (let i = 0; i < requests.length; i++) {\n      const request = requests[i]\n      util.errorRequest(client, request, err)\n    }\n    assert(client[kSize] === 0)\n  }\n}\n\n/**\n * @param {Client} client\n * @returns\n */\nasync function connect (client) {\n  assert(!client[kConnecting])\n  assert(!client[kHTTPContext])\n\n  let { host, hostname, protocol, port } = client[kUrl]\n\n  // Resolve ipv6\n  if (hostname[0] === '[') {\n    const idx = hostname.indexOf(']')\n\n    assert(idx !== -1)\n    const ip = hostname.substring(1, idx)\n\n    assert(net.isIP(ip))\n    hostname = ip\n  }\n\n  client[kConnecting] = true\n\n  if (channels.beforeConnect.hasSubscribers) {\n    channels.beforeConnect.publish({\n      connectParams: {\n        host,\n        hostname,\n        protocol,\n        port,\n        version: client[kHTTPContext]?.version,\n        servername: client[kServerName],\n        localAddress: client[kLocalAddress]\n      },\n      connector: client[kConnector]\n    })\n  }\n\n  try {\n    const socket = await new Promise((resolve, reject) => {\n      client[kConnector]({\n        host,\n        hostname,\n        protocol,\n        port,\n        servername: client[kServerName],\n        localAddress: client[kLocalAddress]\n      }, (err, socket) => {\n        if (err) {\n          reject(err)\n        } else {\n          resolve(socket)\n        }\n      })\n    })\n\n    if (client.destroyed) {\n      util.destroy(socket.on('error', noop), new ClientDestroyedError())\n      return\n    }\n\n    assert(socket)\n\n    try {\n      client[kHTTPContext] = socket.alpnProtocol === 'h2'\n        ? await connectH2(client, socket)\n        : await connectH1(client, socket)\n    } catch (err) {\n      socket.destroy().on('error', noop)\n      throw err\n    }\n\n    client[kConnecting] = false\n\n    socket[kCounter] = 0\n    socket[kMaxRequests] = client[kMaxRequests]\n    socket[kClient] = client\n    socket[kError] = null\n\n    if (channels.connected.hasSubscribers) {\n      channels.connected.publish({\n        connectParams: {\n          host,\n          hostname,\n          protocol,\n          port,\n          version: client[kHTTPContext]?.version,\n          servername: client[kServerName],\n          localAddress: client[kLocalAddress]\n        },\n        connector: client[kConnector],\n        socket\n      })\n    }\n    client.emit('connect', client[kUrl], [client])\n  } catch (err) {\n    if (client.destroyed) {\n      return\n    }\n\n    client[kConnecting] = false\n\n    if (channels.connectError.hasSubscribers) {\n      channels.connectError.publish({\n        connectParams: {\n          host,\n          hostname,\n          protocol,\n          port,\n          version: client[kHTTPContext]?.version,\n          servername: client[kServerName],\n          localAddress: client[kLocalAddress]\n        },\n        connector: client[kConnector],\n        error: err\n      })\n    }\n\n    if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n      assert(client[kRunning] === 0)\n      while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n        const request = client[kQueue][client[kPendingIdx]++]\n        util.errorRequest(client, request, err)\n      }\n    } else {\n      onError(client, err)\n    }\n\n    client.emit('connectionError', client[kUrl], [client], err)\n  }\n\n  client[kResume]()\n}\n\nfunction emitDrain (client) {\n  client[kNeedDrain] = 0\n  client.emit('drain', client[kUrl], [client])\n}\n\nfunction resume (client, sync) {\n  if (client[kResuming] === 2) {\n    return\n  }\n\n  client[kResuming] = 2\n\n  _resume(client, sync)\n  client[kResuming] = 0\n\n  if (client[kRunningIdx] > 256) {\n    client[kQueue].splice(0, client[kRunningIdx])\n    client[kPendingIdx] -= client[kRunningIdx]\n    client[kRunningIdx] = 0\n  }\n}\n\nfunction _resume (client, sync) {\n  while (true) {\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n      return\n    }\n\n    if (client[kClosedResolve] && !client[kSize]) {\n      client[kClosedResolve]()\n      client[kClosedResolve] = null\n      return\n    }\n\n    if (client[kHTTPContext]) {\n      client[kHTTPContext].resume()\n    }\n\n    if (client[kBusy]) {\n      client[kNeedDrain] = 2\n    } else if (client[kNeedDrain] === 2) {\n      if (sync) {\n        client[kNeedDrain] = 1\n        queueMicrotask(() => emitDrain(client))\n      } else {\n        emitDrain(client)\n      }\n      continue\n    }\n\n    if (client[kPending] === 0) {\n      return\n    }\n\n    if (client[kRunning] >= (getPipelining(client) || 1)) {\n      return\n    }\n\n    const request = client[kQueue][client[kPendingIdx]]\n\n    if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {\n      if (client[kRunning] > 0) {\n        return\n      }\n\n      client[kServerName] = request.servername\n      client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {\n        client[kHTTPContext] = null\n        resume(client)\n      })\n    }\n\n    if (client[kConnecting]) {\n      return\n    }\n\n    if (!client[kHTTPContext]) {\n      connect(client)\n      return\n    }\n\n    if (client[kHTTPContext].destroyed) {\n      return\n    }\n\n    if (client[kHTTPContext].busy(request)) {\n      return\n    }\n\n    if (!request.aborted && client[kHTTPContext].write(request)) {\n      client[kPendingIdx]++\n    } else {\n      client[kQueue].splice(client[kPendingIdx], 1)\n    }\n  }\n}\n\nmodule.exports = Client\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst {\n  ClientDestroyedError,\n  ClientClosedError,\n  InvalidArgumentError\n} = require('../core/errors')\nconst { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require('../core/symbols')\n\nconst kOnDestroyed = Symbol('onDestroyed')\nconst kOnClosed = Symbol('onClosed')\nconst kInterceptedDispatch = Symbol('Intercepted Dispatch')\nconst kWebSocketOptions = Symbol('webSocketOptions')\n\nclass DispatcherBase extends Dispatcher {\n  constructor (opts) {\n    super()\n\n    this[kDestroyed] = false\n    this[kOnDestroyed] = null\n    this[kClosed] = false\n    this[kOnClosed] = []\n    this[kWebSocketOptions] = opts?.webSocket ?? {}\n  }\n\n  get webSocketOptions () {\n    return {\n      maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,\n      maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024\n    }\n  }\n\n  get destroyed () {\n    return this[kDestroyed]\n  }\n\n  get closed () {\n    return this[kClosed]\n  }\n\n  get interceptors () {\n    return this[kInterceptors]\n  }\n\n  set interceptors (newInterceptors) {\n    if (newInterceptors) {\n      for (let i = newInterceptors.length - 1; i >= 0; i--) {\n        const interceptor = this[kInterceptors][i]\n        if (typeof interceptor !== 'function') {\n          throw new InvalidArgumentError('interceptor must be an function')\n        }\n      }\n    }\n\n    this[kInterceptors] = newInterceptors\n  }\n\n  close (callback) {\n    if (callback === undefined) {\n      return new Promise((resolve, reject) => {\n        this.close((err, data) => {\n          return err ? reject(err) : resolve(data)\n        })\n      })\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    if (this[kDestroyed]) {\n      queueMicrotask(() => callback(new ClientDestroyedError(), null))\n      return\n    }\n\n    if (this[kClosed]) {\n      if (this[kOnClosed]) {\n        this[kOnClosed].push(callback)\n      } else {\n        queueMicrotask(() => callback(null, null))\n      }\n      return\n    }\n\n    this[kClosed] = true\n    this[kOnClosed].push(callback)\n\n    const onClosed = () => {\n      const callbacks = this[kOnClosed]\n      this[kOnClosed] = null\n      for (let i = 0; i < callbacks.length; i++) {\n        callbacks[i](null, null)\n      }\n    }\n\n    // Should not error.\n    this[kClose]()\n      .then(() => this.destroy())\n      .then(() => {\n        queueMicrotask(onClosed)\n      })\n  }\n\n  destroy (err, callback) {\n    if (typeof err === 'function') {\n      callback = err\n      err = null\n    }\n\n    if (callback === undefined) {\n      return new Promise((resolve, reject) => {\n        this.destroy(err, (err, data) => {\n          return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)\n        })\n      })\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    if (this[kDestroyed]) {\n      if (this[kOnDestroyed]) {\n        this[kOnDestroyed].push(callback)\n      } else {\n        queueMicrotask(() => callback(null, null))\n      }\n      return\n    }\n\n    if (!err) {\n      err = new ClientDestroyedError()\n    }\n\n    this[kDestroyed] = true\n    this[kOnDestroyed] = this[kOnDestroyed] || []\n    this[kOnDestroyed].push(callback)\n\n    const onDestroyed = () => {\n      const callbacks = this[kOnDestroyed]\n      this[kOnDestroyed] = null\n      for (let i = 0; i < callbacks.length; i++) {\n        callbacks[i](null, null)\n      }\n    }\n\n    // Should not error.\n    this[kDestroy](err).then(() => {\n      queueMicrotask(onDestroyed)\n    })\n  }\n\n  [kInterceptedDispatch] (opts, handler) {\n    if (!this[kInterceptors] || this[kInterceptors].length === 0) {\n      this[kInterceptedDispatch] = this[kDispatch]\n      return this[kDispatch](opts, handler)\n    }\n\n    let dispatch = this[kDispatch].bind(this)\n    for (let i = this[kInterceptors].length - 1; i >= 0; i--) {\n      dispatch = this[kInterceptors][i](dispatch)\n    }\n    this[kInterceptedDispatch] = dispatch\n    return dispatch(opts, handler)\n  }\n\n  dispatch (opts, handler) {\n    if (!handler || typeof handler !== 'object') {\n      throw new InvalidArgumentError('handler must be an object')\n    }\n\n    try {\n      if (!opts || typeof opts !== 'object') {\n        throw new InvalidArgumentError('opts must be an object.')\n      }\n\n      if (this[kDestroyed] || this[kOnDestroyed]) {\n        throw new ClientDestroyedError()\n      }\n\n      if (this[kClosed]) {\n        throw new ClientClosedError()\n      }\n\n      return this[kInterceptedDispatch](opts, handler)\n    } catch (err) {\n      if (typeof handler.onError !== 'function') {\n        throw new InvalidArgumentError('invalid onError method')\n      }\n\n      handler.onError(err)\n\n      return false\n    }\n  }\n}\n\nmodule.exports = DispatcherBase\n","'use strict'\nconst EventEmitter = require('node:events')\n\nclass Dispatcher extends EventEmitter {\n  dispatch () {\n    throw new Error('not implemented')\n  }\n\n  close () {\n    throw new Error('not implemented')\n  }\n\n  destroy () {\n    throw new Error('not implemented')\n  }\n\n  compose (...args) {\n    // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...\n    const interceptors = Array.isArray(args[0]) ? args[0] : args\n    let dispatch = this.dispatch.bind(this)\n\n    for (const interceptor of interceptors) {\n      if (interceptor == null) {\n        continue\n      }\n\n      if (typeof interceptor !== 'function') {\n        throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)\n      }\n\n      dispatch = interceptor(dispatch)\n\n      if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {\n        throw new TypeError('invalid interceptor')\n      }\n    }\n\n    return new ComposedDispatcher(this, dispatch)\n  }\n}\n\nclass ComposedDispatcher extends Dispatcher {\n  #dispatcher = null\n  #dispatch = null\n\n  constructor (dispatcher, dispatch) {\n    super()\n    this.#dispatcher = dispatcher\n    this.#dispatch = dispatch\n  }\n\n  dispatch (...args) {\n    this.#dispatch(...args)\n  }\n\n  close (...args) {\n    return this.#dispatcher.close(...args)\n  }\n\n  destroy (...args) {\n    return this.#dispatcher.destroy(...args)\n  }\n}\n\nmodule.exports = Dispatcher\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require('../core/symbols')\nconst ProxyAgent = require('./proxy-agent')\nconst Agent = require('./agent')\n\nconst DEFAULT_PORTS = {\n  'http:': 80,\n  'https:': 443\n}\n\nlet experimentalWarned = false\n\nclass EnvHttpProxyAgent extends DispatcherBase {\n  #noProxyValue = null\n  #noProxyEntries = null\n  #opts = null\n\n  constructor (opts = {}) {\n    super()\n    this.#opts = opts\n\n    if (!experimentalWarned) {\n      experimentalWarned = true\n      process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', {\n        code: 'UNDICI-EHPA'\n      })\n    }\n\n    const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts\n\n    this[kNoProxyAgent] = new Agent(agentOpts)\n\n    const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY\n    if (HTTP_PROXY) {\n      this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY })\n    } else {\n      this[kHttpProxyAgent] = this[kNoProxyAgent]\n    }\n\n    const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY\n    if (HTTPS_PROXY) {\n      this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY })\n    } else {\n      this[kHttpsProxyAgent] = this[kHttpProxyAgent]\n    }\n\n    this.#parseNoProxy()\n  }\n\n  [kDispatch] (opts, handler) {\n    const url = new URL(opts.origin)\n    const agent = this.#getProxyAgentForUrl(url)\n    return agent.dispatch(opts, handler)\n  }\n\n  async [kClose] () {\n    await this[kNoProxyAgent].close()\n    if (!this[kHttpProxyAgent][kClosed]) {\n      await this[kHttpProxyAgent].close()\n    }\n    if (!this[kHttpsProxyAgent][kClosed]) {\n      await this[kHttpsProxyAgent].close()\n    }\n  }\n\n  async [kDestroy] (err) {\n    await this[kNoProxyAgent].destroy(err)\n    if (!this[kHttpProxyAgent][kDestroyed]) {\n      await this[kHttpProxyAgent].destroy(err)\n    }\n    if (!this[kHttpsProxyAgent][kDestroyed]) {\n      await this[kHttpsProxyAgent].destroy(err)\n    }\n  }\n\n  #getProxyAgentForUrl (url) {\n    let { protocol, host: hostname, port } = url\n\n    // Stripping ports in this way instead of using parsedUrl.hostname to make\n    // sure that the brackets around IPv6 addresses are kept.\n    hostname = hostname.replace(/:\\d*$/, '').toLowerCase()\n    port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0\n    if (!this.#shouldProxy(hostname, port)) {\n      return this[kNoProxyAgent]\n    }\n    if (protocol === 'https:') {\n      return this[kHttpsProxyAgent]\n    }\n    return this[kHttpProxyAgent]\n  }\n\n  #shouldProxy (hostname, port) {\n    if (this.#noProxyChanged) {\n      this.#parseNoProxy()\n    }\n\n    if (this.#noProxyEntries.length === 0) {\n      return true // Always proxy if NO_PROXY is not set or empty.\n    }\n    if (this.#noProxyValue === '*') {\n      return false // Never proxy if wildcard is set.\n    }\n\n    for (let i = 0; i < this.#noProxyEntries.length; i++) {\n      const entry = this.#noProxyEntries[i]\n      if (entry.port && entry.port !== port) {\n        continue // Skip if ports don't match.\n      }\n      if (!/^[.*]/.test(entry.hostname)) {\n        // No wildcards, so don't proxy only if there is not an exact match.\n        if (hostname === entry.hostname) {\n          return false\n        }\n      } else {\n        // Don't proxy if the hostname ends with the no_proxy host.\n        if (hostname.endsWith(entry.hostname.replace(/^\\*/, ''))) {\n          return false\n        }\n      }\n    }\n\n    return true\n  }\n\n  #parseNoProxy () {\n    const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv\n    const noProxySplit = noProxyValue.split(/[,\\s]/)\n    const noProxyEntries = []\n\n    for (let i = 0; i < noProxySplit.length; i++) {\n      const entry = noProxySplit[i]\n      if (!entry) {\n        continue\n      }\n      const parsed = entry.match(/^(.+):(\\d+)$/)\n      noProxyEntries.push({\n        hostname: (parsed ? parsed[1] : entry).toLowerCase(),\n        port: parsed ? Number.parseInt(parsed[2], 10) : 0\n      })\n    }\n\n    this.#noProxyValue = noProxyValue\n    this.#noProxyEntries = noProxyEntries\n  }\n\n  get #noProxyChanged () {\n    if (this.#opts.noProxy !== undefined) {\n      return false\n    }\n    return this.#noProxyValue !== this.#noProxyEnv\n  }\n\n  get #noProxyEnv () {\n    return process.env.no_proxy ?? process.env.NO_PROXY ?? ''\n  }\n}\n\nmodule.exports = EnvHttpProxyAgent\n","/* eslint-disable */\n\n'use strict'\n\n// Extracted from node/lib/internal/fixed_queue.js\n\n// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.\nconst kSize = 2048;\nconst kMask = kSize - 1;\n\n// The FixedQueue is implemented as a singly-linked list of fixed-size\n// circular buffers. It looks something like this:\n//\n//  head                                                       tail\n//    |                                                          |\n//    v                                                          v\n// +-----------+ <-----\\       +-----------+ <------\\         +-----------+\n// |  [null]   |        \\----- |   next    |         \\------- |   next    |\n// +-----------+               +-----------+                  +-----------+\n// |   item    | <-- bottom    |   item    | <-- bottom       |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |       bottom --> |   item    |\n// |   item    |               |   item    |                  |   item    |\n// |    ...    |               |    ...    |                  |    ...    |\n// |   item    |               |   item    |                  |   item    |\n// |   item    |               |   item    |                  |   item    |\n// |  [empty]  | <-- top       |   item    |                  |   item    |\n// |  [empty]  |               |   item    |                  |   item    |\n// |  [empty]  |               |  [empty]  | <-- top  top --> |  [empty]  |\n// +-----------+               +-----------+                  +-----------+\n//\n// Or, if there is only one circular buffer, it looks something\n// like either of these:\n//\n//  head   tail                                 head   tail\n//    |     |                                     |     |\n//    v     v                                     v     v\n// +-----------+                               +-----------+\n// |  [null]   |                               |  [null]   |\n// +-----------+                               +-----------+\n// |  [empty]  |                               |   item    |\n// |  [empty]  |                               |   item    |\n// |   item    | <-- bottom            top --> |  [empty]  |\n// |   item    |                               |  [empty]  |\n// |  [empty]  | <-- top            bottom --> |   item    |\n// |  [empty]  |                               |   item    |\n// +-----------+                               +-----------+\n//\n// Adding a value means moving `top` forward by one, removing means\n// moving `bottom` forward by one. After reaching the end, the queue\n// wraps around.\n//\n// When `top === bottom` the current queue is empty and when\n// `top + 1 === bottom` it's full. This wastes a single space of storage\n// but allows much quicker checks.\n\nclass FixedCircularBuffer {\n  constructor() {\n    this.bottom = 0;\n    this.top = 0;\n    this.list = new Array(kSize);\n    this.next = null;\n  }\n\n  isEmpty() {\n    return this.top === this.bottom;\n  }\n\n  isFull() {\n    return ((this.top + 1) & kMask) === this.bottom;\n  }\n\n  push(data) {\n    this.list[this.top] = data;\n    this.top = (this.top + 1) & kMask;\n  }\n\n  shift() {\n    const nextItem = this.list[this.bottom];\n    if (nextItem === undefined)\n      return null;\n    this.list[this.bottom] = undefined;\n    this.bottom = (this.bottom + 1) & kMask;\n    return nextItem;\n  }\n}\n\nmodule.exports = class FixedQueue {\n  constructor() {\n    this.head = this.tail = new FixedCircularBuffer();\n  }\n\n  isEmpty() {\n    return this.head.isEmpty();\n  }\n\n  push(data) {\n    if (this.head.isFull()) {\n      // Head is full: Creates a new queue, sets the old queue's `.next` to it,\n      // and sets it as the new main queue.\n      this.head = this.head.next = new FixedCircularBuffer();\n    }\n    this.head.push(data);\n  }\n\n  shift() {\n    const tail = this.tail;\n    const next = tail.shift();\n    if (tail.isEmpty() && tail.next !== null) {\n      // If there is another queue, it forms the new tail.\n      this.tail = tail.next;\n    }\n    return next;\n  }\n};\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst FixedQueue = require('./fixed-queue')\nconst { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('../core/symbols')\nconst PoolStats = require('./pool-stats')\n\nconst kClients = Symbol('clients')\nconst kNeedDrain = Symbol('needDrain')\nconst kQueue = Symbol('queue')\nconst kClosedResolve = Symbol('closed resolve')\nconst kOnDrain = Symbol('onDrain')\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kGetDispatcher = Symbol('get dispatcher')\nconst kAddClient = Symbol('add client')\nconst kRemoveClient = Symbol('remove client')\nconst kStats = Symbol('stats')\n\nclass PoolBase extends DispatcherBase {\n  constructor (opts) {\n    super(opts)\n\n    this[kQueue] = new FixedQueue()\n    this[kClients] = []\n    this[kQueued] = 0\n\n    const pool = this\n\n    this[kOnDrain] = function onDrain (origin, targets) {\n      const queue = pool[kQueue]\n\n      let needDrain = false\n\n      while (!needDrain) {\n        const item = queue.shift()\n        if (!item) {\n          break\n        }\n        pool[kQueued]--\n        needDrain = !this.dispatch(item.opts, item.handler)\n      }\n\n      this[kNeedDrain] = needDrain\n\n      if (!this[kNeedDrain] && pool[kNeedDrain]) {\n        pool[kNeedDrain] = false\n        pool.emit('drain', origin, [pool, ...targets])\n      }\n\n      if (pool[kClosedResolve] && queue.isEmpty()) {\n        Promise\n          .all(pool[kClients].map(c => c.close()))\n          .then(pool[kClosedResolve])\n      }\n    }\n\n    this[kOnConnect] = (origin, targets) => {\n      pool.emit('connect', origin, [pool, ...targets])\n    }\n\n    this[kOnDisconnect] = (origin, targets, err) => {\n      pool.emit('disconnect', origin, [pool, ...targets], err)\n    }\n\n    this[kOnConnectionError] = (origin, targets, err) => {\n      pool.emit('connectionError', origin, [pool, ...targets], err)\n    }\n\n    this[kStats] = new PoolStats(this)\n  }\n\n  get [kBusy] () {\n    return this[kNeedDrain]\n  }\n\n  get [kConnected] () {\n    return this[kClients].filter(client => client[kConnected]).length\n  }\n\n  get [kFree] () {\n    return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length\n  }\n\n  get [kPending] () {\n    let ret = this[kQueued]\n    for (const { [kPending]: pending } of this[kClients]) {\n      ret += pending\n    }\n    return ret\n  }\n\n  get [kRunning] () {\n    let ret = 0\n    for (const { [kRunning]: running } of this[kClients]) {\n      ret += running\n    }\n    return ret\n  }\n\n  get [kSize] () {\n    let ret = this[kQueued]\n    for (const { [kSize]: size } of this[kClients]) {\n      ret += size\n    }\n    return ret\n  }\n\n  get stats () {\n    return this[kStats]\n  }\n\n  async [kClose] () {\n    if (this[kQueue].isEmpty()) {\n      await Promise.all(this[kClients].map(c => c.close()))\n    } else {\n      await new Promise((resolve) => {\n        this[kClosedResolve] = resolve\n      })\n    }\n  }\n\n  async [kDestroy] (err) {\n    while (true) {\n      const item = this[kQueue].shift()\n      if (!item) {\n        break\n      }\n      item.handler.onError(err)\n    }\n\n    await Promise.all(this[kClients].map(c => c.destroy(err)))\n  }\n\n  [kDispatch] (opts, handler) {\n    const dispatcher = this[kGetDispatcher]()\n\n    if (!dispatcher) {\n      this[kNeedDrain] = true\n      this[kQueue].push({ opts, handler })\n      this[kQueued]++\n    } else if (!dispatcher.dispatch(opts, handler)) {\n      dispatcher[kNeedDrain] = true\n      this[kNeedDrain] = !this[kGetDispatcher]()\n    }\n\n    return !this[kNeedDrain]\n  }\n\n  [kAddClient] (client) {\n    client\n      .on('drain', this[kOnDrain])\n      .on('connect', this[kOnConnect])\n      .on('disconnect', this[kOnDisconnect])\n      .on('connectionError', this[kOnConnectionError])\n\n    this[kClients].push(client)\n\n    if (this[kNeedDrain]) {\n      queueMicrotask(() => {\n        if (this[kNeedDrain]) {\n          this[kOnDrain](client[kUrl], [this, client])\n        }\n      })\n    }\n\n    return this\n  }\n\n  [kRemoveClient] (client) {\n    client.close(() => {\n      const idx = this[kClients].indexOf(client)\n      if (idx !== -1) {\n        this[kClients].splice(idx, 1)\n      }\n    })\n\n    this[kNeedDrain] = this[kClients].some(dispatcher => (\n      !dispatcher[kNeedDrain] &&\n      dispatcher.closed !== true &&\n      dispatcher.destroyed !== true\n    ))\n  }\n}\n\nmodule.exports = {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kRemoveClient,\n  kGetDispatcher\n}\n","const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('../core/symbols')\nconst kPool = Symbol('pool')\n\nclass PoolStats {\n  constructor (pool) {\n    this[kPool] = pool\n  }\n\n  get connected () {\n    return this[kPool][kConnected]\n  }\n\n  get free () {\n    return this[kPool][kFree]\n  }\n\n  get pending () {\n    return this[kPool][kPending]\n  }\n\n  get queued () {\n    return this[kPool][kQueued]\n  }\n\n  get running () {\n    return this[kPool][kRunning]\n  }\n\n  get size () {\n    return this[kPool][kSize]\n  }\n}\n\nmodule.exports = PoolStats\n","'use strict'\n\nconst {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kGetDispatcher\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n  InvalidArgumentError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst buildConnector = require('../core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\n\nfunction defaultFactory (origin, opts) {\n  return new Client(origin, opts)\n}\n\nclass Pool extends PoolBase {\n  constructor (origin, {\n    connections,\n    factory = defaultFactory,\n    connect,\n    connectTimeout,\n    tls,\n    maxCachedSessions,\n    socketPath,\n    autoSelectFamily,\n    autoSelectFamilyAttemptTimeout,\n    allowH2,\n    ...options\n  } = {}) {\n    if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n      throw new InvalidArgumentError('invalid connections')\n    }\n\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (typeof connect !== 'function') {\n      connect = buildConnector({\n        ...tls,\n        maxCachedSessions,\n        allowH2,\n        socketPath,\n        timeout: connectTimeout,\n        ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n        ...connect\n      })\n    }\n\n    super(options)\n\n    this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool)\n      ? options.interceptors.Pool\n      : []\n    this[kConnections] = connections || null\n    this[kUrl] = util.parseOrigin(origin)\n    this[kOptions] = { ...util.deepClone(options), connect, allowH2 }\n    this[kOptions].interceptors = options.interceptors\n      ? { ...options.interceptors }\n      : undefined\n    this[kFactory] = factory\n\n    this.on('connectionError', (origin, targets, error) => {\n      // If a connection error occurs, we remove the client from the pool,\n      // and emit a connectionError event. They will not be re-used.\n      // Fixes https://github.com/nodejs/undici/issues/3895\n      for (const target of targets) {\n        // Do not use kRemoveClient here, as it will close the client,\n        // but the client cannot be closed in this state.\n        const idx = this[kClients].indexOf(target)\n        if (idx !== -1) {\n          this[kClients].splice(idx, 1)\n        }\n      }\n    })\n  }\n\n  [kGetDispatcher] () {\n    for (const client of this[kClients]) {\n      if (!client[kNeedDrain]) {\n        return client\n      }\n    }\n\n    if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n      const dispatcher = this[kFactory](this[kUrl], this[kOptions])\n      this[kAddClient](dispatcher)\n      return dispatcher\n    }\n  }\n}\n\nmodule.exports = Pool\n","'use strict'\n\nconst { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst { URL } = require('node:url')\nconst Agent = require('./agent')\nconst Pool = require('./pool')\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors')\nconst buildConnector = require('../core/connect')\nconst Client = require('./client')\n\nconst kAgent = Symbol('proxy agent')\nconst kClient = Symbol('proxy client')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kRequestTls = Symbol('request tls settings')\nconst kProxyTls = Symbol('proxy tls settings')\nconst kConnectEndpoint = Symbol('connect endpoint function')\nconst kTunnelProxy = Symbol('tunnel proxy')\n\nfunction defaultProtocolPort (protocol) {\n  return protocol === 'https:' ? 443 : 80\n}\n\nfunction defaultFactory (origin, opts) {\n  return new Pool(origin, opts)\n}\n\nconst noop = () => {}\n\nfunction defaultAgentFactory (origin, opts) {\n  if (opts.connections === 1) {\n    return new Client(origin, opts)\n  }\n  return new Pool(origin, opts)\n}\n\nclass Http1ProxyWrapper extends DispatcherBase {\n  #client\n\n  constructor (proxyUrl, { headers = {}, connect, factory }) {\n    super()\n    if (!proxyUrl) {\n      throw new InvalidArgumentError('Proxy URL is mandatory')\n    }\n\n    this[kProxyHeaders] = headers\n    if (factory) {\n      this.#client = factory(proxyUrl, { connect })\n    } else {\n      this.#client = new Client(proxyUrl, { connect })\n    }\n  }\n\n  [kDispatch] (opts, handler) {\n    const onHeaders = handler.onHeaders\n    handler.onHeaders = function (statusCode, data, resume) {\n      if (statusCode === 407) {\n        if (typeof handler.onError === 'function') {\n          handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)'))\n        }\n        return\n      }\n      if (onHeaders) onHeaders.call(this, statusCode, data, resume)\n    }\n\n    // Rewrite request as an HTTP1 Proxy request, without tunneling.\n    const {\n      origin,\n      path = '/',\n      headers = {}\n    } = opts\n\n    opts.path = origin + path\n\n    if (!('host' in headers) && !('Host' in headers)) {\n      const { host } = new URL(origin)\n      headers.host = host\n    }\n    opts.headers = { ...this[kProxyHeaders], ...headers }\n\n    return this.#client[kDispatch](opts, handler)\n  }\n\n  async [kClose] () {\n    return this.#client.close()\n  }\n\n  async [kDestroy] (err) {\n    return this.#client.destroy(err)\n  }\n}\n\nclass ProxyAgent extends DispatcherBase {\n  constructor (opts) {\n    super()\n\n    if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) {\n      throw new InvalidArgumentError('Proxy uri is mandatory')\n    }\n\n    const { clientFactory = defaultFactory } = opts\n    if (typeof clientFactory !== 'function') {\n      throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')\n    }\n\n    const { proxyTunnel = true } = opts\n\n    const url = this.#getUrl(opts)\n    const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url\n\n    this[kProxy] = { uri: href, protocol }\n    this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)\n      ? opts.interceptors.ProxyAgent\n      : []\n    this[kRequestTls] = opts.requestTls\n    this[kProxyTls] = opts.proxyTls\n    this[kProxyHeaders] = opts.headers || {}\n    this[kTunnelProxy] = proxyTunnel\n\n    if (opts.auth && opts.token) {\n      throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')\n    } else if (opts.auth) {\n      /* @deprecated in favour of opts.token */\n      this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`\n    } else if (opts.token) {\n      this[kProxyHeaders]['proxy-authorization'] = opts.token\n    } else if (username && password) {\n      this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`\n    }\n\n    const connect = buildConnector({ ...opts.proxyTls })\n    this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })\n\n    const agentFactory = opts.factory || defaultAgentFactory\n    const factory = (origin, options) => {\n      const { protocol } = new URL(origin)\n      if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') {\n        return new Http1ProxyWrapper(this[kProxy].uri, {\n          headers: this[kProxyHeaders],\n          connect,\n          factory: agentFactory\n        })\n      }\n      return agentFactory(origin, options)\n    }\n    this[kClient] = clientFactory(url, { connect })\n    this[kAgent] = new Agent({\n      ...opts,\n      factory,\n      connect: async (opts, callback) => {\n        let requestedPath = opts.host\n        if (!opts.port) {\n          requestedPath += `:${defaultProtocolPort(opts.protocol)}`\n        }\n        try {\n          const { socket, statusCode } = await this[kClient].connect({\n            origin,\n            port,\n            path: requestedPath,\n            signal: opts.signal,\n            headers: {\n              ...this[kProxyHeaders],\n              host: opts.host\n            },\n            servername: this[kProxyTls]?.servername || proxyHostname\n          })\n          if (statusCode !== 200) {\n            socket.on('error', noop).destroy()\n            callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))\n          }\n          if (opts.protocol !== 'https:') {\n            callback(null, socket)\n            return\n          }\n          let servername\n          if (this[kRequestTls]) {\n            servername = this[kRequestTls].servername\n          } else {\n            servername = opts.servername\n          }\n          this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)\n        } catch (err) {\n          if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n            // Throw a custom error to avoid loop in client.js#connect\n            callback(new SecureProxyConnectionError(err))\n          } else {\n            callback(err)\n          }\n        }\n      }\n    })\n  }\n\n  dispatch (opts, handler) {\n    const headers = buildHeaders(opts.headers)\n    throwIfProxyAuthIsSent(headers)\n\n    if (headers && !('host' in headers) && !('Host' in headers)) {\n      const { host } = new URL(opts.origin)\n      headers.host = host\n    }\n\n    return this[kAgent].dispatch(\n      {\n        ...opts,\n        headers\n      },\n      handler\n    )\n  }\n\n  /**\n   * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts\n   * @returns {URL}\n   */\n  #getUrl (opts) {\n    if (typeof opts === 'string') {\n      return new URL(opts)\n    } else if (opts instanceof URL) {\n      return opts\n    } else {\n      return new URL(opts.uri)\n    }\n  }\n\n  async [kClose] () {\n    await this[kAgent].close()\n    await this[kClient].close()\n  }\n\n  async [kDestroy] () {\n    await this[kAgent].destroy()\n    await this[kClient].destroy()\n  }\n}\n\n/**\n * @param {string[] | Record} headers\n * @returns {Record}\n */\nfunction buildHeaders (headers) {\n  // When using undici.fetch, the headers list is stored\n  // as an array.\n  if (Array.isArray(headers)) {\n    /** @type {Record} */\n    const headersPair = {}\n\n    for (let i = 0; i < headers.length; i += 2) {\n      headersPair[headers[i]] = headers[i + 1]\n    }\n\n    return headersPair\n  }\n\n  return headers\n}\n\n/**\n * @param {Record} headers\n *\n * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers\n * Nevertheless, it was changed and to avoid a security vulnerability by end users\n * this check was created.\n * It should be removed in the next major version for performance reasons\n */\nfunction throwIfProxyAuthIsSent (headers) {\n  const existProxyAuth = headers && Object.keys(headers)\n    .find((key) => key.toLowerCase() === 'proxy-authorization')\n  if (existProxyAuth) {\n    throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')\n  }\n}\n\nmodule.exports = ProxyAgent\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst RetryHandler = require('../handler/retry-handler')\n\nclass RetryAgent extends Dispatcher {\n  #agent = null\n  #options = null\n  constructor (agent, options = {}) {\n    super(options)\n    this.#agent = agent\n    this.#options = options\n  }\n\n  dispatch (opts, handler) {\n    const retry = new RetryHandler({\n      ...opts,\n      retryOptions: this.#options\n    }, {\n      dispatch: this.#agent.dispatch.bind(this.#agent),\n      handler\n    })\n    return this.#agent.dispatch(opts, retry)\n  }\n\n  close () {\n    return this.#agent.close()\n  }\n\n  destroy () {\n    return this.#agent.destroy()\n  }\n}\n\nmodule.exports = RetryAgent\n","'use strict'\n\n// We include a version number for the Dispatcher API. In case of breaking changes,\n// this version number must be increased to avoid conflicts.\nconst globalDispatcher = Symbol.for('undici.globalDispatcher.1')\nconst { InvalidArgumentError } = require('./core/errors')\nconst Agent = require('./dispatcher/agent')\n\nif (getGlobalDispatcher() === undefined) {\n  setGlobalDispatcher(new Agent())\n}\n\nfunction setGlobalDispatcher (agent) {\n  if (!agent || typeof agent.dispatch !== 'function') {\n    throw new InvalidArgumentError('Argument agent must implement Agent')\n  }\n  Object.defineProperty(globalThis, globalDispatcher, {\n    value: agent,\n    writable: true,\n    enumerable: false,\n    configurable: false\n  })\n}\n\nfunction getGlobalDispatcher () {\n  return globalThis[globalDispatcher]\n}\n\nmodule.exports = {\n  setGlobalDispatcher,\n  getGlobalDispatcher\n}\n","'use strict'\n\nmodule.exports = class DecoratorHandler {\n  #handler\n\n  constructor (handler) {\n    if (typeof handler !== 'object' || handler === null) {\n      throw new TypeError('handler must be an object')\n    }\n    this.#handler = handler\n  }\n\n  onConnect (...args) {\n    return this.#handler.onConnect?.(...args)\n  }\n\n  onError (...args) {\n    return this.#handler.onError?.(...args)\n  }\n\n  onUpgrade (...args) {\n    return this.#handler.onUpgrade?.(...args)\n  }\n\n  onResponseStarted (...args) {\n    return this.#handler.onResponseStarted?.(...args)\n  }\n\n  onHeaders (...args) {\n    return this.#handler.onHeaders?.(...args)\n  }\n\n  onData (...args) {\n    return this.#handler.onData?.(...args)\n  }\n\n  onComplete (...args) {\n    return this.#handler.onComplete?.(...args)\n  }\n\n  onBodySent (...args) {\n    return this.#handler.onBodySent?.(...args)\n  }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('node:assert')\nconst { InvalidArgumentError } = require('../core/errors')\nconst EE = require('node:events')\n\nconst redirectableStatusCodes = [300, 301, 302, 303, 307, 308]\n\nconst kBody = Symbol('body')\n\nclass BodyAsyncIterable {\n  constructor (body) {\n    this[kBody] = body\n    this[kBodyUsed] = false\n  }\n\n  async * [Symbol.asyncIterator] () {\n    assert(!this[kBodyUsed], 'disturbed')\n    this[kBodyUsed] = true\n    yield * this[kBody]\n  }\n}\n\nclass RedirectHandler {\n  constructor (dispatch, maxRedirections, opts, handler) {\n    if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    util.validateHandler(handler, opts.method, opts.upgrade)\n\n    this.dispatch = dispatch\n    this.location = null\n    this.abort = null\n    this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy\n    this.maxRedirections = maxRedirections\n    this.handler = handler\n    this.history = []\n    this.redirectionLimitReached = false\n\n    if (util.isStream(this.opts.body)) {\n      // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n      // so that it can be dispatched again?\n      // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n      if (util.bodyLength(this.opts.body) === 0) {\n        this.opts.body\n          .on('data', function () {\n            assert(false)\n          })\n      }\n\n      if (typeof this.opts.body.readableDidRead !== 'boolean') {\n        this.opts.body[kBodyUsed] = false\n        EE.prototype.on.call(this.opts.body, 'data', function () {\n          this[kBodyUsed] = true\n        })\n      }\n    } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {\n      // TODO (fix): We can't access ReadableStream internal state\n      // to determine whether or not it has been disturbed. This is just\n      // a workaround.\n      this.opts.body = new BodyAsyncIterable(this.opts.body)\n    } else if (\n      this.opts.body &&\n      typeof this.opts.body !== 'string' &&\n      !ArrayBuffer.isView(this.opts.body) &&\n      util.isIterable(this.opts.body)\n    ) {\n      // TODO: Should we allow re-using iterable if !this.opts.idempotent\n      // or through some other flag?\n      this.opts.body = new BodyAsyncIterable(this.opts.body)\n    }\n  }\n\n  onConnect (abort) {\n    this.abort = abort\n    this.handler.onConnect(abort, { history: this.history })\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    this.handler.onUpgrade(statusCode, headers, socket)\n  }\n\n  onError (error) {\n    this.handler.onError(error)\n  }\n\n  onHeaders (statusCode, headers, resume, statusText) {\n    this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)\n      ? null\n      : parseLocation(statusCode, headers)\n\n    if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {\n      if (this.request) {\n        this.request.abort(new Error('max redirects'))\n      }\n\n      this.redirectionLimitReached = true\n      this.abort(new Error('max redirects'))\n      return\n    }\n\n    if (this.opts.origin) {\n      this.history.push(new URL(this.opts.path, this.opts.origin))\n    }\n\n    if (!this.location) {\n      return this.handler.onHeaders(statusCode, headers, resume, statusText)\n    }\n\n    const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))\n    const path = search ? `${pathname}${search}` : pathname\n\n    // Remove headers referring to the original URL.\n    // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.\n    // https://tools.ietf.org/html/rfc7231#section-6.4\n    this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)\n    this.opts.path = path\n    this.opts.origin = origin\n    this.opts.maxRedirections = 0\n    this.opts.query = null\n\n    // https://tools.ietf.org/html/rfc7231#section-6.4.4\n    // In case of HTTP 303, always replace method to be either HEAD or GET\n    if (statusCode === 303 && this.opts.method !== 'HEAD') {\n      this.opts.method = 'GET'\n      this.opts.body = null\n    }\n  }\n\n  onData (chunk) {\n    if (this.location) {\n      /*\n        https://tools.ietf.org/html/rfc7231#section-6.4\n\n        TLDR: undici always ignores 3xx response bodies.\n\n        Redirection is used to serve the requested resource from another URL, so it is assumes that\n        no body is generated (and thus can be ignored). Even though generating a body is not prohibited.\n\n        For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually\n        (which means it's optional and not mandated) contain just an hyperlink to the value of\n        the Location response header, so the body can be ignored safely.\n\n        For status 300, which is \"Multiple Choices\", the spec mentions both generating a Location\n        response header AND a response body with the other possible location to follow.\n        Since the spec explicitly chooses not to specify a format for such body and leave it to\n        servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.\n      */\n    } else {\n      return this.handler.onData(chunk)\n    }\n  }\n\n  onComplete (trailers) {\n    if (this.location) {\n      /*\n        https://tools.ietf.org/html/rfc7231#section-6.4\n\n        TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections\n        and neither are useful if present.\n\n        See comment on onData method above for more detailed information.\n      */\n\n      this.location = null\n      this.abort = null\n\n      this.dispatch(this.opts, this)\n    } else {\n      this.handler.onComplete(trailers)\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this.handler.onBodySent) {\n      this.handler.onBodySent(chunk)\n    }\n  }\n}\n\nfunction parseLocation (statusCode, headers) {\n  if (redirectableStatusCodes.indexOf(statusCode) === -1) {\n    return null\n  }\n\n  for (let i = 0; i < headers.length; i += 2) {\n    if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') {\n      return headers[i + 1]\n    }\n  }\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4.4\nfunction shouldRemoveHeader (header, removeContent, unknownOrigin) {\n  if (header.length === 4) {\n    return util.headerNameToString(header) === 'host'\n  }\n  if (removeContent && util.headerNameToString(header).startsWith('content-')) {\n    return true\n  }\n  if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {\n    const name = util.headerNameToString(header)\n    return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'\n  }\n  return false\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4\nfunction cleanRequestHeaders (headers, removeContent, unknownOrigin) {\n  const ret = []\n  if (Array.isArray(headers)) {\n    for (let i = 0; i < headers.length; i += 2) {\n      if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n        ret.push(headers[i], headers[i + 1])\n      }\n    }\n  } else if (headers && typeof headers === 'object') {\n    for (const key of Object.keys(headers)) {\n      if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n        ret.push(key, headers[key])\n      }\n    }\n  } else {\n    assert(headers == null, 'headers must be an object or an array')\n  }\n  return ret\n}\n\nmodule.exports = RedirectHandler\n","'use strict'\nconst assert = require('node:assert')\n\nconst { kRetryHandlerDefaultRetry } = require('../core/symbols')\nconst { RequestRetryError } = require('../core/errors')\nconst {\n  isDisturbed,\n  parseHeaders,\n  parseRangeHeader,\n  wrapRequestBody\n} = require('../core/util')\n\nfunction calculateRetryAfterHeader (retryAfter) {\n  const current = Date.now()\n  return new Date(retryAfter).getTime() - current\n}\n\nclass RetryHandler {\n  constructor (opts, handlers) {\n    const { retryOptions, ...dispatchOpts } = opts\n    const {\n      // Retry scoped\n      retry: retryFn,\n      maxRetries,\n      maxTimeout,\n      minTimeout,\n      timeoutFactor,\n      // Response scoped\n      methods,\n      errorCodes,\n      retryAfter,\n      statusCodes\n    } = retryOptions ?? {}\n\n    this.dispatch = handlers.dispatch\n    this.handler = handlers.handler\n    this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }\n    this.abort = null\n    this.aborted = false\n    this.retryOpts = {\n      retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],\n      retryAfter: retryAfter ?? true,\n      maxTimeout: maxTimeout ?? 30 * 1000, // 30s,\n      minTimeout: minTimeout ?? 500, // .5s\n      timeoutFactor: timeoutFactor ?? 2,\n      maxRetries: maxRetries ?? 5,\n      // What errors we should retry\n      methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],\n      // Indicates which errors to retry\n      statusCodes: statusCodes ?? [500, 502, 503, 504, 429],\n      // List of errors to retry\n      errorCodes: errorCodes ?? [\n        'ECONNRESET',\n        'ECONNREFUSED',\n        'ENOTFOUND',\n        'ENETDOWN',\n        'ENETUNREACH',\n        'EHOSTDOWN',\n        'EHOSTUNREACH',\n        'EPIPE',\n        'UND_ERR_SOCKET'\n      ]\n    }\n\n    this.retryCount = 0\n    this.retryCountCheckpoint = 0\n    this.start = 0\n    this.end = null\n    this.etag = null\n    this.resume = null\n\n    // Handle possible onConnect duplication\n    this.handler.onConnect(reason => {\n      this.aborted = true\n      if (this.abort) {\n        this.abort(reason)\n      } else {\n        this.reason = reason\n      }\n    })\n  }\n\n  onRequestSent () {\n    if (this.handler.onRequestSent) {\n      this.handler.onRequestSent()\n    }\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    if (this.handler.onUpgrade) {\n      this.handler.onUpgrade(statusCode, headers, socket)\n    }\n  }\n\n  onConnect (abort) {\n    if (this.aborted) {\n      abort(this.reason)\n    } else {\n      this.abort = abort\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this.handler.onBodySent) return this.handler.onBodySent(chunk)\n  }\n\n  static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {\n    const { statusCode, code, headers } = err\n    const { method, retryOptions } = opts\n    const {\n      maxRetries,\n      minTimeout,\n      maxTimeout,\n      timeoutFactor,\n      statusCodes,\n      errorCodes,\n      methods\n    } = retryOptions\n    const { counter } = state\n\n    // Any code that is not a Undici's originated and allowed to retry\n    if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) {\n      cb(err)\n      return\n    }\n\n    // If a set of method are provided and the current method is not in the list\n    if (Array.isArray(methods) && !methods.includes(method)) {\n      cb(err)\n      return\n    }\n\n    // If a set of status code are provided and the current status code is not in the list\n    if (\n      statusCode != null &&\n      Array.isArray(statusCodes) &&\n      !statusCodes.includes(statusCode)\n    ) {\n      cb(err)\n      return\n    }\n\n    // If we reached the max number of retries\n    if (counter > maxRetries) {\n      cb(err)\n      return\n    }\n\n    let retryAfterHeader = headers?.['retry-after']\n    if (retryAfterHeader) {\n      retryAfterHeader = Number(retryAfterHeader)\n      retryAfterHeader = Number.isNaN(retryAfterHeader)\n        ? calculateRetryAfterHeader(retryAfterHeader)\n        : retryAfterHeader * 1e3 // Retry-After is in seconds\n    }\n\n    const retryTimeout =\n      retryAfterHeader > 0\n        ? Math.min(retryAfterHeader, maxTimeout)\n        : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)\n\n    setTimeout(() => cb(null), retryTimeout)\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const headers = parseHeaders(rawHeaders)\n\n    this.retryCount += 1\n\n    if (statusCode >= 300) {\n      if (this.retryOpts.statusCodes.includes(statusCode) === false) {\n        return this.handler.onHeaders(\n          statusCode,\n          rawHeaders,\n          resume,\n          statusMessage\n        )\n      } else {\n        this.abort(\n          new RequestRetryError('Request failed', statusCode, {\n            headers,\n            data: {\n              count: this.retryCount\n            }\n          })\n        )\n        return false\n      }\n    }\n\n    // Checkpoint for resume from where we left it\n    if (this.resume != null) {\n      this.resume = null\n\n      // Only Partial Content 206 supposed to provide Content-Range,\n      // any other status code that partially consumed the payload\n      // should not be retry because it would result in downstream\n      // wrongly concatanete multiple responses.\n      if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {\n        this.abort(\n          new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      const contentRange = parseRangeHeader(headers['content-range'])\n      // If no content range\n      if (!contentRange) {\n        this.abort(\n          new RequestRetryError('Content-Range mismatch', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      // Let's start with a weak etag check\n      if (this.etag != null && this.etag !== headers.etag) {\n        this.abort(\n          new RequestRetryError('ETag mismatch', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      const { start, size, end = size - 1 } = contentRange\n\n      assert(this.start === start, 'content-range mismatch')\n      assert(this.end == null || this.end === end, 'content-range mismatch')\n\n      this.resume = resume\n      return true\n    }\n\n    if (this.end == null) {\n      if (statusCode === 206) {\n        // First time we receive 206\n        const range = parseRangeHeader(headers['content-range'])\n\n        if (range == null) {\n          return this.handler.onHeaders(\n            statusCode,\n            rawHeaders,\n            resume,\n            statusMessage\n          )\n        }\n\n        const { start, size, end = size - 1 } = range\n        assert(\n          start != null && Number.isFinite(start),\n          'content-range mismatch'\n        )\n        assert(end != null && Number.isFinite(end), 'invalid content-length')\n\n        this.start = start\n        this.end = end\n      }\n\n      // We make our best to checkpoint the body for further range headers\n      if (this.end == null) {\n        const contentLength = headers['content-length']\n        this.end = contentLength != null ? Number(contentLength) - 1 : null\n      }\n\n      assert(Number.isFinite(this.start))\n      assert(\n        this.end == null || Number.isFinite(this.end),\n        'invalid content-length'\n      )\n\n      this.resume = resume\n      this.etag = headers.etag != null ? headers.etag : null\n\n      // Weak etags are not useful for comparison nor cache\n      // for instance not safe to assume if the response is byte-per-byte\n      // equal\n      if (this.etag != null && this.etag.startsWith('W/')) {\n        this.etag = null\n      }\n\n      return this.handler.onHeaders(\n        statusCode,\n        rawHeaders,\n        resume,\n        statusMessage\n      )\n    }\n\n    const err = new RequestRetryError('Request failed', statusCode, {\n      headers,\n      data: { count: this.retryCount }\n    })\n\n    this.abort(err)\n\n    return false\n  }\n\n  onData (chunk) {\n    this.start += chunk.length\n\n    return this.handler.onData(chunk)\n  }\n\n  onComplete (rawTrailers) {\n    this.retryCount = 0\n    return this.handler.onComplete(rawTrailers)\n  }\n\n  onError (err) {\n    if (this.aborted || isDisturbed(this.opts.body)) {\n      return this.handler.onError(err)\n    }\n\n    // We reconcile in case of a mix between network errors\n    // and server error response\n    if (this.retryCount - this.retryCountCheckpoint > 0) {\n      // We count the difference between the last checkpoint and the current retry count\n      this.retryCount =\n        this.retryCountCheckpoint +\n        (this.retryCount - this.retryCountCheckpoint)\n    } else {\n      this.retryCount += 1\n    }\n\n    this.retryOpts.retry(\n      err,\n      {\n        state: { counter: this.retryCount },\n        opts: { retryOptions: this.retryOpts, ...this.opts }\n      },\n      onRetry.bind(this)\n    )\n\n    function onRetry (err) {\n      if (err != null || this.aborted || isDisturbed(this.opts.body)) {\n        return this.handler.onError(err)\n      }\n\n      if (this.start !== 0) {\n        const headers = { range: `bytes=${this.start}-${this.end ?? ''}` }\n\n        // Weak etag check - weak etags will make comparison algorithms never match\n        if (this.etag != null) {\n          headers['if-match'] = this.etag\n        }\n\n        this.opts = {\n          ...this.opts,\n          headers: {\n            ...this.opts.headers,\n            ...headers\n          }\n        }\n      }\n\n      try {\n        this.retryCountCheckpoint = this.retryCount\n        this.dispatch(this.opts, this)\n      } catch (err) {\n        this.handler.onError(err)\n      }\n    }\n  }\n}\n\nmodule.exports = RetryHandler\n","'use strict'\nconst { isIP } = require('node:net')\nconst { lookup } = require('node:dns')\nconst DecoratorHandler = require('../handler/decorator-handler')\nconst { InvalidArgumentError, InformationalError } = require('../core/errors')\nconst maxInt = Math.pow(2, 31) - 1\n\nclass DNSInstance {\n  #maxTTL = 0\n  #maxItems = 0\n  #records = new Map()\n  dualStack = true\n  affinity = null\n  lookup = null\n  pick = null\n\n  constructor (opts) {\n    this.#maxTTL = opts.maxTTL\n    this.#maxItems = opts.maxItems\n    this.dualStack = opts.dualStack\n    this.affinity = opts.affinity\n    this.lookup = opts.lookup ?? this.#defaultLookup\n    this.pick = opts.pick ?? this.#defaultPick\n  }\n\n  get full () {\n    return this.#records.size === this.#maxItems\n  }\n\n  runLookup (origin, opts, cb) {\n    const ips = this.#records.get(origin.hostname)\n\n    // If full, we just return the origin\n    if (ips == null && this.full) {\n      cb(null, origin.origin)\n      return\n    }\n\n    const newOpts = {\n      affinity: this.affinity,\n      dualStack: this.dualStack,\n      lookup: this.lookup,\n      pick: this.pick,\n      ...opts.dns,\n      maxTTL: this.#maxTTL,\n      maxItems: this.#maxItems\n    }\n\n    // If no IPs we lookup\n    if (ips == null) {\n      this.lookup(origin, newOpts, (err, addresses) => {\n        if (err || addresses == null || addresses.length === 0) {\n          cb(err ?? new InformationalError('No DNS entries found'))\n          return\n        }\n\n        this.setRecords(origin, addresses)\n        const records = this.#records.get(origin.hostname)\n\n        const ip = this.pick(\n          origin,\n          records,\n          newOpts.affinity\n        )\n\n        let port\n        if (typeof ip.port === 'number') {\n          port = `:${ip.port}`\n        } else if (origin.port !== '') {\n          port = `:${origin.port}`\n        } else {\n          port = ''\n        }\n\n        cb(\n          null,\n          `${origin.protocol}//${\n            ip.family === 6 ? `[${ip.address}]` : ip.address\n          }${port}`\n        )\n      })\n    } else {\n      // If there's IPs we pick\n      const ip = this.pick(\n        origin,\n        ips,\n        newOpts.affinity\n      )\n\n      // If no IPs we lookup - deleting old records\n      if (ip == null) {\n        this.#records.delete(origin.hostname)\n        this.runLookup(origin, opts, cb)\n        return\n      }\n\n      let port\n      if (typeof ip.port === 'number') {\n        port = `:${ip.port}`\n      } else if (origin.port !== '') {\n        port = `:${origin.port}`\n      } else {\n        port = ''\n      }\n\n      cb(\n        null,\n        `${origin.protocol}//${\n          ip.family === 6 ? `[${ip.address}]` : ip.address\n        }${port}`\n      )\n    }\n  }\n\n  #defaultLookup (origin, opts, cb) {\n    lookup(\n      origin.hostname,\n      {\n        all: true,\n        family: this.dualStack === false ? this.affinity : 0,\n        order: 'ipv4first'\n      },\n      (err, addresses) => {\n        if (err) {\n          return cb(err)\n        }\n\n        const results = new Map()\n\n        for (const addr of addresses) {\n          // On linux we found duplicates, we attempt to remove them with\n          // the latest record\n          results.set(`${addr.address}:${addr.family}`, addr)\n        }\n\n        cb(null, results.values())\n      }\n    )\n  }\n\n  #defaultPick (origin, hostnameRecords, affinity) {\n    let ip = null\n    const { records, offset } = hostnameRecords\n\n    let family\n    if (this.dualStack) {\n      if (affinity == null) {\n        // Balance between ip families\n        if (offset == null || offset === maxInt) {\n          hostnameRecords.offset = 0\n          affinity = 4\n        } else {\n          hostnameRecords.offset++\n          affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4\n        }\n      }\n\n      if (records[affinity] != null && records[affinity].ips.length > 0) {\n        family = records[affinity]\n      } else {\n        family = records[affinity === 4 ? 6 : 4]\n      }\n    } else {\n      family = records[affinity]\n    }\n\n    // If no IPs we return null\n    if (family == null || family.ips.length === 0) {\n      return ip\n    }\n\n    if (family.offset == null || family.offset === maxInt) {\n      family.offset = 0\n    } else {\n      family.offset++\n    }\n\n    const position = family.offset % family.ips.length\n    ip = family.ips[position] ?? null\n\n    if (ip == null) {\n      return ip\n    }\n\n    if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms\n      // We delete expired records\n      // It is possible that they have different TTL, so we manage them individually\n      family.ips.splice(position, 1)\n      return this.pick(origin, hostnameRecords, affinity)\n    }\n\n    return ip\n  }\n\n  setRecords (origin, addresses) {\n    const timestamp = Date.now()\n    const records = { records: { 4: null, 6: null } }\n    for (const record of addresses) {\n      record.timestamp = timestamp\n      if (typeof record.ttl === 'number') {\n        // The record TTL is expected to be in ms\n        record.ttl = Math.min(record.ttl, this.#maxTTL)\n      } else {\n        record.ttl = this.#maxTTL\n      }\n\n      const familyRecords = records.records[record.family] ?? { ips: [] }\n\n      familyRecords.ips.push(record)\n      records.records[record.family] = familyRecords\n    }\n\n    this.#records.set(origin.hostname, records)\n  }\n\n  getHandler (meta, opts) {\n    return new DNSDispatchHandler(this, meta, opts)\n  }\n}\n\nclass DNSDispatchHandler extends DecoratorHandler {\n  #state = null\n  #opts = null\n  #dispatch = null\n  #handler = null\n  #origin = null\n\n  constructor (state, { origin, handler, dispatch }, opts) {\n    super(handler)\n    this.#origin = origin\n    this.#handler = handler\n    this.#opts = { ...opts }\n    this.#state = state\n    this.#dispatch = dispatch\n  }\n\n  onError (err) {\n    switch (err.code) {\n      case 'ETIMEDOUT':\n      case 'ECONNREFUSED': {\n        if (this.#state.dualStack) {\n          // We delete the record and retry\n          this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => {\n            if (err) {\n              return this.#handler.onError(err)\n            }\n\n            const dispatchOpts = {\n              ...this.#opts,\n              origin: newOrigin\n            }\n\n            this.#dispatch(dispatchOpts, this)\n          })\n\n          // if dual-stack disabled, we error out\n          return\n        }\n\n        this.#handler.onError(err)\n        return\n      }\n      case 'ENOTFOUND':\n        this.#state.deleteRecord(this.#origin)\n      // eslint-disable-next-line no-fallthrough\n      default:\n        this.#handler.onError(err)\n        break\n    }\n  }\n}\n\nmodule.exports = interceptorOpts => {\n  if (\n    interceptorOpts?.maxTTL != null &&\n    (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0)\n  ) {\n    throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number')\n  }\n\n  if (\n    interceptorOpts?.maxItems != null &&\n    (typeof interceptorOpts?.maxItems !== 'number' ||\n      interceptorOpts?.maxItems < 1)\n  ) {\n    throw new InvalidArgumentError(\n      'Invalid maxItems. Must be a positive number and greater than zero'\n    )\n  }\n\n  if (\n    interceptorOpts?.affinity != null &&\n    interceptorOpts?.affinity !== 4 &&\n    interceptorOpts?.affinity !== 6\n  ) {\n    throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6')\n  }\n\n  if (\n    interceptorOpts?.dualStack != null &&\n    typeof interceptorOpts?.dualStack !== 'boolean'\n  ) {\n    throw new InvalidArgumentError('Invalid dualStack. Must be a boolean')\n  }\n\n  if (\n    interceptorOpts?.lookup != null &&\n    typeof interceptorOpts?.lookup !== 'function'\n  ) {\n    throw new InvalidArgumentError('Invalid lookup. Must be a function')\n  }\n\n  if (\n    interceptorOpts?.pick != null &&\n    typeof interceptorOpts?.pick !== 'function'\n  ) {\n    throw new InvalidArgumentError('Invalid pick. Must be a function')\n  }\n\n  const dualStack = interceptorOpts?.dualStack ?? true\n  let affinity\n  if (dualStack) {\n    affinity = interceptorOpts?.affinity ?? null\n  } else {\n    affinity = interceptorOpts?.affinity ?? 4\n  }\n\n  const opts = {\n    maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms\n    lookup: interceptorOpts?.lookup ?? null,\n    pick: interceptorOpts?.pick ?? null,\n    dualStack,\n    affinity,\n    maxItems: interceptorOpts?.maxItems ?? Infinity\n  }\n\n  const instance = new DNSInstance(opts)\n\n  return dispatch => {\n    return function dnsInterceptor (origDispatchOpts, handler) {\n      const origin =\n        origDispatchOpts.origin.constructor === URL\n          ? origDispatchOpts.origin\n          : new URL(origDispatchOpts.origin)\n\n      if (isIP(origin.hostname) !== 0) {\n        return dispatch(origDispatchOpts, handler)\n      }\n\n      instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {\n        if (err) {\n          return handler.onError(err)\n        }\n\n        let dispatchOpts = null\n        dispatchOpts = {\n          ...origDispatchOpts,\n          servername: origin.hostname, // For SNI on TLS\n          origin: newOrigin,\n          headers: {\n            host: origin.hostname,\n            ...origDispatchOpts.headers\n          }\n        }\n\n        dispatch(\n          dispatchOpts,\n          instance.getHandler({ origin, dispatch, handler }, origDispatchOpts)\n        )\n      })\n\n      return true\n    }\n  }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst DecoratorHandler = require('../handler/decorator-handler')\n\nclass DumpHandler extends DecoratorHandler {\n  #maxSize = 1024 * 1024\n  #abort = null\n  #dumped = false\n  #aborted = false\n  #size = 0\n  #reason = null\n  #handler = null\n\n  constructor ({ maxSize }, handler) {\n    super(handler)\n\n    if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {\n      throw new InvalidArgumentError('maxSize must be a number greater than 0')\n    }\n\n    this.#maxSize = maxSize ?? this.#maxSize\n    this.#handler = handler\n  }\n\n  onConnect (abort) {\n    this.#abort = abort\n\n    this.#handler.onConnect(this.#customAbort.bind(this))\n  }\n\n  #customAbort (reason) {\n    this.#aborted = true\n    this.#reason = reason\n  }\n\n  // TODO: will require adjustment after new hooks are out\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const headers = util.parseHeaders(rawHeaders)\n    const contentLength = headers['content-length']\n\n    if (contentLength != null && contentLength > this.#maxSize) {\n      throw new RequestAbortedError(\n        `Response size (${contentLength}) larger than maxSize (${\n          this.#maxSize\n        })`\n      )\n    }\n\n    if (this.#aborted) {\n      return true\n    }\n\n    return this.#handler.onHeaders(\n      statusCode,\n      rawHeaders,\n      resume,\n      statusMessage\n    )\n  }\n\n  onError (err) {\n    if (this.#dumped) {\n      return\n    }\n\n    err = this.#reason ?? err\n\n    this.#handler.onError(err)\n  }\n\n  onData (chunk) {\n    this.#size = this.#size + chunk.length\n\n    if (this.#size >= this.#maxSize) {\n      this.#dumped = true\n\n      if (this.#aborted) {\n        this.#handler.onError(this.#reason)\n      } else {\n        this.#handler.onComplete([])\n      }\n    }\n\n    return true\n  }\n\n  onComplete (trailers) {\n    if (this.#dumped) {\n      return\n    }\n\n    if (this.#aborted) {\n      this.#handler.onError(this.reason)\n      return\n    }\n\n    this.#handler.onComplete(trailers)\n  }\n}\n\nfunction createDumpInterceptor (\n  { maxSize: defaultMaxSize } = {\n    maxSize: 1024 * 1024\n  }\n) {\n  return dispatch => {\n    return function Intercept (opts, handler) {\n      const { dumpMaxSize = defaultMaxSize } =\n        opts\n\n      const dumpHandler = new DumpHandler(\n        { maxSize: dumpMaxSize },\n        handler\n      )\n\n      return dispatch(opts, dumpHandler)\n    }\n  }\n}\n\nmodule.exports = createDumpInterceptor\n","'use strict'\n\nconst RedirectHandler = require('../handler/redirect-handler')\n\nfunction createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {\n  return (dispatch) => {\n    return function Intercept (opts, handler) {\n      const { maxRedirections = defaultMaxRedirections } = opts\n\n      if (!maxRedirections) {\n        return dispatch(opts, handler)\n      }\n\n      const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)\n      opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.\n      return dispatch(opts, redirectHandler)\n    }\n  }\n}\n\nmodule.exports = createRedirectInterceptor\n","'use strict'\nconst RedirectHandler = require('../handler/redirect-handler')\n\nmodule.exports = opts => {\n  const globalMaxRedirections = opts?.maxRedirections\n  return dispatch => {\n    return function redirectInterceptor (opts, handler) {\n      const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts\n\n      if (!maxRedirections) {\n        return dispatch(opts, handler)\n      }\n\n      const redirectHandler = new RedirectHandler(\n        dispatch,\n        maxRedirections,\n        opts,\n        handler\n      )\n\n      return dispatch(baseOpts, redirectHandler)\n    }\n  }\n}\n","'use strict'\nconst RetryHandler = require('../handler/retry-handler')\n\nmodule.exports = globalOpts => {\n  return dispatch => {\n    return function retryInterceptor (opts, handler) {\n      return dispatch(\n        opts,\n        new RetryHandler(\n          { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },\n          {\n            handler,\n            dispatch\n          }\n        )\n      )\n    }\n  }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;\nconst utils_1 = require(\"./utils\");\n// C headers\nvar ERROR;\n(function (ERROR) {\n    ERROR[ERROR[\"OK\"] = 0] = \"OK\";\n    ERROR[ERROR[\"INTERNAL\"] = 1] = \"INTERNAL\";\n    ERROR[ERROR[\"STRICT\"] = 2] = \"STRICT\";\n    ERROR[ERROR[\"LF_EXPECTED\"] = 3] = \"LF_EXPECTED\";\n    ERROR[ERROR[\"UNEXPECTED_CONTENT_LENGTH\"] = 4] = \"UNEXPECTED_CONTENT_LENGTH\";\n    ERROR[ERROR[\"CLOSED_CONNECTION\"] = 5] = \"CLOSED_CONNECTION\";\n    ERROR[ERROR[\"INVALID_METHOD\"] = 6] = \"INVALID_METHOD\";\n    ERROR[ERROR[\"INVALID_URL\"] = 7] = \"INVALID_URL\";\n    ERROR[ERROR[\"INVALID_CONSTANT\"] = 8] = \"INVALID_CONSTANT\";\n    ERROR[ERROR[\"INVALID_VERSION\"] = 9] = \"INVALID_VERSION\";\n    ERROR[ERROR[\"INVALID_HEADER_TOKEN\"] = 10] = \"INVALID_HEADER_TOKEN\";\n    ERROR[ERROR[\"INVALID_CONTENT_LENGTH\"] = 11] = \"INVALID_CONTENT_LENGTH\";\n    ERROR[ERROR[\"INVALID_CHUNK_SIZE\"] = 12] = \"INVALID_CHUNK_SIZE\";\n    ERROR[ERROR[\"INVALID_STATUS\"] = 13] = \"INVALID_STATUS\";\n    ERROR[ERROR[\"INVALID_EOF_STATE\"] = 14] = \"INVALID_EOF_STATE\";\n    ERROR[ERROR[\"INVALID_TRANSFER_ENCODING\"] = 15] = \"INVALID_TRANSFER_ENCODING\";\n    ERROR[ERROR[\"CB_MESSAGE_BEGIN\"] = 16] = \"CB_MESSAGE_BEGIN\";\n    ERROR[ERROR[\"CB_HEADERS_COMPLETE\"] = 17] = \"CB_HEADERS_COMPLETE\";\n    ERROR[ERROR[\"CB_MESSAGE_COMPLETE\"] = 18] = \"CB_MESSAGE_COMPLETE\";\n    ERROR[ERROR[\"CB_CHUNK_HEADER\"] = 19] = \"CB_CHUNK_HEADER\";\n    ERROR[ERROR[\"CB_CHUNK_COMPLETE\"] = 20] = \"CB_CHUNK_COMPLETE\";\n    ERROR[ERROR[\"PAUSED\"] = 21] = \"PAUSED\";\n    ERROR[ERROR[\"PAUSED_UPGRADE\"] = 22] = \"PAUSED_UPGRADE\";\n    ERROR[ERROR[\"PAUSED_H2_UPGRADE\"] = 23] = \"PAUSED_H2_UPGRADE\";\n    ERROR[ERROR[\"USER\"] = 24] = \"USER\";\n})(ERROR = exports.ERROR || (exports.ERROR = {}));\nvar TYPE;\n(function (TYPE) {\n    TYPE[TYPE[\"BOTH\"] = 0] = \"BOTH\";\n    TYPE[TYPE[\"REQUEST\"] = 1] = \"REQUEST\";\n    TYPE[TYPE[\"RESPONSE\"] = 2] = \"RESPONSE\";\n})(TYPE = exports.TYPE || (exports.TYPE = {}));\nvar FLAGS;\n(function (FLAGS) {\n    FLAGS[FLAGS[\"CONNECTION_KEEP_ALIVE\"] = 1] = \"CONNECTION_KEEP_ALIVE\";\n    FLAGS[FLAGS[\"CONNECTION_CLOSE\"] = 2] = \"CONNECTION_CLOSE\";\n    FLAGS[FLAGS[\"CONNECTION_UPGRADE\"] = 4] = \"CONNECTION_UPGRADE\";\n    FLAGS[FLAGS[\"CHUNKED\"] = 8] = \"CHUNKED\";\n    FLAGS[FLAGS[\"UPGRADE\"] = 16] = \"UPGRADE\";\n    FLAGS[FLAGS[\"CONTENT_LENGTH\"] = 32] = \"CONTENT_LENGTH\";\n    FLAGS[FLAGS[\"SKIPBODY\"] = 64] = \"SKIPBODY\";\n    FLAGS[FLAGS[\"TRAILING\"] = 128] = \"TRAILING\";\n    // 1 << 8 is unused\n    FLAGS[FLAGS[\"TRANSFER_ENCODING\"] = 512] = \"TRANSFER_ENCODING\";\n})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));\nvar LENIENT_FLAGS;\n(function (LENIENT_FLAGS) {\n    LENIENT_FLAGS[LENIENT_FLAGS[\"HEADERS\"] = 1] = \"HEADERS\";\n    LENIENT_FLAGS[LENIENT_FLAGS[\"CHUNKED_LENGTH\"] = 2] = \"CHUNKED_LENGTH\";\n    LENIENT_FLAGS[LENIENT_FLAGS[\"KEEP_ALIVE\"] = 4] = \"KEEP_ALIVE\";\n})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));\nvar METHODS;\n(function (METHODS) {\n    METHODS[METHODS[\"DELETE\"] = 0] = \"DELETE\";\n    METHODS[METHODS[\"GET\"] = 1] = \"GET\";\n    METHODS[METHODS[\"HEAD\"] = 2] = \"HEAD\";\n    METHODS[METHODS[\"POST\"] = 3] = \"POST\";\n    METHODS[METHODS[\"PUT\"] = 4] = \"PUT\";\n    /* pathological */\n    METHODS[METHODS[\"CONNECT\"] = 5] = \"CONNECT\";\n    METHODS[METHODS[\"OPTIONS\"] = 6] = \"OPTIONS\";\n    METHODS[METHODS[\"TRACE\"] = 7] = \"TRACE\";\n    /* WebDAV */\n    METHODS[METHODS[\"COPY\"] = 8] = \"COPY\";\n    METHODS[METHODS[\"LOCK\"] = 9] = \"LOCK\";\n    METHODS[METHODS[\"MKCOL\"] = 10] = \"MKCOL\";\n    METHODS[METHODS[\"MOVE\"] = 11] = \"MOVE\";\n    METHODS[METHODS[\"PROPFIND\"] = 12] = \"PROPFIND\";\n    METHODS[METHODS[\"PROPPATCH\"] = 13] = \"PROPPATCH\";\n    METHODS[METHODS[\"SEARCH\"] = 14] = \"SEARCH\";\n    METHODS[METHODS[\"UNLOCK\"] = 15] = \"UNLOCK\";\n    METHODS[METHODS[\"BIND\"] = 16] = \"BIND\";\n    METHODS[METHODS[\"REBIND\"] = 17] = \"REBIND\";\n    METHODS[METHODS[\"UNBIND\"] = 18] = \"UNBIND\";\n    METHODS[METHODS[\"ACL\"] = 19] = \"ACL\";\n    /* subversion */\n    METHODS[METHODS[\"REPORT\"] = 20] = \"REPORT\";\n    METHODS[METHODS[\"MKACTIVITY\"] = 21] = \"MKACTIVITY\";\n    METHODS[METHODS[\"CHECKOUT\"] = 22] = \"CHECKOUT\";\n    METHODS[METHODS[\"MERGE\"] = 23] = \"MERGE\";\n    /* upnp */\n    METHODS[METHODS[\"M-SEARCH\"] = 24] = \"M-SEARCH\";\n    METHODS[METHODS[\"NOTIFY\"] = 25] = \"NOTIFY\";\n    METHODS[METHODS[\"SUBSCRIBE\"] = 26] = \"SUBSCRIBE\";\n    METHODS[METHODS[\"UNSUBSCRIBE\"] = 27] = \"UNSUBSCRIBE\";\n    /* RFC-5789 */\n    METHODS[METHODS[\"PATCH\"] = 28] = \"PATCH\";\n    METHODS[METHODS[\"PURGE\"] = 29] = \"PURGE\";\n    /* CalDAV */\n    METHODS[METHODS[\"MKCALENDAR\"] = 30] = \"MKCALENDAR\";\n    /* RFC-2068, section 19.6.1.2 */\n    METHODS[METHODS[\"LINK\"] = 31] = \"LINK\";\n    METHODS[METHODS[\"UNLINK\"] = 32] = \"UNLINK\";\n    /* icecast */\n    METHODS[METHODS[\"SOURCE\"] = 33] = \"SOURCE\";\n    /* RFC-7540, section 11.6 */\n    METHODS[METHODS[\"PRI\"] = 34] = \"PRI\";\n    /* RFC-2326 RTSP */\n    METHODS[METHODS[\"DESCRIBE\"] = 35] = \"DESCRIBE\";\n    METHODS[METHODS[\"ANNOUNCE\"] = 36] = \"ANNOUNCE\";\n    METHODS[METHODS[\"SETUP\"] = 37] = \"SETUP\";\n    METHODS[METHODS[\"PLAY\"] = 38] = \"PLAY\";\n    METHODS[METHODS[\"PAUSE\"] = 39] = \"PAUSE\";\n    METHODS[METHODS[\"TEARDOWN\"] = 40] = \"TEARDOWN\";\n    METHODS[METHODS[\"GET_PARAMETER\"] = 41] = \"GET_PARAMETER\";\n    METHODS[METHODS[\"SET_PARAMETER\"] = 42] = \"SET_PARAMETER\";\n    METHODS[METHODS[\"REDIRECT\"] = 43] = \"REDIRECT\";\n    METHODS[METHODS[\"RECORD\"] = 44] = \"RECORD\";\n    /* RAOP */\n    METHODS[METHODS[\"FLUSH\"] = 45] = \"FLUSH\";\n})(METHODS = exports.METHODS || (exports.METHODS = {}));\nexports.METHODS_HTTP = [\n    METHODS.DELETE,\n    METHODS.GET,\n    METHODS.HEAD,\n    METHODS.POST,\n    METHODS.PUT,\n    METHODS.CONNECT,\n    METHODS.OPTIONS,\n    METHODS.TRACE,\n    METHODS.COPY,\n    METHODS.LOCK,\n    METHODS.MKCOL,\n    METHODS.MOVE,\n    METHODS.PROPFIND,\n    METHODS.PROPPATCH,\n    METHODS.SEARCH,\n    METHODS.UNLOCK,\n    METHODS.BIND,\n    METHODS.REBIND,\n    METHODS.UNBIND,\n    METHODS.ACL,\n    METHODS.REPORT,\n    METHODS.MKACTIVITY,\n    METHODS.CHECKOUT,\n    METHODS.MERGE,\n    METHODS['M-SEARCH'],\n    METHODS.NOTIFY,\n    METHODS.SUBSCRIBE,\n    METHODS.UNSUBSCRIBE,\n    METHODS.PATCH,\n    METHODS.PURGE,\n    METHODS.MKCALENDAR,\n    METHODS.LINK,\n    METHODS.UNLINK,\n    METHODS.PRI,\n    // TODO(indutny): should we allow it with HTTP?\n    METHODS.SOURCE,\n];\nexports.METHODS_ICE = [\n    METHODS.SOURCE,\n];\nexports.METHODS_RTSP = [\n    METHODS.OPTIONS,\n    METHODS.DESCRIBE,\n    METHODS.ANNOUNCE,\n    METHODS.SETUP,\n    METHODS.PLAY,\n    METHODS.PAUSE,\n    METHODS.TEARDOWN,\n    METHODS.GET_PARAMETER,\n    METHODS.SET_PARAMETER,\n    METHODS.REDIRECT,\n    METHODS.RECORD,\n    METHODS.FLUSH,\n    // For AirPlay\n    METHODS.GET,\n    METHODS.POST,\n];\nexports.METHOD_MAP = utils_1.enumToMap(METHODS);\nexports.H_METHOD_MAP = {};\nObject.keys(exports.METHOD_MAP).forEach((key) => {\n    if (/^H/.test(key)) {\n        exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];\n    }\n});\nvar FINISH;\n(function (FINISH) {\n    FINISH[FINISH[\"SAFE\"] = 0] = \"SAFE\";\n    FINISH[FINISH[\"SAFE_WITH_CB\"] = 1] = \"SAFE_WITH_CB\";\n    FINISH[FINISH[\"UNSAFE\"] = 2] = \"UNSAFE\";\n})(FINISH = exports.FINISH || (exports.FINISH = {}));\nexports.ALPHA = [];\nfor (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {\n    // Upper case\n    exports.ALPHA.push(String.fromCharCode(i));\n    // Lower case\n    exports.ALPHA.push(String.fromCharCode(i + 0x20));\n}\nexports.NUM_MAP = {\n    0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n    5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n};\nexports.HEX_MAP = {\n    0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n    5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n    A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,\n    a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,\n};\nexports.NUM = [\n    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n];\nexports.ALPHANUM = exports.ALPHA.concat(exports.NUM);\nexports.MARK = ['-', '_', '.', '!', '~', '*', '\\'', '(', ')'];\nexports.USERINFO_CHARS = exports.ALPHANUM\n    .concat(exports.MARK)\n    .concat(['%', ';', ':', '&', '=', '+', '$', ',']);\n// TODO(indutny): use RFC\nexports.STRICT_URL_CHAR = [\n    '!', '\"', '$', '%', '&', '\\'',\n    '(', ')', '*', '+', ',', '-', '.', '/',\n    ':', ';', '<', '=', '>',\n    '@', '[', '\\\\', ']', '^', '_',\n    '`',\n    '{', '|', '}', '~',\n].concat(exports.ALPHANUM);\nexports.URL_CHAR = exports.STRICT_URL_CHAR\n    .concat(['\\t', '\\f']);\n// All characters with 0x80 bit set to 1\nfor (let i = 0x80; i <= 0xff; i++) {\n    exports.URL_CHAR.push(i);\n}\nexports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);\n/* Tokens as defined by rfc 2616. Also lowercases them.\n *        token       = 1*\n *     separators     = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n *                    | \",\" | \";\" | \":\" | \"\\\" | <\">\n *                    | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n *                    | \"{\" | \"}\" | SP | HT\n */\nexports.STRICT_TOKEN = [\n    '!', '#', '$', '%', '&', '\\'',\n    '*', '+', '-', '.',\n    '^', '_', '`',\n    '|', '~',\n].concat(exports.ALPHANUM);\nexports.TOKEN = exports.STRICT_TOKEN.concat([' ']);\n/*\n * Verify that a char is a valid visible (printable) US-ASCII\n * character or %x80-FF\n */\nexports.HEADER_CHARS = ['\\t'];\nfor (let i = 32; i <= 255; i++) {\n    if (i !== 127) {\n        exports.HEADER_CHARS.push(i);\n    }\n}\n// ',' = \\x44\nexports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);\nexports.MAJOR = exports.NUM_MAP;\nexports.MINOR = exports.MAJOR;\nvar HEADER_STATE;\n(function (HEADER_STATE) {\n    HEADER_STATE[HEADER_STATE[\"GENERAL\"] = 0] = \"GENERAL\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION\"] = 1] = \"CONNECTION\";\n    HEADER_STATE[HEADER_STATE[\"CONTENT_LENGTH\"] = 2] = \"CONTENT_LENGTH\";\n    HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING\"] = 3] = \"TRANSFER_ENCODING\";\n    HEADER_STATE[HEADER_STATE[\"UPGRADE\"] = 4] = \"UPGRADE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_KEEP_ALIVE\"] = 5] = \"CONNECTION_KEEP_ALIVE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_CLOSE\"] = 6] = \"CONNECTION_CLOSE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_UPGRADE\"] = 7] = \"CONNECTION_UPGRADE\";\n    HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING_CHUNKED\"] = 8] = \"TRANSFER_ENCODING_CHUNKED\";\n})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));\nexports.SPECIAL_HEADERS = {\n    'connection': HEADER_STATE.CONNECTION,\n    'content-length': HEADER_STATE.CONTENT_LENGTH,\n    'proxy-connection': HEADER_STATE.CONNECTION,\n    'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,\n    'upgrade': HEADER_STATE.UPGRADE,\n};\n//# sourceMappingURL=constants.js.map","'use strict'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QIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAC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ACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2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CFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBC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AIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ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AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAC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AwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64')\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enumToMap = void 0;\nfunction enumToMap(obj) {\n    const res = {};\n    Object.keys(obj).forEach((key) => {\n        const value = obj[key];\n        if (typeof value === 'number') {\n            res[key] = value;\n        }\n    });\n    return res;\n}\nexports.enumToMap = enumToMap;\n//# sourceMappingURL=utils.js.map","'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../dispatcher/agent')\nconst {\n  kAgent,\n  kMockAgentSet,\n  kMockAgentGet,\n  kDispatches,\n  kIsMockActive,\n  kNetConnect,\n  kGetNetConnect,\n  kOptions,\n  kFactory\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, buildMockOptions } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher/dispatcher')\nconst Pluralizer = require('./pluralizer')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\n\nclass MockAgent extends Dispatcher {\n  constructor (opts) {\n    super(opts)\n\n    this[kNetConnect] = true\n    this[kIsMockActive] = true\n\n    // Instantiate Agent and encapsulate\n    if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n    const agent = opts?.agent ? opts.agent : new Agent(opts)\n    this[kAgent] = agent\n\n    this[kClients] = agent[kClients]\n    this[kOptions] = buildMockOptions(opts)\n  }\n\n  get (origin) {\n    let dispatcher = this[kMockAgentGet](origin)\n\n    if (!dispatcher) {\n      dispatcher = this[kFactory](origin)\n      this[kMockAgentSet](origin, dispatcher)\n    }\n    return dispatcher\n  }\n\n  dispatch (opts, handler) {\n    // Call MockAgent.get to perform additional setup before dispatching as normal\n    this.get(opts.origin)\n    return this[kAgent].dispatch(opts, handler)\n  }\n\n  async close () {\n    await this[kAgent].close()\n    this[kClients].clear()\n  }\n\n  deactivate () {\n    this[kIsMockActive] = false\n  }\n\n  activate () {\n    this[kIsMockActive] = true\n  }\n\n  enableNetConnect (matcher) {\n    if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n      if (Array.isArray(this[kNetConnect])) {\n        this[kNetConnect].push(matcher)\n      } else {\n        this[kNetConnect] = [matcher]\n      }\n    } else if (typeof matcher === 'undefined') {\n      this[kNetConnect] = true\n    } else {\n      throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n    }\n  }\n\n  disableNetConnect () {\n    this[kNetConnect] = false\n  }\n\n  // This is required to bypass issues caused by using global symbols - see:\n  // https://github.com/nodejs/undici/issues/1447\n  get isMockActive () {\n    return this[kIsMockActive]\n  }\n\n  [kMockAgentSet] (origin, dispatcher) {\n    this[kClients].set(origin, dispatcher)\n  }\n\n  [kFactory] (origin) {\n    const mockOptions = Object.assign({ agent: this }, this[kOptions])\n    return this[kOptions] && this[kOptions].connections === 1\n      ? new MockClient(origin, mockOptions)\n      : new MockPool(origin, mockOptions)\n  }\n\n  [kMockAgentGet] (origin) {\n    // First check if we can immediately find it\n    const client = this[kClients].get(origin)\n    if (client) {\n      return client\n    }\n\n    // If the origin is not a string create a dummy parent pool and return to user\n    if (typeof origin !== 'string') {\n      const dispatcher = this[kFactory]('http://localhost:9999')\n      this[kMockAgentSet](origin, dispatcher)\n      return dispatcher\n    }\n\n    // If we match, create a pool and assign the same dispatches\n    for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) {\n      if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n        const dispatcher = this[kFactory](origin)\n        this[kMockAgentSet](origin, dispatcher)\n        dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]\n        return dispatcher\n      }\n    }\n  }\n\n  [kGetNetConnect] () {\n    return this[kNetConnect]\n  }\n\n  pendingInterceptors () {\n    const mockAgentClients = this[kClients]\n\n    return Array.from(mockAgentClients.entries())\n      .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n      .filter(({ pending }) => pending)\n  }\n\n  assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n    const pending = this.pendingInterceptors()\n\n    if (pending.length === 0) {\n      return\n    }\n\n    const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)\n\n    throw new UndiciError(`\n${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:\n\n${pendingInterceptorsFormatter.format(pending)}\n`.trim())\n  }\n}\n\nmodule.exports = MockAgent\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Client = require('../dispatcher/client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kMockAgent,\n  kClose,\n  kOriginalClose,\n  kOrigin,\n  kOriginalDispatch,\n  kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n  constructor (origin, opts) {\n    super(origin, opts)\n\n    if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n\n    this[kMockAgent] = opts.agent\n    this[kOrigin] = origin\n    this[kDispatches] = []\n    this[kConnected] = 1\n    this[kOriginalDispatch] = this.dispatch\n    this[kOriginalClose] = this.close.bind(this)\n\n    this.dispatch = buildMockDispatch.call(this)\n    this.close = this[kClose]\n  }\n\n  get [Symbols.kConnected] () {\n    return this[kConnected]\n  }\n\n  /**\n   * Sets up the base interceptor for mocking replies from undici.\n   */\n  intercept (opts) {\n    return new MockInterceptor(opts, this[kDispatches])\n  }\n\n  async [kClose] () {\n    await promisify(this[kOriginalClose])()\n    this[kConnected] = 0\n    this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n  }\n}\n\nmodule.exports = MockClient\n","'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nconst kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')\n\n/**\n * The request does not match any registered mock dispatches.\n */\nclass MockNotMatchedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    Error.captureStackTrace(this, MockNotMatchedError)\n    this.name = 'MockNotMatchedError'\n    this.message = message || 'The request does not match any registered mock dispatches'\n    this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kMockNotMatchedError] === true\n  }\n\n  [kMockNotMatchedError] = true\n}\n\nmodule.exports = {\n  MockNotMatchedError\n}\n","'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kDispatchKey,\n  kDefaultHeaders,\n  kDefaultTrailers,\n  kContentLength,\n  kMockDispatch\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { buildURL } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n  constructor (mockDispatch) {\n    this[kMockDispatch] = mockDispatch\n  }\n\n  /**\n   * Delay a reply by a set amount in ms.\n   */\n  delay (waitInMs) {\n    if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n      throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n    }\n\n    this[kMockDispatch].delay = waitInMs\n    return this\n  }\n\n  /**\n   * For a defined reply, never mark as consumed.\n   */\n  persist () {\n    this[kMockDispatch].persist = true\n    return this\n  }\n\n  /**\n   * Allow one to define a reply for a set amount of matching requests.\n   */\n  times (repeatTimes) {\n    if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n      throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n    }\n\n    this[kMockDispatch].times = repeatTimes\n    return this\n  }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n  constructor (opts, mockDispatches) {\n    if (typeof opts !== 'object') {\n      throw new InvalidArgumentError('opts must be an object')\n    }\n    if (typeof opts.path === 'undefined') {\n      throw new InvalidArgumentError('opts.path must be defined')\n    }\n    if (typeof opts.method === 'undefined') {\n      opts.method = 'GET'\n    }\n    // See https://github.com/nodejs/undici/issues/1245\n    // As per RFC 3986, clients are not supposed to send URI\n    // fragments to servers when they retrieve a document,\n    if (typeof opts.path === 'string') {\n      if (opts.query) {\n        opts.path = buildURL(opts.path, opts.query)\n      } else {\n        // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811\n        const parsedURL = new URL(opts.path, 'data://')\n        opts.path = parsedURL.pathname + parsedURL.search\n      }\n    }\n    if (typeof opts.method === 'string') {\n      opts.method = opts.method.toUpperCase()\n    }\n\n    this[kDispatchKey] = buildKey(opts)\n    this[kDispatches] = mockDispatches\n    this[kDefaultHeaders] = {}\n    this[kDefaultTrailers] = {}\n    this[kContentLength] = false\n  }\n\n  createMockScopeDispatchData ({ statusCode, data, responseOptions }) {\n    const responseData = getResponseData(data)\n    const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n    const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n    const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n    return { statusCode, data, headers, trailers }\n  }\n\n  validateReplyParameters (replyParameters) {\n    if (typeof replyParameters.statusCode === 'undefined') {\n      throw new InvalidArgumentError('statusCode must be defined')\n    }\n    if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) {\n      throw new InvalidArgumentError('responseOptions must be an object')\n    }\n  }\n\n  /**\n   * Mock an undici request with a defined reply.\n   */\n  reply (replyOptionsCallbackOrStatusCode) {\n    // Values of reply aren't available right now as they\n    // can only be available when the reply callback is invoked.\n    if (typeof replyOptionsCallbackOrStatusCode === 'function') {\n      // We'll first wrap the provided callback in another function,\n      // this function will properly resolve the data from the callback\n      // when invoked.\n      const wrappedDefaultsCallback = (opts) => {\n        // Our reply options callback contains the parameter for statusCode, data and options.\n        const resolvedData = replyOptionsCallbackOrStatusCode(opts)\n\n        // Check if it is in the right format\n        if (typeof resolvedData !== 'object' || resolvedData === null) {\n          throw new InvalidArgumentError('reply options callback must return an object')\n        }\n\n        const replyParameters = { data: '', responseOptions: {}, ...resolvedData }\n        this.validateReplyParameters(replyParameters)\n        // Since the values can be obtained immediately we return them\n        // from this higher order function that will be resolved later.\n        return {\n          ...this.createMockScopeDispatchData(replyParameters)\n        }\n      }\n\n      // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n      const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)\n      return new MockScope(newMockDispatch)\n    }\n\n    // We can have either one or three parameters, if we get here,\n    // we should have 1-3 parameters. So we spread the arguments of\n    // this function to obtain the parameters, since replyData will always\n    // just be the statusCode.\n    const replyParameters = {\n      statusCode: replyOptionsCallbackOrStatusCode,\n      data: arguments[1] === undefined ? '' : arguments[1],\n      responseOptions: arguments[2] === undefined ? {} : arguments[2]\n    }\n    this.validateReplyParameters(replyParameters)\n\n    // Send in-already provided data like usual\n    const dispatchData = this.createMockScopeDispatchData(replyParameters)\n    const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)\n    return new MockScope(newMockDispatch)\n  }\n\n  /**\n   * Mock an undici request with a defined error.\n   */\n  replyWithError (error) {\n    if (typeof error === 'undefined') {\n      throw new InvalidArgumentError('error must be defined')\n    }\n\n    const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })\n    return new MockScope(newMockDispatch)\n  }\n\n  /**\n   * Set default reply headers on the interceptor for subsequent replies\n   */\n  defaultReplyHeaders (headers) {\n    if (typeof headers === 'undefined') {\n      throw new InvalidArgumentError('headers must be defined')\n    }\n\n    this[kDefaultHeaders] = headers\n    return this\n  }\n\n  /**\n   * Set default reply trailers on the interceptor for subsequent replies\n   */\n  defaultReplyTrailers (trailers) {\n    if (typeof trailers === 'undefined') {\n      throw new InvalidArgumentError('trailers must be defined')\n    }\n\n    this[kDefaultTrailers] = trailers\n    return this\n  }\n\n  /**\n   * Set reply content length header for replies on the interceptor\n   */\n  replyContentLength () {\n    this[kContentLength] = true\n    return this\n  }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Pool = require('../dispatcher/pool')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kMockAgent,\n  kClose,\n  kOriginalClose,\n  kOrigin,\n  kOriginalDispatch,\n  kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockPool provides an API that extends the Pool to influence the mockDispatches.\n */\nclass MockPool extends Pool {\n  constructor (origin, opts) {\n    super(origin, opts)\n\n    if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n\n    this[kMockAgent] = opts.agent\n    this[kOrigin] = origin\n    this[kDispatches] = []\n    this[kConnected] = 1\n    this[kOriginalDispatch] = this.dispatch\n    this[kOriginalClose] = this.close.bind(this)\n\n    this.dispatch = buildMockDispatch.call(this)\n    this.close = this[kClose]\n  }\n\n  get [Symbols.kConnected] () {\n    return this[kConnected]\n  }\n\n  /**\n   * Sets up the base interceptor for mocking replies from undici.\n   */\n  intercept (opts) {\n    return new MockInterceptor(opts, this[kDispatches])\n  }\n\n  async [kClose] () {\n    await promisify(this[kOriginalClose])()\n    this[kConnected] = 0\n    this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n  }\n}\n\nmodule.exports = MockPool\n","'use strict'\n\nmodule.exports = {\n  kAgent: Symbol('agent'),\n  kOptions: Symbol('options'),\n  kFactory: Symbol('factory'),\n  kDispatches: Symbol('dispatches'),\n  kDispatchKey: Symbol('dispatch key'),\n  kDefaultHeaders: Symbol('default headers'),\n  kDefaultTrailers: Symbol('default trailers'),\n  kContentLength: Symbol('content length'),\n  kMockAgent: Symbol('mock agent'),\n  kMockAgentSet: Symbol('mock agent set'),\n  kMockAgentGet: Symbol('mock agent get'),\n  kMockDispatch: Symbol('mock dispatch'),\n  kClose: Symbol('close'),\n  kOriginalClose: Symbol('original agent close'),\n  kOrigin: Symbol('origin'),\n  kIsMockActive: Symbol('is mock active'),\n  kNetConnect: Symbol('net connect'),\n  kGetNetConnect: Symbol('get net connect'),\n  kConnected: Symbol('connected')\n}\n","'use strict'\n\nconst { MockNotMatchedError } = require('./mock-errors')\nconst {\n  kDispatches,\n  kMockAgent,\n  kOriginalDispatch,\n  kOrigin,\n  kGetNetConnect\n} = require('./mock-symbols')\nconst { buildURL } = require('../core/util')\nconst { STATUS_CODES } = require('node:http')\nconst {\n  types: {\n    isPromise\n  }\n} = require('node:util')\n\nfunction matchValue (match, value) {\n  if (typeof match === 'string') {\n    return match === value\n  }\n  if (match instanceof RegExp) {\n    return match.test(value)\n  }\n  if (typeof match === 'function') {\n    return match(value) === true\n  }\n  return false\n}\n\nfunction lowerCaseEntries (headers) {\n  return Object.fromEntries(\n    Object.entries(headers).map(([headerName, headerValue]) => {\n      return [headerName.toLocaleLowerCase(), headerValue]\n    })\n  )\n}\n\n/**\n * @param {import('../../index').Headers|string[]|Record} headers\n * @param {string} key\n */\nfunction getHeaderByName (headers, key) {\n  if (Array.isArray(headers)) {\n    for (let i = 0; i < headers.length; i += 2) {\n      if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {\n        return headers[i + 1]\n      }\n    }\n\n    return undefined\n  } else if (typeof headers.get === 'function') {\n    return headers.get(key)\n  } else {\n    return lowerCaseEntries(headers)[key.toLocaleLowerCase()]\n  }\n}\n\n/** @param {string[]} headers */\nfunction buildHeadersFromArray (headers) { // fetch HeadersList\n  const clone = headers.slice()\n  const entries = []\n  for (let index = 0; index < clone.length; index += 2) {\n    entries.push([clone[index], clone[index + 1]])\n  }\n  return Object.fromEntries(entries)\n}\n\nfunction matchHeaders (mockDispatch, headers) {\n  if (typeof mockDispatch.headers === 'function') {\n    if (Array.isArray(headers)) { // fetch HeadersList\n      headers = buildHeadersFromArray(headers)\n    }\n    return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})\n  }\n  if (typeof mockDispatch.headers === 'undefined') {\n    return true\n  }\n  if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {\n    return false\n  }\n\n  for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {\n    const headerValue = getHeaderByName(headers, matchHeaderName)\n\n    if (!matchValue(matchHeaderValue, headerValue)) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction safeUrl (path) {\n  if (typeof path !== 'string') {\n    return path\n  }\n\n  const pathSegments = path.split('?')\n\n  if (pathSegments.length !== 2) {\n    return path\n  }\n\n  const qp = new URLSearchParams(pathSegments.pop())\n  qp.sort()\n  return [...pathSegments, qp.toString()].join('?')\n}\n\nfunction matchKey (mockDispatch, { path, method, body, headers }) {\n  const pathMatch = matchValue(mockDispatch.path, path)\n  const methodMatch = matchValue(mockDispatch.method, method)\n  const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true\n  const headersMatch = matchHeaders(mockDispatch, headers)\n  return pathMatch && methodMatch && bodyMatch && headersMatch\n}\n\nfunction getResponseData (data) {\n  if (Buffer.isBuffer(data)) {\n    return data\n  } else if (data instanceof Uint8Array) {\n    return data\n  } else if (data instanceof ArrayBuffer) {\n    return data\n  } else if (typeof data === 'object') {\n    return JSON.stringify(data)\n  } else {\n    return data.toString()\n  }\n}\n\nfunction getMockDispatch (mockDispatches, key) {\n  const basePath = key.query ? buildURL(key.path, key.query) : key.path\n  const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath\n\n  // Match path\n  let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)\n  }\n\n  // Match method\n  matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)\n  }\n\n  // Match body\n  matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)\n  }\n\n  // Match headers\n  matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))\n  if (matchedMockDispatches.length === 0) {\n    const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers\n    throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)\n  }\n\n  return matchedMockDispatches[0]\n}\n\nfunction addMockDispatch (mockDispatches, key, data) {\n  const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }\n  const replyData = typeof data === 'function' ? { callback: data } : { ...data }\n  const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }\n  mockDispatches.push(newMockDispatch)\n  return newMockDispatch\n}\n\nfunction deleteMockDispatch (mockDispatches, key) {\n  const index = mockDispatches.findIndex(dispatch => {\n    if (!dispatch.consumed) {\n      return false\n    }\n    return matchKey(dispatch, key)\n  })\n  if (index !== -1) {\n    mockDispatches.splice(index, 1)\n  }\n}\n\nfunction buildKey (opts) {\n  const { path, method, body, headers, query } = opts\n  return {\n    path,\n    method,\n    body,\n    headers,\n    query\n  }\n}\n\nfunction generateKeyValues (data) {\n  const keys = Object.keys(data)\n  const result = []\n  for (let i = 0; i < keys.length; ++i) {\n    const key = keys[i]\n    const value = data[key]\n    const name = Buffer.from(`${key}`)\n    if (Array.isArray(value)) {\n      for (let j = 0; j < value.length; ++j) {\n        result.push(name, Buffer.from(`${value[j]}`))\n      }\n    } else {\n      result.push(name, Buffer.from(`${value}`))\n    }\n  }\n  return result\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n * @param {number} statusCode\n */\nfunction getStatusText (statusCode) {\n  return STATUS_CODES[statusCode] || 'unknown'\n}\n\nasync function getResponse (body) {\n  const buffers = []\n  for await (const data of body) {\n    buffers.push(data)\n  }\n  return Buffer.concat(buffers).toString('utf8')\n}\n\n/**\n * Mock dispatch function used to simulate undici dispatches\n */\nfunction mockDispatch (opts, handler) {\n  // Get mock dispatch from built key\n  const key = buildKey(opts)\n  const mockDispatch = getMockDispatch(this[kDispatches], key)\n\n  mockDispatch.timesInvoked++\n\n  // Here's where we resolve a callback if a callback is present for the dispatch data.\n  if (mockDispatch.data.callback) {\n    mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }\n  }\n\n  // Parse mockDispatch data\n  const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch\n  const { timesInvoked, times } = mockDispatch\n\n  // If it's used up and not persistent, mark as consumed\n  mockDispatch.consumed = !persist && timesInvoked >= times\n  mockDispatch.pending = timesInvoked < times\n\n  // If specified, trigger dispatch error\n  if (error !== null) {\n    deleteMockDispatch(this[kDispatches], key)\n    handler.onError(error)\n    return true\n  }\n\n  // Handle the request with a delay if necessary\n  if (typeof delay === 'number' && delay > 0) {\n    setTimeout(() => {\n      handleReply(this[kDispatches])\n    }, delay)\n  } else {\n    handleReply(this[kDispatches])\n  }\n\n  function handleReply (mockDispatches, _data = data) {\n    // fetch's HeadersList is a 1D string array\n    const optsHeaders = Array.isArray(opts.headers)\n      ? buildHeadersFromArray(opts.headers)\n      : opts.headers\n    const body = typeof _data === 'function'\n      ? _data({ ...opts, headers: optsHeaders })\n      : _data\n\n    // util.types.isPromise is likely needed for jest.\n    if (isPromise(body)) {\n      // If handleReply is asynchronous, throwing an error\n      // in the callback will reject the promise, rather than\n      // synchronously throw the error, which breaks some tests.\n      // Rather, we wait for the callback to resolve if it is a\n      // promise, and then re-run handleReply with the new body.\n      body.then((newData) => handleReply(mockDispatches, newData))\n      return\n    }\n\n    const responseData = getResponseData(body)\n    const responseHeaders = generateKeyValues(headers)\n    const responseTrailers = generateKeyValues(trailers)\n\n    handler.onConnect?.(err => handler.onError(err), null)\n    handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))\n    handler.onData?.(Buffer.from(responseData))\n    handler.onComplete?.(responseTrailers)\n    deleteMockDispatch(mockDispatches, key)\n  }\n\n  function resume () {}\n\n  return true\n}\n\nfunction buildMockDispatch () {\n  const agent = this[kMockAgent]\n  const origin = this[kOrigin]\n  const originalDispatch = this[kOriginalDispatch]\n\n  return function dispatch (opts, handler) {\n    if (agent.isMockActive) {\n      try {\n        mockDispatch.call(this, opts, handler)\n      } catch (error) {\n        if (error instanceof MockNotMatchedError) {\n          const netConnect = agent[kGetNetConnect]()\n          if (netConnect === false) {\n            throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)\n          }\n          if (checkNetConnect(netConnect, origin)) {\n            originalDispatch.call(this, opts, handler)\n          } else {\n            throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)\n          }\n        } else {\n          throw error\n        }\n      }\n    } else {\n      originalDispatch.call(this, opts, handler)\n    }\n  }\n}\n\nfunction checkNetConnect (netConnect, origin) {\n  const url = new URL(origin)\n  if (netConnect === true) {\n    return true\n  } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {\n    return true\n  }\n  return false\n}\n\nfunction buildMockOptions (opts) {\n  if (opts) {\n    const { agent, ...mockOptions } = opts\n    return mockOptions\n  }\n}\n\nmodule.exports = {\n  getResponseData,\n  getMockDispatch,\n  addMockDispatch,\n  deleteMockDispatch,\n  buildKey,\n  generateKeyValues,\n  matchValue,\n  getResponse,\n  getStatusText,\n  mockDispatch,\n  buildMockDispatch,\n  checkNetConnect,\n  buildMockOptions,\n  getHeaderByName,\n  buildHeadersFromArray\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst { Console } = require('node:console')\n\nconst PERSISTENT = process.versions.icu ? '✅' : 'Y '\nconst NOT_PERSISTENT = process.versions.icu ? '❌' : 'N '\n\n/**\n * Gets the output of `console.table(…)` as a string.\n */\nmodule.exports = class PendingInterceptorsFormatter {\n  constructor ({ disableColors } = {}) {\n    this.transform = new Transform({\n      transform (chunk, _enc, cb) {\n        cb(null, chunk)\n      }\n    })\n\n    this.logger = new Console({\n      stdout: this.transform,\n      inspectOptions: {\n        colors: !disableColors && !process.env.CI\n      }\n    })\n  }\n\n  format (pendingInterceptors) {\n    const withPrettyHeaders = pendingInterceptors.map(\n      ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({\n        Method: method,\n        Origin: origin,\n        Path: path,\n        'Status code': statusCode,\n        Persistent: persist ? PERSISTENT : NOT_PERSISTENT,\n        Invocations: timesInvoked,\n        Remaining: persist ? Infinity : times - timesInvoked\n      }))\n\n    this.logger.table(withPrettyHeaders)\n    return this.transform.read().toString()\n  }\n}\n","'use strict'\n\nconst singulars = {\n  pronoun: 'it',\n  is: 'is',\n  was: 'was',\n  this: 'this'\n}\n\nconst plurals = {\n  pronoun: 'they',\n  is: 'are',\n  was: 'were',\n  this: 'these'\n}\n\nmodule.exports = class Pluralizer {\n  constructor (singular, plural) {\n    this.singular = singular\n    this.plural = plural\n  }\n\n  pluralize (count) {\n    const one = count === 1\n    const keys = one ? singulars : plurals\n    const noun = one ? this.singular : this.plural\n    return { ...keys, count, noun }\n  }\n}\n","'use strict'\n\n/**\n * This module offers an optimized timer implementation designed for scenarios\n * where high precision is not critical.\n *\n * The timer achieves faster performance by using a low-resolution approach,\n * with an accuracy target of within 500ms. This makes it particularly useful\n * for timers with delays of 1 second or more, where exact timing is less\n * crucial.\n *\n * It's important to note that Node.js timers are inherently imprecise, as\n * delays can occur due to the event loop being blocked by other operations.\n * Consequently, timers may trigger later than their scheduled time.\n */\n\n/**\n * The fastNow variable contains the internal fast timer clock value.\n *\n * @type {number}\n */\nlet fastNow = 0\n\n/**\n * RESOLUTION_MS represents the target resolution time in milliseconds.\n *\n * @type {number}\n * @default 1000\n */\nconst RESOLUTION_MS = 1e3\n\n/**\n * TICK_MS defines the desired interval in milliseconds between each tick.\n * The target value is set to half the resolution time, minus 1 ms, to account\n * for potential event loop overhead.\n *\n * @type {number}\n * @default 499\n */\nconst TICK_MS = (RESOLUTION_MS >> 1) - 1\n\n/**\n * fastNowTimeout is a Node.js timer used to manage and process\n * the FastTimers stored in the `fastTimers` array.\n *\n * @type {NodeJS.Timeout}\n */\nlet fastNowTimeout\n\n/**\n * The kFastTimer symbol is used to identify FastTimer instances.\n *\n * @type {Symbol}\n */\nconst kFastTimer = Symbol('kFastTimer')\n\n/**\n * The fastTimers array contains all active FastTimers.\n *\n * @type {FastTimer[]}\n */\nconst fastTimers = []\n\n/**\n * These constants represent the various states of a FastTimer.\n */\n\n/**\n * The `NOT_IN_LIST` constant indicates that the FastTimer is not included\n * in the `fastTimers` array. Timers with this status will not be processed\n * during the next tick by the `onTick` function.\n *\n * A FastTimer can be re-added to the `fastTimers` array by invoking the\n * `refresh` method on the FastTimer instance.\n *\n * @type {-2}\n */\nconst NOT_IN_LIST = -2\n\n/**\n * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled\n * for removal from the `fastTimers` array. A FastTimer in this state will\n * be removed in the next tick by the `onTick` function and will no longer\n * be processed.\n *\n * This status is also set when the `clear` method is called on the FastTimer instance.\n *\n * @type {-1}\n */\nconst TO_BE_CLEARED = -1\n\n/**\n * The `PENDING` constant signifies that the FastTimer is awaiting processing\n * in the next tick by the `onTick` function. Timers with this status will have\n * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick.\n *\n * @type {0}\n */\nconst PENDING = 0\n\n/**\n * The `ACTIVE` constant indicates that the FastTimer is active and waiting\n * for its timer to expire. During the next tick, the `onTick` function will\n * check if the timer has expired, and if so, it will execute the associated callback.\n *\n * @type {1}\n */\nconst ACTIVE = 1\n\n/**\n * The onTick function processes the fastTimers array.\n *\n * @returns {void}\n */\nfunction onTick () {\n  /**\n   * Increment the fastNow value by the TICK_MS value, despite the actual time\n   * that has passed since the last tick. This approach ensures independence\n   * from the system clock and delays caused by a blocked event loop.\n   *\n   * @type {number}\n   */\n  fastNow += TICK_MS\n\n  /**\n   * The `idx` variable is used to iterate over the `fastTimers` array.\n   * Expired timers are removed by replacing them with the last element in the array.\n   * Consequently, `idx` is only incremented when the current element is not removed.\n   *\n   * @type {number}\n   */\n  let idx = 0\n\n  /**\n   * The len variable will contain the length of the fastTimers array\n   * and will be decremented when a FastTimer should be removed from the\n   * fastTimers array.\n   *\n   * @type {number}\n   */\n  let len = fastTimers.length\n\n  while (idx < len) {\n    /**\n     * @type {FastTimer}\n     */\n    const timer = fastTimers[idx]\n\n    // If the timer is in the ACTIVE state and the timer has expired, it will\n    // be processed in the next tick.\n    if (timer._state === PENDING) {\n      // Set the _idleStart value to the fastNow value minus the TICK_MS value\n      // to account for the time the timer was in the PENDING state.\n      timer._idleStart = fastNow - TICK_MS\n      timer._state = ACTIVE\n    } else if (\n      timer._state === ACTIVE &&\n      fastNow >= timer._idleStart + timer._idleTimeout\n    ) {\n      timer._state = TO_BE_CLEARED\n      timer._idleStart = -1\n      timer._onTimeout(timer._timerArg)\n    }\n\n    if (timer._state === TO_BE_CLEARED) {\n      timer._state = NOT_IN_LIST\n\n      // Move the last element to the current index and decrement len if it is\n      // not the only element in the array.\n      if (--len !== 0) {\n        fastTimers[idx] = fastTimers[len]\n      }\n    } else {\n      ++idx\n    }\n  }\n\n  // Set the length of the fastTimers array to the new length and thus\n  // removing the excess FastTimers elements from the array.\n  fastTimers.length = len\n\n  // If there are still active FastTimers in the array, refresh the Timer.\n  // If there are no active FastTimers, the timer will be refreshed again\n  // when a new FastTimer is instantiated.\n  if (fastTimers.length !== 0) {\n    refreshTimeout()\n  }\n}\n\nfunction refreshTimeout () {\n  // If the fastNowTimeout is already set, refresh it.\n  if (fastNowTimeout) {\n    fastNowTimeout.refresh()\n  // fastNowTimeout is not instantiated yet, create a new Timer.\n  } else {\n    clearTimeout(fastNowTimeout)\n    fastNowTimeout = setTimeout(onTick, TICK_MS)\n\n    // If the Timer has an unref method, call it to allow the process to exit if\n    // there are no other active handles.\n    if (fastNowTimeout.unref) {\n      fastNowTimeout.unref()\n    }\n  }\n}\n\n/**\n * The `FastTimer` class is a data structure designed to store and manage\n * timer information.\n */\nclass FastTimer {\n  [kFastTimer] = true\n\n  /**\n   * The state of the timer, which can be one of the following:\n   * - NOT_IN_LIST (-2)\n   * - TO_BE_CLEARED (-1)\n   * - PENDING (0)\n   * - ACTIVE (1)\n   *\n   * @type {-2|-1|0|1}\n   * @private\n   */\n  _state = NOT_IN_LIST\n\n  /**\n   * The number of milliseconds to wait before calling the callback.\n   *\n   * @type {number}\n   * @private\n   */\n  _idleTimeout = -1\n\n  /**\n   * The time in milliseconds when the timer was started. This value is used to\n   * calculate when the timer should expire.\n   *\n   * @type {number}\n   * @default -1\n   * @private\n   */\n  _idleStart = -1\n\n  /**\n   * The function to be executed when the timer expires.\n   * @type {Function}\n   * @private\n   */\n  _onTimeout\n\n  /**\n   * The argument to be passed to the callback when the timer expires.\n   *\n   * @type {*}\n   * @private\n   */\n  _timerArg\n\n  /**\n   * @constructor\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should wait\n   * before the specified function or code is executed.\n   * @param {*} arg\n   */\n  constructor (callback, delay, arg) {\n    this._onTimeout = callback\n    this._idleTimeout = delay\n    this._timerArg = arg\n\n    this.refresh()\n  }\n\n  /**\n   * Sets the timer's start time to the current time, and reschedules the timer\n   * to call its callback at the previously specified duration adjusted to the\n   * current time.\n   * Using this on a timer that has already called its callback will reactivate\n   * the timer.\n   *\n   * @returns {void}\n   */\n  refresh () {\n    // In the special case that the timer is not in the list of active timers,\n    // add it back to the array to be processed in the next tick by the onTick\n    // function.\n    if (this._state === NOT_IN_LIST) {\n      fastTimers.push(this)\n    }\n\n    // If the timer is the only active timer, refresh the fastNowTimeout for\n    // better resolution.\n    if (!fastNowTimeout || fastTimers.length === 1) {\n      refreshTimeout()\n    }\n\n    // Setting the state to PENDING will cause the timer to be reset in the\n    // next tick by the onTick function.\n    this._state = PENDING\n  }\n\n  /**\n   * The `clear` method cancels the timer, preventing it from executing.\n   *\n   * @returns {void}\n   * @private\n   */\n  clear () {\n    // Set the state to TO_BE_CLEARED to mark the timer for removal in the next\n    // tick by the onTick function.\n    this._state = TO_BE_CLEARED\n\n    // Reset the _idleStart value to -1 to indicate that the timer is no longer\n    // active.\n    this._idleStart = -1\n  }\n}\n\n/**\n * This module exports a setTimeout and clearTimeout function that can be\n * used as a drop-in replacement for the native functions.\n */\nmodule.exports = {\n  /**\n   * The setTimeout() method sets a timer which executes a function once the\n   * timer expires.\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should\n   * wait before the specified function or code is executed.\n   * @param {*} [arg] An optional argument to be passed to the callback function\n   * when the timer expires.\n   * @returns {NodeJS.Timeout|FastTimer}\n   */\n  setTimeout (callback, delay, arg) {\n    // If the delay is less than or equal to the RESOLUTION_MS value return a\n    // native Node.js Timer instance.\n    return delay <= RESOLUTION_MS\n      ? setTimeout(callback, delay, arg)\n      : new FastTimer(callback, delay, arg)\n  },\n  /**\n   * The clearTimeout method cancels an instantiated Timer previously created\n   * by calling setTimeout.\n   *\n   * @param {NodeJS.Timeout|FastTimer} timeout\n   */\n  clearTimeout (timeout) {\n    // If the timeout is a FastTimer, call its own clear method.\n    if (timeout[kFastTimer]) {\n      /**\n       * @type {FastTimer}\n       */\n      timeout.clear()\n      // Otherwise it is an instance of a native NodeJS.Timeout, so call the\n      // Node.js native clearTimeout function.\n    } else {\n      clearTimeout(timeout)\n    }\n  },\n  /**\n   * The setFastTimeout() method sets a fastTimer which executes a function once\n   * the timer expires.\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should\n   * wait before the specified function or code is executed.\n   * @param {*} [arg] An optional argument to be passed to the callback function\n   * when the timer expires.\n   * @returns {FastTimer}\n   */\n  setFastTimeout (callback, delay, arg) {\n    return new FastTimer(callback, delay, arg)\n  },\n  /**\n   * The clearTimeout method cancels an instantiated FastTimer previously\n   * created by calling setFastTimeout.\n   *\n   * @param {FastTimer} timeout\n   */\n  clearFastTimeout (timeout) {\n    timeout.clear()\n  },\n  /**\n   * The now method returns the value of the internal fast timer clock.\n   *\n   * @returns {number}\n   */\n  now () {\n    return fastNow\n  },\n  /**\n   * Trigger the onTick function to process the fastTimers array.\n   * Exported for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   * @param {number} [delay=0] The delay in milliseconds to add to the now value.\n   */\n  tick (delay = 0) {\n    fastNow += delay - RESOLUTION_MS + 1\n    onTick()\n    onTick()\n  },\n  /**\n   * Reset FastTimers.\n   * Exported for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   */\n  reset () {\n    fastNow = 0\n    fastTimers.length = 0\n    clearTimeout(fastNowTimeout)\n    fastNowTimeout = null\n  },\n  /**\n   * Exporting for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   */\n  kFastTimer\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { urlEquals, getFieldValues } = require('./util')\nconst { kEnumerableProperty, isDisturbed } = require('../../core/util')\nconst { webidl } = require('../fetch/webidl')\nconst { Response, cloneResponse, fromInnerResponse } = require('../fetch/response')\nconst { Request, fromInnerRequest } = require('../fetch/request')\nconst { kState } = require('../fetch/symbols')\nconst { fetching } = require('../fetch/index')\nconst { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require('../fetch/util')\nconst assert = require('node:assert')\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation\n * @typedef {Object} CacheBatchOperation\n * @property {'delete' | 'put'} type\n * @property {any} request\n * @property {any} response\n * @property {import('../../types/cache').CacheQueryOptions} options\n */\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list\n * @typedef {[any, any][]} requestResponseList\n */\n\nclass Cache {\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list\n   * @type {requestResponseList}\n   */\n  #relevantRequestResponseList\n\n  constructor () {\n    if (arguments[0] !== kConstruct) {\n      webidl.illegalConstructor()\n    }\n\n    webidl.util.markAsUncloneable(this)\n    this.#relevantRequestResponseList = arguments[1]\n  }\n\n  async match (request, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.match'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    const p = this.#internalMatchAll(request, options, 1)\n\n    if (p.length === 0) {\n      return\n    }\n\n    return p[0]\n  }\n\n  async matchAll (request = undefined, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.matchAll'\n    if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    return this.#internalMatchAll(request, options)\n  }\n\n  async add (request) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.add'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n\n    // 1.\n    const requests = [request]\n\n    // 2.\n    const responseArrayPromise = this.addAll(requests)\n\n    // 3.\n    return await responseArrayPromise\n  }\n\n  async addAll (requests) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.addAll'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    // 1.\n    const responsePromises = []\n\n    // 2.\n    const requestList = []\n\n    // 3.\n    for (let request of requests) {\n      if (request === undefined) {\n        throw webidl.errors.conversionFailed({\n          prefix,\n          argument: 'Argument 1',\n          types: ['undefined is not allowed']\n        })\n      }\n\n      request = webidl.converters.RequestInfo(request)\n\n      if (typeof request === 'string') {\n        continue\n      }\n\n      // 3.1\n      const r = request[kState]\n\n      // 3.2\n      if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {\n        throw webidl.errors.exception({\n          header: prefix,\n          message: 'Expected http/s scheme when method is not GET.'\n        })\n      }\n    }\n\n    // 4.\n    /** @type {ReturnType[]} */\n    const fetchControllers = []\n\n    // 5.\n    for (const request of requests) {\n      // 5.1\n      const r = new Request(request)[kState]\n\n      // 5.2\n      if (!urlIsHttpHttpsScheme(r.url)) {\n        throw webidl.errors.exception({\n          header: prefix,\n          message: 'Expected http/s scheme.'\n        })\n      }\n\n      // 5.4\n      r.initiator = 'fetch'\n      r.destination = 'subresource'\n\n      // 5.5\n      requestList.push(r)\n\n      // 5.6\n      const responsePromise = createDeferredPromise()\n\n      // 5.7\n      fetchControllers.push(fetching({\n        request: r,\n        processResponse (response) {\n          // 1.\n          if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {\n            responsePromise.reject(webidl.errors.exception({\n              header: 'Cache.addAll',\n              message: 'Received an invalid status code or the request failed.'\n            }))\n          } else if (response.headersList.contains('vary')) { // 2.\n            // 2.1\n            const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n            // 2.2\n            for (const fieldValue of fieldValues) {\n              // 2.2.1\n              if (fieldValue === '*') {\n                responsePromise.reject(webidl.errors.exception({\n                  header: 'Cache.addAll',\n                  message: 'invalid vary field value'\n                }))\n\n                for (const controller of fetchControllers) {\n                  controller.abort()\n                }\n\n                return\n              }\n            }\n          }\n        },\n        processResponseEndOfBody (response) {\n          // 1.\n          if (response.aborted) {\n            responsePromise.reject(new DOMException('aborted', 'AbortError'))\n            return\n          }\n\n          // 2.\n          responsePromise.resolve(response)\n        }\n      }))\n\n      // 5.8\n      responsePromises.push(responsePromise.promise)\n    }\n\n    // 6.\n    const p = Promise.all(responsePromises)\n\n    // 7.\n    const responses = await p\n\n    // 7.1\n    const operations = []\n\n    // 7.2\n    let index = 0\n\n    // 7.3\n    for (const response of responses) {\n      // 7.3.1\n      /** @type {CacheBatchOperation} */\n      const operation = {\n        type: 'put', // 7.3.2\n        request: requestList[index], // 7.3.3\n        response // 7.3.4\n      }\n\n      operations.push(operation) // 7.3.5\n\n      index++ // 7.3.6\n    }\n\n    // 7.5\n    const cacheJobPromise = createDeferredPromise()\n\n    // 7.6.1\n    let errorData = null\n\n    // 7.6.2\n    try {\n      this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    // 7.6.3\n    queueMicrotask(() => {\n      // 7.6.3.1\n      if (errorData === null) {\n        cacheJobPromise.resolve(undefined)\n      } else {\n        // 7.6.3.2\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    // 7.7\n    return cacheJobPromise.promise\n  }\n\n  async put (request, response) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.put'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    response = webidl.converters.Response(response, prefix, 'response')\n\n    // 1.\n    let innerRequest = null\n\n    // 2.\n    if (request instanceof Request) {\n      innerRequest = request[kState]\n    } else { // 3.\n      innerRequest = new Request(request)[kState]\n    }\n\n    // 4.\n    if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Expected an http/s scheme when method is not GET'\n      })\n    }\n\n    // 5.\n    const innerResponse = response[kState]\n\n    // 6.\n    if (innerResponse.status === 206) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Got 206 status'\n      })\n    }\n\n    // 7.\n    if (innerResponse.headersList.contains('vary')) {\n      // 7.1.\n      const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))\n\n      // 7.2.\n      for (const fieldValue of fieldValues) {\n        // 7.2.1\n        if (fieldValue === '*') {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: 'Got * vary field value'\n          })\n        }\n      }\n    }\n\n    // 8.\n    if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Response body is locked or disturbed'\n      })\n    }\n\n    // 9.\n    const clonedResponse = cloneResponse(innerResponse)\n\n    // 10.\n    const bodyReadPromise = createDeferredPromise()\n\n    // 11.\n    if (innerResponse.body != null) {\n      // 11.1\n      const stream = innerResponse.body.stream\n\n      // 11.2\n      const reader = stream.getReader()\n\n      // 11.3\n      readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)\n    } else {\n      bodyReadPromise.resolve(undefined)\n    }\n\n    // 12.\n    /** @type {CacheBatchOperation[]} */\n    const operations = []\n\n    // 13.\n    /** @type {CacheBatchOperation} */\n    const operation = {\n      type: 'put', // 14.\n      request: innerRequest, // 15.\n      response: clonedResponse // 16.\n    }\n\n    // 17.\n    operations.push(operation)\n\n    // 19.\n    const bytes = await bodyReadPromise.promise\n\n    if (clonedResponse.body != null) {\n      clonedResponse.body.source = bytes\n    }\n\n    // 19.1\n    const cacheJobPromise = createDeferredPromise()\n\n    // 19.2.1\n    let errorData = null\n\n    // 19.2.2\n    try {\n      this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    // 19.2.3\n    queueMicrotask(() => {\n      // 19.2.3.1\n      if (errorData === null) {\n        cacheJobPromise.resolve()\n      } else { // 19.2.3.2\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    return cacheJobPromise.promise\n  }\n\n  async delete (request, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    /**\n     * @type {Request}\n     */\n    let r = null\n\n    if (request instanceof Request) {\n      r = request[kState]\n\n      if (r.method !== 'GET' && !options.ignoreMethod) {\n        return false\n      }\n    } else {\n      assert(typeof request === 'string')\n\n      r = new Request(request)[kState]\n    }\n\n    /** @type {CacheBatchOperation[]} */\n    const operations = []\n\n    /** @type {CacheBatchOperation} */\n    const operation = {\n      type: 'delete',\n      request: r,\n      options\n    }\n\n    operations.push(operation)\n\n    const cacheJobPromise = createDeferredPromise()\n\n    let errorData = null\n    let requestResponses\n\n    try {\n      requestResponses = this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    queueMicrotask(() => {\n      if (errorData === null) {\n        cacheJobPromise.resolve(!!requestResponses?.length)\n      } else {\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    return cacheJobPromise.promise\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys\n   * @param {any} request\n   * @param {import('../../types/cache').CacheQueryOptions} options\n   * @returns {Promise}\n   */\n  async keys (request = undefined, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.keys'\n\n    if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    // 1.\n    let r = null\n\n    // 2.\n    if (request !== undefined) {\n      // 2.1\n      if (request instanceof Request) {\n        // 2.1.1\n        r = request[kState]\n\n        // 2.1.2\n        if (r.method !== 'GET' && !options.ignoreMethod) {\n          return []\n        }\n      } else if (typeof request === 'string') { // 2.2\n        r = new Request(request)[kState]\n      }\n    }\n\n    // 4.\n    const promise = createDeferredPromise()\n\n    // 5.\n    // 5.1\n    const requests = []\n\n    // 5.2\n    if (request === undefined) {\n      // 5.2.1\n      for (const requestResponse of this.#relevantRequestResponseList) {\n        // 5.2.1.1\n        requests.push(requestResponse[0])\n      }\n    } else { // 5.3\n      // 5.3.1\n      const requestResponses = this.#queryCache(r, options)\n\n      // 5.3.2\n      for (const requestResponse of requestResponses) {\n        // 5.3.2.1\n        requests.push(requestResponse[0])\n      }\n    }\n\n    // 5.4\n    queueMicrotask(() => {\n      // 5.4.1\n      const requestList = []\n\n      // 5.4.2\n      for (const request of requests) {\n        const requestObject = fromInnerRequest(\n          request,\n          new AbortController().signal,\n          'immutable'\n        )\n        // 5.4.2.1\n        requestList.push(requestObject)\n      }\n\n      // 5.4.3\n      promise.resolve(Object.freeze(requestList))\n    })\n\n    return promise.promise\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm\n   * @param {CacheBatchOperation[]} operations\n   * @returns {requestResponseList}\n   */\n  #batchCacheOperations (operations) {\n    // 1.\n    const cache = this.#relevantRequestResponseList\n\n    // 2.\n    const backupCache = [...cache]\n\n    // 3.\n    const addedItems = []\n\n    // 4.1\n    const resultList = []\n\n    try {\n      // 4.2\n      for (const operation of operations) {\n        // 4.2.1\n        if (operation.type !== 'delete' && operation.type !== 'put') {\n          throw webidl.errors.exception({\n            header: 'Cache.#batchCacheOperations',\n            message: 'operation type does not match \"delete\" or \"put\"'\n          })\n        }\n\n        // 4.2.2\n        if (operation.type === 'delete' && operation.response != null) {\n          throw webidl.errors.exception({\n            header: 'Cache.#batchCacheOperations',\n            message: 'delete operation should not have an associated response'\n          })\n        }\n\n        // 4.2.3\n        if (this.#queryCache(operation.request, operation.options, addedItems).length) {\n          throw new DOMException('???', 'InvalidStateError')\n        }\n\n        // 4.2.4\n        let requestResponses\n\n        // 4.2.5\n        if (operation.type === 'delete') {\n          // 4.2.5.1\n          requestResponses = this.#queryCache(operation.request, operation.options)\n\n          // TODO: the spec is wrong, this is needed to pass WPTs\n          if (requestResponses.length === 0) {\n            return []\n          }\n\n          // 4.2.5.2\n          for (const requestResponse of requestResponses) {\n            const idx = cache.indexOf(requestResponse)\n            assert(idx !== -1)\n\n            // 4.2.5.2.1\n            cache.splice(idx, 1)\n          }\n        } else if (operation.type === 'put') { // 4.2.6\n          // 4.2.6.1\n          if (operation.response == null) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'put operation should have an associated response'\n            })\n          }\n\n          // 4.2.6.2\n          const r = operation.request\n\n          // 4.2.6.3\n          if (!urlIsHttpHttpsScheme(r.url)) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'expected http or https scheme'\n            })\n          }\n\n          // 4.2.6.4\n          if (r.method !== 'GET') {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'not get method'\n            })\n          }\n\n          // 4.2.6.5\n          if (operation.options != null) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'options must not be defined'\n            })\n          }\n\n          // 4.2.6.6\n          requestResponses = this.#queryCache(operation.request)\n\n          // 4.2.6.7\n          for (const requestResponse of requestResponses) {\n            const idx = cache.indexOf(requestResponse)\n            assert(idx !== -1)\n\n            // 4.2.6.7.1\n            cache.splice(idx, 1)\n          }\n\n          // 4.2.6.8\n          cache.push([operation.request, operation.response])\n\n          // 4.2.6.10\n          addedItems.push([operation.request, operation.response])\n        }\n\n        // 4.2.7\n        resultList.push([operation.request, operation.response])\n      }\n\n      // 4.3\n      return resultList\n    } catch (e) { // 5.\n      // 5.1\n      this.#relevantRequestResponseList.length = 0\n\n      // 5.2\n      this.#relevantRequestResponseList = backupCache\n\n      // 5.3\n      throw e\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#query-cache\n   * @param {any} requestQuery\n   * @param {import('../../types/cache').CacheQueryOptions} options\n   * @param {requestResponseList} targetStorage\n   * @returns {requestResponseList}\n   */\n  #queryCache (requestQuery, options, targetStorage) {\n    /** @type {requestResponseList} */\n    const resultList = []\n\n    const storage = targetStorage ?? this.#relevantRequestResponseList\n\n    for (const requestResponse of storage) {\n      const [cachedRequest, cachedResponse] = requestResponse\n      if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {\n        resultList.push(requestResponse)\n      }\n    }\n\n    return resultList\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm\n   * @param {any} requestQuery\n   * @param {any} request\n   * @param {any | null} response\n   * @param {import('../../types/cache').CacheQueryOptions | undefined} options\n   * @returns {boolean}\n   */\n  #requestMatchesCachedItem (requestQuery, request, response = null, options) {\n    // if (options?.ignoreMethod === false && request.method === 'GET') {\n    //   return false\n    // }\n\n    const queryURL = new URL(requestQuery.url)\n\n    const cachedURL = new URL(request.url)\n\n    if (options?.ignoreSearch) {\n      cachedURL.search = ''\n\n      queryURL.search = ''\n    }\n\n    if (!urlEquals(queryURL, cachedURL, true)) {\n      return false\n    }\n\n    if (\n      response == null ||\n      options?.ignoreVary ||\n      !response.headersList.contains('vary')\n    ) {\n      return true\n    }\n\n    const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n    for (const fieldValue of fieldValues) {\n      if (fieldValue === '*') {\n        return false\n      }\n\n      const requestValue = request.headersList.get(fieldValue)\n      const queryValue = requestQuery.headersList.get(fieldValue)\n\n      // If one has the header and the other doesn't, or one has\n      // a different value than the other, return false\n      if (requestValue !== queryValue) {\n        return false\n      }\n    }\n\n    return true\n  }\n\n  #internalMatchAll (request, options, maxResponses = Infinity) {\n    // 1.\n    let r = null\n\n    // 2.\n    if (request !== undefined) {\n      if (request instanceof Request) {\n        // 2.1.1\n        r = request[kState]\n\n        // 2.1.2\n        if (r.method !== 'GET' && !options.ignoreMethod) {\n          return []\n        }\n      } else if (typeof request === 'string') {\n        // 2.2.1\n        r = new Request(request)[kState]\n      }\n    }\n\n    // 5.\n    // 5.1\n    const responses = []\n\n    // 5.2\n    if (request === undefined) {\n      // 5.2.1\n      for (const requestResponse of this.#relevantRequestResponseList) {\n        responses.push(requestResponse[1])\n      }\n    } else { // 5.3\n      // 5.3.1\n      const requestResponses = this.#queryCache(r, options)\n\n      // 5.3.2\n      for (const requestResponse of requestResponses) {\n        responses.push(requestResponse[1])\n      }\n    }\n\n    // 5.4\n    // We don't implement CORs so we don't need to loop over the responses, yay!\n\n    // 5.5.1\n    const responseList = []\n\n    // 5.5.2\n    for (const response of responses) {\n      // 5.5.2.1\n      const responseObject = fromInnerResponse(response, 'immutable')\n\n      responseList.push(responseObject.clone())\n\n      if (responseList.length >= maxResponses) {\n        break\n      }\n    }\n\n    // 6.\n    return Object.freeze(responseList)\n  }\n}\n\nObject.defineProperties(Cache.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'Cache',\n    configurable: true\n  },\n  match: kEnumerableProperty,\n  matchAll: kEnumerableProperty,\n  add: kEnumerableProperty,\n  addAll: kEnumerableProperty,\n  put: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  keys: kEnumerableProperty\n})\n\nconst cacheQueryOptionConverters = [\n  {\n    key: 'ignoreSearch',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'ignoreMethod',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'ignoreVary',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n]\n\nwebidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)\n\nwebidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([\n  ...cacheQueryOptionConverters,\n  {\n    key: 'cacheName',\n    converter: webidl.converters.DOMString\n  }\n])\n\nwebidl.converters.Response = webidl.interfaceConverter(Response)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.RequestInfo\n)\n\nmodule.exports = {\n  Cache\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { Cache } = require('./cache')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass CacheStorage {\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map\n   * @type {Map}\n   */\n  async has (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.has'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    // 2.1.1\n    // 2.2\n    return this.#caches.has(cacheName)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open\n   * @param {string} cacheName\n   * @returns {Promise}\n   */\n  async open (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.open'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    // 2.1\n    if (this.#caches.has(cacheName)) {\n      // await caches.open('v1') !== await caches.open('v1')\n\n      // 2.1.1\n      const cache = this.#caches.get(cacheName)\n\n      // 2.1.1.1\n      return new Cache(kConstruct, cache)\n    }\n\n    // 2.2\n    const cache = []\n\n    // 2.3\n    this.#caches.set(cacheName, cache)\n\n    // 2.4\n    return new Cache(kConstruct, cache)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete\n   * @param {string} cacheName\n   * @returns {Promise}\n   */\n  async delete (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    return this.#caches.delete(cacheName)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys\n   * @returns {Promise}\n   */\n  async keys () {\n    webidl.brandCheck(this, CacheStorage)\n\n    // 2.1\n    const keys = this.#caches.keys()\n\n    // 2.2\n    return [...keys]\n  }\n}\n\nObject.defineProperties(CacheStorage.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'CacheStorage',\n    configurable: true\n  },\n  match: kEnumerableProperty,\n  has: kEnumerableProperty,\n  open: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  keys: kEnumerableProperty\n})\n\nmodule.exports = {\n  CacheStorage\n}\n","'use strict'\n\nmodule.exports = {\n  kConstruct: require('../../core/symbols').kConstruct\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { isValidHeaderName } = require('../fetch/util')\n\n/**\n * @see https://url.spec.whatwg.org/#concept-url-equals\n * @param {URL} A\n * @param {URL} B\n * @param {boolean | undefined} excludeFragment\n * @returns {boolean}\n */\nfunction urlEquals (A, B, excludeFragment = false) {\n  const serializedA = URLSerializer(A, excludeFragment)\n\n  const serializedB = URLSerializer(B, excludeFragment)\n\n  return serializedA === serializedB\n}\n\n/**\n * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262\n * @param {string} header\n */\nfunction getFieldValues (header) {\n  assert(header !== null)\n\n  const values = []\n\n  for (let value of header.split(',')) {\n    value = value.trim()\n\n    if (isValidHeaderName(value)) {\n      values.push(value)\n    }\n  }\n\n  return values\n}\n\nmodule.exports = {\n  urlEquals,\n  getFieldValues\n}\n","'use strict'\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size\nconst maxAttributeValueSize = 1024\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size\nconst maxNameValuePairSize = 4096\n\nmodule.exports = {\n  maxAttributeValueSize,\n  maxNameValuePairSize\n}\n","'use strict'\n\nconst { parseSetCookie } = require('./parse')\nconst { stringify } = require('./util')\nconst { webidl } = require('../fetch/webidl')\nconst { Headers } = require('../fetch/headers')\n\n/**\n * @typedef {Object} Cookie\n * @property {string} name\n * @property {string} value\n * @property {Date|number|undefined} expires\n * @property {number|undefined} maxAge\n * @property {string|undefined} domain\n * @property {string|undefined} path\n * @property {boolean|undefined} secure\n * @property {boolean|undefined} httpOnly\n * @property {'Strict'|'Lax'|'None'} sameSite\n * @property {string[]} unparsed\n */\n\n/**\n * @param {Headers} headers\n * @returns {Record}\n */\nfunction getCookies (headers) {\n  webidl.argumentLengthCheck(arguments, 1, 'getCookies')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const cookie = headers.get('cookie')\n  const out = {}\n\n  if (!cookie) {\n    return out\n  }\n\n  for (const piece of cookie.split(';')) {\n    const [name, ...value] = piece.split('=')\n\n    out[name.trim()] = value.join('=')\n  }\n\n  return out\n}\n\n/**\n * @param {Headers} headers\n * @param {string} name\n * @param {{ path?: string, domain?: string }|undefined} attributes\n * @returns {void}\n */\nfunction deleteCookie (headers, name, attributes) {\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const prefix = 'deleteCookie'\n  webidl.argumentLengthCheck(arguments, 2, prefix)\n\n  name = webidl.converters.DOMString(name, prefix, 'name')\n  attributes = webidl.converters.DeleteCookieAttributes(attributes)\n\n  // Matches behavior of\n  // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278\n  setCookie(headers, {\n    name,\n    value: '',\n    expires: new Date(0),\n    ...attributes\n  })\n}\n\n/**\n * @param {Headers} headers\n * @returns {Cookie[]}\n */\nfunction getSetCookies (headers) {\n  webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const cookies = headers.getSetCookie()\n\n  if (!cookies) {\n    return []\n  }\n\n  return cookies.map((pair) => parseSetCookie(pair))\n}\n\n/**\n * @param {Headers} headers\n * @param {Cookie} cookie\n * @returns {void}\n */\nfunction setCookie (headers, cookie) {\n  webidl.argumentLengthCheck(arguments, 2, 'setCookie')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  cookie = webidl.converters.Cookie(cookie)\n\n  const str = stringify(cookie)\n\n  if (str) {\n    headers.append('Set-Cookie', str)\n  }\n}\n\nwebidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'path',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'domain',\n    defaultValue: () => null\n  }\n])\n\nwebidl.converters.Cookie = webidl.dictionaryConverter([\n  {\n    converter: webidl.converters.DOMString,\n    key: 'name'\n  },\n  {\n    converter: webidl.converters.DOMString,\n    key: 'value'\n  },\n  {\n    converter: webidl.nullableConverter((value) => {\n      if (typeof value === 'number') {\n        return webidl.converters['unsigned long long'](value)\n      }\n\n      return new Date(value)\n    }),\n    key: 'expires',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters['long long']),\n    key: 'maxAge',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'domain',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'path',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.boolean),\n    key: 'secure',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.boolean),\n    key: 'httpOnly',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.converters.USVString,\n    key: 'sameSite',\n    allowedValues: ['Strict', 'Lax', 'None']\n  },\n  {\n    converter: webidl.sequenceConverter(webidl.converters.DOMString),\n    key: 'unparsed',\n    defaultValue: () => new Array(0)\n  }\n])\n\nmodule.exports = {\n  getCookies,\n  deleteCookie,\n  getSetCookies,\n  setCookie\n}\n","'use strict'\n\nconst { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')\nconst { isCTLExcludingHtab } = require('./util')\nconst { collectASequenceOfCodePointsFast } = require('../fetch/data-url')\nconst assert = require('node:assert')\n\n/**\n * @description Parses the field-value attributes of a set-cookie header string.\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} header\n * @returns if the header is invalid, null will be returned\n */\nfunction parseSetCookie (header) {\n  // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F\n  //    character (CTL characters excluding HTAB): Abort these steps and\n  //    ignore the set-cookie-string entirely.\n  if (isCTLExcludingHtab(header)) {\n    return null\n  }\n\n  let nameValuePair = ''\n  let unparsedAttributes = ''\n  let name = ''\n  let value = ''\n\n  // 2. If the set-cookie-string contains a %x3B (\";\") character:\n  if (header.includes(';')) {\n    // 1. The name-value-pair string consists of the characters up to,\n    //    but not including, the first %x3B (\";\"), and the unparsed-\n    //    attributes consist of the remainder of the set-cookie-string\n    //    (including the %x3B (\";\") in question).\n    const position = { position: 0 }\n\n    nameValuePair = collectASequenceOfCodePointsFast(';', header, position)\n    unparsedAttributes = header.slice(position.position)\n  } else {\n    // Otherwise:\n\n    // 1. The name-value-pair string consists of all the characters\n    //    contained in the set-cookie-string, and the unparsed-\n    //    attributes is the empty string.\n    nameValuePair = header\n  }\n\n  // 3. If the name-value-pair string lacks a %x3D (\"=\") character, then\n  //    the name string is empty, and the value string is the value of\n  //    name-value-pair.\n  if (!nameValuePair.includes('=')) {\n    value = nameValuePair\n  } else {\n    //    Otherwise, the name string consists of the characters up to, but\n    //    not including, the first %x3D (\"=\") character, and the (possibly\n    //    empty) value string consists of the characters after the first\n    //    %x3D (\"=\") character.\n    const position = { position: 0 }\n    name = collectASequenceOfCodePointsFast(\n      '=',\n      nameValuePair,\n      position\n    )\n    value = nameValuePair.slice(position.position + 1)\n  }\n\n  // 4. Remove any leading or trailing WSP characters from the name\n  //    string and the value string.\n  name = name.trim()\n  value = value.trim()\n\n  // 5. If the sum of the lengths of the name string and the value string\n  //    is more than 4096 octets, abort these steps and ignore the set-\n  //    cookie-string entirely.\n  if (name.length + value.length > maxNameValuePairSize) {\n    return null\n  }\n\n  // 6. The cookie-name is the name string, and the cookie-value is the\n  //    value string.\n  return {\n    name, value, ...parseUnparsedAttributes(unparsedAttributes)\n  }\n}\n\n/**\n * Parses the remaining attributes of a set-cookie header\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} unparsedAttributes\n * @param {[Object.]={}} cookieAttributeList\n */\nfunction parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {\n  // 1. If the unparsed-attributes string is empty, skip the rest of\n  //    these steps.\n  if (unparsedAttributes.length === 0) {\n    return cookieAttributeList\n  }\n\n  // 2. Discard the first character of the unparsed-attributes (which\n  //    will be a %x3B (\";\") character).\n  assert(unparsedAttributes[0] === ';')\n  unparsedAttributes = unparsedAttributes.slice(1)\n\n  let cookieAv = ''\n\n  // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n  //    character:\n  if (unparsedAttributes.includes(';')) {\n    // 1. Consume the characters of the unparsed-attributes up to, but\n    //    not including, the first %x3B (\";\") character.\n    cookieAv = collectASequenceOfCodePointsFast(\n      ';',\n      unparsedAttributes,\n      { position: 0 }\n    )\n    unparsedAttributes = unparsedAttributes.slice(cookieAv.length)\n  } else {\n    // Otherwise:\n\n    // 1. Consume the remainder of the unparsed-attributes.\n    cookieAv = unparsedAttributes\n    unparsedAttributes = ''\n  }\n\n  // Let the cookie-av string be the characters consumed in this step.\n\n  let attributeName = ''\n  let attributeValue = ''\n\n  // 4. If the cookie-av string contains a %x3D (\"=\") character:\n  if (cookieAv.includes('=')) {\n    // 1. The (possibly empty) attribute-name string consists of the\n    //    characters up to, but not including, the first %x3D (\"=\")\n    //    character, and the (possibly empty) attribute-value string\n    //    consists of the characters after the first %x3D (\"=\")\n    //    character.\n    const position = { position: 0 }\n\n    attributeName = collectASequenceOfCodePointsFast(\n      '=',\n      cookieAv,\n      position\n    )\n    attributeValue = cookieAv.slice(position.position + 1)\n  } else {\n    // Otherwise:\n\n    // 1. The attribute-name string consists of the entire cookie-av\n    //    string, and the attribute-value string is empty.\n    attributeName = cookieAv\n  }\n\n  // 5. Remove any leading or trailing WSP characters from the attribute-\n  //    name string and the attribute-value string.\n  attributeName = attributeName.trim()\n  attributeValue = attributeValue.trim()\n\n  // 6. If the attribute-value is longer than 1024 octets, ignore the\n  //    cookie-av string and return to Step 1 of this algorithm.\n  if (attributeValue.length > maxAttributeValueSize) {\n    return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n  }\n\n  // 7. Process the attribute-name and attribute-value according to the\n  //    requirements in the following subsections.  (Notice that\n  //    attributes with unrecognized attribute-names are ignored.)\n  const attributeNameLowercase = attributeName.toLowerCase()\n\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1\n  // If the attribute-name case-insensitively matches the string\n  // \"Expires\", the user agent MUST process the cookie-av as follows.\n  if (attributeNameLowercase === 'expires') {\n    // 1. Let the expiry-time be the result of parsing the attribute-value\n    //    as cookie-date (see Section 5.1.1).\n    const expiryTime = new Date(attributeValue)\n\n    // 2. If the attribute-value failed to parse as a cookie date, ignore\n    //    the cookie-av.\n\n    cookieAttributeList.expires = expiryTime\n  } else if (attributeNameLowercase === 'max-age') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2\n    // If the attribute-name case-insensitively matches the string \"Max-\n    // Age\", the user agent MUST process the cookie-av as follows.\n\n    // 1. If the first character of the attribute-value is not a DIGIT or a\n    //    \"-\" character, ignore the cookie-av.\n    const charCode = attributeValue.charCodeAt(0)\n\n    if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {\n      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n    }\n\n    // 2. If the remainder of attribute-value contains a non-DIGIT\n    //    character, ignore the cookie-av.\n    if (!/^\\d+$/.test(attributeValue)) {\n      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n    }\n\n    // 3. Let delta-seconds be the attribute-value converted to an integer.\n    const deltaSeconds = Number(attributeValue)\n\n    // 4. Let cookie-age-limit be the maximum age of the cookie (which\n    //    SHOULD be 400 days or less, see Section 4.1.2.2).\n\n    // 5. Set delta-seconds to the smaller of its present value and cookie-\n    //    age-limit.\n    // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)\n\n    // 6. If delta-seconds is less than or equal to zero (0), let expiry-\n    //    time be the earliest representable date and time.  Otherwise, let\n    //    the expiry-time be the current date and time plus delta-seconds\n    //    seconds.\n    // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds\n\n    // 7. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Max-Age and an attribute-value of expiry-time.\n    cookieAttributeList.maxAge = deltaSeconds\n  } else if (attributeNameLowercase === 'domain') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3\n    // If the attribute-name case-insensitively matches the string \"Domain\",\n    // the user agent MUST process the cookie-av as follows.\n\n    // 1. Let cookie-domain be the attribute-value.\n    let cookieDomain = attributeValue\n\n    // 2. If cookie-domain starts with %x2E (\".\"), let cookie-domain be\n    //    cookie-domain without its leading %x2E (\".\").\n    if (cookieDomain[0] === '.') {\n      cookieDomain = cookieDomain.slice(1)\n    }\n\n    // 3. Convert the cookie-domain to lower case.\n    cookieDomain = cookieDomain.toLowerCase()\n\n    // 4. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Domain and an attribute-value of cookie-domain.\n    cookieAttributeList.domain = cookieDomain\n  } else if (attributeNameLowercase === 'path') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4\n    // If the attribute-name case-insensitively matches the string \"Path\",\n    // the user agent MUST process the cookie-av as follows.\n\n    // 1. If the attribute-value is empty or if the first character of the\n    //    attribute-value is not %x2F (\"/\"):\n    let cookiePath = ''\n    if (attributeValue.length === 0 || attributeValue[0] !== '/') {\n      // 1. Let cookie-path be the default-path.\n      cookiePath = '/'\n    } else {\n      // Otherwise:\n\n      // 1. Let cookie-path be the attribute-value.\n      cookiePath = attributeValue\n    }\n\n    // 2. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Path and an attribute-value of cookie-path.\n    cookieAttributeList.path = cookiePath\n  } else if (attributeNameLowercase === 'secure') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5\n    // If the attribute-name case-insensitively matches the string \"Secure\",\n    // the user agent MUST append an attribute to the cookie-attribute-list\n    // with an attribute-name of Secure and an empty attribute-value.\n\n    cookieAttributeList.secure = true\n  } else if (attributeNameLowercase === 'httponly') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6\n    // If the attribute-name case-insensitively matches the string\n    // \"HttpOnly\", the user agent MUST append an attribute to the cookie-\n    // attribute-list with an attribute-name of HttpOnly and an empty\n    // attribute-value.\n\n    cookieAttributeList.httpOnly = true\n  } else if (attributeNameLowercase === 'samesite') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7\n    // If the attribute-name case-insensitively matches the string\n    // \"SameSite\", the user agent MUST process the cookie-av as follows:\n\n    const attributeValueLowercase = attributeValue.toLowerCase()\n\n    // 1. If cookie-av's attribute-value is a case-insensitive match for\n    //    \"None\", append an attribute to the cookie-attribute-list with an\n    //    attribute-name of \"SameSite\" and an attribute-value of \"None\".\n    if (attributeValueLowercase === 'none') {\n      cookieAttributeList.sameSite = 'None'\n    } else if (attributeValueLowercase === 'strict') {\n      // 2. If cookie-av's attribute-value is a case-insensitive match for\n      //    \"Strict\", append an attribute to the cookie-attribute-list with\n      //    an attribute-name of \"SameSite\" and an attribute-value of\n      //    \"Strict\".\n      cookieAttributeList.sameSite = 'Strict'\n    } else if (attributeValueLowercase === 'lax') {\n      // 3. If cookie-av's attribute-value is a case-insensitive match for\n      //    \"Lax\", append an attribute to the cookie-attribute-list with an\n      //    attribute-name of \"SameSite\" and an attribute-value of \"Lax\".\n      cookieAttributeList.sameSite = 'Lax'\n    }\n  } else {\n    cookieAttributeList.unparsed ??= []\n\n    cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)\n  }\n\n  // 8. Return to Step 1 of this algorithm.\n  return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n}\n\nmodule.exports = {\n  parseSetCookie,\n  parseUnparsedAttributes\n}\n","'use strict'\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction isCTLExcludingHtab (value) {\n  for (let i = 0; i < value.length; ++i) {\n    const code = value.charCodeAt(i)\n\n    if (\n      (code >= 0x00 && code <= 0x08) ||\n      (code >= 0x0A && code <= 0x1F) ||\n      code === 0x7F\n    ) {\n      return true\n    }\n  }\n  return false\n}\n\n/**\n CHAR           = \n token          = 1*\n separators     = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n                | \",\" | \";\" | \":\" | \"\\\" | <\">\n                | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n                | \"{\" | \"}\" | SP | HT\n * @param {string} name\n */\nfunction validateCookieName (name) {\n  for (let i = 0; i < name.length; ++i) {\n    const code = name.charCodeAt(i)\n\n    if (\n      code < 0x21 || // exclude CTLs (0-31), SP and HT\n      code > 0x7E || // exclude non-ascii and DEL\n      code === 0x22 || // \"\n      code === 0x28 || // (\n      code === 0x29 || // )\n      code === 0x3C || // <\n      code === 0x3E || // >\n      code === 0x40 || // @\n      code === 0x2C || // ,\n      code === 0x3B || // ;\n      code === 0x3A || // :\n      code === 0x5C || // \\\n      code === 0x2F || // /\n      code === 0x5B || // [\n      code === 0x5D || // ]\n      code === 0x3F || // ?\n      code === 0x3D || // =\n      code === 0x7B || // {\n      code === 0x7D // }\n    ) {\n      throw new Error('Invalid cookie name')\n    }\n  }\n}\n\n/**\n cookie-value      = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n cookie-octet      = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n                       ; US-ASCII characters excluding CTLs,\n                       ; whitespace DQUOTE, comma, semicolon,\n                       ; and backslash\n * @param {string} value\n */\nfunction validateCookieValue (value) {\n  let len = value.length\n  let i = 0\n\n  // if the value is wrapped in DQUOTE\n  if (value[0] === '\"') {\n    if (len === 1 || value[len - 1] !== '\"') {\n      throw new Error('Invalid cookie value')\n    }\n    --len\n    ++i\n  }\n\n  while (i < len) {\n    const code = value.charCodeAt(i++)\n\n    if (\n      code < 0x21 || // exclude CTLs (0-31)\n      code > 0x7E || // non-ascii and DEL (127)\n      code === 0x22 || // \"\n      code === 0x2C || // ,\n      code === 0x3B || // ;\n      code === 0x5C // \\\n    ) {\n      throw new Error('Invalid cookie value')\n    }\n  }\n}\n\n/**\n * path-value        = \n * @param {string} path\n */\nfunction validateCookiePath (path) {\n  for (let i = 0; i < path.length; ++i) {\n    const code = path.charCodeAt(i)\n\n    if (\n      code < 0x20 || // exclude CTLs (0-31)\n      code === 0x7F || // DEL\n      code === 0x3B // ;\n    ) {\n      throw new Error('Invalid cookie path')\n    }\n  }\n}\n\n/**\n * I have no idea why these values aren't allowed to be honest,\n * but Deno tests these. - Khafra\n * @param {string} domain\n */\nfunction validateCookieDomain (domain) {\n  if (\n    domain.startsWith('-') ||\n    domain.endsWith('.') ||\n    domain.endsWith('-')\n  ) {\n    throw new Error('Invalid cookie domain')\n  }\n}\n\nconst IMFDays = [\n  'Sun', 'Mon', 'Tue', 'Wed',\n  'Thu', 'Fri', 'Sat'\n]\n\nconst IMFMonths = [\n  'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n]\n\nconst IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1\n * @param {number|Date} date\n  IMF-fixdate  = day-name \",\" SP date1 SP time-of-day SP GMT\n  ; fixed length/zone/capitalization subset of the format\n  ; see Section 3.3 of [RFC5322]\n\n  day-name     = %x4D.6F.6E ; \"Mon\", case-sensitive\n              / %x54.75.65 ; \"Tue\", case-sensitive\n              / %x57.65.64 ; \"Wed\", case-sensitive\n              / %x54.68.75 ; \"Thu\", case-sensitive\n              / %x46.72.69 ; \"Fri\", case-sensitive\n              / %x53.61.74 ; \"Sat\", case-sensitive\n              / %x53.75.6E ; \"Sun\", case-sensitive\n  date1        = day SP month SP year\n                  ; e.g., 02 Jun 1982\n\n  day          = 2DIGIT\n  month        = %x4A.61.6E ; \"Jan\", case-sensitive\n              / %x46.65.62 ; \"Feb\", case-sensitive\n              / %x4D.61.72 ; \"Mar\", case-sensitive\n              / %x41.70.72 ; \"Apr\", case-sensitive\n              / %x4D.61.79 ; \"May\", case-sensitive\n              / %x4A.75.6E ; \"Jun\", case-sensitive\n              / %x4A.75.6C ; \"Jul\", case-sensitive\n              / %x41.75.67 ; \"Aug\", case-sensitive\n              / %x53.65.70 ; \"Sep\", case-sensitive\n              / %x4F.63.74 ; \"Oct\", case-sensitive\n              / %x4E.6F.76 ; \"Nov\", case-sensitive\n              / %x44.65.63 ; \"Dec\", case-sensitive\n  year         = 4DIGIT\n\n  GMT          = %x47.4D.54 ; \"GMT\", case-sensitive\n\n  time-of-day  = hour \":\" minute \":\" second\n              ; 00:00:00 - 23:59:60 (leap second)\n\n  hour         = 2DIGIT\n  minute       = 2DIGIT\n  second       = 2DIGIT\n */\nfunction toIMFDate (date) {\n  if (typeof date === 'number') {\n    date = new Date(date)\n  }\n\n  return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`\n}\n\n/**\n max-age-av        = \"Max-Age=\" non-zero-digit *DIGIT\n                       ; In practice, both expires-av and max-age-av\n                       ; are limited to dates representable by the\n                       ; user agent.\n * @param {number} maxAge\n */\nfunction validateCookieMaxAge (maxAge) {\n  if (maxAge < 0) {\n    throw new Error('Invalid cookie max-age')\n  }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1\n * @param {import('./index').Cookie} cookie\n */\nfunction stringify (cookie) {\n  if (cookie.name.length === 0) {\n    return null\n  }\n\n  validateCookieName(cookie.name)\n  validateCookieValue(cookie.value)\n\n  const out = [`${cookie.name}=${cookie.value}`]\n\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2\n  if (cookie.name.startsWith('__Secure-')) {\n    cookie.secure = true\n  }\n\n  if (cookie.name.startsWith('__Host-')) {\n    cookie.secure = true\n    cookie.domain = null\n    cookie.path = '/'\n  }\n\n  if (cookie.secure) {\n    out.push('Secure')\n  }\n\n  if (cookie.httpOnly) {\n    out.push('HttpOnly')\n  }\n\n  if (typeof cookie.maxAge === 'number') {\n    validateCookieMaxAge(cookie.maxAge)\n    out.push(`Max-Age=${cookie.maxAge}`)\n  }\n\n  if (cookie.domain) {\n    validateCookieDomain(cookie.domain)\n    out.push(`Domain=${cookie.domain}`)\n  }\n\n  if (cookie.path) {\n    validateCookiePath(cookie.path)\n    out.push(`Path=${cookie.path}`)\n  }\n\n  if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {\n    out.push(`Expires=${toIMFDate(cookie.expires)}`)\n  }\n\n  if (cookie.sameSite) {\n    out.push(`SameSite=${cookie.sameSite}`)\n  }\n\n  for (const part of cookie.unparsed) {\n    if (!part.includes('=')) {\n      throw new Error('Invalid unparsed')\n    }\n\n    const [key, ...value] = part.split('=')\n\n    out.push(`${key.trim()}=${value.join('=')}`)\n  }\n\n  return out.join('; ')\n}\n\nmodule.exports = {\n  isCTLExcludingHtab,\n  validateCookieName,\n  validateCookiePath,\n  validateCookieValue,\n  toIMFDate,\n  stringify\n}\n","'use strict'\nconst { Transform } = require('node:stream')\nconst { isASCIINumber, isValidLastEventId } = require('./util')\n\n/**\n * @type {number[]} BOM\n */\nconst BOM = [0xEF, 0xBB, 0xBF]\n/**\n * @type {10} LF\n */\nconst LF = 0x0A\n/**\n * @type {13} CR\n */\nconst CR = 0x0D\n/**\n * @type {58} COLON\n */\nconst COLON = 0x3A\n/**\n * @type {32} SPACE\n */\nconst SPACE = 0x20\n\n/**\n * @typedef {object} EventSourceStreamEvent\n * @type {object}\n * @property {string} [event] The event type.\n * @property {string} [data] The data of the message.\n * @property {string} [id] A unique ID for the event.\n * @property {string} [retry] The reconnection time, in milliseconds.\n */\n\n/**\n * @typedef eventSourceSettings\n * @type {object}\n * @property {string} lastEventId The last event ID received from the server.\n * @property {string} origin The origin of the event source.\n * @property {number} reconnectionTime The reconnection time, in milliseconds.\n */\n\nclass EventSourceStream extends Transform {\n  /**\n   * @type {eventSourceSettings}\n   */\n  state = null\n\n  /**\n   * Leading byte-order-mark check.\n   * @type {boolean}\n   */\n  checkBOM = true\n\n  /**\n   * @type {boolean}\n   */\n  crlfCheck = false\n\n  /**\n   * @type {boolean}\n   */\n  eventEndCheck = false\n\n  /**\n   * @type {Buffer}\n   */\n  buffer = null\n\n  pos = 0\n\n  event = {\n    data: undefined,\n    event: undefined,\n    id: undefined,\n    retry: undefined\n  }\n\n  /**\n   * @param {object} options\n   * @param {eventSourceSettings} options.eventSourceSettings\n   * @param {Function} [options.push]\n   */\n  constructor (options = {}) {\n    // Enable object mode as EventSourceStream emits objects of shape\n    // EventSourceStreamEvent\n    options.readableObjectMode = true\n\n    super(options)\n\n    this.state = options.eventSourceSettings || {}\n    if (options.push) {\n      this.push = options.push\n    }\n  }\n\n  /**\n   * @param {Buffer} chunk\n   * @param {string} _encoding\n   * @param {Function} callback\n   * @returns {void}\n   */\n  _transform (chunk, _encoding, callback) {\n    if (chunk.length === 0) {\n      callback()\n      return\n    }\n\n    // Cache the chunk in the buffer, as the data might not be complete while\n    // processing it\n    // TODO: Investigate if there is a more performant way to handle\n    // incoming chunks\n    // see: https://github.com/nodejs/undici/issues/2630\n    if (this.buffer) {\n      this.buffer = Buffer.concat([this.buffer, chunk])\n    } else {\n      this.buffer = chunk\n    }\n\n    // Strip leading byte-order-mark if we opened the stream and started\n    // the processing of the incoming data\n    if (this.checkBOM) {\n      switch (this.buffer.length) {\n        case 1:\n          // Check if the first byte is the same as the first byte of the BOM\n          if (this.buffer[0] === BOM[0]) {\n            // If it is, we need to wait for more data\n            callback()\n            return\n          }\n          // Set the checkBOM flag to false as we don't need to check for the\n          // BOM anymore\n          this.checkBOM = false\n\n          // The buffer only contains one byte so we need to wait for more data\n          callback()\n          return\n        case 2:\n          // Check if the first two bytes are the same as the first two bytes\n          // of the BOM\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1]\n          ) {\n            // If it is, we need to wait for more data, because the third byte\n            // is needed to determine if it is the BOM or not\n            callback()\n            return\n          }\n\n          // Set the checkBOM flag to false as we don't need to check for the\n          // BOM anymore\n          this.checkBOM = false\n          break\n        case 3:\n          // Check if the first three bytes are the same as the first three\n          // bytes of the BOM\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1] &&\n            this.buffer[2] === BOM[2]\n          ) {\n            // If it is, we can drop the buffered data, as it is only the BOM\n            this.buffer = Buffer.alloc(0)\n            // Set the checkBOM flag to false as we don't need to check for the\n            // BOM anymore\n            this.checkBOM = false\n\n            // Await more data\n            callback()\n            return\n          }\n          // If it is not the BOM, we can start processing the data\n          this.checkBOM = false\n          break\n        default:\n          // The buffer is longer than 3 bytes, so we can drop the BOM if it is\n          // present\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1] &&\n            this.buffer[2] === BOM[2]\n          ) {\n            // Remove the BOM from the buffer\n            this.buffer = this.buffer.subarray(3)\n          }\n\n          // Set the checkBOM flag to false as we don't need to check for the\n          this.checkBOM = false\n          break\n      }\n    }\n\n    while (this.pos < this.buffer.length) {\n      // If the previous line ended with an end-of-line, we need to check\n      // if the next character is also an end-of-line.\n      if (this.eventEndCheck) {\n        // If the the current character is an end-of-line, then the event\n        // is finished and we can process it\n\n        // If the previous line ended with a carriage return, we need to\n        // check if the current character is a line feed and remove it\n        // from the buffer.\n        if (this.crlfCheck) {\n          // If the current character is a line feed, we can remove it\n          // from the buffer and reset the crlfCheck flag\n          if (this.buffer[this.pos] === LF) {\n            this.buffer = this.buffer.subarray(this.pos + 1)\n            this.pos = 0\n            this.crlfCheck = false\n\n            // It is possible that the line feed is not the end of the\n            // event. We need to check if the next character is an\n            // end-of-line character to determine if the event is\n            // finished. We simply continue the loop to check the next\n            // character.\n\n            // As we removed the line feed from the buffer and set the\n            // crlfCheck flag to false, we basically don't make any\n            // distinction between a line feed and a carriage return.\n            continue\n          }\n          this.crlfCheck = false\n        }\n\n        if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n          // If the current character is a carriage return, we need to\n          // set the crlfCheck flag to true, as we need to check if the\n          // next character is a line feed so we can remove it from the\n          // buffer\n          if (this.buffer[this.pos] === CR) {\n            this.crlfCheck = true\n          }\n\n          this.buffer = this.buffer.subarray(this.pos + 1)\n          this.pos = 0\n          if (\n            this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {\n            this.processEvent(this.event)\n          }\n          this.clearEvent()\n          continue\n        }\n        // If the current character is not an end-of-line, then the event\n        // is not finished and we have to reset the eventEndCheck flag\n        this.eventEndCheck = false\n        continue\n      }\n\n      // If the current character is an end-of-line, we can process the\n      // line\n      if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n        // If the current character is a carriage return, we need to\n        // set the crlfCheck flag to true, as we need to check if the\n        // next character is a line feed\n        if (this.buffer[this.pos] === CR) {\n          this.crlfCheck = true\n        }\n\n        // In any case, we can process the line as we reached an\n        // end-of-line character\n        this.parseLine(this.buffer.subarray(0, this.pos), this.event)\n\n        // Remove the processed line from the buffer\n        this.buffer = this.buffer.subarray(this.pos + 1)\n        // Reset the position as we removed the processed line from the buffer\n        this.pos = 0\n        // A line was processed and this could be the end of the event. We need\n        // to check if the next line is empty to determine if the event is\n        // finished.\n        this.eventEndCheck = true\n        continue\n      }\n\n      this.pos++\n    }\n\n    callback()\n  }\n\n  /**\n   * @param {Buffer} line\n   * @param {EventStreamEvent} event\n   */\n  parseLine (line, event) {\n    // If the line is empty (a blank line)\n    // Dispatch the event, as defined below.\n    // This will be handled in the _transform method\n    if (line.length === 0) {\n      return\n    }\n\n    // If the line starts with a U+003A COLON character (:)\n    // Ignore the line.\n    const colonPosition = line.indexOf(COLON)\n    if (colonPosition === 0) {\n      return\n    }\n\n    let field = ''\n    let value = ''\n\n    // If the line contains a U+003A COLON character (:)\n    if (colonPosition !== -1) {\n      // Collect the characters on the line before the first U+003A COLON\n      // character (:), and let field be that string.\n      // TODO: Investigate if there is a more performant way to extract the\n      // field\n      // see: https://github.com/nodejs/undici/issues/2630\n      field = line.subarray(0, colonPosition).toString('utf8')\n\n      // Collect the characters on the line after the first U+003A COLON\n      // character (:), and let value be that string.\n      // If value starts with a U+0020 SPACE character, remove it from value.\n      let valueStart = colonPosition + 1\n      if (line[valueStart] === SPACE) {\n        ++valueStart\n      }\n      // TODO: Investigate if there is a more performant way to extract the\n      // value\n      // see: https://github.com/nodejs/undici/issues/2630\n      value = line.subarray(valueStart).toString('utf8')\n\n      // Otherwise, the string is not empty but does not contain a U+003A COLON\n      // character (:)\n    } else {\n      // Process the field using the steps described below, using the whole\n      // line as the field name, and the empty string as the field value.\n      field = line.toString('utf8')\n      value = ''\n    }\n\n    // Modify the event with the field name and value. The value is also\n    // decoded as UTF-8\n    switch (field) {\n      case 'data':\n        if (event[field] === undefined) {\n          event[field] = value\n        } else {\n          event[field] += `\\n${value}`\n        }\n        break\n      case 'retry':\n        if (isASCIINumber(value)) {\n          event[field] = value\n        }\n        break\n      case 'id':\n        if (isValidLastEventId(value)) {\n          event[field] = value\n        }\n        break\n      case 'event':\n        if (value.length > 0) {\n          event[field] = value\n        }\n        break\n    }\n  }\n\n  /**\n   * @param {EventSourceStreamEvent} event\n   */\n  processEvent (event) {\n    if (event.retry && isASCIINumber(event.retry)) {\n      this.state.reconnectionTime = parseInt(event.retry, 10)\n    }\n\n    if (event.id && isValidLastEventId(event.id)) {\n      this.state.lastEventId = event.id\n    }\n\n    // only dispatch event, when data is provided\n    if (event.data !== undefined) {\n      this.push({\n        type: event.event || 'message',\n        options: {\n          data: event.data,\n          lastEventId: this.state.lastEventId,\n          origin: this.state.origin\n        }\n      })\n    }\n  }\n\n  clearEvent () {\n    this.event = {\n      data: undefined,\n      event: undefined,\n      id: undefined,\n      retry: undefined\n    }\n  }\n}\n\nmodule.exports = {\n  EventSourceStream\n}\n","'use strict'\n\nconst { pipeline } = require('node:stream')\nconst { fetching } = require('../fetch')\nconst { makeRequest } = require('../fetch/request')\nconst { webidl } = require('../fetch/webidl')\nconst { EventSourceStream } = require('./eventsource-stream')\nconst { parseMIMEType } = require('../fetch/data-url')\nconst { createFastMessageEvent } = require('../websocket/events')\nconst { isNetworkError } = require('../fetch/response')\nconst { delay } = require('./util')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { environmentSettingsObject } = require('../fetch/util')\n\nlet experimentalWarned = false\n\n/**\n * A reconnection time, in milliseconds. This must initially be an implementation-defined value,\n * probably in the region of a few seconds.\n *\n * In Comparison:\n * - Chrome uses 3000ms.\n * - Deno uses 5000ms.\n *\n * @type {3000}\n */\nconst defaultReconnectionTime = 3000\n\n/**\n * The readyState attribute represents the state of the connection.\n * @enum\n * @readonly\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev\n */\n\n/**\n * The connection has not yet been established, or it was closed and the user\n * agent is reconnecting.\n * @type {0}\n */\nconst CONNECTING = 0\n\n/**\n * The user agent has an open connection and is dispatching events as it\n * receives them.\n * @type {1}\n */\nconst OPEN = 1\n\n/**\n * The connection is not open, and the user agent is not trying to reconnect.\n * @type {2}\n */\nconst CLOSED = 2\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"same-origin\".\n * @type {'anonymous'}\n */\nconst ANONYMOUS = 'anonymous'\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"include\".\n * @type {'use-credentials'}\n */\nconst USE_CREDENTIALS = 'use-credentials'\n\n/**\n * The EventSource interface is used to receive server-sent events. It\n * connects to a server over HTTP and receives events in text/event-stream\n * format without closing the connection.\n * @extends {EventTarget}\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events\n * @api public\n */\nclass EventSource extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    message: null\n  }\n\n  #url = null\n  #withCredentials = false\n\n  #readyState = CONNECTING\n\n  #request = null\n  #controller = null\n\n  #dispatcher\n\n  /**\n   * @type {import('./eventsource-stream').eventSourceSettings}\n   */\n  #state\n\n  /**\n   * Creates a new EventSource object.\n   * @param {string} url\n   * @param {EventSourceInit} [eventSourceInitDict]\n   * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface\n   */\n  constructor (url, eventSourceInitDict = {}) {\n    // 1. Let ev be a new EventSource object.\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'EventSource constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    if (!experimentalWarned) {\n      experimentalWarned = true\n      process.emitWarning('EventSource is experimental, expect them to change at any time.', {\n        code: 'UNDICI-ES'\n      })\n    }\n\n    url = webidl.converters.USVString(url, prefix, 'url')\n    eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')\n\n    this.#dispatcher = eventSourceInitDict.dispatcher\n    this.#state = {\n      lastEventId: '',\n      reconnectionTime: defaultReconnectionTime\n    }\n\n    // 2. Let settings be ev's relevant settings object.\n    // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object\n    const settings = environmentSettingsObject\n\n    let urlRecord\n\n    try {\n      // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.\n      urlRecord = new URL(url, settings.settingsObject.baseUrl)\n      this.#state.origin = urlRecord.origin\n    } catch (e) {\n      // 4. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n      throw new DOMException(e, 'SyntaxError')\n    }\n\n    // 5. Set ev's url to urlRecord.\n    this.#url = urlRecord.href\n\n    // 6. Let corsAttributeState be Anonymous.\n    let corsAttributeState = ANONYMOUS\n\n    // 7. If the value of eventSourceInitDict's withCredentials member is true,\n    // then set corsAttributeState to Use Credentials and set ev's\n    // withCredentials attribute to true.\n    if (eventSourceInitDict.withCredentials) {\n      corsAttributeState = USE_CREDENTIALS\n      this.#withCredentials = true\n    }\n\n    // 8. Let request be the result of creating a potential-CORS request given\n    // urlRecord, the empty string, and corsAttributeState.\n    const initRequest = {\n      redirect: 'follow',\n      keepalive: true,\n      // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes\n      mode: 'cors',\n      credentials: corsAttributeState === 'anonymous'\n        ? 'same-origin'\n        : 'omit',\n      referrer: 'no-referrer'\n    }\n\n    // 9. Set request's client to settings.\n    initRequest.client = environmentSettingsObject.settingsObject\n\n    // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.\n    initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]]\n\n    // 11. Set request's cache mode to \"no-store\".\n    initRequest.cache = 'no-store'\n\n    // 12. Set request's initiator type to \"other\".\n    initRequest.initiator = 'other'\n\n    initRequest.urlList = [new URL(this.#url)]\n\n    // 13. Set ev's request to request.\n    this.#request = makeRequest(initRequest)\n\n    this.#connect()\n  }\n\n  /**\n   * Returns the state of this EventSource object's connection. It can have the\n   * values described below.\n   * @returns {0|1|2}\n   * @readonly\n   */\n  get readyState () {\n    return this.#readyState\n  }\n\n  /**\n   * Returns the URL providing the event stream.\n   * @readonly\n   * @returns {string}\n   */\n  get url () {\n    return this.#url\n  }\n\n  /**\n   * Returns a boolean indicating whether the EventSource object was\n   * instantiated with CORS credentials set (true), or not (false, the default).\n   */\n  get withCredentials () {\n    return this.#withCredentials\n  }\n\n  #connect () {\n    if (this.#readyState === CLOSED) return\n\n    this.#readyState = CONNECTING\n\n    const fetchParams = {\n      request: this.#request,\n      dispatcher: this.#dispatcher\n    }\n\n    // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.\n    const processEventSourceEndOfBody = (response) => {\n      if (isNetworkError(response)) {\n        this.dispatchEvent(new Event('error'))\n        this.close()\n      }\n\n      this.#reconnect()\n    }\n\n    // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...\n    fetchParams.processResponseEndOfBody = processEventSourceEndOfBody\n\n    // and processResponse set to the following steps given response res:\n    fetchParams.processResponse = (response) => {\n      // 1. If res is an aborted network error, then fail the connection.\n\n      if (isNetworkError(response)) {\n        // 1. When a user agent is to fail the connection, the user agent\n        // must queue a task which, if the readyState attribute is set to a\n        // value other than CLOSED, sets the readyState attribute to CLOSED\n        // and fires an event named error at the EventSource object. Once the\n        // user agent has failed the connection, it does not attempt to\n        // reconnect.\n        if (response.aborted) {\n          this.close()\n          this.dispatchEvent(new Event('error'))\n          return\n          // 2. Otherwise, if res is a network error, then reestablish the\n          // connection, unless the user agent knows that to be futile, in\n          // which case the user agent may fail the connection.\n        } else {\n          this.#reconnect()\n          return\n        }\n      }\n\n      // 3. Otherwise, if res's status is not 200, or if res's `Content-Type`\n      // is not `text/event-stream`, then fail the connection.\n      const contentType = response.headersList.get('content-type', true)\n      const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'\n      const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'\n      if (\n        response.status !== 200 ||\n        contentTypeValid === false\n      ) {\n        this.close()\n        this.dispatchEvent(new Event('error'))\n        return\n      }\n\n      // 4. Otherwise, announce the connection and interpret res's body\n      // line by line.\n\n      // When a user agent is to announce the connection, the user agent\n      // must queue a task which, if the readyState attribute is set to a\n      // value other than CLOSED, sets the readyState attribute to OPEN\n      // and fires an event named open at the EventSource object.\n      // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n      this.#readyState = OPEN\n      this.dispatchEvent(new Event('open'))\n\n      // If redirected to a different origin, set the origin to the new origin.\n      this.#state.origin = response.urlList[response.urlList.length - 1].origin\n\n      const eventSourceStream = new EventSourceStream({\n        eventSourceSettings: this.#state,\n        push: (event) => {\n          this.dispatchEvent(createFastMessageEvent(\n            event.type,\n            event.options\n          ))\n        }\n      })\n\n      pipeline(response.body.stream,\n        eventSourceStream,\n        (error) => {\n          if (\n            error?.aborted === false\n          ) {\n            this.close()\n            this.dispatchEvent(new Event('error'))\n          }\n        })\n    }\n\n    this.#controller = fetching(fetchParams)\n  }\n\n  /**\n   * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n   * @returns {Promise}\n   */\n  async #reconnect () {\n    // When a user agent is to reestablish the connection, the user agent must\n    // run the following steps. These steps are run in parallel, not as part of\n    // a task. (The tasks that it queues, of course, are run like normal tasks\n    // and not themselves in parallel.)\n\n    // 1. Queue a task to run the following steps:\n\n    //   1. If the readyState attribute is set to CLOSED, abort the task.\n    if (this.#readyState === CLOSED) return\n\n    //   2. Set the readyState attribute to CONNECTING.\n    this.#readyState = CONNECTING\n\n    //   3. Fire an event named error at the EventSource object.\n    this.dispatchEvent(new Event('error'))\n\n    // 2. Wait a delay equal to the reconnection time of the event source.\n    await delay(this.#state.reconnectionTime)\n\n    // 5. Queue a task to run the following steps:\n\n    //   1. If the EventSource object's readyState attribute is not set to\n    //      CONNECTING, then return.\n    if (this.#readyState !== CONNECTING) return\n\n    //   2. Let request be the EventSource object's request.\n    //   3. If the EventSource object's last event ID string is not the empty\n    //      string, then:\n    //      1. Let lastEventIDValue be the EventSource object's last event ID\n    //         string, encoded as UTF-8.\n    //      2. Set (`Last-Event-ID`, lastEventIDValue) in request's header\n    //         list.\n    if (this.#state.lastEventId.length) {\n      this.#request.headersList.set('last-event-id', this.#state.lastEventId, true)\n    }\n\n    //   4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.\n    this.#connect()\n  }\n\n  /**\n   * Closes the connection, if any, and sets the readyState attribute to\n   * CLOSED.\n   */\n  close () {\n    webidl.brandCheck(this, EventSource)\n\n    if (this.#readyState === CLOSED) return\n    this.#readyState = CLOSED\n    this.#controller.abort()\n    this.#request = null\n  }\n\n  get onopen () {\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.open = fn\n      this.addEventListener('open', fn)\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onmessage () {\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.message = fn\n      this.addEventListener('message', fn)\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get onerror () {\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this.#events.error = null\n    }\n  }\n}\n\nconst constantsPropertyDescriptors = {\n  CONNECTING: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: CONNECTING,\n    writable: false\n  },\n  OPEN: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: OPEN,\n    writable: false\n  },\n  CLOSED: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: CLOSED,\n    writable: false\n  }\n}\n\nObject.defineProperties(EventSource, constantsPropertyDescriptors)\nObject.defineProperties(EventSource.prototype, constantsPropertyDescriptors)\n\nObject.defineProperties(EventSource.prototype, {\n  close: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  url: kEnumerableProperty,\n  withCredentials: kEnumerableProperty\n})\n\nwebidl.converters.EventSourceInitDict = webidl.dictionaryConverter([\n  {\n    key: 'withCredentials',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'dispatcher', // undici only\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = {\n  EventSource,\n  defaultReconnectionTime\n}\n","'use strict'\n\n/**\n * Checks if the given value is a valid LastEventId.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isValidLastEventId (value) {\n  // LastEventId should not contain U+0000 NULL\n  return value.indexOf('\\u0000') === -1\n}\n\n/**\n * Checks if the given value is a base 10 digit.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isASCIINumber (value) {\n  if (value.length === 0) return false\n  for (let i = 0; i < value.length; i++) {\n    if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false\n  }\n  return true\n}\n\n// https://github.com/nodejs/undici/issues/2664\nfunction delay (ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms).unref()\n  })\n}\n\nmodule.exports = {\n  isValidLastEventId,\n  isASCIINumber,\n  delay\n}\n","'use strict'\n\nconst util = require('../../core/util')\nconst {\n  ReadableStreamFrom,\n  isBlobLike,\n  isReadableStreamLike,\n  readableStreamClose,\n  createDeferredPromise,\n  fullyReadBody,\n  extractMimeType,\n  utf8DecodeBytes\n} = require('./util')\nconst { FormData } = require('./formdata')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { Blob } = require('node:buffer')\nconst assert = require('node:assert')\nconst { isErrored, isDisturbed } = require('node:stream')\nconst { isArrayBuffer } = require('node:util/types')\nconst { serializeAMimeType } = require('./data-url')\nconst { multipartFormDataParser } = require('./formdata-parser')\nlet random\n\ntry {\n  const crypto = require('node:crypto')\n  random = (max) => crypto.randomInt(0, max)\n} catch {\n  random = (max) => Math.floor(Math.random(max))\n}\n\nconst textEncoder = new TextEncoder()\nfunction noop () {}\n\nconst hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0\nlet streamRegistry\n\nif (hasFinalizationRegistry) {\n  streamRegistry = new FinalizationRegistry((weakRef) => {\n    const stream = weakRef.deref()\n    if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {\n      stream.cancel('Response object has been garbage collected').catch(noop)\n    }\n  })\n}\n\n// https://fetch.spec.whatwg.org/#concept-bodyinit-extract\nfunction extractBody (object, keepalive = false) {\n  // 1. Let stream be null.\n  let stream = null\n\n  // 2. If object is a ReadableStream object, then set stream to object.\n  if (object instanceof ReadableStream) {\n    stream = object\n  } else if (isBlobLike(object)) {\n    // 3. Otherwise, if object is a Blob object, set stream to the\n    //    result of running object’s get stream.\n    stream = object.stream()\n  } else {\n    // 4. Otherwise, set stream to a new ReadableStream object, and set\n    //    up stream with byte reading support.\n    stream = new ReadableStream({\n      async pull (controller) {\n        const buffer = typeof source === 'string' ? textEncoder.encode(source) : source\n\n        if (buffer.byteLength) {\n          controller.enqueue(buffer)\n        }\n\n        queueMicrotask(() => readableStreamClose(controller))\n      },\n      start () {},\n      type: 'bytes'\n    })\n  }\n\n  // 5. Assert: stream is a ReadableStream object.\n  assert(isReadableStreamLike(stream))\n\n  // 6. Let action be null.\n  let action = null\n\n  // 7. Let source be null.\n  let source = null\n\n  // 8. Let length be null.\n  let length = null\n\n  // 9. Let type be null.\n  let type = null\n\n  // 10. Switch on object:\n  if (typeof object === 'string') {\n    // Set source to the UTF-8 encoding of object.\n    // Note: setting source to a Uint8Array here breaks some mocking assumptions.\n    source = object\n\n    // Set type to `text/plain;charset=UTF-8`.\n    type = 'text/plain;charset=UTF-8'\n  } else if (object instanceof URLSearchParams) {\n    // URLSearchParams\n\n    // spec says to run application/x-www-form-urlencoded on body.list\n    // this is implemented in Node.js as apart of an URLSearchParams instance toString method\n    // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490\n    // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100\n\n    // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.\n    source = object.toString()\n\n    // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.\n    type = 'application/x-www-form-urlencoded;charset=UTF-8'\n  } else if (isArrayBuffer(object)) {\n    // BufferSource/ArrayBuffer\n\n    // Set source to a copy of the bytes held by object.\n    source = new Uint8Array(object.slice())\n  } else if (ArrayBuffer.isView(object)) {\n    // BufferSource/ArrayBufferView\n\n    // Set source to a copy of the bytes held by object.\n    source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))\n  } else if (util.isFormDataLike(object)) {\n    const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`\n    const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n    /*! formdata-polyfill. MIT License. Jimmy Wärting  */\n    const escape = (str) =>\n      str.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n    const normalizeLinefeeds = (value) => value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n\n    // Set action to this step: run the multipart/form-data\n    // encoding algorithm, with object’s entry list and UTF-8.\n    // - This ensures that the body is immutable and can't be changed afterwords\n    // - That the content-length is calculated in advance.\n    // - And that all parts are pre-encoded and ready to be sent.\n\n    const blobParts = []\n    const rn = new Uint8Array([13, 10]) // '\\r\\n'\n    length = 0\n    let hasUnknownSizeValue = false\n\n    for (const [name, value] of object) {\n      if (typeof value === 'string') {\n        const chunk = textEncoder.encode(prefix +\n          `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`)\n        blobParts.push(chunk)\n        length += chunk.byteLength\n      } else {\n        const chunk = textEncoder.encode(`${prefix}; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          (value.name ? `; filename=\"${escape(value.name)}\"` : '') + '\\r\\n' +\n          `Content-Type: ${\n            value.type || 'application/octet-stream'\n          }\\r\\n\\r\\n`)\n        blobParts.push(chunk, value, rn)\n        if (typeof value.size === 'number') {\n          length += chunk.byteLength + value.size + rn.byteLength\n        } else {\n          hasUnknownSizeValue = true\n        }\n      }\n    }\n\n    // CRLF is appended to the body to function with legacy servers and match other implementations.\n    // https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030\n    // https://github.com/form-data/form-data/issues/63\n    const chunk = textEncoder.encode(`--${boundary}--\\r\\n`)\n    blobParts.push(chunk)\n    length += chunk.byteLength\n    if (hasUnknownSizeValue) {\n      length = null\n    }\n\n    // Set source to object.\n    source = object\n\n    action = async function * () {\n      for (const part of blobParts) {\n        if (part.stream) {\n          yield * part.stream()\n        } else {\n          yield part\n        }\n      }\n    }\n\n    // Set type to `multipart/form-data; boundary=`,\n    // followed by the multipart/form-data boundary string generated\n    // by the multipart/form-data encoding algorithm.\n    type = `multipart/form-data; boundary=${boundary}`\n  } else if (isBlobLike(object)) {\n    // Blob\n\n    // Set source to object.\n    source = object\n\n    // Set length to object’s size.\n    length = object.size\n\n    // If object’s type attribute is not the empty byte sequence, set\n    // type to its value.\n    if (object.type) {\n      type = object.type\n    }\n  } else if (typeof object[Symbol.asyncIterator] === 'function') {\n    // If keepalive is true, then throw a TypeError.\n    if (keepalive) {\n      throw new TypeError('keepalive')\n    }\n\n    // If object is disturbed or locked, then throw a TypeError.\n    if (util.isDisturbed(object) || object.locked) {\n      throw new TypeError(\n        'Response body object should not be disturbed or locked'\n      )\n    }\n\n    stream =\n      object instanceof ReadableStream ? object : ReadableStreamFrom(object)\n  }\n\n  // 11. If source is a byte sequence, then set action to a\n  // step that returns source and length to source’s length.\n  if (typeof source === 'string' || util.isBuffer(source)) {\n    length = Buffer.byteLength(source)\n  }\n\n  // 12. If action is non-null, then run these steps in in parallel:\n  if (action != null) {\n    // Run action.\n    let iterator\n    stream = new ReadableStream({\n      async start () {\n        iterator = action(object)[Symbol.asyncIterator]()\n      },\n      async pull (controller) {\n        const { value, done } = await iterator.next()\n        if (done) {\n          // When running action is done, close stream.\n          queueMicrotask(() => {\n            controller.close()\n            controller.byobRequest?.respond(0)\n          })\n        } else {\n          // Whenever one or more bytes are available and stream is not errored,\n          // enqueue a Uint8Array wrapping an ArrayBuffer containing the available\n          // bytes into stream.\n          if (!isErrored(stream)) {\n            const buffer = new Uint8Array(value)\n            if (buffer.byteLength) {\n              controller.enqueue(buffer)\n            }\n          }\n        }\n        return controller.desiredSize > 0\n      },\n      async cancel (reason) {\n        await iterator.return()\n      },\n      type: 'bytes'\n    })\n  }\n\n  // 13. Let body be a body whose stream is stream, source is source,\n  // and length is length.\n  const body = { stream, source, length }\n\n  // 14. Return (body, type).\n  return [body, type]\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit-safely-extract\nfunction safelyExtractBody (object, keepalive = false) {\n  // To safely extract a body and a `Content-Type` value from\n  // a byte sequence or BodyInit object object, run these steps:\n\n  // 1. If object is a ReadableStream object, then:\n  if (object instanceof ReadableStream) {\n    // Assert: object is neither disturbed nor locked.\n    // istanbul ignore next\n    assert(!util.isDisturbed(object), 'The body has already been consumed.')\n    // istanbul ignore next\n    assert(!object.locked, 'The stream is locked.')\n  }\n\n  // 2. Return the results of extracting object.\n  return extractBody(object, keepalive)\n}\n\nfunction cloneBody (instance, body) {\n  // To clone a body body, run these steps:\n\n  // https://fetch.spec.whatwg.org/#concept-body-clone\n\n  // 1. Let « out1, out2 » be the result of teeing body’s stream.\n  const [out1, out2] = body.stream.tee()\n\n  // 2. Set body’s stream to out1.\n  body.stream = out1\n\n  // 3. Return a body whose stream is out2 and other members are copied from body.\n  return {\n    stream: out2,\n    length: body.length,\n    source: body.source\n  }\n}\n\nfunction throwIfAborted (state) {\n  if (state.aborted) {\n    throw new DOMException('The operation was aborted.', 'AbortError')\n  }\n}\n\nfunction bodyMixinMethods (instance) {\n  const methods = {\n    blob () {\n      // The blob() method steps are to return the result of\n      // running consume body with this and the following step\n      // given a byte sequence bytes: return a Blob whose\n      // contents are bytes and whose type attribute is this’s\n      // MIME type.\n      return consumeBody(this, (bytes) => {\n        let mimeType = bodyMimeType(this)\n\n        if (mimeType === null) {\n          mimeType = ''\n        } else if (mimeType) {\n          mimeType = serializeAMimeType(mimeType)\n        }\n\n        // Return a Blob whose contents are bytes and type attribute\n        // is mimeType.\n        return new Blob([bytes], { type: mimeType })\n      }, instance)\n    },\n\n    arrayBuffer () {\n      // The arrayBuffer() method steps are to return the result\n      // of running consume body with this and the following step\n      // given a byte sequence bytes: return a new ArrayBuffer\n      // whose contents are bytes.\n      return consumeBody(this, (bytes) => {\n        return new Uint8Array(bytes).buffer\n      }, instance)\n    },\n\n    text () {\n      // The text() method steps are to return the result of running\n      // consume body with this and UTF-8 decode.\n      return consumeBody(this, utf8DecodeBytes, instance)\n    },\n\n    json () {\n      // The json() method steps are to return the result of running\n      // consume body with this and parse JSON from bytes.\n      return consumeBody(this, parseJSONFromBytes, instance)\n    },\n\n    formData () {\n      // The formData() method steps are to return the result of running\n      // consume body with this and the following step given a byte sequence bytes:\n      return consumeBody(this, (value) => {\n        // 1. Let mimeType be the result of get the MIME type with this.\n        const mimeType = bodyMimeType(this)\n\n        // 2. If mimeType is non-null, then switch on mimeType’s essence and run\n        //    the corresponding steps:\n        if (mimeType !== null) {\n          switch (mimeType.essence) {\n            case 'multipart/form-data': {\n              // 1. ... [long step]\n              const parsed = multipartFormDataParser(value, mimeType)\n\n              // 2. If that fails for some reason, then throw a TypeError.\n              if (parsed === 'failure') {\n                throw new TypeError('Failed to parse body as FormData.')\n              }\n\n              // 3. Return a new FormData object, appending each entry,\n              //    resulting from the parsing operation, to its entry list.\n              const fd = new FormData()\n              fd[kState] = parsed\n\n              return fd\n            }\n            case 'application/x-www-form-urlencoded': {\n              // 1. Let entries be the result of parsing bytes.\n              const entries = new URLSearchParams(value.toString())\n\n              // 2. If entries is failure, then throw a TypeError.\n\n              // 3. Return a new FormData object whose entry list is entries.\n              const fd = new FormData()\n\n              for (const [name, value] of entries) {\n                fd.append(name, value)\n              }\n\n              return fd\n            }\n          }\n        }\n\n        // 3. Throw a TypeError.\n        throw new TypeError(\n          'Content-Type was not one of \"multipart/form-data\" or \"application/x-www-form-urlencoded\".'\n        )\n      }, instance)\n    },\n\n    bytes () {\n      // The bytes() method steps are to return the result of running consume body\n      // with this and the following step given a byte sequence bytes: return the\n      // result of creating a Uint8Array from bytes in this’s relevant realm.\n      return consumeBody(this, (bytes) => {\n        return new Uint8Array(bytes)\n      }, instance)\n    }\n  }\n\n  return methods\n}\n\nfunction mixinBody (prototype) {\n  Object.assign(prototype.prototype, bodyMixinMethods(prototype))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-consume-body\n * @param {Response|Request} object\n * @param {(value: unknown) => unknown} convertBytesToJSValue\n * @param {Response|Request} instance\n */\nasync function consumeBody (object, convertBytesToJSValue, instance) {\n  webidl.brandCheck(object, instance)\n\n  // 1. If object is unusable, then return a promise rejected\n  //    with a TypeError.\n  if (bodyUnusable(object)) {\n    throw new TypeError('Body is unusable: Body has already been read')\n  }\n\n  throwIfAborted(object[kState])\n\n  // 2. Let promise be a new promise.\n  const promise = createDeferredPromise()\n\n  // 3. Let errorSteps given error be to reject promise with error.\n  const errorSteps = (error) => promise.reject(error)\n\n  // 4. Let successSteps given a byte sequence data be to resolve\n  //    promise with the result of running convertBytesToJSValue\n  //    with data. If that threw an exception, then run errorSteps\n  //    with that exception.\n  const successSteps = (data) => {\n    try {\n      promise.resolve(convertBytesToJSValue(data))\n    } catch (e) {\n      errorSteps(e)\n    }\n  }\n\n  // 5. If object’s body is null, then run successSteps with an\n  //    empty byte sequence.\n  if (object[kState].body == null) {\n    successSteps(Buffer.allocUnsafe(0))\n    return promise.promise\n  }\n\n  // 6. Otherwise, fully read object’s body given successSteps,\n  //    errorSteps, and object’s relevant global object.\n  await fullyReadBody(object[kState].body, successSteps, errorSteps)\n\n  // 7. Return promise.\n  return promise.promise\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction bodyUnusable (object) {\n  const body = object[kState].body\n\n  // An object including the Body interface mixin is\n  // said to be unusable if its body is non-null and\n  // its body’s stream is disturbed or locked.\n  return body != null && (body.stream.locked || util.isDisturbed(body.stream))\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value\n * @param {Uint8Array} bytes\n */\nfunction parseJSONFromBytes (bytes) {\n  return JSON.parse(utf8DecodeBytes(bytes))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-mime-type\n * @param {import('./response').Response|import('./request').Request} requestOrResponse\n */\nfunction bodyMimeType (requestOrResponse) {\n  // 1. Let headers be null.\n  // 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.\n  // 3. Otherwise, set headers to requestOrResponse’s response’s header list.\n  /** @type {import('./headers').HeadersList} */\n  const headers = requestOrResponse[kState].headersList\n\n  // 4. Let mimeType be the result of extracting a MIME type from headers.\n  const mimeType = extractMimeType(headers)\n\n  // 5. If mimeType is failure, then return null.\n  if (mimeType === 'failure') {\n    return null\n  }\n\n  // 6. Return mimeType.\n  return mimeType\n}\n\nmodule.exports = {\n  extractBody,\n  safelyExtractBody,\n  cloneBody,\n  mixinBody,\n  streamRegistry,\n  hasFinalizationRegistry,\n  bodyUnusable\n}\n","'use strict'\n\nconst corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])\n\nconst redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])\nconst redirectStatusSet = new Set(redirectStatus)\n\n/**\n * @see https://fetch.spec.whatwg.org/#block-bad-port\n */\nconst badPorts = /** @type {const} */ ([\n  '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n  '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n  '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n  '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n  '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',\n  '6697', '10080'\n])\nconst badPortsSet = new Set(badPorts)\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\n */\nconst referrerPolicy = /** @type {const} */ ([\n  '',\n  'no-referrer',\n  'no-referrer-when-downgrade',\n  'same-origin',\n  'origin',\n  'strict-origin',\n  'origin-when-cross-origin',\n  'strict-origin-when-cross-origin',\n  'unsafe-url'\n])\nconst referrerPolicySet = new Set(referrerPolicy)\n\nconst requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])\n\nconst safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])\n\nconst requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])\n\nconst requestCache = /** @type {const} */ ([\n  'default',\n  'no-store',\n  'reload',\n  'no-cache',\n  'force-cache',\n  'only-if-cached'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-body-header-name\n */\nconst requestBodyHeader = /** @type {const} */ ([\n  'content-encoding',\n  'content-language',\n  'content-location',\n  'content-type',\n  // See https://github.com/nodejs/undici/issues/2021\n  // 'Content-Length' is a forbidden header name, which is typically\n  // removed in the Headers implementation. However, undici doesn't\n  // filter out headers, so we add it here.\n  'content-length'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex\n */\nconst requestDuplex = /** @type {const} */ ([\n  'half'\n])\n\n/**\n * @see http://fetch.spec.whatwg.org/#forbidden-method\n */\nconst forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = /** @type {const} */ ([\n  'audio',\n  'audioworklet',\n  'font',\n  'image',\n  'manifest',\n  'paintworklet',\n  'script',\n  'style',\n  'track',\n  'video',\n  'xslt',\n  ''\n])\nconst subresourceSet = new Set(subresource)\n\nmodule.exports = {\n  subresource,\n  forbiddenMethods,\n  requestBodyHeader,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  redirectStatus,\n  corsSafeListedMethods,\n  nullBodyStatus,\n  safeMethods,\n  badPorts,\n  requestDuplex,\n  subresourceSet,\n  badPortsSet,\n  redirectStatusSet,\n  corsSafeListedMethodsSet,\n  safeMethodsSet,\n  forbiddenMethodsSet,\n  referrerPolicySet\n}\n","'use strict'\n\nconst assert = require('node:assert')\n\nconst encoder = new TextEncoder()\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-token-code-point\n */\nconst HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\\-.^_|~A-Za-z0-9]+$/\nconst HTTP_WHITESPACE_REGEX = /[\\u000A\\u000D\\u0009\\u0020]/ // eslint-disable-line\nconst ASCII_WHITESPACE_REPLACE_REGEX = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/g // eslint-disable-line\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point\n */\nconst HTTP_QUOTED_STRING_TOKENS = /^[\\u0009\\u0020-\\u007E\\u0080-\\u00FF]+$/ // eslint-disable-line\n\n// https://fetch.spec.whatwg.org/#data-url-processor\n/** @param {URL} dataURL */\nfunction dataURLProcessor (dataURL) {\n  // 1. Assert: dataURL’s scheme is \"data\".\n  assert(dataURL.protocol === 'data:')\n\n  // 2. Let input be the result of running the URL\n  // serializer on dataURL with exclude fragment\n  // set to true.\n  let input = URLSerializer(dataURL, true)\n\n  // 3. Remove the leading \"data:\" string from input.\n  input = input.slice(5)\n\n  // 4. Let position point at the start of input.\n  const position = { position: 0 }\n\n  // 5. Let mimeType be the result of collecting a\n  // sequence of code points that are not equal\n  // to U+002C (,), given position.\n  let mimeType = collectASequenceOfCodePointsFast(\n    ',',\n    input,\n    position\n  )\n\n  // 6. Strip leading and trailing ASCII whitespace\n  // from mimeType.\n  // Undici implementation note: we need to store the\n  // length because if the mimetype has spaces removed,\n  // the wrong amount will be sliced from the input in\n  // step #9\n  const mimeTypeLength = mimeType.length\n  mimeType = removeASCIIWhitespace(mimeType, true, true)\n\n  // 7. If position is past the end of input, then\n  // return failure\n  if (position.position >= input.length) {\n    return 'failure'\n  }\n\n  // 8. Advance position by 1.\n  position.position++\n\n  // 9. Let encodedBody be the remainder of input.\n  const encodedBody = input.slice(mimeTypeLength + 1)\n\n  // 10. Let body be the percent-decoding of encodedBody.\n  let body = stringPercentDecode(encodedBody)\n\n  // 11. If mimeType ends with U+003B (;), followed by\n  // zero or more U+0020 SPACE, followed by an ASCII\n  // case-insensitive match for \"base64\", then:\n  if (/;(\\u0020){0,}base64$/i.test(mimeType)) {\n    // 1. Let stringBody be the isomorphic decode of body.\n    const stringBody = isomorphicDecode(body)\n\n    // 2. Set body to the forgiving-base64 decode of\n    // stringBody.\n    body = forgivingBase64(stringBody)\n\n    // 3. If body is failure, then return failure.\n    if (body === 'failure') {\n      return 'failure'\n    }\n\n    // 4. Remove the last 6 code points from mimeType.\n    mimeType = mimeType.slice(0, -6)\n\n    // 5. Remove trailing U+0020 SPACE code points from mimeType,\n    // if any.\n    mimeType = mimeType.replace(/(\\u0020)+$/, '')\n\n    // 6. Remove the last U+003B (;) code point from mimeType.\n    mimeType = mimeType.slice(0, -1)\n  }\n\n  // 12. If mimeType starts with U+003B (;), then prepend\n  // \"text/plain\" to mimeType.\n  if (mimeType.startsWith(';')) {\n    mimeType = 'text/plain' + mimeType\n  }\n\n  // 13. Let mimeTypeRecord be the result of parsing\n  // mimeType.\n  let mimeTypeRecord = parseMIMEType(mimeType)\n\n  // 14. If mimeTypeRecord is failure, then set\n  // mimeTypeRecord to text/plain;charset=US-ASCII.\n  if (mimeTypeRecord === 'failure') {\n    mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')\n  }\n\n  // 15. Return a new data: URL struct whose MIME\n  // type is mimeTypeRecord and body is body.\n  // https://fetch.spec.whatwg.org/#data-url-struct\n  return { mimeType: mimeTypeRecord, body }\n}\n\n// https://url.spec.whatwg.org/#concept-url-serializer\n/**\n * @param {URL} url\n * @param {boolean} excludeFragment\n */\nfunction URLSerializer (url, excludeFragment = false) {\n  if (!excludeFragment) {\n    return url.href\n  }\n\n  const href = url.href\n  const hashLength = url.hash.length\n\n  const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength)\n\n  if (!hashLength && href.endsWith('#')) {\n    return serialized.slice(0, -1)\n  }\n\n  return serialized\n}\n\n// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n/**\n * @param {(char: string) => boolean} condition\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePoints (condition, input, position) {\n  // 1. Let result be the empty string.\n  let result = ''\n\n  // 2. While position doesn’t point past the end of input and the\n  // code point at position within input meets the condition condition:\n  while (position.position < input.length && condition(input[position.position])) {\n    // 1. Append that code point to the end of result.\n    result += input[position.position]\n\n    // 2. Advance position by 1.\n    position.position++\n  }\n\n  // 3. Return result.\n  return result\n}\n\n/**\n * A faster collectASequenceOfCodePoints that only works when comparing a single character.\n * @param {string} char\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePointsFast (char, input, position) {\n  const idx = input.indexOf(char, position.position)\n  const start = position.position\n\n  if (idx === -1) {\n    position.position = input.length\n    return input.slice(start)\n  }\n\n  position.position = idx\n  return input.slice(start, position.position)\n}\n\n// https://url.spec.whatwg.org/#string-percent-decode\n/** @param {string} input */\nfunction stringPercentDecode (input) {\n  // 1. Let bytes be the UTF-8 encoding of input.\n  const bytes = encoder.encode(input)\n\n  // 2. Return the percent-decoding of bytes.\n  return percentDecode(bytes)\n}\n\n/**\n * @param {number} byte\n */\nfunction isHexCharByte (byte) {\n  // 0-9 A-F a-f\n  return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66)\n}\n\n/**\n * @param {number} byte\n */\nfunction hexByteToNumber (byte) {\n  return (\n    // 0-9\n    byte >= 0x30 && byte <= 0x39\n      ? (byte - 48)\n    // Convert to uppercase\n    // ((byte & 0xDF) - 65) + 10\n      : ((byte & 0xDF) - 55)\n  )\n}\n\n// https://url.spec.whatwg.org/#percent-decode\n/** @param {Uint8Array} input */\nfunction percentDecode (input) {\n  const length = input.length\n  // 1. Let output be an empty byte sequence.\n  /** @type {Uint8Array} */\n  const output = new Uint8Array(length)\n  let j = 0\n  // 2. For each byte byte in input:\n  for (let i = 0; i < length; ++i) {\n    const byte = input[i]\n\n    // 1. If byte is not 0x25 (%), then append byte to output.\n    if (byte !== 0x25) {\n      output[j++] = byte\n\n    // 2. Otherwise, if byte is 0x25 (%) and the next two bytes\n    // after byte in input are not in the ranges\n    // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),\n    // and 0x61 (a) to 0x66 (f), all inclusive, append byte\n    // to output.\n    } else if (\n      byte === 0x25 &&\n      !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))\n    ) {\n      output[j++] = 0x25\n\n    // 3. Otherwise:\n    } else {\n      // 1. Let bytePoint be the two bytes after byte in input,\n      // decoded, and then interpreted as hexadecimal number.\n      // 2. Append a byte whose value is bytePoint to output.\n      output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2])\n\n      // 3. Skip the next two bytes in input.\n      i += 2\n    }\n  }\n\n  // 3. Return output.\n  return length === j ? output : output.subarray(0, j)\n}\n\n// https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n/** @param {string} input */\nfunction parseMIMEType (input) {\n  // 1. Remove any leading and trailing HTTP whitespace\n  // from input.\n  input = removeHTTPWhitespace(input, true, true)\n\n  // 2. Let position be a position variable for input,\n  // initially pointing at the start of input.\n  const position = { position: 0 }\n\n  // 3. Let type be the result of collecting a sequence\n  // of code points that are not U+002F (/) from\n  // input, given position.\n  const type = collectASequenceOfCodePointsFast(\n    '/',\n    input,\n    position\n  )\n\n  // 4. If type is the empty string or does not solely\n  // contain HTTP token code points, then return failure.\n  // https://mimesniff.spec.whatwg.org/#http-token-code-point\n  if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n    return 'failure'\n  }\n\n  // 5. If position is past the end of input, then return\n  // failure\n  if (position.position > input.length) {\n    return 'failure'\n  }\n\n  // 6. Advance position by 1. (This skips past U+002F (/).)\n  position.position++\n\n  // 7. Let subtype be the result of collecting a sequence of\n  // code points that are not U+003B (;) from input, given\n  // position.\n  let subtype = collectASequenceOfCodePointsFast(\n    ';',\n    input,\n    position\n  )\n\n  // 8. Remove any trailing HTTP whitespace from subtype.\n  subtype = removeHTTPWhitespace(subtype, false, true)\n\n  // 9. If subtype is the empty string or does not solely\n  // contain HTTP token code points, then return failure.\n  if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n    return 'failure'\n  }\n\n  const typeLowercase = type.toLowerCase()\n  const subtypeLowercase = subtype.toLowerCase()\n\n  // 10. Let mimeType be a new MIME type record whose type\n  // is type, in ASCII lowercase, and subtype is subtype,\n  // in ASCII lowercase.\n  // https://mimesniff.spec.whatwg.org/#mime-type\n  const mimeType = {\n    type: typeLowercase,\n    subtype: subtypeLowercase,\n    /** @type {Map} */\n    parameters: new Map(),\n    // https://mimesniff.spec.whatwg.org/#mime-type-essence\n    essence: `${typeLowercase}/${subtypeLowercase}`\n  }\n\n  // 11. While position is not past the end of input:\n  while (position.position < input.length) {\n    // 1. Advance position by 1. (This skips past U+003B (;).)\n    position.position++\n\n    // 2. Collect a sequence of code points that are HTTP\n    // whitespace from input given position.\n    collectASequenceOfCodePoints(\n      // https://fetch.spec.whatwg.org/#http-whitespace\n      char => HTTP_WHITESPACE_REGEX.test(char),\n      input,\n      position\n    )\n\n    // 3. Let parameterName be the result of collecting a\n    // sequence of code points that are not U+003B (;)\n    // or U+003D (=) from input, given position.\n    let parameterName = collectASequenceOfCodePoints(\n      (char) => char !== ';' && char !== '=',\n      input,\n      position\n    )\n\n    // 4. Set parameterName to parameterName, in ASCII\n    // lowercase.\n    parameterName = parameterName.toLowerCase()\n\n    // 5. If position is not past the end of input, then:\n    if (position.position < input.length) {\n      // 1. If the code point at position within input is\n      // U+003B (;), then continue.\n      if (input[position.position] === ';') {\n        continue\n      }\n\n      // 2. Advance position by 1. (This skips past U+003D (=).)\n      position.position++\n    }\n\n    // 6. If position is past the end of input, then break.\n    if (position.position > input.length) {\n      break\n    }\n\n    // 7. Let parameterValue be null.\n    let parameterValue = null\n\n    // 8. If the code point at position within input is\n    // U+0022 (\"), then:\n    if (input[position.position] === '\"') {\n      // 1. Set parameterValue to the result of collecting\n      // an HTTP quoted string from input, given position\n      // and the extract-value flag.\n      parameterValue = collectAnHTTPQuotedString(input, position, true)\n\n      // 2. Collect a sequence of code points that are not\n      // U+003B (;) from input, given position.\n      collectASequenceOfCodePointsFast(\n        ';',\n        input,\n        position\n      )\n\n    // 9. Otherwise:\n    } else {\n      // 1. Set parameterValue to the result of collecting\n      // a sequence of code points that are not U+003B (;)\n      // from input, given position.\n      parameterValue = collectASequenceOfCodePointsFast(\n        ';',\n        input,\n        position\n      )\n\n      // 2. Remove any trailing HTTP whitespace from parameterValue.\n      parameterValue = removeHTTPWhitespace(parameterValue, false, true)\n\n      // 3. If parameterValue is the empty string, then continue.\n      if (parameterValue.length === 0) {\n        continue\n      }\n    }\n\n    // 10. If all of the following are true\n    // - parameterName is not the empty string\n    // - parameterName solely contains HTTP token code points\n    // - parameterValue solely contains HTTP quoted-string token code points\n    // - mimeType’s parameters[parameterName] does not exist\n    // then set mimeType’s parameters[parameterName] to parameterValue.\n    if (\n      parameterName.length !== 0 &&\n      HTTP_TOKEN_CODEPOINTS.test(parameterName) &&\n      (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&\n      !mimeType.parameters.has(parameterName)\n    ) {\n      mimeType.parameters.set(parameterName, parameterValue)\n    }\n  }\n\n  // 12. Return mimeType.\n  return mimeType\n}\n\n// https://infra.spec.whatwg.org/#forgiving-base64-decode\n/** @param {string} data */\nfunction forgivingBase64 (data) {\n  // 1. Remove all ASCII whitespace from data.\n  data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '')  // eslint-disable-line\n\n  let dataLength = data.length\n  // 2. If data’s code point length divides by 4 leaving\n  // no remainder, then:\n  if (dataLength % 4 === 0) {\n    // 1. If data ends with one or two U+003D (=) code points,\n    // then remove them from data.\n    if (data.charCodeAt(dataLength - 1) === 0x003D) {\n      --dataLength\n      if (data.charCodeAt(dataLength - 1) === 0x003D) {\n        --dataLength\n      }\n    }\n  }\n\n  // 3. If data’s code point length divides by 4 leaving\n  // a remainder of 1, then return failure.\n  if (dataLength % 4 === 1) {\n    return 'failure'\n  }\n\n  // 4. If data contains a code point that is not one of\n  //  U+002B (+)\n  //  U+002F (/)\n  //  ASCII alphanumeric\n  // then return failure.\n  if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {\n    return 'failure'\n  }\n\n  const buffer = Buffer.from(data, 'base64')\n  return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\n// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string\n// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string\n/**\n * @param {string} input\n * @param {{ position: number }} position\n * @param {boolean?} extractValue\n */\nfunction collectAnHTTPQuotedString (input, position, extractValue) {\n  // 1. Let positionStart be position.\n  const positionStart = position.position\n\n  // 2. Let value be the empty string.\n  let value = ''\n\n  // 3. Assert: the code point at position within input\n  // is U+0022 (\").\n  assert(input[position.position] === '\"')\n\n  // 4. Advance position by 1.\n  position.position++\n\n  // 5. While true:\n  while (true) {\n    // 1. Append the result of collecting a sequence of code points\n    // that are not U+0022 (\") or U+005C (\\) from input, given\n    // position, to value.\n    value += collectASequenceOfCodePoints(\n      (char) => char !== '\"' && char !== '\\\\',\n      input,\n      position\n    )\n\n    // 2. If position is past the end of input, then break.\n    if (position.position >= input.length) {\n      break\n    }\n\n    // 3. Let quoteOrBackslash be the code point at position within\n    // input.\n    const quoteOrBackslash = input[position.position]\n\n    // 4. Advance position by 1.\n    position.position++\n\n    // 5. If quoteOrBackslash is U+005C (\\), then:\n    if (quoteOrBackslash === '\\\\') {\n      // 1. If position is past the end of input, then append\n      // U+005C (\\) to value and break.\n      if (position.position >= input.length) {\n        value += '\\\\'\n        break\n      }\n\n      // 2. Append the code point at position within input to value.\n      value += input[position.position]\n\n      // 3. Advance position by 1.\n      position.position++\n\n    // 6. Otherwise:\n    } else {\n      // 1. Assert: quoteOrBackslash is U+0022 (\").\n      assert(quoteOrBackslash === '\"')\n\n      // 2. Break.\n      break\n    }\n  }\n\n  // 6. If the extract-value flag is set, then return value.\n  if (extractValue) {\n    return value\n  }\n\n  // 7. Return the code points from positionStart to position,\n  // inclusive, within input.\n  return input.slice(positionStart, position.position)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serializeAMimeType (mimeType) {\n  assert(mimeType !== 'failure')\n  const { parameters, essence } = mimeType\n\n  // 1. Let serialization be the concatenation of mimeType’s\n  //    type, U+002F (/), and mimeType’s subtype.\n  let serialization = essence\n\n  // 2. For each name → value of mimeType’s parameters:\n  for (let [name, value] of parameters.entries()) {\n    // 1. Append U+003B (;) to serialization.\n    serialization += ';'\n\n    // 2. Append name to serialization.\n    serialization += name\n\n    // 3. Append U+003D (=) to serialization.\n    serialization += '='\n\n    // 4. If value does not solely contain HTTP token code\n    //    points or value is the empty string, then:\n    if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n      // 1. Precede each occurrence of U+0022 (\") or\n      //    U+005C (\\) in value with U+005C (\\).\n      value = value.replace(/(\\\\|\")/g, '\\\\$1')\n\n      // 2. Prepend U+0022 (\") to value.\n      value = '\"' + value\n\n      // 3. Append U+0022 (\") to value.\n      value += '\"'\n    }\n\n    // 5. Append value to serialization.\n    serialization += value\n  }\n\n  // 3. Return serialization.\n  return serialization\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {number} char\n */\nfunction isHTTPWhiteSpace (char) {\n  // \"\\r\\n\\t \"\n  return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeHTTPWhitespace (str, leading = true, trailing = true) {\n  return removeChars(str, leading, trailing, isHTTPWhiteSpace)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n * @param {number} char\n */\nfunction isASCIIWhitespace (char) {\n  // \"\\r\\n\\t\\f \"\n  return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x00c || char === 0x020\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeASCIIWhitespace (str, leading = true, trailing = true) {\n  return removeChars(str, leading, trailing, isASCIIWhitespace)\n}\n\n/**\n * @param {string} str\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns\n */\nfunction removeChars (str, leading, trailing, predicate) {\n  let lead = 0\n  let trail = str.length - 1\n\n  if (leading) {\n    while (lead < str.length && predicate(str.charCodeAt(lead))) lead++\n  }\n\n  if (trailing) {\n    while (trail > 0 && predicate(str.charCodeAt(trail))) trail--\n  }\n\n  return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-decode\n * @param {Uint8Array} input\n * @returns {string}\n */\nfunction isomorphicDecode (input) {\n  // 1. To isomorphic decode a byte sequence input, return a string whose code point\n  //    length is equal to input’s length and whose code points have the same values\n  //    as the values of input’s bytes, in the same order.\n  const length = input.length\n  if ((2 << 15) - 1 > length) {\n    return String.fromCharCode.apply(null, input)\n  }\n  let result = ''; let i = 0\n  let addition = (2 << 15) - 1\n  while (i < length) {\n    if (i + addition > length) {\n      addition = length - i\n    }\n    result += String.fromCharCode.apply(null, input.subarray(i, i += addition))\n  }\n  return result\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type\n * @param {Exclude, 'failure'>} mimeType\n */\nfunction minimizeSupportedMimeType (mimeType) {\n  switch (mimeType.essence) {\n    case 'application/ecmascript':\n    case 'application/javascript':\n    case 'application/x-ecmascript':\n    case 'application/x-javascript':\n    case 'text/ecmascript':\n    case 'text/javascript':\n    case 'text/javascript1.0':\n    case 'text/javascript1.1':\n    case 'text/javascript1.2':\n    case 'text/javascript1.3':\n    case 'text/javascript1.4':\n    case 'text/javascript1.5':\n    case 'text/jscript':\n    case 'text/livescript':\n    case 'text/x-ecmascript':\n    case 'text/x-javascript':\n      // 1. If mimeType is a JavaScript MIME type, then return \"text/javascript\".\n      return 'text/javascript'\n    case 'application/json':\n    case 'text/json':\n      // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n      return 'application/json'\n    case 'image/svg+xml':\n      // 3. If mimeType’s essence is \"image/svg+xml\", then return \"image/svg+xml\".\n      return 'image/svg+xml'\n    case 'text/xml':\n    case 'application/xml':\n      // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n      return 'application/xml'\n  }\n\n  // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n  if (mimeType.subtype.endsWith('+json')) {\n    return 'application/json'\n  }\n\n  // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n  if (mimeType.subtype.endsWith('+xml')) {\n    return 'application/xml'\n  }\n\n  // 5. If mimeType is supported by the user agent, then return mimeType’s essence.\n  // Technically, node doesn't support any mimetypes.\n\n  // 6. Return the empty string.\n  return ''\n}\n\nmodule.exports = {\n  dataURLProcessor,\n  URLSerializer,\n  collectASequenceOfCodePoints,\n  collectASequenceOfCodePointsFast,\n  stringPercentDecode,\n  parseMIMEType,\n  collectAnHTTPQuotedString,\n  serializeAMimeType,\n  removeChars,\n  removeHTTPWhitespace,\n  minimizeSupportedMimeType,\n  HTTP_TOKEN_CODEPOINTS,\n  isomorphicDecode\n}\n","'use strict'\n\nconst { kConnected, kSize } = require('../../core/symbols')\n\nclass CompatWeakRef {\n  constructor (value) {\n    this.value = value\n  }\n\n  deref () {\n    return this.value[kConnected] === 0 && this.value[kSize] === 0\n      ? undefined\n      : this.value\n  }\n}\n\nclass CompatFinalizer {\n  constructor (finalizer) {\n    this.finalizer = finalizer\n  }\n\n  register (dispatcher, key) {\n    if (dispatcher.on) {\n      dispatcher.on('disconnect', () => {\n        if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {\n          this.finalizer(key)\n        }\n      })\n    }\n  }\n\n  unregister (key) {}\n}\n\nmodule.exports = function () {\n  // FIXME: remove workaround when the Node bug is backported to v18\n  // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\n  if (process.env.NODE_V8_COVERAGE && process.version.startsWith('v18')) {\n    process._rawDebug('Using compatibility WeakRef and FinalizationRegistry')\n    return {\n      WeakRef: CompatWeakRef,\n      FinalizationRegistry: CompatFinalizer\n    }\n  }\n  return { WeakRef, FinalizationRegistry }\n}\n","'use strict'\n\nconst { Blob, File } = require('node:buffer')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\n\n// TODO(@KhafraDev): remove\nclass FileLike {\n  constructor (blobLike, fileName, options = {}) {\n    // TODO: argument idl type check\n\n    // The File constructor is invoked with two or three parameters, depending\n    // on whether the optional dictionary parameter is used. When the File()\n    // constructor is invoked, user agents must run the following steps:\n\n    // 1. Let bytes be the result of processing blob parts given fileBits and\n    // options.\n\n    // 2. Let n be the fileName argument to the constructor.\n    const n = fileName\n\n    // 3. Process FilePropertyBag dictionary argument by running the following\n    // substeps:\n\n    //    1. If the type member is provided and is not the empty string, let t\n    //    be set to the type dictionary member. If t contains any characters\n    //    outside the range U+0020 to U+007E, then set t to the empty string\n    //    and return from these substeps.\n    //    TODO\n    const t = options.type\n\n    //    2. Convert every character in t to ASCII lowercase.\n    //    TODO\n\n    //    3. If the lastModified member is provided, let d be set to the\n    //    lastModified dictionary member. If it is not provided, set d to the\n    //    current date and time represented as the number of milliseconds since\n    //    the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n    const d = options.lastModified ?? Date.now()\n\n    // 4. Return a new File object F such that:\n    // F refers to the bytes byte sequence.\n    // F.size is set to the number of total bytes in bytes.\n    // F.name is set to n.\n    // F.type is set to t.\n    // F.lastModified is set to d.\n\n    this[kState] = {\n      blobLike,\n      name: n,\n      type: t,\n      lastModified: d\n    }\n  }\n\n  stream (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.stream(...args)\n  }\n\n  arrayBuffer (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.arrayBuffer(...args)\n  }\n\n  slice (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.slice(...args)\n  }\n\n  text (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.text(...args)\n  }\n\n  get size () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.size\n  }\n\n  get type () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.type\n  }\n\n  get name () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].name\n  }\n\n  get lastModified () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].lastModified\n  }\n\n  get [Symbol.toStringTag] () {\n    return 'File'\n  }\n}\n\nwebidl.converters.Blob = webidl.interfaceConverter(Blob)\n\n// If this function is moved to ./util.js, some tools (such as\n// rollup) will warn about circular dependencies. See:\n// https://github.com/nodejs/undici/issues/1629\nfunction isFileLike (object) {\n  return (\n    (object instanceof File) ||\n    (\n      object &&\n      (typeof object.stream === 'function' ||\n      typeof object.arrayBuffer === 'function') &&\n      object[Symbol.toStringTag] === 'File'\n    )\n  )\n}\n\nmodule.exports = { FileLike, isFileLike }\n","'use strict'\n\nconst { isUSVString, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { utf8DecodeBytes } = require('./util')\nconst { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require('./data-url')\nconst { isFileLike } = require('./file')\nconst { makeEntry } = require('./formdata')\nconst assert = require('node:assert')\nconst { File: NodeFile } = require('node:buffer')\n\nconst File = globalThis.File ?? NodeFile\n\nconst formDataNameBuffer = Buffer.from('form-data; name=\"')\nconst filenameBuffer = Buffer.from('; filename')\nconst dd = Buffer.from('--')\nconst ddcrlf = Buffer.from('--\\r\\n')\n\n/**\n * @param {string} chars\n */\nfunction isAsciiString (chars) {\n  for (let i = 0; i < chars.length; ++i) {\n    if ((chars.charCodeAt(i) & ~0x7F) !== 0) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary\n * @param {string} boundary\n */\nfunction validateBoundary (boundary) {\n  const length = boundary.length\n\n  // - its length is greater or equal to 27 and lesser or equal to 70, and\n  if (length < 27 || length > 70) {\n    return false\n  }\n\n  // - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or\n  //   0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),\n  //   0x2D (-) or 0x5F (_).\n  for (let i = 0; i < length; ++i) {\n    const cp = boundary.charCodeAt(i)\n\n    if (!(\n      (cp >= 0x30 && cp <= 0x39) ||\n      (cp >= 0x41 && cp <= 0x5a) ||\n      (cp >= 0x61 && cp <= 0x7a) ||\n      cp === 0x27 ||\n      cp === 0x2d ||\n      cp === 0x5f\n    )) {\n      return false\n    }\n  }\n\n  return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser\n * @param {Buffer} input\n * @param {ReturnType} mimeType\n */\nfunction multipartFormDataParser (input, mimeType) {\n  // 1. Assert: mimeType’s essence is \"multipart/form-data\".\n  assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')\n\n  const boundaryString = mimeType.parameters.get('boundary')\n\n  // 2. If mimeType’s parameters[\"boundary\"] does not exist, return failure.\n  //    Otherwise, let boundary be the result of UTF-8 decoding mimeType’s\n  //    parameters[\"boundary\"].\n  if (boundaryString === undefined) {\n    return 'failure'\n  }\n\n  const boundary = Buffer.from(`--${boundaryString}`, 'utf8')\n\n  // 3. Let entry list be an empty entry list.\n  const entryList = []\n\n  // 4. Let position be a pointer to a byte in input, initially pointing at\n  //    the first byte.\n  const position = { position: 0 }\n\n  // Note: undici addition, allows leading and trailing CRLFs.\n  while (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n    position.position += 2\n  }\n\n  let trailing = input.length\n\n  while (input[trailing - 1] === 0x0a && input[trailing - 2] === 0x0d) {\n    trailing -= 2\n  }\n\n  if (trailing !== input.length) {\n    input = input.subarray(0, trailing)\n  }\n\n  // 5. While true:\n  while (true) {\n    // 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D\n    //      (`--`) followed by boundary, advance position by 2 + the length of\n    //      boundary. Otherwise, return failure.\n    // Note: boundary is padded with 2 dashes already, no need to add 2.\n    if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {\n      position.position += boundary.length\n    } else {\n      return 'failure'\n    }\n\n    // 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A\n    //      (`--` followed by CR LF) followed by the end of input, return entry list.\n    // Note: a body does NOT need to end with CRLF. It can end with --.\n    if (\n      (position.position === input.length - 2 && bufferStartsWith(input, dd, position)) ||\n      (position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position))\n    ) {\n      return entryList\n    }\n\n    // 5.3. If position does not point to a sequence of bytes starting with 0x0D\n    //      0x0A (CR LF), return failure.\n    if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    }\n\n    // 5.4. Advance position by 2. (This skips past the newline.)\n    position.position += 2\n\n    // 5.5. Let name, filename and contentType be the result of parsing\n    //      multipart/form-data headers on input and position, if the result\n    //      is not failure. Otherwise, return failure.\n    const result = parseMultipartFormDataHeaders(input, position)\n\n    if (result === 'failure') {\n      return 'failure'\n    }\n\n    let { name, filename, contentType, encoding } = result\n\n    // 5.6. Advance position by 2. (This skips past the empty line that marks\n    //      the end of the headers.)\n    position.position += 2\n\n    // 5.7. Let body be the empty byte sequence.\n    let body\n\n    // 5.8. Body loop: While position is not past the end of input:\n    // TODO: the steps here are completely wrong\n    {\n      const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)\n\n      if (boundaryIndex === -1) {\n        return 'failure'\n      }\n\n      body = input.subarray(position.position, boundaryIndex - 4)\n\n      position.position += body.length\n\n      // Note: position must be advanced by the body's length before being\n      // decoded, otherwise the parsing will fail.\n      if (encoding === 'base64') {\n        body = Buffer.from(body.toString(), 'base64')\n      }\n    }\n\n    // 5.9. If position does not point to a sequence of bytes starting with\n    //      0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.\n    if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    } else {\n      position.position += 2\n    }\n\n    // 5.10. If filename is not null:\n    let value\n\n    if (filename !== null) {\n      // 5.10.1. If contentType is null, set contentType to \"text/plain\".\n      contentType ??= 'text/plain'\n\n      // 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.\n\n      // Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.\n      // Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.\n      if (!isAsciiString(contentType)) {\n        contentType = ''\n      }\n\n      // 5.10.3. Let value be a new File object with name filename, type contentType, and body body.\n      value = new File([body], filename, { type: contentType })\n    } else {\n      // 5.11. Otherwise:\n\n      // 5.11.1. Let value be the UTF-8 decoding without BOM of body.\n      value = utf8DecodeBytes(Buffer.from(body))\n    }\n\n    // 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.\n    assert(isUSVString(name))\n    assert((typeof value === 'string' && isUSVString(value)) || isFileLike(value))\n\n    // 5.13. Create an entry with name and value, and append it to entry list.\n    entryList.push(makeEntry(name, value, filename))\n  }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataHeaders (input, position) {\n  // 1. Let name, filename and contentType be null.\n  let name = null\n  let filename = null\n  let contentType = null\n  let encoding = null\n\n  // 2. While true:\n  while (true) {\n    // 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):\n    if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n      // 2.1.1. If name is null, return failure.\n      if (name === null) {\n        return 'failure'\n      }\n\n      // 2.1.2. Return name, filename and contentType.\n      return { name, filename, contentType, encoding }\n    }\n\n    // 2.2. Let header name be the result of collecting a sequence of bytes that are\n    //      not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.\n    let headerName = collectASequenceOfBytes(\n      (char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,\n      input,\n      position\n    )\n\n    // 2.3. Remove any HTTP tab or space bytes from the start or end of header name.\n    headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)\n\n    // 2.4. If header name does not match the field-name token production, return failure.\n    if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {\n      return 'failure'\n    }\n\n    // 2.5. If the byte at position is not 0x3A (:), return failure.\n    if (input[position.position] !== 0x3a) {\n      return 'failure'\n    }\n\n    // 2.6. Advance position by 1.\n    position.position++\n\n    // 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.\n    //      (Do nothing with those bytes.)\n    collectASequenceOfBytes(\n      (char) => char === 0x20 || char === 0x09,\n      input,\n      position\n    )\n\n    // 2.8. Byte-lowercase header name and switch on the result:\n    switch (bufferToLowerCasedHeaderName(headerName)) {\n      case 'content-disposition': {\n        // 1. Set name and filename to null.\n        name = filename = null\n\n        // 2. If position does not point to a sequence of bytes starting with\n        //    `form-data; name=\"`, return failure.\n        if (!bufferStartsWith(input, formDataNameBuffer, position)) {\n          return 'failure'\n        }\n\n        // 3. Advance position so it points at the byte after the next 0x22 (\")\n        //    byte (the one in the sequence of bytes matched above).\n        position.position += 17\n\n        // 4. Set name to the result of parsing a multipart/form-data name given\n        //    input and position, if the result is not failure. Otherwise, return\n        //    failure.\n        name = parseMultipartFormDataName(input, position)\n\n        if (name === null) {\n          return 'failure'\n        }\n\n        // 5. If position points to a sequence of bytes starting with `; filename=\"`:\n        if (bufferStartsWith(input, filenameBuffer, position)) {\n          // Note: undici also handles filename*\n          let check = position.position + filenameBuffer.length\n\n          if (input[check] === 0x2a) {\n            position.position += 1\n            check += 1\n          }\n\n          if (input[check] !== 0x3d || input[check + 1] !== 0x22) { // =\"\n            return 'failure'\n          }\n\n          // 1. Advance position so it points at the byte after the next 0x22 (\") byte\n          //    (the one in the sequence of bytes matched above).\n          position.position += 12\n\n          // 2. Set filename to the result of parsing a multipart/form-data name given\n          //    input and position, if the result is not failure. Otherwise, return failure.\n          filename = parseMultipartFormDataName(input, position)\n\n          if (filename === null) {\n            return 'failure'\n          }\n        }\n\n        break\n      }\n      case 'content-type': {\n        // 1. Let header value be the result of collecting a sequence of bytes that are\n        //    not 0x0A (LF) or 0x0D (CR), given position.\n        let headerValue = collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n\n        // 2. Remove any HTTP tab or space bytes from the end of header value.\n        headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n        // 3. Set contentType to the isomorphic decoding of header value.\n        contentType = isomorphicDecode(headerValue)\n\n        break\n      }\n      case 'content-transfer-encoding': {\n        let headerValue = collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n\n        headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n        encoding = isomorphicDecode(headerValue)\n\n        break\n      }\n      default: {\n        // Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.\n        // (Do nothing with those bytes.)\n        collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n      }\n    }\n\n    // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A\n    //      (CR LF), return failure. Otherwise, advance position by 2 (past the newline).\n    if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    } else {\n      position.position += 2\n    }\n  }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-a-multipart-form-data-name\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataName (input, position) {\n  // 1. Assert: The byte at (position - 1) is 0x22 (\").\n  assert(input[position.position - 1] === 0x22)\n\n  // 2. Let name be the result of collecting a sequence of bytes that are not 0x0A (LF), 0x0D (CR) or 0x22 (\"), given position.\n  /** @type {string | Buffer} */\n  let name = collectASequenceOfBytes(\n    (char) => char !== 0x0a && char !== 0x0d && char !== 0x22,\n    input,\n    position\n  )\n\n  // 3. If the byte at position is not 0x22 (\"), return failure. Otherwise, advance position by 1.\n  if (input[position.position] !== 0x22) {\n    return null // name could be 'failure'\n  } else {\n    position.position++\n  }\n\n  // 4. Replace any occurrence of the following subsequences in name with the given byte:\n  // - `%0A`: 0x0A (LF)\n  // - `%0D`: 0x0D (CR)\n  // - `%22`: 0x22 (\")\n  name = new TextDecoder().decode(name)\n    .replace(/%0A/ig, '\\n')\n    .replace(/%0D/ig, '\\r')\n    .replace(/%22/g, '\"')\n\n  // 5. Return the UTF-8 decoding without BOM of name.\n  return name\n}\n\n/**\n * @param {(char: number) => boolean} condition\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfBytes (condition, input, position) {\n  let start = position.position\n\n  while (start < input.length && condition(input[start])) {\n    ++start\n  }\n\n  return input.subarray(position.position, (position.position = start))\n}\n\n/**\n * @param {Buffer} buf\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns {Buffer}\n */\nfunction removeChars (buf, leading, trailing, predicate) {\n  let lead = 0\n  let trail = buf.length - 1\n\n  if (leading) {\n    while (lead < buf.length && predicate(buf[lead])) lead++\n  }\n\n  if (trailing) {\n    while (trail > 0 && predicate(buf[trail])) trail--\n  }\n\n  return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)\n}\n\n/**\n * Checks if {@param buffer} starts with {@param start}\n * @param {Buffer} buffer\n * @param {Buffer} start\n * @param {{ position: number }} position\n */\nfunction bufferStartsWith (buffer, start, position) {\n  if (buffer.length < start.length) {\n    return false\n  }\n\n  for (let i = 0; i < start.length; i++) {\n    if (start[i] !== buffer[position.position + i]) {\n      return false\n    }\n  }\n\n  return true\n}\n\nmodule.exports = {\n  multipartFormDataParser,\n  validateBoundary\n}\n","'use strict'\n\nconst { isBlobLike, iteratorMixin } = require('./util')\nconst { kState } = require('./symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { FileLike, isFileLike } = require('./file')\nconst { webidl } = require('./webidl')\nconst { File: NativeFile } = require('node:buffer')\nconst nodeUtil = require('node:util')\n\n/** @type {globalThis['File']} */\nconst File = globalThis.File ?? NativeFile\n\n// https://xhr.spec.whatwg.org/#formdata\nclass FormData {\n  constructor (form) {\n    webidl.util.markAsUncloneable(this)\n\n    if (form !== undefined) {\n      throw webidl.errors.conversionFailed({\n        prefix: 'FormData constructor',\n        argument: 'Argument 1',\n        types: ['undefined']\n      })\n    }\n\n    this[kState] = []\n  }\n\n  append (name, value, filename = undefined) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.append'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    if (arguments.length === 3 && !isBlobLike(value)) {\n      throw new TypeError(\n        \"Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'\"\n      )\n    }\n\n    // 1. Let value be value if given; otherwise blobValue.\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n    value = isBlobLike(value)\n      ? webidl.converters.Blob(value, prefix, 'value', { strict: false })\n      : webidl.converters.USVString(value, prefix, 'value')\n    filename = arguments.length === 3\n      ? webidl.converters.USVString(filename, prefix, 'filename')\n      : undefined\n\n    // 2. Let entry be the result of creating an entry with\n    // name, value, and filename if given.\n    const entry = makeEntry(name, value, filename)\n\n    // 3. Append entry to this’s entry list.\n    this[kState].push(entry)\n  }\n\n  delete (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // The delete(name) method steps are to remove all entries whose name\n    // is name from this’s entry list.\n    this[kState] = this[kState].filter(entry => entry.name !== name)\n  }\n\n  get (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.get'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // 1. If there is no entry whose name is name in this’s entry list,\n    // then return null.\n    const idx = this[kState].findIndex((entry) => entry.name === name)\n    if (idx === -1) {\n      return null\n    }\n\n    // 2. Return the value of the first entry whose name is name from\n    // this’s entry list.\n    return this[kState][idx].value\n  }\n\n  getAll (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.getAll'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // 1. If there is no entry whose name is name in this’s entry list,\n    // then return the empty list.\n    // 2. Return the values of all entries whose name is name, in order,\n    // from this’s entry list.\n    return this[kState]\n      .filter((entry) => entry.name === name)\n      .map((entry) => entry.value)\n  }\n\n  has (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.has'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // The has(name) method steps are to return true if there is an entry\n    // whose name is name in this’s entry list; otherwise false.\n    return this[kState].findIndex((entry) => entry.name === name) !== -1\n  }\n\n  set (name, value, filename = undefined) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.set'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    if (arguments.length === 3 && !isBlobLike(value)) {\n      throw new TypeError(\n        \"Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'\"\n      )\n    }\n\n    // The set(name, value) and set(name, blobValue, filename) method steps\n    // are:\n\n    // 1. Let value be value if given; otherwise blobValue.\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n    value = isBlobLike(value)\n      ? webidl.converters.Blob(value, prefix, 'name', { strict: false })\n      : webidl.converters.USVString(value, prefix, 'name')\n    filename = arguments.length === 3\n      ? webidl.converters.USVString(filename, prefix, 'name')\n      : undefined\n\n    // 2. Let entry be the result of creating an entry with name, value, and\n    // filename if given.\n    const entry = makeEntry(name, value, filename)\n\n    // 3. If there are entries in this’s entry list whose name is name, then\n    // replace the first such entry with entry and remove the others.\n    const idx = this[kState].findIndex((entry) => entry.name === name)\n    if (idx !== -1) {\n      this[kState] = [\n        ...this[kState].slice(0, idx),\n        entry,\n        ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)\n      ]\n    } else {\n      // 4. Otherwise, append entry to this’s entry list.\n      this[kState].push(entry)\n    }\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    const state = this[kState].reduce((a, b) => {\n      if (a[b.name]) {\n        if (Array.isArray(a[b.name])) {\n          a[b.name].push(b.value)\n        } else {\n          a[b.name] = [a[b.name], b.value]\n        }\n      } else {\n        a[b.name] = b.value\n      }\n\n      return a\n    }, { __proto__: null })\n\n    options.depth ??= depth\n    options.colors ??= true\n\n    const output = nodeUtil.formatWithOptions(options, state)\n\n    // remove [Object null prototype]\n    return `FormData ${output.slice(output.indexOf(']') + 2)}`\n  }\n}\n\niteratorMixin('FormData', FormData, kState, 'name', 'value')\n\nObject.defineProperties(FormData.prototype, {\n  append: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  get: kEnumerableProperty,\n  getAll: kEnumerableProperty,\n  has: kEnumerableProperty,\n  set: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'FormData',\n    configurable: true\n  }\n})\n\n/**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry\n * @param {string} name\n * @param {string|Blob} value\n * @param {?string} filename\n * @returns\n */\nfunction makeEntry (name, value, filename) {\n  // 1. Set name to the result of converting name into a scalar value string.\n  // Note: This operation was done by the webidl converter USVString.\n\n  // 2. If value is a string, then set value to the result of converting\n  //    value into a scalar value string.\n  if (typeof value === 'string') {\n    // Note: This operation was done by the webidl converter USVString.\n  } else {\n    // 3. Otherwise:\n\n    // 1. If value is not a File object, then set value to a new File object,\n    //    representing the same bytes, whose name attribute value is \"blob\"\n    if (!isFileLike(value)) {\n      value = value instanceof Blob\n        ? new File([value], 'blob', { type: value.type })\n        : new FileLike(value, 'blob', { type: value.type })\n    }\n\n    // 2. If filename is given, then set value to a new File object,\n    //    representing the same bytes, whose name attribute is filename.\n    if (filename !== undefined) {\n      /** @type {FilePropertyBag} */\n      const options = {\n        type: value.type,\n        lastModified: value.lastModified\n      }\n\n      value = value instanceof NativeFile\n        ? new File([value], filename, options)\n        : new FileLike(value, filename, options)\n    }\n  }\n\n  // 4. Return an entry whose name is name and whose value is value.\n  return { name, value }\n}\n\nmodule.exports = { FormData, makeEntry }\n","'use strict'\n\n// In case of breaking changes, increase the version\n// number to avoid conflicts.\nconst globalOrigin = Symbol.for('undici.globalOrigin.1')\n\nfunction getGlobalOrigin () {\n  return globalThis[globalOrigin]\n}\n\nfunction setGlobalOrigin (newOrigin) {\n  if (newOrigin === undefined) {\n    Object.defineProperty(globalThis, globalOrigin, {\n      value: undefined,\n      writable: true,\n      enumerable: false,\n      configurable: false\n    })\n\n    return\n  }\n\n  const parsedURL = new URL(newOrigin)\n\n  if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {\n    throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)\n  }\n\n  Object.defineProperty(globalThis, globalOrigin, {\n    value: parsedURL,\n    writable: true,\n    enumerable: false,\n    configurable: false\n  })\n}\n\nmodule.exports = {\n  getGlobalOrigin,\n  setGlobalOrigin\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst { kConstruct } = require('../../core/symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst {\n  iteratorMixin,\n  isValidHeaderName,\n  isValidHeaderValue\n} = require('./util')\nconst { webidl } = require('./webidl')\nconst assert = require('node:assert')\nconst util = require('node:util')\n\nconst kHeadersMap = Symbol('headers map')\nconst kHeadersSortedMap = Symbol('headers map sorted')\n\n/**\n * @param {number} code\n */\nfunction isHTTPWhiteSpaceCharCode (code) {\n  return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize\n * @param {string} potentialValue\n */\nfunction headerValueNormalize (potentialValue) {\n  //  To normalize a byte sequence potentialValue, remove\n  //  any leading and trailing HTTP whitespace bytes from\n  //  potentialValue.\n  let i = 0; let j = potentialValue.length\n\n  while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j\n  while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i\n\n  return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)\n}\n\nfunction fill (headers, object) {\n  // To fill a Headers object headers with a given object object, run these steps:\n\n  // 1. If object is a sequence, then for each header in object:\n  // Note: webidl conversion to array has already been done.\n  if (Array.isArray(object)) {\n    for (let i = 0; i < object.length; ++i) {\n      const header = object[i]\n      // 1. If header does not contain exactly two items, then throw a TypeError.\n      if (header.length !== 2) {\n        throw webidl.errors.exception({\n          header: 'Headers constructor',\n          message: `expected name/value pair to be length 2, found ${header.length}.`\n        })\n      }\n\n      // 2. Append (header’s first item, header’s second item) to headers.\n      appendHeader(headers, header[0], header[1])\n    }\n  } else if (typeof object === 'object' && object !== null) {\n    // Note: null should throw\n\n    // 2. Otherwise, object is a record, then for each key → value in object,\n    //    append (key, value) to headers\n    const keys = Object.keys(object)\n    for (let i = 0; i < keys.length; ++i) {\n      appendHeader(headers, keys[i], object[keys[i]])\n    }\n  } else {\n    throw webidl.errors.conversionFailed({\n      prefix: 'Headers constructor',\n      argument: 'Argument 1',\n      types: ['sequence>', 'record']\n    })\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-headers-append\n */\nfunction appendHeader (headers, name, value) {\n  // 1. Normalize value.\n  value = headerValueNormalize(value)\n\n  // 2. If name is not a header name or value is not a\n  //    header value, then throw a TypeError.\n  if (!isValidHeaderName(name)) {\n    throw webidl.errors.invalidArgument({\n      prefix: 'Headers.append',\n      value: name,\n      type: 'header name'\n    })\n  } else if (!isValidHeaderValue(value)) {\n    throw webidl.errors.invalidArgument({\n      prefix: 'Headers.append',\n      value,\n      type: 'header value'\n    })\n  }\n\n  // 3. If headers’s guard is \"immutable\", then throw a TypeError.\n  // 4. Otherwise, if headers’s guard is \"request\" and name is a\n  //    forbidden header name, return.\n  // 5. Otherwise, if headers’s guard is \"request-no-cors\":\n  //    TODO\n  // Note: undici does not implement forbidden header names\n  if (getHeadersGuard(headers) === 'immutable') {\n    throw new TypeError('immutable')\n  }\n\n  // 6. Otherwise, if headers’s guard is \"response\" and name is a\n  //    forbidden response-header name, return.\n\n  // 7. Append (name, value) to headers’s header list.\n  return getHeadersList(headers).append(name, value, false)\n\n  // 8. If headers’s guard is \"request-no-cors\", then remove\n  //    privileged no-CORS request headers from headers\n}\n\nfunction compareHeaderName (a, b) {\n  return a[0] < b[0] ? -1 : 1\n}\n\nclass HeadersList {\n  /** @type {[string, string][]|null} */\n  cookies = null\n\n  constructor (init) {\n    if (init instanceof HeadersList) {\n      this[kHeadersMap] = new Map(init[kHeadersMap])\n      this[kHeadersSortedMap] = init[kHeadersSortedMap]\n      this.cookies = init.cookies === null ? null : [...init.cookies]\n    } else {\n      this[kHeadersMap] = new Map(init)\n      this[kHeadersSortedMap] = null\n    }\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#header-list-contains\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   */\n  contains (name, isLowerCase) {\n    // A header list list contains a header name name if list\n    // contains a header whose name is a byte-case-insensitive\n    // match for name.\n\n    return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase())\n  }\n\n  clear () {\n    this[kHeadersMap].clear()\n    this[kHeadersSortedMap] = null\n    this.cookies = null\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-append\n   * @param {string} name\n   * @param {string} value\n   * @param {boolean} isLowerCase\n   */\n  append (name, value, isLowerCase) {\n    this[kHeadersSortedMap] = null\n\n    // 1. If list contains name, then set name to the first such\n    //    header’s name.\n    const lowercaseName = isLowerCase ? name : name.toLowerCase()\n    const exists = this[kHeadersMap].get(lowercaseName)\n\n    // 2. Append (name, value) to list.\n    if (exists) {\n      const delimiter = lowercaseName === 'cookie' ? '; ' : ', '\n      this[kHeadersMap].set(lowercaseName, {\n        name: exists.name,\n        value: `${exists.value}${delimiter}${value}`\n      })\n    } else {\n      this[kHeadersMap].set(lowercaseName, { name, value })\n    }\n\n    if (lowercaseName === 'set-cookie') {\n      (this.cookies ??= []).push(value)\n    }\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-set\n   * @param {string} name\n   * @param {string} value\n   * @param {boolean} isLowerCase\n   */\n  set (name, value, isLowerCase) {\n    this[kHeadersSortedMap] = null\n    const lowercaseName = isLowerCase ? name : name.toLowerCase()\n\n    if (lowercaseName === 'set-cookie') {\n      this.cookies = [value]\n    }\n\n    // 1. If list contains name, then set the value of\n    //    the first such header to value and remove the\n    //    others.\n    // 2. Otherwise, append header (name, value) to list.\n    this[kHeadersMap].set(lowercaseName, { name, value })\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-delete\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   */\n  delete (name, isLowerCase) {\n    this[kHeadersSortedMap] = null\n    if (!isLowerCase) name = name.toLowerCase()\n\n    if (name === 'set-cookie') {\n      this.cookies = null\n    }\n\n    this[kHeadersMap].delete(name)\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-get\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   * @returns {string | null}\n   */\n  get (name, isLowerCase) {\n    // 1. If list does not contain name, then return null.\n    // 2. Return the values of all headers in list whose name\n    //    is a byte-case-insensitive match for name,\n    //    separated from each other by 0x2C 0x20, in order.\n    return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null\n  }\n\n  * [Symbol.iterator] () {\n    // use the lowercased name\n    for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n      yield [name, value]\n    }\n  }\n\n  get entries () {\n    const headers = {}\n\n    if (this[kHeadersMap].size !== 0) {\n      for (const { name, value } of this[kHeadersMap].values()) {\n        headers[name] = value\n      }\n    }\n\n    return headers\n  }\n\n  rawValues () {\n    return this[kHeadersMap].values()\n  }\n\n  get entriesList () {\n    const headers = []\n\n    if (this[kHeadersMap].size !== 0) {\n      for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) {\n        if (lowerName === 'set-cookie') {\n          for (const cookie of this.cookies) {\n            headers.push([name, cookie])\n          }\n        } else {\n          headers.push([name, value])\n        }\n      }\n    }\n\n    return headers\n  }\n\n  // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set\n  toSortedArray () {\n    const size = this[kHeadersMap].size\n    const array = new Array(size)\n    // In most cases, you will use the fast-path.\n    // fast-path: Use binary insertion sort for small arrays.\n    if (size <= 32) {\n      if (size === 0) {\n        // If empty, it is an empty array. To avoid the first index assignment.\n        return array\n      }\n      // Improve performance by unrolling loop and avoiding double-loop.\n      // Double-loop-less version of the binary insertion sort.\n      const iterator = this[kHeadersMap][Symbol.iterator]()\n      const firstValue = iterator.next().value\n      // set [name, value] to first index.\n      array[0] = [firstValue[0], firstValue[1].value]\n      // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n      // 3.2.2. Assert: value is non-null.\n      assert(firstValue[1].value !== null)\n      for (\n        let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value;\n        i < size;\n        ++i\n      ) {\n        // get next value\n        value = iterator.next().value\n        // set [name, value] to current index.\n        x = array[i] = [value[0], value[1].value]\n        // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n        // 3.2.2. Assert: value is non-null.\n        assert(x[1] !== null)\n        left = 0\n        right = i\n        // binary search\n        while (left < right) {\n          // middle index\n          pivot = left + ((right - left) >> 1)\n          // compare header name\n          if (array[pivot][0] <= x[0]) {\n            left = pivot + 1\n          } else {\n            right = pivot\n          }\n        }\n        if (i !== pivot) {\n          j = i\n          while (j > left) {\n            array[j] = array[--j]\n          }\n          array[left] = x\n        }\n      }\n      /* c8 ignore next 4 */\n      if (!iterator.next().done) {\n        // This is for debugging and will never be called.\n        throw new TypeError('Unreachable')\n      }\n      return array\n    } else {\n      // This case would be a rare occurrence.\n      // slow-path: fallback\n      let i = 0\n      for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n        array[i++] = [name, value]\n        // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n        // 3.2.2. Assert: value is non-null.\n        assert(value !== null)\n      }\n      return array.sort(compareHeaderName)\n    }\n  }\n}\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n  #guard\n  #headersList\n\n  constructor (init = undefined) {\n    webidl.util.markAsUncloneable(this)\n\n    if (init === kConstruct) {\n      return\n    }\n\n    this.#headersList = new HeadersList()\n\n    // The new Headers(init) constructor steps are:\n\n    // 1. Set this’s guard to \"none\".\n    this.#guard = 'none'\n\n    // 2. If init is given, then fill this with init.\n    if (init !== undefined) {\n      init = webidl.converters.HeadersInit(init, 'Headers contructor', 'init')\n      fill(this, init)\n    }\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-append\n  append (name, value) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 2, 'Headers.append')\n\n    const prefix = 'Headers.append'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n    value = webidl.converters.ByteString(value, prefix, 'value')\n\n    return appendHeader(this, name, value)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-delete\n  delete (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')\n\n    const prefix = 'Headers.delete'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix: 'Headers.delete',\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. If this’s guard is \"immutable\", then throw a TypeError.\n    // 3. Otherwise, if this’s guard is \"request\" and name is a\n    //    forbidden header name, return.\n    // 4. Otherwise, if this’s guard is \"request-no-cors\", name\n    //    is not a no-CORS-safelisted request-header name, and\n    //    name is not a privileged no-CORS request-header name,\n    //    return.\n    // 5. Otherwise, if this’s guard is \"response\" and name is\n    //    a forbidden response-header name, return.\n    // Note: undici does not implement forbidden header names\n    if (this.#guard === 'immutable') {\n      throw new TypeError('immutable')\n    }\n\n    // 6. If this’s header list does not contain name, then\n    //    return.\n    if (!this.#headersList.contains(name, false)) {\n      return\n    }\n\n    // 7. Delete name from this’s header list.\n    // 8. If this’s guard is \"request-no-cors\", then remove\n    //    privileged no-CORS request headers from this.\n    this.#headersList.delete(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-get\n  get (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.get')\n\n    const prefix = 'Headers.get'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. Return the result of getting name from this’s header\n    //    list.\n    return this.#headersList.get(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-has\n  has (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.has')\n\n    const prefix = 'Headers.has'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. Return true if this’s header list contains name;\n    //    otherwise false.\n    return this.#headersList.contains(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-set\n  set (name, value) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 2, 'Headers.set')\n\n    const prefix = 'Headers.set'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n    value = webidl.converters.ByteString(value, prefix, 'value')\n\n    // 1. Normalize value.\n    value = headerValueNormalize(value)\n\n    // 2. If name is not a header name or value is not a\n    //    header value, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    } else if (!isValidHeaderValue(value)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value,\n        type: 'header value'\n      })\n    }\n\n    // 3. If this’s guard is \"immutable\", then throw a TypeError.\n    // 4. Otherwise, if this’s guard is \"request\" and name is a\n    //    forbidden header name, return.\n    // 5. Otherwise, if this’s guard is \"request-no-cors\" and\n    //    name/value is not a no-CORS-safelisted request-header,\n    //    return.\n    // 6. Otherwise, if this’s guard is \"response\" and name is a\n    //    forbidden response-header name, return.\n    // Note: undici does not implement forbidden header names\n    if (this.#guard === 'immutable') {\n      throw new TypeError('immutable')\n    }\n\n    // 7. Set (name, value) in this’s header list.\n    // 8. If this’s guard is \"request-no-cors\", then remove\n    //    privileged no-CORS request headers from this\n    this.#headersList.set(name, value, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n  getSetCookie () {\n    webidl.brandCheck(this, Headers)\n\n    // 1. If this’s header list does not contain `Set-Cookie`, then return « ».\n    // 2. Return the values of all headers in this’s header list whose name is\n    //    a byte-case-insensitive match for `Set-Cookie`, in order.\n\n    const list = this.#headersList.cookies\n\n    if (list) {\n      return [...list]\n    }\n\n    return []\n  }\n\n  // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n  get [kHeadersSortedMap] () {\n    if (this.#headersList[kHeadersSortedMap]) {\n      return this.#headersList[kHeadersSortedMap]\n    }\n\n    // 1. Let headers be an empty list of headers with the key being the name\n    //    and value the value.\n    const headers = []\n\n    // 2. Let names be the result of convert header names to a sorted-lowercase\n    //    set with all the names of the headers in list.\n    const names = this.#headersList.toSortedArray()\n\n    const cookies = this.#headersList.cookies\n\n    // fast-path\n    if (cookies === null || cookies.length === 1) {\n      // Note: The non-null assertion of value has already been done by `HeadersList#toSortedArray`\n      return (this.#headersList[kHeadersSortedMap] = names)\n    }\n\n    // 3. For each name of names:\n    for (let i = 0; i < names.length; ++i) {\n      const { 0: name, 1: value } = names[i]\n      // 1. If name is `set-cookie`, then:\n      if (name === 'set-cookie') {\n        // 1. Let values be a list of all values of headers in list whose name\n        //    is a byte-case-insensitive match for name, in order.\n\n        // 2. For each value of values:\n        // 1. Append (name, value) to headers.\n        for (let j = 0; j < cookies.length; ++j) {\n          headers.push([name, cookies[j]])\n        }\n      } else {\n        // 2. Otherwise:\n\n        // 1. Let value be the result of getting name from list.\n\n        // 2. Assert: value is non-null.\n        // Note: This operation was done by `HeadersList#toSortedArray`.\n\n        // 3. Append (name, value) to headers.\n        headers.push([name, value])\n      }\n    }\n\n    // 4. Return headers.\n    return (this.#headersList[kHeadersSortedMap] = headers)\n  }\n\n  [util.inspect.custom] (depth, options) {\n    options.depth ??= depth\n\n    return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`\n  }\n\n  static getHeadersGuard (o) {\n    return o.#guard\n  }\n\n  static setHeadersGuard (o, guard) {\n    o.#guard = guard\n  }\n\n  static getHeadersList (o) {\n    return o.#headersList\n  }\n\n  static setHeadersList (o, list) {\n    o.#headersList = list\n  }\n}\n\nconst { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers\nReflect.deleteProperty(Headers, 'getHeadersGuard')\nReflect.deleteProperty(Headers, 'setHeadersGuard')\nReflect.deleteProperty(Headers, 'getHeadersList')\nReflect.deleteProperty(Headers, 'setHeadersList')\n\niteratorMixin('Headers', Headers, kHeadersSortedMap, 0, 1)\n\nObject.defineProperties(Headers.prototype, {\n  append: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  get: kEnumerableProperty,\n  has: kEnumerableProperty,\n  set: kEnumerableProperty,\n  getSetCookie: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Headers',\n    configurable: true\n  },\n  [util.inspect.custom]: {\n    enumerable: false\n  }\n})\n\nwebidl.converters.HeadersInit = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === 'Object') {\n    const iterator = Reflect.get(V, Symbol.iterator)\n\n    // A work-around to ensure we send the properly-cased Headers when V is a Headers object.\n    // Read https://github.com/nodejs/undici/pull/3159#issuecomment-2075537226 before touching, please.\n    if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { // Headers object\n      try {\n        return getHeadersList(V).entriesList\n      } catch {\n        // fall-through\n      }\n    }\n\n    if (typeof iterator === 'function') {\n      return webidl.converters['sequence>'](V, prefix, argument, iterator.bind(V))\n    }\n\n    return webidl.converters['record'](V, prefix, argument)\n  }\n\n  throw webidl.errors.conversionFailed({\n    prefix: 'Headers constructor',\n    argument: 'Argument 1',\n    types: ['sequence>', 'record']\n  })\n}\n\nmodule.exports = {\n  fill,\n  // for test.\n  compareHeaderName,\n  Headers,\n  HeadersList,\n  getHeadersGuard,\n  setHeadersGuard,\n  setHeadersList,\n  getHeadersList\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst {\n  makeNetworkError,\n  makeAppropriateNetworkError,\n  filterResponse,\n  makeResponse,\n  fromInnerResponse\n} = require('./response')\nconst { HeadersList } = require('./headers')\nconst { Request, cloneRequest } = require('./request')\nconst zlib = require('node:zlib')\nconst {\n  bytesMatch,\n  makePolicyContainer,\n  clonePolicyContainer,\n  requestBadPort,\n  TAOCheck,\n  appendRequestOriginHeader,\n  responseLocationURL,\n  requestCurrentURL,\n  setRequestReferrerPolicyOnRedirect,\n  tryUpgradeRequestToAPotentiallyTrustworthyURL,\n  createOpaqueTimingInfo,\n  appendFetchMetadata,\n  corsCheck,\n  crossOriginResourcePolicyCheck,\n  determineRequestsReferrer,\n  coarsenedSharedCurrentTime,\n  createDeferredPromise,\n  isBlobLike,\n  sameOrigin,\n  isCancelled,\n  isAborted,\n  isErrorLike,\n  fullyReadBody,\n  readableStreamClose,\n  isomorphicEncode,\n  urlIsLocal,\n  urlIsHttpHttpsScheme,\n  urlHasHttpsScheme,\n  clampAndCoarsenConnectionTimingInfo,\n  simpleRangeHeaderValue,\n  buildContentRange,\n  createInflate,\n  extractMimeType\n} = require('./util')\nconst { kState, kDispatcher } = require('./symbols')\nconst assert = require('node:assert')\nconst { safelyExtractBody, extractBody } = require('./body')\nconst {\n  redirectStatusSet,\n  nullBodyStatus,\n  safeMethodsSet,\n  requestBodyHeader,\n  subresourceSet\n} = require('./constants')\nconst EE = require('node:events')\nconst { Readable, pipeline, finished } = require('node:stream')\nconst { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url')\nconst { getGlobalDispatcher } = require('../../global')\nconst { webidl } = require('./webidl')\nconst { STATUS_CODES } = require('node:http')\nconst GET_OR_HEAD = ['GET', 'HEAD']\n\nconst defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'\n  ? 'node'\n  : 'undici'\n\n/** @type {import('buffer').resolveObjectURL} */\nlet resolveObjectURL\n\nclass Fetch extends EE {\n  constructor (dispatcher) {\n    super()\n\n    this.dispatcher = dispatcher\n    this.connection = null\n    this.dump = false\n    this.state = 'ongoing'\n  }\n\n  terminate (reason) {\n    if (this.state !== 'ongoing') {\n      return\n    }\n\n    this.state = 'terminated'\n    this.connection?.destroy(reason)\n    this.emit('terminated', reason)\n  }\n\n  // https://fetch.spec.whatwg.org/#fetch-controller-abort\n  abort (error) {\n    if (this.state !== 'ongoing') {\n      return\n    }\n\n    // 1. Set controller’s state to \"aborted\".\n    this.state = 'aborted'\n\n    // 2. Let fallbackError be an \"AbortError\" DOMException.\n    // 3. Set error to fallbackError if it is not given.\n    if (!error) {\n      error = new DOMException('The operation was aborted.', 'AbortError')\n    }\n\n    // 4. Let serializedError be StructuredSerialize(error).\n    //    If that threw an exception, catch it, and let\n    //    serializedError be StructuredSerialize(fallbackError).\n\n    // 5. Set controller’s serialized abort reason to serializedError.\n    this.serializedAbortReason = error\n\n    this.connection?.destroy(error)\n    this.emit('terminated', error)\n  }\n}\n\nfunction handleFetchDone (response) {\n  finalizeAndReportTiming(response, 'fetch')\n}\n\n// https://fetch.spec.whatwg.org/#fetch-method\nfunction fetch (input, init = undefined) {\n  webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')\n\n  // 1. Let p be a new promise.\n  let p = createDeferredPromise()\n\n  // 2. Let requestObject be the result of invoking the initial value of\n  // Request as constructor with input and init as arguments. If this throws\n  // an exception, reject p with it and return p.\n  let requestObject\n\n  try {\n    requestObject = new Request(input, init)\n  } catch (e) {\n    p.reject(e)\n    return p.promise\n  }\n\n  // 3. Let request be requestObject’s request.\n  const request = requestObject[kState]\n\n  // 4. If requestObject’s signal’s aborted flag is set, then:\n  if (requestObject.signal.aborted) {\n    // 1. Abort the fetch() call with p, request, null, and\n    //    requestObject’s signal’s abort reason.\n    abortFetch(p, request, null, requestObject.signal.reason)\n\n    // 2. Return p.\n    return p.promise\n  }\n\n  // 5. Let globalObject be request’s client’s global object.\n  const globalObject = request.client.globalObject\n\n  // 6. If globalObject is a ServiceWorkerGlobalScope object, then set\n  // request’s service-workers mode to \"none\".\n  if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {\n    request.serviceWorkers = 'none'\n  }\n\n  // 7. Let responseObject be null.\n  let responseObject = null\n\n  // 8. Let relevantRealm be this’s relevant Realm.\n\n  // 9. Let locallyAborted be false.\n  let locallyAborted = false\n\n  // 10. Let controller be null.\n  let controller = null\n\n  // 11. Add the following abort steps to requestObject’s signal:\n  addAbortListener(\n    requestObject.signal,\n    () => {\n      // 1. Set locallyAborted to true.\n      locallyAborted = true\n\n      // 2. Assert: controller is non-null.\n      assert(controller != null)\n\n      // 3. Abort controller with requestObject’s signal’s abort reason.\n      controller.abort(requestObject.signal.reason)\n\n      const realResponse = responseObject?.deref()\n\n      // 4. Abort the fetch() call with p, request, responseObject,\n      //    and requestObject’s signal’s abort reason.\n      abortFetch(p, request, realResponse, requestObject.signal.reason)\n    }\n  )\n\n  // 12. Let handleFetchDone given response response be to finalize and\n  // report timing with response, globalObject, and \"fetch\".\n  // see function handleFetchDone\n\n  // 13. Set controller to the result of calling fetch given request,\n  // with processResponseEndOfBody set to handleFetchDone, and processResponse\n  // given response being these substeps:\n\n  const processResponse = (response) => {\n    // 1. If locallyAborted is true, terminate these substeps.\n    if (locallyAborted) {\n      return\n    }\n\n    // 2. If response’s aborted flag is set, then:\n    if (response.aborted) {\n      // 1. Let deserializedError be the result of deserialize a serialized\n      //    abort reason given controller’s serialized abort reason and\n      //    relevantRealm.\n\n      // 2. Abort the fetch() call with p, request, responseObject, and\n      //    deserializedError.\n\n      abortFetch(p, request, responseObject, controller.serializedAbortReason)\n      return\n    }\n\n    // 3. If response is a network error, then reject p with a TypeError\n    // and terminate these substeps.\n    if (response.type === 'error') {\n      p.reject(new TypeError('fetch failed', { cause: response.error }))\n      return\n    }\n\n    // 4. Set responseObject to the result of creating a Response object,\n    // given response, \"immutable\", and relevantRealm.\n    responseObject = new WeakRef(fromInnerResponse(response, 'immutable'))\n\n    // 5. Resolve p with responseObject.\n    p.resolve(responseObject.deref())\n    p = null\n  }\n\n  controller = fetching({\n    request,\n    processResponseEndOfBody: handleFetchDone,\n    processResponse,\n    dispatcher: requestObject[kDispatcher] // undici\n  })\n\n  // 14. Return p.\n  return p.promise\n}\n\n// https://fetch.spec.whatwg.org/#finalize-and-report-timing\nfunction finalizeAndReportTiming (response, initiatorType = 'other') {\n  // 1. If response is an aborted network error, then return.\n  if (response.type === 'error' && response.aborted) {\n    return\n  }\n\n  // 2. If response’s URL list is null or empty, then return.\n  if (!response.urlList?.length) {\n    return\n  }\n\n  // 3. Let originalURL be response’s URL list[0].\n  const originalURL = response.urlList[0]\n\n  // 4. Let timingInfo be response’s timing info.\n  let timingInfo = response.timingInfo\n\n  // 5. Let cacheState be response’s cache state.\n  let cacheState = response.cacheState\n\n  // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.\n  if (!urlIsHttpHttpsScheme(originalURL)) {\n    return\n  }\n\n  // 7. If timingInfo is null, then return.\n  if (timingInfo === null) {\n    return\n  }\n\n  // 8. If response’s timing allow passed flag is not set, then:\n  if (!response.timingAllowPassed) {\n    //  1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.\n    timingInfo = createOpaqueTimingInfo({\n      startTime: timingInfo.startTime\n    })\n\n    //  2. Set cacheState to the empty string.\n    cacheState = ''\n  }\n\n  // 9. Set timingInfo’s end time to the coarsened shared current time\n  // given global’s relevant settings object’s cross-origin isolated\n  // capability.\n  // TODO: given global’s relevant settings object’s cross-origin isolated\n  // capability?\n  timingInfo.endTime = coarsenedSharedCurrentTime()\n\n  // 10. Set response’s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 11. Mark resource timing for timingInfo, originalURL, initiatorType,\n  // global, and cacheState.\n  markResourceTiming(\n    timingInfo,\n    originalURL.href,\n    initiatorType,\n    globalThis,\n    cacheState\n  )\n}\n\n// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing\nconst markResourceTiming = performance.markResourceTiming\n\n// https://fetch.spec.whatwg.org/#abort-fetch\nfunction abortFetch (p, request, responseObject, error) {\n  // 1. Reject promise with error.\n  if (p) {\n    // We might have already resolved the promise at this stage\n    p.reject(error)\n  }\n\n  // 2. If request’s body is not null and is readable, then cancel request’s\n  // body with error.\n  if (request.body != null && isReadable(request.body?.stream)) {\n    request.body.stream.cancel(error).catch((err) => {\n      if (err.code === 'ERR_INVALID_STATE') {\n        // Node bug?\n        return\n      }\n      throw err\n    })\n  }\n\n  // 3. If responseObject is null, then return.\n  if (responseObject == null) {\n    return\n  }\n\n  // 4. Let response be responseObject’s response.\n  const response = responseObject[kState]\n\n  // 5. If response’s body is not null and is readable, then error response’s\n  // body with error.\n  if (response.body != null && isReadable(response.body?.stream)) {\n    response.body.stream.cancel(error).catch((err) => {\n      if (err.code === 'ERR_INVALID_STATE') {\n        // Node bug?\n        return\n      }\n      throw err\n    })\n  }\n}\n\n// https://fetch.spec.whatwg.org/#fetching\nfunction fetching ({\n  request,\n  processRequestBodyChunkLength,\n  processRequestEndOfBody,\n  processResponse,\n  processResponseEndOfBody,\n  processResponseConsumeBody,\n  useParallelQueue = false,\n  dispatcher = getGlobalDispatcher() // undici\n}) {\n  // Ensure that the dispatcher is set accordingly\n  assert(dispatcher)\n\n  // 1. Let taskDestination be null.\n  let taskDestination = null\n\n  // 2. Let crossOriginIsolatedCapability be false.\n  let crossOriginIsolatedCapability = false\n\n  // 3. If request’s client is non-null, then:\n  if (request.client != null) {\n    // 1. Set taskDestination to request’s client’s global object.\n    taskDestination = request.client.globalObject\n\n    // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin\n    // isolated capability.\n    crossOriginIsolatedCapability =\n      request.client.crossOriginIsolatedCapability\n  }\n\n  // 4. If useParallelQueue is true, then set taskDestination to the result of\n  // starting a new parallel queue.\n  // TODO\n\n  // 5. Let timingInfo be a new fetch timing info whose start time and\n  // post-redirect start time are the coarsened shared current time given\n  // crossOriginIsolatedCapability.\n  const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)\n  const timingInfo = createOpaqueTimingInfo({\n    startTime: currentTime\n  })\n\n  // 6. Let fetchParams be a new fetch params whose\n  // request is request,\n  // timing info is timingInfo,\n  // process request body chunk length is processRequestBodyChunkLength,\n  // process request end-of-body is processRequestEndOfBody,\n  // process response is processResponse,\n  // process response consume body is processResponseConsumeBody,\n  // process response end-of-body is processResponseEndOfBody,\n  // task destination is taskDestination,\n  // and cross-origin isolated capability is crossOriginIsolatedCapability.\n  const fetchParams = {\n    controller: new Fetch(dispatcher),\n    request,\n    timingInfo,\n    processRequestBodyChunkLength,\n    processRequestEndOfBody,\n    processResponse,\n    processResponseConsumeBody,\n    processResponseEndOfBody,\n    taskDestination,\n    crossOriginIsolatedCapability\n  }\n\n  // 7. If request’s body is a byte sequence, then set request’s body to\n  //    request’s body as a body.\n  // NOTE: Since fetching is only called from fetch, body should already be\n  // extracted.\n  assert(!request.body || request.body.stream)\n\n  // 8. If request’s window is \"client\", then set request’s window to request’s\n  // client, if request’s client’s global object is a Window object; otherwise\n  // \"no-window\".\n  if (request.window === 'client') {\n    // TODO: What if request.client is null?\n    request.window =\n      request.client?.globalObject?.constructor?.name === 'Window'\n        ? request.client\n        : 'no-window'\n  }\n\n  // 9. If request’s origin is \"client\", then set request’s origin to request’s\n  // client’s origin.\n  if (request.origin === 'client') {\n    request.origin = request.client.origin\n  }\n\n  // 10. If all of the following conditions are true:\n  // TODO\n\n  // 11. If request’s policy container is \"client\", then:\n  if (request.policyContainer === 'client') {\n    // 1. If request’s client is non-null, then set request’s policy\n    // container to a clone of request’s client’s policy container. [HTML]\n    if (request.client != null) {\n      request.policyContainer = clonePolicyContainer(\n        request.client.policyContainer\n      )\n    } else {\n      // 2. Otherwise, set request’s policy container to a new policy\n      // container.\n      request.policyContainer = makePolicyContainer()\n    }\n  }\n\n  // 12. If request’s header list does not contain `Accept`, then:\n  if (!request.headersList.contains('accept', true)) {\n    // 1. Let value be `*/*`.\n    const value = '*/*'\n\n    // 2. A user agent should set value to the first matching statement, if\n    // any, switching on request’s destination:\n    // \"document\"\n    // \"frame\"\n    // \"iframe\"\n    // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`\n    // \"image\"\n    // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`\n    // \"style\"\n    // `text/css,*/*;q=0.1`\n    // TODO\n\n    // 3. Append `Accept`/value to request’s header list.\n    request.headersList.append('accept', value, true)\n  }\n\n  // 13. If request’s header list does not contain `Accept-Language`, then\n  // user agents should append `Accept-Language`/an appropriate value to\n  // request’s header list.\n  if (!request.headersList.contains('accept-language', true)) {\n    request.headersList.append('accept-language', '*', true)\n  }\n\n  // 14. If request’s priority is null, then use request’s initiator and\n  // destination appropriately in setting request’s priority to a\n  // user-agent-defined object.\n  if (request.priority === null) {\n    // TODO\n  }\n\n  // 15. If request is a subresource request, then:\n  if (subresourceSet.has(request.destination)) {\n    // TODO\n  }\n\n  // 16. Run main fetch given fetchParams.\n  mainFetch(fetchParams)\n    .catch(err => {\n      fetchParams.controller.terminate(err)\n    })\n\n  // 17. Return fetchParam's controller\n  return fetchParams.controller\n}\n\n// https://fetch.spec.whatwg.org/#concept-main-fetch\nasync function mainFetch (fetchParams, recursive = false) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. If request’s local-URLs-only flag is set and request’s current URL is\n  // not local, then set response to a network error.\n  if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n    response = makeNetworkError('local URLs only')\n  }\n\n  // 4. Run report Content Security Policy violations for request.\n  // TODO\n\n  // 5. Upgrade request to a potentially trustworthy URL, if appropriate.\n  tryUpgradeRequestToAPotentiallyTrustworthyURL(request)\n\n  // 6. If should request be blocked due to a bad port, should fetching request\n  // be blocked as mixed content, or should request be blocked by Content\n  // Security Policy returns blocked, then set response to a network error.\n  if (requestBadPort(request) === 'blocked') {\n    response = makeNetworkError('bad port')\n  }\n  // TODO: should fetching request be blocked as mixed content?\n  // TODO: should request be blocked by Content Security Policy?\n\n  // 7. If request’s referrer policy is the empty string, then set request’s\n  // referrer policy to request’s policy container’s referrer policy.\n  if (request.referrerPolicy === '') {\n    request.referrerPolicy = request.policyContainer.referrerPolicy\n  }\n\n  // 8. If request’s referrer is not \"no-referrer\", then set request’s\n  // referrer to the result of invoking determine request’s referrer.\n  if (request.referrer !== 'no-referrer') {\n    request.referrer = determineRequestsReferrer(request)\n  }\n\n  // 9. Set request’s current URL’s scheme to \"https\" if all of the following\n  // conditions are true:\n  // - request’s current URL’s scheme is \"http\"\n  // - request’s current URL’s host is a domain\n  // - Matching request’s current URL’s host per Known HSTS Host Domain Name\n  //   Matching results in either a superdomain match with an asserted\n  //   includeSubDomains directive or a congruent match (with or without an\n  //   asserted includeSubDomains directive). [HSTS]\n  // TODO\n\n  // 10. If recursive is false, then run the remaining steps in parallel.\n  // TODO\n\n  // 11. If response is null, then set response to the result of running\n  // the steps corresponding to the first matching statement:\n  if (response === null) {\n    response = await (async () => {\n      const currentURL = requestCurrentURL(request)\n\n      if (\n        // - request’s current URL’s origin is same origin with request’s origin,\n        //   and request’s response tainting is \"basic\"\n        (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||\n        // request’s current URL’s scheme is \"data\"\n        (currentURL.protocol === 'data:') ||\n        // - request’s mode is \"navigate\" or \"websocket\"\n        (request.mode === 'navigate' || request.mode === 'websocket')\n      ) {\n        // 1. Set request’s response tainting to \"basic\".\n        request.responseTainting = 'basic'\n\n        // 2. Return the result of running scheme fetch given fetchParams.\n        return await schemeFetch(fetchParams)\n      }\n\n      // request’s mode is \"same-origin\"\n      if (request.mode === 'same-origin') {\n        // 1. Return a network error.\n        return makeNetworkError('request mode cannot be \"same-origin\"')\n      }\n\n      // request’s mode is \"no-cors\"\n      if (request.mode === 'no-cors') {\n        // 1. If request’s redirect mode is not \"follow\", then return a network\n        // error.\n        if (request.redirect !== 'follow') {\n          return makeNetworkError(\n            'redirect mode cannot be \"follow\" for \"no-cors\" request'\n          )\n        }\n\n        // 2. Set request’s response tainting to \"opaque\".\n        request.responseTainting = 'opaque'\n\n        // 3. Return the result of running scheme fetch given fetchParams.\n        return await schemeFetch(fetchParams)\n      }\n\n      // request’s current URL’s scheme is not an HTTP(S) scheme\n      if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n        // Return a network error.\n        return makeNetworkError('URL scheme must be a HTTP(S) scheme')\n      }\n\n      // - request’s use-CORS-preflight flag is set\n      // - request’s unsafe-request flag is set and either request’s method is\n      //   not a CORS-safelisted method or CORS-unsafe request-header names with\n      //   request’s header list is not empty\n      //    1. Set request’s response tainting to \"cors\".\n      //    2. Let corsWithPreflightResponse be the result of running HTTP fetch\n      //    given fetchParams and true.\n      //    3. If corsWithPreflightResponse is a network error, then clear cache\n      //    entries using request.\n      //    4. Return corsWithPreflightResponse.\n      // TODO\n\n      // Otherwise\n      //    1. Set request’s response tainting to \"cors\".\n      request.responseTainting = 'cors'\n\n      //    2. Return the result of running HTTP fetch given fetchParams.\n      return await httpFetch(fetchParams)\n    })()\n  }\n\n  // 12. If recursive is true, then return response.\n  if (recursive) {\n    return response\n  }\n\n  // 13. If response is not a network error and response is not a filtered\n  // response, then:\n  if (response.status !== 0 && !response.internalResponse) {\n    // If request’s response tainting is \"cors\", then:\n    if (request.responseTainting === 'cors') {\n      // 1. Let headerNames be the result of extracting header list values\n      // given `Access-Control-Expose-Headers` and response’s header list.\n      // TODO\n      // 2. If request’s credentials mode is not \"include\" and headerNames\n      // contains `*`, then set response’s CORS-exposed header-name list to\n      // all unique header names in response’s header list.\n      // TODO\n      // 3. Otherwise, if headerNames is not null or failure, then set\n      // response’s CORS-exposed header-name list to headerNames.\n      // TODO\n    }\n\n    // Set response to the following filtered response with response as its\n    // internal response, depending on request’s response tainting:\n    if (request.responseTainting === 'basic') {\n      response = filterResponse(response, 'basic')\n    } else if (request.responseTainting === 'cors') {\n      response = filterResponse(response, 'cors')\n    } else if (request.responseTainting === 'opaque') {\n      response = filterResponse(response, 'opaque')\n    } else {\n      assert(false)\n    }\n  }\n\n  // 14. Let internalResponse be response, if response is a network error,\n  // and response’s internal response otherwise.\n  let internalResponse =\n    response.status === 0 ? response : response.internalResponse\n\n  // 15. If internalResponse’s URL list is empty, then set it to a clone of\n  // request’s URL list.\n  if (internalResponse.urlList.length === 0) {\n    internalResponse.urlList.push(...request.urlList)\n  }\n\n  // 16. If request’s timing allow failed flag is unset, then set\n  // internalResponse’s timing allow passed flag.\n  if (!request.timingAllowFailed) {\n    response.timingAllowPassed = true\n  }\n\n  // 17. If response is not a network error and any of the following returns\n  // blocked\n  // - should internalResponse to request be blocked as mixed content\n  // - should internalResponse to request be blocked by Content Security Policy\n  // - should internalResponse to request be blocked due to its MIME type\n  // - should internalResponse to request be blocked due to nosniff\n  // TODO\n\n  // 18. If response’s type is \"opaque\", internalResponse’s status is 206,\n  // internalResponse’s range-requested flag is set, and request’s header\n  // list does not contain `Range`, then set response and internalResponse\n  // to a network error.\n  if (\n    response.type === 'opaque' &&\n    internalResponse.status === 206 &&\n    internalResponse.rangeRequested &&\n    !request.headers.contains('range', true)\n  ) {\n    response = internalResponse = makeNetworkError()\n  }\n\n  // 19. If response is not a network error and either request’s method is\n  // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,\n  // set internalResponse’s body to null and disregard any enqueuing toward\n  // it (if any).\n  if (\n    response.status !== 0 &&\n    (request.method === 'HEAD' ||\n      request.method === 'CONNECT' ||\n      nullBodyStatus.includes(internalResponse.status))\n  ) {\n    internalResponse.body = null\n    fetchParams.controller.dump = true\n  }\n\n  // 20. If request’s integrity metadata is not the empty string, then:\n  if (request.integrity) {\n    // 1. Let processBodyError be this step: run fetch finale given fetchParams\n    // and a network error.\n    const processBodyError = (reason) =>\n      fetchFinale(fetchParams, makeNetworkError(reason))\n\n    // 2. If request’s response tainting is \"opaque\", or response’s body is null,\n    // then run processBodyError and abort these steps.\n    if (request.responseTainting === 'opaque' || response.body == null) {\n      processBodyError(response.error)\n      return\n    }\n\n    // 3. Let processBody given bytes be these steps:\n    const processBody = (bytes) => {\n      // 1. If bytes do not match request’s integrity metadata,\n      // then run processBodyError and abort these steps. [SRI]\n      if (!bytesMatch(bytes, request.integrity)) {\n        processBodyError('integrity mismatch')\n        return\n      }\n\n      // 2. Set response’s body to bytes as a body.\n      response.body = safelyExtractBody(bytes)[0]\n\n      // 3. Run fetch finale given fetchParams and response.\n      fetchFinale(fetchParams, response)\n    }\n\n    // 4. Fully read response’s body given processBody and processBodyError.\n    await fullyReadBody(response.body, processBody, processBodyError)\n  } else {\n    // 21. Otherwise, run fetch finale given fetchParams and response.\n    fetchFinale(fetchParams, response)\n  }\n}\n\n// https://fetch.spec.whatwg.org/#concept-scheme-fetch\n// given a fetch params fetchParams\nfunction schemeFetch (fetchParams) {\n  // Note: since the connection is destroyed on redirect, which sets fetchParams to a\n  // cancelled state, we do not want this condition to trigger *unless* there have been\n  // no redirects. See https://github.com/nodejs/undici/issues/1776\n  // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n  if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n    return Promise.resolve(makeAppropriateNetworkError(fetchParams))\n  }\n\n  // 2. Let request be fetchParams’s request.\n  const { request } = fetchParams\n\n  const { protocol: scheme } = requestCurrentURL(request)\n\n  // 3. Switch on request’s current URL’s scheme and run the associated steps:\n  switch (scheme) {\n    case 'about:': {\n      // If request’s current URL’s path is the string \"blank\", then return a new response\n      // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,\n      // and body is the empty byte sequence as a body.\n\n      // Otherwise, return a network error.\n      return Promise.resolve(makeNetworkError('about scheme is not supported'))\n    }\n    case 'blob:': {\n      if (!resolveObjectURL) {\n        resolveObjectURL = require('node:buffer').resolveObjectURL\n      }\n\n      // 1. Let blobURLEntry be request’s current URL’s blob URL entry.\n      const blobURLEntry = requestCurrentURL(request)\n\n      // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56\n      // Buffer.resolveObjectURL does not ignore URL queries.\n      if (blobURLEntry.search.length !== 0) {\n        return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))\n      }\n\n      const blob = resolveObjectURL(blobURLEntry.toString())\n\n      // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s\n      //    object is not a Blob object, then return a network error.\n      if (request.method !== 'GET' || !isBlobLike(blob)) {\n        return Promise.resolve(makeNetworkError('invalid method'))\n      }\n\n      // 3. Let blob be blobURLEntry’s object.\n      // Note: done above\n\n      // 4. Let response be a new response.\n      const response = makeResponse()\n\n      // 5. Let fullLength be blob’s size.\n      const fullLength = blob.size\n\n      // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.\n      const serializedFullLength = isomorphicEncode(`${fullLength}`)\n\n      // 7. Let type be blob’s type.\n      const type = blob.type\n\n      // 8. If request’s header list does not contain `Range`:\n      // 9. Otherwise:\n      if (!request.headersList.contains('range', true)) {\n        // 1. Let bodyWithType be the result of safely extracting blob.\n        // Note: in the FileAPI a blob \"object\" is a Blob *or* a MediaSource.\n        // In node, this can only ever be a Blob. Therefore we can safely\n        // use extractBody directly.\n        const bodyWithType = extractBody(blob)\n\n        // 2. Set response’s status message to `OK`.\n        response.statusText = 'OK'\n\n        // 3. Set response’s body to bodyWithType’s body.\n        response.body = bodyWithType[0]\n\n        // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».\n        response.headersList.set('content-length', serializedFullLength, true)\n        response.headersList.set('content-type', type, true)\n      } else {\n        // 1. Set response’s range-requested flag.\n        response.rangeRequested = true\n\n        // 2. Let rangeHeader be the result of getting `Range` from request’s header list.\n        const rangeHeader = request.headersList.get('range', true)\n\n        // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true.\n        const rangeValue = simpleRangeHeaderValue(rangeHeader, true)\n\n        // 4. If rangeValue is failure, then return a network error.\n        if (rangeValue === 'failure') {\n          return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n        }\n\n        // 5. Let (rangeStart, rangeEnd) be rangeValue.\n        let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue\n\n        // 6. If rangeStart is null:\n        // 7. Otherwise:\n        if (rangeStart === null) {\n          // 1. Set rangeStart to fullLength − rangeEnd.\n          rangeStart = fullLength - rangeEnd\n\n          // 2. Set rangeEnd to rangeStart + rangeEnd − 1.\n          rangeEnd = rangeStart + rangeEnd - 1\n        } else {\n          // 1. If rangeStart is greater than or equal to fullLength, then return a network error.\n          if (rangeStart >= fullLength) {\n            return Promise.resolve(makeNetworkError('Range start is greater than the blob\\'s size.'))\n          }\n\n          // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set\n          //    rangeEnd to fullLength − 1.\n          if (rangeEnd === null || rangeEnd >= fullLength) {\n            rangeEnd = fullLength - 1\n          }\n        }\n\n        // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,\n        //    rangeEnd + 1, and type.\n        const slicedBlob = blob.slice(rangeStart, rangeEnd, type)\n\n        // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.\n        // Note: same reason as mentioned above as to why we use extractBody\n        const slicedBodyWithType = extractBody(slicedBlob)\n\n        // 10. Set response’s body to slicedBodyWithType’s body.\n        response.body = slicedBodyWithType[0]\n\n        // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.\n        const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`)\n\n        // 12. Let contentRange be the result of invoking build a content range given rangeStart,\n        //     rangeEnd, and fullLength.\n        const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength)\n\n        // 13. Set response’s status to 206.\n        response.status = 206\n\n        // 14. Set response’s status message to `Partial Content`.\n        response.statusText = 'Partial Content'\n\n        // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength),\n        //     (`Content-Type`, type), (`Content-Range`, contentRange) ».\n        response.headersList.set('content-length', serializedSlicedLength, true)\n        response.headersList.set('content-type', type, true)\n        response.headersList.set('content-range', contentRange, true)\n      }\n\n      // 10. Return response.\n      return Promise.resolve(response)\n    }\n    case 'data:': {\n      // 1. Let dataURLStruct be the result of running the\n      //    data: URL processor on request’s current URL.\n      const currentURL = requestCurrentURL(request)\n      const dataURLStruct = dataURLProcessor(currentURL)\n\n      // 2. If dataURLStruct is failure, then return a\n      //    network error.\n      if (dataURLStruct === 'failure') {\n        return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n      }\n\n      // 3. Let mimeType be dataURLStruct’s MIME type, serialized.\n      const mimeType = serializeAMimeType(dataURLStruct.mimeType)\n\n      // 4. Return a response whose status message is `OK`,\n      //    header list is « (`Content-Type`, mimeType) »,\n      //    and body is dataURLStruct’s body as a body.\n      return Promise.resolve(makeResponse({\n        statusText: 'OK',\n        headersList: [\n          ['content-type', { name: 'Content-Type', value: mimeType }]\n        ],\n        body: safelyExtractBody(dataURLStruct.body)[0]\n      }))\n    }\n    case 'file:': {\n      // For now, unfortunate as it is, file URLs are left as an exercise for the reader.\n      // When in doubt, return a network error.\n      return Promise.resolve(makeNetworkError('not implemented... yet...'))\n    }\n    case 'http:':\n    case 'https:': {\n      // Return the result of running HTTP fetch given fetchParams.\n\n      return httpFetch(fetchParams)\n        .catch((err) => makeNetworkError(err))\n    }\n    default: {\n      return Promise.resolve(makeNetworkError('unknown scheme'))\n    }\n  }\n}\n\n// https://fetch.spec.whatwg.org/#finalize-response\nfunction finalizeResponse (fetchParams, response) {\n  // 1. Set fetchParams’s request’s done flag.\n  fetchParams.request.done = true\n\n  // 2, If fetchParams’s process response done is not null, then queue a fetch\n  // task to run fetchParams’s process response done given response, with\n  // fetchParams’s task destination.\n  if (fetchParams.processResponseDone != null) {\n    queueMicrotask(() => fetchParams.processResponseDone(response))\n  }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-finale\nfunction fetchFinale (fetchParams, response) {\n  // 1. Let timingInfo be fetchParams’s timing info.\n  let timingInfo = fetchParams.timingInfo\n\n  // 2. If response is not a network error and fetchParams’s request’s client is a secure context,\n  //    then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting\n  //    `Server-Timing` from response’s internal response’s header list.\n  // TODO\n\n  // 3. Let processResponseEndOfBody be the following steps:\n  const processResponseEndOfBody = () => {\n    // 1. Let unsafeEndTime be the unsafe shared current time.\n    const unsafeEndTime = Date.now() // ?\n\n    // 2. If fetchParams’s request’s destination is \"document\", then set fetchParams’s controller’s\n    //    full timing info to fetchParams’s timing info.\n    if (fetchParams.request.destination === 'document') {\n      fetchParams.controller.fullTimingInfo = timingInfo\n    }\n\n    // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:\n    fetchParams.controller.reportTimingSteps = () => {\n      // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.\n      if (fetchParams.request.url.protocol !== 'https:') {\n        return\n      }\n\n      // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global.\n      timingInfo.endTime = unsafeEndTime\n\n      // 3. Let cacheState be response’s cache state.\n      let cacheState = response.cacheState\n\n      // 4. Let bodyInfo be response’s body info.\n      const bodyInfo = response.bodyInfo\n\n      // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an\n      //    opaque timing info for timingInfo and set cacheState to the empty string.\n      if (!response.timingAllowPassed) {\n        timingInfo = createOpaqueTimingInfo(timingInfo)\n\n        cacheState = ''\n      }\n\n      // 6. Let responseStatus be 0.\n      let responseStatus = 0\n\n      // 7. If fetchParams’s request’s mode is not \"navigate\" or response’s has-cross-origin-redirects is false:\n      if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {\n        // 1. Set responseStatus to response’s status.\n        responseStatus = response.status\n\n        // 2. Let mimeType be the result of extracting a MIME type from response’s header list.\n        const mimeType = extractMimeType(response.headersList)\n\n        // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType.\n        if (mimeType !== 'failure') {\n          bodyInfo.contentType = minimizeSupportedMimeType(mimeType)\n        }\n      }\n\n      // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo,\n      //    fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,\n      //    and responseStatus.\n      if (fetchParams.request.initiatorType != null) {\n        // TODO: update markresourcetiming\n        markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)\n      }\n    }\n\n    // 4. Let processResponseEndOfBodyTask be the following steps:\n    const processResponseEndOfBodyTask = () => {\n      // 1. Set fetchParams’s request’s done flag.\n      fetchParams.request.done = true\n\n      // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process\n      //    response end-of-body given response.\n      if (fetchParams.processResponseEndOfBody != null) {\n        queueMicrotask(() => fetchParams.processResponseEndOfBody(response))\n      }\n\n      // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s\n      //    global object is fetchParams’s task destination, then run fetchParams’s controller’s report\n      //    timing steps given fetchParams’s request’s client’s global object.\n      if (fetchParams.request.initiatorType != null) {\n        fetchParams.controller.reportTimingSteps()\n      }\n    }\n\n    // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination\n    queueMicrotask(() => processResponseEndOfBodyTask())\n  }\n\n  // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s\n  //    process response given response, with fetchParams’s task destination.\n  if (fetchParams.processResponse != null) {\n    queueMicrotask(() => {\n      fetchParams.processResponse(response)\n      fetchParams.processResponse = null\n    })\n  }\n\n  // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.\n  const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)\n\n  // 6. If internalResponse’s body is null, then run processResponseEndOfBody.\n  // 7. Otherwise:\n  if (internalResponse.body == null) {\n    processResponseEndOfBody()\n  } else {\n    // mcollina: all the following steps of the specs are skipped.\n    // The internal transform stream is not needed.\n    // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541\n\n    // 1. Let transformStream be a new TransformStream.\n    // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream.\n    // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm\n    //    set to processResponseEndOfBody.\n    // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.\n\n    finished(internalResponse.body.stream, () => {\n      processResponseEndOfBody()\n    })\n  }\n}\n\n// https://fetch.spec.whatwg.org/#http-fetch\nasync function httpFetch (fetchParams) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let actualResponse be null.\n  let actualResponse = null\n\n  // 4. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 5. If request’s service-workers mode is \"all\", then:\n  if (request.serviceWorkers === 'all') {\n    // TODO\n  }\n\n  // 6. If response is null, then:\n  if (response === null) {\n    // 1. If makeCORSPreflight is true and one of these conditions is true:\n    // TODO\n\n    // 2. If request’s redirect mode is \"follow\", then set request’s\n    // service-workers mode to \"none\".\n    if (request.redirect === 'follow') {\n      request.serviceWorkers = 'none'\n    }\n\n    // 3. Set response and actualResponse to the result of running\n    // HTTP-network-or-cache fetch given fetchParams.\n    actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n    // 4. If request’s response tainting is \"cors\" and a CORS check\n    // for request and response returns failure, then return a network error.\n    if (\n      request.responseTainting === 'cors' &&\n      corsCheck(request, response) === 'failure'\n    ) {\n      return makeNetworkError('cors failure')\n    }\n\n    // 5. If the TAO check for request and response returns failure, then set\n    // request’s timing allow failed flag.\n    if (TAOCheck(request, response) === 'failure') {\n      request.timingAllowFailed = true\n    }\n  }\n\n  // 7. If either request’s response tainting or response’s type\n  // is \"opaque\", and the cross-origin resource policy check with\n  // request’s origin, request’s client, request’s destination,\n  // and actualResponse returns blocked, then return a network error.\n  if (\n    (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n    crossOriginResourcePolicyCheck(\n      request.origin,\n      request.client,\n      request.destination,\n      actualResponse\n    ) === 'blocked'\n  ) {\n    return makeNetworkError('blocked')\n  }\n\n  // 8. If actualResponse’s status is a redirect status, then:\n  if (redirectStatusSet.has(actualResponse.status)) {\n    // 1. If actualResponse’s status is not 303, request’s body is not null,\n    // and the connection uses HTTP/2, then user agents may, and are even\n    // encouraged to, transmit an RST_STREAM frame.\n    // See, https://github.com/whatwg/fetch/issues/1288\n    if (request.redirect !== 'manual') {\n      fetchParams.controller.connection.destroy(undefined, false)\n    }\n\n    // 2. Switch on request’s redirect mode:\n    if (request.redirect === 'error') {\n      // Set response to a network error.\n      response = makeNetworkError('unexpected redirect')\n    } else if (request.redirect === 'manual') {\n      // Set response to an opaque-redirect filtered response whose internal\n      // response is actualResponse.\n      // NOTE(spec): On the web this would return an `opaqueredirect` response,\n      // but that doesn't make sense server side.\n      // See https://github.com/nodejs/undici/issues/1193.\n      response = actualResponse\n    } else if (request.redirect === 'follow') {\n      // Set response to the result of running HTTP-redirect fetch given\n      // fetchParams and response.\n      response = await httpRedirectFetch(fetchParams, response)\n    } else {\n      assert(false)\n    }\n  }\n\n  // 9. Set response’s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 10. Return response.\n  return response\n}\n\n// https://fetch.spec.whatwg.org/#http-redirect-fetch\nfunction httpRedirectFetch (fetchParams, response) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let actualResponse be response, if response is not a filtered response,\n  // and response’s internal response otherwise.\n  const actualResponse = response.internalResponse\n    ? response.internalResponse\n    : response\n\n  // 3. Let locationURL be actualResponse’s location URL given request’s current\n  // URL’s fragment.\n  let locationURL\n\n  try {\n    locationURL = responseLocationURL(\n      actualResponse,\n      requestCurrentURL(request).hash\n    )\n\n    // 4. If locationURL is null, then return response.\n    if (locationURL == null) {\n      return response\n    }\n  } catch (err) {\n    // 5. If locationURL is failure, then return a network error.\n    return Promise.resolve(makeNetworkError(err))\n  }\n\n  // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network\n  // error.\n  if (!urlIsHttpHttpsScheme(locationURL)) {\n    return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))\n  }\n\n  // 7. If request’s redirect count is 20, then return a network error.\n  if (request.redirectCount === 20) {\n    return Promise.resolve(makeNetworkError('redirect count exceeded'))\n  }\n\n  // 8. Increase request’s redirect count by 1.\n  request.redirectCount += 1\n\n  // 9. If request’s mode is \"cors\", locationURL includes credentials, and\n  // request’s origin is not same origin with locationURL’s origin, then return\n  //  a network error.\n  if (\n    request.mode === 'cors' &&\n    (locationURL.username || locationURL.password) &&\n    !sameOrigin(request, locationURL)\n  ) {\n    return Promise.resolve(makeNetworkError('cross origin not allowed for request mode \"cors\"'))\n  }\n\n  // 10. If request’s response tainting is \"cors\" and locationURL includes\n  // credentials, then return a network error.\n  if (\n    request.responseTainting === 'cors' &&\n    (locationURL.username || locationURL.password)\n  ) {\n    return Promise.resolve(makeNetworkError(\n      'URL cannot contain credentials for request mode \"cors\"'\n    ))\n  }\n\n  // 11. If actualResponse’s status is not 303, request’s body is non-null,\n  // and request’s body’s source is null, then return a network error.\n  if (\n    actualResponse.status !== 303 &&\n    request.body != null &&\n    request.body.source == null\n  ) {\n    return Promise.resolve(makeNetworkError())\n  }\n\n  // 12. If one of the following is true\n  // - actualResponse’s status is 301 or 302 and request’s method is `POST`\n  // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`\n  if (\n    ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||\n    (actualResponse.status === 303 &&\n      !GET_OR_HEAD.includes(request.method))\n  ) {\n    // then:\n    // 1. Set request’s method to `GET` and request’s body to null.\n    request.method = 'GET'\n    request.body = null\n\n    // 2. For each headerName of request-body-header name, delete headerName from\n    // request’s header list.\n    for (const headerName of requestBodyHeader) {\n      request.headersList.delete(headerName)\n    }\n  }\n\n  // 13. If request’s current URL’s origin is not same origin with locationURL’s\n  //     origin, then for each headerName of CORS non-wildcard request-header name,\n  //     delete headerName from request’s header list.\n  if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n    // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name\n    request.headersList.delete('authorization', true)\n\n    // https://fetch.spec.whatwg.org/#authentication-entries\n    request.headersList.delete('proxy-authorization', true)\n\n    // \"Cookie\" and \"Host\" are forbidden request-headers, which undici doesn't implement.\n    request.headersList.delete('cookie', true)\n    request.headersList.delete('host', true)\n  }\n\n  // 14. If request’s body is non-null, then set request’s body to the first return\n  // value of safely extracting request’s body’s source.\n  if (request.body != null) {\n    assert(request.body.source != null)\n    request.body = safelyExtractBody(request.body.source)[0]\n  }\n\n  // 15. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 16. Set timingInfo’s redirect end time and post-redirect start time to the\n  // coarsened shared current time given fetchParams’s cross-origin isolated\n  // capability.\n  timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =\n    coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n\n  // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s\n  //  redirect start time to timingInfo’s start time.\n  if (timingInfo.redirectStartTime === 0) {\n    timingInfo.redirectStartTime = timingInfo.startTime\n  }\n\n  // 18. Append locationURL to request’s URL list.\n  request.urlList.push(locationURL)\n\n  // 19. Invoke set request’s referrer policy on redirect on request and\n  // actualResponse.\n  setRequestReferrerPolicyOnRedirect(request, actualResponse)\n\n  // 20. Return the result of running main fetch given fetchParams and true.\n  return mainFetch(fetchParams, true)\n}\n\n// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch\nasync function httpNetworkOrCacheFetch (\n  fetchParams,\n  isAuthenticationFetch = false,\n  isNewConnectionFetch = false\n) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let httpFetchParams be null.\n  let httpFetchParams = null\n\n  // 3. Let httpRequest be null.\n  let httpRequest = null\n\n  // 4. Let response be null.\n  let response = null\n\n  // 5. Let storedResponse be null.\n  // TODO: cache\n\n  // 6. Let httpCache be null.\n  const httpCache = null\n\n  // 7. Let the revalidatingFlag be unset.\n  const revalidatingFlag = false\n\n  // 8. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. If request’s window is \"no-window\" and request’s redirect mode is\n  //    \"error\", then set httpFetchParams to fetchParams and httpRequest to\n  //    request.\n  if (request.window === 'no-window' && request.redirect === 'error') {\n    httpFetchParams = fetchParams\n    httpRequest = request\n  } else {\n    // Otherwise:\n\n    // 1. Set httpRequest to a clone of request.\n    httpRequest = cloneRequest(request)\n\n    // 2. Set httpFetchParams to a copy of fetchParams.\n    httpFetchParams = { ...fetchParams }\n\n    // 3. Set httpFetchParams’s request to httpRequest.\n    httpFetchParams.request = httpRequest\n  }\n\n  //    3. Let includeCredentials be true if one of\n  const includeCredentials =\n    request.credentials === 'include' ||\n    (request.credentials === 'same-origin' &&\n      request.responseTainting === 'basic')\n\n  //    4. Let contentLength be httpRequest’s body’s length, if httpRequest’s\n  //    body is non-null; otherwise null.\n  const contentLength = httpRequest.body ? httpRequest.body.length : null\n\n  //    5. Let contentLengthHeaderValue be null.\n  let contentLengthHeaderValue = null\n\n  //    6. If httpRequest’s body is null and httpRequest’s method is `POST` or\n  //    `PUT`, then set contentLengthHeaderValue to `0`.\n  if (\n    httpRequest.body == null &&\n    ['POST', 'PUT'].includes(httpRequest.method)\n  ) {\n    contentLengthHeaderValue = '0'\n  }\n\n  //    7. If contentLength is non-null, then set contentLengthHeaderValue to\n  //    contentLength, serialized and isomorphic encoded.\n  if (contentLength != null) {\n    contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)\n  }\n\n  //    8. If contentLengthHeaderValue is non-null, then append\n  //    `Content-Length`/contentLengthHeaderValue to httpRequest’s header\n  //    list.\n  if (contentLengthHeaderValue != null) {\n    httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)\n  }\n\n  //    9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,\n  //    contentLengthHeaderValue) to httpRequest’s header list.\n\n  //    10. If contentLength is non-null and httpRequest’s keepalive is true,\n  //    then:\n  if (contentLength != null && httpRequest.keepalive) {\n    // NOTE: keepalive is a noop outside of browser context.\n  }\n\n  //    11. If httpRequest’s referrer is a URL, then append\n  //    `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,\n  //     to httpRequest’s header list.\n  if (httpRequest.referrer instanceof URL) {\n    httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)\n  }\n\n  //    12. Append a request `Origin` header for httpRequest.\n  appendRequestOriginHeader(httpRequest)\n\n  //    13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]\n  appendFetchMetadata(httpRequest)\n\n  //    14. If httpRequest’s header list does not contain `User-Agent`, then\n  //    user agents should append `User-Agent`/default `User-Agent` value to\n  //    httpRequest’s header list.\n  if (!httpRequest.headersList.contains('user-agent', true)) {\n    httpRequest.headersList.append('user-agent', defaultUserAgent)\n  }\n\n  //    15. If httpRequest’s cache mode is \"default\" and httpRequest’s header\n  //    list contains `If-Modified-Since`, `If-None-Match`,\n  //    `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set\n  //    httpRequest’s cache mode to \"no-store\".\n  if (\n    httpRequest.cache === 'default' &&\n    (httpRequest.headersList.contains('if-modified-since', true) ||\n      httpRequest.headersList.contains('if-none-match', true) ||\n      httpRequest.headersList.contains('if-unmodified-since', true) ||\n      httpRequest.headersList.contains('if-match', true) ||\n      httpRequest.headersList.contains('if-range', true))\n  ) {\n    httpRequest.cache = 'no-store'\n  }\n\n  //    16. If httpRequest’s cache mode is \"no-cache\", httpRequest’s prevent\n  //    no-cache cache-control header modification flag is unset, and\n  //    httpRequest’s header list does not contain `Cache-Control`, then append\n  //    `Cache-Control`/`max-age=0` to httpRequest’s header list.\n  if (\n    httpRequest.cache === 'no-cache' &&\n    !httpRequest.preventNoCacheCacheControlHeaderModification &&\n    !httpRequest.headersList.contains('cache-control', true)\n  ) {\n    httpRequest.headersList.append('cache-control', 'max-age=0', true)\n  }\n\n  //    17. If httpRequest’s cache mode is \"no-store\" or \"reload\", then:\n  if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {\n    // 1. If httpRequest’s header list does not contain `Pragma`, then append\n    // `Pragma`/`no-cache` to httpRequest’s header list.\n    if (!httpRequest.headersList.contains('pragma', true)) {\n      httpRequest.headersList.append('pragma', 'no-cache', true)\n    }\n\n    // 2. If httpRequest’s header list does not contain `Cache-Control`,\n    // then append `Cache-Control`/`no-cache` to httpRequest’s header list.\n    if (!httpRequest.headersList.contains('cache-control', true)) {\n      httpRequest.headersList.append('cache-control', 'no-cache', true)\n    }\n  }\n\n  //    18. If httpRequest’s header list contains `Range`, then append\n  //    `Accept-Encoding`/`identity` to httpRequest’s header list.\n  if (httpRequest.headersList.contains('range', true)) {\n    httpRequest.headersList.append('accept-encoding', 'identity', true)\n  }\n\n  //    19. Modify httpRequest’s header list per HTTP. Do not append a given\n  //    header if httpRequest’s header list contains that header’s name.\n  //    TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129\n  if (!httpRequest.headersList.contains('accept-encoding', true)) {\n    if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n      httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)\n    } else {\n      httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)\n    }\n  }\n\n  httpRequest.headersList.delete('host', true)\n\n  //    20. If includeCredentials is true, then:\n  if (includeCredentials) {\n    // 1. If the user agent is not configured to block cookies for httpRequest\n    // (see section 7 of [COOKIES]), then:\n    // TODO: credentials\n    // 2. If httpRequest’s header list does not contain `Authorization`, then:\n    // TODO: credentials\n  }\n\n  //    21. If there’s a proxy-authentication entry, use it as appropriate.\n  //    TODO: proxy-authentication\n\n  //    22. Set httpCache to the result of determining the HTTP cache\n  //    partition, given httpRequest.\n  //    TODO: cache\n\n  //    23. If httpCache is null, then set httpRequest’s cache mode to\n  //    \"no-store\".\n  if (httpCache == null) {\n    httpRequest.cache = 'no-store'\n  }\n\n  //    24. If httpRequest’s cache mode is neither \"no-store\" nor \"reload\",\n  //    then:\n  if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {\n    // TODO: cache\n  }\n\n  // 9. If aborted, then return the appropriate network error for fetchParams.\n  // TODO\n\n  // 10. If response is null, then:\n  if (response == null) {\n    // 1. If httpRequest’s cache mode is \"only-if-cached\", then return a\n    // network error.\n    if (httpRequest.cache === 'only-if-cached') {\n      return makeNetworkError('only if cached')\n    }\n\n    // 2. Let forwardResponse be the result of running HTTP-network fetch\n    // given httpFetchParams, includeCredentials, and isNewConnectionFetch.\n    const forwardResponse = await httpNetworkFetch(\n      httpFetchParams,\n      includeCredentials,\n      isNewConnectionFetch\n    )\n\n    // 3. If httpRequest’s method is unsafe and forwardResponse’s status is\n    // in the range 200 to 399, inclusive, invalidate appropriate stored\n    // responses in httpCache, as per the \"Invalidation\" chapter of HTTP\n    // Caching, and set storedResponse to null. [HTTP-CACHING]\n    if (\n      !safeMethodsSet.has(httpRequest.method) &&\n      forwardResponse.status >= 200 &&\n      forwardResponse.status <= 399\n    ) {\n      // TODO: cache\n    }\n\n    // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,\n    // then:\n    if (revalidatingFlag && forwardResponse.status === 304) {\n      // TODO: cache\n    }\n\n    // 5. If response is null, then:\n    if (response == null) {\n      // 1. Set response to forwardResponse.\n      response = forwardResponse\n\n      // 2. Store httpRequest and forwardResponse in httpCache, as per the\n      // \"Storing Responses in Caches\" chapter of HTTP Caching. [HTTP-CACHING]\n      // TODO: cache\n    }\n  }\n\n  // 11. Set response’s URL list to a clone of httpRequest’s URL list.\n  response.urlList = [...httpRequest.urlList]\n\n  // 12. If httpRequest’s header list contains `Range`, then set response’s\n  // range-requested flag.\n  if (httpRequest.headersList.contains('range', true)) {\n    response.rangeRequested = true\n  }\n\n  // 13. Set response’s request-includes-credentials to includeCredentials.\n  response.requestIncludesCredentials = includeCredentials\n\n  // 14. If response’s status is 401, httpRequest’s response tainting is not\n  // \"cors\", includeCredentials is true, and request’s window is an environment\n  // settings object, then:\n  // TODO\n\n  // 15. If response’s status is 407, then:\n  if (response.status === 407) {\n    // 1. If request’s window is \"no-window\", then return a network error.\n    if (request.window === 'no-window') {\n      return makeNetworkError()\n    }\n\n    // 2. ???\n\n    // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n    if (isCancelled(fetchParams)) {\n      return makeAppropriateNetworkError(fetchParams)\n    }\n\n    // 4. Prompt the end user as appropriate in request’s window and store\n    // the result as a proxy-authentication entry. [HTTP-AUTH]\n    // TODO: Invoke some kind of callback?\n\n    // 5. Set response to the result of running HTTP-network-or-cache fetch given\n    // fetchParams.\n    // TODO\n    return makeNetworkError('proxy authentication required')\n  }\n\n  // 16. If all of the following are true\n  if (\n    // response’s status is 421\n    response.status === 421 &&\n    // isNewConnectionFetch is false\n    !isNewConnectionFetch &&\n    // request’s body is null, or request’s body is non-null and request’s body’s source is non-null\n    (request.body == null || request.body.source != null)\n  ) {\n    // then:\n\n    // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n    if (isCancelled(fetchParams)) {\n      return makeAppropriateNetworkError(fetchParams)\n    }\n\n    // 2. Set response to the result of running HTTP-network-or-cache\n    // fetch given fetchParams, isAuthenticationFetch, and true.\n\n    // TODO (spec): The spec doesn't specify this but we need to cancel\n    // the active response before we can start a new one.\n    // https://github.com/whatwg/fetch/issues/1293\n    fetchParams.controller.connection.destroy()\n\n    response = await httpNetworkOrCacheFetch(\n      fetchParams,\n      isAuthenticationFetch,\n      true\n    )\n  }\n\n  // 17. If isAuthenticationFetch is true, then create an authentication entry\n  if (isAuthenticationFetch) {\n    // TODO\n  }\n\n  // 18. Return response.\n  return response\n}\n\n// https://fetch.spec.whatwg.org/#http-network-fetch\nasync function httpNetworkFetch (\n  fetchParams,\n  includeCredentials = false,\n  forceNewConnection = false\n) {\n  assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)\n\n  fetchParams.controller.connection = {\n    abort: null,\n    destroyed: false,\n    destroy (err, abort = true) {\n      if (!this.destroyed) {\n        this.destroyed = true\n        if (abort) {\n          this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))\n        }\n      }\n    }\n  }\n\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 4. Let httpCache be the result of determining the HTTP cache partition,\n  // given request.\n  // TODO: cache\n  const httpCache = null\n\n  // 5. If httpCache is null, then set request’s cache mode to \"no-store\".\n  if (httpCache == null) {\n    request.cache = 'no-store'\n  }\n\n  // 6. Let networkPartitionKey be the result of determining the network\n  // partition key given request.\n  // TODO\n\n  // 7. Let newConnection be \"yes\" if forceNewConnection is true; otherwise\n  // \"no\".\n  const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars\n\n  // 8. Switch on request’s mode:\n  if (request.mode === 'websocket') {\n    // Let connection be the result of obtaining a WebSocket connection,\n    // given request’s current URL.\n    // TODO\n  } else {\n    // Let connection be the result of obtaining a connection, given\n    // networkPartitionKey, request’s current URL’s origin,\n    // includeCredentials, and forceNewConnection.\n    // TODO\n  }\n\n  // 9. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. If connection is failure, then return a network error.\n\n  //    2. Set timingInfo’s final connection timing info to the result of\n  //    calling clamp and coarsen connection timing info with connection’s\n  //    timing info, timingInfo’s post-redirect start time, and fetchParams’s\n  //    cross-origin isolated capability.\n\n  //    3. If connection is not an HTTP/2 connection, request’s body is non-null,\n  //    and request’s body’s source is null, then append (`Transfer-Encoding`,\n  //    `chunked`) to request’s header list.\n\n  //    4. Set timingInfo’s final network-request start time to the coarsened\n  //    shared current time given fetchParams’s cross-origin isolated\n  //    capability.\n\n  //    5. Set response to the result of making an HTTP request over connection\n  //    using request with the following caveats:\n\n  //        - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]\n  //        [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]\n\n  //        - If request’s body is non-null, and request’s body’s source is null,\n  //        then the user agent may have a buffer of up to 64 kibibytes and store\n  //        a part of request’s body in that buffer. If the user agent reads from\n  //        request’s body beyond that buffer’s size and the user agent needs to\n  //        resend request, then instead return a network error.\n\n  //        - Set timingInfo’s final network-response start time to the coarsened\n  //        shared current time given fetchParams’s cross-origin isolated capability,\n  //        immediately after the user agent’s HTTP parser receives the first byte\n  //        of the response (e.g., frame header bytes for HTTP/2 or response status\n  //        line for HTTP/1.x).\n\n  //        - Wait until all the headers are transmitted.\n\n  //        - Any responses whose status is in the range 100 to 199, inclusive,\n  //        and is not 101, are to be ignored, except for the purposes of setting\n  //        timingInfo’s final network-response start time above.\n\n  //    - If request’s header list contains `Transfer-Encoding`/`chunked` and\n  //    response is transferred via HTTP/1.0 or older, then return a network\n  //    error.\n\n  //    - If the HTTP request results in a TLS client certificate dialog, then:\n\n  //        1. If request’s window is an environment settings object, make the\n  //        dialog available in request’s window.\n\n  //        2. Otherwise, return a network error.\n\n  // To transmit request’s body body, run these steps:\n  let requestBody = null\n  // 1. If body is null and fetchParams’s process request end-of-body is\n  // non-null, then queue a fetch task given fetchParams’s process request\n  // end-of-body and fetchParams’s task destination.\n  if (request.body == null && fetchParams.processRequestEndOfBody) {\n    queueMicrotask(() => fetchParams.processRequestEndOfBody())\n  } else if (request.body != null) {\n    // 2. Otherwise, if body is non-null:\n\n    //    1. Let processBodyChunk given bytes be these steps:\n    const processBodyChunk = async function * (bytes) {\n      // 1. If the ongoing fetch is terminated, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. Run this step in parallel: transmit bytes.\n      yield bytes\n\n      // 3. If fetchParams’s process request body is non-null, then run\n      // fetchParams’s process request body given bytes’s length.\n      fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)\n    }\n\n    // 2. Let processEndOfBody be these steps:\n    const processEndOfBody = () => {\n      // 1. If fetchParams is canceled, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. If fetchParams’s process request end-of-body is non-null,\n      // then run fetchParams’s process request end-of-body.\n      if (fetchParams.processRequestEndOfBody) {\n        fetchParams.processRequestEndOfBody()\n      }\n    }\n\n    // 3. Let processBodyError given e be these steps:\n    const processBodyError = (e) => {\n      // 1. If fetchParams is canceled, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. If e is an \"AbortError\" DOMException, then abort fetchParams’s controller.\n      if (e.name === 'AbortError') {\n        fetchParams.controller.abort()\n      } else {\n        fetchParams.controller.terminate(e)\n      }\n    }\n\n    // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,\n    // processBodyError, and fetchParams’s task destination.\n    requestBody = (async function * () {\n      try {\n        for await (const bytes of request.body.stream) {\n          yield * processBodyChunk(bytes)\n        }\n        processEndOfBody()\n      } catch (err) {\n        processBodyError(err)\n      }\n    })()\n  }\n\n  try {\n    // socket is only provided for websockets\n    const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })\n\n    if (socket) {\n      response = makeResponse({ status, statusText, headersList, socket })\n    } else {\n      const iterator = body[Symbol.asyncIterator]()\n      fetchParams.controller.next = () => iterator.next()\n\n      response = makeResponse({ status, statusText, headersList })\n    }\n  } catch (err) {\n    // 10. If aborted, then:\n    if (err.name === 'AbortError') {\n      // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n      fetchParams.controller.connection.destroy()\n\n      // 2. Return the appropriate network error for fetchParams.\n      return makeAppropriateNetworkError(fetchParams, err)\n    }\n\n    return makeNetworkError(err)\n  }\n\n  // 11. Let pullAlgorithm be an action that resumes the ongoing fetch\n  // if it is suspended.\n  const pullAlgorithm = async () => {\n    await fetchParams.controller.resume()\n  }\n\n  // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s\n  // controller with reason, given reason.\n  const cancelAlgorithm = (reason) => {\n    // If the aborted fetch was already terminated, then we do not\n    // need to do anything.\n    if (!isCancelled(fetchParams)) {\n      fetchParams.controller.abort(reason)\n    }\n  }\n\n  // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by\n  // the user agent.\n  // TODO\n\n  // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object\n  // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.\n  // TODO\n\n  // 15. Let stream be a new ReadableStream.\n  // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm,\n  //     cancelAlgorithm set to cancelAlgorithm.\n  const stream = new ReadableStream(\n    {\n      async start (controller) {\n        fetchParams.controller.controller = controller\n      },\n      async pull (controller) {\n        await pullAlgorithm(controller)\n      },\n      async cancel (reason) {\n        await cancelAlgorithm(reason)\n      },\n      type: 'bytes'\n    }\n  )\n\n  // 17. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. Set response’s body to a new body whose stream is stream.\n  response.body = { stream, source: null, length: null }\n\n  //    2. If response is not a network error and request’s cache mode is\n  //    not \"no-store\", then update response in httpCache for request.\n  //    TODO\n\n  //    3. If includeCredentials is true and the user agent is not configured\n  //    to block cookies for request (see section 7 of [COOKIES]), then run the\n  //    \"set-cookie-string\" parsing algorithm (see section 5.2 of [COOKIES]) on\n  //    the value of each header whose name is a byte-case-insensitive match for\n  //    `Set-Cookie` in response’s header list, if any, and request’s current URL.\n  //    TODO\n\n  // 18. If aborted, then:\n  // TODO\n\n  // 19. Run these steps in parallel:\n\n  //    1. Run these steps, but abort when fetchParams is canceled:\n  fetchParams.controller.onAborted = onAborted\n  fetchParams.controller.on('terminated', onAborted)\n  fetchParams.controller.resume = async () => {\n    // 1. While true\n    while (true) {\n      // 1-3. See onData...\n\n      // 4. Set bytes to the result of handling content codings given\n      // codings and bytes.\n      let bytes\n      let isFailure\n      try {\n        const { done, value } = await fetchParams.controller.next()\n\n        if (isAborted(fetchParams)) {\n          break\n        }\n\n        bytes = done ? undefined : value\n      } catch (err) {\n        if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n          // zlib doesn't like empty streams.\n          bytes = undefined\n        } else {\n          bytes = err\n\n          // err may be propagated from the result of calling readablestream.cancel,\n          // which might not be an error. https://github.com/nodejs/undici/issues/2009\n          isFailure = true\n        }\n      }\n\n      if (bytes === undefined) {\n        // 2. Otherwise, if the bytes transmission for response’s message\n        // body is done normally and stream is readable, then close\n        // stream, finalize response for fetchParams and response, and\n        // abort these in-parallel steps.\n        readableStreamClose(fetchParams.controller.controller)\n\n        finalizeResponse(fetchParams, response)\n\n        return\n      }\n\n      // 5. Increase timingInfo’s decoded body size by bytes’s length.\n      timingInfo.decodedBodySize += bytes?.byteLength ?? 0\n\n      // 6. If bytes is failure, then terminate fetchParams’s controller.\n      if (isFailure) {\n        fetchParams.controller.terminate(bytes)\n        return\n      }\n\n      // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes\n      // into stream.\n      const buffer = new Uint8Array(bytes)\n      if (buffer.byteLength) {\n        fetchParams.controller.controller.enqueue(buffer)\n      }\n\n      // 8. If stream is errored, then terminate the ongoing fetch.\n      if (isErrored(stream)) {\n        fetchParams.controller.terminate()\n        return\n      }\n\n      // 9. If stream doesn’t need more data ask the user agent to suspend\n      // the ongoing fetch.\n      if (fetchParams.controller.controller.desiredSize <= 0) {\n        return\n      }\n    }\n  }\n\n  //    2. If aborted, then:\n  function onAborted (reason) {\n    // 2. If fetchParams is aborted, then:\n    if (isAborted(fetchParams)) {\n      // 1. Set response’s aborted flag.\n      response.aborted = true\n\n      // 2. If stream is readable, then error stream with the result of\n      //    deserialize a serialized abort reason given fetchParams’s\n      //    controller’s serialized abort reason and an\n      //    implementation-defined realm.\n      if (isReadable(stream)) {\n        fetchParams.controller.controller.error(\n          fetchParams.controller.serializedAbortReason\n        )\n      }\n    } else {\n      // 3. Otherwise, if stream is readable, error stream with a TypeError.\n      if (isReadable(stream)) {\n        fetchParams.controller.controller.error(new TypeError('terminated', {\n          cause: isErrorLike(reason) ? reason : undefined\n        }))\n      }\n    }\n\n    // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n    // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.\n    fetchParams.controller.connection.destroy()\n  }\n\n  // 20. Return response.\n  return response\n\n  function dispatch ({ body }) {\n    const url = requestCurrentURL(request)\n    /** @type {import('../..').Agent} */\n    const agent = fetchParams.controller.dispatcher\n\n    return new Promise((resolve, reject) => agent.dispatch(\n      {\n        path: url.pathname + url.search,\n        origin: url.origin,\n        method: request.method,\n        body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,\n        headers: request.headersList.entries,\n        maxRedirections: 0,\n        upgrade: request.mode === 'websocket' ? 'websocket' : undefined\n      },\n      {\n        body: null,\n        abort: null,\n\n        onConnect (abort) {\n          // TODO (fix): Do we need connection here?\n          const { connection } = fetchParams.controller\n\n          // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen\n          // connection timing info with connection’s timing info, timingInfo’s post-redirect start\n          // time, and fetchParams’s cross-origin isolated capability.\n          // TODO: implement connection timing\n          timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)\n\n          if (connection.destroyed) {\n            abort(new DOMException('The operation was aborted.', 'AbortError'))\n          } else {\n            fetchParams.controller.on('terminated', abort)\n            this.abort = connection.abort = abort\n          }\n\n          // Set timingInfo’s final network-request start time to the coarsened shared current time given\n          // fetchParams’s cross-origin isolated capability.\n          timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n        },\n\n        onResponseStarted () {\n          // Set timingInfo’s final network-response start time to the coarsened shared current\n          // time given fetchParams’s cross-origin isolated capability, immediately after the\n          // user agent’s HTTP parser receives the first byte of the response (e.g., frame header\n          // bytes for HTTP/2 or response status line for HTTP/1.x).\n          timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n        },\n\n        onHeaders (status, rawHeaders, resume, statusText) {\n          if (status < 200) {\n            return\n          }\n\n          let location = ''\n\n          const headersList = new HeadersList()\n\n          for (let i = 0; i < rawHeaders.length; i += 2) {\n            headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n          }\n          location = headersList.get('location', true)\n\n          this.body = new Readable({ read: resume })\n\n          const decoders = []\n\n          const willFollow = location && request.redirect === 'follow' &&\n            redirectStatusSet.has(status)\n\n          // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding\n          if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {\n            // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n            const contentEncoding = headersList.get('content-encoding', true)\n            // \"All content-coding values are case-insensitive...\"\n            /** @type {string[]} */\n            const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []\n\n            // Limit the number of content-encodings to prevent resource exhaustion.\n            // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).\n            const maxContentEncodings = 5\n            if (codings.length > maxContentEncodings) {\n              reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))\n              return true\n            }\n\n            for (let i = codings.length - 1; i >= 0; --i) {\n              const coding = codings[i].trim()\n              // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2\n              if (coding === 'x-gzip' || coding === 'gzip') {\n                decoders.push(zlib.createGunzip({\n                  // Be less strict when decoding compressed responses, since sometimes\n                  // servers send slightly invalid responses that are still accepted\n                  // by common browsers.\n                  // Always using Z_SYNC_FLUSH is what cURL does.\n                  flush: zlib.constants.Z_SYNC_FLUSH,\n                  finishFlush: zlib.constants.Z_SYNC_FLUSH\n                }))\n              } else if (coding === 'deflate') {\n                decoders.push(createInflate({\n                  flush: zlib.constants.Z_SYNC_FLUSH,\n                  finishFlush: zlib.constants.Z_SYNC_FLUSH\n                }))\n              } else if (coding === 'br') {\n                decoders.push(zlib.createBrotliDecompress({\n                  flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n                  finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n                }))\n              } else {\n                decoders.length = 0\n                break\n              }\n            }\n          }\n\n          const onError = this.onError.bind(this)\n\n          resolve({\n            status,\n            statusText,\n            headersList,\n            body: decoders.length\n              ? pipeline(this.body, ...decoders, (err) => {\n                if (err) {\n                  this.onError(err)\n                }\n              }).on('error', onError)\n              : this.body.on('error', onError)\n          })\n\n          return true\n        },\n\n        onData (chunk) {\n          if (fetchParams.controller.dump) {\n            return\n          }\n\n          // 1. If one or more bytes have been transmitted from response’s\n          // message body, then:\n\n          //  1. Let bytes be the transmitted bytes.\n          const bytes = chunk\n\n          //  2. Let codings be the result of extracting header list values\n          //  given `Content-Encoding` and response’s header list.\n          //  See pullAlgorithm.\n\n          //  3. Increase timingInfo’s encoded body size by bytes’s length.\n          timingInfo.encodedBodySize += bytes.byteLength\n\n          //  4. See pullAlgorithm...\n\n          return this.body.push(bytes)\n        },\n\n        onComplete () {\n          if (this.abort) {\n            fetchParams.controller.off('terminated', this.abort)\n          }\n\n          if (fetchParams.controller.onAborted) {\n            fetchParams.controller.off('terminated', fetchParams.controller.onAborted)\n          }\n\n          fetchParams.controller.ended = true\n\n          this.body.push(null)\n        },\n\n        onError (error) {\n          if (this.abort) {\n            fetchParams.controller.off('terminated', this.abort)\n          }\n\n          this.body?.destroy(error)\n\n          fetchParams.controller.terminate(error)\n\n          reject(error)\n        },\n\n        onUpgrade (status, rawHeaders, socket) {\n          if (status !== 101) {\n            return\n          }\n\n          const headersList = new HeadersList()\n\n          for (let i = 0; i < rawHeaders.length; i += 2) {\n            headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n          }\n\n          resolve({\n            status,\n            statusText: STATUS_CODES[status],\n            headersList,\n            socket\n          })\n\n          return true\n        }\n      }\n    ))\n  }\n}\n\nmodule.exports = {\n  fetch,\n  Fetch,\n  fetching,\n  finalizeAndReportTiming\n}\n","/* globals AbortController */\n\n'use strict'\n\nconst { extractBody, mixinBody, cloneBody, bodyUnusable } = require('./body')\nconst { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require('./headers')\nconst { FinalizationRegistry } = require('./dispatcher-weakref')()\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst {\n  isValidHTTPToken,\n  sameOrigin,\n  environmentSettingsObject\n} = require('./util')\nconst {\n  forbiddenMethodsSet,\n  corsSafeListedMethodsSet,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  requestDuplex\n} = require('./constants')\nconst { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util\nconst { kHeaders, kSignal, kState, kDispatcher } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('node:events')\n\nconst kAbortController = Symbol('abortController')\n\nconst requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n  signal.removeEventListener('abort', abort)\n})\n\nconst dependentControllerMap = new WeakMap()\n\nfunction buildAbort (acRef) {\n  return abort\n\n  function abort () {\n    const ac = acRef.deref()\n    if (ac !== undefined) {\n      // Currently, there is a problem with FinalizationRegistry.\n      // https://github.com/nodejs/node/issues/49344\n      // https://github.com/nodejs/node/issues/47748\n      // In the case of abort, the first step is to unregister from it.\n      // If the controller can refer to it, it is still registered.\n      // It will be removed in the future.\n      requestFinalizer.unregister(abort)\n\n      // Unsubscribe a listener.\n      // FinalizationRegistry will no longer be called, so this must be done.\n      this.removeEventListener('abort', abort)\n\n      ac.abort(this.reason)\n\n      const controllerList = dependentControllerMap.get(ac.signal)\n\n      if (controllerList !== undefined) {\n        if (controllerList.size !== 0) {\n          for (const ref of controllerList) {\n            const ctrl = ref.deref()\n            if (ctrl !== undefined) {\n              ctrl.abort(this.reason)\n            }\n          }\n          controllerList.clear()\n        }\n        dependentControllerMap.delete(ac.signal)\n      }\n    }\n  }\n}\n\nlet patchMethodWarning = false\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request {\n  // https://fetch.spec.whatwg.org/#dom-request\n  constructor (input, init = {}) {\n    webidl.util.markAsUncloneable(this)\n    if (input === kConstruct) {\n      return\n    }\n\n    const prefix = 'Request constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    input = webidl.converters.RequestInfo(input, prefix, 'input')\n    init = webidl.converters.RequestInit(init, prefix, 'init')\n\n    // 1. Let request be null.\n    let request = null\n\n    // 2. Let fallbackMode be null.\n    let fallbackMode = null\n\n    // 3. Let baseURL be this’s relevant settings object’s API base URL.\n    const baseUrl = environmentSettingsObject.settingsObject.baseUrl\n\n    // 4. Let signal be null.\n    let signal = null\n\n    // 5. If input is a string, then:\n    if (typeof input === 'string') {\n      this[kDispatcher] = init.dispatcher\n\n      // 1. Let parsedURL be the result of parsing input with baseURL.\n      // 2. If parsedURL is failure, then throw a TypeError.\n      let parsedURL\n      try {\n        parsedURL = new URL(input, baseUrl)\n      } catch (err) {\n        throw new TypeError('Failed to parse URL from ' + input, { cause: err })\n      }\n\n      // 3. If parsedURL includes credentials, then throw a TypeError.\n      if (parsedURL.username || parsedURL.password) {\n        throw new TypeError(\n          'Request cannot be constructed from a URL that includes credentials: ' +\n            input\n        )\n      }\n\n      // 4. Set request to a new request whose URL is parsedURL.\n      request = makeRequest({ urlList: [parsedURL] })\n\n      // 5. Set fallbackMode to \"cors\".\n      fallbackMode = 'cors'\n    } else {\n      this[kDispatcher] = init.dispatcher || input[kDispatcher]\n\n      // 6. Otherwise:\n\n      // 7. Assert: input is a Request object.\n      assert(input instanceof Request)\n\n      // 8. Set request to input’s request.\n      request = input[kState]\n\n      // 9. Set signal to input’s signal.\n      signal = input[kSignal]\n    }\n\n    // 7. Let origin be this’s relevant settings object’s origin.\n    const origin = environmentSettingsObject.settingsObject.origin\n\n    // 8. Let window be \"client\".\n    let window = 'client'\n\n    // 9. If request’s window is an environment settings object and its origin\n    // is same origin with origin, then set window to request’s window.\n    if (\n      request.window?.constructor?.name === 'EnvironmentSettingsObject' &&\n      sameOrigin(request.window, origin)\n    ) {\n      window = request.window\n    }\n\n    // 10. If init[\"window\"] exists and is non-null, then throw a TypeError.\n    if (init.window != null) {\n      throw new TypeError(`'window' option '${window}' must be null`)\n    }\n\n    // 11. If init[\"window\"] exists, then set window to \"no-window\".\n    if ('window' in init) {\n      window = 'no-window'\n    }\n\n    // 12. Set request to a new request with the following properties:\n    request = makeRequest({\n      // URL request’s URL.\n      // undici implementation note: this is set as the first item in request's urlList in makeRequest\n      // method request’s method.\n      method: request.method,\n      // header list A copy of request’s header list.\n      // undici implementation note: headersList is cloned in makeRequest\n      headersList: request.headersList,\n      // unsafe-request flag Set.\n      unsafeRequest: request.unsafeRequest,\n      // client This’s relevant settings object.\n      client: environmentSettingsObject.settingsObject,\n      // window window.\n      window,\n      // priority request’s priority.\n      priority: request.priority,\n      // origin request’s origin. The propagation of the origin is only significant for navigation requests\n      // being handled by a service worker. In this scenario a request can have an origin that is different\n      // from the current client.\n      origin: request.origin,\n      // referrer request’s referrer.\n      referrer: request.referrer,\n      // referrer policy request’s referrer policy.\n      referrerPolicy: request.referrerPolicy,\n      // mode request’s mode.\n      mode: request.mode,\n      // credentials mode request’s credentials mode.\n      credentials: request.credentials,\n      // cache mode request’s cache mode.\n      cache: request.cache,\n      // redirect mode request’s redirect mode.\n      redirect: request.redirect,\n      // integrity metadata request’s integrity metadata.\n      integrity: request.integrity,\n      // keepalive request’s keepalive.\n      keepalive: request.keepalive,\n      // reload-navigation flag request’s reload-navigation flag.\n      reloadNavigation: request.reloadNavigation,\n      // history-navigation flag request’s history-navigation flag.\n      historyNavigation: request.historyNavigation,\n      // URL list A clone of request’s URL list.\n      urlList: [...request.urlList]\n    })\n\n    const initHasKey = Object.keys(init).length !== 0\n\n    // 13. If init is not empty, then:\n    if (initHasKey) {\n      // 1. If request’s mode is \"navigate\", then set it to \"same-origin\".\n      if (request.mode === 'navigate') {\n        request.mode = 'same-origin'\n      }\n\n      // 2. Unset request’s reload-navigation flag.\n      request.reloadNavigation = false\n\n      // 3. Unset request’s history-navigation flag.\n      request.historyNavigation = false\n\n      // 4. Set request’s origin to \"client\".\n      request.origin = 'client'\n\n      // 5. Set request’s referrer to \"client\"\n      request.referrer = 'client'\n\n      // 6. Set request’s referrer policy to the empty string.\n      request.referrerPolicy = ''\n\n      // 7. Set request’s URL to request’s current URL.\n      request.url = request.urlList[request.urlList.length - 1]\n\n      // 8. Set request’s URL list to « request’s URL ».\n      request.urlList = [request.url]\n    }\n\n    // 14. If init[\"referrer\"] exists, then:\n    if (init.referrer !== undefined) {\n      // 1. Let referrer be init[\"referrer\"].\n      const referrer = init.referrer\n\n      // 2. If referrer is the empty string, then set request’s referrer to \"no-referrer\".\n      if (referrer === '') {\n        request.referrer = 'no-referrer'\n      } else {\n        // 1. Let parsedReferrer be the result of parsing referrer with\n        // baseURL.\n        // 2. If parsedReferrer is failure, then throw a TypeError.\n        let parsedReferrer\n        try {\n          parsedReferrer = new URL(referrer, baseUrl)\n        } catch (err) {\n          throw new TypeError(`Referrer \"${referrer}\" is not a valid URL.`, { cause: err })\n        }\n\n        // 3. If one of the following is true\n        // - parsedReferrer’s scheme is \"about\" and path is the string \"client\"\n        // - parsedReferrer’s origin is not same origin with origin\n        // then set request’s referrer to \"client\".\n        if (\n          (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||\n          (origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl))\n        ) {\n          request.referrer = 'client'\n        } else {\n          // 4. Otherwise, set request’s referrer to parsedReferrer.\n          request.referrer = parsedReferrer\n        }\n      }\n    }\n\n    // 15. If init[\"referrerPolicy\"] exists, then set request’s referrer policy\n    // to it.\n    if (init.referrerPolicy !== undefined) {\n      request.referrerPolicy = init.referrerPolicy\n    }\n\n    // 16. Let mode be init[\"mode\"] if it exists, and fallbackMode otherwise.\n    let mode\n    if (init.mode !== undefined) {\n      mode = init.mode\n    } else {\n      mode = fallbackMode\n    }\n\n    // 17. If mode is \"navigate\", then throw a TypeError.\n    if (mode === 'navigate') {\n      throw webidl.errors.exception({\n        header: 'Request constructor',\n        message: 'invalid request mode navigate.'\n      })\n    }\n\n    // 18. If mode is non-null, set request’s mode to mode.\n    if (mode != null) {\n      request.mode = mode\n    }\n\n    // 19. If init[\"credentials\"] exists, then set request’s credentials mode\n    // to it.\n    if (init.credentials !== undefined) {\n      request.credentials = init.credentials\n    }\n\n    // 18. If init[\"cache\"] exists, then set request’s cache mode to it.\n    if (init.cache !== undefined) {\n      request.cache = init.cache\n    }\n\n    // 21. If request’s cache mode is \"only-if-cached\" and request’s mode is\n    // not \"same-origin\", then throw a TypeError.\n    if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {\n      throw new TypeError(\n        \"'only-if-cached' can be set only with 'same-origin' mode\"\n      )\n    }\n\n    // 22. If init[\"redirect\"] exists, then set request’s redirect mode to it.\n    if (init.redirect !== undefined) {\n      request.redirect = init.redirect\n    }\n\n    // 23. If init[\"integrity\"] exists, then set request’s integrity metadata to it.\n    if (init.integrity != null) {\n      request.integrity = String(init.integrity)\n    }\n\n    // 24. If init[\"keepalive\"] exists, then set request’s keepalive to it.\n    if (init.keepalive !== undefined) {\n      request.keepalive = Boolean(init.keepalive)\n    }\n\n    // 25. If init[\"method\"] exists, then:\n    if (init.method !== undefined) {\n      // 1. Let method be init[\"method\"].\n      let method = init.method\n\n      const mayBeNormalized = normalizedMethodRecords[method]\n\n      if (mayBeNormalized !== undefined) {\n        // Note: Bypass validation DELETE, GET, HEAD, OPTIONS, POST, PUT, PATCH and these lowercase ones\n        request.method = mayBeNormalized\n      } else {\n        // 2. If method is not a method or method is a forbidden method, then\n        // throw a TypeError.\n        if (!isValidHTTPToken(method)) {\n          throw new TypeError(`'${method}' is not a valid HTTP method.`)\n        }\n\n        const upperCase = method.toUpperCase()\n\n        if (forbiddenMethodsSet.has(upperCase)) {\n          throw new TypeError(`'${method}' HTTP method is unsupported.`)\n        }\n\n        // 3. Normalize method.\n        // https://fetch.spec.whatwg.org/#concept-method-normalize\n        // Note: must be in uppercase\n        method = normalizedMethodRecordsBase[upperCase] ?? method\n\n        // 4. Set request’s method to method.\n        request.method = method\n      }\n\n      if (!patchMethodWarning && request.method === 'patch') {\n        process.emitWarning('Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.', {\n          code: 'UNDICI-FETCH-patch'\n        })\n\n        patchMethodWarning = true\n      }\n    }\n\n    // 26. If init[\"signal\"] exists, then set signal to it.\n    if (init.signal !== undefined) {\n      signal = init.signal\n    }\n\n    // 27. Set this’s request to request.\n    this[kState] = request\n\n    // 28. Set this’s signal to a new AbortSignal object with this’s relevant\n    // Realm.\n    // TODO: could this be simplified with AbortSignal.any\n    // (https://dom.spec.whatwg.org/#dom-abortsignal-any)\n    const ac = new AbortController()\n    this[kSignal] = ac.signal\n\n    // 29. If signal is not null, then make this’s signal follow signal.\n    if (signal != null) {\n      if (\n        !signal ||\n        typeof signal.aborted !== 'boolean' ||\n        typeof signal.addEventListener !== 'function'\n      ) {\n        throw new TypeError(\n          \"Failed to construct 'Request': member signal is not of type AbortSignal.\"\n        )\n      }\n\n      if (signal.aborted) {\n        ac.abort(signal.reason)\n      } else {\n        // Keep a strong ref to ac while request object\n        // is alive. This is needed to prevent AbortController\n        // from being prematurely garbage collected.\n        // See, https://github.com/nodejs/undici/issues/1926.\n        this[kAbortController] = ac\n\n        const acRef = new WeakRef(ac)\n        const abort = buildAbort(acRef)\n\n        // Third-party AbortControllers may not work with these.\n        // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.\n        try {\n          // If the max amount of listeners is equal to the default, increase it\n          // This is only available in node >= v19.9.0\n          if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {\n            setMaxListeners(1500, signal)\n          } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {\n            setMaxListeners(1500, signal)\n          }\n        } catch {}\n\n        util.addAbortListener(signal, abort)\n        // The third argument must be a registry key to be unregistered.\n        // Without it, you cannot unregister.\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n        // abort is used as the unregister key. (because it is unique)\n        requestFinalizer.register(ac, { signal, abort }, abort)\n      }\n    }\n\n    // 30. Set this’s headers to a new Headers object with this’s relevant\n    // Realm, whose header list is request’s header list and guard is\n    // \"request\".\n    this[kHeaders] = new Headers(kConstruct)\n    setHeadersList(this[kHeaders], request.headersList)\n    setHeadersGuard(this[kHeaders], 'request')\n\n    // 31. If this’s request’s mode is \"no-cors\", then:\n    if (mode === 'no-cors') {\n      // 1. If this’s request’s method is not a CORS-safelisted method,\n      // then throw a TypeError.\n      if (!corsSafeListedMethodsSet.has(request.method)) {\n        throw new TypeError(\n          `'${request.method} is unsupported in no-cors mode.`\n        )\n      }\n\n      // 2. Set this’s headers’s guard to \"request-no-cors\".\n      setHeadersGuard(this[kHeaders], 'request-no-cors')\n    }\n\n    // 32. If init is not empty, then:\n    if (initHasKey) {\n      /** @type {HeadersList} */\n      const headersList = getHeadersList(this[kHeaders])\n      // 1. Let headers be a copy of this’s headers and its associated header\n      // list.\n      // 2. If init[\"headers\"] exists, then set headers to init[\"headers\"].\n      const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)\n\n      // 3. Empty this’s headers’s header list.\n      headersList.clear()\n\n      // 4. If headers is a Headers object, then for each header in its header\n      // list, append header’s name/header’s value to this’s headers.\n      if (headers instanceof HeadersList) {\n        for (const { name, value } of headers.rawValues()) {\n          headersList.append(name, value, false)\n        }\n        // Note: Copy the `set-cookie` meta-data.\n        headersList.cookies = headers.cookies\n      } else {\n        // 5. Otherwise, fill this’s headers with headers.\n        fillHeaders(this[kHeaders], headers)\n      }\n    }\n\n    // 33. Let inputBody be input’s request’s body if input is a Request\n    // object; otherwise null.\n    const inputBody = input instanceof Request ? input[kState].body : null\n\n    // 34. If either init[\"body\"] exists and is non-null or inputBody is\n    // non-null, and request’s method is `GET` or `HEAD`, then throw a\n    // TypeError.\n    if (\n      (init.body != null || inputBody != null) &&\n      (request.method === 'GET' || request.method === 'HEAD')\n    ) {\n      throw new TypeError('Request with GET/HEAD method cannot have body.')\n    }\n\n    // 35. Let initBody be null.\n    let initBody = null\n\n    // 36. If init[\"body\"] exists and is non-null, then:\n    if (init.body != null) {\n      // 1. Let Content-Type be null.\n      // 2. Set initBody and Content-Type to the result of extracting\n      // init[\"body\"], with keepalive set to request’s keepalive.\n      const [extractedBody, contentType] = extractBody(\n        init.body,\n        request.keepalive\n      )\n      initBody = extractedBody\n\n      // 3, If Content-Type is non-null and this’s headers’s header list does\n      // not contain `Content-Type`, then append `Content-Type`/Content-Type to\n      // this’s headers.\n      if (contentType && !getHeadersList(this[kHeaders]).contains('content-type', true)) {\n        this[kHeaders].append('content-type', contentType)\n      }\n    }\n\n    // 37. Let inputOrInitBody be initBody if it is non-null; otherwise\n    // inputBody.\n    const inputOrInitBody = initBody ?? inputBody\n\n    // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is\n    // null, then:\n    if (inputOrInitBody != null && inputOrInitBody.source == null) {\n      // 1. If initBody is non-null and init[\"duplex\"] does not exist,\n      //    then throw a TypeError.\n      if (initBody != null && init.duplex == null) {\n        throw new TypeError('RequestInit: duplex option is required when sending a body.')\n      }\n\n      // 2. If this’s request’s mode is neither \"same-origin\" nor \"cors\",\n      // then throw a TypeError.\n      if (request.mode !== 'same-origin' && request.mode !== 'cors') {\n        throw new TypeError(\n          'If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"'\n        )\n      }\n\n      // 3. Set this’s request’s use-CORS-preflight flag.\n      request.useCORSPreflightFlag = true\n    }\n\n    // 39. Let finalBody be inputOrInitBody.\n    let finalBody = inputOrInitBody\n\n    // 40. If initBody is null and inputBody is non-null, then:\n    if (initBody == null && inputBody != null) {\n      // 1. If input is unusable, then throw a TypeError.\n      if (bodyUnusable(input)) {\n        throw new TypeError(\n          'Cannot construct a Request with a Request object that has already been used.'\n        )\n      }\n\n      // 2. Set finalBody to the result of creating a proxy for inputBody.\n      // https://streams.spec.whatwg.org/#readablestream-create-a-proxy\n      const identityTransform = new TransformStream()\n      inputBody.stream.pipeThrough(identityTransform)\n      finalBody = {\n        source: inputBody.source,\n        length: inputBody.length,\n        stream: identityTransform.readable\n      }\n    }\n\n    // 41. Set this’s request’s body to finalBody.\n    this[kState].body = finalBody\n  }\n\n  // Returns request’s HTTP method, which is \"GET\" by default.\n  get method () {\n    webidl.brandCheck(this, Request)\n\n    // The method getter steps are to return this’s request’s method.\n    return this[kState].method\n  }\n\n  // Returns the URL of request as a string.\n  get url () {\n    webidl.brandCheck(this, Request)\n\n    // The url getter steps are to return this’s request’s URL, serialized.\n    return URLSerializer(this[kState].url)\n  }\n\n  // Returns a Headers object consisting of the headers associated with request.\n  // Note that headers added in the network layer by the user agent will not\n  // be accounted for in this object, e.g., the \"Host\" header.\n  get headers () {\n    webidl.brandCheck(this, Request)\n\n    // The headers getter steps are to return this’s headers.\n    return this[kHeaders]\n  }\n\n  // Returns the kind of resource requested by request, e.g., \"document\"\n  // or \"script\".\n  get destination () {\n    webidl.brandCheck(this, Request)\n\n    // The destination getter are to return this’s request’s destination.\n    return this[kState].destination\n  }\n\n  // Returns the referrer of request. Its value can be a same-origin URL if\n  // explicitly set in init, the empty string to indicate no referrer, and\n  // \"about:client\" when defaulting to the global’s default. This is used\n  // during fetching to determine the value of the `Referer` header of the\n  // request being made.\n  get referrer () {\n    webidl.brandCheck(this, Request)\n\n    // 1. If this’s request’s referrer is \"no-referrer\", then return the\n    // empty string.\n    if (this[kState].referrer === 'no-referrer') {\n      return ''\n    }\n\n    // 2. If this’s request’s referrer is \"client\", then return\n    // \"about:client\".\n    if (this[kState].referrer === 'client') {\n      return 'about:client'\n    }\n\n    // Return this’s request’s referrer, serialized.\n    return this[kState].referrer.toString()\n  }\n\n  // Returns the referrer policy associated with request.\n  // This is used during fetching to compute the value of the request’s\n  // referrer.\n  get referrerPolicy () {\n    webidl.brandCheck(this, Request)\n\n    // The referrerPolicy getter steps are to return this’s request’s referrer policy.\n    return this[kState].referrerPolicy\n  }\n\n  // Returns the mode associated with request, which is a string indicating\n  // whether the request will use CORS, or will be restricted to same-origin\n  // URLs.\n  get mode () {\n    webidl.brandCheck(this, Request)\n\n    // The mode getter steps are to return this’s request’s mode.\n    return this[kState].mode\n  }\n\n  // Returns the credentials mode associated with request,\n  // which is a string indicating whether credentials will be sent with the\n  // request always, never, or only when sent to a same-origin URL.\n  get credentials () {\n    // The credentials getter steps are to return this’s request’s credentials mode.\n    return this[kState].credentials\n  }\n\n  // Returns the cache mode associated with request,\n  // which is a string indicating how the request will\n  // interact with the browser’s cache when fetching.\n  get cache () {\n    webidl.brandCheck(this, Request)\n\n    // The cache getter steps are to return this’s request’s cache mode.\n    return this[kState].cache\n  }\n\n  // Returns the redirect mode associated with request,\n  // which is a string indicating how redirects for the\n  // request will be handled during fetching. A request\n  // will follow redirects by default.\n  get redirect () {\n    webidl.brandCheck(this, Request)\n\n    // The redirect getter steps are to return this’s request’s redirect mode.\n    return this[kState].redirect\n  }\n\n  // Returns request’s subresource integrity metadata, which is a\n  // cryptographic hash of the resource being fetched. Its value\n  // consists of multiple hashes separated by whitespace. [SRI]\n  get integrity () {\n    webidl.brandCheck(this, Request)\n\n    // The integrity getter steps are to return this’s request’s integrity\n    // metadata.\n    return this[kState].integrity\n  }\n\n  // Returns a boolean indicating whether or not request can outlive the\n  // global in which it was created.\n  get keepalive () {\n    webidl.brandCheck(this, Request)\n\n    // The keepalive getter steps are to return this’s request’s keepalive.\n    return this[kState].keepalive\n  }\n\n  // Returns a boolean indicating whether or not request is for a reload\n  // navigation.\n  get isReloadNavigation () {\n    webidl.brandCheck(this, Request)\n\n    // The isReloadNavigation getter steps are to return true if this’s\n    // request’s reload-navigation flag is set; otherwise false.\n    return this[kState].reloadNavigation\n  }\n\n  // Returns a boolean indicating whether or not request is for a history\n  // navigation (a.k.a. back-forward navigation).\n  get isHistoryNavigation () {\n    webidl.brandCheck(this, Request)\n\n    // The isHistoryNavigation getter steps are to return true if this’s request’s\n    // history-navigation flag is set; otherwise false.\n    return this[kState].historyNavigation\n  }\n\n  // Returns the signal associated with request, which is an AbortSignal\n  // object indicating whether or not request has been aborted, and its\n  // abort event handler.\n  get signal () {\n    webidl.brandCheck(this, Request)\n\n    // The signal getter steps are to return this’s signal.\n    return this[kSignal]\n  }\n\n  get body () {\n    webidl.brandCheck(this, Request)\n\n    return this[kState].body ? this[kState].body.stream : null\n  }\n\n  get bodyUsed () {\n    webidl.brandCheck(this, Request)\n\n    return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n  }\n\n  get duplex () {\n    webidl.brandCheck(this, Request)\n\n    return 'half'\n  }\n\n  // Returns a clone of request.\n  clone () {\n    webidl.brandCheck(this, Request)\n\n    // 1. If this is unusable, then throw a TypeError.\n    if (bodyUnusable(this)) {\n      throw new TypeError('unusable')\n    }\n\n    // 2. Let clonedRequest be the result of cloning this’s request.\n    const clonedRequest = cloneRequest(this[kState])\n\n    // 3. Let clonedRequestObject be the result of creating a Request object,\n    // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.\n    // 4. Make clonedRequestObject’s signal follow this’s signal.\n    const ac = new AbortController()\n    if (this.signal.aborted) {\n      ac.abort(this.signal.reason)\n    } else {\n      let list = dependentControllerMap.get(this.signal)\n      if (list === undefined) {\n        list = new Set()\n        dependentControllerMap.set(this.signal, list)\n      }\n      const acRef = new WeakRef(ac)\n      list.add(acRef)\n      util.addAbortListener(\n        ac.signal,\n        buildAbort(acRef)\n      )\n    }\n\n    // 4. Return clonedRequestObject.\n    return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders]))\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    if (options.depth === null) {\n      options.depth = 2\n    }\n\n    options.colors ??= true\n\n    const properties = {\n      method: this.method,\n      url: this.url,\n      headers: this.headers,\n      destination: this.destination,\n      referrer: this.referrer,\n      referrerPolicy: this.referrerPolicy,\n      mode: this.mode,\n      credentials: this.credentials,\n      cache: this.cache,\n      redirect: this.redirect,\n      integrity: this.integrity,\n      keepalive: this.keepalive,\n      isReloadNavigation: this.isReloadNavigation,\n      isHistoryNavigation: this.isHistoryNavigation,\n      signal: this.signal\n    }\n\n    return `Request ${nodeUtil.formatWithOptions(options, properties)}`\n  }\n}\n\nmixinBody(Request)\n\n// https://fetch.spec.whatwg.org/#requests\nfunction makeRequest (init) {\n  return {\n    method: init.method ?? 'GET',\n    localURLsOnly: init.localURLsOnly ?? false,\n    unsafeRequest: init.unsafeRequest ?? false,\n    body: init.body ?? null,\n    client: init.client ?? null,\n    reservedClient: init.reservedClient ?? null,\n    replacesClientId: init.replacesClientId ?? '',\n    window: init.window ?? 'client',\n    keepalive: init.keepalive ?? false,\n    serviceWorkers: init.serviceWorkers ?? 'all',\n    initiator: init.initiator ?? '',\n    destination: init.destination ?? '',\n    priority: init.priority ?? null,\n    origin: init.origin ?? 'client',\n    policyContainer: init.policyContainer ?? 'client',\n    referrer: init.referrer ?? 'client',\n    referrerPolicy: init.referrerPolicy ?? '',\n    mode: init.mode ?? 'no-cors',\n    useCORSPreflightFlag: init.useCORSPreflightFlag ?? false,\n    credentials: init.credentials ?? 'same-origin',\n    useCredentials: init.useCredentials ?? false,\n    cache: init.cache ?? 'default',\n    redirect: init.redirect ?? 'follow',\n    integrity: init.integrity ?? '',\n    cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? '',\n    parserMetadata: init.parserMetadata ?? '',\n    reloadNavigation: init.reloadNavigation ?? false,\n    historyNavigation: init.historyNavigation ?? false,\n    userActivation: init.userActivation ?? false,\n    taintedOrigin: init.taintedOrigin ?? false,\n    redirectCount: init.redirectCount ?? 0,\n    responseTainting: init.responseTainting ?? 'basic',\n    preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false,\n    done: init.done ?? false,\n    timingAllowFailed: init.timingAllowFailed ?? false,\n    urlList: init.urlList,\n    url: init.urlList[0],\n    headersList: init.headersList\n      ? new HeadersList(init.headersList)\n      : new HeadersList()\n  }\n}\n\n// https://fetch.spec.whatwg.org/#concept-request-clone\nfunction cloneRequest (request) {\n  // To clone a request request, run these steps:\n\n  // 1. Let newRequest be a copy of request, except for its body.\n  const newRequest = makeRequest({ ...request, body: null })\n\n  // 2. If request’s body is non-null, set newRequest’s body to the\n  // result of cloning request’s body.\n  if (request.body != null) {\n    newRequest.body = cloneBody(newRequest, request.body)\n  }\n\n  // 3. Return newRequest.\n  return newRequest\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-create\n * @param {any} innerRequest\n * @param {AbortSignal} signal\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Request}\n */\nfunction fromInnerRequest (innerRequest, signal, guard) {\n  const request = new Request(kConstruct)\n  request[kState] = innerRequest\n  request[kSignal] = signal\n  request[kHeaders] = new Headers(kConstruct)\n  setHeadersList(request[kHeaders], innerRequest.headersList)\n  setHeadersGuard(request[kHeaders], guard)\n  return request\n}\n\nObject.defineProperties(Request.prototype, {\n  method: kEnumerableProperty,\n  url: kEnumerableProperty,\n  headers: kEnumerableProperty,\n  redirect: kEnumerableProperty,\n  clone: kEnumerableProperty,\n  signal: kEnumerableProperty,\n  duplex: kEnumerableProperty,\n  destination: kEnumerableProperty,\n  body: kEnumerableProperty,\n  bodyUsed: kEnumerableProperty,\n  isHistoryNavigation: kEnumerableProperty,\n  isReloadNavigation: kEnumerableProperty,\n  keepalive: kEnumerableProperty,\n  integrity: kEnumerableProperty,\n  cache: kEnumerableProperty,\n  credentials: kEnumerableProperty,\n  attribute: kEnumerableProperty,\n  referrerPolicy: kEnumerableProperty,\n  referrer: kEnumerableProperty,\n  mode: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Request',\n    configurable: true\n  }\n})\n\nwebidl.converters.Request = webidl.interfaceConverter(\n  Request\n)\n\n// https://fetch.spec.whatwg.org/#requestinfo\nwebidl.converters.RequestInfo = function (V, prefix, argument) {\n  if (typeof V === 'string') {\n    return webidl.converters.USVString(V, prefix, argument)\n  }\n\n  if (V instanceof Request) {\n    return webidl.converters.Request(V, prefix, argument)\n  }\n\n  return webidl.converters.USVString(V, prefix, argument)\n}\n\nwebidl.converters.AbortSignal = webidl.interfaceConverter(\n  AbortSignal\n)\n\n// https://fetch.spec.whatwg.org/#requestinit\nwebidl.converters.RequestInit = webidl.dictionaryConverter([\n  {\n    key: 'method',\n    converter: webidl.converters.ByteString\n  },\n  {\n    key: 'headers',\n    converter: webidl.converters.HeadersInit\n  },\n  {\n    key: 'body',\n    converter: webidl.nullableConverter(\n      webidl.converters.BodyInit\n    )\n  },\n  {\n    key: 'referrer',\n    converter: webidl.converters.USVString\n  },\n  {\n    key: 'referrerPolicy',\n    converter: webidl.converters.DOMString,\n    // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n    allowedValues: referrerPolicy\n  },\n  {\n    key: 'mode',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#concept-request-mode\n    allowedValues: requestMode\n  },\n  {\n    key: 'credentials',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestcredentials\n    allowedValues: requestCredentials\n  },\n  {\n    key: 'cache',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestcache\n    allowedValues: requestCache\n  },\n  {\n    key: 'redirect',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestredirect\n    allowedValues: requestRedirect\n  },\n  {\n    key: 'integrity',\n    converter: webidl.converters.DOMString\n  },\n  {\n    key: 'keepalive',\n    converter: webidl.converters.boolean\n  },\n  {\n    key: 'signal',\n    converter: webidl.nullableConverter(\n      (signal) => webidl.converters.AbortSignal(\n        signal,\n        'RequestInit',\n        'signal',\n        { strict: false }\n      )\n    )\n  },\n  {\n    key: 'window',\n    converter: webidl.converters.any\n  },\n  {\n    key: 'duplex',\n    converter: webidl.converters.DOMString,\n    allowedValues: requestDuplex\n  },\n  {\n    key: 'dispatcher', // undici specific option\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }\n","'use strict'\n\nconst { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require('./headers')\nconst { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require('./body')\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst { kEnumerableProperty } = util\nconst {\n  isValidReasonPhrase,\n  isCancelled,\n  isAborted,\n  isBlobLike,\n  serializeJavascriptValueToJSONString,\n  isErrorLike,\n  isomorphicEncode,\n  environmentSettingsObject: relevantRealm\n} = require('./util')\nconst {\n  redirectStatusSet,\n  nullBodyStatus\n} = require('./constants')\nconst { kState, kHeaders } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { FormData } = require('./formdata')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { types } = require('node:util')\n\nconst textEncoder = new TextEncoder('utf-8')\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response {\n  // Creates network error Response.\n  static error () {\n    // The static error() method steps are to return the result of creating a\n    // Response object, given a new network error, \"immutable\", and this’s\n    // relevant Realm.\n    const responseObject = fromInnerResponse(makeNetworkError(), 'immutable')\n\n    return responseObject\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-json\n  static json (data, init = {}) {\n    webidl.argumentLengthCheck(arguments, 1, 'Response.json')\n\n    if (init !== null) {\n      init = webidl.converters.ResponseInit(init)\n    }\n\n    // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.\n    const bytes = textEncoder.encode(\n      serializeJavascriptValueToJSONString(data)\n    )\n\n    // 2. Let body be the result of extracting bytes.\n    const body = extractBody(bytes)\n\n    // 3. Let responseObject be the result of creating a Response object, given a new response,\n    //    \"response\", and this’s relevant Realm.\n    const responseObject = fromInnerResponse(makeResponse({}), 'response')\n\n    // 4. Perform initialize a response given responseObject, init, and (body, \"application/json\").\n    initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })\n\n    // 5. Return responseObject.\n    return responseObject\n  }\n\n  // Creates a redirect Response that redirects to url with status status.\n  static redirect (url, status = 302) {\n    webidl.argumentLengthCheck(arguments, 1, 'Response.redirect')\n\n    url = webidl.converters.USVString(url)\n    status = webidl.converters['unsigned short'](status)\n\n    // 1. Let parsedURL be the result of parsing url with current settings\n    // object’s API base URL.\n    // 2. If parsedURL is failure, then throw a TypeError.\n    // TODO: base-URL?\n    let parsedURL\n    try {\n      parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl)\n    } catch (err) {\n      throw new TypeError(`Failed to parse URL from ${url}`, { cause: err })\n    }\n\n    // 3. If status is not a redirect status, then throw a RangeError.\n    if (!redirectStatusSet.has(status)) {\n      throw new RangeError(`Invalid status code ${status}`)\n    }\n\n    // 4. Let responseObject be the result of creating a Response object,\n    // given a new response, \"immutable\", and this’s relevant Realm.\n    const responseObject = fromInnerResponse(makeResponse({}), 'immutable')\n\n    // 5. Set responseObject’s response’s status to status.\n    responseObject[kState].status = status\n\n    // 6. Let value be parsedURL, serialized and isomorphic encoded.\n    const value = isomorphicEncode(URLSerializer(parsedURL))\n\n    // 7. Append `Location`/value to responseObject’s response’s header list.\n    responseObject[kState].headersList.append('location', value, true)\n\n    // 8. Return responseObject.\n    return responseObject\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response\n  constructor (body = null, init = {}) {\n    webidl.util.markAsUncloneable(this)\n    if (body === kConstruct) {\n      return\n    }\n\n    if (body !== null) {\n      body = webidl.converters.BodyInit(body)\n    }\n\n    init = webidl.converters.ResponseInit(init)\n\n    // 1. Set this’s response to a new response.\n    this[kState] = makeResponse({})\n\n    // 2. Set this’s headers to a new Headers object with this’s relevant\n    // Realm, whose header list is this’s response’s header list and guard\n    // is \"response\".\n    this[kHeaders] = new Headers(kConstruct)\n    setHeadersGuard(this[kHeaders], 'response')\n    setHeadersList(this[kHeaders], this[kState].headersList)\n\n    // 3. Let bodyWithType be null.\n    let bodyWithType = null\n\n    // 4. If body is non-null, then set bodyWithType to the result of extracting body.\n    if (body != null) {\n      const [extractedBody, type] = extractBody(body)\n      bodyWithType = { body: extractedBody, type }\n    }\n\n    // 5. Perform initialize a response given this, init, and bodyWithType.\n    initializeResponse(this, init, bodyWithType)\n  }\n\n  // Returns response’s type, e.g., \"cors\".\n  get type () {\n    webidl.brandCheck(this, Response)\n\n    // The type getter steps are to return this’s response’s type.\n    return this[kState].type\n  }\n\n  // Returns response’s URL, if it has one; otherwise the empty string.\n  get url () {\n    webidl.brandCheck(this, Response)\n\n    const urlList = this[kState].urlList\n\n    // The url getter steps are to return the empty string if this’s\n    // response’s URL is null; otherwise this’s response’s URL,\n    // serialized with exclude fragment set to true.\n    const url = urlList[urlList.length - 1] ?? null\n\n    if (url === null) {\n      return ''\n    }\n\n    return URLSerializer(url, true)\n  }\n\n  // Returns whether response was obtained through a redirect.\n  get redirected () {\n    webidl.brandCheck(this, Response)\n\n    // The redirected getter steps are to return true if this’s response’s URL\n    // list has more than one item; otherwise false.\n    return this[kState].urlList.length > 1\n  }\n\n  // Returns response’s status.\n  get status () {\n    webidl.brandCheck(this, Response)\n\n    // The status getter steps are to return this’s response’s status.\n    return this[kState].status\n  }\n\n  // Returns whether response’s status is an ok status.\n  get ok () {\n    webidl.brandCheck(this, Response)\n\n    // The ok getter steps are to return true if this’s response’s status is an\n    // ok status; otherwise false.\n    return this[kState].status >= 200 && this[kState].status <= 299\n  }\n\n  // Returns response’s status message.\n  get statusText () {\n    webidl.brandCheck(this, Response)\n\n    // The statusText getter steps are to return this’s response’s status\n    // message.\n    return this[kState].statusText\n  }\n\n  // Returns response’s headers as Headers.\n  get headers () {\n    webidl.brandCheck(this, Response)\n\n    // The headers getter steps are to return this’s headers.\n    return this[kHeaders]\n  }\n\n  get body () {\n    webidl.brandCheck(this, Response)\n\n    return this[kState].body ? this[kState].body.stream : null\n  }\n\n  get bodyUsed () {\n    webidl.brandCheck(this, Response)\n\n    return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n  }\n\n  // Returns a clone of response.\n  clone () {\n    webidl.brandCheck(this, Response)\n\n    // 1. If this is unusable, then throw a TypeError.\n    if (bodyUnusable(this)) {\n      throw webidl.errors.exception({\n        header: 'Response.clone',\n        message: 'Body has already been consumed.'\n      })\n    }\n\n    // 2. Let clonedResponse be the result of cloning this’s response.\n    const clonedResponse = cloneResponse(this[kState])\n\n    // Note: To re-register because of a new stream.\n    if (hasFinalizationRegistry && this[kState].body?.stream) {\n      streamRegistry.register(this, new WeakRef(this[kState].body.stream))\n    }\n\n    // 3. Return the result of creating a Response object, given\n    // clonedResponse, this’s headers’s guard, and this’s relevant Realm.\n    return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders]))\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    if (options.depth === null) {\n      options.depth = 2\n    }\n\n    options.colors ??= true\n\n    const properties = {\n      status: this.status,\n      statusText: this.statusText,\n      headers: this.headers,\n      body: this.body,\n      bodyUsed: this.bodyUsed,\n      ok: this.ok,\n      redirected: this.redirected,\n      type: this.type,\n      url: this.url\n    }\n\n    return `Response ${nodeUtil.formatWithOptions(options, properties)}`\n  }\n}\n\nmixinBody(Response)\n\nObject.defineProperties(Response.prototype, {\n  type: kEnumerableProperty,\n  url: kEnumerableProperty,\n  status: kEnumerableProperty,\n  ok: kEnumerableProperty,\n  redirected: kEnumerableProperty,\n  statusText: kEnumerableProperty,\n  headers: kEnumerableProperty,\n  clone: kEnumerableProperty,\n  body: kEnumerableProperty,\n  bodyUsed: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Response',\n    configurable: true\n  }\n})\n\nObject.defineProperties(Response, {\n  json: kEnumerableProperty,\n  redirect: kEnumerableProperty,\n  error: kEnumerableProperty\n})\n\n// https://fetch.spec.whatwg.org/#concept-response-clone\nfunction cloneResponse (response) {\n  // To clone a response response, run these steps:\n\n  // 1. If response is a filtered response, then return a new identical\n  // filtered response whose internal response is a clone of response’s\n  // internal response.\n  if (response.internalResponse) {\n    return filterResponse(\n      cloneResponse(response.internalResponse),\n      response.type\n    )\n  }\n\n  // 2. Let newResponse be a copy of response, except for its body.\n  const newResponse = makeResponse({ ...response, body: null })\n\n  // 3. If response’s body is non-null, then set newResponse’s body to the\n  // result of cloning response’s body.\n  if (response.body != null) {\n    newResponse.body = cloneBody(newResponse, response.body)\n  }\n\n  // 4. Return newResponse.\n  return newResponse\n}\n\nfunction makeResponse (init) {\n  return {\n    aborted: false,\n    rangeRequested: false,\n    timingAllowPassed: false,\n    requestIncludesCredentials: false,\n    type: 'default',\n    status: 200,\n    timingInfo: null,\n    cacheState: '',\n    statusText: '',\n    ...init,\n    headersList: init?.headersList\n      ? new HeadersList(init?.headersList)\n      : new HeadersList(),\n    urlList: init?.urlList ? [...init.urlList] : []\n  }\n}\n\nfunction makeNetworkError (reason) {\n  const isError = isErrorLike(reason)\n  return makeResponse({\n    type: 'error',\n    status: 0,\n    error: isError\n      ? reason\n      : new Error(reason ? String(reason) : reason),\n    aborted: reason && reason.name === 'AbortError'\n  })\n}\n\n// @see https://fetch.spec.whatwg.org/#concept-network-error\nfunction isNetworkError (response) {\n  return (\n    // A network error is a response whose type is \"error\",\n    response.type === 'error' &&\n    // status is 0\n    response.status === 0\n  )\n}\n\nfunction makeFilteredResponse (response, state) {\n  state = {\n    internalResponse: response,\n    ...state\n  }\n\n  return new Proxy(response, {\n    get (target, p) {\n      return p in state ? state[p] : target[p]\n    },\n    set (target, p, value) {\n      assert(!(p in state))\n      target[p] = value\n      return true\n    }\n  })\n}\n\n// https://fetch.spec.whatwg.org/#concept-filtered-response\nfunction filterResponse (response, type) {\n  // Set response to the following filtered response with response as its\n  // internal response, depending on request’s response tainting:\n  if (type === 'basic') {\n    // A basic filtered response is a filtered response whose type is \"basic\"\n    // and header list excludes any headers in internal response’s header list\n    // whose name is a forbidden response-header name.\n\n    // Note: undici does not implement forbidden response-header names\n    return makeFilteredResponse(response, {\n      type: 'basic',\n      headersList: response.headersList\n    })\n  } else if (type === 'cors') {\n    // A CORS filtered response is a filtered response whose type is \"cors\"\n    // and header list excludes any headers in internal response’s header\n    // list whose name is not a CORS-safelisted response-header name, given\n    // internal response’s CORS-exposed header-name list.\n\n    // Note: undici does not implement CORS-safelisted response-header names\n    return makeFilteredResponse(response, {\n      type: 'cors',\n      headersList: response.headersList\n    })\n  } else if (type === 'opaque') {\n    // An opaque filtered response is a filtered response whose type is\n    // \"opaque\", URL list is the empty list, status is 0, status message\n    // is the empty byte sequence, header list is empty, and body is null.\n\n    return makeFilteredResponse(response, {\n      type: 'opaque',\n      urlList: Object.freeze([]),\n      status: 0,\n      statusText: '',\n      body: null\n    })\n  } else if (type === 'opaqueredirect') {\n    // An opaque-redirect filtered response is a filtered response whose type\n    // is \"opaqueredirect\", status is 0, status message is the empty byte\n    // sequence, header list is empty, and body is null.\n\n    return makeFilteredResponse(response, {\n      type: 'opaqueredirect',\n      status: 0,\n      statusText: '',\n      headersList: [],\n      body: null\n    })\n  } else {\n    assert(false)\n  }\n}\n\n// https://fetch.spec.whatwg.org/#appropriate-network-error\nfunction makeAppropriateNetworkError (fetchParams, err = null) {\n  // 1. Assert: fetchParams is canceled.\n  assert(isCancelled(fetchParams))\n\n  // 2. Return an aborted network error if fetchParams is aborted;\n  // otherwise return a network error.\n  return isAborted(fetchParams)\n    ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))\n    : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))\n}\n\n// https://whatpr.org/fetch/1392.html#initialize-a-response\nfunction initializeResponse (response, init, body) {\n  // 1. If init[\"status\"] is not in the range 200 to 599, inclusive, then\n  //    throw a RangeError.\n  if (init.status !== null && (init.status < 200 || init.status > 599)) {\n    throw new RangeError('init[\"status\"] must be in the range of 200 to 599, inclusive.')\n  }\n\n  // 2. If init[\"statusText\"] does not match the reason-phrase token production,\n  //    then throw a TypeError.\n  if ('statusText' in init && init.statusText != null) {\n    // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:\n    //   reason-phrase  = *( HTAB / SP / VCHAR / obs-text )\n    if (!isValidReasonPhrase(String(init.statusText))) {\n      throw new TypeError('Invalid statusText')\n    }\n  }\n\n  // 3. Set response’s response’s status to init[\"status\"].\n  if ('status' in init && init.status != null) {\n    response[kState].status = init.status\n  }\n\n  // 4. Set response’s response’s status message to init[\"statusText\"].\n  if ('statusText' in init && init.statusText != null) {\n    response[kState].statusText = init.statusText\n  }\n\n  // 5. If init[\"headers\"] exists, then fill response’s headers with init[\"headers\"].\n  if ('headers' in init && init.headers != null) {\n    fill(response[kHeaders], init.headers)\n  }\n\n  // 6. If body was given, then:\n  if (body) {\n    // 1. If response's status is a null body status, then throw a TypeError.\n    if (nullBodyStatus.includes(response.status)) {\n      throw webidl.errors.exception({\n        header: 'Response constructor',\n        message: `Invalid response status code ${response.status}`\n      })\n    }\n\n    // 2. Set response's body to body's body.\n    response[kState].body = body.body\n\n    // 3. If body's type is non-null and response's header list does not contain\n    //    `Content-Type`, then append (`Content-Type`, body's type) to response's header list.\n    if (body.type != null && !response[kState].headersList.contains('content-type', true)) {\n      response[kState].headersList.append('content-type', body.type, true)\n    }\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#response-create\n * @param {any} innerResponse\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Response}\n */\nfunction fromInnerResponse (innerResponse, guard) {\n  const response = new Response(kConstruct)\n  response[kState] = innerResponse\n  response[kHeaders] = new Headers(kConstruct)\n  setHeadersList(response[kHeaders], innerResponse.headersList)\n  setHeadersGuard(response[kHeaders], guard)\n\n  if (hasFinalizationRegistry && innerResponse.body?.stream) {\n    // If the target (response) is reclaimed, the cleanup callback may be called at some point with\n    // the held value provided for it (innerResponse.body.stream). The held value can be any value:\n    // a primitive or an object, even undefined. If the held value is an object, the registry keeps\n    // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n    streamRegistry.register(response, new WeakRef(innerResponse.body.stream))\n  }\n\n  return response\n}\n\nwebidl.converters.ReadableStream = webidl.interfaceConverter(\n  ReadableStream\n)\n\nwebidl.converters.FormData = webidl.interfaceConverter(\n  FormData\n)\n\nwebidl.converters.URLSearchParams = webidl.interfaceConverter(\n  URLSearchParams\n)\n\n// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit\nwebidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) {\n  if (typeof V === 'string') {\n    return webidl.converters.USVString(V, prefix, name)\n  }\n\n  if (isBlobLike(V)) {\n    return webidl.converters.Blob(V, prefix, name, { strict: false })\n  }\n\n  if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n    return webidl.converters.BufferSource(V, prefix, name)\n  }\n\n  if (util.isFormDataLike(V)) {\n    return webidl.converters.FormData(V, prefix, name, { strict: false })\n  }\n\n  if (V instanceof URLSearchParams) {\n    return webidl.converters.URLSearchParams(V, prefix, name)\n  }\n\n  return webidl.converters.DOMString(V, prefix, name)\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit\nwebidl.converters.BodyInit = function (V, prefix, argument) {\n  if (V instanceof ReadableStream) {\n    return webidl.converters.ReadableStream(V, prefix, argument)\n  }\n\n  // Note: the spec doesn't include async iterables,\n  // this is an undici extension.\n  if (V?.[Symbol.asyncIterator]) {\n    return V\n  }\n\n  return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument)\n}\n\nwebidl.converters.ResponseInit = webidl.dictionaryConverter([\n  {\n    key: 'status',\n    converter: webidl.converters['unsigned short'],\n    defaultValue: () => 200\n  },\n  {\n    key: 'statusText',\n    converter: webidl.converters.ByteString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'headers',\n    converter: webidl.converters.HeadersInit\n  }\n])\n\nmodule.exports = {\n  isNetworkError,\n  makeNetworkError,\n  makeResponse,\n  makeAppropriateNetworkError,\n  filterResponse,\n  Response,\n  cloneResponse,\n  fromInnerResponse\n}\n","'use strict'\n\nmodule.exports = {\n  kUrl: Symbol('url'),\n  kHeaders: Symbol('headers'),\n  kSignal: Symbol('signal'),\n  kState: Symbol('state'),\n  kDispatcher: Symbol('dispatcher')\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst zlib = require('node:zlib')\nconst { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants')\nconst { getGlobalOrigin } = require('./global')\nconst { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require('./data-url')\nconst { performance } = require('node:perf_hooks')\nconst { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require('../../core/util')\nconst assert = require('node:assert')\nconst { isUint8Array } = require('node:util/types')\nconst { webidl } = require('./webidl')\n\nlet supportedHashes = []\n\n// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable\n/** @type {import('crypto')} */\nlet crypto\ntry {\n  crypto = require('node:crypto')\n  const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']\n  supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))\n/* c8 ignore next 3 */\n} catch {\n\n}\n\nfunction responseURL (response) {\n  // https://fetch.spec.whatwg.org/#responses\n  // A response has an associated URL. It is a pointer to the last URL\n  // in response’s URL list and null if response’s URL list is empty.\n  const urlList = response.urlList\n  const length = urlList.length\n  return length === 0 ? null : urlList[length - 1].toString()\n}\n\n// https://fetch.spec.whatwg.org/#concept-response-location-url\nfunction responseLocationURL (response, requestFragment) {\n  // 1. If response’s status is not a redirect status, then return null.\n  if (!redirectStatusSet.has(response.status)) {\n    return null\n  }\n\n  // 2. Let location be the result of extracting header list values given\n  // `Location` and response’s header list.\n  let location = response.headersList.get('location', true)\n\n  // 3. If location is a header value, then set location to the result of\n  //    parsing location with response’s URL.\n  if (location !== null && isValidHeaderValue(location)) {\n    if (!isValidEncodedURL(location)) {\n      // Some websites respond location header in UTF-8 form without encoding them as ASCII\n      // and major browsers redirect them to correctly UTF-8 encoded addresses.\n      // Here, we handle that behavior in the same way.\n      location = normalizeBinaryStringToUtf8(location)\n    }\n    location = new URL(location, responseURL(response))\n  }\n\n  // 4. If location is a URL whose fragment is null, then set location’s\n  // fragment to requestFragment.\n  if (location && !location.hash) {\n    location.hash = requestFragment\n  }\n\n  // 5. Return location.\n  return location\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2\n * @param {string} url\n * @returns {boolean}\n */\nfunction isValidEncodedURL (url) {\n  for (let i = 0; i < url.length; ++i) {\n    const code = url.charCodeAt(i)\n\n    if (\n      code > 0x7E || // Non-US-ASCII + DEL\n      code < 0x20 // Control characters NUL - US\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it.\n * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well.\n * @param {string} value\n * @returns {string}\n */\nfunction normalizeBinaryStringToUtf8 (value) {\n  return Buffer.from(value, 'binary').toString('utf8')\n}\n\n/** @returns {URL} */\nfunction requestCurrentURL (request) {\n  return request.urlList[request.urlList.length - 1]\n}\n\nfunction requestBadPort (request) {\n  // 1. Let url be request’s current URL.\n  const url = requestCurrentURL(request)\n\n  // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,\n  // then return blocked.\n  if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {\n    return 'blocked'\n  }\n\n  // 3. Return allowed.\n  return 'allowed'\n}\n\nfunction isErrorLike (object) {\n  return object instanceof Error || (\n    object?.constructor?.name === 'Error' ||\n    object?.constructor?.name === 'DOMException'\n  )\n}\n\n// Check whether |statusText| is a ByteString and\n// matches the Reason-Phrase token production.\n// RFC 2616: https://tools.ietf.org/html/rfc2616\n// RFC 7230: https://tools.ietf.org/html/rfc7230\n// \"reason-phrase = *( HTAB / SP / VCHAR / obs-text )\"\n// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116\nfunction isValidReasonPhrase (statusText) {\n  for (let i = 0; i < statusText.length; ++i) {\n    const c = statusText.charCodeAt(i)\n    if (\n      !(\n        (\n          c === 0x09 || // HTAB\n          (c >= 0x20 && c <= 0x7e) || // SP / VCHAR\n          (c >= 0x80 && c <= 0xff)\n        ) // obs-text\n      )\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-name\n * @param {string} potentialValue\n */\nconst isValidHeaderName = isValidHTTPToken\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value\n * @param {string} potentialValue\n */\nfunction isValidHeaderValue (potentialValue) {\n  // - Has no leading or trailing HTTP tab or space bytes.\n  // - Contains no 0x00 (NUL) or HTTP newline bytes.\n  return (\n    potentialValue[0] === '\\t' ||\n    potentialValue[0] === ' ' ||\n    potentialValue[potentialValue.length - 1] === '\\t' ||\n    potentialValue[potentialValue.length - 1] === ' ' ||\n    potentialValue.includes('\\n') ||\n    potentialValue.includes('\\r') ||\n    potentialValue.includes('\\0')\n  ) === false\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect\nfunction setRequestReferrerPolicyOnRedirect (request, actualResponse) {\n  //  Given a request request and a response actualResponse, this algorithm\n  //  updates request’s referrer policy according to the Referrer-Policy\n  //  header (if any) in actualResponse.\n\n  // 1. Let policy be the result of executing § 8.1 Parse a referrer policy\n  // from a Referrer-Policy header on actualResponse.\n\n  // 8.1 Parse a referrer policy from a Referrer-Policy header\n  // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.\n  const { headersList } = actualResponse\n  // 2. Let policy be the empty string.\n  // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.\n  // 4. Return policy.\n  const policyHeader = (headersList.get('referrer-policy', true) ?? '').split(',')\n\n  // Note: As the referrer-policy can contain multiple policies\n  // separated by comma, we need to loop through all of them\n  // and pick the first valid one.\n  // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy\n  let policy = ''\n  if (policyHeader.length > 0) {\n    // The right-most policy takes precedence.\n    // The left-most policy is the fallback.\n    for (let i = policyHeader.length; i !== 0; i--) {\n      const token = policyHeader[i - 1].trim()\n      if (referrerPolicyTokens.has(token)) {\n        policy = token\n        break\n      }\n    }\n  }\n\n  // 2. If policy is not the empty string, then set request’s referrer policy to policy.\n  if (policy !== '') {\n    request.referrerPolicy = policy\n  }\n}\n\n// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check\nfunction crossOriginResourcePolicyCheck () {\n  // TODO\n  return 'allowed'\n}\n\n// https://fetch.spec.whatwg.org/#concept-cors-check\nfunction corsCheck () {\n  // TODO\n  return 'success'\n}\n\n// https://fetch.spec.whatwg.org/#concept-tao-check\nfunction TAOCheck () {\n  // TODO\n  return 'success'\n}\n\nfunction appendFetchMetadata (httpRequest) {\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header\n  //  TODO\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header\n\n  //  1. Assert: r’s url is a potentially trustworthy URL.\n  //  TODO\n\n  //  2. Let header be a Structured Header whose value is a token.\n  let header = null\n\n  //  3. Set header’s value to r’s mode.\n  header = httpRequest.mode\n\n  //  4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.\n  httpRequest.headersList.set('sec-fetch-mode', header, true)\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header\n  //  TODO\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header\n  //  TODO\n}\n\n// https://fetch.spec.whatwg.org/#append-a-request-origin-header\nfunction appendRequestOriginHeader (request) {\n  // 1. Let serializedOrigin be the result of byte-serializing a request origin\n  //    with request.\n  // TODO: implement \"byte-serializing a request origin\"\n  let serializedOrigin = request.origin\n\n  // - \"'client' is changed to an origin during fetching.\"\n  //   This doesn't happen in undici (in most cases) because undici, by default,\n  //   has no concept of origin.\n  // - request.origin can also be set to request.client.origin (client being\n  //   an environment settings object), which is undefined without using\n  //   setGlobalOrigin.\n  if (serializedOrigin === 'client' || serializedOrigin === undefined) {\n    return\n  }\n\n  // 2. If request’s response tainting is \"cors\" or request’s mode is \"websocket\",\n  //    then append (`Origin`, serializedOrigin) to request’s header list.\n  // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:\n  if (request.responseTainting === 'cors' || request.mode === 'websocket') {\n    request.headersList.append('origin', serializedOrigin, true)\n  } else if (request.method !== 'GET' && request.method !== 'HEAD') {\n    // 1. Switch on request’s referrer policy:\n    switch (request.referrerPolicy) {\n      case 'no-referrer':\n        // Set serializedOrigin to `null`.\n        serializedOrigin = null\n        break\n      case 'no-referrer-when-downgrade':\n      case 'strict-origin':\n      case 'strict-origin-when-cross-origin':\n        // If request’s origin is a tuple origin, its scheme is \"https\", and\n        // request’s current URL’s scheme is not \"https\", then set\n        // serializedOrigin to `null`.\n        if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n          serializedOrigin = null\n        }\n        break\n      case 'same-origin':\n        // If request’s origin is not same origin with request’s current URL’s\n        // origin, then set serializedOrigin to `null`.\n        if (!sameOrigin(request, requestCurrentURL(request))) {\n          serializedOrigin = null\n        }\n        break\n      default:\n        // Do nothing.\n    }\n\n    // 2. Append (`Origin`, serializedOrigin) to request’s header list.\n    request.headersList.append('origin', serializedOrigin, true)\n  }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsen-time\nfunction coarsenTime (timestamp, crossOriginIsolatedCapability) {\n  // TODO\n  return timestamp\n}\n\n// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info\nfunction clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {\n  if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {\n    return {\n      domainLookupStartTime: defaultStartTime,\n      domainLookupEndTime: defaultStartTime,\n      connectionStartTime: defaultStartTime,\n      connectionEndTime: defaultStartTime,\n      secureConnectionStartTime: defaultStartTime,\n      ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol\n    }\n  }\n\n  return {\n    domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),\n    domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),\n    connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),\n    connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),\n    secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),\n    ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol\n  }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time\nfunction coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {\n  return coarsenTime(performance.now(), crossOriginIsolatedCapability)\n}\n\n// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info\nfunction createOpaqueTimingInfo (timingInfo) {\n  return {\n    startTime: timingInfo.startTime ?? 0,\n    redirectStartTime: 0,\n    redirectEndTime: 0,\n    postRedirectStartTime: timingInfo.startTime ?? 0,\n    finalServiceWorkerStartTime: 0,\n    finalNetworkResponseStartTime: 0,\n    finalNetworkRequestStartTime: 0,\n    endTime: 0,\n    encodedBodySize: 0,\n    decodedBodySize: 0,\n    finalConnectionTimingInfo: null\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#policy-container\nfunction makePolicyContainer () {\n  // Note: the fetch spec doesn't make use of embedder policy or CSP list\n  return {\n    referrerPolicy: 'strict-origin-when-cross-origin'\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container\nfunction clonePolicyContainer (policyContainer) {\n  return {\n    referrerPolicy: policyContainer.referrerPolicy\n  }\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer\nfunction determineRequestsReferrer (request) {\n  // 1. Let policy be request's referrer policy.\n  const policy = request.referrerPolicy\n\n  // Note: policy cannot (shouldn't) be null or an empty string.\n  assert(policy)\n\n  // 2. Let environment be request’s client.\n\n  let referrerSource = null\n\n  // 3. Switch on request’s referrer:\n  if (request.referrer === 'client') {\n    // Note: node isn't a browser and doesn't implement document/iframes,\n    // so we bypass this step and replace it with our own.\n\n    const globalOrigin = getGlobalOrigin()\n\n    if (!globalOrigin || globalOrigin.origin === 'null') {\n      return 'no-referrer'\n    }\n\n    // note: we need to clone it as it's mutated\n    referrerSource = new URL(globalOrigin)\n  } else if (request.referrer instanceof URL) {\n    // Let referrerSource be request’s referrer.\n    referrerSource = request.referrer\n  }\n\n  // 4. Let request’s referrerURL be the result of stripping referrerSource for\n  //    use as a referrer.\n  let referrerURL = stripURLForReferrer(referrerSource)\n\n  // 5. Let referrerOrigin be the result of stripping referrerSource for use as\n  //    a referrer, with the origin-only flag set to true.\n  const referrerOrigin = stripURLForReferrer(referrerSource, true)\n\n  // 6. If the result of serializing referrerURL is a string whose length is\n  //    greater than 4096, set referrerURL to referrerOrigin.\n  if (referrerURL.toString().length > 4096) {\n    referrerURL = referrerOrigin\n  }\n\n  const areSameOrigin = sameOrigin(request, referrerURL)\n  const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&\n    !isURLPotentiallyTrustworthy(request.url)\n\n  // 8. Execute the switch statements corresponding to the value of policy:\n  switch (policy) {\n    case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)\n    case 'unsafe-url': return referrerURL\n    case 'same-origin':\n      return areSameOrigin ? referrerOrigin : 'no-referrer'\n    case 'origin-when-cross-origin':\n      return areSameOrigin ? referrerURL : referrerOrigin\n    case 'strict-origin-when-cross-origin': {\n      const currentURL = requestCurrentURL(request)\n\n      // 1. If the origin of referrerURL and the origin of request’s current\n      //    URL are the same, then return referrerURL.\n      if (sameOrigin(referrerURL, currentURL)) {\n        return referrerURL\n      }\n\n      // 2. If referrerURL is a potentially trustworthy URL and request’s\n      //    current URL is not a potentially trustworthy URL, then return no\n      //    referrer.\n      if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n        return 'no-referrer'\n      }\n\n      // 3. Return referrerOrigin.\n      return referrerOrigin\n    }\n    case 'strict-origin': // eslint-disable-line\n      /**\n         * 1. If referrerURL is a potentially trustworthy URL and\n         * request’s current URL is not a potentially trustworthy URL,\n         * then return no referrer.\n         * 2. Return referrerOrigin\n        */\n    case 'no-referrer-when-downgrade': // eslint-disable-line\n      /**\n       * 1. If referrerURL is a potentially trustworthy URL and\n       * request’s current URL is not a potentially trustworthy URL,\n       * then return no referrer.\n       * 2. Return referrerOrigin\n      */\n\n    default: // eslint-disable-line\n      return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin\n  }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url\n * @param {URL} url\n * @param {boolean|undefined} originOnly\n */\nfunction stripURLForReferrer (url, originOnly) {\n  // 1. Assert: url is a URL.\n  assert(url instanceof URL)\n\n  url = new URL(url)\n\n  // 2. If url’s scheme is a local scheme, then return no referrer.\n  if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {\n    return 'no-referrer'\n  }\n\n  // 3. Set url’s username to the empty string.\n  url.username = ''\n\n  // 4. Set url’s password to the empty string.\n  url.password = ''\n\n  // 5. Set url’s fragment to null.\n  url.hash = ''\n\n  // 6. If the origin-only flag is true, then:\n  if (originOnly) {\n    // 1. Set url’s path to « the empty string ».\n    url.pathname = ''\n\n    // 2. Set url’s query to null.\n    url.search = ''\n  }\n\n  // 7. Return url.\n  return url\n}\n\nfunction isURLPotentiallyTrustworthy (url) {\n  if (!(url instanceof URL)) {\n    return false\n  }\n\n  // If child of about, return true\n  if (url.href === 'about:blank' || url.href === 'about:srcdoc') {\n    return true\n  }\n\n  // If scheme is data, return true\n  if (url.protocol === 'data:') return true\n\n  // If file, return true\n  if (url.protocol === 'file:') return true\n\n  return isOriginPotentiallyTrustworthy(url.origin)\n\n  function isOriginPotentiallyTrustworthy (origin) {\n    // If origin is explicitly null, return false\n    if (origin == null || origin === 'null') return false\n\n    const originAsURL = new URL(origin)\n\n    // If secure, return true\n    if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {\n      return true\n    }\n\n    // If localhost or variants, return true\n    if (/^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^\\[(?:0*:)*?:?0*1\\]$/.test(originAsURL.hostname) ||\n     (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||\n     (originAsURL.hostname.endsWith('.localhost'))) {\n      return true\n    }\n\n    // If any other, return false\n    return false\n  }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist\n * @param {Uint8Array} bytes\n * @param {string} metadataList\n */\nfunction bytesMatch (bytes, metadataList) {\n  // If node is not built with OpenSSL support, we cannot check\n  // a request's integrity, so allow it by default (the spec will\n  // allow requests if an invalid hash is given, as precedence).\n  /* istanbul ignore if: only if node is built with --without-ssl */\n  if (crypto === undefined) {\n    return true\n  }\n\n  // 1. Let parsedMetadata be the result of parsing metadataList.\n  const parsedMetadata = parseMetadata(metadataList)\n\n  // 2. If parsedMetadata is no metadata, return true.\n  if (parsedMetadata === 'no metadata') {\n    return true\n  }\n\n  // 3. If response is not eligible for integrity validation, return false.\n  // TODO\n\n  // 4. If parsedMetadata is the empty set, return true.\n  if (parsedMetadata.length === 0) {\n    return true\n  }\n\n  // 5. Let metadata be the result of getting the strongest\n  //    metadata from parsedMetadata.\n  const strongest = getStrongestMetadata(parsedMetadata)\n  const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)\n\n  // 6. For each item in metadata:\n  for (const item of metadata) {\n    // 1. Let algorithm be the alg component of item.\n    const algorithm = item.algo\n\n    // 2. Let expectedValue be the val component of item.\n    const expectedValue = item.hash\n\n    // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e\n    // \"be liberal with padding\". This is annoying, and it's not even in the spec.\n\n    // 3. Let actualValue be the result of applying algorithm to bytes.\n    let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')\n\n    if (actualValue[actualValue.length - 1] === '=') {\n      if (actualValue[actualValue.length - 2] === '=') {\n        actualValue = actualValue.slice(0, -2)\n      } else {\n        actualValue = actualValue.slice(0, -1)\n      }\n    }\n\n    // 4. If actualValue is a case-sensitive match for expectedValue,\n    //    return true.\n    if (compareBase64Mixed(actualValue, expectedValue)) {\n      return true\n    }\n  }\n\n  // 7. Return false.\n  return false\n}\n\n// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options\n// https://www.w3.org/TR/CSP2/#source-list-syntax\n// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1\nconst parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\\s|$)( +[!-~]*)?)?/i\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata\n * @param {string} metadata\n */\nfunction parseMetadata (metadata) {\n  // 1. Let result be the empty set.\n  /** @type {{ algo: string, hash: string }[]} */\n  const result = []\n\n  // 2. Let empty be equal to true.\n  let empty = true\n\n  // 3. For each token returned by splitting metadata on spaces:\n  for (const token of metadata.split(' ')) {\n    // 1. Set empty to false.\n    empty = false\n\n    // 2. Parse token as a hash-with-options.\n    const parsedToken = parseHashWithOptions.exec(token)\n\n    // 3. If token does not parse, continue to the next token.\n    if (\n      parsedToken === null ||\n      parsedToken.groups === undefined ||\n      parsedToken.groups.algo === undefined\n    ) {\n      // Note: Chromium blocks the request at this point, but Firefox\n      // gives a warning that an invalid integrity was given. The\n      // correct behavior is to ignore these, and subsequently not\n      // check the integrity of the resource.\n      continue\n    }\n\n    // 4. Let algorithm be the hash-algo component of token.\n    const algorithm = parsedToken.groups.algo.toLowerCase()\n\n    // 5. If algorithm is a hash function recognized by the user\n    //    agent, add the parsed token to result.\n    if (supportedHashes.includes(algorithm)) {\n      result.push(parsedToken.groups)\n    }\n  }\n\n  // 4. Return no metadata if empty is true, otherwise return result.\n  if (empty === true) {\n    return 'no metadata'\n  }\n\n  return result\n}\n\n/**\n * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList\n */\nfunction getStrongestMetadata (metadataList) {\n  // Let algorithm be the algo component of the first item in metadataList.\n  // Can be sha256\n  let algorithm = metadataList[0].algo\n  // If the algorithm is sha512, then it is the strongest\n  // and we can return immediately\n  if (algorithm[3] === '5') {\n    return algorithm\n  }\n\n  for (let i = 1; i < metadataList.length; ++i) {\n    const metadata = metadataList[i]\n    // If the algorithm is sha512, then it is the strongest\n    // and we can break the loop immediately\n    if (metadata.algo[3] === '5') {\n      algorithm = 'sha512'\n      break\n    // If the algorithm is sha384, then a potential sha256 or sha384 is ignored\n    } else if (algorithm[3] === '3') {\n      continue\n    // algorithm is sha256, check if algorithm is sha384 and if so, set it as\n    // the strongest\n    } else if (metadata.algo[3] === '3') {\n      algorithm = 'sha384'\n    }\n  }\n  return algorithm\n}\n\nfunction filterMetadataListByAlgorithm (metadataList, algorithm) {\n  if (metadataList.length === 1) {\n    return metadataList\n  }\n\n  let pos = 0\n  for (let i = 0; i < metadataList.length; ++i) {\n    if (metadataList[i].algo === algorithm) {\n      metadataList[pos++] = metadataList[i]\n    }\n  }\n\n  metadataList.length = pos\n\n  return metadataList\n}\n\n/**\n * Compares two base64 strings, allowing for base64url\n * in the second string.\n *\n* @param {string} actualValue always base64\n * @param {string} expectedValue base64 or base64url\n * @returns {boolean}\n */\nfunction compareBase64Mixed (actualValue, expectedValue) {\n  if (actualValue.length !== expectedValue.length) {\n    return false\n  }\n  for (let i = 0; i < actualValue.length; ++i) {\n    if (actualValue[i] !== expectedValue[i]) {\n      if (\n        (actualValue[i] === '+' && expectedValue[i] === '-') ||\n        (actualValue[i] === '/' && expectedValue[i] === '_')\n      ) {\n        continue\n      }\n      return false\n    }\n  }\n\n  return true\n}\n\n// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request\nfunction tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {\n  // TODO\n}\n\n/**\n * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}\n * @param {URL} A\n * @param {URL} B\n */\nfunction sameOrigin (A, B) {\n  // 1. If A and B are the same opaque origin, then return true.\n  if (A.origin === B.origin && A.origin === 'null') {\n    return true\n  }\n\n  // 2. If A and B are both tuple origins and their schemes,\n  //    hosts, and port are identical, then return true.\n  if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n    return true\n  }\n\n  // 3. Return false.\n  return false\n}\n\nfunction createDeferredPromise () {\n  let res\n  let rej\n  const promise = new Promise((resolve, reject) => {\n    res = resolve\n    rej = reject\n  })\n\n  return { promise, resolve: res, reject: rej }\n}\n\nfunction isAborted (fetchParams) {\n  return fetchParams.controller.state === 'aborted'\n}\n\nfunction isCancelled (fetchParams) {\n  return fetchParams.controller.state === 'aborted' ||\n    fetchParams.controller.state === 'terminated'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-method-normalize\n * @param {string} method\n */\nfunction normalizeMethod (method) {\n  return normalizedMethodRecordsBase[method.toLowerCase()] ?? method\n}\n\n// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string\nfunction serializeJavascriptValueToJSONString (value) {\n  // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).\n  const result = JSON.stringify(value)\n\n  // 2. If result is undefined, then throw a TypeError.\n  if (result === undefined) {\n    throw new TypeError('Value is not JSON serializable')\n  }\n\n  // 3. Assert: result is a string.\n  assert(typeof result === 'string')\n\n  // 4. Return result.\n  return result\n}\n\n// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object\nconst esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n  class FastIterableIterator {\n    /** @type {any} */\n    #target\n    /** @type {'key' | 'value' | 'key+value'} */\n    #kind\n    /** @type {number} */\n    #index\n\n    /**\n     * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object\n     * @param {unknown} target\n     * @param {'key' | 'value' | 'key+value'} kind\n     */\n    constructor (target, kind) {\n      this.#target = target\n      this.#kind = kind\n      this.#index = 0\n    }\n\n    next () {\n      // 1. Let interface be the interface for which the iterator prototype object exists.\n      // 2. Let thisValue be the this value.\n      // 3. Let object be ? ToObject(thisValue).\n      // 4. If object is a platform object, then perform a security\n      //    check, passing:\n      // 5. If object is not a default iterator object for interface,\n      //    then throw a TypeError.\n      if (typeof this !== 'object' || this === null || !(#target in this)) {\n        throw new TypeError(\n          `'next' called on an object that does not implement interface ${name} Iterator.`\n        )\n      }\n\n      // 6. Let index be object’s index.\n      // 7. Let kind be object’s kind.\n      // 8. Let values be object’s target's value pairs to iterate over.\n      const index = this.#index\n      const values = this.#target[kInternalIterator]\n\n      // 9. Let len be the length of values.\n      const len = values.length\n\n      // 10. If index is greater than or equal to len, then return\n      //     CreateIterResultObject(undefined, true).\n      if (index >= len) {\n        return {\n          value: undefined,\n          done: true\n        }\n      }\n\n      // 11. Let pair be the entry in values at index index.\n      const { [keyIndex]: key, [valueIndex]: value } = values[index]\n\n      // 12. Set object’s index to index + 1.\n      this.#index = index + 1\n\n      // 13. Return the iterator result for pair and kind.\n\n      // https://webidl.spec.whatwg.org/#iterator-result\n\n      // 1. Let result be a value determined by the value of kind:\n      let result\n      switch (this.#kind) {\n        case 'key':\n          // 1. Let idlKey be pair’s key.\n          // 2. Let key be the result of converting idlKey to an\n          //    ECMAScript value.\n          // 3. result is key.\n          result = key\n          break\n        case 'value':\n          // 1. Let idlValue be pair’s value.\n          // 2. Let value be the result of converting idlValue to\n          //    an ECMAScript value.\n          // 3. result is value.\n          result = value\n          break\n        case 'key+value':\n          // 1. Let idlKey be pair’s key.\n          // 2. Let idlValue be pair’s value.\n          // 3. Let key be the result of converting idlKey to an\n          //    ECMAScript value.\n          // 4. Let value be the result of converting idlValue to\n          //    an ECMAScript value.\n          // 5. Let array be ! ArrayCreate(2).\n          // 6. Call ! CreateDataProperty(array, \"0\", key).\n          // 7. Call ! CreateDataProperty(array, \"1\", value).\n          // 8. result is array.\n          result = [key, value]\n          break\n      }\n\n      // 2. Return CreateIterResultObject(result, false).\n      return {\n        value: result,\n        done: false\n      }\n    }\n  }\n\n  // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n  // @ts-ignore\n  delete FastIterableIterator.prototype.constructor\n\n  Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype)\n\n  Object.defineProperties(FastIterableIterator.prototype, {\n    [Symbol.toStringTag]: {\n      writable: false,\n      enumerable: false,\n      configurable: true,\n      value: `${name} Iterator`\n    },\n    next: { writable: true, enumerable: true, configurable: true }\n  })\n\n  /**\n   * @param {unknown} target\n   * @param {'key' | 'value' | 'key+value'} kind\n   * @returns {IterableIterator}\n   */\n  return function (target, kind) {\n    return new FastIterableIterator(target, kind)\n  }\n}\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {any} object class\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n  const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex)\n\n  const properties = {\n    keys: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function keys () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'key')\n      }\n    },\n    values: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function values () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'value')\n      }\n    },\n    entries: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function entries () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'key+value')\n      }\n    },\n    forEach: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function forEach (callbackfn, thisArg = globalThis) {\n        webidl.brandCheck(this, object)\n        webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`)\n        if (typeof callbackfn !== 'function') {\n          throw new TypeError(\n            `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`\n          )\n        }\n        for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) {\n          callbackfn.call(thisArg, value, key, this)\n        }\n      }\n    }\n  }\n\n  return Object.defineProperties(object.prototype, {\n    ...properties,\n    [Symbol.iterator]: {\n      writable: true,\n      enumerable: false,\n      configurable: true,\n      value: properties.entries.value\n    }\n  })\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-fully-read\n */\nasync function fullyReadBody (body, processBody, processBodyError) {\n  // 1. If taskDestination is null, then set taskDestination to\n  //    the result of starting a new parallel queue.\n\n  // 2. Let successSteps given a byte sequence bytes be to queue a\n  //    fetch task to run processBody given bytes, with taskDestination.\n  const successSteps = processBody\n\n  // 3. Let errorSteps be to queue a fetch task to run processBodyError,\n  //    with taskDestination.\n  const errorSteps = processBodyError\n\n  // 4. Let reader be the result of getting a reader for body’s stream.\n  //    If that threw an exception, then run errorSteps with that\n  //    exception and return.\n  let reader\n\n  try {\n    reader = body.stream.getReader()\n  } catch (e) {\n    errorSteps(e)\n    return\n  }\n\n  // 5. Read all bytes from reader, given successSteps and errorSteps.\n  try {\n    successSteps(await readAllBytes(reader))\n  } catch (e) {\n    errorSteps(e)\n  }\n}\n\nfunction isReadableStreamLike (stream) {\n  return stream instanceof ReadableStream || (\n    stream[Symbol.toStringTag] === 'ReadableStream' &&\n    typeof stream.tee === 'function'\n  )\n}\n\n/**\n * @param {ReadableStreamController} controller\n */\nfunction readableStreamClose (controller) {\n  try {\n    controller.close()\n    controller.byobRequest?.respond(0)\n  } catch (err) {\n    // TODO: add comment explaining why this error occurs.\n    if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {\n      throw err\n    }\n  }\n}\n\nconst invalidIsomorphicEncodeValueRegex = /[^\\x00-\\xFF]/ // eslint-disable-line\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-encode\n * @param {string} input\n */\nfunction isomorphicEncode (input) {\n  // 1. Assert: input contains no code points greater than U+00FF.\n  assert(!invalidIsomorphicEncodeValueRegex.test(input))\n\n  // 2. Return a byte sequence whose length is equal to input’s code\n  //    point length and whose bytes have the same values as the\n  //    values of input’s code points, in the same order\n  return input\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes\n * @see https://streams.spec.whatwg.org/#read-loop\n * @param {ReadableStreamDefaultReader} reader\n */\nasync function readAllBytes (reader) {\n  const bytes = []\n  let byteLength = 0\n\n  while (true) {\n    const { done, value: chunk } = await reader.read()\n\n    if (done) {\n      // 1. Call successSteps with bytes.\n      return Buffer.concat(bytes, byteLength)\n    }\n\n    // 1. If chunk is not a Uint8Array object, call failureSteps\n    //    with a TypeError and abort these steps.\n    if (!isUint8Array(chunk)) {\n      throw new TypeError('Received non-Uint8Array chunk')\n    }\n\n    // 2. Append the bytes represented by chunk to bytes.\n    bytes.push(chunk)\n    byteLength += chunk.length\n\n    // 3. Read-loop given reader, bytes, successSteps, and failureSteps.\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#is-local\n * @param {URL} url\n */\nfunction urlIsLocal (url) {\n  assert('protocol' in url) // ensure it's a url object\n\n  const protocol = url.protocol\n\n  return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'\n}\n\n/**\n * @param {string|URL} url\n * @returns {boolean}\n */\nfunction urlHasHttpsScheme (url) {\n  return (\n    (\n      typeof url === 'string' &&\n      url[5] === ':' &&\n      url[0] === 'h' &&\n      url[1] === 't' &&\n      url[2] === 't' &&\n      url[3] === 'p' &&\n      url[4] === 's'\n    ) ||\n    url.protocol === 'https:'\n  )\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-scheme\n * @param {URL} url\n */\nfunction urlIsHttpHttpsScheme (url) {\n  assert('protocol' in url) // ensure it's a url object\n\n  const protocol = url.protocol\n\n  return protocol === 'http:' || protocol === 'https:'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#simple-range-header-value\n * @param {string} value\n * @param {boolean} allowWhitespace\n */\nfunction simpleRangeHeaderValue (value, allowWhitespace) {\n  // 1. Let data be the isomorphic decoding of value.\n  // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string,\n  // nothing more. We obviously don't need to do that if value is a string already.\n  const data = value\n\n  // 2. If data does not start with \"bytes\", then return failure.\n  if (!data.startsWith('bytes')) {\n    return 'failure'\n  }\n\n  // 3. Let position be a position variable for data, initially pointing at the 5th code point of data.\n  const position = { position: 5 }\n\n  // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n  //    from data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 5. If the code point at position within data is not U+003D (=), then return failure.\n  if (data.charCodeAt(position.position) !== 0x3D) {\n    return 'failure'\n  }\n\n  // 6. Advance position by 1.\n  position.position++\n\n  // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from\n  //    data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits,\n  //    from data given position.\n  const rangeStart = collectASequenceOfCodePoints(\n    (char) => {\n      const code = char.charCodeAt(0)\n\n      return code >= 0x30 && code <= 0x39\n    },\n    data,\n    position\n  )\n\n  // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the\n  //    empty string; otherwise null.\n  const rangeStartValue = rangeStart.length ? Number(rangeStart) : null\n\n  // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n  //     from data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 11. If the code point at position within data is not U+002D (-), then return failure.\n  if (data.charCodeAt(position.position) !== 0x2D) {\n    return 'failure'\n  }\n\n  // 12. Advance position by 1.\n  position.position++\n\n  // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab\n  //     or space, from data given position.\n  // Note from Khafra: its the same step as in #8 again lol\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 14. Let rangeEnd be the result of collecting a sequence of code points that are\n  //     ASCII digits, from data given position.\n  // Note from Khafra: you wouldn't guess it, but this is also the same step as #8\n  const rangeEnd = collectASequenceOfCodePoints(\n    (char) => {\n      const code = char.charCodeAt(0)\n\n      return code >= 0x30 && code <= 0x39\n    },\n    data,\n    position\n  )\n\n  // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd\n  //     is not the empty string; otherwise null.\n  // Note from Khafra: THE SAME STEP, AGAIN!!!\n  // Note: why interpret as a decimal if we only collect ascii digits?\n  const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null\n\n  // 16. If position is not past the end of data, then return failure.\n  if (position.position < data.length) {\n    return 'failure'\n  }\n\n  // 17. If rangeEndValue and rangeStartValue are null, then return failure.\n  if (rangeEndValue === null && rangeStartValue === null) {\n    return 'failure'\n  }\n\n  // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is\n  //     greater than rangeEndValue, then return failure.\n  // Note: ... when can they not be numbers?\n  if (rangeStartValue > rangeEndValue) {\n    return 'failure'\n  }\n\n  // 19. Return (rangeStartValue, rangeEndValue).\n  return { rangeStartValue, rangeEndValue }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#build-a-content-range\n * @param {number} rangeStart\n * @param {number} rangeEnd\n * @param {number} fullLength\n */\nfunction buildContentRange (rangeStart, rangeEnd, fullLength) {\n  // 1. Let contentRange be `bytes `.\n  let contentRange = 'bytes '\n\n  // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange.\n  contentRange += isomorphicEncode(`${rangeStart}`)\n\n  // 3. Append 0x2D (-) to contentRange.\n  contentRange += '-'\n\n  // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange.\n  contentRange += isomorphicEncode(`${rangeEnd}`)\n\n  // 5. Append 0x2F (/) to contentRange.\n  contentRange += '/'\n\n  // 6. Append fullLength, serialized and isomorphic encoded to contentRange.\n  contentRange += isomorphicEncode(`${fullLength}`)\n\n  // 7. Return contentRange.\n  return contentRange\n}\n\n// A Stream, which pipes the response to zlib.createInflate() or\n// zlib.createInflateRaw() depending on the first byte of the Buffer.\n// If the lower byte of the first byte is 0x08, then the stream is\n// interpreted as a zlib stream, otherwise it's interpreted as a\n// raw deflate stream.\nclass InflateStream extends Transform {\n  #zlibOptions\n\n  /** @param {zlib.ZlibOptions} [zlibOptions] */\n  constructor (zlibOptions) {\n    super()\n    this.#zlibOptions = zlibOptions\n  }\n\n  _transform (chunk, encoding, callback) {\n    if (!this._inflateStream) {\n      if (chunk.length === 0) {\n        callback()\n        return\n      }\n      this._inflateStream = (chunk[0] & 0x0F) === 0x08\n        ? zlib.createInflate(this.#zlibOptions)\n        : zlib.createInflateRaw(this.#zlibOptions)\n\n      this._inflateStream.on('data', this.push.bind(this))\n      this._inflateStream.on('end', () => this.push(null))\n      this._inflateStream.on('error', (err) => this.destroy(err))\n    }\n\n    this._inflateStream.write(chunk, encoding, callback)\n  }\n\n  _final (callback) {\n    if (this._inflateStream) {\n      this._inflateStream.end()\n      this._inflateStream = null\n    }\n    callback()\n  }\n}\n\n/**\n * @param {zlib.ZlibOptions} [zlibOptions]\n * @returns {InflateStream}\n */\nfunction createInflate (zlibOptions) {\n  return new InflateStream(zlibOptions)\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type\n * @param {import('./headers').HeadersList} headers\n */\nfunction extractMimeType (headers) {\n  // 1. Let charset be null.\n  let charset = null\n\n  // 2. Let essence be null.\n  let essence = null\n\n  // 3. Let mimeType be null.\n  let mimeType = null\n\n  // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers.\n  const values = getDecodeSplit('content-type', headers)\n\n  // 5. If values is null, then return failure.\n  if (values === null) {\n    return 'failure'\n  }\n\n  // 6. For each value of values:\n  for (const value of values) {\n    // 6.1. Let temporaryMimeType be the result of parsing value.\n    const temporaryMimeType = parseMIMEType(value)\n\n    // 6.2. If temporaryMimeType is failure or its essence is \"*/*\", then continue.\n    if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') {\n      continue\n    }\n\n    // 6.3. Set mimeType to temporaryMimeType.\n    mimeType = temporaryMimeType\n\n    // 6.4. If mimeType’s essence is not essence, then:\n    if (mimeType.essence !== essence) {\n      // 6.4.1. Set charset to null.\n      charset = null\n\n      // 6.4.2. If mimeType’s parameters[\"charset\"] exists, then set charset to\n      //        mimeType’s parameters[\"charset\"].\n      if (mimeType.parameters.has('charset')) {\n        charset = mimeType.parameters.get('charset')\n      }\n\n      // 6.4.3. Set essence to mimeType’s essence.\n      essence = mimeType.essence\n    } else if (!mimeType.parameters.has('charset') && charset !== null) {\n      // 6.5. Otherwise, if mimeType’s parameters[\"charset\"] does not exist, and\n      //      charset is non-null, set mimeType’s parameters[\"charset\"] to charset.\n      mimeType.parameters.set('charset', charset)\n    }\n  }\n\n  // 7. If mimeType is null, then return failure.\n  if (mimeType == null) {\n    return 'failure'\n  }\n\n  // 8. Return mimeType.\n  return mimeType\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split\n * @param {string|null} value\n */\nfunction gettingDecodingSplitting (value) {\n  // 1. Let input be the result of isomorphic decoding value.\n  const input = value\n\n  // 2. Let position be a position variable for input, initially pointing at the start of input.\n  const position = { position: 0 }\n\n  // 3. Let values be a list of strings, initially empty.\n  const values = []\n\n  // 4. Let temporaryValue be the empty string.\n  let temporaryValue = ''\n\n  // 5. While position is not past the end of input:\n  while (position.position < input.length) {\n    // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (\")\n    //      or U+002C (,) from input, given position, to temporaryValue.\n    temporaryValue += collectASequenceOfCodePoints(\n      (char) => char !== '\"' && char !== ',',\n      input,\n      position\n    )\n\n    // 5.2. If position is not past the end of input, then:\n    if (position.position < input.length) {\n      // 5.2.1. If the code point at position within input is U+0022 (\"), then:\n      if (input.charCodeAt(position.position) === 0x22) {\n        // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue.\n        temporaryValue += collectAnHTTPQuotedString(\n          input,\n          position\n        )\n\n        // 5.2.1.2. If position is not past the end of input, then continue.\n        if (position.position < input.length) {\n          continue\n        }\n      } else {\n        // 5.2.2. Otherwise:\n\n        // 5.2.2.1. Assert: the code point at position within input is U+002C (,).\n        assert(input.charCodeAt(position.position) === 0x2C)\n\n        // 5.2.2.2. Advance position by 1.\n        position.position++\n      }\n    }\n\n    // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue.\n    temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20)\n\n    // 5.4. Append temporaryValue to values.\n    values.push(temporaryValue)\n\n    // 5.6. Set temporaryValue to the empty string.\n    temporaryValue = ''\n  }\n\n  // 6. Return values.\n  return values\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split\n * @param {string} name lowercase header name\n * @param {import('./headers').HeadersList} list\n */\nfunction getDecodeSplit (name, list) {\n  // 1. Let value be the result of getting name from list.\n  const value = list.get(name, true)\n\n  // 2. If value is null, then return null.\n  if (value === null) {\n    return null\n  }\n\n  // 3. Return the result of getting, decoding, and splitting value.\n  return gettingDecodingSplitting(value)\n}\n\nconst textDecoder = new TextDecoder()\n\n/**\n * @see https://encoding.spec.whatwg.org/#utf-8-decode\n * @param {Buffer} buffer\n */\nfunction utf8DecodeBytes (buffer) {\n  if (buffer.length === 0) {\n    return ''\n  }\n\n  // 1. Let buffer be the result of peeking three bytes from\n  //    ioQueue, converted to a byte sequence.\n\n  // 2. If buffer is 0xEF 0xBB 0xBF, then read three\n  //    bytes from ioQueue. (Do nothing with those bytes.)\n  if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {\n    buffer = buffer.subarray(3)\n  }\n\n  // 3. Process a queue with an instance of UTF-8’s\n  //    decoder, ioQueue, output, and \"replacement\".\n  const output = textDecoder.decode(buffer)\n\n  // 4. Return output.\n  return output\n}\n\nclass EnvironmentSettingsObjectBase {\n  get baseUrl () {\n    return getGlobalOrigin()\n  }\n\n  get origin () {\n    return this.baseUrl?.origin\n  }\n\n  policyContainer = makePolicyContainer()\n}\n\nclass EnvironmentSettingsObject {\n  settingsObject = new EnvironmentSettingsObjectBase()\n}\n\nconst environmentSettingsObject = new EnvironmentSettingsObject()\n\nmodule.exports = {\n  isAborted,\n  isCancelled,\n  isValidEncodedURL,\n  createDeferredPromise,\n  ReadableStreamFrom,\n  tryUpgradeRequestToAPotentiallyTrustworthyURL,\n  clampAndCoarsenConnectionTimingInfo,\n  coarsenedSharedCurrentTime,\n  determineRequestsReferrer,\n  makePolicyContainer,\n  clonePolicyContainer,\n  appendFetchMetadata,\n  appendRequestOriginHeader,\n  TAOCheck,\n  corsCheck,\n  crossOriginResourcePolicyCheck,\n  createOpaqueTimingInfo,\n  setRequestReferrerPolicyOnRedirect,\n  isValidHTTPToken,\n  requestBadPort,\n  requestCurrentURL,\n  responseURL,\n  responseLocationURL,\n  isBlobLike,\n  isURLPotentiallyTrustworthy,\n  isValidReasonPhrase,\n  sameOrigin,\n  normalizeMethod,\n  serializeJavascriptValueToJSONString,\n  iteratorMixin,\n  createIterator,\n  isValidHeaderName,\n  isValidHeaderValue,\n  isErrorLike,\n  fullyReadBody,\n  bytesMatch,\n  isReadableStreamLike,\n  readableStreamClose,\n  isomorphicEncode,\n  urlIsLocal,\n  urlHasHttpsScheme,\n  urlIsHttpHttpsScheme,\n  readAllBytes,\n  simpleRangeHeaderValue,\n  buildContentRange,\n  parseMetadata,\n  createInflate,\n  extractMimeType,\n  getDecodeSplit,\n  utf8DecodeBytes,\n  environmentSettingsObject\n}\n","'use strict'\n\nconst { types, inspect } = require('node:util')\nconst { markAsUncloneable } = require('node:worker_threads')\nconst { toUSVString } = require('../../core/util')\n\n/** @type {import('../../../types/webidl').Webidl} */\nconst webidl = {}\nwebidl.converters = {}\nwebidl.util = {}\nwebidl.errors = {}\n\nwebidl.errors.exception = function (message) {\n  return new TypeError(`${message.header}: ${message.message}`)\n}\n\nwebidl.errors.conversionFailed = function (context) {\n  const plural = context.types.length === 1 ? '' : ' one of'\n  const message =\n    `${context.argument} could not be converted to` +\n    `${plural}: ${context.types.join(', ')}.`\n\n  return webidl.errors.exception({\n    header: context.prefix,\n    message\n  })\n}\n\nwebidl.errors.invalidArgument = function (context) {\n  return webidl.errors.exception({\n    header: context.prefix,\n    message: `\"${context.value}\" is an invalid ${context.type}.`\n  })\n}\n\n// https://webidl.spec.whatwg.org/#implements\nwebidl.brandCheck = function (V, I, opts) {\n  if (opts?.strict !== false) {\n    if (!(V instanceof I)) {\n      const err = new TypeError('Illegal invocation')\n      err.code = 'ERR_INVALID_THIS' // node compat.\n      throw err\n    }\n  } else {\n    if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {\n      const err = new TypeError('Illegal invocation')\n      err.code = 'ERR_INVALID_THIS' // node compat.\n      throw err\n    }\n  }\n}\n\nwebidl.argumentLengthCheck = function ({ length }, min, ctx) {\n  if (length < min) {\n    throw webidl.errors.exception({\n      message: `${min} argument${min !== 1 ? 's' : ''} required, ` +\n               `but${length ? ' only' : ''} ${length} found.`,\n      header: ctx\n    })\n  }\n}\n\nwebidl.illegalConstructor = function () {\n  throw webidl.errors.exception({\n    header: 'TypeError',\n    message: 'Illegal constructor'\n  })\n}\n\n// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\nwebidl.util.Type = function (V) {\n  switch (typeof V) {\n    case 'undefined': return 'Undefined'\n    case 'boolean': return 'Boolean'\n    case 'string': return 'String'\n    case 'symbol': return 'Symbol'\n    case 'number': return 'Number'\n    case 'bigint': return 'BigInt'\n    case 'function':\n    case 'object': {\n      if (V === null) {\n        return 'Null'\n      }\n\n      return 'Object'\n    }\n  }\n}\n\nwebidl.util.markAsUncloneable = markAsUncloneable || (() => {})\n// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint\nwebidl.util.ConvertToInt = function (V, bitLength, signedness, opts) {\n  let upperBound\n  let lowerBound\n\n  // 1. If bitLength is 64, then:\n  if (bitLength === 64) {\n    // 1. Let upperBound be 2^53 − 1.\n    upperBound = Math.pow(2, 53) - 1\n\n    // 2. If signedness is \"unsigned\", then let lowerBound be 0.\n    if (signedness === 'unsigned') {\n      lowerBound = 0\n    } else {\n      // 3. Otherwise let lowerBound be −2^53 + 1.\n      lowerBound = Math.pow(-2, 53) + 1\n    }\n  } else if (signedness === 'unsigned') {\n    // 2. Otherwise, if signedness is \"unsigned\", then:\n\n    // 1. Let lowerBound be 0.\n    lowerBound = 0\n\n    // 2. Let upperBound be 2^bitLength − 1.\n    upperBound = Math.pow(2, bitLength) - 1\n  } else {\n    // 3. Otherwise:\n\n    // 1. Let lowerBound be -2^bitLength − 1.\n    lowerBound = Math.pow(-2, bitLength) - 1\n\n    // 2. Let upperBound be 2^bitLength − 1 − 1.\n    upperBound = Math.pow(2, bitLength - 1) - 1\n  }\n\n  // 4. Let x be ? ToNumber(V).\n  let x = Number(V)\n\n  // 5. If x is −0, then set x to +0.\n  if (x === 0) {\n    x = 0\n  }\n\n  // 6. If the conversion is to an IDL type associated\n  //    with the [EnforceRange] extended attribute, then:\n  if (opts?.enforceRange === true) {\n    // 1. If x is NaN, +∞, or −∞, then throw a TypeError.\n    if (\n      Number.isNaN(x) ||\n      x === Number.POSITIVE_INFINITY ||\n      x === Number.NEGATIVE_INFINITY\n    ) {\n      throw webidl.errors.exception({\n        header: 'Integer conversion',\n        message: `Could not convert ${webidl.util.Stringify(V)} to an integer.`\n      })\n    }\n\n    // 2. Set x to IntegerPart(x).\n    x = webidl.util.IntegerPart(x)\n\n    // 3. If x < lowerBound or x > upperBound, then\n    //    throw a TypeError.\n    if (x < lowerBound || x > upperBound) {\n      throw webidl.errors.exception({\n        header: 'Integer conversion',\n        message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n      })\n    }\n\n    // 4. Return x.\n    return x\n  }\n\n  // 7. If x is not NaN and the conversion is to an IDL\n  //    type associated with the [Clamp] extended\n  //    attribute, then:\n  if (!Number.isNaN(x) && opts?.clamp === true) {\n    // 1. Set x to min(max(x, lowerBound), upperBound).\n    x = Math.min(Math.max(x, lowerBound), upperBound)\n\n    // 2. Round x to the nearest integer, choosing the\n    //    even integer if it lies halfway between two,\n    //    and choosing +0 rather than −0.\n    if (Math.floor(x) % 2 === 0) {\n      x = Math.floor(x)\n    } else {\n      x = Math.ceil(x)\n    }\n\n    // 3. Return x.\n    return x\n  }\n\n  // 8. If x is NaN, +0, +∞, or −∞, then return +0.\n  if (\n    Number.isNaN(x) ||\n    (x === 0 && Object.is(0, x)) ||\n    x === Number.POSITIVE_INFINITY ||\n    x === Number.NEGATIVE_INFINITY\n  ) {\n    return 0\n  }\n\n  // 9. Set x to IntegerPart(x).\n  x = webidl.util.IntegerPart(x)\n\n  // 10. Set x to x modulo 2^bitLength.\n  x = x % Math.pow(2, bitLength)\n\n  // 11. If signedness is \"signed\" and x ≥ 2^bitLength − 1,\n  //    then return x − 2^bitLength.\n  if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {\n    return x - Math.pow(2, bitLength)\n  }\n\n  // 12. Otherwise, return x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart\nwebidl.util.IntegerPart = function (n) {\n  // 1. Let r be floor(abs(n)).\n  const r = Math.floor(Math.abs(n))\n\n  // 2. If n < 0, then return -1 × r.\n  if (n < 0) {\n    return -1 * r\n  }\n\n  // 3. Otherwise, return r.\n  return r\n}\n\nwebidl.util.Stringify = function (V) {\n  const type = webidl.util.Type(V)\n\n  switch (type) {\n    case 'Symbol':\n      return `Symbol(${V.description})`\n    case 'Object':\n      return inspect(V)\n    case 'String':\n      return `\"${V}\"`\n    default:\n      return `${V}`\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-sequence\nwebidl.sequenceConverter = function (converter) {\n  return (V, prefix, argument, Iterable) => {\n    // 1. If Type(V) is not Object, throw a TypeError.\n    if (webidl.util.Type(V) !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.`\n      })\n    }\n\n    // 2. Let method be ? GetMethod(V, @@iterator).\n    /** @type {Generator} */\n    const method = typeof Iterable === 'function' ? Iterable() : V?.[Symbol.iterator]?.()\n    const seq = []\n    let index = 0\n\n    // 3. If method is undefined, throw a TypeError.\n    if (\n      method === undefined ||\n      typeof method.next !== 'function'\n    ) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} is not iterable.`\n      })\n    }\n\n    // https://webidl.spec.whatwg.org/#create-sequence-from-iterable\n    while (true) {\n      const { done, value } = method.next()\n\n      if (done) {\n        break\n      }\n\n      seq.push(converter(value, prefix, `${argument}[${index++}]`))\n    }\n\n    return seq\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-to-record\nwebidl.recordConverter = function (keyConverter, valueConverter) {\n  return (O, prefix, argument) => {\n    // 1. If Type(O) is not Object, throw a TypeError.\n    if (webidl.util.Type(O) !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} (\"${webidl.util.Type(O)}\") is not an Object.`\n      })\n    }\n\n    // 2. Let result be a new empty instance of record.\n    const result = {}\n\n    if (!types.isProxy(O)) {\n      // 1. Let desc be ? O.[[GetOwnProperty]](key).\n      const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]\n\n      for (const key of keys) {\n        // 1. Let typedKey be key converted to an IDL value of type K.\n        const typedKey = keyConverter(key, prefix, argument)\n\n        // 2. Let value be ? Get(O, key).\n        // 3. Let typedValue be value converted to an IDL value of type V.\n        const typedValue = valueConverter(O[key], prefix, argument)\n\n        // 4. Set result[typedKey] to typedValue.\n        result[typedKey] = typedValue\n      }\n\n      // 5. Return result.\n      return result\n    }\n\n    // 3. Let keys be ? O.[[OwnPropertyKeys]]().\n    const keys = Reflect.ownKeys(O)\n\n    // 4. For each key of keys.\n    for (const key of keys) {\n      // 1. Let desc be ? O.[[GetOwnProperty]](key).\n      const desc = Reflect.getOwnPropertyDescriptor(O, key)\n\n      // 2. If desc is not undefined and desc.[[Enumerable]] is true:\n      if (desc?.enumerable) {\n        // 1. Let typedKey be key converted to an IDL value of type K.\n        const typedKey = keyConverter(key, prefix, argument)\n\n        // 2. Let value be ? Get(O, key).\n        // 3. Let typedValue be value converted to an IDL value of type V.\n        const typedValue = valueConverter(O[key], prefix, argument)\n\n        // 4. Set result[typedKey] to typedValue.\n        result[typedKey] = typedValue\n      }\n    }\n\n    // 5. Return result.\n    return result\n  }\n}\n\nwebidl.interfaceConverter = function (i) {\n  return (V, prefix, argument, opts) => {\n    if (opts?.strict !== false && !(V instanceof i)) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `Expected ${argument} (\"${webidl.util.Stringify(V)}\") to be an instance of ${i.name}.`\n      })\n    }\n\n    return V\n  }\n}\n\nwebidl.dictionaryConverter = function (converters) {\n  return (dictionary, prefix, argument) => {\n    const type = webidl.util.Type(dictionary)\n    const dict = {}\n\n    if (type === 'Null' || type === 'Undefined') {\n      return dict\n    } else if (type !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n      })\n    }\n\n    for (const options of converters) {\n      const { key, defaultValue, required, converter } = options\n\n      if (required === true) {\n        if (!Object.hasOwn(dictionary, key)) {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: `Missing required key \"${key}\".`\n          })\n        }\n      }\n\n      let value = dictionary[key]\n      const hasDefault = Object.hasOwn(options, 'defaultValue')\n\n      // Only use defaultValue if value is undefined and\n      // a defaultValue options was provided.\n      if (hasDefault && value !== null) {\n        value ??= defaultValue()\n      }\n\n      // A key can be optional and have no default value.\n      // When this happens, do not perform a conversion,\n      // and do not assign the key a value.\n      if (required || hasDefault || value !== undefined) {\n        value = converter(value, prefix, `${argument}.${key}`)\n\n        if (\n          options.allowedValues &&\n          !options.allowedValues.includes(value)\n        ) {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`\n          })\n        }\n\n        dict[key] = value\n      }\n    }\n\n    return dict\n  }\n}\n\nwebidl.nullableConverter = function (converter) {\n  return (V, prefix, argument) => {\n    if (V === null) {\n      return V\n    }\n\n    return converter(V, prefix, argument)\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-DOMString\nwebidl.converters.DOMString = function (V, prefix, argument, opts) {\n  // 1. If V is null and the conversion is to an IDL type\n  //    associated with the [LegacyNullToEmptyString]\n  //    extended attribute, then return the DOMString value\n  //    that represents the empty string.\n  if (V === null && opts?.legacyNullToEmptyString) {\n    return ''\n  }\n\n  // 2. Let x be ? ToString(V).\n  if (typeof V === 'symbol') {\n    throw webidl.errors.exception({\n      header: prefix,\n      message: `${argument} is a symbol, which cannot be converted to a DOMString.`\n    })\n  }\n\n  // 3. Return the IDL DOMString value that represents the\n  //    same sequence of code units as the one the\n  //    ECMAScript String value x represents.\n  return String(V)\n}\n\n// https://webidl.spec.whatwg.org/#es-ByteString\nwebidl.converters.ByteString = function (V, prefix, argument) {\n  // 1. Let x be ? ToString(V).\n  // Note: DOMString converter perform ? ToString(V)\n  const x = webidl.converters.DOMString(V, prefix, argument)\n\n  // 2. If the value of any element of x is greater than\n  //    255, then throw a TypeError.\n  for (let index = 0; index < x.length; index++) {\n    if (x.charCodeAt(index) > 255) {\n      throw new TypeError(\n        'Cannot convert argument to a ByteString because the character at ' +\n        `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`\n      )\n    }\n  }\n\n  // 3. Return an IDL ByteString value whose length is the\n  //    length of x, and where the value of each element is\n  //    the value of the corresponding element of x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-USVString\n// TODO: rewrite this so we can control the errors thrown\nwebidl.converters.USVString = toUSVString\n\n// https://webidl.spec.whatwg.org/#es-boolean\nwebidl.converters.boolean = function (V) {\n  // 1. Let x be the result of computing ToBoolean(V).\n  const x = Boolean(V)\n\n  // 2. Return the IDL boolean value that is the one that represents\n  //    the same truth value as the ECMAScript Boolean value x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-any\nwebidl.converters.any = function (V) {\n  return V\n}\n\n// https://webidl.spec.whatwg.org/#es-long-long\nwebidl.converters['long long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 64, \"signed\").\n  const x = webidl.util.ConvertToInt(V, 64, 'signed', undefined, prefix, argument)\n\n  // 2. Return the IDL long long value that represents\n  //    the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long-long\nwebidl.converters['unsigned long long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 64, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 64, 'unsigned', undefined, prefix, argument)\n\n  // 2. Return the IDL unsigned long long value that\n  //    represents the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long\nwebidl.converters['unsigned long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 32, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 32, 'unsigned', undefined, prefix, argument)\n\n  // 2. Return the IDL unsigned long value that\n  //    represents the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-short\nwebidl.converters['unsigned short'] = function (V, prefix, argument, opts) {\n  // 1. Let x be ? ConvertToInt(V, 16, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts, prefix, argument)\n\n  // 2. Return the IDL unsigned short value that represents\n  //    the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#idl-ArrayBuffer\nwebidl.converters.ArrayBuffer = function (V, prefix, argument, opts) {\n  // 1. If Type(V) is not Object, or V does not have an\n  //    [[ArrayBufferData]] internal slot, then throw a\n  //    TypeError.\n  // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances\n  // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances\n  if (\n    webidl.util.Type(V) !== 'Object' ||\n    !types.isAnyArrayBuffer(V)\n  ) {\n    throw webidl.errors.conversionFailed({\n      prefix,\n      argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n      types: ['ArrayBuffer']\n    })\n  }\n\n  // 2. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V) is true, then throw a\n  //    TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V) is true, then throw a\n  //    TypeError.\n  if (V.resizable || V.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 4. Return the IDL ArrayBuffer value that is a\n  //    reference to the same object as V.\n  return V\n}\n\nwebidl.converters.TypedArray = function (V, T, prefix, name, opts) {\n  // 1. Let T be the IDL type V is being converted to.\n\n  // 2. If Type(V) is not Object, or V does not have a\n  //    [[TypedArrayName]] internal slot with a value\n  //    equal to T’s name, then throw a TypeError.\n  if (\n    webidl.util.Type(V) !== 'Object' ||\n    !types.isTypedArray(V) ||\n    V.constructor.name !== T.name\n  ) {\n    throw webidl.errors.conversionFailed({\n      prefix,\n      argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n      types: [T.name]\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 4. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (V.buffer.resizable || V.buffer.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 5. Return the IDL value of type T that is a reference\n  //    to the same object as V.\n  return V\n}\n\nwebidl.converters.DataView = function (V, prefix, name, opts) {\n  // 1. If Type(V) is not Object, or V does not have a\n  //    [[DataView]] internal slot, then throw a TypeError.\n  if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {\n    throw webidl.errors.exception({\n      header: prefix,\n      message: `${name} is not a DataView.`\n    })\n  }\n\n  // 2. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,\n  //    then throw a TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (V.buffer.resizable || V.buffer.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 4. Return the IDL DataView value that is a reference\n  //    to the same object as V.\n  return V\n}\n\n// https://webidl.spec.whatwg.org/#BufferSource\nwebidl.converters.BufferSource = function (V, prefix, name, opts) {\n  if (types.isAnyArrayBuffer(V)) {\n    return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false })\n  }\n\n  if (types.isTypedArray(V)) {\n    return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false })\n  }\n\n  if (types.isDataView(V)) {\n    return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false })\n  }\n\n  throw webidl.errors.conversionFailed({\n    prefix,\n    argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n    types: ['BufferSource']\n  })\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.ByteString\n)\n\nwebidl.converters['sequence>'] = webidl.sequenceConverter(\n  webidl.converters['sequence']\n)\n\nwebidl.converters['record'] = webidl.recordConverter(\n  webidl.converters.ByteString,\n  webidl.converters.ByteString\n)\n\nmodule.exports = {\n  webidl\n}\n","'use strict'\n\n/**\n * @see https://encoding.spec.whatwg.org/#concept-encoding-get\n * @param {string|undefined} label\n */\nfunction getEncoding (label) {\n  if (!label) {\n    return 'failure'\n  }\n\n  // 1. Remove any leading and trailing ASCII whitespace from label.\n  // 2. If label is an ASCII case-insensitive match for any of the\n  //    labels listed in the table below, then return the\n  //    corresponding encoding; otherwise return failure.\n  switch (label.trim().toLowerCase()) {\n    case 'unicode-1-1-utf-8':\n    case 'unicode11utf8':\n    case 'unicode20utf8':\n    case 'utf-8':\n    case 'utf8':\n    case 'x-unicode20utf8':\n      return 'UTF-8'\n    case '866':\n    case 'cp866':\n    case 'csibm866':\n    case 'ibm866':\n      return 'IBM866'\n    case 'csisolatin2':\n    case 'iso-8859-2':\n    case 'iso-ir-101':\n    case 'iso8859-2':\n    case 'iso88592':\n    case 'iso_8859-2':\n    case 'iso_8859-2:1987':\n    case 'l2':\n    case 'latin2':\n      return 'ISO-8859-2'\n    case 'csisolatin3':\n    case 'iso-8859-3':\n    case 'iso-ir-109':\n    case 'iso8859-3':\n    case 'iso88593':\n    case 'iso_8859-3':\n    case 'iso_8859-3:1988':\n    case 'l3':\n    case 'latin3':\n      return 'ISO-8859-3'\n    case 'csisolatin4':\n    case 'iso-8859-4':\n    case 'iso-ir-110':\n    case 'iso8859-4':\n    case 'iso88594':\n    case 'iso_8859-4':\n    case 'iso_8859-4:1988':\n    case 'l4':\n    case 'latin4':\n      return 'ISO-8859-4'\n    case 'csisolatincyrillic':\n    case 'cyrillic':\n    case 'iso-8859-5':\n    case 'iso-ir-144':\n    case 'iso8859-5':\n    case 'iso88595':\n    case 'iso_8859-5':\n    case 'iso_8859-5:1988':\n      return 'ISO-8859-5'\n    case 'arabic':\n    case 'asmo-708':\n    case 'csiso88596e':\n    case 'csiso88596i':\n    case 'csisolatinarabic':\n    case 'ecma-114':\n    case 'iso-8859-6':\n    case 'iso-8859-6-e':\n    case 'iso-8859-6-i':\n    case 'iso-ir-127':\n    case 'iso8859-6':\n    case 'iso88596':\n    case 'iso_8859-6':\n    case 'iso_8859-6:1987':\n      return 'ISO-8859-6'\n    case 'csisolatingreek':\n    case 'ecma-118':\n    case 'elot_928':\n    case 'greek':\n    case 'greek8':\n    case 'iso-8859-7':\n    case 'iso-ir-126':\n    case 'iso8859-7':\n    case 'iso88597':\n    case 'iso_8859-7':\n    case 'iso_8859-7:1987':\n    case 'sun_eu_greek':\n      return 'ISO-8859-7'\n    case 'csiso88598e':\n    case 'csisolatinhebrew':\n    case 'hebrew':\n    case 'iso-8859-8':\n    case 'iso-8859-8-e':\n    case 'iso-ir-138':\n    case 'iso8859-8':\n    case 'iso88598':\n    case 'iso_8859-8':\n    case 'iso_8859-8:1988':\n    case 'visual':\n      return 'ISO-8859-8'\n    case 'csiso88598i':\n    case 'iso-8859-8-i':\n    case 'logical':\n      return 'ISO-8859-8-I'\n    case 'csisolatin6':\n    case 'iso-8859-10':\n    case 'iso-ir-157':\n    case 'iso8859-10':\n    case 'iso885910':\n    case 'l6':\n    case 'latin6':\n      return 'ISO-8859-10'\n    case 'iso-8859-13':\n    case 'iso8859-13':\n    case 'iso885913':\n      return 'ISO-8859-13'\n    case 'iso-8859-14':\n    case 'iso8859-14':\n    case 'iso885914':\n      return 'ISO-8859-14'\n    case 'csisolatin9':\n    case 'iso-8859-15':\n    case 'iso8859-15':\n    case 'iso885915':\n    case 'iso_8859-15':\n    case 'l9':\n      return 'ISO-8859-15'\n    case 'iso-8859-16':\n      return 'ISO-8859-16'\n    case 'cskoi8r':\n    case 'koi':\n    case 'koi8':\n    case 'koi8-r':\n    case 'koi8_r':\n      return 'KOI8-R'\n    case 'koi8-ru':\n    case 'koi8-u':\n      return 'KOI8-U'\n    case 'csmacintosh':\n    case 'mac':\n    case 'macintosh':\n    case 'x-mac-roman':\n      return 'macintosh'\n    case 'iso-8859-11':\n    case 'iso8859-11':\n    case 'iso885911':\n    case 'tis-620':\n    case 'windows-874':\n      return 'windows-874'\n    case 'cp1250':\n    case 'windows-1250':\n    case 'x-cp1250':\n      return 'windows-1250'\n    case 'cp1251':\n    case 'windows-1251':\n    case 'x-cp1251':\n      return 'windows-1251'\n    case 'ansi_x3.4-1968':\n    case 'ascii':\n    case 'cp1252':\n    case 'cp819':\n    case 'csisolatin1':\n    case 'ibm819':\n    case 'iso-8859-1':\n    case 'iso-ir-100':\n    case 'iso8859-1':\n    case 'iso88591':\n    case 'iso_8859-1':\n    case 'iso_8859-1:1987':\n    case 'l1':\n    case 'latin1':\n    case 'us-ascii':\n    case 'windows-1252':\n    case 'x-cp1252':\n      return 'windows-1252'\n    case 'cp1253':\n    case 'windows-1253':\n    case 'x-cp1253':\n      return 'windows-1253'\n    case 'cp1254':\n    case 'csisolatin5':\n    case 'iso-8859-9':\n    case 'iso-ir-148':\n    case 'iso8859-9':\n    case 'iso88599':\n    case 'iso_8859-9':\n    case 'iso_8859-9:1989':\n    case 'l5':\n    case 'latin5':\n    case 'windows-1254':\n    case 'x-cp1254':\n      return 'windows-1254'\n    case 'cp1255':\n    case 'windows-1255':\n    case 'x-cp1255':\n      return 'windows-1255'\n    case 'cp1256':\n    case 'windows-1256':\n    case 'x-cp1256':\n      return 'windows-1256'\n    case 'cp1257':\n    case 'windows-1257':\n    case 'x-cp1257':\n      return 'windows-1257'\n    case 'cp1258':\n    case 'windows-1258':\n    case 'x-cp1258':\n      return 'windows-1258'\n    case 'x-mac-cyrillic':\n    case 'x-mac-ukrainian':\n      return 'x-mac-cyrillic'\n    case 'chinese':\n    case 'csgb2312':\n    case 'csiso58gb231280':\n    case 'gb2312':\n    case 'gb_2312':\n    case 'gb_2312-80':\n    case 'gbk':\n    case 'iso-ir-58':\n    case 'x-gbk':\n      return 'GBK'\n    case 'gb18030':\n      return 'gb18030'\n    case 'big5':\n    case 'big5-hkscs':\n    case 'cn-big5':\n    case 'csbig5':\n    case 'x-x-big5':\n      return 'Big5'\n    case 'cseucpkdfmtjapanese':\n    case 'euc-jp':\n    case 'x-euc-jp':\n      return 'EUC-JP'\n    case 'csiso2022jp':\n    case 'iso-2022-jp':\n      return 'ISO-2022-JP'\n    case 'csshiftjis':\n    case 'ms932':\n    case 'ms_kanji':\n    case 'shift-jis':\n    case 'shift_jis':\n    case 'sjis':\n    case 'windows-31j':\n    case 'x-sjis':\n      return 'Shift_JIS'\n    case 'cseuckr':\n    case 'csksc56011987':\n    case 'euc-kr':\n    case 'iso-ir-149':\n    case 'korean':\n    case 'ks_c_5601-1987':\n    case 'ks_c_5601-1989':\n    case 'ksc5601':\n    case 'ksc_5601':\n    case 'windows-949':\n      return 'EUC-KR'\n    case 'csiso2022kr':\n    case 'hz-gb-2312':\n    case 'iso-2022-cn':\n    case 'iso-2022-cn-ext':\n    case 'iso-2022-kr':\n    case 'replacement':\n      return 'replacement'\n    case 'unicodefffe':\n    case 'utf-16be':\n      return 'UTF-16BE'\n    case 'csunicode':\n    case 'iso-10646-ucs-2':\n    case 'ucs-2':\n    case 'unicode':\n    case 'unicodefeff':\n    case 'utf-16':\n    case 'utf-16le':\n      return 'UTF-16LE'\n    case 'x-user-defined':\n      return 'x-user-defined'\n    default: return 'failure'\n  }\n}\n\nmodule.exports = {\n  getEncoding\n}\n","'use strict'\n\nconst {\n  staticPropertyDescriptors,\n  readOperation,\n  fireAProgressEvent\n} = require('./util')\nconst {\n  kState,\n  kError,\n  kResult,\n  kEvents,\n  kAborted\n} = require('./symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass FileReader extends EventTarget {\n  constructor () {\n    super()\n\n    this[kState] = 'empty'\n    this[kResult] = null\n    this[kError] = null\n    this[kEvents] = {\n      loadend: null,\n      error: null,\n      abort: null,\n      load: null,\n      progress: null,\n      loadstart: null\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer\n   * @param {import('buffer').Blob} blob\n   */\n  readAsArrayBuffer (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsArrayBuffer')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsArrayBuffer(blob) method, when invoked,\n    // must initiate a read operation for blob with ArrayBuffer.\n    readOperation(this, blob, 'ArrayBuffer')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#readAsBinaryString\n   * @param {import('buffer').Blob} blob\n   */\n  readAsBinaryString (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsBinaryString')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsBinaryString(blob) method, when invoked,\n    // must initiate a read operation for blob with BinaryString.\n    readOperation(this, blob, 'BinaryString')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#readAsDataText\n   * @param {import('buffer').Blob} blob\n   * @param {string?} encoding\n   */\n  readAsText (blob, encoding = undefined) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsText')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    if (encoding !== undefined) {\n      encoding = webidl.converters.DOMString(encoding, 'FileReader.readAsText', 'encoding')\n    }\n\n    // The readAsText(blob, encoding) method, when invoked,\n    // must initiate a read operation for blob with Text and encoding.\n    readOperation(this, blob, 'Text', encoding)\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL\n   * @param {import('buffer').Blob} blob\n   */\n  readAsDataURL (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsDataURL')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsDataURL(blob) method, when invoked, must\n    // initiate a read operation for blob with DataURL.\n    readOperation(this, blob, 'DataURL')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-abort\n   */\n  abort () {\n    // 1. If this's state is \"empty\" or if this's state is\n    //    \"done\" set this's result to null and terminate\n    //    this algorithm.\n    if (this[kState] === 'empty' || this[kState] === 'done') {\n      this[kResult] = null\n      return\n    }\n\n    // 2. If this's state is \"loading\" set this's state to\n    //    \"done\" and set this's result to null.\n    if (this[kState] === 'loading') {\n      this[kState] = 'done'\n      this[kResult] = null\n    }\n\n    // 3. If there are any tasks from this on the file reading\n    //    task source in an affiliated task queue, then remove\n    //    those tasks from that task queue.\n    this[kAborted] = true\n\n    // 4. Terminate the algorithm for the read method being processed.\n    // TODO\n\n    // 5. Fire a progress event called abort at this.\n    fireAProgressEvent('abort', this)\n\n    // 6. If this's state is not \"loading\", fire a progress\n    //    event called loadend at this.\n    if (this[kState] !== 'loading') {\n      fireAProgressEvent('loadend', this)\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate\n   */\n  get readyState () {\n    webidl.brandCheck(this, FileReader)\n\n    switch (this[kState]) {\n      case 'empty': return this.EMPTY\n      case 'loading': return this.LOADING\n      case 'done': return this.DONE\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-result\n   */\n  get result () {\n    webidl.brandCheck(this, FileReader)\n\n    // The result attribute’s getter, when invoked, must return\n    // this's result.\n    return this[kResult]\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-error\n   */\n  get error () {\n    webidl.brandCheck(this, FileReader)\n\n    // The error attribute’s getter, when invoked, must return\n    // this's error.\n    return this[kError]\n  }\n\n  get onloadend () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].loadend\n  }\n\n  set onloadend (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].loadend) {\n      this.removeEventListener('loadend', this[kEvents].loadend)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].loadend = fn\n      this.addEventListener('loadend', fn)\n    } else {\n      this[kEvents].loadend = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].error) {\n      this.removeEventListener('error', this[kEvents].error)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this[kEvents].error = null\n    }\n  }\n\n  get onloadstart () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].loadstart\n  }\n\n  set onloadstart (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].loadstart) {\n      this.removeEventListener('loadstart', this[kEvents].loadstart)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].loadstart = fn\n      this.addEventListener('loadstart', fn)\n    } else {\n      this[kEvents].loadstart = null\n    }\n  }\n\n  get onprogress () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].progress\n  }\n\n  set onprogress (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].progress) {\n      this.removeEventListener('progress', this[kEvents].progress)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].progress = fn\n      this.addEventListener('progress', fn)\n    } else {\n      this[kEvents].progress = null\n    }\n  }\n\n  get onload () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].load\n  }\n\n  set onload (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].load) {\n      this.removeEventListener('load', this[kEvents].load)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].load = fn\n      this.addEventListener('load', fn)\n    } else {\n      this[kEvents].load = null\n    }\n  }\n\n  get onabort () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].abort\n  }\n\n  set onabort (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].abort) {\n      this.removeEventListener('abort', this[kEvents].abort)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].abort = fn\n      this.addEventListener('abort', fn)\n    } else {\n      this[kEvents].abort = null\n    }\n  }\n}\n\n// https://w3c.github.io/FileAPI/#dom-filereader-empty\nFileReader.EMPTY = FileReader.prototype.EMPTY = 0\n// https://w3c.github.io/FileAPI/#dom-filereader-loading\nFileReader.LOADING = FileReader.prototype.LOADING = 1\n// https://w3c.github.io/FileAPI/#dom-filereader-done\nFileReader.DONE = FileReader.prototype.DONE = 2\n\nObject.defineProperties(FileReader.prototype, {\n  EMPTY: staticPropertyDescriptors,\n  LOADING: staticPropertyDescriptors,\n  DONE: staticPropertyDescriptors,\n  readAsArrayBuffer: kEnumerableProperty,\n  readAsBinaryString: kEnumerableProperty,\n  readAsText: kEnumerableProperty,\n  readAsDataURL: kEnumerableProperty,\n  abort: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  result: kEnumerableProperty,\n  error: kEnumerableProperty,\n  onloadstart: kEnumerableProperty,\n  onprogress: kEnumerableProperty,\n  onload: kEnumerableProperty,\n  onabort: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onloadend: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'FileReader',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(FileReader, {\n  EMPTY: staticPropertyDescriptors,\n  LOADING: staticPropertyDescriptors,\n  DONE: staticPropertyDescriptors\n})\n\nmodule.exports = {\n  FileReader\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\n\nconst kState = Symbol('ProgressEvent state')\n\n/**\n * @see https://xhr.spec.whatwg.org/#progressevent\n */\nclass ProgressEvent extends Event {\n  constructor (type, eventInitDict = {}) {\n    type = webidl.converters.DOMString(type, 'ProgressEvent constructor', 'type')\n    eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})\n\n    super(type, eventInitDict)\n\n    this[kState] = {\n      lengthComputable: eventInitDict.lengthComputable,\n      loaded: eventInitDict.loaded,\n      total: eventInitDict.total\n    }\n  }\n\n  get lengthComputable () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].lengthComputable\n  }\n\n  get loaded () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].loaded\n  }\n\n  get total () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].total\n  }\n}\n\nwebidl.converters.ProgressEventInit = webidl.dictionaryConverter([\n  {\n    key: 'lengthComputable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'loaded',\n    converter: webidl.converters['unsigned long long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'total',\n    converter: webidl.converters['unsigned long long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'bubbles',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'cancelable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'composed',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n])\n\nmodule.exports = {\n  ProgressEvent\n}\n","'use strict'\n\nmodule.exports = {\n  kState: Symbol('FileReader state'),\n  kResult: Symbol('FileReader result'),\n  kError: Symbol('FileReader error'),\n  kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),\n  kEvents: Symbol('FileReader events'),\n  kAborted: Symbol('FileReader aborted')\n}\n","'use strict'\n\nconst {\n  kState,\n  kError,\n  kResult,\n  kAborted,\n  kLastProgressEventFired\n} = require('./symbols')\nconst { ProgressEvent } = require('./progressevent')\nconst { getEncoding } = require('./encoding')\nconst { serializeAMimeType, parseMIMEType } = require('../fetch/data-url')\nconst { types } = require('node:util')\nconst { StringDecoder } = require('string_decoder')\nconst { btoa } = require('node:buffer')\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n  enumerable: true,\n  writable: false,\n  configurable: false\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#readOperation\n * @param {import('./filereader').FileReader} fr\n * @param {import('buffer').Blob} blob\n * @param {string} type\n * @param {string?} encodingName\n */\nfunction readOperation (fr, blob, type, encodingName) {\n  // 1. If fr’s state is \"loading\", throw an InvalidStateError\n  //    DOMException.\n  if (fr[kState] === 'loading') {\n    throw new DOMException('Invalid state', 'InvalidStateError')\n  }\n\n  // 2. Set fr’s state to \"loading\".\n  fr[kState] = 'loading'\n\n  // 3. Set fr’s result to null.\n  fr[kResult] = null\n\n  // 4. Set fr’s error to null.\n  fr[kError] = null\n\n  // 5. Let stream be the result of calling get stream on blob.\n  /** @type {import('stream/web').ReadableStream} */\n  const stream = blob.stream()\n\n  // 6. Let reader be the result of getting a reader from stream.\n  const reader = stream.getReader()\n\n  // 7. Let bytes be an empty byte sequence.\n  /** @type {Uint8Array[]} */\n  const bytes = []\n\n  // 8. Let chunkPromise be the result of reading a chunk from\n  //    stream with reader.\n  let chunkPromise = reader.read()\n\n  // 9. Let isFirstChunk be true.\n  let isFirstChunk = true\n\n  // 10. In parallel, while true:\n  // Note: \"In parallel\" just means non-blocking\n  // Note 2: readOperation itself cannot be async as double\n  // reading the body would then reject the promise, instead\n  // of throwing an error.\n  ;(async () => {\n    while (!fr[kAborted]) {\n      // 1. Wait for chunkPromise to be fulfilled or rejected.\n      try {\n        const { done, value } = await chunkPromise\n\n        // 2. If chunkPromise is fulfilled, and isFirstChunk is\n        //    true, queue a task to fire a progress event called\n        //    loadstart at fr.\n        if (isFirstChunk && !fr[kAborted]) {\n          queueMicrotask(() => {\n            fireAProgressEvent('loadstart', fr)\n          })\n        }\n\n        // 3. Set isFirstChunk to false.\n        isFirstChunk = false\n\n        // 4. If chunkPromise is fulfilled with an object whose\n        //    done property is false and whose value property is\n        //    a Uint8Array object, run these steps:\n        if (!done && types.isUint8Array(value)) {\n          // 1. Let bs be the byte sequence represented by the\n          //    Uint8Array object.\n\n          // 2. Append bs to bytes.\n          bytes.push(value)\n\n          // 3. If roughly 50ms have passed since these steps\n          //    were last invoked, queue a task to fire a\n          //    progress event called progress at fr.\n          if (\n            (\n              fr[kLastProgressEventFired] === undefined ||\n              Date.now() - fr[kLastProgressEventFired] >= 50\n            ) &&\n            !fr[kAborted]\n          ) {\n            fr[kLastProgressEventFired] = Date.now()\n            queueMicrotask(() => {\n              fireAProgressEvent('progress', fr)\n            })\n          }\n\n          // 4. Set chunkPromise to the result of reading a\n          //    chunk from stream with reader.\n          chunkPromise = reader.read()\n        } else if (done) {\n          // 5. Otherwise, if chunkPromise is fulfilled with an\n          //    object whose done property is true, queue a task\n          //    to run the following steps and abort this algorithm:\n          queueMicrotask(() => {\n            // 1. Set fr’s state to \"done\".\n            fr[kState] = 'done'\n\n            // 2. Let result be the result of package data given\n            //    bytes, type, blob’s type, and encodingName.\n            try {\n              const result = packageData(bytes, type, blob.type, encodingName)\n\n              // 4. Else:\n\n              if (fr[kAborted]) {\n                return\n              }\n\n              // 1. Set fr’s result to result.\n              fr[kResult] = result\n\n              // 2. Fire a progress event called load at the fr.\n              fireAProgressEvent('load', fr)\n            } catch (error) {\n              // 3. If package data threw an exception error:\n\n              // 1. Set fr’s error to error.\n              fr[kError] = error\n\n              // 2. Fire a progress event called error at fr.\n              fireAProgressEvent('error', fr)\n            }\n\n            // 5. If fr’s state is not \"loading\", fire a progress\n            //    event called loadend at the fr.\n            if (fr[kState] !== 'loading') {\n              fireAProgressEvent('loadend', fr)\n            }\n          })\n\n          break\n        }\n      } catch (error) {\n        if (fr[kAborted]) {\n          return\n        }\n\n        // 6. Otherwise, if chunkPromise is rejected with an\n        //    error error, queue a task to run the following\n        //    steps and abort this algorithm:\n        queueMicrotask(() => {\n          // 1. Set fr’s state to \"done\".\n          fr[kState] = 'done'\n\n          // 2. Set fr’s error to error.\n          fr[kError] = error\n\n          // 3. Fire a progress event called error at fr.\n          fireAProgressEvent('error', fr)\n\n          // 4. If fr’s state is not \"loading\", fire a progress\n          //    event called loadend at fr.\n          if (fr[kState] !== 'loading') {\n            fireAProgressEvent('loadend', fr)\n          }\n        })\n\n        break\n      }\n    }\n  })()\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#fire-a-progress-event\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e The name of the event\n * @param {import('./filereader').FileReader} reader\n */\nfunction fireAProgressEvent (e, reader) {\n  // The progress event e does not bubble. e.bubbles must be false\n  // The progress event e is NOT cancelable. e.cancelable must be false\n  const event = new ProgressEvent(e, {\n    bubbles: false,\n    cancelable: false\n  })\n\n  reader.dispatchEvent(event)\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#blob-package-data\n * @param {Uint8Array[]} bytes\n * @param {string} type\n * @param {string?} mimeType\n * @param {string?} encodingName\n */\nfunction packageData (bytes, type, mimeType, encodingName) {\n  // 1. A Blob has an associated package data algorithm, given\n  //    bytes, a type, a optional mimeType, and a optional\n  //    encodingName, which switches on type and runs the\n  //    associated steps:\n\n  switch (type) {\n    case 'DataURL': {\n      // 1. Return bytes as a DataURL [RFC2397] subject to\n      //    the considerations below:\n      //  * Use mimeType as part of the Data URL if it is\n      //    available in keeping with the Data URL\n      //    specification [RFC2397].\n      //  * If mimeType is not available return a Data URL\n      //    without a media-type. [RFC2397].\n\n      // https://datatracker.ietf.org/doc/html/rfc2397#section-3\n      // dataurl    := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n      // mediatype  := [ type \"/\" subtype ] *( \";\" parameter )\n      // data       := *urlchar\n      // parameter  := attribute \"=\" value\n      let dataURL = 'data:'\n\n      const parsed = parseMIMEType(mimeType || 'application/octet-stream')\n\n      if (parsed !== 'failure') {\n        dataURL += serializeAMimeType(parsed)\n      }\n\n      dataURL += ';base64,'\n\n      const decoder = new StringDecoder('latin1')\n\n      for (const chunk of bytes) {\n        dataURL += btoa(decoder.write(chunk))\n      }\n\n      dataURL += btoa(decoder.end())\n\n      return dataURL\n    }\n    case 'Text': {\n      // 1. Let encoding be failure\n      let encoding = 'failure'\n\n      // 2. If the encodingName is present, set encoding to the\n      //    result of getting an encoding from encodingName.\n      if (encodingName) {\n        encoding = getEncoding(encodingName)\n      }\n\n      // 3. If encoding is failure, and mimeType is present:\n      if (encoding === 'failure' && mimeType) {\n        // 1. Let type be the result of parse a MIME type\n        //    given mimeType.\n        const type = parseMIMEType(mimeType)\n\n        // 2. If type is not failure, set encoding to the result\n        //    of getting an encoding from type’s parameters[\"charset\"].\n        if (type !== 'failure') {\n          encoding = getEncoding(type.parameters.get('charset'))\n        }\n      }\n\n      // 4. If encoding is failure, then set encoding to UTF-8.\n      if (encoding === 'failure') {\n        encoding = 'UTF-8'\n      }\n\n      // 5. Decode bytes using fallback encoding encoding, and\n      //    return the result.\n      return decode(bytes, encoding)\n    }\n    case 'ArrayBuffer': {\n      // Return a new ArrayBuffer whose contents are bytes.\n      const sequence = combineByteSequences(bytes)\n\n      return sequence.buffer\n    }\n    case 'BinaryString': {\n      // Return bytes as a binary string, in which every byte\n      //  is represented by a code unit of equal value [0..255].\n      let binaryString = ''\n\n      const decoder = new StringDecoder('latin1')\n\n      for (const chunk of bytes) {\n        binaryString += decoder.write(chunk)\n      }\n\n      binaryString += decoder.end()\n\n      return binaryString\n    }\n  }\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#decode\n * @param {Uint8Array[]} ioQueue\n * @param {string} encoding\n */\nfunction decode (ioQueue, encoding) {\n  const bytes = combineByteSequences(ioQueue)\n\n  // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.\n  const BOMEncoding = BOMSniffing(bytes)\n\n  let slice = 0\n\n  // 2. If BOMEncoding is non-null:\n  if (BOMEncoding !== null) {\n    // 1. Set encoding to BOMEncoding.\n    encoding = BOMEncoding\n\n    // 2. Read three bytes from ioQueue, if BOMEncoding is\n    //    UTF-8; otherwise read two bytes.\n    //    (Do nothing with those bytes.)\n    slice = BOMEncoding === 'UTF-8' ? 3 : 2\n  }\n\n  // 3. Process a queue with an instance of encoding’s\n  //    decoder, ioQueue, output, and \"replacement\".\n\n  // 4. Return output.\n\n  const sliced = bytes.slice(slice)\n  return new TextDecoder(encoding).decode(sliced)\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#bom-sniff\n * @param {Uint8Array} ioQueue\n */\nfunction BOMSniffing (ioQueue) {\n  // 1. Let BOM be the result of peeking 3 bytes from ioQueue,\n  //    converted to a byte sequence.\n  const [a, b, c] = ioQueue\n\n  // 2. For each of the rows in the table below, starting with\n  //    the first one and going down, if BOM starts with the\n  //    bytes given in the first column, then return the\n  //    encoding given in the cell in the second column of that\n  //    row. Otherwise, return null.\n  if (a === 0xEF && b === 0xBB && c === 0xBF) {\n    return 'UTF-8'\n  } else if (a === 0xFE && b === 0xFF) {\n    return 'UTF-16BE'\n  } else if (a === 0xFF && b === 0xFE) {\n    return 'UTF-16LE'\n  }\n\n  return null\n}\n\n/**\n * @param {Uint8Array[]} sequences\n */\nfunction combineByteSequences (sequences) {\n  const size = sequences.reduce((a, b) => {\n    return a + b.byteLength\n  }, 0)\n\n  let offset = 0\n\n  return sequences.reduce((a, b) => {\n    a.set(b, offset)\n    offset += b.byteLength\n    return a\n  }, new Uint8Array(size))\n}\n\nmodule.exports = {\n  staticPropertyDescriptors,\n  readOperation,\n  fireAProgressEvent\n}\n","'use strict'\n\nconst { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require('./constants')\nconst {\n  kReadyState,\n  kSentClose,\n  kByteParser,\n  kReceivedClose,\n  kResponse\n} = require('./symbols')\nconst { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require('./util')\nconst { channels } = require('../../core/diagnostics')\nconst { CloseEvent } = require('./events')\nconst { makeRequest } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { Headers, getHeadersList } = require('../fetch/headers')\nconst { getDecodeSplit } = require('../fetch/util')\nconst { WebsocketFrameSend } = require('./frame')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n  crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#concept-websocket-establish\n * @param {URL} url\n * @param {string|string[]} protocols\n * @param {import('./websocket').WebSocket} ws\n * @param {(response: any, extensions: string[] | undefined) => void} onEstablish\n * @param {Partial} options\n */\nfunction establishWebSocketConnection (url, protocols, client, ws, onEstablish, options) {\n  // 1. Let requestURL be a copy of url, with its scheme set to \"http\", if url’s\n  //    scheme is \"ws\", and to \"https\" otherwise.\n  const requestURL = url\n\n  requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'\n\n  // 2. Let request be a new request, whose URL is requestURL, client is client,\n  //    service-workers mode is \"none\", referrer is \"no-referrer\", mode is\n  //    \"websocket\", credentials mode is \"include\", cache mode is \"no-store\" ,\n  //    and redirect mode is \"error\".\n  const request = makeRequest({\n    urlList: [requestURL],\n    client,\n    serviceWorkers: 'none',\n    referrer: 'no-referrer',\n    mode: 'websocket',\n    credentials: 'include',\n    cache: 'no-store',\n    redirect: 'error'\n  })\n\n  // Note: undici extension, allow setting custom headers.\n  if (options.headers) {\n    const headersList = getHeadersList(new Headers(options.headers))\n\n    request.headersList = headersList\n  }\n\n  // 3. Append (`Upgrade`, `websocket`) to request’s header list.\n  // 4. Append (`Connection`, `Upgrade`) to request’s header list.\n  // Note: both of these are handled by undici currently.\n  // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397\n\n  // 5. Let keyValue be a nonce consisting of a randomly selected\n  //    16-byte value that has been forgiving-base64-encoded and\n  //    isomorphic encoded.\n  const keyValue = crypto.randomBytes(16).toString('base64')\n\n  // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s\n  //    header list.\n  request.headersList.append('sec-websocket-key', keyValue)\n\n  // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s\n  //    header list.\n  request.headersList.append('sec-websocket-version', '13')\n\n  // 8. For each protocol in protocols, combine\n  //    (`Sec-WebSocket-Protocol`, protocol) in request’s header\n  //    list.\n  for (const protocol of protocols) {\n    request.headersList.append('sec-websocket-protocol', protocol)\n  }\n\n  // 9. Let permessageDeflate be a user-agent defined\n  //    \"permessage-deflate\" extension header value.\n  // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673\n  const permessageDeflate = 'permessage-deflate; client_max_window_bits'\n\n  // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to\n  //     request’s header list.\n  request.headersList.append('sec-websocket-extensions', permessageDeflate)\n\n  // 11. Fetch request with useParallelQueue set to true, and\n  //     processResponse given response being these steps:\n  const controller = fetching({\n    request,\n    useParallelQueue: true,\n    dispatcher: options.dispatcher,\n    processResponse (response) {\n      // 1. If response is a network error or its status is not 101,\n      //    fail the WebSocket connection.\n      if (response.type === 'error' || response.status !== 101) {\n        failWebsocketConnection(ws, 'Received network error or non-101 status code.')\n        return\n      }\n\n      // 2. If protocols is not the empty list and extracting header\n      //    list values given `Sec-WebSocket-Protocol` and response’s\n      //    header list results in null, failure, or the empty byte\n      //    sequence, then fail the WebSocket connection.\n      if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {\n        failWebsocketConnection(ws, 'Server did not respond with sent protocols.')\n        return\n      }\n\n      // 3. Follow the requirements stated step 2 to step 6, inclusive,\n      //    of the last set of steps in section 4.1 of The WebSocket\n      //    Protocol to validate response. This either results in fail\n      //    the WebSocket connection or the WebSocket connection is\n      //    established.\n\n      // 2. If the response lacks an |Upgrade| header field or the |Upgrade|\n      //    header field contains a value that is not an ASCII case-\n      //    insensitive match for the value \"websocket\", the client MUST\n      //    _Fail the WebSocket Connection_.\n      if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {\n        failWebsocketConnection(ws, 'Server did not set Upgrade header to \"websocket\".')\n        return\n      }\n\n      // 3. If the response lacks a |Connection| header field or the\n      //    |Connection| header field doesn't contain a token that is an\n      //    ASCII case-insensitive match for the value \"Upgrade\", the client\n      //    MUST _Fail the WebSocket Connection_.\n      if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {\n        failWebsocketConnection(ws, 'Server did not set Connection header to \"upgrade\".')\n        return\n      }\n\n      // 4. If the response lacks a |Sec-WebSocket-Accept| header field or\n      //    the |Sec-WebSocket-Accept| contains a value other than the\n      //    base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-\n      //    Key| (as a string, not base64-decoded) with the string \"258EAFA5-\n      //    E914-47DA-95CA-C5AB0DC85B11\" but ignoring any leading and\n      //    trailing whitespace, the client MUST _Fail the WebSocket\n      //    Connection_.\n      const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')\n      const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')\n      if (secWSAccept !== digest) {\n        failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')\n        return\n      }\n\n      // 5. If the response includes a |Sec-WebSocket-Extensions| header\n      //    field and this header field indicates the use of an extension\n      //    that was not present in the client's handshake (the server has\n      //    indicated an extension not requested by the client), the client\n      //    MUST _Fail the WebSocket Connection_.  (The parsing of this\n      //    header field to determine which extensions are requested is\n      //    discussed in Section 9.1.)\n      const secExtension = response.headersList.get('Sec-WebSocket-Extensions')\n      let extensions\n\n      if (secExtension !== null) {\n        extensions = parseExtensions(secExtension)\n\n        if (!extensions.has('permessage-deflate')) {\n          failWebsocketConnection(ws, 'Sec-WebSocket-Extensions header does not match.')\n          return\n        }\n      }\n\n      // 6. If the response includes a |Sec-WebSocket-Protocol| header field\n      //    and this header field indicates the use of a subprotocol that was\n      //    not present in the client's handshake (the server has indicated a\n      //    subprotocol not requested by the client), the client MUST _Fail\n      //    the WebSocket Connection_.\n      const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')\n\n      if (secProtocol !== null) {\n        const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList)\n\n        // The client can request that the server use a specific subprotocol by\n        // including the |Sec-WebSocket-Protocol| field in its handshake.  If it\n        // is specified, the server needs to include the same field and one of\n        // the selected subprotocol values in its response for the connection to\n        // be established.\n        if (!requestProtocols.includes(secProtocol)) {\n          failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')\n          return\n        }\n      }\n\n      response.socket.on('data', onSocketData)\n      response.socket.on('close', onSocketClose)\n      response.socket.on('error', onSocketError)\n\n      if (channels.open.hasSubscribers) {\n        channels.open.publish({\n          address: response.socket.address(),\n          protocol: secProtocol,\n          extensions: secExtension\n        })\n      }\n\n      onEstablish(response, extensions)\n    }\n  })\n\n  return controller\n}\n\nfunction closeWebSocketConnection (ws, code, reason, reasonByteLength) {\n  if (isClosing(ws) || isClosed(ws)) {\n    // If this's ready state is CLOSING (2) or CLOSED (3)\n    // Do nothing.\n  } else if (!isEstablished(ws)) {\n    // If the WebSocket connection is not yet established\n    // Fail the WebSocket connection and set this's ready state\n    // to CLOSING (2).\n    failWebsocketConnection(ws, 'Connection was closed before it was established.')\n    ws[kReadyState] = states.CLOSING\n  } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) {\n    // If the WebSocket closing handshake has not yet been started\n    // Start the WebSocket closing handshake and set this's ready\n    // state to CLOSING (2).\n    // - If neither code nor reason is present, the WebSocket Close\n    //   message must not have a body.\n    // - If code is present, then the status code to use in the\n    //   WebSocket Close message must be the integer given by code.\n    // - If reason is also present, then reasonBytes must be\n    //   provided in the Close message after the status code.\n\n    ws[kSentClose] = sentCloseFrameState.PROCESSING\n\n    const frame = new WebsocketFrameSend()\n\n    // If neither code nor reason is present, the WebSocket Close\n    // message must not have a body.\n\n    // If code is present, then the status code to use in the\n    // WebSocket Close message must be the integer given by code.\n    if (code !== undefined && reason === undefined) {\n      frame.frameData = Buffer.allocUnsafe(2)\n      frame.frameData.writeUInt16BE(code, 0)\n    } else if (code !== undefined && reason !== undefined) {\n      // If reason is also present, then reasonBytes must be\n      // provided in the Close message after the status code.\n      frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)\n      frame.frameData.writeUInt16BE(code, 0)\n      // the body MAY contain UTF-8-encoded data with value /reason/\n      frame.frameData.write(reason, 2, 'utf-8')\n    } else {\n      frame.frameData = emptyBuffer\n    }\n\n    /** @type {import('stream').Duplex} */\n    const socket = ws[kResponse].socket\n\n    socket.write(frame.createFrame(opcodes.CLOSE))\n\n    ws[kSentClose] = sentCloseFrameState.SENT\n\n    // Upon either sending or receiving a Close control frame, it is said\n    // that _The WebSocket Closing Handshake is Started_ and that the\n    // WebSocket connection is in the CLOSING state.\n    ws[kReadyState] = states.CLOSING\n  } else {\n    // Otherwise\n    // Set this's ready state to CLOSING (2).\n    ws[kReadyState] = states.CLOSING\n  }\n}\n\n/**\n * @param {Buffer} chunk\n */\nfunction onSocketData (chunk) {\n  if (!this.ws[kByteParser].write(chunk)) {\n    this.pause()\n  }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n */\nfunction onSocketClose () {\n  const { ws } = this\n  const { [kResponse]: response } = ws\n\n  response.socket.off('data', onSocketData)\n  response.socket.off('close', onSocketClose)\n  response.socket.off('error', onSocketError)\n\n  // If the TCP connection was closed after the\n  // WebSocket closing handshake was completed, the WebSocket connection\n  // is said to have been closed _cleanly_.\n  const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]\n\n  let code = 1005\n  let reason = ''\n\n  const result = ws[kByteParser].closingInfo\n\n  if (result && !result.error) {\n    code = result.code ?? 1005\n    reason = result.reason\n  } else if (!ws[kReceivedClose]) {\n    // If _The WebSocket\n    // Connection is Closed_ and no Close control frame was received by the\n    // endpoint (such as could occur if the underlying transport connection\n    // is lost), _The WebSocket Connection Close Code_ is considered to be\n    // 1006.\n    code = 1006\n  }\n\n  // 1. Change the ready state to CLOSED (3).\n  ws[kReadyState] = states.CLOSED\n\n  // 2. If the user agent was required to fail the WebSocket\n  //    connection, or if the WebSocket connection was closed\n  //    after being flagged as full, fire an event named error\n  //    at the WebSocket object.\n  // TODO\n\n  // 3. Fire an event named close at the WebSocket object,\n  //    using CloseEvent, with the wasClean attribute\n  //    initialized to true if the connection closed cleanly\n  //    and false otherwise, the code attribute initialized to\n  //    the WebSocket connection close code, and the reason\n  //    attribute initialized to the result of applying UTF-8\n  //    decode without BOM to the WebSocket connection close\n  //    reason.\n  // TODO: process.nextTick\n  fireEvent('close', ws, (type, init) => new CloseEvent(type, init), {\n    wasClean, code, reason\n  })\n\n  if (channels.close.hasSubscribers) {\n    channels.close.publish({\n      websocket: ws,\n      code,\n      reason\n    })\n  }\n}\n\nfunction onSocketError (error) {\n  const { ws } = this\n\n  ws[kReadyState] = states.CLOSING\n\n  if (channels.socketError.hasSubscribers) {\n    channels.socketError.publish(error)\n  }\n\n  this.destroy()\n}\n\nmodule.exports = {\n  establishWebSocketConnection,\n  closeWebSocketConnection\n}\n","'use strict'\n\n// This is a Globally Unique Identifier unique used\n// to validate that the endpoint accepts websocket\n// connections.\n// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3\nconst uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n  enumerable: true,\n  writable: false,\n  configurable: false\n}\n\nconst states = {\n  CONNECTING: 0,\n  OPEN: 1,\n  CLOSING: 2,\n  CLOSED: 3\n}\n\nconst sentCloseFrameState = {\n  NOT_SENT: 0,\n  PROCESSING: 1,\n  SENT: 2\n}\n\nconst opcodes = {\n  CONTINUATION: 0x0,\n  TEXT: 0x1,\n  BINARY: 0x2,\n  CLOSE: 0x8,\n  PING: 0x9,\n  PONG: 0xA\n}\n\nconst maxUnsigned16Bit = 2 ** 16 - 1 // 65535\n\nconst parserStates = {\n  INFO: 0,\n  PAYLOADLENGTH_16: 2,\n  PAYLOADLENGTH_64: 3,\n  READ_DATA: 4\n}\n\nconst emptyBuffer = Buffer.allocUnsafe(0)\n\nconst sendHints = {\n  string: 1,\n  typedArray: 2,\n  arrayBuffer: 3,\n  blob: 4\n}\n\nmodule.exports = {\n  uid,\n  sentCloseFrameState,\n  staticPropertyDescriptors,\n  states,\n  opcodes,\n  maxUnsigned16Bit,\n  parserStates,\n  emptyBuffer,\n  sendHints\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { kConstruct } = require('../../core/symbols')\nconst { MessagePort } = require('node:worker_threads')\n\n/**\n * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent\n */\nclass MessageEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict = {}) {\n    if (type === kConstruct) {\n      super(arguments[1], arguments[2])\n      webidl.util.markAsUncloneable(this)\n      return\n    }\n\n    const prefix = 'MessageEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')\n\n    super(type, eventInitDict)\n\n    this.#eventInit = eventInitDict\n    webidl.util.markAsUncloneable(this)\n  }\n\n  get data () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.data\n  }\n\n  get origin () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.origin\n  }\n\n  get lastEventId () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.lastEventId\n  }\n\n  get source () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.source\n  }\n\n  get ports () {\n    webidl.brandCheck(this, MessageEvent)\n\n    if (!Object.isFrozen(this.#eventInit.ports)) {\n      Object.freeze(this.#eventInit.ports)\n    }\n\n    return this.#eventInit.ports\n  }\n\n  initMessageEvent (\n    type,\n    bubbles = false,\n    cancelable = false,\n    data = null,\n    origin = '',\n    lastEventId = '',\n    source = null,\n    ports = []\n  ) {\n    webidl.brandCheck(this, MessageEvent)\n\n    webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')\n\n    return new MessageEvent(type, {\n      bubbles, cancelable, data, origin, lastEventId, source, ports\n    })\n  }\n\n  static createFastMessageEvent (type, init) {\n    const messageEvent = new MessageEvent(kConstruct, type, init)\n    messageEvent.#eventInit = init\n    messageEvent.#eventInit.data ??= null\n    messageEvent.#eventInit.origin ??= ''\n    messageEvent.#eventInit.lastEventId ??= ''\n    messageEvent.#eventInit.source ??= null\n    messageEvent.#eventInit.ports ??= []\n    return messageEvent\n  }\n}\n\nconst { createFastMessageEvent } = MessageEvent\ndelete MessageEvent.createFastMessageEvent\n\n/**\n * @see https://websockets.spec.whatwg.org/#the-closeevent-interface\n */\nclass CloseEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict = {}) {\n    const prefix = 'CloseEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.CloseEventInit(eventInitDict)\n\n    super(type, eventInitDict)\n\n    this.#eventInit = eventInitDict\n    webidl.util.markAsUncloneable(this)\n  }\n\n  get wasClean () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.wasClean\n  }\n\n  get code () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.code\n  }\n\n  get reason () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.reason\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface\nclass ErrorEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict) {\n    const prefix = 'ErrorEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    super(type, eventInitDict)\n    webidl.util.markAsUncloneable(this)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})\n\n    this.#eventInit = eventInitDict\n  }\n\n  get message () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.message\n  }\n\n  get filename () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.filename\n  }\n\n  get lineno () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.lineno\n  }\n\n  get colno () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.colno\n  }\n\n  get error () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.error\n  }\n}\n\nObject.defineProperties(MessageEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'MessageEvent',\n    configurable: true\n  },\n  data: kEnumerableProperty,\n  origin: kEnumerableProperty,\n  lastEventId: kEnumerableProperty,\n  source: kEnumerableProperty,\n  ports: kEnumerableProperty,\n  initMessageEvent: kEnumerableProperty\n})\n\nObject.defineProperties(CloseEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'CloseEvent',\n    configurable: true\n  },\n  reason: kEnumerableProperty,\n  code: kEnumerableProperty,\n  wasClean: kEnumerableProperty\n})\n\nObject.defineProperties(ErrorEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'ErrorEvent',\n    configurable: true\n  },\n  message: kEnumerableProperty,\n  filename: kEnumerableProperty,\n  lineno: kEnumerableProperty,\n  colno: kEnumerableProperty,\n  error: kEnumerableProperty\n})\n\nwebidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.MessagePort\n)\n\nconst eventInit = [\n  {\n    key: 'bubbles',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'cancelable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'composed',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n]\n\nwebidl.converters.MessageEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'data',\n    converter: webidl.converters.any,\n    defaultValue: () => null\n  },\n  {\n    key: 'origin',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'lastEventId',\n    converter: webidl.converters.DOMString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'source',\n    // Node doesn't implement WindowProxy or ServiceWorker, so the only\n    // valid value for source is a MessagePort.\n    converter: webidl.nullableConverter(webidl.converters.MessagePort),\n    defaultValue: () => null\n  },\n  {\n    key: 'ports',\n    converter: webidl.converters['sequence'],\n    defaultValue: () => new Array(0)\n  }\n])\n\nwebidl.converters.CloseEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'wasClean',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'code',\n    converter: webidl.converters['unsigned short'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'reason',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  }\n])\n\nwebidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'message',\n    converter: webidl.converters.DOMString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'filename',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'lineno',\n    converter: webidl.converters['unsigned long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'colno',\n    converter: webidl.converters['unsigned long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'error',\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = {\n  MessageEvent,\n  CloseEvent,\n  ErrorEvent,\n  createFastMessageEvent\n}\n","'use strict'\n\nconst { maxUnsigned16Bit } = require('./constants')\n\nconst BUFFER_SIZE = 16386\n\n/** @type {import('crypto')} */\nlet crypto\nlet buffer = null\nlet bufIdx = BUFFER_SIZE\n\ntry {\n  crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n  crypto = {\n    // not full compatibility, but minimum.\n    randomFillSync: function randomFillSync (buffer, _offset, _size) {\n      for (let i = 0; i < buffer.length; ++i) {\n        buffer[i] = Math.random() * 255 | 0\n      }\n      return buffer\n    }\n  }\n}\n\nfunction generateMask () {\n  if (bufIdx === BUFFER_SIZE) {\n    bufIdx = 0\n    crypto.randomFillSync((buffer ??= Buffer.allocUnsafe(BUFFER_SIZE)), 0, BUFFER_SIZE)\n  }\n  return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]\n}\n\nclass WebsocketFrameSend {\n  /**\n   * @param {Buffer|undefined} data\n   */\n  constructor (data) {\n    this.frameData = data\n  }\n\n  createFrame (opcode) {\n    const frameData = this.frameData\n    const maskKey = generateMask()\n    const bodyLength = frameData?.byteLength ?? 0\n\n    /** @type {number} */\n    let payloadLength = bodyLength // 0-125\n    let offset = 6\n\n    if (bodyLength > maxUnsigned16Bit) {\n      offset += 8 // payload length is next 8 bytes\n      payloadLength = 127\n    } else if (bodyLength > 125) {\n      offset += 2 // payload length is next 2 bytes\n      payloadLength = 126\n    }\n\n    const buffer = Buffer.allocUnsafe(bodyLength + offset)\n\n    // Clear first 2 bytes, everything else is overwritten\n    buffer[0] = buffer[1] = 0\n    buffer[0] |= 0x80 // FIN\n    buffer[0] = (buffer[0] & 0xF0) + opcode // opcode\n\n    /*! ws. MIT License. Einar Otto Stangvik  */\n    buffer[offset - 4] = maskKey[0]\n    buffer[offset - 3] = maskKey[1]\n    buffer[offset - 2] = maskKey[2]\n    buffer[offset - 1] = maskKey[3]\n\n    buffer[1] = payloadLength\n\n    if (payloadLength === 126) {\n      buffer.writeUInt16BE(bodyLength, 2)\n    } else if (payloadLength === 127) {\n      // Clear extended payload length\n      buffer[2] = buffer[3] = 0\n      buffer.writeUIntBE(bodyLength, 4, 6)\n    }\n\n    buffer[1] |= 0x80 // MASK\n\n    // mask body\n    for (let i = 0; i < bodyLength; ++i) {\n      buffer[offset + i] = frameData[i] ^ maskKey[i & 3]\n    }\n\n    return buffer\n  }\n}\n\nmodule.exports = {\n  WebsocketFrameSend\n}\n","'use strict'\n\nconst { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require('node:zlib')\nconst { isValidClientWindowBits } = require('./util')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nconst tail = Buffer.from([0x00, 0x00, 0xff, 0xff])\nconst kBuffer = Symbol('kBuffer')\nconst kLength = Symbol('kLength')\n\nclass PerMessageDeflate {\n  /** @type {import('node:zlib').InflateRaw} */\n  #inflate\n\n  #options = {}\n\n  #maxPayloadSize = 0\n\n  /**\n   * @param {Map} extensions\n   */\n  constructor (extensions, options) {\n    this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')\n    this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')\n\n    this.#maxPayloadSize = options.maxPayloadSize\n  }\n\n  /**\n   * Decompress a compressed payload.\n   * @param {Buffer} chunk Compressed data\n   * @param {boolean} fin Final fragment flag\n   * @param {Function} callback Callback function\n   */\n  decompress (chunk, fin, callback) {\n    // An endpoint uses the following algorithm to decompress a message.\n    // 1.  Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the\n    //     payload of the message.\n    // 2.  Decompress the resulting data using DEFLATE.\n    if (!this.#inflate) {\n      let windowBits = Z_DEFAULT_WINDOWBITS\n\n      if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS\n        if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {\n          callback(new Error('Invalid server_max_window_bits'))\n          return\n        }\n\n        windowBits = Number.parseInt(this.#options.serverMaxWindowBits)\n      }\n\n      try {\n        this.#inflate = createInflateRaw({ windowBits })\n      } catch (err) {\n        callback(err)\n        return\n      }\n      this.#inflate[kBuffer] = []\n      this.#inflate[kLength] = 0\n\n      this.#inflate.on('data', (data) => {\n        this.#inflate[kLength] += data.length\n\n        if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {\n          callback(new MessageSizeExceededError())\n          this.#inflate.removeAllListeners()\n          this.#inflate = null\n          return\n        }\n\n        this.#inflate[kBuffer].push(data)\n      })\n\n      this.#inflate.on('error', (err) => {\n        this.#inflate = null\n        callback(err)\n      })\n    }\n\n    this.#inflate.write(chunk)\n    if (fin) {\n      this.#inflate.write(tail)\n    }\n\n    this.#inflate.flush(() => {\n      if (!this.#inflate) {\n        return\n      }\n\n      const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])\n\n      this.#inflate[kBuffer].length = 0\n      this.#inflate[kLength] = 0\n\n      callback(null, full)\n    })\n  }\n}\n\nmodule.exports = { PerMessageDeflate }\n","'use strict'\n\nconst { Writable } = require('node:stream')\nconst assert = require('node:assert')\nconst { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require('./constants')\nconst { kReadyState, kSentClose, kResponse, kReceivedClose } = require('./symbols')\nconst { channels } = require('../../core/diagnostics')\nconst {\n  isValidStatusCode,\n  isValidOpcode,\n  failWebsocketConnection,\n  websocketMessageReceived,\n  utf8Decode,\n  isControlFrame,\n  isTextBinaryFrame,\n  isContinuationFrame\n} = require('./util')\nconst { WebsocketFrameSend } = require('./frame')\nconst { closeWebSocketConnection } = require('./connection')\nconst { PerMessageDeflate } = require('./permessage-deflate')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nfunction failWebsocketConnectionWithCode (ws, code, reason) {\n  closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason))\n  failWebsocketConnection(ws, reason)\n}\n\n// This code was influenced by ws released under the MIT license.\n// Copyright (c) 2011 Einar Otto Stangvik \n// Copyright (c) 2013 Arnout Kazemier and contributors\n// Copyright (c) 2016 Luigi Pinca and contributors\n\nclass ByteParser extends Writable {\n  #buffers = []\n  #fragmentsBytes = 0\n  #byteOffset = 0\n  #loop = false\n\n  #state = parserStates.INFO\n\n  #info = {}\n  #fragments = []\n\n  /** @type {Map} */\n  #extensions\n\n  /** @type {number} */\n  #maxFragments\n\n  /** @type {number} */\n  #maxPayloadSize\n\n  /**\n   * @param {import('./websocket').WebSocket} ws\n   * @param {Map|null} extensions\n   * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]\n   */\n  constructor (ws, extensions, options = {}) {\n    super()\n\n    this.ws = ws\n    this.#extensions = extensions == null ? new Map() : extensions\n    this.#maxFragments = options.maxFragments ?? 0\n    this.#maxPayloadSize = options.maxPayloadSize ?? 0\n\n    if (this.#extensions.has('permessage-deflate')) {\n      this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))\n    }\n  }\n\n  /**\n   * @param {Buffer} chunk\n   * @param {() => void} callback\n   */\n  _write (chunk, _, callback) {\n    this.#buffers.push(chunk)\n    this.#byteOffset += chunk.length\n    this.#loop = true\n\n    this.run(callback)\n  }\n\n  #validatePayloadLength () {\n    if (\n      this.#maxPayloadSize > 0 &&\n      !isControlFrame(this.#info.opcode) &&\n      this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize\n    ) {\n      failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size')\n      return false\n    }\n\n    return true\n  }\n\n  /**\n   * Runs whenever a new chunk is received.\n   * Callback is called whenever there are no more chunks buffering,\n   * or not enough bytes are buffered to parse.\n   */\n  run (callback) {\n    while (this.#loop) {\n      if (this.#state === parserStates.INFO) {\n        // If there aren't enough bytes to parse the payload length, etc.\n        if (this.#byteOffset < 2) {\n          return callback()\n        }\n\n        const buffer = this.consume(2)\n        const fin = (buffer[0] & 0x80) !== 0\n        const opcode = buffer[0] & 0x0F\n        const masked = (buffer[1] & 0x80) === 0x80\n\n        const fragmented = !fin && opcode !== opcodes.CONTINUATION\n        const payloadLength = buffer[1] & 0x7F\n\n        const rsv1 = buffer[0] & 0x40\n        const rsv2 = buffer[0] & 0x20\n        const rsv3 = buffer[0] & 0x10\n\n        if (!isValidOpcode(opcode)) {\n          failWebsocketConnection(this.ws, 'Invalid opcode received')\n          return callback()\n        }\n\n        if (masked) {\n          failWebsocketConnection(this.ws, 'Frame cannot be masked')\n          return callback()\n        }\n\n        // MUST be 0 unless an extension is negotiated that defines meanings\n        // for non-zero values.  If a nonzero value is received and none of\n        // the negotiated extensions defines the meaning of such a nonzero\n        // value, the receiving endpoint MUST _Fail the WebSocket\n        // Connection_.\n        // This document allocates the RSV1 bit of the WebSocket header for\n        // PMCEs and calls the bit the \"Per-Message Compressed\" bit.  On a\n        // WebSocket connection where a PMCE is in use, this bit indicates\n        // whether a message is compressed or not.\n        if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {\n          failWebsocketConnection(this.ws, 'Expected RSV1 to be clear.')\n          return\n        }\n\n        if (rsv2 !== 0 || rsv3 !== 0) {\n          failWebsocketConnection(this.ws, 'RSV1, RSV2, RSV3 must be clear')\n          return\n        }\n\n        if (fragmented && !isTextBinaryFrame(opcode)) {\n          // Only text and binary frames can be fragmented\n          failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')\n          return\n        }\n\n        // If we are already parsing a text/binary frame and do not receive either\n        // a continuation frame or close frame, fail the connection.\n        if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {\n          failWebsocketConnection(this.ws, 'Expected continuation frame')\n          return\n        }\n\n        if (this.#info.fragmented && fragmented) {\n          // A fragmented frame can't be fragmented itself\n          failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')\n          return\n        }\n\n        // \"All control frames MUST have a payload length of 125 bytes or less\n        // and MUST NOT be fragmented.\"\n        if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {\n          failWebsocketConnection(this.ws, 'Control frame either too large or fragmented')\n          return\n        }\n\n        if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {\n          failWebsocketConnection(this.ws, 'Unexpected continuation frame')\n          return\n        }\n\n        if (payloadLength <= 125) {\n          this.#info.payloadLength = payloadLength\n          this.#state = parserStates.READ_DATA\n\n          if (!this.#validatePayloadLength()) {\n            return\n          }\n        } else if (payloadLength === 126) {\n          this.#state = parserStates.PAYLOADLENGTH_16\n        } else if (payloadLength === 127) {\n          this.#state = parserStates.PAYLOADLENGTH_64\n        }\n\n        if (isTextBinaryFrame(opcode)) {\n          this.#info.binaryType = opcode\n          this.#info.compressed = rsv1 !== 0\n        }\n\n        this.#info.opcode = opcode\n        this.#info.masked = masked\n        this.#info.fin = fin\n        this.#info.fragmented = fragmented\n      } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n        if (this.#byteOffset < 2) {\n          return callback()\n        }\n\n        const buffer = this.consume(2)\n\n        this.#info.payloadLength = buffer.readUInt16BE(0)\n        this.#state = parserStates.READ_DATA\n\n        if (!this.#validatePayloadLength()) {\n          return\n        }\n      } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n        if (this.#byteOffset < 8) {\n          return callback()\n        }\n\n        const buffer = this.consume(8)\n        const upper = buffer.readUInt32BE(0)\n        const lower = buffer.readUInt32BE(4)\n\n        // 2^31 is the maximum bytes an arraybuffer can contain\n        // on 32-bit systems. Although, on 64-bit systems, this is\n        // 2^53-1 bytes.\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n        // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n        // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n        if (upper !== 0 || lower > 2 ** 31 - 1) {\n          failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')\n          return\n        }\n\n        this.#info.payloadLength = lower\n        this.#state = parserStates.READ_DATA\n\n        if (!this.#validatePayloadLength()) {\n          return\n        }\n      } else if (this.#state === parserStates.READ_DATA) {\n        if (this.#byteOffset < this.#info.payloadLength) {\n          return callback()\n        }\n\n        const body = this.consume(this.#info.payloadLength)\n\n        if (isControlFrame(this.#info.opcode)) {\n          this.#loop = this.parseControlFrame(body)\n          this.#state = parserStates.INFO\n        } else {\n          if (!this.#info.compressed) {\n            if (!this.writeFragments(body)) {\n              return\n            }\n\n            if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n              failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n              return\n            }\n\n            // If the frame is not fragmented, a message has been received.\n            // If the frame is fragmented, it will terminate with a fin bit set\n            // and an opcode of 0 (continuation), therefore we handle that when\n            // parsing continuation frames, not here.\n            if (!this.#info.fragmented && this.#info.fin) {\n              websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n            }\n\n            this.#state = parserStates.INFO\n          } else {\n            this.#extensions.get('permessage-deflate').decompress(\n              body,\n              this.#info.fin,\n              (error, data) => {\n                if (error) {\n                  const code = error instanceof MessageSizeExceededError ? 1009 : 1007\n                  failWebsocketConnectionWithCode(this.ws, code, error.message)\n                  return\n                }\n\n                if (!this.writeFragments(data)) {\n                  return\n                }\n\n                if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n                  failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n                  return\n                }\n\n                if (!this.#info.fin) {\n                  this.#state = parserStates.INFO\n                  this.#loop = true\n                  this.run(callback)\n                  return\n                }\n\n                websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n\n                this.#loop = true\n                this.#state = parserStates.INFO\n                this.run(callback)\n              }\n            )\n\n            this.#loop = false\n            break\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * Take n bytes from the buffered Buffers\n   * @param {number} n\n   * @returns {Buffer}\n   */\n  consume (n) {\n    if (n > this.#byteOffset) {\n      throw new Error('Called consume() before buffers satiated.')\n    } else if (n === 0) {\n      return emptyBuffer\n    }\n\n    if (this.#buffers[0].length === n) {\n      this.#byteOffset -= this.#buffers[0].length\n      return this.#buffers.shift()\n    }\n\n    const buffer = Buffer.allocUnsafe(n)\n    let offset = 0\n\n    while (offset !== n) {\n      const next = this.#buffers[0]\n      const { length } = next\n\n      if (length + offset === n) {\n        buffer.set(this.#buffers.shift(), offset)\n        break\n      } else if (length + offset > n) {\n        buffer.set(next.subarray(0, n - offset), offset)\n        this.#buffers[0] = next.subarray(n - offset)\n        break\n      } else {\n        buffer.set(this.#buffers.shift(), offset)\n        offset += next.length\n      }\n    }\n\n    this.#byteOffset -= n\n\n    return buffer\n  }\n\n  writeFragments (fragment) {\n    if (\n      this.#maxFragments > 0 &&\n      this.#fragments.length === this.#maxFragments\n    ) {\n      failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments')\n      return false\n    }\n\n    this.#fragmentsBytes += fragment.length\n    this.#fragments.push(fragment)\n    return true\n  }\n\n  consumeFragments () {\n    const fragments = this.#fragments\n\n    if (fragments.length === 1) {\n      this.#fragmentsBytes = 0\n      return fragments.shift()\n    }\n\n    const output = Buffer.concat(fragments, this.#fragmentsBytes)\n    this.#fragments = []\n    this.#fragmentsBytes = 0\n\n    return output\n  }\n\n  parseCloseBody (data) {\n    assert(data.length !== 1)\n\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n    /** @type {number|undefined} */\n    let code\n\n    if (data.length >= 2) {\n      // _The WebSocket Connection Close Code_ is\n      // defined as the status code (Section 7.4) contained in the first Close\n      // control frame received by the application\n      code = data.readUInt16BE(0)\n    }\n\n    if (code !== undefined && !isValidStatusCode(code)) {\n      return { code: 1002, reason: 'Invalid status code', error: true }\n    }\n\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6\n    /** @type {Buffer} */\n    let reason = data.subarray(2)\n\n    // Remove BOM\n    if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {\n      reason = reason.subarray(3)\n    }\n\n    try {\n      reason = utf8Decode(reason)\n    } catch {\n      return { code: 1007, reason: 'Invalid UTF-8', error: true }\n    }\n\n    return { code, reason, error: false }\n  }\n\n  /**\n   * Parses control frames.\n   * @param {Buffer} body\n   */\n  parseControlFrame (body) {\n    const { opcode, payloadLength } = this.#info\n\n    if (opcode === opcodes.CLOSE) {\n      if (payloadLength === 1) {\n        failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')\n        return false\n      }\n\n      this.#info.closeInfo = this.parseCloseBody(body)\n\n      if (this.#info.closeInfo.error) {\n        const { code, reason } = this.#info.closeInfo\n\n        closeWebSocketConnection(this.ws, code, reason, reason.length)\n        failWebsocketConnection(this.ws, reason)\n        return false\n      }\n\n      if (this.ws[kSentClose] !== sentCloseFrameState.SENT) {\n        // If an endpoint receives a Close frame and did not previously send a\n        // Close frame, the endpoint MUST send a Close frame in response.  (When\n        // sending a Close frame in response, the endpoint typically echos the\n        // status code it received.)\n        let body = emptyBuffer\n        if (this.#info.closeInfo.code) {\n          body = Buffer.allocUnsafe(2)\n          body.writeUInt16BE(this.#info.closeInfo.code, 0)\n        }\n        const closeFrame = new WebsocketFrameSend(body)\n\n        this.ws[kResponse].socket.write(\n          closeFrame.createFrame(opcodes.CLOSE),\n          (err) => {\n            if (!err) {\n              this.ws[kSentClose] = sentCloseFrameState.SENT\n            }\n          }\n        )\n      }\n\n      // Upon either sending or receiving a Close control frame, it is said\n      // that _The WebSocket Closing Handshake is Started_ and that the\n      // WebSocket connection is in the CLOSING state.\n      this.ws[kReadyState] = states.CLOSING\n      this.ws[kReceivedClose] = true\n\n      return false\n    } else if (opcode === opcodes.PING) {\n      // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n      // response, unless it already received a Close frame.\n      // A Pong frame sent in response to a Ping frame must have identical\n      // \"Application data\"\n\n      if (!this.ws[kReceivedClose]) {\n        const frame = new WebsocketFrameSend(body)\n\n        this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))\n\n        if (channels.ping.hasSubscribers) {\n          channels.ping.publish({\n            payload: body\n          })\n        }\n      }\n    } else if (opcode === opcodes.PONG) {\n      // A Pong frame MAY be sent unsolicited.  This serves as a\n      // unidirectional heartbeat.  A response to an unsolicited Pong frame is\n      // not expected.\n\n      if (channels.pong.hasSubscribers) {\n        channels.pong.publish({\n          payload: body\n        })\n      }\n    }\n\n    return true\n  }\n\n  get closingInfo () {\n    return this.#info.closeInfo\n  }\n}\n\nmodule.exports = {\n  ByteParser\n}\n","'use strict'\n\nconst { WebsocketFrameSend } = require('./frame')\nconst { opcodes, sendHints } = require('./constants')\nconst FixedQueue = require('../../dispatcher/fixed-queue')\n\n/** @type {typeof Uint8Array} */\nconst FastBuffer = Buffer[Symbol.species]\n\n/**\n * @typedef {object} SendQueueNode\n * @property {Promise | null} promise\n * @property {((...args: any[]) => any)} callback\n * @property {Buffer | null} frame\n */\n\nclass SendQueue {\n  /**\n   * @type {FixedQueue}\n   */\n  #queue = new FixedQueue()\n\n  /**\n   * @type {boolean}\n   */\n  #running = false\n\n  /** @type {import('node:net').Socket} */\n  #socket\n\n  constructor (socket) {\n    this.#socket = socket\n  }\n\n  add (item, cb, hint) {\n    if (hint !== sendHints.blob) {\n      const frame = createFrame(item, hint)\n      if (!this.#running) {\n        // fast-path\n        this.#socket.write(frame, cb)\n      } else {\n        /** @type {SendQueueNode} */\n        const node = {\n          promise: null,\n          callback: cb,\n          frame\n        }\n        this.#queue.push(node)\n      }\n      return\n    }\n\n    /** @type {SendQueueNode} */\n    const node = {\n      promise: item.arrayBuffer().then((ab) => {\n        node.promise = null\n        node.frame = createFrame(ab, hint)\n      }),\n      callback: cb,\n      frame: null\n    }\n\n    this.#queue.push(node)\n\n    if (!this.#running) {\n      this.#run()\n    }\n  }\n\n  async #run () {\n    this.#running = true\n    const queue = this.#queue\n    while (!queue.isEmpty()) {\n      const node = queue.shift()\n      // wait pending promise\n      if (node.promise !== null) {\n        await node.promise\n      }\n      // write\n      this.#socket.write(node.frame, node.callback)\n      // cleanup\n      node.callback = node.frame = null\n    }\n    this.#running = false\n  }\n}\n\nfunction createFrame (data, hint) {\n  return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY)\n}\n\nfunction toBuffer (data, hint) {\n  switch (hint) {\n    case sendHints.string:\n      return Buffer.from(data)\n    case sendHints.arrayBuffer:\n    case sendHints.blob:\n      return new FastBuffer(data)\n    case sendHints.typedArray:\n      return new FastBuffer(data.buffer, data.byteOffset, data.byteLength)\n  }\n}\n\nmodule.exports = { SendQueue }\n","'use strict'\n\nmodule.exports = {\n  kWebSocketURL: Symbol('url'),\n  kReadyState: Symbol('ready state'),\n  kController: Symbol('controller'),\n  kResponse: Symbol('response'),\n  kBinaryType: Symbol('binary type'),\n  kSentClose: Symbol('sent close'),\n  kReceivedClose: Symbol('received close'),\n  kByteParser: Symbol('byte parser')\n}\n","'use strict'\n\nconst { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require('./symbols')\nconst { states, opcodes } = require('./constants')\nconst { ErrorEvent, createFastMessageEvent } = require('./events')\nconst { isUtf8 } = require('node:buffer')\nconst { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require('../fetch/data-url')\n\n/* globals Blob */\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isConnecting (ws) {\n  // If the WebSocket connection is not yet established, and the connection\n  // is not yet closed, then the WebSocket connection is in the CONNECTING state.\n  return ws[kReadyState] === states.CONNECTING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isEstablished (ws) {\n  // If the server's response is validated as provided for above, it is\n  // said that _The WebSocket Connection is Established_ and that the\n  // WebSocket Connection is in the OPEN state.\n  return ws[kReadyState] === states.OPEN\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosing (ws) {\n  // Upon either sending or receiving a Close control frame, it is said\n  // that _The WebSocket Closing Handshake is Started_ and that the\n  // WebSocket connection is in the CLOSING state.\n  return ws[kReadyState] === states.CLOSING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosed (ws) {\n  return ws[kReadyState] === states.CLOSED\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e\n * @param {EventTarget} target\n * @param {(...args: ConstructorParameters) => Event} eventFactory\n * @param {EventInit | undefined} eventInitDict\n */\nfunction fireEvent (e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {\n  // 1. If eventConstructor is not given, then let eventConstructor be Event.\n\n  // 2. Let event be the result of creating an event given eventConstructor,\n  //    in the relevant realm of target.\n  // 3. Initialize event’s type attribute to e.\n  const event = eventFactory(e, eventInitDict)\n\n  // 4. Initialize any other IDL attributes of event as described in the\n  //    invocation of this algorithm.\n\n  // 5. Return the result of dispatching event at target, with legacy target\n  //    override flag set if set.\n  target.dispatchEvent(event)\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @param {import('./websocket').WebSocket} ws\n * @param {number} type Opcode\n * @param {Buffer} data application data\n */\nfunction websocketMessageReceived (ws, type, data) {\n  // 1. If ready state is not OPEN (1), then return.\n  if (ws[kReadyState] !== states.OPEN) {\n    return\n  }\n\n  // 2. Let dataForEvent be determined by switching on type and binary type:\n  let dataForEvent\n\n  if (type === opcodes.TEXT) {\n    // -> type indicates that the data is Text\n    //      a new DOMString containing data\n    try {\n      dataForEvent = utf8Decode(data)\n    } catch {\n      failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')\n      return\n    }\n  } else if (type === opcodes.BINARY) {\n    if (ws[kBinaryType] === 'blob') {\n      // -> type indicates that the data is Binary and binary type is \"blob\"\n      //      a new Blob object, created in the relevant Realm of the WebSocket\n      //      object, that represents data as its raw data\n      dataForEvent = new Blob([data])\n    } else {\n      // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n      //      a new ArrayBuffer object, created in the relevant Realm of the\n      //      WebSocket object, whose contents are data\n      dataForEvent = toArrayBuffer(data)\n    }\n  }\n\n  // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n  //    with the origin attribute initialized to the serialization of the WebSocket\n  //    object’s url's origin, and the data attribute initialized to dataForEvent.\n  fireEvent('message', ws, createFastMessageEvent, {\n    origin: ws[kWebSocketURL].origin,\n    data: dataForEvent\n  })\n}\n\nfunction toArrayBuffer (buffer) {\n  if (buffer.byteLength === buffer.buffer.byteLength) {\n    return buffer.buffer\n  }\n  return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455\n * @see https://datatracker.ietf.org/doc/html/rfc2616\n * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407\n * @param {string} protocol\n */\nfunction isValidSubprotocol (protocol) {\n  // If present, this value indicates one\n  // or more comma-separated subprotocol the client wishes to speak,\n  // ordered by preference.  The elements that comprise this value\n  // MUST be non-empty strings with characters in the range U+0021 to\n  // U+007E not including separator characters as defined in\n  // [RFC2616] and MUST all be unique strings.\n  if (protocol.length === 0) {\n    return false\n  }\n\n  for (let i = 0; i < protocol.length; ++i) {\n    const code = protocol.charCodeAt(i)\n\n    if (\n      code < 0x21 || // CTL, contains SP (0x20) and HT (0x09)\n      code > 0x7E ||\n      code === 0x22 || // \"\n      code === 0x28 || // (\n      code === 0x29 || // )\n      code === 0x2C || // ,\n      code === 0x2F || // /\n      code === 0x3A || // :\n      code === 0x3B || // ;\n      code === 0x3C || // <\n      code === 0x3D || // =\n      code === 0x3E || // >\n      code === 0x3F || // ?\n      code === 0x40 || // @\n      code === 0x5B || // [\n      code === 0x5C || // \\\n      code === 0x5D || // ]\n      code === 0x7B || // {\n      code === 0x7D // }\n    ) {\n      return false\n    }\n  }\n\n  return true\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4\n * @param {number} code\n */\nfunction isValidStatusCode (code) {\n  if (code >= 1000 && code < 1015) {\n    return (\n      code !== 1004 && // reserved\n      code !== 1005 && // \"MUST NOT be set as a status code\"\n      code !== 1006 // \"MUST NOT be set as a status code\"\n    )\n  }\n\n  return code >= 3000 && code <= 4999\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @param {string|undefined} reason\n */\nfunction failWebsocketConnection (ws, reason) {\n  const { [kController]: controller, [kResponse]: response } = ws\n\n  controller.abort()\n\n  if (response?.socket && !response.socket.destroyed) {\n    response.socket.destroy()\n  }\n\n  if (reason) {\n    // TODO: process.nextTick\n    fireEvent('error', ws, (type, init) => new ErrorEvent(type, init), {\n      error: new Error(reason),\n      message: reason\n    })\n  }\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5\n * @param {number} opcode\n */\nfunction isControlFrame (opcode) {\n  return (\n    opcode === opcodes.CLOSE ||\n    opcode === opcodes.PING ||\n    opcode === opcodes.PONG\n  )\n}\n\nfunction isContinuationFrame (opcode) {\n  return opcode === opcodes.CONTINUATION\n}\n\nfunction isTextBinaryFrame (opcode) {\n  return opcode === opcodes.TEXT || opcode === opcodes.BINARY\n}\n\nfunction isValidOpcode (opcode) {\n  return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode)\n}\n\n/**\n * Parses a Sec-WebSocket-Extensions header value.\n * @param {string} extensions\n * @returns {Map}\n */\n// TODO(@Uzlopak, @KhafraDev): make compliant https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\nfunction parseExtensions (extensions) {\n  const position = { position: 0 }\n  const extensionList = new Map()\n\n  while (position.position < extensions.length) {\n    const pair = collectASequenceOfCodePointsFast(';', extensions, position)\n    const [name, value = ''] = pair.split('=')\n\n    extensionList.set(\n      removeHTTPWhitespace(name, true, false),\n      removeHTTPWhitespace(value, false, true)\n    )\n\n    position.position++\n  }\n\n  return extensionList\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2\n * @description \"client-max-window-bits = 1*DIGIT\"\n * @param {string} value\n */\nfunction isValidClientWindowBits (value) {\n  // Must have at least one character\n  if (value.length === 0) {\n    return false\n  }\n\n  // Check all characters are ASCII digits\n  for (let i = 0; i < value.length; i++) {\n    const byte = value.charCodeAt(i)\n\n    if (byte < 0x30 || byte > 0x39) {\n      return false\n    }\n  }\n\n  // Check numeric range: zlib requires windowBits in range 8-15\n  const num = Number.parseInt(value, 10)\n  return num >= 8 && num <= 15\n}\n\n// https://nodejs.org/api/intl.html#detecting-internationalization-support\nconst hasIntl = typeof process.versions.icu === 'string'\nconst fatalDecoder = hasIntl ? new TextDecoder('utf-8', { fatal: true }) : undefined\n\n/**\n * Converts a Buffer to utf-8, even on platforms without icu.\n * @param {Buffer} buffer\n */\nconst utf8Decode = hasIntl\n  ? fatalDecoder.decode.bind(fatalDecoder)\n  : function (buffer) {\n    if (isUtf8(buffer)) {\n      return buffer.toString('utf-8')\n    }\n    throw new TypeError('Invalid utf-8 received.')\n  }\n\nmodule.exports = {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isClosed,\n  fireEvent,\n  isValidSubprotocol,\n  isValidStatusCode,\n  failWebsocketConnection,\n  websocketMessageReceived,\n  utf8Decode,\n  isControlFrame,\n  isContinuationFrame,\n  isTextBinaryFrame,\n  isValidOpcode,\n  parseExtensions,\n  isValidClientWindowBits\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { environmentSettingsObject } = require('../fetch/util')\nconst { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require('./constants')\nconst {\n  kWebSocketURL,\n  kReadyState,\n  kController,\n  kBinaryType,\n  kResponse,\n  kSentClose,\n  kByteParser\n} = require('./symbols')\nconst {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isValidSubprotocol,\n  fireEvent\n} = require('./util')\nconst { establishWebSocketConnection, closeWebSocketConnection } = require('./connection')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty, isBlobLike } = require('../../core/util')\nconst { getGlobalDispatcher } = require('../../global')\nconst { types } = require('node:util')\nconst { ErrorEvent, CloseEvent } = require('./events')\nconst { SendQueue } = require('./sender')\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    close: null,\n    message: null\n  }\n\n  #bufferedAmount = 0\n  #protocol = ''\n  #extensions = ''\n\n  /** @type {SendQueue} */\n  #sendQueue\n\n  /**\n   * @param {string} url\n   * @param {string|string[]} protocols\n   */\n  constructor (url, protocols = []) {\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'WebSocket constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols, prefix, 'options')\n\n    url = webidl.converters.USVString(url, prefix, 'url')\n    protocols = options.protocols\n\n    // 1. Let baseURL be this's relevant settings object's API base URL.\n    const baseURL = environmentSettingsObject.settingsObject.baseUrl\n\n    // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.\n    let urlRecord\n\n    try {\n      urlRecord = new URL(url, baseURL)\n    } catch (e) {\n      // 3. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n      throw new DOMException(e, 'SyntaxError')\n    }\n\n    // 4. If urlRecord’s scheme is \"http\", then set urlRecord’s scheme to \"ws\".\n    if (urlRecord.protocol === 'http:') {\n      urlRecord.protocol = 'ws:'\n    } else if (urlRecord.protocol === 'https:') {\n      // 5. Otherwise, if urlRecord’s scheme is \"https\", set urlRecord’s scheme to \"wss\".\n      urlRecord.protocol = 'wss:'\n    }\n\n    // 6. If urlRecord’s scheme is not \"ws\" or \"wss\", then throw a \"SyntaxError\" DOMException.\n    if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {\n      throw new DOMException(\n        `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,\n        'SyntaxError'\n      )\n    }\n\n    // 7. If urlRecord’s fragment is non-null, then throw a \"SyntaxError\"\n    //    DOMException.\n    if (urlRecord.hash || urlRecord.href.endsWith('#')) {\n      throw new DOMException('Got fragment', 'SyntaxError')\n    }\n\n    // 8. If protocols is a string, set protocols to a sequence consisting\n    //    of just that string.\n    if (typeof protocols === 'string') {\n      protocols = [protocols]\n    }\n\n    // 9. If any of the values in protocols occur more than once or otherwise\n    //    fail to match the requirements for elements that comprise the value\n    //    of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n    //    protocol, then throw a \"SyntaxError\" DOMException.\n    if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    // 10. Set this's url to urlRecord.\n    this[kWebSocketURL] = new URL(urlRecord.href)\n\n    // 11. Let client be this's relevant settings object.\n    const client = environmentSettingsObject.settingsObject\n\n    // 12. Run this step in parallel:\n\n    //    1. Establish a WebSocket connection given urlRecord, protocols,\n    //       and client.\n    this[kController] = establishWebSocketConnection(\n      urlRecord,\n      protocols,\n      client,\n      this,\n      (response, extensions) => this.#onConnectionEstablished(response, extensions),\n      options\n    )\n\n    // Each WebSocket object has an associated ready state, which is a\n    // number representing the state of the connection. Initially it must\n    // be CONNECTING (0).\n    this[kReadyState] = WebSocket.CONNECTING\n\n    this[kSentClose] = sentCloseFrameState.NOT_SENT\n\n    // The extensions attribute must initially return the empty string.\n\n    // The protocol attribute must initially return the empty string.\n\n    // Each WebSocket object has an associated binary type, which is a\n    // BinaryType. Initially it must be \"blob\".\n    this[kBinaryType] = 'blob'\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n   * @param {number|undefined} code\n   * @param {string|undefined} reason\n   */\n  close (code = undefined, reason = undefined) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.close'\n\n    if (code !== undefined) {\n      code = webidl.converters['unsigned short'](code, prefix, 'code', { clamp: true })\n    }\n\n    if (reason !== undefined) {\n      reason = webidl.converters.USVString(reason, prefix, 'reason')\n    }\n\n    // 1. If code is present, but is neither an integer equal to 1000 nor an\n    //    integer in the range 3000 to 4999, inclusive, throw an\n    //    \"InvalidAccessError\" DOMException.\n    if (code !== undefined) {\n      if (code !== 1000 && (code < 3000 || code > 4999)) {\n        throw new DOMException('invalid code', 'InvalidAccessError')\n      }\n    }\n\n    let reasonByteLength = 0\n\n    // 2. If reason is present, then run these substeps:\n    if (reason !== undefined) {\n      // 1. Let reasonBytes be the result of encoding reason.\n      // 2. If reasonBytes is longer than 123 bytes, then throw a\n      //    \"SyntaxError\" DOMException.\n      reasonByteLength = Buffer.byteLength(reason)\n\n      if (reasonByteLength > 123) {\n        throw new DOMException(\n          `Reason must be less than 123 bytes; received ${reasonByteLength}`,\n          'SyntaxError'\n        )\n      }\n    }\n\n    // 3. Run the first matching steps from the following list:\n    closeWebSocketConnection(this, code, reason, reasonByteLength)\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n   * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n   */\n  send (data) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.send'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    data = webidl.converters.WebSocketSendData(data, prefix, 'data')\n\n    // 1. If this's ready state is CONNECTING, then throw an\n    //    \"InvalidStateError\" DOMException.\n    if (isConnecting(this)) {\n      throw new DOMException('Sent before connected.', 'InvalidStateError')\n    }\n\n    // 2. Run the appropriate set of steps from the following list:\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n    if (!isEstablished(this) || isClosing(this)) {\n      return\n    }\n\n    // If data is a string\n    if (typeof data === 'string') {\n      // If the WebSocket connection is established and the WebSocket\n      // closing handshake has not yet started, then the user agent\n      // must send a WebSocket Message comprised of the data argument\n      // using a text frame opcode; if the data cannot be sent, e.g.\n      // because it would need to be buffered but the buffer is full,\n      // the user agent must flag the WebSocket as full and then close\n      // the WebSocket connection. Any invocation of this method with a\n      // string argument that does not throw an exception must increase\n      // the bufferedAmount attribute by the number of bytes needed to\n      // express the argument as UTF-8.\n\n      const length = Buffer.byteLength(data)\n\n      this.#bufferedAmount += length\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= length\n      }, sendHints.string)\n    } else if (types.isArrayBuffer(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need\n      // to be buffered but the buffer is full, the user agent must flag\n      // the WebSocket as full and then close the WebSocket connection.\n      // The data to be sent is the data stored in the buffer described\n      // by the ArrayBuffer object. Any invocation of this method with an\n      // ArrayBuffer argument that does not throw an exception must\n      // increase the bufferedAmount attribute by the length of the\n      // ArrayBuffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.arrayBuffer)\n    } else if (ArrayBuffer.isView(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The\n      // data to be sent is the data stored in the section of the buffer\n      // described by the ArrayBuffer object that data references. Any\n      // invocation of this method with this kind of argument that does\n      // not throw an exception must increase the bufferedAmount attribute\n      // by the length of data’s buffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.typedArray)\n    } else if (isBlobLike(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The data\n      // to be sent is the raw data represented by the Blob object. Any\n      // invocation of this method with a Blob argument that does not throw\n      // an exception must increase the bufferedAmount attribute by the size\n      // of the Blob object’s raw data, in bytes.\n\n      this.#bufferedAmount += data.size\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.size\n      }, sendHints.blob)\n    }\n  }\n\n  get readyState () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The readyState getter steps are to return this's ready state.\n    return this[kReadyState]\n  }\n\n  get bufferedAmount () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#bufferedAmount\n  }\n\n  get url () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The url getter steps are to return this's url, serialized.\n    return URLSerializer(this[kWebSocketURL])\n  }\n\n  get extensions () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#extensions\n  }\n\n  get protocol () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#protocol\n  }\n\n  get onopen () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.open = fn\n      this.addEventListener('open', fn)\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this.#events.error = null\n    }\n  }\n\n  get onclose () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.close\n  }\n\n  set onclose (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.close) {\n      this.removeEventListener('close', this.#events.close)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.close = fn\n      this.addEventListener('close', fn)\n    } else {\n      this.#events.close = null\n    }\n  }\n\n  get onmessage () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.message = fn\n      this.addEventListener('message', fn)\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get binaryType () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this[kBinaryType]\n  }\n\n  set binaryType (type) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (type !== 'blob' && type !== 'arraybuffer') {\n      this[kBinaryType] = 'blob'\n    } else {\n      this[kBinaryType] = type\n    }\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n   */\n  #onConnectionEstablished (response, parsedExtensions) {\n    // processResponse is called when the \"response's header list has been received and initialized.\"\n    // once this happens, the connection is open\n    this[kResponse] = response\n\n    const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions\n    const maxFragments = webSocketOptions?.maxFragments\n    const maxPayloadSize = webSocketOptions?.maxPayloadSize\n\n    const parser = new ByteParser(this, parsedExtensions, {\n      maxFragments,\n      maxPayloadSize\n    })\n    parser.on('drain', onParserDrain)\n    parser.on('error', onParserError.bind(this))\n\n    response.socket.ws = this\n    this[kByteParser] = parser\n\n    this.#sendQueue = new SendQueue(response.socket)\n\n    // 1. Change the ready state to OPEN (1).\n    this[kReadyState] = states.OPEN\n\n    // 2. Change the extensions attribute’s value to the extensions in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n    const extensions = response.headersList.get('sec-websocket-extensions')\n\n    if (extensions !== null) {\n      this.#extensions = extensions\n    }\n\n    // 3. Change the protocol attribute’s value to the subprotocol in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n    const protocol = response.headersList.get('sec-websocket-protocol')\n\n    if (protocol !== null) {\n      this.#protocol = protocol\n    }\n\n    // 4. Fire an event named open at the WebSocket object.\n    fireEvent('open', this)\n  }\n}\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors,\n  url: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  bufferedAmount: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onclose: kEnumerableProperty,\n  close: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  binaryType: kEnumerableProperty,\n  send: kEnumerableProperty,\n  extensions: kEnumerableProperty,\n  protocol: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'WebSocket',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(WebSocket, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence'] = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {\n    return webidl.converters['sequence'](V)\n  }\n\n  return webidl.converters.DOMString(V, prefix, argument)\n}\n\n// This implements the proposal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n  {\n    key: 'protocols',\n    converter: webidl.converters['DOMString or sequence'],\n    defaultValue: () => new Array(0)\n  },\n  {\n    key: 'dispatcher',\n    converter: webidl.converters.any,\n    defaultValue: () => getGlobalDispatcher()\n  },\n  {\n    key: 'headers',\n    converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n  }\n])\n\nwebidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {\n  if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {\n    return webidl.converters.WebSocketInit(V)\n  }\n\n  return { protocols: webidl.converters['DOMString or sequence'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n  if (webidl.util.Type(V) === 'Object') {\n    if (isBlobLike(V)) {\n      return webidl.converters.Blob(V, { strict: false })\n    }\n\n    if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n      return webidl.converters.BufferSource(V)\n    }\n  }\n\n  return webidl.converters.USVString(V)\n}\n\nfunction onParserDrain () {\n  this.ws[kResponse].socket.resume()\n}\n\nfunction onParserError (err) {\n  let message\n  let code\n\n  if (err instanceof CloseEvent) {\n    message = err.reason\n    code = err.code\n  } else {\n    message = err.message\n  }\n\n  fireEvent('error', this, () => new ErrorEvent('error', { error: err, message }))\n\n  closeWebSocketConnection(this, code)\n}\n\nmodule.exports = {\n  WebSocket\n}\n","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"https\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:async_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:buffer\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:console\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:crypto\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:diagnostics_channel\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:dns\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs/promises\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http2\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:path\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:perf_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:querystring\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:url\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util/types\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:worker_threads\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:zlib\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"string_decoder\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\\/\\/\\/\\w:/) ? 1 : 0, -1) + \"/\";","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"os\");","// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nexport function toCommandValue(input) {\n    if (input === null || input === undefined) {\n        return '';\n    }\n    else if (typeof input === 'string' || input instanceof String) {\n        return input;\n    }\n    return JSON.stringify(input);\n}\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nexport function toCommandProperties(annotationProperties) {\n    if (!Object.keys(annotationProperties).length) {\n        return {};\n    }\n    return {\n        title: annotationProperties.title,\n        file: annotationProperties.file,\n        line: annotationProperties.startLine,\n        endLine: annotationProperties.endLine,\n        col: annotationProperties.startColumn,\n        endColumn: annotationProperties.endColumn\n    };\n}\n//# sourceMappingURL=utils.js.map","import * as os from 'os';\nimport { toCommandValue } from './utils.js';\n/**\n * Issues a command to the GitHub Actions runner\n *\n * @param command - The command name to issue\n * @param properties - Additional properties for the command (key-value pairs)\n * @param message - The message to include with the command\n * @remarks\n * This function outputs a specially formatted string to stdout that the Actions\n * runner interprets as a command. These commands can control workflow behavior,\n * set outputs, create annotations, mask values, and more.\n *\n * Command Format:\n *   ::name key=value,key=value::message\n *\n * @example\n * ```typescript\n * // Issue a warning annotation\n * issueCommand('warning', {}, 'This is a warning message');\n * // Output: ::warning::This is a warning message\n *\n * // Set an environment variable\n * issueCommand('set-env', { name: 'MY_VAR' }, 'some value');\n * // Output: ::set-env name=MY_VAR::some value\n *\n * // Add a secret mask\n * issueCommand('add-mask', {}, 'secretValue123');\n * // Output: ::add-mask::secretValue123\n * ```\n *\n * @internal\n * This is an internal utility function that powers the public API functions\n * such as setSecret, warning, error, and exportVariable.\n */\nexport function issueCommand(command, properties, message) {\n    const cmd = new Command(command, properties, message);\n    process.stdout.write(cmd.toString() + os.EOL);\n}\nexport function issue(name, message = '') {\n    issueCommand(name, {}, message);\n}\nconst CMD_STRING = '::';\nclass Command {\n    constructor(command, properties, message) {\n        if (!command) {\n            command = 'missing.command';\n        }\n        this.command = command;\n        this.properties = properties;\n        this.message = message;\n    }\n    toString() {\n        let cmdStr = CMD_STRING + this.command;\n        if (this.properties && Object.keys(this.properties).length > 0) {\n            cmdStr += ' ';\n            let first = true;\n            for (const key in this.properties) {\n                if (this.properties.hasOwnProperty(key)) {\n                    const val = this.properties[key];\n                    if (val) {\n                        if (first) {\n                            first = false;\n                        }\n                        else {\n                            cmdStr += ',';\n                        }\n                        cmdStr += `${key}=${escapeProperty(val)}`;\n                    }\n                }\n            }\n        }\n        cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n        return cmdStr;\n    }\n}\nfunction escapeData(s) {\n    return toCommandValue(s)\n        .replace(/%/g, '%25')\n        .replace(/\\r/g, '%0D')\n        .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n    return toCommandValue(s)\n        .replace(/%/g, '%25')\n        .replace(/\\r/g, '%0D')\n        .replace(/\\n/g, '%0A')\n        .replace(/:/g, '%3A')\n        .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"crypto\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"fs\");","// For internal use, subject to change.\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as crypto from 'crypto';\nimport * as fs from 'fs';\nimport * as os from 'os';\nimport { toCommandValue } from './utils.js';\nexport function issueFileCommand(command, message) {\n    const filePath = process.env[`GITHUB_${command}`];\n    if (!filePath) {\n        throw new Error(`Unable to find environment variable for file command ${command}`);\n    }\n    if (!fs.existsSync(filePath)) {\n        throw new Error(`Missing file at path: ${filePath}`);\n    }\n    fs.appendFileSync(filePath, `${toCommandValue(message)}${os.EOL}`, {\n        encoding: 'utf8'\n    });\n}\nexport function prepareKeyValueMessage(key, value) {\n    const delimiter = `ghadelimiter_${crypto.randomUUID()}`;\n    const convertedValue = toCommandValue(value);\n    // These should realistically never happen, but just in case someone finds a\n    // way to exploit uuid generation let's not allow keys or values that contain\n    // the delimiter.\n    if (key.includes(delimiter)) {\n        throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n    }\n    if (convertedValue.includes(delimiter)) {\n        throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n    }\n    return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\n//# sourceMappingURL=file-command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"path\");","export function getProxyUrl(reqUrl) {\n    const usingSsl = reqUrl.protocol === 'https:';\n    if (checkBypass(reqUrl)) {\n        return undefined;\n    }\n    const proxyVar = (() => {\n        if (usingSsl) {\n            return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n        }\n        else {\n            return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n        }\n    })();\n    if (proxyVar) {\n        try {\n            return new DecodedURL(proxyVar);\n        }\n        catch (_a) {\n            if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))\n                return new DecodedURL(`http://${proxyVar}`);\n        }\n    }\n    else {\n        return undefined;\n    }\n}\nexport function checkBypass(reqUrl) {\n    if (!reqUrl.hostname) {\n        return false;\n    }\n    const reqHost = reqUrl.hostname;\n    if (isLoopbackAddress(reqHost)) {\n        return true;\n    }\n    const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n    if (!noProxy) {\n        return false;\n    }\n    // Determine the request port\n    let reqPort;\n    if (reqUrl.port) {\n        reqPort = Number(reqUrl.port);\n    }\n    else if (reqUrl.protocol === 'http:') {\n        reqPort = 80;\n    }\n    else if (reqUrl.protocol === 'https:') {\n        reqPort = 443;\n    }\n    // Format the request hostname and hostname with port\n    const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n    if (typeof reqPort === 'number') {\n        upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n    }\n    // Compare request host against noproxy\n    for (const upperNoProxyItem of noProxy\n        .split(',')\n        .map(x => x.trim().toUpperCase())\n        .filter(x => x)) {\n        if (upperNoProxyItem === '*' ||\n            upperReqHosts.some(x => x === upperNoProxyItem ||\n                x.endsWith(`.${upperNoProxyItem}`) ||\n                (upperNoProxyItem.startsWith('.') &&\n                    x.endsWith(`${upperNoProxyItem}`)))) {\n            return true;\n        }\n    }\n    return false;\n}\nfunction isLoopbackAddress(host) {\n    const hostLower = host.toLowerCase();\n    return (hostLower === 'localhost' ||\n        hostLower.startsWith('127.') ||\n        hostLower.startsWith('[::1]') ||\n        hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\nclass DecodedURL extends URL {\n    constructor(url, base) {\n        super(url, base);\n        this._decodedUsername = decodeURIComponent(super.username);\n        this._decodedPassword = decodeURIComponent(super.password);\n    }\n    get username() {\n        return this._decodedUsername;\n    }\n    get password() {\n        return this._decodedPassword;\n    }\n}\n//# sourceMappingURL=proxy.js.map","/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as pm from './proxy.js';\nimport * as tunnel from 'tunnel';\nimport { ProxyAgent } from 'undici';\nexport var HttpCodes;\n(function (HttpCodes) {\n    HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n    HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n    HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n    HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n    HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n    HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n    HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n    HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n    HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n    HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n    HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n    HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n    HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n    HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n    HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n    HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n    HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n    HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n    HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n    HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n    HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n    HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n    HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n    HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n    HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n    HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n    HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes || (HttpCodes = {}));\nexport var Headers;\n(function (Headers) {\n    Headers[\"Accept\"] = \"accept\";\n    Headers[\"ContentType\"] = \"content-type\";\n})(Headers || (Headers = {}));\nexport var MediaTypes;\n(function (MediaTypes) {\n    MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes || (MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl  The server URL where the request will be sent. For example, https://api.github.com\n */\nexport function getProxyUrl(serverUrl) {\n    const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n    return proxyUrl ? proxyUrl.href : '';\n}\nconst HttpRedirectCodes = [\n    HttpCodes.MovedPermanently,\n    HttpCodes.ResourceMoved,\n    HttpCodes.SeeOther,\n    HttpCodes.TemporaryRedirect,\n    HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n    HttpCodes.BadGateway,\n    HttpCodes.ServiceUnavailable,\n    HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nexport class HttpClientError extends Error {\n    constructor(message, statusCode) {\n        super(message);\n        this.name = 'HttpClientError';\n        this.statusCode = statusCode;\n        Object.setPrototypeOf(this, HttpClientError.prototype);\n    }\n}\nexport class HttpClientResponse {\n    constructor(message) {\n        this.message = message;\n    }\n    readBody() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n                let output = Buffer.alloc(0);\n                this.message.on('data', (chunk) => {\n                    output = Buffer.concat([output, chunk]);\n                });\n                this.message.on('end', () => {\n                    resolve(output.toString());\n                });\n            }));\n        });\n    }\n    readBodyBuffer() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n                const chunks = [];\n                this.message.on('data', (chunk) => {\n                    chunks.push(chunk);\n                });\n                this.message.on('end', () => {\n                    resolve(Buffer.concat(chunks));\n                });\n            }));\n        });\n    }\n}\nexport function isHttps(requestUrl) {\n    const parsedUrl = new URL(requestUrl);\n    return parsedUrl.protocol === 'https:';\n}\nexport class HttpClient {\n    constructor(userAgent, handlers, requestOptions) {\n        this._ignoreSslError = false;\n        this._allowRedirects = true;\n        this._allowRedirectDowngrade = false;\n        this._maxRedirects = 50;\n        this._allowRetries = false;\n        this._maxRetries = 1;\n        this._keepAlive = false;\n        this._disposed = false;\n        this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);\n        this.handlers = handlers || [];\n        this.requestOptions = requestOptions;\n        if (requestOptions) {\n            if (requestOptions.ignoreSslError != null) {\n                this._ignoreSslError = requestOptions.ignoreSslError;\n            }\n            this._socketTimeout = requestOptions.socketTimeout;\n            if (requestOptions.allowRedirects != null) {\n                this._allowRedirects = requestOptions.allowRedirects;\n            }\n            if (requestOptions.allowRedirectDowngrade != null) {\n                this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n            }\n            if (requestOptions.maxRedirects != null) {\n                this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n            }\n            if (requestOptions.keepAlive != null) {\n                this._keepAlive = requestOptions.keepAlive;\n            }\n            if (requestOptions.allowRetries != null) {\n                this._allowRetries = requestOptions.allowRetries;\n            }\n            if (requestOptions.maxRetries != null) {\n                this._maxRetries = requestOptions.maxRetries;\n            }\n        }\n    }\n    options(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    get(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('GET', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    del(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    post(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('POST', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    patch(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    put(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('PUT', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    head(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    sendStream(verb, requestUrl, stream, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request(verb, requestUrl, stream, additionalHeaders);\n        });\n    }\n    /**\n     * Gets a typed object from an endpoint\n     * Be aware that not found returns a null.  Other errors (4xx, 5xx) reject the promise\n     */\n    getJson(requestUrl_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            const res = yield this.get(requestUrl, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    postJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.post(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    putJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.put(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    patchJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.patch(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    /**\n     * Makes a raw http request.\n     * All other methods such as get, post, patch, and request ultimately call this.\n     * Prefer get, del, post and patch\n     */\n    request(verb, requestUrl, data, headers) {\n        return __awaiter(this, void 0, void 0, function* () {\n            if (this._disposed) {\n                throw new Error('Client has already been disposed.');\n            }\n            const parsedUrl = new URL(requestUrl);\n            let info = this._prepareRequest(verb, parsedUrl, headers);\n            // Only perform retries on reads since writes may not be idempotent.\n            const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n                ? this._maxRetries + 1\n                : 1;\n            let numTries = 0;\n            let response;\n            do {\n                response = yield this.requestRaw(info, data);\n                // Check if it's an authentication challenge\n                if (response &&\n                    response.message &&\n                    response.message.statusCode === HttpCodes.Unauthorized) {\n                    let authenticationHandler;\n                    for (const handler of this.handlers) {\n                        if (handler.canHandleAuthentication(response)) {\n                            authenticationHandler = handler;\n                            break;\n                        }\n                    }\n                    if (authenticationHandler) {\n                        return authenticationHandler.handleAuthentication(this, info, data);\n                    }\n                    else {\n                        // We have received an unauthorized response but have no handlers to handle it.\n                        // Let the response return to the caller.\n                        return response;\n                    }\n                }\n                let redirectsRemaining = this._maxRedirects;\n                while (response.message.statusCode &&\n                    HttpRedirectCodes.includes(response.message.statusCode) &&\n                    this._allowRedirects &&\n                    redirectsRemaining > 0) {\n                    const redirectUrl = response.message.headers['location'];\n                    if (!redirectUrl) {\n                        // if there's no location to redirect to, we won't\n                        break;\n                    }\n                    const parsedRedirectUrl = new URL(redirectUrl);\n                    if (parsedUrl.protocol === 'https:' &&\n                        parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n                        !this._allowRedirectDowngrade) {\n                        throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n                    }\n                    // we need to finish reading the response before reassigning response\n                    // which will leak the open socket.\n                    yield response.readBody();\n                    // strip authorization header if redirected to a different hostname\n                    if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n                        for (const header in headers) {\n                            // header names are case insensitive\n                            if (header.toLowerCase() === 'authorization') {\n                                delete headers[header];\n                            }\n                        }\n                    }\n                    // let's make the request with the new redirectUrl\n                    info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n                    response = yield this.requestRaw(info, data);\n                    redirectsRemaining--;\n                }\n                if (!response.message.statusCode ||\n                    !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n                    // If not a retry code, return immediately instead of retrying\n                    return response;\n                }\n                numTries += 1;\n                if (numTries < maxTries) {\n                    yield response.readBody();\n                    yield this._performExponentialBackoff(numTries);\n                }\n            } while (numTries < maxTries);\n            return response;\n        });\n    }\n    /**\n     * Needs to be called if keepAlive is set to true in request options.\n     */\n    dispose() {\n        if (this._agent) {\n            this._agent.destroy();\n        }\n        this._disposed = true;\n    }\n    /**\n     * Raw request.\n     * @param info\n     * @param data\n     */\n    requestRaw(info, data) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve, reject) => {\n                function callbackForResult(err, res) {\n                    if (err) {\n                        reject(err);\n                    }\n                    else if (!res) {\n                        // If `err` is not passed, then `res` must be passed.\n                        reject(new Error('Unknown error'));\n                    }\n                    else {\n                        resolve(res);\n                    }\n                }\n                this.requestRawWithCallback(info, data, callbackForResult);\n            });\n        });\n    }\n    /**\n     * Raw request with callback.\n     * @param info\n     * @param data\n     * @param onResult\n     */\n    requestRawWithCallback(info, data, onResult) {\n        if (typeof data === 'string') {\n            if (!info.options.headers) {\n                info.options.headers = {};\n            }\n            info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n        }\n        let callbackCalled = false;\n        function handleResult(err, res) {\n            if (!callbackCalled) {\n                callbackCalled = true;\n                onResult(err, res);\n            }\n        }\n        const req = info.httpModule.request(info.options, (msg) => {\n            const res = new HttpClientResponse(msg);\n            handleResult(undefined, res);\n        });\n        let socket;\n        req.on('socket', sock => {\n            socket = sock;\n        });\n        // If we ever get disconnected, we want the socket to timeout eventually\n        req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n            if (socket) {\n                socket.end();\n            }\n            handleResult(new Error(`Request timeout: ${info.options.path}`));\n        });\n        req.on('error', function (err) {\n            // err has statusCode property\n            // res should have headers\n            handleResult(err);\n        });\n        if (data && typeof data === 'string') {\n            req.write(data, 'utf8');\n        }\n        if (data && typeof data !== 'string') {\n            data.on('close', function () {\n                req.end();\n            });\n            data.pipe(req);\n        }\n        else {\n            req.end();\n        }\n    }\n    /**\n     * Gets an http agent. This function is useful when you need an http agent that handles\n     * routing through a proxy server - depending upon the url and proxy environment variables.\n     * @param serverUrl  The server URL where the request will be sent. For example, https://api.github.com\n     */\n    getAgent(serverUrl) {\n        const parsedUrl = new URL(serverUrl);\n        return this._getAgent(parsedUrl);\n    }\n    getAgentDispatcher(serverUrl) {\n        const parsedUrl = new URL(serverUrl);\n        const proxyUrl = pm.getProxyUrl(parsedUrl);\n        const useProxy = proxyUrl && proxyUrl.hostname;\n        if (!useProxy) {\n            return;\n        }\n        return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);\n    }\n    _prepareRequest(method, requestUrl, headers) {\n        const info = {};\n        info.parsedUrl = requestUrl;\n        const usingSsl = info.parsedUrl.protocol === 'https:';\n        info.httpModule = usingSsl ? https : http;\n        const defaultPort = usingSsl ? 443 : 80;\n        info.options = {};\n        info.options.host = info.parsedUrl.hostname;\n        info.options.port = info.parsedUrl.port\n            ? parseInt(info.parsedUrl.port)\n            : defaultPort;\n        info.options.path =\n            (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n        info.options.method = method;\n        info.options.headers = this._mergeHeaders(headers);\n        if (this.userAgent != null) {\n            info.options.headers['user-agent'] = this.userAgent;\n        }\n        info.options.agent = this._getAgent(info.parsedUrl);\n        // gives handlers an opportunity to participate\n        if (this.handlers) {\n            for (const handler of this.handlers) {\n                handler.prepareRequest(info.options);\n            }\n        }\n        return info;\n    }\n    _mergeHeaders(headers) {\n        if (this.requestOptions && this.requestOptions.headers) {\n            return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n        }\n        return lowercaseKeys(headers || {});\n    }\n    /**\n     * Gets an existing header value or returns a default.\n     * Handles converting number header values to strings since HTTP headers must be strings.\n     * Note: This returns string | string[] since some headers can have multiple values.\n     * For headers that must always be a single string (like Content-Type), use the\n     * specialized _getExistingOrDefaultContentTypeHeader method instead.\n     */\n    _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n        let clientHeader;\n        if (this.requestOptions && this.requestOptions.headers) {\n            const headerValue = lowercaseKeys(this.requestOptions.headers)[header];\n            if (headerValue) {\n                clientHeader =\n                    typeof headerValue === 'number' ? headerValue.toString() : headerValue;\n            }\n        }\n        const additionalValue = additionalHeaders[header];\n        if (additionalValue !== undefined) {\n            return typeof additionalValue === 'number'\n                ? additionalValue.toString()\n                : additionalValue;\n        }\n        if (clientHeader !== undefined) {\n            return clientHeader;\n        }\n        return _default;\n    }\n    /**\n     * Specialized version of _getExistingOrDefaultHeader for Content-Type header.\n     * Always returns a single string (not an array) since Content-Type should be a single value.\n     * Converts arrays to comma-separated strings and numbers to strings to ensure type safety.\n     * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers\n     * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).\n     */\n    _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {\n        let clientHeader;\n        if (this.requestOptions && this.requestOptions.headers) {\n            const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];\n            if (headerValue) {\n                if (typeof headerValue === 'number') {\n                    clientHeader = String(headerValue);\n                }\n                else if (Array.isArray(headerValue)) {\n                    clientHeader = headerValue.join(', ');\n                }\n                else {\n                    clientHeader = headerValue;\n                }\n            }\n        }\n        const additionalValue = additionalHeaders[Headers.ContentType];\n        // Return the first non-undefined value, converting numbers or arrays to strings if necessary\n        if (additionalValue !== undefined) {\n            if (typeof additionalValue === 'number') {\n                return String(additionalValue);\n            }\n            else if (Array.isArray(additionalValue)) {\n                return additionalValue.join(', ');\n            }\n            else {\n                return additionalValue;\n            }\n        }\n        if (clientHeader !== undefined) {\n            return clientHeader;\n        }\n        return _default;\n    }\n    _getAgent(parsedUrl) {\n        let agent;\n        const proxyUrl = pm.getProxyUrl(parsedUrl);\n        const useProxy = proxyUrl && proxyUrl.hostname;\n        if (this._keepAlive && useProxy) {\n            agent = this._proxyAgent;\n        }\n        if (!useProxy) {\n            agent = this._agent;\n        }\n        // if agent is already assigned use that agent.\n        if (agent) {\n            return agent;\n        }\n        const usingSsl = parsedUrl.protocol === 'https:';\n        let maxSockets = 100;\n        if (this.requestOptions) {\n            maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n        }\n        // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n        if (proxyUrl && proxyUrl.hostname) {\n            const agentOptions = {\n                maxSockets,\n                keepAlive: this._keepAlive,\n                proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n                    proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n                })), { host: proxyUrl.hostname, port: proxyUrl.port })\n            };\n            let tunnelAgent;\n            const overHttps = proxyUrl.protocol === 'https:';\n            if (usingSsl) {\n                tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n            }\n            else {\n                tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n            }\n            agent = tunnelAgent(agentOptions);\n            this._proxyAgent = agent;\n        }\n        // if tunneling agent isn't assigned create a new agent\n        if (!agent) {\n            const options = { keepAlive: this._keepAlive, maxSockets };\n            agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n            this._agent = agent;\n        }\n        if (usingSsl && this._ignoreSslError) {\n            // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n            // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n            // we have to cast it to any and change it directly\n            agent.options = Object.assign(agent.options || {}, {\n                rejectUnauthorized: false\n            });\n        }\n        return agent;\n    }\n    _getProxyAgentDispatcher(parsedUrl, proxyUrl) {\n        let proxyAgent;\n        if (this._keepAlive) {\n            proxyAgent = this._proxyAgentDispatcher;\n        }\n        // if agent is already assigned use that agent.\n        if (proxyAgent) {\n            return proxyAgent;\n        }\n        const usingSsl = parsedUrl.protocol === 'https:';\n        proxyAgent = new ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {\n            token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`\n        })));\n        this._proxyAgentDispatcher = proxyAgent;\n        if (usingSsl && this._ignoreSslError) {\n            // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n            // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n            // we have to cast it to any and change it directly\n            proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {\n                rejectUnauthorized: false\n            });\n        }\n        return proxyAgent;\n    }\n    _getUserAgentWithOrchestrationId(userAgent) {\n        const baseUserAgent = userAgent || 'actions/http-client';\n        const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];\n        if (orchId) {\n            // Sanitize the orchestration ID to ensure it contains only valid characters\n            // Valid characters: 0-9, a-z, _, -, .\n            const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');\n            return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;\n        }\n        return baseUserAgent;\n    }\n    _performExponentialBackoff(retryNumber) {\n        return __awaiter(this, void 0, void 0, function* () {\n            retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n            const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n            return new Promise(resolve => setTimeout(() => resolve(), ms));\n        });\n    }\n    _processResponse(res, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n                const statusCode = res.message.statusCode || 0;\n                const response = {\n                    statusCode,\n                    result: null,\n                    headers: {}\n                };\n                // not found leads to null obj returned\n                if (statusCode === HttpCodes.NotFound) {\n                    resolve(response);\n                }\n                // get the result from the body\n                function dateTimeDeserializer(key, value) {\n                    if (typeof value === 'string') {\n                        const a = new Date(value);\n                        if (!isNaN(a.valueOf())) {\n                            return a;\n                        }\n                    }\n                    return value;\n                }\n                let obj;\n                let contents;\n                try {\n                    contents = yield res.readBody();\n                    if (contents && contents.length > 0) {\n                        if (options && options.deserializeDates) {\n                            obj = JSON.parse(contents, dateTimeDeserializer);\n                        }\n                        else {\n                            obj = JSON.parse(contents);\n                        }\n                        response.result = obj;\n                    }\n                    response.headers = res.message.headers;\n                }\n                catch (err) {\n                    // Invalid resource (contents not json);  leaving result obj null\n                }\n                // note that 3xx redirects are handled by the http layer.\n                if (statusCode > 299) {\n                    let msg;\n                    // if exception/error in body, attempt to get better error\n                    if (obj && obj.message) {\n                        msg = obj.message;\n                    }\n                    else if (contents && contents.length > 0) {\n                        // it may be the case that the exception is in the body message as string\n                        msg = contents;\n                    }\n                    else {\n                        msg = `Failed request: (${statusCode})`;\n                    }\n                    const err = new HttpClientError(msg, statusCode);\n                    err.result = response.result;\n                    reject(err);\n                }\n                else {\n                    resolve(response);\n                }\n            }));\n        });\n    }\n}\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nexport class BasicCredentialHandler {\n    constructor(username, password) {\n        this.username = username;\n        this.password = password;\n    }\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\nexport class BearerCredentialHandler {\n    constructor(token) {\n        this.token = token;\n    }\n    // currently implements pre-authorization\n    // TODO: support preAuth = false where it hooks on 401\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Bearer ${this.token}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\nexport class PersonalAccessTokenCredentialHandler {\n    constructor(token) {\n        this.token = token;\n    }\n    // currently implements pre-authorization\n    // TODO: support preAuth = false where it hooks on 401\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\n//# sourceMappingURL=auth.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { HttpClient } from '@actions/http-client';\nimport { BearerCredentialHandler } from '@actions/http-client/lib/auth';\nimport { debug, setSecret } from './core.js';\nexport class OidcClient {\n    static createHttpClient(allowRetry = true, maxRetry = 10) {\n        const requestOptions = {\n            allowRetries: allowRetry,\n            maxRetries: maxRetry\n        };\n        return new HttpClient('actions/oidc-client', [new BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n    }\n    static getRequestToken() {\n        const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n        if (!token) {\n            throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n        }\n        return token;\n    }\n    static getIDTokenUrl() {\n        const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n        if (!runtimeUrl) {\n            throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n        }\n        return runtimeUrl;\n    }\n    static getCall(id_token_url) {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a;\n            const httpclient = OidcClient.createHttpClient();\n            const res = yield httpclient\n                .getJson(id_token_url)\n                .catch(error => {\n                throw new Error(`Failed to get ID Token. \\n \n        Error Code : ${error.statusCode}\\n \n        Error Message: ${error.message}`);\n            });\n            const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n            if (!id_token) {\n                throw new Error('Response json body do not have ID Token field');\n            }\n            return id_token;\n        });\n    }\n    static getIDToken(audience) {\n        return __awaiter(this, void 0, void 0, function* () {\n            try {\n                // New ID Token is requested from action service\n                let id_token_url = OidcClient.getIDTokenUrl();\n                if (audience) {\n                    const encodedAudience = encodeURIComponent(audience);\n                    id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n                }\n                debug(`ID token url is ${id_token_url}`);\n                const id_token = yield OidcClient.getCall(id_token_url);\n                setSecret(id_token);\n                return id_token;\n            }\n            catch (error) {\n                throw new Error(`Error message: ${error.message}`);\n            }\n        });\n    }\n}\n//# sourceMappingURL=oidc-utils.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { EOL } from 'os';\nimport { constants, promises } from 'fs';\nconst { access, appendFile, writeFile } = promises;\nexport const SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexport const SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n    constructor() {\n        this._buffer = '';\n    }\n    /**\n     * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n     * Also checks r/w permissions.\n     *\n     * @returns step summary file path\n     */\n    filePath() {\n        return __awaiter(this, void 0, void 0, function* () {\n            if (this._filePath) {\n                return this._filePath;\n            }\n            const pathFromEnv = process.env[SUMMARY_ENV_VAR];\n            if (!pathFromEnv) {\n                throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n            }\n            try {\n                yield access(pathFromEnv, constants.R_OK | constants.W_OK);\n            }\n            catch (_a) {\n                throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n            }\n            this._filePath = pathFromEnv;\n            return this._filePath;\n        });\n    }\n    /**\n     * Wraps content in an HTML tag, adding any HTML attributes\n     *\n     * @param {string} tag HTML tag to wrap\n     * @param {string | null} content content within the tag\n     * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n     *\n     * @returns {string} content wrapped in HTML element\n     */\n    wrap(tag, content, attrs = {}) {\n        const htmlAttrs = Object.entries(attrs)\n            .map(([key, value]) => ` ${key}=\"${value}\"`)\n            .join('');\n        if (!content) {\n            return `<${tag}${htmlAttrs}>`;\n        }\n        return `<${tag}${htmlAttrs}>${content}`;\n    }\n    /**\n     * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n     *\n     * @param {SummaryWriteOptions} [options] (optional) options for write operation\n     *\n     * @returns {Promise} summary instance\n     */\n    write(options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n            const filePath = yield this.filePath();\n            const writeFunc = overwrite ? writeFile : appendFile;\n            yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n            return this.emptyBuffer();\n        });\n    }\n    /**\n     * Clears the summary buffer and wipes the summary file\n     *\n     * @returns {Summary} summary instance\n     */\n    clear() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.emptyBuffer().write({ overwrite: true });\n        });\n    }\n    /**\n     * Returns the current summary buffer as a string\n     *\n     * @returns {string} string of summary buffer\n     */\n    stringify() {\n        return this._buffer;\n    }\n    /**\n     * If the summary buffer is empty\n     *\n     * @returns {boolen} true if the buffer is empty\n     */\n    isEmptyBuffer() {\n        return this._buffer.length === 0;\n    }\n    /**\n     * Resets the summary buffer without writing to summary file\n     *\n     * @returns {Summary} summary instance\n     */\n    emptyBuffer() {\n        this._buffer = '';\n        return this;\n    }\n    /**\n     * Adds raw text to the summary buffer\n     *\n     * @param {string} text content to add\n     * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n     *\n     * @returns {Summary} summary instance\n     */\n    addRaw(text, addEOL = false) {\n        this._buffer += text;\n        return addEOL ? this.addEOL() : this;\n    }\n    /**\n     * Adds the operating system-specific end-of-line marker to the buffer\n     *\n     * @returns {Summary} summary instance\n     */\n    addEOL() {\n        return this.addRaw(EOL);\n    }\n    /**\n     * Adds an HTML codeblock to the summary buffer\n     *\n     * @param {string} code content to render within fenced code block\n     * @param {string} lang (optional) language to syntax highlight code\n     *\n     * @returns {Summary} summary instance\n     */\n    addCodeBlock(code, lang) {\n        const attrs = Object.assign({}, (lang && { lang }));\n        const element = this.wrap('pre', this.wrap('code', code), attrs);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML list to the summary buffer\n     *\n     * @param {string[]} items list of items to render\n     * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n     *\n     * @returns {Summary} summary instance\n     */\n    addList(items, ordered = false) {\n        const tag = ordered ? 'ol' : 'ul';\n        const listItems = items.map(item => this.wrap('li', item)).join('');\n        const element = this.wrap(tag, listItems);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML table to the summary buffer\n     *\n     * @param {SummaryTableCell[]} rows table rows\n     *\n     * @returns {Summary} summary instance\n     */\n    addTable(rows) {\n        const tableBody = rows\n            .map(row => {\n            const cells = row\n                .map(cell => {\n                if (typeof cell === 'string') {\n                    return this.wrap('td', cell);\n                }\n                const { header, data, colspan, rowspan } = cell;\n                const tag = header ? 'th' : 'td';\n                const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n                return this.wrap(tag, data, attrs);\n            })\n                .join('');\n            return this.wrap('tr', cells);\n        })\n            .join('');\n        const element = this.wrap('table', tableBody);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds a collapsable HTML details element to the summary buffer\n     *\n     * @param {string} label text for the closed state\n     * @param {string} content collapsable content\n     *\n     * @returns {Summary} summary instance\n     */\n    addDetails(label, content) {\n        const element = this.wrap('details', this.wrap('summary', label) + content);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML image tag to the summary buffer\n     *\n     * @param {string} src path to the image you to embed\n     * @param {string} alt text description of the image\n     * @param {SummaryImageOptions} options (optional) addition image attributes\n     *\n     * @returns {Summary} summary instance\n     */\n    addImage(src, alt, options) {\n        const { width, height } = options || {};\n        const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n        const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML section heading element\n     *\n     * @param {string} text heading text\n     * @param {number | string} [level=1] (optional) the heading level, default: 1\n     *\n     * @returns {Summary} summary instance\n     */\n    addHeading(text, level) {\n        const tag = `h${level}`;\n        const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n            ? tag\n            : 'h1';\n        const element = this.wrap(allowedTag, text);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexport const markdownSummary = _summary;\nexport const summary = _summary;\n//# sourceMappingURL=summary.js.map","import * as path from 'path';\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nexport function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nexport function toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nexport function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\n//# sourceMappingURL=path-utils.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"child_process\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as fs from 'fs';\nimport * as path from 'path';\nexport const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises;\n// export const {open} = 'fs'\nexport const IS_WINDOWS = process.platform === 'win32';\n/**\n * Custom implementation of readlink to ensure Windows junctions\n * maintain trailing backslash for backward compatibility with Node.js < 24\n *\n * In Node.js 20, Windows junctions (directory symlinks) always returned paths\n * with trailing backslashes. Node.js 24 removed this behavior, which breaks\n * code that relied on this format for path operations.\n *\n * This implementation restores the Node 20 behavior by adding a trailing\n * backslash to all junction results on Windows.\n */\nexport function readlink(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield fs.promises.readlink(fsPath);\n // On Windows, restore Node 20 behavior: add trailing backslash to all results\n // since junctions on Windows are always directory links\n if (IS_WINDOWS && !result.endsWith('\\\\')) {\n return `${result}\\\\`;\n }\n return result;\n });\n}\n// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691\nexport const UV_FS_O_EXLOCK = 0x10000000;\nexport const READONLY = fs.constants.O_RDONLY;\nexport function exists(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n yield stat(fsPath);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n }\n return true;\n });\n}\nexport function isDirectory(fsPath_1) {\n return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) {\n const stats = useStat ? yield stat(fsPath) : yield lstat(fsPath);\n return stats.isDirectory();\n });\n}\n/**\n * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:\n * \\, \\hello, \\\\hello\\share, C:, and C:\\hello (and corresponding alternate separator cases).\n */\nexport function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}\n/**\n * Best effort attempt to determine whether a file exists and is executable.\n * @param filePath file path to check\n * @param extensions additional file extensions to try\n * @return if file exists and is executable, returns the file path. otherwise empty string.\n */\nexport function tryGetExecutablePath(filePath, extensions) {\n return __awaiter(this, void 0, void 0, function* () {\n let stats = undefined;\n try {\n // test file exists\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // on Windows, test for valid extension\n const upperExt = path.extname(filePath).toUpperCase();\n if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {\n return filePath;\n }\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n // try each extension\n const originalFilePath = filePath;\n for (const extension of extensions) {\n filePath = originalFilePath + extension;\n stats = undefined;\n try {\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // preserve the case of the actual file (since an extension was appended)\n try {\n const directory = path.dirname(filePath);\n const upperName = path.basename(filePath).toUpperCase();\n for (const actualName of yield readdir(directory)) {\n if (upperName === actualName.toUpperCase()) {\n filePath = path.join(directory, actualName);\n break;\n }\n }\n }\n catch (err) {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);\n }\n return filePath;\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n }\n return '';\n });\n}\nfunction normalizeSeparators(p) {\n p = p || '';\n if (IS_WINDOWS) {\n // convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // remove redundant slashes\n return p.replace(/\\\\\\\\+/g, '\\\\');\n }\n // remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n// on Mac/Linux, test the execute bit\n// R W X R W X R W X\n// 256 128 64 32 16 8 4 2 1\nfunction isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 &&\n process.getgid !== undefined &&\n stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 &&\n process.getuid !== undefined &&\n stats.uid === process.getuid()));\n}\n// Get the path of cmd.exe in windows\nexport function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}\n//# sourceMappingURL=io-util.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ok } from 'assert';\nimport * as path from 'path';\nimport * as ioUtil from './io-util.js';\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nexport function cp(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n const { force, recursive, copySourceDirectory } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory() && copySourceDirectory\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nexport function mv(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nexport function rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Check for invalid characters\n // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n if (/[*\"<>|]/.test(inputPath)) {\n throw new Error('File path must not contain `*`, `\"`, `<`, `>` or `|` on Windows');\n }\n }\n try {\n // note if path does not exist, error is silent\n yield ioUtil.rm(inputPath, {\n force: true,\n maxRetries: 3,\n recursive: true,\n retryDelay: 300\n });\n }\n catch (err) {\n throw new Error(`File was unable to be removed ${err}`);\n }\n });\n}\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nexport function mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n ok(fsPath, 'a path argument must be provided');\n yield ioUtil.mkdir(fsPath, { recursive: true });\n });\n}\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nexport function which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nexport function findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n const copySourceDirectory = options.copySourceDirectory == null\n ? true\n : Boolean(options.copySourceDirectory);\n return { force, recursive, copySourceDirectory };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"timers\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as os from 'os';\nimport * as events from 'events';\nimport * as child from 'child_process';\nimport * as path from 'path';\nimport * as io from '@actions/io';\nimport * as ioUtil from '@actions/io/lib/io-util';\nimport { setTimeout } from 'timers';\n/* eslint-disable @typescript-eslint/unbound-method */\nconst IS_WINDOWS = process.platform === 'win32';\n/*\n * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.\n */\nexport class ToolRunner extends events.EventEmitter {\n constructor(toolPath, args, options) {\n super();\n if (!toolPath) {\n throw new Error(\"Parameter 'toolPath' cannot be null or empty.\");\n }\n this.toolPath = toolPath;\n this.args = args || [];\n this.options = options || {};\n }\n _debug(message) {\n if (this.options.listeners && this.options.listeners.debug) {\n this.options.listeners.debug(message);\n }\n }\n _getCommandString(options, noPrefix) {\n const toolPath = this._getSpawnFileName();\n const args = this._getSpawnArgs(options);\n let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool\n if (IS_WINDOWS) {\n // Windows + cmd file\n if (this._isCmdFile()) {\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows + verbatim\n else if (options.windowsVerbatimArguments) {\n cmd += `\"${toolPath}\"`;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows (regular)\n else {\n cmd += this._windowsQuoteCmdArg(toolPath);\n for (const a of args) {\n cmd += ` ${this._windowsQuoteCmdArg(a)}`;\n }\n }\n }\n else {\n // OSX/Linux - this can likely be improved with some form of quoting.\n // creating processes on Unix is fundamentally different than Windows.\n // on Unix, execvp() takes an arg array.\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n return cmd;\n }\n _processLineBuffer(data, strBuffer, onLine) {\n try {\n let s = strBuffer + data.toString();\n let n = s.indexOf(os.EOL);\n while (n > -1) {\n const line = s.substring(0, n);\n onLine(line);\n // the rest of the string ...\n s = s.substring(n + os.EOL.length);\n n = s.indexOf(os.EOL);\n }\n return s;\n }\n catch (err) {\n // streaming lines to console is best effort. Don't fail a build.\n this._debug(`error processing line. Failed with error ${err}`);\n return '';\n }\n }\n _getSpawnFileName() {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n return process.env['COMSPEC'] || 'cmd.exe';\n }\n }\n return this.toolPath;\n }\n _getSpawnArgs(options) {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n let argline = `/D /S /C \"${this._windowsQuoteCmdArg(this.toolPath)}`;\n for (const a of this.args) {\n argline += ' ';\n argline += options.windowsVerbatimArguments\n ? a\n : this._windowsQuoteCmdArg(a);\n }\n argline += '\"';\n return [argline];\n }\n }\n return this.args;\n }\n _endsWith(str, end) {\n return str.endsWith(end);\n }\n _isCmdFile() {\n const upperToolPath = this.toolPath.toUpperCase();\n return (this._endsWith(upperToolPath, '.CMD') ||\n this._endsWith(upperToolPath, '.BAT'));\n }\n _windowsQuoteCmdArg(arg) {\n // for .exe, apply the normal quoting rules that libuv applies\n if (!this._isCmdFile()) {\n return this._uvQuoteCmdArg(arg);\n }\n // otherwise apply quoting rules specific to the cmd.exe command line parser.\n // the libuv rules are generic and are not designed specifically for cmd.exe\n // command line parser.\n //\n // for a detailed description of the cmd.exe command line parser, refer to\n // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912\n // need quotes for empty arg\n if (!arg) {\n return '\"\"';\n }\n // determine whether the arg needs to be quoted\n const cmdSpecialChars = [\n ' ',\n '\\t',\n '&',\n '(',\n ')',\n '[',\n ']',\n '{',\n '}',\n '^',\n '=',\n ';',\n '!',\n \"'\",\n '+',\n ',',\n '`',\n '~',\n '|',\n '<',\n '>',\n '\"'\n ];\n let needsQuotes = false;\n for (const char of arg) {\n if (cmdSpecialChars.some(x => x === char)) {\n needsQuotes = true;\n break;\n }\n }\n // short-circuit if quotes not needed\n if (!needsQuotes) {\n return arg;\n }\n // the following quoting rules are very similar to the rules that by libuv applies.\n //\n // 1) wrap the string in quotes\n //\n // 2) double-up quotes - i.e. \" => \"\"\n //\n // this is different from the libuv quoting rules. libuv replaces \" with \\\", which unfortunately\n // doesn't work well with a cmd.exe command line.\n //\n // note, replacing \" with \"\" also works well if the arg is passed to a downstream .NET console app.\n // for example, the command line:\n // foo.exe \"myarg:\"\"my val\"\"\"\n // is parsed by a .NET console app into an arg array:\n // [ \"myarg:\\\"my val\\\"\" ]\n // which is the same end result when applying libuv quoting rules. although the actual\n // command line from libuv quoting rules would look like:\n // foo.exe \"myarg:\\\"my val\\\"\"\n //\n // 3) double-up slashes that precede a quote,\n // e.g. hello \\world => \"hello \\world\"\n // hello\\\"world => \"hello\\\\\"\"world\"\n // hello\\\\\"world => \"hello\\\\\\\\\"\"world\"\n // hello world\\ => \"hello world\\\\\"\n //\n // technically this is not required for a cmd.exe command line, or the batch argument parser.\n // the reasons for including this as a .cmd quoting rule are:\n //\n // a) this is optimized for the scenario where the argument is passed from the .cmd file to an\n // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.\n //\n // b) it's what we've been doing previously (by deferring to node default behavior) and we\n // haven't heard any complaints about that aspect.\n //\n // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be\n // escaped when used on the command line directly - even though within a .cmd file % can be escaped\n // by using %%.\n //\n // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts\n // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.\n //\n // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would\n // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the\n // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args\n // to an external program.\n //\n // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.\n // % can be escaped within a .cmd file.\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\'; // double the slash\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\"'; // double the quote\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _uvQuoteCmdArg(arg) {\n // Tool runner wraps child_process.spawn() and needs to apply the same quoting as\n // Node in certain cases where the undocumented spawn option windowsVerbatimArguments\n // is used.\n //\n // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,\n // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),\n // pasting copyright notice from Node within this function:\n //\n // Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to\n // deal in the Software without restriction, including without limitation the\n // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n // sell copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n //\n // The above copyright notice and this permission notice shall be included in\n // all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n // IN THE SOFTWARE.\n if (!arg) {\n // Need double quotation for empty argument\n return '\"\"';\n }\n if (!arg.includes(' ') && !arg.includes('\\t') && !arg.includes('\"')) {\n // No quotation needed\n return arg;\n }\n if (!arg.includes('\"') && !arg.includes('\\\\')) {\n // No embedded double quotes or backslashes, so I can just wrap\n // quote marks around the whole thing.\n return `\"${arg}\"`;\n }\n // Expected input/output:\n // input : hello\"world\n // output: \"hello\\\"world\"\n // input : hello\"\"world\n // output: \"hello\\\"\\\"world\"\n // input : hello\\world\n // output: hello\\world\n // input : hello\\\\world\n // output: hello\\\\world\n // input : hello\\\"world\n // output: \"hello\\\\\\\"world\"\n // input : hello\\\\\"world\n // output: \"hello\\\\\\\\\\\"world\"\n // input : hello world\\\n // output: \"hello world\\\\\" - note the comment in libuv actually reads \"hello world\\\"\n // but it appears the comment is wrong, it should be \"hello world\\\\\"\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\';\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\\\\';\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _cloneExecOptions(options) {\n options = options || {};\n const result = {\n cwd: options.cwd || process.cwd(),\n env: options.env || process.env,\n silent: options.silent || false,\n windowsVerbatimArguments: options.windowsVerbatimArguments || false,\n failOnStdErr: options.failOnStdErr || false,\n ignoreReturnCode: options.ignoreReturnCode || false,\n delay: options.delay || 10000\n };\n result.outStream = options.outStream || process.stdout;\n result.errStream = options.errStream || process.stderr;\n return result;\n }\n _getSpawnOptions(options, toolPath) {\n options = options || {};\n const result = {};\n result.cwd = options.cwd;\n result.env = options.env;\n result['windowsVerbatimArguments'] =\n options.windowsVerbatimArguments || this._isCmdFile();\n if (options.windowsVerbatimArguments) {\n result.argv0 = `\"${toolPath}\"`;\n }\n return result;\n }\n /**\n * Exec a tool.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param tool path to tool to exec\n * @param options optional exec options. See ExecOptions\n * @returns number\n */\n exec() {\n return __awaiter(this, void 0, void 0, function* () {\n // root the tool path if it is unrooted and contains relative pathing\n if (!ioUtil.isRooted(this.toolPath) &&\n (this.toolPath.includes('/') ||\n (IS_WINDOWS && this.toolPath.includes('\\\\')))) {\n // prefer options.cwd if it is specified, however options.cwd may also need to be rooted\n this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);\n }\n // if the tool is only a file name, then resolve it from the PATH\n // otherwise verify it exists (add extension on Windows if necessary)\n this.toolPath = yield io.which(this.toolPath, true);\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n this._debug(`exec tool: ${this.toolPath}`);\n this._debug('arguments:');\n for (const arg of this.args) {\n this._debug(` ${arg}`);\n }\n const optionsNonNull = this._cloneExecOptions(this.options);\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);\n }\n const state = new ExecState(optionsNonNull, this.toolPath);\n state.on('debug', (message) => {\n this._debug(message);\n });\n if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {\n return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));\n }\n const fileName = this._getSpawnFileName();\n const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));\n let stdbuffer = '';\n if (cp.stdout) {\n cp.stdout.on('data', (data) => {\n if (this.options.listeners && this.options.listeners.stdout) {\n this.options.listeners.stdout(data);\n }\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(data);\n }\n stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.stdline) {\n this.options.listeners.stdline(line);\n }\n });\n });\n }\n let errbuffer = '';\n if (cp.stderr) {\n cp.stderr.on('data', (data) => {\n state.processStderr = true;\n if (this.options.listeners && this.options.listeners.stderr) {\n this.options.listeners.stderr(data);\n }\n if (!optionsNonNull.silent &&\n optionsNonNull.errStream &&\n optionsNonNull.outStream) {\n const s = optionsNonNull.failOnStdErr\n ? optionsNonNull.errStream\n : optionsNonNull.outStream;\n s.write(data);\n }\n errbuffer = this._processLineBuffer(data, errbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.errline) {\n this.options.listeners.errline(line);\n }\n });\n });\n }\n cp.on('error', (err) => {\n state.processError = err.message;\n state.processExited = true;\n state.processClosed = true;\n state.CheckComplete();\n });\n cp.on('exit', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n cp.on('close', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n state.processClosed = true;\n this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n state.on('done', (error, exitCode) => {\n if (stdbuffer.length > 0) {\n this.emit('stdline', stdbuffer);\n }\n if (errbuffer.length > 0) {\n this.emit('errline', errbuffer);\n }\n cp.removeAllListeners();\n if (error) {\n reject(error);\n }\n else {\n resolve(exitCode);\n }\n });\n if (this.options.input) {\n if (!cp.stdin) {\n throw new Error('child process missing stdin');\n }\n cp.stdin.end(this.options.input);\n }\n }));\n });\n }\n}\n/**\n * Convert an arg string to an array of args. Handles escaping\n *\n * @param argString string of arguments\n * @returns string[] array of arguments\n */\nexport function argStringToArray(argString) {\n const args = [];\n let inQuotes = false;\n let escaped = false;\n let arg = '';\n function append(c) {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\';\n }\n arg += c;\n escaped = false;\n }\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i);\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes;\n }\n else {\n append(c);\n }\n continue;\n }\n if (c === '\\\\' && escaped) {\n append(c);\n continue;\n }\n if (c === '\\\\' && inQuotes) {\n escaped = true;\n continue;\n }\n if (c === ' ' && !inQuotes) {\n if (arg.length > 0) {\n args.push(arg);\n arg = '';\n }\n continue;\n }\n append(c);\n }\n if (arg.length > 0) {\n args.push(arg.trim());\n }\n return args;\n}\nclass ExecState extends events.EventEmitter {\n constructor(options, toolPath) {\n super();\n this.processClosed = false; // tracks whether the process has exited and stdio is closed\n this.processError = '';\n this.processExitCode = 0;\n this.processExited = false; // tracks whether the process has exited\n this.processStderr = false; // tracks whether stderr was written to\n this.delay = 10000; // 10 seconds\n this.done = false;\n this.timeout = null;\n if (!toolPath) {\n throw new Error('toolPath must not be empty');\n }\n this.options = options;\n this.toolPath = toolPath;\n if (options.delay) {\n this.delay = options.delay;\n }\n }\n CheckComplete() {\n if (this.done) {\n return;\n }\n if (this.processClosed) {\n this._setResult();\n }\n else if (this.processExited) {\n this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);\n }\n }\n _debug(message) {\n this.emit('debug', message);\n }\n _setResult() {\n // determine whether there is an error\n let error;\n if (this.processExited) {\n if (this.processError) {\n error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);\n }\n else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {\n error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);\n }\n else if (this.processStderr && this.options.failOnStdErr) {\n error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);\n }\n }\n // clear the timeout\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.done = true;\n this.emit('done', error, this.processExitCode);\n }\n static HandleTimeout(state) {\n if (state.done) {\n return;\n }\n if (!state.processClosed && state.processExited) {\n const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;\n state._debug(message);\n }\n state._setResult();\n }\n}\n//# sourceMappingURL=toolrunner.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { StringDecoder } from 'string_decoder';\nimport * as tr from './toolrunner.js';\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nexport function exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\n/**\n * Exec a command and get the output.\n * Output will be streamed to the live console.\n * Returns promise with the exit code and collected stdout and stderr\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code, stdout, and stderr\n */\nexport function getExecOutput(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let stdout = '';\n let stderr = '';\n //Using string decoder covers the case where a mult-byte character is split\n const stdoutDecoder = new StringDecoder('utf8');\n const stderrDecoder = new StringDecoder('utf8');\n const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;\n const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;\n const stdErrListener = (data) => {\n stderr += stderrDecoder.write(data);\n if (originalStdErrListener) {\n originalStdErrListener(data);\n }\n };\n const stdOutListener = (data) => {\n stdout += stdoutDecoder.write(data);\n if (originalStdoutListener) {\n originalStdoutListener(data);\n }\n };\n const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });\n const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));\n //flush any remaining characters\n stdout += stdoutDecoder.end();\n stderr += stderrDecoder.end();\n return {\n exitCode,\n stdout,\n stderr\n };\n });\n}\n//# sourceMappingURL=exec.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport os from 'os';\nimport * as exec from '@actions/exec';\nconst getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout: version } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Version\"', undefined, {\n silent: true\n });\n const { stdout: name } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Caption\"', undefined, {\n silent: true\n });\n return {\n name: name.trim(),\n version: version.trim()\n };\n});\nconst getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d;\n const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {\n silent: true\n });\n const version = (_b = (_a = stdout.match(/ProductVersion:\\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';\n const name = (_d = (_c = stdout.match(/ProductName:\\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';\n return {\n name,\n version\n };\n});\nconst getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {\n silent: true\n });\n const [name, version] = stdout.trim().split('\\n');\n return {\n name,\n version\n };\n});\nexport const platform = os.platform();\nexport const arch = os.arch();\nexport const isWindows = platform === 'win32';\nexport const isMacOS = platform === 'darwin';\nexport const isLinux = platform === 'linux';\nexport function getDetails() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign(Object.assign({}, (yield (isWindows\n ? getWindowsInfo()\n : isMacOS\n ? getMacOsInfo()\n : getLinuxInfo()))), { platform,\n arch,\n isWindows,\n isMacOS,\n isLinux });\n });\n}\n//# sourceMappingURL=platform.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { issue, issueCommand } from './command.js';\nimport { issueFileCommand, prepareKeyValueMessage } from './file-command.js';\nimport { toCommandProperties, toCommandValue } from './utils.js';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { OidcClient } from './oidc-utils.js';\n/**\n * The code to exit an action\n */\nexport var ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode || (ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function exportVariable(name, val) {\n const convertedVal = toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return issueFileCommand('ENV', prepareKeyValueMessage(name, val));\n }\n issueCommand('set-env', { name }, convertedVal);\n}\n/**\n * Registers a secret which will get masked from logs\n *\n * @param secret - Value of the secret to be masked\n * @remarks\n * This function instructs the Actions runner to mask the specified value in any\n * logs produced during the workflow run. Once registered, the secret value will\n * be replaced with asterisks (***) whenever it appears in console output, logs,\n * or error messages.\n *\n * This is useful for protecting sensitive information such as:\n * - API keys\n * - Access tokens\n * - Authentication credentials\n * - URL parameters containing signatures (SAS tokens)\n *\n * Note that masking only affects future logs; any previous appearances of the\n * secret in logs before calling this function will remain unmasked.\n *\n * @example\n * ```typescript\n * // Register an API token as a secret\n * const apiToken = \"abc123xyz456\";\n * setSecret(apiToken);\n *\n * // Now any logs containing this value will show *** instead\n * console.log(`Using token: ${apiToken}`); // Outputs: \"Using token: ***\"\n * ```\n */\nexport function setSecret(secret) {\n issueCommand('add-mask', {}, secret);\n}\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nexport function addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n issueFileCommand('PATH', inputPath);\n }\n else {\n issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nexport function getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nexport function getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nexport function getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n issueCommand('set-output', { name }, toCommandValue(value));\n}\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nexport function setCommandEcho(enabled) {\n issue('echo', enabled ? 'on' : 'off');\n}\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nexport function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nexport function isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nexport function debug(message) {\n issueCommand('debug', {}, message);\n}\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function error(message, properties = {}) {\n issueCommand('error', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function warning(message, properties = {}) {\n issueCommand('warning', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function notice(message, properties = {}) {\n issueCommand('notice', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nexport function info(message) {\n process.stdout.write(message + os.EOL);\n}\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nexport function startGroup(name) {\n issue('group', name);\n}\n/**\n * End an output group.\n */\nexport function endGroup() {\n issue('endgroup');\n}\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nexport function group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return issueFileCommand('STATE', prepareKeyValueMessage(name, value));\n }\n issueCommand('save-state', { name }, toCommandValue(value));\n}\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nexport function getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexport function getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield OidcClient.getIDToken(aud);\n });\n}\n/**\n * Summary exports\n */\nexport { summary } from './summary.js';\n/**\n * @deprecated use core.summary\n */\nexport { markdownSummary } from './summary.js';\n/**\n * Path exports\n */\nexport { toPosixPath, toWin32Path, toPlatformPath } from './path-utils.js';\n/**\n * Platform utilities exports\n */\nexport * as platform from './platform.js';\n//# sourceMappingURL=core.js.map","class UploadUrlPool {\n /** Map from key (bucket ID or file ID) to a stack of available entries. */\n pools = /* @__PURE__ */ new Map();\n /**\n * Take an upload URL from the pool, or return null if none are available.\n *\n * @param key - The bucket ID or file ID to look up.\n *\n * @returns An upload URL entry, or null if the pool is empty for the given key.\n */\n checkout(key) {\n const pool = this.pools.get(key);\n if (!pool || pool.length === 0) return null;\n return pool.pop() ?? null;\n }\n /**\n * Return a still-valid upload URL to the pool for future reuse.\n *\n * @param key - The bucket ID or file ID the entry belongs to.\n * @param entry - The upload URL entry to return to the pool.\n */\n checkin(key, entry) {\n let pool = this.pools.get(key);\n if (!pool) {\n pool = [];\n this.pools.set(key, pool);\n }\n pool.push(entry);\n }\n /**\n * Remove a specific upload URL from the pool (e.g. after an upload error).\n *\n * @param key - The bucket ID or file ID the entry belongs to.\n * @param entry - The failed upload URL entry to remove.\n */\n evict(key, entry) {\n const pool = this.pools.get(key);\n if (!pool) return;\n const idx = pool.findIndex((e) => e.uploadUrl === entry.uploadUrl);\n if (idx !== -1) {\n pool.splice(idx, 1);\n }\n }\n /** Remove all entries from every key in the pool. */\n clear() {\n this.pools.clear();\n }\n}\nexport {\n UploadUrlPool\n};\n//# sourceMappingURL=upload-url-pool.js.map\n","import { UploadUrlPool } from \"./upload-url-pool.js\";\nclass InMemoryAccountInfo {\n /** Cached authorization response, or null before authorize() is called. */\n auth = null;\n /** Pool of reusable small-file upload URLs, keyed by bucket ID. */\n uploadUrls = new UploadUrlPool();\n /** Pool of reusable large-file part upload URLs, keyed by file ID. */\n partUploadUrls = new UploadUrlPool();\n /**\n * Store a fresh authorization response, replacing any previous state.\n *\n * @param auth - The authorize account response to store.\n */\n setAuth(auth) {\n this.auth = auth;\n this.uploadUrls.clear();\n this.partUploadUrls.clear();\n }\n /**\n * Return the current authorization response, or null if not authorized.\n *\n * @returns The cached authorization response, or null if not yet authorized.\n */\n getAuth() {\n return this.auth;\n }\n /** Discard all cached authorization state and upload URLs. */\n clear() {\n this.auth = null;\n this.uploadUrls.clear();\n this.partUploadUrls.clear();\n }\n /**\n * Base URL for B2 API calls.\n *\n * @returns The base URL for B2 API calls.\n *\n * @throws Error if not yet authorized.\n */\n getApiUrl() {\n return this.requireAuth().apiInfo.storageApi.apiUrl;\n }\n /**\n * Base URL for file downloads.\n *\n * @returns The base URL for file downloads.\n *\n * @throws Error if not yet authorized.\n */\n getDownloadUrl() {\n return this.requireAuth().apiInfo.storageApi.downloadUrl;\n }\n /**\n * Current authorization token.\n *\n * @returns The current authorization token.\n *\n * @throws Error if not yet authorized.\n */\n getAuthToken() {\n return this.requireAuth().authorizationToken;\n }\n /**\n * The authorized account ID.\n *\n * @returns The authorized account identifier.\n *\n * @throws Error if not yet authorized.\n */\n getAccountId() {\n return this.requireAuth().accountId;\n }\n /**\n * Server-recommended part size for large file uploads, in bytes.\n *\n * @returns The server-recommended part size in bytes.\n *\n * @throws Error if not yet authorized.\n */\n getRecommendedPartSize() {\n return this.requireAuth().apiInfo.storageApi.recommendedPartSize;\n }\n /**\n * Smallest allowed part size for large file uploads, in bytes.\n *\n * @returns The smallest allowed part size in bytes.\n *\n * @throws Error if not yet authorized.\n */\n getAbsoluteMinimumPartSize() {\n return this.requireAuth().apiInfo.storageApi.absoluteMinimumPartSize;\n }\n /**\n * Base URL for the S3-compatible API.\n *\n * @returns The base URL for the S3-compatible API.\n *\n * @throws Error if not yet authorized.\n */\n getS3ApiUrl() {\n return this.requireAuth().apiInfo.storageApi.s3ApiUrl;\n }\n /**\n * Bucket ID the key is restricted to, or null if unrestricted.\n *\n * @returns The restricted bucket identifier, or null if the key is unrestricted.\n *\n * @throws Error if not yet authorized.\n */\n getAllowedBucketId() {\n return this.requireAuth().apiInfo.storageApi.allowed.bucketId ?? null;\n }\n /**\n * Take an upload URL from the pool for the given bucket, or null if none available.\n *\n * @param bucketId - The bucket to check out an upload URL for.\n *\n * @returns A reusable upload URL entry, or null if none are available.\n */\n checkoutUploadUrl(bucketId) {\n return this.uploadUrls.checkout(bucketId);\n }\n /**\n * Return a still-valid upload URL to the pool for reuse.\n *\n * @param bucketId - The bucket the upload URL belongs to.\n * @param entry - The upload URL entry to return to the pool.\n */\n returnUploadUrl(bucketId, entry) {\n this.uploadUrls.checkin(bucketId, entry);\n }\n /**\n * Remove an upload URL from the pool after an upload error.\n *\n * @param bucketId - The bucket the failed upload URL belongs to.\n * @param entry - The upload URL entry to remove from the pool.\n */\n evictUploadUrl(bucketId, entry) {\n this.uploadUrls.evict(bucketId, entry);\n }\n /**\n * Take a large-file part upload URL from the pool, or null if none available.\n *\n * @param fileId - The large file to check out a part upload URL for.\n *\n * @returns A reusable part upload URL entry, or null if none are available.\n */\n checkoutPartUploadUrl(fileId) {\n return this.partUploadUrls.checkout(fileId);\n }\n /**\n * Return a still-valid part upload URL to the pool for reuse.\n *\n * @param fileId - The large file the part upload URL belongs to.\n * @param entry - The part upload URL entry to return to the pool.\n */\n returnPartUploadUrl(fileId, entry) {\n this.partUploadUrls.checkin(fileId, entry);\n }\n /**\n * Remove a part upload URL from the pool after an error.\n *\n * @param fileId - The large file the failed part upload URL belongs to.\n * @param entry - The part upload URL entry to remove from the pool.\n */\n evictPartUploadUrl(fileId, entry) {\n this.partUploadUrls.evict(fileId, entry);\n }\n /**\n * Retrieve the cached auth response or throw if not yet authorized.\n *\n * @returns The cached authorization response.\n *\n * @throws Error if authorize() has not been called.\n */\n requireAuth() {\n if (!this.auth) throw new Error(\"Not authorized. Call authorize() first.\");\n return this.auth;\n }\n}\nexport {\n InMemoryAccountInfo\n};\n//# sourceMappingURL=in-memory.js.map\n","const REALM_URLS = {\n production: \"https://api.backblazeb2.com\",\n staging: \"https://api.backblazeb2.com\"\n};\nfunction getRealmUrl(realm) {\n return REALM_URLS[realm] ?? realm;\n}\nexport {\n REALM_URLS,\n getRealmUrl\n};\n//# sourceMappingURL=realms.js.map\n","function accountId(raw) {\n return raw;\n}\nfunction bucketId(raw) {\n return raw;\n}\nfunction fileId(raw) {\n return raw;\n}\nfunction keyId(raw) {\n return raw;\n}\nfunction applicationKeyId(raw) {\n return raw;\n}\nfunction largeFileId(raw) {\n return raw;\n}\nexport {\n accountId,\n applicationKeyId,\n bucketId,\n fileId,\n keyId,\n largeFileId\n};\n//# sourceMappingURL=ids.js.map\n","async function bestEffort(fn) {\n try {\n await fn();\n } catch {\n }\n}\nexport {\n bestEffort\n};\n//# sourceMappingURL=best-effort.js.map\n","import { bestEffort } from \"../util/best-effort.js\";\nasync function cancelLargeFileBestEffort(raw, accountInfo, fileId) {\n await bestEffort(\n () => raw.cancelLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId })\n );\n}\nexport {\n cancelLargeFileBestEffort\n};\n//# sourceMappingURL=cancel.js.map\n","class Semaphore {\n /**\n * @param limit - Maximum number of concurrent acquisitions. Must be a\n * positive integer; values `<= 0` would create a semaphore that\n * never lets anything through (all `acquire()` calls would queue\n * forever), so the constructor throws fast instead.\n *\n * @throws `RangeError` when `limit` is not a positive integer.\n */\n constructor(limit) {\n this.limit = limit;\n if (!Number.isInteger(limit) || limit <= 0) {\n throw new RangeError(\n `Semaphore limit must be a positive integer; received ${limit}. A non-positive limit produces a deadlocked semaphore — fail fast at construction instead.`\n );\n }\n }\n current = 0;\n queue = [];\n /**\n * Acquires a slot, waiting if the limit has been reached.\n * @returns A promise that resolves when a slot is available.\n */\n async acquire() {\n if (this.current < this.limit) {\n this.current++;\n return;\n }\n return new Promise((resolve) => {\n this.queue.push(resolve);\n });\n }\n /** Releases a slot, unblocking the next queued caller if any. */\n release() {\n const next = this.queue.shift();\n if (next) {\n next();\n } else {\n this.current--;\n }\n }\n /**\n * Number of slots currently available.\n *\n * @returns The count of free concurrency slots.\n */\n get available() {\n return this.limit - this.current;\n }\n}\nexport {\n Semaphore\n};\n//# sourceMappingURL=concurrency.js.map\n","const DEFAULT_TRANSFER_CONCURRENCY = 4;\nconst DEFAULT_BULK_CONCURRENCY = 10;\nconst DEFAULT_PAGE_SIZE = 1e3;\nconst DEFAULT_CONTENT_TYPE = \"b2/x-auto\";\nexport {\n DEFAULT_BULK_CONCURRENCY,\n DEFAULT_CONTENT_TYPE,\n DEFAULT_PAGE_SIZE,\n DEFAULT_TRANSFER_CONCURRENCY\n};\n//# sourceMappingURL=defaults.js.map\n","function planRanges(totalSize, chunkSize) {\n const plans = [];\n let offset = 0;\n let index = 0;\n while (offset < totalSize) {\n const length = Math.min(chunkSize, totalSize - offset);\n const end = offset + length - 1;\n plans.push({\n partNumber: index + 1,\n index,\n offset,\n length,\n start: offset,\n end\n });\n offset += length;\n index++;\n }\n return plans;\n}\nfunction byteRangeHeader(start, end) {\n return `bytes=${start}-${end}`;\n}\nexport {\n byteRangeHeader,\n planRanges\n};\n//# sourceMappingURL=plan-ranges.js.map\n","import { fileId } from \"../types/ids.js\";\nimport { cancelLargeFileBestEffort } from \"../upload/cancel.js\";\nimport { Semaphore } from \"../upload/concurrency.js\";\nimport { DEFAULT_CONTENT_TYPE, DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { byteRangeHeader, planRanges } from \"../util/plan-ranges.js\";\nasync function copyLargeFile(raw, accountInfo, options) {\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const sourceInfo = await raw.getFileInfo(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: options.sourceFileId\n });\n const totalSize = sourceInfo.contentLength;\n if (totalSize <= partSize) {\n return raw.copyFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n sourceFileId: options.sourceFileId,\n fileName: options.fileName,\n ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : {},\n ...options.contentType !== void 0 ? { contentType: options.contentType } : {},\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}\n });\n }\n const destBucketId = options.destinationBucketId ?? sourceInfo.bucketId;\n const startResp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: destBucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? sourceInfo.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo: options.fileInfo ?? {},\n ...options.destinationServerSideEncryption !== void 0 ? { serverSideEncryption: options.destinationServerSideEncryption } : {}\n });\n const largeFileId = startResp.fileId;\n const ranges = planRanges(totalSize, partSize);\n const partSha1s = new Array(ranges.length);\n const sem = new Semaphore(concurrency);\n try {\n options.signal?.throwIfAborted();\n await Promise.all(\n ranges.map(async (range) => {\n await sem.acquire();\n try {\n options.signal?.throwIfAborted();\n const resp = await raw.copyPart(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n sourceFileId: options.sourceFileId,\n // `startLargeFile` returns `LargeFileId`; `copyPart` takes the\n // same value typed as `FileId`. Re-brand via the factory.\n largeFileId: fileId(largeFileId),\n partNumber: range.partNumber,\n range: byteRangeHeader(range.start, range.end),\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}\n });\n partSha1s[range.partNumber - 1] = resp.contentSha1;\n } finally {\n sem.release();\n }\n })\n );\n options.signal?.throwIfAborted();\n return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n}\nexport {\n copyLargeFile\n};\n//# sourceMappingURL=large.js.map\n","const utf8Encoder = new TextEncoder();\nconst utf8Decoder = new TextDecoder();\nexport {\n utf8Decoder,\n utf8Encoder\n};\n//# sourceMappingURL=text-codec.js.map\n","import { utf8Encoder } from \"../util/text-codec.js\";\nconst SAFE_CHARS = new Set(\n \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@/\".split(\"\")\n);\nfunction encodeFileName(name) {\n const encoded = [];\n for (const char of name) {\n if (SAFE_CHARS.has(char)) {\n encoded.push(char);\n } else {\n const bytes = utf8Encoder.encode(char);\n for (const byte of bytes) {\n encoded.push(`%${byte.toString(16).toUpperCase().padStart(2, \"0\")}`);\n }\n }\n }\n return encoded.join(\"\");\n}\nfunction decodeFileName(encoded) {\n return decodeURIComponent(encoded);\n}\nfunction buildFileInfoHeaders(fileInfo) {\n if (!fileInfo) return {};\n const headers = {};\n for (const [key, value] of Object.entries(fileInfo)) {\n headers[`X-Bz-Info-${encodeFileName(key)}`] = encodeFileName(value);\n }\n return headers;\n}\nfunction parseFileInfoHeaders(headers) {\n const info = {};\n headers.forEach((value, key) => {\n const lower = key.toLowerCase();\n if (lower.startsWith(\"x-bz-info-\")) {\n const infoKey = decodeFileName(lower.slice(\"x-bz-info-\".length));\n info[infoKey] = decodeFileName(value);\n }\n });\n return info;\n}\nexport {\n buildFileInfoHeaders,\n decodeFileName,\n encodeFileName,\n parseFileInfoHeaders\n};\n//# sourceMappingURL=encoding.js.map\n","class ProgressTracker {\n /**\n * Creates a new ProgressTracker.\n * @param listener - Callback to receive progress events, or undefined to disable.\n * @param totalBytes - Expected total bytes, or null if unknown.\n * @param totalParts - Expected total parts, or null if not a multipart transfer.\n */\n constructor(listener, totalBytes, totalParts) {\n this.listener = listener;\n this.totalBytes = totalBytes;\n this.totalParts = totalParts;\n this.startTime = Date.now();\n }\n /** Running total of bytes transferred. */\n bytesTransferred = 0;\n /** Running count of completed parts. */\n partsCompleted = 0;\n /** Timestamp when tracking began. */\n startTime;\n /**\n * Record that additional bytes have been transferred and notify the listener.\n * @param count - The number of additional bytes that were transferred.\n */\n addBytes(count) {\n this.bytesTransferred += count;\n this.emit();\n }\n /** Record that a multipart part has completed and notify the listener. */\n completePart() {\n this.partsCompleted++;\n this.emit();\n }\n /** Emit the current progress snapshot to the listener, if one is registered. */\n emit() {\n this.listener?.({\n bytesTransferred: this.bytesTransferred,\n totalBytes: this.totalBytes,\n partsCompleted: this.partsCompleted,\n totalParts: this.totalParts,\n elapsedMs: Date.now() - this.startTime\n });\n }\n}\nexport {\n ProgressTracker\n};\n//# sourceMappingURL=progress.js.map\n","function normalizeSha1(raw) {\n if (raw === null || raw === void 0 || raw === \"none\") return null;\n return raw;\n}\nfunction normalizeFileVersionSha1(fv) {\n return fv.contentSha1 === \"none\" ? { ...fv, contentSha1: null } : fv;\n}\nfunction normalizeFileVersionListSha1(resp) {\n return { ...resp, files: resp.files.map(normalizeFileVersionSha1) };\n}\nexport {\n normalizeFileVersionListSha1,\n normalizeFileVersionSha1,\n normalizeSha1\n};\n//# sourceMappingURL=normalize.js.map\n","import { parseFileInfoHeaders } from \"../raw/encoding.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { fileId } from \"../types/ids.js\";\nimport { bestEffort } from \"../util/best-effort.js\";\nimport { normalizeSha1 } from \"../util/normalize.js\";\nasync function downloadById(raw, accountInfo, options) {\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.fileId,\n toRawDownloadOptions(options)\n );\n const headers = extractDownloadHeaders(resp.headers);\n return {\n headers,\n // HEAD requests legitimately have no body; return an empty stream so the\n // result shape stays consistent.\n body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress)\n };\n}\nasync function downloadByName(raw, accountInfo, options) {\n const resp = await raw.downloadFileByName(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.bucketName,\n options.fileName,\n toRawDownloadOptions(options)\n );\n const headers = extractDownloadHeaders(resp.headers);\n return {\n headers,\n body: instrumentProgress(resp.body ?? emptyStream(), headers.contentLength, options.onProgress)\n };\n}\nasync function headById(raw, accountInfo, options) {\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.fileId,\n { ...toRawDownloadOptions(options), method: \"HEAD\" }\n );\n if (resp.body !== null) {\n const body = resp.body;\n await bestEffort(() => body.cancel());\n }\n return { headers: extractDownloadHeaders(resp.headers) };\n}\nasync function headByName(raw, accountInfo, options) {\n const resp = await raw.downloadFileByName(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n options.bucketName,\n options.fileName,\n { ...toRawDownloadOptions(options), method: \"HEAD\" }\n );\n if (resp.body !== null) {\n const body = resp.body;\n await bestEffort(() => body.cancel());\n }\n return { headers: extractDownloadHeaders(resp.headers) };\n}\nfunction toRawDownloadOptions(options) {\n return {\n ...options.method !== void 0 ? { method: options.method } : {},\n ...options.range !== void 0 ? { range: options.range } : {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.b2ContentDisposition !== void 0 ? { b2ContentDisposition: options.b2ContentDisposition } : {},\n ...options.b2ContentLanguage !== void 0 ? { b2ContentLanguage: options.b2ContentLanguage } : {},\n ...options.b2ContentEncoding !== void 0 ? { b2ContentEncoding: options.b2ContentEncoding } : {},\n ...options.b2ContentType !== void 0 ? { b2ContentType: options.b2ContentType } : {},\n ...options.b2CacheControl !== void 0 ? { b2CacheControl: options.b2CacheControl } : {},\n ...options.b2Expires !== void 0 ? { b2Expires: options.b2Expires } : {},\n ...options.signal !== void 0 ? { signal: options.signal } : {}\n };\n}\nfunction emptyStream() {\n return new ReadableStream({\n start(controller) {\n controller.close();\n }\n });\n}\nfunction instrumentProgress(body, totalBytes, listener) {\n if (listener === void 0) return body;\n const tracker = new ProgressTracker(listener, totalBytes, 1);\n const transform = new TransformStream({\n transform(chunk, controller) {\n tracker.addBytes(chunk.byteLength);\n controller.enqueue(chunk);\n },\n flush() {\n tracker.completePart();\n }\n });\n return body.pipeThrough(transform);\n}\nfunction extractDownloadHeaders(headers) {\n const fileInfo = parseFileInfoHeaders(headers);\n return {\n contentType: headers.get(\"Content-Type\") ?? \"application/octet-stream\",\n contentLength: Number.parseInt(headers.get(\"Content-Length\") ?? \"0\", 10),\n // B2 sends the literal `'none'` for multipart-finished files; collapse\n // to `null` so the typed `string | null` actually means \"no SHA-1\".\n contentSha1: normalizeSha1(headers.get(\"X-Bz-Content-Sha1\")),\n fileId: fileId(headers.get(\"X-Bz-File-Id\") ?? \"\"),\n fileName: decodeURIComponent(headers.get(\"X-Bz-File-Name\") ?? \"\"),\n fileInfo,\n uploadTimestamp: Number.parseInt(headers.get(\"X-Bz-Upload-Timestamp\") ?? \"0\", 10)\n };\n}\nexport {\n downloadById,\n downloadByName,\n headById,\n headByName\n};\n//# sourceMappingURL=single.js.map\n","const DEFAULT_RETRY_OPTIONS = {\n maxRetries: 5,\n maxRetryDelayMs: 64e3,\n initialRetryDelayMs: 1e3\n};\nfunction computeBackoff(attempt, options, retryAfter) {\n if (retryAfter !== void 0 && retryAfter > 0) {\n return Math.min(retryAfter * 1e3, options.maxRetryDelayMs);\n }\n const base = options.initialRetryDelayMs * 2 ** attempt;\n const jitter = Math.random() * base * 0.5;\n return Math.min(base + jitter, options.maxRetryDelayMs);\n}\nfunction sleep(ms, signal) {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) {\n reject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n return;\n }\n const timer = setTimeout(resolve, ms);\n signal?.addEventListener(\n \"abort\",\n () => {\n clearTimeout(timer);\n reject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n },\n { once: true }\n );\n });\n}\nexport {\n DEFAULT_RETRY_OPTIONS,\n computeBackoff,\n sleep\n};\n//# sourceMappingURL=retry.js.map\n","async function collectStream(stream) {\n const reader = stream.getReader();\n try {\n const chunks = [];\n let total = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n total += value.byteLength;\n }\n const result = new Uint8Array(total);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return result;\n } finally {\n reader.releaseLock();\n }\n}\nexport {\n collectStream\n};\n//# sourceMappingURL=collect.js.map\n","import { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep } from \"../http/retry.js\";\nimport { collectStream } from \"../streams/collect.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { planRanges, byteRangeHeader } from \"../util/plan-ranges.js\";\nfunction createParallelDownloadStream(raw, accountInfo, options) {\n const rangeSize = options.rangeSize ?? 10 * 1024 * 1024;\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const totalSize = options.totalSize;\n const retryOptions = {\n ...DEFAULT_RETRY_OPTIONS,\n ...options.maxRetries !== void 0 ? { maxRetries: options.maxRetries } : {}\n };\n const abort = options.signal;\n const ranges = planRanges(totalSize, rangeSize);\n const windowSize = concurrency * 2;\n const inflight = /* @__PURE__ */ new Map();\n const buffer = /* @__PURE__ */ new Map();\n let nextToSchedule = 0;\n let nextToEmit = 0;\n let firstError = null;\n function scheduleNext() {\n while (firstError === null && // Honour abort here so a completed range that triggers a top-up\n // doesn't queue one final fetch after the caller aborted. Without\n // this gate, one extra range request fires post-abort before the\n // `pull()` loop notices.\n abort?.aborted !== true && nextToSchedule < ranges.length && inflight.size + buffer.size < windowSize) {\n const range = ranges[nextToSchedule];\n if (range === void 0) break;\n const idx = nextToSchedule;\n nextToSchedule++;\n const task = (async () => {\n try {\n const data = await fetchRangeWithRetry(\n raw,\n accountInfo,\n options.fileId,\n range.start,\n range.end,\n retryOptions,\n abort\n );\n buffer.set(idx, data);\n } catch (err) {\n if (firstError === null) firstError = err;\n } finally {\n inflight.delete(idx);\n }\n })();\n inflight.set(idx, task);\n }\n }\n return new ReadableStream({\n start(controller) {\n try {\n abort?.throwIfAborted();\n scheduleNext();\n } catch (err) {\n controller.error(err);\n }\n },\n async pull(controller) {\n try {\n while (!buffer.has(nextToEmit)) {\n abort?.throwIfAborted();\n if (firstError !== null) throw firstError;\n if (inflight.size === 0) {\n controller.close();\n return;\n }\n await Promise.race(inflight.values());\n }\n const data = buffer.get(nextToEmit);\n if (data !== void 0) {\n buffer.delete(nextToEmit);\n nextToEmit++;\n controller.enqueue(data);\n }\n scheduleNext();\n if (nextToEmit >= ranges.length && buffer.size === 0 && inflight.size === 0 && firstError === null) {\n controller.close();\n }\n } catch (err) {\n controller.error(err);\n }\n },\n cancel() {\n buffer.clear();\n }\n });\n}\nasync function fetchRangeWithRetry(raw, accountInfo, fileId, start, end, retryOptions, signal) {\n let lastError;\n for (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {\n if (attempt > 0) {\n const delay = computeBackoff(attempt - 1, retryOptions);\n await sleep(delay, signal);\n }\n try {\n signal?.throwIfAborted();\n const resp = await raw.downloadFileById(\n accountInfo.getDownloadUrl(),\n accountInfo.getAuthToken(),\n fileId,\n {\n range: byteRangeHeader(start, end),\n ...signal !== void 0 ? { signal } : {}\n }\n );\n if (!resp.body) throw new Error(\"Download chunk has no body\");\n return await collectStream(resp.body);\n } catch (err) {\n lastError = err;\n if (signal?.aborted) throw err;\n if (err instanceof DOMException && err.name === \"AbortError\") throw err;\n }\n }\n throw lastError instanceof Error ? lastError : new Error(\"Range download failed after retries\");\n}\nexport {\n createParallelDownloadStream\n};\n//# sourceMappingURL=parallel.js.map\n","let nodeCreateHash;\nasync function getNodeCreateHash() {\n if (nodeCreateHash !== void 0) return nodeCreateHash;\n try {\n const crypto2 = await import(\"node:crypto\");\n if (typeof crypto2.createHash !== \"function\") throw new Error(\"createHash unavailable\");\n nodeCreateHash = (algo) => {\n const h = crypto2.createHash(algo);\n return {\n update(data) {\n h.update(data);\n },\n digest(encoding) {\n return h.digest(encoding);\n }\n };\n };\n } catch {\n nodeCreateHash = null;\n }\n return nodeCreateHash;\n}\nclass IncrementalSha1 {\n /** Buffered chunks for WebCrypto fallback path. */\n chunks = [];\n /** Total bytes fed into the hash so far. */\n totalLength = 0;\n /** Node.js hash instance, or null if using WebCrypto fallback. */\n nodeHash = null;\n /** Resolves once the crypto backend has been loaded. */\n initPromise;\n /** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */\n constructor() {\n this.initPromise = getNodeCreateHash().then((factory) => {\n if (factory) this.nodeHash = factory(\"sha1\");\n });\n }\n /**\n * Feed data into the hash. Async because it lazily initializes the crypto backend.\n * @param data - The bytes to include in the hash computation.\n *\n * @returns A promise that resolves once the data has been consumed.\n */\n async update(data) {\n await this.initPromise;\n if (this.nodeHash) {\n this.nodeHash.update(data);\n } else {\n this.chunks.push(new Uint8Array(data));\n }\n this.totalLength += data.byteLength;\n }\n /**\n * Finalize the hash and return the hex-encoded SHA-1 digest.\n * @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.\n */\n async digest() {\n await this.initPromise;\n if (this.nodeHash) {\n return this.nodeHash.digest(\"hex\");\n }\n const combined = new Uint8Array(this.totalLength);\n let offset = 0;\n for (const chunk of this.chunks) {\n combined.set(chunk, offset);\n offset += chunk.byteLength;\n }\n const hashBuffer = await crypto.subtle.digest(\"SHA-1\", combined.buffer);\n return hexEncode(new Uint8Array(hashBuffer));\n }\n /**\n * Total number of bytes fed into the hash so far.\n *\n * @returns The cumulative byte count across all update calls.\n */\n get bytesProcessed() {\n return this.totalLength;\n }\n}\nfunction hexEncode(bytes) {\n const hex = [];\n for (const b of bytes) {\n hex.push(b.toString(16).padStart(2, \"0\"));\n }\n return hex.join(\"\");\n}\nasync function sha1Hex(data) {\n const factory = await getNodeCreateHash();\n if (factory) {\n const h = factory(\"sha1\");\n h.update(data);\n return h.digest(\"hex\");\n }\n const hashBuffer = await crypto.subtle.digest(\"SHA-1\", data.buffer);\n return hexEncode(new Uint8Array(hashBuffer));\n}\nexport {\n IncrementalSha1,\n sha1Hex\n};\n//# sourceMappingURL=hash.js.map\n","import { largeFileId } from \"../types/ids.js\";\nasync function findResumeCandidate(raw, accountInfo, bucketId, fileName) {\n const unfinished = await raw.listUnfinishedLargeFiles(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { bucketId }\n );\n const match = unfinished.files.find((f) => f.fileName === fileName);\n if (!match) return null;\n const fileId = largeFileId(match.fileId);\n const uploadedPartSha1s = await collectPartSha1s(raw, accountInfo, fileId);\n return { fileId, uploadedPartSha1s };\n}\nasync function collectPartSha1s(raw, accountInfo, fileId) {\n const sha1s = /* @__PURE__ */ new Map();\n let startPartNumber;\n while (true) {\n const page = await raw.listParts(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId,\n ...startPartNumber !== void 0 ? { startPartNumber } : {}\n });\n for (const part of page.parts) {\n sha1s.set(part.partNumber, part.contentSha1);\n }\n if (page.nextPartNumber === null) break;\n startPartNumber = page.nextPartNumber;\n }\n return sha1s;\n}\nexport {\n collectPartSha1s,\n findResumeCandidate\n};\n//# sourceMappingURL=resume.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY, DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nimport { planRanges } from \"../util/plan-ranges.js\";\nimport { cancelLargeFileBestEffort } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nimport { collectPartSha1s, findResumeCandidate } from \"./resume.js\";\nasync function uploadLargeFile(raw, accountInfo, options) {\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const totalSize = options.source.size;\n const parts = planRanges(totalSize, partSize);\n const fileInfo = { ...options.fileInfo };\n const startLargeFileRequest = {\n bucketId: options.bucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {}\n };\n let largeFileId;\n let preUploaded;\n if (options.resumeFileId !== void 0) {\n largeFileId = options.resumeFileId;\n preUploaded = await collectPartSha1s(raw, accountInfo, largeFileId);\n } else if (options.resume === true) {\n const candidate = await findResumeCandidate(\n raw,\n accountInfo,\n options.bucketId,\n options.fileName\n );\n if (candidate) {\n largeFileId = candidate.fileId;\n preUploaded = candidate.uploadedPartSha1s;\n } else {\n const startResp = await raw.startLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n startLargeFileRequest\n );\n largeFileId = startResp.fileId;\n preUploaded = /* @__PURE__ */ new Map();\n }\n } else {\n const startResp = await raw.startLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n startLargeFileRequest\n );\n largeFileId = startResp.fileId;\n preUploaded = /* @__PURE__ */ new Map();\n }\n const partSha1s = new Array(parts.length);\n const tracker = new ProgressTracker(options.onProgress, totalSize, parts.length);\n const sem = new Semaphore(concurrency);\n if (!options.source.canSlice) {\n if (options.resume === true || options.resumeFileId !== void 0) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw new Error(\n \"uploadLargeFile: resume is not supported on non-sliceable sources (e.g. StreamSource).\"\n );\n }\n try {\n await uploadPartsSequentially(\n raw,\n accountInfo,\n options,\n largeFileId,\n parts,\n partSha1s,\n tracker\n );\n return await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n }\n try {\n const tasks = parts.map(async (part) => {\n await sem.acquire();\n try {\n options.signal?.throwIfAborted();\n const partSource = options.source.slice(part.offset, part.offset + part.length);\n const data = new Uint8Array(await partSource.toArrayBuffer());\n const partSha1 = new IncrementalSha1();\n await partSha1.update(data);\n const sha1Hex = await partSha1.digest();\n const serverSha1 = preUploaded.get(part.partNumber);\n if (serverSha1 !== void 0 && serverSha1 === sha1Hex) {\n partSha1s[part.partNumber - 1] = serverSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n return;\n }\n let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId }\n );\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result2 = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber: part.partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(largeFileId, uploadEntry);\n partSha1s[part.partNumber - 1] = result2.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(largeFileId, uploadEntry);\n throw err;\n }\n } finally {\n sem.release();\n }\n });\n await Promise.all(tasks);\n const result = await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId: largeFileId,\n partSha1Array: partSha1s\n });\n return result;\n } catch (err) {\n await cancelLargeFileBestEffort(raw, accountInfo, largeFileId);\n throw err;\n }\n}\nasync function uploadPartsSequentially(raw, accountInfo, options, largeFileId, parts, partSha1s, tracker) {\n const reader = options.source.stream().getReader();\n let partNumber = 1;\n let carry = null;\n try {\n for (const planned of parts) {\n options.signal?.throwIfAborted();\n const buf = new Uint8Array(planned.length);\n let filled = 0;\n if (carry !== null) {\n const take = Math.min(carry.byteLength, buf.byteLength - filled);\n buf.set(carry.subarray(0, take), filled);\n filled += take;\n carry = take < carry.byteLength ? carry.subarray(take) : null;\n }\n while (filled < buf.byteLength) {\n const { done, value } = await reader.read();\n if (done) break;\n const take = Math.min(value.byteLength, buf.byteLength - filled);\n buf.set(value.subarray(0, take), filled);\n filled += take;\n if (take < value.byteLength) {\n carry = value.subarray(take);\n }\n }\n const data = filled === buf.byteLength ? buf : buf.subarray(0, filled);\n if (data.byteLength === 0) {\n throw new Error(\n `uploadLargeFile: source stream ended before part ${partNumber}; advertised size does not match emitted bytes.`\n );\n }\n const partSha1 = new IncrementalSha1();\n await partSha1.update(data);\n const sha1Hex = await partSha1.digest();\n let uploadEntry = accountInfo.checkoutPartUploadUrl(largeFileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId }\n );\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber: planned.partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(largeFileId, uploadEntry);\n partSha1s[planned.partNumber - 1] = result.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(largeFileId, uploadEntry);\n throw err;\n }\n partNumber++;\n }\n } finally {\n reader.releaseLock();\n }\n}\nexport {\n uploadLargeFile\n};\n//# sourceMappingURL=large.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nasync function uploadSmallFile(raw, accountInfo, options) {\n let uploadEntry = accountInfo.checkoutUploadUrl(options.bucketId);\n if (!uploadEntry) {\n const resp = await raw.getUploadUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: options.bucketId\n });\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n const data = new Uint8Array(await options.source.toArrayBuffer());\n const sha1 = new IncrementalSha1();\n await sha1.update(data);\n const sha1Hex = await sha1.digest();\n const tracker = new ProgressTracker(options.onProgress, data.byteLength, 1);\n try {\n const result = await raw.uploadFile(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n ...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n ...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {},\n ...options.lastModifiedMillis !== void 0 ? { lastModifiedMillis: options.lastModifiedMillis } : {}\n },\n data,\n options.signal\n );\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n accountInfo.returnUploadUrl(options.bucketId, uploadEntry);\n return result;\n } catch (err) {\n accountInfo.evictUploadUrl(options.bucketId, uploadEntry);\n throw err;\n }\n}\nexport {\n uploadSmallFile\n};\n//# sourceMappingURL=single.js.map\n","function toError(value) {\n return value instanceof Error ? value : new Error(String(value));\n}\nexport {\n toError\n};\n//# sourceMappingURL=to-error.js.map\n","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY, DEFAULT_CONTENT_TYPE } from \"../util/defaults.js\";\nimport { toError } from \"../util/to-error.js\";\nimport { cancelLargeFileBestEffort } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nfunction createWriteStream(raw, accountInfo, options) {\n const minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n const recommendedPartSize = accountInfo.getRecommendedPartSize();\n const partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const tracker = new ProgressTracker(options.onProgress, null, null);\n const sem = new Semaphore(concurrency);\n let largeFileId = null;\n let startPromise = null;\n let nextPartNumber = 1;\n let pendingBytes = 0;\n const pending = [];\n const partSha1s = [];\n const inflight = [];\n let errored = null;\n const {\n promise: done,\n resolve: resolveDone,\n reject: rejectDone\n } = Promise.withResolvers();\n done.catch(() => {\n });\n function ensureStarted() {\n if (largeFileId !== null) return Promise.resolve(largeFileId);\n if (startPromise !== null) return startPromise;\n startPromise = (async () => {\n const resp = await raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n bucketId: options.bucketId,\n fileName: options.fileName,\n contentType: options.contentType ?? DEFAULT_CONTENT_TYPE,\n fileInfo: options.fileInfo ?? {},\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n });\n largeFileId = resp.fileId;\n return largeFileId;\n })();\n return startPromise;\n }\n async function shipPart(data, partNumber) {\n const fileId = await ensureStarted();\n const sha1 = new IncrementalSha1();\n await sha1.update(data);\n const sha1Hex = await sha1.digest();\n let uploadEntry = accountInfo.checkoutPartUploadUrl(fileId);\n if (!uploadEntry) {\n const resp = await raw.getUploadPartUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n fileId\n });\n uploadEntry = { uploadUrl: resp.uploadUrl, authorizationToken: resp.authorizationToken };\n }\n try {\n const result = await raw.uploadPart(\n uploadEntry.uploadUrl,\n {\n authorization: uploadEntry.authorizationToken,\n partNumber,\n contentLength: data.byteLength,\n contentSha1: sha1Hex,\n ...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n },\n data,\n options.signal\n );\n accountInfo.returnPartUploadUrl(fileId, uploadEntry);\n partSha1s[partNumber - 1] = result.contentSha1;\n tracker.addBytes(data.byteLength);\n tracker.completePart();\n } catch (err) {\n accountInfo.evictPartUploadUrl(fileId, uploadEntry);\n throw err;\n }\n }\n function dispatchPart() {\n if (pending.length === 0) return;\n let data;\n if (pending.length === 1) {\n const head = pending[0];\n if (!head) return;\n data = head;\n } else {\n const total = pending.reduce((sum, chunk) => sum + chunk.byteLength, 0);\n data = new Uint8Array(total);\n let offset = 0;\n for (const chunk of pending) {\n data.set(chunk, offset);\n offset += chunk.byteLength;\n }\n }\n pending.length = 0;\n pendingBytes = 0;\n const partNumber = nextPartNumber++;\n const task = (async () => {\n await sem.acquire();\n try {\n await shipPart(data, partNumber);\n } catch (err) {\n errored = toError(err);\n throw err;\n } finally {\n sem.release();\n }\n })();\n inflight.push(task);\n task.catch(() => {\n });\n }\n const writable = new WritableStream({\n async write(chunk) {\n if (errored) throw errored;\n options.signal?.throwIfAborted();\n pending.push(chunk);\n pendingBytes += chunk.byteLength;\n while (pendingBytes >= partSize) {\n const carved = carveExact(pending, partSize);\n const partNumber = nextPartNumber++;\n pendingBytes -= partSize;\n const task = (async () => {\n await sem.acquire();\n try {\n await shipPart(carved, partNumber);\n } catch (err) {\n errored = toError(err);\n throw err;\n } finally {\n sem.release();\n }\n })();\n inflight.push(task);\n task.catch(() => {\n });\n }\n },\n async close() {\n try {\n if (errored) throw errored;\n options.signal?.throwIfAborted();\n if (pendingBytes > 0) {\n dispatchPart();\n }\n await Promise.all(inflight);\n if (errored) throw errored;\n if (largeFileId === null) {\n throw new Error(\"createWriteStream closed without any data written.\");\n }\n const result = await raw.finishLargeFile(\n accountInfo.getApiUrl(),\n accountInfo.getAuthToken(),\n { fileId: largeFileId, partSha1Array: partSha1s }\n );\n resolveDone(result);\n } catch (err) {\n const fileIdToCancel = largeFileId;\n if (fileIdToCancel !== null) {\n await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel);\n }\n rejectDone(err);\n throw err;\n }\n },\n async abort(reason) {\n const fileIdToCancel = largeFileId;\n if (fileIdToCancel !== null) {\n await cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel);\n }\n rejectDone(toError(reason));\n }\n });\n return { writable, done };\n}\nfunction carveExact(chunks, size) {\n const out = new Uint8Array(size);\n let written = 0;\n while (written < size && chunks.length > 0) {\n const head = chunks[0];\n if (!head) break;\n const need = size - written;\n if (head.byteLength <= need) {\n out.set(head, written);\n written += head.byteLength;\n chunks.shift();\n } else {\n out.set(head.subarray(0, need), written);\n chunks[0] = head.subarray(need);\n written += need;\n }\n }\n return out;\n}\nexport {\n createWriteStream\n};\n//# sourceMappingURL=stream.js.map\n","import { createParallelDownloadStream } from \"./download/parallel.js\";\nimport { downloadByName, headByName, downloadById, headById } from \"./download/single.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { createWriteStream } from \"./upload/stream.js\";\nclass B2Object {\n /** The file name (path) within the bucket. */\n fileName;\n client;\n bucket;\n /**\n * @param client - The parent B2Client instance.\n * @param bucket - The parent Bucket this object belongs to.\n * @param fileName - The file path within the bucket.\n *\n * @internal\n */\n constructor(client, bucket, fileName) {\n this.client = client;\n this.bucket = bucket;\n this.fileName = fileName;\n }\n /**\n * Uploads data to this file name. Automatically uses multipart upload for large files.\n * @param options - Upload configuration including data source and optional settings.\n *\n * @returns Metadata for the uploaded file version.\n */\n async upload(options) {\n const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n const isLarge = options.source.size > recommendedPartSize;\n if (isLarge) {\n return uploadLargeFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...options\n });\n }\n const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options;\n return uploadSmallFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...smallOptions\n });\n }\n /**\n * Downloads this file by name. Pass `method: 'HEAD'` to fetch only the\n * response headers (file metadata) without streaming the body.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result with response headers and body stream.\n */\n async download(options) {\n return downloadByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.bucket.name,\n fileName: this.fileName,\n ...options\n });\n }\n /**\n * Fetches response headers for this file via HTTP HEAD. Returns a\n * body-less result so callers never have to drain the (logically\n * empty) HEAD body themselves.\n *\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal. Same shape as {@link B2Object.download}'s\n * options minus `method` (always HEAD) and `onProgress` (no body).\n *\n * @returns Parsed download headers (content type, SHA-1, file info, etc.).\n */\n async head(options) {\n return headByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.bucket.name,\n fileName: this.fileName,\n ...options\n });\n }\n /**\n * Downloads a specific version of this file by ID. Pass `method: 'HEAD'`\n * to fetch only the response headers (file metadata) without streaming the body.\n * @param fileId - The file version ID to download.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result with response headers and body stream.\n */\n async downloadById(fileId, options) {\n return downloadById(this.client.raw, this.client.accountInfo, {\n fileId,\n ...options\n });\n }\n /**\n * Fetches response headers for a specific version of this file by ID\n * via HTTP HEAD. Returns a body-less result so callers never have to\n * drain the (logically empty) HEAD body themselves.\n *\n * @param fileId - The file version ID to inspect.\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal.\n *\n * @returns Parsed download headers.\n */\n async headById(fileId, options) {\n return headById(this.client.raw, this.client.accountInfo, {\n fileId,\n ...options\n });\n }\n /**\n * Creates a parallel-download ReadableStream that fetches the file in concurrent ranged chunks.\n * @param fileId - The file version ID to download.\n * @param totalSize - Total file size in bytes (needed to compute range boundaries).\n * @param options - Concurrency, range size, and abort signal.\n *\n * @returns A Web ReadableStream of file data in sequential order.\n */\n createReadStream(fileId, totalSize, options) {\n return createParallelDownloadStream(this.client.raw, this.client.accountInfo, {\n fileId,\n totalSize,\n ...options\n });\n }\n /**\n * Creates a Web `WritableStream` that uploads streamed data into this file\n * using the multipart protocol. Pipe a `ReadableStream` into the\n * returned `writable` and await `done` to get the final {@link FileVersion}.\n *\n * Note: streaming uploads do not support resume because the size and per-part\n * hashes are not known in advance. Use {@link upload} with a buffered source\n * when resume is required.\n *\n * @param options - Streaming upload parameters (part size, concurrency, encryption).\n *\n * @returns A handle with the writable sink and a completion promise.\n */\n createWriteStream(options) {\n return createWriteStream(this.client.raw, this.client.accountInfo, {\n bucketId: this.bucket.id,\n fileName: this.fileName,\n ...options ?? {}\n });\n }\n /**\n * Retrieves metadata for a specific file version.\n * @param fileId - The file version ID to look up.\n *\n * @returns The file version metadata.\n */\n async getFileInfo(fileId) {\n return this.client.raw.getFileInfo(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileId }\n );\n }\n /**\n * Hides this file by creating a hide marker at this file name.\n *\n * @returns Metadata for the newly created hide marker.\n */\n async hide() {\n return this.bucket.hideFile(this.fileName);\n }\n /**\n * Permanently deletes a specific version of this file.\n * @param fileId - The unique identifier of the file version to delete.\n */\n async deleteVersion(fileId) {\n await this.bucket.deleteFileVersion(this.fileName, fileId);\n }\n /**\n * Sets or updates the Object Lock retention policy on a specific file\n * version of this file.\n *\n * The bucket must have Object Lock enabled (`fileLockEnabled: true` at\n * creation time). Governance-mode retention can be shortened or removed\n * by passing `bypassGovernance: true` together with an application key\n * that carries the `bypassGovernance` capability; compliance-mode\n * retention cannot be shortened by anyone until the\n * `retainUntilTimestamp` elapses.\n *\n * @param fileId - The file version to apply the policy to.\n * @param retention - The retention policy to apply.\n * @param options - Optional flag for shortening governance-mode retention.\n *\n * @returns Metadata for the updated file version.\n */\n async setRetention(fileId, retention, options) {\n return this.bucket.updateFileRetention(this.fileName, fileId, retention, options);\n }\n /**\n * Toggles the legal hold flag on a specific file version of this file.\n *\n * Legal hold is independent of retention: a file can be on legal hold\n * without any retention policy, and vice versa. The bucket must have\n * Object Lock enabled, and any caller must hold the `writeFileLegalHolds`\n * capability.\n *\n * @param fileId - The file version to apply the flag to.\n * @param legalHold - `'on'` to apply the hold, `'off'` to remove it.\n *\n * @returns Metadata for the updated file version.\n */\n async setLegalHold(fileId, legalHold) {\n return this.bucket.updateFileLegalHold(this.fileName, fileId, legalHold);\n }\n}\nexport {\n B2Object\n};\n//# sourceMappingURL=object.js.map\n","async function* paginatePages(fetcher, signal) {\n let cursor;\n while (true) {\n signal?.throwIfAborted();\n const { page, nextCursor } = await fetcher(cursor);\n yield page;\n if (nextCursor === void 0) return;\n cursor = nextCursor;\n }\n}\nasync function* paginateItems(fetcher, extractItems, signal) {\n for await (const page of paginatePages(fetcher, signal)) {\n yield* extractItems(page);\n }\n}\nexport {\n paginateItems,\n paginatePages\n};\n//# sourceMappingURL=paginator.js.map\n","import { copyLargeFile } from \"./copy/large.js\";\nimport { downloadByName, headByName } from \"./download/single.js\";\nimport { B2Object } from \"./object.js\";\nimport { accountId } from \"./types/ids.js\";\nimport { Semaphore } from \"./upload/concurrency.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { DEFAULT_PAGE_SIZE, DEFAULT_BULK_CONCURRENCY } from \"./util/defaults.js\";\nimport { paginateItems } from \"./util/paginator.js\";\nimport { toError } from \"./util/to-error.js\";\nclass Bucket {\n /** Unique identifier for this bucket. */\n id;\n /** Human-readable bucket name. */\n name;\n /** Full bucket metadata as returned by the B2 API. */\n info;\n client;\n /**\n * @param client - The parent B2Client instance.\n * @param info - The bucket metadata from the API.\n *\n * @internal\n */\n constructor(client, info) {\n this.client = client;\n this.info = info;\n this.id = info.bucketId;\n this.name = info.bucketName;\n }\n /**\n * Returns a {@link B2Object} handle for a specific file name in this bucket.\n * @param fileName - The file path within the bucket.\n *\n * @returns A B2Object handle bound to this bucket and file name.\n */\n file(fileName) {\n return new B2Object(this.client, this, fileName);\n }\n /**\n * Uploads a file to this bucket. Automatically uses multipart upload for files\n * larger than the recommended part size.\n * @param options - Upload configuration including file name, source data, and optional settings.\n *\n * @returns Metadata for the uploaded file version.\n */\n async upload(options) {\n const recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n const isLarge = options.source.size > recommendedPartSize;\n if (isLarge) {\n return uploadLargeFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.id,\n ...options\n });\n }\n const { resume: _resume, resumeFileId: _resumeFileId, ...smallOptions } = options;\n return uploadSmallFile(this.client.raw, this.client.accountInfo, {\n bucketId: this.id,\n ...smallOptions\n });\n }\n /**\n * Downloads a file from this bucket by name. Pass `method: 'HEAD'` in\n * `options` to fetch only the response headers (file metadata) without\n * streaming the body.\n * @param fileName - The file name (path) to download.\n * @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n *\n * @returns The download result containing response headers and a readable body stream.\n */\n async download(fileName, options) {\n return downloadByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.name,\n fileName,\n ...options\n });\n }\n /**\n * Fetches the response headers (file metadata) for a file via HTTP\n * HEAD. Returns a body-less result so callers never have to drain\n * the (logically empty) HEAD body themselves.\n *\n * Use this for metadata-only checks like \"does this file exist\", \"what\n * is its current SHA-1\", \"what is its Content-Length\". For full file\n * retrieval use {@link Bucket.download}.\n *\n * @param fileName - The file name (path) to inspect.\n * @param options - Optional range, SSE-C decryption, response-header\n * overrides, and abort signal. Same shape as {@link Bucket.download}'s\n * options minus `method` (always HEAD) and `onProgress` (no body).\n *\n * @returns Parsed download headers (content type, SHA-1, file info, etc.).\n *\n * @example\n * ```ts\n * const { headers } = await bucket.head('photos/2026/sunset.jpg')\n * console.log(headers.contentLength, headers.contentSha1)\n * ```\n */\n async head(fileName, options) {\n return headByName(this.client.raw, this.client.accountInfo, {\n bucketName: this.name,\n fileName,\n ...options\n });\n }\n /**\n * Lists file names in this bucket (most recent versions only).\n * @param options - Optional filtering and pagination settings.\n *\n * @returns A page of file versions with an optional continuation token.\n */\n async listFileNames(options) {\n return this.client.raw.listFileNames(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n }\n );\n }\n /**\n * Lists all file versions in this bucket, including hidden files.\n * @param options - Optional filtering and pagination settings.\n *\n * @returns A page of file versions with an optional continuation token.\n */\n async listFileVersions(options) {\n return this.client.raw.listFileVersions(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n }\n );\n }\n /**\n * Async iterator that yields the latest visible version of every file in\n * the bucket, automatically handling pagination via `listFileNames`.\n *\n * Hidden files (those whose latest version is a hide marker) are NOT\n * yielded by this iterator. Use {@link paginateFileVersions} when you\n * need full version history.\n *\n * @param options - Filter + pagination + abort options. `pageSize` is\n * forwarded to `b2_list_file_names`'s `maxFileCount` (default 1000,\n * B2-capped at 10000).\n *\n * @returns An async iterable of {@link FileVersion} entries.\n *\n * @example\n * ```ts\n * for await (const file of bucket.paginateFileNames({ prefix: 'photos/' })) {\n * console.log(file.fileName, file.contentLength)\n * }\n * ```\n */\n paginateFileNames(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listFileNames({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startFileName: cursor } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n });\n return { page: resp, nextCursor: resp.nextFileName ?? void 0 };\n },\n // Real B2 surfaces hide markers as rows in `b2_list_file_names`. This\n // iterator's documented contract is \"latest VISIBLE version\", so we\n // drop hide-action rows here. Callers who need full history should\n // use `paginateFileVersions`.\n (page) => page.files.filter((f) => f.action !== \"hide\"),\n options?.signal\n );\n }\n /**\n * Async iterator that yields every version of every file in the bucket,\n * including hidden files and historical versions, automatically handling\n * pagination via `listFileVersions`.\n *\n * The two-cursor `(nextFileName, nextFileId)` continuation that the raw\n * endpoint exposes is threaded internally; callers iterate flat.\n *\n * @param options - Filter + pagination + abort options.\n *\n * @returns An async iterable of {@link FileVersion} entries.\n */\n paginateFileVersions(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listFileVersions({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startFileName: cursor.fileName } : {},\n ...cursor?.fileId !== void 0 ? { startFileId: cursor.fileId } : {},\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n });\n const nextCursor = resp.nextFileName !== null ? { fileName: resp.nextFileName, fileId: resp.nextFileId ?? void 0 } : void 0;\n return { page: resp, nextCursor };\n },\n (page) => page.files,\n options?.signal\n );\n }\n /**\n * Async iterator that yields every unfinished large file in the bucket,\n * automatically handling pagination via `listUnfinishedLargeFiles`.\n *\n * Useful for janitorial scripts that want to inspect or cancel abandoned\n * multipart uploads (typically followed by {@link cancelLargeFile} on\n * the underlying raw client).\n *\n * @param options - Filter + pagination + abort options. `pageSize` is\n * B2-capped at 100 for this endpoint.\n *\n * @returns An async iterable of unfinished-large-file metadata entries.\n */\n paginateUnfinishedLargeFiles(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listUnfinishedLargeFiles({\n pageSize: options?.pageSize ?? 100,\n ...cursor !== void 0 ? { startFileId: cursor } : {},\n ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {}\n });\n return { page: resp, nextCursor: resp.nextFileId ?? void 0 };\n },\n (page) => page.files,\n options?.signal\n );\n }\n /**\n * Async iterator that yields every uploaded part for a specific large\n * file, automatically handling pagination via `listParts`.\n *\n * @param largeFileId - The unfinished large file to enumerate parts of.\n * @param options - Pagination + abort options. `pageSize` is B2-capped\n * at 1000 for this endpoint; the default is 1000.\n *\n * @returns An async iterable of {@link PartInfo} entries.\n */\n paginateParts(largeFileId, options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.client.raw.listParts(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileId: largeFileId,\n maxPartCount: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startPartNumber: cursor } : {}\n }\n );\n return { page: resp, nextCursor: resp.nextPartNumber ?? void 0 };\n },\n (page) => page.parts,\n options?.signal\n );\n }\n /**\n * Looks up the latest visible version of a file by name.\n * Uses `listFileNames` under the hood; returns `null` when the file does not\n * exist or its latest version is a hide marker.\n * @param fileName - The exact file path to look up.\n *\n * @returns The latest {@link FileVersion}, or `null` if not found.\n */\n async getFileInfoByName(fileName) {\n const resp = await this.listFileNames({ prefix: fileName, pageSize: 1 });\n const match = resp.files.find((f) => f.fileName === fileName);\n if (!match || match.action === \"hide\") return null;\n return match;\n }\n /**\n * Removes the latest hide marker for a file, restoring visibility of the\n * previous upload. Returns the deleted hide marker, or `null` if there was\n * no hide marker to remove (file is already visible or does not exist).\n * @param fileName - The file path to unhide.\n *\n * @returns The deleted hide marker version, or `null` if nothing was hidden.\n */\n async unhideFile(fileName) {\n const resp = await this.listFileVersions({ prefix: fileName, pageSize: 100 });\n const versions = resp.files.filter((f) => f.fileName === fileName);\n if (versions.length === 0) return null;\n const latest = versions[0];\n if (!latest || latest.action !== \"hide\") return null;\n await this.deleteFileVersion(fileName, latest.fileId);\n return latest;\n }\n /**\n * Hides a file by creating a hide marker. The file remains in version history but is no longer visible in `listFileNames`.\n * @param fileName - The file path to hide.\n *\n * @returns Metadata for the newly created hide marker.\n */\n async hideFile(fileName) {\n return this.client.raw.hideFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, fileName }\n );\n }\n /**\n * Permanently deletes a specific file version. Both file name and file ID are required.\n *\n * If the file is under Object Lock retention, B2 will reject the\n * delete: compliance-mode files cannot be deleted until the retention\n * expires; governance-mode files require `bypassGovernance: true`\n * AND a calling key with the `bypassGovernance` capability. Files on\n * legal hold cannot be deleted by anyone until the hold is removed.\n *\n * @param fileName - The file path of the version to delete.\n * @param fileId - The unique identifier of the file version to delete.\n * @param options - Optional flag for bypassing governance retention.\n */\n async deleteFileVersion(fileName, fileId, options) {\n await this.client.raw.deleteFileVersion(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileName,\n fileId,\n ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n }\n );\n }\n /**\n * Cancels an in-progress large file upload so the partial parts are not\n * retained or billed. The most common reason to call this is to clean up\n * abandoned multipart uploads surfaced by {@link listUnfinishedLargeFiles}.\n * @param fileId - The unique identifier of the unfinished large file to cancel.\n *\n * @returns Metadata about the cancelled large file.\n */\n async cancelLargeFile(fileId) {\n return this.client.raw.cancelLargeFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileId }\n );\n }\n /**\n * Lists large files in this bucket that were started but never finished or\n * cancelled. Wraps `b2_list_unfinished_large_files`.\n * @param options - Optional pagination filters.\n *\n * @returns The page of unfinished large files plus a continuation token.\n */\n async listUnfinishedLargeFiles(options) {\n return this.client.raw.listUnfinishedLargeFiles(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n bucketId: this.id,\n ...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},\n ...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n ...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}\n }\n );\n }\n /**\n * Deletes many file versions with bounded concurrency. Errors from individual\n * deletes are collected and returned rather than thrown, so partial success\n * does not abort the run.\n *\n * When `options.signal` is supplied and aborted, in-flight deletes\n * complete (they're already on the wire), but no new deletes start\n * after the abort fires. Subsequent targets are short-circuited to an\n * error entry so the result tally reflects what actually happened.\n * @param targets - File versions to delete.\n * @param options - Optional concurrency override and abort signal.\n * Concurrency defaults to the SDK-wide bulk-metadata setting\n * (currently 10, higher than transfer concurrency because each\n * task is a single tiny API round-trip).\n *\n * @returns A summary of successes and per-target errors.\n */\n async deleteMany(targets, options) {\n const concurrency = options?.concurrency ?? DEFAULT_BULK_CONCURRENCY;\n const sem = new Semaphore(concurrency);\n const signal = options?.signal;\n let deleted = 0;\n const errors = [];\n await Promise.all(\n targets.map(async (target) => {\n await sem.acquire();\n try {\n if (signal?.aborted) {\n errors.push({\n target,\n error: toError(signal.reason ?? \"aborted\")\n });\n return;\n }\n await this.deleteFileVersion(target.fileName, target.fileId);\n deleted++;\n } catch (err) {\n errors.push({\n target,\n error: toError(err)\n });\n } finally {\n sem.release();\n }\n })\n );\n return { deleted, errors };\n }\n /**\n * Async generator that streams every file version in the bucket (optionally\n * filtered by prefix) and deletes each one. Yields a {@link DeleteAllEvent}\n * per file version. With `dryRun: true`, no deletes are performed but `skip`\n * events are still emitted.\n * @param options - Optional prefix filter, page size, and dry-run flag.\n *\n * @returns An async generator of per-file events.\n */\n async *deleteAll(options) {\n const dryRun = options?.dryRun ?? false;\n const pageSize = options?.pageSize ?? DEFAULT_PAGE_SIZE;\n let startFileName;\n let startFileId;\n while (true) {\n const page = await this.listFileVersions({\n pageSize,\n ...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n ...startFileName !== void 0 ? { startFileName } : {},\n ...startFileId !== void 0 ? { startFileId } : {}\n });\n for (const version of page.files) {\n if (dryRun) {\n yield { type: \"skip\", fileName: version.fileName, fileId: version.fileId };\n continue;\n }\n try {\n await this.deleteFileVersion(version.fileName, version.fileId);\n yield { type: \"delete\", fileName: version.fileName, fileId: version.fileId };\n } catch (err) {\n yield {\n type: \"error\",\n fileName: version.fileName,\n fileId: version.fileId,\n message: toError(err).message\n };\n }\n }\n if (!page.nextFileName) break;\n startFileName = page.nextFileName;\n startFileId = page.nextFileId ?? void 0;\n }\n }\n /**\n * Creates a server-side copy of a file within or across buckets.\n * @param options - Copy configuration including source file ID and destination name.\n *\n * @returns Metadata for the newly created file version.\n */\n async copyFile(options) {\n return this.client.raw.copyFile(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n options\n );\n }\n /**\n * Copies a file via the server-side multipart protocol. Each part is copied\n * by reference through `b2_copy_part`; data never traverses the client. Falls\n * back to a single `copyFile` call when the source fits within a single part.\n * @param options - Copy parameters including source file ID, destination name, part size, and concurrency.\n *\n * @returns Metadata for the newly created destination file version.\n */\n async copyLargeFile(options) {\n return copyLargeFile(this.client.raw, this.client.accountInfo, {\n sourceFileId: options.sourceFileId,\n fileName: options.fileName,\n ...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : { destinationBucketId: this.id },\n ...options.contentType !== void 0 ? { contentType: options.contentType } : {},\n ...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n ...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n ...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n ...options.partSize !== void 0 ? { partSize: options.partSize } : {},\n ...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {},\n ...options.signal !== void 0 ? { signal: options.signal } : {}\n });\n }\n /**\n * Updates bucket settings such as type, CORS, lifecycle rules, and encryption.\n * @param options - Fields to update. Omitted fields are left unchanged.\n *\n * @returns Updated bucket metadata.\n */\n async update(options) {\n return this.client.raw.updateBucket(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n accountId: accountId(this.client.accountInfo.getAccountId()),\n bucketId: this.id,\n ...options\n }\n );\n }\n /**\n * Permanently deletes this bucket. The bucket must be empty (no file versions).\n *\n * @returns The deleted bucket metadata.\n */\n async delete() {\n return this.client.deleteBucket(this.id);\n }\n /**\n * Gets a download authorization token scoped to a file name prefix in this bucket.\n * @param fileNamePrefix - Only authorize downloads of files starting with this prefix.\n * @param validDurationInSeconds - How long the authorization is valid (1-604800 seconds).\n *\n * @returns The download authorization response containing a time-limited token.\n */\n async getDownloadAuthorization(fileNamePrefix, validDurationInSeconds) {\n return this.client.raw.getDownloadAuthorization(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, fileNamePrefix, validDurationInSeconds }\n );\n }\n /**\n * Gets the event notification rules configured for this bucket.\n *\n * @returns The current notification rules for this bucket.\n */\n async getNotificationRules() {\n return this.client.raw.getBucketNotificationRules(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id }\n );\n }\n /**\n * Replaces the event notification rules for this bucket.\n * @param rules - The new set of notification rules to apply.\n *\n * @returns The updated notification rules for this bucket.\n */\n async setNotificationRules(rules) {\n return this.client.raw.setBucketNotificationRules(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { bucketId: this.id, eventNotificationRules: rules }\n );\n }\n /**\n * Updates the file retention policy for a specific file version. Requires file lock on the bucket.\n * @param fileName - The file path of the version to update.\n * @param fileId - The unique identifier of the file version.\n * @param retention - The new retention policy to apply.\n * @param options - Optional flags. Set `bypassGovernance: true` to shorten governance-mode retention.\n *\n * @returns The updated file retention metadata.\n */\n async updateFileRetention(fileName, fileId, retention, options) {\n return this.client.raw.updateFileRetention(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n {\n fileName,\n fileId,\n fileRetention: retention,\n ...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n }\n );\n }\n /**\n * Updates the legal hold status for a specific file version. Requires file lock on the bucket.\n * @param fileName - The file path of the version to update.\n * @param fileId - The unique identifier of the file version.\n * @param legalHold - The new legal hold status to apply.\n *\n * @returns The updated legal hold metadata.\n */\n async updateFileLegalHold(fileName, fileId, legalHold) {\n return this.client.raw.updateFileLegalHold(\n this.client.accountInfo.getApiUrl(),\n this.client.accountInfo.getAuthToken(),\n { fileName, fileId, legalHold }\n );\n }\n /**\n * Refetches this bucket's metadata from B2 so callers operating on\n * replication / lifecycle / retention configuration always start from the\n * server-of-record state.\n *\n * Bucket configuration is monotonically revisioned by B2: B2 increments\n * `revision` on every accepted update. The local {@link info} snapshot\n * captured at construction time goes stale as soon as anyone else (or any\n * prior `update()` call) mutates the bucket, so the ergonomic\n * add/remove helpers below always refresh before composing the next\n * `setX()` call. The result is that each helper is safe to call without\n * the caller having to thread BucketInfo through their code.\n *\n * @returns Fresh {@link BucketInfo} for this bucket.\n *\n * @throws If the bucket no longer exists.\n */\n async refresh() {\n const fresh = await this.client.listBuckets({ bucketId: this.id });\n const found = fresh[0];\n if (!found) throw new Error(`Bucket ${this.id} not found`);\n return found.info;\n }\n /**\n * Returns the current cross-region replication configuration, refetched\n * from B2.\n *\n * Use this when you need to read replication state without composing a\n * write. For add/remove flows the helper methods below handle the\n * refresh-then-set sequence for you.\n *\n * @returns The current {@link ReplicationConfiguration}.\n */\n async getReplication() {\n const fresh = await this.refresh();\n return fresh.replicationConfiguration;\n }\n /**\n * Replaces this bucket's complete replication configuration.\n * @param replication - The new configuration. Pass an empty source/destination\n * pair (`{ asReplicationSource: null, asReplicationDestination: null }`)\n * to clear replication entirely.\n *\n * @returns The updated bucket metadata.\n */\n async setReplication(replication) {\n return this.update({ replicationConfiguration: replication });\n }\n /**\n * Adds (or replaces by `replicationRuleName`) a single replication rule\n * on this bucket while leaving any other rules, the source key, and the\n * destination key mapping untouched.\n *\n * When this is the very first source-side rule, `sourceApplicationKeyId`\n * must be supplied to seed `asReplicationSource.sourceApplicationKeyId`;\n * for subsequent calls the existing source key is reused unless the\n * caller explicitly overrides it.\n *\n * @param rule - The replication rule to add or replace.\n * @param options - Optional source application key ID override (or seed\n * when no source side exists yet).\n *\n * @returns The updated bucket metadata.\n *\n * @throws If no source-side replication exists yet and the caller did\n * not supply `sourceApplicationKeyId`.\n */\n async addReplicationRule(rule, options) {\n const current = (await this.refresh()).replicationConfiguration;\n const existingSource = current.asReplicationSource;\n const sourceKey = options?.sourceApplicationKeyId ?? existingSource?.sourceApplicationKeyId;\n if (!sourceKey) {\n throw new Error(\n \"addReplicationRule: no existing source-side replication; pass options.sourceApplicationKeyId\"\n );\n }\n const existingRules = existingSource?.replicationRules ?? [];\n const without = existingRules.filter((r) => r.replicationRuleName !== rule.replicationRuleName);\n return this.setReplication({\n asReplicationSource: {\n sourceApplicationKeyId: sourceKey,\n replicationRules: [...without, rule]\n },\n asReplicationDestination: current.asReplicationDestination\n });\n }\n /**\n * Removes a single replication rule by name. No-ops cleanly when the rule\n * is not present (returns the unchanged-but-revision-bumped bucket info).\n *\n * @param replicationRuleName - Name of the rule to remove.\n *\n * @returns The updated bucket metadata.\n */\n async removeReplicationRule(replicationRuleName) {\n const current = (await this.refresh()).replicationConfiguration;\n const existingSource = current.asReplicationSource;\n if (!existingSource) {\n return this.setReplication(current);\n }\n const filtered = existingSource.replicationRules.filter(\n (r) => r.replicationRuleName !== replicationRuleName\n );\n return this.setReplication({\n asReplicationSource: {\n sourceApplicationKeyId: existingSource.sourceApplicationKeyId,\n replicationRules: filtered\n },\n asReplicationDestination: current.asReplicationDestination\n });\n }\n /**\n * Returns the current lifecycle rules for this bucket, refetched from B2.\n *\n * @returns The current array of {@link LifecycleRule}s.\n */\n async getLifecycleRules() {\n const fresh = await this.refresh();\n return fresh.lifecycleRules;\n }\n /**\n * Replaces this bucket's lifecycle rules in their entirety.\n * @param rules - The new rule set. Pass `[]` to remove all lifecycle\n * automation.\n *\n * @returns The updated bucket metadata.\n */\n async setLifecycleRules(rules) {\n return this.update({ lifecycleRules: [...rules] });\n }\n /**\n * Adds (or replaces, matched by `fileNamePrefix`) a single lifecycle rule\n * while leaving any other rules untouched.\n *\n * Matching on prefix mirrors B2's own data model: each unique prefix can\n * have at most one rule, and a `b2_update_bucket` call that contains two\n * rules with the same prefix is rejected. The helper enforces this for\n * the caller.\n *\n * @param rule - The lifecycle rule to add or replace.\n *\n * @returns The updated bucket metadata.\n */\n async addLifecycleRule(rule) {\n const current = await this.getLifecycleRules();\n const without = current.filter((r) => r.fileNamePrefix !== rule.fileNamePrefix);\n return this.setLifecycleRules([...without, rule]);\n }\n /**\n * Removes a single lifecycle rule by prefix. No-ops cleanly when the rule\n * is not present.\n *\n * @param fileNamePrefix - The prefix of the rule to remove.\n *\n * @returns The updated bucket metadata.\n */\n async removeLifecycleRule(fileNamePrefix) {\n const current = await this.getLifecycleRules();\n return this.setLifecycleRules(current.filter((r) => r.fileNamePrefix !== fileNamePrefix));\n }\n /**\n * Returns the current default Object Lock retention policy for new\n * uploads to this bucket, refetched from B2.\n *\n * @returns The default {@link BucketRetentionPolicy} (which may be\n * `{ mode: 'none', period: null }` when Object Lock is enabled on the\n * bucket but no default is set).\n */\n async getDefaultRetention() {\n const fresh = await this.refresh();\n return fresh.defaultRetention;\n }\n /**\n * Sets (or clears, by passing `{ mode: 'none', period: null }`) the\n * default Object Lock retention policy applied to new uploads.\n *\n * Object Lock must already be enabled on the bucket. Buckets created\n * without `fileLockEnabled: true` cannot accept a default retention\n * policy and B2 will reject this call.\n *\n * @param policy - The new default retention policy.\n *\n * @returns The updated bucket metadata.\n */\n async setDefaultRetention(policy) {\n return this.update({ defaultRetention: policy });\n }\n}\nexport {\n Bucket\n};\n//# sourceMappingURL=bucket.js.map\n","class B2Error extends Error {\n /** HTTP status code returned by the B2 API. */\n status;\n /** B2 error code identifying the error type (e.g. `expired_auth_token`). */\n code;\n /** B2 request ID from the `X-Bz-Request-Id` response header, if present. */\n requestId;\n /** Retry delay in seconds from the `Retry-After` response header, if present. */\n retryAfter;\n /** Whether this error is transient and the request can be retried. */\n retryable;\n /**\n * Creates a new B2Error instance.\n * @param response - Parsed B2 error response body.\n * @param options - Optional retry and request metadata from response headers.\n */\n constructor(response, options) {\n super(response.message);\n this.name = \"B2Error\";\n this.status = response.status;\n this.code = response.code;\n if (options?.retryAfter !== void 0) this.retryAfter = options.retryAfter;\n if (options?.requestId !== void 0) this.requestId = options.requestId;\n this.retryable = isTransient(response.status, response.code);\n }\n}\nclass ExpiredAuthTokenError extends B2Error {\n /**\n * Creates a new ExpiredAuthTokenError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ExpiredAuthTokenError\";\n }\n}\nclass BadAuthTokenError extends B2Error {\n /**\n * Creates a new BadAuthTokenError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadAuthTokenError\";\n }\n}\nclass ServiceUnavailableError extends B2Error {\n /**\n * Creates a new ServiceUnavailableError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ServiceUnavailableError\";\n }\n}\nclass RequestTimeoutError extends B2Error {\n /**\n * Creates a new RequestTimeoutError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"RequestTimeoutError\";\n }\n}\nclass TooManyRequestsError extends B2Error {\n /**\n * Creates a new TooManyRequestsError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"TooManyRequestsError\";\n }\n}\nclass CapExceededError extends B2Error {\n /**\n * Creates a new CapExceededError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"CapExceededError\";\n }\n}\nclass AccessDeniedError extends B2Error {\n /**\n * Creates a new AccessDeniedError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"AccessDeniedError\";\n }\n}\nclass FileNotPresentError extends B2Error {\n /**\n * Creates a new FileNotPresentError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"FileNotPresentError\";\n }\n}\nclass DuplicateBucketNameError extends B2Error {\n /**\n * Creates a new DuplicateBucketNameError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"DuplicateBucketNameError\";\n }\n}\nclass BadRequestError extends B2Error {\n /**\n * Creates a new BadRequestError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadRequestError\";\n }\n}\nclass BadUploadUrlError extends B2Error {\n /**\n * Creates a new BadUploadUrlError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"BadUploadUrlError\";\n }\n}\nclass ChecksumMismatchError extends B2Error {\n /**\n * Creates a new ChecksumMismatchError instance.\n * @param response - Parsed B2 error response body.\n * @param options - The error details including HTTP status, error code, message, and optional request ID.\n */\n constructor(response, options) {\n super(response, options);\n this.name = \"ChecksumMismatchError\";\n }\n}\nclass B2InsufficientCapabilityError extends Error {\n /** Capabilities that were required for the operation. */\n required;\n /** Capabilities that the current key actually has. */\n available;\n /** Capabilities present in `required` but not in `available`. */\n missing;\n /**\n * Creates a new B2InsufficientCapabilityError instance.\n *\n * @param required - Capabilities the operation requires.\n * @param available - Capabilities the current key holds.\n * @param missing - The subset of required that isn't available.\n */\n constructor(required, available, missing) {\n super(`Application key is missing capabilities: ${missing.join(\", \")}`);\n this.name = \"B2InsufficientCapabilityError\";\n this.required = required;\n this.available = available;\n this.missing = missing;\n }\n}\nclass B2SsrfError extends Error {\n /**\n * Creates a new {@link B2SsrfError}.\n *\n * @param message - Human-readable description of which URL was rejected and why.\n * @param url - The full URL that was rejected.\n */\n constructor(message, url) {\n super(message);\n this.url = url;\n this.name = \"B2SsrfError\";\n }\n /** Always `false` — this is a security failure, not transient. */\n retryable = false;\n}\nclass NetworkError extends Error {\n /**\n * Creates a new NetworkError instance.\n * @param message - Human-readable description of the network failure.\n * @param cause - The underlying error that caused this failure, if any.\n */\n constructor(message, cause) {\n super(message);\n this.cause = cause;\n this.name = \"NetworkError\";\n }\n /** Always `true` since network errors are transient. */\n retryable = true;\n}\nfunction isTransient(status, code) {\n if (status === 408 || status === 429 || status === 503) return true;\n if (code === \"expired_auth_token\") return true;\n if (code === \"service_unavailable\" || code === \"request_timeout\") return true;\n return false;\n}\nfunction classifyError(response, options) {\n switch (response.code) {\n case \"expired_auth_token\":\n return new ExpiredAuthTokenError(response, options);\n case \"bad_auth_token\":\n case \"unauthorized\":\n return new BadAuthTokenError(response, options);\n case \"service_unavailable\":\n return new ServiceUnavailableError(response, options);\n case \"request_timeout\":\n return new RequestTimeoutError(response, options);\n case \"cap_exceeded\":\n case \"storage_cap_exceeded\":\n case \"transaction_cap_exceeded\":\n case \"download_cap_exceeded\":\n return new CapExceededError(response, options);\n case \"access_denied\":\n return new AccessDeniedError(response, options);\n case \"file_not_present\":\n case \"no_such_file\":\n return new FileNotPresentError(response, options);\n case \"duplicate_bucket_name\":\n return new DuplicateBucketNameError(response, options);\n case \"bad_sha1_checksum\":\n return new ChecksumMismatchError(response, options);\n case \"bad_request\":\n return new BadRequestError(response, options);\n }\n if (response.status === 429) return new TooManyRequestsError(response, options);\n if (response.status === 503) return new ServiceUnavailableError(response, options);\n if (response.status === 408) return new RequestTimeoutError(response, options);\n return new B2Error(response, options);\n}\nexport {\n AccessDeniedError,\n B2Error,\n B2InsufficientCapabilityError,\n B2SsrfError,\n BadAuthTokenError,\n BadRequestError,\n BadUploadUrlError,\n CapExceededError,\n ChecksumMismatchError,\n DuplicateBucketNameError,\n ExpiredAuthTokenError,\n FileNotPresentError,\n NetworkError,\n RequestTimeoutError,\n ServiceUnavailableError,\n TooManyRequestsError,\n classifyError\n};\n//# sourceMappingURL=index.js.map\n","import { B2SsrfError } from \"../errors/index.js\";\nclass UrlGuard {\n allowedSuffixes = [];\n /**\n * Lock the guard to the given host suffixes. A suffix matches a host\n * either exactly or as a `*.suffix` subdomain. For example,\n * `backblazeb2.com` allows `api.backblazeb2.com` and\n * `s3.us-west-004.backblazeb2.com`.\n *\n * Passing an empty array disables the guard (used by the simulator and\n * other test setups). Production code should always lock the guard after\n * a successful `b2_authorize_account`.\n *\n * @param suffixes - Allowed host suffixes.\n */\n setAllowedSuffixes(suffixes) {\n this.allowedSuffixes = suffixes;\n }\n /**\n * Returns the current allowed-suffix list (for tests and diagnostics).\n *\n * @returns The currently-configured list of allowed host suffixes.\n */\n getAllowedSuffixes() {\n return this.allowedSuffixes;\n }\n /**\n * Validate `rawUrl` against the allow-list. Throws {@link B2SsrfError} if\n * the URL points at a literal IP, a known-internal hostname, or a host\n * outside the allowed suffixes. Permissive (no-op) when no suffixes have\n * been configured yet.\n *\n * @param rawUrl - The URL the caller is about to fetch.\n *\n * @throws A `B2SsrfError` when the URL is rejected.\n */\n check(rawUrl) {\n if (this.allowedSuffixes.length === 0) return;\n let parsed;\n try {\n parsed = new URL(rawUrl);\n } catch {\n throw new B2SsrfError(`malformed URL rejected by SSRF guard: ${rawUrl}`, rawUrl);\n }\n const host = parsed.hostname.toLowerCase();\n if (isLiteralIp(host)) {\n throw new B2SsrfError(\n `literal IP host not allowed by SSRF guard (use a hostname): ${host}`,\n rawUrl\n );\n }\n if (isInternalHostname(host)) {\n throw new B2SsrfError(`internal hostname not allowed by SSRF guard: ${host}`, rawUrl);\n }\n for (const suffix of this.allowedSuffixes) {\n const lowered = suffix.toLowerCase();\n if (host === lowered || host.endsWith(`.${lowered}`)) return;\n }\n throw new B2SsrfError(\n `host outside allowed B2 realm: ${host} (allowed suffixes: ${this.allowedSuffixes.join(\", \")})`,\n rawUrl\n );\n }\n}\nfunction deriveAllowedSuffixes(storageApi) {\n const suffixes = /* @__PURE__ */ new Set([\"backblaze.com\"]);\n for (const url of [storageApi.apiUrl, storageApi.downloadUrl, storageApi.s3ApiUrl]) {\n try {\n const host = new URL(url).hostname;\n const parts = host.split(\".\");\n if (parts.length >= 2) {\n suffixes.add(parts.slice(-2).join(\".\"));\n }\n } catch {\n }\n }\n return Array.from(suffixes).sort();\n}\nfunction isLiteralIp(host) {\n if (/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/.test(host)) return true;\n if (host.includes(\":\")) return true;\n return false;\n}\nfunction isInternalHostname(host) {\n if (host === \"localhost\") return true;\n if (host.endsWith(\".localhost\")) return true;\n if (host === \"metadata\") return true;\n if (host === \"metadata.google.internal\") return true;\n if (host.endsWith(\".internal\")) return true;\n if (host.endsWith(\".local\")) return true;\n return false;\n}\nexport {\n UrlGuard,\n deriveAllowedSuffixes\n};\n//# sourceMappingURL=url-guard.js.map\n","const version = \"0.1.0\";\nconst pkg = {\n version\n};\nexport {\n pkg as default,\n version\n};\n//# sourceMappingURL=package.json.js.map\n","import pkg from \"./package.json.js\";\nconst VERSION = pkg.version;\nexport {\n VERSION\n};\n//# sourceMappingURL=version.js.map\n","import { VERSION } from \"../version.js\";\nconst SDK_PRODUCT = \"b2-sdk-typescript\";\nconst SDK_PACKAGE = \"@backblaze-labs/b2-sdk\";\nfunction detectPlatform() {\n const g = globalThis;\n if (typeof g[\"Deno\"] !== \"undefined\") {\n const deno = g[\"Deno\"];\n return {\n runtime: deno.version?.deno ? `deno/${deno.version.deno}` : \"deno\",\n os: deno.build?.os,\n arch: deno.build?.arch\n };\n }\n if (typeof g[\"Bun\"] !== \"undefined\") {\n const bun = g[\"Bun\"];\n const proc = g[\"process\"];\n return {\n runtime: bun.version ? `bun/${bun.version}` : \"bun\",\n os: proc?.platform,\n arch: proc?.arch\n };\n }\n if (typeof g[\"process\"] !== \"undefined\") {\n const proc = g[\"process\"];\n if (proc.versions?.node) {\n return {\n runtime: `node/${proc.versions.node}`,\n os: proc.platform,\n arch: proc.arch\n };\n }\n }\n if (typeof g[\"navigator\"] !== \"undefined\") {\n return { runtime: \"browser\", os: void 0, arch: void 0 };\n }\n return { runtime: \"unknown\", os: void 0, arch: void 0 };\n}\nfunction getUserAgent(custom) {\n const { runtime, os, arch } = detectPlatform();\n const parts = [\"typescript\", SDK_PACKAGE, runtime];\n if (os !== void 0) parts.push(os);\n if (arch !== void 0) parts.push(arch);\n const base = `${SDK_PRODUCT}/${VERSION} (${parts.join(\"; \")})`;\n return custom ? `${custom} ${base}` : base;\n}\nexport {\n SDK_PACKAGE,\n SDK_PRODUCT,\n getUserAgent\n};\n//# sourceMappingURL=user-agent.js.map\n","import { classifyError, ExpiredAuthTokenError, B2Error, NetworkError } from \"../errors/index.js\";\nimport { DEFAULT_RETRY_OPTIONS, sleep, computeBackoff } from \"./retry.js\";\nimport { UrlGuard } from \"./url-guard.js\";\nimport { getUserAgent } from \"./user-agent.js\";\nclass FetchTransport {\n /** User-Agent string sent with every request. */\n userAgent;\n /** SSRF allow-list applied to every outgoing URL. Mutable so `B2Client.authorize()` can lock it down post-auth. */\n urlGuard;\n /**\n * Creates a new FetchTransport.\n * @param options - Optional configuration: custom User-Agent prefix and SSRF guard.\n */\n constructor(options) {\n this.userAgent = getUserAgent(options?.userAgent);\n this.urlGuard = options?.urlGuard ?? new UrlGuard();\n }\n /**\n * Sends the request using the global `fetch` function.\n * @param request - The HTTP request to execute.\n *\n * @returns The HTTP response.\n *\n * @throws B2SsrfError when the URL fails the configured SSRF guard.\n */\n async send(request) {\n this.urlGuard.check(request.url);\n const headers = new Headers(request.headers);\n if (!headers.has(\"User-Agent\")) {\n headers.set(\"User-Agent\", this.userAgent);\n }\n const response = await fetch(request.url, {\n method: request.method,\n headers,\n body: request.body ?? null,\n ...request.signal !== void 0 ? { signal: request.signal } : {}\n });\n return {\n status: response.status,\n headers: response.headers,\n body: response.body,\n json: () => response.json(),\n text: () => response.text(),\n arrayBuffer: () => response.arrayBuffer()\n };\n }\n}\nclass RetryTransport {\n /** The wrapped transport that performs actual HTTP requests. */\n inner;\n /** Resolved retry options (defaults merged with user overrides). */\n options;\n /** Optional callback to refresh auth credentials on 401 — returns the fresh token. */\n onReauth;\n /** Sleep implementation used between retries; injectable for tests. */\n sleepImpl;\n /**\n * Creates a new RetryTransport.\n * @param opts - Retry transport configuration.\n */\n constructor(opts) {\n this.inner = opts.transport;\n this.options = { ...DEFAULT_RETRY_OPTIONS, ...opts.retry };\n if (opts.onReauth !== void 0) this.onReauth = opts.onReauth;\n this.sleepImpl = opts.sleepImpl ?? sleep;\n }\n /**\n * Sends the request with automatic retry on transient failures.\n * On expired auth tokens, calls {@link RetryTransportOptions.onReauth} and retries.\n * @param originalRequest - The HTTP request to execute. The caller's\n * reference is not mutated; on reauth, a copy with a refreshed\n * Authorization header is sent.\n *\n * @returns The HTTP response.\n */\n async send(originalRequest) {\n let request = originalRequest;\n let lastError;\n for (let attempt = 0; attempt <= this.options.maxRetries; attempt++) {\n if (attempt > 0 && lastError) {\n const retryAfter = lastError instanceof NetworkError ? void 0 : lastError.retryAfter;\n const delay = computeBackoff(attempt - 1, this.options, retryAfter);\n await this.sleepImpl(delay, request.signal);\n }\n try {\n const response = await this.inner.send(request);\n if (response.status >= 200 && response.status < 300) {\n return response;\n }\n let errorBody;\n try {\n errorBody = await response.json();\n } catch {\n errorBody = {\n status: response.status,\n code: \"internal_error\",\n message: `HTTP ${response.status}`\n };\n }\n const retryAfterHeader = response.headers.get(\"Retry-After\");\n const retryAfterSec = retryAfterHeader ? Number.parseInt(retryAfterHeader, 10) : void 0;\n const requestId = response.headers.get(\"X-Bz-Request-Id\") ?? void 0;\n const error = classifyError(errorBody, {\n ...retryAfterSec !== void 0 ? { retryAfter: retryAfterSec } : {},\n ...requestId !== void 0 ? { requestId } : {}\n });\n if (error instanceof ExpiredAuthTokenError && this.onReauth) {\n const freshToken = await this.onReauth();\n request = {\n ...request,\n headers: { ...request.headers ?? {}, Authorization: freshToken }\n };\n continue;\n }\n if (!error.retryable || attempt === this.options.maxRetries) {\n throw error;\n }\n lastError = error;\n } catch (err) {\n if (err instanceof B2Error || err instanceof NetworkError) {\n throw err;\n }\n if (err instanceof DOMException && err.name === \"AbortError\") {\n throw err;\n }\n const networkErr = new NetworkError(\n err instanceof Error ? err.message : \"Network error\",\n err\n );\n if (attempt === this.options.maxRetries) {\n throw networkErr;\n }\n lastError = networkErr;\n }\n }\n throw lastError ?? new NetworkError(\"Max retries exceeded\");\n }\n}\nexport {\n FetchTransport,\n RetryTransport\n};\n//# sourceMappingURL=transport.js.map\n","const EncryptionAlgorithm = {\n /** AES with a 256-bit key. The only algorithm B2 currently supports. */\n Aes256: \"AES256\"\n};\nconst EncryptionMode = {\n /** B2-managed encryption keys. */\n SseB2: \"SSE-B2\",\n /** Customer-provided encryption keys. */\n SseC: \"SSE-C\",\n /** No encryption. */\n None: \"none\"\n};\nconst SSE_B2 = { mode: \"SSE-B2\", algorithm: \"AES256\" };\nconst SSE_NONE = { mode: \"none\" };\nfunction sseCustomer(customerKey, customerKeyMd5) {\n return { mode: \"SSE-C\", algorithm: \"AES256\", customerKey, customerKeyMd5 };\n}\nfunction bytesToBase64(bytes) {\n const g = globalThis;\n if (g.Buffer) {\n return g.Buffer.from(bytes).toString(\"base64\");\n }\n let binary = \"\";\n for (const b of bytes) binary += String.fromCharCode(b);\n return btoa(binary);\n}\nasync function md5Base64(bytes) {\n try {\n const { createHash } = await import(\"node:crypto\");\n if (typeof createHash !== \"function\") throw new Error(\"createHash unavailable\");\n return createHash(\"md5\").update(bytes).digest(\"base64\");\n } catch {\n return bytesToBase64(md5Bytes(bytes));\n }\n}\nfunction md5Bytes(data) {\n const originalBitLength = data.byteLength * 8;\n const padLength = (data.byteLength + 8 >>> 6) + 1;\n const padded = new Uint8Array(padLength * 64);\n padded.set(data);\n padded[data.byteLength] = 128;\n const lowBits = originalBitLength >>> 0;\n const highBits = Math.floor(originalBitLength / 4294967296) >>> 0;\n const lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8);\n lengthView.setUint32(0, lowBits, true);\n lengthView.setUint32(4, highBits, true);\n const s = [\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 7,\n 12,\n 17,\n 22,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 5,\n 9,\n 14,\n 20,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 4,\n 11,\n 16,\n 23,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21,\n 6,\n 10,\n 15,\n 21\n ];\n const k = new Uint32Array([\n 3614090360,\n 3905402710,\n 606105819,\n 3250441966,\n 4118548399,\n 1200080426,\n 2821735955,\n 4249261313,\n 1770035416,\n 2336552879,\n 4294925233,\n 2304563134,\n 1804603682,\n 4254626195,\n 2792965006,\n 1236535329,\n 4129170786,\n 3225465664,\n 643717713,\n 3921069994,\n 3593408605,\n 38016083,\n 3634488961,\n 3889429448,\n 568446438,\n 3275163606,\n 4107603335,\n 1163531501,\n 2850285829,\n 4243563512,\n 1735328473,\n 2368359562,\n 4294588738,\n 2272392833,\n 1839030562,\n 4259657740,\n 2763975236,\n 1272893353,\n 4139469664,\n 3200236656,\n 681279174,\n 3936430074,\n 3572445317,\n 76029189,\n 3654602809,\n 3873151461,\n 530742520,\n 3299628645,\n 4096336452,\n 1126891415,\n 2878612391,\n 4237533241,\n 1700485571,\n 2399980690,\n 4293915773,\n 2240044497,\n 1873313359,\n 4264355552,\n 2734768916,\n 1309151649,\n 4149444226,\n 3174756917,\n 718787259,\n 3951481745\n ]);\n let a0 = 1732584193;\n let b0 = 4023233417;\n let c0 = 2562383102;\n let d0 = 271733878;\n const m = new Uint32Array(16);\n const view = new DataView(padded.buffer);\n for (let block = 0; block < padded.byteLength; block += 64) {\n for (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true);\n let A = a0;\n let B = b0;\n let C = c0;\n let D = d0;\n for (let i = 0; i < 64; i++) {\n let f;\n let g;\n if (i < 16) {\n f = B & C | ~B & D;\n g = i;\n } else if (i < 32) {\n f = D & B | ~D & C;\n g = (5 * i + 1) % 16;\n } else if (i < 48) {\n f = B ^ C ^ D;\n g = (3 * i + 5) % 16;\n } else {\n f = C ^ (B | ~D);\n g = 7 * i % 16;\n }\n const temp = D;\n D = C;\n C = B;\n const sum = A + f + (k[i] ?? 0) + (m[g] ?? 0) >>> 0;\n const shift = s[i] ?? 0;\n const rotated = (sum << shift | sum >>> 32 - shift) >>> 0;\n B = B + rotated >>> 0;\n A = temp;\n }\n a0 = a0 + A >>> 0;\n b0 = b0 + B >>> 0;\n c0 = c0 + C >>> 0;\n d0 = d0 + D >>> 0;\n }\n const out = new Uint8Array(16);\n const outView = new DataView(out.buffer);\n outView.setUint32(0, a0, true);\n outView.setUint32(4, b0, true);\n outView.setUint32(8, c0, true);\n outView.setUint32(12, d0, true);\n return out;\n}\nconst KEY_REDACTED = \"[redacted SSE-C key]\";\nclass EncryptionKey {\n /** Encryption mode discriminant. Always `'SSE-C'` for this class. */\n mode = \"SSE-C\";\n /** Encryption algorithm. B2's S3-compatible API only supports AES-256. */\n algorithm = \"AES256\";\n /** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */\n customerKey;\n /** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */\n customerKeyMd5;\n /**\n * Internal constructor. Use {@link EncryptionKey.fromBytes} or\n * {@link EncryptionKey.fromBase64} instead.\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @internal\n */\n constructor(customerKey, customerKeyMd5) {\n this.customerKey = customerKey;\n this.customerKeyMd5 = customerKeyMd5;\n }\n /**\n * Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the\n * required base64 MD5 digest internally.\n *\n * @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n *\n * @throws If the key is not exactly 32 bytes.\n */\n static async fromBytes(rawKey) {\n if (rawKey.byteLength !== 32) {\n throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`);\n }\n const customerKey = bytesToBase64(rawKey);\n const customerKeyMd5 = await md5Base64(rawKey);\n return new EncryptionKey(customerKey, customerKeyMd5);\n }\n /**\n * Builds an EncryptionKey from precomputed base64 strings. Use this in\n * environments where MD5 must be computed externally (e.g., browsers).\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n */\n static fromBase64(customerKey, customerKeyMd5) {\n return new EncryptionKey(customerKey, customerKeyMd5);\n }\n /**\n * Hides the key bytes from `JSON.stringify`.\n *\n * @returns A redacted shape: same mode and algorithm, but the key and MD5\n * replaced with a placeholder string.\n */\n toJSON() {\n return {\n mode: this.mode,\n algorithm: this.algorithm,\n customerKey: KEY_REDACTED,\n customerKeyMd5: KEY_REDACTED\n };\n }\n /**\n * Hides the key bytes from default `toString()`.\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n toString() {\n return `[EncryptionKey SSE-C ${KEY_REDACTED}]`;\n }\n /**\n * Hides the key bytes from Node's `util.inspect` (and therefore `console.log`).\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return this.toString();\n }\n}\nexport {\n EncryptionAlgorithm,\n EncryptionKey,\n EncryptionMode,\n SSE_B2,\n SSE_NONE,\n sseCustomer\n};\n//# sourceMappingURL=encryption.js.map\n","import { normalizeFileVersionSha1, normalizeFileVersionListSha1 } from \"../util/normalize.js\";\nimport { buildFileInfoHeaders, encodeFileName } from \"./encoding.js\";\nimport { decodeFileName, parseFileInfoHeaders } from \"./encoding.js\";\nimport { EncryptionMode, EncryptionAlgorithm } from \"../types/encryption.js\";\nclass RawClient {\n /** @internal */\n transport;\n /**\n * Creates a new RawClient with the given transport.\n * @param options - The constructor configuration.\n */\n constructor(options) {\n this.transport = options.transport;\n }\n // --- Auth ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}.\n * @param applicationKeyId - The application key ID for authentication.\n * @param applicationKey - The application key secret.\n * @param realmUrl - The B2 realm URL to authenticate against.\n *\n * @returns The authorization response with API URLs and credentials.\n */\n async authorizeAccount(applicationKeyId, applicationKey, realmUrl = \"https://api.backblazeb2.com\") {\n const response = await this.transport.send({\n url: `${realmUrl}/b2api/v3/b2_authorize_account`,\n method: \"GET\",\n headers: {\n Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}`\n }\n });\n return response.json();\n }\n // --- Buckets ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The created bucket metadata.\n */\n async createBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_create_bucket\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted bucket metadata.\n */\n async deleteBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_delete_bucket\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of matching buckets.\n */\n async listBuckets(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_buckets\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated bucket metadata.\n */\n async updateBucket(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_update_bucket\", request);\n }\n // --- Files ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-url | b2_get_upload_url}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The upload URL and authorization token.\n */\n async getUploadUrl(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_get_upload_url\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-upload-file | b2_upload_file}.\n *\n * Unlike most methods, this posts directly to the `uploadUrl` obtained\n * from {@link getUploadUrl} rather than the API URL.\n * @param uploadUrl - The upload endpoint URL.\n * @param headers - The request headers including authorization and content metadata.\n * @param body - The file data to upload.\n * @param signal - An optional abort signal for cancellation.\n *\n * @returns The uploaded file version metadata.\n */\n async uploadFile(uploadUrl, headers, body, signal) {\n const reqHeaders = {\n Authorization: headers.authorization,\n \"X-Bz-File-Name\": encodeFileName(headers.fileName),\n \"Content-Type\": headers.contentType,\n \"Content-Length\": String(headers.contentLength),\n \"X-Bz-Content-Sha1\": headers.contentSha1,\n ...buildFileInfoHeaders(headers.fileInfo)\n };\n if (headers.lastModifiedMillis !== void 0) {\n reqHeaders[\"X-Bz-Info-src_last_modified_millis\"] = String(headers.lastModifiedMillis);\n }\n if (headers.contentDisposition) {\n reqHeaders[\"X-Bz-Info-b2-content-disposition\"] = headers.contentDisposition;\n }\n if (headers.contentLanguage) {\n reqHeaders[\"X-Bz-Info-b2-content-language\"] = headers.contentLanguage;\n }\n if (headers.expires) {\n reqHeaders[\"X-Bz-Info-b2-expires\"] = headers.expires;\n }\n if (headers.cacheControl) {\n reqHeaders[\"X-Bz-Info-b2-cache-control\"] = headers.cacheControl;\n }\n if (headers.contentEncoding) {\n reqHeaders[\"X-Bz-Info-b2-content-encoding\"] = headers.contentEncoding;\n }\n applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n applyRetentionHeaders(reqHeaders, headers.fileRetention);\n applyLegalHoldHeader(reqHeaders, headers.legalHold);\n const response = await this.transport.send({\n url: uploadUrl,\n method: \"POST\",\n headers: reqHeaders,\n body,\n ...signal !== void 0 ? { signal } : {}\n });\n return normalizeFileVersionSha1(await response.json());\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of file names and optional continuation token.\n */\n async listFileNames(apiUrl, authToken, request) {\n return normalizeFileVersionListSha1(\n await this.postJson(apiUrl, authToken, \"b2_list_file_names\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of file versions and optional continuation token.\n */\n async listFileVersions(apiUrl, authToken, request) {\n return normalizeFileVersionListSha1(\n await this.postJson(\n apiUrl,\n authToken,\n \"b2_list_file_versions\",\n request\n )\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The file version metadata.\n */\n async getFileInfo(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_get_file_info\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The hidden file version metadata.\n */\n async hideFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_hide_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted file version identifier.\n */\n async deleteFileVersion(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_delete_file_version\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The copied file version metadata.\n */\n async copyFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_copy_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The copied part metadata.\n */\n async copyPart(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_copy_part\", request);\n }\n // --- Large Files ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The started large file metadata with file ID.\n */\n async startLargeFile(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_start_large_file\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-part-url | b2_get_upload_part_url}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The upload part URL and authorization token.\n */\n async getUploadPartUrl(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_upload_part_url\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-upload-part | b2_upload_part}.\n *\n * Posts directly to the `uploadUrl` obtained from {@link getUploadPartUrl}\n * rather than the API URL.\n * @param uploadUrl - The upload endpoint URL.\n * @param headers - The request headers including authorization and content metadata.\n * @param body - The file data to upload.\n * @param signal - An optional abort signal for cancellation.\n *\n * @returns The uploaded part metadata.\n */\n async uploadPart(uploadUrl, headers, body, signal) {\n const reqHeaders = {\n Authorization: headers.authorization,\n \"X-Bz-Part-Number\": String(headers.partNumber),\n \"Content-Length\": String(headers.contentLength),\n \"X-Bz-Content-Sha1\": headers.contentSha1\n };\n applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n const response = await this.transport.send({\n url: uploadUrl,\n method: \"POST\",\n headers: reqHeaders,\n body,\n ...signal !== void 0 ? { signal } : {}\n });\n return response.json();\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The completed file version metadata.\n */\n async finishLargeFile(apiUrl, authToken, request) {\n return normalizeFileVersionSha1(\n await this.postJson(apiUrl, authToken, \"b2_finish_large_file\", request)\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The cancelled large file metadata.\n */\n async cancelLargeFile(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_cancel_large_file\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of unfinished large files and optional continuation token.\n */\n async listUnfinishedLargeFiles(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_list_unfinished_large_files\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of uploaded parts and optional continuation token.\n */\n async listParts(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_parts\", request);\n }\n // --- Downloads ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}.\n * @param downloadUrl - The B2 download base URL.\n * @param authToken - The authorization token.\n * @param fileId - The unique identifier of the file to download.\n * @param options - Optional download parameters for range requests and cancellation.\n *\n * @returns The response headers, streaming body, and HTTP status code.\n */\n async downloadFileById(downloadUrl, authToken, fileId, options) {\n const headers = buildDownloadRequestHeaders(authToken, options);\n const url = appendDownloadOverrides(\n `${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`,\n options\n );\n const response = await this.transport.send({\n url,\n method: options?.method ?? \"GET\",\n headers,\n ...options?.signal !== void 0 ? { signal: options.signal } : {}\n });\n return { headers: response.headers, body: response.body, status: response.status };\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}.\n * @param downloadUrl - The B2 download base URL.\n * @param authToken - The authorization token.\n * @param bucketName - The name of the bucket containing the file.\n * @param fileName - The name of the file to download.\n * @param options - Optional download parameters for range requests and cancellation.\n *\n * @returns The response headers, streaming body, and HTTP status code.\n */\n async downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) {\n const headers = buildDownloadRequestHeaders(authToken, options);\n const url = appendDownloadOverrides(\n `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileName(fileName)}`,\n options\n );\n const response = await this.transport.send({\n url,\n method: options?.method ?? \"GET\",\n headers,\n ...options?.signal !== void 0 ? { signal: options.signal } : {}\n });\n return { headers: response.headers, body: response.body, status: response.status };\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The current session authorization token.\n * @param request - The API request parameters.\n *\n * @returns The download authorization token for the specified file prefix.\n */\n async getDownloadAuthorization(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_download_authorization\",\n request\n );\n }\n // --- Keys ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The newly created application key with secret.\n */\n async createKey(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_create_key\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The list of application keys and optional continuation token.\n */\n async listKeys(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_list_keys\", request);\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The deleted application key metadata.\n */\n async deleteKey(apiUrl, authToken, request) {\n return this.postJson(apiUrl, authToken, \"b2_delete_key\", request);\n }\n // --- Retention / Legal Hold ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated file retention settings.\n */\n async updateFileRetention(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_update_file_retention\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated file legal hold status.\n */\n async updateFileLegalHold(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_update_file_legal_hold\",\n request\n );\n }\n // --- Notifications ---\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The configured event notification rules for the specified bucket.\n */\n async getBucketNotificationRules(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_get_bucket_notification_rules\",\n request\n );\n }\n /**\n * Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param request - The API request parameters.\n *\n * @returns The updated bucket notification rules.\n */\n async setBucketNotificationRules(apiUrl, authToken, request) {\n return this.postJson(\n apiUrl,\n authToken,\n \"b2_set_bucket_notification_rules\",\n request\n );\n }\n // --- Internal ---\n /**\n * Sends a JSON POST request to the specified B2 API endpoint.\n * @param apiUrl - The B2 API base URL.\n * @param authToken - The authorization token.\n * @param endpoint - The B2 API endpoint name.\n * @param body - The JSON request body.\n *\n * @returns The parsed JSON response.\n */\n async postJson(apiUrl, authToken, endpoint, body) {\n const response = await this.transport.send({\n url: `${apiUrl}/b2api/v3/${endpoint}`,\n method: \"POST\",\n headers: {\n Authorization: authToken,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(body)\n });\n return response.json();\n }\n}\nfunction applyEncryptionHeaders(headers, encryption) {\n if (!encryption || encryption.mode === EncryptionMode.None) return;\n if (encryption.mode === EncryptionMode.SseB2) {\n headers[\"X-Bz-Server-Side-Encryption\"] = EncryptionAlgorithm.Aes256;\n } else if (encryption.mode === EncryptionMode.SseC) {\n headers[\"X-Bz-Server-Side-Encryption-Customer-Algorithm\"] = EncryptionAlgorithm.Aes256;\n headers[\"X-Bz-Server-Side-Encryption-Customer-Key\"] = encryption.customerKey;\n headers[\"X-Bz-Server-Side-Encryption-Customer-Key-Md5\"] = encryption.customerKeyMd5;\n }\n}\nconst DOWNLOAD_OVERRIDE_PARAMS = [\n \"b2ContentDisposition\",\n \"b2ContentLanguage\",\n \"b2ContentEncoding\",\n \"b2ContentType\",\n \"b2CacheControl\",\n \"b2Expires\"\n];\nfunction buildDownloadRequestHeaders(authToken, options) {\n const headers = { Authorization: authToken };\n if (options?.range) headers[\"Range\"] = options.range;\n if (options?.serverSideEncryption) {\n applyEncryptionHeaders(headers, {\n mode: EncryptionMode.SseC,\n ...options.serverSideEncryption\n });\n }\n return headers;\n}\nfunction appendDownloadOverrides(url, options) {\n if (!options) return url;\n const params = [];\n for (const key of DOWNLOAD_OVERRIDE_PARAMS) {\n const value = options[key];\n if (value !== void 0) {\n params.push(`${key}=${encodeURIComponent(value)}`);\n }\n }\n if (params.length === 0) return url;\n const separator = url.includes(\"?\") ? \"&\" : \"?\";\n return `${url}${separator}${params.join(\"&\")}`;\n}\nfunction applyRetentionHeaders(headers, retention) {\n if (!retention) return;\n if (retention.mode) {\n headers[\"X-Bz-File-Retention-Mode\"] = retention.mode;\n }\n if (retention.retainUntilTimestamp) {\n headers[\"X-Bz-File-Retention-Retain-Until-Timestamp\"] = String(retention.retainUntilTimestamp);\n }\n}\nfunction applyLegalHoldHeader(headers, legalHold) {\n if (!legalHold) return;\n headers[\"X-Bz-File-Legal-Hold\"] = legalHold;\n}\nexport {\n RawClient,\n buildFileInfoHeaders,\n decodeFileName,\n encodeFileName,\n parseFileInfoHeaders\n};\n//# sourceMappingURL=index.js.map\n","import { InMemoryAccountInfo } from \"./auth/in-memory.js\";\nimport { getRealmUrl } from \"./auth/realms.js\";\nimport { Bucket } from \"./bucket.js\";\nimport { FetchTransport, RetryTransport } from \"./http/transport.js\";\nimport { UrlGuard, deriveAllowedSuffixes } from \"./http/url-guard.js\";\nimport { RawClient } from \"./raw/index.js\";\nimport { accountId } from \"./types/ids.js\";\nimport { DEFAULT_PAGE_SIZE } from \"./util/defaults.js\";\nimport { paginateItems } from \"./util/paginator.js\";\nclass B2Client {\n /** Low-level client for direct B2 API calls. */\n raw;\n /** Authorization state storage (tokens, URLs, capabilities). */\n accountInfo;\n /**\n * SSRF allow-list applied by the default {@link FetchTransport}. `null` when\n * a custom transport was supplied — in that case the SDK does not own the\n * guard. Locked down by {@link B2Client.authorize}.\n */\n urlGuard;\n applicationKeyId;\n applicationKey;\n realmUrl;\n userAllowedSuffixes;\n /**\n * Creates a new B2Client. Call {@link authorize} before making API requests.\n * @param options - Configuration including credentials, realm, and transport settings.\n */\n constructor(options) {\n this.applicationKeyId = options.applicationKeyId;\n this.applicationKey = options.applicationKey;\n this.realmUrl = getRealmUrl(options.realm ?? \"production\");\n this.accountInfo = options.accountInfo ?? new InMemoryAccountInfo();\n this.userAllowedSuffixes = options.allowedHostSuffixes;\n let baseTransport;\n if (options.transport !== void 0) {\n baseTransport = options.transport;\n this.urlGuard = null;\n } else {\n const urlGuard = new UrlGuard();\n baseTransport = new FetchTransport({\n urlGuard,\n ...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {}\n });\n this.urlGuard = urlGuard;\n }\n const retryTransport = new RetryTransport({\n transport: baseTransport,\n ...options.retry !== void 0 ? { retry: options.retry } : {},\n onReauth: () => this.reauthorize()\n });\n this.raw = new RawClient({ transport: retryTransport });\n }\n /**\n * Authenticates with B2 and stores the authorization state. Must be called before other methods.\n *\n * @returns The authorization response containing tokens, URLs, and capabilities.\n */\n async authorize() {\n const auth = await this.raw.authorizeAccount(\n this.applicationKeyId,\n this.applicationKey,\n this.realmUrl\n );\n this.accountInfo.setAuth(auth);\n if (this.urlGuard !== null) {\n const derived = deriveAllowedSuffixes(auth.apiInfo.storageApi);\n const merged = this.userAllowedSuffixes !== void 0 ? Array.from(/* @__PURE__ */ new Set([...derived, ...this.userAllowedSuffixes])) : derived;\n this.urlGuard.setAllowedSuffixes(merged);\n }\n return auth;\n }\n /**\n * Refresh credentials after a 401. Returns the fresh auth token so\n * {@link RetryTransport} can rewrite the in-flight request's\n * Authorization header before retrying.\n *\n * @returns The fresh authorization token.\n */\n async reauthorize() {\n this.accountInfo.clear();\n const auth = await this.authorize();\n return auth.authorizationToken;\n }\n /**\n * Creates a new B2 bucket.\n * @param options - Bucket configuration including name, type, and optional settings.\n *\n * @returns A {@link Bucket} handle for the newly created bucket.\n */\n async createBucket(options) {\n const request = {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n };\n const info = await this.raw.createBucket(\n this.accountInfo.getApiUrl(),\n this.accountInfo.getAuthToken(),\n request\n );\n return new Bucket(this, info);\n }\n /**\n * Lists buckets in the account, optionally filtered by ID, name, or type.\n * @param options - Optional filters for bucket ID, name, or type.\n *\n * @returns An array of {@link Bucket} handles.\n */\n async listBuckets(options) {\n const resp = await this.raw.listBuckets(\n this.accountInfo.getApiUrl(),\n this.accountInfo.getAuthToken(),\n {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n }\n );\n return resp.buckets.map((info) => new Bucket(this, info));\n }\n /**\n * Looks up a single bucket by name.\n * @param bucketName - The name of the bucket to find.\n *\n * @returns The {@link Bucket} handle, or `null` if not found.\n */\n async getBucket(bucketName) {\n const buckets = await this.listBuckets({ bucketName });\n return buckets[0] ?? null;\n }\n /**\n * Permanently deletes a bucket. The bucket must be empty.\n * @param id - The unique identifier of the bucket to delete.\n *\n * @returns The deleted bucket metadata.\n */\n async deleteBucket(id) {\n return this.raw.deleteBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n bucketId: id\n });\n }\n /**\n * Creates a new application key with the specified capabilities.\n * @param options - Key configuration including capabilities, name, and optional restrictions.\n *\n * @returns The full key including the secret (only returned at creation time).\n */\n async createKey(options) {\n return this.raw.createKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options\n });\n }\n /**\n * Lists application keys in the account.\n * @param options - Optional pagination settings.\n *\n * @returns A page of application keys with an optional continuation token.\n */\n async listKeys(options) {\n return this.raw.listKeys(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n accountId: accountId(this.accountInfo.getAccountId()),\n ...options?.pageSize !== void 0 ? { maxKeyCount: options.pageSize } : {},\n ...options?.startApplicationKeyId !== void 0 ? { startApplicationKeyId: options.startApplicationKeyId } : {}\n });\n }\n /**\n * Async iterator that yields every application key on the account,\n * automatically handling pagination via `listKeys`.\n *\n * @param options - Pagination + abort options. `pageSize` is forwarded\n * to `maxKeyCount`; the default is 1000.\n *\n * @returns An async iterable of {@link ApplicationKey} entries.\n *\n * @example\n * ```ts\n * for await (const key of client.paginateKeys()) {\n * console.log(key.keyName, key.capabilities)\n * }\n * ```\n */\n paginateKeys(options) {\n return paginateItems(\n async (cursor) => {\n const resp = await this.listKeys({\n pageSize: options?.pageSize ?? DEFAULT_PAGE_SIZE,\n ...cursor !== void 0 ? { startApplicationKeyId: cursor } : {}\n });\n return { page: resp, nextCursor: resp.nextApplicationKeyId ?? void 0 };\n },\n (page) => page.keys,\n options?.signal\n );\n }\n /**\n * Permanently deletes an application key.\n * @param applicationKeyId - The unique identifier of the key to delete.\n *\n * @returns The deleted application key metadata.\n */\n async deleteKey(applicationKeyId) {\n return this.raw.deleteKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n applicationKeyId\n });\n }\n /**\n * Checks whether the authorized application key carries every capability in\n * `needed`. Returns the missing capabilities so callers can fail fast with a\n * clear error instead of a generic 401/403 from the server.\n *\n * @param needed - The capabilities required by the planned operation.\n *\n * @returns An object with `ok: true` when every needed capability is\n * present, otherwise `{ ok: false, missing: [...] }`.\n *\n * @throws If {@link authorize} has not been called yet.\n */\n hasCapabilities(needed) {\n const auth = this.accountInfo.getAuth();\n if (!auth) throw new Error(\"Not authorized. Call authorize() first.\");\n const available = new Set(auth.apiInfo.storageApi.allowed.capabilities);\n const missing = needed.filter((cap) => !available.has(cap));\n return { ok: missing.length === 0, missing };\n }\n}\nexport {\n B2Client\n};\n//# sourceMappingURL=client.js.map\n","import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Action version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync: bumping `version` in package.json\n * automatically propagates here, into the User-Agent header, and into the\n * bundled `dist/index.js`.\n *\n * Works because:\n * - Node 22+ supports native JSON import attributes.\n * - ncc / webpack statically inlines the JSON at bundle time, so the\n * runtime artifact has the version baked in as a string literal.\n * - TypeScript's `resolveJsonModule` makes the import type-safe.\n */\nexport const VERSION: string = pkg.version\n","import * as core from '@actions/core'\nimport type { AuthorizeAccountResponse, FileVersion } from '@backblaze-labs/b2-sdk'\nimport {\n B2Client,\n type Bucket,\n type HttpTransport,\n InMemoryAccountInfo,\n} from '@backblaze-labs/b2-sdk'\nimport { VERSION } from './version.ts'\n\n/**\n * An authorized B2Client paired with the bucket name the action is scoped\n * to. Returned by {@link buildClient}; consumed by command dispatch sites\n * that need either the high-level client (cross-bucket copy, presign) or\n * the resolved bucket (via {@link getBucket}).\n */\nexport interface AuthorizedClient {\n /** The authorized SDK client. `client.accountInfo` is populated. */\n client: B2Client\n /** The destination bucket name as provided to the action's `bucket` input. */\n bucketName: string\n}\n\n/** Inputs to {@link buildClient}. */\nexport interface BuildClientOptions {\n /** B2 application key ID. Masked via `core.setSecret` by the dispatcher (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked via `core.setSecret` by the dispatcher. */\n applicationKey: string\n /** Target bucket name (stored on the result for later `getBucket` resolution). */\n bucket: string\n /** Override the default B2 realm endpoint. Only set for staging / custom realms. */\n endpoint?: string | undefined\n /** Inject a custom transport (used by tests with the SDK's `B2Simulator`). */\n transport?: HttpTransport | undefined\n}\n\nfunction maskAccountAuthToken(token: string | null | undefined): void {\n if (token) core.setSecret(token)\n}\n\nclass SecretMaskingAccountInfo extends InMemoryAccountInfo {\n // The SDK routes authorize() and transparent reauthorize() through the\n // supplied AccountInfo.setAuth. The reauth masking test is the CI guard for\n // this SDK coupling when the dependency is bumped.\n override setAuth(auth: AuthorizeAccountResponse): void {\n maskAccountAuthToken(auth.authorizationToken)\n super.setAuth(auth)\n }\n}\n\n/**\n * Build an authorized B2Client.\n *\n * Steps:\n * 1. Construct the client with `userAgent: 'b2-github-action/'`. The\n * SDK preserves its own `b2-sdk-typescript/` and `@backblaze-labs/b2-sdk` tokens before\n * ours so Backblaze server-side logs see both attribution layers.\n * 2. `await client.authorize()`. This is one-shot for the lifetime of the\n * action invocation. B2 auth tokens carry a 24h TTL; typical GitHub\n * Actions runs finish well inside that window. If a long-running job\n * outlives the token, the SDK transparently re-authorizes on the next\n * 401, so the action layer does not need its own refresh loop.\n * 3. Use an AccountInfo wrapper that masks each account authorization token\n * as it is stored, including SDK-driven reauthorization after token\n * expiry. The post-authorize mask is kept as a fallback in case a future\n * SDK version bypasses the wrapper for initial authorization.\n *\n * The `transport` parameter is only used by tests (the SDK's B2Simulator\n * provides one). Production callers leave it undefined to use the SDK's\n * default FetchTransport with its built-in SSRF guard.\n */\nexport async function buildClient(options: BuildClientOptions): Promise {\n const userAgent = `b2-github-action/${VERSION}`\n\n const client = new B2Client({\n applicationKeyId: options.applicationKeyId,\n applicationKey: options.applicationKey,\n accountInfo: new SecretMaskingAccountInfo(),\n userAgent,\n ...(options.transport !== undefined ? { transport: options.transport } : {}),\n ...(options.endpoint !== undefined ? { realm: options.endpoint } : {}),\n })\n\n await client.authorize()\n // Deliberately overlaps with setAuth for initial auth. If a future SDK\n // changes authorize() storage, the public AccountInfo getter still masks the\n // stored account token before command code can log.\n maskAccountAuthToken(client.accountInfo.getAuthToken())\n\n return { client, bucketName: options.bucket }\n}\n\n/**\n * Resolve a bucket by name. Throws a clear error rather than the SDK's\n * `undefined` return so the workflow log surfaces the misconfiguration.\n */\nexport async function getBucket(authorized: AuthorizedClient) {\n const bucket = await authorized.client.getBucket(authorized.bucketName)\n if (!bucket) {\n throw new Error(\n `Bucket \"${authorized.bucketName}\" not found, or the application key lacks listBuckets capability for it.`,\n )\n }\n return bucket\n}\n\n/**\n * Resolve an exact file name only when its latest version is an upload. If the\n * latest exact-name version is a hide marker, this intentionally reports the\n * file as not found instead of selecting an older upload from version history\n * or revealing hidden-object existence in default workflow logs. Throws when\n * the latest exact-name state is hidden, deleted, or absent. Used by `copy`,\n * `delete`, and `retention` to resolve a file name to a `fileId` before\n * operating on it.\n *\n * Consistency assumption: B2's `listFileNames` is read-after-write consistent\n * for a recently-uploaded file in the same region. The simulator returns\n * uploads immediately; production B2 in practice does the same, but a caller\n * that chains \"upload then operate on the same name\" across two action steps\n * is relying on observed behavior rather than a documented SLA.\n *\n * @param bucket - The bucket to search.\n * @param fileName - Exact file name (path) to look up.\n * @param bucketDisplayName - Optional label for the error message; defaults\n * to `bucket.name`. Used when looking up in a source bucket distinct from\n * the action's destination bucket (cross-bucket copy).\n */\nexport async function findFileByName(\n bucket: Bucket,\n fileName: string,\n bucketDisplayName?: string,\n): Promise {\n const display = bucketDisplayName ?? bucket.name\n const page = await bucket.listFileNames({ prefix: fileName, pageSize: 1 })\n const exactLatest = page.files.find((f) => f.fileName === fileName)\n if (exactLatest?.action === 'upload') return exactLatest\n\n throw new Error(`File not found in bucket \"${display}\": ${fileName}`)\n}\n","import { Buffer } from 'node:buffer'\nimport { createHash } from 'node:crypto'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { SSE_B2, sseCustomer } from '@backblaze-labs/b2-sdk'\n\nconst CANONICAL_BASE64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/\n\n/**\n * Parse the `sse` input into an SDK {@link EncryptionSetting}.\n *\n * Accepted forms:\n * - `undefined` / empty → no encryption setting passed (B2 still applies any\n * bucket-default SSE-B2; we just don't override it).\n * - `\"B2\"` (case-insensitive) → SSE-B2 with the B2-managed key (no cost).\n * - `\"C:\"` → SSE-C with a customer-provided key. We\n * compute the required base64 MD5 internally so the workflow author\n * doesn't have to.\n *\n * The action runs in Node only, so we use `node:crypto.createHash('md5')`\n * directly rather than the SDK's isomorphic key wrapper. We deliberately do\n * NOT log the key bytes; the only place they ever go is into the\n * `customerKey` field of the SDK setting which the SDK marks as a secret in\n * any error / debug output.\n */\nexport function parseSse(raw: string | undefined): EncryptionSetting | undefined {\n if (raw === undefined || raw === '') return undefined\n\n const normalized = raw.trim()\n if (normalized.toUpperCase() === 'B2') return SSE_B2\n\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n const base64Key = normalized.slice(2).trim()\n if (base64Key === '') {\n throw new Error(\"SSE-C key is empty. Use 'C:'.\")\n }\n // Node's `Buffer.from(str, 'base64')` silently drops invalid chars instead\n // of throwing, so validate the canonical alphabet and padding first.\n if (!CANONICAL_BASE64.test(base64Key)) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const keyBytes = Buffer.from(base64Key, 'base64')\n if (keyBytes.byteLength !== 32) {\n throw new Error(\n `SSE-C key must decode to exactly 32 bytes (256 bits); got ${keyBytes.byteLength}.`,\n )\n }\n const customerKey = keyBytes.toString('base64')\n if (customerKey !== base64Key) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const customerKeyMd5 = createHash('md5').update(keyBytes).digest('base64')\n return sseCustomer(customerKey, customerKeyMd5)\n }\n\n throw new Error(`Invalid 'sse' input: \"${raw}\". Expected \"B2\" or \"C:\".`)\n}\n","import * as core from '@actions/core'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { parseSse } from './sse.ts'\n\n/**\n * Discriminator the action's dispatcher switches on. Matches the values\n * accepted by the `action:` input in `action.yml`. Adding a new verb\n * requires updating this union, the runtime `VALID_ACTIONS` list,\n * `ACTION_EFFECTS`, the dispatcher in `src/main.ts`, and the documentation\n * surfaces.\n */\nexport type ActionName =\n | 'upload'\n | 'download'\n | 'sync'\n | 'copy'\n | 'delete'\n | 'presign'\n | 'list'\n | 'hide'\n | 'unhide'\n | 'verify'\n | 'retention'\n | 'head'\n | 'purge'\n\nconst VALID_ACTIONS: readonly ActionName[] = [\n 'upload',\n 'download',\n 'sync',\n 'copy',\n 'delete',\n 'presign',\n 'list',\n 'hide',\n 'unhide',\n 'verify',\n 'retention',\n 'head',\n 'purge',\n]\n\ntype ActionEffect = {\n readonly kind: 'read' | 'write'\n readonly honorsDryRun: boolean\n}\n\n/**\n * Runtime side-effect policy for each action verb.\n *\n * @internal\n */\nexport const ACTION_EFFECTS = {\n upload: { kind: 'write', honorsDryRun: false },\n download: { kind: 'read', honorsDryRun: false },\n sync: { kind: 'write', honorsDryRun: true },\n copy: { kind: 'write', honorsDryRun: false },\n delete: { kind: 'write', honorsDryRun: true },\n presign: { kind: 'read', honorsDryRun: false },\n list: { kind: 'read', honorsDryRun: false },\n hide: { kind: 'write', honorsDryRun: false },\n unhide: { kind: 'write', honorsDryRun: false },\n verify: { kind: 'read', honorsDryRun: false },\n retention: { kind: 'write', honorsDryRun: false },\n head: { kind: 'read', honorsDryRun: false },\n purge: { kind: 'write', honorsDryRun: true },\n} as const satisfies Record\n\n/** How `sync` decides whether two files match. Drives the SDK's `synchronize()`. */\nexport type CompareMode = 'modtime' | 'size' | 'none'\n/** What `sync` does with destination-only files when reconciling. */\nexport type KeepMode = 'no-delete' | 'delete' | 'keep-days'\n/** Direction of a `sync`: `auto` infers from whether `source` is local or remote. */\nexport type SyncDirection = 'auto' | 'up' | 'down'\n/** B2 Object Lock retention mode. `none` clears any prior retention. */\nexport type RetentionMode = 'compliance' | 'governance' | 'none'\n/** B2 Object Lock legal-hold state. */\nexport type LegalHold = 'on' | 'off'\n\nconst VALID_COMPARE: readonly CompareMode[] = ['modtime', 'size', 'none']\nconst VALID_KEEP: readonly KeepMode[] = ['no-delete', 'delete', 'keep-days']\nconst VALID_DIRECTION: readonly SyncDirection[] = ['auto', 'up', 'down']\nconst VALID_RETENTION_MODE: readonly RetentionMode[] = ['compliance', 'governance', 'none']\nconst VALID_LEGAL_HOLD: readonly LegalHold[] = ['on', 'off']\nconst APPLICATION_KEY_ID_ENV = 'B2_APPLICATION_KEY_ID'\nconst APPLICATION_KEY_ENV = 'B2_APPLICATION_KEY'\n\n/**\n * The fully-parsed, fully-validated action surface. Built by\n * {@link parseInputs} from `INPUT_*` env vars (via `@actions/core`); every\n * command in `src/commands/` consumes a frozen instance of this shape.\n *\n * Most fields map 1:1 to inputs declared in `action.yml`. Defaults and\n * optionality match the YAML surface; see `action.yml` for the user-facing\n * documentation per input.\n */\nexport interface ParsedInputs {\n /** Which verb to dispatch to. */\n action: ActionName\n /** B2 application key ID. Masked at parse time via `core.setSecret` (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked at parse time via `core.setSecret`. */\n applicationKey: string\n /** Destination bucket name for the action. */\n bucket: string\n /** Cross-bucket `copy` source bucket. Undefined means same-bucket copy. */\n sourceBucket: string | undefined\n /**\n * Verb-dependent source. Upload/sync: a local path or glob. Download/copy/\n * delete/presign/list/hide/unhide/verify/retention/head/purge: a B2 file\n * name or prefix (trailing `/` means prefix mode for verbs that support it).\n */\n source: string | undefined\n /**\n * Verb-dependent destination. Upload/sync: B2 file name or prefix.\n * Download: local path. Copy: destination file name. Other verbs: ignored.\n */\n destination: string | undefined\n /** Glob patterns to include during upload/sync expansion. */\n include: string[]\n /** Glob patterns to exclude during upload/sync expansion. Default: `.git/**`. */\n exclude: string[]\n /** Parallel parts/files for upload/sync. */\n concurrency: number\n /** Multipart part size in bytes. Undefined defers to the SDK's recommendation. */\n partSize: number | undefined\n /** Resume an in-progress multipart upload. */\n resume: boolean\n /** Content-Type to set on uploaded objects. Undefined leaves B2's auto-detect. */\n contentType: string | undefined\n /** Response Content-Disposition override for `download` and `presign`. */\n responseContentDisposition: string | undefined\n /** Response Content-Type override for `download` and `presign`. */\n responseContentType: string | undefined\n /** Response Cache-Control override for `download` and `presign`. */\n responseCacheControl: string | undefined\n /** Preview without executing (sync/delete/purge). */\n dryRun: boolean\n /** Permit whole-bucket purge when `source` is empty or `/`. */\n allowBucketPurge: boolean\n /** Presigned-URL TTL in seconds. */\n presignTtlSeconds: number\n /** Override B2 realm endpoint for staging / custom realms. */\n endpoint: string | undefined\n /** Fail the action when upload/sync matches zero files. */\n failOnEmpty: boolean\n /** Raw `sse:` input value as the user typed it. Retained for diagnostics. */\n sse: string | undefined\n /** Parsed SSE specification ready to hand to the SDK. */\n encryption: EncryptionSetting | undefined\n /** How `sync` compares files. */\n compareMode: CompareMode\n /** How `sync` treats destination-only files. */\n keepMode: KeepMode\n /** Direction of a `sync` (auto-detected when set to `auto`). */\n syncDirection: SyncDirection\n /** Cap on listed/presigned entries for `list` and prefix `presign`. */\n maxResults: number\n /** Literal SHA-1 to compare against in `verify` (when set, no local read). */\n expectedSha1: string | undefined\n /** Object Lock retention mode to apply (`retention` verb). */\n retentionMode: RetentionMode | undefined\n /** ISO-8601 timestamp until which retention applies. Required with `retentionMode`. */\n retentionUntil: string | undefined\n /** Legal-hold state to apply (`retention` verb). */\n legalHold: LegalHold | undefined\n /** Allow shortening a governance-mode retention (requires key capability). */\n bypassGovernance: boolean\n}\n\n/**\n * Sensitive raw values that can appear in parser-scope errors before\n * {@link parseInputs} returns its structured output.\n */\nexport function collectInputSecretsForScrubbing(): string[] {\n const secretValues = new Set()\n addSecretValue(secretValues, core.getInput('application-key-id'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ID_ENV])\n addSecretValue(secretValues, core.getInput('application-key'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ENV])\n addSseSecretValue(secretValues, core.getInput('sse'))\n return [...secretValues]\n}\n\n/**\n * Parse and validate inputs.\n *\n * Credentials lookup order:\n *\n * 1. `application-key-id` / `application-key` action inputs\n * 2. `B2_APPLICATION_KEY_ID` / `B2_APPLICATION_KEY` env vars (the official\n * contract used by the Backblaze b2 CLI and the @backblaze-labs/b2-sdk).\n *\n * The credential value, once resolved, is immediately masked via `core.setSecret`\n * so any accidental echo (including from a misbehaving sub-process) is redacted\n * in workflow logs.\n */\nexport function parseInputs(): ParsedInputs {\n const action = parseEnum('action', required('action').toLowerCase(), VALID_ACTIONS)\n\n const applicationKeyId = resolveCredential('application-key-id', APPLICATION_KEY_ID_ENV)\n const applicationKey = resolveCredential('application-key', APPLICATION_KEY_ENV)\n // The keyId is identifying (not the secret half of the HMAC pair), but mask\n // it anyway for defense in depth: the canonical AWS analogue mask AKIA-style\n // IDs in CI logs, and masking costs nothing in debuggability since the user\n // already knows which key they passed.\n core.setSecret(applicationKeyId)\n core.setSecret(applicationKey)\n\n const bucket = required('bucket')\n const sourceBucket = optional('source-bucket')\n const allowBucketPurge = parseBool(\n 'allow-bucket-purge',\n core.getInput('allow-bucket-purge') || 'false',\n )\n const source = optionalSource(action, allowBucketPurge)\n const destination = optional('destination')\n\n const include = splitCsv(optional('include'))\n const exclude = splitCsv(optional('exclude'))\n\n const concurrency = parsePositiveInt('concurrency', core.getInput('concurrency') || '4')\n const partSizeInput = optional('part-size')\n const partSize =\n partSizeInput !== undefined ? parsePositiveInt('part-size', partSizeInput) : undefined\n\n const resume = parseBool('resume', core.getInput('resume') || 'true')\n const dryRun = parseBool('dry-run', core.getInput('dry-run') || 'false')\n const failOnEmpty = parseBool('fail-on-empty', core.getInput('fail-on-empty') || 'true')\n const bypassGovernance = parseBool(\n 'bypass-governance',\n core.getInput('bypass-governance') || 'false',\n )\n\n const presignTtlSeconds = parsePositiveInt('presign-ttl', core.getInput('presign-ttl') || '3600')\n const maxResults = parsePositiveInt('max-results', core.getInput('max-results') || '1000')\n\n const contentType = optional('content-type')\n const responseContentDisposition = optional('response-content-disposition')\n const responseContentType = optional('response-content-type')\n const responseCacheControl = optional('response-cache-control')\n const endpoint = optional('endpoint')\n const sse = optional('sse')\n const encryption = parseSse(sse)\n const expectedSha1 = optional('expected-sha1')\n const retentionUntil = optional('retention-until')\n\n const compareMode = parseEnum(\n 'compare-mode',\n (core.getInput('compare-mode') || 'modtime').toLowerCase(),\n VALID_COMPARE,\n )\n const keepMode = parseEnum(\n 'keep-mode',\n (core.getInput('keep-mode') || 'no-delete').toLowerCase(),\n VALID_KEEP,\n )\n const syncDirection = parseEnum(\n 'direction',\n (core.getInput('direction') || 'auto').toLowerCase(),\n VALID_DIRECTION,\n )\n const retentionMode = parseOptionalEnum(\n 'retention-mode',\n optional('retention-mode')?.toLowerCase(),\n VALID_RETENTION_MODE,\n )\n const legalHold = parseOptionalEnum(\n 'legal-hold',\n optional('legal-hold')?.toLowerCase(),\n VALID_LEGAL_HOLD,\n )\n\n return {\n action,\n applicationKeyId,\n applicationKey,\n bucket,\n sourceBucket,\n source,\n destination,\n include,\n exclude,\n concurrency,\n partSize,\n resume,\n contentType,\n responseContentDisposition,\n responseContentType,\n responseCacheControl,\n dryRun,\n allowBucketPurge,\n presignTtlSeconds,\n endpoint,\n failOnEmpty,\n sse,\n encryption,\n compareMode,\n keepMode,\n syncDirection,\n maxResults,\n expectedSha1,\n retentionMode,\n retentionUntil,\n legalHold,\n bypassGovernance,\n }\n}\n\n/**\n * Validate that `inputs.source` is set and non-empty, returning the value.\n * Throws a uniform error message naming the verb so the workflow log surfaces\n * exactly what's missing. Commands that allow an empty-string source for\n * special semantics (e.g. `purge` with explicit whole-bucket scope) should\n * not use this helper.\n */\nexport function requireSource(\n source: string | undefined,\n verb: string,\n description?: string,\n): string {\n if (source === undefined || source === '') {\n const tail = description !== undefined ? ` (${description})` : ''\n throw new Error(`'source' input is required for '${verb}' action${tail}`)\n }\n return source\n}\n\n/**\n * Validate that `raw` is one of `valid`, narrowing the return type.\n *\n * Replaces the previous pattern of one type-guard + one throw per enum:\n *\n * const x = parseEnum('compare-mode', raw, VALID_COMPARE)\n *\n * Throws a uniform error message that lists the legal values.\n *\n * @internal\n */\nexport function parseEnum(name: string, raw: string, valid: readonly T[]): T {\n if ((valid as readonly string[]).includes(raw)) return raw as T\n throw new Error(`Invalid '${name}' input: \"${raw}\". Must be one of: ${valid.join(', ')}`)\n}\n\n/**\n * Like {@link parseEnum} but passes through `undefined`. Used for inputs that\n * are optional but, when set, must be one of a known set.\n */\nfunction parseOptionalEnum(\n name: string,\n raw: string | undefined,\n valid: readonly T[],\n): T | undefined {\n return raw === undefined ? undefined : parseEnum(name, raw, valid)\n}\n\nfunction required(name: string): string {\n // `@actions/core` throws on missing required inputs, so this never returns\n // empty. Wrapping the call only exists so the throw site has a uniform\n // shape with the rest of the input parsers.\n return core.getInput(name, { required: true })\n}\n\nfunction optional(name: string): string | undefined {\n const v = core.getInput(name)\n return v === '' ? undefined : v\n}\n\nfunction optionalSource(action: ActionName, allowBucketPurge: boolean): string | undefined {\n const v = core.getInput('source')\n if (v !== '') return v\n return action === 'purge' && allowBucketPurge ? '' : undefined\n}\n\nfunction addSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined || value === '') return\n const trimmed = value.trim()\n for (const secret of new Set([value, trimmed])) {\n if (secret === '' || secretValues.has(secret)) continue\n core.setSecret(secret)\n secretValues.add(secret)\n }\n}\n\nfunction addSseSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined) return\n const normalized = value.trim()\n if (normalized === '' || normalized.toUpperCase() === 'B2') return\n\n addSecretValue(secretValues, value)\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n addSecretValue(secretValues, normalized.slice(2).trim())\n }\n}\n\nfunction resolveCredential(inputName: string, envName: string): string {\n const fromInput = optional(inputName)\n if (fromInput !== undefined) return fromInput\n\n const fromEnv = process.env[envName]\n if (fromEnv !== undefined && fromEnv !== '') return fromEnv\n\n throw new Error(`Missing credential: set input '${inputName}' or env var '${envName}'`)\n}\n\n/**\n * Parse a comma-separated action input, trimming entries and dropping blanks.\n *\n * @internal\n */\nexport function splitCsv(value: string | undefined): string[] {\n if (value === undefined) return []\n return value\n .split(',')\n .map((s) => s.trim())\n .filter((s) => s.length > 0)\n}\n\n/**\n * Parse the documented boolean input spellings accepted by this action.\n *\n * @internal\n */\nexport function parseBool(name: string, raw: string): boolean {\n const v = raw.trim().toLowerCase()\n if (v === 'true' || v === '1' || v === 'yes') return true\n if (v === 'false' || v === '0' || v === 'no') return false\n throw new Error(`Invalid boolean for '${name}': \"${raw}\"`)\n}\n\n/**\n * Parse a strictly positive integer input.\n *\n * @internal\n */\nexport function parsePositiveInt(name: string, raw: string): number {\n const trimmed = raw.trim()\n const n = Number(trimmed)\n if (!/^\\d+$/.test(trimmed) || n <= 0 || !Number.isSafeInteger(n)) {\n throw new Error(`Invalid positive integer for '${name}': \"${raw}\"`)\n }\n return n\n}\n","import * as core from '@actions/core'\nimport type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link copyCommand}. Single-file (copy is always one-source-one-destination). */\nexport interface CopyResult {\n /** Source bucket name. */\n sourceBucket: string\n /** Source file name (the B2 key in the source bucket). */\n sourceFileName: string\n /** Destination bucket name. */\n destinationBucket: string\n /** Destination file name (the B2 key in the destination bucket). */\n destinationFileName: string\n /** B2 file ID of the newly-created destination object. */\n fileId: string\n /** Byte size of the copied object. */\n size: number\n}\n\n/**\n * Server-side copy of one B2 object to a new name, within the same bucket or\n * across two buckets in the same account.\n *\n * The copy is done by reference (`b2_copy_file` for small, `b2_copy_part` for\n * large): bytes never traverse the runner. This is dramatically faster and\n * cheaper than download-then-reupload for any non-trivial file.\n *\n * Cross-bucket: set `source-bucket` to the source bucket name. The action's\n * `bucket` input is the destination. The application key must have read\n * permission on the source bucket and write permission on the destination.\n */\nexport async function copyCommand(\n client: B2Client,\n destinationBucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'copy', 'the source B2 file name')\n const destination = inputs.destination\n if (destination === undefined || destination === '') {\n throw new Error(\n \"'destination' input is required for 'copy' action (the destination B2 file name)\",\n )\n }\n\n const sourceBucketName = inputs.sourceBucket ?? destinationBucket.name\n const sourceBucket =\n sourceBucketName === destinationBucket.name\n ? destinationBucket\n : await client.getBucket(sourceBucketName)\n if (!sourceBucket) {\n throw new Error(`Source bucket \"${sourceBucketName}\" not found, or key lacks listBuckets.`)\n }\n\n const hit = await findFileByName(sourceBucket, source, sourceBucketName)\n\n core.startGroup(\n `copy b2://${sourceBucketName}/${source} → b2://${destinationBucket.name}/${destination}`,\n )\n try {\n const recommendedPartSize = client.accountInfo.getRecommendedPartSize()\n const isLarge = hit.contentLength > recommendedPartSize\n const copyOptions = {\n sourceFileId: hit.fileId,\n fileName: destination,\n ...(sourceBucketName !== destinationBucket.name\n ? { destinationBucketId: destinationBucket.id }\n : {}),\n }\n\n const result = isLarge\n ? await destinationBucket.copyLargeFile({\n ...copyOptions,\n ...(signal !== undefined ? { signal } : {}),\n })\n : await destinationBucket.copyFile(copyOptions)\n\n core.info(` copied → fileId=${result.fileId}, size=${result.contentLength}`)\n return {\n sourceBucket: sourceBucketName,\n sourceFileName: source,\n destinationBucket: destinationBucket.name,\n destinationFileName: destination,\n fileId: result.fileId,\n size: result.contentLength,\n }\n } finally {\n core.endGroup()\n }\n}\n","import type {\n Bucket,\n DeleteAllDeleteEvent,\n DeleteAllErrorEvent,\n DeleteAllSkipEvent,\n FileAction,\n} from '@backblaze-labs/b2-sdk'\n\nconst DELETE_FAILED_MESSAGE = 'delete failed'\nconst OUT_OF_PREFIX_MESSAGE = 'listed file is outside requested prefix'\n\n// SDK-deleteAll-compatible events with local extensions for this bypass-governance shim.\nexport type DeleteAllVersionsDeleteEvent = DeleteAllDeleteEvent & {\n readonly action: FileAction\n}\n\nexport type DeleteAllVersionsEvent =\n | DeleteAllVersionsDeleteEvent\n | DeleteAllErrorEvent\n | DeleteAllSkipEvent\n\nexport interface DeleteAllVersionsOptions {\n prefix?: string\n dryRun: boolean\n bypassGovernance: boolean\n signal?: AbortSignal\n}\n\nexport async function* deleteAllVersions(\n bucket: Bucket,\n options: DeleteAllVersionsOptions,\n): AsyncGenerator {\n const versions = bucket.paginateFileVersions({\n ...(options.prefix !== undefined ? { prefix: options.prefix } : {}),\n ...(options.signal !== undefined ? { signal: options.signal } : {}),\n })\n\n while (true) {\n options.signal?.throwIfAborted()\n const next = await versions.next()\n options.signal?.throwIfAborted()\n if (next.done === true) break\n\n const version = next.value\n if (options.prefix !== undefined && !version.fileName.startsWith(options.prefix)) {\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: OUT_OF_PREFIX_MESSAGE,\n }\n continue\n }\n\n if (options.dryRun) {\n yield { type: 'skip', fileName: version.fileName, fileId: version.fileId }\n continue\n }\n\n options.signal?.throwIfAborted()\n try {\n if (options.bypassGovernance) {\n await bucket.deleteFileVersion(version.fileName, version.fileId, {\n bypassGovernance: true,\n })\n } else {\n await bucket.deleteFileVersion(version.fileName, version.fileId)\n }\n yield {\n type: 'delete',\n fileName: version.fileName,\n fileId: version.fileId,\n action: version.action,\n }\n } catch (error) {\n options.signal?.throwIfAborted()\n if (isAbortError(error)) throw error\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: DELETE_FAILED_MESSAGE,\n }\n }\n\n options.signal?.throwIfAborted()\n }\n}\n\nfunction isAbortError(error: unknown): boolean {\n return error instanceof Error && error.name === 'AbortError'\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link DeleteResult.files}. */\nexport interface DeletedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** True for dry-run previews; the file was not actually deleted. */\n skipped: boolean\n}\n\n/** Result of {@link deleteCommand}. */\nexport interface DeleteResult {\n /** One entry per matched file version (including hide markers). */\n files: DeletedFile[]\n /** Count of individual-file delete failures (non-fatal; sums into the dispatcher's `core.setFailed`). */\n errors: number\n}\n\n/**\n * Delete files from B2.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and delete every version\n * matching it.\n * - Otherwise delete the single file by name. We look up the latest version\n * via `listFileNames` to get its `fileId` and call `deleteFileVersion`.\n *\n * With `dry-run: true`, no actual deletions happen; the action reports what\n * would have been deleted.\n */\nexport async function deleteCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'delete', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n if (isPrefix) {\n return deletePrefix(bucket, source, inputs.dryRun, inputs.bypassGovernance, signal)\n }\n return deleteOne(bucket, source, inputs.dryRun, inputs.bypassGovernance)\n}\n\nasync function deletePrefix(\n bucket: Bucket,\n prefix: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n signal?: AbortSignal,\n): Promise {\n const files: DeletedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} prefix b2://${bucket.name}/${prefix}`)\n try {\n for await (const event of deleteAllVersions(bucket, {\n prefix,\n dryRun,\n bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n })) {\n if (event.type === 'delete') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: false })\n core.info(` deleted ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: true })\n core.info(` would delete ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to delete ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n\nasync function deleteOne(\n bucket: Bucket,\n fileName: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n): Promise {\n const hit = await findFileByName(bucket, fileName)\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} b2://${bucket.name}/${fileName}`)\n try {\n if (dryRun) {\n core.info(` would delete ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: true }],\n errors: 0,\n }\n }\n if (bypassGovernance) {\n await bucket.deleteFileVersion(fileName, hit.fileId, { bypassGovernance: true })\n } else {\n await bucket.deleteFileVersion(fileName, hit.fileId)\n }\n core.info(` deleted ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: false }],\n errors: 0,\n }\n } finally {\n core.endGroup()\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream/promises\");","import type { DownloadCallOptions } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from './inputs.ts'\n\nexport type DownloadHeaderOverrides = Pick<\n DownloadCallOptions,\n 'b2CacheControl' | 'b2ContentDisposition' | 'b2ContentType'\n>\n\nconst DOWNLOAD_OVERRIDE_QUERY_PARAMS = {\n b2ContentDisposition: 'b2ContentDisposition',\n b2ContentType: 'b2ContentType',\n b2CacheControl: 'b2CacheControl',\n} as const satisfies Record\n\nconst HTTP_TOKEN_RE = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/\nconst MAX_CONTENT_DISPOSITION_LENGTH = 1024\nconst MAX_CONTENT_TYPE_LENGTH = 255\nconst MAX_CACHE_CONTROL_LENGTH = 1024\n\nexport function downloadHeaderOverridesFromInputs(inputs: ParsedInputs): DownloadHeaderOverrides {\n const contentDisposition = validateContentDisposition(inputs.responseContentDisposition)\n const contentType = validateContentType(inputs.responseContentType)\n const cacheControl = validateCacheControl(inputs.responseCacheControl)\n\n return {\n ...(contentDisposition !== undefined ? { b2ContentDisposition: contentDisposition } : {}),\n ...(contentType !== undefined ? { b2ContentType: contentType } : {}),\n ...(cacheControl !== undefined ? { b2CacheControl: cacheControl } : {}),\n }\n}\n\nexport function appendDownloadHeaderOverrides(\n url: string,\n overrides: DownloadHeaderOverrides,\n): string {\n const entries = Object.entries(DOWNLOAD_OVERRIDE_QUERY_PARAMS) as Array<\n [keyof DownloadHeaderOverrides, string]\n >\n if (entries.every(([key]) => overrides[key] === undefined)) return url\n\n const parsed = new URL(url)\n for (const [key, param] of entries) {\n const value = overrides[key]\n if (value !== undefined) {\n parsed.searchParams.set(param, value)\n }\n }\n return parsed.toString()\n}\n\nfunction validateContentDisposition(value: string | undefined): string | undefined {\n return validateHeaderValue(\n 'response-content-disposition',\n value,\n MAX_CONTENT_DISPOSITION_LENGTH,\n isContentDisposition,\n 'must start with a disposition token and contain only valid parameters',\n )\n}\n\nfunction validateContentType(value: string | undefined): string | undefined {\n return validateHeaderValue(\n 'response-content-type',\n value,\n MAX_CONTENT_TYPE_LENGTH,\n isContentType,\n 'must be a media type such as application/pdf, with optional valid parameters',\n )\n}\n\nfunction validateCacheControl(value: string | undefined): string | undefined {\n return validateHeaderValue(\n 'response-cache-control',\n value,\n MAX_CACHE_CONTROL_LENGTH,\n isCacheControl,\n 'must contain comma-separated Cache-Control directives',\n )\n}\n\nfunction validateHeaderValue(\n inputName: string,\n value: string | undefined,\n maxLength: number,\n isValidFormat: (value: string) => boolean,\n formatDescription: string,\n): string | undefined {\n if (value === undefined) return undefined\n if (value.length > maxLength) {\n throw new Error(`Invalid '${inputName}' input: must be at most ${maxLength} characters`)\n }\n if (containsHttpControlCharacter(value)) {\n throw new Error(`Invalid '${inputName}' input: must not contain HTTP control characters`)\n }\n if (!isValidFormat(value)) {\n throw new Error(`Invalid '${inputName}' input: ${formatDescription}`)\n }\n return value\n}\n\nfunction containsHttpControlCharacter(value: string): boolean {\n for (let i = 0; i < value.length; i += 1) {\n const code = value.charCodeAt(i)\n if (code <= 0x1f || code === 0x7f) return true\n }\n return false\n}\n\nfunction isContentDisposition(value: string): boolean {\n const parts = splitOutsideQuotes(value, ';')\n if (parts === null || parts.length === 0 || !isHttpToken(parts[0])) return false\n return parts.slice(1).every(isParameter)\n}\n\nfunction isContentType(value: string): boolean {\n const parts = splitOutsideQuotes(value, ';')\n if (parts === null || parts.length === 0) return false\n\n const [type, subtype, ...extra] = parts[0]?.split('/') ?? []\n if (extra.length > 0 || !isHttpToken(type) || !isHttpToken(subtype)) return false\n return parts.slice(1).every(isParameter)\n}\n\nfunction isCacheControl(value: string): boolean {\n const directives = splitOutsideQuotes(value, ',')\n if (directives === null || directives.length === 0) return false\n return directives.every((directive) => {\n if (directive === '') return false\n const equals = directive.indexOf('=')\n if (equals === -1) return isHttpToken(directive)\n\n const name = directive.slice(0, equals).trim()\n const rawValue = directive.slice(equals + 1).trim()\n return isHttpToken(name) && isHeaderParameterValue(rawValue)\n })\n}\n\nfunction isParameter(value: string): boolean {\n const equals = value.indexOf('=')\n if (equals <= 0) return false\n\n const name = value.slice(0, equals).trim()\n const rawValue = value.slice(equals + 1).trim()\n return isHttpToken(name) && isHeaderParameterValue(rawValue)\n}\n\nfunction isHeaderParameterValue(value: string): boolean {\n return isHttpToken(value) || isQuotedString(value)\n}\n\nfunction isHttpToken(value: string | undefined): boolean {\n return value !== undefined && HTTP_TOKEN_RE.test(value)\n}\n\nfunction isQuotedString(value: string): boolean {\n if (value.length < 2 || !value.startsWith('\"') || !value.endsWith('\"')) return false\n for (let i = 1; i < value.length - 1; i += 1) {\n const char = value[i]\n if (char === '\"') return false\n if (char === '\\\\') {\n i += 1\n if (i >= value.length - 1) return false\n }\n }\n return true\n}\n\nfunction splitOutsideQuotes(value: string, separator: ';' | ','): string[] | null {\n const parts: string[] = []\n let start = 0\n let quoted = false\n let escaped = false\n\n for (let i = 0; i < value.length; i += 1) {\n const char = value[i]\n if (escaped) {\n escaped = false\n continue\n }\n if (quoted && char === '\\\\') {\n escaped = true\n continue\n }\n if (char === '\"') {\n quoted = !quoted\n continue\n }\n if (!quoted && char === separator) {\n parts.push(value.slice(start, i).trim())\n start = i + 1\n }\n }\n\n if (quoted || escaped) return null\n parts.push(value.slice(start).trim())\n return parts\n}\n","import type { Stats } from 'node:fs'\nimport { stat } from 'node:fs/promises'\n\n/**\n * `stat(path)` that returns `undefined` instead of throwing on ENOENT/EACCES\n * etc. Used at filesystem boundaries where the caller wants to distinguish\n * \"doesn't exist / not readable\" from \"exists with shape X\" without juggling\n * try/catch at every call site.\n */\nexport async function tryStat(path: string): Promise {\n return stat(path).catch(() => undefined)\n}\n","/**\n * Format a byte count with KB/MB/GB suffixes.\n *\n * Single source of truth so the workflow log (progress.ts) and the step\n * summary table (summary.ts) never drift on thresholds or rounding.\n */\nexport function formatBytes(n: number): string {\n if (n < 1024) return `${n} B`\n if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`\n if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`\n return `${(n / 1024 / 1024 / 1024).toFixed(2)} GB`\n}\n","import * as core from '@actions/core'\nimport type { ProgressEvent, ProgressListener } from '@backblaze-labs/b2-sdk'\nimport { formatBytes } from './format.ts'\n\n/**\n * Build a progress listener that throttles output to one update per\n * `intervalMs` (default 1s) so a long-running upload doesn't flood the\n * workflow log with thousands of lines. The first event and the final\n * event are always emitted.\n */\nexport function makeProgressListener(label: string, intervalMs = 1000): ProgressListener {\n let lastEmit = 0\n let lastBytes = 0\n let lastTime = Date.now()\n\n return (event: ProgressEvent) => {\n const now = Date.now()\n const isFirst = lastEmit === 0\n const isFinal = event.totalBytes !== null && event.bytesTransferred >= event.totalBytes\n const due = now - lastEmit >= intervalMs\n\n if (!isFirst && !isFinal && !due) return\n\n const elapsedMs = Math.max(1, now - lastTime)\n const deltaBytes = event.bytesTransferred - lastBytes\n const mbps = (deltaBytes / 1024 / 1024) * (1000 / elapsedMs)\n\n const pct =\n event.totalBytes !== null && event.totalBytes > 0\n ? `${Math.round((event.bytesTransferred / event.totalBytes) * 100)}%`\n : '?%'\n\n const parts =\n event.totalParts !== null ? ` (${event.partsCompleted}/${event.totalParts} parts)` : ''\n\n const totalSuffix = event.totalBytes !== null ? ` / ${formatBytes(event.totalBytes)}` : ''\n core.info(\n `${label} ${pct}${parts} ${formatBytes(event.bytesTransferred)}${totalSuffix} @ ${mbps.toFixed(2)} MB/s`,\n )\n\n lastEmit = now\n lastBytes = event.bytesTransferred\n lastTime = now\n }\n}\n","import { randomUUID } from 'node:crypto'\nimport { createWriteStream } from 'node:fs'\nimport { mkdir, realpath, rename, unlink, writeFile } from 'node:fs/promises'\nimport { dirname, isAbsolute, relative, resolve, sep } from 'node:path'\nimport { Readable, Transform } from 'node:stream'\nimport { pipeline } from 'node:stream/promises'\nimport * as core from '@actions/core'\nimport type { Bucket, SseCDownloadKey } from '@backblaze-labs/b2-sdk'\nimport {\n type DownloadHeaderOverrides,\n downloadHeaderOverridesFromInputs,\n} from '../download-overrides.ts'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link DownloadResult.files}. */\nexport interface DownloadedFile {\n /** B2 file name (the key that was fetched). */\n fileName: string\n /** Absolute path on the runner where the body landed. */\n localPath: string\n /** Byte size of the downloaded body. */\n size: number\n /** Remote SHA-1, or `null` if the file was multipart-uploaded (B2 doesn't store a whole-file SHA-1 in that case). */\n contentSha1: string | null\n}\n\n/** Result of {@link downloadCommand}. */\nexport interface DownloadResult {\n /** One entry per downloaded file. Single-file modes return a one-element array. */\n files: DownloadedFile[]\n /** Total bytes transferred across all files. */\n bytesTransferred: number\n}\n\ninterface PathSafetyContext {\n realRoot: string\n safeAncestorDirs: Set\n}\n\ninterface DownloadPathSafety {\n root: string\n realRoot: string\n}\n\ninterface PlannedDownload {\n fileName: string\n localPath: string\n}\n\ninterface LocalPathOwner {\n fileName: string\n localPath: string\n}\n\ninterface ReplaceDownloadedFileOptions {\n platform?: NodeJS.Platform\n renameFile?: typeof rename\n unlinkFile?: typeof unlink\n}\n\n/**\n * Download from B2 to the local runner.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and download every file\n * under it to the local directory at `destination` (defaults to `.`).\n * - Otherwise download a single file. If `destination` ends with `/` or\n * resolves to an existing directory, write into that directory using the\n * basename of `source`. Else `destination` is the exact output file path.\n * If unset, the file's basename is used in the current working directory.\n */\nexport async function downloadCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'download', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n const sseDownload = sseFromInputs(inputs)\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n\n if (isPrefix) {\n return downloadPrefix(\n bucket,\n source,\n inputs.destination ?? '.',\n sseDownload,\n downloadOverrides,\n signal,\n )\n }\n const out = await downloadOne(\n bucket,\n source,\n inputs.destination,\n sseDownload,\n downloadOverrides,\n signal,\n )\n return { files: [out], bytesTransferred: out.size }\n}\n\nfunction sseFromInputs(inputs: ParsedInputs): SseCDownloadKey | undefined {\n const e = inputs.encryption\n if (e === undefined || e.mode !== 'SSE-C') return undefined\n return {\n algorithm: 'AES256',\n customerKey: e.customerKey,\n customerKeyMd5: e.customerKeyMd5,\n }\n}\n\nasync function downloadPrefix(\n bucket: Bucket,\n prefix: string,\n destinationDir: string,\n sseDownload: SseCDownloadKey | undefined,\n downloadOverrides: DownloadHeaderOverrides,\n signal?: AbortSignal,\n): Promise {\n const destRoot = resolve(destinationDir)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n const downloadPathSafety = { root: destRoot, realRoot: pathSafety.realRoot }\n const caseInsensitivePaths = await isCaseInsensitiveDirectory(destRoot)\n\n const planned: PlannedDownload[] = []\n const localPathOwners = new Map()\n const localPathAncestorOwners = new Map()\n let startFileName: string | undefined\n\n for (;;) {\n signal?.throwIfAborted()\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n signal?.throwIfAborted()\n // `listFileNames({ prefix })` returns files matching `prefix` per the\n // SDK / B2 contract, so the slice is always safe. Empty `prefix`\n // leaves the name unchanged.\n const relName = f.fileName.slice(prefix.length)\n const localPath = await resolvePathUnderRoot(\n destRoot,\n safeRemotePathSegments(relName, f.fileName),\n f.fileName,\n pathSafety,\n )\n recordPlannedLocalPath(\n { fileName: f.fileName, localPath },\n destRoot,\n caseInsensitivePaths,\n localPathOwners,\n localPathAncestorOwners,\n )\n planned.push({ fileName: f.fileName, localPath })\n }\n // SDK contract: `nextFileName` is `string | null` per `ListFileNamesResponse`.\n // The \"not null\" arm fires for prefixes with >1000 files (covered by\n // the real-pagination test in coverage-stress).\n if (page.nextFileName === null) break\n startFileName = page.nextFileName\n }\n\n const files: DownloadedFile[] = []\n let total = 0\n for (const plan of planned) {\n signal?.throwIfAborted()\n core.startGroup(`download b2://${bucket.name}/${plan.fileName} → ${plan.localPath}`)\n try {\n const r = await downloadOne(\n bucket,\n plan.fileName,\n plan.localPath,\n sseDownload,\n downloadOverrides,\n signal,\n downloadPathSafety,\n )\n files.push(r)\n total += r.size\n } finally {\n core.endGroup()\n }\n }\n\n return { files, bytesTransferred: total }\n}\n\nasync function downloadOne(\n bucket: Bucket,\n fileName: string,\n destination: string | undefined,\n sseDownload: SseCDownloadKey | undefined,\n downloadOverrides: DownloadHeaderOverrides,\n signal?: AbortSignal,\n pathSafety?: DownloadPathSafety,\n): Promise {\n const localPath =\n pathSafety !== undefined && destination !== undefined\n ? resolve(destination)\n : await resolveLocalPath(fileName, destination)\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n await mkdir(dirname(localPath), { recursive: true })\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n\n const result = await bucket.download(fileName, {\n ...(sseDownload !== undefined ? { serverSideEncryption: sseDownload } : {}),\n ...downloadOverrides,\n ...(signal !== undefined ? { signal } : {}),\n })\n const size = result.headers.contentLength\n const sha1 = result.headers.contentSha1\n\n // Wrap the body in a byte-counting Transform that synthesizes ProgressEvents\n // for the shared progress listener. The SDK doesn't expose progress for\n // single-shot downloads; we compute it here from the known content-length.\n const onProgress = makeProgressListener(`download[${fileName}]`)\n const startedAt = Date.now()\n let bytesSeen = 0\n const counter = new Transform({\n transform(chunk: Buffer, _enc, cb) {\n // The transform only runs when the body has bytes to push; for a zero-\n // length response Node's stream pipeline closes without invoking it,\n // so `size` is provably > 0 here.\n bytesSeen += chunk.length\n onProgress({\n bytesTransferred: bytesSeen,\n totalBytes: size,\n partsCompleted: 0,\n totalParts: null,\n elapsedMs: Date.now() - startedAt,\n })\n cb(null, chunk)\n },\n })\n\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n const tempPath = `${localPath}.b2-action-download-${randomUUID()}.tmp`\n const writeStream = createWriteStream(tempPath, { flags: 'wx' })\n try {\n await pipeline(\n Readable.fromWeb(result.body as unknown as Parameters[0]),\n counter,\n writeStream,\n )\n await replaceDownloadedFile(tempPath, localPath)\n } catch (err) {\n // Partial download on disk is worse than no file. Write through a\n // same-directory temporary file and rename only after the body completes,\n // which also avoids following an existing symlink at the final leaf.\n try {\n await unlink(tempPath)\n } catch {\n // ignore: best-effort cleanup, the original error matters more\n }\n throw err\n }\n\n core.info(` wrote ${size} bytes to ${localPath} (sha1=${sha1 ?? 'multipart'})`)\n\n return { fileName, localPath, size, contentSha1: sha1 }\n}\n\n/**\n * Atomically move a completed same-directory download into place.\n *\n * @internal\n */\nexport async function replaceDownloadedFile(\n tempPath: string,\n localPath: string,\n {\n platform = process.platform,\n renameFile = rename,\n unlinkFile = unlink,\n }: ReplaceDownloadedFileOptions = {},\n): Promise {\n try {\n await renameFile(tempPath, localPath)\n } catch (renameError) {\n const retryWindowsOverwrite =\n platform === 'win32' &&\n typeof renameError === 'object' &&\n renameError !== null &&\n 'code' in renameError &&\n (renameError.code === 'EEXIST' || renameError.code === 'EPERM')\n if (!retryWindowsOverwrite) throw renameError\n\n // Windows refuses to rename over an existing leaf. Remove only the leaf\n // path, which unlinks symlinks instead of following them, then retry the\n // completed same-directory temp-file move.\n try {\n await unlinkFile(localPath)\n } catch (unlinkError) {\n if (!isFileNotFound(unlinkError)) throw unlinkError\n }\n await renameFile(tempPath, localPath)\n }\n}\n\n/**\n * Resolve the local target path for a single B2 download.\n *\n * @internal\n */\nexport async function resolveLocalPath(\n fileName: string,\n destination: string | undefined,\n): Promise {\n if (destination === undefined || destination === '') {\n return resolve(safeRemotePathTail(fileName))\n }\n if (destination.endsWith('/') || destination.endsWith('\\\\')) {\n const destRoot = resolve(destination)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n const s = await tryStat(destination)\n if (s?.isDirectory()) {\n const destRoot = resolve(destination)\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n return resolve(destination)\n}\n\nasync function resolvePathUnderRoot(\n root: string,\n segments: string[],\n fileName: string,\n pathSafety: PathSafetyContext,\n) {\n const localPath = resolve(root, ...segments)\n const rel = relative(root, localPath)\n if (!isPathInsideRootRelative(rel)) {\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n }\n await assertExistingAncestryInsideRoot(pathSafety, localPath, fileName)\n return localPath\n}\n\nfunction isPathInsideRootRelative(rel: string): boolean {\n return rel === '' || (!isAbsolute(rel) && rel !== '..' && !rel.startsWith(`..${sep}`))\n}\n\nasync function createPathSafetyContext(root: string): Promise {\n return { realRoot: await realpath(root), safeAncestorDirs: new Set([root]) }\n}\n\nasync function assertFreshAncestryInsideRoot(\n pathSafety: DownloadPathSafety,\n localPath: string,\n fileName: string,\n): Promise {\n await assertExistingAncestryInsideRoot(\n { realRoot: pathSafety.realRoot, safeAncestorDirs: new Set() },\n localPath,\n fileName,\n )\n}\n\nasync function assertExistingAncestryInsideRoot(\n pathSafety: PathSafetyContext,\n localPath: string,\n fileName: string,\n): Promise {\n let candidate = dirname(localPath)\n const checkedDirs: string[] = []\n\n for (;;) {\n if (pathSafety.safeAncestorDirs.has(candidate)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n checkedDirs.push(candidate)\n try {\n const realCandidate = await realpath(candidate)\n const rel = relative(pathSafety.realRoot, realCandidate)\n if (isPathInsideRootRelative(rel)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n } catch (error) {\n if (!isFileNotFound(error)) throw error\n const parent = dirname(candidate)\n if (parent === candidate) throw error\n candidate = parent\n }\n }\n}\n\nfunction isFileNotFound(error: unknown): boolean {\n return typeof error === 'object' && error !== null && 'code' in error && error.code === 'ENOENT'\n}\n\nasync function isCaseInsensitiveDirectory(dir: string): Promise {\n const marker = `.b2-action-case-check-${randomUUID()}`\n const lowerPath = resolve(dir, marker.toLowerCase())\n const upperPath = resolve(dir, marker.toUpperCase())\n\n try {\n await writeFile(lowerPath, '')\n } catch (error) {\n core.warning(\n `Could not probe case sensitivity in ${dir}; treating download collision checks as case-sensitive (${error instanceof Error ? error.message : String(error)})`,\n )\n return false\n }\n try {\n try {\n return (await realpath(lowerPath)) === (await realpath(upperPath))\n } catch (error) {\n if (isFileNotFound(error)) return false\n throw error\n }\n } finally {\n try {\n await unlink(lowerPath)\n } catch (error) {\n core.warning(\n `Could not remove B2 action case-sensitivity probe ${lowerPath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n}\n\nfunction localPathCollisionKey(localPath: string, caseInsensitivePaths: boolean): string {\n return caseInsensitivePaths ? localPath.toLowerCase() : localPath\n}\n\nfunction recordPlannedLocalPath(\n owner: LocalPathOwner,\n root: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n localPathAncestorOwners: Map,\n): void {\n const collisionKey = localPathCollisionKey(owner.localPath, caseInsensitivePaths)\n const existingFile = localPathOwners.get(collisionKey)\n if (existingFile !== undefined && existingFile.fileName !== owner.fileName) {\n throw new Error(\n `download path collision: B2 files \"${existingFile.fileName}\" and \"${owner.fileName}\" both map to \"${owner.localPath}\"`,\n )\n }\n\n const existingDescendant = localPathAncestorOwners.get(collisionKey)\n if (existingDescendant !== undefined && existingDescendant.fileName !== owner.fileName) {\n throwFileDirectoryCollision(owner, existingDescendant)\n }\n\n const existingAncestor = findLocalPathFileAncestor(\n root,\n owner.localPath,\n caseInsensitivePaths,\n localPathOwners,\n )\n if (existingAncestor !== undefined && existingAncestor.fileName !== owner.fileName) {\n throwFileDirectoryCollision(existingAncestor, owner)\n }\n\n localPathOwners.set(collisionKey, owner)\n rememberLocalPathAncestors(root, owner, caseInsensitivePaths, localPathAncestorOwners)\n}\n\nfunction findLocalPathFileAncestor(\n root: string,\n localPath: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n): LocalPathOwner | undefined {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return undefined\n const owner = localPathOwners.get(parentKey)\n if (owner !== undefined) return owner\n const next = dirname(parent)\n if (next === parent) return undefined\n parent = next\n }\n}\n\nfunction rememberLocalPathAncestors(\n root: string,\n owner: LocalPathOwner,\n caseInsensitivePaths: boolean,\n localPathAncestorOwners: Map,\n): void {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(owner.localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return\n if (!localPathAncestorOwners.has(parentKey)) localPathAncestorOwners.set(parentKey, owner)\n const next = dirname(parent)\n if (next === parent) return\n parent = next\n }\n}\n\nfunction throwFileDirectoryCollision(\n fileOwner: LocalPathOwner,\n descendantOwner: LocalPathOwner,\n): never {\n throw new Error(\n `download path collision: B2 file \"${fileOwner.fileName}\" maps to \"${fileOwner.localPath}\", which must be a file, but B2 file \"${descendantOwner.fileName}\" maps beneath it at \"${descendantOwner.localPath}\"`,\n )\n}\n\nfunction safeRemotePathSegments(fileName: string, displayName = fileName): string[] {\n const segments = fileName.split('/')\n for (const segment of segments) {\n validateRemotePathSegment(segment, displayName)\n }\n return segments\n}\n\nfunction safeRemotePathTail(fileName: string): string {\n const tail = fileName.split('/').at(-1) ?? ''\n validateRemotePathSegment(tail, fileName)\n return tail\n}\n\nfunction validateRemotePathSegment(segment: string, fileName: string): void {\n if (segment === '' || segment === '.' || segment === '..') {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains an empty, \".\" or \"..\" path segment`,\n )\n }\n for (const char of segment) {\n const codePoint = char.codePointAt(0)\n if (codePoint !== undefined && (codePoint <= 0x1f || codePoint === 0x7f)) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains a control character`,\n )\n }\n }\n\n // B2 keys are opaque, but prefix downloads must project `/`-separated\n // keys into the runner filesystem without path traversal or lossy rewrites.\n // POSIX runners can preserve characters such as `:`, `?`, trailing dots,\n // and Windows device names verbatim. Windows treats several of those as\n // separators or invalid/reserved filenames, so reject them there instead of\n // silently changing the on-disk name or risking two B2 keys overwriting one\n // local path.\n if (\n process.platform === 'win32' &&\n (/[<>:\"|?*\\\\]/u.test(segment) ||\n /[. ]$/u.test(segment) ||\n /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/iu.test(segment))\n ) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped on Windows because segment \"${segment}\" is reserved or contains a Windows path character`,\n )\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link headCommand}: metadata read from a HEAD request, no body. */\nexport interface HeadResult {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file (from `Content-Length`). */\n size: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** B2-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Custom `X-Bz-Info-*` headers attached at upload time. */\n fileInfo: Record\n}\n\n/**\n * HEAD-only metadata probe. Fetches the headers of an object without\n * downloading the body. Useful for cheap \"does this exist and what's its\n * size / sha1 / contentType?\" checks, or to inspect custom `fileInfo`\n * metadata that the uploader attached.\n *\n * Returns all output fields as step outputs so downstream steps can branch\n * on them.\n */\nexport async function headCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'head', 'the B2 file name')\n\n core.startGroup(`head b2://${bucket.name}/${source}`)\n try {\n // `bucket.head` returns only the parsed response headers; no body to\n // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n const { headers: h } = await bucket.head(source)\n core.info(\n ` size=${h.contentLength} type=${h.contentType} sha1=${h.contentSha1 ?? 'multipart'}`,\n )\n return {\n fileName: h.fileName,\n fileId: h.fileId,\n size: h.contentLength,\n contentType: h.contentType,\n contentSha1: h.contentSha1,\n uploadTimestamp: h.uploadTimestamp,\n fileInfo: h.fileInfo,\n }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link hideCommand}: identifies the hide marker that was just created. */\nexport interface HideResult {\n /** B2 file name that was hidden. */\n fileName: string\n /** File ID of the hide marker (a special version with `action: 'hide'`). */\n fileId: string\n}\n\n/**\n * Hide a file in B2 (creates a \"hide marker\" file version that masks the\n * previous version from `listFileNames` and downloads-by-name).\n *\n * Versioning is always on in B2, so hide is a soft-delete: the underlying\n * data and prior versions remain until lifecycle rules collect them. To\n * permanently delete, use the `delete` command.\n *\n * To unhide, run `delete` against the hide marker's `fileId` (use `list`\n * with versions if you need to discover it).\n */\nexport async function hideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'hide', 'the B2 file name')\n\n core.startGroup(`hide b2://${bucket.name}/${source}`)\n try {\n const result = await bucket.hideFile(source)\n core.info(` hidden: ${result.fileName} (marker fileId=${result.fileId})`)\n return { fileName: result.fileName, fileId: result.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\n\n/** One entry in {@link ListResult.files}. Mirrors the SDK's per-version metadata. */\nexport interface ListedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file. */\n size: number\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** Server-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Custom `X-Bz-Info-*` headers from upload time. */\n fileInfo: Record\n}\n\n/** Result of {@link listCommand}. */\nexport interface ListResult {\n /** Files matching the prefix, capped by `maxResults`. */\n files: ListedFile[]\n /** True when more visible upload files exist beyond `maxResults`. Use to detect pagination. */\n truncated: boolean\n}\n\n/**\n * List file names under a prefix.\n *\n * `source` is the prefix (use trailing `/` to list a \"directory\"). Empty\n * `source` lists everything the application key is allowed to see. Pagination\n * is followed transparently up to `max-results` matches.\n *\n * Useful for \"decide what to do next\" workflow steps:\n * - inventory before a delete\n * - find the most recent release artifact to promote\n * - emit a JSON manifest as a build output\n */\nexport async function listCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const prefix = inputs.source ?? ''\n const maxResults = inputs.maxResults\n const files: ListedFile[] = []\n let startFileName: string | undefined\n\n core.startGroup(`list b2://${bucket.name}/${prefix} (max ${maxResults})`)\n try {\n while (files.length < maxResults) {\n const remaining = maxResults - files.length\n const pageSize = Math.min(1000, remaining)\n const page = await bucket.listFileNames({\n prefix,\n pageSize,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n files.push({\n fileName: f.fileName,\n fileId: f.fileId,\n size: f.contentLength,\n contentSha1: f.contentSha1,\n uploadTimestamp: f.uploadTimestamp,\n contentType: f.contentType,\n fileInfo: f.fileInfo,\n })\n if (files.length >= maxResults) {\n if (!page.nextFileName) return { files, truncated: false }\n return {\n files,\n truncated: await hasVisibleUploadAfter(bucket, prefix, page.nextFileName),\n }\n }\n }\n\n if (!page.nextFileName) {\n return { files, truncated: false }\n }\n startFileName = page.nextFileName\n }\n\n return { files, truncated: true }\n } finally {\n core.info(` ${files.length} file(s) listed`)\n core.endGroup()\n }\n}\n\nasync function hasVisibleUploadAfter(\n bucket: Bucket,\n prefix: string,\n startFileName: string,\n): Promise {\n let cursor: string | undefined = startFileName\n\n while (cursor !== undefined) {\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n startFileName: cursor,\n })\n if (page.files.some((f) => f.action === 'upload')) return true\n cursor = page.nextFileName ?? undefined\n }\n\n return false\n}\n","function createS3ClientConfig(config) {\n const s3Url = config.accountInfo.getS3ApiUrl();\n const regionMatch = s3Url.match(/s3\\.([^.]+)\\.backblazeb2\\.com/);\n const region = config.region ?? regionMatch?.[1] ?? \"us-west-004\";\n return {\n endpoint: s3Url,\n region,\n credentials: {\n accessKeyId: config.applicationKeyId,\n secretAccessKey: config.applicationKey\n },\n forcePathStyle: true\n };\n}\nfunction presignGetObjectUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds = 3600) {\n const expires = Math.floor(Date.now() / 1e3) + validDurationInSeconds;\n return `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeURIComponent(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;\n}\nexport {\n createS3ClientConfig,\n presignGetObjectUrl\n};\n//# sourceMappingURL=index.js.map\n","import * as core from '@actions/core'\nimport type { B2Client, Bucket, DownloadAuthorizationRequest } from '@backblaze-labs/b2-sdk'\nimport { presignGetObjectUrl } from '@backblaze-labs/b2-sdk/s3'\nimport {\n appendDownloadHeaderOverrides,\n type DownloadHeaderOverrides,\n downloadHeaderOverridesFromInputs,\n} from '../download-overrides.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** One entry in {@link PresignResult.files}. */\nexport interface PresignedFile {\n /** B2 file name (the key the URL grants access to). */\n fileName: string\n /** Presigned download URL. Masked via `core.setSecret` before this struct is logged. */\n url: string\n /** Expiration time as milliseconds since the epoch. */\n expiresAt: number\n}\n\n/** Result of {@link presignCommand}. */\nexport interface PresignResult {\n /** One entry per generated URL. Single-file mode returns a one-element array. */\n files: PresignedFile[]\n}\n\n/**\n * Generate a presigned download URL for one B2 file or every file under a\n * prefix.\n *\n * Modes:\n * - `source` ending in `/` → prefix mode. List the prefix and emit one\n * presigned URL per file (capped by `max-results`). All URLs share the\n * same `b2_get_download_authorization` token because the auth scope is\n * prefix-based; we just expand it into one URL per matched object.\n * - Otherwise → single-file mode (the original behavior).\n *\n * Every URL is masked via `core.setSecret` so subsequent log lines redact\n * them. The first URL is also exposed as the `presigned-url` step output\n * for the most common one-file workflow.\n */\nexport async function presignCommand(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'presign', 'the B2 file name or prefix')\n\n if (source.endsWith('/')) {\n return presignPrefix(client, bucket, inputs, source)\n }\n\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n return {\n files: [\n await presignOne(client, bucket, source, inputs.presignTtlSeconds, source, downloadOverrides),\n ],\n }\n}\n\nasync function presignPrefix(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n prefix: string,\n): Promise {\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n // One auth token covers the whole prefix (that's exactly what\n // `b2_get_download_authorization` is designed for).\n const auth = await getDownloadAuthorization(\n client,\n bucket,\n prefix,\n inputs.presignTtlSeconds,\n downloadOverrides,\n )\n core.setSecret(auth.authorizationToken)\n const expiresAt = Math.floor(Date.now() / 1000) + inputs.presignTtlSeconds\n\n const files: PresignedFile[] = []\n let startFileName: string | undefined\n core.startGroup(`presign prefix b2://${bucket.name}/${prefix} (TTL ${inputs.presignTtlSeconds}s)`)\n try {\n while (files.length < inputs.maxResults) {\n const remaining = inputs.maxResults - files.length\n const page = await bucket.listFileNames({\n prefix,\n pageSize: Math.min(1000, remaining),\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n const url = appendDownloadHeaderOverrides(\n presignGetObjectUrl(\n downloadUrl,\n bucket.name,\n f.fileName,\n auth.authorizationToken,\n inputs.presignTtlSeconds,\n ),\n downloadOverrides,\n )\n core.setSecret(url)\n files.push({ fileName: f.fileName, url, expiresAt })\n if (files.length >= inputs.maxResults) break\n }\n if (!page.nextFileName) break\n startFileName = page.nextFileName\n }\n } finally {\n core.info(` generated ${files.length} presigned URL(s)`)\n core.endGroup()\n }\n return { files }\n}\n\nasync function presignOne(\n client: B2Client,\n bucket: Bucket,\n fileName: string,\n ttlSeconds: number,\n authPrefix: string,\n downloadOverrides: DownloadHeaderOverrides,\n): Promise {\n const auth = await getDownloadAuthorization(\n client,\n bucket,\n authPrefix,\n ttlSeconds,\n downloadOverrides,\n )\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const url = appendDownloadHeaderOverrides(\n presignGetObjectUrl(downloadUrl, bucket.name, fileName, auth.authorizationToken, ttlSeconds),\n downloadOverrides,\n )\n core.setSecret(auth.authorizationToken)\n core.setSecret(url)\n const expiresAt = Math.floor(Date.now() / 1000) + ttlSeconds\n core.info(`presigned URL for ${fileName} valid for ${ttlSeconds}s (expires at ${expiresAt})`)\n return { fileName, url, expiresAt }\n}\n\nasync function getDownloadAuthorization(\n client: B2Client,\n bucket: Bucket,\n fileNamePrefix: string,\n validDurationInSeconds: number,\n downloadOverrides: DownloadHeaderOverrides,\n) {\n const request = {\n bucketId: bucket.id,\n fileNamePrefix,\n validDurationInSeconds,\n ...downloadOverrides,\n } satisfies DownloadAuthorizationRequest\n\n return await client.raw.getDownloadAuthorization(\n client.accountInfo.getApiUrl(),\n client.accountInfo.getAuthToken(),\n request,\n )\n}\n","import * as core from '@actions/core'\nimport type { Bucket, FileAction } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link PurgeResult.files}. */\nexport interface PurgedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID of the version that was purged. */\n fileId: string\n /** Which kind of version this entry refers to, or `skip` for dry-run previews. */\n action: FileAction | 'skip'\n /** True for dry-run previews; the version was not actually purged. */\n skipped: boolean\n}\n\n/** Result of {@link purgeCommand}. */\nexport interface PurgeResult {\n /** One entry per matched version (live, prior, and hide markers). */\n files: PurgedFile[]\n /** Count of individual-version purge failures. */\n errors: number\n}\n\n/**\n * Permanently delete every file version (including hide markers and historic\n * uploads) under a prefix. Differs from `delete` in that `delete`'s\n * implementation streams over `listFileVersions` and removes all versions,\n * but `purge` makes the wipe-the-prefix intent explicit and warns loudly.\n *\n * If `source` is empty or `/`, this purges the **entire bucket** only when\n * `allow-bucket-purge: true` is also set. Default behavior is to require a\n * scoped prefix so an omitted source cannot become a bucket-wide wipe.\n *\n * Supports `dry-run` to preview what would be deleted.\n */\nexport async function purgeCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const bucketWide = inputs.source === undefined || inputs.source === '' || inputs.source === '/'\n if (bucketWide && !inputs.allowBucketPurge) {\n throw new Error(\n \"'allow-bucket-purge' must be true for whole-bucket purge (set 'source' to a prefix for scoped purge)\",\n )\n }\n const source = inputs.source ?? ''\n const prefix = bucketWide ? '' : source.endsWith('/') ? source : `${source}/`\n const dryRun = inputs.dryRun\n\n if (prefix === '' && !dryRun) {\n core.warning(\n `purge will permanently delete EVERY version in bucket \"${bucket.name}\". Continuing because allow-bucket-purge is true.`,\n )\n }\n\n const files: PurgedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'purge'} b2://${bucket.name}/${prefix} (all versions)`)\n try {\n const opts = {\n ...(prefix !== '' ? { prefix } : {}),\n dryRun,\n bypassGovernance: inputs.bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n }\n for await (const event of deleteAllVersions(bucket, opts)) {\n if (event.type === 'delete') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: event.action,\n skipped: false,\n })\n core.info(` purged ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: 'skip',\n skipped: true,\n })\n core.info(` would purge ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to purge ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link retentionCommand}: describes what was applied to the target version. */\nexport interface RetentionResult {\n /** B2 file name the retention/hold was applied to. */\n fileName: string\n /** B2 file ID of the version that was modified. */\n fileId: string\n /** Retention mode after the call. `none` means retention was cleared. Undefined if only legal-hold was touched. */\n appliedMode: 'compliance' | 'governance' | 'none' | undefined\n /** Retention expiration timestamp (ms since the epoch). `null` when mode is `none`. */\n retainUntilTimestamp: number | null | undefined\n /** Legal-hold state after the call. Undefined when not touched by this invocation. */\n appliedLegalHold: 'on' | 'off' | undefined\n}\n\n/**\n * Apply Object Lock retention settings and/or a legal hold to a specific\n * file version.\n *\n * The bucket must have Object Lock enabled. Three inputs drive this command:\n * - `retention-mode`: `compliance` | `governance` | `none`. Required if\n * `retention-until` is set.\n * - `retention-until`: ISO 8601 timestamp (e.g. `2027-01-01T00:00:00Z`).\n * Required if `retention-mode` is `compliance` or `governance`.\n * - `legal-hold`: `on` | `off`. Independent of retention; can be set on\n * its own or alongside retention.\n * - `bypass-governance` (bool): allows shortening a governance retention.\n *\n * At least one of `retention-mode` / `legal-hold` must be supplied.\n *\n * The target file version is resolved by exact name only when the latest\n * version is an upload.\n */\nexport async function retentionCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'retention', 'the B2 file name')\n\n const mode = inputs.retentionMode\n const until = inputs.retentionUntil\n const legalHold = inputs.legalHold\n\n if (mode === undefined && legalHold === undefined) {\n throw new Error(\"retention requires at least one of 'retention-mode' or 'legal-hold' to be set\")\n }\n\n // Resolve the retention expiration up front so TypeScript narrows `until`\n // inside the parse branch and the downstream call site doesn't need a cast.\n let retainUntilMillis: number | null = null\n if (mode === 'compliance' || mode === 'governance') {\n if (until === undefined) {\n throw new Error(\n `'retention-until' (ISO 8601 timestamp) is required when 'retention-mode' is '${mode}'`,\n )\n }\n const parsed = Date.parse(until)\n if (Number.isNaN(parsed)) {\n throw new Error(`'retention-until' is not a valid ISO 8601 timestamp: \"${until}\"`)\n }\n // Reject past timestamps client-side. B2 also rejects them server-side\n // but with a generic 400; the action's check fails faster and tells the\n // user exactly what's wrong (especially helpful for timezone-skewed CI\n // runners). Allow a small clock-skew tolerance: anything within the\n // last 30 seconds is treated as \"now\" rather than past.\n const skewToleranceMs = 30_000\n if (parsed < Date.now() - skewToleranceMs) {\n throw new Error(\n `'retention-until' must be in the future; got \"${until}\" (${new Date(parsed).toISOString()})`,\n )\n }\n retainUntilMillis = parsed\n }\n\n // Resolve the file version we're operating on.\n const hit = await findFileByName(bucket, source)\n\n let appliedMode: RetentionResult['appliedMode']\n let retainUntilTimestamp: number | null | undefined\n let appliedLegalHold: RetentionResult['appliedLegalHold']\n\n core.startGroup(`retention b2://${bucket.name}/${source}`)\n try {\n if (mode !== undefined) {\n const retention = {\n mode: mode === 'none' ? null : mode,\n retainUntilTimestamp: retainUntilMillis,\n }\n const result = inputs.bypassGovernance\n ? await bucket.updateFileRetention(source, hit.fileId, retention, {\n bypassGovernance: true,\n })\n : await bucket.updateFileRetention(source, hit.fileId, retention)\n appliedMode = mode\n retainUntilTimestamp = result.fileRetention.retainUntilTimestamp\n core.info(` retention: mode=${mode} retainUntil=${retainUntilMillis}`)\n }\n\n if (legalHold !== undefined) {\n const result = await bucket.updateFileLegalHold(source, hit.fileId, legalHold)\n appliedLegalHold = result.legalHold\n core.info(` legal-hold: ${result.legalHold}`)\n }\n\n return {\n fileName: source,\n fileId: hit.fileId,\n appliedMode,\n retainUntilTimestamp,\n appliedLegalHold,\n }\n } finally {\n core.endGroup()\n }\n}\n","import { collectStream } from \"./collect.js\";\nclass BlobSource {\n /**\n * Create a BlobSource wrapping the given Blob.\n * @param blob - The Blob or File to use as the underlying content.\n */\n constructor(blob) {\n this.blob = blob;\n this.size = blob.size;\n }\n /** {@inheritDoc} */\n size;\n /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */\n canSlice = true;\n /**\n * Return a new BlobSource covering the specified byte range.\n * @param start - The zero-based byte offset to begin the slice.\n * @param end - The exclusive byte offset where the slice ends.\n *\n * @returns A new ContentSource representing the requested sub-range.\n */\n slice(start, end) {\n return new BlobSource(this.blob.slice(start, end));\n }\n /**\n * Open the Blob content as a ReadableStream.\n * @returns A ReadableStream of the Blob bytes.\n */\n stream() {\n return this.blob.stream();\n }\n /**\n * Read the entire Blob content into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n toArrayBuffer() {\n return this.blob.arrayBuffer();\n }\n}\nclass BufferSource {\n /**\n * Create a BufferSource wrapping the given Uint8Array.\n * @param buffer - The byte buffer to use as the underlying content.\n */\n constructor(buffer) {\n this.buffer = buffer;\n this.size = buffer.byteLength;\n }\n /** {@inheritDoc} */\n size;\n /** Random-access: the entire payload lives in memory. */\n canSlice = true;\n /**\n * Return a new BufferSource covering the specified byte range.\n * @param start - The zero-based byte offset to begin the slice.\n * @param end - The exclusive byte offset where the slice ends.\n *\n * @returns A new ContentSource representing the requested sub-range.\n */\n slice(start, end) {\n return new BufferSource(this.buffer.slice(start, end));\n }\n /**\n * Open the buffer content as a ReadableStream.\n * @returns A ReadableStream that emits the buffer bytes in a single chunk.\n */\n stream() {\n const buffer = this.buffer;\n return new ReadableStream({\n start(controller) {\n controller.enqueue(buffer);\n controller.close();\n }\n });\n }\n /**\n * Read the entire buffer content into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n toArrayBuffer() {\n return Promise.resolve(\n this.buffer.buffer.slice(\n this.buffer.byteOffset,\n this.buffer.byteOffset + this.buffer.byteLength\n )\n );\n }\n}\nclass StreamSource {\n /**\n * Create a StreamSource wrapping the given ReadableStream with a known byte size.\n * @param readable - The ReadableStream to wrap as a content source.\n * @param size - The total number of bytes the stream will produce.\n */\n constructor(readable, size) {\n this.readable = readable;\n this.size = size;\n }\n /** {@inheritDoc} */\n size;\n /**\n * Forward-only: ReadableStreams cannot be repositioned, so multipart\n * uploads must take the sequential path. See the interface comment on\n * `canSlice` for what the engine does with this flag.\n */\n canSlice = false;\n /** Whether the stream has already been read. */\n consumed = false;\n /**\n * Always throws because streams cannot be sliced. Buffer the stream first.\n *\n * @throws If slicing is attempted on a stream-backed source.\n */\n slice() {\n throw new Error(\"StreamSource does not support slicing. Buffer the stream first.\");\n }\n /**\n * Open the underlying ReadableStream. Can only be called once.\n * @returns The underlying ReadableStream of bytes.\n *\n * @throws If the stream has already been consumed.\n */\n stream() {\n if (this.consumed) throw new Error(\"StreamSource can only be consumed once.\");\n this.consumed = true;\n return this.readable;\n }\n /**\n * Read the entire stream into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n async toArrayBuffer() {\n const bytes = await collectStream(this.stream());\n return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);\n }\n}\nfunction toContentSource(input, size) {\n if (input instanceof Uint8Array) {\n return new BufferSource(input);\n }\n if (input instanceof Blob) {\n return new BlobSource(input);\n }\n if (size === void 0) {\n throw new Error(\"size is required when using a ReadableStream as input.\");\n }\n return new StreamSource(input, size);\n}\nexport {\n BlobSource,\n BufferSource,\n StreamSource,\n toContentSource\n};\n//# sourceMappingURL=source.js.map\n","class UploadAction {\n /**\n * Creates a new UploadAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param absolutePath - Absolute local filesystem path.\n * @param size - File size in bytes.\n * @param doUpload - Callback that performs the actual upload.\n */\n constructor(relativePath, absolutePath, size, doUpload) {\n this.relativePath = relativePath;\n this.absolutePath = absolutePath;\n this.size = size;\n this.doUpload = doUpload;\n }\n type = \"upload\";\n /**\n * Uploads the file (unless dryRun) and returns an 'upload-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doUpload(this.absolutePath, this.relativePath);\n }\n return { type: \"upload-done\", path: this.relativePath, size: this.size };\n }\n}\nclass DownloadAction {\n /**\n * Creates a new DownloadAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param size - File size in bytes.\n * @param doDownload - Callback that performs the actual download.\n */\n constructor(relativePath, size, doDownload) {\n this.relativePath = relativePath;\n this.size = size;\n this.doDownload = doDownload;\n }\n type = \"download\";\n /**\n * Downloads the file (unless dryRun) and returns a 'download-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDownload(this.relativePath);\n }\n return { type: \"download-done\", path: this.relativePath, size: this.size };\n }\n}\nclass CopyAction {\n /**\n * Creates a new CopyAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param size - File size in bytes.\n * @param doCopy - Callback that performs the server-side copy.\n */\n constructor(relativePath, size, doCopy) {\n this.relativePath = relativePath;\n this.size = size;\n this.doCopy = doCopy;\n }\n type = \"copy\";\n /**\n * Copies the file (unless dryRun) and returns a 'copy-done' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doCopy(this.relativePath);\n }\n return { type: \"copy-done\", path: this.relativePath, size: this.size };\n }\n}\nclass HideAction {\n /**\n * Creates a new HideAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param doHide - Callback that creates the hide marker.\n */\n constructor(relativePath, doHide) {\n this.relativePath = relativePath;\n this.doHide = doHide;\n }\n type = \"hide\";\n size = 0;\n /**\n * Hides the file (unless dryRun) and returns a 'hide' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doHide(this.relativePath);\n }\n return { type: \"hide\", path: this.relativePath, size: 0 };\n }\n}\nclass DeleteRemoteAction {\n /**\n * Creates a new DeleteRemoteAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param fileId - The B2 file version ID to delete.\n * @param doDelete - Callback that performs the deletion.\n */\n constructor(relativePath, fileId, doDelete) {\n this.relativePath = relativePath;\n this.fileId = fileId;\n this.doDelete = doDelete;\n }\n type = \"delete-remote\";\n size = 0;\n /**\n * Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDelete(this.fileId, this.relativePath);\n }\n return { type: \"delete-remote\", path: this.relativePath, size: 0 };\n }\n}\nclass DeleteLocalAction {\n /**\n * Creates a new DeleteLocalAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param absolutePath - Absolute local filesystem path.\n * @param doDelete - Callback that performs the deletion.\n */\n constructor(relativePath, absolutePath, doDelete) {\n this.relativePath = relativePath;\n this.absolutePath = absolutePath;\n this.doDelete = doDelete;\n }\n type = \"delete-local\";\n size = 0;\n /**\n * Deletes the local file (unless dryRun) and returns a 'delete-local' event.\n * @param dryRun - Whether to simulate the action without making changes.\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(dryRun) {\n if (!dryRun) {\n await this.doDelete(this.absolutePath);\n }\n return { type: \"delete-local\", path: this.relativePath, size: 0 };\n }\n}\nclass SkipAction {\n /**\n * Creates a new SkipAction for the given relative path.\n * @param relativePath - Path relative to the sync root.\n * @param reason - Human-readable explanation for why the file was skipped.\n */\n constructor(relativePath, reason) {\n this.relativePath = relativePath;\n this.reason = reason;\n }\n type = \"skip\";\n size = 0;\n /**\n * Returns a 'skip' event with the reason message. No I/O is performed.\n * @param _dryRun - Whether to simulate the action (unused for no-op).\n *\n * @returns An async generator yielding sync progress events.\n */\n async execute(_dryRun) {\n return { type: \"skip\", path: this.relativePath, size: 0, message: this.reason };\n }\n}\nexport {\n CopyAction,\n DeleteLocalAction,\n DeleteRemoteAction,\n DownloadAction,\n HideAction,\n SkipAction,\n UploadAction\n};\n//# sourceMappingURL=index.js.map\n","async function* zipFolders(source, dest) {\n const sourceIter = source.scan()[Symbol.asyncIterator]();\n const destIter = dest.scan()[Symbol.asyncIterator]();\n let sourceResult = await sourceIter.next();\n let destResult = await destIter.next();\n while (!sourceResult.done || !destResult.done) {\n const s = sourceResult.done ? null : sourceResult.value;\n const d = destResult.done ? null : destResult.value;\n if (s === null) {\n yield [null, d];\n destResult = await destIter.next();\n } else if (d === null) {\n yield [s, null];\n sourceResult = await sourceIter.next();\n } else if (s.relativePath < d.relativePath) {\n yield [s, null];\n sourceResult = await sourceIter.next();\n } else if (d.relativePath < s.relativePath) {\n yield [null, d];\n destResult = await destIter.next();\n } else {\n yield [s, d];\n sourceResult = await sourceIter.next();\n destResult = await destIter.next();\n }\n }\n}\nexport {\n zipFolders\n};\n//# sourceMappingURL=pairing.js.map\n","function filesAreDifferent(source, dest, compareMode, threshold = 0) {\n switch (compareMode) {\n case \"none\":\n return false;\n case \"size\":\n return Math.abs(source.size - dest.size) > threshold;\n case \"modtime\":\n return Math.abs(source.modTimeMillis - dest.modTimeMillis) > threshold;\n }\n}\nexport {\n filesAreDifferent\n};\n//# sourceMappingURL=compare.js.map\n","import { SkipAction } from \"../actions/index.js\";\nimport { filesAreDifferent } from \"./compare.js\";\nfunction* generateActions(pair, direction, compareMode, keepMode, keepDays, nowMillis, factory, compareThreshold) {\n const [source, dest] = pair;\n if (source !== null && dest === null) {\n yield* actionsForSourceOnly(source, direction, factory);\n } else if (source === null && dest !== null) {\n yield* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory);\n } else if (source !== null && dest !== null) {\n yield* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory);\n }\n}\nfunction* actionsForSourceOnly(source, direction, factory) {\n switch (direction) {\n case \"local-to-b2\":\n yield factory.upload(source);\n break;\n case \"b2-to-local\":\n yield factory.download(source);\n break;\n case \"b2-to-b2\":\n yield factory.copy(source, source.relativePath);\n break;\n }\n}\nfunction* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory) {\n if (keepMode === \"no-delete\") {\n yield new SkipAction(dest.relativePath, \"not in source, keep-mode is no-delete\");\n return;\n }\n if (keepMode === \"keep-days\") {\n const ageMillis = nowMillis - dest.modTimeMillis;\n const ageDays = ageMillis / (24 * 60 * 60 * 1e3);\n if (ageDays < keepDays) {\n yield new SkipAction(\n dest.relativePath,\n `not in source, keeping for ${Math.ceil(keepDays - ageDays)} more days`\n );\n return;\n }\n }\n switch (direction) {\n case \"local-to-b2\":\n yield factory.removeOrphan(dest);\n break;\n case \"b2-to-local\":\n yield factory.deleteLocal(dest);\n break;\n case \"b2-to-b2\":\n yield factory.removeOrphan(dest);\n break;\n }\n}\nfunction* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory) {\n if (!filesAreDifferent(source, dest, compareMode, compareThreshold)) {\n yield new SkipAction(source.relativePath, \"files are the same\");\n return;\n }\n switch (direction) {\n case \"local-to-b2\":\n yield factory.upload(source);\n break;\n case \"b2-to-local\":\n yield factory.download(source);\n break;\n case \"b2-to-b2\":\n yield factory.copy(source, dest.relativePath);\n break;\n }\n}\nexport {\n generateActions\n};\n//# sourceMappingURL=index.js.map\n","import { BufferSource } from \"../streams/source.js\";\nimport { fileId } from \"../types/ids.js\";\nimport { Semaphore } from \"../upload/concurrency.js\";\nimport { DEFAULT_TRANSFER_CONCURRENCY } from \"../util/defaults.js\";\nimport { toError } from \"../util/to-error.js\";\nimport { DeleteLocalAction, DeleteRemoteAction, HideAction, CopyAction, DownloadAction, UploadAction } from \"./actions/index.js\";\nimport { zipFolders } from \"./pairing.js\";\nimport { generateActions } from \"./policies/index.js\";\nfunction resolveDirection(source, dest) {\n if (source.type === \"local\" && dest.type === \"b2\") return \"local-to-b2\";\n if (source.type === \"b2\" && dest.type === \"local\") return \"b2-to-local\";\n if (source.type === \"b2\" && dest.type === \"b2\") return \"b2-to-b2\";\n throw new Error(`Unsupported sync direction: ${source.type} to ${dest.type}`);\n}\nasync function* synchronize(config) {\n const { source, dest, options } = config;\n const direction = resolveDirection(source, dest);\n const dryRun = options.dryRun ?? false;\n const concurrency = options.concurrency ?? DEFAULT_TRANSFER_CONCURRENCY;\n const keepDays = options.keepDays ?? 0;\n const compareThreshold = options.compareThreshold ?? 0;\n const nowMillis = Date.now();\n const factory = createActionFactory(config);\n const actions = [];\n for await (const pair of zipFolders(source, dest)) {\n if (options.signal?.aborted) return;\n for (const action of generateActions(\n pair,\n direction,\n options.compareMode,\n options.keepMode,\n keepDays,\n nowMillis,\n factory,\n compareThreshold\n )) {\n actions.push(action);\n }\n yield { type: \"compare\", path: (pair[0] ?? pair[1])?.relativePath ?? \"\", size: 0 };\n }\n const sem = new Semaphore(concurrency);\n const results = [];\n const errors = [];\n const promises = actions.map(async (action) => {\n await sem.acquire();\n try {\n if (options.signal?.aborted) return;\n const event = await action.execute(dryRun);\n results.push(event);\n } catch (err) {\n const errorValue = toError(err);\n errors.push(errorValue);\n results.push({\n type: \"error\",\n path: action.relativePath,\n size: 0,\n message: errorValue.message\n });\n } finally {\n sem.release();\n }\n });\n await Promise.all(promises);\n for (const event of results) {\n yield event;\n }\n if (errors.length > 0) {\n yield {\n type: \"error\",\n path: \"\",\n size: 0,\n message: `${errors.length} action(s) failed`\n };\n }\n}\nfunction assertBucket(bucket, context) {\n if (!bucket) throw new Error(`Bucket required for ${context} actions`);\n}\nfunction createActionFactory(config) {\n const upConfig = config;\n const downConfig = config;\n const destBucket = upConfig.bucket ?? downConfig.bucket;\n const bucketIsLocked = destBucket?.info?.fileLockConfiguration?.value?.isFileLockEnabled ?? false;\n const factory = {\n upload(source) {\n const bucket = upConfig.bucket;\n const prefix = upConfig.prefix ?? \"\";\n assertBucket(bucket, \"upload\");\n return new UploadAction(\n source.relativePath,\n source.absolutePath,\n source.size,\n async (absPath, relPath) => {\n const { readFile } = await import(\"node:fs/promises\");\n const data = await readFile(absPath);\n await bucket.upload({\n fileName: `${prefix}${relPath}`,\n source: new BufferSource(new Uint8Array(data))\n });\n }\n );\n },\n download(source) {\n const bucket = downConfig.bucket;\n const root = downConfig.dest?.type === \"local\" ? downConfig.dest.root : \"\";\n assertBucket(bucket, \"download\");\n return new DownloadAction(source.relativePath, source.size, async (relPath) => {\n const result = await bucket.download(source.selectedVersion.fileName);\n const reader = result.body.getReader();\n let combined;\n try {\n const chunks = [];\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n let total = 0;\n for (const c of chunks) total += c.byteLength;\n combined = new Uint8Array(total);\n let offset = 0;\n for (const c of chunks) {\n combined.set(c, offset);\n offset += c.byteLength;\n }\n } finally {\n reader.releaseLock();\n }\n const { mkdir, writeFile } = await import(\"node:fs/promises\");\n const { dirname, join } = await import(\"node:path\");\n const destPath = join(root, relPath);\n await mkdir(dirname(destPath), { recursive: true });\n await writeFile(destPath, combined);\n });\n },\n copy(source, destPath) {\n const bucket = upConfig.bucket;\n assertBucket(bucket, \"copy\");\n return new CopyAction(source.relativePath, source.size, async () => {\n await bucket.copyFile({\n sourceFileId: source.selectedVersion.fileId,\n fileName: destPath\n });\n });\n },\n hide(path) {\n const bucket = upConfig.bucket ?? downConfig.bucket;\n assertBucket(bucket, \"hide\");\n return new HideAction(path, async (relPath) => {\n const prefix = upConfig.prefix ?? \"\";\n await bucket.hideFile(`${prefix}${relPath}`);\n });\n },\n deleteRemote(path) {\n const bucket = upConfig.bucket ?? downConfig.bucket;\n assertBucket(bucket, \"delete\");\n const b2FileName = path.selectedVersion.fileName;\n return new DeleteRemoteAction(\n path.relativePath,\n path.selectedVersion.fileId,\n async (fileId$1) => {\n await bucket.deleteFileVersion(b2FileName, fileId(fileId$1));\n }\n );\n },\n deleteLocal(path) {\n return new DeleteLocalAction(path.relativePath, path.absolutePath, async (absPath) => {\n const { unlink } = await import(\"node:fs/promises\");\n await unlink(absPath);\n });\n },\n removeOrphan(dest) {\n return bucketIsLocked ? factory.hide(dest.relativePath) : factory.deleteRemote(dest);\n }\n };\n return factory;\n}\nexport {\n synchronize\n};\n//# sourceMappingURL=synchronizer.js.map\n","import { readdir, stat } from \"node:fs/promises\";\nimport { join, relative, sep } from \"node:path\";\nclass LocalFolder {\n type = \"local\";\n /** Absolute path to the local root directory. */\n root;\n /**\n * Creates a new LocalFolder for the given root directory.\n * @param root - Absolute path to the local directory to scan.\n */\n constructor(root) {\n this.root = root;\n }\n /** Recursively walks the directory and yields files sorted by relative path. */\n async *scan() {\n const collected = [];\n await this.walk(this.root, collected);\n collected.sort((a, b) => a.relativePath.localeCompare(b.relativePath));\n for (const entry of collected) {\n yield entry;\n }\n }\n /**\n * Recursively collects files from {@link dir} into {@link out}.\n * @param dir - Absolute path of the directory to scan.\n * @param out - Accumulator array that receives discovered file entries.\n */\n async walk(dir, out) {\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n if (entry.isDirectory()) {\n await this.walk(fullPath, out);\n } else if (entry.isFile()) {\n try {\n const s = await stat(fullPath);\n const rel = relative(this.root, fullPath).split(sep).join(\"/\");\n out.push({\n relativePath: rel,\n absolutePath: fullPath,\n modTimeMillis: Math.floor(s.mtimeMs),\n size: s.size\n });\n } catch {\n }\n }\n }\n }\n}\nexport {\n LocalFolder\n};\n//# sourceMappingURL=local.js.map\n","const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: \"start\",\n /** Normal upload (small or finished large file). */\n Upload: \"upload\",\n /** Hide marker (soft delete). */\n Hide: \"hide\",\n /** Virtual folder marker. */\n Folder: \"folder\",\n /** Created via server-side copy. */\n Copy: \"copy\"\n};\nconst MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: \"COPY\",\n /** Use the values provided in the copy request. */\n Replace: \"REPLACE\"\n};\nexport {\n FileAction,\n MetadataDirective\n};\n//# sourceMappingURL=file.js.map\n","import { FileAction } from \"../../types/file.js\";\nclass B2Folder {\n type = \"b2\";\n bucket;\n prefix;\n /**\n * Creates a new B2Folder for the given bucket and optional prefix.\n * @param bucket - The B2 bucket to scan.\n * @param prefix - Optional key prefix to restrict the scan scope.\n */\n constructor(bucket, prefix = \"\") {\n this.bucket = bucket;\n this.prefix = prefix;\n }\n /** Lists all file versions in the bucket, groups by name, and yields the latest visible version. */\n async *scan() {\n const grouped = /* @__PURE__ */ new Map();\n let startFileName;\n let startFileId;\n while (true) {\n const listing = await this.bucket.listFileVersions({\n ...this.prefix !== \"\" ? { prefix: this.prefix } : {},\n ...startFileName !== void 0 ? { startFileName } : {},\n ...startFileId !== void 0 ? { startFileId } : {}\n });\n for (const fv of listing.files) {\n const existing = grouped.get(fv.fileName);\n if (existing) {\n existing.push(fv);\n } else {\n grouped.set(fv.fileName, [fv]);\n }\n }\n if (!listing.nextFileName) break;\n startFileName = listing.nextFileName;\n startFileId = listing.nextFileId;\n }\n const sorted = [...grouped.entries()].sort((a, b) => a[0].localeCompare(b[0]));\n for (const [fileName, versions] of sorted) {\n versions.sort((a, b) => b.uploadTimestamp - a.uploadTimestamp);\n const selected = versions[0];\n if (!selected || selected.action === FileAction.Hide) continue;\n const relativePath = this.prefix !== \"\" ? fileName.slice(this.prefix.length) : fileName;\n yield {\n relativePath,\n modTimeMillis: selected.uploadTimestamp,\n size: selected.contentLength,\n selectedVersion: selected,\n allVersions: versions\n };\n }\n }\n}\nexport {\n B2Folder\n};\n//# sourceMappingURL=b2.js.map\n","import { mkdir } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type {\n CompareMode,\n KeepMode,\n SyncEvent,\n SynchronizerDownConfig,\n SynchronizerUpConfig,\n} from '@backblaze-labs/b2-sdk/sync'\nimport { B2Folder, LocalFolder, synchronize } from '@backblaze-labs/b2-sdk/sync'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/**\n * Mutable counter bag fed by {@link processSyncEvent} as the action consumes\n * the SDK's `synchronize()` event stream. Exposed alongside the processor so\n * unit tests can drive each SyncEvent variant deterministically (notably the\n * `copy-start` / `copy-done` events that only fire in b2-to-b2 sync, which\n * the action's input surface doesn't currently expose).\n */\nexport interface SyncEventCounters {\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files removed (delete-remote, delete-local, or hide). */\n deleted: number\n /** Count of files left unchanged. */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred (upload + download). */\n bytesTransferred: number\n}\n\n/**\n * Apply one `SyncEvent` from the SDK's `synchronize()` stream to the running\n * counters and emit the corresponding log line. The action's `syncCommand`\n * calls this in a loop; the function is exported (and the {@link SyncEventCounters}\n * type with it) so tests can exercise every event variant independently,\n * including the `copy-*` events that require b2-to-b2 sync to fire from the\n * real engine.\n *\n * Informational lifecycle events (`upload-start`, `compare`, etc.) are\n * deliberate no-ops; listing them explicitly keeps the switch exhaustive\n * so TypeScript errors if the SDK adds a new variant.\n */\nexport function processSyncEvent(event: SyncEvent, counters: SyncEventCounters): void {\n switch (event.type) {\n case 'upload-done':\n counters.uploaded++\n counters.bytesTransferred += event.size\n core.info(` ↑ ${event.path} (${event.size}B)`)\n return\n case 'download-done':\n counters.downloaded++\n counters.bytesTransferred += event.size\n core.info(` ↓ ${event.path} (${event.size}B)`)\n return\n case 'delete-remote':\n counters.deleted++\n core.info(` − ${event.path}`)\n return\n case 'delete-local':\n counters.deleted++\n core.info(` − (local) ${event.path}`)\n return\n case 'hide':\n counters.deleted++\n core.info(` ⌀ ${event.path} (hidden)`)\n return\n case 'skip':\n counters.skipped++\n return\n case 'error':\n counters.errors++\n core.warning(` ! ${event.path}: ${event.message}`)\n return\n case 'upload-start':\n case 'compare':\n case 'download-start':\n case 'copy-start':\n case 'copy-done':\n return\n }\n}\n\n/**\n * Build a one-line summary of the first few sync errors for the dispatcher's\n * top-level failure message. Without this, a sync that fails on three files\n * surfaces only `Sync completed with 3 error(s)` to the user, who then has to\n * dig into the (possibly collapsed) per-file warnings or parse `summary-json`.\n * Including a sample makes the failure message itself diagnose-able.\n */\nexport function summarizeSyncErrors(events: SyncEvent[], limit = 3): string {\n const errors = events.filter(\n (e): e is Extract => e.type === 'error',\n )\n if (errors.length === 0) return ''\n const head = errors\n .slice(0, limit)\n .map((e) => `${e.path}: ${e.message}`)\n .join('; ')\n const tail = errors.length > limit ? `; +${errors.length - limit} more` : ''\n return `${head}${tail}`\n}\n\n/** Result of {@link syncCommand}: per-event log plus aggregate counters. */\nexport interface SyncResult {\n /** Per-file events emitted by the SDK's `synchronize()` (upload-done, download-done, skip, delete-*, hide, error). */\n events: SyncEvent[]\n /** Resolved direction of this sync (after `auto` resolution). */\n direction: 'local-to-b2' | 'b2-to-local'\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files deleted/hidden across both sides. */\n deleted: number\n /** Count of files left unchanged (already in sync). */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred across both directions. */\n bytesTransferred: number\n}\n\n/**\n * Sync a local directory to / from a B2 bucket prefix.\n *\n * Direction is determined by the `direction` input (`up` = local → B2,\n * `down` = B2 → local). With `direction: auto` (the default) we infer:\n * - if `source` is an existing local directory → `up`\n * - otherwise → `down` (source is a B2 prefix, destination is local)\n *\n * The SDK's {@link synchronize} returns an `AsyncGenerator` which we\n * relay to the workflow log (per-file) and aggregate into a typed result.\n */\nexport async function syncCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'sync', 'a local directory (up) or B2 prefix (down)')\n\n const direction = await resolveDirection(inputs.syncDirection, source)\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n\n const config = await buildConfig(bucket, source, inputs, direction, signal)\n\n core.startGroup(\n `sync ${direction === 'local-to-b2' ? source : `b2://${bucket.name}/${source}`} ` +\n `→ ${direction === 'local-to-b2' ? `b2://${bucket.name}/${inputs.destination ?? ''}` : (inputs.destination ?? '.')} ` +\n `(compare=${compareMode}, keep=${keepMode}${dryRun ? ', dry-run' : ''})`,\n )\n\n const events: SyncEvent[] = []\n const counters: SyncEventCounters = {\n uploaded: 0,\n downloaded: 0,\n deleted: 0,\n skipped: 0,\n errors: 0,\n bytesTransferred: 0,\n }\n\n try {\n for await (const event of synchronize(config)) {\n events.push(event)\n processSyncEvent(event, counters)\n }\n } finally {\n core.endGroup()\n }\n\n const { uploaded, downloaded, deleted, skipped, errors, bytesTransferred } = counters\n\n core.info(\n `sync done [${direction}]: ${uploaded} uploaded, ${downloaded} downloaded, ${deleted} removed, ${skipped} unchanged, ${errors} errors`,\n )\n\n return {\n events,\n direction,\n uploaded,\n downloaded,\n deleted,\n skipped,\n errors,\n bytesTransferred,\n }\n}\n\nasync function resolveDirection(\n requested: 'up' | 'down' | 'auto',\n source: string,\n): Promise<'local-to-b2' | 'b2-to-local'> {\n if (requested === 'up') return 'local-to-b2'\n if (requested === 'down') return 'b2-to-local'\n const localStat = await tryStat(source)\n return localStat?.isDirectory() ? 'local-to-b2' : 'b2-to-local'\n}\n\nasync function buildConfig(\n bucket: Bucket,\n source: string,\n inputs: ParsedInputs,\n direction: 'local-to-b2' | 'b2-to-local',\n signal?: AbortSignal,\n): Promise {\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n const concurrency = inputs.concurrency\n const options = {\n compareMode,\n keepMode,\n concurrency,\n dryRun,\n ...(signal !== undefined ? { signal } : {}),\n }\n\n if (direction === 'local-to-b2') {\n const stats = await tryStat(source)\n if (!stats?.isDirectory()) {\n throw new Error(`'sync' up requires 'source' to be an existing local directory: ${source}`)\n }\n const prefix = (inputs.destination ?? '').replace(/^\\/+|\\/+$/g, '')\n return {\n source: new LocalFolder(resolve(source)),\n dest: new B2Folder(bucket, prefix === '' ? '' : `${prefix}/`),\n bucket,\n prefix: prefix === '' ? '' : `${prefix}/`,\n options,\n }\n }\n\n const remotePrefix = source.replace(/^\\/+|\\/+$/g, '')\n const localDest = inputs.destination ?? '.'\n await mkdir(resolve(localDest), { recursive: true })\n return {\n source: new B2Folder(bucket, remotePrefix === '' ? '' : `${remotePrefix}/`),\n dest: new LocalFolder(resolve(localDest)),\n bucket,\n options,\n }\n}\n\nexport type { CompareMode, KeepMode }\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link unhideCommand}. */\nexport interface UnhideResult {\n /** B2 file name that was unhidden. */\n fileName: string\n /** File ID of the removed hide marker, or `null` if there was nothing hidden. */\n removedMarkerFileId: string | null\n}\n\n/**\n * Restore visibility of a file previously hidden by the `hide` command.\n *\n * Wraps the SDK's {@link Bucket.unhideFile}, which finds the most recent hide\n * marker for the file name and deletes it. If the file is already visible\n * (or never existed), no-ops and reports `removedMarkerFileId: null`.\n *\n * B2 has no native `b2_unhide_file` endpoint; the SDK implements unhide as\n * \"list versions → delete the top hide marker\", which is the canonical\n * recipe. We expose it here so workflow authors don't have to know that.\n */\nexport async function unhideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'unhide', 'the B2 file name')\n\n core.startGroup(`unhide b2://${bucket.name}/${source}`)\n try {\n const marker = await bucket.unhideFile(source)\n if (marker === null) {\n core.info(` no hide marker found for ${source} (already visible or non-existent)`)\n return { fileName: source, removedMarkerFileId: null }\n }\n core.info(` removed hide marker fileId=${marker.fileId}, ${source} is now visible`)\n return { fileName: source, removedMarkerFileId: marker.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core';\n/**\n * Returns a copy with defaults filled in.\n */\nexport function getOptions(copy) {\n const result = {\n followSymbolicLinks: true,\n implicitDescendants: true,\n matchDirectories: true,\n omitBrokenSymbolicLinks: true,\n excludeHiddenFiles: false\n };\n if (copy) {\n if (typeof copy.followSymbolicLinks === 'boolean') {\n result.followSymbolicLinks = copy.followSymbolicLinks;\n core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);\n }\n if (typeof copy.implicitDescendants === 'boolean') {\n result.implicitDescendants = copy.implicitDescendants;\n core.debug(`implicitDescendants '${result.implicitDescendants}'`);\n }\n if (typeof copy.matchDirectories === 'boolean') {\n result.matchDirectories = copy.matchDirectories;\n core.debug(`matchDirectories '${result.matchDirectories}'`);\n }\n if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {\n result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;\n core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);\n }\n if (typeof copy.excludeHiddenFiles === 'boolean') {\n result.excludeHiddenFiles = copy.excludeHiddenFiles;\n core.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`);\n }\n }\n return result;\n}\n//# sourceMappingURL=internal-glob-options-helper.js.map","import * as path from 'path';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.\n *\n * For example, on Linux/macOS:\n * - `/ => /`\n * - `/hello => /`\n *\n * For example, on Windows:\n * - `C:\\ => C:\\`\n * - `C:\\hello => C:\\`\n * - `C: => C:`\n * - `C:hello => C:`\n * - `\\ => \\`\n * - `\\hello => \\`\n * - `\\\\hello => \\\\hello`\n * - `\\\\hello\\world => \\\\hello\\world`\n */\nexport function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}\n/**\n * Roots the path if not already rooted. On Windows, relative roots like `\\`\n * or `C:` are expanded based on the current working directory.\n */\nexport function ensureAbsoluteRoot(root, itemPath) {\n assert(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);\n assert(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Already rooted\n if (hasAbsoluteRoot(itemPath)) {\n return itemPath;\n }\n // Windows\n if (IS_WINDOWS) {\n // Check for itemPath like C: or C:foo\n if (itemPath.match(/^[A-Z]:[^\\\\/]|^[A-Z]:$/i)) {\n let cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n // Drive letter matches cwd? Expand to cwd\n if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {\n // Drive only, e.g. C:\n if (itemPath.length === 2) {\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}`;\n }\n // Drive + path, e.g. C:foo\n else {\n if (!cwd.endsWith('\\\\')) {\n cwd += '\\\\';\n }\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}${itemPath.substr(2)}`;\n }\n }\n // Different drive\n else {\n return `${itemPath[0]}:\\\\${itemPath.substr(2)}`;\n }\n }\n // Check for itemPath like \\ or \\foo\n else if (normalizeSeparators(itemPath).match(/^\\\\$|^\\\\[^\\\\]/)) {\n const cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n return `${cwd[0]}:\\\\${itemPath.substr(1)}`;\n }\n }\n assert(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);\n // Otherwise ensure root ends with a separator\n if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\\\'))) {\n // Intentionally empty\n }\n else {\n // Append separator\n root += path.sep;\n }\n return root + itemPath;\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\\\hello\\share` and `C:\\hello` (and using alternate separator).\n */\nexport function hasAbsoluteRoot(itemPath) {\n assert(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\\\hello\\share or C:\\hello\n return itemPath.startsWith('\\\\\\\\') || /^[A-Z]:\\\\/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\`, `\\hello`, `\\\\hello\\share`, `C:`, and `C:\\hello` (and using alternate separator).\n */\nexport function hasRoot(itemPath) {\n assert(itemPath, `isRooted parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\ or \\hello or \\\\hello\n // E.g. C: or C:\\hello\n return itemPath.startsWith('\\\\') || /^[A-Z]:/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * Removes redundant slashes and converts `/` to `\\` on Windows\n */\nexport function normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n/**\n * Normalizes the path separators and trims the trailing separator (when safe).\n * For example, `/foo/ => /foo` but `/ => /`\n */\nexport function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}\n//# sourceMappingURL=internal-path-helper.js.map","/**\n * Indicates whether a pattern matches a path\n */\nexport var MatchKind;\n(function (MatchKind) {\n /** Not matched */\n MatchKind[MatchKind[\"None\"] = 0] = \"None\";\n /** Matched if the path is a directory */\n MatchKind[MatchKind[\"Directory\"] = 1] = \"Directory\";\n /** Matched if the path is a regular file */\n MatchKind[MatchKind[\"File\"] = 2] = \"File\";\n /** Matched */\n MatchKind[MatchKind[\"All\"] = 3] = \"All\";\n})(MatchKind || (MatchKind = {}));\n//# sourceMappingURL=internal-match-kind.js.map","import * as pathHelper from './internal-path-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Given an array of patterns, returns an array of paths to search.\n * Duplicates and paths under other included paths are filtered out.\n */\nexport function getSearchPaths(patterns) {\n // Ignore negate patterns\n patterns = patterns.filter(x => !x.negate);\n // Create a map of all search paths\n const searchPathMap = {};\n for (const pattern of patterns) {\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n searchPathMap[key] = 'candidate';\n }\n const result = [];\n for (const pattern of patterns) {\n // Check if already included\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n if (searchPathMap[key] === 'included') {\n continue;\n }\n // Check for an ancestor search path\n let foundAncestor = false;\n let tempKey = key;\n let parent = pathHelper.dirname(tempKey);\n while (parent !== tempKey) {\n if (searchPathMap[parent]) {\n foundAncestor = true;\n break;\n }\n tempKey = parent;\n parent = pathHelper.dirname(tempKey);\n }\n // Include the search pattern in the result\n if (!foundAncestor) {\n result.push(pattern.searchPath);\n searchPathMap[key] = 'included';\n }\n }\n return result;\n}\n/**\n * Matches the patterns against the path\n */\nexport function match(patterns, itemPath) {\n let result = MatchKind.None;\n for (const pattern of patterns) {\n if (pattern.negate) {\n result &= ~pattern.match(itemPath);\n }\n else {\n result |= pattern.match(itemPath);\n }\n }\n return result;\n}\n/**\n * Checks whether to descend further into the directory\n */\nexport function partialMatch(patterns, itemPath) {\n return patterns.some(x => !x.negate && x.partialMatch(itemPath));\n}\n//# sourceMappingURL=internal-pattern-helper.js.map","export const balanced = (a, b, str) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a;\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b;\n const r = ma !== null && mb != null && range(ma, mb, str);\n return (r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n });\n};\nconst maybeMatch = (reg, str) => {\n const m = str.match(reg);\n return m ? m[0] : null;\n};\nexport const range = (a, b, str) => {\n let begs, beg, left, right = undefined, result;\n let ai = str.indexOf(a);\n let bi = str.indexOf(b, ai + 1);\n let i = ai;\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n }\n else if (begs.length === 1) {\n const r = begs.pop();\n if (r !== undefined)\n result = [r, bi];\n }\n else {\n beg = begs.pop();\n if (beg !== undefined && beg < left) {\n left = beg;\n right = bi;\n }\n bi = str.indexOf(b, i + 1);\n }\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n if (begs.length && right !== undefined) {\n result = [left, right];\n }\n }\n return result;\n};\n//# sourceMappingURL=index.js.map","import { balanced } from 'balanced-match';\nconst escSlash = '\\0SLASH' + Math.random() + '\\0';\nconst escOpen = '\\0OPEN' + Math.random() + '\\0';\nconst escClose = '\\0CLOSE' + Math.random() + '\\0';\nconst escComma = '\\0COMMA' + Math.random() + '\\0';\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0';\nconst escSlashPattern = new RegExp(escSlash, 'g');\nconst escOpenPattern = new RegExp(escOpen, 'g');\nconst escClosePattern = new RegExp(escClose, 'g');\nconst escCommaPattern = new RegExp(escComma, 'g');\nconst escPeriodPattern = new RegExp(escPeriod, 'g');\nconst slashPattern = /\\\\\\\\/g;\nconst openPattern = /\\\\{/g;\nconst closePattern = /\\\\}/g;\nconst commaPattern = /\\\\,/g;\nconst periodPattern = /\\\\\\./g;\nexport const EXPANSION_MAX = 100_000;\nfunction numeric(str) {\n return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);\n}\nfunction escapeBraces(str) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod);\n}\nfunction unescapeBraces(str) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.');\n}\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str) {\n if (!str) {\n return [''];\n }\n const parts = [];\n const m = balanced('{', '}', str);\n if (!m) {\n return str.split(',');\n }\n const { pre, body, post } = m;\n const p = pre.split(',');\n p[p.length - 1] += '{' + body + '}';\n const postParts = parseCommaParts(post);\n if (post.length) {\n ;\n p[p.length - 1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n parts.push.apply(parts, p);\n return parts;\n}\nexport function expand(str, options = {}) {\n if (!str) {\n return [];\n }\n const { max = EXPANSION_MAX } = options;\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2);\n }\n return expand_(escapeBraces(str), max, true).map(unescapeBraces);\n}\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\nfunction expand_(str, max, isTop) {\n /** @type {string[]} */\n const expansions = [];\n const m = balanced('{', '}', str);\n if (!m)\n return [str];\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre;\n const post = m.post.length ? expand_(m.post, max, false) : [''];\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k];\n expansions.push(expansion);\n }\n }\n else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n const isSequence = isNumericSequence || isAlphaSequence;\n const isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand_(str, max, true);\n }\n return [str];\n }\n let n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n }\n else {\n n = parseCommaParts(m.body);\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace);\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p);\n }\n /* c8 ignore stop */\n }\n }\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N;\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0]);\n const y = numeric(n[1]);\n const width = Math.max(n[0].length, n[1].length);\n let incr = n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n let test = lte;\n const reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n const pad = n.some(isPadded);\n N = [];\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\') {\n c = '';\n }\n }\n else {\n c = String(i);\n if (pad) {\n const need = width - c.length;\n if (need > 0) {\n const z = new Array(need + 1).join('0');\n if (i < 0) {\n c = '-' + z + c.slice(1);\n }\n else {\n c = z + c;\n }\n }\n }\n }\n N.push(c);\n }\n }\n else {\n N = [];\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j], max, false));\n }\n }\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion);\n }\n }\n }\n }\n return expansions;\n}\n//# sourceMappingURL=index.js.map","const MAX_PATTERN_LENGTH = 1024 * 64;\nexport const assertValidPattern = (pattern) => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern');\n }\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long');\n }\n};\n//# sourceMappingURL=assert-valid-pattern.js.map","// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n// { : [, /u flag required, negated]\nconst posixClasses = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n};\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s) => s.replace(/[[\\]\\\\-]/g, '\\\\$&');\n// escape all regexp magic characters\nconst regexpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges) => ranges.join('');\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (glob, position) => {\n const pos = position;\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression');\n }\n /* c8 ignore stop */\n const ranges = [];\n const negs = [];\n let i = pos + 1;\n let sawStart = false;\n let uflag = false;\n let escaping = false;\n let negate = false;\n let endPos = pos;\n let rangeStart = '';\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i);\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true;\n i++;\n continue;\n }\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1;\n break;\n }\n sawStart = true;\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true;\n i++;\n continue;\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true];\n }\n i += cls.length;\n if (neg)\n negs.push(unip);\n else\n ranges.push(unip);\n uflag = uflag || u;\n continue WHILE;\n }\n }\n }\n // now it's just a normal character, effectively\n escaping = false;\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));\n }\n else if (c === rangeStart) {\n ranges.push(braceEscape(c));\n }\n rangeStart = '';\n i++;\n continue;\n }\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'));\n i += 2;\n continue;\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c;\n i += 2;\n continue;\n }\n // not the start of a range, just a single character\n ranges.push(braceEscape(c));\n i++;\n }\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false];\n }\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true];\n }\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];\n return [regexpEscape(r), false, endPos - pos, false];\n }\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';\n const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs;\n return [comb, uflag, endPos - pos, true];\n};\n//# sourceMappingURL=brace-expressions.js.map","/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\nexport const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1');\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1');\n};\n//# sourceMappingURL=unescape.js.map","// parse a single path portion\nvar _a;\nimport { parseClass } from './brace-expressions.js';\nimport { unescape } from './unescape.js';\nconst types = new Set(['!', '?', '+', '*', '@']);\nconst isExtglobType = (c) => types.has(c);\nconst isExtglobAST = (c) => isExtglobType(c.type);\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n]);\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n]);\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n]);\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n]);\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))';\nconst startNoDot = '(?!\\\\.)';\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.']);\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.']);\nconst reSpecials = new Set('().*{}+?[]^$\\\\!');\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// any single thing other than /\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?';\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\nlet ID = 0;\nexport class AST {\n type;\n #root;\n #hasMagic;\n #uflag = false;\n #parts = [];\n #parent;\n #parentIndex;\n #negs;\n #filledNegs = false;\n #options;\n #toString;\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt = false;\n id = ++ID;\n get depth() {\n return (this.#parent?.depth ?? -1) + 1;\n }\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n };\n }\n constructor(type, parent, options = {}) {\n this.type = type;\n // extglobs are inherently magical\n if (type)\n this.#hasMagic = true;\n this.#parent = parent;\n this.#root = this.#parent ? this.#parent.#root : this;\n this.#options = this.#root === this ? options : this.#root.#options;\n this.#negs = this.#root === this ? [] : this.#root.#negs;\n if (type === '!' && !this.#root.#filledNegs)\n this.#negs.push(this);\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;\n }\n get hasMagic() {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined)\n return this.#hasMagic;\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string')\n continue;\n if (p.type || p.hasMagic)\n return (this.#hasMagic = true);\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic;\n }\n // reconstructs the pattern\n toString() {\n return (this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')'));\n }\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root)\n throw new Error('should only call on root');\n if (this.#filledNegs)\n return this;\n /* c8 ignore stop */\n // call toString() once to fill this out\n this.toString();\n this.#filledNegs = true;\n let n;\n while ((n = this.#negs.pop())) {\n if (n.type !== '!')\n continue;\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p = n;\n let pp = p.#parent;\n while (pp) {\n for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??');\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i]);\n }\n }\n p = pp;\n pp = p.#parent;\n }\n }\n return this;\n }\n push(...parts) {\n for (const p of parts) {\n if (p === '')\n continue;\n /* c8 ignore start */\n if (typeof p !== 'string' &&\n !(p instanceof _a && p.#parent === this)) {\n throw new Error('invalid part: ' + p);\n }\n /* c8 ignore stop */\n this.#parts.push(p);\n }\n }\n toJSON() {\n const ret = this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => p.toJSON())];\n if (this.isStart() && !this.type)\n ret.unshift([]);\n if (this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))) {\n ret.push({});\n }\n return ret;\n }\n isStart() {\n if (this.#root === this)\n return true;\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart())\n return false;\n if (this.#parentIndex === 0)\n return true;\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent;\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i];\n if (!(pp instanceof _a && pp.type === '!')) {\n return false;\n }\n }\n return true;\n }\n isEnd() {\n if (this.#root === this)\n return true;\n if (this.#parent?.type === '!')\n return true;\n if (!this.#parent?.isEnd())\n return false;\n if (!this.type)\n return this.#parent?.isEnd();\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0;\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1;\n }\n copyIn(part) {\n if (typeof part === 'string')\n this.push(part);\n else\n this.push(part.clone(this));\n }\n clone(parent) {\n const c = new _a(this.type, parent);\n for (const p of this.#parts) {\n c.copyIn(p);\n }\n return c;\n }\n static #parseAST(str, ast, pos, opt, extDepth) {\n const maxDepth = opt.maxExtglobRecursion ?? 2;\n let escaping = false;\n let inBrace = false;\n let braceStart = -1;\n let braceNeg = false;\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos;\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth;\n if (doRecurse) {\n ast.push(acc);\n acc = '';\n const ext = new _a(c, ast);\n i = _a.#parseAST(str, ext, i, opt, extDepth + 1);\n ast.push(ext);\n continue;\n }\n acc += c;\n }\n ast.push(acc);\n return i;\n }\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1;\n let part = new _a(null, ast);\n const parts = [];\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;\n part.push(acc);\n acc = '';\n const ext = new _a(c, part);\n part.push(ext);\n i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);\n continue;\n }\n if (c === '|') {\n part.push(acc);\n acc = '';\n parts.push(part);\n part = new _a(null, ast);\n continue;\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true;\n }\n part.push(acc);\n acc = '';\n ast.push(...parts, part);\n return i;\n }\n acc += c;\n }\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null;\n ast.#hasMagic = undefined;\n ast.#parts = [str.substring(pos - 1)];\n return i;\n }\n #canAdoptWithSpace(child) {\n return this.#canAdopt(child, adoptionWithSpaceMap);\n }\n #canAdopt(child, map = adoptionMap) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canAdoptType(gc.type, map);\n }\n #canAdoptType(c, map = adoptionAnyMap) {\n return !!map.get(this.type)?.includes(c);\n }\n #adoptWithSpace(child, index) {\n const gc = child.#parts[0];\n const blank = new _a(null, gc, this.options);\n blank.#parts.push('');\n gc.push(blank);\n this.#adopt(child, index);\n }\n #adopt(child, index) {\n const gc = child.#parts[0];\n this.#parts.splice(index, 1, ...gc.#parts);\n for (const p of gc.#parts) {\n if (typeof p === 'object')\n p.#parent = this;\n }\n this.#toString = undefined;\n }\n #canUsurpType(c) {\n const m = usurpMap.get(this.type);\n return !!m?.has(c);\n }\n #canUsurp(child) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canUsurpType(gc.type);\n }\n #usurp(child) {\n const m = usurpMap.get(this.type);\n const gc = child.#parts[0];\n const nt = m?.get(gc.type);\n /* c8 ignore start - impossible */\n if (!nt)\n return false;\n /* c8 ignore stop */\n this.#parts = gc.#parts;\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this;\n }\n }\n this.type = nt;\n this.#toString = undefined;\n this.#emptyExt = false;\n }\n static fromGlob(pattern, options = {}) {\n const ast = new _a(null, undefined, options);\n _a.#parseAST(pattern, ast, 0, options, 0);\n return ast;\n }\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern() {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root)\n return this.#root.toMMPattern();\n /* c8 ignore stop */\n const glob = this.toString();\n const [re, body, hasMagic, uflag] = this.toRegExpSource();\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic = hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase());\n if (!anyMagic) {\n return body;\n }\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n });\n }\n get options() {\n return this.#options;\n }\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(allowDot) {\n const dot = allowDot ?? !!this.#options.dot;\n if (this.#root === this) {\n this.#flatten();\n this.#fillNegs();\n }\n if (!isExtglobAST(this)) {\n const noEmpty = this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string');\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] = typeof p === 'string' ?\n _a.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot);\n this.#hasMagic = this.#hasMagic || hasMagic;\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .join('');\n let start = '';\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);\n if (!dotTravAllowed) {\n const aps = addPatternStart;\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav = \n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)));\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : '';\n }\n }\n }\n // append the \"end of path portion\" pattern to negation tails\n let end = '';\n if (this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!') {\n end = '(?:$|\\\\/)';\n }\n const final = start + src + end;\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n const repeated = this.type === '*' || this.type === '+';\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:';\n let body = this.#partsToRegExp(dot);\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString();\n const me = this;\n me.#parts = [s];\n me.type = null;\n me.#hasMagic = undefined;\n return [s, unescape(this.toString()), false, false];\n }\n let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true);\n if (bodyDotAllowed === body) {\n bodyDotAllowed = '';\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`;\n }\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = '';\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;\n }\n else {\n const close = this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`;\n final = start + body + close;\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten();\n }\n }\n }\n else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0;\n let done = false;\n do {\n done = true;\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i];\n if (typeof c === 'object') {\n c.#flatten();\n if (this.#canAdopt(c)) {\n done = false;\n this.#adopt(c, i);\n }\n else if (this.#canAdoptWithSpace(c)) {\n done = false;\n this.#adoptWithSpace(c, i);\n }\n else if (this.#canUsurp(c)) {\n done = false;\n this.#usurp(c);\n }\n }\n }\n } while (!done && ++iterations < 10);\n }\n this.#toString = undefined;\n }\n #partsToRegExp(dot) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??');\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|');\n }\n static #parseGlob(glob, hasMagic, noEmpty = false) {\n let escaping = false;\n let re = '';\n let uflag = false;\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false;\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i);\n if (escaping) {\n escaping = false;\n re += (reSpecials.has(c) ? '\\\\' : '') + c;\n continue;\n }\n if (c === '*') {\n if (inStar)\n continue;\n inStar = true;\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;\n hasMagic = true;\n continue;\n }\n else {\n inStar = false;\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\';\n }\n else {\n escaping = true;\n }\n continue;\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i);\n if (consumed) {\n re += src;\n uflag = uflag || needUflag;\n i += consumed - 1;\n hasMagic = hasMagic || magic;\n continue;\n }\n }\n if (c === '?') {\n re += qmark;\n hasMagic = true;\n continue;\n }\n re += regExpEscape(c);\n }\n return [re, unescape(glob), !!hasMagic, uflag];\n }\n}\n_a = AST;\n//# sourceMappingURL=ast.js.map","/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&');\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&');\n};\n//# sourceMappingURL=escape.js.map","import { expand } from 'brace-expansion';\nimport { assertValidPattern } from './assert-valid-pattern.js';\nimport { AST } from './ast.js';\nimport { escape } from './escape.js';\nimport { unescape } from './unescape.js';\nexport const minimatch = (p, pattern, options = {}) => {\n assertValidPattern(pattern);\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false;\n }\n return new Minimatch(pattern, options).match(p);\n};\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/;\nconst starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);\nconst starDotExtTestDot = (ext) => (f) => f.endsWith(ext);\nconst starDotExtTestNocase = (ext) => {\n ext = ext.toLowerCase();\n return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);\n};\nconst starDotExtTestNocaseDot = (ext) => {\n ext = ext.toLowerCase();\n return (f) => f.toLowerCase().endsWith(ext);\n};\nconst starDotStarRE = /^\\*+\\.\\*+$/;\nconst starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');\nconst starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');\nconst dotStarRE = /^\\.\\*+$/;\nconst dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');\nconst starRE = /^\\*+$/;\nconst starTest = (f) => f.length !== 0 && !f.startsWith('.');\nconst starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/;\nconst qmarksTestNocase = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestNocaseDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTest = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTestNoExt = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && !f.startsWith('.');\n};\nconst qmarksTestNoExtDot = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && f !== '.' && f !== '..';\n};\n/* c8 ignore start */\nconst defaultPlatform = (typeof process === 'object' && process ?\n (typeof process.env === 'object' &&\n process.env &&\n process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n process.platform\n : 'posix');\nconst path = {\n win32: { sep: '\\\\' },\n posix: { sep: '/' },\n};\n/* c8 ignore stop */\nexport const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;\nminimatch.sep = sep;\nexport const GLOBSTAR = Symbol('globstar **');\nminimatch.GLOBSTAR = GLOBSTAR;\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?';\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?';\nexport const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);\nminimatch.filter = filter;\nconst ext = (a, b = {}) => Object.assign({}, a, b);\nexport const defaults = (def) => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch;\n }\n const orig = minimatch;\n const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));\n return Object.assign(m, {\n Minimatch: class Minimatch extends orig.Minimatch {\n constructor(pattern, options = {}) {\n super(pattern, ext(def, options));\n }\n static defaults(options) {\n return orig.defaults(ext(def, options)).Minimatch;\n }\n },\n AST: class AST extends orig.AST {\n /* c8 ignore start */\n constructor(type, parent, options = {}) {\n super(type, parent, ext(def, options));\n }\n /* c8 ignore stop */\n static fromGlob(pattern, options = {}) {\n return orig.AST.fromGlob(pattern, ext(def, options));\n }\n },\n unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),\n escape: (s, options = {}) => orig.escape(s, ext(def, options)),\n filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),\n defaults: (options) => orig.defaults(ext(def, options)),\n makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),\n braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),\n match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),\n sep: orig.sep,\n GLOBSTAR: GLOBSTAR,\n });\n};\nminimatch.defaults = defaults;\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (pattern, options = {}) => {\n assertValidPattern(pattern);\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern];\n }\n return expand(pattern, { max: options.braceExpandMax });\n};\nminimatch.braceExpand = braceExpand;\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nexport const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();\nminimatch.makeRe = makeRe;\nexport const match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options);\n list = list.filter(f => mm.match(f));\n if (mm.options.nonull && !list.length) {\n list.push(pattern);\n }\n return list;\n};\nminimatch.match = match;\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/;\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\nexport class Minimatch {\n options;\n set;\n pattern;\n windowsPathsNoEscape;\n nonegate;\n negate;\n comment;\n empty;\n preserveMultipleSlashes;\n partial;\n globSet;\n globParts;\n nocase;\n isWindows;\n platform;\n windowsNoMagicRoot;\n maxGlobstarRecursion;\n regexp;\n constructor(pattern, options = {}) {\n assertValidPattern(pattern);\n options = options || {};\n this.options = options;\n this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;\n this.pattern = pattern;\n this.platform = options.platform || defaultPlatform;\n this.isWindows = this.platform === 'win32';\n // avoid the annoying deprecation flag lol\n const awe = ('allowWindow' + 'sEscape');\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options[awe] === false;\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/');\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;\n this.regexp = null;\n this.negate = false;\n this.nonegate = !!options.nonegate;\n this.comment = false;\n this.empty = false;\n this.partial = !!options.partial;\n this.nocase = !!this.options.nocase;\n this.windowsNoMagicRoot =\n options.windowsNoMagicRoot !== undefined ?\n options.windowsNoMagicRoot\n : !!(this.isWindows && this.nocase);\n this.globSet = [];\n this.globParts = [];\n this.set = [];\n // make the set of regexps etc.\n this.make();\n }\n hasMagic() {\n if (this.options.magicalBraces && this.set.length > 1) {\n return true;\n }\n for (const pattern of this.set) {\n for (const part of pattern) {\n if (typeof part !== 'string')\n return true;\n }\n }\n return false;\n }\n debug(..._) { }\n make() {\n const pattern = this.pattern;\n const options = this.options;\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true;\n return;\n }\n if (!pattern) {\n this.empty = true;\n return;\n }\n // step 1: figure out negation, etc.\n this.parseNegate();\n // step 2: expand braces\n this.globSet = [...new Set(this.braceExpand())];\n if (options.debug) {\n //oxlint-disable-next-line no-console\n this.debug = (...args) => console.error(...args);\n }\n this.debug(this.pattern, this.globSet);\n // step 3: now we have a set, so turn each one into a series of\n // path-portion matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n //\n // First, we preprocess to make the glob pattern sets a bit simpler\n // and deduped. There are some perf-killing patterns that can cause\n // problems with a glob walk, but we can simplify them down a bit.\n const rawGlobParts = this.globSet.map(s => this.slashSplit(s));\n this.globParts = this.preprocess(rawGlobParts);\n this.debug(this.pattern, this.globParts);\n // glob --> regexps\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path.\n const isUNC = s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n !globMagic.test(s[3]);\n const isDrive = /^[a-z]:/i.test(s[0]);\n if (isUNC) {\n return [\n ...s.slice(0, 4),\n ...s.slice(4).map(ss => this.parse(ss)),\n ];\n }\n else if (isDrive) {\n return [s[0], ...s.slice(1).map(ss => this.parse(ss))];\n }\n }\n return s.map(ss => this.parse(ss));\n });\n this.debug(this.pattern, set);\n // filter out everything that didn't compile properly.\n this.set = set.filter(s => s.indexOf(false) === -1);\n // do not treat the ? in UNC paths as magic\n if (this.isWindows) {\n for (let i = 0; i < this.set.length; i++) {\n const p = this.set[i];\n if (p[0] === '' &&\n p[1] === '' &&\n this.globParts[i][2] === '?' &&\n typeof p[3] === 'string' &&\n /^[a-z]:$/i.test(p[3])) {\n p[2] = '?';\n }\n }\n }\n this.debug(this.pattern, this.set);\n }\n // various transforms to equivalent pattern sets that are\n // faster to process in a filesystem walk. The goal is to\n // eliminate what we can, and push all ** patterns as far\n // to the right as possible, even if it increases the number\n // of patterns that we have to process.\n preprocess(globParts) {\n // if we're not in globstar mode, then turn ** into *\n if (this.options.noglobstar) {\n for (const partset of globParts) {\n for (let j = 0; j < partset.length; j++) {\n if (partset[j] === '**') {\n partset[j] = '*';\n }\n }\n }\n }\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n // aggressive optimization for the purpose of fs walking\n globParts = this.firstPhasePreProcess(globParts);\n globParts = this.secondPhasePreProcess(globParts);\n }\n else if (optimizationLevel >= 1) {\n // just basic optimizations to remove some .. parts\n globParts = this.levelOneOptimize(globParts);\n }\n else {\n // just collapse multiple ** portions into one\n globParts = this.adjascentGlobstarOptimize(globParts);\n }\n return globParts;\n }\n // just get rid of adjascent ** portions\n adjascentGlobstarOptimize(globParts) {\n return globParts.map(parts => {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let i = gs;\n while (parts[i + 1] === '**') {\n i++;\n }\n if (i !== gs) {\n parts.splice(gs, i - gs);\n }\n }\n return parts;\n });\n }\n // get rid of adjascent ** and resolve .. portions\n levelOneOptimize(globParts) {\n return globParts.map(parts => {\n parts = parts.reduce((set, part) => {\n const prev = set[set.length - 1];\n if (part === '**' && prev === '**') {\n return set;\n }\n if (part === '..') {\n if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n set.pop();\n return set;\n }\n }\n set.push(part);\n return set;\n }, []);\n return parts.length === 0 ? [''] : parts;\n });\n }\n levelTwoFileOptimize(parts) {\n if (!Array.isArray(parts)) {\n parts = this.slashSplit(parts);\n }\n let didSomething = false;\n do {\n didSomething = false;\n //
// -> 
/\n            if (!this.preserveMultipleSlashes) {\n                for (let i = 1; i < parts.length - 1; i++) {\n                    const p = parts[i];\n                    // don't squeeze out UNC patterns\n                    if (i === 1 && p === '' && parts[0] === '')\n                        continue;\n                    if (p === '.' || p === '') {\n                        didSomething = true;\n                        parts.splice(i, 1);\n                        i--;\n                    }\n                }\n                if (parts[0] === '.' &&\n                    parts.length === 2 &&\n                    (parts[1] === '.' || parts[1] === '')) {\n                    didSomething = true;\n                    parts.pop();\n                }\n            }\n            // 
/

/../ ->

/\n            let dd = 0;\n            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                const p = parts[dd - 1];\n                if (p &&\n                    p !== '.' &&\n                    p !== '..' &&\n                    p !== '**' &&\n                    !(this.isWindows && /^[a-z]:$/i.test(p))) {\n                    didSomething = true;\n                    parts.splice(dd - 1, 2);\n                    dd -= 2;\n                }\n            }\n        } while (didSomething);\n        return parts.length === 0 ? [''] : parts;\n    }\n    // First phase: single-pattern processing\n    // 
 is 1 or more portions\n    //  is 1 or more portions\n    // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n    // 
/

/../ ->

/\n    // **/**/ -> **/\n    //\n    // **/*/ -> */**/ <== not valid because ** doesn't follow\n    // this WOULD be allowed if ** did follow symlinks, or * didn't\n    firstPhasePreProcess(globParts) {\n        let didSomething = false;\n        do {\n            didSomething = false;\n            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss = gs;\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n                        gss++;\n                    }\n                    // eg, if gs is 2 and gss is 4, that means we have 3 **\n                    // parts, and can remove 2 of them.\n                    if (gss > gs) {\n                        parts.splice(gs + 1, gss - gs);\n                    }\n                    let next = parts[gs + 1];\n                    const p = parts[gs + 2];\n                    const p2 = parts[gs + 3];\n                    if (next !== '..')\n                        continue;\n                    if (!p ||\n                        p === '.' ||\n                        p === '..' ||\n                        !p2 ||\n                        p2 === '.' ||\n                        p2 === '..') {\n                        continue;\n                    }\n                    didSomething = true;\n                    // edit parts in place, and push the new one\n                    parts.splice(gs, 1);\n                    const other = parts.slice(0);\n                    other[gs] = '**';\n                    globParts.push(other);\n                    gs--;\n                }\n                // 
// -> 
/\n                if (!this.preserveMultipleSlashes) {\n                    for (let i = 1; i < parts.length - 1; i++) {\n                        const p = parts[i];\n                        // don't squeeze out UNC patterns\n                        if (i === 1 && p === '' && parts[0] === '')\n                            continue;\n                        if (p === '.' || p === '') {\n                            didSomething = true;\n                            parts.splice(i, 1);\n                            i--;\n                        }\n                    }\n                    if (parts[0] === '.' &&\n                        parts.length === 2 &&\n                        (parts[1] === '.' || parts[1] === '')) {\n                        didSomething = true;\n                        parts.pop();\n                    }\n                }\n                // 
/

/../ ->

/\n                let dd = 0;\n                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                    const p = parts[dd - 1];\n                    if (p && p !== '.' && p !== '..' && p !== '**') {\n                        didSomething = true;\n                        const needDot = dd === 1 && parts[dd + 1] === '**';\n                        const splin = needDot ? ['.'] : [];\n                        parts.splice(dd - 1, 2, ...splin);\n                        if (parts.length === 0)\n                            parts.push('');\n                        dd -= 2;\n                    }\n                }\n            }\n        } while (didSomething);\n        return globParts;\n    }\n    // second phase: multi-pattern dedupes\n    // {
/*/,
/

/} ->

/*/\n    // {
/,
/} -> 
/\n    // {
/**/,
/} -> 
/**/\n    //\n    // {
/**/,
/**/

/} ->

/**/\n    // ^-- not valid because ** doens't follow symlinks\n    secondPhasePreProcess(globParts) {\n        for (let i = 0; i < globParts.length - 1; i++) {\n            for (let j = i + 1; j < globParts.length; j++) {\n                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);\n                if (matched) {\n                    globParts[i] = [];\n                    globParts[j] = matched;\n                    break;\n                }\n            }\n        }\n        return globParts.filter(gs => gs.length);\n    }\n    partsMatch(a, b, emptyGSMatch = false) {\n        let ai = 0;\n        let bi = 0;\n        let result = [];\n        let which = '';\n        while (ai < a.length && bi < b.length) {\n            if (a[ai] === b[bi]) {\n                result.push(which === 'b' ? b[bi] : a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n                result.push(a[ai]);\n                ai++;\n            }\n            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n                result.push(b[bi]);\n                bi++;\n            }\n            else if (a[ai] === '*' &&\n                b[bi] &&\n                (this.options.dot || !b[bi].startsWith('.')) &&\n                b[bi] !== '**') {\n                if (which === 'b')\n                    return false;\n                which = 'a';\n                result.push(a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (b[bi] === '*' &&\n                a[ai] &&\n                (this.options.dot || !a[ai].startsWith('.')) &&\n                a[ai] !== '**') {\n                if (which === 'a')\n                    return false;\n                which = 'b';\n                result.push(b[bi]);\n                ai++;\n                bi++;\n            }\n            else {\n                return false;\n            }\n        }\n        // if we fall out of the loop, it means they two are identical\n        // as long as their lengths match\n        return a.length === b.length && result;\n    }\n    parseNegate() {\n        if (this.nonegate)\n            return;\n        const pattern = this.pattern;\n        let negate = false;\n        let negateOffset = 0;\n        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n            negate = !negate;\n            negateOffset++;\n        }\n        if (negateOffset)\n            this.pattern = pattern.slice(negateOffset);\n        this.negate = negate;\n    }\n    // set partial to true to test if, for example,\n    // \"/a/b\" matches the start of \"/*/b/*/d\"\n    // Partial means, if you run out of file before you run\n    // out of pattern, then that's fine, as long as all\n    // the parts match.\n    matchOne(file, pattern, partial = false) {\n        let fileStartIndex = 0;\n        let patternStartIndex = 0;\n        // UNC paths like //?/X:/... can match X:/... and vice versa\n        // Drive letters in absolute drive or unc paths are always compared\n        // case-insensitively.\n        if (this.isWindows) {\n            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);\n            const fileUNC = !fileDrive &&\n                file[0] === '' &&\n                file[1] === '' &&\n                file[2] === '?' &&\n                /^[a-z]:$/i.test(file[3]);\n            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);\n            const patternUNC = !patternDrive &&\n                pattern[0] === '' &&\n                pattern[1] === '' &&\n                pattern[2] === '?' &&\n                typeof pattern[3] === 'string' &&\n                /^[a-z]:$/i.test(pattern[3]);\n            const fdi = fileUNC ? 3\n                : fileDrive ? 0\n                    : undefined;\n            const pdi = patternUNC ? 3\n                : patternDrive ? 0\n                    : undefined;\n            if (typeof fdi === 'number' && typeof pdi === 'number') {\n                const [fd, pd] = [\n                    file[fdi],\n                    pattern[pdi],\n                ];\n                // start matching at the drive letter index of each\n                if (fd.toLowerCase() === pd.toLowerCase()) {\n                    pattern[pdi] = fd;\n                    patternStartIndex = pdi;\n                    fileStartIndex = fdi;\n                }\n            }\n        }\n        // resolve and reduce . and .. portions in the file as well.\n        // don't need to do the second phase, because it's only one string[]\n        const { optimizationLevel = 1 } = this.options;\n        if (optimizationLevel >= 2) {\n            file = this.levelTwoFileOptimize(file);\n        }\n        if (pattern.includes(GLOBSTAR)) {\n            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);\n        }\n        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);\n    }\n    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {\n        // split the pattern into head, tail, and middle of ** delimited parts\n        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);\n        const lastgs = pattern.lastIndexOf(GLOBSTAR);\n        // split the pattern up into globstar-delimited sections\n        // the tail has to be at the end, and the others just have\n        // to be found in order from the head.\n        const [head, body, tail] = partial ?\n            [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1),\n                [],\n            ]\n            : [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1, lastgs),\n                pattern.slice(lastgs + 1),\n            ];\n        // check the head, from the current file/pattern index.\n        if (head.length) {\n            const fileHead = file.slice(fileIndex, fileIndex + head.length);\n            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n                return false;\n            }\n            fileIndex += head.length;\n            patternIndex += head.length;\n        }\n        // now we know the head matches!\n        // if the last portion is not empty, it MUST match the end\n        // check the tail\n        let fileTailMatch = 0;\n        if (tail.length) {\n            // if head + tail > file, then we cannot possibly match\n            if (tail.length + fileIndex > file.length)\n                return false;\n            // try to match the tail\n            let tailStart = file.length - tail.length;\n            if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n                fileTailMatch = tail.length;\n            }\n            else {\n                // affordance for stuff like a/**/* matching a/b/\n                // if the last file portion is '', and there's more to the pattern\n                // then try without the '' bit.\n                if (file[file.length - 1] !== '' ||\n                    fileIndex + tail.length === file.length) {\n                    return false;\n                }\n                tailStart--;\n                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n                    return false;\n                }\n                fileTailMatch = tail.length + 1;\n            }\n        }\n        // now we know the tail matches!\n        // the middle is zero or more portions wrapped in **, possibly\n        // containing more ** sections.\n        // so a/**/b/**/c/**/d has become **/b/**/c/**\n        // if it's empty, it means a/**/b, just verify we have no bad dots\n        // if there's no tail, so it ends on /**, then we must have *something*\n        // after the head, or it's not a matc\n        if (!body.length) {\n            let sawSome = !!fileTailMatch;\n            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n                const f = String(file[i]);\n                sawSome = true;\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            // in partial mode, we just need to get past all file parts\n            return partial || sawSome;\n        }\n        // now we know that there's one or more body sections, which can\n        // be matched anywhere from the 0 index (because the head was pruned)\n        // through to the length-fileTailMatch index.\n        // split the body up into sections, and note the minimum index it can\n        // be found at (start with the length of all previous segments)\n        // [section, before, after]\n        const bodySegments = [[[], 0]];\n        let currentBody = bodySegments[0];\n        let nonGsParts = 0;\n        const nonGsPartsSums = [0];\n        for (const b of body) {\n            if (b === GLOBSTAR) {\n                nonGsPartsSums.push(nonGsParts);\n                currentBody = [[], 0];\n                bodySegments.push(currentBody);\n            }\n            else {\n                currentBody[0].push(b);\n                nonGsParts++;\n            }\n        }\n        let i = bodySegments.length - 1;\n        const fileLength = file.length - fileTailMatch;\n        for (const b of bodySegments) {\n            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);\n        }\n        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);\n    }\n    // return false for \"nope, not matching\"\n    // return null for \"not matching, cannot keep trying\"\n    #matchGlobStarBodySections(file, \n    // pattern section, last possible position for it\n    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {\n        // take the first body segment, and walk from fileIndex to its \"after\"\n        // value at the end\n        // If it doesn't match at that position, we increment, until we hit\n        // that final possible position, and give up.\n        // If it does match, then advance and try to rest.\n        // If any of them fail we keep walking forward.\n        // this is still a bit recursively painful, but it's more constrained\n        // than previous implementations, because we never test something that\n        // can't possibly be a valid matching condition.\n        const bs = bodySegments[bodyIndex];\n        if (!bs) {\n            // just make sure that there's no bad dots\n            for (let i = fileIndex; i < file.length; i++) {\n                sawTail = true;\n                const f = file[i];\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            return sawTail;\n        }\n        // have a non-globstar body section to test\n        const [body, after] = bs;\n        while (fileIndex <= after) {\n            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);\n            // if limit exceeded, no match. intentional false negative,\n            // acceptable break in correctness for security.\n            if (m && globStarDepth < this.maxGlobstarRecursion) {\n                // match! see if the rest match. if so, we're done!\n                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);\n                if (sub !== false) {\n                    return sub;\n                }\n            }\n            const f = file[fileIndex];\n            if (f === '.' ||\n                f === '..' ||\n                (!this.options.dot && f.startsWith('.'))) {\n                return false;\n            }\n            fileIndex++;\n        }\n        // walked off. no point continuing\n        return partial || null;\n    }\n    #matchOne(file, pattern, partial, fileIndex, patternIndex) {\n        let fi;\n        let pi;\n        let pl;\n        let fl;\n        for (fi = fileIndex,\n            pi = patternIndex,\n            fl = file.length,\n            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {\n            this.debug('matchOne loop');\n            let p = pattern[pi];\n            let f = file[fi];\n            this.debug(pattern, p, f);\n            // should be impossible.\n            // some invalid regexp stuff in the set.\n            /* c8 ignore start */\n            if (p === false || p === GLOBSTAR) {\n                return false;\n            }\n            /* c8 ignore stop */\n            // something other than **\n            // non-magic patterns just have to match exactly\n            // patterns with magic have been turned into regexps.\n            let hit;\n            if (typeof p === 'string') {\n                hit = f === p;\n                this.debug('string match', p, f, hit);\n            }\n            else {\n                hit = p.test(f);\n                this.debug('pattern match', p, f, hit);\n            }\n            if (!hit)\n                return false;\n        }\n        // Note: ending in / means that we'll get a final \"\"\n        // at the end of the pattern.  This can only match a\n        // corresponding \"\" at the end of the file.\n        // If the file ends in /, then it can only match a\n        // a pattern that ends in /, unless the pattern just\n        // doesn't have any more for it. But, a/b/ should *not*\n        // match \"a/b/*\", even though \"\" matches against the\n        // [^/]*? pattern, except in partial mode, where it might\n        // simply not be reached yet.\n        // However, a/b/ should still satisfy a/*\n        // now either we fell off the end of the pattern, or we're done.\n        if (fi === fl && pi === pl) {\n            // ran out of pattern and filename at the same time.\n            // an exact hit!\n            return true;\n        }\n        else if (fi === fl) {\n            // ran out of file, but still had pattern left.\n            // this is ok if we're doing the match as part of\n            // a glob fs traversal.\n            return partial;\n        }\n        else if (pi === pl) {\n            // ran out of pattern, still have file left.\n            // this is only acceptable if we're on the very last\n            // empty segment of a file with a trailing slash.\n            // a/* should match a/b/\n            return fi === fl - 1 && file[fi] === '';\n            /* c8 ignore start */\n        }\n        else {\n            // should be unreachable.\n            throw new Error('wtf?');\n        }\n        /* c8 ignore stop */\n    }\n    braceExpand() {\n        return braceExpand(this.pattern, this.options);\n    }\n    parse(pattern) {\n        assertValidPattern(pattern);\n        const options = this.options;\n        // shortcuts\n        if (pattern === '**')\n            return GLOBSTAR;\n        if (pattern === '')\n            return '';\n        // far and away, the most common glob pattern parts are\n        // *, *.*, and *.  Add a fast check method for those.\n        let m;\n        let fastTest = null;\n        if ((m = pattern.match(starRE))) {\n            fastTest = options.dot ? starTestDot : starTest;\n        }\n        else if ((m = pattern.match(starDotExtRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    starDotExtTestNocaseDot\n                    : starDotExtTestNocase\n                : options.dot ? starDotExtTestDot\n                    : starDotExtTest)(m[1]);\n        }\n        else if ((m = pattern.match(qmarksRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    qmarksTestNocaseDot\n                    : qmarksTestNocase\n                : options.dot ? qmarksTestDot\n                    : qmarksTest)(m);\n        }\n        else if ((m = pattern.match(starDotStarRE))) {\n            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;\n        }\n        else if ((m = pattern.match(dotStarRE))) {\n            fastTest = dotStarTest;\n        }\n        const re = AST.fromGlob(pattern, this.options).toMMPattern();\n        if (fastTest && typeof re === 'object') {\n            // Avoids overriding in frozen environments\n            Reflect.defineProperty(re, 'test', { value: fastTest });\n        }\n        return re;\n    }\n    makeRe() {\n        if (this.regexp || this.regexp === false)\n            return this.regexp;\n        // at this point, this.set is a 2d array of partial\n        // pattern strings, or \"**\".\n        //\n        // It's better to use .match().  This function shouldn't\n        // be used, really, but it's pretty convenient sometimes,\n        // when you just want to work with a regex.\n        const set = this.set;\n        if (!set.length) {\n            this.regexp = false;\n            return this.regexp;\n        }\n        const options = this.options;\n        const twoStar = options.noglobstar ? star\n            : options.dot ? twoStarDot\n                : twoStarNoDot;\n        const flags = new Set(options.nocase ? ['i'] : []);\n        // regexpify non-globstar patterns\n        // if ** is only item, then we just do one twoStar\n        // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n        // if ** is last, append (\\/twoStar|) to previous\n        // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n        // then filter out GLOBSTAR symbols\n        let re = set\n            .map(pattern => {\n            const pp = pattern.map(p => {\n                if (p instanceof RegExp) {\n                    for (const f of p.flags.split(''))\n                        flags.add(f);\n                }\n                return (typeof p === 'string' ? regExpEscape(p)\n                    : p === GLOBSTAR ? GLOBSTAR\n                        : p._src);\n            });\n            pp.forEach((p, i) => {\n                const next = pp[i + 1];\n                const prev = pp[i - 1];\n                if (p !== GLOBSTAR || prev === GLOBSTAR) {\n                    return;\n                }\n                if (prev === undefined) {\n                    if (next !== undefined && next !== GLOBSTAR) {\n                        pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next;\n                    }\n                    else {\n                        pp[i] = twoStar;\n                    }\n                }\n                else if (next === undefined) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?';\n                }\n                else if (next !== GLOBSTAR) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next;\n                    pp[i + 1] = GLOBSTAR;\n                }\n            });\n            const filtered = pp.filter(p => p !== GLOBSTAR);\n            // For partial matches, we need to make the pattern match\n            // any prefix of the full path. We do this by generating\n            // alternative patterns that match progressively longer prefixes.\n            if (this.partial && filtered.length >= 1) {\n                const prefixes = [];\n                for (let i = 1; i <= filtered.length; i++) {\n                    prefixes.push(filtered.slice(0, i).join('/'));\n                }\n                return '(?:' + prefixes.join('|') + ')';\n            }\n            return filtered.join('/');\n        })\n            .join('|');\n        // need to wrap in parens if we had more than one thing with |,\n        // otherwise only the first will be anchored to ^ and the last to $\n        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];\n        // must match entire pattern\n        // ending in a * or ** will make it less strict.\n        re = '^' + open + re + close + '$';\n        // In partial mode, '/' should always match as it's a valid prefix for any pattern\n        if (this.partial) {\n            re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$';\n        }\n        // can match anything, as long as it's not this.\n        if (this.negate)\n            re = '^(?!' + re + ').+$';\n        try {\n            this.regexp = new RegExp(re, [...flags].join(''));\n            /* c8 ignore start */\n        }\n        catch {\n            // should be impossible\n            this.regexp = false;\n        }\n        /* c8 ignore stop */\n        return this.regexp;\n    }\n    slashSplit(p) {\n        // if p starts with // on windows, we preserve that\n        // so that UNC paths aren't broken.  Otherwise, any number of\n        // / characters are coalesced into one, unless\n        // preserveMultipleSlashes is set to true.\n        if (this.preserveMultipleSlashes) {\n            return p.split('/');\n        }\n        else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n            // add an extra '' for the one we lose\n            return ['', ...p.split(/\\/+/)];\n        }\n        else {\n            return p.split(/\\/+/);\n        }\n    }\n    match(f, partial = this.partial) {\n        this.debug('match', f, this.pattern);\n        // short-circuit in the case of busted things.\n        // comments, etc.\n        if (this.comment) {\n            return false;\n        }\n        if (this.empty) {\n            return f === '';\n        }\n        if (f === '/' && partial) {\n            return true;\n        }\n        const options = this.options;\n        // windows: need to use /, not \\\n        if (this.isWindows) {\n            f = f.split('\\\\').join('/');\n        }\n        // treat the test path as a set of pathparts.\n        const ff = this.slashSplit(f);\n        this.debug(this.pattern, 'split', ff);\n        // just ONE of the pattern sets in this.set needs to match\n        // in order for it to be valid.  If negating, then just one\n        // match means that we have failed.\n        // Either way, return on the first hit.\n        const set = this.set;\n        this.debug(this.pattern, 'set', set);\n        // Find the basename of the path by looking for the last non-empty segment\n        let filename = ff[ff.length - 1];\n        if (!filename) {\n            for (let i = ff.length - 2; !filename && i >= 0; i--) {\n                filename = ff[i];\n            }\n        }\n        for (const pattern of set) {\n            let file = ff;\n            if (options.matchBase && pattern.length === 1) {\n                file = [filename];\n            }\n            const hit = this.matchOne(file, pattern, partial);\n            if (hit) {\n                if (options.flipNegate) {\n                    return true;\n                }\n                return !this.negate;\n            }\n        }\n        // didn't get any hits.  this is success if it's a negative\n        // pattern, failure otherwise.\n        if (options.flipNegate) {\n            return false;\n        }\n        return this.negate;\n    }\n    static defaults(def) {\n        return minimatch.defaults(def).Minimatch;\n    }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js';\nexport { escape } from './escape.js';\nexport { unescape } from './unescape.js';\n/* c8 ignore stop */\nminimatch.AST = AST;\nminimatch.Minimatch = Minimatch;\nminimatch.escape = escape;\nminimatch.unescape = unescape;\n//# sourceMappingURL=index.js.map","import * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Helper class for parsing paths into segments\n */\nexport class Path {\n    /**\n     * Constructs a Path\n     * @param itemPath Path or array of segments\n     */\n    constructor(itemPath) {\n        this.segments = [];\n        // String\n        if (typeof itemPath === 'string') {\n            assert(itemPath, `Parameter 'itemPath' must not be empty`);\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n            // Not rooted\n            if (!pathHelper.hasRoot(itemPath)) {\n                this.segments = itemPath.split(path.sep);\n            }\n            // Rooted\n            else {\n                // Add all segments, while not at the root\n                let remaining = itemPath;\n                let dir = pathHelper.dirname(remaining);\n                while (dir !== remaining) {\n                    // Add the segment\n                    const basename = path.basename(remaining);\n                    this.segments.unshift(basename);\n                    // Truncate the last segment\n                    remaining = dir;\n                    dir = pathHelper.dirname(remaining);\n                }\n                // Remainder is the root\n                this.segments.unshift(remaining);\n            }\n        }\n        // Array\n        else {\n            // Must not be empty\n            assert(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);\n            // Each segment\n            for (let i = 0; i < itemPath.length; i++) {\n                let segment = itemPath[i];\n                // Must not be empty\n                assert(segment, `Parameter 'itemPath' must not contain any empty segments`);\n                // Normalize slashes\n                segment = pathHelper.normalizeSeparators(itemPath[i]);\n                // Root segment\n                if (i === 0 && pathHelper.hasRoot(segment)) {\n                    segment = pathHelper.safeTrimTrailingSeparator(segment);\n                    assert(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);\n                    this.segments.push(segment);\n                }\n                // All other segments\n                else {\n                    // Must not contain slash\n                    assert(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);\n                    this.segments.push(segment);\n                }\n            }\n        }\n    }\n    /**\n     * Converts the path to it's string representation\n     */\n    toString() {\n        // First segment\n        let result = this.segments[0];\n        // All others\n        let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n        for (let i = 1; i < this.segments.length; i++) {\n            if (skipSlash) {\n                skipSlash = false;\n            }\n            else {\n                result += path.sep;\n            }\n            result += this.segments[i];\n        }\n        return result;\n    }\n}\n//# sourceMappingURL=internal-path.js.map","import * as os from 'os';\nimport * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nimport { Minimatch } from 'minimatch';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Path } from './internal-path.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class Pattern {\n    constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) {\n        /**\n         * Indicates whether matches should be excluded from the result set\n         */\n        this.negate = false;\n        // Pattern overload\n        let pattern;\n        if (typeof patternOrNegate === 'string') {\n            pattern = patternOrNegate.trim();\n        }\n        // Segments overload\n        else {\n            // Convert to pattern\n            segments = segments || [];\n            assert(segments.length, `Parameter 'segments' must not empty`);\n            const root = Pattern.getLiteral(segments[0]);\n            assert(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);\n            pattern = new Path(segments).toString().trim();\n            if (patternOrNegate) {\n                pattern = `!${pattern}`;\n            }\n        }\n        // Negate\n        while (pattern.startsWith('!')) {\n            this.negate = !this.negate;\n            pattern = pattern.substr(1).trim();\n        }\n        // Normalize slashes and ensures absolute root\n        pattern = Pattern.fixupPattern(pattern, homedir);\n        // Segments\n        this.segments = new Path(pattern).segments;\n        // Trailing slash indicates the pattern should only match directories, not regular files\n        this.trailingSeparator = pathHelper\n            .normalizeSeparators(pattern)\n            .endsWith(path.sep);\n        pattern = pathHelper.safeTrimTrailingSeparator(pattern);\n        // Search path (literal path prior to the first glob segment)\n        let foundGlob = false;\n        const searchSegments = this.segments\n            .map(x => Pattern.getLiteral(x))\n            .filter(x => !foundGlob && !(foundGlob = x === ''));\n        this.searchPath = new Path(searchSegments).toString();\n        // Root RegExp (required when determining partial match)\n        this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : '');\n        this.isImplicitPattern = isImplicitPattern;\n        // Create minimatch\n        const minimatchOptions = {\n            dot: true,\n            nobrace: true,\n            nocase: IS_WINDOWS,\n            nocomment: true,\n            noext: true,\n            nonegate: true\n        };\n        pattern = IS_WINDOWS ? pattern.replace(/\\\\/g, '/') : pattern;\n        this.minimatch = new Minimatch(pattern, minimatchOptions);\n    }\n    /**\n     * Matches the pattern against the specified path\n     */\n    match(itemPath) {\n        // Last segment is globstar?\n        if (this.segments[this.segments.length - 1] === '**') {\n            // Normalize slashes\n            itemPath = pathHelper.normalizeSeparators(itemPath);\n            // Append a trailing slash. Otherwise Minimatch will not match the directory immediately\n            // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns\n            // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.\n            if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) {\n                // Note, this is safe because the constructor ensures the pattern has an absolute root.\n                // For example, formats like C: and C:foo on Windows are resolved to an absolute root.\n                itemPath = `${itemPath}${path.sep}`;\n            }\n        }\n        else {\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        }\n        // Match\n        if (this.minimatch.match(itemPath)) {\n            return this.trailingSeparator ? MatchKind.Directory : MatchKind.All;\n        }\n        return MatchKind.None;\n    }\n    /**\n     * Indicates whether the pattern may match descendants of the specified path\n     */\n    partialMatch(itemPath) {\n        // Normalize slashes and trim unnecessary trailing slash\n        itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        // matchOne does not handle root path correctly\n        if (pathHelper.dirname(itemPath) === itemPath) {\n            return this.rootRegExp.test(itemPath);\n        }\n        return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\\\+/ : /\\/+/), this.minimatch.set[0], true);\n    }\n    /**\n     * Escapes glob patterns within a path\n     */\n    static globEscape(s) {\n        return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n            .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n            .replace(/\\?/g, '[?]') // escape '?'\n            .replace(/\\*/g, '[*]'); // escape '*'\n    }\n    /**\n     * Normalizes slashes and ensures absolute root\n     */\n    static fixupPattern(pattern, homedir) {\n        // Empty\n        assert(pattern, 'pattern cannot be empty');\n        // Must not contain `.` segment, unless first segment\n        // Must not contain `..` segment\n        const literalSegments = new Path(pattern).segments.map(x => Pattern.getLiteral(x));\n        assert(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);\n        // Must not contain globs in root, e.g. Windows UNC path \\\\foo\\b*r\n        assert(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);\n        // Normalize slashes\n        pattern = pathHelper.normalizeSeparators(pattern);\n        // Replace leading `.` segment\n        if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) {\n            pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1);\n        }\n        // Replace leading `~` segment\n        else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {\n            homedir = homedir || os.homedir();\n            assert(homedir, 'Unable to determine HOME directory');\n            assert(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);\n            pattern = Pattern.globEscape(homedir) + pattern.substr(1);\n        }\n        // Replace relative drive root, e.g. pattern is C: or C:foo\n        else if (IS_WINDOWS &&\n            (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\\\]/i))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', pattern.substr(0, 2));\n            if (pattern.length > 2 && !root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(2);\n        }\n        // Replace relative root, e.g. pattern is \\ or \\foo\n        else if (IS_WINDOWS && (pattern === '\\\\' || pattern.match(/^\\\\[^\\\\]/))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', '\\\\');\n            if (!root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(1);\n        }\n        // Otherwise ensure absolute root\n        else {\n            pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern);\n        }\n        return pathHelper.normalizeSeparators(pattern);\n    }\n    /**\n     * Attempts to unescape a pattern segment to create a literal path segment.\n     * Otherwise returns empty string.\n     */\n    static getLiteral(segment) {\n        let literal = '';\n        for (let i = 0; i < segment.length; i++) {\n            const c = segment[i];\n            // Escape\n            if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n                literal += segment[++i];\n                continue;\n            }\n            // Wildcard\n            else if (c === '*' || c === '?') {\n                return '';\n            }\n            // Character set\n            else if (c === '[' && i + 1 < segment.length) {\n                let set = '';\n                let closed = -1;\n                for (let i2 = i + 1; i2 < segment.length; i2++) {\n                    const c2 = segment[i2];\n                    // Escape\n                    if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n                        set += segment[++i2];\n                        continue;\n                    }\n                    // Closed\n                    else if (c2 === ']') {\n                        closed = i2;\n                        break;\n                    }\n                    // Otherwise\n                    else {\n                        set += c2;\n                    }\n                }\n                // Closed?\n                if (closed >= 0) {\n                    // Cannot convert\n                    if (set.length > 1) {\n                        return '';\n                    }\n                    // Convert to literal\n                    if (set) {\n                        literal += set;\n                        i = closed;\n                        continue;\n                    }\n                }\n                // Otherwise fall thru\n            }\n            // Append\n            literal += c;\n        }\n        return literal;\n    }\n    /**\n     * Escapes regexp special characters\n     * https://javascript.info/regexp-escaping\n     */\n    static regExpEscape(s) {\n        return s.replace(/[[\\\\^$.|?*+()]/g, '\\\\$&');\n    }\n}\n//# sourceMappingURL=internal-pattern.js.map","export class SearchState {\n    constructor(path, level) {\n        this.path = path;\n        this.level = level;\n    }\n}\n//# sourceMappingURL=internal-search-state.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\n    return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n    function fulfill(value) { resume(\"next\", value); }\n    function reject(value) { resume(\"throw\", value); }\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as globOptionsHelper from './internal-glob-options-helper.js';\nimport * as path from 'path';\nimport * as patternHelper from './internal-pattern-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Pattern } from './internal-pattern.js';\nimport { SearchState } from './internal-search-state.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class DefaultGlobber {\n    constructor(options) {\n        this.patterns = [];\n        this.searchPaths = [];\n        this.options = globOptionsHelper.getOptions(options);\n    }\n    getSearchPaths() {\n        // Return a copy\n        return this.searchPaths.slice();\n    }\n    glob() {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a, e_1, _b, _c;\n            const result = [];\n            try {\n                for (var _d = true, _e = __asyncValues(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {\n                    _c = _f.value;\n                    _d = false;\n                    const itemPath = _c;\n                    result.push(itemPath);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            return result;\n        });\n    }\n    globGenerator() {\n        return __asyncGenerator(this, arguments, function* globGenerator_1() {\n            // Fill in defaults options\n            const options = globOptionsHelper.getOptions(this.options);\n            // Implicit descendants?\n            const patterns = [];\n            for (const pattern of this.patterns) {\n                patterns.push(pattern);\n                if (options.implicitDescendants &&\n                    (pattern.trailingSeparator ||\n                        pattern.segments[pattern.segments.length - 1] !== '**')) {\n                    patterns.push(new Pattern(pattern.negate, true, pattern.segments.concat('**')));\n                }\n            }\n            // Push the search paths\n            const stack = [];\n            for (const searchPath of patternHelper.getSearchPaths(patterns)) {\n                core.debug(`Search path '${searchPath}'`);\n                // Exists?\n                try {\n                    // Intentionally using lstat. Detection for broken symlink\n                    // will be performed later (if following symlinks).\n                    yield __await(fs.promises.lstat(searchPath));\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        continue;\n                    }\n                    throw err;\n                }\n                stack.unshift(new SearchState(searchPath, 1));\n            }\n            // Search\n            const traversalChain = []; // used to detect cycles\n            while (stack.length) {\n                // Pop\n                const item = stack.pop();\n                // Match?\n                const match = patternHelper.match(patterns, item.path);\n                const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path);\n                if (!match && !partialMatch) {\n                    continue;\n                }\n                // Stat\n                const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain)\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                );\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                if (!stats) {\n                    continue;\n                }\n                // Hidden file or directory?\n                if (options.excludeHiddenFiles && path.basename(item.path).match(/^\\./)) {\n                    continue;\n                }\n                // Directory\n                if (stats.isDirectory()) {\n                    // Matched\n                    if (match & MatchKind.Directory && options.matchDirectories) {\n                        yield yield __await(item.path);\n                    }\n                    // Descend?\n                    else if (!partialMatch) {\n                        continue;\n                    }\n                    // Push the child items in reverse\n                    const childLevel = item.level + 1;\n                    const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new SearchState(path.join(item.path, x), childLevel));\n                    stack.push(...childItems.reverse());\n                }\n                // File\n                else if (match & MatchKind.File) {\n                    yield yield __await(item.path);\n                }\n            }\n        });\n    }\n    /**\n     * Constructs a DefaultGlobber\n     */\n    static create(patterns, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const result = new DefaultGlobber(options);\n            if (IS_WINDOWS) {\n                patterns = patterns.replace(/\\r\\n/g, '\\n');\n                patterns = patterns.replace(/\\r/g, '\\n');\n            }\n            const lines = patterns.split('\\n').map(x => x.trim());\n            for (const line of lines) {\n                // Empty or comment\n                if (!line || line.startsWith('#')) {\n                    continue;\n                }\n                // Pattern\n                else {\n                    result.patterns.push(new Pattern(line));\n                }\n            }\n            result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns));\n            return result;\n        });\n    }\n    static stat(item, options, traversalChain) {\n        return __awaiter(this, void 0, void 0, function* () {\n            // Note:\n            // `stat` returns info about the target of a symlink (or symlink chain)\n            // `lstat` returns info about a symlink itself\n            let stats;\n            if (options.followSymbolicLinks) {\n                try {\n                    // Use `stat` (following symlinks)\n                    stats = yield fs.promises.stat(item.path);\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        if (options.omitBrokenSymbolicLinks) {\n                            core.debug(`Broken symlink '${item.path}'`);\n                            return undefined;\n                        }\n                        throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);\n                    }\n                    throw err;\n                }\n            }\n            else {\n                // Use `lstat` (not following symlinks)\n                stats = yield fs.promises.lstat(item.path);\n            }\n            // Note, isDirectory() returns false for the lstat of a symlink\n            if (stats.isDirectory() && options.followSymbolicLinks) {\n                // Get the realpath\n                const realPath = yield fs.promises.realpath(item.path);\n                // Fixup the traversal chain to match the item level\n                while (traversalChain.length >= item.level) {\n                    traversalChain.pop();\n                }\n                // Test for a cycle\n                if (traversalChain.some((x) => x === realPath)) {\n                    core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);\n                    return undefined;\n                }\n                // Update the traversal chain\n                traversalChain.push(realPath);\n            }\n            return stats;\n        });\n    }\n}\n//# sourceMappingURL=internal-globber.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"stream\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nimport * as crypto from 'crypto';\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as stream from 'stream';\nimport * as util from 'util';\nimport * as path from 'path';\nexport function hashFiles(globber_1, currentWorkspace_1) {\n    return __awaiter(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) {\n        var _a, e_1, _b, _c;\n        var _d;\n        const writeDelegate = verbose ? core.info : core.debug;\n        let hasMatch = false;\n        const githubWorkspace = currentWorkspace\n            ? currentWorkspace\n            : ((_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd());\n        const result = crypto.createHash('sha256');\n        let count = 0;\n        try {\n            for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {\n                _c = _g.value;\n                _e = false;\n                const file = _c;\n                writeDelegate(file);\n                if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {\n                    writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);\n                    continue;\n                }\n                if (fs.statSync(file).isDirectory()) {\n                    writeDelegate(`Skip directory '${file}'.`);\n                    continue;\n                }\n                const hash = crypto.createHash('sha256');\n                const pipeline = util.promisify(stream.pipeline);\n                yield pipeline(fs.createReadStream(file), hash);\n                result.write(hash.digest());\n                count++;\n                if (!hasMatch) {\n                    hasMatch = true;\n                }\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        result.end();\n        if (hasMatch) {\n            writeDelegate(`Found ${count} files to hash.`);\n            return result.digest('hex');\n        }\n        else {\n            writeDelegate(`No matches found for glob`);\n            return '';\n        }\n    });\n}\n//# sourceMappingURL=internal-hash-files.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { DefaultGlobber } from './internal-globber.js';\nimport { hashFiles as _hashFiles } from './internal-hash-files.js';\n/**\n * Constructs a globber\n *\n * @param patterns  Patterns separated by newlines\n * @param options   Glob options\n */\nexport function create(patterns, options) {\n    return __awaiter(this, void 0, void 0, function* () {\n        return yield DefaultGlobber.create(patterns, options);\n    });\n}\n/**\n * Computes the sha256 hash of a glob\n *\n * @param patterns  Patterns separated by newlines\n * @param currentWorkspace  Workspace used when matching files\n * @param options   Glob options\n * @param verbose   Enables verbose logging\n */\nexport function hashFiles(patterns_1) {\n    return __awaiter(this, arguments, void 0, function* (patterns, currentWorkspace = '', options, verbose = false) {\n        let followSymbolicLinks = true;\n        if (options && typeof options.followSymbolicLinks === 'boolean') {\n            followSymbolicLinks = options.followSymbolicLinks;\n        }\n        const globber = yield create(patterns, { followSymbolicLinks });\n        return _hashFiles(globber, currentWorkspace, verbose);\n    });\n}\n//# sourceMappingURL=glob.js.map","import { createReadStream } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { basename, posix, relative, resolve, sep } from 'node:path'\nimport { Readable } from 'node:stream'\nimport * as core from '@actions/core'\nimport * as glob from '@actions/glob'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { StreamSource } from '@backblaze-labs/b2-sdk/streams'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link UploadResult.files}. */\nexport interface UploadedFile {\n  /** Absolute path on the runner that was uploaded. */\n  localPath: string\n  /** B2 file name (the key) the upload landed under. */\n  fileName: string\n  /** B2 file ID assigned by the server. */\n  fileId: string\n  /** Byte size of the upload. */\n  size: number\n  /** Whole-file SHA-1, or `null` when the file was multipart-uploaded. */\n  contentSha1: string | null\n}\n\n/** Result of {@link uploadCommand}. */\nexport interface UploadResult {\n  /** One entry per uploaded file. Single-file mode returns a one-element array. */\n  files: UploadedFile[]\n  /** Total bytes uploaded across all files. */\n  bytesTransferred: number\n}\n\n/**\n * Upload one or more files to B2.\n *\n * Mode selection:\n *   - If `source` is a plain file path (no glob metacharacters and the path\n *     exists as a regular file), upload that single file. The B2 file name is\n *     `destination` if set; otherwise `basename(source)`.\n *   - Otherwise treat `source` (plus any `include` patterns) as glob(s). Each\n *     matched file is uploaded preserving its path relative to the glob root,\n *     prefixed by `destination` (default empty).\n *\n * Large files are streamed (StreamSource over a fs ReadStream-as-Web-Stream)\n * so we don't buffer the whole payload in RAM. The SDK's `Bucket.upload`\n * routes to multipart automatically when size exceeds the recommended part\n * size and parallelizes parts up to `concurrency`.\n */\nexport async function uploadCommand(\n  bucket: Bucket,\n  inputs: ParsedInputs,\n  signal?: AbortSignal,\n): Promise {\n  const source = requireSource(inputs.source, 'upload')\n\n  const { files, isSingleExplicitFile } = await resolveFiles(source, inputs.include, inputs.exclude)\n  if (files.length === 0) {\n    if (inputs.failOnEmpty) {\n      throw new Error(`No files matched: ${source}`)\n    }\n    core.warning(`No files matched: ${source}`)\n    return { files: [], bytesTransferred: 0 }\n  }\n\n  const fileConcurrency = isSingleExplicitFile ? 1 : inputs.concurrency\n  // Multi-file uploads spend the concurrency budget across files and keep each\n  // file's multipart upload sequential so total in-flight B2 requests remain\n  // bounded by the user-supplied `concurrency` value.\n  const partConcurrency = isSingleExplicitFile || files.length === 1 ? inputs.concurrency : 1\n\n  const uploaded = await mapWithConcurrency(files, fileConcurrency, async (f) => {\n    signal?.throwIfAborted()\n    const fileName = remapFileName(f, inputs.destination, isSingleExplicitFile)\n    const uploadLabel = `upload ${f.localPath} → b2://${bucket.name}/${fileName}`\n    const groupedLog = files.length === 1 || fileConcurrency === 1\n    if (groupedLog) {\n      core.startGroup(uploadLabel)\n    } else {\n      core.info(uploadLabel)\n    }\n    try {\n      return await uploadOne(\n        bucket,\n        f.localPath,\n        fileName,\n        inputs,\n        partConcurrency,\n        groupedLog,\n        signal,\n      )\n    } finally {\n      if (groupedLog) core.endGroup()\n    }\n  })\n  const totalBytes = uploaded.reduce((sum, file) => sum + file.size, 0)\n\n  return { files: uploaded, bytesTransferred: totalBytes }\n}\n\nasync function mapWithConcurrency(\n  items: T[],\n  concurrency: number,\n  mapper: (item: T) => Promise,\n): Promise {\n  const results = new Array(items.length)\n  let next = 0\n  let firstError: unknown\n  let failed = false\n\n  async function worker(): Promise {\n    while (true) {\n      if (failed) return\n      const index = next++\n      if (index >= items.length) return\n      try {\n        results[index] = await mapper(items[index] as T)\n      } catch (error) {\n        if (!failed) {\n          failed = true\n          firstError = error\n        }\n        return\n      }\n    }\n  }\n\n  const workerCount = Math.min(concurrency, items.length)\n  await Promise.all(Array.from({ length: workerCount }, () => worker()))\n  if (failed) throw firstError\n  return results\n}\n\ninterface ResolvedFiles {\n  files: ResolvedFile[]\n  isSingleExplicitFile: boolean\n}\n\n/**\n * Local file resolved from an upload source.\n *\n * @internal\n */\nexport interface ResolvedFile {\n  localPath: string\n  /** Path relative to the glob root, used when computing the B2 key. */\n  fileName: string\n}\n\nasync function resolveFiles(\n  source: string,\n  include: string[],\n  exclude: string[],\n): Promise {\n  const explicitFile = await tryStat(source)\n  const looksLikeGlob = /[*?[\\]]/.test(source)\n\n  if (explicitFile?.isFile() && !looksLikeGlob && include.length === 0) {\n    return {\n      files: [{ localPath: resolve(source), fileName: basename(source) }],\n      isSingleExplicitFile: true,\n    }\n  }\n\n  const patterns: string[] = []\n  if (explicitFile?.isDirectory()) {\n    patterns.push(`${resolve(source)}/**`)\n  } else {\n    patterns.push(source)\n  }\n  for (const p of include) patterns.push(p)\n  for (const p of exclude) patterns.push(`!${p}`)\n\n  const globber = await glob.create(patterns.join('\\n'), {\n    followSymbolicLinks: false,\n    matchDirectories: false,\n  })\n  const matches = await globber.glob()\n  const root = explicitFile?.isDirectory() ? resolve(source) : process.cwd()\n\n  const out: ResolvedFile[] = []\n  for (const m of matches) {\n    const s = await tryStat(m)\n    // Filesystem boundary: skip entries that aren't readable files (broken\n    // symlinks, races where a file is unlinked between glob and stat, etc.).\n    if (!s?.isFile()) continue\n    const rel = relative(root, m).split(sep).join(posix.sep)\n    out.push({ localPath: m, fileName: rel })\n  }\n  out.sort(compareResolvedFiles)\n  return { files: out, isSingleExplicitFile: false }\n}\n\nfunction compareResolvedFiles(a: ResolvedFile, b: ResolvedFile): number {\n  return compareStrings(a.fileName, b.fileName) || compareStrings(a.localPath, b.localPath)\n}\n\nfunction compareStrings(a: string, b: string): number {\n  if (a < b) return -1\n  if (a > b) return 1\n  return 0\n}\n\n/**\n * Map a local source file to its B2 file name under the requested destination.\n *\n * @internal\n */\nexport function remapFileName(\n  file: ResolvedFile,\n  destination: string | undefined,\n  isSingleExplicitFile: boolean,\n): string {\n  if (destination === undefined || destination === '') return file.fileName\n  const dest = destination.replace(/\\/+$/, '')\n  if (isSingleExplicitFile && !destination.endsWith('/')) return dest\n  return `${dest}/${file.fileName}`\n}\n\nasync function uploadOne(\n  bucket: Bucket,\n  localPath: string,\n  fileName: string,\n  inputs: ParsedInputs,\n  partConcurrency: number,\n  groupedLog: boolean,\n  signal?: AbortSignal,\n): Promise {\n  const fileStat = await stat(localPath)\n  const size = fileStat.size\n\n  // Stream the file from disk. The SDK's `bucket.upload` routes files larger\n  // than the recommended part size through `uploadLargeFile`, which now\n  // detects non-sliceable sources (StreamSource) and reads the stream once,\n  // shipping one part at a time. Peak memory ≈ partSize regardless of file\n  // size, so multi-GB uploads stay bounded.\n  const nodeStream = createReadStream(localPath)\n  const webStream = Readable.toWeb(nodeStream) as ReadableStream\n  const source = new StreamSource(webStream, size)\n\n  const onProgress = makeProgressListener(`upload[${fileName}]`)\n\n  // `inputs.resume` is parsed but deliberately NOT forwarded to the SDK.\n  // The SDK's resume implementation requires a sliceable source so it can\n  // re-upload specific part offsets after a crash. The action uses\n  // `StreamSource` (memory-bounded streaming from disk), which is read-once-\n  // sequential and not sliceable; passing `resume: true` here would throw\n  // `\"resume is not supported on non-sliceable sources\"`. The input is\n  // kept in the action surface so this can be re-enabled if the action\n  // ever offers a `BufferSource` fallback for users willing to trade RAM\n  // for resumability.\n  const result = await bucket.upload({\n    fileName,\n    source,\n    concurrency: partConcurrency,\n    ...(inputs.partSize !== undefined ? { partSize: inputs.partSize } : {}),\n    ...(inputs.contentType !== undefined ? { contentType: inputs.contentType } : {}),\n    ...(inputs.encryption !== undefined ? { serverSideEncryption: inputs.encryption } : {}),\n    ...(signal !== undefined ? { signal } : {}),\n    onProgress,\n  })\n\n  // SDK now normalizes multipart `'none'` to `null` at the boundary, so\n  // `result.contentSha1` is `string | null` directly.\n  const sha1 = result.contentSha1\n  const detailPrefix = groupedLog ? '  ' : ''\n  core.info(`${detailPrefix}fileId=${result.fileId} sha1=${sha1 ?? 'multipart'}`)\n\n  return {\n    localPath,\n    fileName: result.fileName,\n    fileId: result.fileId,\n    size,\n    contentSha1: sha1,\n  }\n}\n","import { createReadStream } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { IncrementalSha1 } from '@backblaze-labs/b2-sdk/streams'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link verifyCommand}. */\nexport interface VerifyResult {\n  /** B2 file name that was checked. */\n  fileName: string\n  /** Server-reported byte size of the remote object. */\n  remoteSize: number\n  /**\n   * Remote SHA-1 result: normalized lowercase digest when comparable, raw B2\n   * value for non-comparable headers such as `none` or `unverified:`,\n   * or `null` when B2 does not expose one.\n   */\n  remoteSha1: string | null\n  /** Locally-computed SHA-1, or `null` if no local file was provided. */\n  localSha1: string | null\n  /** True when remote SHA-1 matches the expected value. */\n  verified: boolean\n  /** Human-readable failure reason; `undefined` on success. */\n  reason: string | undefined\n}\n\n/**\n * Verify that a B2 object matches a local file (or an expected SHA-1) without\n * transferring the body.\n *\n * Three modes, in priority order:\n *   1. `expected-sha1` input set → compare the remote object's SHA-1 to that\n *      literal value. No local read.\n *   2. `destination` input is an existing local file → compute that file's\n *      SHA-1 locally and compare to the remote.\n *   3. Neither → fail.\n *\n * In all modes, the remote SHA-1 is fetched via a HEAD request (header\n * `x-bz-content-sha1`). Large files uploaded via multipart return `null` from\n * B2 here because B2 stores the per-part SHA-1s but not a whole-file SHA-1;\n * HEAD-only verification cannot validate those objects, even when\n * `expected-sha1` is supplied.\n */\nexport async function verifyCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n  const source = requireSource(inputs.source, 'verify', 'the B2 file name')\n\n  core.startGroup(`verify b2://${bucket.name}/${source}`)\n  try {\n    // `bucket.head` returns only the parsed response headers; no body to\n    // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n    const { headers } = await bucket.head(source)\n    const remoteSize = headers.contentLength\n    const remoteSha1 = headers.contentSha1\n\n    let localSha1: string | null = null\n    let expected: string | null =\n      inputs.expectedSha1 !== undefined ? normalizeSha1(inputs.expectedSha1, 'expected-sha1') : null\n\n    if (expected === null && inputs.destination !== undefined && inputs.destination !== '') {\n      localSha1 = await sha1OfFile(inputs.destination)\n      expected = normalizeSha1(localSha1, 'destination')\n    }\n\n    if (expected === null) {\n      throw new Error(\n        \"verify needs either 'expected-sha1' (literal) or 'destination' (local file path) to compare against\",\n      )\n    }\n\n    const normalizedRemoteSha1 = remoteSha1 === null ? null : normalizeRemoteSha1(remoteSha1)\n    if (normalizedRemoteSha1 === null) {\n      const reason = unavailableRemoteSha1Reason(remoteSha1)\n      core.warning(`  ${reason}`)\n      return {\n        fileName: source,\n        remoteSize,\n        remoteSha1,\n        localSha1,\n        verified: false,\n        reason,\n      }\n    }\n\n    const verified = normalizedRemoteSha1 === expected\n    const reason = verified\n      ? undefined\n      : `SHA-1 mismatch: remote=${normalizedRemoteSha1} expected=${expected}`\n    if (verified) {\n      core.info(`  ✓ SHA-1 matches (${normalizedRemoteSha1}), size=${remoteSize}B`)\n    } else {\n      core.warning(`  ${reason}`)\n    }\n\n    return {\n      fileName: source,\n      remoteSize,\n      remoteSha1: normalizedRemoteSha1,\n      localSha1,\n      verified,\n      reason,\n    }\n  } finally {\n    core.endGroup()\n  }\n}\n\n/**\n * Normalize and validate a SHA-1 digest for case-insensitive comparison.\n *\n * @internal\n */\nexport function normalizeSha1(raw: string, label = 'SHA-1'): string {\n  const normalized = raw.trim().toLowerCase()\n  if (!/^[a-f0-9]{40}$/.test(normalized)) {\n    throw new Error(`Invalid ${label}: expected a 40-character hexadecimal SHA-1 digest`)\n  }\n  return normalized\n}\n\nfunction normalizeRemoteSha1(raw: string): string | null {\n  const normalized = raw.trim().toLowerCase()\n  return /^[a-f0-9]{40}$/.test(normalized) ? normalized : null\n}\n\nfunction unavailableRemoteSha1Reason(remoteSha1: string | null): string {\n  if (remoteSha1 === null) {\n    return 'remote SHA-1 is unavailable because B2 does not expose a whole-file SHA-1 for multipart-uploaded files; HEAD-only verify cannot validate this object, even with expected-sha1'\n  }\n  return `remote SHA-1 is unavailable because B2 reported ${JSON.stringify(remoteSha1)} instead of a verified 40-character whole-file SHA-1; HEAD-only verify cannot validate this object, even with expected-sha1`\n}\n\nasync function sha1OfFile(path: string): Promise {\n  const fileStat = await stat(path)\n  if (!fileStat.isFile()) {\n    throw new Error(`verify: 'destination' must be an existing file, got: ${path}`)\n  }\n  const hasher = new IncrementalSha1()\n  const stream = createReadStream(path)\n  for await (const chunk of stream) {\n    await hasher.update(chunk as Uint8Array)\n  }\n  return hasher.digest()\n}\n","import {\n  AccessDeniedError,\n  B2Error,\n  B2InsufficientCapabilityError,\n  B2SsrfError,\n  BadAuthTokenError,\n  NetworkError,\n} from '@backblaze-labs/b2-sdk/errors'\nimport { ACTION_EFFECTS, type ActionName } from './inputs.ts'\n\nconst SAFE_RETRY_HINT = 'safe to retry this workflow.'\nconst DRY_RUN_RETRY_HINT = 'safe to retry this dry-run workflow.'\nconst MUTATING_RETRY_SUFFIX =\n  'action may have partially committed; inspect B2 state before rerunning to avoid duplicate file versions, orphaned large-file uploads, or unintended deletes.'\nconst UNKNOWN_RETRY_HINT =\n  'retry may be appropriate after checking whether the request had side effects.'\nconst SSRF_FAILURE_MESSAGE =\n  'B2 endpoint safety check failed: rejected an unsafe B2 endpoint or server-provided URL. Check the endpoint input and B2 realm configuration.'\nconst MAX_LOG_FIELD_LENGTH = 1_000\nconst MAX_LOG_INPUT_LENGTH = MAX_LOG_FIELD_LENGTH * 2\nconst MAX_SECRET_BOUNDARY_WINDOW = MAX_LOG_INPUT_LENGTH\nconst MAX_DERIVED_SECRET_LENGTH = 512\nconst DEFAULT_NETWORK_RETRY_AFTER_SECONDS = 30\nconst MAX_RETRY_AFTER_SECONDS = 3_600\nconst MAX_CAUSE_DEPTH = 32\n\nexport interface ActionErrorOptions {\n  action?: ActionName\n  dryRun?: boolean\n  secretValues?: readonly string[]\n}\n\nexport interface ClassifiedActionError {\n  message: string\n  retryable: boolean | undefined\n  retryAfter: number | undefined\n}\n\nexport function classifyActionError(\n  err: unknown,\n  options: ActionErrorOptions = {},\n): ClassifiedActionError {\n  // Order matters: specific SDK classes first, then retryable B2Error, then\n  // the generic B2Error fallback last so new subclasses are not shadowed.\n  if (hasSsrfCause(err)) {\n    return failure(SSRF_FAILURE_MESSAGE, false)\n  }\n  if (err instanceof BadAuthTokenError && isAuthorizationScopeFailure(err)) {\n    return failure(\n      `B2 permission denied: application key is missing required capabilities or is outside the bucket/prefix scope. Update the key capabilities or use a key scoped to this bucket/prefix. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof BadAuthTokenError) {\n    return failure(\n      `B2 authentication failed: check application-key-id and application-key, and confirm the key is active. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof B2InsufficientCapabilityError) {\n    const missing = err.missing.length > 0 ? err.missing.join(', ') : '(unknown)'\n    return failure(\n      `B2 permission denied: application key is missing required capabilities: ${sanitizeLogField(missing, options)}. Update the key capabilities or use a key scoped to this bucket/prefix.`,\n      false,\n    )\n  }\n  if (err instanceof AccessDeniedError) {\n    return failure(\n      `B2 permission denied: check application key capabilities, bucket access, and file name prefix restrictions. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof NetworkError) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient network error talking to B2: ${retry.hint} ${sanitizeLogField(err.message, options)}`,\n      retry.safe,\n      retry.safe ? DEFAULT_NETWORK_RETRY_AFTER_SECONDS : undefined,\n    )\n  }\n  if (err instanceof B2Error && err.retryable) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient B2 error: ${retry.hint} ${formatB2Details(err, options)}`,\n      retry.safe,\n      retry.safe ? err.retryAfter : undefined,\n    )\n  }\n  if (err instanceof B2Error) {\n    return failure(\n      `B2 request failed: ${formatGenericB2Guidance(err, options)} ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  const message = err instanceof Error ? err.message : String(err)\n  return failure(sanitizeLogField(message, options), undefined)\n}\n\nexport function formatActionDebugError(err: unknown, options: ActionErrorOptions = {}): string {\n  const message = err instanceof Error ? (err.stack ?? err.message) : String(err)\n  return sanitizeLogField(message, options)\n}\n\nfunction failure(\n  message: string,\n  retryable: boolean | undefined,\n  retryAfter?: number | undefined,\n): ClassifiedActionError {\n  return { message, retryable, retryAfter: normalizeRetryAfter(retryAfter) }\n}\n\nfunction formatB2Details(err: B2Error, options: ActionErrorOptions): string {\n  const details = [\n    `status ${sanitizeLogField(String(err.status), options)}`,\n    `code ${sanitizeLogField(err.code, options)}`,\n  ]\n  const retryAfter = normalizeRetryAfter(err.retryAfter)\n  if (retryAfter !== undefined) {\n    details.push(`retry after ${sanitizeLogField(String(retryAfter), options)}s`)\n  }\n  return `B2 response details: ${details.join(', ')}`\n}\n\nfunction formatGenericB2Guidance(err: B2Error, options: ActionErrorOptions): string {\n  const message = sanitizeLogField(err.message, options)\n  switch (err.code) {\n    case 'file_not_present':\n    case 'no_such_file':\n      return `File not found; check the bucket and file name. B2 said: ${message}.`\n    case 'duplicate_bucket_name':\n      return `Bucket name already exists; choose a unique bucket name. B2 said: ${message}.`\n    case 'cap_exceeded':\n    case 'storage_cap_exceeded':\n    case 'transaction_cap_exceeded':\n    case 'download_cap_exceeded':\n      return `B2 account cap was exceeded; reduce usage or wait before retrying. B2 said: ${message}.`\n    case 'bad_request':\n      return `Bad request; check the action inputs for invalid values. B2 said: ${message}.`\n    default:\n      return `B2 said: ${message}.`\n  }\n}\n\nfunction retryPolicy(options: ActionErrorOptions): { safe: boolean; hint: string } {\n  const { action } = options\n  if (action === undefined) return { safe: false, hint: UNKNOWN_RETRY_HINT }\n  const effect = ACTION_EFFECTS[action]\n  if (options.dryRun === true && effect.honorsDryRun) {\n    return { safe: true, hint: DRY_RUN_RETRY_HINT }\n  }\n  if (effect.kind === 'read') return { safe: true, hint: SAFE_RETRY_HINT }\n  return { safe: false, hint: `the ${action} ${MUTATING_RETRY_SUFFIX}` }\n}\n\nfunction isAuthorizationScopeFailure(err: BadAuthTokenError): boolean {\n  if (err.code !== 'unauthorized') return false\n  // The SDK currently exposes scoped-key `unauthorized` responses as\n  // BadAuthTokenError with only server prose to distinguish capability/scope\n  // misses. Keep this as best-effort until a structured subtype exists.\n  return /\\b(capability|capabilities|scope|bucket|prefix|permission|not authorized|unauthorized)\\b/i.test(\n    err.message,\n  )\n}\n\nfunction hasSsrfCause(err: unknown): boolean {\n  const seen = new Set()\n  let current: unknown = err\n  for (let depth = 0; current instanceof Error && depth < MAX_CAUSE_DEPTH; depth += 1) {\n    if (current instanceof B2SsrfError) return true\n    if (seen.has(current)) return false\n    seen.add(current)\n    current = current.cause\n  }\n  return false\n}\n\nfunction normalizeRetryAfter(retryAfter: number | undefined): number | undefined {\n  if (retryAfter === undefined || !Number.isFinite(retryAfter) || retryAfter < 0) return undefined\n  return Math.min(Math.ceil(retryAfter), MAX_RETRY_AFTER_SECONDS)\n}\n\nfunction sanitizeUntrustedText(value: string): string {\n  return value\n    .replace(/\\bhttps?:\\/\\/\\S+/gi, '[redacted-url]')\n    .replace(/\\bBearer\\s+[A-Za-z0-9._~+/=-]+/gi, 'Bearer ***')\n}\n\nfunction sanitizeLogField(value: string, options: ActionErrorOptions): string {\n  const secretValues = options.secretValues ?? []\n  const scrubInputLength =\n    secretValues.length > 0\n      ? MAX_LOG_INPUT_LENGTH + MAX_SECRET_BOUNDARY_WINDOW\n      : MAX_LOG_INPUT_LENGTH\n  const bounded = value.length > scrubInputLength ? value.slice(0, scrubInputLength) : value\n  const masked = maskSecrets(bounded, secretValues)\n  const scrubbed =\n    masked.length > MAX_LOG_INPUT_LENGTH ? masked.slice(0, MAX_LOG_INPUT_LENGTH) : masked\n  const sanitized = sanitizeUntrustedText(scrubbed)\n  if (sanitized.length <= MAX_LOG_FIELD_LENGTH) return sanitized\n  return `${sanitized.slice(0, MAX_LOG_FIELD_LENGTH)}... [truncated]`\n}\n\nfunction maskSecrets(value: string, secretValues: readonly string[]): string {\n  let masked = value\n  for (const secret of secretValues) {\n    for (const variant of secretVariants(secret)) {\n      masked = masked.split(variant).join('***')\n    }\n  }\n  return masked\n}\n\nfunction secretVariants(secret: string): string[] {\n  if (secret === '') return []\n  const variants = new Set()\n  addSecretVariant(variants, secret)\n  if (secret.length > MAX_LOG_INPUT_LENGTH) {\n    addSecretVariant(variants, secret.slice(0, MAX_LOG_INPUT_LENGTH))\n  }\n  if (secret.length >= 4 && secret.length <= MAX_DERIVED_SECRET_LENGTH) {\n    const base64 = Buffer.from(secret, 'utf8').toString('base64')\n    const base64Url = base64.replaceAll('+', '-').replaceAll('/', '_')\n    addUriEncodedSecretVariant(variants, secret)\n    addSecretVariant(variants, base64)\n    addSecretVariant(variants, base64Url)\n    addSecretVariant(variants, base64Url.replace(/=+$/u, ''))\n    addSecretVariant(variants, Buffer.from(secret, 'utf8').toString('hex'))\n  }\n  return [...variants].sort((a, b) => b.length - a.length)\n}\n\nfunction addSecretVariant(variants: Set, value: string): void {\n  if (value !== '') variants.add(value)\n}\n\nfunction addUriEncodedSecretVariant(variants: Set, secret: string): void {\n  try {\n    addSecretVariant(variants, encodeURIComponent(secret))\n  } catch {\n    // Malformed surrogate pairs are valid JavaScript strings but invalid URI\n    // components. Keep raw/base64/hex masking without letting scrubbing fail.\n  }\n}\n","import { Buffer } from 'node:buffer'\nimport * as core from '@actions/core'\n\nexport const SUMMARY_JSON_PREVIEW_MAX_ENTRIES = 100\nexport const SUMMARY_JSON_MAX_UTF8_BYTES = 256 * 1024\nconst SUMMARY_JSON_OUTPUT_NAME = 'summary-json'\nconst SUMMARY_JSON_TRUNCATED_OUTPUT_NAME = 'summary-json-truncated'\nexport const SUMMARY_JSON_NOTICE_OUTPUT_NAME = 'summary-json-notice'\nexport const SUMMARY_JSON_PREVIEW_OUTPUT_NAME = 'summary-json-preview'\n\nexport type SummaryJsonPayload = CompleteSummaryJsonPayload | TruncatedSummaryJsonPayload\n\nexport interface CompleteSummaryJsonPayload {\n  json: string\n  totalCount: number\n  truncated: false\n}\n\nexport interface TruncatedSummaryJsonPayload {\n  json: string\n  noticeJson: string\n  previewJson: string\n  totalCount: number\n  previewCount: number\n  reason: string\n  truncated: true\n}\n\nexport interface SummaryJsonOutputOptions {\n  item?: (item: T) => unknown\n}\n\ninterface BoundedJsonArray {\n  json: string\n  emittedCount: number\n  byteLimitExceeded: boolean\n  serializationFailed: boolean\n}\n\n/**\n * Serialize per-file command details into the bounded `summary-json` output.\n *\n * GitHub Actions writes outputs as UTF-8 and caps all action outputs for a job\n * at 1 MB. Keep this single structured output well below that job-level\n * budget so scalar outputs, $GITHUB_OUTPUT framing, and caller-defined outputs\n * still have room.\n *\n * `summary-json` remains a complete array when the full manifest fits. When a\n * result exceeds the supported byte cap, `summary-json` remains an array\n * (`[]`) rather than changing shape or carrying a partial manifest.\n * `summary-json-notice` receives a small JSON object describing the\n * truncation, `summary-json-preview` receives a bounded diagnostic prefix, and\n * `summary-json-truncated` is set to `true`. The action step may still succeed\n * because the B2 operation itself has already completed. Scalar count outputs\n * (`file-count`, `files-listed`, etc.) remain the authoritative totals.\n *\n * The serializer also omits credential-bearing field names for every command:\n * `url`, fields ending in `url`, and fields containing `authorization`,\n * `signature`, or `token` after case/underscore/hyphen normalization. Commands\n * that need to expose similarly named non-secret data should project it to an\n * explicit safe field name before calling this helper.\n */\nexport function buildSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): SummaryJsonPayload {\n  const serialized = serializeJsonArrayPrefix(items, options, items.length)\n  if (!serialized.byteLimitExceeded && !serialized.serializationFailed) {\n    return {\n      json: serialized.json,\n      totalCount: items.length,\n      truncated: false,\n    }\n  }\n\n  return buildTruncatedSummaryJsonPayload(\n    items,\n    options,\n    serialized.serializationFailed\n      ? 'summary-json could not be serialized within the supported output contract'\n      : 'summary-json exceeded the supported UTF-8 output size cap',\n  )\n}\n\nfunction buildTruncatedSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  reason: string,\n): TruncatedSummaryJsonPayload {\n  const preview = buildSummaryJsonPreview(items, options)\n\n  return {\n    json: '[]',\n    noticeJson: JSON.stringify({\n      truncated: true,\n      reason,\n      totalCount: items.length,\n      previewCount: preview.emittedCount,\n      previewOutput: SUMMARY_JSON_PREVIEW_OUTPUT_NAME,\n    }),\n    previewJson: preview.json,\n    totalCount: items.length,\n    previewCount: preview.emittedCount,\n    reason,\n    truncated: true,\n  }\n}\n\nfunction buildSummaryJsonPreview(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n): {\n  json: string\n  emittedCount: number\n} {\n  const preview = serializeJsonArrayPrefix(items, options, SUMMARY_JSON_PREVIEW_MAX_ENTRIES)\n  return { json: preview.json, emittedCount: preview.emittedCount }\n}\n\nexport function setSummaryJsonOutput(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): void {\n  const payload = buildSummaryJsonPayload(items, options)\n\n  core.setOutput(SUMMARY_JSON_TRUNCATED_OUTPUT_NAME, String(payload.truncated))\n  core.setOutput(SUMMARY_JSON_OUTPUT_NAME, payload.json)\n  if (!payload.truncated) {\n    return\n  }\n\n  core.setOutput(SUMMARY_JSON_NOTICE_OUTPUT_NAME, payload.noticeJson)\n  core.setOutput(SUMMARY_JSON_PREVIEW_OUTPUT_NAME, payload.previewJson)\n  core.warning(\n    `summary-json truncated: ${payload.reason}; preview contains ` +\n      `${payload.previewCount} of ${payload.totalCount} item(s). ` +\n      `summary-json is [] and summary-json-notice describes the truncation. ` +\n      `limit is ${formatKiB(SUMMARY_JSON_MAX_UTF8_BYTES)} of UTF-8 JSON text`,\n  )\n}\n\nfunction serializeJsonArrayPrefix(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  maxEntries: number,\n): BoundedJsonArray {\n  const parts: string[] = ['[']\n  let bytes = 2\n  let emittedCount = 0\n  const count = Math.min(items.length, maxEntries)\n\n  for (let index = 0; index < count; index++) {\n    let itemJson: string\n    try {\n      itemJson = stringifyArrayItem(projectItem(items[index] as T, options))\n    } catch {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: false,\n        serializationFailed: true,\n      }\n    }\n\n    const separator = emittedCount === 0 ? '' : ','\n    const additionalBytes = utf8ByteLength(separator) + utf8ByteLength(itemJson)\n    if (bytes + additionalBytes > SUMMARY_JSON_MAX_UTF8_BYTES) {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: true,\n        serializationFailed: false,\n      }\n    }\n\n    if (separator !== '') parts.push(separator)\n    parts.push(itemJson)\n    bytes += additionalBytes\n    emittedCount++\n  }\n\n  parts.push(']')\n  return {\n    json: parts.join(''),\n    emittedCount,\n    byteLimitExceeded: false,\n    serializationFailed: false,\n  }\n}\n\nfunction projectItem(item: T, options: SummaryJsonOutputOptions): unknown {\n  return options.item === undefined ? item : options.item(item)\n}\n\nfunction stringifyArrayItem(item: unknown): string {\n  const json = JSON.stringify(item, sensitiveSummaryJsonFieldReplacer)\n  return json === undefined ? 'null' : json\n}\n\nfunction sensitiveSummaryJsonFieldReplacer(key: string, value: unknown): unknown {\n  return key !== '' && isSensitiveSummaryJsonField(key) ? undefined : value\n}\n\nfunction isSensitiveSummaryJsonField(key: string): boolean {\n  const normalized = key.replaceAll('-', '').replaceAll('_', '').toLowerCase()\n  return (\n    normalized === 'url' ||\n    normalized.endsWith('url') ||\n    normalized.includes('authorization') ||\n    normalized.includes('signature') ||\n    normalized.includes('token')\n  )\n}\n\nfunction utf8ByteLength(value: string): number {\n  return Buffer.byteLength(value, 'utf8')\n}\n\nfunction formatKiB(bytes: number): string {\n  return `${Math.floor(bytes / 1024)} KiB`\n}\n","import { appendFile } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport { formatBytes } from './format.ts'\n\n/** Maximum per-file rows rendered in a GitHub Actions step summary table. */\nexport const STEP_SUMMARY_MAX_ROWS = 100\n\n/**\n * One row in the `$GITHUB_STEP_SUMMARY` table emitted by a verb. Only\n * `fileName` is required; the other cells render empty when omitted.\n */\nexport interface SummaryRow {\n  /** B2 file name or display label (e.g. `(uploaded)`, `(removed)`). */\n  fileName: string\n  /** Byte size of the file. Rendered via {@link formatBytes}. */\n  size?: number | undefined\n  /** B2 file ID (rendered as inline code). */\n  fileId?: string | undefined\n  /** Content SHA-1. Truncated to 12 chars in the table for readability. */\n  sha1?: string | null | undefined\n  /** Free-form status cell (e.g. `uploaded`, `would delete`, `deleted`). */\n  status?: string | undefined\n}\n\n/**\n * Append a markdown summary block to `$GITHUB_STEP_SUMMARY`. No-ops when\n * the env var is unset (e.g. running the bundle locally for a smoke test).\n *\n * @param opts.title - Heading rendered as `## {title}`.\n * @param opts.rows - One row per file. Empty rows render an empty table body.\n * @param opts.totals - Optional aggregate line printed above the table.\n * @param opts.totalRows - Optional source row count when callers pre-slice rows.\n */\nexport async function writeStepSummary(opts: {\n  title: string\n  rows: readonly SummaryRow[]\n  totals?: { files: number; bytes: number } | undefined\n  totalRows?: number | undefined\n}): Promise {\n  const path = process.env.GITHUB_STEP_SUMMARY\n  if (!path) return\n\n  // Keep the writer defensive for direct callers even though dispatcher\n  // call sites pre-slice rows to avoid mapping very large result sets.\n  const rows = opts.rows.slice(0, STEP_SUMMARY_MAX_ROWS)\n  const totalRows = opts.totalRows ?? opts.rows.length\n  const lines: string[] = []\n  lines.push(`## ${opts.title}`)\n  lines.push('')\n\n  if (opts.totals !== undefined) {\n    lines.push(`**${opts.totals.files}** files, **${formatBytes(opts.totals.bytes)}** total.`)\n    lines.push('')\n  }\n\n  if (totalRows > rows.length) {\n    lines.push(`Showing first ${rows.length} of ${totalRows} rows.`)\n    lines.push('')\n  }\n\n  if (rows.length > 0) {\n    lines.push('| File | Size | File ID | SHA-1 | Status |')\n    lines.push('|------|------|---------|-------|--------|')\n    for (const r of rows) {\n      lines.push(\n        `| ${inlineCodeCell(r.fileName)} | ${r.size !== undefined ? formatBytes(r.size) : ''} | ${\n          r.fileId !== undefined ? inlineCodeCell(r.fileId) : ''\n        } | ${r.sha1 != null ? `\\`${r.sha1.slice(0, 12)}…\\`` : ''} | ${\n          r.status !== undefined ? inlineCodeCell(r.status) : ''\n        } |`,\n      )\n    }\n  }\n\n  lines.push('')\n\n  try {\n    await appendFile(path, `${lines.join('\\n')}\\n`)\n  } catch (err) {\n    // $GITHUB_STEP_SUMMARY might point at an unwritable path (e.g. a\n    // directory, or a file the runner lacks permission to extend). The\n    // summary is informational; degrading to a warning is better than\n    // failing an otherwise-successful step.\n    core.warning(`Failed to write step summary: ${(err as Error).message}`)\n  }\n}\n\nfunction inlineCodeCell(value: string): string {\n  return `${escapeHtml(value).replaceAll('|', '|')}`\n}\n\nfunction escapeHtml(value: string): string {\n  // Single-pass escape so correctness never depends on replace ordering\n  // (a chained version must escape '&' first or it would re-escape '<').\n  const map = { '&': '&', '<': '<', '>': '>' } as const\n  return value.replace(/[&<>]/g, (ch) => map[ch as keyof typeof map])\n}\n","import { realpathSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport * as core from '@actions/core'\nimport { buildClient, getBucket } from './client.ts'\nimport { copyCommand } from './commands/copy.ts'\nimport { deleteCommand } from './commands/delete.ts'\nimport { downloadCommand } from './commands/download.ts'\nimport { headCommand } from './commands/head.ts'\nimport { hideCommand } from './commands/hide.ts'\nimport { listCommand } from './commands/list.ts'\nimport { type PresignedFile, presignCommand } from './commands/presign.ts'\nimport { purgeCommand } from './commands/purge.ts'\nimport { retentionCommand } from './commands/retention.ts'\nimport { summarizeSyncErrors, syncCommand } from './commands/sync.ts'\nimport { unhideCommand } from './commands/unhide.ts'\nimport { uploadCommand } from './commands/upload.ts'\nimport { verifyCommand } from './commands/verify.ts'\nimport { classifyActionError, formatActionDebugError } from './errors.ts'\nimport { collectInputSecretsForScrubbing, type ParsedInputs, parseInputs } from './inputs.ts'\nimport { setSummaryJsonOutput } from './outputs.ts'\nimport { STEP_SUMMARY_MAX_ROWS, type SummaryRow, writeStepSummary } from './summary.ts'\n\n/**\n * Action entrypoint. Parses inputs, builds an authorized B2Client, dispatches\n * to the requested subcommand, and writes structured outputs back via\n * `core.setOutput`. Any thrown error is reported through `core.setFailed`\n * so the workflow step surfaces with a clear message and a non-zero exit.\n *\n * Each command path also publishes a `$GITHUB_STEP_SUMMARY` markdown block so\n * the run's summary page shows a per-file table without scrolling through the\n * live log.\n */\nexport async function run(): Promise {\n  // Wire workflow-cancellation signals (`SIGTERM` when the user cancels the\n  // job or a sibling fails fast; `SIGINT` for Ctrl+C in local dev) to an\n  // AbortController that long-running SDK operations subscribe to. Aborting\n  // mid-upload lets the SDK cancel in-flight multipart sessions cleanly\n  // rather than leaving them dangling for the user to pay storage on.\n  const controller = new AbortController()\n  const onSignal = (sig: NodeJS.Signals) => {\n    core.warning(`Received ${sig}; cancelling in-flight B2 operations.`)\n    controller.abort(new Error(`${sig} received`))\n  }\n  const onSigterm = () => onSignal('SIGTERM')\n  const onSigint = () => onSignal('SIGINT')\n  process.once('SIGTERM', onSigterm)\n  process.once('SIGINT', onSigint)\n  const signal = controller.signal\n  let action: ParsedInputs['action'] | undefined\n  let dryRun: boolean | undefined\n  const secretValues: string[] = []\n\n  try {\n    // These values are a defensive formatter scrub list for parser and\n    // dispatcher-scope credentials and tokens. Command-level secrets such as\n    // presigned URLs are masked at the command site with core.setSecret. Any\n    // SDK free-form B2 messages that reach failure output are sanitized in\n    // errors.ts.\n    secretValues.push(...collectInputSecretsForScrubbing())\n    const inputs = parseInputs()\n    action = inputs.action\n    dryRun = inputs.dryRun\n\n    const authorized = await buildClient({\n      applicationKeyId: inputs.applicationKeyId,\n      applicationKey: inputs.applicationKey,\n      bucket: inputs.bucket,\n      ...(inputs.endpoint !== undefined ? { endpoint: inputs.endpoint } : {}),\n    })\n    const authToken = authorized.client.accountInfo.getAuthToken()\n    if (authToken) registerSecretValue(secretValues, authToken)\n    const bucket = await getBucket(authorized)\n\n    switch (inputs.action) {\n      case 'upload': {\n        const result = await uploadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-id', first.fileId)\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-uploaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`uploaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: upload',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: 'uploaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'download': {\n        const result = await downloadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-downloaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`downloaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: download',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            sha1: f.contentSha1,\n            status: 'downloaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'sync': {\n        const result = await syncCommand(bucket, inputs, signal)\n        core.setOutput('files-uploaded', String(result.uploaded))\n        core.setOutput('files-downloaded', String(result.downloaded))\n        core.setOutput('files-deleted', String(result.deleted))\n        setFileCountOutput(result.uploaded + result.downloaded + result.deleted + result.skipped)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        setSummaryJsonOutput(result.events)\n        if (result.errors > 0) {\n          const sample = summarizeSyncErrors(result.events)\n          throw new Error(`Sync completed with ${result.errors} error(s): ${sample}`)\n        }\n        const syncTitlePrefix = inputs.dryRun\n          ? 'Backblaze B2: sync (dry-run)'\n          : 'Backblaze B2: sync'\n        await writeStepSummary({\n          title: `${syncTitlePrefix} [${result.direction}]`,\n          totals: {\n            files: result.uploaded + result.downloaded + result.deleted,\n            bytes: result.bytesTransferred,\n          },\n          rows: [\n            {\n              fileName: '(uploaded)',\n              size: result.direction === 'local-to-b2' ? result.bytesTransferred : 0,\n              status: String(result.uploaded),\n            },\n            {\n              fileName: '(downloaded)',\n              size: result.direction === 'b2-to-local' ? result.bytesTransferred : 0,\n              status: String(result.downloaded),\n            },\n            { fileName: '(removed)', status: String(result.deleted) },\n            { fileName: '(unchanged)', status: String(result.skipped) },\n          ],\n        })\n        return\n      }\n      case 'copy': {\n        const result = await copyCommand(authorized.client, bucket, inputs, signal)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.destinationFileName)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', String(result.size))\n        await writeStepSummary({\n          title: 'Backblaze B2: copy',\n          rows: [\n            {\n              fileName: `b2://${result.sourceBucket}/${result.sourceFileName} → b2://${result.destinationBucket}/${result.destinationFileName}`,\n              size: result.size,\n              fileId: result.fileId,\n              status: 'copied (server-side)',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'delete': {\n        const result = await deleteCommand(bucket, inputs, signal)\n        await emitDeletionSummary('delete', result, inputs)\n        return\n      }\n      case 'presign': {\n        const result = await presignCommand(authorized.client, bucket, inputs)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('presigned-url', first.url)\n          core.setOutput('file-name', first.fileName)\n        }\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        await writeStepSummary({\n          title: `Backblaze B2: presign (${result.files.length})`,\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            status: `expires at ${new Date(f.expiresAt * 1000).toISOString()}`,\n          })),\n        })\n        setSummaryJsonOutput(result.files, { item: presignSummaryItem })\n        return\n      }\n      case 'list': {\n        const result = await listCommand(bucket, inputs)\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        if (result.truncated) {\n          core.warning(\n            `list result truncated at max-results=${inputs.maxResults}; raise it to see more`,\n          )\n        }\n        await writeStepSummary({\n          title: `Backblaze B2: list (${result.files.length}${result.truncated ? '+' : ''})`,\n          totals: {\n            files: result.files.length,\n            bytes: result.files.reduce((s, f) => s + f.size, 0),\n          },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: f.contentType,\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'hide': {\n        const result = await hideCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: hide',\n          rows: [{ fileName: result.fileName, fileId: result.fileId, status: 'hidden' }],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'unhide': {\n        const result = await unhideCommand(bucket, inputs)\n        core.setOutput('file-name', result.fileName)\n        if (result.removedMarkerFileId !== null) {\n          core.setOutput('file-id', result.removedMarkerFileId)\n        }\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: unhide',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.removedMarkerFileId ?? undefined,\n              status: result.removedMarkerFileId === null ? 'no-op (not hidden)' : 'unhidden',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'verify': {\n        const result = await verifyCommand(bucket, inputs)\n        core.setOutput('verified', String(result.verified))\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        if (result.remoteSha1 !== null) core.setOutput('remote-sha1', result.remoteSha1)\n        if (result.localSha1 !== null) core.setOutput('local-sha1', result.localSha1)\n        await writeStepSummary({\n          title: result.verified ? 'Backblaze B2: verify ✓' : 'Backblaze B2: verify ✗',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.remoteSize,\n              sha1: result.remoteSha1,\n              status: result.verified ? 'matches' : (result.reason ?? 'mismatch'),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        if (!result.verified) {\n          throw new Error(result.reason ?? 'verify failed: SHA-1 mismatch')\n        }\n        return\n      }\n      case 'retention': {\n        const result = await retentionCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: retention',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.fileId,\n              status: retentionStatusLine(result),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'head': {\n        const result = await headCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        if (result.contentSha1 !== null) core.setOutput('content-sha1', result.contentSha1)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', '0')\n        await writeStepSummary({\n          title: 'Backblaze B2: head',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.size,\n              fileId: result.fileId,\n              sha1: result.contentSha1,\n              status: result.contentType,\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'purge': {\n        const result = await purgeCommand(bucket, inputs, signal)\n        await emitDeletionSummary('purge', result, inputs)\n        return\n      }\n    }\n  } catch (err) {\n    const failure = classifyActionError(err, {\n      ...(action !== undefined ? { action } : {}),\n      ...(dryRun !== undefined ? { dryRun } : {}),\n      secretValues,\n    })\n    core.debug(formatActionDebugError(err, { secretValues }))\n    if (failure.retryable !== undefined) core.setOutput('retryable', String(failure.retryable))\n    if (failure.retryAfter !== undefined) core.setOutput('retry-after', String(failure.retryAfter))\n    core.setFailed(failure.message)\n  } finally {\n    process.off('SIGTERM', onSigterm)\n    process.off('SIGINT', onSigint)\n  }\n}\n\n/**\n * Checks whether this module is the process entrypoint.\n *\n * @param metaUrl - The current module URL from `import.meta.url`.\n * @param argv1 - The executable script path from `process.argv[1]`.\n * @returns `true` when the current module path matches the invoked script.\n */\nexport function isEntrypoint(metaUrl: string, argv1: string | undefined): boolean {\n  if (argv1 === undefined) return false\n  try {\n    return realpathSync(fileURLToPath(metaUrl)) === realpathSync(resolve(argv1))\n  } catch {\n    return false\n  }\n}\n\n/**\n * Shared output-emission + step-summary for the two deletion verbs.\n * `delete` and `purge` returned-shape and dispatcher-side handling are\n * structurally identical (filter into actually-deleted vs would-delete,\n * set the same outputs, render the same capped row table); they differ only\n * in the verb label and the per-row status string.\n */\nasync function emitDeletionSummary(\n  verb: 'delete' | 'purge',\n  result: {\n    files: { fileName: string; fileId: string; skipped: boolean }[]\n    errors: number\n  },\n  inputs: ParsedInputs,\n): Promise {\n  const actuallyDeleted = result.files.filter((f) => !f.skipped).length\n  const wouldDelete = result.files.filter((f) => f.skipped).length\n  core.setOutput('files-deleted', String(actuallyDeleted))\n  setFileCountOutput(result.files.length)\n  setSummaryJsonOutput(result.files)\n  if (result.errors > 0) {\n    const labels = { delete: 'Delete', purge: 'Purge' } as const\n    throw new Error(`${labels[verb]} completed with ${result.errors} error(s)`)\n  }\n  const past = verb === 'delete' ? 'deleted' : 'purged'\n  const future = verb === 'delete' ? 'would delete' : 'would purge'\n  await writeStepSummary({\n    title: inputs.dryRun ? `Backblaze B2: ${verb} (dry-run)` : `Backblaze B2: ${verb}`,\n    totals: { files: actuallyDeleted + wouldDelete, bytes: 0 },\n    ...stepSummaryRows(result.files, (f) => ({\n      fileName: f.fileName,\n      fileId: f.fileId,\n      status: f.skipped ? future : past,\n    })),\n  })\n}\n\nfunction stepSummaryRows(\n  items: readonly T[],\n  row: (item: T) => SummaryRow,\n): { rows: SummaryRow[]; totalRows?: number } {\n  // Pre-slice here to avoid mapping very large result sets; writeStepSummary\n  // keeps its own defensive cap for direct callers.\n  const rows = items.slice(0, STEP_SUMMARY_MAX_ROWS).map(row)\n  return rows.length < items.length ? { rows, totalRows: items.length } : { rows }\n}\n\nfunction presignSummaryItem(file: PresignedFile): Pick {\n  return { fileName: file.fileName, expiresAt: file.expiresAt }\n}\n\nfunction setFileCountOutput(count: number): void {\n  core.setOutput('file-count', String(count))\n}\n\nfunction registerSecretValue(secretValues: string[], value: string): void {\n  const trimmed = value.trim()\n  for (const secret of [value, trimmed]) {\n    if (secret === '' || secretValues.includes(secret)) continue\n    core.setSecret(secret)\n    secretValues.push(secret)\n  }\n}\n\nfunction retentionStatusLine(result: {\n  appliedMode: 'compliance' | 'governance' | 'none' | undefined\n  retainUntilTimestamp: number | null | undefined\n  appliedLegalHold: 'on' | 'off' | undefined\n}): string {\n  const parts: string[] = [`mode=${result.appliedMode ?? '-'}`]\n  if (result.retainUntilTimestamp != null) {\n    parts.push(`until=${new Date(result.retainUntilTimestamp).toISOString()}`)\n  }\n  if (result.appliedLegalHold !== undefined) {\n    parts.push(`legal-hold=${result.appliedLegalHold}`)\n  }\n  return parts.join(' ')\n}\n\nif (isEntrypoint(import.meta.url, process.argv[1])) {\n  void run()\n}\n"],"names":[],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"index.js","mappings":";;;;;;AAAA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9sBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC98CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrRA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC11BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/dA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/tEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5gCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/lDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACllBA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACNA;AACA;;;;;;;;;;;;;;;;;;ACDA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AChCA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9QA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9JA;AACA;AACA;AACA;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACvPA;AAEA;;;;;;;;;;;AAWA;AACA;;;ACdA;AAEA;AAMA;AA6BA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;AAKA;AACA;AACA;AACA;AAAA;AAEA;AACA;;;;;;;AC3IA;AACA;AAEA;AAEA;AAEA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;;;AC3DA;AAEA;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAyFA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;AAYA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAKA;AAKA;AAKA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;AAUA;AACA;AACA;AAAA;AACA;AACA;AAEA;;;AAGA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAEA;;;;AAIA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAMA;AAOA;AAAA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACxkBA;AAEA;AACA;AAkBA;;;;;;;;;;;AAWA;AACA;AAMA;AACA;AACA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACnFA;AACA;AAmBA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC3FA;AAEA;AACA;AACA;AAoBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAEA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;;;;;ACpHA;;ACQA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAOA;AAEA;AACA;AAOA;AAEA;AACA;AAOA;AAEA;AAOA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;;;ACnMA;AAEA;;;;;AAKA;AACA;AACA;AACA;;;ACXA;;;;;AAKA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;;;ACXA;AAEA;AAEA;;;;;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAGA;AACA;AAIA;AACA;AACA;AACA;AACA;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAgDA;;;;;;;;;;AAUA;AACA;AAKA;AACA;AAEA;AACA;AAEA;AACA;AAQA;AACA;AAQA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AAOA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AASA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;;;;AAIA;AACA;AASA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAKA;AAKA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAIA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAGA;AACA;;;ACvkBA;AAEA;AAoBA;;;;;;;;AAQA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtDA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;AClCA;AA8BA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/VA;AAEA;AACA;AAKA;AAkBA;;;;;;;;;;;;;;AAcA;AACA;AAKA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAUA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AAOA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;;;ACnKA;AAGA;AAsBA;;;;;;;;;;;AAWA;AACA;AAKA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;;;AChGA;AAEA;AACA;AAgBA;;;;;;;;;;;;;;;;;AAiBA;AACA;AAIA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChPA;AACA;AACA;AASA;AACA;AACA;AAwBA;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAGA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;;;;;;;;;;AAUA;AACA;AAKA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;;;AClQA;AAEA;AAUA;;;;;;;;;;AAUA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACx0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzlCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpOA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAMA;AA8BA;;;;;;;;;;;;;;;AAeA;AACA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AA8BA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAEA;;;;AAIA;AACA;AAKA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;;;ACzVA;AACA;AACA;AAEA;AACA;AAsBA;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC/IA;AAQA;AAEA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAIA;AACA;AACA;AAIA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;;;AClPA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AA+BA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AAEA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AACA;AAEA;AAIA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;AC9NA;AACA;AACA;AAEA;AACA;AAmBA;;;;;;;;AAQA;AACA;AAMA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;;;;;AAMA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA","sources":[".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js",".././node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/abort-signal.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-pipeline.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/api-upgrade.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/readable.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/api/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/connect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/diagnostics.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/tree.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/core/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/balanced-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h1.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client-h2.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/dispatcher.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/fixed-queue.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-base.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool-stats.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/proxy-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/dispatcher/retry-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/decorator-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/redirect-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/handler/retry-handler.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dns.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/dump.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/redirect.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/interceptor/retry.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/llhttp/utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-agent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-client.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-errors.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-interceptor.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-pool.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/mock-utils.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/mock/pluralizer.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/util/timers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cache.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/cachestorage.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cache/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/parse.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/cookies/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource-stream.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/eventsource.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/eventsource/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/body.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/data-url.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/dispatcher-weakref.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/file.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata-parser.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/formdata.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/global.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/headers.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/index.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/request.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/response.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fetch/webidl.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/encoding.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/filereader.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/progressevent.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/fileapi/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/connection.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/constants.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/events.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/frame.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/permessage-deflate.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/receiver.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/sender.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/symbols.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/util.js",".././node_modules/.pnpm/undici@6.27.0/node_modules/undici/lib/web/websocket/websocket.js","../external node-commonjs \"assert\"","../external node-commonjs \"events\"","../external node-commonjs \"http\"","../external node-commonjs \"https\"","../external node-commonjs \"net\"","../external node-commonjs \"node:assert\"","../external node-commonjs \"node:async_hooks\"","../external node-commonjs \"node:buffer\"","../external node-commonjs \"node:console\"","../external node-commonjs \"node:crypto\"","../external node-commonjs \"node:diagnostics_channel\"","../external node-commonjs \"node:dns\"","../external node-commonjs \"node:events\"","../external node-commonjs \"node:fs\"","../external node-commonjs \"node:fs/promises\"","../external node-commonjs \"node:http\"","../external node-commonjs \"node:http2\"","../external node-commonjs \"node:net\"","../external node-commonjs \"node:path\"","../external node-commonjs \"node:perf_hooks\"","../external node-commonjs \"node:querystring\"","../external node-commonjs \"node:stream\"","../external node-commonjs \"node:tls\"","../external node-commonjs \"node:url\"","../external node-commonjs \"node:util\"","../external node-commonjs \"node:util/types\"","../external node-commonjs \"node:worker_threads\"","../external node-commonjs \"node:zlib\"","../external node-commonjs \"string_decoder\"","../external node-commonjs \"tls\"","../external node-commonjs \"util\"","../webpack/bootstrap","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/compat","../external node-commonjs \"os\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/command.js","../external node-commonjs \"crypto\"","../external node-commonjs \"fs\"",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/file-command.js","../external node-commonjs \"path\"",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/proxy.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/index.js",".././node_modules/.pnpm/@actions+http-client@4.0.1/node_modules/@actions/http-client/lib/auth.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/oidc-utils.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/summary.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/path-utils.js","../external node-commonjs \"child_process\"",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io-util.js",".././node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io.js","../external node-commonjs \"timers\"",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/toolrunner.js",".././node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/exec.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/platform.js",".././node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/core.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/upload-url-pool.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/in-memory.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/ids.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/retry.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/paginator.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/concurrency.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/file.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/abort-scope.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/internal/url-redaction.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/errors.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/errors/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/best-effort.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/cancel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/finish.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/plan-ranges.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/copy/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/text-codec.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/encoding.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/progress.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/normalize.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/hash.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/sha1.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/checksum.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/internal/upload-retry-options.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/source.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/bucket.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/types/encryption.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/resume.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/retry.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/large.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/options.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/single.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/to-error.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/collect.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/download/parallel.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/upload/stream.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/object.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/bucket.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/auth/realms.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/url-guard.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/_virtual/_b2-sdk-version-json.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/version.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/user-agent.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/http/transport.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/raw/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/client.js",".././src/version.ts",".././src/client.ts",".././src/sse.ts",".././src/inputs.ts",".././src/commands/copy.ts",".././src/commands/delete-all.ts",".././src/commands/delete.ts","../external node-commonjs \"node:stream/promises\"",".././src/download-overrides.ts",".././src/fs.ts",".././src/format.ts",".././src/progress.ts",".././src/commands/download.ts",".././src/commands/head.ts",".././src/commands/hide.ts",".././src/commands/list.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/s3/index.js",".././src/commands/presign.ts",".././src/commands/purge.ts",".././src/commands/retention.ts",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/streams/file-source.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/actions/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/regexp-safety.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scan-events.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/filters.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/path-order.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scan-limit.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/pairing.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/util/error-reason.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/sha1-options.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-file-identity.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-sha1.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/sha1-metadata.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/compare.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/policies/index.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/path-safety.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/download-staging.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/prefix.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/filesystem-errors.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-filesystem-root.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/b2-sha1-reader.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/local-file-io.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/synchronizer.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/local.js",".././node_modules/.pnpm/@backblaze-labs+b2-sdk@0.2.0/node_modules/@backblaze-labs/b2-sdk/dist/sync/scanners/b2.js",".././src/commands/sync.ts",".././src/commands/unhide.ts",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-glob-options-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path-helper.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-match-kind.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern-helper.js",".././node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js",".././node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/esm/index.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/brace-expressions.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/unescape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/ast.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/escape.js",".././node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-path.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-pattern.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-search-state.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-globber.js","../external node-commonjs \"stream\"",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/internal-hash-files.js",".././node_modules/.pnpm/@actions+glob@0.7.0/node_modules/@actions/glob/lib/glob.js",".././src/commands/upload.ts",".././src/commands/verify.ts",".././src/errors.ts",".././src/outputs.ts",".././src/summary.ts",".././src/main.ts"],"sourcesContent":["module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = http.request;\n  return agent;\n}\n\nfunction httpsOverHttp(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = http.request;\n  agent.createSocket = createSecureSocket;\n  agent.defaultPort = 443;\n  return agent;\n}\n\nfunction httpOverHttps(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = https.request;\n  return agent;\n}\n\nfunction httpsOverHttps(options) {\n  var agent = new TunnelingAgent(options);\n  agent.request = https.request;\n  agent.createSocket = createSecureSocket;\n  agent.defaultPort = 443;\n  return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n  var self = this;\n  self.options = options || {};\n  self.proxyOptions = self.options.proxy || {};\n  self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n  self.requests = [];\n  self.sockets = [];\n\n  self.on('free', function onFree(socket, host, port, localAddress) {\n    var options = toOptions(host, port, localAddress);\n    for (var i = 0, len = self.requests.length; i < len; ++i) {\n      var pending = self.requests[i];\n      if (pending.host === options.host && pending.port === options.port) {\n        // Detect the request to connect same origin server,\n        // reuse the connection.\n        self.requests.splice(i, 1);\n        pending.request.onSocket(socket);\n        return;\n      }\n    }\n    socket.destroy();\n    self.removeSocket(socket);\n  });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n  var self = this;\n  var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n  if (self.sockets.length >= this.maxSockets) {\n    // We are over limit so we'll add it to the queue.\n    self.requests.push(options);\n    return;\n  }\n\n  // If we are under maxSockets create a new one.\n  self.createSocket(options, function(socket) {\n    socket.on('free', onFree);\n    socket.on('close', onCloseOrRemove);\n    socket.on('agentRemove', onCloseOrRemove);\n    req.onSocket(socket);\n\n    function onFree() {\n      self.emit('free', socket, options);\n    }\n\n    function onCloseOrRemove(err) {\n      self.removeSocket(socket);\n      socket.removeListener('free', onFree);\n      socket.removeListener('close', onCloseOrRemove);\n      socket.removeListener('agentRemove', onCloseOrRemove);\n    }\n  });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n  var self = this;\n  var placeholder = {};\n  self.sockets.push(placeholder);\n\n  var connectOptions = mergeOptions({}, self.proxyOptions, {\n    method: 'CONNECT',\n    path: options.host + ':' + options.port,\n    agent: false,\n    headers: {\n      host: options.host + ':' + options.port\n    }\n  });\n  if (options.localAddress) {\n    connectOptions.localAddress = options.localAddress;\n  }\n  if (connectOptions.proxyAuth) {\n    connectOptions.headers = connectOptions.headers || {};\n    connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n        new Buffer(connectOptions.proxyAuth).toString('base64');\n  }\n\n  debug('making CONNECT request');\n  var connectReq = self.request(connectOptions);\n  connectReq.useChunkedEncodingByDefault = false; // for v0.6\n  connectReq.once('response', onResponse); // for v0.6\n  connectReq.once('upgrade', onUpgrade);   // for v0.6\n  connectReq.once('connect', onConnect);   // for v0.7 or later\n  connectReq.once('error', onError);\n  connectReq.end();\n\n  function onResponse(res) {\n    // Very hacky. This is necessary to avoid http-parser leaks.\n    res.upgrade = true;\n  }\n\n  function onUpgrade(res, socket, head) {\n    // Hacky.\n    process.nextTick(function() {\n      onConnect(res, socket, head);\n    });\n  }\n\n  function onConnect(res, socket, head) {\n    connectReq.removeAllListeners();\n    socket.removeAllListeners();\n\n    if (res.statusCode !== 200) {\n      debug('tunneling socket could not be established, statusCode=%d',\n        res.statusCode);\n      socket.destroy();\n      var error = new Error('tunneling socket could not be established, ' +\n        'statusCode=' + res.statusCode);\n      error.code = 'ECONNRESET';\n      options.request.emit('error', error);\n      self.removeSocket(placeholder);\n      return;\n    }\n    if (head.length > 0) {\n      debug('got illegal response body from proxy');\n      socket.destroy();\n      var error = new Error('got illegal response body from proxy');\n      error.code = 'ECONNRESET';\n      options.request.emit('error', error);\n      self.removeSocket(placeholder);\n      return;\n    }\n    debug('tunneling connection has established');\n    self.sockets[self.sockets.indexOf(placeholder)] = socket;\n    return cb(socket);\n  }\n\n  function onError(cause) {\n    connectReq.removeAllListeners();\n\n    debug('tunneling socket could not be established, cause=%s\\n',\n          cause.message, cause.stack);\n    var error = new Error('tunneling socket could not be established, ' +\n                          'cause=' + cause.message);\n    error.code = 'ECONNRESET';\n    options.request.emit('error', error);\n    self.removeSocket(placeholder);\n  }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n  var pos = this.sockets.indexOf(socket)\n  if (pos === -1) {\n    return;\n  }\n  this.sockets.splice(pos, 1);\n\n  var pending = this.requests.shift();\n  if (pending) {\n    // If we have pending requests and a socket gets closed a new one\n    // needs to be created to take over in the pool for the one that closed.\n    this.createSocket(pending, function(socket) {\n      pending.request.onSocket(socket);\n    });\n  }\n};\n\nfunction createSecureSocket(options, cb) {\n  var self = this;\n  TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n    var hostHeader = options.request.getHeader('host');\n    var tlsOptions = mergeOptions({}, self.options, {\n      socket: socket,\n      servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n    });\n\n    // 0 is dummy port for v0.6\n    var secureSocket = tls.connect(0, tlsOptions);\n    self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n    cb(secureSocket);\n  });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n  if (typeof host === 'string') { // since v0.10\n    return {\n      host: host,\n      port: port,\n      localAddress: localAddress\n    };\n  }\n  return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n  for (var i = 1, len = arguments.length; i < len; ++i) {\n    var overrides = arguments[i];\n    if (typeof overrides === 'object') {\n      var keys = Object.keys(overrides);\n      for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n        var k = keys[j];\n        if (overrides[k] !== undefined) {\n          target[k] = overrides[k];\n        }\n      }\n    }\n  }\n  return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n  debug = function() {\n    var args = Array.prototype.slice.call(arguments);\n    if (typeof args[0] === 'string') {\n      args[0] = 'TUNNEL: ' + args[0];\n    } else {\n      args.unshift('TUNNEL:');\n    }\n    console.error.apply(console, args);\n  }\n} else {\n  debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict'\n\nconst Client = require('./lib/dispatcher/client')\nconst Dispatcher = require('./lib/dispatcher/dispatcher')\nconst Pool = require('./lib/dispatcher/pool')\nconst BalancedPool = require('./lib/dispatcher/balanced-pool')\nconst Agent = require('./lib/dispatcher/agent')\nconst ProxyAgent = require('./lib/dispatcher/proxy-agent')\nconst EnvHttpProxyAgent = require('./lib/dispatcher/env-http-proxy-agent')\nconst RetryAgent = require('./lib/dispatcher/retry-agent')\nconst errors = require('./lib/core/errors')\nconst util = require('./lib/core/util')\nconst { InvalidArgumentError } = errors\nconst api = require('./lib/api')\nconst buildConnector = require('./lib/core/connect')\nconst MockClient = require('./lib/mock/mock-client')\nconst MockAgent = require('./lib/mock/mock-agent')\nconst MockPool = require('./lib/mock/mock-pool')\nconst mockErrors = require('./lib/mock/mock-errors')\nconst RetryHandler = require('./lib/handler/retry-handler')\nconst { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global')\nconst DecoratorHandler = require('./lib/handler/decorator-handler')\nconst RedirectHandler = require('./lib/handler/redirect-handler')\nconst createRedirectInterceptor = require('./lib/interceptor/redirect-interceptor')\n\nObject.assign(Dispatcher.prototype, api)\n\nmodule.exports.Dispatcher = Dispatcher\nmodule.exports.Client = Client\nmodule.exports.Pool = Pool\nmodule.exports.BalancedPool = BalancedPool\nmodule.exports.Agent = Agent\nmodule.exports.ProxyAgent = ProxyAgent\nmodule.exports.EnvHttpProxyAgent = EnvHttpProxyAgent\nmodule.exports.RetryAgent = RetryAgent\nmodule.exports.RetryHandler = RetryHandler\n\nmodule.exports.DecoratorHandler = DecoratorHandler\nmodule.exports.RedirectHandler = RedirectHandler\nmodule.exports.createRedirectInterceptor = createRedirectInterceptor\nmodule.exports.interceptors = {\n  redirect: require('./lib/interceptor/redirect'),\n  retry: require('./lib/interceptor/retry'),\n  dump: require('./lib/interceptor/dump'),\n  dns: require('./lib/interceptor/dns')\n}\n\nmodule.exports.buildConnector = buildConnector\nmodule.exports.errors = errors\nmodule.exports.util = {\n  parseHeaders: util.parseHeaders,\n  headerNameToString: util.headerNameToString\n}\n\nfunction makeDispatcher (fn) {\n  return (url, opts, handler) => {\n    if (typeof opts === 'function') {\n      handler = opts\n      opts = null\n    }\n\n    if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {\n      throw new InvalidArgumentError('invalid url')\n    }\n\n    if (opts != null && typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (opts && opts.path != null) {\n      if (typeof opts.path !== 'string') {\n        throw new InvalidArgumentError('invalid opts.path')\n      }\n\n      let path = opts.path\n      if (!opts.path.startsWith('/')) {\n        path = `/${path}`\n      }\n\n      url = new URL(util.parseOrigin(url).origin + path)\n    } else {\n      if (!opts) {\n        opts = typeof url === 'object' ? url : {}\n      }\n\n      url = util.parseURL(url)\n    }\n\n    const { agent, dispatcher = getGlobalDispatcher() } = opts\n\n    if (agent) {\n      throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')\n    }\n\n    return fn.call(dispatcher, {\n      ...opts,\n      origin: url.origin,\n      path: url.search ? `${url.pathname}${url.search}` : url.pathname,\n      method: opts.method || (opts.body ? 'PUT' : 'GET')\n    }, handler)\n  }\n}\n\nmodule.exports.setGlobalDispatcher = setGlobalDispatcher\nmodule.exports.getGlobalDispatcher = getGlobalDispatcher\n\nconst fetchImpl = require('./lib/web/fetch').fetch\nmodule.exports.fetch = async function fetch (init, options = undefined) {\n  try {\n    return await fetchImpl(init, options)\n  } catch (err) {\n    if (err && typeof err === 'object') {\n      Error.captureStackTrace(err)\n    }\n\n    throw err\n  }\n}\nmodule.exports.Headers = require('./lib/web/fetch/headers').Headers\nmodule.exports.Response = require('./lib/web/fetch/response').Response\nmodule.exports.Request = require('./lib/web/fetch/request').Request\nmodule.exports.FormData = require('./lib/web/fetch/formdata').FormData\nmodule.exports.File = globalThis.File ?? require('node:buffer').File\nmodule.exports.FileReader = require('./lib/web/fileapi/filereader').FileReader\n\nconst { setGlobalOrigin, getGlobalOrigin } = require('./lib/web/fetch/global')\n\nmodule.exports.setGlobalOrigin = setGlobalOrigin\nmodule.exports.getGlobalOrigin = getGlobalOrigin\n\nconst { CacheStorage } = require('./lib/web/cache/cachestorage')\nconst { kConstruct } = require('./lib/web/cache/symbols')\n\n// Cache & CacheStorage are tightly coupled with fetch. Even if it may run\n// in an older version of Node, it doesn't have any use without fetch.\nmodule.exports.caches = new CacheStorage(kConstruct)\n\nconst { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/web/cookies')\n\nmodule.exports.deleteCookie = deleteCookie\nmodule.exports.getCookies = getCookies\nmodule.exports.getSetCookies = getSetCookies\nmodule.exports.setCookie = setCookie\n\nconst { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/data-url')\n\nmodule.exports.parseMIMEType = parseMIMEType\nmodule.exports.serializeAMimeType = serializeAMimeType\n\nconst { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/web/websocket/events')\nmodule.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket\nmodule.exports.CloseEvent = CloseEvent\nmodule.exports.ErrorEvent = ErrorEvent\nmodule.exports.MessageEvent = MessageEvent\n\nmodule.exports.request = makeDispatcher(api.request)\nmodule.exports.stream = makeDispatcher(api.stream)\nmodule.exports.pipeline = makeDispatcher(api.pipeline)\nmodule.exports.connect = makeDispatcher(api.connect)\nmodule.exports.upgrade = makeDispatcher(api.upgrade)\n\nmodule.exports.MockClient = MockClient\nmodule.exports.MockPool = MockPool\nmodule.exports.MockAgent = MockAgent\nmodule.exports.mockErrors = mockErrors\n\nconst { EventSource } = require('./lib/web/eventsource/eventsource')\n\nmodule.exports.EventSource = EventSource\n","const { addAbortListener } = require('../core/util')\nconst { RequestAbortedError } = require('../core/errors')\n\nconst kListener = Symbol('kListener')\nconst kSignal = Symbol('kSignal')\n\nfunction abort (self) {\n  if (self.abort) {\n    self.abort(self[kSignal]?.reason)\n  } else {\n    self.reason = self[kSignal]?.reason ?? new RequestAbortedError()\n  }\n  removeSignal(self)\n}\n\nfunction addSignal (self, signal) {\n  self.reason = null\n\n  self[kSignal] = null\n  self[kListener] = null\n\n  if (!signal) {\n    return\n  }\n\n  if (signal.aborted) {\n    abort(self)\n    return\n  }\n\n  self[kSignal] = signal\n  self[kListener] = () => {\n    abort(self)\n  }\n\n  addAbortListener(self[kSignal], self[kListener])\n}\n\nfunction removeSignal (self) {\n  if (!self[kSignal]) {\n    return\n  }\n\n  if ('removeEventListener' in self[kSignal]) {\n    self[kSignal].removeEventListener('abort', self[kListener])\n  } else {\n    self[kSignal].removeListener('abort', self[kListener])\n  }\n\n  self[kSignal] = null\n  self[kListener] = null\n}\n\nmodule.exports = {\n  addSignal,\n  removeSignal\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { AsyncResource } = require('node:async_hooks')\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass ConnectHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    const { signal, opaque, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    super('UNDICI_CONNECT')\n\n    this.opaque = opaque || null\n    this.responseHeaders = responseHeaders || null\n    this.callback = callback\n    this.abort = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders () {\n    throw new SocketError('bad connect', null)\n  }\n\n  onUpgrade (statusCode, rawHeaders, socket) {\n    const { callback, opaque, context } = this\n\n    removeSignal(this)\n\n    this.callback = null\n\n    let headers = rawHeaders\n    // Indicates is an HTTP2Session\n    if (headers != null) {\n      headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n    }\n\n    this.runInAsyncScope(callback, null, null, {\n      statusCode,\n      headers,\n      socket,\n      opaque,\n      context\n    })\n  }\n\n  onError (err) {\n    const { callback, opaque } = this\n\n    removeSignal(this)\n\n    if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n  }\n}\n\nfunction connect (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      connect.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    const connectHandler = new ConnectHandler(opts, callback)\n    this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = connect\n","'use strict'\n\nconst {\n  Readable,\n  Duplex,\n  PassThrough\n} = require('node:stream')\nconst {\n  InvalidArgumentError,\n  InvalidReturnValueError,\n  RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nconst kResume = Symbol('resume')\n\nclass PipelineRequest extends Readable {\n  constructor () {\n    super({ autoDestroy: true })\n\n    this[kResume] = null\n  }\n\n  _read () {\n    const { [kResume]: resume } = this\n\n    if (resume) {\n      this[kResume] = null\n      resume()\n    }\n  }\n\n  _destroy (err, callback) {\n    this._read()\n\n    callback(err)\n  }\n}\n\nclass PipelineResponse extends Readable {\n  constructor (resume) {\n    super({ autoDestroy: true })\n    this[kResume] = resume\n  }\n\n  _read () {\n    this[kResume]()\n  }\n\n  _destroy (err, callback) {\n    if (!err && !this._readableState.endEmitted) {\n      err = new RequestAbortedError()\n    }\n\n    callback(err)\n  }\n}\n\nclass PipelineHandler extends AsyncResource {\n  constructor (opts, handler) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof handler !== 'function') {\n      throw new InvalidArgumentError('invalid handler')\n    }\n\n    const { signal, method, opaque, onInfo, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    if (method === 'CONNECT') {\n      throw new InvalidArgumentError('invalid method')\n    }\n\n    if (onInfo && typeof onInfo !== 'function') {\n      throw new InvalidArgumentError('invalid onInfo callback')\n    }\n\n    super('UNDICI_PIPELINE')\n\n    this.opaque = opaque || null\n    this.responseHeaders = responseHeaders || null\n    this.handler = handler\n    this.abort = null\n    this.context = null\n    this.onInfo = onInfo || null\n\n    this.req = new PipelineRequest().on('error', util.nop)\n\n    this.ret = new Duplex({\n      readableObjectMode: opts.objectMode,\n      autoDestroy: true,\n      read: () => {\n        const { body } = this\n\n        if (body?.resume) {\n          body.resume()\n        }\n      },\n      write: (chunk, encoding, callback) => {\n        const { req } = this\n\n        if (req.push(chunk, encoding) || req._readableState.destroyed) {\n          callback()\n        } else {\n          req[kResume] = callback\n        }\n      },\n      destroy: (err, callback) => {\n        const { body, req, res, ret, abort } = this\n\n        if (!err && !ret._readableState.endEmitted) {\n          err = new RequestAbortedError()\n        }\n\n        if (abort && err) {\n          abort()\n        }\n\n        util.destroy(body, err)\n        util.destroy(req, err)\n        util.destroy(res, err)\n\n        removeSignal(this)\n\n        callback(err)\n      }\n    }).on('prefinish', () => {\n      const { req } = this\n\n      // Node < 15 does not call _final in same tick.\n      req.push(null)\n    })\n\n    this.res = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    const { ret, res } = this\n\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(!res, 'pipeline cannot be retried')\n    assert(!ret.destroyed)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume) {\n    const { opaque, handler, context } = this\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    this.res = new PipelineResponse(resume)\n\n    let body\n    try {\n      this.handler = null\n      const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n      body = this.runInAsyncScope(handler, null, {\n        statusCode,\n        headers,\n        opaque,\n        body: this.res,\n        context\n      })\n    } catch (err) {\n      this.res.on('error', util.nop)\n      throw err\n    }\n\n    if (!body || typeof body.on !== 'function') {\n      throw new InvalidReturnValueError('expected Readable')\n    }\n\n    body\n      .on('data', (chunk) => {\n        const { ret, body } = this\n\n        if (!ret.push(chunk) && body.pause) {\n          body.pause()\n        }\n      })\n      .on('error', (err) => {\n        const { ret } = this\n\n        util.destroy(ret, err)\n      })\n      .on('end', () => {\n        const { ret } = this\n\n        ret.push(null)\n      })\n      .on('close', () => {\n        const { ret } = this\n\n        if (!ret._readableState.ended) {\n          util.destroy(ret, new RequestAbortedError())\n        }\n      })\n\n    this.body = body\n  }\n\n  onData (chunk) {\n    const { res } = this\n    return res.push(chunk)\n  }\n\n  onComplete (trailers) {\n    const { res } = this\n    res.push(null)\n  }\n\n  onError (err) {\n    const { ret } = this\n    this.handler = null\n    util.destroy(ret, err)\n  }\n}\n\nfunction pipeline (opts, handler) {\n  try {\n    const pipelineHandler = new PipelineHandler(opts, handler)\n    this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)\n    return pipelineHandler.ret\n  } catch (err) {\n    return new PassThrough().destroy(err)\n  }\n}\n\nmodule.exports = pipeline\n","'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('./readable')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\n\nclass RequestHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts\n\n    try {\n      if (typeof callback !== 'function') {\n        throw new InvalidArgumentError('invalid callback')\n      }\n\n      if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {\n        throw new InvalidArgumentError('invalid highWaterMark')\n      }\n\n      if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n        throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n      }\n\n      if (method === 'CONNECT') {\n        throw new InvalidArgumentError('invalid method')\n      }\n\n      if (onInfo && typeof onInfo !== 'function') {\n        throw new InvalidArgumentError('invalid onInfo callback')\n      }\n\n      super('UNDICI_REQUEST')\n    } catch (err) {\n      if (util.isStream(body)) {\n        util.destroy(body.on('error', util.nop), err)\n      }\n      throw err\n    }\n\n    this.method = method\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.callback = callback\n    this.res = null\n    this.abort = null\n    this.body = body\n    this.trailers = {}\n    this.context = null\n    this.onInfo = onInfo || null\n    this.throwOnError = throwOnError\n    this.highWaterMark = highWaterMark\n    this.signal = signal\n    this.reason = null\n    this.removeAbortListener = null\n\n    if (util.isStream(body)) {\n      body.on('error', (err) => {\n        this.onError(err)\n      })\n    }\n\n    if (this.signal) {\n      if (this.signal.aborted) {\n        this.reason = this.signal.reason ?? new RequestAbortedError()\n      } else {\n        this.removeAbortListener = util.addAbortListener(this.signal, () => {\n          this.reason = this.signal.reason ?? new RequestAbortedError()\n          if (this.res) {\n            util.destroy(this.res.on('error', util.nop), this.reason)\n          } else if (this.abort) {\n            this.abort(this.reason)\n          }\n\n          if (this.removeAbortListener) {\n            this.res?.off('close', this.removeAbortListener)\n            this.removeAbortListener()\n            this.removeAbortListener = null\n          }\n        })\n      }\n    }\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this\n\n    const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n    const contentType = parsedHeaders['content-type']\n    const contentLength = parsedHeaders['content-length']\n    const res = new Readable({\n      resume,\n      abort,\n      contentType,\n      contentLength: this.method !== 'HEAD' && contentLength\n        ? Number(contentLength)\n        : null,\n      highWaterMark\n    })\n\n    if (this.removeAbortListener) {\n      res.on('close', this.removeAbortListener)\n    }\n\n    this.callback = null\n    this.res = res\n    if (callback !== null) {\n      if (this.throwOnError && statusCode >= 400) {\n        this.runInAsyncScope(getResolveErrorBodyCallback, null,\n          { callback, body: res, contentType, statusCode, statusMessage, headers }\n        )\n      } else {\n        this.runInAsyncScope(callback, null, null, {\n          statusCode,\n          headers,\n          trailers: this.trailers,\n          opaque,\n          body: res,\n          context\n        })\n      }\n    }\n  }\n\n  onData (chunk) {\n    return this.res.push(chunk)\n  }\n\n  onComplete (trailers) {\n    util.parseHeaders(trailers, this.trailers)\n    this.res.push(null)\n  }\n\n  onError (err) {\n    const { res, callback, body, opaque } = this\n\n    if (callback) {\n      // TODO: Does this need queueMicrotask?\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n\n    if (res) {\n      this.res = null\n      // Ensure all queued handlers are invoked before destroying res.\n      queueMicrotask(() => {\n        util.destroy(res, err)\n      })\n    }\n\n    if (body) {\n      this.body = null\n      util.destroy(body, err)\n    }\n\n    if (this.removeAbortListener) {\n      res?.off('close', this.removeAbortListener)\n      this.removeAbortListener()\n      this.removeAbortListener = null\n    }\n  }\n}\n\nfunction request (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      request.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    this.dispatch(opts, new RequestHandler(opts, callback))\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = request\nmodule.exports.RequestHandler = RequestHandler\n","'use strict'\n\nconst assert = require('node:assert')\nconst { finished, PassThrough } = require('node:stream')\nconst { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass StreamHandler extends AsyncResource {\n  constructor (opts, factory, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts\n\n    try {\n      if (typeof callback !== 'function') {\n        throw new InvalidArgumentError('invalid callback')\n      }\n\n      if (typeof factory !== 'function') {\n        throw new InvalidArgumentError('invalid factory')\n      }\n\n      if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n        throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n      }\n\n      if (method === 'CONNECT') {\n        throw new InvalidArgumentError('invalid method')\n      }\n\n      if (onInfo && typeof onInfo !== 'function') {\n        throw new InvalidArgumentError('invalid onInfo callback')\n      }\n\n      super('UNDICI_STREAM')\n    } catch (err) {\n      if (util.isStream(body)) {\n        util.destroy(body.on('error', util.nop), err)\n      }\n      throw err\n    }\n\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.factory = factory\n    this.callback = callback\n    this.res = null\n    this.abort = null\n    this.context = null\n    this.trailers = null\n    this.body = body\n    this.onInfo = onInfo || null\n    this.throwOnError = throwOnError || false\n\n    if (util.isStream(body)) {\n      body.on('error', (err) => {\n        this.onError(err)\n      })\n    }\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = context\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const { factory, opaque, context, callback, responseHeaders } = this\n\n    const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n    if (statusCode < 200) {\n      if (this.onInfo) {\n        this.onInfo({ statusCode, headers })\n      }\n      return\n    }\n\n    this.factory = null\n\n    let res\n\n    if (this.throwOnError && statusCode >= 400) {\n      const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n      const contentType = parsedHeaders['content-type']\n      res = new PassThrough()\n\n      this.callback = null\n      this.runInAsyncScope(getResolveErrorBodyCallback, null,\n        { callback, body: res, contentType, statusCode, statusMessage, headers }\n      )\n    } else {\n      if (factory === null) {\n        return\n      }\n\n      res = this.runInAsyncScope(factory, null, {\n        statusCode,\n        headers,\n        opaque,\n        context\n      })\n\n      if (\n        !res ||\n        typeof res.write !== 'function' ||\n        typeof res.end !== 'function' ||\n        typeof res.on !== 'function'\n      ) {\n        throw new InvalidReturnValueError('expected Writable')\n      }\n\n      // TODO: Avoid finished. It registers an unnecessary amount of listeners.\n      finished(res, { readable: false }, (err) => {\n        const { callback, res, opaque, trailers, abort } = this\n\n        this.res = null\n        if (err || !res.readable) {\n          util.destroy(res, err)\n        }\n\n        this.callback = null\n        this.runInAsyncScope(callback, null, err || null, { opaque, trailers })\n\n        if (err) {\n          abort()\n        }\n      })\n    }\n\n    res.on('drain', resume)\n\n    this.res = res\n\n    const needDrain = res.writableNeedDrain !== undefined\n      ? res.writableNeedDrain\n      : res._writableState?.needDrain\n\n    return needDrain !== true\n  }\n\n  onData (chunk) {\n    const { res } = this\n\n    return res ? res.write(chunk) : true\n  }\n\n  onComplete (trailers) {\n    const { res } = this\n\n    removeSignal(this)\n\n    if (!res) {\n      return\n    }\n\n    this.trailers = util.parseHeaders(trailers)\n\n    res.end()\n  }\n\n  onError (err) {\n    const { res, callback, opaque, body } = this\n\n    removeSignal(this)\n\n    this.factory = null\n\n    if (res) {\n      this.res = null\n      util.destroy(res, err)\n    } else if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n\n    if (body) {\n      this.body = null\n      util.destroy(body, err)\n    }\n  }\n}\n\nfunction stream (opts, factory, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      stream.call(this, opts, factory, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    this.dispatch(opts, new StreamHandler(opts, factory, callback))\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = stream\n","'use strict'\n\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst { AsyncResource } = require('node:async_hooks')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nclass UpgradeHandler extends AsyncResource {\n  constructor (opts, callback) {\n    if (!opts || typeof opts !== 'object') {\n      throw new InvalidArgumentError('invalid opts')\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    const { signal, opaque, responseHeaders } = opts\n\n    if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n      throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n    }\n\n    super('UNDICI_UPGRADE')\n\n    this.responseHeaders = responseHeaders || null\n    this.opaque = opaque || null\n    this.callback = callback\n    this.abort = null\n    this.context = null\n\n    addSignal(this, signal)\n  }\n\n  onConnect (abort, context) {\n    if (this.reason) {\n      abort(this.reason)\n      return\n    }\n\n    assert(this.callback)\n\n    this.abort = abort\n    this.context = null\n  }\n\n  onHeaders () {\n    throw new SocketError('bad upgrade', null)\n  }\n\n  onUpgrade (statusCode, rawHeaders, socket) {\n    assert(statusCode === 101)\n\n    const { callback, opaque, context } = this\n\n    removeSignal(this)\n\n    this.callback = null\n    const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n    this.runInAsyncScope(callback, null, null, {\n      headers,\n      socket,\n      opaque,\n      context\n    })\n  }\n\n  onError (err) {\n    const { callback, opaque } = this\n\n    removeSignal(this)\n\n    if (callback) {\n      this.callback = null\n      queueMicrotask(() => {\n        this.runInAsyncScope(callback, null, err, { opaque })\n      })\n    }\n  }\n}\n\nfunction upgrade (opts, callback) {\n  if (callback === undefined) {\n    return new Promise((resolve, reject) => {\n      upgrade.call(this, opts, (err, data) => {\n        return err ? reject(err) : resolve(data)\n      })\n    })\n  }\n\n  try {\n    const upgradeHandler = new UpgradeHandler(opts, callback)\n    this.dispatch({\n      ...opts,\n      method: opts.method || 'GET',\n      upgrade: opts.protocol || 'Websocket'\n    }, upgradeHandler)\n  } catch (err) {\n    if (typeof callback !== 'function') {\n      throw err\n    }\n    const opaque = opts?.opaque\n    queueMicrotask(() => callback(err, { opaque }))\n  }\n}\n\nmodule.exports = upgrade\n","'use strict'\n\nmodule.exports.request = require('./api-request')\nmodule.exports.stream = require('./api-stream')\nmodule.exports.pipeline = require('./api-pipeline')\nmodule.exports.upgrade = require('./api-upgrade')\nmodule.exports.connect = require('./api-connect')\n","// Ported from https://github.com/nodejs/undici/pull/907\n\n'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('node:stream')\nconst { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require('../core/errors')\nconst util = require('../core/util')\nconst { ReadableStreamFrom } = require('../core/util')\n\nconst kConsume = Symbol('kConsume')\nconst kReading = Symbol('kReading')\nconst kBody = Symbol('kBody')\nconst kAbort = Symbol('kAbort')\nconst kContentType = Symbol('kContentType')\nconst kContentLength = Symbol('kContentLength')\n\nconst noop = () => {}\n\nclass BodyReadable extends Readable {\n  constructor ({\n    resume,\n    abort,\n    contentType = '',\n    contentLength,\n    highWaterMark = 64 * 1024 // Same as nodejs fs streams.\n  }) {\n    super({\n      autoDestroy: true,\n      read: resume,\n      highWaterMark\n    })\n\n    this._readableState.dataEmitted = false\n\n    this[kAbort] = abort\n    this[kConsume] = null\n    this[kBody] = null\n    this[kContentType] = contentType\n    this[kContentLength] = contentLength\n\n    // Is stream being consumed through Readable API?\n    // This is an optimization so that we avoid checking\n    // for 'data' and 'readable' listeners in the hot path\n    // inside push().\n    this[kReading] = false\n  }\n\n  destroy (err) {\n    if (!err && !this._readableState.endEmitted) {\n      err = new RequestAbortedError()\n    }\n\n    if (err) {\n      this[kAbort]()\n    }\n\n    return super.destroy(err)\n  }\n\n  _destroy (err, callback) {\n    // Workaround for Node \"bug\". If the stream is destroyed in same\n    // tick as it is created, then a user who is waiting for a\n    // promise (i.e micro tick) for installing a 'error' listener will\n    // never get a chance and will always encounter an unhandled exception.\n    if (!this[kReading]) {\n      setImmediate(() => {\n        callback(err)\n      })\n    } else {\n      callback(err)\n    }\n  }\n\n  on (ev, ...args) {\n    if (ev === 'data' || ev === 'readable') {\n      this[kReading] = true\n    }\n    return super.on(ev, ...args)\n  }\n\n  addListener (ev, ...args) {\n    return this.on(ev, ...args)\n  }\n\n  off (ev, ...args) {\n    const ret = super.off(ev, ...args)\n    if (ev === 'data' || ev === 'readable') {\n      this[kReading] = (\n        this.listenerCount('data') > 0 ||\n        this.listenerCount('readable') > 0\n      )\n    }\n    return ret\n  }\n\n  removeListener (ev, ...args) {\n    return this.off(ev, ...args)\n  }\n\n  push (chunk) {\n    if (this[kConsume] && chunk !== null) {\n      consumePush(this[kConsume], chunk)\n      return this[kReading] ? super.push(chunk) : true\n    }\n    return super.push(chunk)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-text\n  async text () {\n    return consume(this, 'text')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-json\n  async json () {\n    return consume(this, 'json')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-blob\n  async blob () {\n    return consume(this, 'blob')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bytes\n  async bytes () {\n    return consume(this, 'bytes')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n  async arrayBuffer () {\n    return consume(this, 'arrayBuffer')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-formdata\n  async formData () {\n    // TODO: Implement.\n    throw new NotSupportedError()\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bodyused\n  get bodyUsed () {\n    return util.isDisturbed(this)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-body\n  get body () {\n    if (!this[kBody]) {\n      this[kBody] = ReadableStreamFrom(this)\n      if (this[kConsume]) {\n        // TODO: Is this the best way to force a lock?\n        this[kBody].getReader() // Ensure stream is locked.\n        assert(this[kBody].locked)\n      }\n    }\n    return this[kBody]\n  }\n\n  async dump (opts) {\n    let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024\n    const signal = opts?.signal\n\n    if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) {\n      throw new InvalidArgumentError('signal must be an AbortSignal')\n    }\n\n    signal?.throwIfAborted()\n\n    if (this._readableState.closeEmitted) {\n      return null\n    }\n\n    return await new Promise((resolve, reject) => {\n      if (this[kContentLength] > limit) {\n        this.destroy(new AbortError())\n      }\n\n      const onAbort = () => {\n        this.destroy(signal.reason ?? new AbortError())\n      }\n      signal?.addEventListener('abort', onAbort)\n\n      this\n        .on('close', function () {\n          signal?.removeEventListener('abort', onAbort)\n          if (signal?.aborted) {\n            reject(signal.reason ?? new AbortError())\n          } else {\n            resolve(null)\n          }\n        })\n        .on('error', noop)\n        .on('data', function (chunk) {\n          limit -= chunk.length\n          if (limit <= 0) {\n            this.destroy()\n          }\n        })\n        .resume()\n    })\n  }\n}\n\n// https://streams.spec.whatwg.org/#readablestream-locked\nfunction isLocked (self) {\n  // Consume is an implicit lock.\n  return (self[kBody] && self[kBody].locked === true) || self[kConsume]\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction isUnusable (self) {\n  return util.isDisturbed(self) || isLocked(self)\n}\n\nasync function consume (stream, type) {\n  assert(!stream[kConsume])\n\n  return new Promise((resolve, reject) => {\n    if (isUnusable(stream)) {\n      const rState = stream._readableState\n      if (rState.destroyed && rState.closeEmitted === false) {\n        stream\n          .on('error', err => {\n            reject(err)\n          })\n          .on('close', () => {\n            reject(new TypeError('unusable'))\n          })\n      } else {\n        reject(rState.errored ?? new TypeError('unusable'))\n      }\n    } else {\n      queueMicrotask(() => {\n        stream[kConsume] = {\n          type,\n          stream,\n          resolve,\n          reject,\n          length: 0,\n          body: []\n        }\n\n        stream\n          .on('error', function (err) {\n            consumeFinish(this[kConsume], err)\n          })\n          .on('close', function () {\n            if (this[kConsume].body !== null) {\n              consumeFinish(this[kConsume], new RequestAbortedError())\n            }\n          })\n\n        consumeStart(stream[kConsume])\n      })\n    }\n  })\n}\n\nfunction consumeStart (consume) {\n  if (consume.body === null) {\n    return\n  }\n\n  const { _readableState: state } = consume.stream\n\n  if (state.bufferIndex) {\n    const start = state.bufferIndex\n    const end = state.buffer.length\n    for (let n = start; n < end; n++) {\n      consumePush(consume, state.buffer[n])\n    }\n  } else {\n    for (const chunk of state.buffer) {\n      consumePush(consume, chunk)\n    }\n  }\n\n  if (state.endEmitted) {\n    consumeEnd(this[kConsume])\n  } else {\n    consume.stream.on('end', function () {\n      consumeEnd(this[kConsume])\n    })\n  }\n\n  consume.stream.resume()\n\n  while (consume.stream.read() != null) {\n    // Loop\n  }\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n */\nfunction chunksDecode (chunks, length) {\n  if (chunks.length === 0 || length === 0) {\n    return ''\n  }\n  const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length)\n  const bufferLength = buffer.length\n\n  // Skip BOM.\n  const start =\n    bufferLength > 2 &&\n    buffer[0] === 0xef &&\n    buffer[1] === 0xbb &&\n    buffer[2] === 0xbf\n      ? 3\n      : 0\n  return buffer.utf8Slice(start, bufferLength)\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n * @returns {Uint8Array}\n */\nfunction chunksConcat (chunks, length) {\n  if (chunks.length === 0 || length === 0) {\n    return new Uint8Array(0)\n  }\n  if (chunks.length === 1) {\n    // fast-path\n    return new Uint8Array(chunks[0])\n  }\n  const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer)\n\n  let offset = 0\n  for (let i = 0; i < chunks.length; ++i) {\n    const chunk = chunks[i]\n    buffer.set(chunk, offset)\n    offset += chunk.length\n  }\n\n  return buffer\n}\n\nfunction consumeEnd (consume) {\n  const { type, body, resolve, stream, length } = consume\n\n  try {\n    if (type === 'text') {\n      resolve(chunksDecode(body, length))\n    } else if (type === 'json') {\n      resolve(JSON.parse(chunksDecode(body, length)))\n    } else if (type === 'arrayBuffer') {\n      resolve(chunksConcat(body, length).buffer)\n    } else if (type === 'blob') {\n      resolve(new Blob(body, { type: stream[kContentType] }))\n    } else if (type === 'bytes') {\n      resolve(chunksConcat(body, length))\n    }\n\n    consumeFinish(consume)\n  } catch (err) {\n    stream.destroy(err)\n  }\n}\n\nfunction consumePush (consume, chunk) {\n  consume.length += chunk.length\n  consume.body.push(chunk)\n}\n\nfunction consumeFinish (consume, err) {\n  if (consume.body === null) {\n    return\n  }\n\n  if (err) {\n    consume.reject(err)\n  } else {\n    consume.resolve()\n  }\n\n  consume.type = null\n  consume.stream = null\n  consume.resolve = null\n  consume.reject = null\n  consume.length = 0\n  consume.body = null\n}\n\nmodule.exports = { Readable: BodyReadable, chunksDecode }\n","const assert = require('node:assert')\nconst {\n  ResponseStatusCodeError\n} = require('../core/errors')\n\nconst { chunksDecode } = require('./readable')\nconst CHUNK_LIMIT = 128 * 1024\n\nasync function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {\n  assert(body)\n\n  let chunks = []\n  let length = 0\n\n  try {\n    for await (const chunk of body) {\n      chunks.push(chunk)\n      length += chunk.length\n      if (length > CHUNK_LIMIT) {\n        chunks = []\n        length = 0\n        break\n      }\n    }\n  } catch {\n    chunks = []\n    length = 0\n    // Do nothing....\n  }\n\n  const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`\n\n  if (statusCode === 204 || !contentType || !length) {\n    queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)))\n    return\n  }\n\n  const stackTraceLimit = Error.stackTraceLimit\n  Error.stackTraceLimit = 0\n  let payload\n\n  try {\n    if (isContentTypeApplicationJson(contentType)) {\n      payload = JSON.parse(chunksDecode(chunks, length))\n    } else if (isContentTypeText(contentType)) {\n      payload = chunksDecode(chunks, length)\n    }\n  } catch {\n    // process in a callback to avoid throwing in the microtask queue\n  } finally {\n    Error.stackTraceLimit = stackTraceLimit\n  }\n  queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)))\n}\n\nconst isContentTypeApplicationJson = (contentType) => {\n  return (\n    contentType.length > 15 &&\n    contentType[11] === '/' &&\n    contentType[0] === 'a' &&\n    contentType[1] === 'p' &&\n    contentType[2] === 'p' &&\n    contentType[3] === 'l' &&\n    contentType[4] === 'i' &&\n    contentType[5] === 'c' &&\n    contentType[6] === 'a' &&\n    contentType[7] === 't' &&\n    contentType[8] === 'i' &&\n    contentType[9] === 'o' &&\n    contentType[10] === 'n' &&\n    contentType[12] === 'j' &&\n    contentType[13] === 's' &&\n    contentType[14] === 'o' &&\n    contentType[15] === 'n'\n  )\n}\n\nconst isContentTypeText = (contentType) => {\n  return (\n    contentType.length > 4 &&\n    contentType[4] === '/' &&\n    contentType[0] === 't' &&\n    contentType[1] === 'e' &&\n    contentType[2] === 'x' &&\n    contentType[3] === 't'\n  )\n}\n\nmodule.exports = {\n  getResolveErrorBodyCallback,\n  isContentTypeApplicationJson,\n  isContentTypeText\n}\n","'use strict'\n\nconst net = require('node:net')\nconst assert = require('node:assert')\nconst util = require('./util')\nconst { InvalidArgumentError, ConnectTimeoutError } = require('./errors')\nconst timers = require('../util/timers')\n\nfunction noop () {}\n\nlet tls // include tls conditionally since it is not always available\n\n// TODO: session re-use does not wait for the first\n// connection to resolve the session and might therefore\n// resolve the same servername multiple times even when\n// re-use is enabled.\n\nlet SessionCache\n// FIXME: remove workaround when the Node bug is fixed\n// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\nif (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) {\n  SessionCache = class WeakSessionCache {\n    constructor (maxCachedSessions) {\n      this._maxCachedSessions = maxCachedSessions\n      this._sessionCache = new Map()\n      this._sessionRegistry = new global.FinalizationRegistry((key) => {\n        if (this._sessionCache.size < this._maxCachedSessions) {\n          return\n        }\n\n        const ref = this._sessionCache.get(key)\n        if (ref !== undefined && ref.deref() === undefined) {\n          this._sessionCache.delete(key)\n        }\n      })\n    }\n\n    get (sessionKey) {\n      const ref = this._sessionCache.get(sessionKey)\n      return ref ? ref.deref() : null\n    }\n\n    set (sessionKey, session) {\n      if (this._maxCachedSessions === 0) {\n        return\n      }\n\n      this._sessionCache.set(sessionKey, new WeakRef(session))\n      this._sessionRegistry.register(session, sessionKey)\n    }\n  }\n} else {\n  SessionCache = class SimpleSessionCache {\n    constructor (maxCachedSessions) {\n      this._maxCachedSessions = maxCachedSessions\n      this._sessionCache = new Map()\n    }\n\n    get (sessionKey) {\n      return this._sessionCache.get(sessionKey)\n    }\n\n    set (sessionKey, session) {\n      if (this._maxCachedSessions === 0) {\n        return\n      }\n\n      if (this._sessionCache.size >= this._maxCachedSessions) {\n        // remove the oldest session\n        const { value: oldestKey } = this._sessionCache.keys().next()\n        this._sessionCache.delete(oldestKey)\n      }\n\n      this._sessionCache.set(sessionKey, session)\n    }\n  }\n}\n\nfunction buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {\n  if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n    throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')\n  }\n\n  const options = { path: socketPath, ...opts }\n  const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)\n  timeout = timeout == null ? 10e3 : timeout\n  allowH2 = allowH2 != null ? allowH2 : false\n  return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n    let socket\n    if (protocol === 'https:') {\n      if (!tls) {\n        tls = require('node:tls')\n      }\n      servername = servername || options.servername || util.getServerName(host) || null\n\n      const sessionKey = servername || hostname\n      assert(sessionKey)\n\n      const session = customSession || sessionCache.get(sessionKey) || null\n\n      port = port || 443\n\n      socket = tls.connect({\n        highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...\n        ...options,\n        servername,\n        session,\n        localAddress,\n        // TODO(HTTP/2): Add support for h2c\n        ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],\n        socket: httpSocket, // upgrade socket connection\n        port,\n        host: hostname\n      })\n\n      socket\n        .on('session', function (session) {\n          // TODO (fix): Can a session become invalid once established? Don't think so?\n          sessionCache.set(sessionKey, session)\n        })\n    } else {\n      assert(!httpSocket, 'httpSocket can only be sent on TLS update')\n\n      port = port || 80\n\n      socket = net.connect({\n        highWaterMark: 64 * 1024, // Same as nodejs fs streams.\n        ...options,\n        localAddress,\n        port,\n        host: hostname\n      })\n    }\n\n    // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket\n    if (options.keepAlive == null || options.keepAlive) {\n      const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay\n      socket.setKeepAlive(true, keepAliveInitialDelay)\n    }\n\n    const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port })\n\n    socket\n      .setNoDelay(true)\n      .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {\n        queueMicrotask(clearConnectTimeout)\n\n        if (callback) {\n          const cb = callback\n          callback = null\n          cb(null, this)\n        }\n      })\n      .on('error', function (err) {\n        queueMicrotask(clearConnectTimeout)\n\n        if (callback) {\n          const cb = callback\n          callback = null\n          cb(err)\n        }\n      })\n\n    return socket\n  }\n}\n\n/**\n * @param {WeakRef} socketWeakRef\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n * @returns {() => void}\n */\nconst setupConnectTimeout = process.platform === 'win32'\n  ? (socketWeakRef, opts) => {\n      if (!opts.timeout) {\n        return noop\n      }\n\n      let s1 = null\n      let s2 = null\n      const fastTimer = timers.setFastTimeout(() => {\n      // setImmediate is added to make sure that we prioritize socket error events over timeouts\n        s1 = setImmediate(() => {\n        // Windows needs an extra setImmediate probably due to implementation differences in the socket logic\n          s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))\n        })\n      }, opts.timeout)\n      return () => {\n        timers.clearFastTimeout(fastTimer)\n        clearImmediate(s1)\n        clearImmediate(s2)\n      }\n    }\n  : (socketWeakRef, opts) => {\n      if (!opts.timeout) {\n        return noop\n      }\n\n      let s1 = null\n      const fastTimer = timers.setFastTimeout(() => {\n      // setImmediate is added to make sure that we prioritize socket error events over timeouts\n        s1 = setImmediate(() => {\n          onConnectTimeout(socketWeakRef.deref(), opts)\n        })\n      }, opts.timeout)\n      return () => {\n        timers.clearFastTimeout(fastTimer)\n        clearImmediate(s1)\n      }\n    }\n\n/**\n * @param {net.Socket} socket\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n */\nfunction onConnectTimeout (socket, opts) {\n  // The socket could be already garbage collected\n  if (socket == null) {\n    return\n  }\n\n  let message = 'Connect Timeout Error'\n  if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {\n    message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`\n  } else {\n    message += ` (attempted address: ${opts.hostname}:${opts.port},`\n  }\n\n  message += ` timeout: ${opts.timeout}ms)`\n\n  util.destroy(socket, new ConnectTimeoutError(message))\n}\n\nmodule.exports = buildConnector\n","'use strict'\n\n/** @type {Record} */\nconst headerNameLowerCasedRecord = {}\n\n// https://developer.mozilla.org/docs/Web/HTTP/Headers\nconst wellknownHeaderNames = [\n  'Accept',\n  'Accept-Encoding',\n  'Accept-Language',\n  'Accept-Ranges',\n  'Access-Control-Allow-Credentials',\n  'Access-Control-Allow-Headers',\n  'Access-Control-Allow-Methods',\n  'Access-Control-Allow-Origin',\n  'Access-Control-Expose-Headers',\n  'Access-Control-Max-Age',\n  'Access-Control-Request-Headers',\n  'Access-Control-Request-Method',\n  'Age',\n  'Allow',\n  'Alt-Svc',\n  'Alt-Used',\n  'Authorization',\n  'Cache-Control',\n  'Clear-Site-Data',\n  'Connection',\n  'Content-Disposition',\n  'Content-Encoding',\n  'Content-Language',\n  'Content-Length',\n  'Content-Location',\n  'Content-Range',\n  'Content-Security-Policy',\n  'Content-Security-Policy-Report-Only',\n  'Content-Type',\n  'Cookie',\n  'Cross-Origin-Embedder-Policy',\n  'Cross-Origin-Opener-Policy',\n  'Cross-Origin-Resource-Policy',\n  'Date',\n  'Device-Memory',\n  'Downlink',\n  'ECT',\n  'ETag',\n  'Expect',\n  'Expect-CT',\n  'Expires',\n  'Forwarded',\n  'From',\n  'Host',\n  'If-Match',\n  'If-Modified-Since',\n  'If-None-Match',\n  'If-Range',\n  'If-Unmodified-Since',\n  'Keep-Alive',\n  'Last-Modified',\n  'Link',\n  'Location',\n  'Max-Forwards',\n  'Origin',\n  'Permissions-Policy',\n  'Pragma',\n  'Proxy-Authenticate',\n  'Proxy-Authorization',\n  'RTT',\n  'Range',\n  'Referer',\n  'Referrer-Policy',\n  'Refresh',\n  'Retry-After',\n  'Sec-WebSocket-Accept',\n  'Sec-WebSocket-Extensions',\n  'Sec-WebSocket-Key',\n  'Sec-WebSocket-Protocol',\n  'Sec-WebSocket-Version',\n  'Server',\n  'Server-Timing',\n  'Service-Worker-Allowed',\n  'Service-Worker-Navigation-Preload',\n  'Set-Cookie',\n  'SourceMap',\n  'Strict-Transport-Security',\n  'Supports-Loading-Mode',\n  'TE',\n  'Timing-Allow-Origin',\n  'Trailer',\n  'Transfer-Encoding',\n  'Upgrade',\n  'Upgrade-Insecure-Requests',\n  'User-Agent',\n  'Vary',\n  'Via',\n  'WWW-Authenticate',\n  'X-Content-Type-Options',\n  'X-DNS-Prefetch-Control',\n  'X-Frame-Options',\n  'X-Permitted-Cross-Domain-Policies',\n  'X-Powered-By',\n  'X-Requested-With',\n  'X-XSS-Protection'\n]\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n  const key = wellknownHeaderNames[i]\n  const lowerCasedKey = key.toLowerCase()\n  headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =\n    lowerCasedKey\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(headerNameLowerCasedRecord, null)\n\nmodule.exports = {\n  wellknownHeaderNames,\n  headerNameLowerCasedRecord\n}\n","'use strict'\nconst diagnosticsChannel = require('node:diagnostics_channel')\nconst util = require('node:util')\n\nconst undiciDebugLog = util.debuglog('undici')\nconst fetchDebuglog = util.debuglog('fetch')\nconst websocketDebuglog = util.debuglog('websocket')\nlet isClientSet = false\nconst channels = {\n  // Client\n  beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),\n  connected: diagnosticsChannel.channel('undici:client:connected'),\n  connectError: diagnosticsChannel.channel('undici:client:connectError'),\n  sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),\n  // Request\n  create: diagnosticsChannel.channel('undici:request:create'),\n  bodySent: diagnosticsChannel.channel('undici:request:bodySent'),\n  headers: diagnosticsChannel.channel('undici:request:headers'),\n  trailers: diagnosticsChannel.channel('undici:request:trailers'),\n  error: diagnosticsChannel.channel('undici:request:error'),\n  // WebSocket\n  open: diagnosticsChannel.channel('undici:websocket:open'),\n  close: diagnosticsChannel.channel('undici:websocket:close'),\n  socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),\n  ping: diagnosticsChannel.channel('undici:websocket:ping'),\n  pong: diagnosticsChannel.channel('undici:websocket:pong')\n}\n\nif (undiciDebugLog.enabled || fetchDebuglog.enabled) {\n  const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog\n\n  // Track all Client events\n  diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host }\n    } = evt\n    debuglog(\n      'connecting to %s using %s%s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host }\n    } = evt\n    debuglog(\n      'connected to %s using %s%s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n    const {\n      connectParams: { version, protocol, port, host },\n      error\n    } = evt\n    debuglog(\n      'connection to %s using %s%s errored - %s',\n      `${host}${port ? `:${port}` : ''}`,\n      protocol,\n      version,\n      error.message\n    )\n  })\n\n  diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n    const {\n      request: { method, path, origin }\n    } = evt\n    debuglog('sending request to %s %s/%s', method, origin, path)\n  })\n\n  // Track Request events\n  diagnosticsChannel.channel('undici:request:headers').subscribe(evt => {\n    const {\n      request: { method, path, origin },\n      response: { statusCode }\n    } = evt\n    debuglog(\n      'received response to %s %s/%s - HTTP %d',\n      method,\n      origin,\n      path,\n      statusCode\n    )\n  })\n\n  diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => {\n    const {\n      request: { method, path, origin }\n    } = evt\n    debuglog('trailers received from %s %s/%s', method, origin, path)\n  })\n\n  diagnosticsChannel.channel('undici:request:error').subscribe(evt => {\n    const {\n      request: { method, path, origin },\n      error\n    } = evt\n    debuglog(\n      'request to %s %s/%s errored - %s',\n      method,\n      origin,\n      path,\n      error.message\n    )\n  })\n\n  isClientSet = true\n}\n\nif (websocketDebuglog.enabled) {\n  if (!isClientSet) {\n    const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog\n    diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host }\n      } = evt\n      debuglog(\n        'connecting to %s%s using %s%s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host }\n      } = evt\n      debuglog(\n        'connected to %s%s using %s%s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n      const {\n        connectParams: { version, protocol, port, host },\n        error\n      } = evt\n      debuglog(\n        'connection to %s%s using %s%s errored - %s',\n        host,\n        port ? `:${port}` : '',\n        protocol,\n        version,\n        error.message\n      )\n    })\n\n    diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n      const {\n        request: { method, path, origin }\n      } = evt\n      debuglog('sending request to %s %s/%s', method, origin, path)\n    })\n  }\n\n  // Track all WebSocket events\n  diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => {\n    const {\n      address: { address, port }\n    } = evt\n    websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '')\n  })\n\n  diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => {\n    const { websocket, code, reason } = evt\n    websocketDebuglog(\n      'closed connection to %s - %s %s',\n      websocket.url,\n      code,\n      reason\n    )\n  })\n\n  diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => {\n    websocketDebuglog('connection errored - %s', err.message)\n  })\n\n  diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => {\n    websocketDebuglog('ping received')\n  })\n\n  diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => {\n    websocketDebuglog('pong received')\n  })\n}\n\nmodule.exports = {\n  channels\n}\n","'use strict'\n\nconst kUndiciError = Symbol.for('undici.error.UND_ERR')\nclass UndiciError extends Error {\n  constructor (message) {\n    super(message)\n    this.name = 'UndiciError'\n    this.code = 'UND_ERR'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kUndiciError] === true\n  }\n\n  [kUndiciError] = true\n}\n\nconst kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT')\nclass ConnectTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ConnectTimeoutError'\n    this.message = message || 'Connect Timeout Error'\n    this.code = 'UND_ERR_CONNECT_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kConnectTimeoutError] === true\n  }\n\n  [kConnectTimeoutError] = true\n}\n\nconst kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT')\nclass HeadersTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'HeadersTimeoutError'\n    this.message = message || 'Headers Timeout Error'\n    this.code = 'UND_ERR_HEADERS_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHeadersTimeoutError] === true\n  }\n\n  [kHeadersTimeoutError] = true\n}\n\nconst kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW')\nclass HeadersOverflowError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'HeadersOverflowError'\n    this.message = message || 'Headers Overflow Error'\n    this.code = 'UND_ERR_HEADERS_OVERFLOW'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHeadersOverflowError] === true\n  }\n\n  [kHeadersOverflowError] = true\n}\n\nconst kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT')\nclass BodyTimeoutError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'BodyTimeoutError'\n    this.message = message || 'Body Timeout Error'\n    this.code = 'UND_ERR_BODY_TIMEOUT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kBodyTimeoutError] === true\n  }\n\n  [kBodyTimeoutError] = true\n}\n\nconst kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE')\nclass ResponseStatusCodeError extends UndiciError {\n  constructor (message, statusCode, headers, body) {\n    super(message)\n    this.name = 'ResponseStatusCodeError'\n    this.message = message || 'Response Status Code Error'\n    this.code = 'UND_ERR_RESPONSE_STATUS_CODE'\n    this.body = body\n    this.status = statusCode\n    this.statusCode = statusCode\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseStatusCodeError] === true\n  }\n\n  [kResponseStatusCodeError] = true\n}\n\nconst kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG')\nclass InvalidArgumentError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InvalidArgumentError'\n    this.message = message || 'Invalid Argument Error'\n    this.code = 'UND_ERR_INVALID_ARG'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInvalidArgumentError] === true\n  }\n\n  [kInvalidArgumentError] = true\n}\n\nconst kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE')\nclass InvalidReturnValueError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InvalidReturnValueError'\n    this.message = message || 'Invalid Return Value Error'\n    this.code = 'UND_ERR_INVALID_RETURN_VALUE'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInvalidReturnValueError] === true\n  }\n\n  [kInvalidReturnValueError] = true\n}\n\nconst kAbortError = Symbol.for('undici.error.UND_ERR_ABORT')\nclass AbortError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'AbortError'\n    this.message = message || 'The operation was aborted'\n    this.code = 'UND_ERR_ABORT'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kAbortError] === true\n  }\n\n  [kAbortError] = true\n}\n\nconst kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED')\nclass RequestAbortedError extends AbortError {\n  constructor (message) {\n    super(message)\n    this.name = 'AbortError'\n    this.message = message || 'Request aborted'\n    this.code = 'UND_ERR_ABORTED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestAbortedError] === true\n  }\n\n  [kRequestAbortedError] = true\n}\n\nconst kInformationalError = Symbol.for('undici.error.UND_ERR_INFO')\nclass InformationalError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'InformationalError'\n    this.message = message || 'Request information'\n    this.code = 'UND_ERR_INFO'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kInformationalError] === true\n  }\n\n  [kInformationalError] = true\n}\n\nconst kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH')\nclass RequestContentLengthMismatchError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'RequestContentLengthMismatchError'\n    this.message = message || 'Request body length does not match content-length header'\n    this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestContentLengthMismatchError] === true\n  }\n\n  [kRequestContentLengthMismatchError] = true\n}\n\nconst kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH')\nclass ResponseContentLengthMismatchError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ResponseContentLengthMismatchError'\n    this.message = message || 'Response body length does not match content-length header'\n    this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseContentLengthMismatchError] === true\n  }\n\n  [kResponseContentLengthMismatchError] = true\n}\n\nconst kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED')\nclass ClientDestroyedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ClientDestroyedError'\n    this.message = message || 'The client is destroyed'\n    this.code = 'UND_ERR_DESTROYED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kClientDestroyedError] === true\n  }\n\n  [kClientDestroyedError] = true\n}\n\nconst kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED')\nclass ClientClosedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ClientClosedError'\n    this.message = message || 'The client is closed'\n    this.code = 'UND_ERR_CLOSED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kClientClosedError] === true\n  }\n\n  [kClientClosedError] = true\n}\n\nconst kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET')\nclass SocketError extends UndiciError {\n  constructor (message, socket) {\n    super(message)\n    this.name = 'SocketError'\n    this.message = message || 'Socket error'\n    this.code = 'UND_ERR_SOCKET'\n    this.socket = socket\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kSocketError] === true\n  }\n\n  [kSocketError] = true\n}\n\nconst kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED')\nclass NotSupportedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'NotSupportedError'\n    this.message = message || 'Not supported error'\n    this.code = 'UND_ERR_NOT_SUPPORTED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kNotSupportedError] === true\n  }\n\n  [kNotSupportedError] = true\n}\n\nconst kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM')\nclass BalancedPoolMissingUpstreamError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'MissingUpstreamError'\n    this.message = message || 'No upstream has been added to the BalancedPool'\n    this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kBalancedPoolMissingUpstreamError] === true\n  }\n\n  [kBalancedPoolMissingUpstreamError] = true\n}\n\nconst kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')\nclass HTTPParserError extends Error {\n  constructor (message, code, data) {\n    super(message)\n    this.name = 'HTTPParserError'\n    this.code = code ? `HPE_${code}` : undefined\n    this.data = data ? data.toString() : undefined\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kHTTPParserError] === true\n  }\n\n  [kHTTPParserError] = true\n}\n\nconst kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE')\nclass ResponseExceededMaxSizeError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'ResponseExceededMaxSizeError'\n    this.message = message || 'Response content exceeded max size'\n    this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseExceededMaxSizeError] === true\n  }\n\n  [kResponseExceededMaxSizeError] = true\n}\n\nconst kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY')\nclass RequestRetryError extends UndiciError {\n  constructor (message, code, { headers, data }) {\n    super(message)\n    this.name = 'RequestRetryError'\n    this.message = message || 'Request retry error'\n    this.code = 'UND_ERR_REQ_RETRY'\n    this.statusCode = code\n    this.data = data\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kRequestRetryError] === true\n  }\n\n  [kRequestRetryError] = true\n}\n\nconst kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')\nclass ResponseError extends UndiciError {\n  constructor (message, code, { headers, data }) {\n    super(message)\n    this.name = 'ResponseError'\n    this.message = message || 'Response error'\n    this.code = 'UND_ERR_RESPONSE'\n    this.statusCode = code\n    this.data = data\n    this.headers = headers\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kResponseError] === true\n  }\n\n  [kResponseError] = true\n}\n\nconst kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS')\nclass SecureProxyConnectionError extends UndiciError {\n  constructor (cause, message, options) {\n    super(message, { cause, ...(options ?? {}) })\n    this.name = 'SecureProxyConnectionError'\n    this.message = message || 'Secure Proxy Connection failed'\n    this.code = 'UND_ERR_PRX_TLS'\n    this.cause = cause\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kSecureProxyConnectionError] === true\n  }\n\n  [kSecureProxyConnectionError] = true\n}\n\nconst kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED')\nclass MessageSizeExceededError extends UndiciError {\n  constructor (message) {\n    super(message)\n    this.name = 'MessageSizeExceededError'\n    this.message = message || 'Max decompressed message size exceeded'\n    this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kMessageSizeExceededError] === true\n  }\n\n  get [kMessageSizeExceededError] () {\n    return true\n  }\n}\n\nmodule.exports = {\n  AbortError,\n  HTTPParserError,\n  UndiciError,\n  HeadersTimeoutError,\n  HeadersOverflowError,\n  BodyTimeoutError,\n  RequestContentLengthMismatchError,\n  ConnectTimeoutError,\n  ResponseStatusCodeError,\n  InvalidArgumentError,\n  InvalidReturnValueError,\n  RequestAbortedError,\n  ClientDestroyedError,\n  ClientClosedError,\n  InformationalError,\n  SocketError,\n  NotSupportedError,\n  ResponseContentLengthMismatchError,\n  BalancedPoolMissingUpstreamError,\n  ResponseExceededMaxSizeError,\n  RequestRetryError,\n  ResponseError,\n  SecureProxyConnectionError,\n  MessageSizeExceededError\n}\n","'use strict'\n\nconst {\n  InvalidArgumentError,\n  NotSupportedError\n} = require('./errors')\nconst assert = require('node:assert')\nconst {\n  isValidHTTPToken,\n  isValidHeaderValue,\n  isStream,\n  destroy,\n  isBuffer,\n  isFormDataLike,\n  isIterable,\n  isBlobLike,\n  buildURL,\n  validateHandler,\n  getServerName,\n  normalizedMethodRecords\n} = require('./util')\nconst { channels } = require('./diagnostics.js')\nconst { headerNameLowerCasedRecord } = require('./constants')\n\n// Verifies that a given path is valid does not contain control chars \\x00 to \\x20\nconst invalidPathRegex = /[^\\u0021-\\u00ff]/\n\nconst kHandler = Symbol('handler')\n\nclass Request {\n  constructor (origin, {\n    path,\n    method,\n    body,\n    headers,\n    query,\n    idempotent,\n    blocking,\n    upgrade,\n    headersTimeout,\n    bodyTimeout,\n    reset,\n    throwOnError,\n    expectContinue,\n    servername\n  }, handler) {\n    if (typeof path !== 'string') {\n      throw new InvalidArgumentError('path must be a string')\n    } else if (\n      path[0] !== '/' &&\n      !(path.startsWith('http://') || path.startsWith('https://')) &&\n      method !== 'CONNECT'\n    ) {\n      throw new InvalidArgumentError('path must be an absolute URL or start with a slash')\n    } else if (invalidPathRegex.test(path)) {\n      throw new InvalidArgumentError('invalid request path')\n    }\n\n    if (typeof method !== 'string') {\n      throw new InvalidArgumentError('method must be a string')\n    } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {\n      throw new InvalidArgumentError('invalid request method')\n    }\n\n    if (upgrade && typeof upgrade !== 'string') {\n      throw new InvalidArgumentError('upgrade must be a string')\n    }\n\n    if (upgrade && !isValidHeaderValue(upgrade)) {\n      throw new InvalidArgumentError('invalid upgrade header')\n    }\n\n    if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n      throw new InvalidArgumentError('invalid headersTimeout')\n    }\n\n    if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n      throw new InvalidArgumentError('invalid bodyTimeout')\n    }\n\n    if (reset != null && typeof reset !== 'boolean') {\n      throw new InvalidArgumentError('invalid reset')\n    }\n\n    if (expectContinue != null && typeof expectContinue !== 'boolean') {\n      throw new InvalidArgumentError('invalid expectContinue')\n    }\n\n    this.headersTimeout = headersTimeout\n\n    this.bodyTimeout = bodyTimeout\n\n    this.throwOnError = throwOnError === true\n\n    this.method = method\n\n    this.abort = null\n\n    if (body == null) {\n      this.body = null\n    } else if (isStream(body)) {\n      this.body = body\n\n      const rState = this.body._readableState\n      if (!rState || !rState.autoDestroy) {\n        this.endHandler = function autoDestroy () {\n          destroy(this)\n        }\n        this.body.on('end', this.endHandler)\n      }\n\n      this.errorHandler = err => {\n        if (this.abort) {\n          this.abort(err)\n        } else {\n          this.error = err\n        }\n      }\n      this.body.on('error', this.errorHandler)\n    } else if (isBuffer(body)) {\n      this.body = body.byteLength ? body : null\n    } else if (ArrayBuffer.isView(body)) {\n      this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null\n    } else if (body instanceof ArrayBuffer) {\n      this.body = body.byteLength ? Buffer.from(body) : null\n    } else if (typeof body === 'string') {\n      this.body = body.length ? Buffer.from(body) : null\n    } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {\n      this.body = body\n    } else {\n      throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')\n    }\n\n    this.completed = false\n\n    this.aborted = false\n\n    this.upgrade = upgrade || null\n\n    this.path = query ? buildURL(path, query) : path\n\n    this.origin = origin\n\n    this.idempotent = idempotent == null\n      ? method === 'HEAD' || method === 'GET'\n      : idempotent\n\n    this.blocking = blocking == null ? false : blocking\n\n    this.reset = reset == null ? null : reset\n\n    this.host = null\n\n    this.contentLength = null\n\n    this.contentType = null\n\n    this.headers = []\n\n    // Only for H2\n    this.expectContinue = expectContinue != null ? expectContinue : false\n\n    if (Array.isArray(headers)) {\n      if (headers.length % 2 !== 0) {\n        throw new InvalidArgumentError('headers array must be even')\n      }\n      for (let i = 0; i < headers.length; i += 2) {\n        processHeader(this, headers[i], headers[i + 1])\n      }\n    } else if (headers && typeof headers === 'object') {\n      if (headers[Symbol.iterator]) {\n        for (const header of headers) {\n          if (!Array.isArray(header) || header.length !== 2) {\n            throw new InvalidArgumentError('headers must be in key-value pair format')\n          }\n          processHeader(this, header[0], header[1])\n        }\n      } else {\n        const keys = Object.keys(headers)\n        for (let i = 0; i < keys.length; ++i) {\n          processHeader(this, keys[i], headers[keys[i]])\n        }\n      }\n    } else if (headers != null) {\n      throw new InvalidArgumentError('headers must be an object or an array')\n    }\n\n    validateHandler(handler, method, upgrade)\n\n    this.servername = servername || getServerName(this.host)\n\n    this[kHandler] = handler\n\n    if (channels.create.hasSubscribers) {\n      channels.create.publish({ request: this })\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this[kHandler].onBodySent) {\n      try {\n        return this[kHandler].onBodySent(chunk)\n      } catch (err) {\n        this.abort(err)\n      }\n    }\n  }\n\n  onRequestSent () {\n    if (channels.bodySent.hasSubscribers) {\n      channels.bodySent.publish({ request: this })\n    }\n\n    if (this[kHandler].onRequestSent) {\n      try {\n        return this[kHandler].onRequestSent()\n      } catch (err) {\n        this.abort(err)\n      }\n    }\n  }\n\n  onConnect (abort) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    if (this.error) {\n      abort(this.error)\n    } else {\n      this.abort = abort\n      return this[kHandler].onConnect(abort)\n    }\n  }\n\n  onResponseStarted () {\n    return this[kHandler].onResponseStarted?.()\n  }\n\n  onHeaders (statusCode, headers, resume, statusText) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    if (channels.headers.hasSubscribers) {\n      channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n    }\n\n    try {\n      return this[kHandler].onHeaders(statusCode, headers, resume, statusText)\n    } catch (err) {\n      this.abort(err)\n    }\n  }\n\n  onData (chunk) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    try {\n      return this[kHandler].onData(chunk)\n    } catch (err) {\n      this.abort(err)\n      return false\n    }\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    assert(!this.aborted)\n    assert(!this.completed)\n\n    return this[kHandler].onUpgrade(statusCode, headers, socket)\n  }\n\n  onComplete (trailers) {\n    this.onFinally()\n\n    assert(!this.aborted)\n\n    this.completed = true\n    if (channels.trailers.hasSubscribers) {\n      channels.trailers.publish({ request: this, trailers })\n    }\n\n    try {\n      return this[kHandler].onComplete(trailers)\n    } catch (err) {\n      // TODO (fix): This might be a bad idea?\n      this.onError(err)\n    }\n  }\n\n  onError (error) {\n    this.onFinally()\n\n    if (channels.error.hasSubscribers) {\n      channels.error.publish({ request: this, error })\n    }\n\n    if (this.aborted) {\n      return\n    }\n    this.aborted = true\n\n    return this[kHandler].onError(error)\n  }\n\n  onFinally () {\n    if (this.errorHandler) {\n      this.body.off('error', this.errorHandler)\n      this.errorHandler = null\n    }\n\n    if (this.endHandler) {\n      this.body.off('end', this.endHandler)\n      this.endHandler = null\n    }\n  }\n\n  addHeader (key, value) {\n    processHeader(this, key, value)\n    return this\n  }\n}\n\nfunction processHeader (request, key, val) {\n  if (val && (typeof val === 'object' && !Array.isArray(val))) {\n    throw new InvalidArgumentError(`invalid ${key} header`)\n  } else if (val === undefined) {\n    return\n  }\n\n  let headerName = headerNameLowerCasedRecord[key]\n\n  if (headerName === undefined) {\n    headerName = key.toLowerCase()\n    if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {\n      throw new InvalidArgumentError('invalid header key')\n    }\n  }\n\n  if (Array.isArray(val)) {\n    const arr = []\n    for (let i = 0; i < val.length; i++) {\n      if (typeof val[i] === 'string') {\n        if (!isValidHeaderValue(val[i])) {\n          throw new InvalidArgumentError(`invalid ${key} header`)\n        }\n        arr.push(val[i])\n      } else if (val[i] === null) {\n        arr.push('')\n      } else if (typeof val[i] === 'object') {\n        throw new InvalidArgumentError(`invalid ${key} header`)\n      } else {\n        arr.push(`${val[i]}`)\n      }\n    }\n    val = arr\n  } else if (typeof val === 'string') {\n    if (!isValidHeaderValue(val)) {\n      throw new InvalidArgumentError(`invalid ${key} header`)\n    }\n  } else if (val === null) {\n    val = ''\n  } else {\n    val = `${val}`\n  }\n\n  if (headerName === 'host') {\n    if (request.host !== null) {\n      throw new InvalidArgumentError('duplicate host header')\n    }\n    if (typeof val !== 'string') {\n      throw new InvalidArgumentError('invalid host header')\n    }\n    // Consumed by Client\n    request.host = val\n  } else if (headerName === 'content-length') {\n    if (request.contentLength !== null) {\n      throw new InvalidArgumentError('duplicate content-length header')\n    }\n    request.contentLength = parseInt(val, 10)\n    if (!Number.isFinite(request.contentLength)) {\n      throw new InvalidArgumentError('invalid content-length header')\n    }\n  } else if (request.contentType === null && headerName === 'content-type') {\n    request.contentType = val\n    request.headers.push(key, val)\n  } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {\n    throw new InvalidArgumentError(`invalid ${headerName} header`)\n  } else if (headerName === 'connection') {\n    const value = typeof val === 'string' ? val.toLowerCase() : null\n    if (value !== 'close' && value !== 'keep-alive') {\n      throw new InvalidArgumentError('invalid connection header')\n    }\n\n    if (value === 'close') {\n      request.reset = true\n    }\n  } else if (headerName === 'expect') {\n    throw new NotSupportedError('expect header not supported')\n  } else {\n    request.headers.push(key, val)\n  }\n}\n\nmodule.exports = Request\n","module.exports = {\n  kClose: Symbol('close'),\n  kDestroy: Symbol('destroy'),\n  kDispatch: Symbol('dispatch'),\n  kUrl: Symbol('url'),\n  kWriting: Symbol('writing'),\n  kResuming: Symbol('resuming'),\n  kQueue: Symbol('queue'),\n  kConnect: Symbol('connect'),\n  kConnecting: Symbol('connecting'),\n  kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),\n  kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),\n  kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),\n  kKeepAliveTimeoutValue: Symbol('keep alive timeout'),\n  kKeepAlive: Symbol('keep alive'),\n  kHeadersTimeout: Symbol('headers timeout'),\n  kBodyTimeout: Symbol('body timeout'),\n  kServerName: Symbol('server name'),\n  kLocalAddress: Symbol('local address'),\n  kHost: Symbol('host'),\n  kNoRef: Symbol('no ref'),\n  kBodyUsed: Symbol('used'),\n  kBody: Symbol('abstracted request body'),\n  kRunning: Symbol('running'),\n  kBlocking: Symbol('blocking'),\n  kPending: Symbol('pending'),\n  kSize: Symbol('size'),\n  kBusy: Symbol('busy'),\n  kQueued: Symbol('queued'),\n  kFree: Symbol('free'),\n  kConnected: Symbol('connected'),\n  kClosed: Symbol('closed'),\n  kNeedDrain: Symbol('need drain'),\n  kReset: Symbol('reset'),\n  kDestroyed: Symbol.for('nodejs.stream.destroyed'),\n  kResume: Symbol('resume'),\n  kOnError: Symbol('on error'),\n  kMaxHeadersSize: Symbol('max headers size'),\n  kRunningIdx: Symbol('running index'),\n  kPendingIdx: Symbol('pending index'),\n  kError: Symbol('error'),\n  kClients: Symbol('clients'),\n  kClient: Symbol('client'),\n  kParser: Symbol('parser'),\n  kOnDestroyed: Symbol('destroy callbacks'),\n  kPipelining: Symbol('pipelining'),\n  kSocket: Symbol('socket'),\n  kHostHeader: Symbol('host header'),\n  kConnector: Symbol('connector'),\n  kStrictContentLength: Symbol('strict content length'),\n  kMaxRedirections: Symbol('maxRedirections'),\n  kMaxRequests: Symbol('maxRequestsPerClient'),\n  kProxy: Symbol('proxy agent options'),\n  kCounter: Symbol('socket request counter'),\n  kInterceptors: Symbol('dispatch interceptors'),\n  kMaxResponseSize: Symbol('max response size'),\n  kHTTP2Session: Symbol('http2Session'),\n  kHTTP2SessionState: Symbol('http2Session state'),\n  kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),\n  kConstruct: Symbol('constructable'),\n  kListeners: Symbol('listeners'),\n  kHTTPContext: Symbol('http context'),\n  kMaxConcurrentStreams: Symbol('max concurrent streams'),\n  kNoProxyAgent: Symbol('no proxy agent'),\n  kHttpProxyAgent: Symbol('http proxy agent'),\n  kHttpsProxyAgent: Symbol('https proxy agent')\n}\n","'use strict'\n\nconst {\n  wellknownHeaderNames,\n  headerNameLowerCasedRecord\n} = require('./constants')\n\nclass TstNode {\n  /** @type {any} */\n  value = null\n  /** @type {null | TstNode} */\n  left = null\n  /** @type {null | TstNode} */\n  middle = null\n  /** @type {null | TstNode} */\n  right = null\n  /** @type {number} */\n  code\n  /**\n   * @param {string} key\n   * @param {any} value\n   * @param {number} index\n   */\n  constructor (key, value, index) {\n    if (index === undefined || index >= key.length) {\n      throw new TypeError('Unreachable')\n    }\n    const code = this.code = key.charCodeAt(index)\n    // check code is ascii string\n    if (code > 0x7F) {\n      throw new TypeError('key must be ascii string')\n    }\n    if (key.length !== ++index) {\n      this.middle = new TstNode(key, value, index)\n    } else {\n      this.value = value\n    }\n  }\n\n  /**\n   * @param {string} key\n   * @param {any} value\n   */\n  add (key, value) {\n    const length = key.length\n    if (length === 0) {\n      throw new TypeError('Unreachable')\n    }\n    let index = 0\n    let node = this\n    while (true) {\n      const code = key.charCodeAt(index)\n      // check code is ascii string\n      if (code > 0x7F) {\n        throw new TypeError('key must be ascii string')\n      }\n      if (node.code === code) {\n        if (length === ++index) {\n          node.value = value\n          break\n        } else if (node.middle !== null) {\n          node = node.middle\n        } else {\n          node.middle = new TstNode(key, value, index)\n          break\n        }\n      } else if (node.code < code) {\n        if (node.left !== null) {\n          node = node.left\n        } else {\n          node.left = new TstNode(key, value, index)\n          break\n        }\n      } else if (node.right !== null) {\n        node = node.right\n      } else {\n        node.right = new TstNode(key, value, index)\n        break\n      }\n    }\n  }\n\n  /**\n   * @param {Uint8Array} key\n   * @return {TstNode | null}\n   */\n  search (key) {\n    const keylength = key.length\n    let index = 0\n    let node = this\n    while (node !== null && index < keylength) {\n      let code = key[index]\n      // A-Z\n      // First check if it is bigger than 0x5a.\n      // Lowercase letters have higher char codes than uppercase ones.\n      // Also we assume that headers will mostly contain lowercase characters.\n      if (code <= 0x5a && code >= 0x41) {\n        // Lowercase for uppercase.\n        code |= 32\n      }\n      while (node !== null) {\n        if (code === node.code) {\n          if (keylength === ++index) {\n            // Returns Node since it is the last key.\n            return node\n          }\n          node = node.middle\n          break\n        }\n        node = node.code < code ? node.left : node.right\n      }\n    }\n    return null\n  }\n}\n\nclass TernarySearchTree {\n  /** @type {TstNode | null} */\n  node = null\n\n  /**\n   * @param {string} key\n   * @param {any} value\n   * */\n  insert (key, value) {\n    if (this.node === null) {\n      this.node = new TstNode(key, value, 0)\n    } else {\n      this.node.add(key, value)\n    }\n  }\n\n  /**\n   * @param {Uint8Array} key\n   * @return {any}\n   */\n  lookup (key) {\n    return this.node?.search(key)?.value ?? null\n  }\n}\n\nconst tree = new TernarySearchTree()\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n  const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]\n  tree.insert(key, key)\n}\n\nmodule.exports = {\n  TernarySearchTree,\n  tree\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')\nconst { IncomingMessage } = require('node:http')\nconst stream = require('node:stream')\nconst net = require('node:net')\nconst { Blob } = require('node:buffer')\nconst nodeUtil = require('node:util')\nconst { stringify } = require('node:querystring')\nconst { EventEmitter: EE } = require('node:events')\nconst { InvalidArgumentError } = require('./errors')\nconst { headerNameLowerCasedRecord } = require('./constants')\nconst { tree } = require('./tree')\n\nconst [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))\n\nclass BodyAsyncIterable {\n  constructor (body) {\n    this[kBody] = body\n    this[kBodyUsed] = false\n  }\n\n  async * [Symbol.asyncIterator] () {\n    assert(!this[kBodyUsed], 'disturbed')\n    this[kBodyUsed] = true\n    yield * this[kBody]\n  }\n}\n\nfunction wrapRequestBody (body) {\n  if (isStream(body)) {\n    // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n    // so that it can be dispatched again?\n    // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n    if (bodyLength(body) === 0) {\n      body\n        .on('data', function () {\n          assert(false)\n        })\n    }\n\n    if (typeof body.readableDidRead !== 'boolean') {\n      body[kBodyUsed] = false\n      EE.prototype.on.call(body, 'data', function () {\n        this[kBodyUsed] = true\n      })\n    }\n\n    return body\n  } else if (body && typeof body.pipeTo === 'function') {\n    // TODO (fix): We can't access ReadableStream internal state\n    // to determine whether or not it has been disturbed. This is just\n    // a workaround.\n    return new BodyAsyncIterable(body)\n  } else if (\n    body &&\n    typeof body !== 'string' &&\n    !ArrayBuffer.isView(body) &&\n    isIterable(body)\n  ) {\n    // TODO: Should we allow re-using iterable if !this.opts.idempotent\n    // or through some other flag?\n    return new BodyAsyncIterable(body)\n  } else {\n    return body\n  }\n}\n\nfunction nop () {}\n\nfunction isStream (obj) {\n  return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'\n}\n\n// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)\nfunction isBlobLike (object) {\n  if (object === null) {\n    return false\n  } else if (object instanceof Blob) {\n    return true\n  } else if (typeof object !== 'object') {\n    return false\n  } else {\n    const sTag = object[Symbol.toStringTag]\n\n    return (sTag === 'Blob' || sTag === 'File') && (\n      ('stream' in object && typeof object.stream === 'function') ||\n      ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')\n    )\n  }\n}\n\nfunction buildURL (url, queryParams) {\n  if (url.includes('?') || url.includes('#')) {\n    throw new Error('Query params cannot be passed when url already contains \"?\" or \"#\".')\n  }\n\n  const stringified = stringify(queryParams)\n\n  if (stringified) {\n    url += '?' + stringified\n  }\n\n  return url\n}\n\nfunction isValidPort (port) {\n  const value = parseInt(port, 10)\n  return (\n    value === Number(port) &&\n    value >= 0 &&\n    value <= 65535\n  )\n}\n\nfunction isHttpOrHttpsPrefixed (value) {\n  return (\n    value != null &&\n    value[0] === 'h' &&\n    value[1] === 't' &&\n    value[2] === 't' &&\n    value[3] === 'p' &&\n    (\n      value[4] === ':' ||\n      (\n        value[4] === 's' &&\n        value[5] === ':'\n      )\n    )\n  )\n}\n\nfunction parseURL (url) {\n  if (typeof url === 'string') {\n    url = new URL(url)\n\n    if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n      throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n    }\n\n    return url\n  }\n\n  if (!url || typeof url !== 'object') {\n    throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')\n  }\n\n  if (!(url instanceof URL)) {\n    if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {\n      throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')\n    }\n\n    if (url.path != null && typeof url.path !== 'string') {\n      throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')\n    }\n\n    if (url.pathname != null && typeof url.pathname !== 'string') {\n      throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')\n    }\n\n    if (url.hostname != null && typeof url.hostname !== 'string') {\n      throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')\n    }\n\n    if (url.origin != null && typeof url.origin !== 'string') {\n      throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')\n    }\n\n    if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n      throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n    }\n\n    const port = url.port != null\n      ? url.port\n      : (url.protocol === 'https:' ? 443 : 80)\n    let origin = url.origin != null\n      ? url.origin\n      : `${url.protocol || ''}//${url.hostname || ''}:${port}`\n    let path = url.path != null\n      ? url.path\n      : `${url.pathname || ''}${url.search || ''}`\n\n    if (origin[origin.length - 1] === '/') {\n      origin = origin.slice(0, origin.length - 1)\n    }\n\n    if (path && path[0] !== '/') {\n      path = `/${path}`\n    }\n    // new URL(path, origin) is unsafe when `path` contains an absolute URL\n    // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:\n    // If first parameter is a relative URL, second param is required, and will be used as the base URL.\n    // If first parameter is an absolute URL, a given second param will be ignored.\n    return new URL(`${origin}${path}`)\n  }\n\n  if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n    throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n  }\n\n  return url\n}\n\nfunction parseOrigin (url) {\n  url = parseURL(url)\n\n  if (url.pathname !== '/' || url.search || url.hash) {\n    throw new InvalidArgumentError('invalid url')\n  }\n\n  return url\n}\n\nfunction getHostname (host) {\n  if (host[0] === '[') {\n    const idx = host.indexOf(']')\n\n    assert(idx !== -1)\n    return host.substring(1, idx)\n  }\n\n  const idx = host.indexOf(':')\n  if (idx === -1) return host\n\n  return host.substring(0, idx)\n}\n\n// IP addresses are not valid server names per RFC6066\n// > Currently, the only server names supported are DNS hostnames\nfunction getServerName (host) {\n  if (!host) {\n    return null\n  }\n\n  assert(typeof host === 'string')\n\n  const servername = getHostname(host)\n  if (net.isIP(servername)) {\n    return ''\n  }\n\n  return servername\n}\n\nfunction deepClone (obj) {\n  return JSON.parse(JSON.stringify(obj))\n}\n\nfunction isAsyncIterable (obj) {\n  return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')\n}\n\nfunction isIterable (obj) {\n  return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))\n}\n\nfunction bodyLength (body) {\n  if (body == null) {\n    return 0\n  } else if (isStream(body)) {\n    const state = body._readableState\n    return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)\n      ? state.length\n      : null\n  } else if (isBlobLike(body)) {\n    return body.size != null ? body.size : null\n  } else if (isBuffer(body)) {\n    return body.byteLength\n  }\n\n  return null\n}\n\nfunction isDestroyed (body) {\n  return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))\n}\n\nfunction destroy (stream, err) {\n  if (stream == null || !isStream(stream) || isDestroyed(stream)) {\n    return\n  }\n\n  if (typeof stream.destroy === 'function') {\n    if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {\n      // See: https://github.com/nodejs/node/pull/38505/files\n      stream.socket = null\n    }\n\n    stream.destroy(err)\n  } else if (err) {\n    queueMicrotask(() => {\n      stream.emit('error', err)\n    })\n  }\n\n  if (stream.destroyed !== true) {\n    stream[kDestroyed] = true\n  }\n}\n\nconst KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/\nfunction parseKeepAliveTimeout (val) {\n  const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)\n  return m ? parseInt(m[1], 10) * 1000 : null\n}\n\n/**\n * Retrieves a header name and returns its lowercase value.\n * @param {string | Buffer} value Header name\n * @returns {string}\n */\nfunction headerNameToString (value) {\n  return typeof value === 'string'\n    ? headerNameLowerCasedRecord[value] ?? value.toLowerCase()\n    : tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * Receive the buffer as a string and return its lowercase value.\n * @param {Buffer} value Header name\n * @returns {string}\n */\nfunction bufferToLowerCasedHeaderName (value) {\n  return tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers\n * @param {Record} [obj]\n * @returns {Record}\n */\nfunction parseHeaders (headers, obj) {\n  if (obj === undefined) obj = {}\n  for (let i = 0; i < headers.length; i += 2) {\n    const key = headerNameToString(headers[i])\n    let val = obj[key]\n\n    if (val) {\n      if (typeof val === 'string') {\n        val = [val]\n        obj[key] = val\n      }\n      val.push(headers[i + 1].toString('utf8'))\n    } else {\n      const headersValue = headers[i + 1]\n      if (typeof headersValue === 'string') {\n        obj[key] = headersValue\n      } else {\n        obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')\n      }\n    }\n  }\n\n  // See https://github.com/nodejs/node/pull/46528\n  if ('content-length' in obj && 'content-disposition' in obj) {\n    obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')\n  }\n\n  return obj\n}\n\nfunction parseRawHeaders (headers) {\n  const len = headers.length\n  const ret = new Array(len)\n\n  let hasContentLength = false\n  let contentDispositionIdx = -1\n  let key\n  let val\n  let kLen = 0\n\n  for (let n = 0; n < headers.length; n += 2) {\n    key = headers[n]\n    val = headers[n + 1]\n\n    typeof key !== 'string' && (key = key.toString())\n    typeof val !== 'string' && (val = val.toString('utf8'))\n\n    kLen = key.length\n    if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {\n      hasContentLength = true\n    } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {\n      contentDispositionIdx = n + 1\n    }\n    ret[n] = key\n    ret[n + 1] = val\n  }\n\n  // See https://github.com/nodejs/node/pull/46528\n  if (hasContentLength && contentDispositionIdx !== -1) {\n    ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')\n  }\n\n  return ret\n}\n\nfunction isBuffer (buffer) {\n  // See, https://github.com/mcollina/undici/pull/319\n  return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)\n}\n\nfunction validateHandler (handler, method, upgrade) {\n  if (!handler || typeof handler !== 'object') {\n    throw new InvalidArgumentError('handler must be an object')\n  }\n\n  if (typeof handler.onConnect !== 'function') {\n    throw new InvalidArgumentError('invalid onConnect method')\n  }\n\n  if (typeof handler.onError !== 'function') {\n    throw new InvalidArgumentError('invalid onError method')\n  }\n\n  if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {\n    throw new InvalidArgumentError('invalid onBodySent method')\n  }\n\n  if (upgrade || method === 'CONNECT') {\n    if (typeof handler.onUpgrade !== 'function') {\n      throw new InvalidArgumentError('invalid onUpgrade method')\n    }\n  } else {\n    if (typeof handler.onHeaders !== 'function') {\n      throw new InvalidArgumentError('invalid onHeaders method')\n    }\n\n    if (typeof handler.onData !== 'function') {\n      throw new InvalidArgumentError('invalid onData method')\n    }\n\n    if (typeof handler.onComplete !== 'function') {\n      throw new InvalidArgumentError('invalid onComplete method')\n    }\n  }\n}\n\n// A body is disturbed if it has been read from and it cannot\n// be re-used without losing state or data.\nfunction isDisturbed (body) {\n  // TODO (fix): Why is body[kBodyUsed] needed?\n  return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))\n}\n\nfunction isErrored (body) {\n  return !!(body && stream.isErrored(body))\n}\n\nfunction isReadable (body) {\n  return !!(body && stream.isReadable(body))\n}\n\nfunction getSocketInfo (socket) {\n  return {\n    localAddress: socket.localAddress,\n    localPort: socket.localPort,\n    remoteAddress: socket.remoteAddress,\n    remotePort: socket.remotePort,\n    remoteFamily: socket.remoteFamily,\n    timeout: socket.timeout,\n    bytesWritten: socket.bytesWritten,\n    bytesRead: socket.bytesRead\n  }\n}\n\n/** @type {globalThis['ReadableStream']} */\nfunction ReadableStreamFrom (iterable) {\n  // We cannot use ReadableStream.from here because it does not return a byte stream.\n\n  let iterator\n  return new ReadableStream(\n    {\n      async start () {\n        iterator = iterable[Symbol.asyncIterator]()\n      },\n      async pull (controller) {\n        const { done, value } = await iterator.next()\n        if (done) {\n          queueMicrotask(() => {\n            controller.close()\n            controller.byobRequest?.respond(0)\n          })\n        } else {\n          const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)\n          if (buf.byteLength) {\n            controller.enqueue(new Uint8Array(buf))\n          }\n        }\n        return controller.desiredSize > 0\n      },\n      async cancel (reason) {\n        await iterator.return()\n      },\n      type: 'bytes'\n    }\n  )\n}\n\n// The chunk should be a FormData instance and contains\n// all the required methods.\nfunction isFormDataLike (object) {\n  return (\n    object &&\n    typeof object === 'object' &&\n    typeof object.append === 'function' &&\n    typeof object.delete === 'function' &&\n    typeof object.get === 'function' &&\n    typeof object.getAll === 'function' &&\n    typeof object.has === 'function' &&\n    typeof object.set === 'function' &&\n    object[Symbol.toStringTag] === 'FormData'\n  )\n}\n\nfunction addAbortListener (signal, listener) {\n  if ('addEventListener' in signal) {\n    signal.addEventListener('abort', listener, { once: true })\n    return () => signal.removeEventListener('abort', listener)\n  }\n  signal.addListener('abort', listener)\n  return () => signal.removeListener('abort', listener)\n}\n\nconst hasToWellFormed = typeof String.prototype.toWellFormed === 'function'\nconst hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'\n\n/**\n * @param {string} val\n */\nfunction toUSVString (val) {\n  return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)\n}\n\n/**\n * @param {string} val\n */\n// TODO: move this to webidl\nfunction isUSVString (val) {\n  return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`\n}\n\n/**\n * @see https://tools.ietf.org/html/rfc7230#section-3.2.6\n * @param {number} c\n */\nfunction isTokenCharCode (c) {\n  switch (c) {\n    case 0x22:\n    case 0x28:\n    case 0x29:\n    case 0x2c:\n    case 0x2f:\n    case 0x3a:\n    case 0x3b:\n    case 0x3c:\n    case 0x3d:\n    case 0x3e:\n    case 0x3f:\n    case 0x40:\n    case 0x5b:\n    case 0x5c:\n    case 0x5d:\n    case 0x7b:\n    case 0x7d:\n      // DQUOTE and \"(),/:;<=>?@[\\]{}\"\n      return false\n    default:\n      // VCHAR %x21-7E\n      return c >= 0x21 && c <= 0x7e\n  }\n}\n\n/**\n * @param {string} characters\n */\nfunction isValidHTTPToken (characters) {\n  if (characters.length === 0) {\n    return false\n  }\n  for (let i = 0; i < characters.length; ++i) {\n    if (!isTokenCharCode(characters.charCodeAt(i))) {\n      return false\n    }\n  }\n  return true\n}\n\n// headerCharRegex have been lifted from\n// https://github.com/nodejs/node/blob/main/lib/_http_common.js\n\n/**\n * Matches if val contains an invalid field-vchar\n *  field-value    = *( field-content / obs-fold )\n *  field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n *  field-vchar    = VCHAR / obs-text\n */\nconst headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/\n\n/**\n * @param {string} characters\n */\nfunction isValidHeaderValue (characters) {\n  return !headerCharRegex.test(characters)\n}\n\n// Parsed accordingly to RFC 9110\n// https://www.rfc-editor.org/rfc/rfc9110#field.content-range\nfunction parseRangeHeader (range) {\n  if (range == null || range === '') return { start: 0, end: null, size: null }\n\n  const m = range ? range.match(/^bytes (\\d+)-(\\d+)\\/(\\d+)?$/) : null\n  return m\n    ? {\n        start: parseInt(m[1]),\n        end: m[2] ? parseInt(m[2]) : null,\n        size: m[3] ? parseInt(m[3]) : null\n      }\n    : null\n}\n\nfunction addListener (obj, name, listener) {\n  const listeners = (obj[kListeners] ??= [])\n  listeners.push([name, listener])\n  obj.on(name, listener)\n  return obj\n}\n\nfunction removeAllListeners (obj) {\n  for (const [name, listener] of obj[kListeners] ?? []) {\n    obj.removeListener(name, listener)\n  }\n  obj[kListeners] = null\n}\n\nfunction errorRequest (client, request, err) {\n  try {\n    request.onError(err)\n    assert(request.aborted)\n  } catch (err) {\n    client.emit('error', err)\n  }\n}\n\nconst kEnumerableProperty = Object.create(null)\nkEnumerableProperty.enumerable = true\n\nconst normalizedMethodRecordsBase = {\n  delete: 'DELETE',\n  DELETE: 'DELETE',\n  get: 'GET',\n  GET: 'GET',\n  head: 'HEAD',\n  HEAD: 'HEAD',\n  options: 'OPTIONS',\n  OPTIONS: 'OPTIONS',\n  post: 'POST',\n  POST: 'POST',\n  put: 'PUT',\n  PUT: 'PUT'\n}\n\nconst normalizedMethodRecords = {\n  ...normalizedMethodRecordsBase,\n  patch: 'patch',\n  PATCH: 'PATCH'\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(normalizedMethodRecordsBase, null)\nObject.setPrototypeOf(normalizedMethodRecords, null)\n\nmodule.exports = {\n  kEnumerableProperty,\n  nop,\n  isDisturbed,\n  isErrored,\n  isReadable,\n  toUSVString,\n  isUSVString,\n  isBlobLike,\n  parseOrigin,\n  parseURL,\n  getServerName,\n  isStream,\n  isIterable,\n  isAsyncIterable,\n  isDestroyed,\n  headerNameToString,\n  bufferToLowerCasedHeaderName,\n  addListener,\n  removeAllListeners,\n  errorRequest,\n  parseRawHeaders,\n  parseHeaders,\n  parseKeepAliveTimeout,\n  destroy,\n  bodyLength,\n  deepClone,\n  ReadableStreamFrom,\n  isBuffer,\n  validateHandler,\n  getSocketInfo,\n  isFormDataLike,\n  buildURL,\n  addAbortListener,\n  isValidHTTPToken,\n  isValidHeaderValue,\n  isTokenCharCode,\n  parseRangeHeader,\n  normalizedMethodRecordsBase,\n  normalizedMethodRecords,\n  isValidPort,\n  isHttpOrHttpsPrefixed,\n  nodeMajor,\n  nodeMinor,\n  safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],\n  wrapRequestBody\n}\n","'use strict'\n\nconst { InvalidArgumentError } = require('../core/errors')\nconst { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst DispatcherBase = require('./dispatcher-base')\nconst Pool = require('./pool')\nconst Client = require('./client')\nconst util = require('../core/util')\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor')\n\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kMaxRedirections = Symbol('maxRedirections')\nconst kOnDrain = Symbol('onDrain')\nconst kFactory = Symbol('factory')\nconst kOptions = Symbol('options')\n\nfunction defaultFactory (origin, opts) {\n  return opts && opts.connections === 1\n    ? new Client(origin, opts)\n    : new Pool(origin, opts)\n}\n\nclass Agent extends DispatcherBase {\n  constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    super(options)\n\n    if (connect && typeof connect !== 'function') {\n      connect = { ...connect }\n    }\n\n    this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)\n      ? options.interceptors.Agent\n      : [createRedirectInterceptor({ maxRedirections })]\n\n    this[kOptions] = { ...util.deepClone(options), connect }\n    this[kOptions].interceptors = options.interceptors\n      ? { ...options.interceptors }\n      : undefined\n    this[kMaxRedirections] = maxRedirections\n    this[kFactory] = factory\n    this[kClients] = new Map()\n\n    this[kOnDrain] = (origin, targets) => {\n      this.emit('drain', origin, [this, ...targets])\n    }\n\n    this[kOnConnect] = (origin, targets) => {\n      this.emit('connect', origin, [this, ...targets])\n    }\n\n    this[kOnDisconnect] = (origin, targets, err) => {\n      this.emit('disconnect', origin, [this, ...targets], err)\n    }\n\n    this[kOnConnectionError] = (origin, targets, err) => {\n      this.emit('connectionError', origin, [this, ...targets], err)\n    }\n  }\n\n  get [kRunning] () {\n    let ret = 0\n    for (const client of this[kClients].values()) {\n      ret += client[kRunning]\n    }\n    return ret\n  }\n\n  [kDispatch] (opts, handler) {\n    let key\n    if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {\n      key = String(opts.origin)\n    } else {\n      throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')\n    }\n\n    let dispatcher = this[kClients].get(key)\n\n    if (!dispatcher) {\n      dispatcher = this[kFactory](opts.origin, this[kOptions])\n        .on('drain', this[kOnDrain])\n        .on('connect', this[kOnConnect])\n        .on('disconnect', this[kOnDisconnect])\n        .on('connectionError', this[kOnConnectionError])\n\n      // This introduces a tiny memory leak, as dispatchers are never removed from the map.\n      // TODO(mcollina): remove te timer when the client/pool do not have any more\n      // active connections.\n      this[kClients].set(key, dispatcher)\n    }\n\n    return dispatcher.dispatch(opts, handler)\n  }\n\n  async [kClose] () {\n    const closePromises = []\n    for (const client of this[kClients].values()) {\n      closePromises.push(client.close())\n    }\n    this[kClients].clear()\n\n    await Promise.all(closePromises)\n  }\n\n  async [kDestroy] (err) {\n    const destroyPromises = []\n    for (const client of this[kClients].values()) {\n      destroyPromises.push(client.destroy(err))\n    }\n    this[kClients].clear()\n\n    await Promise.all(destroyPromises)\n  }\n}\n\nmodule.exports = Agent\n","'use strict'\n\nconst {\n  BalancedPoolMissingUpstreamError,\n  InvalidArgumentError\n} = require('../core/errors')\nconst {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kRemoveClient,\n  kGetDispatcher\n} = require('./pool-base')\nconst Pool = require('./pool')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst { parseOrigin } = require('../core/util')\nconst kFactory = Symbol('factory')\n\nconst kOptions = Symbol('options')\nconst kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')\nconst kCurrentWeight = Symbol('kCurrentWeight')\nconst kIndex = Symbol('kIndex')\nconst kWeight = Symbol('kWeight')\nconst kMaxWeightPerServer = Symbol('kMaxWeightPerServer')\nconst kErrorPenalty = Symbol('kErrorPenalty')\n\n/**\n * Calculate the greatest common divisor of two numbers by\n * using the Euclidean algorithm.\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction getGreatestCommonDivisor (a, b) {\n  if (a === 0) return b\n\n  while (b !== 0) {\n    const t = b\n    b = a % b\n    a = t\n  }\n  return a\n}\n\nfunction defaultFactory (origin, opts) {\n  return new Pool(origin, opts)\n}\n\nclass BalancedPool extends PoolBase {\n  constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {\n    super()\n\n    this[kOptions] = opts\n    this[kIndex] = -1\n    this[kCurrentWeight] = 0\n\n    this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100\n    this[kErrorPenalty] = this[kOptions].errorPenalty || 15\n\n    if (!Array.isArray(upstreams)) {\n      upstreams = [upstreams]\n    }\n\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)\n      ? opts.interceptors.BalancedPool\n      : []\n    this[kFactory] = factory\n\n    for (const upstream of upstreams) {\n      this.addUpstream(upstream)\n    }\n    this._updateBalancedPoolStats()\n  }\n\n  addUpstream (upstream) {\n    const upstreamOrigin = parseOrigin(upstream).origin\n\n    if (this[kClients].find((pool) => (\n      pool[kUrl].origin === upstreamOrigin &&\n      pool.closed !== true &&\n      pool.destroyed !== true\n    ))) {\n      return this\n    }\n    const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))\n\n    this[kAddClient](pool)\n    pool.on('connect', () => {\n      pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])\n    })\n\n    pool.on('connectionError', () => {\n      pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n      this._updateBalancedPoolStats()\n    })\n\n    pool.on('disconnect', (...args) => {\n      const err = args[2]\n      if (err && err.code === 'UND_ERR_SOCKET') {\n        // decrease the weight of the pool.\n        pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n        this._updateBalancedPoolStats()\n      }\n    })\n\n    for (const client of this[kClients]) {\n      client[kWeight] = this[kMaxWeightPerServer]\n    }\n\n    this._updateBalancedPoolStats()\n\n    return this\n  }\n\n  _updateBalancedPoolStats () {\n    let result = 0\n    for (let i = 0; i < this[kClients].length; i++) {\n      result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)\n    }\n\n    this[kGreatestCommonDivisor] = result\n  }\n\n  removeUpstream (upstream) {\n    const upstreamOrigin = parseOrigin(upstream).origin\n\n    const pool = this[kClients].find((pool) => (\n      pool[kUrl].origin === upstreamOrigin &&\n      pool.closed !== true &&\n      pool.destroyed !== true\n    ))\n\n    if (pool) {\n      this[kRemoveClient](pool)\n    }\n\n    return this\n  }\n\n  get upstreams () {\n    return this[kClients]\n      .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)\n      .map((p) => p[kUrl].origin)\n  }\n\n  [kGetDispatcher] () {\n    // We validate that pools is greater than 0,\n    // otherwise we would have to wait until an upstream\n    // is added, which might never happen.\n    if (this[kClients].length === 0) {\n      throw new BalancedPoolMissingUpstreamError()\n    }\n\n    const dispatcher = this[kClients].find(dispatcher => (\n      !dispatcher[kNeedDrain] &&\n      dispatcher.closed !== true &&\n      dispatcher.destroyed !== true\n    ))\n\n    if (!dispatcher) {\n      return\n    }\n\n    const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)\n\n    if (allClientsBusy) {\n      return\n    }\n\n    let counter = 0\n\n    let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])\n\n    while (counter++ < this[kClients].length) {\n      this[kIndex] = (this[kIndex] + 1) % this[kClients].length\n      const pool = this[kClients][this[kIndex]]\n\n      // find pool index with the largest weight\n      if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {\n        maxWeightIndex = this[kIndex]\n      }\n\n      // decrease the current weight every `this[kClients].length`.\n      if (this[kIndex] === 0) {\n        // Set the current weight to the next lower weight.\n        this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]\n\n        if (this[kCurrentWeight] <= 0) {\n          this[kCurrentWeight] = this[kMaxWeightPerServer]\n        }\n      }\n      if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {\n        return pool\n      }\n    }\n\n    this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]\n    this[kIndex] = maxWeightIndex\n    return this[kClients][maxWeightIndex]\n  }\n}\n\nmodule.exports = BalancedPool\n","'use strict'\n\n/* global WebAssembly */\n\nconst assert = require('node:assert')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst timers = require('../util/timers.js')\nconst {\n  RequestContentLengthMismatchError,\n  ResponseContentLengthMismatchError,\n  RequestAbortedError,\n  HeadersTimeoutError,\n  HeadersOverflowError,\n  SocketError,\n  InformationalError,\n  BodyTimeoutError,\n  HTTPParserError,\n  ResponseExceededMaxSizeError\n} = require('../core/errors.js')\nconst {\n  kUrl,\n  kReset,\n  kClient,\n  kParser,\n  kBlocking,\n  kRunning,\n  kPending,\n  kSize,\n  kWriting,\n  kQueue,\n  kNoRef,\n  kKeepAliveDefaultTimeout,\n  kHostHeader,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kPipelining,\n  kSocket,\n  kKeepAliveTimeoutValue,\n  kMaxHeadersSize,\n  kKeepAliveMaxTimeout,\n  kKeepAliveTimeoutThreshold,\n  kHeadersTimeout,\n  kBodyTimeout,\n  kStrictContentLength,\n  kMaxRequests,\n  kCounter,\n  kMaxResponseSize,\n  kOnError,\n  kResume,\n  kHTTPContext\n} = require('../core/symbols.js')\n\nconst constants = require('../llhttp/constants.js')\nconst EMPTY_BUF = Buffer.alloc(0)\nconst FastBuffer = Buffer[Symbol.species]\nconst addListener = util.addListener\nconst removeAllListeners = util.removeAllListeners\nconst kIdleSocketValidation = Symbol('kIdleSocketValidation')\nconst kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout')\nconst kSocketUsed = Symbol('kSocketUsed')\n\nlet extractBody\n\nasync function lazyllhttp () {\n  const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined\n\n  let mod\n  try {\n    mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js'))\n  } catch (e) {\n    /* istanbul ignore next */\n\n    // We could check if the error was caused by the simd option not\n    // being enabled, but the occurring of this other error\n    // * https://github.com/emscripten-core/emscripten/issues/11495\n    // got me to remove that check to avoid breaking Node 12.\n    mod = await WebAssembly.compile(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))\n  }\n\n  return await WebAssembly.instantiate(mod, {\n    env: {\n      /* eslint-disable camelcase */\n\n      wasm_on_url: (p, at, len) => {\n        /* istanbul ignore next */\n        return 0\n      },\n      wasm_on_status: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_message_begin: (p) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onMessageBegin() || 0\n      },\n      wasm_on_header_field: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_header_value: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0\n      },\n      wasm_on_body: (p, at, len) => {\n        assert(currentParser.ptr === p)\n        const start = at - currentBufferPtr + currentBufferRef.byteOffset\n        return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n      },\n      wasm_on_message_complete: (p) => {\n        assert(currentParser.ptr === p)\n        return currentParser.onMessageComplete() || 0\n      }\n\n      /* eslint-enable camelcase */\n    }\n  })\n}\n\nlet llhttpInstance = null\nlet llhttpPromise = lazyllhttp()\nllhttpPromise.catch()\n\nlet currentParser = null\nlet currentBufferRef = null\nlet currentBufferSize = 0\nlet currentBufferPtr = null\n\nconst USE_NATIVE_TIMER = 0\nconst USE_FAST_TIMER = 1\n\n// Use fast timers for headers and body to take eventual event loop\n// latency into account.\nconst TIMEOUT_HEADERS = 2 | USE_FAST_TIMER\nconst TIMEOUT_BODY = 4 | USE_FAST_TIMER\n\n// Use native timers to ignore event loop latency for keep-alive\n// handling.\nconst TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER\n\nclass Parser {\n  constructor (client, socket, { exports }) {\n    assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)\n\n    this.llhttp = exports\n    this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)\n    this.client = client\n    this.socket = socket\n    this.timeout = null\n    this.timeoutValue = null\n    this.timeoutType = null\n    this.statusCode = null\n    this.statusText = ''\n    this.upgrade = false\n    this.headers = []\n    this.headersSize = 0\n    this.headersMaxSize = client[kMaxHeadersSize]\n    this.shouldKeepAlive = false\n    this.paused = false\n    this.resume = this.resume.bind(this)\n\n    this.bytesRead = 0\n\n    this.keepAlive = ''\n    this.contentLength = ''\n    this.connection = ''\n    this.maxResponseSize = client[kMaxResponseSize]\n  }\n\n  setTimeout (delay, type) {\n    // If the existing timer and the new timer are of different timer type\n    // (fast or native) or have different delay, we need to clear the existing\n    // timer and set a new one.\n    if (\n      delay !== this.timeoutValue ||\n      (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)\n    ) {\n      // If a timeout is already set, clear it with clearTimeout of the fast\n      // timer implementation, as it can clear fast and native timers.\n      if (this.timeout) {\n        timers.clearTimeout(this.timeout)\n        this.timeout = null\n      }\n\n      if (delay) {\n        if (type & USE_FAST_TIMER) {\n          this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this))\n        } else {\n          this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this))\n          this.timeout.unref()\n        }\n      }\n\n      this.timeoutValue = delay\n    } else if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    this.timeoutType = type\n  }\n\n  resume () {\n    if (this.socket.destroyed || !this.paused) {\n      return\n    }\n\n    assert(this.ptr != null)\n    assert(currentParser == null)\n\n    this.llhttp.llhttp_resume(this.ptr)\n\n    assert(this.timeoutType === TIMEOUT_BODY)\n    if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    this.paused = false\n    this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.\n    this.readMore()\n  }\n\n  readMore () {\n    while (!this.paused && this.ptr) {\n      const chunk = this.socket.read()\n      if (chunk === null) {\n        break\n      }\n      this.execute(chunk)\n    }\n  }\n\n  execute (data) {\n    assert(this.ptr != null)\n    assert(currentParser == null)\n    assert(!this.paused)\n\n    const { socket, llhttp } = this\n\n    if (data.length > currentBufferSize) {\n      if (currentBufferPtr) {\n        llhttp.free(currentBufferPtr)\n      }\n      currentBufferSize = Math.ceil(data.length / 4096) * 4096\n      currentBufferPtr = llhttp.malloc(currentBufferSize)\n    }\n\n    new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)\n\n    // Call `execute` on the wasm parser.\n    // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,\n    // and finally the length of bytes to parse.\n    // The return value is an error code or `constants.ERROR.OK`.\n    try {\n      let ret\n\n      try {\n        currentBufferRef = data\n        currentParser = this\n        ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)\n        /* eslint-disable-next-line no-useless-catch */\n      } catch (err) {\n        /* istanbul ignore next: difficult to make a test case for */\n        throw err\n      } finally {\n        currentParser = null\n        currentBufferRef = null\n      }\n\n      const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr\n\n      if (ret !== constants.ERROR.OK) {\n        const body = data.subarray(offset)\n\n        if (ret === constants.ERROR.PAUSED_UPGRADE) {\n          this.onUpgrade(body)\n        } else if (ret === constants.ERROR.PAUSED) {\n          this.paused = true\n          socket.unshift(body)\n        } else {\n          throw this.createError(ret, body)\n        }\n      }\n    } catch (err) {\n      util.destroy(socket, err)\n    }\n  }\n\n  finish () {\n    assert(currentParser === null)\n    assert(this.ptr != null)\n    assert(!this.paused)\n\n    const { llhttp } = this\n\n    let ret\n\n    try {\n      currentParser = this\n      ret = llhttp.llhttp_finish(this.ptr)\n    } finally {\n      currentParser = null\n    }\n\n    if (ret === constants.ERROR.OK) {\n      return null\n    }\n\n    if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {\n      this.paused = true\n      return null\n    }\n\n    return this.createError(ret, EMPTY_BUF)\n  }\n\n  createError (ret, data) {\n    const { llhttp, contentLength, bytesRead } = this\n\n    if (contentLength && bytesRead !== parseInt(contentLength, 10)) {\n      return new ResponseContentLengthMismatchError()\n    }\n\n    const ptr = llhttp.llhttp_get_error_reason(this.ptr)\n    let message = ''\n    if (ptr) {\n      const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)\n      message =\n        'Response does not match the HTTP/1.1 protocol (' +\n        Buffer.from(llhttp.memory.buffer, ptr, len).toString() +\n        ')'\n    }\n\n    return new HTTPParserError(message, constants.ERROR[ret], data)\n  }\n\n  destroy () {\n    assert(this.ptr != null)\n    assert(currentParser == null)\n\n    this.llhttp.llhttp_free(this.ptr)\n    this.ptr = null\n\n    this.timeout && timers.clearTimeout(this.timeout)\n    this.timeout = null\n    this.timeoutValue = null\n    this.timeoutType = null\n\n    this.paused = false\n  }\n\n  onStatus (buf) {\n    this.statusText = buf.toString()\n  }\n\n  onMessageBegin () {\n    const { socket, client } = this\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (socket.destroyed) {\n      return -1\n    }\n\n    if (client[kRunning] === 0) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n    if (!request) {\n      return -1\n    }\n    request.onResponseStarted()\n  }\n\n  onHeaderField (buf) {\n    const len = this.headers.length\n\n    if ((len & 1) === 0) {\n      this.headers.push(buf)\n    } else {\n      this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n    }\n\n    this.trackHeader(buf.length)\n  }\n\n  onHeaderValue (buf) {\n    let len = this.headers.length\n\n    if ((len & 1) === 1) {\n      this.headers.push(buf)\n      len += 1\n    } else {\n      this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n    }\n\n    const key = this.headers[len - 2]\n    if (key.length === 10) {\n      const headerName = util.bufferToLowerCasedHeaderName(key)\n      if (headerName === 'keep-alive') {\n        this.keepAlive += buf.toString()\n      } else if (headerName === 'connection') {\n        this.connection += buf.toString()\n      }\n    } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {\n      this.contentLength += buf.toString()\n    }\n\n    this.trackHeader(buf.length)\n  }\n\n  trackHeader (len) {\n    this.headersSize += len\n    if (this.headersSize >= this.headersMaxSize) {\n      util.destroy(this.socket, new HeadersOverflowError())\n    }\n  }\n\n  onUpgrade (head) {\n    const { upgrade, client, socket, headers, statusCode } = this\n\n    assert(upgrade)\n    assert(client[kSocket] === socket)\n    assert(!socket.destroyed)\n    assert(!this.paused)\n    assert((headers.length & 1) === 0)\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n    assert(request.upgrade || request.method === 'CONNECT')\n\n    this.statusCode = null\n    this.statusText = ''\n    this.shouldKeepAlive = null\n\n    this.headers = []\n    this.headersSize = 0\n\n    socket.unshift(head)\n\n    socket[kParser].destroy()\n    socket[kParser] = null\n\n    socket[kClient] = null\n    socket[kError] = null\n\n    removeAllListeners(socket)\n\n    client[kSocket] = null\n    client[kHTTPContext] = null // TODO (fix): This is hacky...\n    client[kQueue][client[kRunningIdx]++] = null\n    client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))\n\n    try {\n      request.onUpgrade(statusCode, headers, socket)\n    } catch (err) {\n      util.destroy(socket, err)\n    }\n\n    client[kResume]()\n  }\n\n  onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {\n    const { client, socket, headers, statusText } = this\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (socket.destroyed) {\n      return -1\n    }\n\n    if (client[kRunning] === 0) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n\n    /* istanbul ignore next: difficult to make a test case for */\n    if (!request) {\n      return -1\n    }\n\n    assert(!this.upgrade)\n    assert(this.statusCode < 200)\n\n    if (statusCode === 100) {\n      util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    /* this can only happen if server is misbehaving */\n    if (upgrade && !request.upgrade) {\n      util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))\n      return -1\n    }\n\n    assert(this.timeoutType === TIMEOUT_HEADERS)\n\n    this.statusCode = statusCode\n    this.shouldKeepAlive = (\n      shouldKeepAlive ||\n      // Override llhttp value which does not allow keepAlive for HEAD.\n      (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')\n    )\n\n    if (this.statusCode >= 200) {\n      const bodyTimeout = request.bodyTimeout != null\n        ? request.bodyTimeout\n        : client[kBodyTimeout]\n      this.setTimeout(bodyTimeout, TIMEOUT_BODY)\n    } else if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    if (request.method === 'CONNECT') {\n      assert(client[kRunning] === 1)\n      this.upgrade = true\n      return 2\n    }\n\n    if (upgrade) {\n      assert(client[kRunning] === 1)\n      this.upgrade = true\n      return 2\n    }\n\n    assert((this.headers.length & 1) === 0)\n    this.headers = []\n    this.headersSize = 0\n\n    if (this.shouldKeepAlive && client[kPipelining]) {\n      const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null\n\n      if (keepAliveTimeout != null) {\n        const timeout = Math.min(\n          keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n          client[kKeepAliveMaxTimeout]\n        )\n        if (timeout <= 0) {\n          socket[kReset] = true\n        } else {\n          client[kKeepAliveTimeoutValue] = timeout\n        }\n      } else {\n        client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]\n      }\n    } else {\n      // Stop more requests from being dispatched.\n      socket[kReset] = true\n    }\n\n    const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false\n\n    if (request.aborted) {\n      return -1\n    }\n\n    if (request.method === 'HEAD') {\n      return 1\n    }\n\n    if (statusCode < 200) {\n      return 1\n    }\n\n    if (socket[kBlocking]) {\n      socket[kBlocking] = false\n      client[kResume]()\n    }\n\n    return pause ? constants.ERROR.PAUSED : 0\n  }\n\n  onBody (buf) {\n    const { client, socket, statusCode, maxResponseSize } = this\n\n    if (socket.destroyed) {\n      return -1\n    }\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n\n    assert(this.timeoutType === TIMEOUT_BODY)\n    if (this.timeout) {\n      // istanbul ignore else: only for jest\n      if (this.timeout.refresh) {\n        this.timeout.refresh()\n      }\n    }\n\n    assert(statusCode >= 200)\n\n    if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n      util.destroy(socket, new ResponseExceededMaxSizeError())\n      return -1\n    }\n\n    this.bytesRead += buf.length\n\n    if (request.onData(buf) === false) {\n      return constants.ERROR.PAUSED\n    }\n  }\n\n  onMessageComplete () {\n    const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this\n\n    if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n      return -1\n    }\n\n    if (upgrade) {\n      return\n    }\n\n    assert(statusCode >= 100)\n    assert((this.headers.length & 1) === 0)\n\n    const request = client[kQueue][client[kRunningIdx]]\n    assert(request)\n\n    this.statusCode = null\n    this.statusText = ''\n    this.bytesRead = 0\n    this.contentLength = ''\n    this.keepAlive = ''\n    this.connection = ''\n\n    this.headers = []\n    this.headersSize = 0\n\n    if (statusCode < 200) {\n      return\n    }\n\n    /* istanbul ignore next: should be handled by llhttp? */\n    if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n      util.destroy(socket, new ResponseContentLengthMismatchError())\n      return -1\n    }\n\n    request.onComplete(headers)\n\n    client[kQueue][client[kRunningIdx]++] = null\n    socket[kSocketUsed] = true\n\n    if (socket[kWriting]) {\n      assert(client[kRunning] === 0)\n      // Response completed before request.\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (!shouldKeepAlive) {\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (socket[kReset] && client[kRunning] === 0) {\n      // Destroy socket once all requests have completed.\n      // The request at the tail of the pipeline is the one\n      // that requested reset and no further requests should\n      // have been queued since then.\n      util.destroy(socket, new InformationalError('reset'))\n      return constants.ERROR.PAUSED\n    } else if (client[kPipelining] == null || client[kPipelining] === 1) {\n      // We must wait a full event loop cycle to reuse this socket to make sure\n      // that non-spec compliant servers are not closing the connection even if they\n      // said they won't.\n      setImmediate(() => client[kResume]())\n    } else {\n      client[kResume]()\n    }\n  }\n}\n\nfunction onParserTimeout (parser) {\n  const { socket, timeoutType, client, paused } = parser.deref()\n\n  /* istanbul ignore else */\n  if (timeoutType === TIMEOUT_HEADERS) {\n    if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n      assert(!paused, 'cannot be paused while waiting for headers')\n      util.destroy(socket, new HeadersTimeoutError())\n    }\n  } else if (timeoutType === TIMEOUT_BODY) {\n    if (!paused) {\n      util.destroy(socket, new BodyTimeoutError())\n    }\n  } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {\n    assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])\n    util.destroy(socket, new InformationalError('socket idle timeout'))\n  }\n}\n\nasync function connectH1 (client, socket) {\n  client[kSocket] = socket\n\n  if (!llhttpInstance) {\n    llhttpInstance = await llhttpPromise\n    llhttpPromise = null\n  }\n\n  socket[kNoRef] = false\n  socket[kWriting] = false\n  socket[kReset] = false\n  socket[kBlocking] = false\n  socket[kIdleSocketValidation] = 0\n  socket[kIdleSocketValidationTimeout] = null\n  socket[kSocketUsed] = false\n  socket[kParser] = new Parser(client, socket, llhttpInstance)\n\n  addListener(socket, 'error', function (err) {\n    assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n    const parser = this[kParser]\n\n    // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded\n    // to the user.\n    if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {\n      const parserErr = parser.finish()\n      if (parserErr) {\n        this[kError] = parserErr\n        this[kClient][kOnError](parserErr)\n      }\n      return\n    }\n\n    this[kError] = err\n\n    this[kClient][kOnError](err)\n  })\n  addListener(socket, 'readable', function () {\n    const parser = this[kParser]\n\n    if (parser) {\n      parser.readMore()\n    }\n  })\n  addListener(socket, 'end', function () {\n    const parser = this[kParser]\n\n    if (parser.statusCode && !parser.shouldKeepAlive) {\n      const parserErr = parser.finish()\n      if (parserErr) {\n        util.destroy(this, parserErr)\n      }\n      return\n    }\n\n    util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n  })\n  addListener(socket, 'close', function () {\n    const client = this[kClient]\n    const parser = this[kParser]\n\n    clearIdleSocketValidation(this)\n\n    if (parser) {\n      if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {\n        this[kError] = parser.finish() || this[kError]\n      }\n\n      this[kParser].destroy()\n      this[kParser] = null\n    }\n\n    const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n    client[kSocket] = null\n    client[kHTTPContext] = null // TODO (fix): This is hacky...\n\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n\n      // Fail entire queue.\n      const requests = client[kQueue].splice(client[kRunningIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(client, request, err)\n      }\n    } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {\n      // Fail head of pipeline.\n      const request = client[kQueue][client[kRunningIdx]]\n      client[kQueue][client[kRunningIdx]++] = null\n\n      util.errorRequest(client, request, err)\n    }\n\n    client[kPendingIdx] = client[kRunningIdx]\n\n    assert(client[kRunning] === 0)\n\n    client.emit('disconnect', client[kUrl], [client], err)\n\n    client[kResume]()\n  })\n\n  let closed = false\n  socket.on('close', () => {\n    closed = true\n  })\n\n  return {\n    version: 'h1',\n    defaultPipelining: 1,\n    write (...args) {\n      return writeH1(client, ...args)\n    },\n    resume () {\n      resumeH1(client)\n    },\n    destroy (err, callback) {\n      if (closed) {\n        queueMicrotask(callback)\n      } else {\n        socket.destroy(err).on('close', callback)\n      }\n    },\n    get destroyed () {\n      return socket.destroyed\n    },\n    busy (request) {\n      if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) {\n        return true\n      }\n\n      if (request) {\n        if (client[kRunning] > 0 && !request.idempotent) {\n          // Non-idempotent request cannot be retried.\n          // Ensure that no other requests are inflight and\n          // could cause failure.\n          return true\n        }\n\n        if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {\n          // Don't dispatch an upgrade until all preceding requests have completed.\n          // A misbehaving server might upgrade the connection before all pipelined\n          // request has completed.\n          return true\n        }\n\n        if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&\n          (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {\n          // Request with stream or iterator body can error while other requests\n          // are inflight and indirectly error those as well.\n          // Ensure this doesn't happen by waiting for inflight\n          // to complete before dispatching.\n\n          // Request with stream or iterator body cannot be retried.\n          // Ensure that no other requests are inflight and\n          // could cause failure.\n          return true\n        }\n      }\n\n      return false\n    }\n  }\n}\n\nfunction clearIdleSocketValidation (socket) {\n  if (socket[kIdleSocketValidationTimeout]) {\n    clearTimeout(socket[kIdleSocketValidationTimeout])\n    socket[kIdleSocketValidationTimeout] = null\n  }\n\n  socket[kIdleSocketValidation] = 0\n}\n\nfunction scheduleIdleSocketValidation (client, socket) {\n  socket[kIdleSocketValidation] = 1\n  socket[kIdleSocketValidationTimeout] = setTimeout(() => {\n    socket[kIdleSocketValidationTimeout] = null\n    socket[kIdleSocketValidation] = 2\n\n    if (client[kSocket] === socket && !socket.destroyed) {\n      client[kResume]()\n    }\n  }, 0)\n  socket[kIdleSocketValidationTimeout].unref?.()\n}\n\n/**\n * @param {import('./client.js')} client\n */\nfunction resumeH1 (client) {\n  const socket = client[kSocket]\n\n  if (socket && !socket.destroyed) {\n    if (client[kSize] === 0) {\n      if (!socket[kNoRef] && socket.unref) {\n        socket.unref()\n        socket[kNoRef] = true\n      }\n    } else if (socket[kNoRef] && socket.ref) {\n      socket.ref()\n      socket[kNoRef] = false\n    }\n\n    if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {\n      if (socket[kIdleSocketValidation] === 0) {\n        scheduleIdleSocketValidation(client, socket)\n        socket[kParser].readMore()\n        if (socket.destroyed) {\n          return\n        }\n        return\n      }\n\n      if (socket[kIdleSocketValidation] === 1) {\n        socket[kParser].readMore()\n        if (socket.destroyed) {\n          return\n        }\n        return\n      }\n    }\n\n    if (client[kRunning] === 0) {\n      socket[kParser].readMore()\n      if (socket.destroyed) {\n        return\n      }\n    }\n\n    if (client[kSize] === 0) {\n      if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {\n        socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)\n      }\n    } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n      if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n        const request = client[kQueue][client[kRunningIdx]]\n        const headersTimeout = request.headersTimeout != null\n          ? request.headersTimeout\n          : client[kHeadersTimeout]\n        socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)\n      }\n    }\n  }\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n  return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH1 (client, request) {\n  const { method, path, host, upgrade, blocking, reset } = request\n\n  let { body, headers, contentLength } = request\n\n  // https://tools.ietf.org/html/rfc7231#section-4.3.1\n  // https://tools.ietf.org/html/rfc7231#section-4.3.2\n  // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n  // Sending a payload body on a request that does not\n  // expect it can cause undefined behavior on some\n  // servers and corrupt connection state. Do not\n  // re-use the connection for further requests.\n\n  const expectsPayload = (\n    method === 'PUT' ||\n    method === 'POST' ||\n    method === 'PATCH' ||\n    method === 'QUERY' ||\n    method === 'PROPFIND' ||\n    method === 'PROPPATCH'\n  )\n\n  if (util.isFormDataLike(body)) {\n    if (!extractBody) {\n      extractBody = require('../web/fetch/body.js').extractBody\n    }\n\n    const [bodyStream, contentType] = extractBody(body)\n    if (request.contentType == null) {\n      headers.push('content-type', contentType)\n    }\n    body = bodyStream.stream\n    contentLength = bodyStream.length\n  } else if (util.isBlobLike(body) && request.contentType == null && body.type) {\n    headers.push('content-type', body.type)\n  }\n\n  if (body && typeof body.read === 'function') {\n    // Try to read EOF in order to get length.\n    body.read(0)\n  }\n\n  const bodyLength = util.bodyLength(body)\n\n  contentLength = bodyLength ?? contentLength\n\n  if (contentLength === null) {\n    contentLength = request.contentLength\n  }\n\n  if (contentLength === 0 && !expectsPayload) {\n    // https://tools.ietf.org/html/rfc7230#section-3.3.2\n    // A user agent SHOULD NOT send a Content-Length header field when\n    // the request message does not contain a payload body and the method\n    // semantics do not anticipate such a body.\n\n    contentLength = null\n  }\n\n  // https://github.com/nodejs/undici/issues/2046\n  // A user agent may send a Content-Length header with 0 value, this should be allowed.\n  if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {\n    if (client[kStrictContentLength]) {\n      util.errorRequest(client, request, new RequestContentLengthMismatchError())\n      return false\n    }\n\n    process.emitWarning(new RequestContentLengthMismatchError())\n  }\n\n  const socket = client[kSocket]\n  clearIdleSocketValidation(socket)\n\n  const abort = (err) => {\n    if (request.aborted || request.completed) {\n      return\n    }\n\n    util.errorRequest(client, request, err || new RequestAbortedError())\n\n    util.destroy(body)\n    util.destroy(socket, new InformationalError('aborted'))\n  }\n\n  try {\n    request.onConnect(abort)\n  } catch (err) {\n    util.errorRequest(client, request, err)\n  }\n\n  if (request.aborted) {\n    return false\n  }\n\n  if (method === 'HEAD') {\n    // https://github.com/mcollina/undici/issues/258\n    // Close after a HEAD request to interop with misbehaving servers\n    // that may send a body in the response.\n\n    socket[kReset] = true\n  }\n\n  if (upgrade || method === 'CONNECT') {\n    // On CONNECT or upgrade, block pipeline from dispatching further\n    // requests on this connection.\n\n    socket[kReset] = true\n  }\n\n  if (reset != null) {\n    socket[kReset] = reset\n  }\n\n  if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n    socket[kReset] = true\n  }\n\n  if (blocking) {\n    socket[kBlocking] = true\n  }\n\n  let header = `${method} ${path} HTTP/1.1\\r\\n`\n\n  if (typeof host === 'string') {\n    header += `host: ${host}\\r\\n`\n  } else {\n    header += client[kHostHeader]\n  }\n\n  if (upgrade) {\n    header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n  } else if (client[kPipelining] && !socket[kReset]) {\n    header += 'connection: keep-alive\\r\\n'\n  } else {\n    header += 'connection: close\\r\\n'\n  }\n\n  if (Array.isArray(headers)) {\n    for (let n = 0; n < headers.length; n += 2) {\n      const key = headers[n + 0]\n      const val = headers[n + 1]\n\n      if (Array.isArray(val)) {\n        for (let i = 0; i < val.length; i++) {\n          header += `${key}: ${val[i]}\\r\\n`\n        }\n      } else {\n        header += `${key}: ${val}\\r\\n`\n      }\n    }\n  }\n\n  if (channels.sendHeaders.hasSubscribers) {\n    channels.sendHeaders.publish({ request, headers: header, socket })\n  }\n\n  /* istanbul ignore else: assertion */\n  if (!body || bodyLength === 0) {\n    writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isBuffer(body)) {\n    writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isBlobLike(body)) {\n    if (typeof body.stream === 'function') {\n      writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)\n    } else {\n      writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)\n    }\n  } else if (util.isStream(body)) {\n    writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else if (util.isIterable(body)) {\n    writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)\n  } else {\n    assert(false)\n  }\n\n  return true\n}\n\nfunction writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n  let finished = false\n\n  const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n\n  const onData = function (chunk) {\n    if (finished) {\n      return\n    }\n\n    try {\n      if (!writer.write(chunk) && this.pause) {\n        this.pause()\n      }\n    } catch (err) {\n      util.destroy(this, err)\n    }\n  }\n  const onDrain = function () {\n    if (finished) {\n      return\n    }\n\n    if (body.resume) {\n      body.resume()\n    }\n  }\n  const onClose = function () {\n    // 'close' might be emitted *before* 'error' for\n    // broken streams. Wait a tick to avoid this case.\n    queueMicrotask(() => {\n      // It's only safe to remove 'error' listener after\n      // 'close'.\n      body.removeListener('error', onFinished)\n    })\n\n    if (!finished) {\n      const err = new RequestAbortedError()\n      queueMicrotask(() => onFinished(err))\n    }\n  }\n  const onFinished = function (err) {\n    if (finished) {\n      return\n    }\n\n    finished = true\n\n    assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))\n\n    socket\n      .off('drain', onDrain)\n      .off('error', onFinished)\n\n    body\n      .removeListener('data', onData)\n      .removeListener('end', onFinished)\n      .removeListener('close', onClose)\n\n    if (!err) {\n      try {\n        writer.end()\n      } catch (er) {\n        err = er\n      }\n    }\n\n    writer.destroy(err)\n\n    if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {\n      util.destroy(body, err)\n    } else {\n      util.destroy(body)\n    }\n  }\n\n  body\n    .on('data', onData)\n    .on('end', onFinished)\n    .on('error', onFinished)\n    .on('close', onClose)\n\n  if (body.resume) {\n    body.resume()\n  }\n\n  socket\n    .on('drain', onDrain)\n    .on('error', onFinished)\n\n  if (body.errorEmitted ?? body.errored) {\n    setImmediate(() => onFinished(body.errored))\n  } else if (body.endEmitted ?? body.readableEnded) {\n    setImmediate(() => onFinished(null))\n  }\n\n  if (body.closeEmitted ?? body.closed) {\n    setImmediate(onClose)\n  }\n}\n\nfunction writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  try {\n    if (!body) {\n      if (contentLength === 0) {\n        socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n      } else {\n        assert(contentLength === null, 'no body must not have content length')\n        socket.write(`${header}\\r\\n`, 'latin1')\n      }\n    } else if (util.isBuffer(body)) {\n      assert(contentLength === body.byteLength, 'buffer body must have content length')\n\n      socket.cork()\n      socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n      socket.write(body)\n      socket.uncork()\n      request.onBodySent(body)\n\n      if (!expectsPayload && request.reset !== false) {\n        socket[kReset] = true\n      }\n    }\n    request.onRequestSent()\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength === body.size, 'blob body must have content length')\n\n  try {\n    if (contentLength != null && contentLength !== body.size) {\n      throw new RequestContentLengthMismatchError()\n    }\n\n    const buffer = Buffer.from(await body.arrayBuffer())\n\n    socket.cork()\n    socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n    socket.write(buffer)\n    socket.uncork()\n\n    request.onBodySent(buffer)\n    request.onRequestSent()\n\n    if (!expectsPayload && request.reset !== false) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n  let callback = null\n  function onDrain () {\n    if (callback) {\n      const cb = callback\n      callback = null\n      cb()\n    }\n  }\n\n  const waitForDrain = () => new Promise((resolve, reject) => {\n    assert(callback === null)\n\n    if (socket[kError]) {\n      reject(socket[kError])\n    } else {\n      callback = resolve\n    }\n  })\n\n  socket\n    .on('close', onDrain)\n    .on('drain', onDrain)\n\n  const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n  try {\n    // It's up to the user to somehow abort the async iterable.\n    for await (const chunk of body) {\n      if (socket[kError]) {\n        throw socket[kError]\n      }\n\n      if (!writer.write(chunk)) {\n        await waitForDrain()\n      }\n    }\n\n    writer.end()\n  } catch (err) {\n    writer.destroy(err)\n  } finally {\n    socket\n      .off('close', onDrain)\n      .off('drain', onDrain)\n  }\n}\n\nclass AsyncWriter {\n  constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {\n    this.socket = socket\n    this.request = request\n    this.contentLength = contentLength\n    this.client = client\n    this.bytesWritten = 0\n    this.expectsPayload = expectsPayload\n    this.header = header\n    this.abort = abort\n\n    socket[kWriting] = true\n  }\n\n  write (chunk) {\n    const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this\n\n    if (socket[kError]) {\n      throw socket[kError]\n    }\n\n    if (socket.destroyed) {\n      return false\n    }\n\n    const len = Buffer.byteLength(chunk)\n    if (!len) {\n      return true\n    }\n\n    // We should defer writing chunks.\n    if (contentLength !== null && bytesWritten + len > contentLength) {\n      if (client[kStrictContentLength]) {\n        throw new RequestContentLengthMismatchError()\n      }\n\n      process.emitWarning(new RequestContentLengthMismatchError())\n    }\n\n    socket.cork()\n\n    if (bytesWritten === 0) {\n      if (!expectsPayload && request.reset !== false) {\n        socket[kReset] = true\n      }\n\n      if (contentLength === null) {\n        socket.write(`${header}transfer-encoding: chunked\\r\\n`, 'latin1')\n      } else {\n        socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n      }\n    }\n\n    if (contentLength === null) {\n      socket.write(`\\r\\n${len.toString(16)}\\r\\n`, 'latin1')\n    }\n\n    this.bytesWritten += len\n\n    const ret = socket.write(chunk)\n\n    socket.uncork()\n\n    request.onBodySent(chunk)\n\n    if (!ret) {\n      if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n        // istanbul ignore else: only for jest\n        if (socket[kParser].timeout.refresh) {\n          socket[kParser].timeout.refresh()\n        }\n      }\n    }\n\n    return ret\n  }\n\n  end () {\n    const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this\n    request.onRequestSent()\n\n    socket[kWriting] = false\n\n    if (socket[kError]) {\n      throw socket[kError]\n    }\n\n    if (socket.destroyed) {\n      return\n    }\n\n    if (bytesWritten === 0) {\n      if (expectsPayload) {\n        // https://tools.ietf.org/html/rfc7230#section-3.3.2\n        // A user agent SHOULD send a Content-Length in a request message when\n        // no Transfer-Encoding is sent and the request method defines a meaning\n        // for an enclosed payload body.\n\n        socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n      } else {\n        socket.write(`${header}\\r\\n`, 'latin1')\n      }\n    } else if (contentLength === null) {\n      socket.write('\\r\\n0\\r\\n\\r\\n', 'latin1')\n    }\n\n    if (contentLength !== null && bytesWritten !== contentLength) {\n      if (client[kStrictContentLength]) {\n        throw new RequestContentLengthMismatchError()\n      } else {\n        process.emitWarning(new RequestContentLengthMismatchError())\n      }\n    }\n\n    if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n      // istanbul ignore else: only for jest\n      if (socket[kParser].timeout.refresh) {\n        socket[kParser].timeout.refresh()\n      }\n    }\n\n    client[kResume]()\n  }\n\n  destroy (err) {\n    const { socket, client, abort } = this\n\n    socket[kWriting] = false\n\n    if (err) {\n      assert(client[kRunning] <= 1, 'pipeline should only contain this request')\n      abort(err)\n    }\n  }\n}\n\nmodule.exports = connectH1\n","'use strict'\n\nconst assert = require('node:assert')\nconst { pipeline } = require('node:stream')\nconst util = require('../core/util.js')\nconst {\n  RequestContentLengthMismatchError,\n  RequestAbortedError,\n  SocketError,\n  InformationalError\n} = require('../core/errors.js')\nconst {\n  kUrl,\n  kReset,\n  kClient,\n  kRunning,\n  kPending,\n  kQueue,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kSocket,\n  kStrictContentLength,\n  kOnError,\n  kMaxConcurrentStreams,\n  kHTTP2Session,\n  kResume,\n  kSize,\n  kHTTPContext\n} = require('../core/symbols.js')\n\nconst kOpenStreams = Symbol('open streams')\n\nlet extractBody\n\n// Experimental\nlet h2ExperimentalWarned = false\n\n/** @type {import('http2')} */\nlet http2\ntry {\n  http2 = require('node:http2')\n} catch {\n  // @ts-ignore\n  http2 = { constants: {} }\n}\n\nconst {\n  constants: {\n    HTTP2_HEADER_AUTHORITY,\n    HTTP2_HEADER_METHOD,\n    HTTP2_HEADER_PATH,\n    HTTP2_HEADER_SCHEME,\n    HTTP2_HEADER_CONTENT_LENGTH,\n    HTTP2_HEADER_EXPECT,\n    HTTP2_HEADER_STATUS\n  }\n} = http2\n\nfunction parseH2Headers (headers) {\n  const result = []\n\n  for (const [name, value] of Object.entries(headers)) {\n    // h2 may concat the header value by array\n    // e.g. Set-Cookie\n    if (Array.isArray(value)) {\n      for (const subvalue of value) {\n        // we need to provide each header value of header name\n        // because the headers handler expect name-value pair\n        result.push(Buffer.from(name), Buffer.from(subvalue))\n      }\n    } else {\n      result.push(Buffer.from(name), Buffer.from(value))\n    }\n  }\n\n  return result\n}\n\nasync function connectH2 (client, socket) {\n  client[kSocket] = socket\n\n  if (!h2ExperimentalWarned) {\n    h2ExperimentalWarned = true\n    process.emitWarning('H2 support is experimental, expect them to change at any time.', {\n      code: 'UNDICI-H2'\n    })\n  }\n\n  const session = http2.connect(client[kUrl], {\n    createConnection: () => socket,\n    peerMaxConcurrentStreams: client[kMaxConcurrentStreams]\n  })\n\n  session[kOpenStreams] = 0\n  session[kClient] = client\n  session[kSocket] = socket\n\n  util.addListener(session, 'error', onHttp2SessionError)\n  util.addListener(session, 'frameError', onHttp2FrameError)\n  util.addListener(session, 'end', onHttp2SessionEnd)\n  util.addListener(session, 'goaway', onHTTP2GoAway)\n  util.addListener(session, 'close', function () {\n    const { [kClient]: client } = this\n    const { [kSocket]: socket } = client\n\n    const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket))\n\n    client[kHTTP2Session] = null\n\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n\n      // Fail entire queue.\n      const requests = client[kQueue].splice(client[kRunningIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(client, request, err)\n      }\n    }\n  })\n\n  session.unref()\n\n  client[kHTTP2Session] = session\n  socket[kHTTP2Session] = session\n\n  util.addListener(socket, 'error', function (err) {\n    assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n    this[kError] = err\n\n    this[kClient][kOnError](err)\n  })\n\n  util.addListener(socket, 'end', function () {\n    util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n  })\n\n  util.addListener(socket, 'close', function () {\n    const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n    client[kSocket] = null\n\n    if (this[kHTTP2Session] != null) {\n      this[kHTTP2Session].destroy(err)\n    }\n\n    client[kPendingIdx] = client[kRunningIdx]\n\n    assert(client[kRunning] === 0)\n\n    client.emit('disconnect', client[kUrl], [client], err)\n\n    client[kResume]()\n  })\n\n  let closed = false\n  socket.on('close', () => {\n    closed = true\n  })\n\n  return {\n    version: 'h2',\n    defaultPipelining: Infinity,\n    write (...args) {\n      return writeH2(client, ...args)\n    },\n    resume () {\n      resumeH2(client)\n    },\n    destroy (err, callback) {\n      if (closed) {\n        queueMicrotask(callback)\n      } else {\n        // Destroying the socket will trigger the session close\n        socket.destroy(err).on('close', callback)\n      }\n    },\n    get destroyed () {\n      return socket.destroyed\n    },\n    busy () {\n      return false\n    }\n  }\n}\n\nfunction resumeH2 (client) {\n  const socket = client[kSocket]\n\n  if (socket?.destroyed === false) {\n    if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) {\n      socket.unref()\n      client[kHTTP2Session].unref()\n    } else {\n      socket.ref()\n      client[kHTTP2Session].ref()\n    }\n  }\n}\n\nfunction onHttp2SessionError (err) {\n  assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n  this[kSocket][kError] = err\n  this[kClient][kOnError](err)\n}\n\nfunction onHttp2FrameError (type, code, id) {\n  if (id === 0) {\n    const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n    this[kSocket][kError] = err\n    this[kClient][kOnError](err)\n  }\n}\n\nfunction onHttp2SessionEnd () {\n  const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket]))\n  this.destroy(err)\n  util.destroy(this[kSocket], err)\n}\n\n/**\n * This is the root cause of #3011\n * We need to handle GOAWAY frames properly, and trigger the session close\n * along with the socket right away\n */\nfunction onHTTP2GoAway (code) {\n  // We cannot recover, so best to close the session and the socket\n  const err = this[kError] || new SocketError(`HTTP/2: \"GOAWAY\" frame received with code ${code}`, util.getSocketInfo(this))\n  const client = this[kClient]\n\n  client[kSocket] = null\n  client[kHTTPContext] = null\n\n  if (this[kHTTP2Session] != null) {\n    this[kHTTP2Session].destroy(err)\n    this[kHTTP2Session] = null\n  }\n\n  util.destroy(this[kSocket], err)\n\n  // Fail head of pipeline.\n  if (client[kRunningIdx] < client[kQueue].length) {\n    const request = client[kQueue][client[kRunningIdx]]\n    client[kQueue][client[kRunningIdx]++] = null\n    util.errorRequest(client, request, err)\n    client[kPendingIdx] = client[kRunningIdx]\n  }\n\n  assert(client[kRunning] === 0)\n\n  client.emit('disconnect', client[kUrl], [client], err)\n\n  client[kResume]()\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n  return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH2 (client, request) {\n  const session = client[kHTTP2Session]\n  const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request\n  let { body } = request\n\n  if (upgrade) {\n    util.errorRequest(client, request, new Error('Upgrade not supported for H2'))\n    return false\n  }\n\n  const headers = {}\n  for (let n = 0; n < reqHeaders.length; n += 2) {\n    const key = reqHeaders[n + 0]\n    const val = reqHeaders[n + 1]\n\n    if (Array.isArray(val)) {\n      for (let i = 0; i < val.length; i++) {\n        if (headers[key]) {\n          headers[key] += `,${val[i]}`\n        } else {\n          headers[key] = val[i]\n        }\n      }\n    } else {\n      headers[key] = val\n    }\n  }\n\n  /** @type {import('node:http2').ClientHttp2Stream} */\n  let stream\n\n  const { hostname, port } = client[kUrl]\n\n  headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`\n  headers[HTTP2_HEADER_METHOD] = method\n\n  const abort = (err) => {\n    if (request.aborted || request.completed) {\n      return\n    }\n\n    err = err || new RequestAbortedError()\n\n    util.errorRequest(client, request, err)\n\n    if (stream != null) {\n      util.destroy(stream, err)\n    }\n\n    // We do not destroy the socket as we can continue using the session\n    // the stream get's destroyed and the session remains to create new streams\n    util.destroy(body, err)\n    client[kQueue][client[kRunningIdx]++] = null\n    client[kResume]()\n  }\n\n  try {\n    // We are already connected, streams are pending.\n    // We can call on connect, and wait for abort\n    request.onConnect(abort)\n  } catch (err) {\n    util.errorRequest(client, request, err)\n  }\n\n  if (request.aborted) {\n    return false\n  }\n\n  if (method === 'CONNECT') {\n    session.ref()\n    // We are already connected, streams are pending, first request\n    // will create a new stream. We trigger a request to create the stream and wait until\n    // `ready` event is triggered\n    // We disabled endStream to allow the user to write to the stream\n    stream = session.request(headers, { endStream: false, signal })\n\n    if (stream.id && !stream.pending) {\n      request.onUpgrade(null, null, stream)\n      ++session[kOpenStreams]\n      client[kQueue][client[kRunningIdx]++] = null\n    } else {\n      stream.once('ready', () => {\n        request.onUpgrade(null, null, stream)\n        ++session[kOpenStreams]\n        client[kQueue][client[kRunningIdx]++] = null\n      })\n    }\n\n    stream.once('close', () => {\n      session[kOpenStreams] -= 1\n      if (session[kOpenStreams] === 0) session.unref()\n    })\n\n    return true\n  }\n\n  // https://tools.ietf.org/html/rfc7540#section-8.3\n  // :path and :scheme headers must be omitted when sending CONNECT\n\n  headers[HTTP2_HEADER_PATH] = path\n  headers[HTTP2_HEADER_SCHEME] = 'https'\n\n  // https://tools.ietf.org/html/rfc7231#section-4.3.1\n  // https://tools.ietf.org/html/rfc7231#section-4.3.2\n  // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n  // Sending a payload body on a request that does not\n  // expect it can cause undefined behavior on some\n  // servers and corrupt connection state. Do not\n  // re-use the connection for further requests.\n\n  const expectsPayload = (\n    method === 'PUT' ||\n    method === 'POST' ||\n    method === 'PATCH'\n  )\n\n  if (body && typeof body.read === 'function') {\n    // Try to read EOF in order to get length.\n    body.read(0)\n  }\n\n  let contentLength = util.bodyLength(body)\n\n  if (util.isFormDataLike(body)) {\n    extractBody ??= require('../web/fetch/body.js').extractBody\n\n    const [bodyStream, contentType] = extractBody(body)\n    headers['content-type'] = contentType\n\n    body = bodyStream.stream\n    contentLength = bodyStream.length\n  }\n\n  if (contentLength == null) {\n    contentLength = request.contentLength\n  }\n\n  if (contentLength === 0 || !expectsPayload) {\n    // https://tools.ietf.org/html/rfc7230#section-3.3.2\n    // A user agent SHOULD NOT send a Content-Length header field when\n    // the request message does not contain a payload body and the method\n    // semantics do not anticipate such a body.\n\n    contentLength = null\n  }\n\n  // https://github.com/nodejs/undici/issues/2046\n  // A user agent may send a Content-Length header with 0 value, this should be allowed.\n  if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {\n    if (client[kStrictContentLength]) {\n      util.errorRequest(client, request, new RequestContentLengthMismatchError())\n      return false\n    }\n\n    process.emitWarning(new RequestContentLengthMismatchError())\n  }\n\n  if (contentLength != null) {\n    assert(body, 'no body must not have content length')\n    headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`\n  }\n\n  session.ref()\n\n  const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null\n  if (expectContinue) {\n    headers[HTTP2_HEADER_EXPECT] = '100-continue'\n    stream = session.request(headers, { endStream: shouldEndStream, signal })\n\n    stream.once('continue', writeBodyH2)\n  } else {\n    stream = session.request(headers, {\n      endStream: shouldEndStream,\n      signal\n    })\n    writeBodyH2()\n  }\n\n  // Increment counter as we have new streams open\n  ++session[kOpenStreams]\n\n  stream.once('response', headers => {\n    const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n    request.onResponseStarted()\n\n    // Due to the stream nature, it is possible we face a race condition\n    // where the stream has been assigned, but the request has been aborted\n    // the request remains in-flight and headers hasn't been received yet\n    // for those scenarios, best effort is to destroy the stream immediately\n    // as there's no value to keep it open.\n    if (request.aborted) {\n      const err = new RequestAbortedError()\n      util.errorRequest(client, request, err)\n      util.destroy(stream, err)\n      return\n    }\n\n    if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) {\n      stream.pause()\n    }\n\n    stream.on('data', (chunk) => {\n      if (request.onData(chunk) === false) {\n        stream.pause()\n      }\n    })\n  })\n\n  stream.once('end', () => {\n    // When state is null, it means we haven't consumed body and the stream still do not have\n    // a state.\n    // Present specially when using pipeline or stream\n    if (stream.state?.state == null || stream.state.state < 6) {\n      request.onComplete([])\n    }\n\n    if (session[kOpenStreams] === 0) {\n      // Stream is closed or half-closed-remote (6), decrement counter and cleanup\n      // It does not have sense to continue working with the stream as we do not\n      // have yet RST_STREAM support on client-side\n\n      session.unref()\n    }\n\n    abort(new InformationalError('HTTP/2: stream half-closed (remote)'))\n    client[kQueue][client[kRunningIdx]++] = null\n    client[kPendingIdx] = client[kRunningIdx]\n    client[kResume]()\n  })\n\n  stream.once('close', () => {\n    session[kOpenStreams] -= 1\n    if (session[kOpenStreams] === 0) {\n      session.unref()\n    }\n  })\n\n  stream.once('error', function (err) {\n    abort(err)\n  })\n\n  stream.once('frameError', (type, code) => {\n    abort(new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`))\n  })\n\n  // stream.on('aborted', () => {\n  //   // TODO(HTTP/2): Support aborted\n  // })\n\n  // stream.on('timeout', () => {\n  //   // TODO(HTTP/2): Support timeout\n  // })\n\n  // stream.on('push', headers => {\n  //   // TODO(HTTP/2): Support push\n  // })\n\n  // stream.on('trailers', headers => {\n  //   // TODO(HTTP/2): Support trailers\n  // })\n\n  return true\n\n  function writeBodyH2 () {\n    /* istanbul ignore else: assertion */\n    if (!body || contentLength === 0) {\n      writeBuffer(\n        abort,\n        stream,\n        null,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else if (util.isBuffer(body)) {\n      writeBuffer(\n        abort,\n        stream,\n        body,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else if (util.isBlobLike(body)) {\n      if (typeof body.stream === 'function') {\n        writeIterable(\n          abort,\n          stream,\n          body.stream(),\n          client,\n          request,\n          client[kSocket],\n          contentLength,\n          expectsPayload\n        )\n      } else {\n        writeBlob(\n          abort,\n          stream,\n          body,\n          client,\n          request,\n          client[kSocket],\n          contentLength,\n          expectsPayload\n        )\n      }\n    } else if (util.isStream(body)) {\n      writeStream(\n        abort,\n        client[kSocket],\n        expectsPayload,\n        stream,\n        body,\n        client,\n        request,\n        contentLength\n      )\n    } else if (util.isIterable(body)) {\n      writeIterable(\n        abort,\n        stream,\n        body,\n        client,\n        request,\n        client[kSocket],\n        contentLength,\n        expectsPayload\n      )\n    } else {\n      assert(false)\n    }\n  }\n}\n\nfunction writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  try {\n    if (body != null && util.isBuffer(body)) {\n      assert(contentLength === body.byteLength, 'buffer body must have content length')\n      h2stream.cork()\n      h2stream.write(body)\n      h2stream.uncork()\n      h2stream.end()\n\n      request.onBodySent(body)\n    }\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    request.onRequestSent()\n    client[kResume]()\n  } catch (error) {\n    abort(error)\n  }\n}\n\nfunction writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n  // For HTTP/2, is enough to pipe the stream\n  const pipe = pipeline(\n    body,\n    h2stream,\n    (err) => {\n      if (err) {\n        util.destroy(pipe, err)\n        abort(err)\n      } else {\n        util.removeAllListeners(pipe)\n        request.onRequestSent()\n\n        if (!expectsPayload) {\n          socket[kReset] = true\n        }\n\n        client[kResume]()\n      }\n    }\n  )\n\n  util.addListener(pipe, 'data', onPipeData)\n\n  function onPipeData (chunk) {\n    request.onBodySent(chunk)\n  }\n}\n\nasync function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  assert(contentLength === body.size, 'blob body must have content length')\n\n  try {\n    if (contentLength != null && contentLength !== body.size) {\n      throw new RequestContentLengthMismatchError()\n    }\n\n    const buffer = Buffer.from(await body.arrayBuffer())\n\n    h2stream.cork()\n    h2stream.write(buffer)\n    h2stream.uncork()\n    h2stream.end()\n\n    request.onBodySent(buffer)\n    request.onRequestSent()\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  }\n}\n\nasync function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n  assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n  let callback = null\n  function onDrain () {\n    if (callback) {\n      const cb = callback\n      callback = null\n      cb()\n    }\n  }\n\n  const waitForDrain = () => new Promise((resolve, reject) => {\n    assert(callback === null)\n\n    if (socket[kError]) {\n      reject(socket[kError])\n    } else {\n      callback = resolve\n    }\n  })\n\n  h2stream\n    .on('close', onDrain)\n    .on('drain', onDrain)\n\n  try {\n    // It's up to the user to somehow abort the async iterable.\n    for await (const chunk of body) {\n      if (socket[kError]) {\n        throw socket[kError]\n      }\n\n      const res = h2stream.write(chunk)\n      request.onBodySent(chunk)\n      if (!res) {\n        await waitForDrain()\n      }\n    }\n\n    h2stream.end()\n\n    request.onRequestSent()\n\n    if (!expectsPayload) {\n      socket[kReset] = true\n    }\n\n    client[kResume]()\n  } catch (err) {\n    abort(err)\n  } finally {\n    h2stream\n      .off('close', onDrain)\n      .off('drain', onDrain)\n  }\n}\n\nmodule.exports = connectH2\n","// @ts-check\n\n'use strict'\n\nconst assert = require('node:assert')\nconst net = require('node:net')\nconst http = require('node:http')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst Request = require('../core/request.js')\nconst DispatcherBase = require('./dispatcher-base')\nconst {\n  InvalidArgumentError,\n  InformationalError,\n  ClientDestroyedError\n} = require('../core/errors.js')\nconst buildConnector = require('../core/connect.js')\nconst {\n  kUrl,\n  kServerName,\n  kClient,\n  kBusy,\n  kConnect,\n  kResuming,\n  kRunning,\n  kPending,\n  kSize,\n  kQueue,\n  kConnected,\n  kConnecting,\n  kNeedDrain,\n  kKeepAliveDefaultTimeout,\n  kHostHeader,\n  kPendingIdx,\n  kRunningIdx,\n  kError,\n  kPipelining,\n  kKeepAliveTimeoutValue,\n  kMaxHeadersSize,\n  kKeepAliveMaxTimeout,\n  kKeepAliveTimeoutThreshold,\n  kHeadersTimeout,\n  kBodyTimeout,\n  kStrictContentLength,\n  kConnector,\n  kMaxRedirections,\n  kMaxRequests,\n  kCounter,\n  kClose,\n  kDestroy,\n  kDispatch,\n  kInterceptors,\n  kLocalAddress,\n  kMaxResponseSize,\n  kOnError,\n  kHTTPContext,\n  kMaxConcurrentStreams,\n  kResume\n} = require('../core/symbols.js')\nconst connectH1 = require('./client-h1.js')\nconst connectH2 = require('./client-h2.js')\nlet deprecatedInterceptorWarned = false\n\nconst kClosedResolve = Symbol('kClosedResolve')\n\nconst noop = () => {}\n\nfunction getPipelining (client) {\n  return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1\n}\n\n/**\n * @type {import('../../types/client.js').default}\n */\nclass Client extends DispatcherBase {\n  /**\n   *\n   * @param {string|URL} url\n   * @param {import('../../types/client.js').Client.Options} options\n   */\n  constructor (url, {\n    interceptors,\n    maxHeaderSize,\n    headersTimeout,\n    socketTimeout,\n    requestTimeout,\n    connectTimeout,\n    bodyTimeout,\n    idleTimeout,\n    keepAlive,\n    keepAliveTimeout,\n    maxKeepAliveTimeout,\n    keepAliveMaxTimeout,\n    keepAliveTimeoutThreshold,\n    socketPath,\n    pipelining,\n    tls,\n    strictContentLength,\n    maxCachedSessions,\n    maxRedirections,\n    connect,\n    maxRequestsPerClient,\n    localAddress,\n    maxResponseSize,\n    autoSelectFamily,\n    autoSelectFamilyAttemptTimeout,\n    // h2\n    maxConcurrentStreams,\n    allowH2,\n    webSocket\n  } = {}) {\n    super({ webSocket })\n\n    if (keepAlive !== undefined) {\n      throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')\n    }\n\n    if (socketTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')\n    }\n\n    if (requestTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')\n    }\n\n    if (idleTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')\n    }\n\n    if (maxKeepAliveTimeout !== undefined) {\n      throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')\n    }\n\n    if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {\n      throw new InvalidArgumentError('invalid maxHeaderSize')\n    }\n\n    if (socketPath != null && typeof socketPath !== 'string') {\n      throw new InvalidArgumentError('invalid socketPath')\n    }\n\n    if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n      throw new InvalidArgumentError('invalid connectTimeout')\n    }\n\n    if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n      throw new InvalidArgumentError('invalid keepAliveTimeout')\n    }\n\n    if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n      throw new InvalidArgumentError('invalid keepAliveMaxTimeout')\n    }\n\n    if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n      throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')\n    }\n\n    if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n      throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')\n    }\n\n    if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n      throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n      throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')\n    }\n\n    if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {\n      throw new InvalidArgumentError('localAddress must be valid string IP address')\n    }\n\n    if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n      throw new InvalidArgumentError('maxResponseSize must be a positive number')\n    }\n\n    if (\n      autoSelectFamilyAttemptTimeout != null &&\n      (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)\n    ) {\n      throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')\n    }\n\n    // h2\n    if (allowH2 != null && typeof allowH2 !== 'boolean') {\n      throw new InvalidArgumentError('allowH2 must be a valid boolean value')\n    }\n\n    if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {\n      throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')\n    }\n\n    if (typeof connect !== 'function') {\n      connect = buildConnector({\n        ...tls,\n        maxCachedSessions,\n        allowH2,\n        socketPath,\n        timeout: connectTimeout,\n        ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n        ...connect\n      })\n    }\n\n    if (interceptors?.Client && Array.isArray(interceptors.Client)) {\n      this[kInterceptors] = interceptors.Client\n      if (!deprecatedInterceptorWarned) {\n        deprecatedInterceptorWarned = true\n        process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', {\n          code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED'\n        })\n      }\n    } else {\n      this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]\n    }\n\n    this[kUrl] = util.parseOrigin(url)\n    this[kConnector] = connect\n    this[kPipelining] = pipelining != null ? pipelining : 1\n    this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize\n    this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout\n    this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout\n    this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold\n    this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]\n    this[kServerName] = null\n    this[kLocalAddress] = localAddress != null ? localAddress : null\n    this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming\n    this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming\n    this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\\r\\n`\n    this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3\n    this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3\n    this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength\n    this[kMaxRedirections] = maxRedirections\n    this[kMaxRequests] = maxRequestsPerClient\n    this[kClosedResolve] = null\n    this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1\n    this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server\n    this[kHTTPContext] = null\n\n    // kQueue is built up of 3 sections separated by\n    // the kRunningIdx and kPendingIdx indices.\n    // |   complete   |   running   |   pending   |\n    //                ^ kRunningIdx ^ kPendingIdx ^ kQueue.length\n    // kRunningIdx points to the first running element.\n    // kPendingIdx points to the first pending element.\n    // This implements a fast queue with an amortized\n    // time of O(1).\n\n    this[kQueue] = []\n    this[kRunningIdx] = 0\n    this[kPendingIdx] = 0\n\n    this[kResume] = (sync) => resume(this, sync)\n    this[kOnError] = (err) => onError(this, err)\n  }\n\n  get pipelining () {\n    return this[kPipelining]\n  }\n\n  set pipelining (value) {\n    this[kPipelining] = value\n    this[kResume](true)\n  }\n\n  get [kPending] () {\n    return this[kQueue].length - this[kPendingIdx]\n  }\n\n  get [kRunning] () {\n    return this[kPendingIdx] - this[kRunningIdx]\n  }\n\n  get [kSize] () {\n    return this[kQueue].length - this[kRunningIdx]\n  }\n\n  get [kConnected] () {\n    return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed\n  }\n\n  get [kBusy] () {\n    return Boolean(\n      this[kHTTPContext]?.busy(null) ||\n      (this[kSize] >= (getPipelining(this) || 1)) ||\n      this[kPending] > 0\n    )\n  }\n\n  /* istanbul ignore: only used for test */\n  [kConnect] (cb) {\n    connect(this)\n    this.once('connect', cb)\n  }\n\n  [kDispatch] (opts, handler) {\n    const origin = opts.origin || this[kUrl].origin\n    const request = new Request(origin, opts, handler)\n\n    this[kQueue].push(request)\n    if (this[kResuming]) {\n      // Do nothing.\n    } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n      // Wait a tick in case stream/iterator is ended in the same tick.\n      this[kResuming] = 1\n      queueMicrotask(() => resume(this))\n    } else {\n      this[kResume](true)\n    }\n\n    if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n      this[kNeedDrain] = 2\n    }\n\n    return this[kNeedDrain] < 2\n  }\n\n  async [kClose] () {\n    // TODO: for H2 we need to gracefully flush the remaining enqueued\n    // request and close each stream.\n    return new Promise((resolve) => {\n      if (this[kSize]) {\n        this[kClosedResolve] = resolve\n      } else {\n        resolve(null)\n      }\n    })\n  }\n\n  async [kDestroy] (err) {\n    return new Promise((resolve) => {\n      const requests = this[kQueue].splice(this[kPendingIdx])\n      for (let i = 0; i < requests.length; i++) {\n        const request = requests[i]\n        util.errorRequest(this, request, err)\n      }\n\n      const callback = () => {\n        if (this[kClosedResolve]) {\n          // TODO (fix): Should we error here with ClientDestroyedError?\n          this[kClosedResolve]()\n          this[kClosedResolve] = null\n        }\n        resolve(null)\n      }\n\n      if (this[kHTTPContext]) {\n        this[kHTTPContext].destroy(err, callback)\n        this[kHTTPContext] = null\n      } else {\n        queueMicrotask(callback)\n      }\n\n      this[kResume]()\n    })\n  }\n}\n\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor.js')\n\nfunction onError (client, err) {\n  if (\n    client[kRunning] === 0 &&\n    err.code !== 'UND_ERR_INFO' &&\n    err.code !== 'UND_ERR_SOCKET'\n  ) {\n    // Error is not caused by running request and not a recoverable\n    // socket error.\n\n    assert(client[kPendingIdx] === client[kRunningIdx])\n\n    const requests = client[kQueue].splice(client[kRunningIdx])\n\n    for (let i = 0; i < requests.length; i++) {\n      const request = requests[i]\n      util.errorRequest(client, request, err)\n    }\n    assert(client[kSize] === 0)\n  }\n}\n\n/**\n * @param {Client} client\n * @returns\n */\nasync function connect (client) {\n  assert(!client[kConnecting])\n  assert(!client[kHTTPContext])\n\n  let { host, hostname, protocol, port } = client[kUrl]\n\n  // Resolve ipv6\n  if (hostname[0] === '[') {\n    const idx = hostname.indexOf(']')\n\n    assert(idx !== -1)\n    const ip = hostname.substring(1, idx)\n\n    assert(net.isIP(ip))\n    hostname = ip\n  }\n\n  client[kConnecting] = true\n\n  if (channels.beforeConnect.hasSubscribers) {\n    channels.beforeConnect.publish({\n      connectParams: {\n        host,\n        hostname,\n        protocol,\n        port,\n        version: client[kHTTPContext]?.version,\n        servername: client[kServerName],\n        localAddress: client[kLocalAddress]\n      },\n      connector: client[kConnector]\n    })\n  }\n\n  try {\n    const socket = await new Promise((resolve, reject) => {\n      client[kConnector]({\n        host,\n        hostname,\n        protocol,\n        port,\n        servername: client[kServerName],\n        localAddress: client[kLocalAddress]\n      }, (err, socket) => {\n        if (err) {\n          reject(err)\n        } else {\n          resolve(socket)\n        }\n      })\n    })\n\n    if (client.destroyed) {\n      util.destroy(socket.on('error', noop), new ClientDestroyedError())\n      return\n    }\n\n    assert(socket)\n\n    try {\n      client[kHTTPContext] = socket.alpnProtocol === 'h2'\n        ? await connectH2(client, socket)\n        : await connectH1(client, socket)\n    } catch (err) {\n      socket.destroy().on('error', noop)\n      throw err\n    }\n\n    client[kConnecting] = false\n\n    socket[kCounter] = 0\n    socket[kMaxRequests] = client[kMaxRequests]\n    socket[kClient] = client\n    socket[kError] = null\n\n    if (channels.connected.hasSubscribers) {\n      channels.connected.publish({\n        connectParams: {\n          host,\n          hostname,\n          protocol,\n          port,\n          version: client[kHTTPContext]?.version,\n          servername: client[kServerName],\n          localAddress: client[kLocalAddress]\n        },\n        connector: client[kConnector],\n        socket\n      })\n    }\n    client.emit('connect', client[kUrl], [client])\n  } catch (err) {\n    if (client.destroyed) {\n      return\n    }\n\n    client[kConnecting] = false\n\n    if (channels.connectError.hasSubscribers) {\n      channels.connectError.publish({\n        connectParams: {\n          host,\n          hostname,\n          protocol,\n          port,\n          version: client[kHTTPContext]?.version,\n          servername: client[kServerName],\n          localAddress: client[kLocalAddress]\n        },\n        connector: client[kConnector],\n        error: err\n      })\n    }\n\n    if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n      assert(client[kRunning] === 0)\n      while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n        const request = client[kQueue][client[kPendingIdx]++]\n        util.errorRequest(client, request, err)\n      }\n    } else {\n      onError(client, err)\n    }\n\n    client.emit('connectionError', client[kUrl], [client], err)\n  }\n\n  client[kResume]()\n}\n\nfunction emitDrain (client) {\n  client[kNeedDrain] = 0\n  client.emit('drain', client[kUrl], [client])\n}\n\nfunction resume (client, sync) {\n  if (client[kResuming] === 2) {\n    return\n  }\n\n  client[kResuming] = 2\n\n  _resume(client, sync)\n  client[kResuming] = 0\n\n  if (client[kRunningIdx] > 256) {\n    client[kQueue].splice(0, client[kRunningIdx])\n    client[kPendingIdx] -= client[kRunningIdx]\n    client[kRunningIdx] = 0\n  }\n}\n\nfunction _resume (client, sync) {\n  while (true) {\n    if (client.destroyed) {\n      assert(client[kPending] === 0)\n      return\n    }\n\n    if (client[kClosedResolve] && !client[kSize]) {\n      client[kClosedResolve]()\n      client[kClosedResolve] = null\n      return\n    }\n\n    if (client[kHTTPContext]) {\n      client[kHTTPContext].resume()\n    }\n\n    if (client[kBusy]) {\n      client[kNeedDrain] = 2\n    } else if (client[kNeedDrain] === 2) {\n      if (sync) {\n        client[kNeedDrain] = 1\n        queueMicrotask(() => emitDrain(client))\n      } else {\n        emitDrain(client)\n      }\n      continue\n    }\n\n    if (client[kPending] === 0) {\n      return\n    }\n\n    if (client[kRunning] >= (getPipelining(client) || 1)) {\n      return\n    }\n\n    const request = client[kQueue][client[kPendingIdx]]\n\n    if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {\n      if (client[kRunning] > 0) {\n        return\n      }\n\n      client[kServerName] = request.servername\n      client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {\n        client[kHTTPContext] = null\n        resume(client)\n      })\n    }\n\n    if (client[kConnecting]) {\n      return\n    }\n\n    if (!client[kHTTPContext]) {\n      connect(client)\n      return\n    }\n\n    if (client[kHTTPContext].destroyed) {\n      return\n    }\n\n    if (client[kHTTPContext].busy(request)) {\n      return\n    }\n\n    if (!request.aborted && client[kHTTPContext].write(request)) {\n      client[kPendingIdx]++\n    } else {\n      client[kQueue].splice(client[kPendingIdx], 1)\n    }\n  }\n}\n\nmodule.exports = Client\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst {\n  ClientDestroyedError,\n  ClientClosedError,\n  InvalidArgumentError\n} = require('../core/errors')\nconst { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require('../core/symbols')\n\nconst kOnDestroyed = Symbol('onDestroyed')\nconst kOnClosed = Symbol('onClosed')\nconst kInterceptedDispatch = Symbol('Intercepted Dispatch')\nconst kWebSocketOptions = Symbol('webSocketOptions')\n\nclass DispatcherBase extends Dispatcher {\n  constructor (opts) {\n    super()\n\n    this[kDestroyed] = false\n    this[kOnDestroyed] = null\n    this[kClosed] = false\n    this[kOnClosed] = []\n    this[kWebSocketOptions] = opts?.webSocket ?? {}\n  }\n\n  get webSocketOptions () {\n    return {\n      maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,\n      maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024\n    }\n  }\n\n  get destroyed () {\n    return this[kDestroyed]\n  }\n\n  get closed () {\n    return this[kClosed]\n  }\n\n  get interceptors () {\n    return this[kInterceptors]\n  }\n\n  set interceptors (newInterceptors) {\n    if (newInterceptors) {\n      for (let i = newInterceptors.length - 1; i >= 0; i--) {\n        const interceptor = this[kInterceptors][i]\n        if (typeof interceptor !== 'function') {\n          throw new InvalidArgumentError('interceptor must be an function')\n        }\n      }\n    }\n\n    this[kInterceptors] = newInterceptors\n  }\n\n  close (callback) {\n    if (callback === undefined) {\n      return new Promise((resolve, reject) => {\n        this.close((err, data) => {\n          return err ? reject(err) : resolve(data)\n        })\n      })\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    if (this[kDestroyed]) {\n      queueMicrotask(() => callback(new ClientDestroyedError(), null))\n      return\n    }\n\n    if (this[kClosed]) {\n      if (this[kOnClosed]) {\n        this[kOnClosed].push(callback)\n      } else {\n        queueMicrotask(() => callback(null, null))\n      }\n      return\n    }\n\n    this[kClosed] = true\n    this[kOnClosed].push(callback)\n\n    const onClosed = () => {\n      const callbacks = this[kOnClosed]\n      this[kOnClosed] = null\n      for (let i = 0; i < callbacks.length; i++) {\n        callbacks[i](null, null)\n      }\n    }\n\n    // Should not error.\n    this[kClose]()\n      .then(() => this.destroy())\n      .then(() => {\n        queueMicrotask(onClosed)\n      })\n  }\n\n  destroy (err, callback) {\n    if (typeof err === 'function') {\n      callback = err\n      err = null\n    }\n\n    if (callback === undefined) {\n      return new Promise((resolve, reject) => {\n        this.destroy(err, (err, data) => {\n          return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)\n        })\n      })\n    }\n\n    if (typeof callback !== 'function') {\n      throw new InvalidArgumentError('invalid callback')\n    }\n\n    if (this[kDestroyed]) {\n      if (this[kOnDestroyed]) {\n        this[kOnDestroyed].push(callback)\n      } else {\n        queueMicrotask(() => callback(null, null))\n      }\n      return\n    }\n\n    if (!err) {\n      err = new ClientDestroyedError()\n    }\n\n    this[kDestroyed] = true\n    this[kOnDestroyed] = this[kOnDestroyed] || []\n    this[kOnDestroyed].push(callback)\n\n    const onDestroyed = () => {\n      const callbacks = this[kOnDestroyed]\n      this[kOnDestroyed] = null\n      for (let i = 0; i < callbacks.length; i++) {\n        callbacks[i](null, null)\n      }\n    }\n\n    // Should not error.\n    this[kDestroy](err).then(() => {\n      queueMicrotask(onDestroyed)\n    })\n  }\n\n  [kInterceptedDispatch] (opts, handler) {\n    if (!this[kInterceptors] || this[kInterceptors].length === 0) {\n      this[kInterceptedDispatch] = this[kDispatch]\n      return this[kDispatch](opts, handler)\n    }\n\n    let dispatch = this[kDispatch].bind(this)\n    for (let i = this[kInterceptors].length - 1; i >= 0; i--) {\n      dispatch = this[kInterceptors][i](dispatch)\n    }\n    this[kInterceptedDispatch] = dispatch\n    return dispatch(opts, handler)\n  }\n\n  dispatch (opts, handler) {\n    if (!handler || typeof handler !== 'object') {\n      throw new InvalidArgumentError('handler must be an object')\n    }\n\n    try {\n      if (!opts || typeof opts !== 'object') {\n        throw new InvalidArgumentError('opts must be an object.')\n      }\n\n      if (this[kDestroyed] || this[kOnDestroyed]) {\n        throw new ClientDestroyedError()\n      }\n\n      if (this[kClosed]) {\n        throw new ClientClosedError()\n      }\n\n      return this[kInterceptedDispatch](opts, handler)\n    } catch (err) {\n      if (typeof handler.onError !== 'function') {\n        throw new InvalidArgumentError('invalid onError method')\n      }\n\n      handler.onError(err)\n\n      return false\n    }\n  }\n}\n\nmodule.exports = DispatcherBase\n","'use strict'\nconst EventEmitter = require('node:events')\n\nclass Dispatcher extends EventEmitter {\n  dispatch () {\n    throw new Error('not implemented')\n  }\n\n  close () {\n    throw new Error('not implemented')\n  }\n\n  destroy () {\n    throw new Error('not implemented')\n  }\n\n  compose (...args) {\n    // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...\n    const interceptors = Array.isArray(args[0]) ? args[0] : args\n    let dispatch = this.dispatch.bind(this)\n\n    for (const interceptor of interceptors) {\n      if (interceptor == null) {\n        continue\n      }\n\n      if (typeof interceptor !== 'function') {\n        throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)\n      }\n\n      dispatch = interceptor(dispatch)\n\n      if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {\n        throw new TypeError('invalid interceptor')\n      }\n    }\n\n    return new ComposedDispatcher(this, dispatch)\n  }\n}\n\nclass ComposedDispatcher extends Dispatcher {\n  #dispatcher = null\n  #dispatch = null\n\n  constructor (dispatcher, dispatch) {\n    super()\n    this.#dispatcher = dispatcher\n    this.#dispatch = dispatch\n  }\n\n  dispatch (...args) {\n    this.#dispatch(...args)\n  }\n\n  close (...args) {\n    return this.#dispatcher.close(...args)\n  }\n\n  destroy (...args) {\n    return this.#dispatcher.destroy(...args)\n  }\n}\n\nmodule.exports = Dispatcher\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require('../core/symbols')\nconst ProxyAgent = require('./proxy-agent')\nconst Agent = require('./agent')\n\nconst DEFAULT_PORTS = {\n  'http:': 80,\n  'https:': 443\n}\n\nlet experimentalWarned = false\n\nclass EnvHttpProxyAgent extends DispatcherBase {\n  #noProxyValue = null\n  #noProxyEntries = null\n  #opts = null\n\n  constructor (opts = {}) {\n    super()\n    this.#opts = opts\n\n    if (!experimentalWarned) {\n      experimentalWarned = true\n      process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', {\n        code: 'UNDICI-EHPA'\n      })\n    }\n\n    const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts\n\n    this[kNoProxyAgent] = new Agent(agentOpts)\n\n    const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY\n    if (HTTP_PROXY) {\n      this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY })\n    } else {\n      this[kHttpProxyAgent] = this[kNoProxyAgent]\n    }\n\n    const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY\n    if (HTTPS_PROXY) {\n      this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY })\n    } else {\n      this[kHttpsProxyAgent] = this[kHttpProxyAgent]\n    }\n\n    this.#parseNoProxy()\n  }\n\n  [kDispatch] (opts, handler) {\n    const url = new URL(opts.origin)\n    const agent = this.#getProxyAgentForUrl(url)\n    return agent.dispatch(opts, handler)\n  }\n\n  async [kClose] () {\n    await this[kNoProxyAgent].close()\n    if (!this[kHttpProxyAgent][kClosed]) {\n      await this[kHttpProxyAgent].close()\n    }\n    if (!this[kHttpsProxyAgent][kClosed]) {\n      await this[kHttpsProxyAgent].close()\n    }\n  }\n\n  async [kDestroy] (err) {\n    await this[kNoProxyAgent].destroy(err)\n    if (!this[kHttpProxyAgent][kDestroyed]) {\n      await this[kHttpProxyAgent].destroy(err)\n    }\n    if (!this[kHttpsProxyAgent][kDestroyed]) {\n      await this[kHttpsProxyAgent].destroy(err)\n    }\n  }\n\n  #getProxyAgentForUrl (url) {\n    let { protocol, host: hostname, port } = url\n\n    // Stripping ports in this way instead of using parsedUrl.hostname to make\n    // sure that the brackets around IPv6 addresses are kept.\n    hostname = hostname.replace(/:\\d*$/, '').toLowerCase()\n    port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0\n    if (!this.#shouldProxy(hostname, port)) {\n      return this[kNoProxyAgent]\n    }\n    if (protocol === 'https:') {\n      return this[kHttpsProxyAgent]\n    }\n    return this[kHttpProxyAgent]\n  }\n\n  #shouldProxy (hostname, port) {\n    if (this.#noProxyChanged) {\n      this.#parseNoProxy()\n    }\n\n    if (this.#noProxyEntries.length === 0) {\n      return true // Always proxy if NO_PROXY is not set or empty.\n    }\n    if (this.#noProxyValue === '*') {\n      return false // Never proxy if wildcard is set.\n    }\n\n    for (let i = 0; i < this.#noProxyEntries.length; i++) {\n      const entry = this.#noProxyEntries[i]\n      if (entry.port && entry.port !== port) {\n        continue // Skip if ports don't match.\n      }\n      if (!/^[.*]/.test(entry.hostname)) {\n        // No wildcards, so don't proxy only if there is not an exact match.\n        if (hostname === entry.hostname) {\n          return false\n        }\n      } else {\n        // Don't proxy if the hostname ends with the no_proxy host.\n        if (hostname.endsWith(entry.hostname.replace(/^\\*/, ''))) {\n          return false\n        }\n      }\n    }\n\n    return true\n  }\n\n  #parseNoProxy () {\n    const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv\n    const noProxySplit = noProxyValue.split(/[,\\s]/)\n    const noProxyEntries = []\n\n    for (let i = 0; i < noProxySplit.length; i++) {\n      const entry = noProxySplit[i]\n      if (!entry) {\n        continue\n      }\n      const parsed = entry.match(/^(.+):(\\d+)$/)\n      noProxyEntries.push({\n        hostname: (parsed ? parsed[1] : entry).toLowerCase(),\n        port: parsed ? Number.parseInt(parsed[2], 10) : 0\n      })\n    }\n\n    this.#noProxyValue = noProxyValue\n    this.#noProxyEntries = noProxyEntries\n  }\n\n  get #noProxyChanged () {\n    if (this.#opts.noProxy !== undefined) {\n      return false\n    }\n    return this.#noProxyValue !== this.#noProxyEnv\n  }\n\n  get #noProxyEnv () {\n    return process.env.no_proxy ?? process.env.NO_PROXY ?? ''\n  }\n}\n\nmodule.exports = EnvHttpProxyAgent\n","/* eslint-disable */\n\n'use strict'\n\n// Extracted from node/lib/internal/fixed_queue.js\n\n// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.\nconst kSize = 2048;\nconst kMask = kSize - 1;\n\n// The FixedQueue is implemented as a singly-linked list of fixed-size\n// circular buffers. It looks something like this:\n//\n//  head                                                       tail\n//    |                                                          |\n//    v                                                          v\n// +-----------+ <-----\\       +-----------+ <------\\         +-----------+\n// |  [null]   |        \\----- |   next    |         \\------- |   next    |\n// +-----------+               +-----------+                  +-----------+\n// |   item    | <-- bottom    |   item    | <-- bottom       |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |                  |  [empty]  |\n// |   item    |               |   item    |       bottom --> |   item    |\n// |   item    |               |   item    |                  |   item    |\n// |    ...    |               |    ...    |                  |    ...    |\n// |   item    |               |   item    |                  |   item    |\n// |   item    |               |   item    |                  |   item    |\n// |  [empty]  | <-- top       |   item    |                  |   item    |\n// |  [empty]  |               |   item    |                  |   item    |\n// |  [empty]  |               |  [empty]  | <-- top  top --> |  [empty]  |\n// +-----------+               +-----------+                  +-----------+\n//\n// Or, if there is only one circular buffer, it looks something\n// like either of these:\n//\n//  head   tail                                 head   tail\n//    |     |                                     |     |\n//    v     v                                     v     v\n// +-----------+                               +-----------+\n// |  [null]   |                               |  [null]   |\n// +-----------+                               +-----------+\n// |  [empty]  |                               |   item    |\n// |  [empty]  |                               |   item    |\n// |   item    | <-- bottom            top --> |  [empty]  |\n// |   item    |                               |  [empty]  |\n// |  [empty]  | <-- top            bottom --> |   item    |\n// |  [empty]  |                               |   item    |\n// +-----------+                               +-----------+\n//\n// Adding a value means moving `top` forward by one, removing means\n// moving `bottom` forward by one. After reaching the end, the queue\n// wraps around.\n//\n// When `top === bottom` the current queue is empty and when\n// `top + 1 === bottom` it's full. This wastes a single space of storage\n// but allows much quicker checks.\n\nclass FixedCircularBuffer {\n  constructor() {\n    this.bottom = 0;\n    this.top = 0;\n    this.list = new Array(kSize);\n    this.next = null;\n  }\n\n  isEmpty() {\n    return this.top === this.bottom;\n  }\n\n  isFull() {\n    return ((this.top + 1) & kMask) === this.bottom;\n  }\n\n  push(data) {\n    this.list[this.top] = data;\n    this.top = (this.top + 1) & kMask;\n  }\n\n  shift() {\n    const nextItem = this.list[this.bottom];\n    if (nextItem === undefined)\n      return null;\n    this.list[this.bottom] = undefined;\n    this.bottom = (this.bottom + 1) & kMask;\n    return nextItem;\n  }\n}\n\nmodule.exports = class FixedQueue {\n  constructor() {\n    this.head = this.tail = new FixedCircularBuffer();\n  }\n\n  isEmpty() {\n    return this.head.isEmpty();\n  }\n\n  push(data) {\n    if (this.head.isFull()) {\n      // Head is full: Creates a new queue, sets the old queue's `.next` to it,\n      // and sets it as the new main queue.\n      this.head = this.head.next = new FixedCircularBuffer();\n    }\n    this.head.push(data);\n  }\n\n  shift() {\n    const tail = this.tail;\n    const next = tail.shift();\n    if (tail.isEmpty() && tail.next !== null) {\n      // If there is another queue, it forms the new tail.\n      this.tail = tail.next;\n    }\n    return next;\n  }\n};\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst FixedQueue = require('./fixed-queue')\nconst { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('../core/symbols')\nconst PoolStats = require('./pool-stats')\n\nconst kClients = Symbol('clients')\nconst kNeedDrain = Symbol('needDrain')\nconst kQueue = Symbol('queue')\nconst kClosedResolve = Symbol('closed resolve')\nconst kOnDrain = Symbol('onDrain')\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kGetDispatcher = Symbol('get dispatcher')\nconst kAddClient = Symbol('add client')\nconst kRemoveClient = Symbol('remove client')\nconst kStats = Symbol('stats')\n\nclass PoolBase extends DispatcherBase {\n  constructor (opts) {\n    super(opts)\n\n    this[kQueue] = new FixedQueue()\n    this[kClients] = []\n    this[kQueued] = 0\n\n    const pool = this\n\n    this[kOnDrain] = function onDrain (origin, targets) {\n      const queue = pool[kQueue]\n\n      let needDrain = false\n\n      while (!needDrain) {\n        const item = queue.shift()\n        if (!item) {\n          break\n        }\n        pool[kQueued]--\n        needDrain = !this.dispatch(item.opts, item.handler)\n      }\n\n      this[kNeedDrain] = needDrain\n\n      if (!this[kNeedDrain] && pool[kNeedDrain]) {\n        pool[kNeedDrain] = false\n        pool.emit('drain', origin, [pool, ...targets])\n      }\n\n      if (pool[kClosedResolve] && queue.isEmpty()) {\n        Promise\n          .all(pool[kClients].map(c => c.close()))\n          .then(pool[kClosedResolve])\n      }\n    }\n\n    this[kOnConnect] = (origin, targets) => {\n      pool.emit('connect', origin, [pool, ...targets])\n    }\n\n    this[kOnDisconnect] = (origin, targets, err) => {\n      pool.emit('disconnect', origin, [pool, ...targets], err)\n    }\n\n    this[kOnConnectionError] = (origin, targets, err) => {\n      pool.emit('connectionError', origin, [pool, ...targets], err)\n    }\n\n    this[kStats] = new PoolStats(this)\n  }\n\n  get [kBusy] () {\n    return this[kNeedDrain]\n  }\n\n  get [kConnected] () {\n    return this[kClients].filter(client => client[kConnected]).length\n  }\n\n  get [kFree] () {\n    return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length\n  }\n\n  get [kPending] () {\n    let ret = this[kQueued]\n    for (const { [kPending]: pending } of this[kClients]) {\n      ret += pending\n    }\n    return ret\n  }\n\n  get [kRunning] () {\n    let ret = 0\n    for (const { [kRunning]: running } of this[kClients]) {\n      ret += running\n    }\n    return ret\n  }\n\n  get [kSize] () {\n    let ret = this[kQueued]\n    for (const { [kSize]: size } of this[kClients]) {\n      ret += size\n    }\n    return ret\n  }\n\n  get stats () {\n    return this[kStats]\n  }\n\n  async [kClose] () {\n    if (this[kQueue].isEmpty()) {\n      await Promise.all(this[kClients].map(c => c.close()))\n    } else {\n      await new Promise((resolve) => {\n        this[kClosedResolve] = resolve\n      })\n    }\n  }\n\n  async [kDestroy] (err) {\n    while (true) {\n      const item = this[kQueue].shift()\n      if (!item) {\n        break\n      }\n      item.handler.onError(err)\n    }\n\n    await Promise.all(this[kClients].map(c => c.destroy(err)))\n  }\n\n  [kDispatch] (opts, handler) {\n    const dispatcher = this[kGetDispatcher]()\n\n    if (!dispatcher) {\n      this[kNeedDrain] = true\n      this[kQueue].push({ opts, handler })\n      this[kQueued]++\n    } else if (!dispatcher.dispatch(opts, handler)) {\n      dispatcher[kNeedDrain] = true\n      this[kNeedDrain] = !this[kGetDispatcher]()\n    }\n\n    return !this[kNeedDrain]\n  }\n\n  [kAddClient] (client) {\n    client\n      .on('drain', this[kOnDrain])\n      .on('connect', this[kOnConnect])\n      .on('disconnect', this[kOnDisconnect])\n      .on('connectionError', this[kOnConnectionError])\n\n    this[kClients].push(client)\n\n    if (this[kNeedDrain]) {\n      queueMicrotask(() => {\n        if (this[kNeedDrain]) {\n          this[kOnDrain](client[kUrl], [this, client])\n        }\n      })\n    }\n\n    return this\n  }\n\n  [kRemoveClient] (client) {\n    client.close(() => {\n      const idx = this[kClients].indexOf(client)\n      if (idx !== -1) {\n        this[kClients].splice(idx, 1)\n      }\n    })\n\n    this[kNeedDrain] = this[kClients].some(dispatcher => (\n      !dispatcher[kNeedDrain] &&\n      dispatcher.closed !== true &&\n      dispatcher.destroyed !== true\n    ))\n  }\n}\n\nmodule.exports = {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kRemoveClient,\n  kGetDispatcher\n}\n","const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('../core/symbols')\nconst kPool = Symbol('pool')\n\nclass PoolStats {\n  constructor (pool) {\n    this[kPool] = pool\n  }\n\n  get connected () {\n    return this[kPool][kConnected]\n  }\n\n  get free () {\n    return this[kPool][kFree]\n  }\n\n  get pending () {\n    return this[kPool][kPending]\n  }\n\n  get queued () {\n    return this[kPool][kQueued]\n  }\n\n  get running () {\n    return this[kPool][kRunning]\n  }\n\n  get size () {\n    return this[kPool][kSize]\n  }\n}\n\nmodule.exports = PoolStats\n","'use strict'\n\nconst {\n  PoolBase,\n  kClients,\n  kNeedDrain,\n  kAddClient,\n  kGetDispatcher\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n  InvalidArgumentError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst buildConnector = require('../core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\n\nfunction defaultFactory (origin, opts) {\n  return new Client(origin, opts)\n}\n\nclass Pool extends PoolBase {\n  constructor (origin, {\n    connections,\n    factory = defaultFactory,\n    connect,\n    connectTimeout,\n    tls,\n    maxCachedSessions,\n    socketPath,\n    autoSelectFamily,\n    autoSelectFamilyAttemptTimeout,\n    allowH2,\n    ...options\n  } = {}) {\n    if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n      throw new InvalidArgumentError('invalid connections')\n    }\n\n    if (typeof factory !== 'function') {\n      throw new InvalidArgumentError('factory must be a function.')\n    }\n\n    if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n      throw new InvalidArgumentError('connect must be a function or an object')\n    }\n\n    if (typeof connect !== 'function') {\n      connect = buildConnector({\n        ...tls,\n        maxCachedSessions,\n        allowH2,\n        socketPath,\n        timeout: connectTimeout,\n        ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n        ...connect\n      })\n    }\n\n    super(options)\n\n    this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool)\n      ? options.interceptors.Pool\n      : []\n    this[kConnections] = connections || null\n    this[kUrl] = util.parseOrigin(origin)\n    this[kOptions] = { ...util.deepClone(options), connect, allowH2 }\n    this[kOptions].interceptors = options.interceptors\n      ? { ...options.interceptors }\n      : undefined\n    this[kFactory] = factory\n\n    this.on('connectionError', (origin, targets, error) => {\n      // If a connection error occurs, we remove the client from the pool,\n      // and emit a connectionError event. They will not be re-used.\n      // Fixes https://github.com/nodejs/undici/issues/3895\n      for (const target of targets) {\n        // Do not use kRemoveClient here, as it will close the client,\n        // but the client cannot be closed in this state.\n        const idx = this[kClients].indexOf(target)\n        if (idx !== -1) {\n          this[kClients].splice(idx, 1)\n        }\n      }\n    })\n  }\n\n  [kGetDispatcher] () {\n    for (const client of this[kClients]) {\n      if (!client[kNeedDrain]) {\n        return client\n      }\n    }\n\n    if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n      const dispatcher = this[kFactory](this[kUrl], this[kOptions])\n      this[kAddClient](dispatcher)\n      return dispatcher\n    }\n  }\n}\n\nmodule.exports = Pool\n","'use strict'\n\nconst { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst { URL } = require('node:url')\nconst Agent = require('./agent')\nconst Pool = require('./pool')\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors')\nconst buildConnector = require('../core/connect')\nconst Client = require('./client')\n\nconst kAgent = Symbol('proxy agent')\nconst kClient = Symbol('proxy client')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kRequestTls = Symbol('request tls settings')\nconst kProxyTls = Symbol('proxy tls settings')\nconst kConnectEndpoint = Symbol('connect endpoint function')\nconst kTunnelProxy = Symbol('tunnel proxy')\n\nfunction defaultProtocolPort (protocol) {\n  return protocol === 'https:' ? 443 : 80\n}\n\nfunction defaultFactory (origin, opts) {\n  return new Pool(origin, opts)\n}\n\nconst noop = () => {}\n\nfunction defaultAgentFactory (origin, opts) {\n  if (opts.connections === 1) {\n    return new Client(origin, opts)\n  }\n  return new Pool(origin, opts)\n}\n\nclass Http1ProxyWrapper extends DispatcherBase {\n  #client\n\n  constructor (proxyUrl, { headers = {}, connect, factory }) {\n    super()\n    if (!proxyUrl) {\n      throw new InvalidArgumentError('Proxy URL is mandatory')\n    }\n\n    this[kProxyHeaders] = headers\n    if (factory) {\n      this.#client = factory(proxyUrl, { connect })\n    } else {\n      this.#client = new Client(proxyUrl, { connect })\n    }\n  }\n\n  [kDispatch] (opts, handler) {\n    const onHeaders = handler.onHeaders\n    handler.onHeaders = function (statusCode, data, resume) {\n      if (statusCode === 407) {\n        if (typeof handler.onError === 'function') {\n          handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)'))\n        }\n        return\n      }\n      if (onHeaders) onHeaders.call(this, statusCode, data, resume)\n    }\n\n    // Rewrite request as an HTTP1 Proxy request, without tunneling.\n    const {\n      origin,\n      path = '/',\n      headers = {}\n    } = opts\n\n    opts.path = origin + path\n\n    if (!('host' in headers) && !('Host' in headers)) {\n      const { host } = new URL(origin)\n      headers.host = host\n    }\n    opts.headers = { ...this[kProxyHeaders], ...headers }\n\n    return this.#client[kDispatch](opts, handler)\n  }\n\n  async [kClose] () {\n    return this.#client.close()\n  }\n\n  async [kDestroy] (err) {\n    return this.#client.destroy(err)\n  }\n}\n\nclass ProxyAgent extends DispatcherBase {\n  constructor (opts) {\n    super()\n\n    if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) {\n      throw new InvalidArgumentError('Proxy uri is mandatory')\n    }\n\n    const { clientFactory = defaultFactory } = opts\n    if (typeof clientFactory !== 'function') {\n      throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')\n    }\n\n    const { proxyTunnel = true } = opts\n\n    const url = this.#getUrl(opts)\n    const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url\n\n    this[kProxy] = { uri: href, protocol }\n    this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)\n      ? opts.interceptors.ProxyAgent\n      : []\n    this[kRequestTls] = opts.requestTls\n    this[kProxyTls] = opts.proxyTls\n    this[kProxyHeaders] = opts.headers || {}\n    this[kTunnelProxy] = proxyTunnel\n\n    if (opts.auth && opts.token) {\n      throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')\n    } else if (opts.auth) {\n      /* @deprecated in favour of opts.token */\n      this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`\n    } else if (opts.token) {\n      this[kProxyHeaders]['proxy-authorization'] = opts.token\n    } else if (username && password) {\n      this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`\n    }\n\n    const connect = buildConnector({ ...opts.proxyTls })\n    this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })\n\n    const agentFactory = opts.factory || defaultAgentFactory\n    const factory = (origin, options) => {\n      const { protocol } = new URL(origin)\n      if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') {\n        return new Http1ProxyWrapper(this[kProxy].uri, {\n          headers: this[kProxyHeaders],\n          connect,\n          factory: agentFactory\n        })\n      }\n      return agentFactory(origin, options)\n    }\n    this[kClient] = clientFactory(url, { connect })\n    this[kAgent] = new Agent({\n      ...opts,\n      factory,\n      connect: async (opts, callback) => {\n        let requestedPath = opts.host\n        if (!opts.port) {\n          requestedPath += `:${defaultProtocolPort(opts.protocol)}`\n        }\n        try {\n          const { socket, statusCode } = await this[kClient].connect({\n            origin,\n            port,\n            path: requestedPath,\n            signal: opts.signal,\n            headers: {\n              ...this[kProxyHeaders],\n              host: opts.host\n            },\n            servername: this[kProxyTls]?.servername || proxyHostname\n          })\n          if (statusCode !== 200) {\n            socket.on('error', noop).destroy()\n            callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))\n          }\n          if (opts.protocol !== 'https:') {\n            callback(null, socket)\n            return\n          }\n          let servername\n          if (this[kRequestTls]) {\n            servername = this[kRequestTls].servername\n          } else {\n            servername = opts.servername\n          }\n          this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)\n        } catch (err) {\n          if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n            // Throw a custom error to avoid loop in client.js#connect\n            callback(new SecureProxyConnectionError(err))\n          } else {\n            callback(err)\n          }\n        }\n      }\n    })\n  }\n\n  dispatch (opts, handler) {\n    const headers = buildHeaders(opts.headers)\n    throwIfProxyAuthIsSent(headers)\n\n    if (headers && !('host' in headers) && !('Host' in headers)) {\n      const { host } = new URL(opts.origin)\n      headers.host = host\n    }\n\n    return this[kAgent].dispatch(\n      {\n        ...opts,\n        headers\n      },\n      handler\n    )\n  }\n\n  /**\n   * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts\n   * @returns {URL}\n   */\n  #getUrl (opts) {\n    if (typeof opts === 'string') {\n      return new URL(opts)\n    } else if (opts instanceof URL) {\n      return opts\n    } else {\n      return new URL(opts.uri)\n    }\n  }\n\n  async [kClose] () {\n    await this[kAgent].close()\n    await this[kClient].close()\n  }\n\n  async [kDestroy] () {\n    await this[kAgent].destroy()\n    await this[kClient].destroy()\n  }\n}\n\n/**\n * @param {string[] | Record} headers\n * @returns {Record}\n */\nfunction buildHeaders (headers) {\n  // When using undici.fetch, the headers list is stored\n  // as an array.\n  if (Array.isArray(headers)) {\n    /** @type {Record} */\n    const headersPair = {}\n\n    for (let i = 0; i < headers.length; i += 2) {\n      headersPair[headers[i]] = headers[i + 1]\n    }\n\n    return headersPair\n  }\n\n  return headers\n}\n\n/**\n * @param {Record} headers\n *\n * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers\n * Nevertheless, it was changed and to avoid a security vulnerability by end users\n * this check was created.\n * It should be removed in the next major version for performance reasons\n */\nfunction throwIfProxyAuthIsSent (headers) {\n  const existProxyAuth = headers && Object.keys(headers)\n    .find((key) => key.toLowerCase() === 'proxy-authorization')\n  if (existProxyAuth) {\n    throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')\n  }\n}\n\nmodule.exports = ProxyAgent\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst RetryHandler = require('../handler/retry-handler')\n\nclass RetryAgent extends Dispatcher {\n  #agent = null\n  #options = null\n  constructor (agent, options = {}) {\n    super(options)\n    this.#agent = agent\n    this.#options = options\n  }\n\n  dispatch (opts, handler) {\n    const retry = new RetryHandler({\n      ...opts,\n      retryOptions: this.#options\n    }, {\n      dispatch: this.#agent.dispatch.bind(this.#agent),\n      handler\n    })\n    return this.#agent.dispatch(opts, retry)\n  }\n\n  close () {\n    return this.#agent.close()\n  }\n\n  destroy () {\n    return this.#agent.destroy()\n  }\n}\n\nmodule.exports = RetryAgent\n","'use strict'\n\n// We include a version number for the Dispatcher API. In case of breaking changes,\n// this version number must be increased to avoid conflicts.\nconst globalDispatcher = Symbol.for('undici.globalDispatcher.1')\nconst { InvalidArgumentError } = require('./core/errors')\nconst Agent = require('./dispatcher/agent')\n\nif (getGlobalDispatcher() === undefined) {\n  setGlobalDispatcher(new Agent())\n}\n\nfunction setGlobalDispatcher (agent) {\n  if (!agent || typeof agent.dispatch !== 'function') {\n    throw new InvalidArgumentError('Argument agent must implement Agent')\n  }\n  Object.defineProperty(globalThis, globalDispatcher, {\n    value: agent,\n    writable: true,\n    enumerable: false,\n    configurable: false\n  })\n}\n\nfunction getGlobalDispatcher () {\n  return globalThis[globalDispatcher]\n}\n\nmodule.exports = {\n  setGlobalDispatcher,\n  getGlobalDispatcher\n}\n","'use strict'\n\nmodule.exports = class DecoratorHandler {\n  #handler\n\n  constructor (handler) {\n    if (typeof handler !== 'object' || handler === null) {\n      throw new TypeError('handler must be an object')\n    }\n    this.#handler = handler\n  }\n\n  onConnect (...args) {\n    return this.#handler.onConnect?.(...args)\n  }\n\n  onError (...args) {\n    return this.#handler.onError?.(...args)\n  }\n\n  onUpgrade (...args) {\n    return this.#handler.onUpgrade?.(...args)\n  }\n\n  onResponseStarted (...args) {\n    return this.#handler.onResponseStarted?.(...args)\n  }\n\n  onHeaders (...args) {\n    return this.#handler.onHeaders?.(...args)\n  }\n\n  onData (...args) {\n    return this.#handler.onData?.(...args)\n  }\n\n  onComplete (...args) {\n    return this.#handler.onComplete?.(...args)\n  }\n\n  onBodySent (...args) {\n    return this.#handler.onBodySent?.(...args)\n  }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('node:assert')\nconst { InvalidArgumentError } = require('../core/errors')\nconst EE = require('node:events')\n\nconst redirectableStatusCodes = [300, 301, 302, 303, 307, 308]\n\nconst kBody = Symbol('body')\n\nclass BodyAsyncIterable {\n  constructor (body) {\n    this[kBody] = body\n    this[kBodyUsed] = false\n  }\n\n  async * [Symbol.asyncIterator] () {\n    assert(!this[kBodyUsed], 'disturbed')\n    this[kBodyUsed] = true\n    yield * this[kBody]\n  }\n}\n\nclass RedirectHandler {\n  constructor (dispatch, maxRedirections, opts, handler) {\n    if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n      throw new InvalidArgumentError('maxRedirections must be a positive number')\n    }\n\n    util.validateHandler(handler, opts.method, opts.upgrade)\n\n    this.dispatch = dispatch\n    this.location = null\n    this.abort = null\n    this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy\n    this.maxRedirections = maxRedirections\n    this.handler = handler\n    this.history = []\n    this.redirectionLimitReached = false\n\n    if (util.isStream(this.opts.body)) {\n      // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n      // so that it can be dispatched again?\n      // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n      if (util.bodyLength(this.opts.body) === 0) {\n        this.opts.body\n          .on('data', function () {\n            assert(false)\n          })\n      }\n\n      if (typeof this.opts.body.readableDidRead !== 'boolean') {\n        this.opts.body[kBodyUsed] = false\n        EE.prototype.on.call(this.opts.body, 'data', function () {\n          this[kBodyUsed] = true\n        })\n      }\n    } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {\n      // TODO (fix): We can't access ReadableStream internal state\n      // to determine whether or not it has been disturbed. This is just\n      // a workaround.\n      this.opts.body = new BodyAsyncIterable(this.opts.body)\n    } else if (\n      this.opts.body &&\n      typeof this.opts.body !== 'string' &&\n      !ArrayBuffer.isView(this.opts.body) &&\n      util.isIterable(this.opts.body)\n    ) {\n      // TODO: Should we allow re-using iterable if !this.opts.idempotent\n      // or through some other flag?\n      this.opts.body = new BodyAsyncIterable(this.opts.body)\n    }\n  }\n\n  onConnect (abort) {\n    this.abort = abort\n    this.handler.onConnect(abort, { history: this.history })\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    this.handler.onUpgrade(statusCode, headers, socket)\n  }\n\n  onError (error) {\n    this.handler.onError(error)\n  }\n\n  onHeaders (statusCode, headers, resume, statusText) {\n    this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)\n      ? null\n      : parseLocation(statusCode, headers)\n\n    if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {\n      if (this.request) {\n        this.request.abort(new Error('max redirects'))\n      }\n\n      this.redirectionLimitReached = true\n      this.abort(new Error('max redirects'))\n      return\n    }\n\n    if (this.opts.origin) {\n      this.history.push(new URL(this.opts.path, this.opts.origin))\n    }\n\n    if (!this.location) {\n      return this.handler.onHeaders(statusCode, headers, resume, statusText)\n    }\n\n    const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))\n    const path = search ? `${pathname}${search}` : pathname\n\n    // Remove headers referring to the original URL.\n    // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.\n    // https://tools.ietf.org/html/rfc7231#section-6.4\n    this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)\n    this.opts.path = path\n    this.opts.origin = origin\n    this.opts.maxRedirections = 0\n    this.opts.query = null\n\n    // https://tools.ietf.org/html/rfc7231#section-6.4.4\n    // In case of HTTP 303, always replace method to be either HEAD or GET\n    if (statusCode === 303 && this.opts.method !== 'HEAD') {\n      this.opts.method = 'GET'\n      this.opts.body = null\n    }\n  }\n\n  onData (chunk) {\n    if (this.location) {\n      /*\n        https://tools.ietf.org/html/rfc7231#section-6.4\n\n        TLDR: undici always ignores 3xx response bodies.\n\n        Redirection is used to serve the requested resource from another URL, so it is assumes that\n        no body is generated (and thus can be ignored). Even though generating a body is not prohibited.\n\n        For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually\n        (which means it's optional and not mandated) contain just an hyperlink to the value of\n        the Location response header, so the body can be ignored safely.\n\n        For status 300, which is \"Multiple Choices\", the spec mentions both generating a Location\n        response header AND a response body with the other possible location to follow.\n        Since the spec explicitly chooses not to specify a format for such body and leave it to\n        servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.\n      */\n    } else {\n      return this.handler.onData(chunk)\n    }\n  }\n\n  onComplete (trailers) {\n    if (this.location) {\n      /*\n        https://tools.ietf.org/html/rfc7231#section-6.4\n\n        TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections\n        and neither are useful if present.\n\n        See comment on onData method above for more detailed information.\n      */\n\n      this.location = null\n      this.abort = null\n\n      this.dispatch(this.opts, this)\n    } else {\n      this.handler.onComplete(trailers)\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this.handler.onBodySent) {\n      this.handler.onBodySent(chunk)\n    }\n  }\n}\n\nfunction parseLocation (statusCode, headers) {\n  if (redirectableStatusCodes.indexOf(statusCode) === -1) {\n    return null\n  }\n\n  for (let i = 0; i < headers.length; i += 2) {\n    if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') {\n      return headers[i + 1]\n    }\n  }\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4.4\nfunction shouldRemoveHeader (header, removeContent, unknownOrigin) {\n  if (header.length === 4) {\n    return util.headerNameToString(header) === 'host'\n  }\n  if (removeContent && util.headerNameToString(header).startsWith('content-')) {\n    return true\n  }\n  if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {\n    const name = util.headerNameToString(header)\n    return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'\n  }\n  return false\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4\nfunction cleanRequestHeaders (headers, removeContent, unknownOrigin) {\n  const ret = []\n  if (Array.isArray(headers)) {\n    for (let i = 0; i < headers.length; i += 2) {\n      if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n        ret.push(headers[i], headers[i + 1])\n      }\n    }\n  } else if (headers && typeof headers === 'object') {\n    for (const key of Object.keys(headers)) {\n      if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n        ret.push(key, headers[key])\n      }\n    }\n  } else {\n    assert(headers == null, 'headers must be an object or an array')\n  }\n  return ret\n}\n\nmodule.exports = RedirectHandler\n","'use strict'\nconst assert = require('node:assert')\n\nconst { kRetryHandlerDefaultRetry } = require('../core/symbols')\nconst { RequestRetryError } = require('../core/errors')\nconst {\n  isDisturbed,\n  parseHeaders,\n  parseRangeHeader,\n  wrapRequestBody\n} = require('../core/util')\n\nfunction calculateRetryAfterHeader (retryAfter) {\n  const current = Date.now()\n  return new Date(retryAfter).getTime() - current\n}\n\nclass RetryHandler {\n  constructor (opts, handlers) {\n    const { retryOptions, ...dispatchOpts } = opts\n    const {\n      // Retry scoped\n      retry: retryFn,\n      maxRetries,\n      maxTimeout,\n      minTimeout,\n      timeoutFactor,\n      // Response scoped\n      methods,\n      errorCodes,\n      retryAfter,\n      statusCodes\n    } = retryOptions ?? {}\n\n    this.dispatch = handlers.dispatch\n    this.handler = handlers.handler\n    this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }\n    this.abort = null\n    this.aborted = false\n    this.retryOpts = {\n      retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],\n      retryAfter: retryAfter ?? true,\n      maxTimeout: maxTimeout ?? 30 * 1000, // 30s,\n      minTimeout: minTimeout ?? 500, // .5s\n      timeoutFactor: timeoutFactor ?? 2,\n      maxRetries: maxRetries ?? 5,\n      // What errors we should retry\n      methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],\n      // Indicates which errors to retry\n      statusCodes: statusCodes ?? [500, 502, 503, 504, 429],\n      // List of errors to retry\n      errorCodes: errorCodes ?? [\n        'ECONNRESET',\n        'ECONNREFUSED',\n        'ENOTFOUND',\n        'ENETDOWN',\n        'ENETUNREACH',\n        'EHOSTDOWN',\n        'EHOSTUNREACH',\n        'EPIPE',\n        'UND_ERR_SOCKET'\n      ]\n    }\n\n    this.retryCount = 0\n    this.retryCountCheckpoint = 0\n    this.start = 0\n    this.end = null\n    this.etag = null\n    this.resume = null\n\n    // Handle possible onConnect duplication\n    this.handler.onConnect(reason => {\n      this.aborted = true\n      if (this.abort) {\n        this.abort(reason)\n      } else {\n        this.reason = reason\n      }\n    })\n  }\n\n  onRequestSent () {\n    if (this.handler.onRequestSent) {\n      this.handler.onRequestSent()\n    }\n  }\n\n  onUpgrade (statusCode, headers, socket) {\n    if (this.handler.onUpgrade) {\n      this.handler.onUpgrade(statusCode, headers, socket)\n    }\n  }\n\n  onConnect (abort) {\n    if (this.aborted) {\n      abort(this.reason)\n    } else {\n      this.abort = abort\n    }\n  }\n\n  onBodySent (chunk) {\n    if (this.handler.onBodySent) return this.handler.onBodySent(chunk)\n  }\n\n  static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {\n    const { statusCode, code, headers } = err\n    const { method, retryOptions } = opts\n    const {\n      maxRetries,\n      minTimeout,\n      maxTimeout,\n      timeoutFactor,\n      statusCodes,\n      errorCodes,\n      methods\n    } = retryOptions\n    const { counter } = state\n\n    // Any code that is not a Undici's originated and allowed to retry\n    if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) {\n      cb(err)\n      return\n    }\n\n    // If a set of method are provided and the current method is not in the list\n    if (Array.isArray(methods) && !methods.includes(method)) {\n      cb(err)\n      return\n    }\n\n    // If a set of status code are provided and the current status code is not in the list\n    if (\n      statusCode != null &&\n      Array.isArray(statusCodes) &&\n      !statusCodes.includes(statusCode)\n    ) {\n      cb(err)\n      return\n    }\n\n    // If we reached the max number of retries\n    if (counter > maxRetries) {\n      cb(err)\n      return\n    }\n\n    let retryAfterHeader = headers?.['retry-after']\n    if (retryAfterHeader) {\n      retryAfterHeader = Number(retryAfterHeader)\n      retryAfterHeader = Number.isNaN(retryAfterHeader)\n        ? calculateRetryAfterHeader(retryAfterHeader)\n        : retryAfterHeader * 1e3 // Retry-After is in seconds\n    }\n\n    const retryTimeout =\n      retryAfterHeader > 0\n        ? Math.min(retryAfterHeader, maxTimeout)\n        : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)\n\n    setTimeout(() => cb(null), retryTimeout)\n  }\n\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const headers = parseHeaders(rawHeaders)\n\n    this.retryCount += 1\n\n    if (statusCode >= 300) {\n      if (this.retryOpts.statusCodes.includes(statusCode) === false) {\n        return this.handler.onHeaders(\n          statusCode,\n          rawHeaders,\n          resume,\n          statusMessage\n        )\n      } else {\n        this.abort(\n          new RequestRetryError('Request failed', statusCode, {\n            headers,\n            data: {\n              count: this.retryCount\n            }\n          })\n        )\n        return false\n      }\n    }\n\n    // Checkpoint for resume from where we left it\n    if (this.resume != null) {\n      this.resume = null\n\n      // Only Partial Content 206 supposed to provide Content-Range,\n      // any other status code that partially consumed the payload\n      // should not be retry because it would result in downstream\n      // wrongly concatanete multiple responses.\n      if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {\n        this.abort(\n          new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      const contentRange = parseRangeHeader(headers['content-range'])\n      // If no content range\n      if (!contentRange) {\n        this.abort(\n          new RequestRetryError('Content-Range mismatch', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      // Let's start with a weak etag check\n      if (this.etag != null && this.etag !== headers.etag) {\n        this.abort(\n          new RequestRetryError('ETag mismatch', statusCode, {\n            headers,\n            data: { count: this.retryCount }\n          })\n        )\n        return false\n      }\n\n      const { start, size, end = size - 1 } = contentRange\n\n      assert(this.start === start, 'content-range mismatch')\n      assert(this.end == null || this.end === end, 'content-range mismatch')\n\n      this.resume = resume\n      return true\n    }\n\n    if (this.end == null) {\n      if (statusCode === 206) {\n        // First time we receive 206\n        const range = parseRangeHeader(headers['content-range'])\n\n        if (range == null) {\n          return this.handler.onHeaders(\n            statusCode,\n            rawHeaders,\n            resume,\n            statusMessage\n          )\n        }\n\n        const { start, size, end = size - 1 } = range\n        assert(\n          start != null && Number.isFinite(start),\n          'content-range mismatch'\n        )\n        assert(end != null && Number.isFinite(end), 'invalid content-length')\n\n        this.start = start\n        this.end = end\n      }\n\n      // We make our best to checkpoint the body for further range headers\n      if (this.end == null) {\n        const contentLength = headers['content-length']\n        this.end = contentLength != null ? Number(contentLength) - 1 : null\n      }\n\n      assert(Number.isFinite(this.start))\n      assert(\n        this.end == null || Number.isFinite(this.end),\n        'invalid content-length'\n      )\n\n      this.resume = resume\n      this.etag = headers.etag != null ? headers.etag : null\n\n      // Weak etags are not useful for comparison nor cache\n      // for instance not safe to assume if the response is byte-per-byte\n      // equal\n      if (this.etag != null && this.etag.startsWith('W/')) {\n        this.etag = null\n      }\n\n      return this.handler.onHeaders(\n        statusCode,\n        rawHeaders,\n        resume,\n        statusMessage\n      )\n    }\n\n    const err = new RequestRetryError('Request failed', statusCode, {\n      headers,\n      data: { count: this.retryCount }\n    })\n\n    this.abort(err)\n\n    return false\n  }\n\n  onData (chunk) {\n    this.start += chunk.length\n\n    return this.handler.onData(chunk)\n  }\n\n  onComplete (rawTrailers) {\n    this.retryCount = 0\n    return this.handler.onComplete(rawTrailers)\n  }\n\n  onError (err) {\n    if (this.aborted || isDisturbed(this.opts.body)) {\n      return this.handler.onError(err)\n    }\n\n    // We reconcile in case of a mix between network errors\n    // and server error response\n    if (this.retryCount - this.retryCountCheckpoint > 0) {\n      // We count the difference between the last checkpoint and the current retry count\n      this.retryCount =\n        this.retryCountCheckpoint +\n        (this.retryCount - this.retryCountCheckpoint)\n    } else {\n      this.retryCount += 1\n    }\n\n    this.retryOpts.retry(\n      err,\n      {\n        state: { counter: this.retryCount },\n        opts: { retryOptions: this.retryOpts, ...this.opts }\n      },\n      onRetry.bind(this)\n    )\n\n    function onRetry (err) {\n      if (err != null || this.aborted || isDisturbed(this.opts.body)) {\n        return this.handler.onError(err)\n      }\n\n      if (this.start !== 0) {\n        const headers = { range: `bytes=${this.start}-${this.end ?? ''}` }\n\n        // Weak etag check - weak etags will make comparison algorithms never match\n        if (this.etag != null) {\n          headers['if-match'] = this.etag\n        }\n\n        this.opts = {\n          ...this.opts,\n          headers: {\n            ...this.opts.headers,\n            ...headers\n          }\n        }\n      }\n\n      try {\n        this.retryCountCheckpoint = this.retryCount\n        this.dispatch(this.opts, this)\n      } catch (err) {\n        this.handler.onError(err)\n      }\n    }\n  }\n}\n\nmodule.exports = RetryHandler\n","'use strict'\nconst { isIP } = require('node:net')\nconst { lookup } = require('node:dns')\nconst DecoratorHandler = require('../handler/decorator-handler')\nconst { InvalidArgumentError, InformationalError } = require('../core/errors')\nconst maxInt = Math.pow(2, 31) - 1\n\nclass DNSInstance {\n  #maxTTL = 0\n  #maxItems = 0\n  #records = new Map()\n  dualStack = true\n  affinity = null\n  lookup = null\n  pick = null\n\n  constructor (opts) {\n    this.#maxTTL = opts.maxTTL\n    this.#maxItems = opts.maxItems\n    this.dualStack = opts.dualStack\n    this.affinity = opts.affinity\n    this.lookup = opts.lookup ?? this.#defaultLookup\n    this.pick = opts.pick ?? this.#defaultPick\n  }\n\n  get full () {\n    return this.#records.size === this.#maxItems\n  }\n\n  runLookup (origin, opts, cb) {\n    const ips = this.#records.get(origin.hostname)\n\n    // If full, we just return the origin\n    if (ips == null && this.full) {\n      cb(null, origin.origin)\n      return\n    }\n\n    const newOpts = {\n      affinity: this.affinity,\n      dualStack: this.dualStack,\n      lookup: this.lookup,\n      pick: this.pick,\n      ...opts.dns,\n      maxTTL: this.#maxTTL,\n      maxItems: this.#maxItems\n    }\n\n    // If no IPs we lookup\n    if (ips == null) {\n      this.lookup(origin, newOpts, (err, addresses) => {\n        if (err || addresses == null || addresses.length === 0) {\n          cb(err ?? new InformationalError('No DNS entries found'))\n          return\n        }\n\n        this.setRecords(origin, addresses)\n        const records = this.#records.get(origin.hostname)\n\n        const ip = this.pick(\n          origin,\n          records,\n          newOpts.affinity\n        )\n\n        let port\n        if (typeof ip.port === 'number') {\n          port = `:${ip.port}`\n        } else if (origin.port !== '') {\n          port = `:${origin.port}`\n        } else {\n          port = ''\n        }\n\n        cb(\n          null,\n          `${origin.protocol}//${\n            ip.family === 6 ? `[${ip.address}]` : ip.address\n          }${port}`\n        )\n      })\n    } else {\n      // If there's IPs we pick\n      const ip = this.pick(\n        origin,\n        ips,\n        newOpts.affinity\n      )\n\n      // If no IPs we lookup - deleting old records\n      if (ip == null) {\n        this.#records.delete(origin.hostname)\n        this.runLookup(origin, opts, cb)\n        return\n      }\n\n      let port\n      if (typeof ip.port === 'number') {\n        port = `:${ip.port}`\n      } else if (origin.port !== '') {\n        port = `:${origin.port}`\n      } else {\n        port = ''\n      }\n\n      cb(\n        null,\n        `${origin.protocol}//${\n          ip.family === 6 ? `[${ip.address}]` : ip.address\n        }${port}`\n      )\n    }\n  }\n\n  #defaultLookup (origin, opts, cb) {\n    lookup(\n      origin.hostname,\n      {\n        all: true,\n        family: this.dualStack === false ? this.affinity : 0,\n        order: 'ipv4first'\n      },\n      (err, addresses) => {\n        if (err) {\n          return cb(err)\n        }\n\n        const results = new Map()\n\n        for (const addr of addresses) {\n          // On linux we found duplicates, we attempt to remove them with\n          // the latest record\n          results.set(`${addr.address}:${addr.family}`, addr)\n        }\n\n        cb(null, results.values())\n      }\n    )\n  }\n\n  #defaultPick (origin, hostnameRecords, affinity) {\n    let ip = null\n    const { records, offset } = hostnameRecords\n\n    let family\n    if (this.dualStack) {\n      if (affinity == null) {\n        // Balance between ip families\n        if (offset == null || offset === maxInt) {\n          hostnameRecords.offset = 0\n          affinity = 4\n        } else {\n          hostnameRecords.offset++\n          affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4\n        }\n      }\n\n      if (records[affinity] != null && records[affinity].ips.length > 0) {\n        family = records[affinity]\n      } else {\n        family = records[affinity === 4 ? 6 : 4]\n      }\n    } else {\n      family = records[affinity]\n    }\n\n    // If no IPs we return null\n    if (family == null || family.ips.length === 0) {\n      return ip\n    }\n\n    if (family.offset == null || family.offset === maxInt) {\n      family.offset = 0\n    } else {\n      family.offset++\n    }\n\n    const position = family.offset % family.ips.length\n    ip = family.ips[position] ?? null\n\n    if (ip == null) {\n      return ip\n    }\n\n    if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms\n      // We delete expired records\n      // It is possible that they have different TTL, so we manage them individually\n      family.ips.splice(position, 1)\n      return this.pick(origin, hostnameRecords, affinity)\n    }\n\n    return ip\n  }\n\n  setRecords (origin, addresses) {\n    const timestamp = Date.now()\n    const records = { records: { 4: null, 6: null } }\n    for (const record of addresses) {\n      record.timestamp = timestamp\n      if (typeof record.ttl === 'number') {\n        // The record TTL is expected to be in ms\n        record.ttl = Math.min(record.ttl, this.#maxTTL)\n      } else {\n        record.ttl = this.#maxTTL\n      }\n\n      const familyRecords = records.records[record.family] ?? { ips: [] }\n\n      familyRecords.ips.push(record)\n      records.records[record.family] = familyRecords\n    }\n\n    this.#records.set(origin.hostname, records)\n  }\n\n  getHandler (meta, opts) {\n    return new DNSDispatchHandler(this, meta, opts)\n  }\n}\n\nclass DNSDispatchHandler extends DecoratorHandler {\n  #state = null\n  #opts = null\n  #dispatch = null\n  #handler = null\n  #origin = null\n\n  constructor (state, { origin, handler, dispatch }, opts) {\n    super(handler)\n    this.#origin = origin\n    this.#handler = handler\n    this.#opts = { ...opts }\n    this.#state = state\n    this.#dispatch = dispatch\n  }\n\n  onError (err) {\n    switch (err.code) {\n      case 'ETIMEDOUT':\n      case 'ECONNREFUSED': {\n        if (this.#state.dualStack) {\n          // We delete the record and retry\n          this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => {\n            if (err) {\n              return this.#handler.onError(err)\n            }\n\n            const dispatchOpts = {\n              ...this.#opts,\n              origin: newOrigin\n            }\n\n            this.#dispatch(dispatchOpts, this)\n          })\n\n          // if dual-stack disabled, we error out\n          return\n        }\n\n        this.#handler.onError(err)\n        return\n      }\n      case 'ENOTFOUND':\n        this.#state.deleteRecord(this.#origin)\n      // eslint-disable-next-line no-fallthrough\n      default:\n        this.#handler.onError(err)\n        break\n    }\n  }\n}\n\nmodule.exports = interceptorOpts => {\n  if (\n    interceptorOpts?.maxTTL != null &&\n    (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0)\n  ) {\n    throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number')\n  }\n\n  if (\n    interceptorOpts?.maxItems != null &&\n    (typeof interceptorOpts?.maxItems !== 'number' ||\n      interceptorOpts?.maxItems < 1)\n  ) {\n    throw new InvalidArgumentError(\n      'Invalid maxItems. Must be a positive number and greater than zero'\n    )\n  }\n\n  if (\n    interceptorOpts?.affinity != null &&\n    interceptorOpts?.affinity !== 4 &&\n    interceptorOpts?.affinity !== 6\n  ) {\n    throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6')\n  }\n\n  if (\n    interceptorOpts?.dualStack != null &&\n    typeof interceptorOpts?.dualStack !== 'boolean'\n  ) {\n    throw new InvalidArgumentError('Invalid dualStack. Must be a boolean')\n  }\n\n  if (\n    interceptorOpts?.lookup != null &&\n    typeof interceptorOpts?.lookup !== 'function'\n  ) {\n    throw new InvalidArgumentError('Invalid lookup. Must be a function')\n  }\n\n  if (\n    interceptorOpts?.pick != null &&\n    typeof interceptorOpts?.pick !== 'function'\n  ) {\n    throw new InvalidArgumentError('Invalid pick. Must be a function')\n  }\n\n  const dualStack = interceptorOpts?.dualStack ?? true\n  let affinity\n  if (dualStack) {\n    affinity = interceptorOpts?.affinity ?? null\n  } else {\n    affinity = interceptorOpts?.affinity ?? 4\n  }\n\n  const opts = {\n    maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms\n    lookup: interceptorOpts?.lookup ?? null,\n    pick: interceptorOpts?.pick ?? null,\n    dualStack,\n    affinity,\n    maxItems: interceptorOpts?.maxItems ?? Infinity\n  }\n\n  const instance = new DNSInstance(opts)\n\n  return dispatch => {\n    return function dnsInterceptor (origDispatchOpts, handler) {\n      const origin =\n        origDispatchOpts.origin.constructor === URL\n          ? origDispatchOpts.origin\n          : new URL(origDispatchOpts.origin)\n\n      if (isIP(origin.hostname) !== 0) {\n        return dispatch(origDispatchOpts, handler)\n      }\n\n      instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {\n        if (err) {\n          return handler.onError(err)\n        }\n\n        let dispatchOpts = null\n        dispatchOpts = {\n          ...origDispatchOpts,\n          servername: origin.hostname, // For SNI on TLS\n          origin: newOrigin,\n          headers: {\n            host: origin.hostname,\n            ...origDispatchOpts.headers\n          }\n        }\n\n        dispatch(\n          dispatchOpts,\n          instance.getHandler({ origin, dispatch, handler }, origDispatchOpts)\n        )\n      })\n\n      return true\n    }\n  }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst DecoratorHandler = require('../handler/decorator-handler')\n\nclass DumpHandler extends DecoratorHandler {\n  #maxSize = 1024 * 1024\n  #abort = null\n  #dumped = false\n  #aborted = false\n  #size = 0\n  #reason = null\n  #handler = null\n\n  constructor ({ maxSize }, handler) {\n    super(handler)\n\n    if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {\n      throw new InvalidArgumentError('maxSize must be a number greater than 0')\n    }\n\n    this.#maxSize = maxSize ?? this.#maxSize\n    this.#handler = handler\n  }\n\n  onConnect (abort) {\n    this.#abort = abort\n\n    this.#handler.onConnect(this.#customAbort.bind(this))\n  }\n\n  #customAbort (reason) {\n    this.#aborted = true\n    this.#reason = reason\n  }\n\n  // TODO: will require adjustment after new hooks are out\n  onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n    const headers = util.parseHeaders(rawHeaders)\n    const contentLength = headers['content-length']\n\n    if (contentLength != null && contentLength > this.#maxSize) {\n      throw new RequestAbortedError(\n        `Response size (${contentLength}) larger than maxSize (${\n          this.#maxSize\n        })`\n      )\n    }\n\n    if (this.#aborted) {\n      return true\n    }\n\n    return this.#handler.onHeaders(\n      statusCode,\n      rawHeaders,\n      resume,\n      statusMessage\n    )\n  }\n\n  onError (err) {\n    if (this.#dumped) {\n      return\n    }\n\n    err = this.#reason ?? err\n\n    this.#handler.onError(err)\n  }\n\n  onData (chunk) {\n    this.#size = this.#size + chunk.length\n\n    if (this.#size >= this.#maxSize) {\n      this.#dumped = true\n\n      if (this.#aborted) {\n        this.#handler.onError(this.#reason)\n      } else {\n        this.#handler.onComplete([])\n      }\n    }\n\n    return true\n  }\n\n  onComplete (trailers) {\n    if (this.#dumped) {\n      return\n    }\n\n    if (this.#aborted) {\n      this.#handler.onError(this.reason)\n      return\n    }\n\n    this.#handler.onComplete(trailers)\n  }\n}\n\nfunction createDumpInterceptor (\n  { maxSize: defaultMaxSize } = {\n    maxSize: 1024 * 1024\n  }\n) {\n  return dispatch => {\n    return function Intercept (opts, handler) {\n      const { dumpMaxSize = defaultMaxSize } =\n        opts\n\n      const dumpHandler = new DumpHandler(\n        { maxSize: dumpMaxSize },\n        handler\n      )\n\n      return dispatch(opts, dumpHandler)\n    }\n  }\n}\n\nmodule.exports = createDumpInterceptor\n","'use strict'\n\nconst RedirectHandler = require('../handler/redirect-handler')\n\nfunction createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {\n  return (dispatch) => {\n    return function Intercept (opts, handler) {\n      const { maxRedirections = defaultMaxRedirections } = opts\n\n      if (!maxRedirections) {\n        return dispatch(opts, handler)\n      }\n\n      const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)\n      opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.\n      return dispatch(opts, redirectHandler)\n    }\n  }\n}\n\nmodule.exports = createRedirectInterceptor\n","'use strict'\nconst RedirectHandler = require('../handler/redirect-handler')\n\nmodule.exports = opts => {\n  const globalMaxRedirections = opts?.maxRedirections\n  return dispatch => {\n    return function redirectInterceptor (opts, handler) {\n      const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts\n\n      if (!maxRedirections) {\n        return dispatch(opts, handler)\n      }\n\n      const redirectHandler = new RedirectHandler(\n        dispatch,\n        maxRedirections,\n        opts,\n        handler\n      )\n\n      return dispatch(baseOpts, redirectHandler)\n    }\n  }\n}\n","'use strict'\nconst RetryHandler = require('../handler/retry-handler')\n\nmodule.exports = globalOpts => {\n  return dispatch => {\n    return function retryInterceptor (opts, handler) {\n      return dispatch(\n        opts,\n        new RetryHandler(\n          { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },\n          {\n            handler,\n            dispatch\n          }\n        )\n      )\n    }\n  }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;\nconst utils_1 = require(\"./utils\");\n// C headers\nvar ERROR;\n(function (ERROR) {\n    ERROR[ERROR[\"OK\"] = 0] = \"OK\";\n    ERROR[ERROR[\"INTERNAL\"] = 1] = \"INTERNAL\";\n    ERROR[ERROR[\"STRICT\"] = 2] = \"STRICT\";\n    ERROR[ERROR[\"LF_EXPECTED\"] = 3] = \"LF_EXPECTED\";\n    ERROR[ERROR[\"UNEXPECTED_CONTENT_LENGTH\"] = 4] = \"UNEXPECTED_CONTENT_LENGTH\";\n    ERROR[ERROR[\"CLOSED_CONNECTION\"] = 5] = \"CLOSED_CONNECTION\";\n    ERROR[ERROR[\"INVALID_METHOD\"] = 6] = \"INVALID_METHOD\";\n    ERROR[ERROR[\"INVALID_URL\"] = 7] = \"INVALID_URL\";\n    ERROR[ERROR[\"INVALID_CONSTANT\"] = 8] = \"INVALID_CONSTANT\";\n    ERROR[ERROR[\"INVALID_VERSION\"] = 9] = \"INVALID_VERSION\";\n    ERROR[ERROR[\"INVALID_HEADER_TOKEN\"] = 10] = \"INVALID_HEADER_TOKEN\";\n    ERROR[ERROR[\"INVALID_CONTENT_LENGTH\"] = 11] = \"INVALID_CONTENT_LENGTH\";\n    ERROR[ERROR[\"INVALID_CHUNK_SIZE\"] = 12] = \"INVALID_CHUNK_SIZE\";\n    ERROR[ERROR[\"INVALID_STATUS\"] = 13] = \"INVALID_STATUS\";\n    ERROR[ERROR[\"INVALID_EOF_STATE\"] = 14] = \"INVALID_EOF_STATE\";\n    ERROR[ERROR[\"INVALID_TRANSFER_ENCODING\"] = 15] = \"INVALID_TRANSFER_ENCODING\";\n    ERROR[ERROR[\"CB_MESSAGE_BEGIN\"] = 16] = \"CB_MESSAGE_BEGIN\";\n    ERROR[ERROR[\"CB_HEADERS_COMPLETE\"] = 17] = \"CB_HEADERS_COMPLETE\";\n    ERROR[ERROR[\"CB_MESSAGE_COMPLETE\"] = 18] = \"CB_MESSAGE_COMPLETE\";\n    ERROR[ERROR[\"CB_CHUNK_HEADER\"] = 19] = \"CB_CHUNK_HEADER\";\n    ERROR[ERROR[\"CB_CHUNK_COMPLETE\"] = 20] = \"CB_CHUNK_COMPLETE\";\n    ERROR[ERROR[\"PAUSED\"] = 21] = \"PAUSED\";\n    ERROR[ERROR[\"PAUSED_UPGRADE\"] = 22] = \"PAUSED_UPGRADE\";\n    ERROR[ERROR[\"PAUSED_H2_UPGRADE\"] = 23] = \"PAUSED_H2_UPGRADE\";\n    ERROR[ERROR[\"USER\"] = 24] = \"USER\";\n})(ERROR = exports.ERROR || (exports.ERROR = {}));\nvar TYPE;\n(function (TYPE) {\n    TYPE[TYPE[\"BOTH\"] = 0] = \"BOTH\";\n    TYPE[TYPE[\"REQUEST\"] = 1] = \"REQUEST\";\n    TYPE[TYPE[\"RESPONSE\"] = 2] = \"RESPONSE\";\n})(TYPE = exports.TYPE || (exports.TYPE = {}));\nvar FLAGS;\n(function (FLAGS) {\n    FLAGS[FLAGS[\"CONNECTION_KEEP_ALIVE\"] = 1] = \"CONNECTION_KEEP_ALIVE\";\n    FLAGS[FLAGS[\"CONNECTION_CLOSE\"] = 2] = \"CONNECTION_CLOSE\";\n    FLAGS[FLAGS[\"CONNECTION_UPGRADE\"] = 4] = \"CONNECTION_UPGRADE\";\n    FLAGS[FLAGS[\"CHUNKED\"] = 8] = \"CHUNKED\";\n    FLAGS[FLAGS[\"UPGRADE\"] = 16] = \"UPGRADE\";\n    FLAGS[FLAGS[\"CONTENT_LENGTH\"] = 32] = \"CONTENT_LENGTH\";\n    FLAGS[FLAGS[\"SKIPBODY\"] = 64] = \"SKIPBODY\";\n    FLAGS[FLAGS[\"TRAILING\"] = 128] = \"TRAILING\";\n    // 1 << 8 is unused\n    FLAGS[FLAGS[\"TRANSFER_ENCODING\"] = 512] = \"TRANSFER_ENCODING\";\n})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));\nvar LENIENT_FLAGS;\n(function (LENIENT_FLAGS) {\n    LENIENT_FLAGS[LENIENT_FLAGS[\"HEADERS\"] = 1] = \"HEADERS\";\n    LENIENT_FLAGS[LENIENT_FLAGS[\"CHUNKED_LENGTH\"] = 2] = \"CHUNKED_LENGTH\";\n    LENIENT_FLAGS[LENIENT_FLAGS[\"KEEP_ALIVE\"] = 4] = \"KEEP_ALIVE\";\n})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));\nvar METHODS;\n(function (METHODS) {\n    METHODS[METHODS[\"DELETE\"] = 0] = \"DELETE\";\n    METHODS[METHODS[\"GET\"] = 1] = \"GET\";\n    METHODS[METHODS[\"HEAD\"] = 2] = \"HEAD\";\n    METHODS[METHODS[\"POST\"] = 3] = \"POST\";\n    METHODS[METHODS[\"PUT\"] = 4] = \"PUT\";\n    /* pathological */\n    METHODS[METHODS[\"CONNECT\"] = 5] = \"CONNECT\";\n    METHODS[METHODS[\"OPTIONS\"] = 6] = \"OPTIONS\";\n    METHODS[METHODS[\"TRACE\"] = 7] = \"TRACE\";\n    /* WebDAV */\n    METHODS[METHODS[\"COPY\"] = 8] = \"COPY\";\n    METHODS[METHODS[\"LOCK\"] = 9] = \"LOCK\";\n    METHODS[METHODS[\"MKCOL\"] = 10] = \"MKCOL\";\n    METHODS[METHODS[\"MOVE\"] = 11] = \"MOVE\";\n    METHODS[METHODS[\"PROPFIND\"] = 12] = \"PROPFIND\";\n    METHODS[METHODS[\"PROPPATCH\"] = 13] = \"PROPPATCH\";\n    METHODS[METHODS[\"SEARCH\"] = 14] = \"SEARCH\";\n    METHODS[METHODS[\"UNLOCK\"] = 15] = \"UNLOCK\";\n    METHODS[METHODS[\"BIND\"] = 16] = \"BIND\";\n    METHODS[METHODS[\"REBIND\"] = 17] = \"REBIND\";\n    METHODS[METHODS[\"UNBIND\"] = 18] = \"UNBIND\";\n    METHODS[METHODS[\"ACL\"] = 19] = \"ACL\";\n    /* subversion */\n    METHODS[METHODS[\"REPORT\"] = 20] = \"REPORT\";\n    METHODS[METHODS[\"MKACTIVITY\"] = 21] = \"MKACTIVITY\";\n    METHODS[METHODS[\"CHECKOUT\"] = 22] = \"CHECKOUT\";\n    METHODS[METHODS[\"MERGE\"] = 23] = \"MERGE\";\n    /* upnp */\n    METHODS[METHODS[\"M-SEARCH\"] = 24] = \"M-SEARCH\";\n    METHODS[METHODS[\"NOTIFY\"] = 25] = \"NOTIFY\";\n    METHODS[METHODS[\"SUBSCRIBE\"] = 26] = \"SUBSCRIBE\";\n    METHODS[METHODS[\"UNSUBSCRIBE\"] = 27] = \"UNSUBSCRIBE\";\n    /* RFC-5789 */\n    METHODS[METHODS[\"PATCH\"] = 28] = \"PATCH\";\n    METHODS[METHODS[\"PURGE\"] = 29] = \"PURGE\";\n    /* CalDAV */\n    METHODS[METHODS[\"MKCALENDAR\"] = 30] = \"MKCALENDAR\";\n    /* RFC-2068, section 19.6.1.2 */\n    METHODS[METHODS[\"LINK\"] = 31] = \"LINK\";\n    METHODS[METHODS[\"UNLINK\"] = 32] = \"UNLINK\";\n    /* icecast */\n    METHODS[METHODS[\"SOURCE\"] = 33] = \"SOURCE\";\n    /* RFC-7540, section 11.6 */\n    METHODS[METHODS[\"PRI\"] = 34] = \"PRI\";\n    /* RFC-2326 RTSP */\n    METHODS[METHODS[\"DESCRIBE\"] = 35] = \"DESCRIBE\";\n    METHODS[METHODS[\"ANNOUNCE\"] = 36] = \"ANNOUNCE\";\n    METHODS[METHODS[\"SETUP\"] = 37] = \"SETUP\";\n    METHODS[METHODS[\"PLAY\"] = 38] = \"PLAY\";\n    METHODS[METHODS[\"PAUSE\"] = 39] = \"PAUSE\";\n    METHODS[METHODS[\"TEARDOWN\"] = 40] = \"TEARDOWN\";\n    METHODS[METHODS[\"GET_PARAMETER\"] = 41] = \"GET_PARAMETER\";\n    METHODS[METHODS[\"SET_PARAMETER\"] = 42] = \"SET_PARAMETER\";\n    METHODS[METHODS[\"REDIRECT\"] = 43] = \"REDIRECT\";\n    METHODS[METHODS[\"RECORD\"] = 44] = \"RECORD\";\n    /* RAOP */\n    METHODS[METHODS[\"FLUSH\"] = 45] = \"FLUSH\";\n})(METHODS = exports.METHODS || (exports.METHODS = {}));\nexports.METHODS_HTTP = [\n    METHODS.DELETE,\n    METHODS.GET,\n    METHODS.HEAD,\n    METHODS.POST,\n    METHODS.PUT,\n    METHODS.CONNECT,\n    METHODS.OPTIONS,\n    METHODS.TRACE,\n    METHODS.COPY,\n    METHODS.LOCK,\n    METHODS.MKCOL,\n    METHODS.MOVE,\n    METHODS.PROPFIND,\n    METHODS.PROPPATCH,\n    METHODS.SEARCH,\n    METHODS.UNLOCK,\n    METHODS.BIND,\n    METHODS.REBIND,\n    METHODS.UNBIND,\n    METHODS.ACL,\n    METHODS.REPORT,\n    METHODS.MKACTIVITY,\n    METHODS.CHECKOUT,\n    METHODS.MERGE,\n    METHODS['M-SEARCH'],\n    METHODS.NOTIFY,\n    METHODS.SUBSCRIBE,\n    METHODS.UNSUBSCRIBE,\n    METHODS.PATCH,\n    METHODS.PURGE,\n    METHODS.MKCALENDAR,\n    METHODS.LINK,\n    METHODS.UNLINK,\n    METHODS.PRI,\n    // TODO(indutny): should we allow it with HTTP?\n    METHODS.SOURCE,\n];\nexports.METHODS_ICE = [\n    METHODS.SOURCE,\n];\nexports.METHODS_RTSP = [\n    METHODS.OPTIONS,\n    METHODS.DESCRIBE,\n    METHODS.ANNOUNCE,\n    METHODS.SETUP,\n    METHODS.PLAY,\n    METHODS.PAUSE,\n    METHODS.TEARDOWN,\n    METHODS.GET_PARAMETER,\n    METHODS.SET_PARAMETER,\n    METHODS.REDIRECT,\n    METHODS.RECORD,\n    METHODS.FLUSH,\n    // For AirPlay\n    METHODS.GET,\n    METHODS.POST,\n];\nexports.METHOD_MAP = utils_1.enumToMap(METHODS);\nexports.H_METHOD_MAP = {};\nObject.keys(exports.METHOD_MAP).forEach((key) => {\n    if (/^H/.test(key)) {\n        exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];\n    }\n});\nvar FINISH;\n(function (FINISH) {\n    FINISH[FINISH[\"SAFE\"] = 0] = \"SAFE\";\n    FINISH[FINISH[\"SAFE_WITH_CB\"] = 1] = \"SAFE_WITH_CB\";\n    FINISH[FINISH[\"UNSAFE\"] = 2] = \"UNSAFE\";\n})(FINISH = exports.FINISH || (exports.FINISH = {}));\nexports.ALPHA = [];\nfor (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {\n    // Upper case\n    exports.ALPHA.push(String.fromCharCode(i));\n    // Lower case\n    exports.ALPHA.push(String.fromCharCode(i + 0x20));\n}\nexports.NUM_MAP = {\n    0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n    5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n};\nexports.HEX_MAP = {\n    0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n    5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n    A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,\n    a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,\n};\nexports.NUM = [\n    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n];\nexports.ALPHANUM = exports.ALPHA.concat(exports.NUM);\nexports.MARK = ['-', '_', '.', '!', '~', '*', '\\'', '(', ')'];\nexports.USERINFO_CHARS = exports.ALPHANUM\n    .concat(exports.MARK)\n    .concat(['%', ';', ':', '&', '=', '+', '$', ',']);\n// TODO(indutny): use RFC\nexports.STRICT_URL_CHAR = [\n    '!', '\"', '$', '%', '&', '\\'',\n    '(', ')', '*', '+', ',', '-', '.', '/',\n    ':', ';', '<', '=', '>',\n    '@', '[', '\\\\', ']', '^', '_',\n    '`',\n    '{', '|', '}', '~',\n].concat(exports.ALPHANUM);\nexports.URL_CHAR = exports.STRICT_URL_CHAR\n    .concat(['\\t', '\\f']);\n// All characters with 0x80 bit set to 1\nfor (let i = 0x80; i <= 0xff; i++) {\n    exports.URL_CHAR.push(i);\n}\nexports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);\n/* Tokens as defined by rfc 2616. Also lowercases them.\n *        token       = 1*\n *     separators     = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n *                    | \",\" | \";\" | \":\" | \"\\\" | <\">\n *                    | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n *                    | \"{\" | \"}\" | SP | HT\n */\nexports.STRICT_TOKEN = [\n    '!', '#', '$', '%', '&', '\\'',\n    '*', '+', '-', '.',\n    '^', '_', '`',\n    '|', '~',\n].concat(exports.ALPHANUM);\nexports.TOKEN = exports.STRICT_TOKEN.concat([' ']);\n/*\n * Verify that a char is a valid visible (printable) US-ASCII\n * character or %x80-FF\n */\nexports.HEADER_CHARS = ['\\t'];\nfor (let i = 32; i <= 255; i++) {\n    if (i !== 127) {\n        exports.HEADER_CHARS.push(i);\n    }\n}\n// ',' = \\x44\nexports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);\nexports.MAJOR = exports.NUM_MAP;\nexports.MINOR = exports.MAJOR;\nvar HEADER_STATE;\n(function (HEADER_STATE) {\n    HEADER_STATE[HEADER_STATE[\"GENERAL\"] = 0] = \"GENERAL\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION\"] = 1] = \"CONNECTION\";\n    HEADER_STATE[HEADER_STATE[\"CONTENT_LENGTH\"] = 2] = \"CONTENT_LENGTH\";\n    HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING\"] = 3] = \"TRANSFER_ENCODING\";\n    HEADER_STATE[HEADER_STATE[\"UPGRADE\"] = 4] = \"UPGRADE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_KEEP_ALIVE\"] = 5] = \"CONNECTION_KEEP_ALIVE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_CLOSE\"] = 6] = \"CONNECTION_CLOSE\";\n    HEADER_STATE[HEADER_STATE[\"CONNECTION_UPGRADE\"] = 7] = \"CONNECTION_UPGRADE\";\n    HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING_CHUNKED\"] = 8] = \"TRANSFER_ENCODING_CHUNKED\";\n})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));\nexports.SPECIAL_HEADERS = {\n    'connection': HEADER_STATE.CONNECTION,\n    'content-length': HEADER_STATE.CONTENT_LENGTH,\n    'proxy-connection': HEADER_STATE.CONNECTION,\n    'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,\n    'upgrade': HEADER_STATE.UPGRADE,\n};\n//# sourceMappingURL=constants.js.map","'use strict'\n\nconst { Buffer } = require('node:buffer')\n\nmodule.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0d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AANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAk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wBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdH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HFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQA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wMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAk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MDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64')\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enumToMap = void 0;\nfunction enumToMap(obj) {\n    const res = {};\n    Object.keys(obj).forEach((key) => {\n        const value = obj[key];\n        if (typeof value === 'number') {\n            res[key] = value;\n        }\n    });\n    return res;\n}\nexports.enumToMap = enumToMap;\n//# sourceMappingURL=utils.js.map","'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../dispatcher/agent')\nconst {\n  kAgent,\n  kMockAgentSet,\n  kMockAgentGet,\n  kDispatches,\n  kIsMockActive,\n  kNetConnect,\n  kGetNetConnect,\n  kOptions,\n  kFactory\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, buildMockOptions } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher/dispatcher')\nconst Pluralizer = require('./pluralizer')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\n\nclass MockAgent extends Dispatcher {\n  constructor (opts) {\n    super(opts)\n\n    this[kNetConnect] = true\n    this[kIsMockActive] = true\n\n    // Instantiate Agent and encapsulate\n    if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n    const agent = opts?.agent ? opts.agent : new Agent(opts)\n    this[kAgent] = agent\n\n    this[kClients] = agent[kClients]\n    this[kOptions] = buildMockOptions(opts)\n  }\n\n  get (origin) {\n    let dispatcher = this[kMockAgentGet](origin)\n\n    if (!dispatcher) {\n      dispatcher = this[kFactory](origin)\n      this[kMockAgentSet](origin, dispatcher)\n    }\n    return dispatcher\n  }\n\n  dispatch (opts, handler) {\n    // Call MockAgent.get to perform additional setup before dispatching as normal\n    this.get(opts.origin)\n    return this[kAgent].dispatch(opts, handler)\n  }\n\n  async close () {\n    await this[kAgent].close()\n    this[kClients].clear()\n  }\n\n  deactivate () {\n    this[kIsMockActive] = false\n  }\n\n  activate () {\n    this[kIsMockActive] = true\n  }\n\n  enableNetConnect (matcher) {\n    if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n      if (Array.isArray(this[kNetConnect])) {\n        this[kNetConnect].push(matcher)\n      } else {\n        this[kNetConnect] = [matcher]\n      }\n    } else if (typeof matcher === 'undefined') {\n      this[kNetConnect] = true\n    } else {\n      throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n    }\n  }\n\n  disableNetConnect () {\n    this[kNetConnect] = false\n  }\n\n  // This is required to bypass issues caused by using global symbols - see:\n  // https://github.com/nodejs/undici/issues/1447\n  get isMockActive () {\n    return this[kIsMockActive]\n  }\n\n  [kMockAgentSet] (origin, dispatcher) {\n    this[kClients].set(origin, dispatcher)\n  }\n\n  [kFactory] (origin) {\n    const mockOptions = Object.assign({ agent: this }, this[kOptions])\n    return this[kOptions] && this[kOptions].connections === 1\n      ? new MockClient(origin, mockOptions)\n      : new MockPool(origin, mockOptions)\n  }\n\n  [kMockAgentGet] (origin) {\n    // First check if we can immediately find it\n    const client = this[kClients].get(origin)\n    if (client) {\n      return client\n    }\n\n    // If the origin is not a string create a dummy parent pool and return to user\n    if (typeof origin !== 'string') {\n      const dispatcher = this[kFactory]('http://localhost:9999')\n      this[kMockAgentSet](origin, dispatcher)\n      return dispatcher\n    }\n\n    // If we match, create a pool and assign the same dispatches\n    for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) {\n      if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n        const dispatcher = this[kFactory](origin)\n        this[kMockAgentSet](origin, dispatcher)\n        dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]\n        return dispatcher\n      }\n    }\n  }\n\n  [kGetNetConnect] () {\n    return this[kNetConnect]\n  }\n\n  pendingInterceptors () {\n    const mockAgentClients = this[kClients]\n\n    return Array.from(mockAgentClients.entries())\n      .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n      .filter(({ pending }) => pending)\n  }\n\n  assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n    const pending = this.pendingInterceptors()\n\n    if (pending.length === 0) {\n      return\n    }\n\n    const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)\n\n    throw new UndiciError(`\n${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:\n\n${pendingInterceptorsFormatter.format(pending)}\n`.trim())\n  }\n}\n\nmodule.exports = MockAgent\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Client = require('../dispatcher/client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kMockAgent,\n  kClose,\n  kOriginalClose,\n  kOrigin,\n  kOriginalDispatch,\n  kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n  constructor (origin, opts) {\n    super(origin, opts)\n\n    if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n\n    this[kMockAgent] = opts.agent\n    this[kOrigin] = origin\n    this[kDispatches] = []\n    this[kConnected] = 1\n    this[kOriginalDispatch] = this.dispatch\n    this[kOriginalClose] = this.close.bind(this)\n\n    this.dispatch = buildMockDispatch.call(this)\n    this.close = this[kClose]\n  }\n\n  get [Symbols.kConnected] () {\n    return this[kConnected]\n  }\n\n  /**\n   * Sets up the base interceptor for mocking replies from undici.\n   */\n  intercept (opts) {\n    return new MockInterceptor(opts, this[kDispatches])\n  }\n\n  async [kClose] () {\n    await promisify(this[kOriginalClose])()\n    this[kConnected] = 0\n    this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n  }\n}\n\nmodule.exports = MockClient\n","'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nconst kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')\n\n/**\n * The request does not match any registered mock dispatches.\n */\nclass MockNotMatchedError extends UndiciError {\n  constructor (message) {\n    super(message)\n    Error.captureStackTrace(this, MockNotMatchedError)\n    this.name = 'MockNotMatchedError'\n    this.message = message || 'The request does not match any registered mock dispatches'\n    this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n  }\n\n  static [Symbol.hasInstance] (instance) {\n    return instance && instance[kMockNotMatchedError] === true\n  }\n\n  [kMockNotMatchedError] = true\n}\n\nmodule.exports = {\n  MockNotMatchedError\n}\n","'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kDispatchKey,\n  kDefaultHeaders,\n  kDefaultTrailers,\n  kContentLength,\n  kMockDispatch\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { buildURL } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n  constructor (mockDispatch) {\n    this[kMockDispatch] = mockDispatch\n  }\n\n  /**\n   * Delay a reply by a set amount in ms.\n   */\n  delay (waitInMs) {\n    if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n      throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n    }\n\n    this[kMockDispatch].delay = waitInMs\n    return this\n  }\n\n  /**\n   * For a defined reply, never mark as consumed.\n   */\n  persist () {\n    this[kMockDispatch].persist = true\n    return this\n  }\n\n  /**\n   * Allow one to define a reply for a set amount of matching requests.\n   */\n  times (repeatTimes) {\n    if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n      throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n    }\n\n    this[kMockDispatch].times = repeatTimes\n    return this\n  }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n  constructor (opts, mockDispatches) {\n    if (typeof opts !== 'object') {\n      throw new InvalidArgumentError('opts must be an object')\n    }\n    if (typeof opts.path === 'undefined') {\n      throw new InvalidArgumentError('opts.path must be defined')\n    }\n    if (typeof opts.method === 'undefined') {\n      opts.method = 'GET'\n    }\n    // See https://github.com/nodejs/undici/issues/1245\n    // As per RFC 3986, clients are not supposed to send URI\n    // fragments to servers when they retrieve a document,\n    if (typeof opts.path === 'string') {\n      if (opts.query) {\n        opts.path = buildURL(opts.path, opts.query)\n      } else {\n        // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811\n        const parsedURL = new URL(opts.path, 'data://')\n        opts.path = parsedURL.pathname + parsedURL.search\n      }\n    }\n    if (typeof opts.method === 'string') {\n      opts.method = opts.method.toUpperCase()\n    }\n\n    this[kDispatchKey] = buildKey(opts)\n    this[kDispatches] = mockDispatches\n    this[kDefaultHeaders] = {}\n    this[kDefaultTrailers] = {}\n    this[kContentLength] = false\n  }\n\n  createMockScopeDispatchData ({ statusCode, data, responseOptions }) {\n    const responseData = getResponseData(data)\n    const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n    const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n    const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n    return { statusCode, data, headers, trailers }\n  }\n\n  validateReplyParameters (replyParameters) {\n    if (typeof replyParameters.statusCode === 'undefined') {\n      throw new InvalidArgumentError('statusCode must be defined')\n    }\n    if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) {\n      throw new InvalidArgumentError('responseOptions must be an object')\n    }\n  }\n\n  /**\n   * Mock an undici request with a defined reply.\n   */\n  reply (replyOptionsCallbackOrStatusCode) {\n    // Values of reply aren't available right now as they\n    // can only be available when the reply callback is invoked.\n    if (typeof replyOptionsCallbackOrStatusCode === 'function') {\n      // We'll first wrap the provided callback in another function,\n      // this function will properly resolve the data from the callback\n      // when invoked.\n      const wrappedDefaultsCallback = (opts) => {\n        // Our reply options callback contains the parameter for statusCode, data and options.\n        const resolvedData = replyOptionsCallbackOrStatusCode(opts)\n\n        // Check if it is in the right format\n        if (typeof resolvedData !== 'object' || resolvedData === null) {\n          throw new InvalidArgumentError('reply options callback must return an object')\n        }\n\n        const replyParameters = { data: '', responseOptions: {}, ...resolvedData }\n        this.validateReplyParameters(replyParameters)\n        // Since the values can be obtained immediately we return them\n        // from this higher order function that will be resolved later.\n        return {\n          ...this.createMockScopeDispatchData(replyParameters)\n        }\n      }\n\n      // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n      const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)\n      return new MockScope(newMockDispatch)\n    }\n\n    // We can have either one or three parameters, if we get here,\n    // we should have 1-3 parameters. So we spread the arguments of\n    // this function to obtain the parameters, since replyData will always\n    // just be the statusCode.\n    const replyParameters = {\n      statusCode: replyOptionsCallbackOrStatusCode,\n      data: arguments[1] === undefined ? '' : arguments[1],\n      responseOptions: arguments[2] === undefined ? {} : arguments[2]\n    }\n    this.validateReplyParameters(replyParameters)\n\n    // Send in-already provided data like usual\n    const dispatchData = this.createMockScopeDispatchData(replyParameters)\n    const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)\n    return new MockScope(newMockDispatch)\n  }\n\n  /**\n   * Mock an undici request with a defined error.\n   */\n  replyWithError (error) {\n    if (typeof error === 'undefined') {\n      throw new InvalidArgumentError('error must be defined')\n    }\n\n    const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })\n    return new MockScope(newMockDispatch)\n  }\n\n  /**\n   * Set default reply headers on the interceptor for subsequent replies\n   */\n  defaultReplyHeaders (headers) {\n    if (typeof headers === 'undefined') {\n      throw new InvalidArgumentError('headers must be defined')\n    }\n\n    this[kDefaultHeaders] = headers\n    return this\n  }\n\n  /**\n   * Set default reply trailers on the interceptor for subsequent replies\n   */\n  defaultReplyTrailers (trailers) {\n    if (typeof trailers === 'undefined') {\n      throw new InvalidArgumentError('trailers must be defined')\n    }\n\n    this[kDefaultTrailers] = trailers\n    return this\n  }\n\n  /**\n   * Set reply content length header for replies on the interceptor\n   */\n  replyContentLength () {\n    this[kContentLength] = true\n    return this\n  }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Pool = require('../dispatcher/pool')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n  kDispatches,\n  kMockAgent,\n  kClose,\n  kOriginalClose,\n  kOrigin,\n  kOriginalDispatch,\n  kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockPool provides an API that extends the Pool to influence the mockDispatches.\n */\nclass MockPool extends Pool {\n  constructor (origin, opts) {\n    super(origin, opts)\n\n    if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n      throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n    }\n\n    this[kMockAgent] = opts.agent\n    this[kOrigin] = origin\n    this[kDispatches] = []\n    this[kConnected] = 1\n    this[kOriginalDispatch] = this.dispatch\n    this[kOriginalClose] = this.close.bind(this)\n\n    this.dispatch = buildMockDispatch.call(this)\n    this.close = this[kClose]\n  }\n\n  get [Symbols.kConnected] () {\n    return this[kConnected]\n  }\n\n  /**\n   * Sets up the base interceptor for mocking replies from undici.\n   */\n  intercept (opts) {\n    return new MockInterceptor(opts, this[kDispatches])\n  }\n\n  async [kClose] () {\n    await promisify(this[kOriginalClose])()\n    this[kConnected] = 0\n    this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n  }\n}\n\nmodule.exports = MockPool\n","'use strict'\n\nmodule.exports = {\n  kAgent: Symbol('agent'),\n  kOptions: Symbol('options'),\n  kFactory: Symbol('factory'),\n  kDispatches: Symbol('dispatches'),\n  kDispatchKey: Symbol('dispatch key'),\n  kDefaultHeaders: Symbol('default headers'),\n  kDefaultTrailers: Symbol('default trailers'),\n  kContentLength: Symbol('content length'),\n  kMockAgent: Symbol('mock agent'),\n  kMockAgentSet: Symbol('mock agent set'),\n  kMockAgentGet: Symbol('mock agent get'),\n  kMockDispatch: Symbol('mock dispatch'),\n  kClose: Symbol('close'),\n  kOriginalClose: Symbol('original agent close'),\n  kOrigin: Symbol('origin'),\n  kIsMockActive: Symbol('is mock active'),\n  kNetConnect: Symbol('net connect'),\n  kGetNetConnect: Symbol('get net connect'),\n  kConnected: Symbol('connected')\n}\n","'use strict'\n\nconst { MockNotMatchedError } = require('./mock-errors')\nconst {\n  kDispatches,\n  kMockAgent,\n  kOriginalDispatch,\n  kOrigin,\n  kGetNetConnect\n} = require('./mock-symbols')\nconst { buildURL } = require('../core/util')\nconst { STATUS_CODES } = require('node:http')\nconst {\n  types: {\n    isPromise\n  }\n} = require('node:util')\n\nfunction matchValue (match, value) {\n  if (typeof match === 'string') {\n    return match === value\n  }\n  if (match instanceof RegExp) {\n    return match.test(value)\n  }\n  if (typeof match === 'function') {\n    return match(value) === true\n  }\n  return false\n}\n\nfunction lowerCaseEntries (headers) {\n  return Object.fromEntries(\n    Object.entries(headers).map(([headerName, headerValue]) => {\n      return [headerName.toLocaleLowerCase(), headerValue]\n    })\n  )\n}\n\n/**\n * @param {import('../../index').Headers|string[]|Record} headers\n * @param {string} key\n */\nfunction getHeaderByName (headers, key) {\n  if (Array.isArray(headers)) {\n    for (let i = 0; i < headers.length; i += 2) {\n      if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {\n        return headers[i + 1]\n      }\n    }\n\n    return undefined\n  } else if (typeof headers.get === 'function') {\n    return headers.get(key)\n  } else {\n    return lowerCaseEntries(headers)[key.toLocaleLowerCase()]\n  }\n}\n\n/** @param {string[]} headers */\nfunction buildHeadersFromArray (headers) { // fetch HeadersList\n  const clone = headers.slice()\n  const entries = []\n  for (let index = 0; index < clone.length; index += 2) {\n    entries.push([clone[index], clone[index + 1]])\n  }\n  return Object.fromEntries(entries)\n}\n\nfunction matchHeaders (mockDispatch, headers) {\n  if (typeof mockDispatch.headers === 'function') {\n    if (Array.isArray(headers)) { // fetch HeadersList\n      headers = buildHeadersFromArray(headers)\n    }\n    return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})\n  }\n  if (typeof mockDispatch.headers === 'undefined') {\n    return true\n  }\n  if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {\n    return false\n  }\n\n  for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {\n    const headerValue = getHeaderByName(headers, matchHeaderName)\n\n    if (!matchValue(matchHeaderValue, headerValue)) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction safeUrl (path) {\n  if (typeof path !== 'string') {\n    return path\n  }\n\n  const pathSegments = path.split('?')\n\n  if (pathSegments.length !== 2) {\n    return path\n  }\n\n  const qp = new URLSearchParams(pathSegments.pop())\n  qp.sort()\n  return [...pathSegments, qp.toString()].join('?')\n}\n\nfunction matchKey (mockDispatch, { path, method, body, headers }) {\n  const pathMatch = matchValue(mockDispatch.path, path)\n  const methodMatch = matchValue(mockDispatch.method, method)\n  const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true\n  const headersMatch = matchHeaders(mockDispatch, headers)\n  return pathMatch && methodMatch && bodyMatch && headersMatch\n}\n\nfunction getResponseData (data) {\n  if (Buffer.isBuffer(data)) {\n    return data\n  } else if (data instanceof Uint8Array) {\n    return data\n  } else if (data instanceof ArrayBuffer) {\n    return data\n  } else if (typeof data === 'object') {\n    return JSON.stringify(data)\n  } else {\n    return data.toString()\n  }\n}\n\nfunction getMockDispatch (mockDispatches, key) {\n  const basePath = key.query ? buildURL(key.path, key.query) : key.path\n  const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath\n\n  // Match path\n  let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)\n  }\n\n  // Match method\n  matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)\n  }\n\n  // Match body\n  matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)\n  if (matchedMockDispatches.length === 0) {\n    throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)\n  }\n\n  // Match headers\n  matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))\n  if (matchedMockDispatches.length === 0) {\n    const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers\n    throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)\n  }\n\n  return matchedMockDispatches[0]\n}\n\nfunction addMockDispatch (mockDispatches, key, data) {\n  const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }\n  const replyData = typeof data === 'function' ? { callback: data } : { ...data }\n  const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }\n  mockDispatches.push(newMockDispatch)\n  return newMockDispatch\n}\n\nfunction deleteMockDispatch (mockDispatches, key) {\n  const index = mockDispatches.findIndex(dispatch => {\n    if (!dispatch.consumed) {\n      return false\n    }\n    return matchKey(dispatch, key)\n  })\n  if (index !== -1) {\n    mockDispatches.splice(index, 1)\n  }\n}\n\nfunction buildKey (opts) {\n  const { path, method, body, headers, query } = opts\n  return {\n    path,\n    method,\n    body,\n    headers,\n    query\n  }\n}\n\nfunction generateKeyValues (data) {\n  const keys = Object.keys(data)\n  const result = []\n  for (let i = 0; i < keys.length; ++i) {\n    const key = keys[i]\n    const value = data[key]\n    const name = Buffer.from(`${key}`)\n    if (Array.isArray(value)) {\n      for (let j = 0; j < value.length; ++j) {\n        result.push(name, Buffer.from(`${value[j]}`))\n      }\n    } else {\n      result.push(name, Buffer.from(`${value}`))\n    }\n  }\n  return result\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n * @param {number} statusCode\n */\nfunction getStatusText (statusCode) {\n  return STATUS_CODES[statusCode] || 'unknown'\n}\n\nasync function getResponse (body) {\n  const buffers = []\n  for await (const data of body) {\n    buffers.push(data)\n  }\n  return Buffer.concat(buffers).toString('utf8')\n}\n\n/**\n * Mock dispatch function used to simulate undici dispatches\n */\nfunction mockDispatch (opts, handler) {\n  // Get mock dispatch from built key\n  const key = buildKey(opts)\n  const mockDispatch = getMockDispatch(this[kDispatches], key)\n\n  mockDispatch.timesInvoked++\n\n  // Here's where we resolve a callback if a callback is present for the dispatch data.\n  if (mockDispatch.data.callback) {\n    mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }\n  }\n\n  // Parse mockDispatch data\n  const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch\n  const { timesInvoked, times } = mockDispatch\n\n  // If it's used up and not persistent, mark as consumed\n  mockDispatch.consumed = !persist && timesInvoked >= times\n  mockDispatch.pending = timesInvoked < times\n\n  // If specified, trigger dispatch error\n  if (error !== null) {\n    deleteMockDispatch(this[kDispatches], key)\n    handler.onError(error)\n    return true\n  }\n\n  // Handle the request with a delay if necessary\n  if (typeof delay === 'number' && delay > 0) {\n    setTimeout(() => {\n      handleReply(this[kDispatches])\n    }, delay)\n  } else {\n    handleReply(this[kDispatches])\n  }\n\n  function handleReply (mockDispatches, _data = data) {\n    // fetch's HeadersList is a 1D string array\n    const optsHeaders = Array.isArray(opts.headers)\n      ? buildHeadersFromArray(opts.headers)\n      : opts.headers\n    const body = typeof _data === 'function'\n      ? _data({ ...opts, headers: optsHeaders })\n      : _data\n\n    // util.types.isPromise is likely needed for jest.\n    if (isPromise(body)) {\n      // If handleReply is asynchronous, throwing an error\n      // in the callback will reject the promise, rather than\n      // synchronously throw the error, which breaks some tests.\n      // Rather, we wait for the callback to resolve if it is a\n      // promise, and then re-run handleReply with the new body.\n      body.then((newData) => handleReply(mockDispatches, newData))\n      return\n    }\n\n    const responseData = getResponseData(body)\n    const responseHeaders = generateKeyValues(headers)\n    const responseTrailers = generateKeyValues(trailers)\n\n    handler.onConnect?.(err => handler.onError(err), null)\n    handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))\n    handler.onData?.(Buffer.from(responseData))\n    handler.onComplete?.(responseTrailers)\n    deleteMockDispatch(mockDispatches, key)\n  }\n\n  function resume () {}\n\n  return true\n}\n\nfunction buildMockDispatch () {\n  const agent = this[kMockAgent]\n  const origin = this[kOrigin]\n  const originalDispatch = this[kOriginalDispatch]\n\n  return function dispatch (opts, handler) {\n    if (agent.isMockActive) {\n      try {\n        mockDispatch.call(this, opts, handler)\n      } catch (error) {\n        if (error instanceof MockNotMatchedError) {\n          const netConnect = agent[kGetNetConnect]()\n          if (netConnect === false) {\n            throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)\n          }\n          if (checkNetConnect(netConnect, origin)) {\n            originalDispatch.call(this, opts, handler)\n          } else {\n            throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)\n          }\n        } else {\n          throw error\n        }\n      }\n    } else {\n      originalDispatch.call(this, opts, handler)\n    }\n  }\n}\n\nfunction checkNetConnect (netConnect, origin) {\n  const url = new URL(origin)\n  if (netConnect === true) {\n    return true\n  } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {\n    return true\n  }\n  return false\n}\n\nfunction buildMockOptions (opts) {\n  if (opts) {\n    const { agent, ...mockOptions } = opts\n    return mockOptions\n  }\n}\n\nmodule.exports = {\n  getResponseData,\n  getMockDispatch,\n  addMockDispatch,\n  deleteMockDispatch,\n  buildKey,\n  generateKeyValues,\n  matchValue,\n  getResponse,\n  getStatusText,\n  mockDispatch,\n  buildMockDispatch,\n  checkNetConnect,\n  buildMockOptions,\n  getHeaderByName,\n  buildHeadersFromArray\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst { Console } = require('node:console')\n\nconst PERSISTENT = process.versions.icu ? '✅' : 'Y '\nconst NOT_PERSISTENT = process.versions.icu ? '❌' : 'N '\n\n/**\n * Gets the output of `console.table(…)` as a string.\n */\nmodule.exports = class PendingInterceptorsFormatter {\n  constructor ({ disableColors } = {}) {\n    this.transform = new Transform({\n      transform (chunk, _enc, cb) {\n        cb(null, chunk)\n      }\n    })\n\n    this.logger = new Console({\n      stdout: this.transform,\n      inspectOptions: {\n        colors: !disableColors && !process.env.CI\n      }\n    })\n  }\n\n  format (pendingInterceptors) {\n    const withPrettyHeaders = pendingInterceptors.map(\n      ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({\n        Method: method,\n        Origin: origin,\n        Path: path,\n        'Status code': statusCode,\n        Persistent: persist ? PERSISTENT : NOT_PERSISTENT,\n        Invocations: timesInvoked,\n        Remaining: persist ? Infinity : times - timesInvoked\n      }))\n\n    this.logger.table(withPrettyHeaders)\n    return this.transform.read().toString()\n  }\n}\n","'use strict'\n\nconst singulars = {\n  pronoun: 'it',\n  is: 'is',\n  was: 'was',\n  this: 'this'\n}\n\nconst plurals = {\n  pronoun: 'they',\n  is: 'are',\n  was: 'were',\n  this: 'these'\n}\n\nmodule.exports = class Pluralizer {\n  constructor (singular, plural) {\n    this.singular = singular\n    this.plural = plural\n  }\n\n  pluralize (count) {\n    const one = count === 1\n    const keys = one ? singulars : plurals\n    const noun = one ? this.singular : this.plural\n    return { ...keys, count, noun }\n  }\n}\n","'use strict'\n\n/**\n * This module offers an optimized timer implementation designed for scenarios\n * where high precision is not critical.\n *\n * The timer achieves faster performance by using a low-resolution approach,\n * with an accuracy target of within 500ms. This makes it particularly useful\n * for timers with delays of 1 second or more, where exact timing is less\n * crucial.\n *\n * It's important to note that Node.js timers are inherently imprecise, as\n * delays can occur due to the event loop being blocked by other operations.\n * Consequently, timers may trigger later than their scheduled time.\n */\n\n/**\n * The fastNow variable contains the internal fast timer clock value.\n *\n * @type {number}\n */\nlet fastNow = 0\n\n/**\n * RESOLUTION_MS represents the target resolution time in milliseconds.\n *\n * @type {number}\n * @default 1000\n */\nconst RESOLUTION_MS = 1e3\n\n/**\n * TICK_MS defines the desired interval in milliseconds between each tick.\n * The target value is set to half the resolution time, minus 1 ms, to account\n * for potential event loop overhead.\n *\n * @type {number}\n * @default 499\n */\nconst TICK_MS = (RESOLUTION_MS >> 1) - 1\n\n/**\n * fastNowTimeout is a Node.js timer used to manage and process\n * the FastTimers stored in the `fastTimers` array.\n *\n * @type {NodeJS.Timeout}\n */\nlet fastNowTimeout\n\n/**\n * The kFastTimer symbol is used to identify FastTimer instances.\n *\n * @type {Symbol}\n */\nconst kFastTimer = Symbol('kFastTimer')\n\n/**\n * The fastTimers array contains all active FastTimers.\n *\n * @type {FastTimer[]}\n */\nconst fastTimers = []\n\n/**\n * These constants represent the various states of a FastTimer.\n */\n\n/**\n * The `NOT_IN_LIST` constant indicates that the FastTimer is not included\n * in the `fastTimers` array. Timers with this status will not be processed\n * during the next tick by the `onTick` function.\n *\n * A FastTimer can be re-added to the `fastTimers` array by invoking the\n * `refresh` method on the FastTimer instance.\n *\n * @type {-2}\n */\nconst NOT_IN_LIST = -2\n\n/**\n * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled\n * for removal from the `fastTimers` array. A FastTimer in this state will\n * be removed in the next tick by the `onTick` function and will no longer\n * be processed.\n *\n * This status is also set when the `clear` method is called on the FastTimer instance.\n *\n * @type {-1}\n */\nconst TO_BE_CLEARED = -1\n\n/**\n * The `PENDING` constant signifies that the FastTimer is awaiting processing\n * in the next tick by the `onTick` function. Timers with this status will have\n * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick.\n *\n * @type {0}\n */\nconst PENDING = 0\n\n/**\n * The `ACTIVE` constant indicates that the FastTimer is active and waiting\n * for its timer to expire. During the next tick, the `onTick` function will\n * check if the timer has expired, and if so, it will execute the associated callback.\n *\n * @type {1}\n */\nconst ACTIVE = 1\n\n/**\n * The onTick function processes the fastTimers array.\n *\n * @returns {void}\n */\nfunction onTick () {\n  /**\n   * Increment the fastNow value by the TICK_MS value, despite the actual time\n   * that has passed since the last tick. This approach ensures independence\n   * from the system clock and delays caused by a blocked event loop.\n   *\n   * @type {number}\n   */\n  fastNow += TICK_MS\n\n  /**\n   * The `idx` variable is used to iterate over the `fastTimers` array.\n   * Expired timers are removed by replacing them with the last element in the array.\n   * Consequently, `idx` is only incremented when the current element is not removed.\n   *\n   * @type {number}\n   */\n  let idx = 0\n\n  /**\n   * The len variable will contain the length of the fastTimers array\n   * and will be decremented when a FastTimer should be removed from the\n   * fastTimers array.\n   *\n   * @type {number}\n   */\n  let len = fastTimers.length\n\n  while (idx < len) {\n    /**\n     * @type {FastTimer}\n     */\n    const timer = fastTimers[idx]\n\n    // If the timer is in the ACTIVE state and the timer has expired, it will\n    // be processed in the next tick.\n    if (timer._state === PENDING) {\n      // Set the _idleStart value to the fastNow value minus the TICK_MS value\n      // to account for the time the timer was in the PENDING state.\n      timer._idleStart = fastNow - TICK_MS\n      timer._state = ACTIVE\n    } else if (\n      timer._state === ACTIVE &&\n      fastNow >= timer._idleStart + timer._idleTimeout\n    ) {\n      timer._state = TO_BE_CLEARED\n      timer._idleStart = -1\n      timer._onTimeout(timer._timerArg)\n    }\n\n    if (timer._state === TO_BE_CLEARED) {\n      timer._state = NOT_IN_LIST\n\n      // Move the last element to the current index and decrement len if it is\n      // not the only element in the array.\n      if (--len !== 0) {\n        fastTimers[idx] = fastTimers[len]\n      }\n    } else {\n      ++idx\n    }\n  }\n\n  // Set the length of the fastTimers array to the new length and thus\n  // removing the excess FastTimers elements from the array.\n  fastTimers.length = len\n\n  // If there are still active FastTimers in the array, refresh the Timer.\n  // If there are no active FastTimers, the timer will be refreshed again\n  // when a new FastTimer is instantiated.\n  if (fastTimers.length !== 0) {\n    refreshTimeout()\n  }\n}\n\nfunction refreshTimeout () {\n  // If the fastNowTimeout is already set, refresh it.\n  if (fastNowTimeout) {\n    fastNowTimeout.refresh()\n  // fastNowTimeout is not instantiated yet, create a new Timer.\n  } else {\n    clearTimeout(fastNowTimeout)\n    fastNowTimeout = setTimeout(onTick, TICK_MS)\n\n    // If the Timer has an unref method, call it to allow the process to exit if\n    // there are no other active handles.\n    if (fastNowTimeout.unref) {\n      fastNowTimeout.unref()\n    }\n  }\n}\n\n/**\n * The `FastTimer` class is a data structure designed to store and manage\n * timer information.\n */\nclass FastTimer {\n  [kFastTimer] = true\n\n  /**\n   * The state of the timer, which can be one of the following:\n   * - NOT_IN_LIST (-2)\n   * - TO_BE_CLEARED (-1)\n   * - PENDING (0)\n   * - ACTIVE (1)\n   *\n   * @type {-2|-1|0|1}\n   * @private\n   */\n  _state = NOT_IN_LIST\n\n  /**\n   * The number of milliseconds to wait before calling the callback.\n   *\n   * @type {number}\n   * @private\n   */\n  _idleTimeout = -1\n\n  /**\n   * The time in milliseconds when the timer was started. This value is used to\n   * calculate when the timer should expire.\n   *\n   * @type {number}\n   * @default -1\n   * @private\n   */\n  _idleStart = -1\n\n  /**\n   * The function to be executed when the timer expires.\n   * @type {Function}\n   * @private\n   */\n  _onTimeout\n\n  /**\n   * The argument to be passed to the callback when the timer expires.\n   *\n   * @type {*}\n   * @private\n   */\n  _timerArg\n\n  /**\n   * @constructor\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should wait\n   * before the specified function or code is executed.\n   * @param {*} arg\n   */\n  constructor (callback, delay, arg) {\n    this._onTimeout = callback\n    this._idleTimeout = delay\n    this._timerArg = arg\n\n    this.refresh()\n  }\n\n  /**\n   * Sets the timer's start time to the current time, and reschedules the timer\n   * to call its callback at the previously specified duration adjusted to the\n   * current time.\n   * Using this on a timer that has already called its callback will reactivate\n   * the timer.\n   *\n   * @returns {void}\n   */\n  refresh () {\n    // In the special case that the timer is not in the list of active timers,\n    // add it back to the array to be processed in the next tick by the onTick\n    // function.\n    if (this._state === NOT_IN_LIST) {\n      fastTimers.push(this)\n    }\n\n    // If the timer is the only active timer, refresh the fastNowTimeout for\n    // better resolution.\n    if (!fastNowTimeout || fastTimers.length === 1) {\n      refreshTimeout()\n    }\n\n    // Setting the state to PENDING will cause the timer to be reset in the\n    // next tick by the onTick function.\n    this._state = PENDING\n  }\n\n  /**\n   * The `clear` method cancels the timer, preventing it from executing.\n   *\n   * @returns {void}\n   * @private\n   */\n  clear () {\n    // Set the state to TO_BE_CLEARED to mark the timer for removal in the next\n    // tick by the onTick function.\n    this._state = TO_BE_CLEARED\n\n    // Reset the _idleStart value to -1 to indicate that the timer is no longer\n    // active.\n    this._idleStart = -1\n  }\n}\n\n/**\n * This module exports a setTimeout and clearTimeout function that can be\n * used as a drop-in replacement for the native functions.\n */\nmodule.exports = {\n  /**\n   * The setTimeout() method sets a timer which executes a function once the\n   * timer expires.\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should\n   * wait before the specified function or code is executed.\n   * @param {*} [arg] An optional argument to be passed to the callback function\n   * when the timer expires.\n   * @returns {NodeJS.Timeout|FastTimer}\n   */\n  setTimeout (callback, delay, arg) {\n    // If the delay is less than or equal to the RESOLUTION_MS value return a\n    // native Node.js Timer instance.\n    return delay <= RESOLUTION_MS\n      ? setTimeout(callback, delay, arg)\n      : new FastTimer(callback, delay, arg)\n  },\n  /**\n   * The clearTimeout method cancels an instantiated Timer previously created\n   * by calling setTimeout.\n   *\n   * @param {NodeJS.Timeout|FastTimer} timeout\n   */\n  clearTimeout (timeout) {\n    // If the timeout is a FastTimer, call its own clear method.\n    if (timeout[kFastTimer]) {\n      /**\n       * @type {FastTimer}\n       */\n      timeout.clear()\n      // Otherwise it is an instance of a native NodeJS.Timeout, so call the\n      // Node.js native clearTimeout function.\n    } else {\n      clearTimeout(timeout)\n    }\n  },\n  /**\n   * The setFastTimeout() method sets a fastTimer which executes a function once\n   * the timer expires.\n   * @param {Function} callback A function to be executed after the timer\n   * expires.\n   * @param {number} delay The time, in milliseconds that the timer should\n   * wait before the specified function or code is executed.\n   * @param {*} [arg] An optional argument to be passed to the callback function\n   * when the timer expires.\n   * @returns {FastTimer}\n   */\n  setFastTimeout (callback, delay, arg) {\n    return new FastTimer(callback, delay, arg)\n  },\n  /**\n   * The clearTimeout method cancels an instantiated FastTimer previously\n   * created by calling setFastTimeout.\n   *\n   * @param {FastTimer} timeout\n   */\n  clearFastTimeout (timeout) {\n    timeout.clear()\n  },\n  /**\n   * The now method returns the value of the internal fast timer clock.\n   *\n   * @returns {number}\n   */\n  now () {\n    return fastNow\n  },\n  /**\n   * Trigger the onTick function to process the fastTimers array.\n   * Exported for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   * @param {number} [delay=0] The delay in milliseconds to add to the now value.\n   */\n  tick (delay = 0) {\n    fastNow += delay - RESOLUTION_MS + 1\n    onTick()\n    onTick()\n  },\n  /**\n   * Reset FastTimers.\n   * Exported for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   */\n  reset () {\n    fastNow = 0\n    fastTimers.length = 0\n    clearTimeout(fastNowTimeout)\n    fastNowTimeout = null\n  },\n  /**\n   * Exporting for testing purposes only.\n   * Marking as deprecated to discourage any use outside of testing.\n   * @deprecated\n   */\n  kFastTimer\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { urlEquals, getFieldValues } = require('./util')\nconst { kEnumerableProperty, isDisturbed } = require('../../core/util')\nconst { webidl } = require('../fetch/webidl')\nconst { Response, cloneResponse, fromInnerResponse } = require('../fetch/response')\nconst { Request, fromInnerRequest } = require('../fetch/request')\nconst { kState } = require('../fetch/symbols')\nconst { fetching } = require('../fetch/index')\nconst { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require('../fetch/util')\nconst assert = require('node:assert')\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation\n * @typedef {Object} CacheBatchOperation\n * @property {'delete' | 'put'} type\n * @property {any} request\n * @property {any} response\n * @property {import('../../types/cache').CacheQueryOptions} options\n */\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list\n * @typedef {[any, any][]} requestResponseList\n */\n\nclass Cache {\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list\n   * @type {requestResponseList}\n   */\n  #relevantRequestResponseList\n\n  constructor () {\n    if (arguments[0] !== kConstruct) {\n      webidl.illegalConstructor()\n    }\n\n    webidl.util.markAsUncloneable(this)\n    this.#relevantRequestResponseList = arguments[1]\n  }\n\n  async match (request, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.match'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    const p = this.#internalMatchAll(request, options, 1)\n\n    if (p.length === 0) {\n      return\n    }\n\n    return p[0]\n  }\n\n  async matchAll (request = undefined, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.matchAll'\n    if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    return this.#internalMatchAll(request, options)\n  }\n\n  async add (request) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.add'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n\n    // 1.\n    const requests = [request]\n\n    // 2.\n    const responseArrayPromise = this.addAll(requests)\n\n    // 3.\n    return await responseArrayPromise\n  }\n\n  async addAll (requests) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.addAll'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    // 1.\n    const responsePromises = []\n\n    // 2.\n    const requestList = []\n\n    // 3.\n    for (let request of requests) {\n      if (request === undefined) {\n        throw webidl.errors.conversionFailed({\n          prefix,\n          argument: 'Argument 1',\n          types: ['undefined is not allowed']\n        })\n      }\n\n      request = webidl.converters.RequestInfo(request)\n\n      if (typeof request === 'string') {\n        continue\n      }\n\n      // 3.1\n      const r = request[kState]\n\n      // 3.2\n      if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {\n        throw webidl.errors.exception({\n          header: prefix,\n          message: 'Expected http/s scheme when method is not GET.'\n        })\n      }\n    }\n\n    // 4.\n    /** @type {ReturnType[]} */\n    const fetchControllers = []\n\n    // 5.\n    for (const request of requests) {\n      // 5.1\n      const r = new Request(request)[kState]\n\n      // 5.2\n      if (!urlIsHttpHttpsScheme(r.url)) {\n        throw webidl.errors.exception({\n          header: prefix,\n          message: 'Expected http/s scheme.'\n        })\n      }\n\n      // 5.4\n      r.initiator = 'fetch'\n      r.destination = 'subresource'\n\n      // 5.5\n      requestList.push(r)\n\n      // 5.6\n      const responsePromise = createDeferredPromise()\n\n      // 5.7\n      fetchControllers.push(fetching({\n        request: r,\n        processResponse (response) {\n          // 1.\n          if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {\n            responsePromise.reject(webidl.errors.exception({\n              header: 'Cache.addAll',\n              message: 'Received an invalid status code or the request failed.'\n            }))\n          } else if (response.headersList.contains('vary')) { // 2.\n            // 2.1\n            const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n            // 2.2\n            for (const fieldValue of fieldValues) {\n              // 2.2.1\n              if (fieldValue === '*') {\n                responsePromise.reject(webidl.errors.exception({\n                  header: 'Cache.addAll',\n                  message: 'invalid vary field value'\n                }))\n\n                for (const controller of fetchControllers) {\n                  controller.abort()\n                }\n\n                return\n              }\n            }\n          }\n        },\n        processResponseEndOfBody (response) {\n          // 1.\n          if (response.aborted) {\n            responsePromise.reject(new DOMException('aborted', 'AbortError'))\n            return\n          }\n\n          // 2.\n          responsePromise.resolve(response)\n        }\n      }))\n\n      // 5.8\n      responsePromises.push(responsePromise.promise)\n    }\n\n    // 6.\n    const p = Promise.all(responsePromises)\n\n    // 7.\n    const responses = await p\n\n    // 7.1\n    const operations = []\n\n    // 7.2\n    let index = 0\n\n    // 7.3\n    for (const response of responses) {\n      // 7.3.1\n      /** @type {CacheBatchOperation} */\n      const operation = {\n        type: 'put', // 7.3.2\n        request: requestList[index], // 7.3.3\n        response // 7.3.4\n      }\n\n      operations.push(operation) // 7.3.5\n\n      index++ // 7.3.6\n    }\n\n    // 7.5\n    const cacheJobPromise = createDeferredPromise()\n\n    // 7.6.1\n    let errorData = null\n\n    // 7.6.2\n    try {\n      this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    // 7.6.3\n    queueMicrotask(() => {\n      // 7.6.3.1\n      if (errorData === null) {\n        cacheJobPromise.resolve(undefined)\n      } else {\n        // 7.6.3.2\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    // 7.7\n    return cacheJobPromise.promise\n  }\n\n  async put (request, response) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.put'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    response = webidl.converters.Response(response, prefix, 'response')\n\n    // 1.\n    let innerRequest = null\n\n    // 2.\n    if (request instanceof Request) {\n      innerRequest = request[kState]\n    } else { // 3.\n      innerRequest = new Request(request)[kState]\n    }\n\n    // 4.\n    if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Expected an http/s scheme when method is not GET'\n      })\n    }\n\n    // 5.\n    const innerResponse = response[kState]\n\n    // 6.\n    if (innerResponse.status === 206) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Got 206 status'\n      })\n    }\n\n    // 7.\n    if (innerResponse.headersList.contains('vary')) {\n      // 7.1.\n      const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))\n\n      // 7.2.\n      for (const fieldValue of fieldValues) {\n        // 7.2.1\n        if (fieldValue === '*') {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: 'Got * vary field value'\n          })\n        }\n      }\n    }\n\n    // 8.\n    if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: 'Response body is locked or disturbed'\n      })\n    }\n\n    // 9.\n    const clonedResponse = cloneResponse(innerResponse)\n\n    // 10.\n    const bodyReadPromise = createDeferredPromise()\n\n    // 11.\n    if (innerResponse.body != null) {\n      // 11.1\n      const stream = innerResponse.body.stream\n\n      // 11.2\n      const reader = stream.getReader()\n\n      // 11.3\n      readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)\n    } else {\n      bodyReadPromise.resolve(undefined)\n    }\n\n    // 12.\n    /** @type {CacheBatchOperation[]} */\n    const operations = []\n\n    // 13.\n    /** @type {CacheBatchOperation} */\n    const operation = {\n      type: 'put', // 14.\n      request: innerRequest, // 15.\n      response: clonedResponse // 16.\n    }\n\n    // 17.\n    operations.push(operation)\n\n    // 19.\n    const bytes = await bodyReadPromise.promise\n\n    if (clonedResponse.body != null) {\n      clonedResponse.body.source = bytes\n    }\n\n    // 19.1\n    const cacheJobPromise = createDeferredPromise()\n\n    // 19.2.1\n    let errorData = null\n\n    // 19.2.2\n    try {\n      this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    // 19.2.3\n    queueMicrotask(() => {\n      // 19.2.3.1\n      if (errorData === null) {\n        cacheJobPromise.resolve()\n      } else { // 19.2.3.2\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    return cacheJobPromise.promise\n  }\n\n  async delete (request, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    /**\n     * @type {Request}\n     */\n    let r = null\n\n    if (request instanceof Request) {\n      r = request[kState]\n\n      if (r.method !== 'GET' && !options.ignoreMethod) {\n        return false\n      }\n    } else {\n      assert(typeof request === 'string')\n\n      r = new Request(request)[kState]\n    }\n\n    /** @type {CacheBatchOperation[]} */\n    const operations = []\n\n    /** @type {CacheBatchOperation} */\n    const operation = {\n      type: 'delete',\n      request: r,\n      options\n    }\n\n    operations.push(operation)\n\n    const cacheJobPromise = createDeferredPromise()\n\n    let errorData = null\n    let requestResponses\n\n    try {\n      requestResponses = this.#batchCacheOperations(operations)\n    } catch (e) {\n      errorData = e\n    }\n\n    queueMicrotask(() => {\n      if (errorData === null) {\n        cacheJobPromise.resolve(!!requestResponses?.length)\n      } else {\n        cacheJobPromise.reject(errorData)\n      }\n    })\n\n    return cacheJobPromise.promise\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys\n   * @param {any} request\n   * @param {import('../../types/cache').CacheQueryOptions} options\n   * @returns {Promise}\n   */\n  async keys (request = undefined, options = {}) {\n    webidl.brandCheck(this, Cache)\n\n    const prefix = 'Cache.keys'\n\n    if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n    options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n    // 1.\n    let r = null\n\n    // 2.\n    if (request !== undefined) {\n      // 2.1\n      if (request instanceof Request) {\n        // 2.1.1\n        r = request[kState]\n\n        // 2.1.2\n        if (r.method !== 'GET' && !options.ignoreMethod) {\n          return []\n        }\n      } else if (typeof request === 'string') { // 2.2\n        r = new Request(request)[kState]\n      }\n    }\n\n    // 4.\n    const promise = createDeferredPromise()\n\n    // 5.\n    // 5.1\n    const requests = []\n\n    // 5.2\n    if (request === undefined) {\n      // 5.2.1\n      for (const requestResponse of this.#relevantRequestResponseList) {\n        // 5.2.1.1\n        requests.push(requestResponse[0])\n      }\n    } else { // 5.3\n      // 5.3.1\n      const requestResponses = this.#queryCache(r, options)\n\n      // 5.3.2\n      for (const requestResponse of requestResponses) {\n        // 5.3.2.1\n        requests.push(requestResponse[0])\n      }\n    }\n\n    // 5.4\n    queueMicrotask(() => {\n      // 5.4.1\n      const requestList = []\n\n      // 5.4.2\n      for (const request of requests) {\n        const requestObject = fromInnerRequest(\n          request,\n          new AbortController().signal,\n          'immutable'\n        )\n        // 5.4.2.1\n        requestList.push(requestObject)\n      }\n\n      // 5.4.3\n      promise.resolve(Object.freeze(requestList))\n    })\n\n    return promise.promise\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm\n   * @param {CacheBatchOperation[]} operations\n   * @returns {requestResponseList}\n   */\n  #batchCacheOperations (operations) {\n    // 1.\n    const cache = this.#relevantRequestResponseList\n\n    // 2.\n    const backupCache = [...cache]\n\n    // 3.\n    const addedItems = []\n\n    // 4.1\n    const resultList = []\n\n    try {\n      // 4.2\n      for (const operation of operations) {\n        // 4.2.1\n        if (operation.type !== 'delete' && operation.type !== 'put') {\n          throw webidl.errors.exception({\n            header: 'Cache.#batchCacheOperations',\n            message: 'operation type does not match \"delete\" or \"put\"'\n          })\n        }\n\n        // 4.2.2\n        if (operation.type === 'delete' && operation.response != null) {\n          throw webidl.errors.exception({\n            header: 'Cache.#batchCacheOperations',\n            message: 'delete operation should not have an associated response'\n          })\n        }\n\n        // 4.2.3\n        if (this.#queryCache(operation.request, operation.options, addedItems).length) {\n          throw new DOMException('???', 'InvalidStateError')\n        }\n\n        // 4.2.4\n        let requestResponses\n\n        // 4.2.5\n        if (operation.type === 'delete') {\n          // 4.2.5.1\n          requestResponses = this.#queryCache(operation.request, operation.options)\n\n          // TODO: the spec is wrong, this is needed to pass WPTs\n          if (requestResponses.length === 0) {\n            return []\n          }\n\n          // 4.2.5.2\n          for (const requestResponse of requestResponses) {\n            const idx = cache.indexOf(requestResponse)\n            assert(idx !== -1)\n\n            // 4.2.5.2.1\n            cache.splice(idx, 1)\n          }\n        } else if (operation.type === 'put') { // 4.2.6\n          // 4.2.6.1\n          if (operation.response == null) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'put operation should have an associated response'\n            })\n          }\n\n          // 4.2.6.2\n          const r = operation.request\n\n          // 4.2.6.3\n          if (!urlIsHttpHttpsScheme(r.url)) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'expected http or https scheme'\n            })\n          }\n\n          // 4.2.6.4\n          if (r.method !== 'GET') {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'not get method'\n            })\n          }\n\n          // 4.2.6.5\n          if (operation.options != null) {\n            throw webidl.errors.exception({\n              header: 'Cache.#batchCacheOperations',\n              message: 'options must not be defined'\n            })\n          }\n\n          // 4.2.6.6\n          requestResponses = this.#queryCache(operation.request)\n\n          // 4.2.6.7\n          for (const requestResponse of requestResponses) {\n            const idx = cache.indexOf(requestResponse)\n            assert(idx !== -1)\n\n            // 4.2.6.7.1\n            cache.splice(idx, 1)\n          }\n\n          // 4.2.6.8\n          cache.push([operation.request, operation.response])\n\n          // 4.2.6.10\n          addedItems.push([operation.request, operation.response])\n        }\n\n        // 4.2.7\n        resultList.push([operation.request, operation.response])\n      }\n\n      // 4.3\n      return resultList\n    } catch (e) { // 5.\n      // 5.1\n      this.#relevantRequestResponseList.length = 0\n\n      // 5.2\n      this.#relevantRequestResponseList = backupCache\n\n      // 5.3\n      throw e\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#query-cache\n   * @param {any} requestQuery\n   * @param {import('../../types/cache').CacheQueryOptions} options\n   * @param {requestResponseList} targetStorage\n   * @returns {requestResponseList}\n   */\n  #queryCache (requestQuery, options, targetStorage) {\n    /** @type {requestResponseList} */\n    const resultList = []\n\n    const storage = targetStorage ?? this.#relevantRequestResponseList\n\n    for (const requestResponse of storage) {\n      const [cachedRequest, cachedResponse] = requestResponse\n      if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {\n        resultList.push(requestResponse)\n      }\n    }\n\n    return resultList\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm\n   * @param {any} requestQuery\n   * @param {any} request\n   * @param {any | null} response\n   * @param {import('../../types/cache').CacheQueryOptions | undefined} options\n   * @returns {boolean}\n   */\n  #requestMatchesCachedItem (requestQuery, request, response = null, options) {\n    // if (options?.ignoreMethod === false && request.method === 'GET') {\n    //   return false\n    // }\n\n    const queryURL = new URL(requestQuery.url)\n\n    const cachedURL = new URL(request.url)\n\n    if (options?.ignoreSearch) {\n      cachedURL.search = ''\n\n      queryURL.search = ''\n    }\n\n    if (!urlEquals(queryURL, cachedURL, true)) {\n      return false\n    }\n\n    if (\n      response == null ||\n      options?.ignoreVary ||\n      !response.headersList.contains('vary')\n    ) {\n      return true\n    }\n\n    const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n    for (const fieldValue of fieldValues) {\n      if (fieldValue === '*') {\n        return false\n      }\n\n      const requestValue = request.headersList.get(fieldValue)\n      const queryValue = requestQuery.headersList.get(fieldValue)\n\n      // If one has the header and the other doesn't, or one has\n      // a different value than the other, return false\n      if (requestValue !== queryValue) {\n        return false\n      }\n    }\n\n    return true\n  }\n\n  #internalMatchAll (request, options, maxResponses = Infinity) {\n    // 1.\n    let r = null\n\n    // 2.\n    if (request !== undefined) {\n      if (request instanceof Request) {\n        // 2.1.1\n        r = request[kState]\n\n        // 2.1.2\n        if (r.method !== 'GET' && !options.ignoreMethod) {\n          return []\n        }\n      } else if (typeof request === 'string') {\n        // 2.2.1\n        r = new Request(request)[kState]\n      }\n    }\n\n    // 5.\n    // 5.1\n    const responses = []\n\n    // 5.2\n    if (request === undefined) {\n      // 5.2.1\n      for (const requestResponse of this.#relevantRequestResponseList) {\n        responses.push(requestResponse[1])\n      }\n    } else { // 5.3\n      // 5.3.1\n      const requestResponses = this.#queryCache(r, options)\n\n      // 5.3.2\n      for (const requestResponse of requestResponses) {\n        responses.push(requestResponse[1])\n      }\n    }\n\n    // 5.4\n    // We don't implement CORs so we don't need to loop over the responses, yay!\n\n    // 5.5.1\n    const responseList = []\n\n    // 5.5.2\n    for (const response of responses) {\n      // 5.5.2.1\n      const responseObject = fromInnerResponse(response, 'immutable')\n\n      responseList.push(responseObject.clone())\n\n      if (responseList.length >= maxResponses) {\n        break\n      }\n    }\n\n    // 6.\n    return Object.freeze(responseList)\n  }\n}\n\nObject.defineProperties(Cache.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'Cache',\n    configurable: true\n  },\n  match: kEnumerableProperty,\n  matchAll: kEnumerableProperty,\n  add: kEnumerableProperty,\n  addAll: kEnumerableProperty,\n  put: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  keys: kEnumerableProperty\n})\n\nconst cacheQueryOptionConverters = [\n  {\n    key: 'ignoreSearch',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'ignoreMethod',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'ignoreVary',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n]\n\nwebidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)\n\nwebidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([\n  ...cacheQueryOptionConverters,\n  {\n    key: 'cacheName',\n    converter: webidl.converters.DOMString\n  }\n])\n\nwebidl.converters.Response = webidl.interfaceConverter(Response)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.RequestInfo\n)\n\nmodule.exports = {\n  Cache\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { Cache } = require('./cache')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass CacheStorage {\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map\n   * @type {Map}\n   */\n  async has (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.has'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    // 2.1.1\n    // 2.2\n    return this.#caches.has(cacheName)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open\n   * @param {string} cacheName\n   * @returns {Promise}\n   */\n  async open (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.open'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    // 2.1\n    if (this.#caches.has(cacheName)) {\n      // await caches.open('v1') !== await caches.open('v1')\n\n      // 2.1.1\n      const cache = this.#caches.get(cacheName)\n\n      // 2.1.1.1\n      return new Cache(kConstruct, cache)\n    }\n\n    // 2.2\n    const cache = []\n\n    // 2.3\n    this.#caches.set(cacheName, cache)\n\n    // 2.4\n    return new Cache(kConstruct, cache)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete\n   * @param {string} cacheName\n   * @returns {Promise}\n   */\n  async delete (cacheName) {\n    webidl.brandCheck(this, CacheStorage)\n\n    const prefix = 'CacheStorage.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n    return this.#caches.delete(cacheName)\n  }\n\n  /**\n   * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys\n   * @returns {Promise}\n   */\n  async keys () {\n    webidl.brandCheck(this, CacheStorage)\n\n    // 2.1\n    const keys = this.#caches.keys()\n\n    // 2.2\n    return [...keys]\n  }\n}\n\nObject.defineProperties(CacheStorage.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'CacheStorage',\n    configurable: true\n  },\n  match: kEnumerableProperty,\n  has: kEnumerableProperty,\n  open: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  keys: kEnumerableProperty\n})\n\nmodule.exports = {\n  CacheStorage\n}\n","'use strict'\n\nmodule.exports = {\n  kConstruct: require('../../core/symbols').kConstruct\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { isValidHeaderName } = require('../fetch/util')\n\n/**\n * @see https://url.spec.whatwg.org/#concept-url-equals\n * @param {URL} A\n * @param {URL} B\n * @param {boolean | undefined} excludeFragment\n * @returns {boolean}\n */\nfunction urlEquals (A, B, excludeFragment = false) {\n  const serializedA = URLSerializer(A, excludeFragment)\n\n  const serializedB = URLSerializer(B, excludeFragment)\n\n  return serializedA === serializedB\n}\n\n/**\n * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262\n * @param {string} header\n */\nfunction getFieldValues (header) {\n  assert(header !== null)\n\n  const values = []\n\n  for (let value of header.split(',')) {\n    value = value.trim()\n\n    if (isValidHeaderName(value)) {\n      values.push(value)\n    }\n  }\n\n  return values\n}\n\nmodule.exports = {\n  urlEquals,\n  getFieldValues\n}\n","'use strict'\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size\nconst maxAttributeValueSize = 1024\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size\nconst maxNameValuePairSize = 4096\n\nmodule.exports = {\n  maxAttributeValueSize,\n  maxNameValuePairSize\n}\n","'use strict'\n\nconst { parseSetCookie } = require('./parse')\nconst { stringify } = require('./util')\nconst { webidl } = require('../fetch/webidl')\nconst { Headers } = require('../fetch/headers')\n\n/**\n * @typedef {Object} Cookie\n * @property {string} name\n * @property {string} value\n * @property {Date|number|undefined} expires\n * @property {number|undefined} maxAge\n * @property {string|undefined} domain\n * @property {string|undefined} path\n * @property {boolean|undefined} secure\n * @property {boolean|undefined} httpOnly\n * @property {'Strict'|'Lax'|'None'} sameSite\n * @property {string[]} unparsed\n */\n\n/**\n * @param {Headers} headers\n * @returns {Record}\n */\nfunction getCookies (headers) {\n  webidl.argumentLengthCheck(arguments, 1, 'getCookies')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const cookie = headers.get('cookie')\n  const out = {}\n\n  if (!cookie) {\n    return out\n  }\n\n  for (const piece of cookie.split(';')) {\n    const [name, ...value] = piece.split('=')\n\n    out[name.trim()] = value.join('=')\n  }\n\n  return out\n}\n\n/**\n * @param {Headers} headers\n * @param {string} name\n * @param {{ path?: string, domain?: string }|undefined} attributes\n * @returns {void}\n */\nfunction deleteCookie (headers, name, attributes) {\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const prefix = 'deleteCookie'\n  webidl.argumentLengthCheck(arguments, 2, prefix)\n\n  name = webidl.converters.DOMString(name, prefix, 'name')\n  attributes = webidl.converters.DeleteCookieAttributes(attributes)\n\n  // Matches behavior of\n  // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278\n  setCookie(headers, {\n    name,\n    value: '',\n    expires: new Date(0),\n    ...attributes\n  })\n}\n\n/**\n * @param {Headers} headers\n * @returns {Cookie[]}\n */\nfunction getSetCookies (headers) {\n  webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  const cookies = headers.getSetCookie()\n\n  if (!cookies) {\n    return []\n  }\n\n  return cookies.map((pair) => parseSetCookie(pair))\n}\n\n/**\n * @param {Headers} headers\n * @param {Cookie} cookie\n * @returns {void}\n */\nfunction setCookie (headers, cookie) {\n  webidl.argumentLengthCheck(arguments, 2, 'setCookie')\n\n  webidl.brandCheck(headers, Headers, { strict: false })\n\n  cookie = webidl.converters.Cookie(cookie)\n\n  const str = stringify(cookie)\n\n  if (str) {\n    headers.append('Set-Cookie', str)\n  }\n}\n\nwebidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'path',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'domain',\n    defaultValue: () => null\n  }\n])\n\nwebidl.converters.Cookie = webidl.dictionaryConverter([\n  {\n    converter: webidl.converters.DOMString,\n    key: 'name'\n  },\n  {\n    converter: webidl.converters.DOMString,\n    key: 'value'\n  },\n  {\n    converter: webidl.nullableConverter((value) => {\n      if (typeof value === 'number') {\n        return webidl.converters['unsigned long long'](value)\n      }\n\n      return new Date(value)\n    }),\n    key: 'expires',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters['long long']),\n    key: 'maxAge',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'domain',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.DOMString),\n    key: 'path',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.boolean),\n    key: 'secure',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.nullableConverter(webidl.converters.boolean),\n    key: 'httpOnly',\n    defaultValue: () => null\n  },\n  {\n    converter: webidl.converters.USVString,\n    key: 'sameSite',\n    allowedValues: ['Strict', 'Lax', 'None']\n  },\n  {\n    converter: webidl.sequenceConverter(webidl.converters.DOMString),\n    key: 'unparsed',\n    defaultValue: () => new Array(0)\n  }\n])\n\nmodule.exports = {\n  getCookies,\n  deleteCookie,\n  getSetCookies,\n  setCookie\n}\n","'use strict'\n\nconst { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')\nconst { isCTLExcludingHtab } = require('./util')\nconst { collectASequenceOfCodePointsFast } = require('../fetch/data-url')\nconst assert = require('node:assert')\n\n/**\n * @description Parses the field-value attributes of a set-cookie header string.\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} header\n * @returns if the header is invalid, null will be returned\n */\nfunction parseSetCookie (header) {\n  // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F\n  //    character (CTL characters excluding HTAB): Abort these steps and\n  //    ignore the set-cookie-string entirely.\n  if (isCTLExcludingHtab(header)) {\n    return null\n  }\n\n  let nameValuePair = ''\n  let unparsedAttributes = ''\n  let name = ''\n  let value = ''\n\n  // 2. If the set-cookie-string contains a %x3B (\";\") character:\n  if (header.includes(';')) {\n    // 1. The name-value-pair string consists of the characters up to,\n    //    but not including, the first %x3B (\";\"), and the unparsed-\n    //    attributes consist of the remainder of the set-cookie-string\n    //    (including the %x3B (\";\") in question).\n    const position = { position: 0 }\n\n    nameValuePair = collectASequenceOfCodePointsFast(';', header, position)\n    unparsedAttributes = header.slice(position.position)\n  } else {\n    // Otherwise:\n\n    // 1. The name-value-pair string consists of all the characters\n    //    contained in the set-cookie-string, and the unparsed-\n    //    attributes is the empty string.\n    nameValuePair = header\n  }\n\n  // 3. If the name-value-pair string lacks a %x3D (\"=\") character, then\n  //    the name string is empty, and the value string is the value of\n  //    name-value-pair.\n  if (!nameValuePair.includes('=')) {\n    value = nameValuePair\n  } else {\n    //    Otherwise, the name string consists of the characters up to, but\n    //    not including, the first %x3D (\"=\") character, and the (possibly\n    //    empty) value string consists of the characters after the first\n    //    %x3D (\"=\") character.\n    const position = { position: 0 }\n    name = collectASequenceOfCodePointsFast(\n      '=',\n      nameValuePair,\n      position\n    )\n    value = nameValuePair.slice(position.position + 1)\n  }\n\n  // 4. Remove any leading or trailing WSP characters from the name\n  //    string and the value string.\n  name = name.trim()\n  value = value.trim()\n\n  // 5. If the sum of the lengths of the name string and the value string\n  //    is more than 4096 octets, abort these steps and ignore the set-\n  //    cookie-string entirely.\n  if (name.length + value.length > maxNameValuePairSize) {\n    return null\n  }\n\n  // 6. The cookie-name is the name string, and the cookie-value is the\n  //    value string.\n  return {\n    name, value, ...parseUnparsedAttributes(unparsedAttributes)\n  }\n}\n\n/**\n * Parses the remaining attributes of a set-cookie header\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} unparsedAttributes\n * @param {[Object.]={}} cookieAttributeList\n */\nfunction parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {\n  // 1. If the unparsed-attributes string is empty, skip the rest of\n  //    these steps.\n  if (unparsedAttributes.length === 0) {\n    return cookieAttributeList\n  }\n\n  // 2. Discard the first character of the unparsed-attributes (which\n  //    will be a %x3B (\";\") character).\n  assert(unparsedAttributes[0] === ';')\n  unparsedAttributes = unparsedAttributes.slice(1)\n\n  let cookieAv = ''\n\n  // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n  //    character:\n  if (unparsedAttributes.includes(';')) {\n    // 1. Consume the characters of the unparsed-attributes up to, but\n    //    not including, the first %x3B (\";\") character.\n    cookieAv = collectASequenceOfCodePointsFast(\n      ';',\n      unparsedAttributes,\n      { position: 0 }\n    )\n    unparsedAttributes = unparsedAttributes.slice(cookieAv.length)\n  } else {\n    // Otherwise:\n\n    // 1. Consume the remainder of the unparsed-attributes.\n    cookieAv = unparsedAttributes\n    unparsedAttributes = ''\n  }\n\n  // Let the cookie-av string be the characters consumed in this step.\n\n  let attributeName = ''\n  let attributeValue = ''\n\n  // 4. If the cookie-av string contains a %x3D (\"=\") character:\n  if (cookieAv.includes('=')) {\n    // 1. The (possibly empty) attribute-name string consists of the\n    //    characters up to, but not including, the first %x3D (\"=\")\n    //    character, and the (possibly empty) attribute-value string\n    //    consists of the characters after the first %x3D (\"=\")\n    //    character.\n    const position = { position: 0 }\n\n    attributeName = collectASequenceOfCodePointsFast(\n      '=',\n      cookieAv,\n      position\n    )\n    attributeValue = cookieAv.slice(position.position + 1)\n  } else {\n    // Otherwise:\n\n    // 1. The attribute-name string consists of the entire cookie-av\n    //    string, and the attribute-value string is empty.\n    attributeName = cookieAv\n  }\n\n  // 5. Remove any leading or trailing WSP characters from the attribute-\n  //    name string and the attribute-value string.\n  attributeName = attributeName.trim()\n  attributeValue = attributeValue.trim()\n\n  // 6. If the attribute-value is longer than 1024 octets, ignore the\n  //    cookie-av string and return to Step 1 of this algorithm.\n  if (attributeValue.length > maxAttributeValueSize) {\n    return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n  }\n\n  // 7. Process the attribute-name and attribute-value according to the\n  //    requirements in the following subsections.  (Notice that\n  //    attributes with unrecognized attribute-names are ignored.)\n  const attributeNameLowercase = attributeName.toLowerCase()\n\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1\n  // If the attribute-name case-insensitively matches the string\n  // \"Expires\", the user agent MUST process the cookie-av as follows.\n  if (attributeNameLowercase === 'expires') {\n    // 1. Let the expiry-time be the result of parsing the attribute-value\n    //    as cookie-date (see Section 5.1.1).\n    const expiryTime = new Date(attributeValue)\n\n    // 2. If the attribute-value failed to parse as a cookie date, ignore\n    //    the cookie-av.\n\n    cookieAttributeList.expires = expiryTime\n  } else if (attributeNameLowercase === 'max-age') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2\n    // If the attribute-name case-insensitively matches the string \"Max-\n    // Age\", the user agent MUST process the cookie-av as follows.\n\n    // 1. If the first character of the attribute-value is not a DIGIT or a\n    //    \"-\" character, ignore the cookie-av.\n    const charCode = attributeValue.charCodeAt(0)\n\n    if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {\n      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n    }\n\n    // 2. If the remainder of attribute-value contains a non-DIGIT\n    //    character, ignore the cookie-av.\n    if (!/^\\d+$/.test(attributeValue)) {\n      return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n    }\n\n    // 3. Let delta-seconds be the attribute-value converted to an integer.\n    const deltaSeconds = Number(attributeValue)\n\n    // 4. Let cookie-age-limit be the maximum age of the cookie (which\n    //    SHOULD be 400 days or less, see Section 4.1.2.2).\n\n    // 5. Set delta-seconds to the smaller of its present value and cookie-\n    //    age-limit.\n    // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)\n\n    // 6. If delta-seconds is less than or equal to zero (0), let expiry-\n    //    time be the earliest representable date and time.  Otherwise, let\n    //    the expiry-time be the current date and time plus delta-seconds\n    //    seconds.\n    // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds\n\n    // 7. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Max-Age and an attribute-value of expiry-time.\n    cookieAttributeList.maxAge = deltaSeconds\n  } else if (attributeNameLowercase === 'domain') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3\n    // If the attribute-name case-insensitively matches the string \"Domain\",\n    // the user agent MUST process the cookie-av as follows.\n\n    // 1. Let cookie-domain be the attribute-value.\n    let cookieDomain = attributeValue\n\n    // 2. If cookie-domain starts with %x2E (\".\"), let cookie-domain be\n    //    cookie-domain without its leading %x2E (\".\").\n    if (cookieDomain[0] === '.') {\n      cookieDomain = cookieDomain.slice(1)\n    }\n\n    // 3. Convert the cookie-domain to lower case.\n    cookieDomain = cookieDomain.toLowerCase()\n\n    // 4. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Domain and an attribute-value of cookie-domain.\n    cookieAttributeList.domain = cookieDomain\n  } else if (attributeNameLowercase === 'path') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4\n    // If the attribute-name case-insensitively matches the string \"Path\",\n    // the user agent MUST process the cookie-av as follows.\n\n    // 1. If the attribute-value is empty or if the first character of the\n    //    attribute-value is not %x2F (\"/\"):\n    let cookiePath = ''\n    if (attributeValue.length === 0 || attributeValue[0] !== '/') {\n      // 1. Let cookie-path be the default-path.\n      cookiePath = '/'\n    } else {\n      // Otherwise:\n\n      // 1. Let cookie-path be the attribute-value.\n      cookiePath = attributeValue\n    }\n\n    // 2. Append an attribute to the cookie-attribute-list with an\n    //    attribute-name of Path and an attribute-value of cookie-path.\n    cookieAttributeList.path = cookiePath\n  } else if (attributeNameLowercase === 'secure') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5\n    // If the attribute-name case-insensitively matches the string \"Secure\",\n    // the user agent MUST append an attribute to the cookie-attribute-list\n    // with an attribute-name of Secure and an empty attribute-value.\n\n    cookieAttributeList.secure = true\n  } else if (attributeNameLowercase === 'httponly') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6\n    // If the attribute-name case-insensitively matches the string\n    // \"HttpOnly\", the user agent MUST append an attribute to the cookie-\n    // attribute-list with an attribute-name of HttpOnly and an empty\n    // attribute-value.\n\n    cookieAttributeList.httpOnly = true\n  } else if (attributeNameLowercase === 'samesite') {\n    // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7\n    // If the attribute-name case-insensitively matches the string\n    // \"SameSite\", the user agent MUST process the cookie-av as follows:\n\n    const attributeValueLowercase = attributeValue.toLowerCase()\n\n    // 1. If cookie-av's attribute-value is a case-insensitive match for\n    //    \"None\", append an attribute to the cookie-attribute-list with an\n    //    attribute-name of \"SameSite\" and an attribute-value of \"None\".\n    if (attributeValueLowercase === 'none') {\n      cookieAttributeList.sameSite = 'None'\n    } else if (attributeValueLowercase === 'strict') {\n      // 2. If cookie-av's attribute-value is a case-insensitive match for\n      //    \"Strict\", append an attribute to the cookie-attribute-list with\n      //    an attribute-name of \"SameSite\" and an attribute-value of\n      //    \"Strict\".\n      cookieAttributeList.sameSite = 'Strict'\n    } else if (attributeValueLowercase === 'lax') {\n      // 3. If cookie-av's attribute-value is a case-insensitive match for\n      //    \"Lax\", append an attribute to the cookie-attribute-list with an\n      //    attribute-name of \"SameSite\" and an attribute-value of \"Lax\".\n      cookieAttributeList.sameSite = 'Lax'\n    }\n  } else {\n    cookieAttributeList.unparsed ??= []\n\n    cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)\n  }\n\n  // 8. Return to Step 1 of this algorithm.\n  return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n}\n\nmodule.exports = {\n  parseSetCookie,\n  parseUnparsedAttributes\n}\n","'use strict'\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction isCTLExcludingHtab (value) {\n  for (let i = 0; i < value.length; ++i) {\n    const code = value.charCodeAt(i)\n\n    if (\n      (code >= 0x00 && code <= 0x08) ||\n      (code >= 0x0A && code <= 0x1F) ||\n      code === 0x7F\n    ) {\n      return true\n    }\n  }\n  return false\n}\n\n/**\n CHAR           = \n token          = 1*\n separators     = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n                | \",\" | \";\" | \":\" | \"\\\" | <\">\n                | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n                | \"{\" | \"}\" | SP | HT\n * @param {string} name\n */\nfunction validateCookieName (name) {\n  for (let i = 0; i < name.length; ++i) {\n    const code = name.charCodeAt(i)\n\n    if (\n      code < 0x21 || // exclude CTLs (0-31), SP and HT\n      code > 0x7E || // exclude non-ascii and DEL\n      code === 0x22 || // \"\n      code === 0x28 || // (\n      code === 0x29 || // )\n      code === 0x3C || // <\n      code === 0x3E || // >\n      code === 0x40 || // @\n      code === 0x2C || // ,\n      code === 0x3B || // ;\n      code === 0x3A || // :\n      code === 0x5C || // \\\n      code === 0x2F || // /\n      code === 0x5B || // [\n      code === 0x5D || // ]\n      code === 0x3F || // ?\n      code === 0x3D || // =\n      code === 0x7B || // {\n      code === 0x7D // }\n    ) {\n      throw new Error('Invalid cookie name')\n    }\n  }\n}\n\n/**\n cookie-value      = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n cookie-octet      = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n                       ; US-ASCII characters excluding CTLs,\n                       ; whitespace DQUOTE, comma, semicolon,\n                       ; and backslash\n * @param {string} value\n */\nfunction validateCookieValue (value) {\n  let len = value.length\n  let i = 0\n\n  // if the value is wrapped in DQUOTE\n  if (value[0] === '\"') {\n    if (len === 1 || value[len - 1] !== '\"') {\n      throw new Error('Invalid cookie value')\n    }\n    --len\n    ++i\n  }\n\n  while (i < len) {\n    const code = value.charCodeAt(i++)\n\n    if (\n      code < 0x21 || // exclude CTLs (0-31)\n      code > 0x7E || // non-ascii and DEL (127)\n      code === 0x22 || // \"\n      code === 0x2C || // ,\n      code === 0x3B || // ;\n      code === 0x5C // \\\n    ) {\n      throw new Error('Invalid cookie value')\n    }\n  }\n}\n\n/**\n * path-value        = \n * @param {string} path\n */\nfunction validateCookiePath (path) {\n  for (let i = 0; i < path.length; ++i) {\n    const code = path.charCodeAt(i)\n\n    if (\n      code < 0x20 || // exclude CTLs (0-31)\n      code === 0x7F || // DEL\n      code === 0x3B // ;\n    ) {\n      throw new Error('Invalid cookie path')\n    }\n  }\n}\n\n/**\n * I have no idea why these values aren't allowed to be honest,\n * but Deno tests these. - Khafra\n * @param {string} domain\n */\nfunction validateCookieDomain (domain) {\n  if (\n    domain.startsWith('-') ||\n    domain.endsWith('.') ||\n    domain.endsWith('-')\n  ) {\n    throw new Error('Invalid cookie domain')\n  }\n}\n\nconst IMFDays = [\n  'Sun', 'Mon', 'Tue', 'Wed',\n  'Thu', 'Fri', 'Sat'\n]\n\nconst IMFMonths = [\n  'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n]\n\nconst IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1\n * @param {number|Date} date\n  IMF-fixdate  = day-name \",\" SP date1 SP time-of-day SP GMT\n  ; fixed length/zone/capitalization subset of the format\n  ; see Section 3.3 of [RFC5322]\n\n  day-name     = %x4D.6F.6E ; \"Mon\", case-sensitive\n              / %x54.75.65 ; \"Tue\", case-sensitive\n              / %x57.65.64 ; \"Wed\", case-sensitive\n              / %x54.68.75 ; \"Thu\", case-sensitive\n              / %x46.72.69 ; \"Fri\", case-sensitive\n              / %x53.61.74 ; \"Sat\", case-sensitive\n              / %x53.75.6E ; \"Sun\", case-sensitive\n  date1        = day SP month SP year\n                  ; e.g., 02 Jun 1982\n\n  day          = 2DIGIT\n  month        = %x4A.61.6E ; \"Jan\", case-sensitive\n              / %x46.65.62 ; \"Feb\", case-sensitive\n              / %x4D.61.72 ; \"Mar\", case-sensitive\n              / %x41.70.72 ; \"Apr\", case-sensitive\n              / %x4D.61.79 ; \"May\", case-sensitive\n              / %x4A.75.6E ; \"Jun\", case-sensitive\n              / %x4A.75.6C ; \"Jul\", case-sensitive\n              / %x41.75.67 ; \"Aug\", case-sensitive\n              / %x53.65.70 ; \"Sep\", case-sensitive\n              / %x4F.63.74 ; \"Oct\", case-sensitive\n              / %x4E.6F.76 ; \"Nov\", case-sensitive\n              / %x44.65.63 ; \"Dec\", case-sensitive\n  year         = 4DIGIT\n\n  GMT          = %x47.4D.54 ; \"GMT\", case-sensitive\n\n  time-of-day  = hour \":\" minute \":\" second\n              ; 00:00:00 - 23:59:60 (leap second)\n\n  hour         = 2DIGIT\n  minute       = 2DIGIT\n  second       = 2DIGIT\n */\nfunction toIMFDate (date) {\n  if (typeof date === 'number') {\n    date = new Date(date)\n  }\n\n  return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`\n}\n\n/**\n max-age-av        = \"Max-Age=\" non-zero-digit *DIGIT\n                       ; In practice, both expires-av and max-age-av\n                       ; are limited to dates representable by the\n                       ; user agent.\n * @param {number} maxAge\n */\nfunction validateCookieMaxAge (maxAge) {\n  if (maxAge < 0) {\n    throw new Error('Invalid cookie max-age')\n  }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1\n * @param {import('./index').Cookie} cookie\n */\nfunction stringify (cookie) {\n  if (cookie.name.length === 0) {\n    return null\n  }\n\n  validateCookieName(cookie.name)\n  validateCookieValue(cookie.value)\n\n  const out = [`${cookie.name}=${cookie.value}`]\n\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1\n  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2\n  if (cookie.name.startsWith('__Secure-')) {\n    cookie.secure = true\n  }\n\n  if (cookie.name.startsWith('__Host-')) {\n    cookie.secure = true\n    cookie.domain = null\n    cookie.path = '/'\n  }\n\n  if (cookie.secure) {\n    out.push('Secure')\n  }\n\n  if (cookie.httpOnly) {\n    out.push('HttpOnly')\n  }\n\n  if (typeof cookie.maxAge === 'number') {\n    validateCookieMaxAge(cookie.maxAge)\n    out.push(`Max-Age=${cookie.maxAge}`)\n  }\n\n  if (cookie.domain) {\n    validateCookieDomain(cookie.domain)\n    out.push(`Domain=${cookie.domain}`)\n  }\n\n  if (cookie.path) {\n    validateCookiePath(cookie.path)\n    out.push(`Path=${cookie.path}`)\n  }\n\n  if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {\n    out.push(`Expires=${toIMFDate(cookie.expires)}`)\n  }\n\n  if (cookie.sameSite) {\n    out.push(`SameSite=${cookie.sameSite}`)\n  }\n\n  for (const part of cookie.unparsed) {\n    if (!part.includes('=')) {\n      throw new Error('Invalid unparsed')\n    }\n\n    const [key, ...value] = part.split('=')\n\n    out.push(`${key.trim()}=${value.join('=')}`)\n  }\n\n  return out.join('; ')\n}\n\nmodule.exports = {\n  isCTLExcludingHtab,\n  validateCookieName,\n  validateCookiePath,\n  validateCookieValue,\n  toIMFDate,\n  stringify\n}\n","'use strict'\nconst { Transform } = require('node:stream')\nconst { isASCIINumber, isValidLastEventId } = require('./util')\n\n/**\n * @type {number[]} BOM\n */\nconst BOM = [0xEF, 0xBB, 0xBF]\n/**\n * @type {10} LF\n */\nconst LF = 0x0A\n/**\n * @type {13} CR\n */\nconst CR = 0x0D\n/**\n * @type {58} COLON\n */\nconst COLON = 0x3A\n/**\n * @type {32} SPACE\n */\nconst SPACE = 0x20\n\n/**\n * @typedef {object} EventSourceStreamEvent\n * @type {object}\n * @property {string} [event] The event type.\n * @property {string} [data] The data of the message.\n * @property {string} [id] A unique ID for the event.\n * @property {string} [retry] The reconnection time, in milliseconds.\n */\n\n/**\n * @typedef eventSourceSettings\n * @type {object}\n * @property {string} lastEventId The last event ID received from the server.\n * @property {string} origin The origin of the event source.\n * @property {number} reconnectionTime The reconnection time, in milliseconds.\n */\n\nclass EventSourceStream extends Transform {\n  /**\n   * @type {eventSourceSettings}\n   */\n  state = null\n\n  /**\n   * Leading byte-order-mark check.\n   * @type {boolean}\n   */\n  checkBOM = true\n\n  /**\n   * @type {boolean}\n   */\n  crlfCheck = false\n\n  /**\n   * @type {boolean}\n   */\n  eventEndCheck = false\n\n  /**\n   * @type {Buffer}\n   */\n  buffer = null\n\n  pos = 0\n\n  event = {\n    data: undefined,\n    event: undefined,\n    id: undefined,\n    retry: undefined\n  }\n\n  /**\n   * @param {object} options\n   * @param {eventSourceSettings} options.eventSourceSettings\n   * @param {Function} [options.push]\n   */\n  constructor (options = {}) {\n    // Enable object mode as EventSourceStream emits objects of shape\n    // EventSourceStreamEvent\n    options.readableObjectMode = true\n\n    super(options)\n\n    this.state = options.eventSourceSettings || {}\n    if (options.push) {\n      this.push = options.push\n    }\n  }\n\n  /**\n   * @param {Buffer} chunk\n   * @param {string} _encoding\n   * @param {Function} callback\n   * @returns {void}\n   */\n  _transform (chunk, _encoding, callback) {\n    if (chunk.length === 0) {\n      callback()\n      return\n    }\n\n    // Cache the chunk in the buffer, as the data might not be complete while\n    // processing it\n    // TODO: Investigate if there is a more performant way to handle\n    // incoming chunks\n    // see: https://github.com/nodejs/undici/issues/2630\n    if (this.buffer) {\n      this.buffer = Buffer.concat([this.buffer, chunk])\n    } else {\n      this.buffer = chunk\n    }\n\n    // Strip leading byte-order-mark if we opened the stream and started\n    // the processing of the incoming data\n    if (this.checkBOM) {\n      switch (this.buffer.length) {\n        case 1:\n          // Check if the first byte is the same as the first byte of the BOM\n          if (this.buffer[0] === BOM[0]) {\n            // If it is, we need to wait for more data\n            callback()\n            return\n          }\n          // Set the checkBOM flag to false as we don't need to check for the\n          // BOM anymore\n          this.checkBOM = false\n\n          // The buffer only contains one byte so we need to wait for more data\n          callback()\n          return\n        case 2:\n          // Check if the first two bytes are the same as the first two bytes\n          // of the BOM\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1]\n          ) {\n            // If it is, we need to wait for more data, because the third byte\n            // is needed to determine if it is the BOM or not\n            callback()\n            return\n          }\n\n          // Set the checkBOM flag to false as we don't need to check for the\n          // BOM anymore\n          this.checkBOM = false\n          break\n        case 3:\n          // Check if the first three bytes are the same as the first three\n          // bytes of the BOM\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1] &&\n            this.buffer[2] === BOM[2]\n          ) {\n            // If it is, we can drop the buffered data, as it is only the BOM\n            this.buffer = Buffer.alloc(0)\n            // Set the checkBOM flag to false as we don't need to check for the\n            // BOM anymore\n            this.checkBOM = false\n\n            // Await more data\n            callback()\n            return\n          }\n          // If it is not the BOM, we can start processing the data\n          this.checkBOM = false\n          break\n        default:\n          // The buffer is longer than 3 bytes, so we can drop the BOM if it is\n          // present\n          if (\n            this.buffer[0] === BOM[0] &&\n            this.buffer[1] === BOM[1] &&\n            this.buffer[2] === BOM[2]\n          ) {\n            // Remove the BOM from the buffer\n            this.buffer = this.buffer.subarray(3)\n          }\n\n          // Set the checkBOM flag to false as we don't need to check for the\n          this.checkBOM = false\n          break\n      }\n    }\n\n    while (this.pos < this.buffer.length) {\n      // If the previous line ended with an end-of-line, we need to check\n      // if the next character is also an end-of-line.\n      if (this.eventEndCheck) {\n        // If the the current character is an end-of-line, then the event\n        // is finished and we can process it\n\n        // If the previous line ended with a carriage return, we need to\n        // check if the current character is a line feed and remove it\n        // from the buffer.\n        if (this.crlfCheck) {\n          // If the current character is a line feed, we can remove it\n          // from the buffer and reset the crlfCheck flag\n          if (this.buffer[this.pos] === LF) {\n            this.buffer = this.buffer.subarray(this.pos + 1)\n            this.pos = 0\n            this.crlfCheck = false\n\n            // It is possible that the line feed is not the end of the\n            // event. We need to check if the next character is an\n            // end-of-line character to determine if the event is\n            // finished. We simply continue the loop to check the next\n            // character.\n\n            // As we removed the line feed from the buffer and set the\n            // crlfCheck flag to false, we basically don't make any\n            // distinction between a line feed and a carriage return.\n            continue\n          }\n          this.crlfCheck = false\n        }\n\n        if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n          // If the current character is a carriage return, we need to\n          // set the crlfCheck flag to true, as we need to check if the\n          // next character is a line feed so we can remove it from the\n          // buffer\n          if (this.buffer[this.pos] === CR) {\n            this.crlfCheck = true\n          }\n\n          this.buffer = this.buffer.subarray(this.pos + 1)\n          this.pos = 0\n          if (\n            this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {\n            this.processEvent(this.event)\n          }\n          this.clearEvent()\n          continue\n        }\n        // If the current character is not an end-of-line, then the event\n        // is not finished and we have to reset the eventEndCheck flag\n        this.eventEndCheck = false\n        continue\n      }\n\n      // If the current character is an end-of-line, we can process the\n      // line\n      if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n        // If the current character is a carriage return, we need to\n        // set the crlfCheck flag to true, as we need to check if the\n        // next character is a line feed\n        if (this.buffer[this.pos] === CR) {\n          this.crlfCheck = true\n        }\n\n        // In any case, we can process the line as we reached an\n        // end-of-line character\n        this.parseLine(this.buffer.subarray(0, this.pos), this.event)\n\n        // Remove the processed line from the buffer\n        this.buffer = this.buffer.subarray(this.pos + 1)\n        // Reset the position as we removed the processed line from the buffer\n        this.pos = 0\n        // A line was processed and this could be the end of the event. We need\n        // to check if the next line is empty to determine if the event is\n        // finished.\n        this.eventEndCheck = true\n        continue\n      }\n\n      this.pos++\n    }\n\n    callback()\n  }\n\n  /**\n   * @param {Buffer} line\n   * @param {EventStreamEvent} event\n   */\n  parseLine (line, event) {\n    // If the line is empty (a blank line)\n    // Dispatch the event, as defined below.\n    // This will be handled in the _transform method\n    if (line.length === 0) {\n      return\n    }\n\n    // If the line starts with a U+003A COLON character (:)\n    // Ignore the line.\n    const colonPosition = line.indexOf(COLON)\n    if (colonPosition === 0) {\n      return\n    }\n\n    let field = ''\n    let value = ''\n\n    // If the line contains a U+003A COLON character (:)\n    if (colonPosition !== -1) {\n      // Collect the characters on the line before the first U+003A COLON\n      // character (:), and let field be that string.\n      // TODO: Investigate if there is a more performant way to extract the\n      // field\n      // see: https://github.com/nodejs/undici/issues/2630\n      field = line.subarray(0, colonPosition).toString('utf8')\n\n      // Collect the characters on the line after the first U+003A COLON\n      // character (:), and let value be that string.\n      // If value starts with a U+0020 SPACE character, remove it from value.\n      let valueStart = colonPosition + 1\n      if (line[valueStart] === SPACE) {\n        ++valueStart\n      }\n      // TODO: Investigate if there is a more performant way to extract the\n      // value\n      // see: https://github.com/nodejs/undici/issues/2630\n      value = line.subarray(valueStart).toString('utf8')\n\n      // Otherwise, the string is not empty but does not contain a U+003A COLON\n      // character (:)\n    } else {\n      // Process the field using the steps described below, using the whole\n      // line as the field name, and the empty string as the field value.\n      field = line.toString('utf8')\n      value = ''\n    }\n\n    // Modify the event with the field name and value. The value is also\n    // decoded as UTF-8\n    switch (field) {\n      case 'data':\n        if (event[field] === undefined) {\n          event[field] = value\n        } else {\n          event[field] += `\\n${value}`\n        }\n        break\n      case 'retry':\n        if (isASCIINumber(value)) {\n          event[field] = value\n        }\n        break\n      case 'id':\n        if (isValidLastEventId(value)) {\n          event[field] = value\n        }\n        break\n      case 'event':\n        if (value.length > 0) {\n          event[field] = value\n        }\n        break\n    }\n  }\n\n  /**\n   * @param {EventSourceStreamEvent} event\n   */\n  processEvent (event) {\n    if (event.retry && isASCIINumber(event.retry)) {\n      this.state.reconnectionTime = parseInt(event.retry, 10)\n    }\n\n    if (event.id && isValidLastEventId(event.id)) {\n      this.state.lastEventId = event.id\n    }\n\n    // only dispatch event, when data is provided\n    if (event.data !== undefined) {\n      this.push({\n        type: event.event || 'message',\n        options: {\n          data: event.data,\n          lastEventId: this.state.lastEventId,\n          origin: this.state.origin\n        }\n      })\n    }\n  }\n\n  clearEvent () {\n    this.event = {\n      data: undefined,\n      event: undefined,\n      id: undefined,\n      retry: undefined\n    }\n  }\n}\n\nmodule.exports = {\n  EventSourceStream\n}\n","'use strict'\n\nconst { pipeline } = require('node:stream')\nconst { fetching } = require('../fetch')\nconst { makeRequest } = require('../fetch/request')\nconst { webidl } = require('../fetch/webidl')\nconst { EventSourceStream } = require('./eventsource-stream')\nconst { parseMIMEType } = require('../fetch/data-url')\nconst { createFastMessageEvent } = require('../websocket/events')\nconst { isNetworkError } = require('../fetch/response')\nconst { delay } = require('./util')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { environmentSettingsObject } = require('../fetch/util')\n\nlet experimentalWarned = false\n\n/**\n * A reconnection time, in milliseconds. This must initially be an implementation-defined value,\n * probably in the region of a few seconds.\n *\n * In Comparison:\n * - Chrome uses 3000ms.\n * - Deno uses 5000ms.\n *\n * @type {3000}\n */\nconst defaultReconnectionTime = 3000\n\n/**\n * The readyState attribute represents the state of the connection.\n * @enum\n * @readonly\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev\n */\n\n/**\n * The connection has not yet been established, or it was closed and the user\n * agent is reconnecting.\n * @type {0}\n */\nconst CONNECTING = 0\n\n/**\n * The user agent has an open connection and is dispatching events as it\n * receives them.\n * @type {1}\n */\nconst OPEN = 1\n\n/**\n * The connection is not open, and the user agent is not trying to reconnect.\n * @type {2}\n */\nconst CLOSED = 2\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"same-origin\".\n * @type {'anonymous'}\n */\nconst ANONYMOUS = 'anonymous'\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"include\".\n * @type {'use-credentials'}\n */\nconst USE_CREDENTIALS = 'use-credentials'\n\n/**\n * The EventSource interface is used to receive server-sent events. It\n * connects to a server over HTTP and receives events in text/event-stream\n * format without closing the connection.\n * @extends {EventTarget}\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events\n * @api public\n */\nclass EventSource extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    message: null\n  }\n\n  #url = null\n  #withCredentials = false\n\n  #readyState = CONNECTING\n\n  #request = null\n  #controller = null\n\n  #dispatcher\n\n  /**\n   * @type {import('./eventsource-stream').eventSourceSettings}\n   */\n  #state\n\n  /**\n   * Creates a new EventSource object.\n   * @param {string} url\n   * @param {EventSourceInit} [eventSourceInitDict]\n   * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface\n   */\n  constructor (url, eventSourceInitDict = {}) {\n    // 1. Let ev be a new EventSource object.\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'EventSource constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    if (!experimentalWarned) {\n      experimentalWarned = true\n      process.emitWarning('EventSource is experimental, expect them to change at any time.', {\n        code: 'UNDICI-ES'\n      })\n    }\n\n    url = webidl.converters.USVString(url, prefix, 'url')\n    eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')\n\n    this.#dispatcher = eventSourceInitDict.dispatcher\n    this.#state = {\n      lastEventId: '',\n      reconnectionTime: defaultReconnectionTime\n    }\n\n    // 2. Let settings be ev's relevant settings object.\n    // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object\n    const settings = environmentSettingsObject\n\n    let urlRecord\n\n    try {\n      // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.\n      urlRecord = new URL(url, settings.settingsObject.baseUrl)\n      this.#state.origin = urlRecord.origin\n    } catch (e) {\n      // 4. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n      throw new DOMException(e, 'SyntaxError')\n    }\n\n    // 5. Set ev's url to urlRecord.\n    this.#url = urlRecord.href\n\n    // 6. Let corsAttributeState be Anonymous.\n    let corsAttributeState = ANONYMOUS\n\n    // 7. If the value of eventSourceInitDict's withCredentials member is true,\n    // then set corsAttributeState to Use Credentials and set ev's\n    // withCredentials attribute to true.\n    if (eventSourceInitDict.withCredentials) {\n      corsAttributeState = USE_CREDENTIALS\n      this.#withCredentials = true\n    }\n\n    // 8. Let request be the result of creating a potential-CORS request given\n    // urlRecord, the empty string, and corsAttributeState.\n    const initRequest = {\n      redirect: 'follow',\n      keepalive: true,\n      // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes\n      mode: 'cors',\n      credentials: corsAttributeState === 'anonymous'\n        ? 'same-origin'\n        : 'omit',\n      referrer: 'no-referrer'\n    }\n\n    // 9. Set request's client to settings.\n    initRequest.client = environmentSettingsObject.settingsObject\n\n    // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.\n    initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]]\n\n    // 11. Set request's cache mode to \"no-store\".\n    initRequest.cache = 'no-store'\n\n    // 12. Set request's initiator type to \"other\".\n    initRequest.initiator = 'other'\n\n    initRequest.urlList = [new URL(this.#url)]\n\n    // 13. Set ev's request to request.\n    this.#request = makeRequest(initRequest)\n\n    this.#connect()\n  }\n\n  /**\n   * Returns the state of this EventSource object's connection. It can have the\n   * values described below.\n   * @returns {0|1|2}\n   * @readonly\n   */\n  get readyState () {\n    return this.#readyState\n  }\n\n  /**\n   * Returns the URL providing the event stream.\n   * @readonly\n   * @returns {string}\n   */\n  get url () {\n    return this.#url\n  }\n\n  /**\n   * Returns a boolean indicating whether the EventSource object was\n   * instantiated with CORS credentials set (true), or not (false, the default).\n   */\n  get withCredentials () {\n    return this.#withCredentials\n  }\n\n  #connect () {\n    if (this.#readyState === CLOSED) return\n\n    this.#readyState = CONNECTING\n\n    const fetchParams = {\n      request: this.#request,\n      dispatcher: this.#dispatcher\n    }\n\n    // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.\n    const processEventSourceEndOfBody = (response) => {\n      if (isNetworkError(response)) {\n        this.dispatchEvent(new Event('error'))\n        this.close()\n      }\n\n      this.#reconnect()\n    }\n\n    // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...\n    fetchParams.processResponseEndOfBody = processEventSourceEndOfBody\n\n    // and processResponse set to the following steps given response res:\n    fetchParams.processResponse = (response) => {\n      // 1. If res is an aborted network error, then fail the connection.\n\n      if (isNetworkError(response)) {\n        // 1. When a user agent is to fail the connection, the user agent\n        // must queue a task which, if the readyState attribute is set to a\n        // value other than CLOSED, sets the readyState attribute to CLOSED\n        // and fires an event named error at the EventSource object. Once the\n        // user agent has failed the connection, it does not attempt to\n        // reconnect.\n        if (response.aborted) {\n          this.close()\n          this.dispatchEvent(new Event('error'))\n          return\n          // 2. Otherwise, if res is a network error, then reestablish the\n          // connection, unless the user agent knows that to be futile, in\n          // which case the user agent may fail the connection.\n        } else {\n          this.#reconnect()\n          return\n        }\n      }\n\n      // 3. Otherwise, if res's status is not 200, or if res's `Content-Type`\n      // is not `text/event-stream`, then fail the connection.\n      const contentType = response.headersList.get('content-type', true)\n      const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'\n      const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'\n      if (\n        response.status !== 200 ||\n        contentTypeValid === false\n      ) {\n        this.close()\n        this.dispatchEvent(new Event('error'))\n        return\n      }\n\n      // 4. Otherwise, announce the connection and interpret res's body\n      // line by line.\n\n      // When a user agent is to announce the connection, the user agent\n      // must queue a task which, if the readyState attribute is set to a\n      // value other than CLOSED, sets the readyState attribute to OPEN\n      // and fires an event named open at the EventSource object.\n      // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n      this.#readyState = OPEN\n      this.dispatchEvent(new Event('open'))\n\n      // If redirected to a different origin, set the origin to the new origin.\n      this.#state.origin = response.urlList[response.urlList.length - 1].origin\n\n      const eventSourceStream = new EventSourceStream({\n        eventSourceSettings: this.#state,\n        push: (event) => {\n          this.dispatchEvent(createFastMessageEvent(\n            event.type,\n            event.options\n          ))\n        }\n      })\n\n      pipeline(response.body.stream,\n        eventSourceStream,\n        (error) => {\n          if (\n            error?.aborted === false\n          ) {\n            this.close()\n            this.dispatchEvent(new Event('error'))\n          }\n        })\n    }\n\n    this.#controller = fetching(fetchParams)\n  }\n\n  /**\n   * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n   * @returns {Promise}\n   */\n  async #reconnect () {\n    // When a user agent is to reestablish the connection, the user agent must\n    // run the following steps. These steps are run in parallel, not as part of\n    // a task. (The tasks that it queues, of course, are run like normal tasks\n    // and not themselves in parallel.)\n\n    // 1. Queue a task to run the following steps:\n\n    //   1. If the readyState attribute is set to CLOSED, abort the task.\n    if (this.#readyState === CLOSED) return\n\n    //   2. Set the readyState attribute to CONNECTING.\n    this.#readyState = CONNECTING\n\n    //   3. Fire an event named error at the EventSource object.\n    this.dispatchEvent(new Event('error'))\n\n    // 2. Wait a delay equal to the reconnection time of the event source.\n    await delay(this.#state.reconnectionTime)\n\n    // 5. Queue a task to run the following steps:\n\n    //   1. If the EventSource object's readyState attribute is not set to\n    //      CONNECTING, then return.\n    if (this.#readyState !== CONNECTING) return\n\n    //   2. Let request be the EventSource object's request.\n    //   3. If the EventSource object's last event ID string is not the empty\n    //      string, then:\n    //      1. Let lastEventIDValue be the EventSource object's last event ID\n    //         string, encoded as UTF-8.\n    //      2. Set (`Last-Event-ID`, lastEventIDValue) in request's header\n    //         list.\n    if (this.#state.lastEventId.length) {\n      this.#request.headersList.set('last-event-id', this.#state.lastEventId, true)\n    }\n\n    //   4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.\n    this.#connect()\n  }\n\n  /**\n   * Closes the connection, if any, and sets the readyState attribute to\n   * CLOSED.\n   */\n  close () {\n    webidl.brandCheck(this, EventSource)\n\n    if (this.#readyState === CLOSED) return\n    this.#readyState = CLOSED\n    this.#controller.abort()\n    this.#request = null\n  }\n\n  get onopen () {\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.open = fn\n      this.addEventListener('open', fn)\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onmessage () {\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.message = fn\n      this.addEventListener('message', fn)\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get onerror () {\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this.#events.error = null\n    }\n  }\n}\n\nconst constantsPropertyDescriptors = {\n  CONNECTING: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: CONNECTING,\n    writable: false\n  },\n  OPEN: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: OPEN,\n    writable: false\n  },\n  CLOSED: {\n    __proto__: null,\n    configurable: false,\n    enumerable: true,\n    value: CLOSED,\n    writable: false\n  }\n}\n\nObject.defineProperties(EventSource, constantsPropertyDescriptors)\nObject.defineProperties(EventSource.prototype, constantsPropertyDescriptors)\n\nObject.defineProperties(EventSource.prototype, {\n  close: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  url: kEnumerableProperty,\n  withCredentials: kEnumerableProperty\n})\n\nwebidl.converters.EventSourceInitDict = webidl.dictionaryConverter([\n  {\n    key: 'withCredentials',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'dispatcher', // undici only\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = {\n  EventSource,\n  defaultReconnectionTime\n}\n","'use strict'\n\n/**\n * Checks if the given value is a valid LastEventId.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isValidLastEventId (value) {\n  // LastEventId should not contain U+0000 NULL\n  return value.indexOf('\\u0000') === -1\n}\n\n/**\n * Checks if the given value is a base 10 digit.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isASCIINumber (value) {\n  if (value.length === 0) return false\n  for (let i = 0; i < value.length; i++) {\n    if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false\n  }\n  return true\n}\n\n// https://github.com/nodejs/undici/issues/2664\nfunction delay (ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms).unref()\n  })\n}\n\nmodule.exports = {\n  isValidLastEventId,\n  isASCIINumber,\n  delay\n}\n","'use strict'\n\nconst util = require('../../core/util')\nconst {\n  ReadableStreamFrom,\n  isBlobLike,\n  isReadableStreamLike,\n  readableStreamClose,\n  createDeferredPromise,\n  fullyReadBody,\n  extractMimeType,\n  utf8DecodeBytes\n} = require('./util')\nconst { FormData } = require('./formdata')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { Blob } = require('node:buffer')\nconst assert = require('node:assert')\nconst { isErrored, isDisturbed } = require('node:stream')\nconst { isArrayBuffer } = require('node:util/types')\nconst { serializeAMimeType } = require('./data-url')\nconst { multipartFormDataParser } = require('./formdata-parser')\nlet random\n\ntry {\n  const crypto = require('node:crypto')\n  random = (max) => crypto.randomInt(0, max)\n} catch {\n  random = (max) => Math.floor(Math.random(max))\n}\n\nconst textEncoder = new TextEncoder()\nfunction noop () {}\n\nconst hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0\nlet streamRegistry\n\nif (hasFinalizationRegistry) {\n  streamRegistry = new FinalizationRegistry((weakRef) => {\n    const stream = weakRef.deref()\n    if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {\n      stream.cancel('Response object has been garbage collected').catch(noop)\n    }\n  })\n}\n\n// https://fetch.spec.whatwg.org/#concept-bodyinit-extract\nfunction extractBody (object, keepalive = false) {\n  // 1. Let stream be null.\n  let stream = null\n\n  // 2. If object is a ReadableStream object, then set stream to object.\n  if (object instanceof ReadableStream) {\n    stream = object\n  } else if (isBlobLike(object)) {\n    // 3. Otherwise, if object is a Blob object, set stream to the\n    //    result of running object’s get stream.\n    stream = object.stream()\n  } else {\n    // 4. Otherwise, set stream to a new ReadableStream object, and set\n    //    up stream with byte reading support.\n    stream = new ReadableStream({\n      async pull (controller) {\n        const buffer = typeof source === 'string' ? textEncoder.encode(source) : source\n\n        if (buffer.byteLength) {\n          controller.enqueue(buffer)\n        }\n\n        queueMicrotask(() => readableStreamClose(controller))\n      },\n      start () {},\n      type: 'bytes'\n    })\n  }\n\n  // 5. Assert: stream is a ReadableStream object.\n  assert(isReadableStreamLike(stream))\n\n  // 6. Let action be null.\n  let action = null\n\n  // 7. Let source be null.\n  let source = null\n\n  // 8. Let length be null.\n  let length = null\n\n  // 9. Let type be null.\n  let type = null\n\n  // 10. Switch on object:\n  if (typeof object === 'string') {\n    // Set source to the UTF-8 encoding of object.\n    // Note: setting source to a Uint8Array here breaks some mocking assumptions.\n    source = object\n\n    // Set type to `text/plain;charset=UTF-8`.\n    type = 'text/plain;charset=UTF-8'\n  } else if (object instanceof URLSearchParams) {\n    // URLSearchParams\n\n    // spec says to run application/x-www-form-urlencoded on body.list\n    // this is implemented in Node.js as apart of an URLSearchParams instance toString method\n    // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490\n    // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100\n\n    // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.\n    source = object.toString()\n\n    // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.\n    type = 'application/x-www-form-urlencoded;charset=UTF-8'\n  } else if (isArrayBuffer(object)) {\n    // BufferSource/ArrayBuffer\n\n    // Set source to a copy of the bytes held by object.\n    source = new Uint8Array(object.slice())\n  } else if (ArrayBuffer.isView(object)) {\n    // BufferSource/ArrayBufferView\n\n    // Set source to a copy of the bytes held by object.\n    source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))\n  } else if (util.isFormDataLike(object)) {\n    const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`\n    const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n    /*! formdata-polyfill. MIT License. Jimmy Wärting  */\n    const escape = (str) =>\n      str.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n    const normalizeLinefeeds = (value) => value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n\n    // Set action to this step: run the multipart/form-data\n    // encoding algorithm, with object’s entry list and UTF-8.\n    // - This ensures that the body is immutable and can't be changed afterwords\n    // - That the content-length is calculated in advance.\n    // - And that all parts are pre-encoded and ready to be sent.\n\n    const blobParts = []\n    const rn = new Uint8Array([13, 10]) // '\\r\\n'\n    length = 0\n    let hasUnknownSizeValue = false\n\n    for (const [name, value] of object) {\n      if (typeof value === 'string') {\n        const chunk = textEncoder.encode(prefix +\n          `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`)\n        blobParts.push(chunk)\n        length += chunk.byteLength\n      } else {\n        const chunk = textEncoder.encode(`${prefix}; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          (value.name ? `; filename=\"${escape(value.name)}\"` : '') + '\\r\\n' +\n          `Content-Type: ${\n            value.type || 'application/octet-stream'\n          }\\r\\n\\r\\n`)\n        blobParts.push(chunk, value, rn)\n        if (typeof value.size === 'number') {\n          length += chunk.byteLength + value.size + rn.byteLength\n        } else {\n          hasUnknownSizeValue = true\n        }\n      }\n    }\n\n    // CRLF is appended to the body to function with legacy servers and match other implementations.\n    // https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030\n    // https://github.com/form-data/form-data/issues/63\n    const chunk = textEncoder.encode(`--${boundary}--\\r\\n`)\n    blobParts.push(chunk)\n    length += chunk.byteLength\n    if (hasUnknownSizeValue) {\n      length = null\n    }\n\n    // Set source to object.\n    source = object\n\n    action = async function * () {\n      for (const part of blobParts) {\n        if (part.stream) {\n          yield * part.stream()\n        } else {\n          yield part\n        }\n      }\n    }\n\n    // Set type to `multipart/form-data; boundary=`,\n    // followed by the multipart/form-data boundary string generated\n    // by the multipart/form-data encoding algorithm.\n    type = `multipart/form-data; boundary=${boundary}`\n  } else if (isBlobLike(object)) {\n    // Blob\n\n    // Set source to object.\n    source = object\n\n    // Set length to object’s size.\n    length = object.size\n\n    // If object’s type attribute is not the empty byte sequence, set\n    // type to its value.\n    if (object.type) {\n      type = object.type\n    }\n  } else if (typeof object[Symbol.asyncIterator] === 'function') {\n    // If keepalive is true, then throw a TypeError.\n    if (keepalive) {\n      throw new TypeError('keepalive')\n    }\n\n    // If object is disturbed or locked, then throw a TypeError.\n    if (util.isDisturbed(object) || object.locked) {\n      throw new TypeError(\n        'Response body object should not be disturbed or locked'\n      )\n    }\n\n    stream =\n      object instanceof ReadableStream ? object : ReadableStreamFrom(object)\n  }\n\n  // 11. If source is a byte sequence, then set action to a\n  // step that returns source and length to source’s length.\n  if (typeof source === 'string' || util.isBuffer(source)) {\n    length = Buffer.byteLength(source)\n  }\n\n  // 12. If action is non-null, then run these steps in in parallel:\n  if (action != null) {\n    // Run action.\n    let iterator\n    stream = new ReadableStream({\n      async start () {\n        iterator = action(object)[Symbol.asyncIterator]()\n      },\n      async pull (controller) {\n        const { value, done } = await iterator.next()\n        if (done) {\n          // When running action is done, close stream.\n          queueMicrotask(() => {\n            controller.close()\n            controller.byobRequest?.respond(0)\n          })\n        } else {\n          // Whenever one or more bytes are available and stream is not errored,\n          // enqueue a Uint8Array wrapping an ArrayBuffer containing the available\n          // bytes into stream.\n          if (!isErrored(stream)) {\n            const buffer = new Uint8Array(value)\n            if (buffer.byteLength) {\n              controller.enqueue(buffer)\n            }\n          }\n        }\n        return controller.desiredSize > 0\n      },\n      async cancel (reason) {\n        await iterator.return()\n      },\n      type: 'bytes'\n    })\n  }\n\n  // 13. Let body be a body whose stream is stream, source is source,\n  // and length is length.\n  const body = { stream, source, length }\n\n  // 14. Return (body, type).\n  return [body, type]\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit-safely-extract\nfunction safelyExtractBody (object, keepalive = false) {\n  // To safely extract a body and a `Content-Type` value from\n  // a byte sequence or BodyInit object object, run these steps:\n\n  // 1. If object is a ReadableStream object, then:\n  if (object instanceof ReadableStream) {\n    // Assert: object is neither disturbed nor locked.\n    // istanbul ignore next\n    assert(!util.isDisturbed(object), 'The body has already been consumed.')\n    // istanbul ignore next\n    assert(!object.locked, 'The stream is locked.')\n  }\n\n  // 2. Return the results of extracting object.\n  return extractBody(object, keepalive)\n}\n\nfunction cloneBody (instance, body) {\n  // To clone a body body, run these steps:\n\n  // https://fetch.spec.whatwg.org/#concept-body-clone\n\n  // 1. Let « out1, out2 » be the result of teeing body’s stream.\n  const [out1, out2] = body.stream.tee()\n\n  // 2. Set body’s stream to out1.\n  body.stream = out1\n\n  // 3. Return a body whose stream is out2 and other members are copied from body.\n  return {\n    stream: out2,\n    length: body.length,\n    source: body.source\n  }\n}\n\nfunction throwIfAborted (state) {\n  if (state.aborted) {\n    throw new DOMException('The operation was aborted.', 'AbortError')\n  }\n}\n\nfunction bodyMixinMethods (instance) {\n  const methods = {\n    blob () {\n      // The blob() method steps are to return the result of\n      // running consume body with this and the following step\n      // given a byte sequence bytes: return a Blob whose\n      // contents are bytes and whose type attribute is this’s\n      // MIME type.\n      return consumeBody(this, (bytes) => {\n        let mimeType = bodyMimeType(this)\n\n        if (mimeType === null) {\n          mimeType = ''\n        } else if (mimeType) {\n          mimeType = serializeAMimeType(mimeType)\n        }\n\n        // Return a Blob whose contents are bytes and type attribute\n        // is mimeType.\n        return new Blob([bytes], { type: mimeType })\n      }, instance)\n    },\n\n    arrayBuffer () {\n      // The arrayBuffer() method steps are to return the result\n      // of running consume body with this and the following step\n      // given a byte sequence bytes: return a new ArrayBuffer\n      // whose contents are bytes.\n      return consumeBody(this, (bytes) => {\n        return new Uint8Array(bytes).buffer\n      }, instance)\n    },\n\n    text () {\n      // The text() method steps are to return the result of running\n      // consume body with this and UTF-8 decode.\n      return consumeBody(this, utf8DecodeBytes, instance)\n    },\n\n    json () {\n      // The json() method steps are to return the result of running\n      // consume body with this and parse JSON from bytes.\n      return consumeBody(this, parseJSONFromBytes, instance)\n    },\n\n    formData () {\n      // The formData() method steps are to return the result of running\n      // consume body with this and the following step given a byte sequence bytes:\n      return consumeBody(this, (value) => {\n        // 1. Let mimeType be the result of get the MIME type with this.\n        const mimeType = bodyMimeType(this)\n\n        // 2. If mimeType is non-null, then switch on mimeType’s essence and run\n        //    the corresponding steps:\n        if (mimeType !== null) {\n          switch (mimeType.essence) {\n            case 'multipart/form-data': {\n              // 1. ... [long step]\n              const parsed = multipartFormDataParser(value, mimeType)\n\n              // 2. If that fails for some reason, then throw a TypeError.\n              if (parsed === 'failure') {\n                throw new TypeError('Failed to parse body as FormData.')\n              }\n\n              // 3. Return a new FormData object, appending each entry,\n              //    resulting from the parsing operation, to its entry list.\n              const fd = new FormData()\n              fd[kState] = parsed\n\n              return fd\n            }\n            case 'application/x-www-form-urlencoded': {\n              // 1. Let entries be the result of parsing bytes.\n              const entries = new URLSearchParams(value.toString())\n\n              // 2. If entries is failure, then throw a TypeError.\n\n              // 3. Return a new FormData object whose entry list is entries.\n              const fd = new FormData()\n\n              for (const [name, value] of entries) {\n                fd.append(name, value)\n              }\n\n              return fd\n            }\n          }\n        }\n\n        // 3. Throw a TypeError.\n        throw new TypeError(\n          'Content-Type was not one of \"multipart/form-data\" or \"application/x-www-form-urlencoded\".'\n        )\n      }, instance)\n    },\n\n    bytes () {\n      // The bytes() method steps are to return the result of running consume body\n      // with this and the following step given a byte sequence bytes: return the\n      // result of creating a Uint8Array from bytes in this’s relevant realm.\n      return consumeBody(this, (bytes) => {\n        return new Uint8Array(bytes)\n      }, instance)\n    }\n  }\n\n  return methods\n}\n\nfunction mixinBody (prototype) {\n  Object.assign(prototype.prototype, bodyMixinMethods(prototype))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-consume-body\n * @param {Response|Request} object\n * @param {(value: unknown) => unknown} convertBytesToJSValue\n * @param {Response|Request} instance\n */\nasync function consumeBody (object, convertBytesToJSValue, instance) {\n  webidl.brandCheck(object, instance)\n\n  // 1. If object is unusable, then return a promise rejected\n  //    with a TypeError.\n  if (bodyUnusable(object)) {\n    throw new TypeError('Body is unusable: Body has already been read')\n  }\n\n  throwIfAborted(object[kState])\n\n  // 2. Let promise be a new promise.\n  const promise = createDeferredPromise()\n\n  // 3. Let errorSteps given error be to reject promise with error.\n  const errorSteps = (error) => promise.reject(error)\n\n  // 4. Let successSteps given a byte sequence data be to resolve\n  //    promise with the result of running convertBytesToJSValue\n  //    with data. If that threw an exception, then run errorSteps\n  //    with that exception.\n  const successSteps = (data) => {\n    try {\n      promise.resolve(convertBytesToJSValue(data))\n    } catch (e) {\n      errorSteps(e)\n    }\n  }\n\n  // 5. If object’s body is null, then run successSteps with an\n  //    empty byte sequence.\n  if (object[kState].body == null) {\n    successSteps(Buffer.allocUnsafe(0))\n    return promise.promise\n  }\n\n  // 6. Otherwise, fully read object’s body given successSteps,\n  //    errorSteps, and object’s relevant global object.\n  await fullyReadBody(object[kState].body, successSteps, errorSteps)\n\n  // 7. Return promise.\n  return promise.promise\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction bodyUnusable (object) {\n  const body = object[kState].body\n\n  // An object including the Body interface mixin is\n  // said to be unusable if its body is non-null and\n  // its body’s stream is disturbed or locked.\n  return body != null && (body.stream.locked || util.isDisturbed(body.stream))\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value\n * @param {Uint8Array} bytes\n */\nfunction parseJSONFromBytes (bytes) {\n  return JSON.parse(utf8DecodeBytes(bytes))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-mime-type\n * @param {import('./response').Response|import('./request').Request} requestOrResponse\n */\nfunction bodyMimeType (requestOrResponse) {\n  // 1. Let headers be null.\n  // 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.\n  // 3. Otherwise, set headers to requestOrResponse’s response’s header list.\n  /** @type {import('./headers').HeadersList} */\n  const headers = requestOrResponse[kState].headersList\n\n  // 4. Let mimeType be the result of extracting a MIME type from headers.\n  const mimeType = extractMimeType(headers)\n\n  // 5. If mimeType is failure, then return null.\n  if (mimeType === 'failure') {\n    return null\n  }\n\n  // 6. Return mimeType.\n  return mimeType\n}\n\nmodule.exports = {\n  extractBody,\n  safelyExtractBody,\n  cloneBody,\n  mixinBody,\n  streamRegistry,\n  hasFinalizationRegistry,\n  bodyUnusable\n}\n","'use strict'\n\nconst corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])\n\nconst redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])\nconst redirectStatusSet = new Set(redirectStatus)\n\n/**\n * @see https://fetch.spec.whatwg.org/#block-bad-port\n */\nconst badPorts = /** @type {const} */ ([\n  '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n  '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n  '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n  '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n  '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',\n  '6697', '10080'\n])\nconst badPortsSet = new Set(badPorts)\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\n */\nconst referrerPolicy = /** @type {const} */ ([\n  '',\n  'no-referrer',\n  'no-referrer-when-downgrade',\n  'same-origin',\n  'origin',\n  'strict-origin',\n  'origin-when-cross-origin',\n  'strict-origin-when-cross-origin',\n  'unsafe-url'\n])\nconst referrerPolicySet = new Set(referrerPolicy)\n\nconst requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])\n\nconst safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])\n\nconst requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])\n\nconst requestCache = /** @type {const} */ ([\n  'default',\n  'no-store',\n  'reload',\n  'no-cache',\n  'force-cache',\n  'only-if-cached'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-body-header-name\n */\nconst requestBodyHeader = /** @type {const} */ ([\n  'content-encoding',\n  'content-language',\n  'content-location',\n  'content-type',\n  // See https://github.com/nodejs/undici/issues/2021\n  // 'Content-Length' is a forbidden header name, which is typically\n  // removed in the Headers implementation. However, undici doesn't\n  // filter out headers, so we add it here.\n  'content-length'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex\n */\nconst requestDuplex = /** @type {const} */ ([\n  'half'\n])\n\n/**\n * @see http://fetch.spec.whatwg.org/#forbidden-method\n */\nconst forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = /** @type {const} */ ([\n  'audio',\n  'audioworklet',\n  'font',\n  'image',\n  'manifest',\n  'paintworklet',\n  'script',\n  'style',\n  'track',\n  'video',\n  'xslt',\n  ''\n])\nconst subresourceSet = new Set(subresource)\n\nmodule.exports = {\n  subresource,\n  forbiddenMethods,\n  requestBodyHeader,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  redirectStatus,\n  corsSafeListedMethods,\n  nullBodyStatus,\n  safeMethods,\n  badPorts,\n  requestDuplex,\n  subresourceSet,\n  badPortsSet,\n  redirectStatusSet,\n  corsSafeListedMethodsSet,\n  safeMethodsSet,\n  forbiddenMethodsSet,\n  referrerPolicySet\n}\n","'use strict'\n\nconst assert = require('node:assert')\n\nconst encoder = new TextEncoder()\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-token-code-point\n */\nconst HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\\-.^_|~A-Za-z0-9]+$/\nconst HTTP_WHITESPACE_REGEX = /[\\u000A\\u000D\\u0009\\u0020]/ // eslint-disable-line\nconst ASCII_WHITESPACE_REPLACE_REGEX = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/g // eslint-disable-line\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point\n */\nconst HTTP_QUOTED_STRING_TOKENS = /^[\\u0009\\u0020-\\u007E\\u0080-\\u00FF]+$/ // eslint-disable-line\n\n// https://fetch.spec.whatwg.org/#data-url-processor\n/** @param {URL} dataURL */\nfunction dataURLProcessor (dataURL) {\n  // 1. Assert: dataURL’s scheme is \"data\".\n  assert(dataURL.protocol === 'data:')\n\n  // 2. Let input be the result of running the URL\n  // serializer on dataURL with exclude fragment\n  // set to true.\n  let input = URLSerializer(dataURL, true)\n\n  // 3. Remove the leading \"data:\" string from input.\n  input = input.slice(5)\n\n  // 4. Let position point at the start of input.\n  const position = { position: 0 }\n\n  // 5. Let mimeType be the result of collecting a\n  // sequence of code points that are not equal\n  // to U+002C (,), given position.\n  let mimeType = collectASequenceOfCodePointsFast(\n    ',',\n    input,\n    position\n  )\n\n  // 6. Strip leading and trailing ASCII whitespace\n  // from mimeType.\n  // Undici implementation note: we need to store the\n  // length because if the mimetype has spaces removed,\n  // the wrong amount will be sliced from the input in\n  // step #9\n  const mimeTypeLength = mimeType.length\n  mimeType = removeASCIIWhitespace(mimeType, true, true)\n\n  // 7. If position is past the end of input, then\n  // return failure\n  if (position.position >= input.length) {\n    return 'failure'\n  }\n\n  // 8. Advance position by 1.\n  position.position++\n\n  // 9. Let encodedBody be the remainder of input.\n  const encodedBody = input.slice(mimeTypeLength + 1)\n\n  // 10. Let body be the percent-decoding of encodedBody.\n  let body = stringPercentDecode(encodedBody)\n\n  // 11. If mimeType ends with U+003B (;), followed by\n  // zero or more U+0020 SPACE, followed by an ASCII\n  // case-insensitive match for \"base64\", then:\n  if (/;(\\u0020){0,}base64$/i.test(mimeType)) {\n    // 1. Let stringBody be the isomorphic decode of body.\n    const stringBody = isomorphicDecode(body)\n\n    // 2. Set body to the forgiving-base64 decode of\n    // stringBody.\n    body = forgivingBase64(stringBody)\n\n    // 3. If body is failure, then return failure.\n    if (body === 'failure') {\n      return 'failure'\n    }\n\n    // 4. Remove the last 6 code points from mimeType.\n    mimeType = mimeType.slice(0, -6)\n\n    // 5. Remove trailing U+0020 SPACE code points from mimeType,\n    // if any.\n    mimeType = mimeType.replace(/(\\u0020)+$/, '')\n\n    // 6. Remove the last U+003B (;) code point from mimeType.\n    mimeType = mimeType.slice(0, -1)\n  }\n\n  // 12. If mimeType starts with U+003B (;), then prepend\n  // \"text/plain\" to mimeType.\n  if (mimeType.startsWith(';')) {\n    mimeType = 'text/plain' + mimeType\n  }\n\n  // 13. Let mimeTypeRecord be the result of parsing\n  // mimeType.\n  let mimeTypeRecord = parseMIMEType(mimeType)\n\n  // 14. If mimeTypeRecord is failure, then set\n  // mimeTypeRecord to text/plain;charset=US-ASCII.\n  if (mimeTypeRecord === 'failure') {\n    mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')\n  }\n\n  // 15. Return a new data: URL struct whose MIME\n  // type is mimeTypeRecord and body is body.\n  // https://fetch.spec.whatwg.org/#data-url-struct\n  return { mimeType: mimeTypeRecord, body }\n}\n\n// https://url.spec.whatwg.org/#concept-url-serializer\n/**\n * @param {URL} url\n * @param {boolean} excludeFragment\n */\nfunction URLSerializer (url, excludeFragment = false) {\n  if (!excludeFragment) {\n    return url.href\n  }\n\n  const href = url.href\n  const hashLength = url.hash.length\n\n  const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength)\n\n  if (!hashLength && href.endsWith('#')) {\n    return serialized.slice(0, -1)\n  }\n\n  return serialized\n}\n\n// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n/**\n * @param {(char: string) => boolean} condition\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePoints (condition, input, position) {\n  // 1. Let result be the empty string.\n  let result = ''\n\n  // 2. While position doesn’t point past the end of input and the\n  // code point at position within input meets the condition condition:\n  while (position.position < input.length && condition(input[position.position])) {\n    // 1. Append that code point to the end of result.\n    result += input[position.position]\n\n    // 2. Advance position by 1.\n    position.position++\n  }\n\n  // 3. Return result.\n  return result\n}\n\n/**\n * A faster collectASequenceOfCodePoints that only works when comparing a single character.\n * @param {string} char\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePointsFast (char, input, position) {\n  const idx = input.indexOf(char, position.position)\n  const start = position.position\n\n  if (idx === -1) {\n    position.position = input.length\n    return input.slice(start)\n  }\n\n  position.position = idx\n  return input.slice(start, position.position)\n}\n\n// https://url.spec.whatwg.org/#string-percent-decode\n/** @param {string} input */\nfunction stringPercentDecode (input) {\n  // 1. Let bytes be the UTF-8 encoding of input.\n  const bytes = encoder.encode(input)\n\n  // 2. Return the percent-decoding of bytes.\n  return percentDecode(bytes)\n}\n\n/**\n * @param {number} byte\n */\nfunction isHexCharByte (byte) {\n  // 0-9 A-F a-f\n  return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66)\n}\n\n/**\n * @param {number} byte\n */\nfunction hexByteToNumber (byte) {\n  return (\n    // 0-9\n    byte >= 0x30 && byte <= 0x39\n      ? (byte - 48)\n    // Convert to uppercase\n    // ((byte & 0xDF) - 65) + 10\n      : ((byte & 0xDF) - 55)\n  )\n}\n\n// https://url.spec.whatwg.org/#percent-decode\n/** @param {Uint8Array} input */\nfunction percentDecode (input) {\n  const length = input.length\n  // 1. Let output be an empty byte sequence.\n  /** @type {Uint8Array} */\n  const output = new Uint8Array(length)\n  let j = 0\n  // 2. For each byte byte in input:\n  for (let i = 0; i < length; ++i) {\n    const byte = input[i]\n\n    // 1. If byte is not 0x25 (%), then append byte to output.\n    if (byte !== 0x25) {\n      output[j++] = byte\n\n    // 2. Otherwise, if byte is 0x25 (%) and the next two bytes\n    // after byte in input are not in the ranges\n    // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),\n    // and 0x61 (a) to 0x66 (f), all inclusive, append byte\n    // to output.\n    } else if (\n      byte === 0x25 &&\n      !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))\n    ) {\n      output[j++] = 0x25\n\n    // 3. Otherwise:\n    } else {\n      // 1. Let bytePoint be the two bytes after byte in input,\n      // decoded, and then interpreted as hexadecimal number.\n      // 2. Append a byte whose value is bytePoint to output.\n      output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2])\n\n      // 3. Skip the next two bytes in input.\n      i += 2\n    }\n  }\n\n  // 3. Return output.\n  return length === j ? output : output.subarray(0, j)\n}\n\n// https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n/** @param {string} input */\nfunction parseMIMEType (input) {\n  // 1. Remove any leading and trailing HTTP whitespace\n  // from input.\n  input = removeHTTPWhitespace(input, true, true)\n\n  // 2. Let position be a position variable for input,\n  // initially pointing at the start of input.\n  const position = { position: 0 }\n\n  // 3. Let type be the result of collecting a sequence\n  // of code points that are not U+002F (/) from\n  // input, given position.\n  const type = collectASequenceOfCodePointsFast(\n    '/',\n    input,\n    position\n  )\n\n  // 4. If type is the empty string or does not solely\n  // contain HTTP token code points, then return failure.\n  // https://mimesniff.spec.whatwg.org/#http-token-code-point\n  if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n    return 'failure'\n  }\n\n  // 5. If position is past the end of input, then return\n  // failure\n  if (position.position > input.length) {\n    return 'failure'\n  }\n\n  // 6. Advance position by 1. (This skips past U+002F (/).)\n  position.position++\n\n  // 7. Let subtype be the result of collecting a sequence of\n  // code points that are not U+003B (;) from input, given\n  // position.\n  let subtype = collectASequenceOfCodePointsFast(\n    ';',\n    input,\n    position\n  )\n\n  // 8. Remove any trailing HTTP whitespace from subtype.\n  subtype = removeHTTPWhitespace(subtype, false, true)\n\n  // 9. If subtype is the empty string or does not solely\n  // contain HTTP token code points, then return failure.\n  if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n    return 'failure'\n  }\n\n  const typeLowercase = type.toLowerCase()\n  const subtypeLowercase = subtype.toLowerCase()\n\n  // 10. Let mimeType be a new MIME type record whose type\n  // is type, in ASCII lowercase, and subtype is subtype,\n  // in ASCII lowercase.\n  // https://mimesniff.spec.whatwg.org/#mime-type\n  const mimeType = {\n    type: typeLowercase,\n    subtype: subtypeLowercase,\n    /** @type {Map} */\n    parameters: new Map(),\n    // https://mimesniff.spec.whatwg.org/#mime-type-essence\n    essence: `${typeLowercase}/${subtypeLowercase}`\n  }\n\n  // 11. While position is not past the end of input:\n  while (position.position < input.length) {\n    // 1. Advance position by 1. (This skips past U+003B (;).)\n    position.position++\n\n    // 2. Collect a sequence of code points that are HTTP\n    // whitespace from input given position.\n    collectASequenceOfCodePoints(\n      // https://fetch.spec.whatwg.org/#http-whitespace\n      char => HTTP_WHITESPACE_REGEX.test(char),\n      input,\n      position\n    )\n\n    // 3. Let parameterName be the result of collecting a\n    // sequence of code points that are not U+003B (;)\n    // or U+003D (=) from input, given position.\n    let parameterName = collectASequenceOfCodePoints(\n      (char) => char !== ';' && char !== '=',\n      input,\n      position\n    )\n\n    // 4. Set parameterName to parameterName, in ASCII\n    // lowercase.\n    parameterName = parameterName.toLowerCase()\n\n    // 5. If position is not past the end of input, then:\n    if (position.position < input.length) {\n      // 1. If the code point at position within input is\n      // U+003B (;), then continue.\n      if (input[position.position] === ';') {\n        continue\n      }\n\n      // 2. Advance position by 1. (This skips past U+003D (=).)\n      position.position++\n    }\n\n    // 6. If position is past the end of input, then break.\n    if (position.position > input.length) {\n      break\n    }\n\n    // 7. Let parameterValue be null.\n    let parameterValue = null\n\n    // 8. If the code point at position within input is\n    // U+0022 (\"), then:\n    if (input[position.position] === '\"') {\n      // 1. Set parameterValue to the result of collecting\n      // an HTTP quoted string from input, given position\n      // and the extract-value flag.\n      parameterValue = collectAnHTTPQuotedString(input, position, true)\n\n      // 2. Collect a sequence of code points that are not\n      // U+003B (;) from input, given position.\n      collectASequenceOfCodePointsFast(\n        ';',\n        input,\n        position\n      )\n\n    // 9. Otherwise:\n    } else {\n      // 1. Set parameterValue to the result of collecting\n      // a sequence of code points that are not U+003B (;)\n      // from input, given position.\n      parameterValue = collectASequenceOfCodePointsFast(\n        ';',\n        input,\n        position\n      )\n\n      // 2. Remove any trailing HTTP whitespace from parameterValue.\n      parameterValue = removeHTTPWhitespace(parameterValue, false, true)\n\n      // 3. If parameterValue is the empty string, then continue.\n      if (parameterValue.length === 0) {\n        continue\n      }\n    }\n\n    // 10. If all of the following are true\n    // - parameterName is not the empty string\n    // - parameterName solely contains HTTP token code points\n    // - parameterValue solely contains HTTP quoted-string token code points\n    // - mimeType’s parameters[parameterName] does not exist\n    // then set mimeType’s parameters[parameterName] to parameterValue.\n    if (\n      parameterName.length !== 0 &&\n      HTTP_TOKEN_CODEPOINTS.test(parameterName) &&\n      (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&\n      !mimeType.parameters.has(parameterName)\n    ) {\n      mimeType.parameters.set(parameterName, parameterValue)\n    }\n  }\n\n  // 12. Return mimeType.\n  return mimeType\n}\n\n// https://infra.spec.whatwg.org/#forgiving-base64-decode\n/** @param {string} data */\nfunction forgivingBase64 (data) {\n  // 1. Remove all ASCII whitespace from data.\n  data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '')  // eslint-disable-line\n\n  let dataLength = data.length\n  // 2. If data’s code point length divides by 4 leaving\n  // no remainder, then:\n  if (dataLength % 4 === 0) {\n    // 1. If data ends with one or two U+003D (=) code points,\n    // then remove them from data.\n    if (data.charCodeAt(dataLength - 1) === 0x003D) {\n      --dataLength\n      if (data.charCodeAt(dataLength - 1) === 0x003D) {\n        --dataLength\n      }\n    }\n  }\n\n  // 3. If data’s code point length divides by 4 leaving\n  // a remainder of 1, then return failure.\n  if (dataLength % 4 === 1) {\n    return 'failure'\n  }\n\n  // 4. If data contains a code point that is not one of\n  //  U+002B (+)\n  //  U+002F (/)\n  //  ASCII alphanumeric\n  // then return failure.\n  if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {\n    return 'failure'\n  }\n\n  const buffer = Buffer.from(data, 'base64')\n  return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\n// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string\n// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string\n/**\n * @param {string} input\n * @param {{ position: number }} position\n * @param {boolean?} extractValue\n */\nfunction collectAnHTTPQuotedString (input, position, extractValue) {\n  // 1. Let positionStart be position.\n  const positionStart = position.position\n\n  // 2. Let value be the empty string.\n  let value = ''\n\n  // 3. Assert: the code point at position within input\n  // is U+0022 (\").\n  assert(input[position.position] === '\"')\n\n  // 4. Advance position by 1.\n  position.position++\n\n  // 5. While true:\n  while (true) {\n    // 1. Append the result of collecting a sequence of code points\n    // that are not U+0022 (\") or U+005C (\\) from input, given\n    // position, to value.\n    value += collectASequenceOfCodePoints(\n      (char) => char !== '\"' && char !== '\\\\',\n      input,\n      position\n    )\n\n    // 2. If position is past the end of input, then break.\n    if (position.position >= input.length) {\n      break\n    }\n\n    // 3. Let quoteOrBackslash be the code point at position within\n    // input.\n    const quoteOrBackslash = input[position.position]\n\n    // 4. Advance position by 1.\n    position.position++\n\n    // 5. If quoteOrBackslash is U+005C (\\), then:\n    if (quoteOrBackslash === '\\\\') {\n      // 1. If position is past the end of input, then append\n      // U+005C (\\) to value and break.\n      if (position.position >= input.length) {\n        value += '\\\\'\n        break\n      }\n\n      // 2. Append the code point at position within input to value.\n      value += input[position.position]\n\n      // 3. Advance position by 1.\n      position.position++\n\n    // 6. Otherwise:\n    } else {\n      // 1. Assert: quoteOrBackslash is U+0022 (\").\n      assert(quoteOrBackslash === '\"')\n\n      // 2. Break.\n      break\n    }\n  }\n\n  // 6. If the extract-value flag is set, then return value.\n  if (extractValue) {\n    return value\n  }\n\n  // 7. Return the code points from positionStart to position,\n  // inclusive, within input.\n  return input.slice(positionStart, position.position)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serializeAMimeType (mimeType) {\n  assert(mimeType !== 'failure')\n  const { parameters, essence } = mimeType\n\n  // 1. Let serialization be the concatenation of mimeType’s\n  //    type, U+002F (/), and mimeType’s subtype.\n  let serialization = essence\n\n  // 2. For each name → value of mimeType’s parameters:\n  for (let [name, value] of parameters.entries()) {\n    // 1. Append U+003B (;) to serialization.\n    serialization += ';'\n\n    // 2. Append name to serialization.\n    serialization += name\n\n    // 3. Append U+003D (=) to serialization.\n    serialization += '='\n\n    // 4. If value does not solely contain HTTP token code\n    //    points or value is the empty string, then:\n    if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n      // 1. Precede each occurrence of U+0022 (\") or\n      //    U+005C (\\) in value with U+005C (\\).\n      value = value.replace(/(\\\\|\")/g, '\\\\$1')\n\n      // 2. Prepend U+0022 (\") to value.\n      value = '\"' + value\n\n      // 3. Append U+0022 (\") to value.\n      value += '\"'\n    }\n\n    // 5. Append value to serialization.\n    serialization += value\n  }\n\n  // 3. Return serialization.\n  return serialization\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {number} char\n */\nfunction isHTTPWhiteSpace (char) {\n  // \"\\r\\n\\t \"\n  return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeHTTPWhitespace (str, leading = true, trailing = true) {\n  return removeChars(str, leading, trailing, isHTTPWhiteSpace)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n * @param {number} char\n */\nfunction isASCIIWhitespace (char) {\n  // \"\\r\\n\\t\\f \"\n  return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x00c || char === 0x020\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeASCIIWhitespace (str, leading = true, trailing = true) {\n  return removeChars(str, leading, trailing, isASCIIWhitespace)\n}\n\n/**\n * @param {string} str\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns\n */\nfunction removeChars (str, leading, trailing, predicate) {\n  let lead = 0\n  let trail = str.length - 1\n\n  if (leading) {\n    while (lead < str.length && predicate(str.charCodeAt(lead))) lead++\n  }\n\n  if (trailing) {\n    while (trail > 0 && predicate(str.charCodeAt(trail))) trail--\n  }\n\n  return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-decode\n * @param {Uint8Array} input\n * @returns {string}\n */\nfunction isomorphicDecode (input) {\n  // 1. To isomorphic decode a byte sequence input, return a string whose code point\n  //    length is equal to input’s length and whose code points have the same values\n  //    as the values of input’s bytes, in the same order.\n  const length = input.length\n  if ((2 << 15) - 1 > length) {\n    return String.fromCharCode.apply(null, input)\n  }\n  let result = ''; let i = 0\n  let addition = (2 << 15) - 1\n  while (i < length) {\n    if (i + addition > length) {\n      addition = length - i\n    }\n    result += String.fromCharCode.apply(null, input.subarray(i, i += addition))\n  }\n  return result\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type\n * @param {Exclude, 'failure'>} mimeType\n */\nfunction minimizeSupportedMimeType (mimeType) {\n  switch (mimeType.essence) {\n    case 'application/ecmascript':\n    case 'application/javascript':\n    case 'application/x-ecmascript':\n    case 'application/x-javascript':\n    case 'text/ecmascript':\n    case 'text/javascript':\n    case 'text/javascript1.0':\n    case 'text/javascript1.1':\n    case 'text/javascript1.2':\n    case 'text/javascript1.3':\n    case 'text/javascript1.4':\n    case 'text/javascript1.5':\n    case 'text/jscript':\n    case 'text/livescript':\n    case 'text/x-ecmascript':\n    case 'text/x-javascript':\n      // 1. If mimeType is a JavaScript MIME type, then return \"text/javascript\".\n      return 'text/javascript'\n    case 'application/json':\n    case 'text/json':\n      // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n      return 'application/json'\n    case 'image/svg+xml':\n      // 3. If mimeType’s essence is \"image/svg+xml\", then return \"image/svg+xml\".\n      return 'image/svg+xml'\n    case 'text/xml':\n    case 'application/xml':\n      // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n      return 'application/xml'\n  }\n\n  // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n  if (mimeType.subtype.endsWith('+json')) {\n    return 'application/json'\n  }\n\n  // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n  if (mimeType.subtype.endsWith('+xml')) {\n    return 'application/xml'\n  }\n\n  // 5. If mimeType is supported by the user agent, then return mimeType’s essence.\n  // Technically, node doesn't support any mimetypes.\n\n  // 6. Return the empty string.\n  return ''\n}\n\nmodule.exports = {\n  dataURLProcessor,\n  URLSerializer,\n  collectASequenceOfCodePoints,\n  collectASequenceOfCodePointsFast,\n  stringPercentDecode,\n  parseMIMEType,\n  collectAnHTTPQuotedString,\n  serializeAMimeType,\n  removeChars,\n  removeHTTPWhitespace,\n  minimizeSupportedMimeType,\n  HTTP_TOKEN_CODEPOINTS,\n  isomorphicDecode\n}\n","'use strict'\n\nconst { kConnected, kSize } = require('../../core/symbols')\n\nclass CompatWeakRef {\n  constructor (value) {\n    this.value = value\n  }\n\n  deref () {\n    return this.value[kConnected] === 0 && this.value[kSize] === 0\n      ? undefined\n      : this.value\n  }\n}\n\nclass CompatFinalizer {\n  constructor (finalizer) {\n    this.finalizer = finalizer\n  }\n\n  register (dispatcher, key) {\n    if (dispatcher.on) {\n      dispatcher.on('disconnect', () => {\n        if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {\n          this.finalizer(key)\n        }\n      })\n    }\n  }\n\n  unregister (key) {}\n}\n\nmodule.exports = function () {\n  // FIXME: remove workaround when the Node bug is backported to v18\n  // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\n  if (process.env.NODE_V8_COVERAGE && process.version.startsWith('v18')) {\n    process._rawDebug('Using compatibility WeakRef and FinalizationRegistry')\n    return {\n      WeakRef: CompatWeakRef,\n      FinalizationRegistry: CompatFinalizer\n    }\n  }\n  return { WeakRef, FinalizationRegistry }\n}\n","'use strict'\n\nconst { Blob, File } = require('node:buffer')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\n\n// TODO(@KhafraDev): remove\nclass FileLike {\n  constructor (blobLike, fileName, options = {}) {\n    // TODO: argument idl type check\n\n    // The File constructor is invoked with two or three parameters, depending\n    // on whether the optional dictionary parameter is used. When the File()\n    // constructor is invoked, user agents must run the following steps:\n\n    // 1. Let bytes be the result of processing blob parts given fileBits and\n    // options.\n\n    // 2. Let n be the fileName argument to the constructor.\n    const n = fileName\n\n    // 3. Process FilePropertyBag dictionary argument by running the following\n    // substeps:\n\n    //    1. If the type member is provided and is not the empty string, let t\n    //    be set to the type dictionary member. If t contains any characters\n    //    outside the range U+0020 to U+007E, then set t to the empty string\n    //    and return from these substeps.\n    //    TODO\n    const t = options.type\n\n    //    2. Convert every character in t to ASCII lowercase.\n    //    TODO\n\n    //    3. If the lastModified member is provided, let d be set to the\n    //    lastModified dictionary member. If it is not provided, set d to the\n    //    current date and time represented as the number of milliseconds since\n    //    the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n    const d = options.lastModified ?? Date.now()\n\n    // 4. Return a new File object F such that:\n    // F refers to the bytes byte sequence.\n    // F.size is set to the number of total bytes in bytes.\n    // F.name is set to n.\n    // F.type is set to t.\n    // F.lastModified is set to d.\n\n    this[kState] = {\n      blobLike,\n      name: n,\n      type: t,\n      lastModified: d\n    }\n  }\n\n  stream (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.stream(...args)\n  }\n\n  arrayBuffer (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.arrayBuffer(...args)\n  }\n\n  slice (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.slice(...args)\n  }\n\n  text (...args) {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.text(...args)\n  }\n\n  get size () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.size\n  }\n\n  get type () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].blobLike.type\n  }\n\n  get name () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].name\n  }\n\n  get lastModified () {\n    webidl.brandCheck(this, FileLike)\n\n    return this[kState].lastModified\n  }\n\n  get [Symbol.toStringTag] () {\n    return 'File'\n  }\n}\n\nwebidl.converters.Blob = webidl.interfaceConverter(Blob)\n\n// If this function is moved to ./util.js, some tools (such as\n// rollup) will warn about circular dependencies. See:\n// https://github.com/nodejs/undici/issues/1629\nfunction isFileLike (object) {\n  return (\n    (object instanceof File) ||\n    (\n      object &&\n      (typeof object.stream === 'function' ||\n      typeof object.arrayBuffer === 'function') &&\n      object[Symbol.toStringTag] === 'File'\n    )\n  )\n}\n\nmodule.exports = { FileLike, isFileLike }\n","'use strict'\n\nconst { isUSVString, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { utf8DecodeBytes } = require('./util')\nconst { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require('./data-url')\nconst { isFileLike } = require('./file')\nconst { makeEntry } = require('./formdata')\nconst assert = require('node:assert')\nconst { File: NodeFile } = require('node:buffer')\n\nconst File = globalThis.File ?? NodeFile\n\nconst formDataNameBuffer = Buffer.from('form-data; name=\"')\nconst filenameBuffer = Buffer.from('; filename')\nconst dd = Buffer.from('--')\nconst ddcrlf = Buffer.from('--\\r\\n')\n\n/**\n * @param {string} chars\n */\nfunction isAsciiString (chars) {\n  for (let i = 0; i < chars.length; ++i) {\n    if ((chars.charCodeAt(i) & ~0x7F) !== 0) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary\n * @param {string} boundary\n */\nfunction validateBoundary (boundary) {\n  const length = boundary.length\n\n  // - its length is greater or equal to 27 and lesser or equal to 70, and\n  if (length < 27 || length > 70) {\n    return false\n  }\n\n  // - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or\n  //   0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),\n  //   0x2D (-) or 0x5F (_).\n  for (let i = 0; i < length; ++i) {\n    const cp = boundary.charCodeAt(i)\n\n    if (!(\n      (cp >= 0x30 && cp <= 0x39) ||\n      (cp >= 0x41 && cp <= 0x5a) ||\n      (cp >= 0x61 && cp <= 0x7a) ||\n      cp === 0x27 ||\n      cp === 0x2d ||\n      cp === 0x5f\n    )) {\n      return false\n    }\n  }\n\n  return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser\n * @param {Buffer} input\n * @param {ReturnType} mimeType\n */\nfunction multipartFormDataParser (input, mimeType) {\n  // 1. Assert: mimeType’s essence is \"multipart/form-data\".\n  assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')\n\n  const boundaryString = mimeType.parameters.get('boundary')\n\n  // 2. If mimeType’s parameters[\"boundary\"] does not exist, return failure.\n  //    Otherwise, let boundary be the result of UTF-8 decoding mimeType’s\n  //    parameters[\"boundary\"].\n  if (boundaryString === undefined) {\n    return 'failure'\n  }\n\n  const boundary = Buffer.from(`--${boundaryString}`, 'utf8')\n\n  // 3. Let entry list be an empty entry list.\n  const entryList = []\n\n  // 4. Let position be a pointer to a byte in input, initially pointing at\n  //    the first byte.\n  const position = { position: 0 }\n\n  // Note: undici addition, allows leading and trailing CRLFs.\n  while (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n    position.position += 2\n  }\n\n  let trailing = input.length\n\n  while (input[trailing - 1] === 0x0a && input[trailing - 2] === 0x0d) {\n    trailing -= 2\n  }\n\n  if (trailing !== input.length) {\n    input = input.subarray(0, trailing)\n  }\n\n  // 5. While true:\n  while (true) {\n    // 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D\n    //      (`--`) followed by boundary, advance position by 2 + the length of\n    //      boundary. Otherwise, return failure.\n    // Note: boundary is padded with 2 dashes already, no need to add 2.\n    if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {\n      position.position += boundary.length\n    } else {\n      return 'failure'\n    }\n\n    // 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A\n    //      (`--` followed by CR LF) followed by the end of input, return entry list.\n    // Note: a body does NOT need to end with CRLF. It can end with --.\n    if (\n      (position.position === input.length - 2 && bufferStartsWith(input, dd, position)) ||\n      (position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position))\n    ) {\n      return entryList\n    }\n\n    // 5.3. If position does not point to a sequence of bytes starting with 0x0D\n    //      0x0A (CR LF), return failure.\n    if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    }\n\n    // 5.4. Advance position by 2. (This skips past the newline.)\n    position.position += 2\n\n    // 5.5. Let name, filename and contentType be the result of parsing\n    //      multipart/form-data headers on input and position, if the result\n    //      is not failure. Otherwise, return failure.\n    const result = parseMultipartFormDataHeaders(input, position)\n\n    if (result === 'failure') {\n      return 'failure'\n    }\n\n    let { name, filename, contentType, encoding } = result\n\n    // 5.6. Advance position by 2. (This skips past the empty line that marks\n    //      the end of the headers.)\n    position.position += 2\n\n    // 5.7. Let body be the empty byte sequence.\n    let body\n\n    // 5.8. Body loop: While position is not past the end of input:\n    // TODO: the steps here are completely wrong\n    {\n      const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)\n\n      if (boundaryIndex === -1) {\n        return 'failure'\n      }\n\n      body = input.subarray(position.position, boundaryIndex - 4)\n\n      position.position += body.length\n\n      // Note: position must be advanced by the body's length before being\n      // decoded, otherwise the parsing will fail.\n      if (encoding === 'base64') {\n        body = Buffer.from(body.toString(), 'base64')\n      }\n    }\n\n    // 5.9. If position does not point to a sequence of bytes starting with\n    //      0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.\n    if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    } else {\n      position.position += 2\n    }\n\n    // 5.10. If filename is not null:\n    let value\n\n    if (filename !== null) {\n      // 5.10.1. If contentType is null, set contentType to \"text/plain\".\n      contentType ??= 'text/plain'\n\n      // 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.\n\n      // Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.\n      // Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.\n      if (!isAsciiString(contentType)) {\n        contentType = ''\n      }\n\n      // 5.10.3. Let value be a new File object with name filename, type contentType, and body body.\n      value = new File([body], filename, { type: contentType })\n    } else {\n      // 5.11. Otherwise:\n\n      // 5.11.1. Let value be the UTF-8 decoding without BOM of body.\n      value = utf8DecodeBytes(Buffer.from(body))\n    }\n\n    // 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.\n    assert(isUSVString(name))\n    assert((typeof value === 'string' && isUSVString(value)) || isFileLike(value))\n\n    // 5.13. Create an entry with name and value, and append it to entry list.\n    entryList.push(makeEntry(name, value, filename))\n  }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataHeaders (input, position) {\n  // 1. Let name, filename and contentType be null.\n  let name = null\n  let filename = null\n  let contentType = null\n  let encoding = null\n\n  // 2. While true:\n  while (true) {\n    // 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):\n    if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n      // 2.1.1. If name is null, return failure.\n      if (name === null) {\n        return 'failure'\n      }\n\n      // 2.1.2. Return name, filename and contentType.\n      return { name, filename, contentType, encoding }\n    }\n\n    // 2.2. Let header name be the result of collecting a sequence of bytes that are\n    //      not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.\n    let headerName = collectASequenceOfBytes(\n      (char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,\n      input,\n      position\n    )\n\n    // 2.3. Remove any HTTP tab or space bytes from the start or end of header name.\n    headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)\n\n    // 2.4. If header name does not match the field-name token production, return failure.\n    if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {\n      return 'failure'\n    }\n\n    // 2.5. If the byte at position is not 0x3A (:), return failure.\n    if (input[position.position] !== 0x3a) {\n      return 'failure'\n    }\n\n    // 2.6. Advance position by 1.\n    position.position++\n\n    // 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.\n    //      (Do nothing with those bytes.)\n    collectASequenceOfBytes(\n      (char) => char === 0x20 || char === 0x09,\n      input,\n      position\n    )\n\n    // 2.8. Byte-lowercase header name and switch on the result:\n    switch (bufferToLowerCasedHeaderName(headerName)) {\n      case 'content-disposition': {\n        // 1. Set name and filename to null.\n        name = filename = null\n\n        // 2. If position does not point to a sequence of bytes starting with\n        //    `form-data; name=\"`, return failure.\n        if (!bufferStartsWith(input, formDataNameBuffer, position)) {\n          return 'failure'\n        }\n\n        // 3. Advance position so it points at the byte after the next 0x22 (\")\n        //    byte (the one in the sequence of bytes matched above).\n        position.position += 17\n\n        // 4. Set name to the result of parsing a multipart/form-data name given\n        //    input and position, if the result is not failure. Otherwise, return\n        //    failure.\n        name = parseMultipartFormDataName(input, position)\n\n        if (name === null) {\n          return 'failure'\n        }\n\n        // 5. If position points to a sequence of bytes starting with `; filename=\"`:\n        if (bufferStartsWith(input, filenameBuffer, position)) {\n          // Note: undici also handles filename*\n          let check = position.position + filenameBuffer.length\n\n          if (input[check] === 0x2a) {\n            position.position += 1\n            check += 1\n          }\n\n          if (input[check] !== 0x3d || input[check + 1] !== 0x22) { // =\"\n            return 'failure'\n          }\n\n          // 1. Advance position so it points at the byte after the next 0x22 (\") byte\n          //    (the one in the sequence of bytes matched above).\n          position.position += 12\n\n          // 2. Set filename to the result of parsing a multipart/form-data name given\n          //    input and position, if the result is not failure. Otherwise, return failure.\n          filename = parseMultipartFormDataName(input, position)\n\n          if (filename === null) {\n            return 'failure'\n          }\n        }\n\n        break\n      }\n      case 'content-type': {\n        // 1. Let header value be the result of collecting a sequence of bytes that are\n        //    not 0x0A (LF) or 0x0D (CR), given position.\n        let headerValue = collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n\n        // 2. Remove any HTTP tab or space bytes from the end of header value.\n        headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n        // 3. Set contentType to the isomorphic decoding of header value.\n        contentType = isomorphicDecode(headerValue)\n\n        break\n      }\n      case 'content-transfer-encoding': {\n        let headerValue = collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n\n        headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n        encoding = isomorphicDecode(headerValue)\n\n        break\n      }\n      default: {\n        // Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.\n        // (Do nothing with those bytes.)\n        collectASequenceOfBytes(\n          (char) => char !== 0x0a && char !== 0x0d,\n          input,\n          position\n        )\n      }\n    }\n\n    // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A\n    //      (CR LF), return failure. Otherwise, advance position by 2 (past the newline).\n    if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {\n      return 'failure'\n    } else {\n      position.position += 2\n    }\n  }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-a-multipart-form-data-name\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataName (input, position) {\n  // 1. Assert: The byte at (position - 1) is 0x22 (\").\n  assert(input[position.position - 1] === 0x22)\n\n  // 2. Let name be the result of collecting a sequence of bytes that are not 0x0A (LF), 0x0D (CR) or 0x22 (\"), given position.\n  /** @type {string | Buffer} */\n  let name = collectASequenceOfBytes(\n    (char) => char !== 0x0a && char !== 0x0d && char !== 0x22,\n    input,\n    position\n  )\n\n  // 3. If the byte at position is not 0x22 (\"), return failure. Otherwise, advance position by 1.\n  if (input[position.position] !== 0x22) {\n    return null // name could be 'failure'\n  } else {\n    position.position++\n  }\n\n  // 4. Replace any occurrence of the following subsequences in name with the given byte:\n  // - `%0A`: 0x0A (LF)\n  // - `%0D`: 0x0D (CR)\n  // - `%22`: 0x22 (\")\n  name = new TextDecoder().decode(name)\n    .replace(/%0A/ig, '\\n')\n    .replace(/%0D/ig, '\\r')\n    .replace(/%22/g, '\"')\n\n  // 5. Return the UTF-8 decoding without BOM of name.\n  return name\n}\n\n/**\n * @param {(char: number) => boolean} condition\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfBytes (condition, input, position) {\n  let start = position.position\n\n  while (start < input.length && condition(input[start])) {\n    ++start\n  }\n\n  return input.subarray(position.position, (position.position = start))\n}\n\n/**\n * @param {Buffer} buf\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns {Buffer}\n */\nfunction removeChars (buf, leading, trailing, predicate) {\n  let lead = 0\n  let trail = buf.length - 1\n\n  if (leading) {\n    while (lead < buf.length && predicate(buf[lead])) lead++\n  }\n\n  if (trailing) {\n    while (trail > 0 && predicate(buf[trail])) trail--\n  }\n\n  return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)\n}\n\n/**\n * Checks if {@param buffer} starts with {@param start}\n * @param {Buffer} buffer\n * @param {Buffer} start\n * @param {{ position: number }} position\n */\nfunction bufferStartsWith (buffer, start, position) {\n  if (buffer.length < start.length) {\n    return false\n  }\n\n  for (let i = 0; i < start.length; i++) {\n    if (start[i] !== buffer[position.position + i]) {\n      return false\n    }\n  }\n\n  return true\n}\n\nmodule.exports = {\n  multipartFormDataParser,\n  validateBoundary\n}\n","'use strict'\n\nconst { isBlobLike, iteratorMixin } = require('./util')\nconst { kState } = require('./symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { FileLike, isFileLike } = require('./file')\nconst { webidl } = require('./webidl')\nconst { File: NativeFile } = require('node:buffer')\nconst nodeUtil = require('node:util')\n\n/** @type {globalThis['File']} */\nconst File = globalThis.File ?? NativeFile\n\n// https://xhr.spec.whatwg.org/#formdata\nclass FormData {\n  constructor (form) {\n    webidl.util.markAsUncloneable(this)\n\n    if (form !== undefined) {\n      throw webidl.errors.conversionFailed({\n        prefix: 'FormData constructor',\n        argument: 'Argument 1',\n        types: ['undefined']\n      })\n    }\n\n    this[kState] = []\n  }\n\n  append (name, value, filename = undefined) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.append'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    if (arguments.length === 3 && !isBlobLike(value)) {\n      throw new TypeError(\n        \"Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'\"\n      )\n    }\n\n    // 1. Let value be value if given; otherwise blobValue.\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n    value = isBlobLike(value)\n      ? webidl.converters.Blob(value, prefix, 'value', { strict: false })\n      : webidl.converters.USVString(value, prefix, 'value')\n    filename = arguments.length === 3\n      ? webidl.converters.USVString(filename, prefix, 'filename')\n      : undefined\n\n    // 2. Let entry be the result of creating an entry with\n    // name, value, and filename if given.\n    const entry = makeEntry(name, value, filename)\n\n    // 3. Append entry to this’s entry list.\n    this[kState].push(entry)\n  }\n\n  delete (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.delete'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // The delete(name) method steps are to remove all entries whose name\n    // is name from this’s entry list.\n    this[kState] = this[kState].filter(entry => entry.name !== name)\n  }\n\n  get (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.get'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // 1. If there is no entry whose name is name in this’s entry list,\n    // then return null.\n    const idx = this[kState].findIndex((entry) => entry.name === name)\n    if (idx === -1) {\n      return null\n    }\n\n    // 2. Return the value of the first entry whose name is name from\n    // this’s entry list.\n    return this[kState][idx].value\n  }\n\n  getAll (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.getAll'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // 1. If there is no entry whose name is name in this’s entry list,\n    // then return the empty list.\n    // 2. Return the values of all entries whose name is name, in order,\n    // from this’s entry list.\n    return this[kState]\n      .filter((entry) => entry.name === name)\n      .map((entry) => entry.value)\n  }\n\n  has (name) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.has'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n\n    // The has(name) method steps are to return true if there is an entry\n    // whose name is name in this’s entry list; otherwise false.\n    return this[kState].findIndex((entry) => entry.name === name) !== -1\n  }\n\n  set (name, value, filename = undefined) {\n    webidl.brandCheck(this, FormData)\n\n    const prefix = 'FormData.set'\n    webidl.argumentLengthCheck(arguments, 2, prefix)\n\n    if (arguments.length === 3 && !isBlobLike(value)) {\n      throw new TypeError(\n        \"Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'\"\n      )\n    }\n\n    // The set(name, value) and set(name, blobValue, filename) method steps\n    // are:\n\n    // 1. Let value be value if given; otherwise blobValue.\n\n    name = webidl.converters.USVString(name, prefix, 'name')\n    value = isBlobLike(value)\n      ? webidl.converters.Blob(value, prefix, 'name', { strict: false })\n      : webidl.converters.USVString(value, prefix, 'name')\n    filename = arguments.length === 3\n      ? webidl.converters.USVString(filename, prefix, 'name')\n      : undefined\n\n    // 2. Let entry be the result of creating an entry with name, value, and\n    // filename if given.\n    const entry = makeEntry(name, value, filename)\n\n    // 3. If there are entries in this’s entry list whose name is name, then\n    // replace the first such entry with entry and remove the others.\n    const idx = this[kState].findIndex((entry) => entry.name === name)\n    if (idx !== -1) {\n      this[kState] = [\n        ...this[kState].slice(0, idx),\n        entry,\n        ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)\n      ]\n    } else {\n      // 4. Otherwise, append entry to this’s entry list.\n      this[kState].push(entry)\n    }\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    const state = this[kState].reduce((a, b) => {\n      if (a[b.name]) {\n        if (Array.isArray(a[b.name])) {\n          a[b.name].push(b.value)\n        } else {\n          a[b.name] = [a[b.name], b.value]\n        }\n      } else {\n        a[b.name] = b.value\n      }\n\n      return a\n    }, { __proto__: null })\n\n    options.depth ??= depth\n    options.colors ??= true\n\n    const output = nodeUtil.formatWithOptions(options, state)\n\n    // remove [Object null prototype]\n    return `FormData ${output.slice(output.indexOf(']') + 2)}`\n  }\n}\n\niteratorMixin('FormData', FormData, kState, 'name', 'value')\n\nObject.defineProperties(FormData.prototype, {\n  append: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  get: kEnumerableProperty,\n  getAll: kEnumerableProperty,\n  has: kEnumerableProperty,\n  set: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'FormData',\n    configurable: true\n  }\n})\n\n/**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry\n * @param {string} name\n * @param {string|Blob} value\n * @param {?string} filename\n * @returns\n */\nfunction makeEntry (name, value, filename) {\n  // 1. Set name to the result of converting name into a scalar value string.\n  // Note: This operation was done by the webidl converter USVString.\n\n  // 2. If value is a string, then set value to the result of converting\n  //    value into a scalar value string.\n  if (typeof value === 'string') {\n    // Note: This operation was done by the webidl converter USVString.\n  } else {\n    // 3. Otherwise:\n\n    // 1. If value is not a File object, then set value to a new File object,\n    //    representing the same bytes, whose name attribute value is \"blob\"\n    if (!isFileLike(value)) {\n      value = value instanceof Blob\n        ? new File([value], 'blob', { type: value.type })\n        : new FileLike(value, 'blob', { type: value.type })\n    }\n\n    // 2. If filename is given, then set value to a new File object,\n    //    representing the same bytes, whose name attribute is filename.\n    if (filename !== undefined) {\n      /** @type {FilePropertyBag} */\n      const options = {\n        type: value.type,\n        lastModified: value.lastModified\n      }\n\n      value = value instanceof NativeFile\n        ? new File([value], filename, options)\n        : new FileLike(value, filename, options)\n    }\n  }\n\n  // 4. Return an entry whose name is name and whose value is value.\n  return { name, value }\n}\n\nmodule.exports = { FormData, makeEntry }\n","'use strict'\n\n// In case of breaking changes, increase the version\n// number to avoid conflicts.\nconst globalOrigin = Symbol.for('undici.globalOrigin.1')\n\nfunction getGlobalOrigin () {\n  return globalThis[globalOrigin]\n}\n\nfunction setGlobalOrigin (newOrigin) {\n  if (newOrigin === undefined) {\n    Object.defineProperty(globalThis, globalOrigin, {\n      value: undefined,\n      writable: true,\n      enumerable: false,\n      configurable: false\n    })\n\n    return\n  }\n\n  const parsedURL = new URL(newOrigin)\n\n  if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {\n    throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)\n  }\n\n  Object.defineProperty(globalThis, globalOrigin, {\n    value: parsedURL,\n    writable: true,\n    enumerable: false,\n    configurable: false\n  })\n}\n\nmodule.exports = {\n  getGlobalOrigin,\n  setGlobalOrigin\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst { kConstruct } = require('../../core/symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst {\n  iteratorMixin,\n  isValidHeaderName,\n  isValidHeaderValue\n} = require('./util')\nconst { webidl } = require('./webidl')\nconst assert = require('node:assert')\nconst util = require('node:util')\n\nconst kHeadersMap = Symbol('headers map')\nconst kHeadersSortedMap = Symbol('headers map sorted')\n\n/**\n * @param {number} code\n */\nfunction isHTTPWhiteSpaceCharCode (code) {\n  return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize\n * @param {string} potentialValue\n */\nfunction headerValueNormalize (potentialValue) {\n  //  To normalize a byte sequence potentialValue, remove\n  //  any leading and trailing HTTP whitespace bytes from\n  //  potentialValue.\n  let i = 0; let j = potentialValue.length\n\n  while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j\n  while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i\n\n  return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)\n}\n\nfunction fill (headers, object) {\n  // To fill a Headers object headers with a given object object, run these steps:\n\n  // 1. If object is a sequence, then for each header in object:\n  // Note: webidl conversion to array has already been done.\n  if (Array.isArray(object)) {\n    for (let i = 0; i < object.length; ++i) {\n      const header = object[i]\n      // 1. If header does not contain exactly two items, then throw a TypeError.\n      if (header.length !== 2) {\n        throw webidl.errors.exception({\n          header: 'Headers constructor',\n          message: `expected name/value pair to be length 2, found ${header.length}.`\n        })\n      }\n\n      // 2. Append (header’s first item, header’s second item) to headers.\n      appendHeader(headers, header[0], header[1])\n    }\n  } else if (typeof object === 'object' && object !== null) {\n    // Note: null should throw\n\n    // 2. Otherwise, object is a record, then for each key → value in object,\n    //    append (key, value) to headers\n    const keys = Object.keys(object)\n    for (let i = 0; i < keys.length; ++i) {\n      appendHeader(headers, keys[i], object[keys[i]])\n    }\n  } else {\n    throw webidl.errors.conversionFailed({\n      prefix: 'Headers constructor',\n      argument: 'Argument 1',\n      types: ['sequence>', 'record']\n    })\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-headers-append\n */\nfunction appendHeader (headers, name, value) {\n  // 1. Normalize value.\n  value = headerValueNormalize(value)\n\n  // 2. If name is not a header name or value is not a\n  //    header value, then throw a TypeError.\n  if (!isValidHeaderName(name)) {\n    throw webidl.errors.invalidArgument({\n      prefix: 'Headers.append',\n      value: name,\n      type: 'header name'\n    })\n  } else if (!isValidHeaderValue(value)) {\n    throw webidl.errors.invalidArgument({\n      prefix: 'Headers.append',\n      value,\n      type: 'header value'\n    })\n  }\n\n  // 3. If headers’s guard is \"immutable\", then throw a TypeError.\n  // 4. Otherwise, if headers’s guard is \"request\" and name is a\n  //    forbidden header name, return.\n  // 5. Otherwise, if headers’s guard is \"request-no-cors\":\n  //    TODO\n  // Note: undici does not implement forbidden header names\n  if (getHeadersGuard(headers) === 'immutable') {\n    throw new TypeError('immutable')\n  }\n\n  // 6. Otherwise, if headers’s guard is \"response\" and name is a\n  //    forbidden response-header name, return.\n\n  // 7. Append (name, value) to headers’s header list.\n  return getHeadersList(headers).append(name, value, false)\n\n  // 8. If headers’s guard is \"request-no-cors\", then remove\n  //    privileged no-CORS request headers from headers\n}\n\nfunction compareHeaderName (a, b) {\n  return a[0] < b[0] ? -1 : 1\n}\n\nclass HeadersList {\n  /** @type {[string, string][]|null} */\n  cookies = null\n\n  constructor (init) {\n    if (init instanceof HeadersList) {\n      this[kHeadersMap] = new Map(init[kHeadersMap])\n      this[kHeadersSortedMap] = init[kHeadersSortedMap]\n      this.cookies = init.cookies === null ? null : [...init.cookies]\n    } else {\n      this[kHeadersMap] = new Map(init)\n      this[kHeadersSortedMap] = null\n    }\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#header-list-contains\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   */\n  contains (name, isLowerCase) {\n    // A header list list contains a header name name if list\n    // contains a header whose name is a byte-case-insensitive\n    // match for name.\n\n    return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase())\n  }\n\n  clear () {\n    this[kHeadersMap].clear()\n    this[kHeadersSortedMap] = null\n    this.cookies = null\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-append\n   * @param {string} name\n   * @param {string} value\n   * @param {boolean} isLowerCase\n   */\n  append (name, value, isLowerCase) {\n    this[kHeadersSortedMap] = null\n\n    // 1. If list contains name, then set name to the first such\n    //    header’s name.\n    const lowercaseName = isLowerCase ? name : name.toLowerCase()\n    const exists = this[kHeadersMap].get(lowercaseName)\n\n    // 2. Append (name, value) to list.\n    if (exists) {\n      const delimiter = lowercaseName === 'cookie' ? '; ' : ', '\n      this[kHeadersMap].set(lowercaseName, {\n        name: exists.name,\n        value: `${exists.value}${delimiter}${value}`\n      })\n    } else {\n      this[kHeadersMap].set(lowercaseName, { name, value })\n    }\n\n    if (lowercaseName === 'set-cookie') {\n      (this.cookies ??= []).push(value)\n    }\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-set\n   * @param {string} name\n   * @param {string} value\n   * @param {boolean} isLowerCase\n   */\n  set (name, value, isLowerCase) {\n    this[kHeadersSortedMap] = null\n    const lowercaseName = isLowerCase ? name : name.toLowerCase()\n\n    if (lowercaseName === 'set-cookie') {\n      this.cookies = [value]\n    }\n\n    // 1. If list contains name, then set the value of\n    //    the first such header to value and remove the\n    //    others.\n    // 2. Otherwise, append header (name, value) to list.\n    this[kHeadersMap].set(lowercaseName, { name, value })\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-delete\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   */\n  delete (name, isLowerCase) {\n    this[kHeadersSortedMap] = null\n    if (!isLowerCase) name = name.toLowerCase()\n\n    if (name === 'set-cookie') {\n      this.cookies = null\n    }\n\n    this[kHeadersMap].delete(name)\n  }\n\n  /**\n   * @see https://fetch.spec.whatwg.org/#concept-header-list-get\n   * @param {string} name\n   * @param {boolean} isLowerCase\n   * @returns {string | null}\n   */\n  get (name, isLowerCase) {\n    // 1. If list does not contain name, then return null.\n    // 2. Return the values of all headers in list whose name\n    //    is a byte-case-insensitive match for name,\n    //    separated from each other by 0x2C 0x20, in order.\n    return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null\n  }\n\n  * [Symbol.iterator] () {\n    // use the lowercased name\n    for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n      yield [name, value]\n    }\n  }\n\n  get entries () {\n    const headers = {}\n\n    if (this[kHeadersMap].size !== 0) {\n      for (const { name, value } of this[kHeadersMap].values()) {\n        headers[name] = value\n      }\n    }\n\n    return headers\n  }\n\n  rawValues () {\n    return this[kHeadersMap].values()\n  }\n\n  get entriesList () {\n    const headers = []\n\n    if (this[kHeadersMap].size !== 0) {\n      for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) {\n        if (lowerName === 'set-cookie') {\n          for (const cookie of this.cookies) {\n            headers.push([name, cookie])\n          }\n        } else {\n          headers.push([name, value])\n        }\n      }\n    }\n\n    return headers\n  }\n\n  // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set\n  toSortedArray () {\n    const size = this[kHeadersMap].size\n    const array = new Array(size)\n    // In most cases, you will use the fast-path.\n    // fast-path: Use binary insertion sort for small arrays.\n    if (size <= 32) {\n      if (size === 0) {\n        // If empty, it is an empty array. To avoid the first index assignment.\n        return array\n      }\n      // Improve performance by unrolling loop and avoiding double-loop.\n      // Double-loop-less version of the binary insertion sort.\n      const iterator = this[kHeadersMap][Symbol.iterator]()\n      const firstValue = iterator.next().value\n      // set [name, value] to first index.\n      array[0] = [firstValue[0], firstValue[1].value]\n      // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n      // 3.2.2. Assert: value is non-null.\n      assert(firstValue[1].value !== null)\n      for (\n        let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value;\n        i < size;\n        ++i\n      ) {\n        // get next value\n        value = iterator.next().value\n        // set [name, value] to current index.\n        x = array[i] = [value[0], value[1].value]\n        // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n        // 3.2.2. Assert: value is non-null.\n        assert(x[1] !== null)\n        left = 0\n        right = i\n        // binary search\n        while (left < right) {\n          // middle index\n          pivot = left + ((right - left) >> 1)\n          // compare header name\n          if (array[pivot][0] <= x[0]) {\n            left = pivot + 1\n          } else {\n            right = pivot\n          }\n        }\n        if (i !== pivot) {\n          j = i\n          while (j > left) {\n            array[j] = array[--j]\n          }\n          array[left] = x\n        }\n      }\n      /* c8 ignore next 4 */\n      if (!iterator.next().done) {\n        // This is for debugging and will never be called.\n        throw new TypeError('Unreachable')\n      }\n      return array\n    } else {\n      // This case would be a rare occurrence.\n      // slow-path: fallback\n      let i = 0\n      for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n        array[i++] = [name, value]\n        // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n        // 3.2.2. Assert: value is non-null.\n        assert(value !== null)\n      }\n      return array.sort(compareHeaderName)\n    }\n  }\n}\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n  #guard\n  #headersList\n\n  constructor (init = undefined) {\n    webidl.util.markAsUncloneable(this)\n\n    if (init === kConstruct) {\n      return\n    }\n\n    this.#headersList = new HeadersList()\n\n    // The new Headers(init) constructor steps are:\n\n    // 1. Set this’s guard to \"none\".\n    this.#guard = 'none'\n\n    // 2. If init is given, then fill this with init.\n    if (init !== undefined) {\n      init = webidl.converters.HeadersInit(init, 'Headers contructor', 'init')\n      fill(this, init)\n    }\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-append\n  append (name, value) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 2, 'Headers.append')\n\n    const prefix = 'Headers.append'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n    value = webidl.converters.ByteString(value, prefix, 'value')\n\n    return appendHeader(this, name, value)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-delete\n  delete (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')\n\n    const prefix = 'Headers.delete'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix: 'Headers.delete',\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. If this’s guard is \"immutable\", then throw a TypeError.\n    // 3. Otherwise, if this’s guard is \"request\" and name is a\n    //    forbidden header name, return.\n    // 4. Otherwise, if this’s guard is \"request-no-cors\", name\n    //    is not a no-CORS-safelisted request-header name, and\n    //    name is not a privileged no-CORS request-header name,\n    //    return.\n    // 5. Otherwise, if this’s guard is \"response\" and name is\n    //    a forbidden response-header name, return.\n    // Note: undici does not implement forbidden header names\n    if (this.#guard === 'immutable') {\n      throw new TypeError('immutable')\n    }\n\n    // 6. If this’s header list does not contain name, then\n    //    return.\n    if (!this.#headersList.contains(name, false)) {\n      return\n    }\n\n    // 7. Delete name from this’s header list.\n    // 8. If this’s guard is \"request-no-cors\", then remove\n    //    privileged no-CORS request headers from this.\n    this.#headersList.delete(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-get\n  get (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.get')\n\n    const prefix = 'Headers.get'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. Return the result of getting name from this’s header\n    //    list.\n    return this.#headersList.get(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-has\n  has (name) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 1, 'Headers.has')\n\n    const prefix = 'Headers.has'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n\n    // 1. If name is not a header name, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    }\n\n    // 2. Return true if this’s header list contains name;\n    //    otherwise false.\n    return this.#headersList.contains(name, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-set\n  set (name, value) {\n    webidl.brandCheck(this, Headers)\n\n    webidl.argumentLengthCheck(arguments, 2, 'Headers.set')\n\n    const prefix = 'Headers.set'\n    name = webidl.converters.ByteString(name, prefix, 'name')\n    value = webidl.converters.ByteString(value, prefix, 'value')\n\n    // 1. Normalize value.\n    value = headerValueNormalize(value)\n\n    // 2. If name is not a header name or value is not a\n    //    header value, then throw a TypeError.\n    if (!isValidHeaderName(name)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value: name,\n        type: 'header name'\n      })\n    } else if (!isValidHeaderValue(value)) {\n      throw webidl.errors.invalidArgument({\n        prefix,\n        value,\n        type: 'header value'\n      })\n    }\n\n    // 3. If this’s guard is \"immutable\", then throw a TypeError.\n    // 4. Otherwise, if this’s guard is \"request\" and name is a\n    //    forbidden header name, return.\n    // 5. Otherwise, if this’s guard is \"request-no-cors\" and\n    //    name/value is not a no-CORS-safelisted request-header,\n    //    return.\n    // 6. Otherwise, if this’s guard is \"response\" and name is a\n    //    forbidden response-header name, return.\n    // Note: undici does not implement forbidden header names\n    if (this.#guard === 'immutable') {\n      throw new TypeError('immutable')\n    }\n\n    // 7. Set (name, value) in this’s header list.\n    // 8. If this’s guard is \"request-no-cors\", then remove\n    //    privileged no-CORS request headers from this\n    this.#headersList.set(name, value, false)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n  getSetCookie () {\n    webidl.brandCheck(this, Headers)\n\n    // 1. If this’s header list does not contain `Set-Cookie`, then return « ».\n    // 2. Return the values of all headers in this’s header list whose name is\n    //    a byte-case-insensitive match for `Set-Cookie`, in order.\n\n    const list = this.#headersList.cookies\n\n    if (list) {\n      return [...list]\n    }\n\n    return []\n  }\n\n  // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n  get [kHeadersSortedMap] () {\n    if (this.#headersList[kHeadersSortedMap]) {\n      return this.#headersList[kHeadersSortedMap]\n    }\n\n    // 1. Let headers be an empty list of headers with the key being the name\n    //    and value the value.\n    const headers = []\n\n    // 2. Let names be the result of convert header names to a sorted-lowercase\n    //    set with all the names of the headers in list.\n    const names = this.#headersList.toSortedArray()\n\n    const cookies = this.#headersList.cookies\n\n    // fast-path\n    if (cookies === null || cookies.length === 1) {\n      // Note: The non-null assertion of value has already been done by `HeadersList#toSortedArray`\n      return (this.#headersList[kHeadersSortedMap] = names)\n    }\n\n    // 3. For each name of names:\n    for (let i = 0; i < names.length; ++i) {\n      const { 0: name, 1: value } = names[i]\n      // 1. If name is `set-cookie`, then:\n      if (name === 'set-cookie') {\n        // 1. Let values be a list of all values of headers in list whose name\n        //    is a byte-case-insensitive match for name, in order.\n\n        // 2. For each value of values:\n        // 1. Append (name, value) to headers.\n        for (let j = 0; j < cookies.length; ++j) {\n          headers.push([name, cookies[j]])\n        }\n      } else {\n        // 2. Otherwise:\n\n        // 1. Let value be the result of getting name from list.\n\n        // 2. Assert: value is non-null.\n        // Note: This operation was done by `HeadersList#toSortedArray`.\n\n        // 3. Append (name, value) to headers.\n        headers.push([name, value])\n      }\n    }\n\n    // 4. Return headers.\n    return (this.#headersList[kHeadersSortedMap] = headers)\n  }\n\n  [util.inspect.custom] (depth, options) {\n    options.depth ??= depth\n\n    return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`\n  }\n\n  static getHeadersGuard (o) {\n    return o.#guard\n  }\n\n  static setHeadersGuard (o, guard) {\n    o.#guard = guard\n  }\n\n  static getHeadersList (o) {\n    return o.#headersList\n  }\n\n  static setHeadersList (o, list) {\n    o.#headersList = list\n  }\n}\n\nconst { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers\nReflect.deleteProperty(Headers, 'getHeadersGuard')\nReflect.deleteProperty(Headers, 'setHeadersGuard')\nReflect.deleteProperty(Headers, 'getHeadersList')\nReflect.deleteProperty(Headers, 'setHeadersList')\n\niteratorMixin('Headers', Headers, kHeadersSortedMap, 0, 1)\n\nObject.defineProperties(Headers.prototype, {\n  append: kEnumerableProperty,\n  delete: kEnumerableProperty,\n  get: kEnumerableProperty,\n  has: kEnumerableProperty,\n  set: kEnumerableProperty,\n  getSetCookie: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Headers',\n    configurable: true\n  },\n  [util.inspect.custom]: {\n    enumerable: false\n  }\n})\n\nwebidl.converters.HeadersInit = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === 'Object') {\n    const iterator = Reflect.get(V, Symbol.iterator)\n\n    // A work-around to ensure we send the properly-cased Headers when V is a Headers object.\n    // Read https://github.com/nodejs/undici/pull/3159#issuecomment-2075537226 before touching, please.\n    if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { // Headers object\n      try {\n        return getHeadersList(V).entriesList\n      } catch {\n        // fall-through\n      }\n    }\n\n    if (typeof iterator === 'function') {\n      return webidl.converters['sequence>'](V, prefix, argument, iterator.bind(V))\n    }\n\n    return webidl.converters['record'](V, prefix, argument)\n  }\n\n  throw webidl.errors.conversionFailed({\n    prefix: 'Headers constructor',\n    argument: 'Argument 1',\n    types: ['sequence>', 'record']\n  })\n}\n\nmodule.exports = {\n  fill,\n  // for test.\n  compareHeaderName,\n  Headers,\n  HeadersList,\n  getHeadersGuard,\n  setHeadersGuard,\n  setHeadersList,\n  getHeadersList\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst {\n  makeNetworkError,\n  makeAppropriateNetworkError,\n  filterResponse,\n  makeResponse,\n  fromInnerResponse\n} = require('./response')\nconst { HeadersList } = require('./headers')\nconst { Request, cloneRequest } = require('./request')\nconst zlib = require('node:zlib')\nconst {\n  bytesMatch,\n  makePolicyContainer,\n  clonePolicyContainer,\n  requestBadPort,\n  TAOCheck,\n  appendRequestOriginHeader,\n  responseLocationURL,\n  requestCurrentURL,\n  setRequestReferrerPolicyOnRedirect,\n  tryUpgradeRequestToAPotentiallyTrustworthyURL,\n  createOpaqueTimingInfo,\n  appendFetchMetadata,\n  corsCheck,\n  crossOriginResourcePolicyCheck,\n  determineRequestsReferrer,\n  coarsenedSharedCurrentTime,\n  createDeferredPromise,\n  isBlobLike,\n  sameOrigin,\n  isCancelled,\n  isAborted,\n  isErrorLike,\n  fullyReadBody,\n  readableStreamClose,\n  isomorphicEncode,\n  urlIsLocal,\n  urlIsHttpHttpsScheme,\n  urlHasHttpsScheme,\n  clampAndCoarsenConnectionTimingInfo,\n  simpleRangeHeaderValue,\n  buildContentRange,\n  createInflate,\n  extractMimeType\n} = require('./util')\nconst { kState, kDispatcher } = require('./symbols')\nconst assert = require('node:assert')\nconst { safelyExtractBody, extractBody } = require('./body')\nconst {\n  redirectStatusSet,\n  nullBodyStatus,\n  safeMethodsSet,\n  requestBodyHeader,\n  subresourceSet\n} = require('./constants')\nconst EE = require('node:events')\nconst { Readable, pipeline, finished } = require('node:stream')\nconst { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url')\nconst { getGlobalDispatcher } = require('../../global')\nconst { webidl } = require('./webidl')\nconst { STATUS_CODES } = require('node:http')\nconst GET_OR_HEAD = ['GET', 'HEAD']\n\nconst defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'\n  ? 'node'\n  : 'undici'\n\n/** @type {import('buffer').resolveObjectURL} */\nlet resolveObjectURL\n\nclass Fetch extends EE {\n  constructor (dispatcher) {\n    super()\n\n    this.dispatcher = dispatcher\n    this.connection = null\n    this.dump = false\n    this.state = 'ongoing'\n  }\n\n  terminate (reason) {\n    if (this.state !== 'ongoing') {\n      return\n    }\n\n    this.state = 'terminated'\n    this.connection?.destroy(reason)\n    this.emit('terminated', reason)\n  }\n\n  // https://fetch.spec.whatwg.org/#fetch-controller-abort\n  abort (error) {\n    if (this.state !== 'ongoing') {\n      return\n    }\n\n    // 1. Set controller’s state to \"aborted\".\n    this.state = 'aborted'\n\n    // 2. Let fallbackError be an \"AbortError\" DOMException.\n    // 3. Set error to fallbackError if it is not given.\n    if (!error) {\n      error = new DOMException('The operation was aborted.', 'AbortError')\n    }\n\n    // 4. Let serializedError be StructuredSerialize(error).\n    //    If that threw an exception, catch it, and let\n    //    serializedError be StructuredSerialize(fallbackError).\n\n    // 5. Set controller’s serialized abort reason to serializedError.\n    this.serializedAbortReason = error\n\n    this.connection?.destroy(error)\n    this.emit('terminated', error)\n  }\n}\n\nfunction handleFetchDone (response) {\n  finalizeAndReportTiming(response, 'fetch')\n}\n\n// https://fetch.spec.whatwg.org/#fetch-method\nfunction fetch (input, init = undefined) {\n  webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')\n\n  // 1. Let p be a new promise.\n  let p = createDeferredPromise()\n\n  // 2. Let requestObject be the result of invoking the initial value of\n  // Request as constructor with input and init as arguments. If this throws\n  // an exception, reject p with it and return p.\n  let requestObject\n\n  try {\n    requestObject = new Request(input, init)\n  } catch (e) {\n    p.reject(e)\n    return p.promise\n  }\n\n  // 3. Let request be requestObject’s request.\n  const request = requestObject[kState]\n\n  // 4. If requestObject’s signal’s aborted flag is set, then:\n  if (requestObject.signal.aborted) {\n    // 1. Abort the fetch() call with p, request, null, and\n    //    requestObject’s signal’s abort reason.\n    abortFetch(p, request, null, requestObject.signal.reason)\n\n    // 2. Return p.\n    return p.promise\n  }\n\n  // 5. Let globalObject be request’s client’s global object.\n  const globalObject = request.client.globalObject\n\n  // 6. If globalObject is a ServiceWorkerGlobalScope object, then set\n  // request’s service-workers mode to \"none\".\n  if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {\n    request.serviceWorkers = 'none'\n  }\n\n  // 7. Let responseObject be null.\n  let responseObject = null\n\n  // 8. Let relevantRealm be this’s relevant Realm.\n\n  // 9. Let locallyAborted be false.\n  let locallyAborted = false\n\n  // 10. Let controller be null.\n  let controller = null\n\n  // 11. Add the following abort steps to requestObject’s signal:\n  addAbortListener(\n    requestObject.signal,\n    () => {\n      // 1. Set locallyAborted to true.\n      locallyAborted = true\n\n      // 2. Assert: controller is non-null.\n      assert(controller != null)\n\n      // 3. Abort controller with requestObject’s signal’s abort reason.\n      controller.abort(requestObject.signal.reason)\n\n      const realResponse = responseObject?.deref()\n\n      // 4. Abort the fetch() call with p, request, responseObject,\n      //    and requestObject’s signal’s abort reason.\n      abortFetch(p, request, realResponse, requestObject.signal.reason)\n    }\n  )\n\n  // 12. Let handleFetchDone given response response be to finalize and\n  // report timing with response, globalObject, and \"fetch\".\n  // see function handleFetchDone\n\n  // 13. Set controller to the result of calling fetch given request,\n  // with processResponseEndOfBody set to handleFetchDone, and processResponse\n  // given response being these substeps:\n\n  const processResponse = (response) => {\n    // 1. If locallyAborted is true, terminate these substeps.\n    if (locallyAborted) {\n      return\n    }\n\n    // 2. If response’s aborted flag is set, then:\n    if (response.aborted) {\n      // 1. Let deserializedError be the result of deserialize a serialized\n      //    abort reason given controller’s serialized abort reason and\n      //    relevantRealm.\n\n      // 2. Abort the fetch() call with p, request, responseObject, and\n      //    deserializedError.\n\n      abortFetch(p, request, responseObject, controller.serializedAbortReason)\n      return\n    }\n\n    // 3. If response is a network error, then reject p with a TypeError\n    // and terminate these substeps.\n    if (response.type === 'error') {\n      p.reject(new TypeError('fetch failed', { cause: response.error }))\n      return\n    }\n\n    // 4. Set responseObject to the result of creating a Response object,\n    // given response, \"immutable\", and relevantRealm.\n    responseObject = new WeakRef(fromInnerResponse(response, 'immutable'))\n\n    // 5. Resolve p with responseObject.\n    p.resolve(responseObject.deref())\n    p = null\n  }\n\n  controller = fetching({\n    request,\n    processResponseEndOfBody: handleFetchDone,\n    processResponse,\n    dispatcher: requestObject[kDispatcher] // undici\n  })\n\n  // 14. Return p.\n  return p.promise\n}\n\n// https://fetch.spec.whatwg.org/#finalize-and-report-timing\nfunction finalizeAndReportTiming (response, initiatorType = 'other') {\n  // 1. If response is an aborted network error, then return.\n  if (response.type === 'error' && response.aborted) {\n    return\n  }\n\n  // 2. If response’s URL list is null or empty, then return.\n  if (!response.urlList?.length) {\n    return\n  }\n\n  // 3. Let originalURL be response’s URL list[0].\n  const originalURL = response.urlList[0]\n\n  // 4. Let timingInfo be response’s timing info.\n  let timingInfo = response.timingInfo\n\n  // 5. Let cacheState be response’s cache state.\n  let cacheState = response.cacheState\n\n  // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.\n  if (!urlIsHttpHttpsScheme(originalURL)) {\n    return\n  }\n\n  // 7. If timingInfo is null, then return.\n  if (timingInfo === null) {\n    return\n  }\n\n  // 8. If response’s timing allow passed flag is not set, then:\n  if (!response.timingAllowPassed) {\n    //  1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.\n    timingInfo = createOpaqueTimingInfo({\n      startTime: timingInfo.startTime\n    })\n\n    //  2. Set cacheState to the empty string.\n    cacheState = ''\n  }\n\n  // 9. Set timingInfo’s end time to the coarsened shared current time\n  // given global’s relevant settings object’s cross-origin isolated\n  // capability.\n  // TODO: given global’s relevant settings object’s cross-origin isolated\n  // capability?\n  timingInfo.endTime = coarsenedSharedCurrentTime()\n\n  // 10. Set response’s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 11. Mark resource timing for timingInfo, originalURL, initiatorType,\n  // global, and cacheState.\n  markResourceTiming(\n    timingInfo,\n    originalURL.href,\n    initiatorType,\n    globalThis,\n    cacheState\n  )\n}\n\n// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing\nconst markResourceTiming = performance.markResourceTiming\n\n// https://fetch.spec.whatwg.org/#abort-fetch\nfunction abortFetch (p, request, responseObject, error) {\n  // 1. Reject promise with error.\n  if (p) {\n    // We might have already resolved the promise at this stage\n    p.reject(error)\n  }\n\n  // 2. If request’s body is not null and is readable, then cancel request’s\n  // body with error.\n  if (request.body != null && isReadable(request.body?.stream)) {\n    request.body.stream.cancel(error).catch((err) => {\n      if (err.code === 'ERR_INVALID_STATE') {\n        // Node bug?\n        return\n      }\n      throw err\n    })\n  }\n\n  // 3. If responseObject is null, then return.\n  if (responseObject == null) {\n    return\n  }\n\n  // 4. Let response be responseObject’s response.\n  const response = responseObject[kState]\n\n  // 5. If response’s body is not null and is readable, then error response’s\n  // body with error.\n  if (response.body != null && isReadable(response.body?.stream)) {\n    response.body.stream.cancel(error).catch((err) => {\n      if (err.code === 'ERR_INVALID_STATE') {\n        // Node bug?\n        return\n      }\n      throw err\n    })\n  }\n}\n\n// https://fetch.spec.whatwg.org/#fetching\nfunction fetching ({\n  request,\n  processRequestBodyChunkLength,\n  processRequestEndOfBody,\n  processResponse,\n  processResponseEndOfBody,\n  processResponseConsumeBody,\n  useParallelQueue = false,\n  dispatcher = getGlobalDispatcher() // undici\n}) {\n  // Ensure that the dispatcher is set accordingly\n  assert(dispatcher)\n\n  // 1. Let taskDestination be null.\n  let taskDestination = null\n\n  // 2. Let crossOriginIsolatedCapability be false.\n  let crossOriginIsolatedCapability = false\n\n  // 3. If request’s client is non-null, then:\n  if (request.client != null) {\n    // 1. Set taskDestination to request’s client’s global object.\n    taskDestination = request.client.globalObject\n\n    // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin\n    // isolated capability.\n    crossOriginIsolatedCapability =\n      request.client.crossOriginIsolatedCapability\n  }\n\n  // 4. If useParallelQueue is true, then set taskDestination to the result of\n  // starting a new parallel queue.\n  // TODO\n\n  // 5. Let timingInfo be a new fetch timing info whose start time and\n  // post-redirect start time are the coarsened shared current time given\n  // crossOriginIsolatedCapability.\n  const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)\n  const timingInfo = createOpaqueTimingInfo({\n    startTime: currentTime\n  })\n\n  // 6. Let fetchParams be a new fetch params whose\n  // request is request,\n  // timing info is timingInfo,\n  // process request body chunk length is processRequestBodyChunkLength,\n  // process request end-of-body is processRequestEndOfBody,\n  // process response is processResponse,\n  // process response consume body is processResponseConsumeBody,\n  // process response end-of-body is processResponseEndOfBody,\n  // task destination is taskDestination,\n  // and cross-origin isolated capability is crossOriginIsolatedCapability.\n  const fetchParams = {\n    controller: new Fetch(dispatcher),\n    request,\n    timingInfo,\n    processRequestBodyChunkLength,\n    processRequestEndOfBody,\n    processResponse,\n    processResponseConsumeBody,\n    processResponseEndOfBody,\n    taskDestination,\n    crossOriginIsolatedCapability\n  }\n\n  // 7. If request’s body is a byte sequence, then set request’s body to\n  //    request’s body as a body.\n  // NOTE: Since fetching is only called from fetch, body should already be\n  // extracted.\n  assert(!request.body || request.body.stream)\n\n  // 8. If request’s window is \"client\", then set request’s window to request’s\n  // client, if request’s client’s global object is a Window object; otherwise\n  // \"no-window\".\n  if (request.window === 'client') {\n    // TODO: What if request.client is null?\n    request.window =\n      request.client?.globalObject?.constructor?.name === 'Window'\n        ? request.client\n        : 'no-window'\n  }\n\n  // 9. If request’s origin is \"client\", then set request’s origin to request’s\n  // client’s origin.\n  if (request.origin === 'client') {\n    request.origin = request.client.origin\n  }\n\n  // 10. If all of the following conditions are true:\n  // TODO\n\n  // 11. If request’s policy container is \"client\", then:\n  if (request.policyContainer === 'client') {\n    // 1. If request’s client is non-null, then set request’s policy\n    // container to a clone of request’s client’s policy container. [HTML]\n    if (request.client != null) {\n      request.policyContainer = clonePolicyContainer(\n        request.client.policyContainer\n      )\n    } else {\n      // 2. Otherwise, set request’s policy container to a new policy\n      // container.\n      request.policyContainer = makePolicyContainer()\n    }\n  }\n\n  // 12. If request’s header list does not contain `Accept`, then:\n  if (!request.headersList.contains('accept', true)) {\n    // 1. Let value be `*/*`.\n    const value = '*/*'\n\n    // 2. A user agent should set value to the first matching statement, if\n    // any, switching on request’s destination:\n    // \"document\"\n    // \"frame\"\n    // \"iframe\"\n    // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`\n    // \"image\"\n    // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`\n    // \"style\"\n    // `text/css,*/*;q=0.1`\n    // TODO\n\n    // 3. Append `Accept`/value to request’s header list.\n    request.headersList.append('accept', value, true)\n  }\n\n  // 13. If request’s header list does not contain `Accept-Language`, then\n  // user agents should append `Accept-Language`/an appropriate value to\n  // request’s header list.\n  if (!request.headersList.contains('accept-language', true)) {\n    request.headersList.append('accept-language', '*', true)\n  }\n\n  // 14. If request’s priority is null, then use request’s initiator and\n  // destination appropriately in setting request’s priority to a\n  // user-agent-defined object.\n  if (request.priority === null) {\n    // TODO\n  }\n\n  // 15. If request is a subresource request, then:\n  if (subresourceSet.has(request.destination)) {\n    // TODO\n  }\n\n  // 16. Run main fetch given fetchParams.\n  mainFetch(fetchParams)\n    .catch(err => {\n      fetchParams.controller.terminate(err)\n    })\n\n  // 17. Return fetchParam's controller\n  return fetchParams.controller\n}\n\n// https://fetch.spec.whatwg.org/#concept-main-fetch\nasync function mainFetch (fetchParams, recursive = false) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. If request’s local-URLs-only flag is set and request’s current URL is\n  // not local, then set response to a network error.\n  if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n    response = makeNetworkError('local URLs only')\n  }\n\n  // 4. Run report Content Security Policy violations for request.\n  // TODO\n\n  // 5. Upgrade request to a potentially trustworthy URL, if appropriate.\n  tryUpgradeRequestToAPotentiallyTrustworthyURL(request)\n\n  // 6. If should request be blocked due to a bad port, should fetching request\n  // be blocked as mixed content, or should request be blocked by Content\n  // Security Policy returns blocked, then set response to a network error.\n  if (requestBadPort(request) === 'blocked') {\n    response = makeNetworkError('bad port')\n  }\n  // TODO: should fetching request be blocked as mixed content?\n  // TODO: should request be blocked by Content Security Policy?\n\n  // 7. If request’s referrer policy is the empty string, then set request’s\n  // referrer policy to request’s policy container’s referrer policy.\n  if (request.referrerPolicy === '') {\n    request.referrerPolicy = request.policyContainer.referrerPolicy\n  }\n\n  // 8. If request’s referrer is not \"no-referrer\", then set request’s\n  // referrer to the result of invoking determine request’s referrer.\n  if (request.referrer !== 'no-referrer') {\n    request.referrer = determineRequestsReferrer(request)\n  }\n\n  // 9. Set request’s current URL’s scheme to \"https\" if all of the following\n  // conditions are true:\n  // - request’s current URL’s scheme is \"http\"\n  // - request’s current URL’s host is a domain\n  // - Matching request’s current URL’s host per Known HSTS Host Domain Name\n  //   Matching results in either a superdomain match with an asserted\n  //   includeSubDomains directive or a congruent match (with or without an\n  //   asserted includeSubDomains directive). [HSTS]\n  // TODO\n\n  // 10. If recursive is false, then run the remaining steps in parallel.\n  // TODO\n\n  // 11. If response is null, then set response to the result of running\n  // the steps corresponding to the first matching statement:\n  if (response === null) {\n    response = await (async () => {\n      const currentURL = requestCurrentURL(request)\n\n      if (\n        // - request’s current URL’s origin is same origin with request’s origin,\n        //   and request’s response tainting is \"basic\"\n        (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||\n        // request’s current URL’s scheme is \"data\"\n        (currentURL.protocol === 'data:') ||\n        // - request’s mode is \"navigate\" or \"websocket\"\n        (request.mode === 'navigate' || request.mode === 'websocket')\n      ) {\n        // 1. Set request’s response tainting to \"basic\".\n        request.responseTainting = 'basic'\n\n        // 2. Return the result of running scheme fetch given fetchParams.\n        return await schemeFetch(fetchParams)\n      }\n\n      // request’s mode is \"same-origin\"\n      if (request.mode === 'same-origin') {\n        // 1. Return a network error.\n        return makeNetworkError('request mode cannot be \"same-origin\"')\n      }\n\n      // request’s mode is \"no-cors\"\n      if (request.mode === 'no-cors') {\n        // 1. If request’s redirect mode is not \"follow\", then return a network\n        // error.\n        if (request.redirect !== 'follow') {\n          return makeNetworkError(\n            'redirect mode cannot be \"follow\" for \"no-cors\" request'\n          )\n        }\n\n        // 2. Set request’s response tainting to \"opaque\".\n        request.responseTainting = 'opaque'\n\n        // 3. Return the result of running scheme fetch given fetchParams.\n        return await schemeFetch(fetchParams)\n      }\n\n      // request’s current URL’s scheme is not an HTTP(S) scheme\n      if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n        // Return a network error.\n        return makeNetworkError('URL scheme must be a HTTP(S) scheme')\n      }\n\n      // - request’s use-CORS-preflight flag is set\n      // - request’s unsafe-request flag is set and either request’s method is\n      //   not a CORS-safelisted method or CORS-unsafe request-header names with\n      //   request’s header list is not empty\n      //    1. Set request’s response tainting to \"cors\".\n      //    2. Let corsWithPreflightResponse be the result of running HTTP fetch\n      //    given fetchParams and true.\n      //    3. If corsWithPreflightResponse is a network error, then clear cache\n      //    entries using request.\n      //    4. Return corsWithPreflightResponse.\n      // TODO\n\n      // Otherwise\n      //    1. Set request’s response tainting to \"cors\".\n      request.responseTainting = 'cors'\n\n      //    2. Return the result of running HTTP fetch given fetchParams.\n      return await httpFetch(fetchParams)\n    })()\n  }\n\n  // 12. If recursive is true, then return response.\n  if (recursive) {\n    return response\n  }\n\n  // 13. If response is not a network error and response is not a filtered\n  // response, then:\n  if (response.status !== 0 && !response.internalResponse) {\n    // If request’s response tainting is \"cors\", then:\n    if (request.responseTainting === 'cors') {\n      // 1. Let headerNames be the result of extracting header list values\n      // given `Access-Control-Expose-Headers` and response’s header list.\n      // TODO\n      // 2. If request’s credentials mode is not \"include\" and headerNames\n      // contains `*`, then set response’s CORS-exposed header-name list to\n      // all unique header names in response’s header list.\n      // TODO\n      // 3. Otherwise, if headerNames is not null or failure, then set\n      // response’s CORS-exposed header-name list to headerNames.\n      // TODO\n    }\n\n    // Set response to the following filtered response with response as its\n    // internal response, depending on request’s response tainting:\n    if (request.responseTainting === 'basic') {\n      response = filterResponse(response, 'basic')\n    } else if (request.responseTainting === 'cors') {\n      response = filterResponse(response, 'cors')\n    } else if (request.responseTainting === 'opaque') {\n      response = filterResponse(response, 'opaque')\n    } else {\n      assert(false)\n    }\n  }\n\n  // 14. Let internalResponse be response, if response is a network error,\n  // and response’s internal response otherwise.\n  let internalResponse =\n    response.status === 0 ? response : response.internalResponse\n\n  // 15. If internalResponse’s URL list is empty, then set it to a clone of\n  // request’s URL list.\n  if (internalResponse.urlList.length === 0) {\n    internalResponse.urlList.push(...request.urlList)\n  }\n\n  // 16. If request’s timing allow failed flag is unset, then set\n  // internalResponse’s timing allow passed flag.\n  if (!request.timingAllowFailed) {\n    response.timingAllowPassed = true\n  }\n\n  // 17. If response is not a network error and any of the following returns\n  // blocked\n  // - should internalResponse to request be blocked as mixed content\n  // - should internalResponse to request be blocked by Content Security Policy\n  // - should internalResponse to request be blocked due to its MIME type\n  // - should internalResponse to request be blocked due to nosniff\n  // TODO\n\n  // 18. If response’s type is \"opaque\", internalResponse’s status is 206,\n  // internalResponse’s range-requested flag is set, and request’s header\n  // list does not contain `Range`, then set response and internalResponse\n  // to a network error.\n  if (\n    response.type === 'opaque' &&\n    internalResponse.status === 206 &&\n    internalResponse.rangeRequested &&\n    !request.headers.contains('range', true)\n  ) {\n    response = internalResponse = makeNetworkError()\n  }\n\n  // 19. If response is not a network error and either request’s method is\n  // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,\n  // set internalResponse’s body to null and disregard any enqueuing toward\n  // it (if any).\n  if (\n    response.status !== 0 &&\n    (request.method === 'HEAD' ||\n      request.method === 'CONNECT' ||\n      nullBodyStatus.includes(internalResponse.status))\n  ) {\n    internalResponse.body = null\n    fetchParams.controller.dump = true\n  }\n\n  // 20. If request’s integrity metadata is not the empty string, then:\n  if (request.integrity) {\n    // 1. Let processBodyError be this step: run fetch finale given fetchParams\n    // and a network error.\n    const processBodyError = (reason) =>\n      fetchFinale(fetchParams, makeNetworkError(reason))\n\n    // 2. If request’s response tainting is \"opaque\", or response’s body is null,\n    // then run processBodyError and abort these steps.\n    if (request.responseTainting === 'opaque' || response.body == null) {\n      processBodyError(response.error)\n      return\n    }\n\n    // 3. Let processBody given bytes be these steps:\n    const processBody = (bytes) => {\n      // 1. If bytes do not match request’s integrity metadata,\n      // then run processBodyError and abort these steps. [SRI]\n      if (!bytesMatch(bytes, request.integrity)) {\n        processBodyError('integrity mismatch')\n        return\n      }\n\n      // 2. Set response’s body to bytes as a body.\n      response.body = safelyExtractBody(bytes)[0]\n\n      // 3. Run fetch finale given fetchParams and response.\n      fetchFinale(fetchParams, response)\n    }\n\n    // 4. Fully read response’s body given processBody and processBodyError.\n    await fullyReadBody(response.body, processBody, processBodyError)\n  } else {\n    // 21. Otherwise, run fetch finale given fetchParams and response.\n    fetchFinale(fetchParams, response)\n  }\n}\n\n// https://fetch.spec.whatwg.org/#concept-scheme-fetch\n// given a fetch params fetchParams\nfunction schemeFetch (fetchParams) {\n  // Note: since the connection is destroyed on redirect, which sets fetchParams to a\n  // cancelled state, we do not want this condition to trigger *unless* there have been\n  // no redirects. See https://github.com/nodejs/undici/issues/1776\n  // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n  if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n    return Promise.resolve(makeAppropriateNetworkError(fetchParams))\n  }\n\n  // 2. Let request be fetchParams’s request.\n  const { request } = fetchParams\n\n  const { protocol: scheme } = requestCurrentURL(request)\n\n  // 3. Switch on request’s current URL’s scheme and run the associated steps:\n  switch (scheme) {\n    case 'about:': {\n      // If request’s current URL’s path is the string \"blank\", then return a new response\n      // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,\n      // and body is the empty byte sequence as a body.\n\n      // Otherwise, return a network error.\n      return Promise.resolve(makeNetworkError('about scheme is not supported'))\n    }\n    case 'blob:': {\n      if (!resolveObjectURL) {\n        resolveObjectURL = require('node:buffer').resolveObjectURL\n      }\n\n      // 1. Let blobURLEntry be request’s current URL’s blob URL entry.\n      const blobURLEntry = requestCurrentURL(request)\n\n      // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56\n      // Buffer.resolveObjectURL does not ignore URL queries.\n      if (blobURLEntry.search.length !== 0) {\n        return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))\n      }\n\n      const blob = resolveObjectURL(blobURLEntry.toString())\n\n      // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s\n      //    object is not a Blob object, then return a network error.\n      if (request.method !== 'GET' || !isBlobLike(blob)) {\n        return Promise.resolve(makeNetworkError('invalid method'))\n      }\n\n      // 3. Let blob be blobURLEntry’s object.\n      // Note: done above\n\n      // 4. Let response be a new response.\n      const response = makeResponse()\n\n      // 5. Let fullLength be blob’s size.\n      const fullLength = blob.size\n\n      // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.\n      const serializedFullLength = isomorphicEncode(`${fullLength}`)\n\n      // 7. Let type be blob’s type.\n      const type = blob.type\n\n      // 8. If request’s header list does not contain `Range`:\n      // 9. Otherwise:\n      if (!request.headersList.contains('range', true)) {\n        // 1. Let bodyWithType be the result of safely extracting blob.\n        // Note: in the FileAPI a blob \"object\" is a Blob *or* a MediaSource.\n        // In node, this can only ever be a Blob. Therefore we can safely\n        // use extractBody directly.\n        const bodyWithType = extractBody(blob)\n\n        // 2. Set response’s status message to `OK`.\n        response.statusText = 'OK'\n\n        // 3. Set response’s body to bodyWithType’s body.\n        response.body = bodyWithType[0]\n\n        // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».\n        response.headersList.set('content-length', serializedFullLength, true)\n        response.headersList.set('content-type', type, true)\n      } else {\n        // 1. Set response’s range-requested flag.\n        response.rangeRequested = true\n\n        // 2. Let rangeHeader be the result of getting `Range` from request’s header list.\n        const rangeHeader = request.headersList.get('range', true)\n\n        // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true.\n        const rangeValue = simpleRangeHeaderValue(rangeHeader, true)\n\n        // 4. If rangeValue is failure, then return a network error.\n        if (rangeValue === 'failure') {\n          return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n        }\n\n        // 5. Let (rangeStart, rangeEnd) be rangeValue.\n        let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue\n\n        // 6. If rangeStart is null:\n        // 7. Otherwise:\n        if (rangeStart === null) {\n          // 1. Set rangeStart to fullLength − rangeEnd.\n          rangeStart = fullLength - rangeEnd\n\n          // 2. Set rangeEnd to rangeStart + rangeEnd − 1.\n          rangeEnd = rangeStart + rangeEnd - 1\n        } else {\n          // 1. If rangeStart is greater than or equal to fullLength, then return a network error.\n          if (rangeStart >= fullLength) {\n            return Promise.resolve(makeNetworkError('Range start is greater than the blob\\'s size.'))\n          }\n\n          // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set\n          //    rangeEnd to fullLength − 1.\n          if (rangeEnd === null || rangeEnd >= fullLength) {\n            rangeEnd = fullLength - 1\n          }\n        }\n\n        // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,\n        //    rangeEnd + 1, and type.\n        const slicedBlob = blob.slice(rangeStart, rangeEnd, type)\n\n        // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.\n        // Note: same reason as mentioned above as to why we use extractBody\n        const slicedBodyWithType = extractBody(slicedBlob)\n\n        // 10. Set response’s body to slicedBodyWithType’s body.\n        response.body = slicedBodyWithType[0]\n\n        // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.\n        const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`)\n\n        // 12. Let contentRange be the result of invoking build a content range given rangeStart,\n        //     rangeEnd, and fullLength.\n        const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength)\n\n        // 13. Set response’s status to 206.\n        response.status = 206\n\n        // 14. Set response’s status message to `Partial Content`.\n        response.statusText = 'Partial Content'\n\n        // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength),\n        //     (`Content-Type`, type), (`Content-Range`, contentRange) ».\n        response.headersList.set('content-length', serializedSlicedLength, true)\n        response.headersList.set('content-type', type, true)\n        response.headersList.set('content-range', contentRange, true)\n      }\n\n      // 10. Return response.\n      return Promise.resolve(response)\n    }\n    case 'data:': {\n      // 1. Let dataURLStruct be the result of running the\n      //    data: URL processor on request’s current URL.\n      const currentURL = requestCurrentURL(request)\n      const dataURLStruct = dataURLProcessor(currentURL)\n\n      // 2. If dataURLStruct is failure, then return a\n      //    network error.\n      if (dataURLStruct === 'failure') {\n        return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n      }\n\n      // 3. Let mimeType be dataURLStruct’s MIME type, serialized.\n      const mimeType = serializeAMimeType(dataURLStruct.mimeType)\n\n      // 4. Return a response whose status message is `OK`,\n      //    header list is « (`Content-Type`, mimeType) »,\n      //    and body is dataURLStruct’s body as a body.\n      return Promise.resolve(makeResponse({\n        statusText: 'OK',\n        headersList: [\n          ['content-type', { name: 'Content-Type', value: mimeType }]\n        ],\n        body: safelyExtractBody(dataURLStruct.body)[0]\n      }))\n    }\n    case 'file:': {\n      // For now, unfortunate as it is, file URLs are left as an exercise for the reader.\n      // When in doubt, return a network error.\n      return Promise.resolve(makeNetworkError('not implemented... yet...'))\n    }\n    case 'http:':\n    case 'https:': {\n      // Return the result of running HTTP fetch given fetchParams.\n\n      return httpFetch(fetchParams)\n        .catch((err) => makeNetworkError(err))\n    }\n    default: {\n      return Promise.resolve(makeNetworkError('unknown scheme'))\n    }\n  }\n}\n\n// https://fetch.spec.whatwg.org/#finalize-response\nfunction finalizeResponse (fetchParams, response) {\n  // 1. Set fetchParams’s request’s done flag.\n  fetchParams.request.done = true\n\n  // 2, If fetchParams’s process response done is not null, then queue a fetch\n  // task to run fetchParams’s process response done given response, with\n  // fetchParams’s task destination.\n  if (fetchParams.processResponseDone != null) {\n    queueMicrotask(() => fetchParams.processResponseDone(response))\n  }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-finale\nfunction fetchFinale (fetchParams, response) {\n  // 1. Let timingInfo be fetchParams’s timing info.\n  let timingInfo = fetchParams.timingInfo\n\n  // 2. If response is not a network error and fetchParams’s request’s client is a secure context,\n  //    then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting\n  //    `Server-Timing` from response’s internal response’s header list.\n  // TODO\n\n  // 3. Let processResponseEndOfBody be the following steps:\n  const processResponseEndOfBody = () => {\n    // 1. Let unsafeEndTime be the unsafe shared current time.\n    const unsafeEndTime = Date.now() // ?\n\n    // 2. If fetchParams’s request’s destination is \"document\", then set fetchParams’s controller’s\n    //    full timing info to fetchParams’s timing info.\n    if (fetchParams.request.destination === 'document') {\n      fetchParams.controller.fullTimingInfo = timingInfo\n    }\n\n    // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:\n    fetchParams.controller.reportTimingSteps = () => {\n      // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.\n      if (fetchParams.request.url.protocol !== 'https:') {\n        return\n      }\n\n      // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global.\n      timingInfo.endTime = unsafeEndTime\n\n      // 3. Let cacheState be response’s cache state.\n      let cacheState = response.cacheState\n\n      // 4. Let bodyInfo be response’s body info.\n      const bodyInfo = response.bodyInfo\n\n      // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an\n      //    opaque timing info for timingInfo and set cacheState to the empty string.\n      if (!response.timingAllowPassed) {\n        timingInfo = createOpaqueTimingInfo(timingInfo)\n\n        cacheState = ''\n      }\n\n      // 6. Let responseStatus be 0.\n      let responseStatus = 0\n\n      // 7. If fetchParams’s request’s mode is not \"navigate\" or response’s has-cross-origin-redirects is false:\n      if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {\n        // 1. Set responseStatus to response’s status.\n        responseStatus = response.status\n\n        // 2. Let mimeType be the result of extracting a MIME type from response’s header list.\n        const mimeType = extractMimeType(response.headersList)\n\n        // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType.\n        if (mimeType !== 'failure') {\n          bodyInfo.contentType = minimizeSupportedMimeType(mimeType)\n        }\n      }\n\n      // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo,\n      //    fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,\n      //    and responseStatus.\n      if (fetchParams.request.initiatorType != null) {\n        // TODO: update markresourcetiming\n        markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)\n      }\n    }\n\n    // 4. Let processResponseEndOfBodyTask be the following steps:\n    const processResponseEndOfBodyTask = () => {\n      // 1. Set fetchParams’s request’s done flag.\n      fetchParams.request.done = true\n\n      // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process\n      //    response end-of-body given response.\n      if (fetchParams.processResponseEndOfBody != null) {\n        queueMicrotask(() => fetchParams.processResponseEndOfBody(response))\n      }\n\n      // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s\n      //    global object is fetchParams’s task destination, then run fetchParams’s controller’s report\n      //    timing steps given fetchParams’s request’s client’s global object.\n      if (fetchParams.request.initiatorType != null) {\n        fetchParams.controller.reportTimingSteps()\n      }\n    }\n\n    // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination\n    queueMicrotask(() => processResponseEndOfBodyTask())\n  }\n\n  // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s\n  //    process response given response, with fetchParams’s task destination.\n  if (fetchParams.processResponse != null) {\n    queueMicrotask(() => {\n      fetchParams.processResponse(response)\n      fetchParams.processResponse = null\n    })\n  }\n\n  // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.\n  const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)\n\n  // 6. If internalResponse’s body is null, then run processResponseEndOfBody.\n  // 7. Otherwise:\n  if (internalResponse.body == null) {\n    processResponseEndOfBody()\n  } else {\n    // mcollina: all the following steps of the specs are skipped.\n    // The internal transform stream is not needed.\n    // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541\n\n    // 1. Let transformStream be a new TransformStream.\n    // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream.\n    // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm\n    //    set to processResponseEndOfBody.\n    // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.\n\n    finished(internalResponse.body.stream, () => {\n      processResponseEndOfBody()\n    })\n  }\n}\n\n// https://fetch.spec.whatwg.org/#http-fetch\nasync function httpFetch (fetchParams) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let actualResponse be null.\n  let actualResponse = null\n\n  // 4. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 5. If request’s service-workers mode is \"all\", then:\n  if (request.serviceWorkers === 'all') {\n    // TODO\n  }\n\n  // 6. If response is null, then:\n  if (response === null) {\n    // 1. If makeCORSPreflight is true and one of these conditions is true:\n    // TODO\n\n    // 2. If request’s redirect mode is \"follow\", then set request’s\n    // service-workers mode to \"none\".\n    if (request.redirect === 'follow') {\n      request.serviceWorkers = 'none'\n    }\n\n    // 3. Set response and actualResponse to the result of running\n    // HTTP-network-or-cache fetch given fetchParams.\n    actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n    // 4. If request’s response tainting is \"cors\" and a CORS check\n    // for request and response returns failure, then return a network error.\n    if (\n      request.responseTainting === 'cors' &&\n      corsCheck(request, response) === 'failure'\n    ) {\n      return makeNetworkError('cors failure')\n    }\n\n    // 5. If the TAO check for request and response returns failure, then set\n    // request’s timing allow failed flag.\n    if (TAOCheck(request, response) === 'failure') {\n      request.timingAllowFailed = true\n    }\n  }\n\n  // 7. If either request’s response tainting or response’s type\n  // is \"opaque\", and the cross-origin resource policy check with\n  // request’s origin, request’s client, request’s destination,\n  // and actualResponse returns blocked, then return a network error.\n  if (\n    (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n    crossOriginResourcePolicyCheck(\n      request.origin,\n      request.client,\n      request.destination,\n      actualResponse\n    ) === 'blocked'\n  ) {\n    return makeNetworkError('blocked')\n  }\n\n  // 8. If actualResponse’s status is a redirect status, then:\n  if (redirectStatusSet.has(actualResponse.status)) {\n    // 1. If actualResponse’s status is not 303, request’s body is not null,\n    // and the connection uses HTTP/2, then user agents may, and are even\n    // encouraged to, transmit an RST_STREAM frame.\n    // See, https://github.com/whatwg/fetch/issues/1288\n    if (request.redirect !== 'manual') {\n      fetchParams.controller.connection.destroy(undefined, false)\n    }\n\n    // 2. Switch on request’s redirect mode:\n    if (request.redirect === 'error') {\n      // Set response to a network error.\n      response = makeNetworkError('unexpected redirect')\n    } else if (request.redirect === 'manual') {\n      // Set response to an opaque-redirect filtered response whose internal\n      // response is actualResponse.\n      // NOTE(spec): On the web this would return an `opaqueredirect` response,\n      // but that doesn't make sense server side.\n      // See https://github.com/nodejs/undici/issues/1193.\n      response = actualResponse\n    } else if (request.redirect === 'follow') {\n      // Set response to the result of running HTTP-redirect fetch given\n      // fetchParams and response.\n      response = await httpRedirectFetch(fetchParams, response)\n    } else {\n      assert(false)\n    }\n  }\n\n  // 9. Set response’s timing info to timingInfo.\n  response.timingInfo = timingInfo\n\n  // 10. Return response.\n  return response\n}\n\n// https://fetch.spec.whatwg.org/#http-redirect-fetch\nfunction httpRedirectFetch (fetchParams, response) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let actualResponse be response, if response is not a filtered response,\n  // and response’s internal response otherwise.\n  const actualResponse = response.internalResponse\n    ? response.internalResponse\n    : response\n\n  // 3. Let locationURL be actualResponse’s location URL given request’s current\n  // URL’s fragment.\n  let locationURL\n\n  try {\n    locationURL = responseLocationURL(\n      actualResponse,\n      requestCurrentURL(request).hash\n    )\n\n    // 4. If locationURL is null, then return response.\n    if (locationURL == null) {\n      return response\n    }\n  } catch (err) {\n    // 5. If locationURL is failure, then return a network error.\n    return Promise.resolve(makeNetworkError(err))\n  }\n\n  // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network\n  // error.\n  if (!urlIsHttpHttpsScheme(locationURL)) {\n    return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))\n  }\n\n  // 7. If request’s redirect count is 20, then return a network error.\n  if (request.redirectCount === 20) {\n    return Promise.resolve(makeNetworkError('redirect count exceeded'))\n  }\n\n  // 8. Increase request’s redirect count by 1.\n  request.redirectCount += 1\n\n  // 9. If request’s mode is \"cors\", locationURL includes credentials, and\n  // request’s origin is not same origin with locationURL’s origin, then return\n  //  a network error.\n  if (\n    request.mode === 'cors' &&\n    (locationURL.username || locationURL.password) &&\n    !sameOrigin(request, locationURL)\n  ) {\n    return Promise.resolve(makeNetworkError('cross origin not allowed for request mode \"cors\"'))\n  }\n\n  // 10. If request’s response tainting is \"cors\" and locationURL includes\n  // credentials, then return a network error.\n  if (\n    request.responseTainting === 'cors' &&\n    (locationURL.username || locationURL.password)\n  ) {\n    return Promise.resolve(makeNetworkError(\n      'URL cannot contain credentials for request mode \"cors\"'\n    ))\n  }\n\n  // 11. If actualResponse’s status is not 303, request’s body is non-null,\n  // and request’s body’s source is null, then return a network error.\n  if (\n    actualResponse.status !== 303 &&\n    request.body != null &&\n    request.body.source == null\n  ) {\n    return Promise.resolve(makeNetworkError())\n  }\n\n  // 12. If one of the following is true\n  // - actualResponse’s status is 301 or 302 and request’s method is `POST`\n  // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`\n  if (\n    ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||\n    (actualResponse.status === 303 &&\n      !GET_OR_HEAD.includes(request.method))\n  ) {\n    // then:\n    // 1. Set request’s method to `GET` and request’s body to null.\n    request.method = 'GET'\n    request.body = null\n\n    // 2. For each headerName of request-body-header name, delete headerName from\n    // request’s header list.\n    for (const headerName of requestBodyHeader) {\n      request.headersList.delete(headerName)\n    }\n  }\n\n  // 13. If request’s current URL’s origin is not same origin with locationURL’s\n  //     origin, then for each headerName of CORS non-wildcard request-header name,\n  //     delete headerName from request’s header list.\n  if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n    // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name\n    request.headersList.delete('authorization', true)\n\n    // https://fetch.spec.whatwg.org/#authentication-entries\n    request.headersList.delete('proxy-authorization', true)\n\n    // \"Cookie\" and \"Host\" are forbidden request-headers, which undici doesn't implement.\n    request.headersList.delete('cookie', true)\n    request.headersList.delete('host', true)\n  }\n\n  // 14. If request’s body is non-null, then set request’s body to the first return\n  // value of safely extracting request’s body’s source.\n  if (request.body != null) {\n    assert(request.body.source != null)\n    request.body = safelyExtractBody(request.body.source)[0]\n  }\n\n  // 15. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 16. Set timingInfo’s redirect end time and post-redirect start time to the\n  // coarsened shared current time given fetchParams’s cross-origin isolated\n  // capability.\n  timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =\n    coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n\n  // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s\n  //  redirect start time to timingInfo’s start time.\n  if (timingInfo.redirectStartTime === 0) {\n    timingInfo.redirectStartTime = timingInfo.startTime\n  }\n\n  // 18. Append locationURL to request’s URL list.\n  request.urlList.push(locationURL)\n\n  // 19. Invoke set request’s referrer policy on redirect on request and\n  // actualResponse.\n  setRequestReferrerPolicyOnRedirect(request, actualResponse)\n\n  // 20. Return the result of running main fetch given fetchParams and true.\n  return mainFetch(fetchParams, true)\n}\n\n// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch\nasync function httpNetworkOrCacheFetch (\n  fetchParams,\n  isAuthenticationFetch = false,\n  isNewConnectionFetch = false\n) {\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let httpFetchParams be null.\n  let httpFetchParams = null\n\n  // 3. Let httpRequest be null.\n  let httpRequest = null\n\n  // 4. Let response be null.\n  let response = null\n\n  // 5. Let storedResponse be null.\n  // TODO: cache\n\n  // 6. Let httpCache be null.\n  const httpCache = null\n\n  // 7. Let the revalidatingFlag be unset.\n  const revalidatingFlag = false\n\n  // 8. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. If request’s window is \"no-window\" and request’s redirect mode is\n  //    \"error\", then set httpFetchParams to fetchParams and httpRequest to\n  //    request.\n  if (request.window === 'no-window' && request.redirect === 'error') {\n    httpFetchParams = fetchParams\n    httpRequest = request\n  } else {\n    // Otherwise:\n\n    // 1. Set httpRequest to a clone of request.\n    httpRequest = cloneRequest(request)\n\n    // 2. Set httpFetchParams to a copy of fetchParams.\n    httpFetchParams = { ...fetchParams }\n\n    // 3. Set httpFetchParams’s request to httpRequest.\n    httpFetchParams.request = httpRequest\n  }\n\n  //    3. Let includeCredentials be true if one of\n  const includeCredentials =\n    request.credentials === 'include' ||\n    (request.credentials === 'same-origin' &&\n      request.responseTainting === 'basic')\n\n  //    4. Let contentLength be httpRequest’s body’s length, if httpRequest’s\n  //    body is non-null; otherwise null.\n  const contentLength = httpRequest.body ? httpRequest.body.length : null\n\n  //    5. Let contentLengthHeaderValue be null.\n  let contentLengthHeaderValue = null\n\n  //    6. If httpRequest’s body is null and httpRequest’s method is `POST` or\n  //    `PUT`, then set contentLengthHeaderValue to `0`.\n  if (\n    httpRequest.body == null &&\n    ['POST', 'PUT'].includes(httpRequest.method)\n  ) {\n    contentLengthHeaderValue = '0'\n  }\n\n  //    7. If contentLength is non-null, then set contentLengthHeaderValue to\n  //    contentLength, serialized and isomorphic encoded.\n  if (contentLength != null) {\n    contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)\n  }\n\n  //    8. If contentLengthHeaderValue is non-null, then append\n  //    `Content-Length`/contentLengthHeaderValue to httpRequest’s header\n  //    list.\n  if (contentLengthHeaderValue != null) {\n    httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)\n  }\n\n  //    9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,\n  //    contentLengthHeaderValue) to httpRequest’s header list.\n\n  //    10. If contentLength is non-null and httpRequest’s keepalive is true,\n  //    then:\n  if (contentLength != null && httpRequest.keepalive) {\n    // NOTE: keepalive is a noop outside of browser context.\n  }\n\n  //    11. If httpRequest’s referrer is a URL, then append\n  //    `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,\n  //     to httpRequest’s header list.\n  if (httpRequest.referrer instanceof URL) {\n    httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)\n  }\n\n  //    12. Append a request `Origin` header for httpRequest.\n  appendRequestOriginHeader(httpRequest)\n\n  //    13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]\n  appendFetchMetadata(httpRequest)\n\n  //    14. If httpRequest’s header list does not contain `User-Agent`, then\n  //    user agents should append `User-Agent`/default `User-Agent` value to\n  //    httpRequest’s header list.\n  if (!httpRequest.headersList.contains('user-agent', true)) {\n    httpRequest.headersList.append('user-agent', defaultUserAgent)\n  }\n\n  //    15. If httpRequest’s cache mode is \"default\" and httpRequest’s header\n  //    list contains `If-Modified-Since`, `If-None-Match`,\n  //    `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set\n  //    httpRequest’s cache mode to \"no-store\".\n  if (\n    httpRequest.cache === 'default' &&\n    (httpRequest.headersList.contains('if-modified-since', true) ||\n      httpRequest.headersList.contains('if-none-match', true) ||\n      httpRequest.headersList.contains('if-unmodified-since', true) ||\n      httpRequest.headersList.contains('if-match', true) ||\n      httpRequest.headersList.contains('if-range', true))\n  ) {\n    httpRequest.cache = 'no-store'\n  }\n\n  //    16. If httpRequest’s cache mode is \"no-cache\", httpRequest’s prevent\n  //    no-cache cache-control header modification flag is unset, and\n  //    httpRequest’s header list does not contain `Cache-Control`, then append\n  //    `Cache-Control`/`max-age=0` to httpRequest’s header list.\n  if (\n    httpRequest.cache === 'no-cache' &&\n    !httpRequest.preventNoCacheCacheControlHeaderModification &&\n    !httpRequest.headersList.contains('cache-control', true)\n  ) {\n    httpRequest.headersList.append('cache-control', 'max-age=0', true)\n  }\n\n  //    17. If httpRequest’s cache mode is \"no-store\" or \"reload\", then:\n  if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {\n    // 1. If httpRequest’s header list does not contain `Pragma`, then append\n    // `Pragma`/`no-cache` to httpRequest’s header list.\n    if (!httpRequest.headersList.contains('pragma', true)) {\n      httpRequest.headersList.append('pragma', 'no-cache', true)\n    }\n\n    // 2. If httpRequest’s header list does not contain `Cache-Control`,\n    // then append `Cache-Control`/`no-cache` to httpRequest’s header list.\n    if (!httpRequest.headersList.contains('cache-control', true)) {\n      httpRequest.headersList.append('cache-control', 'no-cache', true)\n    }\n  }\n\n  //    18. If httpRequest’s header list contains `Range`, then append\n  //    `Accept-Encoding`/`identity` to httpRequest’s header list.\n  if (httpRequest.headersList.contains('range', true)) {\n    httpRequest.headersList.append('accept-encoding', 'identity', true)\n  }\n\n  //    19. Modify httpRequest’s header list per HTTP. Do not append a given\n  //    header if httpRequest’s header list contains that header’s name.\n  //    TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129\n  if (!httpRequest.headersList.contains('accept-encoding', true)) {\n    if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n      httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)\n    } else {\n      httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)\n    }\n  }\n\n  httpRequest.headersList.delete('host', true)\n\n  //    20. If includeCredentials is true, then:\n  if (includeCredentials) {\n    // 1. If the user agent is not configured to block cookies for httpRequest\n    // (see section 7 of [COOKIES]), then:\n    // TODO: credentials\n    // 2. If httpRequest’s header list does not contain `Authorization`, then:\n    // TODO: credentials\n  }\n\n  //    21. If there’s a proxy-authentication entry, use it as appropriate.\n  //    TODO: proxy-authentication\n\n  //    22. Set httpCache to the result of determining the HTTP cache\n  //    partition, given httpRequest.\n  //    TODO: cache\n\n  //    23. If httpCache is null, then set httpRequest’s cache mode to\n  //    \"no-store\".\n  if (httpCache == null) {\n    httpRequest.cache = 'no-store'\n  }\n\n  //    24. If httpRequest’s cache mode is neither \"no-store\" nor \"reload\",\n  //    then:\n  if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {\n    // TODO: cache\n  }\n\n  // 9. If aborted, then return the appropriate network error for fetchParams.\n  // TODO\n\n  // 10. If response is null, then:\n  if (response == null) {\n    // 1. If httpRequest’s cache mode is \"only-if-cached\", then return a\n    // network error.\n    if (httpRequest.cache === 'only-if-cached') {\n      return makeNetworkError('only if cached')\n    }\n\n    // 2. Let forwardResponse be the result of running HTTP-network fetch\n    // given httpFetchParams, includeCredentials, and isNewConnectionFetch.\n    const forwardResponse = await httpNetworkFetch(\n      httpFetchParams,\n      includeCredentials,\n      isNewConnectionFetch\n    )\n\n    // 3. If httpRequest’s method is unsafe and forwardResponse’s status is\n    // in the range 200 to 399, inclusive, invalidate appropriate stored\n    // responses in httpCache, as per the \"Invalidation\" chapter of HTTP\n    // Caching, and set storedResponse to null. [HTTP-CACHING]\n    if (\n      !safeMethodsSet.has(httpRequest.method) &&\n      forwardResponse.status >= 200 &&\n      forwardResponse.status <= 399\n    ) {\n      // TODO: cache\n    }\n\n    // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,\n    // then:\n    if (revalidatingFlag && forwardResponse.status === 304) {\n      // TODO: cache\n    }\n\n    // 5. If response is null, then:\n    if (response == null) {\n      // 1. Set response to forwardResponse.\n      response = forwardResponse\n\n      // 2. Store httpRequest and forwardResponse in httpCache, as per the\n      // \"Storing Responses in Caches\" chapter of HTTP Caching. [HTTP-CACHING]\n      // TODO: cache\n    }\n  }\n\n  // 11. Set response’s URL list to a clone of httpRequest’s URL list.\n  response.urlList = [...httpRequest.urlList]\n\n  // 12. If httpRequest’s header list contains `Range`, then set response’s\n  // range-requested flag.\n  if (httpRequest.headersList.contains('range', true)) {\n    response.rangeRequested = true\n  }\n\n  // 13. Set response’s request-includes-credentials to includeCredentials.\n  response.requestIncludesCredentials = includeCredentials\n\n  // 14. If response’s status is 401, httpRequest’s response tainting is not\n  // \"cors\", includeCredentials is true, and request’s window is an environment\n  // settings object, then:\n  // TODO\n\n  // 15. If response’s status is 407, then:\n  if (response.status === 407) {\n    // 1. If request’s window is \"no-window\", then return a network error.\n    if (request.window === 'no-window') {\n      return makeNetworkError()\n    }\n\n    // 2. ???\n\n    // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n    if (isCancelled(fetchParams)) {\n      return makeAppropriateNetworkError(fetchParams)\n    }\n\n    // 4. Prompt the end user as appropriate in request’s window and store\n    // the result as a proxy-authentication entry. [HTTP-AUTH]\n    // TODO: Invoke some kind of callback?\n\n    // 5. Set response to the result of running HTTP-network-or-cache fetch given\n    // fetchParams.\n    // TODO\n    return makeNetworkError('proxy authentication required')\n  }\n\n  // 16. If all of the following are true\n  if (\n    // response’s status is 421\n    response.status === 421 &&\n    // isNewConnectionFetch is false\n    !isNewConnectionFetch &&\n    // request’s body is null, or request’s body is non-null and request’s body’s source is non-null\n    (request.body == null || request.body.source != null)\n  ) {\n    // then:\n\n    // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n    if (isCancelled(fetchParams)) {\n      return makeAppropriateNetworkError(fetchParams)\n    }\n\n    // 2. Set response to the result of running HTTP-network-or-cache\n    // fetch given fetchParams, isAuthenticationFetch, and true.\n\n    // TODO (spec): The spec doesn't specify this but we need to cancel\n    // the active response before we can start a new one.\n    // https://github.com/whatwg/fetch/issues/1293\n    fetchParams.controller.connection.destroy()\n\n    response = await httpNetworkOrCacheFetch(\n      fetchParams,\n      isAuthenticationFetch,\n      true\n    )\n  }\n\n  // 17. If isAuthenticationFetch is true, then create an authentication entry\n  if (isAuthenticationFetch) {\n    // TODO\n  }\n\n  // 18. Return response.\n  return response\n}\n\n// https://fetch.spec.whatwg.org/#http-network-fetch\nasync function httpNetworkFetch (\n  fetchParams,\n  includeCredentials = false,\n  forceNewConnection = false\n) {\n  assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)\n\n  fetchParams.controller.connection = {\n    abort: null,\n    destroyed: false,\n    destroy (err, abort = true) {\n      if (!this.destroyed) {\n        this.destroyed = true\n        if (abort) {\n          this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))\n        }\n      }\n    }\n  }\n\n  // 1. Let request be fetchParams’s request.\n  const request = fetchParams.request\n\n  // 2. Let response be null.\n  let response = null\n\n  // 3. Let timingInfo be fetchParams’s timing info.\n  const timingInfo = fetchParams.timingInfo\n\n  // 4. Let httpCache be the result of determining the HTTP cache partition,\n  // given request.\n  // TODO: cache\n  const httpCache = null\n\n  // 5. If httpCache is null, then set request’s cache mode to \"no-store\".\n  if (httpCache == null) {\n    request.cache = 'no-store'\n  }\n\n  // 6. Let networkPartitionKey be the result of determining the network\n  // partition key given request.\n  // TODO\n\n  // 7. Let newConnection be \"yes\" if forceNewConnection is true; otherwise\n  // \"no\".\n  const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars\n\n  // 8. Switch on request’s mode:\n  if (request.mode === 'websocket') {\n    // Let connection be the result of obtaining a WebSocket connection,\n    // given request’s current URL.\n    // TODO\n  } else {\n    // Let connection be the result of obtaining a connection, given\n    // networkPartitionKey, request’s current URL’s origin,\n    // includeCredentials, and forceNewConnection.\n    // TODO\n  }\n\n  // 9. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. If connection is failure, then return a network error.\n\n  //    2. Set timingInfo’s final connection timing info to the result of\n  //    calling clamp and coarsen connection timing info with connection’s\n  //    timing info, timingInfo’s post-redirect start time, and fetchParams’s\n  //    cross-origin isolated capability.\n\n  //    3. If connection is not an HTTP/2 connection, request’s body is non-null,\n  //    and request’s body’s source is null, then append (`Transfer-Encoding`,\n  //    `chunked`) to request’s header list.\n\n  //    4. Set timingInfo’s final network-request start time to the coarsened\n  //    shared current time given fetchParams’s cross-origin isolated\n  //    capability.\n\n  //    5. Set response to the result of making an HTTP request over connection\n  //    using request with the following caveats:\n\n  //        - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]\n  //        [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]\n\n  //        - If request’s body is non-null, and request’s body’s source is null,\n  //        then the user agent may have a buffer of up to 64 kibibytes and store\n  //        a part of request’s body in that buffer. If the user agent reads from\n  //        request’s body beyond that buffer’s size and the user agent needs to\n  //        resend request, then instead return a network error.\n\n  //        - Set timingInfo’s final network-response start time to the coarsened\n  //        shared current time given fetchParams’s cross-origin isolated capability,\n  //        immediately after the user agent’s HTTP parser receives the first byte\n  //        of the response (e.g., frame header bytes for HTTP/2 or response status\n  //        line for HTTP/1.x).\n\n  //        - Wait until all the headers are transmitted.\n\n  //        - Any responses whose status is in the range 100 to 199, inclusive,\n  //        and is not 101, are to be ignored, except for the purposes of setting\n  //        timingInfo’s final network-response start time above.\n\n  //    - If request’s header list contains `Transfer-Encoding`/`chunked` and\n  //    response is transferred via HTTP/1.0 or older, then return a network\n  //    error.\n\n  //    - If the HTTP request results in a TLS client certificate dialog, then:\n\n  //        1. If request’s window is an environment settings object, make the\n  //        dialog available in request’s window.\n\n  //        2. Otherwise, return a network error.\n\n  // To transmit request’s body body, run these steps:\n  let requestBody = null\n  // 1. If body is null and fetchParams’s process request end-of-body is\n  // non-null, then queue a fetch task given fetchParams’s process request\n  // end-of-body and fetchParams’s task destination.\n  if (request.body == null && fetchParams.processRequestEndOfBody) {\n    queueMicrotask(() => fetchParams.processRequestEndOfBody())\n  } else if (request.body != null) {\n    // 2. Otherwise, if body is non-null:\n\n    //    1. Let processBodyChunk given bytes be these steps:\n    const processBodyChunk = async function * (bytes) {\n      // 1. If the ongoing fetch is terminated, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. Run this step in parallel: transmit bytes.\n      yield bytes\n\n      // 3. If fetchParams’s process request body is non-null, then run\n      // fetchParams’s process request body given bytes’s length.\n      fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)\n    }\n\n    // 2. Let processEndOfBody be these steps:\n    const processEndOfBody = () => {\n      // 1. If fetchParams is canceled, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. If fetchParams’s process request end-of-body is non-null,\n      // then run fetchParams’s process request end-of-body.\n      if (fetchParams.processRequestEndOfBody) {\n        fetchParams.processRequestEndOfBody()\n      }\n    }\n\n    // 3. Let processBodyError given e be these steps:\n    const processBodyError = (e) => {\n      // 1. If fetchParams is canceled, then abort these steps.\n      if (isCancelled(fetchParams)) {\n        return\n      }\n\n      // 2. If e is an \"AbortError\" DOMException, then abort fetchParams’s controller.\n      if (e.name === 'AbortError') {\n        fetchParams.controller.abort()\n      } else {\n        fetchParams.controller.terminate(e)\n      }\n    }\n\n    // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,\n    // processBodyError, and fetchParams’s task destination.\n    requestBody = (async function * () {\n      try {\n        for await (const bytes of request.body.stream) {\n          yield * processBodyChunk(bytes)\n        }\n        processEndOfBody()\n      } catch (err) {\n        processBodyError(err)\n      }\n    })()\n  }\n\n  try {\n    // socket is only provided for websockets\n    const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })\n\n    if (socket) {\n      response = makeResponse({ status, statusText, headersList, socket })\n    } else {\n      const iterator = body[Symbol.asyncIterator]()\n      fetchParams.controller.next = () => iterator.next()\n\n      response = makeResponse({ status, statusText, headersList })\n    }\n  } catch (err) {\n    // 10. If aborted, then:\n    if (err.name === 'AbortError') {\n      // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n      fetchParams.controller.connection.destroy()\n\n      // 2. Return the appropriate network error for fetchParams.\n      return makeAppropriateNetworkError(fetchParams, err)\n    }\n\n    return makeNetworkError(err)\n  }\n\n  // 11. Let pullAlgorithm be an action that resumes the ongoing fetch\n  // if it is suspended.\n  const pullAlgorithm = async () => {\n    await fetchParams.controller.resume()\n  }\n\n  // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s\n  // controller with reason, given reason.\n  const cancelAlgorithm = (reason) => {\n    // If the aborted fetch was already terminated, then we do not\n    // need to do anything.\n    if (!isCancelled(fetchParams)) {\n      fetchParams.controller.abort(reason)\n    }\n  }\n\n  // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by\n  // the user agent.\n  // TODO\n\n  // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object\n  // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.\n  // TODO\n\n  // 15. Let stream be a new ReadableStream.\n  // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm,\n  //     cancelAlgorithm set to cancelAlgorithm.\n  const stream = new ReadableStream(\n    {\n      async start (controller) {\n        fetchParams.controller.controller = controller\n      },\n      async pull (controller) {\n        await pullAlgorithm(controller)\n      },\n      async cancel (reason) {\n        await cancelAlgorithm(reason)\n      },\n      type: 'bytes'\n    }\n  )\n\n  // 17. Run these steps, but abort when the ongoing fetch is terminated:\n\n  //    1. Set response’s body to a new body whose stream is stream.\n  response.body = { stream, source: null, length: null }\n\n  //    2. If response is not a network error and request’s cache mode is\n  //    not \"no-store\", then update response in httpCache for request.\n  //    TODO\n\n  //    3. If includeCredentials is true and the user agent is not configured\n  //    to block cookies for request (see section 7 of [COOKIES]), then run the\n  //    \"set-cookie-string\" parsing algorithm (see section 5.2 of [COOKIES]) on\n  //    the value of each header whose name is a byte-case-insensitive match for\n  //    `Set-Cookie` in response’s header list, if any, and request’s current URL.\n  //    TODO\n\n  // 18. If aborted, then:\n  // TODO\n\n  // 19. Run these steps in parallel:\n\n  //    1. Run these steps, but abort when fetchParams is canceled:\n  fetchParams.controller.onAborted = onAborted\n  fetchParams.controller.on('terminated', onAborted)\n  fetchParams.controller.resume = async () => {\n    // 1. While true\n    while (true) {\n      // 1-3. See onData...\n\n      // 4. Set bytes to the result of handling content codings given\n      // codings and bytes.\n      let bytes\n      let isFailure\n      try {\n        const { done, value } = await fetchParams.controller.next()\n\n        if (isAborted(fetchParams)) {\n          break\n        }\n\n        bytes = done ? undefined : value\n      } catch (err) {\n        if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n          // zlib doesn't like empty streams.\n          bytes = undefined\n        } else {\n          bytes = err\n\n          // err may be propagated from the result of calling readablestream.cancel,\n          // which might not be an error. https://github.com/nodejs/undici/issues/2009\n          isFailure = true\n        }\n      }\n\n      if (bytes === undefined) {\n        // 2. Otherwise, if the bytes transmission for response’s message\n        // body is done normally and stream is readable, then close\n        // stream, finalize response for fetchParams and response, and\n        // abort these in-parallel steps.\n        readableStreamClose(fetchParams.controller.controller)\n\n        finalizeResponse(fetchParams, response)\n\n        return\n      }\n\n      // 5. Increase timingInfo’s decoded body size by bytes’s length.\n      timingInfo.decodedBodySize += bytes?.byteLength ?? 0\n\n      // 6. If bytes is failure, then terminate fetchParams’s controller.\n      if (isFailure) {\n        fetchParams.controller.terminate(bytes)\n        return\n      }\n\n      // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes\n      // into stream.\n      const buffer = new Uint8Array(bytes)\n      if (buffer.byteLength) {\n        fetchParams.controller.controller.enqueue(buffer)\n      }\n\n      // 8. If stream is errored, then terminate the ongoing fetch.\n      if (isErrored(stream)) {\n        fetchParams.controller.terminate()\n        return\n      }\n\n      // 9. If stream doesn’t need more data ask the user agent to suspend\n      // the ongoing fetch.\n      if (fetchParams.controller.controller.desiredSize <= 0) {\n        return\n      }\n    }\n  }\n\n  //    2. If aborted, then:\n  function onAborted (reason) {\n    // 2. If fetchParams is aborted, then:\n    if (isAborted(fetchParams)) {\n      // 1. Set response’s aborted flag.\n      response.aborted = true\n\n      // 2. If stream is readable, then error stream with the result of\n      //    deserialize a serialized abort reason given fetchParams’s\n      //    controller’s serialized abort reason and an\n      //    implementation-defined realm.\n      if (isReadable(stream)) {\n        fetchParams.controller.controller.error(\n          fetchParams.controller.serializedAbortReason\n        )\n      }\n    } else {\n      // 3. Otherwise, if stream is readable, error stream with a TypeError.\n      if (isReadable(stream)) {\n        fetchParams.controller.controller.error(new TypeError('terminated', {\n          cause: isErrorLike(reason) ? reason : undefined\n        }))\n      }\n    }\n\n    // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n    // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.\n    fetchParams.controller.connection.destroy()\n  }\n\n  // 20. Return response.\n  return response\n\n  function dispatch ({ body }) {\n    const url = requestCurrentURL(request)\n    /** @type {import('../..').Agent} */\n    const agent = fetchParams.controller.dispatcher\n\n    return new Promise((resolve, reject) => agent.dispatch(\n      {\n        path: url.pathname + url.search,\n        origin: url.origin,\n        method: request.method,\n        body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,\n        headers: request.headersList.entries,\n        maxRedirections: 0,\n        upgrade: request.mode === 'websocket' ? 'websocket' : undefined\n      },\n      {\n        body: null,\n        abort: null,\n\n        onConnect (abort) {\n          // TODO (fix): Do we need connection here?\n          const { connection } = fetchParams.controller\n\n          // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen\n          // connection timing info with connection’s timing info, timingInfo’s post-redirect start\n          // time, and fetchParams’s cross-origin isolated capability.\n          // TODO: implement connection timing\n          timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)\n\n          if (connection.destroyed) {\n            abort(new DOMException('The operation was aborted.', 'AbortError'))\n          } else {\n            fetchParams.controller.on('terminated', abort)\n            this.abort = connection.abort = abort\n          }\n\n          // Set timingInfo’s final network-request start time to the coarsened shared current time given\n          // fetchParams’s cross-origin isolated capability.\n          timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n        },\n\n        onResponseStarted () {\n          // Set timingInfo’s final network-response start time to the coarsened shared current\n          // time given fetchParams’s cross-origin isolated capability, immediately after the\n          // user agent’s HTTP parser receives the first byte of the response (e.g., frame header\n          // bytes for HTTP/2 or response status line for HTTP/1.x).\n          timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n        },\n\n        onHeaders (status, rawHeaders, resume, statusText) {\n          if (status < 200) {\n            return\n          }\n\n          let location = ''\n\n          const headersList = new HeadersList()\n\n          for (let i = 0; i < rawHeaders.length; i += 2) {\n            headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n          }\n          location = headersList.get('location', true)\n\n          this.body = new Readable({ read: resume })\n\n          const decoders = []\n\n          const willFollow = location && request.redirect === 'follow' &&\n            redirectStatusSet.has(status)\n\n          // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding\n          if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {\n            // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n            const contentEncoding = headersList.get('content-encoding', true)\n            // \"All content-coding values are case-insensitive...\"\n            /** @type {string[]} */\n            const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []\n\n            // Limit the number of content-encodings to prevent resource exhaustion.\n            // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).\n            const maxContentEncodings = 5\n            if (codings.length > maxContentEncodings) {\n              reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))\n              return true\n            }\n\n            for (let i = codings.length - 1; i >= 0; --i) {\n              const coding = codings[i].trim()\n              // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2\n              if (coding === 'x-gzip' || coding === 'gzip') {\n                decoders.push(zlib.createGunzip({\n                  // Be less strict when decoding compressed responses, since sometimes\n                  // servers send slightly invalid responses that are still accepted\n                  // by common browsers.\n                  // Always using Z_SYNC_FLUSH is what cURL does.\n                  flush: zlib.constants.Z_SYNC_FLUSH,\n                  finishFlush: zlib.constants.Z_SYNC_FLUSH\n                }))\n              } else if (coding === 'deflate') {\n                decoders.push(createInflate({\n                  flush: zlib.constants.Z_SYNC_FLUSH,\n                  finishFlush: zlib.constants.Z_SYNC_FLUSH\n                }))\n              } else if (coding === 'br') {\n                decoders.push(zlib.createBrotliDecompress({\n                  flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n                  finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n                }))\n              } else {\n                decoders.length = 0\n                break\n              }\n            }\n          }\n\n          const onError = this.onError.bind(this)\n\n          resolve({\n            status,\n            statusText,\n            headersList,\n            body: decoders.length\n              ? pipeline(this.body, ...decoders, (err) => {\n                if (err) {\n                  this.onError(err)\n                }\n              }).on('error', onError)\n              : this.body.on('error', onError)\n          })\n\n          return true\n        },\n\n        onData (chunk) {\n          if (fetchParams.controller.dump) {\n            return\n          }\n\n          // 1. If one or more bytes have been transmitted from response’s\n          // message body, then:\n\n          //  1. Let bytes be the transmitted bytes.\n          const bytes = chunk\n\n          //  2. Let codings be the result of extracting header list values\n          //  given `Content-Encoding` and response’s header list.\n          //  See pullAlgorithm.\n\n          //  3. Increase timingInfo’s encoded body size by bytes’s length.\n          timingInfo.encodedBodySize += bytes.byteLength\n\n          //  4. See pullAlgorithm...\n\n          return this.body.push(bytes)\n        },\n\n        onComplete () {\n          if (this.abort) {\n            fetchParams.controller.off('terminated', this.abort)\n          }\n\n          if (fetchParams.controller.onAborted) {\n            fetchParams.controller.off('terminated', fetchParams.controller.onAborted)\n          }\n\n          fetchParams.controller.ended = true\n\n          this.body.push(null)\n        },\n\n        onError (error) {\n          if (this.abort) {\n            fetchParams.controller.off('terminated', this.abort)\n          }\n\n          this.body?.destroy(error)\n\n          fetchParams.controller.terminate(error)\n\n          reject(error)\n        },\n\n        onUpgrade (status, rawHeaders, socket) {\n          if (status !== 101) {\n            return\n          }\n\n          const headersList = new HeadersList()\n\n          for (let i = 0; i < rawHeaders.length; i += 2) {\n            headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n          }\n\n          resolve({\n            status,\n            statusText: STATUS_CODES[status],\n            headersList,\n            socket\n          })\n\n          return true\n        }\n      }\n    ))\n  }\n}\n\nmodule.exports = {\n  fetch,\n  Fetch,\n  fetching,\n  finalizeAndReportTiming\n}\n","/* globals AbortController */\n\n'use strict'\n\nconst { extractBody, mixinBody, cloneBody, bodyUnusable } = require('./body')\nconst { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require('./headers')\nconst { FinalizationRegistry } = require('./dispatcher-weakref')()\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst {\n  isValidHTTPToken,\n  sameOrigin,\n  environmentSettingsObject\n} = require('./util')\nconst {\n  forbiddenMethodsSet,\n  corsSafeListedMethodsSet,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  requestDuplex\n} = require('./constants')\nconst { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util\nconst { kHeaders, kSignal, kState, kDispatcher } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('node:events')\n\nconst kAbortController = Symbol('abortController')\n\nconst requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n  signal.removeEventListener('abort', abort)\n})\n\nconst dependentControllerMap = new WeakMap()\n\nfunction buildAbort (acRef) {\n  return abort\n\n  function abort () {\n    const ac = acRef.deref()\n    if (ac !== undefined) {\n      // Currently, there is a problem with FinalizationRegistry.\n      // https://github.com/nodejs/node/issues/49344\n      // https://github.com/nodejs/node/issues/47748\n      // In the case of abort, the first step is to unregister from it.\n      // If the controller can refer to it, it is still registered.\n      // It will be removed in the future.\n      requestFinalizer.unregister(abort)\n\n      // Unsubscribe a listener.\n      // FinalizationRegistry will no longer be called, so this must be done.\n      this.removeEventListener('abort', abort)\n\n      ac.abort(this.reason)\n\n      const controllerList = dependentControllerMap.get(ac.signal)\n\n      if (controllerList !== undefined) {\n        if (controllerList.size !== 0) {\n          for (const ref of controllerList) {\n            const ctrl = ref.deref()\n            if (ctrl !== undefined) {\n              ctrl.abort(this.reason)\n            }\n          }\n          controllerList.clear()\n        }\n        dependentControllerMap.delete(ac.signal)\n      }\n    }\n  }\n}\n\nlet patchMethodWarning = false\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request {\n  // https://fetch.spec.whatwg.org/#dom-request\n  constructor (input, init = {}) {\n    webidl.util.markAsUncloneable(this)\n    if (input === kConstruct) {\n      return\n    }\n\n    const prefix = 'Request constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    input = webidl.converters.RequestInfo(input, prefix, 'input')\n    init = webidl.converters.RequestInit(init, prefix, 'init')\n\n    // 1. Let request be null.\n    let request = null\n\n    // 2. Let fallbackMode be null.\n    let fallbackMode = null\n\n    // 3. Let baseURL be this’s relevant settings object’s API base URL.\n    const baseUrl = environmentSettingsObject.settingsObject.baseUrl\n\n    // 4. Let signal be null.\n    let signal = null\n\n    // 5. If input is a string, then:\n    if (typeof input === 'string') {\n      this[kDispatcher] = init.dispatcher\n\n      // 1. Let parsedURL be the result of parsing input with baseURL.\n      // 2. If parsedURL is failure, then throw a TypeError.\n      let parsedURL\n      try {\n        parsedURL = new URL(input, baseUrl)\n      } catch (err) {\n        throw new TypeError('Failed to parse URL from ' + input, { cause: err })\n      }\n\n      // 3. If parsedURL includes credentials, then throw a TypeError.\n      if (parsedURL.username || parsedURL.password) {\n        throw new TypeError(\n          'Request cannot be constructed from a URL that includes credentials: ' +\n            input\n        )\n      }\n\n      // 4. Set request to a new request whose URL is parsedURL.\n      request = makeRequest({ urlList: [parsedURL] })\n\n      // 5. Set fallbackMode to \"cors\".\n      fallbackMode = 'cors'\n    } else {\n      this[kDispatcher] = init.dispatcher || input[kDispatcher]\n\n      // 6. Otherwise:\n\n      // 7. Assert: input is a Request object.\n      assert(input instanceof Request)\n\n      // 8. Set request to input’s request.\n      request = input[kState]\n\n      // 9. Set signal to input’s signal.\n      signal = input[kSignal]\n    }\n\n    // 7. Let origin be this’s relevant settings object’s origin.\n    const origin = environmentSettingsObject.settingsObject.origin\n\n    // 8. Let window be \"client\".\n    let window = 'client'\n\n    // 9. If request’s window is an environment settings object and its origin\n    // is same origin with origin, then set window to request’s window.\n    if (\n      request.window?.constructor?.name === 'EnvironmentSettingsObject' &&\n      sameOrigin(request.window, origin)\n    ) {\n      window = request.window\n    }\n\n    // 10. If init[\"window\"] exists and is non-null, then throw a TypeError.\n    if (init.window != null) {\n      throw new TypeError(`'window' option '${window}' must be null`)\n    }\n\n    // 11. If init[\"window\"] exists, then set window to \"no-window\".\n    if ('window' in init) {\n      window = 'no-window'\n    }\n\n    // 12. Set request to a new request with the following properties:\n    request = makeRequest({\n      // URL request’s URL.\n      // undici implementation note: this is set as the first item in request's urlList in makeRequest\n      // method request’s method.\n      method: request.method,\n      // header list A copy of request’s header list.\n      // undici implementation note: headersList is cloned in makeRequest\n      headersList: request.headersList,\n      // unsafe-request flag Set.\n      unsafeRequest: request.unsafeRequest,\n      // client This’s relevant settings object.\n      client: environmentSettingsObject.settingsObject,\n      // window window.\n      window,\n      // priority request’s priority.\n      priority: request.priority,\n      // origin request’s origin. The propagation of the origin is only significant for navigation requests\n      // being handled by a service worker. In this scenario a request can have an origin that is different\n      // from the current client.\n      origin: request.origin,\n      // referrer request’s referrer.\n      referrer: request.referrer,\n      // referrer policy request’s referrer policy.\n      referrerPolicy: request.referrerPolicy,\n      // mode request’s mode.\n      mode: request.mode,\n      // credentials mode request’s credentials mode.\n      credentials: request.credentials,\n      // cache mode request’s cache mode.\n      cache: request.cache,\n      // redirect mode request’s redirect mode.\n      redirect: request.redirect,\n      // integrity metadata request’s integrity metadata.\n      integrity: request.integrity,\n      // keepalive request’s keepalive.\n      keepalive: request.keepalive,\n      // reload-navigation flag request’s reload-navigation flag.\n      reloadNavigation: request.reloadNavigation,\n      // history-navigation flag request’s history-navigation flag.\n      historyNavigation: request.historyNavigation,\n      // URL list A clone of request’s URL list.\n      urlList: [...request.urlList]\n    })\n\n    const initHasKey = Object.keys(init).length !== 0\n\n    // 13. If init is not empty, then:\n    if (initHasKey) {\n      // 1. If request’s mode is \"navigate\", then set it to \"same-origin\".\n      if (request.mode === 'navigate') {\n        request.mode = 'same-origin'\n      }\n\n      // 2. Unset request’s reload-navigation flag.\n      request.reloadNavigation = false\n\n      // 3. Unset request’s history-navigation flag.\n      request.historyNavigation = false\n\n      // 4. Set request’s origin to \"client\".\n      request.origin = 'client'\n\n      // 5. Set request’s referrer to \"client\"\n      request.referrer = 'client'\n\n      // 6. Set request’s referrer policy to the empty string.\n      request.referrerPolicy = ''\n\n      // 7. Set request’s URL to request’s current URL.\n      request.url = request.urlList[request.urlList.length - 1]\n\n      // 8. Set request’s URL list to « request’s URL ».\n      request.urlList = [request.url]\n    }\n\n    // 14. If init[\"referrer\"] exists, then:\n    if (init.referrer !== undefined) {\n      // 1. Let referrer be init[\"referrer\"].\n      const referrer = init.referrer\n\n      // 2. If referrer is the empty string, then set request’s referrer to \"no-referrer\".\n      if (referrer === '') {\n        request.referrer = 'no-referrer'\n      } else {\n        // 1. Let parsedReferrer be the result of parsing referrer with\n        // baseURL.\n        // 2. If parsedReferrer is failure, then throw a TypeError.\n        let parsedReferrer\n        try {\n          parsedReferrer = new URL(referrer, baseUrl)\n        } catch (err) {\n          throw new TypeError(`Referrer \"${referrer}\" is not a valid URL.`, { cause: err })\n        }\n\n        // 3. If one of the following is true\n        // - parsedReferrer’s scheme is \"about\" and path is the string \"client\"\n        // - parsedReferrer’s origin is not same origin with origin\n        // then set request’s referrer to \"client\".\n        if (\n          (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||\n          (origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl))\n        ) {\n          request.referrer = 'client'\n        } else {\n          // 4. Otherwise, set request’s referrer to parsedReferrer.\n          request.referrer = parsedReferrer\n        }\n      }\n    }\n\n    // 15. If init[\"referrerPolicy\"] exists, then set request’s referrer policy\n    // to it.\n    if (init.referrerPolicy !== undefined) {\n      request.referrerPolicy = init.referrerPolicy\n    }\n\n    // 16. Let mode be init[\"mode\"] if it exists, and fallbackMode otherwise.\n    let mode\n    if (init.mode !== undefined) {\n      mode = init.mode\n    } else {\n      mode = fallbackMode\n    }\n\n    // 17. If mode is \"navigate\", then throw a TypeError.\n    if (mode === 'navigate') {\n      throw webidl.errors.exception({\n        header: 'Request constructor',\n        message: 'invalid request mode navigate.'\n      })\n    }\n\n    // 18. If mode is non-null, set request’s mode to mode.\n    if (mode != null) {\n      request.mode = mode\n    }\n\n    // 19. If init[\"credentials\"] exists, then set request’s credentials mode\n    // to it.\n    if (init.credentials !== undefined) {\n      request.credentials = init.credentials\n    }\n\n    // 18. If init[\"cache\"] exists, then set request’s cache mode to it.\n    if (init.cache !== undefined) {\n      request.cache = init.cache\n    }\n\n    // 21. If request’s cache mode is \"only-if-cached\" and request’s mode is\n    // not \"same-origin\", then throw a TypeError.\n    if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {\n      throw new TypeError(\n        \"'only-if-cached' can be set only with 'same-origin' mode\"\n      )\n    }\n\n    // 22. If init[\"redirect\"] exists, then set request’s redirect mode to it.\n    if (init.redirect !== undefined) {\n      request.redirect = init.redirect\n    }\n\n    // 23. If init[\"integrity\"] exists, then set request’s integrity metadata to it.\n    if (init.integrity != null) {\n      request.integrity = String(init.integrity)\n    }\n\n    // 24. If init[\"keepalive\"] exists, then set request’s keepalive to it.\n    if (init.keepalive !== undefined) {\n      request.keepalive = Boolean(init.keepalive)\n    }\n\n    // 25. If init[\"method\"] exists, then:\n    if (init.method !== undefined) {\n      // 1. Let method be init[\"method\"].\n      let method = init.method\n\n      const mayBeNormalized = normalizedMethodRecords[method]\n\n      if (mayBeNormalized !== undefined) {\n        // Note: Bypass validation DELETE, GET, HEAD, OPTIONS, POST, PUT, PATCH and these lowercase ones\n        request.method = mayBeNormalized\n      } else {\n        // 2. If method is not a method or method is a forbidden method, then\n        // throw a TypeError.\n        if (!isValidHTTPToken(method)) {\n          throw new TypeError(`'${method}' is not a valid HTTP method.`)\n        }\n\n        const upperCase = method.toUpperCase()\n\n        if (forbiddenMethodsSet.has(upperCase)) {\n          throw new TypeError(`'${method}' HTTP method is unsupported.`)\n        }\n\n        // 3. Normalize method.\n        // https://fetch.spec.whatwg.org/#concept-method-normalize\n        // Note: must be in uppercase\n        method = normalizedMethodRecordsBase[upperCase] ?? method\n\n        // 4. Set request’s method to method.\n        request.method = method\n      }\n\n      if (!patchMethodWarning && request.method === 'patch') {\n        process.emitWarning('Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.', {\n          code: 'UNDICI-FETCH-patch'\n        })\n\n        patchMethodWarning = true\n      }\n    }\n\n    // 26. If init[\"signal\"] exists, then set signal to it.\n    if (init.signal !== undefined) {\n      signal = init.signal\n    }\n\n    // 27. Set this’s request to request.\n    this[kState] = request\n\n    // 28. Set this’s signal to a new AbortSignal object with this’s relevant\n    // Realm.\n    // TODO: could this be simplified with AbortSignal.any\n    // (https://dom.spec.whatwg.org/#dom-abortsignal-any)\n    const ac = new AbortController()\n    this[kSignal] = ac.signal\n\n    // 29. If signal is not null, then make this’s signal follow signal.\n    if (signal != null) {\n      if (\n        !signal ||\n        typeof signal.aborted !== 'boolean' ||\n        typeof signal.addEventListener !== 'function'\n      ) {\n        throw new TypeError(\n          \"Failed to construct 'Request': member signal is not of type AbortSignal.\"\n        )\n      }\n\n      if (signal.aborted) {\n        ac.abort(signal.reason)\n      } else {\n        // Keep a strong ref to ac while request object\n        // is alive. This is needed to prevent AbortController\n        // from being prematurely garbage collected.\n        // See, https://github.com/nodejs/undici/issues/1926.\n        this[kAbortController] = ac\n\n        const acRef = new WeakRef(ac)\n        const abort = buildAbort(acRef)\n\n        // Third-party AbortControllers may not work with these.\n        // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.\n        try {\n          // If the max amount of listeners is equal to the default, increase it\n          // This is only available in node >= v19.9.0\n          if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {\n            setMaxListeners(1500, signal)\n          } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {\n            setMaxListeners(1500, signal)\n          }\n        } catch {}\n\n        util.addAbortListener(signal, abort)\n        // The third argument must be a registry key to be unregistered.\n        // Without it, you cannot unregister.\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n        // abort is used as the unregister key. (because it is unique)\n        requestFinalizer.register(ac, { signal, abort }, abort)\n      }\n    }\n\n    // 30. Set this’s headers to a new Headers object with this’s relevant\n    // Realm, whose header list is request’s header list and guard is\n    // \"request\".\n    this[kHeaders] = new Headers(kConstruct)\n    setHeadersList(this[kHeaders], request.headersList)\n    setHeadersGuard(this[kHeaders], 'request')\n\n    // 31. If this’s request’s mode is \"no-cors\", then:\n    if (mode === 'no-cors') {\n      // 1. If this’s request’s method is not a CORS-safelisted method,\n      // then throw a TypeError.\n      if (!corsSafeListedMethodsSet.has(request.method)) {\n        throw new TypeError(\n          `'${request.method} is unsupported in no-cors mode.`\n        )\n      }\n\n      // 2. Set this’s headers’s guard to \"request-no-cors\".\n      setHeadersGuard(this[kHeaders], 'request-no-cors')\n    }\n\n    // 32. If init is not empty, then:\n    if (initHasKey) {\n      /** @type {HeadersList} */\n      const headersList = getHeadersList(this[kHeaders])\n      // 1. Let headers be a copy of this’s headers and its associated header\n      // list.\n      // 2. If init[\"headers\"] exists, then set headers to init[\"headers\"].\n      const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)\n\n      // 3. Empty this’s headers’s header list.\n      headersList.clear()\n\n      // 4. If headers is a Headers object, then for each header in its header\n      // list, append header’s name/header’s value to this’s headers.\n      if (headers instanceof HeadersList) {\n        for (const { name, value } of headers.rawValues()) {\n          headersList.append(name, value, false)\n        }\n        // Note: Copy the `set-cookie` meta-data.\n        headersList.cookies = headers.cookies\n      } else {\n        // 5. Otherwise, fill this’s headers with headers.\n        fillHeaders(this[kHeaders], headers)\n      }\n    }\n\n    // 33. Let inputBody be input’s request’s body if input is a Request\n    // object; otherwise null.\n    const inputBody = input instanceof Request ? input[kState].body : null\n\n    // 34. If either init[\"body\"] exists and is non-null or inputBody is\n    // non-null, and request’s method is `GET` or `HEAD`, then throw a\n    // TypeError.\n    if (\n      (init.body != null || inputBody != null) &&\n      (request.method === 'GET' || request.method === 'HEAD')\n    ) {\n      throw new TypeError('Request with GET/HEAD method cannot have body.')\n    }\n\n    // 35. Let initBody be null.\n    let initBody = null\n\n    // 36. If init[\"body\"] exists and is non-null, then:\n    if (init.body != null) {\n      // 1. Let Content-Type be null.\n      // 2. Set initBody and Content-Type to the result of extracting\n      // init[\"body\"], with keepalive set to request’s keepalive.\n      const [extractedBody, contentType] = extractBody(\n        init.body,\n        request.keepalive\n      )\n      initBody = extractedBody\n\n      // 3, If Content-Type is non-null and this’s headers’s header list does\n      // not contain `Content-Type`, then append `Content-Type`/Content-Type to\n      // this’s headers.\n      if (contentType && !getHeadersList(this[kHeaders]).contains('content-type', true)) {\n        this[kHeaders].append('content-type', contentType)\n      }\n    }\n\n    // 37. Let inputOrInitBody be initBody if it is non-null; otherwise\n    // inputBody.\n    const inputOrInitBody = initBody ?? inputBody\n\n    // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is\n    // null, then:\n    if (inputOrInitBody != null && inputOrInitBody.source == null) {\n      // 1. If initBody is non-null and init[\"duplex\"] does not exist,\n      //    then throw a TypeError.\n      if (initBody != null && init.duplex == null) {\n        throw new TypeError('RequestInit: duplex option is required when sending a body.')\n      }\n\n      // 2. If this’s request’s mode is neither \"same-origin\" nor \"cors\",\n      // then throw a TypeError.\n      if (request.mode !== 'same-origin' && request.mode !== 'cors') {\n        throw new TypeError(\n          'If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"'\n        )\n      }\n\n      // 3. Set this’s request’s use-CORS-preflight flag.\n      request.useCORSPreflightFlag = true\n    }\n\n    // 39. Let finalBody be inputOrInitBody.\n    let finalBody = inputOrInitBody\n\n    // 40. If initBody is null and inputBody is non-null, then:\n    if (initBody == null && inputBody != null) {\n      // 1. If input is unusable, then throw a TypeError.\n      if (bodyUnusable(input)) {\n        throw new TypeError(\n          'Cannot construct a Request with a Request object that has already been used.'\n        )\n      }\n\n      // 2. Set finalBody to the result of creating a proxy for inputBody.\n      // https://streams.spec.whatwg.org/#readablestream-create-a-proxy\n      const identityTransform = new TransformStream()\n      inputBody.stream.pipeThrough(identityTransform)\n      finalBody = {\n        source: inputBody.source,\n        length: inputBody.length,\n        stream: identityTransform.readable\n      }\n    }\n\n    // 41. Set this’s request’s body to finalBody.\n    this[kState].body = finalBody\n  }\n\n  // Returns request’s HTTP method, which is \"GET\" by default.\n  get method () {\n    webidl.brandCheck(this, Request)\n\n    // The method getter steps are to return this’s request’s method.\n    return this[kState].method\n  }\n\n  // Returns the URL of request as a string.\n  get url () {\n    webidl.brandCheck(this, Request)\n\n    // The url getter steps are to return this’s request’s URL, serialized.\n    return URLSerializer(this[kState].url)\n  }\n\n  // Returns a Headers object consisting of the headers associated with request.\n  // Note that headers added in the network layer by the user agent will not\n  // be accounted for in this object, e.g., the \"Host\" header.\n  get headers () {\n    webidl.brandCheck(this, Request)\n\n    // The headers getter steps are to return this’s headers.\n    return this[kHeaders]\n  }\n\n  // Returns the kind of resource requested by request, e.g., \"document\"\n  // or \"script\".\n  get destination () {\n    webidl.brandCheck(this, Request)\n\n    // The destination getter are to return this’s request’s destination.\n    return this[kState].destination\n  }\n\n  // Returns the referrer of request. Its value can be a same-origin URL if\n  // explicitly set in init, the empty string to indicate no referrer, and\n  // \"about:client\" when defaulting to the global’s default. This is used\n  // during fetching to determine the value of the `Referer` header of the\n  // request being made.\n  get referrer () {\n    webidl.brandCheck(this, Request)\n\n    // 1. If this’s request’s referrer is \"no-referrer\", then return the\n    // empty string.\n    if (this[kState].referrer === 'no-referrer') {\n      return ''\n    }\n\n    // 2. If this’s request’s referrer is \"client\", then return\n    // \"about:client\".\n    if (this[kState].referrer === 'client') {\n      return 'about:client'\n    }\n\n    // Return this’s request’s referrer, serialized.\n    return this[kState].referrer.toString()\n  }\n\n  // Returns the referrer policy associated with request.\n  // This is used during fetching to compute the value of the request’s\n  // referrer.\n  get referrerPolicy () {\n    webidl.brandCheck(this, Request)\n\n    // The referrerPolicy getter steps are to return this’s request’s referrer policy.\n    return this[kState].referrerPolicy\n  }\n\n  // Returns the mode associated with request, which is a string indicating\n  // whether the request will use CORS, or will be restricted to same-origin\n  // URLs.\n  get mode () {\n    webidl.brandCheck(this, Request)\n\n    // The mode getter steps are to return this’s request’s mode.\n    return this[kState].mode\n  }\n\n  // Returns the credentials mode associated with request,\n  // which is a string indicating whether credentials will be sent with the\n  // request always, never, or only when sent to a same-origin URL.\n  get credentials () {\n    // The credentials getter steps are to return this’s request’s credentials mode.\n    return this[kState].credentials\n  }\n\n  // Returns the cache mode associated with request,\n  // which is a string indicating how the request will\n  // interact with the browser’s cache when fetching.\n  get cache () {\n    webidl.brandCheck(this, Request)\n\n    // The cache getter steps are to return this’s request’s cache mode.\n    return this[kState].cache\n  }\n\n  // Returns the redirect mode associated with request,\n  // which is a string indicating how redirects for the\n  // request will be handled during fetching. A request\n  // will follow redirects by default.\n  get redirect () {\n    webidl.brandCheck(this, Request)\n\n    // The redirect getter steps are to return this’s request’s redirect mode.\n    return this[kState].redirect\n  }\n\n  // Returns request’s subresource integrity metadata, which is a\n  // cryptographic hash of the resource being fetched. Its value\n  // consists of multiple hashes separated by whitespace. [SRI]\n  get integrity () {\n    webidl.brandCheck(this, Request)\n\n    // The integrity getter steps are to return this’s request’s integrity\n    // metadata.\n    return this[kState].integrity\n  }\n\n  // Returns a boolean indicating whether or not request can outlive the\n  // global in which it was created.\n  get keepalive () {\n    webidl.brandCheck(this, Request)\n\n    // The keepalive getter steps are to return this’s request’s keepalive.\n    return this[kState].keepalive\n  }\n\n  // Returns a boolean indicating whether or not request is for a reload\n  // navigation.\n  get isReloadNavigation () {\n    webidl.brandCheck(this, Request)\n\n    // The isReloadNavigation getter steps are to return true if this’s\n    // request’s reload-navigation flag is set; otherwise false.\n    return this[kState].reloadNavigation\n  }\n\n  // Returns a boolean indicating whether or not request is for a history\n  // navigation (a.k.a. back-forward navigation).\n  get isHistoryNavigation () {\n    webidl.brandCheck(this, Request)\n\n    // The isHistoryNavigation getter steps are to return true if this’s request’s\n    // history-navigation flag is set; otherwise false.\n    return this[kState].historyNavigation\n  }\n\n  // Returns the signal associated with request, which is an AbortSignal\n  // object indicating whether or not request has been aborted, and its\n  // abort event handler.\n  get signal () {\n    webidl.brandCheck(this, Request)\n\n    // The signal getter steps are to return this’s signal.\n    return this[kSignal]\n  }\n\n  get body () {\n    webidl.brandCheck(this, Request)\n\n    return this[kState].body ? this[kState].body.stream : null\n  }\n\n  get bodyUsed () {\n    webidl.brandCheck(this, Request)\n\n    return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n  }\n\n  get duplex () {\n    webidl.brandCheck(this, Request)\n\n    return 'half'\n  }\n\n  // Returns a clone of request.\n  clone () {\n    webidl.brandCheck(this, Request)\n\n    // 1. If this is unusable, then throw a TypeError.\n    if (bodyUnusable(this)) {\n      throw new TypeError('unusable')\n    }\n\n    // 2. Let clonedRequest be the result of cloning this’s request.\n    const clonedRequest = cloneRequest(this[kState])\n\n    // 3. Let clonedRequestObject be the result of creating a Request object,\n    // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.\n    // 4. Make clonedRequestObject’s signal follow this’s signal.\n    const ac = new AbortController()\n    if (this.signal.aborted) {\n      ac.abort(this.signal.reason)\n    } else {\n      let list = dependentControllerMap.get(this.signal)\n      if (list === undefined) {\n        list = new Set()\n        dependentControllerMap.set(this.signal, list)\n      }\n      const acRef = new WeakRef(ac)\n      list.add(acRef)\n      util.addAbortListener(\n        ac.signal,\n        buildAbort(acRef)\n      )\n    }\n\n    // 4. Return clonedRequestObject.\n    return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders]))\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    if (options.depth === null) {\n      options.depth = 2\n    }\n\n    options.colors ??= true\n\n    const properties = {\n      method: this.method,\n      url: this.url,\n      headers: this.headers,\n      destination: this.destination,\n      referrer: this.referrer,\n      referrerPolicy: this.referrerPolicy,\n      mode: this.mode,\n      credentials: this.credentials,\n      cache: this.cache,\n      redirect: this.redirect,\n      integrity: this.integrity,\n      keepalive: this.keepalive,\n      isReloadNavigation: this.isReloadNavigation,\n      isHistoryNavigation: this.isHistoryNavigation,\n      signal: this.signal\n    }\n\n    return `Request ${nodeUtil.formatWithOptions(options, properties)}`\n  }\n}\n\nmixinBody(Request)\n\n// https://fetch.spec.whatwg.org/#requests\nfunction makeRequest (init) {\n  return {\n    method: init.method ?? 'GET',\n    localURLsOnly: init.localURLsOnly ?? false,\n    unsafeRequest: init.unsafeRequest ?? false,\n    body: init.body ?? null,\n    client: init.client ?? null,\n    reservedClient: init.reservedClient ?? null,\n    replacesClientId: init.replacesClientId ?? '',\n    window: init.window ?? 'client',\n    keepalive: init.keepalive ?? false,\n    serviceWorkers: init.serviceWorkers ?? 'all',\n    initiator: init.initiator ?? '',\n    destination: init.destination ?? '',\n    priority: init.priority ?? null,\n    origin: init.origin ?? 'client',\n    policyContainer: init.policyContainer ?? 'client',\n    referrer: init.referrer ?? 'client',\n    referrerPolicy: init.referrerPolicy ?? '',\n    mode: init.mode ?? 'no-cors',\n    useCORSPreflightFlag: init.useCORSPreflightFlag ?? false,\n    credentials: init.credentials ?? 'same-origin',\n    useCredentials: init.useCredentials ?? false,\n    cache: init.cache ?? 'default',\n    redirect: init.redirect ?? 'follow',\n    integrity: init.integrity ?? '',\n    cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? '',\n    parserMetadata: init.parserMetadata ?? '',\n    reloadNavigation: init.reloadNavigation ?? false,\n    historyNavigation: init.historyNavigation ?? false,\n    userActivation: init.userActivation ?? false,\n    taintedOrigin: init.taintedOrigin ?? false,\n    redirectCount: init.redirectCount ?? 0,\n    responseTainting: init.responseTainting ?? 'basic',\n    preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false,\n    done: init.done ?? false,\n    timingAllowFailed: init.timingAllowFailed ?? false,\n    urlList: init.urlList,\n    url: init.urlList[0],\n    headersList: init.headersList\n      ? new HeadersList(init.headersList)\n      : new HeadersList()\n  }\n}\n\n// https://fetch.spec.whatwg.org/#concept-request-clone\nfunction cloneRequest (request) {\n  // To clone a request request, run these steps:\n\n  // 1. Let newRequest be a copy of request, except for its body.\n  const newRequest = makeRequest({ ...request, body: null })\n\n  // 2. If request’s body is non-null, set newRequest’s body to the\n  // result of cloning request’s body.\n  if (request.body != null) {\n    newRequest.body = cloneBody(newRequest, request.body)\n  }\n\n  // 3. Return newRequest.\n  return newRequest\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-create\n * @param {any} innerRequest\n * @param {AbortSignal} signal\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Request}\n */\nfunction fromInnerRequest (innerRequest, signal, guard) {\n  const request = new Request(kConstruct)\n  request[kState] = innerRequest\n  request[kSignal] = signal\n  request[kHeaders] = new Headers(kConstruct)\n  setHeadersList(request[kHeaders], innerRequest.headersList)\n  setHeadersGuard(request[kHeaders], guard)\n  return request\n}\n\nObject.defineProperties(Request.prototype, {\n  method: kEnumerableProperty,\n  url: kEnumerableProperty,\n  headers: kEnumerableProperty,\n  redirect: kEnumerableProperty,\n  clone: kEnumerableProperty,\n  signal: kEnumerableProperty,\n  duplex: kEnumerableProperty,\n  destination: kEnumerableProperty,\n  body: kEnumerableProperty,\n  bodyUsed: kEnumerableProperty,\n  isHistoryNavigation: kEnumerableProperty,\n  isReloadNavigation: kEnumerableProperty,\n  keepalive: kEnumerableProperty,\n  integrity: kEnumerableProperty,\n  cache: kEnumerableProperty,\n  credentials: kEnumerableProperty,\n  attribute: kEnumerableProperty,\n  referrerPolicy: kEnumerableProperty,\n  referrer: kEnumerableProperty,\n  mode: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Request',\n    configurable: true\n  }\n})\n\nwebidl.converters.Request = webidl.interfaceConverter(\n  Request\n)\n\n// https://fetch.spec.whatwg.org/#requestinfo\nwebidl.converters.RequestInfo = function (V, prefix, argument) {\n  if (typeof V === 'string') {\n    return webidl.converters.USVString(V, prefix, argument)\n  }\n\n  if (V instanceof Request) {\n    return webidl.converters.Request(V, prefix, argument)\n  }\n\n  return webidl.converters.USVString(V, prefix, argument)\n}\n\nwebidl.converters.AbortSignal = webidl.interfaceConverter(\n  AbortSignal\n)\n\n// https://fetch.spec.whatwg.org/#requestinit\nwebidl.converters.RequestInit = webidl.dictionaryConverter([\n  {\n    key: 'method',\n    converter: webidl.converters.ByteString\n  },\n  {\n    key: 'headers',\n    converter: webidl.converters.HeadersInit\n  },\n  {\n    key: 'body',\n    converter: webidl.nullableConverter(\n      webidl.converters.BodyInit\n    )\n  },\n  {\n    key: 'referrer',\n    converter: webidl.converters.USVString\n  },\n  {\n    key: 'referrerPolicy',\n    converter: webidl.converters.DOMString,\n    // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n    allowedValues: referrerPolicy\n  },\n  {\n    key: 'mode',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#concept-request-mode\n    allowedValues: requestMode\n  },\n  {\n    key: 'credentials',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestcredentials\n    allowedValues: requestCredentials\n  },\n  {\n    key: 'cache',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestcache\n    allowedValues: requestCache\n  },\n  {\n    key: 'redirect',\n    converter: webidl.converters.DOMString,\n    // https://fetch.spec.whatwg.org/#requestredirect\n    allowedValues: requestRedirect\n  },\n  {\n    key: 'integrity',\n    converter: webidl.converters.DOMString\n  },\n  {\n    key: 'keepalive',\n    converter: webidl.converters.boolean\n  },\n  {\n    key: 'signal',\n    converter: webidl.nullableConverter(\n      (signal) => webidl.converters.AbortSignal(\n        signal,\n        'RequestInit',\n        'signal',\n        { strict: false }\n      )\n    )\n  },\n  {\n    key: 'window',\n    converter: webidl.converters.any\n  },\n  {\n    key: 'duplex',\n    converter: webidl.converters.DOMString,\n    allowedValues: requestDuplex\n  },\n  {\n    key: 'dispatcher', // undici specific option\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }\n","'use strict'\n\nconst { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require('./headers')\nconst { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require('./body')\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst { kEnumerableProperty } = util\nconst {\n  isValidReasonPhrase,\n  isCancelled,\n  isAborted,\n  isBlobLike,\n  serializeJavascriptValueToJSONString,\n  isErrorLike,\n  isomorphicEncode,\n  environmentSettingsObject: relevantRealm\n} = require('./util')\nconst {\n  redirectStatusSet,\n  nullBodyStatus\n} = require('./constants')\nconst { kState, kHeaders } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { FormData } = require('./formdata')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { types } = require('node:util')\n\nconst textEncoder = new TextEncoder('utf-8')\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response {\n  // Creates network error Response.\n  static error () {\n    // The static error() method steps are to return the result of creating a\n    // Response object, given a new network error, \"immutable\", and this’s\n    // relevant Realm.\n    const responseObject = fromInnerResponse(makeNetworkError(), 'immutable')\n\n    return responseObject\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-json\n  static json (data, init = {}) {\n    webidl.argumentLengthCheck(arguments, 1, 'Response.json')\n\n    if (init !== null) {\n      init = webidl.converters.ResponseInit(init)\n    }\n\n    // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.\n    const bytes = textEncoder.encode(\n      serializeJavascriptValueToJSONString(data)\n    )\n\n    // 2. Let body be the result of extracting bytes.\n    const body = extractBody(bytes)\n\n    // 3. Let responseObject be the result of creating a Response object, given a new response,\n    //    \"response\", and this’s relevant Realm.\n    const responseObject = fromInnerResponse(makeResponse({}), 'response')\n\n    // 4. Perform initialize a response given responseObject, init, and (body, \"application/json\").\n    initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })\n\n    // 5. Return responseObject.\n    return responseObject\n  }\n\n  // Creates a redirect Response that redirects to url with status status.\n  static redirect (url, status = 302) {\n    webidl.argumentLengthCheck(arguments, 1, 'Response.redirect')\n\n    url = webidl.converters.USVString(url)\n    status = webidl.converters['unsigned short'](status)\n\n    // 1. Let parsedURL be the result of parsing url with current settings\n    // object’s API base URL.\n    // 2. If parsedURL is failure, then throw a TypeError.\n    // TODO: base-URL?\n    let parsedURL\n    try {\n      parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl)\n    } catch (err) {\n      throw new TypeError(`Failed to parse URL from ${url}`, { cause: err })\n    }\n\n    // 3. If status is not a redirect status, then throw a RangeError.\n    if (!redirectStatusSet.has(status)) {\n      throw new RangeError(`Invalid status code ${status}`)\n    }\n\n    // 4. Let responseObject be the result of creating a Response object,\n    // given a new response, \"immutable\", and this’s relevant Realm.\n    const responseObject = fromInnerResponse(makeResponse({}), 'immutable')\n\n    // 5. Set responseObject’s response’s status to status.\n    responseObject[kState].status = status\n\n    // 6. Let value be parsedURL, serialized and isomorphic encoded.\n    const value = isomorphicEncode(URLSerializer(parsedURL))\n\n    // 7. Append `Location`/value to responseObject’s response’s header list.\n    responseObject[kState].headersList.append('location', value, true)\n\n    // 8. Return responseObject.\n    return responseObject\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response\n  constructor (body = null, init = {}) {\n    webidl.util.markAsUncloneable(this)\n    if (body === kConstruct) {\n      return\n    }\n\n    if (body !== null) {\n      body = webidl.converters.BodyInit(body)\n    }\n\n    init = webidl.converters.ResponseInit(init)\n\n    // 1. Set this’s response to a new response.\n    this[kState] = makeResponse({})\n\n    // 2. Set this’s headers to a new Headers object with this’s relevant\n    // Realm, whose header list is this’s response’s header list and guard\n    // is \"response\".\n    this[kHeaders] = new Headers(kConstruct)\n    setHeadersGuard(this[kHeaders], 'response')\n    setHeadersList(this[kHeaders], this[kState].headersList)\n\n    // 3. Let bodyWithType be null.\n    let bodyWithType = null\n\n    // 4. If body is non-null, then set bodyWithType to the result of extracting body.\n    if (body != null) {\n      const [extractedBody, type] = extractBody(body)\n      bodyWithType = { body: extractedBody, type }\n    }\n\n    // 5. Perform initialize a response given this, init, and bodyWithType.\n    initializeResponse(this, init, bodyWithType)\n  }\n\n  // Returns response’s type, e.g., \"cors\".\n  get type () {\n    webidl.brandCheck(this, Response)\n\n    // The type getter steps are to return this’s response’s type.\n    return this[kState].type\n  }\n\n  // Returns response’s URL, if it has one; otherwise the empty string.\n  get url () {\n    webidl.brandCheck(this, Response)\n\n    const urlList = this[kState].urlList\n\n    // The url getter steps are to return the empty string if this’s\n    // response’s URL is null; otherwise this’s response’s URL,\n    // serialized with exclude fragment set to true.\n    const url = urlList[urlList.length - 1] ?? null\n\n    if (url === null) {\n      return ''\n    }\n\n    return URLSerializer(url, true)\n  }\n\n  // Returns whether response was obtained through a redirect.\n  get redirected () {\n    webidl.brandCheck(this, Response)\n\n    // The redirected getter steps are to return true if this’s response’s URL\n    // list has more than one item; otherwise false.\n    return this[kState].urlList.length > 1\n  }\n\n  // Returns response’s status.\n  get status () {\n    webidl.brandCheck(this, Response)\n\n    // The status getter steps are to return this’s response’s status.\n    return this[kState].status\n  }\n\n  // Returns whether response’s status is an ok status.\n  get ok () {\n    webidl.brandCheck(this, Response)\n\n    // The ok getter steps are to return true if this’s response’s status is an\n    // ok status; otherwise false.\n    return this[kState].status >= 200 && this[kState].status <= 299\n  }\n\n  // Returns response’s status message.\n  get statusText () {\n    webidl.brandCheck(this, Response)\n\n    // The statusText getter steps are to return this’s response’s status\n    // message.\n    return this[kState].statusText\n  }\n\n  // Returns response’s headers as Headers.\n  get headers () {\n    webidl.brandCheck(this, Response)\n\n    // The headers getter steps are to return this’s headers.\n    return this[kHeaders]\n  }\n\n  get body () {\n    webidl.brandCheck(this, Response)\n\n    return this[kState].body ? this[kState].body.stream : null\n  }\n\n  get bodyUsed () {\n    webidl.brandCheck(this, Response)\n\n    return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n  }\n\n  // Returns a clone of response.\n  clone () {\n    webidl.brandCheck(this, Response)\n\n    // 1. If this is unusable, then throw a TypeError.\n    if (bodyUnusable(this)) {\n      throw webidl.errors.exception({\n        header: 'Response.clone',\n        message: 'Body has already been consumed.'\n      })\n    }\n\n    // 2. Let clonedResponse be the result of cloning this’s response.\n    const clonedResponse = cloneResponse(this[kState])\n\n    // Note: To re-register because of a new stream.\n    if (hasFinalizationRegistry && this[kState].body?.stream) {\n      streamRegistry.register(this, new WeakRef(this[kState].body.stream))\n    }\n\n    // 3. Return the result of creating a Response object, given\n    // clonedResponse, this’s headers’s guard, and this’s relevant Realm.\n    return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders]))\n  }\n\n  [nodeUtil.inspect.custom] (depth, options) {\n    if (options.depth === null) {\n      options.depth = 2\n    }\n\n    options.colors ??= true\n\n    const properties = {\n      status: this.status,\n      statusText: this.statusText,\n      headers: this.headers,\n      body: this.body,\n      bodyUsed: this.bodyUsed,\n      ok: this.ok,\n      redirected: this.redirected,\n      type: this.type,\n      url: this.url\n    }\n\n    return `Response ${nodeUtil.formatWithOptions(options, properties)}`\n  }\n}\n\nmixinBody(Response)\n\nObject.defineProperties(Response.prototype, {\n  type: kEnumerableProperty,\n  url: kEnumerableProperty,\n  status: kEnumerableProperty,\n  ok: kEnumerableProperty,\n  redirected: kEnumerableProperty,\n  statusText: kEnumerableProperty,\n  headers: kEnumerableProperty,\n  clone: kEnumerableProperty,\n  body: kEnumerableProperty,\n  bodyUsed: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'Response',\n    configurable: true\n  }\n})\n\nObject.defineProperties(Response, {\n  json: kEnumerableProperty,\n  redirect: kEnumerableProperty,\n  error: kEnumerableProperty\n})\n\n// https://fetch.spec.whatwg.org/#concept-response-clone\nfunction cloneResponse (response) {\n  // To clone a response response, run these steps:\n\n  // 1. If response is a filtered response, then return a new identical\n  // filtered response whose internal response is a clone of response’s\n  // internal response.\n  if (response.internalResponse) {\n    return filterResponse(\n      cloneResponse(response.internalResponse),\n      response.type\n    )\n  }\n\n  // 2. Let newResponse be a copy of response, except for its body.\n  const newResponse = makeResponse({ ...response, body: null })\n\n  // 3. If response’s body is non-null, then set newResponse’s body to the\n  // result of cloning response’s body.\n  if (response.body != null) {\n    newResponse.body = cloneBody(newResponse, response.body)\n  }\n\n  // 4. Return newResponse.\n  return newResponse\n}\n\nfunction makeResponse (init) {\n  return {\n    aborted: false,\n    rangeRequested: false,\n    timingAllowPassed: false,\n    requestIncludesCredentials: false,\n    type: 'default',\n    status: 200,\n    timingInfo: null,\n    cacheState: '',\n    statusText: '',\n    ...init,\n    headersList: init?.headersList\n      ? new HeadersList(init?.headersList)\n      : new HeadersList(),\n    urlList: init?.urlList ? [...init.urlList] : []\n  }\n}\n\nfunction makeNetworkError (reason) {\n  const isError = isErrorLike(reason)\n  return makeResponse({\n    type: 'error',\n    status: 0,\n    error: isError\n      ? reason\n      : new Error(reason ? String(reason) : reason),\n    aborted: reason && reason.name === 'AbortError'\n  })\n}\n\n// @see https://fetch.spec.whatwg.org/#concept-network-error\nfunction isNetworkError (response) {\n  return (\n    // A network error is a response whose type is \"error\",\n    response.type === 'error' &&\n    // status is 0\n    response.status === 0\n  )\n}\n\nfunction makeFilteredResponse (response, state) {\n  state = {\n    internalResponse: response,\n    ...state\n  }\n\n  return new Proxy(response, {\n    get (target, p) {\n      return p in state ? state[p] : target[p]\n    },\n    set (target, p, value) {\n      assert(!(p in state))\n      target[p] = value\n      return true\n    }\n  })\n}\n\n// https://fetch.spec.whatwg.org/#concept-filtered-response\nfunction filterResponse (response, type) {\n  // Set response to the following filtered response with response as its\n  // internal response, depending on request’s response tainting:\n  if (type === 'basic') {\n    // A basic filtered response is a filtered response whose type is \"basic\"\n    // and header list excludes any headers in internal response’s header list\n    // whose name is a forbidden response-header name.\n\n    // Note: undici does not implement forbidden response-header names\n    return makeFilteredResponse(response, {\n      type: 'basic',\n      headersList: response.headersList\n    })\n  } else if (type === 'cors') {\n    // A CORS filtered response is a filtered response whose type is \"cors\"\n    // and header list excludes any headers in internal response’s header\n    // list whose name is not a CORS-safelisted response-header name, given\n    // internal response’s CORS-exposed header-name list.\n\n    // Note: undici does not implement CORS-safelisted response-header names\n    return makeFilteredResponse(response, {\n      type: 'cors',\n      headersList: response.headersList\n    })\n  } else if (type === 'opaque') {\n    // An opaque filtered response is a filtered response whose type is\n    // \"opaque\", URL list is the empty list, status is 0, status message\n    // is the empty byte sequence, header list is empty, and body is null.\n\n    return makeFilteredResponse(response, {\n      type: 'opaque',\n      urlList: Object.freeze([]),\n      status: 0,\n      statusText: '',\n      body: null\n    })\n  } else if (type === 'opaqueredirect') {\n    // An opaque-redirect filtered response is a filtered response whose type\n    // is \"opaqueredirect\", status is 0, status message is the empty byte\n    // sequence, header list is empty, and body is null.\n\n    return makeFilteredResponse(response, {\n      type: 'opaqueredirect',\n      status: 0,\n      statusText: '',\n      headersList: [],\n      body: null\n    })\n  } else {\n    assert(false)\n  }\n}\n\n// https://fetch.spec.whatwg.org/#appropriate-network-error\nfunction makeAppropriateNetworkError (fetchParams, err = null) {\n  // 1. Assert: fetchParams is canceled.\n  assert(isCancelled(fetchParams))\n\n  // 2. Return an aborted network error if fetchParams is aborted;\n  // otherwise return a network error.\n  return isAborted(fetchParams)\n    ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))\n    : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))\n}\n\n// https://whatpr.org/fetch/1392.html#initialize-a-response\nfunction initializeResponse (response, init, body) {\n  // 1. If init[\"status\"] is not in the range 200 to 599, inclusive, then\n  //    throw a RangeError.\n  if (init.status !== null && (init.status < 200 || init.status > 599)) {\n    throw new RangeError('init[\"status\"] must be in the range of 200 to 599, inclusive.')\n  }\n\n  // 2. If init[\"statusText\"] does not match the reason-phrase token production,\n  //    then throw a TypeError.\n  if ('statusText' in init && init.statusText != null) {\n    // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:\n    //   reason-phrase  = *( HTAB / SP / VCHAR / obs-text )\n    if (!isValidReasonPhrase(String(init.statusText))) {\n      throw new TypeError('Invalid statusText')\n    }\n  }\n\n  // 3. Set response’s response’s status to init[\"status\"].\n  if ('status' in init && init.status != null) {\n    response[kState].status = init.status\n  }\n\n  // 4. Set response’s response’s status message to init[\"statusText\"].\n  if ('statusText' in init && init.statusText != null) {\n    response[kState].statusText = init.statusText\n  }\n\n  // 5. If init[\"headers\"] exists, then fill response’s headers with init[\"headers\"].\n  if ('headers' in init && init.headers != null) {\n    fill(response[kHeaders], init.headers)\n  }\n\n  // 6. If body was given, then:\n  if (body) {\n    // 1. If response's status is a null body status, then throw a TypeError.\n    if (nullBodyStatus.includes(response.status)) {\n      throw webidl.errors.exception({\n        header: 'Response constructor',\n        message: `Invalid response status code ${response.status}`\n      })\n    }\n\n    // 2. Set response's body to body's body.\n    response[kState].body = body.body\n\n    // 3. If body's type is non-null and response's header list does not contain\n    //    `Content-Type`, then append (`Content-Type`, body's type) to response's header list.\n    if (body.type != null && !response[kState].headersList.contains('content-type', true)) {\n      response[kState].headersList.append('content-type', body.type, true)\n    }\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#response-create\n * @param {any} innerResponse\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Response}\n */\nfunction fromInnerResponse (innerResponse, guard) {\n  const response = new Response(kConstruct)\n  response[kState] = innerResponse\n  response[kHeaders] = new Headers(kConstruct)\n  setHeadersList(response[kHeaders], innerResponse.headersList)\n  setHeadersGuard(response[kHeaders], guard)\n\n  if (hasFinalizationRegistry && innerResponse.body?.stream) {\n    // If the target (response) is reclaimed, the cleanup callback may be called at some point with\n    // the held value provided for it (innerResponse.body.stream). The held value can be any value:\n    // a primitive or an object, even undefined. If the held value is an object, the registry keeps\n    // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n    streamRegistry.register(response, new WeakRef(innerResponse.body.stream))\n  }\n\n  return response\n}\n\nwebidl.converters.ReadableStream = webidl.interfaceConverter(\n  ReadableStream\n)\n\nwebidl.converters.FormData = webidl.interfaceConverter(\n  FormData\n)\n\nwebidl.converters.URLSearchParams = webidl.interfaceConverter(\n  URLSearchParams\n)\n\n// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit\nwebidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) {\n  if (typeof V === 'string') {\n    return webidl.converters.USVString(V, prefix, name)\n  }\n\n  if (isBlobLike(V)) {\n    return webidl.converters.Blob(V, prefix, name, { strict: false })\n  }\n\n  if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n    return webidl.converters.BufferSource(V, prefix, name)\n  }\n\n  if (util.isFormDataLike(V)) {\n    return webidl.converters.FormData(V, prefix, name, { strict: false })\n  }\n\n  if (V instanceof URLSearchParams) {\n    return webidl.converters.URLSearchParams(V, prefix, name)\n  }\n\n  return webidl.converters.DOMString(V, prefix, name)\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit\nwebidl.converters.BodyInit = function (V, prefix, argument) {\n  if (V instanceof ReadableStream) {\n    return webidl.converters.ReadableStream(V, prefix, argument)\n  }\n\n  // Note: the spec doesn't include async iterables,\n  // this is an undici extension.\n  if (V?.[Symbol.asyncIterator]) {\n    return V\n  }\n\n  return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument)\n}\n\nwebidl.converters.ResponseInit = webidl.dictionaryConverter([\n  {\n    key: 'status',\n    converter: webidl.converters['unsigned short'],\n    defaultValue: () => 200\n  },\n  {\n    key: 'statusText',\n    converter: webidl.converters.ByteString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'headers',\n    converter: webidl.converters.HeadersInit\n  }\n])\n\nmodule.exports = {\n  isNetworkError,\n  makeNetworkError,\n  makeResponse,\n  makeAppropriateNetworkError,\n  filterResponse,\n  Response,\n  cloneResponse,\n  fromInnerResponse\n}\n","'use strict'\n\nmodule.exports = {\n  kUrl: Symbol('url'),\n  kHeaders: Symbol('headers'),\n  kSignal: Symbol('signal'),\n  kState: Symbol('state'),\n  kDispatcher: Symbol('dispatcher')\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst zlib = require('node:zlib')\nconst { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants')\nconst { getGlobalOrigin } = require('./global')\nconst { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require('./data-url')\nconst { performance } = require('node:perf_hooks')\nconst { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require('../../core/util')\nconst assert = require('node:assert')\nconst { isUint8Array } = require('node:util/types')\nconst { webidl } = require('./webidl')\n\nlet supportedHashes = []\n\n// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable\n/** @type {import('crypto')} */\nlet crypto\ntry {\n  crypto = require('node:crypto')\n  const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']\n  supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))\n/* c8 ignore next 3 */\n} catch {\n\n}\n\nfunction responseURL (response) {\n  // https://fetch.spec.whatwg.org/#responses\n  // A response has an associated URL. It is a pointer to the last URL\n  // in response’s URL list and null if response’s URL list is empty.\n  const urlList = response.urlList\n  const length = urlList.length\n  return length === 0 ? null : urlList[length - 1].toString()\n}\n\n// https://fetch.spec.whatwg.org/#concept-response-location-url\nfunction responseLocationURL (response, requestFragment) {\n  // 1. If response’s status is not a redirect status, then return null.\n  if (!redirectStatusSet.has(response.status)) {\n    return null\n  }\n\n  // 2. Let location be the result of extracting header list values given\n  // `Location` and response’s header list.\n  let location = response.headersList.get('location', true)\n\n  // 3. If location is a header value, then set location to the result of\n  //    parsing location with response’s URL.\n  if (location !== null && isValidHeaderValue(location)) {\n    if (!isValidEncodedURL(location)) {\n      // Some websites respond location header in UTF-8 form without encoding them as ASCII\n      // and major browsers redirect them to correctly UTF-8 encoded addresses.\n      // Here, we handle that behavior in the same way.\n      location = normalizeBinaryStringToUtf8(location)\n    }\n    location = new URL(location, responseURL(response))\n  }\n\n  // 4. If location is a URL whose fragment is null, then set location’s\n  // fragment to requestFragment.\n  if (location && !location.hash) {\n    location.hash = requestFragment\n  }\n\n  // 5. Return location.\n  return location\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2\n * @param {string} url\n * @returns {boolean}\n */\nfunction isValidEncodedURL (url) {\n  for (let i = 0; i < url.length; ++i) {\n    const code = url.charCodeAt(i)\n\n    if (\n      code > 0x7E || // Non-US-ASCII + DEL\n      code < 0x20 // Control characters NUL - US\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it.\n * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well.\n * @param {string} value\n * @returns {string}\n */\nfunction normalizeBinaryStringToUtf8 (value) {\n  return Buffer.from(value, 'binary').toString('utf8')\n}\n\n/** @returns {URL} */\nfunction requestCurrentURL (request) {\n  return request.urlList[request.urlList.length - 1]\n}\n\nfunction requestBadPort (request) {\n  // 1. Let url be request’s current URL.\n  const url = requestCurrentURL(request)\n\n  // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,\n  // then return blocked.\n  if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {\n    return 'blocked'\n  }\n\n  // 3. Return allowed.\n  return 'allowed'\n}\n\nfunction isErrorLike (object) {\n  return object instanceof Error || (\n    object?.constructor?.name === 'Error' ||\n    object?.constructor?.name === 'DOMException'\n  )\n}\n\n// Check whether |statusText| is a ByteString and\n// matches the Reason-Phrase token production.\n// RFC 2616: https://tools.ietf.org/html/rfc2616\n// RFC 7230: https://tools.ietf.org/html/rfc7230\n// \"reason-phrase = *( HTAB / SP / VCHAR / obs-text )\"\n// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116\nfunction isValidReasonPhrase (statusText) {\n  for (let i = 0; i < statusText.length; ++i) {\n    const c = statusText.charCodeAt(i)\n    if (\n      !(\n        (\n          c === 0x09 || // HTAB\n          (c >= 0x20 && c <= 0x7e) || // SP / VCHAR\n          (c >= 0x80 && c <= 0xff)\n        ) // obs-text\n      )\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-name\n * @param {string} potentialValue\n */\nconst isValidHeaderName = isValidHTTPToken\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value\n * @param {string} potentialValue\n */\nfunction isValidHeaderValue (potentialValue) {\n  // - Has no leading or trailing HTTP tab or space bytes.\n  // - Contains no 0x00 (NUL) or HTTP newline bytes.\n  return (\n    potentialValue[0] === '\\t' ||\n    potentialValue[0] === ' ' ||\n    potentialValue[potentialValue.length - 1] === '\\t' ||\n    potentialValue[potentialValue.length - 1] === ' ' ||\n    potentialValue.includes('\\n') ||\n    potentialValue.includes('\\r') ||\n    potentialValue.includes('\\0')\n  ) === false\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect\nfunction setRequestReferrerPolicyOnRedirect (request, actualResponse) {\n  //  Given a request request and a response actualResponse, this algorithm\n  //  updates request’s referrer policy according to the Referrer-Policy\n  //  header (if any) in actualResponse.\n\n  // 1. Let policy be the result of executing § 8.1 Parse a referrer policy\n  // from a Referrer-Policy header on actualResponse.\n\n  // 8.1 Parse a referrer policy from a Referrer-Policy header\n  // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.\n  const { headersList } = actualResponse\n  // 2. Let policy be the empty string.\n  // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.\n  // 4. Return policy.\n  const policyHeader = (headersList.get('referrer-policy', true) ?? '').split(',')\n\n  // Note: As the referrer-policy can contain multiple policies\n  // separated by comma, we need to loop through all of them\n  // and pick the first valid one.\n  // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy\n  let policy = ''\n  if (policyHeader.length > 0) {\n    // The right-most policy takes precedence.\n    // The left-most policy is the fallback.\n    for (let i = policyHeader.length; i !== 0; i--) {\n      const token = policyHeader[i - 1].trim()\n      if (referrerPolicyTokens.has(token)) {\n        policy = token\n        break\n      }\n    }\n  }\n\n  // 2. If policy is not the empty string, then set request’s referrer policy to policy.\n  if (policy !== '') {\n    request.referrerPolicy = policy\n  }\n}\n\n// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check\nfunction crossOriginResourcePolicyCheck () {\n  // TODO\n  return 'allowed'\n}\n\n// https://fetch.spec.whatwg.org/#concept-cors-check\nfunction corsCheck () {\n  // TODO\n  return 'success'\n}\n\n// https://fetch.spec.whatwg.org/#concept-tao-check\nfunction TAOCheck () {\n  // TODO\n  return 'success'\n}\n\nfunction appendFetchMetadata (httpRequest) {\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header\n  //  TODO\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header\n\n  //  1. Assert: r’s url is a potentially trustworthy URL.\n  //  TODO\n\n  //  2. Let header be a Structured Header whose value is a token.\n  let header = null\n\n  //  3. Set header’s value to r’s mode.\n  header = httpRequest.mode\n\n  //  4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.\n  httpRequest.headersList.set('sec-fetch-mode', header, true)\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header\n  //  TODO\n\n  //  https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header\n  //  TODO\n}\n\n// https://fetch.spec.whatwg.org/#append-a-request-origin-header\nfunction appendRequestOriginHeader (request) {\n  // 1. Let serializedOrigin be the result of byte-serializing a request origin\n  //    with request.\n  // TODO: implement \"byte-serializing a request origin\"\n  let serializedOrigin = request.origin\n\n  // - \"'client' is changed to an origin during fetching.\"\n  //   This doesn't happen in undici (in most cases) because undici, by default,\n  //   has no concept of origin.\n  // - request.origin can also be set to request.client.origin (client being\n  //   an environment settings object), which is undefined without using\n  //   setGlobalOrigin.\n  if (serializedOrigin === 'client' || serializedOrigin === undefined) {\n    return\n  }\n\n  // 2. If request’s response tainting is \"cors\" or request’s mode is \"websocket\",\n  //    then append (`Origin`, serializedOrigin) to request’s header list.\n  // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:\n  if (request.responseTainting === 'cors' || request.mode === 'websocket') {\n    request.headersList.append('origin', serializedOrigin, true)\n  } else if (request.method !== 'GET' && request.method !== 'HEAD') {\n    // 1. Switch on request’s referrer policy:\n    switch (request.referrerPolicy) {\n      case 'no-referrer':\n        // Set serializedOrigin to `null`.\n        serializedOrigin = null\n        break\n      case 'no-referrer-when-downgrade':\n      case 'strict-origin':\n      case 'strict-origin-when-cross-origin':\n        // If request’s origin is a tuple origin, its scheme is \"https\", and\n        // request’s current URL’s scheme is not \"https\", then set\n        // serializedOrigin to `null`.\n        if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n          serializedOrigin = null\n        }\n        break\n      case 'same-origin':\n        // If request’s origin is not same origin with request’s current URL’s\n        // origin, then set serializedOrigin to `null`.\n        if (!sameOrigin(request, requestCurrentURL(request))) {\n          serializedOrigin = null\n        }\n        break\n      default:\n        // Do nothing.\n    }\n\n    // 2. Append (`Origin`, serializedOrigin) to request’s header list.\n    request.headersList.append('origin', serializedOrigin, true)\n  }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsen-time\nfunction coarsenTime (timestamp, crossOriginIsolatedCapability) {\n  // TODO\n  return timestamp\n}\n\n// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info\nfunction clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {\n  if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {\n    return {\n      domainLookupStartTime: defaultStartTime,\n      domainLookupEndTime: defaultStartTime,\n      connectionStartTime: defaultStartTime,\n      connectionEndTime: defaultStartTime,\n      secureConnectionStartTime: defaultStartTime,\n      ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol\n    }\n  }\n\n  return {\n    domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),\n    domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),\n    connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),\n    connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),\n    secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),\n    ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol\n  }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time\nfunction coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {\n  return coarsenTime(performance.now(), crossOriginIsolatedCapability)\n}\n\n// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info\nfunction createOpaqueTimingInfo (timingInfo) {\n  return {\n    startTime: timingInfo.startTime ?? 0,\n    redirectStartTime: 0,\n    redirectEndTime: 0,\n    postRedirectStartTime: timingInfo.startTime ?? 0,\n    finalServiceWorkerStartTime: 0,\n    finalNetworkResponseStartTime: 0,\n    finalNetworkRequestStartTime: 0,\n    endTime: 0,\n    encodedBodySize: 0,\n    decodedBodySize: 0,\n    finalConnectionTimingInfo: null\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#policy-container\nfunction makePolicyContainer () {\n  // Note: the fetch spec doesn't make use of embedder policy or CSP list\n  return {\n    referrerPolicy: 'strict-origin-when-cross-origin'\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container\nfunction clonePolicyContainer (policyContainer) {\n  return {\n    referrerPolicy: policyContainer.referrerPolicy\n  }\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer\nfunction determineRequestsReferrer (request) {\n  // 1. Let policy be request's referrer policy.\n  const policy = request.referrerPolicy\n\n  // Note: policy cannot (shouldn't) be null or an empty string.\n  assert(policy)\n\n  // 2. Let environment be request’s client.\n\n  let referrerSource = null\n\n  // 3. Switch on request’s referrer:\n  if (request.referrer === 'client') {\n    // Note: node isn't a browser and doesn't implement document/iframes,\n    // so we bypass this step and replace it with our own.\n\n    const globalOrigin = getGlobalOrigin()\n\n    if (!globalOrigin || globalOrigin.origin === 'null') {\n      return 'no-referrer'\n    }\n\n    // note: we need to clone it as it's mutated\n    referrerSource = new URL(globalOrigin)\n  } else if (request.referrer instanceof URL) {\n    // Let referrerSource be request’s referrer.\n    referrerSource = request.referrer\n  }\n\n  // 4. Let request’s referrerURL be the result of stripping referrerSource for\n  //    use as a referrer.\n  let referrerURL = stripURLForReferrer(referrerSource)\n\n  // 5. Let referrerOrigin be the result of stripping referrerSource for use as\n  //    a referrer, with the origin-only flag set to true.\n  const referrerOrigin = stripURLForReferrer(referrerSource, true)\n\n  // 6. If the result of serializing referrerURL is a string whose length is\n  //    greater than 4096, set referrerURL to referrerOrigin.\n  if (referrerURL.toString().length > 4096) {\n    referrerURL = referrerOrigin\n  }\n\n  const areSameOrigin = sameOrigin(request, referrerURL)\n  const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&\n    !isURLPotentiallyTrustworthy(request.url)\n\n  // 8. Execute the switch statements corresponding to the value of policy:\n  switch (policy) {\n    case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)\n    case 'unsafe-url': return referrerURL\n    case 'same-origin':\n      return areSameOrigin ? referrerOrigin : 'no-referrer'\n    case 'origin-when-cross-origin':\n      return areSameOrigin ? referrerURL : referrerOrigin\n    case 'strict-origin-when-cross-origin': {\n      const currentURL = requestCurrentURL(request)\n\n      // 1. If the origin of referrerURL and the origin of request’s current\n      //    URL are the same, then return referrerURL.\n      if (sameOrigin(referrerURL, currentURL)) {\n        return referrerURL\n      }\n\n      // 2. If referrerURL is a potentially trustworthy URL and request’s\n      //    current URL is not a potentially trustworthy URL, then return no\n      //    referrer.\n      if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n        return 'no-referrer'\n      }\n\n      // 3. Return referrerOrigin.\n      return referrerOrigin\n    }\n    case 'strict-origin': // eslint-disable-line\n      /**\n         * 1. If referrerURL is a potentially trustworthy URL and\n         * request’s current URL is not a potentially trustworthy URL,\n         * then return no referrer.\n         * 2. Return referrerOrigin\n        */\n    case 'no-referrer-when-downgrade': // eslint-disable-line\n      /**\n       * 1. If referrerURL is a potentially trustworthy URL and\n       * request’s current URL is not a potentially trustworthy URL,\n       * then return no referrer.\n       * 2. Return referrerOrigin\n      */\n\n    default: // eslint-disable-line\n      return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin\n  }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url\n * @param {URL} url\n * @param {boolean|undefined} originOnly\n */\nfunction stripURLForReferrer (url, originOnly) {\n  // 1. Assert: url is a URL.\n  assert(url instanceof URL)\n\n  url = new URL(url)\n\n  // 2. If url’s scheme is a local scheme, then return no referrer.\n  if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {\n    return 'no-referrer'\n  }\n\n  // 3. Set url’s username to the empty string.\n  url.username = ''\n\n  // 4. Set url’s password to the empty string.\n  url.password = ''\n\n  // 5. Set url’s fragment to null.\n  url.hash = ''\n\n  // 6. If the origin-only flag is true, then:\n  if (originOnly) {\n    // 1. Set url’s path to « the empty string ».\n    url.pathname = ''\n\n    // 2. Set url’s query to null.\n    url.search = ''\n  }\n\n  // 7. Return url.\n  return url\n}\n\nfunction isURLPotentiallyTrustworthy (url) {\n  if (!(url instanceof URL)) {\n    return false\n  }\n\n  // If child of about, return true\n  if (url.href === 'about:blank' || url.href === 'about:srcdoc') {\n    return true\n  }\n\n  // If scheme is data, return true\n  if (url.protocol === 'data:') return true\n\n  // If file, return true\n  if (url.protocol === 'file:') return true\n\n  return isOriginPotentiallyTrustworthy(url.origin)\n\n  function isOriginPotentiallyTrustworthy (origin) {\n    // If origin is explicitly null, return false\n    if (origin == null || origin === 'null') return false\n\n    const originAsURL = new URL(origin)\n\n    // If secure, return true\n    if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {\n      return true\n    }\n\n    // If localhost or variants, return true\n    if (/^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^\\[(?:0*:)*?:?0*1\\]$/.test(originAsURL.hostname) ||\n     (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||\n     (originAsURL.hostname.endsWith('.localhost'))) {\n      return true\n    }\n\n    // If any other, return false\n    return false\n  }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist\n * @param {Uint8Array} bytes\n * @param {string} metadataList\n */\nfunction bytesMatch (bytes, metadataList) {\n  // If node is not built with OpenSSL support, we cannot check\n  // a request's integrity, so allow it by default (the spec will\n  // allow requests if an invalid hash is given, as precedence).\n  /* istanbul ignore if: only if node is built with --without-ssl */\n  if (crypto === undefined) {\n    return true\n  }\n\n  // 1. Let parsedMetadata be the result of parsing metadataList.\n  const parsedMetadata = parseMetadata(metadataList)\n\n  // 2. If parsedMetadata is no metadata, return true.\n  if (parsedMetadata === 'no metadata') {\n    return true\n  }\n\n  // 3. If response is not eligible for integrity validation, return false.\n  // TODO\n\n  // 4. If parsedMetadata is the empty set, return true.\n  if (parsedMetadata.length === 0) {\n    return true\n  }\n\n  // 5. Let metadata be the result of getting the strongest\n  //    metadata from parsedMetadata.\n  const strongest = getStrongestMetadata(parsedMetadata)\n  const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)\n\n  // 6. For each item in metadata:\n  for (const item of metadata) {\n    // 1. Let algorithm be the alg component of item.\n    const algorithm = item.algo\n\n    // 2. Let expectedValue be the val component of item.\n    const expectedValue = item.hash\n\n    // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e\n    // \"be liberal with padding\". This is annoying, and it's not even in the spec.\n\n    // 3. Let actualValue be the result of applying algorithm to bytes.\n    let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')\n\n    if (actualValue[actualValue.length - 1] === '=') {\n      if (actualValue[actualValue.length - 2] === '=') {\n        actualValue = actualValue.slice(0, -2)\n      } else {\n        actualValue = actualValue.slice(0, -1)\n      }\n    }\n\n    // 4. If actualValue is a case-sensitive match for expectedValue,\n    //    return true.\n    if (compareBase64Mixed(actualValue, expectedValue)) {\n      return true\n    }\n  }\n\n  // 7. Return false.\n  return false\n}\n\n// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options\n// https://www.w3.org/TR/CSP2/#source-list-syntax\n// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1\nconst parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\\s|$)( +[!-~]*)?)?/i\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata\n * @param {string} metadata\n */\nfunction parseMetadata (metadata) {\n  // 1. Let result be the empty set.\n  /** @type {{ algo: string, hash: string }[]} */\n  const result = []\n\n  // 2. Let empty be equal to true.\n  let empty = true\n\n  // 3. For each token returned by splitting metadata on spaces:\n  for (const token of metadata.split(' ')) {\n    // 1. Set empty to false.\n    empty = false\n\n    // 2. Parse token as a hash-with-options.\n    const parsedToken = parseHashWithOptions.exec(token)\n\n    // 3. If token does not parse, continue to the next token.\n    if (\n      parsedToken === null ||\n      parsedToken.groups === undefined ||\n      parsedToken.groups.algo === undefined\n    ) {\n      // Note: Chromium blocks the request at this point, but Firefox\n      // gives a warning that an invalid integrity was given. The\n      // correct behavior is to ignore these, and subsequently not\n      // check the integrity of the resource.\n      continue\n    }\n\n    // 4. Let algorithm be the hash-algo component of token.\n    const algorithm = parsedToken.groups.algo.toLowerCase()\n\n    // 5. If algorithm is a hash function recognized by the user\n    //    agent, add the parsed token to result.\n    if (supportedHashes.includes(algorithm)) {\n      result.push(parsedToken.groups)\n    }\n  }\n\n  // 4. Return no metadata if empty is true, otherwise return result.\n  if (empty === true) {\n    return 'no metadata'\n  }\n\n  return result\n}\n\n/**\n * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList\n */\nfunction getStrongestMetadata (metadataList) {\n  // Let algorithm be the algo component of the first item in metadataList.\n  // Can be sha256\n  let algorithm = metadataList[0].algo\n  // If the algorithm is sha512, then it is the strongest\n  // and we can return immediately\n  if (algorithm[3] === '5') {\n    return algorithm\n  }\n\n  for (let i = 1; i < metadataList.length; ++i) {\n    const metadata = metadataList[i]\n    // If the algorithm is sha512, then it is the strongest\n    // and we can break the loop immediately\n    if (metadata.algo[3] === '5') {\n      algorithm = 'sha512'\n      break\n    // If the algorithm is sha384, then a potential sha256 or sha384 is ignored\n    } else if (algorithm[3] === '3') {\n      continue\n    // algorithm is sha256, check if algorithm is sha384 and if so, set it as\n    // the strongest\n    } else if (metadata.algo[3] === '3') {\n      algorithm = 'sha384'\n    }\n  }\n  return algorithm\n}\n\nfunction filterMetadataListByAlgorithm (metadataList, algorithm) {\n  if (metadataList.length === 1) {\n    return metadataList\n  }\n\n  let pos = 0\n  for (let i = 0; i < metadataList.length; ++i) {\n    if (metadataList[i].algo === algorithm) {\n      metadataList[pos++] = metadataList[i]\n    }\n  }\n\n  metadataList.length = pos\n\n  return metadataList\n}\n\n/**\n * Compares two base64 strings, allowing for base64url\n * in the second string.\n *\n* @param {string} actualValue always base64\n * @param {string} expectedValue base64 or base64url\n * @returns {boolean}\n */\nfunction compareBase64Mixed (actualValue, expectedValue) {\n  if (actualValue.length !== expectedValue.length) {\n    return false\n  }\n  for (let i = 0; i < actualValue.length; ++i) {\n    if (actualValue[i] !== expectedValue[i]) {\n      if (\n        (actualValue[i] === '+' && expectedValue[i] === '-') ||\n        (actualValue[i] === '/' && expectedValue[i] === '_')\n      ) {\n        continue\n      }\n      return false\n    }\n  }\n\n  return true\n}\n\n// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request\nfunction tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {\n  // TODO\n}\n\n/**\n * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}\n * @param {URL} A\n * @param {URL} B\n */\nfunction sameOrigin (A, B) {\n  // 1. If A and B are the same opaque origin, then return true.\n  if (A.origin === B.origin && A.origin === 'null') {\n    return true\n  }\n\n  // 2. If A and B are both tuple origins and their schemes,\n  //    hosts, and port are identical, then return true.\n  if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n    return true\n  }\n\n  // 3. Return false.\n  return false\n}\n\nfunction createDeferredPromise () {\n  let res\n  let rej\n  const promise = new Promise((resolve, reject) => {\n    res = resolve\n    rej = reject\n  })\n\n  return { promise, resolve: res, reject: rej }\n}\n\nfunction isAborted (fetchParams) {\n  return fetchParams.controller.state === 'aborted'\n}\n\nfunction isCancelled (fetchParams) {\n  return fetchParams.controller.state === 'aborted' ||\n    fetchParams.controller.state === 'terminated'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-method-normalize\n * @param {string} method\n */\nfunction normalizeMethod (method) {\n  return normalizedMethodRecordsBase[method.toLowerCase()] ?? method\n}\n\n// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string\nfunction serializeJavascriptValueToJSONString (value) {\n  // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).\n  const result = JSON.stringify(value)\n\n  // 2. If result is undefined, then throw a TypeError.\n  if (result === undefined) {\n    throw new TypeError('Value is not JSON serializable')\n  }\n\n  // 3. Assert: result is a string.\n  assert(typeof result === 'string')\n\n  // 4. Return result.\n  return result\n}\n\n// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object\nconst esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n  class FastIterableIterator {\n    /** @type {any} */\n    #target\n    /** @type {'key' | 'value' | 'key+value'} */\n    #kind\n    /** @type {number} */\n    #index\n\n    /**\n     * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object\n     * @param {unknown} target\n     * @param {'key' | 'value' | 'key+value'} kind\n     */\n    constructor (target, kind) {\n      this.#target = target\n      this.#kind = kind\n      this.#index = 0\n    }\n\n    next () {\n      // 1. Let interface be the interface for which the iterator prototype object exists.\n      // 2. Let thisValue be the this value.\n      // 3. Let object be ? ToObject(thisValue).\n      // 4. If object is a platform object, then perform a security\n      //    check, passing:\n      // 5. If object is not a default iterator object for interface,\n      //    then throw a TypeError.\n      if (typeof this !== 'object' || this === null || !(#target in this)) {\n        throw new TypeError(\n          `'next' called on an object that does not implement interface ${name} Iterator.`\n        )\n      }\n\n      // 6. Let index be object’s index.\n      // 7. Let kind be object’s kind.\n      // 8. Let values be object’s target's value pairs to iterate over.\n      const index = this.#index\n      const values = this.#target[kInternalIterator]\n\n      // 9. Let len be the length of values.\n      const len = values.length\n\n      // 10. If index is greater than or equal to len, then return\n      //     CreateIterResultObject(undefined, true).\n      if (index >= len) {\n        return {\n          value: undefined,\n          done: true\n        }\n      }\n\n      // 11. Let pair be the entry in values at index index.\n      const { [keyIndex]: key, [valueIndex]: value } = values[index]\n\n      // 12. Set object’s index to index + 1.\n      this.#index = index + 1\n\n      // 13. Return the iterator result for pair and kind.\n\n      // https://webidl.spec.whatwg.org/#iterator-result\n\n      // 1. Let result be a value determined by the value of kind:\n      let result\n      switch (this.#kind) {\n        case 'key':\n          // 1. Let idlKey be pair’s key.\n          // 2. Let key be the result of converting idlKey to an\n          //    ECMAScript value.\n          // 3. result is key.\n          result = key\n          break\n        case 'value':\n          // 1. Let idlValue be pair’s value.\n          // 2. Let value be the result of converting idlValue to\n          //    an ECMAScript value.\n          // 3. result is value.\n          result = value\n          break\n        case 'key+value':\n          // 1. Let idlKey be pair’s key.\n          // 2. Let idlValue be pair’s value.\n          // 3. Let key be the result of converting idlKey to an\n          //    ECMAScript value.\n          // 4. Let value be the result of converting idlValue to\n          //    an ECMAScript value.\n          // 5. Let array be ! ArrayCreate(2).\n          // 6. Call ! CreateDataProperty(array, \"0\", key).\n          // 7. Call ! CreateDataProperty(array, \"1\", value).\n          // 8. result is array.\n          result = [key, value]\n          break\n      }\n\n      // 2. Return CreateIterResultObject(result, false).\n      return {\n        value: result,\n        done: false\n      }\n    }\n  }\n\n  // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n  // @ts-ignore\n  delete FastIterableIterator.prototype.constructor\n\n  Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype)\n\n  Object.defineProperties(FastIterableIterator.prototype, {\n    [Symbol.toStringTag]: {\n      writable: false,\n      enumerable: false,\n      configurable: true,\n      value: `${name} Iterator`\n    },\n    next: { writable: true, enumerable: true, configurable: true }\n  })\n\n  /**\n   * @param {unknown} target\n   * @param {'key' | 'value' | 'key+value'} kind\n   * @returns {IterableIterator}\n   */\n  return function (target, kind) {\n    return new FastIterableIterator(target, kind)\n  }\n}\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {any} object class\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n  const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex)\n\n  const properties = {\n    keys: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function keys () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'key')\n      }\n    },\n    values: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function values () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'value')\n      }\n    },\n    entries: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function entries () {\n        webidl.brandCheck(this, object)\n        return makeIterator(this, 'key+value')\n      }\n    },\n    forEach: {\n      writable: true,\n      enumerable: true,\n      configurable: true,\n      value: function forEach (callbackfn, thisArg = globalThis) {\n        webidl.brandCheck(this, object)\n        webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`)\n        if (typeof callbackfn !== 'function') {\n          throw new TypeError(\n            `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`\n          )\n        }\n        for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) {\n          callbackfn.call(thisArg, value, key, this)\n        }\n      }\n    }\n  }\n\n  return Object.defineProperties(object.prototype, {\n    ...properties,\n    [Symbol.iterator]: {\n      writable: true,\n      enumerable: false,\n      configurable: true,\n      value: properties.entries.value\n    }\n  })\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-fully-read\n */\nasync function fullyReadBody (body, processBody, processBodyError) {\n  // 1. If taskDestination is null, then set taskDestination to\n  //    the result of starting a new parallel queue.\n\n  // 2. Let successSteps given a byte sequence bytes be to queue a\n  //    fetch task to run processBody given bytes, with taskDestination.\n  const successSteps = processBody\n\n  // 3. Let errorSteps be to queue a fetch task to run processBodyError,\n  //    with taskDestination.\n  const errorSteps = processBodyError\n\n  // 4. Let reader be the result of getting a reader for body’s stream.\n  //    If that threw an exception, then run errorSteps with that\n  //    exception and return.\n  let reader\n\n  try {\n    reader = body.stream.getReader()\n  } catch (e) {\n    errorSteps(e)\n    return\n  }\n\n  // 5. Read all bytes from reader, given successSteps and errorSteps.\n  try {\n    successSteps(await readAllBytes(reader))\n  } catch (e) {\n    errorSteps(e)\n  }\n}\n\nfunction isReadableStreamLike (stream) {\n  return stream instanceof ReadableStream || (\n    stream[Symbol.toStringTag] === 'ReadableStream' &&\n    typeof stream.tee === 'function'\n  )\n}\n\n/**\n * @param {ReadableStreamController} controller\n */\nfunction readableStreamClose (controller) {\n  try {\n    controller.close()\n    controller.byobRequest?.respond(0)\n  } catch (err) {\n    // TODO: add comment explaining why this error occurs.\n    if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {\n      throw err\n    }\n  }\n}\n\nconst invalidIsomorphicEncodeValueRegex = /[^\\x00-\\xFF]/ // eslint-disable-line\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-encode\n * @param {string} input\n */\nfunction isomorphicEncode (input) {\n  // 1. Assert: input contains no code points greater than U+00FF.\n  assert(!invalidIsomorphicEncodeValueRegex.test(input))\n\n  // 2. Return a byte sequence whose length is equal to input’s code\n  //    point length and whose bytes have the same values as the\n  //    values of input’s code points, in the same order\n  return input\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes\n * @see https://streams.spec.whatwg.org/#read-loop\n * @param {ReadableStreamDefaultReader} reader\n */\nasync function readAllBytes (reader) {\n  const bytes = []\n  let byteLength = 0\n\n  while (true) {\n    const { done, value: chunk } = await reader.read()\n\n    if (done) {\n      // 1. Call successSteps with bytes.\n      return Buffer.concat(bytes, byteLength)\n    }\n\n    // 1. If chunk is not a Uint8Array object, call failureSteps\n    //    with a TypeError and abort these steps.\n    if (!isUint8Array(chunk)) {\n      throw new TypeError('Received non-Uint8Array chunk')\n    }\n\n    // 2. Append the bytes represented by chunk to bytes.\n    bytes.push(chunk)\n    byteLength += chunk.length\n\n    // 3. Read-loop given reader, bytes, successSteps, and failureSteps.\n  }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#is-local\n * @param {URL} url\n */\nfunction urlIsLocal (url) {\n  assert('protocol' in url) // ensure it's a url object\n\n  const protocol = url.protocol\n\n  return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'\n}\n\n/**\n * @param {string|URL} url\n * @returns {boolean}\n */\nfunction urlHasHttpsScheme (url) {\n  return (\n    (\n      typeof url === 'string' &&\n      url[5] === ':' &&\n      url[0] === 'h' &&\n      url[1] === 't' &&\n      url[2] === 't' &&\n      url[3] === 'p' &&\n      url[4] === 's'\n    ) ||\n    url.protocol === 'https:'\n  )\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-scheme\n * @param {URL} url\n */\nfunction urlIsHttpHttpsScheme (url) {\n  assert('protocol' in url) // ensure it's a url object\n\n  const protocol = url.protocol\n\n  return protocol === 'http:' || protocol === 'https:'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#simple-range-header-value\n * @param {string} value\n * @param {boolean} allowWhitespace\n */\nfunction simpleRangeHeaderValue (value, allowWhitespace) {\n  // 1. Let data be the isomorphic decoding of value.\n  // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string,\n  // nothing more. We obviously don't need to do that if value is a string already.\n  const data = value\n\n  // 2. If data does not start with \"bytes\", then return failure.\n  if (!data.startsWith('bytes')) {\n    return 'failure'\n  }\n\n  // 3. Let position be a position variable for data, initially pointing at the 5th code point of data.\n  const position = { position: 5 }\n\n  // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n  //    from data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 5. If the code point at position within data is not U+003D (=), then return failure.\n  if (data.charCodeAt(position.position) !== 0x3D) {\n    return 'failure'\n  }\n\n  // 6. Advance position by 1.\n  position.position++\n\n  // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from\n  //    data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits,\n  //    from data given position.\n  const rangeStart = collectASequenceOfCodePoints(\n    (char) => {\n      const code = char.charCodeAt(0)\n\n      return code >= 0x30 && code <= 0x39\n    },\n    data,\n    position\n  )\n\n  // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the\n  //    empty string; otherwise null.\n  const rangeStartValue = rangeStart.length ? Number(rangeStart) : null\n\n  // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n  //     from data given position.\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 11. If the code point at position within data is not U+002D (-), then return failure.\n  if (data.charCodeAt(position.position) !== 0x2D) {\n    return 'failure'\n  }\n\n  // 12. Advance position by 1.\n  position.position++\n\n  // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab\n  //     or space, from data given position.\n  // Note from Khafra: its the same step as in #8 again lol\n  if (allowWhitespace) {\n    collectASequenceOfCodePoints(\n      (char) => char === '\\t' || char === ' ',\n      data,\n      position\n    )\n  }\n\n  // 14. Let rangeEnd be the result of collecting a sequence of code points that are\n  //     ASCII digits, from data given position.\n  // Note from Khafra: you wouldn't guess it, but this is also the same step as #8\n  const rangeEnd = collectASequenceOfCodePoints(\n    (char) => {\n      const code = char.charCodeAt(0)\n\n      return code >= 0x30 && code <= 0x39\n    },\n    data,\n    position\n  )\n\n  // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd\n  //     is not the empty string; otherwise null.\n  // Note from Khafra: THE SAME STEP, AGAIN!!!\n  // Note: why interpret as a decimal if we only collect ascii digits?\n  const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null\n\n  // 16. If position is not past the end of data, then return failure.\n  if (position.position < data.length) {\n    return 'failure'\n  }\n\n  // 17. If rangeEndValue and rangeStartValue are null, then return failure.\n  if (rangeEndValue === null && rangeStartValue === null) {\n    return 'failure'\n  }\n\n  // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is\n  //     greater than rangeEndValue, then return failure.\n  // Note: ... when can they not be numbers?\n  if (rangeStartValue > rangeEndValue) {\n    return 'failure'\n  }\n\n  // 19. Return (rangeStartValue, rangeEndValue).\n  return { rangeStartValue, rangeEndValue }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#build-a-content-range\n * @param {number} rangeStart\n * @param {number} rangeEnd\n * @param {number} fullLength\n */\nfunction buildContentRange (rangeStart, rangeEnd, fullLength) {\n  // 1. Let contentRange be `bytes `.\n  let contentRange = 'bytes '\n\n  // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange.\n  contentRange += isomorphicEncode(`${rangeStart}`)\n\n  // 3. Append 0x2D (-) to contentRange.\n  contentRange += '-'\n\n  // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange.\n  contentRange += isomorphicEncode(`${rangeEnd}`)\n\n  // 5. Append 0x2F (/) to contentRange.\n  contentRange += '/'\n\n  // 6. Append fullLength, serialized and isomorphic encoded to contentRange.\n  contentRange += isomorphicEncode(`${fullLength}`)\n\n  // 7. Return contentRange.\n  return contentRange\n}\n\n// A Stream, which pipes the response to zlib.createInflate() or\n// zlib.createInflateRaw() depending on the first byte of the Buffer.\n// If the lower byte of the first byte is 0x08, then the stream is\n// interpreted as a zlib stream, otherwise it's interpreted as a\n// raw deflate stream.\nclass InflateStream extends Transform {\n  #zlibOptions\n\n  /** @param {zlib.ZlibOptions} [zlibOptions] */\n  constructor (zlibOptions) {\n    super()\n    this.#zlibOptions = zlibOptions\n  }\n\n  _transform (chunk, encoding, callback) {\n    if (!this._inflateStream) {\n      if (chunk.length === 0) {\n        callback()\n        return\n      }\n      this._inflateStream = (chunk[0] & 0x0F) === 0x08\n        ? zlib.createInflate(this.#zlibOptions)\n        : zlib.createInflateRaw(this.#zlibOptions)\n\n      this._inflateStream.on('data', this.push.bind(this))\n      this._inflateStream.on('end', () => this.push(null))\n      this._inflateStream.on('error', (err) => this.destroy(err))\n    }\n\n    this._inflateStream.write(chunk, encoding, callback)\n  }\n\n  _final (callback) {\n    if (this._inflateStream) {\n      this._inflateStream.end()\n      this._inflateStream = null\n    }\n    callback()\n  }\n}\n\n/**\n * @param {zlib.ZlibOptions} [zlibOptions]\n * @returns {InflateStream}\n */\nfunction createInflate (zlibOptions) {\n  return new InflateStream(zlibOptions)\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type\n * @param {import('./headers').HeadersList} headers\n */\nfunction extractMimeType (headers) {\n  // 1. Let charset be null.\n  let charset = null\n\n  // 2. Let essence be null.\n  let essence = null\n\n  // 3. Let mimeType be null.\n  let mimeType = null\n\n  // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers.\n  const values = getDecodeSplit('content-type', headers)\n\n  // 5. If values is null, then return failure.\n  if (values === null) {\n    return 'failure'\n  }\n\n  // 6. For each value of values:\n  for (const value of values) {\n    // 6.1. Let temporaryMimeType be the result of parsing value.\n    const temporaryMimeType = parseMIMEType(value)\n\n    // 6.2. If temporaryMimeType is failure or its essence is \"*/*\", then continue.\n    if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') {\n      continue\n    }\n\n    // 6.3. Set mimeType to temporaryMimeType.\n    mimeType = temporaryMimeType\n\n    // 6.4. If mimeType’s essence is not essence, then:\n    if (mimeType.essence !== essence) {\n      // 6.4.1. Set charset to null.\n      charset = null\n\n      // 6.4.2. If mimeType’s parameters[\"charset\"] exists, then set charset to\n      //        mimeType’s parameters[\"charset\"].\n      if (mimeType.parameters.has('charset')) {\n        charset = mimeType.parameters.get('charset')\n      }\n\n      // 6.4.3. Set essence to mimeType’s essence.\n      essence = mimeType.essence\n    } else if (!mimeType.parameters.has('charset') && charset !== null) {\n      // 6.5. Otherwise, if mimeType’s parameters[\"charset\"] does not exist, and\n      //      charset is non-null, set mimeType’s parameters[\"charset\"] to charset.\n      mimeType.parameters.set('charset', charset)\n    }\n  }\n\n  // 7. If mimeType is null, then return failure.\n  if (mimeType == null) {\n    return 'failure'\n  }\n\n  // 8. Return mimeType.\n  return mimeType\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split\n * @param {string|null} value\n */\nfunction gettingDecodingSplitting (value) {\n  // 1. Let input be the result of isomorphic decoding value.\n  const input = value\n\n  // 2. Let position be a position variable for input, initially pointing at the start of input.\n  const position = { position: 0 }\n\n  // 3. Let values be a list of strings, initially empty.\n  const values = []\n\n  // 4. Let temporaryValue be the empty string.\n  let temporaryValue = ''\n\n  // 5. While position is not past the end of input:\n  while (position.position < input.length) {\n    // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (\")\n    //      or U+002C (,) from input, given position, to temporaryValue.\n    temporaryValue += collectASequenceOfCodePoints(\n      (char) => char !== '\"' && char !== ',',\n      input,\n      position\n    )\n\n    // 5.2. If position is not past the end of input, then:\n    if (position.position < input.length) {\n      // 5.2.1. If the code point at position within input is U+0022 (\"), then:\n      if (input.charCodeAt(position.position) === 0x22) {\n        // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue.\n        temporaryValue += collectAnHTTPQuotedString(\n          input,\n          position\n        )\n\n        // 5.2.1.2. If position is not past the end of input, then continue.\n        if (position.position < input.length) {\n          continue\n        }\n      } else {\n        // 5.2.2. Otherwise:\n\n        // 5.2.2.1. Assert: the code point at position within input is U+002C (,).\n        assert(input.charCodeAt(position.position) === 0x2C)\n\n        // 5.2.2.2. Advance position by 1.\n        position.position++\n      }\n    }\n\n    // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue.\n    temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20)\n\n    // 5.4. Append temporaryValue to values.\n    values.push(temporaryValue)\n\n    // 5.6. Set temporaryValue to the empty string.\n    temporaryValue = ''\n  }\n\n  // 6. Return values.\n  return values\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split\n * @param {string} name lowercase header name\n * @param {import('./headers').HeadersList} list\n */\nfunction getDecodeSplit (name, list) {\n  // 1. Let value be the result of getting name from list.\n  const value = list.get(name, true)\n\n  // 2. If value is null, then return null.\n  if (value === null) {\n    return null\n  }\n\n  // 3. Return the result of getting, decoding, and splitting value.\n  return gettingDecodingSplitting(value)\n}\n\nconst textDecoder = new TextDecoder()\n\n/**\n * @see https://encoding.spec.whatwg.org/#utf-8-decode\n * @param {Buffer} buffer\n */\nfunction utf8DecodeBytes (buffer) {\n  if (buffer.length === 0) {\n    return ''\n  }\n\n  // 1. Let buffer be the result of peeking three bytes from\n  //    ioQueue, converted to a byte sequence.\n\n  // 2. If buffer is 0xEF 0xBB 0xBF, then read three\n  //    bytes from ioQueue. (Do nothing with those bytes.)\n  if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {\n    buffer = buffer.subarray(3)\n  }\n\n  // 3. Process a queue with an instance of UTF-8’s\n  //    decoder, ioQueue, output, and \"replacement\".\n  const output = textDecoder.decode(buffer)\n\n  // 4. Return output.\n  return output\n}\n\nclass EnvironmentSettingsObjectBase {\n  get baseUrl () {\n    return getGlobalOrigin()\n  }\n\n  get origin () {\n    return this.baseUrl?.origin\n  }\n\n  policyContainer = makePolicyContainer()\n}\n\nclass EnvironmentSettingsObject {\n  settingsObject = new EnvironmentSettingsObjectBase()\n}\n\nconst environmentSettingsObject = new EnvironmentSettingsObject()\n\nmodule.exports = {\n  isAborted,\n  isCancelled,\n  isValidEncodedURL,\n  createDeferredPromise,\n  ReadableStreamFrom,\n  tryUpgradeRequestToAPotentiallyTrustworthyURL,\n  clampAndCoarsenConnectionTimingInfo,\n  coarsenedSharedCurrentTime,\n  determineRequestsReferrer,\n  makePolicyContainer,\n  clonePolicyContainer,\n  appendFetchMetadata,\n  appendRequestOriginHeader,\n  TAOCheck,\n  corsCheck,\n  crossOriginResourcePolicyCheck,\n  createOpaqueTimingInfo,\n  setRequestReferrerPolicyOnRedirect,\n  isValidHTTPToken,\n  requestBadPort,\n  requestCurrentURL,\n  responseURL,\n  responseLocationURL,\n  isBlobLike,\n  isURLPotentiallyTrustworthy,\n  isValidReasonPhrase,\n  sameOrigin,\n  normalizeMethod,\n  serializeJavascriptValueToJSONString,\n  iteratorMixin,\n  createIterator,\n  isValidHeaderName,\n  isValidHeaderValue,\n  isErrorLike,\n  fullyReadBody,\n  bytesMatch,\n  isReadableStreamLike,\n  readableStreamClose,\n  isomorphicEncode,\n  urlIsLocal,\n  urlHasHttpsScheme,\n  urlIsHttpHttpsScheme,\n  readAllBytes,\n  simpleRangeHeaderValue,\n  buildContentRange,\n  parseMetadata,\n  createInflate,\n  extractMimeType,\n  getDecodeSplit,\n  utf8DecodeBytes,\n  environmentSettingsObject\n}\n","'use strict'\n\nconst { types, inspect } = require('node:util')\nconst { markAsUncloneable } = require('node:worker_threads')\nconst { toUSVString } = require('../../core/util')\n\n/** @type {import('../../../types/webidl').Webidl} */\nconst webidl = {}\nwebidl.converters = {}\nwebidl.util = {}\nwebidl.errors = {}\n\nwebidl.errors.exception = function (message) {\n  return new TypeError(`${message.header}: ${message.message}`)\n}\n\nwebidl.errors.conversionFailed = function (context) {\n  const plural = context.types.length === 1 ? '' : ' one of'\n  const message =\n    `${context.argument} could not be converted to` +\n    `${plural}: ${context.types.join(', ')}.`\n\n  return webidl.errors.exception({\n    header: context.prefix,\n    message\n  })\n}\n\nwebidl.errors.invalidArgument = function (context) {\n  return webidl.errors.exception({\n    header: context.prefix,\n    message: `\"${context.value}\" is an invalid ${context.type}.`\n  })\n}\n\n// https://webidl.spec.whatwg.org/#implements\nwebidl.brandCheck = function (V, I, opts) {\n  if (opts?.strict !== false) {\n    if (!(V instanceof I)) {\n      const err = new TypeError('Illegal invocation')\n      err.code = 'ERR_INVALID_THIS' // node compat.\n      throw err\n    }\n  } else {\n    if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {\n      const err = new TypeError('Illegal invocation')\n      err.code = 'ERR_INVALID_THIS' // node compat.\n      throw err\n    }\n  }\n}\n\nwebidl.argumentLengthCheck = function ({ length }, min, ctx) {\n  if (length < min) {\n    throw webidl.errors.exception({\n      message: `${min} argument${min !== 1 ? 's' : ''} required, ` +\n               `but${length ? ' only' : ''} ${length} found.`,\n      header: ctx\n    })\n  }\n}\n\nwebidl.illegalConstructor = function () {\n  throw webidl.errors.exception({\n    header: 'TypeError',\n    message: 'Illegal constructor'\n  })\n}\n\n// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\nwebidl.util.Type = function (V) {\n  switch (typeof V) {\n    case 'undefined': return 'Undefined'\n    case 'boolean': return 'Boolean'\n    case 'string': return 'String'\n    case 'symbol': return 'Symbol'\n    case 'number': return 'Number'\n    case 'bigint': return 'BigInt'\n    case 'function':\n    case 'object': {\n      if (V === null) {\n        return 'Null'\n      }\n\n      return 'Object'\n    }\n  }\n}\n\nwebidl.util.markAsUncloneable = markAsUncloneable || (() => {})\n// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint\nwebidl.util.ConvertToInt = function (V, bitLength, signedness, opts) {\n  let upperBound\n  let lowerBound\n\n  // 1. If bitLength is 64, then:\n  if (bitLength === 64) {\n    // 1. Let upperBound be 2^53 − 1.\n    upperBound = Math.pow(2, 53) - 1\n\n    // 2. If signedness is \"unsigned\", then let lowerBound be 0.\n    if (signedness === 'unsigned') {\n      lowerBound = 0\n    } else {\n      // 3. Otherwise let lowerBound be −2^53 + 1.\n      lowerBound = Math.pow(-2, 53) + 1\n    }\n  } else if (signedness === 'unsigned') {\n    // 2. Otherwise, if signedness is \"unsigned\", then:\n\n    // 1. Let lowerBound be 0.\n    lowerBound = 0\n\n    // 2. Let upperBound be 2^bitLength − 1.\n    upperBound = Math.pow(2, bitLength) - 1\n  } else {\n    // 3. Otherwise:\n\n    // 1. Let lowerBound be -2^bitLength − 1.\n    lowerBound = Math.pow(-2, bitLength) - 1\n\n    // 2. Let upperBound be 2^bitLength − 1 − 1.\n    upperBound = Math.pow(2, bitLength - 1) - 1\n  }\n\n  // 4. Let x be ? ToNumber(V).\n  let x = Number(V)\n\n  // 5. If x is −0, then set x to +0.\n  if (x === 0) {\n    x = 0\n  }\n\n  // 6. If the conversion is to an IDL type associated\n  //    with the [EnforceRange] extended attribute, then:\n  if (opts?.enforceRange === true) {\n    // 1. If x is NaN, +∞, or −∞, then throw a TypeError.\n    if (\n      Number.isNaN(x) ||\n      x === Number.POSITIVE_INFINITY ||\n      x === Number.NEGATIVE_INFINITY\n    ) {\n      throw webidl.errors.exception({\n        header: 'Integer conversion',\n        message: `Could not convert ${webidl.util.Stringify(V)} to an integer.`\n      })\n    }\n\n    // 2. Set x to IntegerPart(x).\n    x = webidl.util.IntegerPart(x)\n\n    // 3. If x < lowerBound or x > upperBound, then\n    //    throw a TypeError.\n    if (x < lowerBound || x > upperBound) {\n      throw webidl.errors.exception({\n        header: 'Integer conversion',\n        message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n      })\n    }\n\n    // 4. Return x.\n    return x\n  }\n\n  // 7. If x is not NaN and the conversion is to an IDL\n  //    type associated with the [Clamp] extended\n  //    attribute, then:\n  if (!Number.isNaN(x) && opts?.clamp === true) {\n    // 1. Set x to min(max(x, lowerBound), upperBound).\n    x = Math.min(Math.max(x, lowerBound), upperBound)\n\n    // 2. Round x to the nearest integer, choosing the\n    //    even integer if it lies halfway between two,\n    //    and choosing +0 rather than −0.\n    if (Math.floor(x) % 2 === 0) {\n      x = Math.floor(x)\n    } else {\n      x = Math.ceil(x)\n    }\n\n    // 3. Return x.\n    return x\n  }\n\n  // 8. If x is NaN, +0, +∞, or −∞, then return +0.\n  if (\n    Number.isNaN(x) ||\n    (x === 0 && Object.is(0, x)) ||\n    x === Number.POSITIVE_INFINITY ||\n    x === Number.NEGATIVE_INFINITY\n  ) {\n    return 0\n  }\n\n  // 9. Set x to IntegerPart(x).\n  x = webidl.util.IntegerPart(x)\n\n  // 10. Set x to x modulo 2^bitLength.\n  x = x % Math.pow(2, bitLength)\n\n  // 11. If signedness is \"signed\" and x ≥ 2^bitLength − 1,\n  //    then return x − 2^bitLength.\n  if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {\n    return x - Math.pow(2, bitLength)\n  }\n\n  // 12. Otherwise, return x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart\nwebidl.util.IntegerPart = function (n) {\n  // 1. Let r be floor(abs(n)).\n  const r = Math.floor(Math.abs(n))\n\n  // 2. If n < 0, then return -1 × r.\n  if (n < 0) {\n    return -1 * r\n  }\n\n  // 3. Otherwise, return r.\n  return r\n}\n\nwebidl.util.Stringify = function (V) {\n  const type = webidl.util.Type(V)\n\n  switch (type) {\n    case 'Symbol':\n      return `Symbol(${V.description})`\n    case 'Object':\n      return inspect(V)\n    case 'String':\n      return `\"${V}\"`\n    default:\n      return `${V}`\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-sequence\nwebidl.sequenceConverter = function (converter) {\n  return (V, prefix, argument, Iterable) => {\n    // 1. If Type(V) is not Object, throw a TypeError.\n    if (webidl.util.Type(V) !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.`\n      })\n    }\n\n    // 2. Let method be ? GetMethod(V, @@iterator).\n    /** @type {Generator} */\n    const method = typeof Iterable === 'function' ? Iterable() : V?.[Symbol.iterator]?.()\n    const seq = []\n    let index = 0\n\n    // 3. If method is undefined, throw a TypeError.\n    if (\n      method === undefined ||\n      typeof method.next !== 'function'\n    ) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} is not iterable.`\n      })\n    }\n\n    // https://webidl.spec.whatwg.org/#create-sequence-from-iterable\n    while (true) {\n      const { done, value } = method.next()\n\n      if (done) {\n        break\n      }\n\n      seq.push(converter(value, prefix, `${argument}[${index++}]`))\n    }\n\n    return seq\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-to-record\nwebidl.recordConverter = function (keyConverter, valueConverter) {\n  return (O, prefix, argument) => {\n    // 1. If Type(O) is not Object, throw a TypeError.\n    if (webidl.util.Type(O) !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `${argument} (\"${webidl.util.Type(O)}\") is not an Object.`\n      })\n    }\n\n    // 2. Let result be a new empty instance of record.\n    const result = {}\n\n    if (!types.isProxy(O)) {\n      // 1. Let desc be ? O.[[GetOwnProperty]](key).\n      const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]\n\n      for (const key of keys) {\n        // 1. Let typedKey be key converted to an IDL value of type K.\n        const typedKey = keyConverter(key, prefix, argument)\n\n        // 2. Let value be ? Get(O, key).\n        // 3. Let typedValue be value converted to an IDL value of type V.\n        const typedValue = valueConverter(O[key], prefix, argument)\n\n        // 4. Set result[typedKey] to typedValue.\n        result[typedKey] = typedValue\n      }\n\n      // 5. Return result.\n      return result\n    }\n\n    // 3. Let keys be ? O.[[OwnPropertyKeys]]().\n    const keys = Reflect.ownKeys(O)\n\n    // 4. For each key of keys.\n    for (const key of keys) {\n      // 1. Let desc be ? O.[[GetOwnProperty]](key).\n      const desc = Reflect.getOwnPropertyDescriptor(O, key)\n\n      // 2. If desc is not undefined and desc.[[Enumerable]] is true:\n      if (desc?.enumerable) {\n        // 1. Let typedKey be key converted to an IDL value of type K.\n        const typedKey = keyConverter(key, prefix, argument)\n\n        // 2. Let value be ? Get(O, key).\n        // 3. Let typedValue be value converted to an IDL value of type V.\n        const typedValue = valueConverter(O[key], prefix, argument)\n\n        // 4. Set result[typedKey] to typedValue.\n        result[typedKey] = typedValue\n      }\n    }\n\n    // 5. Return result.\n    return result\n  }\n}\n\nwebidl.interfaceConverter = function (i) {\n  return (V, prefix, argument, opts) => {\n    if (opts?.strict !== false && !(V instanceof i)) {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `Expected ${argument} (\"${webidl.util.Stringify(V)}\") to be an instance of ${i.name}.`\n      })\n    }\n\n    return V\n  }\n}\n\nwebidl.dictionaryConverter = function (converters) {\n  return (dictionary, prefix, argument) => {\n    const type = webidl.util.Type(dictionary)\n    const dict = {}\n\n    if (type === 'Null' || type === 'Undefined') {\n      return dict\n    } else if (type !== 'Object') {\n      throw webidl.errors.exception({\n        header: prefix,\n        message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n      })\n    }\n\n    for (const options of converters) {\n      const { key, defaultValue, required, converter } = options\n\n      if (required === true) {\n        if (!Object.hasOwn(dictionary, key)) {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: `Missing required key \"${key}\".`\n          })\n        }\n      }\n\n      let value = dictionary[key]\n      const hasDefault = Object.hasOwn(options, 'defaultValue')\n\n      // Only use defaultValue if value is undefined and\n      // a defaultValue options was provided.\n      if (hasDefault && value !== null) {\n        value ??= defaultValue()\n      }\n\n      // A key can be optional and have no default value.\n      // When this happens, do not perform a conversion,\n      // and do not assign the key a value.\n      if (required || hasDefault || value !== undefined) {\n        value = converter(value, prefix, `${argument}.${key}`)\n\n        if (\n          options.allowedValues &&\n          !options.allowedValues.includes(value)\n        ) {\n          throw webidl.errors.exception({\n            header: prefix,\n            message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`\n          })\n        }\n\n        dict[key] = value\n      }\n    }\n\n    return dict\n  }\n}\n\nwebidl.nullableConverter = function (converter) {\n  return (V, prefix, argument) => {\n    if (V === null) {\n      return V\n    }\n\n    return converter(V, prefix, argument)\n  }\n}\n\n// https://webidl.spec.whatwg.org/#es-DOMString\nwebidl.converters.DOMString = function (V, prefix, argument, opts) {\n  // 1. If V is null and the conversion is to an IDL type\n  //    associated with the [LegacyNullToEmptyString]\n  //    extended attribute, then return the DOMString value\n  //    that represents the empty string.\n  if (V === null && opts?.legacyNullToEmptyString) {\n    return ''\n  }\n\n  // 2. Let x be ? ToString(V).\n  if (typeof V === 'symbol') {\n    throw webidl.errors.exception({\n      header: prefix,\n      message: `${argument} is a symbol, which cannot be converted to a DOMString.`\n    })\n  }\n\n  // 3. Return the IDL DOMString value that represents the\n  //    same sequence of code units as the one the\n  //    ECMAScript String value x represents.\n  return String(V)\n}\n\n// https://webidl.spec.whatwg.org/#es-ByteString\nwebidl.converters.ByteString = function (V, prefix, argument) {\n  // 1. Let x be ? ToString(V).\n  // Note: DOMString converter perform ? ToString(V)\n  const x = webidl.converters.DOMString(V, prefix, argument)\n\n  // 2. If the value of any element of x is greater than\n  //    255, then throw a TypeError.\n  for (let index = 0; index < x.length; index++) {\n    if (x.charCodeAt(index) > 255) {\n      throw new TypeError(\n        'Cannot convert argument to a ByteString because the character at ' +\n        `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`\n      )\n    }\n  }\n\n  // 3. Return an IDL ByteString value whose length is the\n  //    length of x, and where the value of each element is\n  //    the value of the corresponding element of x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-USVString\n// TODO: rewrite this so we can control the errors thrown\nwebidl.converters.USVString = toUSVString\n\n// https://webidl.spec.whatwg.org/#es-boolean\nwebidl.converters.boolean = function (V) {\n  // 1. Let x be the result of computing ToBoolean(V).\n  const x = Boolean(V)\n\n  // 2. Return the IDL boolean value that is the one that represents\n  //    the same truth value as the ECMAScript Boolean value x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-any\nwebidl.converters.any = function (V) {\n  return V\n}\n\n// https://webidl.spec.whatwg.org/#es-long-long\nwebidl.converters['long long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 64, \"signed\").\n  const x = webidl.util.ConvertToInt(V, 64, 'signed', undefined, prefix, argument)\n\n  // 2. Return the IDL long long value that represents\n  //    the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long-long\nwebidl.converters['unsigned long long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 64, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 64, 'unsigned', undefined, prefix, argument)\n\n  // 2. Return the IDL unsigned long long value that\n  //    represents the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long\nwebidl.converters['unsigned long'] = function (V, prefix, argument) {\n  // 1. Let x be ? ConvertToInt(V, 32, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 32, 'unsigned', undefined, prefix, argument)\n\n  // 2. Return the IDL unsigned long value that\n  //    represents the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-short\nwebidl.converters['unsigned short'] = function (V, prefix, argument, opts) {\n  // 1. Let x be ? ConvertToInt(V, 16, \"unsigned\").\n  const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts, prefix, argument)\n\n  // 2. Return the IDL unsigned short value that represents\n  //    the same numeric value as x.\n  return x\n}\n\n// https://webidl.spec.whatwg.org/#idl-ArrayBuffer\nwebidl.converters.ArrayBuffer = function (V, prefix, argument, opts) {\n  // 1. If Type(V) is not Object, or V does not have an\n  //    [[ArrayBufferData]] internal slot, then throw a\n  //    TypeError.\n  // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances\n  // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances\n  if (\n    webidl.util.Type(V) !== 'Object' ||\n    !types.isAnyArrayBuffer(V)\n  ) {\n    throw webidl.errors.conversionFailed({\n      prefix,\n      argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n      types: ['ArrayBuffer']\n    })\n  }\n\n  // 2. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V) is true, then throw a\n  //    TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V) is true, then throw a\n  //    TypeError.\n  if (V.resizable || V.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 4. Return the IDL ArrayBuffer value that is a\n  //    reference to the same object as V.\n  return V\n}\n\nwebidl.converters.TypedArray = function (V, T, prefix, name, opts) {\n  // 1. Let T be the IDL type V is being converted to.\n\n  // 2. If Type(V) is not Object, or V does not have a\n  //    [[TypedArrayName]] internal slot with a value\n  //    equal to T’s name, then throw a TypeError.\n  if (\n    webidl.util.Type(V) !== 'Object' ||\n    !types.isTypedArray(V) ||\n    V.constructor.name !== T.name\n  ) {\n    throw webidl.errors.conversionFailed({\n      prefix,\n      argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n      types: [T.name]\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 4. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (V.buffer.resizable || V.buffer.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 5. Return the IDL value of type T that is a reference\n  //    to the same object as V.\n  return V\n}\n\nwebidl.converters.DataView = function (V, prefix, name, opts) {\n  // 1. If Type(V) is not Object, or V does not have a\n  //    [[DataView]] internal slot, then throw a TypeError.\n  if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {\n    throw webidl.errors.exception({\n      header: prefix,\n      message: `${name} is not a DataView.`\n    })\n  }\n\n  // 2. If the conversion is not to an IDL type associated\n  //    with the [AllowShared] extended attribute, and\n  //    IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,\n  //    then throw a TypeError.\n  if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'SharedArrayBuffer is not allowed.'\n    })\n  }\n\n  // 3. If the conversion is not to an IDL type associated\n  //    with the [AllowResizable] extended attribute, and\n  //    IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n  //    true, then throw a TypeError.\n  if (V.buffer.resizable || V.buffer.growable) {\n    throw webidl.errors.exception({\n      header: 'ArrayBuffer',\n      message: 'Received a resizable ArrayBuffer.'\n    })\n  }\n\n  // 4. Return the IDL DataView value that is a reference\n  //    to the same object as V.\n  return V\n}\n\n// https://webidl.spec.whatwg.org/#BufferSource\nwebidl.converters.BufferSource = function (V, prefix, name, opts) {\n  if (types.isAnyArrayBuffer(V)) {\n    return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false })\n  }\n\n  if (types.isTypedArray(V)) {\n    return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false })\n  }\n\n  if (types.isDataView(V)) {\n    return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false })\n  }\n\n  throw webidl.errors.conversionFailed({\n    prefix,\n    argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n    types: ['BufferSource']\n  })\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.ByteString\n)\n\nwebidl.converters['sequence>'] = webidl.sequenceConverter(\n  webidl.converters['sequence']\n)\n\nwebidl.converters['record'] = webidl.recordConverter(\n  webidl.converters.ByteString,\n  webidl.converters.ByteString\n)\n\nmodule.exports = {\n  webidl\n}\n","'use strict'\n\n/**\n * @see https://encoding.spec.whatwg.org/#concept-encoding-get\n * @param {string|undefined} label\n */\nfunction getEncoding (label) {\n  if (!label) {\n    return 'failure'\n  }\n\n  // 1. Remove any leading and trailing ASCII whitespace from label.\n  // 2. If label is an ASCII case-insensitive match for any of the\n  //    labels listed in the table below, then return the\n  //    corresponding encoding; otherwise return failure.\n  switch (label.trim().toLowerCase()) {\n    case 'unicode-1-1-utf-8':\n    case 'unicode11utf8':\n    case 'unicode20utf8':\n    case 'utf-8':\n    case 'utf8':\n    case 'x-unicode20utf8':\n      return 'UTF-8'\n    case '866':\n    case 'cp866':\n    case 'csibm866':\n    case 'ibm866':\n      return 'IBM866'\n    case 'csisolatin2':\n    case 'iso-8859-2':\n    case 'iso-ir-101':\n    case 'iso8859-2':\n    case 'iso88592':\n    case 'iso_8859-2':\n    case 'iso_8859-2:1987':\n    case 'l2':\n    case 'latin2':\n      return 'ISO-8859-2'\n    case 'csisolatin3':\n    case 'iso-8859-3':\n    case 'iso-ir-109':\n    case 'iso8859-3':\n    case 'iso88593':\n    case 'iso_8859-3':\n    case 'iso_8859-3:1988':\n    case 'l3':\n    case 'latin3':\n      return 'ISO-8859-3'\n    case 'csisolatin4':\n    case 'iso-8859-4':\n    case 'iso-ir-110':\n    case 'iso8859-4':\n    case 'iso88594':\n    case 'iso_8859-4':\n    case 'iso_8859-4:1988':\n    case 'l4':\n    case 'latin4':\n      return 'ISO-8859-4'\n    case 'csisolatincyrillic':\n    case 'cyrillic':\n    case 'iso-8859-5':\n    case 'iso-ir-144':\n    case 'iso8859-5':\n    case 'iso88595':\n    case 'iso_8859-5':\n    case 'iso_8859-5:1988':\n      return 'ISO-8859-5'\n    case 'arabic':\n    case 'asmo-708':\n    case 'csiso88596e':\n    case 'csiso88596i':\n    case 'csisolatinarabic':\n    case 'ecma-114':\n    case 'iso-8859-6':\n    case 'iso-8859-6-e':\n    case 'iso-8859-6-i':\n    case 'iso-ir-127':\n    case 'iso8859-6':\n    case 'iso88596':\n    case 'iso_8859-6':\n    case 'iso_8859-6:1987':\n      return 'ISO-8859-6'\n    case 'csisolatingreek':\n    case 'ecma-118':\n    case 'elot_928':\n    case 'greek':\n    case 'greek8':\n    case 'iso-8859-7':\n    case 'iso-ir-126':\n    case 'iso8859-7':\n    case 'iso88597':\n    case 'iso_8859-7':\n    case 'iso_8859-7:1987':\n    case 'sun_eu_greek':\n      return 'ISO-8859-7'\n    case 'csiso88598e':\n    case 'csisolatinhebrew':\n    case 'hebrew':\n    case 'iso-8859-8':\n    case 'iso-8859-8-e':\n    case 'iso-ir-138':\n    case 'iso8859-8':\n    case 'iso88598':\n    case 'iso_8859-8':\n    case 'iso_8859-8:1988':\n    case 'visual':\n      return 'ISO-8859-8'\n    case 'csiso88598i':\n    case 'iso-8859-8-i':\n    case 'logical':\n      return 'ISO-8859-8-I'\n    case 'csisolatin6':\n    case 'iso-8859-10':\n    case 'iso-ir-157':\n    case 'iso8859-10':\n    case 'iso885910':\n    case 'l6':\n    case 'latin6':\n      return 'ISO-8859-10'\n    case 'iso-8859-13':\n    case 'iso8859-13':\n    case 'iso885913':\n      return 'ISO-8859-13'\n    case 'iso-8859-14':\n    case 'iso8859-14':\n    case 'iso885914':\n      return 'ISO-8859-14'\n    case 'csisolatin9':\n    case 'iso-8859-15':\n    case 'iso8859-15':\n    case 'iso885915':\n    case 'iso_8859-15':\n    case 'l9':\n      return 'ISO-8859-15'\n    case 'iso-8859-16':\n      return 'ISO-8859-16'\n    case 'cskoi8r':\n    case 'koi':\n    case 'koi8':\n    case 'koi8-r':\n    case 'koi8_r':\n      return 'KOI8-R'\n    case 'koi8-ru':\n    case 'koi8-u':\n      return 'KOI8-U'\n    case 'csmacintosh':\n    case 'mac':\n    case 'macintosh':\n    case 'x-mac-roman':\n      return 'macintosh'\n    case 'iso-8859-11':\n    case 'iso8859-11':\n    case 'iso885911':\n    case 'tis-620':\n    case 'windows-874':\n      return 'windows-874'\n    case 'cp1250':\n    case 'windows-1250':\n    case 'x-cp1250':\n      return 'windows-1250'\n    case 'cp1251':\n    case 'windows-1251':\n    case 'x-cp1251':\n      return 'windows-1251'\n    case 'ansi_x3.4-1968':\n    case 'ascii':\n    case 'cp1252':\n    case 'cp819':\n    case 'csisolatin1':\n    case 'ibm819':\n    case 'iso-8859-1':\n    case 'iso-ir-100':\n    case 'iso8859-1':\n    case 'iso88591':\n    case 'iso_8859-1':\n    case 'iso_8859-1:1987':\n    case 'l1':\n    case 'latin1':\n    case 'us-ascii':\n    case 'windows-1252':\n    case 'x-cp1252':\n      return 'windows-1252'\n    case 'cp1253':\n    case 'windows-1253':\n    case 'x-cp1253':\n      return 'windows-1253'\n    case 'cp1254':\n    case 'csisolatin5':\n    case 'iso-8859-9':\n    case 'iso-ir-148':\n    case 'iso8859-9':\n    case 'iso88599':\n    case 'iso_8859-9':\n    case 'iso_8859-9:1989':\n    case 'l5':\n    case 'latin5':\n    case 'windows-1254':\n    case 'x-cp1254':\n      return 'windows-1254'\n    case 'cp1255':\n    case 'windows-1255':\n    case 'x-cp1255':\n      return 'windows-1255'\n    case 'cp1256':\n    case 'windows-1256':\n    case 'x-cp1256':\n      return 'windows-1256'\n    case 'cp1257':\n    case 'windows-1257':\n    case 'x-cp1257':\n      return 'windows-1257'\n    case 'cp1258':\n    case 'windows-1258':\n    case 'x-cp1258':\n      return 'windows-1258'\n    case 'x-mac-cyrillic':\n    case 'x-mac-ukrainian':\n      return 'x-mac-cyrillic'\n    case 'chinese':\n    case 'csgb2312':\n    case 'csiso58gb231280':\n    case 'gb2312':\n    case 'gb_2312':\n    case 'gb_2312-80':\n    case 'gbk':\n    case 'iso-ir-58':\n    case 'x-gbk':\n      return 'GBK'\n    case 'gb18030':\n      return 'gb18030'\n    case 'big5':\n    case 'big5-hkscs':\n    case 'cn-big5':\n    case 'csbig5':\n    case 'x-x-big5':\n      return 'Big5'\n    case 'cseucpkdfmtjapanese':\n    case 'euc-jp':\n    case 'x-euc-jp':\n      return 'EUC-JP'\n    case 'csiso2022jp':\n    case 'iso-2022-jp':\n      return 'ISO-2022-JP'\n    case 'csshiftjis':\n    case 'ms932':\n    case 'ms_kanji':\n    case 'shift-jis':\n    case 'shift_jis':\n    case 'sjis':\n    case 'windows-31j':\n    case 'x-sjis':\n      return 'Shift_JIS'\n    case 'cseuckr':\n    case 'csksc56011987':\n    case 'euc-kr':\n    case 'iso-ir-149':\n    case 'korean':\n    case 'ks_c_5601-1987':\n    case 'ks_c_5601-1989':\n    case 'ksc5601':\n    case 'ksc_5601':\n    case 'windows-949':\n      return 'EUC-KR'\n    case 'csiso2022kr':\n    case 'hz-gb-2312':\n    case 'iso-2022-cn':\n    case 'iso-2022-cn-ext':\n    case 'iso-2022-kr':\n    case 'replacement':\n      return 'replacement'\n    case 'unicodefffe':\n    case 'utf-16be':\n      return 'UTF-16BE'\n    case 'csunicode':\n    case 'iso-10646-ucs-2':\n    case 'ucs-2':\n    case 'unicode':\n    case 'unicodefeff':\n    case 'utf-16':\n    case 'utf-16le':\n      return 'UTF-16LE'\n    case 'x-user-defined':\n      return 'x-user-defined'\n    default: return 'failure'\n  }\n}\n\nmodule.exports = {\n  getEncoding\n}\n","'use strict'\n\nconst {\n  staticPropertyDescriptors,\n  readOperation,\n  fireAProgressEvent\n} = require('./util')\nconst {\n  kState,\n  kError,\n  kResult,\n  kEvents,\n  kAborted\n} = require('./symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass FileReader extends EventTarget {\n  constructor () {\n    super()\n\n    this[kState] = 'empty'\n    this[kResult] = null\n    this[kError] = null\n    this[kEvents] = {\n      loadend: null,\n      error: null,\n      abort: null,\n      load: null,\n      progress: null,\n      loadstart: null\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer\n   * @param {import('buffer').Blob} blob\n   */\n  readAsArrayBuffer (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsArrayBuffer')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsArrayBuffer(blob) method, when invoked,\n    // must initiate a read operation for blob with ArrayBuffer.\n    readOperation(this, blob, 'ArrayBuffer')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#readAsBinaryString\n   * @param {import('buffer').Blob} blob\n   */\n  readAsBinaryString (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsBinaryString')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsBinaryString(blob) method, when invoked,\n    // must initiate a read operation for blob with BinaryString.\n    readOperation(this, blob, 'BinaryString')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#readAsDataText\n   * @param {import('buffer').Blob} blob\n   * @param {string?} encoding\n   */\n  readAsText (blob, encoding = undefined) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsText')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    if (encoding !== undefined) {\n      encoding = webidl.converters.DOMString(encoding, 'FileReader.readAsText', 'encoding')\n    }\n\n    // The readAsText(blob, encoding) method, when invoked,\n    // must initiate a read operation for blob with Text and encoding.\n    readOperation(this, blob, 'Text', encoding)\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL\n   * @param {import('buffer').Blob} blob\n   */\n  readAsDataURL (blob) {\n    webidl.brandCheck(this, FileReader)\n\n    webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsDataURL')\n\n    blob = webidl.converters.Blob(blob, { strict: false })\n\n    // The readAsDataURL(blob) method, when invoked, must\n    // initiate a read operation for blob with DataURL.\n    readOperation(this, blob, 'DataURL')\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dfn-abort\n   */\n  abort () {\n    // 1. If this's state is \"empty\" or if this's state is\n    //    \"done\" set this's result to null and terminate\n    //    this algorithm.\n    if (this[kState] === 'empty' || this[kState] === 'done') {\n      this[kResult] = null\n      return\n    }\n\n    // 2. If this's state is \"loading\" set this's state to\n    //    \"done\" and set this's result to null.\n    if (this[kState] === 'loading') {\n      this[kState] = 'done'\n      this[kResult] = null\n    }\n\n    // 3. If there are any tasks from this on the file reading\n    //    task source in an affiliated task queue, then remove\n    //    those tasks from that task queue.\n    this[kAborted] = true\n\n    // 4. Terminate the algorithm for the read method being processed.\n    // TODO\n\n    // 5. Fire a progress event called abort at this.\n    fireAProgressEvent('abort', this)\n\n    // 6. If this's state is not \"loading\", fire a progress\n    //    event called loadend at this.\n    if (this[kState] !== 'loading') {\n      fireAProgressEvent('loadend', this)\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate\n   */\n  get readyState () {\n    webidl.brandCheck(this, FileReader)\n\n    switch (this[kState]) {\n      case 'empty': return this.EMPTY\n      case 'loading': return this.LOADING\n      case 'done': return this.DONE\n    }\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-result\n   */\n  get result () {\n    webidl.brandCheck(this, FileReader)\n\n    // The result attribute’s getter, when invoked, must return\n    // this's result.\n    return this[kResult]\n  }\n\n  /**\n   * @see https://w3c.github.io/FileAPI/#dom-filereader-error\n   */\n  get error () {\n    webidl.brandCheck(this, FileReader)\n\n    // The error attribute’s getter, when invoked, must return\n    // this's error.\n    return this[kError]\n  }\n\n  get onloadend () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].loadend\n  }\n\n  set onloadend (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].loadend) {\n      this.removeEventListener('loadend', this[kEvents].loadend)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].loadend = fn\n      this.addEventListener('loadend', fn)\n    } else {\n      this[kEvents].loadend = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].error) {\n      this.removeEventListener('error', this[kEvents].error)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this[kEvents].error = null\n    }\n  }\n\n  get onloadstart () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].loadstart\n  }\n\n  set onloadstart (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].loadstart) {\n      this.removeEventListener('loadstart', this[kEvents].loadstart)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].loadstart = fn\n      this.addEventListener('loadstart', fn)\n    } else {\n      this[kEvents].loadstart = null\n    }\n  }\n\n  get onprogress () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].progress\n  }\n\n  set onprogress (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].progress) {\n      this.removeEventListener('progress', this[kEvents].progress)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].progress = fn\n      this.addEventListener('progress', fn)\n    } else {\n      this[kEvents].progress = null\n    }\n  }\n\n  get onload () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].load\n  }\n\n  set onload (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].load) {\n      this.removeEventListener('load', this[kEvents].load)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].load = fn\n      this.addEventListener('load', fn)\n    } else {\n      this[kEvents].load = null\n    }\n  }\n\n  get onabort () {\n    webidl.brandCheck(this, FileReader)\n\n    return this[kEvents].abort\n  }\n\n  set onabort (fn) {\n    webidl.brandCheck(this, FileReader)\n\n    if (this[kEvents].abort) {\n      this.removeEventListener('abort', this[kEvents].abort)\n    }\n\n    if (typeof fn === 'function') {\n      this[kEvents].abort = fn\n      this.addEventListener('abort', fn)\n    } else {\n      this[kEvents].abort = null\n    }\n  }\n}\n\n// https://w3c.github.io/FileAPI/#dom-filereader-empty\nFileReader.EMPTY = FileReader.prototype.EMPTY = 0\n// https://w3c.github.io/FileAPI/#dom-filereader-loading\nFileReader.LOADING = FileReader.prototype.LOADING = 1\n// https://w3c.github.io/FileAPI/#dom-filereader-done\nFileReader.DONE = FileReader.prototype.DONE = 2\n\nObject.defineProperties(FileReader.prototype, {\n  EMPTY: staticPropertyDescriptors,\n  LOADING: staticPropertyDescriptors,\n  DONE: staticPropertyDescriptors,\n  readAsArrayBuffer: kEnumerableProperty,\n  readAsBinaryString: kEnumerableProperty,\n  readAsText: kEnumerableProperty,\n  readAsDataURL: kEnumerableProperty,\n  abort: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  result: kEnumerableProperty,\n  error: kEnumerableProperty,\n  onloadstart: kEnumerableProperty,\n  onprogress: kEnumerableProperty,\n  onload: kEnumerableProperty,\n  onabort: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onloadend: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'FileReader',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(FileReader, {\n  EMPTY: staticPropertyDescriptors,\n  LOADING: staticPropertyDescriptors,\n  DONE: staticPropertyDescriptors\n})\n\nmodule.exports = {\n  FileReader\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\n\nconst kState = Symbol('ProgressEvent state')\n\n/**\n * @see https://xhr.spec.whatwg.org/#progressevent\n */\nclass ProgressEvent extends Event {\n  constructor (type, eventInitDict = {}) {\n    type = webidl.converters.DOMString(type, 'ProgressEvent constructor', 'type')\n    eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})\n\n    super(type, eventInitDict)\n\n    this[kState] = {\n      lengthComputable: eventInitDict.lengthComputable,\n      loaded: eventInitDict.loaded,\n      total: eventInitDict.total\n    }\n  }\n\n  get lengthComputable () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].lengthComputable\n  }\n\n  get loaded () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].loaded\n  }\n\n  get total () {\n    webidl.brandCheck(this, ProgressEvent)\n\n    return this[kState].total\n  }\n}\n\nwebidl.converters.ProgressEventInit = webidl.dictionaryConverter([\n  {\n    key: 'lengthComputable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'loaded',\n    converter: webidl.converters['unsigned long long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'total',\n    converter: webidl.converters['unsigned long long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'bubbles',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'cancelable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'composed',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n])\n\nmodule.exports = {\n  ProgressEvent\n}\n","'use strict'\n\nmodule.exports = {\n  kState: Symbol('FileReader state'),\n  kResult: Symbol('FileReader result'),\n  kError: Symbol('FileReader error'),\n  kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),\n  kEvents: Symbol('FileReader events'),\n  kAborted: Symbol('FileReader aborted')\n}\n","'use strict'\n\nconst {\n  kState,\n  kError,\n  kResult,\n  kAborted,\n  kLastProgressEventFired\n} = require('./symbols')\nconst { ProgressEvent } = require('./progressevent')\nconst { getEncoding } = require('./encoding')\nconst { serializeAMimeType, parseMIMEType } = require('../fetch/data-url')\nconst { types } = require('node:util')\nconst { StringDecoder } = require('string_decoder')\nconst { btoa } = require('node:buffer')\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n  enumerable: true,\n  writable: false,\n  configurable: false\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#readOperation\n * @param {import('./filereader').FileReader} fr\n * @param {import('buffer').Blob} blob\n * @param {string} type\n * @param {string?} encodingName\n */\nfunction readOperation (fr, blob, type, encodingName) {\n  // 1. If fr’s state is \"loading\", throw an InvalidStateError\n  //    DOMException.\n  if (fr[kState] === 'loading') {\n    throw new DOMException('Invalid state', 'InvalidStateError')\n  }\n\n  // 2. Set fr’s state to \"loading\".\n  fr[kState] = 'loading'\n\n  // 3. Set fr’s result to null.\n  fr[kResult] = null\n\n  // 4. Set fr’s error to null.\n  fr[kError] = null\n\n  // 5. Let stream be the result of calling get stream on blob.\n  /** @type {import('stream/web').ReadableStream} */\n  const stream = blob.stream()\n\n  // 6. Let reader be the result of getting a reader from stream.\n  const reader = stream.getReader()\n\n  // 7. Let bytes be an empty byte sequence.\n  /** @type {Uint8Array[]} */\n  const bytes = []\n\n  // 8. Let chunkPromise be the result of reading a chunk from\n  //    stream with reader.\n  let chunkPromise = reader.read()\n\n  // 9. Let isFirstChunk be true.\n  let isFirstChunk = true\n\n  // 10. In parallel, while true:\n  // Note: \"In parallel\" just means non-blocking\n  // Note 2: readOperation itself cannot be async as double\n  // reading the body would then reject the promise, instead\n  // of throwing an error.\n  ;(async () => {\n    while (!fr[kAborted]) {\n      // 1. Wait for chunkPromise to be fulfilled or rejected.\n      try {\n        const { done, value } = await chunkPromise\n\n        // 2. If chunkPromise is fulfilled, and isFirstChunk is\n        //    true, queue a task to fire a progress event called\n        //    loadstart at fr.\n        if (isFirstChunk && !fr[kAborted]) {\n          queueMicrotask(() => {\n            fireAProgressEvent('loadstart', fr)\n          })\n        }\n\n        // 3. Set isFirstChunk to false.\n        isFirstChunk = false\n\n        // 4. If chunkPromise is fulfilled with an object whose\n        //    done property is false and whose value property is\n        //    a Uint8Array object, run these steps:\n        if (!done && types.isUint8Array(value)) {\n          // 1. Let bs be the byte sequence represented by the\n          //    Uint8Array object.\n\n          // 2. Append bs to bytes.\n          bytes.push(value)\n\n          // 3. If roughly 50ms have passed since these steps\n          //    were last invoked, queue a task to fire a\n          //    progress event called progress at fr.\n          if (\n            (\n              fr[kLastProgressEventFired] === undefined ||\n              Date.now() - fr[kLastProgressEventFired] >= 50\n            ) &&\n            !fr[kAborted]\n          ) {\n            fr[kLastProgressEventFired] = Date.now()\n            queueMicrotask(() => {\n              fireAProgressEvent('progress', fr)\n            })\n          }\n\n          // 4. Set chunkPromise to the result of reading a\n          //    chunk from stream with reader.\n          chunkPromise = reader.read()\n        } else if (done) {\n          // 5. Otherwise, if chunkPromise is fulfilled with an\n          //    object whose done property is true, queue a task\n          //    to run the following steps and abort this algorithm:\n          queueMicrotask(() => {\n            // 1. Set fr’s state to \"done\".\n            fr[kState] = 'done'\n\n            // 2. Let result be the result of package data given\n            //    bytes, type, blob’s type, and encodingName.\n            try {\n              const result = packageData(bytes, type, blob.type, encodingName)\n\n              // 4. Else:\n\n              if (fr[kAborted]) {\n                return\n              }\n\n              // 1. Set fr’s result to result.\n              fr[kResult] = result\n\n              // 2. Fire a progress event called load at the fr.\n              fireAProgressEvent('load', fr)\n            } catch (error) {\n              // 3. If package data threw an exception error:\n\n              // 1. Set fr’s error to error.\n              fr[kError] = error\n\n              // 2. Fire a progress event called error at fr.\n              fireAProgressEvent('error', fr)\n            }\n\n            // 5. If fr’s state is not \"loading\", fire a progress\n            //    event called loadend at the fr.\n            if (fr[kState] !== 'loading') {\n              fireAProgressEvent('loadend', fr)\n            }\n          })\n\n          break\n        }\n      } catch (error) {\n        if (fr[kAborted]) {\n          return\n        }\n\n        // 6. Otherwise, if chunkPromise is rejected with an\n        //    error error, queue a task to run the following\n        //    steps and abort this algorithm:\n        queueMicrotask(() => {\n          // 1. Set fr’s state to \"done\".\n          fr[kState] = 'done'\n\n          // 2. Set fr’s error to error.\n          fr[kError] = error\n\n          // 3. Fire a progress event called error at fr.\n          fireAProgressEvent('error', fr)\n\n          // 4. If fr’s state is not \"loading\", fire a progress\n          //    event called loadend at fr.\n          if (fr[kState] !== 'loading') {\n            fireAProgressEvent('loadend', fr)\n          }\n        })\n\n        break\n      }\n    }\n  })()\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#fire-a-progress-event\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e The name of the event\n * @param {import('./filereader').FileReader} reader\n */\nfunction fireAProgressEvent (e, reader) {\n  // The progress event e does not bubble. e.bubbles must be false\n  // The progress event e is NOT cancelable. e.cancelable must be false\n  const event = new ProgressEvent(e, {\n    bubbles: false,\n    cancelable: false\n  })\n\n  reader.dispatchEvent(event)\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#blob-package-data\n * @param {Uint8Array[]} bytes\n * @param {string} type\n * @param {string?} mimeType\n * @param {string?} encodingName\n */\nfunction packageData (bytes, type, mimeType, encodingName) {\n  // 1. A Blob has an associated package data algorithm, given\n  //    bytes, a type, a optional mimeType, and a optional\n  //    encodingName, which switches on type and runs the\n  //    associated steps:\n\n  switch (type) {\n    case 'DataURL': {\n      // 1. Return bytes as a DataURL [RFC2397] subject to\n      //    the considerations below:\n      //  * Use mimeType as part of the Data URL if it is\n      //    available in keeping with the Data URL\n      //    specification [RFC2397].\n      //  * If mimeType is not available return a Data URL\n      //    without a media-type. [RFC2397].\n\n      // https://datatracker.ietf.org/doc/html/rfc2397#section-3\n      // dataurl    := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n      // mediatype  := [ type \"/\" subtype ] *( \";\" parameter )\n      // data       := *urlchar\n      // parameter  := attribute \"=\" value\n      let dataURL = 'data:'\n\n      const parsed = parseMIMEType(mimeType || 'application/octet-stream')\n\n      if (parsed !== 'failure') {\n        dataURL += serializeAMimeType(parsed)\n      }\n\n      dataURL += ';base64,'\n\n      const decoder = new StringDecoder('latin1')\n\n      for (const chunk of bytes) {\n        dataURL += btoa(decoder.write(chunk))\n      }\n\n      dataURL += btoa(decoder.end())\n\n      return dataURL\n    }\n    case 'Text': {\n      // 1. Let encoding be failure\n      let encoding = 'failure'\n\n      // 2. If the encodingName is present, set encoding to the\n      //    result of getting an encoding from encodingName.\n      if (encodingName) {\n        encoding = getEncoding(encodingName)\n      }\n\n      // 3. If encoding is failure, and mimeType is present:\n      if (encoding === 'failure' && mimeType) {\n        // 1. Let type be the result of parse a MIME type\n        //    given mimeType.\n        const type = parseMIMEType(mimeType)\n\n        // 2. If type is not failure, set encoding to the result\n        //    of getting an encoding from type’s parameters[\"charset\"].\n        if (type !== 'failure') {\n          encoding = getEncoding(type.parameters.get('charset'))\n        }\n      }\n\n      // 4. If encoding is failure, then set encoding to UTF-8.\n      if (encoding === 'failure') {\n        encoding = 'UTF-8'\n      }\n\n      // 5. Decode bytes using fallback encoding encoding, and\n      //    return the result.\n      return decode(bytes, encoding)\n    }\n    case 'ArrayBuffer': {\n      // Return a new ArrayBuffer whose contents are bytes.\n      const sequence = combineByteSequences(bytes)\n\n      return sequence.buffer\n    }\n    case 'BinaryString': {\n      // Return bytes as a binary string, in which every byte\n      //  is represented by a code unit of equal value [0..255].\n      let binaryString = ''\n\n      const decoder = new StringDecoder('latin1')\n\n      for (const chunk of bytes) {\n        binaryString += decoder.write(chunk)\n      }\n\n      binaryString += decoder.end()\n\n      return binaryString\n    }\n  }\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#decode\n * @param {Uint8Array[]} ioQueue\n * @param {string} encoding\n */\nfunction decode (ioQueue, encoding) {\n  const bytes = combineByteSequences(ioQueue)\n\n  // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.\n  const BOMEncoding = BOMSniffing(bytes)\n\n  let slice = 0\n\n  // 2. If BOMEncoding is non-null:\n  if (BOMEncoding !== null) {\n    // 1. Set encoding to BOMEncoding.\n    encoding = BOMEncoding\n\n    // 2. Read three bytes from ioQueue, if BOMEncoding is\n    //    UTF-8; otherwise read two bytes.\n    //    (Do nothing with those bytes.)\n    slice = BOMEncoding === 'UTF-8' ? 3 : 2\n  }\n\n  // 3. Process a queue with an instance of encoding’s\n  //    decoder, ioQueue, output, and \"replacement\".\n\n  // 4. Return output.\n\n  const sliced = bytes.slice(slice)\n  return new TextDecoder(encoding).decode(sliced)\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#bom-sniff\n * @param {Uint8Array} ioQueue\n */\nfunction BOMSniffing (ioQueue) {\n  // 1. Let BOM be the result of peeking 3 bytes from ioQueue,\n  //    converted to a byte sequence.\n  const [a, b, c] = ioQueue\n\n  // 2. For each of the rows in the table below, starting with\n  //    the first one and going down, if BOM starts with the\n  //    bytes given in the first column, then return the\n  //    encoding given in the cell in the second column of that\n  //    row. Otherwise, return null.\n  if (a === 0xEF && b === 0xBB && c === 0xBF) {\n    return 'UTF-8'\n  } else if (a === 0xFE && b === 0xFF) {\n    return 'UTF-16BE'\n  } else if (a === 0xFF && b === 0xFE) {\n    return 'UTF-16LE'\n  }\n\n  return null\n}\n\n/**\n * @param {Uint8Array[]} sequences\n */\nfunction combineByteSequences (sequences) {\n  const size = sequences.reduce((a, b) => {\n    return a + b.byteLength\n  }, 0)\n\n  let offset = 0\n\n  return sequences.reduce((a, b) => {\n    a.set(b, offset)\n    offset += b.byteLength\n    return a\n  }, new Uint8Array(size))\n}\n\nmodule.exports = {\n  staticPropertyDescriptors,\n  readOperation,\n  fireAProgressEvent\n}\n","'use strict'\n\nconst { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require('./constants')\nconst {\n  kReadyState,\n  kSentClose,\n  kByteParser,\n  kReceivedClose,\n  kResponse\n} = require('./symbols')\nconst { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require('./util')\nconst { channels } = require('../../core/diagnostics')\nconst { CloseEvent } = require('./events')\nconst { makeRequest } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { Headers, getHeadersList } = require('../fetch/headers')\nconst { getDecodeSplit } = require('../fetch/util')\nconst { WebsocketFrameSend } = require('./frame')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n  crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#concept-websocket-establish\n * @param {URL} url\n * @param {string|string[]} protocols\n * @param {import('./websocket').WebSocket} ws\n * @param {(response: any, extensions: string[] | undefined) => void} onEstablish\n * @param {Partial} options\n */\nfunction establishWebSocketConnection (url, protocols, client, ws, onEstablish, options) {\n  // 1. Let requestURL be a copy of url, with its scheme set to \"http\", if url’s\n  //    scheme is \"ws\", and to \"https\" otherwise.\n  const requestURL = url\n\n  requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'\n\n  // 2. Let request be a new request, whose URL is requestURL, client is client,\n  //    service-workers mode is \"none\", referrer is \"no-referrer\", mode is\n  //    \"websocket\", credentials mode is \"include\", cache mode is \"no-store\" ,\n  //    and redirect mode is \"error\".\n  const request = makeRequest({\n    urlList: [requestURL],\n    client,\n    serviceWorkers: 'none',\n    referrer: 'no-referrer',\n    mode: 'websocket',\n    credentials: 'include',\n    cache: 'no-store',\n    redirect: 'error'\n  })\n\n  // Note: undici extension, allow setting custom headers.\n  if (options.headers) {\n    const headersList = getHeadersList(new Headers(options.headers))\n\n    request.headersList = headersList\n  }\n\n  // 3. Append (`Upgrade`, `websocket`) to request’s header list.\n  // 4. Append (`Connection`, `Upgrade`) to request’s header list.\n  // Note: both of these are handled by undici currently.\n  // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397\n\n  // 5. Let keyValue be a nonce consisting of a randomly selected\n  //    16-byte value that has been forgiving-base64-encoded and\n  //    isomorphic encoded.\n  const keyValue = crypto.randomBytes(16).toString('base64')\n\n  // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s\n  //    header list.\n  request.headersList.append('sec-websocket-key', keyValue)\n\n  // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s\n  //    header list.\n  request.headersList.append('sec-websocket-version', '13')\n\n  // 8. For each protocol in protocols, combine\n  //    (`Sec-WebSocket-Protocol`, protocol) in request’s header\n  //    list.\n  for (const protocol of protocols) {\n    request.headersList.append('sec-websocket-protocol', protocol)\n  }\n\n  // 9. Let permessageDeflate be a user-agent defined\n  //    \"permessage-deflate\" extension header value.\n  // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673\n  const permessageDeflate = 'permessage-deflate; client_max_window_bits'\n\n  // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to\n  //     request’s header list.\n  request.headersList.append('sec-websocket-extensions', permessageDeflate)\n\n  // 11. Fetch request with useParallelQueue set to true, and\n  //     processResponse given response being these steps:\n  const controller = fetching({\n    request,\n    useParallelQueue: true,\n    dispatcher: options.dispatcher,\n    processResponse (response) {\n      // 1. If response is a network error or its status is not 101,\n      //    fail the WebSocket connection.\n      if (response.type === 'error' || response.status !== 101) {\n        failWebsocketConnection(ws, 'Received network error or non-101 status code.')\n        return\n      }\n\n      // 2. If protocols is not the empty list and extracting header\n      //    list values given `Sec-WebSocket-Protocol` and response’s\n      //    header list results in null, failure, or the empty byte\n      //    sequence, then fail the WebSocket connection.\n      if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {\n        failWebsocketConnection(ws, 'Server did not respond with sent protocols.')\n        return\n      }\n\n      // 3. Follow the requirements stated step 2 to step 6, inclusive,\n      //    of the last set of steps in section 4.1 of The WebSocket\n      //    Protocol to validate response. This either results in fail\n      //    the WebSocket connection or the WebSocket connection is\n      //    established.\n\n      // 2. If the response lacks an |Upgrade| header field or the |Upgrade|\n      //    header field contains a value that is not an ASCII case-\n      //    insensitive match for the value \"websocket\", the client MUST\n      //    _Fail the WebSocket Connection_.\n      if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {\n        failWebsocketConnection(ws, 'Server did not set Upgrade header to \"websocket\".')\n        return\n      }\n\n      // 3. If the response lacks a |Connection| header field or the\n      //    |Connection| header field doesn't contain a token that is an\n      //    ASCII case-insensitive match for the value \"Upgrade\", the client\n      //    MUST _Fail the WebSocket Connection_.\n      if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {\n        failWebsocketConnection(ws, 'Server did not set Connection header to \"upgrade\".')\n        return\n      }\n\n      // 4. If the response lacks a |Sec-WebSocket-Accept| header field or\n      //    the |Sec-WebSocket-Accept| contains a value other than the\n      //    base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-\n      //    Key| (as a string, not base64-decoded) with the string \"258EAFA5-\n      //    E914-47DA-95CA-C5AB0DC85B11\" but ignoring any leading and\n      //    trailing whitespace, the client MUST _Fail the WebSocket\n      //    Connection_.\n      const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')\n      const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')\n      if (secWSAccept !== digest) {\n        failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')\n        return\n      }\n\n      // 5. If the response includes a |Sec-WebSocket-Extensions| header\n      //    field and this header field indicates the use of an extension\n      //    that was not present in the client's handshake (the server has\n      //    indicated an extension not requested by the client), the client\n      //    MUST _Fail the WebSocket Connection_.  (The parsing of this\n      //    header field to determine which extensions are requested is\n      //    discussed in Section 9.1.)\n      const secExtension = response.headersList.get('Sec-WebSocket-Extensions')\n      let extensions\n\n      if (secExtension !== null) {\n        extensions = parseExtensions(secExtension)\n\n        if (!extensions.has('permessage-deflate')) {\n          failWebsocketConnection(ws, 'Sec-WebSocket-Extensions header does not match.')\n          return\n        }\n      }\n\n      // 6. If the response includes a |Sec-WebSocket-Protocol| header field\n      //    and this header field indicates the use of a subprotocol that was\n      //    not present in the client's handshake (the server has indicated a\n      //    subprotocol not requested by the client), the client MUST _Fail\n      //    the WebSocket Connection_.\n      const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')\n\n      if (secProtocol !== null) {\n        const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList)\n\n        // The client can request that the server use a specific subprotocol by\n        // including the |Sec-WebSocket-Protocol| field in its handshake.  If it\n        // is specified, the server needs to include the same field and one of\n        // the selected subprotocol values in its response for the connection to\n        // be established.\n        if (!requestProtocols.includes(secProtocol)) {\n          failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')\n          return\n        }\n      }\n\n      response.socket.on('data', onSocketData)\n      response.socket.on('close', onSocketClose)\n      response.socket.on('error', onSocketError)\n\n      if (channels.open.hasSubscribers) {\n        channels.open.publish({\n          address: response.socket.address(),\n          protocol: secProtocol,\n          extensions: secExtension\n        })\n      }\n\n      onEstablish(response, extensions)\n    }\n  })\n\n  return controller\n}\n\nfunction closeWebSocketConnection (ws, code, reason, reasonByteLength) {\n  if (isClosing(ws) || isClosed(ws)) {\n    // If this's ready state is CLOSING (2) or CLOSED (3)\n    // Do nothing.\n  } else if (!isEstablished(ws)) {\n    // If the WebSocket connection is not yet established\n    // Fail the WebSocket connection and set this's ready state\n    // to CLOSING (2).\n    failWebsocketConnection(ws, 'Connection was closed before it was established.')\n    ws[kReadyState] = states.CLOSING\n  } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) {\n    // If the WebSocket closing handshake has not yet been started\n    // Start the WebSocket closing handshake and set this's ready\n    // state to CLOSING (2).\n    // - If neither code nor reason is present, the WebSocket Close\n    //   message must not have a body.\n    // - If code is present, then the status code to use in the\n    //   WebSocket Close message must be the integer given by code.\n    // - If reason is also present, then reasonBytes must be\n    //   provided in the Close message after the status code.\n\n    ws[kSentClose] = sentCloseFrameState.PROCESSING\n\n    const frame = new WebsocketFrameSend()\n\n    // If neither code nor reason is present, the WebSocket Close\n    // message must not have a body.\n\n    // If code is present, then the status code to use in the\n    // WebSocket Close message must be the integer given by code.\n    if (code !== undefined && reason === undefined) {\n      frame.frameData = Buffer.allocUnsafe(2)\n      frame.frameData.writeUInt16BE(code, 0)\n    } else if (code !== undefined && reason !== undefined) {\n      // If reason is also present, then reasonBytes must be\n      // provided in the Close message after the status code.\n      frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)\n      frame.frameData.writeUInt16BE(code, 0)\n      // the body MAY contain UTF-8-encoded data with value /reason/\n      frame.frameData.write(reason, 2, 'utf-8')\n    } else {\n      frame.frameData = emptyBuffer\n    }\n\n    /** @type {import('stream').Duplex} */\n    const socket = ws[kResponse].socket\n\n    socket.write(frame.createFrame(opcodes.CLOSE))\n\n    ws[kSentClose] = sentCloseFrameState.SENT\n\n    // Upon either sending or receiving a Close control frame, it is said\n    // that _The WebSocket Closing Handshake is Started_ and that the\n    // WebSocket connection is in the CLOSING state.\n    ws[kReadyState] = states.CLOSING\n  } else {\n    // Otherwise\n    // Set this's ready state to CLOSING (2).\n    ws[kReadyState] = states.CLOSING\n  }\n}\n\n/**\n * @param {Buffer} chunk\n */\nfunction onSocketData (chunk) {\n  if (!this.ws[kByteParser].write(chunk)) {\n    this.pause()\n  }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n */\nfunction onSocketClose () {\n  const { ws } = this\n  const { [kResponse]: response } = ws\n\n  response.socket.off('data', onSocketData)\n  response.socket.off('close', onSocketClose)\n  response.socket.off('error', onSocketError)\n\n  // If the TCP connection was closed after the\n  // WebSocket closing handshake was completed, the WebSocket connection\n  // is said to have been closed _cleanly_.\n  const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]\n\n  let code = 1005\n  let reason = ''\n\n  const result = ws[kByteParser].closingInfo\n\n  if (result && !result.error) {\n    code = result.code ?? 1005\n    reason = result.reason\n  } else if (!ws[kReceivedClose]) {\n    // If _The WebSocket\n    // Connection is Closed_ and no Close control frame was received by the\n    // endpoint (such as could occur if the underlying transport connection\n    // is lost), _The WebSocket Connection Close Code_ is considered to be\n    // 1006.\n    code = 1006\n  }\n\n  // 1. Change the ready state to CLOSED (3).\n  ws[kReadyState] = states.CLOSED\n\n  // 2. If the user agent was required to fail the WebSocket\n  //    connection, or if the WebSocket connection was closed\n  //    after being flagged as full, fire an event named error\n  //    at the WebSocket object.\n  // TODO\n\n  // 3. Fire an event named close at the WebSocket object,\n  //    using CloseEvent, with the wasClean attribute\n  //    initialized to true if the connection closed cleanly\n  //    and false otherwise, the code attribute initialized to\n  //    the WebSocket connection close code, and the reason\n  //    attribute initialized to the result of applying UTF-8\n  //    decode without BOM to the WebSocket connection close\n  //    reason.\n  // TODO: process.nextTick\n  fireEvent('close', ws, (type, init) => new CloseEvent(type, init), {\n    wasClean, code, reason\n  })\n\n  if (channels.close.hasSubscribers) {\n    channels.close.publish({\n      websocket: ws,\n      code,\n      reason\n    })\n  }\n}\n\nfunction onSocketError (error) {\n  const { ws } = this\n\n  ws[kReadyState] = states.CLOSING\n\n  if (channels.socketError.hasSubscribers) {\n    channels.socketError.publish(error)\n  }\n\n  this.destroy()\n}\n\nmodule.exports = {\n  establishWebSocketConnection,\n  closeWebSocketConnection\n}\n","'use strict'\n\n// This is a Globally Unique Identifier unique used\n// to validate that the endpoint accepts websocket\n// connections.\n// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3\nconst uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n  enumerable: true,\n  writable: false,\n  configurable: false\n}\n\nconst states = {\n  CONNECTING: 0,\n  OPEN: 1,\n  CLOSING: 2,\n  CLOSED: 3\n}\n\nconst sentCloseFrameState = {\n  NOT_SENT: 0,\n  PROCESSING: 1,\n  SENT: 2\n}\n\nconst opcodes = {\n  CONTINUATION: 0x0,\n  TEXT: 0x1,\n  BINARY: 0x2,\n  CLOSE: 0x8,\n  PING: 0x9,\n  PONG: 0xA\n}\n\nconst maxUnsigned16Bit = 2 ** 16 - 1 // 65535\n\nconst parserStates = {\n  INFO: 0,\n  PAYLOADLENGTH_16: 2,\n  PAYLOADLENGTH_64: 3,\n  READ_DATA: 4\n}\n\nconst emptyBuffer = Buffer.allocUnsafe(0)\n\nconst sendHints = {\n  string: 1,\n  typedArray: 2,\n  arrayBuffer: 3,\n  blob: 4\n}\n\nmodule.exports = {\n  uid,\n  sentCloseFrameState,\n  staticPropertyDescriptors,\n  states,\n  opcodes,\n  maxUnsigned16Bit,\n  parserStates,\n  emptyBuffer,\n  sendHints\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { kConstruct } = require('../../core/symbols')\nconst { MessagePort } = require('node:worker_threads')\n\n/**\n * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent\n */\nclass MessageEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict = {}) {\n    if (type === kConstruct) {\n      super(arguments[1], arguments[2])\n      webidl.util.markAsUncloneable(this)\n      return\n    }\n\n    const prefix = 'MessageEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')\n\n    super(type, eventInitDict)\n\n    this.#eventInit = eventInitDict\n    webidl.util.markAsUncloneable(this)\n  }\n\n  get data () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.data\n  }\n\n  get origin () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.origin\n  }\n\n  get lastEventId () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.lastEventId\n  }\n\n  get source () {\n    webidl.brandCheck(this, MessageEvent)\n\n    return this.#eventInit.source\n  }\n\n  get ports () {\n    webidl.brandCheck(this, MessageEvent)\n\n    if (!Object.isFrozen(this.#eventInit.ports)) {\n      Object.freeze(this.#eventInit.ports)\n    }\n\n    return this.#eventInit.ports\n  }\n\n  initMessageEvent (\n    type,\n    bubbles = false,\n    cancelable = false,\n    data = null,\n    origin = '',\n    lastEventId = '',\n    source = null,\n    ports = []\n  ) {\n    webidl.brandCheck(this, MessageEvent)\n\n    webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')\n\n    return new MessageEvent(type, {\n      bubbles, cancelable, data, origin, lastEventId, source, ports\n    })\n  }\n\n  static createFastMessageEvent (type, init) {\n    const messageEvent = new MessageEvent(kConstruct, type, init)\n    messageEvent.#eventInit = init\n    messageEvent.#eventInit.data ??= null\n    messageEvent.#eventInit.origin ??= ''\n    messageEvent.#eventInit.lastEventId ??= ''\n    messageEvent.#eventInit.source ??= null\n    messageEvent.#eventInit.ports ??= []\n    return messageEvent\n  }\n}\n\nconst { createFastMessageEvent } = MessageEvent\ndelete MessageEvent.createFastMessageEvent\n\n/**\n * @see https://websockets.spec.whatwg.org/#the-closeevent-interface\n */\nclass CloseEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict = {}) {\n    const prefix = 'CloseEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.CloseEventInit(eventInitDict)\n\n    super(type, eventInitDict)\n\n    this.#eventInit = eventInitDict\n    webidl.util.markAsUncloneable(this)\n  }\n\n  get wasClean () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.wasClean\n  }\n\n  get code () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.code\n  }\n\n  get reason () {\n    webidl.brandCheck(this, CloseEvent)\n\n    return this.#eventInit.reason\n  }\n}\n\n// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface\nclass ErrorEvent extends Event {\n  #eventInit\n\n  constructor (type, eventInitDict) {\n    const prefix = 'ErrorEvent constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    super(type, eventInitDict)\n    webidl.util.markAsUncloneable(this)\n\n    type = webidl.converters.DOMString(type, prefix, 'type')\n    eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})\n\n    this.#eventInit = eventInitDict\n  }\n\n  get message () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.message\n  }\n\n  get filename () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.filename\n  }\n\n  get lineno () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.lineno\n  }\n\n  get colno () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.colno\n  }\n\n  get error () {\n    webidl.brandCheck(this, ErrorEvent)\n\n    return this.#eventInit.error\n  }\n}\n\nObject.defineProperties(MessageEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'MessageEvent',\n    configurable: true\n  },\n  data: kEnumerableProperty,\n  origin: kEnumerableProperty,\n  lastEventId: kEnumerableProperty,\n  source: kEnumerableProperty,\n  ports: kEnumerableProperty,\n  initMessageEvent: kEnumerableProperty\n})\n\nObject.defineProperties(CloseEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'CloseEvent',\n    configurable: true\n  },\n  reason: kEnumerableProperty,\n  code: kEnumerableProperty,\n  wasClean: kEnumerableProperty\n})\n\nObject.defineProperties(ErrorEvent.prototype, {\n  [Symbol.toStringTag]: {\n    value: 'ErrorEvent',\n    configurable: true\n  },\n  message: kEnumerableProperty,\n  filename: kEnumerableProperty,\n  lineno: kEnumerableProperty,\n  colno: kEnumerableProperty,\n  error: kEnumerableProperty\n})\n\nwebidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.MessagePort\n)\n\nconst eventInit = [\n  {\n    key: 'bubbles',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'cancelable',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'composed',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  }\n]\n\nwebidl.converters.MessageEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'data',\n    converter: webidl.converters.any,\n    defaultValue: () => null\n  },\n  {\n    key: 'origin',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'lastEventId',\n    converter: webidl.converters.DOMString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'source',\n    // Node doesn't implement WindowProxy or ServiceWorker, so the only\n    // valid value for source is a MessagePort.\n    converter: webidl.nullableConverter(webidl.converters.MessagePort),\n    defaultValue: () => null\n  },\n  {\n    key: 'ports',\n    converter: webidl.converters['sequence'],\n    defaultValue: () => new Array(0)\n  }\n])\n\nwebidl.converters.CloseEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'wasClean',\n    converter: webidl.converters.boolean,\n    defaultValue: () => false\n  },\n  {\n    key: 'code',\n    converter: webidl.converters['unsigned short'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'reason',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  }\n])\n\nwebidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n  ...eventInit,\n  {\n    key: 'message',\n    converter: webidl.converters.DOMString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'filename',\n    converter: webidl.converters.USVString,\n    defaultValue: () => ''\n  },\n  {\n    key: 'lineno',\n    converter: webidl.converters['unsigned long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'colno',\n    converter: webidl.converters['unsigned long'],\n    defaultValue: () => 0\n  },\n  {\n    key: 'error',\n    converter: webidl.converters.any\n  }\n])\n\nmodule.exports = {\n  MessageEvent,\n  CloseEvent,\n  ErrorEvent,\n  createFastMessageEvent\n}\n","'use strict'\n\nconst { maxUnsigned16Bit } = require('./constants')\n\nconst BUFFER_SIZE = 16386\n\n/** @type {import('crypto')} */\nlet crypto\nlet buffer = null\nlet bufIdx = BUFFER_SIZE\n\ntry {\n  crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n  crypto = {\n    // not full compatibility, but minimum.\n    randomFillSync: function randomFillSync (buffer, _offset, _size) {\n      for (let i = 0; i < buffer.length; ++i) {\n        buffer[i] = Math.random() * 255 | 0\n      }\n      return buffer\n    }\n  }\n}\n\nfunction generateMask () {\n  if (bufIdx === BUFFER_SIZE) {\n    bufIdx = 0\n    crypto.randomFillSync((buffer ??= Buffer.allocUnsafe(BUFFER_SIZE)), 0, BUFFER_SIZE)\n  }\n  return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]\n}\n\nclass WebsocketFrameSend {\n  /**\n   * @param {Buffer|undefined} data\n   */\n  constructor (data) {\n    this.frameData = data\n  }\n\n  createFrame (opcode) {\n    const frameData = this.frameData\n    const maskKey = generateMask()\n    const bodyLength = frameData?.byteLength ?? 0\n\n    /** @type {number} */\n    let payloadLength = bodyLength // 0-125\n    let offset = 6\n\n    if (bodyLength > maxUnsigned16Bit) {\n      offset += 8 // payload length is next 8 bytes\n      payloadLength = 127\n    } else if (bodyLength > 125) {\n      offset += 2 // payload length is next 2 bytes\n      payloadLength = 126\n    }\n\n    const buffer = Buffer.allocUnsafe(bodyLength + offset)\n\n    // Clear first 2 bytes, everything else is overwritten\n    buffer[0] = buffer[1] = 0\n    buffer[0] |= 0x80 // FIN\n    buffer[0] = (buffer[0] & 0xF0) + opcode // opcode\n\n    /*! ws. MIT License. Einar Otto Stangvik  */\n    buffer[offset - 4] = maskKey[0]\n    buffer[offset - 3] = maskKey[1]\n    buffer[offset - 2] = maskKey[2]\n    buffer[offset - 1] = maskKey[3]\n\n    buffer[1] = payloadLength\n\n    if (payloadLength === 126) {\n      buffer.writeUInt16BE(bodyLength, 2)\n    } else if (payloadLength === 127) {\n      // Clear extended payload length\n      buffer[2] = buffer[3] = 0\n      buffer.writeUIntBE(bodyLength, 4, 6)\n    }\n\n    buffer[1] |= 0x80 // MASK\n\n    // mask body\n    for (let i = 0; i < bodyLength; ++i) {\n      buffer[offset + i] = frameData[i] ^ maskKey[i & 3]\n    }\n\n    return buffer\n  }\n}\n\nmodule.exports = {\n  WebsocketFrameSend\n}\n","'use strict'\n\nconst { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require('node:zlib')\nconst { isValidClientWindowBits } = require('./util')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nconst tail = Buffer.from([0x00, 0x00, 0xff, 0xff])\nconst kBuffer = Symbol('kBuffer')\nconst kLength = Symbol('kLength')\n\nclass PerMessageDeflate {\n  /** @type {import('node:zlib').InflateRaw} */\n  #inflate\n\n  #options = {}\n\n  #maxPayloadSize = 0\n\n  /**\n   * @param {Map} extensions\n   */\n  constructor (extensions, options) {\n    this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')\n    this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')\n\n    this.#maxPayloadSize = options.maxPayloadSize\n  }\n\n  /**\n   * Decompress a compressed payload.\n   * @param {Buffer} chunk Compressed data\n   * @param {boolean} fin Final fragment flag\n   * @param {Function} callback Callback function\n   */\n  decompress (chunk, fin, callback) {\n    // An endpoint uses the following algorithm to decompress a message.\n    // 1.  Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the\n    //     payload of the message.\n    // 2.  Decompress the resulting data using DEFLATE.\n    if (!this.#inflate) {\n      let windowBits = Z_DEFAULT_WINDOWBITS\n\n      if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS\n        if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {\n          callback(new Error('Invalid server_max_window_bits'))\n          return\n        }\n\n        windowBits = Number.parseInt(this.#options.serverMaxWindowBits)\n      }\n\n      try {\n        this.#inflate = createInflateRaw({ windowBits })\n      } catch (err) {\n        callback(err)\n        return\n      }\n      this.#inflate[kBuffer] = []\n      this.#inflate[kLength] = 0\n\n      this.#inflate.on('data', (data) => {\n        this.#inflate[kLength] += data.length\n\n        if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {\n          callback(new MessageSizeExceededError())\n          this.#inflate.removeAllListeners()\n          this.#inflate = null\n          return\n        }\n\n        this.#inflate[kBuffer].push(data)\n      })\n\n      this.#inflate.on('error', (err) => {\n        this.#inflate = null\n        callback(err)\n      })\n    }\n\n    this.#inflate.write(chunk)\n    if (fin) {\n      this.#inflate.write(tail)\n    }\n\n    this.#inflate.flush(() => {\n      if (!this.#inflate) {\n        return\n      }\n\n      const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])\n\n      this.#inflate[kBuffer].length = 0\n      this.#inflate[kLength] = 0\n\n      callback(null, full)\n    })\n  }\n}\n\nmodule.exports = { PerMessageDeflate }\n","'use strict'\n\nconst { Writable } = require('node:stream')\nconst assert = require('node:assert')\nconst { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require('./constants')\nconst { kReadyState, kSentClose, kResponse, kReceivedClose } = require('./symbols')\nconst { channels } = require('../../core/diagnostics')\nconst {\n  isValidStatusCode,\n  isValidOpcode,\n  failWebsocketConnection,\n  websocketMessageReceived,\n  utf8Decode,\n  isControlFrame,\n  isTextBinaryFrame,\n  isContinuationFrame\n} = require('./util')\nconst { WebsocketFrameSend } = require('./frame')\nconst { closeWebSocketConnection } = require('./connection')\nconst { PerMessageDeflate } = require('./permessage-deflate')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nfunction failWebsocketConnectionWithCode (ws, code, reason) {\n  closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason))\n  failWebsocketConnection(ws, reason)\n}\n\n// This code was influenced by ws released under the MIT license.\n// Copyright (c) 2011 Einar Otto Stangvik \n// Copyright (c) 2013 Arnout Kazemier and contributors\n// Copyright (c) 2016 Luigi Pinca and contributors\n\nclass ByteParser extends Writable {\n  #buffers = []\n  #fragmentsBytes = 0\n  #byteOffset = 0\n  #loop = false\n\n  #state = parserStates.INFO\n\n  #info = {}\n  #fragments = []\n\n  /** @type {Map} */\n  #extensions\n\n  /** @type {number} */\n  #maxFragments\n\n  /** @type {number} */\n  #maxPayloadSize\n\n  /**\n   * @param {import('./websocket').WebSocket} ws\n   * @param {Map|null} extensions\n   * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]\n   */\n  constructor (ws, extensions, options = {}) {\n    super()\n\n    this.ws = ws\n    this.#extensions = extensions == null ? new Map() : extensions\n    this.#maxFragments = options.maxFragments ?? 0\n    this.#maxPayloadSize = options.maxPayloadSize ?? 0\n\n    if (this.#extensions.has('permessage-deflate')) {\n      this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))\n    }\n  }\n\n  /**\n   * @param {Buffer} chunk\n   * @param {() => void} callback\n   */\n  _write (chunk, _, callback) {\n    this.#buffers.push(chunk)\n    this.#byteOffset += chunk.length\n    this.#loop = true\n\n    this.run(callback)\n  }\n\n  #validatePayloadLength () {\n    if (\n      this.#maxPayloadSize > 0 &&\n      !isControlFrame(this.#info.opcode) &&\n      this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize\n    ) {\n      failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size')\n      return false\n    }\n\n    return true\n  }\n\n  /**\n   * Runs whenever a new chunk is received.\n   * Callback is called whenever there are no more chunks buffering,\n   * or not enough bytes are buffered to parse.\n   */\n  run (callback) {\n    while (this.#loop) {\n      if (this.#state === parserStates.INFO) {\n        // If there aren't enough bytes to parse the payload length, etc.\n        if (this.#byteOffset < 2) {\n          return callback()\n        }\n\n        const buffer = this.consume(2)\n        const fin = (buffer[0] & 0x80) !== 0\n        const opcode = buffer[0] & 0x0F\n        const masked = (buffer[1] & 0x80) === 0x80\n\n        const fragmented = !fin && opcode !== opcodes.CONTINUATION\n        const payloadLength = buffer[1] & 0x7F\n\n        const rsv1 = buffer[0] & 0x40\n        const rsv2 = buffer[0] & 0x20\n        const rsv3 = buffer[0] & 0x10\n\n        if (!isValidOpcode(opcode)) {\n          failWebsocketConnection(this.ws, 'Invalid opcode received')\n          return callback()\n        }\n\n        if (masked) {\n          failWebsocketConnection(this.ws, 'Frame cannot be masked')\n          return callback()\n        }\n\n        // MUST be 0 unless an extension is negotiated that defines meanings\n        // for non-zero values.  If a nonzero value is received and none of\n        // the negotiated extensions defines the meaning of such a nonzero\n        // value, the receiving endpoint MUST _Fail the WebSocket\n        // Connection_.\n        // This document allocates the RSV1 bit of the WebSocket header for\n        // PMCEs and calls the bit the \"Per-Message Compressed\" bit.  On a\n        // WebSocket connection where a PMCE is in use, this bit indicates\n        // whether a message is compressed or not.\n        if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {\n          failWebsocketConnection(this.ws, 'Expected RSV1 to be clear.')\n          return\n        }\n\n        if (rsv2 !== 0 || rsv3 !== 0) {\n          failWebsocketConnection(this.ws, 'RSV1, RSV2, RSV3 must be clear')\n          return\n        }\n\n        if (fragmented && !isTextBinaryFrame(opcode)) {\n          // Only text and binary frames can be fragmented\n          failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')\n          return\n        }\n\n        // If we are already parsing a text/binary frame and do not receive either\n        // a continuation frame or close frame, fail the connection.\n        if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {\n          failWebsocketConnection(this.ws, 'Expected continuation frame')\n          return\n        }\n\n        if (this.#info.fragmented && fragmented) {\n          // A fragmented frame can't be fragmented itself\n          failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')\n          return\n        }\n\n        // \"All control frames MUST have a payload length of 125 bytes or less\n        // and MUST NOT be fragmented.\"\n        if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {\n          failWebsocketConnection(this.ws, 'Control frame either too large or fragmented')\n          return\n        }\n\n        if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {\n          failWebsocketConnection(this.ws, 'Unexpected continuation frame')\n          return\n        }\n\n        if (payloadLength <= 125) {\n          this.#info.payloadLength = payloadLength\n          this.#state = parserStates.READ_DATA\n\n          if (!this.#validatePayloadLength()) {\n            return\n          }\n        } else if (payloadLength === 126) {\n          this.#state = parserStates.PAYLOADLENGTH_16\n        } else if (payloadLength === 127) {\n          this.#state = parserStates.PAYLOADLENGTH_64\n        }\n\n        if (isTextBinaryFrame(opcode)) {\n          this.#info.binaryType = opcode\n          this.#info.compressed = rsv1 !== 0\n        }\n\n        this.#info.opcode = opcode\n        this.#info.masked = masked\n        this.#info.fin = fin\n        this.#info.fragmented = fragmented\n      } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n        if (this.#byteOffset < 2) {\n          return callback()\n        }\n\n        const buffer = this.consume(2)\n\n        this.#info.payloadLength = buffer.readUInt16BE(0)\n        this.#state = parserStates.READ_DATA\n\n        if (!this.#validatePayloadLength()) {\n          return\n        }\n      } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n        if (this.#byteOffset < 8) {\n          return callback()\n        }\n\n        const buffer = this.consume(8)\n        const upper = buffer.readUInt32BE(0)\n        const lower = buffer.readUInt32BE(4)\n\n        // 2^31 is the maximum bytes an arraybuffer can contain\n        // on 32-bit systems. Although, on 64-bit systems, this is\n        // 2^53-1 bytes.\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n        // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n        // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n        if (upper !== 0 || lower > 2 ** 31 - 1) {\n          failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')\n          return\n        }\n\n        this.#info.payloadLength = lower\n        this.#state = parserStates.READ_DATA\n\n        if (!this.#validatePayloadLength()) {\n          return\n        }\n      } else if (this.#state === parserStates.READ_DATA) {\n        if (this.#byteOffset < this.#info.payloadLength) {\n          return callback()\n        }\n\n        const body = this.consume(this.#info.payloadLength)\n\n        if (isControlFrame(this.#info.opcode)) {\n          this.#loop = this.parseControlFrame(body)\n          this.#state = parserStates.INFO\n        } else {\n          if (!this.#info.compressed) {\n            if (!this.writeFragments(body)) {\n              return\n            }\n\n            if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n              failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n              return\n            }\n\n            // If the frame is not fragmented, a message has been received.\n            // If the frame is fragmented, it will terminate with a fin bit set\n            // and an opcode of 0 (continuation), therefore we handle that when\n            // parsing continuation frames, not here.\n            if (!this.#info.fragmented && this.#info.fin) {\n              websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n            }\n\n            this.#state = parserStates.INFO\n          } else {\n            this.#extensions.get('permessage-deflate').decompress(\n              body,\n              this.#info.fin,\n              (error, data) => {\n                if (error) {\n                  const code = error instanceof MessageSizeExceededError ? 1009 : 1007\n                  failWebsocketConnectionWithCode(this.ws, code, error.message)\n                  return\n                }\n\n                if (!this.writeFragments(data)) {\n                  return\n                }\n\n                if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n                  failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)\n                  return\n                }\n\n                if (!this.#info.fin) {\n                  this.#state = parserStates.INFO\n                  this.#loop = true\n                  this.run(callback)\n                  return\n                }\n\n                websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n\n                this.#loop = true\n                this.#state = parserStates.INFO\n                this.run(callback)\n              }\n            )\n\n            this.#loop = false\n            break\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * Take n bytes from the buffered Buffers\n   * @param {number} n\n   * @returns {Buffer}\n   */\n  consume (n) {\n    if (n > this.#byteOffset) {\n      throw new Error('Called consume() before buffers satiated.')\n    } else if (n === 0) {\n      return emptyBuffer\n    }\n\n    if (this.#buffers[0].length === n) {\n      this.#byteOffset -= this.#buffers[0].length\n      return this.#buffers.shift()\n    }\n\n    const buffer = Buffer.allocUnsafe(n)\n    let offset = 0\n\n    while (offset !== n) {\n      const next = this.#buffers[0]\n      const { length } = next\n\n      if (length + offset === n) {\n        buffer.set(this.#buffers.shift(), offset)\n        break\n      } else if (length + offset > n) {\n        buffer.set(next.subarray(0, n - offset), offset)\n        this.#buffers[0] = next.subarray(n - offset)\n        break\n      } else {\n        buffer.set(this.#buffers.shift(), offset)\n        offset += next.length\n      }\n    }\n\n    this.#byteOffset -= n\n\n    return buffer\n  }\n\n  writeFragments (fragment) {\n    if (\n      this.#maxFragments > 0 &&\n      this.#fragments.length === this.#maxFragments\n    ) {\n      failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments')\n      return false\n    }\n\n    this.#fragmentsBytes += fragment.length\n    this.#fragments.push(fragment)\n    return true\n  }\n\n  consumeFragments () {\n    const fragments = this.#fragments\n\n    if (fragments.length === 1) {\n      this.#fragmentsBytes = 0\n      return fragments.shift()\n    }\n\n    const output = Buffer.concat(fragments, this.#fragmentsBytes)\n    this.#fragments = []\n    this.#fragmentsBytes = 0\n\n    return output\n  }\n\n  parseCloseBody (data) {\n    assert(data.length !== 1)\n\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n    /** @type {number|undefined} */\n    let code\n\n    if (data.length >= 2) {\n      // _The WebSocket Connection Close Code_ is\n      // defined as the status code (Section 7.4) contained in the first Close\n      // control frame received by the application\n      code = data.readUInt16BE(0)\n    }\n\n    if (code !== undefined && !isValidStatusCode(code)) {\n      return { code: 1002, reason: 'Invalid status code', error: true }\n    }\n\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6\n    /** @type {Buffer} */\n    let reason = data.subarray(2)\n\n    // Remove BOM\n    if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {\n      reason = reason.subarray(3)\n    }\n\n    try {\n      reason = utf8Decode(reason)\n    } catch {\n      return { code: 1007, reason: 'Invalid UTF-8', error: true }\n    }\n\n    return { code, reason, error: false }\n  }\n\n  /**\n   * Parses control frames.\n   * @param {Buffer} body\n   */\n  parseControlFrame (body) {\n    const { opcode, payloadLength } = this.#info\n\n    if (opcode === opcodes.CLOSE) {\n      if (payloadLength === 1) {\n        failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')\n        return false\n      }\n\n      this.#info.closeInfo = this.parseCloseBody(body)\n\n      if (this.#info.closeInfo.error) {\n        const { code, reason } = this.#info.closeInfo\n\n        closeWebSocketConnection(this.ws, code, reason, reason.length)\n        failWebsocketConnection(this.ws, reason)\n        return false\n      }\n\n      if (this.ws[kSentClose] !== sentCloseFrameState.SENT) {\n        // If an endpoint receives a Close frame and did not previously send a\n        // Close frame, the endpoint MUST send a Close frame in response.  (When\n        // sending a Close frame in response, the endpoint typically echos the\n        // status code it received.)\n        let body = emptyBuffer\n        if (this.#info.closeInfo.code) {\n          body = Buffer.allocUnsafe(2)\n          body.writeUInt16BE(this.#info.closeInfo.code, 0)\n        }\n        const closeFrame = new WebsocketFrameSend(body)\n\n        this.ws[kResponse].socket.write(\n          closeFrame.createFrame(opcodes.CLOSE),\n          (err) => {\n            if (!err) {\n              this.ws[kSentClose] = sentCloseFrameState.SENT\n            }\n          }\n        )\n      }\n\n      // Upon either sending or receiving a Close control frame, it is said\n      // that _The WebSocket Closing Handshake is Started_ and that the\n      // WebSocket connection is in the CLOSING state.\n      this.ws[kReadyState] = states.CLOSING\n      this.ws[kReceivedClose] = true\n\n      return false\n    } else if (opcode === opcodes.PING) {\n      // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n      // response, unless it already received a Close frame.\n      // A Pong frame sent in response to a Ping frame must have identical\n      // \"Application data\"\n\n      if (!this.ws[kReceivedClose]) {\n        const frame = new WebsocketFrameSend(body)\n\n        this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))\n\n        if (channels.ping.hasSubscribers) {\n          channels.ping.publish({\n            payload: body\n          })\n        }\n      }\n    } else if (opcode === opcodes.PONG) {\n      // A Pong frame MAY be sent unsolicited.  This serves as a\n      // unidirectional heartbeat.  A response to an unsolicited Pong frame is\n      // not expected.\n\n      if (channels.pong.hasSubscribers) {\n        channels.pong.publish({\n          payload: body\n        })\n      }\n    }\n\n    return true\n  }\n\n  get closingInfo () {\n    return this.#info.closeInfo\n  }\n}\n\nmodule.exports = {\n  ByteParser\n}\n","'use strict'\n\nconst { WebsocketFrameSend } = require('./frame')\nconst { opcodes, sendHints } = require('./constants')\nconst FixedQueue = require('../../dispatcher/fixed-queue')\n\n/** @type {typeof Uint8Array} */\nconst FastBuffer = Buffer[Symbol.species]\n\n/**\n * @typedef {object} SendQueueNode\n * @property {Promise | null} promise\n * @property {((...args: any[]) => any)} callback\n * @property {Buffer | null} frame\n */\n\nclass SendQueue {\n  /**\n   * @type {FixedQueue}\n   */\n  #queue = new FixedQueue()\n\n  /**\n   * @type {boolean}\n   */\n  #running = false\n\n  /** @type {import('node:net').Socket} */\n  #socket\n\n  constructor (socket) {\n    this.#socket = socket\n  }\n\n  add (item, cb, hint) {\n    if (hint !== sendHints.blob) {\n      const frame = createFrame(item, hint)\n      if (!this.#running) {\n        // fast-path\n        this.#socket.write(frame, cb)\n      } else {\n        /** @type {SendQueueNode} */\n        const node = {\n          promise: null,\n          callback: cb,\n          frame\n        }\n        this.#queue.push(node)\n      }\n      return\n    }\n\n    /** @type {SendQueueNode} */\n    const node = {\n      promise: item.arrayBuffer().then((ab) => {\n        node.promise = null\n        node.frame = createFrame(ab, hint)\n      }),\n      callback: cb,\n      frame: null\n    }\n\n    this.#queue.push(node)\n\n    if (!this.#running) {\n      this.#run()\n    }\n  }\n\n  async #run () {\n    this.#running = true\n    const queue = this.#queue\n    while (!queue.isEmpty()) {\n      const node = queue.shift()\n      // wait pending promise\n      if (node.promise !== null) {\n        await node.promise\n      }\n      // write\n      this.#socket.write(node.frame, node.callback)\n      // cleanup\n      node.callback = node.frame = null\n    }\n    this.#running = false\n  }\n}\n\nfunction createFrame (data, hint) {\n  return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY)\n}\n\nfunction toBuffer (data, hint) {\n  switch (hint) {\n    case sendHints.string:\n      return Buffer.from(data)\n    case sendHints.arrayBuffer:\n    case sendHints.blob:\n      return new FastBuffer(data)\n    case sendHints.typedArray:\n      return new FastBuffer(data.buffer, data.byteOffset, data.byteLength)\n  }\n}\n\nmodule.exports = { SendQueue }\n","'use strict'\n\nmodule.exports = {\n  kWebSocketURL: Symbol('url'),\n  kReadyState: Symbol('ready state'),\n  kController: Symbol('controller'),\n  kResponse: Symbol('response'),\n  kBinaryType: Symbol('binary type'),\n  kSentClose: Symbol('sent close'),\n  kReceivedClose: Symbol('received close'),\n  kByteParser: Symbol('byte parser')\n}\n","'use strict'\n\nconst { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require('./symbols')\nconst { states, opcodes } = require('./constants')\nconst { ErrorEvent, createFastMessageEvent } = require('./events')\nconst { isUtf8 } = require('node:buffer')\nconst { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require('../fetch/data-url')\n\n/* globals Blob */\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isConnecting (ws) {\n  // If the WebSocket connection is not yet established, and the connection\n  // is not yet closed, then the WebSocket connection is in the CONNECTING state.\n  return ws[kReadyState] === states.CONNECTING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isEstablished (ws) {\n  // If the server's response is validated as provided for above, it is\n  // said that _The WebSocket Connection is Established_ and that the\n  // WebSocket Connection is in the OPEN state.\n  return ws[kReadyState] === states.OPEN\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosing (ws) {\n  // Upon either sending or receiving a Close control frame, it is said\n  // that _The WebSocket Closing Handshake is Started_ and that the\n  // WebSocket connection is in the CLOSING state.\n  return ws[kReadyState] === states.CLOSING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosed (ws) {\n  return ws[kReadyState] === states.CLOSED\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e\n * @param {EventTarget} target\n * @param {(...args: ConstructorParameters) => Event} eventFactory\n * @param {EventInit | undefined} eventInitDict\n */\nfunction fireEvent (e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {\n  // 1. If eventConstructor is not given, then let eventConstructor be Event.\n\n  // 2. Let event be the result of creating an event given eventConstructor,\n  //    in the relevant realm of target.\n  // 3. Initialize event’s type attribute to e.\n  const event = eventFactory(e, eventInitDict)\n\n  // 4. Initialize any other IDL attributes of event as described in the\n  //    invocation of this algorithm.\n\n  // 5. Return the result of dispatching event at target, with legacy target\n  //    override flag set if set.\n  target.dispatchEvent(event)\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @param {import('./websocket').WebSocket} ws\n * @param {number} type Opcode\n * @param {Buffer} data application data\n */\nfunction websocketMessageReceived (ws, type, data) {\n  // 1. If ready state is not OPEN (1), then return.\n  if (ws[kReadyState] !== states.OPEN) {\n    return\n  }\n\n  // 2. Let dataForEvent be determined by switching on type and binary type:\n  let dataForEvent\n\n  if (type === opcodes.TEXT) {\n    // -> type indicates that the data is Text\n    //      a new DOMString containing data\n    try {\n      dataForEvent = utf8Decode(data)\n    } catch {\n      failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')\n      return\n    }\n  } else if (type === opcodes.BINARY) {\n    if (ws[kBinaryType] === 'blob') {\n      // -> type indicates that the data is Binary and binary type is \"blob\"\n      //      a new Blob object, created in the relevant Realm of the WebSocket\n      //      object, that represents data as its raw data\n      dataForEvent = new Blob([data])\n    } else {\n      // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n      //      a new ArrayBuffer object, created in the relevant Realm of the\n      //      WebSocket object, whose contents are data\n      dataForEvent = toArrayBuffer(data)\n    }\n  }\n\n  // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n  //    with the origin attribute initialized to the serialization of the WebSocket\n  //    object’s url's origin, and the data attribute initialized to dataForEvent.\n  fireEvent('message', ws, createFastMessageEvent, {\n    origin: ws[kWebSocketURL].origin,\n    data: dataForEvent\n  })\n}\n\nfunction toArrayBuffer (buffer) {\n  if (buffer.byteLength === buffer.buffer.byteLength) {\n    return buffer.buffer\n  }\n  return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455\n * @see https://datatracker.ietf.org/doc/html/rfc2616\n * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407\n * @param {string} protocol\n */\nfunction isValidSubprotocol (protocol) {\n  // If present, this value indicates one\n  // or more comma-separated subprotocol the client wishes to speak,\n  // ordered by preference.  The elements that comprise this value\n  // MUST be non-empty strings with characters in the range U+0021 to\n  // U+007E not including separator characters as defined in\n  // [RFC2616] and MUST all be unique strings.\n  if (protocol.length === 0) {\n    return false\n  }\n\n  for (let i = 0; i < protocol.length; ++i) {\n    const code = protocol.charCodeAt(i)\n\n    if (\n      code < 0x21 || // CTL, contains SP (0x20) and HT (0x09)\n      code > 0x7E ||\n      code === 0x22 || // \"\n      code === 0x28 || // (\n      code === 0x29 || // )\n      code === 0x2C || // ,\n      code === 0x2F || // /\n      code === 0x3A || // :\n      code === 0x3B || // ;\n      code === 0x3C || // <\n      code === 0x3D || // =\n      code === 0x3E || // >\n      code === 0x3F || // ?\n      code === 0x40 || // @\n      code === 0x5B || // [\n      code === 0x5C || // \\\n      code === 0x5D || // ]\n      code === 0x7B || // {\n      code === 0x7D // }\n    ) {\n      return false\n    }\n  }\n\n  return true\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4\n * @param {number} code\n */\nfunction isValidStatusCode (code) {\n  if (code >= 1000 && code < 1015) {\n    return (\n      code !== 1004 && // reserved\n      code !== 1005 && // \"MUST NOT be set as a status code\"\n      code !== 1006 // \"MUST NOT be set as a status code\"\n    )\n  }\n\n  return code >= 3000 && code <= 4999\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @param {string|undefined} reason\n */\nfunction failWebsocketConnection (ws, reason) {\n  const { [kController]: controller, [kResponse]: response } = ws\n\n  controller.abort()\n\n  if (response?.socket && !response.socket.destroyed) {\n    response.socket.destroy()\n  }\n\n  if (reason) {\n    // TODO: process.nextTick\n    fireEvent('error', ws, (type, init) => new ErrorEvent(type, init), {\n      error: new Error(reason),\n      message: reason\n    })\n  }\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5\n * @param {number} opcode\n */\nfunction isControlFrame (opcode) {\n  return (\n    opcode === opcodes.CLOSE ||\n    opcode === opcodes.PING ||\n    opcode === opcodes.PONG\n  )\n}\n\nfunction isContinuationFrame (opcode) {\n  return opcode === opcodes.CONTINUATION\n}\n\nfunction isTextBinaryFrame (opcode) {\n  return opcode === opcodes.TEXT || opcode === opcodes.BINARY\n}\n\nfunction isValidOpcode (opcode) {\n  return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode)\n}\n\n/**\n * Parses a Sec-WebSocket-Extensions header value.\n * @param {string} extensions\n * @returns {Map}\n */\n// TODO(@Uzlopak, @KhafraDev): make compliant https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\nfunction parseExtensions (extensions) {\n  const position = { position: 0 }\n  const extensionList = new Map()\n\n  while (position.position < extensions.length) {\n    const pair = collectASequenceOfCodePointsFast(';', extensions, position)\n    const [name, value = ''] = pair.split('=')\n\n    extensionList.set(\n      removeHTTPWhitespace(name, true, false),\n      removeHTTPWhitespace(value, false, true)\n    )\n\n    position.position++\n  }\n\n  return extensionList\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2\n * @description \"client-max-window-bits = 1*DIGIT\"\n * @param {string} value\n */\nfunction isValidClientWindowBits (value) {\n  // Must have at least one character\n  if (value.length === 0) {\n    return false\n  }\n\n  // Check all characters are ASCII digits\n  for (let i = 0; i < value.length; i++) {\n    const byte = value.charCodeAt(i)\n\n    if (byte < 0x30 || byte > 0x39) {\n      return false\n    }\n  }\n\n  // Check numeric range: zlib requires windowBits in range 8-15\n  const num = Number.parseInt(value, 10)\n  return num >= 8 && num <= 15\n}\n\n// https://nodejs.org/api/intl.html#detecting-internationalization-support\nconst hasIntl = typeof process.versions.icu === 'string'\nconst fatalDecoder = hasIntl ? new TextDecoder('utf-8', { fatal: true }) : undefined\n\n/**\n * Converts a Buffer to utf-8, even on platforms without icu.\n * @param {Buffer} buffer\n */\nconst utf8Decode = hasIntl\n  ? fatalDecoder.decode.bind(fatalDecoder)\n  : function (buffer) {\n    if (isUtf8(buffer)) {\n      return buffer.toString('utf-8')\n    }\n    throw new TypeError('Invalid utf-8 received.')\n  }\n\nmodule.exports = {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isClosed,\n  fireEvent,\n  isValidSubprotocol,\n  isValidStatusCode,\n  failWebsocketConnection,\n  websocketMessageReceived,\n  utf8Decode,\n  isControlFrame,\n  isContinuationFrame,\n  isTextBinaryFrame,\n  isValidOpcode,\n  parseExtensions,\n  isValidClientWindowBits\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { environmentSettingsObject } = require('../fetch/util')\nconst { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require('./constants')\nconst {\n  kWebSocketURL,\n  kReadyState,\n  kController,\n  kBinaryType,\n  kResponse,\n  kSentClose,\n  kByteParser\n} = require('./symbols')\nconst {\n  isConnecting,\n  isEstablished,\n  isClosing,\n  isValidSubprotocol,\n  fireEvent\n} = require('./util')\nconst { establishWebSocketConnection, closeWebSocketConnection } = require('./connection')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty, isBlobLike } = require('../../core/util')\nconst { getGlobalDispatcher } = require('../../global')\nconst { types } = require('node:util')\nconst { ErrorEvent, CloseEvent } = require('./events')\nconst { SendQueue } = require('./sender')\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n  #events = {\n    open: null,\n    error: null,\n    close: null,\n    message: null\n  }\n\n  #bufferedAmount = 0\n  #protocol = ''\n  #extensions = ''\n\n  /** @type {SendQueue} */\n  #sendQueue\n\n  /**\n   * @param {string} url\n   * @param {string|string[]} protocols\n   */\n  constructor (url, protocols = []) {\n    super()\n\n    webidl.util.markAsUncloneable(this)\n\n    const prefix = 'WebSocket constructor'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols, prefix, 'options')\n\n    url = webidl.converters.USVString(url, prefix, 'url')\n    protocols = options.protocols\n\n    // 1. Let baseURL be this's relevant settings object's API base URL.\n    const baseURL = environmentSettingsObject.settingsObject.baseUrl\n\n    // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.\n    let urlRecord\n\n    try {\n      urlRecord = new URL(url, baseURL)\n    } catch (e) {\n      // 3. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n      throw new DOMException(e, 'SyntaxError')\n    }\n\n    // 4. If urlRecord’s scheme is \"http\", then set urlRecord’s scheme to \"ws\".\n    if (urlRecord.protocol === 'http:') {\n      urlRecord.protocol = 'ws:'\n    } else if (urlRecord.protocol === 'https:') {\n      // 5. Otherwise, if urlRecord’s scheme is \"https\", set urlRecord’s scheme to \"wss\".\n      urlRecord.protocol = 'wss:'\n    }\n\n    // 6. If urlRecord’s scheme is not \"ws\" or \"wss\", then throw a \"SyntaxError\" DOMException.\n    if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {\n      throw new DOMException(\n        `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,\n        'SyntaxError'\n      )\n    }\n\n    // 7. If urlRecord’s fragment is non-null, then throw a \"SyntaxError\"\n    //    DOMException.\n    if (urlRecord.hash || urlRecord.href.endsWith('#')) {\n      throw new DOMException('Got fragment', 'SyntaxError')\n    }\n\n    // 8. If protocols is a string, set protocols to a sequence consisting\n    //    of just that string.\n    if (typeof protocols === 'string') {\n      protocols = [protocols]\n    }\n\n    // 9. If any of the values in protocols occur more than once or otherwise\n    //    fail to match the requirements for elements that comprise the value\n    //    of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n    //    protocol, then throw a \"SyntaxError\" DOMException.\n    if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n      throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n    }\n\n    // 10. Set this's url to urlRecord.\n    this[kWebSocketURL] = new URL(urlRecord.href)\n\n    // 11. Let client be this's relevant settings object.\n    const client = environmentSettingsObject.settingsObject\n\n    // 12. Run this step in parallel:\n\n    //    1. Establish a WebSocket connection given urlRecord, protocols,\n    //       and client.\n    this[kController] = establishWebSocketConnection(\n      urlRecord,\n      protocols,\n      client,\n      this,\n      (response, extensions) => this.#onConnectionEstablished(response, extensions),\n      options\n    )\n\n    // Each WebSocket object has an associated ready state, which is a\n    // number representing the state of the connection. Initially it must\n    // be CONNECTING (0).\n    this[kReadyState] = WebSocket.CONNECTING\n\n    this[kSentClose] = sentCloseFrameState.NOT_SENT\n\n    // The extensions attribute must initially return the empty string.\n\n    // The protocol attribute must initially return the empty string.\n\n    // Each WebSocket object has an associated binary type, which is a\n    // BinaryType. Initially it must be \"blob\".\n    this[kBinaryType] = 'blob'\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n   * @param {number|undefined} code\n   * @param {string|undefined} reason\n   */\n  close (code = undefined, reason = undefined) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.close'\n\n    if (code !== undefined) {\n      code = webidl.converters['unsigned short'](code, prefix, 'code', { clamp: true })\n    }\n\n    if (reason !== undefined) {\n      reason = webidl.converters.USVString(reason, prefix, 'reason')\n    }\n\n    // 1. If code is present, but is neither an integer equal to 1000 nor an\n    //    integer in the range 3000 to 4999, inclusive, throw an\n    //    \"InvalidAccessError\" DOMException.\n    if (code !== undefined) {\n      if (code !== 1000 && (code < 3000 || code > 4999)) {\n        throw new DOMException('invalid code', 'InvalidAccessError')\n      }\n    }\n\n    let reasonByteLength = 0\n\n    // 2. If reason is present, then run these substeps:\n    if (reason !== undefined) {\n      // 1. Let reasonBytes be the result of encoding reason.\n      // 2. If reasonBytes is longer than 123 bytes, then throw a\n      //    \"SyntaxError\" DOMException.\n      reasonByteLength = Buffer.byteLength(reason)\n\n      if (reasonByteLength > 123) {\n        throw new DOMException(\n          `Reason must be less than 123 bytes; received ${reasonByteLength}`,\n          'SyntaxError'\n        )\n      }\n    }\n\n    // 3. Run the first matching steps from the following list:\n    closeWebSocketConnection(this, code, reason, reasonByteLength)\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n   * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n   */\n  send (data) {\n    webidl.brandCheck(this, WebSocket)\n\n    const prefix = 'WebSocket.send'\n    webidl.argumentLengthCheck(arguments, 1, prefix)\n\n    data = webidl.converters.WebSocketSendData(data, prefix, 'data')\n\n    // 1. If this's ready state is CONNECTING, then throw an\n    //    \"InvalidStateError\" DOMException.\n    if (isConnecting(this)) {\n      throw new DOMException('Sent before connected.', 'InvalidStateError')\n    }\n\n    // 2. Run the appropriate set of steps from the following list:\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n    if (!isEstablished(this) || isClosing(this)) {\n      return\n    }\n\n    // If data is a string\n    if (typeof data === 'string') {\n      // If the WebSocket connection is established and the WebSocket\n      // closing handshake has not yet started, then the user agent\n      // must send a WebSocket Message comprised of the data argument\n      // using a text frame opcode; if the data cannot be sent, e.g.\n      // because it would need to be buffered but the buffer is full,\n      // the user agent must flag the WebSocket as full and then close\n      // the WebSocket connection. Any invocation of this method with a\n      // string argument that does not throw an exception must increase\n      // the bufferedAmount attribute by the number of bytes needed to\n      // express the argument as UTF-8.\n\n      const length = Buffer.byteLength(data)\n\n      this.#bufferedAmount += length\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= length\n      }, sendHints.string)\n    } else if (types.isArrayBuffer(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need\n      // to be buffered but the buffer is full, the user agent must flag\n      // the WebSocket as full and then close the WebSocket connection.\n      // The data to be sent is the data stored in the buffer described\n      // by the ArrayBuffer object. Any invocation of this method with an\n      // ArrayBuffer argument that does not throw an exception must\n      // increase the bufferedAmount attribute by the length of the\n      // ArrayBuffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.arrayBuffer)\n    } else if (ArrayBuffer.isView(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The\n      // data to be sent is the data stored in the section of the buffer\n      // described by the ArrayBuffer object that data references. Any\n      // invocation of this method with this kind of argument that does\n      // not throw an exception must increase the bufferedAmount attribute\n      // by the length of data’s buffer in bytes.\n\n      this.#bufferedAmount += data.byteLength\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.byteLength\n      }, sendHints.typedArray)\n    } else if (isBlobLike(data)) {\n      // If the WebSocket connection is established, and the WebSocket\n      // closing handshake has not yet started, then the user agent must\n      // send a WebSocket Message comprised of data using a binary frame\n      // opcode; if the data cannot be sent, e.g. because it would need to\n      // be buffered but the buffer is full, the user agent must flag the\n      // WebSocket as full and then close the WebSocket connection. The data\n      // to be sent is the raw data represented by the Blob object. Any\n      // invocation of this method with a Blob argument that does not throw\n      // an exception must increase the bufferedAmount attribute by the size\n      // of the Blob object’s raw data, in bytes.\n\n      this.#bufferedAmount += data.size\n      this.#sendQueue.add(data, () => {\n        this.#bufferedAmount -= data.size\n      }, sendHints.blob)\n    }\n  }\n\n  get readyState () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The readyState getter steps are to return this's ready state.\n    return this[kReadyState]\n  }\n\n  get bufferedAmount () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#bufferedAmount\n  }\n\n  get url () {\n    webidl.brandCheck(this, WebSocket)\n\n    // The url getter steps are to return this's url, serialized.\n    return URLSerializer(this[kWebSocketURL])\n  }\n\n  get extensions () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#extensions\n  }\n\n  get protocol () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#protocol\n  }\n\n  get onopen () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.open\n  }\n\n  set onopen (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.open) {\n      this.removeEventListener('open', this.#events.open)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.open = fn\n      this.addEventListener('open', fn)\n    } else {\n      this.#events.open = null\n    }\n  }\n\n  get onerror () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.error\n  }\n\n  set onerror (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.error) {\n      this.removeEventListener('error', this.#events.error)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.error = fn\n      this.addEventListener('error', fn)\n    } else {\n      this.#events.error = null\n    }\n  }\n\n  get onclose () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.close\n  }\n\n  set onclose (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.close) {\n      this.removeEventListener('close', this.#events.close)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.close = fn\n      this.addEventListener('close', fn)\n    } else {\n      this.#events.close = null\n    }\n  }\n\n  get onmessage () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this.#events.message\n  }\n\n  set onmessage (fn) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (this.#events.message) {\n      this.removeEventListener('message', this.#events.message)\n    }\n\n    if (typeof fn === 'function') {\n      this.#events.message = fn\n      this.addEventListener('message', fn)\n    } else {\n      this.#events.message = null\n    }\n  }\n\n  get binaryType () {\n    webidl.brandCheck(this, WebSocket)\n\n    return this[kBinaryType]\n  }\n\n  set binaryType (type) {\n    webidl.brandCheck(this, WebSocket)\n\n    if (type !== 'blob' && type !== 'arraybuffer') {\n      this[kBinaryType] = 'blob'\n    } else {\n      this[kBinaryType] = type\n    }\n  }\n\n  /**\n   * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n   */\n  #onConnectionEstablished (response, parsedExtensions) {\n    // processResponse is called when the \"response's header list has been received and initialized.\"\n    // once this happens, the connection is open\n    this[kResponse] = response\n\n    const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions\n    const maxFragments = webSocketOptions?.maxFragments\n    const maxPayloadSize = webSocketOptions?.maxPayloadSize\n\n    const parser = new ByteParser(this, parsedExtensions, {\n      maxFragments,\n      maxPayloadSize\n    })\n    parser.on('drain', onParserDrain)\n    parser.on('error', onParserError.bind(this))\n\n    response.socket.ws = this\n    this[kByteParser] = parser\n\n    this.#sendQueue = new SendQueue(response.socket)\n\n    // 1. Change the ready state to OPEN (1).\n    this[kReadyState] = states.OPEN\n\n    // 2. Change the extensions attribute’s value to the extensions in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n    const extensions = response.headersList.get('sec-websocket-extensions')\n\n    if (extensions !== null) {\n      this.#extensions = extensions\n    }\n\n    // 3. Change the protocol attribute’s value to the subprotocol in use, if\n    //    it is not the null value.\n    // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n    const protocol = response.headersList.get('sec-websocket-protocol')\n\n    if (protocol !== null) {\n      this.#protocol = protocol\n    }\n\n    // 4. Fire an event named open at the WebSocket object.\n    fireEvent('open', this)\n  }\n}\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors,\n  url: kEnumerableProperty,\n  readyState: kEnumerableProperty,\n  bufferedAmount: kEnumerableProperty,\n  onopen: kEnumerableProperty,\n  onerror: kEnumerableProperty,\n  onclose: kEnumerableProperty,\n  close: kEnumerableProperty,\n  onmessage: kEnumerableProperty,\n  binaryType: kEnumerableProperty,\n  send: kEnumerableProperty,\n  extensions: kEnumerableProperty,\n  protocol: kEnumerableProperty,\n  [Symbol.toStringTag]: {\n    value: 'WebSocket',\n    writable: false,\n    enumerable: false,\n    configurable: true\n  }\n})\n\nObject.defineProperties(WebSocket, {\n  CONNECTING: staticPropertyDescriptors,\n  OPEN: staticPropertyDescriptors,\n  CLOSING: staticPropertyDescriptors,\n  CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n  webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence'] = function (V, prefix, argument) {\n  if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {\n    return webidl.converters['sequence'](V)\n  }\n\n  return webidl.converters.DOMString(V, prefix, argument)\n}\n\n// This implements the proposal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n  {\n    key: 'protocols',\n    converter: webidl.converters['DOMString or sequence'],\n    defaultValue: () => new Array(0)\n  },\n  {\n    key: 'dispatcher',\n    converter: webidl.converters.any,\n    defaultValue: () => getGlobalDispatcher()\n  },\n  {\n    key: 'headers',\n    converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n  }\n])\n\nwebidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {\n  if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {\n    return webidl.converters.WebSocketInit(V)\n  }\n\n  return { protocols: webidl.converters['DOMString or sequence'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n  if (webidl.util.Type(V) === 'Object') {\n    if (isBlobLike(V)) {\n      return webidl.converters.Blob(V, { strict: false })\n    }\n\n    if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n      return webidl.converters.BufferSource(V)\n    }\n  }\n\n  return webidl.converters.USVString(V)\n}\n\nfunction onParserDrain () {\n  this.ws[kResponse].socket.resume()\n}\n\nfunction onParserError (err) {\n  let message\n  let code\n\n  if (err instanceof CloseEvent) {\n    message = err.reason\n    code = err.code\n  } else {\n    message = err.message\n  }\n\n  fireEvent('error', this, () => new ErrorEvent('error', { error: err, message }))\n\n  closeWebSocketConnection(this, code)\n}\n\nmodule.exports = {\n  WebSocket\n}\n","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"https\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:assert\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:async_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:buffer\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:console\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:crypto\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:diagnostics_channel\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:dns\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:events\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:fs/promises\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:http2\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:net\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:path\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:perf_hooks\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:querystring\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:url\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:util/types\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:worker_threads\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:zlib\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"string_decoder\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"tls\");","module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\\/\\/\\/\\w:/) ? 1 : 0, -1) + \"/\";","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"os\");","// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nexport function toCommandValue(input) {\n    if (input === null || input === undefined) {\n        return '';\n    }\n    else if (typeof input === 'string' || input instanceof String) {\n        return input;\n    }\n    return JSON.stringify(input);\n}\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nexport function toCommandProperties(annotationProperties) {\n    if (!Object.keys(annotationProperties).length) {\n        return {};\n    }\n    return {\n        title: annotationProperties.title,\n        file: annotationProperties.file,\n        line: annotationProperties.startLine,\n        endLine: annotationProperties.endLine,\n        col: annotationProperties.startColumn,\n        endColumn: annotationProperties.endColumn\n    };\n}\n//# sourceMappingURL=utils.js.map","import * as os from 'os';\nimport { toCommandValue } from './utils.js';\n/**\n * Issues a command to the GitHub Actions runner\n *\n * @param command - The command name to issue\n * @param properties - Additional properties for the command (key-value pairs)\n * @param message - The message to include with the command\n * @remarks\n * This function outputs a specially formatted string to stdout that the Actions\n * runner interprets as a command. These commands can control workflow behavior,\n * set outputs, create annotations, mask values, and more.\n *\n * Command Format:\n *   ::name key=value,key=value::message\n *\n * @example\n * ```typescript\n * // Issue a warning annotation\n * issueCommand('warning', {}, 'This is a warning message');\n * // Output: ::warning::This is a warning message\n *\n * // Set an environment variable\n * issueCommand('set-env', { name: 'MY_VAR' }, 'some value');\n * // Output: ::set-env name=MY_VAR::some value\n *\n * // Add a secret mask\n * issueCommand('add-mask', {}, 'secretValue123');\n * // Output: ::add-mask::secretValue123\n * ```\n *\n * @internal\n * This is an internal utility function that powers the public API functions\n * such as setSecret, warning, error, and exportVariable.\n */\nexport function issueCommand(command, properties, message) {\n    const cmd = new Command(command, properties, message);\n    process.stdout.write(cmd.toString() + os.EOL);\n}\nexport function issue(name, message = '') {\n    issueCommand(name, {}, message);\n}\nconst CMD_STRING = '::';\nclass Command {\n    constructor(command, properties, message) {\n        if (!command) {\n            command = 'missing.command';\n        }\n        this.command = command;\n        this.properties = properties;\n        this.message = message;\n    }\n    toString() {\n        let cmdStr = CMD_STRING + this.command;\n        if (this.properties && Object.keys(this.properties).length > 0) {\n            cmdStr += ' ';\n            let first = true;\n            for (const key in this.properties) {\n                if (this.properties.hasOwnProperty(key)) {\n                    const val = this.properties[key];\n                    if (val) {\n                        if (first) {\n                            first = false;\n                        }\n                        else {\n                            cmdStr += ',';\n                        }\n                        cmdStr += `${key}=${escapeProperty(val)}`;\n                    }\n                }\n            }\n        }\n        cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n        return cmdStr;\n    }\n}\nfunction escapeData(s) {\n    return toCommandValue(s)\n        .replace(/%/g, '%25')\n        .replace(/\\r/g, '%0D')\n        .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n    return toCommandValue(s)\n        .replace(/%/g, '%25')\n        .replace(/\\r/g, '%0D')\n        .replace(/\\n/g, '%0A')\n        .replace(/:/g, '%3A')\n        .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"crypto\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"fs\");","// For internal use, subject to change.\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as crypto from 'crypto';\nimport * as fs from 'fs';\nimport * as os from 'os';\nimport { toCommandValue } from './utils.js';\nexport function issueFileCommand(command, message) {\n    const filePath = process.env[`GITHUB_${command}`];\n    if (!filePath) {\n        throw new Error(`Unable to find environment variable for file command ${command}`);\n    }\n    if (!fs.existsSync(filePath)) {\n        throw new Error(`Missing file at path: ${filePath}`);\n    }\n    fs.appendFileSync(filePath, `${toCommandValue(message)}${os.EOL}`, {\n        encoding: 'utf8'\n    });\n}\nexport function prepareKeyValueMessage(key, value) {\n    const delimiter = `ghadelimiter_${crypto.randomUUID()}`;\n    const convertedValue = toCommandValue(value);\n    // These should realistically never happen, but just in case someone finds a\n    // way to exploit uuid generation let's not allow keys or values that contain\n    // the delimiter.\n    if (key.includes(delimiter)) {\n        throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n    }\n    if (convertedValue.includes(delimiter)) {\n        throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n    }\n    return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\n//# sourceMappingURL=file-command.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"path\");","export function getProxyUrl(reqUrl) {\n    const usingSsl = reqUrl.protocol === 'https:';\n    if (checkBypass(reqUrl)) {\n        return undefined;\n    }\n    const proxyVar = (() => {\n        if (usingSsl) {\n            return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n        }\n        else {\n            return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n        }\n    })();\n    if (proxyVar) {\n        try {\n            return new DecodedURL(proxyVar);\n        }\n        catch (_a) {\n            if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))\n                return new DecodedURL(`http://${proxyVar}`);\n        }\n    }\n    else {\n        return undefined;\n    }\n}\nexport function checkBypass(reqUrl) {\n    if (!reqUrl.hostname) {\n        return false;\n    }\n    const reqHost = reqUrl.hostname;\n    if (isLoopbackAddress(reqHost)) {\n        return true;\n    }\n    const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n    if (!noProxy) {\n        return false;\n    }\n    // Determine the request port\n    let reqPort;\n    if (reqUrl.port) {\n        reqPort = Number(reqUrl.port);\n    }\n    else if (reqUrl.protocol === 'http:') {\n        reqPort = 80;\n    }\n    else if (reqUrl.protocol === 'https:') {\n        reqPort = 443;\n    }\n    // Format the request hostname and hostname with port\n    const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n    if (typeof reqPort === 'number') {\n        upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n    }\n    // Compare request host against noproxy\n    for (const upperNoProxyItem of noProxy\n        .split(',')\n        .map(x => x.trim().toUpperCase())\n        .filter(x => x)) {\n        if (upperNoProxyItem === '*' ||\n            upperReqHosts.some(x => x === upperNoProxyItem ||\n                x.endsWith(`.${upperNoProxyItem}`) ||\n                (upperNoProxyItem.startsWith('.') &&\n                    x.endsWith(`${upperNoProxyItem}`)))) {\n            return true;\n        }\n    }\n    return false;\n}\nfunction isLoopbackAddress(host) {\n    const hostLower = host.toLowerCase();\n    return (hostLower === 'localhost' ||\n        hostLower.startsWith('127.') ||\n        hostLower.startsWith('[::1]') ||\n        hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\nclass DecodedURL extends URL {\n    constructor(url, base) {\n        super(url, base);\n        this._decodedUsername = decodeURIComponent(super.username);\n        this._decodedPassword = decodeURIComponent(super.password);\n    }\n    get username() {\n        return this._decodedUsername;\n    }\n    get password() {\n        return this._decodedPassword;\n    }\n}\n//# sourceMappingURL=proxy.js.map","/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as pm from './proxy.js';\nimport * as tunnel from 'tunnel';\nimport { ProxyAgent } from 'undici';\nexport var HttpCodes;\n(function (HttpCodes) {\n    HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n    HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n    HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n    HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n    HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n    HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n    HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n    HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n    HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n    HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n    HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n    HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n    HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n    HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n    HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n    HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n    HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n    HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n    HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n    HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n    HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n    HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n    HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n    HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n    HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n    HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n    HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes || (HttpCodes = {}));\nexport var Headers;\n(function (Headers) {\n    Headers[\"Accept\"] = \"accept\";\n    Headers[\"ContentType\"] = \"content-type\";\n})(Headers || (Headers = {}));\nexport var MediaTypes;\n(function (MediaTypes) {\n    MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes || (MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl  The server URL where the request will be sent. For example, https://api.github.com\n */\nexport function getProxyUrl(serverUrl) {\n    const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n    return proxyUrl ? proxyUrl.href : '';\n}\nconst HttpRedirectCodes = [\n    HttpCodes.MovedPermanently,\n    HttpCodes.ResourceMoved,\n    HttpCodes.SeeOther,\n    HttpCodes.TemporaryRedirect,\n    HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n    HttpCodes.BadGateway,\n    HttpCodes.ServiceUnavailable,\n    HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nexport class HttpClientError extends Error {\n    constructor(message, statusCode) {\n        super(message);\n        this.name = 'HttpClientError';\n        this.statusCode = statusCode;\n        Object.setPrototypeOf(this, HttpClientError.prototype);\n    }\n}\nexport class HttpClientResponse {\n    constructor(message) {\n        this.message = message;\n    }\n    readBody() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n                let output = Buffer.alloc(0);\n                this.message.on('data', (chunk) => {\n                    output = Buffer.concat([output, chunk]);\n                });\n                this.message.on('end', () => {\n                    resolve(output.toString());\n                });\n            }));\n        });\n    }\n    readBodyBuffer() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n                const chunks = [];\n                this.message.on('data', (chunk) => {\n                    chunks.push(chunk);\n                });\n                this.message.on('end', () => {\n                    resolve(Buffer.concat(chunks));\n                });\n            }));\n        });\n    }\n}\nexport function isHttps(requestUrl) {\n    const parsedUrl = new URL(requestUrl);\n    return parsedUrl.protocol === 'https:';\n}\nexport class HttpClient {\n    constructor(userAgent, handlers, requestOptions) {\n        this._ignoreSslError = false;\n        this._allowRedirects = true;\n        this._allowRedirectDowngrade = false;\n        this._maxRedirects = 50;\n        this._allowRetries = false;\n        this._maxRetries = 1;\n        this._keepAlive = false;\n        this._disposed = false;\n        this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);\n        this.handlers = handlers || [];\n        this.requestOptions = requestOptions;\n        if (requestOptions) {\n            if (requestOptions.ignoreSslError != null) {\n                this._ignoreSslError = requestOptions.ignoreSslError;\n            }\n            this._socketTimeout = requestOptions.socketTimeout;\n            if (requestOptions.allowRedirects != null) {\n                this._allowRedirects = requestOptions.allowRedirects;\n            }\n            if (requestOptions.allowRedirectDowngrade != null) {\n                this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n            }\n            if (requestOptions.maxRedirects != null) {\n                this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n            }\n            if (requestOptions.keepAlive != null) {\n                this._keepAlive = requestOptions.keepAlive;\n            }\n            if (requestOptions.allowRetries != null) {\n                this._allowRetries = requestOptions.allowRetries;\n            }\n            if (requestOptions.maxRetries != null) {\n                this._maxRetries = requestOptions.maxRetries;\n            }\n        }\n    }\n    options(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    get(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('GET', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    del(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    post(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('POST', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    patch(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    put(requestUrl, data, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('PUT', requestUrl, data, additionalHeaders || {});\n        });\n    }\n    head(requestUrl, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n        });\n    }\n    sendStream(verb, requestUrl, stream, additionalHeaders) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.request(verb, requestUrl, stream, additionalHeaders);\n        });\n    }\n    /**\n     * Gets a typed object from an endpoint\n     * Be aware that not found returns a null.  Other errors (4xx, 5xx) reject the promise\n     */\n    getJson(requestUrl_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            const res = yield this.get(requestUrl, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    postJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.post(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    putJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.put(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    patchJson(requestUrl_1, obj_1) {\n        return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {\n            const data = JSON.stringify(obj, null, 2);\n            additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n            additionalHeaders[Headers.ContentType] =\n                this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);\n            const res = yield this.patch(requestUrl, data, additionalHeaders);\n            return this._processResponse(res, this.requestOptions);\n        });\n    }\n    /**\n     * Makes a raw http request.\n     * All other methods such as get, post, patch, and request ultimately call this.\n     * Prefer get, del, post and patch\n     */\n    request(verb, requestUrl, data, headers) {\n        return __awaiter(this, void 0, void 0, function* () {\n            if (this._disposed) {\n                throw new Error('Client has already been disposed.');\n            }\n            const parsedUrl = new URL(requestUrl);\n            let info = this._prepareRequest(verb, parsedUrl, headers);\n            // Only perform retries on reads since writes may not be idempotent.\n            const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n                ? this._maxRetries + 1\n                : 1;\n            let numTries = 0;\n            let response;\n            do {\n                response = yield this.requestRaw(info, data);\n                // Check if it's an authentication challenge\n                if (response &&\n                    response.message &&\n                    response.message.statusCode === HttpCodes.Unauthorized) {\n                    let authenticationHandler;\n                    for (const handler of this.handlers) {\n                        if (handler.canHandleAuthentication(response)) {\n                            authenticationHandler = handler;\n                            break;\n                        }\n                    }\n                    if (authenticationHandler) {\n                        return authenticationHandler.handleAuthentication(this, info, data);\n                    }\n                    else {\n                        // We have received an unauthorized response but have no handlers to handle it.\n                        // Let the response return to the caller.\n                        return response;\n                    }\n                }\n                let redirectsRemaining = this._maxRedirects;\n                while (response.message.statusCode &&\n                    HttpRedirectCodes.includes(response.message.statusCode) &&\n                    this._allowRedirects &&\n                    redirectsRemaining > 0) {\n                    const redirectUrl = response.message.headers['location'];\n                    if (!redirectUrl) {\n                        // if there's no location to redirect to, we won't\n                        break;\n                    }\n                    const parsedRedirectUrl = new URL(redirectUrl);\n                    if (parsedUrl.protocol === 'https:' &&\n                        parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n                        !this._allowRedirectDowngrade) {\n                        throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n                    }\n                    // we need to finish reading the response before reassigning response\n                    // which will leak the open socket.\n                    yield response.readBody();\n                    // strip authorization header if redirected to a different hostname\n                    if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n                        for (const header in headers) {\n                            // header names are case insensitive\n                            if (header.toLowerCase() === 'authorization') {\n                                delete headers[header];\n                            }\n                        }\n                    }\n                    // let's make the request with the new redirectUrl\n                    info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n                    response = yield this.requestRaw(info, data);\n                    redirectsRemaining--;\n                }\n                if (!response.message.statusCode ||\n                    !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n                    // If not a retry code, return immediately instead of retrying\n                    return response;\n                }\n                numTries += 1;\n                if (numTries < maxTries) {\n                    yield response.readBody();\n                    yield this._performExponentialBackoff(numTries);\n                }\n            } while (numTries < maxTries);\n            return response;\n        });\n    }\n    /**\n     * Needs to be called if keepAlive is set to true in request options.\n     */\n    dispose() {\n        if (this._agent) {\n            this._agent.destroy();\n        }\n        this._disposed = true;\n    }\n    /**\n     * Raw request.\n     * @param info\n     * @param data\n     */\n    requestRaw(info, data) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve, reject) => {\n                function callbackForResult(err, res) {\n                    if (err) {\n                        reject(err);\n                    }\n                    else if (!res) {\n                        // If `err` is not passed, then `res` must be passed.\n                        reject(new Error('Unknown error'));\n                    }\n                    else {\n                        resolve(res);\n                    }\n                }\n                this.requestRawWithCallback(info, data, callbackForResult);\n            });\n        });\n    }\n    /**\n     * Raw request with callback.\n     * @param info\n     * @param data\n     * @param onResult\n     */\n    requestRawWithCallback(info, data, onResult) {\n        if (typeof data === 'string') {\n            if (!info.options.headers) {\n                info.options.headers = {};\n            }\n            info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n        }\n        let callbackCalled = false;\n        function handleResult(err, res) {\n            if (!callbackCalled) {\n                callbackCalled = true;\n                onResult(err, res);\n            }\n        }\n        const req = info.httpModule.request(info.options, (msg) => {\n            const res = new HttpClientResponse(msg);\n            handleResult(undefined, res);\n        });\n        let socket;\n        req.on('socket', sock => {\n            socket = sock;\n        });\n        // If we ever get disconnected, we want the socket to timeout eventually\n        req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n            if (socket) {\n                socket.end();\n            }\n            handleResult(new Error(`Request timeout: ${info.options.path}`));\n        });\n        req.on('error', function (err) {\n            // err has statusCode property\n            // res should have headers\n            handleResult(err);\n        });\n        if (data && typeof data === 'string') {\n            req.write(data, 'utf8');\n        }\n        if (data && typeof data !== 'string') {\n            data.on('close', function () {\n                req.end();\n            });\n            data.pipe(req);\n        }\n        else {\n            req.end();\n        }\n    }\n    /**\n     * Gets an http agent. This function is useful when you need an http agent that handles\n     * routing through a proxy server - depending upon the url and proxy environment variables.\n     * @param serverUrl  The server URL where the request will be sent. For example, https://api.github.com\n     */\n    getAgent(serverUrl) {\n        const parsedUrl = new URL(serverUrl);\n        return this._getAgent(parsedUrl);\n    }\n    getAgentDispatcher(serverUrl) {\n        const parsedUrl = new URL(serverUrl);\n        const proxyUrl = pm.getProxyUrl(parsedUrl);\n        const useProxy = proxyUrl && proxyUrl.hostname;\n        if (!useProxy) {\n            return;\n        }\n        return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);\n    }\n    _prepareRequest(method, requestUrl, headers) {\n        const info = {};\n        info.parsedUrl = requestUrl;\n        const usingSsl = info.parsedUrl.protocol === 'https:';\n        info.httpModule = usingSsl ? https : http;\n        const defaultPort = usingSsl ? 443 : 80;\n        info.options = {};\n        info.options.host = info.parsedUrl.hostname;\n        info.options.port = info.parsedUrl.port\n            ? parseInt(info.parsedUrl.port)\n            : defaultPort;\n        info.options.path =\n            (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n        info.options.method = method;\n        info.options.headers = this._mergeHeaders(headers);\n        if (this.userAgent != null) {\n            info.options.headers['user-agent'] = this.userAgent;\n        }\n        info.options.agent = this._getAgent(info.parsedUrl);\n        // gives handlers an opportunity to participate\n        if (this.handlers) {\n            for (const handler of this.handlers) {\n                handler.prepareRequest(info.options);\n            }\n        }\n        return info;\n    }\n    _mergeHeaders(headers) {\n        if (this.requestOptions && this.requestOptions.headers) {\n            return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n        }\n        return lowercaseKeys(headers || {});\n    }\n    /**\n     * Gets an existing header value or returns a default.\n     * Handles converting number header values to strings since HTTP headers must be strings.\n     * Note: This returns string | string[] since some headers can have multiple values.\n     * For headers that must always be a single string (like Content-Type), use the\n     * specialized _getExistingOrDefaultContentTypeHeader method instead.\n     */\n    _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n        let clientHeader;\n        if (this.requestOptions && this.requestOptions.headers) {\n            const headerValue = lowercaseKeys(this.requestOptions.headers)[header];\n            if (headerValue) {\n                clientHeader =\n                    typeof headerValue === 'number' ? headerValue.toString() : headerValue;\n            }\n        }\n        const additionalValue = additionalHeaders[header];\n        if (additionalValue !== undefined) {\n            return typeof additionalValue === 'number'\n                ? additionalValue.toString()\n                : additionalValue;\n        }\n        if (clientHeader !== undefined) {\n            return clientHeader;\n        }\n        return _default;\n    }\n    /**\n     * Specialized version of _getExistingOrDefaultHeader for Content-Type header.\n     * Always returns a single string (not an array) since Content-Type should be a single value.\n     * Converts arrays to comma-separated strings and numbers to strings to ensure type safety.\n     * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers\n     * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).\n     */\n    _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {\n        let clientHeader;\n        if (this.requestOptions && this.requestOptions.headers) {\n            const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];\n            if (headerValue) {\n                if (typeof headerValue === 'number') {\n                    clientHeader = String(headerValue);\n                }\n                else if (Array.isArray(headerValue)) {\n                    clientHeader = headerValue.join(', ');\n                }\n                else {\n                    clientHeader = headerValue;\n                }\n            }\n        }\n        const additionalValue = additionalHeaders[Headers.ContentType];\n        // Return the first non-undefined value, converting numbers or arrays to strings if necessary\n        if (additionalValue !== undefined) {\n            if (typeof additionalValue === 'number') {\n                return String(additionalValue);\n            }\n            else if (Array.isArray(additionalValue)) {\n                return additionalValue.join(', ');\n            }\n            else {\n                return additionalValue;\n            }\n        }\n        if (clientHeader !== undefined) {\n            return clientHeader;\n        }\n        return _default;\n    }\n    _getAgent(parsedUrl) {\n        let agent;\n        const proxyUrl = pm.getProxyUrl(parsedUrl);\n        const useProxy = proxyUrl && proxyUrl.hostname;\n        if (this._keepAlive && useProxy) {\n            agent = this._proxyAgent;\n        }\n        if (!useProxy) {\n            agent = this._agent;\n        }\n        // if agent is already assigned use that agent.\n        if (agent) {\n            return agent;\n        }\n        const usingSsl = parsedUrl.protocol === 'https:';\n        let maxSockets = 100;\n        if (this.requestOptions) {\n            maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n        }\n        // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n        if (proxyUrl && proxyUrl.hostname) {\n            const agentOptions = {\n                maxSockets,\n                keepAlive: this._keepAlive,\n                proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n                    proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n                })), { host: proxyUrl.hostname, port: proxyUrl.port })\n            };\n            let tunnelAgent;\n            const overHttps = proxyUrl.protocol === 'https:';\n            if (usingSsl) {\n                tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n            }\n            else {\n                tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n            }\n            agent = tunnelAgent(agentOptions);\n            this._proxyAgent = agent;\n        }\n        // if tunneling agent isn't assigned create a new agent\n        if (!agent) {\n            const options = { keepAlive: this._keepAlive, maxSockets };\n            agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n            this._agent = agent;\n        }\n        if (usingSsl && this._ignoreSslError) {\n            // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n            // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n            // we have to cast it to any and change it directly\n            agent.options = Object.assign(agent.options || {}, {\n                rejectUnauthorized: false\n            });\n        }\n        return agent;\n    }\n    _getProxyAgentDispatcher(parsedUrl, proxyUrl) {\n        let proxyAgent;\n        if (this._keepAlive) {\n            proxyAgent = this._proxyAgentDispatcher;\n        }\n        // if agent is already assigned use that agent.\n        if (proxyAgent) {\n            return proxyAgent;\n        }\n        const usingSsl = parsedUrl.protocol === 'https:';\n        proxyAgent = new ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {\n            token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`\n        })));\n        this._proxyAgentDispatcher = proxyAgent;\n        if (usingSsl && this._ignoreSslError) {\n            // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n            // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n            // we have to cast it to any and change it directly\n            proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {\n                rejectUnauthorized: false\n            });\n        }\n        return proxyAgent;\n    }\n    _getUserAgentWithOrchestrationId(userAgent) {\n        const baseUserAgent = userAgent || 'actions/http-client';\n        const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];\n        if (orchId) {\n            // Sanitize the orchestration ID to ensure it contains only valid characters\n            // Valid characters: 0-9, a-z, _, -, .\n            const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');\n            return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;\n        }\n        return baseUserAgent;\n    }\n    _performExponentialBackoff(retryNumber) {\n        return __awaiter(this, void 0, void 0, function* () {\n            retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n            const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n            return new Promise(resolve => setTimeout(() => resolve(), ms));\n        });\n    }\n    _processResponse(res, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n                const statusCode = res.message.statusCode || 0;\n                const response = {\n                    statusCode,\n                    result: null,\n                    headers: {}\n                };\n                // not found leads to null obj returned\n                if (statusCode === HttpCodes.NotFound) {\n                    resolve(response);\n                }\n                // get the result from the body\n                function dateTimeDeserializer(key, value) {\n                    if (typeof value === 'string') {\n                        const a = new Date(value);\n                        if (!isNaN(a.valueOf())) {\n                            return a;\n                        }\n                    }\n                    return value;\n                }\n                let obj;\n                let contents;\n                try {\n                    contents = yield res.readBody();\n                    if (contents && contents.length > 0) {\n                        if (options && options.deserializeDates) {\n                            obj = JSON.parse(contents, dateTimeDeserializer);\n                        }\n                        else {\n                            obj = JSON.parse(contents);\n                        }\n                        response.result = obj;\n                    }\n                    response.headers = res.message.headers;\n                }\n                catch (err) {\n                    // Invalid resource (contents not json);  leaving result obj null\n                }\n                // note that 3xx redirects are handled by the http layer.\n                if (statusCode > 299) {\n                    let msg;\n                    // if exception/error in body, attempt to get better error\n                    if (obj && obj.message) {\n                        msg = obj.message;\n                    }\n                    else if (contents && contents.length > 0) {\n                        // it may be the case that the exception is in the body message as string\n                        msg = contents;\n                    }\n                    else {\n                        msg = `Failed request: (${statusCode})`;\n                    }\n                    const err = new HttpClientError(msg, statusCode);\n                    err.result = response.result;\n                    reject(err);\n                }\n                else {\n                    resolve(response);\n                }\n            }));\n        });\n    }\n}\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nexport class BasicCredentialHandler {\n    constructor(username, password) {\n        this.username = username;\n        this.password = password;\n    }\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\nexport class BearerCredentialHandler {\n    constructor(token) {\n        this.token = token;\n    }\n    // currently implements pre-authorization\n    // TODO: support preAuth = false where it hooks on 401\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Bearer ${this.token}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\nexport class PersonalAccessTokenCredentialHandler {\n    constructor(token) {\n        this.token = token;\n    }\n    // currently implements pre-authorization\n    // TODO: support preAuth = false where it hooks on 401\n    prepareRequest(options) {\n        if (!options.headers) {\n            throw Error('The request has no headers');\n        }\n        options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n    }\n    // This handler cannot handle 401\n    canHandleAuthentication() {\n        return false;\n    }\n    handleAuthentication() {\n        return __awaiter(this, void 0, void 0, function* () {\n            throw new Error('not implemented');\n        });\n    }\n}\n//# sourceMappingURL=auth.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { HttpClient } from '@actions/http-client';\nimport { BearerCredentialHandler } from '@actions/http-client/lib/auth';\nimport { debug, setSecret } from './core.js';\nexport class OidcClient {\n    static createHttpClient(allowRetry = true, maxRetry = 10) {\n        const requestOptions = {\n            allowRetries: allowRetry,\n            maxRetries: maxRetry\n        };\n        return new HttpClient('actions/oidc-client', [new BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n    }\n    static getRequestToken() {\n        const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n        if (!token) {\n            throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n        }\n        return token;\n    }\n    static getIDTokenUrl() {\n        const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n        if (!runtimeUrl) {\n            throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n        }\n        return runtimeUrl;\n    }\n    static getCall(id_token_url) {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a;\n            const httpclient = OidcClient.createHttpClient();\n            const res = yield httpclient\n                .getJson(id_token_url)\n                .catch(error => {\n                throw new Error(`Failed to get ID Token. \\n \n        Error Code : ${error.statusCode}\\n \n        Error Message: ${error.message}`);\n            });\n            const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n            if (!id_token) {\n                throw new Error('Response json body do not have ID Token field');\n            }\n            return id_token;\n        });\n    }\n    static getIDToken(audience) {\n        return __awaiter(this, void 0, void 0, function* () {\n            try {\n                // New ID Token is requested from action service\n                let id_token_url = OidcClient.getIDTokenUrl();\n                if (audience) {\n                    const encodedAudience = encodeURIComponent(audience);\n                    id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n                }\n                debug(`ID token url is ${id_token_url}`);\n                const id_token = yield OidcClient.getCall(id_token_url);\n                setSecret(id_token);\n                return id_token;\n            }\n            catch (error) {\n                throw new Error(`Error message: ${error.message}`);\n            }\n        });\n    }\n}\n//# sourceMappingURL=oidc-utils.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { EOL } from 'os';\nimport { constants, promises } from 'fs';\nconst { access, appendFile, writeFile } = promises;\nexport const SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexport const SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n    constructor() {\n        this._buffer = '';\n    }\n    /**\n     * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n     * Also checks r/w permissions.\n     *\n     * @returns step summary file path\n     */\n    filePath() {\n        return __awaiter(this, void 0, void 0, function* () {\n            if (this._filePath) {\n                return this._filePath;\n            }\n            const pathFromEnv = process.env[SUMMARY_ENV_VAR];\n            if (!pathFromEnv) {\n                throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n            }\n            try {\n                yield access(pathFromEnv, constants.R_OK | constants.W_OK);\n            }\n            catch (_a) {\n                throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n            }\n            this._filePath = pathFromEnv;\n            return this._filePath;\n        });\n    }\n    /**\n     * Wraps content in an HTML tag, adding any HTML attributes\n     *\n     * @param {string} tag HTML tag to wrap\n     * @param {string | null} content content within the tag\n     * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n     *\n     * @returns {string} content wrapped in HTML element\n     */\n    wrap(tag, content, attrs = {}) {\n        const htmlAttrs = Object.entries(attrs)\n            .map(([key, value]) => ` ${key}=\"${value}\"`)\n            .join('');\n        if (!content) {\n            return `<${tag}${htmlAttrs}>`;\n        }\n        return `<${tag}${htmlAttrs}>${content}`;\n    }\n    /**\n     * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n     *\n     * @param {SummaryWriteOptions} [options] (optional) options for write operation\n     *\n     * @returns {Promise} summary instance\n     */\n    write(options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n            const filePath = yield this.filePath();\n            const writeFunc = overwrite ? writeFile : appendFile;\n            yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n            return this.emptyBuffer();\n        });\n    }\n    /**\n     * Clears the summary buffer and wipes the summary file\n     *\n     * @returns {Summary} summary instance\n     */\n    clear() {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.emptyBuffer().write({ overwrite: true });\n        });\n    }\n    /**\n     * Returns the current summary buffer as a string\n     *\n     * @returns {string} string of summary buffer\n     */\n    stringify() {\n        return this._buffer;\n    }\n    /**\n     * If the summary buffer is empty\n     *\n     * @returns {boolen} true if the buffer is empty\n     */\n    isEmptyBuffer() {\n        return this._buffer.length === 0;\n    }\n    /**\n     * Resets the summary buffer without writing to summary file\n     *\n     * @returns {Summary} summary instance\n     */\n    emptyBuffer() {\n        this._buffer = '';\n        return this;\n    }\n    /**\n     * Adds raw text to the summary buffer\n     *\n     * @param {string} text content to add\n     * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n     *\n     * @returns {Summary} summary instance\n     */\n    addRaw(text, addEOL = false) {\n        this._buffer += text;\n        return addEOL ? this.addEOL() : this;\n    }\n    /**\n     * Adds the operating system-specific end-of-line marker to the buffer\n     *\n     * @returns {Summary} summary instance\n     */\n    addEOL() {\n        return this.addRaw(EOL);\n    }\n    /**\n     * Adds an HTML codeblock to the summary buffer\n     *\n     * @param {string} code content to render within fenced code block\n     * @param {string} lang (optional) language to syntax highlight code\n     *\n     * @returns {Summary} summary instance\n     */\n    addCodeBlock(code, lang) {\n        const attrs = Object.assign({}, (lang && { lang }));\n        const element = this.wrap('pre', this.wrap('code', code), attrs);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML list to the summary buffer\n     *\n     * @param {string[]} items list of items to render\n     * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n     *\n     * @returns {Summary} summary instance\n     */\n    addList(items, ordered = false) {\n        const tag = ordered ? 'ol' : 'ul';\n        const listItems = items.map(item => this.wrap('li', item)).join('');\n        const element = this.wrap(tag, listItems);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML table to the summary buffer\n     *\n     * @param {SummaryTableCell[]} rows table rows\n     *\n     * @returns {Summary} summary instance\n     */\n    addTable(rows) {\n        const tableBody = rows\n            .map(row => {\n            const cells = row\n                .map(cell => {\n                if (typeof cell === 'string') {\n                    return this.wrap('td', cell);\n                }\n                const { header, data, colspan, rowspan } = cell;\n                const tag = header ? 'th' : 'td';\n                const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n                return this.wrap(tag, data, attrs);\n            })\n                .join('');\n            return this.wrap('tr', cells);\n        })\n            .join('');\n        const element = this.wrap('table', tableBody);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds a collapsable HTML details element to the summary buffer\n     *\n     * @param {string} label text for the closed state\n     * @param {string} content collapsable content\n     *\n     * @returns {Summary} summary instance\n     */\n    addDetails(label, content) {\n        const element = this.wrap('details', this.wrap('summary', label) + content);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML image tag to the summary buffer\n     *\n     * @param {string} src path to the image you to embed\n     * @param {string} alt text description of the image\n     * @param {SummaryImageOptions} options (optional) addition image attributes\n     *\n     * @returns {Summary} summary instance\n     */\n    addImage(src, alt, options) {\n        const { width, height } = options || {};\n        const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n        const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML section heading element\n     *\n     * @param {string} text heading text\n     * @param {number | string} [level=1] (optional) the heading level, default: 1\n     *\n     * @returns {Summary} summary instance\n     */\n    addHeading(text, level) {\n        const tag = `h${level}`;\n        const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n            ? tag\n            : 'h1';\n        const element = this.wrap(allowedTag, text);\n        return this.addRaw(element).addEOL();\n    }\n    /**\n     * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexport const markdownSummary = _summary;\nexport const summary = _summary;\n//# sourceMappingURL=summary.js.map","import * as path from 'path';\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nexport function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nexport function toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nexport function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\n//# sourceMappingURL=path-utils.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"child_process\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as fs from 'fs';\nimport * as path from 'path';\nexport const { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises;\n// export const {open} = 'fs'\nexport const IS_WINDOWS = process.platform === 'win32';\n/**\n * Custom implementation of readlink to ensure Windows junctions\n * maintain trailing backslash for backward compatibility with Node.js < 24\n *\n * In Node.js 20, Windows junctions (directory symlinks) always returned paths\n * with trailing backslashes. Node.js 24 removed this behavior, which breaks\n * code that relied on this format for path operations.\n *\n * This implementation restores the Node 20 behavior by adding a trailing\n * backslash to all junction results on Windows.\n */\nexport function readlink(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield fs.promises.readlink(fsPath);\n // On Windows, restore Node 20 behavior: add trailing backslash to all results\n // since junctions on Windows are always directory links\n if (IS_WINDOWS && !result.endsWith('\\\\')) {\n return `${result}\\\\`;\n }\n return result;\n });\n}\n// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691\nexport const UV_FS_O_EXLOCK = 0x10000000;\nexport const READONLY = fs.constants.O_RDONLY;\nexport function exists(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n yield stat(fsPath);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n }\n return true;\n });\n}\nexport function isDirectory(fsPath_1) {\n return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) {\n const stats = useStat ? yield stat(fsPath) : yield lstat(fsPath);\n return stats.isDirectory();\n });\n}\n/**\n * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:\n * \\, \\hello, \\\\hello\\share, C:, and C:\\hello (and corresponding alternate separator cases).\n */\nexport function isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}\n/**\n * Best effort attempt to determine whether a file exists and is executable.\n * @param filePath file path to check\n * @param extensions additional file extensions to try\n * @return if file exists and is executable, returns the file path. otherwise empty string.\n */\nexport function tryGetExecutablePath(filePath, extensions) {\n return __awaiter(this, void 0, void 0, function* () {\n let stats = undefined;\n try {\n // test file exists\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // on Windows, test for valid extension\n const upperExt = path.extname(filePath).toUpperCase();\n if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {\n return filePath;\n }\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n // try each extension\n const originalFilePath = filePath;\n for (const extension of extensions) {\n filePath = originalFilePath + extension;\n stats = undefined;\n try {\n stats = yield stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (IS_WINDOWS) {\n // preserve the case of the actual file (since an extension was appended)\n try {\n const directory = path.dirname(filePath);\n const upperName = path.basename(filePath).toUpperCase();\n for (const actualName of yield readdir(directory)) {\n if (upperName === actualName.toUpperCase()) {\n filePath = path.join(directory, actualName);\n break;\n }\n }\n }\n catch (err) {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);\n }\n return filePath;\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n }\n return '';\n });\n}\nfunction normalizeSeparators(p) {\n p = p || '';\n if (IS_WINDOWS) {\n // convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // remove redundant slashes\n return p.replace(/\\\\\\\\+/g, '\\\\');\n }\n // remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n// on Mac/Linux, test the execute bit\n// R W X R W X R W X\n// 256 128 64 32 16 8 4 2 1\nfunction isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 &&\n process.getgid !== undefined &&\n stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 &&\n process.getuid !== undefined &&\n stats.uid === process.getuid()));\n}\n// Get the path of cmd.exe in windows\nexport function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}\n//# sourceMappingURL=io-util.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ok } from 'assert';\nimport * as path from 'path';\nimport * as ioUtil from './io-util.js';\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nexport function cp(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n const { force, recursive, copySourceDirectory } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory() && copySourceDirectory\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nexport function mv(source_1, dest_1) {\n return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nexport function rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Check for invalid characters\n // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n if (/[*\"<>|]/.test(inputPath)) {\n throw new Error('File path must not contain `*`, `\"`, `<`, `>` or `|` on Windows');\n }\n }\n try {\n // note if path does not exist, error is silent\n yield ioUtil.rm(inputPath, {\n force: true,\n maxRetries: 3,\n recursive: true,\n retryDelay: 300\n });\n }\n catch (err) {\n throw new Error(`File was unable to be removed ${err}`);\n }\n });\n}\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nexport function mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n ok(fsPath, 'a path argument must be provided');\n yield ioUtil.mkdir(fsPath, { recursive: true });\n });\n}\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nexport function which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nexport function findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n const copySourceDirectory = options.copySourceDirectory == null\n ? true\n : Boolean(options.copySourceDirectory);\n return { force, recursive, copySourceDirectory };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"timers\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as os from 'os';\nimport * as events from 'events';\nimport * as child from 'child_process';\nimport * as path from 'path';\nimport * as io from '@actions/io';\nimport * as ioUtil from '@actions/io/lib/io-util';\nimport { setTimeout } from 'timers';\n/* eslint-disable @typescript-eslint/unbound-method */\nconst IS_WINDOWS = process.platform === 'win32';\n/*\n * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.\n */\nexport class ToolRunner extends events.EventEmitter {\n constructor(toolPath, args, options) {\n super();\n if (!toolPath) {\n throw new Error(\"Parameter 'toolPath' cannot be null or empty.\");\n }\n this.toolPath = toolPath;\n this.args = args || [];\n this.options = options || {};\n }\n _debug(message) {\n if (this.options.listeners && this.options.listeners.debug) {\n this.options.listeners.debug(message);\n }\n }\n _getCommandString(options, noPrefix) {\n const toolPath = this._getSpawnFileName();\n const args = this._getSpawnArgs(options);\n let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool\n if (IS_WINDOWS) {\n // Windows + cmd file\n if (this._isCmdFile()) {\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows + verbatim\n else if (options.windowsVerbatimArguments) {\n cmd += `\"${toolPath}\"`;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows (regular)\n else {\n cmd += this._windowsQuoteCmdArg(toolPath);\n for (const a of args) {\n cmd += ` ${this._windowsQuoteCmdArg(a)}`;\n }\n }\n }\n else {\n // OSX/Linux - this can likely be improved with some form of quoting.\n // creating processes on Unix is fundamentally different than Windows.\n // on Unix, execvp() takes an arg array.\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n return cmd;\n }\n _processLineBuffer(data, strBuffer, onLine) {\n try {\n let s = strBuffer + data.toString();\n let n = s.indexOf(os.EOL);\n while (n > -1) {\n const line = s.substring(0, n);\n onLine(line);\n // the rest of the string ...\n s = s.substring(n + os.EOL.length);\n n = s.indexOf(os.EOL);\n }\n return s;\n }\n catch (err) {\n // streaming lines to console is best effort. Don't fail a build.\n this._debug(`error processing line. Failed with error ${err}`);\n return '';\n }\n }\n _getSpawnFileName() {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n return process.env['COMSPEC'] || 'cmd.exe';\n }\n }\n return this.toolPath;\n }\n _getSpawnArgs(options) {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n let argline = `/D /S /C \"${this._windowsQuoteCmdArg(this.toolPath)}`;\n for (const a of this.args) {\n argline += ' ';\n argline += options.windowsVerbatimArguments\n ? a\n : this._windowsQuoteCmdArg(a);\n }\n argline += '\"';\n return [argline];\n }\n }\n return this.args;\n }\n _endsWith(str, end) {\n return str.endsWith(end);\n }\n _isCmdFile() {\n const upperToolPath = this.toolPath.toUpperCase();\n return (this._endsWith(upperToolPath, '.CMD') ||\n this._endsWith(upperToolPath, '.BAT'));\n }\n _windowsQuoteCmdArg(arg) {\n // for .exe, apply the normal quoting rules that libuv applies\n if (!this._isCmdFile()) {\n return this._uvQuoteCmdArg(arg);\n }\n // otherwise apply quoting rules specific to the cmd.exe command line parser.\n // the libuv rules are generic and are not designed specifically for cmd.exe\n // command line parser.\n //\n // for a detailed description of the cmd.exe command line parser, refer to\n // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912\n // need quotes for empty arg\n if (!arg) {\n return '\"\"';\n }\n // determine whether the arg needs to be quoted\n const cmdSpecialChars = [\n ' ',\n '\\t',\n '&',\n '(',\n ')',\n '[',\n ']',\n '{',\n '}',\n '^',\n '=',\n ';',\n '!',\n \"'\",\n '+',\n ',',\n '`',\n '~',\n '|',\n '<',\n '>',\n '\"'\n ];\n let needsQuotes = false;\n for (const char of arg) {\n if (cmdSpecialChars.some(x => x === char)) {\n needsQuotes = true;\n break;\n }\n }\n // short-circuit if quotes not needed\n if (!needsQuotes) {\n return arg;\n }\n // the following quoting rules are very similar to the rules that by libuv applies.\n //\n // 1) wrap the string in quotes\n //\n // 2) double-up quotes - i.e. \" => \"\"\n //\n // this is different from the libuv quoting rules. libuv replaces \" with \\\", which unfortunately\n // doesn't work well with a cmd.exe command line.\n //\n // note, replacing \" with \"\" also works well if the arg is passed to a downstream .NET console app.\n // for example, the command line:\n // foo.exe \"myarg:\"\"my val\"\"\"\n // is parsed by a .NET console app into an arg array:\n // [ \"myarg:\\\"my val\\\"\" ]\n // which is the same end result when applying libuv quoting rules. although the actual\n // command line from libuv quoting rules would look like:\n // foo.exe \"myarg:\\\"my val\\\"\"\n //\n // 3) double-up slashes that precede a quote,\n // e.g. hello \\world => \"hello \\world\"\n // hello\\\"world => \"hello\\\\\"\"world\"\n // hello\\\\\"world => \"hello\\\\\\\\\"\"world\"\n // hello world\\ => \"hello world\\\\\"\n //\n // technically this is not required for a cmd.exe command line, or the batch argument parser.\n // the reasons for including this as a .cmd quoting rule are:\n //\n // a) this is optimized for the scenario where the argument is passed from the .cmd file to an\n // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.\n //\n // b) it's what we've been doing previously (by deferring to node default behavior) and we\n // haven't heard any complaints about that aspect.\n //\n // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be\n // escaped when used on the command line directly - even though within a .cmd file % can be escaped\n // by using %%.\n //\n // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts\n // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.\n //\n // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would\n // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the\n // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args\n // to an external program.\n //\n // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.\n // % can be escaped within a .cmd file.\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\'; // double the slash\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\"'; // double the quote\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _uvQuoteCmdArg(arg) {\n // Tool runner wraps child_process.spawn() and needs to apply the same quoting as\n // Node in certain cases where the undocumented spawn option windowsVerbatimArguments\n // is used.\n //\n // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,\n // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),\n // pasting copyright notice from Node within this function:\n //\n // Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to\n // deal in the Software without restriction, including without limitation the\n // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n // sell copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n //\n // The above copyright notice and this permission notice shall be included in\n // all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n // IN THE SOFTWARE.\n if (!arg) {\n // Need double quotation for empty argument\n return '\"\"';\n }\n if (!arg.includes(' ') && !arg.includes('\\t') && !arg.includes('\"')) {\n // No quotation needed\n return arg;\n }\n if (!arg.includes('\"') && !arg.includes('\\\\')) {\n // No embedded double quotes or backslashes, so I can just wrap\n // quote marks around the whole thing.\n return `\"${arg}\"`;\n }\n // Expected input/output:\n // input : hello\"world\n // output: \"hello\\\"world\"\n // input : hello\"\"world\n // output: \"hello\\\"\\\"world\"\n // input : hello\\world\n // output: hello\\world\n // input : hello\\\\world\n // output: hello\\\\world\n // input : hello\\\"world\n // output: \"hello\\\\\\\"world\"\n // input : hello\\\\\"world\n // output: \"hello\\\\\\\\\\\"world\"\n // input : hello world\\\n // output: \"hello world\\\\\" - note the comment in libuv actually reads \"hello world\\\"\n // but it appears the comment is wrong, it should be \"hello world\\\\\"\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\';\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\\\\';\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse.split('').reverse().join('');\n }\n _cloneExecOptions(options) {\n options = options || {};\n const result = {\n cwd: options.cwd || process.cwd(),\n env: options.env || process.env,\n silent: options.silent || false,\n windowsVerbatimArguments: options.windowsVerbatimArguments || false,\n failOnStdErr: options.failOnStdErr || false,\n ignoreReturnCode: options.ignoreReturnCode || false,\n delay: options.delay || 10000\n };\n result.outStream = options.outStream || process.stdout;\n result.errStream = options.errStream || process.stderr;\n return result;\n }\n _getSpawnOptions(options, toolPath) {\n options = options || {};\n const result = {};\n result.cwd = options.cwd;\n result.env = options.env;\n result['windowsVerbatimArguments'] =\n options.windowsVerbatimArguments || this._isCmdFile();\n if (options.windowsVerbatimArguments) {\n result.argv0 = `\"${toolPath}\"`;\n }\n return result;\n }\n /**\n * Exec a tool.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param tool path to tool to exec\n * @param options optional exec options. See ExecOptions\n * @returns number\n */\n exec() {\n return __awaiter(this, void 0, void 0, function* () {\n // root the tool path if it is unrooted and contains relative pathing\n if (!ioUtil.isRooted(this.toolPath) &&\n (this.toolPath.includes('/') ||\n (IS_WINDOWS && this.toolPath.includes('\\\\')))) {\n // prefer options.cwd if it is specified, however options.cwd may also need to be rooted\n this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);\n }\n // if the tool is only a file name, then resolve it from the PATH\n // otherwise verify it exists (add extension on Windows if necessary)\n this.toolPath = yield io.which(this.toolPath, true);\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n this._debug(`exec tool: ${this.toolPath}`);\n this._debug('arguments:');\n for (const arg of this.args) {\n this._debug(` ${arg}`);\n }\n const optionsNonNull = this._cloneExecOptions(this.options);\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);\n }\n const state = new ExecState(optionsNonNull, this.toolPath);\n state.on('debug', (message) => {\n this._debug(message);\n });\n if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {\n return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));\n }\n const fileName = this._getSpawnFileName();\n const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));\n let stdbuffer = '';\n if (cp.stdout) {\n cp.stdout.on('data', (data) => {\n if (this.options.listeners && this.options.listeners.stdout) {\n this.options.listeners.stdout(data);\n }\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(data);\n }\n stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.stdline) {\n this.options.listeners.stdline(line);\n }\n });\n });\n }\n let errbuffer = '';\n if (cp.stderr) {\n cp.stderr.on('data', (data) => {\n state.processStderr = true;\n if (this.options.listeners && this.options.listeners.stderr) {\n this.options.listeners.stderr(data);\n }\n if (!optionsNonNull.silent &&\n optionsNonNull.errStream &&\n optionsNonNull.outStream) {\n const s = optionsNonNull.failOnStdErr\n ? optionsNonNull.errStream\n : optionsNonNull.outStream;\n s.write(data);\n }\n errbuffer = this._processLineBuffer(data, errbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.errline) {\n this.options.listeners.errline(line);\n }\n });\n });\n }\n cp.on('error', (err) => {\n state.processError = err.message;\n state.processExited = true;\n state.processClosed = true;\n state.CheckComplete();\n });\n cp.on('exit', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n cp.on('close', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n state.processClosed = true;\n this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n state.on('done', (error, exitCode) => {\n if (stdbuffer.length > 0) {\n this.emit('stdline', stdbuffer);\n }\n if (errbuffer.length > 0) {\n this.emit('errline', errbuffer);\n }\n cp.removeAllListeners();\n if (error) {\n reject(error);\n }\n else {\n resolve(exitCode);\n }\n });\n if (this.options.input) {\n if (!cp.stdin) {\n throw new Error('child process missing stdin');\n }\n cp.stdin.end(this.options.input);\n }\n }));\n });\n }\n}\n/**\n * Convert an arg string to an array of args. Handles escaping\n *\n * @param argString string of arguments\n * @returns string[] array of arguments\n */\nexport function argStringToArray(argString) {\n const args = [];\n let inQuotes = false;\n let escaped = false;\n let arg = '';\n function append(c) {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\';\n }\n arg += c;\n escaped = false;\n }\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i);\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes;\n }\n else {\n append(c);\n }\n continue;\n }\n if (c === '\\\\' && escaped) {\n append(c);\n continue;\n }\n if (c === '\\\\' && inQuotes) {\n escaped = true;\n continue;\n }\n if (c === ' ' && !inQuotes) {\n if (arg.length > 0) {\n args.push(arg);\n arg = '';\n }\n continue;\n }\n append(c);\n }\n if (arg.length > 0) {\n args.push(arg.trim());\n }\n return args;\n}\nclass ExecState extends events.EventEmitter {\n constructor(options, toolPath) {\n super();\n this.processClosed = false; // tracks whether the process has exited and stdio is closed\n this.processError = '';\n this.processExitCode = 0;\n this.processExited = false; // tracks whether the process has exited\n this.processStderr = false; // tracks whether stderr was written to\n this.delay = 10000; // 10 seconds\n this.done = false;\n this.timeout = null;\n if (!toolPath) {\n throw new Error('toolPath must not be empty');\n }\n this.options = options;\n this.toolPath = toolPath;\n if (options.delay) {\n this.delay = options.delay;\n }\n }\n CheckComplete() {\n if (this.done) {\n return;\n }\n if (this.processClosed) {\n this._setResult();\n }\n else if (this.processExited) {\n this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);\n }\n }\n _debug(message) {\n this.emit('debug', message);\n }\n _setResult() {\n // determine whether there is an error\n let error;\n if (this.processExited) {\n if (this.processError) {\n error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);\n }\n else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {\n error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);\n }\n else if (this.processStderr && this.options.failOnStdErr) {\n error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);\n }\n }\n // clear the timeout\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.done = true;\n this.emit('done', error, this.processExitCode);\n }\n static HandleTimeout(state) {\n if (state.done) {\n return;\n }\n if (!state.processClosed && state.processExited) {\n const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;\n state._debug(message);\n }\n state._setResult();\n }\n}\n//# sourceMappingURL=toolrunner.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { StringDecoder } from 'string_decoder';\nimport * as tr from './toolrunner.js';\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nexport function exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\n/**\n * Exec a command and get the output.\n * Output will be streamed to the live console.\n * Returns promise with the exit code and collected stdout and stderr\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code, stdout, and stderr\n */\nexport function getExecOutput(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let stdout = '';\n let stderr = '';\n //Using string decoder covers the case where a mult-byte character is split\n const stdoutDecoder = new StringDecoder('utf8');\n const stderrDecoder = new StringDecoder('utf8');\n const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;\n const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;\n const stdErrListener = (data) => {\n stderr += stderrDecoder.write(data);\n if (originalStdErrListener) {\n originalStdErrListener(data);\n }\n };\n const stdOutListener = (data) => {\n stdout += stdoutDecoder.write(data);\n if (originalStdoutListener) {\n originalStdoutListener(data);\n }\n };\n const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });\n const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));\n //flush any remaining characters\n stdout += stdoutDecoder.end();\n stderr += stderrDecoder.end();\n return {\n exitCode,\n stdout,\n stderr\n };\n });\n}\n//# sourceMappingURL=exec.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport os from 'os';\nimport * as exec from '@actions/exec';\nconst getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout: version } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Version\"', undefined, {\n silent: true\n });\n const { stdout: name } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Caption\"', undefined, {\n silent: true\n });\n return {\n name: name.trim(),\n version: version.trim()\n };\n});\nconst getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d;\n const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {\n silent: true\n });\n const version = (_b = (_a = stdout.match(/ProductVersion:\\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';\n const name = (_d = (_c = stdout.match(/ProductName:\\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';\n return {\n name,\n version\n };\n});\nconst getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {\n silent: true\n });\n const [name, version] = stdout.trim().split('\\n');\n return {\n name,\n version\n };\n});\nexport const platform = os.platform();\nexport const arch = os.arch();\nexport const isWindows = platform === 'win32';\nexport const isMacOS = platform === 'darwin';\nexport const isLinux = platform === 'linux';\nexport function getDetails() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign(Object.assign({}, (yield (isWindows\n ? getWindowsInfo()\n : isMacOS\n ? getMacOsInfo()\n : getLinuxInfo()))), { platform,\n arch,\n isWindows,\n isMacOS,\n isLinux });\n });\n}\n//# sourceMappingURL=platform.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { issue, issueCommand } from './command.js';\nimport { issueFileCommand, prepareKeyValueMessage } from './file-command.js';\nimport { toCommandProperties, toCommandValue } from './utils.js';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { OidcClient } from './oidc-utils.js';\n/**\n * The code to exit an action\n */\nexport var ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode || (ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function exportVariable(name, val) {\n const convertedVal = toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return issueFileCommand('ENV', prepareKeyValueMessage(name, val));\n }\n issueCommand('set-env', { name }, convertedVal);\n}\n/**\n * Registers a secret which will get masked from logs\n *\n * @param secret - Value of the secret to be masked\n * @remarks\n * This function instructs the Actions runner to mask the specified value in any\n * logs produced during the workflow run. Once registered, the secret value will\n * be replaced with asterisks (***) whenever it appears in console output, logs,\n * or error messages.\n *\n * This is useful for protecting sensitive information such as:\n * - API keys\n * - Access tokens\n * - Authentication credentials\n * - URL parameters containing signatures (SAS tokens)\n *\n * Note that masking only affects future logs; any previous appearances of the\n * secret in logs before calling this function will remain unmasked.\n *\n * @example\n * ```typescript\n * // Register an API token as a secret\n * const apiToken = \"abc123xyz456\";\n * setSecret(apiToken);\n *\n * // Now any logs containing this value will show *** instead\n * console.log(`Using token: ${apiToken}`); // Outputs: \"Using token: ***\"\n * ```\n */\nexport function setSecret(secret) {\n issueCommand('add-mask', {}, secret);\n}\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nexport function addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n issueFileCommand('PATH', inputPath);\n }\n else {\n issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nexport function getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nexport function getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nexport function getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n issueCommand('set-output', { name }, toCommandValue(value));\n}\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nexport function setCommandEcho(enabled) {\n issue('echo', enabled ? 'on' : 'off');\n}\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nexport function setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nexport function isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nexport function debug(message) {\n issueCommand('debug', {}, message);\n}\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function error(message, properties = {}) {\n issueCommand('error', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function warning(message, properties = {}) {\n issueCommand('warning', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nexport function notice(message, properties = {}) {\n issueCommand('notice', toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nexport function info(message) {\n process.stdout.write(message + os.EOL);\n}\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nexport function startGroup(name) {\n issue('group', name);\n}\n/**\n * End an output group.\n */\nexport function endGroup() {\n issue('endgroup');\n}\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nexport function group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return issueFileCommand('STATE', prepareKeyValueMessage(name, value));\n }\n issueCommand('save-state', { name }, toCommandValue(value));\n}\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nexport function getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexport function getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield OidcClient.getIDToken(aud);\n });\n}\n/**\n * Summary exports\n */\nexport { summary } from './summary.js';\n/**\n * @deprecated use core.summary\n */\nexport { markdownSummary } from './summary.js';\n/**\n * Path exports\n */\nexport { toPosixPath, toWin32Path, toPlatformPath } from './path-utils.js';\n/**\n * Platform utilities exports\n */\nexport * as platform from './platform.js';\n//# sourceMappingURL=core.js.map","//#region src/auth/upload-url-pool.ts\n/**\n* Manages a pool of reusable upload URLs keyed by bucket ID or file ID.\n* URLs are checked out before an upload, checked back in on success, and\n* evicted on error so they are not reused.\n*/\nvar UploadUrlPool = class {\n\t/** Map from key (bucket ID or file ID) to a stack of available entries. */\n\tpools = /* @__PURE__ */ new Map();\n\t/**\n\t* Take an upload URL from the pool, or return null if none are available.\n\t*\n\t* @param key - The bucket ID or file ID to look up.\n\t*\n\t* @returns An upload URL entry, or null if the pool is empty for the given key.\n\t*/\n\tcheckout(key) {\n\t\tconst pool = this.pools.get(key);\n\t\tif (!pool || pool.length === 0) return null;\n\t\treturn pool.pop() ?? null;\n\t}\n\t/**\n\t* Return a still-valid upload URL to the pool for future reuse.\n\t*\n\t* @param key - The bucket ID or file ID the entry belongs to.\n\t* @param entry - The upload URL entry to return to the pool.\n\t*/\n\tcheckin(key, entry) {\n\t\tlet pool = this.pools.get(key);\n\t\tif (!pool) {\n\t\t\tpool = [];\n\t\t\tthis.pools.set(key, pool);\n\t\t}\n\t\tpool.push(entry);\n\t}\n\t/**\n\t* Remove a specific upload URL from the pool (e.g. after an upload error).\n\t*\n\t* @param key - The bucket ID or file ID the entry belongs to.\n\t* @param entry - The failed upload URL entry to remove.\n\t*/\n\tevict(key, entry) {\n\t\tconst pool = this.pools.get(key);\n\t\tif (!pool) return;\n\t\tconst idx = pool.findIndex((e) => e.uploadUrl === entry.uploadUrl);\n\t\tif (idx !== -1) pool.splice(idx, 1);\n\t}\n\t/** Remove all entries from every key in the pool. */\n\tclear() {\n\t\tthis.pools.clear();\n\t}\n};\n//#endregion\nexport { UploadUrlPool };\n\n//# sourceMappingURL=upload-url-pool.js.map","import { UploadUrlPool } from \"./upload-url-pool.js\";\n//#region src/auth/in-memory.ts\n/**\n* In-memory implementation of {@link AccountInfo}.\n* Stores the authorization response and upload URL pools in plain object fields.\n* Suitable for short-lived processes or tests; state is lost when the process exits.\n*/\nvar InMemoryAccountInfo = class {\n\t/** Cached authorization response, or null before authorize() is called. */\n\tauth = null;\n\t/** Pool of reusable small-file upload URLs, keyed by bucket ID. */\n\tuploadUrls = new UploadUrlPool();\n\t/** Pool of reusable large-file part upload URLs, keyed by file ID. */\n\tpartUploadUrls = new UploadUrlPool();\n\t/**\n\t* Store a fresh authorization response, replacing any previous state.\n\t*\n\t* @param auth - The authorize account response to store.\n\t*/\n\tsetAuth(auth) {\n\t\tthis.auth = auth;\n\t\tthis.uploadUrls.clear();\n\t\tthis.partUploadUrls.clear();\n\t}\n\t/**\n\t* Return the current authorization response, or null if not authorized.\n\t*\n\t* @returns The cached authorization response, or null if not yet authorized.\n\t*/\n\tgetAuth() {\n\t\treturn this.auth;\n\t}\n\t/** Discard all cached authorization state and upload URLs. */\n\tclear() {\n\t\tthis.auth = null;\n\t\tthis.uploadUrls.clear();\n\t\tthis.partUploadUrls.clear();\n\t}\n\t/**\n\t* Base URL for B2 API calls.\n\t*\n\t* @returns The base URL for B2 API calls.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetApiUrl() {\n\t\treturn this.requireAuth().apiInfo.storageApi.apiUrl;\n\t}\n\t/**\n\t* Base URL for file downloads.\n\t*\n\t* @returns The base URL for file downloads.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetDownloadUrl() {\n\t\treturn this.requireAuth().apiInfo.storageApi.downloadUrl;\n\t}\n\t/**\n\t* Current authorization token.\n\t*\n\t* @returns The current authorization token.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetAuthToken() {\n\t\treturn this.requireAuth().authorizationToken;\n\t}\n\t/**\n\t* The authorized account ID.\n\t*\n\t* @returns The authorized account identifier.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetAccountId() {\n\t\treturn this.requireAuth().accountId;\n\t}\n\t/**\n\t* Server-recommended part size for large file uploads, in bytes.\n\t*\n\t* @returns The server-recommended part size in bytes.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetRecommendedPartSize() {\n\t\treturn this.requireAuth().apiInfo.storageApi.recommendedPartSize;\n\t}\n\t/**\n\t* Smallest allowed part size for large file uploads, in bytes.\n\t*\n\t* @returns The smallest allowed part size in bytes.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetAbsoluteMinimumPartSize() {\n\t\treturn this.requireAuth().apiInfo.storageApi.absoluteMinimumPartSize;\n\t}\n\t/**\n\t* Base URL for the S3-compatible API.\n\t*\n\t* @returns The base URL for the S3-compatible API.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetS3ApiUrl() {\n\t\treturn this.requireAuth().apiInfo.storageApi.s3ApiUrl;\n\t}\n\t/**\n\t* Bucket ID the key is restricted to, or null if unrestricted.\n\t*\n\t* @returns The restricted bucket identifier, or null if the key is unrestricted.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetAllowedBucketId() {\n\t\tconst allowed = this.requireAuth().apiInfo.storageApi.allowed;\n\t\tconst buckets = allowed.buckets;\n\t\tif (buckets === void 0) return allowed.bucketId ?? null;\n\t\tif (buckets !== null) {\n\t\t\tif (buckets.length !== 1) throw new Error(\"Authorized key is not restricted to exactly one bucket; use getAllowedBucketIds()\");\n\t\t\treturn buckets[0]?.id ?? null;\n\t\t}\n\t\treturn null;\n\t}\n\t/**\n\t* Bucket IDs the key is restricted to, or null if unrestricted.\n\t*\n\t* @returns The restricted bucket identifiers, or null if the key is unrestricted.\n\t*\n\t* @throws Error if not yet authorized.\n\t*/\n\tgetAllowedBucketIds() {\n\t\tconst allowed = this.requireAuth().apiInfo.storageApi.allowed;\n\t\tconst buckets = allowed.buckets;\n\t\tif (buckets === void 0) {\n\t\t\tconst legacyBucketId = allowed.bucketId ?? null;\n\t\t\treturn legacyBucketId === null ? null : [legacyBucketId];\n\t\t}\n\t\treturn buckets === null ? null : buckets.map((bucket) => bucket.id);\n\t}\n\t/**\n\t* Take an upload URL from the pool for the given bucket, or null if none available.\n\t*\n\t* @param bucketId - The bucket to check out an upload URL for.\n\t*\n\t* @returns A reusable upload URL entry, or null if none are available.\n\t*/\n\tcheckoutUploadUrl(bucketId) {\n\t\treturn this.uploadUrls.checkout(bucketId);\n\t}\n\t/**\n\t* Return a still-valid upload URL to the pool for reuse.\n\t*\n\t* @param bucketId - The bucket the upload URL belongs to.\n\t* @param entry - The upload URL entry to return to the pool.\n\t*/\n\treturnUploadUrl(bucketId, entry) {\n\t\tthis.uploadUrls.checkin(bucketId, entry);\n\t}\n\t/**\n\t* Remove an upload URL from the pool after an upload error.\n\t*\n\t* @param bucketId - The bucket the failed upload URL belongs to.\n\t* @param entry - The upload URL entry to remove from the pool.\n\t*/\n\tevictUploadUrl(bucketId, entry) {\n\t\tthis.uploadUrls.evict(bucketId, entry);\n\t}\n\t/**\n\t* Take a large-file part upload URL from the pool, or null if none available.\n\t*\n\t* @param fileId - The large file to check out a part upload URL for.\n\t*\n\t* @returns A reusable part upload URL entry, or null if none are available.\n\t*/\n\tcheckoutPartUploadUrl(fileId) {\n\t\treturn this.partUploadUrls.checkout(fileId);\n\t}\n\t/**\n\t* Return a still-valid part upload URL to the pool for reuse.\n\t*\n\t* @param fileId - The large file the part upload URL belongs to.\n\t* @param entry - The part upload URL entry to return to the pool.\n\t*/\n\treturnPartUploadUrl(fileId, entry) {\n\t\tthis.partUploadUrls.checkin(fileId, entry);\n\t}\n\t/**\n\t* Remove a part upload URL from the pool after an error.\n\t*\n\t* @param fileId - The large file the failed part upload URL belongs to.\n\t* @param entry - The part upload URL entry to remove from the pool.\n\t*/\n\tevictPartUploadUrl(fileId, entry) {\n\t\tthis.partUploadUrls.evict(fileId, entry);\n\t}\n\t/**\n\t* Retrieve the cached auth response or throw if not yet authorized.\n\t*\n\t* @returns The cached authorization response.\n\t*\n\t* @throws Error if authorize() has not been called.\n\t*/\n\trequireAuth() {\n\t\tif (!this.auth) throw new Error(\"Not authorized. Call authorize() first.\");\n\t\treturn this.auth;\n\t}\n};\n//#endregion\nexport { InMemoryAccountInfo };\n\n//# sourceMappingURL=in-memory.js.map","//#region src/types/ids.ts\n/**\n* Creates a branded {@link AccountId} from a raw string.\n* @param raw - The raw account ID string from the B2 API.\n*\n* @returns A branded AccountId value.\n*/\nfunction accountId(raw) {\n\treturn raw;\n}\n/**\n* Creates a branded {@link BucketId} from a raw string.\n* @param raw - The raw bucket ID string from the B2 API.\n*\n* @returns A branded BucketId value.\n*/\nfunction bucketId(raw) {\n\treturn raw;\n}\n/**\n* Creates a branded {@link FileId} from a raw string.\n* @param raw - The raw file ID string from the B2 API.\n*\n* @returns A branded FileId value.\n*/\nfunction fileId(raw) {\n\treturn raw;\n}\n/**\n* Creates a branded {@link KeyId} from a raw string.\n* @param raw - The raw key ID string from the B2 API.\n*\n* @returns A branded KeyId value.\n*/\nfunction keyId(raw) {\n\treturn raw;\n}\n/**\n* Creates a branded {@link ApplicationKeyId} from a raw string.\n* @param raw - The raw application key ID string from the B2 API.\n*\n* @returns A branded ApplicationKeyId value.\n*/\nfunction applicationKeyId(raw) {\n\treturn raw;\n}\n/**\n* Creates a branded {@link LargeFileId} from a raw string.\n*\n* `LargeFileId` is the same wire-level shape as `FileId` but is a\n* distinct brand so that \"ID of an in-progress multipart upload\" and\n* \"ID of a committed file version\" don't get mixed up by accident.\n* `b2_start_large_file` returns one; `b2_finish_large_file` consumes it\n* and produces a regular `FileId`.\n*\n* @param raw - The raw large-file ID string from the B2 API.\n*\n* @returns A branded LargeFileId value.\n*/\nfunction largeFileId(raw) {\n\treturn raw;\n}\n//#endregion\nexport { accountId, applicationKeyId, bucketId, fileId, keyId, largeFileId };\n\n//# sourceMappingURL=ids.js.map","//#region src/http/retry.ts\n/** Default retry settings: 5 retries, 1s initial delay, 64s max delay, 15 minute timeout. */\nvar DEFAULT_RETRY_OPTIONS = {\n\tmaxRetries: 5,\n\tmaxRetryDelayMs: 64e3,\n\tinitialRetryDelayMs: 1e3,\n\trequestTimeoutMs: 15 * 6e4\n};\n/**\n* Computes the delay before the next retry using exponential backoff with jitter.\n* If a `Retry-After` value is provided by the server, it takes precedence over\n* the calculated backoff (still capped at {@link RetryOptions.maxRetryDelayMs}).\n*\n* @param attempt - Zero-based retry attempt index.\n* @param options - Retry configuration with delay bounds.\n* @param retryAfter - Server-provided retry delay in seconds, if any.\n*\n* @returns The delay in milliseconds before the next retry attempt.\n*/\nfunction computeBackoff(attempt, options, retryAfter) {\n\tif (retryAfter !== void 0 && retryAfter > 0) return Math.min(retryAfter * 1e3, options.maxRetryDelayMs);\n\tconst base = options.initialRetryDelayMs * 2 ** attempt;\n\tconst jitter = Math.random() * base * .5;\n\treturn Math.min(base + jitter, options.maxRetryDelayMs);\n}\n/**\n* Returns a promise that resolves after the given delay. Supports cancellation\n* via an optional AbortSignal.\n*\n* @param ms - Delay in milliseconds.\n* @param signal - Optional abort signal to cancel the sleep early.\n*\n* @returns A promise that resolves when the delay elapses or rejects if aborted.\n*/\nfunction sleep(ms, signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (signal?.aborted) {\n\t\t\treject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n\t\t\treturn;\n\t\t}\n\t\tconst timer = setTimeout(resolve, ms);\n\t\tsignal?.addEventListener(\"abort\", () => {\n\t\t\tclearTimeout(timer);\n\t\t\treject(signal.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n\t\t}, { once: true });\n\t});\n}\n//#endregion\nexport { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep };\n\n//# sourceMappingURL=retry.js.map","//#region src/util/paginator.ts\n/**\n* Async-iterates one page at a time. Stops when `fetcher` returns\n* `nextCursor: undefined`.\n*\n* @typeParam Page - The per-page response shape.\n* @typeParam Cursor - The cursor type used to request the next page.\n*\n* @param fetcher - Function that fetches one page given the current cursor.\n* @param signal - Optional abort signal. Checked before each fetch.\n*\n* @returns An async iterable of pages.\n*\n* @throws DOMException When `signal` is aborted between fetches.\n*\n* @example\n* ```ts\n* for await (const page of paginatePages(\n* async (cursor) => {\n* const resp = await bucket.listFileNames({ startFileName: cursor })\n* return { page: resp, nextCursor: resp.nextFileName ?? undefined }\n* },\n* abortSignal,\n* )) {\n* for (const file of page.files) { ... }\n* }\n* ```\n*/\nasync function* paginatePages(fetcher, signal) {\n\tlet cursor;\n\twhile (true) {\n\t\tsignal?.throwIfAborted();\n\t\tconst { page, nextCursor } = await fetcher(cursor);\n\t\tyield page;\n\t\tif (nextCursor === void 0) return;\n\t\tcursor = nextCursor;\n\t}\n}\n/**\n* Async-iterates items by flattening pages. The `extractItems` function\n* pulls the relevant array out of each page (e.g. `page.files`,\n* `page.keys`, `page.parts`). Each item is yielded individually so the\n* caller can `for await (const item of paginator)` rather than nest loops.\n*\n* Aborts between **pages**, not between items: if `signal` is aborted while\n* the caller is processing the items of page N, the iterator will still\n* yield all of page N's remaining items before checking the signal before\n* fetching page N+1.\n*\n* @typeParam Page - The per-page response shape.\n* @typeParam Cursor - The cursor type used to request the next page.\n* @typeParam Item - The item type the caller wants to iterate.\n*\n* @param fetcher - Function that fetches one page given the current cursor.\n* @param extractItems - Pulls the iterable items out of a page.\n* @param signal - Optional abort signal. Checked before each fetch.\n*\n* @returns An async iterable of individual items.\n*\n* @throws DOMException When `signal` is aborted between fetches.\n*/\nasync function* paginateItems(fetcher, extractItems, signal) {\n\tfor await (const page of paginatePages(fetcher, signal)) yield* extractItems(page);\n}\n//#endregion\nexport { paginateItems, paginatePages };\n\n//# sourceMappingURL=paginator.js.map","//#region src/upload/concurrency.ts\n/**\n* Bounded concurrency primitive.\n*\n* Limits the number of concurrent operations to a fixed maximum. Callers\n* {@link acquire} a slot before starting work and {@link release} it when done.\n* If all slots are taken, `acquire` returns a promise that resolves when a slot\n* becomes available.\n*/\nvar Semaphore = class {\n\tlimit;\n\tcurrent = 0;\n\tqueue = [];\n\t/**\n\t* @param limit - Maximum number of concurrent acquisitions. Must be a\n\t* positive integer; values `<= 0` would create a semaphore that\n\t* never lets anything through (all `acquire()` calls would queue\n\t* forever), so the constructor throws fast instead.\n\t*\n\t* @throws `RangeError` when `limit` is not a positive integer.\n\t*/\n\tconstructor(limit) {\n\t\tthis.limit = limit;\n\t\tif (!Number.isInteger(limit) || limit <= 0) throw new RangeError(`Semaphore limit must be a positive integer; received ${limit}. A non-positive limit produces a deadlocked semaphore — fail fast at construction instead.`);\n\t}\n\t/**\n\t* Acquires a slot, waiting if the limit has been reached.\n\t* @returns A promise that resolves when a slot is available.\n\t*/\n\tasync acquire() {\n\t\tif (this.current < this.limit) {\n\t\t\tthis.current++;\n\t\t\treturn;\n\t\t}\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.queue.push(resolve);\n\t\t});\n\t}\n\t/** Releases a slot, unblocking the next queued caller if any. */\n\trelease() {\n\t\tconst next = this.queue.shift();\n\t\tif (next) next();\n\t\telse this.current--;\n\t}\n\t/**\n\t* Number of slots currently available.\n\t*\n\t* @returns The count of free concurrency slots.\n\t*/\n\tget available() {\n\t\treturn this.limit - this.current;\n\t}\n};\n/**\n* Maps over an array with bounded concurrency.\n*\n* @param items - Input items to process.\n* @param concurrency - Maximum number of items processed in parallel.\n* @param fn - Async function applied to each item.\n*\n* @returns Results in the same order as the input items.\n*/\nasync function mapConcurrent(items, concurrency, fn) {\n\tconst sem = new Semaphore(concurrency);\n\tconst results = new Array(items.length);\n\tconst tasks = items.map(async (item, i) => {\n\t\tawait sem.acquire();\n\t\ttry {\n\t\t\tresults[i] = await fn(item, i);\n\t\t} finally {\n\t\t\tsem.release();\n\t\t}\n\t});\n\tawait Promise.all(tasks);\n\treturn results;\n}\n//#endregion\nexport { Semaphore, mapConcurrent };\n\n//# sourceMappingURL=concurrency.js.map","//#region src/types/file.ts\n/**\n* Named constants for the action that created a file version.\n*\n* @example\n* ```ts\n* if (file.action === FileAction.Hide) { ... }\n* ```\n*/\nvar FileAction = {\n\t/** Large file upload started but not yet finished. */\n\tStart: \"start\",\n\t/** Normal upload (small or finished large file). */\n\tUpload: \"upload\",\n\t/** Hide marker (soft delete). */\n\tHide: \"hide\",\n\t/** Virtual folder marker. */\n\tFolder: \"folder\",\n\t/** Created via server-side copy. */\n\tCopy: \"copy\"\n};\n/**\n* Named constants for how metadata is handled during a file copy.\n*\n* @example\n* ```ts\n* await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n* ```\n*/\nvar MetadataDirective = {\n\t/** Preserve the source file's contentType and fileInfo. */\n\tCopy: \"COPY\",\n\t/** Use the values provided in the copy request. */\n\tReplace: \"REPLACE\"\n};\n//#endregion\nexport { FileAction, MetadataDirective };\n\n//# sourceMappingURL=file.js.map","//#region src/upload/abort-scope.ts\n/**\n* Creates an abort scope linked to an optional upstream signal.\n* Task failures can abort the same scope so sibling tasks stop promptly.\n* @param upstream - Caller-provided abort signal, if any.\n*\n* @returns A linked abort scope.\n*/\nfunction createAbortScope(upstream) {\n\tconst controller = new AbortController();\n\tlet upstreamAbort;\n\tconst abort = (reason) => {\n\t\tif (!controller.signal.aborted) controller.abort(reason);\n\t};\n\tif (upstream?.aborted === true) abort(upstream.reason);\n\telse if (upstream !== void 0) {\n\t\tupstreamAbort = () => abort(upstream.reason);\n\t\tupstream.addEventListener(\"abort\", upstreamAbort, { once: true });\n\t}\n\treturn {\n\t\tsignal: controller.signal,\n\t\tabort,\n\t\tdispose() {\n\t\t\tif (upstreamAbort !== void 0) upstream?.removeEventListener(\"abort\", upstreamAbort);\n\t\t}\n\t};\n}\n/**\n* Throws the abort reason or first task rejection from a settled task set.\n* @param settled - Results from `Promise.allSettled`.\n* @param abortScope - Scope that coordinated the tasks.\n*\n* @throws The abort reason or first rejected task reason.\n*/\nfunction throwRejectedOrAbortReason(settled, abortScope) {\n\tconst rejected = settled.find((result) => result.status === \"rejected\");\n\tif (rejected === void 0) return;\n\tif (abortScope.signal.aborted && abortScope.signal.reason !== void 0) throw abortScope.signal.reason;\n\t/* v8 ignore next -- Defensive fallback for unexpected task rejections outside the abort scope. */\n\tthrow rejected.reason;\n}\n/**\n* Returns the observable reason for an aborted signal.\n* @param signal - Aborted signal to inspect.\n*\n* @returns The signal's reason, or a standard AbortError when the runtime did not provide one.\n*/\nfunction abortReason(signal) {\n\treturn signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\n/**\n* Races a request promise against an abort signal.\n*\n* The underlying request must still receive the same signal so transports can\n* cancel their network work. This helper makes callers stop waiting promptly\n* even when a test double or custom transport ignores the signal.\n*\n* @param promise - Request promise to observe.\n* @param signal - Signal that should stop waiting for the request.\n*\n* @returns The request result if it settles before the signal aborts.\n*\n* @throws The abort reason if the signal aborts first, or the request rejection.\n*/\nasync function raceWithAbort(promise, signal) {\n\tif (signal.aborted) {\n\t\tpromise.catch(() => {});\n\t\tthrow abortReason(signal);\n\t}\n\tlet removeAbortListener;\n\tconst abort = new Promise((_, reject) => {\n\t\tconst onAbort = () => reject(abortReason(signal));\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\treturn await Promise.race([promise, abort]);\n\t} catch (err) {\n\t\tif (signal.aborted) promise.catch(() => {});\n\t\tthrow err;\n\t} finally {\n\t\tremoveAbortListener?.();\n\t}\n}\n//#endregion\nexport { abortReason, createAbortScope, raceWithAbort, throwRejectedOrAbortReason };\n\n//# sourceMappingURL=abort-scope.js.map","//#region src/internal/url-redaction.ts\n/**\n* Redact a URL before including it in an error message.\n*\n* @param url - Absolute URL, relative URL, or parsed URL to redact.\n* @param options - Optional base URL and invalid-URL placeholder.\n*\n* @returns A URL string with userinfo, query string, fragment, and path\n* segments removed.\n*/\nfunction redactUrlForError(url, options = {}) {\n\ttry {\n\t\tconst parsed = url instanceof URL ? new URL(url) : options.baseUrl !== void 0 ? new URL(url, options.baseUrl) : new URL(url);\n\t\tif (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") return options.invalidUrlLabel ?? \"\";\n\t\tparsed.username = \"\";\n\t\tparsed.password = \"\";\n\t\tparsed.search = \"\";\n\t\tparsed.hash = \"\";\n\t\tparsed.pathname = redactPathname(parsed.pathname);\n\t\treturn parsed.toString();\n\t} catch {\n\t\treturn options.invalidUrlLabel ?? \"\";\n\t}\n}\nfunction redactPathname(pathname) {\n\treturn pathname.split(\"/\").some(Boolean) ? \"/...\" : pathname;\n}\n//#endregion\nexport { redactUrlForError };\n\n//# sourceMappingURL=url-redaction.js.map","//#region src/types/errors.ts\n/**\n* B2 API error codes documented by the SDK.\n* This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback\n* so callers can receive unknown future server codes while keeping autocomplete\n* for known values.\n*/\nvar KNOWN_B2_ERROR_CODES = [\n\t\"expired_auth_token\",\n\t\"bad_auth_token\",\n\t\"unauthorized\",\n\t\"bad_request\",\n\t\"bad_bucket_name\",\n\t\"bad_bucket_id\",\n\t\"not_found\",\n\t\"method_not_allowed\",\n\t\"request_timeout\",\n\t\"too_many_requests\",\n\t\"conflict\",\n\t\"duplicate_bucket_name\",\n\t\"too_many_buckets\",\n\t\"too_many_files\",\n\t\"cap_exceeded\",\n\t\"storage_cap_exceeded\",\n\t\"transaction_cap_exceeded\",\n\t\"download_cap_exceeded\",\n\t\"access_denied\",\n\t\"service_unavailable\",\n\t\"internal_error\",\n\t\"bad_json\",\n\t\"invalid_bucket_id\",\n\t\"invalid_bucket_name\",\n\t\"invalid_bucket_info\",\n\t\"file_not_present\",\n\t\"no_such_file\",\n\t\"out_of_range\",\n\t\"range_not_satisfiable\",\n\t\"invalid_file_id\",\n\t\"invalid_file_name\",\n\t\"invalid_file_info\",\n\t\"invalid_part_number\",\n\t\"bad_sha1_checksum\"\n];\n//#endregion\nexport { KNOWN_B2_ERROR_CODES };\n\n//# sourceMappingURL=errors.js.map","import { redactUrlForError } from \"../internal/url-redaction.js\";\nimport { KNOWN_B2_ERROR_CODES } from \"../types/errors.js\";\n//#region src/errors/index.ts\n/**\n* Typed error hierarchy for B2 API failures.\n*\n* Every B2 error response maps to a specific {@link B2Error} subclass.\n* Retry behavior is exposed through {@link B2Error.retryable}.\n* Examples include {@link ExpiredAuthTokenError} and {@link CapExceededError}.\n* Use {@link classifyError} to convert a raw error response into the\n* appropriate subclass.\n*\n* Convention: most `B2Error` subclasses represent failures returned by the B2\n* API. The client-side exception is {@link B2RealmConfigurationError}; it\n* extends `B2Error` so realm-validation failures can be handled with the SDK\n* error hierarchy before credentials are sent.\n*\n* Other programming errors and SDK preconditions, such as \"not yet authorized\",\n* \"stream consumed twice\", or \"called before init\", use the native `Error`\n* constructor instead. The direct `Error` outliers are\n* {@link B2InsufficientCapabilityError}, {@link B2RedirectError},\n* {@link B2SsrfError}, {@link NetworkError},\n* {@link ResumeFileIdMismatchError}, {@link UploadResponseBodyError}, and\n* {@link FinishLargeFileResponseBodyError}.\n*\n* @packageDocumentation\n*/\n/** Thrown when an explicit resumeFileId is not compatible with the requested upload. */\nvar ResumeFileIdMismatchError = class extends Error {\n\t/** Caller-supplied unfinished large file ID that failed verification. */\n\tfileId;\n\t/** Requested destination file name. */\n\tfileName;\n\t/**\n\t* Creates a new resume-file ID mismatch error.\n\t* @param fileId - Caller-supplied unfinished large file ID that failed verification.\n\t* @param fileName - Requested destination file name.\n\t*/\n\tconstructor(fileId, fileName) {\n\t\tsuper(`uploadLargeFile: resumeFileId ${fileId} does not identify a compatible unfinished large file for ${fileName}.`);\n\t\tthis.name = \"ResumeFileIdMismatchError\";\n\t\tthis.fileId = fileId;\n\t\tthis.fileName = fileName;\n\t}\n};\n/**\n* Base error class for all B2 API errors.\n* Contains the HTTP status, B2 error code, and retry metadata from the response.\n*/\nvar B2Error = class extends Error {\n\t/** HTTP status code returned by the B2 API. */\n\tstatus;\n\t/** B2 error code identifying the error type (e.g. `expired_auth_token`). */\n\tcode;\n\t/** B2 request ID from the `X-Bz-Request-Id` response header, if present. */\n\trequestId;\n\t/** Retry delay in seconds from the `Retry-After` response header, if present. */\n\tretryAfter;\n\t/** Whether this error is transient and the request can be retried. */\n\tretryable;\n\t/**\n\t* Creates a new B2Error instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional retry and request metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response.message);\n\t\tthis.name = \"B2Error\";\n\t\tthis.status = response.status;\n\t\tthis.code = response.code;\n\t\tif (options?.retryAfter !== void 0) this.retryAfter = options.retryAfter;\n\t\tif (options?.requestId !== void 0) this.requestId = options.requestId;\n\t\tthis.retryable = isTransient(response.status, response.code);\n\t}\n};\n/** Thrown when the auth token has expired. Triggers automatic re-authorization. */\nvar ExpiredAuthTokenError = class extends B2Error {\n\t/**\n\t* Creates a new ExpiredAuthTokenError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"ExpiredAuthTokenError\";\n\t}\n};\n/** Thrown when the auth token is invalid or unauthorized. */\nvar BadAuthTokenError = class extends B2Error {\n\t/**\n\t* Creates a new BadAuthTokenError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"BadAuthTokenError\";\n\t}\n};\n/** Thrown when the B2 service is temporarily unavailable (HTTP 503). */\nvar ServiceUnavailableError = class extends B2Error {\n\t/**\n\t* Creates a new ServiceUnavailableError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"ServiceUnavailableError\";\n\t}\n};\n/** Thrown when B2 reports an internal server error. */\nvar InternalError = class extends B2Error {\n\t/**\n\t* Creates a new InternalError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InternalError\";\n\t}\n};\n/** Thrown when a request times out on the server side (HTTP 408). */\nvar RequestTimeoutError = class extends B2Error {\n\t/**\n\t* Creates a new RequestTimeoutError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"RequestTimeoutError\";\n\t}\n};\n/** Thrown when the client has sent too many requests (HTTP 429). */\nvar TooManyRequestsError = class extends B2Error {\n\t/**\n\t* Creates a new TooManyRequestsError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"TooManyRequestsError\";\n\t}\n};\n/** Thrown when the account has reached the maximum number of buckets. */\nvar TooManyBucketsError = class extends B2Error {\n\t/**\n\t* Creates a new TooManyBucketsError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"TooManyBucketsError\";\n\t}\n};\n/** Thrown when the bucket or request has reached the maximum number of files. */\nvar TooManyFilesError = class extends B2Error {\n\t/**\n\t* Creates a new TooManyFilesError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"TooManyFilesError\";\n\t}\n};\n/** Thrown when a storage, transaction, or download cap has been exceeded. */\nvar CapExceededError = class extends B2Error {\n\t/**\n\t* Creates a new CapExceededError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"CapExceededError\";\n\t}\n};\n/** Thrown when the application key does not have permission for the requested operation. */\nvar AccessDeniedError = class extends B2Error {\n\t/**\n\t* Creates a new AccessDeniedError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"AccessDeniedError\";\n\t}\n};\n/** Thrown when the requested file does not exist. */\nvar FileNotPresentError = class extends B2Error {\n\t/**\n\t* Creates a new FileNotPresentError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"FileNotPresentError\";\n\t}\n};\n/** Thrown when a requested B2 resource does not exist. */\nvar NotFoundError = class extends B2Error {\n\t/**\n\t* Creates a new NotFoundError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"NotFoundError\";\n\t}\n};\n/** Thrown when creating a bucket with a name that already exists in the account. */\nvar DuplicateBucketNameError = class extends B2Error {\n\t/**\n\t* Creates a new DuplicateBucketNameError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"DuplicateBucketNameError\";\n\t}\n};\n/** Thrown when a bucket name is malformed, reserved, or otherwise rejected by B2. */\nvar InvalidBucketNameError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidBucketNameError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidBucketNameError\";\n\t}\n};\n/** Thrown when bucket metadata fails B2 validation. */\nvar InvalidBucketInfoError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidBucketInfoError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidBucketInfoError\";\n\t}\n};\n/** Thrown when a bucket ID is malformed or does not identify a valid bucket. */\nvar BadBucketIdError = class extends B2Error {\n\t/**\n\t* Creates a new BadBucketIdError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"BadBucketIdError\";\n\t}\n};\n/** Thrown when the B2 endpoint does not allow the request method. */\nvar MethodNotAllowedError = class extends B2Error {\n\t/**\n\t* Creates a new MethodNotAllowedError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"MethodNotAllowedError\";\n\t}\n};\n/** Thrown when the request conflicts with current B2 resource state. */\nvar ConflictError = class extends B2Error {\n\t/**\n\t* Creates a new ConflictError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"ConflictError\";\n\t}\n};\n/** Thrown for general bad request errors (HTTP 400) not covered by a more specific subclass. */\nvar BadRequestError = class extends B2Error {\n\t/**\n\t* Creates a new BadRequestError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"BadRequestError\";\n\t}\n};\n/** Thrown when B2 cannot parse the JSON request body. */\nvar BadJsonError = class extends B2Error {\n\t/**\n\t* Creates a new BadJsonError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"BadJsonError\";\n\t}\n};\n/** Thrown when a bucket ID has a valid shape but does not identify a usable bucket. */\nvar InvalidBucketIdError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidBucketIdError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidBucketIdError\";\n\t}\n};\n/** Thrown when a numeric request parameter is outside the allowed range. */\nvar OutOfRangeError = class extends B2Error {\n\t/**\n\t* Creates a new OutOfRangeError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"OutOfRangeError\";\n\t}\n};\n/** Thrown when a requested byte range cannot be satisfied. */\nvar RangeNotSatisfiableError = class extends B2Error {\n\t/**\n\t* Creates a new RangeNotSatisfiableError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"RangeNotSatisfiableError\";\n\t}\n};\n/** Thrown when a file name is malformed or otherwise rejected by B2. */\nvar InvalidFileNameError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidFileNameError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidFileNameError\";\n\t}\n};\n/** Thrown when file metadata fails B2 validation. */\nvar InvalidFileInfoError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidFileInfoError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidFileInfoError\";\n\t}\n};\n/** Thrown when a file ID is malformed or does not identify a valid file. */\nvar InvalidFileIdError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidFileIdError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidFileIdError\";\n\t}\n};\n/** Thrown when a multipart upload part number is invalid. */\nvar InvalidPartNumberError = class extends B2Error {\n\t/**\n\t* Creates a new InvalidPartNumberError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"InvalidPartNumberError\";\n\t}\n};\n/**\n* Thrown when an upload URL is no longer valid and must be refreshed.\n*\n* Forward-compat insurance: B2 does not currently surface a distinct\n* error code for this case, so {@link classifyError} never actually\n* instantiates this class today. It's part of the public API so\n* consumers can pre-write `instanceof` checks; when B2 documents a\n* `bad_upload_url` (or similar) error code, the `classifyError`\n* switch gets a matching case and existing consumer code starts\n* catching the typed error without any changes on their side.\n*\n* Until then, expect `BadRequestError` for upload-URL invalidation\n* scenarios — that's what B2 currently returns.\n*/\nvar BadUploadUrlError = class extends B2Error {\n\t/**\n\t* Creates a new BadUploadUrlError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"BadUploadUrlError\";\n\t}\n};\n/**\n* Thrown when the uploaded file's SHA-1 checksum does not match the\n* expected value.\n*\n* When B2 returns `bad_sha1_checksum`, {@link classifyError} instantiates\n* this class so callers can handle checksum failures with `instanceof`.\n* Generic `bad_request` checksum failures continue to classify as\n* {@link BadRequestError}.\n*/\nvar ChecksumMismatchError = class extends B2Error {\n\t/**\n\t* Creates a new ChecksumMismatchError instance.\n\t* @param response - Parsed B2 error response body.\n\t* @param options - Optional metadata from response headers.\n\t*/\n\tconstructor(response, options) {\n\t\tsuper(response, options);\n\t\tthis.name = \"ChecksumMismatchError\";\n\t}\n};\n/**\n* Thrown by client-side capability checks when the application key is missing\n* capabilities required by an operation. Not raised by the server.\n*/\nvar B2InsufficientCapabilityError = class extends Error {\n\t/** Capabilities that were required for the operation. */\n\trequired;\n\t/** Capabilities that the current key actually has. */\n\tavailable;\n\t/** Capabilities present in `required` but not in `available`. */\n\tmissing;\n\t/**\n\t* Creates a new B2InsufficientCapabilityError instance.\n\t*\n\t* @param required - Capabilities the operation requires.\n\t* @param available - Capabilities the current key holds.\n\t* @param missing - The subset of required that isn't available.\n\t*/\n\tconstructor(required, available, missing) {\n\t\tsuper(`Application key is missing capabilities: ${missing.join(\", \")}`);\n\t\tthis.name = \"B2InsufficientCapabilityError\";\n\t\tthis.required = required;\n\t\tthis.available = available;\n\t\tthis.missing = missing;\n\t}\n};\n/**\n* Thrown when the SDK is asked to fetch a URL whose host is outside the\n* authorized B2 realm. Defense against SSRF / URL-substitution attacks where\n* a compromised or hostile B2 endpoint returns an upload URL pointing at an\n* internal service (e.g. cloud metadata at `169.254.169.254`).\n*\n* Not retryable.\n*/\nvar B2SsrfError = class extends Error {\n\t/** Always `false` — this is a security failure, not transient. */\n\tretryable = false;\n\t/**\n\t* Creates a new {@link B2SsrfError}.\n\t*\n\t* @param message - Human-readable description of which URL was rejected and why.\n\t* @param url - The URL that was rejected. Stored as a sanitized URL.\n\t*/\n\tconstructor(message, url) {\n\t\tconst safeUrl = redactUrlForError(url);\n\t\tsuper(`${message.split(url).join(safeUrl)} (${safeUrl})`);\n\t\tthis.name = \"B2SsrfError\";\n\t\tthis.url = safeUrl;\n\t}\n\t/** Sanitized URL that was rejected. */\n\turl;\n};\n/** Thrown when a configured auth realm cannot safely be used for authorization. */\nvar B2RealmConfigurationError = class extends B2Error {\n\t/**\n\t* Creates a new B2RealmConfigurationError instance.\n\t*\n\t* @param message - Human-readable description of the invalid realm setting.\n\t*/\n\tconstructor(message) {\n\t\tsuper({\n\t\t\tstatus: 400,\n\t\t\tcode: \"bad_request\",\n\t\t\tmessage\n\t\t});\n\t\tthis.name = \"B2RealmConfigurationError\";\n\t}\n};\n/** Thrown when the SDK refuses to follow an HTTP redirect automatically. */\nvar B2RedirectError = class extends Error {\n\t/** Always `false` because a blocked redirect is deterministic. */\n\tretryable = false;\n\t/** Sanitized request URL whose response attempted to redirect. */\n\turl;\n\t/** HTTP redirect status code, or 0 for an opaque browser redirect. */\n\tstatus;\n\t/** Sanitized redirect target, or `null` when no Location header was present. */\n\tlocation;\n\t/**\n\t* Creates a new B2RedirectError instance.\n\t*\n\t* @param url - Request URL whose response attempted to redirect. Stored as a sanitized URL.\n\t* @param status - HTTP redirect status code.\n\t* @param location - Redirect Location header, if present. Stored as a sanitized URL.\n\t*/\n\tconstructor(url, status, location) {\n\t\tconst safeUrl = redactUrlForError(url);\n\t\tconst safeLocation = location !== null ? redactUrlForError(location, { baseUrl: url }) : null;\n\t\tsuper(safeLocation !== null ? `HTTP ${status} redirect blocked for ${safeUrl} to ${safeLocation}` : `HTTP ${status} redirect blocked for ${safeUrl}`);\n\t\tthis.name = \"B2RedirectError\";\n\t\tthis.url = safeUrl;\n\t\tthis.status = status;\n\t\tthis.location = safeLocation;\n\t}\n};\n/** Thrown when a network-level failure occurs (DNS, TCP, TLS). Always retryable. */\nvar NetworkError = class extends Error {\n\tcause;\n\t/** Always `true` since network errors are transient. */\n\tretryable = true;\n\t/**\n\t* Creates a new NetworkError instance.\n\t* @param message - Human-readable description of the network failure.\n\t* @param cause - The underlying error that caused this failure, if any.\n\t*/\n\tconstructor(message, cause) {\n\t\tsuper(message);\n\t\tthis.cause = cause;\n\t\tthis.name = \"NetworkError\";\n\t}\n};\n/**\n* Thrown when an upload POST returned a response but its body could not be\n* read. The upload may already have been stored by B2, so retrying this error\n* can create duplicate file versions or parts.\n*/\nvar UploadResponseBodyError = class extends Error {\n\t/** Underlying response body error, when available. */\n\tcause;\n\t/**\n\t* Creates a new UploadResponseBodyError instance.\n\t* @param message - Human-readable description of the response read failure.\n\t* @param options - Optional cause.\n\t*/\n\tconstructor(message, options = {}) {\n\t\tsuper(message, { cause: options.cause });\n\t\tthis.name = \"UploadResponseBodyError\";\n\t\tif (options.cause !== void 0) this.cause = options.cause;\n\t}\n};\n/**\n* Thrown when `b2_finish_large_file` returned a response but its body could not\n* be read. The large file may already be committed server-side, so high-level\n* upload paths do not cancel the large file after this error.\n*/\nvar FinishLargeFileResponseBodyError = class extends Error {\n\t/** Ambiguous large file ID that may already be committed server-side. */\n\tfileId;\n\t/** Bucket requested by the high-level upload, when available. */\n\tbucketId;\n\t/** File name requested by the high-level upload, when available. */\n\tfileName;\n\t/**\n\t* Creates a new FinishLargeFileResponseBodyError instance.\n\t* @param message - Human-readable description of the response read failure.\n\t* @param options - Optional cause and reconciliation metadata.\n\t*/\n\tconstructor(message, options = {}) {\n\t\tsuper(message, { cause: options.cause });\n\t\tthis.name = \"FinishLargeFileResponseBodyError\";\n\t\tif (options.cause !== void 0) this.cause = options.cause;\n\t\tif (options.fileId !== void 0) this.fileId = options.fileId;\n\t\tif (options.bucketId !== void 0) this.bucketId = options.bucketId;\n\t\tif (options.fileName !== void 0) this.fileName = options.fileName;\n\t}\n};\nfunction isTransient(status, code) {\n\tif (status === 408 || status === 429) return true;\n\tif (status === 500 || status === 502 || status === 503 || status === 504) return true;\n\tif (code === \"expired_auth_token\") return true;\n\tif (code === \"service_unavailable\" || code === \"request_timeout\") return true;\n\treturn false;\n}\nvar knownB2ErrorCodes = new Set(KNOWN_B2_ERROR_CODES);\nfunction isKnownB2ErrorCode(code) {\n\treturn knownB2ErrorCodes.has(code);\n}\nfunction assertNever(value) {\n\tthrow new Error(`Unhandled B2 error code: ${String(value)}`);\n}\nfunction classifyKnownError(response, code, options) {\n\tswitch (code) {\n\t\tcase \"expired_auth_token\": return new ExpiredAuthTokenError(response, options);\n\t\tcase \"bad_auth_token\":\n\t\tcase \"unauthorized\": return new BadAuthTokenError(response, options);\n\t\tcase \"bad_request\": return new BadRequestError(response, options);\n\t\tcase \"bad_bucket_name\":\n\t\tcase \"invalid_bucket_name\": return new InvalidBucketNameError(response, options);\n\t\tcase \"bad_bucket_id\": return new BadBucketIdError(response, options);\n\t\tcase \"not_found\": return new NotFoundError(response, options);\n\t\tcase \"method_not_allowed\": return new MethodNotAllowedError(response, options);\n\t\tcase \"request_timeout\": return new RequestTimeoutError(response, options);\n\t\tcase \"too_many_requests\": return new TooManyRequestsError(response, options);\n\t\tcase \"conflict\": return new ConflictError(response, options);\n\t\tcase \"duplicate_bucket_name\": return new DuplicateBucketNameError(response, options);\n\t\tcase \"too_many_buckets\": return new TooManyBucketsError(response, options);\n\t\tcase \"too_many_files\": return new TooManyFilesError(response, options);\n\t\tcase \"cap_exceeded\":\n\t\tcase \"storage_cap_exceeded\":\n\t\tcase \"transaction_cap_exceeded\":\n\t\tcase \"download_cap_exceeded\": return new CapExceededError(response, options);\n\t\tcase \"access_denied\": return new AccessDeniedError(response, options);\n\t\tcase \"service_unavailable\": return new ServiceUnavailableError(response, options);\n\t\tcase \"internal_error\": return new InternalError(response, options);\n\t\tcase \"bad_json\": return new BadJsonError(response, options);\n\t\tcase \"invalid_bucket_id\": return new InvalidBucketIdError(response, options);\n\t\tcase \"invalid_bucket_info\": return new InvalidBucketInfoError(response, options);\n\t\tcase \"file_not_present\":\n\t\tcase \"no_such_file\": return new FileNotPresentError(response, options);\n\t\tcase \"out_of_range\": return new OutOfRangeError(response, options);\n\t\tcase \"range_not_satisfiable\": return new RangeNotSatisfiableError(response, options);\n\t\tcase \"invalid_file_id\": return new InvalidFileIdError(response, options);\n\t\tcase \"invalid_file_name\": return new InvalidFileNameError(response, options);\n\t\tcase \"invalid_file_info\": return new InvalidFileInfoError(response, options);\n\t\tcase \"invalid_part_number\": return new InvalidPartNumberError(response, options);\n\t\tcase \"bad_sha1_checksum\": return new ChecksumMismatchError(response, options);\n\t\tdefault: return assertNever(code);\n\t}\n}\nfunction classifyUnknownError(response, options) {\n\tif (response.status === 429) return new TooManyRequestsError(response, options);\n\tif (response.status === 503) return new ServiceUnavailableError(response, options);\n\tif (response.status === 408) return new RequestTimeoutError(response, options);\n\treturn new B2Error(response, options);\n}\n/**\n* Maps a B2 error response to the appropriate {@link B2Error} subclass.\n* Uses known error codes for exact matching, then falls back to HTTP status\n* codes for unknown future B2 codes.\n*\n* Maintainer note: when B2 documents a new error code, add it to\n* `KNOWN_B2_ERROR_CODES` in `src/types/errors.ts` and add a matching\n* `classifyKnownError` switch case. Unknown codes fall through to the\n* HTTP-status-based heuristic and finally to a generic `B2Error`, which is\n* safe but loses semantic specificity (the caller can't `instanceof` against\n* a precise subclass and the retry decision relies on status alone).\n*\n* @param response - Parsed B2 error response body.\n* @param options - Optional retry and request metadata from response headers.\n*\n* @returns A typed B2Error subclass instance.\n*/\nfunction classifyError(response, options) {\n\tif (response.code === \"internal_error\" && response.status !== 500) return classifyUnknownError(response, options);\n\tif (isKnownB2ErrorCode(response.code)) return classifyKnownError(response, response.code, options);\n\treturn classifyUnknownError(response, options);\n}\n//#endregion\nexport { AccessDeniedError, B2Error, B2InsufficientCapabilityError, B2RealmConfigurationError, B2RedirectError, B2SsrfError, BadAuthTokenError, BadBucketIdError, BadJsonError, BadRequestError, BadUploadUrlError, CapExceededError, ChecksumMismatchError, ConflictError, DuplicateBucketNameError, ExpiredAuthTokenError, FileNotPresentError, FinishLargeFileResponseBodyError, InternalError, InvalidBucketIdError, InvalidBucketInfoError, InvalidBucketNameError, InvalidFileIdError, InvalidFileInfoError, InvalidFileNameError, InvalidPartNumberError, MethodNotAllowedError, NetworkError, NotFoundError, OutOfRangeError, RangeNotSatisfiableError, RequestTimeoutError, ResumeFileIdMismatchError, ServiceUnavailableError, TooManyBucketsError, TooManyFilesError, TooManyRequestsError, UploadResponseBodyError, classifyError };\n\n//# sourceMappingURL=index.js.map","//#region src/util/best-effort.ts\n/**\n* Runs an async cleanup operation and swallows any rejection.\n*\n* Used at error-handling boundaries (e.g. after a multipart upload fails,\n* when trying to `cancelLargeFile` on the orphaned upload). The primary\n* error is what the caller wants to see; a secondary failure during\n* cleanup must not shadow it.\n*\n* Naming the pattern instead of inlining a try/catch with an empty catch\n* makes the intent explicit at the call site: this is best-effort cleanup,\n* not a silent error swallow.\n*\n* @param fn - Cleanup async function. Its return value is ignored; any\n* thrown error or rejected promise is caught and discarded.\n* @param onError - Optional observer called with the swallowed cleanup error.\n*\n* @returns A promise that always resolves, regardless of `fn`'s outcome.\n*\n* @example\n* ```ts\n* try {\n* await uploadParts(...)\n* } catch (err) {\n* await bestEffort(() =>\n* raw.cancelLargeFile(apiUrl, authToken, { fileId: largeFileId }),\n* )\n* throw err\n* }\n* ```\n*/\nasync function bestEffort(fn, onError) {\n\ttry {\n\t\tawait fn();\n\t} catch (error) {\n\t\ttry {\n\t\t\tonError?.(error);\n\t\t} catch {}\n\t}\n}\n//#endregion\nexport { bestEffort };\n\n//# sourceMappingURL=best-effort.js.map","import { FinishLargeFileResponseBodyError } from \"../errors/index.js\";\nimport { bestEffort } from \"../util/best-effort.js\";\n//#region src/upload/cancel.ts\n/** Default wall-clock bound for best-effort cleanup calls after upload failure. */\nvar DEFAULT_CLEANUP_TIMEOUT_MS = 3e4;\nvar fallbackCleanupDisposers = /* @__PURE__ */ new WeakMap();\n/**\n* Cancels an unfinished large file on a best-effort basis. Used at every\n* error-handling boundary in the multipart upload, write-stream, and\n* server-side copy paths to roll back in-progress uploads without\n* letting a cancellation failure mask the underlying error the caller\n* is about to see.\n*\n* Centralising the call removes a five-line `bestEffort` block that\n* recurred at six sites with identical shape — the only thing that\n* changed was the captured `fileId` and the surrounding error trail.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state for the API URL + token.\n* @param fileId - The in-progress large file ID to cancel.\n* @param options - Optional request controls and cleanup-failure observer.\n*\n* @returns A promise that always resolves, regardless of the cancel\n* call's outcome.\n*/\nasync function cancelLargeFileBestEffort(raw, accountInfo, fileId, options) {\n\tawait bestEffort(async () => {\n\t\tconst requestOptions = cleanupRequestOptions(options?.signal);\n\t\tawait waitForCleanup(raw.cancelLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId }, requestOptions), requestOptions.signal);\n\t}, (error) => options?.onCleanupFailure?.({\n\t\tfileId,\n\t\terror,\n\t\treason: \"cancel-failed\"\n\t}));\n}\n/**\n* Returns cleanup request controls with a live timeout signal.\n*\n* @param signal - Caller-provided abort signal, if any.\n* @param timeoutMs - Maximum time to spend waiting for cleanup.\n*\n* @returns Request controls with a signal independent of an already-aborted caller signal.\n*/\nfunction cleanupRequestOptions(signal, timeoutMs = DEFAULT_CLEANUP_TIMEOUT_MS) {\n\treturn { signal: createCleanupSignal(signal, timeoutMs) };\n}\nfunction createCleanupSignal(signal, timeoutMs) {\n\tif (typeof AbortSignal.timeout === \"function\") {\n\t\tif (signal === void 0 || signal.aborted) return AbortSignal.timeout(timeoutMs);\n\t\tif (typeof AbortSignal.any === \"function\") return AbortSignal.any([signal, AbortSignal.timeout(timeoutMs)]);\n\t}\n\treturn createFallbackCleanupSignal(signal, timeoutMs);\n}\nfunction createFallbackCleanupSignal(signal, timeoutMs) {\n\tconst controller = new AbortController();\n\tconst timeout = setTimeout(() => {\n\t\tabortFallbackCleanup(controller, cleanupTimeoutReason(), cleanup);\n\t}, timeoutMs);\n\tconst onAbort = () => {\n\t\tconst reason = signal === void 0 ? cleanupDomException(\"Cleanup aborted\", \"AbortError\") : cleanupAbortReason(signal);\n\t\tabortFallbackCleanup(controller, reason, cleanup);\n\t};\n\tconst cleanup = () => {\n\t\tclearTimeout(timeout);\n\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\tfallbackCleanupDisposers.delete(controller.signal);\n\t};\n\tfallbackCleanupDisposers.set(controller.signal, cleanup);\n\tif (signal === void 0 || signal.aborted) return controller.signal;\n\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\tcontroller.signal.addEventListener(\"abort\", cleanup, { once: true });\n\treturn controller.signal;\n}\nfunction abortFallbackCleanup(controller, reason, cleanup) {\n\tif (!controller.signal.aborted) controller.abort(reason);\n\tcleanup();\n}\nasync function waitForCleanup(request, signal) {\n\tif (signal.aborted) throw cleanupAbortReason(signal);\n\tlet removeAbortListener;\n\tconst aborted = new Promise((_resolve, reject) => {\n\t\tconst onAbort = () => reject(cleanupAbortReason(signal));\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\tawait Promise.race([request, aborted]);\n\t} finally {\n\t\tremoveAbortListener?.();\n\t\tfallbackCleanupDisposers.get(signal)?.();\n\t\trequest.catch(() => {});\n\t}\n}\nfunction cleanupAbortReason(signal) {\n\treturn signal.reason ?? cleanupDomException(\"Cleanup aborted\", \"AbortError\");\n}\nfunction cleanupTimeoutReason() {\n\treturn cleanupDomException(\"Cleanup timed out\", \"TimeoutError\");\n}\nfunction cleanupDomException(message, name) {\n\tif (typeof DOMException === \"function\") return new DOMException(message, name);\n\tconst error = new Error(message);\n\terror.name = name;\n\treturn error;\n}\n/**\n* Emits an observable cleanup event when cancellation is deliberately skipped\n* because `b2_finish_large_file` may already have committed the file.\n* @param fileId - Large file whose final state is ambiguous.\n* @param error - Ambiguous finish error that will be thrown to the caller.\n* @param onCleanupFailure - Optional observer for cleanup-related events.\n*/\nfunction notifyAmbiguousLargeFileCleanupSkipped(fileId, error, onCleanupFailure) {\n\ttry {\n\t\tonCleanupFailure?.({\n\t\t\tfileId,\n\t\t\terror,\n\t\t\treason: \"finish-ambiguous\"\n\t\t});\n\t} catch {}\n}\n/**\n* Adds high-level reconciliation metadata to an ambiguous finish response-body\n* error and notifies the cleanup observer that cancellation was skipped.\n*\n* @param err - Raw finish response-body error from the low-level client.\n* @param options - Large-file context used for reconciliation.\n*\n* @returns The enriched {@link FinishLargeFileResponseBodyError}.\n*/\nfunction handleAmbiguousFinishLargeFileResponseBodyError(err, options) {\n\tconst enriched = err.fileId === options.fileId && err.bucketId === options.bucketId && err.fileName === options.fileName ? err : new FinishLargeFileResponseBodyError(err.message, {\n\t\tcause: err.cause ?? err,\n\t\tfileId: options.fileId,\n\t\tbucketId: options.bucketId,\n\t\tfileName: options.fileName\n\t});\n\tnotifyAmbiguousLargeFileCleanupSkipped(options.fileId, enriched, options.onCleanupFailure);\n\treturn enriched;\n}\n/**\n* Performs the shared large-file failure policy: ambiguous finish-body errors\n* are enriched and left uncancelled, while all pre-finish errors trigger\n* best-effort cancellation.\n*\n* @param err - Error from a multipart upload/copy/write-stream path.\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param context - Large file metadata used for cleanup and diagnostics.\n* @param options - Cleanup policy controls.\n*\n* @returns The error that should be surfaced to the caller.\n*/\nasync function resolveLargeFileErrorAfterCleanup(err, raw, accountInfo, context, options = {}) {\n\tif (err instanceof FinishLargeFileResponseBodyError) return handleAmbiguousFinishLargeFileResponseBodyError(err, context);\n\tif (options.cancelOnError ?? true) await cancelLargeFileBestEffort(raw, accountInfo, context.fileId, {\n\t\t...context.signal !== void 0 ? { signal: context.signal } : {},\n\t\t...context.onCleanupFailure !== void 0 ? { onCleanupFailure: context.onCleanupFailure } : {}\n\t});\n\treturn err;\n}\n/**\n* Throwing wrapper around {@link resolveLargeFileErrorAfterCleanup} for paths\n* that can surface the error directly.\n* @param err - Error from a multipart upload/copy/write-stream path.\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param context - Large file metadata used for cleanup and diagnostics.\n* @param options - Cleanup policy controls.\n*\n* @throws The resolved large-file error after cleanup policy is applied.\n*/\nasync function cleanupAfterLargeFileError(err, raw, accountInfo, context, options) {\n\tthrow await resolveLargeFileErrorAfterCleanup(err, raw, accountInfo, context, options);\n}\n//#endregion\nexport { DEFAULT_CLEANUP_TIMEOUT_MS, cancelLargeFileBestEffort, cleanupAfterLargeFileError, cleanupRequestOptions, handleAmbiguousFinishLargeFileResponseBodyError, notifyAmbiguousLargeFileCleanupSkipped, resolveLargeFileErrorAfterCleanup };\n\n//# sourceMappingURL=cancel.js.map","import { FinishLargeFileResponseBodyError, NetworkError } from \"../errors/index.js\";\n//#region src/upload/finish.ts\n/**\n* Calls `b2_finish_large_file` and classifies failures after dispatch that can\n* hide an already-committed file as ambiguous finish failures.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param context - Finish request data and reconciliation metadata.\n*\n* @returns The completed file version metadata.\n*/\nasync function finishLargeFileWithAbortReconciliation(raw, accountInfo, context) {\n\tcontext.signal?.throwIfAborted();\n\ttry {\n\t\treturn await raw.finishLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tfileId: context.fileId,\n\t\t\tpartSha1Array: context.partSha1s\n\t\t}, context.signal === void 0 && context.retry === void 0 ? void 0 : {\n\t\t\t...context.signal !== void 0 ? { signal: context.signal } : {},\n\t\t\t...context.retry !== void 0 ? { retry: context.retry } : {}\n\t\t});\n\t} catch (err) {\n\t\tif (err instanceof FinishLargeFileResponseBodyError) throw finishLargeFileResponseBodyErrorWithContext(err, context);\n\t\tif (isAmbiguousFinishDispatchFailure(err, context.signal)) throw new FinishLargeFileResponseBodyError(\"b2_finish_large_file failed after dispatch; final file state is ambiguous.\", {\n\t\t\tcause: err,\n\t\t\tfileId: context.fileId,\n\t\t\tbucketId: context.bucketId,\n\t\t\tfileName: context.fileName\n\t\t});\n\t\tthrow err;\n\t}\n}\nfunction finishLargeFileResponseBodyErrorWithContext(err, context) {\n\tif (err.fileId === context.fileId && err.bucketId === context.bucketId && err.fileName === context.fileName) return err;\n\treturn new FinishLargeFileResponseBodyError(err.message, {\n\t\tcause: err.cause ?? err,\n\t\tfileId: context.fileId,\n\t\tbucketId: context.bucketId,\n\t\tfileName: context.fileName\n\t});\n}\nfunction isAmbiguousFinishDispatchFailure(err, signal) {\n\tif (err instanceof NetworkError) return true;\n\tif (isTimeoutError(err)) return true;\n\tif (signal?.aborted !== true) return false;\n\tif (signal.reason !== void 0 && Object.is(err, signal.reason)) return true;\n\treturn isAbortError(err);\n}\nfunction isAbortError(err) {\n\treturn err instanceof DOMException && err.name === \"AbortError\" || err instanceof Error && err.name === \"AbortError\";\n}\nfunction isTimeoutError(err) {\n\treturn err instanceof DOMException && err.name === \"TimeoutError\" || err instanceof Error && err.name === \"TimeoutError\";\n}\n//#endregion\nexport { finishLargeFileWithAbortReconciliation };\n\n//# sourceMappingURL=finish.js.map","//#region src/util/plan-ranges.ts\n/**\n* Lays out a sequence of contiguous, non-overlapping byte ranges over\n* `[0, totalSize)`. Every produced range is at most `chunkSize` bytes\n* long; the final range may be shorter if `totalSize` is not a multiple\n* of `chunkSize`.\n*\n* Replaces three near-identical hand-rolled loops in\n* `upload/large.ts`, `copy/large.ts`, and `download/parallel.ts`.\n*\n* @param totalSize - Total number of bytes to cover.\n* @param chunkSize - Target size of each range in bytes (last range may be smaller).\n*\n* @returns Ordered, non-overlapping range plans. Empty array when `totalSize === 0`.\n*/\nfunction planRanges(totalSize, chunkSize) {\n\tconst plans = [];\n\tlet offset = 0;\n\tlet index = 0;\n\twhile (offset < totalSize) {\n\t\tconst length = Math.min(chunkSize, totalSize - offset);\n\t\tconst end = offset + length - 1;\n\t\tplans.push({\n\t\t\tpartNumber: index + 1,\n\t\t\tindex,\n\t\t\toffset,\n\t\t\tlength,\n\t\t\tstart: offset,\n\t\t\tend\n\t\t});\n\t\toffset += length;\n\t\tindex++;\n\t}\n\treturn plans;\n}\n/**\n* Format an HTTP `Range:` request-header value covering the given\n* inclusive byte offsets. Centralises the `bytes=-` template\n* so the upload, copy, and download paths agree on syntax.\n*\n* @param start - Inclusive starting byte.\n* @param end - Inclusive ending byte.\n*\n* @returns The header value (e.g. `'bytes=0-99'`).\n*/\nfunction byteRangeHeader(start, end) {\n\treturn `bytes=${start}-${end}`;\n}\n//#endregion\nexport { byteRangeHeader, planRanges };\n\n//# sourceMappingURL=plan-ranges.js.map","import { MetadataDirective } from \"../types/file.js\";\nimport { fileId } from \"../types/ids.js\";\nimport { createAbortScope, raceWithAbort, throwRejectedOrAbortReason } from \"../upload/abort-scope.js\";\nimport { cancelLargeFileBestEffort, cleanupAfterLargeFileError } from \"../upload/cancel.js\";\nimport { Semaphore } from \"../upload/concurrency.js\";\nimport { finishLargeFileWithAbortReconciliation } from \"../upload/finish.js\";\nimport \"../util/defaults.js\";\nimport { byteRangeHeader, planRanges } from \"../util/plan-ranges.js\";\n//#region src/copy/large.ts\n/**\n* Performs a server-side copy of a file using the multipart `b2_copy_part` protocol.\n* The source bytes never traverse the client; B2 copies each range internally.\n*\n* Falls back to a single `copyFile` call when the source fits in one part.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state (used to resolve API URL, recommended part size).\n* @param options - Copy parameters including source, destination, and concurrency.\n*\n* @returns The resulting destination {@link FileVersion}.\n*/\nasync function copyLargeFile(raw, accountInfo, options) {\n\toptions.signal?.throwIfAborted();\n\tconst recommendedPartSize = accountInfo.getRecommendedPartSize();\n\tconst minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n\tconst partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n\tconst concurrency = options.concurrency ?? 4;\n\tconst sourceInfo = await raw.getFileInfo(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId: options.sourceFileId });\n\tconst totalSize = sourceInfo.contentLength;\n\tif (totalSize <= partSize) {\n\t\toptions.signal?.throwIfAborted();\n\t\tconst replaceMetadata = options.contentType !== void 0 || options.fileInfo !== void 0;\n\t\treturn raw.copyFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tsourceFileId: options.sourceFileId,\n\t\t\tfileName: options.fileName,\n\t\t\t...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : {},\n\t\t\t...replaceMetadata ? {\n\t\t\t\tmetadataDirective: MetadataDirective.Replace,\n\t\t\t\tcontentType: options.contentType ?? sourceInfo.contentType ?? \"b2/x-auto\",\n\t\t\t\tfileInfo: options.fileInfo ?? {}\n\t\t\t} : {},\n\t\t\t...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n\t\t\t...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {}\n\t\t}, options.signal !== void 0 ? { signal: options.signal } : void 0);\n\t}\n\tconst destBucketId = options.destinationBucketId ?? sourceInfo.bucketId;\n\tconst ranges = planRanges(totalSize, partSize);\n\tconst partSha1s = new Array(ranges.length);\n\tconst sem = new Semaphore(concurrency);\n\tconst abortScope = createAbortScope(options.signal);\n\tlet largeFileId;\n\ttry {\n\t\tabortScope.signal.throwIfAborted();\n\t\tconst startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tbucketId: destBucketId,\n\t\t\tfileName: options.fileName,\n\t\t\tcontentType: options.contentType ?? sourceInfo.contentType ?? \"b2/x-auto\",\n\t\t\tfileInfo: options.fileInfo ?? {},\n\t\t\t...options.destinationServerSideEncryption !== void 0 ? { serverSideEncryption: options.destinationServerSideEncryption } : {}\n\t\t}, { signal: abortScope.signal });\n\t\ttry {\n\t\t\tlargeFileId = (await raceWithAbort(startPromise, abortScope.signal)).fileId;\n\t\t} catch (err) {\n\t\t\tif (abortScope.signal.aborted) cancelLargeFileAfterStart(startPromise, raw, accountInfo, options.onCleanupFailure);\n\t\t\tthrow err;\n\t\t}\n\t\tconst startedLargeFileId = largeFileId;\n\t\tif (startedLargeFileId === void 0) throw new Error(\"copyLargeFile: start did not return a large file ID.\");\n\t\tconst tasks = ranges.map(async (range) => {\n\t\t\tawait sem.acquire();\n\t\t\ttry {\n\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\tconst resp = await raceWithAbort(raw.copyPart(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\t\t\tsourceFileId: options.sourceFileId,\n\t\t\t\t\tlargeFileId: fileId(startedLargeFileId),\n\t\t\t\t\tpartNumber: range.partNumber,\n\t\t\t\t\trange: byteRangeHeader(range.start, range.end),\n\t\t\t\t\t...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n\t\t\t\t\t...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {}\n\t\t\t\t}, { signal: abortScope.signal }), abortScope.signal);\n\t\t\t\tpartSha1s[range.partNumber - 1] = resp.contentSha1;\n\t\t\t} catch (err) {\n\t\t\t\tabortScope.abort(err);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsem.release();\n\t\t\t}\n\t\t});\n\t\tthrowRejectedOrAbortReason(await Promise.allSettled(tasks), abortScope);\n\t\treturn await finishLargeFileWithAbortReconciliation(raw, accountInfo, {\n\t\t\tfileId: startedLargeFileId,\n\t\t\tbucketId: destBucketId,\n\t\t\tfileName: options.fileName,\n\t\t\tpartSha1s,\n\t\t\tsignal: abortScope.signal\n\t\t});\n\t} catch (err) {\n\t\tabortScope.abort(err);\n\t\tif (largeFileId === void 0) throw err;\n\t\treturn await cleanupAfterLargeFileError(err, raw, accountInfo, {\n\t\t\tfileId: largeFileId,\n\t\t\tbucketId: destBucketId,\n\t\t\tfileName: options.fileName,\n\t\t\tsignal: options.signal,\n\t\t\tonCleanupFailure: options.onCleanupFailure\n\t\t});\n\t} finally {\n\t\tabortScope.dispose();\n\t}\n}\nfunction cancelLargeFileAfterStart(started, raw, accountInfo, onCleanupFailure) {\n\tstarted.then((resp) => cancelLargeFileBestEffort(raw, accountInfo, resp.fileId, onCleanupFailure === void 0 ? void 0 : { onCleanupFailure })).catch(() => {});\n}\n//#endregion\nexport { copyLargeFile };\n\n//# sourceMappingURL=large.js.map","//#region src/util/text-codec.ts\n/**\n* Shared UTF-8 codec singletons.\n*\n* Every byte boundary in this SDK is UTF-8: JSON request and response bodies,\n* webhook payloads, simulator stream chunks, and B2 percent-encoding inputs.\n* Allocating a fresh `TextEncoder` / `TextDecoder` per call is wasteful and\n* makes the encoding assumption invisible. Importing these constants makes\n* \"we use UTF-8\" explicit at every call site and avoids the per-call\n* allocation entirely.\n*\n* Both classes are spec-defined as stateless across encode / decode calls,\n* so a process-wide singleton is safe.\n*\n* @packageDocumentation\n*/\n/**\n* Process-wide UTF-8 `TextEncoder`. Use this instead of\n* `new TextEncoder()` for any string → bytes conversion in the SDK.\n*/\nvar utf8Encoder = new TextEncoder();\n/**\n* Process-wide UTF-8 `TextDecoder`. Use this instead of\n* `new TextDecoder()` for any bytes → string conversion in the SDK.\n*/\nvar utf8Decoder = new TextDecoder();\n//#endregion\nexport { utf8Decoder, utf8Encoder };\n\n//# sourceMappingURL=text-codec.js.map","import { utf8Encoder } from \"../util/text-codec.js\";\n//#region src/raw/encoding.ts\n/**\n* Characters that B2 treats as safe (not percent-encoded) in file names.\n*\n* Per the B2 docs, everything except `a-z A-Z 0-9 - . _ ~ / ! $ & ' ( ) * + , ; = : @`\n* must be percent-encoded using UTF-8 byte values.\n*/\nvar SAFE_CHARS = new Set(\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~!$&'()*+,;=:@/\".split(\"\"));\n/**\n* Percent-encodes a file name using the B2-specific encoding rules.\n*\n* Unlike standard `encodeURIComponent`, B2 keeps `/` and several other\n* characters unencoded while encoding all other non-ASCII and special\n* characters as uppercase percent-encoded UTF-8 bytes.\n*\n* @param name - The raw (unencoded) file name.\n*\n* @returns The percent-encoded file name suitable for `X-Bz-File-Name` headers.\n*/\nfunction encodeFileName(name) {\n\tconst encoded = [];\n\tfor (const char of name) if (SAFE_CHARS.has(char)) encoded.push(char);\n\telse {\n\t\tconst bytes = utf8Encoder.encode(char);\n\t\tfor (const byte of bytes) encoded.push(`%${byte.toString(16).toUpperCase().padStart(2, \"0\")}`);\n\t}\n\treturn encoded.join(\"\");\n}\n/**\n* Decodes a B2 percent-encoded file name back to a plain string.\n*\n* B2 percent-encoding is compatible with standard `decodeURIComponent`,\n* so this is a thin wrapper.\n*\n* @param encoded - The percent-encoded file name from B2.\n*\n* @returns The decoded file name.\n*/\nfunction decodeFileName(encoded) {\n\treturn decodeURIComponent(encoded);\n}\n/**\n* Converts a file-info map into `X-Bz-Info-*` HTTP headers.\n*\n* Both keys and values are percent-encoded with {@link encodeFileName}\n* to satisfy B2 header requirements.\n*\n* @param fileInfo - Key/value pairs to attach as custom file info, or `undefined`.\n*\n* @returns A record of header name/value pairs (empty if `fileInfo` is `undefined`).\n*/\nfunction buildFileInfoHeaders(fileInfo) {\n\tif (!fileInfo) return {};\n\tconst headers = {};\n\tfor (const [key, value] of Object.entries(fileInfo)) headers[`X-Bz-Info-${encodeFileName(key)}`] = encodeFileName(value);\n\treturn headers;\n}\n/**\n* Extracts custom file-info key/value pairs from B2 response headers.\n*\n* Scans for headers prefixed with `x-bz-info-` and decodes both the\n* key suffix and value using {@link decodeFileName}.\n*\n* @param headers - The HTTP response headers from a B2 download or file-info call.\n*\n* @returns A record of decoded file-info key/value pairs.\n*/\nfunction parseFileInfoHeaders(headers) {\n\tconst info = {};\n\theaders.forEach((value, key) => {\n\t\tconst lower = key.toLowerCase();\n\t\tif (lower.startsWith(\"x-bz-info-\")) {\n\t\t\tconst infoKey = decodeFileName(lower.slice(10));\n\t\t\tinfo[infoKey] = decodeFileName(value);\n\t\t}\n\t});\n\treturn info;\n}\n//#endregion\nexport { buildFileInfoHeaders, decodeFileName, encodeFileName, parseFileInfoHeaders };\n\n//# sourceMappingURL=encoding.js.map","//#region src/streams/progress.ts\n/**\n* Accumulates byte and part counts and emits {@link ProgressEvent}s to a listener.\n*\n* Internal building block. The SDK wires one of these inside every\n* transfer that accepts an `onProgress` option; users supply the\n* listener callback, not the tracker. Exported only so SDK source\n* modules can import it; not re-exported through any subpath.\n*\n* @internal\n*/\nvar ProgressTracker = class {\n\tlistener;\n\ttotalBytes;\n\ttotalParts;\n\t/** Running total of bytes transferred. */\n\tbytesTransferred = 0;\n\t/** Running count of completed parts. */\n\tpartsCompleted = 0;\n\t/** Timestamp when tracking began. */\n\tstartTime;\n\t/**\n\t* Creates a new ProgressTracker.\n\t* @param listener - Callback to receive progress events, or undefined to disable.\n\t* @param totalBytes - Expected total bytes, or null if unknown.\n\t* @param totalParts - Expected total parts, or null if not a multipart transfer.\n\t*/\n\tconstructor(listener, totalBytes, totalParts) {\n\t\tthis.listener = listener;\n\t\tthis.totalBytes = totalBytes;\n\t\tthis.totalParts = totalParts;\n\t\tthis.startTime = Date.now();\n\t}\n\t/**\n\t* Record that additional bytes have been transferred and notify the listener.\n\t* @param count - The number of additional bytes that were transferred.\n\t*/\n\taddBytes(count) {\n\t\tthis.bytesTransferred += count;\n\t\tthis.emit();\n\t}\n\t/** Record that a multipart part has completed and notify the listener. */\n\tcompletePart() {\n\t\tthis.partsCompleted++;\n\t\tthis.emit();\n\t}\n\t/** Emit the current progress snapshot to the listener, if one is registered. */\n\temit() {\n\t\tthis.listener?.({\n\t\t\tbytesTransferred: this.bytesTransferred,\n\t\t\ttotalBytes: this.totalBytes,\n\t\t\tpartsCompleted: this.partsCompleted,\n\t\t\ttotalParts: this.totalParts,\n\t\t\telapsedMs: Date.now() - this.startTime\n\t\t});\n\t}\n};\n//#endregion\nexport { ProgressTracker };\n\n//# sourceMappingURL=progress.js.map","//#region src/util/normalize.ts\n/**\n* Wire-shape → SDK-shape normalization helpers.\n*\n* B2 occasionally uses sentinel strings on the wire where a missing\n* value would be more idiomatic in TypeScript. The biggest offender is\n* `contentSha1: 'none'` on files completed via `b2_finish_large_file`\n* (multipart-finished files don't have a whole-file SHA-1; B2 sends the\n* literal three-letter string). The SDK's `FileVersion.contentSha1` is\n* typed `string | null` to signal that absence — this module collapses\n* the wire sentinel to `null` so callers can write\n* `if (fv.contentSha1) { ... }` without an extra `=== 'none'` guard.\n*\n* Normalization happens at the RawClient boundary so every SDK consumer\n* (RawClient direct users, the high-level facade, the simulator-driven\n* tests, generated docs) sees the same `null` value.\n*\n* @packageDocumentation\n*/\n/**\n* Collapses the B2 wire sentinel `'none'` (and `undefined`) to `null` for\n* SHA-1-shaped fields. Any other string passes through unchanged.\n*\n* @param raw - SHA-1 string from the wire, or `null`/`undefined`.\n*\n* @returns A hex SHA-1 string, or `null` when the wire said \"no hash\".\n*/\nfunction normalizeSha1(raw) {\n\tif (raw === null || raw === void 0 || raw === \"none\") return null;\n\treturn raw;\n}\n/**\n* Returns a new file-version-shaped object with the `contentSha1: 'none'`\n* sentinel collapsed to `null`. Pass-through when the value is already\n* `null` or a real hash. The object reference is preserved if no\n* substitution was needed, so callers paying for change detection\n* (e.g. React memo) see referential stability.\n*\n* @typeParam T - Any object with a `contentSha1: string | null` field.\n*\n* @param fv - The wire-shape file-version object.\n*\n* @returns Either `fv` unchanged or a shallow copy with `contentSha1: null`.\n*/\nfunction normalizeFileVersionSha1(fv) {\n\treturn fv.contentSha1 === \"none\" ? {\n\t\t...fv,\n\t\tcontentSha1: null\n\t} : fv;\n}\n/**\n* Returns a new list-response object with `normalizeFileVersionSha1`\n* applied to every entry in `files`. Used at the `b2_list_file_names` /\n* `b2_list_file_versions` boundary so list output shares the same\n* SHA-1 semantics as the singular endpoints.\n*\n* @typeParam F - Any object with a `contentSha1: string | null` field.\n* @typeParam R - The list-response shape (must have a `files` array of `F`).\n*\n* @param resp - The wire-shape list response.\n*\n* @returns A response with normalized `files`. `resp.files` is a new array.\n*/\nfunction normalizeFileVersionListSha1(resp) {\n\treturn {\n\t\t...resp,\n\t\tfiles: resp.files.map(normalizeFileVersionSha1)\n\t};\n}\n//#endregion\nexport { normalizeFileVersionListSha1, normalizeFileVersionSha1, normalizeSha1 };\n\n//# sourceMappingURL=normalize.js.map","import { arrayBufferFor } from \"../util/bytes.js\";\nimport { hexEncode } from \"../util/crypto.js\";\n//#region src/streams/hash.ts\nvar nodeCreateHash;\n/**\n* Lazily loads `node:crypto` and caches the factory. Returns null in non-Node runtimes.\n*\n* @returns The cached hash factory, or null if Node crypto is unavailable.\n*/\nasync function getNodeCreateHash() {\n\tif (nodeCreateHash !== void 0) return nodeCreateHash;\n\ttry {\n\t\tconst crypto = await import(\"node:crypto\");\n\t\tif (typeof crypto.createHash !== \"function\") throw new Error(\"createHash unavailable\");\n\t\tnodeCreateHash = (algo) => {\n\t\t\tconst h = crypto.createHash(algo);\n\t\t\treturn {\n\t\t\t\tupdate(data) {\n\t\t\t\t\th.update(data);\n\t\t\t\t},\n\t\t\t\tdigest(encoding) {\n\t\t\t\t\treturn h.digest(encoding);\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t} catch {\n\t\t/* v8 ignore next -- non-Node runtime fallback, unreachable in Node coverage. */\n\t\tnodeCreateHash = null;\n\t}\n\treturn nodeCreateHash;\n}\n/**\n* Incrementally computes SHA-1 hashes over streaming data.\n* Uses Node.js `crypto` when available, falling back to a dependency-free\n* incremental JavaScript implementation.\n*/\nvar IncrementalSha1 = class {\n\t/** Total bytes fed into the hash so far. */\n\ttotalLength = 0;\n\t/** Node.js hash instance, or null if using the JavaScript fallback. */\n\tnodeHash = null;\n\t/** Streaming JavaScript fallback used when Node crypto is unavailable. */\n\tjsHash = new JsSha1Hasher();\n\t/** Resolves once the crypto backend has been loaded. */\n\tinitPromise;\n\t/** Creates a new IncrementalSha1 and lazily initializes the crypto backend. */\n\tconstructor() {\n\t\tthis.initPromise = getNodeCreateHash().then((factory) => {\n\t\t\tif (factory) this.nodeHash = factory(\"sha1\");\n\t\t});\n\t}\n\t/**\n\t* Feed data into the hash. Async because it lazily initializes the crypto backend.\n\t* @param data - The bytes to include in the hash computation.\n\t*\n\t* @returns A promise that resolves once the data has been consumed.\n\t*/\n\tasync update(data) {\n\t\tawait this.initPromise;\n\t\tif (this.nodeHash) this.nodeHash.update(data);\n\t\telse\n /* v8 ignore next -- WebCrypto fallback is exercised by browser-mode tests. */\n\t\tthis.jsHash.update(data);\n\t\tthis.totalLength += data.byteLength;\n\t}\n\t/**\n\t* Finalize the hash and return the hex-encoded SHA-1 digest.\n\t* @returns The lowercase hex-encoded SHA-1 digest of all data fed so far.\n\t*/\n\tasync digest() {\n\t\tawait this.initPromise;\n\t\tif (this.nodeHash) return this.nodeHash.digest(\"hex\");\n\t\t/* v8 ignore next -- non-Node runtime fallback, exercised by browser-mode tests */\n\t\treturn this.jsHash.digest();\n\t}\n\t/**\n\t* Total number of bytes fed into the hash so far.\n\t*\n\t* @returns The cumulative byte count across all update calls.\n\t*/\n\tget bytesProcessed() {\n\t\treturn this.totalLength;\n\t}\n};\n/* v8 ignore start -- JavaScript fallback path, exercised by browser-mode tests */\nvar JsSha1Hasher = class {\n\th0 = 1732584193;\n\th1 = 4023233417;\n\th2 = 2562383102;\n\th3 = 271733878;\n\th4 = 3285377520;\n\tblock = /* @__PURE__ */ new Uint8Array(64);\n\tblockLength = 0;\n\tbytesProcessed = 0;\n\tdigested = false;\n\twords = /* @__PURE__ */ new Uint32Array(80);\n\tupdate(data) {\n\t\tif (this.digested) throw new Error(\"SHA-1 digest has already been finalized\");\n\t\tthis.bytesProcessed += data.byteLength;\n\t\tlet offset = 0;\n\t\tif (this.blockLength > 0) {\n\t\t\tconst toCopy = Math.min(64 - this.blockLength, data.byteLength);\n\t\t\tthis.block.set(data.subarray(0, toCopy), this.blockLength);\n\t\t\tthis.blockLength += toCopy;\n\t\t\toffset = toCopy;\n\t\t\tif (this.blockLength === 64) {\n\t\t\t\tthis.processBlock(this.block, 0);\n\t\t\t\tthis.blockLength = 0;\n\t\t\t}\n\t\t}\n\t\twhile (offset + 64 <= data.byteLength) {\n\t\t\tthis.processBlock(data, offset);\n\t\t\toffset += 64;\n\t\t}\n\t\tif (offset < data.byteLength) {\n\t\t\tthis.block.set(data.subarray(offset), 0);\n\t\t\tthis.blockLength = data.byteLength - offset;\n\t\t}\n\t}\n\tdigest() {\n\t\tif (this.digested) throw new Error(\"SHA-1 digest has already been finalized\");\n\t\tthis.digested = true;\n\t\tconst bitLengthHigh = Math.floor(this.bytesProcessed / 536870912);\n\t\tconst bitLengthLow = this.bytesProcessed << 3 >>> 0;\n\t\tthis.block[this.blockLength] = 128;\n\t\tthis.blockLength++;\n\t\tif (this.blockLength > 56) {\n\t\t\tthis.block.fill(0, this.blockLength, 64);\n\t\t\tthis.processBlock(this.block, 0);\n\t\t\tthis.blockLength = 0;\n\t\t}\n\t\tthis.block.fill(0, this.blockLength, 56);\n\t\tthis.writeUint32(56, bitLengthHigh);\n\t\tthis.writeUint32(60, bitLengthLow);\n\t\tthis.processBlock(this.block, 0);\n\t\treturn wordToHex(this.h0) + wordToHex(this.h1) + wordToHex(this.h2) + wordToHex(this.h3) + wordToHex(this.h4);\n\t}\n\twriteUint32(offset, value) {\n\t\tthis.block[offset] = value >>> 24 & 255;\n\t\tthis.block[offset + 1] = value >>> 16 & 255;\n\t\tthis.block[offset + 2] = value >>> 8 & 255;\n\t\tthis.block[offset + 3] = value & 255;\n\t}\n\tprocessBlock(block, offset) {\n\t\tconst words = this.words;\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tconst j = offset + i * 4;\n\t\t\twords[i] = (block[j] ?? 0) << 24 | (block[j + 1] ?? 0) << 16 | (block[j + 2] ?? 0) << 8 | (block[j + 3] ?? 0);\n\t\t}\n\t\tfor (let i = 16; i < 80; i++) words[i] = rotateLeft((words[i - 3] ?? 0) ^ (words[i - 8] ?? 0) ^ (words[i - 14] ?? 0) ^ (words[i - 16] ?? 0), 1);\n\t\tlet a = this.h0;\n\t\tlet b = this.h1;\n\t\tlet c = this.h2;\n\t\tlet d = this.h3;\n\t\tlet e = this.h4;\n\t\tfor (let i = 0; i < 80; i++) {\n\t\t\tlet f;\n\t\t\tlet k;\n\t\t\tif (i < 20) {\n\t\t\t\tf = b & c | ~b & d;\n\t\t\t\tk = 1518500249;\n\t\t\t} else if (i < 40) {\n\t\t\t\tf = b ^ c ^ d;\n\t\t\t\tk = 1859775393;\n\t\t\t} else if (i < 60) {\n\t\t\t\tf = b & c | b & d | c & d;\n\t\t\t\tk = 2400959708;\n\t\t\t} else {\n\t\t\t\tf = b ^ c ^ d;\n\t\t\t\tk = 3395469782;\n\t\t\t}\n\t\t\tconst temp = rotateLeft(a, 5) + f + e + k + (words[i] ?? 0) >>> 0;\n\t\t\te = d;\n\t\t\td = c;\n\t\t\tc = rotateLeft(b, 30);\n\t\t\tb = a;\n\t\t\ta = temp;\n\t\t}\n\t\tthis.h0 = this.h0 + a >>> 0;\n\t\tthis.h1 = this.h1 + b >>> 0;\n\t\tthis.h2 = this.h2 + c >>> 0;\n\t\tthis.h3 = this.h3 + d >>> 0;\n\t\tthis.h4 = this.h4 + e >>> 0;\n\t}\n};\nfunction rotateLeft(value, bits) {\n\treturn (value << bits | value >>> 32 - bits) >>> 0;\n}\nfunction wordToHex(word) {\n\treturn word.toString(16).padStart(8, \"0\");\n}\n/* v8 ignore stop */\n/**\n* Compute the SHA-1 hex digest of a complete byte array in one shot.\n* @param data - The byte array to hash.\n*\n* @returns The lowercase hex-encoded SHA-1 digest of the input.\n*/\nasync function sha1Hex(data) {\n\tconst factory = await getNodeCreateHash();\n\tif (factory) {\n\t\tconst h = factory(\"sha1\");\n\t\th.update(data);\n\t\treturn h.digest(\"hex\");\n\t}\n\t/* v8 ignore start -- WebCrypto fallback, only reachable when node:crypto is unavailable */\n\tconst hashBuffer = await crypto.subtle.digest(\"SHA-1\", arrayBufferFor(data));\n\treturn hexEncode(new Uint8Array(hashBuffer));\n\t/* v8 ignore stop */\n}\n//#endregion\nexport { IncrementalSha1, sha1Hex };\n\n//# sourceMappingURL=hash.js.map","//#region src/util/sha1.ts\nvar sha1HexPattern = /^[0-9a-f]{40}$/i;\n/**\n* Returns whether a value is a verifiable 40-character hexadecimal SHA-1 digest.\n*\n* @param sha1 - SHA-1 value, or null/undefined when unavailable.\n*\n* @returns True when the value is a 40-character hexadecimal SHA-1 digest.\n*/\nfunction isVerifiableSha1(sha1) {\n\treturn sha1 !== null && sha1 !== void 0 && sha1HexPattern.test(sha1);\n}\n/**\n* Normalizes a verifiable SHA-1 digest to lowercase.\n*\n* @param sha1 - SHA-1 value, or null/undefined when unavailable.\n*\n* @returns A lowercase SHA-1 digest, or null when the value is not verifiable.\n*/\nfunction normalizeVerifiableSha1(sha1) {\n\treturn isVerifiableSha1(sha1) ? sha1.toLowerCase() : null;\n}\n//#endregion\nexport { isVerifiableSha1, normalizeVerifiableSha1 };\n\n//# sourceMappingURL=sha1.js.map","import { ChecksumMismatchError } from \"../errors/index.js\";\nimport { IncrementalSha1 } from \"../streams/hash.js\";\nimport { isVerifiableSha1 } from \"../util/sha1.js\";\n//#region src/download/checksum.ts\n/**\n* Client-side checksum helpers for download streams.\n*\n* B2 sends `X-Bz-Content-Sha1` on download responses when a whole-file\n* checksum is available. These helpers verify streamed bytes against that\n* header without buffering the full response in memory.\n*\n* @packageDocumentation\n*/\n/**\n* Builds the typed error used when downloaded bytes fail SHA-1 verification.\n*\n* @param expectedSha1 - SHA-1 digest advertised by the download response.\n* @param actualSha1 - SHA-1 digest computed from the downloaded bytes.\n*\n* @returns A typed checksum mismatch error.\n*/\nfunction createDownloadChecksumMismatchError(expectedSha1, actualSha1) {\n\treturn new ChecksumMismatchError({\n\t\tstatus: 400,\n\t\tcode: \"bad_sha1_checksum\",\n\t\tmessage: `Downloaded content SHA-1 mismatch: expected ${expectedSha1.toLowerCase()}, got ${actualSha1.toLowerCase()}`\n\t});\n}\n/**\n* Throws when a computed download SHA-1 does not match the expected value.\n*\n* @param expectedSha1 - SHA-1 digest advertised by the download response.\n* @param actualSha1 - SHA-1 digest computed from the downloaded bytes.\n*\n* @throws ChecksumMismatchError when the two digests differ.\n*/\nfunction assertDownloadSha1(expectedSha1, actualSha1) {\n\tif (actualSha1.toLowerCase() !== expectedSha1.toLowerCase()) throw createDownloadChecksumMismatchError(expectedSha1, actualSha1);\n}\n/**\n* Throws when two range responses disagree about the expected whole-file SHA-1.\n*\n* @param expectedSha1 - The first range's verifiable SHA-1, or null when unavailable.\n* @param actualSha1 - The current range's verifiable SHA-1, or null when unavailable.\n*\n* @throws ChecksumMismatchError when the two header states differ.\n*/\nfunction assertDownloadSha1HeaderAgreement(expectedSha1, actualSha1) {\n\tif (expectedSha1 === actualSha1) return;\n\tthrow new ChecksumMismatchError({\n\t\tstatus: 400,\n\t\tcode: \"bad_sha1_checksum\",\n\t\tmessage: `Downloaded content SHA-1 header mismatch: expected ${formatSha1ForMessage(expectedSha1)}, got ${formatSha1ForMessage(actualSha1)}`\n\t});\n}\n/**\n* Wraps a download stream with whole-body SHA-1 verification.\n*\n* If B2 did not provide a verifiable whole-file SHA-1 (for example,\n* multipart-finished files report `none`), the original stream is returned.\n*\n* @param body - Download response body.\n* @param expectedSha1 - Normalized SHA-1 header value, or null when unavailable.\n*\n* @returns A stream that emits the same bytes and errors on checksum mismatch.\n*/\nfunction verifyDownloadStream(body, expectedSha1) {\n\tif (!isVerifiableSha1(expectedSha1)) return body;\n\tconst sha1 = new IncrementalSha1();\n\tconst transform = new TransformStream({\n\t\tasync transform(chunk, controller) {\n\t\t\tawait sha1.update(chunk);\n\t\t\tcontroller.enqueue(chunk);\n\t\t},\n\t\tasync flush() {\n\t\t\tassertDownloadSha1(expectedSha1, await sha1.digest());\n\t\t}\n\t});\n\treturn body.pipeThrough(transform);\n}\nfunction formatSha1ForMessage(sha1) {\n\treturn sha1 === null ? \"missing or unverifiable\" : sha1.toLowerCase();\n}\n//#endregion\nexport { assertDownloadSha1, assertDownloadSha1HeaderAgreement, verifyDownloadStream };\n\n//# sourceMappingURL=checksum.js.map","import { fileId } from \"../types/ids.js\";\nimport { bestEffort } from \"../util/best-effort.js\";\nimport { parseFileInfoHeaders } from \"../raw/encoding.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { normalizeSha1 } from \"../util/normalize.js\";\nimport { verifyDownloadStream } from \"./checksum.js\";\n//#region src/download/single.ts\n/**\n* Downloads a file by its unique ID in a single HTTP request.\n*\n* Returns a streaming body suitable for small-to-medium files. For large files\n* that benefit from concurrent ranged fetches, use\n* {@link createParallelDownloadStream} instead.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - Download parameters.\n*\n* @returns Parsed headers and a readable stream of file bytes.\n*/\nasync function downloadById(raw, accountInfo, options) {\n\tconst resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.fileId, toRawDownloadOptions(options));\n\tconst headers = extractDownloadHeaders(resp.headers);\n\treturn {\n\t\theaders,\n\t\tbody: prepareDownloadBody(resp.body ?? emptyStream(), headers, options)\n\t};\n}\n/**\n* Downloads a file by bucket name and file path in a single HTTP request.\n*\n* Returns a streaming body suitable for small-to-medium files. For large files\n* that benefit from concurrent ranged fetches, use\n* {@link createParallelDownloadStream} instead.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - Download parameters.\n*\n* @returns Parsed headers and a readable stream of file bytes.\n*/\nasync function downloadByName(raw, accountInfo, options) {\n\tconst resp = await raw.downloadFileByName(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.bucketName, options.fileName, toRawDownloadOptions(options));\n\tconst headers = extractDownloadHeaders(resp.headers);\n\treturn {\n\t\theaders,\n\t\tbody: prepareDownloadBody(resp.body ?? emptyStream(), headers, options)\n\t};\n}\n/**\n* Issues a HEAD-by-ID request and returns parsed headers only. Drains\n* the (logically empty) response body internally so callers don't have\n* to remember to `body.cancel()` themselves.\n*\n* Prefer this over `downloadById({ method: 'HEAD' })` — same wire-level\n* effect, but the caller-facing result has no `body` field at all so\n* there's nothing to clean up.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - HEAD parameters (file ID + the same response-header\n* overrides and abort signal that `downloadById` accepts).\n*\n* @returns Parsed download headers (no body field).\n*/\nasync function headById(raw, accountInfo, options) {\n\tconst resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.fileId, {\n\t\t...toRawDownloadOptions(options),\n\t\tmethod: \"HEAD\"\n\t});\n\tif (resp.body !== null) {\n\t\tconst body = resp.body;\n\t\tawait bestEffort(() => body.cancel());\n\t}\n\treturn { headers: extractDownloadHeaders(resp.headers) };\n}\n/**\n* Issues a HEAD-by-name request and returns parsed headers only. Drains\n* the (logically empty) response body internally so callers don't have\n* to remember to `body.cancel()` themselves.\n*\n* Prefer this over `downloadByName({ method: 'HEAD' })` — same wire-level\n* effect, but the caller-facing result has no `body` field at all so\n* there's nothing to clean up.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - HEAD parameters (bucket + file name + the same\n* response-header overrides and abort signal that `downloadByName`\n* accepts).\n*\n* @returns Parsed download headers (no body field).\n*/\nasync function headByName(raw, accountInfo, options) {\n\tconst resp = await raw.downloadFileByName(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), options.bucketName, options.fileName, {\n\t\t...toRawDownloadOptions(options),\n\t\tmethod: \"HEAD\"\n\t});\n\tif (resp.body !== null) {\n\t\tconst body = resp.body;\n\t\tawait bestEffort(() => body.cancel());\n\t}\n\treturn { headers: extractDownloadHeaders(resp.headers) };\n}\n/**\n* Translates the public download-options shape into the raw client's\n* {@link DownloadFileOptions}, dropping the request-target fields (`fileId`,\n* `bucketName`, `fileName`) that don't apply at the transport layer.\n*\n* @param options - Caller-supplied download options.\n*\n* @returns The raw transport-layer options.\n*/\nfunction toRawDownloadOptions(options) {\n\treturn {\n\t\t...options.method !== void 0 ? { method: options.method } : {},\n\t\t...options.range !== void 0 ? { range: options.range } : {},\n\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n\t\t...options.b2ContentDisposition !== void 0 ? { b2ContentDisposition: options.b2ContentDisposition } : {},\n\t\t...options.b2ContentLanguage !== void 0 ? { b2ContentLanguage: options.b2ContentLanguage } : {},\n\t\t...options.b2ContentEncoding !== void 0 ? { b2ContentEncoding: options.b2ContentEncoding } : {},\n\t\t...options.b2ContentType !== void 0 ? { b2ContentType: options.b2ContentType } : {},\n\t\t...options.b2CacheControl !== void 0 ? { b2CacheControl: options.b2CacheControl } : {},\n\t\t...options.b2Expires !== void 0 ? { b2Expires: options.b2Expires } : {},\n\t\t...options.signal !== void 0 ? { signal: options.signal } : {}\n\t};\n}\n/**\n* Builds an immediately-closed empty ReadableStream. Used as the body of a\n* HEAD download response so callers always get a stream they can `pipeTo`.\n*\n* @returns A ReadableStream that yields zero bytes and immediately closes.\n*/\nfunction emptyStream() {\n\treturn new ReadableStream({ start(controller) {\n\t\tcontroller.close();\n\t} });\n}\n/**\n* Applies stream wrappers common to single-request downloads.\n*\n* Full-body GET downloads are checksum-verified when B2 supplies a real\n* whole-file SHA-1. HEAD requests and ranged GETs are skipped because the\n* response body is empty or partial while `X-Bz-Content-Sha1` describes the\n* full file version.\n*\n* @param body - Download response body.\n* @param headers - Parsed download headers.\n* @param options - Caller-supplied download options.\n*\n* @returns A stream wrapped for checksum verification and progress reporting.\n*/\nfunction prepareDownloadBody(body, headers, options) {\n\treturn instrumentProgress(options.method !== \"HEAD\" && options.range === void 0 ? verifyDownloadStream(body, headers.contentSha1) : body, headers.contentLength, options.onProgress);\n}\n/**\n* Wraps a body stream with a `TransformStream` that increments a\n* {@link ProgressTracker} for each chunk and reports `partsCompleted: 1`\n* when the stream finishes.\n*\n* When `listener` is undefined the function short-circuits and returns\n* the original stream, so unobserved downloads pay no overhead.\n*\n* @param body - The download response body to wrap.\n* @param totalBytes - Expected total bytes (response `Content-Length`).\n* @param listener - Caller-supplied progress callback, or undefined.\n*\n* @returns A stream that emits the same bytes and reports progress.\n*/\nfunction instrumentProgress(body, totalBytes, listener) {\n\tif (listener === void 0) return body;\n\tconst tracker = new ProgressTracker(listener, totalBytes, 1);\n\tconst transform = new TransformStream({\n\t\ttransform(chunk, controller) {\n\t\t\ttracker.addBytes(chunk.byteLength);\n\t\t\tcontroller.enqueue(chunk);\n\t\t},\n\t\tflush() {\n\t\t\ttracker.completePart();\n\t\t}\n\t});\n\treturn body.pipeThrough(transform);\n}\n/**\n* Extracts B2-specific download headers into a structured object.\n* @param headers - The HTTP response headers from the download.\n*\n* @returns The parsed download metadata.\n*/\nfunction extractDownloadHeaders(headers) {\n\tconst fileInfo = parseFileInfoHeaders(headers);\n\treturn {\n\t\tcontentType: headers.get(\"Content-Type\") ?? \"application/octet-stream\",\n\t\tcontentLength: Number.parseInt(headers.get(\"Content-Length\") ?? \"0\", 10),\n\t\tcontentSha1: normalizeSha1(headers.get(\"X-Bz-Content-Sha1\")),\n\t\tfileId: fileId(headers.get(\"X-Bz-File-Id\") ?? \"\"),\n\t\tfileName: decodeURIComponent(headers.get(\"X-Bz-File-Name\") ?? \"\"),\n\t\tfileInfo,\n\t\tuploadTimestamp: Number.parseInt(headers.get(\"X-Bz-Upload-Timestamp\") ?? \"0\", 10)\n\t};\n}\n//#endregion\nexport { downloadById, downloadByName, headById, headByName };\n\n//# sourceMappingURL=single.js.map","//#region src/internal/upload-retry-options.ts\n/**\n* Merges client upload retry defaults with a per-call override.\n* @param defaults - Resolved client upload retry defaults.\n* @param override - Per-call retry option overrides, if any.\n*\n* @returns Retry options for one high-level upload operation.\n*\n* @internal\n*/\nfunction mergeUploadRetryOptions(defaults, override) {\n\tif (override === void 0) return defaults;\n\treturn {\n\t\t...defaults,\n\t\t...override\n\t};\n}\n//#endregion\nexport { mergeUploadRetryOptions };\n\n//# sourceMappingURL=upload-retry-options.js.map","import { arrayBufferFor } from \"../util/bytes.js\";\nimport { collectStream } from \"./collect.js\";\nimport { FileSource } from \"./file-source.js\";\n//#region src/streams/source.ts\nvar READABLE_STREAM_SIZE_REQUIRED_ERROR = \"size is required when using a ReadableStream as input.\";\nvar FORWARD_ONLY_SIZE_REQUIRED_ERROR = \"size is required when using a forward-only content source as input.\";\nvar STREAM_SOURCE_ENDED_EARLY_ERROR = \"StreamSource ended before the advertised byte count.\";\nvar STREAM_SOURCE_TOO_MANY_BYTES_ERROR = \"StreamSource emitted more bytes than the advertised byte count.\";\nvar STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR = \"StreamSource emitted too many empty chunks without data.\";\n/** Maximum consecutive empty chunks tolerated from a forward-only stream. */\nvar MAX_EMPTY_STREAM_CHUNKS = 1024;\nfunction asyncIterableToReadableStream(iterable) {\n\tconst iterator = iterable[Symbol.asyncIterator]();\n\treturn new ReadableStream({\n\t\tasync pull(controller) {\n\t\t\ttry {\n\t\t\t\tconst { done, value } = await iterator.next();\n\t\t\t\tif (done === true) {\n\t\t\t\t\tcontroller.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!(value instanceof Uint8Array)) throw new TypeError(\"Async iterable content sources must yield Uint8Array chunks.\");\n\t\t\t\tcontroller.enqueue(value);\n\t\t\t} catch (err) {\n\t\t\t\t/* v8 ignore next -- Iterator-return failure must not mask the pull error. */\n\t\t\t\tawait returnAsyncIteratorBestEffort(iterator);\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t},\n\t\tasync cancel(reason) {\n\t\t\tawait returnAsyncIteratorBestEffort(iterator, reason);\n\t\t}\n\t});\n}\nasync function returnAsyncIteratorBestEffort(iterator, reason) {\n\ttry {\n\t\tawait iterator.return?.(reason);\n\t} catch {}\n}\nfunction isAsyncIterable(input) {\n\treturn typeof input === \"object\" && input !== null && Symbol.asyncIterator in input && typeof input[Symbol.asyncIterator] === \"function\";\n}\nfunction isReadableStream(input) {\n\treturn typeof input === \"object\" && input !== null && typeof input.getReader === \"function\";\n}\n/** ContentSource backed by a Blob or File. */\nvar BlobSource = class BlobSource {\n\tblob;\n\t/** {@inheritDoc} */\n\tsize;\n\t/** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */\n\tcanSlice = true;\n\t/**\n\t* Create a BlobSource wrapping the given Blob.\n\t* @param blob - The Blob or File to use as the underlying content.\n\t*/\n\tconstructor(blob) {\n\t\tthis.blob = blob;\n\t\tthis.size = blob.size;\n\t}\n\t/**\n\t* Return a new BlobSource covering the specified byte range.\n\t* @param start - The zero-based byte offset to begin the slice.\n\t* @param end - The exclusive byte offset where the slice ends.\n\t*\n\t* @returns A new ContentSource representing the requested sub-range.\n\t*/\n\tslice(start, end) {\n\t\treturn new BlobSource(this.blob.slice(start, end));\n\t}\n\t/**\n\t* Open the Blob content as a ReadableStream.\n\t* @returns A ReadableStream of the Blob bytes.\n\t*/\n\tstream() {\n\t\treturn this.blob.stream();\n\t}\n\t/**\n\t* Read the entire Blob content into an ArrayBuffer.\n\t* @param options - Optional abort signal used while reading.\n\t*\n\t* @returns A promise that resolves with the full content as an ArrayBuffer.\n\t*/\n\tasync toArrayBuffer(options = {}) {\n\t\toptions.signal?.throwIfAborted();\n\t\tif (options.signal === void 0) return this.blob.arrayBuffer();\n\t\treturn arrayBufferFor(await collectStream(this.stream(), options));\n\t}\n};\n/** ContentSource backed by a Uint8Array buffer. */\nvar BufferSource = class BufferSource {\n\tbuffer;\n\t/** {@inheritDoc} */\n\tsize;\n\t/** Random-access: the entire payload lives in memory. */\n\tcanSlice = true;\n\t/**\n\t* Create a BufferSource wrapping the given Uint8Array.\n\t* @param buffer - The byte buffer to use as the underlying content.\n\t*/\n\tconstructor(buffer) {\n\t\tthis.buffer = buffer;\n\t\tthis.size = buffer.byteLength;\n\t}\n\t/**\n\t* Return a new BufferSource covering the specified byte range.\n\t* @param start - The zero-based byte offset to begin the slice.\n\t* @param end - The exclusive byte offset where the slice ends.\n\t*\n\t* @returns A new ContentSource representing the requested sub-range.\n\t*/\n\tslice(start, end) {\n\t\treturn new BufferSource(this.buffer.slice(start, end));\n\t}\n\t/**\n\t* Open the buffer content as a ReadableStream.\n\t* @returns A ReadableStream that emits the buffer bytes in a single chunk.\n\t*/\n\tstream() {\n\t\tconst buffer = this.buffer;\n\t\treturn new ReadableStream({ start(controller) {\n\t\t\tcontroller.enqueue(buffer);\n\t\t\tcontroller.close();\n\t\t} });\n\t}\n\t/**\n\t* Read the entire buffer content into an ArrayBuffer.\n\t* @param options - Optional abort signal checked before returning bytes.\n\t*\n\t* @returns A promise that resolves with the full content as an ArrayBuffer.\n\t*/\n\tasync toArrayBuffer(options = {}) {\n\t\toptions.signal?.throwIfAborted();\n\t\treturn arrayBufferFor(this.buffer);\n\t}\n};\n/** ContentSource backed by a ReadableStream. Can only be consumed once and does not support slicing. */\nvar StreamSource = class {\n\treadable;\n\t/** {@inheritDoc} */\n\tsize;\n\t/**\n\t* Forward-only: ReadableStreams cannot be repositioned, so multipart\n\t* uploads must take the sequential path. See the interface comment on\n\t* `canSlice` for what the engine does with this flag.\n\t*/\n\tcanSlice = false;\n\t/** Whether the stream has already been read. */\n\tconsumed = false;\n\t/**\n\t* Create a StreamSource wrapping the given ReadableStream with a known byte size.\n\t* @param readable - The ReadableStream to wrap as a content source.\n\t* @param size - The total number of bytes the stream will produce.\n\t*/\n\tconstructor(readable, size) {\n\t\tthis.readable = readable;\n\t\tvalidateStreamSourceSize(size);\n\t\tthis.size = size;\n\t}\n\t/**\n\t* Always throws because streams cannot be sliced. Buffer the stream first.\n\t*\n\t* @throws If slicing is attempted on a stream-backed source.\n\t*/\n\tslice() {\n\t\tthrow new Error(\"StreamSource does not support slicing. Buffer the stream first.\");\n\t}\n\t/**\n\t* Open the underlying ReadableStream. Can only be called once.\n\t* @returns The underlying ReadableStream of bytes.\n\t*\n\t* @throws If the stream has already been consumed.\n\t*/\n\tstream() {\n\t\tif (this.consumed) throw new Error(\"StreamSource can only be consumed once.\");\n\t\tthis.consumed = true;\n\t\treturn this.readable;\n\t}\n\t/**\n\t* Read the entire stream into an ArrayBuffer.\n\t* @param options - Optional abort signal used while reading.\n\t*\n\t* @returns A promise that resolves with the full content as an ArrayBuffer.\n\t*/\n\tasync toArrayBuffer(options = {}) {\n\t\treturn (await collectStreamExactly(this.stream(), this.size, options.signal)).buffer;\n\t}\n};\nfunction validateStreamSourceSize(size) {\n\tif (!Number.isFinite(size) || !Number.isInteger(size) || size < 0) throw new RangeError(\"StreamSource size must be a non-negative finite integer.\");\n}\n/**\n* Reads exactly the advertised number of bytes from a stream.\n* @param stream - Stream to consume.\n* @param expectedSize - Exact number of bytes expected from the stream.\n* @param signal - Optional abort signal for cancelling the read.\n*\n* @returns A byte array of length `expectedSize`.\n*\n* @throws If the stream emits too few bytes, too many bytes, too many empty chunks, or aborts.\n*/\nasync function collectStreamExactly(stream, expectedSize, signal) {\n\tconst reader = stream.getReader();\n\tconst chunks = [];\n\tlet total = 0;\n\tlet completed = false;\n\ttry {\n\t\twhile (total < expectedSize) {\n\t\t\tconst { done, value } = await readNextNonEmptyStreamChunk(reader, STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR, signal);\n\t\t\tif (done) throw new Error(STREAM_SOURCE_ENDED_EARLY_ERROR);\n\t\t\tif (total + value.byteLength > expectedSize) throw new Error(STREAM_SOURCE_TOO_MANY_BYTES_ERROR);\n\t\t\tchunks.push(value);\n\t\t\ttotal += value.byteLength;\n\t\t}\n\t\tif (!(await readNextNonEmptyStreamChunk(reader, STREAM_SOURCE_TOO_MANY_EMPTY_CHUNKS_ERROR, signal)).done) throw new Error(STREAM_SOURCE_TOO_MANY_BYTES_ERROR);\n\t\tconst result = new Uint8Array(expectedSize);\n\t\tlet offset = 0;\n\t\tfor (const chunk of chunks) {\n\t\t\tresult.set(chunk, offset);\n\t\t\toffset += chunk.byteLength;\n\t\t}\n\t\tcompleted = true;\n\t\treturn result;\n\t} finally {\n\t\tif (!completed) cancelReaderBestEffort(reader);\n\t\ttry {\n\t\t\treader.releaseLock();\n\t\t} catch {}\n\t}\n}\n/**\n* Reads from a stream until it receives data, EOF, or too many consecutive empty chunks.\n* @param reader - Locked reader for a Uint8Array stream.\n* @param emptyChunkErrorMessage - Error message to throw when the empty-chunk limit is exceeded.\n* @param signal - Optional abort signal that cancels the reader and rejects the read.\n*\n* @returns The next non-empty chunk or EOF result.\n*/\nasync function readNextNonEmptyStreamChunk(reader, emptyChunkErrorMessage, signal) {\n\tlet emptyChunks = 0;\n\twhile (true) {\n\t\tconst result = await readStreamChunk(reader, signal);\n\t\tif (result.done || result.value.byteLength > 0) return result;\n\t\temptyChunks += 1;\n\t\tif (emptyChunks > 1024) throw new Error(emptyChunkErrorMessage);\n\t}\n}\nasync function readStreamChunk(reader, signal) {\n\tif (signal === void 0) return reader.read();\n\tif (signal.aborted) {\n\t\tconst reason = signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\t\tcancelReaderBestEffort(reader, reason);\n\t\tthrow reason;\n\t}\n\tlet removeAbortListener;\n\tconst abort = new Promise((_, reject) => {\n\t\tconst onAbort = () => {\n\t\t\tconst reason = signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\t\t\tcancelReaderBestEffort(reader, reason);\n\t\t\treject(reason);\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\tconst result = await Promise.race([reader.read(), abort]);\n\t\tif (signal.aborted) {\n\t\t\tconst reason = signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\t\t\tcancelReaderBestEffort(reader, reason);\n\t\t\tthrow reason;\n\t\t}\n\t\treturn result;\n\t} finally {\n\t\tremoveAbortListener?.();\n\t}\n}\nfunction cancelReaderBestEffort(reader, reason) {\n\t/* v8 ignore next -- Reader cancellation failure is deliberately best-effort. */\n\treader.cancel(reason).catch(() => {});\n}\n/** ContentSource backed by a forward-only async iterable of Uint8Array chunks. */\nvar AsyncIterableSource = class extends StreamSource {\n\t/**\n\t* Create an AsyncIterableSource from a known-size async iterable.\n\t* @param iterable - Async iterable that yields Uint8Array chunks.\n\t* @param size - Total byte length the iterable will produce.\n\t*/\n\tconstructor(iterable, size) {\n\t\tsuper(asyncIterableToReadableStream(iterable), size);\n\t}\n};\n/**\n* Convert a Uint8Array, Blob, ReadableStream, or async iterable into a {@link ContentSource}.\n* When passing a ReadableStream or async iterable, the `size` parameter is required.\n* @param input - The content to wrap.\n* @param size - The total byte length, required for forward-only inputs.\n*\n* @returns A ContentSource adapter for the given input.\n*\n* @throws If input is forward-only and size is not provided.\n*/\nfunction toContentSource(input, size) {\n\tif (input instanceof Uint8Array) return new BufferSource(input);\n\tif (input instanceof Blob) return new BlobSource(input);\n\tif (isReadableStream(input)) {\n\t\tif (size === void 0) throw new Error(READABLE_STREAM_SIZE_REQUIRED_ERROR);\n\t\treturn new StreamSource(input, size);\n\t}\n\tif (isAsyncIterable(input)) {\n\t\tif (size === void 0) throw new Error(FORWARD_ONLY_SIZE_REQUIRED_ERROR);\n\t\treturn new AsyncIterableSource(input, size);\n\t}\n\tthrow new TypeError(\"Unsupported content source input.\");\n}\n//#endregion\nexport { BlobSource, BufferSource, FileSource, MAX_EMPTY_STREAM_CHUNKS, StreamSource, collectStreamExactly, readNextNonEmptyStreamChunk, toContentSource };\n\n//# sourceMappingURL=source.js.map","//#region src/types/bucket.ts\n/**\n* Named constants for the bucket access level.\n*\n* The {@link BucketType} type alias is derived from the values of this\n* object, so the const is the single source of truth: adding a key here\n* automatically widens the type union.\n*\n* @example\n* ```ts\n* await client.createBucket({ bucketName: 'my-app-logs', bucketType: BucketType.AllPrivate })\n* ```\n*/\nvar BucketType = {\n\t/** Publicly downloadable without authentication. */\n\tAllPublic: \"allPublic\",\n\t/** Requires a valid auth token to download. */\n\tAllPrivate: \"allPrivate\",\n\t/** Internal snapshot bucket type, generally not user-created. */\n\tSnapshot: \"snapshot\",\n\t/** B2-restricted bucket (e.g., for S3-compatible workflows). */\n\tRestricted: \"restricted\"\n};\n/**\n* Named constants for the B2 + S3 operations a CORS rule can permit.\n*\n* @example\n* ```ts\n* await bucket.update({\n* corsRules: [{\n* corsRuleName: 'browser-downloads',\n* allowedOrigins: ['https://example.com'],\n* allowedOperations: [CorsOperation.B2DownloadFileByName, CorsOperation.S3Get],\n* allowedHeaders: null,\n* exposeHeaders: null,\n* maxAgeSeconds: 3600,\n* }],\n* })\n* ```\n*/\nvar CorsOperation = {\n\t/** Native B2 download-by-name request. */\n\tB2DownloadFileByName: \"b2_download_file_by_name\",\n\t/** Native B2 download-by-id request. */\n\tB2DownloadFileById: \"b2_download_file_by_id\",\n\t/** Native B2 small-file upload. */\n\tB2UploadFile: \"b2_upload_file\",\n\t/** Native B2 multipart-part upload. */\n\tB2UploadPart: \"b2_upload_part\",\n\t/** S3-compatible DELETE. */\n\tS3Delete: \"s3_delete\",\n\t/** S3-compatible GET. */\n\tS3Get: \"s3_get\",\n\t/** S3-compatible HEAD. */\n\tS3Head: \"s3_head\",\n\t/** S3-compatible POST. */\n\tS3Post: \"s3_post\",\n\t/** S3-compatible PUT. */\n\tS3Put: \"s3_put\"\n};\n/**\n* Named constants for the bucket-level Object Lock retention mode.\n*\n* Pair with {@link BucketRetentionPolicy} when setting a bucket's default\n* retention: `{ mode: BucketRetentionMode.Compliance, period: { duration: 30, unit: 'days' } }`.\n*/\nvar BucketRetentionMode = {\n\t/** Files cannot be deleted or modified during the retention period, even by the account owner. */\n\tCompliance: \"compliance\",\n\t/** Files cannot be deleted during retention except by callers with the `bypassGovernance` capability. */\n\tGovernance: \"governance\",\n\t/** No default retention is applied to new uploads. */\n\tNone: \"none\"\n};\n//#endregion\nexport { BucketRetentionMode, BucketType, CorsOperation };\n\n//# sourceMappingURL=bucket.js.map","//#region src/types/encryption.ts\n/** Named constants for the supported server-side encryption algorithms. */\nvar EncryptionAlgorithm = { \n/** AES with a 256-bit key. The only algorithm B2 currently supports. */\nAes256: \"AES256\" };\n/**\n* Named constants for the server-side encryption mode used by a file.\n*\n* Most callers should use the {@link SSE_B2}, {@link SSE_NONE}, and\n* {@link sseCustomer} helpers below which return complete\n* {@link EncryptionSetting} objects. These constants are useful when you\n* need the bare mode discriminator (e.g., when introspecting a file's\n* current encryption setting).\n*/\nvar EncryptionMode = {\n\t/** B2-managed encryption keys. */\n\tSseB2: \"SSE-B2\",\n\t/** Customer-provided encryption keys. */\n\tSseC: \"SSE-C\",\n\t/** No encryption. */\n\tNone: \"none\"\n};\n/** Pre-built SSE-B2 encryption setting using AES-256. */\nvar SSE_B2 = {\n\tmode: \"SSE-B2\",\n\talgorithm: \"AES256\"\n};\n/** Pre-built setting indicating no server-side encryption. */\nvar SSE_NONE = { mode: \"none\" };\n/**\n* Creates an SSE-C encryption setting with a customer-provided key.\n* @param customerKey - Base64-encoded 256-bit encryption key.\n* @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n*\n* @returns An SSE-C encryption setting ready to pass to upload or download calls.\n*/\nfunction sseCustomer(customerKey, customerKeyMd5) {\n\treturn {\n\t\tmode: \"SSE-C\",\n\t\talgorithm: \"AES256\",\n\t\tcustomerKey,\n\t\tcustomerKeyMd5\n\t};\n}\n/**\n* Encodes raw bytes as base64 in an isomorphic way (Node Buffer fallback to btoa).\n*\n* @param bytes - The raw bytes to encode.\n*\n* @returns The base64-encoded string.\n*/\nfunction bytesToBase64(bytes) {\n\tconst g = globalThis;\n\tif (g.Buffer) return g.Buffer.from(bytes).toString(\"base64\");\n\tlet binary = \"\";\n\tfor (const b of bytes) binary += String.fromCharCode(b);\n\treturn btoa(binary);\n}\n/**\n* Computes the MD5 digest of the given bytes as a base64 string. Prefers\n* `node:crypto` for native speed when available; falls back to a pure-JS\n* implementation in browser / edge runtimes because WebCrypto's\n* `crypto.subtle.digest` deliberately does not support MD5.\n*\n* MD5 is used here only for SSE-C key integrity (matching the B2 wire\n* protocol). It is **not** a security boundary; the customer key itself is\n* the secret. Bundling a pure-JS fallback keeps `EncryptionKey.fromBytes`\n* isomorphic.\n*\n* @param bytes - The bytes to digest.\n*\n* @returns The base64-encoded MD5 digest.\n*/\nasync function md5Base64(bytes) {\n\ttry {\n\t\tconst { createHash } = await import(\"node:crypto\");\n\t\tif (typeof createHash !== \"function\") throw new Error(\"createHash unavailable\");\n\t\treturn createHash(\"md5\").update(bytes).digest(\"base64\");\n\t} catch {\n\t\treturn bytesToBase64(md5Bytes(bytes));\n\t}\n}\n/**\n* Pure-JS MD5 implementation per RFC 1321. Returns the 16-byte digest of the\n* input. Used as a browser fallback for SSE-C key MD5 computation; not\n* intended for security-sensitive purposes (MD5 is broken cryptographically).\n*\n* @param data - The bytes to hash.\n*\n* @returns The 16-byte MD5 digest.\n*/\nfunction md5Bytes(data) {\n\tconst originalBitLength = data.byteLength * 8;\n\tconst padLength = (data.byteLength + 8 >>> 6) + 1;\n\tconst padded = new Uint8Array(padLength * 64);\n\tpadded.set(data);\n\tpadded[data.byteLength] = 128;\n\tconst lowBits = originalBitLength >>> 0;\n\tconst highBits = Math.floor(originalBitLength / 4294967296) >>> 0;\n\tconst lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8);\n\tlengthView.setUint32(0, lowBits, true);\n\tlengthView.setUint32(4, highBits, true);\n\tconst s = [\n\t\t7,\n\t\t12,\n\t\t17,\n\t\t22,\n\t\t7,\n\t\t12,\n\t\t17,\n\t\t22,\n\t\t7,\n\t\t12,\n\t\t17,\n\t\t22,\n\t\t7,\n\t\t12,\n\t\t17,\n\t\t22,\n\t\t5,\n\t\t9,\n\t\t14,\n\t\t20,\n\t\t5,\n\t\t9,\n\t\t14,\n\t\t20,\n\t\t5,\n\t\t9,\n\t\t14,\n\t\t20,\n\t\t5,\n\t\t9,\n\t\t14,\n\t\t20,\n\t\t4,\n\t\t11,\n\t\t16,\n\t\t23,\n\t\t4,\n\t\t11,\n\t\t16,\n\t\t23,\n\t\t4,\n\t\t11,\n\t\t16,\n\t\t23,\n\t\t4,\n\t\t11,\n\t\t16,\n\t\t23,\n\t\t6,\n\t\t10,\n\t\t15,\n\t\t21,\n\t\t6,\n\t\t10,\n\t\t15,\n\t\t21,\n\t\t6,\n\t\t10,\n\t\t15,\n\t\t21,\n\t\t6,\n\t\t10,\n\t\t15,\n\t\t21\n\t];\n\tconst k = new Uint32Array([\n\t\t3614090360,\n\t\t3905402710,\n\t\t606105819,\n\t\t3250441966,\n\t\t4118548399,\n\t\t1200080426,\n\t\t2821735955,\n\t\t4249261313,\n\t\t1770035416,\n\t\t2336552879,\n\t\t4294925233,\n\t\t2304563134,\n\t\t1804603682,\n\t\t4254626195,\n\t\t2792965006,\n\t\t1236535329,\n\t\t4129170786,\n\t\t3225465664,\n\t\t643717713,\n\t\t3921069994,\n\t\t3593408605,\n\t\t38016083,\n\t\t3634488961,\n\t\t3889429448,\n\t\t568446438,\n\t\t3275163606,\n\t\t4107603335,\n\t\t1163531501,\n\t\t2850285829,\n\t\t4243563512,\n\t\t1735328473,\n\t\t2368359562,\n\t\t4294588738,\n\t\t2272392833,\n\t\t1839030562,\n\t\t4259657740,\n\t\t2763975236,\n\t\t1272893353,\n\t\t4139469664,\n\t\t3200236656,\n\t\t681279174,\n\t\t3936430074,\n\t\t3572445317,\n\t\t76029189,\n\t\t3654602809,\n\t\t3873151461,\n\t\t530742520,\n\t\t3299628645,\n\t\t4096336452,\n\t\t1126891415,\n\t\t2878612391,\n\t\t4237533241,\n\t\t1700485571,\n\t\t2399980690,\n\t\t4293915773,\n\t\t2240044497,\n\t\t1873313359,\n\t\t4264355552,\n\t\t2734768916,\n\t\t1309151649,\n\t\t4149444226,\n\t\t3174756917,\n\t\t718787259,\n\t\t3951481745\n\t]);\n\tlet a0 = 1732584193;\n\tlet b0 = 4023233417;\n\tlet c0 = 2562383102;\n\tlet d0 = 271733878;\n\tconst m = /* @__PURE__ */ new Uint32Array(16);\n\tconst view = new DataView(padded.buffer);\n\tfor (let block = 0; block < padded.byteLength; block += 64) {\n\t\tfor (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true);\n\t\tlet A = a0;\n\t\tlet B = b0;\n\t\tlet C = c0;\n\t\tlet D = d0;\n\t\tfor (let i = 0; i < 64; i++) {\n\t\t\tlet f;\n\t\t\tlet g;\n\t\t\tif (i < 16) {\n\t\t\t\tf = B & C | ~B & D;\n\t\t\t\tg = i;\n\t\t\t} else if (i < 32) {\n\t\t\t\tf = D & B | ~D & C;\n\t\t\t\tg = (5 * i + 1) % 16;\n\t\t\t} else if (i < 48) {\n\t\t\t\tf = B ^ C ^ D;\n\t\t\t\tg = (3 * i + 5) % 16;\n\t\t\t} else {\n\t\t\t\tf = C ^ (B | ~D);\n\t\t\t\tg = 7 * i % 16;\n\t\t\t}\n\t\t\tconst temp = D;\n\t\t\tD = C;\n\t\t\tC = B;\n\t\t\tconst sum = A + f + (k[i] ?? 0) + (m[g] ?? 0) >>> 0;\n\t\t\tconst shift = s[i] ?? 0;\n\t\t\tconst rotated = (sum << shift | sum >>> 32 - shift) >>> 0;\n\t\t\tB = B + rotated >>> 0;\n\t\t\tA = temp;\n\t\t}\n\t\ta0 = a0 + A >>> 0;\n\t\tb0 = b0 + B >>> 0;\n\t\tc0 = c0 + C >>> 0;\n\t\td0 = d0 + D >>> 0;\n\t}\n\tconst out = /* @__PURE__ */ new Uint8Array(16);\n\tconst outView = new DataView(out.buffer);\n\toutView.setUint32(0, a0, true);\n\toutView.setUint32(4, b0, true);\n\toutView.setUint32(8, c0, true);\n\toutView.setUint32(12, d0, true);\n\treturn out;\n}\nvar KEY_REDACTED = \"[redacted SSE-C key]\";\n/**\n* Safe wrapper around an SSE-C customer key. Hides the key bytes from\n* `JSON.stringify`, `console.log`, and Node's `util.inspect`. Use {@link EncryptionKey.fromBytes}\n* to construct one from a raw 32-byte key; the MD5 digest is computed internally.\n*/\nvar EncryptionKey = class EncryptionKey {\n\t/** Encryption mode discriminant. Always `'SSE-C'` for this class. */\n\tmode = \"SSE-C\";\n\t/** Encryption algorithm. B2's S3-compatible API only supports AES-256. */\n\talgorithm = \"AES256\";\n\t/** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */\n\tcustomerKey;\n\t/** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */\n\tcustomerKeyMd5;\n\t/**\n\t* Internal constructor. Use {@link EncryptionKey.fromBytes} or\n\t* {@link EncryptionKey.fromBase64} instead.\n\t*\n\t* @param customerKey - Base64-encoded 256-bit encryption key.\n\t* @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n\t*\n\t* @internal\n\t*/\n\tconstructor(customerKey, customerKeyMd5) {\n\t\tthis.customerKey = customerKey;\n\t\tthis.customerKeyMd5 = customerKeyMd5;\n\t}\n\t/**\n\t* Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the\n\t* required base64 MD5 digest internally.\n\t*\n\t* @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes.\n\t*\n\t* @returns A safely-wrapped EncryptionKey ready for upload/download.\n\t*\n\t* @throws If the key is not exactly 32 bytes.\n\t*/\n\tstatic async fromBytes(rawKey) {\n\t\tif (rawKey.byteLength !== 32) throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`);\n\t\tconst customerKey = bytesToBase64(rawKey);\n\t\tconst customerKeyMd5 = await md5Base64(rawKey);\n\t\treturn new EncryptionKey(customerKey, customerKeyMd5);\n\t}\n\t/**\n\t* Builds an EncryptionKey from precomputed base64 strings. Use this in\n\t* environments where MD5 must be computed externally (e.g., browsers).\n\t*\n\t* @param customerKey - Base64-encoded 256-bit encryption key.\n\t* @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n\t*\n\t* @returns A safely-wrapped EncryptionKey ready for upload/download.\n\t*/\n\tstatic fromBase64(customerKey, customerKeyMd5) {\n\t\treturn new EncryptionKey(customerKey, customerKeyMd5);\n\t}\n\t/**\n\t* Hides the key bytes from `JSON.stringify`.\n\t*\n\t* @returns A redacted shape: same mode and algorithm, but the key and MD5\n\t* replaced with a placeholder string.\n\t*/\n\ttoJSON() {\n\t\treturn {\n\t\t\tmode: this.mode,\n\t\t\talgorithm: this.algorithm,\n\t\t\tcustomerKey: KEY_REDACTED,\n\t\t\tcustomerKeyMd5: KEY_REDACTED\n\t\t};\n\t}\n\t/**\n\t* Hides the key bytes from default `toString()`.\n\t*\n\t* @returns A short opaque label indicating this is an SSE-C key.\n\t*/\n\ttoString() {\n\t\treturn `[EncryptionKey SSE-C ${KEY_REDACTED}]`;\n\t}\n\t/**\n\t* Hides the key bytes from Node's `util.inspect` (and therefore `console.log`).\n\t*\n\t* @returns A short opaque label indicating this is an SSE-C key.\n\t*/\n\t[Symbol.for(\"nodejs.util.inspect.custom\")]() {\n\t\treturn this.toString();\n\t}\n};\n//#endregion\nexport { EncryptionAlgorithm, EncryptionKey, EncryptionMode, SSE_B2, SSE_NONE, sseCustomer };\n\n//# sourceMappingURL=encryption.js.map","import { largeFileId } from \"../types/ids.js\";\nimport { ResumeFileIdMismatchError } from \"../errors/index.js\";\nimport { BucketRetentionMode } from \"../types/bucket.js\";\nimport { EncryptionMode } from \"../types/encryption.js\";\n//#region src/upload/resume.ts\n/** Compatibility-only file-info key read from legacy unfinished uploads; new uploads do not write it. */\nvar RESUME_SOURCE_SIZE_INFO_KEY = \"b2_sdk_resume_source_size\";\n/** Compatibility-only file-info key read from legacy unfinished uploads; new uploads do not write it. */\nvar RESUME_PART_SIZE_INFO_KEY = \"b2_sdk_resume_part_size\";\nvar DEFAULT_MAX_RESUME_LIST_PAGES = 10;\nvar DEFAULT_MAX_RESUME_PART_CANDIDATES = 25;\nvar DEFAULT_MAX_RESUME_PART_PAGES = 10;\nvar LIST_PARTS_PAGE_SIZE = 100;\n/**\n* Finds an unfinished large file matching the given bucket and file name.\n* Returns `null` when no compatible candidate exists.\n*\n* With criteria, the newest compatible candidate is selected; incompatible\n* same-name uploads are ignored and optionally reported via\n* `onCandidateRejected`.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param bucketId - Target bucket of the upload.\n* @param fileName - Destination file name of the upload.\n* @param criteria - Upload identity and option checks.\n*\n* @returns A {@link ResumeCandidate} describing the candidate and its uploaded parts, or `null`.\n*/\nasync function findResumeCandidate(raw, accountInfo, bucketId, fileName, criteria) {\n\tconst discoverySignal = createResumeDiscoverySignal(criteria);\n\ttry {\n\t\treturn await findResumeCandidateWithSignal(raw, accountInfo, bucketId, fileName, criteria, discoverySignal.signal);\n\t} finally {\n\t\tdiscoverySignal.dispose();\n\t}\n}\nasync function findResumeCandidateWithSignal(raw, accountInfo, bucketId, fileName, criteria, signal) {\n\tconst matches = [];\n\tconst maxListPages = criteria.maxListPages ?? DEFAULT_MAX_RESUME_LIST_PAGES;\n\tconst maxPartCandidates = criteria.maxPartCandidates ?? DEFAULT_MAX_RESUME_PART_CANDIDATES;\n\tlet sequence = 0;\n\tlet pageCount = 0;\n\tconst explicitResumeFileId = criteria.resumeFileId;\n\tlet startFileId = explicitResumeFileId;\n\tlet truncated = false;\n\twhile (pageCount < maxListPages) {\n\t\tsignal?.throwIfAborted();\n\t\tconst unfinished = await abortableRequest(raw.listUnfinishedLargeFiles(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tbucketId,\n\t\t\tmaxFileCount: explicitResumeFileId !== void 0 ? 1 : 100,\n\t\t\tnamePrefix: fileName,\n\t\t\t...startFileId !== void 0 ? { startFileId } : {}\n\t\t}, signal !== void 0 ? { signal } : void 0), signal);\n\t\tpageCount++;\n\t\tfor (const file of unfinished.files) {\n\t\t\tif (explicitResumeFileId !== void 0 ? file.fileId === explicitResumeFileId : file.fileName === fileName) matches.push({\n\t\t\t\tfile,\n\t\t\t\tsequence\n\t\t\t});\n\t\t\tsequence++;\n\t\t}\n\t\tif (explicitResumeFileId !== void 0) break;\n\t\tif (unfinished.nextFileId === null) break;\n\t\tstartFileId = unfinished.nextFileId;\n\t\ttruncated = pageCount >= maxListPages;\n\t}\n\tif (truncated) emitCandidateRejected(criteria, {\n\t\trequestedFileName: fileName,\n\t\treason: \"search-truncated\"\n\t});\n\tmatches.sort(compareNewestFirst);\n\tlet partCandidatesInspected = 0;\n\tfor (const match of matches) {\n\t\tsignal?.throwIfAborted();\n\t\tconst rejection = candidateMetadataRejectReason(match.file, fileName, criteria);\n\t\tif (rejection !== null) {\n\t\t\tnotifyCandidateRejected(criteria, match.file, fileName, rejection);\n\t\t\tcontinue;\n\t\t}\n\t\tif (partCandidatesInspected >= maxPartCandidates) {\n\t\t\tnotifyCandidateRejected(criteria, match.file, fileName, \"candidate-limit\");\n\t\t\tbreak;\n\t\t}\n\t\tpartCandidatesInspected++;\n\t\tconst fileId = largeFileId(match.file.fileId);\n\t\tconst uploadedPartsResult = await collectResumePartInfo(raw, accountInfo, fileId, {\n\t\t\tmaxPages: criteria.maxPartPages ?? DEFAULT_MAX_RESUME_PART_PAGES,\n\t\t\tmaxParts: criteria.parts.length,\n\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t});\n\t\tconst uploadedParts = uploadedPartsResult.parts;\n\t\tif (uploadedPartsResult.truncated || !uploadedPartsMatchPlan(uploadedParts, criteria.parts)) {\n\t\t\tnotifyCandidateRejected(criteria, match.file, fileName, \"part-length-mismatch\");\n\t\t\tcontinue;\n\t\t}\n\t\treturn {\n\t\t\tfileId,\n\t\t\tuploadedPartSha1s: partInfoToSha1s(uploadedParts)\n\t\t};\n\t}\n\treturn null;\n}\nasync function collectResumePartInfo(raw, accountInfo, fileId, options) {\n\tconst parts = /* @__PURE__ */ new Map();\n\tconst maxPages = options.maxPages ?? Number.POSITIVE_INFINITY;\n\tconst maxParts = options.maxParts ?? Number.POSITIVE_INFINITY;\n\tlet startPartNumber;\n\tlet pageCount = 0;\n\twhile (pageCount < maxPages) {\n\t\toptions.signal?.throwIfAborted();\n\t\tconst remainingParts = maxParts === Number.POSITIVE_INFINITY ? void 0 : Math.max(1, Math.min(LIST_PARTS_PAGE_SIZE, maxParts - parts.size + 1));\n\t\tconst page = await abortableRequest(raw.listParts(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tfileId,\n\t\t\t...startPartNumber !== void 0 ? { startPartNumber } : {},\n\t\t\t...remainingParts !== void 0 ? { maxPartCount: remainingParts } : {}\n\t\t}, options.signal !== void 0 ? { signal: options.signal } : void 0), options.signal);\n\t\tpageCount++;\n\t\tfor (const part of page.parts) {\n\t\t\tparts.set(part.partNumber, {\n\t\t\t\tcontentSha1: part.contentSha1,\n\t\t\t\tcontentLength: part.contentLength\n\t\t\t});\n\t\t\tif (parts.size > maxParts) return {\n\t\t\t\tparts,\n\t\t\t\ttruncated: true\n\t\t\t};\n\t\t}\n\t\tif (page.nextPartNumber === null) return {\n\t\t\tparts,\n\t\t\ttruncated: false\n\t\t};\n\t\tassertAdvancingPartCursor(fileId, startPartNumber, page.nextPartNumber);\n\t\tstartPartNumber = page.nextPartNumber;\n\t}\n\treturn {\n\t\tparts,\n\t\ttruncated: true\n\t};\n}\nfunction compareNewestFirst(a, b) {\n\tconst aTime = a.file.uploadTimestamp ?? Number.NEGATIVE_INFINITY;\n\tconst bTime = b.file.uploadTimestamp ?? Number.NEGATIVE_INFINITY;\n\tif (aTime !== bTime) return bTime - aTime;\n\treturn b.sequence - a.sequence;\n}\nfunction candidateMetadataRejectReason(candidate, fileName, criteria) {\n\tif (candidate.fileName !== fileName) return \"file-name-mismatch\";\n\tif (criteria.contentType === \"b2/x-auto\" && criteria.resumeFileId === void 0 && candidate.contentType !== \"b2/x-auto\") return \"content-type-mismatch\";\n\tif (criteria.contentType !== \"b2/x-auto\" && candidate.contentType !== criteria.contentType) return \"content-type-mismatch\";\n\tconst candidateInfo = splitResumeFileInfo(candidate.fileInfo ?? {});\n\tif (!recordEquals(candidateInfo.fileInfo, criteria.fileInfo)) return \"file-info-mismatch\";\n\tif (candidateInfo.sourceSize !== void 0 && candidateInfo.sourceSize !== String(criteria.sourceSize)) return \"source-size-mismatch\";\n\tif (candidateInfo.partSize !== void 0 && candidateInfo.partSize !== String(criteria.partSize)) return \"part-size-mismatch\";\n\tconst encryptionRejectReason = serverSideEncryptionRejectReason(candidate.serverSideEncryption, criteria.serverSideEncryption);\n\tif (encryptionRejectReason !== null) return encryptionRejectReason;\n\tif (!fileRetentionMatches(candidate.fileRetention, criteria.fileRetention, criteria.defaultFileRetention, criteria.defaultFileRetentionUnreadable === true, candidate.uploadTimestamp)) return \"retention-mismatch\";\n\tif (!legalHoldMatches(candidate.legalHold, criteria.legalHold)) return \"legal-hold-mismatch\";\n\treturn null;\n}\nfunction notifyCandidateRejected(criteria, candidate, requestedFileName, reason) {\n\temitCandidateRejected(criteria, {\n\t\tfileId: largeFileId(candidate.fileId),\n\t\trequestedFileName,\n\t\tcandidateFileName: candidate.fileName,\n\t\treason\n\t});\n}\nfunction emitCandidateRejected(criteria, event) {\n\ttry {\n\t\tcriteria.onCandidateRejected?.(event);\n\t} catch {}\n}\nfunction uploadedPartsMatchPlan(uploadedParts, plans) {\n\tfor (const [partNumber, part] of uploadedParts) {\n\t\tconst planned = plans[partNumber - 1];\n\t\tif (planned === void 0) return false;\n\t\tif (planned.partNumber !== partNumber) return false;\n\t\tif (planned.length !== part.contentLength) return false;\n\t}\n\treturn true;\n}\nfunction partInfoToSha1s(parts) {\n\tconst sha1s = /* @__PURE__ */ new Map();\n\tfor (const [partNumber, part] of parts) sha1s.set(partNumber, part.contentSha1);\n\treturn sha1s;\n}\nfunction recordEquals(a, b) {\n\tconst aKeys = Object.keys(a);\n\tconst bKeys = Object.keys(b);\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (const key of aKeys) if (a[key] !== b[key]) return false;\n\treturn true;\n}\nfunction splitResumeFileInfo(fileInfo) {\n\tconst userFileInfo = Object.create(null);\n\tlet sourceSize;\n\tlet partSize;\n\tfor (const [key, value] of Object.entries(fileInfo)) if (key === \"b2_sdk_resume_source_size\") sourceSize = value;\n\telse if (key === \"b2_sdk_resume_part_size\") partSize = value;\n\telse userFileInfo[key] = value;\n\treturn {\n\t\tfileInfo: userFileInfo,\n\t\t...sourceSize !== void 0 ? { sourceSize } : {},\n\t\t...partSize !== void 0 ? { partSize } : {}\n\t};\n}\nfunction fileRetentionMatches(candidate, expected, defaultExpected, defaultUnreadable, uploadTimestamp) {\n\tif (expected === void 0 && defaultUnreadable) return false;\n\tif (expected === void 0 && defaultExpected !== void 0) {\n\t\tif (defaultExpected.mode === BucketRetentionMode.None) {\n\t\t\tif (candidate === void 0) return true;\n\t\t\tif (!candidate.isClientAuthorizedToRead) return false;\n\t\t\treturn fileRetentionValueEquals(candidate.value, null);\n\t\t}\n\t\tif (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false;\n\t\treturn fileRetentionValueMatchesBucketDefault(candidate.value, defaultExpected, uploadTimestamp);\n\t}\n\tif (expected === void 0) {\n\t\tif (candidate === void 0) return true;\n\t\tif (!candidate.isClientAuthorizedToRead) return false;\n\t\treturn fileRetentionValueEquals(candidate.value, null);\n\t}\n\tif (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false;\n\treturn fileRetentionValueEquals(candidate.value, expected);\n}\nfunction fileRetentionValueMatchesBucketDefault(candidate, expected, uploadTimestamp) {\n\tif (expected.period === null) return false;\n\tif (candidate?.mode !== expected.mode || candidate.retainUntilTimestamp === null) return false;\n\tif (uploadTimestamp === void 0) return false;\n\treturn candidate.retainUntilTimestamp === uploadTimestamp + retentionPeriodMillis(expected.period);\n}\nfunction retentionPeriodMillis(period) {\n\tif (period === null) return 0;\n\treturn (period.unit === \"days\" ? period.duration : period.duration * 365) * 24 * 60 * 60 * 1e3;\n}\nfunction fileRetentionValueEquals(a, b) {\n\treturn (a?.mode ?? null) === (b?.mode ?? null) && (a?.retainUntilTimestamp ?? null) === (b?.retainUntilTimestamp ?? null);\n}\nfunction legalHoldMatches(candidate, expected) {\n\tif (expected === void 0) {\n\t\tif (candidate === void 0) return true;\n\t\tif (!candidate.isClientAuthorizedToRead) return false;\n\t\treturn candidate.value === null || candidate.value === \"off\";\n\t}\n\tif (candidate === void 0 || !candidate.isClientAuthorizedToRead) return false;\n\treturn candidate.value === expected;\n}\nfunction createResumeDiscoverySignal(criteria) {\n\tif (criteria.signal !== void 0) return {\n\t\tsignal: criteria.signal,\n\t\tdispose() {}\n\t};\n\tif (criteria.discoveryTimeoutMs === void 0) return { dispose() {} };\n\tconst timeoutMs = criteria.discoveryTimeoutMs;\n\tif (timeoutMs === Number.POSITIVE_INFINITY) return { dispose() {} };\n\tconst controller = new AbortController();\n\tconst timeout = setTimeout(() => {\n\t\tcontroller.abort(resumeDiscoveryTimeoutReason(timeoutMs));\n\t}, Math.max(0, timeoutMs));\n\treturn {\n\t\tsignal: controller.signal,\n\t\tdispose() {\n\t\t\tclearTimeout(timeout);\n\t\t}\n\t};\n}\nasync function abortableRequest(request, signal) {\n\tif (signal === void 0) return request;\n\tif (signal.aborted) throw resumeAbortReason(signal);\n\tlet removeAbortListener;\n\tconst aborted = new Promise((_resolve, reject) => {\n\t\tconst onAbort = () => reject(resumeAbortReason(signal));\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\treturn await Promise.race([request, aborted]);\n\t} finally {\n\t\tremoveAbortListener?.();\n\t\trequest.catch(() => {});\n\t}\n}\nfunction resumeAbortReason(signal) {\n\treturn signal.reason ?? resumeAbortFallbackReason();\n}\nfunction resumeAbortFallbackReason() {\n\tif (typeof DOMException === \"function\") return new DOMException(\"Resume discovery aborted\", \"AbortError\");\n\tconst error = /* @__PURE__ */ new Error(\"Resume discovery aborted\");\n\terror.name = \"AbortError\";\n\treturn error;\n}\nfunction resumeDiscoveryTimeoutReason(timeoutMs) {\n\tif (typeof DOMException === \"function\") return new DOMException(`Resume discovery timed out after ${timeoutMs} ms`, \"TimeoutError\");\n\tconst error = /* @__PURE__ */ new Error(`Resume discovery timed out after ${timeoutMs} ms`);\n\terror.name = \"TimeoutError\";\n\treturn error;\n}\nfunction serverSideEncryptionRejectReason(candidate, expected) {\n\tif (expected?.mode === EncryptionMode.SseC) return \"sse-c-unsupported\";\n\tconst actual = normalizeEncryption(candidate);\n\tif (expected === void 0) {\n\t\tif (candidate === void 0) return null;\n\t\tif (actual === void 0) return \"encryption-mismatch\";\n\t\tif (actual.mode === EncryptionMode.None) return null;\n\t\tif (actual.mode === EncryptionMode.SseB2) return null;\n\t\treturn actual.mode === EncryptionMode.SseC ? \"sse-c-unsupported\" : \"encryption-mismatch\";\n\t}\n\tconst normalizedExpected = normalizeEncryption(expected);\n\tif (normalizedExpected?.mode === EncryptionMode.None && candidate === void 0) return null;\n\tif (actual === void 0 || normalizedExpected === void 0) return \"encryption-mismatch\";\n\tif (actual.mode !== normalizedExpected.mode) return \"encryption-mismatch\";\n\tif (actual.mode === EncryptionMode.None) return null;\n\treturn actual.algorithm === normalizedExpected.algorithm ? null : \"encryption-mismatch\";\n}\nfunction normalizeEncryption(encryption) {\n\tif (encryption === void 0) return void 0;\n\tif (encryption.mode === null || encryption.mode === EncryptionMode.None) return { mode: EncryptionMode.None };\n\tif (encryption.mode !== EncryptionMode.SseB2 && encryption.mode !== EncryptionMode.SseC) return;\n\treturn {\n\t\tmode: encryption.mode,\n\t\talgorithm: encryption.algorithm\n\t};\n}\nfunction assertAdvancingPartCursor(fileId, previous, next) {\n\tif (!Number.isInteger(next) || next < 1 || previous !== void 0 && next <= previous) throw new Error(`uploadLargeFile: listParts returned a non-advancing nextPartNumber for ${fileId}; aborting resume.`);\n}\n//#endregion\nexport { RESUME_PART_SIZE_INFO_KEY, RESUME_SOURCE_SIZE_INFO_KEY, ResumeFileIdMismatchError, findResumeCandidate };\n\n//# sourceMappingURL=resume.js.map","import { B2Error, B2SsrfError, BadAuthTokenError, BadRequestError, BadUploadUrlError, NetworkError, UploadResponseBodyError } from \"../errors/index.js\";\nimport { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep } from \"../http/retry.js\";\n//#region src/upload/retry.ts\nvar freshUrlRetryOverride = { maxRetries: 0 };\n/**\n* Resolves the public default for `retryResponseBodyFailures`. Callers must\n* opt into replaying ambiguous upload POST failures for every upload mode.\n*\n* @param value - Caller-provided override, if any.\n*\n* @returns The boolean value passed to the upload retry helper.\n*/\nfunction resolveRetryResponseBodyFailures(value) {\n\treturn value ?? false;\n}\n/**\n* Fetches a small-file upload URL, bypassing the pool.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param bucketId - Bucket to upload into.\n* @param signal - Optional abort signal for the fresh URL request.\n*\n* @returns A fresh upload URL entry.\n*/\nasync function fetchFreshUploadUrl(raw, accountInfo, bucketId, signal) {\n\tconst resp = await raw.getUploadUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { bucketId }, {\n\t\t...signal !== void 0 ? { signal } : {},\n\t\tretry: freshUrlRetryOverride\n\t});\n\treturn {\n\t\tuploadUrl: resp.uploadUrl,\n\t\tauthorizationToken: resp.authorizationToken\n\t};\n}\n/**\n* Fetches a large-file part upload URL, bypassing the pool.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param fileId - Large file to upload a part into.\n* @param signal - Optional abort signal for the fresh URL request.\n*\n* @returns A fresh part upload URL entry.\n*/\nasync function fetchFreshPartUploadUrl(raw, accountInfo, fileId, signal) {\n\tconst resp = await raw.getUploadPartUrl(accountInfo.getApiUrl(), accountInfo.getAuthToken(), { fileId }, {\n\t\t...signal !== void 0 ? { signal } : {},\n\t\tretry: freshUrlRetryOverride\n\t});\n\treturn {\n\t\tuploadUrl: resp.uploadUrl,\n\t\tauthorizationToken: resp.authorizationToken\n\t};\n}\n/**\n* Uploads one multipart part with fresh-URL retry.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param fileId - Large file to upload a part into.\n* @param options - Part upload parameters and retry settings.\n*\n* @returns The uploaded part response.\n*/\nfunction uploadPartWithFreshUrl(raw, accountInfo, fileId, options) {\n\treturn withFreshUploadUrlRetry({\n\t\tfileName: options.fileName,\n\t\tpartNumber: options.partNumber,\n\t\tretry: options.retry,\n\t\tsignal: options.signal,\n\t\tonUploadRetry: options.onUploadRetry,\n\t\tretryResponseBodyFailures: options.retryResponseBodyFailures,\n\t\tcheckout: () => accountInfo.checkoutPartUploadUrl(fileId),\n\t\tfetchFresh: () => fetchFreshPartUploadUrl(raw, accountInfo, fileId, options.signal),\n\t\treturnEntry: (entry) => accountInfo.returnPartUploadUrl(fileId, entry),\n\t\tevictEntry: (entry) => accountInfo.evictPartUploadUrl(fileId, entry),\n\t\tupload: (entry) => raw.uploadPart(entry.uploadUrl, {\n\t\t\tauthorization: entry.authorizationToken,\n\t\t\tpartNumber: options.partNumber,\n\t\t\tcontentLength: options.contentLength,\n\t\t\tcontentSha1: options.contentSha1,\n\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n\t\t}, options.data, {\n\t\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t})\n\t});\n}\n/**\n* Runs an upload operation with B2's documented retry flow: evict the failed\n* upload URL, back off, fetch a fresh upload URL, and retry there.\n*\n* For single-request file uploads, sending the POST again after a lost success\n* response can create a duplicate file version. Multipart retries re-send the\n* same part number instead. Response-body retry defaults are caller-specific:\n* single-request uploads keep them off by default, while multipart callers can\n* opt in with `retryResponseBodyFailures: true` when replaying the same part\n* number is acceptable.\n*\n* @param options - URL checkout, upload, eviction, and retry callbacks.\n*\n* @returns The successful upload result.\n*/\nasync function withFreshUploadUrlRetry(options) {\n\tconst retryOptions = {\n\t\t...DEFAULT_RETRY_OPTIONS,\n\t\t...options.retry\n\t};\n\tfor (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {\n\t\tlet uploadEntry;\n\t\tlet uploadStarted = false;\n\t\ttry {\n\t\t\toptions.signal?.throwIfAborted();\n\t\t\tuploadEntry = attempt === 0 ? options.checkout() ?? await options.fetchFresh() : await options.fetchFresh();\n\t\t\tuploadStarted = true;\n\t\t\tconst result = await options.upload(uploadEntry);\n\t\t\toptions.returnEntry(uploadEntry);\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst retryError = normalizeUploadRetryError(err, options);\n\t\t\tif (uploadEntry !== void 0) if (isUploadRateLimitError(retryError)) options.returnEntry(uploadEntry);\n\t\t\telse options.evictEntry(uploadEntry);\n\t\t\tif (options.signal?.aborted) throw err;\n\t\t\tif (isUploadRateLimitError(retryError) && uploadEntry !== void 0) throw retryError;\n\t\t\tif (!isUploadRetryable(retryError, {\n\t\t\t\t...options,\n\t\t\t\tuploadStarted\n\t\t\t}) || attempt === retryOptions.maxRetries) throw retryError;\n\t\t\tconst retryAttempt = attempt + 1;\n\t\t\tconst retryAfter = retryError instanceof B2Error ? retryError.retryAfter : void 0;\n\t\t\tconst delayMs = computeBackoff(attempt, retryOptions, retryAfter);\n\t\t\tnotifyUploadRetry(options, {\n\t\t\t\tfileName: options.fileName,\n\t\t\t\tpartNumber: options.partNumber,\n\t\t\t\tattempt: retryAttempt,\n\t\t\t\tmaxRetries: retryOptions.maxRetries,\n\t\t\t\tdelayMs,\n\t\t\t\terror: retryError\n\t\t\t});\n\t\t\tawait sleep(delayMs, options.signal);\n\t\t}\n\t}\n\t/* v8 ignore next -- defensive return-path guard. */\n\tthrow new NetworkError(\"Upload retry budget exhausted\");\n}\nfunction notifyUploadRetry(options, event) {\n\ttry {\n\t\toptions.onUploadRetry?.(event);\n\t} catch {}\n}\nfunction isUploadRetryable(err, options) {\n\tif (err instanceof NetworkError) {\n\t\tif (err.cause instanceof B2SsrfError) return false;\n\t\tif (!options.uploadStarted) return true;\n\t\treturn options.retryResponseBodyFailures === true;\n\t}\n\tif (err instanceof BadAuthTokenError) return true;\n\tif (isUploadUrlInvalidationError(err)) return true;\n\treturn err instanceof B2Error && err.retryable;\n}\nfunction isUploadRateLimitError(err) {\n\treturn err instanceof B2Error && err.status === 429;\n}\nfunction normalizeUploadRetryError(err, options) {\n\tif (err instanceof B2Error || err instanceof NetworkError) return err;\n\tif (err instanceof UploadResponseBodyError) {\n\t\tif (!options.retryResponseBodyFailures) return err;\n\t\treturn new NetworkError(err.message, err);\n\t}\n\tif (err instanceof DOMException && err.name === \"AbortError\") return err;\n\tif (err instanceof TypeError || err instanceof SyntaxError || err instanceof DOMException) return new NetworkError(err instanceof Error ? err.message : \"Upload response read failed\", err);\n\treturn err;\n}\nfunction isUploadUrlInvalidationError(err) {\n\tif (err instanceof BadUploadUrlError) return true;\n\treturn err instanceof BadRequestError && /upload url/i.test(err.message);\n}\n//#endregion\nexport { fetchFreshPartUploadUrl, fetchFreshUploadUrl, resolveRetryResponseBodyFailures, uploadPartWithFreshUrl, withFreshUploadUrlRetry };\n\n//# sourceMappingURL=retry.js.map","import { createAbortScope, raceWithAbort, throwRejectedOrAbortReason } from \"./abort-scope.js\";\nimport { ResumeFileIdMismatchError } from \"../errors/index.js\";\nimport { cancelLargeFileBestEffort, cleanupAfterLargeFileError } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nimport { finishLargeFileWithAbortReconciliation } from \"./finish.js\";\nimport \"../util/defaults.js\";\nimport { planRanges } from \"../util/plan-ranges.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { IncrementalSha1 } from \"../streams/hash.js\";\nimport { readNextNonEmptyStreamChunk } from \"../streams/source.js\";\nimport { findResumeCandidate } from \"./resume.js\";\nimport { resolveRetryResponseBodyFailures, uploadPartWithFreshUrl } from \"./retry.js\";\n//#region src/upload/large.ts\nvar MAX_CONSECUTIVE_EMPTY_STREAM_CHUNKS = 1024;\nfunction createResumeCandidateCriteria(options, request, totalSize, partSize, parts) {\n\treturn {\n\t\tcontentType: request.contentType,\n\t\tfileInfo: request.fileInfo,\n\t\tsourceSize: totalSize,\n\t\tpartSize,\n\t\tparts,\n\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t...request.serverSideEncryption !== void 0 ? { serverSideEncryption: request.serverSideEncryption } : options.bucketDefaultServerSideEncryption !== void 0 ? { serverSideEncryption: options.bucketDefaultServerSideEncryption } : {},\n\t\t...request.fileRetention !== void 0 ? { fileRetention: request.fileRetention } : options.bucketDefaultRetention !== void 0 ? { defaultFileRetention: options.bucketDefaultRetention } : options.bucketDefaultRetentionUnreadable === true ? { defaultFileRetentionUnreadable: true } : {},\n\t\t...request.legalHold !== void 0 ? { legalHold: request.legalHold } : {},\n\t\t...options.resumeDiscoveryTimeoutMs !== void 0 ? { discoveryTimeoutMs: options.resumeDiscoveryTimeoutMs } : {},\n\t\t...options.onResumeCandidateRejected !== void 0 ? { onCandidateRejected: options.onResumeCandidateRejected } : {},\n\t\t...options.resumeMaxListPages !== void 0 ? { maxListPages: options.resumeMaxListPages } : {},\n\t\t...options.resumeMaxPartCandidates !== void 0 ? { maxPartCandidates: options.resumeMaxPartCandidates } : {},\n\t\t...options.resumeMaxPartPages !== void 0 ? { maxPartPages: options.resumeMaxPartPages } : {}\n\t};\n}\n/**\n* Uploads a file using the B2 multipart (large file) protocol.\n*\n* The source is sliced into parts and uploaded concurrently via\n* `b2_upload_part`. This is appropriate for files larger than the recommended\n* part size. For smaller files, use {@link uploadSmallFile} which sends the\n* entire payload in a single request.\n*\n* On failure, the in-progress large file is cancelled on a best-effort basis.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state (tokens, URLs, upload URL pool).\n* @param options - Upload parameters including part size and concurrency.\n*\n* @returns The resulting {@link FileVersion} metadata.\n*/\nasync function uploadLargeFile(raw, accountInfo, options) {\n\tconst recommendedPartSize = accountInfo.getRecommendedPartSize();\n\tconst minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n\tconst partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n\tconst concurrency = options.concurrency ?? 4;\n\tconst totalSize = options.source.size;\n\tconst parts = planRanges(totalSize, partSize);\n\tconst fileInfo = Object.create(null);\n\tif (options.fileInfo !== void 0) for (const [key, value] of Object.entries(options.fileInfo)) fileInfo[key] = value;\n\tconst startLargeFileRequest = {\n\t\tbucketId: options.bucketId,\n\t\tfileName: options.fileName,\n\t\tcontentType: options.contentType ?? \"b2/x-auto\",\n\t\tfileInfo,\n\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n\t\t...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n\t\t...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {}\n\t};\n\tconst resumeCandidateCriteria = createResumeCandidateCriteria(options, startLargeFileRequest, totalSize, partSize, parts);\n\tif (!options.source.canSlice && options.resumeFileId !== void 0) throw new Error(\"uploadLargeFile: resume is not supported on non-sliceable sources.\");\n\tlet largeFileId;\n\tlet preUploaded = /* @__PURE__ */ new Map();\n\tlet createdLargeFile = false;\n\tconst abortScope = createAbortScope(options.signal);\n\tconst startFreshLargeFile = async () => {\n\t\tif (abortScope.signal.aborted && !options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason);\n\t\tabortScope.signal.throwIfAborted();\n\t\tconst startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), startLargeFileRequest, {\n\t\t\tsignal: abortScope.signal,\n\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t});\n\t\ttry {\n\t\t\tlargeFileId = (await raceWithAbort(startPromise, abortScope.signal)).fileId;\n\t\t} catch (err) {\n\t\t\tif (abortScope.signal.aborted) {\n\t\t\t\tif (!options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason).catch(() => {});\n\t\t\t\tcancelLargeFileAfterStart(startPromise, raw, accountInfo, options.onCleanupFailure);\n\t\t\t}\n\t\t\tthrow err;\n\t\t}\n\t\tpreUploaded = /* @__PURE__ */ new Map();\n\t\tcreatedLargeFile = true;\n\t};\n\ttry {\n\t\tif (abortScope.signal.aborted && !options.source.canSlice) await cancelForwardOnlySource(options.source, abortScope.signal.reason);\n\t\tabortScope.signal.throwIfAborted();\n\t\tif (options.resumeFileId !== void 0) {\n\t\t\tconst candidate = await findResumeCandidate(raw, accountInfo, options.bucketId, options.fileName, {\n\t\t\t\t...resumeCandidateCriteria,\n\t\t\t\tresumeFileId: options.resumeFileId\n\t\t\t});\n\t\t\tif (candidate === null) throw new ResumeFileIdMismatchError(options.resumeFileId, options.fileName);\n\t\t\tlargeFileId = candidate.fileId;\n\t\t\tpreUploaded = candidate.uploadedPartSha1s;\n\t\t} else if (options.resume === true && options.source.canSlice) {\n\t\t\tconst candidate = await findResumeCandidate(raw, accountInfo, options.bucketId, options.fileName, resumeCandidateCriteria);\n\t\t\tif (candidate) {\n\t\t\t\tlargeFileId = candidate.fileId;\n\t\t\t\tpreUploaded = /* @__PURE__ */ new Map();\n\t\t\t} else await startFreshLargeFile();\n\t\t} else await startFreshLargeFile();\n\t\tconst activeLargeFileId = largeFileId;\n\t\tif (activeLargeFileId === void 0) throw new Error(\"uploadLargeFile: start did not return a large file ID.\");\n\t\tconst partSha1s = new Array(parts.length);\n\t\tconst tracker = new ProgressTracker(options.onProgress, totalSize, parts.length);\n\t\tconst sem = new Semaphore(concurrency);\n\t\tif (!options.source.canSlice) {\n\t\t\tawait uploadPartsSequentially(raw, accountInfo, options, activeLargeFileId, parts, partSha1s, tracker, abortScope.signal);\n\t\t\treturn await finishLargeFileWithAbortReconciliation(raw, accountInfo, {\n\t\t\t\tfileId: activeLargeFileId,\n\t\t\t\tbucketId: options.bucketId,\n\t\t\t\tfileName: options.fileName,\n\t\t\t\tpartSha1s,\n\t\t\t\tsignal: abortScope.signal,\n\t\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t\t});\n\t\t}\n\t\tconst tasks = parts.map(async (part) => {\n\t\t\tawait sem.acquire();\n\t\t\ttry {\n\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\tconst partSource = options.source.slice(part.offset, part.offset + part.length);\n\t\t\t\tconst data = new Uint8Array(await partSource.toArrayBuffer({ signal: abortScope.signal }));\n\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\tconst partSha1 = new IncrementalSha1();\n\t\t\t\tawait partSha1.update(data);\n\t\t\t\tconst sha1Hex = await partSha1.digest();\n\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\tconst serverSha1 = preUploaded.get(part.partNumber);\n\t\t\t\tif (serverSha1 !== void 0 && serverSha1 === sha1Hex) {\n\t\t\t\t\tnotifyResumePartReused(options.onResumePartReused, {\n\t\t\t\t\t\tfileName: options.fileName,\n\t\t\t\t\t\tfileId: activeLargeFileId,\n\t\t\t\t\t\tpartNumber: part.partNumber,\n\t\t\t\t\t\tcontentLength: data.byteLength,\n\t\t\t\t\t\tcontentSha1: serverSha1\n\t\t\t\t\t});\n\t\t\t\t\tpartSha1s[part.partNumber - 1] = serverSha1;\n\t\t\t\t\ttracker.addBytes(data.byteLength);\n\t\t\t\t\ttracker.completePart();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst result = await uploadPartWithFreshUrl(raw, accountInfo, activeLargeFileId, {\n\t\t\t\t\tfileName: options.fileName,\n\t\t\t\t\tpartNumber: part.partNumber,\n\t\t\t\t\tdata,\n\t\t\t\t\tcontentLength: data.byteLength,\n\t\t\t\t\tcontentSha1: sha1Hex,\n\t\t\t\t\tretry: options.retry,\n\t\t\t\t\tsignal: abortScope.signal,\n\t\t\t\t\tonUploadRetry: options.onUploadRetry,\n\t\t\t\t\tretryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),\n\t\t\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n\t\t\t\t});\n\t\t\t\tpartSha1s[part.partNumber - 1] = result.contentSha1;\n\t\t\t\ttracker.addBytes(data.byteLength);\n\t\t\t\ttracker.completePart();\n\t\t\t} catch (err) {\n\t\t\t\tabortScope.abort(err);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsem.release();\n\t\t\t}\n\t\t});\n\t\tthrowRejectedOrAbortReason(await Promise.allSettled(tasks), abortScope);\n\t\treturn await finishLargeFileWithAbortReconciliation(raw, accountInfo, {\n\t\t\tfileId: activeLargeFileId,\n\t\t\tbucketId: options.bucketId,\n\t\t\tfileName: options.fileName,\n\t\t\tpartSha1s,\n\t\t\tsignal: abortScope.signal,\n\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t});\n\t} catch (err) {\n\t\tabortScope.abort(err);\n\t\tif (largeFileId === void 0) throw err;\n\t\treturn await cleanupAfterUploadLargeFileError(err, raw, accountInfo, options, largeFileId, createdLargeFile);\n\t} finally {\n\t\tabortScope.dispose();\n\t}\n}\nfunction cancelLargeFileAfterStart(started, raw, accountInfo, onCleanupFailure) {\n\tstarted.then((resp) => cancelLargeFileBestEffort(raw, accountInfo, resp.fileId, onCleanupFailure === void 0 ? void 0 : { onCleanupFailure })).catch(() => {});\n}\nasync function cleanupAfterUploadLargeFileError(err, raw, accountInfo, options, largeFileId, createdLargeFile) {\n\treturn await cleanupAfterLargeFileError(err, raw, accountInfo, {\n\t\tfileId: largeFileId,\n\t\tbucketId: options.bucketId,\n\t\tfileName: options.fileName,\n\t\tsignal: options.signal,\n\t\tonCleanupFailure: options.onCleanupFailure\n\t}, { cancelOnError: createdLargeFile });\n}\n/**\n* Sequential upload path for non-sliceable sources.\n*\n* Reads the source's `stream()` once and accumulates exactly `partSize`\n* bytes into an in-memory buffer per iteration. Each filled buffer is\n* hashed, dispatched to `b2_upload_part`, then released before the next\n* part starts — so peak memory is ~partSize regardless of file size.\n*\n* Concurrency is forced to 1 here because the stream is a single\n* forward-only cursor; the engine can't read part N+1 until part N is\n* fully consumed.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - The original `uploadLargeFile` options.\n* @param largeFileId - ID of the in-progress large file (already started).\n* @param parts - Pre-planned part layout (used for part numbers + count).\n* @param partSha1s - Output array, written in-place at index `partNumber - 1`.\n* @param tracker - Progress tracker; bytes added per chunk, part completed\n* each time a part finishes.\n* @param signal - Linked abort signal for source reads and part uploads.\n*/\nasync function uploadPartsSequentially(raw, accountInfo, options, largeFileId, parts, partSha1s, tracker, signal) {\n\tconst reader = options.source.stream().getReader();\n\tlet bytesRead = 0;\n\tlet carry = null;\n\ttry {\n\t\tfor (const planned of parts) {\n\t\t\tsignal.throwIfAborted();\n\t\t\tconst buf = new Uint8Array(planned.length);\n\t\t\tlet filled = 0;\n\t\t\tif (carry !== null) {\n\t\t\t\tconst take = Math.min(carry.byteLength, buf.byteLength - filled);\n\t\t\t\tbuf.set(carry.subarray(0, take), filled);\n\t\t\t\tfilled += take;\n\t\t\t\tcarry = take < carry.byteLength ? carry.subarray(take) : null;\n\t\t\t}\n\t\t\twhile (filled < buf.byteLength) {\n\t\t\t\tconst { done, value } = await readNextNonEmptyStreamChunk(reader, emptyChunkError(), signal);\n\t\t\t\tif (done) throw new Error(`uploadLargeFile: source stream ended after ${bytesRead} bytes, expected ${options.source.size}.`);\n\t\t\t\tbytesRead += value.byteLength;\n\t\t\t\tconst take = Math.min(value.byteLength, buf.byteLength - filled);\n\t\t\t\tbuf.set(value.subarray(0, take), filled);\n\t\t\t\tfilled += take;\n\t\t\t\tif (take < value.byteLength) carry = value.subarray(take);\n\t\t\t}\n\t\t\tsignal.throwIfAborted();\n\t\t\tconst data = buf;\n\t\t\tconst partSha1 = new IncrementalSha1();\n\t\t\tawait partSha1.update(data);\n\t\t\tconst sha1Hex = await partSha1.digest();\n\t\t\tsignal.throwIfAborted();\n\t\t\tconst result = await uploadPartWithFreshUrl(raw, accountInfo, largeFileId, {\n\t\t\t\tfileName: options.fileName,\n\t\t\t\tpartNumber: planned.partNumber,\n\t\t\t\tdata,\n\t\t\t\tcontentLength: data.byteLength,\n\t\t\t\tcontentSha1: sha1Hex,\n\t\t\t\tretry: options.retry,\n\t\t\t\tsignal,\n\t\t\t\tonUploadRetry: options.onUploadRetry,\n\t\t\t\tretryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),\n\t\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n\t\t\t});\n\t\t\tpartSha1s[planned.partNumber - 1] = result.contentSha1;\n\t\t\ttracker.addBytes(data.byteLength);\n\t\t\ttracker.completePart();\n\t\t}\n\t\tif (carry !== null && carry.byteLength > 0) throw new Error(tooManyBytesError(options.source.size));\n\t\tconst extra = await readNextNonEmptyStreamChunk(reader, emptyChunkError(), signal);\n\t\tif (!extra.done) {\n\t\t\tbytesRead += extra.value.byteLength;\n\t\t\tthrow new Error(tooManyBytesError(options.source.size));\n\t\t}\n\t} catch (err) {\n\t\tawait reader.cancel(err).catch(() => {});\n\t\tthrow err;\n\t} finally {\n\t\treader.releaseLock();\n\t}\n}\nfunction emptyChunkError() {\n\treturn `uploadLargeFile: source stream emitted more than ${MAX_CONSECUTIVE_EMPTY_STREAM_CHUNKS} consecutive empty chunks. too many empty chunks.`;\n}\nfunction tooManyBytesError(advertisedSize) {\n\treturn `uploadLargeFile: source stream emitted more than advertised ${advertisedSize} bytes. source stream emitted more bytes than advertised size.`;\n}\nasync function cancelForwardOnlySource(source, reason) {\n\tconst reader = source.stream().getReader();\n\ttry {\n\t\tawait reader.cancel(reason);\n\t} finally {\n\t\treader.releaseLock();\n\t}\n}\nfunction notifyResumePartReused(listener, event) {\n\ttry {\n\t\tlistener?.(event);\n\t} catch {}\n}\n//#endregion\nexport { uploadLargeFile };\n\n//# sourceMappingURL=large.js.map","//#region src/upload/options.ts\n/**\n* Explicit resume targets are multipart-only and must fail closed on small uploads.\n*\n* @param options - High-level upload options.\n* @param caller - Public method name used in the thrown error.\n*\n* @throws Error when an explicit resume target is supplied for a small upload.\n*/\nfunction rejectSmallResumeFileId(options, caller) {\n\tif (options.resumeFileId !== void 0) throw new Error(`${caller}: resumeFileId is only supported for multipart uploads.`);\n}\n/**\n* Removes resume-only options before forwarding to the small-file upload path.\n*\n* @param options - High-level upload options.\n*\n* @returns Options accepted by the single-request upload implementation.\n*/\nfunction stripResumeOnlyOptions(options) {\n\tconst { resume: _resume, resumeFileId: _resumeFileId, onResumeCandidateRejected: _onResumeCandidateRejected, onResumePartReused: _onResumePartReused, resumeDiscoveryTimeoutMs: _resumeDiscoveryTimeoutMs, resumeMaxListPages: _resumeMaxListPages, resumeMaxPartCandidates: _resumeMaxPartCandidates, resumeMaxPartPages: _resumeMaxPartPages, ...smallOptions } = options;\n\treturn smallOptions;\n}\n//#endregion\nexport { rejectSmallResumeFileId, stripResumeOnlyOptions };\n\n//# sourceMappingURL=options.js.map","import \"../util/defaults.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { IncrementalSha1 } from \"../streams/hash.js\";\nimport { collectStreamExactly } from \"../streams/source.js\";\nimport { fetchFreshUploadUrl, resolveRetryResponseBodyFailures, withFreshUploadUrlRetry } from \"./retry.js\";\n//#region src/upload/single.ts\n/**\n* Uploads a file in a single HTTP request (suitable for files up to ~100 MB).\n*\n* The entire file content is read into memory, SHA-1 hashed, and sent in one\n* `b2_upload_file` call. For files larger than the recommended part size, use\n* {@link uploadLargeFile} which splits the file into parts uploaded in parallel.\n*\n* Upload URLs are pooled via {@link AccountInfo} and recycled on success or\n* evicted on failure.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state (tokens, URLs, upload URL pool).\n* @param options - Upload parameters.\n*\n* @returns The resulting {@link FileVersion} metadata.\n*/\nasync function uploadSmallFile(raw, accountInfo, options) {\n\tconst data = await readSmallFileSource(options.source, options.signal);\n\tif (data.byteLength !== options.source.size) throw new Error(`uploadSmallFile: source byte count does not match advertised size (expected ${options.source.size} bytes, got ${data.byteLength} bytes).`);\n\tconst sha1 = new IncrementalSha1();\n\tawait sha1.update(data);\n\tconst sha1Hex = await sha1.digest();\n\tconst tracker = new ProgressTracker(options.onProgress, data.byteLength, 1);\n\tconst result = await withFreshUploadUrlRetry({\n\t\tfileName: options.fileName,\n\t\tpartNumber: null,\n\t\tretry: options.retry,\n\t\tsignal: options.signal,\n\t\tonUploadRetry: options.onUploadRetry,\n\t\tretryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),\n\t\tcheckout: () => accountInfo.checkoutUploadUrl(options.bucketId),\n\t\tfetchFresh: () => fetchFreshUploadUrl(raw, accountInfo, options.bucketId, options.signal),\n\t\treturnEntry: (entry) => accountInfo.returnUploadUrl(options.bucketId, entry),\n\t\tevictEntry: (entry) => accountInfo.evictUploadUrl(options.bucketId, entry),\n\t\tupload: (entry) => raw.uploadFile(entry.uploadUrl, {\n\t\t\tauthorization: entry.authorizationToken,\n\t\t\tfileName: options.fileName,\n\t\t\tcontentType: options.contentType ?? \"b2/x-auto\",\n\t\t\tcontentLength: data.byteLength,\n\t\t\tcontentSha1: sha1Hex,\n\t\t\t...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {},\n\t\t\t...options.fileRetention !== void 0 ? { fileRetention: options.fileRetention } : {},\n\t\t\t...options.legalHold !== void 0 ? { legalHold: options.legalHold } : {},\n\t\t\t...options.lastModifiedMillis !== void 0 ? { lastModifiedMillis: options.lastModifiedMillis } : {}\n\t\t}, data, {\n\t\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t})\n\t});\n\ttracker.addBytes(data.byteLength);\n\ttracker.completePart();\n\treturn result;\n}\nasync function readSmallFileSource(source, signal) {\n\tsignal?.throwIfAborted();\n\tif (!source.canSlice) return collectStreamExactly(source.stream(), source.size, signal);\n\tconst data = new Uint8Array(await (signal === void 0 ? source.toArrayBuffer() : source.toArrayBuffer({ signal })));\n\tsignal?.throwIfAborted();\n\treturn data;\n}\n//#endregion\nexport { uploadSmallFile };\n\n//# sourceMappingURL=single.js.map","//#region src/util/to-error.ts\n/**\n* Coerce an unknown caught value to a real error instance.\n*\n* Existing error objects pass through unchanged so call sites preserve\n* the original stack and any subclass identity. Other values are\n* wrapped in a fresh Error whose message is `String(value)`. Centralises\n* the conditional that previously recurred at every async-boundary\n* catch site in the upload, copy, sync, and stream paths.\n*\n* @param value - Value caught from a `try`/`catch` or rejected promise.\n*\n* @returns An `Error` representing `value`.\n*/\nfunction toError(value) {\n\treturn value instanceof Error ? value : new Error(String(value));\n}\n//#endregion\nexport { toError };\n\n//# sourceMappingURL=to-error.js.map","//#region src/streams/collect.ts\n/**\n* Drain a `ReadableStream` into a single contiguous\n* `Uint8Array`. Releases the reader lock on both the happy and error\n* paths so the underlying stream can propagate close / error events to\n* the upstream producer.\n*\n* Used by both `createParallelDownloadStream` (per-range fetch) and\n* `StreamSource.toArrayBuffer` (whole-source materialisation). The two\n* code paths previously hand-rolled the same accumulate-then-concat\n* loop; consolidating here removes ~25 duplicated lines and a class of\n* lock-leak bugs.\n*\n* @param stream - Readable stream to consume. Will be fully drained.\n* @param options - Optional abort signal used to stop a pending read.\n*\n* @returns A new `Uint8Array` containing every byte the stream produced.\n*/\nasync function collectStream(stream, options = {}) {\n\tconst reader = stream.getReader();\n\ttry {\n\t\tconst chunks = [];\n\t\tlet total = 0;\n\t\twhile (true) {\n\t\t\tconst { done, value } = await readStreamChunkWithSignal(reader, options.signal);\n\t\t\tif (done) break;\n\t\t\tchunks.push(value);\n\t\t\ttotal += value.byteLength;\n\t\t}\n\t\tconst result = new Uint8Array(total);\n\t\tlet offset = 0;\n\t\tfor (const chunk of chunks) {\n\t\t\tresult.set(chunk, offset);\n\t\t\toffset += chunk.byteLength;\n\t\t}\n\t\treturn result;\n\t} finally {\n\t\treader.releaseLock();\n\t}\n}\n/**\n* Reads one chunk and rejects when the supplied signal aborts.\n* @param reader - Stream reader to read from.\n* @param signal - Optional abort signal that cancels the read.\n*\n* @returns The next stream read result.\n*\n* @internal\n*/\nasync function readStreamChunkWithSignal(reader, signal) {\n\tif (signal === void 0) return reader.read();\n\tsignal.throwIfAborted();\n\tlet removeAbortListener;\n\tconst abortPromise = new Promise((_, reject) => {\n\t\tconst onAbort = () => {\n\t\t\tconst reason = abortReason(signal);\n\t\t\treject(reason);\n\t\t\treader.cancel(reason).catch(() => {});\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\treturn await Promise.race([reader.read(), abortPromise]);\n\t} finally {\n\t\tremoveAbortListener?.();\n\t}\n}\nfunction abortReason(signal) {\n\treturn signal.reason ?? new DOMException(\"The operation was aborted.\", \"AbortError\");\n}\n//#endregion\nexport { collectStream, readStreamChunkWithSignal };\n\n//# sourceMappingURL=collect.js.map","import { B2Error, NetworkError, classifyError } from \"../errors/index.js\";\nimport { byteRangeHeader, planRanges } from \"../util/plan-ranges.js\";\nimport { utf8Decoder } from \"../util/text-codec.js\";\nimport { normalizeSha1 } from \"../util/normalize.js\";\nimport { IncrementalSha1 } from \"../streams/hash.js\";\nimport { normalizeVerifiableSha1 } from \"../util/sha1.js\";\nimport { assertDownloadSha1, assertDownloadSha1HeaderAgreement } from \"./checksum.js\";\nimport { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep } from \"../http/retry.js\";\nimport { collectStream } from \"../streams/collect.js\";\n//#region src/download/parallel.ts\n/**\n* Creates a readable stream that downloads a file using parallel byte-range requests.\n*\n* The file is split into fixed-size ranges fetched in a **sliding\n* window** keyed off the consumer's read pace. The window size is\n* `concurrency * 2`: up to `concurrency` ranges are in flight at once,\n* plus up to `concurrency` completed-but-not-yet-emitted ranges buffered\n* ahead of the read head. New fetches kick off only when the consumer\n* reads a chunk, so a slow downstream pipe (e.g. a saturated network\n* sink or a `pipeTo` consumer that drains slowly) backpressures into\n* the SDK and bounds peak memory to `(concurrency * 2) * rangeSize`.\n*\n* The previous eager implementation scheduled every range into\n* `Promise.all` up front; a slow head-of-line range could hold the\n* entire file in memory while later ranges finished and waited.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param options - Parallel download parameters (file ID, size, concurrency).\n*\n* @returns A `ReadableStream` that yields file bytes in order.\n*/\nfunction createParallelDownloadStream(raw, accountInfo, options) {\n\tconst rangeSize = options.rangeSize ?? 10 * 1024 * 1024;\n\tconst concurrency = options.concurrency ?? 4;\n\tconst totalSize = options.totalSize;\n\tconst retryOptions = {\n\t\t...DEFAULT_RETRY_OPTIONS,\n\t\tmaxRetries: options.maxRetries ?? 0\n\t};\n\tconst abort = options.signal;\n\tconst ranges = planRanges(totalSize, rangeSize);\n\tconst windowSize = concurrency * 2;\n\tconst inflight = /* @__PURE__ */ new Map();\n\tconst buffer = /* @__PURE__ */ new Map();\n\tlet assembledSha1 = null;\n\tlet nextToSchedule = 0;\n\tlet nextToEmit = 0;\n\tlet expectedSha1;\n\tlet firstError = null;\n\tfunction scheduleNext() {\n\t\twhile (firstError === null && abort?.aborted !== true && nextToSchedule < ranges.length && inflight.size + buffer.size < windowSize) {\n\t\t\tconst range = ranges[nextToSchedule];\n\t\t\tif (range === void 0) break;\n\t\t\tconst idx = nextToSchedule;\n\t\t\tnextToSchedule++;\n\t\t\tconst task = (async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await fetchRangeWithRetry(raw, accountInfo, options.fileId, range.start, range.end, totalSize, retryOptions, abort);\n\t\t\t\t\tbuffer.set(idx, result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (firstError === null) firstError = err;\n\t\t\t\t} finally {\n\t\t\t\t\tinflight.delete(idx);\n\t\t\t\t}\n\t\t\t})();\n\t\t\tinflight.set(idx, task);\n\t\t}\n\t}\n\treturn new ReadableStream({\n\t\tstart(controller) {\n\t\t\ttry {\n\t\t\t\tabort?.throwIfAborted();\n\t\t\t\tscheduleNext();\n\t\t\t} catch (err) {\n\t\t\t\tcontroller.error(err);\n\t\t\t}\n\t\t},\n\t\tasync pull(controller) {\n\t\t\ttry {\n\t\t\t\twhile (!buffer.has(nextToEmit)) {\n\t\t\t\t\tabort?.throwIfAborted();\n\t\t\t\t\tif (firstError !== null) throw firstError;\n\t\t\t\t\tif (inflight.size === 0) {\n\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tawait Promise.race(inflight.values());\n\t\t\t\t}\n\t\t\t\tconst result = buffer.get(nextToEmit);\n\t\t\t\tif (result !== void 0) {\n\t\t\t\t\tbuffer.delete(nextToEmit);\n\t\t\t\t\tnextToEmit++;\n\t\t\t\t\tconst rangeSha1 = normalizeVerifiableSha1(result.contentSha1);\n\t\t\t\t\tif (expectedSha1 === void 0) expectedSha1 = rangeSha1;\n\t\t\t\t\telse assertDownloadSha1HeaderAgreement(expectedSha1, rangeSha1);\n\t\t\t\t\tif (expectedSha1 !== null) {\n\t\t\t\t\t\tassembledSha1 ??= new IncrementalSha1();\n\t\t\t\t\t\tawait assembledSha1.update(result.data);\n\t\t\t\t\t}\n\t\t\t\t\tcontroller.enqueue(result.data);\n\t\t\t\t}\n\t\t\t\tscheduleNext();\n\t\t\t\tif (nextToEmit >= ranges.length && buffer.size === 0 && inflight.size === 0 && firstError === null) {\n\t\t\t\t\tif (expectedSha1 !== void 0 && expectedSha1 !== null && assembledSha1 !== null) assertDownloadSha1(expectedSha1, await assembledSha1.digest());\n\t\t\t\t\tcontroller.close();\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tcontroller.error(err);\n\t\t\t}\n\t\t},\n\t\tcancel() {\n\t\t\tbuffer.clear();\n\t\t}\n\t});\n}\n/**\n* Fetches a single byte range with bounded retry on transient failures.\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state.\n* @param fileId - ID of the file being downloaded.\n* @param start - Inclusive byte offset where the range begins.\n* @param end - Inclusive byte offset where the range ends.\n* @param totalSize - Expected complete file size.\n* @param retryOptions - Retry settings controlling attempts and backoff.\n* @param signal - Optional abort signal that cancels the range and any pending retry.\n*\n* @returns The range's bytes, or throws after exhausting all retry attempts.\n*/\nasync function fetchRangeWithRetry(raw, accountInfo, fileId, start, end, totalSize, retryOptions, signal) {\n\tlet lastError;\n\tfor (let attempt = 0; attempt <= retryOptions.maxRetries; attempt++) {\n\t\tif (attempt > 0) {\n\t\t\tconst retryAfter = lastError instanceof B2Error && lastError.retryAfter !== void 0 ? lastError.retryAfter : void 0;\n\t\t\tawait sleep(computeBackoff(attempt - 1, retryOptions, retryAfter), signal);\n\t\t}\n\t\ttry {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tconst resp = await raw.downloadFileById(accountInfo.getDownloadUrl(), accountInfo.getAuthToken(), fileId, {\n\t\t\t\trange: byteRangeHeader(start, end),\n\t\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t\t});\n\t\t\tif (resp.status < 200 || resp.status >= 300) throw await classifyDownloadResponseError(resp);\n\t\t\tif (!resp.body) throw new Error(\"Download chunk has no body\");\n\t\t\tconst data = await collectStream(resp.body);\n\t\t\tvalidateRangeResponse(resp, start, end, totalSize, data.byteLength);\n\t\t\treturn {\n\t\t\t\tdata,\n\t\t\t\tcontentSha1: normalizeSha1(resp.headers.get(\"X-Bz-Content-Sha1\"))\n\t\t\t};\n\t\t} catch (err) {\n\t\t\tlastError = err;\n\t\t\tif (signal?.aborted) throw err;\n\t\t\tif (err instanceof DOMException && err.name === \"AbortError\") throw err;\n\t\t\tif (!isRetryableRangeError(err) || attempt === retryOptions.maxRetries) throw err;\n\t\t}\n\t}\n\tthrow lastError instanceof Error ? lastError : /* @__PURE__ */ new Error(\"Range download failed after retries\");\n}\nvar RangeValidationError = class extends Error {\n\tretryable = false;\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"RangeValidationError\";\n\t}\n};\nfunction validateRangeResponse(response, start, end, totalSize, byteLength) {\n\tconst expectedLength = end - start + 1;\n\tif (response.status !== 206) throw new RangeValidationError(`Expected HTTP 206 Partial Content for range ${start}-${end}, got ${response.status}`);\n\tconst contentRange = response.headers.get(\"Content-Range\");\n\tif (contentRange === null) throw new RangeValidationError(`Missing Content-Range for range ${start}-${end}`);\n\tconst match = contentRange.match(/^bytes (\\d+)-(\\d+)\\/(\\d+|\\*)$/);\n\tif (match === null) throw new RangeValidationError(`Invalid Content-Range for range ${start}-${end}: ${contentRange}`);\n\tconst actualStart = Number.parseInt(match[1] ?? \"\", 10);\n\tconst actualEnd = Number.parseInt(match[2] ?? \"\", 10);\n\tconst actualTotal = match[3] ?? \"\";\n\tif (actualStart !== start || actualEnd !== end) throw new RangeValidationError(`Content-Range ${contentRange} does not match requested range ${start}-${end}`);\n\tif (actualTotal === \"*\") throw new RangeValidationError(`Content-Range ${contentRange} does not include total size`);\n\tif (Number.parseInt(actualTotal, 10) !== totalSize) throw new RangeValidationError(`Content-Range ${contentRange} does not match expected total size ${totalSize}`);\n\tif (byteLength !== expectedLength) throw new RangeValidationError(`Expected ${expectedLength} bytes for range ${start}-${end}, got ${byteLength}`);\n}\nasync function classifyDownloadResponseError(response) {\n\tlet errorBody = {\n\t\tstatus: response.status,\n\t\tcode: \"internal_error\",\n\t\tmessage: `HTTP ${response.status}`\n\t};\n\tif (response.body !== null) {\n\t\tconst bytes = await collectStream(response.body);\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(utf8Decoder.decode(bytes));\n\t\t\terrorBody = {\n\t\t\t\tstatus: response.status,\n\t\t\t\tcode: parsed.code ?? \"internal_error\",\n\t\t\t\tmessage: parsed.message ?? `HTTP ${response.status}`\n\t\t\t};\n\t\t} catch {}\n\t}\n\tconst retryAfterHeader = response.headers.get(\"Retry-After\");\n\tconst retryAfter = retryAfterHeader !== null ? Number.parseInt(retryAfterHeader, 10) : void 0;\n\tconst requestId = response.headers.get(\"X-Bz-Request-Id\") ?? void 0;\n\treturn classifyError(errorBody, {\n\t\t...retryAfter !== void 0 ? { retryAfter } : {},\n\t\t...requestId !== void 0 ? { requestId } : {}\n\t});\n}\nfunction isRetryableRangeError(err) {\n\tif (err instanceof B2Error || err instanceof NetworkError) return err.retryable;\n\tif (hasRetryableFlag(err)) return err.retryable;\n\treturn err instanceof TypeError;\n}\nfunction hasRetryableFlag(err) {\n\treturn typeof err === \"object\" && err !== null && \"retryable\" in err && typeof err.retryable === \"boolean\";\n}\n//#endregion\nexport { createParallelDownloadStream };\n\n//# sourceMappingURL=parallel.js.map","import { abortReason, createAbortScope, raceWithAbort } from \"./abort-scope.js\";\nimport { DEFAULT_CLEANUP_TIMEOUT_MS, cancelLargeFileBestEffort, resolveLargeFileErrorAfterCleanup } from \"./cancel.js\";\nimport { Semaphore } from \"./concurrency.js\";\nimport { finishLargeFileWithAbortReconciliation } from \"./finish.js\";\nimport \"../util/defaults.js\";\nimport { ProgressTracker } from \"../streams/progress.js\";\nimport { IncrementalSha1 } from \"../streams/hash.js\";\nimport { resolveRetryResponseBodyFailures, uploadPartWithFreshUrl } from \"./retry.js\";\nimport { toError } from \"../util/to-error.js\";\n//#region src/upload/stream.ts\n/**\n* Creates a {@link WritableStream} that streams data into a B2 multipart upload.\n*\n* Buffers incoming chunks until `partSize` bytes are accumulated, ships each\n* complete part through the standard multipart engine, and finalizes the file\n* once the stream is closed. Honours backpressure via the queue's bounded\n* concurrency. Streaming uploads do not support resume because the total size\n* and per-part hashes aren't known in advance; use {@link uploadLargeFile} with\n* a buffered source when resume is required.\n*\n* @param raw - Low-level B2 API client.\n* @param accountInfo - Authorized account state (tokens, URLs, part URL pool).\n* @param options - Streaming upload parameters.\n*\n* @returns A {@link UploadWriteHandle} with the writable sink and a completion promise.\n*/\nfunction createWriteStream(raw, accountInfo, options) {\n\tconst minPartSize = accountInfo.getAbsoluteMinimumPartSize();\n\tconst recommendedPartSize = accountInfo.getRecommendedPartSize();\n\tconst partSize = Math.max(options.partSize ?? recommendedPartSize, minPartSize);\n\tconst concurrency = options.concurrency ?? 4;\n\tconst tracker = new ProgressTracker(options.onProgress, null, null);\n\tconst sem = new Semaphore(concurrency);\n\tconst abortScope = createAbortScope(options.signal);\n\tlet largeFileId = null;\n\tlet startPromise = null;\n\tlet cancelAfterStartScheduled = false;\n\tlet nextPartNumber = 1;\n\tlet pendingBytes = 0;\n\tconst pending = [];\n\tconst partSha1s = [];\n\tconst inflight = [];\n\tlet errored = null;\n\tconst { promise: done, resolve: resolveDone, reject: rejectDone } = Promise.withResolvers();\n\tdone.catch(() => {});\n\tfunction ensureStarted() {\n\t\tif (largeFileId !== null) return Promise.resolve(largeFileId);\n\t\tif (startPromise === null) startPromise = raw.startLargeFile(accountInfo.getApiUrl(), accountInfo.getAuthToken(), {\n\t\t\tbucketId: options.bucketId,\n\t\t\tfileName: options.fileName,\n\t\t\tcontentType: options.contentType ?? \"b2/x-auto\",\n\t\t\tfileInfo: options.fileInfo ?? {},\n\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n\t\t}, {\n\t\t\tsignal: abortScope.signal,\n\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t}).then((resp) => {\n\t\t\tlargeFileId = resp.fileId;\n\t\t\tif (abortScope.signal.aborted || errored !== null) cancelStartedLargeFile(largeFileId);\n\t\t\treturn largeFileId;\n\t\t});\n\t\tconst started = startPromise;\n\t\treturn raceWithAbort(started, abortScope.signal).catch((err) => {\n\t\t\tif (abortScope.signal.aborted) scheduleCancelLargeFileAfterStart(started);\n\t\t\tthrow err;\n\t\t});\n\t}\n\tasync function shipPart(data, partNumber) {\n\t\tif (errored !== null) throw errored;\n\t\tabortScope.signal.throwIfAborted();\n\t\tconst fileId = await ensureStarted();\n\t\tif (errored !== null) throw errored;\n\t\tabortScope.signal.throwIfAborted();\n\t\tconst sha1 = new IncrementalSha1();\n\t\tawait sha1.update(data);\n\t\tconst sha1Hex = await sha1.digest();\n\t\tabortScope.signal.throwIfAborted();\n\t\tconst result = await uploadPartWithFreshUrl(raw, accountInfo, fileId, {\n\t\t\tfileName: options.fileName,\n\t\t\tpartNumber,\n\t\t\tdata,\n\t\t\tcontentLength: data.byteLength,\n\t\t\tcontentSha1: sha1Hex,\n\t\t\tretry: options.retry,\n\t\t\tsignal: abortScope.signal,\n\t\t\tonUploadRetry: options.onUploadRetry,\n\t\t\tretryResponseBodyFailures: resolveRetryResponseBodyFailures(options.retryResponseBodyFailures),\n\t\t\t...options.serverSideEncryption !== void 0 ? { serverSideEncryption: options.serverSideEncryption } : {}\n\t\t});\n\t\tpartSha1s[partNumber - 1] = result.contentSha1;\n\t\ttracker.addBytes(data.byteLength);\n\t\ttracker.completePart();\n\t}\n\tfunction markErrored(err) {\n\t\tconst error = toError(err);\n\t\terrored = error;\n\t\tabortScope.abort(error);\n\t\treturn error;\n\t}\n\tfunction cancelStartedLargeFile(fileId) {\n\t\tif (cancelAfterStartScheduled) return;\n\t\tcancelAfterStartScheduled = true;\n\t\tcancelLargeFileBestEffort(raw, accountInfo, fileId, cleanupWriteStreamOptions(options));\n\t}\n\tfunction scheduleCancelLargeFileAfterStart(started) {\n\t\tstarted.then((fileId) => cancelStartedLargeFile(fileId)).catch(() => {});\n\t}\n\tasync function settleInflightForClose() {\n\t\tconst settled = Promise.allSettled(inflight);\n\t\tif (startPromise === null || largeFileId !== null) return await settled;\n\t\tconst abortWaiter = waitForAbort(abortScope.signal);\n\t\ttry {\n\t\t\tif (await Promise.race([\n\t\t\t\tsettled.then(() => \"settled\"),\n\t\t\t\tstartPromise.then(() => \"start-settled\", () => \"start-settled\"),\n\t\t\t\tabortWaiter.promise.then(() => \"aborted\")\n\t\t\t]) === \"aborted\" && largeFileId === null) throw abortReason(abortScope.signal);\n\t\t\treturn await settled;\n\t\t} finally {\n\t\t\tabortWaiter.dispose();\n\t\t}\n\t}\n\tfunction startPartWithAcquiredSlot(data, partNumber) {\n\t\tconst task = (async () => {\n\t\t\ttry {\n\t\t\t\tawait shipPart(data, partNumber);\n\t\t\t} catch (err) {\n\t\t\t\tmarkErrored(err);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsem.release();\n\t\t\t}\n\t\t})();\n\t\tinflight.push(task);\n\t\ttask.catch(() => {});\n\t}\n\tasync function acquirePartSlot() {\n\t\tawait sem.acquire();\n\t\tif (errored !== null) {\n\t\t\tsem.release();\n\t\t\tthrow errored;\n\t\t}\n\t\ttry {\n\t\t\tabortScope.signal.throwIfAborted();\n\t\t} catch (err) {\n\t\t\tsem.release();\n\t\t\tthrow err;\n\t\t}\n\t}\n\tasync function waitForInflightPartsToSettle(timeoutMs = DEFAULT_CLEANUP_TIMEOUT_MS) {\n\t\tif (inflight.length === 0) return;\n\t\tlet timeout;\n\t\ttry {\n\t\t\tawait Promise.race([Promise.allSettled(inflight).then(() => void 0), new Promise((resolve) => {\n\t\t\t\ttimeout = setTimeout(resolve, timeoutMs);\n\t\t\t})]);\n\t\t} finally {\n\t\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t\t}\n\t}\n\tasync function dispatchPart() {\n\t\tif (pending.length === 0) return;\n\t\tawait acquirePartSlot();\n\t\tlet data;\n\t\tif (pending.length === 1) {\n\t\t\tconst head = pending[0];\n\t\t\tif (!head) {\n\t\t\t\tsem.release();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdata = head;\n\t\t} else {\n\t\t\tconst total = pending.reduce((sum, chunk) => sum + chunk.byteLength, 0);\n\t\t\tdata = new Uint8Array(total);\n\t\t\tlet offset = 0;\n\t\t\tfor (const chunk of pending) {\n\t\t\t\tdata.set(chunk, offset);\n\t\t\t\toffset += chunk.byteLength;\n\t\t\t}\n\t\t}\n\t\tpending.length = 0;\n\t\tpendingBytes = 0;\n\t\tconst partNumber = nextPartNumber++;\n\t\tstartPartWithAcquiredSlot(data, partNumber);\n\t}\n\treturn {\n\t\twritable: new WritableStream({\n\t\t\tasync write(chunk) {\n\t\t\t\tif (errored) throw errored;\n\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\tif (chunk.byteLength === 0) return;\n\t\t\t\tpending.push(chunk);\n\t\t\t\tpendingBytes += chunk.byteLength;\n\t\t\t\twhile (pendingBytes >= partSize) {\n\t\t\t\t\tawait acquirePartSlot();\n\t\t\t\t\tif (errored) {\n\t\t\t\t\t\tsem.release();\n\t\t\t\t\t\tthrow errored;\n\t\t\t\t\t}\n\t\t\t\t\tconst carved = carveExact(pending, partSize);\n\t\t\t\t\tconst partNumber = nextPartNumber++;\n\t\t\t\t\tpendingBytes -= partSize;\n\t\t\t\t\tstartPartWithAcquiredSlot(carved, partNumber);\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync close() {\n\t\t\t\ttry {\n\t\t\t\t\tif (errored) throw errored;\n\t\t\t\t\tabortScope.signal.throwIfAborted();\n\t\t\t\t\tif (pendingBytes > 0) await dispatchPart();\n\t\t\t\t\tconst rejected = (await settleInflightForClose()).find((result) => result.status === \"rejected\");\n\t\t\t\t\tif (rejected !== void 0 && errored === null) markErrored(rejected.reason);\n\t\t\t\t\tif (errored) throw errored;\n\t\t\t\t\tif (largeFileId === null) throw new Error(\"createWriteStream closed without any data written.\");\n\t\t\t\t\tconst result = await finishLargeFileWithAbortReconciliation(raw, accountInfo, {\n\t\t\t\t\t\tfileId: largeFileId,\n\t\t\t\t\t\tbucketId: options.bucketId,\n\t\t\t\t\t\tfileName: options.fileName,\n\t\t\t\t\t\tpartSha1s,\n\t\t\t\t\t\tsignal: abortScope.signal,\n\t\t\t\t\t\t...options.retry !== void 0 ? { retry: options.retry } : {}\n\t\t\t\t\t});\n\t\t\t\t\tabortScope.dispose();\n\t\t\t\t\tresolveDone(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst closeError = toError(err);\n\t\t\t\t\tif (errored === null) errored = closeError;\n\t\t\t\t\tabortScope.abort(errored);\n\t\t\t\t\tconst observedError = errored;\n\t\t\t\t\tconst fileIdToCancel = largeFileId;\n\t\t\t\t\tif (fileIdToCancel === null && startPromise !== null) {\n\t\t\t\t\t\tscheduleCancelLargeFileAfterStart(startPromise);\n\t\t\t\t\t\tabortScope.dispose();\n\t\t\t\t\t\trejectDone(observedError);\n\t\t\t\t\t\tthrow observedError;\n\t\t\t\t\t}\n\t\t\t\t\tawait Promise.allSettled(inflight);\n\t\t\t\t\tlet finalError = observedError;\n\t\t\t\t\tif (fileIdToCancel !== null) finalError = await resolveLargeFileErrorAfterCleanup(observedError, raw, accountInfo, {\n\t\t\t\t\t\tfileId: fileIdToCancel,\n\t\t\t\t\t\tbucketId: options.bucketId,\n\t\t\t\t\t\tfileName: options.fileName,\n\t\t\t\t\t\tsignal: options.signal,\n\t\t\t\t\t\tonCleanupFailure: options.onCleanupFailure\n\t\t\t\t\t});\n\t\t\t\t\tabortScope.dispose();\n\t\t\t\t\trejectDone(finalError);\n\t\t\t\t\tthrow finalError;\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync abort(reason) {\n\t\t\t\tconst abortError = markErrored(reason);\n\t\t\t\tpending.length = 0;\n\t\t\t\tpendingBytes = 0;\n\t\t\t\tconst fileIdToCancel = largeFileId;\n\t\t\t\tif (fileIdToCancel === null && startPromise !== null) scheduleCancelLargeFileAfterStart(startPromise);\n\t\t\t\tif (fileIdToCancel !== null) {\n\t\t\t\t\tawait waitForInflightPartsToSettle();\n\t\t\t\t\tawait cancelLargeFileBestEffort(raw, accountInfo, fileIdToCancel, cleanupWriteStreamOptions(options));\n\t\t\t\t}\n\t\t\t\tabortScope.dispose();\n\t\t\t\trejectDone(abortError);\n\t\t\t}\n\t\t}),\n\t\tdone\n\t};\n}\nfunction cleanupWriteStreamOptions(options) {\n\treturn {\n\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t...options.onCleanupFailure !== void 0 ? { onCleanupFailure: options.onCleanupFailure } : {}\n\t};\n}\n/**\n* Removes exactly `size` bytes from the front of `chunks` (mutates) and returns\n* them as a contiguous Uint8Array. Any trailing remainder of the last chunk\n* stays at the front of `chunks` for the next part.\n*\n* @param chunks - Queue of pending chunks. Modified in place.\n* @param size - Number of bytes to carve off the front.\n*\n* @returns A new Uint8Array containing exactly `size` bytes.\n*/\nfunction carveExact(chunks, size) {\n\tconst out = new Uint8Array(size);\n\tlet written = 0;\n\twhile (written < size && chunks.length > 0) {\n\t\tconst head = chunks[0];\n\t\tif (!head) break;\n\t\tconst need = size - written;\n\t\tif (head.byteLength <= need) {\n\t\t\tout.set(head, written);\n\t\t\twritten += head.byteLength;\n\t\t\tchunks.shift();\n\t\t} else {\n\t\t\tout.set(head.subarray(0, need), written);\n\t\t\tchunks[0] = head.subarray(need);\n\t\t\twritten += need;\n\t\t}\n\t}\n\treturn out;\n}\nfunction waitForAbort(signal) {\n\tif (signal.aborted) return {\n\t\tpromise: Promise.resolve(abortReason(signal)),\n\t\tdispose() {}\n\t};\n\tlet onAbort;\n\treturn {\n\t\tpromise: new Promise((resolve) => {\n\t\t\tonAbort = () => resolve(abortReason(signal));\n\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t}),\n\t\tdispose() {\n\t\t\tif (onAbort !== void 0) signal.removeEventListener(\"abort\", onAbort);\n\t\t}\n\t};\n}\n//#endregion\nexport { createWriteStream };\n\n//# sourceMappingURL=stream.js.map","import { downloadById, downloadByName, headById, headByName } from \"./download/single.js\";\nimport { mergeUploadRetryOptions } from \"./internal/upload-retry-options.js\";\nimport { createParallelDownloadStream } from \"./download/parallel.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { rejectSmallResumeFileId, stripResumeOnlyOptions } from \"./upload/options.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { createWriteStream } from \"./upload/stream.js\";\n//#region src/object.ts\nfunction bucketDefaultRetentionSnapshot(info) {\n\tconst fileLock = info.fileLockConfiguration;\n\tif (!fileLock.isClientAuthorizedToRead) return { unreadable: true };\n\tif (fileLock.value === null) return { unreadable: false };\n\treturn {\n\t\tretention: fileLock.value.defaultRetention,\n\t\tunreadable: false\n\t};\n}\nfunction resumeNeedsFreshBucketDefaults(options) {\n\treturn (options.resume === true || options.resumeFileId !== void 0) && (options.serverSideEncryption === void 0 || options.fileRetention === void 0);\n}\n/**\n* Handle to a specific file (by name) within a B2 bucket.\n*\n* Provides file-scoped upload, download, and management operations.\n* Obtained via {@link Bucket.file}.\n*\n* @example\n* ```ts\n* const obj = bucket.file('photos/2026/sunset.jpg')\n* await obj.upload({ source: new BufferSource(data) })\n* const result = await obj.download()\n* ```\n*/\nvar B2Object = class {\n\t/** The file name (path) within the bucket. */\n\tfileName;\n\tclient;\n\tbucket;\n\tuploadRetryOptions;\n\t/**\n\t* @param client - The parent B2Client instance.\n\t* @param bucket - The parent Bucket this object belongs to.\n\t* @param fileName - The file path within the bucket.\n\t* @param uploadRetryOptions - Resolved client upload retry defaults.\n\t*\n\t* @internal\n\t*/\n\tconstructor(client, bucket, fileName, uploadRetryOptions) {\n\t\tthis.client = client;\n\t\tthis.bucket = bucket;\n\t\tthis.fileName = fileName;\n\t\tthis.uploadRetryOptions = uploadRetryOptions;\n\t}\n\t/**\n\t* Uploads data to this file name. Automatically uses multipart upload for large files.\n\t* @param options - Upload configuration including data source and optional settings.\n\t*\n\t* @returns Metadata for the uploaded file version.\n\t*/\n\tasync upload(options) {\n\t\tconst recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n\t\tconst isLarge = options.source.size > recommendedPartSize;\n\t\tconst uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options.retry);\n\t\tif (isLarge) {\n\t\t\tconst bucketInfo = resumeNeedsFreshBucketDefaults(options) ? await this.fetchFreshBucketInfo() : this.bucket.info;\n\t\t\tconst bucketDefaultRetention = bucketDefaultRetentionSnapshot(bucketInfo);\n\t\t\treturn uploadLargeFile(this.client.raw, this.client.accountInfo, {\n\t\t\t\t...options,\n\t\t\t\tbucketId: this.bucket.id,\n\t\t\t\tfileName: this.fileName,\n\t\t\t\tretry: uploadRetryOptions,\n\t\t\t\tbucketDefaultServerSideEncryption: bucketInfo.defaultServerSideEncryption,\n\t\t\t\t...bucketDefaultRetention.retention !== void 0 ? { bucketDefaultRetention: bucketDefaultRetention.retention } : {},\n\t\t\t\t...bucketDefaultRetention.unreadable ? { bucketDefaultRetentionUnreadable: true } : {}\n\t\t\t});\n\t\t}\n\t\trejectSmallResumeFileId(options, \"B2Object.upload\");\n\t\tconst smallOptions = stripResumeOnlyOptions(options);\n\t\treturn uploadSmallFile(this.client.raw, this.client.accountInfo, {\n\t\t\t...smallOptions,\n\t\t\tbucketId: this.bucket.id,\n\t\t\tfileName: this.fileName,\n\t\t\tretry: uploadRetryOptions\n\t\t});\n\t}\n\tasync fetchFreshBucketInfo() {\n\t\tconst found = (await this.client.listBuckets({ bucketId: this.bucket.id }))[0];\n\t\tif (!found) throw new Error(`Bucket ${this.bucket.id} not found`);\n\t\treturn found.info;\n\t}\n\t/**\n\t* Downloads this file by name. Pass `method: 'HEAD'` to fetch only the\n\t* response headers (file metadata) without streaming the body.\n\t* @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n\t*\n\t* @returns The download result with response headers and body stream.\n\t*/\n\tasync download(options) {\n\t\treturn downloadByName(this.client.raw, this.client.accountInfo, {\n\t\t\tbucketName: this.bucket.name,\n\t\t\tfileName: this.fileName,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Fetches response headers for this file via HTTP HEAD. Returns a\n\t* body-less result so callers never have to drain the (logically\n\t* empty) HEAD body themselves.\n\t*\n\t* @param options - Optional range, SSE-C decryption, response-header\n\t* overrides, and abort signal. Same shape as {@link B2Object.download}'s\n\t* options minus `method` (always HEAD) and `onProgress` (no body).\n\t*\n\t* @returns Parsed download headers (content type, SHA-1, file info, etc.).\n\t*/\n\tasync head(options) {\n\t\treturn headByName(this.client.raw, this.client.accountInfo, {\n\t\t\tbucketName: this.bucket.name,\n\t\t\tfileName: this.fileName,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Downloads a specific version of this file by ID. Pass `method: 'HEAD'`\n\t* to fetch only the response headers (file metadata) without streaming the body.\n\t* @param fileId - The file version ID to download.\n\t* @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n\t*\n\t* @returns The download result with response headers and body stream.\n\t*/\n\tasync downloadById(fileId, options) {\n\t\treturn downloadById(this.client.raw, this.client.accountInfo, {\n\t\t\tfileId,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Fetches response headers for a specific version of this file by ID\n\t* via HTTP HEAD. Returns a body-less result so callers never have to\n\t* drain the (logically empty) HEAD body themselves.\n\t*\n\t* @param fileId - The file version ID to inspect.\n\t* @param options - Optional range, SSE-C decryption, response-header\n\t* overrides, and abort signal.\n\t*\n\t* @returns Parsed download headers.\n\t*/\n\tasync headById(fileId, options) {\n\t\treturn headById(this.client.raw, this.client.accountInfo, {\n\t\t\tfileId,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Creates a parallel-download ReadableStream that fetches the file in concurrent ranged chunks.\n\t* @param fileId - The file version ID to download.\n\t* @param totalSize - Total file size in bytes (needed to compute range boundaries).\n\t* @param options - Concurrency, range size, and abort signal.\n\t*\n\t* @returns A Web ReadableStream of file data in sequential order.\n\t*/\n\tcreateReadStream(fileId, totalSize, options) {\n\t\treturn createParallelDownloadStream(this.client.raw, this.client.accountInfo, {\n\t\t\tfileId,\n\t\t\ttotalSize,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Creates a Web `WritableStream` that uploads streamed data into this file\n\t* using the multipart protocol. Pipe a `ReadableStream` into the\n\t* returned `writable` and await `done` to get the final {@link FileVersion}.\n\t*\n\t* Note: streaming uploads do not support resume because the size and per-part\n\t* hashes are not known in advance. Use {@link upload} with a buffered source\n\t* when resume is required.\n\t*\n\t* @param options - Streaming upload parameters (part size, concurrency, encryption).\n\t*\n\t* @returns A handle with the writable sink and a completion promise.\n\t*/\n\tcreateWriteStream(options) {\n\t\tconst uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options?.retry);\n\t\treturn createWriteStream(this.client.raw, this.client.accountInfo, {\n\t\t\t...options ?? {},\n\t\t\tbucketId: this.bucket.id,\n\t\t\tfileName: this.fileName,\n\t\t\tretry: uploadRetryOptions\n\t\t});\n\t}\n\t/**\n\t* Retrieves metadata for a specific file version.\n\t* @param fileId - The file version ID to look up.\n\t*\n\t* @returns The file version metadata.\n\t*/\n\tasync getFileInfo(fileId) {\n\t\treturn this.client.raw.getFileInfo(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { fileId });\n\t}\n\t/**\n\t* Hides this file by creating a hide marker at this file name.\n\t*\n\t* @returns Metadata for the newly created hide marker.\n\t*/\n\tasync hide() {\n\t\treturn this.bucket.hideFile(this.fileName);\n\t}\n\t/**\n\t* Permanently deletes a specific version of this file.\n\t* @param fileId - The unique identifier of the file version to delete.\n\t*/\n\tasync deleteVersion(fileId) {\n\t\tawait this.bucket.deleteFileVersion(this.fileName, fileId);\n\t}\n\t/**\n\t* Sets or updates the Object Lock retention policy on a specific file\n\t* version of this file.\n\t*\n\t* The bucket must have Object Lock enabled (`fileLockEnabled: true` at\n\t* creation time). Governance-mode retention can be shortened or removed\n\t* by passing `bypassGovernance: true` together with an application key\n\t* that carries the `bypassGovernance` capability; compliance-mode\n\t* retention cannot be shortened by anyone until the\n\t* `retainUntilTimestamp` elapses.\n\t*\n\t* @param fileId - The file version to apply the policy to.\n\t* @param retention - The retention policy to apply.\n\t* @param options - Optional flag for shortening governance-mode retention.\n\t*\n\t* @returns Metadata for the updated file version.\n\t*/\n\tasync setRetention(fileId, retention, options) {\n\t\treturn this.bucket.updateFileRetention(this.fileName, fileId, retention, options);\n\t}\n\t/**\n\t* Toggles the legal hold flag on a specific file version of this file.\n\t*\n\t* Legal hold is independent of retention: a file can be on legal hold\n\t* without any retention policy, and vice versa. The bucket must have\n\t* Object Lock enabled, and any caller must hold the `writeFileLegalHolds`\n\t* capability.\n\t*\n\t* @param fileId - The file version to apply the flag to.\n\t* @param legalHold - `'on'` to apply the hold, `'off'` to remove it.\n\t*\n\t* @returns Metadata for the updated file version.\n\t*/\n\tasync setLegalHold(fileId, legalHold) {\n\t\treturn this.bucket.updateFileLegalHold(this.fileName, fileId, legalHold);\n\t}\n};\n//#endregion\nexport { B2Object };\n\n//# sourceMappingURL=object.js.map","import { accountId } from \"./types/ids.js\";\nimport { Semaphore } from \"./upload/concurrency.js\";\nimport \"./util/defaults.js\";\nimport { copyLargeFile } from \"./copy/large.js\";\nimport { downloadByName, headByName } from \"./download/single.js\";\nimport { mergeUploadRetryOptions } from \"./internal/upload-retry-options.js\";\nimport { uploadLargeFile } from \"./upload/large.js\";\nimport { rejectSmallResumeFileId, stripResumeOnlyOptions } from \"./upload/options.js\";\nimport { uploadSmallFile } from \"./upload/single.js\";\nimport { toError } from \"./util/to-error.js\";\nimport { B2Object } from \"./object.js\";\nimport { paginateItems } from \"./util/paginator.js\";\n//#region src/bucket.ts\nfunction bucketDefaultRetentionSnapshot(info) {\n\tconst fileLock = info.fileLockConfiguration;\n\tif (!fileLock.isClientAuthorizedToRead) return { unreadable: true };\n\tif (fileLock.value === null) return { unreadable: false };\n\treturn {\n\t\tretention: fileLock.value.defaultRetention,\n\t\tunreadable: false\n\t};\n}\nfunction resumeNeedsFreshBucketDefaults(options) {\n\treturn (options.resume === true || options.resumeFileId !== void 0) && (options.serverSideEncryption === void 0 || options.fileRetention === void 0);\n}\n/**\n* Handle to a B2 bucket providing upload, download, listing, and management operations.\n*\n* Obtained via {@link B2Client.createBucket}, {@link B2Client.listBuckets}, or {@link B2Client.getBucket}.\n*\n* @example\n* ```ts\n* const bucket = await client.getBucket('my-bucket')\n* await bucket.upload({ fileName: 'hello.txt', source: new BufferSource(data) })\n* ```\n*/\nvar Bucket = class {\n\t/** Unique identifier for this bucket. */\n\tid;\n\t/** Human-readable bucket name. */\n\tname;\n\t/** Full bucket metadata as returned by the B2 API. */\n\tinfo;\n\tclient;\n\tuploadRetryOptions;\n\t/**\n\t* @param client - The parent B2Client instance.\n\t* @param info - The bucket metadata from the API.\n\t* @param uploadRetryOptions - Resolved client upload retry defaults.\n\t*\n\t* @internal\n\t*/\n\tconstructor(client, info, uploadRetryOptions) {\n\t\tthis.client = client;\n\t\tthis.info = info;\n\t\tthis.id = info.bucketId;\n\t\tthis.name = info.bucketName;\n\t\tthis.uploadRetryOptions = uploadRetryOptions;\n\t}\n\t/**\n\t* Returns a {@link B2Object} handle for a specific file name in this bucket.\n\t* @param fileName - The file path within the bucket.\n\t*\n\t* @returns A B2Object handle bound to this bucket and file name.\n\t*/\n\tfile(fileName) {\n\t\treturn new B2Object(this.client, this, fileName, this.uploadRetryOptions);\n\t}\n\t/**\n\t* Uploads a file to this bucket. Automatically uses multipart upload for files\n\t* larger than the recommended part size.\n\t* @param options - Upload configuration including file name, source data, and optional settings.\n\t*\n\t* @returns Metadata for the uploaded file version.\n\t*/\n\tasync upload(options) {\n\t\tconst recommendedPartSize = this.client.accountInfo.getRecommendedPartSize();\n\t\tconst isLarge = options.source.size > recommendedPartSize;\n\t\tconst uploadRetryOptions = mergeUploadRetryOptions(this.uploadRetryOptions, options.retry);\n\t\tif (isLarge) {\n\t\t\tconst bucketInfo = resumeNeedsFreshBucketDefaults(options) ? await this.refresh() : this.info;\n\t\t\tconst bucketDefaultRetention = bucketDefaultRetentionSnapshot(bucketInfo);\n\t\t\treturn uploadLargeFile(this.client.raw, this.client.accountInfo, {\n\t\t\t\t...options,\n\t\t\t\tbucketId: this.id,\n\t\t\t\tretry: uploadRetryOptions,\n\t\t\t\tbucketDefaultServerSideEncryption: bucketInfo.defaultServerSideEncryption,\n\t\t\t\t...bucketDefaultRetention.retention !== void 0 ? { bucketDefaultRetention: bucketDefaultRetention.retention } : {},\n\t\t\t\t...bucketDefaultRetention.unreadable ? { bucketDefaultRetentionUnreadable: true } : {}\n\t\t\t});\n\t\t}\n\t\trejectSmallResumeFileId(options, \"Bucket.upload\");\n\t\tconst smallOptions = stripResumeOnlyOptions(options);\n\t\treturn uploadSmallFile(this.client.raw, this.client.accountInfo, {\n\t\t\t...smallOptions,\n\t\t\tbucketId: this.id,\n\t\t\tretry: uploadRetryOptions\n\t\t});\n\t}\n\t/**\n\t* Downloads a file from this bucket by name. Pass `method: 'HEAD'` in\n\t* `options` to fetch only the response headers (file metadata) without\n\t* streaming the body.\n\t* @param fileName - The file name (path) to download.\n\t* @param options - Optional method, range, SSE-C decryption, response-header overrides, and abort signal.\n\t*\n\t* @returns The download result containing response headers and a readable body stream.\n\t*/\n\tasync download(fileName, options) {\n\t\treturn downloadByName(this.client.raw, this.client.accountInfo, {\n\t\t\tbucketName: this.name,\n\t\t\tfileName,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Fetches the response headers (file metadata) for a file via HTTP\n\t* HEAD. Returns a body-less result so callers never have to drain\n\t* the (logically empty) HEAD body themselves.\n\t*\n\t* Use this for metadata-only checks like \"does this file exist\", \"what\n\t* is its current SHA-1\", \"what is its Content-Length\". For full file\n\t* retrieval use {@link Bucket.download}.\n\t*\n\t* @param fileName - The file name (path) to inspect.\n\t* @param options - Optional range, SSE-C decryption, response-header\n\t* overrides, and abort signal. Same shape as {@link Bucket.download}'s\n\t* options minus `method` (always HEAD) and `onProgress` (no body).\n\t*\n\t* @returns Parsed download headers (content type, SHA-1, file info, etc.).\n\t*\n\t* @example\n\t* ```ts\n\t* const { headers } = await bucket.head('photos/2026/sunset.jpg')\n\t* console.log(headers.contentLength, headers.contentSha1)\n\t* ```\n\t*/\n\tasync head(fileName, options) {\n\t\treturn headByName(this.client.raw, this.client.accountInfo, {\n\t\t\tbucketName: this.name,\n\t\t\tfileName,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Lists file names in this bucket (most recent versions only).\n\t* @param options - Optional filtering and pagination settings.\n\t*\n\t* @returns A page of file versions with an optional continuation token.\n\t*/\n\tasync listFileNames(options) {\n\t\treturn this.client.raw.listFileNames(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\t...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n\t\t\t...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n\t\t\t...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n\t\t\t...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n\t\t}, { ...options?.signal !== void 0 ? { signal: options.signal } : {} });\n\t}\n\t/**\n\t* Lists all file versions in this bucket, including hidden files.\n\t* @param options - Optional filtering and pagination settings.\n\t*\n\t* @returns A page of file versions with an optional continuation token.\n\t*/\n\tasync listFileVersions(options) {\n\t\treturn this.client.raw.listFileVersions(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\t...options?.startFileName !== void 0 ? { startFileName: options.startFileName } : {},\n\t\t\t...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n\t\t\t...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {},\n\t\t\t...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n\t\t\t...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {}\n\t\t}, { ...options?.signal !== void 0 ? { signal: options.signal } : {} });\n\t}\n\t/**\n\t* Async iterator that yields the latest visible version of every file in\n\t* the bucket, automatically handling pagination via `listFileNames`.\n\t*\n\t* Hidden files (those whose latest version is a hide marker) are NOT\n\t* yielded by this iterator. Use {@link paginateFileVersions} when you\n\t* need full version history.\n\t*\n\t* @param options - Filter + pagination + abort options. `pageSize` is\n\t* forwarded to `b2_list_file_names`'s `maxFileCount` (default 1000,\n\t* B2-capped at 10000).\n\t*\n\t* @returns An async iterable of {@link FileVersion} entries.\n\t*\n\t* @example\n\t* ```ts\n\t* for await (const file of bucket.paginateFileNames({ prefix: 'photos/' })) {\n\t* console.log(file.fileName, file.contentLength)\n\t* }\n\t* ```\n\t*/\n\tpaginateFileNames(options) {\n\t\treturn paginateItems(async (cursor) => {\n\t\t\tconst resp = await this.listFileNames({\n\t\t\t\tpageSize: options?.pageSize ?? 1e3,\n\t\t\t\t...cursor !== void 0 ? { startFileName: cursor } : {},\n\t\t\t\t...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n\t\t\t\t...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {},\n\t\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tpage: resp,\n\t\t\t\tnextCursor: resp.nextFileName ?? void 0\n\t\t\t};\n\t\t}, (page) => page.files.filter((f) => f.action !== \"hide\"), options?.signal);\n\t}\n\t/**\n\t* Async iterator that yields every version of every file in the bucket,\n\t* including hidden files and historical versions, automatically handling\n\t* pagination via `listFileVersions`.\n\t*\n\t* The two-cursor `(nextFileName, nextFileId)` continuation that the raw\n\t* endpoint exposes is threaded internally; callers iterate flat.\n\t*\n\t* @param options - Filter + pagination + abort options.\n\t*\n\t* @returns An async iterable of {@link FileVersion} entries.\n\t*/\n\tpaginateFileVersions(options) {\n\t\treturn paginateItems(async (cursor) => {\n\t\t\tconst resp = await this.listFileVersions({\n\t\t\t\tpageSize: options?.pageSize ?? 1e3,\n\t\t\t\t...cursor !== void 0 ? { startFileName: cursor.fileName } : {},\n\t\t\t\t...cursor?.fileId !== void 0 ? { startFileId: cursor.fileId } : {},\n\t\t\t\t...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n\t\t\t\t...options?.delimiter !== void 0 ? { delimiter: options.delimiter } : {},\n\t\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tpage: resp,\n\t\t\t\tnextCursor: resp.nextFileName !== null ? {\n\t\t\t\t\tfileName: resp.nextFileName,\n\t\t\t\t\tfileId: resp.nextFileId ?? void 0\n\t\t\t\t} : void 0\n\t\t\t};\n\t\t}, (page) => page.files, options?.signal);\n\t}\n\t/**\n\t* Async iterator that yields every unfinished large file in the bucket,\n\t* automatically handling pagination via `listUnfinishedLargeFiles`.\n\t*\n\t* Useful for janitorial scripts that want to inspect or cancel abandoned\n\t* multipart uploads (typically followed by {@link cancelLargeFile} on\n\t* the underlying raw client).\n\t*\n\t* @param options - Filter + pagination + abort options. `pageSize` is\n\t* B2-capped at 100 for this endpoint.\n\t*\n\t* @returns An async iterable of unfinished-large-file metadata entries.\n\t*/\n\tpaginateUnfinishedLargeFiles(options) {\n\t\treturn paginateItems(async (cursor) => {\n\t\t\tconst resp = await this.listUnfinishedLargeFiles({\n\t\t\t\tpageSize: options?.pageSize ?? 100,\n\t\t\t\t...cursor !== void 0 ? { startFileId: cursor } : {},\n\t\t\t\t...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},\n\t\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tpage: resp,\n\t\t\t\tnextCursor: resp.nextFileId ?? void 0\n\t\t\t};\n\t\t}, (page) => page.files, options?.signal);\n\t}\n\t/**\n\t* Async iterator that yields every uploaded part for a specific large\n\t* file, automatically handling pagination via `listParts`.\n\t*\n\t* @param largeFileId - The unfinished large file to enumerate parts of.\n\t* @param options - Pagination + abort options. `pageSize` is B2-capped\n\t* at 1000 for this endpoint; the default is 1000.\n\t*\n\t* @returns An async iterable of {@link PartInfo} entries.\n\t*/\n\tpaginateParts(largeFileId, options) {\n\t\treturn paginateItems(async (cursor) => {\n\t\t\tconst resp = await this.client.raw.listParts(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\t\tfileId: largeFileId,\n\t\t\t\tmaxPartCount: options?.pageSize ?? 1e3,\n\t\t\t\t...cursor !== void 0 ? { startPartNumber: cursor } : {}\n\t\t\t}, options?.signal !== void 0 ? { signal: options.signal } : void 0);\n\t\t\treturn {\n\t\t\t\tpage: resp,\n\t\t\t\tnextCursor: resp.nextPartNumber ?? void 0\n\t\t\t};\n\t\t}, (page) => page.parts, options?.signal);\n\t}\n\t/**\n\t* Looks up the latest visible version of a file by name.\n\t* Uses `listFileNames` under the hood; returns `null` when the file does not\n\t* exist or its latest version is a hide marker.\n\t* @param fileName - The exact file path to look up.\n\t*\n\t* @returns The latest {@link FileVersion}, or `null` if not found.\n\t*/\n\tasync getFileInfoByName(fileName) {\n\t\tconst match = (await this.listFileNames({\n\t\t\tprefix: fileName,\n\t\t\tpageSize: 1\n\t\t})).files.find((f) => f.fileName === fileName);\n\t\tif (!match || match.action === \"hide\") return null;\n\t\treturn match;\n\t}\n\t/**\n\t* Removes the latest hide marker for a file, restoring visibility of the\n\t* previous upload. Returns the deleted hide marker, or `null` if there was\n\t* no hide marker to remove (file is already visible or does not exist).\n\t* @param fileName - The file path to unhide.\n\t*\n\t* @returns The deleted hide marker version, or `null` if nothing was hidden.\n\t*/\n\tasync unhideFile(fileName) {\n\t\tconst versions = (await this.listFileVersions({\n\t\t\tprefix: fileName,\n\t\t\tpageSize: 100\n\t\t})).files.filter((f) => f.fileName === fileName);\n\t\tif (versions.length === 0) return null;\n\t\tconst latest = versions[0];\n\t\tif (latest?.action !== \"hide\") return null;\n\t\tawait this.deleteFileVersion(fileName, latest.fileId);\n\t\treturn latest;\n\t}\n\t/**\n\t* Hides a file by creating a hide marker. The file remains in version history but is no longer visible in `listFileNames`.\n\t* @param fileName - The file path to hide.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns Metadata for the newly created hide marker.\n\t*/\n\tasync hideFile(fileName, options) {\n\t\treturn this.client.raw.hideFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\tfileName\n\t\t}, options);\n\t}\n\t/**\n\t* Permanently deletes a specific file version. Both file name and file ID are required.\n\t*\n\t* If the file is under Object Lock retention, B2 will reject the\n\t* delete: compliance-mode files cannot be deleted until the retention\n\t* expires; governance-mode files require `bypassGovernance: true`\n\t* AND a calling key with the `bypassGovernance` capability. Files on\n\t* legal hold cannot be deleted by anyone until the hold is removed.\n\t*\n\t* @param fileName - The file path of the version to delete.\n\t* @param fileId - The unique identifier of the file version to delete.\n\t* @param options - Optional governance and abort controls.\n\t*/\n\tasync deleteFileVersion(fileName, fileId, options) {\n\t\tawait this.client.raw.deleteFileVersion(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tfileName,\n\t\t\tfileId,\n\t\t\t...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n\t\t}, options?.signal !== void 0 ? { signal: options.signal } : void 0);\n\t}\n\t/**\n\t* Cancels an in-progress large file upload so the partial parts are not\n\t* retained or billed. The most common reason to call this is to clean up\n\t* abandoned multipart uploads surfaced by {@link listUnfinishedLargeFiles}.\n\t* @param fileId - The unique identifier of the unfinished large file to cancel.\n\t*\n\t* @returns Metadata about the cancelled large file.\n\t*/\n\tasync cancelLargeFile(fileId) {\n\t\treturn this.client.raw.cancelLargeFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { fileId });\n\t}\n\t/**\n\t* Lists large files in this bucket that were started but never finished or\n\t* cancelled. Wraps `b2_list_unfinished_large_files`.\n\t* @param options - Optional pagination filters.\n\t*\n\t* @returns The page of unfinished large files plus a continuation token.\n\t*/\n\tasync listUnfinishedLargeFiles(options) {\n\t\treturn this.client.raw.listUnfinishedLargeFiles(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\t...options?.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {},\n\t\t\t...options?.startFileId !== void 0 ? { startFileId: options.startFileId } : {},\n\t\t\t...options?.pageSize !== void 0 ? { maxFileCount: options.pageSize } : {}\n\t\t}, options?.signal !== void 0 ? { signal: options.signal } : void 0);\n\t}\n\t/**\n\t* Deletes many file versions with bounded concurrency. Errors from individual\n\t* deletes are collected and returned rather than thrown, so partial success\n\t* does not abort the run.\n\t*\n\t* When `options.signal` is supplied and aborted, in-flight deletes\n\t* complete (they're already on the wire), but no new deletes start\n\t* after the abort fires. Subsequent targets are short-circuited to an\n\t* error entry so the result tally reflects what actually happened.\n\t* @param targets - File versions to delete.\n\t* @param options - Optional concurrency override and abort signal.\n\t* Concurrency defaults to the SDK-wide bulk-metadata setting\n\t* (currently 10, higher than transfer concurrency because each\n\t* task is a single tiny API round-trip).\n\t*\n\t* @returns A summary of successes and per-target errors.\n\t*/\n\tasync deleteMany(targets, options) {\n\t\tconst sem = new Semaphore(options?.concurrency ?? 10);\n\t\tconst signal = options?.signal;\n\t\tlet deleted = 0;\n\t\tconst errors = [];\n\t\tawait Promise.all(targets.map(async (target) => {\n\t\t\tawait sem.acquire();\n\t\t\ttry {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\ttarget,\n\t\t\t\t\t\terror: toError(signal.reason ?? \"aborted\")\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tawait this.deleteFileVersion(target.fileName, target.fileId);\n\t\t\t\tdeleted++;\n\t\t\t} catch (err) {\n\t\t\t\terrors.push({\n\t\t\t\t\ttarget,\n\t\t\t\t\terror: toError(err)\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tsem.release();\n\t\t\t}\n\t\t}));\n\t\treturn {\n\t\t\tdeleted,\n\t\t\terrors\n\t\t};\n\t}\n\t/**\n\t* Async generator that streams every file version in the bucket (optionally\n\t* filtered by prefix) and deletes each one. Yields a {@link DeleteAllEvent}\n\t* per file version. With `dryRun: true`, no deletes are performed but `skip`\n\t* events are still emitted.\n\t* @param options - Optional prefix filter, page size, and dry-run flag.\n\t*\n\t* @returns An async generator of per-file events.\n\t*/\n\tasync *deleteAll(options) {\n\t\tconst dryRun = options?.dryRun ?? false;\n\t\tconst pageSize = options?.pageSize ?? 1e3;\n\t\tlet startFileName;\n\t\tlet startFileId;\n\t\twhile (true) {\n\t\t\tconst page = await this.listFileVersions({\n\t\t\t\tpageSize,\n\t\t\t\t...options?.prefix !== void 0 ? { prefix: options.prefix } : {},\n\t\t\t\t...startFileName !== void 0 ? { startFileName } : {},\n\t\t\t\t...startFileId !== void 0 ? { startFileId } : {}\n\t\t\t});\n\t\t\tfor (const version of page.files) {\n\t\t\t\tif (dryRun) {\n\t\t\t\t\tyield {\n\t\t\t\t\t\ttype: \"skip\",\n\t\t\t\t\t\tfileName: version.fileName,\n\t\t\t\t\t\tfileId: version.fileId\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tawait this.deleteFileVersion(version.fileName, version.fileId);\n\t\t\t\t\tyield {\n\t\t\t\t\t\ttype: \"delete\",\n\t\t\t\t\t\tfileName: version.fileName,\n\t\t\t\t\t\tfileId: version.fileId\n\t\t\t\t\t};\n\t\t\t\t} catch (err) {\n\t\t\t\t\tyield {\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\tfileName: version.fileName,\n\t\t\t\t\t\tfileId: version.fileId,\n\t\t\t\t\t\tmessage: toError(err).message\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!page.nextFileName) break;\n\t\t\tstartFileName = page.nextFileName;\n\t\t\tstartFileId = page.nextFileId ?? void 0;\n\t\t}\n\t}\n\t/**\n\t* Creates a server-side copy of a file within or across buckets.\n\t* @param options - Copy configuration including source file ID and destination name.\n\t*\n\t* @returns Metadata for the newly created file version.\n\t*/\n\tasync copyFile(options) {\n\t\tconst { serverSideEncryption, destinationServerSideEncryption, signal, ...copyOptions } = options;\n\t\tconst destinationEncryption = destinationServerSideEncryption ?? serverSideEncryption;\n\t\treturn this.client.raw.copyFile(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\t...copyOptions,\n\t\t\t...destinationEncryption !== void 0 ? { destinationServerSideEncryption: destinationEncryption } : {}\n\t\t}, signal !== void 0 ? { signal } : void 0);\n\t}\n\t/**\n\t* Copies a file via the server-side multipart protocol. Each part is copied\n\t* by reference through `b2_copy_part`; data never traverses the client. Falls\n\t* back to a single `copyFile` call when the source fits within a single part.\n\t* @param options - Copy parameters including source file ID, destination name, part size, and concurrency.\n\t*\n\t* @returns Metadata for the newly created destination file version.\n\t*/\n\tasync copyLargeFile(options) {\n\t\treturn copyLargeFile(this.client.raw, this.client.accountInfo, {\n\t\t\tsourceFileId: options.sourceFileId,\n\t\t\tfileName: options.fileName,\n\t\t\t...options.destinationBucketId !== void 0 ? { destinationBucketId: options.destinationBucketId } : { destinationBucketId: this.id },\n\t\t\t...options.contentType !== void 0 ? { contentType: options.contentType } : {},\n\t\t\t...options.fileInfo !== void 0 ? { fileInfo: options.fileInfo } : {},\n\t\t\t...options.destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption: options.destinationServerSideEncryption } : {},\n\t\t\t...options.sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption: options.sourceServerSideEncryption } : {},\n\t\t\t...options.partSize !== void 0 ? { partSize: options.partSize } : {},\n\t\t\t...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {},\n\t\t\t...options.onCleanupFailure !== void 0 ? { onCleanupFailure: options.onCleanupFailure } : {},\n\t\t\t...options.signal !== void 0 ? { signal: options.signal } : {}\n\t\t});\n\t}\n\t/**\n\t* Updates bucket settings such as type, CORS, lifecycle rules, and encryption.\n\t* @param options - Fields to update. Omitted fields are left unchanged.\n\t*\n\t* @returns Updated bucket metadata.\n\t*/\n\tasync update(options) {\n\t\treturn this.client.raw.updateBucket(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\taccountId: accountId(this.client.accountInfo.getAccountId()),\n\t\t\tbucketId: this.id,\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Permanently deletes this bucket. The bucket must be empty (no file versions).\n\t*\n\t* @returns The deleted bucket metadata.\n\t*/\n\tasync delete() {\n\t\treturn this.client.deleteBucket(this.id);\n\t}\n\t/**\n\t* Gets a download authorization token scoped to a file name prefix in this bucket.\n\t* @param fileNamePrefix - Only authorize downloads of files starting with this prefix.\n\t* @param validDurationInSeconds - How long the authorization is valid (1-604800 seconds).\n\t*\n\t* @returns The download authorization response containing a time-limited token.\n\t*/\n\tasync getDownloadAuthorization(fileNamePrefix, validDurationInSeconds) {\n\t\treturn this.client.raw.getDownloadAuthorization(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\tfileNamePrefix,\n\t\t\tvalidDurationInSeconds\n\t\t});\n\t}\n\t/**\n\t* Gets the event notification rules configured for this bucket.\n\t*\n\t* @returns The current notification rules for this bucket.\n\t*/\n\tasync getNotificationRules() {\n\t\treturn this.client.raw.getBucketNotificationRules(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), { bucketId: this.id });\n\t}\n\t/**\n\t* Replaces the event notification rules for this bucket.\n\t* @param rules - The new set of notification rules to apply.\n\t*\n\t* @returns The updated notification rules for this bucket.\n\t*/\n\tasync setNotificationRules(rules) {\n\t\treturn this.client.raw.setBucketNotificationRules(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tbucketId: this.id,\n\t\t\teventNotificationRules: rules\n\t\t});\n\t}\n\t/**\n\t* Updates the file retention policy for a specific file version. Requires file lock on the bucket.\n\t* @param fileName - The file path of the version to update.\n\t* @param fileId - The unique identifier of the file version.\n\t* @param retention - The new retention policy to apply.\n\t* @param options - Optional flags. Set `bypassGovernance: true` to shorten governance-mode retention.\n\t*\n\t* @returns The updated file retention metadata.\n\t*/\n\tasync updateFileRetention(fileName, fileId, retention, options) {\n\t\treturn this.client.raw.updateFileRetention(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tfileName,\n\t\t\tfileId,\n\t\t\tfileRetention: retention,\n\t\t\t...options?.bypassGovernance !== void 0 ? { bypassGovernance: options.bypassGovernance } : {}\n\t\t});\n\t}\n\t/**\n\t* Updates the legal hold status for a specific file version. Requires file lock on the bucket.\n\t* @param fileName - The file path of the version to update.\n\t* @param fileId - The unique identifier of the file version.\n\t* @param legalHold - The new legal hold status to apply.\n\t*\n\t* @returns The updated legal hold metadata.\n\t*/\n\tasync updateFileLegalHold(fileName, fileId, legalHold) {\n\t\treturn this.client.raw.updateFileLegalHold(this.client.accountInfo.getApiUrl(), this.client.accountInfo.getAuthToken(), {\n\t\t\tfileName,\n\t\t\tfileId,\n\t\t\tlegalHold\n\t\t});\n\t}\n\t/**\n\t* Refetches this bucket's metadata from B2 so callers operating on\n\t* replication / lifecycle / retention configuration always start from the\n\t* server-of-record state.\n\t*\n\t* Bucket configuration is monotonically revisioned by B2: B2 increments\n\t* `revision` on every accepted update. The local {@link info} snapshot\n\t* captured at construction time goes stale as soon as anyone else (or any\n\t* prior `update()` call) mutates the bucket, so the ergonomic\n\t* add/remove helpers below always refresh before composing the next\n\t* `setX()` call. The result is that each helper is safe to call without\n\t* the caller having to thread BucketInfo through their code.\n\t*\n\t* @returns Fresh {@link BucketInfo} for this bucket.\n\t*\n\t* @throws If the bucket no longer exists.\n\t*/\n\tasync refresh() {\n\t\tconst found = (await this.client.listBuckets({ bucketId: this.id }))[0];\n\t\tif (!found) throw new Error(`Bucket ${this.id} not found`);\n\t\treturn found.info;\n\t}\n\t/**\n\t* Returns the current cross-region replication configuration, refetched\n\t* from B2.\n\t*\n\t* Use this when you need to read replication state without composing a\n\t* write. For add/remove flows the helper methods below handle the\n\t* refresh-then-set sequence for you.\n\t*\n\t* @returns The current {@link ReplicationConfiguration}.\n\t*/\n\tasync getReplication() {\n\t\treturn (await this.refresh()).replicationConfiguration;\n\t}\n\t/**\n\t* Replaces this bucket's complete replication configuration.\n\t* @param replication - The new configuration. Pass an empty source/destination\n\t* pair (`{ asReplicationSource: null, asReplicationDestination: null }`)\n\t* to clear replication entirely.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync setReplication(replication) {\n\t\treturn this.update({ replicationConfiguration: replication });\n\t}\n\t/**\n\t* Adds (or replaces by `replicationRuleName`) a single replication rule\n\t* on this bucket while leaving any other rules, the source key, and the\n\t* destination key mapping untouched.\n\t*\n\t* When this is the very first source-side rule, `sourceApplicationKeyId`\n\t* must be supplied to seed `asReplicationSource.sourceApplicationKeyId`;\n\t* for subsequent calls the existing source key is reused unless the\n\t* caller explicitly overrides it.\n\t*\n\t* @param rule - The replication rule to add or replace.\n\t* @param options - Optional source application key ID override (or seed\n\t* when no source side exists yet).\n\t*\n\t* @returns The updated bucket metadata.\n\t*\n\t* @throws If no source-side replication exists yet and the caller did\n\t* not supply `sourceApplicationKeyId`.\n\t*/\n\tasync addReplicationRule(rule, options) {\n\t\tconst current = (await this.refresh()).replicationConfiguration;\n\t\tconst existingSource = current.asReplicationSource;\n\t\tconst sourceKey = options?.sourceApplicationKeyId ?? existingSource?.sourceApplicationKeyId;\n\t\tif (!sourceKey) throw new Error(\"addReplicationRule: no existing source-side replication; pass options.sourceApplicationKeyId\");\n\t\tconst without = (existingSource?.replicationRules ?? []).filter((r) => r.replicationRuleName !== rule.replicationRuleName);\n\t\treturn this.setReplication({\n\t\t\tasReplicationSource: {\n\t\t\t\tsourceApplicationKeyId: sourceKey,\n\t\t\t\treplicationRules: [...without, rule]\n\t\t\t},\n\t\t\tasReplicationDestination: current.asReplicationDestination\n\t\t});\n\t}\n\t/**\n\t* Removes a single replication rule by name. No-ops cleanly when the rule\n\t* is not present (returns the unchanged-but-revision-bumped bucket info).\n\t*\n\t* @param replicationRuleName - Name of the rule to remove.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync removeReplicationRule(replicationRuleName) {\n\t\tconst current = (await this.refresh()).replicationConfiguration;\n\t\tconst existingSource = current.asReplicationSource;\n\t\tif (!existingSource) return this.setReplication(current);\n\t\tconst filtered = existingSource.replicationRules.filter((r) => r.replicationRuleName !== replicationRuleName);\n\t\treturn this.setReplication({\n\t\t\tasReplicationSource: {\n\t\t\t\tsourceApplicationKeyId: existingSource.sourceApplicationKeyId,\n\t\t\t\treplicationRules: filtered\n\t\t\t},\n\t\t\tasReplicationDestination: current.asReplicationDestination\n\t\t});\n\t}\n\t/**\n\t* Returns the current lifecycle rules for this bucket, refetched from B2.\n\t*\n\t* @returns The current array of {@link LifecycleRule}s.\n\t*/\n\tasync getLifecycleRules() {\n\t\treturn (await this.refresh()).lifecycleRules;\n\t}\n\t/**\n\t* Replaces this bucket's lifecycle rules in their entirety.\n\t* @param rules - The new rule set. Pass `[]` to remove all lifecycle\n\t* automation.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync setLifecycleRules(rules) {\n\t\treturn this.update({ lifecycleRules: [...rules] });\n\t}\n\t/**\n\t* Adds (or replaces, matched by `fileNamePrefix`) a single lifecycle rule\n\t* while leaving any other rules untouched.\n\t*\n\t* Matching on prefix mirrors B2's own data model: each unique prefix can\n\t* have at most one rule, and a `b2_update_bucket` call that contains two\n\t* rules with the same prefix is rejected. The helper enforces this for\n\t* the caller.\n\t*\n\t* @param rule - The lifecycle rule to add or replace.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync addLifecycleRule(rule) {\n\t\tconst without = (await this.getLifecycleRules()).filter((r) => r.fileNamePrefix !== rule.fileNamePrefix);\n\t\treturn this.setLifecycleRules([...without, rule]);\n\t}\n\t/**\n\t* Removes a single lifecycle rule by prefix. No-ops cleanly when the rule\n\t* is not present.\n\t*\n\t* @param fileNamePrefix - The prefix of the rule to remove.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync removeLifecycleRule(fileNamePrefix) {\n\t\tconst current = await this.getLifecycleRules();\n\t\treturn this.setLifecycleRules(current.filter((r) => r.fileNamePrefix !== fileNamePrefix));\n\t}\n\t/**\n\t* Returns the current default Object Lock retention policy for new\n\t* uploads to this bucket, refetched from B2.\n\t*\n\t* @returns The default {@link BucketRetentionPolicy} (which may be\n\t* `{ mode: 'none', period: null }` when Object Lock is enabled on the\n\t* bucket but no default is set).\n\t*/\n\tasync getDefaultRetention() {\n\t\treturn (await this.refresh()).defaultRetention;\n\t}\n\t/**\n\t* Sets (or clears, by passing `{ mode: 'none', period: null }`) the\n\t* default Object Lock retention policy applied to new uploads.\n\t*\n\t* Object Lock must already be enabled on the bucket. Buckets created\n\t* without `fileLockEnabled: true` cannot accept a default retention\n\t* policy and B2 will reject this call.\n\t*\n\t* @param policy - The new default retention policy.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync setDefaultRetention(policy) {\n\t\treturn this.update({ defaultRetention: policy });\n\t}\n};\n//#endregion\nexport { Bucket };\n\n//# sourceMappingURL=bucket.js.map","import { redactUrlForError } from \"../internal/url-redaction.js\";\nimport { B2RealmConfigurationError } from \"../errors/index.js\";\n//#region src/auth/realms.ts\nvar VERIFIED_REALM_URLS = {\n\t/** Public production B2 Native API authorize endpoint. */\n\tproduction: \"https://api.backblazeb2.com\",\n\t/** Backblaze staging authorize endpoint from the official Python SDK realm map. */\n\tstaging: \"https://api.backblaze.net\"\n};\n/**\n* Built-in realm aliases to their `b2_authorize_account` base API URLs.\n* The object remains a mutable `Record` for source\n* compatibility with earlier SDK versions that let applications add local\n* aliases. SDK internals validate only the built-in aliases in\n* `VERIFIED_REALM_URLS`; pass direct custom realm URLs to `B2Client` instead\n* of relying on mutation for new code.\n*/\nvar REALM_URLS = { ...VERIFIED_REALM_URLS };\nvar HTTP_REALM_URL_WITH_HOST = /^https?:\\/\\/[^/?#]/i;\nfunction parseAbsoluteRealmUrl(realmUrl) {\n\ttry {\n\t\treturn new URL(realmUrl);\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction realmUrlForError(realmUrl, url = parseAbsoluteRealmUrl(realmUrl)) {\n\treturn redactUrlForError(url ?? realmUrl, { invalidUrlLabel: \"\" });\n}\nfunction isLoopbackHost(hostname) {\n\tconst host = hostname.toLowerCase();\n\tif (host === \"[::1]\" || host === \"::1\") return true;\n\tconst parts = host.split(\".\");\n\treturn parts.length === 4 && parts[0] === \"127\" && parts.every((part) => /^\\d+$/.test(part) && Number(part) <= 255);\n}\nfunction assertAuthorizableRealmScheme(realmUrl, url) {\n\tif ((url.protocol === \"https:\" || url.protocol === \"http:\") && (!HTTP_REALM_URL_WITH_HOST.test(realmUrl) || url.hostname === \"\")) throw new B2RealmConfigurationError(`realm URL must be an absolute HTTP(S) URL with a hostname for authorization: ${realmUrlForError(realmUrl, url)}`);\n\tif (url.protocol === \"https:\") return;\n\tif (url.protocol === \"http:\" && isLoopbackHost(url.hostname)) return;\n\tif (url.protocol === \"http:\") throw new B2RealmConfigurationError(`refusing to send credentials over plaintext HTTP realm: ${realmUrlForError(realmUrl, url)}`);\n\tthrow new B2RealmConfigurationError(`realm URL must use HTTPS or loopback IP HTTP for authorization: ${realmUrlForError(realmUrl, url)}`);\n}\nfunction assertRealmBaseUrl(realmUrl, url) {\n\tif (url.username === \"\" && url.password === \"\" && url.search === \"\" && url.hash === \"\") return;\n\tthrow new B2RealmConfigurationError(`realm URL must not include credentials, query, or fragment for authorization: ${realmUrlForError(realmUrl, url)}`);\n}\n/**\n* Validate a realm URL before it is used for credential-bearing authorization.\n* Any accepted custom HTTPS host receives the application key during authorize;\n* do not derive custom realm URLs from untrusted input. Realm URLs must be base\n* URLs without userinfo, query strings, or fragments.\n*\n* @param realmUrl - The resolved realm URL to validate.\n*\n* @throws B2RealmConfigurationError when the realm URL is not absolute, is not\n* a base URL, uses an unsupported scheme, or uses non-loopback plaintext HTTP.\n* Loopback IP HTTP is accepted only for local testing and sends the application\n* key unencrypted to whichever process is listening on that address and port.\n*/\nfunction assertSecureRealmUrl(realmUrl) {\n\tconst url = parseAbsoluteRealmUrl(realmUrl);\n\tif (url === null) throw new B2RealmConfigurationError(`realm URL must be absolute for authorization: ${realmUrlForError(realmUrl, url)}`);\n\tassertRealmBaseUrl(realmUrl, url);\n\tassertAuthorizableRealmScheme(realmUrl, url);\n}\nfunction isRealmName(realm) {\n\treturn Object.hasOwn(VERIFIED_REALM_URLS, realm);\n}\n/**\n* Resolve a realm name to its base API URL. Unknown strings are returned\n* unchanged so callers can resolve custom aliases before authorization.\n*\n* @param realm - The realm name or direct URL to resolve.\n*\n* @returns The mapped base API URL for a known realm, otherwise `realm`.\n*/\nfunction getRealmUrl(realm) {\n\treturn isRealmName(realm) ? VERIFIED_REALM_URLS[realm] : realm;\n}\n//#endregion\nexport { REALM_URLS, assertSecureRealmUrl, getRealmUrl };\n\n//# sourceMappingURL=realms.js.map","import { B2SsrfError } from \"../errors/index.js\";\n//#region src/http/url-guard.ts\n/**\n* URL allow-list guard. Defends against SSRF / URL-substitution attacks where\n* a compromised or hostile B2 endpoint returns an upload URL pointing at an\n* internal service (e.g. cloud metadata at `169.254.169.254`).\n*\n* The guard is built once per `B2Client` and updated by `B2Client.authorize()`.\n* Before authorization it is permissive (so the very first\n* `b2_authorize_account` request, whose URL the user configured, can succeed).\n* After authorization it is locked to host suffixes derived from the realm's\n* apiUrl/downloadUrl/s3ApiUrl, plus the well-known B2 upload-pod parent\n* domain `backblaze.com`.\n*\n* The guard runs in `FetchTransport` before any outgoing request. It rejects:\n*\n* 1. Literal IPv4/IPv6 addresses (defense in depth, covers attempts to\n* bypass DNS-based checks with raw IPs).\n* 2. Well-known internal hostnames (`localhost`, `metadata`,\n* `metadata.google.internal`, `.internal`, `.local`).\n* 3. Hosts not matching any allowed suffix once the SDK is locked.\n*\n* Users supplying a custom `transport` to `B2Client` bypass the guard. That\n* is their responsibility to document for their threat model.\n*\n* Threat-model note: the guard checks the URL's hostname before the\n* `fetch()` call. It does NOT pin the resolved IP. A DNS rebinding attack\n* could in principle resolve a permitted hostname to an internal IP between\n* the guard's check and `fetch()`'s own resolution. This is theoretical\n* against B2 because the allow-list is locked to a small set of stable\n* Backblaze hostnames (the realm's apiUrl/downloadUrl/s3ApiUrl plus the\n* `backblaze.com` parent), and DNS rebinding requires a hostname under\n* attacker control. Defense in depth — pinning the IP from the first\n* resolution and rejecting subsequent mismatches — would break legitimate\n* CDN failovers and is not justified at this surface area. If your\n* threat model requires it, supply a custom transport that does.\n*/\n/** A URL allow-list that can be reconfigured after construction. */\nvar UrlGuard = class {\n\tallowedSuffixes = [];\n\t/**\n\t* Lock the guard to the given host suffixes. A suffix matches a host\n\t* either exactly or as a `*.suffix` subdomain. For example,\n\t* `backblazeb2.com` allows `api.backblazeb2.com` and\n\t* `s3.us-west-004.backblazeb2.com`.\n\t*\n\t* Passing an empty array disables the guard (used by the simulator and\n\t* other test setups). Production code should always lock the guard after\n\t* a successful `b2_authorize_account`.\n\t*\n\t* @param suffixes - Allowed host suffixes.\n\t*/\n\tsetAllowedSuffixes(suffixes) {\n\t\tthis.allowedSuffixes = suffixes;\n\t}\n\t/**\n\t* Returns the current allowed-suffix list (for tests and diagnostics).\n\t*\n\t* @returns The currently-configured list of allowed host suffixes.\n\t*/\n\tgetAllowedSuffixes() {\n\t\treturn this.allowedSuffixes;\n\t}\n\t/**\n\t* Validate `rawUrl` against the allow-list. Throws {@link B2SsrfError} if\n\t* the URL points at a literal IP, a known-internal hostname, or a host\n\t* outside the allowed suffixes. Permissive (no-op) when no suffixes have\n\t* been configured yet.\n\t*\n\t* @param rawUrl - The URL the caller is about to fetch.\n\t*\n\t* @throws A `B2SsrfError` when the URL is rejected.\n\t*/\n\tcheck(rawUrl) {\n\t\tif (this.allowedSuffixes.length === 0) return;\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = new URL(rawUrl);\n\t\t} catch {\n\t\t\tthrow new B2SsrfError(`malformed URL rejected by SSRF guard: ${rawUrl}`, rawUrl);\n\t\t}\n\t\tconst host = parsed.hostname.toLowerCase();\n\t\tif (isLiteralIp(host)) throw new B2SsrfError(`literal IP host not allowed by SSRF guard (use a hostname): ${host}`, rawUrl);\n\t\tif (isInternalHostname(host)) throw new B2SsrfError(`internal hostname not allowed by SSRF guard: ${host}`, rawUrl);\n\t\tif (hostMatchesAnyAllowedSuffix(host, this.allowedSuffixes)) return;\n\t\tthrow new B2SsrfError(`host outside allowed B2 realm: ${host} (allowed suffixes: ${this.allowedSuffixes.join(\", \")})`, rawUrl);\n\t}\n};\n/**\n* Extract host suffixes to allow from a B2 authorize-account response.\n*\n* Known B2 realm hosts under `backblazeb2.com` are collapsed to that parent.\n* Unknown or custom realm hosts are used as scoped suffixes: the returned\n* hostname and its subdomains are allowed, but sibling hosts and parent\n* domains are not. This avoids accidentally trusting broad public suffixes\n* such as `co.uk`.\n*\n* Always includes `backblaze.com` because upload-pod URLs returned by\n* `b2_get_upload_url` use that parent domain (`pod-NNN-NNNN-NN.backblaze.com`)\n* rather than `backblazeb2.com`.\n*\n* @param storageApi - The `apiInfo.storageApi` portion of the authorize response.\n*\n* @returns Sorted list of unique host suffixes to allow.\n*/\nfunction deriveAllowedSuffixes(storageApi) {\n\tconst suffixes = /* @__PURE__ */ new Set([\"backblaze.com\"]);\n\tfor (const url of [\n\t\tstorageApi.apiUrl,\n\t\tstorageApi.downloadUrl,\n\t\tstorageApi.s3ApiUrl\n\t]) try {\n\t\tconst host = new URL(url).hostname;\n\t\tsuffixes.add(host === \"backblazeb2.com\" || host.endsWith(\".backblazeb2.com\") ? \"backblazeb2.com\" : host);\n\t} catch {}\n\treturn Array.from(suffixes).sort();\n}\n/**\n* Checks a hostname against one allowed suffix using the SDK's exact-or-subdomain rule.\n*\n* @param hostname - URL hostname to check.\n* @param suffix - Domain suffix that may match exactly or as a parent domain.\n*\n* @returns Whether the hostname is exactly the suffix or a subdomain of it.\n*/\nfunction hostMatchesAllowedSuffix(hostname, suffix) {\n\tconst host = hostname.toLowerCase();\n\tconst lowered = suffix.toLowerCase();\n\treturn host === lowered || host.endsWith(`.${lowered}`);\n}\n/**\n* Checks a hostname against an allowed-suffix list.\n*\n* @param hostname - URL hostname to check.\n* @param suffixes - Domain suffixes to test with the SDK's suffix-matching rule.\n*\n* @returns Whether any suffix matches the hostname.\n*/\nfunction hostMatchesAnyAllowedSuffix(hostname, suffixes) {\n\treturn suffixes.some((suffix) => hostMatchesAllowedSuffix(hostname, suffix));\n}\nfunction isLiteralIp(host) {\n\tif (/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/.test(host)) return true;\n\tif (host.includes(\":\")) return true;\n\treturn false;\n}\nfunction isInternalHostname(host) {\n\tif (host === \"localhost\") return true;\n\tif (host.endsWith(\".localhost\")) return true;\n\tif (host === \"metadata\") return true;\n\tif (host === \"metadata.google.internal\") return true;\n\tif (host.endsWith(\".internal\")) return true;\n\tif (host.endsWith(\".local\")) return true;\n\treturn false;\n}\n//#endregion\nexport { UrlGuard, deriveAllowedSuffixes, hostMatchesAllowedSuffix, hostMatchesAnyAllowedSuffix };\n\n//# sourceMappingURL=url-guard.js.map","//#region \\0b2-sdk-version-json\nvar _b2_sdk_version_json_default = { \"version\": \"0.2.0\" };\n//#endregion\nexport { _b2_sdk_version_json_default as default };\n","import _b2_sdk_version_json_default from \"./_virtual/_b2-sdk-version-json.js\";\n//#region src/version.ts\n/**\n* Current SDK version. Read directly from package.json so there is no\n* second-source-of-truth to keep in sync — bumping `version` in package.json\n* automatically propagates here, into the SDK's User-Agent header, and into\n* the published artifact.\n*\n* Works in every runtime the SDK targets:\n* - Node 22.3+, Bun, Deno: native JSON import attributes.\n* - Vite builds: the JSON import is replaced with a version-only shim so\n* published runtime chunks do not carry unrelated package metadata.\n* - Vitest browser mode: Vite handles the import the same way as build.\n*/\nvar VERSION = _b2_sdk_version_json_default.version;\n//#endregion\nexport { VERSION };\n\n//# sourceMappingURL=version.js.map","import { VERSION } from \"../version.js\";\n//#region src/http/user-agent.ts\n/**\n* Stable identifier Backblaze can grep server logs for to find every request\n* issued by this SDK regardless of how the User-Agent comment evolves.\n* Treat as part of the public contract: do NOT rename without coordinating.\n*/\nvar SDK_PRODUCT = \"b2-sdk-typescript\";\n/**\n* The npm package name. Embedded in the User-Agent comment alongside\n* {@link SDK_PRODUCT} so log queries that grep on either token work.\n*/\nvar SDK_PACKAGE = \"@backblaze-labs/b2-sdk\";\n/**\n* Best-effort detection of the JS runtime and host OS. Used to populate the\n* User-Agent comment so server-side logs can spot Bun/Deno adoption and\n* triage OS-specific issues without asking for a repro environment.\n*\n* @returns The detected runtime, OS, and architecture tokens.\n*/\nfunction detectPlatform() {\n\tconst g = globalThis;\n\tif (typeof g[\"Deno\"] !== \"undefined\") {\n\t\tconst deno = g[\"Deno\"];\n\t\treturn {\n\t\t\truntime: deno.version?.deno ? `deno/${deno.version.deno}` : \"deno\",\n\t\t\tos: deno.build?.os,\n\t\t\tarch: deno.build?.arch\n\t\t};\n\t}\n\tif (typeof g[\"Bun\"] !== \"undefined\") {\n\t\tconst bun = g[\"Bun\"];\n\t\tconst proc = g[\"process\"];\n\t\treturn {\n\t\t\truntime: bun.version ? `bun/${bun.version}` : \"bun\",\n\t\t\tos: proc?.platform,\n\t\t\tarch: proc?.arch\n\t\t};\n\t}\n\tif (typeof g[\"process\"] !== \"undefined\") {\n\t\tconst proc = g[\"process\"];\n\t\tif (proc.versions?.node) return {\n\t\t\truntime: `node/${proc.versions.node}`,\n\t\t\tos: proc.platform,\n\t\t\tarch: proc.arch\n\t\t};\n\t}\n\tif (typeof g[\"navigator\"] !== \"undefined\") return {\n\t\truntime: \"browser\",\n\t\tos: void 0,\n\t\tarch: void 0\n\t};\n\treturn {\n\t\truntime: \"unknown\",\n\t\tos: void 0,\n\t\tarch: void 0\n\t};\n}\n/**\n* Build the User-Agent header value the SDK sends on every B2 request.\n*\n* The product token, npm package name, language label, runtime, OS, and\n* architecture are emitted in that order, separated by semicolons inside a\n* single parenthesised comment block. OS and architecture are omitted on\n* runtimes that don't expose them (notably browsers). A custom prefix passed\n* via `B2ClientOptions.userAgent` is prepended verbatim so app-level\n* identifiers come first. See the README \"Identifying your traffic\" section\n* for examples.\n*\n* @param custom - Optional prefix prepended to the default User-Agent.\n*\n* @returns The formatted User-Agent header string.\n*/\nfunction getUserAgent(custom) {\n\tconst { runtime, os, arch } = detectPlatform();\n\tconst parts = [\n\t\t\"typescript\",\n\t\tSDK_PACKAGE,\n\t\truntime\n\t];\n\tif (os !== void 0) parts.push(os);\n\tif (arch !== void 0) parts.push(arch);\n\tconst base = `${SDK_PRODUCT}/${VERSION} (${parts.join(\"; \")})`;\n\treturn custom ? `${custom} ${base}` : base;\n}\n//#endregion\nexport { SDK_PACKAGE, SDK_PRODUCT, getUserAgent };\n\n//# sourceMappingURL=user-agent.js.map","import { B2Error, B2RedirectError, B2SsrfError, ExpiredAuthTokenError, NetworkError, classifyError } from \"../errors/index.js\";\nimport { DEFAULT_RETRY_OPTIONS, computeBackoff, sleep } from \"./retry.js\";\nimport { UrlGuard } from \"./url-guard.js\";\nimport { getUserAgent } from \"./user-agent.js\";\n//#region src/http/transport.ts\nvar REDIRECT_STATUSES = /* @__PURE__ */ new Set([\n\t301,\n\t302,\n\t303,\n\t307,\n\t308\n]);\nvar MAX_SAME_ORIGIN_REDIRECTS = 5;\n/**\n* Default transport implementation using the global `fetch` API.\n* Automatically sets the User-Agent header on each request and applies the\n* SSRF {@link UrlGuard} (if configured) before opening the connection.\n* Redirect following is disabled so redirected URLs cannot bypass the guard or\n* receive credential-bearing headers without an explicit checked request.\n*/\nvar FetchTransport = class {\n\t/** User-Agent string sent with every request. */\n\tuserAgent;\n\t/** Whether same-origin GET/HEAD redirects should be followed after guard checks. */\n\tfollowSameOriginRedirects;\n\t/** SSRF allow-list applied to every outgoing URL. Mutable so `B2Client.authorize()` can lock it down post-auth. */\n\turlGuard;\n\t/**\n\t* Creates a new FetchTransport.\n\t* @param options - Optional configuration: custom User-Agent prefix and SSRF guard.\n\t*/\n\tconstructor(options) {\n\t\tthis.userAgent = getUserAgent(options?.userAgent);\n\t\tthis.followSameOriginRedirects = options?.followSameOriginRedirects ?? true;\n\t\tthis.urlGuard = options?.urlGuard ?? new UrlGuard();\n\t}\n\t/**\n\t* Sends the request using the global `fetch` function.\n\t* @param request - The HTTP request to execute.\n\t*\n\t* @returns The HTTP response.\n\t*\n\t* @throws B2SsrfError when the URL fails the configured SSRF guard.\n\t* @throws B2RedirectError when a response attempts to redirect.\n\t*/\n\tasync send(request) {\n\t\tlet currentRequest = request;\n\t\tlet redirectCount = 0;\n\t\twhile (true) {\n\t\t\tthis.urlGuard.check(currentRequest.url);\n\t\t\tconst headers = new Headers(currentRequest.headers);\n\t\t\tif (!headers.has(\"User-Agent\")) headers.set(\"User-Agent\", this.userAgent);\n\t\t\tconst timeoutScope = createRequestTimeoutScope(currentRequest);\n\t\t\tlet response;\n\t\t\ttry {\n\t\t\t\tresponse = await fetch(currentRequest.url, {\n\t\t\t\t\tmethod: currentRequest.method,\n\t\t\t\t\theaders,\n\t\t\t\t\tbody: currentRequest.body ?? null,\n\t\t\t\t\tredirect: \"manual\",\n\t\t\t\t\t...timeoutScope.signal !== void 0 ? { signal: timeoutScope.signal } : {}\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\ttimeoutScope.dispose();\n\t\t\t\tif (timeoutScope.timedOut) throw createRequestTimeoutError(timeoutScope);\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif (isBlockedRedirect(response)) {\n\t\t\t\tconst location = response.headers.get(\"Location\");\n\t\t\t\tif (this.followSameOriginRedirects && location !== null && redirectCount < MAX_SAME_ORIGIN_REDIRECTS && canFollowSameOriginRedirect(currentRequest, location)) {\n\t\t\t\t\tconst nextUrl = new URL(location, currentRequest.url).toString();\n\t\t\t\t\tawait cancelResponseBody(response);\n\t\t\t\t\ttimeoutScope.dispose();\n\t\t\t\t\tthis.urlGuard.check(nextUrl);\n\t\t\t\t\tcurrentRequest = {\n\t\t\t\t\t\t...currentRequest,\n\t\t\t\t\t\turl: nextUrl\n\t\t\t\t\t};\n\t\t\t\t\tredirectCount += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tawait cancelResponseBody(response);\n\t\t\t\ttimeoutScope.dispose();\n\t\t\t\tthrow new B2RedirectError(currentRequest.url, response.status, location);\n\t\t\t}\n\t\t\treturn createTimedHttpResponse(response, timeoutScope);\n\t\t}\n\t}\n};\nfunction createRequestTimeoutScope(request) {\n\tconst timeoutMs = request.retry?.requestTimeoutMs ?? DEFAULT_RETRY_OPTIONS.requestTimeoutMs;\n\tif (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {\n\t\tconst scope = {\n\t\t\ttimeoutMs: 0,\n\t\t\ttimedOut: false,\n\t\t\treset() {},\n\t\t\tdispose() {}\n\t\t};\n\t\tif (request.signal !== void 0) return {\n\t\t\t...scope,\n\t\t\tsignal: request.signal\n\t\t};\n\t\treturn scope;\n\t}\n\tconst controller = new AbortController();\n\tlet timedOut = false;\n\tlet timer;\n\tconst abortFromUpstream = () => {\n\t\tclearTimeout(timer);\n\t\tcontroller.abort(request.signal?.reason ?? new DOMException(\"Aborted\", \"AbortError\"));\n\t};\n\tconst armTimer = () => {\n\t\tconst nextTimer = setTimeout(() => {\n\t\t\ttimedOut = true;\n\t\t\tcontroller.abort(new DOMException(\"HTTP request timed out\", \"TimeoutError\"));\n\t\t}, timeoutMs);\n\t\tunrefTimer(nextTimer);\n\t\treturn nextTimer;\n\t};\n\ttimer = armTimer();\n\tconst reset = () => {\n\t\tif (timedOut || controller.signal.aborted) return;\n\t\tclearTimeout(timer);\n\t\ttimer = armTimer();\n\t};\n\tif (request.signal?.aborted === true) {\n\t\tclearTimeout(timer);\n\t\tabortFromUpstream();\n\t} else request.signal?.addEventListener(\"abort\", abortFromUpstream, { once: true });\n\treturn {\n\t\tsignal: controller.signal,\n\t\ttimeoutMs,\n\t\tget timedOut() {\n\t\t\treturn timedOut;\n\t\t},\n\t\treset,\n\t\tdispose() {\n\t\t\tclearTimeout(timer);\n\t\t\trequest.signal?.removeEventListener(\"abort\", abortFromUpstream);\n\t\t}\n\t};\n}\nfunction unrefTimer(timer) {\n\tconst maybeUnref = timer.unref;\n\tif (typeof maybeUnref === \"function\") maybeUnref.call(timer);\n}\nfunction createRequestTimeoutError(scope) {\n\treturn new DOMException(`HTTP request timed out after ${scope.timeoutMs} ms`, \"TimeoutError\");\n}\nfunction createTimedHttpResponse(response, timeoutScope) {\n\tconst body = response.body;\n\tif (body === null) timeoutScope.dispose();\n\tlet timedBody;\n\treturn {\n\t\tstatus: response.status,\n\t\theaders: response.headers,\n\t\tget body() {\n\t\t\tif (body === null) return null;\n\t\t\ttimedBody ??= createTimedResponseBody(body, timeoutScope);\n\t\t\treturn timedBody;\n\t\t},\n\t\tjson: () => readTimedResponseBody(timeoutScope, response, () => response.json()),\n\t\ttext: () => readTimedResponseBody(timeoutScope, response, () => response.text()),\n\t\tarrayBuffer: () => readTimedResponseBody(timeoutScope, response, () => response.arrayBuffer())\n\t};\n}\nasync function readTimedResponseBody(timeoutScope, response, read) {\n\ttry {\n\t\treturn await raceBodyReadWithAbort(timeoutScope, read(), (reason) => cancelResponseBody(response, reason));\n\t} catch (err) {\n\t\tif (timeoutScope.timedOut) throw createRequestTimeoutError(timeoutScope);\n\t\tthrow err;\n\t} finally {\n\t\ttimeoutScope.dispose();\n\t}\n}\nfunction createTimedResponseBody(body, timeoutScope) {\n\tlet reader;\n\tlet disposed = false;\n\tconst dispose = () => {\n\t\tif (disposed) return;\n\t\tdisposed = true;\n\t\ttimeoutScope.dispose();\n\t};\n\treturn new ReadableStream({\n\t\tasync pull(controller) {\n\t\t\treader ??= body.getReader();\n\t\t\ttry {\n\t\t\t\tconst result = await raceBodyReadWithAbort(timeoutScope, reader.read(), (reason) => reader?.cancel(reason));\n\t\t\t\tif (result.done) {\n\t\t\t\t\tdispose();\n\t\t\t\t\tcontroller.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttimeoutScope.reset();\n\t\t\t\tcontroller.enqueue(result.value);\n\t\t\t} catch (err) {\n\t\t\t\tdispose();\n\t\t\t\tif (timeoutScope.timedOut) {\n\t\t\t\t\tcontroller.error(createRequestTimeoutError(timeoutScope));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontroller.error(err);\n\t\t\t}\n\t\t},\n\t\tasync cancel(reason) {\n\t\t\tdispose();\n\t\t\ttry {\n\t\t\t\tif (reader !== void 0) {\n\t\t\t\t\tawait reader.cancel(reason);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tawait body.cancel(reason);\n\t\t\t} catch {}\n\t\t}\n\t});\n}\nasync function raceBodyReadWithAbort(timeoutScope, read, abortCleanup) {\n\tconst signal = timeoutScope.signal;\n\tif (signal === void 0) return read;\n\tconst abortReason = () => signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\tif (signal.aborted) {\n\t\tread.catch(() => {});\n\t\tconst reason = abortReason();\n\t\tawait runAbortCleanup(abortCleanup, reason);\n\t\tthrow reason;\n\t}\n\tlet removeAbortListener;\n\tconst abort = new Promise((_, reject) => {\n\t\tconst onAbort = () => {\n\t\t\tconst reason = abortReason();\n\t\t\tread.catch(() => {});\n\t\t\treject(reason);\n\t\t\trunAbortCleanup(abortCleanup, reason);\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\treturn await Promise.race([read, abort]);\n\t} finally {\n\t\tremoveAbortListener?.();\n\t}\n}\nasync function runAbortCleanup(abortCleanup, reason) {\n\ttry {\n\t\tawait abortCleanup?.(reason);\n\t} catch {}\n}\nfunction isBlockedRedirect(response) {\n\treturn response.type === \"opaqueredirect\" || REDIRECT_STATUSES.has(response.status);\n}\nfunction canFollowSameOriginRedirect(request, location) {\n\tif (request.method !== \"GET\" && request.method !== \"HEAD\") return false;\n\ttry {\n\t\treturn new URL(request.url).origin === new URL(location, request.url).origin;\n\t} catch {\n\t\treturn false;\n\t}\n}\nasync function cancelResponseBody(response, reason) {\n\ttry {\n\t\tawait response.body?.cancel(reason);\n\t} catch {}\n}\n/**\n* Decide whether `url` points at a URL-pinned upload POST endpoint.\n*\n* @param url - Request URL to inspect.\n*\n* @returns Whether the request is a direct upload endpoint.\n*/\nfunction isUploadEndpoint(url) {\n\tconst endpoint = b2ApiEndpointName(url);\n\treturn endpoint === \"b2_upload_file\" || endpoint === \"b2_upload_part\";\n}\nfunction isFinishLargeFileEndpoint(url) {\n\treturn b2ApiEndpointName(url) === \"b2_finish_large_file\";\n}\nfunction isStartLargeFileEndpoint(url) {\n\treturn b2ApiEndpointName(url) === \"b2_start_large_file\";\n}\nfunction b2ApiEndpointName(url) {\n\tconst [, root, , endpoint] = new URL(url).pathname.split(\"/\");\n\tif (root !== \"b2api\") return void 0;\n\treturn endpoint;\n}\nfunction isReplayUnsafePostEndpoint(url) {\n\treturn isUploadEndpoint(url) || isStartLargeFileEndpoint(url) || isFinishLargeFileEndpoint(url);\n}\n/**\n* Decide whether a classified error should be retried in place for `url`.\n* Transient errors normally retry; upload endpoints bubble to the upload layer\n* for fresh-URL retry except account-level 429 throttling, where fetching a new\n* upload URL only amplifies the rate limit.\n*\n* @param error - The classified, retryability-tagged error.\n* @param url - The request URL (used to detect upload endpoints).\n*\n* @returns Whether to retry the request in place.\n*/\nfunction shouldRetryInPlace(error, url) {\n\tif (!error.retryable) return false;\n\tif (isStartLargeFileEndpoint(url) || isFinishLargeFileEndpoint(url)) return false;\n\tif (isUploadEndpoint(url) && error.status === 429) return true;\n\tif (isUploadEndpoint(url)) return false;\n\treturn true;\n}\nfunction isRequestTimeoutError(err) {\n\treturn err instanceof DOMException && err.name === \"TimeoutError\";\n}\nfunction isTerminalTransportError(err) {\n\treturn err instanceof B2Error || err instanceof B2RedirectError || err instanceof NetworkError || err instanceof B2SsrfError || err instanceof DOMException && err.name === \"AbortError\";\n}\n/**\n* Transport wrapper that adds automatic retry with exponential backoff.\n* Handles transient errors (408, 429, and the transient 5xx set 500/502/503/504),\n* expired auth tokens, and network failures. Delegates to an inner\n* {@link HttpTransport}.\n*\n* Upload endpoints (`b2_upload_file` / `b2_upload_part`) are URL-pinned. Their\n* retryable pod failures bubble to the upload layer, which evicts the failed\n* URL, fetches a fresh one, and retries there. HTTP 429 remains an in-place\n* retry so account-level throttling does not trigger extra upload URL fetches.\n*/\nvar RetryTransport = class {\n\t/** The wrapped transport that performs actual HTTP requests. */\n\tinner;\n\t/** Resolved retry options (defaults merged with user overrides). */\n\toptions;\n\t/** Optional callback to refresh auth credentials on 401 — returns the fresh token. */\n\tonReauth;\n\t/** Sleep implementation used between retries; injectable for tests. */\n\tsleepImpl;\n\t/**\n\t* Creates a new RetryTransport.\n\t* @param opts - Retry transport configuration.\n\t*/\n\tconstructor(opts) {\n\t\tthis.inner = opts.transport;\n\t\tthis.options = {\n\t\t\t...DEFAULT_RETRY_OPTIONS,\n\t\t\t...opts.retry\n\t\t};\n\t\tif (opts.onReauth !== void 0) this.onReauth = opts.onReauth;\n\t\tthis.sleepImpl = opts.sleepImpl ?? sleep;\n\t}\n\t/**\n\t* Sends the request with automatic retry on transient failures.\n\t* On expired auth tokens, calls {@link RetryTransportOptions.onReauth} and retries.\n\t* @param originalRequest - The HTTP request to execute. The caller's\n\t* reference is not mutated; on reauth, a copy with a refreshed\n\t* Authorization header is sent.\n\t*\n\t* @returns The HTTP response.\n\t*/\n\tasync send(originalRequest) {\n\t\tlet request = originalRequest;\n\t\tconst retryOptions = {\n\t\t\t...this.options,\n\t\t\t...originalRequest.retry\n\t\t};\n\t\tlet lastError;\n\t\tlet didReauth = false;\n\t\tlet attempt = 0;\n\t\twhile (attempt <= retryOptions.maxRetries) {\n\t\t\tthrowIfSignalAborted(request.signal);\n\t\t\tif (attempt > 0 && lastError) {\n\t\t\t\tconst retryAfter = lastError instanceof NetworkError ? void 0 : lastError.retryAfter;\n\t\t\t\tconst delay = computeBackoff(attempt - 1, retryOptions, retryAfter);\n\t\t\t\tawait this.sleepImpl(delay, request.signal);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await this.inner.send({\n\t\t\t\t\t...request,\n\t\t\t\t\tretry: retryOptions\n\t\t\t\t});\n\t\t\t\tawait throwIfSignalAbortedAfterResponse(request.signal, response);\n\t\t\t\tif (response.status >= 200 && response.status < 300) return response;\n\t\t\t\tlet errorBody;\n\t\t\t\ttry {\n\t\t\t\t\terrorBody = await response.json();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (isRequestTimeoutError(err)) throw err;\n\t\t\t\t\terrorBody = {\n\t\t\t\t\t\tstatus: response.status,\n\t\t\t\t\t\tcode: \"internal_error\",\n\t\t\t\t\t\tmessage: `HTTP ${response.status}`\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst retryAfterHeader = response.headers.get(\"Retry-After\");\n\t\t\t\tconst retryAfterSec = retryAfterHeader ? Number.parseInt(retryAfterHeader, 10) : void 0;\n\t\t\t\tconst requestId = response.headers.get(\"X-Bz-Request-Id\") ?? void 0;\n\t\t\t\tconst error = classifyError(errorBody, {\n\t\t\t\t\t...retryAfterSec !== void 0 ? { retryAfter: retryAfterSec } : {},\n\t\t\t\t\t...requestId !== void 0 ? { requestId } : {}\n\t\t\t\t});\n\t\t\t\tif (error instanceof ExpiredAuthTokenError && this.onReauth && !isUploadEndpoint(request.url) && !didReauth) {\n\t\t\t\t\tconst freshToken = await this.onReauth();\n\t\t\t\t\trequest = {\n\t\t\t\t\t\t...request,\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t...request.headers ?? {},\n\t\t\t\t\t\t\tAuthorization: freshToken\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tdidReauth = true;\n\t\t\t\t\tlastError = void 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!shouldRetryInPlace(error, request.url) || attempt === retryOptions.maxRetries) throw error;\n\t\t\t\tlastError = error;\n\t\t\t\tattempt += 1;\n\t\t\t} catch (err) {\n\t\t\t\tthrowIfSignalAborted(request.signal);\n\t\t\t\tif (isTerminalTransportError(err)) throw err;\n\t\t\t\tconst networkErr = new NetworkError(err instanceof Error ? err.message : \"Network error\", err);\n\t\t\t\tif (isReplayUnsafePostEndpoint(request.url) || attempt === retryOptions.maxRetries) throw networkErr;\n\t\t\t\tlastError = networkErr;\n\t\t\t\tattempt += 1;\n\t\t\t}\n\t\t}\n\t\tthrow lastError ?? new NetworkError(\"Max retries exceeded\");\n\t}\n};\nfunction throwIfSignalAborted(signal) {\n\tif (signal?.aborted === true) throw signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\nasync function throwIfSignalAbortedAfterResponse(signal, response) {\n\tif (signal?.aborted !== true) return;\n\tconst reason = signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\ttry {\n\t\tawait response.body?.cancel(reason);\n\t} catch {}\n\tthrow reason;\n}\n//#endregion\nexport { FetchTransport, RetryTransport };\n\n//# sourceMappingURL=transport.js.map","import { FinishLargeFileResponseBodyError, UploadResponseBodyError } from \"../errors/index.js\";\nimport { buildFileInfoHeaders, decodeFileName, encodeFileName, parseFileInfoHeaders } from \"./encoding.js\";\nimport { normalizeFileVersionListSha1, normalizeFileVersionSha1 } from \"../util/normalize.js\";\nimport { EncryptionAlgorithm, EncryptionMode } from \"../types/encryption.js\";\nimport { assertSecureRealmUrl } from \"../auth/realms.js\";\n//#region src/raw/index.ts\n/**\n* Low-level 1:1 bindings for every B2 native API endpoint.\n*\n* Each method on {@link RawClient} maps directly to a single `b2_*` HTTP call\n* with fully typed request and response objects. No retry logic, no URL pooling,\n* no automatic reauthorization. Use this when you need precise control over\n* individual API calls; for most use cases prefer the high-level `B2Client`.\n*\n* @packageDocumentation\n*/\nfunction normalizeRawRequestOptions(optionsOrSignal, retry) {\n\tif (optionsOrSignal === void 0) return retry === void 0 ? void 0 : { retry };\n\tif (isAbortSignal(optionsOrSignal)) return {\n\t\tsignal: optionsOrSignal,\n\t\t...retry !== void 0 ? { retry } : {}\n\t};\n\treturn retry === void 0 ? optionsOrSignal : {\n\t\t...optionsOrSignal,\n\t\tretry\n\t};\n}\nfunction isAbortSignal(value) {\n\treturn typeof value === \"object\" && value !== null && \"aborted\" in value && typeof value.addEventListener === \"function\";\n}\nfunction normalizeCreateKeyRequest(request) {\n\tconst { bucketId, ...withoutDeprecatedBucketId } = request;\n\tif (bucketId !== void 0 && withoutDeprecatedBucketId.bucketIds !== void 0) throw new TypeError(\"createKey accepts either bucketIds or deprecated bucketId, not both\");\n\tif (bucketId === void 0) return withoutDeprecatedBucketId;\n\treturn {\n\t\t...withoutDeprecatedBucketId,\n\t\tbucketIds: [bucketId]\n\t};\n}\nfunction singleBucketId(bucketIds) {\n\treturn bucketIds?.length === 1 ? bucketIds[0] ?? null : null;\n}\nfunction normalizeKeyResponse(key) {\n\treturn {\n\t\t...key,\n\t\tbucketId: singleBucketId(key.bucketIds)\n\t};\n}\nfunction normalizeAllowedBuckets(storageApi) {\n\tconst allowed = storageApi.allowed;\n\tif (allowed?.buckets !== void 0) return allowed.buckets === null ? null : allowed.buckets.map((bucket) => ({ ...bucket }));\n\tconst bucketId = allowed?.bucketId ?? storageApi.bucketId ?? null;\n\tif (bucketId === null) return null;\n\treturn [{\n\t\tid: bucketId,\n\t\tname: allowed?.bucketName ?? storageApi.bucketName ?? null\n\t}];\n}\nfunction normalizeAuthorizeAccountResponse(response) {\n\tconst storageApi = response.apiInfo.storageApi;\n\tconst allowed = storageApi.allowed;\n\tconst buckets = normalizeAllowedBuckets(storageApi);\n\tconst singleBucket = buckets?.length === 1 ? buckets[0] : void 0;\n\tconst bucketId = singleBucket?.id ?? null;\n\tconst bucketName = singleBucket?.name ?? null;\n\tconst namePrefix = allowed?.namePrefix ?? storageApi.namePrefix ?? null;\n\tconst capabilities = allowed?.capabilities ?? storageApi.capabilities ?? [];\n\tconst { allowed: _wireAllowed, capabilities: _legacyCapabilities, ...storageApiBase } = storageApi;\n\treturn {\n\t\t...response,\n\t\tapiInfo: {\n\t\t\t...response.apiInfo,\n\t\t\tstorageApi: {\n\t\t\t\t...storageApiBase,\n\t\t\t\tbucketId,\n\t\t\t\tbucketName,\n\t\t\t\tdownloadUrl: storageApi.downloadUrl,\n\t\t\t\tinfoType: \"storageApi\",\n\t\t\t\tnamePrefix,\n\t\t\t\tallowed: {\n\t\t\t\t\t...allowed ?? {},\n\t\t\t\t\tcapabilities,\n\t\t\t\t\tbuckets,\n\t\t\t\t\tbucketId,\n\t\t\t\t\tbucketName,\n\t\t\t\t\tnamePrefix\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction uploadResponseBodyError(err, signal) {\n\tif (signal?.aborted === true) throw signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n\treturn new UploadResponseBodyError(err instanceof Error ? err.message : \"Upload response body could not be read\", { cause: err });\n}\n/**\n* Low-level client providing 1:1 bindings to all B2 native API endpoints.\n*\n* Each method maps directly to a single B2 API call. Most methods accept\n* `(apiUrl, authToken, request)` and return the JSON response. Upload and\n* download methods accept endpoint-specific parameters instead.\n*/\nvar RawClient = class {\n\t/** @internal */\n\ttransport;\n\t/**\n\t* Creates a new RawClient with the given transport.\n\t* @param options - The constructor configuration.\n\t*/\n\tconstructor(options) {\n\t\tthis.transport = options.transport;\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}.\n\t* @param applicationKeyId - The application key ID for authentication.\n\t* @param applicationKey - The application key secret.\n\t* @param realmUrl - The B2 realm URL to authenticate against.\n\t*\n\t* @returns The authorization response with API URLs and credentials.\n\t*/\n\tasync authorizeAccount(applicationKeyId, applicationKey, realmUrl = \"https://api.backblazeb2.com\") {\n\t\tassertSecureRealmUrl(realmUrl);\n\t\treturn normalizeAuthorizeAccountResponse(await (await this.transport.send({\n\t\t\turl: `${realmUrl}/b2api/v4/b2_authorize_account`,\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}` }\n\t\t})).json());\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The created bucket metadata.\n\t*/\n\tasync createBucket(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_create_bucket\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The deleted bucket metadata.\n\t*/\n\tasync deleteBucket(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_delete_bucket\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The list of matching buckets.\n\t*/\n\tasync listBuckets(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_list_buckets\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The updated bucket metadata.\n\t*/\n\tasync updateBucket(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_update_bucket\", request);\n\t}\n\t/**\n\t* Implementation for both upload URL request-control signatures.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param optionsOrSignal - Options bag or legacy abort signal.\n\t* @param retry - Optional legacy per-request retry override.\n\t*\n\t* @returns The upload URL and authorization token.\n\t*/\n\tasync getUploadUrl(apiUrl, authToken, request, optionsOrSignal, retry) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_get_upload_url\", request, normalizeRawRequestOptions(optionsOrSignal, retry));\n\t}\n\t/**\n\t* Implementation for both upload-file request-control signatures.\n\t* @param uploadUrl - The upload endpoint URL.\n\t* @param headers - The request headers including authorization and content metadata.\n\t* @param body - The file data to upload.\n\t* @param optionsOrSignal - Options bag or legacy abort signal.\n\t* @param retry - Optional legacy per-request retry override.\n\t*\n\t* @returns The uploaded file version metadata.\n\t*/\n\tasync uploadFile(uploadUrl, headers, body, optionsOrSignal, retry) {\n\t\tconst options = normalizeRawRequestOptions(optionsOrSignal, retry);\n\t\tconst reqHeaders = {\n\t\t\tAuthorization: headers.authorization,\n\t\t\t\"X-Bz-File-Name\": encodeFileName(headers.fileName),\n\t\t\t\"Content-Type\": headers.contentType,\n\t\t\t\"Content-Length\": String(headers.contentLength),\n\t\t\t\"X-Bz-Content-Sha1\": headers.contentSha1,\n\t\t\t...buildFileInfoHeaders(headers.fileInfo)\n\t\t};\n\t\tif (headers.lastModifiedMillis !== void 0) reqHeaders[\"X-Bz-Info-src_last_modified_millis\"] = String(headers.lastModifiedMillis);\n\t\tif (headers.contentDisposition) reqHeaders[\"X-Bz-Info-b2-content-disposition\"] = headers.contentDisposition;\n\t\tif (headers.contentLanguage) reqHeaders[\"X-Bz-Info-b2-content-language\"] = headers.contentLanguage;\n\t\tif (headers.expires) reqHeaders[\"X-Bz-Info-b2-expires\"] = headers.expires;\n\t\tif (headers.cacheControl) reqHeaders[\"X-Bz-Info-b2-cache-control\"] = headers.cacheControl;\n\t\tif (headers.contentEncoding) reqHeaders[\"X-Bz-Info-b2-content-encoding\"] = headers.contentEncoding;\n\t\tapplyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n\t\tapplyRetentionHeaders(reqHeaders, headers.fileRetention);\n\t\tapplyLegalHoldHeader(reqHeaders, headers.legalHold);\n\t\tconst response = await this.transport.send({\n\t\t\turl: uploadUrl,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: reqHeaders,\n\t\t\tbody,\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options?.retry !== void 0 ? { retry: options.retry } : {}\n\t\t});\n\t\ttry {\n\t\t\treturn normalizeFileVersionSha1(await response.json());\n\t\t} catch (err) {\n\t\t\tthrow uploadResponseBodyError(err, options?.signal);\n\t\t}\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns The list of file names and optional continuation token.\n\t*/\n\tasync listFileNames(apiUrl, authToken, request, options) {\n\t\treturn normalizeFileVersionListSha1(await this.postJson(apiUrl, authToken, \"b2_list_file_names\", request, options));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns The list of file versions and optional continuation token.\n\t*/\n\tasync listFileVersions(apiUrl, authToken, request, options) {\n\t\treturn normalizeFileVersionListSha1(await this.postJson(apiUrl, authToken, \"b2_list_file_versions\", request, options));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The file version metadata.\n\t*/\n\tasync getFileInfo(apiUrl, authToken, request) {\n\t\treturn normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, \"b2_get_file_info\", request));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns The hidden file version metadata.\n\t*/\n\tasync hideFile(apiUrl, authToken, request, options) {\n\t\treturn normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, \"b2_hide_file\", request, options));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns The deleted file version identifier.\n\t*/\n\tasync deleteFileVersion(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_delete_file_version\", request, options);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as an abort signal.\n\t*\n\t* @returns The copied file version metadata.\n\t*/\n\tasync copyFile(apiUrl, authToken, request, options) {\n\t\treturn normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, \"b2_copy_file\", request, options));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional abort and retry controls.\n\t*\n\t* @returns The copied part metadata.\n\t*/\n\tasync copyPart(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_copy_part\", request, options);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional abort and retry controls.\n\t*\n\t* @returns The started large file metadata with file ID.\n\t*/\n\tasync startLargeFile(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_start_large_file\", request, options);\n\t}\n\t/**\n\t* Implementation for both upload part URL request-control signatures.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param optionsOrSignal - Options bag or legacy abort signal.\n\t* @param retry - Optional legacy per-request retry override.\n\t*\n\t* @returns The upload part URL and authorization token.\n\t*/\n\tasync getUploadPartUrl(apiUrl, authToken, request, optionsOrSignal, retry) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_get_upload_part_url\", request, normalizeRawRequestOptions(optionsOrSignal, retry));\n\t}\n\t/**\n\t* Implementation for both upload-part request-control signatures.\n\t* @param uploadUrl - The upload endpoint URL.\n\t* @param headers - The request headers including authorization and content metadata.\n\t* @param body - The file data to upload.\n\t* @param optionsOrSignal - Options bag or legacy abort signal.\n\t* @param retry - Optional legacy per-request retry override.\n\t*\n\t* @returns The uploaded part metadata.\n\t*/\n\tasync uploadPart(uploadUrl, headers, body, optionsOrSignal, retry) {\n\t\tconst options = normalizeRawRequestOptions(optionsOrSignal, retry);\n\t\tconst reqHeaders = {\n\t\t\tAuthorization: headers.authorization,\n\t\t\t\"X-Bz-Part-Number\": String(headers.partNumber),\n\t\t\t\"Content-Length\": String(headers.contentLength),\n\t\t\t\"X-Bz-Content-Sha1\": headers.contentSha1\n\t\t};\n\t\tapplyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);\n\t\tconst response = await this.transport.send({\n\t\t\turl: uploadUrl,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: reqHeaders,\n\t\t\tbody,\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options?.retry !== void 0 ? { retry: options.retry } : {}\n\t\t});\n\t\ttry {\n\t\t\treturn await response.json();\n\t\t} catch (err) {\n\t\t\tthrow uploadResponseBodyError(err, options?.signal);\n\t\t}\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional abort and retry controls.\n\t*\n\t* @returns The completed file version metadata.\n\t*/\n\tasync finishLargeFile(apiUrl, authToken, request, options) {\n\t\tconst response = await this.transport.send({\n\t\t\turl: `${apiUrl}/b2api/v3/b2_finish_large_file`,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\tAuthorization: authToken,\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(request),\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options?.retry !== void 0 ? { retry: options.retry } : {}\n\t\t});\n\t\tlet fileVersion;\n\t\ttry {\n\t\t\tfileVersion = await response.json();\n\t\t} catch (err) {\n\t\t\tthrow new FinishLargeFileResponseBodyError(err instanceof Error ? err.message : \"Finish large file response body could not be read\", {\n\t\t\t\tcause: err,\n\t\t\t\tfileId: request.fileId\n\t\t\t});\n\t\t}\n\t\treturn normalizeFileVersionSha1(fileVersion);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as cancellation and retry overrides.\n\t*\n\t* @returns The cancelled large file metadata.\n\t*/\n\tasync cancelLargeFile(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_cancel_large_file\", request, options);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as cancellation and retry.\n\t*\n\t* @returns The list of unfinished large files and optional continuation token.\n\t*/\n\tasync listUnfinishedLargeFiles(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_list_unfinished_large_files\", request, options);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t* @param options - Optional request controls such as cancellation and retry.\n\t*\n\t* @returns The list of uploaded parts and optional continuation token.\n\t*/\n\tasync listParts(apiUrl, authToken, request, options) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_list_parts\", request, options);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}.\n\t* @param downloadUrl - The B2 download base URL.\n\t* @param authToken - The authorization token.\n\t* @param fileId - The unique identifier of the file to download.\n\t* @param options - Optional download parameters for range requests and cancellation.\n\t*\n\t* @returns The response headers, streaming body, and HTTP status code.\n\t*/\n\tasync downloadFileById(downloadUrl, authToken, fileId, options) {\n\t\tconst headers = buildDownloadRequestHeaders(authToken, options);\n\t\tconst url = appendDownloadOverrides(`${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`, options);\n\t\tconst response = await this.transport.send({\n\t\t\turl,\n\t\t\tmethod: options?.method ?? \"GET\",\n\t\t\theaders,\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {}\n\t\t});\n\t\treturn {\n\t\t\theaders: response.headers,\n\t\t\tbody: response.body,\n\t\t\tstatus: response.status\n\t\t};\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}.\n\t* @param downloadUrl - The B2 download base URL.\n\t* @param authToken - The authorization token.\n\t* @param bucketName - The name of the bucket containing the file.\n\t* @param fileName - The name of the file to download.\n\t* @param options - Optional download parameters for range requests and cancellation.\n\t*\n\t* @returns The response headers, streaming body, and HTTP status code.\n\t*/\n\tasync downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) {\n\t\tconst headers = buildDownloadRequestHeaders(authToken, options);\n\t\tconst url = appendDownloadOverrides(`${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileName(fileName)}`, options);\n\t\tconst response = await this.transport.send({\n\t\t\turl,\n\t\t\tmethod: options?.method ?? \"GET\",\n\t\t\theaders,\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {}\n\t\t});\n\t\treturn {\n\t\t\theaders: response.headers,\n\t\t\tbody: response.body,\n\t\t\tstatus: response.status\n\t\t};\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The current session authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The download authorization token for the specified file prefix.\n\t*/\n\tasync getDownloadAuthorization(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_get_download_authorization\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The newly created application key with secret.\n\t*/\n\tasync createKey(apiUrl, authToken, request) {\n\t\treturn normalizeKeyResponse(await this.postJson(apiUrl, authToken, \"b2_create_key\", normalizeCreateKeyRequest(request), void 0, \"v4\"));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The list of application keys and optional continuation token.\n\t*/\n\tasync listKeys(apiUrl, authToken, request) {\n\t\tconst response = await this.postJson(apiUrl, authToken, \"b2_list_keys\", request, void 0, \"v4\");\n\t\treturn {\n\t\t\t...response,\n\t\t\tkeys: response.keys.map((key) => normalizeKeyResponse(key))\n\t\t};\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The deleted application key metadata.\n\t*/\n\tasync deleteKey(apiUrl, authToken, request) {\n\t\treturn normalizeKeyResponse(await this.postJson(apiUrl, authToken, \"b2_delete_key\", request, void 0, \"v4\"));\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The updated file retention settings.\n\t*/\n\tasync updateFileRetention(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_update_file_retention\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The updated file legal hold status.\n\t*/\n\tasync updateFileLegalHold(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_update_file_legal_hold\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The configured event notification rules for the specified bucket.\n\t*/\n\tasync getBucketNotificationRules(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_get_bucket_notification_rules\", request);\n\t}\n\t/**\n\t* Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param request - The API request parameters.\n\t*\n\t* @returns The updated bucket notification rules.\n\t*/\n\tasync setBucketNotificationRules(apiUrl, authToken, request) {\n\t\treturn this.postJson(apiUrl, authToken, \"b2_set_bucket_notification_rules\", request);\n\t}\n\t/**\n\t* Sends a JSON POST request to the specified B2 API endpoint.\n\t* @param apiUrl - The B2 API base URL.\n\t* @param authToken - The authorization token.\n\t* @param endpoint - The B2 API endpoint name.\n\t* @param body - The JSON request body.\n\t* @param options - Optional abort and per-request retry settings.\n\t* @param apiVersion - B2 Native API version segment for this endpoint.\n\t*\n\t* @returns The parsed JSON response.\n\t*/\n\tasync postJson(apiUrl, authToken, endpoint, body, options, apiVersion = \"v3\") {\n\t\treturn (await this.transport.send({\n\t\t\turl: `${apiUrl}/b2api/${apiVersion}/${endpoint}`,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\tAuthorization: authToken,\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(body),\n\t\t\t...options?.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options?.retry !== void 0 ? { retry: options.retry } : {}\n\t\t})).json();\n\t}\n};\n/**\n* Applies server-side encryption headers to the request.\n* @param headers - The mutable headers object to populate.\n* @param encryption - The encryption settings, or undefined to skip.\n*/\nfunction applyEncryptionHeaders(headers, encryption) {\n\tif (!encryption || encryption.mode === EncryptionMode.None) return;\n\tif (encryption.mode === EncryptionMode.SseB2) headers[\"X-Bz-Server-Side-Encryption\"] = EncryptionAlgorithm.Aes256;\n\telse if (encryption.mode === EncryptionMode.SseC) {\n\t\theaders[\"X-Bz-Server-Side-Encryption-Customer-Algorithm\"] = EncryptionAlgorithm.Aes256;\n\t\theaders[\"X-Bz-Server-Side-Encryption-Customer-Key\"] = encryption.customerKey;\n\t\theaders[\"X-Bz-Server-Side-Encryption-Customer-Key-Md5\"] = encryption.customerKeyMd5;\n\t}\n}\nvar DOWNLOAD_OVERRIDE_PARAMS = [\n\t\"b2ContentDisposition\",\n\t\"b2ContentLanguage\",\n\t\"b2ContentEncoding\",\n\t\"b2ContentType\",\n\t\"b2CacheControl\",\n\t\"b2Expires\"\n];\n/**\n* Builds the HTTP request headers for a download: Authorization, optional\n* Range, and optional SSE-C decryption headers.\n*\n* @param authToken - The B2 session authorization token.\n* @param options - Caller-supplied download options.\n*\n* @returns The header map to send with the request.\n*/\nfunction buildDownloadRequestHeaders(authToken, options) {\n\tconst headers = { Authorization: authToken };\n\tif (options?.range) headers[\"Range\"] = options.range;\n\tif (options?.serverSideEncryption) applyEncryptionHeaders(headers, {\n\t\tmode: EncryptionMode.SseC,\n\t\t...options.serverSideEncryption\n\t});\n\treturn headers;\n}\n/**\n* Appends the documented `b2Content*` response-header overrides to a download\n* URL as query-string parameters. B2 echoes the values into the response\n* headers so callers can control content type, disposition, and caching.\n*\n* @param url - The base download URL.\n* @param options - Caller-supplied download options.\n*\n* @returns The URL with any override parameters appended.\n*/\nfunction appendDownloadOverrides(url, options) {\n\tif (!options) return url;\n\tconst params = [];\n\tfor (const key of DOWNLOAD_OVERRIDE_PARAMS) {\n\t\tconst value = options[key];\n\t\tif (value !== void 0) params.push(`${key}=${encodeURIComponent(value)}`);\n\t}\n\tif (params.length === 0) return url;\n\treturn `${url}${url.includes(\"?\") ? \"&\" : \"?\"}${params.join(\"&\")}`;\n}\n/**\n* Applies file retention headers to the request.\n* @param headers - The mutable headers object to populate.\n* @param retention - The retention settings, or undefined to skip.\n*/\nfunction applyRetentionHeaders(headers, retention) {\n\tif (!retention) return;\n\tif (retention.mode) headers[\"X-Bz-File-Retention-Mode\"] = retention.mode;\n\tif (retention.retainUntilTimestamp) headers[\"X-Bz-File-Retention-Retain-Until-Timestamp\"] = String(retention.retainUntilTimestamp);\n}\n/**\n* Applies the legal hold header to the request.\n* @param headers - The mutable headers object to populate.\n* @param legalHold - The legal hold value, or undefined to skip.\n*/\nfunction applyLegalHoldHeader(headers, legalHold) {\n\tif (!legalHold) return;\n\theaders[\"X-Bz-File-Legal-Hold\"] = legalHold;\n}\n//#endregion\nexport { RawClient, buildFileInfoHeaders, decodeFileName, encodeFileName, parseFileInfoHeaders };\n\n//# sourceMappingURL=index.js.map","import { InMemoryAccountInfo } from \"./auth/in-memory.js\";\nimport { accountId } from \"./types/ids.js\";\nimport \"./util/defaults.js\";\nimport { DEFAULT_RETRY_OPTIONS } from \"./http/retry.js\";\nimport { paginateItems } from \"./util/paginator.js\";\nimport { Bucket } from \"./bucket.js\";\nimport { getRealmUrl } from \"./auth/realms.js\";\nimport { UrlGuard, deriveAllowedSuffixes } from \"./http/url-guard.js\";\nimport { FetchTransport, RetryTransport } from \"./http/transport.js\";\nimport { RawClient } from \"./raw/index.js\";\n//#region src/client.ts\n/**\n* High-level B2 client providing ergonomic access to buckets, files, and keys.\n*\n* @example\n* ```ts\n* const client = new B2Client({\n* applicationKeyId: process.env.B2_APPLICATION_KEY_ID,\n* applicationKey: process.env.B2_APPLICATION_KEY,\n* })\n* await client.authorize()\n* const buckets = await client.listBuckets()\n* ```\n*/\nvar B2Client = class {\n\t/** Low-level client for direct B2 API calls. */\n\traw;\n\t/** Authorization state storage (tokens, URLs, capabilities). */\n\taccountInfo;\n\t/**\n\t* SSRF allow-list applied by the default {@link FetchTransport}. `null` when\n\t* a custom transport was supplied — in that case the SDK does not own the\n\t* guard. Locked down by {@link B2Client.authorize}.\n\t*/\n\turlGuard;\n\tapplicationKeyId;\n\tapplicationKey;\n\trealmUrl;\n\tuserAllowedSuffixes;\n\tresolvedUploadRetryOptions;\n\t/**\n\t* Creates a new B2Client. Call {@link authorize} before making API requests.\n\t* @param options - Configuration including credentials, realm, and transport settings.\n\t*/\n\tconstructor(options) {\n\t\tthis.applicationKeyId = options.applicationKeyId;\n\t\tthis.applicationKey = options.applicationKey;\n\t\tthis.realmUrl = getRealmUrl(options.realm ?? \"production\");\n\t\tthis.accountInfo = options.accountInfo ?? new InMemoryAccountInfo();\n\t\tbindAccountInfoAuthContext(this.accountInfo, this.realmUrl, this.applicationKeyId);\n\t\tthis.userAllowedSuffixes = options.allowedHostSuffixes;\n\t\tthis.resolvedUploadRetryOptions = {\n\t\t\t...DEFAULT_RETRY_OPTIONS,\n\t\t\t...options.retry\n\t\t};\n\t\tlet baseTransport;\n\t\tif (options.transport !== void 0) {\n\t\t\tbaseTransport = options.transport;\n\t\t\tthis.urlGuard = null;\n\t\t} else {\n\t\t\tconst urlGuard = new UrlGuard();\n\t\t\tbaseTransport = new FetchTransport({\n\t\t\t\turlGuard,\n\t\t\t\t...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {},\n\t\t\t\t...options.followSameOriginRedirects !== void 0 ? { followSameOriginRedirects: options.followSameOriginRedirects } : {}\n\t\t\t});\n\t\t\tthis.urlGuard = urlGuard;\n\t\t}\n\t\tconst retryTransport = new RetryTransport({\n\t\t\ttransport: baseTransport,\n\t\t\tretry: this.resolvedUploadRetryOptions,\n\t\t\tonReauth: () => this.reauthorize()\n\t\t});\n\t\tconst cachedAuth = this.accountInfo.getAuth();\n\t\tif (cachedAuth !== null) this.lockUrlGuard(cachedAuth);\n\t\tthis.raw = new RawClient({ transport: retryTransport });\n\t}\n\t/**\n\t* Authenticates with B2 and stores the authorization state. Must be called before other methods.\n\t*\n\t* @returns The authorization response containing tokens, URLs, and capabilities.\n\t*/\n\tasync authorize() {\n\t\tconst auth = await this.raw.authorizeAccount(this.applicationKeyId, this.applicationKey, this.realmUrl);\n\t\tthis.accountInfo.setAuth(auth);\n\t\tthis.lockUrlGuard(auth);\n\t\treturn auth;\n\t}\n\tlockUrlGuard(auth) {\n\t\tif (this.urlGuard !== null) {\n\t\t\tconst derived = deriveAllowedSuffixes(auth.apiInfo.storageApi);\n\t\t\tconst merged = this.userAllowedSuffixes !== void 0 ? this.userAllowedSuffixes.length === 0 ? [] : Array.from(/* @__PURE__ */ new Set([...derived, ...this.userAllowedSuffixes])) : derived;\n\t\t\tthis.urlGuard.setAllowedSuffixes(merged);\n\t\t}\n\t}\n\t/**\n\t* Refresh credentials after a 401. Returns the fresh auth token so\n\t* {@link RetryTransport} can rewrite the in-flight request's\n\t* Authorization header before retrying.\n\t*\n\t* @returns The fresh authorization token.\n\t*/\n\tasync reauthorize() {\n\t\tthis.accountInfo.clear();\n\t\treturn (await this.authorize()).authorizationToken;\n\t}\n\t/**\n\t* Creates a new B2 bucket.\n\t* @param options - Bucket configuration including name, type, and optional settings.\n\t*\n\t* @returns A {@link Bucket} handle for the newly created bucket.\n\t*/\n\tasync createBucket(options) {\n\t\tconst request = {\n\t\t\taccountId: accountId(this.accountInfo.getAccountId()),\n\t\t\t...options\n\t\t};\n\t\tconst info = await this.raw.createBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), request);\n\t\treturn new Bucket(this, info, this.resolvedUploadRetryOptions);\n\t}\n\t/**\n\t* Lists buckets in the account, optionally filtered by ID, name, or type.\n\t* @param options - Optional filters for bucket ID, name, or type.\n\t*\n\t* @returns An array of {@link Bucket} handles.\n\t*/\n\tasync listBuckets(options) {\n\t\treturn (await this.raw.listBuckets(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n\t\t\taccountId: accountId(this.accountInfo.getAccountId()),\n\t\t\t...options\n\t\t})).buckets.map((info) => new Bucket(this, info, this.resolvedUploadRetryOptions));\n\t}\n\t/**\n\t* Looks up a single bucket by name.\n\t* @param bucketName - The name of the bucket to find.\n\t*\n\t* @returns The {@link Bucket} handle, or `null` if not found.\n\t*/\n\tasync getBucket(bucketName) {\n\t\tconst filteredMatch = (await this.listBuckets({ bucketName }))[0];\n\t\tif (filteredMatch !== void 0) return filteredMatch;\n\t\treturn (await this.listBuckets()).find((bucket) => bucket.name === bucketName) ?? null;\n\t}\n\t/**\n\t* Permanently deletes a bucket. The bucket must be empty.\n\t* @param id - The unique identifier of the bucket to delete.\n\t*\n\t* @returns The deleted bucket metadata.\n\t*/\n\tasync deleteBucket(id) {\n\t\treturn this.raw.deleteBucket(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n\t\t\taccountId: accountId(this.accountInfo.getAccountId()),\n\t\t\tbucketId: id\n\t\t});\n\t}\n\t/**\n\t* Creates a new application key with the specified capabilities.\n\t* @param options - Key configuration including capabilities, name, and optional restrictions.\n\t*\n\t* @returns The full key including the secret (only returned at creation time).\n\t*/\n\tasync createKey(options) {\n\t\treturn this.raw.createKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n\t\t\taccountId: accountId(this.accountInfo.getAccountId()),\n\t\t\t...options\n\t\t});\n\t}\n\t/**\n\t* Lists application keys in the account.\n\t* @param options - Optional pagination settings.\n\t*\n\t* @returns A page of application keys with an optional continuation token.\n\t*/\n\tasync listKeys(options) {\n\t\treturn this.raw.listKeys(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), {\n\t\t\taccountId: accountId(this.accountInfo.getAccountId()),\n\t\t\t...options?.pageSize !== void 0 ? { maxKeyCount: options.pageSize } : {},\n\t\t\t...options?.startApplicationKeyId !== void 0 ? { startApplicationKeyId: options.startApplicationKeyId } : {}\n\t\t});\n\t}\n\t/**\n\t* Async iterator that yields every application key on the account,\n\t* automatically handling pagination via `listKeys`.\n\t*\n\t* @param options - Pagination + abort options. `pageSize` is forwarded\n\t* to `maxKeyCount`; the default is 1000.\n\t*\n\t* @returns An async iterable of {@link ApplicationKey} entries.\n\t*\n\t* @example\n\t* ```ts\n\t* for await (const key of client.paginateKeys()) {\n\t* console.log(key.keyName, key.capabilities)\n\t* }\n\t* ```\n\t*/\n\tpaginateKeys(options) {\n\t\treturn paginateItems(async (cursor) => {\n\t\t\tconst resp = await this.listKeys({\n\t\t\t\tpageSize: options?.pageSize ?? 1e3,\n\t\t\t\t...cursor !== void 0 ? { startApplicationKeyId: cursor } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tpage: resp,\n\t\t\t\tnextCursor: resp.nextApplicationKeyId ?? void 0\n\t\t\t};\n\t\t}, (page) => page.keys, options?.signal);\n\t}\n\t/**\n\t* Permanently deletes an application key.\n\t* @param applicationKeyId - The unique identifier of the key to delete.\n\t*\n\t* @returns The deleted application key metadata.\n\t*/\n\tasync deleteKey(applicationKeyId) {\n\t\treturn this.raw.deleteKey(this.accountInfo.getApiUrl(), this.accountInfo.getAuthToken(), { applicationKeyId });\n\t}\n\t/**\n\t* Checks whether the authorized application key carries every capability in\n\t* `needed`. Returns the missing capabilities so callers can fail fast with a\n\t* clear error instead of a generic 401/403 from the server.\n\t*\n\t* @param needed - The capabilities required by the planned operation.\n\t*\n\t* @returns An object with `ok: true` when every needed capability is\n\t* present, otherwise `{ ok: false, missing: [...] }`.\n\t*\n\t* @throws If {@link authorize} has not been called yet.\n\t*/\n\thasCapabilities(needed) {\n\t\tconst auth = this.accountInfo.getAuth();\n\t\tif (!auth) throw new Error(\"Not authorized. Call authorize() first.\");\n\t\tconst available = new Set(auth.apiInfo.storageApi.allowed.capabilities);\n\t\tconst missing = needed.filter((cap) => !available.has(cap));\n\t\treturn {\n\t\t\tok: missing.length === 0,\n\t\t\tmissing\n\t\t};\n\t}\n};\nfunction bindAccountInfoAuthContext(accountInfo, realmUrl, applicationKeyId) {\n\taccountInfo.setApplicationKeyId?.(applicationKeyId);\n\taccountInfo.setRealmUrl?.(realmUrl);\n}\n//#endregion\nexport { B2Client };\n\n//# sourceMappingURL=client.js.map","import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Action version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync: bumping `version` in package.json\n * automatically propagates here, into the User-Agent header, and into the\n * bundled `dist/index.js`.\n *\n * Works because:\n * - Node 22+ supports native JSON import attributes.\n * - ncc / webpack statically inlines the JSON at bundle time, so the\n * runtime artifact has the version baked in as a string literal.\n * - TypeScript's `resolveJsonModule` makes the import type-safe.\n */\nexport const VERSION: string = pkg.version\n","import * as core from '@actions/core'\nimport type { AuthorizeAccountResponse, FileVersion } from '@backblaze-labs/b2-sdk'\nimport {\n B2Client,\n type Bucket,\n type HttpTransport,\n InMemoryAccountInfo,\n} from '@backblaze-labs/b2-sdk'\nimport { VERSION } from './version.ts'\n\n/**\n * An authorized B2Client paired with the bucket name the action is scoped\n * to. Returned by {@link buildClient}; consumed by command dispatch sites\n * that need either the high-level client (cross-bucket copy, presign) or\n * the resolved bucket (via {@link getBucket}).\n */\nexport interface AuthorizedClient {\n /** The authorized SDK client. `client.accountInfo` is populated. */\n client: B2Client\n /** The destination bucket name as provided to the action's `bucket` input. */\n bucketName: string\n}\n\n/** Inputs to {@link buildClient}. */\nexport interface BuildClientOptions {\n /** B2 application key ID. Masked via `core.setSecret` by the dispatcher (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked via `core.setSecret` by the dispatcher. */\n applicationKey: string\n /** Target bucket name (stored on the result for later `getBucket` resolution). */\n bucket: string\n /** Override the default B2 realm endpoint. Only set for staging / custom realms. */\n endpoint?: string | undefined\n /** Inject a custom transport (used by tests with the SDK's `B2Simulator`). */\n transport?: HttpTransport | undefined\n}\n\nfunction maskAccountAuthToken(token: string | null | undefined): void {\n if (token) core.setSecret(token)\n}\n\nclass SecretMaskingAccountInfo extends InMemoryAccountInfo {\n // The SDK routes authorize() and transparent reauthorize() through the\n // supplied AccountInfo.setAuth. The reauth masking test is the CI guard for\n // this SDK coupling when the dependency is bumped.\n override setAuth(auth: AuthorizeAccountResponse): void {\n maskAccountAuthToken(auth.authorizationToken)\n super.setAuth(auth)\n }\n}\n\n/**\n * Build an authorized B2Client.\n *\n * Steps:\n * 1. Construct the client with `userAgent: 'b2-github-action/'`. The\n * SDK preserves its own `b2-sdk-typescript/` and `@backblaze-labs/b2-sdk` tokens before\n * ours so Backblaze server-side logs see both attribution layers.\n * 2. `await client.authorize()`. This is one-shot for the lifetime of the\n * action invocation. B2 auth tokens carry a 24h TTL; typical GitHub\n * Actions runs finish well inside that window. If a long-running job\n * outlives the token, the SDK transparently re-authorizes on the next\n * 401, so the action layer does not need its own refresh loop.\n * 3. Use an AccountInfo wrapper that masks each account authorization token\n * as it is stored, including SDK-driven reauthorization after token\n * expiry. The post-authorize mask is kept as a fallback in case a future\n * SDK version bypasses the wrapper for initial authorization.\n *\n * The `transport` parameter is only used by tests (the SDK's B2Simulator\n * provides one). Production callers leave it undefined to use the SDK's\n * default FetchTransport with its built-in SSRF guard.\n */\nexport async function buildClient(options: BuildClientOptions): Promise {\n const userAgent = `b2-github-action/${VERSION}`\n\n const client = new B2Client({\n applicationKeyId: options.applicationKeyId,\n applicationKey: options.applicationKey,\n accountInfo: new SecretMaskingAccountInfo(),\n userAgent,\n ...(options.transport !== undefined ? { transport: options.transport } : {}),\n ...(options.endpoint !== undefined ? { realm: options.endpoint } : {}),\n })\n\n await client.authorize()\n // Deliberately overlaps with setAuth for initial auth. If a future SDK\n // changes authorize() storage, the public AccountInfo getter still masks the\n // stored account token before command code can log.\n maskAccountAuthToken(client.accountInfo.getAuthToken())\n\n return { client, bucketName: options.bucket }\n}\n\n/**\n * Resolve a bucket by name. Throws a clear error rather than the SDK's\n * `undefined` return so the workflow log surfaces the misconfiguration.\n */\nexport async function getBucket(authorized: AuthorizedClient) {\n const bucket = await authorized.client.getBucket(authorized.bucketName)\n if (!bucket) {\n throw new Error(\n `Bucket \"${authorized.bucketName}\" not found, or the application key lacks listBuckets capability for it.`,\n )\n }\n return bucket\n}\n\n/**\n * Resolve an exact file name only when its latest version is an upload. If the\n * latest exact-name version is a hide marker, this intentionally reports the\n * file as not found instead of selecting an older upload from version history\n * or revealing hidden-object existence in default workflow logs. Throws when\n * the latest exact-name state is hidden, deleted, or absent. Used by `copy`,\n * `delete`, and `retention` to resolve a file name to a `fileId` before\n * operating on it.\n *\n * Consistency assumption: B2's `listFileNames` is read-after-write consistent\n * for a recently-uploaded file in the same region. The simulator returns\n * uploads immediately; production B2 in practice does the same, but a caller\n * that chains \"upload then operate on the same name\" across two action steps\n * is relying on observed behavior rather than a documented SLA.\n *\n * @param bucket - The bucket to search.\n * @param fileName - Exact file name (path) to look up.\n * @param bucketDisplayName - Optional label for the error message; defaults\n * to `bucket.name`. Used when looking up in a source bucket distinct from\n * the action's destination bucket (cross-bucket copy).\n */\nexport async function findFileByName(\n bucket: Bucket,\n fileName: string,\n bucketDisplayName?: string,\n): Promise {\n const display = bucketDisplayName ?? bucket.name\n const page = await bucket.listFileNames({ prefix: fileName, pageSize: 1 })\n const exactLatest = page.files.find((f) => f.fileName === fileName)\n if (exactLatest?.action === 'upload') return exactLatest\n\n throw new Error(`File not found in bucket \"${display}\": ${fileName}`)\n}\n","import { Buffer } from 'node:buffer'\nimport { createHash } from 'node:crypto'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { SSE_B2, sseCustomer } from '@backblaze-labs/b2-sdk'\n\nconst CANONICAL_BASE64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/\n\n/**\n * Parse the `sse` input into an SDK {@link EncryptionSetting}.\n *\n * Accepted forms:\n * - `undefined` / empty → no encryption setting passed (B2 still applies any\n * bucket-default SSE-B2; we just don't override it).\n * - `\"B2\"` (case-insensitive) → SSE-B2 with the B2-managed key (no cost).\n * - `\"C:\"` → SSE-C with a customer-provided key. We\n * compute the required base64 MD5 internally so the workflow author\n * doesn't have to.\n *\n * The action runs in Node only, so we use `node:crypto.createHash('md5')`\n * directly rather than the SDK's isomorphic key wrapper. We deliberately do\n * NOT log the key bytes; the only place they ever go is into the\n * `customerKey` field of the SDK setting which the SDK marks as a secret in\n * any error / debug output.\n */\nexport function parseSse(raw: string | undefined): EncryptionSetting | undefined {\n if (raw === undefined || raw === '') return undefined\n\n const normalized = raw.trim()\n if (normalized.toUpperCase() === 'B2') return SSE_B2\n\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n const base64Key = normalized.slice(2).trim()\n if (base64Key === '') {\n throw new Error(\"SSE-C key is empty. Use 'C:'.\")\n }\n // Node's `Buffer.from(str, 'base64')` silently drops invalid chars instead\n // of throwing, so validate the canonical alphabet and padding first.\n if (!CANONICAL_BASE64.test(base64Key)) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const keyBytes = Buffer.from(base64Key, 'base64')\n if (keyBytes.byteLength !== 32) {\n throw new Error(\n `SSE-C key must decode to exactly 32 bytes (256 bits); got ${keyBytes.byteLength}.`,\n )\n }\n const customerKey = keyBytes.toString('base64')\n if (customerKey !== base64Key) {\n throw new Error(\n \"SSE-C key must be valid canonical base64. Use 'C:'.\",\n )\n }\n const customerKeyMd5 = createHash('md5').update(keyBytes).digest('base64')\n return sseCustomer(customerKey, customerKeyMd5)\n }\n\n throw new Error(`Invalid 'sse' input: \"${raw}\". Expected \"B2\" or \"C:\".`)\n}\n","import * as core from '@actions/core'\nimport type { EncryptionSetting } from '@backblaze-labs/b2-sdk'\nimport { parseSse } from './sse.ts'\n\n/**\n * Discriminator the action's dispatcher switches on. Matches the values\n * accepted by the `action:` input in `action.yml`. Adding a new verb\n * requires updating this union, the runtime `VALID_ACTIONS` list,\n * `ACTION_EFFECTS`, the dispatcher in `src/main.ts`, and the documentation\n * surfaces.\n */\nexport type ActionName =\n | 'upload'\n | 'download'\n | 'sync'\n | 'copy'\n | 'delete'\n | 'presign'\n | 'list'\n | 'hide'\n | 'unhide'\n | 'verify'\n | 'retention'\n | 'head'\n | 'purge'\n\nconst VALID_ACTIONS: readonly ActionName[] = [\n 'upload',\n 'download',\n 'sync',\n 'copy',\n 'delete',\n 'presign',\n 'list',\n 'hide',\n 'unhide',\n 'verify',\n 'retention',\n 'head',\n 'purge',\n]\n\ntype ActionEffect = {\n readonly kind: 'read' | 'write'\n readonly honorsDryRun: boolean\n}\n\n/**\n * Runtime side-effect policy for each action verb.\n *\n * @internal\n */\nexport const ACTION_EFFECTS = {\n upload: { kind: 'write', honorsDryRun: false },\n download: { kind: 'read', honorsDryRun: false },\n sync: { kind: 'write', honorsDryRun: true },\n copy: { kind: 'write', honorsDryRun: false },\n delete: { kind: 'write', honorsDryRun: true },\n presign: { kind: 'read', honorsDryRun: false },\n list: { kind: 'read', honorsDryRun: false },\n hide: { kind: 'write', honorsDryRun: false },\n unhide: { kind: 'write', honorsDryRun: false },\n verify: { kind: 'read', honorsDryRun: false },\n retention: { kind: 'write', honorsDryRun: false },\n head: { kind: 'read', honorsDryRun: false },\n purge: { kind: 'write', honorsDryRun: true },\n} as const satisfies Record\n\n/** How `sync` decides whether two files match. Drives the SDK's `synchronize()`. */\nexport type CompareMode = 'modtime' | 'size' | 'none'\n/** What `sync` does with destination-only files when reconciling. */\nexport type KeepMode = 'no-delete' | 'delete' | 'keep-days'\n/** Direction of a `sync`: `auto` infers from whether `source` is local or remote. */\nexport type SyncDirection = 'auto' | 'up' | 'down'\n/** B2 Object Lock retention mode. `none` clears any prior retention. */\nexport type RetentionMode = 'compliance' | 'governance' | 'none'\n/** B2 Object Lock legal-hold state. */\nexport type LegalHold = 'on' | 'off'\n\nconst VALID_COMPARE: readonly CompareMode[] = ['modtime', 'size', 'none']\nconst VALID_KEEP: readonly KeepMode[] = ['no-delete', 'delete', 'keep-days']\nconst VALID_DIRECTION: readonly SyncDirection[] = ['auto', 'up', 'down']\nconst VALID_RETENTION_MODE: readonly RetentionMode[] = ['compliance', 'governance', 'none']\nconst VALID_LEGAL_HOLD: readonly LegalHold[] = ['on', 'off']\nconst APPLICATION_KEY_ID_ENV = 'B2_APPLICATION_KEY_ID'\nconst APPLICATION_KEY_ENV = 'B2_APPLICATION_KEY'\nconst FILE_INFO_KEY_PATTERN = /^[a-zA-Z0-9_.`~!#$%^&*'|+-]+$/\nconst FILE_INFO_KEY_MAX_BYTES = 50\nconst FILE_INFO_MAX_ENTRIES = 10\nconst FILE_INFO_TOTAL_MAX_BYTES = 7000\nconst FILE_INFO_TOTAL_MAX_BYTES_WITH_ENCRYPTION = 2048\nconst utf8Encoder = new TextEncoder()\n\n/**\n * The fully-parsed, fully-validated action surface. Built by\n * {@link parseInputs} from `INPUT_*` env vars (via `@actions/core`); every\n * command in `src/commands/` consumes a frozen instance of this shape.\n *\n * Most fields map 1:1 to inputs declared in `action.yml`. Defaults and\n * optionality match the YAML surface; see `action.yml` for the user-facing\n * documentation per input.\n */\nexport interface ParsedInputs {\n /** Which verb to dispatch to. */\n action: ActionName\n /** B2 application key ID. Masked at parse time via `core.setSecret` (defense in depth). */\n applicationKeyId: string\n /** B2 application key (the secret). Masked at parse time via `core.setSecret`. */\n applicationKey: string\n /** Destination bucket name for the action. */\n bucket: string\n /** Cross-bucket `copy` source bucket. Undefined means same-bucket copy. */\n sourceBucket: string | undefined\n /**\n * Verb-dependent source. Upload/sync: a local path or glob. Download/copy/\n * delete/presign/list/hide/unhide/verify/retention/head/purge: a B2 file\n * name or prefix (trailing `/` means prefix mode for verbs that support it).\n */\n source: string | undefined\n /**\n * Verb-dependent destination. Upload/sync: B2 file name or prefix.\n * Download: local path. Copy: destination file name. Other verbs: ignored.\n */\n destination: string | undefined\n /** Glob patterns to include during upload/sync expansion. */\n include: string[]\n /** Glob patterns to exclude during upload/sync expansion. Default: `.git/**`. */\n exclude: string[]\n /** Parallel parts/files for upload/sync. */\n concurrency: number\n /** Multipart part size in bytes. Undefined defers to the SDK's recommendation. */\n partSize: number | undefined\n /** Resume an in-progress multipart upload. */\n resume: boolean\n /** Content-Type to set on uploaded objects. Undefined leaves B2's auto-detect. */\n contentType: string | undefined\n /** Custom B2 fileInfo metadata (`X-Bz-Info-*`) to set on uploaded objects. */\n fileInfo: Record\n /** Preserve each local file's mtime as B2 `src_last_modified_millis`. */\n preserveMtime: boolean\n /** Response Content-Disposition override for `download` and `presign`. */\n responseContentDisposition: string | undefined\n /** Response Content-Type override for `download` and `presign`. */\n responseContentType: string | undefined\n /** Response Cache-Control override for `download` and `presign`. */\n responseCacheControl: string | undefined\n /** Preview without executing (sync/delete/purge). */\n dryRun: boolean\n /** Permit whole-bucket purge when `source` is empty or `/`. */\n allowBucketPurge: boolean\n /** Presigned-URL TTL in seconds. */\n presignTtlSeconds: number\n /** Override B2 realm endpoint for staging / custom realms. */\n endpoint: string | undefined\n /** Fail the action when upload/sync matches zero files. */\n failOnEmpty: boolean\n /** Raw `sse:` input value as the user typed it. Retained for diagnostics. */\n sse: string | undefined\n /** Parsed SSE specification ready to hand to the SDK. */\n encryption: EncryptionSetting | undefined\n /** How `sync` compares files. */\n compareMode: CompareMode\n /** How `sync` treats destination-only files. */\n keepMode: KeepMode\n /** Direction of a `sync` (auto-detected when set to `auto`). */\n syncDirection: SyncDirection\n /** Cap on listed/presigned entries for `list` and prefix `presign`. */\n maxResults: number\n /** Literal SHA-1 to compare against in `verify` (when set, no local read). */\n expectedSha1: string | undefined\n /** Object Lock retention mode to apply (`retention` verb). */\n retentionMode: RetentionMode | undefined\n /** ISO-8601 timestamp until which retention applies. Required with `retentionMode`. */\n retentionUntil: string | undefined\n /** Legal-hold state to apply (`retention` verb). */\n legalHold: LegalHold | undefined\n /** Allow shortening a governance-mode retention (requires key capability). */\n bypassGovernance: boolean\n}\n\n/**\n * Sensitive raw values that can appear in parser-scope errors before\n * {@link parseInputs} returns its structured output.\n */\nexport function collectInputSecretsForScrubbing(): string[] {\n const secretValues = new Set()\n addSecretValue(secretValues, core.getInput('application-key-id'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ID_ENV])\n addSecretValue(secretValues, core.getInput('application-key'))\n addSecretValue(secretValues, process.env[APPLICATION_KEY_ENV])\n addSseSecretValue(secretValues, core.getInput('sse'))\n return [...secretValues]\n}\n\n/**\n * Parse and validate inputs.\n *\n * Credentials lookup order:\n *\n * 1. `application-key-id` / `application-key` action inputs\n * 2. `B2_APPLICATION_KEY_ID` / `B2_APPLICATION_KEY` env vars (the official\n * contract used by the Backblaze b2 CLI and the @backblaze-labs/b2-sdk).\n *\n * The credential value, once resolved, is immediately masked via `core.setSecret`\n * so any accidental echo (including from a misbehaving sub-process) is redacted\n * in workflow logs.\n */\nexport function parseInputs(): ParsedInputs {\n const action = parseEnum('action', required('action').toLowerCase(), VALID_ACTIONS)\n\n const applicationKeyId = resolveCredential('application-key-id', APPLICATION_KEY_ID_ENV)\n const applicationKey = resolveCredential('application-key', APPLICATION_KEY_ENV)\n // The keyId is identifying (not the secret half of the HMAC pair), but mask\n // it anyway for defense in depth: the canonical AWS analogue mask AKIA-style\n // IDs in CI logs, and masking costs nothing in debuggability since the user\n // already knows which key they passed.\n core.setSecret(applicationKeyId)\n core.setSecret(applicationKey)\n\n const bucket = required('bucket')\n const sourceBucket = optional('source-bucket')\n const allowBucketPurge = parseBool(\n 'allow-bucket-purge',\n core.getInput('allow-bucket-purge') || 'false',\n )\n const source = optionalSource(action, allowBucketPurge)\n const destination = optional('destination')\n\n const include = splitCsv(optional('include'))\n const exclude = splitCsv(optional('exclude'))\n\n const concurrency = parsePositiveInt('concurrency', core.getInput('concurrency') || '4')\n const partSizeInput = optional('part-size')\n const partSize =\n partSizeInput !== undefined ? parsePositiveInt('part-size', partSizeInput) : undefined\n\n const resume = parseBool('resume', core.getInput('resume') || 'true')\n const dryRun = parseBool('dry-run', core.getInput('dry-run') || 'false')\n const failOnEmpty = parseBool('fail-on-empty', core.getInput('fail-on-empty') || 'true')\n const bypassGovernance = parseBool(\n 'bypass-governance',\n core.getInput('bypass-governance') || 'false',\n )\n\n const presignTtlSeconds = parsePositiveInt('presign-ttl', core.getInput('presign-ttl') || '3600')\n const maxResults = parsePositiveInt('max-results', core.getInput('max-results') || '1000')\n\n const contentType = optional('content-type')\n const contentDisposition = optional('content-disposition')\n const cacheControl = optional('cache-control')\n const responseContentDisposition = optional('response-content-disposition')\n const responseContentType = optional('response-content-type')\n const responseCacheControl = optional('response-cache-control')\n const endpoint = optional('endpoint')\n const sse = optional('sse')\n const encryption = parseSse(sse)\n\n const fileInfo = parseFileInfo(optional('file-info'))\n addFileInfo(fileInfo, 'b2-cache-control', cacheControl, 'cache-control', { allowReserved: true })\n addFileInfo(fileInfo, 'b2-content-disposition', contentDisposition, 'content-disposition', {\n allowReserved: true,\n })\n addFileInfo(fileInfo, 'b2-content-language', optional('content-language'), 'content-language', {\n allowReserved: true,\n })\n addFileInfo(fileInfo, 'b2-expires', optional('expires'), 'expires', { allowReserved: true })\n validateFileInfo(fileInfo, uploadFileInfoTotalMaxBytes(encryption))\n const preserveMtime = parseBool('preserve-mtime', core.getInput('preserve-mtime') || 'false')\n if (preserveMtime && Object.hasOwn(fileInfo, 'src_last_modified_millis')) {\n throw new Error(`Duplicate fileInfo key \"src_last_modified_millis\" from 'preserve-mtime' input`)\n }\n const expectedSha1 = optional('expected-sha1')\n const retentionUntil = optional('retention-until')\n\n const compareMode = parseEnum(\n 'compare-mode',\n (core.getInput('compare-mode') || 'modtime').toLowerCase(),\n VALID_COMPARE,\n )\n const keepMode = parseEnum(\n 'keep-mode',\n (core.getInput('keep-mode') || 'no-delete').toLowerCase(),\n VALID_KEEP,\n )\n const syncDirection = parseEnum(\n 'direction',\n (core.getInput('direction') || 'auto').toLowerCase(),\n VALID_DIRECTION,\n )\n const retentionMode = parseOptionalEnum(\n 'retention-mode',\n optional('retention-mode')?.toLowerCase(),\n VALID_RETENTION_MODE,\n )\n const legalHold = parseOptionalEnum(\n 'legal-hold',\n optional('legal-hold')?.toLowerCase(),\n VALID_LEGAL_HOLD,\n )\n\n return {\n action,\n applicationKeyId,\n applicationKey,\n bucket,\n sourceBucket,\n source,\n destination,\n include,\n exclude,\n concurrency,\n partSize,\n resume,\n contentType,\n fileInfo,\n preserveMtime,\n responseContentDisposition,\n responseContentType,\n responseCacheControl,\n dryRun,\n allowBucketPurge,\n presignTtlSeconds,\n endpoint,\n failOnEmpty,\n sse,\n encryption,\n compareMode,\n keepMode,\n syncDirection,\n maxResults,\n expectedSha1,\n retentionMode,\n retentionUntil,\n legalHold,\n bypassGovernance,\n }\n}\n\n/**\n * Validate that `inputs.source` is set and non-empty, returning the value.\n * Throws a uniform error message naming the verb so the workflow log surfaces\n * exactly what's missing. Commands that allow an empty-string source for\n * special semantics (e.g. `purge` with explicit whole-bucket scope) should\n * not use this helper.\n */\nexport function requireSource(\n source: string | undefined,\n verb: string,\n description?: string,\n): string {\n if (source === undefined || source === '') {\n const tail = description !== undefined ? ` (${description})` : ''\n throw new Error(`'source' input is required for '${verb}' action${tail}`)\n }\n return source\n}\n\n/**\n * Validate that `raw` is one of `valid`, narrowing the return type.\n *\n * Replaces the previous pattern of one type-guard + one throw per enum:\n *\n * const x = parseEnum('compare-mode', raw, VALID_COMPARE)\n *\n * Throws a uniform error message that lists the legal values.\n *\n * @internal\n */\nexport function parseEnum(name: string, raw: string, valid: readonly T[]): T {\n if ((valid as readonly string[]).includes(raw)) return raw as T\n throw new Error(`Invalid '${name}' input: \"${raw}\". Must be one of: ${valid.join(', ')}`)\n}\n\n/**\n * Like {@link parseEnum} but passes through `undefined`. Used for inputs that\n * are optional but, when set, must be one of a known set.\n */\nfunction parseOptionalEnum(\n name: string,\n raw: string | undefined,\n valid: readonly T[],\n): T | undefined {\n return raw === undefined ? undefined : parseEnum(name, raw, valid)\n}\n\nfunction required(name: string): string {\n // `@actions/core` throws on missing required inputs, so this never returns\n // empty. Wrapping the call only exists so the throw site has a uniform\n // shape with the rest of the input parsers.\n return core.getInput(name, { required: true })\n}\n\nfunction optional(name: string): string | undefined {\n const v = core.getInput(name)\n return v === '' ? undefined : v\n}\n\nfunction optionalSource(action: ActionName, allowBucketPurge: boolean): string | undefined {\n const v = core.getInput('source')\n if (v !== '') return v\n return action === 'purge' && allowBucketPurge ? '' : undefined\n}\n\nfunction addSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined || value === '') return\n const trimmed = value.trim()\n for (const secret of new Set([value, trimmed])) {\n if (secret === '' || secretValues.has(secret)) continue\n core.setSecret(secret)\n secretValues.add(secret)\n }\n}\n\nfunction addSseSecretValue(secretValues: Set, value: string | undefined): void {\n if (value === undefined) return\n const normalized = value.trim()\n if (normalized === '' || normalized.toUpperCase() === 'B2') return\n\n addSecretValue(secretValues, value)\n if (normalized.startsWith('C:') || normalized.startsWith('c:')) {\n addSecretValue(secretValues, normalized.slice(2).trim())\n }\n}\n\nfunction resolveCredential(inputName: string, envName: string): string {\n const fromInput = optional(inputName)\n if (fromInput !== undefined) return fromInput\n\n const fromEnv = process.env[envName]\n if (fromEnv !== undefined && fromEnv !== '') return fromEnv\n\n throw new Error(`Missing credential: set input '${inputName}' or env var '${envName}'`)\n}\n\n/**\n * Parse a comma-separated action input, trimming entries and dropping blanks.\n *\n * @internal\n */\nexport function splitCsv(value: string | undefined): string[] {\n if (value === undefined) return []\n return value\n .split(',')\n .map((s) => s.trim())\n .filter((s) => s.length > 0)\n}\n\n/**\n * Parse upload fileInfo metadata from newline-delimited or simple\n * comma-separated `key=value` entries. Newline mode preserves commas inside\n * values.\n *\n * @internal\n */\nexport function parseFileInfo(value: string | undefined): Record {\n if (value === undefined || value.trim() === '') return {}\n const pairs = /[\\r\\n]/.test(value) ? value.split(/\\r?\\n|\\r/) : value.split(',')\n const fileInfo: Record = {}\n\n for (const rawPair of pairs) {\n const pair = rawPair.trim()\n if (pair === '') continue\n const equalsIndex = pair.indexOf('=')\n if (equalsIndex <= 0) {\n throw new Error(`Invalid 'file-info' entry \"${pair}\". Expected key=value.`)\n }\n const key = pair.slice(0, equalsIndex).trim()\n const parsedValue = pair.slice(equalsIndex + 1).trim()\n addFileInfo(fileInfo, key, parsedValue, 'file-info', { allowReserved: false })\n }\n\n return fileInfo\n}\n\ninterface AddFileInfoOptions {\n allowReserved: boolean\n}\n\nfunction addFileInfo(\n fileInfo: Record,\n key: string,\n value: string | undefined,\n inputName: string,\n options: AddFileInfoOptions,\n): void {\n if (value === undefined) return\n const canonicalKey = key.toLowerCase()\n if (!options.allowReserved && canonicalKey.startsWith('b2-')) {\n throw new Error(\n `Reserved fileInfo key \"${key}\" from '${inputName}' input must use the dedicated upload inputs such as content-type, cache-control, content-disposition, content-language, or expires`,\n )\n }\n if (Object.hasOwn(fileInfo, canonicalKey)) {\n throw new Error(`Duplicate fileInfo key \"${key}\" from '${inputName}' input`)\n }\n fileInfo[canonicalKey] = value\n}\n\n/**\n * Return the upload fileInfo byte budget for the active encryption mode.\n *\n * @internal\n */\nexport function uploadFileInfoTotalMaxBytes(encryption: EncryptionSetting | undefined): number {\n return encryption === undefined\n ? FILE_INFO_TOTAL_MAX_BYTES\n : FILE_INFO_TOTAL_MAX_BYTES_WITH_ENCRYPTION\n}\n\n/**\n * Validate upload fileInfo metadata before forwarding it to the B2 SDK.\n *\n * @internal\n */\nexport function validateFileInfo(\n fileInfo: Record,\n totalMaxBytes = FILE_INFO_TOTAL_MAX_BYTES,\n): void {\n const entries = Object.entries(fileInfo)\n if (entries.length > FILE_INFO_MAX_ENTRIES) {\n throw new Error(`Invalid fileInfo: ${entries.length} entries exceeds ${FILE_INFO_MAX_ENTRIES}`)\n }\n\n let totalBytes = 0\n const seenCanonicalKeys = new Set()\n for (const [key, value] of entries) {\n const canonicalKey = key.toLowerCase()\n if (seenCanonicalKeys.has(canonicalKey)) {\n throw new Error(`Duplicate fileInfo key \"${key}\" from upload metadata`)\n }\n seenCanonicalKeys.add(canonicalKey)\n\n if (!FILE_INFO_KEY_PATTERN.test(key)) {\n throw new Error(\n `Invalid fileInfo key \"${key}\" from 'file-info'. Keys must match ${FILE_INFO_KEY_PATTERN.source}`,\n )\n }\n\n const keyBytes = utf8Encoder.encode(key).byteLength\n if (keyBytes > FILE_INFO_KEY_MAX_BYTES) {\n throw new Error(\n `Invalid fileInfo key \"${key}\": ${keyBytes} bytes exceeds ${FILE_INFO_KEY_MAX_BYTES}`,\n )\n }\n\n const valueBytes = utf8Encoder.encode(value).byteLength\n const remainingValueBytes = Math.max(0, totalMaxBytes - totalBytes - keyBytes)\n if (valueBytes > remainingValueBytes) {\n throw new Error(\n `Invalid fileInfo value for \"${key}\": ${valueBytes} bytes exceeds ${remainingValueBytes}`,\n )\n }\n totalBytes += keyBytes + valueBytes\n }\n\n if (totalBytes > totalMaxBytes) {\n throw new Error(`Invalid fileInfo: total size ${totalBytes} bytes exceeds ${totalMaxBytes}`)\n }\n}\n\n/**\n * Parse the documented boolean input spellings accepted by this action.\n *\n * @internal\n */\nexport function parseBool(name: string, raw: string): boolean {\n const v = raw.trim().toLowerCase()\n if (v === 'true' || v === '1' || v === 'yes') return true\n if (v === 'false' || v === '0' || v === 'no') return false\n throw new Error(`Invalid boolean for '${name}': \"${raw}\"`)\n}\n\n/**\n * Parse a strictly positive integer input.\n *\n * @internal\n */\nexport function parsePositiveInt(name: string, raw: string): number {\n const trimmed = raw.trim()\n const n = Number(trimmed)\n if (!/^\\d+$/.test(trimmed) || n <= 0 || !Number.isSafeInteger(n)) {\n throw new Error(`Invalid positive integer for '${name}': \"${raw}\"`)\n }\n return n\n}\n","import * as core from '@actions/core'\nimport type { B2Client, Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link copyCommand}. Single-file (copy is always one-source-one-destination). */\nexport interface CopyResult {\n /** Source bucket name. */\n sourceBucket: string\n /** Source file name (the B2 key in the source bucket). */\n sourceFileName: string\n /** Destination bucket name. */\n destinationBucket: string\n /** Destination file name (the B2 key in the destination bucket). */\n destinationFileName: string\n /** B2 file ID of the newly-created destination object. */\n fileId: string\n /** Byte size of the copied object. */\n size: number\n}\n\n/**\n * Server-side copy of one B2 object to a new name, within the same bucket or\n * across two buckets in the same account.\n *\n * The copy is done by reference (`b2_copy_file` for small, `b2_copy_part` for\n * large): bytes never traverse the runner. This is dramatically faster and\n * cheaper than download-then-reupload for any non-trivial file.\n *\n * Cross-bucket: set `source-bucket` to the source bucket name. The action's\n * `bucket` input is the destination. The application key must have read\n * permission on the source bucket and write permission on the destination.\n */\nexport async function copyCommand(\n client: B2Client,\n destinationBucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'copy', 'the source B2 file name')\n const destination = inputs.destination\n if (destination === undefined || destination === '') {\n throw new Error(\n \"'destination' input is required for 'copy' action (the destination B2 file name)\",\n )\n }\n\n const sourceBucketName = inputs.sourceBucket ?? destinationBucket.name\n const sourceBucket =\n sourceBucketName === destinationBucket.name\n ? destinationBucket\n : await client.getBucket(sourceBucketName)\n if (!sourceBucket) {\n throw new Error(`Source bucket \"${sourceBucketName}\" not found, or key lacks listBuckets.`)\n }\n\n const hit = await findFileByName(sourceBucket, source, sourceBucketName)\n\n core.startGroup(\n `copy b2://${sourceBucketName}/${source} → b2://${destinationBucket.name}/${destination}`,\n )\n try {\n const recommendedPartSize = client.accountInfo.getRecommendedPartSize()\n const isLarge = hit.contentLength > recommendedPartSize\n const copyOptions = {\n sourceFileId: hit.fileId,\n fileName: destination,\n ...(sourceBucketName !== destinationBucket.name\n ? { destinationBucketId: destinationBucket.id }\n : {}),\n }\n\n const result = isLarge\n ? await destinationBucket.copyLargeFile({\n ...copyOptions,\n ...(signal !== undefined ? { signal } : {}),\n })\n : await destinationBucket.copyFile(copyOptions)\n\n core.info(` copied → fileId=${result.fileId}, size=${result.contentLength}`)\n return {\n sourceBucket: sourceBucketName,\n sourceFileName: source,\n destinationBucket: destinationBucket.name,\n destinationFileName: destination,\n fileId: result.fileId,\n size: result.contentLength,\n }\n } finally {\n core.endGroup()\n }\n}\n","import type {\n Bucket,\n DeleteAllDeleteEvent,\n DeleteAllErrorEvent,\n DeleteAllSkipEvent,\n FileAction,\n} from '@backblaze-labs/b2-sdk'\n\nconst DELETE_FAILED_MESSAGE = 'delete failed'\nconst OUT_OF_PREFIX_MESSAGE = 'listed file is outside requested prefix'\n\n// SDK-deleteAll-compatible events with local extensions for this bypass-governance shim.\nexport type DeleteAllVersionsDeleteEvent = DeleteAllDeleteEvent & {\n readonly action: FileAction\n}\n\nexport type DeleteAllVersionsEvent =\n | DeleteAllVersionsDeleteEvent\n | DeleteAllErrorEvent\n | DeleteAllSkipEvent\n\nexport interface DeleteAllVersionsOptions {\n prefix?: string\n dryRun: boolean\n bypassGovernance: boolean\n signal?: AbortSignal\n}\n\nexport async function* deleteAllVersions(\n bucket: Bucket,\n options: DeleteAllVersionsOptions,\n): AsyncGenerator {\n const versions = bucket.paginateFileVersions({\n ...(options.prefix !== undefined ? { prefix: options.prefix } : {}),\n ...(options.signal !== undefined ? { signal: options.signal } : {}),\n })\n\n while (true) {\n options.signal?.throwIfAborted()\n const next = await versions.next()\n options.signal?.throwIfAborted()\n if (next.done === true) break\n\n const version = next.value\n if (options.prefix !== undefined && !version.fileName.startsWith(options.prefix)) {\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: OUT_OF_PREFIX_MESSAGE,\n }\n continue\n }\n\n if (options.dryRun) {\n yield { type: 'skip', fileName: version.fileName, fileId: version.fileId }\n continue\n }\n\n options.signal?.throwIfAborted()\n try {\n if (options.bypassGovernance) {\n await bucket.deleteFileVersion(version.fileName, version.fileId, {\n bypassGovernance: true,\n })\n } else {\n await bucket.deleteFileVersion(version.fileName, version.fileId)\n }\n yield {\n type: 'delete',\n fileName: version.fileName,\n fileId: version.fileId,\n action: version.action,\n }\n } catch (error) {\n options.signal?.throwIfAborted()\n if (isAbortError(error)) throw error\n yield {\n type: 'error',\n fileName: version.fileName,\n fileId: version.fileId,\n message: DELETE_FAILED_MESSAGE,\n }\n }\n\n options.signal?.throwIfAborted()\n }\n}\n\nfunction isAbortError(error: unknown): boolean {\n return error instanceof Error && error.name === 'AbortError'\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link DeleteResult.files}. */\nexport interface DeletedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** True for dry-run previews; the file was not actually deleted. */\n skipped: boolean\n}\n\n/** Result of {@link deleteCommand}. */\nexport interface DeleteResult {\n /** One entry per matched file version (including hide markers). */\n files: DeletedFile[]\n /** Count of individual-file delete failures (non-fatal; sums into the dispatcher's `core.setFailed`). */\n errors: number\n}\n\n/**\n * Delete files from B2.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and delete every version\n * matching it.\n * - Otherwise delete the single file by name. We look up the latest version\n * via `listFileNames` to get its `fileId` and call `deleteFileVersion`.\n *\n * With `dry-run: true`, no actual deletions happen; the action reports what\n * would have been deleted.\n */\nexport async function deleteCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'delete', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n if (isPrefix) {\n return deletePrefix(bucket, source, inputs.dryRun, inputs.bypassGovernance, signal)\n }\n return deleteOne(bucket, source, inputs.dryRun, inputs.bypassGovernance)\n}\n\nasync function deletePrefix(\n bucket: Bucket,\n prefix: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n signal?: AbortSignal,\n): Promise {\n const files: DeletedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} prefix b2://${bucket.name}/${prefix}`)\n try {\n for await (const event of deleteAllVersions(bucket, {\n prefix,\n dryRun,\n bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n })) {\n if (event.type === 'delete') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: false })\n core.info(` deleted ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({ fileName: event.fileName, fileId: event.fileId, skipped: true })\n core.info(` would delete ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to delete ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n\nasync function deleteOne(\n bucket: Bucket,\n fileName: string,\n dryRun: boolean,\n bypassGovernance: boolean,\n): Promise {\n const hit = await findFileByName(bucket, fileName)\n\n core.startGroup(`${dryRun ? 'dry-run' : 'delete'} b2://${bucket.name}/${fileName}`)\n try {\n if (dryRun) {\n core.info(` would delete ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: true }],\n errors: 0,\n }\n }\n if (bypassGovernance) {\n await bucket.deleteFileVersion(fileName, hit.fileId, { bypassGovernance: true })\n } else {\n await bucket.deleteFileVersion(fileName, hit.fileId)\n }\n core.info(` deleted ${fileName} (${hit.fileId})`)\n return {\n files: [{ fileName, fileId: hit.fileId, skipped: false }],\n errors: 0,\n }\n } finally {\n core.endGroup()\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"node:stream/promises\");","import type { DownloadCallOptions } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from './inputs.ts'\n\nexport type DownloadHeaderOverrides = Pick<\n DownloadCallOptions,\n 'b2CacheControl' | 'b2ContentDisposition' | 'b2ContentType'\n>\n\nconst DOWNLOAD_OVERRIDE_QUERY_PARAMS = {\n b2ContentDisposition: 'b2ContentDisposition',\n b2ContentType: 'b2ContentType',\n b2CacheControl: 'b2CacheControl',\n} as const satisfies Record\n\nconst HTTP_TOKEN_RE = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/\nconst MAX_CONTENT_DISPOSITION_LENGTH = 1024\nconst MAX_CONTENT_TYPE_LENGTH = 255\nconst MAX_CACHE_CONTROL_LENGTH = 1024\n\nexport function downloadHeaderOverridesFromInputs(inputs: ParsedInputs): DownloadHeaderOverrides {\n const contentDisposition = validateContentDisposition(inputs.responseContentDisposition)\n const contentType = validateContentType(inputs.responseContentType)\n const cacheControl = validateCacheControl(inputs.responseCacheControl)\n\n return {\n ...(contentDisposition !== undefined ? { b2ContentDisposition: contentDisposition } : {}),\n ...(contentType !== undefined ? { b2ContentType: contentType } : {}),\n ...(cacheControl !== undefined ? { b2CacheControl: cacheControl } : {}),\n }\n}\n\nexport function appendDownloadHeaderOverrides(\n url: string,\n overrides: DownloadHeaderOverrides,\n): string {\n const entries = Object.entries(DOWNLOAD_OVERRIDE_QUERY_PARAMS) as Array<\n [keyof DownloadHeaderOverrides, string]\n >\n if (entries.every(([key]) => overrides[key] === undefined)) return url\n\n const parsed = new URL(url)\n for (const [key, param] of entries) {\n const value = overrides[key]\n if (value !== undefined) {\n parsed.searchParams.set(param, value)\n }\n }\n return parsed.toString()\n}\n\nfunction validateContentDisposition(value: string | undefined): string | undefined {\n return validateHeaderValue(\n 'response-content-disposition',\n value,\n MAX_CONTENT_DISPOSITION_LENGTH,\n isContentDisposition,\n 'must start with a disposition token and contain only valid parameters',\n )\n}\n\nfunction validateContentType(value: string | undefined): string | undefined {\n return validateHeaderValue(\n 'response-content-type',\n value,\n MAX_CONTENT_TYPE_LENGTH,\n isContentType,\n 'must be a media type such as application/pdf, with optional valid parameters',\n )\n}\n\nfunction validateCacheControl(value: string | undefined): string | undefined {\n return validateHeaderValue(\n 'response-cache-control',\n value,\n MAX_CACHE_CONTROL_LENGTH,\n isCacheControl,\n 'must contain comma-separated Cache-Control directives',\n )\n}\n\nfunction validateHeaderValue(\n inputName: string,\n value: string | undefined,\n maxLength: number,\n isValidFormat: (value: string) => boolean,\n formatDescription: string,\n): string | undefined {\n if (value === undefined) return undefined\n if (value.length > maxLength) {\n throw new Error(`Invalid '${inputName}' input: must be at most ${maxLength} characters`)\n }\n if (containsHttpControlCharacter(value)) {\n throw new Error(`Invalid '${inputName}' input: must not contain HTTP control characters`)\n }\n if (!isValidFormat(value)) {\n throw new Error(`Invalid '${inputName}' input: ${formatDescription}`)\n }\n return value\n}\n\nfunction containsHttpControlCharacter(value: string): boolean {\n for (let i = 0; i < value.length; i += 1) {\n const code = value.charCodeAt(i)\n if (code <= 0x1f || code === 0x7f) return true\n }\n return false\n}\n\nfunction isContentDisposition(value: string): boolean {\n const parts = splitOutsideQuotes(value, ';')\n if (parts === null || parts.length === 0 || !isHttpToken(parts[0])) return false\n return parts.slice(1).every(isParameter)\n}\n\nfunction isContentType(value: string): boolean {\n const parts = splitOutsideQuotes(value, ';')\n if (parts === null || parts.length === 0) return false\n\n const [type, subtype, ...extra] = parts[0]?.split('/') ?? []\n if (extra.length > 0 || !isHttpToken(type) || !isHttpToken(subtype)) return false\n return parts.slice(1).every(isParameter)\n}\n\nfunction isCacheControl(value: string): boolean {\n const directives = splitOutsideQuotes(value, ',')\n if (directives === null || directives.length === 0) return false\n return directives.every((directive) => {\n if (directive === '') return false\n const equals = directive.indexOf('=')\n if (equals === -1) return isHttpToken(directive)\n\n const name = directive.slice(0, equals).trim()\n const rawValue = directive.slice(equals + 1).trim()\n return isHttpToken(name) && isHeaderParameterValue(rawValue)\n })\n}\n\nfunction isParameter(value: string): boolean {\n const equals = value.indexOf('=')\n if (equals <= 0) return false\n\n const name = value.slice(0, equals).trim()\n const rawValue = value.slice(equals + 1).trim()\n return isHttpToken(name) && isHeaderParameterValue(rawValue)\n}\n\nfunction isHeaderParameterValue(value: string): boolean {\n return isHttpToken(value) || isQuotedString(value)\n}\n\nfunction isHttpToken(value: string | undefined): boolean {\n return value !== undefined && HTTP_TOKEN_RE.test(value)\n}\n\nfunction isQuotedString(value: string): boolean {\n if (value.length < 2 || !value.startsWith('\"') || !value.endsWith('\"')) return false\n for (let i = 1; i < value.length - 1; i += 1) {\n const char = value[i]\n if (char === '\"') return false\n if (char === '\\\\') {\n i += 1\n if (i >= value.length - 1) return false\n }\n }\n return true\n}\n\nfunction splitOutsideQuotes(value: string, separator: ';' | ','): string[] | null {\n const parts: string[] = []\n let start = 0\n let quoted = false\n let escaped = false\n\n for (let i = 0; i < value.length; i += 1) {\n const char = value[i]\n if (escaped) {\n escaped = false\n continue\n }\n if (quoted && char === '\\\\') {\n escaped = true\n continue\n }\n if (char === '\"') {\n quoted = !quoted\n continue\n }\n if (!quoted && char === separator) {\n parts.push(value.slice(start, i).trim())\n start = i + 1\n }\n }\n\n if (quoted || escaped) return null\n parts.push(value.slice(start).trim())\n return parts\n}\n","import type { Stats } from 'node:fs'\nimport { stat } from 'node:fs/promises'\n\n/**\n * `stat(path)` that returns `undefined` instead of throwing on ENOENT/EACCES\n * etc. Used at filesystem boundaries where the caller wants to distinguish\n * \"doesn't exist / not readable\" from \"exists with shape X\" without juggling\n * try/catch at every call site.\n */\nexport async function tryStat(path: string): Promise {\n return stat(path).catch(() => undefined)\n}\n","/**\n * Format a byte count with KB/MB/GB suffixes.\n *\n * Single source of truth so the workflow log (progress.ts) and the step\n * summary table (summary.ts) never drift on thresholds or rounding.\n */\nexport function formatBytes(n: number): string {\n if (n < 1024) return `${n} B`\n if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`\n if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`\n return `${(n / 1024 / 1024 / 1024).toFixed(2)} GB`\n}\n","import * as core from '@actions/core'\nimport type { ProgressEvent, ProgressListener } from '@backblaze-labs/b2-sdk'\nimport { formatBytes } from './format.ts'\n\n/**\n * Build a progress listener that throttles output to one update per\n * `intervalMs` (default 1s) so a long-running upload doesn't flood the\n * workflow log with thousands of lines. The first event and the final\n * event are always emitted.\n */\nexport function makeProgressListener(label: string, intervalMs = 1000): ProgressListener {\n let lastEmit = 0\n let lastBytes = 0\n let lastTime = Date.now()\n\n return (event: ProgressEvent) => {\n const now = Date.now()\n const isFirst = lastEmit === 0\n const isFinal = event.totalBytes !== null && event.bytesTransferred >= event.totalBytes\n const due = now - lastEmit >= intervalMs\n\n if (!isFirst && !isFinal && !due) return\n\n const elapsedMs = Math.max(1, now - lastTime)\n const deltaBytes = event.bytesTransferred - lastBytes\n const mbps = (deltaBytes / 1024 / 1024) * (1000 / elapsedMs)\n\n const pct =\n event.totalBytes !== null && event.totalBytes > 0\n ? `${Math.round((event.bytesTransferred / event.totalBytes) * 100)}%`\n : '?%'\n\n const parts =\n event.totalParts !== null ? ` (${event.partsCompleted}/${event.totalParts} parts)` : ''\n\n const totalSuffix = event.totalBytes !== null ? ` / ${formatBytes(event.totalBytes)}` : ''\n core.info(\n `${label} ${pct}${parts} ${formatBytes(event.bytesTransferred)}${totalSuffix} @ ${mbps.toFixed(2)} MB/s`,\n )\n\n lastEmit = now\n lastBytes = event.bytesTransferred\n lastTime = now\n }\n}\n","import { randomUUID } from 'node:crypto'\nimport { createWriteStream } from 'node:fs'\nimport { mkdir, realpath, rename, unlink, writeFile } from 'node:fs/promises'\nimport { dirname, isAbsolute, relative, resolve, sep } from 'node:path'\nimport { Readable, Transform } from 'node:stream'\nimport { pipeline } from 'node:stream/promises'\nimport * as core from '@actions/core'\nimport type { Bucket, SseCDownloadKey } from '@backblaze-labs/b2-sdk'\nimport {\n type DownloadHeaderOverrides,\n downloadHeaderOverridesFromInputs,\n} from '../download-overrides.ts'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link DownloadResult.files}. */\nexport interface DownloadedFile {\n /** B2 file name (the key that was fetched). */\n fileName: string\n /** Absolute path on the runner where the body landed. */\n localPath: string\n /** Byte size of the downloaded body. */\n size: number\n /** Remote SHA-1, or `null` if the file was multipart-uploaded (B2 doesn't store a whole-file SHA-1 in that case). */\n contentSha1: string | null\n}\n\n/** Result of {@link downloadCommand}. */\nexport interface DownloadResult {\n /** One entry per downloaded file. Single-file modes return a one-element array. */\n files: DownloadedFile[]\n /** Total bytes transferred across all files. */\n bytesTransferred: number\n}\n\ninterface PathSafetyContext {\n realRoot: string\n safeAncestorDirs: Set\n}\n\ninterface DownloadPathSafety {\n root: string\n realRoot: string\n}\n\ninterface PlannedDownload {\n fileName: string\n localPath: string\n}\n\ninterface LocalPathOwner {\n fileName: string\n localPath: string\n}\n\ninterface ReplaceDownloadedFileOptions {\n platform?: NodeJS.Platform\n renameFile?: typeof rename\n unlinkFile?: typeof unlink\n}\n\n/**\n * Download from B2 to the local runner.\n *\n * Modes:\n * - If `source` ends with `/`, treat it as a prefix and download every file\n * under it to the local directory at `destination` (defaults to `.`).\n * - Otherwise download a single file. If `destination` ends with `/` or\n * resolves to an existing directory, write into that directory using the\n * basename of `source`. Else `destination` is the exact output file path.\n * If unset, the file's basename is used in the current working directory.\n */\nexport async function downloadCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'download', 'a B2 file name or prefix')\n const isPrefix = source.endsWith('/')\n\n const sseDownload = sseFromInputs(inputs)\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n\n if (isPrefix) {\n return downloadPrefix(\n bucket,\n source,\n inputs.destination ?? '.',\n sseDownload,\n downloadOverrides,\n signal,\n )\n }\n const out = await downloadOne(\n bucket,\n source,\n inputs.destination,\n sseDownload,\n downloadOverrides,\n signal,\n )\n return { files: [out], bytesTransferred: out.size }\n}\n\nfunction sseFromInputs(inputs: ParsedInputs): SseCDownloadKey | undefined {\n const e = inputs.encryption\n if (e === undefined || e.mode !== 'SSE-C') return undefined\n return {\n algorithm: 'AES256',\n customerKey: e.customerKey,\n customerKeyMd5: e.customerKeyMd5,\n }\n}\n\nasync function downloadPrefix(\n bucket: Bucket,\n prefix: string,\n destinationDir: string,\n sseDownload: SseCDownloadKey | undefined,\n downloadOverrides: DownloadHeaderOverrides,\n signal?: AbortSignal,\n): Promise {\n const destRoot = resolve(destinationDir)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n const downloadPathSafety = { root: destRoot, realRoot: pathSafety.realRoot }\n const caseInsensitivePaths = await isCaseInsensitiveDirectory(destRoot)\n\n const planned: PlannedDownload[] = []\n const localPathOwners = new Map()\n const localPathAncestorOwners = new Map()\n let startFileName: string | undefined\n\n for (;;) {\n signal?.throwIfAborted()\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n signal?.throwIfAborted()\n // `listFileNames({ prefix })` returns files matching `prefix` per the\n // SDK / B2 contract, so the slice is always safe. Empty `prefix`\n // leaves the name unchanged.\n const relName = f.fileName.slice(prefix.length)\n const localPath = await resolvePathUnderRoot(\n destRoot,\n safeRemotePathSegments(relName, f.fileName),\n f.fileName,\n pathSafety,\n )\n recordPlannedLocalPath(\n { fileName: f.fileName, localPath },\n destRoot,\n caseInsensitivePaths,\n localPathOwners,\n localPathAncestorOwners,\n )\n planned.push({ fileName: f.fileName, localPath })\n }\n // SDK contract: `nextFileName` is `string | null` per `ListFileNamesResponse`.\n // The \"not null\" arm fires for prefixes with >1000 files (covered by\n // the real-pagination test in coverage-stress).\n if (page.nextFileName === null) break\n startFileName = page.nextFileName\n }\n\n const files: DownloadedFile[] = []\n let total = 0\n for (const plan of planned) {\n signal?.throwIfAborted()\n core.startGroup(`download b2://${bucket.name}/${plan.fileName} → ${plan.localPath}`)\n try {\n const r = await downloadOne(\n bucket,\n plan.fileName,\n plan.localPath,\n sseDownload,\n downloadOverrides,\n signal,\n downloadPathSafety,\n )\n files.push(r)\n total += r.size\n } finally {\n core.endGroup()\n }\n }\n\n return { files, bytesTransferred: total }\n}\n\nasync function downloadOne(\n bucket: Bucket,\n fileName: string,\n destination: string | undefined,\n sseDownload: SseCDownloadKey | undefined,\n downloadOverrides: DownloadHeaderOverrides,\n signal?: AbortSignal,\n pathSafety?: DownloadPathSafety,\n): Promise {\n const localPath =\n pathSafety !== undefined && destination !== undefined\n ? resolve(destination)\n : await resolveLocalPath(fileName, destination)\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n await mkdir(dirname(localPath), { recursive: true })\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n\n const result = await bucket.download(fileName, {\n ...(sseDownload !== undefined ? { serverSideEncryption: sseDownload } : {}),\n ...downloadOverrides,\n ...(signal !== undefined ? { signal } : {}),\n })\n const size = result.headers.contentLength\n const sha1 = result.headers.contentSha1\n\n // Wrap the body in a byte-counting Transform that synthesizes ProgressEvents\n // for the shared progress listener. The SDK doesn't expose progress for\n // single-shot downloads; we compute it here from the known content-length.\n const onProgress = makeProgressListener(`download[${fileName}]`)\n const startedAt = Date.now()\n let bytesSeen = 0\n const counter = new Transform({\n transform(chunk: Buffer, _enc, cb) {\n // The transform only runs when the body has bytes to push; for a zero-\n // length response Node's stream pipeline closes without invoking it,\n // so `size` is provably > 0 here.\n bytesSeen += chunk.length\n onProgress({\n bytesTransferred: bytesSeen,\n totalBytes: size,\n partsCompleted: 0,\n totalParts: null,\n elapsedMs: Date.now() - startedAt,\n })\n cb(null, chunk)\n },\n })\n\n if (pathSafety !== undefined) {\n await assertFreshAncestryInsideRoot(pathSafety, localPath, fileName)\n }\n const tempPath = `${localPath}.b2-action-download-${randomUUID()}.tmp`\n const writeStream = createWriteStream(tempPath, { flags: 'wx' })\n try {\n await pipeline(\n Readable.fromWeb(result.body as unknown as Parameters[0]),\n counter,\n writeStream,\n )\n await replaceDownloadedFile(tempPath, localPath)\n } catch (err) {\n // Partial download on disk is worse than no file. Write through a\n // same-directory temporary file and rename only after the body completes,\n // which also avoids following an existing symlink at the final leaf.\n try {\n await unlink(tempPath)\n } catch {\n // ignore: best-effort cleanup, the original error matters more\n }\n throw err\n }\n\n core.info(` wrote ${size} bytes to ${localPath} (sha1=${sha1 ?? 'multipart'})`)\n\n return { fileName, localPath, size, contentSha1: sha1 }\n}\n\n/**\n * Atomically move a completed same-directory download into place.\n *\n * @internal\n */\nexport async function replaceDownloadedFile(\n tempPath: string,\n localPath: string,\n {\n platform = process.platform,\n renameFile = rename,\n unlinkFile = unlink,\n }: ReplaceDownloadedFileOptions = {},\n): Promise {\n try {\n await renameFile(tempPath, localPath)\n } catch (renameError) {\n const retryWindowsOverwrite =\n platform === 'win32' &&\n typeof renameError === 'object' &&\n renameError !== null &&\n 'code' in renameError &&\n (renameError.code === 'EEXIST' || renameError.code === 'EPERM')\n if (!retryWindowsOverwrite) throw renameError\n\n // Windows refuses to rename over an existing leaf. Remove only the leaf\n // path, which unlinks symlinks instead of following them, then retry the\n // completed same-directory temp-file move.\n try {\n await unlinkFile(localPath)\n } catch (unlinkError) {\n if (!isFileNotFound(unlinkError)) throw unlinkError\n }\n await renameFile(tempPath, localPath)\n }\n}\n\n/**\n * Resolve the local target path for a single B2 download.\n *\n * @internal\n */\nexport async function resolveLocalPath(\n fileName: string,\n destination: string | undefined,\n): Promise {\n if (destination === undefined || destination === '') {\n return resolve(safeRemotePathTail(fileName))\n }\n if (destination.endsWith('/') || destination.endsWith('\\\\')) {\n const destRoot = resolve(destination)\n await mkdir(destRoot, { recursive: true })\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n const s = await tryStat(destination)\n if (s?.isDirectory()) {\n const destRoot = resolve(destination)\n const pathSafety = await createPathSafetyContext(destRoot)\n return await resolvePathUnderRoot(\n destRoot,\n [safeRemotePathTail(fileName)],\n fileName,\n pathSafety,\n )\n }\n return resolve(destination)\n}\n\nasync function resolvePathUnderRoot(\n root: string,\n segments: string[],\n fileName: string,\n pathSafety: PathSafetyContext,\n) {\n const localPath = resolve(root, ...segments)\n const rel = relative(root, localPath)\n if (!isPathInsideRootRelative(rel)) {\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n }\n await assertExistingAncestryInsideRoot(pathSafety, localPath, fileName)\n return localPath\n}\n\nfunction isPathInsideRootRelative(rel: string): boolean {\n return rel === '' || (!isAbsolute(rel) && rel !== '..' && !rel.startsWith(`..${sep}`))\n}\n\nasync function createPathSafetyContext(root: string): Promise {\n return { realRoot: await realpath(root), safeAncestorDirs: new Set([root]) }\n}\n\nasync function assertFreshAncestryInsideRoot(\n pathSafety: DownloadPathSafety,\n localPath: string,\n fileName: string,\n): Promise {\n await assertExistingAncestryInsideRoot(\n { realRoot: pathSafety.realRoot, safeAncestorDirs: new Set() },\n localPath,\n fileName,\n )\n}\n\nasync function assertExistingAncestryInsideRoot(\n pathSafety: PathSafetyContext,\n localPath: string,\n fileName: string,\n): Promise {\n let candidate = dirname(localPath)\n const checkedDirs: string[] = []\n\n for (;;) {\n if (pathSafety.safeAncestorDirs.has(candidate)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n checkedDirs.push(candidate)\n try {\n const realCandidate = await realpath(candidate)\n const rel = relative(pathSafety.realRoot, realCandidate)\n if (isPathInsideRootRelative(rel)) {\n for (const checked of checkedDirs) pathSafety.safeAncestorDirs.add(checked)\n return\n }\n throw new Error(`download path for B2 file \"${fileName}\" escapes destination directory`)\n } catch (error) {\n if (!isFileNotFound(error)) throw error\n const parent = dirname(candidate)\n if (parent === candidate) throw error\n candidate = parent\n }\n }\n}\n\nfunction isFileNotFound(error: unknown): boolean {\n return typeof error === 'object' && error !== null && 'code' in error && error.code === 'ENOENT'\n}\n\nasync function isCaseInsensitiveDirectory(dir: string): Promise {\n const marker = `.b2-action-case-check-${randomUUID()}`\n const lowerPath = resolve(dir, marker.toLowerCase())\n const upperPath = resolve(dir, marker.toUpperCase())\n\n try {\n await writeFile(lowerPath, '')\n } catch (error) {\n core.warning(\n `Could not probe case sensitivity in ${dir}; treating download collision checks as case-sensitive (${error instanceof Error ? error.message : String(error)})`,\n )\n return false\n }\n try {\n try {\n return (await realpath(lowerPath)) === (await realpath(upperPath))\n } catch (error) {\n if (isFileNotFound(error)) return false\n throw error\n }\n } finally {\n try {\n await unlink(lowerPath)\n } catch (error) {\n core.warning(\n `Could not remove B2 action case-sensitivity probe ${lowerPath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n}\n\nfunction localPathCollisionKey(localPath: string, caseInsensitivePaths: boolean): string {\n return caseInsensitivePaths ? localPath.toLowerCase() : localPath\n}\n\nfunction recordPlannedLocalPath(\n owner: LocalPathOwner,\n root: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n localPathAncestorOwners: Map,\n): void {\n const collisionKey = localPathCollisionKey(owner.localPath, caseInsensitivePaths)\n const existingFile = localPathOwners.get(collisionKey)\n if (existingFile !== undefined && existingFile.fileName !== owner.fileName) {\n throw new Error(\n `download path collision: B2 files \"${existingFile.fileName}\" and \"${owner.fileName}\" both map to \"${owner.localPath}\"`,\n )\n }\n\n const existingDescendant = localPathAncestorOwners.get(collisionKey)\n if (existingDescendant !== undefined && existingDescendant.fileName !== owner.fileName) {\n throwFileDirectoryCollision(owner, existingDescendant)\n }\n\n const existingAncestor = findLocalPathFileAncestor(\n root,\n owner.localPath,\n caseInsensitivePaths,\n localPathOwners,\n )\n if (existingAncestor !== undefined && existingAncestor.fileName !== owner.fileName) {\n throwFileDirectoryCollision(existingAncestor, owner)\n }\n\n localPathOwners.set(collisionKey, owner)\n rememberLocalPathAncestors(root, owner, caseInsensitivePaths, localPathAncestorOwners)\n}\n\nfunction findLocalPathFileAncestor(\n root: string,\n localPath: string,\n caseInsensitivePaths: boolean,\n localPathOwners: Map,\n): LocalPathOwner | undefined {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return undefined\n const owner = localPathOwners.get(parentKey)\n if (owner !== undefined) return owner\n const next = dirname(parent)\n if (next === parent) return undefined\n parent = next\n }\n}\n\nfunction rememberLocalPathAncestors(\n root: string,\n owner: LocalPathOwner,\n caseInsensitivePaths: boolean,\n localPathAncestorOwners: Map,\n): void {\n const rootKey = localPathCollisionKey(root, caseInsensitivePaths)\n let parent = dirname(owner.localPath)\n\n for (;;) {\n const parentKey = localPathCollisionKey(parent, caseInsensitivePaths)\n if (parentKey === rootKey) return\n if (!localPathAncestorOwners.has(parentKey)) localPathAncestorOwners.set(parentKey, owner)\n const next = dirname(parent)\n if (next === parent) return\n parent = next\n }\n}\n\nfunction throwFileDirectoryCollision(\n fileOwner: LocalPathOwner,\n descendantOwner: LocalPathOwner,\n): never {\n throw new Error(\n `download path collision: B2 file \"${fileOwner.fileName}\" maps to \"${fileOwner.localPath}\", which must be a file, but B2 file \"${descendantOwner.fileName}\" maps beneath it at \"${descendantOwner.localPath}\"`,\n )\n}\n\nfunction safeRemotePathSegments(fileName: string, displayName = fileName): string[] {\n const segments = fileName.split('/')\n for (const segment of segments) {\n validateRemotePathSegment(segment, displayName)\n }\n return segments\n}\n\nfunction safeRemotePathTail(fileName: string): string {\n const tail = fileName.split('/').at(-1) ?? ''\n validateRemotePathSegment(tail, fileName)\n return tail\n}\n\nfunction validateRemotePathSegment(segment: string, fileName: string): void {\n if (segment === '' || segment === '.' || segment === '..') {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains an empty, \".\" or \"..\" path segment`,\n )\n }\n for (const char of segment) {\n const codePoint = char.codePointAt(0)\n if (codePoint !== undefined && (codePoint <= 0x1f || codePoint === 0x7f)) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped because it contains a control character`,\n )\n }\n }\n\n // B2 keys are opaque, but prefix downloads must project `/`-separated\n // keys into the runner filesystem without path traversal or lossy rewrites.\n // POSIX runners can preserve characters such as `:`, `?`, trailing dots,\n // and Windows device names verbatim. Windows treats several of those as\n // separators or invalid/reserved filenames, so reject them there instead of\n // silently changing the on-disk name or risking two B2 keys overwriting one\n // local path.\n if (\n process.platform === 'win32' &&\n (/[<>:\"|?*\\\\]/u.test(segment) ||\n /[. ]$/u.test(segment) ||\n /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/iu.test(segment))\n ) {\n throw new Error(\n `download path for B2 file \"${fileName}\" cannot be safely mapped on Windows because segment \"${segment}\" is reserved or contains a Windows path character`,\n )\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link headCommand}: metadata read from a HEAD request, no body. */\nexport interface HeadResult {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file (from `Content-Length`). */\n size: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** B2-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Custom `X-Bz-Info-*` headers attached at upload time. */\n fileInfo: Record\n}\n\n/**\n * HEAD-only metadata probe. Fetches the headers of an object without\n * downloading the body. Useful for cheap \"does this exist and what's its\n * size / sha1 / contentType?\" checks, or to inspect custom `fileInfo`\n * metadata that the uploader attached.\n *\n * Returns all output fields as step outputs so downstream steps can branch\n * on them.\n */\nexport async function headCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'head', 'the B2 file name')\n\n core.startGroup(`head b2://${bucket.name}/${source}`)\n try {\n // `bucket.head` returns only the parsed response headers; no body to\n // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n const { headers: h } = await bucket.head(source)\n core.info(\n ` size=${h.contentLength} type=${h.contentType} sha1=${h.contentSha1 ?? 'multipart'}`,\n )\n return {\n fileName: h.fileName,\n fileId: h.fileId,\n size: h.contentLength,\n contentType: h.contentType,\n contentSha1: h.contentSha1,\n uploadTimestamp: h.uploadTimestamp,\n fileInfo: h.fileInfo,\n }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link hideCommand}: identifies the hide marker that was just created. */\nexport interface HideResult {\n /** B2 file name that was hidden. */\n fileName: string\n /** File ID of the hide marker (a special version with `action: 'hide'`). */\n fileId: string\n}\n\n/**\n * Hide a file in B2 (creates a \"hide marker\" file version that masks the\n * previous version from `listFileNames` and downloads-by-name).\n *\n * Versioning is always on in B2, so hide is a soft-delete: the underlying\n * data and prior versions remain until lifecycle rules collect them. To\n * permanently delete, use the `delete` command.\n *\n * To unhide, run `delete` against the hide marker's `fileId` (use `list`\n * with versions if you need to discover it).\n */\nexport async function hideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'hide', 'the B2 file name')\n\n core.startGroup(`hide b2://${bucket.name}/${source}`)\n try {\n const result = await bucket.hideFile(source)\n core.info(` hidden: ${result.fileName} (marker fileId=${result.fileId})`)\n return { fileName: result.fileName, fileId: result.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\n\n/** One entry in {@link ListResult.files}. Mirrors the SDK's per-version metadata. */\nexport interface ListedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID. */\n fileId: string\n /** Byte size of the file. */\n size: number\n /** Whole-file SHA-1, or `null` for multipart uploads. */\n contentSha1: string | null\n /** Server-side upload timestamp in milliseconds since the epoch. */\n uploadTimestamp: number\n /** Content-Type the file was uploaded with. */\n contentType: string\n /** Custom `X-Bz-Info-*` headers from upload time. */\n fileInfo: Record\n}\n\n/** Result of {@link listCommand}. */\nexport interface ListResult {\n /** Files matching the prefix, capped by `maxResults`. */\n files: ListedFile[]\n /** True when more visible upload files exist beyond `maxResults`. Use to detect pagination. */\n truncated: boolean\n}\n\n/**\n * List file names under a prefix.\n *\n * `source` is the prefix (use trailing `/` to list a \"directory\"). Empty\n * `source` lists everything the application key is allowed to see. Pagination\n * is followed transparently up to `max-results` matches.\n *\n * Useful for \"decide what to do next\" workflow steps:\n * - inventory before a delete\n * - find the most recent release artifact to promote\n * - emit a JSON manifest as a build output\n */\nexport async function listCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const prefix = inputs.source ?? ''\n const maxResults = inputs.maxResults\n const files: ListedFile[] = []\n let startFileName: string | undefined\n\n core.startGroup(`list b2://${bucket.name}/${prefix} (max ${maxResults})`)\n try {\n while (files.length < maxResults) {\n const remaining = maxResults - files.length\n const pageSize = Math.min(1000, remaining)\n const page = await bucket.listFileNames({\n prefix,\n pageSize,\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n files.push({\n fileName: f.fileName,\n fileId: f.fileId,\n size: f.contentLength,\n contentSha1: f.contentSha1,\n uploadTimestamp: f.uploadTimestamp,\n contentType: f.contentType,\n fileInfo: f.fileInfo,\n })\n if (files.length >= maxResults) {\n if (!page.nextFileName) return { files, truncated: false }\n return {\n files,\n truncated: await hasVisibleUploadAfter(bucket, prefix, page.nextFileName),\n }\n }\n }\n\n if (!page.nextFileName) {\n return { files, truncated: false }\n }\n startFileName = page.nextFileName\n }\n\n return { files, truncated: true }\n } finally {\n core.info(` ${files.length} file(s) listed`)\n core.endGroup()\n }\n}\n\nasync function hasVisibleUploadAfter(\n bucket: Bucket,\n prefix: string,\n startFileName: string,\n): Promise {\n let cursor: string | undefined = startFileName\n\n while (cursor !== undefined) {\n const page = await bucket.listFileNames({\n prefix,\n pageSize: 1000,\n startFileName: cursor,\n })\n if (page.files.some((f) => f.action === 'upload')) return true\n cursor = page.nextFileName ?? undefined\n }\n\n return false\n}\n","import { redactUrlForError } from \"../internal/url-redaction.js\";\nimport { encodeFileName } from \"../raw/encoding.js\";\nimport { hostMatchesAllowedSuffix } from \"../http/url-guard.js\";\nimport { hasHttpHeaderControlCharacter } from \"../util/http.js\";\nimport { assertNativeDownloadFileName, assertSafeBucketName } from \"./validation.js\";\nimport { presignS3Request } from \"./sigv4.js\";\n//#region src/s3/index.ts\nvar HTTP_HEADER_TOKEN = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\nvar HTTP_MEDIA_TYPE = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+\\/[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\nvar DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN = 3600;\nvar TRUSTED_NATIVE_DOWNLOAD_HOST_SUFFIXES = [\n\t\"backblazeb2.com\",\n\t\"backblaze.com\",\n\t\"backblaze.net\",\n\t\"b2-staging.io\"\n];\nvar BROWSER_EXECUTABLE_CONTENT_TYPES = /* @__PURE__ */ new Set([\n\t\"text/html\",\n\t\"application/xhtml+xml\",\n\t\"image/svg+xml\",\n\t\"application/javascript\",\n\t\"text/javascript\",\n\t\"application/x-javascript\",\n\t\"text/x-javascript\",\n\t\"application/ecmascript\",\n\t\"text/ecmascript\",\n\t\"application/x-ecmascript\",\n\t\"text/x-ecmascript\",\n\t\"text/xml\",\n\t\"application/xml\"\n]);\n/**\n* Server-side opt-in token for unsafe S3 presign options.\n*\n* Use this token as the value for `allowBrowserExecutableContentType`,\n* `allowBrowserExecutableResponseContentType`, or\n* `allowInlineResponseContentDisposition` only when active content or inline\n* rendering from the storage origin is intentional and trusted.\n*/\nvar trustedUnsafeS3PresignOptIn = Object.freeze({ __trustedUnsafeS3PresignOptIn: \"trustedUnsafeS3PresignOptIn\" });\n/**\n* Derives an S3-compatible client configuration from B2 authorization state.\n* Pass the result to `new S3Client(config)` from `@aws-sdk/client-s3`.\n*\n* Non-standard, custom, or proxied endpoints require an explicit `region`; set\n* it before deploying this SDK to those endpoints. The SDK no longer falls back\n* to `us-west-004` because that can mis-sign requests.\n*\n* @param config - B2 auth state, application key credentials, and optional region override.\n*\n* @returns Configuration ready for the AWS S3 SDK.\n*\n* @example\n* ```ts\n* const { B2_APPLICATION_KEY_ID, B2_APPLICATION_KEY } = process.env\n* if (!B2_APPLICATION_KEY_ID || !B2_APPLICATION_KEY) throw new Error('Missing B2 credentials')\n* const s3 = new S3Client(createS3ClientConfig({\n* accountInfo: client.accountInfo,\n* applicationKeyId: B2_APPLICATION_KEY_ID,\n* applicationKey: B2_APPLICATION_KEY,\n* }))\n* ```\n*/\nfunction createS3ClientConfig(config) {\n\tconst s3Url = config.accountInfo.getS3ApiUrl();\n\tconst region = config.region ?? deriveRequiredS3Region(s3Url);\n\tassertNonEmptyStringOption(\"applicationKeyId\", config.applicationKeyId);\n\tassertNonEmptyStringOption(\"applicationKey\", config.applicationKey);\n\tassertNonEmptyStringOption(\"region\", region);\n\tassertSigV4CredentialScopeComponent(\"applicationKeyId\", config.applicationKeyId);\n\tassertSigV4CredentialScopeComponent(\"region\", region);\n\treturn {\n\t\tendpoint: s3Url,\n\t\tregion,\n\t\tcredentials: {\n\t\t\taccessKeyId: config.applicationKeyId,\n\t\t\tsecretAccessKey: config.applicationKey\n\t\t},\n\t\tforcePathStyle: true\n\t};\n}\n/**\n* Extracts the B2 S3 region from a standard B2 S3 endpoint.\n*\n* Custom endpoints cannot be inferred safely. Pass `region` explicitly to\n* {@link createS3ClientConfig}, {@link presignS3GetObjectUrl}, or\n* {@link presignS3PutObjectUrl} when this returns `null`.\n*\n* @param endpoint - The S3 endpoint URL.\n*\n* @returns The derived region, or `null` when the endpoint is not a standard B2 S3 URL.\n*/\nfunction deriveS3RegionFromEndpoint(endpoint) {\n\tlet hostname;\n\ttry {\n\t\thostname = new URL(endpoint).hostname.toLowerCase();\n\t} catch {\n\t\treturn null;\n\t}\n\treturn /^s3\\.([a-z0-9-]+)\\.backblazeb2\\.com$/.exec(hostname)?.[1] ?? null;\n}\n/**\n* Generates an AWS Signature Version 4 presigned GET URL for B2's S3-compatible API.\n*\n* This helper signs internally and does not pass the B2 application key to\n* runtime peer dependencies. Response override options are signed into the URL\n* and control headers served from the storage origin; do not populate them from\n* untrusted input without an allow-list. Presign success does not prove the URL\n* will be accepted later; keep URL-generating hosts clock-synchronized and\n* check clock skew when downstream use returns SigV4 403 errors.\n*\n* @param options - B2 auth state, S3 credentials, target object, and signing options.\n*\n* @returns The presigned URL string.\n*/\nasync function presignS3GetObjectUrl(options) {\n\tconst query = [[\"x-id\", \"GetObject\"]];\n\tif (options.versionId !== void 0) {\n\t\tassertSafeQueryValue(\"versionId\", options.versionId);\n\t\tquery.push([\"versionId\", options.versionId]);\n\t}\n\tif (options.responseCacheControl !== void 0) {\n\t\tassertSafeResponseOverride(\"responseCacheControl\", options.responseCacheControl);\n\t\tquery.push([\"response-cache-control\", options.responseCacheControl]);\n\t}\n\tif (options.responseContentDisposition !== void 0) {\n\t\tassertSafeResponseContentDisposition(options.responseContentDisposition, isTrustedUnsafeS3PresignOptIn(options.allowInlineResponseContentDisposition));\n\t\tquery.push([\"response-content-disposition\", options.responseContentDisposition]);\n\t}\n\tif (options.responseContentEncoding !== void 0) {\n\t\tassertSafeResponseOverride(\"responseContentEncoding\", options.responseContentEncoding);\n\t\tquery.push([\"response-content-encoding\", options.responseContentEncoding]);\n\t}\n\tif (options.responseContentLanguage !== void 0) {\n\t\tassertSafeResponseOverride(\"responseContentLanguage\", options.responseContentLanguage);\n\t\tquery.push([\"response-content-language\", options.responseContentLanguage]);\n\t}\n\tif (options.responseContentType !== void 0) {\n\t\tif (isTrustedUnsafeS3PresignOptIn(options.allowBrowserExecutableResponseContentType)) assertSafeContentTypeValue(\"responseContentType\", options.responseContentType, \"response header value\");\n\t\telse assertSafeResponseContentType(options.responseContentType);\n\t\tquery.push([\"response-content-type\", options.responseContentType]);\n\t}\n\tif (options.responseExpires !== void 0) query.push([\"response-expires\", normalizeResponseExpires(options.responseExpires)]);\n\treturn await presignS3Request(\"GET\", createSigV4PresignOptions(options), query, []);\n}\n/**\n* Returns a B2-native download-authorization URL, not an S3 presigned URL.\n*\n* This deprecated helper preserves the legacy positional output contract where\n* the whole file name is encoded as one URL component, including `/` as `%2F`.\n* It keeps the legacy string-building contract for callers that relied on\n* custom/local download URLs or permissive inputs. Use\n* {@link createNativeDownloadAuthorizationUrl} for strict validation.\n*\n* @param downloadUrl - The B2 download URL from authorization.\n* @param bucketName - The bucket containing the file.\n* @param fileName - The file name (path) to download.\n* @param authorizationToken - A download authorization token from `b2_get_download_authorization`.\n* @param validDurationInSeconds - Compatibility-only value for the non-authoritative `expires` query.\n*\n* @returns The B2 native download-authorization URL string.\n*\n* @deprecated Use {@link createNativeDownloadAuthorizationUrl} for B2 native\n* download-token URLs, or {@link presignS3GetObjectUrl} for real S3-compatible\n* AWS Signature Version 4 presigned GET URLs.\n*/\nfunction presignGetObjectUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds) {\n\tconst expires = Math.floor(Date.now() / 1e3) + (validDurationInSeconds ?? DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN);\n\treturn `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeURIComponent(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;\n}\n/**\n* Generates an AWS Signature Version 4 presigned PUT URL for browser or\n* third-party uploads through B2's S3-compatible API.\n*\n* This helper signs internally and does not pass the B2 application key to\n* runtime peer dependencies. A presigned PUT URL is a replayable bearer\n* credential for writing one key until expiry. Retried PUTs can create\n* duplicate B2 file versions when a response is lost after B2 stored the object.\n* Use unique keys or reconcile uploaded file IDs/checksums, and configure\n* lifecycle/version cleanup where duplicate versions must be removed\n* automatically. If `contentType` and `contentLength` are omitted, the holder\n* can choose any content type, including browser-executable types, and any size\n* accepted by B2; bind both values before handing URLs to untrusted uploaders\n* to limit financial-DoS and content-type smuggling risk.\n*\n* @param options - B2 auth state, S3 credentials, target object, and signing options.\n*\n* @returns The presigned URL string.\n*/\nasync function presignS3PutObjectUrl(options) {\n\tconst headers = [];\n\tif (options.contentType !== void 0) {\n\t\tif (isTrustedUnsafeS3PresignOptIn(options.allowBrowserExecutableContentType)) assertSafeContentTypeValue(\"contentType\", options.contentType, \"stored object Content-Type\");\n\t\telse assertSafePutContentType(options.contentType);\n\t\theaders.push([\"content-type\", options.contentType]);\n\t}\n\tif (options.contentLength !== void 0) headers.push([\"content-length\", normalizeContentLength(options.contentLength)]);\n\theaders.push(...normalizeMetadataHeaders(options.metadata));\n\treturn await presignS3Request(\"PUT\", createSigV4PresignOptions(options), [[\"x-id\", \"PutObject\"]], headers);\n}\n/**\n* Generates an AWS Signature Version 4 presigned PUT URL for B2's\n* S3-compatible API.\n*\n* @param options - B2 auth state, S3 credentials, target object, and signing options.\n*\n* @returns The presigned URL string.\n*\n* @deprecated Use {@link presignS3PutObjectUrl}; this alias is retained for\n* pre-release callers that adopted the shorter name.\n*/\nasync function presignPutObjectUrl(options) {\n\treturn await presignS3PutObjectUrl(options);\n}\n/**\n* Constructs a B2-native download URL using a token from `b2_get_download_authorization`.\n* This is not an S3 presigned URL.\n*\n* The token lifetime is fixed when `b2_get_download_authorization` creates the\n* token. `validDurationInSeconds` is retained only for compatibility with the\n* legacy `presignGetObjectUrl` helper's decorative `expires` query parameter;\n* changing it here does not shorten or extend access.\n* Because the returned URL carries a bearer token, `downloadUrl` must be an\n* HTTPS Backblaze download origin without userinfo, path, query, or fragment.\n*\n* @param downloadUrl - The B2 download URL from authorization (e.g., `https://f004.backblazeb2.com`).\n* @param bucketName - The bucket containing the file.\n* @param fileName - The file name (path) to download.\n* @param authorizationToken - A download authorization token from `b2_get_download_authorization`.\n* @param validDurationInSeconds - Compatibility-only value for the non-authoritative `expires` query.\n*\n* @returns The B2 native download-authorization URL string, not an S3 presigned URL.\n*/\nfunction createNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds = DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN) {\n\treturn buildNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds, encodeFileName, assertNativeDownloadFileName);\n}\nfunction deriveRequiredS3Region(endpoint) {\n\tconst region = deriveS3RegionFromEndpoint(endpoint);\n\tif (region !== null) return region;\n\tthrow new Error(`Unable to derive B2 S3 region from endpoint \"${redactUrlForError(endpoint, { invalidUrlLabel: \"\" })}\". Pass an explicit \\`region\\` option before deploying custom or proxied endpoints.`);\n}\nfunction createSigV4PresignOptions(options) {\n\tconst clientConfig = createS3ClientConfig(options);\n\treturn {\n\t\tendpoint: clientConfig.endpoint,\n\t\tregion: clientConfig.region,\n\t\taccessKeyId: clientConfig.credentials.accessKeyId,\n\t\tsecretAccessKey: clientConfig.credentials.secretAccessKey,\n\t\tbucketName: options.bucketName,\n\t\tfileName: options.fileName,\n\t\t...options.expiresIn !== void 0 ? { expiresIn: options.expiresIn } : {}\n\t};\n}\nfunction normalizeContentLength(contentLength) {\n\tif (!Number.isSafeInteger(contentLength) || contentLength < 0) throw new RangeError(`contentLength must be a non-negative safe integer; received ${String(contentLength)}.`);\n\treturn String(contentLength);\n}\nfunction normalizeValidDurationInSeconds(validDurationInSeconds) {\n\tif (!Number.isSafeInteger(validDurationInSeconds) || validDurationInSeconds < 0) throw new RangeError(`validDurationInSeconds must be a non-negative safe integer; received ${String(validDurationInSeconds)}.`);\n\treturn validDurationInSeconds;\n}\nfunction assertNonEmptyStringOption(name, value) {\n\tif (typeof value !== \"string\" || value.trim().length === 0) throw new TypeError(`${name} must be a non-empty string.`);\n}\nfunction assertSigV4CredentialScopeComponent(name, value) {\n\tif (/[\\s/]/u.test(value) || hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain whitespace, control characters, or \"/\" because it is embedded in the SigV4 credential scope.`);\n}\nfunction isTrustedUnsafeS3PresignOptIn(value) {\n\treturn value === trustedUnsafeS3PresignOptIn;\n}\nfunction buildNativeDownloadAuthorizationUrl(downloadUrl, bucketName, fileName, authorizationToken, validDurationInSeconds, encodeFileNameForUrl, assertFileName) {\n\tconst baseUrl = parseNativeDownloadBaseUrl(downloadUrl);\n\tassertSafeBucketName(bucketName);\n\tassertFileName(fileName);\n\tconst expires = Math.floor(Date.now() / 1e3) + normalizeValidDurationInSeconds(validDurationInSeconds);\n\treturn `${baseUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileNameForUrl(fileName)}?Authorization=${encodeURIComponent(authorizationToken)}&expires=${expires}`;\n}\nfunction parseNativeDownloadBaseUrl(downloadUrl) {\n\tlet base;\n\ttry {\n\t\tbase = new URL(downloadUrl);\n\t} catch {\n\t\tthrow new TypeError(`Native download-authorization URLs require a valid https: downloadUrl; received \"${redactUrlForError(downloadUrl, { invalidUrlLabel: \"\" })}\".`);\n\t}\n\tif (base.protocol !== \"https:\") throw new TypeError(`Native download-authorization URLs require an https: downloadUrl; received \"${redactUrlForError(base)}\".`);\n\tif (base.username !== \"\" || base.password !== \"\") throw new TypeError(\"Native download-authorization URLs must not include userinfo.\");\n\tif (base.search !== \"\" || base.hash !== \"\") throw new TypeError(\"Native download-authorization URLs must not include query or fragment.\");\n\tif (base.pathname !== \"\" && base.pathname !== \"/\") throw new TypeError(\"Native download-authorization URLs must not include a path.\");\n\tif (!isTrustedNativeDownloadHost(base.hostname)) throw new TypeError(`Native download-authorization URLs require a Backblaze download host; received \"${redactUrlForError(base)}\".`);\n\treturn base.origin;\n}\nfunction normalizeMetadataHeaders(metadata) {\n\tconst headers = [];\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tfor (const [key, value] of Object.entries(metadata ?? {})) {\n\t\tif (!HTTP_HEADER_TOKEN.test(key)) throw new TypeError(`metadata key \"${key}\" must be a non-empty valid HTTP header token.`);\n\t\tif (typeof value !== \"string\") throw new TypeError(`metadata value for \"${key}\" must be a string.`);\n\t\tconst lowerKey = key.toLowerCase();\n\t\tif (seenKeys.has(lowerKey)) throw new TypeError(`metadata key \"${key}\" must not differ only by case.`);\n\t\tseenKeys.add(lowerKey);\n\t\theaders.push([`x-amz-meta-${lowerKey}`, value]);\n\t}\n\treturn headers;\n}\nfunction normalizeResponseExpires(responseExpires) {\n\tif (!Number.isFinite(responseExpires.getTime())) throw new RangeError(\"responseExpires must be a valid Date.\");\n\treturn responseExpires.toUTCString();\n}\nfunction assertSafeResponseOverride(name, value) {\n\tassertSafeHeaderValue(name, value, \"response header value\");\n}\nfunction assertSafeQueryValue(name, value) {\n\tif (hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain control characters because it becomes a query parameter.`);\n}\nfunction assertSafeHeaderValue(name, value, target) {\n\tif (hasHttpHeaderControlCharacter(value)) throw new TypeError(`${name} must not contain control characters because it becomes a ${target}.`);\n}\nfunction assertSafeResponseContentType(contentType) {\n\tassertNonExecutableContentType(\"responseContentType\", contentType, \"response header value\", \"allow-list a safe content type before signing response overrides\");\n}\nfunction assertSafePutContentType(contentType) {\n\tassertNonExecutableContentType(\"contentType\", contentType, \"stored object Content-Type\", \"pass allowBrowserExecutableContentType only when active content is intentional\");\n}\nfunction assertSafeResponseContentDisposition(contentDisposition, allowInline) {\n\tassertSafeResponseOverride(\"responseContentDisposition\", contentDisposition);\n\tconst disposition = contentDisposition.split(\";\", 1)[0]?.trim().toLowerCase();\n\tif (!allowInline && disposition === \"inline\") throw new TypeError(\"responseContentDisposition must not force inline rendering; use an attachment disposition for response overrides.\");\n}\nfunction mediaTypeFor(contentType) {\n\treturn contentType.split(\";\", 1)[0]?.trim().toLowerCase() ?? \"\";\n}\nfunction assertSafeContentTypeValue(name, contentType, target) {\n\tassertSafeHeaderValue(name, contentType, target);\n\tconst mediaType = mediaTypeFor(contentType);\n\tif (mediaType.length === 0) throw new TypeError(`${name} must include a non-empty media type.`);\n\tif (!HTTP_MEDIA_TYPE.test(mediaType)) throw new TypeError(`${name} must include a valid media type.`);\n\treturn mediaType;\n}\nfunction assertNonExecutableContentType(name, contentType, target, guidance) {\n\tconst mediaType = assertSafeContentTypeValue(name, contentType, target);\n\tif (isBrowserExecutableContentType(mediaType)) throw new TypeError(`${name} \"${mediaType}\" can execute in browsers; ${guidance}.`);\n}\nfunction isBrowserExecutableContentType(mediaType) {\n\treturn BROWSER_EXECUTABLE_CONTENT_TYPES.has(mediaType) || mediaType.endsWith(\"+xml\");\n}\nfunction isTrustedNativeDownloadHost(hostname) {\n\treturn TRUSTED_NATIVE_DOWNLOAD_HOST_SUFFIXES.some((suffix) => hostMatchesAllowedSuffix(hostname, suffix));\n}\n//#endregion\nexport { createNativeDownloadAuthorizationUrl, createS3ClientConfig, deriveS3RegionFromEndpoint, presignGetObjectUrl, presignPutObjectUrl, presignS3GetObjectUrl, presignS3PutObjectUrl, trustedUnsafeS3PresignOptIn };\n\n//# sourceMappingURL=index.js.map","import * as core from '@actions/core'\nimport type { B2Client, Bucket, DownloadAuthorizationRequest } from '@backblaze-labs/b2-sdk'\nimport { presignGetObjectUrl } from '@backblaze-labs/b2-sdk/s3'\nimport {\n appendDownloadHeaderOverrides,\n type DownloadHeaderOverrides,\n downloadHeaderOverridesFromInputs,\n} from '../download-overrides.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** One entry in {@link PresignResult.files}. */\nexport interface PresignedFile {\n /** B2 file name (the key the URL grants access to). */\n fileName: string\n /** Presigned download URL. Masked via `core.setSecret` before this struct is logged. */\n url: string\n /** Expiration time as milliseconds since the epoch. */\n expiresAt: number\n}\n\n/** Result of {@link presignCommand}. */\nexport interface PresignResult {\n /** One entry per generated URL. Single-file mode returns a one-element array. */\n files: PresignedFile[]\n}\n\n/**\n * Generate a presigned download URL for one B2 file or every file under a\n * prefix.\n *\n * Modes:\n * - `source` ending in `/` → prefix mode. List the prefix and emit one\n * presigned URL per file (capped by `max-results`). All URLs share the\n * same `b2_get_download_authorization` token because the auth scope is\n * prefix-based; we just expand it into one URL per matched object.\n * - Otherwise → single-file mode (the original behavior).\n *\n * Every URL is masked via `core.setSecret` so subsequent log lines redact\n * them. The first URL is also exposed as the `presigned-url` step output\n * for the most common one-file workflow.\n */\nexport async function presignCommand(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'presign', 'the B2 file name or prefix')\n\n if (source.endsWith('/')) {\n return presignPrefix(client, bucket, inputs, source)\n }\n\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n return {\n files: [\n await presignOne(client, bucket, source, inputs.presignTtlSeconds, source, downloadOverrides),\n ],\n }\n}\n\nasync function presignPrefix(\n client: B2Client,\n bucket: Bucket,\n inputs: ParsedInputs,\n prefix: string,\n): Promise {\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const downloadOverrides = downloadHeaderOverridesFromInputs(inputs)\n // One auth token covers the whole prefix (that's exactly what\n // `b2_get_download_authorization` is designed for).\n const auth = await getDownloadAuthorization(\n client,\n bucket,\n prefix,\n inputs.presignTtlSeconds,\n downloadOverrides,\n )\n core.setSecret(auth.authorizationToken)\n const expiresAt = Math.floor(Date.now() / 1000) + inputs.presignTtlSeconds\n\n const files: PresignedFile[] = []\n let startFileName: string | undefined\n core.startGroup(`presign prefix b2://${bucket.name}/${prefix} (TTL ${inputs.presignTtlSeconds}s)`)\n try {\n while (files.length < inputs.maxResults) {\n const remaining = inputs.maxResults - files.length\n const page = await bucket.listFileNames({\n prefix,\n pageSize: Math.min(1000, remaining),\n ...(startFileName !== undefined ? { startFileName } : {}),\n })\n for (const f of page.files) {\n if (f.action !== 'upload') continue\n const url = appendDownloadHeaderOverrides(\n presignGetObjectUrl(\n downloadUrl,\n bucket.name,\n f.fileName,\n auth.authorizationToken,\n inputs.presignTtlSeconds,\n ),\n downloadOverrides,\n )\n core.setSecret(url)\n files.push({ fileName: f.fileName, url, expiresAt })\n if (files.length >= inputs.maxResults) break\n }\n if (!page.nextFileName) break\n startFileName = page.nextFileName\n }\n } finally {\n core.info(` generated ${files.length} presigned URL(s)`)\n core.endGroup()\n }\n return { files }\n}\n\nasync function presignOne(\n client: B2Client,\n bucket: Bucket,\n fileName: string,\n ttlSeconds: number,\n authPrefix: string,\n downloadOverrides: DownloadHeaderOverrides,\n): Promise {\n const auth = await getDownloadAuthorization(\n client,\n bucket,\n authPrefix,\n ttlSeconds,\n downloadOverrides,\n )\n const downloadUrl = client.accountInfo.getDownloadUrl()\n const url = appendDownloadHeaderOverrides(\n presignGetObjectUrl(downloadUrl, bucket.name, fileName, auth.authorizationToken, ttlSeconds),\n downloadOverrides,\n )\n core.setSecret(auth.authorizationToken)\n core.setSecret(url)\n const expiresAt = Math.floor(Date.now() / 1000) + ttlSeconds\n core.info(`presigned URL for ${fileName} valid for ${ttlSeconds}s (expires at ${expiresAt})`)\n return { fileName, url, expiresAt }\n}\n\nasync function getDownloadAuthorization(\n client: B2Client,\n bucket: Bucket,\n fileNamePrefix: string,\n validDurationInSeconds: number,\n downloadOverrides: DownloadHeaderOverrides,\n) {\n const request = {\n bucketId: bucket.id,\n fileNamePrefix,\n validDurationInSeconds,\n ...downloadOverrides,\n } satisfies DownloadAuthorizationRequest\n\n return await client.raw.getDownloadAuthorization(\n client.accountInfo.getApiUrl(),\n client.accountInfo.getAuthToken(),\n request,\n )\n}\n","import * as core from '@actions/core'\nimport type { Bucket, FileAction } from '@backblaze-labs/b2-sdk'\nimport type { ParsedInputs } from '../inputs.ts'\nimport { deleteAllVersions } from './delete-all.ts'\n\n/** One entry in {@link PurgeResult.files}. */\nexport interface PurgedFile {\n /** B2 file name (the key). */\n fileName: string\n /** B2 file ID of the version that was purged. */\n fileId: string\n /** Which kind of version this entry refers to, or `skip` for dry-run previews. */\n action: FileAction | 'skip'\n /** True for dry-run previews; the version was not actually purged. */\n skipped: boolean\n}\n\n/** Result of {@link purgeCommand}. */\nexport interface PurgeResult {\n /** One entry per matched version (live, prior, and hide markers). */\n files: PurgedFile[]\n /** Count of individual-version purge failures. */\n errors: number\n}\n\n/**\n * Permanently delete every file version (including hide markers and historic\n * uploads) under a prefix. Differs from `delete` in that `delete`'s\n * implementation streams over `listFileVersions` and removes all versions,\n * but `purge` makes the wipe-the-prefix intent explicit and warns loudly.\n *\n * If `source` is empty or `/`, this purges the **entire bucket** only when\n * `allow-bucket-purge: true` is also set. Default behavior is to require a\n * scoped prefix so an omitted source cannot become a bucket-wide wipe.\n *\n * Supports `dry-run` to preview what would be deleted.\n */\nexport async function purgeCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const bucketWide = inputs.source === undefined || inputs.source === '' || inputs.source === '/'\n if (bucketWide && !inputs.allowBucketPurge) {\n throw new Error(\n \"'allow-bucket-purge' must be true for whole-bucket purge (set 'source' to a prefix for scoped purge)\",\n )\n }\n const source = inputs.source ?? ''\n const prefix = bucketWide ? '' : source.endsWith('/') ? source : `${source}/`\n const dryRun = inputs.dryRun\n\n if (prefix === '' && !dryRun) {\n core.warning(\n `purge will permanently delete EVERY version in bucket \"${bucket.name}\". Continuing because allow-bucket-purge is true.`,\n )\n }\n\n const files: PurgedFile[] = []\n let errors = 0\n\n core.startGroup(`${dryRun ? 'dry-run' : 'purge'} b2://${bucket.name}/${prefix} (all versions)`)\n try {\n const opts = {\n ...(prefix !== '' ? { prefix } : {}),\n dryRun,\n bypassGovernance: inputs.bypassGovernance,\n ...(signal !== undefined ? { signal } : {}),\n }\n for await (const event of deleteAllVersions(bucket, opts)) {\n if (event.type === 'delete') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: event.action,\n skipped: false,\n })\n core.info(` purged ${event.fileName} (${event.fileId})`)\n } else if (event.type === 'skip') {\n files.push({\n fileName: event.fileName,\n fileId: event.fileId,\n action: 'skip',\n skipped: true,\n })\n core.info(` would purge ${event.fileName} (${event.fileId})`)\n } else {\n errors++\n core.warning(` failed to purge ${event.fileName}: ${event.message}`)\n }\n }\n } finally {\n core.endGroup()\n }\n\n return { files, errors }\n}\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { findFileByName } from '../client.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link retentionCommand}: describes what was applied to the target version. */\nexport interface RetentionResult {\n /** B2 file name the retention/hold was applied to. */\n fileName: string\n /** B2 file ID of the version that was modified. */\n fileId: string\n /** Retention mode after the call. `none` means retention was cleared. Undefined if only legal-hold was touched. */\n appliedMode: 'compliance' | 'governance' | 'none' | undefined\n /** Retention expiration timestamp (ms since the epoch). `null` when mode is `none`. */\n retainUntilTimestamp: number | null | undefined\n /** Legal-hold state after the call. Undefined when not touched by this invocation. */\n appliedLegalHold: 'on' | 'off' | undefined\n}\n\n/**\n * Apply Object Lock retention settings and/or a legal hold to a specific\n * file version.\n *\n * The bucket must have Object Lock enabled. Three inputs drive this command:\n * - `retention-mode`: `compliance` | `governance` | `none`. Required if\n * `retention-until` is set.\n * - `retention-until`: ISO 8601 timestamp (e.g. `2027-01-01T00:00:00Z`).\n * Required if `retention-mode` is `compliance` or `governance`.\n * - `legal-hold`: `on` | `off`. Independent of retention; can be set on\n * its own or alongside retention.\n * - `bypass-governance` (bool): allows shortening a governance retention.\n *\n * At least one of `retention-mode` / `legal-hold` must be supplied.\n *\n * The target file version is resolved by exact name only when the latest\n * version is an upload.\n */\nexport async function retentionCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n): Promise {\n const source = requireSource(inputs.source, 'retention', 'the B2 file name')\n\n const mode = inputs.retentionMode\n const until = inputs.retentionUntil\n const legalHold = inputs.legalHold\n\n if (mode === undefined && legalHold === undefined) {\n throw new Error(\"retention requires at least one of 'retention-mode' or 'legal-hold' to be set\")\n }\n\n // Resolve the retention expiration up front so TypeScript narrows `until`\n // inside the parse branch and the downstream call site doesn't need a cast.\n let retainUntilMillis: number | null = null\n if (mode === 'compliance' || mode === 'governance') {\n if (until === undefined) {\n throw new Error(\n `'retention-until' (ISO 8601 timestamp) is required when 'retention-mode' is '${mode}'`,\n )\n }\n const parsed = Date.parse(until)\n if (Number.isNaN(parsed)) {\n throw new Error(`'retention-until' is not a valid ISO 8601 timestamp: \"${until}\"`)\n }\n // Reject past timestamps client-side. B2 also rejects them server-side\n // but with a generic 400; the action's check fails faster and tells the\n // user exactly what's wrong (especially helpful for timezone-skewed CI\n // runners). Allow a small clock-skew tolerance: anything within the\n // last 30 seconds is treated as \"now\" rather than past.\n const skewToleranceMs = 30_000\n if (parsed < Date.now() - skewToleranceMs) {\n throw new Error(\n `'retention-until' must be in the future; got \"${until}\" (${new Date(parsed).toISOString()})`,\n )\n }\n retainUntilMillis = parsed\n }\n\n // Resolve the file version we're operating on.\n const hit = await findFileByName(bucket, source)\n\n let appliedMode: RetentionResult['appliedMode']\n let retainUntilTimestamp: number | null | undefined\n let appliedLegalHold: RetentionResult['appliedLegalHold']\n\n core.startGroup(`retention b2://${bucket.name}/${source}`)\n try {\n if (mode !== undefined) {\n const retention = {\n mode: mode === 'none' ? null : mode,\n retainUntilTimestamp: retainUntilMillis,\n }\n const result = inputs.bypassGovernance\n ? await bucket.updateFileRetention(source, hit.fileId, retention, {\n bypassGovernance: true,\n })\n : await bucket.updateFileRetention(source, hit.fileId, retention)\n appliedMode = mode\n retainUntilTimestamp = result.fileRetention.retainUntilTimestamp\n core.info(` retention: mode=${mode} retainUntil=${retainUntilMillis}`)\n }\n\n if (legalHold !== undefined) {\n const result = await bucket.updateFileLegalHold(source, hit.fileId, legalHold)\n appliedLegalHold = result.legalHold\n core.info(` legal-hold: ${result.legalHold}`)\n }\n\n return {\n fileName: source,\n fileId: hit.fileId,\n appliedMode,\n retainUntilTimestamp,\n appliedLegalHold,\n }\n } finally {\n core.endGroup()\n }\n}\n","//#region src/streams/file-source.ts\nvar FILE_STREAM_CHUNK_SIZE = 16 * 1024 * 1024;\nvar FILE_SOURCE_INTERNAL = Symbol(\"FileSource.internal\");\n/** @internal */\nvar fileSourceTestHooks = {};\nfunction getNodeFsSync() {\n\tconst fs = globalThis.process?.getBuiltinModule?.(\"node:fs\");\n\tif (!isNodeFsSync(fs)) throw new Error(\"FileSource constructor requires Node.js 22.3+ synchronous filesystem APIs; use FileSource.fromPath() when synchronous filesystem access is unavailable.\");\n\treturn fs;\n}\nfunction isNodeFsSync(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn typeof value[\"lstatSync\"] === \"function\";\n}\nasync function fileOpenFlags() {\n\tconst { constants } = await import(\"node:fs\");\n\treturn constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);\n}\nfunction normalizeSliceOffset(value, size) {\n\tif (!Number.isFinite(value)) throw new RangeError(\"FileSource slice offsets must be finite.\");\n\tconst integer = Math.trunc(value);\n\tconst offset = integer < 0 ? size + integer : integer;\n\treturn Math.min(Math.max(offset, 0), size);\n}\nfunction formatFilePath(path) {\n\treturn path instanceof URL ? path.href : path;\n}\nfunction identityFromStats(stats) {\n\treturn {\n\t\tdev: stats.dev,\n\t\tino: stats.ino,\n\t\tsize: stats.size,\n\t\tmtimeMs: stats.mtimeMs,\n\t\tctimeMs: stats.ctimeMs\n\t};\n}\nfunction assertStableIdentity(path, stats) {\n\tif (stats.dev === 0 && stats.ino === 0) throw new Error(`FileSource: ${formatFilePath(path)} is on a filesystem that does not expose stable file identity.`);\n}\nfunction assertRegularFile(path, stats) {\n\tif (!stats.isFile()) throw new Error(`FileSource: ${formatFilePath(path)} is not a regular file.`);\n}\nfunction validatedIdentityFromStats(path, stats) {\n\tassertRegularFile(path, stats);\n\tif (shouldComparePosixFileIdentity()) assertStableIdentity(path, stats);\n\treturn identityFromStats(stats);\n}\nfunction assertSameIdentity(path, expected, actual, when) {\n\tif (shouldComparePosixFileIdentity()) assertStableIdentity(path, actual);\n\tif (shouldComparePosixFileIdentity() && (actual.dev !== expected.dev || actual.ino !== expected.ino)) throw new Error(`FileSource: ${formatFilePath(path)} changed ${when}.`);\n\tif (actual.size !== expected.size || actual.mtimeMs !== expected.mtimeMs) throw new Error(`FileSource: ${formatFilePath(path)} was modified ${when}.`);\n\tif (shouldComparePosixChangeTime() && actual.ctimeMs !== expected.ctimeMs) throw new Error(`FileSource: ${formatFilePath(path)} was modified ${when}.`);\n}\nfunction isWindows() {\n\tif (fileSourceTestHooks.platform !== void 0) return fileSourceTestHooks.platform === \"win32\";\n\treturn globalThis.process?.platform === \"win32\";\n}\nfunction shouldComparePosixFileIdentity() {\n\treturn !isWindows();\n}\nfunction shouldComparePosixChangeTime() {\n\treturn !isWindows();\n}\nfunction throwIfAborted(signal) {\n\tif (signal === void 0 || !signal.aborted) return;\n\tthrow signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\nfunction maxReadSize() {\n\treturn fileSourceTestHooks.maxReadSize ?? FILE_STREAM_CHUNK_SIZE;\n}\n/* v8 ignore start -- Requires a file to pass identity checks and still EOF mid-range. */\nfunction rangeEndedEarlyError(path, offset, size) {\n\tconst end = offset + size;\n\treturn /* @__PURE__ */ new Error(`FileSource: ${formatFilePath(path)} ended before byte range [${offset}, ${end}) was fully read.`);\n}\n/* v8 ignore stop */\nasync function openValidatedFile(path, identity) {\n\tconst open = fileSourceTestHooks.openFile ?? (await import(\"node:fs/promises\")).open;\n\tlet file;\n\ttry {\n\t\tfile = await open(path, await fileOpenFlags());\n\t} catch (err) {\n\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\tthrow new Error(`FileSource: ${formatFilePath(path)} could not be opened: ${message}`);\n\t}\n\ttry {\n\t\tconst stats = await file.stat();\n\t\tassertRegularFile(path, stats);\n\t\tassertSameIdentity(path, identity, stats, \"before read\");\n\t\treturn file;\n\t} catch (err) {\n\t\t/* v8 ignore next -- Cleanup failure is deliberately best-effort. */\n\t\tawait file.close().catch(() => {});\n\t\tthrow err;\n\t}\n}\nasync function lstatNodeFile(path) {\n\tconst { lstat } = await import(\"node:fs/promises\");\n\treturn lstat(path);\n}\nasync function readFileRange(path, identity, offset, size, signal) {\n\tthrowIfAborted(signal);\n\tif (size === 0) {\n\t\tawait verifyFileIdentityForEmptyRead(path, identity, signal);\n\t\treturn /* @__PURE__ */ new Uint8Array(0);\n\t}\n\tthrowIfAborted(signal);\n\tconst file = await openValidatedFile(path, identity);\n\tconst data = new Uint8Array(size);\n\tlet filled = 0;\n\ttry {\n\t\twhile (filled < data.byteLength) {\n\t\t\tthrowIfAborted(signal);\n\t\t\tconst length = Math.min(maxReadSize(), data.byteLength - filled);\n\t\t\tconst { bytesRead } = await file.read(data, filled, length, offset + filled);\n\t\t\tif (bytesRead === 0) throw rangeEndedEarlyError(path, offset, size);\n\t\t\tfilled += bytesRead;\n\t\t\tawait fileSourceTestHooks.afterReadIteration?.(filled);\n\t\t}\n\t\tthrowIfAborted(signal);\n\t\tassertSameIdentity(path, identity, await file.stat(), \"while being read\");\n\t\treturn data;\n\t} finally {\n\t\t/* v8 ignore next -- Cleanup failure is deliberately best-effort. */\n\t\tawait file.close().catch(() => {});\n\t}\n}\nasync function verifyFileIdentityForEmptyRead(path, identity, signal) {\n\tthrowIfAborted(signal);\n\tconst file = await openValidatedFile(path, identity);\n\ttry {\n\t\tthrowIfAborted(signal);\n\t\treturn;\n\t} finally {\n\t\t/* v8 ignore next -- Cleanup failure is deliberately best-effort. */\n\t\tawait file.close().catch(() => {});\n\t}\n}\nfunction sliceFileRange(path, identity, offset, size, start, end) {\n\tconst normalizedStart = normalizeSliceOffset(start, size);\n\tconst normalizedEnd = normalizeSliceOffset(end, size);\n\treturn new FileSliceSource(path, identity, offset + normalizedStart, Math.max(normalizedEnd - normalizedStart, 0));\n}\nfunction streamFileRange(path, identity, offset, size) {\n\tlet position = offset;\n\tlet remaining = size;\n\tlet verifiedEmpty = false;\n\tconst abortController = new AbortController();\n\treturn new ReadableStream({\n\t\tasync pull(controller) {\n\t\t\ttry {\n\t\t\t\tif (remaining === 0) {\n\t\t\t\t\tif (!verifiedEmpty) {\n\t\t\t\t\t\tverifiedEmpty = true;\n\t\t\t\t\t\tawait verifyFileIdentityForEmptyRead(path, identity);\n\t\t\t\t\t}\n\t\t\t\t\tcontroller.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst data = await readFileRange(path, identity, position, Math.min(FILE_STREAM_CHUNK_SIZE, remaining), abortController.signal);\n\t\t\t\tposition += data.byteLength;\n\t\t\t\tremaining -= data.byteLength;\n\t\t\t\tcontroller.enqueue(data);\n\t\t\t\tif (remaining === 0) controller.close();\n\t\t\t} catch (err) {\n\t\t\t\tcontroller.error(err);\n\t\t\t}\n\t\t},\n\t\tcancel(reason) {\n\t\t\tabortController.abort(reason);\n\t\t}\n\t});\n}\nasync function fileRangeToArrayBuffer(path, identity, offset, size, options = {}) {\n\treturn (await readFileRange(path, identity, offset, size, options.signal)).buffer;\n}\nvar FileSliceSource = class {\n\tpath;\n\tidentity;\n\toffset;\n\tsize;\n\tcanSlice = true;\n\tconstructor(path, identity, offset, size) {\n\t\tthis.path = path;\n\t\tthis.identity = identity;\n\t\tthis.offset = offset;\n\t\tthis.size = size;\n\t}\n\tslice(start, end) {\n\t\treturn sliceFileRange(this.path, this.identity, this.offset, this.size, start, end);\n\t}\n\tstream() {\n\t\treturn streamFileRange(this.path, this.identity, this.offset, this.size);\n\t}\n\ttoArrayBuffer(options = {}) {\n\t\treturn fileRangeToArrayBuffer(this.path, this.identity, this.offset, this.size, options);\n\t}\n};\n/**\n* ContentSource backed by a local filesystem path.\n*\n* `FileSource` is Node-only but safe to import in browser builds: it touches\n* Node filesystem APIs only when constructed or read. The constructor performs\n* synchronous filesystem validation so `size` is immediately available; request\n* handlers, sync loops, and other latency-sensitive code should use\n* {@link FileSource.fromPath}. Both paths capture a best-effort regular file\n* identity and reject a symlink as the final path component; parent directory\n* symlinks are followed by the operating system, so callers that constrain\n* paths under a trusted root should validate those parents separately. Reads\n* reject if the path is replaced, if the filesystem cannot report stable\n* identity on POSIX platforms, or if size/mtime/ctime changes before the\n* configured byte range is read. On Windows, reads avoid unreliable dev/inode\n* identity comparisons and validate size/mtime instead.\n* Slices preserve the captured identity, so multipart uploads can read\n* disjoint ranges without materialising the whole file in memory or following\n* later leaf path swaps.\n*/\nvar FileSource = class {\n\t/** Random-access: file ranges are read by absolute byte offset. */\n\tcanSlice = true;\n\t/** File size captured at construction time. */\n\tsize;\n\tpath;\n\tidentity;\n\t/**\n\t* Internal constructor path for async validation.\n\t* @param path - Local filesystem path or file URL.\n\t* @param internal - Module-private validated identity payload.\n\t*\n\t* @internal\n\t*/\n\tconstructor(path, internal) {\n\t\tconst resolvedIdentity = internal?.key === FILE_SOURCE_INTERNAL ? internal.identity : validatedIdentityFromStats(path, getNodeFsSync().lstatSync(path));\n\t\tthis.path = path;\n\t\tthis.identity = resolvedIdentity;\n\t\tthis.size = resolvedIdentity.size;\n\t}\n\t/**\n\t* Return a new file-backed source covering the specified byte range.\n\t* @param start - The zero-based byte offset to begin the slice.\n\t* @param end - The exclusive byte offset where the slice ends.\n\t*\n\t* @returns A new ContentSource representing the requested sub-range.\n\t*/\n\tslice(start, end) {\n\t\treturn sliceFileRange(this.path, this.identity, 0, this.size, start, end);\n\t}\n\t/**\n\t* Open this file as a Web ReadableStream.\n\t* @returns A ReadableStream that reads the file lazily.\n\t*/\n\tstream() {\n\t\treturn streamFileRange(this.path, this.identity, 0, this.size);\n\t}\n\t/**\n\t* Read this file into an ArrayBuffer.\n\t* @param options - Optional abort signal used while reading.\n\t*\n\t* @returns A promise resolving with the file bytes.\n\t*/\n\ttoArrayBuffer(options = {}) {\n\t\treturn fileRangeToArrayBuffer(this.path, this.identity, 0, this.size, options);\n\t}\n\t/**\n\t* Create a FileSource using asynchronous filesystem validation.\n\t* @param path - Local filesystem path or file URL.\n\t*\n\t* @returns A FileSource bound to the validated file identity.\n\t*\n\t* @throws If the path does not reference a regular non-symlink file.\n\t* @throws If a POSIX filesystem cannot report stable file identity.\n\t*/\n\tstatic async fromPath(path) {\n\t\treturn constructFileSourceFromIdentity(path, validatedIdentityFromStats(path, await lstatNodeFile(path)));\n\t}\n};\nfunction constructFileSourceFromIdentity(path, identity) {\n\treturn Reflect.construct(FileSource, [path, {\n\t\tkey: FILE_SOURCE_INTERNAL,\n\t\tidentity\n\t}]);\n}\n//#endregion\nexport { FileSource, fileSourceTestHooks };\n\n//# sourceMappingURL=file-source.js.map","//#region src/sync/actions/index.ts\n/** Uploads a local file to B2. */\nvar UploadAction = class {\n\trelativePath;\n\tabsolutePath;\n\tsize;\n\tdoUpload;\n\ttype = \"upload\";\n\t/**\n\t* Creates a new UploadAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param absolutePath - Absolute local filesystem path.\n\t* @param size - File size in bytes.\n\t* @param doUpload - Callback that performs the actual upload.\n\t*/\n\tconstructor(relativePath, absolutePath, size, doUpload) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.absolutePath = absolutePath;\n\t\tthis.size = size;\n\t\tthis.doUpload = doUpload;\n\t}\n\t/**\n\t* Uploads the file (unless dryRun) and returns an 'upload-done' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal for canceling the upload.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doUpload(this.absolutePath, this.relativePath, signal);\n\t\treturn {\n\t\t\ttype: \"upload-done\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: this.size\n\t\t};\n\t}\n};\n/** Downloads a B2 file to the local filesystem. */\nvar DownloadAction = class {\n\trelativePath;\n\tsize;\n\tdoDownload;\n\ttype = \"download\";\n\t/**\n\t* Creates a new DownloadAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param size - File size in bytes.\n\t* @param doDownload - Callback that performs the actual download.\n\t*/\n\tconstructor(relativePath, size, doDownload) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.size = size;\n\t\tthis.doDownload = doDownload;\n\t}\n\t/**\n\t* Downloads the file (unless dryRun) and returns a 'download-done' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal for canceling the download.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doDownload(this.relativePath, signal);\n\t\treturn {\n\t\t\ttype: \"download-done\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: this.size\n\t\t};\n\t}\n};\n/** Server-side copies a B2 file to a new key within the same or different bucket. */\nvar CopyAction = class {\n\trelativePath;\n\tsize;\n\tdoCopy;\n\ttype = \"copy\";\n\t/**\n\t* Creates a new CopyAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param size - File size in bytes.\n\t* @param doCopy - Callback that performs the server-side copy.\n\t*/\n\tconstructor(relativePath, size, doCopy) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.size = size;\n\t\tthis.doCopy = doCopy;\n\t}\n\t/**\n\t* Copies the file (unless dryRun) and returns a 'copy-done' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal for canceling the copy.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doCopy(this.relativePath, signal);\n\t\treturn {\n\t\t\ttype: \"copy-done\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: this.size\n\t\t};\n\t}\n};\n/** Hides a file in B2 by creating a hide marker (soft delete). */\nvar HideAction = class {\n\trelativePath;\n\tdoHide;\n\ttype = \"hide\";\n\tsize = 0;\n\t/**\n\t* Creates a new HideAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param doHide - Callback that creates the hide marker.\n\t*/\n\tconstructor(relativePath, doHide) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.doHide = doHide;\n\t}\n\t/**\n\t* Hides the file (unless dryRun) and returns a 'hide' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal for canceling the hide request.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doHide(this.relativePath, signal);\n\t\treturn {\n\t\t\ttype: \"hide\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: 0\n\t\t};\n\t}\n};\n/** Permanently deletes a specific file version from B2. */\nvar DeleteRemoteAction = class {\n\trelativePath;\n\tfileId;\n\tdoDelete;\n\ttype = \"delete-remote\";\n\tsize = 0;\n\t/**\n\t* Creates a new DeleteRemoteAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param fileId - The B2 file version ID to delete.\n\t* @param doDelete - Callback that performs the deletion.\n\t*/\n\tconstructor(relativePath, fileId, doDelete) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.fileId = fileId;\n\t\tthis.doDelete = doDelete;\n\t}\n\t/**\n\t* Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal for canceling the delete request.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doDelete(this.fileId, this.relativePath, signal);\n\t\treturn {\n\t\t\ttype: \"delete-remote\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: 0\n\t\t};\n\t}\n};\n/** Deletes a file from the local filesystem. */\nvar DeleteLocalAction = class {\n\trelativePath;\n\tabsolutePath;\n\tdoDelete;\n\ttype = \"delete-local\";\n\tsize = 0;\n\t/**\n\t* Creates a new DeleteLocalAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param absolutePath - Absolute local filesystem path.\n\t* @param doDelete - Callback that performs the deletion.\n\t*/\n\tconstructor(relativePath, absolutePath, doDelete) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.absolutePath = absolutePath;\n\t\tthis.doDelete = doDelete;\n\t}\n\t/**\n\t* Deletes the local file (unless dryRun) and returns a 'delete-local' event.\n\t* @param dryRun - Whether to simulate the action without making changes.\n\t* @param signal - Optional abort signal checked before deleting.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(dryRun, signal) {\n\t\tif (!dryRun) await this.doDelete(this.absolutePath, signal);\n\t\treturn {\n\t\t\ttype: \"delete-local\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: 0\n\t\t};\n\t}\n};\n/** Represents a no-op action for files that do not need syncing. */\nvar SkipAction = class {\n\trelativePath;\n\treason;\n\ttype = \"skip\";\n\tsize = 0;\n\t/**\n\t* Creates a new SkipAction for the given relative path.\n\t* @param relativePath - Path relative to the sync root.\n\t* @param reason - Human-readable explanation for why the file was skipped.\n\t*/\n\tconstructor(relativePath, reason) {\n\t\tthis.relativePath = relativePath;\n\t\tthis.reason = reason;\n\t}\n\t/**\n\t* Returns a 'skip' event with the reason message. No I/O is performed.\n\t* @param _dryRun - Whether to simulate the action (unused for no-op).\n\t* @param _signal - Unused abort signal accepted for the shared action interface.\n\t*\n\t* @returns A promise resolving to the sync event produced by the action.\n\t*/\n\tasync execute(_dryRun, _signal) {\n\t\treturn {\n\t\t\ttype: \"skip\",\n\t\t\tpath: this.relativePath,\n\t\t\tsize: 0,\n\t\t\tmessage: this.reason\n\t\t};\n\t}\n};\n//#endregion\nexport { CopyAction, DeleteLocalAction, DeleteRemoteAction, DownloadAction, HideAction, SkipAction, UploadAction };\n\n//# sourceMappingURL=index.js.map","//#region src/sync/regexp-safety.ts\nvar MAX_REGEXP_SOURCE_LENGTH = 512;\nvar MAX_REGEXP_INPUT_LENGTH = 1024;\nvar MAX_REGEXP_UNBOUNDED_QUANTIFIERS = 1;\nvar MAX_REGEXP_BOUNDED_QUANTIFIER = 200;\nvar MAX_REGEXP_BOUNDED_QUANTIFIERS = 16;\nvar MAX_REGEXP_BOUNDED_QUANTIFIER_PRODUCT = 1e4;\nvar safeRegExpCache = /* @__PURE__ */ new WeakMap();\nvar validatedFilterCache = /* @__PURE__ */ new WeakSet();\n/**\n* Validates every RegExp filter in an include/exclude filter set.\n*\n* @param filters - Optional include and exclude filters to validate.\n*\n* @throws When a RegExp filter is too large or structurally unsafe.\n*/\nfunction validateSyncFilters(filters) {\n\tif (filters === void 0) return;\n\tif (validatedFilterCache.has(filters)) return;\n\tvalidateSyncFilterList(\"include\", filters.include);\n\tvalidateSyncFilterList(\"exclude\", filters.exclude);\n\tvalidatedFilterCache.add(filters);\n}\n/**\n* Tests a path with a caller-provided RegExp without retaining `lastIndex` state.\n*\n* @param relativePath - Folder-relative path to test.\n* @param pattern - Caller-provided RegExp filter.\n*\n* @returns True when the RegExp matches the relative path.\n*\n* @throws When the RegExp filter is too large or structurally unsafe.\n*/\nfunction regexpMatchesSyncPath(relativePath, pattern) {\n\tif (pathExceedsSafeRegExpInput(relativePath)) return false;\n\treturn regexpWithoutState(pattern).test(relativePath);\n}\n/**\n* Tests whether a relative path is too long to feed to caller-provided RegExp filters.\n*\n* @param relativePath - Folder-relative path to test.\n*\n* @returns True when RegExp filters should not be evaluated for the path.\n*/\nfunction pathExceedsSafeRegExpInput(relativePath) {\n\treturn relativePath.length > MAX_REGEXP_INPUT_LENGTH;\n}\nfunction validateSyncFilterList(kind, patterns) {\n\tfor (const pattern of patterns ?? []) if (typeof pattern !== \"string\") regexpWithoutState(pattern, kind);\n}\nfunction regexpWithoutState(pattern, kind = \"pattern\") {\n\tconst cached = safeRegExpCache.get(pattern);\n\tif (cached !== void 0) return cached;\n\tassertSafeRegExp(pattern, kind);\n\tconst compiled = new RegExp(pattern.source, pattern.flags.replace(/[gy]/g, \"\"));\n\tsafeRegExpCache.set(pattern, compiled);\n\treturn compiled;\n}\nfunction assertSafeRegExp(pattern, kind) {\n\tconst source = pattern.source;\n\tif (source.length > MAX_REGEXP_SOURCE_LENGTH) throw new Error(`Sync filter RegExp is too long (${kind}: /${source}/)`);\n\tif (!regexpSourceLooksSafe(source)) throw new Error(`Sync filter RegExp is too complex (${kind}: /${source}/)`);\n}\n/**\n* Best-effort linear RegExp guard for filters matched synchronously on attacker-controlled paths.\n*\n* The accepted subset intentionally rejects constructs that are hard to bound in the JavaScript\n* RegExp engine: backreferences, unterminated escapes/classes/groups, repeated unbounded\n* quantifiers, bounded quantifiers above {@link MAX_REGEXP_BOUNDED_QUANTIFIER}, too many bounded\n* quantifiers or too large a bounded-quantifier product, and any quantified group whose subtree\n* already contains a quantifier or alternation. Group state is propagated upward so nested groups\n* cannot hide a quantified or alternated subtree before an outer bounded or unbounded quantifier.\n*\n* @param source - RegExp source text to inspect.\n*\n* @returns True when the source passes the SDK's structural safety heuristic.\n*/\nfunction regexpSourceLooksSafe(source) {\n\tlet escaped = false;\n\tlet inClass = false;\n\tlet unboundedQuantifiers = 0;\n\tlet boundedQuantifiers = 0;\n\tlet boundedQuantifierProduct = 1;\n\tconst groups = [];\n\tlet lastToken = null;\n\tfor (let i = 0; i < source.length; i++) {\n\t\tconst char = source[i] ?? \"\";\n\t\tif (escaped) {\n\t\t\tif (!inClass && char === \"k\" && source[i + 1] === \"<\") return false;\n\t\t\tif (!inClass && /[1-9]/.test(char)) return false;\n\t\t\tescaped = false;\n\t\t\tlastToken = { type: \"atom\" };\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \"\\\\\") {\n\t\t\tescaped = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (inClass) {\n\t\t\tif (char === \"]\") inClass = false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \"[\") {\n\t\t\tinClass = true;\n\t\t\tlastToken = { type: \"atom\" };\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \"(\") {\n\t\t\tgroups.push({\n\t\t\t\thasQuantifier: false,\n\t\t\t\thasAlternation: false\n\t\t\t});\n\t\t\tlastToken = null;\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \")\") {\n\t\t\tconst group = groups.pop();\n\t\t\tif (!group) return false;\n\t\t\tconst parent = groups.at(-1);\n\t\t\tif (parent) mergeGroupState(parent, group);\n\t\t\tlastToken = {\n\t\t\t\ttype: \"group\",\n\t\t\t\t...group\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tif (char === \"|\") {\n\t\t\tconst group = groups.at(-1);\n\t\t\tif (group) group.hasAlternation = true;\n\t\t\tlastToken = null;\n\t\t\tcontinue;\n\t\t}\n\t\tconst quantifier = lastToken !== null ? parseQuantifier(source, i) : null;\n\t\tif (lastToken !== null && quantifier !== null) {\n\t\t\tif (lastToken?.type === \"group\" && (lastToken.hasQuantifier || lastToken.hasAlternation)) return false;\n\t\t\tif (quantifier.unbounded) {\n\t\t\t\tunboundedQuantifiers++;\n\t\t\t\tif (unboundedQuantifiers > MAX_REGEXP_UNBOUNDED_QUANTIFIERS) return false;\n\t\t\t} else {\n\t\t\t\tboundedQuantifiers++;\n\t\t\t\tif (boundedQuantifiers > MAX_REGEXP_BOUNDED_QUANTIFIERS) return false;\n\t\t\t\tif (quantifier.maxRepetitions > MAX_REGEXP_BOUNDED_QUANTIFIER) return false;\n\t\t\t\tboundedQuantifierProduct *= Math.max(quantifier.maxRepetitions, 1);\n\t\t\t\tif (boundedQuantifierProduct > MAX_REGEXP_BOUNDED_QUANTIFIER_PRODUCT) return false;\n\t\t\t}\n\t\t\tconst group = groups.at(-1);\n\t\t\tif (group) group.hasQuantifier = true;\n\t\t\ti = quantifier.endIndex;\n\t\t\tlastToken = null;\n\t\t\tcontinue;\n\t\t}\n\t\tlastToken = { type: \"atom\" };\n\t}\n\treturn !escaped && !inClass && groups.length === 0;\n}\nfunction mergeGroupState(target, source) {\n\ttarget.hasQuantifier = target.hasQuantifier || source.hasQuantifier;\n\ttarget.hasAlternation = target.hasAlternation || source.hasAlternation;\n}\nfunction parseQuantifier(source, index) {\n\tconst char = source[index];\n\tif (char === \"*\" || char === \"+\") return {\n\t\tendIndex: index,\n\t\tmaxRepetitions: Number.POSITIVE_INFINITY,\n\t\tunbounded: true\n\t};\n\tif (char === \"?\") return {\n\t\tendIndex: index,\n\t\tmaxRepetitions: 1,\n\t\tunbounded: false\n\t};\n\tif (char !== \"{\") return null;\n\tconst end = source.indexOf(\"}\", index + 1);\n\tif (end === -1) return null;\n\tconst body = source.slice(index + 1, end);\n\tconst match = /^(\\d+)(?:,(\\d*))?$/.exec(body);\n\tif (!match) return null;\n\tconst min = Number(match[1]);\n\tconst maxText = match[2];\n\tconst unbounded = body.includes(\",\") && maxText === \"\";\n\treturn {\n\t\tendIndex: end,\n\t\tmaxRepetitions: unbounded ? Number.POSITIVE_INFINITY : Number(maxText ?? min),\n\t\tunbounded\n\t};\n}\n//#endregion\nexport { pathExceedsSafeRegExpInput, regexpMatchesSyncPath, validateSyncFilters };\n\n//# sourceMappingURL=regexp-safety.js.map","//#region src/sync/scan-events.ts\n/**\n* Emits a scanner skip event without letting observer failures abort the scan.\n*\n* @param filters - Scan options that may include an onSkip callback.\n* @param event - Skip event to report.\n*/\nfunction emitScannerSkip(filters, event) {\n\ttry {\n\t\tfilters?.onSkip?.(event);\n\t} catch {}\n}\n/**\n* Builds a consistent skip event for paths that cannot be safely tested against RegExp filters.\n*\n* @param relativePath - Sync-relative path that exceeded the RegExp input limit.\n*\n* @returns A typed scanner skip event.\n*/\nfunction regexpInputTooLongSkip(relativePath) {\n\treturn {\n\t\ttype: \"skip\",\n\t\tpath: relativePath,\n\t\tsize: 0,\n\t\tmessage: `Skipped sync path ${JSON.stringify(relativePath)}: path exceeds the RegExp filter input limit`,\n\t\treason: \"path-too-long-for-regexp\"\n\t};\n}\n//#endregion\nexport { emitScannerSkip, regexpInputTooLongSkip };\n\n//# sourceMappingURL=scan-events.js.map","import { pathExceedsSafeRegExpInput, regexpMatchesSyncPath, validateSyncFilters } from \"./regexp-safety.js\";\nimport { emitScannerSkip, regexpInputTooLongSkip } from \"./scan-events.js\";\n//#region src/sync/filters.ts\n/**\n* Tests whether a relative sync path is included by the configured include/exclude filters.\n* Exclude filters win over include filters when both match the same path.\n*\n* @param relativePath - Folder-relative path using forward slashes.\n* @param filters - Optional include and exclude filters.\n*\n* @returns True when the path should remain in the sync scan.\n*/\nfunction pathPassesSyncFilters(relativePath, filters) {\n\tvalidateSyncFilters(filters);\n\tconst path = normalizePath(relativePath);\n\tif (normalizedPathSkippedByRegExpInputLimit(path, filters)) return false;\n\tconst include = filters?.include ?? [];\n\tconst exclude = filters?.exclude ?? [];\n\tif (include.length > 0) {\n\t\tif (!include.some((pattern) => matchesPattern(path, pattern))) return false;\n\t}\n\treturn !exclude.some((pattern) => matchesPattern(path, pattern));\n}\n/**\n* Tests whether a directory may contain paths admitted by the configured filters.\n*\n* @param relativePath - Folder-relative directory path using forward slashes.\n* @param filters - Optional include and exclude filters.\n*\n* @returns True when the scanner should descend into the directory.\n*/\nfunction directoryMayContainSyncPaths(relativePath, filters) {\n\tvalidateSyncFilters(filters);\n\tconst path = normalizePath(relativePath);\n\tif (path === \"\") return true;\n\tif ((filters?.exclude ?? []).some((pattern) => stringPatternExcludesAllDescendants(path, pattern))) return false;\n\tconst include = filters?.include ?? [];\n\treturn include.length === 0 || include.some((pattern) => patternMayMatchDescendant(path, pattern));\n}\n/**\n* Returns the safe literal prefix that B2 listing can use for include filters.\n* Exclude filters are not considered because they cannot narrow a B2 prefix.\n*\n* @param filters - Optional include and exclude filters.\n*\n* @returns A folder-relative literal prefix, or an empty string when no safe narrowing exists.\n*/\nfunction literalPrefixForSyncFilters(filters) {\n\tvalidateSyncFilters(filters);\n\tconst include = filters?.include ?? [];\n\tlet commonPrefix;\n\tfor (const pattern of include) {\n\t\tif (patternIsRegExp(pattern)) return \"\";\n\t\tconst glob = normalizePath(pattern);\n\t\tif (!glob.includes(\"/\")) return \"\";\n\t\tconst prefix = literalPrefixForGlob(glob);\n\t\tif (prefix === \"\") return \"\";\n\t\tcommonPrefix = commonPrefix === void 0 ? prefix : commonLiteralPrefix(commonPrefix, prefix);\n\t}\n\treturn commonPrefix ?? \"\";\n}\n/**\n* Filters an async iterable of sync paths while preserving the original item type.\n*\n* @typeParam T - Concrete sync path shape yielded by the source folder.\n*\n* @param paths - Async iterable of folder scan results.\n* @param filters - Optional include and exclude filters.\n*\n* @returns A filtered async generator of sync paths.\n*/\nasync function* filterSyncPaths(paths, filters) {\n\tfor await (const path of paths) if (pathPassesSyncFilters(path.relativePath, filters)) yield path;\n\telse if (pathSkippedByRegExpInputLimit(path.relativePath, filters)) emitScannerSkip(filters, regexpInputTooLongSkip(normalizePath(path.relativePath)));\n}\n/**\n* Tests whether a path is skipped because RegExp filters are configured and the normalized path\n* exceeds the SDK RegExp input guard.\n*\n* @param relativePath - Folder-relative path using forward slashes.\n* @param filters - Optional include and exclude filters.\n*\n* @returns True when any RegExp filter is present and the path is too long to evaluate.\n*/\nfunction pathSkippedByRegExpInputLimit(relativePath, filters) {\n\tvalidateSyncFilters(filters);\n\treturn normalizedPathSkippedByRegExpInputLimit(normalizePath(relativePath), filters);\n}\nfunction normalizedPathSkippedByRegExpInputLimit(normalizedPath, filters) {\n\tif (!pathExceedsSafeRegExpInput(normalizedPath) || !filtersContainRegExp(filters)) return false;\n\treturn true;\n}\nfunction matchesPattern(relativePath, pattern) {\n\tif (patternIsRegExp(pattern)) return regexpMatchesSyncPath(relativePath, pattern);\n\tconst glob = normalizePath(pattern);\n\tif (glob === \"\") return relativePath === \"\";\n\tconst segments = splitPath(relativePath);\n\tif (!glob.includes(\"/\")) return segments.some((segment) => matchSegmentGlob(segment, glob));\n\treturn matchPathGlob(segments, splitPath(glob));\n}\nfunction stringPatternExcludesAllDescendants(relativePath, pattern) {\n\tif (patternIsRegExp(pattern)) return false;\n\tconst glob = normalizePath(pattern);\n\tif (glob === \"\") return false;\n\tif (!glob.includes(\"/\")) return matchesPattern(relativePath, pattern);\n\tconst globSegments = splitPath(glob);\n\treturn globSegments.at(-1) === \"**\" && matchPathGlob(splitPath(relativePath), globSegments);\n}\nfunction filtersContainRegExp(filters) {\n\treturn filters?.include?.some(patternIsRegExp) === true || filters?.exclude?.some(patternIsRegExp) === true;\n}\nfunction patternMayMatchDescendant(relativePath, pattern) {\n\tif (patternIsRegExp(pattern)) return true;\n\tconst glob = normalizePath(pattern);\n\tif (glob === \"\" || !glob.includes(\"/\")) return true;\n\tconst pathSegments = splitPath(relativePath);\n\tconst globSegments = splitPath(glob);\n\tconst length = Math.min(pathSegments.length, globSegments.length);\n\tfor (let i = 0; i < length; i++) {\n\t\tconst globSegment = globSegments[i];\n\t\tif (globSegment === \"**\" || globSegment === void 0 || hasGlobWildcard(globSegment)) return true;\n\t\tif (globSegment !== pathSegments[i]) return false;\n\t}\n\treturn true;\n}\nfunction matchPathGlob(pathSegments, globSegments) {\n\tlet reachable = new Array(pathSegments.length + 1).fill(false);\n\treachable[0] = true;\n\tfor (const globSegment of globSegments) {\n\t\tconst next = new Array(pathSegments.length + 1).fill(false);\n\t\tif (globSegment === \"**\") {\n\t\t\tlet canReach = false;\n\t\t\tfor (let i = 0; i <= pathSegments.length; i++) {\n\t\t\t\tcanReach = canReach || reachable[i] === true;\n\t\t\t\tnext[i] = canReach;\n\t\t\t}\n\t\t} else for (let i = 0; i < pathSegments.length; i++) if (reachable[i] === true && matchSegmentGlob(pathSegments[i] ?? \"\", globSegment)) next[i + 1] = true;\n\t\treachable = next;\n\t}\n\treturn reachable[pathSegments.length] === true;\n}\nfunction matchSegmentGlob(segment, glob) {\n\tlet segmentIndex = 0;\n\tlet globIndex = 0;\n\tlet starIndex = -1;\n\tlet starMatchIndex = 0;\n\twhile (segmentIndex < segment.length) {\n\t\tconst globChar = glob[globIndex];\n\t\tif (globChar === \"?\" || globChar === segment[segmentIndex]) {\n\t\t\tglobIndex++;\n\t\t\tsegmentIndex++;\n\t\t} else if (globChar === \"*\") {\n\t\t\twhile (glob[globIndex + 1] === \"*\") globIndex++;\n\t\t\tstarIndex = globIndex;\n\t\t\tstarMatchIndex = segmentIndex;\n\t\t\tglobIndex++;\n\t\t} else if (starIndex !== -1) {\n\t\t\tglobIndex = starIndex + 1;\n\t\t\tstarMatchIndex++;\n\t\t\tsegmentIndex = starMatchIndex;\n\t\t} else return false;\n\t}\n\twhile (glob[globIndex] === \"*\") globIndex++;\n\treturn globIndex === glob.length;\n}\nfunction literalPrefixForGlob(glob) {\n\tconst segments = splitPath(glob);\n\tconst literalSegments = [];\n\tlet firstWildcardIndex = segments.length;\n\tfor (const [index, segment] of segments.entries()) {\n\t\tif (segment === \"**\" || hasGlobWildcard(segment)) {\n\t\t\tfirstWildcardIndex = index;\n\t\t\tbreak;\n\t\t}\n\t\tliteralSegments.push(segment);\n\t}\n\tif (literalSegments.length === 0) return \"\";\n\tconst prefix = literalSegments.join(\"/\");\n\tconst wildcardTail = segments.slice(firstWildcardIndex);\n\tif (wildcardTail.length > 0 && wildcardTail.every((segment) => segment === \"**\")) return prefix;\n\treturn literalSegments.length < segments.length ? `${prefix}/` : prefix;\n}\nfunction commonLiteralPrefix(a, b) {\n\tlet end = 0;\n\tconst max = Math.min(a.length, b.length);\n\twhile (end < max && a[end] === b[end]) end++;\n\treturn trimTrailingHighSurrogate(a.slice(0, end));\n}\nfunction trimTrailingHighSurrogate(value) {\n\tconst lastCodeUnit = value.charCodeAt(value.length - 1);\n\treturn lastCodeUnit >= 55296 && lastCodeUnit <= 56319 ? value.slice(0, -1) : value;\n}\nfunction hasGlobWildcard(glob) {\n\treturn glob.includes(\"*\") || glob.includes(\"?\");\n}\nfunction patternIsRegExp(pattern) {\n\treturn typeof pattern !== \"string\";\n}\nfunction splitPath(path) {\n\tif (path === \"\") return [];\n\treturn path.split(\"/\").filter((segment) => segment !== \"\");\n}\nfunction normalizePath(path) {\n\tlet normalized = path.split(\"\\\\\").join(\"/\");\n\twhile (normalized.startsWith(\"./\")) normalized = normalized.slice(2);\n\twhile (normalized.startsWith(\"/\")) normalized = normalized.slice(1);\n\twhile (normalized.endsWith(\"/\") && normalized.length > 1) normalized = normalized.slice(0, -1);\n\treturn normalized;\n}\n//#endregion\nexport { directoryMayContainSyncPaths, filterSyncPaths, literalPrefixForSyncFilters, pathPassesSyncFilters, pathSkippedByRegExpInputLimit };\n\n//# sourceMappingURL=filters.js.map","//#region src/sync/path-order.ts\n/**\n* Compares sync-relative paths using the same code-unit order everywhere sorted scans are consumed.\n*\n* @param left - First sync-relative path.\n* @param right - Second sync-relative path.\n*\n* @returns Negative, zero, or positive using JavaScript code-unit order.\n*/\nfunction compareSyncRelativePaths(left, right) {\n\treturn compareCodeUnits(left, right);\n}\n/**\n* Compares strings by JavaScript code-unit order.\n*\n* @param left - First string.\n* @param right - Second string.\n*\n* @returns Negative, zero, or positive using code-unit order.\n*/\nfunction compareCodeUnits(left, right) {\n\tif (left < right) return -1;\n\tif (left > right) return 1;\n\treturn 0;\n}\n//#endregion\nexport { compareCodeUnits, compareSyncRelativePaths };\n\n//# sourceMappingURL=path-order.js.map","//#region src/sync/scan-limit.ts\n/** Default maximum number of entries a sync scanner may retain before failing. */\nvar DEFAULT_MAX_SCAN_ENTRIES = 1e6;\n/**\n* Resolves and validates the effective scan entry limit.\n* @param options - Optional scan options carrying an override.\n*\n* @returns The configured or default scan entry limit.\n*\n* @throws When the configured limit is not a positive safe integer or Infinity.\n*/\nfunction scanEntryLimit(options) {\n\tconst limit = options?.maxScanEntries ?? 1e6;\n\tif (limit === Number.POSITIVE_INFINITY) return limit;\n\tif (!Number.isSafeInteger(limit) || limit < 1) throw new Error(\"maxScanEntries must be a positive safe integer or Infinity\");\n\treturn limit;\n}\n/**\n* Throws when a scanner has retained more entries than the configured limit.\n* @param count - Number of retained entries.\n* @param limit - Maximum allowed retained entries.\n*\n* @throws When count is greater than limit.\n*/\nfunction assertScanEntryLimit(count, limit) {\n\tif (count > limit) throw new Error(`Sync scan entry limit exceeded: maxScanEntries=${limit} was exceeded after ${count} scanned entries; raising maxScanEntries increases peak scanner memory`);\n}\n//#endregion\nexport { DEFAULT_MAX_SCAN_ENTRIES, assertScanEntryLimit, scanEntryLimit };\n\n//# sourceMappingURL=scan-limit.js.map","import { validateSyncFilters } from \"./regexp-safety.js\";\nimport { filterSyncPaths } from \"./filters.js\";\nimport { compareSyncRelativePaths } from \"./path-order.js\";\nimport { assertScanEntryLimit, scanEntryLimit } from \"./scan-limit.js\";\n//#region src/sync/pairing.ts\n/**\n* Merge-joins two sorted folder scans by relative path, yielding paired tuples.\n* Files present only in source yield `[source, null]`, only in dest yield `[null, dest]`,\n* and files in both yield `[source, dest]`.\n*\n* @param source - The source folder to scan.\n* @param dest - The destination folder to scan.\n* @param options - Optional scan controls and filters shared by both folders.\n* @param scanCallbacks - Optional internal source/destination skip callbacks.\n*/\nasync function* zipFolders(source, dest, options = {}, scanCallbacks = {}) {\n\tvalidateSyncFilters(options);\n\tconst sourceOptions = scanOptionsSnapshot(options, scanCallbacks.onSourceSkip);\n\tconst destOptions = scanOptionsSnapshot(options, scanCallbacks.onDestSkip);\n\tconst sourceIter = scanWithFilters(source, sourceOptions)[Symbol.asyncIterator]();\n\tconst destIter = scanWithFilters(dest, destOptions)[Symbol.asyncIterator]();\n\tlet sourceDone = false;\n\tlet destDone = false;\n\ttry {\n\t\tlet [sourceResult, destResult] = await Promise.all([sourceIter.next(), destIter.next()]);\n\t\tsourceDone = sourceResult.done === true;\n\t\tdestDone = destResult.done === true;\n\t\twhile (!sourceResult.done || !destResult.done) {\n\t\t\tconst s = sourceResult.done ? null : sourceResult.value;\n\t\t\tconst d = destResult.done ? null : destResult.value;\n\t\t\tif (s === null) {\n\t\t\t\tyield [null, d];\n\t\t\t\tdestResult = await destIter.next();\n\t\t\t\tdestDone = destResult.done === true;\n\t\t\t} else if (d === null) {\n\t\t\t\tyield [s, null];\n\t\t\t\tsourceResult = await sourceIter.next();\n\t\t\t\tsourceDone = sourceResult.done === true;\n\t\t\t} else {\n\t\t\t\tconst comparison = compareSyncRelativePaths(s.relativePath, d.relativePath);\n\t\t\t\tif (comparison < 0) {\n\t\t\t\t\tyield [s, null];\n\t\t\t\t\tsourceResult = await sourceIter.next();\n\t\t\t\t\tsourceDone = sourceResult.done === true;\n\t\t\t\t} else if (comparison > 0) {\n\t\t\t\t\tyield [null, d];\n\t\t\t\t\tdestResult = await destIter.next();\n\t\t\t\t\tdestDone = destResult.done === true;\n\t\t\t\t} else {\n\t\t\t\t\tyield [s, d];\n\t\t\t\t\tsourceResult = await sourceIter.next();\n\t\t\t\t\tdestResult = await destIter.next();\n\t\t\t\t\tsourceDone = sourceResult.done === true;\n\t\t\t\t\tdestDone = destResult.done === true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tawait closeScanIterator(sourceIter, sourceDone);\n\t\tawait closeScanIterator(destIter, destDone);\n\t}\n}\nasync function closeScanIterator(iterator, alreadyDone) {\n\tif (alreadyDone || iterator.return === void 0) return;\n\ttry {\n\t\tawait iterator.return();\n\t} catch {}\n}\nfunction scanWithFilters(folder, options) {\n\tconst scanned = filterSyncPaths(folder.scan(options.scanner), options.sdk);\n\tif (folder.appliesScanSorting === true) return limitSyncPaths(scanned, options.sdk);\n\treturn sortSyncPaths(scanned, options.sdk);\n}\nasync function* limitSyncPaths(paths, filters) {\n\tconst maxScanEntries = scanEntryLimit(filters);\n\tlet count = 0;\n\tfor await (const path of paths) {\n\t\tcount++;\n\t\tassertScanEntryLimit(count, maxScanEntries);\n\t\tyield path;\n\t}\n}\nasync function* sortSyncPaths(paths, filters) {\n\tconst maxScanEntries = scanEntryLimit(filters);\n\tconst collected = [];\n\tfor await (const path of paths) {\n\t\tcollected.push(path);\n\t\tassertScanEntryLimit(collected.length, maxScanEntries);\n\t}\n\tcollected.sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath));\n\tyield* collected;\n}\nfunction scanOptionsSnapshot(options, onSkip) {\n\tconst onSkipSnapshot = options.onSkip === void 0 && onSkip === void 0 ? void 0 : (event) => {\n\t\toptions.onSkip?.(event);\n\t\tonSkip?.(event);\n\t};\n\treturn {\n\t\tscanner: frozenScanOptions(options, frozenPatterns(options.include), frozenPatterns(options.exclude), onSkipSnapshot),\n\t\tsdk: frozenScanOptions(options, frozenPatterns(options.include), frozenPatterns(options.exclude), onSkipSnapshot)\n\t};\n}\nfunction frozenScanOptions(options, include, exclude, onSkip) {\n\treturn Object.freeze({\n\t\t...include !== void 0 ? { include } : {},\n\t\t...exclude !== void 0 ? { exclude } : {},\n\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t...options.onError !== void 0 ? { onError: options.onError } : {},\n\t\t...onSkip !== void 0 ? { onSkip } : {},\n\t\t...options.requireLocalSafePaths !== void 0 ? { requireLocalSafePaths: options.requireLocalSafePaths } : {},\n\t\t...options.maxScanEntries !== void 0 ? { maxScanEntries: options.maxScanEntries } : {}\n\t});\n}\nfunction frozenPatterns(patterns) {\n\treturn patterns === void 0 ? void 0 : Object.freeze([...patterns]);\n}\n//#endregion\nexport { zipFolders };\n\n//# sourceMappingURL=pairing.js.map","import { toError } from \"./to-error.js\";\n//#region src/util/error-reason.ts\n/**\n* Formats an unknown error for public diagnostics without leaking filesystem paths.\n*\n* @param err - Unknown thrown value.\n*\n* @returns A stable, sanitized reason.\n*/\nfunction sanitizeErrorReason(err) {\n\tconst error = toError(err);\n\tconst code = error.code;\n\tif (typeof code === \"string\" && code.length > 0) {\n\t\tconst reason = cleanReason(code);\n\t\tif (reason.length > 0) return reason;\n\t}\n\tconst message = cleanReason(error.message);\n\tif (message.length > 0 && !/[\\\\/]/.test(message)) return message;\n\tconst name = cleanReason(error.name);\n\tif (name.length > 0) return name;\n\treturn \"Error\";\n}\nfunction cleanReason(value) {\n\tlet cleaned = \"\";\n\tlet sawNonWhitespace = false;\n\tfor (const char of value) {\n\t\tconst code = char.charCodeAt(0);\n\t\tif (code < 32 || code === 127) continue;\n\t\tif (!sawNonWhitespace) {\n\t\t\tif (char.trim().length === 0) continue;\n\t\t\tsawNonWhitespace = true;\n\t\t}\n\t\tcleaned += char;\n\t\tif (cleaned.length >= 200) break;\n\t}\n\treturn cleaned.trimEnd();\n}\n//#endregion\nexport { sanitizeErrorReason };\n\n//# sourceMappingURL=error-reason.js.map","//#region src/sync/sha1-options.ts\n/** Default idle/no-progress timeout for SHA-1 reads. */\nvar DEFAULT_SHA1_IDLE_TIMEOUT_MILLIS = 3e4;\n/** Default absolute deadline for one untrusted B2 SHA-1 verification read. */\nvar DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS = 3e5;\n/**\n* Normalizes a user-provided SHA-1 timeout value.\n*\n* @param value - Optional timeout in milliseconds.\n* @param defaultValue - Default timeout when the value is missing or invalid.\n*\n* @returns A positive integer timeout in milliseconds.\n*/\nfunction normalizeSha1TimeoutMillis(value, defaultValue = DEFAULT_SHA1_IDLE_TIMEOUT_MILLIS) {\n\tif (value === void 0 || !Number.isFinite(value) || value < 1) return defaultValue;\n\treturn Math.floor(value);\n}\n//#endregion\nexport { DEFAULT_SHA1_IDLE_TIMEOUT_MILLIS, DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS, normalizeSha1TimeoutMillis };\n\n//# sourceMappingURL=sha1-options.js.map","//#region src/sync/local-file-identity.ts\n/**\n* Converts Node file stats into the sync scanner's persisted identity shape.\n* @param stats - Node file stats to convert.\n*\n* @returns The scanner identity stored with a local sync path.\n*\n* @internal\n*/\nfunction localFileIdentityFromStats(stats) {\n\treturn {\n\t\tdeviceId: stats.dev,\n\t\tinode: stats.ino,\n\t\tsize: stats.size,\n\t\tmodTimeMillis: Math.floor(stats.mtimeMs),\n\t\tchangeTimeMillis: Math.floor(stats.ctimeMs)\n\t};\n}\n/**\n* Verifies that current local stats still match a previously scanned regular file.\n* @param stats - Current filesystem stats for the candidate file.\n* @param path - Previously scanned local sync path.\n* @param operation - Operation name used in mutation diagnostics.\n* @param options - Platform and ctime comparison overrides for controlled filesystem moves.\n*\n* @throws If the current file is not the scanned regular file.\n*\n* @internal\n*/\nfunction assertSameScannedRegularFile(stats, path, operation = \"upload\", options = {}) {\n\tconst reason = `local file changed before ${operation}`;\n\tif (!stats.isFile()) {\n\t\tif (operation === \"delete\") throw Object.assign(/* @__PURE__ */ new Error(`${reason}: not a regular file`), { code: \"EISDIR\" });\n\t\tthrow new Error(`${reason}: not a regular file`);\n\t}\n\tif (stats.size !== path.size) throw new Error(`${reason}: size changed`);\n\tconst identity = path.fileIdentity;\n\tif (identity === void 0) return;\n\tif (!sameLocalIdentity(stats, identity, {\n\t\tcompareChangeTime: options.compareChangeTime,\n\t\tplatform: options.platform ?? currentPlatform()\n\t})) throw new Error(reason);\n}\nfunction sameLocalIdentity(stats, identity, options) {\n\tconst compareChangeTime = options.compareChangeTime ?? shouldComparePosixChangeTime(options.platform);\n\treturn (!shouldComparePosixFileIdentity(options.platform) || stats.dev === identity.deviceId && stats.ino === identity.inode) && stats.size === identity.size && Math.floor(stats.mtimeMs) === identity.modTimeMillis && (!compareChangeTime || identity.changeTimeMillis === void 0 || Math.floor(stats.ctimeMs) === identity.changeTimeMillis);\n}\nfunction shouldComparePosixFileIdentity(platform) {\n\treturn platform !== \"win32\";\n}\nfunction shouldComparePosixChangeTime(platform) {\n\treturn platform !== \"win32\";\n}\nfunction currentPlatform() {\n\treturn globalThis.process?.platform;\n}\n//#endregion\nexport { assertSameScannedRegularFile, localFileIdentityFromStats };\n\n//# sourceMappingURL=local-file-identity.js.map","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { toError } from \"../util/to-error.js\";\nimport { sanitizeErrorReason } from \"../util/error-reason.js\";\nimport { assertSameScannedRegularFile } from \"./local-file-identity.js\";\nimport { normalizeSha1TimeoutMillis } from \"./sha1-options.js\";\n//#region src/sync/local-sha1.ts\n/**\n* Formats a hash error for public sync events without leaking filesystem paths.\n*\n* @param error - Error thrown while hashing.\n*\n* @returns A sanitized reason suitable for event messages.\n*/\nfunction formatHashError(error) {\n\treturn sanitizeErrorReason(error);\n}\n/**\n* Returns whether an error represents an abort.\n*\n* @param err - Unknown thrown value.\n*\n* @returns True for AbortError values.\n*/\nfunction isAbortError(err) {\n\treturn toError(err).name === \"AbortError\";\n}\n/**\n* Reads a local file and computes its SHA-1 digest with non-regular-file rejection,\n* scanned-size bounds, abort support, and an idle/no-progress timeout.\n*\n* @param path - Local sync path to hash.\n* @param signal - Optional abort signal.\n* @param options - Optional idle timeout override.\n*\n* @returns The lowercase SHA-1 digest of the file bytes.\n*/\nasync function readLocalSha1File(path, signal, options = {}) {\n\tconst { constants } = await import(\"node:fs\");\n\tconst { lstat, open } = await import(\"node:fs/promises\");\n\tconst timeoutMillis = normalizeSha1TimeoutMillis(options.timeoutMillis);\n\tconst flags = constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);\n\tconst hash = new IncrementalSha1();\n\tlet stream;\n\tlet file;\n\tlet timeout;\n\tfunction armTimeout(onTimeout) {\n\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t\ttimeout = setTimeout(onTimeout, timeoutMillis);\n\t}\n\ttry {\n\t\tsignal?.throwIfAborted();\n\t\tassertSameScannedRegularFile(await withTimeout(lstat(path.absolutePath), timeoutMillis, \"sha1 file status\"), path, \"sha1 comparison\");\n\t\tfile = await openWithTimeout(open(path.absolutePath, flags), timeoutMillis);\n\t\tassertSameScannedRegularFile(await withTimeout(lstat(path.absolutePath), timeoutMillis, \"sha1 file status\"), path, \"sha1 comparison\");\n\t\tassertSameScannedRegularFile(await withTimeout(file.stat(), timeoutMillis, \"sha1 file status\"), path, \"sha1 comparison\");\n\t\tstream = file.createReadStream({\n\t\t\t...path.size > 0 ? {\n\t\t\t\tstart: 0,\n\t\t\t\tend: path.size - 1\n\t\t\t} : {},\n\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t});\n\t\tlet bytesRead = 0;\n\t\t/* v8 ignore next 3 -- idle-timeout firing is timing-dependent in filesystem tests */\n\t\tarmTimeout(() => {\n\t\t\tstream?.destroy(/* @__PURE__ */ new Error(`sha1 read stalled for ${timeoutMillis} ms`));\n\t\t});\n\t\tfor await (const chunk of stream) {\n\t\t\tbytesRead += chunk.byteLength;\n\t\t\tawait hash.update(chunk);\n\t\t\t/* v8 ignore next 3 -- idle-timeout firing is timing-dependent in filesystem tests */\n\t\t\tarmTimeout(() => {\n\t\t\t\tstream?.destroy(/* @__PURE__ */ new Error(`sha1 read stalled for ${timeoutMillis} ms`));\n\t\t\t});\n\t\t}\n\t\t/* v8 ignore next -- defensive TOCTOU guard after the bounded stream completes */\n\t\tif (bytesRead !== path.size) throw new Error(\"file changed during sha1 comparison\");\n\t\treturn hash.digest();\n\t} finally {\n\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t\tstream?.destroy();\n\t\tawait file?.close().catch(() => {});\n\t}\n}\n/* v8 ignore start -- defensive stale-filesystem stall handling is not portable to trigger */\nasync function withTimeout(promise, timeoutMillis, operation) {\n\tlet timeout;\n\ttry {\n\t\treturn await Promise.race([promise, new Promise((_, reject) => {\n\t\t\ttimeout = setTimeout(() => {\n\t\t\t\treject(/* @__PURE__ */ new Error(`${operation} stalled for ${timeoutMillis} ms`));\n\t\t\t}, timeoutMillis);\n\t\t})]);\n\t} finally {\n\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t}\n}\nasync function openWithTimeout(promise, timeoutMillis) {\n\tlet timedOut = false;\n\tconst tracked = promise.then((file) => {\n\t\tif (timedOut) file.close().catch(() => {});\n\t\treturn file;\n\t}, (err) => {\n\t\tthrow err;\n\t});\n\ttry {\n\t\treturn await withTimeout(tracked, timeoutMillis, \"sha1 file open\");\n\t} catch (err) {\n\t\ttimedOut = true;\n\t\tthrow err;\n\t}\n}\n/* v8 ignore stop */\n//#endregion\nexport { formatHashError, isAbortError, readLocalSha1File };\n\n//# sourceMappingURL=local-sha1.js.map","import { normalizeVerifiableSha1 } from \"../util/sha1.js\";\n//#region src/sync/sha1-metadata.ts\n/** Prefix used to mark SHA-1 metadata that must not prove equality without byte verification. */\nvar untrustedSha1Prefix = \"unverified:\";\n/**\n* Marks a verifiable SHA-1 digest as untrusted provider metadata.\n*\n* @param sha1 - Verifiable 40-character hexadecimal SHA-1 digest.\n*\n* @returns The untrusted SHA-1 sentinel value.\n*\n* @throws When the supplied value is not a verifiable SHA-1 digest.\n*/\nfunction untrustedSha1(sha1) {\n\tconst normalized = normalizeVerifiableSha1(sha1);\n\tif (normalized === null) throw new Error(\"untrusted SHA-1 metadata must be verifiable\");\n\treturn `${untrustedSha1Prefix}${normalized}`;\n}\n/**\n* Extracts the best comparable SHA-1 value from a B2 file version.\n*\n* B2's primary `contentSha1` is authoritative for single-part uploads when it is a verifiable\n* digest. Large/multipart B2 files report `contentSha1: null`; `fileInfo.large_file_sha1` is\n* caller-provided metadata, so it is returned as an untrusted hint that cannot prove equality\n* until the high-level synchronizer hashes the selected version's bytes.\n*\n* @param version - B2 file version metadata.\n*\n* @returns A lowercase comparable SHA-1, an untrusted sentinel, or null when unavailable.\n*/\nfunction selectB2ComparableSha1(version) {\n\tconst originalContentSha1 = version.contentSha1;\n\tif (typeof originalContentSha1 === \"string\") {\n\t\tif (isUntrustedSha1(originalContentSha1)) return originalContentSha1.toLowerCase();\n\t\treturn normalizeVerifiableSha1(originalContentSha1) ?? originalContentSha1.toLowerCase();\n\t}\n\tconst largeFileSha1 = normalizeVerifiableSha1(version.fileInfo[\"large_file_sha1\"]);\n\treturn largeFileSha1 === null ? null : untrustedSha1(largeFileSha1);\n}\n/**\n* Returns whether a SHA-1 value is marked as untrusted metadata.\n*\n* @param sha1 - Candidate SHA-1 metadata.\n*\n* @returns True when the value carries B2's unverified sentinel prefix.\n*/\nfunction isUntrustedSha1(sha1) {\n\treturn sha1?.toLowerCase().startsWith(\"unverified:\") ?? false;\n}\n/**\n* Parses the public `SyncPath.contentSha1` value into an explicit trust/availability state.\n*\n* @param sha1 - The raw `contentSha1` field from a sync path.\n*\n* @returns A discriminated state so custom scanners do not need to decode sentinels directly.\n*/\nfunction parseSyncContentSha1(sha1) {\n\tif (sha1 === void 0) return { kind: \"pending\" };\n\tif (sha1 === null) return { kind: \"unavailable\" };\n\tif (isUntrustedSha1(sha1)) return {\n\t\tkind: \"untrusted\",\n\t\traw: sha1,\n\t\tvalue: normalizeVerifiableSha1(sha1.slice(11))\n\t};\n\tconst normalized = normalizeVerifiableSha1(sha1);\n\tif (normalized === null) return {\n\t\tkind: \"untrusted\",\n\t\traw: sha1,\n\t\tvalue: null\n\t};\n\treturn {\n\t\tkind: \"verified\",\n\t\tvalue: normalized\n\t};\n}\n/**\n* Reads an explicit SHA-1 state when present, otherwise parses the compatibility field.\n*\n* @param path - Object carrying SHA-1 metadata.\n*\n* @returns The explicit or parsed SHA-1 state.\n*/\nfunction syncSha1StateOf(path) {\n\treturn path.contentSha1State ?? parseSyncContentSha1(path.contentSha1);\n}\n//#endregion\nexport { isUntrustedSha1, parseSyncContentSha1, selectB2ComparableSha1, syncSha1StateOf, untrustedSha1, untrustedSha1Prefix };\n\n//# sourceMappingURL=sha1-metadata.js.map","import { mapConcurrent } from \"../../upload/concurrency.js\";\nimport { normalizeVerifiableSha1 } from \"../../util/sha1.js\";\nimport { toError } from \"../../util/to-error.js\";\nimport { formatHashError, isAbortError } from \"../local-sha1.js\";\nimport { selectB2ComparableSha1, syncSha1StateOf } from \"../sha1-metadata.js\";\n//#region src/sync/policies/compare.ts\n/**\n* Determines whether two files should be considered different based on the compare mode.\n* For `sha1`, callers that use the low-level policy helpers should first prepare the pair so\n* local hashes and comparable B2 hashes are populated.\n*\n* @param source - The source file metadata.\n* @param dest - The destination file metadata.\n* @param compareMode - The comparison strategy: 'modtime', 'size', 'sha1', or 'none'.\n* @param threshold - Tolerance for the comparison (bytes for size, milliseconds for modtime).\n*\n* @returns `true` if the files are considered different.\n*\n* @throws When `compareMode` is not one of the supported compare modes.\n*/\nfunction filesAreDifferent(source, dest, compareMode, threshold = 0) {\n\tswitch (compareMode) {\n\t\tcase \"none\": return false;\n\t\tcase \"size\": return Math.abs(source.size - dest.size) > threshold;\n\t\tcase \"sha1\": return sha1ValuesAreDifferent(source, dest);\n\t\tcase \"modtime\": return Math.abs(source.modTimeMillis - dest.modTimeMillis) > threshold;\n\t\tdefault: throw new Error(`Unsupported compare mode: ${String(compareMode)}`);\n\t}\n}\n/**\n* Throws when a runtime compare mode value is unsupported.\n*\n* @param compareMode - User-supplied compare mode.\n*\n* @throws When `compareMode` is not one of the supported values.\n*/\nfunction assertSupportedCompareMode(compareMode) {\n\tswitch (compareMode) {\n\t\tcase \"none\":\n\t\tcase \"size\":\n\t\tcase \"sha1\":\n\t\tcase \"modtime\": return;\n\t\tdefault: throw new Error(`Unsupported compare mode: ${String(compareMode)}`);\n\t}\n}\nfunction sha1ValuesAreDifferent(source, dest) {\n\tif (source.size !== dest.size) return true;\n\tconst sourceSha1 = comparableSha1(source);\n\tconst destSha1 = comparableSha1(dest);\n\tif (sourceSha1.kind === \"untrusted\" || destSha1.kind === \"untrusted\") return true;\n\tif (sourceSha1.kind === \"unavailable\" || destSha1.kind === \"unavailable\") return true;\n\treturn sourceSha1.value !== destSha1.value;\n}\n/**\n* Prepares a pair for the selected compare mode.\n*\n* For `sha1`, this fills missing B2 hashes from comparable metadata and, when an explicit local\n* reader is supplied, hashes the local side only when size cannot already prove a difference.\n* Reader failures are converted into per-file sync events instead of aborting the whole run.\n*\n* @param pair - Source/destination pair from {@link zipFolders}.\n* @param compareMode - The comparison strategy.\n* @param options - Optional hashing dependencies and cancellation signal.\n*\n* @returns The prepared pair plus any preparation events.\n*/\nasync function preparePairForCompare(pair, compareMode, options = {}) {\n\tassertSupportedCompareMode(compareMode);\n\tif (compareMode !== \"sha1\") return readyComparePair(pair);\n\tconst [source, dest] = pair;\n\tif (source === null || dest === null) return readyComparePair(pair);\n\tif (source.size !== dest.size) return readyComparePair(pair);\n\tconst metadataPair = [withB2ContentSha1(source), withB2ContentSha1(dest)];\n\tif (hasUnavailableB2Sha1(metadataPair)) return skipped(metadataPair, unavailableSha1Event(metadataPair));\n\tif (options.readB2Sha1 === void 0 && hasUntrustedSha1(metadataPair) && !hasVerifiableUntrustedSha1(metadataPair)) return readyComparePair(metadataPair);\n\tconst [metadataSource, metadataDest] = metadataPair;\n\tif (metadataSource === null || metadataDest === null) return readyComparePair(metadataPair);\n\tconst sourceResult = await prepareLocalPathSha1(metadataSource, options);\n\tif (sourceResult.aborted) return aborted(metadataPair);\n\tif (sourceResult.event) return skipped(metadataPair, sourceResult.event, sourceResult.error, sourceResult.bytesHashed);\n\tconst destResult = await prepareLocalPathSha1(metadataDest, options);\n\tif (destResult.aborted) return aborted([sourceResult.path, destResult.path]);\n\tif (destResult.event) return skipped([sourceResult.path, destResult.path], destResult.event, destResult.error, sourceResult.bytesHashed);\n\tconst preparedPair = [sourceResult.path, destResult.path];\n\tconst sourceState = comparableSha1(sourceResult.path);\n\tconst destState = comparableSha1(destResult.path);\n\tconst bytesHashed = sourceResult.bytesHashed + destResult.bytesHashed;\n\tif (sourceState.kind === \"unavailable\" || destState.kind === \"unavailable\") return skipped(preparedPair, unavailableSha1Event(preparedPair), void 0, bytesHashed);\n\tconst shouldVerifyB2Bytes = untrustedSha1CouldSuppressTransfer(sourceState, destState);\n\tconst readB2Sha1 = options.readB2Sha1;\n\tif (shouldVerifyB2Bytes && hasB2Path(preparedPair) && readB2Sha1 !== void 0) return verifyB2Sha1Bytes(preparedPair, {\n\t\t...options,\n\t\treadB2Sha1\n\t}, bytesHashed);\n\treturn readyComparePair(preparedPair, bytesHashed);\n}\n/**\n* Prepares a list of pairs for the selected compare mode with bounded concurrency.\n*\n* @param pairs - Source/destination pairs from {@link zipFolders}.\n* @param compareMode - The comparison strategy.\n* @param options - Optional hashing dependencies, cancellation signal, and concurrency.\n*\n* @returns Prepared results in the same order as the input pairs.\n*/\nasync function preparePairsForCompare(pairs, compareMode, options = {}) {\n\tassertSupportedCompareMode(compareMode);\n\tif (compareMode !== \"sha1\") return pairs.map((pair) => ({\n\t\toriginalPair: pair,\n\t\tprepared: readyComparePair(pair)\n\t}));\n\treturn mapConcurrent(pairs, normalizeConcurrency(options.concurrency), async (pair) => {\n\t\tif (options.signal?.aborted) return {\n\t\t\toriginalPair: pair,\n\t\t\tprepared: aborted(pair)\n\t\t};\n\t\treturn {\n\t\t\toriginalPair: pair,\n\t\t\tprepared: await preparePairForCompare(pair, compareMode, options)\n\t\t};\n\t});\n}\nasync function prepareLocalPathSha1(path, options) {\n\tif (!isLocalSyncPath(path)) return {\n\t\tpath,\n\t\tbytesHashed: 0,\n\t\tbytesVerified: 0,\n\t\taborted: false\n\t};\n\tif (options.signal?.aborted) return {\n\t\tpath,\n\t\tbytesHashed: 0,\n\t\tbytesVerified: 0,\n\t\taborted: true\n\t};\n\ttry {\n\t\tconst state = syncSha1StateOf(path);\n\t\tif (state.kind === \"verified\") return {\n\t\t\tpath: {\n\t\t\t\t...path,\n\t\t\t\tcontentSha1: state.value\n\t\t\t},\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: false\n\t\t};\n\t\tif (state.kind === \"unavailable\") return {\n\t\t\tpath: {\n\t\t\t\t...path,\n\t\t\t\tcontentSha1: null\n\t\t\t},\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: false\n\t\t};\n\t\tconst readLocalSha1 = options.readLocalSha1;\n\t\tif (readLocalSha1 === void 0) return {\n\t\t\tpath: {\n\t\t\t\t...path,\n\t\t\t\tcontentSha1: path.contentSha1 ?? null\n\t\t\t},\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: false\n\t\t};\n\t\tconst contentSha1 = await readLocalSha1(path, options.signal, { ...options.sha1ReadTimeoutMillis !== void 0 ? { timeoutMillis: options.sha1ReadTimeoutMillis } : {} });\n\t\treturn {\n\t\t\tpath: {\n\t\t\t\t...path,\n\t\t\t\tcontentSha1\n\t\t\t},\n\t\t\tbytesHashed: normalizeVerifiableSha1(contentSha1) === null ? 0 : path.size,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: false\n\t\t};\n\t} catch (err) {\n\t\tif (options.signal?.aborted || isAbortError(err)) return {\n\t\t\tpath,\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: true\n\t\t};\n\t\tconst error = toError(err);\n\t\treturn {\n\t\t\tpath,\n\t\t\tbytesHashed: 0,\n\t\t\tevent: {\n\t\t\t\ttype: \"error\",\n\t\t\t\tpath: path.relativePath,\n\t\t\t\tsize: 0,\n\t\t\t\tmessage: `failed to hash local file for sha1 comparison: ${formatHashError(error)}`\n\t\t\t},\n\t\t\terror,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: false\n\t\t};\n\t}\n}\nasync function verifyB2Sha1Bytes(pair, options, bytesHashed) {\n\tconst [source, dest] = pair;\n\t/* v8 ignore next -- callers only verify B2 bytes for paired compare results */\n\tif (source === null || dest === null) return readyComparePair(pair, bytesHashed);\n\tconst sourceResult = await prepareUntrustedB2PathSha1(source, options);\n\tconst sourceBytesVerified = sourceResult.bytesVerified;\n\tif (sourceResult.aborted) return aborted(pair);\n\tif (sourceResult.event) return skipped([sourceResult.path, dest], sourceResult.event, sourceResult.error, bytesHashed, sourceBytesVerified);\n\tconst destResult = await prepareUntrustedB2PathSha1(dest, options);\n\tconst bytesVerified = sourceBytesVerified + destResult.bytesVerified;\n\t/* v8 ignore next -- destination abort mirrors the covered source abort path */\n\tif (destResult.aborted) return aborted([sourceResult.path, destResult.path]);\n\tif (destResult.event) return skipped([sourceResult.path, destResult.path], destResult.event, destResult.error, bytesHashed, bytesVerified);\n\treturn readyComparePair([sourceResult.path, destResult.path], bytesHashed, bytesVerified);\n}\nasync function prepareUntrustedB2PathSha1(path, options) {\n\tif (!isB2SyncPath(path) || comparableSha1(path).kind !== \"untrusted\") return {\n\t\tpath,\n\t\tbytesHashed: 0,\n\t\tbytesVerified: 0,\n\t\taborted: false\n\t};\n\treturn prepareB2PathSha1(path, options);\n}\nasync function prepareB2PathSha1(path, options) {\n\t/* v8 ignore next -- pre-aborted B2 reads are covered at pair level */\n\tif (options.signal?.aborted) return {\n\t\tpath,\n\t\tbytesHashed: 0,\n\t\tbytesVerified: 0,\n\t\taborted: true\n\t};\n\ttry {\n\t\tconst result = await options.readB2Sha1(path, options.signal);\n\t\tconst contentSha1 = typeof result === \"object\" && result !== null ? result.contentSha1 : result;\n\t\tconst bytesVerified = typeof result === \"object\" && result !== null ? Math.max(0, result.bytesRead) : 0;\n\t\tconst preparedPath = {\n\t\t\t...path,\n\t\t\tcontentSha1,\n\t\t\tcontentSha1State: syncSha1StateOf({ contentSha1 })\n\t\t};\n\t\tif (contentSha1 === null) return {\n\t\t\tpath: preparedPath,\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified,\n\t\t\tevent: unavailableSha1PathEvent(path),\n\t\t\taborted: false\n\t\t};\n\t\treturn {\n\t\t\tpath: preparedPath,\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified,\n\t\t\taborted: false\n\t\t};\n\t} catch (err) {\n\t\tif (options.signal?.aborted || isAbortError(err)) return {\n\t\t\tpath,\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\taborted: true\n\t\t};\n\t\tconst error = toError(err);\n\t\treturn {\n\t\t\tpath,\n\t\t\tbytesHashed: 0,\n\t\t\tbytesVerified: 0,\n\t\t\tevent: {\n\t\t\t\ttype: \"skip\",\n\t\t\t\tpath: path.relativePath,\n\t\t\t\tsize: 0,\n\t\t\t\tmessage: `sha1 comparison skipped because B2 verification failed: ${formatHashError(error)}`\n\t\t\t},\n\t\t\taborted: false\n\t\t};\n\t}\n}\nfunction comparableSha1(path) {\n\tconst state = syncSha1StateOf(path);\n\tif (state.kind === \"verified\") return {\n\t\tkind: \"verified\",\n\t\tvalue: state.value\n\t};\n\tif (state.kind === \"untrusted\") return {\n\t\tkind: \"untrusted\",\n\t\tvalue: state.value\n\t};\n\treturn { kind: \"unavailable\" };\n}\nfunction untrustedSha1CouldSuppressTransfer(source, dest) {\n\tif (source.kind === \"untrusted\" && dest.kind === \"verified\") return source.value === dest.value;\n\tif (dest.kind === \"untrusted\" && source.kind === \"verified\") return dest.value === source.value;\n\tif (source.kind === \"untrusted\" && dest.kind === \"untrusted\") return source.value !== null && source.value === dest.value;\n\treturn false;\n}\nfunction withB2ContentSha1(path) {\n\tif (!isB2SyncPath(path) || path.contentSha1 !== void 0 || path.contentSha1State !== void 0) return path;\n\tconst contentSha1 = selectB2ComparableSha1(path.selectedVersion);\n\treturn {\n\t\t...path,\n\t\tcontentSha1,\n\t\tcontentSha1State: syncSha1StateOf({ contentSha1 })\n\t};\n}\nfunction hasUnavailableB2Sha1(pair) {\n\tconst [source, dest] = pair;\n\treturn source !== null && isB2SyncPath(source) && comparableSha1(source).kind === \"unavailable\" || dest !== null && isB2SyncPath(dest) && comparableSha1(dest).kind === \"unavailable\";\n}\nfunction hasUntrustedSha1(pair) {\n\tconst [source, dest] = pair;\n\treturn source !== null && comparableSha1(source).kind === \"untrusted\" || dest !== null && comparableSha1(dest).kind === \"untrusted\";\n}\nfunction hasVerifiableUntrustedSha1(pair) {\n\tconst [source, dest] = pair;\n\treturn source !== null && verifiableUntrustedSha1(source) || dest !== null && verifiableUntrustedSha1(dest);\n}\nfunction verifiableUntrustedSha1(path) {\n\tconst state = comparableSha1(path);\n\treturn state.kind === \"untrusted\" && state.value !== null;\n}\nfunction hasB2Path(pair) {\n\tconst [source, dest] = pair;\n\treturn source !== null && isB2SyncPath(source) || dest !== null && isB2SyncPath(dest);\n}\nfunction isB2SyncPath(path) {\n\treturn \"selectedVersion\" in path;\n}\nfunction isLocalSyncPath(path) {\n\treturn \"absolutePath\" in path;\n}\n/**\n* Creates a successful no-op compare preparation result for a pair.\n*\n* @param pair - Source/destination pair from {@link zipFolders}.\n* @param bytesHashed - Local file bytes read while preparing the pair.\n* @param bytesVerified - B2 bytes read while verifying untrusted SHA-1 metadata.\n*\n* @returns A ready preparation result that allows action generation.\n*/\nfunction readyComparePair(pair, bytesHashed = 0, bytesVerified = 0) {\n\treturn {\n\t\tpair,\n\t\tevents: [],\n\t\terrors: [],\n\t\tbytesHashed,\n\t\tbytesVerified,\n\t\tskipActionGeneration: false,\n\t\taborted: false\n\t};\n}\nfunction skipped(pair, event, error, bytesHashed = 0, bytesVerified = 0) {\n\treturn {\n\t\tpair,\n\t\tevents: [event],\n\t\terrors: error !== void 0 ? [error] : [],\n\t\tbytesHashed,\n\t\tbytesVerified,\n\t\tskipActionGeneration: true,\n\t\taborted: false\n\t};\n}\nfunction aborted(pair) {\n\treturn {\n\t\tpair,\n\t\tevents: [],\n\t\terrors: [],\n\t\tbytesHashed: 0,\n\t\tbytesVerified: 0,\n\t\tskipActionGeneration: true,\n\t\taborted: true\n\t};\n}\nfunction unavailableSha1Event(pair) {\n\treturn unavailableSha1PathEvent({ relativePath: (pair[0] ?? pair[1])?.relativePath ?? \"\" });\n}\nfunction unavailableSha1PathEvent(path) {\n\treturn {\n\t\ttype: \"skip\",\n\t\tpath: path.relativePath,\n\t\tsize: 0,\n\t\tmessage: \"sha1 comparison skipped because a verifiable SHA-1 is unavailable\"\n\t};\n}\nfunction normalizeConcurrency(value) {\n\tif (value === void 0 || !Number.isFinite(value) || value < 1) return 1;\n\treturn Math.max(1, Math.floor(value));\n}\n//#endregion\nexport { assertSupportedCompareMode, filesAreDifferent, preparePairForCompare, preparePairsForCompare, readyComparePair };\n\n//# sourceMappingURL=compare.js.map","import { SkipAction } from \"../actions/index.js\";\nimport { assertSupportedCompareMode, filesAreDifferent } from \"./compare.js\";\n//#region src/sync/policies/index.ts\n/**\n* Converts a paired source/dest tuple into zero or more sync actions based on the\n* sync direction, compare mode, and keep policy.\n* For `compareMode: 'sha1'`, prefer the high-level `synchronize()` API so local\n* file hashes and comparable B2 hashes are prepared before actions are generated.\n* Low-level callers must pass pairs with local `contentSha1` values already\n* computed and B2 `contentSha1` values containing any comparable metadata fallback.\n*\n* @param pair - The source/dest file pair from {@link zipFolders}.\n* @param direction - The sync direction.\n* @param compareMode - How to compare files for differences.\n* @param keepMode - Policy for destination-only files.\n* @param keepDays - Retention period when keepMode is 'keep-days'.\n* @param nowMillis - Current time in milliseconds, used for keep-days calculation.\n* @param factory - Factory to create the concrete action objects.\n* @param compareThreshold - Tolerance for the comparison.\n*/\nfunction* generateActions(pair, direction, compareMode, keepMode, keepDays, nowMillis, factory, compareThreshold) {\n\tassertSupportedCompareMode(compareMode);\n\tconst [source, dest] = pair;\n\tif (source !== null && dest === null) yield* actionsForSourceOnly(source, direction, factory);\n\telse if (source === null && dest !== null) yield* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory);\n\telse if (source !== null && dest !== null) yield* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory);\n}\nfunction* actionsForSourceOnly(source, direction, factory) {\n\tswitch (direction) {\n\t\tcase \"local-to-b2\":\n\t\t\tyield factory.upload(source);\n\t\t\tbreak;\n\t\tcase \"b2-to-local\":\n\t\t\tyield factory.download(source, null);\n\t\t\tbreak;\n\t\tcase \"b2-to-b2\":\n\t\t\tyield factory.copy(source, source.relativePath);\n\t\t\tbreak;\n\t}\n}\nfunction* actionsForDestOnly(dest, direction, keepMode, keepDays, nowMillis, factory) {\n\tif (keepMode === \"no-delete\") {\n\t\tyield new SkipAction(dest.relativePath, \"not in source, keep-mode is no-delete\");\n\t\treturn;\n\t}\n\tif (keepMode === \"keep-days\") {\n\t\tconst ageDays = (nowMillis - dest.modTimeMillis) / (1440 * 60 * 1e3);\n\t\tif (ageDays < keepDays) {\n\t\t\tyield new SkipAction(dest.relativePath, `not in source, keeping for ${Math.ceil(keepDays - ageDays)} more days`);\n\t\t\treturn;\n\t\t}\n\t}\n\tswitch (direction) {\n\t\tcase \"local-to-b2\":\n\t\t\tyield factory.removeOrphan(dest);\n\t\t\tbreak;\n\t\tcase \"b2-to-local\":\n\t\t\tyield factory.deleteLocal(dest);\n\t\t\tbreak;\n\t\tcase \"b2-to-b2\":\n\t\t\tyield factory.removeOrphan(dest);\n\t\t\tbreak;\n\t}\n}\nfunction* actionsForBoth(source, dest, direction, compareMode, compareThreshold, factory) {\n\tif (!filesAreDifferent(source, dest, compareMode, compareThreshold)) {\n\t\tyield new SkipAction(source.relativePath, \"files are the same\");\n\t\treturn;\n\t}\n\tswitch (direction) {\n\t\tcase \"local-to-b2\":\n\t\t\tyield factory.upload(source, dest);\n\t\t\tbreak;\n\t\tcase \"b2-to-local\":\n\t\t\tyield factory.download(source, dest);\n\t\t\tbreak;\n\t\tcase \"b2-to-b2\":\n\t\t\tyield factory.copyB2Path?.(source, dest) ?? factory.copy(source, dest.relativePath);\n\t\t\tbreak;\n\t}\n}\n//#endregion\nexport { generateActions };\n\n//# sourceMappingURL=index.js.map","//#region src/sync/path-safety.ts\nvar RESERVED_SYNC_TEMP_FILE_RE = /^\\.b2sdk-[0-9a-f]{24}-[^/\\\\]+-[0-9a-f]{32}\\.partial$/i;\nvar UUID_HEX_RE = /^[0-9a-f]{32}$/i;\n/**\n* Checks whether a basename is reserved for SDK-owned sync partial files.\n* @param name - Basename to inspect.\n*\n* @returns Whether the basename matches the SDK reserved partial-file pattern.\n*\n* @internal\n*/\nfunction isReservedSyncTempFileName(name) {\n\treturn RESERVED_SYNC_TEMP_FILE_RE.test(name);\n}\n/**\n* Rejects sync paths whose basename is reserved for SDK-owned temporary files.\n* @param relativePath - Sync-relative path using slash separators.\n*\n* @throws If any path segment uses the SDK's reserved temporary-file pattern.\n*\n* @internal\n*/\nfunction assertSyncPathAllowed(relativePath) {\n\tif (relativePath.split(/[\\\\/]+/).filter(Boolean).some((part) => isReservedSyncTempFileName(part))) throw new Error(`Sync path uses reserved SDK temporary-file name: ${relativePath}`);\n}\n/**\n* Creates a download staging basename inside the SDK-reserved temp namespace.\n* @param finalName - Final destination basename.\n* @param uuid - UUID used to make the temp basename unique.\n*\n* @returns A basename that local and B2 scanners reject as SDK-owned temp data.\n*\n* @throws If the provided UUID cannot be normalized to 32 hex characters.\n*\n* @internal\n*/\nfunction makeReservedSyncTempFileName(finalName, uuid) {\n\tif (finalName.length === 0 || /[\\\\/]/.test(finalName)) throw new Error(\"invalid sync temporary-file basename\");\n\tconst hex = uuid.replaceAll(\"-\", \"\").toLowerCase();\n\tif (!UUID_HEX_RE.test(hex)) throw new Error(\"invalid sync temporary-file nonce\");\n\treturn `.b2sdk-${hex.slice(0, 24)}-${finalName}-${hex}.partial`;\n}\n/**\n* Validates B2 relative names before they are materialized on a local filesystem.\n*\n* @param relPath - B2-style relative path.\n*\n* @returns Validated path segments.\n*\n* @throws When the path is empty, absolute, platform-ambiguous, or contains traversal.\n*\n* @internal\n*/\nfunction safeRelativePathSegments(relPath) {\n\tassertSyncPathAllowed(relPath);\n\tif (relPath.length === 0 || relPath.includes(\"\\0\") || relPath.includes(\"\\\\\") || relPath.startsWith(\"/\") || /^[A-Za-z]:/.test(relPath)) throw new Error(\"unsafe local destination path\");\n\tconst segments = relPath.split(\"/\");\n\tif (segments.some((segment) => segment.length === 0 || segment === \".\" || segment === \"..\" || segment.includes(\":\") || segment.endsWith(\".\") || segment.endsWith(\" \") || WINDOWS_RESERVED_NAME.test(segment))) throw new Error(\"unsafe local destination path\");\n\treturn segments;\n}\nvar WINDOWS_RESERVED_NAME = /^(con|prn|aux|nul|conin\\$|conout\\$|com[0-9\\u00b9\\u00b2\\u00b3]|lpt[0-9\\u00b9\\u00b2\\u00b3])(?:\\..*)?$/i;\n/**\n* Throws if {@link target} is outside {@link root} or names the root itself.\n*\n* @param root - Resolved filesystem root.\n* @param target - Candidate path to validate.\n* @param path - Node path module.\n*\n* @throws When the target is outside the root or equal to the root.\n*\n* @internal\n*/\nfunction assertPathInsideRoot(root, target, path) {\n\tconst relative = path.relative(root, target);\n\tif (relative.length === 0 || relative === \"..\" || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) throw new Error(\"unsafe local destination path\");\n}\n/**\n* Returns the platform's no-follow open flag when available.\n*\n* @param constants - Node filesystem constants.\n*\n* @returns The `O_NOFOLLOW` bit or `0`.\n*\n* @internal\n*/\nfunction noFollowFlag(constants) {\n\treturn constants.O_NOFOLLOW ?? 0;\n}\n/**\n* Checks whether an unknown thrown value has a specific Node error code.\n*\n* @param err - Unknown thrown value.\n* @param code - Expected Node error code.\n*\n* @returns True when the value exposes the expected code.\n*\n* @internal\n*/\nfunction hasErrorCode(err, code) {\n\treturn err.code === code;\n}\n//#endregion\nexport { assertPathInsideRoot, assertSyncPathAllowed, hasErrorCode, isReservedSyncTempFileName, makeReservedSyncTempFileName, noFollowFlag, safeRelativePathSegments };\n\n//# sourceMappingURL=path-safety.js.map","import { assertPathInsideRoot, hasErrorCode, noFollowFlag } from \"./path-safety.js\";\n//#region src/sync/download-staging.ts\n/** @internal */\nvar DOWNLOAD_STAGING_DIRECTORY_NAME = \".b2sdk-download-staging\";\n/** @internal */\nvar DOWNLOAD_STAGING_MARKER_NAME = \".b2sdk-staging-marker.partial\";\nvar CANONICAL_DOWNLOAD_STAGING_DIRECTORY_NAME = canonicalLocalFilesystemSegment(DOWNLOAD_STAGING_DIRECTORY_NAME);\nvar DOWNLOAD_STAGING_ENTRY_SUFFIX = \".download\";\nvar STALE_DOWNLOAD_STAGING_AGE_MS = 1440 * 60 * 1e3;\nvar MAX_STAGING_CLEANUP_CONCURRENCY = 8;\nvar MAX_CLEANUP_WARNING_ENTRIES = 3;\n/** @internal */\nvar DOWNLOAD_STAGING_ACTIVITY_ENTRY_LIMIT = 1024;\nvar reapedManagedDirectories = /* @__PURE__ */ new Map();\n/**\n* Checks whether a single path segment matches the SDK-managed staging directory name.\n* @param segment - Candidate path segment.\n*\n* @returns True when the segment is the reserved staging directory name under\n* local filesystem canonicalization.\n*\n* @internal\n*/\nfunction isDownloadStagingDirectorySegment(segment) {\n\treturn segment !== void 0 && canonicalLocalFilesystemSegment(segment) === CANONICAL_DOWNLOAD_STAGING_DIRECTORY_NAME;\n}\n/**\n* Creates a private SDK-managed staging directory under a local sync root.\n* @param rootRealPath - Resolved local sync root path.\n* @param path - Node path module used for platform-specific path operations.\n* @param randomUUID - UUID provider used to create unique staging entries.\n* @param statForDeviceCheck - Stat function used to verify filesystem devices.\n* @param beforeStagingMarkerWrite - Test hook called before marker creation.\n*\n* @returns The resolved staging directory path.\n*\n* @internal\n*/\nasync function createDownloadStagingDirectory(rootRealPath, path, randomUUID, statForDeviceCheck, beforeStagingMarkerWrite) {\n\tconst { chmod, lstat, mkdir, readdir, realpath, rm } = await import(\"node:fs/promises\");\n\tconst managedDirectory = path.join(rootRealPath, DOWNLOAD_STAGING_DIRECTORY_NAME);\n\ttry {\n\t\tawait mkdir(managedDirectory, { mode: PRIVATE_DOWNLOAD_DIRECTORY_MODE });\n\t} catch (err) {\n\t\tif (!hasErrorCode(err, \"EEXIST\")) throw err;\n\t}\n\tif (!(await lstat(managedDirectory)).isDirectory()) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is not a directory`);\n\tconst realManagedDirectory = await realpath(managedDirectory);\n\tassertPathInsideRoot(rootRealPath, realManagedDirectory, path);\n\tawait assertDownloadPathSameDevice(rootRealPath, realManagedDirectory, statForDeviceCheck, \"unsafe local destination path: cannot stage download across filesystems\");\n\tif (!await isManagedDownloadStagingRoot(realManagedDirectory)) {\n\t\tif ((await readdir(realManagedDirectory)).length > 0 && !await isManagedDownloadStagingRoot(realManagedDirectory)) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is reserved for SDK download staging`);\n\t}\n\tawait beforeStagingMarkerWrite?.(realManagedDirectory);\n\tawait writeStagingMarker(realManagedDirectory, path);\n\t/* v8 ignore next -- best-effort chmod */\n\tawait chmod(realManagedDirectory, PRIVATE_DOWNLOAD_DIRECTORY_MODE).catch(() => {});\n\tawait reapStaleDownloadStagingDirectoriesOnce(realManagedDirectory, path, Date.now());\n\tconst stagingDirectory = path.join(realManagedDirectory, `${Date.now()}-${randomUUID()}${DOWNLOAD_STAGING_ENTRY_SUFFIX}`);\n\tawait mkdir(stagingDirectory, { mode: PRIVATE_DOWNLOAD_DIRECTORY_MODE });\n\t/* v8 ignore next -- best-effort chmod */\n\tawait chmod(stagingDirectory, PRIVATE_DOWNLOAD_DIRECTORY_MODE).catch(() => {});\n\ttry {\n\t\tconst realStagingDirectory = await realpath(stagingDirectory);\n\t\tassertPathInsideRoot(realManagedDirectory, realStagingDirectory, path);\n\t\tawait assertDownloadPathSameDevice(rootRealPath, realStagingDirectory, statForDeviceCheck, \"unsafe local destination path: cannot stage download across filesystems\");\n\t\tawait beforeStagingMarkerWrite?.(realStagingDirectory);\n\t\tawait writeStagingMarker(realStagingDirectory, path);\n\t\treturn realStagingDirectory;\n\t} catch (err) {\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait rm(stagingDirectory, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t}).catch(() => {});\n\t\tthrow err;\n\t}\n}\n/**\n* Returns true when a scan-root entry is an SDK-managed download staging root.\n* @param directory - Candidate directory to inspect.\n*\n* @returns True when the directory contains SDK staging markers.\n*\n* @internal\n*/\nasync function isManagedDownloadStagingRoot(directory) {\n\tconst { lstat, readdir } = await import(\"node:fs/promises\");\n\tconst path = await import(\"node:path\");\n\ttry {\n\t\tif ((await lstat(path.join(directory, \".b2sdk-staging-marker.partial\"))).isFile()) return true;\n\t} catch (err) {\n\t\tif (!hasErrorCode(err, \"ENOENT\")) return false;\n\t}\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(directory, { withFileTypes: true });\n\t} catch {\n\t\treturn false;\n\t}\n\tfor (const entry of entries) {\n\t\tif (!entry.isDirectory() || !entry.name.endsWith(DOWNLOAD_STAGING_ENTRY_SUFFIX)) continue;\n\t\ttry {\n\t\t\tif ((await lstat(path.join(directory, entry.name, \".b2sdk-staging-marker.partial\"))).isFile()) return true;\n\t\t} catch {}\n\t}\n\treturn false;\n}\nvar PRIVATE_DOWNLOAD_FILE_MODE = 384;\nvar PRIVATE_DOWNLOAD_DIRECTORY_MODE = 448;\nasync function writeStagingMarker(directory, path) {\n\tconst { constants } = await import(\"node:fs\");\n\tconst { lstat, open } = await import(\"node:fs/promises\");\n\tconst markerPath = path.join(directory, DOWNLOAD_STAGING_MARKER_NAME);\n\tlet handle;\n\ttry {\n\t\thandle = await open(markerPath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | noFollowFlag(constants), PRIVATE_DOWNLOAD_FILE_MODE);\n\t\t/* v8 ignore next -- best-effort chmod */\n\t\tawait handle.chmod(PRIVATE_DOWNLOAD_FILE_MODE).catch(() => {});\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"EEXIST\") || hasErrorCode(err, \"ELOOP\")) {\n\t\t\tif ((await lstat(markerPath).catch(() => void 0))?.isFile() === true) return;\n\t\t\tthrow new Error(\"unsafe local destination path: staging marker is not a regular file\");\n\t\t}\n\t\tthrow err;\n\t} finally {\n\t\t/* v8 ignore next -- best-effort close */\n\t\tawait handle?.close().catch(() => {});\n\t}\n}\n/**\n* Verifies that a candidate path is on the same filesystem device as the root.\n* @param rootRealPath - Resolved local sync root path.\n* @param candidateRealPath - Resolved candidate path to compare.\n* @param statForDeviceCheck - Stat function used to read device IDs.\n* @param message - Error message used when devices differ.\n*\n* @internal\n*/\nasync function assertDownloadPathSameDevice(rootRealPath, candidateRealPath, statForDeviceCheck, message) {\n\tconst [rootStats, candidateStats] = await Promise.all([statForDeviceCheck(rootRealPath), statForDeviceCheck(candidateRealPath)]);\n\tif (rootStats.dev !== candidateStats.dev) throw new Error(message);\n}\nasync function reapStaleDownloadStagingDirectoriesOnce(managedDirectory, path, nowMillis) {\n\tconst previous = reapedManagedDirectories.get(managedDirectory);\n\tif (previous !== void 0) {\n\t\tawait previous;\n\t\treturn;\n\t}\n\tconst next = reapStaleDownloadStagingDirectories(managedDirectory, path, nowMillis).finally(() => {\n\t\tif (reapedManagedDirectories.get(managedDirectory) === next) reapedManagedDirectories.delete(managedDirectory);\n\t});\n\treapedManagedDirectories.set(managedDirectory, next);\n\tawait next;\n}\nasync function reapStaleDownloadStagingDirectories(managedDirectory, path, nowMillis) {\n\tconst { readdir, realpath, rm } = await import(\"node:fs/promises\");\n\tlet entries;\n\ttry {\n\t\tentries = await readdir(managedDirectory, { withFileTypes: true });\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"ENOENT\")) return;\n\t\temitCleanupWarning(\"failed to inspect B2 SDK download staging entries\");\n\t\treturn;\n\t}\n\tconst cleanupErrors = [];\n\tawait forEachWithConcurrency(entries, MAX_STAGING_CLEANUP_CONCURRENCY, async (entry) => {\n\t\tif (!entry.isDirectory() || !entry.name.endsWith(DOWNLOAD_STAGING_ENTRY_SUFFIX)) return;\n\t\tconst candidate = path.join(managedDirectory, entry.name);\n\t\tconst activity = await readManagedStagingEntryActivity(candidate, path);\n\t\tif (activity === void 0 || !stagingActivityIsStale(activity, nowMillis)) return;\n\t\tconst realCandidate = await realpath(candidate).catch(() => {\n\t\t\tcleanupErrors.push({\n\t\t\t\tentryName: entry.name,\n\t\t\t\toperation: \"inspect\"\n\t\t\t});\n\t\t});\n\t\tif (realCandidate === void 0) return;\n\t\ttry {\n\t\t\tassertPathInsideRoot(managedDirectory, realCandidate, path);\n\t\t\tconst latestActivity = await readManagedStagingEntryActivity(candidate, path);\n\t\t\tif (latestActivity === void 0 || latestActivity.signature !== activity.signature || !stagingActivityIsStale(latestActivity, nowMillis)) return;\n\t\t\tawait rm(realCandidate, {\n\t\t\t\trecursive: true,\n\t\t\t\tforce: true\n\t\t\t});\n\t\t} catch {\n\t\t\tcleanupErrors.push({\n\t\t\t\tentryName: entry.name,\n\t\t\t\toperation: \"remove\"\n\t\t\t});\n\t\t}\n\t});\n\tif (cleanupErrors.length > 0) {\n\t\tconst noun = cleanupErrors.length === 1 ? \"entry\" : \"entries\";\n\t\temitCleanupWarning(`failed to reap ${cleanupErrors.length} stale B2 SDK download staging ${noun}: ${cleanupErrors.slice(0, MAX_CLEANUP_WARNING_ENTRIES).map(formatCleanupWarning).join(\"; \")}`);\n\t}\n}\nasync function readManagedStagingEntryActivity(candidate, path) {\n\tconst { lstat, readdir } = await import(\"node:fs/promises\");\n\ttry {\n\t\tconst [directoryStats, markerStats] = await Promise.all([lstat(candidate), lstat(path.join(candidate, DOWNLOAD_STAGING_MARKER_NAME))]);\n\t\tif (!directoryStats.isDirectory() || !markerStats.isFile()) return void 0;\n\t\tconst entries = await readdir(candidate, { withFileTypes: true });\n\t\tif (entries.length > 1024) return void 0;\n\t\tconst statsParts = [`.:${stagingStatsSignature(directoryStats)}`, `${DOWNLOAD_STAGING_MARKER_NAME}:${stagingStatsSignature(markerStats)}`];\n\t\tlet newestActivityMs = Math.max(stagingStatsActivityMs(directoryStats), stagingStatsActivityMs(markerStats));\n\t\tfor (const entry of [...entries].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {\n\t\t\tconst stats = await lstat(path.join(candidate, entry.name));\n\t\t\tstatsParts.push(`${entry.name}:${stagingStatsSignature(stats)}`);\n\t\t\tnewestActivityMs = Math.max(newestActivityMs, stagingStatsActivityMs(stats));\n\t\t}\n\t\treturn {\n\t\t\tnewestActivityMs,\n\t\t\tsignature: statsParts.join(\"|\")\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction stagingStatsActivityMs(stats) {\n\treturn stats.mtimeMs;\n}\nfunction stagingStatsSignature(stats) {\n\treturn `${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeMs}:${stats.ctimeMs}`;\n}\nfunction stagingActivityIsStale(activity, nowMillis) {\n\treturn nowMillis - activity.newestActivityMs >= STALE_DOWNLOAD_STAGING_AGE_MS;\n}\nfunction formatCleanupWarning(error) {\n\treturn `${error.operation} ${safeWarningName(error.entryName)}`;\n}\nfunction safeWarningName(name) {\n\tconst chars = Array.from(name);\n\tconst bounded = chars.slice(0, 80).join(\"\");\n\tconst suffix = chars.length > 80 ? \"...\" : \"\";\n\treturn JSON.stringify(`${bounded.replace(/[^A-Za-z0-9._-]/g, \"?\")}${suffix}`);\n}\nfunction canonicalLocalFilesystemSegment(segment) {\n\treturn segment.normalize(\"NFC\").toLocaleLowerCase(\"en-US\");\n}\nasync function forEachWithConcurrency(items, concurrency, fn) {\n\tlet index = 0;\n\tconst workers = Array.from({ length: Math.min(concurrency, items.length) }, async () => {\n\t\twhile (index < items.length) {\n\t\t\tconst item = items[index];\n\t\t\tindex += 1;\n\t\t\tif (item !== void 0) await fn(item);\n\t\t}\n\t});\n\tawait Promise.all(workers);\n}\nfunction emitCleanupWarning(message) {\n\tglobalThis.process?.emitWarning?.(message, { code: \"B2SDK_DOWNLOAD_STAGING_CLEANUP_FAILED\" });\n}\n//#endregion\nexport { DOWNLOAD_STAGING_ACTIVITY_ENTRY_LIMIT, DOWNLOAD_STAGING_DIRECTORY_NAME, DOWNLOAD_STAGING_MARKER_NAME, assertDownloadPathSameDevice, createDownloadStagingDirectory, isDownloadStagingDirectorySegment, isManagedDownloadStagingRoot };\n\n//# sourceMappingURL=download-staging.js.map","import { isDownloadStagingDirectorySegment } from \"./download-staging.js\";\n//#region src/sync/prefix.ts\n/**\n* Treats the supplied string as a raw B2 key prefix without adding a folder boundary.\n*\n* B2 keys are byte-oriented names, not local filesystem paths. A backslash in a prefix is a real\n* key character and must not be rewritten to `/`; callers that want slash-delimited prefixes should\n* pass `/` explicitly.\n*\n* @param prefix - User-supplied raw B2 key prefix.\n*\n* @returns Raw B2 key prefix.\n*/\nfunction asRawB2KeyPrefix(prefix) {\n\treturn prefix;\n}\n/**\n* Normalizes a B2 object name into a safe folder-relative sync path.\n*\n* Object names are converted to forward-slash sync paths for local compatibility. Callers that scan\n* B2 must detect normalized-path collisions between distinct raw B2 keys before yielding entries.\n*\n* @param path - B2 object name or prefix-stripped suffix returned by a listing.\n* @param options - Optional normalization behavior for legacy slashless raw prefixes.\n*\n* @returns Folder-relative sync path.\n*\n* @throws When the object name cannot be represented as a safe relative path.\n*/\nfunction normalizeB2RelativePath(path, options = {}) {\n\tconst slashPath = path.split(\"\\\\\").join(\"/\");\n\tconst relativePath = options.stripLeadingSlashes === true ? stripSingleLeadingSlash(slashPath) : slashPath;\n\tconst segments = relativePath.split(\"/\");\n\tif (/^[A-Za-z]:/.test(relativePath) || segments.some((segment) => segmentIsUnsafe(segment))) throw new Error(\"Unsafe B2 file name cannot be used as a sync relative path\");\n\treturn relativePath;\n}\n/**\n* Converts a B2 object key under a configured raw prefix into a sync relative path.\n*\n* @param prefix - Raw B2 key prefix used for the scan or mutation guard.\n* @param fileName - Full B2 object key.\n*\n* @returns The normalized sync relative path for the key suffix.\n*/\nfunction b2KeyToRelativePathUnderPrefix(prefix, fileName) {\n\tconst rawPrefix = asRawB2KeyPrefix(prefix);\n\treturn normalizeB2RelativePath(rawPrefix === \"\" ? fileName : fileName.slice(rawPrefix.length), { stripLeadingSlashes: rawPrefix !== \"\" && !rawPrefix.endsWith(\"/\") });\n}\n/**\n* Returns whether a sync path is unsafe to materialize on Windows-compatible local filesystems.\n* B2-to-B2 syncs can preserve these object names, but B2-to-local syncs skip them before writing.\n*\n* @param relativePath - Folder-relative sync path.\n*\n* @returns True when any segment is Windows-dangerous or ambiguous.\n*/\nfunction localFilesystemSyncPathIsUnsafe(relativePath) {\n\tconst segments = relativePath.split(\"/\");\n\treturn isDownloadStagingDirectorySegment(segments[0]) || segments.some((segment) => segmentIsLocalFilesystemUnsafe(segment));\n}\n/**\n* Produces an approximate Windows/macOS-style canonical key for local collision detection.\n*\n* @param relativePath - Folder-relative sync path.\n*\n* @returns A canonicalized path key for detecting case/Unicode collisions before local writes.\n*/\nfunction localFilesystemCanonicalSyncPath(relativePath) {\n\treturn relativePath.split(\"/\").map((segment) => segment.normalize(\"NFC\").toLocaleLowerCase(\"en-US\")).join(\"/\");\n}\nfunction segmentIsUnsafe(segment) {\n\treturn segment === \"\" || segment === \".\" || segment === \"..\" || containsControlCharacter(segment);\n}\nfunction segmentIsLocalFilesystemUnsafe(segment) {\n\tif (segment.includes(\":\") || segment.endsWith(\".\") || segment.endsWith(\" \")) return true;\n\tconst basename = segment.split(\".\")[0]?.toUpperCase();\n\treturn basename !== void 0 && /^(CON|PRN|AUX|NUL|CONIN\\$|CONOUT\\$|COM[0-9¹²³]|LPT[0-9¹²³])$/u.test(basename);\n}\nfunction containsControlCharacter(segment) {\n\tfor (let index = 0; index < segment.length; index++) {\n\t\tconst code = segment.charCodeAt(index);\n\t\tif (code >= 0 && code <= 31) return true;\n\t}\n\treturn false;\n}\nfunction stripSingleLeadingSlash(path) {\n\treturn path.startsWith(\"/\") ? path.slice(1) : path;\n}\n//#endregion\nexport { asRawB2KeyPrefix, b2KeyToRelativePathUnderPrefix, localFilesystemCanonicalSyncPath, localFilesystemSyncPathIsUnsafe, normalizeB2RelativePath };\n\n//# sourceMappingURL=prefix.js.map","import { toError } from \"../util/to-error.js\";\n//#region src/sync/filesystem-errors.ts\n/**\n* Formats local filesystem errors without including host filesystem paths.\n* @param err - Unknown filesystem error.\n*\n* @returns A path-independent code or error name.\n*/\nfunction localFilesystemErrorReason(err) {\n\tconst error = toError(err);\n\tconst code = cleanFilesystemErrorPart(error.code);\n\tif (code !== \"\") return code;\n\tconst name = cleanFilesystemErrorPart(error.name);\n\tif (name !== \"\") return name;\n\treturn \"Error\";\n}\nfunction cleanFilesystemErrorPart(value) {\n\tif (typeof value !== \"string\") return \"\";\n\tlet cleaned = \"\";\n\tfor (const char of value) {\n\t\tconst code = char.charCodeAt(0);\n\t\tif (code < 32 || code === 127) continue;\n\t\tcleaned += char;\n\t\tif (cleaned.length >= 80) break;\n\t}\n\tconst trimmed = cleaned.trim();\n\treturn /[\\\\/]/.test(trimmed) ? \"\" : trimmed;\n}\n//#endregion\nexport { localFilesystemErrorReason };\n\n//# sourceMappingURL=filesystem-errors.js.map","//#region src/sync/local-filesystem-root.ts\nvar localFilesystemRoots = /* @__PURE__ */ new WeakSet();\n/**\n* Privately marks SDK local folders that are backed by the filesystem.\n* @param folder - Local folder instance to mark.\n*\n* @internal\n*/\nfunction registerLocalFilesystemRoot(folder) {\n\tlocalFilesystemRoots.add(folder);\n}\n/**\n* Returns true for SDK local folders backed by the filesystem.\n* @param folder - Sync folder to inspect.\n*\n* @returns True when the folder was registered as an SDK filesystem root.\n*\n* @internal\n*/\nfunction isLocalFilesystemRoot(folder) {\n\treturn localFilesystemRoots.has(folder);\n}\n//#endregion\nexport { isLocalFilesystemRoot, registerLocalFilesystemRoot };\n\n//# sourceMappingURL=local-filesystem-root.js.map","import { IncrementalSha1 } from \"../streams/hash.js\";\nimport { normalizeSha1TimeoutMillis } from \"./sha1-options.js\";\n//#region src/sync/b2-sha1-reader.ts\nvar MAX_CONSECUTIVE_EMPTY_READ_CHUNKS = 1024;\n/**\n* Reads one non-empty stream chunk with an idle timeout and optional abort signal.\n* Empty chunks are not progress; too many consecutive empty chunks fail with the\n* same stalled-read diagnostic used for pending reads.\n*\n* @param reader - Locked reader to read from.\n* @param timeoutMillis - Idle timeout in milliseconds for this read.\n* @param stalledMessage - Error message used when the read makes no progress.\n* @param signal - Optional abort signal to observe while reading.\n*\n* @returns The next stream read result.\n*\n* @internal\n*/\nasync function readStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal) {\n\tlet emptyChunks = 0;\n\twhile (true) {\n\t\tconst result = await readRawStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal);\n\t\tif (result.done || result.value.byteLength > 0) return result;\n\t\temptyChunks += 1;\n\t\tif (emptyChunks > MAX_CONSECUTIVE_EMPTY_READ_CHUNKS) throw new Error(stalledMessage);\n\t}\n}\nasync function readRawStreamChunkWithTimeout(reader, timeoutMillis, stalledMessage, signal) {\n\tsignal?.throwIfAborted();\n\tlet timeout;\n\tlet removeAbortListener;\n\tconst readPromise = reader.read();\n\tconst timeoutPromise = timeoutMillis === Number.POSITIVE_INFINITY ? void 0 : new Promise((_, reject) => {\n\t\ttimeout = setTimeout(() => {\n\t\t\treject(new Error(stalledMessage));\n\t\t}, timeoutMillis);\n\t});\n\tconst abortPromise = signal === void 0 ? void 0 : new Promise((_, reject) => {\n\t\tconst onAbort = () => reject(signal.reason ?? /* @__PURE__ */ new Error(\"aborted\"));\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tremoveAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n\t});\n\ttry {\n\t\tif (timeoutPromise === void 0 && abortPromise === void 0) return await readPromise;\n\t\tconst candidates = [readPromise];\n\t\tif (timeoutPromise !== void 0) candidates.push(timeoutPromise);\n\t\tif (abortPromise !== void 0) candidates.push(abortPromise);\n\t\treturn await Promise.race(candidates);\n\t} finally {\n\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t\tremoveAbortListener?.();\n\t\treadPromise.catch(() => {});\n\t}\n}\n/**\n* Hashes a B2 response body as SHA-1 with idle timeout, abort, and size checks.\n*\n* @param body - Response body stream to hash.\n* @param signal - Optional abort signal to observe while reading.\n* @param options - Optional timeout and byte-count limits.\n*\n* @returns The computed SHA-1 and number of bytes read.\n*\n* @internal\n*/\nasync function hashReadableStreamSha1(body, signal, options) {\n\tconst hash = new IncrementalSha1();\n\tconst reader = body.getReader();\n\tconst idleTimeoutMillis = options?.idleTimeoutMillis ?? normalizeSha1TimeoutMillis(void 0);\n\tconst maxBytes = options?.maxBytes ?? Number.POSITIVE_INFINITY;\n\tconst expectedBytes = options?.expectedBytes;\n\tlet bytesRead = 0;\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = await readStreamChunkWithTimeout(reader, idleTimeoutMillis, `sha1 B2 read stalled for ${idleTimeoutMillis} ms`, signal);\n\t\t\tif (done) break;\n\t\t\tbytesRead += value.byteLength;\n\t\t\tif (bytesRead > maxBytes) throw new Error(`sha1 B2 read exceeded ${maxBytes} byte verification budget`);\n\t\t\tawait hash.update(value);\n\t\t}\n\t\tif (expectedBytes !== void 0 && bytesRead !== expectedBytes) throw new Error(`sha1 B2 read ended after ${bytesRead} bytes, expected ${expectedBytes}`);\n\t\treturn {\n\t\t\tcontentSha1: await hash.digest(),\n\t\t\tbytesRead\n\t\t};\n\t} catch (err) {\n\t\treader.cancel(err).catch(() => {});\n\t\tthrow err;\n\t} finally {\n\t\treader.releaseLock();\n\t}\n}\n/**\n* Applies an absolute verification deadline while forwarding parent aborts.\n*\n* @param signal - Optional parent abort signal.\n* @param timeoutMillis - Absolute deadline in milliseconds.\n* @param run - Operation to run with the derived deadline signal.\n*\n* @returns The operation result.\n*\n* @internal\n*/\nasync function withSha1VerificationDeadline(signal, timeoutMillis, run) {\n\tconst controller = new AbortController();\n\tconst abortFromParent = () => controller.abort(signal?.reason);\n\tif (signal?.aborted) abortFromParent();\n\tsignal?.addEventListener(\"abort\", abortFromParent, { once: true });\n\tlet timeout;\n\tconst timeoutPromise = new Promise((_, reject) => {\n\t\ttimeout = setTimeout(() => {\n\t\t\tconst error = /* @__PURE__ */ new Error(`sha1 B2 verification exceeded ${timeoutMillis} ms`);\n\t\t\tcontroller.abort(error);\n\t\t\treject(error);\n\t\t}, timeoutMillis);\n\t});\n\tconst runPromise = run(controller.signal);\n\ttry {\n\t\treturn await Promise.race([runPromise, timeoutPromise]);\n\t} finally {\n\t\tif (timeout !== void 0) clearTimeout(timeout);\n\t\tsignal?.removeEventListener(\"abort\", abortFromParent);\n\t\trunPromise.catch(() => {});\n\t}\n}\n/**\n* Bounds B2 SHA-1 verification downloads to the selected object's size and optional ceiling.\n*\n* @param contentLength - Selected B2 object byte length.\n* @param ceiling - Optional lower verification budget.\n*\n* @returns The byte budget to enforce.\n*\n* @internal\n*/\nfunction normalizeSha1VerificationMaxBytes(contentLength, ceiling) {\n\tconst contentBudget = Math.max(0, Math.floor(contentLength));\n\tif (ceiling === void 0) return contentBudget;\n\tif (!Number.isFinite(ceiling) || ceiling < 0) return contentBudget;\n\treturn Math.min(contentBudget, Math.floor(ceiling));\n}\n//#endregion\nexport { hashReadableStreamSha1, normalizeSha1VerificationMaxBytes, readStreamChunkWithTimeout, withSha1VerificationDeadline };\n\n//# sourceMappingURL=b2-sha1-reader.js.map","import { sanitizeErrorReason } from \"../util/error-reason.js\";\nimport { assertSameScannedRegularFile } from \"./local-file-identity.js\";\nimport { assertPathInsideRoot, hasErrorCode, makeReservedSyncTempFileName, noFollowFlag, safeRelativePathSegments } from \"./path-safety.js\";\nimport { DOWNLOAD_STAGING_DIRECTORY_NAME, assertDownloadPathSameDevice, createDownloadStagingDirectory, isDownloadStagingDirectorySegment } from \"./download-staging.js\";\nimport { readStreamChunkWithTimeout } from \"./b2-sha1-reader.js\";\n//#region src/sync/local-file-io.ts\n/** @internal */\nvar localFileIoTestHooks = {};\n/**\n* Verifies that a previously scanned local file still points at the same regular file.\n*\n* @param path - Scanned local path and file identity.\n*\n* @internal\n*/\nasync function validateScannedLocalFile(path) {\n\tawait (await openValidatedScannedLocalFile(path)).close();\n}\nasync function openValidatedScannedLocalFile(path) {\n\tconst { constants } = await import(\"node:fs\");\n\tconst { open } = await import(\"node:fs/promises\");\n\tconst flags = constants.O_RDONLY | noFollowFlag(constants) | (constants.O_NONBLOCK ?? 0);\n\tconst handle = await open(path.absolutePath, flags).catch((err) => {\n\t\tif (hasErrorCode(err, \"ELOOP\")) throw new Error(\"local file changed before upload: not a regular file\");\n\t\tthrow new Error(`local file changed before upload: could not open scanned file: ${sanitizeErrorReason(err)}`);\n\t});\n\ttry {\n\t\tassertSameScannedRegularFile(await handle.stat(), path, \"upload\", { platform: localFileIoTestHooks.platform });\n\t\treturn handle;\n\t} catch (err) {\n\t\tawait handle.close().catch(() => {});\n\t\tthrow err;\n\t}\n}\n/**\n* Streams a B2 download under a local sync root with path, timeout, and size checks.\n*\n* @param root - Local sync root.\n* @param relPath - Destination path relative to the root.\n* @param body - Download body stream.\n* @param options - Expected byte count, idle timeout, and optional abort signal.\n*\n* @internal\n*/\nasync function writeLocalStreamInsideRoot(root, relPath, body, options) {\n\tconst { constants } = await import(\"node:fs\");\n\tconst { link, lstat, mkdir, open, realpath, rename, rm, stat } = await import(\"node:fs/promises\");\n\tconst path = await import(\"node:path\");\n\tconst { randomUUID } = await import(\"node:crypto\");\n\tassertValidExpectedBytes(options.expectedBytes);\n\tconst segments = safeRelativePathSegments(relPath);\n\tif (isDownloadStagingDirectorySegment(segments[0])) throw new Error(`unsafe local destination path: ${DOWNLOAD_STAGING_DIRECTORY_NAME} is reserved for SDK download staging`);\n\tconst rootRealPath = await realpath(root);\n\tlet current = rootRealPath;\n\tfor (const segment of segments.slice(0, -1)) {\n\t\tcurrent = path.join(current, segment);\n\t\ttry {\n\t\t\tawait mkdir(current);\n\t\t} catch (err) {\n\t\t\tif (!hasErrorCode(err, \"EEXIST\")) throw err;\n\t\t}\n\t\tif (!(await lstat(current)).isDirectory()) throw new Error(\"unsafe local destination path: parent is not a directory\");\n\t\tawait localFileIoTestHooks.afterParentDirectoryValidated?.(current);\n\t}\n\tconst destPath = path.join(rootRealPath, ...segments);\n\tassertPathInsideRoot(rootRealPath, destPath, path);\n\tconst parentRealPath = await realpath(path.dirname(destPath));\n\tconst finalPath = path.join(parentRealPath, path.basename(destPath));\n\tassertPathInsideRoot(rootRealPath, finalPath, path);\n\ttry {\n\t\tconst targetStats = await lstat(finalPath);\n\t\tif (targetStats.isSymbolicLink()) throw new Error(\"unsafe local destination path: target is a symbolic link\");\n\t\tif (targetStats.isFile() && targetStats.nlink > 1) throw new Error(\"unsafe local destination path: target has multiple hard links\");\n\t} catch (err) {\n\t\tif (!hasErrorCode(err, \"ENOENT\")) throw err;\n\t}\n\tconst statForDeviceCheck = localFileIoTestHooks.statForDeviceCheck ?? stat;\n\tawait assertDownloadPathSameDevice(rootRealPath, parentRealPath, statForDeviceCheck, \"unsafe local destination path: cannot publish download across filesystems\");\n\tlet parentHandle;\n\tlet anchoredParentPath;\n\t/* v8 ignore start -- Linux-only fd-relative path support is covered by Linux CI */\n\tif (globalThis.process?.platform === \"linux\" && constants.O_DIRECTORY !== void 0 && localFileIoTestHooks.disableProcFdAnchoring !== true) try {\n\t\tparentHandle = await open(parentRealPath, constants.O_RDONLY | constants.O_DIRECTORY | noFollowFlag(constants));\n\t\tanchoredParentPath = `/proc/self/fd/${parentHandle.fd}`;\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"ELOOP\") || hasErrorCode(err, \"ENOTDIR\")) throw new Error(\"unsafe local destination path: parent is not a directory\");\n\t\tthrow err;\n\t}\n\t/* v8 ignore stop */\n\tconst finalName = path.basename(destPath);\n\tconst finalWritePath = path.join(anchoredParentPath ?? parentRealPath, finalName);\n\tlet publishMode;\n\ttry {\n\t\tpublishMode = await replacementFileMode(finalPath);\n\t} catch (err) {\n\t\t/* v8 ignore next -- best-effort close during setup failure */\n\t\tawait parentHandle?.close().catch(() => {});\n\t\tthrow err;\n\t}\n\tlet stagingDirectory;\n\ttry {\n\t\tstagingDirectory = await createDownloadStagingDirectory(rootRealPath, path, randomUUID, statForDeviceCheck, localFileIoTestHooks.beforeStagingMarkerWrite);\n\t} catch (err) {\n\t\t/* v8 ignore next -- best-effort close during setup failure */\n\t\tawait parentHandle?.close().catch(() => {});\n\t\tthrow err;\n\t}\n\tconst tmpPath = path.join(stagingDirectory, `.b2sdk-${randomUUID()}.partial`);\n\tlet handle;\n\ttry {\n\t\thandle = await open(tmpPath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | noFollowFlag(constants), PRIVATE_DOWNLOAD_FILE_MODE);\n\t\t/* v8 ignore next -- best-effort chmod */\n\t\tawait handle.chmod(PRIVATE_DOWNLOAD_FILE_MODE).catch(() => {});\n\t\tawait localFileIoTestHooks.afterTempFileCreated?.(tmpPath, stagingDirectory);\n\t} catch (err) {\n\t\tawait parentHandle?.close().catch(() => {});\n\t\tawait rm(stagingDirectory, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t}).catch(() => {});\n\t\tthrow err;\n\t}\n\t/* v8 ignore stop */\n\ttry {\n\t\tconst tmpRealPath = await realpath(tmpPath);\n\t\tassertPathInsideRoot(stagingDirectory, tmpRealPath, path);\n\t} catch (err) {\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait handle?.close().catch(() => {});\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait rm(tmpPath, { force: true }).catch(() => {});\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait rm(stagingDirectory, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t}).catch(() => {});\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait parentHandle?.close().catch(() => {});\n\t\tthrow err;\n\t}\n\tconst writeHandle = handle;\n\tconst reader = body.getReader();\n\tlet completed = false;\n\ttry {\n\t\tlet bytesWritten = 0;\n\t\twhile (true) {\n\t\t\tconst { done, value } = await readStreamChunkWithTimeout(reader, options.idleTimeoutMillis, `download read stalled for ${options.idleTimeoutMillis} ms`, options.signal);\n\t\t\tif (done) break;\n\t\t\tif (bytesWritten + value.byteLength > options.expectedBytes) throw new Error(`download read exceeded ${options.expectedBytes} byte limit`);\n\t\t\tawait writeAll(writeHandle, value, bytesWritten);\n\t\t\tbytesWritten += value.byteLength;\n\t\t}\n\t\tif (bytesWritten !== options.expectedBytes) throw new Error(`download read ended after ${bytesWritten} bytes, expected ${options.expectedBytes}`);\n\t\tif (publishMode !== PRIVATE_DOWNLOAD_FILE_MODE)\n /* v8 ignore next -- best-effort mode preservation */\n\t\tawait writeHandle.chmod(publishMode).catch(() => {});\n\t\tawait writeHandle.close();\n\t\thandle = void 0;\n\t\tconst [parentRealPathBeforeRename, parentStatsBeforeRename] = await Promise.all([realpath(path.dirname(destPath)), stat(path.dirname(destPath))]);\n\t\tassertPathInsideRoot(rootRealPath, path.join(parentRealPathBeforeRename, path.basename(destPath)), path);\n\t\tawait localFileIoTestHooks.beforeFinalRename?.(parentRealPathBeforeRename);\n\t\tlet publishPath = finalWritePath;\n\t\tif (anchoredParentPath === void 0) {\n\t\t\tconst [parentRealPathAfterHook, parentStatsAfterHook] = await Promise.all([realpath(path.dirname(destPath)), stat(path.dirname(destPath))]);\n\t\t\tif (parentRealPathAfterHook !== parentRealPathBeforeRename || !sameParentIdentity(parentStatsAfterHook, parentStatsBeforeRename)) throw new Error(\"unsafe local destination path: parent changed before final publish\");\n\t\t\tpublishPath = path.join(parentRealPathAfterHook, path.basename(destPath));\n\t\t\tassertPathInsideRoot(rootRealPath, publishPath, path);\n\t\t}\n\t\tawait publishDownload(lstat, link, path, randomUUID, rename, rm, tmpPath, publishPath, options.expectedDestination);\n\t\tcompleted = true;\n\t} catch (err) {\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\treader.cancel(err).catch(() => {});\n\t\tthrow err;\n\t} finally {\n\t\treader.releaseLock();\n\t\tif (!completed) {\n\t\t\t/* v8 ignore next -- best-effort cleanup */\n\t\t\tawait handle?.close().catch(() => {});\n\t\t\t/* v8 ignore next -- best-effort cleanup */\n\t\t\tawait rm(tmpPath, { force: true }).catch(() => {});\n\t\t}\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait rm(stagingDirectory, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t}).catch(() => {});\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait parentHandle?.close().catch(() => {});\n\t}\n}\nfunction assertValidExpectedBytes(expectedBytes) {\n\tif (!Number.isSafeInteger(expectedBytes) || expectedBytes < 0) throw new Error(\"download expectedBytes must be a non-negative safe integer\");\n}\nasync function assertExpectedDownloadDestination(lstat, finalPath, expectedDestination) {\n\tif (expectedDestination === void 0) return;\n\ttry {\n\t\tconst stats = await lstat(finalPath);\n\t\tif (expectedDestination === null) throw new Error(\"local destination changed before download: file was created\");\n\t\tassertSameScannedRegularFile(stats, {\n\t\t\t...expectedDestination,\n\t\t\tabsolutePath: finalPath\n\t\t}, \"download\", { platform: localFileIoTestHooks.platform });\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"ENOENT\")) {\n\t\t\tif (expectedDestination === null) return;\n\t\t\tthrow new Error(\"local file changed before download: file missing\");\n\t\t}\n\t\tthrow err;\n\t}\n}\nasync function publishDownload(lstat, link, path, randomUUID, rename, rm, tmpPath, publishPath, expectedDestination) {\n\tawait assertExpectedDownloadDestination(lstat, publishPath, expectedDestination);\n\tawait localFileIoTestHooks.beforeDownloadPublish?.(publishPath);\n\tif (expectedDestination === void 0) {\n\t\tawait rename(tmpPath, publishPath);\n\t\treturn;\n\t}\n\tif (expectedDestination === null) {\n\t\tawait linkDownloadNoOverwrite(link, tmpPath, publishPath, \"local destination changed before download: file was created\");\n\t\t/* v8 ignore next -- staging cleanup is best-effort after a guarded publish succeeds. */\n\t\tawait rm(tmpPath, { force: true }).catch(() => {});\n\t\treturn;\n\t}\n\tconst backupPath = path.join(path.dirname(publishPath), makeReservedSyncTempFileName(path.basename(publishPath), randomUUID()));\n\tlet backupExists = false;\n\tlet removeBackup = false;\n\ttry {\n\t\ttry {\n\t\t\tawait rename(publishPath, backupPath);\n\t\t\tbackupExists = true;\n\t\t\tawait localFileIoTestHooks.afterDownloadBackupRename?.(backupPath);\n\t\t} catch (err) {\n\t\t\tif (hasErrorCode(err, \"ENOENT\")) throw new Error(\"local file changed before download: file missing\");\n\t\t\tthrow err;\n\t\t}\n\t\tassertSameScannedRegularFile(await lstat(backupPath), {\n\t\t\t...expectedDestination,\n\t\t\tabsolutePath: backupPath\n\t\t}, \"download\", {\n\t\t\tcompareChangeTime: false,\n\t\t\tplatform: localFileIoTestHooks.platform\n\t\t});\n\t\tawait linkDownloadNoOverwrite(link, tmpPath, publishPath, \"local destination changed before download: file was created\");\n\t\tremoveBackup = true;\n\t\t/* v8 ignore next -- staging cleanup is best-effort after a guarded publish succeeds. */\n\t\tawait rm(tmpPath, { force: true }).catch(() => {});\n\t} catch (err) {\n\t\tif (backupExists && !removeBackup) await restoreBackupWithoutOverwrite(link, rm, backupPath, publishPath).catch(() => {});\n\t\tthrow err;\n\t} finally {\n\t\tif (removeBackup)\n /* v8 ignore next -- old destination cleanup is best-effort after publish succeeds. */\n\t\tawait rm(backupPath, { force: true }).catch(() => {});\n\t}\n}\nasync function linkDownloadNoOverwrite(link, sourcePath, destPath, message) {\n\ttry {\n\t\tawait link(sourcePath, destPath);\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"EEXIST\")) throw new Error(message);\n\t\tthrow err;\n\t}\n}\nasync function restoreBackupWithoutOverwrite(link, rm, backupPath, publishPath) {\n\ttry {\n\t\tawait link(backupPath, publishPath);\n\t\tawait rm(backupPath, { force: true });\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"EEXIST\")) return;\n\t\tthrow err;\n\t}\n}\nvar PRIVATE_DOWNLOAD_FILE_MODE = 384;\nasync function replacementFileMode(filePath) {\n\tconst { lstat } = await import(\"node:fs/promises\");\n\ttry {\n\t\tconst stats = await lstat(filePath);\n\t\treturn stats.isFile() ? stats.mode & 511 : PRIVATE_DOWNLOAD_FILE_MODE;\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"ENOENT\")) return PRIVATE_DOWNLOAD_FILE_MODE;\n\t\tthrow err;\n\t}\n}\n/**\n* Deletes a scanned local file under a sync root without re-resolving attacker-controlled parents.\n*\n* @param root - Local sync root.\n* @param scannedPath - Previously scanned local file metadata.\n*\n* @internal\n*/\nasync function deleteLocalFileInsideRoot(root, scannedPath) {\n\tif (root === \"\") throw new Error(\"Local sync root required for filesystem mutation\");\n\tconst { constants } = await import(\"node:fs\");\n\tconst { lstat, open, realpath, stat, unlink } = await import(\"node:fs/promises\");\n\tconst path = await import(\"node:path\");\n\tconst segments = safeRelativePathSegments(scannedPath.relativePath);\n\tconst safeRoot = path.resolve(root);\n\tconst rootStats = await lstat(safeRoot);\n\tif (rootStats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${scannedPath.relativePath}`);\n\tif (!rootStats.isDirectory()) throw new Error(`Local sync root is not a directory: ${scannedPath.relativePath}`);\n\tconst rootRealPath = await realpath(safeRoot);\n\tconst expectedPath = path.join(rootRealPath, ...segments);\n\tassertPathInsideRoot(rootRealPath, expectedPath, path);\n\tif (path.resolve(scannedPath.absolutePath) !== expectedPath) throw new Error(`Refusing to delete outside sync root: ${scannedPath.relativePath}`);\n\tconst [parentRealPath, parentStats] = await Promise.all([realpath(path.dirname(expectedPath)), stat(path.dirname(expectedPath))]);\n\tconst finalPath = path.join(parentRealPath, path.basename(expectedPath));\n\tassertPathInsideRoot(rootRealPath, finalPath, path);\n\tconst platform = globalThis.process?.platform;\n\tlet parentHandle;\n\tlet anchoredParentPath;\n\t/* v8 ignore start -- Linux-only fd-relative path support is covered by Linux CI */\n\tif (platform === \"linux\" && constants.O_DIRECTORY !== void 0 && localFileIoTestHooks.disableProcFdAnchoring !== true) try {\n\t\tawait localFileIoTestHooks.beforeLocalDeleteOpenParent?.(parentRealPath);\n\t\tparentHandle = await open(parentRealPath, constants.O_RDONLY | constants.O_DIRECTORY | noFollowFlag(constants));\n\t\tanchoredParentPath = `/proc/self/fd/${parentHandle.fd}`;\n\t} catch (err) {\n\t\tif (hasErrorCode(err, \"ELOOP\") || hasErrorCode(err, \"ENOTDIR\")) throw new Error(\"unsafe local delete path: parent is not a directory\");\n\t\tthrow err;\n\t}\n\t/* v8 ignore stop */\n\ttry {\n\t\tconst unlinkPath = anchoredParentPath === void 0 ? finalPath : path.join(anchoredParentPath, path.basename(expectedPath));\n\t\tassertSameScannedRegularFile(await lstat(unlinkPath), {\n\t\t\t...scannedPath,\n\t\t\tabsolutePath: unlinkPath\n\t\t}, \"delete\", { platform: localFileIoTestHooks.platform });\n\t\tawait localFileIoTestHooks.beforeLocalDeleteUnlink?.(parentRealPath);\n\t\tif (anchoredParentPath === void 0 && localFileIoTestHooks.disableProcFdAnchoring === true && parentRealPath !== rootRealPath) throw new Error(\"unsafe local delete path: stable parent handle unavailable for unlink\");\n\t\tif (anchoredParentPath === void 0) {\n\t\t\tconst [parentRealPathBeforeUnlink, parentStatsBeforeUnlink] = await Promise.all([realpath(path.dirname(expectedPath)), stat(path.dirname(expectedPath))]);\n\t\t\tif (parentRealPathBeforeUnlink !== parentRealPath || !sameParentIdentity(parentStatsBeforeUnlink, parentStats)) throw new Error(\"unsafe local delete path: parent changed before unlink\");\n\t\t}\n\t\tassertSameScannedRegularFile(await lstat(unlinkPath), {\n\t\t\t...scannedPath,\n\t\t\tabsolutePath: unlinkPath\n\t\t}, \"delete\", { platform: localFileIoTestHooks.platform });\n\t\tawait unlink(unlinkPath);\n\t} finally {\n\t\t/* v8 ignore next -- best-effort cleanup */\n\t\tawait parentHandle?.close().catch(() => {});\n\t}\n}\nfunction sameParentIdentity(current, expected) {\n\treturn current.dev === expected.dev && current.ino === expected.ino;\n}\nasync function writeAll(handle, data, position) {\n\tlet offset = 0;\n\twhile (offset < data.byteLength) {\n\t\tconst { bytesWritten } = await handle.write(data, offset, data.byteLength - offset, position + offset);\n\t\t/* v8 ignore next -- defensive: FileHandle.write should progress for non-empty chunks. */\n\t\tif (bytesWritten <= 0) throw new Error(\"download write made no progress\");\n\t\toffset += bytesWritten;\n\t}\n}\n//#endregion\nexport { DOWNLOAD_STAGING_DIRECTORY_NAME, deleteLocalFileInsideRoot, localFileIoTestHooks, validateScannedLocalFile, writeLocalStreamInsideRoot };\n\n//# sourceMappingURL=local-file-io.js.map","import { fileId } from \"../types/ids.js\";\nimport { FileSource } from \"../streams/file-source.js\";\nimport { CopyAction, DeleteLocalAction, DeleteRemoteAction, DownloadAction, HideAction, SkipAction, UploadAction } from \"./actions/index.js\";\nimport { zipFolders } from \"./pairing.js\";\nimport { sanitizeErrorReason } from \"../util/error-reason.js\";\nimport { DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS, normalizeSha1TimeoutMillis } from \"./sha1-options.js\";\nimport { readLocalSha1File } from \"./local-sha1.js\";\nimport { assertSupportedCompareMode, preparePairsForCompare, readyComparePair } from \"./policies/compare.js\";\nimport { generateActions } from \"./policies/index.js\";\nimport { safeRelativePathSegments } from \"./path-safety.js\";\nimport { asRawB2KeyPrefix, b2KeyToRelativePathUnderPrefix } from \"./prefix.js\";\nimport { localFilesystemErrorReason } from \"./filesystem-errors.js\";\nimport { isLocalFilesystemRoot } from \"./local-filesystem-root.js\";\nimport { hashReadableStreamSha1, normalizeSha1VerificationMaxBytes, withSha1VerificationDeadline } from \"./b2-sha1-reader.js\";\nimport { deleteLocalFileInsideRoot, validateScannedLocalFile, writeLocalStreamInsideRoot } from \"./local-file-io.js\";\n//#region src/sync/synchronizer.ts\nvar MAX_BUFFERED_SCAN_EVENTS = 100;\nvar MAX_AGGREGATE_FAILED_PATHS = 100;\nvar DEFAULT_DOWNLOAD_IDLE_TIMEOUT_MILLIS = 6e4;\n/**\n* Test hooks for bounded planning behavior.\n*\n* @internal\n*/\nvar synchronizerTestHooks = {};\n/**\n* Infers the sync direction from the source and destination folder types.\n* @param source - The folder to read files from.\n* @param dest - The folder to write files to.\n*\n* @returns The resolved sync direction based on folder types.\n*\n* @throws When the source and destination folder types form an unsupported combination.\n*/\nfunction resolveDirection(source, dest) {\n\tif (source.type === \"local\" && dest.type === \"b2\") return \"local-to-b2\";\n\tif (source.type === \"b2\" && dest.type === \"local\") return \"b2-to-local\";\n\tif (source.type === \"b2\" && dest.type === \"b2\") return \"b2-to-b2\";\n\tthrow new Error(`Unsupported sync direction: ${source.type} to ${dest.type}`);\n}\nasync function* synchronize(config) {\n\tconst { source, dest, options } = config;\n\tassertSupportedCompareMode(options.compareMode);\n\tconst direction = resolveDirection(source, dest);\n\tconst dryRun = options.dryRun ?? false;\n\tconst concurrency = normalizeSyncConcurrency(options.concurrency);\n\tconst keepDays = options.keepDays ?? 0;\n\tconst compareThreshold = options.compareThreshold ?? 0;\n\tconst nowMillis = Date.now();\n\tconst localRootContexts = await resolveLocalRootContexts(config);\n\tconst queuedEvents = [];\n\tconst failedPaths = [];\n\tconst failedPathSet = /* @__PURE__ */ new Set();\n\tlet errorCount = 0;\n\tlet failedPathOmittedCount = 0;\n\tlet scanHadError = false;\n\tconst runningActions = /* @__PURE__ */ new Set();\n\tconst scanEvents = {\n\t\tevents: [],\n\t\tdropped: 0\n\t};\n\tconst scanOptions = {\n\t\t...options.include !== void 0 ? { include: options.include } : {},\n\t\t...options.exclude !== void 0 ? { exclude: options.exclude } : {},\n\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t...options.maxScanEntries !== void 0 ? { maxScanEntries: options.maxScanEntries } : {},\n\t\t...direction === \"b2-to-local\" ? { requireLocalSafePaths: true } : {},\n\t\tonError: (event) => {\n\t\t\tscanHadError = true;\n\t\t\trecordSyncError(event);\n\t\t\tqueueEvent(event);\n\t\t}\n\t};\n\tconst factory = createActionFactory(config, localRootContexts);\n\tconst readB2Sha1 = dryRun ? void 0 : createB2Sha1Reader(config);\n\tconst actionAbortController = new AbortController();\n\tconst removeAbortForwarder = forwardAbortSignal(options.signal, actionAbortController);\n\tlet completed = false;\n\tasync function* finishAfterAbort() {\n\t\tawait drainActions();\n\t\tyield* emitQueuedEvents();\n\t}\n\ttry {\n\t\tlet pairs;\n\t\ttry {\n\t\t\tpairs = await collectPairs();\n\t\t} catch (err) {\n\t\t\tawait drainActions();\n\t\t\tif (options.signal?.aborted) {\n\t\t\t\tyield* finishAfterAbort();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!scanHadError) {\n\t\t\t\tyield* emitQueuedEvents();\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tyield* emitQueuedEvents();\n\t\t\tyield aggregateErrorEvent();\n\t\t\tcompleted = true;\n\t\t\treturn;\n\t\t}\n\t\tyield* emitQueuedEvents();\n\t\tconst filesystemError = scanFilesystemError(scanEvents);\n\t\tif (filesystemError !== void 0) throw filesystemError;\n\t\tif (options.signal?.aborted) {\n\t\t\tyield* finishAfterAbort();\n\t\t\treturn;\n\t\t}\n\t\tif (scanHadError) {\n\t\t\tif (errorCount > 0) yield aggregateErrorEvent();\n\t\t\tcompleted = true;\n\t\t\treturn;\n\t\t}\n\t\tif (options.compareMode === \"sha1\") {\n\t\t\tconst compareBatchSize = concurrency;\n\t\t\tfor (let index = 0; index < pairs.length; index += compareBatchSize) if (yield* emitSha1Batch(pairs.slice(index, index + compareBatchSize))) return;\n\t\t} else for (let index = 0; index < pairs.length; index += concurrency) {\n\t\t\tconst items = pairs.slice(index, index + concurrency).map((pair) => planPreparedPair(pair, readyComparePair(pair)));\n\t\t\tsynchronizerTestHooks.afterNonSha1PlanBatch?.(items.length);\n\t\t\tif (yield* emitPreparedItems(items)) return;\n\t\t}\n\t\tawait drainActions();\n\t\tyield* emitQueuedEvents();\n\t\tif (errorCount > 0) yield aggregateErrorEvent();\n\t\tcompleted = true;\n\t} finally {\n\t\tif (!completed) abortActionController(actionAbortController, new DOMException(\"Sync iterator closed\", \"AbortError\"));\n\t\tremoveAbortForwarder();\n\t\tawait drainActions();\n\t}\n\tasync function collectPairs() {\n\t\tconst pairs = [];\n\t\tfor await (const pair of zipFolders(source, dest, scanOptions, {\n\t\t\tonSourceSkip(event) {\n\t\t\t\tbufferScanEvent(scanEvents, event, direction, \"source\");\n\t\t\t},\n\t\t\tonDestSkip(event) {\n\t\t\t\tbufferScanEvent(scanEvents, event, direction, \"dest\");\n\t\t\t}\n\t\t})) {\n\t\t\tif (options.signal?.aborted) return pairs;\n\t\t\tvalidateB2SourcePairPrefix(pair, config);\n\t\t\tpairs.push(pair);\n\t\t}\n\t\treturn pairs;\n\t}\n\tasync function* emitSha1Batch(batch) {\n\t\tif (batch.length === 0) return false;\n\t\tawait drainActions();\n\t\tyield* emitQueuedEvents();\n\t\tconst preparedBatch = await processPreparedBatch(batch);\n\t\tif (yield* emitPreparedItems(preparedBatch.items)) return true;\n\t\tif (preparedBatch.aborted || options.signal?.aborted) {\n\t\t\tyield* finishAfterAbort();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tasync function* emitPreparedItems(items) {\n\t\tfor (const item of items) {\n\t\t\tyield* emitQueuedEvents();\n\t\t\tyield item.event;\n\t\t\tyield* emitQueuedEvents();\n\t\t\t/* v8 ignore next -- abort between compare yield and scheduling is timing-dependent */\n\t\t\tif (options.signal?.aborted) {\n\t\t\t\tyield* finishAfterAbort();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tfor (const action of item.actions) {\n\t\t\t\tawait scheduleAction(action);\n\t\t\t\tyield* emitQueuedEvents();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tasync function processPreparedBatch(batch) {\n\t\tif (batch.length === 0) return {\n\t\t\titems: [],\n\t\t\taborted: false\n\t\t};\n\t\tconst preparedPairs = await preparePairsForCompare(batch, \"sha1\", {\n\t\t\tconcurrency,\n\t\t\t...options.signal !== void 0 ? { signal: options.signal } : {},\n\t\t\t...options.sha1ReadTimeoutMillis !== void 0 ? { sha1ReadTimeoutMillis: options.sha1ReadTimeoutMillis } : {},\n\t\t\treadLocalSha1: readLocalSha1File,\n\t\t\t...readB2Sha1 !== void 0 ? { readB2Sha1 } : {}\n\t\t});\n\t\tconst items = [];\n\t\tfor (const { originalPair, prepared } of preparedPairs) {\n\t\t\tif (prepared.aborted || options.signal?.aborted) return {\n\t\t\t\titems,\n\t\t\t\taborted: true\n\t\t\t};\n\t\t\titems.push(planPreparedPair(originalPair, prepared));\n\t\t}\n\t\treturn {\n\t\t\titems,\n\t\t\taborted: false\n\t\t};\n\t}\n\tfunction planPreparedPair(pair, prepared) {\n\t\tconst event = {\n\t\t\ttype: \"compare\",\n\t\t\tpath: (pair[0] ?? pair[1])?.relativePath ?? \"\",\n\t\t\tsize: 0,\n\t\t\tbytesHashed: prepared.bytesHashed,\n\t\t\t...prepared.bytesVerified > 0 ? { bytesVerified: prepared.bytesVerified } : {}\n\t\t};\n\t\tlet preparedErrorEventCount = 0;\n\t\tfor (const preparedEvent of prepared.events) {\n\t\t\tqueueEvent(preparedEvent);\n\t\t\tif (preparedEvent.type === \"error\") {\n\t\t\t\tpreparedErrorEventCount++;\n\t\t\t\trecordFailurePath(preparedEvent.path);\n\t\t\t}\n\t\t}\n\t\terrorCount += prepared.errors.length;\n\t\tfor (let index = preparedErrorEventCount; index < prepared.errors.length; index++) recordFailurePath(event.path);\n\t\tif (prepared.skipActionGeneration) return {\n\t\t\tevent,\n\t\t\tactions: []\n\t\t};\n\t\tif ((scanHadError || scanHadFilesystemError(scanEvents)) && prepared.pair[0] === null && prepared.pair[1] !== null) return {\n\t\t\tevent,\n\t\t\tactions: [new SkipAction(prepared.pair[1].relativePath, \"not removed because scan errors occurred\")]\n\t\t};\n\t\tif (sourceInventoryIncomplete(scanEvents) && prepared.pair[0] === null && prepared.pair[1] !== null) return {\n\t\t\tevent,\n\t\t\tactions: [new SkipAction(prepared.pair[1].relativePath, scanEvents.sourceInventoryIncompleteMessage ?? \"not removed because the source scan skipped unsafe B2 names\")]\n\t\t};\n\t\treturn {\n\t\t\tevent,\n\t\t\tactions: [...generateActions(prepared.pair, direction, options.compareMode, options.keepMode, keepDays, nowMillis, factory, compareThreshold)]\n\t\t};\n\t}\n\tasync function scheduleAction(action) {\n\t\tconst task = executeAction(action).finally(() => {\n\t\t\trunningActions.delete(task);\n\t\t});\n\t\trunningActions.add(task);\n\t\tif (runningActions.size >= concurrency) await Promise.race(runningActions);\n\t}\n\tasync function executeAction(action) {\n\t\ttry {\n\t\t\tif (actionAbortController.signal.aborted) return;\n\t\t\tqueueEvent(await action.execute(dryRun, actionAbortController.signal));\n\t\t} catch (err) {\n\t\t\tconst event = {\n\t\t\t\ttype: \"error\",\n\t\t\t\tpath: action.relativePath,\n\t\t\t\tsize: 0,\n\t\t\t\tmessage: sanitizeErrorReason(err)\n\t\t\t};\n\t\t\trecordSyncError(event);\n\t\t\tqueueEvent(event);\n\t\t}\n\t}\n\tfunction recordSyncError(event) {\n\t\terrorCount += 1;\n\t\trecordFailurePath(event.path);\n\t}\n\tfunction recordFailurePath(path) {\n\t\tif (path === \"\") return;\n\t\tif (failedPathSet.has(path)) return;\n\t\tfailedPathSet.add(path);\n\t\tif (failedPaths.length < MAX_AGGREGATE_FAILED_PATHS) failedPaths.push(path);\n\t\telse failedPathOmittedCount++;\n\t}\n\tfunction aggregateErrorEvent() {\n\t\treturn {\n\t\t\ttype: \"error\",\n\t\t\tpath: \"\",\n\t\t\tsize: 0,\n\t\t\tmessage: `${errorCount} sync error(s) occurred`,\n\t\t\tfailureCount: errorCount,\n\t\t\tfailedPaths: [...failedPaths],\n\t\t\t...failedPathOmittedCount > 0 ? { failedPathOmittedCount } : {}\n\t\t};\n\t}\n\tfunction queueEvent(event) {\n\t\tqueuedEvents.push(event);\n\t}\n\tasync function* emitQueuedEvents() {\n\t\tyield* drainScanEvents(scanEvents);\n\t\tfor (const event of queuedEvents.splice(0)) yield event;\n\t}\n\tasync function drainActions() {\n\t\twhile (runningActions.size > 0) await Promise.race(runningActions);\n\t}\n}\n/**\n* Normalizes user-provided sync concurrency before it controls compare batches and transfers.\n*\n* @param value - Optional concurrency value from sync options.\n*\n* @returns A positive integer concurrency value.\n*\n* @throws When the configured concurrency is not a positive integer.\n*/\nfunction normalizeSyncConcurrency(value) {\n\tconst candidate = value ?? 4;\n\tif (!Number.isInteger(candidate) || candidate < 1) throw new RangeError(\"Sync concurrency must be a positive integer\");\n\treturn candidate;\n}\nfunction normalizeDownloadIdleTimeoutMillis(value) {\n\tif (value === void 0) return DEFAULT_DOWNLOAD_IDLE_TIMEOUT_MILLIS;\n\tif (value === Number.POSITIVE_INFINITY) return value;\n\tif (!Number.isFinite(value) || value < 1) throw new RangeError(\"downloadIdleTimeoutMillis must be a positive finite number or Infinity\");\n\treturn Math.floor(value);\n}\nfunction assertValidB2ContentLength(contentLength) {\n\tif (!Number.isSafeInteger(contentLength) || contentLength < 0) throw new Error(\"B2 contentLength must be a non-negative safe integer\");\n\treturn contentLength;\n}\nfunction createB2Sha1Reader(config) {\n\tconst upConfig = config;\n\tconst downConfig = config;\n\tconst bucket = upConfig.bucket ?? downConfig.bucket;\n\tif (bucket === void 0) return void 0;\n\tconst readablePrefixes = b2ReadableRawPrefixes(config);\n\tconst idleTimeoutMillis = normalizeSha1TimeoutMillis(config.options.sha1ReadTimeoutMillis);\n\tconst verificationTimeoutMillis = normalizeSha1TimeoutMillis(config.options.sha1VerificationTimeoutMillis, DEFAULT_SHA1_VERIFICATION_TIMEOUT_MILLIS);\n\treturn async (path, signal) => {\n\t\tconst expectedBytes = assertValidB2ContentLength(path.selectedVersion.contentLength);\n\t\tconst maxBytes = normalizeSha1VerificationMaxBytes(expectedBytes, config.options.sha1VerificationMaxBytes);\n\t\treturn withSha1VerificationDeadline(signal, verificationTimeoutMillis, async (deadlineSignal) => {\n\t\t\tdeadlineSignal.throwIfAborted();\n\t\t\tif (maxBytes < expectedBytes) throw new Error(`sha1 B2 verification skipped because contentLength ${expectedBytes} exceeds ${maxBytes} byte verification budget`);\n\t\t\tconst serverSideEncryption = toSseCDownloadKey(config.options.encryptionProvider?.getSettingForDownload(path.selectedVersion));\n\t\t\tconst fileName = validateB2SyncPathInAnyPrefix(readablePrefixes, path, \"read\");\n\t\t\tconst verified = await hashReadableStreamSha1((await bucket.file(fileName).downloadById(path.selectedVersion.fileId, {\n\t\t\t\t...serverSideEncryption !== void 0 ? { serverSideEncryption } : {},\n\t\t\t\tsignal: deadlineSignal\n\t\t\t})).body, deadlineSignal, {\n\t\t\t\tidleTimeoutMillis,\n\t\t\t\tmaxBytes,\n\t\t\t\texpectedBytes\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tcontentSha1: verified.contentSha1,\n\t\t\t\tbytesRead: verified.bytesRead\n\t\t\t};\n\t\t});\n\t};\n}\nfunction forwardAbortSignal(source, controller) {\n\tif (source === void 0) return () => void 0;\n\tif (source.aborted) {\n\t\tabortActionController(controller, source.reason);\n\t\treturn () => void 0;\n\t}\n\tconst abort = () => abortActionController(controller, source.reason);\n\tsource.addEventListener(\"abort\", abort, { once: true });\n\treturn () => source.removeEventListener(\"abort\", abort);\n}\nfunction abortActionController(controller, reason) {\n\tif (!controller.signal.aborted) controller.abort(reason);\n}\n/**\n* Narrowing assertion that a `Bucket` is present for an action that requires\n* it. Throws with a consistent, context-tagged message when the configured\n* direction did not supply one (e.g. `b2-to-local` direction asking for an\n* upload action).\n*\n* Uses TypeScript's `asserts` signature so call-site flow narrows\n* `bucket` from `Bucket | undefined` to `Bucket` after the check, without\n* requiring a separate `if (!bucket) throw ...` line per action factory.\n*\n* @param bucket - The (possibly missing) bucket reference.\n* @param context - Short verb describing the action being constructed\n* (e.g. `'upload'`, `'download'`). Surfaced in the error message.\n*\n* @throws `Error` when `bucket` is `undefined` or `null`.\n*/\nfunction assertBucket(bucket, context) {\n\tif (!bucket) throw new Error(`Bucket required for ${context} actions`);\n}\n/**\n* Returns the root for a local sync folder required by an action.\n*\n* @param folder - The configured folder to validate.\n* @param role - Whether the local folder is the source or destination.\n* @param context - Short verb describing the action being constructed.\n*\n* @returns The local filesystem root.\n*\n* @throws `Error` when the folder is not local or has no root.\n*/\nfunction requireLocalRoot(folder, role, context) {\n\tconst root = folder?.type === \"local\" ? folder.root : void 0;\n\tif (typeof root !== \"string\" || root === \"\") throw new Error(`Local ${role} root required for ${context} actions`);\n\treturn root;\n}\nasync function resolveLocalRootContexts(config) {\n\tconst sourceIsLocalFilesystem = isLocalFilesystemFolder(config.source);\n\tconst destIsLocalFilesystem = isLocalFilesystemFolder(config.dest);\n\tif (!sourceIsLocalFilesystem && !destIsLocalFilesystem) return {};\n\tconst sourceContext = config.dest.type === \"b2\" ? \"upload\" : \"sync\";\n\tconst destContext = config.source.type === \"b2\" ? \"download\" : \"sync\";\n\treturn {\n\t\t...sourceIsLocalFilesystem ? { source: await resolveLocalRootContext(requireLocalRoot(config.source, \"source\", sourceContext)) } : {},\n\t\t...destIsLocalFilesystem ? { dest: await resolveLocalRootContext(requireLocalRoot(config.dest, \"destination\", destContext)) } : {}\n\t};\n}\nasync function resolveLocalRootContext(root) {\n\tconst { realpath, stat } = await import(\"node:fs/promises\");\n\tconst { resolve } = await import(\"node:path\");\n\tconst safeRoot = resolve(root);\n\tconst realPath = await realpath(safeRoot).catch((err) => {\n\t\tif (isNotFoundError(err)) return safeRoot;\n\t\tthrow err;\n\t});\n\tconst stats = await stat(realPath).catch((err) => {\n\t\tif (isNotFoundError(err)) return void 0;\n\t\tthrow err;\n\t});\n\tif (stats !== void 0 && !stats.isDirectory()) throw new Error(\"Local sync root is not a directory\");\n\treturn {\n\t\troot: safeRoot,\n\t\trealPath,\n\t\t...stats === void 0 ? {} : { identity: {\n\t\t\tdeviceId: stats.dev,\n\t\t\tinode: stats.ino\n\t\t} }\n\t};\n}\nfunction isLocalFilesystemFolder(folder) {\n\treturn folder?.type === \"local\" && isLocalFilesystemRoot(folder);\n}\n/**\n* Narrows a setting to SSE-C; non-SSE-C source settings need no key on read.\n*\n* @param setting - Provider-supplied encryption setting, or undefined.\n*\n* @returns The SSE-C setting when one is provided; otherwise undefined.\n*/\nfunction toSseCEncryptionSetting(setting) {\n\tif (setting?.mode !== \"SSE-C\") return void 0;\n\treturn setting;\n}\n/**\n* Returns a download key from SSE-C settings; non-SSE-C downloads need no key.\n*\n* @param setting - Provider-supplied encryption setting, or undefined.\n*\n* @returns A download key for SSE-C files; otherwise undefined.\n*/\nfunction toSseCDownloadKey(setting) {\n\treturn toSseCEncryptionSetting(setting);\n}\n/**\n* Creates a configured sync engine wired to the bucket and paths in the given config.\n*\n* For sync operations that may need to remove destination-only files (the\n* `keepMode: 'delete'` policy), the factory reads the destination\n* bucket's cached `fileLockConfiguration` once so `removeOrphan` can\n* dispatch to either `hide` (locked buckets) or `deleteFileVersion`\n* (vanilla buckets) without a per-file branch. The cache is whatever\n* `client.listBuckets()` or `client.createBucket()` returned — callers\n* who flipped lock state mid-sync (rare) should refresh before\n* synchronize().\n*\n* @param config - Synchronizer configuration containing source, destination, and options.\n* @param localRootContexts - Resolved filesystem roots captured before action creation.\n*\n* @returns An action factory bound to the provided configuration.\n*/\nfunction createActionFactory(config, localRootContexts) {\n\tconst upConfig = config;\n\tconst downConfig = config;\n\tconst uploadPrefix = asRawB2KeyPrefix(upConfig.prefix ?? b2FolderRawPrefix(config.dest) ?? \"\");\n\tconst sourceB2Prefix = b2FolderRawPrefix(config.source);\n\tconst bucketIsLocked = (upConfig.bucket ?? downConfig.bucket)?.info?.fileLockConfiguration?.value?.isFileLockEnabled ?? false;\n\tconst factory = {\n\t\tupload(source, dest) {\n\t\t\tconst bucket = upConfig.bucket;\n\t\t\tassertBucket(bucket, \"upload\");\n\t\t\treturn new UploadAction(source.relativePath, source.absolutePath, source.size, async (absPath, relPath, signal) => {\n\t\t\t\tconst rootContext = localRootContexts.source;\n\t\t\t\tconst root = rootContext?.root ?? upConfig.source.root ?? \"\";\n\t\t\t\tconst fileName = dest !== void 0 ? validateB2SyncPathInPrefix(uploadPrefix, dest) : `${uploadPrefix}${relPath}`;\n\t\t\t\tif (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, relPath, { allowSymlinkRoot: true });\n\t\t\t\tconst targetPath = rootContext === void 0 ? await resolveContainedLocalPath(root, source.relativePath, absPath) : await resolveContainedLocalPath(rootContext.realPath, source.relativePath);\n\t\t\t\tthrowIfAborted(signal);\n\t\t\t\tconst fileSource = await createValidatedUploadFileSource(source, targetPath);\n\t\t\t\tthrowIfAborted(signal);\n\t\t\t\tconst serverSideEncryption = config.options.encryptionProvider?.getSettingForUpload(fileName, fileSource.size);\n\t\t\t\tawait bucket.upload({\n\t\t\t\t\tfileName,\n\t\t\t\t\tsource: fileSource,\n\t\t\t\t\t...serverSideEncryption !== void 0 ? { serverSideEncryption } : {},\n\t\t\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\tdownload(source, scannedDest) {\n\t\t\tconst bucket = downConfig.bucket;\n\t\t\tassertBucket(bucket, \"download\");\n\t\t\treturn new DownloadAction(source.relativePath, source.size, async (relPath, signal) => {\n\t\t\t\tconst rootContext = localRootContexts.dest;\n\t\t\t\tconst root = rootContext?.root ?? downConfig.dest.root ?? \"\";\n\t\t\t\tsafeRelativePathSegments(relPath);\n\t\t\t\tconst b2FileName = sourceB2Prefix === void 0 ? source.selectedVersion.fileName : validateB2SyncPathInPrefix(sourceB2Prefix, source, \"read\");\n\t\t\t\tconst idleTimeoutMillis = normalizeDownloadIdleTimeoutMillis(config.options.downloadIdleTimeoutMillis);\n\t\t\t\tconst expectedBytes = assertValidB2ContentLength(source.selectedVersion.contentLength);\n\t\t\t\tif (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, relPath, { allowSymlinkRoot: false });\n\t\t\t\tawait ensureLocalSyncRootDirectory(root, relPath);\n\t\t\t\tconst serverSideEncryption = toSseCDownloadKey(config.options.encryptionProvider?.getSettingForDownload(source.selectedVersion));\n\t\t\t\tconst result = await bucket.file(b2FileName).downloadById(source.selectedVersion.fileId, {\n\t\t\t\t\t...serverSideEncryption !== void 0 ? { serverSideEncryption } : {},\n\t\t\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t\t\t});\n\t\t\t\ttry {\n\t\t\t\t\tawait writeLocalStreamInsideRoot(root, relPath, result.body, {\n\t\t\t\t\t\texpectedBytes,\n\t\t\t\t\t\t...scannedDest !== void 0 ? { expectedDestination: scannedDest } : {},\n\t\t\t\t\t\tidleTimeoutMillis,\n\t\t\t\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t\t\t\t});\n\t\t\t\t} catch (err) {\n\t\t\t\t\tawait cancelReadableStreamBody(result.body, err);\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tcopy(source, destRelativePath) {\n\t\t\treturn copyToB2Key(source, `${uploadPrefix}${destRelativePath}`);\n\t\t},\n\t\tcopyB2Path(source, dest) {\n\t\t\treturn copyToB2Key(source, validateB2SyncPathInPrefix(uploadPrefix, dest));\n\t\t},\n\t\thide(path) {\n\t\t\tconst bucket = upConfig.bucket ?? downConfig.bucket;\n\t\t\tassertBucket(bucket, \"hide\");\n\t\t\treturn new HideAction(path, async (_relPath, signal) => {\n\t\t\t\tawait bucket.hideFile(`${uploadPrefix}${path}`, signal === void 0 ? void 0 : { signal });\n\t\t\t});\n\t\t},\n\t\thideB2Path(path) {\n\t\t\tconst bucket = upConfig.bucket ?? downConfig.bucket;\n\t\t\tassertBucket(bucket, \"hide\");\n\t\t\tconst b2FileName = validateB2SyncPathInPrefix(uploadPrefix, path);\n\t\t\treturn new HideAction(path.relativePath, async (_relPath, signal) => {\n\t\t\t\tawait bucket.hideFile(b2FileName, signal === void 0 ? void 0 : { signal });\n\t\t\t});\n\t\t},\n\t\tdeleteRemote(path) {\n\t\t\tconst bucket = upConfig.bucket ?? downConfig.bucket;\n\t\t\tassertBucket(bucket, \"delete\");\n\t\t\tconst b2FileName = validateB2SyncPathInPrefix(uploadPrefix, path);\n\t\t\treturn new DeleteRemoteAction(path.relativePath, path.selectedVersion.fileId, async (fileId$1, _fileName, signal) => {\n\t\t\t\tawait bucket.deleteFileVersion(b2FileName, fileId(fileId$1), signal === void 0 ? void 0 : { signal });\n\t\t\t});\n\t\t},\n\t\tdeleteLocal(path) {\n\t\t\tconst rootContext = localRootContexts.dest;\n\t\t\tconst root = rootContext?.root ?? localSyncRoot(downConfig.dest);\n\t\t\treturn new DeleteLocalAction(path.relativePath, path.absolutePath, async (absPath, signal) => {\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\tif (absPath !== path.absolutePath) throw new Error(`Refusing to delete outside sync root: ${path.relativePath}`);\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\ttry {\n\t\t\t\t\tif (rootContext !== void 0) await assertLocalRootContextCurrent(rootContext, path.relativePath, { allowSymlinkRoot: false });\n\t\t\t\t\tawait deleteLocalFileInsideRoot(root, path);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (isLocalDeleteSafetyError(err)) throw err;\n\t\t\t\t\tthrow new Error(`failed to delete local file: ${localFilesystemErrorReason(err)}`);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tremoveOrphan(dest) {\n\t\t\treturn bucketIsLocked ? factory.hideB2Path?.(dest) ?? factory.hide(dest.relativePath) : factory.deleteRemote(dest);\n\t\t}\n\t};\n\tfunction copyToB2Key(source, targetPath) {\n\t\tconst bucket = upConfig.bucket;\n\t\tassertBucket(bucket, \"copy\");\n\t\treturn new CopyAction(source.relativePath, source.size, async (_relPath, signal) => {\n\t\t\tif (sourceB2Prefix !== void 0) validateB2SyncPathInPrefix(sourceB2Prefix, source, \"read\");\n\t\t\tconst destinationServerSideEncryption = config.options.encryptionProvider?.getSettingForUpload(targetPath, source.size);\n\t\t\tconst sourceServerSideEncryption = toSseCEncryptionSetting(config.options.encryptionProvider?.getSettingForDownload(source.selectedVersion));\n\t\t\tawait bucket.copyFile({\n\t\t\t\tsourceFileId: source.selectedVersion.fileId,\n\t\t\t\tfileName: targetPath,\n\t\t\t\t...destinationServerSideEncryption !== void 0 ? { destinationServerSideEncryption } : {},\n\t\t\t\t...sourceServerSideEncryption !== void 0 ? { sourceServerSideEncryption } : {},\n\t\t\t\t...signal !== void 0 ? { signal } : {}\n\t\t\t});\n\t\t});\n\t}\n\treturn factory;\n}\nasync function createValidatedUploadFileSource(source, absolutePath) {\n\ttry {\n\t\tconst fileSource = await FileSource.fromPath(absolutePath);\n\t\tawait validateScannedLocalFile({\n\t\t\t...source,\n\t\t\tabsolutePath\n\t\t});\n\t\treturn fileSource;\n\t} catch (err) {\n\t\tthrow normalizeLocalUploadSourceError(err);\n\t}\n}\nfunction normalizeLocalUploadSourceError(err) {\n\tif (err instanceof Error && err.message.startsWith(\"local file changed before upload\")) return err;\n\tconst message = err instanceof Error ? err.message : String(err);\n\tif (message.includes(\"not a regular file\")) return /* @__PURE__ */ new Error(\"local file changed before upload: not a regular file\");\n\tif (message.includes(\"changed\") || message.includes(\"modified\")) return /* @__PURE__ */ new Error(\"local file changed before upload\");\n\treturn /* @__PURE__ */ new Error(`local file changed before upload: ${sanitizeErrorReason(err)}`);\n}\nfunction localSyncRoot(folder) {\n\treturn folder?.type === \"local\" ? folder.root : \"\";\n}\nfunction b2FolderRawPrefix(folder) {\n\tif (folder?.type !== \"b2\") return void 0;\n\tconst rawPrefix = folder.rawPrefix;\n\treturn typeof rawPrefix === \"string\" ? rawPrefix : void 0;\n}\nfunction validateB2SourcePairPrefix(pair, config) {\n\tconst [source] = pair;\n\tif (config.source.type !== \"b2\" || source === null || !isB2SyncPath(source)) return;\n\tconst sourcePrefix = b2FolderRawPrefix(config.source);\n\tif (sourcePrefix === void 0) return;\n\tvalidateB2SyncPathInPrefix(sourcePrefix, source, \"read\");\n}\nfunction b2ReadableRawPrefixes(config) {\n\tconst prefixes = [];\n\tconst sourcePrefix = b2FolderRawPrefix(config.source);\n\tif (config.source.type === \"b2\") prefixes.push(sourcePrefix ?? \"\");\n\tconst upConfig = config;\n\tif (config.dest.type === \"b2\") prefixes.push(upConfig.prefix ?? b2FolderRawPrefix(config.dest) ?? \"\");\n\treturn [...new Set(prefixes.map((prefix) => asRawB2KeyPrefix(prefix)))];\n}\nfunction validateB2SyncPathInAnyPrefix(prefixes, path, operation) {\n\tlet firstError = /* @__PURE__ */ new Error(`Refusing to ${operation} B2 key: ${path.relativePath}`);\n\tfor (const prefix of prefixes) try {\n\t\treturn validateB2SyncPathInPrefix(prefix, path, operation);\n\t} catch (err) {\n\t\tif (err instanceof Error) firstError = err;\n\t}\n\tthrow firstError;\n}\nfunction validateB2SyncPathInPrefix(prefix, path, operation = \"mutate\") {\n\tconst fileName = path.selectedVersion.fileName;\n\tif (!fileName.startsWith(prefix)) throw new Error(`Refusing to ${operation} B2 key outside configured prefix: ${path.relativePath}`);\n\tif (b2KeyToRelativePathUnderPrefix(prefix, fileName) !== path.relativePath) throw new Error(`Refusing to ${operation} mismatched B2 key for sync path: ${path.relativePath}`);\n\treturn fileName;\n}\nfunction isB2SyncPath(path) {\n\treturn \"selectedVersion\" in path;\n}\nfunction throwIfAborted(signal) {\n\tif (signal?.aborted === true) throw signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\nasync function cancelReadableStreamBody(body, reason) {\n\tif (body.locked) return;\n\ttry {\n\t\tawait body.cancel(reason);\n\t} catch {}\n}\nasync function assertLocalRootContextCurrent(context, relativePath, options) {\n\tif (context.identity === void 0) return;\n\tconst { lstat, realpath, stat } = await import(\"node:fs/promises\");\n\tlet currentRealPath;\n\ttry {\n\t\tconst rootLinkStats = await lstat(context.root);\n\t\tif (!options.allowSymlinkRoot && rootLinkStats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`);\n\t\tcurrentRealPath = await realpath(context.root);\n\t} catch (err) {\n\t\tif (err instanceof Error && err.message.startsWith(\"Refusing to access sync root\")) throw err;\n\t\tthrow new Error(`Local sync root changed before filesystem action: ${relativePath}`);\n\t}\n\tif (currentRealPath !== context.realPath) throw new Error(`Local sync root changed before filesystem action: ${relativePath}`);\n\tlet currentStats;\n\ttry {\n\t\tcurrentStats = await stat(context.realPath);\n\t} catch {\n\t\tthrow new Error(`Local sync root changed before filesystem action: ${relativePath}`);\n\t}\n\tif (!currentStats.isDirectory() || currentStats.dev !== context.identity.deviceId || currentStats.ino !== context.identity.inode) throw new Error(`Local sync root changed before filesystem action: ${relativePath}`);\n}\nasync function ensureLocalSyncRootDirectory(root, relativePath) {\n\tif (root === \"\") throw new Error(\"Local sync root required for filesystem mutation\");\n\tconst { lstat, mkdir } = await import(\"node:fs/promises\");\n\tconst { resolve } = await import(\"node:path\");\n\tconst safeRoot = resolve(root);\n\ttry {\n\t\tconst stats = await lstat(safeRoot);\n\t\tif (stats.isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`);\n\t\tif (!stats.isDirectory()) throw new Error(`Local sync root is not a directory: ${relativePath}`);\n\t\treturn;\n\t} catch (error) {\n\t\tif (!isNotFoundError(error)) throw error;\n\t}\n\tawait mkdir(safeRoot, { recursive: true });\n\tawait assertLocalRootHasNoSymlink(safeRoot, relativePath);\n}\nfunction bufferScanEvent(buffer, event, direction, scanSide) {\n\tif (event.type === \"skip\" && event.reason === \"filesystem-error\") buffer.fatalFilesystemErrorMessage ??= event.message;\n\tif (sourceSkipMakesInventoryIncomplete(event, direction, scanSide)) buffer.sourceInventoryIncompleteMessage ??= sourceInventoryIncompleteMessage(direction);\n\tif (buffer.events.length < MAX_BUFFERED_SCAN_EVENTS) buffer.events.push(event);\n\telse buffer.dropped++;\n}\nfunction* drainScanEvents(buffer) {\n\twhile (buffer.events.length > 0) {\n\t\tconst event = buffer.events.shift();\n\t\tif (event) yield event;\n\t}\n\tif (buffer.dropped > 0) {\n\t\tyield {\n\t\t\ttype: \"skip\",\n\t\t\tpath: \"\",\n\t\t\tsize: 0,\n\t\t\treason: \"scan-skip-overflow\",\n\t\t\tmessage: `${buffer.dropped} scanner skip event(s) were omitted after ${MAX_BUFFERED_SCAN_EVENTS} buffered diagnostics`\n\t\t};\n\t\tbuffer.dropped = 0;\n\t}\n}\nfunction scanHadFilesystemError(scanEvents) {\n\treturn scanEvents.fatalFilesystemErrorMessage !== void 0;\n}\nfunction sourceInventoryIncomplete(scanEvents) {\n\treturn scanEvents.sourceInventoryIncompleteMessage !== void 0;\n}\nfunction scanFilesystemError(scanEvents) {\n\treturn scanEvents.fatalFilesystemErrorMessage === void 0 ? void 0 : new Error(scanEvents.fatalFilesystemErrorMessage);\n}\nfunction sourceSkipMakesInventoryIncomplete(event, direction, scanSide) {\n\tif (scanSide !== \"source\" || event.type !== \"skip\") return false;\n\tif (direction === \"local-to-b2\") return event.reason === \"unsafe-name\" || event.reason === \"stale-download-partial\" || event.reason === \"path-too-long-for-regexp\";\n\tif (direction === \"b2-to-local\" || direction === \"b2-to-b2\") return event.reason === \"unsafe-name\" || event.reason === \"local-unsafe-name\" || event.reason === \"relative-path-collision\" || event.reason === \"local-path-collision\" || event.reason === \"path-too-long-for-regexp\";\n\treturn false;\n}\nfunction sourceInventoryIncompleteMessage(direction) {\n\treturn direction === \"local-to-b2\" ? \"not removed because the source scan skipped local paths\" : \"not removed because the source scan skipped unsafe B2 names\";\n}\nfunction isLocalDeleteSafetyError(err) {\n\tif (!(err instanceof Error)) return false;\n\treturn err.message === \"Local sync root required for filesystem mutation\" || err.message.startsWith(\"Local sync root changed before filesystem action: \") || err.message.startsWith(\"Refusing to \") || err.message.startsWith(\"Local sync root is not a directory: \") || err.message.startsWith(\"unsafe local delete path: \");\n}\nasync function resolveContainedLocalPath(root, relativePath, absolutePath) {\n\tif (root === \"\") throw new Error(\"Local sync root required for filesystem mutation\");\n\tconst { isAbsolute, relative, resolve, sep } = await import(\"node:path\");\n\tconst safeRoot = resolve(root);\n\tconst target = absolutePath === void 0 ? resolve(safeRoot, relativePath) : resolve(absolutePath);\n\tconst pathFromRoot = relative(safeRoot, target);\n\t/* v8 ignore next -- defense-in-depth after prior no-follow and symlink checks. */\n\tif (pathFromRoot === \"..\" || pathFromRoot.startsWith(`..${sep}`) || isAbsolute(pathFromRoot)) throw new Error(`Refusing to access path outside sync root: ${relativePath}`);\n\tawait assertLocalRootHasNoSymlink(safeRoot, relativePath);\n\tawait assertPathHasNoSymlinkComponents(safeRoot, pathFromRoot, relativePath);\n\treturn target;\n}\nasync function assertLocalRootHasNoSymlink(safeRoot, relativePath) {\n\tconst { lstat } = await import(\"node:fs/promises\");\n\ttry {\n\t\tif ((await lstat(safeRoot)).isSymbolicLink()) throw new Error(`Refusing to access sync root through symlink: ${relativePath}`);\n\t} catch (error) {\n\t\tif (isNotFoundError(error)) return;\n\t\tthrow error;\n\t}\n}\nasync function assertPathHasNoSymlinkComponents(safeRoot, pathFromRoot, relativePath) {\n\tif (pathFromRoot === \"\") return;\n\tconst { lstat } = await import(\"node:fs/promises\");\n\tconst { join, sep } = await import(\"node:path\");\n\tlet current = safeRoot;\n\tfor (const segment of pathFromRoot.split(sep)) {\n\t\tcurrent = join(current, segment);\n\t\tlet stats;\n\t\ttry {\n\t\t\tstats = await lstat(current);\n\t\t} catch (error) {\n\t\t\tif (isNotFoundError(error)) return;\n\t\t\tthrow error;\n\t\t}\n\t\tif (stats.isSymbolicLink()) throw new Error(`Refusing to access path through symlink: ${relativePath}`);\n\t}\n}\nfunction isNotFoundError(error) {\n\treturn typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"ENOENT\";\n}\n//#endregion\nexport { synchronize, synchronizerTestHooks };\n\n//# sourceMappingURL=synchronizer.js.map","import { validateSyncFilters } from \"../regexp-safety.js\";\nimport { emitScannerSkip, regexpInputTooLongSkip } from \"../scan-events.js\";\nimport { directoryMayContainSyncPaths, pathPassesSyncFilters, pathSkippedByRegExpInputLimit } from \"../filters.js\";\nimport { compareSyncRelativePaths } from \"../path-order.js\";\nimport { assertScanEntryLimit, scanEntryLimit } from \"../scan-limit.js\";\nimport { localFileIdentityFromStats } from \"../local-file-identity.js\";\nimport { isReservedSyncTempFileName } from \"../path-safety.js\";\nimport { isDownloadStagingDirectorySegment, isManagedDownloadStagingRoot } from \"../download-staging.js\";\nimport { localFilesystemErrorReason } from \"../filesystem-errors.js\";\nimport { registerLocalFilesystemRoot } from \"../local-filesystem-root.js\";\n//#region src/sync/scanners/local.ts\n/**\n* Scans a local directory tree and yields {@link LocalSyncPath} entries sorted by relative path.\n* A root directory read failure aborts the scan with an error diagnostic. Per-entry file or\n* directory failures are reported through `onError` and the scan continues over readable siblings.\n* SDK-managed partial download file names are skipped so unfinished internal\n* temp files are not synchronized.\n* The current implementation collects matching entries before sorting, so memory usage is\n* proportional to the number of matched files.\n*/\nvar LocalFolder = class {\n\ttype = \"local\";\n\tappliesScanFilters = true;\n\tappliesScanSorting = true;\n\t/** Resolved absolute path to the local root directory. */\n\troot;\n\t/**\n\t* Creates a new LocalFolder for the given root directory.\n\t* @param root - Absolute or relative path to the local directory to scan.\n\t*/\n\tconstructor(root) {\n\t\tthis.root = resolvePathAtConstruction(root);\n\t\tregisterLocalFilesystemRoot(this);\n\t}\n\t/**\n\t* Recursively walks the directory and yields files in sync path order.\n\t* @param options - Optional scan controls.\n\t*/\n\tasync *scan(options = {}) {\n\t\tvalidateSyncFilters(options);\n\t\tconst nodeDeps = await loadLocalNodeDeps();\n\t\tconst root = nodeDeps.resolve(this.root);\n\t\tconst collected = [];\n\t\tawait this.walk(root, root, collected, options, scanEntryLimit(options), nodeDeps);\n\t\tcollected.sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath));\n\t\tfor (const entry of collected) {\n\t\t\tthrowIfScanAborted(options);\n\t\t\tyield entry;\n\t\t}\n\t}\n\t/**\n\t* Recursively collects files from {@link dir} into {@link out}.\n\t* @param root - Resolved scan root used for relative path calculation.\n\t* @param dir - Absolute path of the directory to scan.\n\t* @param out - Accumulator array that receives discovered file entries.\n\t* @param options - Optional scan controls.\n\t* @param maxScanEntries - Maximum number of entries to retain before failing.\n\t* @param nodeDeps - Lazy-loaded Node filesystem and path helpers.\n\t*/\n\tasync walk(root, dir, out, options, maxScanEntries, nodeDeps) {\n\t\tthrowIfScanAborted(options);\n\t\tlet entries;\n\t\ttry {\n\t\t\tentries = await nodeDeps.readdir(dir, { withFileTypes: true });\n\t\t} catch (err) {\n\t\t\tconst error = this.emitScanError(options, relativePathFromRoot(root, dir, nodeDeps), \"directory\", err);\n\t\t\tif (dir === root) throw error;\n\t\t\treturn;\n\t\t}\n\t\tfor (const entry of entries) {\n\t\t\tthrowIfScanAborted(options);\n\t\t\tconst fullPath = nodeDeps.join(dir, entry.name);\n\t\t\tconst rel = relativePathFromRoot(root, fullPath, nodeDeps);\n\t\t\tif (isDownloadStagingDirectorySegment(rel) && entry.isDirectory() && isDownloadStagingDirectorySegment(entry.name) && await isManagedDownloadStagingRoot(fullPath)) continue;\n\t\t\tif (rel.includes(\"\\\\\")) {\n\t\t\t\temitScannerSkip(options, {\n\t\t\t\t\ttype: \"skip\",\n\t\t\t\t\tpath: rel,\n\t\t\t\t\tsize: 0,\n\t\t\t\t\treason: \"unsafe-name\",\n\t\t\t\t\tmessage: `Skipped local path ${JSON.stringify(rel)}: backslashes are not safe sync path characters`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (isReservedSyncTempFileName(entry.name)) {\n\t\t\t\temitScannerSkip(options, {\n\t\t\t\t\ttype: \"skip\",\n\t\t\t\t\tpath: rel,\n\t\t\t\t\tsize: 0,\n\t\t\t\t\treason: \"stale-download-partial\",\n\t\t\t\t\tmessage: `Skipped local path ${JSON.stringify(rel)}: reserved SDK partial download file`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tif (directoryMayContainSyncPaths(rel, options)) await this.walk(root, fullPath, out, options, maxScanEntries, nodeDeps);\n\t\t\t} else if (entry.isFile()) {\n\t\t\t\tif (!pathPassesSyncFilters(rel, options)) {\n\t\t\t\t\tif (pathSkippedByRegExpInputLimit(rel, options)) emitScannerSkip(options, regexpInputTooLongSkip(rel));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlet s;\n\t\t\t\ttry {\n\t\t\t\t\ts = await nodeDeps.lstat(fullPath);\n\t\t\t\t\t/* v8 ignore start -- lstat race after a Dirent file result is not deterministic */\n\t\t\t\t\tif (!s.isFile()) {\n\t\t\t\t\t\tthis.emitScanError(options, rel, \"file\", /* @__PURE__ */ new Error(\"not a regular file\"));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t/* v8 ignore next -- stat TOCTOU failures are not deterministic to trigger */\n\t\t\t\t\tthis.emitScanError(options, relativePathFromRoot(root, fullPath, nodeDeps), \"file\", err);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tassertScanEntryLimit(out.length + 1, maxScanEntries);\n\t\t\t\tout.push({\n\t\t\t\t\trelativePath: rel,\n\t\t\t\t\tabsolutePath: fullPath,\n\t\t\t\t\tmodTimeMillis: Math.floor(s.mtimeMs),\n\t\t\t\t\tsize: s.size,\n\t\t\t\t\tfileIdentity: localFileIdentityFromStats(s)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\temitScanError(options, path, kind, err) {\n\t\tconst event = {\n\t\t\ttype: \"error\",\n\t\t\tpath,\n\t\t\tsize: 0,\n\t\t\tmessage: `failed to scan local ${kind}: ${localFilesystemErrorReason(err)}`\n\t\t};\n\t\toptions.onError?.(event);\n\t\treturn new Error(event.message);\n\t}\n};\nasync function loadLocalNodeDeps() {\n\tconst [fsPromises, path] = await Promise.all([import(\"node:fs/promises\"), import(\"node:path\")]);\n\treturn {\n\t\treaddir: fsPromises.readdir,\n\t\tlstat: fsPromises.lstat,\n\t\tjoin: path.join,\n\t\trelative: path.relative,\n\t\tresolve: path.resolve,\n\t\tsep: path.sep\n\t};\n}\nfunction resolvePathAtConstruction(root) {\n\tconst processLike = globalThis.process;\n\tif (typeof processLike?.cwd !== \"function\") return root;\n\tconst cwd = processLike.cwd();\n\tif (processLike.platform === \"win32\") return resolveWindowsPath(cwd, root);\n\treturn resolvePosixPath(cwd, root);\n}\nfunction resolvePosixPath(cwd, root) {\n\tconst resolved = normalizePathSegments((root.startsWith(\"/\") ? root : `${cwd}/${root}`).split(\"/\"), \"/\");\n\treturn resolved === \"\" ? \"/\" : `/${resolved}`;\n}\nfunction resolveWindowsPath(cwd, root) {\n\tconst normalizedRoot = root.replaceAll(\"/\", \"\\\\\");\n\tconst normalizedCwd = cwd.replaceAll(\"/\", \"\\\\\");\n\tconst drive = /^[A-Za-z]:/.exec(normalizedCwd)?.[0] ?? \"\";\n\tconst cwdUnc = splitUncPath(normalizedCwd);\n\tif (/^\\\\\\\\/.test(normalizedRoot)) return normalizeUncPath(normalizedRoot);\n\tif (/^[A-Za-z]:\\\\/.test(normalizedRoot)) return joinWindowsRoot(normalizedRoot.slice(0, 2), normalizePathSegments(normalizedRoot.slice(3).split(\"\\\\\"), \"\\\\\"));\n\tif (/^[A-Za-z]:/.test(normalizedRoot)) throw new Error(\"LocalFolder root must not be a drive-relative Windows path\");\n\tif (normalizedRoot.startsWith(\"\\\\\")) {\n\t\tconst rest = normalizePathSegments(normalizedRoot.slice(1).split(\"\\\\\"), \"\\\\\");\n\t\treturn joinWindowsRoot(cwdUnc?.prefix ?? drive, rest);\n\t}\n\tif (cwdUnc !== void 0) {\n\t\tconst resolved = normalizePathSegments([...cwdUnc.rest, ...normalizedRoot.split(\"\\\\\")], \"\\\\\");\n\t\treturn joinWindowsRoot(cwdUnc.prefix, resolved);\n\t}\n\tconst base = /^[A-Za-z]:\\\\/.test(normalizedCwd) ? normalizedCwd : `${drive}\\\\`;\n\tconst prefix = /^[A-Za-z]:/.exec(base)?.[0] ?? drive;\n\treturn joinWindowsRoot(prefix, normalizePathSegments([...base.slice(prefix.length).replace(/^\\\\/, \"\").split(\"\\\\\"), ...normalizedRoot.split(\"\\\\\")], \"\\\\\"));\n}\nfunction normalizeUncPath(path) {\n\tconst unc = splitUncPath(path);\n\tif (unc === void 0) return path;\n\treturn joinWindowsRoot(unc.prefix, normalizePathSegments(unc.rest, \"\\\\\"));\n}\nfunction splitUncPath(path) {\n\tif (!path.startsWith(\"\\\\\\\\\")) return void 0;\n\tconst [server, share, ...rest] = path.split(\"\\\\\").filter((part) => part !== \"\");\n\tif (server === void 0 || share === void 0) return void 0;\n\treturn {\n\t\tprefix: `\\\\\\\\${server}\\\\${share}`,\n\t\trest\n\t};\n}\nfunction joinWindowsRoot(prefix, rest) {\n\treturn rest === \"\" ? `${prefix}\\\\` : `${prefix}\\\\${rest}`;\n}\nfunction normalizePathSegments(segments, separator) {\n\tconst out = [];\n\tfor (const segment of segments) {\n\t\tif (segment === \"\" || segment === \".\") continue;\n\t\tif (segment === \"..\") {\n\t\t\tout.pop();\n\t\t\tcontinue;\n\t\t}\n\t\tout.push(segment);\n\t}\n\treturn out.join(separator);\n}\nfunction relativePathFromRoot(root, path, nodeDeps) {\n\treturn nodeDeps.relative(root, path).split(nodeDeps.sep).join(\"/\");\n}\nfunction throwIfScanAborted(options) {\n\tif (options.signal?.aborted === true) throw options.signal.reason ?? new DOMException(\"Aborted\", \"AbortError\");\n}\n//#endregion\nexport { LocalFolder };\n\n//# sourceMappingURL=local.js.map","import { FileAction } from \"../../types/file.js\";\nimport { validateSyncFilters } from \"../regexp-safety.js\";\nimport { emitScannerSkip, regexpInputTooLongSkip } from \"../scan-events.js\";\nimport { literalPrefixForSyncFilters, pathPassesSyncFilters, pathSkippedByRegExpInputLimit } from \"../filters.js\";\nimport { compareCodeUnits, compareSyncRelativePaths } from \"../path-order.js\";\nimport { assertScanEntryLimit, scanEntryLimit } from \"../scan-limit.js\";\nimport { sanitizeErrorReason } from \"../../util/error-reason.js\";\nimport { isAbortError } from \"../local-sha1.js\";\nimport { selectB2ComparableSha1, syncSha1StateOf } from \"../sha1-metadata.js\";\nimport { assertSyncPathAllowed } from \"../path-safety.js\";\nimport { asRawB2KeyPrefix, b2KeyToRelativePathUnderPrefix, localFilesystemCanonicalSyncPath, localFilesystemSyncPathIsUnsafe } from \"../prefix.js\";\n//#region src/sync/scanners/b2.ts\nvar MAX_EMPTY_B2_SCAN_PAGES = 100;\n/**\n* Scans a B2 bucket (optionally filtered by a raw B2 key prefix) and yields\n* {@link B2SyncPath} entries sorted by `compareSyncRelativePaths(relativePath)`. Hidden files are excluded.\n* Raw B2 file names are used only as an internal tie-breaker after collision handling.\n* All versions for the listed prefix are fetched, grouped, and sorted before\n* yielding; exclude filters are applied client-side and do not reduce that\n* B2 listing memory footprint.\n* SDK-reserved temporary names fail the scan because syncing them could corrupt\n* in-progress transfers.\n*/\nvar B2Folder = class {\n\ttype = \"b2\";\n\tappliesScanFilters = true;\n\tappliesScanSorting = true;\n\t/** Raw B2 key prefix this folder scans, preserving caller-provided separators verbatim. */\n\trawPrefix;\n\tbucket;\n\t/**\n\t* Creates a new B2Folder for the given bucket and optional prefix.\n\t* @param bucket - The B2 bucket to scan.\n\t* @param prefix - Optional raw B2 key prefix to restrict the scan scope.\n\t* Backslashes are preserved as raw B2 key characters; pass `/` explicitly for slash prefixes.\n\t*/\n\tconstructor(bucket, prefix = \"\") {\n\t\tthis.bucket = bucket;\n\t\tthis.rawPrefix = asRawB2KeyPrefix(prefix);\n\t}\n\t/**\n\t* Lists all file versions in the bucket, groups by name, and yields the latest visible version.\n\t* @param options - Optional scan controls.\n\t*/\n\tasync *scan(options = {}) {\n\t\tvalidateSyncFilters(options);\n\t\tconst maxScanEntries = scanEntryLimit(options);\n\t\tconst grouped = /* @__PURE__ */ new Map();\n\t\tconst listPrefix = this.listPrefixFor(options);\n\t\tlet listedVersions = 0;\n\t\tlet startFileName;\n\t\tlet startFileId;\n\t\tlet emptyPageCount = 0;\n\t\twhile (true) {\n\t\t\tif (scanIsAborted(options)) return;\n\t\t\tlet listing;\n\t\t\ttry {\n\t\t\t\tlisting = await this.bucket.listFileVersions({\n\t\t\t\t\t...listPrefix !== \"\" ? { prefix: listPrefix } : {},\n\t\t\t\t\t...startFileName !== void 0 ? { startFileName } : {},\n\t\t\t\t\t...startFileId !== void 0 ? { startFileId } : {},\n\t\t\t\t\t...options.signal !== void 0 ? { signal: options.signal } : {}\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\tif (scanIsAborted(options) || isAbortError(err)) return;\n\t\t\t\tthrow emitScanError(options, \"failed to scan B2 file versions\", err);\n\t\t\t}\n\t\t\tif (scanIsAborted(options)) return;\n\t\t\tif (listing.files.length === 0) {\n\t\t\t\temptyPageCount++;\n\t\t\t\tif (emptyPageCount > MAX_EMPTY_B2_SCAN_PAGES) throw emitScanError(options, \"failed to scan B2 file versions\", /* @__PURE__ */ new Error(\"B2 pagination returned too many empty pages\"));\n\t\t\t} else emptyPageCount = 0;\n\t\t\tfor (const fv of listing.files) {\n\t\t\t\tif (scanIsAborted(options)) return;\n\t\t\t\tassertScanEntryLimit(listedVersions + 1, maxScanEntries);\n\t\t\t\tlistedVersions++;\n\t\t\t\tif (this.rawPrefix !== \"\" && !fv.fileName.startsWith(this.rawPrefix)) {\n\t\t\t\t\tthis.emitSkip(options, fv.fileName, fv.fileName, \"outside-prefix\", `listed object is outside configured B2 prefix ${JSON.stringify(this.rawPrefix)}`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (options.requireLocalSafePaths === true && fv.fileName.includes(\"\\\\\")) {\n\t\t\t\t\tthis.emitSkip(options, fv.fileName, fv.fileName, \"local-unsafe-name\", \"object name contains a backslash that is unsafe for local filesystem destinations\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst relativePath = this.tryToRelativePath(fv.fileName);\n\t\t\t\tif (relativePath === null) {\n\t\t\t\t\tthis.emitSkip(options, fv.fileName, fv.fileName, \"unsafe-name\", \"object name cannot be represented as a safe sync relative path\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!pathPassesSyncFilters(relativePath, options)) {\n\t\t\t\t\tif (pathSkippedByRegExpInputLimit(relativePath, options)) emitScannerSkip(options, {\n\t\t\t\t\t\t...regexpInputTooLongSkip(relativePath),\n\t\t\t\t\t\tb2FileName: fv.fileName\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst existing = grouped.get(fv.fileName);\n\t\t\t\tif (existing) existing.versions.push(fv);\n\t\t\t\telse grouped.set(fv.fileName, {\n\t\t\t\t\trelativePath,\n\t\t\t\t\tversions: [fv]\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!listing.nextFileName) break;\n\t\t\tif (listing.nextFileName === startFileName && (listing.nextFileId ?? void 0) === startFileId) throw emitScanError(options, \"failed to scan B2 file versions\", /* @__PURE__ */ new Error(\"B2 pagination did not advance\"));\n\t\t\tstartFileName = listing.nextFileName;\n\t\t\tstartFileId = listing.nextFileId ?? void 0;\n\t\t}\n\t\tconst visible = this.visibleCandidates(grouped, options);\n\t\tconst withoutRelativeCollisions = this.rejectRelativePathCollisions(visible, options);\n\t\tconst sorted = (options.requireLocalSafePaths === true ? this.rejectLocalPathCollisions(withoutRelativeCollisions, options) : withoutRelativeCollisions).sort((a, b) => compareSyncRelativePaths(a.relativePath, b.relativePath) || compareCodeUnits(a.fileName, b.fileName));\n\t\tfor (const { relativePath, versions, selectedVersion } of sorted) {\n\t\t\tif (scanIsAborted(options)) return;\n\t\t\tassertSyncPathAllowed(relativePath);\n\t\t\tconst contentSha1 = selectB2ComparableSha1(selectedVersion);\n\t\t\tyield {\n\t\t\t\trelativePath,\n\t\t\t\tmodTimeMillis: selectedVersion.uploadTimestamp,\n\t\t\t\tsize: selectedVersion.contentLength,\n\t\t\t\tcontentSha1,\n\t\t\t\tcontentSha1State: syncSha1StateOf({ contentSha1 }),\n\t\t\t\tselectedVersion,\n\t\t\t\tallVersions: versions\n\t\t\t};\n\t\t}\n\t}\n\ttryToRelativePath(fileName) {\n\t\ttry {\n\t\t\treturn b2KeyToRelativePathUnderPrefix(this.rawPrefix, fileName);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\tlistPrefixFor(filters) {\n\t\tconst filterPrefix = literalPrefixForSyncFilters(filters);\n\t\tif (filterPrefix === \"\") return this.rawPrefix;\n\t\tif (this.rawPrefix !== \"\" && !this.rawPrefix.endsWith(\"/\")) return this.rawPrefix;\n\t\treturn `${this.rawPrefix}${rawPrefixBeforeNormalizedSeparator(filterPrefix)}`;\n\t}\n\tvisibleCandidates(grouped, filters) {\n\t\tconst visible = [];\n\t\tfor (const [fileName, entry] of grouped) {\n\t\t\tentry.versions.sort((a, b) => b.uploadTimestamp - a.uploadTimestamp);\n\t\t\tconst selected = entry.versions[0];\n\t\t\tif (!selected || selected.action === FileAction.Hide) continue;\n\t\t\tif (filters?.requireLocalSafePaths === true && localFilesystemSyncPathIsUnsafe(entry.relativePath)) {\n\t\t\t\tthis.emitSkip(filters, entry.relativePath, fileName, \"local-unsafe-name\", \"object name is unsafe for a local filesystem destination\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvisible.push({\n\t\t\t\tfileName,\n\t\t\t\trelativePath: entry.relativePath,\n\t\t\t\tversions: entry.versions,\n\t\t\t\tselectedVersion: selected\n\t\t\t});\n\t\t}\n\t\treturn visible;\n\t}\n\trejectRelativePathCollisions(candidates, filters) {\n\t\tconst accepted = [];\n\t\tconst owners = /* @__PURE__ */ new Map();\n\t\tconst collidedRelativePaths = /* @__PURE__ */ new Set();\n\t\tfor (const candidate of candidates) {\n\t\t\tif (collidedRelativePaths.has(candidate.relativePath)) {\n\t\t\t\tthis.emitSkip(filters, candidate.relativePath, candidate.fileName, \"relative-path-collision\", \"object normalizes to a relative path already rejected because of another raw B2 key\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst owner = owners.get(candidate.relativePath);\n\t\t\tif (owner !== void 0 && owner.fileName !== candidate.fileName) {\n\t\t\t\towners.delete(candidate.relativePath);\n\t\t\t\tremoveAcceptedCandidate(accepted, owner);\n\t\t\t\tcollidedRelativePaths.add(candidate.relativePath);\n\t\t\t\tthis.emitSkip(filters, candidate.relativePath, owner.fileName, \"relative-path-collision\", `object normalizes to the same relative path as ${JSON.stringify(candidate.fileName)}`);\n\t\t\t\tthis.emitSkip(filters, candidate.relativePath, candidate.fileName, \"relative-path-collision\", `object normalizes to the same relative path as ${JSON.stringify(owner.fileName)}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\towners.set(candidate.relativePath, candidate);\n\t\t\taccepted.push(candidate);\n\t\t}\n\t\treturn accepted;\n\t}\n\trejectLocalPathCollisions(candidates, filters) {\n\t\tconst accepted = [];\n\t\tconst owners = /* @__PURE__ */ new Map();\n\t\tconst collidedLocalPaths = /* @__PURE__ */ new Set();\n\t\tfor (const candidate of candidates) {\n\t\t\tconst canonicalPath = localFilesystemCanonicalSyncPath(candidate.relativePath);\n\t\t\tif (collidedLocalPaths.has(canonicalPath)) {\n\t\t\t\tthis.emitSkip(filters, candidate.relativePath, candidate.fileName, \"local-path-collision\", \"object collides with another object on case-insensitive or Unicode-normalizing filesystems\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst owner = owners.get(canonicalPath);\n\t\t\tif (owner !== void 0) {\n\t\t\t\towners.delete(canonicalPath);\n\t\t\t\tremoveAcceptedCandidate(accepted, owner);\n\t\t\t\tcollidedLocalPaths.add(canonicalPath);\n\t\t\t\tthis.emitSkip(filters, owner.relativePath, owner.fileName, \"local-path-collision\", `object collides with ${JSON.stringify(candidate.fileName)} on local filesystems`);\n\t\t\t\tthis.emitSkip(filters, candidate.relativePath, candidate.fileName, \"local-path-collision\", `object collides with ${JSON.stringify(owner.fileName)} on local filesystems`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\towners.set(canonicalPath, candidate);\n\t\t\taccepted.push(candidate);\n\t\t}\n\t\treturn accepted;\n\t}\n\temitSkip(filters, path, b2FileName, reason, message) {\n\t\temitScannerSkip(filters, {\n\t\t\ttype: \"skip\",\n\t\t\tpath,\n\t\t\tsize: 0,\n\t\t\tmessage: `Skipped B2 object ${JSON.stringify(b2FileName)}: ${message}`,\n\t\t\treason,\n\t\t\tb2FileName\n\t\t});\n\t}\n};\nfunction rawPrefixBeforeNormalizedSeparator(filterPrefix) {\n\tconst separatorIndex = filterPrefix.indexOf(\"/\");\n\treturn separatorIndex === -1 ? filterPrefix : filterPrefix.slice(0, separatorIndex);\n}\nfunction emitScanError(options, message, err) {\n\tconst event = {\n\t\ttype: \"error\",\n\t\tpath: \"\",\n\t\tsize: 0,\n\t\tmessage: `${message}: ${sanitizeErrorReason(err)}`\n\t};\n\toptions.onError?.(event);\n\treturn new Error(event.message);\n}\nfunction removeAcceptedCandidate(candidates, target) {\n\tconst index = candidates.indexOf(target);\n\tif (index !== -1) candidates.splice(index, 1);\n}\nfunction scanIsAborted(filters) {\n\treturn filters?.signal?.aborted === true;\n}\n//#endregion\nexport { B2Folder };\n\n//# sourceMappingURL=b2.js.map","import { lstat, mkdir, realpath } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport type {\n CompareMode,\n KeepMode,\n SyncEvent,\n SynchronizerDownConfig,\n SynchronizerUpConfig,\n} from '@backblaze-labs/b2-sdk/sync'\nimport { B2Folder, LocalFolder, synchronize } from '@backblaze-labs/b2-sdk/sync'\nimport { tryStat } from '../fs.ts'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/**\n * Mutable counter bag fed by {@link processSyncEvent} as the action consumes\n * the SDK's `synchronize()` event stream. Exposed alongside the processor so\n * unit tests can drive each SyncEvent variant deterministically (notably the\n * `copy-start` / `copy-done` events that only fire in b2-to-b2 sync, which\n * the action's input surface doesn't currently expose).\n */\nexport interface SyncEventCounters {\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files removed (delete-remote, delete-local, or hide). */\n deleted: number\n /** Count of files left unchanged. */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred (upload + download). */\n bytesTransferred: number\n}\n\n/**\n * Apply one `SyncEvent` from the SDK's `synchronize()` stream to the running\n * counters and emit the corresponding log line. The action's `syncCommand`\n * calls this in a loop; the function is exported (and the {@link SyncEventCounters}\n * type with it) so tests can exercise every event variant independently,\n * including the `copy-*` events that require b2-to-b2 sync to fire from the\n * real engine.\n *\n * Informational lifecycle events (`upload-start`, `compare`, etc.) are\n * deliberate no-ops; listing them explicitly keeps the switch exhaustive\n * so TypeScript errors if the SDK adds a new variant.\n */\nexport function processSyncEvent(event: SyncEvent, counters: SyncEventCounters): void {\n switch (event.type) {\n case 'upload-done':\n counters.uploaded++\n counters.bytesTransferred += event.size\n core.info(` ↑ ${event.path} (${event.size}B)`)\n return\n case 'download-done':\n counters.downloaded++\n counters.bytesTransferred += event.size\n core.info(` ↓ ${event.path} (${event.size}B)`)\n return\n case 'delete-remote':\n counters.deleted++\n core.info(` − ${event.path}`)\n return\n case 'delete-local':\n counters.deleted++\n core.info(` − (local) ${event.path}`)\n return\n case 'hide':\n counters.deleted++\n core.info(` ⌀ ${event.path} (hidden)`)\n return\n case 'skip':\n counters.skipped++\n return\n case 'error':\n counters.errors++\n core.warning(` ! ${event.path}: ${event.message}`)\n return\n case 'upload-start':\n case 'compare':\n case 'download-start':\n case 'copy-start':\n case 'copy-done':\n return\n }\n}\n\n/**\n * Build a one-line summary of the first few sync errors for the dispatcher's\n * top-level failure message. Without this, a sync that fails on three files\n * surfaces only `Sync completed with 3 error(s)` to the user, who then has to\n * dig into the (possibly collapsed) per-file warnings or parse `summary-json`.\n * Including a sample makes the failure message itself diagnose-able.\n */\nexport function summarizeSyncErrors(events: SyncEvent[], limit = 3): string {\n const errors = events.filter(\n (e): e is Extract => e.type === 'error',\n )\n if (errors.length === 0) return ''\n const head = errors\n .slice(0, limit)\n .map((e) => `${e.path}: ${e.message}`)\n .join('; ')\n const tail = errors.length > limit ? `; +${errors.length - limit} more` : ''\n return `${head}${tail}`\n}\n\n/** Result of {@link syncCommand}: per-event log plus aggregate counters. */\nexport interface SyncResult {\n /** Per-file events emitted by the SDK's `synchronize()` (upload-done, download-done, skip, delete-*, hide, error). */\n events: SyncEvent[]\n /** Resolved direction of this sync (after `auto` resolution). */\n direction: 'local-to-b2' | 'b2-to-local'\n /** Count of files uploaded. */\n uploaded: number\n /** Count of files downloaded. */\n downloaded: number\n /** Count of files deleted/hidden across both sides. */\n deleted: number\n /** Count of files left unchanged (already in sync). */\n skipped: number\n /** Count of per-file errors. */\n errors: number\n /** Total bytes transferred across both directions. */\n bytesTransferred: number\n}\n\n/**\n * Sync a local directory to / from a B2 bucket prefix.\n *\n * Direction is determined by the `direction` input (`up` = local → B2,\n * `down` = B2 → local). With `direction: auto` (the default) we infer:\n * - if `source` is an existing local directory → `up`\n * - otherwise → `down` (source is a B2 prefix, destination is local)\n *\n * The SDK's {@link synchronize} returns an `AsyncGenerator` which we\n * relay to the workflow log (per-file) and aggregate into a typed result.\n */\nexport async function syncCommand(\n bucket: Bucket,\n inputs: ParsedInputs,\n signal?: AbortSignal,\n): Promise {\n const source = requireSource(inputs.source, 'sync', 'a local directory (up) or B2 prefix (down)')\n\n const direction = await resolveDirection(inputs.syncDirection, source)\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n\n const config = await buildConfig(bucket, source, inputs, direction, signal)\n\n core.startGroup(\n `sync ${direction === 'local-to-b2' ? source : `b2://${bucket.name}/${source}`} ` +\n `→ ${direction === 'local-to-b2' ? `b2://${bucket.name}/${inputs.destination ?? ''}` : (inputs.destination ?? '.')} ` +\n `(compare=${compareMode}, keep=${keepMode}${dryRun ? ', dry-run' : ''})`,\n )\n\n const events: SyncEvent[] = []\n const counters: SyncEventCounters = {\n uploaded: 0,\n downloaded: 0,\n deleted: 0,\n skipped: 0,\n errors: 0,\n bytesTransferred: 0,\n }\n\n try {\n for await (const event of synchronize(config)) {\n events.push(event)\n processSyncEvent(event, counters)\n }\n } finally {\n core.endGroup()\n }\n\n const { uploaded, downloaded, deleted, skipped, errors, bytesTransferred } = counters\n\n core.info(\n `sync done [${direction}]: ${uploaded} uploaded, ${downloaded} downloaded, ${deleted} removed, ${skipped} unchanged, ${errors} errors`,\n )\n\n return {\n events,\n direction,\n uploaded,\n downloaded,\n deleted,\n skipped,\n errors,\n bytesTransferred,\n }\n}\n\nasync function resolveDirection(\n requested: 'up' | 'down' | 'auto',\n source: string,\n): Promise<'local-to-b2' | 'b2-to-local'> {\n if (requested === 'up') return 'local-to-b2'\n if (requested === 'down') return 'b2-to-local'\n const localStat = await tryStat(source)\n return localStat?.isDirectory() ? 'local-to-b2' : 'b2-to-local'\n}\n\nasync function buildConfig(\n bucket: Bucket,\n source: string,\n inputs: ParsedInputs,\n direction: 'local-to-b2' | 'b2-to-local',\n signal?: AbortSignal,\n): Promise {\n const compareMode = inputs.compareMode\n const keepMode = inputs.keepMode\n const dryRun = inputs.dryRun\n const concurrency = inputs.concurrency\n const options = {\n compareMode,\n keepMode,\n concurrency,\n dryRun,\n ...(signal !== undefined ? { signal } : {}),\n }\n\n if (direction === 'local-to-b2') {\n const stats = await tryStat(source)\n if (!stats?.isDirectory()) {\n throw new Error(`'sync' up requires 'source' to be an existing local directory: ${source}`)\n }\n const prefix = (inputs.destination ?? '').replace(/^\\/+|\\/+$/g, '')\n return {\n source: new LocalFolder(resolve(source)),\n dest: new B2Folder(bucket, prefix === '' ? '' : `${prefix}/`),\n bucket,\n prefix: prefix === '' ? '' : `${prefix}/`,\n options,\n }\n }\n\n const remotePrefix = source.replace(/^\\/+|\\/+$/g, '')\n const localDest = inputs.destination ?? '.'\n const localRoot = await prepareLocalDestinationRoot(localDest)\n return {\n source: new B2Folder(bucket, remotePrefix === '' ? '' : `${remotePrefix}/`),\n dest: new LocalFolder(localRoot),\n bucket,\n options,\n }\n}\n\nasync function prepareLocalDestinationRoot(localDest: string): Promise {\n const resolved = resolve(localDest)\n await mkdir(resolved, { recursive: true })\n const stats = await lstat(resolved)\n if (stats.isSymbolicLink()) return resolved\n return realpath(resolved)\n}\n\nexport type { CompareMode, KeepMode }\n","import * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link unhideCommand}. */\nexport interface UnhideResult {\n /** B2 file name that was unhidden. */\n fileName: string\n /** File ID of the removed hide marker, or `null` if there was nothing hidden. */\n removedMarkerFileId: string | null\n}\n\n/**\n * Restore visibility of a file previously hidden by the `hide` command.\n *\n * Wraps the SDK's {@link Bucket.unhideFile}, which finds the most recent hide\n * marker for the file name and deletes it. If the file is already visible\n * (or never existed), no-ops and reports `removedMarkerFileId: null`.\n *\n * B2 has no native `b2_unhide_file` endpoint; the SDK implements unhide as\n * \"list versions → delete the top hide marker\", which is the canonical\n * recipe. We expose it here so workflow authors don't have to know that.\n */\nexport async function unhideCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n const source = requireSource(inputs.source, 'unhide', 'the B2 file name')\n\n core.startGroup(`unhide b2://${bucket.name}/${source}`)\n try {\n const marker = await bucket.unhideFile(source)\n if (marker === null) {\n core.info(` no hide marker found for ${source} (already visible or non-existent)`)\n return { fileName: source, removedMarkerFileId: null }\n }\n core.info(` removed hide marker fileId=${marker.fileId}, ${source} is now visible`)\n return { fileName: source, removedMarkerFileId: marker.fileId }\n } finally {\n core.endGroup()\n }\n}\n","import * as core from '@actions/core';\n/**\n * Returns a copy with defaults filled in.\n */\nexport function getOptions(copy) {\n const result = {\n followSymbolicLinks: true,\n implicitDescendants: true,\n matchDirectories: true,\n omitBrokenSymbolicLinks: true,\n excludeHiddenFiles: false\n };\n if (copy) {\n if (typeof copy.followSymbolicLinks === 'boolean') {\n result.followSymbolicLinks = copy.followSymbolicLinks;\n core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);\n }\n if (typeof copy.implicitDescendants === 'boolean') {\n result.implicitDescendants = copy.implicitDescendants;\n core.debug(`implicitDescendants '${result.implicitDescendants}'`);\n }\n if (typeof copy.matchDirectories === 'boolean') {\n result.matchDirectories = copy.matchDirectories;\n core.debug(`matchDirectories '${result.matchDirectories}'`);\n }\n if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {\n result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;\n core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);\n }\n if (typeof copy.excludeHiddenFiles === 'boolean') {\n result.excludeHiddenFiles = copy.excludeHiddenFiles;\n core.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`);\n }\n }\n return result;\n}\n//# sourceMappingURL=internal-glob-options-helper.js.map","import * as path from 'path';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.\n *\n * For example, on Linux/macOS:\n * - `/ => /`\n * - `/hello => /`\n *\n * For example, on Windows:\n * - `C:\\ => C:\\`\n * - `C:\\hello => C:\\`\n * - `C: => C:`\n * - `C:hello => C:`\n * - `\\ => \\`\n * - `\\hello => \\`\n * - `\\\\hello => \\\\hello`\n * - `\\\\hello\\world => \\\\hello\\world`\n */\nexport function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}\n/**\n * Roots the path if not already rooted. On Windows, relative roots like `\\`\n * or `C:` are expanded based on the current working directory.\n */\nexport function ensureAbsoluteRoot(root, itemPath) {\n assert(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);\n assert(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Already rooted\n if (hasAbsoluteRoot(itemPath)) {\n return itemPath;\n }\n // Windows\n if (IS_WINDOWS) {\n // Check for itemPath like C: or C:foo\n if (itemPath.match(/^[A-Z]:[^\\\\/]|^[A-Z]:$/i)) {\n let cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n // Drive letter matches cwd? Expand to cwd\n if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {\n // Drive only, e.g. C:\n if (itemPath.length === 2) {\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}`;\n }\n // Drive + path, e.g. C:foo\n else {\n if (!cwd.endsWith('\\\\')) {\n cwd += '\\\\';\n }\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}${itemPath.substr(2)}`;\n }\n }\n // Different drive\n else {\n return `${itemPath[0]}:\\\\${itemPath.substr(2)}`;\n }\n }\n // Check for itemPath like \\ or \\foo\n else if (normalizeSeparators(itemPath).match(/^\\\\$|^\\\\[^\\\\]/)) {\n const cwd = process.cwd();\n assert(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n return `${cwd[0]}:\\\\${itemPath.substr(1)}`;\n }\n }\n assert(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);\n // Otherwise ensure root ends with a separator\n if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\\\'))) {\n // Intentionally empty\n }\n else {\n // Append separator\n root += path.sep;\n }\n return root + itemPath;\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\\\hello\\share` and `C:\\hello` (and using alternate separator).\n */\nexport function hasAbsoluteRoot(itemPath) {\n assert(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\\\hello\\share or C:\\hello\n return itemPath.startsWith('\\\\\\\\') || /^[A-Z]:\\\\/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\`, `\\hello`, `\\\\hello\\share`, `C:`, and `C:\\hello` (and using alternate separator).\n */\nexport function hasRoot(itemPath) {\n assert(itemPath, `isRooted parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\ or \\hello or \\\\hello\n // E.g. C: or C:\\hello\n return itemPath.startsWith('\\\\') || /^[A-Z]:/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\n/**\n * Removes redundant slashes and converts `/` to `\\` on Windows\n */\nexport function normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n/**\n * Normalizes the path separators and trims the trailing separator (when safe).\n * For example, `/foo/ => /foo` but `/ => /`\n */\nexport function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}\n//# sourceMappingURL=internal-path-helper.js.map","/**\n * Indicates whether a pattern matches a path\n */\nexport var MatchKind;\n(function (MatchKind) {\n /** Not matched */\n MatchKind[MatchKind[\"None\"] = 0] = \"None\";\n /** Matched if the path is a directory */\n MatchKind[MatchKind[\"Directory\"] = 1] = \"Directory\";\n /** Matched if the path is a regular file */\n MatchKind[MatchKind[\"File\"] = 2] = \"File\";\n /** Matched */\n MatchKind[MatchKind[\"All\"] = 3] = \"All\";\n})(MatchKind || (MatchKind = {}));\n//# sourceMappingURL=internal-match-kind.js.map","import * as pathHelper from './internal-path-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Given an array of patterns, returns an array of paths to search.\n * Duplicates and paths under other included paths are filtered out.\n */\nexport function getSearchPaths(patterns) {\n // Ignore negate patterns\n patterns = patterns.filter(x => !x.negate);\n // Create a map of all search paths\n const searchPathMap = {};\n for (const pattern of patterns) {\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n searchPathMap[key] = 'candidate';\n }\n const result = [];\n for (const pattern of patterns) {\n // Check if already included\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n if (searchPathMap[key] === 'included') {\n continue;\n }\n // Check for an ancestor search path\n let foundAncestor = false;\n let tempKey = key;\n let parent = pathHelper.dirname(tempKey);\n while (parent !== tempKey) {\n if (searchPathMap[parent]) {\n foundAncestor = true;\n break;\n }\n tempKey = parent;\n parent = pathHelper.dirname(tempKey);\n }\n // Include the search pattern in the result\n if (!foundAncestor) {\n result.push(pattern.searchPath);\n searchPathMap[key] = 'included';\n }\n }\n return result;\n}\n/**\n * Matches the patterns against the path\n */\nexport function match(patterns, itemPath) {\n let result = MatchKind.None;\n for (const pattern of patterns) {\n if (pattern.negate) {\n result &= ~pattern.match(itemPath);\n }\n else {\n result |= pattern.match(itemPath);\n }\n }\n return result;\n}\n/**\n * Checks whether to descend further into the directory\n */\nexport function partialMatch(patterns, itemPath) {\n return patterns.some(x => !x.negate && x.partialMatch(itemPath));\n}\n//# sourceMappingURL=internal-pattern-helper.js.map","export const balanced = (a, b, str) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a;\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b;\n const r = ma !== null && mb != null && range(ma, mb, str);\n return (r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n });\n};\nconst maybeMatch = (reg, str) => {\n const m = str.match(reg);\n return m ? m[0] : null;\n};\nexport const range = (a, b, str) => {\n let begs, beg, left, right = undefined, result;\n let ai = str.indexOf(a);\n let bi = str.indexOf(b, ai + 1);\n let i = ai;\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n }\n else if (begs.length === 1) {\n const r = begs.pop();\n if (r !== undefined)\n result = [r, bi];\n }\n else {\n beg = begs.pop();\n if (beg !== undefined && beg < left) {\n left = beg;\n right = bi;\n }\n bi = str.indexOf(b, i + 1);\n }\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n if (begs.length && right !== undefined) {\n result = [left, right];\n }\n }\n return result;\n};\n//# sourceMappingURL=index.js.map","import { balanced } from 'balanced-match';\nconst escSlash = '\\0SLASH' + Math.random() + '\\0';\nconst escOpen = '\\0OPEN' + Math.random() + '\\0';\nconst escClose = '\\0CLOSE' + Math.random() + '\\0';\nconst escComma = '\\0COMMA' + Math.random() + '\\0';\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0';\nconst escSlashPattern = new RegExp(escSlash, 'g');\nconst escOpenPattern = new RegExp(escOpen, 'g');\nconst escClosePattern = new RegExp(escClose, 'g');\nconst escCommaPattern = new RegExp(escComma, 'g');\nconst escPeriodPattern = new RegExp(escPeriod, 'g');\nconst slashPattern = /\\\\\\\\/g;\nconst openPattern = /\\\\{/g;\nconst closePattern = /\\\\}/g;\nconst commaPattern = /\\\\,/g;\nconst periodPattern = /\\\\\\./g;\nexport const EXPANSION_MAX = 100_000;\nfunction numeric(str) {\n return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);\n}\nfunction escapeBraces(str) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod);\n}\nfunction unescapeBraces(str) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.');\n}\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str) {\n if (!str) {\n return [''];\n }\n const parts = [];\n const m = balanced('{', '}', str);\n if (!m) {\n return str.split(',');\n }\n const { pre, body, post } = m;\n const p = pre.split(',');\n p[p.length - 1] += '{' + body + '}';\n const postParts = parseCommaParts(post);\n if (post.length) {\n ;\n p[p.length - 1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n parts.push.apply(parts, p);\n return parts;\n}\nexport function expand(str, options = {}) {\n if (!str) {\n return [];\n }\n const { max = EXPANSION_MAX } = options;\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2);\n }\n return expand_(escapeBraces(str), max, true).map(unescapeBraces);\n}\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\nfunction expand_(str, max, isTop) {\n /** @type {string[]} */\n const expansions = [];\n const m = balanced('{', '}', str);\n if (!m)\n return [str];\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre;\n const post = m.post.length ? expand_(m.post, max, false) : [''];\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k];\n expansions.push(expansion);\n }\n }\n else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n const isSequence = isNumericSequence || isAlphaSequence;\n const isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand_(str, max, true);\n }\n return [str];\n }\n let n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n }\n else {\n n = parseCommaParts(m.body);\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace);\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p);\n }\n /* c8 ignore stop */\n }\n }\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N;\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0]);\n const y = numeric(n[1]);\n const width = Math.max(n[0].length, n[1].length);\n let incr = n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n let test = lte;\n const reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n const pad = n.some(isPadded);\n N = [];\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\') {\n c = '';\n }\n }\n else {\n c = String(i);\n if (pad) {\n const need = width - c.length;\n if (need > 0) {\n const z = new Array(need + 1).join('0');\n if (i < 0) {\n c = '-' + z + c.slice(1);\n }\n else {\n c = z + c;\n }\n }\n }\n }\n N.push(c);\n }\n }\n else {\n N = [];\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j], max, false));\n }\n }\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion);\n }\n }\n }\n }\n return expansions;\n}\n//# sourceMappingURL=index.js.map","const MAX_PATTERN_LENGTH = 1024 * 64;\nexport const assertValidPattern = (pattern) => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern');\n }\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long');\n }\n};\n//# sourceMappingURL=assert-valid-pattern.js.map","// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n// { : [, /u flag required, negated]\nconst posixClasses = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n};\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s) => s.replace(/[[\\]\\\\-]/g, '\\\\$&');\n// escape all regexp magic characters\nconst regexpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges) => ranges.join('');\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (glob, position) => {\n const pos = position;\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression');\n }\n /* c8 ignore stop */\n const ranges = [];\n const negs = [];\n let i = pos + 1;\n let sawStart = false;\n let uflag = false;\n let escaping = false;\n let negate = false;\n let endPos = pos;\n let rangeStart = '';\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i);\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true;\n i++;\n continue;\n }\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1;\n break;\n }\n sawStart = true;\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true;\n i++;\n continue;\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true];\n }\n i += cls.length;\n if (neg)\n negs.push(unip);\n else\n ranges.push(unip);\n uflag = uflag || u;\n continue WHILE;\n }\n }\n }\n // now it's just a normal character, effectively\n escaping = false;\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));\n }\n else if (c === rangeStart) {\n ranges.push(braceEscape(c));\n }\n rangeStart = '';\n i++;\n continue;\n }\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'));\n i += 2;\n continue;\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c;\n i += 2;\n continue;\n }\n // not the start of a range, just a single character\n ranges.push(braceEscape(c));\n i++;\n }\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false];\n }\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true];\n }\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];\n return [regexpEscape(r), false, endPos - pos, false];\n }\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';\n const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs;\n return [comb, uflag, endPos - pos, true];\n};\n//# sourceMappingURL=brace-expressions.js.map","/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\nexport const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1');\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1');\n};\n//# sourceMappingURL=unescape.js.map","// parse a single path portion\nvar _a;\nimport { parseClass } from './brace-expressions.js';\nimport { unescape } from './unescape.js';\nconst types = new Set(['!', '?', '+', '*', '@']);\nconst isExtglobType = (c) => types.has(c);\nconst isExtglobAST = (c) => isExtglobType(c.type);\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n]);\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n]);\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n]);\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n]);\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))';\nconst startNoDot = '(?!\\\\.)';\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.']);\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.']);\nconst reSpecials = new Set('().*{}+?[]^$\\\\!');\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// any single thing other than /\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?';\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\nlet ID = 0;\nexport class AST {\n type;\n #root;\n #hasMagic;\n #uflag = false;\n #parts = [];\n #parent;\n #parentIndex;\n #negs;\n #filledNegs = false;\n #options;\n #toString;\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt = false;\n id = ++ID;\n get depth() {\n return (this.#parent?.depth ?? -1) + 1;\n }\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n };\n }\n constructor(type, parent, options = {}) {\n this.type = type;\n // extglobs are inherently magical\n if (type)\n this.#hasMagic = true;\n this.#parent = parent;\n this.#root = this.#parent ? this.#parent.#root : this;\n this.#options = this.#root === this ? options : this.#root.#options;\n this.#negs = this.#root === this ? [] : this.#root.#negs;\n if (type === '!' && !this.#root.#filledNegs)\n this.#negs.push(this);\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;\n }\n get hasMagic() {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined)\n return this.#hasMagic;\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string')\n continue;\n if (p.type || p.hasMagic)\n return (this.#hasMagic = true);\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic;\n }\n // reconstructs the pattern\n toString() {\n return (this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')'));\n }\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root)\n throw new Error('should only call on root');\n if (this.#filledNegs)\n return this;\n /* c8 ignore stop */\n // call toString() once to fill this out\n this.toString();\n this.#filledNegs = true;\n let n;\n while ((n = this.#negs.pop())) {\n if (n.type !== '!')\n continue;\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p = n;\n let pp = p.#parent;\n while (pp) {\n for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??');\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i]);\n }\n }\n p = pp;\n pp = p.#parent;\n }\n }\n return this;\n }\n push(...parts) {\n for (const p of parts) {\n if (p === '')\n continue;\n /* c8 ignore start */\n if (typeof p !== 'string' &&\n !(p instanceof _a && p.#parent === this)) {\n throw new Error('invalid part: ' + p);\n }\n /* c8 ignore stop */\n this.#parts.push(p);\n }\n }\n toJSON() {\n const ret = this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => p.toJSON())];\n if (this.isStart() && !this.type)\n ret.unshift([]);\n if (this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))) {\n ret.push({});\n }\n return ret;\n }\n isStart() {\n if (this.#root === this)\n return true;\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart())\n return false;\n if (this.#parentIndex === 0)\n return true;\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent;\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i];\n if (!(pp instanceof _a && pp.type === '!')) {\n return false;\n }\n }\n return true;\n }\n isEnd() {\n if (this.#root === this)\n return true;\n if (this.#parent?.type === '!')\n return true;\n if (!this.#parent?.isEnd())\n return false;\n if (!this.type)\n return this.#parent?.isEnd();\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0;\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1;\n }\n copyIn(part) {\n if (typeof part === 'string')\n this.push(part);\n else\n this.push(part.clone(this));\n }\n clone(parent) {\n const c = new _a(this.type, parent);\n for (const p of this.#parts) {\n c.copyIn(p);\n }\n return c;\n }\n static #parseAST(str, ast, pos, opt, extDepth) {\n const maxDepth = opt.maxExtglobRecursion ?? 2;\n let escaping = false;\n let inBrace = false;\n let braceStart = -1;\n let braceNeg = false;\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos;\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth;\n if (doRecurse) {\n ast.push(acc);\n acc = '';\n const ext = new _a(c, ast);\n i = _a.#parseAST(str, ext, i, opt, extDepth + 1);\n ast.push(ext);\n continue;\n }\n acc += c;\n }\n ast.push(acc);\n return i;\n }\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1;\n let part = new _a(null, ast);\n const parts = [];\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;\n part.push(acc);\n acc = '';\n const ext = new _a(c, part);\n part.push(ext);\n i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);\n continue;\n }\n if (c === '|') {\n part.push(acc);\n acc = '';\n parts.push(part);\n part = new _a(null, ast);\n continue;\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true;\n }\n part.push(acc);\n acc = '';\n ast.push(...parts, part);\n return i;\n }\n acc += c;\n }\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null;\n ast.#hasMagic = undefined;\n ast.#parts = [str.substring(pos - 1)];\n return i;\n }\n #canAdoptWithSpace(child) {\n return this.#canAdopt(child, adoptionWithSpaceMap);\n }\n #canAdopt(child, map = adoptionMap) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canAdoptType(gc.type, map);\n }\n #canAdoptType(c, map = adoptionAnyMap) {\n return !!map.get(this.type)?.includes(c);\n }\n #adoptWithSpace(child, index) {\n const gc = child.#parts[0];\n const blank = new _a(null, gc, this.options);\n blank.#parts.push('');\n gc.push(blank);\n this.#adopt(child, index);\n }\n #adopt(child, index) {\n const gc = child.#parts[0];\n this.#parts.splice(index, 1, ...gc.#parts);\n for (const p of gc.#parts) {\n if (typeof p === 'object')\n p.#parent = this;\n }\n this.#toString = undefined;\n }\n #canUsurpType(c) {\n const m = usurpMap.get(this.type);\n return !!m?.has(c);\n }\n #canUsurp(child) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canUsurpType(gc.type);\n }\n #usurp(child) {\n const m = usurpMap.get(this.type);\n const gc = child.#parts[0];\n const nt = m?.get(gc.type);\n /* c8 ignore start - impossible */\n if (!nt)\n return false;\n /* c8 ignore stop */\n this.#parts = gc.#parts;\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this;\n }\n }\n this.type = nt;\n this.#toString = undefined;\n this.#emptyExt = false;\n }\n static fromGlob(pattern, options = {}) {\n const ast = new _a(null, undefined, options);\n _a.#parseAST(pattern, ast, 0, options, 0);\n return ast;\n }\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern() {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root)\n return this.#root.toMMPattern();\n /* c8 ignore stop */\n const glob = this.toString();\n const [re, body, hasMagic, uflag] = this.toRegExpSource();\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic = hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase());\n if (!anyMagic) {\n return body;\n }\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n });\n }\n get options() {\n return this.#options;\n }\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(allowDot) {\n const dot = allowDot ?? !!this.#options.dot;\n if (this.#root === this) {\n this.#flatten();\n this.#fillNegs();\n }\n if (!isExtglobAST(this)) {\n const noEmpty = this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string');\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] = typeof p === 'string' ?\n _a.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot);\n this.#hasMagic = this.#hasMagic || hasMagic;\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .join('');\n let start = '';\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);\n if (!dotTravAllowed) {\n const aps = addPatternStart;\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav = \n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)));\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : '';\n }\n }\n }\n // append the \"end of path portion\" pattern to negation tails\n let end = '';\n if (this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!') {\n end = '(?:$|\\\\/)';\n }\n const final = start + src + end;\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n const repeated = this.type === '*' || this.type === '+';\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:';\n let body = this.#partsToRegExp(dot);\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString();\n const me = this;\n me.#parts = [s];\n me.type = null;\n me.#hasMagic = undefined;\n return [s, unescape(this.toString()), false, false];\n }\n let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true);\n if (bodyDotAllowed === body) {\n bodyDotAllowed = '';\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`;\n }\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = '';\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;\n }\n else {\n const close = this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`;\n final = start + body + close;\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten();\n }\n }\n }\n else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0;\n let done = false;\n do {\n done = true;\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i];\n if (typeof c === 'object') {\n c.#flatten();\n if (this.#canAdopt(c)) {\n done = false;\n this.#adopt(c, i);\n }\n else if (this.#canAdoptWithSpace(c)) {\n done = false;\n this.#adoptWithSpace(c, i);\n }\n else if (this.#canUsurp(c)) {\n done = false;\n this.#usurp(c);\n }\n }\n }\n } while (!done && ++iterations < 10);\n }\n this.#toString = undefined;\n }\n #partsToRegExp(dot) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??');\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|');\n }\n static #parseGlob(glob, hasMagic, noEmpty = false) {\n let escaping = false;\n let re = '';\n let uflag = false;\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false;\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i);\n if (escaping) {\n escaping = false;\n re += (reSpecials.has(c) ? '\\\\' : '') + c;\n continue;\n }\n if (c === '*') {\n if (inStar)\n continue;\n inStar = true;\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;\n hasMagic = true;\n continue;\n }\n else {\n inStar = false;\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\';\n }\n else {\n escaping = true;\n }\n continue;\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i);\n if (consumed) {\n re += src;\n uflag = uflag || needUflag;\n i += consumed - 1;\n hasMagic = hasMagic || magic;\n continue;\n }\n }\n if (c === '?') {\n re += qmark;\n hasMagic = true;\n continue;\n }\n re += regExpEscape(c);\n }\n return [re, unescape(glob), !!hasMagic, uflag];\n }\n}\n_a = AST;\n//# sourceMappingURL=ast.js.map","/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&');\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&');\n};\n//# sourceMappingURL=escape.js.map","import { expand } from 'brace-expansion';\nimport { assertValidPattern } from './assert-valid-pattern.js';\nimport { AST } from './ast.js';\nimport { escape } from './escape.js';\nimport { unescape } from './unescape.js';\nexport const minimatch = (p, pattern, options = {}) => {\n assertValidPattern(pattern);\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false;\n }\n return new Minimatch(pattern, options).match(p);\n};\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/;\nconst starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);\nconst starDotExtTestDot = (ext) => (f) => f.endsWith(ext);\nconst starDotExtTestNocase = (ext) => {\n ext = ext.toLowerCase();\n return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);\n};\nconst starDotExtTestNocaseDot = (ext) => {\n ext = ext.toLowerCase();\n return (f) => f.toLowerCase().endsWith(ext);\n};\nconst starDotStarRE = /^\\*+\\.\\*+$/;\nconst starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');\nconst starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');\nconst dotStarRE = /^\\.\\*+$/;\nconst dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');\nconst starRE = /^\\*+$/;\nconst starTest = (f) => f.length !== 0 && !f.startsWith('.');\nconst starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/;\nconst qmarksTestNocase = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestNocaseDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTest = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTestNoExt = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && !f.startsWith('.');\n};\nconst qmarksTestNoExtDot = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && f !== '.' && f !== '..';\n};\n/* c8 ignore start */\nconst defaultPlatform = (typeof process === 'object' && process ?\n (typeof process.env === 'object' &&\n process.env &&\n process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n process.platform\n : 'posix');\nconst path = {\n win32: { sep: '\\\\' },\n posix: { sep: '/' },\n};\n/* c8 ignore stop */\nexport const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;\nminimatch.sep = sep;\nexport const GLOBSTAR = Symbol('globstar **');\nminimatch.GLOBSTAR = GLOBSTAR;\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?';\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?';\nexport const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);\nminimatch.filter = filter;\nconst ext = (a, b = {}) => Object.assign({}, a, b);\nexport const defaults = (def) => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch;\n }\n const orig = minimatch;\n const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));\n return Object.assign(m, {\n Minimatch: class Minimatch extends orig.Minimatch {\n constructor(pattern, options = {}) {\n super(pattern, ext(def, options));\n }\n static defaults(options) {\n return orig.defaults(ext(def, options)).Minimatch;\n }\n },\n AST: class AST extends orig.AST {\n /* c8 ignore start */\n constructor(type, parent, options = {}) {\n super(type, parent, ext(def, options));\n }\n /* c8 ignore stop */\n static fromGlob(pattern, options = {}) {\n return orig.AST.fromGlob(pattern, ext(def, options));\n }\n },\n unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),\n escape: (s, options = {}) => orig.escape(s, ext(def, options)),\n filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),\n defaults: (options) => orig.defaults(ext(def, options)),\n makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),\n braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),\n match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),\n sep: orig.sep,\n GLOBSTAR: GLOBSTAR,\n });\n};\nminimatch.defaults = defaults;\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (pattern, options = {}) => {\n assertValidPattern(pattern);\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern];\n }\n return expand(pattern, { max: options.braceExpandMax });\n};\nminimatch.braceExpand = braceExpand;\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nexport const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();\nminimatch.makeRe = makeRe;\nexport const match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options);\n list = list.filter(f => mm.match(f));\n if (mm.options.nonull && !list.length) {\n list.push(pattern);\n }\n return list;\n};\nminimatch.match = match;\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/;\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\nexport class Minimatch {\n options;\n set;\n pattern;\n windowsPathsNoEscape;\n nonegate;\n negate;\n comment;\n empty;\n preserveMultipleSlashes;\n partial;\n globSet;\n globParts;\n nocase;\n isWindows;\n platform;\n windowsNoMagicRoot;\n maxGlobstarRecursion;\n regexp;\n constructor(pattern, options = {}) {\n assertValidPattern(pattern);\n options = options || {};\n this.options = options;\n this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;\n this.pattern = pattern;\n this.platform = options.platform || defaultPlatform;\n this.isWindows = this.platform === 'win32';\n // avoid the annoying deprecation flag lol\n const awe = ('allowWindow' + 'sEscape');\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options[awe] === false;\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/');\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;\n this.regexp = null;\n this.negate = false;\n this.nonegate = !!options.nonegate;\n this.comment = false;\n this.empty = false;\n this.partial = !!options.partial;\n this.nocase = !!this.options.nocase;\n this.windowsNoMagicRoot =\n options.windowsNoMagicRoot !== undefined ?\n options.windowsNoMagicRoot\n : !!(this.isWindows && this.nocase);\n this.globSet = [];\n this.globParts = [];\n this.set = [];\n // make the set of regexps etc.\n this.make();\n }\n hasMagic() {\n if (this.options.magicalBraces && this.set.length > 1) {\n return true;\n }\n for (const pattern of this.set) {\n for (const part of pattern) {\n if (typeof part !== 'string')\n return true;\n }\n }\n return false;\n }\n debug(..._) { }\n make() {\n const pattern = this.pattern;\n const options = this.options;\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true;\n return;\n }\n if (!pattern) {\n this.empty = true;\n return;\n }\n // step 1: figure out negation, etc.\n this.parseNegate();\n // step 2: expand braces\n this.globSet = [...new Set(this.braceExpand())];\n if (options.debug) {\n //oxlint-disable-next-line no-console\n this.debug = (...args) => console.error(...args);\n }\n this.debug(this.pattern, this.globSet);\n // step 3: now we have a set, so turn each one into a series of\n // path-portion matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n //\n // First, we preprocess to make the glob pattern sets a bit simpler\n // and deduped. There are some perf-killing patterns that can cause\n // problems with a glob walk, but we can simplify them down a bit.\n const rawGlobParts = this.globSet.map(s => this.slashSplit(s));\n this.globParts = this.preprocess(rawGlobParts);\n this.debug(this.pattern, this.globParts);\n // glob --> regexps\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path.\n const isUNC = s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n !globMagic.test(s[3]);\n const isDrive = /^[a-z]:/i.test(s[0]);\n if (isUNC) {\n return [\n ...s.slice(0, 4),\n ...s.slice(4).map(ss => this.parse(ss)),\n ];\n }\n else if (isDrive) {\n return [s[0], ...s.slice(1).map(ss => this.parse(ss))];\n }\n }\n return s.map(ss => this.parse(ss));\n });\n this.debug(this.pattern, set);\n // filter out everything that didn't compile properly.\n this.set = set.filter(s => s.indexOf(false) === -1);\n // do not treat the ? in UNC paths as magic\n if (this.isWindows) {\n for (let i = 0; i < this.set.length; i++) {\n const p = this.set[i];\n if (p[0] === '' &&\n p[1] === '' &&\n this.globParts[i][2] === '?' &&\n typeof p[3] === 'string' &&\n /^[a-z]:$/i.test(p[3])) {\n p[2] = '?';\n }\n }\n }\n this.debug(this.pattern, this.set);\n }\n // various transforms to equivalent pattern sets that are\n // faster to process in a filesystem walk. The goal is to\n // eliminate what we can, and push all ** patterns as far\n // to the right as possible, even if it increases the number\n // of patterns that we have to process.\n preprocess(globParts) {\n // if we're not in globstar mode, then turn ** into *\n if (this.options.noglobstar) {\n for (const partset of globParts) {\n for (let j = 0; j < partset.length; j++) {\n if (partset[j] === '**') {\n partset[j] = '*';\n }\n }\n }\n }\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n // aggressive optimization for the purpose of fs walking\n globParts = this.firstPhasePreProcess(globParts);\n globParts = this.secondPhasePreProcess(globParts);\n }\n else if (optimizationLevel >= 1) {\n // just basic optimizations to remove some .. parts\n globParts = this.levelOneOptimize(globParts);\n }\n else {\n // just collapse multiple ** portions into one\n globParts = this.adjascentGlobstarOptimize(globParts);\n }\n return globParts;\n }\n // just get rid of adjascent ** portions\n adjascentGlobstarOptimize(globParts) {\n return globParts.map(parts => {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let i = gs;\n while (parts[i + 1] === '**') {\n i++;\n }\n if (i !== gs) {\n parts.splice(gs, i - gs);\n }\n }\n return parts;\n });\n }\n // get rid of adjascent ** and resolve .. portions\n levelOneOptimize(globParts) {\n return globParts.map(parts => {\n parts = parts.reduce((set, part) => {\n const prev = set[set.length - 1];\n if (part === '**' && prev === '**') {\n return set;\n }\n if (part === '..') {\n if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n set.pop();\n return set;\n }\n }\n set.push(part);\n return set;\n }, []);\n return parts.length === 0 ? [''] : parts;\n });\n }\n levelTwoFileOptimize(parts) {\n if (!Array.isArray(parts)) {\n parts = this.slashSplit(parts);\n }\n let didSomething = false;\n do {\n didSomething = false;\n //
// -> 
/\n            if (!this.preserveMultipleSlashes) {\n                for (let i = 1; i < parts.length - 1; i++) {\n                    const p = parts[i];\n                    // don't squeeze out UNC patterns\n                    if (i === 1 && p === '' && parts[0] === '')\n                        continue;\n                    if (p === '.' || p === '') {\n                        didSomething = true;\n                        parts.splice(i, 1);\n                        i--;\n                    }\n                }\n                if (parts[0] === '.' &&\n                    parts.length === 2 &&\n                    (parts[1] === '.' || parts[1] === '')) {\n                    didSomething = true;\n                    parts.pop();\n                }\n            }\n            // 
/

/../ ->

/\n            let dd = 0;\n            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                const p = parts[dd - 1];\n                if (p &&\n                    p !== '.' &&\n                    p !== '..' &&\n                    p !== '**' &&\n                    !(this.isWindows && /^[a-z]:$/i.test(p))) {\n                    didSomething = true;\n                    parts.splice(dd - 1, 2);\n                    dd -= 2;\n                }\n            }\n        } while (didSomething);\n        return parts.length === 0 ? [''] : parts;\n    }\n    // First phase: single-pattern processing\n    // 
 is 1 or more portions\n    //  is 1 or more portions\n    // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n    // 
/

/../ ->

/\n    // **/**/ -> **/\n    //\n    // **/*/ -> */**/ <== not valid because ** doesn't follow\n    // this WOULD be allowed if ** did follow symlinks, or * didn't\n    firstPhasePreProcess(globParts) {\n        let didSomething = false;\n        do {\n            didSomething = false;\n            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss = gs;\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n                        gss++;\n                    }\n                    // eg, if gs is 2 and gss is 4, that means we have 3 **\n                    // parts, and can remove 2 of them.\n                    if (gss > gs) {\n                        parts.splice(gs + 1, gss - gs);\n                    }\n                    let next = parts[gs + 1];\n                    const p = parts[gs + 2];\n                    const p2 = parts[gs + 3];\n                    if (next !== '..')\n                        continue;\n                    if (!p ||\n                        p === '.' ||\n                        p === '..' ||\n                        !p2 ||\n                        p2 === '.' ||\n                        p2 === '..') {\n                        continue;\n                    }\n                    didSomething = true;\n                    // edit parts in place, and push the new one\n                    parts.splice(gs, 1);\n                    const other = parts.slice(0);\n                    other[gs] = '**';\n                    globParts.push(other);\n                    gs--;\n                }\n                // 
// -> 
/\n                if (!this.preserveMultipleSlashes) {\n                    for (let i = 1; i < parts.length - 1; i++) {\n                        const p = parts[i];\n                        // don't squeeze out UNC patterns\n                        if (i === 1 && p === '' && parts[0] === '')\n                            continue;\n                        if (p === '.' || p === '') {\n                            didSomething = true;\n                            parts.splice(i, 1);\n                            i--;\n                        }\n                    }\n                    if (parts[0] === '.' &&\n                        parts.length === 2 &&\n                        (parts[1] === '.' || parts[1] === '')) {\n                        didSomething = true;\n                        parts.pop();\n                    }\n                }\n                // 
/

/../ ->

/\n                let dd = 0;\n                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n                    const p = parts[dd - 1];\n                    if (p && p !== '.' && p !== '..' && p !== '**') {\n                        didSomething = true;\n                        const needDot = dd === 1 && parts[dd + 1] === '**';\n                        const splin = needDot ? ['.'] : [];\n                        parts.splice(dd - 1, 2, ...splin);\n                        if (parts.length === 0)\n                            parts.push('');\n                        dd -= 2;\n                    }\n                }\n            }\n        } while (didSomething);\n        return globParts;\n    }\n    // second phase: multi-pattern dedupes\n    // {
/*/,
/

/} ->

/*/\n    // {
/,
/} -> 
/\n    // {
/**/,
/} -> 
/**/\n    //\n    // {
/**/,
/**/

/} ->

/**/\n    // ^-- not valid because ** doens't follow symlinks\n    secondPhasePreProcess(globParts) {\n        for (let i = 0; i < globParts.length - 1; i++) {\n            for (let j = i + 1; j < globParts.length; j++) {\n                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);\n                if (matched) {\n                    globParts[i] = [];\n                    globParts[j] = matched;\n                    break;\n                }\n            }\n        }\n        return globParts.filter(gs => gs.length);\n    }\n    partsMatch(a, b, emptyGSMatch = false) {\n        let ai = 0;\n        let bi = 0;\n        let result = [];\n        let which = '';\n        while (ai < a.length && bi < b.length) {\n            if (a[ai] === b[bi]) {\n                result.push(which === 'b' ? b[bi] : a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n                result.push(a[ai]);\n                ai++;\n            }\n            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n                result.push(b[bi]);\n                bi++;\n            }\n            else if (a[ai] === '*' &&\n                b[bi] &&\n                (this.options.dot || !b[bi].startsWith('.')) &&\n                b[bi] !== '**') {\n                if (which === 'b')\n                    return false;\n                which = 'a';\n                result.push(a[ai]);\n                ai++;\n                bi++;\n            }\n            else if (b[bi] === '*' &&\n                a[ai] &&\n                (this.options.dot || !a[ai].startsWith('.')) &&\n                a[ai] !== '**') {\n                if (which === 'a')\n                    return false;\n                which = 'b';\n                result.push(b[bi]);\n                ai++;\n                bi++;\n            }\n            else {\n                return false;\n            }\n        }\n        // if we fall out of the loop, it means they two are identical\n        // as long as their lengths match\n        return a.length === b.length && result;\n    }\n    parseNegate() {\n        if (this.nonegate)\n            return;\n        const pattern = this.pattern;\n        let negate = false;\n        let negateOffset = 0;\n        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n            negate = !negate;\n            negateOffset++;\n        }\n        if (negateOffset)\n            this.pattern = pattern.slice(negateOffset);\n        this.negate = negate;\n    }\n    // set partial to true to test if, for example,\n    // \"/a/b\" matches the start of \"/*/b/*/d\"\n    // Partial means, if you run out of file before you run\n    // out of pattern, then that's fine, as long as all\n    // the parts match.\n    matchOne(file, pattern, partial = false) {\n        let fileStartIndex = 0;\n        let patternStartIndex = 0;\n        // UNC paths like //?/X:/... can match X:/... and vice versa\n        // Drive letters in absolute drive or unc paths are always compared\n        // case-insensitively.\n        if (this.isWindows) {\n            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);\n            const fileUNC = !fileDrive &&\n                file[0] === '' &&\n                file[1] === '' &&\n                file[2] === '?' &&\n                /^[a-z]:$/i.test(file[3]);\n            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);\n            const patternUNC = !patternDrive &&\n                pattern[0] === '' &&\n                pattern[1] === '' &&\n                pattern[2] === '?' &&\n                typeof pattern[3] === 'string' &&\n                /^[a-z]:$/i.test(pattern[3]);\n            const fdi = fileUNC ? 3\n                : fileDrive ? 0\n                    : undefined;\n            const pdi = patternUNC ? 3\n                : patternDrive ? 0\n                    : undefined;\n            if (typeof fdi === 'number' && typeof pdi === 'number') {\n                const [fd, pd] = [\n                    file[fdi],\n                    pattern[pdi],\n                ];\n                // start matching at the drive letter index of each\n                if (fd.toLowerCase() === pd.toLowerCase()) {\n                    pattern[pdi] = fd;\n                    patternStartIndex = pdi;\n                    fileStartIndex = fdi;\n                }\n            }\n        }\n        // resolve and reduce . and .. portions in the file as well.\n        // don't need to do the second phase, because it's only one string[]\n        const { optimizationLevel = 1 } = this.options;\n        if (optimizationLevel >= 2) {\n            file = this.levelTwoFileOptimize(file);\n        }\n        if (pattern.includes(GLOBSTAR)) {\n            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);\n        }\n        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);\n    }\n    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {\n        // split the pattern into head, tail, and middle of ** delimited parts\n        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);\n        const lastgs = pattern.lastIndexOf(GLOBSTAR);\n        // split the pattern up into globstar-delimited sections\n        // the tail has to be at the end, and the others just have\n        // to be found in order from the head.\n        const [head, body, tail] = partial ?\n            [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1),\n                [],\n            ]\n            : [\n                pattern.slice(patternIndex, firstgs),\n                pattern.slice(firstgs + 1, lastgs),\n                pattern.slice(lastgs + 1),\n            ];\n        // check the head, from the current file/pattern index.\n        if (head.length) {\n            const fileHead = file.slice(fileIndex, fileIndex + head.length);\n            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n                return false;\n            }\n            fileIndex += head.length;\n            patternIndex += head.length;\n        }\n        // now we know the head matches!\n        // if the last portion is not empty, it MUST match the end\n        // check the tail\n        let fileTailMatch = 0;\n        if (tail.length) {\n            // if head + tail > file, then we cannot possibly match\n            if (tail.length + fileIndex > file.length)\n                return false;\n            // try to match the tail\n            let tailStart = file.length - tail.length;\n            if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n                fileTailMatch = tail.length;\n            }\n            else {\n                // affordance for stuff like a/**/* matching a/b/\n                // if the last file portion is '', and there's more to the pattern\n                // then try without the '' bit.\n                if (file[file.length - 1] !== '' ||\n                    fileIndex + tail.length === file.length) {\n                    return false;\n                }\n                tailStart--;\n                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n                    return false;\n                }\n                fileTailMatch = tail.length + 1;\n            }\n        }\n        // now we know the tail matches!\n        // the middle is zero or more portions wrapped in **, possibly\n        // containing more ** sections.\n        // so a/**/b/**/c/**/d has become **/b/**/c/**\n        // if it's empty, it means a/**/b, just verify we have no bad dots\n        // if there's no tail, so it ends on /**, then we must have *something*\n        // after the head, or it's not a matc\n        if (!body.length) {\n            let sawSome = !!fileTailMatch;\n            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n                const f = String(file[i]);\n                sawSome = true;\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            // in partial mode, we just need to get past all file parts\n            return partial || sawSome;\n        }\n        // now we know that there's one or more body sections, which can\n        // be matched anywhere from the 0 index (because the head was pruned)\n        // through to the length-fileTailMatch index.\n        // split the body up into sections, and note the minimum index it can\n        // be found at (start with the length of all previous segments)\n        // [section, before, after]\n        const bodySegments = [[[], 0]];\n        let currentBody = bodySegments[0];\n        let nonGsParts = 0;\n        const nonGsPartsSums = [0];\n        for (const b of body) {\n            if (b === GLOBSTAR) {\n                nonGsPartsSums.push(nonGsParts);\n                currentBody = [[], 0];\n                bodySegments.push(currentBody);\n            }\n            else {\n                currentBody[0].push(b);\n                nonGsParts++;\n            }\n        }\n        let i = bodySegments.length - 1;\n        const fileLength = file.length - fileTailMatch;\n        for (const b of bodySegments) {\n            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);\n        }\n        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);\n    }\n    // return false for \"nope, not matching\"\n    // return null for \"not matching, cannot keep trying\"\n    #matchGlobStarBodySections(file, \n    // pattern section, last possible position for it\n    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {\n        // take the first body segment, and walk from fileIndex to its \"after\"\n        // value at the end\n        // If it doesn't match at that position, we increment, until we hit\n        // that final possible position, and give up.\n        // If it does match, then advance and try to rest.\n        // If any of them fail we keep walking forward.\n        // this is still a bit recursively painful, but it's more constrained\n        // than previous implementations, because we never test something that\n        // can't possibly be a valid matching condition.\n        const bs = bodySegments[bodyIndex];\n        if (!bs) {\n            // just make sure that there's no bad dots\n            for (let i = fileIndex; i < file.length; i++) {\n                sawTail = true;\n                const f = file[i];\n                if (f === '.' ||\n                    f === '..' ||\n                    (!this.options.dot && f.startsWith('.'))) {\n                    return false;\n                }\n            }\n            return sawTail;\n        }\n        // have a non-globstar body section to test\n        const [body, after] = bs;\n        while (fileIndex <= after) {\n            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);\n            // if limit exceeded, no match. intentional false negative,\n            // acceptable break in correctness for security.\n            if (m && globStarDepth < this.maxGlobstarRecursion) {\n                // match! see if the rest match. if so, we're done!\n                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);\n                if (sub !== false) {\n                    return sub;\n                }\n            }\n            const f = file[fileIndex];\n            if (f === '.' ||\n                f === '..' ||\n                (!this.options.dot && f.startsWith('.'))) {\n                return false;\n            }\n            fileIndex++;\n        }\n        // walked off. no point continuing\n        return partial || null;\n    }\n    #matchOne(file, pattern, partial, fileIndex, patternIndex) {\n        let fi;\n        let pi;\n        let pl;\n        let fl;\n        for (fi = fileIndex,\n            pi = patternIndex,\n            fl = file.length,\n            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {\n            this.debug('matchOne loop');\n            let p = pattern[pi];\n            let f = file[fi];\n            this.debug(pattern, p, f);\n            // should be impossible.\n            // some invalid regexp stuff in the set.\n            /* c8 ignore start */\n            if (p === false || p === GLOBSTAR) {\n                return false;\n            }\n            /* c8 ignore stop */\n            // something other than **\n            // non-magic patterns just have to match exactly\n            // patterns with magic have been turned into regexps.\n            let hit;\n            if (typeof p === 'string') {\n                hit = f === p;\n                this.debug('string match', p, f, hit);\n            }\n            else {\n                hit = p.test(f);\n                this.debug('pattern match', p, f, hit);\n            }\n            if (!hit)\n                return false;\n        }\n        // Note: ending in / means that we'll get a final \"\"\n        // at the end of the pattern.  This can only match a\n        // corresponding \"\" at the end of the file.\n        // If the file ends in /, then it can only match a\n        // a pattern that ends in /, unless the pattern just\n        // doesn't have any more for it. But, a/b/ should *not*\n        // match \"a/b/*\", even though \"\" matches against the\n        // [^/]*? pattern, except in partial mode, where it might\n        // simply not be reached yet.\n        // However, a/b/ should still satisfy a/*\n        // now either we fell off the end of the pattern, or we're done.\n        if (fi === fl && pi === pl) {\n            // ran out of pattern and filename at the same time.\n            // an exact hit!\n            return true;\n        }\n        else if (fi === fl) {\n            // ran out of file, but still had pattern left.\n            // this is ok if we're doing the match as part of\n            // a glob fs traversal.\n            return partial;\n        }\n        else if (pi === pl) {\n            // ran out of pattern, still have file left.\n            // this is only acceptable if we're on the very last\n            // empty segment of a file with a trailing slash.\n            // a/* should match a/b/\n            return fi === fl - 1 && file[fi] === '';\n            /* c8 ignore start */\n        }\n        else {\n            // should be unreachable.\n            throw new Error('wtf?');\n        }\n        /* c8 ignore stop */\n    }\n    braceExpand() {\n        return braceExpand(this.pattern, this.options);\n    }\n    parse(pattern) {\n        assertValidPattern(pattern);\n        const options = this.options;\n        // shortcuts\n        if (pattern === '**')\n            return GLOBSTAR;\n        if (pattern === '')\n            return '';\n        // far and away, the most common glob pattern parts are\n        // *, *.*, and *.  Add a fast check method for those.\n        let m;\n        let fastTest = null;\n        if ((m = pattern.match(starRE))) {\n            fastTest = options.dot ? starTestDot : starTest;\n        }\n        else if ((m = pattern.match(starDotExtRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    starDotExtTestNocaseDot\n                    : starDotExtTestNocase\n                : options.dot ? starDotExtTestDot\n                    : starDotExtTest)(m[1]);\n        }\n        else if ((m = pattern.match(qmarksRE))) {\n            fastTest = (options.nocase ?\n                options.dot ?\n                    qmarksTestNocaseDot\n                    : qmarksTestNocase\n                : options.dot ? qmarksTestDot\n                    : qmarksTest)(m);\n        }\n        else if ((m = pattern.match(starDotStarRE))) {\n            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;\n        }\n        else if ((m = pattern.match(dotStarRE))) {\n            fastTest = dotStarTest;\n        }\n        const re = AST.fromGlob(pattern, this.options).toMMPattern();\n        if (fastTest && typeof re === 'object') {\n            // Avoids overriding in frozen environments\n            Reflect.defineProperty(re, 'test', { value: fastTest });\n        }\n        return re;\n    }\n    makeRe() {\n        if (this.regexp || this.regexp === false)\n            return this.regexp;\n        // at this point, this.set is a 2d array of partial\n        // pattern strings, or \"**\".\n        //\n        // It's better to use .match().  This function shouldn't\n        // be used, really, but it's pretty convenient sometimes,\n        // when you just want to work with a regex.\n        const set = this.set;\n        if (!set.length) {\n            this.regexp = false;\n            return this.regexp;\n        }\n        const options = this.options;\n        const twoStar = options.noglobstar ? star\n            : options.dot ? twoStarDot\n                : twoStarNoDot;\n        const flags = new Set(options.nocase ? ['i'] : []);\n        // regexpify non-globstar patterns\n        // if ** is only item, then we just do one twoStar\n        // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n        // if ** is last, append (\\/twoStar|) to previous\n        // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n        // then filter out GLOBSTAR symbols\n        let re = set\n            .map(pattern => {\n            const pp = pattern.map(p => {\n                if (p instanceof RegExp) {\n                    for (const f of p.flags.split(''))\n                        flags.add(f);\n                }\n                return (typeof p === 'string' ? regExpEscape(p)\n                    : p === GLOBSTAR ? GLOBSTAR\n                        : p._src);\n            });\n            pp.forEach((p, i) => {\n                const next = pp[i + 1];\n                const prev = pp[i - 1];\n                if (p !== GLOBSTAR || prev === GLOBSTAR) {\n                    return;\n                }\n                if (prev === undefined) {\n                    if (next !== undefined && next !== GLOBSTAR) {\n                        pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next;\n                    }\n                    else {\n                        pp[i] = twoStar;\n                    }\n                }\n                else if (next === undefined) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?';\n                }\n                else if (next !== GLOBSTAR) {\n                    pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next;\n                    pp[i + 1] = GLOBSTAR;\n                }\n            });\n            const filtered = pp.filter(p => p !== GLOBSTAR);\n            // For partial matches, we need to make the pattern match\n            // any prefix of the full path. We do this by generating\n            // alternative patterns that match progressively longer prefixes.\n            if (this.partial && filtered.length >= 1) {\n                const prefixes = [];\n                for (let i = 1; i <= filtered.length; i++) {\n                    prefixes.push(filtered.slice(0, i).join('/'));\n                }\n                return '(?:' + prefixes.join('|') + ')';\n            }\n            return filtered.join('/');\n        })\n            .join('|');\n        // need to wrap in parens if we had more than one thing with |,\n        // otherwise only the first will be anchored to ^ and the last to $\n        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];\n        // must match entire pattern\n        // ending in a * or ** will make it less strict.\n        re = '^' + open + re + close + '$';\n        // In partial mode, '/' should always match as it's a valid prefix for any pattern\n        if (this.partial) {\n            re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$';\n        }\n        // can match anything, as long as it's not this.\n        if (this.negate)\n            re = '^(?!' + re + ').+$';\n        try {\n            this.regexp = new RegExp(re, [...flags].join(''));\n            /* c8 ignore start */\n        }\n        catch {\n            // should be impossible\n            this.regexp = false;\n        }\n        /* c8 ignore stop */\n        return this.regexp;\n    }\n    slashSplit(p) {\n        // if p starts with // on windows, we preserve that\n        // so that UNC paths aren't broken.  Otherwise, any number of\n        // / characters are coalesced into one, unless\n        // preserveMultipleSlashes is set to true.\n        if (this.preserveMultipleSlashes) {\n            return p.split('/');\n        }\n        else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n            // add an extra '' for the one we lose\n            return ['', ...p.split(/\\/+/)];\n        }\n        else {\n            return p.split(/\\/+/);\n        }\n    }\n    match(f, partial = this.partial) {\n        this.debug('match', f, this.pattern);\n        // short-circuit in the case of busted things.\n        // comments, etc.\n        if (this.comment) {\n            return false;\n        }\n        if (this.empty) {\n            return f === '';\n        }\n        if (f === '/' && partial) {\n            return true;\n        }\n        const options = this.options;\n        // windows: need to use /, not \\\n        if (this.isWindows) {\n            f = f.split('\\\\').join('/');\n        }\n        // treat the test path as a set of pathparts.\n        const ff = this.slashSplit(f);\n        this.debug(this.pattern, 'split', ff);\n        // just ONE of the pattern sets in this.set needs to match\n        // in order for it to be valid.  If negating, then just one\n        // match means that we have failed.\n        // Either way, return on the first hit.\n        const set = this.set;\n        this.debug(this.pattern, 'set', set);\n        // Find the basename of the path by looking for the last non-empty segment\n        let filename = ff[ff.length - 1];\n        if (!filename) {\n            for (let i = ff.length - 2; !filename && i >= 0; i--) {\n                filename = ff[i];\n            }\n        }\n        for (const pattern of set) {\n            let file = ff;\n            if (options.matchBase && pattern.length === 1) {\n                file = [filename];\n            }\n            const hit = this.matchOne(file, pattern, partial);\n            if (hit) {\n                if (options.flipNegate) {\n                    return true;\n                }\n                return !this.negate;\n            }\n        }\n        // didn't get any hits.  this is success if it's a negative\n        // pattern, failure otherwise.\n        if (options.flipNegate) {\n            return false;\n        }\n        return this.negate;\n    }\n    static defaults(def) {\n        return minimatch.defaults(def).Minimatch;\n    }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js';\nexport { escape } from './escape.js';\nexport { unescape } from './unescape.js';\n/* c8 ignore stop */\nminimatch.AST = AST;\nminimatch.Minimatch = Minimatch;\nminimatch.escape = escape;\nminimatch.unescape = unescape;\n//# sourceMappingURL=index.js.map","import * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Helper class for parsing paths into segments\n */\nexport class Path {\n    /**\n     * Constructs a Path\n     * @param itemPath Path or array of segments\n     */\n    constructor(itemPath) {\n        this.segments = [];\n        // String\n        if (typeof itemPath === 'string') {\n            assert(itemPath, `Parameter 'itemPath' must not be empty`);\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n            // Not rooted\n            if (!pathHelper.hasRoot(itemPath)) {\n                this.segments = itemPath.split(path.sep);\n            }\n            // Rooted\n            else {\n                // Add all segments, while not at the root\n                let remaining = itemPath;\n                let dir = pathHelper.dirname(remaining);\n                while (dir !== remaining) {\n                    // Add the segment\n                    const basename = path.basename(remaining);\n                    this.segments.unshift(basename);\n                    // Truncate the last segment\n                    remaining = dir;\n                    dir = pathHelper.dirname(remaining);\n                }\n                // Remainder is the root\n                this.segments.unshift(remaining);\n            }\n        }\n        // Array\n        else {\n            // Must not be empty\n            assert(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);\n            // Each segment\n            for (let i = 0; i < itemPath.length; i++) {\n                let segment = itemPath[i];\n                // Must not be empty\n                assert(segment, `Parameter 'itemPath' must not contain any empty segments`);\n                // Normalize slashes\n                segment = pathHelper.normalizeSeparators(itemPath[i]);\n                // Root segment\n                if (i === 0 && pathHelper.hasRoot(segment)) {\n                    segment = pathHelper.safeTrimTrailingSeparator(segment);\n                    assert(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);\n                    this.segments.push(segment);\n                }\n                // All other segments\n                else {\n                    // Must not contain slash\n                    assert(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);\n                    this.segments.push(segment);\n                }\n            }\n        }\n    }\n    /**\n     * Converts the path to it's string representation\n     */\n    toString() {\n        // First segment\n        let result = this.segments[0];\n        // All others\n        let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n        for (let i = 1; i < this.segments.length; i++) {\n            if (skipSlash) {\n                skipSlash = false;\n            }\n            else {\n                result += path.sep;\n            }\n            result += this.segments[i];\n        }\n        return result;\n    }\n}\n//# sourceMappingURL=internal-path.js.map","import * as os from 'os';\nimport * as path from 'path';\nimport * as pathHelper from './internal-path-helper.js';\nimport assert from 'assert';\nimport { Minimatch } from 'minimatch';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Path } from './internal-path.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class Pattern {\n    constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) {\n        /**\n         * Indicates whether matches should be excluded from the result set\n         */\n        this.negate = false;\n        // Pattern overload\n        let pattern;\n        if (typeof patternOrNegate === 'string') {\n            pattern = patternOrNegate.trim();\n        }\n        // Segments overload\n        else {\n            // Convert to pattern\n            segments = segments || [];\n            assert(segments.length, `Parameter 'segments' must not empty`);\n            const root = Pattern.getLiteral(segments[0]);\n            assert(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);\n            pattern = new Path(segments).toString().trim();\n            if (patternOrNegate) {\n                pattern = `!${pattern}`;\n            }\n        }\n        // Negate\n        while (pattern.startsWith('!')) {\n            this.negate = !this.negate;\n            pattern = pattern.substr(1).trim();\n        }\n        // Normalize slashes and ensures absolute root\n        pattern = Pattern.fixupPattern(pattern, homedir);\n        // Segments\n        this.segments = new Path(pattern).segments;\n        // Trailing slash indicates the pattern should only match directories, not regular files\n        this.trailingSeparator = pathHelper\n            .normalizeSeparators(pattern)\n            .endsWith(path.sep);\n        pattern = pathHelper.safeTrimTrailingSeparator(pattern);\n        // Search path (literal path prior to the first glob segment)\n        let foundGlob = false;\n        const searchSegments = this.segments\n            .map(x => Pattern.getLiteral(x))\n            .filter(x => !foundGlob && !(foundGlob = x === ''));\n        this.searchPath = new Path(searchSegments).toString();\n        // Root RegExp (required when determining partial match)\n        this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : '');\n        this.isImplicitPattern = isImplicitPattern;\n        // Create minimatch\n        const minimatchOptions = {\n            dot: true,\n            nobrace: true,\n            nocase: IS_WINDOWS,\n            nocomment: true,\n            noext: true,\n            nonegate: true\n        };\n        pattern = IS_WINDOWS ? pattern.replace(/\\\\/g, '/') : pattern;\n        this.minimatch = new Minimatch(pattern, minimatchOptions);\n    }\n    /**\n     * Matches the pattern against the specified path\n     */\n    match(itemPath) {\n        // Last segment is globstar?\n        if (this.segments[this.segments.length - 1] === '**') {\n            // Normalize slashes\n            itemPath = pathHelper.normalizeSeparators(itemPath);\n            // Append a trailing slash. Otherwise Minimatch will not match the directory immediately\n            // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns\n            // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.\n            if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) {\n                // Note, this is safe because the constructor ensures the pattern has an absolute root.\n                // For example, formats like C: and C:foo on Windows are resolved to an absolute root.\n                itemPath = `${itemPath}${path.sep}`;\n            }\n        }\n        else {\n            // Normalize slashes and trim unnecessary trailing slash\n            itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        }\n        // Match\n        if (this.minimatch.match(itemPath)) {\n            return this.trailingSeparator ? MatchKind.Directory : MatchKind.All;\n        }\n        return MatchKind.None;\n    }\n    /**\n     * Indicates whether the pattern may match descendants of the specified path\n     */\n    partialMatch(itemPath) {\n        // Normalize slashes and trim unnecessary trailing slash\n        itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n        // matchOne does not handle root path correctly\n        if (pathHelper.dirname(itemPath) === itemPath) {\n            return this.rootRegExp.test(itemPath);\n        }\n        return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\\\+/ : /\\/+/), this.minimatch.set[0], true);\n    }\n    /**\n     * Escapes glob patterns within a path\n     */\n    static globEscape(s) {\n        return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n            .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n            .replace(/\\?/g, '[?]') // escape '?'\n            .replace(/\\*/g, '[*]'); // escape '*'\n    }\n    /**\n     * Normalizes slashes and ensures absolute root\n     */\n    static fixupPattern(pattern, homedir) {\n        // Empty\n        assert(pattern, 'pattern cannot be empty');\n        // Must not contain `.` segment, unless first segment\n        // Must not contain `..` segment\n        const literalSegments = new Path(pattern).segments.map(x => Pattern.getLiteral(x));\n        assert(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);\n        // Must not contain globs in root, e.g. Windows UNC path \\\\foo\\b*r\n        assert(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);\n        // Normalize slashes\n        pattern = pathHelper.normalizeSeparators(pattern);\n        // Replace leading `.` segment\n        if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) {\n            pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1);\n        }\n        // Replace leading `~` segment\n        else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {\n            homedir = homedir || os.homedir();\n            assert(homedir, 'Unable to determine HOME directory');\n            assert(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);\n            pattern = Pattern.globEscape(homedir) + pattern.substr(1);\n        }\n        // Replace relative drive root, e.g. pattern is C: or C:foo\n        else if (IS_WINDOWS &&\n            (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\\\]/i))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', pattern.substr(0, 2));\n            if (pattern.length > 2 && !root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(2);\n        }\n        // Replace relative root, e.g. pattern is \\ or \\foo\n        else if (IS_WINDOWS && (pattern === '\\\\' || pattern.match(/^\\\\[^\\\\]/))) {\n            let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', '\\\\');\n            if (!root.endsWith('\\\\')) {\n                root += '\\\\';\n            }\n            pattern = Pattern.globEscape(root) + pattern.substr(1);\n        }\n        // Otherwise ensure absolute root\n        else {\n            pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern);\n        }\n        return pathHelper.normalizeSeparators(pattern);\n    }\n    /**\n     * Attempts to unescape a pattern segment to create a literal path segment.\n     * Otherwise returns empty string.\n     */\n    static getLiteral(segment) {\n        let literal = '';\n        for (let i = 0; i < segment.length; i++) {\n            const c = segment[i];\n            // Escape\n            if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n                literal += segment[++i];\n                continue;\n            }\n            // Wildcard\n            else if (c === '*' || c === '?') {\n                return '';\n            }\n            // Character set\n            else if (c === '[' && i + 1 < segment.length) {\n                let set = '';\n                let closed = -1;\n                for (let i2 = i + 1; i2 < segment.length; i2++) {\n                    const c2 = segment[i2];\n                    // Escape\n                    if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n                        set += segment[++i2];\n                        continue;\n                    }\n                    // Closed\n                    else if (c2 === ']') {\n                        closed = i2;\n                        break;\n                    }\n                    // Otherwise\n                    else {\n                        set += c2;\n                    }\n                }\n                // Closed?\n                if (closed >= 0) {\n                    // Cannot convert\n                    if (set.length > 1) {\n                        return '';\n                    }\n                    // Convert to literal\n                    if (set) {\n                        literal += set;\n                        i = closed;\n                        continue;\n                    }\n                }\n                // Otherwise fall thru\n            }\n            // Append\n            literal += c;\n        }\n        return literal;\n    }\n    /**\n     * Escapes regexp special characters\n     * https://javascript.info/regexp-escaping\n     */\n    static regExpEscape(s) {\n        return s.replace(/[[\\\\^$.|?*+()]/g, '\\\\$&');\n    }\n}\n//# sourceMappingURL=internal-pattern.js.map","export class SearchState {\n    constructor(path, level) {\n        this.path = path;\n        this.level = level;\n    }\n}\n//# sourceMappingURL=internal-search-state.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\n    return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n    function fulfill(value) { resume(\"next\", value); }\n    function reject(value) { resume(\"throw\", value); }\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as globOptionsHelper from './internal-glob-options-helper.js';\nimport * as path from 'path';\nimport * as patternHelper from './internal-pattern-helper.js';\nimport { MatchKind } from './internal-match-kind.js';\nimport { Pattern } from './internal-pattern.js';\nimport { SearchState } from './internal-search-state.js';\nconst IS_WINDOWS = process.platform === 'win32';\nexport class DefaultGlobber {\n    constructor(options) {\n        this.patterns = [];\n        this.searchPaths = [];\n        this.options = globOptionsHelper.getOptions(options);\n    }\n    getSearchPaths() {\n        // Return a copy\n        return this.searchPaths.slice();\n    }\n    glob() {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a, e_1, _b, _c;\n            const result = [];\n            try {\n                for (var _d = true, _e = __asyncValues(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {\n                    _c = _f.value;\n                    _d = false;\n                    const itemPath = _c;\n                    result.push(itemPath);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            return result;\n        });\n    }\n    globGenerator() {\n        return __asyncGenerator(this, arguments, function* globGenerator_1() {\n            // Fill in defaults options\n            const options = globOptionsHelper.getOptions(this.options);\n            // Implicit descendants?\n            const patterns = [];\n            for (const pattern of this.patterns) {\n                patterns.push(pattern);\n                if (options.implicitDescendants &&\n                    (pattern.trailingSeparator ||\n                        pattern.segments[pattern.segments.length - 1] !== '**')) {\n                    patterns.push(new Pattern(pattern.negate, true, pattern.segments.concat('**')));\n                }\n            }\n            // Push the search paths\n            const stack = [];\n            for (const searchPath of patternHelper.getSearchPaths(patterns)) {\n                core.debug(`Search path '${searchPath}'`);\n                // Exists?\n                try {\n                    // Intentionally using lstat. Detection for broken symlink\n                    // will be performed later (if following symlinks).\n                    yield __await(fs.promises.lstat(searchPath));\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        continue;\n                    }\n                    throw err;\n                }\n                stack.unshift(new SearchState(searchPath, 1));\n            }\n            // Search\n            const traversalChain = []; // used to detect cycles\n            while (stack.length) {\n                // Pop\n                const item = stack.pop();\n                // Match?\n                const match = patternHelper.match(patterns, item.path);\n                const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path);\n                if (!match && !partialMatch) {\n                    continue;\n                }\n                // Stat\n                const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain)\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                );\n                // Broken symlink, or symlink cycle detected, or no longer exists\n                if (!stats) {\n                    continue;\n                }\n                // Hidden file or directory?\n                if (options.excludeHiddenFiles && path.basename(item.path).match(/^\\./)) {\n                    continue;\n                }\n                // Directory\n                if (stats.isDirectory()) {\n                    // Matched\n                    if (match & MatchKind.Directory && options.matchDirectories) {\n                        yield yield __await(item.path);\n                    }\n                    // Descend?\n                    else if (!partialMatch) {\n                        continue;\n                    }\n                    // Push the child items in reverse\n                    const childLevel = item.level + 1;\n                    const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new SearchState(path.join(item.path, x), childLevel));\n                    stack.push(...childItems.reverse());\n                }\n                // File\n                else if (match & MatchKind.File) {\n                    yield yield __await(item.path);\n                }\n            }\n        });\n    }\n    /**\n     * Constructs a DefaultGlobber\n     */\n    static create(patterns, options) {\n        return __awaiter(this, void 0, void 0, function* () {\n            const result = new DefaultGlobber(options);\n            if (IS_WINDOWS) {\n                patterns = patterns.replace(/\\r\\n/g, '\\n');\n                patterns = patterns.replace(/\\r/g, '\\n');\n            }\n            const lines = patterns.split('\\n').map(x => x.trim());\n            for (const line of lines) {\n                // Empty or comment\n                if (!line || line.startsWith('#')) {\n                    continue;\n                }\n                // Pattern\n                else {\n                    result.patterns.push(new Pattern(line));\n                }\n            }\n            result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns));\n            return result;\n        });\n    }\n    static stat(item, options, traversalChain) {\n        return __awaiter(this, void 0, void 0, function* () {\n            // Note:\n            // `stat` returns info about the target of a symlink (or symlink chain)\n            // `lstat` returns info about a symlink itself\n            let stats;\n            if (options.followSymbolicLinks) {\n                try {\n                    // Use `stat` (following symlinks)\n                    stats = yield fs.promises.stat(item.path);\n                }\n                catch (err) {\n                    if (err.code === 'ENOENT') {\n                        if (options.omitBrokenSymbolicLinks) {\n                            core.debug(`Broken symlink '${item.path}'`);\n                            return undefined;\n                        }\n                        throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);\n                    }\n                    throw err;\n                }\n            }\n            else {\n                // Use `lstat` (not following symlinks)\n                stats = yield fs.promises.lstat(item.path);\n            }\n            // Note, isDirectory() returns false for the lstat of a symlink\n            if (stats.isDirectory() && options.followSymbolicLinks) {\n                // Get the realpath\n                const realPath = yield fs.promises.realpath(item.path);\n                // Fixup the traversal chain to match the item level\n                while (traversalChain.length >= item.level) {\n                    traversalChain.pop();\n                }\n                // Test for a cycle\n                if (traversalChain.some((x) => x === realPath)) {\n                    core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);\n                    return undefined;\n                }\n                // Update the traversal chain\n                traversalChain.push(realPath);\n            }\n            return stats;\n        });\n    }\n}\n//# sourceMappingURL=internal-globber.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"stream\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n    var m = o[Symbol.asyncIterator], i;\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nimport * as crypto from 'crypto';\nimport * as core from '@actions/core';\nimport * as fs from 'fs';\nimport * as stream from 'stream';\nimport * as util from 'util';\nimport * as path from 'path';\nexport function hashFiles(globber_1, currentWorkspace_1) {\n    return __awaiter(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) {\n        var _a, e_1, _b, _c;\n        var _d;\n        const writeDelegate = verbose ? core.info : core.debug;\n        let hasMatch = false;\n        const githubWorkspace = currentWorkspace\n            ? currentWorkspace\n            : ((_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd());\n        const result = crypto.createHash('sha256');\n        let count = 0;\n        try {\n            for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {\n                _c = _g.value;\n                _e = false;\n                const file = _c;\n                writeDelegate(file);\n                if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {\n                    writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);\n                    continue;\n                }\n                if (fs.statSync(file).isDirectory()) {\n                    writeDelegate(`Skip directory '${file}'.`);\n                    continue;\n                }\n                const hash = crypto.createHash('sha256');\n                const pipeline = util.promisify(stream.pipeline);\n                yield pipeline(fs.createReadStream(file), hash);\n                result.write(hash.digest());\n                count++;\n                if (!hasMatch) {\n                    hasMatch = true;\n                }\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        result.end();\n        if (hasMatch) {\n            writeDelegate(`Found ${count} files to hash.`);\n            return result.digest('hex');\n        }\n        else {\n            writeDelegate(`No matches found for glob`);\n            return '';\n        }\n    });\n}\n//# sourceMappingURL=internal-hash-files.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { DefaultGlobber } from './internal-globber.js';\nimport { hashFiles as _hashFiles } from './internal-hash-files.js';\n/**\n * Constructs a globber\n *\n * @param patterns  Patterns separated by newlines\n * @param options   Glob options\n */\nexport function create(patterns, options) {\n    return __awaiter(this, void 0, void 0, function* () {\n        return yield DefaultGlobber.create(patterns, options);\n    });\n}\n/**\n * Computes the sha256 hash of a glob\n *\n * @param patterns  Patterns separated by newlines\n * @param currentWorkspace  Workspace used when matching files\n * @param options   Glob options\n * @param verbose   Enables verbose logging\n */\nexport function hashFiles(patterns_1) {\n    return __awaiter(this, arguments, void 0, function* (patterns, currentWorkspace = '', options, verbose = false) {\n        let followSymbolicLinks = true;\n        if (options && typeof options.followSymbolicLinks === 'boolean') {\n            followSymbolicLinks = options.followSymbolicLinks;\n        }\n        const globber = yield create(patterns, { followSymbolicLinks });\n        return _hashFiles(globber, currentWorkspace, verbose);\n    });\n}\n//# sourceMappingURL=glob.js.map","import { createReadStream } from 'node:fs'\nimport { basename, posix, relative, resolve, sep } from 'node:path'\nimport { Readable } from 'node:stream'\nimport * as core from '@actions/core'\nimport * as glob from '@actions/glob'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { StreamSource } from '@backblaze-labs/b2-sdk/streams'\nimport { tryStat } from '../fs.ts'\nimport {\n  type ParsedInputs,\n  requireSource,\n  uploadFileInfoTotalMaxBytes,\n  validateFileInfo,\n} from '../inputs.ts'\nimport { makeProgressListener } from '../progress.ts'\n\n/** One entry in {@link UploadResult.files}. */\nexport interface UploadedFile {\n  /** Absolute path on the runner that was uploaded. */\n  localPath: string\n  /** B2 file name (the key) the upload landed under. */\n  fileName: string\n  /** B2 file ID assigned by the server. */\n  fileId: string\n  /** Byte size of the upload. */\n  size: number\n  /** Whole-file SHA-1, or `null` when the file was multipart-uploaded. */\n  contentSha1: string | null\n  /**\n   * B2 fileInfo metadata for the uploaded object. This is the SDK-returned\n   * metadata when available; otherwise it falls back to the canonical metadata\n   * submitted in the upload request.\n   */\n  fileInfo: Record\n}\n\n/** Result of {@link uploadCommand}. */\nexport interface UploadResult {\n  /** One entry per uploaded file. Single-file mode returns a one-element array. */\n  files: UploadedFile[]\n  /** Total bytes uploaded across all files. */\n  bytesTransferred: number\n}\n\n/**\n * Upload one or more files to B2.\n *\n * Mode selection:\n *   - If `source` is a plain file path (no glob metacharacters and the path\n *     exists as a regular file), upload that single file. The B2 file name is\n *     `destination` if set; otherwise `basename(source)`.\n *   - Otherwise treat `source` (plus any `include` patterns) as glob(s). Each\n *     matched file is uploaded preserving its path relative to the glob root,\n *     prefixed by `destination` (default empty).\n *\n * Large files are streamed (StreamSource over a fs ReadStream-as-Web-Stream)\n * so we don't buffer the whole payload in RAM. The SDK's `Bucket.upload`\n * routes to multipart automatically when size exceeds the recommended part\n * size and parallelizes parts up to `concurrency`.\n */\nexport async function uploadCommand(\n  bucket: Bucket,\n  inputs: ParsedInputs,\n  signal?: AbortSignal,\n): Promise {\n  const source = requireSource(inputs.source, 'upload')\n\n  const { files, isSingleExplicitFile } = await resolveFiles(source, inputs.include, inputs.exclude)\n  if (files.length === 0) {\n    if (inputs.failOnEmpty) {\n      throw new Error(`No files matched: ${source}`)\n    }\n    core.warning(`No files matched: ${source}`)\n    return { files: [], bytesTransferred: 0 }\n  }\n\n  const fileConcurrency = isSingleExplicitFile ? 1 : inputs.concurrency\n  // Multi-file uploads spend the concurrency budget across files and keep each\n  // file's multipart upload sequential so total in-flight B2 requests remain\n  // bounded by the user-supplied `concurrency` value.\n  const partConcurrency = isSingleExplicitFile || files.length === 1 ? inputs.concurrency : 1\n\n  const uploadPlans = await mapWithConcurrency(files, fileConcurrency, async (f) => {\n    signal?.throwIfAborted()\n    return await prepareUploadPlan(f, inputs, isSingleExplicitFile)\n  })\n\n  const uploaded = await mapWithConcurrency(uploadPlans, fileConcurrency, async (plan) => {\n    signal?.throwIfAborted()\n    const uploadLabel = `upload ${plan.localPath} → b2://${bucket.name}/${plan.fileName}`\n    const groupedLog = uploadPlans.length === 1 || fileConcurrency === 1\n    if (groupedLog) {\n      core.startGroup(uploadLabel)\n    } else {\n      core.info(uploadLabel)\n    }\n    try {\n      return await uploadOne(bucket, plan, inputs, partConcurrency, groupedLog, signal)\n    } finally {\n      if (groupedLog) core.endGroup()\n    }\n  })\n  const totalBytes = uploaded.reduce((sum, file) => sum + file.size, 0)\n\n  return { files: uploaded, bytesTransferred: totalBytes }\n}\n\nasync function mapWithConcurrency(\n  items: T[],\n  concurrency: number,\n  mapper: (item: T) => Promise,\n): Promise {\n  const results = new Array(items.length)\n  let next = 0\n  let firstError: unknown\n  let failed = false\n\n  async function worker(): Promise {\n    while (true) {\n      if (failed) return\n      const index = next++\n      if (index >= items.length) return\n      try {\n        results[index] = await mapper(items[index] as T)\n      } catch (error) {\n        if (!failed) {\n          failed = true\n          firstError = error\n        }\n        return\n      }\n    }\n  }\n\n  const workerCount = Math.min(concurrency, items.length)\n  await Promise.all(Array.from({ length: workerCount }, () => worker()))\n  if (failed) throw firstError\n  return results\n}\n\ninterface ResolvedFiles {\n  files: ResolvedFile[]\n  isSingleExplicitFile: boolean\n}\n\n/**\n * Local file resolved from an upload source.\n *\n * @internal\n */\nexport interface ResolvedFile {\n  localPath: string\n  /** Path relative to the glob root, used when computing the B2 key. */\n  fileName: string\n  /** Byte size captured while resolving the upload source. */\n  size: number\n  /** Modification time captured while resolving the upload source. */\n  mtimeMs: number\n}\n\ninterface UploadPlan {\n  localPath: string\n  fileName: string\n  size: number\n  lastModifiedMillis: number | undefined\n  fileInfo: Record\n}\n\nasync function resolveFiles(\n  source: string,\n  include: string[],\n  exclude: string[],\n): Promise {\n  const explicitFile = await tryStat(source)\n  const looksLikeGlob = /[*?[\\]]/.test(source)\n\n  if (explicitFile?.isFile() && !looksLikeGlob && include.length === 0) {\n    return {\n      files: [\n        {\n          localPath: resolve(source),\n          fileName: basename(source),\n          size: explicitFile.size,\n          mtimeMs: explicitFile.mtimeMs,\n        },\n      ],\n      isSingleExplicitFile: true,\n    }\n  }\n\n  const patterns: string[] = []\n  if (explicitFile?.isDirectory()) {\n    patterns.push(`${resolve(source)}/**`)\n  } else {\n    patterns.push(source)\n  }\n  for (const p of include) patterns.push(p)\n  for (const p of exclude) patterns.push(`!${p}`)\n\n  const globber = await glob.create(patterns.join('\\n'), {\n    followSymbolicLinks: false,\n    matchDirectories: false,\n  })\n  const matches = await globber.glob()\n  const root = explicitFile?.isDirectory() ? resolve(source) : process.cwd()\n\n  const out: ResolvedFile[] = []\n  for (const m of matches) {\n    const s = await tryStat(m)\n    // Filesystem boundary: skip entries that aren't readable files (broken\n    // symlinks, races where a file is unlinked between glob and stat, etc.).\n    if (!s?.isFile()) continue\n    const rel = relative(root, m).split(sep).join(posix.sep)\n    out.push({ localPath: m, fileName: rel, size: s.size, mtimeMs: s.mtimeMs })\n  }\n  out.sort(compareResolvedFiles)\n  return { files: out, isSingleExplicitFile: false }\n}\n\nfunction compareResolvedFiles(a: ResolvedFile, b: ResolvedFile): number {\n  return compareStrings(a.fileName, b.fileName) || compareStrings(a.localPath, b.localPath)\n}\n\nfunction compareStrings(a: string, b: string): number {\n  if (a < b) return -1\n  if (a > b) return 1\n  return 0\n}\n\n/**\n * Map a local source file to its B2 file name under the requested destination.\n *\n * @internal\n */\nexport function remapFileName(\n  file: ResolvedFile,\n  destination: string | undefined,\n  isSingleExplicitFile: boolean,\n): string {\n  if (destination === undefined || destination === '') return file.fileName\n  const dest = destination.replace(/\\/+$/, '')\n  if (isSingleExplicitFile && !destination.endsWith('/')) return dest\n  return `${dest}/${file.fileName}`\n}\n\nasync function prepareUploadPlan(\n  file: ResolvedFile,\n  inputs: ParsedInputs,\n  isSingleExplicitFile: boolean,\n): Promise {\n  const size = file.size\n  const lastModifiedMillis = inputs.preserveMtime ? Math.trunc(file.mtimeMs) : undefined\n  const fileInfo = buildUploadFileInfo(inputs.fileInfo, lastModifiedMillis)\n  validateFileInfo(fileInfo, uploadFileInfoTotalMaxBytes(inputs.encryption))\n\n  return {\n    localPath: file.localPath,\n    fileName: remapFileName(file, inputs.destination, isSingleExplicitFile),\n    size,\n    lastModifiedMillis,\n    fileInfo,\n  }\n}\n\nasync function uploadOne(\n  bucket: Bucket,\n  plan: UploadPlan,\n  inputs: ParsedInputs,\n  partConcurrency: number,\n  groupedLog: boolean,\n  signal?: AbortSignal,\n): Promise {\n  const { fileInfo, fileName, lastModifiedMillis, localPath, size } = plan\n\n  // Stream the file from disk. The SDK's `bucket.upload` routes files larger\n  // than the recommended part size through `uploadLargeFile`, which now\n  // detects non-sliceable sources (StreamSource) and reads the stream once,\n  // shipping one part at a time. Peak memory ≈ partSize regardless of file\n  // size, so multi-GB uploads stay bounded.\n  const nodeStream = createReadStream(localPath)\n  const webStream = Readable.toWeb(nodeStream) as ReadableStream\n  const source = new StreamSource(webStream, size)\n\n  const onProgress = makeProgressListener(`upload[${fileName}]`)\n\n  // `inputs.resume` is parsed but deliberately NOT forwarded to the SDK.\n  // The SDK's resume implementation requires a sliceable source so it can\n  // re-upload specific part offsets after a crash. The action uses\n  // `StreamSource` (memory-bounded streaming from disk), which is read-once-\n  // sequential and not sliceable; passing `resume: true` here would throw\n  // `\"resume is not supported on non-sliceable sources\"`. The input is\n  // kept in the action surface so this can be re-enabled if the action\n  // ever offers a `BufferSource` fallback for users willing to trade RAM\n  // for resumability.\n  const result = await bucket.upload({\n    fileName,\n    source,\n    concurrency: partConcurrency,\n    ...(inputs.partSize !== undefined ? { partSize: inputs.partSize } : {}),\n    ...(inputs.contentType !== undefined ? { contentType: inputs.contentType } : {}),\n    ...(Object.keys(fileInfo).length > 0 ? { fileInfo } : {}),\n    ...(lastModifiedMillis !== undefined ? { lastModifiedMillis } : {}),\n    ...(inputs.encryption !== undefined ? { serverSideEncryption: inputs.encryption } : {}),\n    ...(signal !== undefined ? { signal } : {}),\n    onProgress,\n  })\n\n  // SDK now normalizes multipart `'none'` to `null` at the boundary, so\n  // `result.contentSha1` is `string | null` directly.\n  const sha1 = result.contentSha1\n  const detailPrefix = groupedLog ? '  ' : ''\n  core.info(`${detailPrefix}fileId=${result.fileId} sha1=${sha1 ?? 'multipart'}`)\n  const resultFileInfo = Object.keys(result.fileInfo).length > 0 ? result.fileInfo : fileInfo\n\n  return {\n    localPath,\n    fileName: result.fileName,\n    fileId: result.fileId,\n    size,\n    contentSha1: sha1,\n    fileInfo: resultFileInfo,\n  }\n}\n\nfunction buildUploadFileInfo(\n  inputFileInfo: Record,\n  lastModifiedMillis: number | undefined,\n): Record {\n  const fileInfo: Record = {}\n  for (const [key, value] of Object.entries(inputFileInfo)) {\n    const canonicalKey = key.toLowerCase()\n    if (Object.hasOwn(fileInfo, canonicalKey)) {\n      throw new Error(`Duplicate fileInfo key \"${key}\" from upload metadata`)\n    }\n    fileInfo[canonicalKey] = value\n  }\n  if (lastModifiedMillis !== undefined) {\n    if (Object.hasOwn(fileInfo, 'src_last_modified_millis')) {\n      throw new Error(\n        `Duplicate fileInfo key \"src_last_modified_millis\" from 'preserve-mtime' input`,\n      )\n    }\n    fileInfo.src_last_modified_millis = String(lastModifiedMillis)\n  }\n  return fileInfo\n}\n","import { createReadStream } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport type { Bucket } from '@backblaze-labs/b2-sdk'\nimport { IncrementalSha1 } from '@backblaze-labs/b2-sdk/streams'\nimport { type ParsedInputs, requireSource } from '../inputs.ts'\n\n/** Result of {@link verifyCommand}. */\nexport interface VerifyResult {\n  /** B2 file name that was checked. */\n  fileName: string\n  /** Server-reported byte size of the remote object. */\n  remoteSize: number\n  /**\n   * Remote SHA-1 result: normalized lowercase digest when comparable, raw B2\n   * value for non-comparable headers such as `none` or `unverified:`,\n   * or `null` when B2 does not expose one.\n   */\n  remoteSha1: string | null\n  /** Locally-computed SHA-1, or `null` if no local file was provided. */\n  localSha1: string | null\n  /** True when remote SHA-1 matches the expected value. */\n  verified: boolean\n  /** Human-readable failure reason; `undefined` on success. */\n  reason: string | undefined\n}\n\n/**\n * Verify that a B2 object matches a local file (or an expected SHA-1) without\n * transferring the body.\n *\n * Three modes, in priority order:\n *   1. `expected-sha1` input set → compare the remote object's SHA-1 to that\n *      literal value. No local read.\n *   2. `destination` input is an existing local file → compute that file's\n *      SHA-1 locally and compare to the remote.\n *   3. Neither → fail.\n *\n * In all modes, the remote SHA-1 is fetched via a HEAD request (header\n * `x-bz-content-sha1`). Large files uploaded via multipart return `null` from\n * B2 here because B2 stores the per-part SHA-1s but not a whole-file SHA-1;\n * HEAD-only verification cannot validate those objects, even when\n * `expected-sha1` is supplied.\n */\nexport async function verifyCommand(bucket: Bucket, inputs: ParsedInputs): Promise {\n  const source = requireSource(inputs.source, 'verify', 'the B2 file name')\n\n  core.startGroup(`verify b2://${bucket.name}/${source}`)\n  try {\n    // `bucket.head` returns only the parsed response headers; no body to\n    // drain. The SDK normalizes multipart `'none'` to `null` at the boundary.\n    const { headers } = await bucket.head(source)\n    const remoteSize = headers.contentLength\n    const remoteSha1 = headers.contentSha1\n\n    let localSha1: string | null = null\n    let expected: string | null =\n      inputs.expectedSha1 !== undefined ? normalizeSha1(inputs.expectedSha1, 'expected-sha1') : null\n\n    if (expected === null && inputs.destination !== undefined && inputs.destination !== '') {\n      localSha1 = await sha1OfFile(inputs.destination)\n      expected = normalizeSha1(localSha1, 'destination')\n    }\n\n    if (expected === null) {\n      throw new Error(\n        \"verify needs either 'expected-sha1' (literal) or 'destination' (local file path) to compare against\",\n      )\n    }\n\n    const normalizedRemoteSha1 = remoteSha1 === null ? null : normalizeRemoteSha1(remoteSha1)\n    if (normalizedRemoteSha1 === null) {\n      const reason = unavailableRemoteSha1Reason(remoteSha1)\n      core.warning(`  ${reason}`)\n      return {\n        fileName: source,\n        remoteSize,\n        remoteSha1,\n        localSha1,\n        verified: false,\n        reason,\n      }\n    }\n\n    const verified = normalizedRemoteSha1 === expected\n    const reason = verified\n      ? undefined\n      : `SHA-1 mismatch: remote=${normalizedRemoteSha1} expected=${expected}`\n    if (verified) {\n      core.info(`  ✓ SHA-1 matches (${normalizedRemoteSha1}), size=${remoteSize}B`)\n    } else {\n      core.warning(`  ${reason}`)\n    }\n\n    return {\n      fileName: source,\n      remoteSize,\n      remoteSha1: normalizedRemoteSha1,\n      localSha1,\n      verified,\n      reason,\n    }\n  } finally {\n    core.endGroup()\n  }\n}\n\n/**\n * Normalize and validate a SHA-1 digest for case-insensitive comparison.\n *\n * @internal\n */\nexport function normalizeSha1(raw: string, label = 'SHA-1'): string {\n  const normalized = raw.trim().toLowerCase()\n  if (!/^[a-f0-9]{40}$/.test(normalized)) {\n    throw new Error(`Invalid ${label}: expected a 40-character hexadecimal SHA-1 digest`)\n  }\n  return normalized\n}\n\nfunction normalizeRemoteSha1(raw: string): string | null {\n  const normalized = raw.trim().toLowerCase()\n  return /^[a-f0-9]{40}$/.test(normalized) ? normalized : null\n}\n\nfunction unavailableRemoteSha1Reason(remoteSha1: string | null): string {\n  if (remoteSha1 === null) {\n    return 'remote SHA-1 is unavailable because B2 does not expose a whole-file SHA-1 for multipart-uploaded files; HEAD-only verify cannot validate this object, even with expected-sha1'\n  }\n  return `remote SHA-1 is unavailable because B2 reported ${JSON.stringify(remoteSha1)} instead of a verified 40-character whole-file SHA-1; HEAD-only verify cannot validate this object, even with expected-sha1`\n}\n\nasync function sha1OfFile(path: string): Promise {\n  const fileStat = await stat(path)\n  if (!fileStat.isFile()) {\n    throw new Error(`verify: 'destination' must be an existing file, got: ${path}`)\n  }\n  const hasher = new IncrementalSha1()\n  const stream = createReadStream(path)\n  for await (const chunk of stream) {\n    await hasher.update(chunk as Uint8Array)\n  }\n  return hasher.digest()\n}\n","import {\n  AccessDeniedError,\n  B2Error,\n  B2InsufficientCapabilityError,\n  B2SsrfError,\n  BadAuthTokenError,\n  NetworkError,\n} from '@backblaze-labs/b2-sdk/errors'\nimport { ACTION_EFFECTS, type ActionName } from './inputs.ts'\n\nconst SAFE_RETRY_HINT = 'safe to retry this workflow.'\nconst DRY_RUN_RETRY_HINT = 'safe to retry this dry-run workflow.'\nconst MUTATING_RETRY_SUFFIX =\n  'action may have partially committed; inspect B2 state before rerunning to avoid duplicate file versions, orphaned large-file uploads, or unintended deletes.'\nconst UNKNOWN_RETRY_HINT =\n  'retry may be appropriate after checking whether the request had side effects.'\nconst SSRF_FAILURE_MESSAGE =\n  'B2 endpoint safety check failed: rejected an unsafe B2 endpoint or server-provided URL. Check the endpoint input and B2 realm configuration.'\nconst MAX_LOG_FIELD_LENGTH = 1_000\nconst MAX_LOG_INPUT_LENGTH = MAX_LOG_FIELD_LENGTH * 2\nconst MAX_SECRET_BOUNDARY_WINDOW = MAX_LOG_INPUT_LENGTH\nconst MAX_DERIVED_SECRET_LENGTH = 512\nconst DEFAULT_NETWORK_RETRY_AFTER_SECONDS = 30\nconst MAX_RETRY_AFTER_SECONDS = 3_600\nconst MAX_CAUSE_DEPTH = 32\n\nexport interface ActionErrorOptions {\n  action?: ActionName\n  dryRun?: boolean\n  secretValues?: readonly string[]\n}\n\nexport interface ClassifiedActionError {\n  message: string\n  retryable: boolean | undefined\n  retryAfter: number | undefined\n}\n\nexport function classifyActionError(\n  err: unknown,\n  options: ActionErrorOptions = {},\n): ClassifiedActionError {\n  // Order matters: specific SDK classes first, then retryable B2Error, then\n  // the generic B2Error fallback last so new subclasses are not shadowed.\n  if (hasSsrfCause(err)) {\n    return failure(SSRF_FAILURE_MESSAGE, false)\n  }\n  if (err instanceof BadAuthTokenError && isAuthorizationScopeFailure(err)) {\n    return failure(\n      `B2 permission denied: application key is missing required capabilities or is outside the bucket/prefix scope. Update the key capabilities or use a key scoped to this bucket/prefix. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof BadAuthTokenError) {\n    return failure(\n      `B2 authentication failed: check application-key-id and application-key, and confirm the key is active. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof B2InsufficientCapabilityError) {\n    const missing = err.missing.length > 0 ? err.missing.join(', ') : '(unknown)'\n    return failure(\n      `B2 permission denied: application key is missing required capabilities: ${sanitizeLogField(missing, options)}. Update the key capabilities or use a key scoped to this bucket/prefix.`,\n      false,\n    )\n  }\n  if (err instanceof AccessDeniedError) {\n    return failure(\n      `B2 permission denied: check application key capabilities, bucket access, and file name prefix restrictions. ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  if (err instanceof NetworkError) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient network error talking to B2: ${retry.hint} ${sanitizeLogField(err.message, options)}`,\n      retry.safe,\n      retry.safe ? DEFAULT_NETWORK_RETRY_AFTER_SECONDS : undefined,\n    )\n  }\n  if (err instanceof B2Error && err.retryable) {\n    const retry = retryPolicy(options)\n    return failure(\n      `Transient B2 error: ${retry.hint} ${formatB2Details(err, options)}`,\n      retry.safe,\n      retry.safe ? err.retryAfter : undefined,\n    )\n  }\n  if (err instanceof B2Error) {\n    return failure(\n      `B2 request failed: ${formatGenericB2Guidance(err, options)} ${formatB2Details(err, options)}`,\n      false,\n    )\n  }\n  const message = err instanceof Error ? err.message : String(err)\n  return failure(sanitizeLogField(message, options), undefined)\n}\n\nexport function formatActionDebugError(err: unknown, options: ActionErrorOptions = {}): string {\n  const message = err instanceof Error ? (err.stack ?? err.message) : String(err)\n  return sanitizeLogField(message, options)\n}\n\nfunction failure(\n  message: string,\n  retryable: boolean | undefined,\n  retryAfter?: number | undefined,\n): ClassifiedActionError {\n  return { message, retryable, retryAfter: normalizeRetryAfter(retryAfter) }\n}\n\nfunction formatB2Details(err: B2Error, options: ActionErrorOptions): string {\n  const details = [\n    `status ${sanitizeLogField(String(err.status), options)}`,\n    `code ${sanitizeLogField(err.code, options)}`,\n  ]\n  const retryAfter = normalizeRetryAfter(err.retryAfter)\n  if (retryAfter !== undefined) {\n    details.push(`retry after ${sanitizeLogField(String(retryAfter), options)}s`)\n  }\n  return `B2 response details: ${details.join(', ')}`\n}\n\nfunction formatGenericB2Guidance(err: B2Error, options: ActionErrorOptions): string {\n  const message = sanitizeLogField(err.message, options)\n  switch (err.code) {\n    case 'file_not_present':\n    case 'no_such_file':\n      return `File not found; check the bucket and file name. B2 said: ${message}.`\n    case 'duplicate_bucket_name':\n      return `Bucket name already exists; choose a unique bucket name. B2 said: ${message}.`\n    case 'cap_exceeded':\n    case 'storage_cap_exceeded':\n    case 'transaction_cap_exceeded':\n    case 'download_cap_exceeded':\n      return `B2 account cap was exceeded; reduce usage or wait before retrying. B2 said: ${message}.`\n    case 'bad_request':\n      return `Bad request; check the action inputs for invalid values. B2 said: ${message}.`\n    default:\n      return `B2 said: ${message}.`\n  }\n}\n\nfunction retryPolicy(options: ActionErrorOptions): { safe: boolean; hint: string } {\n  const { action } = options\n  if (action === undefined) return { safe: false, hint: UNKNOWN_RETRY_HINT }\n  const effect = ACTION_EFFECTS[action]\n  if (options.dryRun === true && effect.honorsDryRun) {\n    return { safe: true, hint: DRY_RUN_RETRY_HINT }\n  }\n  if (effect.kind === 'read') return { safe: true, hint: SAFE_RETRY_HINT }\n  return { safe: false, hint: `the ${action} ${MUTATING_RETRY_SUFFIX}` }\n}\n\nfunction isAuthorizationScopeFailure(err: BadAuthTokenError): boolean {\n  if (err.code !== 'unauthorized') return false\n  // The SDK currently exposes scoped-key `unauthorized` responses as\n  // BadAuthTokenError with only server prose to distinguish capability/scope\n  // misses. Keep this as best-effort until a structured subtype exists.\n  return /\\b(capability|capabilities|scope|bucket|prefix|permission|not authorized|unauthorized)\\b/i.test(\n    err.message,\n  )\n}\n\nfunction hasSsrfCause(err: unknown): boolean {\n  const seen = new Set()\n  let current: unknown = err\n  for (let depth = 0; current instanceof Error && depth < MAX_CAUSE_DEPTH; depth += 1) {\n    if (current instanceof B2SsrfError) return true\n    if (seen.has(current)) return false\n    seen.add(current)\n    current = current.cause\n  }\n  return false\n}\n\nfunction normalizeRetryAfter(retryAfter: number | undefined): number | undefined {\n  if (retryAfter === undefined || !Number.isFinite(retryAfter) || retryAfter < 0) return undefined\n  return Math.min(Math.ceil(retryAfter), MAX_RETRY_AFTER_SECONDS)\n}\n\nfunction sanitizeUntrustedText(value: string): string {\n  return value\n    .replace(/\\bhttps?:\\/\\/\\S+/gi, '[redacted-url]')\n    .replace(/\\bBearer\\s+[A-Za-z0-9._~+/=-]+/gi, 'Bearer ***')\n}\n\nfunction sanitizeLogField(value: string, options: ActionErrorOptions): string {\n  const secretValues = options.secretValues ?? []\n  const scrubInputLength =\n    secretValues.length > 0\n      ? MAX_LOG_INPUT_LENGTH + MAX_SECRET_BOUNDARY_WINDOW\n      : MAX_LOG_INPUT_LENGTH\n  const bounded = value.length > scrubInputLength ? value.slice(0, scrubInputLength) : value\n  const masked = maskSecrets(bounded, secretValues)\n  const scrubbed =\n    masked.length > MAX_LOG_INPUT_LENGTH ? masked.slice(0, MAX_LOG_INPUT_LENGTH) : masked\n  const sanitized = sanitizeUntrustedText(scrubbed)\n  if (sanitized.length <= MAX_LOG_FIELD_LENGTH) return sanitized\n  return `${sanitized.slice(0, MAX_LOG_FIELD_LENGTH)}... [truncated]`\n}\n\nfunction maskSecrets(value: string, secretValues: readonly string[]): string {\n  let masked = value\n  for (const secret of secretValues) {\n    for (const variant of secretVariants(secret)) {\n      masked = masked.split(variant).join('***')\n    }\n  }\n  return masked\n}\n\nfunction secretVariants(secret: string): string[] {\n  if (secret === '') return []\n  const variants = new Set()\n  addSecretVariant(variants, secret)\n  if (secret.length > MAX_LOG_INPUT_LENGTH) {\n    addSecretVariant(variants, secret.slice(0, MAX_LOG_INPUT_LENGTH))\n  }\n  if (secret.length >= 4 && secret.length <= MAX_DERIVED_SECRET_LENGTH) {\n    const base64 = Buffer.from(secret, 'utf8').toString('base64')\n    const base64Url = base64.replaceAll('+', '-').replaceAll('/', '_')\n    addUriEncodedSecretVariant(variants, secret)\n    addSecretVariant(variants, base64)\n    addSecretVariant(variants, base64Url)\n    addSecretVariant(variants, base64Url.replace(/=+$/u, ''))\n    addSecretVariant(variants, Buffer.from(secret, 'utf8').toString('hex'))\n  }\n  return [...variants].sort((a, b) => b.length - a.length)\n}\n\nfunction addSecretVariant(variants: Set, value: string): void {\n  if (value !== '') variants.add(value)\n}\n\nfunction addUriEncodedSecretVariant(variants: Set, secret: string): void {\n  try {\n    addSecretVariant(variants, encodeURIComponent(secret))\n  } catch {\n    // Malformed surrogate pairs are valid JavaScript strings but invalid URI\n    // components. Keep raw/base64/hex masking without letting scrubbing fail.\n  }\n}\n","import { Buffer } from 'node:buffer'\nimport * as core from '@actions/core'\n\nexport const SUMMARY_JSON_PREVIEW_MAX_ENTRIES = 100\nexport const SUMMARY_JSON_MAX_UTF8_BYTES = 256 * 1024\nconst SUMMARY_JSON_OUTPUT_NAME = 'summary-json'\nconst SUMMARY_JSON_TRUNCATED_OUTPUT_NAME = 'summary-json-truncated'\nexport const SUMMARY_JSON_NOTICE_OUTPUT_NAME = 'summary-json-notice'\nexport const SUMMARY_JSON_PREVIEW_OUTPUT_NAME = 'summary-json-preview'\n\nexport type SummaryJsonPayload = CompleteSummaryJsonPayload | TruncatedSummaryJsonPayload\n\nexport interface CompleteSummaryJsonPayload {\n  json: string\n  totalCount: number\n  truncated: false\n}\n\nexport interface TruncatedSummaryJsonPayload {\n  json: string\n  noticeJson: string\n  previewJson: string\n  totalCount: number\n  previewCount: number\n  reason: string\n  truncated: true\n}\n\nexport interface SummaryJsonOutputOptions {\n  item?: (item: T) => unknown\n}\n\ninterface BoundedJsonArray {\n  json: string\n  emittedCount: number\n  byteLimitExceeded: boolean\n  serializationFailed: boolean\n}\n\n/**\n * Serialize per-file command details into the bounded `summary-json` output.\n *\n * GitHub Actions writes outputs as UTF-8 and caps all action outputs for a job\n * at 1 MB. Keep this single structured output well below that job-level\n * budget so scalar outputs, $GITHUB_OUTPUT framing, and caller-defined outputs\n * still have room.\n *\n * `summary-json` remains a complete array when the full manifest fits. When a\n * result exceeds the supported byte cap, `summary-json` remains an array\n * (`[]`) rather than changing shape or carrying a partial manifest.\n * `summary-json-notice` receives a small JSON object describing the\n * truncation, `summary-json-preview` receives a bounded diagnostic prefix, and\n * `summary-json-truncated` is set to `true`. The action step may still succeed\n * because the B2 operation itself has already completed. Scalar count outputs\n * (`file-count`, `files-listed`, etc.) remain the authoritative totals.\n *\n * The serializer also omits credential-bearing field names for every command:\n * `url`, fields ending in `url`, and fields containing `authorization`,\n * `signature`, or `token` after case/underscore/hyphen normalization. Commands\n * that need to expose similarly named non-secret data should project it to an\n * explicit safe field name before calling this helper.\n */\nexport function buildSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): SummaryJsonPayload {\n  const serialized = serializeJsonArrayPrefix(items, options, items.length)\n  if (!serialized.byteLimitExceeded && !serialized.serializationFailed) {\n    return {\n      json: serialized.json,\n      totalCount: items.length,\n      truncated: false,\n    }\n  }\n\n  return buildTruncatedSummaryJsonPayload(\n    items,\n    options,\n    serialized.serializationFailed\n      ? 'summary-json could not be serialized within the supported output contract'\n      : 'summary-json exceeded the supported UTF-8 output size cap',\n  )\n}\n\nfunction buildTruncatedSummaryJsonPayload(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  reason: string,\n): TruncatedSummaryJsonPayload {\n  const preview = buildSummaryJsonPreview(items, options)\n\n  return {\n    json: '[]',\n    noticeJson: JSON.stringify({\n      truncated: true,\n      reason,\n      totalCount: items.length,\n      previewCount: preview.emittedCount,\n      previewOutput: SUMMARY_JSON_PREVIEW_OUTPUT_NAME,\n    }),\n    previewJson: preview.json,\n    totalCount: items.length,\n    previewCount: preview.emittedCount,\n    reason,\n    truncated: true,\n  }\n}\n\nfunction buildSummaryJsonPreview(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n): {\n  json: string\n  emittedCount: number\n} {\n  const preview = serializeJsonArrayPrefix(items, options, SUMMARY_JSON_PREVIEW_MAX_ENTRIES)\n  return { json: preview.json, emittedCount: preview.emittedCount }\n}\n\nexport function setSummaryJsonOutput(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions = {},\n): void {\n  const payload = buildSummaryJsonPayload(items, options)\n\n  core.setOutput(SUMMARY_JSON_TRUNCATED_OUTPUT_NAME, String(payload.truncated))\n  core.setOutput(SUMMARY_JSON_OUTPUT_NAME, payload.json)\n  if (!payload.truncated) {\n    return\n  }\n\n  core.setOutput(SUMMARY_JSON_NOTICE_OUTPUT_NAME, payload.noticeJson)\n  core.setOutput(SUMMARY_JSON_PREVIEW_OUTPUT_NAME, payload.previewJson)\n  core.warning(\n    `summary-json truncated: ${payload.reason}; preview contains ` +\n      `${payload.previewCount} of ${payload.totalCount} item(s). ` +\n      `summary-json is [] and summary-json-notice describes the truncation. ` +\n      `limit is ${formatKiB(SUMMARY_JSON_MAX_UTF8_BYTES)} of UTF-8 JSON text`,\n  )\n}\n\nfunction serializeJsonArrayPrefix(\n  items: readonly T[],\n  options: SummaryJsonOutputOptions,\n  maxEntries: number,\n): BoundedJsonArray {\n  const parts: string[] = ['[']\n  let bytes = 2\n  let emittedCount = 0\n  const count = Math.min(items.length, maxEntries)\n\n  for (let index = 0; index < count; index++) {\n    let itemJson: string\n    try {\n      itemJson = stringifyArrayItem(projectItem(items[index] as T, options))\n    } catch {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: false,\n        serializationFailed: true,\n      }\n    }\n\n    const separator = emittedCount === 0 ? '' : ','\n    const additionalBytes = utf8ByteLength(separator) + utf8ByteLength(itemJson)\n    if (bytes + additionalBytes > SUMMARY_JSON_MAX_UTF8_BYTES) {\n      parts.push(']')\n      return {\n        json: parts.join(''),\n        emittedCount,\n        byteLimitExceeded: true,\n        serializationFailed: false,\n      }\n    }\n\n    if (separator !== '') parts.push(separator)\n    parts.push(itemJson)\n    bytes += additionalBytes\n    emittedCount++\n  }\n\n  parts.push(']')\n  return {\n    json: parts.join(''),\n    emittedCount,\n    byteLimitExceeded: false,\n    serializationFailed: false,\n  }\n}\n\nfunction projectItem(item: T, options: SummaryJsonOutputOptions): unknown {\n  return options.item === undefined ? item : options.item(item)\n}\n\nfunction stringifyArrayItem(item: unknown): string {\n  const json = JSON.stringify(item, sensitiveSummaryJsonFieldReplacer)\n  return json === undefined ? 'null' : json\n}\n\nfunction sensitiveSummaryJsonFieldReplacer(key: string, value: unknown): unknown {\n  return key !== '' && isSensitiveSummaryJsonField(key) ? undefined : value\n}\n\nfunction isSensitiveSummaryJsonField(key: string): boolean {\n  const normalized = key.replaceAll('-', '').replaceAll('_', '').toLowerCase()\n  return (\n    normalized === 'url' ||\n    normalized.endsWith('url') ||\n    normalized.includes('authorization') ||\n    normalized.includes('signature') ||\n    normalized.includes('token')\n  )\n}\n\nfunction utf8ByteLength(value: string): number {\n  return Buffer.byteLength(value, 'utf8')\n}\n\nfunction formatKiB(bytes: number): string {\n  return `${Math.floor(bytes / 1024)} KiB`\n}\n","import { appendFile } from 'node:fs/promises'\nimport * as core from '@actions/core'\nimport { formatBytes } from './format.ts'\n\n/** Maximum per-file rows rendered in a GitHub Actions step summary table. */\nexport const STEP_SUMMARY_MAX_ROWS = 100\n\n/**\n * One row in the `$GITHUB_STEP_SUMMARY` table emitted by a verb. Only\n * `fileName` is required; the other cells render empty when omitted.\n */\nexport interface SummaryRow {\n  /** B2 file name or display label (e.g. `(uploaded)`, `(removed)`). */\n  fileName: string\n  /** Byte size of the file. Rendered via {@link formatBytes}. */\n  size?: number | undefined\n  /** B2 file ID (rendered as inline code). */\n  fileId?: string | undefined\n  /** Content SHA-1. Truncated to 12 chars in the table for readability. */\n  sha1?: string | null | undefined\n  /** Free-form status cell (e.g. `uploaded`, `would delete`, `deleted`). */\n  status?: string | undefined\n}\n\n/**\n * Append a markdown summary block to `$GITHUB_STEP_SUMMARY`. No-ops when\n * the env var is unset (e.g. running the bundle locally for a smoke test).\n *\n * @param opts.title - Heading rendered as `## {title}`.\n * @param opts.rows - One row per file. Empty rows render an empty table body.\n * @param opts.totals - Optional aggregate line printed above the table.\n * @param opts.totalRows - Optional source row count when callers pre-slice rows.\n */\nexport async function writeStepSummary(opts: {\n  title: string\n  rows: readonly SummaryRow[]\n  totals?: { files: number; bytes: number } | undefined\n  totalRows?: number | undefined\n}): Promise {\n  const path = process.env.GITHUB_STEP_SUMMARY\n  if (!path) return\n\n  // Keep the writer defensive for direct callers even though dispatcher\n  // call sites pre-slice rows to avoid mapping very large result sets.\n  const rows = opts.rows.slice(0, STEP_SUMMARY_MAX_ROWS)\n  const totalRows = opts.totalRows ?? opts.rows.length\n  const lines: string[] = []\n  lines.push(`## ${opts.title}`)\n  lines.push('')\n\n  if (opts.totals !== undefined) {\n    lines.push(`**${opts.totals.files}** files, **${formatBytes(opts.totals.bytes)}** total.`)\n    lines.push('')\n  }\n\n  if (totalRows > rows.length) {\n    lines.push(`Showing first ${rows.length} of ${totalRows} rows.`)\n    lines.push('')\n  }\n\n  if (rows.length > 0) {\n    lines.push('| File | Size | File ID | SHA-1 | Status |')\n    lines.push('|------|------|---------|-------|--------|')\n    for (const r of rows) {\n      lines.push(\n        `| ${inlineCodeCell(r.fileName)} | ${r.size !== undefined ? formatBytes(r.size) : ''} | ${\n          r.fileId !== undefined ? inlineCodeCell(r.fileId) : ''\n        } | ${r.sha1 != null ? `\\`${r.sha1.slice(0, 12)}…\\`` : ''} | ${\n          r.status !== undefined ? inlineCodeCell(r.status) : ''\n        } |`,\n      )\n    }\n  }\n\n  lines.push('')\n\n  try {\n    await appendFile(path, `${lines.join('\\n')}\\n`)\n  } catch (err) {\n    // $GITHUB_STEP_SUMMARY might point at an unwritable path (e.g. a\n    // directory, or a file the runner lacks permission to extend). The\n    // summary is informational; degrading to a warning is better than\n    // failing an otherwise-successful step.\n    core.warning(`Failed to write step summary: ${(err as Error).message}`)\n  }\n}\n\nfunction inlineCodeCell(value: string): string {\n  return `${escapeHtml(value).replaceAll('|', '|')}`\n}\n\nfunction escapeHtml(value: string): string {\n  // Single-pass escape so correctness never depends on replace ordering\n  // (a chained version must escape '&' first or it would re-escape '<').\n  const map = { '&': '&', '<': '<', '>': '>' } as const\n  return value.replace(/[&<>]/g, (ch) => map[ch as keyof typeof map])\n}\n","import { realpathSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport * as core from '@actions/core'\nimport { buildClient, getBucket } from './client.ts'\nimport { copyCommand } from './commands/copy.ts'\nimport { deleteCommand } from './commands/delete.ts'\nimport { downloadCommand } from './commands/download.ts'\nimport { headCommand } from './commands/head.ts'\nimport { hideCommand } from './commands/hide.ts'\nimport { listCommand } from './commands/list.ts'\nimport { type PresignedFile, presignCommand } from './commands/presign.ts'\nimport { purgeCommand } from './commands/purge.ts'\nimport { retentionCommand } from './commands/retention.ts'\nimport { summarizeSyncErrors, syncCommand } from './commands/sync.ts'\nimport { unhideCommand } from './commands/unhide.ts'\nimport { uploadCommand } from './commands/upload.ts'\nimport { verifyCommand } from './commands/verify.ts'\nimport { classifyActionError, formatActionDebugError } from './errors.ts'\nimport { collectInputSecretsForScrubbing, type ParsedInputs, parseInputs } from './inputs.ts'\nimport { setSummaryJsonOutput } from './outputs.ts'\nimport { STEP_SUMMARY_MAX_ROWS, type SummaryRow, writeStepSummary } from './summary.ts'\n\n/**\n * Action entrypoint. Parses inputs, builds an authorized B2Client, dispatches\n * to the requested subcommand, and writes structured outputs back via\n * `core.setOutput`. Any thrown error is reported through `core.setFailed`\n * so the workflow step surfaces with a clear message and a non-zero exit.\n *\n * Each command path also publishes a `$GITHUB_STEP_SUMMARY` markdown block so\n * the run's summary page shows a per-file table without scrolling through the\n * live log.\n */\nexport async function run(): Promise {\n  // Wire workflow-cancellation signals (`SIGTERM` when the user cancels the\n  // job or a sibling fails fast; `SIGINT` for Ctrl+C in local dev) to an\n  // AbortController that long-running SDK operations subscribe to. Aborting\n  // mid-upload lets the SDK cancel in-flight multipart sessions cleanly\n  // rather than leaving them dangling for the user to pay storage on.\n  const controller = new AbortController()\n  const onSignal = (sig: NodeJS.Signals) => {\n    core.warning(`Received ${sig}; cancelling in-flight B2 operations.`)\n    controller.abort(new Error(`${sig} received`))\n  }\n  const onSigterm = () => onSignal('SIGTERM')\n  const onSigint = () => onSignal('SIGINT')\n  process.once('SIGTERM', onSigterm)\n  process.once('SIGINT', onSigint)\n  const signal = controller.signal\n  let action: ParsedInputs['action'] | undefined\n  let dryRun: boolean | undefined\n  const secretValues: string[] = []\n\n  try {\n    // These values are a defensive formatter scrub list for parser and\n    // dispatcher-scope credentials and tokens. Command-level secrets such as\n    // presigned URLs are masked at the command site with core.setSecret. Any\n    // SDK free-form B2 messages that reach failure output are sanitized in\n    // errors.ts.\n    secretValues.push(...collectInputSecretsForScrubbing())\n    const inputs = parseInputs()\n    action = inputs.action\n    dryRun = inputs.dryRun\n\n    const authorized = await buildClient({\n      applicationKeyId: inputs.applicationKeyId,\n      applicationKey: inputs.applicationKey,\n      bucket: inputs.bucket,\n      ...(inputs.endpoint !== undefined ? { endpoint: inputs.endpoint } : {}),\n    })\n    const authToken = authorized.client.accountInfo.getAuthToken()\n    if (authToken) registerSecretValue(secretValues, authToken)\n    const bucket = await getBucket(authorized)\n\n    switch (inputs.action) {\n      case 'upload': {\n        const result = await uploadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-id', first.fileId)\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-uploaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`uploaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: upload',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: 'uploaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'download': {\n        const result = await downloadCommand(bucket, inputs, signal)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('file-name', first.fileName)\n          if (first.contentSha1 !== null) core.setOutput('content-sha1', first.contentSha1)\n        }\n        core.setOutput('files-downloaded', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        core.info(`downloaded ${result.files.length} file(s), ${result.bytesTransferred} bytes`)\n        await writeStepSummary({\n          title: 'Backblaze B2: download',\n          totals: { files: result.files.length, bytes: result.bytesTransferred },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            sha1: f.contentSha1,\n            status: 'downloaded',\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'sync': {\n        const result = await syncCommand(bucket, inputs, signal)\n        core.setOutput('files-uploaded', String(result.uploaded))\n        core.setOutput('files-downloaded', String(result.downloaded))\n        core.setOutput('files-deleted', String(result.deleted))\n        setFileCountOutput(result.uploaded + result.downloaded + result.deleted + result.skipped)\n        core.setOutput('bytes-transferred', String(result.bytesTransferred))\n        setSummaryJsonOutput(result.events)\n        if (result.errors > 0) {\n          const sample = summarizeSyncErrors(result.events)\n          throw new Error(`Sync completed with ${result.errors} error(s): ${sample}`)\n        }\n        const syncTitlePrefix = inputs.dryRun\n          ? 'Backblaze B2: sync (dry-run)'\n          : 'Backblaze B2: sync'\n        await writeStepSummary({\n          title: `${syncTitlePrefix} [${result.direction}]`,\n          totals: {\n            files: result.uploaded + result.downloaded + result.deleted,\n            bytes: result.bytesTransferred,\n          },\n          rows: [\n            {\n              fileName: '(uploaded)',\n              size: result.direction === 'local-to-b2' ? result.bytesTransferred : 0,\n              status: String(result.uploaded),\n            },\n            {\n              fileName: '(downloaded)',\n              size: result.direction === 'b2-to-local' ? result.bytesTransferred : 0,\n              status: String(result.downloaded),\n            },\n            { fileName: '(removed)', status: String(result.deleted) },\n            { fileName: '(unchanged)', status: String(result.skipped) },\n          ],\n        })\n        return\n      }\n      case 'copy': {\n        const result = await copyCommand(authorized.client, bucket, inputs, signal)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.destinationFileName)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', String(result.size))\n        await writeStepSummary({\n          title: 'Backblaze B2: copy',\n          rows: [\n            {\n              fileName: `b2://${result.sourceBucket}/${result.sourceFileName} → b2://${result.destinationBucket}/${result.destinationFileName}`,\n              size: result.size,\n              fileId: result.fileId,\n              status: 'copied (server-side)',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'delete': {\n        const result = await deleteCommand(bucket, inputs, signal)\n        await emitDeletionSummary('delete', result, inputs)\n        return\n      }\n      case 'presign': {\n        const result = await presignCommand(authorized.client, bucket, inputs)\n        const first = result.files[0]\n        if (first !== undefined) {\n          core.setOutput('presigned-url', first.url)\n          core.setOutput('file-name', first.fileName)\n        }\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        await writeStepSummary({\n          title: `Backblaze B2: presign (${result.files.length})`,\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            status: `expires at ${new Date(f.expiresAt * 1000).toISOString()}`,\n          })),\n        })\n        setSummaryJsonOutput(result.files, { item: presignSummaryItem })\n        return\n      }\n      case 'list': {\n        const result = await listCommand(bucket, inputs)\n        core.setOutput('files-listed', String(result.files.length))\n        setFileCountOutput(result.files.length)\n        if (result.truncated) {\n          core.warning(\n            `list result truncated at max-results=${inputs.maxResults}; raise it to see more`,\n          )\n        }\n        await writeStepSummary({\n          title: `Backblaze B2: list (${result.files.length}${result.truncated ? '+' : ''})`,\n          totals: {\n            files: result.files.length,\n            bytes: result.files.reduce((s, f) => s + f.size, 0),\n          },\n          ...stepSummaryRows(result.files, (f) => ({\n            fileName: f.fileName,\n            size: f.size,\n            fileId: f.fileId,\n            sha1: f.contentSha1,\n            status: f.contentType,\n          })),\n        })\n        setSummaryJsonOutput(result.files)\n        return\n      }\n      case 'hide': {\n        const result = await hideCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: hide',\n          rows: [{ fileName: result.fileName, fileId: result.fileId, status: 'hidden' }],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'unhide': {\n        const result = await unhideCommand(bucket, inputs)\n        core.setOutput('file-name', result.fileName)\n        if (result.removedMarkerFileId !== null) {\n          core.setOutput('file-id', result.removedMarkerFileId)\n        }\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: unhide',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.removedMarkerFileId ?? undefined,\n              status: result.removedMarkerFileId === null ? 'no-op (not hidden)' : 'unhidden',\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'verify': {\n        const result = await verifyCommand(bucket, inputs)\n        core.setOutput('verified', String(result.verified))\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        if (result.remoteSha1 !== null) core.setOutput('remote-sha1', result.remoteSha1)\n        if (result.localSha1 !== null) core.setOutput('local-sha1', result.localSha1)\n        await writeStepSummary({\n          title: result.verified ? 'Backblaze B2: verify ✓' : 'Backblaze B2: verify ✗',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.remoteSize,\n              sha1: result.remoteSha1,\n              status: result.verified ? 'matches' : (result.reason ?? 'mismatch'),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        if (!result.verified) {\n          throw new Error(result.reason ?? 'verify failed: SHA-1 mismatch')\n        }\n        return\n      }\n      case 'retention': {\n        const result = await retentionCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        setFileCountOutput(1)\n        await writeStepSummary({\n          title: 'Backblaze B2: retention',\n          rows: [\n            {\n              fileName: result.fileName,\n              fileId: result.fileId,\n              status: retentionStatusLine(result),\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'head': {\n        const result = await headCommand(bucket, inputs)\n        core.setOutput('file-id', result.fileId)\n        core.setOutput('file-name', result.fileName)\n        if (result.contentSha1 !== null) core.setOutput('content-sha1', result.contentSha1)\n        setFileCountOutput(1)\n        core.setOutput('bytes-transferred', '0')\n        await writeStepSummary({\n          title: 'Backblaze B2: head',\n          rows: [\n            {\n              fileName: result.fileName,\n              size: result.size,\n              fileId: result.fileId,\n              sha1: result.contentSha1,\n              status: result.contentType,\n            },\n          ],\n        })\n        setSummaryJsonOutput([result])\n        return\n      }\n      case 'purge': {\n        const result = await purgeCommand(bucket, inputs, signal)\n        await emitDeletionSummary('purge', result, inputs)\n        return\n      }\n    }\n  } catch (err) {\n    const failure = classifyActionError(err, {\n      ...(action !== undefined ? { action } : {}),\n      ...(dryRun !== undefined ? { dryRun } : {}),\n      secretValues,\n    })\n    core.debug(formatActionDebugError(err, { secretValues }))\n    if (failure.retryable !== undefined) core.setOutput('retryable', String(failure.retryable))\n    if (failure.retryAfter !== undefined) core.setOutput('retry-after', String(failure.retryAfter))\n    core.setFailed(failure.message)\n  } finally {\n    process.off('SIGTERM', onSigterm)\n    process.off('SIGINT', onSigint)\n  }\n}\n\n/**\n * Checks whether this module is the process entrypoint.\n *\n * @param metaUrl - The current module URL from `import.meta.url`.\n * @param argv1 - The executable script path from `process.argv[1]`.\n * @returns `true` when the current module path matches the invoked script.\n */\nexport function isEntrypoint(metaUrl: string, argv1: string | undefined): boolean {\n  if (argv1 === undefined) return false\n  try {\n    return realpathSync(fileURLToPath(metaUrl)) === realpathSync(resolve(argv1))\n  } catch {\n    return false\n  }\n}\n\n/**\n * Shared output-emission + step-summary for the two deletion verbs.\n * `delete` and `purge` returned-shape and dispatcher-side handling are\n * structurally identical (filter into actually-deleted vs would-delete,\n * set the same outputs, render the same capped row table); they differ only\n * in the verb label and the per-row status string.\n */\nasync function emitDeletionSummary(\n  verb: 'delete' | 'purge',\n  result: {\n    files: { fileName: string; fileId: string; skipped: boolean }[]\n    errors: number\n  },\n  inputs: ParsedInputs,\n): Promise {\n  const actuallyDeleted = result.files.filter((f) => !f.skipped).length\n  const wouldDelete = result.files.filter((f) => f.skipped).length\n  core.setOutput('files-deleted', String(actuallyDeleted))\n  setFileCountOutput(result.files.length)\n  setSummaryJsonOutput(result.files)\n  if (result.errors > 0) {\n    const labels = { delete: 'Delete', purge: 'Purge' } as const\n    throw new Error(`${labels[verb]} completed with ${result.errors} error(s)`)\n  }\n  const past = verb === 'delete' ? 'deleted' : 'purged'\n  const future = verb === 'delete' ? 'would delete' : 'would purge'\n  await writeStepSummary({\n    title: inputs.dryRun ? `Backblaze B2: ${verb} (dry-run)` : `Backblaze B2: ${verb}`,\n    totals: { files: actuallyDeleted + wouldDelete, bytes: 0 },\n    ...stepSummaryRows(result.files, (f) => ({\n      fileName: f.fileName,\n      fileId: f.fileId,\n      status: f.skipped ? future : past,\n    })),\n  })\n}\n\nfunction stepSummaryRows(\n  items: readonly T[],\n  row: (item: T) => SummaryRow,\n): { rows: SummaryRow[]; totalRows?: number } {\n  // Pre-slice here to avoid mapping very large result sets; writeStepSummary\n  // keeps its own defensive cap for direct callers.\n  const rows = items.slice(0, STEP_SUMMARY_MAX_ROWS).map(row)\n  return rows.length < items.length ? { rows, totalRows: items.length } : { rows }\n}\n\nfunction presignSummaryItem(file: PresignedFile): Pick {\n  return { fileName: file.fileName, expiresAt: file.expiresAt }\n}\n\nfunction setFileCountOutput(count: number): void {\n  core.setOutput('file-count', String(count))\n}\n\nfunction registerSecretValue(secretValues: string[], value: string): void {\n  const trimmed = value.trim()\n  for (const secret of [value, trimmed]) {\n    if (secret === '' || secretValues.includes(secret)) continue\n    core.setSecret(secret)\n    secretValues.push(secret)\n  }\n}\n\nfunction retentionStatusLine(result: {\n  appliedMode: 'compliance' | 'governance' | 'none' | undefined\n  retainUntilTimestamp: number | null | undefined\n  appliedLegalHold: 'on' | 'off' | undefined\n}): string {\n  const parts: string[] = [`mode=${result.appliedMode ?? '-'}`]\n  if (result.retainUntilTimestamp != null) {\n    parts.push(`until=${new Date(result.retainUntilTimestamp).toISOString()}`)\n  }\n  if (result.appliedLegalHold !== undefined) {\n    parts.push(`legal-hold=${result.appliedLegalHold}`)\n  }\n  return parts.join(' ')\n}\n\nif (isEntrypoint(import.meta.url, process.argv[1])) {\n  void run()\n}\n"],"names":[],"sourceRoot":""}
\ No newline at end of file